Repository: Canner/WrenAI Branch: main Commit: eea642fde8e2 Files: 778 Total size: 8.0 MB Directory structure: gitextract_1iqodypf/ ├── .claude/ │ ├── CLAUDE.md │ └── settings.json ├── .editorconfig ├── .github/ │ ├── ISSUE_TEMPLATE/ │ │ ├── bug_report.md │ │ └── feature_request.md │ ├── dependabot.yaml │ └── workflows/ │ ├── ai-service-release-image.yaml │ ├── ai-service-release-nightly-image.yaml │ ├── ai-service-release-stable-image.yaml │ ├── ai-service-test.yaml │ ├── create-rc-release-pr.yaml │ ├── create-rc-release.yaml │ ├── pr-tagger.yaml │ ├── pull-request-title-validator.yaml │ ├── ui-lint.yaml │ ├── ui-release-image-stable.yaml │ ├── ui-release-image.yaml │ ├── ui-test.yaml │ └── wren-launcher-ci.yaml ├── .gitignore ├── .gitmodules ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── SECURITY.md ├── deployment/ │ ├── README.md │ └── kustomizations/ │ ├── .gitignore │ ├── README.md │ ├── base/ │ │ ├── cm.yaml │ │ ├── deploy-wren-ai-service.yaml │ │ ├── deploy-wren-engine.yaml │ │ ├── deploy-wren-ibis-server.yaml │ │ ├── deploy-wren-ui.yaml │ │ ├── pvc.yaml │ │ └── svc.yaml │ ├── examples/ │ │ ├── .gitignore │ │ ├── certificate-qdrant_example.yaml │ │ ├── certificate-wren_example.yaml │ │ ├── ingress-wren_example.yaml │ │ └── secret-wren_example.yaml │ ├── helm-values-qdrant_1.11.0.yaml │ ├── helm-values_postgresql_15.yaml │ ├── kustomization.yaml │ └── patches/ │ ├── README.md │ ├── cm.yaml │ ├── rm-certificate.yaml │ ├── rm-ingress.yaml │ └── service.yaml ├── docker/ │ ├── README.md │ ├── bootstrap/ │ │ ├── Dockerfile │ │ └── init.sh │ ├── config.example.yaml │ ├── docker-compose-dev.yaml │ └── docker-compose.yaml ├── wren-ai-service/ │ ├── .dockerignore │ ├── .pre-commit-config.yaml │ ├── CONTRIBUTING.md │ ├── Justfile │ ├── README.md │ ├── docker/ │ │ └── Dockerfile │ ├── docs/ │ │ ├── code_design.md │ │ ├── config_examples/ │ │ │ ├── README.md │ │ │ ├── config.anthropic.yaml │ │ │ ├── config.azure.yaml │ │ │ ├── config.bedrock.yaml │ │ │ ├── config.deepseek.yaml │ │ │ ├── config.google_ai_studio.yaml │ │ │ ├── config.google_vertexai.yaml │ │ │ ├── config.grok.yaml │ │ │ ├── config.groq.yaml │ │ │ ├── config.lm_studio.yaml │ │ │ ├── config.ollama.yaml │ │ │ ├── config.open_router.yaml │ │ │ ├── config.qwen3.yaml │ │ │ └── config.zhipu.yaml │ │ └── configuration.md │ ├── entrypoint.sh │ ├── eval/ │ │ ├── .gitignore │ │ ├── README.md │ │ ├── __init__.py │ │ ├── add_samples_to_toml.py │ │ ├── data_curation/ │ │ │ ├── __init__.py │ │ │ ├── app.py │ │ │ └── utils.py │ │ ├── dataset/ │ │ │ └── .gitignore │ │ ├── dspy_modules/ │ │ │ ├── __init__.py │ │ │ ├── ask_generation.py │ │ │ └── prompt_optimizer.py │ │ ├── evaluation.py │ │ ├── mdl_to_csv.py │ │ ├── metrics/ │ │ │ ├── __init__.py │ │ │ ├── accuracy.py │ │ │ ├── answer_relevancy.py │ │ │ ├── context_precision.py │ │ │ ├── context_recall.py │ │ │ ├── context_relevancy.py │ │ │ ├── faithfulness.py │ │ │ ├── llm/ │ │ │ │ └── __init__.py │ │ │ └── spider/ │ │ │ ├── __init__.py │ │ │ ├── exact_match.py │ │ │ ├── exec_match.py │ │ │ └── process_sql.py │ │ ├── optimized/ │ │ │ └── .gitignore │ │ ├── pipelines.py │ │ ├── prediction.py │ │ ├── preparation.py │ │ └── utils.py │ ├── pyproject.toml │ ├── ruff.toml │ ├── src/ │ │ ├── __init__.py │ │ ├── __main__.py │ │ ├── config.py │ │ ├── core/ │ │ │ ├── __init__.py │ │ │ ├── engine.py │ │ │ ├── pipeline.py │ │ │ └── provider.py │ │ ├── force_deploy.py │ │ ├── force_update_config.py │ │ ├── globals.py │ │ ├── pipelines/ │ │ │ ├── __init__.py │ │ │ ├── common.py │ │ │ ├── generation/ │ │ │ │ ├── __init__.py │ │ │ │ ├── chart_adjustment.py │ │ │ │ ├── chart_generation.py │ │ │ │ ├── data_assistance.py │ │ │ │ ├── followup_sql_generation.py │ │ │ │ ├── followup_sql_generation_reasoning.py │ │ │ │ ├── intent_classification.py │ │ │ │ ├── misleading_assistance.py │ │ │ │ ├── question_recommendation.py │ │ │ │ ├── relationship_recommendation.py │ │ │ │ ├── semantics_description.py │ │ │ │ ├── sql_answer.py │ │ │ │ ├── sql_correction.py │ │ │ │ ├── sql_diagnosis.py │ │ │ │ ├── sql_generation.py │ │ │ │ ├── sql_generation_reasoning.py │ │ │ │ ├── sql_question.py │ │ │ │ ├── sql_regeneration.py │ │ │ │ ├── sql_tables_extraction.py │ │ │ │ ├── user_guide_assistance.py │ │ │ │ └── utils/ │ │ │ │ ├── chart.py │ │ │ │ ├── sql.py │ │ │ │ └── vega-lite-schema-v5.json │ │ │ ├── indexing/ │ │ │ │ ├── __init__.py │ │ │ │ ├── db_schema.py │ │ │ │ ├── historical_question.py │ │ │ │ ├── instructions.py │ │ │ │ ├── project_meta.py │ │ │ │ ├── sql_pairs.py │ │ │ │ ├── table_description.py │ │ │ │ └── utils/ │ │ │ │ └── helper.py │ │ │ └── retrieval/ │ │ │ ├── __init__.py │ │ │ ├── db_schema_retrieval.py │ │ │ ├── historical_question_retrieval.py │ │ │ ├── instructions.py │ │ │ ├── preprocess_sql_data.py │ │ │ ├── sql_executor.py │ │ │ ├── sql_functions.py │ │ │ ├── sql_knowledge.py │ │ │ └── sql_pairs_retrieval.py │ │ ├── providers/ │ │ │ ├── __init__.py │ │ │ ├── document_store/ │ │ │ │ ├── __init__.py │ │ │ │ └── qdrant.py │ │ │ ├── embedder/ │ │ │ │ ├── __init__.py │ │ │ │ └── litellm.py │ │ │ ├── engine/ │ │ │ │ ├── __init__.py │ │ │ │ └── wren.py │ │ │ ├── llm/ │ │ │ │ ├── __init__.py │ │ │ │ └── litellm.py │ │ │ └── loader.py │ │ ├── utils.py │ │ └── web/ │ │ ├── __init__.py │ │ ├── development.py │ │ └── v1/ │ │ ├── __init__.py │ │ ├── routers/ │ │ │ ├── __init__.py │ │ │ ├── ask.py │ │ │ ├── ask_feedbacks.py │ │ │ ├── chart.py │ │ │ ├── chart_adjustment.py │ │ │ ├── instructions.py │ │ │ ├── question_recommendation.py │ │ │ ├── relationship_recommendation.py │ │ │ ├── semantics_description.py │ │ │ ├── semantics_preparation.py │ │ │ ├── sql_answers.py │ │ │ ├── sql_corrections.py │ │ │ ├── sql_pairs.py │ │ │ └── sql_question.py │ │ └── services/ │ │ ├── __init__.py │ │ ├── ask.py │ │ ├── ask_feedback.py │ │ ├── chart.py │ │ ├── chart_adjustment.py │ │ ├── instructions.py │ │ ├── question_recommendation.py │ │ ├── relationship_recommendation.py │ │ ├── semantics_description.py │ │ ├── semantics_preparation.py │ │ ├── sql_answer.py │ │ ├── sql_corrections.py │ │ ├── sql_pairs.py │ │ └── sql_question.py │ ├── tests/ │ │ ├── __init__.py │ │ ├── data/ │ │ │ ├── book_2_mdl.json │ │ │ ├── config.test.yaml │ │ │ ├── mock_pyproject.toml │ │ │ └── pairs.json │ │ ├── locust/ │ │ │ ├── __init__.py │ │ │ ├── config_users.json │ │ │ ├── locust.conf │ │ │ ├── locust_script.py │ │ │ └── locustfile.py │ │ └── pytest/ │ │ ├── __init__.py │ │ ├── eval/ │ │ │ ├── __init__.py │ │ │ └── test_metrics.py │ │ ├── pipelines/ │ │ │ ├── __init__.py │ │ │ ├── generation/ │ │ │ │ ├── __init__.py │ │ │ │ ├── test_ask.py │ │ │ │ └── test_semantics_enrichment.py │ │ │ ├── indexing/ │ │ │ │ ├── __init__.py │ │ │ │ ├── test_db_schema.py │ │ │ │ ├── test_helper.py │ │ │ │ ├── test_historical_questions.py │ │ │ │ ├── test_indexing.py │ │ │ │ ├── test_instructions.py │ │ │ │ ├── test_sql_pairs.py │ │ │ │ └── test_table_description.py │ │ │ └── retrieval/ │ │ │ ├── __init__.py │ │ │ └── sql_function.py │ │ ├── providers/ │ │ │ ├── __init__.py │ │ │ ├── test_loader.py │ │ │ └── test_providers.py │ │ ├── services/ │ │ │ ├── __init__.py │ │ │ ├── mocks.py │ │ │ ├── test_ask.py │ │ │ ├── test_instructions.py │ │ │ ├── test_relationship_recommendation.py │ │ │ ├── test_semantics_description.py │ │ │ └── test_sql_pairs.py │ │ ├── test_config.py │ │ ├── test_main.py │ │ ├── test_usecases.py │ │ └── test_utils.py │ └── tools/ │ ├── .env.example │ ├── config/ │ │ ├── config.example.yaml │ │ └── config.full.yaml │ ├── dev/ │ │ ├── config.properties.example │ │ └── docker-compose-dev.yaml │ ├── mdl_to_str.py │ └── run_sql.py ├── wren-launcher/ │ ├── .golangci.yml │ ├── Makefile │ ├── README.md │ ├── commands/ │ │ ├── dbt/ │ │ │ ├── README.md │ │ │ ├── converter.go │ │ │ ├── data_source.go │ │ │ ├── data_source_test.go │ │ │ ├── profiles.go │ │ │ ├── profiles_analyzer.go │ │ │ ├── utils.go │ │ │ └── wren_mdl.go │ │ ├── dbt.go │ │ └── launch.go │ ├── config/ │ │ └── config.go │ ├── go.mod │ ├── go.sum │ ├── main.go │ └── utils/ │ ├── docker.go │ ├── docker_test.go │ ├── network.go │ ├── os.go │ ├── rc.go │ └── rc_test.go ├── wren-mdl/ │ └── mdl.schema.json └── wren-ui/ ├── .dockerignore ├── .eslintignore ├── .eslintrc.json ├── .prettierrc ├── .yarn/ │ └── releases/ │ └── yarn-4.5.3.cjs ├── .yarnrc.yml ├── Dockerfile ├── README.md ├── codegen.yaml ├── e2e/ │ ├── README.md │ ├── commonTests/ │ │ ├── home.ts │ │ ├── modeling.ts │ │ └── onboarding.ts │ ├── config.ts │ ├── global.setup.ts │ ├── global.teardown.ts │ ├── helper.ts │ └── specs/ │ ├── connectBigQuery.spec.ts │ ├── connectClickHouse.spec.ts │ ├── connectDuckDB.spec.ts │ ├── connectMySQL.spec.ts │ ├── connectPostgreSQL.spec.ts │ ├── connectSQLServer.spec.ts │ ├── connectSampleECommerce.spec.ts │ ├── connectSampleHR.spec.ts │ ├── connectSnowflake.spec.ts │ └── connectTrino.spec.ts ├── jest.config.js ├── knexfile.js ├── migrations/ │ ├── 20240125070643_create_project_table.js │ ├── 20240125071855_create_model_table.js │ ├── 20240125081244_create_model_column_table.js │ ├── 20240125083821_create_relation_table.js │ ├── 20240125085655_create_metrics_table.js │ ├── 20240126100753_create_metrics_measure_table.js │ ├── 20240129021453_create_view_table.js │ ├── 20240319083758_create_deploy_table.js │ ├── 20240327030000_create_ask_table.js │ ├── 20240418000000_update_project_table_pg.js │ ├── 20240419090558_add_foreign_key_to_model_column_and_metric_measure.js │ ├── 20240425000000_add_thread_response_summary.js │ ├── 20240430033014_update_model_column_table.js │ ├── 20240446090560_update_relationship_table.js │ ├── 20240502000000_add_properties_to_relationship.js │ ├── 20240524044348_update_project_table.js │ ├── 20240524071859_update_thread_table.js │ ├── 20240530062133_update_project_table.js │ ├── 20240530062809_transfer_project_table_data.js │ ├── 20240530105955_drop_project_table_columns.js │ ├── 20240531085916_transfer_model_properties.js │ ├── 20240610070534_create_schema_change_table.js │ ├── 20240928165009_create_model_nested_column.js │ ├── 20241021073019_update_project_language.js │ ├── 20241029092204_create_learning_table.js │ ├── 20241106232204_update_project_table.js │ ├── 20241107171828_update_thread_table.js │ ├── 20241115031024_drop_thread_response_table_column.js │ ├── 20241207000000_update_thread_response_for_answer.js │ ├── 20241210072534_update_thread_response_table.js │ ├── 20241226135712_remove_thread_sql.js │ ├── 20250102074255_create_dashboard_table.js │ ├── 20250102074256_create_dashboard_item_table.js │ ├── 20250102074256_create_sql_pair_table.js │ ├── 20250311046282_create_instruction_table.js │ ├── 20250320074256_alter_sql_pair_table.js │ ├── 20250422000000_alter_dashboard_table.js │ ├── 20250423000000_create_dashboard_cache_refresh_table.js │ ├── 20250509000000_create_asking_task.js │ ├── 20250509000001_add_task_id_to_thread.js │ ├── 20250510000000_add_adjustment_to_thread_response.js │ ├── 20250510000001_alter_dashboard_item_table.js │ ├── 20250510000002_add_version_to_project.js │ └── 20250511000000-create-api-history.js ├── next.config.js ├── openapi.yaml ├── package.json ├── playwright.config.ts ├── src/ │ ├── apollo/ │ │ ├── client/ │ │ │ ├── graphql/ │ │ │ │ ├── __types__.ts │ │ │ │ ├── apiManagement.generated.ts │ │ │ │ ├── apiManagement.ts │ │ │ │ ├── calculatedField.generated.ts │ │ │ │ ├── calculatedField.ts │ │ │ │ ├── dashboard.generated.ts │ │ │ │ ├── dashboard.ts │ │ │ │ ├── dataSource.generated.ts │ │ │ │ ├── dataSource.ts │ │ │ │ ├── deploy.generated.ts │ │ │ │ ├── deploy.ts │ │ │ │ ├── diagram.generated.ts │ │ │ │ ├── diagram.ts │ │ │ │ ├── home.generated.ts │ │ │ │ ├── home.ts │ │ │ │ ├── instructions.generated.ts │ │ │ │ ├── instructions.ts │ │ │ │ ├── learning.generated.ts │ │ │ │ ├── learning.ts │ │ │ │ ├── metadata.generated.ts │ │ │ │ ├── metadata.ts │ │ │ │ ├── model.generated.ts │ │ │ │ ├── model.ts │ │ │ │ ├── onboarding.generated.ts │ │ │ │ ├── onboarding.ts │ │ │ │ ├── relationship.generated.ts │ │ │ │ ├── relationship.ts │ │ │ │ ├── settings.generated.ts │ │ │ │ ├── settings.ts │ │ │ │ ├── sql.generated.ts │ │ │ │ ├── sql.ts │ │ │ │ ├── sqlPairs.generated.ts │ │ │ │ ├── sqlPairs.ts │ │ │ │ ├── view.generated.ts │ │ │ │ └── view.ts │ │ │ └── index.ts │ │ └── server/ │ │ ├── adaptors/ │ │ │ ├── ibisAdaptor.ts │ │ │ ├── index.ts │ │ │ ├── tests/ │ │ │ │ ├── ibisAdaptor.test.ts │ │ │ │ └── wrenAIAdaptor.test.ts │ │ │ ├── wrenAIAdaptor.ts │ │ │ └── wrenEngineAdaptor.ts │ │ ├── backgrounds/ │ │ │ ├── adjustmentBackgroundTracker.ts │ │ │ ├── chart.ts │ │ │ ├── dashboardCacheBackgroundTracker.ts │ │ │ ├── index.ts │ │ │ ├── recommend-question.ts │ │ │ └── textBasedAnswerBackgroundTracker.ts │ │ ├── config.ts │ │ ├── data/ │ │ │ ├── index.ts │ │ │ ├── sample.ts │ │ │ └── type.ts │ │ ├── dataSource.ts │ │ ├── index.ts │ │ ├── managers/ │ │ │ └── dataSourceSchemaDetector.ts │ │ ├── mdl/ │ │ │ ├── mdlBuilder.ts │ │ │ ├── test/ │ │ │ │ └── mdlBuilder.test.ts │ │ │ └── type.ts │ │ ├── models/ │ │ │ ├── adaptor.ts │ │ │ ├── dashboard.ts │ │ │ ├── index.ts │ │ │ ├── instruction.ts │ │ │ └── model.ts │ │ ├── repositories/ │ │ │ ├── apiHistoryRepository.ts │ │ │ ├── askingTaskRepository.ts │ │ │ ├── baseRepository.ts │ │ │ ├── dashboardItemRefreshJobRepository.ts │ │ │ ├── dashboardItemRepository.ts │ │ │ ├── dashboardRepository.ts │ │ │ ├── deployLogRepository.ts │ │ │ ├── index.ts │ │ │ ├── instructionRepository.ts │ │ │ ├── learningRepository.ts │ │ │ ├── metricsMeasureRepository.ts │ │ │ ├── metricsRepository.ts │ │ │ ├── modelColumnRepository.ts │ │ │ ├── modelNestedColumnRepository.ts │ │ │ ├── modelRepository.ts │ │ │ ├── projectRepository.ts │ │ │ ├── relationshipRepository.ts │ │ │ ├── schemaChangeRepository.ts │ │ │ ├── sqlPairRepository.ts │ │ │ ├── threadRepository.ts │ │ │ ├── threadResponseRepository.ts │ │ │ └── viewRepository.ts │ │ ├── resolvers/ │ │ │ ├── apiHistoryResolver.ts │ │ │ ├── askingResolver.ts │ │ │ ├── dashboardResolver.ts │ │ │ ├── diagramResolver.ts │ │ │ ├── instructionResolver.ts │ │ │ ├── learningResolver.ts │ │ │ ├── modelResolver.ts │ │ │ ├── projectResolver.ts │ │ │ └── sqlPairResolver.ts │ │ ├── resolvers.ts │ │ ├── scalars.ts │ │ ├── schema.ts │ │ ├── services/ │ │ │ ├── askingService.ts │ │ │ ├── askingTaskTracker.ts │ │ │ ├── dashboardService.ts │ │ │ ├── deployService.ts │ │ │ ├── index.ts │ │ │ ├── instructionService.ts │ │ │ ├── mdlService.ts │ │ │ ├── metadataService.ts │ │ │ ├── modelService.ts │ │ │ ├── projectService.ts │ │ │ ├── queryService.ts │ │ │ ├── sqlPairService.ts │ │ │ └── tests/ │ │ │ ├── askingService.test.ts │ │ │ ├── dashboardService.test.ts │ │ │ ├── deployService.test.ts │ │ │ └── queryService.test.ts │ │ ├── telemetry/ │ │ │ └── telemetry.ts │ │ ├── types/ │ │ │ ├── context.ts │ │ │ ├── dataSource.ts │ │ │ ├── diagram.ts │ │ │ ├── index.ts │ │ │ ├── manifest.ts │ │ │ ├── metric.ts │ │ │ └── relationship.ts │ │ └── utils/ │ │ ├── apiUtils.ts │ │ ├── dataUtils.ts │ │ ├── docker.ts │ │ ├── encode.ts │ │ ├── encryptor.ts │ │ ├── error.ts │ │ ├── helper.ts │ │ ├── index.ts │ │ ├── knex.ts │ │ ├── logger.ts │ │ ├── model.ts │ │ ├── regex.ts │ │ ├── sqlFormat.ts │ │ ├── sseTypes.ts │ │ ├── sseUtils.ts │ │ ├── string.ts │ │ ├── tests/ │ │ │ ├── dataSource.test.ts │ │ │ ├── encryptor.test.ts │ │ │ └── regex.test.ts │ │ └── timezone.ts │ ├── common.ts │ ├── components/ │ │ ├── ActionButton.tsx │ │ ├── EditableWrapper.tsx │ │ ├── EllipsisWrapper.tsx │ │ ├── ErrorCollapse.tsx │ │ ├── HeaderBar.tsx │ │ ├── Logo.tsx │ │ ├── LogoBar.tsx │ │ ├── PageLoading.tsx │ │ ├── chart/ │ │ │ ├── handler.ts │ │ │ ├── index.tsx │ │ │ └── properties/ │ │ │ ├── BasicProperties.tsx │ │ │ ├── DonutProperties.tsx │ │ │ ├── GroupedBarProperties.tsx │ │ │ ├── LineProperties.tsx │ │ │ └── StackedBarProperties.tsx │ │ ├── code/ │ │ │ ├── BaseCodeBlock.tsx │ │ │ ├── JsonCodeBlock.tsx │ │ │ └── SQLCodeBlock.tsx │ │ ├── dataPreview/ │ │ │ ├── PreviewData.tsx │ │ │ └── PreviewDataContent.tsx │ │ ├── deploy/ │ │ │ ├── Context.ts │ │ │ └── Deploy.tsx │ │ ├── diagram/ │ │ │ ├── Context.ts │ │ │ ├── CustomDropdown.tsx │ │ │ ├── CustomPopover.tsx │ │ │ ├── Marker.tsx │ │ │ ├── customEdge/ │ │ │ │ ├── ModelEdge.tsx │ │ │ │ └── index.ts │ │ │ ├── customNode/ │ │ │ │ ├── Column.tsx │ │ │ │ ├── MarkerHandle.tsx │ │ │ │ ├── ModelNode.tsx │ │ │ │ ├── ViewNode.tsx │ │ │ │ ├── index.ts │ │ │ │ └── utils.tsx │ │ │ ├── index.tsx │ │ │ └── utils.ts │ │ ├── editor/ │ │ │ ├── AceEditor.tsx │ │ │ ├── MarkdownBlock.tsx │ │ │ ├── MarkdownEditor.tsx │ │ │ └── SQLEditor.tsx │ │ ├── layouts/ │ │ │ ├── PageLayout.tsx │ │ │ ├── SiderLayout.tsx │ │ │ └── SimpleLayout.tsx │ │ ├── learning/ │ │ │ ├── guide/ │ │ │ │ ├── index.tsx │ │ │ │ ├── stories.tsx │ │ │ │ └── utils.ts │ │ │ └── index.tsx │ │ ├── modals/ │ │ │ ├── AdjustReasoningStepsModal.tsx │ │ │ ├── AdjustSQLModal.tsx │ │ │ ├── CalculatedFieldModal.tsx │ │ │ ├── DeleteModal.tsx │ │ │ ├── FixSQLModal.tsx │ │ │ ├── ImportDataSourceSQLModal.tsx │ │ │ ├── InstructionModal.tsx │ │ │ ├── QuestionSQLPairModal.tsx │ │ │ ├── RelationModal.tsx │ │ │ ├── SaveAsViewModal.tsx │ │ │ └── SchemaChangeModal.tsx │ │ ├── pages/ │ │ │ ├── apiManagement/ │ │ │ │ └── DetailsDrawer.tsx │ │ │ ├── home/ │ │ │ │ ├── RecommendedQuestions.tsx │ │ │ │ ├── dashboardGrid/ │ │ │ │ │ ├── CacheSettingsDrawer.tsx │ │ │ │ │ ├── DashboardHeader.tsx │ │ │ │ │ ├── EmptyDashboard.tsx │ │ │ │ │ └── index.tsx │ │ │ │ ├── preparation/ │ │ │ │ │ ├── ErrorBoundary.tsx │ │ │ │ │ ├── PreparationStatus.tsx │ │ │ │ │ ├── PreparationSteps.tsx │ │ │ │ │ ├── index.tsx │ │ │ │ │ └── step/ │ │ │ │ │ ├── FixedSQLFinished.tsx │ │ │ │ │ ├── Generating.tsx │ │ │ │ │ ├── Organizing.tsx │ │ │ │ │ ├── Retrieving.tsx │ │ │ │ │ ├── SQLPairFinished.tsx │ │ │ │ │ └── ViewFinished.tsx │ │ │ │ ├── prompt/ │ │ │ │ │ ├── DemoPrompt.tsx │ │ │ │ │ ├── Input.tsx │ │ │ │ │ ├── RecommendedQuestionsPrompt.tsx │ │ │ │ │ ├── Result.tsx │ │ │ │ │ └── index.tsx │ │ │ │ └── promptThread/ │ │ │ │ ├── AnswerResult.tsx │ │ │ │ ├── ChartAnswer.tsx │ │ │ │ ├── TextBasedAnswer.tsx │ │ │ │ ├── ViewBlock.tsx │ │ │ │ ├── ViewSQLTabContent.tsx │ │ │ │ ├── index.tsx │ │ │ │ └── store.tsx │ │ │ ├── knowledge/ │ │ │ │ ├── GlobalLabel.tsx │ │ │ │ ├── InstructionDrawer.tsx │ │ │ │ └── SQLPairDrawer.tsx │ │ │ ├── modeling/ │ │ │ │ ├── EditMetadataModal.tsx │ │ │ │ ├── MetadataDrawer.tsx │ │ │ │ ├── ModelDrawer.tsx │ │ │ │ ├── form/ │ │ │ │ │ └── ModelForm.tsx │ │ │ │ └── metadata/ │ │ │ │ ├── EditBasicMetadata.tsx │ │ │ │ ├── EditModelMetadata.tsx │ │ │ │ ├── EditViewMetadata.tsx │ │ │ │ ├── ModelMetadata.tsx │ │ │ │ └── ViewMetadata.tsx │ │ │ └── setup/ │ │ │ ├── ButtonItem.tsx │ │ │ ├── ConnectDataSource.tsx │ │ │ ├── ContainerCard.tsx │ │ │ ├── DefineRelations.tsx │ │ │ ├── SelectModels.tsx │ │ │ ├── Starter.tsx │ │ │ ├── dataSources/ │ │ │ │ ├── AthenaProperties.tsx │ │ │ │ ├── BigQueryProperties.tsx │ │ │ │ ├── ClickHouseProperties.tsx │ │ │ │ ├── DatabricksProperties.tsx │ │ │ │ ├── DuckDBProperties.tsx │ │ │ │ ├── MySQLProperties.tsx │ │ │ │ ├── OracleProperties.tsx │ │ │ │ ├── PostgreSQLProperties.tsx │ │ │ │ ├── RedshiftProperties.tsx │ │ │ │ ├── SQLServerProperties.tsx │ │ │ │ ├── SnowflakeProperties.tsx │ │ │ │ └── TrinoProperties.tsx │ │ │ └── utils.tsx │ │ ├── selectors/ │ │ │ ├── CombineFieldSelector.tsx │ │ │ ├── DescriptiveSelector.tsx │ │ │ ├── Selector.tsx │ │ │ └── lineageSelector/ │ │ │ ├── FieldSelect.tsx │ │ │ └── index.tsx │ │ ├── settings/ │ │ │ ├── DataSourceSettings.tsx │ │ │ ├── ProjectSettings.tsx │ │ │ ├── index.tsx │ │ │ └── utils.tsx │ │ ├── sidebar/ │ │ │ ├── APIManagement.tsx │ │ │ ├── Home.tsx │ │ │ ├── Knowledge.tsx │ │ │ ├── LabelTitle.tsx │ │ │ ├── Modeling.tsx │ │ │ ├── SidebarMenu.tsx │ │ │ ├── SidebarTree.tsx │ │ │ ├── home/ │ │ │ │ ├── ThreadTree.tsx │ │ │ │ ├── TreeTitle.tsx │ │ │ │ └── TreeTitleInput.tsx │ │ │ ├── index.tsx │ │ │ ├── modeling/ │ │ │ │ ├── GroupTreeTitle.tsx │ │ │ │ ├── ModelTree.tsx │ │ │ │ └── ViewTree.tsx │ │ │ └── utils.tsx │ │ └── table/ │ │ ├── BaseTable.tsx │ │ ├── CalculatedFieldTable.tsx │ │ ├── EditableBaseTable.tsx │ │ ├── FieldTable.tsx │ │ ├── ModelRelationSelectionTable.tsx │ │ ├── MultiSelectBox.tsx │ │ ├── NestedFieldTable.tsx │ │ ├── RelationTable.tsx │ │ ├── SelectionTable.tsx │ │ └── TableTransfer.tsx │ ├── hooks/ │ │ ├── .gitkeep │ │ ├── useAdjustAnswer.tsx │ │ ├── useAskProcessState.tsx │ │ ├── useAskPrompt.tsx │ │ ├── useAskingStreamTask.tsx │ │ ├── useAutoComplete.tsx │ │ ├── useCheckOnboarding.tsx │ │ ├── useCombineFieldOptions.tsx │ │ ├── useDrawerAction.tsx │ │ ├── useDropdown.tsx │ │ ├── useExpressionFieldOptions.tsx │ │ ├── useGlobalConfig.tsx │ │ ├── useHomeSidebar.tsx │ │ ├── useModalAction.tsx │ │ ├── useNativeSQL.tsx │ │ ├── useRecommendedQuestionsInstruction.tsx │ │ ├── useRelationshipModal.tsx │ │ ├── useSetupConnection.tsx │ │ ├── useSetupConnectionDataSource.tsx │ │ ├── useSetupConnectionSampleDataset.tsx │ │ ├── useSetupModels.tsx │ │ ├── useSetupRelations.tsx │ │ ├── useStoreContext.tsx │ │ └── useTextBasedAnswerStreamTask.tsx │ ├── import/ │ │ ├── antd.ts │ │ └── icon.ts │ ├── pages/ │ │ ├── _app.tsx │ │ ├── _document.tsx │ │ ├── api/ │ │ │ ├── ask_task/ │ │ │ │ ├── streaming.ts │ │ │ │ └── streaming_answer.ts │ │ │ ├── config.ts │ │ │ ├── graphql.ts │ │ │ └── v1/ │ │ │ ├── ask.ts │ │ │ ├── generate_sql.ts │ │ │ ├── generate_summary.ts │ │ │ ├── generate_vega_chart.ts │ │ │ ├── knowledge/ │ │ │ │ ├── instructions/ │ │ │ │ │ ├── [id].ts │ │ │ │ │ └── index.ts │ │ │ │ └── sql_pairs/ │ │ │ │ ├── [id].ts │ │ │ │ └── index.ts │ │ │ ├── models.ts │ │ │ ├── run_sql.ts │ │ │ ├── stream/ │ │ │ │ ├── ask.ts │ │ │ │ └── generate_sql.ts │ │ │ └── stream_explanation.ts │ │ ├── api-management/ │ │ │ └── history.tsx │ │ ├── home/ │ │ │ ├── [id].tsx │ │ │ ├── dashboard.tsx │ │ │ └── index.tsx │ │ ├── index.tsx │ │ ├── knowledge/ │ │ │ ├── instructions.tsx │ │ │ └── question-sql-pairs.tsx │ │ ├── modeling.tsx │ │ └── setup/ │ │ ├── connection.tsx │ │ ├── models.tsx │ │ └── relationships.tsx │ ├── styles/ │ │ ├── antd-variables.less │ │ ├── components/ │ │ │ ├── alert.less │ │ │ ├── avatar.less │ │ │ ├── button.less │ │ │ ├── chart.less │ │ │ ├── driver.less │ │ │ ├── scrollbar.less │ │ │ ├── select.less │ │ │ ├── table.less │ │ │ ├── tag.less │ │ │ └── transfer.less │ │ ├── index.less │ │ ├── layouts/ │ │ │ ├── global.less │ │ │ └── main.less │ │ └── utilities/ │ │ ├── animation.less │ │ ├── border.less │ │ ├── color.less │ │ ├── display.less │ │ ├── flex.less │ │ ├── grid.less │ │ ├── spacing.less │ │ └── text.less │ └── utils/ │ ├── columnType.tsx │ ├── data/ │ │ ├── dictionary.ts │ │ ├── index.ts │ │ └── type/ │ │ ├── index.ts │ │ └── modeling.ts │ ├── dataSourceType.ts │ ├── diagram/ │ │ ├── creator.ts │ │ ├── index.ts │ │ └── transformer.ts │ ├── enum/ │ │ ├── columnType.ts │ │ ├── dataSources.ts │ │ ├── diagram.ts │ │ ├── dropdown.ts │ │ ├── form.ts │ │ ├── home.ts │ │ ├── index.ts │ │ ├── menu.ts │ │ ├── modeling.ts │ │ ├── path.ts │ │ ├── settings.ts │ │ └── setup.ts │ ├── env.ts │ ├── error/ │ │ ├── dictionary.ts │ │ └── index.ts │ ├── errorHandler.tsx │ ├── events.tsx │ ├── expressionType.ts │ ├── file.ts │ ├── helper.ts │ ├── icons.ts │ ├── iteration.tsx │ ├── language.ts │ ├── modelingHelper.ts │ ├── nodeType.tsx │ ├── svgs/ │ │ ├── BrainSVG.tsx │ │ ├── CopilotSVG.tsx │ │ ├── EditSVG.tsx │ │ ├── InstructionsSVG.tsx │ │ ├── RobotSVG.tsx │ │ └── index.ts │ ├── table.tsx │ ├── telemetry.ts │ ├── time.ts │ ├── validator/ │ │ ├── calculatedFieldValidator.ts │ │ ├── cronValidator.ts │ │ ├── hostValidator.ts │ │ ├── index.ts │ │ ├── relationshipValidator.ts │ │ ├── sqlPairValidator.ts │ │ └── viewValidator.ts │ ├── vegaSpecUtils.test.ts │ └── vegaSpecUtils.ts ├── tools/ │ └── knex.js └── tsconfig.json ================================================ FILE CONTENTS ================================================ ================================================ FILE: .claude/CLAUDE.md ================================================ # CLAUDE.md WrenAI is an open-source GenBI (Generative BI) agent that converts natural language questions into SQL queries and charts. It uses a semantic layer (MDL - Metadata Definition Language) to guide LLM-powered text-to-SQL generation via retrieval-augmented generation (RAG). ## Repository Structure This is a monorepo with three main services: - **wren-ui/** — Next.js 14 frontend + Apollo GraphQL backend (TypeScript, Yarn 4.5.3) - **wren-ai-service/** — AI/LLM service (Python 3.12, FastAPI, Poetry, Just command runner) - **wren-launcher/** — CLI deployment tool (Go 1.18+, Make) - **docker/** — Docker Compose configs for running all services together - **deployment/** — Kubernetes/Kustomize manifests - **wren-engine/** — SQL engine (git submodule, not developed here) - **wren-mdl/** — MDL JSON schema definitions ## Build, Test, and Lint Commands ### wren-ui (TypeScript/Next.js) ```bash cd wren-ui yarn install yarn dev # Dev server on port 3000 (TZ=UTC) yarn build # Production build (max-old-space-size=8192) yarn lint # TypeScript type check + ESLint yarn check-types # tsc --noEmit yarn test # Jest unit tests yarn test:e2e # Playwright E2E tests (installs chromium) yarn migrate # Knex database migrations yarn rollback # Knex migration rollback yarn generate-gql # GraphQL codegen from codegen.yaml ``` Environment: set `DB_TYPE=sqlite` (default) or `DB_TYPE=pg` with PostgreSQL connection vars. The UI needs `WREN_ENGINE_ENDPOINT`, `WREN_AI_ENDPOINT`, and `IBIS_SERVER_ENDPOINT` to connect to backend services. ### wren-ai-service (Python/FastAPI) ```bash cd wren-ai-service poetry install just init # Creates config.yaml and .env.dev from examples just up # Start dev Docker services (Qdrant, engine, etc.) just start # Run AI service (poetry run python -m src.__main__) just test # pytest (spins up Docker deps, ignores usecases) just test [test_args] # e.g., just test tests/pytest/pipelines/ just test-usecases # Run use-case integration tests just down # Stop Docker services just load-test # Locust load tests ``` Configuration is via `config.yaml` (multi-document YAML with sections for LLM, embedder, engine, document_store, pipeline, and settings). Environment variables in `.env.dev` (API keys). Settings load order: defaults → env vars → .env.dev → config.yaml. Pre-commit hooks: `poetry run pre-commit install` then `poetry run pre-commit run --all-files` ### wren-launcher (Go) ```bash cd wren-launcher make build # Cross-compile for macOS/Linux/Windows make test # go test ./... make check # fmt + vet + lint (golangci-lint) make lint-fix # Auto-fix lint issues ``` ## Architecture ### Service Communication Flow ``` User → Wren UI (Next.js :3000) ↓ GraphQL (Apollo Server embedded in Next.js API routes) Apollo Server → Wren AI Service (FastAPI :5556) [HTTP REST] → Wren Engine (:8080) [SQL validation/execution] → Ibis Server (:8000) [SQL abstraction for data sources] Wren AI Service → Qdrant (:6333) [vector search for RAG] → LLM Provider (OpenAI/Azure/etc.) [text-to-SQL generation] ``` ### Wren UI Internal Architecture The Next.js app embeds an Apollo GraphQL server in its API routes (`src/apollo/`): - **`src/apollo/server/resolvers/`** — GraphQL resolvers (asking, model, project, dashboard, etc.) - **`src/apollo/server/services/`** — Business logic layer (askingService, deployService, mdlService, queryService, etc.) - **`src/apollo/server/repositories/`** — Data access layer using Knex (SQLite or PostgreSQL) - **`src/apollo/server/adaptors/`** — External service adapters (AI service, engine) - **`src/apollo/client/`** — Frontend GraphQL operations - **`src/components/`** — React components organized by page (home, setup, modeling, knowledge) - **`src/pages/`** — Next.js page routes Path aliases: `@/*` → `./src/*`, `@server/*` → `./src/apollo/server/*` ### Wren AI Service Internal Architecture The Python service uses a pipeline-based architecture: - **`src/pipelines/`** — RAG pipeline implementations: - `indexing/` — MDL schema, table descriptions, historical questions, SQL pairs → Qdrant - `retrieval/` — Semantic search for relevant context from Qdrant - `generation/` — SQL generation, chart generation, intent classification - `ask/` — Orchestrates retrieval + generation for text-to-SQL - `ask_details/` — SQL breakdown and explanation - `semantics/` — Semantic processing helpers - **`src/web/v1/services/`** — Service layer (AskService, SemanticsPreparationService, ChartService, SqlPairsService, etc.) - **`src/web/v1/routers/`** — FastAPI route handlers - **`src/core/`** — Base abstractions (pipeline, provider, engine interfaces) - **`src/globals.py`** — ServiceContainer wiring all services and pipelines together - **`src/config.py`** — Pydantic Settings with all configuration knobs Pipelines are configured declaratively in `config.yaml`, wiring LLM providers, embedders, document stores, and engines to named pipeline components. ### Data Flow for "Ask" (Text-to-SQL) 1. User submits natural language question in UI 2. UI sends GraphQL mutation to Apollo Server 3. Apollo Server calls AI Service REST API 4. AI Service runs intent classification → retrieves relevant schema/context from Qdrant → generates SQL via LLM 5. Generated SQL is validated against Wren Engine 6. SQL corrections are attempted if validation fails (up to `max_sql_correction_retries`) 7. Results returned through the chain back to UI ### MDL (Metadata Definition Language) The semantic layer that maps business concepts to database schema. Defines models, columns, relationships, metrics, and calculated fields. MDL is indexed into Qdrant as vector embeddings to provide context for LLM SQL generation. Schema defined in `wren-mdl/mdl.schema.json`. ## Docker Development To run the full stack locally: ```bash cd docker cp .env.example .env.local # Configure API keys and ports cp config.example.yaml config.yaml docker compose --env-file .env.local up -d ``` For developing a single service while others run in Docker, use `docker-compose-dev.yaml` in the AI service's `tools/dev/` directory. ## Commit Convention Follows conventional commits: `type(scope): description` - Scopes: `wren-ui`, `wren-ai-service`, `wren-launcher` - Types: `feat`, `fix`, `chore`, `refactor` - Examples: `feat(wren-ui): add dashboard widget`, `fix(wren-ai-service): handle empty MDL` ## CI/CD - PR labels trigger service-specific CI: `ci/ui` for UI tests/lint, `ci/ai-service` for AI service tests - Docker images published to `ghcr.io/canner/` ================================================ FILE: .claude/settings.json ================================================ { "permissions": { "allow": [ "Bash(cd wren-ui && yarn:*)", "Bash(cd wren-ai-service && just:*)", "Bash(cd wren-ai-service && poetry run:*)", "Bash(cd wren-ai-service && poetry install:*)", "Bash(cd wren-launcher && make:*)", "Bash(git status:*)", "Bash(git diff:*)", "Bash(git log:*)", "Bash(git branch:*)", "Bash(gh pr:*)", "Bash(gh run:*)", "Bash(ls:*)", "Bash(wc:*)" ] } } ================================================ FILE: .editorconfig ================================================ # Editor configuration, see http://editorconfig.org root = true [*] charset = utf-8 indent_style = space indent_size = 2 insert_final_newline = true trim_trailing_whitespace = true [*.md] max_line_length = off trim_trailing_whitespace = false # Makefile [Makefile] indent_style = tab ================================================ FILE: .github/ISSUE_TEMPLATE/bug_report.md ================================================ --- name: Bug report about: Create a report to help us improve title: '' labels: bug assignees: '' --- **Describe the bug** A clear and concise description of what the bug is. **To Reproduce** Steps to reproduce the behavior: 1. Go to '...' 2. Click on '....' 3. Scroll down to '....' 4. See error **Expected behavior** A clear and concise description of what you expected to happen. **Screenshots** If applicable, add screenshots to help explain your problem. **Desktop (please complete the following information):** - OS: [e.g. iOS] - Browser [e.g. chrome, safari] **Wren AI Information** - Version: [e.g, 0.1.0] **Additional context** Add any other context about the problem here. **Relevant log output** - Please share `config.yaml` with us, it should be located at `~/.wrenai/config.yaml`. - Please share your logs with us with the following command: ```bash docker logs wrenai-wren-ui-1 >& wrenai-wren-ui.log && \ docker logs wrenai-wren-ai-service-1 >& wrenai-wren-ai-service.log && \ docker logs wrenai-wren-engine-1 >& wrenai-wren-engine.log && \ docker logs wrenai-ibis-server-1 >& wrenai-ibis-server.log ``` ================================================ FILE: .github/ISSUE_TEMPLATE/feature_request.md ================================================ --- name: Feature request about: Suggest an idea for this project title: '' labels: feature-request assignees: '' --- **Is your feature request related to a problem? Please describe.** A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] **Describe the solution you'd like** A clear and concise description of what you want to happen. **Describe alternatives you've considered** A clear and concise description of any alternative solutions or features you've considered. **Additional context** Add any other context or screenshots about the feature request here. ================================================ FILE: .github/dependabot.yaml ================================================ version: 2 updates: - package-ecosystem: "pip" directory: "/wren-ai-service" schedule: interval: "weekly" groups: all: patterns: ["*"] commit-message: prefix: "chore(wren-ai-service)" labels: - "dependencies" - "python" - "ci/ai-service" - "module/ai-service" ================================================ FILE: .github/workflows/ai-service-release-image.yaml ================================================ name: AI Service Release image on: workflow_dispatch: inputs: tag_name: description: Docker image tag name (Optional) type: string env: WREN_AI_SERVICE_IMAGE: ghcr.io/canner/wren-ai-service defaults: run: working-directory: wren-ai-service jobs: build-image: outputs: tag_name: ${{ steps.tag-preparation.outputs.TAG_NAME }} strategy: fail-fast: false matrix: arch: - runner: ubuntu-latest platform: linux/amd64 - runner: linux_arm64_runner platform: linux/arm64 runs-on: ${{ matrix.arch.runner }} steps: - uses: actions/checkout@v4 - name: Login to GitHub Container Registry uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Prepare tag name id: tag-preparation run: | if [ -n "${{ github.event.inputs.tag_name }}" ]; then tag_name=${{ github.event.inputs.tag_name }} else tag_name=commit-$(git log -1 --pretty=%h) fi echo "TAG_NAME=$tag_name" >> $GITHUB_OUTPUT - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Prepare platform run: | platform=${{ matrix.arch.platform }} echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV - name: Build and push by digest id: build uses: docker/build-push-action@v6 with: platforms: ${{ matrix.arch.platform }} labels: ${{ env.WREN_AI_SERVICE_IMAGE }} context: ./wren-ai-service file: ./wren-ai-service/docker/Dockerfile outputs: type=image,name=${{ env.WREN_AI_SERVICE_IMAGE }},push-by-digest=true,name-canonical=true,push=true - name: Export digest run: | mkdir -p /tmp/digests digest="${{ steps.build.outputs.digest }}" touch "/tmp/digests/${digest#sha256:}" - name: Upload digest uses: actions/upload-artifact@v4 with: name: digests-${{ env.PLATFORM_PAIR }} path: /tmp/digests/* if-no-files-found: error retention-days: 1 merge: runs-on: ubuntu-latest needs: [ build-image ] steps: - name: Download digests uses: actions/download-artifact@v4 with: path: /tmp/digests pattern: digests-* merge-multiple: true - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Docker meta id: meta uses: docker/metadata-action@v5 with: images: ${{ env.WREN_AI_SERVICE_IMAGE }} tags: | ${{ needs.build-image.outputs.tag_name }} - name: Login to GitHub Container Registry uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Create manifest list and push working-directory: /tmp/digests run: | TAGS=$(echo "${{ steps.meta.outputs.tags }}" | awk '{printf "--tag %s ", $0}') docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ $(printf '${{ env.WREN_AI_SERVICE_IMAGE }}@sha256:%s ' *) \ $TAGS ================================================ FILE: .github/workflows/ai-service-release-nightly-image.yaml ================================================ name: AI Service Release nightly image on: push: branches: [main] paths: - 'wren-ai-service/**' env: WREN_AI_SERVICE_IMAGE: ghcr.io/canner/wren-ai-service defaults: run: working-directory: wren-ai-service jobs: build-image: outputs: tag_name: ${{ steps.tag-preparation.outputs.TAG_NAME }} strategy: fail-fast: false matrix: arch: - runner: ubuntu-latest platform: linux/amd64 - runner: linux_arm64_runner platform: linux/arm64 runs-on: ${{ matrix.arch.runner }} steps: - uses: actions/checkout@v4 - name: Login to GitHub Container Registry uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Prepare tag name id: tag-preparation run: | tag_name=main-$(git log -1 --pretty=%h) echo "TAG_NAME=$tag_name" >> $GITHUB_OUTPUT - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Prepare platform run: | platform=${{ matrix.arch.platform }} echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV - name: Build and push by digest id: build uses: docker/build-push-action@v6 with: platforms: ${{ matrix.arch.platform }} labels: ${{ env.WREN_AI_SERVICE_IMAGE }} context: ./wren-ai-service file: ./wren-ai-service/docker/Dockerfile outputs: type=image,name=${{ env.WREN_AI_SERVICE_IMAGE }},push-by-digest=true,name-canonical=true,push=true - name: Export digest run: | mkdir -p /tmp/digests digest="${{ steps.build.outputs.digest }}" touch "/tmp/digests/${digest#sha256:}" - name: Upload digest uses: actions/upload-artifact@v4 with: name: digests-${{ env.PLATFORM_PAIR }} path: /tmp/digests/* if-no-files-found: error retention-days: 1 merge: runs-on: ubuntu-latest needs: [ build-image ] steps: - name: Download digests uses: actions/download-artifact@v4 with: path: /tmp/digests pattern: digests-* merge-multiple: true - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Docker meta id: meta uses: docker/metadata-action@v5 with: images: ${{ env.WREN_AI_SERVICE_IMAGE }} tags: | type=raw,${{ needs.build-image.outputs.tag_name }} type=raw,nightly - name: Login to GitHub Container Registry uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Create manifest list and push working-directory: /tmp/digests run: | TAGS=$(echo "${{ steps.meta.outputs.tags }}" | awk '{printf "--tag %s ", $0}') docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ $(printf '${{ env.WREN_AI_SERVICE_IMAGE }}@sha256:%s ' *) \ $TAGS ================================================ FILE: .github/workflows/ai-service-release-stable-image.yaml ================================================ name: AI Service Release stable image on: workflow_dispatch: inputs: version: description: Give a version for this release type: string required: true env: WREN_AI_SERVICE_IMAGE: ghcr.io/canner/wren-ai-service defaults: run: working-directory: wren-ai-service jobs: upgrade-ai-service-version: runs-on: ubuntu-latest steps: - name: Generate a token id: generate-token uses: actions/create-github-app-token@v1 with: app-id: ${{ vars.CI_APP_ID }} private-key: ${{ secrets.CI_APP_PRIVATE_KEY }} - uses: actions/checkout@v4 with: token: ${{ steps.generate-token.outputs.token }} fetch-depth: 0 - name: Set up Git run: | git config --global user.name "wren-ai[bot]" git config --global user.email "dev@cannerdata.com" - name: Set up Python 3.12.0 uses: actions/setup-python@v4 with: python-version: 3.12.0 - name: Install Poetry uses: abatilo/actions-poetry@v2 with: poetry-version: 1.8.3 - name: Generate and Save Change Log id: changelog run: | echo "Generating change log..." PREVIOUS_VERSION=release/ai-service/$(poetry version -s) echo "Previous version: $PREVIOUS_VERSION" # Get the change log from the previous version to the current HEAD # If there is no change log, the command will return an error, so we use || true to ignore the error CHANGE_LOG=$(git log --pretty=format:"%s" $PREVIOUS_VERSION..HEAD | grep wren-ai-service || true) # Separate the change log into categories FEATURES=$(echo "$CHANGE_LOG" | grep "^feat" | sed 's/^/- /') FIXES_AND_CHORES=$(echo "$CHANGE_LOG" | grep -E "^(fix|chore)" | sed 's/^/- /') # Create the full change log FULL_CHANGE_LOG="\nChangelog for the version\n" if [ -n "$FEATURES" ]; then FULL_CHANGE_LOG+="\nFeature and Enhancement\n$FEATURES" fi if [ -n "$FIXES_AND_CHORES" ]; then FULL_CHANGE_LOG+="\n\nFixes and Chores\n$FIXES_AND_CHORES" fi { echo "CHANGE_LOG<> $GITHUB_ENV - name: Upgrade AI Service version run: | version=${{ github.event.inputs.version }} poetry version --next-phase $version git add pyproject.toml git commit -m "Upgrade AI Service version to $version" git push git tag -a "release/ai-service/$version" -m "${{ env.CHANGE_LOG }}" git push origin "release/ai-service/$version" build-image: needs: upgrade-ai-service-version strategy: fail-fast: false matrix: arch: - runner: ubuntu-latest platform: linux/amd64 - runner: linux_arm64_runner platform: linux/arm64 runs-on: ${{ matrix.arch.runner }} steps: - uses: actions/checkout@v4 with: ref: ${{ github.ref }} - name: Login to GitHub Container Registry uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Prepare platform run: | platform=${{ matrix.arch.platform }} echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV - name: Build and push by digest id: build uses: docker/build-push-action@v6 with: platforms: ${{ matrix.arch.platform }} labels: ${{ env.WREN_AI_SERVICE_IMAGE }} context: ./wren-ai-service file: ./wren-ai-service/docker/Dockerfile outputs: type=image,name=${{ env.WREN_AI_SERVICE_IMAGE }},push-by-digest=true,name-canonical=true,push=true - name: Export digest run: | mkdir -p /tmp/digests digest="${{ steps.build.outputs.digest }}" touch "/tmp/digests/${digest#sha256:}" - name: Upload digest uses: actions/upload-artifact@v4 with: name: digests-${{ env.PLATFORM_PAIR }} path: /tmp/digests/* if-no-files-found: error retention-days: 1 merge: runs-on: ubuntu-latest needs: [ build-image ] steps: - name: Download digests uses: actions/download-artifact@v4 with: path: /tmp/digests pattern: digests-* merge-multiple: true - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Docker meta id: meta uses: docker/metadata-action@v5 with: images: ${{ env.WREN_AI_SERVICE_IMAGE }} tags: | type=raw,${{ github.event.inputs.version }} type=raw,latest - name: Login to GitHub Container Registry uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Create manifest list and push working-directory: /tmp/digests run: | TAGS=$(echo "${{ steps.meta.outputs.tags }}" | awk '{printf "--tag %s ", $0}') docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ $(printf '${{ env.WREN_AI_SERVICE_IMAGE }}@sha256:%s ' *) \ $TAGS ================================================ FILE: .github/workflows/ai-service-test.yaml ================================================ # This workflow will install Python dependencies, run tests and lint with a single version of Python # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python name: AI Service Test on: push: branches: - main paths: - "wren-ai-service/**" pull_request: types: [synchronize, labeled] workflow_dispatch: permissions: contents: read concurrency: # avoid mis-canceling the ci runs while other labels are added to the PR, so we add the label name as the condition group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.label.name == 'ci/ai-service' && github.event.number || github.sha }} cancel-in-progress: true defaults: run: working-directory: wren-ai-service jobs: pytest: if: ${{ contains(github.event.pull_request.labels.*.name, 'ci/ai-service') || github.event_name == 'push' }} runs-on: ubuntu-22.04 timeout-minutes: 10 steps: - uses: actions/checkout@v4 - name: Install Poetry uses: abatilo/actions-poetry@v3 with: poetry-version: "1.8.3" - name: Set up Python uses: actions/setup-python@v5 with: python-version-file: ./wren-ai-service/pyproject.toml cache: "poetry" - name: Install the project dependencies run: poetry install --without eval - name: Install Just uses: extractions/setup-just@v2 with: just-version: "1.36.0" - name: Initialize the config run: | just init --non-dev - name: Prepare testing environment and Run tests run: | just test env: OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} ================================================ FILE: .github/workflows/create-rc-release-pr.yaml ================================================ name: Create RC Release PR on: workflow_dispatch: inputs: release_version: description: "Release version (e.g., 0.23.0-rc.1)" required: true ui_version: description: "UI version (e.g., 0.22.0)" required: true ai_version: description: "AI service version (e.g., 0.17.0)" required: true engine_version: description: "Engine version (e.g., 0.14.7)" required: true permissions: contents: write pull-requests: write jobs: create-release-pr: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v3 - name: Setup Git Identity run: | git config --global user.name "wren-ai[bot]" git config --global user.email "dev@cannerdata.com" - name: Update docker.go run: | FILE_PATH="wren-launcher/utils/docker.go" # Replace the WREN_PRODUCT_VERSION value with the new release version sed -i "s/WREN_PRODUCT_VERSION\s*string = \"[^\"]*\"/WREN_PRODUCT_VERSION\tstring = \"${{ github.event.inputs.release_version }}\"/" $FILE_PATH # Verify the changes grep "WREN_PRODUCT_VERSION" $FILE_PATH - name: Update .env.example run: | FILE_PATH="docker/.env.example" # Update all versions in the .env.example file sed -i "s/WREN_PRODUCT_VERSION=.*/WREN_PRODUCT_VERSION=${{ github.event.inputs.release_version }}/" $FILE_PATH sed -i "s/WREN_ENGINE_VERSION=.*/WREN_ENGINE_VERSION=${{ github.event.inputs.engine_version }}/" $FILE_PATH sed -i "s/IBIS_SERVER_VERSION=.*/IBIS_SERVER_VERSION=${{ github.event.inputs.engine_version }}/" $FILE_PATH sed -i "s/WREN_AI_SERVICE_VERSION=.*/WREN_AI_SERVICE_VERSION=${{ github.event.inputs.ai_version }}/" $FILE_PATH sed -i "s/WREN_UI_VERSION=.*/WREN_UI_VERSION=${{ github.event.inputs.ui_version }}/" $FILE_PATH # Verify the changes grep "VERSION" $FILE_PATH - name: Show git status run: git status - name: Show git diff run: | echo "===== Git diff for changed files =====" git diff - name: Create PR uses: peter-evans/create-pull-request@v7 with: base: main branch: "release/${{ github.event.inputs.release_version }}" commit-message: "release ${{ github.event.inputs.release_version }}" title: "Release ${{ github.event.inputs.release_version }}" body: "Release ${{ github.event.inputs.release_version }}" draft: false ================================================ FILE: .github/workflows/create-rc-release.yaml ================================================ name: Create RC Release on: workflow_dispatch: inputs: release_version: description: "Release version" required: true issue_comment: types: [created] jobs: release: runs-on: macos-latest if: ${{ github.event_name == 'issue_comment' && contains(github.event.comment.body, '/release-rc') && startsWith(github.event.issue.title, 'Release') }} steps: - name: Checkout repository uses: actions/checkout@v4 with: ref: main - name: Set up Go uses: actions/setup-go@v4 with: go-version: "1.23.0" - name: Add rocket emoji to comment run: | curl -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -d '{"body": "🚀 Starting the release process!"}' \ "https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/comments" - name: Parse release version from PR title id: parse_release_version env: GITHUB_ISSUE_TITLE: ${{ github.event.issue.title }} run: | release_version=$(echo "$GITHUB_ISSUE_TITLE" | sed 's/ /\n/g' | tail -n 1) echo "Release version: $release_version" echo "release_version=$release_version" >> $GITHUB_OUTPUT - name: Build for macOS working-directory: ./wren-launcher run: | mkdir -p dist env GOARCH=amd64 GOOS=darwin CGO_ENABLED=1 go build -o dist/wren-launcher-darwin main.go cd dist && chmod +x wren-launcher-darwin && tar zcvf wren-launcher-darwin.tar.gz wren-launcher-darwin - name: Build for macOS(arm64) working-directory: ./wren-launcher run: | mkdir -p dist env GOARCH=arm64 GOOS=darwin CGO_ENABLED=1 go build -o dist/wren-launcher-darwin-arm64 main.go cd dist && chmod +x wren-launcher-darwin-arm64 && tar zcvf wren-launcher-darwin-arm64.tar.gz wren-launcher-darwin-arm64 - name: Build for Linux working-directory: ./wren-launcher run: | mkdir -p dist env GOARCH=amd64 GOOS=linux CGO_ENABLED=0 go build -o dist/wren-launcher-linux main.go cd dist && chmod +x wren-launcher-linux && tar zcvf wren-launcher-linux.tar.gz wren-launcher-linux - name: Build for Linux(arm64) working-directory: ./wren-launcher run: | mkdir -p dist env GOARCH=arm64 GOOS=linux CGO_ENABLED=0 go build -o dist/wren-launcher-linux-arm64 main.go cd dist && chmod +x wren-launcher-linux-arm64 && tar zcvf wren-launcher-linux-arm64.tar.gz wren-launcher-linux-arm64 - name: Build for Windows working-directory: ./wren-launcher run: | mkdir -p dist env GOARCH=amd64 GOOS=windows CGO_ENABLED=0 go build -o dist/wren-launcher-windows.exe main.go cd dist && zip wren-launcher-windows.zip wren-launcher-windows.exe - name: Create GitHub Release uses: softprops/action-gh-release@v2 with: files: | ./wren-launcher/dist/wren-launcher-darwin.tar.gz ./wren-launcher/dist/wren-launcher-linux.tar.gz ./wren-launcher/dist/wren-launcher-windows.zip ./wren-launcher/dist/wren-launcher-darwin-arm64.tar.gz ./wren-launcher/dist/wren-launcher-linux-arm64.tar.gz tag_name: ${{ steps.parse_release_version.outputs.release_version }} prerelease: true generate_release_notes: true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Comment with release link run: | release_url="https://github.com/${{ github.repository }}/releases/tag/${{ steps.parse_release_version.outputs.release_version }}" curl -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -d "{\"body\": \"🚀 A new release has been created! [View Release](${release_url})\"}" \ "https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/comments" ================================================ FILE: .github/workflows/pr-tagger.yaml ================================================ name: PR Tagger on: pull_request: types: [opened, synchronize, reopened] paths: - "wren-ui/src/**" - "deployment/**" - "wren-launcher/**" - "wren-ai-service/**" - "docker/**" jobs: tag-pr: runs-on: ubuntu-latest permissions: pull-requests: write steps: - name: Checkout code uses: actions/checkout@v3 with: fetch-depth: 0 - name: Get changed files id: changed-files uses: tj-actions/changed-files@v46 - name: Tag PR based on changed files and title uses: actions/github-script@v6 with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | const changedFiles = '${{ steps.changed-files.outputs.all_changed_files }}'.split(' '); const labels = new Set(); // Define label colors const labelColors = { 'wren-ui': 'f29513', // Orange 'launcher': 'f29513', // Orange (same as wren-ui) 'wren-ai-service': 'f29513', // Orange (same as wren-ui) 'deployment': '0075ca', // Blue 'ai-env-changed': 'd73a4a', // Red 'ui-env-changed': 'd73a4a' // Red }; // Check for files in specific directories for (const file of changedFiles) { if (file.startsWith('wren-ui/src/')) { labels.add('wren-ui'); } else if (file.startsWith('deployment/')) { labels.add('deployment'); } else if (file.startsWith('wren-launcher/')) { labels.add('launcher'); } else if (file.startsWith('wren-ai-service/')) { labels.add('wren-ai-service'); } if (file.startsWith('docker/') && file.includes('.example')) { labels.add('ai-env-changed'); } if (file.startsWith('wren-ui/src/apollo/server/config.ts')) { labels.add('ui-env-changed'); } } // Extract milestone from PR title const prTitle = context.payload.pull_request.title; const milestoneMatch = prTitle.match(/\(milestone:\s*([^)]+)\)/i); if (milestoneMatch && milestoneMatch[1]) { const milestone = milestoneMatch[1].trim(); if (milestone) { labels.add(milestone); console.log(`Found milestone in PR title: ${milestone}`); } } // Append env changed label to PR title if (labels.has('ai-env-changed')) { // check if pr title contains "ai-env-changed" if (!prTitle.includes('ai-env-changed')) { const newTitle = `${prTitle} (ai-env-changed)`; await github.rest.issues.update({ owner: context.repo.owner, repo: context.repo.repo, issue_number: context.issue.number, title: newTitle }); } } if (labels.has('ui-env-changed')) { // check if pr title contains "ui-env-changed" if (!prTitle.includes('ui-env-changed')) { const newTitle = `${prTitle} (ui-env-changed)`; await github.rest.issues.update({ owner: context.repo.owner, repo: context.repo.repo, issue_number: context.issue.number, title: newTitle }); } } if (labels.size > 0) { // Create or update labels with colors for (const label of labels) { try { // Try to create the label with color if (labelColors[label]) { await github.rest.issues.createLabel({ owner: context.repo.owner, repo: context.repo.repo, name: label, color: labelColors[label] }); } } catch (error) { // Label already exists, update its color if needed if (labelColors[label]) { try { await github.rest.issues.updateLabel({ owner: context.repo.owner, repo: context.repo.repo, name: label, color: labelColors[label] }); } catch (updateError) { console.log(`Could not update color for label ${label}: ${updateError.message}`); } } } } // Add labels to PR await github.rest.issues.addLabels({ owner: context.repo.owner, repo: context.repo.repo, issue_number: context.issue.number, labels: Array.from(labels) }); console.log(`Added labels: ${Array.from(labels).join(', ')}`); } else { console.log('No matching directories or milestone found'); } ================================================ FILE: .github/workflows/pull-request-title-validator.yaml ================================================ name: Pull Request Title Validator on: pull_request: paths: - "wren-ai-service/**" - ".github/workflows/pull-request-title-validator.yaml" - ".github/workflows/ai-service-*.yaml" types: [opened, edited, synchronize] permissions: pull-requests: read jobs: validator: name: validate-pull-request-title runs-on: ubuntu-latest steps: - name: validate pull request title uses: kontrolplane/pull-request-title-validator@v1.3.1 with: types: "fix,feat,chore" scopes: "wren-ai-service" ================================================ FILE: .github/workflows/ui-lint.yaml ================================================ # create the github action to run the yarn lint when PR created or pushed to main branch # name: Wren-UI Lint on: pull_request: types: [ labeled, synchronize ] permissions: contents: read concurrency: # avoid mis-canceling the ci runs while other labels are added to the PR, so we add the label name as the condition group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.label.name == 'ci/ui' && github.event.number || github.sha }} cancel-in-progress: true defaults: run: working-directory: wren-ui jobs: eslint: # run this job only if the PR is labeled with "ci/ui" if: ${{ github.event.label.name == 'ci/ui' }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Set up Node.js uses: actions/setup-node@v2 with: node-version: '18' - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn cache dir)" - uses: actions/cache@v2 id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) with: path: | # should cache node_modules as well ${{ steps.yarn-cache-dir-path.outputs.dir }} key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} restore-keys: | ${{ runner.os }}-yarn- - if: ${{ steps.yarn-cache.outputs.cache-hit != 'true' }} name: List the state of node modules continue-on-error: true run: yarn list - name: Install Node.js dependencies run: yarn install - name: Run lint run: yarn lint ================================================ FILE: .github/workflows/ui-release-image-stable.yaml ================================================ name: Wren-UI Release stable image on: workflow_dispatch: inputs: version: description: Give a version for this release type: string required: true env: WREN_UI_IMAGE: ghcr.io/canner/wren-ui defaults: run: working-directory: wren-ui jobs: build-image: strategy: fail-fast: false matrix: arch: - runner: ubuntu-latest platform: linux/amd64 - runner: linux_arm64_runner platform: linux/arm64 runs-on: ${{ matrix.arch.runner }} steps: - uses: actions/checkout@v4 - name: Login to GitHub Container Registry uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Prepare platform run: | platform=${{ matrix.arch.platform }} echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV - name: Build and push by digest id: build uses: docker/build-push-action@v6 with: platforms: ${{ matrix.arch.platform }} labels: ${{ env.WREN_UI_IMAGE }} context: ./wren-ui outputs: type=image,name=${{ env.WREN_UI_IMAGE }},push-by-digest=true,name-canonical=true,push=true - name: Export digest run: | mkdir -p /tmp/digests digest="${{ steps.build.outputs.digest }}" touch "/tmp/digests/${digest#sha256:}" - name: Upload digest uses: actions/upload-artifact@v4 with: name: digests-${{ env.PLATFORM_PAIR }} path: /tmp/digests/* if-no-files-found: error retention-days: 1 merge: runs-on: ubuntu-latest needs: [build-image] steps: - name: Download digests uses: actions/download-artifact@v4 with: path: /tmp/digests pattern: digests-* merge-multiple: true - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Docker meta id: meta uses: docker/metadata-action@v5 with: images: ${{ env.WREN_UI_IMAGE }} tags: | ${{ github.event.inputs.version }} - name: Login to GitHub Container Registry uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Create manifest list and push working-directory: /tmp/digests # tag with input version and latest run: | TAGS=$(echo "${{ steps.meta.outputs.tags }}" | awk '{printf "--tag %s ", $0}') docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ $(printf '${{ env.WREN_UI_IMAGE }}@sha256:%s ' *) \ $TAGS tag-ui-version: runs-on: ubuntu-latest needs: [merge] steps: - name: Generate a token id: generate-token uses: actions/create-github-app-token@v1 with: app-id: ${{ vars.CI_APP_ID }} private-key: ${{ secrets.CI_APP_PRIVATE_KEY }} - uses: actions/checkout@v4 with: token: ${{ steps.generate-token.outputs.token }} fetch-depth: 0 - name: Set up Git run: | git config --global user.name "wren-ai[bot]" git config --global user.email "dev@cannerdata.com" - name: Generate and Save Change Log id: changelog run: | echo "Generating change log..." PREVIOUS_VERSION=release/ui/$(jq -r '.version' package.json) echo "Previous version: $PREVIOUS_VERSION" echo "================ change log ================" CHANGE_LOG=$(git log --pretty=format:"%s" $PREVIOUS_VERSION..HEAD | grep wren-ui) echo "================ change log ================" # Separate the change log into categories FEATURES=$(echo "$CHANGE_LOG" | grep "^feat" | sed 's/^/- /') FIXES_AND_CHORES=$(echo "$CHANGE_LOG" | grep -E "^(fix|chore)" | sed 's/^/- /') # Create the full change log FULL_CHANGE_LOG="\nChangelog for the version\n" if [ -n "$FEATURES" ]; then FULL_CHANGE_LOG+="\nFeature and Enhancement\n$FEATURES" fi if [ -n "$FIXES_AND_CHORES" ]; then FULL_CHANGE_LOG+="\n\nFixes and Chores\n$FIXES_AND_CHORES" fi { echo "CHANGE_LOG<> $GITHUB_ENV - name: Update Wren-UI version run: | version=${{ github.event.inputs.version }} sed -i 's/"version": "[^"]*"/"version": "'"$version"'"/' package.json git add package.json git commit -m "update wren-ui version to $version" git push git tag -a "release/ui/$version" -m "${{ env.CHANGE_LOG }}" git push origin "release/ui/$version" ================================================ FILE: .github/workflows/ui-release-image.yaml ================================================ name: Wren-UI Release image on: workflow_dispatch: inputs: docker_image_tag_name: description: Docker image tag name (optional, default branch name/tag name replaced with hyphens) type: string env: WREN_UI_IMAGE: ghcr.io/canner/wren-ui defaults: run: working-directory: wren-ui jobs: build-image: outputs: tag_name: ${{ steps.tag-preparation.outputs.TAG_NAME }} strategy: fail-fast: false matrix: arch: - runner: ubuntu-latest platform: linux/amd64 - runner: linux_arm64_runner platform: linux/arm64 runs-on: ${{ matrix.arch.runner }} steps: - uses: actions/checkout@v4 - name: Login to GitHub Container Registry uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Prepare tag name id: tag-preparation run: | if [ -n "${{ github.event.inputs.docker_image_tag_name }}" ]; then tag_name=${{ github.event.inputs.docker_image_tag_name }} else tag_name=$(echo ${{ github.ref_name }} | sed 's/[^a-zA-Z0-9]/-/g')-$(git log -1 --pretty=%h) fi echo "TAG_NAME=$tag_name" >> $GITHUB_OUTPUT - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Prepare platform run: | platform=${{ matrix.arch.platform }} echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV - name: Build and push by digest id: build uses: docker/build-push-action@v6 with: platforms: ${{ matrix.arch.platform }} labels: ${{ env.WREN_UI_IMAGE }} context: ./wren-ui outputs: type=image,name=${{ env.WREN_UI_IMAGE }},push-by-digest=true,name-canonical=true,push=true - name: Export digest run: | mkdir -p /tmp/digests digest="${{ steps.build.outputs.digest }}" touch "/tmp/digests/${digest#sha256:}" - name: Upload digest uses: actions/upload-artifact@v4 with: name: digests-${{ env.PLATFORM_PAIR }} path: /tmp/digests/* if-no-files-found: error retention-days: 1 merge: runs-on: ubuntu-latest needs: [ build-image ] steps: - name: Download digests uses: actions/download-artifact@v4 with: path: /tmp/digests pattern: digests-* merge-multiple: true - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Docker meta id: meta uses: docker/metadata-action@v5 with: images: ${{ env.WREN_UI_IMAGE }} tags: | ${{ needs.build-image.outputs.tag_name }} - name: Login to GitHub Container Registry uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Create manifest list and push working-directory: /tmp/digests run: | TAGS=$(echo "${{ steps.meta.outputs.tags }}" | awk '{printf "--tag %s ", $0}') docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ $(printf '${{ env.WREN_UI_IMAGE }}@sha256:%s ' *) \ $TAGS ================================================ FILE: .github/workflows/ui-test.yaml ================================================ # create the github action to run the UI tests when PR created name: Wren-UI Test on: pull_request: types: [ labeled, synchronize ] permissions: contents: read concurrency: # avoid mis-canceling the ci runs while other labels are added to the PR, so we add the label name as the condition group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.label.name == 'ci/ui' && github.event.number || github.sha }} cancel-in-progress: true defaults: run: working-directory: wren-ui jobs: unit-test: # run this job only if the PR is labeled with "ci/ui" if: ${{ github.event.label.name == 'ci/ui'}} runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Set up Node.js uses: actions/setup-node@v2 with: node-version: '18' - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn cache dir)" - uses: actions/cache@v2 id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) with: path: | # should cache node_modules as well ${{ steps.yarn-cache-dir-path.outputs.dir }} key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} restore-keys: | ${{ runner.os }}-yarn- - if: ${{ steps.yarn-cache.cache-hit != 'true' }} name: List the state of node modules continue-on-error: true run: yarn list - name: Install dependencies run: yarn - name: Run tests run: yarn test ================================================ FILE: .github/workflows/wren-launcher-ci.yaml ================================================ name: Wren Launcher CI on: pull_request: types: [synchronize, labeled] paths: - 'wren-launcher/**' - '.github/workflows/wren-launcher-ci.yaml' permissions: contents: read concurrency: group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.number || github.sha }} cancel-in-progress: true defaults: run: working-directory: wren-launcher jobs: golangci: name: lint runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: go-version: '1.24' cache-dependency-path: wren-launcher/go.sum - name: golangci-lint uses: golangci/golangci-lint-action@v8 with: version: v2.3.1 working-directory: wren-launcher fmt-and-test: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4 - name: Setup Go uses: actions/setup-go@v5 with: go-version: '1.24' cache-dependency-path: wren-launcher/go.sum - name: Install goimports run: go install golang.org/x/tools/cmd/goimports@latest - name: Download dependencies run: go mod download - name: Run format check run: | make fmt # Check if there are any formatting changes if [ -n "$(git diff --name-only)" ]; then echo "Code is not formatted properly. Please run 'make fmt' and commit the changes." git diff exit 1 fi - name: Run go vet run: make vet - name: Run tests run: go test ./commands/dbt security-scan: runs-on: ubuntu-latest needs: fmt-and-test steps: - name: Checkout repository uses: actions/checkout@v4 - name: Setup Go uses: actions/setup-go@v5 with: go-version: '1.24' cache-dependency-path: wren-launcher/go.sum - name: Run Gosec Security Scanner run: | go install github.com/securego/gosec/v2/cmd/gosec@latest gosec ./... - name: Run Go mod audit run: | go mod verify go list -json -deps ./... | jq -r '.Module | select(.Version) | "\(.Path) \(.Version)"' | sort -u ================================================ FILE: .gitignore ================================================ # wren-ai-service wren-ai-service/.env.* wren-ai-service/config.yaml* !wren-ai-service/.env.*.example !wren-ai-service/src/eval/wren-engine/.env wren-ai-service/src/eval/wren-engine/**/config.properties wren-ai-service/src/eval/wren-engine/etc/mdl/* wren-ai-service/src/eval/wren-engine/etc/duckdb wren-ai-service/src/eval/wren-engine/etc/archived wren-ai-service/src/eval/data wren-ai-service/**/outputs/ wren-ai-service/**/spider/ wren-ai-service/tests/data/usecases/ !wren-ai-service/**/metrics/spider/ !wren-ai-service/tests/data !wren-ai-service/src/eval/data/book_2*.json !wren-ai-service/src/eval/data/baseball_1*.json !wren-ai-service/src/eval/data/college_3*.json !wren-ai-service/src/eval/data/college_3_optimal_ddl.json wren-ai-service/*.csv wren-ai-service/*.json wren-ai-service/assertion.log wren-ai-service/redis.* wren-ai-service/demo/spider wren-ai-service/demo/poetry.lock wren-ai-service/demo/custom_dataset wren-ai-service/demo/.env wren-ai-service/tools/dev/etc/** .deepeval-cache.json .deepeval_telemtry.txt docker/config.yaml docker/docker-compose-local.yaml docker/data # python .python-version # cache __pycache__ local_cache .ruff_cache .pytest_cache # ide .idea .vscode/ # os .DS_Store __MACOSX/ *.pem # sqlite *.sqlite *.sqlite3 # ui ## dependencies node_modules .pnp .pnp.js ## testing wren-ui/coverage wren-ui/test-results wren-ui/playwright-report wren-ui/e2e/e2e.config.json ## next.js wren-ui/.next wren-ui/out wren-ui/.yarn/install-state.gz ## production wren-ui/build ## debug npm-debug.log* yarn-debug.log* yarn-error.log* ## local env files .env*.local .env* .env.ai ## vercel .vercel ## typescript *.tsbuildinfo next-env.d.ts # wren-launcher wren-launcher/dist wren-launcher/main ## temporary files .tmp !wren-ai-service/tools/.env.example ================================================ FILE: .gitmodules ================================================ [submodule "wren-engine"] path = wren-engine url = git@github.com:Canner/wren-engine.git ================================================ FILE: CODE_OF_CONDUCT.md ================================================ ## Code of Conduct ### Our Pledge We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation. We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. ### Our Standards Examples of behavior that contributes to a positive environment for our community include: - Demonstrating empathy and kindness toward other people - Being respectful of differing opinions, viewpoints, and experiences - Giving and gracefully accepting constructive feedback - Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience - Focusing on what is best not just for us as individuals, but for the overall community Examples of unacceptable behavior include: - The use of sexualized language or imagery, and sexual attention or advances of any kind - Trolling, insulting or derogatory comments, and personal or political attacks - Public or private harassment - Publishing others’ private information, such as a physical or email address, without their explicit permission - Other conduct which could reasonably be considered inappropriate in a professional setting ### Enforcement Responsibilities Project maintainers are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful. Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate. ### Scope This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. ### Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the project team responsible for enforcement at [contact@getwren.ai](mailto:contact@getwren.ai). All complaints will be reviewed and investigated promptly and fairly. All project maintainers are obligated to respect the privacy and security of the reporter of any incident. Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. ### Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct/][version] [homepage]: http://contributor-covenant.org [version]: https://www.contributor-covenant.org/version/2/1 ================================================ FILE: CONTRIBUTING.md ================================================ # Contributing Guidelines *Pull requests, bug reports, and all other forms of contribution are welcomed and highly encouraged!* :octocat: ### Contents - [Code of Conduct](#book-code-of-conduct) - [Overview](#mag-overview) - [Contribution Guide of Different Services](#love_letter-contribution-guide-of-different-services) - [Creating a New Data Source Connector](#electric_plug-creating-a-new-data-source-connector) > **This guide serves to set clear expectations for everyone involved with the project so that we can improve it together while also creating a welcoming space for everyone to participate. Following these guidelines will help ensure a positive experience for contributors and maintainers.** ## :book: Code of Conduct Please review our [Code of Conduct](https://github.com/Canner/WrenAI/blob/main/CODE_OF_CONDUCT.md). It is in effect at all times. We expect it to be honored by everyone who contributes to this project. Acting like an asshole will not be tolerated. ## :rocket: Get Started 1. Visit [How Wren AI works?](https://docs.getwren.ai/oss/overview/how_wrenai_works) to understand the architecture of Wren AI 1. After you understand the architecture of Wren AI, understand the scope of the services you want to contribute to. Check each service's section under [Contribution Guide of Different Services](#love_letter-contribution-guide-of-different-services) to learn how to contribute to each service. 1. If you are dealing with UI-related tasks, such as adding a dark mode, you only need to contribute to the [Wren UI Service](#wren-ui-service). 2. If you are dealing with LLM-related tasks, such as enhancing the prompts used in the LLM pipelines, you only need to contribute to the [Wren AI Service](#wren-ai-service). 3. If you are working on data-source-related tasks, such as fixing a bug in SQL server connector, you will need to contribute to the [Wren Engine Service](#wren-engine-service). 1. If you are not sure which service to contribute to, please reach out to us in [Discord](https://discord.gg/canner) or [GitHub Issues](https://github.com/Canner/WrenAI/issues). 1. It's possible that you need to contribute to multiple services. For example, if you are adding a new data source, you will need to contribute to the [Wren UI Service](#wren-ui-service) and [Wren Engine Service](#wren-engine-service). Follow [Guide for Contributing to Multiple Services](#guide-for-contributing-to-multiple-services) to learn how to contribute to multiple services. ## :love_letter: Contribution Guide of Different Services ### Wren AI Service Wren AI Service is responsible for LLM-related tasks like converting natural language questions into SQL queries and providing step-by-step SQL breakdowns. To contribute to Wren AI Service, please refer to the [Wren AI Service Contributing Guide](https://github.com/Canner/WrenAI/blob/main/wren-ai-service/CONTRIBUTING.md) ### Wren UI Service Wren UI is the client service of WrenAI. It is built with Next.js and TypeScript. To contribute to Wren UI, you can refer to the [WrenAI/wren-ui/README.md](https://github.com/Canner/WrenAI/blob/main/wren-ui/README.md) file for instructions on how to set up the development environment and run the development server. ### Wren Engine Service Wren Engine is the backbone of the Wren AI project. The semantic engine for LLMs, bringing business context to AI agents. To contribute, please refer to [Wren Engine Contributing Guide](https://github.com/Canner/wren-engine/blob/main/ibis-server/docs/CONTRIBUTING.md) ## Guide for Contributing to Multiple Services We rely on docker-compose to start all services. If you are contributing to multiple services, you could just comment out the services you'd like to start from the source code and change the `env` variables to point to the services you started by yourself. ### Example: Contributing to the [Wren UI Service](#wren-ui-service) and [Wren Engine Service](#wren-engine-service) If you are contributing to both the [Wren UI Service](#wren-ui-service) and [Wren Engine Service](#wren-engine-service), you should comment out the `wren-engine` service in the `docker/docker-compose-dev.yml` file (note that the UI service is already excluded from `docker/docker-compose-dev.yml`). Then, adjust the environment variables in your `.env` file to point to the services you have started manually. This will ensure that your local development environment correctly interfaces with the services you are working on. 1. Prepare your `.env` file: In the `WrenAI/docker` folder, use the `.env.example` file as a template. Copy this file to create a `.env.local` file. ```sh # assuming the current directory is wren-ui cd ../docker cp .env.example .env.local ``` 2. Modify your `.env.local` file: Fill in the `OPENAI_API_KEY` with your OpenAI API keys before starting. 3. In the `WrenAI/docker` folder, copy `config.example.yaml` to `config.yaml` for AI service configuration. Also change `http://wren-ui:3000` to `http://host.docker.internal:3000` in `config.yaml`. 4. Start the UI and engine services from the source code. 5. Update the `env` variables in the `.env.local` file to point to the services you started manually. 6. Start the other services using docker-compose: ```sh # current directory is WrenAI/docker docker-compose -f docker-compose-dev.yaml --env-file .env.example up # you can add the -d flag to run the services in the background docker-compose -f docker-compose-dev.yaml --env-file .env.example up -d # to stop the services, use docker-compose -f docker-compose-dev.yaml --env-file .env.example down ``` 7. Happy coding! ## :electric_plug: Creating a New Data Source Connector To develop a new data source connector, you'll need to modify both the front-end and back-end of the Wren UI, in addition to the Wren Engine. Below is a brief overview of a data source connector: The UI is primarily responsible for storing database connection settings, providing an interface for users to input these settings, and submitting them to the Engine, which then connects to the database. The UI must be aware of the connection details it needs to retain, as specified by the Engine. Therefore, the implementation sequence would be as follows: - Engine: - Implement the new data source (you'll determine what connection information is needed and how it should be passed from the UI). - Implement the metadata API for the UI to access. - UI: - Back-End: - Safely store the connection information. - Provide the connection information to the Engine. - Front-End: - Prepare an icon for the data source. - Set up the form template for users to input the connection information. - Update the data source list. ### Wren Engine - To implement a new data source, please refer to [How to Add a New Data Source](https://github.com/Canner/wren-engine/blob/main/ibis-server/docs/how-to-add-data-source.md). - After adding a new data source, you can proceed with implementing the metadata API for the UI. Here are some previous PRs that introduced new data sources: - [Add MSSQL data source](https://github.com/Canner/wren-engine/pull/631) - [Add MySQL data source](https://github.com/Canner/wren-engine/pull/618) - [Add ClickHouse data source](https://github.com/Canner/wren-engine/pull/648) ### Wren UI Guide We'll describe what should be done in the UI for each new data source. If you prefer to learn by example, you can refer to this Trino [issue](https://github.com/Canner/WrenAI/issues/492) and [PR](https://github.com/Canner/WrenAI/pull/535). #### Backend 1. Define the data source in `wren-ui/src/apollo/server/dataSource.ts` - define the `toIbisConnectionInfo` and `sensitiveProps` methods 2. Modify the ibis adaptor in `wren-ui/src/apollo/server/adaptors/ibisAdaptor.ts` - define an ibis connection info type for the new data source - set up the `dataSourceUrlMap` for the new data source 3. Modify the repository in `wren-ui/src/apollo/server/repositories/projectRepository.ts` - define the wren ui connection info type for the new data source 4. Update the graphql schema in `wren-ui/src/apollo/server/schema.ts` so that the new data source can be used in the UI - add the new data source to the `DataSource` enum 5. Update the type definition in `wren-ui/src/apollo/server/types/dataSource.ts` - add the new data source to the `DataSourceName` enum #### Frontend 1. Prepare the data source's logo: - Image size should be `40 x 40` px - Preferably use SVG format - Ensure the logo is centered within a `30px` container for consistent formatting Example: 2. Create the data source form template: - In `wren-ui/src/components/pages/setup/dataSources`, add a new file named `${dataSource}Properties.tsx` - Implement the data source form template in this file 3. Set up the data source template: - Navigate to `wren-ui/src/utils/dataSourceType.ts` - Add new data source image, name, properties - Update the necessary files to include the new data source template settings 4. Update the data source list: - Add the new data source to the `DATA_SOURCES` enum in `wren-ui/src/utils/enum/dataSources.ts` - Update relevant files in `wren-ui/src/components/pages/setup/` to include the new data source - Ensure `wren-ui/src/apollo/server/adaptors/ibisAdaptor.ts` handle the new data source 5. Test the new connector: - Ensure the new data source appears in the UI - Verify that the form works correctly - Test the connection to the new data source ================================================ FILE: LICENSE ================================================ GNU AFFERO GENERAL PUBLIC LICENSE Version 3, 19 November 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU Affero General Public License is a free, copyleft license for software and other kinds of works, specifically designed to ensure cooperation with the community in the case of network server software. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, our General Public Licenses are intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. Developers that use our General Public Licenses protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License which gives you legal permission to copy, distribute and/or modify the software. A secondary benefit of defending all users' freedom is that improvements made in alternate versions of the program, if they receive widespread use, become available for other developers to incorporate. Many developers of free software are heartened and encouraged by the resulting cooperation. However, in the case of software used on network servers, this result may fail to come about. The GNU General Public License permits making a modified version and letting the public access it on a server without ever releasing its source code to the public. The GNU Affero General Public License is designed specifically to ensure that, in such cases, the modified source code becomes available to the community. It requires the operator of a network server to provide the source code of the modified version running there to the users of that server. Therefore, public use of a modified version, on a publicly accessible server, gives the public access to the source code of the modified version. An older license, called the Affero General Public License and published by Affero, was designed to accomplish similar goals. This is a different license, not a version of the Affero GPL, but Affero has released a new version of the Affero GPL which permits relicensing under this license. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU Affero General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Remote Network Interaction; Use with the GNU General Public License. Notwithstanding any other provision of this License, if you modify the Program, your modified version must prominently offer all users interacting with it remotely through a computer network (if your version supports such interaction) an opportunity to receive the Corresponding Source of your version by providing access to the Corresponding Source from a network server at no charge, through some standard or customary means of facilitating copying of software. This Corresponding Source shall include the Corresponding Source for any work covered by version 3 of the GNU General Public License that is incorporated pursuant to the following paragraph. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the work with which it is combined will remain governed by version 3 of the GNU General Public License. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU Affero General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU Affero General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU Affero General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU Affero General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Wren AI is a Text-to-SQL solution for data teams to get results and insights faster by asking business questions without writing SQL. Copyright (C) 2024 Canner, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If your software can interact with users remotely through a computer network, you should also make sure that it provides a way for users to get its source. For example, if your program is a web application, its interface could display a "Source" link that leads users to an archive of the code. There are many ways you could offer source, and different solutions will be better for different programs; see section 13 for the specific requirements. You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU AGPL, see . ================================================ FILE: README.md ================================================

Wren AI - Open-Source GenBI Agent

Docs

Canner%2FWrenAI | Trendshift

> ⚡ GenBI (Generative BI) queries any database in natural language, generates accurate SQL (Text-to-SQL), charts (Text-to-Chart), and AI-powered business intelligence in seconds. ️

1

## 😍 Demos https://github.com/user-attachments/assets/f9c1cb34-5a95-4580-8890-ec9644da4160 [Watch GenBI Demo](https://github.com/user-attachments/assets/90ad1d35-bb1e-490b-9676-b29863ff090b) ## 🤖 Features | | What you get | Why it matters | |--------------------|--------------|----------------| | **Talk to Your Data** | Ask in any language → precise SQL & answers | Slash the SQL learning curve | | **GenBI Insights** | AI-written summaries, charts & reports | Decision-ready context in one click | | **Semantic Layer** | MDL models encode schema, metrics, joins | Keeps LLM outputs accurate & governed | | **Embed via API** | Generate queries & charts inside your apps ([API Docs](https://wrenai.readme.io/reference/cloud-getting-started)) | Build custom agents, SaaS features, chatbots ([Streamlit Live Demo](https://huggingface.co/spaces/getWrenAI/wrenai-cloud-api-demo)) | 🤩 [Learn more about GenBI](https://getwren.ai/genbi?utm_source=github&utm_medium=content&utm_campaign=readme) ## 🚀 Getting Started Using Wren AI is super simple, you can set it up within 3 minutes, and start to interact with your data!

2

- Visit our [Install in your local environment](http://docs.getwren.ai/oss/installation?utm_source=github&utm_medium=content&utm_campaign=readme). - Visit the [Usage Guides](https://docs.getwren.ai/oss/guide/connect/overview?utm_source=github&utm_medium=content&utm_campaign=readme) to learn more about how to use Wren AI. - Or just start with [Wren AI Cloud](https://getwren.ai/?utm_source=github&utm_medium=content&utm_campaign=readme) our Managed Cloud Service. ([OSS vs. Commercial Plans](https://docs.getwren.ai/oss/overview/cloud_vs_self_host)). ## 🏗️ Architecture

wrenai-architecture

👉 [Learn more about our Design](https://getwren.ai/post/how-we-design-our-semantic-engine-for-llms-the-backbone-of-the-semantic-layer-for-llm-architecture?utm_source=github&utm_medium=content&utm_campaign=readme) ## 🔌 Data Sources If your data source is not listed here, vote for it in our [GitHub discussion thread](https://github.com/Canner/WrenAI/discussions/327). It will be a valuable input for us to decide on the next supported data sources. - Athena (Trino) - Redshift - BigQuery - DuckDB - Databricks - PostgreSQL - MySQL - Microsoft SQL Server - ClickHouse - Oracle - Trino - Snowflake ## 🤖 LLM Models Wren AI supports integration with various Large Language Models (LLMs), including but not limited to: - OpenAI Models - Azure OpenAI Models - DeepSeek Models - Google AI Studio – Gemini Models - Vertex AI Models (Gemini + Anthropic) - Bedrock Models - Anthropic API Models - Groq Models - Ollama Models - Databricks Models Check [configuration examples here](https://github.com/Canner/WrenAI/tree/main/wren-ai-service/docs/config_examples)! > [!CAUTION] > The performance of Wren AI depends significantly on the capabilities of the LLM you choose. We strongly recommend using the most powerful model available for optimal results. Using less capable models may lead to reduced performance, slower response times, or inaccurate outputs. ## 📚 Documentation Visit [Wren AI documentation](https://docs.getwren.ai/oss/overview/introduction?utm_source=github&utm_medium=content&utm_campaign=readme) to view the full documentation. ## 📪 Keep Posted? [Subscribe our blog](https://www.getwren.ai/blog/?utm_source=github&utm_medium=content&utm_campaign=readme) and [Follow our LinkedIn](https://www.linkedin.com/company/wrenai) ## 🛠️ Contribution 1. Star ⭐ the repo to show support (it really helps). 2. Open an issue for bugs, ideas, or discussions. 3. Read [Contribution Guidelines](https://github.com/Canner/WrenAI/blob/main/CONTRIBUTING.md) for setup & PR guidelines. ## ⭐️ Community - Join 1.3k+ developers in our [Discord](https://discord.gg/5DvshJqG8Z) for real-time help and roadmap previews. - If there are any issues, please visit [GitHub Issues](https://github.com/Canner/WrenAI/issues). - Explore our [public roadmap](https://wrenai.notion.site/) to stay updated on upcoming features and improvements! Please note that our [Code of Conduct](./CODE_OF_CONDUCT.md) applies to all Wren AI community channels. Users are **highly encouraged** to read and adhere to them to avoid repercussions. ## 🎉 Our Contributors

⬆️ Back to Top

================================================ FILE: SECURITY.md ================================================ # Security Policy ## Reporting a Vulnerability If you believe you have found a security vulnerability in any Canner-owned repository, please report it to us through coordinated disclosure. **Please do not report security vulnerabilities through public GitHub issues, discussions, or pull requests.** Instead, please send an email to contact[@]cannerdata.com. Please include as much of the information listed below as you can to help us better understand and resolve the issue: * The type of issue (e.g., buffer overflow, SQL injection, or cross-site scripting) * Full paths of source file(s) related to the manifestation of the issue * The location of the affected source code (tag/branch/commit or direct URL) * Any special configuration required to reproduce the issue * Step-by-step instructions to reproduce the issue * Proof-of-concept or exploit code (if possible) * Impact of the issue, including how an attacker might exploit the issue This information will help us triage your report more quickly. ================================================ FILE: deployment/README.md ================================================ # Various deployemnt starategies of the app - [x] [Docker](../docker/) - [x] [Kubernetes: Kustomizations](./kustomizations/) ================================================ FILE: deployment/kustomizations/.gitignore ================================================ *.kustomized.yaml charts/* ================================================ FILE: deployment/kustomizations/README.md ================================================ # Deployment of Wren AI to Kubernetes with Kustomization 1. Ensure you satisfy the dependencies required to deploy Wren AI. 2. Adjust the values and manifests accordingly to fit your Kubernetes environment. 3. Deploy Secrets separately. 4. Deploy the inflated kustomized app. Note: Without authentication, once you publish this on the internet, anyone can access your app, see your data, and modify your settings! ## Dependencies used in this kustomization: - nginx.ingress - external-dns - cert-manager - kubectl kustomize - helm (for minikube) ## Steps to deploy: `Suggestion`: Before deploying, check out the manifests in the `deployment/kustomizations ` folder and modify them for your Kubernetes environment. The `deployment/kustomizations` folder contains a `kustomization.yaml` file that will inflate the manifests into a `deployment/kustomizations/wrenai.kustomized.yaml` file used to deploy the app to your Kubernetes cluster. ```shell # Clone the repository with the kustomization git clone https://github.com/Canner/WrenAI.git cd WrenAI # Inflate the manifest with kustomization kubectl kustomize deployment/kustomizations --enable-helm > deployment/kustomizations/wrenai.kustomized.yaml # Create namespace kubectl create namespace wren # !!!!!!!!!!!! # MODIFY secret-wren_example.yaml manifest file FIRST # OPENAI_API_KEY is REQUIRED: without a valid key the wren-ai-service-deployment pod will not start # You must update PG_URL, otherwise wren-ui will not work #vi deployment/kustomizations/examples/secret-wren_example.yaml kubectl apply -f deployment/kustomizations/examples/secret-wren_example.yaml -n wren # Deploy the app: kubectl apply -f deployment/kustomizations/wrenai.kustomized.yaml kubectl get pods -n wren ``` ### Notes on kustomization: - `deployment/kustomizations/kustomization.yaml` is the main file responsible for versions of other apps such as Qdrant and PostgreSQL, version of your Wren AI app. It also combines resourses from the manifest such as ConfigMaps, Deployments, and Services. And example Ingress, Certificates and Secrets. - `deployment/kustomizations/base` is the base folder that contains the core Wren AI manifests, its less likely you need to modify them, but check just in case - `deployment/kustomizations/examples` is a place with examples of manifests must take a look and adjust to your k8s environment and your needs. - `deployment/kustomizations/examples/secret-wren_example.yaml` is the file you would not normally include in the kustomization file as its not a best practice and especially not a good idea to include in your GitOps repo as it contains cleartext passwords. We recommend to deploy it separately. Thant's why its commented in the `kustomization.yaml` file. - `deployment/kustomizations/examples/wrenai-ingress-example.yaml` is an example of how to deploy Ingress. You can use this as a template for your own Ingress. It contains dependancy of extarnal-dns to add your dns name to your DNS records automatically, otherwise you'll need to add it manually. Also it assumes you are using nginx.ingress, it increases timeouts, disables the owasp and modsecurity that might be enabled globaly and prevent your UI from working properly. Comment the TLS section if you do not wish to use `https` encryption. Note: without authentication, enyone can acess your app, see your data and modify your settings! - `deployment/kustomizations/examples/certificate-wren_example.yaml` is an example of how to deploy certificates for your ingress for the Wren-UI. You can use this as a template for your own certificate. It contains dependancy of cert-manager to add your certificates automatically, otherwise you'll need to add it manually. The certificate will be used by your Ingress. - `deployment/kustomizations/examples/certificate-qdrant_example.yaml` is an example of how to deploy certificates for your ingress for Qdrant. This is included just in case and is not required, usually you would not be publishing your Vector Database publically in internet. That's why it's commented in the `kustomization.yaml` file. You can use this as a template for your own certificate. It contains dependancy of cert-manager to add your certificates automatically, otherwise you'll need to add it manually. - `deployment/kustomizations/patches` folder is empty, feel free to add your own patches & overlays there. #### Wren-UI Database Starting with wren-ui version 0.6.0 by default the postgres database is used for wren-ui in this kubernetes kustomization and will be installed in the same namespace as wren-ai. - `postgres`: Database that will be installed in the same namespace as wren-ai. You *must* update `PG_URL` in the Secret manifest `deployment/kustomizations/examples/secret-wren_example.yaml`. Example: `PG_URL: "postgres://postgres:postgres@wrenai-postgresql:5432/admin_ui"` - `postgres://` This is the protocol. It tells the system that you’re connecting to a PostgreSQL database. - `postgres:postgres` These are the username(first) and password(second) for the database respectively, separated by a colon. In this case, both the username and password are “postgres”. - `@wren-postgresql` This is the hostname of the database server. "wren-postgresql" means the database server is running in a Kubernetes cluster and it is named "wren-postgresql" in the *same* namespace. If you are using another namespace you must provide the full hostname, example: `wren-postgresql.wrenai.svc.cluster.local`, "wrenai" is the namespace name, "svc.cluster.local" is the default domain name for Kubernetes services no need to change it. - `:5432` This is the port number. PostgreSQL servers listen on port 5432 by default. - `/admin_ui` This is the name of the database you’re connecting to. In this case, the database name is `admin_ui`. It can be found in the helm values file in the auth.database parameter `deployment/kustomizations/helm-values_postgresql_15.yaml` # Minikube Prepare your k8s environment. Then use the `Steps to deploy` section to deploy Wren AI app into your k8s. ```shell minikube start minikube addons enable ingress minikube addons enable metallb minikube kubectl -- get nodes minikube kubectl -- get pods -A minikube update-context helm repo add bitnami https://charts.bitnami.com/bitnami helm repo update helm install external-dns bitnami/external-dns helm install \ external-dns bitnami/external-dns \ --namespace external-dns \ --version 7.5.2 \ --create-namespace \ --set installCRDs=true kubectl get pods -n external-dns helm repo add jetstack https://charts.jetstack.io helm repo update helm install \ cert-manager jetstack/cert-manager \ --namespace cert-manager \ --version v1.13.6 \ --create-namespace \ --set installCRDs=true kubectl get pods -n cert-manager ########## # Use the `Steps to deploy` section to continue as you would on a production k8s cluster. ``` # GitOps Patches In the [patches](./patches) folder you can find usefull kustomization examples files if you wish to use existing official kustomization directly from this repo as a base kustomization layer and only customize some values. It can be usefull for you GitOps workflow and can be used in conjunction with FlexCD or ArgoCD. ================================================ FILE: deployment/kustomizations/base/cm.yaml ================================================ apiVersion: v1 kind: ConfigMap metadata: name: wren-config data: # Wren Engine Service Port WREN_ENGINE_PORT: "8080" # Wren AI Service Port WREN_AI_SERVICE_PORT: "5555" WREN_UI_ENDPOINT: http://wren-ui-svc:3000 #Release version used by wren ui https://github.com/Canner/WrenAI/blob/main/docker/docker-compose.yaml#L85-L88 WREN_PRODUCT_VERSION: "0.12.0" WREN_ENGINE_VERSION: "0.12.3" WREN_AI_SERVICE_VERSION: "0.12.1" WREN_UI_VERSION: "0.17.6" # Document store related QDRANT_HOST: "wren-qdrant" # Telemetry POSTHOG_HOST: "https://app.posthog.com" TELEMETRY_ENABLED: "false" # this is for telemetry to know the model, i think ai-service might be able to provide a endpoint to get the information GENERATION_MODEL: "gpt-4o-mini-2024-07-18" # service endpoints of AI service & engine service WREN_ENGINE_ENDPOINT: "http://wren-engine-svc:8080" WREN_AI_ENDPOINT: "http://wren-ai-service-svc:5555" #WREN_AI_ENDPOINT: "http://wren-ai-service-svc.ai-system.svc.cluster.local:5555" # "pg" for postgres as UI application database WREN_UI_DB_TYPE: pg #For bootstrap WREN_ENGINE_DATA_PATH: "/app/data" ### if DB_TYPE = "postgres" you must provide PG_URL string in the *Secret* manifest file (deployment/kustomizations/examples/secret-wren_example.yaml) to connect to postgres #DEBUG, INFO LOGGING_LEVEL: INFO IBIS_SERVER_ENDPOINT: http://wren-ibis-server-svc:8000 --- apiVersion: v1 kind: ConfigMap metadata: name: wren-ai-service-config data: config.yaml: | type: llm provider: litellm_llm timeout: 120 models: - alias: default model: gpt-4.1-nano-2025-04-14 context_window_size: 1000000 kwargs: max_tokens: 4096 n: 1 seed: 0 temperature: 0 - model: gpt-4.1-mini-2025-04-14 context_window_size: 1000000 kwargs: max_tokens: 4096 n: 1 seed: 0 temperature: 0 - model: gpt-4.1-2025-04-14 context_window_size: 1000000 kwargs: max_tokens: 4096 n: 1 seed: 0 temperature: 0 - model: gpt-5-nano-2025-08-07 context_window_size: 380000 kwargs: max_completion_tokens: 4096 n: 1 seed: 0 reasoning_effort: minimal - model: gpt-5-mini-2025-08-07 context_window_size: 380000 kwargs: max_completion_tokens: 4096 n: 1 seed: 0 reasoning_effort: minimal - model: gpt-5-2025-08-07 context_window_size: 380000 kwargs: max_completion_tokens: 4096 n: 1 seed: 0 reasoning_effort: minimal --- type: embedder provider: litellm_embedder models: - model: text-embedding-3-large alias: default timeout: 120 --- type: engine provider: wren_ui endpoint: http://wren-ui-svc:3000 --- type: engine provider: wren_ibis endpoint: http://wren-ibis-server-svc:8000 --- type: document_store provider: qdrant location: http://wren-qdrant:6333 embedding_model_dim: 3072 timeout: 120 --- type: pipeline pipes: - name: db_schema_indexing embedder: litellm_embedder.default document_store: qdrant - name: historical_question_indexing embedder: litellm_embedder.default document_store: qdrant - name: table_description_indexing embedder: litellm_embedder.default document_store: qdrant - name: db_schema_retrieval llm: litellm_llm.default embedder: litellm_embedder.default document_store: qdrant - name: historical_question_retrieval embedder: litellm_embedder.default document_store: qdrant - name: sql_generation llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: sql_correction llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: followup_sql_generation llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: sql_answer llm: litellm_llm.default - name: semantics_description llm: litellm_llm.default - name: relationship_recommendation llm: litellm_llm.default - name: question_recommendation llm: litellm_llm.default - name: question_recommendation_sql_generation llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: intent_classification llm: litellm_llm.default embedder: litellm_embedder.default document_store: qdrant - name: misleading_assistance llm: litellm_llm.default - name: data_assistance llm: litellm_llm.default - name: sql_pairs_indexing document_store: qdrant embedder: litellm_embedder.default - name: sql_pairs_retrieval document_store: qdrant embedder: litellm_embedder.default llm: litellm_llm.default - name: preprocess_sql_data llm: litellm_llm.default - name: sql_executor engine: wren_ui - name: chart_generation llm: litellm_llm.default - name: chart_adjustment llm: litellm_llm.default - name: user_guide_assistance llm: litellm_llm.default - name: sql_question_generation llm: litellm_llm.default - name: sql_generation_reasoning llm: litellm_llm.default - name: followup_sql_generation_reasoning llm: litellm_llm.default - name: sql_regeneration llm: litellm_llm.default engine: wren_ui - name: instructions_indexing embedder: litellm_embedder.default document_store: qdrant - name: instructions_retrieval embedder: litellm_embedder.default document_store: qdrant - name: sql_functions_retrieval engine: wren_ibis document_store: qdrant - name: project_meta_indexing document_store: qdrant - name: sql_tables_extraction llm: litellm_llm.default - name: sql_diagnosis llm: litellm_llm.default --- settings: doc_endpoint: https://docs.getwren.ai is_oss: true engine_timeout: 30 column_indexing_batch_size: 50 table_retrieval_size: 10 table_column_retrieval_size: 100 allow_intent_classification: true allow_sql_generation_reasoning: true allow_sql_functions_retrieval: true enable_column_pruning: false max_sql_correction_retries: 3 query_cache_maxsize: 1000 query_cache_ttl: 3600 langfuse_host: https://cloud.langfuse.com langfuse_enable: true logging_level: DEBUG development: false historical_question_retrieval_similarity_threshold: 0.9 sql_pairs_similarity_threshold: 0.7 sql_pairs_retrieval_max_size: 10 instructions_similarity_threshold: 0.7 instructions_top_k: 10 ================================================ FILE: deployment/kustomizations/base/deploy-wren-ai-service.yaml ================================================ apiVersion: apps/v1 kind: Deployment metadata: name: wren-ai-service-deployment spec: replicas: 1 selector: matchLabels: app: wren-ai-service template: metadata: labels: app: wren-ai-service spec: containers: - name: wren-ai-service image: ghcr.io/canner/wren-ai-service:latest volumeMounts: - name: config-volume mountPath: /app/data env: - name: WREN_AI_SERVICE_PORT valueFrom: configMapKeyRef: name: wren-config key: WREN_AI_SERVICE_PORT - name: OPENAI_API_KEY valueFrom: secretKeyRef: name: wrenai-secrets key: OPENAI_API_KEY - name: QDRANT_HOST valueFrom: configMapKeyRef: name: wren-config key: QDRANT_HOST - name: LOGGING_LEVEL valueFrom: configMapKeyRef: name: wren-config key: LOGGING_LEVEL - name: WREN_UI_ENDPOINT valueFrom: configMapKeyRef: name: wren-config key: WREN_UI_ENDPOINT - name: PYTHONUNBUFFERED value: "1" - name: LANGFUSE_PUBLIC_KEY valueFrom: secretKeyRef: name: wrenai-secrets key: LANGFUSE_PUBLIC_KEY - name: LANGFUSE_SECRET_KEY valueFrom: secretKeyRef: name: wrenai-secrets key: LANGFUSE_SECRET_KEY - name: CONFIG_PATH value: /app/data/config.yaml ports: - containerPort: 5555 volumes: - name: config-volume configMap: name: wren-ai-service-config items: - key: config.yaml path: config.yaml ================================================ FILE: deployment/kustomizations/base/deploy-wren-engine.yaml ================================================ apiVersion: apps/v1 kind: Deployment metadata: name: wren-engine-deployment spec: replicas: 1 selector: matchLabels: app: wren-engine template: metadata: labels: app: wren-engine spec: volumes: - name: wren-data persistentVolumeClaim: claimName: wren-data-pvc initContainers: - name: bootstrap image: ghcr.io/canner/wren-bootstrap:0.1.4 env: - name: DATA_PATH valueFrom: configMapKeyRef: name: wren-config key: WREN_ENGINE_DATA_PATH - name: PG_PASSWORD valueFrom: secretKeyRef: name: wrenai-postgresql key: postgres-password - name: PG_USERNAME valueFrom: secretKeyRef: name: wrenai-secrets key: PG_USERNAME volumeMounts: - name: wren-data mountPath: /app/data command: ["/bin/sh", "/app/init.sh"] containers: - name: wren-engine image: ghcr.io/canner/wren-engine:0.4.4 ports: - containerPort: 8080 - containerPort: 7432 volumeMounts: - name: wren-data mountPath: /usr/src/app/etc ================================================ FILE: deployment/kustomizations/base/deploy-wren-ibis-server.yaml ================================================ apiVersion: apps/v1 kind: Deployment metadata: name: wren-ibis-server spec: replicas: 1 selector: matchLabels: app: wren-ibis template: metadata: labels: app: wren-ibis spec: containers: - name: wren-ibis image: ghcr.io/canner/wren-engine-ibis:0.5.0 env: - name: WREN_ENGINE_ENDPOINT valueFrom: configMapKeyRef: name: wren-config key: WREN_ENGINE_ENDPOINT - name: LOGGING_LEVEL valueFrom: configMapKeyRef: name: wren-config key: LOGGING_LEVEL ports: - containerPort: 8000 ================================================ FILE: deployment/kustomizations/base/deploy-wren-ui.yaml ================================================ apiVersion: apps/v1 kind: Deployment metadata: name: wren-ui-deployment spec: replicas: 1 selector: matchLabels: app: wren-ui template: metadata: labels: app: wren-ui spec: containers: - name: wren-ui image: ghcr.io/canner/wren-ui:0.5.6 env: - name: DB_TYPE valueFrom: configMapKeyRef: name: wren-config key: WREN_UI_DB_TYPE - name: WREN_ENGINE_ENDPOINT valueFrom: configMapKeyRef: name: wren-config key: WREN_ENGINE_ENDPOINT - name: WREN_AI_ENDPOINT valueFrom: configMapKeyRef: name: wren-config key: WREN_AI_ENDPOINT - name: GENERATION_MODEL valueFrom: configMapKeyRef: name: wren-config key: GENERATION_MODEL - name: PG_URL valueFrom: secretKeyRef: name: wrenai-secrets key: PG_URL # telemetry - name: WREN_ENGINE_PORT valueFrom: configMapKeyRef: name: wren-config key: WREN_ENGINE_PORT - name: WREN_AI_SERVICE_VERSION valueFrom: configMapKeyRef: name: wren-config key: WREN_AI_SERVICE_VERSION - name: WREN_UI_VERSION valueFrom: configMapKeyRef: name: wren-config key: WREN_UI_VERSION - name: WREN_ENGINE_VERSION valueFrom: configMapKeyRef: name: wren-config key: WREN_ENGINE_VERSION - name: USER_UUID valueFrom: secretKeyRef: name: wrenai-secrets key: USER_UUID - name: POSTHOG_API_KEY valueFrom: secretKeyRef: name: wrenai-secrets key: POSTHOG_API_KEY - name: POSTHOG_HOST valueFrom: secretKeyRef: name: wrenai-secrets key: POSTHOG_HOST - name: TELEMETRY_ENABLED valueFrom: configMapKeyRef: name: wren-config key: TELEMETRY_ENABLED # client side - name: NEXT_PUBLIC_USER_UUID valueFrom: secretKeyRef: name: wrenai-secrets key: USER_UUID - name: NEXT_PUBLIC_POSTHOG_API_KEY valueFrom: secretKeyRef: name: wrenai-secrets key: POSTHOG_API_KEY - name: NEXT_PUBLIC_POSTHOG_HOST valueFrom: secretKeyRef: name: wrenai-secrets key: POSTHOG_HOST - name: NEXT_PUBLIC_TELEMETRY_ENABLED valueFrom: configMapKeyRef: name: wren-config key: TELEMETRY_ENABLED # configs - name: WREN_PRODUCT_VERSION valueFrom: configMapKeyRef: name: wren-config key: WREN_PRODUCT_VERSION - name: IBIS_SERVER_ENDPOINT valueFrom: configMapKeyRef: name: wren-config key: IBIS_SERVER_ENDPOINT ports: - containerPort: 3000 ================================================ FILE: deployment/kustomizations/base/pvc.yaml ================================================ apiVersion: v1 kind: PersistentVolumeClaim metadata: name: wren-data-pvc spec: accessModes: - ReadWriteOnce resources: requests: storage: 8Gi # storageClassName: vsphere-retain ================================================ FILE: deployment/kustomizations/base/svc.yaml ================================================ # Dependancy https://external-dns.io # You may want to add a DNS record for wren-ui.myhost.net host for your k8s Service instead of Ingress. # Note: without authentication, enyone can acess your app, see your data and modify your settings! # If this is the case, make sure to comment the ingress-wren_example.yaml manifest in the `kustomization.yaml` file to exclude it # And uncomment external-dns in the Service manifest here below: apiVersion: v1 kind: Service metadata: name: wren-ui-svc #annotations: ### Dependancy external-dns #external-dns.alpha.kubernetes.io/filter: 'include' #external-dns.alpha.kubernetes.io/cloudflare-proxied: 'false' #external-dns.alpha.kubernetes.io/target: wren-ui.myhost.net spec: selector: app: wren-ui ports: - protocol: TCP port: 3000 targetPort: 3000 name: http-ui --- apiVersion: v1 kind: Service metadata: name: wren-engine-svc spec: selector: app: wren-engine ports: - protocol: TCP port: 8080 targetPort: 8080 name: wren-engine - protocol: TCP port: 7432 targetPort: 7432 name: wren-engine-sql --- apiVersion: v1 kind: Service metadata: name: wren-ai-service-svc spec: selector: app: wren-ai-service ports: - protocol: TCP port: 5555 targetPort: 5555 name: wren-ai-service --- apiVersion: v1 kind: Service metadata: name: wren-ibis-server-svc spec: selector: app: wren-ibis ports: - protocol: TCP port: 8000 targetPort: 8000 name: wren-ibis ================================================ FILE: deployment/kustomizations/examples/.gitignore ================================================ secret.yaml ================================================ FILE: deployment/kustomizations/examples/certificate-qdrant_example.yaml ================================================ # To generate valid certificates into qdrant-ai.myhost.net-tls # Dependancy: install https://cert-manager.io apiVersion: cert-manager.io/v1 kind: Certificate metadata: name: qdrant-ai.myhost.net spec: dnsNames: - qdrant-ai.myhost.net issuerRef: group: cert-manager.io kind: ClusterIssuer #### Replace with the name of your issuer name: myhost.net-prod secretName: qdrant-ai.myhost.net-tls ================================================ FILE: deployment/kustomizations/examples/certificate-wren_example.yaml ================================================ # To generate valid certificates into wren-ui.myhost.net-tls # Dependancy: install https://cert-manager.io apiVersion: cert-manager.io/v1 kind: Certificate metadata: name: wren-ui.myhost.net spec: dnsNames: - wren-ui.myhost.net issuerRef: group: cert-manager.io kind: ClusterIssuer ### Replace with the name of your issuer, otherwise the secret will be produce randoom name and the ingress will not work. name: myhost.net-prod ### Your ingress will be looking for this exact name: secretName: wren-ui.myhost.net-tls ================================================ FILE: deployment/kustomizations/examples/ingress-wren_example.yaml ================================================ # Dependancy https://external-dns.io # To add a DNS record for wren-ui.myhost.net host # Note: without authentication, enyone can acess your app, see your data and modify your settings! apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: wren-ui-ingress annotations: ### Dependancy external-dns #external-dns.alpha.kubernetes.io/filter: 'include' #external-dns.alpha.kubernetes.io/cloudflare-proxied: 'false' ##external-dns.alpha.kubernetes.io/cloudflare-proxied: 'true' external-dns.alpha.kubernetes.io/target: ingress1.myhost.net #external-dns.alpha.kubernetes.io/target: ingress2.myhost.net ### Dependancy nginx-ingress-controller nginx.ingress.kubernetes.io/disable-lua: 'true' nginx.ingress.kubernetes.io/enable-lua: 'false' nginx.ingress.kubernetes.io/enable-vts-status: 'false' nginx.ingress.kubernetes.io/enable-modsecurity: 'false' #nginx.ingress.kubernetes.io/modsecurity-snippet: | # SecRuleEngine Off nginx.ingress.kubernetes.io/enable-owasp-modsecurity-crs: 'false' nginx.ingress.kubernetes.io/proxy-connect-timeout: '360' nginx.ingress.kubernetes.io/proxy-read-timeout: '360' nginx.ingress.kubernetes.io/proxy-send-timeout: '360' spec: #instead you may use other ingressClassName such as AWS alb. If other than nginx ingress is used, don't forget to comment unsupported annotations above #"nginx" or "alb" ingressClassName: nginx rules: - host: wren-ui.myhost.net http: paths: - path: / pathType: Prefix backend: service: name: wren-ui-svc port: number: 3000 ### Comment TLS section if you are not going to use https tls: - hosts: - wren-ui.myhost.net secretName: wren-ui.myhost.net-tls ================================================ FILE: deployment/kustomizations/examples/secret-wren_example.yaml ================================================ --- apiVersion: v1 kind: Secret metadata: name: wrenai-secrets type: Opaque data: # OPENAI_API_KEY is REQUIRED: without a valid key the wren-ai-service-deployment pod will not start OPENAI_API_KEY: UkVRVUlSRUQ6IHNrLXByb2otYWxsLWFjY2Vzcy1wbGFjZWhvbGRlci00LXdyZW4tYWktc2VydmljZS1kZXBsb3ltZW50 # Azure openai env AZURE_CHAT_BASE: bi9h AZURE_CHAT_KEY: bi9h AZURE_CHAT_VERSION: bi9h AZURE_EMBED_BASE: bi9h AZURE_EMBED_KEY: bi9h AZURE_EMBED_VERSION: bi9h # Langfuse: for LLM tracing LANGFUSE_PUBLIC_KEY: xxxx LANGFUSE_SECRET_KEY: xxxx ### postgres:// This is the protocol. It tells the system that you’re connecting to a PostgreSQL database. ### postgres:postgres These are the username and password for the database, separated by a colon. In this case, both the username and password are “postgres”. ### @wren-postgresql This is the hostname of the database server. "wren-postgresql" means the database server is running in a Kubernetes cluster and it is named "wren-postgresql" in the *same* namespace. If you are using another namespace you must provide the full hostname, example: `wren-postgresql.wrenai.svc.cluster.local`, "wrenai" is the namespace name, "svc.cluster.local" is the default domain name for Kubernetes services no need to change it. ### :5432 This is the port number. PostgreSQL servers listen on port 5432 by default. ### /admin_ui This is the name of the database you’re connecting to. In this case, the database name is “admin_ui”. It can be found in the helm values file in the auth.database parameter (deployment/kustomizations/helm-values_postgresql_14.yaml) ### PG_URL: "postgres://postgres:postgres@wren-postgresql:5432/admin_ui" #Fix PG_URL: cG9zdGdyZXM6Ly9wb3N0Z3Jlczpwb3N0Z3Jlc0B3cmVuLXBvc3RncmVzcWw6NTQzMi9hZG1pbl91aQo= PG_USERNAME: cG9zdGdyZXM= POSTHOG_API_KEY: cGhjX2tleS1wbGFjZWhvbGRlcg== POSTHOG_HOST: aHR0cHM6Ly9hcHAucG9zdGhvZy5jb20= USER_UUID: MDAwMDAwMDAtMDAwMC0wMDAwLTAwMDAtMDAwMDAwMDAwMDAw --- apiVersion: v1 kind: Secret metadata: name: wrenai-postgresql data: postgres-password: cG9zdGdyZXM= type: Opaque ================================================ FILE: deployment/kustomizations/helm-values-qdrant_1.11.0.yaml ================================================ replicaCount: 1 image: repository: docker.io/qdrant/qdrant pullPolicy: IfNotPresent tag: "v1.11.0" useUnprivilegedImage: false imagePullSecrets: [] nameOverride: "" fullnameOverride: "" args: ["./config/initialize.sh"] env: {} # - name: QDRANT_ALLOW_RECOVERY_MODE # value: true # checks - Readiness and liveness checks can only be enabled for either http (REST) or grpc (multiple checks not supported) # grpc checks are only available from k8s 1.24+ so as of per default we check http service: type: ClusterIP additionalLabels: {} annotations: {} loadBalancerIP: "" ports: - name: http port: 6333 targetPort: 6333 protocol: TCP checksEnabled: true - name: grpc port: 6334 targetPort: 6334 protocol: TCP checksEnabled: false - name: p2p port: 6335 targetPort: 6335 protocol: TCP checksEnabled: false ingress: enabled: false ingressClassName: "nginx" additionalLabels: {} annotations: # Dependancy: https://kubernetes-sigs.github.io/external-dns #external-dns.alpha.kubernetes.io/filter: 'include' #external-dns.alpha.kubernetes.io/cloudflare-proxied: 'true' external-dns.alpha.kubernetes.io/target: ingress1.myhost.net hosts: - host: qdrant-ai.myhost.net paths: - path: / pathType: Prefix servicePort: 6333 tls: - hosts: - qdrant-ai.myhost.net secretName: qdrant-ai.myhost.net-tls livenessProbe: enabled: false initialDelaySeconds: 5 periodSeconds: 5 timeoutSeconds: 1 failureThreshold: 6 successThreshold: 1 readinessProbe: enabled: true initialDelaySeconds: 5 periodSeconds: 5 timeoutSeconds: 1 failureThreshold: 6 successThreshold: 1 startupProbe: enabled: false initialDelaySeconds: 10 periodSeconds: 5 timeoutSeconds: 1 failureThreshold: 30 successThreshold: 1 additionalLabels: {} podAnnotations: {} podLabels: {} resources: {} # limits: # cpu: 100m # memory: 128Mi # requests: # cpu: 100m # memory: 128Mi containerSecurityContext: runAsNonRoot: true runAsUser: 1000 runAsGroup: 2000 allowPrivilegeEscalation: false privileged: false readOnlyRootFilesystem: true podSecurityContext: fsGroup: 3000 fsGroupChangePolicy: Always lifecycle: preStop: exec: # Sleeping before shutdown allows Qdrant to process requests that were # in-flight before the node is removed from load-balancing. # If using an external load balancer, you may need to increase this # duration to be greater than the LB's health check interval. command: ["sleep", "3"] # If true ensures that the pre-existing files on the storage and snapshot volume are owned by the container's # user and fsGroup updateVolumeFsOwnership: true nodeSelector: {} tolerations: [] affinity: {} topologySpreadConstraints: [] persistence: accessModes: ["ReadWriteOnce"] size: 20Gi annotations: {} # storageClassName: vsphere-retain # If you use snapshots or the snapshot shard transfer mechanism, we recommend # creating a separate volume of the same size as your main volume so that your # cluster won't crash if the snapshot is too big. snapshotPersistence: enabled: false accessModes: ["ReadWriteOnce"] size: 20Gi annotations: {} # You can change the storageClassName to ensure snapshots are saved to cold storage. # storageClassName: local-path snapshotRestoration: enabled: false # Set pvcName if you want to restore from a separately-created PVC. Only supported for single-node clusters unless the PVC is ReadWriteMany. # If you set snapshotPersistence.enabled and want to restore a snapshot from there, you can leave this blank to skip mounting an external volume. pvcName: snapshots-pvc # Must not conflict with /qdrant/snapshots or /qdrant/storage mountPath: /qdrant/snapshot-restoration snapshots: # - /qdrant/snapshot-restoration/test_collection/test_collection-2022-10-24-13-56-50.snapshot:test_collection # modification example for configuration to overwrite defaults config: cluster: enabled: true p2p: port: 6335 consensus: tick_period_ms: 100 sidecarContainers: [] # sidecarContainers: # - name: my-sidecar # image: qdrant/my-sidecar-image # imagePullPolicy: Always # ports: # - name: my-port # containerPort: 5000 # protocol: TCP # resources: # requests: # memory: 10Mi # cpu: 10m # limits: # memory: 100Mi # cpu: 100m metrics: serviceMonitor: enabled: false additionalLabels: {} scrapeInterval: 30s scrapeTimeout: 10s targetPort: http targetPath: "/metrics" ## MetricRelabelConfigs to apply to samples after scraping, but before ingestion. ## ref: https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#relabelconfig ## metricRelabelings: [] ## RelabelConfigs to apply to samples before scraping ## ref: https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#relabelconfig ## relabelings: [] serviceAccount: annotations: {} priorityClassName: "" # We disourage changing this setting. Using the "OrderedReady" policy in a # multi-node cluster will cause a deadlock where nodes refuse to become # "Ready" until all nodes are running. podManagementPolicy: Parallel podDisruptionBudget: enabled: false maxUnavailable: 1 # do not enable if you are using not in 1.27 unhealthyPodEvictionPolicy: "" # minAvailable: 1 # api key for authentication at qdrant # false: no api key will be configured # true: an api key will be auto-generated # string: the given string will be set as an apikey apiKey: false # read-only api key for authentication at qdrant # false: no read-only api key will be configured # true: an read-only api key will be auto-generated # string: the given string will be set as a read-only apikey readOnlyApiKey: false additionalVolumes: [] # - name: volumeName # emptyDir: {} additionalVolumeMounts: [] # - name: volumeName # mountPath: "/mount/path" ================================================ FILE: deployment/kustomizations/helm-values_postgresql_15.yaml ================================================ auth: secretKeys: adminPasswordKey: postgres-password existingSecret: wrenai-postgresql #creates admin_ui database global: postgresql: auth: database: admin_ui ================================================ FILE: deployment/kustomizations/kustomization.yaml ================================================ ##### Dependancies used in this kustomization: # nginx.ingress # external-dns # cert-manager # kubectl kustomize #test output like this: #kubectl kustomize deployment/kustomizations --enable-helm > deployment/kustomizations/wrenai.kustimized.yaml #kubectl create namespace wren #kubectl apply -f deployment/kustomizations/wrenai.kustimized.yaml apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization # Namespace for all resources here and in the Helm charts namespace: wren helmCharts: ### Uncomment if you are planing to use postgresql - name: postgresql repo: https://repo.vmware.com/bitnami-files version: 15.5.5 releaseName: wren-postgresql valuesFile: helm-values_postgresql_15.yaml includeCRDs: true # the Same Namespace namespace: wren - name: qdrant repo: https://qdrant.github.io/qdrant-helm version: 1.11.0 releaseName: wren-qdrant valuesFile: helm-values-qdrant_1.11.0.yaml includeCRDs: true # The Same Namespace namespace: wren images: # for the latest versions, please check here: https://github.com/Canner/WrenAI/blob/main/docker/.env.example#L23 - name: ghcr.io/canner/wren-bootstrap newTag: 0.1.5 # WREN_BOOTSTRAP_VERSION - name: ghcr.io/canner/wren-engine newTag: 0.14.8 # WREN_ENGINE_VERSION - name: ghcr.io/canner/wren-ui newTag: 0.24.1 # WREN_UI_VERSION - name: ghcr.io/canner/wren-ai-service newTag: 0.19.7 # WREN_AI_SERVICE_VERSION - name: ghcr.io/canner/wren-engine-ibis newTag: 0.14.8 # IBIS_SERVER_VERSION resources: - base/cm.yaml - base/deploy-wren-ui.yaml - base/deploy-wren-engine.yaml - base/deploy-wren-ibis-server.yaml - base/deploy-wren-ai-service.yaml - base/pvc.yaml - base/svc.yaml ### Modify these examples first and uncomment them: # - examples/ingress-wren_example.yaml # - examples/certificate-wren_example.yaml ### Usually you do not need to generate a certificate for Qdrant # - examples/certificate-qdrant_example.yaml ### Best practice is to create and deploy Secrets manually, not as part of kustomization or GitOps! # - examples/secret-wren_example.yaml ================================================ FILE: deployment/kustomizations/patches/README.md ================================================ # Example of usefull Patches for Kustomization Patches from this folder allows to utilize the official unmodified deployment/kustomization dirrectly from the repo as a base layer for your kustomization. And then add patches to update some values. This is usefull for your GitOps and can be combined with tools such as ArgoCD and FluxCD. Patch ConfigMap, and Service if needed. Remove Certificate and Ingress if not needed. ================================================ FILE: deployment/kustomizations/patches/cm.yaml ================================================ - op: replace path: /data value: # Wren Engine Service Port WREN_ENGINE_PORT: "8080" # Wren AI Service Port WREN_AI_SERVICE_PORT: "5555" #Release version used by wren ui https://github.com/Canner/WrenAI/blob/main/docker/docker-compose.yaml#L85-L88 WREN_PRODUCT_VERSION: "0.12.0" #fix: WREN_ENGINE_VERSION: "0.12.3" WREN_AI_SERVICE_VERSION: "0.12.1" #fix: WREN_UI_VERSION: "0.17.6" # OpenAI GENERATION_MODEL: "gpt-4o-mini" # Telemetry POSTHOG_HOST: "https://app.posthog.com" TELEMETRY_ENABLED: "false" # service endpoints of AI service & engine service WREN_ENGINE_ENDPOINT: "http://wren-engine-svc:8080" #fix: WREN_AI_ENDPOINT: "http://wren-ai-service:5555" # "pg" for postgres as application database. #fix DB_TYPE: pg DATA_PATH: "/app/data" ### if DB_TYPE = "postgres" you must provide PG_URL string in the *Secret* manifest file (deployment/kustomizations/examples/secret-wren_example.yaml) to connect to postgres ================================================ FILE: deployment/kustomizations/patches/rm-certificate.yaml ================================================ $patch: delete apiVersion: v1 kind: Certificate metadata: name: wren-ui.myhost.net ================================================ FILE: deployment/kustomizations/patches/rm-ingress.yaml ================================================ $patch: delete apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: wren-ui-ingress annotations: external-dns.alpha.kubernetes.io/target: ingress1.myhost.net ================================================ FILE: deployment/kustomizations/patches/service.yaml ================================================ - op: replace path: /spec/ipFamilies value: - IPv6 - IPv4 - op: replace path: /spec/type value: LoadBalancer - op: replace path: /spec/ipFamilyPolicy value: # SingleStack PreferDualStack ================================================ FILE: docker/README.md ================================================ ## Service - `wren-engine`: the engine service. check out example here: [wren-engine /example](https://github.com/Canner/wren-engine/tree/main/example) - `wren-ai-service`: the AI service. - `qdrant`: the vector store ai service is using. - `wren-ui`: the UI service. - `bootstrap`: put required files to volume for engine service. ## Volume Shared data using `data` volume. Path structure as following: - `/mdl` - `*.json` (will put `sample.json` during bootstrap) - `accounts` - `config.properties` ## Network - Check out [Network drivers overview](https://docs.docker.com/engine/network/drivers/) to learn more about `bridge` network driver. ## How to start with OpenAI 1. copy `.env.example` to `.env` and modify the OpenAI API key. 2. copy `config.example.yaml` to `config.yaml` for AI service configuration. 3. start all services: `docker-compose --env-file .env up -d`. 4. stop all services: `docker-compose --env-file .env down`. ### Optional - If your port 3000 is occupied, you can modify the `HOST_PORT` in `.env`. ## How to start with custom LLM To start with a custom LLM, the process is similar to starting with OpenAI. The main difference is that you need to modify the `config.yaml` file that we created on the previous step. After modifying the file, you can restart the services by running `docker-compose --env-file .env up -d --force-recreate wren-ai-service`. For detailed information on how to modify the configuration for different LLM providers and models, please refer to the [AI Service Configuration](../wren-ai-service/docs/configuration.md). This guide provides comprehensive instructions on setting up various LLM providers, embedders, and other components of the AI service. ================================================ FILE: docker/bootstrap/Dockerfile ================================================ FROM busybox WORKDIR /app COPY init.sh ./ ================================================ FILE: docker/bootstrap/init.sh ================================================ #!/bin/sh # declare a variable from the environment variable: DATA_PATH data_path=${DATA_PATH:-"./"} # touch a empty config.properties if not exists # put a content into config.properties if not exists if [ ! -f ${data_path}/config.properties ]; then echo "init config.properties" echo "node.environment=production" >${data_path}/config.properties fi # after the config.properties is created, check if config properties properly set # if not, then append default values to the config.properties # check if wren.experimental-enable-dynamic-fields is set, otherwise append it with true if ! grep -q "wren.experimental-enable-dynamic-fields" ${data_path}/config.properties; then echo "wren.experimental-enable-dynamic-fields is not set, set it to true" echo "wren.experimental-enable-dynamic-fields=true" >>${data_path}/config.properties fi # create a folder mdl if not exists if [ ! -d ${data_path}/mdl ]; then echo "create mdl folder" mkdir ${data_path}/mdl fi # put an emtpy sample.json if not exists if [ ! -f ${data_path}/mdl/sample.json ]; then echo "init mdl/sample.json" echo "{\"catalog\": \"test_catalog\", \"schema\": \"test_schema\", \"models\": []}" >${data_path}/mdl/sample.json fi ================================================ FILE: docker/config.example.yaml ================================================ type: llm provider: litellm_llm timeout: 120 models: - alias: default model: gpt-4.1-nano-2025-04-14 context_window_size: 1000000 kwargs: max_tokens: 4096 n: 1 seed: 0 temperature: 0 - model: gpt-4.1-mini-2025-04-14 context_window_size: 1000000 kwargs: max_tokens: 4096 n: 1 seed: 0 temperature: 0 - model: gpt-4.1-2025-04-14 context_window_size: 1000000 kwargs: max_tokens: 4096 n: 1 seed: 0 temperature: 0 - model: gpt-5-nano-2025-08-07 context_window_size: 380000 kwargs: max_completion_tokens: 4096 n: 1 seed: 0 reasoning_effort: minimal - model: gpt-5-mini-2025-08-07 context_window_size: 380000 kwargs: max_completion_tokens: 4096 n: 1 seed: 0 reasoning_effort: minimal - model: gpt-5-2025-08-07 context_window_size: 380000 kwargs: max_completion_tokens: 4096 n: 1 seed: 0 reasoning_effort: minimal --- type: embedder provider: litellm_embedder models: - model: text-embedding-3-large alias: default timeout: 120 --- type: engine provider: wren_ui endpoint: http://wren-ui:3000 --- type: engine provider: wren_ibis endpoint: http://ibis-server:8000 --- type: document_store provider: qdrant location: http://qdrant:6333 embedding_model_dim: 3072 timeout: 120 recreate_index: true --- type: pipeline pipes: - name: db_schema_indexing embedder: litellm_embedder.default document_store: qdrant - name: historical_question_indexing embedder: litellm_embedder.default document_store: qdrant - name: table_description_indexing embedder: litellm_embedder.default document_store: qdrant - name: db_schema_retrieval llm: litellm_llm.default embedder: litellm_embedder.default document_store: qdrant - name: historical_question_retrieval embedder: litellm_embedder.default document_store: qdrant - name: sql_generation llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: sql_correction llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: followup_sql_generation llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: sql_answer llm: litellm_llm.default - name: semantics_description llm: litellm_llm.default - name: relationship_recommendation llm: litellm_llm.default - name: question_recommendation llm: litellm_llm.default - name: question_recommendation_sql_generation llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: intent_classification llm: litellm_llm.default embedder: litellm_embedder.default document_store: qdrant - name: misleading_assistance llm: litellm_llm.default - name: data_assistance llm: litellm_llm.default - name: sql_pairs_indexing document_store: qdrant embedder: litellm_embedder.default - name: sql_pairs_retrieval document_store: qdrant embedder: litellm_embedder.default llm: litellm_llm.default - name: preprocess_sql_data llm: litellm_llm.default - name: sql_executor engine: wren_ui - name: chart_generation llm: litellm_llm.default - name: chart_adjustment llm: litellm_llm.default - name: user_guide_assistance llm: litellm_llm.default - name: sql_question_generation llm: litellm_llm.default - name: sql_generation_reasoning llm: litellm_llm.default - name: followup_sql_generation_reasoning llm: litellm_llm.default - name: sql_regeneration llm: litellm_llm.default engine: wren_ui - name: instructions_indexing embedder: litellm_embedder.default document_store: qdrant - name: instructions_retrieval embedder: litellm_embedder.default document_store: qdrant - name: sql_functions_retrieval engine: wren_ibis document_store: qdrant - name: project_meta_indexing document_store: qdrant - name: sql_tables_extraction llm: litellm_llm.default - name: sql_diagnosis llm: litellm_llm.default - name: sql_knowledge_retrieval engine: wren_ibis document_store: qdrant --- settings: doc_endpoint: https://docs.getwren.ai is_oss: true engine_timeout: 30 column_indexing_batch_size: 50 table_retrieval_size: 10 table_column_retrieval_size: 100 allow_intent_classification: true allow_sql_generation_reasoning: true allow_sql_functions_retrieval: true enable_column_pruning: false max_sql_correction_retries: 3 query_cache_maxsize: 1000 query_cache_ttl: 3600 langfuse_host: https://cloud.langfuse.com langfuse_enable: true logging_level: DEBUG development: false historical_question_retrieval_similarity_threshold: 0.9 sql_pairs_similarity_threshold: 0.7 sql_pairs_retrieval_max_size: 10 instructions_similarity_threshold: 0.7 instructions_top_k: 10 ================================================ FILE: docker/docker-compose-dev.yaml ================================================ version: "3" volumes: data: networks: wren: driver: bridge services: bootstrap: image: ghcr.io/canner/wren-bootstrap:${WREN_BOOTSTRAP_VERSION} pull_policy: always platform: ${PLATFORM} environment: DATA_PATH: /app/data volumes: - data:/app/data command: /bin/sh /app/init.sh wren-engine: image: ghcr.io/canner/wren-engine:${WREN_ENGINE_VERSION} pull_policy: always platform: ${PLATFORM} expose: - ${WREN_ENGINE_SQL_PORT} ports: - ${WREN_ENGINE_PORT}:${WREN_ENGINE_PORT} volumes: - data:/usr/src/app/etc networks: - wren depends_on: - bootstrap wren-ai-service: image: ghcr.io/canner/wren-ai-service:${WREN_AI_SERVICE_VERSION} pull_policy: always platform: ${PLATFORM} ports: - ${AI_SERVICE_FORWARD_PORT}:${WREN_AI_SERVICE_PORT} environment: WREN_UI_ENDPOINT: http://host.docker.internal:${WREN_UI_PORT} # sometimes the console won't show print messages, # using PYTHONUNBUFFERED: 1 can fix this PYTHONUNBUFFERED: 1 CONFIG_PATH: /app/config.yaml env_file: - ${PROJECT_DIR}/.env volumes: - ${PROJECT_DIR}/config.yaml:/app/config.yaml:ro - ${PROJECT_DIR}/data:/app/data:ro networks: - wren depends_on: - qdrant ibis-server: image: ghcr.io/canner/wren-engine-ibis:${IBIS_SERVER_VERSION} pull_policy: always platform: ${PLATFORM} expose: - 8000 ports: - ${IBIS_SERVER_PORT}:8000 environment: WREN_ENGINE_ENDPOINT: http://wren-engine:${WREN_ENGINE_PORT} LOG_LEVEL: DEBUG networks: - wren qdrant: image: qdrant/qdrant:v1.11.0 pull_policy: always ports: - 6333:6333 - 6334:6334 networks: - wren # If you want to use postgres for testing purpose, uncomment the following block # postgres: # image: postgres:14-alpine # platform: ${PLATFORM} # ports: # - 9432:5432 # volumes: # - data:/var/lib/postgresql/data # environment: # - POSTGRES_PASSWORD=secret # - POSTGRES_USER=test # - POSTGRES_DB=test # - PGDATA=/var/lib/postgresql/data/pgdata # networks: # - wren ================================================ FILE: docker/docker-compose.yaml ================================================ version: "3" volumes: data: networks: wren: driver: bridge services: bootstrap: image: ghcr.io/canner/wren-bootstrap:${WREN_BOOTSTRAP_VERSION} restart: on-failure platform: ${PLATFORM} environment: DATA_PATH: /app/data volumes: - data:/app/data command: /bin/sh /app/init.sh wren-engine: image: ghcr.io/canner/wren-engine:${WREN_ENGINE_VERSION} restart: on-failure platform: ${PLATFORM} expose: - ${WREN_ENGINE_PORT} - ${WREN_ENGINE_SQL_PORT} volumes: - data:/usr/src/app/etc - ${PROJECT_DIR}/data:/usr/src/app/data networks: - wren depends_on: - bootstrap ibis-server: image: ghcr.io/canner/wren-engine-ibis:${IBIS_SERVER_VERSION} restart: on-failure platform: ${PLATFORM} expose: - ${IBIS_SERVER_PORT} environment: WREN_ENGINE_ENDPOINT: http://wren-engine:${WREN_ENGINE_PORT} volumes: - ${LOCAL_STORAGE:-.}:/usr/src/app/data networks: - wren wren-ai-service: image: ghcr.io/canner/wren-ai-service:${WREN_AI_SERVICE_VERSION} restart: on-failure platform: ${PLATFORM} expose: - ${WREN_AI_SERVICE_PORT} ports: - ${AI_SERVICE_FORWARD_PORT}:${WREN_AI_SERVICE_PORT} environment: # sometimes the console won't show print messages, # using PYTHONUNBUFFERED: 1 can fix this PYTHONUNBUFFERED: 1 CONFIG_PATH: /app/config.yaml env_file: - ${PROJECT_DIR}/.env volumes: - ${PROJECT_DIR}/config.yaml:/app/config.yaml:ro - ${PROJECT_DIR}/data:/app/data:ro networks: - wren depends_on: - qdrant qdrant: image: qdrant/qdrant:v1.11.0 restart: on-failure expose: - 6333 - 6334 volumes: - data:/qdrant/storage networks: - wren wren-ui: image: ghcr.io/canner/wren-ui:${WREN_UI_VERSION} restart: on-failure platform: ${PLATFORM} environment: DB_TYPE: sqlite # /app is the working directory in the container SQLITE_FILE: /app/data/db.sqlite3 WREN_ENGINE_ENDPOINT: http://wren-engine:${WREN_ENGINE_PORT} WREN_AI_ENDPOINT: http://wren-ai-service:${WREN_AI_SERVICE_PORT} IBIS_SERVER_ENDPOINT: http://ibis-server:${IBIS_SERVER_PORT} # this is for telemetry to know the model, i think ai-service might be able to provide a endpoint to get the information GENERATION_MODEL: ${GENERATION_MODEL} # telemetry WREN_ENGINE_PORT: ${WREN_ENGINE_PORT} WREN_AI_SERVICE_VERSION: ${WREN_AI_SERVICE_VERSION} WREN_UI_VERSION: ${WREN_UI_VERSION} WREN_ENGINE_VERSION: ${WREN_ENGINE_VERSION} USER_UUID: ${USER_UUID} POSTHOG_API_KEY: ${POSTHOG_API_KEY} POSTHOG_HOST: ${POSTHOG_HOST} TELEMETRY_ENABLED: ${TELEMETRY_ENABLED} # client side NEXT_PUBLIC_USER_UUID: ${USER_UUID} NEXT_PUBLIC_POSTHOG_API_KEY: ${POSTHOG_API_KEY} NEXT_PUBLIC_POSTHOG_HOST: ${POSTHOG_HOST} NEXT_PUBLIC_TELEMETRY_ENABLED: ${TELEMETRY_ENABLED} EXPERIMENTAL_ENGINE_RUST_VERSION: ${EXPERIMENTAL_ENGINE_RUST_VERSION} # configs WREN_PRODUCT_VERSION: ${WREN_PRODUCT_VERSION} ports: # HOST_PORT is the port you want to expose to the host machine - ${HOST_PORT}:3000 volumes: - data:/app/data networks: - wren depends_on: - wren-ai-service - wren-engine ================================================ FILE: wren-ai-service/.dockerignore ================================================ * !src !entrypoint.sh !pyproject.toml src/eval ================================================ FILE: wren-ai-service/.pre-commit-config.yaml ================================================ repos: - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. rev: v0.2.2 hooks: # Run the linter. - id: ruff args: [ --fix ] # Run the formatter. - id: ruff-format ================================================ FILE: wren-ai-service/CONTRIBUTING.md ================================================ # Welcome to Wren AI Service contributing guide Thank you for investing your time in contributing to our project! This document provides guidelines for contributing to the Wren AI service. ## New contributor guide - To get an overview of the project, please read the [concepts](https://docs.getwren.ai/oss/concept/wren_ai_service). - To set up the project for local development, please read [Environment Setup](README.md#environment-setup) and [Start the service for development](README.md#start-the-service-for-development) - To understand the codebase more quickly, we've prepared [a codebase introduciton](docs/code_design.md) for you. ## Getting started ### Issues #### Create a new issue If you spot a problem, search if an issue already exists. If a related issue doesn't exist, you can open a new [issue](https://github.com/Canner/WrenAI/issues/new/choose). #### Solve an issue Scan through our [existing issues](https://github.com/Canner/WrenAI/issues?q=is%3Aopen+is%3Aissue+label%3Amodule%2Fai-service) to find one that interests you. As a general rule, we don't assign issues to anyone. If you find an issue to work on, you are welcome to open a PR with a fix. ### Pull Request When you've finished with the changes, create a pull request, also known as a PR. - Fill the description so that we can review your PR. - Don't forget to [link PR to issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) if you are solving one. - Add the `module/ai-service` label to your PR. - Enable the checkbox to [allow maintainer edits](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/allowing-changes-to-a-pull-request-branch-created-from-a-fork) so the branch can be updated for a merge. Once you submit your PR, a Canner team member will review your proposal. We may ask questions or request additional information. - We may ask for changes to be made before a PR can be merged, either using [suggested changes](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/incorporating-feedback-in-your-pull-request) or pull request comments. You can apply suggested changes directly through the UI. You can make any other changes in your fork, then commit them to your branch. - As you update your PR and apply changes, mark each conversation as [resolved](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/commenting-on-a-pull-request#resolving-conversations). - Be sure to add one of the prefixes to the PR title, so that our CI could automatically capture the changelog of this PR. - `feat(wren-ai-service)`: for new features - `chore(wren-ai-service)`: for maintenance work - `fix(wren-ai-service)`: for bug fixes - If you run into any merge issues, checkout this [git tutorial](https://github.com/skills/resolve-merge-conflicts) to help you resolve merge conflicts and other issues. ### Your PR is merged! Congratulations :tada::tada: The Canner team thanks you :sparkles:. Once your PR is merged, your contributions will be worked on the next release. Now that you are part of the Canner community. ## How to add your preferred LLM, Embedder or Document Store - Please read [this documentation for further details](https://docs.getwren.ai/oss/ai_service/guide/custom_llm#adding-a-custom-llm-embedder-or-document-store-to-wren-ai). ================================================ FILE: wren-ai-service/Justfile ================================================ GREEN := "\u{001b}[32m" YELLOW := "\u{001b}[33m" RESET := "\u{001b}[0m" ## todo: consider to support --override flag to override existing files init dev='--dev': @if [ ! -f config.yaml ]; then \ echo "{{GREEN}}config.yaml does not exist. Creating from example...{{RESET}}"; \ cp tools/config/config.example.yaml config.yaml; \ else \ echo "{{YELLOW}}config.yaml already exists. Skipping creation.{{RESET}}"; \ fi @if [ {{dev}} = "--dev" ] || [ {{dev}} != "--non-dev" ]; then \ if [ ! -f .env.dev ]; then \ echo "{{GREEN}}.env.dev does not exist. Creating from example...{{RESET}}"; \ cp tools/config/.env.dev.example .env.dev; \ else \ echo "{{YELLOW}}.env.dev already exists. Skipping creation.{{RESET}}"; \ fi \ fi up: prepare-files docker compose -f ./tools/dev/docker-compose-dev.yaml --env-file ./tools/dev/.env up -d down: docker compose -f ./tools/dev/docker-compose-dev.yaml --env-file ./tools/dev/.env down start: force_update_config poetry run python -m src.__main__ curate_eval_data: poetry run streamlit run eval/data_curation/app.py prep dataset='spider1.0': poetry run python -m eval.preparation --dataset {{dataset}} predict dataset pipeline='ask': poetry run python -u eval/prediction.py --file {{dataset}} --pipeline {{pipeline}} eval prediction_result semantics='--no-semantics': poetry run python -u eval/evaluation.py --file {{prediction_result}} {{semantics}} test test_args='': up && down poetry run pytest -s {{test_args}} --ignore tests/pytest/test_usecases.py test-usecases usecases='all' lang='en': poetry run python -m tests.pytest.test_usecases --usecases {{usecases}} --lang {{lang}} load-test: poetry run python -m tests.locust.locust_script prepare-files: # only remove files related to engine and ui rm -rf tools/dev/etc/duckdb tools/dev/etc/mdl tools/dev/etc/config.properties tools/dev/etc/db.sqlite3 tools/dev/etc/archived mkdir -p tools/dev/etc cp tools/dev/config.properties.example tools/dev/etc/config.properties mkdir -p tools/dev/etc/mdl echo "{\"catalog\": \"test_catalog\", \"schema\": \"test_schema\", \"models\": []}" \\ > tools/dev/etc/mdl/sample.json force_update_config: poetry run python -m src.force_update_config run-sql mdl_path="" data_source="" sample_dataset="": poetry run python tools/run_sql.py --mdl-path "{{mdl_path}}" --data-source "{{data_source}}" --sample-dataset "{{sample_dataset}}" mdl-to-str mdl_path="": poetry run python tools/mdl_to_str.py -p {{mdl_path}} ================================================ FILE: wren-ai-service/README.md ================================================ # AI Service of Wren AI ## Concepts Please read the [documentation](https://docs.getwren.ai/oss/concept/wren_ai_service) here to understand the concepts of Wren AI Service. ## Setup for Local Development ### Prerequisites 1. **Python**: Install Python 3.12.\* - Recommended: Use [`pyenv`](https://github.com/pyenv/pyenv?tab=readme-ov-file#installation) to manage Python versions 2. **Poetry**: Install Poetry 1.8.3 ```bash curl -sSL https://install.python-poetry.org | python3 - --version 1.8.3 ``` 3. **Just**: Install [Just](https://github.com/casey/just?tab=readme-ov-file#packages) command runner (version 1.36 or higher) ### Step-by-Step Setup 1. **Install Dependencies**: ```bash poetry install ``` 2. **Generate Configuration Files**: ```bash just init ``` This creates both `.env.dev` and `config.yaml`. Use `just init --non-dev` to generate only `config.yaml`. > For Windows, add the line `set shell:= ["bash", "-cu"]` at the start of the Justfile. 4. **Configure Environment**: - Edit `.env.dev` to set environment variables - Modify `config.yaml` to configure components, pipelines, and other settings - Refer to [AI Service Configuration](./docs/configuration.md) for detailed setup instructions 5. **Set Up Development Environment** (optional): - Install pre-commit hooks: ```bash poetry run pre-commit install ``` - Run initial pre-commit checks: ```bash poetry run pre-commit run --all-files ``` 6. **Run Tests** (optional): ```bash just test ``` ### Starting the Service 1. **Start Required Containers**: ```bash just up ``` 2. **Launch the AI Service**: ```bash just start ``` 3. **Access the Service**: - API Documentation: `http://WREN_AI_SERVICE_HOST:WREN_AI_SERVICE_PORT` (default: ) - User Interface: `http://WREN_UI_HOST:WREN_UI_PORT` (default: ) 4. **Stop the Service**: When finished, stop the containers: ```bash just down ``` This setup ensures a consistent development environment and helps maintain code quality through pre-commit hooks and tests. Follow these steps to get started with local development of the Wren AI Service. ## Others ### Pipeline Evaluation For a comprehensive understanding of how to evaluate the pipelines, please refer to the [evaluation framework](./eval/README.md). This document provides detailed guidelines on the evaluation process, including how to set up and run evaluations, interpret results, and utilize the evaluation metrics effectively. It is a valuable resource for ensuring that the evaluation is conducted accurately and that the results are meaningful. ### Estimate the Speed of the Pipeline(may be outdated) - to run the load test - setup `DATASET_NAME` in `.env.dev` - adjust test config if needed - adjust user count in `tests/locust/config_users.json` - in wren-ai-service folder, run `just up` to start the docker containers - in wren-ai-service folder, run `just start` to start the ai service - run `just load-test` - check reports in /outputs/locust folder, there are 3 files with filename **locust*report*{test_timestamp}**: - .json: test report in json format, including info like llm provider, version - .html: test report in html format, showing tables and charts - .log: test log ## Contributing Thank you for investing your time in contributing to our project! Please [read this for more information](CONTRIBUTING.md)! ================================================ FILE: wren-ai-service/docker/Dockerfile ================================================ # reference: https://medium.com/@albertazzir/blazing-fast-python-docker-builds-with-poetry-a78a66f5aed0 FROM python:3.12.0-bookworm as builder RUN pip install poetry==1.8.3 ENV POETRY_NO_INTERACTION=1 \ POETRY_VIRTUALENVS_IN_PROJECT=1 \ POETRY_VIRTUALENVS_CREATE=1 \ POETRY_CACHE_DIR=/tmp/poetry_cache WORKDIR /app COPY pyproject.toml ./ RUN poetry install --without dev,eval,test --no-root && rm -rf $POETRY_CACHE_DIR FROM python:3.12.0-slim-bookworm as runtime RUN apt-get update && apt install -y netcat-traditional ENV VIRTUAL_ENV=/app/.venv \ PATH="/app/.venv/bin:$PATH" COPY --from=builder ${VIRTUAL_ENV} ${VIRTUAL_ENV} COPY src src COPY entrypoint.sh /app/entrypoint.sh COPY pyproject.toml pyproject.toml RUN chmod +x /app/entrypoint.sh ENTRYPOINT [ "/app/entrypoint.sh" ] ================================================ FILE: wren-ai-service/docs/code_design.md ================================================ # Introduction to the codebase of wren-ai-service ## Table of Contents - [Purpose](#purpose) - [Environment Setup and Start wren-ai-service Locally](#environment-setup-and-start-wren-ai-service-locally) - [Codebase Introduction](#codebase-introduction) - [Entrypoint](#entrypoint) - [Globals](#globals) - [API endpoints](#api-endpoints) - [Services](#services) - [Pipelines](#pipelines) - [Providers](#providers) - [Others](#others) ## Purpose This document aims to dive deep to the implementation details of wren-ai-service. We have two goals in mind while writing the document: 1. You will be more knowledgeable about how wren-ai-service works under the hood. 2. You will be more confident on what part of codebase is needed for adjustment if you would like to be Wren AI's contributor. ## Environment Setup and Start wren-ai-service Locally If you haven't setup the environment or don't know how to run wren-ai-service locally, please refer to the [document](../README.md#setup-for-local-development) here first. ## Codebase Introduction wren-ai-service is basically an AI service which provides REST api endpoints for access. There are 4 main concepts to wren-ai-service: `API endpoints`, `Services`, `Pipelines` and `Providers`. 1. `API endpoints`: They are entry points for users to access several kinds of RAG(retrieval-augmented-generation) systems; you can also see API endpoints as encapsulation of Services. For example, when users need to ask a question in order to get SQL, they need to call `/ask` and there is AskService under the hood for background computation. 2. `Services`: They are abstraction of business-logic concepts, such as AskService for users asking questions to get SQL results back, AskDetailsService for users to get SQL breakdown as several sub-steps in order to understand the logic behind the original SQL. Every service is composed of a series of pipelines. 3. `Pipelines`: Basically RAG systems are actually implemented here. However, not all pipelines have complete indexing, retrieval and generation components; it depends on what's the purpose of the pipeline. Also, every pipeline contains some providers such as LLM provider, which represents an LLM. 4. `Providers`: Now there are 4 kinds of providers: - llm: representing large language models, and now we support OpenAI, Azure OpenAI, OpenAI api-compatible and Ollama models - embedder: representing embedding models, and now we support OpenAI, Azure OpenAI, OpenAI api-compatible and Ollama models - document store: representing vector database, and now we use Qdrant - engine: representing data engine, which is responsible for validating generated SQL's syntax. ### Entrypoint - The entry point of wren-ai-service is located at [`wren-ai-service/src/__main__.py`](../src/__main__.py) - The main point of the entry point is the `lifespan` method, which is FastAPI's feature for defining startup and shutdown logic. ```python # https://fastapi.tiangolo.com/advanced/events/#lifespan @asynccontextmanager async def lifespan(app: FastAPI): # startup events pipe_components = generate_components() app.state.service_container = create_service_container( pipe_components, column_indexing_batch_size=( int(os.getenv("COLUMN_INDEXING_BATCH_SIZE")) if os.getenv("COLUMN_INDEXING_BATCH_SIZE") else 50 ), table_retrieval_size=( int(os.getenv("TABLE_RETRIEVAL_SIZE")) if os.getenv("TABLE_RETRIEVAL_SIZE") else 10 ), table_column_retrieval_size=( int(os.getenv("TABLE_COLUMN_RETRIEVAL_SIZE")) if os.getenv("TABLE_COLUMN_RETRIEVAL_SIZE") else 1000 ), query_cache={ # the maxsize is a necessary parameter to init cache, but we don't want to expose it to the user # so we set it to 1_000_000, which is a large number "maxsize": 1_000_000, "ttl": int(os.getenv("QUERY_CACHE_TTL") or 120), }, ) app.state.service_metadata = create_service_metadata(pipe_components) init_langfuse() yield # shutdown events langfuse_context.flush() ``` - For startup logic, we initialize pipeline components, service containers(which include all services), service metadata(which is some metadata logged for traces inside [Langfuse, an open-source LLM engineering platform](https://langfuse.com/)) and Langfuse. - For initializing pipeline components, we are in the progress of supporting multiple LLMs, namely users can choose which LLM is responsible for each pipeline. - You still need to have `.env.dev` locally, then you can prepare `config.yaml` and run `just start`. - For shutdown logic, we make sure all Langfuse events are transmitted successfully ### Globals - The file is located at [`wren-ai-service/src/globals.py`](../src/globals.py) - You can understand the details of service containers and service metadata here - service containers(Other services are not supported in UI yet) - SemanticsPreparationService: this is responsible for indexing [MDL](https://docs.getwren.ai/oss/engine/concept/what_is_mdl) to Qdarnt - AskService: this is responsible for answering users' questions with SQLs, namely text-to-sql - AskDetailsService: this is responsible for SQL breakdown to several sub-steps - service metadata - We will record llm's and embedding model's metadata, wren-ai-service version, etc. ### API endpoints - All business related API endpoints are located at [`wren-ai-service/src/web/v1/routers`](../src/web/v1/routers) - Since computation for each kind of API endpoint(ex. ask, etc.) takes several seconds, so we use FastAPI's `background_tasks`. For example, after the `ask` api is invoked, the response is immediately returned, then users need to conduct polling in order to get the latest task status; and once the status is `finished`, the result is returned correspondingly - Each kind of API endpoint corresponds to one kind of business related task, for example, AskService, AskDetailsService ### Services - All services are located at [`wren-ai-service/src/web/v1/services`](../src/web/v1/services) ### Pipelines - All pipelines are located at [`wren-ai-service/src/pipelines`](../src/pipelines) - Since all pipelines are actually RAG systems, so we classify the role of each pipeline as indexing, retrieval or generation - The abstract class is defined at [`wren-ai-service/src/core/pipeline.py`](../src/core/pipeline.py) ### Providers - All providers are located at [`wren-ai-service/src/providers`](../src/providers) - The abstract classes for providers(LLM, embedding model and document store) are defined at [`wren-ai-service/src/core/provider.py`](../src/core/provider.py) - The abstract class for engine is defined at [`wren-ai-service/src/core/engine.py`](../src/core/engine.py) ================================================ FILE: wren-ai-service/docs/config_examples/README.md ================================================ # MUST READ!!! Since these config files are examples, so **please carefully read the file and comments inside**. Try to understand the purpose of each section and parameter, **don't simply copy and paste the content of these config files into your own config file. It will not work.** For more detailed information to the configurations, please [read this file](../configuration.md). We also definitely welcome your contribution to add config files for other LLM providers. ## Qwen3 Think and No_Think Configuration The `config.qwen3.yaml` file provides an example configuration for using Qwen3 models with their unique thinking and non-thinking capabilities. Qwen3 models support two modes: ### Thinking Mode - Use `/think` in your prompts to enable step-by-step reasoning - Optimized with `temperature=0.6`, `top_p=0.95`, `top_k=20` - Best for complex problems requiring detailed reasoning - Uses the `qwen3-thinking` alias in the pipeline configuration ### Non-Thinking Mode - Use `/no_think` in your prompts for direct, fast responses - Optimized with `temperature=0.7`, `top_p=0.8`, `top_k=20` - Best for simple queries and general conversation - Uses the `qwen3-fast` alias in the pipeline configuration ### Available Models - `qwen/qwen3-30b-a3b`: 30B parameter MoE model (3.3B activated) - `qwen/qwen3-32b`: 32B parameter dense model - `qwen/qwen3-8b`: 8B parameter dense model - `qwen/qwen3-14b`: 14B parameter dense model ### Usage Examples ``` # Enable thinking for complex reasoning "Explain the mathematical proof for the Pythagorean theorem /think" # Use fast mode for simple queries "What is the capital of France? /no_think" ``` **Note**: You need to set `OPENROUTER_API_KEY` in your `~/.wrenai/.env` file to use OpenRouter as the provider for Qwen3 models. ================================================ FILE: wren-ai-service/docs/config_examples/config.anthropic.yaml ================================================ # you should rename this file to config.yaml and put it in ~/.wrenai # please pay attention to the comments starting with # and adjust the config accordingly, 3 steps basically: # 1. you need to use your own llm and embedding models # 2. fill in embedding model dimension in the document_store section # 3. you need to use the correct pipe definitions based on https://raw.githubusercontent.com/canner/WrenAI//docker/config.example.yaml # 4. you need to fill in correct llm and embedding models in the pipe definitions type: llm provider: litellm_llm timeout: 120 models: # put ANTHROPIC_API_KEY= in ~/.wrenai/.env - api_base: https://api.anthropic.com model: anthropic/claude-3-7-sonnet-20250219 alias: default timeout: 600 kwargs: n: 1 temperature: 0 --- type: embedder provider: litellm_embedder models: # anthropic embedding model is not supported yet, so we use openai embedding model as a workaround - model: text-embedding-3-large alias: default timeout: 120 --- type: engine provider: wren_ui endpoint: http://wren-ui:3000 --- type: engine provider: wren_ibis endpoint: http://ibis-server:8000 --- type: document_store provider: qdrant location: http://qdrant:6333 embedding_model_dim: 3072 # put your embedding model dimension here timeout: 120 recreate_index: true --- type: pipeline pipes: - name: db_schema_indexing embedder: litellm_embedder.default document_store: qdrant - name: historical_question_indexing embedder: litellm_embedder.default document_store: qdrant - name: table_description_indexing embedder: litellm_embedder.default document_store: qdrant - name: db_schema_retrieval llm: litellm_llm.default embedder: litellm_embedder.default document_store: qdrant - name: historical_question_retrieval embedder: litellm_embedder.default document_store: qdrant - name: sql_generation llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: sql_correction llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: followup_sql_generation llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: sql_answer llm: litellm_llm.default - name: semantics_description llm: litellm_llm.default - name: relationship_recommendation llm: litellm_llm.default engine: wren_ui - name: question_recommendation llm: litellm_llm.default - name: question_recommendation_db_schema_retrieval llm: litellm_llm.default embedder: litellm_embedder.default document_store: qdrant - name: question_recommendation_sql_generation llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: intent_classification llm: litellm_llm.default embedder: litellm_embedder.default document_store: qdrant - name: misleading_assistance llm: litellm_llm.default - name: data_assistance llm: litellm_llm.default - name: sql_pairs_indexing document_store: qdrant embedder: litellm_embedder.default - name: sql_pairs_retrieval document_store: qdrant embedder: litellm_embedder.default llm: litellm_llm.default - name: preprocess_sql_data llm: litellm_llm.default - name: sql_executor engine: wren_ui - name: user_guide_assistance llm: litellm_llm.default - name: chart_generation llm: litellm_llm.default - name: chart_adjustment llm: litellm_llm.default - name: sql_question_generation llm: litellm_llm.default - name: sql_generation_reasoning llm: litellm_llm.default - name: followup_sql_generation_reasoning llm: litellm_llm.default - name: sql_regeneration llm: litellm_llm.default engine: wren_ui - name: instructions_indexing embedder: litellm_embedder.default document_store: qdrant - name: instructions_retrieval embedder: litellm_embedder.default document_store: qdrant - name: sql_functions_retrieval engine: wren_ibis document_store: qdrant - name: project_meta_indexing document_store: qdrant - name: sql_tables_extraction llm: litellm_llm.default - name: sql_diagnosis llm: litellm_llm.default - name: sql_knowledge_retrieval engine: wren_ibis document_store: qdrant --- settings: engine_timeout: 30 column_indexing_batch_size: 50 table_retrieval_size: 10 table_column_retrieval_size: 100 allow_intent_classification: true allow_sql_generation_reasoning: true allow_sql_functions_retrieval: true enable_column_pruning: false max_sql_correction_retries: 3 query_cache_maxsize: 1000 query_cache_ttl: 3600 langfuse_host: https://cloud.langfuse.com langfuse_enable: true logging_level: DEBUG development: false historical_question_retrieval_similarity_threshold: 0.9 sql_pairs_similarity_threshold: 0.7 sql_pairs_retrieval_max_size: 10 instructions_similarity_threshold: 0.7 instructions_top_k: 10 ================================================ FILE: wren-ai-service/docs/config_examples/config.azure.yaml ================================================ # you should rename this file to config.yaml and put it in ~/.wrenai # please pay attention to the comments starting with # and adjust the config accordingly, 3 steps basically: # 1. you need to use your own llm and embedding models # 2. fill in embedding model dimension in the document_store section # 3. you need to use the correct pipe definitions based on https://raw.githubusercontent.com/canner/WrenAI//docker/config.example.yaml # 4. you need to fill in correct llm and embedding models in the pipe definitions type: llm provider: litellm_llm models: # put AZURE_OPENAI_API_KEY= in ~/.wrenai/.env - model: azure/gpt-4 # Your Azure deployment name, put 'azure/' before deployment name alias: default api_base: https://endpoint.openai.azure.com # Replace with your custom Azure endpoint api_version: 2024-02-15-preview timeout: 120 kwargs: temperature: 0 n: 1 seed: 0 max_tokens: 4096 --- type: embedder provider: litellm_embedder models: # put AZURE_OPENAI_API_KEY= in ~/.wrenai/.env - model: azure/text-embedding-ada-002 # Your Azure deployment name, put 'azure/' before deployment name alias: default api_base: https://endpoint.openai.azure.com # Replace with your custom Azure endpoint api_version: 2023-05-15 timeout: 300 --- type: engine provider: wren_ui endpoint: http://wren-ui:3000 --- type: engine provider: wren_ibis endpoint: http://ibis-server:8000 --- type: document_store provider: qdrant location: http://qdrant:6333 embedding_model_dim: 1536 # put your embedding model dimension here timeout: 120 recreate_index: true --- # please change the llm and embedder names to the ones you want to use # the format of llm and embedder should be . such as litellm_llm.gpt-4o-2024-08-06 # the pipes may be not the latest version, please refer to the latest version: https://raw.githubusercontent.com/canner/WrenAI//docker/config.example.yaml type: pipeline pipes: - name: db_schema_indexing embedder: litellm_embedder.default document_store: qdrant # Match document_store name llm: litellm_llm.default - name: historical_question_indexing embedder: litellm_embedder.default document_store: qdrant - name: table_description_indexing embedder: litellm_embedder.default document_store: qdrant - name: db_schema_retrieval llm: litellm_llm.default embedder: litellm_embedder.default document_store: qdrant - name: historical_question_retrieval embedder: litellm_embedder.default document_store: qdrant - name: sql_generation llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: sql_correction llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: followup_sql_generation llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: sql_answer llm: litellm_llm.default - name: semantics_description llm: litellm_llm.default - name: relationship_recommendation llm: litellm_llm.default engine: wren_ui - name: question_recommendation llm: litellm_llm.default - name: intent_classification llm: litellm_llm.default embedder: litellm_embedder.default document_store: qdrant - name: misleading_assistance llm: litellm_llm.default - name: data_assistance llm: litellm_llm.default - name: sql_pairs_preparation document_store: qdrant embedder: litellm_embedder.default llm: litellm_llm.default - name: sql_pairs_retrieval document_store: qdrant embedder: litellm_embedder.default llm: litellm_llm.default - name: preprocess_sql_data llm: litellm_llm.default - name: sql_executor engine: wren_ui - name: user_guide_assistance llm: litellm_llm.default - name: chart_generation llm: litellm_llm.default - name: chart_adjustment llm: litellm_llm.default - name: sql_pairs_indexing document_store: qdrant embedder: litellm_embedder.default - name: sql_generation_reasoning llm: litellm_llm.default - name: followup_sql_generation_reasoning llm: litellm_llm.default - name: question_recommendation_db_schema_retrieval llm: litellm_llm.default embedder: litellm_embedder.default document_store: qdrant - name: question_recommendation_sql_generation llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: sql_question_generation llm: litellm_llm.default - name: sql_regeneration llm: litellm_llm.default engine: wren_ui - name: instructions_indexing embedder: litellm_embedder.default document_store: qdrant - name: instructions_retrieval embedder: litellm_embedder.default document_store: qdrant - name: sql_functions_retrieval engine: wren_ibis document_store: qdrant - name: project_meta_indexing document_store: qdrant - name: sql_tables_extraction llm: litellm_llm.default - name: sql_diagnosis llm: litellm_llm.default - name: sql_knowledge_retrieval engine: wren_ibis document_store: qdrant --- settings: engine_timeout: 30 column_indexing_batch_size: 50 table_retrieval_size: 10 table_column_retrieval_size: 100 allow_intent_classification: true allow_sql_generation_reasoning: true allow_sql_functions_retrieval: true enable_column_pruning: false max_sql_correction_retries: 3 query_cache_maxsize: 1000 query_cache_ttl: 3600 langfuse_host: https://cloud.langfuse.com langfuse_enable: true logging_level: DEBUG development: false historical_question_retrieval_similarity_threshold: 0.9 sql_pairs_similarity_threshold: 0.7 sql_pairs_retrieval_max_size: 10 instructions_similarity_threshold: 0.7 instructions_top_k: 10 ================================================ FILE: wren-ai-service/docs/config_examples/config.bedrock.yaml ================================================ # you should rename this file to config.yaml and put it in ~/.wrenai # please pay attention to the comments starting with # and adjust the config accordingly, 3 steps basically: # 1. you need to use your own llm and embedding models # 2. fill in embedding model dimension in the document_store section # 3. you need to use the correct pipe definitions based on https://raw.githubusercontent.com/canner/WrenAI//docker/config.example.yaml # 4. you need to fill in correct llm and embedding models in the pipe definitions type: llm provider: litellm_llm timeout: 120 models: - model: bedrock/us.anthropic.claude-3-7-sonnet-20250219-v1:0 # Inference profile ID, us. -> us-east-1, You can get it from "Cross-region inference" section api_base: https://bedrock-runtime..amazonaws.com alias: default kwargs: temperature: 0.1 aws_region_name: aws_bedrock_runtime_endpoint: https://bedrock-runtime..amazonaws.com # to authenticate via iam role aws_role_name: ## other available configs # aws_access_key_id: # aws_secret_access_key: # aws_session_token: # aws_session_name: # aws_profile_name: # aws_web_identity_token: # aws_sts_endpoint: --- type: embedder provider: litellm_embedder models: - model: bedrock/amazon.titan-embed-text-v2:0 api_base: https://bedrock-runtime..amazonaws.com timeout: 600 alias: default kwargs: temperature: 0.1 aws_region_name: aws_role_name: aws_bedrock_runtime_endpoint: https://bedrock-runtime..amazonaws.com --- type: engine provider: wren_ui endpoint: http://wren-ui:3000 --- type: engine provider: wren_ibis endpoint: http://ibis-server:8000 --- type: document_store provider: qdrant location: http://qdrant:6333 embedding_model_dim: 1024 # put your embedding model dimension here, 1024 for amazon-titan timeout: 120 recreate_index: true --- type: pipeline pipes: - name: db_schema_indexing embedder: litellm_embedder.default document_store: qdrant - name: historical_question_indexing embedder: litellm_embedder.default document_store: qdrant - name: table_description_indexing embedder: litellm_embedder.default document_store: qdrant - name: db_schema_retrieval llm: litellm_llm.default embedder: litellm_embedder.default document_store: qdrant - name: historical_question_retrieval embedder: litellm_embedder.default document_store: qdrant - name: sql_generation llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: sql_correction llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: followup_sql_generation llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: sql_answer llm: litellm_llm.default - name: semantics_description llm: litellm_llm.default - name: relationship_recommendation llm: litellm_llm.default engine: wren_ui - name: question_recommendation llm: litellm_llm.default - name: question_recommendation_db_schema_retrieval llm: litellm_llm.default embedder: litellm_embedder.default document_store: qdrant - name: question_recommendation_sql_generation llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: intent_classification llm: litellm_llm.default embedder: litellm_embedder.default document_store: qdrant - name: misleading_assistance llm: litellm_llm.default - name: data_assistance llm: litellm_llm.default - name: sql_pairs_indexing document_store: qdrant embedder: litellm_embedder.default - name: sql_pairs_retrieval document_store: qdrant embedder: litellm_embedder.default llm: litellm_llm.default - name: preprocess_sql_data llm: litellm_llm.default - name: sql_executor engine: wren_ui - name: user_guide_assistance llm: litellm_llm.default - name: chart_generation llm: litellm_llm.default - name: chart_adjustment llm: litellm_llm.default - name: sql_question_generation llm: litellm_llm.default - name: sql_generation_reasoning llm: litellm_llm.default - name: followup_sql_generation_reasoning llm: litellm_llm.default - name: sql_regeneration llm: litellm_llm.default engine: wren_ui - name: instructions_indexing embedder: litellm_embedder.default document_store: qdrant - name: instructions_retrieval embedder: litellm_embedder.default document_store: qdrant - name: sql_functions_retrieval engine: wren_ibis document_store: qdrant - name: project_meta_indexing document_store: qdrant - name: sql_tables_extraction llm: litellm_llm.default - name: sql_diagnosis llm: litellm_llm.default - name: sql_knowledge_retrieval engine: wren_ibis document_store: qdrant --- settings: engine_timeout: 30 column_indexing_batch_size: 50 table_retrieval_size: 10 table_column_retrieval_size: 100 allow_intent_classification: true allow_sql_generation_reasoning: true allow_sql_functions_retrieval: true enable_column_pruning: false max_sql_correction_retries: 3 query_cache_maxsize: 1000 query_cache_ttl: 3600 langfuse_host: https://cloud.langfuse.com langfuse_enable: true logging_level: DEBUG development: false historical_question_retrieval_similarity_threshold: 0.9 sql_pairs_similarity_threshold: 0.7 sql_pairs_retrieval_max_size: 10 instructions_similarity_threshold: 0.7 instructions_top_k: 10 ================================================ FILE: wren-ai-service/docs/config_examples/config.deepseek.yaml ================================================ # you should rename this file to config.yaml and put it in ~/.wrenai # please pay attention to the comments starting with # and adjust the config accordingly, 3 steps basically: # 1. you need to use your own llm and embedding models # 2. fill in embedding model dimension in the document_store section # 3. you need to use the correct pipe definitions based on https://raw.githubusercontent.com/canner/WrenAI//docker/config.example.yaml # 4. you need to fill in correct llm and embedding models in the pipe definitions type: llm provider: litellm_llm models: # put DEEPSEEK_API_KEY= in ~/.wrenai/.env - api_base: https://api.deepseek.com/v1 model: deepseek/deepseek-reasoner timeout: 120 kwargs: n: 1 temperature: 0 response_format: type: text - api_base: https://api.deepseek.com/v1 model: deepseek/deepseek-chat timeout: 120 kwargs: n: 1 temperature: 0 response_format: type: text - api_base: https://api.deepseek.com/v1 model: deepseek/deepseek-coder alias: default timeout: 120 kwargs: n: 1 temperature: 0 response_format: type: json_object --- type: embedder provider: litellm_embedder models: # define OPENAI_API_KEY= in ~/.wrenai/.env if you are using openai embedding model # please refer to LiteLLM documentation for more details: https://docs.litellm.ai/docs/providers - model: text-embedding-3-large # put your embedding model name here, if it is not openai embedding model, should be / alias: default api_base: https://api.openai.com/v1 # change this according to your embedding model timeout: 120 --- type: engine provider: wren_ui endpoint: http://wren-ui:3000 --- type: engine provider: wren_ibis endpoint: http://ibis-server:8000 --- type: document_store provider: qdrant location: http://qdrant:6333 embedding_model_dim: 3072 # put your embedding model dimension here timeout: 120 recreate_index: true --- # please change the llm and embedder names to the ones you want to use # the format of llm and embedder should be . such as litellm_llm.gpt-4o-2024-08-06 # the pipes may be not the latest version, please refer to the latest version: https://raw.githubusercontent.com/canner/WrenAI//docker/config.example.yaml type: pipeline pipes: - name: db_schema_indexing embedder: litellm_embedder.default document_store: qdrant - name: historical_question_indexing embedder: litellm_embedder.default document_store: qdrant - name: table_description_indexing embedder: litellm_embedder.default document_store: qdrant - name: db_schema_retrieval llm: litellm_llm.default embedder: litellm_embedder.default document_store: qdrant - name: historical_question_retrieval embedder: litellm_embedder.default document_store: qdrant - name: sql_generation llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: sql_correction llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: followup_sql_generation llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: sql_answer llm: litellm_llm.deepseek/deepseek-chat - name: semantics_description llm: litellm_llm.default - name: relationship_recommendation llm: litellm_llm.default engine: wren_ui - name: question_recommendation llm: litellm_llm.default - name: question_recommendation_db_schema_retrieval llm: litellm_llm.default embedder: litellm_embedder.default document_store: qdrant - name: question_recommendation_sql_generation llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: chart_generation llm: litellm_llm.default - name: chart_adjustment llm: litellm_llm.default - name: intent_classification llm: litellm_llm.default embedder: litellm_embedder.default document_store: qdrant - name: misleading_assistance llm: litellm_llm.default - name: data_assistance llm: litellm_llm.deepseek/deepseek-chat - name: sql_pairs_indexing document_store: qdrant embedder: litellm_embedder.default - name: sql_pairs_retrieval document_store: qdrant embedder: litellm_embedder.default llm: litellm_llm.default - name: preprocess_sql_data llm: litellm_llm.default - name: sql_executor engine: wren_ui - name: user_guide_assistance llm: litellm_llm.default - name: sql_question_generation llm: litellm_llm.default - name: sql_generation_reasoning llm: litellm_llm.deepseek/deepseek-reasoner - name: followup_sql_generation_reasoning llm: litellm_llm.deepseek/deepseek-reasoner - name: sql_regeneration llm: litellm_llm.default engine: wren_ui - name: instructions_indexing embedder: litellm_embedder.default document_store: qdrant - name: instructions_retrieval embedder: litellm_embedder.default document_store: qdrant - name: sql_functions_retrieval engine: wren_ibis document_store: qdrant - name: project_meta_indexing document_store: qdrant - name: sql_tables_extraction llm: litellm_llm.default - name: sql_diagnosis llm: litellm_llm.default - name: sql_knowledge_retrieval engine: wren_ibis document_store: qdrant --- settings: engine_timeout: 30 column_indexing_batch_size: 50 table_retrieval_size: 10 table_column_retrieval_size: 100 allow_intent_classification: true allow_sql_generation_reasoning: true allow_sql_functions_retrieval: true enable_column_pruning: false max_sql_correction_retries: 3 query_cache_maxsize: 1000 query_cache_ttl: 3600 langfuse_host: https://cloud.langfuse.com langfuse_enable: true logging_level: DEBUG development: true historical_question_retrieval_similarity_threshold: 0.9 sql_pairs_similarity_threshold: 0.7 sql_pairs_retrieval_max_size: 10 instructions_similarity_threshold: 0.7 instructions_top_k: 10 ================================================ FILE: wren-ai-service/docs/config_examples/config.google_ai_studio.yaml ================================================ # you should rename this file to config.yaml and put it in ~/.wrenai # please pay attention to the comments starting with # and adjust the config accordingly, 3 steps basically: # 1. you need to use your own llm and embedding models # 2. fill in embedding model dimension in the document_store section # 3. you need to use the correct pipe definitions based on https://raw.githubusercontent.com/canner/WrenAI//docker/config.example.yaml # 4. you need to fill in correct llm and embedding models in the pipe definitions type: llm provider: litellm_llm models: # put GEMINI_API_KEY= in ~/.wrenai/.env - model: gemini/gemini-2.0-flash # gemini/ alias: default timeout: 120 kwargs: n: 1 temperature: 0 - model: gemini/gemini-2.0-flash # gemini/ alias: gemini-llm-for-chart timeout: 120 kwargs: n: 1 temperature: 0 response_format: type: json_object --- type: embedder provider: litellm_embedder models: # put GEMINI_API_KEY= in ~/.wrenai/.env - model: gemini/text-embedding-004 # gemini/ alias: default timeout: 120 --- type: engine provider: wren_ui endpoint: http://wren-ui:3000 --- type: engine provider: wren_ibis endpoint: http://ibis-server:8000 --- type: document_store provider: qdrant location: http://qdrant:6333 embedding_model_dim: 768 # put your embedding model dimension here timeout: 120 recreate_index: true --- # please change the llm and embedder names to the ones you want to use # the format of llm and embedder should be . such as litellm_llm.gpt-4o-2024-08-06 or . such as litellm_llm.gemini-llm-for-chart # the pipes may be not the latest version, please refer to the latest version: https://raw.githubusercontent.com/canner/WrenAI//docker/config.example.yaml type: pipeline pipes: - name: db_schema_indexing embedder: litellm_embedder.default document_store: qdrant - name: historical_question_indexing embedder: litellm_embedder.default document_store: qdrant - name: table_description_indexing embedder: litellm_embedder.default document_store: qdrant - name: db_schema_retrieval llm: litellm_llm.default embedder: litellm_embedder.default document_store: qdrant - name: historical_question_retrieval embedder: litellm_embedder.default document_store: qdrant - name: sql_generation llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: sql_correction llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: followup_sql_generation llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: sql_answer llm: litellm_llm.default - name: semantics_description llm: litellm_llm.default - name: relationship_recommendation llm: litellm_llm.default engine: wren_ui - name: question_recommendation llm: litellm_llm.default - name: question_recommendation_db_schema_retrieval llm: litellm_llm.default embedder: litellm_embedder.default document_store: qdrant - name: question_recommendation_sql_generation llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: chart_generation llm: litellm_llm.gemini-llm-for-chart - name: chart_adjustment llm: litellm_llm.gemini-llm-for-chart - name: intent_classification llm: litellm_llm.default embedder: litellm_embedder.default document_store: qdrant - name: misleading_assistance llm: litellm_llm.default - name: data_assistance llm: litellm_llm.default - name: sql_pairs_indexing document_store: qdrant embedder: litellm_embedder.default - name: sql_pairs_retrieval document_store: qdrant embedder: litellm_embedder.default llm: litellm_llm.default - name: preprocess_sql_data llm: litellm_llm.default - name: sql_executor engine: wren_ui - name: user_guide_assistance llm: litellm_llm.default - name: sql_question_generation llm: litellm_llm.default - name: sql_generation_reasoning llm: litellm_llm.default - name: followup_sql_generation_reasoning llm: litellm_llm.default - name: sql_regeneration llm: litellm_llm.default engine: wren_ui - name: instructions_indexing embedder: litellm_embedder.default document_store: qdrant - name: instructions_retrieval embedder: litellm_embedder.default document_store: qdrant - name: sql_functions_retrieval engine: wren_ibis document_store: qdrant - name: project_meta_indexing document_store: qdrant - name: sql_tables_extraction llm: litellm_llm.default - name: sql_diagnosis llm: litellm_llm.default - name: sql_knowledge_retrieval engine: wren_ibis document_store: qdrant --- settings: engine_timeout: 30 column_indexing_batch_size: 50 table_retrieval_size: 10 table_column_retrieval_size: 100 allow_intent_classification: true allow_sql_generation_reasoning: true allow_sql_functions_retrieval: true enable_column_pruning: false max_sql_correction_retries: 3 query_cache_maxsize: 1000 query_cache_ttl: 3600 langfuse_host: https://cloud.langfuse.com langfuse_enable: true logging_level: DEBUG development: true historical_question_retrieval_similarity_threshold: 0.9 sql_pairs_similarity_threshold: 0.7 sql_pairs_retrieval_max_size: 10 instructions_similarity_threshold: 0.7 instructions_top_k: 10 ================================================ FILE: wren-ai-service/docs/config_examples/config.google_vertexai.yaml ================================================ # you should rename this file to config.yaml and put it in ~/.wrenai # please pay attention to the comments starting with # and adjust the config accordingly, 3 steps basically: # 1. you need to use your own llm and embedding models # 2. fill in embedding model dimension in the document_store section # 3. you need to use the correct pipe definitions based on https://raw.githubusercontent.com/canner/WrenAI//docker/config.example.yaml # 4. you need to fill in correct llm and embedding models in the pipe definitions type: llm provider: litellm_llm models: # put VERTEXAI_LOCATION= in ~/.wrenai/.env # put VERTEXAI_PROJECT= in ~/.wrenai/.env # put GOOGLE_APPLICATION_CREDENTIALS=/app/data/ in ~/.wrenai.env - model: vertex_ai/gemini-2.5-flash # vertex_ai/ alias: default timeout: 120 kwargs: n: 1 temperature: 0 seed: 0 max_tokens: 4096 - model: vertex_ai/gemini-2.5-flash # vertex_ai/ alias: gemini-llm-for-chart timeout: 120 kwargs: n: 1 temperature: 0 seed: 0 max_tokens: 4096 response_format: type: json_object --- type: embedder provider: litellm_embedder models: # put VERTEXAI_LOCATION= in ~/.wrenai/.env # put VERTEXAI_PROJECT= in ~/.wrenai/.env # put GOOGLE_APPLICATION_CREDENTIALS=/app/data/ in ~/.wrenai.env - model: vertex_ai/text-embedding-004 # vertex_ai/ alias: default timeout: 120 --- type: engine provider: wren_ui endpoint: http://wren-ui:3000 --- type: engine provider: wren_ibis endpoint: http://ibis-server:8000 --- type: document_store provider: qdrant location: http://qdrant:6333 embedding_model_dim: 768 # put your embedding model dimension here timeout: 120 recreate_index: true --- # please change the llm and embedder names to the ones you want to use # the format of llm and embedder should be . such as litellm_llm.gpt-4o-2024-08-06 or . such as litellm_llm.gemini-llm-for-chart # the pipes may be not the latest version, please refer to the latest version: https://raw.githubusercontent.com/canner/WrenAI//docker/config.example.yaml type: pipeline pipes: - name: db_schema_indexing embedder: litellm_embedder.default document_store: qdrant - name: historical_question_indexing embedder: litellm_embedder.default document_store: qdrant - name: table_description_indexing embedder: litellm_embedder.default document_store: qdrant - name: db_schema_retrieval llm: litellm_llm.default embedder: litellm_embedder.default document_store: qdrant - name: historical_question_retrieval embedder: litellm_embedder.default document_store: qdrant - name: sql_generation llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: sql_correction llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: followup_sql_generation llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: sql_answer llm: litellm_llm.default - name: semantics_description llm: litellm_llm.default - name: relationship_recommendation llm: litellm_llm.default engine: wren_ui - name: question_recommendation llm: litellm_llm.default - name: question_recommendation_db_schema_retrieval llm: litellm_llm.default embedder: litellm_embedder.default document_store: qdrant - name: question_recommendation_sql_generation llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: chart_generation llm: litellm_llm.gemini-llm-for-chart - name: chart_adjustment llm: litellm_llm.gemini-llm-for-chart - name: intent_classification llm: litellm_llm.default embedder: litellm_embedder.default document_store: qdrant - name: misleading_assistance llm: litellm_llm.default - name: data_assistance llm: litellm_llm.default - name: sql_pairs_indexing document_store: qdrant embedder: litellm_embedder.default - name: sql_pairs_retrieval document_store: qdrant embedder: litellm_embedder.default llm: litellm_llm.default - name: preprocess_sql_data llm: litellm_llm.default - name: sql_executor engine: wren_ui - name: user_guide_assistance llm: litellm_llm.default - name: sql_question_generation llm: litellm_llm.default - name: sql_generation_reasoning llm: litellm_llm.default - name: followup_sql_generation_reasoning llm: litellm_llm.default - name: sql_regeneration llm: litellm_llm.default engine: wren_ui - name: instructions_indexing embedder: litellm_embedder.default document_store: qdrant - name: instructions_retrieval embedder: litellm_embedder.default document_store: qdrant - name: sql_functions_retrieval engine: wren_ibis document_store: qdrant - name: project_meta_indexing document_store: qdrant - name: sql_tables_extraction llm: litellm_llm.default - name: sql_diagnosis llm: litellm_llm.default - name: sql_knowledge_retrieval engine: wren_ibis document_store: qdrant --- settings: engine_timeout: 30 column_indexing_batch_size: 50 table_retrieval_size: 10 table_column_retrieval_size: 100 allow_intent_classification: true allow_sql_generation_reasoning: true allow_sql_functions_retrieval: true enable_column_pruning: false max_sql_correction_retries: 3 query_cache_maxsize: 1000 query_cache_ttl: 3600 langfuse_host: https://cloud.langfuse.com langfuse_enable: true logging_level: DEBUG development: true historical_question_retrieval_similarity_threshold: 0.9 sql_pairs_similarity_threshold: 0.7 sql_pairs_retrieval_max_size: 10 instructions_similarity_threshold: 0.7 instructions_top_k: 10 ================================================ FILE: wren-ai-service/docs/config_examples/config.grok.yaml ================================================ # you should rename this file to config.yaml and put it in ~/.wrenai # please pay attention to the comments starting with # and adjust the config accordingly, 3 steps basically: # 1. you need to use your own llm and embedding models # 2. fill in embedding model dimension in the document_store section # 3. you need to use the correct pipe definitions based on https://raw.githubusercontent.com/canner/WrenAI//docker/config.example.yaml # 4. you need to fill in correct llm and embedding models in the pipe definitions type: llm provider: litellm_llm models: # put XAI_API_KEY= in ~/.wrenai/.env - api_base: https://api.x.ai/v1 model: xai/grok-3-latest alias: default timeout: 120 kwargs: temperature: 0 max_tokens: 4096 n: 1 --- type: embedder provider: litellm_embedder models: # define OPENAI_API_KEY= in ~/.wrenai/.env if you are using openai embedding model # please refer to LiteLLM documentation for more details: https://docs.litellm.ai/docs/providers - model: text-embedding-3-large # put your embedding model name here, if it is not openai embedding model, should be / alias: default api_base: https://api.openai.com/v1 # change this according to your embedding model timeout: 120 --- type: engine provider: wren_ui endpoint: http://wren-ui:3000 --- type: engine provider: wren_ibis endpoint: http://ibis-server:8000 --- type: document_store provider: qdrant location: http://qdrant:6333 embedding_model_dim: 3072 # put your embedding model dimension here timeout: 120 recreate_index: true --- # please change the llm and embedder names to the ones you want to use # the format of llm and embedder should be . such as litellm_llm.gpt-4o-2024-08-06 # the pipes may be not the latest version, please refer to the latest version: https://raw.githubusercontent.com/canner/WrenAI//docker/config.example.yaml type: pipeline pipes: - name: db_schema_indexing embedder: litellm_embedder.default document_store: qdrant - name: historical_question_indexing embedder: litellm_embedder.default document_store: qdrant - name: table_description_indexing embedder: litellm_embedder.default document_store: qdrant - name: db_schema_retrieval llm: litellm_llm.default embedder: litellm_embedder.default document_store: qdrant - name: historical_question_retrieval embedder: litellm_embedder.default document_store: qdrant - name: sql_generation llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: sql_correction llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: followup_sql_generation llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: sql_answer llm: litellm_llm.default - name: semantics_description llm: litellm_llm.default - name: relationship_recommendation llm: litellm_llm.default engine: wren_ui - name: question_recommendation llm: litellm_llm.default - name: question_recommendation_db_schema_retrieval llm: litellm_llm.default embedder: litellm_embedder.default document_store: qdrant - name: question_recommendation_sql_generation llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: chart_generation llm: litellm_llm.default - name: chart_adjustment llm: litellm_llm.default - name: intent_classification llm: litellm_llm.default embedder: litellm_embedder.default document_store: qdrant - name: misleading_assistance llm: litellm_llm.default - name: data_assistance llm: litellm_llm.default - name: sql_pairs_indexing document_store: qdrant embedder: litellm_embedder.default - name: sql_pairs_retrieval document_store: qdrant embedder: litellm_embedder.default llm: litellm_llm.default - name: preprocess_sql_data llm: litellm_llm.default - name: sql_executor engine: wren_ui - name: user_guide_assistance llm: litellm_llm.default - name: sql_question_generation llm: litellm_llm.default - name: sql_generation_reasoning llm: litellm_llm.default - name: followup_sql_generation_reasoning llm: litellm_llm.default - name: sql_regeneration llm: litellm_llm.default engine: wren_ui - name: instructions_indexing embedder: litellm_embedder.default document_store: qdrant - name: instructions_retrieval embedder: litellm_embedder.default document_store: qdrant - name: sql_functions_retrieval engine: wren_ibis document_store: qdrant - name: project_meta_indexing document_store: qdrant - name: sql_tables_extraction llm: litellm_llm.default - name: sql_diagnosis llm: litellm_llm.default - name: sql_knowledge_retrieval engine: wren_ibis document_store: qdrant --- settings: engine_timeout: 30 column_indexing_batch_size: 50 table_retrieval_size: 10 table_column_retrieval_size: 100 allow_intent_classification: true allow_sql_generation_reasoning: true allow_sql_functions_retrieval: true enable_column_pruning: false max_sql_correction_retries: 3 query_cache_maxsize: 1000 query_cache_ttl: 3600 langfuse_host: https://cloud.langfuse.com langfuse_enable: true logging_level: DEBUG development: true historical_question_retrieval_similarity_threshold: 0.9 sql_pairs_similarity_threshold: 0.7 sql_pairs_retrieval_max_size: 10 instructions_similarity_threshold: 0.7 instructions_top_k: 10 ================================================ FILE: wren-ai-service/docs/config_examples/config.groq.yaml ================================================ # you should rename this file to config.yaml and put it in ~/.wrenai # please pay attention to the comments starting with # and adjust the config accordingly, 3 steps basically: # 1. you need to use your own llm and embedding models # 2. fill in embedding model dimension in the document_store section # 3. you need to use the correct pipe definitions based on https://raw.githubusercontent.com/canner/WrenAI//docker/config.example.yaml # 4. you need to fill in correct llm and embedding models in the pipe definitions type: llm provider: litellm_llm models: # put GROQ_API_KEY= in ~/.wrenai/.env - api_base: https://api.groq.com/openai/v1 model: groq/llama-3.3-70b-specdec # groq/ alias: default timeout: 120 kwargs: n: 1 temperature: 0 --- type: embedder provider: litellm_embedder models: # define OPENAI_API_KEY= in ~/.wrenai/.env if you are using openai embedding model # please refer to LiteLLM documentation for more details: https://docs.litellm.ai/docs/providers - model: text-embedding-3-large # put your embedding model name here, if it is not openai embedding model, should be / alias: default api_base: https://api.openai.com/v1 # change this according to your embedding model timeout: 120 --- type: engine provider: wren_ui endpoint: http://wren-ui:3000 --- type: engine provider: wren_ibis endpoint: http://ibis-server:8000 --- type: document_store provider: qdrant location: http://qdrant:6333 embedding_model_dim: 3072 # put your embedding model dimension here timeout: 120 recreate_index: true --- # please change the llm and embedder names to the ones you want to use # the format of llm and embedder should be . such as litellm_llm.gpt-4o-2024-08-06 # the pipes may be not the latest version, please refer to the latest version: https://raw.githubusercontent.com/canner/WrenAI//docker/config.example.yaml type: pipeline pipes: - name: db_schema_indexing embedder: litellm_embedder.default document_store: qdrant - name: historical_question_indexing embedder: litellm_embedder.default document_store: qdrant - name: table_description_indexing embedder: litellm_embedder.default document_store: qdrant - name: db_schema_retrieval llm: litellm_llm.default embedder: litellm_embedder.default document_store: qdrant - name: historical_question_retrieval embedder: litellm_embedder.default document_store: qdrant - name: sql_generation llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: sql_correction llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: followup_sql_generation llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: sql_answer llm: litellm_llm.default - name: semantics_description llm: litellm_llm.default - name: relationship_recommendation llm: litellm_llm.default engine: wren_ui - name: question_recommendation llm: litellm_llm.default - name: question_recommendation_db_schema_retrieval llm: litellm_llm.default embedder: litellm_embedder.default document_store: qdrant - name: question_recommendation_sql_generation llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: chart_generation llm: litellm_llm.default - name: chart_adjustment llm: litellm_llm.default - name: intent_classification llm: litellm_llm.default embedder: litellm_embedder.default document_store: qdrant - name: misleading_assistance llm: litellm_llm.default - name: data_assistance llm: litellm_llm.default - name: sql_pairs_indexing document_store: qdrant embedder: litellm_embedder.default - name: sql_pairs_retrieval document_store: qdrant embedder: litellm_embedder.default llm: litellm_llm.default - name: preprocess_sql_data llm: litellm_llm.default - name: sql_executor engine: wren_ui - name: user_guide_assistance llm: litellm_llm.default - name: sql_question_generation llm: litellm_llm.default - name: sql_generation_reasoning llm: litellm_llm.default - name: followup_sql_generation_reasoning llm: litellm_llm.default - name: sql_regeneration llm: litellm_llm.default engine: wren_ui - name: instructions_indexing embedder: litellm_embedder.default document_store: qdrant - name: instructions_retrieval embedder: litellm_embedder.default document_store: qdrant - name: sql_functions_retrieval engine: wren_ibis document_store: qdrant - name: project_meta_indexing document_store: qdrant - name: sql_tables_extraction llm: litellm_llm.default - name: sql_diagnosis llm: litellm_llm.default - name: sql_knowledge_retrieval engine: wren_ibis document_store: qdrant --- settings: engine_timeout: 30 column_indexing_batch_size: 50 table_retrieval_size: 10 table_column_retrieval_size: 100 allow_intent_classification: true allow_sql_generation_reasoning: true allow_sql_functions_retrieval: true enable_column_pruning: false max_sql_correction_retries: 3 query_cache_maxsize: 1000 query_cache_ttl: 3600 langfuse_host: https://cloud.langfuse.com langfuse_enable: true logging_level: DEBUG development: true historical_question_retrieval_similarity_threshold: 0.9 sql_pairs_similarity_threshold: 0.7 sql_pairs_retrieval_max_size: 10 instructions_similarity_threshold: 0.7 instructions_top_k: 10 ================================================ FILE: wren-ai-service/docs/config_examples/config.lm_studio.yaml ================================================ # you should rename this file to config.yaml and put it in ~/.wrenai # please pay attention to the comments starting with # and adjust the config accordingly, 3 steps basically: # 1. you need to use your own llm and embedding models # 2. fill in embedding model dimension in the document_store section # 3. you need to use the correct pipe definitions based on https://raw.githubusercontent.com/canner/WrenAI//docker/config.example.yaml # 4. you need to fill in correct llm and embedding models in the pipe definitions type: llm provider: litellm_llm models: # put LM_STUDIO_API_KEY= in ~/.wrenai/.env - api_base: http://host.docker.internal:1234/v1 model: openai/phi-4 # openai/ alias: default timeout: 600 kwargs: n: 1 temperature: 0 --- type: embedder provider: litellm_embedder models: # put LM_STUDIO_API_KEY= in ~/.wrenai/.env - model: openai/text-embedding-nomic-embed-text-v1.5 # put your lm_studio embedder model name here, openai/ alias: default api_base: http://host.docker.internal:1234/v1 timeout: 600 --- type: engine provider: wren_ui endpoint: http://wren-ui:3000 --- type: engine provider: wren_ibis endpoint: http://ibis-server:8000 --- type: document_store provider: qdrant location: http://qdrant:6333 embedding_model_dim: 768 # put your embedding model dimension here timeout: 120 recreate_index: true --- # please change the llm and embedder names to the ones you want to use # the format of llm and embedder should be . such as litellm_llm.gpt-4o-2024-08-06 # the pipes may be not the latest version, please refer to the latest version: https://raw.githubusercontent.com/canner/WrenAI//docker/config.example.yaml type: pipeline pipes: - name: db_schema_indexing embedder: litellm_embedder.default document_store: qdrant - name: historical_question_indexing embedder: litellm_embedder.default document_store: qdrant - name: table_description_indexing embedder: litellm_embedder.default document_store: qdrant - name: db_schema_retrieval llm: litellm_llm.default embedder: litellm_embedder.default document_store: qdrant - name: historical_question_retrieval embedder: litellm_embedder.default document_store: qdrant - name: sql_generation llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: sql_correction llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: followup_sql_generation llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: sql_answer llm: litellm_llm.default - name: semantics_description llm: litellm_llm.default - name: relationship_recommendation llm: litellm_llm.default engine: wren_ui - name: question_recommendation llm: litellm_llm.default - name: question_recommendation_db_schema_retrieval llm: litellm_llm.default embedder: litellm_embedder.default document_store: qdrant - name: question_recommendation_sql_generation llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: chart_generation llm: litellm_llm.default - name: chart_adjustment llm: litellm_llm.default - name: intent_classification llm: litellm_llm.default embedder: litellm_embedder.default document_store: qdrant - name: misleading_assistance llm: litellm_llm.default - name: data_assistance llm: litellm_llm.default - name: sql_pairs_indexing document_store: qdrant embedder: litellm_embedder.default - name: sql_pairs_retrieval document_store: qdrant embedder: litellm_embedder.default llm: litellm_llm.default - name: preprocess_sql_data llm: litellm_llm.default - name: sql_executor engine: wren_ui - name: user_guide_assistance llm: litellm_llm.default - name: sql_question_generation llm: litellm_llm.default - name: sql_generation_reasoning llm: litellm_llm.default - name: followup_sql_generation_reasoning llm: litellm_llm.default - name: sql_regeneration llm: litellm_llm.default engine: wren_ui - name: instructions_indexing embedder: litellm_embedder.default document_store: qdrant - name: instructions_retrieval embedder: litellm_embedder.default document_store: qdrant - name: sql_functions_retrieval engine: wren_ibis document_store: qdrant - name: project_meta_indexing document_store: qdrant - name: sql_tables_extraction llm: litellm_llm.default - name: sql_diagnosis llm: litellm_llm.default - name: sql_knowledge_retrieval engine: wren_ibis document_store: qdrant --- settings: engine_timeout: 30 column_indexing_batch_size: 50 table_retrieval_size: 10 table_column_retrieval_size: 100 allow_intent_classification: true allow_sql_generation_reasoning: true allow_sql_functions_retrieval: true enable_column_pruning: false max_sql_correction_retries: 3 query_cache_maxsize: 1000 query_cache_ttl: 3600 langfuse_host: https://cloud.langfuse.com langfuse_enable: true logging_level: DEBUG development: true historical_question_retrieval_similarity_threshold: 0.9 sql_pairs_similarity_threshold: 0.7 sql_pairs_retrieval_max_size: 10 instructions_similarity_threshold: 0.7 instructions_top_k: 10 ================================================ FILE: wren-ai-service/docs/config_examples/config.ollama.yaml ================================================ # you should rename this file to config.yaml and put it in ~/.wrenai # please pay attention to the comments starting with # and adjust the config accordingly, 3 steps basically: # 1. you need to use your own llm and embedding models # 2. fill in embedding model dimension in the document_store section # 3. you need to use the correct pipe definitions based on https://raw.githubusercontent.com/canner/WrenAI//docker/config.example.yaml # 4. you need to fill in correct llm and embedding models in the pipe definitions type: llm provider: litellm_llm models: - api_base: http://host.docker.internal:11434 # if you are using mac/windows, don't change this; if you are using linux, please search "Run Ollama in docker container" in this page: https://docs.getwren.ai/oss/ai_service/guide/custom_llm#running-wren-ai-with-your-custom-llm-embedder model: ollama_chat/phi4:14b # ollama_chat/ alias: default timeout: 600 kwargs: n: 1 temperature: 0 --- type: embedder provider: litellm_embedder models: # at the moment, we are invoking ollama embedding model through ollama's openai compatible endpoint # since there is issue invoking ollama embedding model through ollama/ using litellm: https://github.com/BerriAI/litellm/issues/7572 - model: openai/nomic-embed-text # put your ollama embedder model name here, openai/ alias: default api_base: http://host.docker.internal:11434/v1 # if you are using mac/windows, don't change this; if you are using linux, please search "Run Ollama in docker container" in this page: https://docs.getwren.ai/oss/ai_service/guide/custom_llm#running-wren-ai-with-your-custom-llm-embedder timeout: 600 --- type: engine provider: wren_ui endpoint: http://wren-ui:3000 --- type: engine provider: wren_ibis endpoint: http://ibis-server:8000 --- type: document_store provider: qdrant location: http://qdrant:6333 embedding_model_dim: 768 # put your embedding model dimension here timeout: 120 recreate_index: true --- # please change the llm and embedder names to the ones you want to use # the format of llm and embedder should be . such as litellm_llm.gpt-4o-2024-08-06 # the pipes may be not the latest version, please refer to the latest version: https://raw.githubusercontent.com/canner/WrenAI//docker/config.example.yaml type: pipeline pipes: - name: db_schema_indexing embedder: litellm_embedder.default document_store: qdrant - name: historical_question_indexing embedder: litellm_embedder.default document_store: qdrant - name: table_description_indexing embedder: litellm_embedder.default document_store: qdrant - name: db_schema_retrieval llm: litellm_llm.default embedder: litellm_embedder.default document_store: qdrant - name: historical_question_retrieval embedder: litellm_embedder.default document_store: qdrant - name: sql_generation llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: sql_correction llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: followup_sql_generation llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: sql_answer llm: litellm_llm.default - name: semantics_description llm: litellm_llm.default - name: relationship_recommendation llm: litellm_llm.default engine: wren_ui - name: question_recommendation llm: litellm_llm.default - name: question_recommendation_db_schema_retrieval llm: litellm_llm.default embedder: litellm_embedder.default document_store: qdrant - name: question_recommendation_sql_generation llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: chart_generation llm: litellm_llm.default - name: chart_adjustment llm: litellm_llm.default - name: intent_classification llm: litellm_llm.default embedder: litellm_embedder.default document_store: qdrant - name: misleading_assistance llm: litellm_llm.default - name: data_assistance llm: litellm_llm.default - name: sql_pairs_indexing document_store: qdrant embedder: litellm_embedder.default - name: sql_pairs_retrieval document_store: qdrant embedder: litellm_embedder.default llm: litellm_llm.default - name: preprocess_sql_data llm: litellm_llm.default - name: sql_executor engine: wren_ui - name: user_guide_assistance llm: litellm_llm.default - name: sql_question_generation llm: litellm_llm.default - name: sql_generation_reasoning llm: litellm_llm.default - name: followup_sql_generation_reasoning llm: litellm_llm.default - name: sql_regeneration llm: litellm_llm.default engine: wren_ui - name: instructions_indexing embedder: litellm_embedder.default document_store: qdrant - name: instructions_retrieval embedder: litellm_embedder.default document_store: qdrant - name: sql_functions_retrieval engine: wren_ibis document_store: qdrant - name: project_meta_indexing document_store: qdrant - name: sql_tables_extraction llm: litellm_llm.default - name: sql_diagnosis llm: litellm_llm.default - name: sql_knowledge_retrieval engine: wren_ibis document_store: qdrant --- settings: engine_timeout: 30 column_indexing_batch_size: 50 table_retrieval_size: 10 table_column_retrieval_size: 100 allow_intent_classification: true allow_sql_generation_reasoning: true allow_sql_functions_retrieval: true enable_column_pruning: false max_sql_correction_retries: 3 query_cache_maxsize: 1000 query_cache_ttl: 3600 langfuse_host: https://cloud.langfuse.com langfuse_enable: true logging_level: DEBUG development: true historical_question_retrieval_similarity_threshold: 0.9 sql_pairs_similarity_threshold: 0.7 sql_pairs_retrieval_max_size: 10 instructions_similarity_threshold: 0.7 instructions_top_k: 10 ================================================ FILE: wren-ai-service/docs/config_examples/config.open_router.yaml ================================================ # you should rename this file to config.yaml and put it in ~/.wrenai # please pay attention to the comments starting with # and adjust the config accordingly, 3 steps basically: # 1. you need to use your own llm and embedding models # 2. fill in embedding model dimension in the document_store section # 3. you need to use the correct pipe definitions based on https://raw.githubusercontent.com/canner/WrenAI//docker/config.example.yaml # 4. you need to fill in correct llm and embedding models in the pipe definitions type: llm provider: litellm_llm timeout: 120 models: # put OPENROUTER_API_KEY= in ~/.wrenai/.env - api_base: https://openrouter.ai/api/v1 model: openrouter/anthropic/claude-3.7-sonnet alias: default timeout: 600 kwargs: n: 1 temperature: 0 --- type: embedder provider: litellm_embedder models: # put GEMINI_API_KEY= in ~/.wrenai/.env # openrouter embedding model is not supported yet, so you can use gemini embedding model as a workaround - model: gemini/text-embedding-004 alias: default timeout: 120 --- type: engine provider: wren_ui endpoint: http://wren-ui:3000 --- type: engine provider: wren_ibis endpoint: http://ibis-server:8000 --- type: document_store provider: qdrant location: http://qdrant:6333 embedding_model_dim: 768 # put your embedding model dimension here timeout: 120 recreate_index: true --- type: pipeline pipes: - name: db_schema_indexing embedder: litellm_embedder.default document_store: qdrant - name: historical_question_indexing embedder: litellm_embedder.default document_store: qdrant - name: table_description_indexing embedder: litellm_embedder.default document_store: qdrant - name: db_schema_retrieval llm: litellm_llm.default embedder: litellm_embedder.default document_store: qdrant - name: historical_question_retrieval embedder: litellm_embedder.default document_store: qdrant - name: sql_generation llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: sql_correction llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: followup_sql_generation llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: sql_answer llm: litellm_llm.default - name: semantics_description llm: litellm_llm.default - name: relationship_recommendation llm: litellm_llm.default engine: wren_ui - name: question_recommendation llm: litellm_llm.default - name: question_recommendation_db_schema_retrieval llm: litellm_llm.default embedder: litellm_embedder.default document_store: qdrant - name: question_recommendation_sql_generation llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: intent_classification llm: litellm_llm.default embedder: litellm_embedder.default document_store: qdrant - name: misleading_assistance llm: litellm_llm.default - name: data_assistance llm: litellm_llm.default - name: sql_pairs_indexing document_store: qdrant embedder: litellm_embedder.default - name: sql_pairs_retrieval document_store: qdrant embedder: litellm_embedder.default llm: litellm_llm.default - name: preprocess_sql_data llm: litellm_llm.default - name: sql_executor engine: wren_ui - name: user_guide_assistance llm: litellm_llm.default - name: chart_generation llm: litellm_llm.default - name: chart_adjustment llm: litellm_llm.default - name: sql_question_generation llm: litellm_llm.default - name: sql_generation_reasoning llm: litellm_llm.default - name: followup_sql_generation_reasoning llm: litellm_llm.default - name: sql_regeneration llm: litellm_llm.default engine: wren_ui - name: instructions_indexing embedder: litellm_embedder.default document_store: qdrant - name: instructions_retrieval embedder: litellm_embedder.default document_store: qdrant - name: sql_functions_retrieval engine: wren_ibis document_store: qdrant - name: project_meta_indexing document_store: qdrant - name: sql_tables_extraction llm: litellm_llm.default - name: sql_diagnosis llm: litellm_llm.default - name: sql_knowledge_retrieval engine: wren_ibis document_store: qdrant --- settings: engine_timeout: 30 column_indexing_batch_size: 50 table_retrieval_size: 10 table_column_retrieval_size: 100 allow_intent_classification: true allow_sql_generation_reasoning: true allow_sql_functions_retrieval: true enable_column_pruning: false max_sql_correction_retries: 3 query_cache_maxsize: 1000 query_cache_ttl: 3600 langfuse_host: https://cloud.langfuse.com langfuse_enable: true logging_level: DEBUG development: false historical_question_retrieval_similarity_threshold: 0.9 sql_pairs_similarity_threshold: 0.7 sql_pairs_retrieval_max_size: 10 instructions_similarity_threshold: 0.7 instructions_top_k: 10 ================================================ FILE: wren-ai-service/docs/config_examples/config.qwen3.yaml ================================================ # you should rename this file to config.yaml and put it in ~/.wrenai # please pay attention to the comments starting with # and adjust the config accordingly, 3 steps basically: # 1. you need to use your own llm and embedding models # 2. fill in embedding model dimension in the document_store section # 3. you need to use the correct pipe definitions based on https://raw.githubusercontent.com/canner/WrenAI//docker/config.example.yaml # 4. you need to fill in correct llm and embedding models in the pipe definitions type: llm provider: litellm_llm models: # put OPENROUTER_API_KEY= in ~/.wrenai/.env # Qwen3 models support thinking and non-thinking modes # Use /think and /no_think in prompts to control reasoning behavior - api_base: https://openrouter.ai/api/v1 model: openrouter/qwen/qwen3-30b-a3b alias: default timeout: 600 kwargs: n: 1 temperature: 0.6 # Recommended for thinking mode top_p: 0.95 top_k: 20 response_format: type: text - api_base: https://openrouter.ai/api/v1 model: openrouter/qwen/qwen3-30b-a3b alias: qwen3-thinking timeout: 600 kwargs: n: 1 temperature: 0.6 # Optimized for thinking mode top_p: 0.95 top_k: 20 response_format: type: text - api_base: https://openrouter.ai/api/v1 model: openrouter/qwen/qwen3-30b-a3b alias: qwen3-fast timeout: 600 kwargs: n: 1 temperature: 0.7 # Optimized for non-thinking mode top_p: 0.8 top_k: 20 response_format: type: text - api_base: https://openrouter.ai/api/v1 model: openrouter/qwen/qwen3-32b alias: qwen3-32b timeout: 600 kwargs: n: 1 temperature: 0.6 top_p: 0.95 top_k: 20 response_format: type: json_object --- type: embedder provider: litellm_embedder models: # define OPENAI_API_KEY= in ~/.wrenai/.env if you are using openai embedding model # please refer to LiteLLM documentation for more details: https://docs.litellm.ai/docs/providers - model: text-embedding-3-large # put your embedding model name here, if it is not openai embedding model, should be / alias: default api_base: https://api.openai.com/v1 # change this according to your embedding model timeout: 120 --- type: engine provider: wren_ui endpoint: http://wren-ui:3000 --- type: engine provider: wren_ibis endpoint: http://ibis-server:8000 --- type: document_store provider: qdrant location: http://qdrant:6333 embedding_model_dim: 3072 # put your embedding model dimension here timeout: 120 recreate_index: true --- # please change the llm and embedder names to the ones you want to use # the format of llm and embedder should be . such as litellm_llm.gpt-4o-2024-08-06 # the pipes may be not the latest version, please refer to the latest version: https://raw.githubusercontent.com/canner/WrenAI//docker/config.example.yaml type: pipeline pipes: - name: db_schema_indexing embedder: litellm_embedder.default document_store: qdrant - name: historical_question_indexing embedder: litellm_embedder.default document_store: qdrant - name: table_description_indexing embedder: litellm_embedder.default document_store: qdrant - name: db_schema_retrieval llm: litellm_llm.default embedder: litellm_embedder.default document_store: qdrant - name: historical_question_retrieval embedder: litellm_embedder.default document_store: qdrant - name: sql_generation llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: sql_correction llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: followup_sql_generation llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: sql_answer llm: litellm_llm.qwen3-fast - name: semantics_description llm: litellm_llm.default - name: relationship_recommendation llm: litellm_llm.default engine: wren_ui - name: question_recommendation llm: litellm_llm.default - name: question_recommendation_db_schema_retrieval llm: litellm_llm.default embedder: litellm_embedder.default document_store: qdrant - name: question_recommendation_sql_generation llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: chart_generation llm: litellm_llm.default - name: chart_adjustment llm: litellm_llm.default - name: intent_classification llm: litellm_llm.default embedder: litellm_embedder.default document_store: qdrant - name: misleading_assistance llm: litellm_llm.default - name: data_assistance llm: litellm_llm.qwen3-fast - name: sql_pairs_indexing document_store: qdrant embedder: litellm_embedder.default - name: sql_pairs_retrieval document_store: qdrant embedder: litellm_embedder.default llm: litellm_llm.default - name: preprocess_sql_data llm: litellm_llm.default - name: sql_executor engine: wren_ui - name: user_guide_assistance llm: litellm_llm.default - name: sql_question_generation llm: litellm_llm.default - name: sql_generation_reasoning llm: litellm_llm.qwen3-thinking - name: followup_sql_generation_reasoning llm: litellm_llm.qwen3-thinking - name: sql_regeneration llm: litellm_llm.default engine: wren_ui - name: instructions_indexing embedder: litellm_embedder.default document_store: qdrant - name: instructions_retrieval embedder: litellm_embedder.default document_store: qdrant - name: sql_functions_retrieval engine: wren_ibis document_store: qdrant - name: project_meta_indexing document_store: qdrant - name: sql_tables_extraction llm: litellm_llm.default - name: sql_diagnosis llm: litellm_llm.default - name: sql_knowledge_retrieval engine: wren_ibis document_store: qdrant --- settings: engine_timeout: 30 column_indexing_batch_size: 50 table_retrieval_size: 10 table_column_retrieval_size: 100 allow_intent_classification: true allow_sql_generation_reasoning: true allow_sql_functions_retrieval: true enable_column_pruning: false max_sql_correction_retries: 3 query_cache_maxsize: 1000 query_cache_ttl: 3600 langfuse_host: https://cloud.langfuse.com langfuse_enable: true logging_level: DEBUG development: true historical_question_retrieval_similarity_threshold: 0.9 sql_pairs_similarity_threshold: 0.7 sql_pairs_retrieval_max_size: 10 instructions_similarity_threshold: 0.7 instructions_top_k: 10 ================================================ FILE: wren-ai-service/docs/config_examples/config.zhipu.yaml ================================================ # you should rename this file to config.yaml and put it in ~/.wrenai # please pay attention to the comments starting with # and adjust the config accordingly, steps: # 1. you need to get your Zhipu AI API key from https://open.bigmodel.cn/ # 2. set your API key in environment variable # 3. fill in embedding model dimension in the document_store section # 4. you need to use the correct pipe definitions based on https://raw.githubusercontent.com/canner/WrenAI//docker/config.example.yaml # 5. you need to fill in correct llm and embedding models in the pipe definitions type: llm provider: litellm_llm models: # GLM-4.5 with thinking disabled - Method 1: Using allowed_openai_params - api_base: https://open.bigmodel.cn/api/paas/v4/ model: openai/glm-4.5 alias: default timeout: 900 kwargs: n: 1 temperature: 0.1 top_p: 0.8 extra_body: chat_template_kwargs: enable_thinking: false allowed_openai_params: ["extra_body"] # Force LiteLLM to allow extra_body # GLM-4.5 fast mode - api_base: https://open.bigmodel.cn/api/paas/v4/ model: openai/glm-4.5 alias: glm45-fast timeout: 900 kwargs: n: 1 temperature: 0.1 top_p: 0.8 extra_body: chat_template_kwargs: enable_thinking: false allowed_openai_params: ["extra_body"] # GLM-4.5 with thinking enabled for complex tasks - api_base: https://open.bigmodel.cn/api/paas/v4/ model: openai/glm-4.5 alias: glm45-thinking timeout: 1200 # Longer timeout for thinking mode kwargs: n: 1 temperature: 0.3 top_p: 0.9 extra_body: chat_template_kwargs: enable_thinking: true allowed_openai_params: ["extra_body"] # GLM-4.5 for JSON responses with thinking disabled - api_base: https://open.bigmodel.cn/api/paas/v4/ model: openai/glm-4.5 alias: glm45-json timeout: 900 kwargs: n: 1 temperature: 0.05 top_p: 0.7 response_format: type: json_object extra_body: chat_template_kwargs: enable_thinking: false allowed_openai_params: ["extra_body"] --- type: embedder provider: litellm_embedder models: # define OPENAI_API_KEY= in ~/.wrenai/.env if you are using openai embedding model # GLM series doesn't have dedicated embedding models yet, so we use OpenAI embedding # please refer to LiteLLM documentation for more details: https://docs.litellm.ai/docs/providers - model: text-embedding-3-large alias: default timeout: 120 --- type: engine provider: wren_ui endpoint: http://wren-ui:3000 --- type: engine provider: wren_ibis endpoint: http://ibis-server:8000 --- type: document_store provider: qdrant location: http://qdrant:6333 embedding_model_dim: 3072 # text-embedding-3-large dimension timeout: 120 recreate_index: true --- # please change the llm and embedder names to the ones you want to use # the format of llm and embedder should be . such as litellm_llm.glm45-fast # the pipes may be not the latest version, please refer to the latest version: https://raw.githubusercontent.com/canner/WrenAI//docker/config.example.yaml type: pipeline pipes: - name: db_schema_indexing embedder: litellm_embedder.default document_store: qdrant - name: historical_question_indexing embedder: litellm_embedder.default document_store: qdrant - name: table_description_indexing embedder: litellm_embedder.default document_store: qdrant - name: db_schema_retrieval llm: litellm_llm.default embedder: litellm_embedder.default document_store: qdrant - name: historical_question_retrieval embedder: litellm_embedder.default document_store: qdrant - name: sql_generation llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: sql_correction llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: followup_sql_generation llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: sql_answer llm: litellm_llm.glm45-fast - name: semantics_description llm: litellm_llm.default - name: relationship_recommendation llm: litellm_llm.default engine: wren_ui - name: question_recommendation llm: litellm_llm.default - name: question_recommendation_db_schema_retrieval llm: litellm_llm.default embedder: litellm_embedder.default document_store: qdrant - name: question_recommendation_sql_generation llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: chart_generation llm: litellm_llm.default - name: chart_adjustment llm: litellm_llm.default - name: intent_classification llm: litellm_llm.default embedder: litellm_embedder.default document_store: qdrant - name: misleading_assistance llm: litellm_llm.default - name: data_assistance llm: litellm_llm.glm45-fast - name: sql_pairs_indexing document_store: qdrant embedder: litellm_embedder.default - name: sql_pairs_retrieval document_store: qdrant embedder: litellm_embedder.default llm: litellm_llm.default - name: preprocess_sql_data llm: litellm_llm.default - name: sql_executor engine: wren_ui - name: user_guide_assistance llm: litellm_llm.default - name: sql_question_generation llm: litellm_llm.default - name: sql_generation_reasoning llm: litellm_llm.glm45-thinking - name: followup_sql_generation_reasoning llm: litellm_llm.glm45-thinking - name: sql_regeneration llm: litellm_llm.default engine: wren_ui - name: instructions_indexing embedder: litellm_embedder.default document_store: qdrant - name: instructions_retrieval embedder: litellm_embedder.default document_store: qdrant - name: sql_functions_retrieval engine: wren_ibis document_store: qdrant - name: project_meta_indexing document_store: qdrant - name: sql_tables_extraction llm: litellm_llm.default - name: sql_diagnosis llm: litellm_llm.default - name: sql_knowledge_retrieval engine: wren_ibis document_store: qdrant --- settings: engine_timeout: 30 column_indexing_batch_size: 50 table_retrieval_size: 10 table_column_retrieval_size: 100 allow_intent_classification: true allow_sql_generation_reasoning: true allow_sql_functions_retrieval: true enable_column_pruning: false max_sql_correction_retries: 3 query_cache_maxsize: 1000 query_cache_ttl: 3600 langfuse_host: https://cloud.langfuse.com langfuse_enable: true logging_level: DEBUG development: true historical_question_retrieval_similarity_threshold: 0.9 sql_pairs_similarity_threshold: 0.7 sql_pairs_retrieval_max_size: 10 instructions_similarity_threshold: 0.7 instructions_top_k: 10 ================================================ FILE: wren-ai-service/docs/configuration.md ================================================ # AI Service Configuration The AI service configuration is managed through a combination of environment variables and a configuration file, providing a flexible and secure approach to setting up the service. 1. **Environment Variables**: - Used for configuring sensitive information such as vendor API keys - Specify the configuration file to use - Allow for partial settings to be configured directly, see [Settings Loading Mechanism](#settings-loading-mechanism) for more details - Provide a way to override settings in different environments 2. **Configuration File**: - Used for detailed configuration of components, pipelines, and other service settings - Allows for more complex and structured configuration options This dual approach ensures that sensitive data can be kept secure (using environment variables) while allowing for more detailed and shareable configuration through the configuration file. It also provides flexibility in deployment across different environments. ## Settings Loading Mechanism The AI service uses a hierarchical approach to load settings, ensuring flexibility across different environments and deployment scenarios. The settings are loaded in the following order of precedence: 1. **Default Values**: These are defined as class attributes in the `Settings` class within [`config.py`](../src/config.py). They serve as the base configuration. 2. **Environment Variables**: Using [pydantic-settings](https://fastapi.tiangolo.com/advanced/settings/#pydantic-settings), the service checks for environment variables that match the setting names. If found, these override the default values. For example, `WREN_AI_SERVICE_HOST` can override the default `host` value. 3. **.env.dev File**: The service loads additional settings or overrides existing ones from a `.env.dev` file if present. This is particularly useful for development environments. 4. **config.yaml File**: This file provides the highest priority configuration. It can override all previous settings and is used to configure components, pipelines, and other detailed settings. See [Configuration File](#configuration-file) for more details. This mechanism allows for easy configuration management across different environments, from development to production, while maintaining security for sensitive information like API keys. ## Configuration File The configuration file (`config.yaml`) is structured into several sections, each defining different aspects of the AI service. Here's a breakdown of its main components: 1. **LLM Configuration**: ```yaml type: llm provider: models: - model: kwargs: {} api_base: ``` This component initializes the LLM provider at runtime. You can specify multiple models with different parameters. The `kwargs` field allows for model-specific configurations. For example: ```yaml type: llm provider: openai_llm models: - model: gpt-4 kwargs: temperature: 0 n: 1 max_tokens: 4096 response_format: type: "json_object" - model: gpt-4o-mini kwargs: {} api_base: https://api.openai.com/v1 ``` For detailed parameter options, refer to the implementation of the specific LLM provider. 2. **Embedder Configuration**: ```yaml type: embedder provider: models: - model: dimension: api_base: timeout: ``` This component configures the embedder, which converts text into numerical vectors. The `provider` specifies the embedder service (e.g., OpenAI, Ollama). You can define multiple `models` with their parameters. The `dimension` parameter indicates the size of the embedding vector. 3. **Engine Configuration**: ```yaml type: engine provider: endpoint: ``` This component configures the engine responsible for generating SQL queries. The `provider` specifies the engine service (e.g., Wren UI). 4. **Document Store Configuration**: ```yaml type: document_store provider: ``` This component configures the document store, which is responsible for storing and retrieving embeddings. The `provider` specifies the document store service (e.g., Qdrant). 5. **Pipeline Configuration**: ```yaml type: pipeline pipes: - name: llm: . embedder: . engine: document_store: ``` This component configures each pipeline, specifying different LLM, embedder, engine, and document store combinations. For LLM and embedder, use `.`. For engine and document store, use ``. Example: ```yaml type: pipeline pipes: - name: sql_generation llm: openai_llm.gpt-4o-mini engine: wren_ui ``` 6. **Settings**: ```yaml settings: host: port: column_indexing_batch_size: table_retrieval_size: table_column_retrieval_size: query_cache_maxsize: query_cache_ttl: langfuse_host: langfuse_enable: logging_level: development: ``` This section defines various service settings including host, port, indexing and retrieval parameters, cache settings, Langfuse configuration, logging level, and development mode. This configuration file allows for detailed customization of the AI service components, pipelines, and overall behavior. It provides a centralized place to manage complex configurations while keeping sensitive information separate (managed through environment variables). See [Full Configuration File](../tools/config/config.full.yaml) for a complete example. ================================================ FILE: wren-ai-service/entrypoint.sh ================================================ #!/bin/bash set -e INTERVAL=1 TIMEOUT=60 # Wait for qdrant to be responsive echo "Waiting for qdrant to start..." current=0 while ! nc -z $QDRANT_HOST 6333; do sleep $INTERVAL current=$((current + INTERVAL)) if [ $current -eq $TIMEOUT ]; then echo "Timeout: qdrant did not start within $TIMEOUT seconds" exit 1 fi done echo "qdrant has started." # Start wren-ai-service in the background uvicorn src.__main__:app --host 0.0.0.0 --port $WREN_AI_SERVICE_PORT --loop uvloop --http httptools & if [[ -n "$SHOULD_FORCE_DEPLOY" ]]; then # Wait for the server to be responsive echo "Waiting for wren-ai-service to start..." current=0 while ! nc -z localhost $WREN_AI_SERVICE_PORT; do sleep $INTERVAL current=$((current + INTERVAL)) if [ $current -eq $TIMEOUT ]; then echo "Timeout: wren-ai-service did not start within $TIMEOUT seconds" exit 1 fi done echo "wren-ai-service has started." # Wait for wren-ui to be responsive echo "Waiting for wren-ui to start..." current=0 while ! nc -z wren-ui $WREN_UI_PORT && ! nc -z host.docker.internal $WREN_UI_PORT; do sleep $INTERVAL current=$((current + INTERVAL)) if [ $current -eq $TIMEOUT ]; then echo "Timeout: wren-ui did not start within $TIMEOUT seconds" exit 1 fi done echo "wren-ui has started." echo "Forcing deployment..." python -m src.force_deploy fi # Bring wren-ai-service to the foreground wait ================================================ FILE: wren-ai-service/eval/.gitignore ================================================ .env config.yaml ================================================ FILE: wren-ai-service/eval/README.md ================================================ # Evaluation Framework This document describes the evaluation framework for the Wren AI service. The evaluation framework is designed to assess the performance of the Wren AI service based on the following components: ## Requirements 1. **Install Just**: Download and install [Just](https://github.com/casey/just?tab=readme-ov-file#packages) to run the evaluation framework commands. 2. **Set up Langfuse**: Create an account on [Langfuse](https://cloud.langfuse.com) and obtain the API key and secret. Populate the `.env.dev` file with these credentials. 3. **Start Development Services**: Run `just up` to initiate the necessary development services. 4. **Configuration File**: Ensure you have a copy of `config.yaml` located in the `wren-ai-service/eval/` directory. ## Dataset Curation The dataset curation process is used to prepare the evaluation dataset for the Wren AI service on evaluation purpose. You can follow the steps below to start the curation app: - copy `.env.example` to `.env` and fill in the environment variables - execute the command under the `wren-ai-service` folder: `just curate_eval_data` ## Eval Dataset Preparation(If using Spider 1.0 dataset, or Bird dataset) ```cli just prep ``` Currently, we support two datasets for evaluation: - `spider1.0`: The Spider dataset (default if no dataset specified) - `bird`: The Bird dataset The command performs two main steps: 1. Downloads the specified dataset to: ```txt wren-ai-service/tools/dev/etc/ ``` 2. Prepares and saves evaluation datasets to: ```txt wren-ai-service/eval/dataset ``` The output files follow these naming conventions: - Spider dataset: `spider__eval_dataset.toml` - Bird dataset: `bird__eval_dataset.toml` Each evaluation dataset contains questions, SQL queries, and relevant context needed for testing the system's text-to-SQL capabilities. ## Evaluation Dataset Schema - dataset_id(UUID) - date - mdl - eval dataset ## Configure the datasource for prediction and evaluation Before starting the prediction and evaluation process, you need to configure the datasource correctly. This ensures that the system can access the necessary data for making predictions and evaluations. ### For Spider or Bird Datasets For the Spider or Bird datasets, a built-in datasource is used. This means that the data is stored locally and accessed through a specific path. You need to specify the `eval_data_db_path` in the `config.yaml` file. This path tells the system where to find the database files. Here's an example of how to set this up in the `config.yaml` file: ```yaml eval_data_db_path: "etc/bird/minidev/MINIDEV/dev_databases" ``` ### Configuring BigQuery as a Datasource for Other custom MDLs When working with custom MDLs that utilize BigQuery as their datasource, it's crucial to properly configure your system to access the necessary datasets. This involves setting specific parameters in the `config.yaml` file or the `.env.dev` file. Both methods are effective, but using the `.env.dev` file is particularly beneficial for keeping sensitive credentials secure. #### Encoding the credentials You can use the following command to encode the credentials: ```cli cat | base64 ``` #### Configuration in `config.yaml` To enable access to your BigQuery dataset, add the following parameters to your `config.yaml` file. This configuration will guide the system in locating and authenticating with your BigQuery resources: ```yaml bigquery_project_id: "your_project_id" bigquery_dataset_id: "your_dataset_id" bigquery_credentials: "your_credentials" # this is a base64 encoded string of the credentials ``` #### Configuration in `.env.dev` For the `.env.dev` file, you can use the following parameters: ```env BIGQUERY_PROJECT_ID="your_project_id" BIGQUERY_DATASET_ID="your_dataset_id" BIGQUERY_CREDENTIALS="your_credentials" # this is a base64 encoded string of the credentials ``` ## Prediction Process The prediction process is used to produce the results of the evaluation data using the Wren AI service. It will create traces and a session on Langfuse to make the results available to the user. You can use the following command to predict the evaluation dataset under the `eval/dataset` directory: ```cli just predict ``` Also, sub-pipeline predictions are supported by specifying the pipeline name: ```cli just predict ``` Currently, we support the following pipelines: 'ask', 'generation', and 'retrieval'. If no pipeline name is specified, the default is the 'ask' pipeline. ## Evaluation Process The evaluation process is used to assess the prediction results of the Wren AI service. It compares the prediction results with the ground truth and calculates the evaluation metrics. This process will also add a trace in the same session on Langfuse to make the evaluation results available to the user. You can use the following command to evaluate the prediction results under the `outputs/predictions` directory: ```cli just eval ``` Note: If you would like to enable semantics comparison between SQLs by LLM in order to improve the accuracy metric, please fill in Open AI API key in `.env` file in `wren-ai-service/eval` and add `--semantics` to the end of the command like following: ```cli just eval --semantics ``` The evaluation results will be presented on Langfuse as follows: ![shallow_trace_example](../docs/imgs/shallow_trace_example.png) ## Terms This section describes the terms used in the evaluation framework: - **input**: The user query used as input to the Wren AI service (e.g., "What is the total number of COVID-19 cases in the US?"). - **actual_output**: The actual SQL query generated to retrieve the answer to the user query (e.g., "SELECT SUM(cases) FROM covid19 WHERE country='US'"). - **expected_output**: The expected SQL query that should retrieve the answer to the user query (e.g., "SELECT SUM(cases) FROM covid19 WHERE country='US'"). - **retrieval_context**: The relevant context that helps the LLM generate the SQL query (e.g., "covid19.country", "covid19.cases"). - **context**: The relevant context that aligns with human expectations to generate the SQL query (e.g., "covid19.country", "covid19.cases"). ## Metrics This section describes the evaluation metrics used in the evaluation framework: - **Accuracy**: This metrics is defined as the proportion of the correct SQL output generated by the model compared to the expected SQL output. It checks if the generated SQL query produces the correct results. - **Answer Relevancy**: This metric helps determine how well your LLM generates relevant information based on the input it receives. It ensures the efficiency and accuracy of the model's output. - **Faithfulness**: This metric helps determine how well your LLM generates information that is factually correct and aligned with the retrieval context, minimizing hallucinations and contradictions. - **Contextual Relevancy**: This metric helps determine how well your retriever minimizes irrelevant information while maximizing the retrieval of relevant information. It ensures the efficiency and accuracy of the retrieval process. - **Contextual Recall**: This metric helps determine how well the embedding model identifies and retrieves relevant information based on the given context. - **Contextual Precision**: This metric helps determine how well the reranker places relevant nodes higher in the ranking, ensuring that users get the most pertinent results quickly. - **QuestionToReasoningJudge**: This metric helps determine how well the LLM generates reasoning that is aligned with the question. - **ReasoningToSqlJudge**: This metric helps determine how well the LLM generates SQL that is aligned with the reasoning. - **SqlSemanticsJudge**: This metric helps determine how well the LLM generates SQL that is semantically equivalent to the expected SQL. ================================================ FILE: wren-ai-service/eval/__init__.py ================================================ from pathlib import Path from pydantic import Field, SecretStr from src.config import Settings SPIDER_DESTINATION_PATH = Path("./tools/dev/etc/spider1.0") BIRD_DESTINATION_PATH = Path("./tools/dev/etc/bird") WREN_ENGINE_API_URL = "http://localhost:8080" EVAL_DATASET_DESTINATION_PATH = Path("./eval/dataset") class EvalSettings(Settings): langfuse_project_id: str = "" batch_size: int = 4 batch_interval: int = 1 datasource: str = "bigquery" config_path: str = "eval/config.yaml" openai_api_key: SecretStr = Field(alias="OPENAI_API_KEY") allow_sql_samples: bool = True allow_instructions: bool = True allow_sql_functions: bool = True eval_data_db_path: str = "" # BigQuery bigquery_project_id: str = Field(default="") bigquery_dataset_id: str = Field(default="") bigquery_credentials: SecretStr = Field(default="") # Postgres postgres_host: str = Field(default="postgres") postgres_port: str = Field(default="5432") postgres_user: str = Field(default="postgres") postgres_password: SecretStr = Field(default="postgres") postgres_database: str = Field(default="test") @property def langfuse_url(self) -> str: if not self.langfuse_project_id: return "" return f"{self.langfuse_host.rstrip('/')}/project/{self.langfuse_project_id}" def get_openai_api_key(self) -> str: return self.openai_api_key.get_secret_value() @property def bigquery_info(self) -> dict: return { "project_id": self.bigquery_project_id, "dataset_id": self.bigquery_dataset_id, "credentials": self.bigquery_credentials.get_secret_value(), } @property def postgres_info(self) -> dict: return { "host": self.postgres_host, "port": self.postgres_port, "user": self.postgres_user, "password": self.postgres_password.get_secret_value(), "database": self.postgres_database, } ================================================ FILE: wren-ai-service/eval/add_samples_to_toml.py ================================================ import argparse import tomlkit from eval.utils import ( get_next_few_items_circular, ) if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument("--toml", type=str, help="The toml file name", required=True) args = parser.parse_args() if args.toml: # read toml with open(f"eval/dataset/{args.toml}", "r") as f: doc = tomlkit.parse(f.read()) # get the list of question-sql pairs for generating sample values ground_truth_list = [ {"question": element["question"], "sql": element["sql"]} for element in doc["eval_dataset"] ] # utilize utils.get_next_few_items_circular, put n samples in the eval dataset new_dataset = [] for i, element in enumerate(doc["eval_dataset"]): samples = get_next_few_items_circular(ground_truth_list, i) element["samples"] = samples new_dataset.append(element) # write toml doc["eval_dataset"] = new_dataset with open(f"eval/dataset/added_samples_{args.toml}", "w") as f: f.write(tomlkit.dumps(doc, sort_keys=True)) ================================================ FILE: wren-ai-service/eval/data_curation/__init__.py ================================================ ================================================ FILE: wren-ai-service/eval/data_curation/app.py ================================================ import asyncio import re import sys import uuid from datetime import datetime from pathlib import Path import orjson import pandas as pd import streamlit as st import tomlkit from openai import AsyncClient from streamlit_tags import st_tags sys.path.append(f"{Path().parent.resolve()}") from utils import ( DATA_SOURCES, WREN_ENGINE_ENDPOINT, WREN_IBIS_ENDPOINT, get_contexts_from_sqls, get_data_from_wren_engine_with_sqls, get_question_sql_pairs, is_sql_valid, prettify_sql, ) from eval import EvalSettings from eval.utils import ( get_documents_given_contexts, get_eval_dataset_in_toml_string, get_openai_client, prepare_duckdb_init_sql, prepare_duckdb_session_sql, ) st.set_page_config(layout="wide") st.title("WrenAI Data Curation App") LLM_OPTIONS = ["gpt-4o-mini", "gpt-4o"] settings = EvalSettings() llm_client = get_openai_client(api_key=settings.get_openai_api_key()) # session states if "llm_model" not in st.session_state: st.session_state["llm_model"] = LLM_OPTIONS[0] if "deployment_id" not in st.session_state: st.session_state["deployment_id"] = str(uuid.uuid4()) if "mdl_json" not in st.session_state: st.session_state["mdl_json"] = None if "custom_instructions_for_llm" not in st.session_state: st.session_state["custom_instructions_for_llm"] = "" if "llm_question_sql_pairs" not in st.session_state: st.session_state["llm_question_sql_pairs"] = [] if "user_question_sql_pair" not in st.session_state: st.session_state["user_question_sql_pair"] = {} if "candidate_dataset" not in st.session_state: st.session_state["candidate_dataset"] = [] if "data_source" not in st.session_state: st.session_state["data_source"] = None if "connection_info" not in st.session_state: st.session_state["connection_info"] = None # widget callbacks def on_change_upload_eval_dataset(): doc = tomlkit.parse(st.session_state.uploaded_eval_file.getvalue().decode("utf-8")) assert ( doc["mdl"] == st.session_state["mdl_json"] ), "The model in the uploaded dataset is different from the deployed model" st.session_state["candidate_dataset"] = doc["eval_dataset"] def on_change_custom_instructions_for_llm(): st.session_state["custom_instructions_for_llm"] = st.session_state[ "custom_instructions_text_area" ] def on_click_generate_question_sql_pairs(llm_client: AsyncClient): st.toast("Generating question-sql-pairs...") st.session_state["llm_question_sql_pairs"] = asyncio.run( get_question_sql_pairs( llm_client, st.session_state["llm_model"], st.session_state["mdl_json"], st.session_state["custom_instructions_for_llm"], st.session_state["data_source"], st.session_state["connection_info"], ) ) def on_click_setup_uploaded_file(): uploaded_file = st.session_state.get("uploaded_mdl_file") if uploaded_file: match = re.match( r".+_(" + "|".join(DATA_SOURCES) + r")(_.+)?_mdl\.json$", uploaded_file.name, ) if not match: st.error( f"the file name must be [xxx]_[datasource]_mdl.json, now we support these datasources: {DATA_SOURCES}" ) st.stop() data_source = match.group(1) st.session_state["data_source"] = data_source st.session_state["mdl_json"] = orjson.loads( uploaded_file.getvalue().decode("utf-8") ) if data_source == "bigquery": st.session_state["connection_info"] = settings.bigquery_info elif data_source == "duckdb": prepare_duckdb_session_sql(WREN_ENGINE_ENDPOINT) prepare_duckdb_init_sql( WREN_ENGINE_ENDPOINT, st.session_state["mdl_json"]["catalog"], "etc/spider1.0/database", ) else: st.session_state["data_source"] = None st.session_state["mdl_json"] = None st.session_state["connection_info"] = None def on_change_llm_model(): st.toast(f"Switching LLM model to {st.session_state['select_llm_model']}") st.session_state["llm_model"] = st.session_state["select_llm_model"] def on_change_sql(i: int, key: str): sql = st.session_state[key] valid, error = asyncio.run( is_sql_valid( sql, st.session_state["data_source"], st.session_state["mdl_json"], st.session_state["connection_info"], WREN_ENGINE_ENDPOINT if st.session_state["data_source"] == "duckdb" else WREN_IBIS_ENDPOINT, ) ) if valid: new_context = asyncio.run( get_contexts_from_sqls([sql], st.session_state["mdl_json"]) )[0] document = get_documents_given_contexts( [new_context], st.session_state["mdl_json"] ) if i != -1: st.session_state["llm_question_sql_pairs"][i]["sql"] = sql st.session_state["llm_question_sql_pairs"][i]["is_valid"] = valid st.session_state["llm_question_sql_pairs"][i]["error"] = error if valid: st.session_state["llm_question_sql_pairs"][i]["context"] = new_context st.session_state["llm_question_sql_pairs"][i]["document"] = document else: st.session_state["user_question_sql_pair"]["sql"] = sql st.session_state["user_question_sql_pair"]["is_valid"] = valid st.session_state["user_question_sql_pair"]["error"] = error if valid: st.session_state["user_question_sql_pair"]["context"] = new_context st.session_state["user_question_sql_pair"]["document"] = document def on_click_add_candidate_dataset(i: int, categories: list): if i != -1: dataset_to_add = { "categories": categories, "question": st.session_state["llm_question_sql_pairs"][i]["question"], "context": st.session_state["llm_question_sql_pairs"][i]["context"], "sql": st.session_state["llm_question_sql_pairs"][i]["sql"], "document": st.session_state["llm_question_sql_pairs"][i]["document"], } else: dataset_to_add = { "categories": categories, "question": st.session_state["user_question_sql_pair"]["question"], "context": st.session_state["user_question_sql_pair"]["context"], "sql": st.session_state["user_question_sql_pair"]["sql"], "document": st.session_state["user_question_sql_pair"]["document"], } # reset input for user question sql pair st.session_state["user_question_sql_pair"] = {} st.session_state["user_question"] = "" st.session_state["user_sql"] = "" should_add = True for dataset in st.session_state["candidate_dataset"]: if dataset == dataset_to_add: should_add = False break if should_add: st.session_state["candidate_dataset"].append(dataset_to_add) def on_change_user_question(): if not st.session_state["user_question_sql_pair"]: st.session_state["user_question_sql_pair"] = { "question": st.session_state["user_question"], "context": [], "document": [], "sql": "", "is_valid": False, "error": "", } else: st.session_state["user_question_sql_pair"] = { **st.session_state["user_question_sql_pair"], "question": st.session_state["user_question"], } def on_click_remove_candidate_dataset_button(i: int): st.session_state["candidate_dataset"].pop(i) st.file_uploader( f"Upload an MDL json file, and the file name must be [xxx]_[datasource]_mdl.json, now we support these datasources: {DATA_SOURCES}", type="json", key="uploaded_mdl_file", on_change=on_click_setup_uploaded_file, ) st.selectbox( label="Select which LLM model you want to use", options=LLM_OPTIONS, index=0, key="select_llm_model", on_change=on_change_llm_model, ) tab_create_dataset, tab_modify_dataset = st.tabs( ["Create New Evaluation Dataset", "Modify Saved Evaluation Dataset"] ) with tab_create_dataset: st.markdown( """ ### Usage Guide 1. Upload an MDL json file first 2. Get question-sql-pairs given by LLM or you manually enter question and corresponding sql 3. Do validation on each group of question, context and SQL, and move it to the candidate dataset if you think it's valid 3. Save the candidate dataset by clicking the "Save as Evaluation Dataset" button. """ ) with tab_modify_dataset: st.markdown( """ ### Usage Guide 1. Upload an MDL json file first 2. Upload the evaluation dataset(`.toml` file) you want to modify, and please make sure the model in the dataset is the same as the deployed model 3. Modify the evaluation dataset the same as you create a new one 4. Save the candidate dataset by clicking the "Save as Evaluation Dataset" button. """ ) st.warning( "WARNING: Uploading the evaluation dataset will overwrite the current candidate dataset" ) st.file_uploader( "Upload Evaluation Dataset", type="toml", key="uploaded_eval_file", on_change=on_change_upload_eval_dataset, disabled=st.session_state["mdl_json"] is None, ) if st.session_state["mdl_json"] is not None: col1, col2 = st.columns(2) with col1: st.markdown("### Question SQL Pairs") tab_generated_by_llm, tab_generated_by_user = st.tabs( ["Generated by LLM", "Generated by User"] ) with tab_generated_by_llm: st.text_area( "Custom Instructions for generating question-sql-pairs (Optional)", key="custom_instructions_text_area", value=st.session_state["custom_instructions_for_llm"], placeholder="You can specify the custom instructions on how LLM should generate question-sql-pairs here, for example: what type of questions you want to generate.", on_change=on_change_custom_instructions_for_llm, ) st.button( "Generate 10 question-sql-pairs", key="generate_question_sql_pairs", on_click=on_click_generate_question_sql_pairs, args=(llm_client,), ) with st.container(border=True, height=550): for i, question_sql_pair in enumerate( st.session_state["llm_question_sql_pairs"] ): st.text_input( f"Question {i}", question_sql_pair["question"], disabled=True, key=f"question_{i}", ) categories = st_tags( label=f"Categories {i}", text="Press enter to add more", value=[], key=f"categories_{i}", ) st.multiselect( label=f"Context {i}", options=question_sql_pair["context"], default=question_sql_pair["context"], key=f"context_{i}", help="Contexts are automatically generated based on the SQL once you save the changes of the it(ctrl+enter or command+enter)", disabled=True, ) st.text_area( f"SQL {i}", prettify_sql(question_sql_pair["sql"]), key=f"sql_{i}", height=250, on_change=on_change_sql, args=(i, f"sql_{i}"), ) if st.session_state["llm_question_sql_pairs"][i]["is_valid"]: st.success("SQL is valid") st.dataframe( pd.DataFrame( question_sql_pair["data"]["data"], columns=question_sql_pair["data"]["columns"], ) ) else: st.error( f"SQL is invalid: {st.session_state['llm_question_sql_pairs'][i]['error']}" ) st.button( "Move it to the candidate dataset", key=f"move_to_dataset_{i}", disabled=( not st.session_state["llm_question_sql_pairs"][i][ "is_valid" ] or not st.session_state[f"context_{i}"] or not categories ), on_click=on_click_add_candidate_dataset, args=( i, categories, ), ) st.markdown("---") with tab_generated_by_user: with st.container(border=True, height=550): st.text_input( "Question", disabled=False, key="user_question", on_change=on_change_user_question, ) categories = st_tags( label="Categories", text="Press enter to add more", value=[], key="user_categories", ) st.multiselect( label="Context", options=st.session_state.get("user_question_sql_pair", {}).get( "context", [] ), default=st.session_state.get("user_question_sql_pair", {}).get( "context", [] ), key="user_context", help="Contexts are automatically generated based on the SQL once you save the changes of the it(ctrl+enter or command+enter)", disabled=True, ) st.text_area( "SQL", key="user_sql", height=250, on_change=on_change_sql, args=(-1, "user_sql"), ) if st.session_state.get("user_question_sql_pair", {}).get( "is_valid", False ): st.success("SQL is valid") data = asyncio.run( get_data_from_wren_engine_with_sqls( [st.session_state["user_question_sql_pair"]["sql"]], st.session_state["data_source"], st.session_state["mdl_json"], st.session_state["connection_info"], WREN_ENGINE_ENDPOINT if st.session_state["data_source"] == "duckdb" else WREN_IBIS_ENDPOINT, ) )[0] st.dataframe( pd.DataFrame( data["data"], columns=data["columns"], ) ) else: st.error( f"SQL is invalid: {st.session_state.get('user_question_sql_pair', {}).get('error', '')}" ) st.button( "Move it to the candidate dataset", key="move_to_dataset", disabled=( not st.session_state.get("user_question_sql_pair", {}).get( "is_valid", False ) or not st.session_state["user_context"] or not st.session_state["user_question"] or not categories ), on_click=on_click_add_candidate_dataset, args=( -1, categories, ), ) with col2: st.markdown("### Candidate Dataset") with st.container(border=True, height=600): for i, dataset in enumerate(st.session_state["candidate_dataset"]): st.text_input( f"Question {i}", dataset["question"], disabled=True, key=f"candidate_dataset_question_{i}", ) st.multiselect( f"Categories {i}", options=dataset["categories"], default=dataset["categories"], disabled=True, key=f"candidate_dataset_categories_{i}", ) st.multiselect( f"Context {i}", options=dataset["context"], default=dataset["context"], disabled=True, key=f"candidate_dataset_context_{i}", ) st.markdown(f"SQL {i}") st.code(prettify_sql(dataset["sql"]), language="sql", line_numbers=True) st.button( "Remove", key=f"remove_{i}", on_click=on_click_remove_candidate_dataset_button, args=(i,), ) st.markdown("---") with st.popover("Save as Evaluation Dataset", use_container_width=True): file_name = st.text_input( "File Name", f"eval_dataset_{datetime.today().strftime('%Y_%m_%d')}.toml", key="eval_dataset_file_name", ) download_btn = st.download_button( "Download", get_eval_dataset_in_toml_string( st.session_state["mdl_json"], st.session_state["candidate_dataset"], ), file_name=file_name, key="download_eval_dataset_confirmed", disabled=not st.session_state["candidate_dataset"], ) if download_btn: st.toast("Downloading the evaluation dataset...") ================================================ FILE: wren-ai-service/eval/data_curation/utils.py ================================================ import asyncio import base64 import logging import os import re import sys from pathlib import Path from typing import List, Tuple import aiohttp import orjson import sqlparse import streamlit as st from dotenv import load_dotenv from openai import AsyncClient # add wren-ai-service to sys.path sys.path.append(f"{Path().parent.parent.resolve()}") from eval.utils import ( get_contexts_from_sql, get_data_from_wren_engine, get_ddl_commands, get_documents_given_contexts, ) from src.pipelines.indexing.db_schema import DDLChunker load_dotenv() WREN_IBIS_ENDPOINT = os.getenv("WREN_IBIS_ENDPOINT", "http://localhost:8000") WREN_ENGINE_ENDPOINT = os.getenv("WREN_ENGINE_ENDPOINT", "http://localhost:8080") DATA_SOURCES = ["bigquery", "duckdb"] TIMEOUT_SECONDS = 60 ddl_converter = DDLChunker() logger = logging.getLogger("wren-ai-service") async def is_sql_valid( sql: str, data_source: str, mdl_json: dict, connection_info: dict, api_endpoint: str, timeout: float = TIMEOUT_SECONDS, ) -> Tuple[bool, str]: sql = sql.rstrip(";") if sql.endswith(";") else sql if data_source == "duckdb": async with aiohttp.request( "GET", f"{api_endpoint}/v1/mdl/dry-run", json={ "sql": remove_limit_statement(sql), "manifest": mdl_json, "limit": 1, }, timeout=aiohttp.ClientTimeout(total=timeout), ) as response: if response.status == 200: return True, None res = await response.json() return False, res else: async with aiohttp.request( "POST", f"{api_endpoint}/v3/connector/{data_source}/query?dryRun=true", json={ "sql": remove_limit_statement(sql), "manifestStr": base64.b64encode(orjson.dumps(mdl_json)).decode(), "connectionInfo": connection_info, }, timeout=aiohttp.ClientTimeout(total=timeout), ) as response: if response.status == 204: return True, None res = await response.text() return False, res async def get_validated_question_sql_pairs( question_sql_pairs: list[dict], data_source: str, mdl_json: dict, connection_info: dict, ) -> list[dict]: tasks = [] async with aiohttp.ClientSession(): for question_sql_pair in question_sql_pairs: task = asyncio.ensure_future( is_sql_valid( question_sql_pair["sql"], data_source, mdl_json, connection_info, WREN_ENGINE_ENDPOINT if data_source == "duckdb" else WREN_IBIS_ENDPOINT, ) ) tasks.append(task) results = await asyncio.gather(*tasks) return [ { **question_sql_pairs[i], "context": [], "is_valid": valid, "error": error, } for i, (valid, error) in enumerate(results) ] async def get_contexts_from_sqls( sqls: list[str], mdl_json: dict, api_endpoint: str = WREN_ENGINE_ENDPOINT, timeout: float = TIMEOUT_SECONDS, ) -> list[list[str]]: async with aiohttp.ClientSession(): tasks = [] for sql in sqls: task = asyncio.ensure_future( get_contexts_from_sql( sql, mdl_json, api_endpoint, timeout, ) ) tasks.append(task) results = await asyncio.gather(*tasks) return results async def get_question_sql_pairs( llm_client: AsyncClient, llm_model: str, mdl_json: dict, custom_instructions: str, data_source: str, connection_info: dict, num_pairs: int = 10, ) -> list[dict]: messages = [ { "role": "system", "content": "", }, { "role": "user", "content": f""" ### TASK ### Given the database DDL, generate {num_pairs} of the questions and corresponding SQL queries. ### Output Format ### {{ "results": [ {{ "question": , "sql": }}, {{ "question": , "sql": }}, ... ] }} ### Custom Instructions ### {custom_instructions} ### Input ### Data Model: {"\n\n".join(get_ddl_commands(mdl_json))} Generate {num_pairs} of the questions and corresponding SQL queries according to the Output Format in JSON Think step by step """, }, ] try: response = await llm_client.chat.completions.create( model=llm_model, messages=messages, response_format={"type": "json_object"}, max_tokens=4096, temperature=0, ) results = orjson.loads(response.choices[0].message.content)["results"] question_sql_pairs = await get_validated_question_sql_pairs( results, data_source=data_source, mdl_json=mdl_json, connection_info=connection_info, ) sqls = [question_sql_pair["sql"] for question_sql_pair in question_sql_pairs] contexts = await get_contexts_from_sqls(sqls, mdl_json) documents = get_documents_given_contexts(contexts, mdl_json) sqls_data = await get_data_from_wren_engine_with_sqls( sqls, data_source, mdl_json, connection_info, WREN_ENGINE_ENDPOINT if st.session_state["data_source"] == "duckdb" else WREN_IBIS_ENDPOINT, ) return [ { **quesiton_sql_pair, "context": context, "data": sql_data, "document": document, } for quesiton_sql_pair, context, sql_data, document in zip( question_sql_pairs, contexts, sqls_data, documents ) ] except Exception as e: logger.error(e) st.error(f"Error generating question-sql-pairs: {e}") return [] def prettify_sql(sql: str) -> str: return sqlparse.format( sql, reindent=True, keyword_case="upper", ) async def get_data_from_wren_engine_with_sqls( sqls: List[str], data_source: str, mdl_json: dict, connection_info: dict, api_endpoint: str, timeout: float = TIMEOUT_SECONDS, ) -> List[dict]: assert data_source in DATA_SOURCES, f"Invalid data source: {data_source}" async with aiohttp.ClientSession(): tasks = [] for sql in sqls: task = asyncio.ensure_future( get_data_from_wren_engine( sql=sql, mdl_json=mdl_json, api_endpoint=api_endpoint, data_source=data_source, connection_info=connection_info, timeout=timeout, limit=50, ) ) tasks.append(task) return await asyncio.gather(*tasks) def remove_limit_statement(sql: str) -> str: pattern = r"\s*LIMIT\s+\d+(\s*;?\s*--.*|\s*;?\s*)$" modified_sql = re.sub(pattern, "", sql, flags=re.IGNORECASE) return modified_sql ================================================ FILE: wren-ai-service/eval/dataset/.gitignore ================================================ * !.gitignore ================================================ FILE: wren-ai-service/eval/dspy_modules/__init__.py ================================================ ================================================ FILE: wren-ai-service/eval/dspy_modules/ask_generation.py ================================================ import dspy class AskGenerationSignatureV1(dspy.Signature): """Given a user query that is ambiguous in nature, your task is to interpret the query in various plausible ways and \ generate three SQL statements that could potentially answer each interpreted version of the queries and within-10-words summary. \ Provide three different interpretations and corresponding SQL queries that reflect these interpretations. \ Ensure that your SQL queries are diverse, covering a range of possible meanings behind the ambiguous query. \ The output should be in the following JSON format: { "results": [ {"sql": , "summary": }, {"sql": , "summary": }, {"sql": , "summary": } ] } """ question = dspy.InputField() context = dspy.InputField(description="List of database schema documents") answer = dspy.OutputField() class AskGenerationV1(dspy.Module): def __init__(self): super().__init__() self.generate_answer = dspy.ChainOfThought(AskGenerationSignatureV1) def forward(self, question, context): prediction = self.generate_answer(question=question, context=context) return dspy.Prediction(context=context, answer=prediction.answer) ================================================ FILE: wren-ai-service/eval/dspy_modules/prompt_optimizer.py ================================================ import argparse import os import re import sys from datetime import datetime from pathlib import Path from typing import Callable, Tuple import dotenv import dspy import dspy.evaluate import dspy.teleprompt sys.path.append(f"{Path().parent.resolve()}") import src.utils as utils from eval.dspy_modules.ask_generation import AskGenerationV1 from eval.utils import parse_toml def parse_args() -> Tuple[str]: parser = argparse.ArgumentParser() parser.add_argument( "--file", "-F", type=str, required=True, help="Eval dataset file name in the eval/dataset folder", ) parser.add_argument( "--program_file", "-P", type=str, help="Optimized program file name in the eval/optimized folder", ) parser.add_argument( "--optimize", action=argparse.BooleanOptionalAction, help="Whether to optimize the program or not", ) parser.add_argument( "--eval", action=argparse.BooleanOptionalAction, help="Whether to evaluate the program or not based on the devset of eval dataset", ) return parser.parse_args() optimizer_parameters = { "evaluator": None, "metrics": None, "meta": None, "predictions": None, } def configure_llm_provider(llm: str, api_key: str): dspy.settings.configure(lm=dspy.LM(model=llm, api_key=api_key)) def clean_sql(sql: str) -> str: return re.sub("[ \t\n]+", " ", sql) def prepare_dataset(path: str, train_ratio: float = 0.5): eval_dataset = parse_toml(f"eval/dataset/{path}")["eval_dataset"] dspy_dataset = [] for data in eval_dataset: dspy_dataset.append( dspy.Example( context=[str(doc["content"]) for doc in data["document"]], question=str(data["question"]), answer=clean_sql(str(data["sql"])), ).with_inputs("question", "context") ) train_size = int(len(dspy_dataset) * train_ratio) _train = dspy_dataset[:train_size] _dev = dspy_dataset[train_size:] return _train, _dev # Validation logic: check that the predicted answer is correct. # Also check that the retrieved context does actually contain that answer. def validate_context_and_answer(example, pred, trace=None): if optimizer_parameters["predictions"] is None: # if we don't have metric from eval module, we use the default metric answer_EM = dspy.evaluate.answer_exact_match(example, pred) answer_PM = dspy.evaluate.answer_passage_match(example, pred) return answer_EM and answer_PM else: prediction = optimizer_parameters["predictions"][0] prediction.input = example.question prediction.expected_output = example.answer prediction.context = example.context prediction["type"] = "execution" prediction.actual_output = pred.answer # reuse the first predict result to optimize the dspy module optimizer_parameters["evaluator"].eval( optimizer_parameters["meta"], [prediction] ) sum_score = 0 for metric in optimizer_parameters["metrics"].get("metrics"): sum_score += metric.score return sum_score def optimize( module: dspy.Module, optimizer: dspy.teleprompt.Teleprompter, trainset: list, metric: Callable, ): optimizer = optimizer(metric=metric) return optimizer.compile(module(), trainset=trainset) def build_optimizing_module(trainset): module = optimize( AskGenerationV1, dspy.teleprompt.BootstrapFewShot, trainset=trainset, metric=validate_context_and_answer, ) path = f"eval/optimized/{AskGenerationV1.__name__}_optimized_{datetime.now().strftime("%Y_%m_%d_%H%M%S")}.json" directory = os.path.dirname(path) if directory and not os.path.exists(directory): os.makedirs(directory) module.save(path) return module if __name__ == "__main__": args = parse_args() path = f"eval/dataset/{args.file}" optimized_program_file = args.program_file should_optimize = args.optimize should_eval = args.eval dotenv.load_dotenv() utils.load_env_vars() configure_llm_provider(os.getenv("GENERATION_MODEL"), os.getenv("OPENAI_API_KEY")) trainset, devset = prepare_dataset(path) if optimized_program_file: module = AskGenerationV1() module.load(f"eval/optimized/{optimized_program_file}") elif should_optimize: module = build_optimizing_module(trainset) else: module = AskGenerationV1() if should_eval: evaluator = dspy.evaluate.Evaluate( devset=devset, metric=validate_context_and_answer, display_progress=True, display_table=True, return_outputs=True, ) results = evaluator( module, metric=validate_context_and_answer, display_progress=True, display_table=True, return_all_scores=True, return_outputs=True, ) for result in results: if isinstance(result, list): for item in result: if isinstance(item, tuple): if len(item) == 3: print(item[0]) print(f"Question: {item[0].get('question')}") print(f"Context: {item[0].get('context')}") print(item[1]) print(f"Answer: {item[1].get('answer')}") print(f"Context: {item[1].get('context')}") ================================================ FILE: wren-ai-service/eval/evaluation.py ================================================ import argparse import sys from pathlib import Path from typing import Tuple from deepeval import evaluate from deepeval.evaluate import TestResult from deepeval.test_case import LLMTestCase from langfuse import Langfuse from langfuse.decorators import langfuse_context, observe sys.path.append(f"{Path().parent.resolve()}") import traceback import eval.pipelines as pipelines import src.providers as provider from eval import EvalSettings from eval.utils import parse_toml, trace_metadata from src import utils def formatter(prediction: dict, meta: dict) -> dict: """ Formats the prediction result to be used as evaluation input. This function takes a prediction dictionary and a meta dictionary, processes them to extract relevant information, and returns a formatted dictionary that serves as input for evaluation. It includes details such as input, actual and expected outputs, context, and additional metadata. Args: prediction (dict): A dictionary containing prediction details. meta (dict): A dictionary containing metadata information. Returns: dict: A formatted dictionary containing evaluation input data. """ retrieval_context = [str(context) for context in prediction["retrieval_context"]] context = [str(context) for context in prediction["context"]] enable_spider_metrics = "spider" in meta.get("evaluation_dataset", "").lower() enable_rewrite = any( dataset in meta.get("evaluation_dataset", "").lower() for dataset in ["spider"] ) return { "input": prediction["input"], "actual_output": ( prediction.get("actual_output", {}) .get("post_process", {}) .get("valid_generation_result", {}) .get("sql", "") ), "expected_output": prediction["expected_output"], "retrieval_context": retrieval_context, "context": context, "reasoning": prediction.get("reasoning", ""), "additional_metadata": { "trace_id": prediction["trace_id"], "trace_url": prediction["trace_url"], "catalog": meta.get("catalog", None), "enable_spider_metrics": enable_spider_metrics, "enable_rewrite": enable_rewrite, }, } def parse_args() -> Tuple[str]: parser = argparse.ArgumentParser() parser.add_argument( "--file", "-F", type=str, help="Eval the prediction result in the outputs/predictions directory", ) parser.add_argument( "--semantics", "-S", default=False, action=argparse.BooleanOptionalAction, help="Whether use the LLM(OpenAI's gpt-4o-mini) to help check semantics of sqls to improve accuracy metrics", ) parser.add_argument( "--training-dataset", "-T", default=None, help="Use the training dataset to build a dspy optimized module", ) return parser.parse_args() class Evaluator: def __init__(self, metrics: list, **kwargs): self._score_collector = {} self._langfuse = Langfuse() self._metrics = metrics self._failed_count = 0 self._post_metrics = kwargs.get("post_metrics", []) def eval(self, meta: dict, predictions: list) -> None: for prediction in predictions: try: test_case = LLMTestCase(**formatter(prediction, meta)) result = evaluate( [test_case], self._metrics, ignore_errors=True ).test_results[0] self._score_metrics(test_case, result) [metric.collect(test_case, result) for metric in self._post_metrics] except Exception: self._failed_count += 1 traceback.print_exc() self._average_score(meta) def _score_metrics(self, test_case: LLMTestCase, result: TestResult) -> None: for metric in result.metrics_data: name = metric.name score = metric.score or 0 self._langfuse.score( trace_id=test_case.additional_metadata["trace_id"], name=name, value=score, comment=metric.reason or metric.error, source="EVAL", ) if name not in self._score_collector: self._score_collector[name] = [] self._score_collector[name].append(score) @observe(name="Summary Trace", capture_input=False, capture_output=False) def _average_score(self, meta: dict) -> None: langfuse_context.update_current_trace( session_id=meta.get("session_id"), user_id=meta.get("user_id"), metadata=trace_metadata(meta, type="summary"), ) summary = { "query_count": meta["query_count"], "expected_batch_size": meta["expected_batch_size"], "actual_batch_size": meta["actual_batch_size"], "valid_eval_count": meta["actual_batch_size"] - self._failed_count, } langfuse_context.update_current_observation(output=summary) for name, scores in self._score_collector.items(): langfuse_context.score_current_trace( name=name, value=sum(scores) / len(scores), comment=f"Average score for {name}", ) for metric in self._post_metrics: langfuse_context.score_current_trace( name=metric.__name__, value=metric.measure(), comment=f"Average score for {metric.__name__}", ) if __name__ == "__main__": args = parse_args() settings = EvalSettings() pipe_components = provider.generate_components(settings.components) utils.init_langfuse(settings) predicted_file = parse_toml(f"outputs/predictions/{args.file}") meta = predicted_file["meta"] predictions = predicted_file["predictions"] dataset = parse_toml(meta["evaluation_dataset"]) metrics = pipelines.metrics_initiator( meta["pipeline"], dataset, pipe_components, args.semantics, settings ) evaluator = Evaluator(**metrics) evaluator.eval(meta, predictions) # if args.training_dataset: # # todo: for now comment dspy related code # optimizer_parameters["evaluator"] = evaluator # optimizer_parameters["metrics"] = metrics # optimizer_parameters["meta"] = meta # optimizer_parameters["predictions"] = predictions # configure_llm_provider( # os.getenv("GENERATION_MODEL"), os.getenv("OPENAI_API_KEY") # ) # trainset, devset = prepare_dataset(args.training_dataset) # build_optimizing_module(trainset) # else: # evaluator.eval(meta, predictions) langfuse_context.flush() if meta["langfuse_url"]: print( f"\n\nYou can view the evaluation result in Langfuse at {meta['langfuse_url']}/sessions/{meta['session_id']}" ) ================================================ FILE: wren-ai-service/eval/mdl_to_csv.py ================================================ import argparse import csv from pathlib import Path import orjson def gen_eval_preparation_data_from_json_to_csv(mdl_path: str): assert Path(mdl_path).exists(), f"File not found: {mdl_path}" with open(mdl_path) as file: mdl = orjson.loads(file.read()) csv_data = [ [ "table", "table alias", "table description", "column", "column alias", "column description", ] ] for model in mdl["models"]: for column in model["columns"]: csv_data.append( [ model["name"], model.get("properties", {}).get("displayName", ""), model.get("properties", {}).get("description", ""), column["name"], column.get("properties", {}).get("displayName", ""), column.get("properties", {}).get("description", ""), ] ) with open(f"{Path(mdl_path).stem}.csv", "w", newline="\n") as file: writer = csv.writer(file, quoting=csv.QUOTE_MINIMAL) for row in csv_data: writer.writerow(row) def gen_new_mdl_from_csv(mdl_path: str, csv_path: str): assert Path(mdl_path).exists(), f"File not found: {mdl_path}" assert Path(csv_path).exists(), f"File not found: {csv_path}" with open(mdl_path) as file: mdl = orjson.loads(file.read()) csv_data_by_table = {} with open(csv_path, newline="\n") as file: csv_data = csv.reader(file) for row in csv_data: model_name = row[0] if model_name not in csv_data_by_table: csv_data_by_table[model_name] = { "model": { "displayName": row[1], "description": row[2], }, "columns": {}, } csv_data_by_table[model_name]["columns"][row[3]] = { "displayName": row[4], "description": row[5], } new_models = [] for model in mdl["models"]: if model["name"] in csv_data_by_table: if "properties" not in model: model["properties"] = {} if csv_data_by_table[model["name"]]["model"]["displayName"]: model["properties"]["displayName"] = csv_data_by_table[ model["name"] ]["model"]["displayName"] if csv_data_by_table[model["name"]]["model"]["description"]: model["properties"]["description"] = csv_data_by_table[ model["name"] ]["model"]["description"] new_columns = [] for column in model["columns"]: if column["name"] in csv_data_by_table[model["name"]]["columns"]: if "properties" not in column: column["properties"] = {} if csv_data_by_table[model["name"]]["columns"][column["name"]][ "displayName" ]: column["properties"]["displayName"] = csv_data_by_table[ model["name"] ]["columns"][column["name"]]["displayName"] if csv_data_by_table[model["name"]]["columns"][column["name"]][ "description" ]: column["properties"]["description"] = csv_data_by_table[ model["name"] ]["columns"][column["name"]]["description"] new_columns.append(column) model["columns"] = new_columns new_models.append(model) mdl["models"] = new_models with open(f"{Path(mdl_path).stem}_new.json", "w") as file: file.write(orjson.dumps(mdl).decode()) if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument( "--mdl-path", type=str, help="Path to the MDL JSON file", required=True ) parser.add_argument("--csv-path", type=str, help="Path to the input CSV file") args = parser.parse_args() if args.mdl_path and not args.csv_path: gen_eval_preparation_data_from_json_to_csv(args.mdl_path) elif args.mdl_path and args.csv_path: gen_new_mdl_from_csv(args.mdl_path, args.csv_path) ================================================ FILE: wren-ai-service/eval/metrics/__init__.py ================================================ from .accuracy import AccuracyMetric, AccuracyMultiCandidateMetric from .answer_relevancy import AnswerRelevancyMetric from .context_precision import ContextualPrecisionMetric from .context_recall import ContextualRecallMetric from .context_relevancy import ContextualRelevancyMetric from .faithfulness import FaithfulnessMetric from .llm import ( QuestionToReasoningJudge, ReasoningToSqlJudge, SqlSemanticsJudge, ) from .spider.exact_match import ExactMatchAccuracy from .spider.exec_match import ExecutionAccuracy __all__ = [ "AccuracyMetric", "AccuracyMultiCandidateMetric", "AnswerRelevancyMetric", "ContextualPrecisionMetric", "ContextualRecallMetric", "ContextualRelevancyMetric", "FaithfulnessMetric", "ExactMatchAccuracy", "ExecutionAccuracy", "QuestionToReasoningJudge", "ReasoningToSqlJudge", "SqlSemanticsJudge", ] ================================================ FILE: wren-ai-service/eval/metrics/accuracy.py ================================================ import asyncio import re import traceback import orjson import pandas as pd from deepeval.evaluate import TestResult from deepeval.metrics import BaseMetric from deepeval.test_case import LLMTestCase from deprecated import deprecated from eval.utils import get_data_from_wren_engine, get_openai_client class AccuracyMetric(BaseMetric): def __init__(self, engine_info: dict, enable_semantics_comparison: bool = False): self.threshold = 0 self.score = 0 self.engine_info = engine_info self.enable_semantics_comparison = enable_semantics_comparison if self.enable_semantics_comparison: self._openai_client = get_openai_client() def measure(self, test_case: LLMTestCase): return asyncio.run(self.a_measure(test_case)) def _is_subset(self, expected: pd.DataFrame, actual: pd.DataFrame) -> bool: if not set(expected.columns).issubset(set(actual.columns)): return False common_columns = sorted(expected.columns) expected_sorted = expected[common_columns] actual_sorted = actual[common_columns] # Ensure that the data types are the same actual_sorted = actual_sorted.astype(expected_sorted.dtypes.to_dict()) merged = pd.merge( actual_sorted, expected_sorted, on=common_columns, how="left", indicator=True, ) return all(merged["_merge"] == "both") def _count_partial_matches( self, expected: pd.DataFrame, actual: pd.DataFrame ) -> int: intersection = set(expected.columns).intersection(set(actual.columns)) common_columns = sorted(intersection) if not common_columns: return 0 expected_sorted = expected[common_columns] actual_sorted = actual[common_columns] # Ensure that the data types are the same actual_sorted = actual_sorted.astype(expected_sorted.dtypes.to_dict()) merged = pd.merge( actual_sorted, expected_sorted, on=common_columns, how="left", indicator=True, ) if all(merged["_merge"] == "both"): return len(intersection) / len(expected.columns) else: return 0 def _rewrite_sql(self, sql: str) -> str: # Pattern to match double quotes after WHERE clause, including multiple occurrences pattern = r'(WHERE\s+.*?)(")(.+?)(")(.*)$' replacement = r"\1'\3'\5" # Apply the replacement repeatedly until no more changes new_sql = re.sub(pattern, replacement, sql, flags=re.IGNORECASE | re.DOTALL) while new_sql != sql: sql = new_sql new_sql = re.sub(pattern, replacement, sql, flags=re.IGNORECASE | re.DOTALL) return sql async def _retrieve_data(self, sql: str) -> pd.DataFrame: response = await get_data_from_wren_engine(sql=sql, **self.engine_info) df = pd.DataFrame(**response) sorted_columns = sorted(df.columns) return df[sorted_columns].sort_values(by=sorted_columns) async def _check_sql_semantics(self, expected_sql: str, actual_sql: str): _system_prompt = ( "### TASK ### \n" + "You are a great data anlyst, please carefully check the semantics of two given SQLs if they are the same. \n" + "The output should be a JSON format with the following schema: \n" + "{ \n" + ' "reasoning": \n' + ' "same": \n' + "}" ) _user_prompt = ( "### QUESTION ### \n" + f"Expected SQL: {expected_sql} \n" + f"Actual SQL: {actual_sql} \n" + "\n" + "Please think step by step" ) response = await self._openai_client.chat.completions.create( model="gpt-4o-mini", messages=[ {"role": "system", "content": _system_prompt}, {"role": "user", "content": _user_prompt}, ], response_format={"type": "json_object"}, ) print( f"response of _check_sql_semantics: {response.choices[0].message.content}" ) return 1 if orjson.loads(response.choices[0].message.content)["same"] else 0 async def a_measure(self, test_case: LLMTestCase, *args, **kwargs): try: enable_rewrite = test_case.additional_metadata.get("enable_rewrite", False) rewritten_expected_output = test_case.expected_output if enable_rewrite: rewritten_expected_output = self._rewrite_sql(test_case.expected_output) expected_dataset = await self._retrieve_data(rewritten_expected_output) actual_dataset = await self._retrieve_data(test_case.actual_output) print(f"expected columns: {set(expected_dataset.columns)}") print(f"actual columns: {set(actual_dataset.columns)}") if expected_dataset.equals(actual_dataset) or self._is_subset( expected_dataset, actual_dataset ): self.success = True self.score = 1 return self.score self.score = self._count_partial_matches(expected_dataset, actual_dataset) # use llm to check sql semantics if self.score == 0 and self.enable_semantics_comparison: # TODO: we may need to upload the sql semantics result to langfuse print(f"before _check_sql_semantics: {self.score}") print(f"expected sql: {rewritten_expected_output}") print(f"actual sql: {test_case.actual_output}") self.score = await self._check_sql_semantics( rewritten_expected_output, test_case.actual_output ) print(f"after _check_sql_semantics: {self.score}") except Exception as e: self.error = f"Error occurred while evaluating the metric: {e}" traceback.print_exc() # if didn't pass any of the above checks self.success = False return self.score def is_successful(self): return self.success @property def __name__(self): return "Accuracy(column-based)" @deprecated( reason="We don't generate multiple candidates for Text to SQL task, so don't need this metric" ) class AccuracyMultiCandidateMetric(BaseMetric): def __init__(self): self.threshold = 0 self.score = 0 self._questions = {} def collect(self, test_case: LLMTestCase, result: TestResult): for metric in result.metrics_data: if metric.name != "Accuracy(column-based)": continue # or 0 to avoid when metric.error is exist self._questions[test_case.input] = ( self._questions.get(test_case.input, 0) or metric.score or 0 ) def measure(self): if not self._questions: return 0 self.score = sum(self._questions.values()) / len(self._questions) self.success = self.score >= self.threshold return self.score def is_successful(self): return self.success @property def __name__(self): return "Accuracy(question-based)" ================================================ FILE: wren-ai-service/eval/metrics/answer_relevancy.py ================================================ import asyncio from deepeval.metrics import BaseMetric from deepeval.test_case import LLMTestCase from eval.utils import get_contexts_from_sql class AnswerRelevancyMetric(BaseMetric): def __init__(self, engine_info: dict): self.threshold = 0 self.score = 0 self.engine_info = engine_info def measure(self, test_case: LLMTestCase): return asyncio.run(self.a_measure(test_case)) async def a_measure(self, test_case: LLMTestCase, *args, **kwargs): actual_units = await get_contexts_from_sql( sql=test_case.actual_output, **self.engine_info ) expected_units = await get_contexts_from_sql( sql=test_case.expected_output, **self.engine_info ) intersection = set(actual_units) & set(expected_units) self.score = len(intersection) / len(actual_units) self.success = self.score >= self.threshold return self.score def is_successful(self): return self.success @property def __name__(self): return "AnswerRelevancy(column-based)" ================================================ FILE: wren-ai-service/eval/metrics/context_precision.py ================================================ import asyncio from deepeval.metrics import BaseMetric from deepeval.test_case import LLMTestCase class ContextualPrecisionMetric(BaseMetric): def __init__(self): self.threshold = 0 self.score = 0 def measure(self, test_case: LLMTestCase): return asyncio.run(self.a_measure(test_case)) async def a_measure(self, test_case: LLMTestCase, *args, **kwargs): context = test_case.context retrieval_context = test_case.retrieval_context intersection = set(context) & set(retrieval_context) intersection_count = len(intersection) if intersection_count == 0: self.success = False return self.score n = len(retrieval_context) summation = 0 for k in range(1, n + 1): intersection_up_to_k = len(set(context[:k]) & set(retrieval_context[:k])) rk = len(set(context[:k]) & set(retrieval_context[k - 1 : k])) > 0 summation += (intersection_up_to_k / k) * rk self.score = (1 / intersection_count) * summation self.success = self.score >= self.threshold return self.score def is_successful(self): return self.success @property def __name__(self): return "ContextualPrecision(column-based)" ================================================ FILE: wren-ai-service/eval/metrics/context_recall.py ================================================ import asyncio from deepeval.metrics import BaseMetric from deepeval.test_case import LLMTestCase from eval.utils import get_contexts_from_sql class ContextualRecallMetric(BaseMetric): def __init__(self, engine_info: dict): self.threshold = 0 self.score = 0 self.engine_info = engine_info def measure(self, test_case: LLMTestCase): return asyncio.run(self.a_measure(test_case)) async def a_measure(self, test_case: LLMTestCase, *args, **kwargs): expected_units = await get_contexts_from_sql( sql=test_case.expected_output, **self.engine_info ) intersection = set(test_case.retrieval_context) & set(expected_units) self.score = len(intersection) / len(expected_units) self.success = self.score >= self.threshold return self.score def is_successful(self): return self.success @property def __name__(self): return "ContextualRecall(column-based)" ================================================ FILE: wren-ai-service/eval/metrics/context_relevancy.py ================================================ import asyncio from deepeval.metrics import BaseMetric from deepeval.test_case import LLMTestCase class ContextualRelevancyMetric(BaseMetric): def __init__(self): self.threshold = 0 self.score = 0 def measure(self, test_case: LLMTestCase): return asyncio.run(self.a_measure(test_case)) async def a_measure(self, test_case: LLMTestCase, *args, **kwargs): intersection = set(test_case.retrieval_context) & set(test_case.context) self.score = len(intersection) / len(test_case.retrieval_context) self.success = self.score >= self.threshold return self.score def is_successful(self): return self.success @property def __name__(self): return "ContextualRelevancy(column-based)" ================================================ FILE: wren-ai-service/eval/metrics/faithfulness.py ================================================ import asyncio from deepeval.metrics import BaseMetric from deepeval.test_case import LLMTestCase from eval.utils import get_contexts_from_sql class FaithfulnessMetric(BaseMetric): def __init__(self, engine_info: dict): self.threshold = 0 self.score = 0 self.engine_info = engine_info def measure(self, test_case: LLMTestCase): return asyncio.run(self.a_measure(test_case)) async def a_measure(self, test_case: LLMTestCase, *args, **kwargs): actual_units = await get_contexts_from_sql( sql=test_case.actual_output, **self.engine_info ) intersection = set(actual_units) & set(test_case.retrieval_context) self.score = len(intersection) / len(actual_units) self.success = self.score >= self.threshold return self.score def is_successful(self): return self.success @property def __name__(self): return "Faithfulness(column-based)" ================================================ FILE: wren-ai-service/eval/metrics/llm/__init__.py ================================================ import asyncio from deepeval.metrics import BaseMetric from deepeval.test_case import LLMTestCase from haystack.components.builders.prompt_builder import PromptBuilder from pydantic import BaseModel from src.providers import LLMProvider class EvalResult(BaseModel): score: float reason: str _MODEL_KWARGS = { "response_format": { "type": "json_schema", "json_schema": { "name": "eval_result", "schema": EvalResult.model_json_schema(), }, } } def format(response: dict) -> EvalResult: reply = response.get("replies", [])[0] return EvalResult.model_validate_json(reply) class QuestionToReasoningJudge(BaseMetric): _system_prompt = """ You are an expert evaluator. Your task is to analyze the reasoning provided for a given question and determine if it makes sense. Provide a score in the range 0.0~1.0 and a detailed explanation for your evaluation. """ _test_case_prompt = """ Question: {{ question }} Reasoning: {{ reasoning }} """ def __init__(self, llm_provider: LLMProvider, **_): self.threshold = 0 self.score = 0 self.llm_provider = llm_provider self.llm = llm_provider.get_generator( system_prompt=self._system_prompt, generation_kwargs=_MODEL_KWARGS, ) self.prompt_builder = PromptBuilder(template=self._test_case_prompt) def measure(self, test_case: LLMTestCase): return asyncio.run(self.a_measure(test_case)) async def a_measure(self, test_case: LLMTestCase, *args, **kwargs): prompt = self.prompt_builder.run( question=test_case.input, reasoning=test_case.reasoning, ) response = await self.llm(prompt.get("prompt")) result = format(response) self.score = result.score self.reason = result.reason self.success = self.score >= self.threshold return self.score def is_successful(self): return self.success @property def __name__(self): return "QuestionToReasoningJudge" class ReasoningToSqlJudge(BaseMetric): _system_prompt = """ You are an expert evaluator. Your task is to analyze the reasoning provided for a given SQL query and determine if it makes sense. Provide a score in the range 0.0~1.0 and a detailed explanation for your evaluation. """ _test_case_prompt = """ Actual Output: {{ actual_output }} Reasoning: {{ reasoning }} """ def __init__(self, llm_provider: LLMProvider, **_): self.threshold = 0 self.score = 0 self.llm_provider = llm_provider self.llm = llm_provider.get_generator( system_prompt=self._system_prompt, generation_kwargs=_MODEL_KWARGS, ) self.prompt_builder = PromptBuilder(template=self._test_case_prompt) def measure(self, test_case: LLMTestCase): return asyncio.run(self.a_measure(test_case)) async def a_measure(self, test_case: LLMTestCase, *args, **kwargs): prompt = self.prompt_builder.run( actual_output=test_case.actual_output, reasoning=test_case.reasoning, ) response = await self.llm(prompt.get("prompt")) result = format(response) self.score = result.score self.reason = result.reason self.success = self.score >= self.threshold return self.score def is_successful(self): return self.success @property def __name__(self): return "ReasoningToSqlJudge" class SqlSemanticsJudge(BaseMetric): _system_prompt = """ You are an expert evaluator. Your task is to analyze the actual SQL query and the expected SQL query and determine if they are semantically equivalent. Provide a score in the range 0.0~1.0 and a detailed explanation for your evaluation. """ _test_case_prompt = """ Actual SQL: {{ actual_sql }} Expected SQL: {{ expected_sql }} """ def __init__(self, llm_provider: LLMProvider, **_): self.threshold = 0 self.score = 0 self.llm_provider = llm_provider self.llm = llm_provider.get_generator( system_prompt=self._system_prompt, generation_kwargs=_MODEL_KWARGS, ) self.prompt_builder = PromptBuilder(template=self._test_case_prompt) def measure(self, test_case: LLMTestCase): return asyncio.run(self.a_measure(test_case)) async def a_measure(self, test_case: LLMTestCase, *args, **kwargs): prompt = self.prompt_builder.run( actual_sql=test_case.actual_output, expected_sql=test_case.expected_output, ) response = await self.llm(prompt.get("prompt")) result = format(response) self.score = result.score self.reason = result.reason self.success = self.score >= self.threshold return self.score def is_successful(self): return self.success @property def __name__(self): return "SqlSemanticsJudge" ================================================ FILE: wren-ai-service/eval/metrics/spider/__init__.py ================================================ import asyncio import itertools import os import random import re import sqlite3 from collections import defaultdict from itertools import chain, product from typing import Any, Iterator, List, Set, Tuple import sqlparse import tqdm from eval.metrics.spider.process_sql import get_sql # Flag to disable value evaluation DISABLE_VALUE = True # Flag to disable distinct in select evaluation DISABLE_DISTINCT = True TABLE_TYPE = { "sql": "sql", "table_unit": "table_unit", } WHERE_OPS = ( "not", "between", "=", ">", "<", ">=", "<=", "!=", "in", "like", "is", "exists", ) def get_scores(count, pred_total, label_total): if pred_total != label_total: return 0, 0, 0 elif count == pred_total: return 1, 1, 1 return 0, 0, 0 def eval_sel(pred, label): pred_sel = pred["select"][1] label_sel = label["select"][1] label_wo_agg = [unit[1] for unit in label_sel] pred_total = len(pred_sel) label_total = len(label_sel) cnt = 0 cnt_wo_agg = 0 for unit in pred_sel: if unit in label_sel: cnt += 1 label_sel.remove(unit) if unit[1] in label_wo_agg: cnt_wo_agg += 1 label_wo_agg.remove(unit[1]) return label_total, pred_total, cnt, cnt_wo_agg def eval_where(pred, label): pred_conds = [unit for unit in pred["where"][::2]] label_conds = [unit for unit in label["where"][::2]] label_wo_agg = [unit[2] for unit in label_conds] pred_total = len(pred_conds) label_total = len(label_conds) cnt = 0 cnt_wo_agg = 0 for unit in pred_conds: if unit in label_conds: cnt += 1 label_conds.remove(unit) if unit[2] in label_wo_agg: cnt_wo_agg += 1 label_wo_agg.remove(unit[2]) return label_total, pred_total, cnt, cnt_wo_agg def eval_group(pred, label): pred_cols = [unit[1] for unit in pred["groupBy"]] label_cols = [unit[1] for unit in label["groupBy"]] pred_total = len(pred_cols) label_total = len(label_cols) cnt = 0 pred_cols = [pred.split(".")[1] if "." in pred else pred for pred in pred_cols] label_cols = [ label.split(".")[1] if "." in label else label for label in label_cols ] for col in pred_cols: if col in label_cols: cnt += 1 label_cols.remove(col) return label_total, pred_total, cnt def eval_having(pred, label): pred_total = label_total = cnt = 0 if len(pred["groupBy"]) > 0: pred_total = 1 if len(label["groupBy"]) > 0: label_total = 1 pred_cols = [unit[1] for unit in pred["groupBy"]] label_cols = [unit[1] for unit in label["groupBy"]] if ( pred_total == label_total == 1 and pred_cols == label_cols and pred["having"] == label["having"] ): cnt = 1 return label_total, pred_total, cnt def eval_order(pred, label): pred_total = label_total = cnt = 0 if len(pred["orderBy"]) > 0: pred_total = 1 if len(label["orderBy"]) > 0: label_total = 1 if ( len(label["orderBy"]) > 0 and pred["orderBy"] == label["orderBy"] and ( (pred["limit"] is None and label["limit"] is None) or (pred["limit"] is not None and label["limit"] is not None) ) ): cnt = 1 return label_total, pred_total, cnt def eval_and_or(pred, label): pred_ao = pred["where"][1::2] label_ao = label["where"][1::2] pred_ao = set(pred_ao) label_ao = set(label_ao) if pred_ao == label_ao: return 1, 1, 1 return len(pred_ao), len(label_ao), 0 def get_nestedSQL(sql): nested = [] for cond_unit in sql["from"]["conds"][::2] + sql["where"][::2] + sql["having"][::2]: if isinstance(cond_unit[3], dict): nested.append(cond_unit[3]) if isinstance(cond_unit[4], dict): nested.append(cond_unit[4]) if sql["intersect"] is not None: nested.append(sql["intersect"]) if sql["except"] is not None: nested.append(sql["except"]) if sql["union"] is not None: nested.append(sql["union"]) return nested def eval_nested(pred, label): label_total = 0 pred_total = 0 cnt = 0 if pred is not None: pred_total += 1 if label is not None: label_total += 1 if pred is not None and label is not None: cnt += Evaluator().eval_exact_match(pred, label) return label_total, pred_total, cnt def eval_IUEN(pred, label): lt1, pt1, cnt1 = eval_nested(pred["intersect"], label["intersect"]) lt2, pt2, cnt2 = eval_nested(pred["except"], label["except"]) lt3, pt3, cnt3 = eval_nested(pred["union"], label["union"]) label_total = lt1 + lt2 + lt3 pred_total = pt1 + pt2 + pt3 cnt = cnt1 + cnt2 + cnt3 return label_total, pred_total, cnt def get_keywords(sql): res = set() if len(sql["where"]) > 0: res.add("where") if len(sql["groupBy"]) > 0: res.add("group") if len(sql["having"]) > 0: res.add("having") if len(sql["orderBy"]) > 0: res.add(sql["orderBy"][0]) res.add("order") if sql["limit"] is not None: res.add("limit") if sql["except"] is not None: res.add("except") if sql["union"] is not None: res.add("union") if sql["intersect"] is not None: res.add("intersect") # or keyword ao = sql["from"]["conds"][1::2] + sql["where"][1::2] + sql["having"][1::2] if len([token for token in ao if token == "or"]) > 0: res.add("or") cond_units = sql["from"]["conds"][::2] + sql["where"][::2] + sql["having"][::2] # not keyword if len([cond_unit for cond_unit in cond_units if cond_unit[0]]) > 0: res.add("not") # in keyword if ( len( [ cond_unit for cond_unit in cond_units if cond_unit[1] == WHERE_OPS.index("in") ] ) > 0 ): res.add("in") # like keyword if ( len( [ cond_unit for cond_unit in cond_units if cond_unit[1] == WHERE_OPS.index("like") ] ) > 0 ): res.add("like") return res def eval_keywords(pred, label): pred_keywords = get_keywords(pred) label_keywords = get_keywords(label) pred_total = len(pred_keywords) label_total = len(label_keywords) cnt = 0 for k in pred_keywords: if k in label_keywords: cnt += 1 return label_total, pred_total, cnt class Evaluator: def eval_exact_match(self, pred: dict, label: dict): partial_scores = self.eval_partial_match(pred, label) for key, score in partial_scores.items(): if score["f1"] != 1: return 0 if len(label["from"]["table_units"]) > 0: label_tables = sorted(label["from"]["table_units"]) pred_tables = sorted(pred["from"]["table_units"]) return label_tables == pred_tables return 1 def eval_partial_match(self, pred, label): res = {} label_total, pred_total, cnt, cnt_wo_agg = eval_sel(pred, label) acc, rec, f1 = get_scores(cnt, pred_total, label_total) res["select"] = { "acc": acc, "rec": rec, "f1": f1, "label_total": label_total, "pred_total": pred_total, } acc, rec, f1 = get_scores(cnt_wo_agg, pred_total, label_total) res["select(no AGG)"] = { "acc": acc, "rec": rec, "f1": f1, "label_total": label_total, "pred_total": pred_total, } label_total, pred_total, cnt, cnt_wo_agg = eval_where(pred, label) acc, rec, f1 = get_scores(cnt, pred_total, label_total) res["where"] = { "acc": acc, "rec": rec, "f1": f1, "label_total": label_total, "pred_total": pred_total, } acc, rec, f1 = get_scores(cnt_wo_agg, pred_total, label_total) res["where(no OP)"] = { "acc": acc, "rec": rec, "f1": f1, "label_total": label_total, "pred_total": pred_total, } label_total, pred_total, cnt = eval_group(pred, label) acc, rec, f1 = get_scores(cnt, pred_total, label_total) res["group(no Having)"] = { "acc": acc, "rec": rec, "f1": f1, "label_total": label_total, "pred_total": pred_total, } label_total, pred_total, cnt = eval_having(pred, label) acc, rec, f1 = get_scores(cnt, pred_total, label_total) res["group"] = { "acc": acc, "rec": rec, "f1": f1, "label_total": label_total, "pred_total": pred_total, } label_total, pred_total, cnt = eval_order(pred, label) acc, rec, f1 = get_scores(cnt, pred_total, label_total) res["order"] = { "acc": acc, "rec": rec, "f1": f1, "label_total": label_total, "pred_total": pred_total, } label_total, pred_total, cnt = eval_and_or(pred, label) acc, rec, f1 = get_scores(cnt, pred_total, label_total) res["and/or"] = { "acc": acc, "rec": rec, "f1": f1, "label_total": label_total, "pred_total": pred_total, } label_total, pred_total, cnt = eval_IUEN(pred, label) acc, rec, f1 = get_scores(cnt, pred_total, label_total) res["IUEN"] = { "acc": acc, "rec": rec, "f1": f1, "label_total": label_total, "pred_total": pred_total, } label_total, pred_total, cnt = eval_keywords(pred, label) acc, rec, f1 = get_scores(cnt, pred_total, label_total) res["keywords"] = { "acc": acc, "rec": rec, "f1": f1, "label_total": label_total, "pred_total": pred_total, } return res def rebuild_col_unit_col(valid_col_units, col_unit, kmap): if col_unit is None: return col_unit agg_id, col_id, distinct = col_unit if col_id in kmap and col_id in valid_col_units: col_id = kmap[col_id] if DISABLE_DISTINCT: distinct = None return agg_id, col_id, distinct def rebuild_val_unit_col(valid_col_units, val_unit, kmap): if val_unit is None: return val_unit unit_op, col_unit1, col_unit2 = val_unit col_unit1 = rebuild_col_unit_col(valid_col_units, col_unit1, kmap) col_unit2 = rebuild_col_unit_col(valid_col_units, col_unit2, kmap) return unit_op, col_unit1, col_unit2 def rebuild_table_unit_col(valid_col_units, table_unit, kmap): if table_unit is None: return table_unit table_type, col_unit_or_sql = table_unit if isinstance(col_unit_or_sql, tuple): col_unit_or_sql = rebuild_col_unit_col(valid_col_units, col_unit_or_sql, kmap) return table_type, col_unit_or_sql def rebuild_cond_unit_col(valid_col_units, cond_unit, kmap): if cond_unit is None: return cond_unit not_op, op_id, val_unit, val1, val2 = cond_unit val_unit = rebuild_val_unit_col(valid_col_units, val_unit, kmap) return not_op, op_id, val_unit, val1, val2 def rebuild_condition_col(valid_col_units, condition, kmap): for idx in range(len(condition)): if idx % 2 == 0: condition[idx] = rebuild_cond_unit_col( valid_col_units, condition[idx], kmap ) return condition def rebuild_select_col(valid_col_units, sel, kmap): if sel is None: return sel distinct, _list = sel new_list = [] for it in _list: agg_id, val_unit = it new_list.append((agg_id, rebuild_val_unit_col(valid_col_units, val_unit, kmap))) if DISABLE_DISTINCT: distinct = None return distinct, new_list def rebuild_from_col(valid_col_units, from_, kmap): if from_ is None: return from_ from_["table_units"] = [ rebuild_table_unit_col(valid_col_units, table_unit, kmap) for table_unit in from_["table_units"] ] from_["conds"] = rebuild_condition_col(valid_col_units, from_["conds"], kmap) return from_ def rebuild_group_by_col(valid_col_units, group_by, kmap): if group_by is None: return group_by return [ rebuild_col_unit_col(valid_col_units, col_unit, kmap) for col_unit in group_by ] def rebuild_order_by_col(valid_col_units, order_by, kmap): if order_by is None or len(order_by) == 0: return order_by direction, val_units = order_by new_val_units = [ rebuild_val_unit_col(valid_col_units, val_unit, kmap) for val_unit in val_units ] return direction, new_val_units def rebuild_sql_col(valid_col_units, sql, kmap): if sql is None: return sql sql["select"] = rebuild_select_col(valid_col_units, sql["select"], kmap) sql["from"] = rebuild_from_col(valid_col_units, sql["from"], kmap) sql["where"] = rebuild_condition_col(valid_col_units, sql["where"], kmap) sql["groupBy"] = rebuild_group_by_col(valid_col_units, sql["groupBy"], kmap) sql["orderBy"] = rebuild_order_by_col(valid_col_units, sql["orderBy"], kmap) sql["having"] = rebuild_condition_col(valid_col_units, sql["having"], kmap) sql["intersect"] = rebuild_sql_col(valid_col_units, sql["intersect"], kmap) sql["except"] = rebuild_sql_col(valid_col_units, sql["except"], kmap) sql["union"] = rebuild_sql_col(valid_col_units, sql["union"], kmap) return sql # Rebuild SQL functions for value evaluation def rebuild_cond_unit_val(cond_unit): if cond_unit is None or not DISABLE_VALUE: return cond_unit not_op, op_id, val_unit, val1, val2 = cond_unit if not isinstance(val1, dict): val1 = None else: val1 = rebuild_sql_val(val1) if not isinstance(val2, dict): val2 = None else: val2 = rebuild_sql_val(val2) return not_op, op_id, val_unit, val1, val2 def rebuild_condition_val(condition): if condition is None or not DISABLE_VALUE: return condition res = [] for idx, it in enumerate(condition): if idx % 2 == 0: res.append(rebuild_cond_unit_val(it)) else: res.append(it) return res def rebuild_sql_val(sql): if sql is None or not DISABLE_VALUE: return sql sql["from"]["conds"] = rebuild_condition_val(sql["from"]["conds"]) sql["having"] = rebuild_condition_val(sql["having"]) sql["where"] = rebuild_condition_val(sql["where"]) sql["intersect"] = rebuild_sql_val(sql["intersect"]) sql["except"] = rebuild_sql_val(sql["except"]) sql["union"] = rebuild_sql_val(sql["union"]) return sql # Rebuild SQL functions for foreign key evaluation def build_valid_col_units(table_units, schema): col_ids = [ table_unit[1] for table_unit in table_units if table_unit[0] == TABLE_TYPE["table_unit"] ] prefixs = [col_id[:-2] for col_id in col_ids] valid_col_units = [] for value in schema.idMap.values(): if "." in value and value[: value.index(".")] in prefixs: valid_col_units.append(value) return valid_col_units def rewrite_sql(sql: str) -> str: sql = re.sub(r'"([^"]*)"', r"\1", sql) sql = re.sub(r"\s+AS\s+\w+", "", sql, flags=re.IGNORECASE) sql = re.sub(r"\s+", " ", sql).strip() return sql def tokenize(sql: str, schema: dict, kmap: dict) -> dict: rewritten_sql = rewrite_sql(sql) try: struct = get_sql(schema, rewritten_sql) except Exception: struct = { "except": None, "from": {"conds": [], "table_units": []}, "groupBy": [], "having": [], "intersect": None, "limit": None, "orderBy": [], "select": [False, []], "union": None, "where": [], } g_valid_col_units = build_valid_col_units(struct["from"]["table_units"], schema) struct = rebuild_sql_val(struct) struct = rebuild_sql_col(g_valid_col_units, struct, kmap) return struct def build_foreign_key_map(entry): cols_orig = entry["column_names_original"] tables_orig = entry["table_names_original"] # rebuild cols corresponding to idmap in Schema cols = [] for col_orig in cols_orig: if col_orig[0] >= 0: t = tables_orig[col_orig[0]] c = col_orig[1] cols.append("__" + t.lower() + "." + c.lower() + "__") else: cols.append("__all__") def keyset_in_list(k1, k2, k_list): for k_set in k_list: if k1 in k_set or k2 in k_set: return k_set new_k_set = set() k_list.append(new_k_set) return new_k_set foreign_key_list = [] foreign_keys = entry["foreign_keys"] for fkey in foreign_keys: key1, key2 = fkey key_set = keyset_in_list(key1, key2, foreign_key_list) key_set.add(key1) key_set.add(key2) foreign_key_map = {} for key_set in foreign_key_list: sorted_list = sorted(list(key_set)) midx = sorted_list[0] for idx in sorted_list: foreign_key_map[cols[idx]] = cols[midx] return foreign_key_map def build_foreign_key_map_from_json(table): try: import json with open(table) as f: data = json.load(f) tables = {} for entry in data: tables[entry["db_id"]] = build_foreign_key_map(entry) return tables except Exception as e: print(f"Error building foreign key map from JSON: {e}") return {} VALUE_NUM_SYMBOL = "VALUERARE" # plug in the values into query with value slots def plugin(query_value_replaced: List[str], values_in_order: List[str]) -> str: q_length = len(query_value_replaced) query_w_values = query_value_replaced[:] value_idx = [ idx for idx in range(q_length) if query_value_replaced[idx] == VALUE_NUM_SYMBOL.lower() ] assert len(value_idx) == len(values_in_order) for idx, value in zip(value_idx, values_in_order): query_w_values[idx] = value return " ".join(query_w_values) # a generator generating all possible ways of # filling values into predicted query def plugin_all_permutations( query_value_replaced: List[str], values: Set[str] ) -> Iterator[str]: num_slots = len([v for v in query_value_replaced if v == VALUE_NUM_SYMBOL.lower()]) for values in itertools.product(*[list(values) for _ in range(num_slots)]): yield plugin(query_value_replaced, list(values)) # strip_query, reformat_query and replace values # were implemented by Yu Tao for processing CoSQL def strip_query(query: str) -> Tuple[List[str], List[str]]: query_keywords, all_values = [], [] # then replace all stuff enclosed by "" with a numerical value to get it marked as {VALUE} # Tao's implementation is commented out here. """ str_1 = re.findall("\"[^\"]*\"", query) str_2 = re.findall("\'[^\']*\'", query) values = str_1 + str_2 """ toks = sqlparse.parse(query)[0].flatten() values = [ t.value for t in toks if t.ttype == sqlparse.tokens.Literal.String.Single or t.ttype == sqlparse.tokens.Literal.String.Symbol ] for val in values: all_values.append(val) query = query.replace(val.strip(), VALUE_NUM_SYMBOL) query_tokenized = query.split() float_nums = re.findall("[-+]?\d*\.\d+", query) all_values += [qt for qt in query_tokenized if qt in float_nums] query_tokenized = [ VALUE_NUM_SYMBOL if qt in float_nums else qt for qt in query_tokenized ] query = " ".join(query_tokenized) int_nums = [i.strip() for i in re.findall("[^tT]\d+", query)] all_values += [qt for qt in query_tokenized if qt in int_nums] query_tokenized = [ VALUE_NUM_SYMBOL if qt in int_nums else qt for qt in query_tokenized ] # print int_nums, query, query_tokenized for tok in query_tokenized: if "." in tok: table = re.findall("[Tt]\d+\.", tok) if len(table) > 0: to = tok.replace(".", " . ").split() to = [t.lower() for t in to if len(t) > 0] query_keywords.extend(to) else: query_keywords.append(tok.lower()) elif len(tok) > 0: query_keywords.append(tok.lower()) return query_keywords, all_values def reformat_query(query: str) -> str: query = query.strip().replace(";", "").replace("\t", "") query = " ".join( [t.value for t in tokenize(query) if t.ttype != sqlparse.tokens.Whitespace] ) t_stars = ["t1.*", "t2.*", "t3.*", "T1.*", "T2.*", "T3.*"] for ts in t_stars: query = query.replace(ts, "*") return query def replace_values(sql: str) -> Tuple[List[str], Set[str]]: sql = sqlparse.format(sql, reindent=False, keyword_case="upper") # sql = re.sub(r"(<=|>=|!=|=|<|>|,)", r" \1 ", sql) sql = re.sub(r"(T\d+\.)\s", r"\1", sql) query_toks_no_value, values = strip_query(sql) return query_toks_no_value, set(values) # extract the non-value tokens and the set of values # from a sql query def extract_query_values(sql: str) -> Tuple[List[str], Set[str]]: reformated = reformat_query(query=sql) query_value_replaced, values = replace_values(reformated) return query_value_replaced, values # given the gold query and the model prediction # extract values from the gold, extract predicted sql with value slots # return 1) number of possible ways to plug in gold values and 2) an iterator of predictions with value plugged in def get_all_preds_for_execution(gold: str, pred: str) -> Tuple[int, Iterator[str]]: _, gold_values = extract_query_values(gold) pred_query_value_replaced, _ = extract_query_values(pred) num_slots = len( [v for v in pred_query_value_replaced if v == VALUE_NUM_SYMBOL.lower()] ) num_alternatives = len(gold_values) ** num_slots return num_alternatives, plugin_all_permutations( pred_query_value_replaced, gold_values ) def remove_distinct(s): toks = [t.value for t in list(sqlparse.parse(s)[0].flatten())] return "".join([t for t in toks if t.lower() != "distinct"]) # postprocess the model predictions to avoid execution errors # e.g. removing spaces between ">" and "=" def postprocess(query: str) -> str: query = query.replace("> =", ">=").replace("< =", "<=").replace("! =", "!=") return query def replace_cur_year(query: str) -> str: return re.sub( "YEAR\s*\(\s*CURDATE\s*\(\s*\)\s*\)\s*", "2020", query, flags=re.IGNORECASE ) # get the database cursor for a sqlite database path def get_cursor_from_path(sqlite_path: str): try: if not os.path.exists(sqlite_path): print("Openning a new connection %s" % sqlite_path) connection = sqlite3.connect(sqlite_path) except Exception as e: print(sqlite_path) raise e connection.text_factory = lambda b: b.decode(errors="ignore") cursor = connection.cursor() return cursor async def exec_on_db_(sqlite_path: str, query: str) -> Tuple[str, Any]: query = replace_cur_year(query) cursor = get_cursor_from_path(sqlite_path) try: cursor.execute(query) result = cursor.fetchall() cursor.close() cursor.connection.close() return "result", result except Exception as e: cursor.close() cursor.connection.close() return "exception", e TIMEOUT = 60 async def exec_on_db( sqlite_path: str, query: str, process_id: str = "", timeout: int = TIMEOUT ) -> Tuple[str, Any]: try: return await asyncio.wait_for(exec_on_db_(sqlite_path, query), timeout) except asyncio.TimeoutError: return ("exception", TimeoutError) except Exception as e: return ("exception", e) def permute_tuple(element: Tuple, perm: Tuple) -> Tuple: assert len(element) == len(perm) return tuple([element[i] for i in perm]) def unorder_row(row: Tuple) -> Tuple: return tuple(sorted(row, key=lambda x: str(x) + str(type(x)))) # unorder each row in the table # [result_1 and result_2 has the same bag of unordered row] # is a necessary condition of # [result_1 and result_2 are equivalent in denotation] def quick_rej(result1: List[Tuple], result2: List[Tuple], order_matters: bool) -> bool: s1 = [unorder_row(row) for row in result1] s2 = [unorder_row(row) for row in result2] if order_matters: return s1 == s2 else: return set(s1) == set(s2) def get_constraint_permutation(tab1_sets_by_columns: List[Set], result2: List[Tuple]): num_cols = len(result2[0]) perm_constraints = [{i for i in range(num_cols)} for _ in range(num_cols)] if num_cols <= 3: return product(*perm_constraints) # we sample 20 rows and constrain the space of permutations for _ in range(20): random_tab2_row = random.choice(result2) for tab1_col in range(num_cols): for tab2_col in set(perm_constraints[tab1_col]): if random_tab2_row[tab2_col] not in tab1_sets_by_columns[tab1_col]: perm_constraints[tab1_col].remove(tab2_col) return product(*perm_constraints) # return whether two bag of relations are equivalent def multiset_eq(l1: List, l2: List) -> bool: if len(l1) != len(l2): return False d = defaultdict(int) for e in l1: d[e] = d[e] + 1 for e in l2: d[e] = d[e] - 1 if d[e] < 0: return False return True # check whether two denotations are correct def result_eq(result1: List[Tuple], result2: List[Tuple], order_matters: bool) -> bool: if len(result1) == 0 and len(result2) == 0: return True # if length is not the same, then they are definitely different bag of rows if len(result1) != len(result2): return False num_cols = len(result1[0]) # if the results do not have the same number of columns, they are different if len(result2[0]) != num_cols: return False # unorder each row and compare whether the denotation is the same # this can already find most pair of denotations that are different if not quick_rej(result1, result2, order_matters): return False # the rest of the problem is in fact more complicated than one might think # we want to find a permutation of column order and a permutation of row order, # s.t. result_1 is the same as result_2 # we return true if we can find such column & row permutations # and false if we cannot tab1_sets_by_columns = [{row[i] for row in result1} for i in range(num_cols)] # on a high level, we enumerate all possible column permutations that might make result_1 == result_2 # we decrease the size of the column permutation space by the function get_constraint_permutation # if one of the permutation make result_1, result_2 equivalent, then they are equivalent for perm in get_constraint_permutation(tab1_sets_by_columns, result2): if len(perm) != len(set(perm)): continue if num_cols == 1: result2_perm = result2 else: result2_perm = [permute_tuple(element, perm) for element in result2] if order_matters: if result1 == result2_perm: return True else: # in fact the first condition must hold if the second condition holds # but the first is way more efficient implementation-wise # and we use it to quickly reject impossible candidates if set(result1) == set(result2_perm) and multiset_eq(result1, result2_perm): return True return False # approximate whether p_str and g_str are semantically equivalent # db is the database path # we are going to evaluate whether they are equivalent in all the databases # that are in the same directory as db # 0 if denotationally equivalent # 1 otherwise # the meaning of each auxillary argument can be seen in the parser definition in evaluation.py async def eval_exec_match( db: str, p_str: str, g_str: str, plug_value: bool = False, keep_distinct: bool = False, progress_bar_for_each_datapoint: bool = False, ) -> int: # post-process the prediction. # e.g. removing spaces between ">" and "=" p_str, g_str = postprocess(p_str), postprocess(g_str) if not keep_distinct: p_str = remove_distinct(p_str) g_str = remove_distinct(g_str) # we decide whether two denotations are equivalent based on "bag semantics" # https://courses.cs.washington.edu/courses/cse444/10sp/lectures/lecture16.pdf # if there is order by in query, then we assume order of the rows matter # order by might also be used to find the max/min instead of sorting, # but in that case the result mostly only contains one row and hence order_matters does not make a difference order_matters = "order by" in g_str.lower() # find all databases in the same directory db_dir = os.path.dirname(db) db_paths = [ os.path.join(db_dir, basename) for basename in os.listdir(db_dir) if ".sqlite" in basename ] preds = [p_str] # if plug in value (i.e. we do not consider value prediction correctness) # enumerate all ways to plug in values in the gold query to the model predictions # otherwise, we only evaluate the predicted query with its own value prediction if plug_value: _, preds = get_all_preds_for_execution(g_str, p_str) # we did not add this line in our EMNLP work # this reduces "false negatives" when value is substituted preds = chain([p_str], preds) for pred in preds: pred_passes = 1 # compare the gold and predicted denotations on each database in the directory # wrap with progress bar if required if progress_bar_for_each_datapoint: ranger = tqdm.tqdm(db_paths) else: ranger = db_paths for db_path in ranger: g_flag, g_denotation = await exec_on_db(db_path, g_str) p_flag, p_denotation = await exec_on_db(db_path, pred) # we should expect the gold to be succesfully executed on the database assert g_flag != "exception", ( "gold query %s has error on database file %s" % (g_str, db_path) ) # wrong if execution fails if p_flag == "exception": pred_passes = 0 # if denotations are not equivalent, the prediction must be wrong elif not result_eq(g_denotation, p_denotation, order_matters=order_matters): pred_passes = 0 if pred_passes == 0: break # the model prediction has the same denotation as the gold for all databases if pred_passes == 1: return 1 # none of the predictions passed return 0 ================================================ FILE: wren-ai-service/eval/metrics/spider/exact_match.py ================================================ import asyncio import os from deepeval.metrics import BaseMetric from deepeval.test_case import LLMTestCase from eval.metrics.spider import Evaluator, build_foreign_key_map_from_json, tokenize from eval.metrics.spider.process_sql import Schema, get_schema class ExactMatchAccuracy(BaseMetric): def __init__( self, kmap_path: str = "./tools/dev/etc/spider1.0/spider_data/tables.json", db_dir: str = "./tools/dev/etc/spider1.0/database", ): self.threshold = 0 self.score = 0 self.kmaps = build_foreign_key_map_from_json(kmap_path) self.db_dir = db_dir def measure(self, test_case: LLMTestCase): return asyncio.run(self.a_measure(test_case)) async def a_measure(self, test_case: LLMTestCase, *args, **kwargs): if not test_case.additional_metadata["enable_spider_metrics"]: self.success = True return 0 db_name = test_case.additional_metadata["catalog"] db = os.path.join(self.db_dir, db_name, db_name + ".sqlite") schema = Schema(get_schema(db)) gold_sql = tokenize(test_case.expected_output, schema, self.kmaps[db_name]) pred_sql = tokenize(test_case.actual_output, schema, self.kmaps[db_name]) evaluator = Evaluator() self.score = evaluator.eval_exact_match(pred_sql, gold_sql) self.success = self.score >= self.threshold return self.score def is_successful(self): return self.success @property def __name__(self): return "ExactMatchAccuracy" if __name__ == "__main__": metric = ExactMatchAccuracy() test_case = LLMTestCase( input="", expected_output="SELECT COUNT(DISTINCT Nationality) FROM people", actual_output='SELECT COUNT(DISTINCT "Nationality") AS "nationality_count" FROM "people"', additional_metadata={"catalog": "poker_player"}, ) print(metric.measure(test_case)) ================================================ FILE: wren-ai-service/eval/metrics/spider/exec_match.py ================================================ import asyncio import os from deepeval.metrics import BaseMetric from deepeval.test_case import LLMTestCase from eval.metrics.spider import eval_exec_match class ExecutionAccuracy(BaseMetric): def __init__( self, db_dir: str = "./tools/dev/etc/spider1.0/database", ): self.threshold = 0 self.score = 0 self.db_dir = db_dir def measure(self, test_case: LLMTestCase): return asyncio.run(self.a_measure(test_case)) async def a_measure(self, test_case: LLMTestCase, *args, **kwargs): if not test_case.additional_metadata["enable_spider_metrics"]: self.success = True return 0 db_name = test_case.additional_metadata["catalog"] db = os.path.join(self.db_dir, db_name, db_name + ".sqlite") self.score = await eval_exec_match( db=db, p_str=test_case.actual_output, g_str=test_case.expected_output, ) self.success = self.score >= self.threshold return self.score def is_successful(self): return self.success @property def __name__(self): return "ExecutionAccuracy" if __name__ == "__main__": metric = ExecutionAccuracy() test_case = LLMTestCase( input="", expected_output="SELECT COUNT(DISTINCT Nationality) FROM people", actual_output='SELECT COUNT(DISTINCT "Nationality") AS "nationality_count" FROM "people"', additional_metadata={"catalog": "poker_player"}, ) print(metric.measure(test_case)) ================================================ FILE: wren-ai-service/eval/metrics/spider/process_sql.py ================================================ ################################ # Assumptions: # 1. sql is correct # 2. only table name has alias # 3. only one intersect/union/except # # val: number(float)/string(str)/sql(dict) # col_unit: (agg_id, col_id, isDistinct(bool)) # val_unit: (unit_op, col_unit1, col_unit2) # table_unit: (table_type, col_unit/sql) # cond_unit: (not_op, op_id, val_unit, val1, val2) # condition: [cond_unit1, 'and'/'or', cond_unit2, ...] # sql { # 'select': (isDistinct(bool), [(agg_id, val_unit), (agg_id, val_unit), ...]) # 'from': {'table_units': [table_unit1, table_unit2, ...], 'conds': condition} # 'where': condition # 'groupBy': [col_unit1, col_unit2, ...] # 'orderBy': ('asc'/'desc', [val_unit1, val_unit2, ...]) # 'having': condition # 'limit': None/limit value # 'intersect': None/sql # 'except': None/sql # 'union': None/sql # } ################################ import json import sqlite3 import nltk nltk.download("punkt_tab") CLAUSE_KEYWORDS = ( "select", "from", "where", "group", "order", "limit", "intersect", "union", "except", ) JOIN_KEYWORDS = ("join", "on", "as") WHERE_OPS = ( "not", "between", "=", ">", "<", ">=", "<=", "!=", "in", "like", "is", "exists", ) UNIT_OPS = ("none", "-", "+", "*", "/") AGG_OPS = ("none", "max", "min", "count", "sum", "avg") TABLE_TYPE = { "sql": "sql", "table_unit": "table_unit", } COND_OPS = ("and", "or") SQL_OPS = ("intersect", "union", "except") ORDER_OPS = ("desc", "asc") class Schema: """ Simple schema which maps table&column to a unique identifier """ def __init__(self, schema): self._schema = schema self._idMap = self._map(self._schema) @property def schema(self): return self._schema @property def idMap(self): return self._idMap def _map(self, schema): idMap = {"*": "__all__"} id = 1 for key, vals in schema.items(): for val in vals: idMap[key.lower() + "." + val.lower()] = ( "__" + key.lower() + "." + val.lower() + "__" ) id += 1 for key in schema: idMap[key.lower()] = "__" + key.lower() + "__" id += 1 return idMap def get_schema(db): """ Get database's schema, which is a dict with table name as key and list of column names as value :param db: database path :return: schema dict """ schema = {} conn = sqlite3.connect(db) cursor = conn.cursor() # fetch table names cursor.execute("SELECT name FROM sqlite_master WHERE type='table';") tables = [str(table[0].lower()) for table in cursor.fetchall()] # fetch table info for table in tables: cursor.execute("PRAGMA table_info({})".format(table)) schema[table] = [str(col[1].lower()) for col in cursor.fetchall()] return schema def get_schema_from_json(fpath): with open(fpath) as f: data = json.load(f) schema = {} for entry in data: table = str(entry["table"].lower()) cols = [str(col["column_name"].lower()) for col in entry["col_data"]] schema[table] = cols return schema def tokenize(string): string = str(string) string = string.replace( "'", '"' ) # ensures all string values wrapped by "" problem?? quote_idxs = [idx for idx, char in enumerate(string) if char == '"'] assert len(quote_idxs) % 2 == 0, "Unexpected quote" # keep string value as token vals = {} for i in range(len(quote_idxs) - 1, -1, -2): qidx1 = quote_idxs[i - 1] qidx2 = quote_idxs[i] val = string[qidx1 : qidx2 + 1] key = "__val_{}_{}__".format(qidx1, qidx2) string = string[:qidx1] + key + string[qidx2 + 1 :] vals[key] = val toks = [word.lower() for word in nltk.word_tokenize(string)] # replace with string value token for i in range(len(toks)): if toks[i] in vals: toks[i] = vals[toks[i]] # find if there exists !=, >=, <= eq_idxs = [idx for idx, tok in enumerate(toks) if tok == "="] eq_idxs.reverse() prefix = ("!", ">", "<") for eq_idx in eq_idxs: pre_tok = toks[eq_idx - 1] if pre_tok in prefix: toks = toks[: eq_idx - 1] + [pre_tok + "="] + toks[eq_idx + 1 :] return toks def scan_alias(toks): """Scan the index of 'as' and build the map for all alias""" as_idxs = [idx for idx, tok in enumerate(toks) if tok == "as"] alias = {} for idx in as_idxs: alias[toks[idx + 1]] = toks[idx - 1] return alias def get_tables_with_alias(schema, toks): tables = scan_alias(toks) for key in schema: assert key not in tables, "Alias {} has the same name in table".format(key) tables[key] = key return tables def parse_col(toks, start_idx, tables_with_alias, schema, default_tables=None): """ :returns next idx, column id """ tok = toks[start_idx] if tok == "*": return start_idx + 1, schema.idMap[tok] if "." in tok: # if token is a composite alias, col = tok.split(".") key = tables_with_alias[alias] + "." + col return start_idx + 1, schema.idMap[key] assert ( default_tables is not None and len(default_tables) > 0 ), "Default tables should not be None or empty" for alias in default_tables: table = tables_with_alias[alias] if tok in schema.schema[table]: key = table + "." + tok return start_idx + 1, schema.idMap[key] assert False, "Error col: {}".format(tok) def parse_col_unit(toks, start_idx, tables_with_alias, schema, default_tables=None): """ :returns next idx, (agg_op id, col_id) """ idx = start_idx len_ = len(toks) isBlock = False isDistinct = False if toks[idx] == "(": isBlock = True idx += 1 if toks[idx] in AGG_OPS: agg_id = AGG_OPS.index(toks[idx]) idx += 1 assert idx < len_ and toks[idx] == "(" idx += 1 if toks[idx] == "distinct": idx += 1 isDistinct = True idx, col_id = parse_col(toks, idx, tables_with_alias, schema, default_tables) assert idx < len_ and toks[idx] == ")" idx += 1 return idx, (agg_id, col_id, isDistinct) if toks[idx] == "distinct": idx += 1 isDistinct = True agg_id = AGG_OPS.index("none") idx, col_id = parse_col(toks, idx, tables_with_alias, schema, default_tables) if isBlock: assert toks[idx] == ")" idx += 1 # skip ')' return idx, (agg_id, col_id, isDistinct) def parse_val_unit(toks, start_idx, tables_with_alias, schema, default_tables=None): idx = start_idx len_ = len(toks) isBlock = False if toks[idx] == "(": isBlock = True idx += 1 col_unit1 = None col_unit2 = None unit_op = UNIT_OPS.index("none") idx, col_unit1 = parse_col_unit( toks, idx, tables_with_alias, schema, default_tables ) if idx < len_ and toks[idx] in UNIT_OPS: unit_op = UNIT_OPS.index(toks[idx]) idx += 1 idx, col_unit2 = parse_col_unit( toks, idx, tables_with_alias, schema, default_tables ) if isBlock: assert toks[idx] == ")" idx += 1 # skip ')' return idx, (unit_op, col_unit1, col_unit2) def parse_table_unit(toks, start_idx, tables_with_alias, schema): """ :returns next idx, table id, table name """ idx = start_idx len_ = len(toks) key = tables_with_alias[toks[idx]] if idx + 1 < len_ and toks[idx + 1] == "as": idx += 3 else: idx += 1 return idx, schema.idMap[key], key def parse_value(toks, start_idx, tables_with_alias, schema, default_tables=None): idx = start_idx len_ = len(toks) isBlock = False if toks[idx] == "(": isBlock = True idx += 1 if toks[idx] == "select": idx, val = parse_sql(toks, idx, tables_with_alias, schema) elif '"' in toks[idx]: # token is a string value val = toks[idx] idx += 1 else: try: val = float(toks[idx]) idx += 1 except ValueError: end_idx = idx while ( end_idx < len_ and toks[end_idx] != "," and toks[end_idx] != ")" and toks[end_idx] != "and" and toks[end_idx] not in CLAUSE_KEYWORDS and toks[end_idx] not in JOIN_KEYWORDS ): end_idx += 1 idx, val = parse_col_unit( toks[start_idx:end_idx], 0, tables_with_alias, schema, default_tables ) idx = end_idx if isBlock: assert toks[idx] == ")" idx += 1 return idx, val def parse_condition(toks, start_idx, tables_with_alias, schema, default_tables=None): idx = start_idx len_ = len(toks) conds = [] while idx < len_: idx, val_unit = parse_val_unit( toks, idx, tables_with_alias, schema, default_tables ) not_op = False if toks[idx] == "not": not_op = True idx += 1 assert ( idx < len_ and toks[idx] in WHERE_OPS ), "Error condition: idx: {}, tok: {}".format(idx, toks[idx]) op_id = WHERE_OPS.index(toks[idx]) idx += 1 val1 = val2 = None if op_id == WHERE_OPS.index( "between" ): # between..and... special case: dual values idx, val1 = parse_value( toks, idx, tables_with_alias, schema, default_tables ) assert toks[idx] == "and" idx += 1 idx, val2 = parse_value( toks, idx, tables_with_alias, schema, default_tables ) else: # normal case: single value idx, val1 = parse_value( toks, idx, tables_with_alias, schema, default_tables ) val2 = None conds.append((not_op, op_id, val_unit, val1, val2)) if idx < len_ and ( toks[idx] in CLAUSE_KEYWORDS or toks[idx] in (")", ";") or toks[idx] in JOIN_KEYWORDS ): break if idx < len_ and toks[idx] in COND_OPS: conds.append(toks[idx]) idx += 1 # skip and/or return idx, conds def parse_select(toks, start_idx, tables_with_alias, schema, default_tables=None): idx = start_idx len_ = len(toks) assert toks[idx] == "select", "'select' not found" idx += 1 isDistinct = False if idx < len_ and toks[idx] == "distinct": idx += 1 isDistinct = True val_units = [] while idx < len_ and toks[idx] not in CLAUSE_KEYWORDS: agg_id = AGG_OPS.index("none") if toks[idx] in AGG_OPS: agg_id = AGG_OPS.index(toks[idx]) idx += 1 idx, val_unit = parse_val_unit( toks, idx, tables_with_alias, schema, default_tables ) val_units.append((agg_id, val_unit)) if idx < len_ and toks[idx] == ",": idx += 1 # skip ',' return idx, (isDistinct, val_units) def parse_from(toks, start_idx, tables_with_alias, schema): """ Assume in the from clause, all table units are combined with join """ assert "from" in toks[start_idx:], "'from' not found" len_ = len(toks) idx = toks.index("from", start_idx) + 1 default_tables = [] table_units = [] conds = [] while idx < len_: isBlock = False if toks[idx] == "(": isBlock = True idx += 1 if toks[idx] == "select": idx, sql = parse_sql(toks, idx, tables_with_alias, schema) table_units.append((TABLE_TYPE["sql"], sql)) else: if idx < len_ and toks[idx] == "join": idx += 1 # skip join idx, table_unit, table_name = parse_table_unit( toks, idx, tables_with_alias, schema ) table_units.append((TABLE_TYPE["table_unit"], table_unit)) default_tables.append(table_name) if idx < len_ and toks[idx] == "on": idx += 1 # skip on idx, this_conds = parse_condition( toks, idx, tables_with_alias, schema, default_tables ) if len(conds) > 0: conds.append("and") conds.extend(this_conds) if isBlock: assert toks[idx] == ")" idx += 1 if idx < len_ and (toks[idx] in CLAUSE_KEYWORDS or toks[idx] in (")", ";")): break return idx, table_units, conds, default_tables def parse_where(toks, start_idx, tables_with_alias, schema, default_tables): idx = start_idx len_ = len(toks) if idx >= len_ or toks[idx] != "where": return idx, [] idx += 1 idx, conds = parse_condition(toks, idx, tables_with_alias, schema, default_tables) return idx, conds def parse_group_by(toks, start_idx, tables_with_alias, schema, default_tables): idx = start_idx len_ = len(toks) col_units = [] if idx >= len_ or toks[idx] != "group": return idx, col_units idx += 1 assert toks[idx] == "by" idx += 1 while idx < len_ and not (toks[idx] in CLAUSE_KEYWORDS or toks[idx] in (")", ";")): idx, col_unit = parse_col_unit( toks, idx, tables_with_alias, schema, default_tables ) col_units.append(col_unit) if idx < len_ and toks[idx] == ",": idx += 1 # skip ',' else: break return idx, col_units def parse_order_by(toks, start_idx, tables_with_alias, schema, default_tables): idx = start_idx len_ = len(toks) val_units = [] order_type = "asc" # default type is 'asc' if idx >= len_ or toks[idx] != "order": return idx, val_units idx += 1 assert toks[idx] == "by" idx += 1 while idx < len_ and not (toks[idx] in CLAUSE_KEYWORDS or toks[idx] in (")", ";")): idx, val_unit = parse_val_unit( toks, idx, tables_with_alias, schema, default_tables ) val_units.append(val_unit) if idx < len_ and toks[idx] in ORDER_OPS: order_type = toks[idx] idx += 1 if idx < len_ and toks[idx] == ",": idx += 1 # skip ',' else: break return idx, (order_type, val_units) def parse_having(toks, start_idx, tables_with_alias, schema, default_tables): idx = start_idx len_ = len(toks) if idx >= len_ or toks[idx] != "having": return idx, [] idx += 1 idx, conds = parse_condition(toks, idx, tables_with_alias, schema, default_tables) return idx, conds def parse_limit(toks, start_idx): idx = start_idx len_ = len(toks) if idx < len_ and toks[idx] == "limit": idx += 2 # make limit value can work, cannot assume put 1 as a fake limit number limit_token = toks[idx - 1] if not str(limit_token).isdigit(): # Preserve previous behaviour but make the intent explicit return idx, 1 return idx, int(limit_token) return idx, None def parse_sql(toks, start_idx, tables_with_alias, schema): isBlock = False # indicate whether this is a block of sql/sub-sql len_ = len(toks) idx = start_idx sql = {} if toks[idx] == "(": isBlock = True idx += 1 # parse from clause in order to get default tables from_end_idx, table_units, conds, default_tables = parse_from( toks, start_idx, tables_with_alias, schema ) sql["from"] = {"table_units": table_units, "conds": conds} # select clause _, select_col_units = parse_select( toks, idx, tables_with_alias, schema, default_tables ) idx = from_end_idx sql["select"] = select_col_units # where clause idx, where_conds = parse_where(toks, idx, tables_with_alias, schema, default_tables) sql["where"] = where_conds # group by clause idx, group_col_units = parse_group_by( toks, idx, tables_with_alias, schema, default_tables ) sql["groupBy"] = group_col_units # having clause idx, having_conds = parse_having( toks, idx, tables_with_alias, schema, default_tables ) sql["having"] = having_conds # order by clause idx, order_col_units = parse_order_by( toks, idx, tables_with_alias, schema, default_tables ) sql["orderBy"] = order_col_units # limit clause idx, limit_val = parse_limit(toks, idx) sql["limit"] = limit_val idx = skip_semicolon(toks, idx) if isBlock: assert toks[idx] == ")" idx += 1 # skip ')' idx = skip_semicolon(toks, idx) # intersect/union/except clause for op in SQL_OPS: # initialize IUE sql[op] = None if idx < len_ and toks[idx] in SQL_OPS: sql_op = toks[idx] idx += 1 idx, IUE_sql = parse_sql(toks, idx, tables_with_alias, schema) sql[sql_op] = IUE_sql return idx, sql def load_data(fpath): with open(fpath) as f: data = json.load(f) return data def get_sql(schema, query): toks = tokenize(query) tables_with_alias = get_tables_with_alias(schema.schema, toks) _, sql = parse_sql(toks, 0, tables_with_alias, schema) return sql def skip_semicolon(toks, start_idx): idx = start_idx while idx < len(toks) and toks[idx] == ";": idx += 1 return idx ================================================ FILE: wren-ai-service/eval/optimized/.gitignore ================================================ *.json ================================================ FILE: wren-ai-service/eval/pipelines.py ================================================ import asyncio import re import sys from abc import abstractmethod from datetime import datetime from pathlib import Path from typing import Any, Dict, List, Literal import orjson from haystack import Document from langfuse.decorators import langfuse_context, observe from tqdm.asyncio import tqdm_asyncio from src.core.pipeline import PipelineComponent sys.path.append(f"{Path().parent.resolve()}") from eval import WREN_ENGINE_API_URL, EvalSettings from eval.metrics import ( AccuracyMetric, AnswerRelevancyMetric, ContextualPrecisionMetric, ContextualRecallMetric, ContextualRelevancyMetric, ExactMatchAccuracy, ExecutionAccuracy, FaithfulnessMetric, QuestionToReasoningJudge, ReasoningToSqlJudge, SqlSemanticsJudge, ) from eval.utils import ( engine_config, trace_metadata, ) from src.pipelines import generation, indexing, retrieval def deploy_model(mdl: str, pipes: list) -> None: async def wrapper(): tasks = [pipe.run(orjson.dumps(mdl).decode()) for pipe in pipes] await asyncio.gather(*tasks) asyncio.run(wrapper()) def extract_units(ddls: list[str]) -> list: def parse_ddl(ddl: str) -> list: """ Parses a DDL statement and returns a list of column definitions in the format table_name.column_name, excluding foreign keys. Args: ddl (str): The DDL statement to parse. Returns: list: A list of column definitions in the format table_name.column_name. """ # Regex to extract table name table_name_match = re.search(r"CREATE TABLE (\w+)", ddl, re.IGNORECASE) table_name = table_name_match.group(1) if table_name_match else None # Split the DDL into lines lines = ddl.splitlines() # Define a regex pattern to match foreign key constraints and comments foreign_key_pattern = re.compile(r"^\s*FOREIGN KEY", re.IGNORECASE) comment_pattern = re.compile(r"^\s*--|/\*|\*/") # Filter out lines that define foreign keys or are comments columns = [ line.strip() for line in lines if not foreign_key_pattern.match(line) and not comment_pattern.match(line) and line.strip() ] # Extract column names and format with table name as prefix if table_name: columns = [ f"{table_name}.{line.split()[0]}" for line in columns if line and line.split()[0] != "CREATE" and line.split()[0] != ");" ] return columns columns = [] for ddl in ddls: columns.extend(parse_ddl(ddl)) return columns class Eval: def __init__(self, meta: dict, candidate_size: int = 1, **_): self._meta = meta self._candidate_size = candidate_size self._batch_size = int(meta["batch_size"]) self._batch_interval = int(meta["batch_interval"]) @property def candidate_size(self): return self._candidate_size def predict(self, queries: list) -> List[Dict[str, Any]]: def split(queries: list, batch_size: int) -> list[list]: return [ queries[i : i + batch_size] for i in range(0, len(queries), batch_size) ] async def wrapper(batch: list): tasks = [self(query) for query in batch] results = await tqdm_asyncio.gather(*tasks, desc="Generating Predictions") await asyncio.sleep(self._batch_interval) return [prediction for predictions in results for prediction in predictions] batches = [ asyncio.run(wrapper(batch)) for batch in split(queries, self._batch_size) ] return [prediction for batch in batches for prediction in batch] @abstractmethod def _process(self, prediction: dict, **_) -> dict: ... @observe(name="Prediction Process", capture_input=False) async def process(self, params: dict) -> dict: prediction = { "trace_id": langfuse_context.get_current_trace_id(), "trace_url": langfuse_context.get_current_trace_url(), "input": params["question"], "actual_output": {}, "expected_output": params["sql"], "retrieval_context": [], "context": params["context"], "samples": params.get("samples", []), "instructions": params.get("instructions", []), "type": "execution", "reasoning": "", "elapsed_time": 0, } langfuse_context.update_current_trace( session_id=self._meta.get("session_id"), user_id=self._meta.get("user_id"), metadata=trace_metadata(self._meta, type=prediction["type"]), ) start_time = datetime.now() returned = await self._process(prediction, **params) returned["elapsed_time"] = (datetime.now() - start_time).total_seconds() return returned class RetrievalPipeline(Eval): def __init__( self, meta: dict, mdl: dict, pipe_components: dict, settings: EvalSettings, **kwargs, ): super().__init__(meta) _db_schema_indexing = indexing.DBSchema( **pipe_components["db_schema_indexing"], column_batch_size=settings.column_indexing_batch_size, ) _table_description_indexing = indexing.TableDescription( **pipe_components["table_description_indexing"], ) deploy_model(mdl, [_db_schema_indexing, _table_description_indexing]) self._retrieval = retrieval.DbSchemaRetrieval( **pipe_components["db_schema_retrieval"], table_retrieval_size=settings.table_retrieval_size, table_column_retrieval_size=settings.table_column_retrieval_size, ) async def _process(self, params: dict, **_) -> dict: result = await self._retrieval.run(query=params["input"]) documents = result.get("construct_retrieval_results", {}).get( "retrieval_results", [] ) table_ddls = [document.get("table_ddl") for document in documents] params["retrieval_context"] = extract_units(table_ddls) return params async def __call__(self, params: dict, **_): prediction = await self.process(params) return [prediction] @staticmethod def metrics(engine_info: dict) -> dict: wren_engine_info = engine_info.copy() wren_engine_info["api_endpoint"] = WREN_ENGINE_API_URL return { "metrics": [ ContextualRecallMetric(engine_info=wren_engine_info), ContextualRelevancyMetric(), ContextualPrecisionMetric(), ] } class GenerationPipeline(Eval): def __init__( self, meta: dict, mdl: dict, pipe_components: dict, settings: EvalSettings, **kwargs, ): super().__init__(meta) self._mdl = mdl self._generation = generation.SQLGeneration( **pipe_components["sql_generation"], ) self._sql_functions_retrieval = retrieval.SqlFunctions( **pipe_components["sql_functions_retrieval"], ) self._allow_sql_samples = settings.allow_sql_samples self._allow_instructions = settings.allow_instructions self._allow_sql_functions = settings.allow_sql_functions self._engine_info = engine_config( mdl, pipe_components, settings.eval_data_db_path ) def _get_instructions(self, params: dict) -> list: if self._allow_instructions: return [ {"instruction": instruction} for instruction in params.get("instructions", []) ] return [] def _get_samples(self, params: dict) -> list: if self._allow_sql_samples: return params.get("samples", []) return [] async def _process(self, params: dict, document: list, **_) -> dict: documents = [Document.from_dict(doc).content for doc in document] table_ddls = [document.get("table_ddl") for document in documents] instructions = self._get_instructions(params) samples = self._get_samples(params) if self._allow_sql_functions: sql_functions = await self._sql_functions_retrieval.run() else: sql_functions = [] actual_output = await self._generation.run( query=params["input"], contexts=table_ddls, sql_samples=samples, has_calculated_field=params.get("has_calculated_field", False), has_metric=params.get("has_metric", False), sql_generation_reasoning=params.get("reasoning", ""), instructions=instructions, sql_functions=sql_functions, ) params["actual_output"] = actual_output params["retrieval_context"] = extract_units(table_ddls) return params async def __call__(self, params: dict, **_): return [await self.process(params)] @staticmethod def metrics( engine_info: dict, enable_semantics_comparison: bool, component: PipelineComponent, ) -> dict: wren_engine_info = engine_info.copy() wren_engine_info["api_endpoint"] = WREN_ENGINE_API_URL return { "metrics": [ AccuracyMetric( engine_info=engine_info, enable_semantics_comparison=enable_semantics_comparison, ), AnswerRelevancyMetric(engine_info=wren_engine_info), FaithfulnessMetric(engine_info=wren_engine_info), ExactMatchAccuracy(), ExecutionAccuracy(), QuestionToReasoningJudge(**component), ReasoningToSqlJudge(**component), SqlSemanticsJudge(**component), ], "post_metrics": [], } class AskPipeline(Eval): def __init__( self, meta: dict, mdl: dict, pipe_components: dict, settings: EvalSettings, **kwargs, ): super().__init__(meta) _db_schema_indexing = indexing.DBSchema( **pipe_components["db_schema_indexing"], column_batch_size=settings.column_indexing_batch_size, ) _table_description_indexing = indexing.TableDescription( **pipe_components["table_description_indexing"], ) deploy_model(mdl, [_db_schema_indexing, _table_description_indexing]) self._retrieval = retrieval.DbSchemaRetrieval( **pipe_components["db_schema_retrieval"], table_retrieval_size=settings.table_retrieval_size, table_column_retrieval_size=settings.table_column_retrieval_size, ) self._sql_reasoner = generation.SQLGenerationReasoning( **pipe_components["sql_generation_reasoning"], ) self._sql_functions_retrieval = retrieval.SqlFunctions( **pipe_components["sql_functions_retrieval"], ) self._generation = generation.SQLGeneration( **pipe_components["sql_generation"], ) self._allow_sql_samples = settings.allow_sql_samples self._allow_instructions = settings.allow_instructions self._allow_sql_generation_reasoning = settings.allow_sql_generation_reasoning self._allow_sql_functions = settings.allow_sql_functions self._engine_info = engine_config( mdl, pipe_components, settings.eval_data_db_path ) def _get_instructions(self, params: dict) -> list: if self._allow_instructions: return [ {"instruction": instruction} for instruction in params.get("instructions", []) ] return [] def _get_samples(self, params: dict) -> list: if self._allow_sql_samples: return params.get("samples", []) return [] async def _process(self, params: dict, **_) -> dict: result = await self._retrieval.run(query=params["input"]) _retrieval_result = result.get("construct_retrieval_results", {}) documents = _retrieval_result.get("retrieval_results", []) table_ddls = [document.get("table_ddl") for document in documents] has_calculated_field = _retrieval_result.get("has_calculated_field", False) has_metric = _retrieval_result.get("has_metric", False) instructions = self._get_instructions(params) samples = self._get_samples(params) if self._allow_sql_generation_reasoning: _reasoning = await self._sql_reasoner.run( query=params["input"], contexts=documents, sql_samples=samples, ) reasoning = _reasoning.get("post_process", {}) else: reasoning = "" if self._allow_sql_functions: sql_functions = await self._sql_functions_retrieval.run() else: sql_functions = [] actual_output = await self._generation.run( query=params["input"], contexts=table_ddls, sql_samples=samples, has_calculated_field=has_calculated_field, has_metric=has_metric, sql_generation_reasoning=reasoning, instructions=instructions, sql_functions=sql_functions, ) params["actual_output"] = actual_output params["retrieval_context"] = extract_units(table_ddls) params["has_calculated_field"] = has_calculated_field params["has_metric"] = has_metric params["reasoning"] = reasoning return params async def __call__(self, params: dict, **_): return [await self.process(params)] @staticmethod def metrics( engine_info: dict, enable_semantics_comparison: bool, component: PipelineComponent, ) -> dict: wren_engine_info = engine_info.copy() wren_engine_info["api_endpoint"] = WREN_ENGINE_API_URL return { "metrics": [ AccuracyMetric( engine_info=engine_info, enable_semantics_comparison=enable_semantics_comparison, ), AnswerRelevancyMetric(engine_info=wren_engine_info), FaithfulnessMetric(engine_info=wren_engine_info), ContextualRecallMetric(engine_info=wren_engine_info), ContextualRelevancyMetric(), ContextualPrecisionMetric(), ExactMatchAccuracy(), ExecutionAccuracy(), QuestionToReasoningJudge(**component), ReasoningToSqlJudge(**component), SqlSemanticsJudge(**component), ], "post_metrics": [], } def init( name: Literal["retrieval", "generation", "ask"], meta: dict, mdl: dict, components: Dict[str, Any], settings: EvalSettings, ) -> Eval: args = { "meta": meta, "mdl": mdl, "pipe_components": components, "settings": settings, } match name: case "retrieval": return RetrievalPipeline(**args) case "generation": return GenerationPipeline(**args) case "ask": return AskPipeline(**args) case _: raise ValueError(f"Invalid pipeline name: {name}") def metrics_initiator( pipeline: str, dataset: dict, pipe_components: dict[str, PipelineComponent], enable_semantics_comparison: bool = True, settings: EvalSettings = EvalSettings(), ) -> dict: engine_info = engine_config( dataset["mdl"], pipe_components, settings.eval_data_db_path, ) component = pipe_components["evaluation"] match pipeline: case "retrieval": return RetrievalPipeline.metrics(engine_info) case "generation": return GenerationPipeline.metrics( engine_info, enable_semantics_comparison, component ) case "ask": return AskPipeline.metrics( engine_info, enable_semantics_comparison, component ) ================================================ FILE: wren-ai-service/eval/prediction.py ================================================ import argparse import base64 import sys import uuid from datetime import datetime from pathlib import Path from typing import Any, Dict, Tuple import orjson from git import Repo from langfuse.decorators import langfuse_context from tomlkit import document, dumps sys.path.append(f"{Path().parent.resolve()}") import eval.pipelines as pipelines import src.providers as provider import src.utils as utils from eval import EvalSettings from eval.utils import ( load_eval_data_db_to_postgres, parse_db_name, parse_toml, replace_wren_engine_env_variables, ) def generate_meta( path: str, dataset: dict, pipe: str, settings: EvalSettings, **kwargs, ) -> Dict[str, Any]: return { "langfuse_url": settings.langfuse_url, "user_id": "wren-evaluator", # this property is using for langfuse "session_id": f"eval_{pipe}_{uuid.uuid4()}", "date": datetime.now(), "dataset_id": dataset["dataset_id"], "evaluation_dataset": path, "query_count": len(dataset["eval_dataset"]), "commit": obtain_commit_hash(), "column_indexing_batch_size": settings.column_indexing_batch_size, "table_retrieval_size": settings.table_retrieval_size, "table_column_retrieval_size": settings.table_column_retrieval_size, "pipeline": pipe, "batch_size": settings.batch_size, "batch_interval": settings.batch_interval, "catalog": dataset["mdl"]["catalog"], "datasource": settings.datasource, } def write_prediction( meta: dict, predictions: list[dict], dir_path: str = "outputs/predictions" ) -> None: if Path(dir_path).exists() is False: Path(dir_path).mkdir(parents=True, exist_ok=True) output_file = f"prediction_{meta['session_id']}_{meta['date'].strftime('%Y_%m_%d_%H%M%S')}.toml" output_path = f"{dir_path}/{output_file}" doc = document() doc.add("meta", meta) doc.add("predictions", predictions) with open(output_path, "w") as file: file.write(dumps(doc)) print(f"\n\nPrediction result is saved at {output_path}") print( f"You can then evaluate the prediction result by running `just eval {output_file}`" ) def obtain_commit_hash() -> str: repo = Repo(search_parent_directories=True) branch = repo.active_branch return f"{repo.head.commit}@{branch.name}" def parse_args() -> Tuple[str, str]: parser = argparse.ArgumentParser() parser.add_argument( "--file", "-F", type=str, help="Eval dataset file path", ) parser.add_argument( "--pipeline", "-P", type=str, choices=["ask", "generation", "retrieval"], help="Specify the pipeline that you want to evaluate", ) args = parser.parse_args() return args.file, args.pipeline if __name__ == "__main__": path, pipe_name = parse_args() dataset = parse_toml(path) settings = EvalSettings() # todo: refactor this _mdl = base64.b64encode(orjson.dumps(dataset["mdl"])).decode("utf-8") if "spider_" in path or "bird_" in path: db_name = parse_db_name(path) if "spider_" in path: settings.eval_data_db_path = "etc/spider1.0/database" load_eval_data_db_to_postgres(db_name, settings.eval_data_db_path) elif "bird_" in path: settings.eval_data_db_path = "etc/bird/minidev/MINIDEV/dev_databases" load_eval_data_db_to_postgres(db_name, settings.eval_data_db_path) settings.datasource = "postgres" _connection_info = base64.b64encode( orjson.dumps(settings.postgres_info) ).decode("utf-8") replace_wren_engine_env_variables( "wren_ibis", { "manifest": _mdl, "source": settings.datasource, "connection_info": _connection_info, }, settings.config_path, ) else: _connection_info = base64.b64encode( orjson.dumps(settings.bigquery_info) ).decode("utf-8") replace_wren_engine_env_variables( "wren_ibis", { "manifest": _mdl, "source": settings.datasource, "connection_info": _connection_info, }, settings.config_path, ) pipe_components = provider.generate_components(settings.components) utils.init_langfuse(settings) meta = generate_meta(path=path, dataset=dataset, pipe=pipe_name, settings=settings) pipe: pipelines.Eval = pipelines.init( pipe_name, meta, mdl=dataset["mdl"], components=pipe_components, settings=settings, ) predictions = pipe.predict(dataset["eval_dataset"]) meta["expected_batch_size"] = meta["query_count"] * pipe.candidate_size meta["actual_batch_size"] = len(predictions) write_prediction(meta, predictions) langfuse_context.flush() if meta["langfuse_url"]: print( f"You can also view the prediction result in Langfuse at {meta['langfuse_url']}/sessions/{meta['session_id']}" ) ================================================ FILE: wren-ai-service/eval/preparation.py ================================================ """ This file aims to prepare spider 1.0 or bird eval dataset for text-to-sql eval purpose """ import argparse import asyncio import os import zipfile from collections import defaultdict from itertools import zip_longest from pathlib import Path from urllib.request import urlretrieve import gdown import orjson import pandas as pd from eval import ( BIRD_DESTINATION_PATH, EVAL_DATASET_DESTINATION_PATH, SPIDER_DESTINATION_PATH, WREN_ENGINE_API_URL, ) from eval.utils import ( get_contexts_from_sql, get_documents_given_contexts, get_eval_dataset_in_toml_string, get_next_few_items_circular, ) def download_spider_data(destination_path: Path): def _download_and_extract( destination_path: Path, path: Path, file_name: str, gdrive_id: str ): if not (destination_path / path).exists(): if Path(file_name).exists(): os.remove(file_name) url = f"https://drive.google.com/u/0/uc?id={gdrive_id}&export=download" gdown.download(url, file_name, quiet=False) with zipfile.ZipFile(file_name, "r") as zip_ref: zip_ref.extractall(destination_path) os.remove(file_name) _download_and_extract( destination_path, "database", "testsuitedatabases.zip", "1mkCx2GOFIqNesD4y8TDAO1yX1QZORP5w", ) _download_and_extract( destination_path, "spider_data", "spider_data.zip", "1403EGqzIDoHMdQF4c9Bkyl7dZLZ5Wt6J", ) def download_bird_data(destination_path: Path): def _download_and_extract(destination_path: Path, path: Path, file_name: str): if not (destination_path / path).exists(): if Path(file_name).exists(): os.remove(file_name) url = "https://bird-bench.oss-cn-beijing.aliyuncs.com/minidev.zip" print(f"Downloading {file_name} from {url}...") urlretrieve(url, file_name) with zipfile.ZipFile(file_name, "r") as zip_ref: zip_ref.extractall(destination_path) os.remove(file_name) _download_and_extract( destination_path, "minidev", "minidev.zip", ) def get_database_names(path: Path): return [folder.name for folder in path.iterdir() if folder.is_dir()] def get_tables_by_db(path: Path, key: str): with open(path, "rb") as f: json_data = orjson.loads(f.read()) return {item[key]: item for item in json_data} def build_mdl_models(database, tables_info, database_info={}): def _build_mdl_columns(tables_info, table_index, table_info=None): def _merge_column_info(column_names_original, column_types): merged_info = [] for (table_index, column_name), column_type in zip( column_names_original, column_types ): merged_info.append( { "table_index": table_index, "column_name": column_name, "column_type": column_type, } ) return merged_info def _get_columns_by_table_index(columns, table_index): return list(filter(lambda col: col["table_index"] == table_index, columns)) _columns = _get_columns_by_table_index( _merge_column_info( tables_info["column_names_original"], tables_info["column_types"] ), table_index, ) columns_info = {} if table_info: for column_info in table_info: original_col_key = next( key for key in column_info.keys() if "original_column_name" in key ) if value_description := column_info.get("value_description", ""): columns_info[column_info[original_col_key]] = ( column_info.get("column_description", "") + ", " + value_description ).strip() else: columns_info[column_info[original_col_key]] = column_info.get( "column_description", "" ).strip() # dealing with some edge cases return [ { "name": column["column_name"], "type": column["column_type"], "notNull": False, "properties": { "description": columns_info.get(column["column_name"], ""), } if columns_info and columns_info.get(column["column_name"], "") else {}, } for column in _columns ] return [ { "name": table, "properties": {}, "tableReference": { "catalog": database, "schema": "main", "table": table, }, "primaryKey": ( tables_info["column_names_original"][primary_key_column_index][-1] if primary_key_column_index else "" ), "columns": _build_mdl_columns( tables_info, i, database_info.get(table, None) ), } for i, (table, primary_key_column_index) in enumerate( zip_longest( tables_info["table_names_original"], filter( lambda x: isinstance(x, int), tables_info["primary_keys"] ), # filter out composite primary keys as of now ) ) ] def build_mdl_relationships(tables_info): relationships = [] for first, second in tables_info["foreign_keys"]: first_table_index, first_column_name = tables_info["column_names_original"][ first ] first_foreign_key_table = tables_info["table_names_original"][first_table_index] second_table_index, second_column_name = tables_info["column_names_original"][ second ] second_foreign_key_table = tables_info["table_names_original"][ second_table_index ] relationships.append( { "name": f"{first_foreign_key_table}_{first_column_name}_{second_foreign_key_table}_{second_column_name}", "models": [first_foreign_key_table, second_foreign_key_table], "joinType": "MANY_TO_MANY", "condition": f"{first_foreign_key_table}.{first_column_name} = {second_foreign_key_table}.{second_column_name}", } ) return relationships def get_ground_truths_by_db(path: Path, key: str): with open(path, "rb") as f: json_data = orjson.loads(f.read()) results = defaultdict(list) for item in json_data: results[item[key]].append(item) return results def build_mdl_by_db_using_spider(destination_path: Path): # get all database names in the spider testsuite database_names = get_database_names(destination_path / "database") # read tables.json and transform it to be a dictionary with database name as key tables_by_db = get_tables_by_db( destination_path / "spider_data/tables.json", "db_id" ) # build mdl for each database by checking the test_tables.json in spider_data mdl_by_db = {} for database in database_names: if tables_info := tables_by_db.get(database): mdl_by_db[database] = { "catalog": database, "schema": "main", "dataSource": "postgres", "models": build_mdl_models(database, tables_info), "relationships": build_mdl_relationships(tables_info), "views": [], "metrics": [], } return mdl_by_db def build_question_sql_pairs_by_db_using_spider(destination_path: Path): # get all database names in the spider testsuite database_names = get_database_names(destination_path / "database") # get dev.json and transform it to be a dictionary with database name as key ground_truths_by_db = get_ground_truths_by_db( destination_path / "spider_data/dev.json", "db_id" ) question_sql_pairs_by_db = defaultdict(list) for database in database_names: if ground_truths_info := ground_truths_by_db.get(database): for ground_truth in ground_truths_info: question_sql_pairs_by_db[database].append( { "question": ground_truth["question"], "sql": ground_truth["query"], } ) return question_sql_pairs_by_db def build_mdl_by_db_using_bird(destination_path: Path): def _get_database_infos(path: Path): database_infos = {} for folder in path.iterdir(): if folder.is_dir(): path_to_database_description = ( path / folder.name / "database_description" ) if ( path_to_database_description in folder.iterdir() and path_to_database_description.is_dir() ): database_infos[folder.name] = {} for file in path_to_database_description.iterdir(): if file.is_file() and file.suffix == ".csv": df = pd.read_csv( file, encoding="ISO-8859-1", keep_default_na=False ) database_infos[folder.name][file.stem] = df.to_dict( orient="records" ) return database_infos database_names = get_database_names( destination_path / "minidev/MINIDEV/dev_databases" ) database_infos = _get_database_infos( destination_path / "minidev/MINIDEV/dev_databases" ) tables_by_db = get_tables_by_db( destination_path / "minidev/MINIDEV/dev_tables.json", "db_id" ) # build mdl for each database by checking the test_tables.json in spider_data mdl_by_db = {} for database in database_names: if tables_info := tables_by_db.get(database): mdl_by_db[database] = { "catalog": database, "schema": "main", "dataSource": "postgres", "models": build_mdl_models( database, tables_info, database_infos.get(database, {}) ), "relationships": build_mdl_relationships(tables_info), "views": [], "metrics": [], } return mdl_by_db def build_question_sql_pairs_by_db_using_bird(destination_path: Path): database_names = get_database_names( destination_path / "minidev/MINIDEV/dev_databases" ) ground_truths_by_db = get_ground_truths_by_db( destination_path / "minidev/MINIDEV/mini_dev_sqlite.json", "db_id" ) question_sql_pairs_by_db = defaultdict(list) for database in database_names: if ground_truths_info := ground_truths_by_db.get(database): for ground_truth in ground_truths_info: question_sql_pairs_by_db[database].append( { "question": ground_truth["question"], "sql": ground_truth["SQL"], "question_id": ground_truth["question_id"], "evidence": ground_truth["evidence"], "difficulty": ground_truth["difficulty"], } ) return question_sql_pairs_by_db def get_mdls_and_question_sql_pairs_by_common_db(mdl_by_db, question_sql_pairs_by_db): common_dbs = set(mdl_by_db.keys()) & set(question_sql_pairs_by_db.keys()) return { db: {"mdl": mdl_by_db[db], "ground_truth": question_sql_pairs_by_db[db]} for db in common_dbs } if __name__ == "__main__": parser = argparse.ArgumentParser( description="Prepare evaluation dataset for text-to-sql tasks." ) parser.add_argument( "--dataset", choices=["spider1.0", "bird"], default="spider1.0", help="Choose which dataset to prepare (spider1.0 or bird)", ) args = parser.parse_args() if args.dataset == "spider1.0": destination_path = SPIDER_DESTINATION_PATH print( f"Downloading {args.dataset} data if unavailable in {destination_path}..." ) download_spider_data(destination_path) elif args.dataset == "bird": destination_path = BIRD_DESTINATION_PATH print( f"Downloading {args.dataset} data if unavailable in {destination_path}..." ) download_bird_data(destination_path) print(f"Building mdl and question sql pairs using {args.dataset} data...") # get mdl_by_db and question_sql_pairs_by_db whose dbs are present in both dictionaries if args.dataset == "spider1.0": mdl_and_ground_truths_by_db = get_mdls_and_question_sql_pairs_by_common_db( build_mdl_by_db_using_spider(destination_path), build_question_sql_pairs_by_db_using_spider(destination_path), ) elif args.dataset == "bird": mdl_and_ground_truths_by_db = get_mdls_and_question_sql_pairs_by_common_db( build_mdl_by_db_using_bird(destination_path), build_question_sql_pairs_by_db_using_bird(destination_path), ) print("Creating eval dataset...") questions_size = 0 if args.dataset == "spider1.0": eval_data_db_path = "etc/spider1.0/database" elif args.dataset == "bird": eval_data_db_path = "etc/bird/minidev/MINIDEV/dev_databases" for db, values in sorted(mdl_and_ground_truths_by_db.items()): candidate_eval_dataset = [] print(f"Database: {db}") for i, ground_truth in enumerate(values["ground_truth"]): context = asyncio.run( get_contexts_from_sql( ground_truth["sql"], values["mdl"], api_endpoint=WREN_ENGINE_API_URL, ) ) # ignore empty context if context: previous_ground_truths = get_next_few_items_circular( values["ground_truth"], i ) sql_pairs = [ { "question": ground_truth["question"], "sql": ground_truth["sql"], } for ground_truth in previous_ground_truths ] instructions = [ground_truth.get("evidence", "")] candidate_eval_dataset.append( { "categories": [], "question": ground_truth["question"], "sql": ground_truth["sql"], "context": context, "document": get_documents_given_contexts( [context], values["mdl"] ), "samples": sql_pairs, "instructions": instructions, } ) # save eval dataset if candidate_eval_dataset: if args.dataset == "spider1.0": file_name = f"spider_{db}_eval_dataset.toml" elif args.dataset == "bird": file_name = f"bird_{db}_eval_dataset.toml" with open(f"{EVAL_DATASET_DESTINATION_PATH}/{file_name}", "w") as f: f.write( get_eval_dataset_in_toml_string( values["mdl"], candidate_eval_dataset ) ) print( f"Successfully creating eval dataset of database {db}, which has {len(candidate_eval_dataset)} questions" ) questions_size += len(candidate_eval_dataset) print() print(f"Total questions size: {questions_size}") ================================================ FILE: wren-ai-service/eval/utils.py ================================================ import base64 import os import re import uuid from copy import deepcopy from datetime import datetime from typing import Any, Dict, List, Literal, Optional, get_args import aiohttp import orjson import psycopg2 import requests import tomlkit import yaml from dotenv import load_dotenv from openai import AsyncClient from tomlkit import parse import docker from eval import WREN_ENGINE_API_URL, EvalSettings from src.providers.engine.wren import WrenEngine load_dotenv(".env", override=True) async def get_data_from_wren_engine( sql: str, mdl_json: dict, api_endpoint: str, data_source: Optional[str] = None, connection_info: Optional[dict] = None, timeout: float = 300, limit: Optional[int] = None, ): if data_source == "duckdb": async with aiohttp.request( "GET", f"{api_endpoint}/v1/mdl/preview", json={ "sql": sql, "manifest": mdl_json, "limit": 500 if limit is None else limit, }, ) as response: data = await response.json() if response.status != 200: return {"data": [], "columns": []} column_names = [col["name"] for col in data["columns"]] return {"data": data["data"], "columns": column_names} else: url = f"{api_endpoint}/v3/connector/{data_source}/query" if limit is not None: url += f"?limit={limit}" async with aiohttp.request( "POST", url, json={ "sql": sql, "manifestStr": base64.b64encode(orjson.dumps(mdl_json)).decode(), "connectionInfo": connection_info, }, timeout=aiohttp.ClientTimeout(total=timeout), ) as response: if response.status != 200: return {"data": [], "columns": []} data = await response.json() column_names = [col for col in data["columns"]] return {"data": data["data"], "columns": column_names} async def get_contexts_from_sql( sql: str, mdl_json: dict, api_endpoint: str = WREN_ENGINE_API_URL, timeout: float = 300, **kwargs, ) -> list[str]: def _get_contexts_from_sql_analysis_results(sql_analysis_results: list[dict]): def _compose_contexts_of_select_type(select_items: list[dict]): return [ f"{expr_source['sourceDataset']}.{expr_source['sourceColumn']}" for select_item in select_items for expr_source in select_item["exprSources"] ] def _compose_contexts_of_filter_type(filter: dict): contexts = [] if filter["type"] == "EXPR": contexts += [ f"{expr_source['sourceDataset']}.{expr_source['sourceColumn']}" for expr_source in filter["exprSources"] ] elif filter["type"] in ("AND", "OR"): contexts += _compose_contexts_of_filter_type(filter["left"]) contexts += _compose_contexts_of_filter_type(filter["right"]) return contexts def _compose_contexts_of_groupby_type(groupby_keys: list[list[dict]]): contexts = [] for groupby_key_list in groupby_keys: contexts += [ f"{expr_source['sourceDataset']}.{expr_source['sourceColumn']}" for groupby_key in groupby_key_list for expr_source in groupby_key["exprSources"] ] return contexts def _compose_contexts_of_sorting_type(sortings: list[dict]): return [ f"{expr_source['sourceDataset']}.{expr_source['sourceColumn']}" for sorting in sortings for expr_source in sorting["exprSources"] ] def _compose_contexts_of_relation_type(relation: dict): contexts = [] if relation["type"] != "TABLE" and relation["type"] != "SUBQUERY": contexts += [ f"{expr_source['sourceDataset']}.{expr_source['sourceColumn']}" for expr_source in relation["exprSources"] ] contexts += _compose_contexts_of_relation_type(relation["left"]) contexts += _compose_contexts_of_relation_type(relation["right"]) return contexts contexts = [] for result in sql_analysis_results: if "selectItems" in result: contexts += _compose_contexts_of_select_type(result["selectItems"]) if "filter" in result: contexts += _compose_contexts_of_filter_type(result["filter"]) if "groupByKeys" in result: contexts += _compose_contexts_of_groupby_type(result["groupByKeys"]) if "sortings" in result: contexts += _compose_contexts_of_sorting_type(result["sortings"]) if "relation" in result: contexts += _compose_contexts_of_relation_type(result["relation"]) return sorted(set(contexts)) async def _get_sql_analysis( sql: str, mdl_json: dict, api_endpoint: str, timeout: float = 300, ) -> List[dict]: sql = sql.rstrip(";") if sql.endswith(";") else sql manifest_str = base64.b64encode(orjson.dumps(mdl_json)).decode() async with aiohttp.request( "GET", f"{api_endpoint}/v2/analysis/sql", json={ "sql": sql, "manifestStr": manifest_str, }, timeout=aiohttp.ClientTimeout(total=timeout), ) as response: return await response.json() sql_analysis_results = await _get_sql_analysis( sql, mdl_json, api_endpoint, timeout=timeout ) contexts = _get_contexts_from_sql_analysis_results(sql_analysis_results) return contexts def parse_toml(path: str) -> Dict[str, Any]: with open(path) as file: return parse(file.read()) def parse_db_name(path: str) -> str: match = re.search( r"bird_(.+?)_eval_dataset\.toml|spider_(.+?)_eval_dataset\.toml", path ) if match: return match.group(1) or match.group(2) else: raise ValueError( f"Invalid path format: {path}. Expected format: bird__eval_dataset.toml or spider__eval_dataset.toml" ) TRACE_TYPES = Literal["execution", "shallow", "summary"] def trace_metadata( meta: dict, type: TRACE_TYPES, ) -> dict: if type not in get_args(TRACE_TYPES): raise ValueError( f"Invalid type: {type}, should be one of {get_args(TRACE_TYPES)}" ) return { "commit": meta["commit"], "dataset_id": meta["dataset_id"], "column_indexing_batch_size": meta["column_indexing_batch_size"], "table_retrieval_size": meta["table_retrieval_size"], "table_column_retrieval_size": meta["table_column_retrieval_size"], "type": type, "pipeline": meta["pipeline"], } def engine_config( mdl: dict, pipe_components: dict[str, Any] = {}, path: str = "" ) -> dict: engine = pipe_components.get("sql_generation", {}).get("engine") if engine is None: raise ValueError( "SQL Generation engine not found in pipe_components. Ensure 'sql_generation' key exists and contains 'engine' configuration." ) if isinstance(engine, WrenEngine): print("datasource is duckdb") prepare_duckdb_session_sql(engine._endpoint) prepare_duckdb_init_sql(engine._endpoint, mdl["catalog"], path) return { "mdl_json": mdl, "api_endpoint": engine._endpoint, "timeout": 10, "data_source": "duckdb", } return { "mdl_json": mdl, "data_source": engine._source, "api_endpoint": engine._endpoint, "connection_info": engine._connection_info, "timeout": 10, } def get_ddl_commands(mdl: Dict[str, Any]) -> List[str]: def _convert_models_and_relationships( models: List[Dict[str, Any]], relationships: List[Dict[str, Any]] ) -> List[str]: ddl_commands = [] # A map to store model primary keys for foreign key relationships primary_keys_map = {model["name"]: model["primaryKey"] for model in models} for model in models: table_name = model["name"] columns_ddl = [] for column in model["columns"]: if "relationship" not in column: if "properties" in column: column["properties"]["alias"] = column["properties"].pop( "displayName", "" ) comment = f"-- {orjson.dumps(column['properties']).decode('utf-8')}\n " else: comment = "" if "isCalculated" in column and column["isCalculated"]: comment = ( comment + f"-- This column is a Calculated Field\n -- column expression: {column['expression']}\n " ) column_name = column["name"] column_type = column["type"] column_ddl = f"{comment}{column_name} {column_type}" # If column is a primary key if column_name == model.get("primaryKey", ""): column_ddl += " PRIMARY KEY" columns_ddl.append(column_ddl) # Add foreign key constraints based on relationships for relationship in relationships: comment = f'-- {{"condition": {relationship["condition"]}, "joinType": {relationship["joinType"]}}}\n ' if ( table_name == relationship["models"][0] and relationship["joinType"].upper() == "MANY_TO_ONE" ): related_table = relationship["models"][1] fk_column = relationship["condition"].split(" = ")[0].split(".")[1] fk_constraint = f"FOREIGN KEY ({fk_column}) REFERENCES {related_table}({primary_keys_map[related_table]})" columns_ddl.append(f"{comment}{fk_constraint}") elif ( table_name == relationship["models"][1] and relationship["joinType"].upper() == "ONE_TO_MANY" ): related_table = relationship["models"][0] fk_column = relationship["condition"].split(" = ")[1].split(".")[1] fk_constraint = f"FOREIGN KEY ({fk_column}) REFERENCES {related_table}({primary_keys_map[related_table]})" columns_ddl.append(f"{comment}{fk_constraint}") elif ( table_name in relationship["models"] and relationship["joinType"].upper() == "ONE_TO_ONE" ): index = relationship["models"].index(table_name) related_table = [ m for m in relationship["models"] if m != table_name ][0] fk_column = ( relationship["condition"].split(" = ")[index].split(".")[1] ) fk_constraint = f"FOREIGN KEY ({fk_column}) REFERENCES {related_table}({primary_keys_map[related_table]})" columns_ddl.append(f"{comment}{fk_constraint}") if "properties" in model: model["properties"]["alias"] = model["properties"].pop( "displayName", "" ) comment = ( f"\n/* {orjson.dumps(model['properties']).decode('utf-8')} */\n" ) else: comment = "" create_table_ddl = ( f"{comment}CREATE TABLE {table_name} (\n " + ",\n ".join(columns_ddl) + "\n);" ) ddl_commands.append(create_table_ddl) return ddl_commands def _convert_views(views: List[Dict[str, Any]]) -> List[str]: def _format(view: Dict[str, Any]) -> str: properties = view["properties"] if "properties" in view else "" return f"/* {properties} */\nCREATE VIEW {view['name']}\nAS ({view['statement']})" return [_format(view) for view in views] def _convert_metrics(metrics: List[Dict[str, Any]]) -> List[str]: ddl_commands = [] for metric in metrics: table_name = metric["name"] columns_ddl = [] for dimension in metric["dimension"]: column_name = dimension["name"] column_type = dimension["type"] comment = "-- This column is a dimension\n " column_ddl = f"{comment}{column_name} {column_type}" columns_ddl.append(column_ddl) for measure in metric["measure"]: column_name = measure["name"] column_type = measure["type"] comment = f"-- This column is a measure\n -- expression: {measure['expression']}\n " column_ddl = f"{comment}{column_name} {column_type}" columns_ddl.append(column_ddl) comment = f"\n/* This table is a metric */\n/* Metric Base Object: {metric['baseObject']} */\n" create_table_ddl = ( f"{comment}CREATE TABLE {table_name} (\n " + ",\n ".join(columns_ddl) + "\n);" ) ddl_commands.append(create_table_ddl) return ddl_commands semantics = { "models": [], "relationships": mdl["relationships"], "views": mdl["views"], "metrics": mdl["metrics"], } for model in mdl["models"]: columns = [] for column in model["columns"]: ddl_column = { "name": column["name"], "type": column["type"], } if "properties" in column: ddl_column["properties"] = column["properties"] if "relationship" in column: ddl_column["relationship"] = column["relationship"] if "expression" in column: ddl_column["expression"] = column["expression"] if "isCalculated" in column: ddl_column["isCalculated"] = column["isCalculated"] columns.append(ddl_column) semantics["models"].append( { "type": "model", "name": model["name"], "properties": model["properties"] if "properties" in model else {}, "columns": columns, "primaryKey": model["primaryKey"], } ) return ( _convert_models_and_relationships( semantics["models"], semantics["relationships"] ) + _convert_metrics(semantics["metrics"]) + _convert_views(semantics["views"]) ) def get_documents_given_contexts( contexts_list: list[list[str]], mdl_json: dict ) -> list[list[dict]]: mdl_json_cloned = deepcopy(mdl_json) def _build_partial_mdl_json( contexts_list: list[list[str]], mdl_json: dict ) -> list[dict]: mdj_json_model_lookup_table = { model["name"]: { **model, "column_lookup": { column["name"]: column for column in model["columns"] if "relationship" not in column }, "relationship_lookup": { column["relationship"]: column for column in model["columns"] if "relationship" in column }, } for model in mdl_json["models"] } new_mdl_jsons = [] for contexts in contexts_list: model_candidates = {} relationship_candidates = [] for context in contexts: table_name, column_name = context.split(".") model = mdj_json_model_lookup_table.get(table_name) if model: if table_name not in model_candidates: model_candidates[table_name] = { "name": model["name"], "properties": model["properties"], "tableReference": model["tableReference"], "primaryKey": model["primaryKey"], "columns": [], } # add column info column = mdj_json_model_lookup_table[table_name]["column_lookup"][ column_name ] model_candidates[table_name]["columns"].append(column) contexts_in_set = set(contexts) for relationship in mdl_json["relationships"]: relationship_name = relationship["name"] condition_str = "".join( relationship["condition"].split() ) # remove all whitespaces conditions = condition_str.split("=") if ( conditions[0] in contexts_in_set and conditions[1] in contexts_in_set ): table_name_first_condition = conditions[0].split(".")[0] table_name_second_condition = conditions[1].split(".")[0] # add relationship column info if ( relationship_column := mdj_json_model_lookup_table.get( table_name_first_condition, {} ) .get("relationship_lookup", {}) .get(relationship_name, {}) ): model_candidates[table_name_first_condition]["columns"].append( relationship_column ) elif ( relationship_column := mdj_json_model_lookup_table.get( table_name_second_condition, {} ) .get("relationship_lookup", {}) .get(relationship_name, {}) ): model_candidates[table_name_second_condition]["columns"].append( relationship_column ) # add relationship info relationship_candidates.append(relationship) new_mdl_jsons.append( { "models": list(model_candidates.values()), "relationships": relationship_candidates, "views": [], "metrics": [], } ) return new_mdl_jsons new_mdl_jsons = _build_partial_mdl_json(contexts_list, mdl_json_cloned) return [ { "id": str(i), "meta": {"id": str(i)}, "content": ddl_command, } for new_mdl_json in new_mdl_jsons for i, ddl_command in enumerate(get_ddl_commands(new_mdl_json)) ] def get_eval_dataset_in_toml_string(mdl: dict, dataset: list) -> str: doc = tomlkit.document() doc.add("dataset_id", str(uuid.uuid4())) doc.add("date", datetime.today().strftime("%Y_%m_%d")) doc.add("mdl", mdl) doc.add("eval_dataset", dataset) return tomlkit.dumps(doc, sort_keys=True) def prepare_duckdb_session_sql(api_endpoint: str): session_sql = "INSTALL sqlite;" response = requests.put( f"{api_endpoint}/v1/data-source/duckdb/settings/session-sql", data=session_sql, ) assert response.status_code == 200, response.text def prepare_duckdb_init_sql(api_endpoint: str, db: str, path: str): init_sql = f"ATTACH '{path}/{db}/{db}.sqlite' AS {db} (TYPE sqlite);" response = requests.put( f"{api_endpoint}/v1/data-source/duckdb/settings/init-sql", data=init_sql, ) assert response.status_code == 200, response.text def load_eval_data_db_to_postgres(db: str, path: str): abs_path = os.path.abspath(f"tools/dev/{path}") postgres_info = EvalSettings().postgres_info conn = psycopg2.connect( host="localhost", port=postgres_info["port"], database=postgres_info["database"], user=postgres_info["user"], password=postgres_info["password"], ) # delete all tables in the database cursor = conn.cursor() cursor.execute("DROP SCHEMA IF EXISTS public CASCADE; CREATE SCHEMA public;") conn.commit() cursor.close() conn.close() # load the eval data db to the postgres docker_client = docker.from_env() docker_client.containers.run( "dimitri/pgloader:latest", name="pgloader", volumes={abs_path: {"bind": "/data", "mode": "ro"}}, command=f'pgloader --with "quote identifiers" sqlite:///data/{db}/{db}.sqlite pgsql://{postgres_info["user"]}:{postgres_info["password"]}@{postgres_info["host"]}:{postgres_info["port"]}/{postgres_info["database"]}', network="wren_wren", remove=True, ) def get_next_few_items_circular(items: list, i: int, few: int = 5): list_length = len(items) if list_length < few + 1: few = list_length - 1 return [items[(i + j) % list_length] for j in range(1, few + 1)] def get_openai_client( api_key: str = os.getenv("OPENAI_API_KEY"), timeout: float = 60 ) -> AsyncClient: return AsyncClient( api_key=api_key, timeout=timeout, ) def replace_wren_engine_env_variables(engine_type: str, data: dict, config_path: str): assert engine_type in ("wren_engine", "wren_ibis") with open(config_path, "r") as f: configs = list(yaml.safe_load_all(f)) for config in configs: if config.get("type") == "engine" and config.get("provider") == engine_type: for key, value in data.items(): config[key] = value if "pipes" in config: for i, pipe in enumerate(config["pipes"]): if "engine" in pipe and pipe["name"] != "sql_functions_retrieval": config["pipes"][i]["engine"] = engine_type with open(config_path, "w") as f: yaml.safe_dump_all(configs, f, default_flow_style=False) ================================================ FILE: wren-ai-service/pyproject.toml ================================================ [tool.poetry] name = "wren-ai-service" version = "0.29.3" description = "" authors = ["dev@getwren.ai"] license = "AGPL-3.0" readme = "README.md" package-mode = false [tool.poetry.dependencies] python = ">=3.12.*, <3.13" fastapi = "^0.121.1" uvicorn = {extras = ["standard"], version = "^0.29.0"} # Litellm requires uvicorn < 0.30.0 python-dotenv = "^1.0.1" haystack-ai = "==2.7.0" openai = "^1.40.0" qdrant-haystack = "^7.0.0" backoff = "^2.2.1" tqdm = "^4.66.4" numpy = "^1.26.4" sqlparse = "^0.5.0" orjson = "^3.11.5" sf-hamilton = {version = "^1.69.0"} aiohttp = {extras = ["speedups"], version = "^3.13.3"} ollama-haystack = "^0.0.6" langfuse = "^2.43.3" ollama = "^0.2.1" toml = "^0.10.2" cachetools = "^5.5.0" pyyaml = "^6.0.2" pydantic-settings = "^2.5.2" google-auth = "^2.35.0" tiktoken = "^0.8.0" jsonschema = "^4.23.0" litellm = "^1.75.2" boto3 = "^1.34.34" # Litellm requires boto3 = 1.34.34 qdrant-client = ">=1.12.0,<2.0.0" filelock = "^3.20.1" urllib3 = ">=2.6.3" werkzeug = ">=3.1.5" # CVE: safe_join Windows device name vulnerability marshmallow = ">=3.26.2" # CVE: Schema.load(many=True) DoS pillow = ">=12.1.1" # CVE: out-of-bounds write when loading PSD images protobuf = ">=5.29.6" [tool.poetry.group.dev.dependencies] pre-commit = "^3.7.1" streamlit = "^1.37.0" watchdog = "^4.0.0" pandas = "^2.2.2" matplotlib = "^3.9.2" sseclient-py = "^1.8.0" dspy-ai = "^2.5.26" requests = "^2.32.4" extra-streamlit-components = "^0.1.71" deepeval = "^3.0.0" tomlkit = "^0.13.0" nltk = "^3.9.3" psycopg2 = "^2.9.10" [tool.poetry.group.eval.dependencies] gitpython = "^3.1.43" plotly = "^5.24.1" nbformat = "^5.1.3" ipykernel = "^6.29.5" itables = "^2.2.1" gdown = "^5.2.0" streamlit-tags = "^1.2.8" docker = "^7.1.0" [tool.poetry.group.test.dependencies] locust = "^2.32.0" pytest = "^8.3.0" pytest-cov = "^6.0.0" pytest-asyncio = "^0.24.0" aioresponses = "^0.7.0" pytest-mock = "^3.14.0" [build-system] requires = ["poetry-core"] build-backend = "poetry.core.masonry.api" ================================================ FILE: wren-ai-service/ruff.toml ================================================ # Exclude a variety of commonly ignored directories. exclude = [ ".bzr", ".direnv", ".eggs", ".git", ".git-rewrite", ".hg", ".ipynb_checkpoints", ".mypy_cache", ".nox", ".pants.d", ".pyenv", ".pytest_cache", ".pytype", ".ruff_cache", ".svn", ".tox", ".venv", ".vscode", "__pypackages__", "_build", "buck-out", "build", "dist", "node_modules", "site-packages", "venv", ] # Same as Black. line-length = 88 indent-width = 4 # Assume Python 3.8 target-version = "py38" [lint] # Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default. # Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or # McCabe complexity (`C901`) by default. select = ["E4", "E7", "E9", "F", "I001"] ignore = [] # Allow fix for all enabled rules (when `--fix`) is provided. fixable = ["ALL"] unfixable = [] # Allow unused variables when underscore-prefixed. dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" [format] # Like Black, use double quotes for strings. quote-style = "double" # Like Black, indent with spaces, rather than tabs. indent-style = "space" # Like Black, respect magic trailing commas. skip-magic-trailing-comma = false # Like Black, automatically detect the appropriate line ending. line-ending = "auto" # Enable auto-formatting of code examples in docstrings. Markdown, # reStructuredText code/literal blocks and doctests are all supported. # # This is currently disabled by default, but it is planned for this # to be opt-out in the future. docstring-code-format = false # Set the line length limit used when formatting code snippets in # docstrings. # # This only has an effect when the `docstring-code-format` setting is # enabled. docstring-code-line-length = "dynamic" ================================================ FILE: wren-ai-service/src/__init__.py ================================================ ================================================ FILE: wren-ai-service/src/__main__.py ================================================ from contextlib import asynccontextmanager import uvicorn from fastapi import FastAPI from fastapi.exceptions import RequestValidationError from fastapi.middleware.cors import CORSMiddleware from fastapi.responses import ORJSONResponse, RedirectResponse from langfuse.decorators import langfuse_context from src.config import settings from src.globals import ( create_service_container, create_service_metadata, ) from src.providers import generate_components from src.utils import ( init_langfuse, setup_custom_logger, ) from src.web.v1 import routers setup_custom_logger( "wren-ai-service", level_str=settings.logging_level, is_dev=settings.development ) # https://fastapi.tiangolo.com/advanced/events/#lifespan @asynccontextmanager async def lifespan(app: FastAPI): # startup events pipe_components = generate_components(settings.components) app.state.service_container = create_service_container(pipe_components, settings) app.state.service_metadata = create_service_metadata(pipe_components) init_langfuse(settings) yield # shutdown events langfuse_context.flush() app = FastAPI( title="wren-ai-service API Docs", lifespan=lifespan, redoc_url=None, default_response_class=ORJSONResponse, ) app.add_middleware( CORSMiddleware, allow_origins=["*"], allow_credentials=True, allow_methods=["*"], allow_headers=["*"], ) app.include_router(routers.router, prefix="/v1", tags=["v1"]) if settings.development: from src.web import development app.include_router(development.router, prefix="/dev", tags=["dev"]) @app.exception_handler(Exception) async def exception_handler(_, exc: Exception): return ORJSONResponse( status_code=500, content={"detail": str(exc)}, ) @app.exception_handler(RequestValidationError) async def request_exception_handler(_, exc: Exception): return ORJSONResponse( status_code=400, content={"detail": str(exc)}, ) @app.get("/") def root(): return RedirectResponse(url="/docs") @app.get("/health") def health(): return {"status": "ok"} if __name__ == "__main__": uvicorn.run( "src.__main__:app", host=settings.host, port=settings.port, reload=settings.development, reload_includes=["src/**/*.py", ".env.dev", "config.yaml"], reload_excludes=["tests/**/*.py", "eval/**/*.py"], workers=1, loop="uvloop", http="httptools", ) ================================================ FILE: wren-ai-service/src/config.py ================================================ import logging import yaml from dotenv import load_dotenv from pydantic import Field from pydantic_settings import BaseSettings logger = logging.getLogger("wren-ai-service") class Settings(BaseSettings): """ Configuration settings for the Wren AI service. The settings are loaded in the following order of precedence: 1. Default values: Defined in the class attributes. 2. Environment variables: Overrides default values if set. 3. .env.dev file: Loads additional settings or overrides previous ones. 4. config.yaml file: Provides the highest priority configuration. This hierarchical loading allows for flexible configuration management across different environments and deployment scenarios. """ host: str = Field(default="127.0.0.1", alias="WREN_AI_SERVICE_HOST") port: int = Field(default=5555, alias="WREN_AI_SERVICE_PORT") # indexing and retrieval config column_indexing_batch_size: int = Field(default=50) table_retrieval_size: int = Field(default=10) table_column_retrieval_size: int = Field(default=100) enable_column_pruning: bool = Field(default=False) historical_question_retrieval_similarity_threshold: float = Field(default=0.9) sql_pairs_similarity_threshold: float = Field(default=0.7) sql_pairs_retrieval_max_size: int = Field(default=10) instructions_similarity_threshold: float = Field(default=0.7) instructions_top_k: int = Field(default=10) # generation config allow_intent_classification: bool = Field(default=True) allow_sql_generation_reasoning: bool = Field(default=True) allow_sql_functions_retrieval: bool = Field(default=True) allow_sql_diagnosis: bool = Field(default=True) allow_sql_knowledge_retrieval: bool = Field(default=False) max_histories: int = Field(default=5) max_sql_correction_retries: int = Field(default=3) # engine config engine_timeout: float = Field(default=30.0) # service config query_cache_ttl: int = Field(default=3600) # unit: seconds query_cache_maxsize: int = Field( default=1_000_000, comment=""" the maxsize is a necessary parameter to init cache, but we don't want to expose it to the user so we set it to 1_000_000, which is a large number """, ) # user guide config is_oss: bool = Field(default=True) doc_endpoint: str = Field(default="https://docs.getwren.ai") # langfuse config # in order to use langfuse, we also need to set the LANGFUSE_SECRET_KEY and LANGFUSE_PUBLIC_KEY in the .env or .env.dev file langfuse_host: str = Field(default="https://cloud.langfuse.com") langfuse_enable: bool = Field(default=True) # debug config logging_level: str = Field(default="INFO") development: bool = Field(default=False) # this is used to store the config like type: llm, embedder, etc. and we will process them later config_path: str = Field(default="config.yaml") _components: list[dict] sql_pairs_path: str = Field(default="sql_pairs.json") def __init__(self): load_dotenv(".env.dev", override=True) super().__init__() raw = self.config_loader() self.override(raw) self._components = [ component for component in raw if "settings" not in component ] def config_loader(self): try: with open(self.config_path, "r") as file: return list(yaml.load_all(file, Loader=yaml.SafeLoader)) except FileNotFoundError: message = f"Warning: Configuration file {self.config_path} not found. Using default settings." logger.warning(message) return [] except yaml.YAMLError as e: logger.exception(f"Error parsing YAML file: {e}") return [] def override(self, raw: list[dict]) -> None: override_settings = {} for doc in raw: if "settings" in doc: override_settings = doc["settings"] break for key, value in override_settings.items(): if hasattr(self, key): setattr(self, key, value) else: message = f"Warning: Unknown configuration key '{key}' in YAML file." logger.warning(message) @property def components(self) -> list[dict]: return self._components settings = Settings() ================================================ FILE: wren-ai-service/src/core/__init__.py ================================================ ================================================ FILE: wren-ai-service/src/core/engine.py ================================================ import logging import re from abc import ABCMeta, abstractmethod from typing import Any, Dict, Optional, Tuple import aiohttp from pydantic import BaseModel logger = logging.getLogger("wren-ai-service") class EngineConfig(BaseModel): provider: str = "wren_ui" config: dict = {} class Engine(metaclass=ABCMeta): @abstractmethod async def execute_sql( self, sql: str, session: aiohttp.ClientSession, dry_run: bool = True, **kwargs, ) -> Tuple[bool, Optional[Dict[str, Any]]]: ... def clean_generation_result(result: str) -> str: def _normalize_whitespace(s: str) -> str: return re.sub(r"\s+", " ", s).strip() return ( _normalize_whitespace(result) .replace("```sql", "") .replace("```json", "") .replace('"""', "") .replace("'''", "") .replace("```", "") .replace(";", "") ) def remove_limit_statement(sql: str) -> str: pattern = r"\s*LIMIT\s+\d+(\s*;?\s*--.*|\s*;?\s*)$" modified_sql = re.sub(pattern, "", sql, flags=re.IGNORECASE) return modified_sql ================================================ FILE: wren-ai-service/src/core/pipeline.py ================================================ from abc import ABCMeta, abstractmethod from collections.abc import Mapping from dataclasses import dataclass from typing import Any, Dict from hamilton.async_driver import AsyncDriver from hamilton.driver import Driver from haystack import Pipeline from src.core.engine import Engine from src.core.provider import DocumentStoreProvider, EmbedderProvider, LLMProvider class BasicPipeline(metaclass=ABCMeta): def __init__(self, pipe: Pipeline | AsyncDriver | Driver): self._pipe = pipe @abstractmethod def run(self, *args, **kwargs) -> Dict[str, Any]: ... @dataclass class PipelineComponent(Mapping): llm_provider: LLMProvider = None embedder_provider: EmbedderProvider = None document_store_provider: DocumentStoreProvider = None engine: Engine = None def __getitem__(self, key): return getattr(self, key) def __iter__(self): return iter(self.__dict__) def __len__(self): return len(self.__dict__) ================================================ FILE: wren-ai-service/src/core/provider.py ================================================ from abc import ABCMeta, abstractmethod from haystack.document_stores.types import DocumentStore class LLMProvider(metaclass=ABCMeta): @abstractmethod def get_generator(self, *args, **kwargs): ... def get_model(self): return self._model def get_model_kwargs(self): return self._model_kwargs def get_context_window_size(self): return self._context_window_size class EmbedderProvider(metaclass=ABCMeta): @abstractmethod def get_text_embedder(self, *args, **kwargs): ... @abstractmethod def get_document_embedder(self, *args, **kwargs): ... def get_model(self): return self._embedding_model class DocumentStoreProvider(metaclass=ABCMeta): @abstractmethod def get_store(self, *args, **kwargs) -> DocumentStore: ... @abstractmethod def get_retriever(self, *args, **kwargs): ... ================================================ FILE: wren-ai-service/src/force_deploy.py ================================================ # This file is only used for OSS, it will force deploy the mdl for the OSS users # Since we allow users to customize llm and embedding models, which means qdrant collections may need to be recreated # So, this file automates the process of force deploying the mdl import asyncio import os from pathlib import Path import aiohttp import backoff from dotenv import load_dotenv if Path(".env.dev").exists(): load_dotenv(".env.dev", override=True) @backoff.on_exception(backoff.expo, aiohttp.ClientError, max_time=60, max_tries=3) async def force_deploy(): async with aiohttp.ClientSession() as session: async with session.post( f"{os.getenv("WREN_UI_ENDPOINT", "http://wren-ui:3000")}/api/graphql", json={ "query": "mutation Deploy($force: Boolean) { deploy(force: $force) }", "variables": {"force": True}, }, timeout=aiohttp.ClientTimeout(total=60), # 60 seconds ) as response: res = await response.json() print(f"Forcing deployment: {res}") if os.getenv("ENGINE", "wren_ui") == "wren_ui": asyncio.run(force_deploy()) ================================================ FILE: wren-ai-service/src/force_update_config.py ================================================ # This file is only used for local development # It will update the config.yaml file to use correct engine name for all pipelines # Since the demo app uses the same config.yaml and the app will update the engine names while deploying mdl, # so we need to force update the engine names to the correct ones when we would like to use Wren UI import yaml def update_config(): # Read the config file with open("config.yaml", "r") as file: # Load all documents from YAML file (since it has multiple documents separated by ---) documents = list(yaml.safe_load_all(file)) # Find the pipeline configuration document for doc in documents: if doc.get("type") == "pipeline": # Update engine name in all pipelines for pipe in doc.get("pipes", []): if "engine" in pipe: if pipe["name"] in [ "sql_functions_retrieval", "sql_knowledge_retrieval", ]: pipe["engine"] = "wren_ibis" else: pipe["engine"] = "wren_ui" # Write back to the file with open("config.yaml", "w") as file: yaml.safe_dump_all(documents, file, default_flow_style=False) print("Successfully updated engine names to 'wren_ui' in all pipelines") if __name__ == "__main__": update_config() ================================================ FILE: wren-ai-service/src/globals.py ================================================ import logging from dataclasses import asdict, dataclass import toml from src.config import Settings from src.core.pipeline import PipelineComponent from src.core.provider import EmbedderProvider, LLMProvider from src.pipelines import generation, indexing, retrieval from src.utils import fetch_wren_ai_docs from src.web.v1 import services logger = logging.getLogger("wren-ai-service") @dataclass class ServiceContainer: ask_service: services.AskService ask_feedback_service: services.AskFeedbackService question_recommendation: services.QuestionRecommendation relationship_recommendation: services.RelationshipRecommendation semantics_description: services.SemanticsDescription semantics_preparation_service: services.SemanticsPreparationService chart_service: services.ChartService chart_adjustment_service: services.ChartAdjustmentService sql_answer_service: services.SqlAnswerService sql_pairs_service: services.SqlPairsService sql_question_service: services.SqlQuestionService instructions_service: services.InstructionsService sql_correction_service: services.SqlCorrectionService @dataclass class ServiceMetadata: pipes_metadata: dict service_version: str def create_service_container( pipe_components: dict[str, PipelineComponent], settings: Settings, ) -> ServiceContainer: query_cache = { "maxsize": settings.query_cache_maxsize, "ttl": settings.query_cache_ttl, } wren_ai_docs = fetch_wren_ai_docs(settings.doc_endpoint, settings.is_oss) if not wren_ai_docs: logger.warning("Failed to fetch Wren AI docs or response was empty.") _db_schema_retrieval_pipeline = retrieval.DbSchemaRetrieval( **pipe_components["db_schema_retrieval"], table_retrieval_size=settings.table_retrieval_size, table_column_retrieval_size=settings.table_column_retrieval_size, ) _sql_pair_indexing_pipeline = indexing.SqlPairs( **pipe_components["sql_pairs_indexing"], sql_pairs_path=settings.sql_pairs_path, ) _instructions_indexing_pipeline = indexing.Instructions( **pipe_components["instructions_indexing"], ) _sql_pair_retrieval_pipeline = retrieval.SqlPairsRetrieval( **pipe_components["sql_pairs_retrieval"], sql_pairs_similarity_threshold=settings.sql_pairs_similarity_threshold, sql_pairs_retrieval_max_size=settings.sql_pairs_retrieval_max_size, ) _instructions_retrieval_pipeline = retrieval.Instructions( **pipe_components["instructions_retrieval"], similarity_threshold=settings.instructions_similarity_threshold, top_k=settings.instructions_top_k, ) _sql_correction_pipeline = generation.SQLCorrection( **pipe_components["sql_correction"], ) _sql_functions_retrieval_pipeline = retrieval.SqlFunctions( **pipe_components["sql_functions_retrieval"], ) _sql_executor_pipeline = retrieval.SQLExecutor( **pipe_components["sql_executor"], ) _sql_diagnosis_pipeline = generation.SQLDiagnosis( **pipe_components["sql_diagnosis"], ) return ServiceContainer( semantics_description=services.SemanticsDescription( pipelines={ "semantics_description": generation.SemanticsDescription( **pipe_components["semantics_description"], ) }, **query_cache, ), semantics_preparation_service=services.SemanticsPreparationService( pipelines={ "db_schema": indexing.DBSchema( **pipe_components["db_schema_indexing"], column_batch_size=settings.column_indexing_batch_size, ), "historical_question": indexing.HistoricalQuestion( **pipe_components["historical_question_indexing"], ), "table_description": indexing.TableDescription( **pipe_components["table_description_indexing"], ), "sql_pairs": _sql_pair_indexing_pipeline, "instructions": _instructions_indexing_pipeline, "project_meta": indexing.ProjectMeta( **pipe_components["project_meta_indexing"], ), }, **query_cache, ), ask_service=services.AskService( pipelines={ "intent_classification": generation.IntentClassification( **pipe_components["intent_classification"], wren_ai_docs=wren_ai_docs, ), "misleading_assistance": generation.MisleadingAssistance( **pipe_components["misleading_assistance"], ), "data_assistance": generation.DataAssistance( **pipe_components["data_assistance"] ), "user_guide_assistance": generation.UserGuideAssistance( **pipe_components["user_guide_assistance"], wren_ai_docs=wren_ai_docs, ), "db_schema_retrieval": _db_schema_retrieval_pipeline, "historical_question": retrieval.HistoricalQuestionRetrieval( **pipe_components["historical_question_retrieval"], historical_question_retrieval_similarity_threshold=settings.historical_question_retrieval_similarity_threshold, ), "sql_pairs_retrieval": _sql_pair_retrieval_pipeline, "instructions_retrieval": _instructions_retrieval_pipeline, "sql_generation": generation.SQLGeneration( **pipe_components["sql_generation"], ), "sql_generation_reasoning": generation.SQLGenerationReasoning( **pipe_components["sql_generation_reasoning"], ), "followup_sql_generation_reasoning": generation.FollowUpSQLGenerationReasoning( **pipe_components["followup_sql_generation_reasoning"], ), "sql_correction": _sql_correction_pipeline, "followup_sql_generation": generation.FollowUpSQLGeneration( **pipe_components["followup_sql_generation"], ), "sql_functions_retrieval": _sql_functions_retrieval_pipeline, "sql_diagnosis": _sql_diagnosis_pipeline, "sql_knowledge_retrieval": retrieval.SqlKnowledges( **pipe_components["sql_knowledge_retrieval"], ), }, allow_intent_classification=settings.allow_intent_classification, allow_sql_generation_reasoning=settings.allow_sql_generation_reasoning, allow_sql_functions_retrieval=settings.allow_sql_functions_retrieval, allow_sql_diagnosis=settings.allow_sql_diagnosis, allow_sql_knowledge_retrieval=settings.allow_sql_knowledge_retrieval, max_histories=settings.max_histories, enable_column_pruning=settings.enable_column_pruning, max_sql_correction_retries=settings.max_sql_correction_retries, **query_cache, ), ask_feedback_service=services.AskFeedbackService( pipelines={ "db_schema_retrieval": _db_schema_retrieval_pipeline, "sql_pairs_retrieval": _sql_pair_retrieval_pipeline, "instructions_retrieval": _instructions_retrieval_pipeline, "sql_functions_retrieval": _sql_functions_retrieval_pipeline, "sql_regeneration": generation.SQLRegeneration( **pipe_components["sql_regeneration"], ), "sql_correction": _sql_correction_pipeline, "sql_diagnosis": _sql_diagnosis_pipeline, "sql_knowledge_retrieval": retrieval.SqlKnowledges( **pipe_components["sql_knowledge_retrieval"], ), }, allow_sql_functions_retrieval=settings.allow_sql_functions_retrieval, allow_sql_diagnosis=settings.allow_sql_diagnosis, allow_sql_knowledge_retrieval=settings.allow_sql_knowledge_retrieval, **query_cache, ), chart_service=services.ChartService( pipelines={ "sql_executor": _sql_executor_pipeline, "chart_generation": generation.ChartGeneration( **pipe_components["chart_generation"], ), }, **query_cache, ), chart_adjustment_service=services.ChartAdjustmentService( pipelines={ "sql_executor": _sql_executor_pipeline, "chart_adjustment": generation.ChartAdjustment( **pipe_components["chart_adjustment"], ), }, **query_cache, ), sql_answer_service=services.SqlAnswerService( pipelines={ "preprocess_sql_data": retrieval.PreprocessSqlData( **pipe_components["preprocess_sql_data"], ), "sql_answer": generation.SQLAnswer( **pipe_components["sql_answer"], ), }, **query_cache, ), relationship_recommendation=services.RelationshipRecommendation( pipelines={ "relationship_recommendation": generation.RelationshipRecommendation( **pipe_components["relationship_recommendation"], ) }, **query_cache, ), question_recommendation=services.QuestionRecommendation( pipelines={ "question_recommendation": generation.QuestionRecommendation( **pipe_components["question_recommendation"], ), "db_schema_retrieval": _db_schema_retrieval_pipeline, "sql_generation": generation.SQLGeneration( **pipe_components["question_recommendation_sql_generation"], ), "sql_pairs_retrieval": _sql_pair_retrieval_pipeline, "instructions_retrieval": _instructions_retrieval_pipeline, "sql_functions_retrieval": _sql_functions_retrieval_pipeline, "sql_knowledge_retrieval": retrieval.SqlKnowledges( **pipe_components["sql_knowledge_retrieval"], ), }, allow_sql_functions_retrieval=settings.allow_sql_functions_retrieval, allow_sql_knowledge_retrieval=settings.allow_sql_knowledge_retrieval, **query_cache, ), sql_pairs_service=services.SqlPairsService( pipelines={ "sql_pairs": _sql_pair_indexing_pipeline, }, **query_cache, ), sql_question_service=services.SqlQuestionService( pipelines={ "sql_question_generation": generation.SQLQuestion( **pipe_components["sql_question_generation"], ) }, **query_cache, ), instructions_service=services.InstructionsService( pipelines={ "instructions_indexing": _instructions_indexing_pipeline, }, **query_cache, ), sql_correction_service=services.SqlCorrectionService( pipelines={ "sql_tables_extraction": generation.SQLTablesExtraction( **pipe_components["sql_tables_extraction"], ), "db_schema_retrieval": _db_schema_retrieval_pipeline, "sql_correction": _sql_correction_pipeline, "sql_knowledge_retrieval": retrieval.SqlKnowledges( **pipe_components["sql_knowledge_retrieval"], ), }, allow_sql_knowledge_retrieval=settings.allow_sql_knowledge_retrieval, **query_cache, ), ) # Create a dependency that will be used to access the ServiceContainer def get_service_container(): from src.__main__ import app return app.state.service_container def create_service_metadata( pipe_components: dict[str, PipelineComponent], pyproject_path: str = "pyproject.toml", ) -> ServiceMetadata: """ This service metadata is used for logging purposes and will be sent to Langfuse. """ def _get_version_from_pyproject() -> str: with open(pyproject_path, "r") as f: pyproject = toml.load(f) return pyproject["tool"]["poetry"]["version"] def _convert_pipe_metadata( llm_provider: LLMProvider, embedder_provider: EmbedderProvider, **_, ) -> dict: llm_metadata = ( { "llm_model": llm_provider.get_model(), "llm_model_kwargs": llm_provider.get_model_kwargs(), } if llm_provider else {} ) embedding_metadata = ( { "embedding_model": embedder_provider.get_model(), } if embedder_provider else {} ) return {**llm_metadata, **embedding_metadata} pipes_metadata = { pipe_name: _convert_pipe_metadata(**asdict(component)) for pipe_name, component in pipe_components.items() } service_version = _get_version_from_pyproject() logger.info(f"Service version: {service_version}") return ServiceMetadata(pipes_metadata, service_version) # Create a dependency that will be used to access the ServiceMetadata def get_service_metadata(): from src.__main__ import app return app.state.service_metadata ================================================ FILE: wren-ai-service/src/pipelines/__init__.py ================================================ ================================================ FILE: wren-ai-service/src/pipelines/common.py ================================================ import re from typing import Any, List, Optional, Tuple from haystack import Document, component def get_engine_supported_data_type(data_type: str) -> str: """ This function makes sure downstream ai pipeline get column data types in a format that is supported by the data engine. """ match data_type.upper(): case "BPCHAR" | "NAME" | "UUID" | "INET": return "VARCHAR" case "OID": return "INT" case "BIGNUMERIC": return "NUMERIC" case "BYTES": return "BYTEA" case "DATETIME": return "TIMESTAMP" case "FLOAT64": return "DOUBLE" case "INT64": return "BIGINT" case _: return data_type.upper() def build_table_ddl( content: dict, columns: Optional[set[str]] = None, tables: Optional[set[str]] = None ) -> Tuple[str, bool, bool]: columns_ddl = [] has_calculated_field = False has_json_field = False for column in content["columns"]: if column["type"] == "COLUMN": if ( (not columns or (columns and column["name"] in columns)) and column["data_type"].lower() != "unknown" # quick fix: filtering out UNKNOWN column type ): if "This column is a Calculated Field" in column["comment"]: has_calculated_field = True if column["data_type"].lower() == "json": has_json_field = True column_ddl = f"{column['comment']}{column['name']} {get_engine_supported_data_type(column['data_type'])}" if column["is_primary_key"]: column_ddl += " PRIMARY KEY" columns_ddl.append(column_ddl) elif column["type"] == "FOREIGN_KEY": if not tables or (tables and set(column["tables"]).issubset(tables)): columns_ddl.append(f"{column['comment']}{column['constraint']}") return ( ( f"{content['comment']}CREATE TABLE {content['name']} (\n " + ",\n ".join(columns_ddl) + "\n);" ), has_calculated_field, has_json_field, ) async def retrieve_metadata(project_id: str, retriever) -> dict[str, Any]: filters = None if project_id: filters = { "operator": "AND", "conditions": [ {"field": "project_id", "operator": "==", "value": project_id}, ], } result = await retriever.run(query_embedding=[], filters=filters) documents = result["documents"] # only one document for a project, thus we can return the first one if documents: doc = documents[0] return doc.meta else: return {} @component class ScoreFilter: @component.output_types( documents=List[Document], ) def run( self, documents: List[Document], score: float = 0.9, max_size: int = 10, ): return { "documents": sorted( filter(lambda document: document.score >= score, documents), key=lambda document: document.score, reverse=True, )[:max_size] } MULTIPLE_NEW_LINE_REGEX = re.compile(r"\n{3,}") def clean_up_new_lines(text: str) -> str: return MULTIPLE_NEW_LINE_REGEX.sub("\n\n\n", text) ================================================ FILE: wren-ai-service/src/pipelines/generation/__init__.py ================================================ from .chart_adjustment import ChartAdjustment from .chart_generation import ChartGeneration from .data_assistance import DataAssistance from .followup_sql_generation import FollowUpSQLGeneration from .followup_sql_generation_reasoning import FollowUpSQLGenerationReasoning from .intent_classification import IntentClassification from .misleading_assistance import MisleadingAssistance from .question_recommendation import QuestionRecommendation from .relationship_recommendation import RelationshipRecommendation from .semantics_description import SemanticsDescription from .sql_answer import SQLAnswer from .sql_correction import SQLCorrection from .sql_diagnosis import SQLDiagnosis from .sql_generation import SQLGeneration from .sql_generation_reasoning import SQLGenerationReasoning from .sql_question import SQLQuestion from .sql_regeneration import SQLRegeneration from .sql_tables_extraction import SQLTablesExtraction from .user_guide_assistance import UserGuideAssistance __all__ = [ "ChartGeneration", "ChartAdjustment", "DataAssistance", "FollowUpSQLGeneration", "IntentClassification", "QuestionRecommendation", "RelationshipRecommendation", "SemanticsDescription", "SQLAnswer", "SQLCorrection", "SQLDiagnosis", "SQLGeneration", "SQLGenerationReasoning", "UserGuideAssistance", "SQLQuestion", "SQLRegeneration", "FollowUpSQLGenerationReasoning", "MisleadingAssistance", "SQLTablesExtraction", ] ================================================ FILE: wren-ai-service/src/pipelines/generation/chart_adjustment.py ================================================ import logging import sys from typing import Any, Dict import orjson from hamilton import base from hamilton.async_driver import AsyncDriver from haystack.components.builders.prompt_builder import PromptBuilder from langfuse.decorators import observe from src.core.pipeline import BasicPipeline from src.core.provider import LLMProvider from src.pipelines.common import clean_up_new_lines from src.pipelines.generation.utils.chart import ( ChartDataPreprocessor, ChartGenerationPostProcessor, ChartGenerationResults, chart_generation_instructions, ) from src.utils import trace_cost from src.web.v1.services.chart_adjustment import ChartAdjustmentOption logger = logging.getLogger("wren-ai-service") chart_adjustment_system_prompt = f""" ### TASK ### You are a data analyst great at visualizing data using vega-lite! Given the user's question, SQL, sample data, sample column values, original vega-lite schema and adjustment options, you need to re-generate vega-lite schema in JSON and provide suitable chart type. Besides, you need to give a concise and easy-to-understand reasoning to describe why you provide such vega-lite schema based on the question, SQL, sample data, sample column values, original vega-lite schema and adjustment options. {chart_generation_instructions} - If you think the adjustment options are not suitable for the data, you can return an empty string for the schema and chart type and give reasoning to explain why. ### OUTPUT FORMAT ### Please provide your chain of thought reasoning, chart type and the vega-lite schema in JSON format. {{ "reasoning": , "chart_type": "line" | "multi_line" | "bar" | "pie" | "grouped_bar" | "stacked_bar" | "area" | "", "chart_schema": }} """ chart_adjustment_user_prompt_template = """ ### INPUT ### Original Question: {{ query }} Original SQL: {{ sql }} Original Vega-Lite Schema: {{ chart_schema }} Sample Data: {{ sample_data }} Sample Column Values: {{ sample_column_values }} Language: {{ language }} Adjustment Options: - Chart Type: {{ adjustment_option.chart_type }} {% if adjustment_option.chart_type != "pie" %} {% if adjustment_option.x_axis %} - X Axis: {{ adjustment_option.x_axis }} {% endif %} {% if adjustment_option.y_axis %} - Y Axis: {{ adjustment_option.y_axis }} {% endif %} {% endif %} {% if adjustment_option.x_offset and adjustment_option.chart_type == "grouped_bar" %} - X Offset: {{ adjustment_option.x_offset }} {% endif %} {% if adjustment_option.color and adjustment_option.chart_type != "area" %} - Color: {{ adjustment_option.color }} {% endif %} {% if adjustment_option.theta and adjustment_option.chart_type == "pie" %} - Theta: {{ adjustment_option.theta }} {% endif %} Please think step by step """ ## Start of Pipeline @observe(capture_input=False) def preprocess_data( data: Dict[str, Any], chart_data_preprocessor: ChartDataPreprocessor ) -> dict: return chart_data_preprocessor.run(data) @observe(capture_input=False) def prompt( query: str, sql: str, adjustment_option: ChartAdjustmentOption, chart_schema: dict, preprocess_data: dict, language: str, prompt_builder: PromptBuilder, ) -> dict: sample_data = preprocess_data.get("sample_data") sample_column_values = preprocess_data.get("sample_column_values") _prompt = prompt_builder.run( query=query, sql=sql, adjustment_option=adjustment_option, chart_schema=chart_schema, sample_data=sample_data, sample_column_values=sample_column_values, language=language, ) return {"prompt": clean_up_new_lines(_prompt.get("prompt"))} @observe(as_type="generation", capture_input=False) @trace_cost async def generate_chart_adjustment( prompt: dict, generator: Any, generator_name: str, ) -> dict: return await generator(prompt=prompt.get("prompt")), generator_name @observe(capture_input=False) def post_process( generate_chart_adjustment: dict, vega_schema: Dict[str, Any], preprocess_data: dict, post_processor: ChartGenerationPostProcessor, ) -> dict: return post_processor.run( generate_chart_adjustment.get("replies"), vega_schema, preprocess_data["sample_data"], ) ## End of Pipeline CHART_ADJUSTMENT_MODEL_KWARGS = { "response_format": { "type": "json_schema", "json_schema": { "name": "chart_adjustment_results", "schema": ChartGenerationResults.model_json_schema(), }, } } class ChartAdjustment(BasicPipeline): def __init__( self, llm_provider: LLMProvider, **kwargs, ): self._components = { "prompt_builder": PromptBuilder( template=chart_adjustment_user_prompt_template ), "generator": llm_provider.get_generator( system_prompt=chart_adjustment_system_prompt, generation_kwargs=CHART_ADJUSTMENT_MODEL_KWARGS, ), "generator_name": llm_provider.get_model(), "chart_data_preprocessor": ChartDataPreprocessor(), "post_processor": ChartGenerationPostProcessor(), } with open("src/pipelines/generation/utils/vega-lite-schema-v5.json", "r") as f: _vega_schema = orjson.loads(f.read()) self._configs = { "vega_schema": _vega_schema, } super().__init__( AsyncDriver({}, sys.modules[__name__], result_builder=base.DictResult()) ) @observe(name="Chart Adjustment") async def run( self, query: str, sql: str, adjustment_option: ChartAdjustmentOption, chart_schema: dict, data: dict, language: str, ) -> dict: logger.info("Chart Adjustment pipeline is running...") return await self._pipe.execute( ["post_process"], inputs={ "query": query, "sql": sql, "adjustment_option": adjustment_option, "chart_schema": chart_schema, "data": data, "language": language, **self._components, **self._configs, }, ) ================================================ FILE: wren-ai-service/src/pipelines/generation/chart_generation.py ================================================ import logging import sys from typing import Any, Dict, Optional import orjson from hamilton import base from hamilton.async_driver import AsyncDriver from haystack.components.builders.prompt_builder import PromptBuilder from langfuse.decorators import observe from src.core.pipeline import BasicPipeline from src.core.provider import LLMProvider from src.pipelines.common import clean_up_new_lines from src.pipelines.generation.utils.chart import ( ChartDataPreprocessor, ChartGenerationPostProcessor, ChartGenerationResults, chart_generation_instructions, ) from src.utils import trace_cost logger = logging.getLogger("wren-ai-service") chart_generation_system_prompt = f""" ### TASK ### You are a data analyst great at visualizing data using vega-lite! Given the user's question, SQL, sample data and sample column values, you need to generate vega-lite schema in JSON and provide suitable chart type. Besides, you need to give a concise and easy-to-understand reasoning to describe why you provide such vega-lite schema based on the question, SQL, sample data and sample column values. {chart_generation_instructions} - If the user provides a custom instruction, it should be followed strictly and you should use it to change the style of response for reasoning. ### OUTPUT FORMAT ### Please provide your chain of thought reasoning, chart type and the vega-lite schema in JSON format. {{ "reasoning": , "chart_type": "line" | "multi_line" | "bar" | "pie" | "grouped_bar" | "stacked_bar" | "area" | "", "chart_schema": }} """ chart_generation_user_prompt_template = """ ### INPUT ### Question: {{ query }} SQL: {{ sql }} Sample Data: {{ sample_data }} Sample Column Values: {{ sample_column_values }} Language: {{ language }} Custom Instruction: {{ custom_instruction }} Please think step by step """ ## Start of Pipeline @observe(capture_input=False) def preprocess_data( data: Dict[str, Any], chart_data_preprocessor: ChartDataPreprocessor ) -> dict: return chart_data_preprocessor.run(data) @observe(capture_input=False) def prompt( query: str, sql: str, preprocess_data: dict, language: str, custom_instruction: str, prompt_builder: PromptBuilder, ) -> dict: sample_data = preprocess_data.get("sample_data") sample_column_values = preprocess_data.get("sample_column_values") _prompt = prompt_builder.run( query=query, sql=sql, sample_data=sample_data, sample_column_values=sample_column_values, language=language, custom_instruction=custom_instruction, ) return {"prompt": clean_up_new_lines(_prompt.get("prompt"))} @observe(as_type="generation", capture_input=False) @trace_cost async def generate_chart(prompt: dict, generator: Any, generator_name: str) -> dict: return await generator(prompt=prompt.get("prompt")), generator_name @observe(capture_input=False) def post_process( generate_chart: dict, vega_schema: Dict[str, Any], remove_data_from_chart_schema: bool, preprocess_data: dict, post_processor: ChartGenerationPostProcessor, ) -> dict: return post_processor.run( generate_chart.get("replies"), vega_schema, preprocess_data["sample_data"], remove_data_from_chart_schema, ) ## End of Pipeline CHART_GENERATION_MODEL_KWARGS = { "response_format": { "type": "json_schema", "json_schema": { "name": "chart_generation_schema", "schema": ChartGenerationResults.model_json_schema(), }, } } class ChartGeneration(BasicPipeline): def __init__( self, llm_provider: LLMProvider, **kwargs, ): self._components = { "prompt_builder": PromptBuilder( template=chart_generation_user_prompt_template ), "generator": llm_provider.get_generator( system_prompt=chart_generation_system_prompt, generation_kwargs=CHART_GENERATION_MODEL_KWARGS, ), "generator_name": llm_provider.get_model(), "chart_data_preprocessor": ChartDataPreprocessor(), "post_processor": ChartGenerationPostProcessor(), } with open("src/pipelines/generation/utils/vega-lite-schema-v5.json", "r") as f: _vega_schema = orjson.loads(f.read()) self._configs = { "vega_schema": _vega_schema, } super().__init__( AsyncDriver({}, sys.modules[__name__], result_builder=base.DictResult()) ) @observe(name="Chart Generation") async def run( self, query: str, sql: str, data: dict, language: str, remove_data_from_chart_schema: bool = True, custom_instruction: Optional[str] = None, ) -> dict: logger.info("Chart Generation pipeline is running...") return await self._pipe.execute( ["post_process"], inputs={ "query": query, "sql": sql, "data": data, "language": language, "remove_data_from_chart_schema": remove_data_from_chart_schema, "custom_instruction": custom_instruction or "", **self._components, **self._configs, }, ) ================================================ FILE: wren-ai-service/src/pipelines/generation/data_assistance.py ================================================ import asyncio import logging import sys from typing import Any, Optional from hamilton import base from hamilton.async_driver import AsyncDriver from haystack.components.builders.prompt_builder import PromptBuilder from langfuse.decorators import observe from src.core.pipeline import BasicPipeline from src.core.provider import LLMProvider from src.pipelines.common import clean_up_new_lines from src.utils import trace_cost from src.web.v1.services.ask import AskHistory logger = logging.getLogger("wren-ai-service") data_assistance_system_prompt = """ ### TASK ### You are a data analyst great at answering user's questions about given database schema. Please carefully read user's question and database schema to answer it in easy to understand manner using the Markdown format. Your goal is to help guide user understand its database! ### INSTRUCTIONS ### - Answer must be in the same language user specified. - There should be proper line breaks, whitespace, and Markdown formatting(headers, lists, tables, etc.) in your response. - If the language is Traditional/Simplified Chinese, Korean, or Japanese, the maximum response length is 150 words; otherwise, the maximum response length is 110 words. - MUST NOT add SQL code in your response. - If the user provides a custom instruction, it should be followed strictly and you should use it to change the style of response. ### OUTPUT FORMAT ### Please provide your response in proper Markdown format without ```markdown``` tags. """ data_assistance_user_prompt_template = """ ### DATABASE SCHEMA ### {% for db_schema in db_schemas %} {{ db_schema }} {% endfor %} ### INPUT ### User's question: {{query}} Language: {{language}} Custom Instruction: {{ custom_instruction }} Please think step by step """ ## Start of Pipeline @observe(capture_input=False) def prompt( query: str, db_schemas: list[str], language: str, histories: list[AskHistory], prompt_builder: PromptBuilder, custom_instruction: str, ) -> dict: previous_query_summaries = ( [history.question for history in histories] if histories else [] ) query = "\n".join(previous_query_summaries) + "\n" + query _prompt = prompt_builder.run( query=query, db_schemas=db_schemas, language=language, custom_instruction=custom_instruction, ) return {"prompt": clean_up_new_lines(_prompt.get("prompt"))} @observe(as_type="generation", capture_input=False) @trace_cost async def data_assistance( prompt: dict, generator: Any, query_id: str, generator_name: str ) -> dict: return await generator( prompt=prompt.get("prompt"), query_id=query_id, ), generator_name ## End of Pipeline class DataAssistance(BasicPipeline): def __init__( self, llm_provider: LLMProvider, **kwargs, ): self._user_queues = {} self._components = { "generator": llm_provider.get_generator( system_prompt=data_assistance_system_prompt, streaming_callback=self._streaming_callback, ), "generator_name": llm_provider.get_model(), "prompt_builder": PromptBuilder( template=data_assistance_user_prompt_template ), } super().__init__( AsyncDriver({}, sys.modules[__name__], result_builder=base.DictResult()) ) def _streaming_callback(self, chunk, query_id): if query_id not in self._user_queues: self._user_queues[ query_id ] = asyncio.Queue() # Create a new queue for the user if it doesn't exist # Put the chunk content into the user's queue asyncio.create_task(self._user_queues[query_id].put(chunk.content)) if chunk.meta.get("finish_reason"): asyncio.create_task(self._user_queues[query_id].put("")) async def get_streaming_results(self, query_id): async def _get_streaming_results(query_id): return await self._user_queues[query_id].get() if query_id not in self._user_queues: self._user_queues[ query_id ] = asyncio.Queue() # Ensure the user's queue exists while True: try: # Wait for an item from the user's queue self._streaming_results = await asyncio.wait_for( _get_streaming_results(query_id), timeout=120 ) if ( self._streaming_results == "" ): # Check for end-of-stream signal del self._user_queues[query_id] break if self._streaming_results: # Check if there are results to yield yield self._streaming_results self._streaming_results = "" # Clear after yielding except TimeoutError: break @observe(name="Data Assistance") async def run( self, query: str, db_schemas: list[str], language: str, query_id: Optional[str] = None, histories: Optional[list[AskHistory]] = None, custom_instruction: Optional[str] = None, ): logger.info("Data Assistance pipeline is running...") return await self._pipe.execute( ["data_assistance"], inputs={ "query": query, "db_schemas": db_schemas, "language": language, "query_id": query_id or "", "histories": histories or [], "custom_instruction": custom_instruction or "", **self._components, }, ) ================================================ FILE: wren-ai-service/src/pipelines/generation/followup_sql_generation.py ================================================ import logging import sys from typing import Any from hamilton import base from hamilton.async_driver import AsyncDriver from haystack.components.builders.prompt_builder import PromptBuilder from langfuse.decorators import observe from src.core.engine import Engine from src.core.pipeline import BasicPipeline from src.core.provider import DocumentStoreProvider, LLMProvider from src.pipelines.common import clean_up_new_lines, retrieve_metadata from src.pipelines.generation.utils.sql import ( SQL_GENERATION_MODEL_KWARGS, SQLGenPostProcessor, construct_ask_history_messages, construct_instructions, get_calculated_field_instructions, get_json_field_instructions, get_metric_instructions, get_sql_generation_system_prompt, ) from src.pipelines.retrieval.sql_functions import SqlFunction from src.pipelines.retrieval.sql_knowledge import SqlKnowledge from src.utils import trace_cost from src.web.v1.services.ask import AskHistory logger = logging.getLogger("wren-ai-service") text_to_sql_with_followup_user_prompt_template = """ ### TASK ### Given the following user's follow-up question and previous SQL query and summary, generate one SQL query to best answer user's question. ### DATABASE SCHEMA ### {% for document in documents %} {{ document }} {% endfor %} {% if calculated_field_instructions %} {{ calculated_field_instructions }} {% endif %} {% if metric_instructions %} {{ metric_instructions }} {% endif %} {% if json_field_instructions %} {{ json_field_instructions }} {% endif %} {% if sql_functions %} ### SQL FUNCTIONS ### {% for function in sql_functions %} {{ function }} {% endfor %} {% endif %} {% if sql_samples %} ### SQL SAMPLES ### {% for sample in sql_samples %} Summary: {{sample.summary}} SQL: {{sample.sql}} {% endfor %} {% endif %} {% if instructions %} ### USER INSTRUCTIONS ### {% for instruction in instructions %} {{ loop.index }}. {{ instruction }} {% endfor %} {% endif %} ### QUESTION ### User's Follow-up Question: {{ query }} ### REASONING PLAN ### {{ sql_generation_reasoning }} Let's think step by step. """ ## Start of Pipeline @observe(capture_input=False) def prompt( query: str, documents: list[str], sql_generation_reasoning: str, prompt_builder: PromptBuilder, sql_samples: list[dict] | None = None, instructions: list[dict] | None = None, has_calculated_field: bool = False, has_metric: bool = False, has_json_field: bool = False, sql_functions: list[SqlFunction] | None = None, sql_knowledge: SqlKnowledge | None = None, ) -> dict: _prompt = prompt_builder.run( query=query, documents=documents, sql_generation_reasoning=sql_generation_reasoning, instructions=construct_instructions( instructions=instructions, ), calculated_field_instructions=( get_calculated_field_instructions(sql_knowledge) if has_calculated_field else "" ), metric_instructions=( get_metric_instructions(sql_knowledge) if has_metric else "" ), json_field_instructions=( get_json_field_instructions(sql_knowledge) if has_json_field else "" ), sql_samples=sql_samples, sql_functions=sql_functions, ) return {"prompt": clean_up_new_lines(_prompt.get("prompt"))} @observe(as_type="generation", capture_input=False) @trace_cost async def generate_sql_in_followup( prompt: dict, generator: Any, histories: list[AskHistory], generator_name: str, sql_knowledge: SqlKnowledge | None = None, ) -> dict: history_messages = construct_ask_history_messages(histories) current_system_prompt = get_sql_generation_system_prompt(sql_knowledge) return await generator( prompt=prompt.get("prompt"), history_messages=history_messages, current_system_prompt=current_system_prompt, ), generator_name @observe(capture_input=False) async def post_process( generate_sql_in_followup: dict, post_processor: SQLGenPostProcessor, data_source: str, project_id: str | None = None, use_dry_plan: bool = False, allow_dry_plan_fallback: bool = True, ) -> dict: return await post_processor.run( generate_sql_in_followup.get("replies"), project_id=project_id, use_dry_plan=use_dry_plan, data_source=data_source, allow_dry_plan_fallback=allow_dry_plan_fallback, ) ## End of Pipeline class FollowUpSQLGeneration(BasicPipeline): def __init__( self, llm_provider: LLMProvider, document_store_provider: DocumentStoreProvider, engine: Engine, **kwargs, ): self._retriever = document_store_provider.get_retriever( document_store_provider.get_store("project_meta") ) self._components = { "generator": llm_provider.get_generator( system_prompt=get_sql_generation_system_prompt(None), generation_kwargs=SQL_GENERATION_MODEL_KWARGS, ), "generator_name": llm_provider.get_model(), "prompt_builder": PromptBuilder( template=text_to_sql_with_followup_user_prompt_template ), "post_processor": SQLGenPostProcessor(engine=engine), } super().__init__( AsyncDriver({}, sys.modules[__name__], result_builder=base.DictResult()) ) @observe(name="Follow-Up SQL Generation") async def run( self, query: str, contexts: list[str], sql_generation_reasoning: str, histories: list[AskHistory], sql_samples: list[dict] | None = None, instructions: list[dict] | None = None, project_id: str | None = None, has_calculated_field: bool = False, has_metric: bool = False, has_json_field: bool = False, sql_functions: list[SqlFunction] | None = None, use_dry_plan: bool = False, allow_dry_plan_fallback: bool = True, sql_knowledge: SqlKnowledge | None = None, ): logger.info("Follow-Up SQL Generation pipeline is running...") if use_dry_plan: metadata = await retrieve_metadata(project_id or "", self._retriever) else: metadata = {} return await self._pipe.execute( ["post_process"], inputs={ "query": query, "documents": contexts, "sql_generation_reasoning": sql_generation_reasoning, "histories": histories, "project_id": project_id, "sql_samples": sql_samples, "instructions": instructions, "has_calculated_field": has_calculated_field, "has_metric": has_metric, "has_json_field": has_json_field, "sql_functions": sql_functions, "use_dry_plan": use_dry_plan, "allow_dry_plan_fallback": allow_dry_plan_fallback, "data_source": metadata.get("data_source", "local_file"), "sql_knowledge": sql_knowledge, **self._components, }, ) ================================================ FILE: wren-ai-service/src/pipelines/generation/followup_sql_generation_reasoning.py ================================================ import asyncio import logging import sys from typing import Any, Optional from hamilton import base from hamilton.async_driver import AsyncDriver from haystack.components.builders.prompt_builder import PromptBuilder from langfuse.decorators import observe from src.core.pipeline import BasicPipeline from src.core.provider import LLMProvider from src.pipelines.common import clean_up_new_lines from src.pipelines.generation.utils.sql import ( construct_instructions, sql_generation_reasoning_system_prompt, ) from src.utils import trace_cost from src.web.v1.services import Configuration from src.web.v1.services.ask import AskHistory logger = logging.getLogger("wren-ai-service") sql_generation_reasoning_user_prompt_template = """ ### DATABASE SCHEMA ### {% for document in documents %} {{ document }} {% endfor %} {% if sql_samples %} ### SQL SAMPLES ### {% for sql_sample in sql_samples %} Question: {{sql_sample.question}} SQL: {{sql_sample.sql}} {% endfor %} {% endif %} {% if instructions %} ### USER INSTRUCTIONS ### {% for instruction in instructions %} {{ loop.index }}. {{ instruction }} {% endfor %} {% endif %} ### User's QUERY HISTORY ### {% for history in histories %} Question: {{ history.question }} SQL: {{ history.sql }} {% endfor %} ### QUESTION ### User's Question: {{ query }} Language: {{ language }} Current Time: {{ current_time }} Let's think step by step. """ ## Start of Pipeline @observe(capture_input=False) def prompt( query: str, documents: list[str], histories: list[AskHistory], sql_samples: list[dict], instructions: list[dict], prompt_builder: PromptBuilder, configuration: Configuration | None = Configuration(), ) -> dict: _prompt = prompt_builder.run( query=query, documents=documents, histories=histories, sql_samples=sql_samples, instructions=construct_instructions( instructions=instructions, ), language=configuration.language, current_time=configuration.show_current_time(), ) return {"prompt": clean_up_new_lines(_prompt.get("prompt"))} @observe(as_type="generation", capture_input=False) @trace_cost async def generate_sql_reasoning( prompt: dict, generator: Any, query_id: str, generator_name: str, ) -> dict: return await generator( prompt=prompt.get("prompt"), query_id=query_id, ), generator_name @observe() def post_process( generate_sql_reasoning: dict, ) -> dict: return generate_sql_reasoning.get("replies")[0] ## End of Pipeline class FollowUpSQLGenerationReasoning(BasicPipeline): def __init__( self, llm_provider: LLMProvider, **kwargs, ): self._user_queues = {} self._components = { "generator": llm_provider.get_generator( system_prompt=sql_generation_reasoning_system_prompt, streaming_callback=self._streaming_callback, ), "generator_name": llm_provider.get_model(), "prompt_builder": PromptBuilder( template=sql_generation_reasoning_user_prompt_template ), } super().__init__( AsyncDriver({}, sys.modules[__name__], result_builder=base.DictResult()) ) def _streaming_callback(self, chunk, query_id): if query_id not in self._user_queues: self._user_queues[query_id] = asyncio.Queue() # Put the chunk content into the user's queue asyncio.create_task(self._user_queues[query_id].put(chunk.content)) if chunk.meta.get("finish_reason"): asyncio.create_task(self._user_queues[query_id].put("")) async def get_streaming_results(self, query_id): async def _get_streaming_results(query_id): return await self._user_queues[query_id].get() if query_id not in self._user_queues: self._user_queues[query_id] = asyncio.Queue() while True: try: # Wait for an item from the user's queue self._streaming_results = await asyncio.wait_for( _get_streaming_results(query_id), timeout=120 ) if ( self._streaming_results == "" ): # Check for end-of-stream signal del self._user_queues[query_id] break if self._streaming_results: # Check if there are results to yield yield self._streaming_results self._streaming_results = "" # Clear after yielding except TimeoutError: break @observe(name="FollowupSQL Generation Reasoning") async def run( self, query: str, contexts: list[str], histories: list[AskHistory], sql_samples: Optional[list[dict]] = None, instructions: Optional[list[dict]] = None, configuration: Configuration = Configuration(), query_id: Optional[str] = None, ): logger.info("Followup SQL Generation Reasoning pipeline is running...") return await self._pipe.execute( ["post_process"], inputs={ "query": query, "documents": contexts, "histories": histories, "sql_samples": sql_samples or [], "instructions": instructions or [], "configuration": configuration, "query_id": query_id, **self._components, }, ) ================================================ FILE: wren-ai-service/src/pipelines/generation/intent_classification.py ================================================ import ast import logging import sys from typing import Any, Literal, Optional import orjson from hamilton import base from hamilton.async_driver import AsyncDriver from haystack import Document from haystack.components.builders.prompt_builder import PromptBuilder from langfuse.decorators import observe from pydantic import BaseModel from src.core.pipeline import BasicPipeline from src.core.provider import DocumentStoreProvider, EmbedderProvider, LLMProvider from src.pipelines.common import build_table_ddl, clean_up_new_lines from src.pipelines.generation.utils.sql import construct_instructions from src.utils import trace_cost from src.web.v1.services import Configuration from src.web.v1.services.ask import AskHistory logger = logging.getLogger("wren-ai-service") intent_classification_system_prompt = """ ### Task ### You are an expert detective specializing in intent classification. Combine the user's current question and previous questions to determine their true intent based on the provided database schema. Classify the intent into one of these categories: `MISLEADING_QUERY`, `TEXT_TO_SQL`, `GENERAL`, or `USER_GUIDE`. Additionally, provide a concise reasoning (maximum 20 words) for your classification. ### Instructions ### - **Follow the user's previous questions:** If there are previous questions, try to understand the user's current question as following the previous questions. - **Follow the user's instructions:** If there are instructions, strictly follow the instructions. - **Consider Context of Inputs:** Combine the user's current question, their previous questions, and the user's instructions together to identify the user's true intent. - **Rephrase Question:** Rewrite follow-up questions into full standalone questions using prior conversation context. - **Concise Reasoning:** The reasoning must be clear, concise, and limited to 20 words. - **Language Consistency:** Use the same language as specified in the user's output language for the rephrased question and reasoning. - **Vague Queries:** If the question is vague or does not related to a table or property from the schema, classify it as `MISLEADING_QUERY`. - **Incomplete Queries:** If the question is related to the database schema but references unspecified values (e.g., "the following", "these", "those") without providing them, classify as `GENERAL`. - **Time-related Queries:** Don't rephrase time-related information in the user's question. ### Intent Definitions ### **When to Use:** - The user's inputs are about modifying SQL from previous questions. - The user's inputs are related to the database schema and requires an SQL query. - The question (or related previous query) includes references to specific tables, columns, or data details. - The question includes **complete information** with specific tables, columns, or data values needed for execution. - The question provides **all necessary parameters** to generate executable SQL. **Requirements:** - Must have complete filter criteria, specific values, or clear references to previous context. - Include specific table and column names from the schema in your reasoning or modifying SQL from previous questions. - Reference phrases from the user's inputs that clearly relate to the schema. **Examples:** - "What is the total sales for last quarter?" - "Show me all customers who purchased product X." - "List the top 10 products by revenue." **When to Use:** - The user seeks general information about the database schema or its overall capabilities. - The query references **missing information** (e.g., "the following items" without listing them). - The query contains **placeholder references** that cannot be resolved from context. - The query is **incomplete for SQL generation** despite mentioning database concepts. **Requirements:** - Incorporate phrases from the user's inputs that indicate incompleteness or lack of relevance to the database schema. - Identify missing parameters, unspecified references, or incomplete filter criteria. **Examples:** - "What is the dataset about?" - "Tell me more about the database." - "How can I analyze customer behavior with this data?" - "Show me orders for these products" (without specifying which products) - "Filter by the criteria I mentioned" (without previous context defining criteria) **When to Use:** - The user's inputs pertains to Wren AI's features, usage, or capabilities. - The query relates directly to content in the user guide. **Examples:** - "What can Wren AI do?" - "How can I reset a project?" - "How can I delete a project?" - "How can I connect to other databases?" - "How do I draw a chart?" **When to Use:** - The user's inputs is irrelevant to the database schema or includes SQL code. - The user's inputs lacks specific details (like table names or columns) needed to generate an SQL query. - It appears off-topic or is simply a casual conversation starter. **Requirements:** - Incorporate phrases from the user's inputs that indicate lack of relevance to the database schema. **Examples:** - "How are you?" - "What's the weather like today?" - "Tell me a joke." ### Output Format ### Return your response as a JSON object with the following structure: { "rephrased_question": "", "reasoning": "", "results": "MISLEADING_QUERY" | "TEXT_TO_SQL" | "GENERAL" | "USER_GUIDE" } """ intent_classification_user_prompt_template = """ ### DATABASE SCHEMA ### {% for db_schema in db_schemas %} {{ db_schema }} {% endfor %} {% if sql_samples %} ### SQL SAMPLES ### {% for sql_sample in sql_samples %} Question: {{sql_sample.question}} SQL: {{sql_sample.sql}} {% endfor %} {% endif %} {% if instructions %} ### USER INSTRUCTIONS ### {% for instruction in instructions %} {{ loop.index }}. {{ instruction }} {% endfor %} {% endif %} ### USER GUIDE ### {% for doc in docs %} - {{doc.path}}: {{doc.content}} {% endfor %} ### INPUT ### {% if histories %} User's previous questions: {% for history in histories %} Question: {{ history.question }} SQL: {{ history.sql }} {% endfor %} {% endif %} User's current question: {{query}} Output Language: {{ language }} Let's think step by step """ ## Start of Pipeline @observe(capture_input=False, capture_output=False) async def embedding(query: str, embedder: Any, histories: list[AskHistory]) -> dict: previous_query_summaries = ( [history.question for history in histories] if histories else [] ) query = "\n".join(previous_query_summaries) + "\n" + query return await embedder.run(query) @observe(capture_input=False) async def table_retrieval( embedding: dict, project_id: str, table_retriever: Any ) -> dict: filters = { "operator": "AND", "conditions": [ {"field": "type", "operator": "==", "value": "TABLE_DESCRIPTION"}, ], } if project_id: filters["conditions"].append( {"field": "project_id", "operator": "==", "value": project_id} ) return await table_retriever.run( query_embedding=embedding.get("embedding"), filters=filters, ) @observe(capture_input=False) async def dbschema_retrieval( table_retrieval: dict, embedding: dict, project_id: str, dbschema_retriever: Any ) -> list[Document]: tables = table_retrieval.get("documents", []) table_names = [] for table in tables: content = ast.literal_eval(table.content) table_names.append(content["name"]) logger.info(f"dbschema_retrieval with table_names: {table_names}") table_name_conditions = [ {"field": "name", "operator": "==", "value": table_name} for table_name in table_names ] filters = { "operator": "AND", "conditions": [ {"field": "type", "operator": "==", "value": "TABLE_SCHEMA"}, {"operator": "OR", "conditions": table_name_conditions}, ], } if project_id: filters["conditions"].append( {"field": "project_id", "operator": "==", "value": project_id} ) results = await dbschema_retriever.run( query_embedding=embedding.get("embedding"), filters=filters ) return results["documents"] @observe() def construct_db_schemas(dbschema_retrieval: list[Document]) -> list[str]: db_schemas = {} for document in dbschema_retrieval: content = ast.literal_eval(document.content) if content["type"] == "TABLE": if document.meta["name"] not in db_schemas: db_schemas[document.meta["name"]] = content else: db_schemas[document.meta["name"]] = { **content, "columns": db_schemas[document.meta["name"]].get("columns", []), } elif content["type"] == "TABLE_COLUMNS": if document.meta["name"] not in db_schemas: db_schemas[document.meta["name"]] = {"columns": content["columns"]} else: if "columns" not in db_schemas[document.meta["name"]]: db_schemas[document.meta["name"]]["columns"] = content["columns"] else: db_schemas[document.meta["name"]]["columns"] += content["columns"] # remove incomplete schemas db_schemas = {k: v for k, v in db_schemas.items() if "type" in v and "columns" in v} db_schemas_in_ddl = [] for table_schema in list(db_schemas.values()): if table_schema["type"] == "TABLE": ddl, _, _ = build_table_ddl(table_schema) db_schemas_in_ddl.append(ddl) return db_schemas_in_ddl @observe(capture_input=False) def prompt( query: str, wren_ai_docs: list[dict], construct_db_schemas: list[str], histories: list[AskHistory], prompt_builder: PromptBuilder, sql_samples: Optional[list[dict]] = None, instructions: Optional[list[dict]] = None, configuration: Configuration | None = None, ) -> dict: _prompt = prompt_builder.run( query=query, language=configuration.language, db_schemas=construct_db_schemas, histories=histories, sql_samples=sql_samples, instructions=construct_instructions( instructions=instructions, ), docs=wren_ai_docs, ) return {"prompt": clean_up_new_lines(_prompt.get("prompt"))} @observe(as_type="generation", capture_input=False) @trace_cost async def classify_intent(prompt: dict, generator: Any, generator_name: str) -> dict: return await generator(prompt=prompt.get("prompt")), generator_name @observe(capture_input=False) def post_process(classify_intent: dict, construct_db_schemas: list[str]) -> dict: try: results = orjson.loads(classify_intent.get("replies")[0]) return { "rephrased_question": results["rephrased_question"], "intent": results["results"], "reasoning": results["reasoning"], "db_schemas": construct_db_schemas, } except Exception: return { "rephrased_question": "", "intent": "TEXT_TO_SQL", "reasoning": "", "db_schemas": construct_db_schemas, } ## End of Pipeline class IntentClassificationResult(BaseModel): rephrased_question: str results: Literal["MISLEADING_QUERY", "TEXT_TO_SQL", "GENERAL", "USER_GUIDE"] reasoning: str INTENT_CLASSIFICAION_MODEL_KWARGS = { "response_format": { "type": "json_schema", "json_schema": { "name": "intent_classification", "schema": IntentClassificationResult.model_json_schema(), }, } } class IntentClassification(BasicPipeline): def __init__( self, llm_provider: LLMProvider, embedder_provider: EmbedderProvider, document_store_provider: DocumentStoreProvider, wren_ai_docs: list[dict], table_retrieval_size: Optional[int] = 50, table_column_retrieval_size: Optional[int] = 100, **kwargs, ): self._components = { "embedder": embedder_provider.get_text_embedder(), "table_retriever": document_store_provider.get_retriever( document_store_provider.get_store(dataset_name="table_descriptions"), top_k=table_retrieval_size, ), "dbschema_retriever": document_store_provider.get_retriever( document_store_provider.get_store(), top_k=table_column_retrieval_size, ), "generator": llm_provider.get_generator( system_prompt=intent_classification_system_prompt, generation_kwargs=INTENT_CLASSIFICAION_MODEL_KWARGS, ), "generator_name": llm_provider.get_model(), "prompt_builder": PromptBuilder( template=intent_classification_user_prompt_template ), } self._configs = { "wren_ai_docs": wren_ai_docs, } super().__init__( AsyncDriver({}, sys.modules[__name__], result_builder=base.DictResult()) ) @observe(name="Intent Classification") async def run( self, query: str, project_id: Optional[str] = None, histories: Optional[list[AskHistory]] = None, sql_samples: Optional[list[dict]] = None, instructions: Optional[list[dict]] = None, configuration: Configuration = Configuration(), ): logger.info("Intent Classification pipeline is running...") return await self._pipe.execute( ["post_process"], inputs={ "query": query, "project_id": project_id or "", "histories": histories or [], "sql_samples": sql_samples or [], "instructions": instructions or [], "configuration": configuration, **self._components, **self._configs, }, ) ================================================ FILE: wren-ai-service/src/pipelines/generation/misleading_assistance.py ================================================ import asyncio import logging import sys from typing import Any, Optional from hamilton import base from hamilton.async_driver import AsyncDriver from haystack.components.builders.prompt_builder import PromptBuilder from langfuse.decorators import observe from src.core.pipeline import BasicPipeline from src.core.provider import LLMProvider from src.pipelines.common import clean_up_new_lines from src.utils import trace_cost from src.web.v1.services.ask import AskHistory logger = logging.getLogger("wren-ai-service") misleading_assistance_system_prompt = """ ### TASK ### You are a helpful assistant that can help users understand their data better. Currently, you are given a user's question that is potentially misleading. Your goal is to help guide user understand its data better and suggest few better questions to ask. ### INSTRUCTIONS ### - Answer must be in the same language user specified in the Language section of the `### INPUT ###` section. - There should be proper line breaks, whitespace, and Markdown formatting(headers, lists, tables, etc.) in your response. - MUST NOT add SQL code in your response. - MUST consider database schema when suggesting better questions. - The maximum response length is 100 words. - If the user provides a custom instruction, it should be followed strictly and you should use it to change the style of response. ### OUTPUT FORMAT ### Please provide your response in proper Markdown format without ```markdown``` tags. """ misleading_assistance_user_prompt_template = """ ### DATABASE SCHEMA ### {% for db_schema in db_schemas %} {{ db_schema }} {% endfor %} ### INPUT ### User's question: {{query}} Language: {{language}} Custom Instruction: {{ custom_instruction }} Please think step by step """ ## Start of Pipeline @observe(capture_input=False) def prompt( query: str, db_schemas: list[str], language: str, histories: list[AskHistory], prompt_builder: PromptBuilder, custom_instruction: str, ) -> dict: previous_query_summaries = ( [history.question for history in histories] if histories else [] ) query = "\n".join(previous_query_summaries) + "\n" + query _prompt = prompt_builder.run( query=query, db_schemas=db_schemas, language=language, custom_instruction=custom_instruction, ) return {"prompt": clean_up_new_lines(_prompt.get("prompt"))} @observe(as_type="generation", capture_input=False) @trace_cost async def misleading_assistance( prompt: dict, generator: Any, query_id: str, generator_name: str ) -> dict: return await generator( prompt=prompt.get("prompt"), query_id=query_id, ), generator_name ## End of Pipeline class MisleadingAssistance(BasicPipeline): def __init__( self, llm_provider: LLMProvider, **kwargs, ): self._user_queues = {} self._components = { "generator": llm_provider.get_generator( system_prompt=misleading_assistance_system_prompt, streaming_callback=self._streaming_callback, ), "generator_name": llm_provider.get_model(), "prompt_builder": PromptBuilder( template=misleading_assistance_user_prompt_template ), } super().__init__( AsyncDriver({}, sys.modules[__name__], result_builder=base.DictResult()) ) def _streaming_callback(self, chunk, query_id): if query_id not in self._user_queues: self._user_queues[ query_id ] = asyncio.Queue() # Create a new queue for the user if it doesn't exist # Put the chunk content into the user's queue asyncio.create_task(self._user_queues[query_id].put(chunk.content)) if chunk.meta.get("finish_reason"): asyncio.create_task(self._user_queues[query_id].put("")) async def get_streaming_results(self, query_id): async def _get_streaming_results(query_id): return await self._user_queues[query_id].get() if query_id not in self._user_queues: self._user_queues[ query_id ] = asyncio.Queue() # Ensure the user's queue exists while True: try: # Wait for an item from the user's queue self._streaming_results = await asyncio.wait_for( _get_streaming_results(query_id), timeout=120 ) if ( self._streaming_results == "" ): # Check for end-of-stream signal del self._user_queues[query_id] break if self._streaming_results: # Check if there are results to yield yield self._streaming_results self._streaming_results = "" # Clear after yielding except TimeoutError: break @observe(name="Misleading Assistance") async def run( self, query: str, db_schemas: list[str], language: str, query_id: Optional[str] = None, histories: Optional[list[AskHistory]] = None, custom_instruction: Optional[str] = None, ): logger.info("Misleading Assistance pipeline is running...") return await self._pipe.execute( ["misleading_assistance"], inputs={ "query": query, "db_schemas": db_schemas, "language": language, "query_id": query_id or "", "histories": histories or [], "custom_instruction": custom_instruction or "", **self._components, }, ) ================================================ FILE: wren-ai-service/src/pipelines/generation/question_recommendation.py ================================================ import logging import sys from typing import Any import orjson from hamilton import base from hamilton.async_driver import AsyncDriver from haystack.components.builders.prompt_builder import PromptBuilder from langfuse.decorators import observe from pydantic import BaseModel from src.core.pipeline import BasicPipeline from src.core.provider import LLMProvider from src.pipelines.common import clean_up_new_lines from src.utils import trace_cost logger = logging.getLogger("wren-ai-service") system_prompt = """ You are an expert in data analysis and SQL query generation. Given a data model specification, optionally a user's question, and a list of categories, your task is to generate insightful, specific questions that can be answered using the provided data model. Each question should be accompanied by a brief explanation of its relevance or importance. ### JSON Output Structure Output all questions in the following JSON format: ```json { "questions": [ { "question": "", "category": "" }, ... ] } ``` ### Guidelines for Generating Questions 1. **If Categories Are Provided:** - **Randomly select categories** from the list and ensure no single category dominates the output. - Ensure a balanced distribution of questions across all provided categories. - For each generated question, **randomize the category selection** to avoid a fixed order. 2. **Incorporate Diverse Analysis Techniques:** - Use a mix of the following analysis techniques for each category: - **Drill-down:** Delve into detailed levels of data. - **Roll-up:** Aggregate data to higher levels. - **Slice and Dice:** Analyze data from different perspectives. - **Trend Analysis:** Identify patterns or changes over time. - **Comparative Analysis:** Compare segments, groups, or time periods. 3. **If a User Question is Provided:** - Generate questions that are closely related to the user's previous question, ensuring that the new questions build upon or provide deeper insights into the original query. - Use **random category selection** to introduce diverse perspectives while maintaining a focus on the context of the previous question. - Apply the analysis techniques above to enhance the relevance and depth of the generated questions. 4. **If No User Question is Provided:** - Ensure questions cover different aspects of the data model. - Randomly distribute questions across all categories to ensure variety. 5. **General Guidelines for All Questions:** - Ensure questions can be answered using the data model. - Mix simple and complex questions. - Avoid open-ended questions - each should have a definite answer. - Incorporate time-based analysis where relevant. - Combine multiple analysis techniques when appropriate for deeper insights. ### Categories of Questions 1. **Descriptive Questions** Summarize historical data. - Example: _"What was the total sales volume for each product last quarter?"_ 2. **Segmentation Questions** Identify meaningful data segments. - Example: _"Which customer segments contributed most to revenue growth?"_ 3. **Comparative Questions** Compare data across segments or periods. - Example: _"How did Product A perform compared to Product B last year?"_ 4. **Data Quality/Accuracy Questions** Assess data reliability and completeness. - Example: _"Are there inconsistencies in the sales records for Q1?"_ --- ### Example JSON Output ```json { "questions": [ { "question": "What was the total revenue generated by each region in the last year?", "category": "Descriptive Questions" }, { "question": "How do customer preferences differ between age groups?", "category": "Segmentation Questions" }, { "question": "How does the conversion rate vary across different lead sources?", "category": "Comparative Questions" }, { "question": "What percentage of contacts have incomplete or missing key properties (e.g., email, lifecycle stage, or deal association)", "category": "Data Quality/Accuracy Questions" } ] } ``` --- ### Additional Instructions for Randomization - **Randomize Category Order:** Ensure that categories are selected in a random order for each question generation session. - **Avoid Repetition:** Ensure the same category doesn't dominate the list by limiting the number of questions from any single category unless specified otherwise. - **Diversity of Analysis:** Combine different analysis techniques (drill-down, roll-up, etc.) within the selected categories for richer insights. - **Shuffle Categories:** If possible, shuffle the list of categories internally before generating questions to ensure varied selection. """ user_prompt_template = """ {% if previous_questions %} Previous Questions: {{previous_questions}} {% endif %} {% if categories %} Categories: {{categories}} {% endif %} {% if documents %} ### DATABASE SCHEMA ### {% for document in documents %} {{ document }} {% endfor %} {% endif %} Please generate {{max_questions}} insightful questions for each of the {{max_categories}} categories based on the provided data model. Both the questions and category names should be translated into {{language}}{% if user_question %} and be related to the user's question{% endif %}. The output format should maintain the structure but with localized text. """ ## Start of Pipeline @observe(capture_input=False) def prompt( previous_questions: list[str], documents: list, language: str, max_questions: int, max_categories: int, prompt_builder: PromptBuilder, ) -> dict: """ If previous_questions is provided, the MDL is omitted to allow the LLM to focus on generating recommendations based on the question history. This helps provide more contextually relevant questions that build on previous questions. """ _prompt = prompt_builder.run( documents=documents, previous_questions=previous_questions, language=language, max_questions=max_questions, max_categories=max_categories, ) return {"prompt": clean_up_new_lines(_prompt.get("prompt"))} @observe(as_type="generation", capture_input=False) @trace_cost async def generate(prompt: dict, generator: Any, generator_name: str) -> dict: return await generator(prompt=prompt.get("prompt")), generator_name @observe(capture_input=False) def normalized(generate: dict) -> dict: def wrapper(text: str) -> list: text = text.replace("\n", " ") text = " ".join(text.split()) try: text_list = orjson.loads(text.strip()) return text_list except orjson.JSONDecodeError as e: logger.error(f"Error decoding JSON: {e}") return [] # Return an empty list if JSON decoding fails reply = generate.get("replies")[0] # Expecting only one reply normalized = wrapper(reply) return normalized ## End of Pipeline class Question(BaseModel): question: str category: str class QuestionResult(BaseModel): questions: list[Question] QUESTION_RECOMMENDATION_MODEL_KWARGS = { "response_format": { "type": "json_schema", "json_schema": { "name": "question_recommendation", "schema": QuestionResult.model_json_schema(), }, } } class QuestionRecommendation(BasicPipeline): def __init__( self, llm_provider: LLMProvider, **_, ): self._components = { "prompt_builder": PromptBuilder(template=user_prompt_template), "generator": llm_provider.get_generator( system_prompt=system_prompt, generation_kwargs=QUESTION_RECOMMENDATION_MODEL_KWARGS, ), "generator_name": llm_provider.get_model(), } self._final = "normalized" super().__init__( AsyncDriver({}, sys.modules[__name__], result_builder=base.DictResult()) ) @observe(name="Question Recommendation") async def run( self, contexts: list[str], previous_questions: list[str] = [], categories: list[str] = [], language: str = "en", max_questions: int = 5, max_categories: int = 3, **_, ) -> dict: logger.info("Question Recommendation pipeline is running...") return await self._pipe.execute( [self._final], inputs={ "documents": contexts, "previous_questions": previous_questions, "categories": categories, "language": language, "max_questions": max_questions, "max_categories": max_categories, **self._components, }, ) ================================================ FILE: wren-ai-service/src/pipelines/generation/relationship_recommendation.py ================================================ import logging import sys from enum import Enum from typing import Any import orjson from hamilton import base from hamilton.async_driver import AsyncDriver from haystack.components.builders.prompt_builder import PromptBuilder from langfuse.decorators import observe from pydantic import BaseModel from src.core.pipeline import BasicPipeline from src.core.provider import LLMProvider from src.pipelines.common import clean_up_new_lines from src.utils import trace_cost logger = logging.getLogger("wren-ai-service") system_prompt = """ You are an expert in database schema design and relationship recommendation. Given a data model specification that includes various models and their attributes, your task is to analyze the models and suggest appropriate relationships between them, but only if there are clear and beneficial relationships to recommend. For each valid relationship, provide the following details: - **name**: A descriptive name for the relationship. - **fromModel**: The name of the source model. - **fromColumn**: The column in the source model that forms the relationship. - **type**: The type of relationship, which can be "MANY_TO_ONE", "ONE_TO_MANY" or "ONE_TO_ONE" only. - **toModel**: The name of the target model. - **toColumn**: The column in the target model that forms the relationship. - **reason**: The reason for recommending this relationship. Important guidelines: 1. Do not recommend relationships within the same model (fromModel and toModel must be different). 2. Only suggest relationships if there is a clear and beneficial reason to do so. 3. If there are no good relationships to recommend or if there are fewer than two models, return an empty list of relationships. 4. Use "MANY_TO_ONE" and "ONE_TO_MANY" instead of "MANY_TO_MANY" relationships. Output all relationships in the following JSON structure: { "relationships": [ { "name": "", "fromModel": "", "fromColumn": "", "type": "", "toModel": "", "toColumn": "", "reason": "" } ... ] } If no relationships are recommended, return: { "relationships": [] } """ user_prompt_template = """ Here is the relationship specification for my data model: {{models}} **Please analyze these models and suggest optimizations for their relationships.** Take into account best practices in database design, opportunities for normalization, indexing strategies, and any additional relationships that could improve data integrity and enhance query performance. Use this for the relationship name and reason based on the localization language: {{language}} """ ## Start of Pipeline @observe(capture_input=False) def cleaned_models(mdl: dict) -> dict: def remove_display_name(d: dict) -> dict: if "properties" in d and isinstance(d["properties"], dict): d["properties"] = d["properties"].copy() d["properties"].pop("displayName", None) return d def column_filter(columns: list[dict]) -> list[dict]: filtered_columns = [] for column in columns: if "relationship" not in column: # Create a copy of the column to avoid modifying the original filtered_column = column.copy() filtered_column = remove_display_name(filtered_column) filtered_columns.append(filtered_column) return filtered_columns return [ remove_display_name( {**model, "columns": column_filter(model.get("columns", []))} ) for model in mdl.get("models", []) ] @observe(capture_input=False) def prompt( cleaned_models: dict, prompt_builder: PromptBuilder, language: str, ) -> dict: _prompt = prompt_builder.run(models=cleaned_models, language=language) return {"prompt": clean_up_new_lines(_prompt.get("prompt"))} @observe(as_type="generation", capture_input=False) @trace_cost async def generate(prompt: dict, generator: Any, generator_name: str) -> dict: return await generator(prompt=prompt.get("prompt")), generator_name @observe(capture_input=False) def normalized(generate: dict) -> dict: def wrapper(text: str) -> str: text = text.replace("\n", " ") text = " ".join(text.split()) # Convert the normalized text to a dictionary try: text_dict = orjson.loads(text.strip()) return text_dict except orjson.JSONDecodeError as e: logger.error(f"Error decoding JSON: {e}") return {} # Return an empty dictionary if JSON decoding fails reply = generate.get("replies")[0] # Expecting only one reply normalized = wrapper(reply) return normalized @observe(capture_input=False) def validated(normalized: dict, mdl: dict) -> dict: model_columns = { model["name"]: set( [ column["name"] for column in model.get("columns", []) if not column.get("relationship") ] ) for model in mdl.get("models", []) } relationships = normalized.get("relationships", []) validated_relationships = [ relationship for relationship in relationships if RelationType.is_include(relationship.get("type")) and relationship.get("fromModel") in model_columns and relationship.get("toModel") in model_columns and relationship.get("fromColumn") in model_columns.get(relationship.get("fromModel")) and relationship.get("toColumn") in model_columns.get(relationship.get("toModel")) ] return {"relationships": validated_relationships} ## End of Pipeline class RelationType(Enum): MANY_TO_ONE = "MANY_TO_ONE" ONE_TO_MANY = "ONE_TO_MANY" ONE_TO_ONE = "ONE_TO_ONE" @classmethod def is_include(cls, value: str) -> bool: return value in cls._value2member_map_ class ModelRelationship(BaseModel): name: str fromModel: str fromColumn: str type: RelationType toModel: str toColumn: str reason: str class RelationshipResult(BaseModel): relationships: list[ModelRelationship] RELATIONSHIP_RECOMMENDATION_MODEL_KWARGS = { "response_format": { "type": "json_schema", "json_schema": { "name": "semantic_description", "schema": RelationshipResult.model_json_schema(), }, } } class RelationshipRecommendation(BasicPipeline): def __init__( self, llm_provider: LLMProvider, **_, ): self._components = { "prompt_builder": PromptBuilder(template=user_prompt_template), "generator": llm_provider.get_generator( system_prompt=system_prompt, generation_kwargs=RELATIONSHIP_RECOMMENDATION_MODEL_KWARGS, ), "generator_name": llm_provider.get_model(), } self._final = "validated" super().__init__( AsyncDriver({}, sys.modules[__name__], result_builder=base.DictResult()) ) @observe(name="Relationship Recommendation") async def run( self, mdl: dict, language: str = "English", ) -> dict: logger.info("Relationship Recommendation pipeline is running...") return await self._pipe.execute( [self._final], inputs={ "mdl": mdl, "language": language, **self._components, }, ) ================================================ FILE: wren-ai-service/src/pipelines/generation/semantics_description.py ================================================ import logging import sys from typing import Any import orjson from hamilton import base from hamilton.async_driver import AsyncDriver from haystack.components.builders.prompt_builder import PromptBuilder from langfuse.decorators import observe from pydantic import BaseModel from src.core.pipeline import BasicPipeline from src.core.provider import LLMProvider from src.pipelines.common import clean_up_new_lines from src.pipelines.indexing import clean_display_name from src.utils import trace_cost logger = logging.getLogger("wren-ai-service") system_prompt = """ I have a data model represented in JSON format, with the following structure: ``` [ {'name': 'model', 'columns': [ {'name': 'column_1', 'type': 'type', 'properties': {} }, {'name': 'column_2', 'type': 'type', 'properties': {} }, {'name': 'column_3', 'type': 'type', 'properties': {} } ], 'properties': {} } ] ``` Your task is to update this JSON structure by adding a `description` field inside both the `properties` attribute of each `column` and the `model` itself. Each `description` should be derived from a user-provided input that explains the purpose or context of the `model` and its respective columns. Follow these steps: 1. **For the `model`**: Prompt the user to provide a brief description of the model's overall purpose or its context. Insert this description in the `properties` field of the `model`. 2. **For each `column`**: Ask the user to describe each column's role or significance. Each column's description should be added under its respective `properties` field in the format: `'description': 'user-provided text'`. 3. Ensure that the output is a well-formatted JSON structure, preserving the input's original format and adding the appropriate `description` fields. ### Output Format: ``` { "models": [ { "name": "model", "columns": [ { "name": "column_1", "properties": { "description": "" } }, { "name": "column_2", "properties": { "description": "" } }, { "name": "column_3", "properties": { "description": "" } } ], "properties": { "description": "" } } ] } ``` Make sure that the descriptions are concise, informative, and contextually appropriate based on the input provided by the user. """ user_prompt_template = """ ### Input: User's prompt: {{ user_prompt }} Picked models: {{ picked_models }} Localization Language: {{ language }} Please provide a brief description for the model and each column based on the user's prompt. """ ## Start of Pipeline @observe(capture_input=False) def picked_models(mdl: dict, selected_models: list[str]) -> list[dict]: def relation_filter(column: dict) -> bool: return "relationship" not in column def column_formatter(columns: list[dict]) -> list[dict]: return [ { "name": column["name"], "type": column["type"], "properties": { "description": column["properties"].get("description", ""), "alias": clean_display_name( column["properties"].get("displayName", "") ), }, } for column in columns if relation_filter(column) ] def extract(model: dict) -> dict: return { "name": model["name"], "columns": column_formatter(model["columns"]), "properties": { "description": model["properties"].get("description", ""), "alias": clean_display_name(model["properties"].get("displayName", "")), }, } return [ extract(model) for model in mdl.get("models", []) if model.get("name", "") in selected_models ] @observe(capture_input=False) def prompt( picked_models: list[dict], user_prompt: str, prompt_builder: PromptBuilder, language: str, ) -> dict: _prompt = prompt_builder.run( picked_models=picked_models, user_prompt=user_prompt, language=language, ) return {"prompt": clean_up_new_lines(_prompt.get("prompt"))} @observe(as_type="generation", capture_input=False) @trace_cost async def generate(prompt: dict, generator: Any, generator_name: str) -> dict: return await generator(prompt=prompt.get("prompt")), generator_name @observe(capture_input=False) def normalize(generate: dict) -> dict: def wrapper(text: str) -> str: text = text.replace("\n", " ") text = " ".join(text.split()) # Convert the normalized text to a dictionary try: text_dict = orjson.loads(text.strip()) return text_dict except orjson.JSONDecodeError as e: logger.error(f"Error decoding JSON: {e}") return {"models": []} # Return an empty list if JSON decoding fails reply = generate.get("replies")[0] # Expecting only one reply normalized = wrapper(reply) return {model["name"]: model for model in normalized["models"]} @observe(capture_input=False) def output(normalize: dict, picked_models: list[dict]) -> dict: def _filter(enriched: list[dict], columns: list[dict]) -> list[dict]: valid_columns = [col["name"] for col in columns] return [col for col in enriched if col["name"] in valid_columns] models = {model["name"]: model for model in picked_models} return { name: {**data, "columns": _filter(data["columns"], models[name]["columns"])} for name, data in normalize.items() if name in models } ## End of Pipeline class ModelProperties(BaseModel): description: str class ModelColumns(BaseModel): name: str properties: ModelProperties class SemanticModel(BaseModel): name: str columns: list[ModelColumns] properties: ModelProperties class SemanticResult(BaseModel): models: list[SemanticModel] SEMANTICS_DESCRIPTION_MODEL_KWARGS = { "response_format": { "type": "json_schema", "json_schema": { "name": "semantic_description", "schema": SemanticResult.model_json_schema(), }, } } class SemanticsDescription(BasicPipeline): def __init__(self, llm_provider: LLMProvider, **_): self._components = { "prompt_builder": PromptBuilder(template=user_prompt_template), "generator": llm_provider.get_generator( system_prompt=system_prompt, generation_kwargs=SEMANTICS_DESCRIPTION_MODEL_KWARGS, ), "generator_name": llm_provider.get_model(), } self._final = "output" super().__init__( AsyncDriver({}, sys.modules[__name__], result_builder=base.DictResult()) ) @observe(name="Semantics Description Generation") async def run( self, user_prompt: str, selected_models: list[str], mdl: dict, language: str = "en", ) -> dict: logger.info("Semantics Description Generation pipeline is running...") return await self._pipe.execute( [self._final], inputs={ "user_prompt": user_prompt, "selected_models": selected_models, "mdl": mdl, "language": language, **self._components, }, ) ================================================ FILE: wren-ai-service/src/pipelines/generation/sql_answer.py ================================================ import asyncio import logging import sys from typing import Any, Optional from hamilton import base from hamilton.async_driver import AsyncDriver from haystack.components.builders.prompt_builder import PromptBuilder from langfuse.decorators import observe from src.core.pipeline import BasicPipeline from src.core.provider import LLMProvider from src.pipelines.common import clean_up_new_lines from src.utils import trace_cost from src.web.v1.services import Configuration logger = logging.getLogger("wren-ai-service") sql_to_answer_system_prompt = """ ### TASK You are a data analyst that great at answering non-technical user's questions based on the data, sql so that even non technical users can easily understand. Please answer the user's question in concise and clear manner in Markdown format. ### INSTRUCTIONS 1. Read the user's question and understand the user's intention. 2. Read the sql and understand the data. 3. Make sure the answer is aimed for non-technical users, so don't mention any technical terms such as SQL syntax. 4. Generate a concise and clear answer in string format to answerthe user's question based on the data and sql. 5. If answer is in list format, only list top few examples, and tell users there are more results omitted. 6. Answer must be in the same language user specified. 7. Do not include ```markdown or ``` in the answer. 8. If the user provides a custom instruction, it should be followed strictly and you should use it to change the style of response. ### OUTPUT FORMAT Please provide your response in proper Markdown stringformat. """ sql_to_answer_user_prompt_template = """ ### Inputs ### User's question: {{ query }} SQL: {{ sql }} Data: columns: {{ sql_data.columns }} rows: {{ sql_data.data }} Language: {{ language }} Current Time: {{ current_time }} Custom Instruction: {{ custom_instruction }} Please think step by step and answer the user's question. """ ## Start of Pipeline @observe(capture_input=False) def prompt( query: str, sql: str, sql_data: dict, language: str, current_time: str, custom_instruction: str, prompt_builder: PromptBuilder, ) -> dict: _prompt = prompt_builder.run( query=query, sql=sql, sql_data=sql_data, language=language, current_time=current_time, custom_instruction=custom_instruction, ) return {"prompt": clean_up_new_lines(_prompt.get("prompt"))} @observe(as_type="generation", capture_input=False) @trace_cost async def generate_answer( prompt: dict, generator: Any, query_id: str, generator_name: str ) -> dict: return await generator( prompt=prompt.get("prompt"), query_id=query_id ), generator_name ## End of Pipeline class SQLAnswer(BasicPipeline): def __init__( self, llm_provider: LLMProvider, **kwargs, ): self._user_queues = {} self._components = { "prompt_builder": PromptBuilder( template=sql_to_answer_user_prompt_template ), "generator": llm_provider.get_generator( system_prompt=sql_to_answer_system_prompt, streaming_callback=self._streaming_callback, ), "generator_name": llm_provider.get_model(), } super().__init__( AsyncDriver({}, sys.modules[__name__], result_builder=base.DictResult()) ) def _streaming_callback(self, chunk, query_id): if query_id not in self._user_queues: self._user_queues[ query_id ] = asyncio.Queue() # Create a new queue for the user if it doesn't exist # Put the chunk content into the user's queue asyncio.create_task(self._user_queues[query_id].put(chunk.content)) if chunk.meta.get("finish_reason"): asyncio.create_task(self._user_queues[query_id].put("")) async def get_streaming_results(self, query_id): async def _get_streaming_results(query_id): return await self._user_queues[query_id].get() if query_id not in self._user_queues: self._user_queues[ query_id ] = asyncio.Queue() # Ensure the user's queue exists while True: try: # Wait for an item from the user's queue self._streaming_results = await asyncio.wait_for( _get_streaming_results(query_id), timeout=120 ) if ( self._streaming_results == "" ): # Check for end-of-stream signal del self._user_queues[query_id] break if self._streaming_results: # Check if there are results to yield yield self._streaming_results self._streaming_results = "" # Clear after yielding except TimeoutError: break @observe(name="SQL Answer Generation") async def run( self, query: str, sql: str, sql_data: dict, language: str, current_time: str = Configuration().show_current_time(), query_id: Optional[str] = None, custom_instruction: Optional[str] = None, ) -> dict: logger.info("Sql_Answer Generation pipeline is running...") return await self._pipe.execute( ["generate_answer"], inputs={ "query": query, "sql": sql, "sql_data": sql_data, "language": language, "current_time": current_time, "query_id": query_id, "custom_instruction": custom_instruction or "", **self._components, }, ) ================================================ FILE: wren-ai-service/src/pipelines/generation/sql_correction.py ================================================ import logging import sys from typing import Any, Dict, List from hamilton import base from hamilton.async_driver import AsyncDriver from haystack import Document from haystack.components.builders.prompt_builder import PromptBuilder from langfuse.decorators import observe from src.core.engine import Engine from src.core.pipeline import BasicPipeline from src.core.provider import DocumentStoreProvider, LLMProvider from src.pipelines.common import clean_up_new_lines, retrieve_metadata from src.pipelines.generation.utils.sql import ( SQL_GENERATION_MODEL_KWARGS, SQLGenPostProcessor, construct_instructions, get_text_to_sql_rules, ) from src.pipelines.retrieval.sql_functions import SqlFunction from src.pipelines.retrieval.sql_knowledge import SqlKnowledge from src.utils import trace_cost logger = logging.getLogger("wren-ai-service") def get_sql_correction_system_prompt(sql_knowledge: SqlKnowledge | None = None) -> str: text_to_sql_rules = get_text_to_sql_rules(sql_knowledge) return f""" ### TASK ### You are an ANSI SQL expert with exceptional logical thinking skills and debugging skills, you need to fix the syntactically incorrect ANSI SQL query. ### SQL CORRECTION INSTRUCTIONS ### 1. First, think hard about the error message, and figure out the root cause first(please use the DATABASE SCHEMA, SQL FUNCTIONS and USER INSTRUCTIONS to help you figure out the root cause). 2. Then, generate the syntactically correct ANSI SQL query to correct the error. ### SQL RULES ### Make sure you follow the SQL Rules strictly. {text_to_sql_rules} ### FINAL ANSWER FORMAT ### The final answer must be in JSON format: {{ "sql": }} """ sql_correction_user_prompt_template = """ {% if documents %} ### DATABASE SCHEMA ### {% for document in documents %} {{ document }} {% endfor %} {% endif %} {% if sql_functions %} ### SQL FUNCTIONS ### {% for function in sql_functions %} {{ function }} {% endfor %} {% endif %} {% if instructions %} ### USER INSTRUCTIONS ### {% for instruction in instructions %} {{ loop.index }}. {{ instruction }} {% endfor %} {% endif %} ### QUESTION ### SQL: {{ invalid_generation_result.sql }} Error Message: {{ invalid_generation_result.error }} Let's think step by step. """ ## Start of Pipeline @observe(capture_input=False) def prompt( documents: List[Document], invalid_generation_result: Dict, prompt_builder: PromptBuilder, instructions: list[dict] | None = None, sql_functions: list[SqlFunction] | None = None, ) -> dict: _prompt = prompt_builder.run( documents=documents, invalid_generation_result=invalid_generation_result, instructions=construct_instructions( instructions=instructions, ), sql_functions=sql_functions, ) return {"prompt": clean_up_new_lines(_prompt.get("prompt"))} @observe(as_type="generation", capture_input=False) @trace_cost async def generate_sql_correction( prompt: dict, generator: Any, generator_name: str, sql_knowledge: SqlKnowledge | None = None, ) -> dict: current_system_prompt = get_sql_correction_system_prompt(sql_knowledge) return await generator( prompt=prompt.get("prompt"), current_system_prompt=current_system_prompt ), generator_name @observe(capture_input=False) async def post_process( generate_sql_correction: dict, post_processor: SQLGenPostProcessor, data_source: str, project_id: str | None = None, use_dry_plan: bool = False, allow_dry_plan_fallback: bool = True, ) -> dict: return await post_processor.run( generate_sql_correction.get("replies"), project_id=project_id, use_dry_plan=use_dry_plan, data_source=data_source, allow_dry_plan_fallback=allow_dry_plan_fallback, ) ## End of Pipeline class SQLCorrection(BasicPipeline): def __init__( self, llm_provider: LLMProvider, document_store_provider: DocumentStoreProvider, engine: Engine, **kwargs, ): self._retriever = document_store_provider.get_retriever( document_store_provider.get_store("project_meta") ) self._components = { "generator": llm_provider.get_generator( system_prompt=get_sql_correction_system_prompt(None), generation_kwargs=SQL_GENERATION_MODEL_KWARGS, ), "generator_name": llm_provider.get_model(), "prompt_builder": PromptBuilder( template=sql_correction_user_prompt_template ), "post_processor": SQLGenPostProcessor(engine=engine), } super().__init__( AsyncDriver({}, sys.modules[__name__], result_builder=base.DictResult()) ) @observe(name="SQL Correction") async def run( self, contexts: List[Document], invalid_generation_result: Dict[str, str], instructions: list[dict] | None = None, sql_functions: list[SqlFunction] | None = None, project_id: str | None = None, use_dry_plan: bool = False, allow_dry_plan_fallback: bool = True, sql_knowledge: SqlKnowledge | None = None, ): logger.info("SQLCorrection pipeline is running...") if use_dry_plan: metadata = await retrieve_metadata(project_id or "", self._retriever) else: metadata = {} return await self._pipe.execute( ["post_process"], inputs={ "invalid_generation_result": invalid_generation_result, "documents": contexts, "instructions": instructions, "sql_functions": sql_functions, "project_id": project_id, "use_dry_plan": use_dry_plan, "allow_dry_plan_fallback": allow_dry_plan_fallback, "data_source": metadata.get("data_source", "local_file"), "sql_knowledge": sql_knowledge, **self._components, }, ) ================================================ FILE: wren-ai-service/src/pipelines/generation/sql_diagnosis.py ================================================ import logging import sys from typing import Any, List import orjson from hamilton import base from hamilton.async_driver import AsyncDriver from haystack import Document from haystack.components.builders.prompt_builder import PromptBuilder from langfuse.decorators import observe from pydantic import BaseModel from src.core.pipeline import BasicPipeline from src.core.provider import LLMProvider from src.pipelines.common import clean_up_new_lines from src.utils import trace_cost logger = logging.getLogger("wren-ai-service") sql_diagnosis_system_prompt = """ ### TASK ### You are an ANSI SQL expert with exceptional logical thinking skills and debugging skills, you need to diagnose the issue with the given SQL query, error message and database schema. ### SQL DIAGNOSIS INSTRUCTIONS ### 1. First, think hard about the error message, and analyze the invalid SQL query to figure out the root cause and which part is incorrect. 2. Then, map the incorrect part of the invalid SQL query to the corresponding part of the original SQL query. 3. Then, return the reasoning behind the diagnosis.(You should give me the part of the original SQL query that is incorrect and the reason why it is incorrect) 4. Reasoning should be in the language same as the language user provided in the INPUTS section. 5. Reasoning should be concise and to the point and within 50 words. ### FINAL ANSWER FORMAT ### The final answer must be in JSON format: { "reasoning": } """ sql_diagnosis_user_prompt_template = """ ### DATABASE SCHEMA ### {% for document in documents %} {{ document }} {% endfor %} ### INPUTS ### Original SQL: {{ original_sql }} Invalid SQL: {{ invalid_sql }} Error Message: {{ error_message }} Language: {{ language }} Please think step by step. """ ## Start of Pipeline @observe(capture_input=False) def prompt( documents: List[Document], original_sql: str, invalid_sql: str, error_message: str, language: str, prompt_builder: PromptBuilder, ) -> dict: _prompt = prompt_builder.run( documents=documents, original_sql=original_sql, invalid_sql=invalid_sql, error_message=error_message, language=language, ) return {"prompt": clean_up_new_lines(_prompt.get("prompt"))} @observe(as_type="generation", capture_input=False) @trace_cost async def generate_sql_diagnosis( prompt: dict, generator: Any, generator_name: str ) -> dict: return await generator(prompt=prompt.get("prompt")), generator_name @observe(capture_input=False) async def post_process( generate_sql_diagnosis: dict, ) -> str: return orjson.loads(generate_sql_diagnosis.get("replies")[0]) ## End of Pipeline class SqlDiagnosisResult(BaseModel): reasoning: str SQL_DIAGNOSIS_MODEL_KWARGS = { "response_format": { "type": "json_schema", "json_schema": { "name": "sql_diagnosis_result", "schema": SqlDiagnosisResult.model_json_schema(), }, } } class SQLDiagnosis(BasicPipeline): def __init__( self, llm_provider: LLMProvider, **kwargs, ): self._components = { "generator": llm_provider.get_generator( system_prompt=sql_diagnosis_system_prompt, generation_kwargs=SQL_DIAGNOSIS_MODEL_KWARGS, ), "generator_name": llm_provider.get_model(), "prompt_builder": PromptBuilder( template=sql_diagnosis_user_prompt_template ), } super().__init__( AsyncDriver({}, sys.modules[__name__], result_builder=base.DictResult()) ) @observe(name="SQL Diagnosis") async def run( self, contexts: List[Document], original_sql: str, invalid_sql: str, error_message: str, language: str, ): logger.info("SQLDiagnosis pipeline is running...") return await self._pipe.execute( ["post_process"], inputs={ "documents": contexts, "original_sql": original_sql, "invalid_sql": invalid_sql, "error_message": error_message, "language": language, **self._components, }, ) ================================================ FILE: wren-ai-service/src/pipelines/generation/sql_generation.py ================================================ import logging import sys from typing import Any from hamilton import base from hamilton.async_driver import AsyncDriver from haystack.components.builders.prompt_builder import PromptBuilder from langfuse.decorators import observe from src.core.engine import Engine from src.core.pipeline import BasicPipeline from src.core.provider import DocumentStoreProvider, LLMProvider from src.pipelines.common import clean_up_new_lines, retrieve_metadata from src.pipelines.generation.utils.sql import ( SQL_GENERATION_MODEL_KWARGS, SQLGenPostProcessor, construct_instructions, get_calculated_field_instructions, get_json_field_instructions, get_metric_instructions, get_sql_generation_system_prompt, ) from src.pipelines.retrieval.sql_functions import SqlFunction from src.pipelines.retrieval.sql_knowledge import SqlKnowledge from src.utils import trace_cost logger = logging.getLogger("wren-ai-service") sql_generation_user_prompt_template = """ ### DATABASE SCHEMA ### {% for document in documents %} {{ document }} {% endfor %} {% if calculated_field_instructions %} {{ calculated_field_instructions }} {% endif %} {% if metric_instructions %} {{ metric_instructions }} {% endif %} {% if json_field_instructions %} {{ json_field_instructions }} {% endif %} {% if sql_functions %} ### SQL FUNCTIONS ### {% for function in sql_functions %} {{ function }} {% endfor %} {% endif %} {% if sql_samples %} ### SQL SAMPLES ### {% for sample in sql_samples %} Question: {{sample.question}} SQL: {{sample.sql}} {% endfor %} {% endif %} {% if instructions %} ### USER INSTRUCTIONS ### {% for instruction in instructions %} {{ loop.index }}. {{ instruction }} {% endfor %} {% endif %} ### QUESTION ### User's Question: {{ query }} {% if sql_generation_reasoning %} ### REASONING PLAN ### {{ sql_generation_reasoning }} {% endif %} Let's think step by step. """ ## Start of Pipeline @observe(capture_input=False) def prompt( query: str, documents: list[str], prompt_builder: PromptBuilder, sql_generation_reasoning: str | None = None, sql_samples: list[dict] | None = None, instructions: list[dict] | None = None, has_calculated_field: bool = False, has_metric: bool = False, has_json_field: bool = False, sql_functions: list[SqlFunction] | None = None, sql_knowledge: SqlKnowledge | None = None, ) -> dict: _prompt = prompt_builder.run( query=query, documents=documents, sql_generation_reasoning=sql_generation_reasoning, instructions=construct_instructions( instructions=instructions, ), calculated_field_instructions=( get_calculated_field_instructions(sql_knowledge) if has_calculated_field else "" ), metric_instructions=( get_metric_instructions(sql_knowledge) if has_metric else "" ), json_field_instructions=( get_json_field_instructions(sql_knowledge) if has_json_field else "" ), sql_samples=sql_samples, sql_functions=sql_functions, ) return {"prompt": clean_up_new_lines(_prompt.get("prompt"))} @observe(as_type="generation", capture_input=False) @trace_cost async def generate_sql( prompt: dict, generator: Any, generator_name: str, sql_knowledge: SqlKnowledge | None = None, ) -> dict: current_system_prompt = get_sql_generation_system_prompt(sql_knowledge) return await generator( prompt=prompt.get("prompt"), current_system_prompt=current_system_prompt ), generator_name @observe(capture_input=False) async def post_process( generate_sql: dict, post_processor: SQLGenPostProcessor, data_source: str, project_id: str | None = None, use_dry_plan: bool = False, allow_dry_plan_fallback: bool = True, allow_data_preview: bool = False, ) -> dict: return await post_processor.run( generate_sql.get("replies"), project_id=project_id, use_dry_plan=use_dry_plan, data_source=data_source, allow_dry_plan_fallback=allow_dry_plan_fallback, allow_data_preview=allow_data_preview, ) ## End of Pipeline class SQLGeneration(BasicPipeline): def __init__( self, llm_provider: LLMProvider, document_store_provider: DocumentStoreProvider, engine: Engine, **kwargs, ): self._retriever = document_store_provider.get_retriever( document_store_provider.get_store("project_meta") ) self._components = { "generator": llm_provider.get_generator( system_prompt=get_sql_generation_system_prompt(None), generation_kwargs=SQL_GENERATION_MODEL_KWARGS, ), "generator_name": llm_provider.get_model(), "prompt_builder": PromptBuilder( template=sql_generation_user_prompt_template ), "post_processor": SQLGenPostProcessor(engine=engine), } super().__init__( AsyncDriver({}, sys.modules[__name__], result_builder=base.DictResult()) ) @observe(name="SQL Generation") async def run( self, query: str, contexts: list[str], sql_generation_reasoning: str | None = None, sql_samples: list[dict] | None = None, instructions: list[dict] | None = None, project_id: str | None = None, has_calculated_field: bool = False, has_metric: bool = False, has_json_field: bool = False, sql_functions: list[SqlFunction] | None = None, use_dry_plan: bool = False, allow_dry_plan_fallback: bool = True, allow_data_preview: bool = False, sql_knowledge: SqlKnowledge | None = None, ): logger.info("SQL Generation pipeline is running...") if use_dry_plan: metadata = await retrieve_metadata(project_id or "", self._retriever) else: metadata = {} return await self._pipe.execute( ["post_process"], inputs={ "query": query, "documents": contexts, "sql_generation_reasoning": sql_generation_reasoning, "sql_samples": sql_samples, "instructions": instructions, "project_id": project_id, "has_calculated_field": has_calculated_field, "has_metric": has_metric, "has_json_field": has_json_field, "sql_functions": sql_functions, "use_dry_plan": use_dry_plan, "allow_dry_plan_fallback": allow_dry_plan_fallback, "data_source": metadata.get("data_source", "local_file"), "allow_data_preview": allow_data_preview, "sql_knowledge": sql_knowledge, **self._components, }, ) ================================================ FILE: wren-ai-service/src/pipelines/generation/sql_generation_reasoning.py ================================================ import asyncio import logging import sys from typing import Any, Optional from hamilton import base from hamilton.async_driver import AsyncDriver from haystack.components.builders.prompt_builder import PromptBuilder from langfuse.decorators import observe from src.core.pipeline import BasicPipeline from src.core.provider import LLMProvider from src.pipelines.common import clean_up_new_lines from src.pipelines.generation.utils.sql import ( construct_instructions, sql_generation_reasoning_system_prompt, ) from src.utils import trace_cost from src.web.v1.services import Configuration logger = logging.getLogger("wren-ai-service") sql_generation_reasoning_user_prompt_template = """ ### DATABASE SCHEMA ### {% for document in documents %} {{ document }} {% endfor %} {% if sql_samples %} ### SQL SAMPLES ### {% for sql_sample in sql_samples %} Question: {{sql_sample.question}} SQL: {{sql_sample.sql}} {% endfor %} {% endif %} {% if instructions %} ### USER INSTRUCTIONS ### {% for instruction in instructions %} {{ loop.index }}. {{ instruction }} {% endfor %} {% endif %} ### INPUTS ### User's Question: {{ query }} Language: {{ language }} Current Time: {{ current_time }} Let's think step by step. """ ## Start of Pipeline @observe(capture_input=False) def prompt( query: str, documents: list[str], sql_samples: list[dict], instructions: list[dict], prompt_builder: PromptBuilder, configuration: Configuration | None = Configuration(), ) -> dict: _prompt = prompt_builder.run( query=query, documents=documents, sql_samples=sql_samples, instructions=construct_instructions( instructions=instructions, ), language=configuration.language, current_time=configuration.show_current_time(), ) return {"prompt": clean_up_new_lines(_prompt.get("prompt"))} @observe(as_type="generation", capture_input=False) @trace_cost async def generate_sql_reasoning( prompt: dict, generator: Any, query_id: str, generator_name: str ) -> dict: return await generator( prompt=prompt.get("prompt"), query_id=query_id ), generator_name @observe() def post_process( generate_sql_reasoning: dict, ) -> dict: return generate_sql_reasoning.get("replies")[0] ## End of Pipeline class SQLGenerationReasoning(BasicPipeline): def __init__( self, llm_provider: LLMProvider, **kwargs, ): self._user_queues = {} self._components = { "generator": llm_provider.get_generator( system_prompt=sql_generation_reasoning_system_prompt, streaming_callback=self._streaming_callback, ), "generator_name": llm_provider.get_model(), "prompt_builder": PromptBuilder( template=sql_generation_reasoning_user_prompt_template ), } super().__init__( AsyncDriver({}, sys.modules[__name__], result_builder=base.DictResult()) ) def _streaming_callback(self, chunk, query_id): if query_id not in self._user_queues: self._user_queues[query_id] = asyncio.Queue() # Put the chunk content into the user's queue asyncio.create_task(self._user_queues[query_id].put(chunk.content)) if chunk.meta.get("finish_reason"): asyncio.create_task(self._user_queues[query_id].put("")) async def get_streaming_results(self, query_id): async def _get_streaming_results(query_id): return await self._user_queues[query_id].get() if query_id not in self._user_queues: self._user_queues[query_id] = asyncio.Queue() while True: try: # Wait for an item from the user's queue self._streaming_results = await asyncio.wait_for( _get_streaming_results(query_id), timeout=120 ) if ( self._streaming_results == "" ): # Check for end-of-stream signal del self._user_queues[query_id] break if self._streaming_results: # Check if there are results to yield yield self._streaming_results self._streaming_results = "" # Clear after yielding except TimeoutError: break @observe(name="SQL Generation Reasoning") async def run( self, query: str, contexts: list[str], sql_samples: Optional[list[dict]] = None, instructions: Optional[list[str]] = None, configuration: Configuration = Configuration(), query_id: Optional[str] = None, ): logger.info("SQL Generation Reasoning pipeline is running...") return await self._pipe.execute( ["post_process"], inputs={ "query": query, "documents": contexts, "sql_samples": sql_samples or [], "instructions": instructions or [], "configuration": configuration, "query_id": query_id, **self._components, }, ) ================================================ FILE: wren-ai-service/src/pipelines/generation/sql_question.py ================================================ import logging import sys from typing import Any import orjson from hamilton import base from hamilton.async_driver import AsyncDriver from haystack.components.builders.prompt_builder import PromptBuilder from langfuse.decorators import observe from pydantic import BaseModel from src.core.pipeline import BasicPipeline from src.core.provider import LLMProvider from src.pipelines.common import clean_up_new_lines from src.utils import trace_cost from src.web.v1.services import Configuration logger = logging.getLogger("wren-ai-service") sql_question_system_prompt = """ ### TASK ### You are a data analyst great at translating any SQL query into a question that can be answered by the given SQL query. ### INSTRUCTIONS ### - The question should be in the language of the user provided - The question should be a single sentence, concise, and easy to understand ### OUTPUT FORMAT ### Please return the result in the following JSON format: { "question": } """ sql_question_user_prompt_template = """ SQL: {{sql}} Language: {{language}} Let's think step by step. """ ## Start of Pipeline @observe(capture_input=False) def prompt( sql: str, language: str, prompt_builder: PromptBuilder, ) -> dict: _prompt = prompt_builder.run( sql=sql, language=language, ) return {"prompt": clean_up_new_lines(_prompt.get("prompt"))} @observe(as_type="generation", capture_input=False) @trace_cost async def generate_sql_question( prompt: dict, generator: Any, generator_name: str ) -> dict: return await generator(prompt=prompt.get("prompt")), generator_name @observe(capture_input=False) def post_process( generate_sql_question: dict, ) -> str: return orjson.loads(generate_sql_question.get("replies")[0])["question"] ## End of Pipeline class SQLQuestionResult(BaseModel): question: str SQL_QUESTION_MODEL_KWARGS = { "response_format": { "type": "json_schema", "json_schema": { "name": "sql_question_result", "schema": SQLQuestionResult.model_json_schema(), }, } } class SQLQuestion(BasicPipeline): def __init__( self, llm_provider: LLMProvider, **kwargs, ): self._components = { "generator": llm_provider.get_generator( system_prompt=sql_question_system_prompt, generation_kwargs=SQL_QUESTION_MODEL_KWARGS, ), "generator_name": llm_provider.get_model(), "prompt_builder": PromptBuilder(template=sql_question_user_prompt_template), } super().__init__( AsyncDriver({}, sys.modules[__name__], result_builder=base.DictResult()) ) @observe(name="Sql Question Generation") async def run( self, sql: str, configuration: Configuration = Configuration(), ): logger.info("Sql Question Generation pipeline is running...") return await self._pipe.execute( ["post_process"], inputs={ "sql": sql, "language": configuration.language or "English", **self._components, }, ) ================================================ FILE: wren-ai-service/src/pipelines/generation/sql_regeneration.py ================================================ import logging import sys from typing import Any from hamilton import base from hamilton.async_driver import AsyncDriver from haystack.components.builders.prompt_builder import PromptBuilder from langfuse.decorators import observe from src.core.engine import Engine from src.core.pipeline import BasicPipeline from src.core.provider import LLMProvider from src.pipelines.common import clean_up_new_lines from src.pipelines.generation.utils.sql import ( SQL_GENERATION_MODEL_KWARGS, SQLGenPostProcessor, construct_instructions, get_calculated_field_instructions, get_json_field_instructions, get_metric_instructions, get_text_to_sql_rules, ) from src.pipelines.retrieval.sql_functions import SqlFunction from src.pipelines.retrieval.sql_knowledge import SqlKnowledge from src.utils import trace_cost logger = logging.getLogger("wren-ai-service") def get_sql_regeneration_system_prompt( sql_knowledge: SqlKnowledge | None = None, ) -> str: text_to_sql_rules = get_text_to_sql_rules(sql_knowledge) return f""" ### TASK ### You are a great ANSI SQL expert. Now you are given database schema, SQL generation reasoning and an original SQL query, please carefully review the reasoning, and then generate a new SQL query that matches the reasoning. While generating the new SQL query, you should use the original SQL query as a reference. While generating the new SQL query, make sure to use the database schema to generate the SQL query. {text_to_sql_rules} ### FINAL ANSWER FORMAT ### The final answer must be a ANSI SQL query in JSON format: {{ "sql": }} """ sql_regeneration_user_prompt_template = """ ### DATABASE SCHEMA ### {% for document in documents %} {{ document }} {% endfor %} {% if calculated_field_instructions %} {{ calculated_field_instructions }} {% endif %} {% if metric_instructions %} {{ metric_instructions }} {% endif %} {% if json_field_instructions %} {{ json_field_instructions }} {% endif %} {% if sql_functions %} ### SQL FUNCTIONS ### {% for function in sql_functions %} {{ function }} {% endfor %} {% endif %} {% if sql_samples %} ### SQL SAMPLES ### {% for sample in sql_samples %} Question: {{sample.question}} SQL: {{sample.sql}} {% endfor %} {% endif %} {% if instructions %} ### USER INSTRUCTIONS ### {% for instruction in instructions %} {{ loop.index }}. {{ instruction }} {% endfor %} {% endif %} ### QUESTION ### SQL generation reasoning: {{ sql_generation_reasoning }} Original SQL query: {{ sql }} Let's think step by step. """ ## Start of Pipeline @observe(capture_input=False) def prompt( documents: list[str], sql_generation_reasoning: str, sql: str, prompt_builder: PromptBuilder, sql_samples: list[dict] | None = None, instructions: list[dict] | None = None, has_calculated_field: bool = False, has_metric: bool = False, has_json_field: bool = False, sql_functions: list[SqlFunction] | None = None, sql_knowledge: SqlKnowledge | None = None, ) -> dict: _prompt = prompt_builder.run( sql=sql, documents=documents, sql_generation_reasoning=sql_generation_reasoning, instructions=construct_instructions( instructions=instructions, ), calculated_field_instructions=( get_calculated_field_instructions(sql_knowledge) if has_calculated_field else "" ), metric_instructions=( get_metric_instructions(sql_knowledge) if has_metric else "" ), json_field_instructions=( get_json_field_instructions(sql_knowledge) if has_json_field else "" ), sql_samples=sql_samples, sql_functions=sql_functions, ) return {"prompt": clean_up_new_lines(_prompt.get("prompt"))} @observe(as_type="generation", capture_input=False) @trace_cost async def regenerate_sql( prompt: dict, generator: Any, generator_name: str, sql_knowledge: SqlKnowledge | None = None, ) -> dict: current_system_prompt = get_sql_regeneration_system_prompt(sql_knowledge) return await generator( prompt=prompt.get("prompt"), current_system_prompt=current_system_prompt ), generator_name @observe(capture_input=False) async def post_process( regenerate_sql: dict, post_processor: SQLGenPostProcessor, project_id: str | None = None, ) -> dict: return await post_processor.run( regenerate_sql.get("replies"), project_id=project_id, ) ## End of Pipeline class SQLRegeneration(BasicPipeline): def __init__( self, llm_provider: LLMProvider, engine: Engine, **kwargs, ): self._components = { "generator": llm_provider.get_generator( system_prompt=get_sql_regeneration_system_prompt(None), generation_kwargs=SQL_GENERATION_MODEL_KWARGS, ), "generator_name": llm_provider.get_model(), "prompt_builder": PromptBuilder( template=sql_regeneration_user_prompt_template ), "post_processor": SQLGenPostProcessor(engine=engine), } super().__init__( AsyncDriver({}, sys.modules[__name__], result_builder=base.DictResult()) ) @observe(name="SQL Regeneration") async def run( self, contexts: list[str], sql_generation_reasoning: str, sql: str, sql_samples: list[dict] | None = None, instructions: list[dict] | None = None, project_id: str | None = None, has_calculated_field: bool = False, has_metric: bool = False, has_json_field: bool = False, sql_functions: list[SqlFunction] | None = None, sql_knowledge: SqlKnowledge | None = None, ): logger.info("SQL Regeneration pipeline is running...") return await self._pipe.execute( ["post_process"], inputs={ "documents": contexts, "sql_generation_reasoning": sql_generation_reasoning, "sql": sql, "sql_samples": sql_samples, "instructions": instructions, "project_id": project_id, "has_calculated_field": has_calculated_field, "has_metric": has_metric, "has_json_field": has_json_field, "sql_functions": sql_functions, "sql_knowledge": sql_knowledge, **self._components, }, ) ================================================ FILE: wren-ai-service/src/pipelines/generation/sql_tables_extraction.py ================================================ import logging import sys from typing import Any import orjson from hamilton import base from hamilton.async_driver import AsyncDriver from haystack.components.builders.prompt_builder import PromptBuilder from langfuse.decorators import observe from pydantic import BaseModel from src.core.pipeline import BasicPipeline from src.core.provider import LLMProvider from src.pipelines.common import clean_up_new_lines from src.utils import trace_cost logger = logging.getLogger("wren-ai-service") sql_tables_extraction_system_prompt = """ ### TASK ### You are a data analyst great at extracting a list of tables from any SQL query. ### EXAMPLES ### SQL: SELECT * FROM table1 Output: { "tables": ["table1"] } SQL: SELECT * FROM table1, table2 Output: { "tables": ["table1", "table2"] } SQL: SELECT * FROM table1 JOIN table2 ON table1.id = table2.id Output: { "tables": ["table1", "table2"] } ### OUTPUT FORMAT ### Please return the result in the following JSON format: { "tables": } """ sql_tables_extraction_user_prompt_template = """ SQL: {{sql}} Let's think step by step. """ ## Start of Pipeline @observe(capture_input=False) def prompt( sql: str, prompt_builder: PromptBuilder, ) -> dict: _prompt = prompt_builder.run(sql=sql) return {"prompt": clean_up_new_lines(_prompt.get("prompt"))} @observe(as_type="generation", capture_input=False) @trace_cost async def extract_sql_tables(prompt: dict, generator: Any, generator_name: str) -> dict: return await generator(prompt=prompt.get("prompt")), generator_name @observe(capture_input=False) async def post_process( extract_sql_tables: dict, ) -> list[str]: return orjson.loads(extract_sql_tables.get("replies")[0])["tables"] ## End of Pipeline class SQLTablesExtractionResult(BaseModel): tables: list[str] SQL_TABLES_EXTRACTION_MODEL_KWARGS = { "response_format": { "type": "json_schema", "json_schema": { "name": "sql_tables_extraction_result", "schema": SQLTablesExtractionResult.model_json_schema(), }, } } class SQLTablesExtraction(BasicPipeline): def __init__( self, llm_provider: LLMProvider, **kwargs, ): self._components = { "generator": llm_provider.get_generator( system_prompt=sql_tables_extraction_system_prompt, generation_kwargs=SQL_TABLES_EXTRACTION_MODEL_KWARGS, ), "generator_name": llm_provider.get_model(), "prompt_builder": PromptBuilder( template=sql_tables_extraction_user_prompt_template ), } super().__init__( AsyncDriver({}, sys.modules[__name__], result_builder=base.DictResult()) ) @observe(name="Sql Tables Extraction") async def run( self, sql: str, ): logger.info("Sql Tables Extraction pipeline is running...") return await self._pipe.execute( ["post_process"], inputs={ "sql": sql, **self._components, }, ) ================================================ FILE: wren-ai-service/src/pipelines/generation/user_guide_assistance.py ================================================ import asyncio import logging import sys from typing import Any, Optional from hamilton import base from hamilton.async_driver import AsyncDriver from haystack.components.builders.prompt_builder import PromptBuilder from langfuse.decorators import observe from src.core.pipeline import BasicPipeline from src.core.provider import LLMProvider from src.pipelines.common import clean_up_new_lines from src.utils import trace_cost logger = logging.getLogger("wren-ai-service") user_guide_assistance_system_prompt = """ You are a helpful assistant that can help users understand Wren AI. You are given a user question and a user guide. You need to understand the user question and the user guide, and then answer the user question. ### INSTRUCTIONS ### 1. Your answer should be in the same language as the language user provided. 2. You must follow the user guide to answer the user question. 3. If you think you cannot answer the user question given the user guide, please kindly respond user that you don't find relevant answer in the user guide. 4. You should add citations to the user guide(document url) in your answer. 5. You should provide your answer in Markdown format. 6. If the user provides a custom instruction, it should be followed strictly and you should use it to change the style of response. ### OUTPUT FORMAT ### Please provide your response in proper Markdown format without ```markdown``` tags. """ user_guide_assistance_user_prompt_template = """ User Question: {{query}} Language: {{language}} User Guide: {% for doc in docs %} - {{doc.path}}: {{doc.content}} {% endfor %} Custom Instruction: {{ custom_instruction }} Please think step by step. """ ## Start of Pipeline @observe(capture_input=False) def prompt( query: str, language: str, wren_ai_docs: list[dict], prompt_builder: PromptBuilder, custom_instruction: str, ) -> dict: _prompt = prompt_builder.run( query=query, language=language, docs=wren_ai_docs, custom_instruction=custom_instruction, ) return {"prompt": clean_up_new_lines(_prompt.get("prompt"))} @observe(as_type="generation", capture_input=False) @trace_cost async def user_guide_assistance( prompt: dict, generator: Any, query_id: str, generator_name: str ) -> dict: return await generator( prompt=prompt.get("prompt"), query_id=query_id ), generator_name ## End of Pipeline class UserGuideAssistance(BasicPipeline): def __init__( self, llm_provider: LLMProvider, wren_ai_docs: list[dict], **kwargs, ): self._user_queues = {} self._components = { "generator": llm_provider.get_generator( system_prompt=user_guide_assistance_system_prompt, streaming_callback=self._streaming_callback, ), "generator_name": llm_provider.get_model(), "prompt_builder": PromptBuilder( template=user_guide_assistance_user_prompt_template ), } self._configs = { "wren_ai_docs": wren_ai_docs, } super().__init__( AsyncDriver({}, sys.modules[__name__], result_builder=base.DictResult()) ) def _streaming_callback(self, chunk, query_id): if query_id not in self._user_queues: self._user_queues[ query_id ] = asyncio.Queue() # Create a new queue for the user if it doesn't exist # Put the chunk content into the user's queue asyncio.create_task(self._user_queues[query_id].put(chunk.content)) if chunk.meta.get("finish_reason"): asyncio.create_task(self._user_queues[query_id].put("")) async def get_streaming_results(self, query_id): async def _get_streaming_results(query_id): return await self._user_queues[query_id].get() if query_id not in self._user_queues: self._user_queues[query_id] = asyncio.Queue() while True: try: # Wait for an item from the user's queue self._streaming_results = await asyncio.wait_for( _get_streaming_results(query_id), timeout=120 ) if ( self._streaming_results == "" ): # Check for end-of-stream signal del self._user_queues[query_id] break if self._streaming_results: # Check if there are results to yield yield self._streaming_results self._streaming_results = "" # Clear after yielding except TimeoutError: break @observe(name="User Guide Assistance") async def run( self, query: str, language: str, query_id: Optional[str] = None, custom_instruction: Optional[str] = None, ): logger.info("User Guide Assistance pipeline is running...") return await self._pipe.execute( ["user_guide_assistance"], inputs={ "query": query, "language": language, "query_id": query_id or "", "custom_instruction": custom_instruction or "", **self._components, **self._configs, }, ) ================================================ FILE: wren-ai-service/src/pipelines/generation/utils/chart.py ================================================ import logging from typing import Any, Dict, Literal, Optional import orjson import pandas as pd from haystack import component from jsonschema import validate from jsonschema.exceptions import ValidationError from pydantic import BaseModel, Field logger = logging.getLogger("wren-ai-service") chart_generation_instructions = """ ### INSTRUCTIONS ### - Chart types: Bar chart, Line chart, Multi line chart, Area chart, Pie chart, Stacked bar chart, Grouped bar chart - You can only use the chart types provided in the instructions - Generated chart should answer the user's question and based on the semantics of the SQL query, and the sample data, sample column values are used to help you generate the suitable chart type - If the sample data is not suitable for visualization, you must return an empty string for the schema and chart type - If the sample data is empty, you must return an empty string for the schema and chart type - The language for the chart and reasoning must be the same language provided by the user - Please use the current time provided by the user to generate the chart - In order to generate the grouped bar chart, you need to follow the given instructions: - Disable Stacking: Add "stack": null to the y-encoding. - Use xOffset for subcategories to group bars. - Don't use "transform" section. - In order to generate the pie chart, you need to follow the given instructions: - Add {"type": "arc"} to the mark section. - Add "theta" encoding to the encoding section. - Add "color" encoding to the encoding section. - Don't add "innerRadius" to the mark section. - If the x-axis of the chart is a temporal field, the time unit should be the same as the question user asked. - For yearly question, the time unit should be "year". - For monthly question, the time unit should be "yearmonth". - For weekly question, the time unit should be "yearmonthdate". - For daily question, the time unit should be "yearmonthdate". - Default time unit is "yearmonth". - For each axis, generate the corresponding human-readable title based on the language provided by the user. - Make sure all of the fields(x, y, xOffset, color, etc.) in the encoding section of the chart schema are present in the column names of the data. ### GUIDELINES TO PLOT CHART ### 1. Understanding Your Data Types - Nominal (Categorical): Names or labels without a specific order (e.g., types of fruits, countries). - Ordinal: Categorical data with a meaningful order but no fixed intervals (e.g., rankings, satisfaction levels). - Quantitative: Numerical values representing counts or measurements (e.g., sales figures, temperatures). - Temporal: Date or time data (e.g., timestamps, dates). 2. Chart Types and When to Use Them - Bar Chart - Use When: Comparing quantities across different categories. - Data Requirements: - One categorical variable (x-axis). - One quantitative variable (y-axis). - Example: Comparing sales numbers for different product categories. - Grouped Bar Chart - Use When: Comparing sub-categories within main categories. - Data Requirements: - Two categorical variables (x-axis grouped by one, color-coded by another). - One quantitative variable (y-axis). - Example: Sales numbers for different products across various regions. - Line Chart - Use When: Displaying trends over continuous data, especially time. - Data Requirements: - One temporal or ordinal variable (x-axis). - One quantitative variable (y-axis). - Example: Tracking monthly revenue over a year. - Multi Line Chart - Use When: Displaying trends over continuous data, especially time. - Data Requirements: - One temporal or ordinal variable (x-axis). - Two or more quantitative variables (y-axis and color). - Implementation Notes: - Uses `transform` with `fold` to combine multiple metrics into a single series - The folded metrics are distinguished using the color encoding - Example: Tracking monthly click rate and read rate over a year. - Area Chart - Use When: Similar to line charts but emphasizing the volume of change over time. - Data Requirements: - Same as Line Chart. - Example: Visualizing cumulative rainfall over months. - Pie Chart - Use When: Showing parts of a whole as percentages. - Data Requirements: - One categorical variable. - One quantitative variable representing proportions. - Example: Market share distribution among companies. - Stacked Bar Chart - Use When: Showing composition and comparison across categories. - Data Requirements: Same as grouped bar chart. - Example: Sales by region and product type. - Guidelines for Selecting Chart Types - Comparing Categories: - Bar Chart: Best for simple comparisons across categories. - Grouped Bar Chart: Use when you have sub-categories. - Stacked Bar Chart: Use to show composition within categories. - Showing Trends Over Time: - Line Chart: Ideal for continuous data over time. - Area Chart: Use when you want to emphasize volume or total value over time. - Displaying Proportions: - Pie Chart: Use for simple compositions at a single point in time. - Stacked Bar Chart (100%): Use for comparing compositions across multiple categories. ### EXAMPLES ### 1. Bar Chart - Sample Data: [ {"Region": "North", "Sales": 100}, {"Region": "South", "Sales": 200}, {"Region": "East", "Sales": 300}, {"Region": "West", "Sales": 400} ] - Chart Schema: { "title": , "mark": {"type": "bar"}, "encoding": { "x": {"field": "Region", "type": "nominal", "title": }, "y": {"field": "Sales", "type": "quantitative", "title": }, "color": {"field": "Region", "type": "nominal", "title": ""} } } 2. Line Chart - Sample Data: [ {"Date": "2022-01-01", "Sales": 100}, {"Date": "2022-01-02", "Sales": 200}, {"Date": "2022-01-03", "Sales": 300}, {"Date": "2022-01-04", "Sales": 400} ] - Chart Schema: { "title": , "mark": {"type": "line"}, "encoding": { "x": {"field": "Date", "type": "temporal", "title": }, "y": {"field": "Sales", "type": "quantitative", "title": } } } 3. Pie Chart - Sample Data: [ {"Company": "Company A", "Market Share": 0.4}, {"Company": "Company B", "Market Share": 0.3}, {"Company": "Company C", "Market Share": 0.2}, {"Company": "Company D", "Market Share": 0.1} ] - Chart Schema: { "title": , "mark": {"type": "arc"}, "encoding": { "theta": {"field": "Market Share", "type": "quantitative"}, "color": {"field": "Company", "type": "nominal", "title": } } } 4. Area Chart - Sample Data: [ {"Date": "2022-01-01", "Sales": 100}, {"Date": "2022-01-02", "Sales": 200}, {"Date": "2022-01-03", "Sales": 300}, {"Date": "2022-01-04", "Sales": 400} ] - Chart Schema: { "title": "", "mark": {"type": "area"}, "encoding": { "x": {"field": "Date", "type": "temporal", "title": ""}, "y": {"field": "Sales", "type": "quantitative", "title": ""} } } 5. Stacked Bar Chart - Sample Data: [ {"Region": "North", "Product": "A", "Sales": 100}, {"Region": "North", "Product": "B", "Sales": 150}, {"Region": "South", "Product": "A", "Sales": 200}, {"Region": "South", "Product": "B", "Sales": 250}, {"Region": "East", "Product": "A", "Sales": 300}, {"Region": "East", "Product": "B", "Sales": 350}, {"Region": "West", "Product": "A", "Sales": 400}, {"Region": "West", "Product": "B", "Sales": 450} ] - Chart Schema: { "title": "", "mark": {"type": "bar"}, "encoding": { "x": {"field": "Region", "type": "nominal", "title": ""}, "y": {"field": "Sales", "type": "quantitative", "title": "", "stack": "zero"}, "color": {"field": "Product", "type": "nominal", "title": ""} } } 6. Grouped Bar Chart - Sample Data: [ {"Region": "North", "Product": "A", "Sales": 100}, {"Region": "North", "Product": "B", "Sales": 150}, {"Region": "South", "Product": "A", "Sales": 200}, {"Region": "South", "Product": "B", "Sales": 250}, {"Region": "East", "Product": "A", "Sales": 300}, {"Region": "East", "Product": "B", "Sales": 350}, {"Region": "West", "Product": "A", "Sales": 400}, {"Region": "West", "Product": "B", "Sales": 450} ] - Chart Schema: { "title": "", "mark": {"type": "bar"}, "encoding": { "x": {"field": "Region", "type": "nominal", "title": ""}, "y": {"field": "Sales", "type": "quantitative", "title": ""}, "xOffset": {"field": "Product", "type": "nominal", "title": ""}, "color": {"field": "Product", "type": "nominal", "title": ""} } } 7. Multi Line Chart - Sample Data: [ {"Date": "2022-01-01", "readCount": 100, "clickCount": 10}, {"Date": "2022-01-02", "readCount": 200, "clickCount": 30}, {"Date": "2022-01-03", "readCount": 300, "clickCount": 20}, {"Date": "2022-01-04", "readCount": 400, "clickCount": 40} ] - Chart Schema: { "title": , "mark": {"type": "line"}, "transform": [ { "fold": ["readCount", "clickCount"], "as": ["Metric", "Value"] } ], "encoding": { "x": {"field": "Date", "type": "temporal", "title": }, "y": {"field": "Value", "type": "quantitative", "title": }, "color": {"field": "Metric", "type": "nominal", "title": } } } """ @component class ChartDataPreprocessor: @component.output_types( sample_data=list[dict], sample_column_values=dict[str, Any], ) def run( self, data: Dict[str, Any], sample_data_count: int = 15, sample_column_size: int = 5, ): columns = [ column.get("name", "") if isinstance(column, dict) else column for column in data.get("columns", []) ] data = data.get("data", []) df = pd.DataFrame(data, columns=columns) sample_column_values = { col: list(df[col].unique())[:sample_column_size] for col in df.columns } if len(df) > sample_data_count: sample_data = df.sample(n=sample_data_count).to_dict(orient="records") else: sample_data = df.to_dict(orient="records") return { "sample_data": sample_data, "sample_column_values": sample_column_values, } @component class ChartGenerationPostProcessor: @component.output_types( results=Dict[str, Any], ) def run( self, replies: str, vega_schema: Dict[str, Any], sample_data: list[dict], remove_data_from_chart_schema: Optional[bool] = True, ): try: generation_result = orjson.loads(replies[0]) reasoning = generation_result.get("reasoning", "") chart_type = generation_result.get("chart_type", "") if chart_schema := generation_result.get("chart_schema", {}): # sometimes the chart_schema is still in string format if isinstance(chart_schema, str): chart_schema = orjson.loads(chart_schema) chart_schema[ "$schema" ] = "https://vega.github.io/schema/vega-lite/v5.json" chart_schema["data"] = {"values": sample_data} validate(chart_schema, schema=vega_schema) if remove_data_from_chart_schema: chart_schema["data"]["values"] = [] return { "results": { "chart_schema": chart_schema, "reasoning": reasoning, "chart_type": chart_type, } } return { "results": { "chart_schema": {}, "reasoning": reasoning, "chart_type": chart_type, } } except ValidationError as e: logger.exception(f"Vega-lite schema is not valid: {e}") return { "results": { "chart_schema": {}, "reasoning": "", "chart_type": "", } } except Exception as e: logger.exception(f"JSON deserialization failed: {e}") return { "results": { "chart_schema": {}, "reasoning": "", "chart_type": "", } } class ChartSchema(BaseModel): class ChartType(BaseModel): type: Literal["bar", "line", "area", "arc"] class ChartEncoding(BaseModel): field: str type: Literal["ordinal", "quantitative", "nominal"] title: str title: str mark: ChartType encoding: ChartEncoding class TemporalChartEncoding(ChartSchema.ChartEncoding): type: Literal["temporal"] = Field(default="temporal") timeUnit: str = Field(default="yearmonth") class LineChartSchema(ChartSchema): class LineChartMark(BaseModel): type: Literal["line"] = Field(default="line") class LineChartEncoding(BaseModel): x: TemporalChartEncoding | ChartSchema.ChartEncoding y: ChartSchema.ChartEncoding color: ChartSchema.ChartEncoding mark: LineChartMark encoding: LineChartEncoding class MultiLineChartSchema(ChartSchema): class MultiLineChartMark(BaseModel): type: Literal["line"] = Field(default="line") class MultiLineChartTransform(BaseModel): fold: list[str] as_: list[str] = Field(alias="as") class MultiLineChartEncoding(BaseModel): x: TemporalChartEncoding | ChartSchema.ChartEncoding y: ChartSchema.ChartEncoding color: ChartSchema.ChartEncoding mark: MultiLineChartMark transform: list[MultiLineChartTransform] encoding: MultiLineChartEncoding class BarChartSchema(ChartSchema): class BarChartMark(BaseModel): type: Literal["bar"] = Field(default="bar") class BarChartEncoding(BaseModel): x: TemporalChartEncoding | ChartSchema.ChartEncoding y: ChartSchema.ChartEncoding color: ChartSchema.ChartEncoding mark: BarChartMark encoding: BarChartEncoding class GroupedBarChartSchema(ChartSchema): class GroupedBarChartMark(BaseModel): type: Literal["bar"] = Field(default="bar") class GroupedBarChartEncoding(BaseModel): x: TemporalChartEncoding | ChartSchema.ChartEncoding y: ChartSchema.ChartEncoding xOffset: ChartSchema.ChartEncoding color: ChartSchema.ChartEncoding mark: GroupedBarChartMark encoding: GroupedBarChartEncoding class StackedBarChartYEncoding(ChartSchema.ChartEncoding): stack: Literal["zero"] = Field(default="zero") class StackedBarChartSchema(ChartSchema): class StackedBarChartMark(BaseModel): type: Literal["bar"] = Field(default="bar") class StackedBarChartEncoding(BaseModel): x: TemporalChartEncoding | ChartSchema.ChartEncoding y: StackedBarChartYEncoding color: ChartSchema.ChartEncoding mark: StackedBarChartMark encoding: StackedBarChartEncoding class PieChartSchema(ChartSchema): class PieChartMark(BaseModel): type: Literal["arc"] = Field(default="arc") class PieChartEncoding(BaseModel): theta: ChartSchema.ChartEncoding color: ChartSchema.ChartEncoding mark: PieChartMark encoding: PieChartEncoding class AreaChartSchema(ChartSchema): class AreaChartMark(BaseModel): type: Literal["area"] = Field(default="area") class AreaChartEncoding(BaseModel): x: TemporalChartEncoding | ChartSchema.ChartEncoding y: ChartSchema.ChartEncoding mark: AreaChartMark encoding: AreaChartEncoding class ChartGenerationResults(BaseModel): reasoning: str chart_type: Literal[ "line", "multi_line", "bar", "pie", "grouped_bar", "stacked_bar", "area", "" ] # empty string for no chart chart_schema: ( LineChartSchema | MultiLineChartSchema | BarChartSchema | PieChartSchema | GroupedBarChartSchema | StackedBarChartSchema | AreaChartSchema ) ================================================ FILE: wren-ai-service/src/pipelines/generation/utils/sql.py ================================================ import logging from typing import Any, Dict, List import aiohttp import orjson from haystack import component from haystack.dataclasses import ChatMessage from pydantic import BaseModel from src.core.engine import ( Engine, clean_generation_result, ) from src.pipelines.retrieval.sql_knowledge import SqlKnowledge from src.web.v1.services.ask import AskHistory logger = logging.getLogger("wren-ai-service") @component class SQLGenPostProcessor: def __init__(self, engine: Engine): self._engine = engine @component.output_types( valid_generation_result=Dict[str, Any], invalid_generation_result=Dict[str, Any], ) async def run( self, replies: List[str] | List[List[str]], project_id: str | None = None, use_dry_plan: bool = False, allow_dry_plan_fallback: bool = True, data_source: str = "", allow_data_preview: bool = False, ) -> dict: try: cleaned_generation_result = clean_generation_result(replies[0]) # test if cleaned_generation_result in string format is actually a dictionary with key 'sql' if cleaned_generation_result.startswith("{"): cleaned_generation_result = orjson.loads(cleaned_generation_result)[ "sql" ] ( valid_generation_result, invalid_generation_result, ) = await self._classify_generation_result( cleaned_generation_result, project_id=project_id, use_dry_plan=use_dry_plan, allow_dry_plan_fallback=allow_dry_plan_fallback, data_source=data_source, allow_data_preview=allow_data_preview, ) return { "valid_generation_result": valid_generation_result, "invalid_generation_result": invalid_generation_result, } except Exception as e: logger.exception(f"Error in SQLGenPostProcessor: {e}") return { "valid_generation_result": {}, "invalid_generation_result": {}, } async def _classify_generation_result( self, generation_result: str, project_id: str | None = None, use_dry_plan: bool = False, allow_dry_plan_fallback: bool = True, data_source: str = "", allow_data_preview: bool = False, ) -> Dict[str, str]: valid_generation_result = {} invalid_generation_result = {} use_dry_run = not allow_data_preview async with aiohttp.ClientSession() as session: if use_dry_plan: dry_plan_result, error_message = await self._engine.dry_plan( session, generation_result, data_source, allow_fallback=allow_dry_plan_fallback, ) if dry_plan_result: valid_generation_result = { "sql": generation_result, "correlation_id": "", } else: invalid_generation_result = { "sql": generation_result, "type": "TIME_OUT" if error_message.startswith("Request timed out") else "DRY_PLAN", "error": error_message, "correlation_id": "", } elif use_dry_run: success, _, addition = await self._engine.execute_sql( generation_result, session, project_id=project_id, limit=1, dry_run=True, ) if success: valid_generation_result = { "sql": generation_result, "correlation_id": addition.get("correlation_id", ""), } else: error_message = addition.get("error_message", "") invalid_generation_result = { "sql": addition.get("error_sql", generation_result), "original_sql": generation_result, "type": "TIME_OUT" if error_message.startswith("Request timed out") else "DRY_RUN", "error": error_message, "correlation_id": addition.get("correlation_id", ""), } else: has_data, _, addition = await self._engine.execute_sql( generation_result, session, project_id=project_id, limit=1, dry_run=False, ) if has_data: valid_generation_result = { "sql": generation_result, "correlation_id": addition.get("correlation_id", ""), } else: error_message = addition.get("error_message", "") preview_data_status = ( "PREVIEW_EMPTY_DATA" if error_message == "" else "PREVIEW_FAILED" ) invalid_generation_result = { "sql": addition.get("error_sql", generation_result), "original_sql": generation_result, "type": "TIME_OUT" if error_message.startswith("Request timed out") else preview_data_status, "error": error_message, "correlation_id": addition.get("correlation_id", ""), } return valid_generation_result, invalid_generation_result _DEFAULT_TEXT_TO_SQL_RULES = """ ### SQL RULES ### - ONLY USE SELECT statements, NO DELETE, UPDATE OR INSERT etc. statements that might change the data in the database. - ONLY USE the tables and columns mentioned in the database schema. - ONLY USE "*" if the user query asks for all the columns of a table. - ONLY CHOOSE columns belong to the tables mentioned in the database schema. - DON'T INCLUDE comments in the generated SQL query. - YOU MUST USE "JOIN" if you choose columns from multiple tables! - PREFER USING CTEs over subqueries. - When generating SQL query, always: - Put double quotes around column and table names. - Put single quotes around string literals. - Never quote numeric literals. For example: SELECT "customers"."customer_name" FROM "customers" WHERE "customers"."city" = 'Taipei' and "customers"."year" = 1992; - YOU MUST USE "lower(.) like lower()" function or "lower(.) = lower()" function for case-insensitive comparison! - Use "lower(.) LIKE lower()" when: - The user requests a pattern or partial match. - The value is not specific enough to be a single, exact value. - Wildcards (%) are needed to capture the pattern. - Use "lower(.) = lower()" when: - The user requests an exact, specific value. - There is no ambiguity or pattern in the value. - If the column is date/time related field, and it is a INT/BIGINT/DOUBLE/FLOAT type, please use the appropriate function mentioned in the SQL FUNCTIONS section to cast the column to "TIMESTAMP" type first before using it in the query - example: TO_TIMESTAMP_MILLIS("") # if the timestamp_column is in milliseconds - example: TO_TIMESTAMP_SECONDS("") # if the timestamp_column is in seconds - example: TO_TIMESTAMP_MICROS("") # if the timestamp_column is in microseconds - ALWAYS CAST the date/time related field to "TIMESTAMP WITH TIME ZONE" type when using them in the query - example 1: CAST(properties_closedate AS TIMESTAMP WITH TIME ZONE) - example 2: CAST('2024-11-09 00:00:00' AS TIMESTAMP WITH TIME ZONE) - example 3: CAST(DATE_TRUNC('month', CURRENT_DATE - INTERVAL '1 month') AS TIMESTAMP WITH TIME ZONE) - If the user asks for a specific date, please give the date range in SQL query - example: "What is the total revenue for the month of 2024-11-01?" - answer: "SELECT SUM(r.PriceSum) FROM Revenue r WHERE CAST(r.PurchaseTimestamp AS TIMESTAMP WITH TIME ZONE) >= CAST('2024-11-01 00:00:00' AS TIMESTAMP WITH TIME ZONE) AND CAST(r.PurchaseTimestamp AS TIMESTAMP WITH TIME ZONE) < CAST('2024-11-02 00:00:00' AS TIMESTAMP WITH TIME ZONE)" - USE THE VIEW TO SIMPLIFY THE QUERY. - DON'T MISUSE THE VIEW NAME. THE ACTUAL NAME IS FOLLOWING THE CREATE VIEW STATEMENT. - ONLY USE table/column alias in the final SELECT clause; don't use table/columnalias in the other clauses. - Refer to the value of alias from the comment section of the corresponding table or column in the DATABASE SCHEMA section for reference when using alias in the final SELECT clause. - EXAMPLE DATABASE SCHEMA /* {"alias":"_orders","description":"A model representing the orders data."} */ CREATE TABLE orders ( -- {"description":"A column that represents the timestamp when the order was approved.","alias":"_timestamp"} ApprovedTimestamp TIMESTAMP } SQL SELECT "_orders"."ApprovedTimestamp" AS "_timestamp" FROM "orders" AS "_orders"; - DON'T USE '.' in column/table alias, replace '.' with '_' in column/table alias. - DON'T USE "FILTER(WHERE )" clause in the generated SQL query. - DON'T USE "EXTRACT(EPOCH FROM )" clause in the generated SQL query. - DON'T USE "EXTRACT()" function with INTERVAL data types as arguments - DON'T USE INTERVAL or generate INTERVAL-like expression in the generated SQL query. - DON'T USE "TO_CHAR" function in the generated SQL query. - Aggregate functions are not allowed in the WHERE clause. Instead, they belong in the HAVING clause, which is used to filter after aggregation. - You can only add "ORDER BY" and "LIMIT" to the final "UNION" result. - For the ranking problem, you must use the ranking function, `DENSE_RANK()` to rank the results and then use `WHERE` clause to filter the results. - For the ranking problem, you must add the ranking column to the final SELECT clause. """ _DEFAULT_CALCULATED_FIELD_INSTRUCTIONS = """ #### Instructions for Calculated Field #### The first structure is the special column marked as "Calculated Field". You need to interpret the purpose and calculation basis for these columns, then utilize them in the following text-to-sql generation tasks. First, provide a brief explanation of what each field represents in the context of the schema, including how each field is computed using the relationships between models. Then, during the following tasks, if the user queries pertain to any calculated fields defined in the database schema, ensure to utilize those calculated fields appropriately in the output SQL queries. The goal is to accurately reflect the intent of the question in the SQL syntax, leveraging the pre-computed logic embedded within the calculated fields. EXAMPLES: The given schema is created by the SQL command: CREATE TABLE orders ( OrderId VARCHAR PRIMARY KEY, CustomerId VARCHAR, -- This column is a Calculated Field -- column expression: avg(reviews.Score) Rating DOUBLE, -- This column is a Calculated Field -- column expression: count(reviews.Id) ReviewCount BIGINT, -- This column is a Calculated Field -- column expression: count(order_items.ItemNumber) Size BIGINT, -- This column is a Calculated Field -- column expression: count(order_items.ItemNumber) > 1 Large BOOLEAN, FOREIGN KEY (CustomerId) REFERENCES customers(Id) ); Interpret the columns that are marked as Calculated Fields in the schema: Rating (DOUBLE) - Calculated as the average score (avg) of the Score field from the reviews table where the reviews are associated with the order. This field represents the overall customer satisfaction rating for the order based on review scores. ReviewCount (BIGINT) - Calculated by counting (count) the number of entries in the reviews table associated with this order. It measures the volume of customer feedback received for the order. Size (BIGINT) - Represents the total number of items in the order, calculated by counting the number of item entries (ItemNumber) in the order_items table linked to this order. This field is useful for understanding the scale or size of an order. Large (BOOLEAN) - A boolean value calculated to check if the number of items in the order exceeds one (count(order_items.ItemNumber) > 1). It indicates whether the order is considered large in terms of item quantity. And if the user input queries like these: 1. "How many large orders have been placed by customer with ID 'C1234'?" 2. "What is the average customer rating for orders that were rated by more than 10 reviewers?" For the first query: First try to intepret the user query, the user wants to know the average rating for orders which have attracted significant review activity, specifically those with more than 10 reviews. Then, according to the above intepretation about the given schema, the term 'Rating' is predefined in the Calculated Field of the 'orders' model. And, the number of reviews is also predefined in the 'ReviewCount' Calculated Field. So utilize those Calculated Fields in the SQL generation process to give an answer like this: SQL Query: SELECT AVG(Rating) FROM orders WHERE ReviewCount > 10 """ _DEFAULT_METRIC_INSTRUCTIONS = """ #### Instructions for Metric #### Second, you will learn how to effectively utilize the special "metric" structure in text-to-SQL generation tasks. Metrics in a data model simplify complex data analysis by structuring data through predefined dimensions and measures. This structuring closely mirrors the concept of OLAP (Online Analytical Processing) cubes but is implemented in a more flexible and SQL-friendly manner. The metric typically constructed of the following components: 1. Base Object The "base object" of a metric indicates the primary data source or table that provides the raw data. Metrics are constructed by selecting specific data points (dimensions and measures) from this base object, effectively creating a summarized or aggregated view of the data that can be queried like a normal table. Base object is the attribute of the metric, showing the origin of this metric and is typically not used in the query. 2. Dimensions Dimensions in a metric represent the various axes along which data can be segmented for analysis. These are fields that provide a categorical breakdown of data. Each dimension provides a unique perspective on the data, allowing users to "slice and dice" the data cube to view different facets of the information contained within the base dataset. Dimensions are used as table columns in the querying process. Querying a dimension means to get the statistic from the certain perspective. 3. Measures Measures are numerical or quantitative statistics calculated from the data. Measures are key results or outputs derived from data aggregation functions like SUM, COUNT, or AVG. Measures are used as table columns in the querying process, and are the main querying items in the metric structure. The expression of a measure represents the definition of the that users are intrested in. Make sure to understand the meaning of measures from their expressions. 4. Time Grain Time Grain specifies the granularity of time-based data aggregation, such as daily, monthly, or yearly, facilitating trend analysis over specified periods. If the given schema contains the structures marked as 'metric', you should first interpret the metric schema based on the above definition. Then, during the following tasks, if the user queries pertain to any metrics defined in the database schema, ensure to utilize those metrics appropriately in the output SQL queries. The target is making complex data analysis more accessible and manageable by pre-aggregating data and structuring it using the metric structure, and supporting direct querying for business insights. EXAMPLES: The given schema is created by the SQL command: /* This table is a metric */ /* Metric Base Object: orders */ CREATE TABLE Revenue ( -- This column is a dimension PurchaseTimestamp TIMESTAMP, -- This column is a dimension CustomerId VARCHAR, -- This column is a dimension Status VARCHAR, -- This column is a measure -- expression: sum(order_items.Price) PriceSum DOUBLE, -- This column is a measure -- expression: count(OrderId) NumberOfOrders BIGINT ); Interpret the metric with the understanding of the metric structure: 1. Base Object: orders This is the primary data source for the metric. The orders table provides the underlying data from which dimensions and measures are derived. It is the foundation upon which the metric is built, though it itself is not directly used in queries against the Revenue table. It shows the reference between the 'Revenue' metric and the 'orders' model. For the user queries pretain to the 'Revenue' of 'orders', the metric should be utilize in the sql generation process. 2. Dimensions The metric contains the columns marked as 'dimension'. They can be interpreted as below: - PurchaseTimestamp (TIMESTAMP) Acts as a temporal dimension, allowing analysis of revenue over time. This can be used to observe trends, seasonal variations, or performance over specific periods. - CustomerId (VARCHAR) A key dimension for customer segmentation, it enables the analysis of revenue generated from individual customers or customer groups. - Status (VARCHAR) Reflects the current state of an order (e.g., pending, completed, cancelled). This dimension is crucial for analyses that differentiate performance based on order status. 3. Measures The metric contains the columns marked as 'measure'. They can be interpreted as below: - PriceSum (DOUBLE) A financial measure calculated as sum(order_items.Price), representing the total revenue generated from orders. This measure is vital for tracking overall sales performance and is the primary output of interest in many financial and business analyses. - NumberOfOrders (BIGINT) A count measure that provides the total number of orders. This is essential for operational metrics, such as assessing the volume of business activity and evaluating the efficiency of sales processes. Now, if the user input queries like this: Question: "What was the total revenue from each customer last month?" First try to intepret the user query, the user asks for a breakdown of the total revenue generated by each customer in the previous calendar month. The user is specifically interested in understanding how much each customer contributed to the total sales during this period. To answer this question, it is suitable to use the following components from the metric: 1. CustomerId (Dimension): This will be used to group the revenue data by each unique customer, allowing us to segment the total revenue by customer. 2. PurchaseTimestamp (Dimension): This timestamp field will be used to filter the data to only include orders from the last month. 3. PriceSum (Measure): Since PriceSum is a pre-aggregated measure of total revenue (sum of order_items.Price), it can be directly used to sum up the revenue without needing further aggregation in the SQL query. So utilize those metric components in the SQL generation process to give an answer like this: SQL Query: SELECT CustomerId, PriceSum AS TotalRevenue FROM Revenue WHERE PurchaseTimestamp >= DATE_TRUNC('month', CURRENT_DATE - INTERVAL '1 month') AND PurchaseTimestamp < DATE_TRUNC('month', CURRENT_DATE) """ _DEFAULT_JSON_FIELD_INSTRUCTIONS = """ #### Instructions for JSON related functions #### - ONLY USE JSON_QUERY for querying fields if "json_type":"JSON" is identified in the columns comment, NOT the deprecated JSON_EXTRACT_SCALAR function. - DON'T USE CAST for JSON fields, ONLY USE the following funtions: - LAX_BOOL for boolean fields - LAX_FLOAT64 for double and float fields - LAX_INT64 for bigint fields - LAX_STRING for varchar fields - For Example: DATA SCHEMA: `/* {"alias":"users","description":"A model representing the users data."} */ CREATE TABLE users ( -- {"alias":"address","description":"A JSON object that represents address information of this user.","json_type":"JSON","json_fields":{"json_type":"JSON","address.json.city":{"name":"city","type":"varchar","path":"$.city","properties":{"alias":"city","description":"City Name."}},"address.json.state":{"name":"state","type":"varchar","path":"$.state","properties":{"alias":"state","description":"ISO code or name of the state, province or district."}},"address.json.postcode":{"name":"postcode","type":"varchar","path":"$.postcode","properties":{"alias":"postcode","description":"Postal code."}},"address.json.country":{"name":"country","type":"varchar","path":"$.country","properties":{"alias":"country","description":"ISO code of the country."}}}} address JSON )` To get the city of address in user table use SQL: `SELECT LAX_STRING(JSON_QUERY(u.address, '$.city')) FROM user as u` - ONLY USE JSON_QUERY_ARRAY for querying "json_type":"JSON_ARRAY" is identified in the comment of the column, NOT the deprecated JSON_EXTRACT_ARRAY. - USE UNNEST to analysis each item individually in the ARRAY. YOU MUST SELECT FROM the parent table ahead of the UNNEST ARRAY. - The alias of the UNNEST(ARRAY) should be in the format `unnest_table_alias(individual_item_alias)` - For Example: `SELECT item FROM UNNEST(ARRAY[1,2,3]) as my_unnested_table(item)` - If the items in the ARRAY are JSON objects, use JSON_QUERY to query the fields inside each JSON item. - For Example: DATA SCHEMA `/* {"alias":"my_table","description":"A test my_table"} */ CREATE TABLE my_table ( -- {"alias":"elements","description":"elements column","json_type":"JSON_ARRAY","json_fields":{"json_type":"JSON_ARRAY","elements.json_array.id":{"name":"id","type":"bigint","path":"$.id","properties":{"alias":"id","description":"data ID."}},"elements.json_array.key":{"name":"key","type":"varchar","path":"$.key","properties":{"alias":"key","description":"data Key."}},"elements.json_array.value":{"name":"value","type":"varchar","path":"$.value","properties":{"alias":"value","description":"data Value."}}}} elements JSON )` To get the number of elements in my_table table use SQL: `SELECT LAX_INT64(JSON_QUERY(element, '$.number')) FROM my_table as t, UNNEST(JSON_QUERY_ARRAY(elements)) AS my_unnested_table(element) WHERE LAX_FLOAT64(JSON_QUERY(element, '$.value')) > 3.5` - To JOIN ON the fields inside UNNEST(ARRAY), YOU MUST SELECT FROM the parent table ahead of the UNNEST syntax, and the alias of the UNNEST(ARRAY) SHOULD BE IN THE FORMAT unnest_table_alias(individual_item_alias) - For Example: `SELECT p.column_1, j.column_2 FROM parent_table AS p, join_table AS j JOIN UNNEST(p.array_column) AS unnested(array_item) ON j.id = array_item.id` - DON'T USE JSON_QUERY and JSON_QUERY_ARRAY when "json_type":"". - DON'T USE LAX_BOOL, LAX_FLOAT64, LAX_INT64, LAX_STRING when "json_type":"". """ sql_samples_instructions = """ #### Instructions for SQL Samples #### Finally, you will learn from the sample SQL queries provided in the input. These samples demonstrate best practices and common patterns for querying this specific database. For each sample, you should: 1. Study the question that explains what the query aims to accomplish 2. Analyze the SQL implementation to understand: - Table structures and relationships used - Specific functions and operators employed - Query patterns and techniques demonstrated 3. Use these samples as reference patterns when generating similar queries 4. Adapt the techniques shown in the samples to match new query requirements while maintaining consistent style and approach The samples will help you understand: - Preferred table join patterns - Common aggregation methods - Specific function usage - Query structure and formatting conventions When generating new queries, try to follow similar patterns when applicable, while adapting them to the specific requirements of each new query. Learn about the usage of the schema structures and generate SQL based on them. """ sql_generation_reasoning_system_prompt = """ ### TASK ### You are a helpful data analyst who is great at thinking deeply and reasoning about the user's question and the database schema, and you provide a step-by-step reasoning plan in order to answer the user's question. ### INSTRUCTIONS ### 1. Think deeply and reason about the user's question, the database schema, and the user's query history if provided. 2. Explicitly state the following information in the reasoning plan: if the user puts any specific timeframe(e.g. YYYY-MM-DD) in the user's question(excluding the value of the current time), you will put the absolute time frame in the SQL query; otherwise, you will put the relative timeframe in the SQL query. 3. For the ranking problem(e.g. "top x", "bottom x", "first x", "last x"), you must use the ranking function, `DENSE_RANK()` to rank the results and then use `WHERE` clause to filter the results. 4. For the ranking problem(e.g. "top x", "bottom x", "first x", "last x"), you must add the ranking column to the final SELECT clause. 5. If USER INSTRUCTIONS section is provided, make sure to consider them in the reasoning plan. 6. If SQL SAMPLES section is provided, make sure to consider them in the reasoning plan. 7. Give a step by step reasoning plan in order to answer user's question. 8. The reasoning plan should be in the language same as the language user provided in the input. 9. Don't include SQL in the reasoning plan. 10. Each step in the reasoning plan must start with a number, a title(in bold format in markdown), and a reasoning for the step. 11. Do not include ```markdown or ``` in the answer. 12. A table name in the reasoning plan must be in this format: `table: `. 13. A column name in the reasoning plan must be in this format: `column: .`. 14. ONLY SHOWING the reasoning plan in bullet points. ### FINAL ANSWER FORMAT ### The final answer must be a reasoning plan in plain Markdown string format """ def _extract_from_sql_knowledge( sql_knowledge: SqlKnowledge | None, attribute_name: str, default_value: str ) -> str: if sql_knowledge is None: return default_value value = getattr(sql_knowledge, attribute_name, "") return value if value and value.strip() else default_value def get_text_to_sql_rules(sql_knowledge: SqlKnowledge | None = None) -> str: if sql_knowledge is not None: return _extract_from_sql_knowledge( sql_knowledge, "text_to_sql_rule", _DEFAULT_TEXT_TO_SQL_RULES ) return _DEFAULT_TEXT_TO_SQL_RULES def get_calculated_field_instructions(sql_knowledge: SqlKnowledge | None = None) -> str: if sql_knowledge is not None: return _extract_from_sql_knowledge( sql_knowledge, "calculated_field_instructions", _DEFAULT_CALCULATED_FIELD_INSTRUCTIONS, ) return _DEFAULT_CALCULATED_FIELD_INSTRUCTIONS def get_metric_instructions(sql_knowledge: SqlKnowledge | None = None) -> str: if sql_knowledge is not None: return _extract_from_sql_knowledge( sql_knowledge, "metric_instructions", _DEFAULT_METRIC_INSTRUCTIONS ) return _DEFAULT_METRIC_INSTRUCTIONS def get_json_field_instructions(sql_knowledge: SqlKnowledge | None = None) -> str: if sql_knowledge is not None: return _extract_from_sql_knowledge( sql_knowledge, "json_field_instructions", _DEFAULT_JSON_FIELD_INSTRUCTIONS ) return _DEFAULT_JSON_FIELD_INSTRUCTIONS def get_sql_generation_system_prompt(sql_knowledge: SqlKnowledge | None = None) -> str: text_to_sql_rules = get_text_to_sql_rules(sql_knowledge) return f""" You are a helpful assistant that converts natural language queries into ANSI SQL queries. Given user's question, database schema, etc., you should think deeply and carefully and generate the SQL query based on the given reasoning plan step by step. ### GENERAL RULES ### 1. YOU MUST FOLLOW the instructions strictly to generate the SQL query if the section of USER INSTRUCTIONS is available in user's input. 2. YOU MUST ONLY CHOOSE the appropriate functions from the sql functions list and use them in the SQL query if the section of SQL FUNCTIONS is available in user's input. 3. YOU MUST REFER to the sql samples and learn the usage of the schema structures and how SQL is written based on them if the section of SQL SAMPLES is available in user's input. 4. YOU MUST FOLLOW the reasoning plan step by step strictly to generate the SQL query if the section of REASONING PLAN is available in user's input. 5. YOU MUST FOLLOW SQL Rules if they are not contradicted with instructions. {text_to_sql_rules} ### FINAL ANSWER FORMAT ### The final answer must be a ANSI SQL query in JSON format: {{ "sql": }} """ class SqlGenerationResult(BaseModel): sql: str SQL_GENERATION_MODEL_KWARGS = { "response_format": { "type": "json_schema", "json_schema": { "name": "sql_generation_result", "schema": SqlGenerationResult.model_json_schema(), }, } } def construct_instructions( instructions: list[dict] | None = None, ): _instructions = [] if instructions: _instructions += [ instruction.get("instruction") for instruction in instructions ] return _instructions def construct_ask_history_messages( histories: list[AskHistory] | list[dict], ) -> list[ChatMessage]: messages = [] for history in histories: messages.append( ChatMessage.from_user( history.question if hasattr(history, "question") else history["question"] ) ) messages.append( ChatMessage.from_assistant( history.sql if hasattr(history, "sql") else history["sql"] ) ) return messages ================================================ FILE: wren-ai-service/src/pipelines/generation/utils/vega-lite-schema-v5.json ================================================ { "$ref": "#/definitions/TopLevelSpec", "$schema": "http://json-schema.org/draft-07/schema#", "definitions": { "Aggregate": { "anyOf": [ { "$ref": "#/definitions/NonArgAggregateOp" }, { "$ref": "#/definitions/ArgmaxDef" }, { "$ref": "#/definitions/ArgminDef" } ] }, "AggregateOp": { "enum": [ "argmax", "argmin", "average", "count", "distinct", "max", "mean", "median", "min", "missing", "product", "q1", "q3", "ci0", "ci1", "stderr", "stdev", "stdevp", "sum", "valid", "values", "variance", "variancep", "exponential", "exponentialb" ], "type": "string" }, "AggregateTransform": { "additionalProperties": false, "properties": { "aggregate": { "description": "Array of objects that define fields to aggregate.", "items": { "$ref": "#/definitions/AggregatedFieldDef" }, "type": "array" }, "groupby": { "description": "The data fields to group by. If not specified, a single group containing all data objects will be used.", "items": { "$ref": "#/definitions/FieldName" }, "type": "array" } }, "required": [ "aggregate" ], "type": "object" }, "AggregatedFieldDef": { "additionalProperties": false, "properties": { "as": { "$ref": "#/definitions/FieldName", "description": "The output field names to use for each aggregated field." }, "field": { "$ref": "#/definitions/FieldName", "description": "The data field for which to compute aggregate function. This is required for all aggregation operations except `\"count\"`." }, "op": { "$ref": "#/definitions/AggregateOp", "description": "The aggregation operation to apply to the fields (e.g., `\"sum\"`, `\"average\"`, or `\"count\"`). See the [full list of supported aggregation operations](https://vega.github.io/vega-lite/docs/aggregate.html#ops) for more information." } }, "required": [ "op", "as" ], "type": "object" }, "Align": { "enum": [ "left", "center", "right" ], "type": "string" }, "AllSortString": { "anyOf": [ { "$ref": "#/definitions/SortOrder" }, { "$ref": "#/definitions/SortByChannel" }, { "$ref": "#/definitions/SortByChannelDesc" } ] }, "AnyMark": { "anyOf": [ { "$ref": "#/definitions/CompositeMark" }, { "$ref": "#/definitions/CompositeMarkDef" }, { "$ref": "#/definitions/Mark" }, { "$ref": "#/definitions/MarkDef" } ] }, "AnyMarkConfig": { "anyOf": [ { "$ref": "#/definitions/MarkConfig" }, { "$ref": "#/definitions/AreaConfig" }, { "$ref": "#/definitions/BarConfig" }, { "$ref": "#/definitions/RectConfig" }, { "$ref": "#/definitions/LineConfig" }, { "$ref": "#/definitions/TickConfig" } ] }, "AreaConfig": { "additionalProperties": false, "properties": { "align": { "anyOf": [ { "$ref": "#/definitions/Align" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of `\"left\"`, `\"right\"`, `\"center\"`.\n\n__Note:__ Expression reference is *not* supported for range marks." }, "angle": { "anyOf": [ { "description": "The rotation angle of the text, in degrees.", "maximum": 360, "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "aria": { "anyOf": [ { "description": "A boolean flag indicating if [ARIA attributes](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) should be included (SVG output only). If `false`, the \"aria-hidden\" attribute will be set on the output SVG element, removing the mark item from the ARIA accessibility tree.", "type": "boolean" }, { "$ref": "#/definitions/ExprRef" } ] }, "ariaRole": { "anyOf": [ { "description": "Sets the type of user interface element of the mark item for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only). If specified, this property determines the \"role\" attribute. Warning: this property is experimental and may be changed in the future.", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "ariaRoleDescription": { "anyOf": [ { "description": "A human-readable, author-localized description for the role of the mark item for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only). If specified, this property determines the \"aria-roledescription\" attribute. Warning: this property is experimental and may be changed in the future.", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "aspect": { "anyOf": [ { "description": "Whether to keep aspect ratio of image marks.", "type": "boolean" }, { "$ref": "#/definitions/ExprRef" } ] }, "baseline": { "anyOf": [ { "$ref": "#/definitions/TextBaseline" }, { "$ref": "#/definitions/ExprRef" } ], "description": "For text marks, the vertical text baseline. One of `\"alphabetic\"` (default), `\"top\"`, `\"middle\"`, `\"bottom\"`, `\"line-top\"`, `\"line-bottom\"`, or an expression reference that provides one of the valid values. The `\"line-top\"` and `\"line-bottom\"` values operate similarly to `\"top\"` and `\"bottom\"`, but are calculated relative to the `lineHeight` rather than `fontSize` alone.\n\nFor range marks, the vertical alignment of the marks. One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Note:__ Expression reference is *not* supported for range marks." }, "blend": { "anyOf": [ { "$ref": "#/definitions/Blend", "description": "The color blend mode for drawing an item on its current background. Any valid [CSS mix-blend-mode](https://developer.mozilla.org/en-US/docs/Web/CSS/mix-blend-mode) value can be used.\n\n__Default value: `\"source-over\"`" }, { "$ref": "#/definitions/ExprRef" } ] }, "color": { "anyOf": [ { "$ref": "#/definitions/Color" }, { "$ref": "#/definitions/Gradient" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Default color.\n\n__Default value:__ `\"#4682b4\"`\n\n__Note:__\n- This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).\n- The `fill` and `stroke` properties have higher precedence than `color` and will override `color`." }, "cornerRadius": { "anyOf": [ { "description": "The radius in pixels of rounded rectangles or arcs' corners.\n\n__Default value:__ `0`", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "cornerRadiusBottomLeft": { "anyOf": [ { "description": "The radius in pixels of rounded rectangles' bottom left corner.\n\n__Default value:__ `0`", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "cornerRadiusBottomRight": { "anyOf": [ { "description": "The radius in pixels of rounded rectangles' bottom right corner.\n\n__Default value:__ `0`", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "cornerRadiusTopLeft": { "anyOf": [ { "description": "The radius in pixels of rounded rectangles' top right corner.\n\n__Default value:__ `0`", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "cornerRadiusTopRight": { "anyOf": [ { "description": "The radius in pixels of rounded rectangles' top left corner.\n\n__Default value:__ `0`", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "cursor": { "anyOf": [ { "$ref": "#/definitions/Cursor", "description": "The mouse cursor used over the mark. Any valid [CSS cursor type](https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values) can be used." }, { "$ref": "#/definitions/ExprRef" } ] }, "description": { "anyOf": [ { "description": "A text description of the mark item for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only). If specified, this property determines the [\"aria-label\" attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute).", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "dir": { "anyOf": [ { "$ref": "#/definitions/TextDirection", "description": "The direction of the text. One of `\"ltr\"` (left-to-right) or `\"rtl\"` (right-to-left). This property determines on which side is truncated in response to the limit parameter.\n\n__Default value:__ `\"ltr\"`" }, { "$ref": "#/definitions/ExprRef" } ] }, "dx": { "anyOf": [ { "description": "The horizontal offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "dy": { "anyOf": [ { "description": "The vertical offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "ellipsis": { "anyOf": [ { "description": "The ellipsis string for text truncated in response to the limit parameter.\n\n__Default value:__ `\"…\"`", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "endAngle": { "anyOf": [ { "description": "The end angle in radians for arc marks. A value of `0` indicates up (north), increasing values proceed clockwise.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "fill": { "anyOf": [ { "$ref": "#/definitions/Color" }, { "$ref": "#/definitions/Gradient" }, { "type": "null" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Default fill color. This property has higher precedence than `config.color`. Set to `null` to remove fill.\n\n__Default value:__ (None)" }, "fillOpacity": { "anyOf": [ { "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", "maximum": 1, "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "filled": { "description": "Whether the mark's color should be used as fill color instead of stroke color.\n\n__Default value:__ `false` for all `point`, `line`, and `rule` marks as well as `geoshape` marks for [`graticule`](https://vega.github.io/vega-lite/docs/data.html#graticule) data sources; otherwise, `true`.\n\n__Note:__ This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).", "type": "boolean" }, "font": { "anyOf": [ { "description": "The typeface to set the text in (e.g., `\"Helvetica Neue\"`).", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "fontSize": { "anyOf": [ { "description": "The font size, in pixels.\n\n__Default value:__ `11`", "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "fontStyle": { "anyOf": [ { "$ref": "#/definitions/FontStyle", "description": "The font style (e.g., `\"italic\"`)." }, { "$ref": "#/definitions/ExprRef" } ] }, "fontWeight": { "anyOf": [ { "$ref": "#/definitions/FontWeight", "description": "The font weight. This can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." }, { "$ref": "#/definitions/ExprRef" } ] }, "height": { "anyOf": [ { "description": "Height of the marks.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "href": { "anyOf": [ { "$ref": "#/definitions/URI", "description": "A URL to load upon mouse click. If defined, the mark acts as a hyperlink." }, { "$ref": "#/definitions/ExprRef" } ] }, "innerRadius": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The inner radius in pixels of arc marks. `innerRadius` is an alias for `radius2`.\n\n__Default value:__ `0`", "minimum": 0 }, "interpolate": { "anyOf": [ { "$ref": "#/definitions/Interpolate", "description": "The line interpolation method to use for line and area marks. One of the following:\n- `\"linear\"`: piecewise linear segments, as in a polyline.\n- `\"linear-closed\"`: close the linear segments to form a polygon.\n- `\"step\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"step-before\"`: alternate between vertical and horizontal segments, as in a step function.\n- `\"step-after\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"basis\"`: a B-spline, with control point duplication on the ends.\n- `\"basis-open\"`: an open B-spline; may not intersect the start or end.\n- `\"basis-closed\"`: a closed B-spline, as in a loop.\n- `\"cardinal\"`: a Cardinal spline, with control point duplication on the ends.\n- `\"cardinal-open\"`: an open Cardinal spline; may not intersect the start or end, but will intersect other control points.\n- `\"cardinal-closed\"`: a closed Cardinal spline, as in a loop.\n- `\"bundle\"`: equivalent to basis, except the tension parameter is used to straighten the spline.\n- `\"monotone\"`: cubic interpolation that preserves monotonicity in y." }, { "$ref": "#/definitions/ExprRef" } ] }, "invalid": { "anyOf": [ { "$ref": "#/definitions/MarkInvalidDataMode" }, { "type": "null" } ], "description": "Invalid data mode, which defines how the marks and corresponding scales should represent invalid values (`null` and `NaN` in continuous scales *without* defined output for invalid values).\n\n- `\"filter\"` — *Exclude* all invalid values from the visualization's *marks* and *scales*. For path marks (for line, area, trail), this option will create paths that connect valid points, as if the data rows with invalid values do not exist.\n\n- `\"break-paths-filter-domains\"` — Break path marks (for line, area, trail) at invalid values. For non-path marks, this is equivalent to `\"filter\"`. All *scale* domains will *exclude* these filtered data points.\n\n- `\"break-paths-show-domains\"` — Break paths (for line, area, trail) at invalid values. Hide invalid values for non-path marks. All *scale* domains will *include* these filtered data points (for both path and non-path marks).\n\n- `\"show\"` or `null` — Show all data points in the marks and scale domains. Each scale will use the output for invalid values defined in `config.scale.invalid` or, if unspecified, by default invalid values will produce the same visual values as zero (if the scale includes zero) or the minimum value (if the scale does not include zero).\n\n- `\"break-paths-show-path-domains\"` (default) — This is equivalent to `\"break-paths-show-domains\"` for path-based marks (line/area/trail) and `\"filter\"` for non-path marks.\n\n__Note__: If any channel's scale has an output for invalid values defined in `config.scale.invalid`, all values for the scales will be considered \"valid\" since they can produce a reasonable output for the scales. Thus, fields for such channels will not be filtered and will not cause path breaks." }, "limit": { "anyOf": [ { "description": "The maximum length of the text mark in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.\n\n__Default value:__ `0` -- indicating no limit", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "line": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/OverlayMarkDef" } ], "description": "A flag for overlaying line on top of area marks, or an object defining the properties of the overlayed lines.\n\n- If this value is an empty object (`{}`) or `true`, lines with default properties will be used.\n\n- If this value is `false`, no lines would be automatically added to area marks.\n\n__Default value:__ `false`." }, "lineBreak": { "anyOf": [ { "description": "A delimiter, such as a newline character, upon which to break text strings into multiple lines. This property is ignored if the text is array-valued.", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "lineHeight": { "anyOf": [ { "description": "The line height in pixels (the spacing between subsequent lines of text) for multi-line text marks.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "opacity": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The overall opacity (value between [0,1]).\n\n__Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or `square` marks or layered `bar` charts and `1` otherwise.", "maximum": 1, "minimum": 0 }, "order": { "description": "For line and trail marks, this `order` property can be set to `null` or `false` to make the lines use the original order in the data sources.", "type": [ "null", "boolean" ] }, "orient": { "$ref": "#/definitions/Orientation", "description": "The orientation of a non-stacked bar, tick, area, and line charts. The value is either horizontal (default) or vertical.\n- For bar, rule and tick, this determines whether the size of the bar and tick should be applied to x or y dimension.\n- For area, this property determines the orient property of the Vega output.\n- For line and trail marks, this property determines the sort order of the points in the line if `config.sortLineBy` is not specified. For stacked charts, this is always determined by the orientation of the stack; therefore explicitly specified value will be ignored." }, "outerRadius": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The outer radius in pixels of arc marks. `outerRadius` is an alias for `radius`.\n\n__Default value:__ `0`", "minimum": 0 }, "padAngle": { "anyOf": [ { "description": "The angular padding applied to sides of the arc, in radians.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "point": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/OverlayMarkDef" }, { "const": "transparent", "type": "string" } ], "description": "A flag for overlaying points on top of line or area marks, or an object defining the properties of the overlayed points.\n\n- If this property is `\"transparent\"`, transparent points will be used (for enhancing tooltips and selections).\n\n- If this property is an empty object (`{}`) or `true`, filled points with default properties will be used.\n\n- If this property is `false`, no points would be automatically added to line or area marks.\n\n__Default value:__ `false`." }, "radius": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "For arc mark, the primary (outer) radius in pixels.\n\nFor text marks, polar coordinate radial offset, in pixels, of the text from the origin determined by the `x` and `y` properties.\n\n__Default value:__ `min(plot_width, plot_height)/2`", "minimum": 0 }, "radius2": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The secondary (inner) radius in pixels of arc marks.\n\n__Default value:__ `0`", "minimum": 0 }, "shape": { "anyOf": [ { "anyOf": [ { "$ref": "#/definitions/SymbolShape" }, { "type": "string" } ], "description": "Shape of the point marks. Supported values include:\n- plotting shapes: `\"circle\"`, `\"square\"`, `\"cross\"`, `\"diamond\"`, `\"triangle-up\"`, `\"triangle-down\"`, `\"triangle-right\"`, or `\"triangle-left\"`.\n- the line symbol `\"stroke\"`\n- centered directional shapes `\"arrow\"`, `\"wedge\"`, or `\"triangle\"`\n- a custom [SVG path string](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths) (For correct sizing, custom shape paths should be defined within a square bounding box with coordinates ranging from -1 to 1 along both the x and y dimensions.)\n\n__Default value:__ `\"circle\"`" }, { "$ref": "#/definitions/ExprRef" } ] }, "size": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Default size for marks.\n- For `point`/`circle`/`square`, this represents the pixel area of the marks. Note that this value sets the area of the symbol; the side lengths will increase with the square root of this value.\n- For `bar`, this represents the band size of the bar, in pixels.\n- For `text`, this represents the font size, in pixels.\n\n__Default value:__\n- `30` for point, circle, square marks; width/height's `step`\n- `2` for bar marks with discrete dimensions;\n- `5` for bar marks with continuous dimensions;\n- `11` for text marks.", "minimum": 0 }, "smooth": { "anyOf": [ { "description": "A boolean flag (default true) indicating if the image should be smoothed when resized. If false, individual pixels should be scaled directly rather than interpolated with smoothing. For SVG rendering, this option may not work in some browsers due to lack of standardization.", "type": "boolean" }, { "$ref": "#/definitions/ExprRef" } ] }, "startAngle": { "anyOf": [ { "description": "The start angle in radians for arc marks. A value of `0` indicates up (north), increasing values proceed clockwise.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "stroke": { "anyOf": [ { "$ref": "#/definitions/Color" }, { "$ref": "#/definitions/Gradient" }, { "type": "null" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Default stroke color. This property has higher precedence than `config.color`. Set to `null` to remove stroke.\n\n__Default value:__ (None)" }, "strokeCap": { "anyOf": [ { "$ref": "#/definitions/StrokeCap", "description": "The stroke cap for line ending style. One of `\"butt\"`, `\"round\"`, or `\"square\"`.\n\n__Default value:__ `\"butt\"`" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeDash": { "anyOf": [ { "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", "items": { "type": "number" }, "type": "array" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeDashOffset": { "anyOf": [ { "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeJoin": { "anyOf": [ { "$ref": "#/definitions/StrokeJoin", "description": "The stroke line join method. One of `\"miter\"`, `\"round\"` or `\"bevel\"`.\n\n__Default value:__ `\"miter\"`" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeMiterLimit": { "anyOf": [ { "description": "The miter limit at which to bevel a line join.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeOffset": { "anyOf": [ { "description": "The offset in pixels at which to draw the group stroke and fill. If unspecified, the default behavior is to dynamically offset stroked groups such that 1 pixel stroke widths align with the pixel grid.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeOpacity": { "anyOf": [ { "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", "maximum": 1, "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeWidth": { "anyOf": [ { "description": "The stroke width, in pixels.", "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "tension": { "anyOf": [ { "description": "Depending on the interpolation type, sets the tension parameter (for line and area marks).", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "text": { "anyOf": [ { "$ref": "#/definitions/Text", "description": "Placeholder text if the `text` channel is not specified" }, { "$ref": "#/definitions/ExprRef" } ] }, "theta": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "- For arc marks, the arc length in radians if theta2 is not specified, otherwise the start arc angle. (A value of 0 indicates up or “north”, increasing values proceed clockwise.)\n\n- For text marks, polar coordinate angle in radians.", "maximum": 360, "minimum": 0 }, "theta2": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise." }, "time": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "timeUnitBandPosition": { "description": "Default relative band position for a time unit. If set to `0`, the marks will be positioned at the beginning of the time unit band step. If set to `0.5`, the marks will be positioned in the middle of the time unit band step.", "type": "number" }, "timeUnitBandSize": { "description": "Default relative band size for a time unit. If set to `1`, the bandwidth of the marks will be equal to the time unit band step. If set to `0.5`, bandwidth of the marks will be half of the time unit band step.", "type": "number" }, "tooltip": { "anyOf": [ { "type": "number" }, { "type": "string" }, { "type": "boolean" }, { "$ref": "#/definitions/TooltipContent" }, { "$ref": "#/definitions/ExprRef" }, { "type": "null" } ], "description": "The tooltip text string to show upon mouse hover or an object defining which fields should the tooltip be derived from.\n\n- If `tooltip` is `true` or `{\"content\": \"encoding\"}`, then all fields from `encoding` will be used.\n- If `tooltip` is `{\"content\": \"data\"}`, then all fields that appear in the highlighted data point will be used.\n- If set to `null` or `false`, then no tooltip will be used.\n\nSee the [`tooltip`](https://vega.github.io/vega-lite/docs/tooltip.html) documentation for a detailed discussion about tooltip in Vega-Lite.\n\n__Default value:__ `null`" }, "url": { "anyOf": [ { "$ref": "#/definitions/URI", "description": "The URL of the image file for image marks." }, { "$ref": "#/definitions/ExprRef" } ] }, "width": { "anyOf": [ { "description": "Width of the marks.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "x": { "anyOf": [ { "type": "number" }, { "const": "width", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ], "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"` without specified `x2` or `width`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." }, "x2": { "anyOf": [ { "type": "number" }, { "const": "width", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ], "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." }, "y": { "anyOf": [ { "type": "number" }, { "const": "height", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"` without specified `y2` or `height`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." }, "y2": { "anyOf": [ { "type": "number" }, { "const": "height", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." } }, "type": "object" }, "ArgmaxDef": { "additionalProperties": false, "properties": { "argmax": { "$ref": "#/definitions/FieldName" } }, "required": [ "argmax" ], "type": "object" }, "ArgminDef": { "additionalProperties": false, "properties": { "argmin": { "$ref": "#/definitions/FieldName" } }, "required": [ "argmin" ], "type": "object" }, "AutoSizeParams": { "additionalProperties": false, "properties": { "contains": { "description": "Determines how size calculation should be performed, one of `\"content\"` or `\"padding\"`. The default setting (`\"content\"`) interprets the width and height settings as the data rectangle (plotting) dimensions, to which padding is then added. In contrast, the `\"padding\"` setting includes the padding within the view size calculations, such that the width and height settings indicate the **total** intended size of the view.\n\n__Default value__: `\"content\"`", "enum": [ "content", "padding" ], "type": "string" }, "resize": { "description": "A boolean flag indicating if autosize layout should be re-calculated on every view update.\n\n__Default value__: `false`", "type": "boolean" }, "type": { "$ref": "#/definitions/AutosizeType", "description": "The sizing format type. One of `\"pad\"`, `\"fit\"`, `\"fit-x\"`, `\"fit-y\"`, or `\"none\"`. See the [autosize type](https://vega.github.io/vega-lite/docs/size.html#autosize) documentation for descriptions of each.\n\n__Default value__: `\"pad\"`" } }, "type": "object" }, "AutosizeType": { "enum": [ "pad", "none", "fit", "fit-x", "fit-y" ], "type": "string" }, "Axis": { "additionalProperties": false, "properties": { "aria": { "anyOf": [ { "description": "A boolean flag indicating if [ARIA attributes](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) should be included (SVG output only). If `false`, the \"aria-hidden\" attribute will be set on the output SVG group, removing the axis from the ARIA accessibility tree.\n\n__Default value:__ `true`", "type": "boolean" }, { "$ref": "#/definitions/ExprRef" } ] }, "bandPosition": { "anyOf": [ { "description": "An interpolation fraction indicating where, for `band` scales, axis ticks should be positioned. A value of `0` places ticks at the left edge of their bands. A value of `0.5` places ticks in the middle of their bands.\n\n __Default value:__ `0.5`", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "description": { "anyOf": [ { "description": "A text description of this axis for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only). If the `aria` property is true, for SVG output the [\"aria-label\" attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute) will be set to this description. If the description is unspecified it will be automatically generated.", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "domain": { "description": "A boolean flag indicating if the domain (the axis baseline) should be included as part of the axis.\n\n__Default value:__ `true`", "type": "boolean" }, "domainCap": { "anyOf": [ { "$ref": "#/definitions/StrokeCap", "description": "The stroke cap for the domain line's ending style. One of `\"butt\"`, `\"round\"` or `\"square\"`.\n\n__Default value:__ `\"butt\"`" }, { "$ref": "#/definitions/ExprRef" } ] }, "domainColor": { "anyOf": [ { "anyOf": [ { "type": "null" }, { "$ref": "#/definitions/Color" } ], "description": "Color of axis domain line.\n\n__Default value:__ `\"gray\"`." }, { "$ref": "#/definitions/ExprRef" } ] }, "domainDash": { "anyOf": [ { "description": "An array of alternating [stroke, space] lengths for dashed domain lines.", "items": { "type": "number" }, "type": "array" }, { "$ref": "#/definitions/ExprRef" } ] }, "domainDashOffset": { "anyOf": [ { "description": "The pixel offset at which to start drawing with the domain dash array.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "domainOpacity": { "anyOf": [ { "description": "Opacity of the axis domain line.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "domainWidth": { "anyOf": [ { "description": "Stroke width of axis domain line\n\n__Default value:__ `1`", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "format": { "anyOf": [ { "type": "string" }, { "$ref": "#/definitions/Dict" } ], "description": "When used with the default `\"number\"` and `\"time\"` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks.\n\n- If the format type is `\"number\"` (e.g., for quantitative fields), this is D3's [number format pattern](https://github.com/d3/d3-format#locale_format).\n- If the format type is `\"time\"` (e.g., for temporal fields), this is D3's [time format pattern](https://github.com/d3/d3-time-format#locale_format).\n\nSee the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for more examples.\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." }, "formatType": { "description": "The format type for labels. One of `\"number\"`, `\"time\"`, or a [registered custom format type](https://vega.github.io/vega-lite/docs/config.html#custom-format-type).\n\n__Default value:__\n- `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`.\n- `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", "type": "string" }, "grid": { "description": "A boolean flag indicating if grid lines should be included as part of the axis\n\n__Default value:__ `true` for [continuous scales](https://vega.github.io/vega-lite/docs/scale.html#continuous) that are not binned; otherwise, `false`.", "type": "boolean" }, "gridCap": { "anyOf": [ { "$ref": "#/definitions/StrokeCap", "description": "The stroke cap for grid lines' ending style. One of `\"butt\"`, `\"round\"` or `\"square\"`.\n\n__Default value:__ `\"butt\"`" }, { "$ref": "#/definitions/ExprRef" } ] }, "gridColor": { "anyOf": [ { "anyOf": [ { "type": "null" }, { "$ref": "#/definitions/Color" } ], "description": "Color of gridlines.\n\n__Default value:__ `\"lightGray\"`." }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/ConditionalAxisColor" } ] }, "gridDash": { "anyOf": [ { "description": "An array of alternating [stroke, space] lengths for dashed grid lines.", "items": { "type": "number" }, "type": "array" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/ConditionalAxisNumberArray" } ] }, "gridDashOffset": { "anyOf": [ { "description": "The pixel offset at which to start drawing with the grid dash array.", "type": "number" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/ConditionalAxisNumber" } ] }, "gridOpacity": { "anyOf": [ { "description": "The stroke opacity of grid (value between [0,1])\n\n__Default value:__ `1`", "maximum": 1, "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/ConditionalAxisNumber" } ] }, "gridWidth": { "anyOf": [ { "description": "The grid width, in pixels.\n\n__Default value:__ `1`", "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/ConditionalAxisNumber" } ] }, "labelAlign": { "anyOf": [ { "$ref": "#/definitions/Align", "description": "Horizontal text alignment of axis tick labels, overriding the default setting for the current axis orientation." }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/ConditionalAxisLabelAlign" } ] }, "labelAngle": { "anyOf": [ { "description": "The rotation angle of the axis labels.\n\n__Default value:__ `-90` for nominal and ordinal fields; `0` otherwise.", "maximum": 360, "minimum": -360, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "labelBaseline": { "anyOf": [ { "$ref": "#/definitions/TextBaseline", "description": "Vertical text baseline of axis tick labels, overriding the default setting for the current axis orientation. One of `\"alphabetic\"` (default), `\"top\"`, `\"middle\"`, `\"bottom\"`, `\"line-top\"`, or `\"line-bottom\"`. The `\"line-top\"` and `\"line-bottom\"` values operate similarly to `\"top\"` and `\"bottom\"`, but are calculated relative to the *lineHeight* rather than *fontSize* alone." }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/ConditionalAxisLabelBaseline" } ] }, "labelBound": { "anyOf": [ { "description": "Indicates if labels should be hidden if they exceed the axis range. If `false` (the default) no bounds overlap analysis is performed. If `true`, labels will be hidden if they exceed the axis range by more than 1 pixel. If this property is a number, it specifies the pixel tolerance: the maximum amount by which a label bounding box may exceed the axis range.\n\n__Default value:__ `false`.", "type": [ "number", "boolean" ] }, { "$ref": "#/definitions/ExprRef" } ] }, "labelColor": { "anyOf": [ { "anyOf": [ { "type": "null" }, { "$ref": "#/definitions/Color" } ], "description": "The color of the tick label, can be in hex color code or regular color name." }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/ConditionalAxisColor" } ] }, "labelExpr": { "description": "[Vega expression](https://vega.github.io/vega/docs/expressions/) for customizing labels.\n\n__Note:__ The label text and value can be assessed via the `label` and `value` properties of the axis's backing `datum` object.", "type": "string" }, "labelFlush": { "description": "Indicates if the first and last axis labels should be aligned flush with the scale range. Flush alignment for a horizontal axis will left-align the first label and right-align the last label. For vertical axes, bottom and top text baselines are applied instead. If this property is a number, it also indicates the number of pixels by which to offset the first and last labels; for example, a value of 2 will flush-align the first and last labels and also push them 2 pixels outward from the center of the axis. The additional adjustment can sometimes help the labels better visually group with corresponding axis ticks.\n\n__Default value:__ `true` for axis of a continuous x-scale. Otherwise, `false`.", "type": [ "boolean", "number" ] }, "labelFlushOffset": { "anyOf": [ { "description": "Indicates the number of pixels by which to offset flush-adjusted labels. For example, a value of `2` will push flush-adjusted labels 2 pixels outward from the center of the axis. Offsets can help the labels better visually group with corresponding axis ticks.\n\n__Default value:__ `0`.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "labelFont": { "anyOf": [ { "description": "The font of the tick label.", "type": "string" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/ConditionalAxisString" } ] }, "labelFontSize": { "anyOf": [ { "description": "The font size of the label, in pixels.", "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/ConditionalAxisNumber" } ] }, "labelFontStyle": { "anyOf": [ { "$ref": "#/definitions/FontStyle", "description": "Font style of the title." }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/ConditionalAxisLabelFontStyle" } ] }, "labelFontWeight": { "anyOf": [ { "$ref": "#/definitions/FontWeight", "description": "Font weight of axis tick labels." }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/ConditionalAxisLabelFontWeight" } ] }, "labelLimit": { "anyOf": [ { "description": "Maximum allowed pixel width of axis tick labels.\n\n__Default value:__ `180`", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "labelLineHeight": { "anyOf": [ { "description": "Line height in pixels for multi-line label text or label text with `\"line-top\"` or `\"line-bottom\"` baseline.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "labelOffset": { "anyOf": [ { "description": "Position offset in pixels to apply to labels, in addition to tickOffset.\n\n__Default value:__ `0`", "type": "number" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/ConditionalAxisNumber" } ] }, "labelOpacity": { "anyOf": [ { "description": "The opacity of the labels.", "type": "number" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/ConditionalAxisNumber" } ] }, "labelOverlap": { "anyOf": [ { "$ref": "#/definitions/LabelOverlap" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The strategy to use for resolving overlap of axis labels. If `false` (the default), no overlap reduction is attempted. If set to `true` or `\"parity\"`, a strategy of removing every other label is used (this works well for standard linear axes). If set to `\"greedy\"`, a linear scan of the labels is performed, removing any labels that overlaps with the last visible label (this often works better for log-scaled axes).\n\n__Default value:__ `true` for non-nominal fields with non-log scales; `\"greedy\"` for log scales; otherwise `false`." }, "labelPadding": { "anyOf": [ { "description": "The padding in pixels between labels and ticks.\n\n__Default value:__ `2`", "type": "number" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/ConditionalAxisNumber" } ] }, "labelSeparation": { "anyOf": [ { "description": "The minimum separation that must be between label bounding boxes for them to be considered non-overlapping (default `0`). This property is ignored if *labelOverlap* resolution is not enabled.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "labels": { "description": "A boolean flag indicating if labels should be included as part of the axis.\n\n__Default value:__ `true`.", "type": "boolean" }, "maxExtent": { "anyOf": [ { "description": "The maximum extent in pixels that axis ticks and labels should use. This determines a maximum offset value for axis titles.\n\n__Default value:__ `undefined`.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "minExtent": { "anyOf": [ { "description": "The minimum extent in pixels that axis ticks and labels should use. This determines a minimum offset value for axis titles.\n\n__Default value:__ `30` for y-axis; `undefined` for x-axis.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "offset": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The offset, in pixels, by which to displace the axis from the edge of the enclosing group or data rectangle.\n\n__Default value:__ derived from the [axis config](https://vega.github.io/vega-lite/docs/config.html#facet-scale-config)'s `offset` (`0` by default)" }, "orient": { "anyOf": [ { "$ref": "#/definitions/AxisOrient" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The orientation of the axis. One of `\"top\"`, `\"bottom\"`, `\"left\"` or `\"right\"`. The orientation can be used to further specialize the axis type (e.g., a y-axis oriented towards the right edge of the chart).\n\n__Default value:__ `\"bottom\"` for x-axes and `\"left\"` for y-axes." }, "position": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The anchor position of the axis in pixels. For x-axes with top or bottom orientation, this sets the axis group x coordinate. For y-axes with left or right orientation, this sets the axis group y coordinate.\n\n__Default value__: `0`" }, "style": { "anyOf": [ { "type": "string" }, { "items": { "type": "string" }, "type": "array" } ], "description": "A string or array of strings indicating the name of custom styles to apply to the axis. A style is a named collection of axis property defined within the [style configuration](https://vega.github.io/vega-lite/docs/mark.html#style-config). If style is an array, later styles will override earlier styles.\n\n__Default value:__ (none) __Note:__ Any specified style will augment the default style. For example, an x-axis mark with `\"style\": \"foo\"` will use `config.axisX` and `config.style.foo` (the specified style `\"foo\"` has higher precedence)." }, "tickBand": { "anyOf": [ { "description": "For band scales, indicates if ticks and grid lines should be placed at the `\"center\"` of a band (default) or at the band `\"extent\"`s to indicate intervals", "enum": [ "center", "extent" ], "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "tickCap": { "anyOf": [ { "$ref": "#/definitions/StrokeCap", "description": "The stroke cap for the tick lines' ending style. One of `\"butt\"`, `\"round\"` or `\"square\"`.\n\n__Default value:__ `\"butt\"`" }, { "$ref": "#/definitions/ExprRef" } ] }, "tickColor": { "anyOf": [ { "anyOf": [ { "type": "null" }, { "$ref": "#/definitions/Color" } ], "description": "The color of the axis's tick.\n\n__Default value:__ `\"gray\"`" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/ConditionalAxisColor" } ] }, "tickCount": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/TimeInterval" }, { "$ref": "#/definitions/TimeIntervalStep" }, { "$ref": "#/definitions/ExprRef" } ], "description": "A desired number of ticks, for axes visualizing quantitative scales. The resulting number may be different so that values are \"nice\" (multiples of 2, 5, 10) and lie within the underlying scale's range.\n\nFor scales of type `\"time\"` or `\"utc\"`, the tick count can instead be a time interval specifier. Legal string values are `\"millisecond\"`, `\"second\"`, `\"minute\"`, `\"hour\"`, `\"day\"`, `\"week\"`, `\"month\"`, and `\"year\"`. Alternatively, an object-valued interval specifier of the form `{\"interval\": \"month\", \"step\": 3}` includes a desired number of interval steps. Here, ticks are generated for each quarter (Jan, Apr, Jul, Oct) boundary.\n\n__Default value__: Determine using a formula `ceil(width/40)` for x and `ceil(height/40)` for y.", "minimum": 0 }, "tickDash": { "anyOf": [ { "description": "An array of alternating [stroke, space] lengths for dashed tick mark lines.", "items": { "type": "number" }, "type": "array" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/ConditionalAxisNumberArray" } ] }, "tickDashOffset": { "anyOf": [ { "description": "The pixel offset at which to start drawing with the tick mark dash array.", "type": "number" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/ConditionalAxisNumber" } ] }, "tickExtra": { "description": "Boolean flag indicating if an extra axis tick should be added for the initial position of the axis. This flag is useful for styling axes for `band` scales such that ticks are placed on band boundaries rather in the middle of a band. Use in conjunction with `\"bandPosition\": 1` and an axis `\"padding\"` value of `0`.", "type": "boolean" }, "tickMinStep": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The minimum desired step between axis ticks, in terms of scale domain values. For example, a value of `1` indicates that ticks should not be less than 1 unit apart. If `tickMinStep` is specified, the `tickCount` value will be adjusted, if necessary, to enforce the minimum step value." }, "tickOffset": { "anyOf": [ { "description": "Position offset in pixels to apply to ticks, labels, and gridlines.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "tickOpacity": { "anyOf": [ { "description": "Opacity of the ticks.", "type": "number" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/ConditionalAxisNumber" } ] }, "tickRound": { "description": "Boolean flag indicating if pixel position values should be rounded to the nearest integer.\n\n__Default value:__ `true`", "type": "boolean" }, "tickSize": { "anyOf": [ { "description": "The size in pixels of axis ticks.\n\n__Default value:__ `5`", "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/ConditionalAxisNumber" } ] }, "tickWidth": { "anyOf": [ { "description": "The width, in pixels, of ticks.\n\n__Default value:__ `1`", "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/ConditionalAxisNumber" } ] }, "ticks": { "description": "Boolean value that determines whether the axis should include ticks.\n\n__Default value:__ `true`", "type": "boolean" }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "titleAlign": { "anyOf": [ { "$ref": "#/definitions/Align", "description": "Horizontal text alignment of axis titles." }, { "$ref": "#/definitions/ExprRef" } ] }, "titleAnchor": { "anyOf": [ { "$ref": "#/definitions/TitleAnchor", "description": "Text anchor position for placing axis titles." }, { "$ref": "#/definitions/ExprRef" } ] }, "titleAngle": { "anyOf": [ { "description": "Angle in degrees of axis titles.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "titleBaseline": { "anyOf": [ { "$ref": "#/definitions/TextBaseline", "description": "Vertical text baseline for axis titles. One of `\"alphabetic\"` (default), `\"top\"`, `\"middle\"`, `\"bottom\"`, `\"line-top\"`, or `\"line-bottom\"`. The `\"line-top\"` and `\"line-bottom\"` values operate similarly to `\"top\"` and `\"bottom\"`, but are calculated relative to the *lineHeight* rather than *fontSize* alone." }, { "$ref": "#/definitions/ExprRef" } ] }, "titleColor": { "anyOf": [ { "anyOf": [ { "type": "null" }, { "$ref": "#/definitions/Color" } ], "description": "Color of the title, can be in hex color code or regular color name." }, { "$ref": "#/definitions/ExprRef" } ] }, "titleFont": { "anyOf": [ { "description": "Font of the title. (e.g., `\"Helvetica Neue\"`).", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "titleFontSize": { "anyOf": [ { "description": "Font size of the title.", "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "titleFontStyle": { "anyOf": [ { "$ref": "#/definitions/FontStyle", "description": "Font style of the title." }, { "$ref": "#/definitions/ExprRef" } ] }, "titleFontWeight": { "anyOf": [ { "$ref": "#/definitions/FontWeight", "description": "Font weight of the title. This can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." }, { "$ref": "#/definitions/ExprRef" } ] }, "titleLimit": { "anyOf": [ { "description": "Maximum allowed pixel width of axis titles.", "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "titleLineHeight": { "anyOf": [ { "description": "Line height in pixels for multi-line title text or title text with `\"line-top\"` or `\"line-bottom\"` baseline.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "titleOpacity": { "anyOf": [ { "description": "Opacity of the axis title.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "titlePadding": { "anyOf": [ { "description": "The padding, in pixels, between title and axis.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "titleX": { "anyOf": [ { "description": "X-coordinate of the axis title relative to the axis group.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "titleY": { "anyOf": [ { "description": "Y-coordinate of the axis title relative to the axis group.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "translate": { "anyOf": [ { "description": "Coordinate space translation offset for axis layout. By default, axes are translated by a 0.5 pixel offset for both the x and y coordinates in order to align stroked lines with the pixel grid. However, for vector graphics output these pixel-specific adjustments may be undesirable, in which case translate can be changed (for example, to zero).\n\n__Default value:__ `0.5`", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "values": { "anyOf": [ { "items": { "type": "number" }, "type": "array" }, { "items": { "type": "string" }, "type": "array" }, { "items": { "type": "boolean" }, "type": "array" }, { "items": { "$ref": "#/definitions/DateTime" }, "type": "array" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Explicitly set the visible axis tick values." }, "zindex": { "description": "A non-negative integer indicating the z-index of the axis. If zindex is 0, axes should be drawn behind all chart elements. To put them in front, set `zindex` to `1` or more.\n\n__Default value:__ `0` (behind the marks).", "minimum": 0, "type": "number" } }, "type": "object" }, "AxisConfig": { "additionalProperties": false, "properties": { "aria": { "anyOf": [ { "description": "A boolean flag indicating if [ARIA attributes](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) should be included (SVG output only). If `false`, the \"aria-hidden\" attribute will be set on the output SVG group, removing the axis from the ARIA accessibility tree.\n\n__Default value:__ `true`", "type": "boolean" }, { "$ref": "#/definitions/ExprRef" } ] }, "bandPosition": { "anyOf": [ { "description": "An interpolation fraction indicating where, for `band` scales, axis ticks should be positioned. A value of `0` places ticks at the left edge of their bands. A value of `0.5` places ticks in the middle of their bands.\n\n __Default value:__ `0.5`", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "description": { "anyOf": [ { "description": "A text description of this axis for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only). If the `aria` property is true, for SVG output the [\"aria-label\" attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute) will be set to this description. If the description is unspecified it will be automatically generated.", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "disable": { "description": "Disable axis by default.", "type": "boolean" }, "domain": { "description": "A boolean flag indicating if the domain (the axis baseline) should be included as part of the axis.\n\n__Default value:__ `true`", "type": "boolean" }, "domainCap": { "anyOf": [ { "$ref": "#/definitions/StrokeCap", "description": "The stroke cap for the domain line's ending style. One of `\"butt\"`, `\"round\"` or `\"square\"`.\n\n__Default value:__ `\"butt\"`" }, { "$ref": "#/definitions/ExprRef" } ] }, "domainColor": { "anyOf": [ { "anyOf": [ { "type": "null" }, { "$ref": "#/definitions/Color" } ], "description": "Color of axis domain line.\n\n__Default value:__ `\"gray\"`." }, { "$ref": "#/definitions/ExprRef" } ] }, "domainDash": { "anyOf": [ { "description": "An array of alternating [stroke, space] lengths for dashed domain lines.", "items": { "type": "number" }, "type": "array" }, { "$ref": "#/definitions/ExprRef" } ] }, "domainDashOffset": { "anyOf": [ { "description": "The pixel offset at which to start drawing with the domain dash array.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "domainOpacity": { "anyOf": [ { "description": "Opacity of the axis domain line.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "domainWidth": { "anyOf": [ { "description": "Stroke width of axis domain line\n\n__Default value:__ `1`", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "format": { "anyOf": [ { "type": "string" }, { "$ref": "#/definitions/Dict" } ], "description": "When used with the default `\"number\"` and `\"time\"` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks.\n\n- If the format type is `\"number\"` (e.g., for quantitative fields), this is D3's [number format pattern](https://github.com/d3/d3-format#locale_format).\n- If the format type is `\"time\"` (e.g., for temporal fields), this is D3's [time format pattern](https://github.com/d3/d3-time-format#locale_format).\n\nSee the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for more examples.\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." }, "formatType": { "description": "The format type for labels. One of `\"number\"`, `\"time\"`, or a [registered custom format type](https://vega.github.io/vega-lite/docs/config.html#custom-format-type).\n\n__Default value:__\n- `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`.\n- `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", "type": "string" }, "grid": { "description": "A boolean flag indicating if grid lines should be included as part of the axis\n\n__Default value:__ `true` for [continuous scales](https://vega.github.io/vega-lite/docs/scale.html#continuous) that are not binned; otherwise, `false`.", "type": "boolean" }, "gridCap": { "anyOf": [ { "$ref": "#/definitions/StrokeCap", "description": "The stroke cap for grid lines' ending style. One of `\"butt\"`, `\"round\"` or `\"square\"`.\n\n__Default value:__ `\"butt\"`" }, { "$ref": "#/definitions/ExprRef" } ] }, "gridColor": { "anyOf": [ { "anyOf": [ { "type": "null" }, { "$ref": "#/definitions/Color" } ], "description": "Color of gridlines.\n\n__Default value:__ `\"lightGray\"`." }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/ConditionalAxisColor" } ] }, "gridDash": { "anyOf": [ { "description": "An array of alternating [stroke, space] lengths for dashed grid lines.", "items": { "type": "number" }, "type": "array" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/ConditionalAxisNumberArray" } ] }, "gridDashOffset": { "anyOf": [ { "description": "The pixel offset at which to start drawing with the grid dash array.", "type": "number" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/ConditionalAxisNumber" } ] }, "gridOpacity": { "anyOf": [ { "description": "The stroke opacity of grid (value between [0,1])\n\n__Default value:__ `1`", "maximum": 1, "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/ConditionalAxisNumber" } ] }, "gridWidth": { "anyOf": [ { "description": "The grid width, in pixels.\n\n__Default value:__ `1`", "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/ConditionalAxisNumber" } ] }, "labelAlign": { "anyOf": [ { "$ref": "#/definitions/Align", "description": "Horizontal text alignment of axis tick labels, overriding the default setting for the current axis orientation." }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/ConditionalAxisLabelAlign" } ] }, "labelAngle": { "anyOf": [ { "description": "The rotation angle of the axis labels.\n\n__Default value:__ `-90` for nominal and ordinal fields; `0` otherwise.", "maximum": 360, "minimum": -360, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "labelBaseline": { "anyOf": [ { "$ref": "#/definitions/TextBaseline", "description": "Vertical text baseline of axis tick labels, overriding the default setting for the current axis orientation. One of `\"alphabetic\"` (default), `\"top\"`, `\"middle\"`, `\"bottom\"`, `\"line-top\"`, or `\"line-bottom\"`. The `\"line-top\"` and `\"line-bottom\"` values operate similarly to `\"top\"` and `\"bottom\"`, but are calculated relative to the *lineHeight* rather than *fontSize* alone." }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/ConditionalAxisLabelBaseline" } ] }, "labelBound": { "anyOf": [ { "description": "Indicates if labels should be hidden if they exceed the axis range. If `false` (the default) no bounds overlap analysis is performed. If `true`, labels will be hidden if they exceed the axis range by more than 1 pixel. If this property is a number, it specifies the pixel tolerance: the maximum amount by which a label bounding box may exceed the axis range.\n\n__Default value:__ `false`.", "type": [ "number", "boolean" ] }, { "$ref": "#/definitions/ExprRef" } ] }, "labelColor": { "anyOf": [ { "anyOf": [ { "type": "null" }, { "$ref": "#/definitions/Color" } ], "description": "The color of the tick label, can be in hex color code or regular color name." }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/ConditionalAxisColor" } ] }, "labelExpr": { "description": "[Vega expression](https://vega.github.io/vega/docs/expressions/) for customizing labels.\n\n__Note:__ The label text and value can be assessed via the `label` and `value` properties of the axis's backing `datum` object.", "type": "string" }, "labelFlush": { "description": "Indicates if the first and last axis labels should be aligned flush with the scale range. Flush alignment for a horizontal axis will left-align the first label and right-align the last label. For vertical axes, bottom and top text baselines are applied instead. If this property is a number, it also indicates the number of pixels by which to offset the first and last labels; for example, a value of 2 will flush-align the first and last labels and also push them 2 pixels outward from the center of the axis. The additional adjustment can sometimes help the labels better visually group with corresponding axis ticks.\n\n__Default value:__ `true` for axis of a continuous x-scale. Otherwise, `false`.", "type": [ "boolean", "number" ] }, "labelFlushOffset": { "anyOf": [ { "description": "Indicates the number of pixels by which to offset flush-adjusted labels. For example, a value of `2` will push flush-adjusted labels 2 pixels outward from the center of the axis. Offsets can help the labels better visually group with corresponding axis ticks.\n\n__Default value:__ `0`.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "labelFont": { "anyOf": [ { "description": "The font of the tick label.", "type": "string" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/ConditionalAxisString" } ] }, "labelFontSize": { "anyOf": [ { "description": "The font size of the label, in pixels.", "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/ConditionalAxisNumber" } ] }, "labelFontStyle": { "anyOf": [ { "$ref": "#/definitions/FontStyle", "description": "Font style of the title." }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/ConditionalAxisLabelFontStyle" } ] }, "labelFontWeight": { "anyOf": [ { "$ref": "#/definitions/FontWeight", "description": "Font weight of axis tick labels." }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/ConditionalAxisLabelFontWeight" } ] }, "labelLimit": { "anyOf": [ { "description": "Maximum allowed pixel width of axis tick labels.\n\n__Default value:__ `180`", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "labelLineHeight": { "anyOf": [ { "description": "Line height in pixels for multi-line label text or label text with `\"line-top\"` or `\"line-bottom\"` baseline.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "labelOffset": { "anyOf": [ { "description": "Position offset in pixels to apply to labels, in addition to tickOffset.\n\n__Default value:__ `0`", "type": "number" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/ConditionalAxisNumber" } ] }, "labelOpacity": { "anyOf": [ { "description": "The opacity of the labels.", "type": "number" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/ConditionalAxisNumber" } ] }, "labelOverlap": { "anyOf": [ { "$ref": "#/definitions/LabelOverlap" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The strategy to use for resolving overlap of axis labels. If `false` (the default), no overlap reduction is attempted. If set to `true` or `\"parity\"`, a strategy of removing every other label is used (this works well for standard linear axes). If set to `\"greedy\"`, a linear scan of the labels is performed, removing any labels that overlaps with the last visible label (this often works better for log-scaled axes).\n\n__Default value:__ `true` for non-nominal fields with non-log scales; `\"greedy\"` for log scales; otherwise `false`." }, "labelPadding": { "anyOf": [ { "description": "The padding in pixels between labels and ticks.\n\n__Default value:__ `2`", "type": "number" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/ConditionalAxisNumber" } ] }, "labelSeparation": { "anyOf": [ { "description": "The minimum separation that must be between label bounding boxes for them to be considered non-overlapping (default `0`). This property is ignored if *labelOverlap* resolution is not enabled.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "labels": { "description": "A boolean flag indicating if labels should be included as part of the axis.\n\n__Default value:__ `true`.", "type": "boolean" }, "maxExtent": { "anyOf": [ { "description": "The maximum extent in pixels that axis ticks and labels should use. This determines a maximum offset value for axis titles.\n\n__Default value:__ `undefined`.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "minExtent": { "anyOf": [ { "description": "The minimum extent in pixels that axis ticks and labels should use. This determines a minimum offset value for axis titles.\n\n__Default value:__ `30` for y-axis; `undefined` for x-axis.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "offset": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The offset, in pixels, by which to displace the axis from the edge of the enclosing group or data rectangle.\n\n__Default value:__ derived from the [axis config](https://vega.github.io/vega-lite/docs/config.html#facet-scale-config)'s `offset` (`0` by default)" }, "orient": { "anyOf": [ { "$ref": "#/definitions/AxisOrient" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The orientation of the axis. One of `\"top\"`, `\"bottom\"`, `\"left\"` or `\"right\"`. The orientation can be used to further specialize the axis type (e.g., a y-axis oriented towards the right edge of the chart).\n\n__Default value:__ `\"bottom\"` for x-axes and `\"left\"` for y-axes." }, "position": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The anchor position of the axis in pixels. For x-axes with top or bottom orientation, this sets the axis group x coordinate. For y-axes with left or right orientation, this sets the axis group y coordinate.\n\n__Default value__: `0`" }, "style": { "anyOf": [ { "type": "string" }, { "items": { "type": "string" }, "type": "array" } ], "description": "A string or array of strings indicating the name of custom styles to apply to the axis. A style is a named collection of axis property defined within the [style configuration](https://vega.github.io/vega-lite/docs/mark.html#style-config). If style is an array, later styles will override earlier styles.\n\n__Default value:__ (none) __Note:__ Any specified style will augment the default style. For example, an x-axis mark with `\"style\": \"foo\"` will use `config.axisX` and `config.style.foo` (the specified style `\"foo\"` has higher precedence)." }, "tickBand": { "anyOf": [ { "description": "For band scales, indicates if ticks and grid lines should be placed at the `\"center\"` of a band (default) or at the band `\"extent\"`s to indicate intervals", "enum": [ "center", "extent" ], "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "tickCap": { "anyOf": [ { "$ref": "#/definitions/StrokeCap", "description": "The stroke cap for the tick lines' ending style. One of `\"butt\"`, `\"round\"` or `\"square\"`.\n\n__Default value:__ `\"butt\"`" }, { "$ref": "#/definitions/ExprRef" } ] }, "tickColor": { "anyOf": [ { "anyOf": [ { "type": "null" }, { "$ref": "#/definitions/Color" } ], "description": "The color of the axis's tick.\n\n__Default value:__ `\"gray\"`" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/ConditionalAxisColor" } ] }, "tickCount": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/TimeInterval" }, { "$ref": "#/definitions/TimeIntervalStep" }, { "$ref": "#/definitions/ExprRef" } ], "description": "A desired number of ticks, for axes visualizing quantitative scales. The resulting number may be different so that values are \"nice\" (multiples of 2, 5, 10) and lie within the underlying scale's range.\n\nFor scales of type `\"time\"` or `\"utc\"`, the tick count can instead be a time interval specifier. Legal string values are `\"millisecond\"`, `\"second\"`, `\"minute\"`, `\"hour\"`, `\"day\"`, `\"week\"`, `\"month\"`, and `\"year\"`. Alternatively, an object-valued interval specifier of the form `{\"interval\": \"month\", \"step\": 3}` includes a desired number of interval steps. Here, ticks are generated for each quarter (Jan, Apr, Jul, Oct) boundary.\n\n__Default value__: Determine using a formula `ceil(width/40)` for x and `ceil(height/40)` for y.", "minimum": 0 }, "tickDash": { "anyOf": [ { "description": "An array of alternating [stroke, space] lengths for dashed tick mark lines.", "items": { "type": "number" }, "type": "array" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/ConditionalAxisNumberArray" } ] }, "tickDashOffset": { "anyOf": [ { "description": "The pixel offset at which to start drawing with the tick mark dash array.", "type": "number" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/ConditionalAxisNumber" } ] }, "tickExtra": { "description": "Boolean flag indicating if an extra axis tick should be added for the initial position of the axis. This flag is useful for styling axes for `band` scales such that ticks are placed on band boundaries rather in the middle of a band. Use in conjunction with `\"bandPosition\": 1` and an axis `\"padding\"` value of `0`.", "type": "boolean" }, "tickMinStep": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The minimum desired step between axis ticks, in terms of scale domain values. For example, a value of `1` indicates that ticks should not be less than 1 unit apart. If `tickMinStep` is specified, the `tickCount` value will be adjusted, if necessary, to enforce the minimum step value." }, "tickOffset": { "anyOf": [ { "description": "Position offset in pixels to apply to ticks, labels, and gridlines.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "tickOpacity": { "anyOf": [ { "description": "Opacity of the ticks.", "type": "number" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/ConditionalAxisNumber" } ] }, "tickRound": { "description": "Boolean flag indicating if pixel position values should be rounded to the nearest integer.\n\n__Default value:__ `true`", "type": "boolean" }, "tickSize": { "anyOf": [ { "description": "The size in pixels of axis ticks.\n\n__Default value:__ `5`", "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/ConditionalAxisNumber" } ] }, "tickWidth": { "anyOf": [ { "description": "The width, in pixels, of ticks.\n\n__Default value:__ `1`", "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/ConditionalAxisNumber" } ] }, "ticks": { "description": "Boolean value that determines whether the axis should include ticks.\n\n__Default value:__ `true`", "type": "boolean" }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "titleAlign": { "anyOf": [ { "$ref": "#/definitions/Align", "description": "Horizontal text alignment of axis titles." }, { "$ref": "#/definitions/ExprRef" } ] }, "titleAnchor": { "anyOf": [ { "$ref": "#/definitions/TitleAnchor", "description": "Text anchor position for placing axis titles." }, { "$ref": "#/definitions/ExprRef" } ] }, "titleAngle": { "anyOf": [ { "description": "Angle in degrees of axis titles.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "titleBaseline": { "anyOf": [ { "$ref": "#/definitions/TextBaseline", "description": "Vertical text baseline for axis titles. One of `\"alphabetic\"` (default), `\"top\"`, `\"middle\"`, `\"bottom\"`, `\"line-top\"`, or `\"line-bottom\"`. The `\"line-top\"` and `\"line-bottom\"` values operate similarly to `\"top\"` and `\"bottom\"`, but are calculated relative to the *lineHeight* rather than *fontSize* alone." }, { "$ref": "#/definitions/ExprRef" } ] }, "titleColor": { "anyOf": [ { "anyOf": [ { "type": "null" }, { "$ref": "#/definitions/Color" } ], "description": "Color of the title, can be in hex color code or regular color name." }, { "$ref": "#/definitions/ExprRef" } ] }, "titleFont": { "anyOf": [ { "description": "Font of the title. (e.g., `\"Helvetica Neue\"`).", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "titleFontSize": { "anyOf": [ { "description": "Font size of the title.", "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "titleFontStyle": { "anyOf": [ { "$ref": "#/definitions/FontStyle", "description": "Font style of the title." }, { "$ref": "#/definitions/ExprRef" } ] }, "titleFontWeight": { "anyOf": [ { "$ref": "#/definitions/FontWeight", "description": "Font weight of the title. This can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." }, { "$ref": "#/definitions/ExprRef" } ] }, "titleLimit": { "anyOf": [ { "description": "Maximum allowed pixel width of axis titles.", "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "titleLineHeight": { "anyOf": [ { "description": "Line height in pixels for multi-line title text or title text with `\"line-top\"` or `\"line-bottom\"` baseline.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "titleOpacity": { "anyOf": [ { "description": "Opacity of the axis title.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "titlePadding": { "anyOf": [ { "description": "The padding, in pixels, between title and axis.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "titleX": { "anyOf": [ { "description": "X-coordinate of the axis title relative to the axis group.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "titleY": { "anyOf": [ { "description": "Y-coordinate of the axis title relative to the axis group.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "translate": { "anyOf": [ { "description": "Coordinate space translation offset for axis layout. By default, axes are translated by a 0.5 pixel offset for both the x and y coordinates in order to align stroked lines with the pixel grid. However, for vector graphics output these pixel-specific adjustments may be undesirable, in which case translate can be changed (for example, to zero).\n\n__Default value:__ `0.5`", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "values": { "anyOf": [ { "items": { "type": "number" }, "type": "array" }, { "items": { "type": "string" }, "type": "array" }, { "items": { "type": "boolean" }, "type": "array" }, { "items": { "$ref": "#/definitions/DateTime" }, "type": "array" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Explicitly set the visible axis tick values." }, "zindex": { "description": "A non-negative integer indicating the z-index of the axis. If zindex is 0, axes should be drawn behind all chart elements. To put them in front, set `zindex` to `1` or more.\n\n__Default value:__ `0` (behind the marks).", "minimum": 0, "type": "number" } }, "type": "object" }, "AxisOrient": { "enum": [ "top", "bottom", "left", "right" ], "type": "string" }, "AxisResolveMap": { "additionalProperties": false, "properties": { "x": { "$ref": "#/definitions/ResolveMode" }, "y": { "$ref": "#/definitions/ResolveMode" } }, "type": "object" }, "BBox": { "anyOf": [ { "items": { "type": "number" }, "maxItems": 4, "minItems": 4, "type": "array" }, { "items": { "type": "number" }, "maxItems": 6, "minItems": 6, "type": "array" } ], "description": "Bounding box https://tools.ietf.org/html/rfc7946#section-5" }, "BarConfig": { "additionalProperties": false, "properties": { "align": { "anyOf": [ { "$ref": "#/definitions/Align" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of `\"left\"`, `\"right\"`, `\"center\"`.\n\n__Note:__ Expression reference is *not* supported for range marks." }, "angle": { "anyOf": [ { "description": "The rotation angle of the text, in degrees.", "maximum": 360, "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "aria": { "anyOf": [ { "description": "A boolean flag indicating if [ARIA attributes](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) should be included (SVG output only). If `false`, the \"aria-hidden\" attribute will be set on the output SVG element, removing the mark item from the ARIA accessibility tree.", "type": "boolean" }, { "$ref": "#/definitions/ExprRef" } ] }, "ariaRole": { "anyOf": [ { "description": "Sets the type of user interface element of the mark item for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only). If specified, this property determines the \"role\" attribute. Warning: this property is experimental and may be changed in the future.", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "ariaRoleDescription": { "anyOf": [ { "description": "A human-readable, author-localized description for the role of the mark item for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only). If specified, this property determines the \"aria-roledescription\" attribute. Warning: this property is experimental and may be changed in the future.", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "aspect": { "anyOf": [ { "description": "Whether to keep aspect ratio of image marks.", "type": "boolean" }, { "$ref": "#/definitions/ExprRef" } ] }, "baseline": { "anyOf": [ { "$ref": "#/definitions/TextBaseline" }, { "$ref": "#/definitions/ExprRef" } ], "description": "For text marks, the vertical text baseline. One of `\"alphabetic\"` (default), `\"top\"`, `\"middle\"`, `\"bottom\"`, `\"line-top\"`, `\"line-bottom\"`, or an expression reference that provides one of the valid values. The `\"line-top\"` and `\"line-bottom\"` values operate similarly to `\"top\"` and `\"bottom\"`, but are calculated relative to the `lineHeight` rather than `fontSize` alone.\n\nFor range marks, the vertical alignment of the marks. One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Note:__ Expression reference is *not* supported for range marks." }, "binSpacing": { "description": "Offset between bars for binned field. The ideal value for this is either 0 (preferred by statisticians) or 1 (Vega-Lite default, D3 example style).\n\n__Default value:__ `1`", "minimum": 0, "type": "number" }, "blend": { "anyOf": [ { "$ref": "#/definitions/Blend", "description": "The color blend mode for drawing an item on its current background. Any valid [CSS mix-blend-mode](https://developer.mozilla.org/en-US/docs/Web/CSS/mix-blend-mode) value can be used.\n\n__Default value: `\"source-over\"`" }, { "$ref": "#/definitions/ExprRef" } ] }, "color": { "anyOf": [ { "$ref": "#/definitions/Color" }, { "$ref": "#/definitions/Gradient" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Default color.\n\n__Default value:__ `\"#4682b4\"`\n\n__Note:__\n- This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).\n- The `fill` and `stroke` properties have higher precedence than `color` and will override `color`." }, "continuousBandSize": { "description": "The default size of the bars on continuous scales.\n\n__Default value:__ `5`", "minimum": 0, "type": "number" }, "cornerRadius": { "anyOf": [ { "description": "The radius in pixels of rounded rectangles or arcs' corners.\n\n__Default value:__ `0`", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "cornerRadiusBottomLeft": { "anyOf": [ { "description": "The radius in pixels of rounded rectangles' bottom left corner.\n\n__Default value:__ `0`", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "cornerRadiusBottomRight": { "anyOf": [ { "description": "The radius in pixels of rounded rectangles' bottom right corner.\n\n__Default value:__ `0`", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "cornerRadiusEnd": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "- For vertical bars, top-left and top-right corner radius.\n\n- For horizontal bars, top-right and bottom-right corner radius." }, "cornerRadiusTopLeft": { "anyOf": [ { "description": "The radius in pixels of rounded rectangles' top right corner.\n\n__Default value:__ `0`", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "cornerRadiusTopRight": { "anyOf": [ { "description": "The radius in pixels of rounded rectangles' top left corner.\n\n__Default value:__ `0`", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "cursor": { "anyOf": [ { "$ref": "#/definitions/Cursor", "description": "The mouse cursor used over the mark. Any valid [CSS cursor type](https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values) can be used." }, { "$ref": "#/definitions/ExprRef" } ] }, "description": { "anyOf": [ { "description": "A text description of the mark item for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only). If specified, this property determines the [\"aria-label\" attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute).", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "dir": { "anyOf": [ { "$ref": "#/definitions/TextDirection", "description": "The direction of the text. One of `\"ltr\"` (left-to-right) or `\"rtl\"` (right-to-left). This property determines on which side is truncated in response to the limit parameter.\n\n__Default value:__ `\"ltr\"`" }, { "$ref": "#/definitions/ExprRef" } ] }, "discreteBandSize": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/RelativeBandSize" } ], "description": "The default size of the bars with discrete dimensions. If unspecified, the default size is `step-2`, which provides 2 pixel offset between bars.", "minimum": 0 }, "dx": { "anyOf": [ { "description": "The horizontal offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "dy": { "anyOf": [ { "description": "The vertical offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "ellipsis": { "anyOf": [ { "description": "The ellipsis string for text truncated in response to the limit parameter.\n\n__Default value:__ `\"…\"`", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "endAngle": { "anyOf": [ { "description": "The end angle in radians for arc marks. A value of `0` indicates up (north), increasing values proceed clockwise.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "fill": { "anyOf": [ { "$ref": "#/definitions/Color" }, { "$ref": "#/definitions/Gradient" }, { "type": "null" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Default fill color. This property has higher precedence than `config.color`. Set to `null` to remove fill.\n\n__Default value:__ (None)" }, "fillOpacity": { "anyOf": [ { "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", "maximum": 1, "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "filled": { "description": "Whether the mark's color should be used as fill color instead of stroke color.\n\n__Default value:__ `false` for all `point`, `line`, and `rule` marks as well as `geoshape` marks for [`graticule`](https://vega.github.io/vega-lite/docs/data.html#graticule) data sources; otherwise, `true`.\n\n__Note:__ This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).", "type": "boolean" }, "font": { "anyOf": [ { "description": "The typeface to set the text in (e.g., `\"Helvetica Neue\"`).", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "fontSize": { "anyOf": [ { "description": "The font size, in pixels.\n\n__Default value:__ `11`", "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "fontStyle": { "anyOf": [ { "$ref": "#/definitions/FontStyle", "description": "The font style (e.g., `\"italic\"`)." }, { "$ref": "#/definitions/ExprRef" } ] }, "fontWeight": { "anyOf": [ { "$ref": "#/definitions/FontWeight", "description": "The font weight. This can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." }, { "$ref": "#/definitions/ExprRef" } ] }, "height": { "anyOf": [ { "description": "Height of the marks.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "href": { "anyOf": [ { "$ref": "#/definitions/URI", "description": "A URL to load upon mouse click. If defined, the mark acts as a hyperlink." }, { "$ref": "#/definitions/ExprRef" } ] }, "innerRadius": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The inner radius in pixels of arc marks. `innerRadius` is an alias for `radius2`.\n\n__Default value:__ `0`", "minimum": 0 }, "interpolate": { "anyOf": [ { "$ref": "#/definitions/Interpolate", "description": "The line interpolation method to use for line and area marks. One of the following:\n- `\"linear\"`: piecewise linear segments, as in a polyline.\n- `\"linear-closed\"`: close the linear segments to form a polygon.\n- `\"step\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"step-before\"`: alternate between vertical and horizontal segments, as in a step function.\n- `\"step-after\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"basis\"`: a B-spline, with control point duplication on the ends.\n- `\"basis-open\"`: an open B-spline; may not intersect the start or end.\n- `\"basis-closed\"`: a closed B-spline, as in a loop.\n- `\"cardinal\"`: a Cardinal spline, with control point duplication on the ends.\n- `\"cardinal-open\"`: an open Cardinal spline; may not intersect the start or end, but will intersect other control points.\n- `\"cardinal-closed\"`: a closed Cardinal spline, as in a loop.\n- `\"bundle\"`: equivalent to basis, except the tension parameter is used to straighten the spline.\n- `\"monotone\"`: cubic interpolation that preserves monotonicity in y." }, { "$ref": "#/definitions/ExprRef" } ] }, "invalid": { "anyOf": [ { "$ref": "#/definitions/MarkInvalidDataMode" }, { "type": "null" } ], "description": "Invalid data mode, which defines how the marks and corresponding scales should represent invalid values (`null` and `NaN` in continuous scales *without* defined output for invalid values).\n\n- `\"filter\"` — *Exclude* all invalid values from the visualization's *marks* and *scales*. For path marks (for line, area, trail), this option will create paths that connect valid points, as if the data rows with invalid values do not exist.\n\n- `\"break-paths-filter-domains\"` — Break path marks (for line, area, trail) at invalid values. For non-path marks, this is equivalent to `\"filter\"`. All *scale* domains will *exclude* these filtered data points.\n\n- `\"break-paths-show-domains\"` — Break paths (for line, area, trail) at invalid values. Hide invalid values for non-path marks. All *scale* domains will *include* these filtered data points (for both path and non-path marks).\n\n- `\"show\"` or `null` — Show all data points in the marks and scale domains. Each scale will use the output for invalid values defined in `config.scale.invalid` or, if unspecified, by default invalid values will produce the same visual values as zero (if the scale includes zero) or the minimum value (if the scale does not include zero).\n\n- `\"break-paths-show-path-domains\"` (default) — This is equivalent to `\"break-paths-show-domains\"` for path-based marks (line/area/trail) and `\"filter\"` for non-path marks.\n\n__Note__: If any channel's scale has an output for invalid values defined in `config.scale.invalid`, all values for the scales will be considered \"valid\" since they can produce a reasonable output for the scales. Thus, fields for such channels will not be filtered and will not cause path breaks." }, "limit": { "anyOf": [ { "description": "The maximum length of the text mark in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.\n\n__Default value:__ `0` -- indicating no limit", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "lineBreak": { "anyOf": [ { "description": "A delimiter, such as a newline character, upon which to break text strings into multiple lines. This property is ignored if the text is array-valued.", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "lineHeight": { "anyOf": [ { "description": "The line height in pixels (the spacing between subsequent lines of text) for multi-line text marks.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "minBandSize": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The minimum band size for bar and rectangle marks. __Default value:__ `0.25`" }, "opacity": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The overall opacity (value between [0,1]).\n\n__Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or `square` marks or layered `bar` charts and `1` otherwise.", "maximum": 1, "minimum": 0 }, "order": { "description": "For line and trail marks, this `order` property can be set to `null` or `false` to make the lines use the original order in the data sources.", "type": [ "null", "boolean" ] }, "orient": { "$ref": "#/definitions/Orientation", "description": "The orientation of a non-stacked bar, tick, area, and line charts. The value is either horizontal (default) or vertical.\n- For bar, rule and tick, this determines whether the size of the bar and tick should be applied to x or y dimension.\n- For area, this property determines the orient property of the Vega output.\n- For line and trail marks, this property determines the sort order of the points in the line if `config.sortLineBy` is not specified. For stacked charts, this is always determined by the orientation of the stack; therefore explicitly specified value will be ignored." }, "outerRadius": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The outer radius in pixels of arc marks. `outerRadius` is an alias for `radius`.\n\n__Default value:__ `0`", "minimum": 0 }, "padAngle": { "anyOf": [ { "description": "The angular padding applied to sides of the arc, in radians.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "radius": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "For arc mark, the primary (outer) radius in pixels.\n\nFor text marks, polar coordinate radial offset, in pixels, of the text from the origin determined by the `x` and `y` properties.\n\n__Default value:__ `min(plot_width, plot_height)/2`", "minimum": 0 }, "radius2": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The secondary (inner) radius in pixels of arc marks.\n\n__Default value:__ `0`", "minimum": 0 }, "shape": { "anyOf": [ { "anyOf": [ { "$ref": "#/definitions/SymbolShape" }, { "type": "string" } ], "description": "Shape of the point marks. Supported values include:\n- plotting shapes: `\"circle\"`, `\"square\"`, `\"cross\"`, `\"diamond\"`, `\"triangle-up\"`, `\"triangle-down\"`, `\"triangle-right\"`, or `\"triangle-left\"`.\n- the line symbol `\"stroke\"`\n- centered directional shapes `\"arrow\"`, `\"wedge\"`, or `\"triangle\"`\n- a custom [SVG path string](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths) (For correct sizing, custom shape paths should be defined within a square bounding box with coordinates ranging from -1 to 1 along both the x and y dimensions.)\n\n__Default value:__ `\"circle\"`" }, { "$ref": "#/definitions/ExprRef" } ] }, "size": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Default size for marks.\n- For `point`/`circle`/`square`, this represents the pixel area of the marks. Note that this value sets the area of the symbol; the side lengths will increase with the square root of this value.\n- For `bar`, this represents the band size of the bar, in pixels.\n- For `text`, this represents the font size, in pixels.\n\n__Default value:__\n- `30` for point, circle, square marks; width/height's `step`\n- `2` for bar marks with discrete dimensions;\n- `5` for bar marks with continuous dimensions;\n- `11` for text marks.", "minimum": 0 }, "smooth": { "anyOf": [ { "description": "A boolean flag (default true) indicating if the image should be smoothed when resized. If false, individual pixels should be scaled directly rather than interpolated with smoothing. For SVG rendering, this option may not work in some browsers due to lack of standardization.", "type": "boolean" }, { "$ref": "#/definitions/ExprRef" } ] }, "startAngle": { "anyOf": [ { "description": "The start angle in radians for arc marks. A value of `0` indicates up (north), increasing values proceed clockwise.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "stroke": { "anyOf": [ { "$ref": "#/definitions/Color" }, { "$ref": "#/definitions/Gradient" }, { "type": "null" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Default stroke color. This property has higher precedence than `config.color`. Set to `null` to remove stroke.\n\n__Default value:__ (None)" }, "strokeCap": { "anyOf": [ { "$ref": "#/definitions/StrokeCap", "description": "The stroke cap for line ending style. One of `\"butt\"`, `\"round\"`, or `\"square\"`.\n\n__Default value:__ `\"butt\"`" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeDash": { "anyOf": [ { "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", "items": { "type": "number" }, "type": "array" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeDashOffset": { "anyOf": [ { "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeJoin": { "anyOf": [ { "$ref": "#/definitions/StrokeJoin", "description": "The stroke line join method. One of `\"miter\"`, `\"round\"` or `\"bevel\"`.\n\n__Default value:__ `\"miter\"`" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeMiterLimit": { "anyOf": [ { "description": "The miter limit at which to bevel a line join.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeOffset": { "anyOf": [ { "description": "The offset in pixels at which to draw the group stroke and fill. If unspecified, the default behavior is to dynamically offset stroked groups such that 1 pixel stroke widths align with the pixel grid.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeOpacity": { "anyOf": [ { "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", "maximum": 1, "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeWidth": { "anyOf": [ { "description": "The stroke width, in pixels.", "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "tension": { "anyOf": [ { "description": "Depending on the interpolation type, sets the tension parameter (for line and area marks).", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "text": { "anyOf": [ { "$ref": "#/definitions/Text", "description": "Placeholder text if the `text` channel is not specified" }, { "$ref": "#/definitions/ExprRef" } ] }, "theta": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "- For arc marks, the arc length in radians if theta2 is not specified, otherwise the start arc angle. (A value of 0 indicates up or “north”, increasing values proceed clockwise.)\n\n- For text marks, polar coordinate angle in radians.", "maximum": 360, "minimum": 0 }, "theta2": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise." }, "time": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "timeUnitBandPosition": { "description": "Default relative band position for a time unit. If set to `0`, the marks will be positioned at the beginning of the time unit band step. If set to `0.5`, the marks will be positioned in the middle of the time unit band step.", "type": "number" }, "timeUnitBandSize": { "description": "Default relative band size for a time unit. If set to `1`, the bandwidth of the marks will be equal to the time unit band step. If set to `0.5`, bandwidth of the marks will be half of the time unit band step.", "type": "number" }, "tooltip": { "anyOf": [ { "type": "number" }, { "type": "string" }, { "type": "boolean" }, { "$ref": "#/definitions/TooltipContent" }, { "$ref": "#/definitions/ExprRef" }, { "type": "null" } ], "description": "The tooltip text string to show upon mouse hover or an object defining which fields should the tooltip be derived from.\n\n- If `tooltip` is `true` or `{\"content\": \"encoding\"}`, then all fields from `encoding` will be used.\n- If `tooltip` is `{\"content\": \"data\"}`, then all fields that appear in the highlighted data point will be used.\n- If set to `null` or `false`, then no tooltip will be used.\n\nSee the [`tooltip`](https://vega.github.io/vega-lite/docs/tooltip.html) documentation for a detailed discussion about tooltip in Vega-Lite.\n\n__Default value:__ `null`" }, "url": { "anyOf": [ { "$ref": "#/definitions/URI", "description": "The URL of the image file for image marks." }, { "$ref": "#/definitions/ExprRef" } ] }, "width": { "anyOf": [ { "description": "Width of the marks.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "x": { "anyOf": [ { "type": "number" }, { "const": "width", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ], "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"` without specified `x2` or `width`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." }, "x2": { "anyOf": [ { "type": "number" }, { "const": "width", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ], "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." }, "y": { "anyOf": [ { "type": "number" }, { "const": "height", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"` without specified `y2` or `height`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." }, "y2": { "anyOf": [ { "type": "number" }, { "const": "height", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." } }, "type": "object" }, "BaseTitleNoValueRefs": { "additionalProperties": false, "properties": { "align": { "$ref": "#/definitions/Align", "description": "Horizontal text alignment for title text. One of `\"left\"`, `\"center\"`, or `\"right\"`." }, "anchor": { "anyOf": [ { "$ref": "#/definitions/TitleAnchor", "description": "The anchor position for placing the title and subtitle text. One of `\"start\"`, `\"middle\"`, or `\"end\"`. For example, with an orientation of top these anchor positions map to a left-, center-, or right-aligned title." }, { "$ref": "#/definitions/ExprRef" } ] }, "angle": { "anyOf": [ { "description": "Angle in degrees of title and subtitle text.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "aria": { "anyOf": [ { "description": "A boolean flag indicating if [ARIA attributes](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) should be included (SVG output only). If `false`, the \"aria-hidden\" attribute will be set on the output SVG group, removing the title from the ARIA accessibility tree.\n\n__Default value:__ `true`", "type": "boolean" }, { "$ref": "#/definitions/ExprRef" } ] }, "baseline": { "$ref": "#/definitions/TextBaseline", "description": "Vertical text baseline for title and subtitle text. One of `\"alphabetic\"` (default), `\"top\"`, `\"middle\"`, `\"bottom\"`, `\"line-top\"`, or `\"line-bottom\"`. The `\"line-top\"` and `\"line-bottom\"` values operate similarly to `\"top\"` and `\"bottom\"`, but are calculated relative to the *lineHeight* rather than *fontSize* alone." }, "color": { "anyOf": [ { "anyOf": [ { "type": "null" }, { "$ref": "#/definitions/Color" } ], "description": "Text color for title text." }, { "$ref": "#/definitions/ExprRef" } ] }, "dx": { "anyOf": [ { "description": "Delta offset for title and subtitle text x-coordinate.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "dy": { "anyOf": [ { "description": "Delta offset for title and subtitle text y-coordinate.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "font": { "anyOf": [ { "description": "Font name for title text.", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "fontSize": { "anyOf": [ { "description": "Font size in pixels for title text.", "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "fontStyle": { "anyOf": [ { "$ref": "#/definitions/FontStyle", "description": "Font style for title text." }, { "$ref": "#/definitions/ExprRef" } ] }, "fontWeight": { "anyOf": [ { "$ref": "#/definitions/FontWeight", "description": "Font weight for title text. This can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." }, { "$ref": "#/definitions/ExprRef" } ] }, "frame": { "anyOf": [ { "anyOf": [ { "$ref": "#/definitions/TitleFrame" }, { "type": "string" } ], "description": "The reference frame for the anchor position, one of `\"bounds\"` (to anchor relative to the full bounding box) or `\"group\"` (to anchor relative to the group width or height)." }, { "$ref": "#/definitions/ExprRef" } ] }, "limit": { "anyOf": [ { "description": "The maximum allowed length in pixels of title and subtitle text.", "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "lineHeight": { "anyOf": [ { "description": "Line height in pixels for multi-line title text or title text with `\"line-top\"` or `\"line-bottom\"` baseline.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "offset": { "anyOf": [ { "description": "The orthogonal offset in pixels by which to displace the title group from its position along the edge of the chart.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "orient": { "anyOf": [ { "$ref": "#/definitions/TitleOrient", "description": "Default title orientation (`\"top\"`, `\"bottom\"`, `\"left\"`, or `\"right\"`)" }, { "$ref": "#/definitions/ExprRef" } ] }, "subtitleColor": { "anyOf": [ { "anyOf": [ { "type": "null" }, { "$ref": "#/definitions/Color" } ], "description": "Text color for subtitle text." }, { "$ref": "#/definitions/ExprRef" } ] }, "subtitleFont": { "anyOf": [ { "description": "Font name for subtitle text.", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "subtitleFontSize": { "anyOf": [ { "description": "Font size in pixels for subtitle text.", "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "subtitleFontStyle": { "anyOf": [ { "$ref": "#/definitions/FontStyle", "description": "Font style for subtitle text." }, { "$ref": "#/definitions/ExprRef" } ] }, "subtitleFontWeight": { "anyOf": [ { "$ref": "#/definitions/FontWeight", "description": "Font weight for subtitle text. This can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." }, { "$ref": "#/definitions/ExprRef" } ] }, "subtitleLineHeight": { "anyOf": [ { "description": "Line height in pixels for multi-line subtitle text.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "subtitlePadding": { "anyOf": [ { "description": "The padding in pixels between title and subtitle text.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "zindex": { "anyOf": [ { "description": "The integer z-index indicating the layering of the title group relative to other axis, mark, and legend groups.\n\n__Default value:__ `0`.", "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] } }, "type": "object" }, "Baseline": { "enum": [ "top", "middle", "bottom" ], "type": "string" }, "BinExtent": { "anyOf": [ { "items": { "type": "number" }, "maxItems": 2, "minItems": 2, "type": "array" }, { "$ref": "#/definitions/ParameterExtent" } ] }, "BinParams": { "additionalProperties": false, "description": "Binning properties or boolean flag for determining whether to bin data or not.", "properties": { "anchor": { "description": "A value in the binned domain at which to anchor the bins, shifting the bin boundaries if necessary to ensure that a boundary aligns with the anchor value.\n\n__Default value:__ the minimum bin extent value", "type": "number" }, "base": { "description": "The number base to use for automatic bin determination (default is base 10).\n\n__Default value:__ `10`", "type": "number" }, "binned": { "description": "When set to `true`, Vega-Lite treats the input data as already binned.", "type": "boolean" }, "divide": { "description": "Scale factors indicating allowable subdivisions. The default value is [5, 2], which indicates that for base 10 numbers (the default base), the method may consider dividing bin sizes by 5 and/or 2. For example, for an initial step size of 10, the method can check if bin sizes of 2 (= 10/5), 5 (= 10/2), or 1 (= 10/(5*2)) might also satisfy the given constraints.\n\n__Default value:__ `[5, 2]`", "items": { "type": "number" }, "maxItems": 2, "minItems": 1, "type": "array" }, "extent": { "$ref": "#/definitions/BinExtent", "description": "A two-element (`[min, max]`) array indicating the range of desired bin values." }, "maxbins": { "description": "Maximum number of bins.\n\n__Default value:__ `6` for `row`, `column` and `shape` channels; `10` for other channels", "minimum": 2, "type": "number" }, "minstep": { "description": "A minimum allowable step size (particularly useful for integer values).", "type": "number" }, "nice": { "description": "If true, attempts to make the bin boundaries use human-friendly boundaries, such as multiples of ten.\n\n__Default value:__ `true`", "type": "boolean" }, "step": { "description": "An exact step size to use between bins.\n\n__Note:__ If provided, options such as maxbins will be ignored.", "type": "number" }, "steps": { "description": "An array of allowable step sizes to choose from.", "items": { "type": "number" }, "minItems": 1, "type": "array" } }, "type": "object" }, "BinTransform": { "additionalProperties": false, "properties": { "as": { "anyOf": [ { "$ref": "#/definitions/FieldName" }, { "items": { "$ref": "#/definitions/FieldName" }, "type": "array" } ], "description": "The output fields at which to write the start and end bin values. This can be either a string or an array of strings with two elements denoting the name for the fields for bin start and bin end respectively. If a single string (e.g., `\"val\"`) is provided, the end field will be `\"val_end\"`." }, "bin": { "anyOf": [ { "const": true, "type": "boolean" }, { "$ref": "#/definitions/BinParams" } ], "description": "An object indicating bin properties, or simply `true` for using default bin parameters." }, "field": { "$ref": "#/definitions/FieldName", "description": "The data field to bin." } }, "required": [ "bin", "field", "as" ], "type": "object" }, "BindCheckbox": { "additionalProperties": false, "properties": { "debounce": { "description": "If defined, delays event handling until the specified milliseconds have elapsed since the last event was fired.", "type": "number" }, "element": { "$ref": "#/definitions/Element", "description": "An optional CSS selector string indicating the parent element to which the input element should be added. By default, all input elements are added within the parent container of the Vega view." }, "input": { "const": "checkbox", "type": "string" }, "name": { "description": "By default, the signal name is used to label input elements. This `name` property can be used instead to specify a custom label for the bound signal.", "type": "string" } }, "required": [ "input" ], "type": "object" }, "BindDirect": { "additionalProperties": false, "properties": { "debounce": { "description": "If defined, delays event handling until the specified milliseconds have elapsed since the last event was fired.", "type": "number" }, "element": { "anyOf": [ { "$ref": "#/definitions/Element" }, { "additionalProperties": false, "type": "object" } ], "description": "An input element that exposes a _value_ property and supports the [EventTarget](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget) interface, or a CSS selector string to such an element. When the element updates and dispatches an event, the _value_ property will be used as the new, bound signal value. When the signal updates independent of the element, the _value_ property will be set to the signal value and a new event will be dispatched on the element." }, "event": { "description": "The event (default `\"input\"`) to listen for to track changes on the external element.", "type": "string" } }, "required": [ "element" ], "type": "object" }, "BindInput": { "additionalProperties": false, "properties": { "autocomplete": { "description": "A hint for form autofill. See the [HTML autocomplete attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete) for additional information.", "type": "string" }, "debounce": { "description": "If defined, delays event handling until the specified milliseconds have elapsed since the last event was fired.", "type": "number" }, "element": { "$ref": "#/definitions/Element", "description": "An optional CSS selector string indicating the parent element to which the input element should be added. By default, all input elements are added within the parent container of the Vega view." }, "input": { "description": "The type of input element to use. The valid values are `\"checkbox\"`, `\"radio\"`, `\"range\"`, `\"select\"`, and any other legal [HTML form input type](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input).", "type": "string" }, "name": { "description": "By default, the signal name is used to label input elements. This `name` property can be used instead to specify a custom label for the bound signal.", "type": "string" }, "placeholder": { "description": "Text that appears in the form control when it has no value set.", "type": "string" } }, "type": "object" }, "BindRadioSelect": { "additionalProperties": false, "properties": { "debounce": { "description": "If defined, delays event handling until the specified milliseconds have elapsed since the last event was fired.", "type": "number" }, "element": { "$ref": "#/definitions/Element", "description": "An optional CSS selector string indicating the parent element to which the input element should be added. By default, all input elements are added within the parent container of the Vega view." }, "input": { "enum": [ "radio", "select" ], "type": "string" }, "labels": { "description": "An array of label strings to represent the `options` values. If unspecified, the `options` value will be coerced to a string and used as the label.", "items": { "type": "string" }, "type": "array" }, "name": { "description": "By default, the signal name is used to label input elements. This `name` property can be used instead to specify a custom label for the bound signal.", "type": "string" }, "options": { "description": "An array of options to select from.", "items": {}, "type": "array" } }, "required": [ "input", "options" ], "type": "object" }, "BindRange": { "additionalProperties": false, "properties": { "debounce": { "description": "If defined, delays event handling until the specified milliseconds have elapsed since the last event was fired.", "type": "number" }, "element": { "$ref": "#/definitions/Element", "description": "An optional CSS selector string indicating the parent element to which the input element should be added. By default, all input elements are added within the parent container of the Vega view." }, "input": { "const": "range", "type": "string" }, "max": { "description": "Sets the maximum slider value. Defaults to the larger of the signal value and `100`.", "type": "number" }, "min": { "description": "Sets the minimum slider value. Defaults to the smaller of the signal value and `0`.", "type": "number" }, "name": { "description": "By default, the signal name is used to label input elements. This `name` property can be used instead to specify a custom label for the bound signal.", "type": "string" }, "step": { "description": "Sets the minimum slider increment. If undefined, the step size will be automatically determined based on the `min` and `max` values.", "type": "number" } }, "required": [ "input" ], "type": "object" }, "Binding": { "anyOf": [ { "$ref": "#/definitions/BindCheckbox" }, { "$ref": "#/definitions/BindRadioSelect" }, { "$ref": "#/definitions/BindRange" }, { "$ref": "#/definitions/BindInput" }, { "$ref": "#/definitions/BindDirect" } ] }, "BinnedTimeUnit": { "enum": [ "binnedyear", "binnedyearquarter", "binnedyearquartermonth", "binnedyearmonth", "binnedyearmonthdate", "binnedyearmonthdatehours", "binnedyearmonthdatehoursminutes", "binnedyearmonthdatehoursminutesseconds", "binnedyearweek", "binnedyearweekday", "binnedyearweekdayhours", "binnedyearweekdayhoursminutes", "binnedyearweekdayhoursminutesseconds", "binnedyeardayofyear", "binnedutcyear", "binnedutcyearquarter", "binnedutcyearquartermonth", "binnedutcyearmonth", "binnedutcyearmonthdate", "binnedutcyearmonthdatehours", "binnedutcyearmonthdatehoursminutes", "binnedutcyearmonthdatehoursminutesseconds", "binnedutcyearweek", "binnedutcyearweekday", "binnedutcyearweekdayhours", "binnedutcyearweekdayhoursminutes", "binnedutcyearweekdayhoursminutesseconds", "binnedutcyeardayofyear" ], "type": "string" }, "Blend": { "enum": [ null, "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity" ], "type": [ "null", "string" ] }, "BoxPlot": { "const": "boxplot", "type": "string" }, "BoxPlotConfig": { "additionalProperties": false, "properties": { "box": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/AnyMarkConfig" } ] }, "extent": { "anyOf": [ { "const": "min-max", "type": "string" }, { "type": "number" } ], "description": "The extent of the whiskers. Available options include:\n- `\"min-max\"`: min and max are the lower and upper whiskers respectively.\n- A number representing multiple of the interquartile range. This number will be multiplied by the IQR to determine whisker boundary, which spans from the smallest data to the largest data within the range _[Q1 - k * IQR, Q3 + k * IQR]_ where _Q1_ and _Q3_ are the first and third quartiles while _IQR_ is the interquartile range (_Q3-Q1_).\n\n__Default value:__ `1.5`." }, "median": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/AnyMarkConfig" } ] }, "outliers": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/AnyMarkConfig" } ] }, "rule": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/AnyMarkConfig" } ] }, "size": { "description": "Size of the box and median tick of a box plot", "type": "number" }, "ticks": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/AnyMarkConfig" } ] } }, "type": "object" }, "BoxPlotDef": { "additionalProperties": false, "properties": { "box": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/AnyMarkConfig" } ] }, "clip": { "description": "Whether a composite mark be clipped to the enclosing group’s width and height.", "type": "boolean" }, "color": { "anyOf": [ { "$ref": "#/definitions/Color" }, { "$ref": "#/definitions/Gradient" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Default color.\n\n__Default value:__ `\"#4682b4\"`\n\n__Note:__\n- This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).\n- The `fill` and `stroke` properties have higher precedence than `color` and will override `color`." }, "extent": { "anyOf": [ { "const": "min-max", "type": "string" }, { "type": "number" } ], "description": "The extent of the whiskers. Available options include:\n- `\"min-max\"`: min and max are the lower and upper whiskers respectively.\n- A number representing multiple of the interquartile range. This number will be multiplied by the IQR to determine whisker boundary, which spans from the smallest data to the largest data within the range _[Q1 - k * IQR, Q3 + k * IQR]_ where _Q1_ and _Q3_ are the first and third quartiles while _IQR_ is the interquartile range (_Q3-Q1_).\n\n__Default value:__ `1.5`." }, "invalid": { "anyOf": [ { "$ref": "#/definitions/MarkInvalidDataMode" }, { "type": "null" } ], "description": "Invalid data mode, which defines how the marks and corresponding scales should represent invalid values (`null` and `NaN` in continuous scales *without* defined output for invalid values).\n\n- `\"filter\"` — *Exclude* all invalid values from the visualization's *marks* and *scales*. For path marks (for line, area, trail), this option will create paths that connect valid points, as if the data rows with invalid values do not exist.\n\n- `\"break-paths-filter-domains\"` — Break path marks (for line, area, trail) at invalid values. For non-path marks, this is equivalent to `\"filter\"`. All *scale* domains will *exclude* these filtered data points.\n\n- `\"break-paths-show-domains\"` — Break paths (for line, area, trail) at invalid values. Hide invalid values for non-path marks. All *scale* domains will *include* these filtered data points (for both path and non-path marks).\n\n- `\"show\"` or `null` — Show all data points in the marks and scale domains. Each scale will use the output for invalid values defined in `config.scale.invalid` or, if unspecified, by default invalid values will produce the same visual values as zero (if the scale includes zero) or the minimum value (if the scale does not include zero).\n\n- `\"break-paths-show-path-domains\"` (default) — This is equivalent to `\"break-paths-show-domains\"` for path-based marks (line/area/trail) and `\"filter\"` for non-path marks.\n\n__Note__: If any channel's scale has an output for invalid values defined in `config.scale.invalid`, all values for the scales will be considered \"valid\" since they can produce a reasonable output for the scales. Thus, fields for such channels will not be filtered and will not cause path breaks." }, "median": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/AnyMarkConfig" } ] }, "opacity": { "description": "The opacity (value between [0,1]) of the mark.", "maximum": 1, "minimum": 0, "type": "number" }, "orient": { "$ref": "#/definitions/Orientation", "description": "Orientation of the box plot. This is normally automatically determined based on types of fields on x and y channels. However, an explicit `orient` be specified when the orientation is ambiguous.\n\n__Default value:__ `\"vertical\"`." }, "outliers": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/AnyMarkConfig" } ] }, "rule": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/AnyMarkConfig" } ] }, "size": { "description": "Size of the box and median tick of a box plot", "type": "number" }, "ticks": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/AnyMarkConfig" } ] }, "type": { "$ref": "#/definitions/BoxPlot", "description": "The mark type. This could a primitive mark type (one of `\"bar\"`, `\"circle\"`, `\"square\"`, `\"tick\"`, `\"line\"`, `\"area\"`, `\"point\"`, `\"geoshape\"`, `\"rule\"`, and `\"text\"`) or a composite mark type (`\"boxplot\"`, `\"errorband\"`, `\"errorbar\"`)." } }, "required": [ "type" ], "type": "object" }, "BrushConfig": { "additionalProperties": false, "properties": { "cursor": { "$ref": "#/definitions/Cursor", "description": "The mouse cursor used over the interval mark. Any valid [CSS cursor type](https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values) can be used." }, "fill": { "$ref": "#/definitions/Color", "description": "The fill color of the interval mark.\n\n__Default value:__ `\"#333333\"`" }, "fillOpacity": { "description": "The fill opacity of the interval mark (a value between `0` and `1`).\n\n__Default value:__ `0.125`", "type": "number" }, "stroke": { "$ref": "#/definitions/Color", "description": "The stroke color of the interval mark.\n\n__Default value:__ `\"#ffffff\"`" }, "strokeDash": { "description": "An array of alternating stroke and space lengths, for creating dashed or dotted lines.", "items": { "type": "number" }, "type": "array" }, "strokeDashOffset": { "description": "The offset (in pixels) with which to begin drawing the stroke dash array.", "type": "number" }, "strokeOpacity": { "description": "The stroke opacity of the interval mark (a value between `0` and `1`).", "type": "number" }, "strokeWidth": { "description": "The stroke width of the interval mark.", "type": "number" } }, "type": "object" }, "CalculateTransform": { "additionalProperties": false, "properties": { "as": { "$ref": "#/definitions/FieldName", "description": "The field for storing the computed formula value." }, "calculate": { "description": "A [expression](https://vega.github.io/vega-lite/docs/types.html#expression) string. Use the variable `datum` to refer to the current data object.", "type": "string" } }, "required": [ "calculate", "as" ], "type": "object" }, "Categorical": { "enum": [ "accent", "category10", "category20", "category20b", "category20c", "dark2", "paired", "pastel1", "pastel2", "set1", "set2", "set3", "tableau10", "tableau20", "observable10" ], "type": "string" }, "Color": { "anyOf": [ { "$ref": "#/definitions/ColorName" }, { "$ref": "#/definitions/HexColor" }, { "type": "string" } ] }, "ColorDef": { "$ref": "#/definitions/MarkPropDef<(Gradient|string|null)>" }, "ColorName": { "enum": [ "black", "silver", "gray", "white", "maroon", "red", "purple", "fuchsia", "green", "lime", "olive", "yellow", "navy", "blue", "teal", "aqua", "orange", "aliceblue", "antiquewhite", "aquamarine", "azure", "beige", "bisque", "blanchedalmond", "blueviolet", "brown", "burlywood", "cadetblue", "chartreuse", "chocolate", "coral", "cornflowerblue", "cornsilk", "crimson", "cyan", "darkblue", "darkcyan", "darkgoldenrod", "darkgray", "darkgreen", "darkgrey", "darkkhaki", "darkmagenta", "darkolivegreen", "darkorange", "darkorchid", "darkred", "darksalmon", "darkseagreen", "darkslateblue", "darkslategray", "darkslategrey", "darkturquoise", "darkviolet", "deeppink", "deepskyblue", "dimgray", "dimgrey", "dodgerblue", "firebrick", "floralwhite", "forestgreen", "gainsboro", "ghostwhite", "gold", "goldenrod", "greenyellow", "grey", "honeydew", "hotpink", "indianred", "indigo", "ivory", "khaki", "lavender", "lavenderblush", "lawngreen", "lemonchiffon", "lightblue", "lightcoral", "lightcyan", "lightgoldenrodyellow", "lightgray", "lightgreen", "lightgrey", "lightpink", "lightsalmon", "lightseagreen", "lightskyblue", "lightslategray", "lightslategrey", "lightsteelblue", "lightyellow", "limegreen", "linen", "magenta", "mediumaquamarine", "mediumblue", "mediumorchid", "mediumpurple", "mediumseagreen", "mediumslateblue", "mediumspringgreen", "mediumturquoise", "mediumvioletred", "midnightblue", "mintcream", "mistyrose", "moccasin", "navajowhite", "oldlace", "olivedrab", "orangered", "orchid", "palegoldenrod", "palegreen", "paleturquoise", "palevioletred", "papayawhip", "peachpuff", "peru", "pink", "plum", "powderblue", "rosybrown", "royalblue", "saddlebrown", "salmon", "sandybrown", "seagreen", "seashell", "sienna", "skyblue", "slateblue", "slategray", "slategrey", "snow", "springgreen", "steelblue", "tan", "thistle", "tomato", "turquoise", "violet", "wheat", "whitesmoke", "yellowgreen", "rebeccapurple" ], "type": "string" }, "ColorScheme": { "anyOf": [ { "$ref": "#/definitions/Categorical" }, { "$ref": "#/definitions/SequentialSingleHue" }, { "$ref": "#/definitions/SequentialMultiHue" }, { "$ref": "#/definitions/Diverging" }, { "$ref": "#/definitions/Cyclical" } ] }, "Encoding": { "additionalProperties": false, "properties": { "angle": { "$ref": "#/definitions/NumericMarkPropDef", "description": "Rotation angle of point and text marks." }, "color": { "$ref": "#/definitions/ColorDef", "description": "Color of the marks – either fill or stroke color based on the `filled` property of mark definition. By default, `color` represents fill color for `\"area\"`, `\"bar\"`, `\"tick\"`, `\"text\"`, `\"trail\"`, `\"circle\"`, and `\"square\"` / stroke color for `\"line\"` and `\"point\"`.\n\n__Default value:__ If undefined, the default color depends on [mark config](https://vega.github.io/vega-lite/docs/config.html#mark-config)'s `color` property.\n\n_Note:_ 1) For fine-grained control over both fill and stroke colors of the marks, please use the `fill` and `stroke` channels. The `fill` or `stroke` encodings have higher precedence than `color`, thus may override the `color` encoding if conflicting encodings are specified. 2) See the scale documentation for more information about customizing [color scheme](https://vega.github.io/vega-lite/docs/scale.html#scheme)." }, "description": { "anyOf": [ { "$ref": "#/definitions/StringFieldDefWithCondition" }, { "$ref": "#/definitions/StringValueDefWithCondition" } ], "description": "A text description of this mark for ARIA accessibility (SVG output only). For SVG output the `\"aria-label\"` attribute will be set to this description." }, "detail": { "anyOf": [ { "$ref": "#/definitions/FieldDefWithoutScale" }, { "items": { "$ref": "#/definitions/FieldDefWithoutScale" }, "type": "array" } ], "description": "Additional levels of detail for grouping data in aggregate views and in line, trail, and area marks without mapping data to a specific visual channel." }, "fill": { "$ref": "#/definitions/ColorDef", "description": "Fill color of the marks. __Default value:__ If undefined, the default color depends on [mark config](https://vega.github.io/vega-lite/docs/config.html#mark-config)'s `color` property.\n\n_Note:_ The `fill` encoding has higher precedence than `color`, thus may override the `color` encoding if conflicting encodings are specified." }, "fillOpacity": { "$ref": "#/definitions/NumericMarkPropDef", "description": "Fill opacity of the marks.\n\n__Default value:__ If undefined, the default opacity depends on [mark config](https://vega.github.io/vega-lite/docs/config.html#mark-config)'s `fillOpacity` property." }, "href": { "anyOf": [ { "$ref": "#/definitions/StringFieldDefWithCondition" }, { "$ref": "#/definitions/StringValueDefWithCondition" } ], "description": "A URL to load upon mouse click." }, "key": { "$ref": "#/definitions/FieldDefWithoutScale", "description": "A data field to use as a unique key for data binding. When a visualization’s data is updated, the key value will be used to match data elements to existing mark instances. Use a key channel to enable object constancy for transitions over dynamic data." }, "latitude": { "$ref": "#/definitions/LatLongDef", "description": "Latitude position of geographically projected marks." }, "latitude2": { "$ref": "#/definitions/Position2Def", "description": "Latitude-2 position for geographically projected ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`." }, "longitude": { "$ref": "#/definitions/LatLongDef", "description": "Longitude position of geographically projected marks." }, "longitude2": { "$ref": "#/definitions/Position2Def", "description": "Longitude-2 position for geographically projected ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`." }, "opacity": { "$ref": "#/definitions/NumericMarkPropDef", "description": "Opacity of the marks.\n\n__Default value:__ If undefined, the default opacity depends on [mark config](https://vega.github.io/vega-lite/docs/config.html#mark-config)'s `opacity` property." }, "order": { "anyOf": [ { "$ref": "#/definitions/OrderFieldDef" }, { "items": { "$ref": "#/definitions/OrderFieldDef" }, "type": "array" }, { "$ref": "#/definitions/OrderValueDef" }, { "$ref": "#/definitions/OrderOnlyDef" } ], "description": "Order of the marks.\n- For stacked marks, this `order` channel encodes [stack order](https://vega.github.io/vega-lite/docs/stack.html#order).\n- For line and trail marks, this `order` channel encodes order of data points in the lines. This can be useful for creating [a connected scatterplot](https://vega.github.io/vega-lite/examples/connected_scatterplot.html). Setting `order` to `{\"value\": null}` makes the line marks use the original order in the data sources.\n- Otherwise, this `order` channel encodes layer order of the marks.\n\n__Note__: In aggregate plots, `order` field should be `aggregate`d to avoid creating additional aggregation grouping." }, "radius": { "$ref": "#/definitions/PolarDef", "description": "The outer radius in pixels of arc marks." }, "radius2": { "$ref": "#/definitions/Position2Def", "description": "The inner radius in pixels of arc marks." }, "shape": { "$ref": "#/definitions/ShapeDef", "description": "Shape of the mark.\n\n1. For `point` marks the supported values include: - plotting shapes: `\"circle\"`, `\"square\"`, `\"cross\"`, `\"diamond\"`, `\"triangle-up\"`, `\"triangle-down\"`, `\"triangle-right\"`, or `\"triangle-left\"`. - the line symbol `\"stroke\"` - centered directional shapes `\"arrow\"`, `\"wedge\"`, or `\"triangle\"` - a custom [SVG path string](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths) (For correct sizing, custom shape paths should be defined within a square bounding box with coordinates ranging from -1 to 1 along both the x and y dimensions.)\n\n2. For `geoshape` marks it should be a field definition of the geojson data\n\n__Default value:__ If undefined, the default shape depends on [mark config](https://vega.github.io/vega-lite/docs/config.html#point-config)'s `shape` property. (`\"circle\"` if unset.)" }, "size": { "$ref": "#/definitions/NumericMarkPropDef", "description": "Size of the mark.\n- For `\"point\"`, `\"square\"` and `\"circle\"`, – the symbol size, or pixel area of the mark.\n- For `\"bar\"` and `\"tick\"` – the bar and tick's size.\n- For `\"text\"` – the text's font size.\n- Size is unsupported for `\"line\"`, `\"area\"`, and `\"rect\"`. (Use `\"trail\"` instead of line with varying size)" }, "stroke": { "$ref": "#/definitions/ColorDef", "description": "Stroke color of the marks. __Default value:__ If undefined, the default color depends on [mark config](https://vega.github.io/vega-lite/docs/config.html#mark-config)'s `color` property.\n\n_Note:_ The `stroke` encoding has higher precedence than `color`, thus may override the `color` encoding if conflicting encodings are specified." }, "strokeDash": { "$ref": "#/definitions/NumericArrayMarkPropDef", "description": "Stroke dash of the marks.\n\n__Default value:__ `[1,0]` (No dash)." }, "strokeOpacity": { "$ref": "#/definitions/NumericMarkPropDef", "description": "Stroke opacity of the marks.\n\n__Default value:__ If undefined, the default opacity depends on [mark config](https://vega.github.io/vega-lite/docs/config.html#mark-config)'s `strokeOpacity` property." }, "strokeWidth": { "$ref": "#/definitions/NumericMarkPropDef", "description": "Stroke width of the marks.\n\n__Default value:__ If undefined, the default stroke width depends on [mark config](https://vega.github.io/vega-lite/docs/config.html#mark-config)'s `strokeWidth` property." }, "text": { "$ref": "#/definitions/TextDef", "description": "Text of the `text` mark." }, "theta": { "$ref": "#/definitions/PolarDef", "description": "- For arc marks, the arc length in radians if theta2 is not specified, otherwise the start arc angle. (A value of 0 indicates up or “north”, increasing values proceed clockwise.)\n\n- For text marks, polar coordinate angle in radians." }, "theta2": { "$ref": "#/definitions/Position2Def", "description": "The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise." }, "time": { "$ref": "#/definitions/TimeDef" }, "tooltip": { "anyOf": [ { "$ref": "#/definitions/StringFieldDefWithCondition" }, { "$ref": "#/definitions/StringValueDefWithCondition" }, { "items": { "$ref": "#/definitions/StringFieldDef" }, "type": "array" }, { "type": "null" } ], "description": "The tooltip text to show upon mouse hover. Specifying `tooltip` encoding overrides [the `tooltip` property in the mark definition](https://vega.github.io/vega-lite/docs/mark.html#mark-def).\n\nSee the [`tooltip`](https://vega.github.io/vega-lite/docs/tooltip.html) documentation for a detailed discussion about tooltip in Vega-Lite." }, "url": { "anyOf": [ { "$ref": "#/definitions/StringFieldDefWithCondition" }, { "$ref": "#/definitions/StringValueDefWithCondition" } ], "description": "The URL of an image mark." }, "x": { "$ref": "#/definitions/PositionDef", "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"` without specified `x2` or `width`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." }, "x2": { "$ref": "#/definitions/Position2Def", "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." }, "xError": { "anyOf": [ { "$ref": "#/definitions/SecondaryFieldDef" }, { "$ref": "#/definitions/ValueDef" } ], "description": "Error value of x coordinates for error specified `\"errorbar\"` and `\"errorband\"`." }, "xError2": { "anyOf": [ { "$ref": "#/definitions/SecondaryFieldDef" }, { "$ref": "#/definitions/ValueDef" } ], "description": "Secondary error value of x coordinates for error specified `\"errorbar\"` and `\"errorband\"`." }, "xOffset": { "$ref": "#/definitions/OffsetDef", "description": "Offset of x-position of the marks" }, "y": { "$ref": "#/definitions/PositionDef", "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"` without specified `y2` or `height`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." }, "y2": { "$ref": "#/definitions/Position2Def", "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." }, "yError": { "anyOf": [ { "$ref": "#/definitions/SecondaryFieldDef" }, { "$ref": "#/definitions/ValueDef" } ], "description": "Error value of y coordinates for error specified `\"errorbar\"` and `\"errorband\"`." }, "yError2": { "anyOf": [ { "$ref": "#/definitions/SecondaryFieldDef" }, { "$ref": "#/definitions/ValueDef" } ], "description": "Secondary error value of y coordinates for error specified `\"errorbar\"` and `\"errorband\"`." }, "yOffset": { "$ref": "#/definitions/OffsetDef", "description": "Offset of y-position of the marks" } }, "type": "object" }, "CompositeMark": { "anyOf": [ { "$ref": "#/definitions/BoxPlot" }, { "$ref": "#/definitions/ErrorBar" }, { "$ref": "#/definitions/ErrorBand" } ] }, "CompositeMarkDef": { "anyOf": [ { "$ref": "#/definitions/BoxPlotDef" }, { "$ref": "#/definitions/ErrorBarDef" }, { "$ref": "#/definitions/ErrorBandDef" } ] }, "CompositionConfig": { "additionalProperties": false, "properties": { "columns": { "description": "The number of columns to include in the view composition layout.\n\n__Default value__: `undefined` -- An infinite number of columns (a single row) will be assumed. This is equivalent to `hconcat` (for `concat`) and to using the `column` channel (for `facet` and `repeat`).\n\n__Note__:\n\n1) This property is only for:\n- the general (wrappable) `concat` operator (not `hconcat`/`vconcat`)\n- the `facet` and `repeat` operator with one field/repetition definition (without row/column nesting)\n\n2) Setting the `columns` to `1` is equivalent to `vconcat` (for `concat`) and to using the `row` channel (for `facet` and `repeat`).", "type": "number" }, "spacing": { "description": "The default spacing in pixels between composed sub-views.\n\n__Default value__: `20`", "type": "number" } }, "type": "object" }, "ConditionalMarkPropFieldOrDatumDef": { "anyOf": [ { "$ref": "#/definitions/ConditionalPredicate" }, { "$ref": "#/definitions/ConditionalParameter" } ] }, "ConditionalMarkPropFieldOrDatumDef": { "anyOf": [ { "$ref": "#/definitions/ConditionalPredicate>" }, { "$ref": "#/definitions/ConditionalParameter>" } ] }, "ConditionalStringFieldDef": { "anyOf": [ { "$ref": "#/definitions/ConditionalPredicate" }, { "$ref": "#/definitions/ConditionalParameter" } ] }, "ConditionalValueDef<(Gradient|string|null|ExprRef)>": { "anyOf": [ { "$ref": "#/definitions/ConditionalPredicate>" }, { "$ref": "#/definitions/ConditionalParameter>" } ] }, "ConditionalValueDef<(Text|ExprRef)>": { "anyOf": [ { "$ref": "#/definitions/ConditionalPredicate>" }, { "$ref": "#/definitions/ConditionalParameter>" } ] }, "ConditionalValueDef<(number[]|ExprRef)>": { "anyOf": [ { "$ref": "#/definitions/ConditionalPredicate>" }, { "$ref": "#/definitions/ConditionalParameter>" } ] }, "ConditionalValueDef<(number|ExprRef)>": { "anyOf": [ { "$ref": "#/definitions/ConditionalPredicate>" }, { "$ref": "#/definitions/ConditionalParameter>" } ] }, "ConditionalValueDef<(string|ExprRef)>": { "anyOf": [ { "$ref": "#/definitions/ConditionalPredicate>" }, { "$ref": "#/definitions/ConditionalParameter>" } ] }, "ConditionalValueDef<(string|null|ExprRef)>": { "anyOf": [ { "$ref": "#/definitions/ConditionalPredicate>" }, { "$ref": "#/definitions/ConditionalParameter>" } ] }, "ConditionalValueDef": { "anyOf": [ { "$ref": "#/definitions/ConditionalPredicate>" }, { "$ref": "#/definitions/ConditionalParameter>" } ] }, "ConditionalAxisColor": { "$ref": "#/definitions/ConditionalAxisProperty<(Color|null)>" }, "ConditionalAxisLabelAlign": { "$ref": "#/definitions/ConditionalAxisProperty<(Align|null)>" }, "ConditionalAxisLabelBaseline": { "$ref": "#/definitions/ConditionalAxisProperty<(TextBaseline|null)>" }, "ConditionalAxisLabelFontStyle": { "$ref": "#/definitions/ConditionalAxisProperty<(FontStyle|null)>" }, "ConditionalAxisLabelFontWeight": { "$ref": "#/definitions/ConditionalAxisProperty<(FontWeight|null)>" }, "ConditionalAxisNumber": { "$ref": "#/definitions/ConditionalAxisProperty<(number|null)>" }, "ConditionalAxisNumberArray": { "$ref": "#/definitions/ConditionalAxisProperty<(number[]|null)>" }, "ConditionalAxisProperty<(Align|null)>": { "anyOf": [ { "additionalProperties": false, "properties": { "condition": { "anyOf": [ { "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(Align|null)>|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(Align|null)>|ExprRef)>" }, "type": "array" } ] }, "value": { "anyOf": [ { "$ref": "#/definitions/Align" }, { "type": "null" } ], "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." } }, "required": [ "condition", "value" ], "type": "object" }, { "additionalProperties": false, "properties": { "condition": { "anyOf": [ { "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(Align|null)>|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(Align|null)>|ExprRef)>" }, "type": "array" } ] }, "expr": { "description": "Vega expression (which can refer to Vega-Lite parameters).", "type": "string" } }, "required": [ "condition", "expr" ], "type": "object" } ] }, "ConditionalAxisProperty<(Color|null)>": { "anyOf": [ { "additionalProperties": false, "properties": { "condition": { "anyOf": [ { "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(Color|null)>|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(Color|null)>|ExprRef)>" }, "type": "array" } ] }, "value": { "anyOf": [ { "$ref": "#/definitions/Color" }, { "type": "null" } ], "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." } }, "required": [ "condition", "value" ], "type": "object" }, { "additionalProperties": false, "properties": { "condition": { "anyOf": [ { "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(Color|null)>|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(Color|null)>|ExprRef)>" }, "type": "array" } ] }, "expr": { "description": "Vega expression (which can refer to Vega-Lite parameters).", "type": "string" } }, "required": [ "condition", "expr" ], "type": "object" } ] }, "ConditionalAxisProperty<(FontStyle|null)>": { "anyOf": [ { "additionalProperties": false, "properties": { "condition": { "anyOf": [ { "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(FontStyle|null)>|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(FontStyle|null)>|ExprRef)>" }, "type": "array" } ] }, "value": { "anyOf": [ { "$ref": "#/definitions/FontStyle" }, { "type": "null" } ], "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." } }, "required": [ "condition", "value" ], "type": "object" }, { "additionalProperties": false, "properties": { "condition": { "anyOf": [ { "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(FontStyle|null)>|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(FontStyle|null)>|ExprRef)>" }, "type": "array" } ] }, "expr": { "description": "Vega expression (which can refer to Vega-Lite parameters).", "type": "string" } }, "required": [ "condition", "expr" ], "type": "object" } ] }, "ConditionalAxisProperty<(FontWeight|null)>": { "anyOf": [ { "additionalProperties": false, "properties": { "condition": { "anyOf": [ { "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(FontWeight|null)>|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(FontWeight|null)>|ExprRef)>" }, "type": "array" } ] }, "value": { "anyOf": [ { "$ref": "#/definitions/FontWeight" }, { "type": "null" } ], "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." } }, "required": [ "condition", "value" ], "type": "object" }, { "additionalProperties": false, "properties": { "condition": { "anyOf": [ { "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(FontWeight|null)>|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(FontWeight|null)>|ExprRef)>" }, "type": "array" } ] }, "expr": { "description": "Vega expression (which can refer to Vega-Lite parameters).", "type": "string" } }, "required": [ "condition", "expr" ], "type": "object" } ] }, "ConditionalAxisProperty<(TextBaseline|null)>": { "anyOf": [ { "additionalProperties": false, "properties": { "condition": { "anyOf": [ { "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(TextBaseline|null)>|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(TextBaseline|null)>|ExprRef)>" }, "type": "array" } ] }, "value": { "anyOf": [ { "$ref": "#/definitions/TextBaseline" }, { "type": "null" } ], "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." } }, "required": [ "condition", "value" ], "type": "object" }, { "additionalProperties": false, "properties": { "condition": { "anyOf": [ { "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(TextBaseline|null)>|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(TextBaseline|null)>|ExprRef)>" }, "type": "array" } ] }, "expr": { "description": "Vega expression (which can refer to Vega-Lite parameters).", "type": "string" } }, "required": [ "condition", "expr" ], "type": "object" } ] }, "ConditionalAxisProperty<(number[]|null)>": { "anyOf": [ { "additionalProperties": false, "properties": { "condition": { "anyOf": [ { "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(number[]|null)>|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(number[]|null)>|ExprRef)>" }, "type": "array" } ] }, "value": { "anyOf": [ { "items": { "type": "number" }, "type": "array" }, { "type": "null" } ], "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." } }, "required": [ "condition", "value" ], "type": "object" }, { "additionalProperties": false, "properties": { "condition": { "anyOf": [ { "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(number[]|null)>|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(number[]|null)>|ExprRef)>" }, "type": "array" } ] }, "expr": { "description": "Vega expression (which can refer to Vega-Lite parameters).", "type": "string" } }, "required": [ "condition", "expr" ], "type": "object" } ] }, "ConditionalAxisProperty<(number|null)>": { "anyOf": [ { "additionalProperties": false, "properties": { "condition": { "anyOf": [ { "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(number|null)>|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(number|null)>|ExprRef)>" }, "type": "array" } ] }, "value": { "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity).", "type": [ "number", "null" ] } }, "required": [ "condition", "value" ], "type": "object" }, { "additionalProperties": false, "properties": { "condition": { "anyOf": [ { "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(number|null)>|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(number|null)>|ExprRef)>" }, "type": "array" } ] }, "expr": { "description": "Vega expression (which can refer to Vega-Lite parameters).", "type": "string" } }, "required": [ "condition", "expr" ], "type": "object" } ] }, "ConditionalAxisProperty<(string|null)>": { "anyOf": [ { "additionalProperties": false, "properties": { "condition": { "anyOf": [ { "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(string|null)>|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(string|null)>|ExprRef)>" }, "type": "array" } ] }, "value": { "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity).", "type": [ "string", "null" ] } }, "required": [ "condition", "value" ], "type": "object" }, { "additionalProperties": false, "properties": { "condition": { "anyOf": [ { "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(string|null)>|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalPredicate<(ValueDef<(string|null)>|ExprRef)>" }, "type": "array" } ] }, "expr": { "description": "Vega expression (which can refer to Vega-Lite parameters).", "type": "string" } }, "required": [ "condition", "expr" ], "type": "object" } ] }, "ConditionalAxisString": { "$ref": "#/definitions/ConditionalAxisProperty<(string|null)>" }, "ConditionalParameter": { "anyOf": [ { "additionalProperties": false, "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/BinParams" }, { "type": "null" } ], "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." }, "empty": { "description": "For selection parameters, the predicate of empty selections returns true by default. Override this behavior, by setting this property `empty: false`.", "type": "boolean" }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "legend": { "anyOf": [ { "$ref": "#/definitions/Legend" }, { "type": "null" } ], "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." }, "param": { "$ref": "#/definitions/ParameterName", "description": "Filter using a parameter name." }, "scale": { "anyOf": [ { "$ref": "#/definitions/Scale" }, { "type": "null" } ], "description": "An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." }, "sort": { "$ref": "#/definitions/Sort", "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript.\n- [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`.\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "$ref": "#/definitions/StandardType", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } }, "required": [ "param" ], "type": "object" }, { "additionalProperties": false, "properties": { "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "datum": { "anyOf": [ { "$ref": "#/definitions/PrimitiveValue" }, { "$ref": "#/definitions/DateTime" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/RepeatRef" } ], "description": "A constant value in data domain." }, "empty": { "description": "For selection parameters, the predicate of empty selections returns true by default. Override this behavior, by setting this property `empty: false`.", "type": "boolean" }, "legend": { "anyOf": [ { "$ref": "#/definitions/Legend" }, { "type": "null" } ], "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." }, "param": { "$ref": "#/definitions/ParameterName", "description": "Filter using a parameter name." }, "scale": { "anyOf": [ { "$ref": "#/definitions/Scale" }, { "type": "null" } ], "description": "An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "$ref": "#/definitions/Type", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } }, "required": [ "param" ], "type": "object" } ] }, "ConditionalParameter>": { "anyOf": [ { "additionalProperties": false, "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/BinParams" }, { "type": "null" } ], "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." }, "empty": { "description": "For selection parameters, the predicate of empty selections returns true by default. Override this behavior, by setting this property `empty: false`.", "type": "boolean" }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "legend": { "anyOf": [ { "$ref": "#/definitions/Legend" }, { "type": "null" } ], "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." }, "param": { "$ref": "#/definitions/ParameterName", "description": "Filter using a parameter name." }, "scale": { "anyOf": [ { "$ref": "#/definitions/Scale" }, { "type": "null" } ], "description": "An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." }, "sort": { "$ref": "#/definitions/Sort", "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript.\n- [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`.\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "$ref": "#/definitions/TypeForShape", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } }, "required": [ "param" ], "type": "object" }, { "additionalProperties": false, "properties": { "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "datum": { "anyOf": [ { "$ref": "#/definitions/PrimitiveValue" }, { "$ref": "#/definitions/DateTime" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/RepeatRef" } ], "description": "A constant value in data domain." }, "empty": { "description": "For selection parameters, the predicate of empty selections returns true by default. Override this behavior, by setting this property `empty: false`.", "type": "boolean" }, "legend": { "anyOf": [ { "$ref": "#/definitions/Legend" }, { "type": "null" } ], "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." }, "param": { "$ref": "#/definitions/ParameterName", "description": "Filter using a parameter name." }, "scale": { "anyOf": [ { "$ref": "#/definitions/Scale" }, { "type": "null" } ], "description": "An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "$ref": "#/definitions/Type", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } }, "required": [ "param" ], "type": "object" } ] }, "ConditionalParameter": { "additionalProperties": false, "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/BinParams" }, { "const": "binned", "type": "string" }, { "type": "null" } ], "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." }, "empty": { "description": "For selection parameters, the predicate of empty selections returns true by default. Override this behavior, by setting this property `empty: false`.", "type": "boolean" }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "format": { "anyOf": [ { "type": "string" }, { "$ref": "#/definitions/Dict" } ], "description": "When used with the default `\"number\"` and `\"time\"` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks.\n\n- If the format type is `\"number\"` (e.g., for quantitative fields), this is D3's [number format pattern](https://github.com/d3/d3-format#locale_format).\n- If the format type is `\"time\"` (e.g., for temporal fields), this is D3's [time format pattern](https://github.com/d3/d3-time-format#locale_format).\n\nSee the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for more examples.\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." }, "formatType": { "description": "The format type for labels. One of `\"number\"`, `\"time\"`, or a [registered custom format type](https://vega.github.io/vega-lite/docs/config.html#custom-format-type).\n\n__Default value:__\n- `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`.\n- `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", "type": "string" }, "param": { "$ref": "#/definitions/ParameterName", "description": "Filter using a parameter name." }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "$ref": "#/definitions/StandardType", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } }, "required": [ "param" ], "type": "object" }, "ConditionalParameter>": { "additionalProperties": false, "properties": { "empty": { "description": "For selection parameters, the predicate of empty selections returns true by default. Override this behavior, by setting this property `empty: false`.", "type": "boolean" }, "param": { "$ref": "#/definitions/ParameterName", "description": "Filter using a parameter name." }, "value": { "anyOf": [ { "$ref": "#/definitions/Gradient" }, { "type": "string" }, { "type": "null" }, { "$ref": "#/definitions/ExprRef" } ], "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." } }, "required": [ "param", "value" ], "type": "object" }, "ConditionalParameter>": { "additionalProperties": false, "properties": { "empty": { "description": "For selection parameters, the predicate of empty selections returns true by default. Override this behavior, by setting this property `empty: false`.", "type": "boolean" }, "param": { "$ref": "#/definitions/ParameterName", "description": "Filter using a parameter name." }, "value": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "$ref": "#/definitions/ExprRef" } ], "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." } }, "required": [ "param", "value" ], "type": "object" }, "ConditionalParameter>": { "additionalProperties": false, "properties": { "empty": { "description": "For selection parameters, the predicate of empty selections returns true by default. Override this behavior, by setting this property `empty: false`.", "type": "boolean" }, "param": { "$ref": "#/definitions/ParameterName", "description": "Filter using a parameter name." }, "value": { "anyOf": [ { "items": { "type": "number" }, "type": "array" }, { "$ref": "#/definitions/ExprRef" } ], "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." } }, "required": [ "param", "value" ], "type": "object" }, "ConditionalParameter>": { "additionalProperties": false, "properties": { "empty": { "description": "For selection parameters, the predicate of empty selections returns true by default. Override this behavior, by setting this property `empty: false`.", "type": "boolean" }, "param": { "$ref": "#/definitions/ParameterName", "description": "Filter using a parameter name." }, "value": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." } }, "required": [ "param", "value" ], "type": "object" }, "ConditionalParameter>": { "additionalProperties": false, "properties": { "empty": { "description": "For selection parameters, the predicate of empty selections returns true by default. Override this behavior, by setting this property `empty: false`.", "type": "boolean" }, "param": { "$ref": "#/definitions/ParameterName", "description": "Filter using a parameter name." }, "value": { "anyOf": [ { "type": "string" }, { "$ref": "#/definitions/ExprRef" } ], "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." } }, "required": [ "param", "value" ], "type": "object" }, "ConditionalParameter>": { "additionalProperties": false, "properties": { "empty": { "description": "For selection parameters, the predicate of empty selections returns true by default. Override this behavior, by setting this property `empty: false`.", "type": "boolean" }, "param": { "$ref": "#/definitions/ParameterName", "description": "Filter using a parameter name." }, "value": { "anyOf": [ { "type": "string" }, { "type": "null" }, { "$ref": "#/definitions/ExprRef" } ], "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." } }, "required": [ "param", "value" ], "type": "object" }, "ConditionalParameter>": { "additionalProperties": false, "properties": { "empty": { "description": "For selection parameters, the predicate of empty selections returns true by default. Override this behavior, by setting this property `empty: false`.", "type": "boolean" }, "param": { "$ref": "#/definitions/ParameterName", "description": "Filter using a parameter name." }, "value": { "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity).", "type": "number" } }, "required": [ "param", "value" ], "type": "object" }, "ConditionalPredicate<(ValueDef<(Align|null)>|ExprRef)>": { "anyOf": [ { "additionalProperties": false, "properties": { "test": { "$ref": "#/definitions/PredicateComposition", "description": "Predicate for triggering the condition" }, "value": { "anyOf": [ { "$ref": "#/definitions/Align" }, { "type": "null" } ], "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." } }, "required": [ "test", "value" ], "type": "object" }, { "additionalProperties": false, "properties": { "expr": { "description": "Vega expression (which can refer to Vega-Lite parameters).", "type": "string" }, "test": { "$ref": "#/definitions/PredicateComposition", "description": "Predicate for triggering the condition" } }, "required": [ "expr", "test" ], "type": "object" } ] }, "ConditionalPredicate<(ValueDef<(Color|null)>|ExprRef)>": { "anyOf": [ { "additionalProperties": false, "properties": { "test": { "$ref": "#/definitions/PredicateComposition", "description": "Predicate for triggering the condition" }, "value": { "anyOf": [ { "$ref": "#/definitions/Color" }, { "type": "null" } ], "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." } }, "required": [ "test", "value" ], "type": "object" }, { "additionalProperties": false, "properties": { "expr": { "description": "Vega expression (which can refer to Vega-Lite parameters).", "type": "string" }, "test": { "$ref": "#/definitions/PredicateComposition", "description": "Predicate for triggering the condition" } }, "required": [ "expr", "test" ], "type": "object" } ] }, "ConditionalPredicate<(ValueDef<(FontStyle|null)>|ExprRef)>": { "anyOf": [ { "additionalProperties": false, "properties": { "test": { "$ref": "#/definitions/PredicateComposition", "description": "Predicate for triggering the condition" }, "value": { "anyOf": [ { "$ref": "#/definitions/FontStyle" }, { "type": "null" } ], "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." } }, "required": [ "test", "value" ], "type": "object" }, { "additionalProperties": false, "properties": { "expr": { "description": "Vega expression (which can refer to Vega-Lite parameters).", "type": "string" }, "test": { "$ref": "#/definitions/PredicateComposition", "description": "Predicate for triggering the condition" } }, "required": [ "expr", "test" ], "type": "object" } ] }, "ConditionalPredicate<(ValueDef<(FontWeight|null)>|ExprRef)>": { "anyOf": [ { "additionalProperties": false, "properties": { "test": { "$ref": "#/definitions/PredicateComposition", "description": "Predicate for triggering the condition" }, "value": { "anyOf": [ { "$ref": "#/definitions/FontWeight" }, { "type": "null" } ], "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." } }, "required": [ "test", "value" ], "type": "object" }, { "additionalProperties": false, "properties": { "expr": { "description": "Vega expression (which can refer to Vega-Lite parameters).", "type": "string" }, "test": { "$ref": "#/definitions/PredicateComposition", "description": "Predicate for triggering the condition" } }, "required": [ "expr", "test" ], "type": "object" } ] }, "ConditionalPredicate<(ValueDef<(TextBaseline|null)>|ExprRef)>": { "anyOf": [ { "additionalProperties": false, "properties": { "test": { "$ref": "#/definitions/PredicateComposition", "description": "Predicate for triggering the condition" }, "value": { "anyOf": [ { "$ref": "#/definitions/TextBaseline" }, { "type": "null" } ], "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." } }, "required": [ "test", "value" ], "type": "object" }, { "additionalProperties": false, "properties": { "expr": { "description": "Vega expression (which can refer to Vega-Lite parameters).", "type": "string" }, "test": { "$ref": "#/definitions/PredicateComposition", "description": "Predicate for triggering the condition" } }, "required": [ "expr", "test" ], "type": "object" } ] }, "ConditionalPredicate<(ValueDef<(number[]|null)>|ExprRef)>": { "anyOf": [ { "additionalProperties": false, "properties": { "test": { "$ref": "#/definitions/PredicateComposition", "description": "Predicate for triggering the condition" }, "value": { "anyOf": [ { "items": { "type": "number" }, "type": "array" }, { "type": "null" } ], "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." } }, "required": [ "test", "value" ], "type": "object" }, { "additionalProperties": false, "properties": { "expr": { "description": "Vega expression (which can refer to Vega-Lite parameters).", "type": "string" }, "test": { "$ref": "#/definitions/PredicateComposition", "description": "Predicate for triggering the condition" } }, "required": [ "expr", "test" ], "type": "object" } ] }, "ConditionalPredicate<(ValueDef<(number|null)>|ExprRef)>": { "anyOf": [ { "additionalProperties": false, "properties": { "test": { "$ref": "#/definitions/PredicateComposition", "description": "Predicate for triggering the condition" }, "value": { "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity).", "type": [ "number", "null" ] } }, "required": [ "test", "value" ], "type": "object" }, { "additionalProperties": false, "properties": { "expr": { "description": "Vega expression (which can refer to Vega-Lite parameters).", "type": "string" }, "test": { "$ref": "#/definitions/PredicateComposition", "description": "Predicate for triggering the condition" } }, "required": [ "expr", "test" ], "type": "object" } ] }, "ConditionalPredicate<(ValueDef<(string|null)>|ExprRef)>": { "anyOf": [ { "additionalProperties": false, "properties": { "test": { "$ref": "#/definitions/PredicateComposition", "description": "Predicate for triggering the condition" }, "value": { "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity).", "type": [ "string", "null" ] } }, "required": [ "test", "value" ], "type": "object" }, { "additionalProperties": false, "properties": { "expr": { "description": "Vega expression (which can refer to Vega-Lite parameters).", "type": "string" }, "test": { "$ref": "#/definitions/PredicateComposition", "description": "Predicate for triggering the condition" } }, "required": [ "expr", "test" ], "type": "object" } ] }, "ConditionalPredicate": { "anyOf": [ { "additionalProperties": false, "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/BinParams" }, { "type": "null" } ], "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "legend": { "anyOf": [ { "$ref": "#/definitions/Legend" }, { "type": "null" } ], "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." }, "scale": { "anyOf": [ { "$ref": "#/definitions/Scale" }, { "type": "null" } ], "description": "An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." }, "sort": { "$ref": "#/definitions/Sort", "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript.\n- [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`.\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." }, "test": { "$ref": "#/definitions/PredicateComposition", "description": "Predicate for triggering the condition" }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "$ref": "#/definitions/StandardType", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } }, "required": [ "test" ], "type": "object" }, { "additionalProperties": false, "properties": { "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "datum": { "anyOf": [ { "$ref": "#/definitions/PrimitiveValue" }, { "$ref": "#/definitions/DateTime" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/RepeatRef" } ], "description": "A constant value in data domain." }, "legend": { "anyOf": [ { "$ref": "#/definitions/Legend" }, { "type": "null" } ], "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." }, "scale": { "anyOf": [ { "$ref": "#/definitions/Scale" }, { "type": "null" } ], "description": "An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." }, "test": { "$ref": "#/definitions/PredicateComposition", "description": "Predicate for triggering the condition" }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "$ref": "#/definitions/Type", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } }, "required": [ "test" ], "type": "object" } ] }, "ConditionalPredicate>": { "anyOf": [ { "additionalProperties": false, "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/BinParams" }, { "type": "null" } ], "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "legend": { "anyOf": [ { "$ref": "#/definitions/Legend" }, { "type": "null" } ], "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." }, "scale": { "anyOf": [ { "$ref": "#/definitions/Scale" }, { "type": "null" } ], "description": "An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." }, "sort": { "$ref": "#/definitions/Sort", "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript.\n- [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`.\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." }, "test": { "$ref": "#/definitions/PredicateComposition", "description": "Predicate for triggering the condition" }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "$ref": "#/definitions/TypeForShape", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } }, "required": [ "test" ], "type": "object" }, { "additionalProperties": false, "properties": { "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "datum": { "anyOf": [ { "$ref": "#/definitions/PrimitiveValue" }, { "$ref": "#/definitions/DateTime" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/RepeatRef" } ], "description": "A constant value in data domain." }, "legend": { "anyOf": [ { "$ref": "#/definitions/Legend" }, { "type": "null" } ], "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." }, "scale": { "anyOf": [ { "$ref": "#/definitions/Scale" }, { "type": "null" } ], "description": "An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." }, "test": { "$ref": "#/definitions/PredicateComposition", "description": "Predicate for triggering the condition" }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "$ref": "#/definitions/Type", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } }, "required": [ "test" ], "type": "object" } ] }, "ConditionalPredicate": { "additionalProperties": false, "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/BinParams" }, { "const": "binned", "type": "string" }, { "type": "null" } ], "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "format": { "anyOf": [ { "type": "string" }, { "$ref": "#/definitions/Dict" } ], "description": "When used with the default `\"number\"` and `\"time\"` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks.\n\n- If the format type is `\"number\"` (e.g., for quantitative fields), this is D3's [number format pattern](https://github.com/d3/d3-format#locale_format).\n- If the format type is `\"time\"` (e.g., for temporal fields), this is D3's [time format pattern](https://github.com/d3/d3-time-format#locale_format).\n\nSee the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for more examples.\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." }, "formatType": { "description": "The format type for labels. One of `\"number\"`, `\"time\"`, or a [registered custom format type](https://vega.github.io/vega-lite/docs/config.html#custom-format-type).\n\n__Default value:__\n- `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`.\n- `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", "type": "string" }, "test": { "$ref": "#/definitions/PredicateComposition", "description": "Predicate for triggering the condition" }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "$ref": "#/definitions/StandardType", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } }, "required": [ "test" ], "type": "object" }, "ConditionalPredicate>": { "additionalProperties": false, "properties": { "test": { "$ref": "#/definitions/PredicateComposition", "description": "Predicate for triggering the condition" }, "value": { "anyOf": [ { "$ref": "#/definitions/Gradient" }, { "type": "string" }, { "type": "null" }, { "$ref": "#/definitions/ExprRef" } ], "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." } }, "required": [ "test", "value" ], "type": "object" }, "ConditionalPredicate>": { "additionalProperties": false, "properties": { "test": { "$ref": "#/definitions/PredicateComposition", "description": "Predicate for triggering the condition" }, "value": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "$ref": "#/definitions/ExprRef" } ], "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." } }, "required": [ "test", "value" ], "type": "object" }, "ConditionalPredicate>": { "additionalProperties": false, "properties": { "test": { "$ref": "#/definitions/PredicateComposition", "description": "Predicate for triggering the condition" }, "value": { "anyOf": [ { "items": { "type": "number" }, "type": "array" }, { "$ref": "#/definitions/ExprRef" } ], "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." } }, "required": [ "test", "value" ], "type": "object" }, "ConditionalPredicate>": { "additionalProperties": false, "properties": { "test": { "$ref": "#/definitions/PredicateComposition", "description": "Predicate for triggering the condition" }, "value": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." } }, "required": [ "test", "value" ], "type": "object" }, "ConditionalPredicate>": { "additionalProperties": false, "properties": { "test": { "$ref": "#/definitions/PredicateComposition", "description": "Predicate for triggering the condition" }, "value": { "anyOf": [ { "type": "string" }, { "$ref": "#/definitions/ExprRef" } ], "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." } }, "required": [ "test", "value" ], "type": "object" }, "ConditionalPredicate>": { "additionalProperties": false, "properties": { "test": { "$ref": "#/definitions/PredicateComposition", "description": "Predicate for triggering the condition" }, "value": { "anyOf": [ { "type": "string" }, { "type": "null" }, { "$ref": "#/definitions/ExprRef" } ], "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." } }, "required": [ "test", "value" ], "type": "object" }, "ConditionalPredicate>": { "additionalProperties": false, "properties": { "test": { "$ref": "#/definitions/PredicateComposition", "description": "Predicate for triggering the condition" }, "value": { "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity).", "type": "number" } }, "required": [ "test", "value" ], "type": "object" }, "Config": { "additionalProperties": false, "properties": { "arc": { "$ref": "#/definitions/RectConfig", "description": "Arc-specific Config" }, "area": { "$ref": "#/definitions/AreaConfig", "description": "Area-Specific Config" }, "aria": { "description": "A boolean flag indicating if ARIA default attributes should be included for marks and guides (SVG output only). If false, the `\"aria-hidden\"` attribute will be set for all guides, removing them from the ARIA accessibility tree and Vega-Lite will not generate default descriptions for marks.\n\n__Default value:__ `true`.", "type": "boolean" }, "autosize": { "anyOf": [ { "$ref": "#/definitions/AutosizeType" }, { "$ref": "#/definitions/AutoSizeParams" } ], "description": "How the visualization size should be determined. If a string, should be one of `\"pad\"`, `\"fit\"` or `\"none\"`. Object values can additionally specify parameters for content sizing and automatic resizing.\n\n__Default value__: `pad`" }, "axis": { "$ref": "#/definitions/AxisConfig", "description": "Axis configuration, which determines default properties for all `x` and `y` [axes](https://vega.github.io/vega-lite/docs/axis.html). For a full list of axis configuration options, please see the [corresponding section of the axis documentation](https://vega.github.io/vega-lite/docs/axis.html#config)." }, "axisBand": { "$ref": "#/definitions/AxisConfig", "description": "Config for axes with \"band\" scales." }, "axisBottom": { "$ref": "#/definitions/AxisConfig", "description": "Config for x-axis along the bottom edge of the chart." }, "axisDiscrete": { "$ref": "#/definitions/AxisConfig", "description": "Config for axes with \"point\" or \"band\" scales." }, "axisLeft": { "$ref": "#/definitions/AxisConfig", "description": "Config for y-axis along the left edge of the chart." }, "axisPoint": { "$ref": "#/definitions/AxisConfig", "description": "Config for axes with \"point\" scales." }, "axisQuantitative": { "$ref": "#/definitions/AxisConfig", "description": "Config for quantitative axes." }, "axisRight": { "$ref": "#/definitions/AxisConfig", "description": "Config for y-axis along the right edge of the chart." }, "axisTemporal": { "$ref": "#/definitions/AxisConfig", "description": "Config for temporal axes." }, "axisTop": { "$ref": "#/definitions/AxisConfig", "description": "Config for x-axis along the top edge of the chart." }, "axisX": { "$ref": "#/definitions/AxisConfig", "description": "X-axis specific config." }, "axisXBand": { "$ref": "#/definitions/AxisConfig", "description": "Config for x-axes with \"band\" scales." }, "axisXDiscrete": { "$ref": "#/definitions/AxisConfig", "description": "Config for x-axes with \"point\" or \"band\" scales." }, "axisXPoint": { "$ref": "#/definitions/AxisConfig", "description": "Config for x-axes with \"point\" scales." }, "axisXQuantitative": { "$ref": "#/definitions/AxisConfig", "description": "Config for x-quantitative axes." }, "axisXTemporal": { "$ref": "#/definitions/AxisConfig", "description": "Config for x-temporal axes." }, "axisY": { "$ref": "#/definitions/AxisConfig", "description": "Y-axis specific config." }, "axisYBand": { "$ref": "#/definitions/AxisConfig", "description": "Config for y-axes with \"band\" scales." }, "axisYDiscrete": { "$ref": "#/definitions/AxisConfig", "description": "Config for y-axes with \"point\" or \"band\" scales." }, "axisYPoint": { "$ref": "#/definitions/AxisConfig", "description": "Config for y-axes with \"point\" scales." }, "axisYQuantitative": { "$ref": "#/definitions/AxisConfig", "description": "Config for y-quantitative axes." }, "axisYTemporal": { "$ref": "#/definitions/AxisConfig", "description": "Config for y-temporal axes." }, "background": { "anyOf": [ { "$ref": "#/definitions/Color" }, { "$ref": "#/definitions/ExprRef" } ], "description": "CSS color property to use as the background of the entire view.\n\n__Default value:__ `\"white\"`" }, "bar": { "$ref": "#/definitions/BarConfig", "description": "Bar-Specific Config" }, "boxplot": { "$ref": "#/definitions/BoxPlotConfig", "description": "Box Config" }, "circle": { "$ref": "#/definitions/MarkConfig", "description": "Circle-Specific Config" }, "concat": { "$ref": "#/definitions/CompositionConfig", "description": "Default configuration for all concatenation and repeat view composition operators (`concat`, `hconcat`, `vconcat`, and `repeat`)" }, "countTitle": { "description": "Default axis and legend title for count fields.\n\n__Default value:__ `'Count of Records`.", "type": "string" }, "customFormatTypes": { "description": "Allow the `formatType` property for text marks and guides to accept a custom formatter function [registered as a Vega expression](https://vega.github.io/vega-lite/usage/compile.html#format-type).", "type": "boolean" }, "errorband": { "$ref": "#/definitions/ErrorBandConfig", "description": "ErrorBand Config" }, "errorbar": { "$ref": "#/definitions/ErrorBarConfig", "description": "ErrorBar Config" }, "facet": { "$ref": "#/definitions/CompositionConfig", "description": "Default configuration for the `facet` view composition operator" }, "fieldTitle": { "description": "Defines how Vega-Lite generates title for fields. There are three possible styles:\n- `\"verbal\"` (Default) - displays function in a verbal style (e.g., \"Sum of field\", \"Year-month of date\", \"field (binned)\").\n- `\"function\"` - displays function using parentheses and capitalized texts (e.g., \"SUM(field)\", \"YEARMONTH(date)\", \"BIN(field)\").\n- `\"plain\"` - displays only the field name without functions (e.g., \"field\", \"date\", \"field\").", "enum": [ "verbal", "functional", "plain" ], "type": "string" }, "font": { "description": "Default font for all text marks, titles, and labels.", "type": "string" }, "geoshape": { "$ref": "#/definitions/MarkConfig", "description": "Geoshape-Specific Config" }, "header": { "$ref": "#/definitions/HeaderConfig", "description": "Header configuration, which determines default properties for all [headers](https://vega.github.io/vega-lite/docs/header.html).\n\nFor a full list of header configuration options, please see the [corresponding section of in the header documentation](https://vega.github.io/vega-lite/docs/header.html#config)." }, "headerColumn": { "$ref": "#/definitions/HeaderConfig", "description": "Header configuration, which determines default properties for column [headers](https://vega.github.io/vega-lite/docs/header.html).\n\nFor a full list of header configuration options, please see the [corresponding section of in the header documentation](https://vega.github.io/vega-lite/docs/header.html#config)." }, "headerFacet": { "$ref": "#/definitions/HeaderConfig", "description": "Header configuration, which determines default properties for non-row/column facet [headers](https://vega.github.io/vega-lite/docs/header.html).\n\nFor a full list of header configuration options, please see the [corresponding section of in the header documentation](https://vega.github.io/vega-lite/docs/header.html#config)." }, "headerRow": { "$ref": "#/definitions/HeaderConfig", "description": "Header configuration, which determines default properties for row [headers](https://vega.github.io/vega-lite/docs/header.html).\n\nFor a full list of header configuration options, please see the [corresponding section of in the header documentation](https://vega.github.io/vega-lite/docs/header.html#config)." }, "image": { "$ref": "#/definitions/RectConfig", "description": "Image-specific Config" }, "legend": { "$ref": "#/definitions/LegendConfig", "description": "Legend configuration, which determines default properties for all [legends](https://vega.github.io/vega-lite/docs/legend.html). For a full list of legend configuration options, please see the [corresponding section of in the legend documentation](https://vega.github.io/vega-lite/docs/legend.html#config)." }, "line": { "$ref": "#/definitions/LineConfig", "description": "Line-Specific Config" }, "lineBreak": { "anyOf": [ { "type": "string" }, { "$ref": "#/definitions/ExprRef" } ], "description": "A delimiter, such as a newline character, upon which to break text strings into multiple lines. This property provides a global default for text marks, which is overridden by mark or style config settings, and by the lineBreak mark encoding channel. If signal-valued, either string or regular expression (regexp) values are valid." }, "locale": { "$ref": "#/definitions/Locale", "description": "Locale definitions for string parsing and formatting of number and date values. The locale object should contain `number` and/or `time` properties with [locale definitions](https://vega.github.io/vega/docs/api/locale/). Locale definitions provided in the config block may be overridden by the View constructor locale option." }, "mark": { "$ref": "#/definitions/MarkConfig", "description": "Mark Config" }, "normalizedNumberFormat": { "description": "If normalizedNumberFormatType is not specified, D3 number format for axis labels, text marks, and tooltips of normalized stacked fields (fields with `stack: \"normalize\"`). For example `\"s\"` for SI units. Use [D3's number format pattern](https://github.com/d3/d3-format#locale_format).\n\nIf `config.normalizedNumberFormatType` is specified and `config.customFormatTypes` is `true`, this value will be passed as `format` alongside `datum.value` to the `config.numberFormatType` function. __Default value:__ `%`", "type": "string" }, "normalizedNumberFormatType": { "description": "[Custom format type](https://vega.github.io/vega-lite/docs/config.html#custom-format-type) for `config.normalizedNumberFormat`.\n\n__Default value:__ `undefined` -- This is equilvalent to call D3-format, which is exposed as [`format` in Vega-Expression](https://vega.github.io/vega/docs/expressions/#format). __Note:__ You must also set `customFormatTypes` to `true` to use this feature.", "type": "string" }, "numberFormat": { "description": "If numberFormatType is not specified, D3 number format for guide labels, text marks, and tooltips of non-normalized fields (fields *without* `stack: \"normalize\"`). For example `\"s\"` for SI units. Use [D3's number format pattern](https://github.com/d3/d3-format#locale_format).\n\nIf `config.numberFormatType` is specified and `config.customFormatTypes` is `true`, this value will be passed as `format` alongside `datum.value` to the `config.numberFormatType` function.", "type": "string" }, "numberFormatType": { "description": "[Custom format type](https://vega.github.io/vega-lite/docs/config.html#custom-format-type) for `config.numberFormat`.\n\n__Default value:__ `undefined` -- This is equilvalent to call D3-format, which is exposed as [`format` in Vega-Expression](https://vega.github.io/vega/docs/expressions/#format). __Note:__ You must also set `customFormatTypes` to `true` to use this feature.", "type": "string" }, "padding": { "anyOf": [ { "$ref": "#/definitions/Padding" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The default visualization padding, in pixels, from the edge of the visualization canvas to the data rectangle. If a number, specifies padding for all sides. If an object, the value should have the format `{\"left\": 5, \"top\": 5, \"right\": 5, \"bottom\": 5}` to specify padding for each side of the visualization.\n\n__Default value__: `5`" }, "params": { "description": "Dynamic variables or selections that parameterize a visualization.", "items": { "$ref": "#/definitions/TopLevelParameter" }, "type": "array" }, "point": { "$ref": "#/definitions/MarkConfig", "description": "Point-Specific Config" }, "projection": { "$ref": "#/definitions/ProjectionConfig", "description": "Projection configuration, which determines default properties for all [projections](https://vega.github.io/vega-lite/docs/projection.html). For a full list of projection configuration options, please see the [corresponding section of the projection documentation](https://vega.github.io/vega-lite/docs/projection.html#config)." }, "range": { "$ref": "#/definitions/RangeConfig", "description": "An object hash that defines default range arrays or schemes for using with scales. For a full list of scale range configuration options, please see the [corresponding section of the scale documentation](https://vega.github.io/vega-lite/docs/scale.html#config)." }, "rect": { "$ref": "#/definitions/RectConfig", "description": "Rect-Specific Config" }, "rule": { "$ref": "#/definitions/MarkConfig", "description": "Rule-Specific Config" }, "scale": { "$ref": "#/definitions/ScaleConfig", "description": "Scale configuration determines default properties for all [scales](https://vega.github.io/vega-lite/docs/scale.html). For a full list of scale configuration options, please see the [corresponding section of the scale documentation](https://vega.github.io/vega-lite/docs/scale.html#config)." }, "selection": { "$ref": "#/definitions/SelectionConfig", "description": "An object hash for defining default properties for each type of selections." }, "square": { "$ref": "#/definitions/MarkConfig", "description": "Square-Specific Config" }, "style": { "$ref": "#/definitions/StyleConfigIndex", "description": "An object hash that defines key-value mappings to determine default properties for marks with a given [style](https://vega.github.io/vega-lite/docs/mark.html#mark-def). The keys represent styles names; the values have to be valid [mark configuration objects](https://vega.github.io/vega-lite/docs/mark.html#config)." }, "text": { "$ref": "#/definitions/MarkConfig", "description": "Text-Specific Config" }, "tick": { "$ref": "#/definitions/TickConfig", "description": "Tick-Specific Config" }, "timeFormat": { "description": "Default time format for raw time values (without time units) in text marks, legend labels and header labels.\n\n__Default value:__ `\"%b %d, %Y\"` __Note:__ Axes automatically determine the format for each label automatically so this config does not affect axes.", "type": "string" }, "timeFormatType": { "description": "[Custom format type](https://vega.github.io/vega-lite/docs/config.html#custom-format-type) for `config.timeFormat`.\n\n__Default value:__ `undefined` -- This is equilvalent to call D3-time-format, which is exposed as [`timeFormat` in Vega-Expression](https://vega.github.io/vega/docs/expressions/#timeFormat). __Note:__ You must also set `customFormatTypes` to `true` and there must *not* be a `timeUnit` defined to use this feature.", "type": "string" }, "title": { "$ref": "#/definitions/TitleConfig", "description": "Title configuration, which determines default properties for all [titles](https://vega.github.io/vega-lite/docs/title.html). For a full list of title configuration options, please see the [corresponding section of the title documentation](https://vega.github.io/vega-lite/docs/title.html#config)." }, "tooltipFormat": { "$ref": "#/definitions/FormatConfig", "description": "Define [custom format configuration](https://vega.github.io/vega-lite/docs/config.html#format) for tooltips. If unspecified, default format config will be applied." }, "trail": { "$ref": "#/definitions/LineConfig", "description": "Trail-Specific Config" }, "view": { "$ref": "#/definitions/ViewConfig", "description": "Default properties for [single view plots](https://vega.github.io/vega-lite/docs/spec.html#single)." } }, "type": "object" }, "CsvDataFormat": { "additionalProperties": false, "properties": { "parse": { "anyOf": [ { "$ref": "#/definitions/Parse" }, { "type": "null" } ], "description": "If set to `null`, disable type inference based on the spec and only use type inference based on the data. Alternatively, a parsing directive object can be provided for explicit data types. Each property of the object corresponds to a field name, and the value to the desired data type (one of `\"number\"`, `\"boolean\"`, `\"date\"`, or null (do not parse the field)). For example, `\"parse\": {\"modified_on\": \"date\"}` parses the `modified_on` field in each input record a Date value.\n\nFor `\"date\"`, we parse data based using JavaScript's [`Date.parse()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse). For Specific date formats can be provided (e.g., `{foo: \"date:'%m%d%Y'\"}`), using the [d3-time-format syntax](https://github.com/d3/d3-time-format#locale_format). UTC date format parsing is supported similarly (e.g., `{foo: \"utc:'%m%d%Y'\"}`). See more about [UTC time](https://vega.github.io/vega-lite/docs/timeunit.html#utc)" }, "type": { "description": "Type of input data: `\"json\"`, `\"csv\"`, `\"tsv\"`, `\"dsv\"`.\n\n__Default value:__ The default format type is determined by the extension of the file URL. If no extension is detected, `\"json\"` will be used by default.", "enum": [ "csv", "tsv" ], "type": "string" } }, "type": "object" }, "Cursor": { "enum": [ "auto", "default", "none", "context-menu", "help", "pointer", "progress", "wait", "cell", "crosshair", "text", "vertical-text", "alias", "copy", "move", "no-drop", "not-allowed", "e-resize", "n-resize", "ne-resize", "nw-resize", "s-resize", "se-resize", "sw-resize", "w-resize", "ew-resize", "ns-resize", "nesw-resize", "nwse-resize", "col-resize", "row-resize", "all-scroll", "zoom-in", "zoom-out", "grab", "grabbing" ], "type": "string" }, "Cyclical": { "enum": [ "rainbow", "sinebow" ], "type": "string" }, "Data": { "anyOf": [ { "$ref": "#/definitions/DataSource" }, { "$ref": "#/definitions/Generator" } ] }, "DataFormat": { "anyOf": [ { "$ref": "#/definitions/CsvDataFormat" }, { "$ref": "#/definitions/DsvDataFormat" }, { "$ref": "#/definitions/JsonDataFormat" }, { "$ref": "#/definitions/TopoDataFormat" } ] }, "DataSource": { "anyOf": [ { "$ref": "#/definitions/UrlData" }, { "$ref": "#/definitions/InlineData" }, { "$ref": "#/definitions/NamedData" } ] }, "Datasets": { "$ref": "#/definitions/Dict" }, "DateTime": { "additionalProperties": false, "description": "Object for defining datetime in Vega-Lite Filter. If both month and quarter are provided, month has higher precedence. `day` cannot be combined with other date. We accept string for month and day names.", "properties": { "date": { "description": "Integer value representing the date (day of the month) from 1-31.", "maximum": 31, "minimum": 1, "type": "number" }, "day": { "anyOf": [ { "$ref": "#/definitions/Day" }, { "type": "string" } ], "description": "Value representing the day of a week. This can be one of: (1) integer value -- `1` represents Monday; (2) case-insensitive day name (e.g., `\"Monday\"`); (3) case-insensitive, 3-character short day name (e.g., `\"Mon\"`).\n\n**Warning:** A DateTime definition object with `day`** should not be combined with `year`, `quarter`, `month`, or `date`." }, "hours": { "description": "Integer value representing the hour of a day from 0-23.", "maximum": 24, "minimum": 0, "type": "number" }, "milliseconds": { "description": "Integer value representing the millisecond segment of time.", "maximum": 1000, "minimum": 0, "type": "number" }, "minutes": { "description": "Integer value representing the minute segment of time from 0-59.", "maximum": 60, "minimum": 0, "type": "number" }, "month": { "anyOf": [ { "$ref": "#/definitions/Month" }, { "type": "string" } ], "description": "One of: (1) integer value representing the month from `1`-`12`. `1` represents January; (2) case-insensitive month name (e.g., `\"January\"`); (3) case-insensitive, 3-character short month name (e.g., `\"Jan\"`)." }, "quarter": { "description": "Integer value representing the quarter of the year (from 1-4).", "maximum": 4, "minimum": 1, "type": "number" }, "seconds": { "description": "Integer value representing the second segment (0-59) of a time value", "maximum": 60, "minimum": 0, "type": "number" }, "utc": { "description": "A boolean flag indicating if date time is in utc time. If false, the date time is in local time", "type": "boolean" }, "year": { "description": "Integer value representing the year.", "type": "number" } }, "type": "object" }, "DatumDef": { "additionalProperties": false, "properties": { "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "datum": { "anyOf": [ { "$ref": "#/definitions/PrimitiveValue" }, { "$ref": "#/definitions/DateTime" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/RepeatRef" } ], "description": "A constant value in data domain." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "$ref": "#/definitions/Type", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } }, "type": "object" }, "Day": { "maximum": 7, "minimum": 1, "type": "number" }, "DensityTransform": { "additionalProperties": false, "properties": { "as": { "description": "The output fields for the sample value and corresponding density estimate.\n\n__Default value:__ `[\"value\", \"density\"]`", "items": { "$ref": "#/definitions/FieldName" }, "maxItems": 2, "minItems": 2, "type": "array" }, "bandwidth": { "description": "The bandwidth (standard deviation) of the Gaussian kernel. If unspecified or set to zero, the bandwidth value is automatically estimated from the input data using Scott’s rule.", "type": "number" }, "counts": { "description": "A boolean flag indicating if the output values should be probability estimates (false) or smoothed counts (true).\n\n__Default value:__ `false`", "type": "boolean" }, "cumulative": { "description": "A boolean flag indicating whether to produce density estimates (false) or cumulative density estimates (true).\n\n__Default value:__ `false`", "type": "boolean" }, "density": { "$ref": "#/definitions/FieldName", "description": "The data field for which to perform density estimation." }, "extent": { "description": "A [min, max] domain from which to sample the distribution. If unspecified, the extent will be determined by the observed minimum and maximum values of the density value field.", "items": { "type": "number" }, "maxItems": 2, "minItems": 2, "type": "array" }, "groupby": { "description": "The data fields to group by. If not specified, a single group containing all data objects will be used.", "items": { "$ref": "#/definitions/FieldName" }, "type": "array" }, "maxsteps": { "description": "The maximum number of samples to take along the extent domain for plotting the density.\n\n__Default value:__ `200`", "type": "number" }, "minsteps": { "description": "The minimum number of samples to take along the extent domain for plotting the density.\n\n__Default value:__ `25`", "type": "number" }, "resolve": { "description": "Indicates how parameters for multiple densities should be resolved. If `\"independent\"`, each density may have its own domain extent and dynamic number of curve sample steps. If `\"shared\"`, the KDE transform will ensure that all densities are defined over a shared domain and curve steps, enabling stacking.\n\n__Default value:__ `\"shared\"`", "enum": [ "independent", "shared" ], "type": "string" }, "steps": { "description": "The exact number of samples to take along the extent domain for plotting the density. If specified, overrides both minsteps and maxsteps to set an exact number of uniform samples. Potentially useful in conjunction with a fixed extent to ensure consistent sample points for stacked densities.", "type": "number" } }, "required": [ "density" ], "type": "object" }, "DerivedStream": { "additionalProperties": false, "properties": { "between": { "items": { "$ref": "#/definitions/Stream" }, "type": "array" }, "consume": { "type": "boolean" }, "debounce": { "type": "number" }, "filter": { "anyOf": [ { "$ref": "#/definitions/Expr" }, { "items": { "$ref": "#/definitions/Expr" }, "type": "array" } ] }, "markname": { "type": "string" }, "marktype": { "$ref": "#/definitions/MarkType" }, "stream": { "$ref": "#/definitions/Stream" }, "throttle": { "type": "number" } }, "required": [ "stream" ], "type": "object" }, "Dict": { "additionalProperties": { "$ref": "#/definitions/InlineDataset" }, "type": "object" }, "Dict": { "additionalProperties": { "$ref": "#/definitions/SelectionInit" }, "type": "object" }, "Dict": { "additionalProperties": { "$ref": "#/definitions/SelectionInitInterval" }, "type": "object" }, "Dict": { "additionalProperties": {}, "type": "object" }, "Diverging": { "enum": [ "blueorange", "blueorange-3", "blueorange-4", "blueorange-5", "blueorange-6", "blueorange-7", "blueorange-8", "blueorange-9", "blueorange-10", "blueorange-11", "brownbluegreen", "brownbluegreen-3", "brownbluegreen-4", "brownbluegreen-5", "brownbluegreen-6", "brownbluegreen-7", "brownbluegreen-8", "brownbluegreen-9", "brownbluegreen-10", "brownbluegreen-11", "purplegreen", "purplegreen-3", "purplegreen-4", "purplegreen-5", "purplegreen-6", "purplegreen-7", "purplegreen-8", "purplegreen-9", "purplegreen-10", "purplegreen-11", "pinkyellowgreen", "pinkyellowgreen-3", "pinkyellowgreen-4", "pinkyellowgreen-5", "pinkyellowgreen-6", "pinkyellowgreen-7", "pinkyellowgreen-8", "pinkyellowgreen-9", "pinkyellowgreen-10", "pinkyellowgreen-11", "purpleorange", "purpleorange-3", "purpleorange-4", "purpleorange-5", "purpleorange-6", "purpleorange-7", "purpleorange-8", "purpleorange-9", "purpleorange-10", "purpleorange-11", "redblue", "redblue-3", "redblue-4", "redblue-5", "redblue-6", "redblue-7", "redblue-8", "redblue-9", "redblue-10", "redblue-11", "redgrey", "redgrey-3", "redgrey-4", "redgrey-5", "redgrey-6", "redgrey-7", "redgrey-8", "redgrey-9", "redgrey-10", "redgrey-11", "redyellowblue", "redyellowblue-3", "redyellowblue-4", "redyellowblue-5", "redyellowblue-6", "redyellowblue-7", "redyellowblue-8", "redyellowblue-9", "redyellowblue-10", "redyellowblue-11", "redyellowgreen", "redyellowgreen-3", "redyellowgreen-4", "redyellowgreen-5", "redyellowgreen-6", "redyellowgreen-7", "redyellowgreen-8", "redyellowgreen-9", "redyellowgreen-10", "redyellowgreen-11", "spectral", "spectral-3", "spectral-4", "spectral-5", "spectral-6", "spectral-7", "spectral-8", "spectral-9", "spectral-10", "spectral-11" ], "type": "string" }, "DomainUnionWith": { "additionalProperties": false, "properties": { "unionWith": { "description": "Customized domain values to be union with the field's values or explicitly defined domain. Should be an array of valid scale domain values.", "items": { "anyOf": [ { "type": "number" }, { "type": "string" }, { "type": "boolean" }, { "$ref": "#/definitions/DateTime" } ] }, "type": "array" } }, "required": [ "unionWith" ], "type": "object" }, "DsvDataFormat": { "additionalProperties": false, "properties": { "delimiter": { "description": "The delimiter between records. The delimiter must be a single character (i.e., a single 16-bit code unit); so, ASCII delimiters are fine, but emoji delimiters are not.", "maxLength": 1, "minLength": 1, "type": "string" }, "parse": { "anyOf": [ { "$ref": "#/definitions/Parse" }, { "type": "null" } ], "description": "If set to `null`, disable type inference based on the spec and only use type inference based on the data. Alternatively, a parsing directive object can be provided for explicit data types. Each property of the object corresponds to a field name, and the value to the desired data type (one of `\"number\"`, `\"boolean\"`, `\"date\"`, or null (do not parse the field)). For example, `\"parse\": {\"modified_on\": \"date\"}` parses the `modified_on` field in each input record a Date value.\n\nFor `\"date\"`, we parse data based using JavaScript's [`Date.parse()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse). For Specific date formats can be provided (e.g., `{foo: \"date:'%m%d%Y'\"}`), using the [d3-time-format syntax](https://github.com/d3/d3-time-format#locale_format). UTC date format parsing is supported similarly (e.g., `{foo: \"utc:'%m%d%Y'\"}`). See more about [UTC time](https://vega.github.io/vega-lite/docs/timeunit.html#utc)" }, "type": { "const": "dsv", "description": "Type of input data: `\"json\"`, `\"csv\"`, `\"tsv\"`, `\"dsv\"`.\n\n__Default value:__ The default format type is determined by the extension of the file URL. If no extension is detected, `\"json\"` will be used by default.", "type": "string" } }, "required": [ "delimiter" ], "type": "object" }, "Element": { "type": "string" }, "EncodingSortField": { "additionalProperties": false, "description": "A sort definition for sorting a discrete scale in an encoding field definition.", "properties": { "field": { "$ref": "#/definitions/Field", "description": "The data [field](https://vega.github.io/vega-lite/docs/field.html) to sort by.\n\n__Default value:__ If unspecified, defaults to the field specified in the outer data reference." }, "op": { "$ref": "#/definitions/NonArgAggregateOp", "description": "An [aggregate operation](https://vega.github.io/vega-lite/docs/aggregate.html#ops) to perform on the field prior to sorting (e.g., `\"count\"`, `\"mean\"` and `\"median\"`). An aggregation is required when there are multiple values of the sort field for each encoded data field. The input data objects will be aggregated, grouped by the encoded data field.\n\nFor a full list of operations, please see the documentation for [aggregate](https://vega.github.io/vega-lite/docs/aggregate.html#ops).\n\n__Default value:__ `\"sum\"` for stacked plots. Otherwise, `\"min\"`." }, "order": { "anyOf": [ { "$ref": "#/definitions/SortOrder" }, { "type": "null" } ], "description": "The sort order. One of `\"ascending\"` (default), `\"descending\"`, or `null` (no not sort)." } }, "type": "object" }, "ErrorBand": { "const": "errorband", "type": "string" }, "ErrorBandConfig": { "additionalProperties": false, "properties": { "band": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/AnyMarkConfig" } ] }, "borders": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/AnyMarkConfig" } ] }, "extent": { "$ref": "#/definitions/ErrorBarExtent", "description": "The extent of the band. Available options include:\n- `\"ci\"`: Extend the band to the 95% bootstrapped confidence interval of the mean.\n- `\"stderr\"`: The size of band are set to the value of standard error, extending from the mean.\n- `\"stdev\"`: The size of band are set to the value of standard deviation, extending from the mean.\n- `\"iqr\"`: Extend the band to the q1 and q3.\n\n__Default value:__ `\"stderr\"`." }, "interpolate": { "$ref": "#/definitions/Interpolate", "description": "The line interpolation method for the error band. One of the following:\n- `\"linear\"`: piecewise linear segments, as in a polyline.\n- `\"linear-closed\"`: close the linear segments to form a polygon.\n- `\"step\"`: a piecewise constant function (a step function) consisting of alternating horizontal and vertical lines. The y-value changes at the midpoint of each pair of adjacent x-values.\n- `\"step-before\"`: a piecewise constant function (a step function) consisting of alternating horizontal and vertical lines. The y-value changes before the x-value.\n- `\"step-after\"`: a piecewise constant function (a step function) consisting of alternating horizontal and vertical lines. The y-value changes after the x-value.\n- `\"basis\"`: a B-spline, with control point duplication on the ends.\n- `\"basis-open\"`: an open B-spline; may not intersect the start or end.\n- `\"basis-closed\"`: a closed B-spline, as in a loop.\n- `\"cardinal\"`: a Cardinal spline, with control point duplication on the ends.\n- `\"cardinal-open\"`: an open Cardinal spline; may not intersect the start or end, but will intersect other control points.\n- `\"cardinal-closed\"`: a closed Cardinal spline, as in a loop.\n- `\"bundle\"`: equivalent to basis, except the tension parameter is used to straighten the spline.\n- `\"monotone\"`: cubic interpolation that preserves monotonicity in y." }, "tension": { "description": "The tension parameter for the interpolation type of the error band.", "maximum": 1, "minimum": 0, "type": "number" } }, "type": "object" }, "ErrorBandDef": { "additionalProperties": false, "properties": { "band": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/AnyMarkConfig" } ] }, "borders": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/AnyMarkConfig" } ] }, "clip": { "description": "Whether a composite mark be clipped to the enclosing group’s width and height.", "type": "boolean" }, "color": { "anyOf": [ { "$ref": "#/definitions/Color" }, { "$ref": "#/definitions/Gradient" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Default color.\n\n__Default value:__ `\"#4682b4\"`\n\n__Note:__\n- This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).\n- The `fill` and `stroke` properties have higher precedence than `color` and will override `color`." }, "extent": { "$ref": "#/definitions/ErrorBarExtent", "description": "The extent of the band. Available options include:\n- `\"ci\"`: Extend the band to the 95% bootstrapped confidence interval of the mean.\n- `\"stderr\"`: The size of band are set to the value of standard error, extending from the mean.\n- `\"stdev\"`: The size of band are set to the value of standard deviation, extending from the mean.\n- `\"iqr\"`: Extend the band to the q1 and q3.\n\n__Default value:__ `\"stderr\"`." }, "interpolate": { "$ref": "#/definitions/Interpolate", "description": "The line interpolation method for the error band. One of the following:\n- `\"linear\"`: piecewise linear segments, as in a polyline.\n- `\"linear-closed\"`: close the linear segments to form a polygon.\n- `\"step\"`: a piecewise constant function (a step function) consisting of alternating horizontal and vertical lines. The y-value changes at the midpoint of each pair of adjacent x-values.\n- `\"step-before\"`: a piecewise constant function (a step function) consisting of alternating horizontal and vertical lines. The y-value changes before the x-value.\n- `\"step-after\"`: a piecewise constant function (a step function) consisting of alternating horizontal and vertical lines. The y-value changes after the x-value.\n- `\"basis\"`: a B-spline, with control point duplication on the ends.\n- `\"basis-open\"`: an open B-spline; may not intersect the start or end.\n- `\"basis-closed\"`: a closed B-spline, as in a loop.\n- `\"cardinal\"`: a Cardinal spline, with control point duplication on the ends.\n- `\"cardinal-open\"`: an open Cardinal spline; may not intersect the start or end, but will intersect other control points.\n- `\"cardinal-closed\"`: a closed Cardinal spline, as in a loop.\n- `\"bundle\"`: equivalent to basis, except the tension parameter is used to straighten the spline.\n- `\"monotone\"`: cubic interpolation that preserves monotonicity in y." }, "opacity": { "description": "The opacity (value between [0,1]) of the mark.", "maximum": 1, "minimum": 0, "type": "number" }, "orient": { "$ref": "#/definitions/Orientation", "description": "Orientation of the error band. This is normally automatically determined, but can be specified when the orientation is ambiguous and cannot be automatically determined." }, "tension": { "description": "The tension parameter for the interpolation type of the error band.", "maximum": 1, "minimum": 0, "type": "number" }, "type": { "$ref": "#/definitions/ErrorBand", "description": "The mark type. This could a primitive mark type (one of `\"bar\"`, `\"circle\"`, `\"square\"`, `\"tick\"`, `\"line\"`, `\"area\"`, `\"point\"`, `\"geoshape\"`, `\"rule\"`, and `\"text\"`) or a composite mark type (`\"boxplot\"`, `\"errorband\"`, `\"errorbar\"`)." } }, "required": [ "type" ], "type": "object" }, "ErrorBar": { "const": "errorbar", "type": "string" }, "ErrorBarConfig": { "additionalProperties": false, "properties": { "extent": { "$ref": "#/definitions/ErrorBarExtent", "description": "The extent of the rule. Available options include:\n- `\"ci\"`: Extend the rule to the 95% bootstrapped confidence interval of the mean.\n- `\"stderr\"`: The size of rule are set to the value of standard error, extending from the mean.\n- `\"stdev\"`: The size of rule are set to the value of standard deviation, extending from the mean.\n- `\"iqr\"`: Extend the rule to the q1 and q3.\n\n__Default value:__ `\"stderr\"`." }, "rule": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/AnyMarkConfig" } ] }, "size": { "description": "Size of the ticks of an error bar", "type": "number" }, "thickness": { "description": "Thickness of the ticks and the bar of an error bar", "type": "number" }, "ticks": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/AnyMarkConfig" } ] } }, "type": "object" }, "ErrorBarDef": { "additionalProperties": false, "properties": { "clip": { "description": "Whether a composite mark be clipped to the enclosing group’s width and height.", "type": "boolean" }, "color": { "anyOf": [ { "$ref": "#/definitions/Color" }, { "$ref": "#/definitions/Gradient" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Default color.\n\n__Default value:__ `\"#4682b4\"`\n\n__Note:__\n- This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).\n- The `fill` and `stroke` properties have higher precedence than `color` and will override `color`." }, "extent": { "$ref": "#/definitions/ErrorBarExtent", "description": "The extent of the rule. Available options include:\n- `\"ci\"`: Extend the rule to the 95% bootstrapped confidence interval of the mean.\n- `\"stderr\"`: The size of rule are set to the value of standard error, extending from the mean.\n- `\"stdev\"`: The size of rule are set to the value of standard deviation, extending from the mean.\n- `\"iqr\"`: Extend the rule to the q1 and q3.\n\n__Default value:__ `\"stderr\"`." }, "opacity": { "description": "The opacity (value between [0,1]) of the mark.", "maximum": 1, "minimum": 0, "type": "number" }, "orient": { "$ref": "#/definitions/Orientation", "description": "Orientation of the error bar. This is normally automatically determined, but can be specified when the orientation is ambiguous and cannot be automatically determined." }, "rule": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/AnyMarkConfig" } ] }, "size": { "description": "Size of the ticks of an error bar", "type": "number" }, "thickness": { "description": "Thickness of the ticks and the bar of an error bar", "type": "number" }, "ticks": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/AnyMarkConfig" } ] }, "type": { "$ref": "#/definitions/ErrorBar", "description": "The mark type. This could a primitive mark type (one of `\"bar\"`, `\"circle\"`, `\"square\"`, `\"tick\"`, `\"line\"`, `\"area\"`, `\"point\"`, `\"geoshape\"`, `\"rule\"`, and `\"text\"`) or a composite mark type (`\"boxplot\"`, `\"errorband\"`, `\"errorbar\"`)." } }, "required": [ "type" ], "type": "object" }, "ErrorBarExtent": { "enum": [ "ci", "iqr", "stderr", "stdev" ], "type": "string" }, "EventStream": { "anyOf": [ { "additionalProperties": false, "properties": { "between": { "items": { "$ref": "#/definitions/Stream" }, "type": "array" }, "consume": { "type": "boolean" }, "debounce": { "type": "number" }, "filter": { "anyOf": [ { "$ref": "#/definitions/Expr" }, { "items": { "$ref": "#/definitions/Expr" }, "type": "array" } ] }, "markname": { "type": "string" }, "marktype": { "$ref": "#/definitions/MarkType" }, "source": { "enum": [ "view", "scope" ], "type": "string" }, "throttle": { "type": "number" }, "type": { "$ref": "#/definitions/EventType" } }, "required": [ "type" ], "type": "object" }, { "additionalProperties": false, "properties": { "between": { "items": { "$ref": "#/definitions/Stream" }, "type": "array" }, "consume": { "type": "boolean" }, "debounce": { "type": "number" }, "filter": { "anyOf": [ { "$ref": "#/definitions/Expr" }, { "items": { "$ref": "#/definitions/Expr" }, "type": "array" } ] }, "markname": { "type": "string" }, "marktype": { "$ref": "#/definitions/MarkType" }, "source": { "const": "window", "type": "string" }, "throttle": { "type": "number" }, "type": { "$ref": "#/definitions/WindowEventType" } }, "required": [ "source", "type" ], "type": "object" } ] }, "EventType": { "enum": [ "click", "dblclick", "dragenter", "dragleave", "dragover", "keydown", "keypress", "keyup", "mousedown", "mousemove", "mouseout", "mouseover", "mouseup", "mousewheel", "pointerdown", "pointermove", "pointerout", "pointerover", "pointerup", "timer", "touchend", "touchmove", "touchstart", "wheel" ], "type": "string" }, "Expr": { "type": "string" }, "ExprRef": { "additionalProperties": false, "properties": { "expr": { "description": "Vega expression (which can refer to Vega-Lite parameters).", "type": "string" } }, "required": [ "expr" ], "type": "object" }, "ExtentTransform": { "additionalProperties": false, "properties": { "extent": { "$ref": "#/definitions/FieldName", "description": "The field of which to get the extent." }, "param": { "$ref": "#/definitions/ParameterName", "description": "The output parameter produced by the extent transform." } }, "required": [ "extent", "param" ], "type": "object" }, "FacetEncodingFieldDef": { "additionalProperties": false, "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "align": { "anyOf": [ { "$ref": "#/definitions/LayoutAlign" }, { "$ref": "#/definitions/RowCol" } ], "description": "The alignment to apply to grid rows and columns. The supported string values are `\"all\"`, `\"each\"`, and `\"none\"`.\n\n- For `\"none\"`, a flow layout will be used, in which adjacent subviews are simply placed one after the other.\n- For `\"each\"`, subviews will be aligned into a clean grid structure, but each row or column may be of variable size.\n- For `\"all\"`, subviews will be aligned and each row or column will be sized identically based on the maximum observed size. String values for this property will be applied to both grid rows and columns.\n\nAlternatively, an object value of the form `{\"row\": string, \"column\": string}` can be used to supply different alignments for rows and columns.\n\n__Default value:__ `\"all\"`." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/BinParams" }, { "type": "null" } ], "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." }, "bounds": { "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used.\n- If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", "enum": [ "full", "flush" ], "type": "string" }, "center": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/RowCol" } ], "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\nAn object value of the form `{\"row\": boolean, \"column\": boolean}` can be used to supply different centering values for rows and columns.\n\n__Default value:__ `false`" }, "columns": { "description": "The number of columns to include in the view composition layout.\n\n__Default value__: `undefined` -- An infinite number of columns (a single row) will be assumed. This is equivalent to `hconcat` (for `concat`) and to using the `column` channel (for `facet` and `repeat`).\n\n__Note__:\n\n1) This property is only for:\n- the general (wrappable) `concat` operator (not `hconcat`/`vconcat`)\n- the `facet` and `repeat` operator with one field/repetition definition (without row/column nesting)\n\n2) Setting the `columns` to `1` is equivalent to `vconcat` (for `concat`) and to using the `row` channel (for `facet` and `repeat`).", "type": "number" }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "header": { "anyOf": [ { "$ref": "#/definitions/Header" }, { "type": "null" } ], "description": "An object defining properties of a facet's header." }, "sort": { "anyOf": [ { "$ref": "#/definitions/SortArray" }, { "$ref": "#/definitions/SortOrder" }, { "$ref": "#/definitions/EncodingSortField" }, { "type": "null" } ], "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript.\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` is not supported for `row` and `column`." }, "spacing": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/RowCol" } ], "description": "The spacing in pixels between sub-views of the composition operator. An object of the form `{\"row\": number, \"column\": number}` can be used to set different spacing values for rows and columns.\n\n__Default value__: Depends on `\"spacing\"` property of [the view composition configuration](https://vega.github.io/vega-lite/docs/config.html#view-config) (`20` by default)" }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "$ref": "#/definitions/StandardType", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } }, "type": "object" }, "FacetFieldDef": { "additionalProperties": false, "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/BinParams" }, { "type": "null" } ], "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "header": { "anyOf": [ { "$ref": "#/definitions/Header" }, { "type": "null" } ], "description": "An object defining properties of a facet's header." }, "sort": { "anyOf": [ { "$ref": "#/definitions/SortArray" }, { "$ref": "#/definitions/SortOrder" }, { "$ref": "#/definitions/EncodingSortField" }, { "type": "null" } ], "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript.\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` is not supported for `row` and `column`." }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "$ref": "#/definitions/StandardType", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } }, "type": "object" }, "FacetMapping": { "additionalProperties": false, "properties": { "column": { "$ref": "#/definitions/FacetFieldDef", "description": "A field definition for the horizontal facet of trellis plots." }, "row": { "$ref": "#/definitions/FacetFieldDef", "description": "A field definition for the vertical facet of trellis plots." } }, "type": "object" }, "FacetedEncoding": { "additionalProperties": false, "properties": { "angle": { "$ref": "#/definitions/NumericMarkPropDef", "description": "Rotation angle of point and text marks." }, "color": { "$ref": "#/definitions/ColorDef", "description": "Color of the marks – either fill or stroke color based on the `filled` property of mark definition. By default, `color` represents fill color for `\"area\"`, `\"bar\"`, `\"tick\"`, `\"text\"`, `\"trail\"`, `\"circle\"`, and `\"square\"` / stroke color for `\"line\"` and `\"point\"`.\n\n__Default value:__ If undefined, the default color depends on [mark config](https://vega.github.io/vega-lite/docs/config.html#mark-config)'s `color` property.\n\n_Note:_ 1) For fine-grained control over both fill and stroke colors of the marks, please use the `fill` and `stroke` channels. The `fill` or `stroke` encodings have higher precedence than `color`, thus may override the `color` encoding if conflicting encodings are specified. 2) See the scale documentation for more information about customizing [color scheme](https://vega.github.io/vega-lite/docs/scale.html#scheme)." }, "column": { "$ref": "#/definitions/RowColumnEncodingFieldDef", "description": "A field definition for the horizontal facet of trellis plots." }, "description": { "anyOf": [ { "$ref": "#/definitions/StringFieldDefWithCondition" }, { "$ref": "#/definitions/StringValueDefWithCondition" } ], "description": "A text description of this mark for ARIA accessibility (SVG output only). For SVG output the `\"aria-label\"` attribute will be set to this description." }, "detail": { "anyOf": [ { "$ref": "#/definitions/FieldDefWithoutScale" }, { "items": { "$ref": "#/definitions/FieldDefWithoutScale" }, "type": "array" } ], "description": "Additional levels of detail for grouping data in aggregate views and in line, trail, and area marks without mapping data to a specific visual channel." }, "facet": { "$ref": "#/definitions/FacetEncodingFieldDef", "description": "A field definition for the (flexible) facet of trellis plots.\n\nIf either `row` or `column` is specified, this channel will be ignored." }, "fill": { "$ref": "#/definitions/ColorDef", "description": "Fill color of the marks. __Default value:__ If undefined, the default color depends on [mark config](https://vega.github.io/vega-lite/docs/config.html#mark-config)'s `color` property.\n\n_Note:_ The `fill` encoding has higher precedence than `color`, thus may override the `color` encoding if conflicting encodings are specified." }, "fillOpacity": { "$ref": "#/definitions/NumericMarkPropDef", "description": "Fill opacity of the marks.\n\n__Default value:__ If undefined, the default opacity depends on [mark config](https://vega.github.io/vega-lite/docs/config.html#mark-config)'s `fillOpacity` property." }, "href": { "anyOf": [ { "$ref": "#/definitions/StringFieldDefWithCondition" }, { "$ref": "#/definitions/StringValueDefWithCondition" } ], "description": "A URL to load upon mouse click." }, "key": { "$ref": "#/definitions/FieldDefWithoutScale", "description": "A data field to use as a unique key for data binding. When a visualization’s data is updated, the key value will be used to match data elements to existing mark instances. Use a key channel to enable object constancy for transitions over dynamic data." }, "latitude": { "$ref": "#/definitions/LatLongDef", "description": "Latitude position of geographically projected marks." }, "latitude2": { "$ref": "#/definitions/Position2Def", "description": "Latitude-2 position for geographically projected ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`." }, "longitude": { "$ref": "#/definitions/LatLongDef", "description": "Longitude position of geographically projected marks." }, "longitude2": { "$ref": "#/definitions/Position2Def", "description": "Longitude-2 position for geographically projected ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`." }, "opacity": { "$ref": "#/definitions/NumericMarkPropDef", "description": "Opacity of the marks.\n\n__Default value:__ If undefined, the default opacity depends on [mark config](https://vega.github.io/vega-lite/docs/config.html#mark-config)'s `opacity` property." }, "order": { "anyOf": [ { "$ref": "#/definitions/OrderFieldDef" }, { "items": { "$ref": "#/definitions/OrderFieldDef" }, "type": "array" }, { "$ref": "#/definitions/OrderValueDef" }, { "$ref": "#/definitions/OrderOnlyDef" } ], "description": "Order of the marks.\n- For stacked marks, this `order` channel encodes [stack order](https://vega.github.io/vega-lite/docs/stack.html#order).\n- For line and trail marks, this `order` channel encodes order of data points in the lines. This can be useful for creating [a connected scatterplot](https://vega.github.io/vega-lite/examples/connected_scatterplot.html). Setting `order` to `{\"value\": null}` makes the line marks use the original order in the data sources.\n- Otherwise, this `order` channel encodes layer order of the marks.\n\n__Note__: In aggregate plots, `order` field should be `aggregate`d to avoid creating additional aggregation grouping." }, "radius": { "$ref": "#/definitions/PolarDef", "description": "The outer radius in pixels of arc marks." }, "radius2": { "$ref": "#/definitions/Position2Def", "description": "The inner radius in pixels of arc marks." }, "row": { "$ref": "#/definitions/RowColumnEncodingFieldDef", "description": "A field definition for the vertical facet of trellis plots." }, "shape": { "$ref": "#/definitions/ShapeDef", "description": "Shape of the mark.\n\n1. For `point` marks the supported values include: - plotting shapes: `\"circle\"`, `\"square\"`, `\"cross\"`, `\"diamond\"`, `\"triangle-up\"`, `\"triangle-down\"`, `\"triangle-right\"`, or `\"triangle-left\"`. - the line symbol `\"stroke\"` - centered directional shapes `\"arrow\"`, `\"wedge\"`, or `\"triangle\"` - a custom [SVG path string](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths) (For correct sizing, custom shape paths should be defined within a square bounding box with coordinates ranging from -1 to 1 along both the x and y dimensions.)\n\n2. For `geoshape` marks it should be a field definition of the geojson data\n\n__Default value:__ If undefined, the default shape depends on [mark config](https://vega.github.io/vega-lite/docs/config.html#point-config)'s `shape` property. (`\"circle\"` if unset.)" }, "size": { "$ref": "#/definitions/NumericMarkPropDef", "description": "Size of the mark.\n- For `\"point\"`, `\"square\"` and `\"circle\"`, – the symbol size, or pixel area of the mark.\n- For `\"bar\"` and `\"tick\"` – the bar and tick's size.\n- For `\"text\"` – the text's font size.\n- Size is unsupported for `\"line\"`, `\"area\"`, and `\"rect\"`. (Use `\"trail\"` instead of line with varying size)" }, "stroke": { "$ref": "#/definitions/ColorDef", "description": "Stroke color of the marks. __Default value:__ If undefined, the default color depends on [mark config](https://vega.github.io/vega-lite/docs/config.html#mark-config)'s `color` property.\n\n_Note:_ The `stroke` encoding has higher precedence than `color`, thus may override the `color` encoding if conflicting encodings are specified." }, "strokeDash": { "$ref": "#/definitions/NumericArrayMarkPropDef", "description": "Stroke dash of the marks.\n\n__Default value:__ `[1,0]` (No dash)." }, "strokeOpacity": { "$ref": "#/definitions/NumericMarkPropDef", "description": "Stroke opacity of the marks.\n\n__Default value:__ If undefined, the default opacity depends on [mark config](https://vega.github.io/vega-lite/docs/config.html#mark-config)'s `strokeOpacity` property." }, "strokeWidth": { "$ref": "#/definitions/NumericMarkPropDef", "description": "Stroke width of the marks.\n\n__Default value:__ If undefined, the default stroke width depends on [mark config](https://vega.github.io/vega-lite/docs/config.html#mark-config)'s `strokeWidth` property." }, "text": { "$ref": "#/definitions/TextDef", "description": "Text of the `text` mark." }, "theta": { "$ref": "#/definitions/PolarDef", "description": "- For arc marks, the arc length in radians if theta2 is not specified, otherwise the start arc angle. (A value of 0 indicates up or “north”, increasing values proceed clockwise.)\n\n- For text marks, polar coordinate angle in radians." }, "theta2": { "$ref": "#/definitions/Position2Def", "description": "The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise." }, "time": { "$ref": "#/definitions/TimeDef" }, "tooltip": { "anyOf": [ { "$ref": "#/definitions/StringFieldDefWithCondition" }, { "$ref": "#/definitions/StringValueDefWithCondition" }, { "items": { "$ref": "#/definitions/StringFieldDef" }, "type": "array" }, { "type": "null" } ], "description": "The tooltip text to show upon mouse hover. Specifying `tooltip` encoding overrides [the `tooltip` property in the mark definition](https://vega.github.io/vega-lite/docs/mark.html#mark-def).\n\nSee the [`tooltip`](https://vega.github.io/vega-lite/docs/tooltip.html) documentation for a detailed discussion about tooltip in Vega-Lite." }, "url": { "anyOf": [ { "$ref": "#/definitions/StringFieldDefWithCondition" }, { "$ref": "#/definitions/StringValueDefWithCondition" } ], "description": "The URL of an image mark." }, "x": { "$ref": "#/definitions/PositionDef", "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"` without specified `x2` or `width`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." }, "x2": { "$ref": "#/definitions/Position2Def", "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." }, "xError": { "anyOf": [ { "$ref": "#/definitions/SecondaryFieldDef" }, { "$ref": "#/definitions/ValueDef" } ], "description": "Error value of x coordinates for error specified `\"errorbar\"` and `\"errorband\"`." }, "xError2": { "anyOf": [ { "$ref": "#/definitions/SecondaryFieldDef" }, { "$ref": "#/definitions/ValueDef" } ], "description": "Secondary error value of x coordinates for error specified `\"errorbar\"` and `\"errorband\"`." }, "xOffset": { "$ref": "#/definitions/OffsetDef", "description": "Offset of x-position of the marks" }, "y": { "$ref": "#/definitions/PositionDef", "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"` without specified `y2` or `height`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." }, "y2": { "$ref": "#/definitions/Position2Def", "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." }, "yError": { "anyOf": [ { "$ref": "#/definitions/SecondaryFieldDef" }, { "$ref": "#/definitions/ValueDef" } ], "description": "Error value of y coordinates for error specified `\"errorbar\"` and `\"errorband\"`." }, "yError2": { "anyOf": [ { "$ref": "#/definitions/SecondaryFieldDef" }, { "$ref": "#/definitions/ValueDef" } ], "description": "Secondary error value of y coordinates for error specified `\"errorbar\"` and `\"errorband\"`." }, "yOffset": { "$ref": "#/definitions/OffsetDef", "description": "Offset of y-position of the marks" } }, "type": "object" }, "FacetedUnitSpec": { "additionalProperties": false, "description": "Unit spec that can have a composite mark and row or column channels (shorthand for a facet spec).", "properties": { "align": { "anyOf": [ { "$ref": "#/definitions/LayoutAlign" }, { "$ref": "#/definitions/RowCol" } ], "description": "The alignment to apply to grid rows and columns. The supported string values are `\"all\"`, `\"each\"`, and `\"none\"`.\n\n- For `\"none\"`, a flow layout will be used, in which adjacent subviews are simply placed one after the other.\n- For `\"each\"`, subviews will be aligned into a clean grid structure, but each row or column may be of variable size.\n- For `\"all\"`, subviews will be aligned and each row or column will be sized identically based on the maximum observed size. String values for this property will be applied to both grid rows and columns.\n\nAlternatively, an object value of the form `{\"row\": string, \"column\": string}` can be used to supply different alignments for rows and columns.\n\n__Default value:__ `\"all\"`." }, "bounds": { "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used.\n- If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", "enum": [ "full", "flush" ], "type": "string" }, "center": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/RowCol" } ], "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\nAn object value of the form `{\"row\": boolean, \"column\": boolean}` can be used to supply different centering values for rows and columns.\n\n__Default value:__ `false`" }, "data": { "anyOf": [ { "$ref": "#/definitions/Data" }, { "type": "null" } ], "description": "An object describing the data source. Set to `null` to ignore the parent's data source. If no data is set, it is derived from the parent." }, "description": { "description": "Description of this mark for commenting purpose.", "type": "string" }, "encoding": { "$ref": "#/definitions/FacetedEncoding", "description": "A key-value mapping between encoding channels and definition of fields." }, "height": { "anyOf": [ { "type": "number" }, { "const": "container", "type": "string" }, { "$ref": "#/definitions/Step" } ], "description": "The height of a visualization.\n\n- For a plot with a continuous y-field, height should be a number.\n- For a plot with either a discrete y-field or no y-field, height can be either a number indicating a fixed height or an object in the form of `{step: number}` defining the height per discrete step. (No y-field is equivalent to having one discrete step.)\n- To enable responsive sizing on height, it should be set to `\"container\"`.\n\n__Default value:__ Based on `config.view.continuousHeight` for a plot with a continuous y-field and `config.view.discreteHeight` otherwise.\n\n__Note:__ For plots with [`row` and `column` channels](https://vega.github.io/vega-lite/docs/encoding.html#facet), this represents the height of a single view and the `\"container\"` option cannot be used.\n\n__See also:__ [`height`](https://vega.github.io/vega-lite/docs/size.html) documentation." }, "mark": { "$ref": "#/definitions/AnyMark", "description": "A string describing the mark type (one of `\"bar\"`, `\"circle\"`, `\"square\"`, `\"tick\"`, `\"line\"`, `\"area\"`, `\"point\"`, `\"rule\"`, `\"geoshape\"`, and `\"text\"`) or a [mark definition object](https://vega.github.io/vega-lite/docs/mark.html#mark-def)." }, "name": { "description": "Name of the visualization for later reference.", "type": "string" }, "params": { "description": "An array of parameters that may either be simple variables, or more complex selections that map user input to data queries.", "items": { "$ref": "#/definitions/SelectionParameter" }, "type": "array" }, "projection": { "$ref": "#/definitions/Projection", "description": "An object defining properties of geographic projection, which will be applied to `shape` path for `\"geoshape\"` marks and to `latitude` and `\"longitude\"` channels for other marks." }, "resolve": { "$ref": "#/definitions/Resolve", "description": "Scale, axis, and legend resolutions for view composition specifications." }, "spacing": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/RowCol" } ], "description": "The spacing in pixels between sub-views of the composition operator. An object of the form `{\"row\": number, \"column\": number}` can be used to set different spacing values for rows and columns.\n\n__Default value__: Depends on `\"spacing\"` property of [the view composition configuration](https://vega.github.io/vega-lite/docs/config.html#view-config) (`20` by default)" }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "$ref": "#/definitions/TitleParams" } ], "description": "Title for the plot." }, "transform": { "description": "An array of data transformations such as filter and new field calculation.", "items": { "$ref": "#/definitions/Transform" }, "type": "array" }, "view": { "$ref": "#/definitions/ViewBackground", "description": "An object defining the view background's fill and stroke.\n\n__Default value:__ none (transparent)" }, "width": { "anyOf": [ { "type": "number" }, { "const": "container", "type": "string" }, { "$ref": "#/definitions/Step" } ], "description": "The width of a visualization.\n\n- For a plot with a continuous x-field, width should be a number.\n- For a plot with either a discrete x-field or no x-field, width can be either a number indicating a fixed width or an object in the form of `{step: number}` defining the width per discrete step. (No x-field is equivalent to having one discrete step.)\n- To enable responsive sizing on width, it should be set to `\"container\"`.\n\n__Default value:__ Based on `config.view.continuousWidth` for a plot with a continuous x-field and `config.view.discreteWidth` otherwise.\n\n__Note:__ For plots with [`row` and `column` channels](https://vega.github.io/vega-lite/docs/encoding.html#facet), this represents the width of a single view and the `\"container\"` option cannot be used.\n\n__See also:__ [`width`](https://vega.github.io/vega-lite/docs/size.html) documentation." } }, "required": [ "mark" ], "type": "object" }, "Feature": { "additionalProperties": false, "description": "A feature object which contains a geometry and associated properties. https://tools.ietf.org/html/rfc7946#section-3.2", "properties": { "bbox": { "$ref": "#/definitions/BBox", "description": "Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. https://tools.ietf.org/html/rfc7946#section-5" }, "geometry": { "$ref": "#/definitions/Geometry", "description": "The feature's geometry" }, "id": { "description": "A value that uniquely identifies this feature in a https://tools.ietf.org/html/rfc7946#section-3.2.", "type": [ "string", "number" ] }, "properties": { "$ref": "#/definitions/GeoJsonProperties", "description": "Properties associated with this feature." }, "type": { "const": "Feature", "description": "Specifies the type of GeoJSON object.", "type": "string" } }, "required": [ "geometry", "properties", "type" ], "type": "object" }, "Feature": { "additionalProperties": false, "description": "A feature object which contains a geometry and associated properties. https://tools.ietf.org/html/rfc7946#section-3.2", "properties": { "bbox": { "$ref": "#/definitions/BBox", "description": "Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. https://tools.ietf.org/html/rfc7946#section-5" }, "geometry": { "$ref": "#/definitions/Geometry", "description": "The feature's geometry" }, "id": { "description": "A value that uniquely identifies this feature in a https://tools.ietf.org/html/rfc7946#section-3.2.", "type": [ "string", "number" ] }, "properties": { "$ref": "#/definitions/GeoJsonProperties", "description": "Properties associated with this feature." }, "type": { "const": "Feature", "description": "Specifies the type of GeoJSON object.", "type": "string" } }, "required": [ "geometry", "properties", "type" ], "type": "object" }, "FeatureCollection": { "additionalProperties": false, "description": "A collection of feature objects. https://tools.ietf.org/html/rfc7946#section-3.3", "properties": { "bbox": { "$ref": "#/definitions/BBox", "description": "Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. https://tools.ietf.org/html/rfc7946#section-5" }, "features": { "items": { "$ref": "#/definitions/Feature" }, "type": "array" }, "type": { "const": "FeatureCollection", "description": "Specifies the type of GeoJSON object.", "type": "string" } }, "required": [ "features", "type" ], "type": "object" }, "Field": { "anyOf": [ { "$ref": "#/definitions/FieldName" }, { "$ref": "#/definitions/RepeatRef" } ] }, "FieldDefWithoutScale": { "$ref": "#/definitions/TypedFieldDef", "description": "Field Def without scale (and without bin: \"binned\" support)." }, "FieldEqualPredicate": { "additionalProperties": false, "properties": { "equal": { "anyOf": [ { "type": "string" }, { "type": "number" }, { "type": "boolean" }, { "$ref": "#/definitions/DateTime" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The value that the field should be equal to." }, "field": { "$ref": "#/definitions/FieldName", "description": "Field to be tested." }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit for the field to be tested." } }, "required": [ "equal", "field" ], "type": "object" }, "FieldGTEPredicate": { "additionalProperties": false, "properties": { "field": { "$ref": "#/definitions/FieldName", "description": "Field to be tested." }, "gte": { "anyOf": [ { "type": "string" }, { "type": "number" }, { "$ref": "#/definitions/DateTime" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The value that the field should be greater than or equals to." }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit for the field to be tested." } }, "required": [ "field", "gte" ], "type": "object" }, "FieldGTPredicate": { "additionalProperties": false, "properties": { "field": { "$ref": "#/definitions/FieldName", "description": "Field to be tested." }, "gt": { "anyOf": [ { "type": "string" }, { "type": "number" }, { "$ref": "#/definitions/DateTime" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The value that the field should be greater than." }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit for the field to be tested." } }, "required": [ "field", "gt" ], "type": "object" }, "FieldLTEPredicate": { "additionalProperties": false, "properties": { "field": { "$ref": "#/definitions/FieldName", "description": "Field to be tested." }, "lte": { "anyOf": [ { "type": "string" }, { "type": "number" }, { "$ref": "#/definitions/DateTime" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The value that the field should be less than or equals to." }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit for the field to be tested." } }, "required": [ "field", "lte" ], "type": "object" }, "FieldLTPredicate": { "additionalProperties": false, "properties": { "field": { "$ref": "#/definitions/FieldName", "description": "Field to be tested." }, "lt": { "anyOf": [ { "type": "string" }, { "type": "number" }, { "$ref": "#/definitions/DateTime" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The value that the field should be less than." }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit for the field to be tested." } }, "required": [ "field", "lt" ], "type": "object" }, "FieldName": { "type": "string" }, "FieldOneOfPredicate": { "additionalProperties": false, "properties": { "field": { "$ref": "#/definitions/FieldName", "description": "Field to be tested." }, "oneOf": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "items": { "type": "number" }, "type": "array" }, { "items": { "type": "boolean" }, "type": "array" }, { "items": { "$ref": "#/definitions/DateTime" }, "type": "array" } ], "description": "A set of values that the `field`'s value should be a member of, for a data item included in the filtered data." }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit for the field to be tested." } }, "required": [ "field", "oneOf" ], "type": "object" }, "FieldOrDatumDefWithCondition": { "additionalProperties": false, "description": "A FieldDef with Condition { condition: {value: ...}, field: ..., ... }", "properties": { "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "condition": { "anyOf": [ { "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" }, "type": "array" } ], "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." }, "datum": { "anyOf": [ { "$ref": "#/definitions/PrimitiveValue" }, { "$ref": "#/definitions/DateTime" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/RepeatRef" } ], "description": "A constant value in data domain." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "$ref": "#/definitions/Type", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } }, "type": "object" }, "FieldOrDatumDefWithCondition": { "additionalProperties": false, "description": "A FieldDef with Condition { condition: {value: ...}, field: ..., ... }", "properties": { "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "condition": { "anyOf": [ { "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" }, "type": "array" } ], "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." }, "datum": { "anyOf": [ { "$ref": "#/definitions/PrimitiveValue" }, { "$ref": "#/definitions/DateTime" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/RepeatRef" } ], "description": "A constant value in data domain." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "$ref": "#/definitions/Type", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } }, "type": "object" }, "FieldOrDatumDefWithCondition": { "additionalProperties": false, "description": "A FieldDef with Condition { condition: {value: ...}, field: ..., ... }", "properties": { "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "condition": { "anyOf": [ { "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" }, "type": "array" } ], "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." }, "datum": { "anyOf": [ { "$ref": "#/definitions/PrimitiveValue" }, { "$ref": "#/definitions/DateTime" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/RepeatRef" } ], "description": "A constant value in data domain." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "$ref": "#/definitions/Type", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } }, "type": "object" }, "FieldOrDatumDefWithCondition": { "additionalProperties": false, "description": "A FieldDef with Condition { condition: {value: ...}, field: ..., ... }", "properties": { "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "condition": { "anyOf": [ { "$ref": "#/definitions/ConditionalValueDef<(number[]|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalValueDef<(number[]|ExprRef)>" }, "type": "array" } ], "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." }, "datum": { "anyOf": [ { "$ref": "#/definitions/PrimitiveValue" }, { "$ref": "#/definitions/DateTime" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/RepeatRef" } ], "description": "A constant value in data domain." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "$ref": "#/definitions/Type", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } }, "type": "object" }, "FieldOrDatumDefWithCondition": { "additionalProperties": false, "description": "A FieldDef with Condition { condition: {value: ...}, field: ..., ... }", "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/BinParams" }, { "type": "null" } ], "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." }, "condition": { "anyOf": [ { "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" }, "type": "array" } ], "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "legend": { "anyOf": [ { "$ref": "#/definitions/Legend" }, { "type": "null" } ], "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." }, "scale": { "anyOf": [ { "$ref": "#/definitions/Scale" }, { "type": "null" } ], "description": "An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." }, "sort": { "$ref": "#/definitions/Sort", "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript.\n- [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`.\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "$ref": "#/definitions/StandardType", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } }, "type": "object" }, "FieldOrDatumDefWithCondition": { "additionalProperties": false, "description": "A FieldDef with Condition { condition: {value: ...}, field: ..., ... }", "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/BinParams" }, { "type": "null" } ], "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." }, "condition": { "anyOf": [ { "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" }, "type": "array" } ], "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "legend": { "anyOf": [ { "$ref": "#/definitions/Legend" }, { "type": "null" } ], "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." }, "scale": { "anyOf": [ { "$ref": "#/definitions/Scale" }, { "type": "null" } ], "description": "An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." }, "sort": { "$ref": "#/definitions/Sort", "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript.\n- [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`.\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "$ref": "#/definitions/StandardType", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } }, "type": "object" }, "FieldOrDatumDefWithCondition": { "additionalProperties": false, "description": "A FieldDef with Condition { condition: {value: ...}, field: ..., ... }", "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/BinParams" }, { "type": "null" } ], "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." }, "condition": { "anyOf": [ { "$ref": "#/definitions/ConditionalValueDef<(number[]|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalValueDef<(number[]|ExprRef)>" }, "type": "array" } ], "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "legend": { "anyOf": [ { "$ref": "#/definitions/Legend" }, { "type": "null" } ], "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." }, "scale": { "anyOf": [ { "$ref": "#/definitions/Scale" }, { "type": "null" } ], "description": "An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." }, "sort": { "$ref": "#/definitions/Sort", "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript.\n- [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`.\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "$ref": "#/definitions/StandardType", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } }, "type": "object" }, "FieldOrDatumDefWithCondition,(string|null)>": { "additionalProperties": false, "description": "A FieldDef with Condition { condition: {value: ...}, field: ..., ... }", "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/BinParams" }, { "type": "null" } ], "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." }, "condition": { "anyOf": [ { "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" }, "type": "array" } ], "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "legend": { "anyOf": [ { "$ref": "#/definitions/Legend" }, { "type": "null" } ], "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." }, "scale": { "anyOf": [ { "$ref": "#/definitions/Scale" }, { "type": "null" } ], "description": "An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." }, "sort": { "$ref": "#/definitions/Sort", "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript.\n- [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`.\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "$ref": "#/definitions/TypeForShape", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } }, "type": "object" }, "FieldOrDatumDefWithCondition": { "additionalProperties": false, "description": "A FieldDef with Condition { condition: {value: ...}, field: ..., ... }", "properties": { "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "condition": { "anyOf": [ { "$ref": "#/definitions/ConditionalValueDef<(Text|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalValueDef<(Text|ExprRef)>" }, "type": "array" } ], "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." }, "datum": { "anyOf": [ { "$ref": "#/definitions/PrimitiveValue" }, { "$ref": "#/definitions/DateTime" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/RepeatRef" } ], "description": "A constant value in data domain." }, "format": { "anyOf": [ { "type": "string" }, { "$ref": "#/definitions/Dict" } ], "description": "When used with the default `\"number\"` and `\"time\"` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks.\n\n- If the format type is `\"number\"` (e.g., for quantitative fields), this is D3's [number format pattern](https://github.com/d3/d3-format#locale_format).\n- If the format type is `\"time\"` (e.g., for temporal fields), this is D3's [time format pattern](https://github.com/d3/d3-time-format#locale_format).\n\nSee the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for more examples.\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." }, "formatType": { "description": "The format type for labels. One of `\"number\"`, `\"time\"`, or a [registered custom format type](https://vega.github.io/vega-lite/docs/config.html#custom-format-type).\n\n__Default value:__\n- `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`.\n- `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", "type": "string" }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "$ref": "#/definitions/Type", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } }, "type": "object" }, "FieldOrDatumDefWithCondition": { "additionalProperties": false, "description": "A FieldDef with Condition { condition: {value: ...}, field: ..., ... }", "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/BinParams" }, { "const": "binned", "type": "string" }, { "type": "null" } ], "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." }, "condition": { "anyOf": [ { "$ref": "#/definitions/ConditionalValueDef<(Text|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalValueDef<(Text|ExprRef)>" }, "type": "array" } ], "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "format": { "anyOf": [ { "type": "string" }, { "$ref": "#/definitions/Dict" } ], "description": "When used with the default `\"number\"` and `\"time\"` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks.\n\n- If the format type is `\"number\"` (e.g., for quantitative fields), this is D3's [number format pattern](https://github.com/d3/d3-format#locale_format).\n- If the format type is `\"time\"` (e.g., for temporal fields), this is D3's [time format pattern](https://github.com/d3/d3-time-format#locale_format).\n\nSee the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for more examples.\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." }, "formatType": { "description": "The format type for labels. One of `\"number\"`, `\"time\"`, or a [registered custom format type](https://vega.github.io/vega-lite/docs/config.html#custom-format-type).\n\n__Default value:__\n- `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`.\n- `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", "type": "string" }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "$ref": "#/definitions/StandardType", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } }, "type": "object" }, "FieldOrDatumDefWithCondition": { "additionalProperties": false, "description": "A FieldDef with Condition { condition: {value: ...}, field: ..., ... }", "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/BinParams" }, { "const": "binned", "type": "string" }, { "type": "null" } ], "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." }, "condition": { "anyOf": [ { "$ref": "#/definitions/ConditionalValueDef<(string|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalValueDef<(string|ExprRef)>" }, "type": "array" } ], "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "format": { "anyOf": [ { "type": "string" }, { "$ref": "#/definitions/Dict" } ], "description": "When used with the default `\"number\"` and `\"time\"` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks.\n\n- If the format type is `\"number\"` (e.g., for quantitative fields), this is D3's [number format pattern](https://github.com/d3/d3-format#locale_format).\n- If the format type is `\"time\"` (e.g., for temporal fields), this is D3's [time format pattern](https://github.com/d3/d3-time-format#locale_format).\n\nSee the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for more examples.\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." }, "formatType": { "description": "The format type for labels. One of `\"number\"`, `\"time\"`, or a [registered custom format type](https://vega.github.io/vega-lite/docs/config.html#custom-format-type).\n\n__Default value:__\n- `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`.\n- `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", "type": "string" }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "$ref": "#/definitions/StandardType", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } }, "type": "object" }, "FieldRange": { "additionalProperties": false, "properties": { "field": { "type": "string" } }, "required": [ "field" ], "type": "object" }, "FieldRangePredicate": { "additionalProperties": false, "properties": { "field": { "$ref": "#/definitions/FieldName", "description": "Field to be tested." }, "range": { "anyOf": [ { "items": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/DateTime" }, { "type": "null" }, { "$ref": "#/definitions/ExprRef" } ] }, "type": "array" }, { "$ref": "#/definitions/ExprRef" } ], "description": "An array of inclusive minimum and maximum values for a field value of a data item to be included in the filtered data.", "maxItems": 2, "minItems": 2 }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit for the field to be tested." } }, "required": [ "field", "range" ], "type": "object" }, "FieldValidPredicate": { "additionalProperties": false, "properties": { "field": { "$ref": "#/definitions/FieldName", "description": "Field to be tested." }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit for the field to be tested." }, "valid": { "description": "If set to true the field's value has to be valid, meaning both not `null` and not [`NaN`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN).", "type": "boolean" } }, "required": [ "field", "valid" ], "type": "object" }, "FilterTransform": { "additionalProperties": false, "properties": { "filter": { "$ref": "#/definitions/PredicateComposition", "description": "The `filter` property must be a predication definition, which can take one of the following forms:\n\n1) an [expression](https://vega.github.io/vega-lite/docs/types.html#expression) string, where `datum` can be used to refer to the current data object. For example, `{filter: \"datum.b2 > 60\"}` would make the output data includes only items that have values in the field `b2` over 60.\n\n2) one of the [field predicates](https://vega.github.io/vega-lite/docs/predicate.html#field-predicate): [`equal`](https://vega.github.io/vega-lite/docs/predicate.html#field-equal-predicate), [`lt`](https://vega.github.io/vega-lite/docs/predicate.html#lt-predicate), [`lte`](https://vega.github.io/vega-lite/docs/predicate.html#lte-predicate), [`gt`](https://vega.github.io/vega-lite/docs/predicate.html#gt-predicate), [`gte`](https://vega.github.io/vega-lite/docs/predicate.html#gte-predicate), [`range`](https://vega.github.io/vega-lite/docs/predicate.html#range-predicate), [`oneOf`](https://vega.github.io/vega-lite/docs/predicate.html#one-of-predicate), or [`valid`](https://vega.github.io/vega-lite/docs/predicate.html#valid-predicate),\n\n3) a [selection predicate](https://vega.github.io/vega-lite/docs/predicate.html#selection-predicate), which define the names of a selection that the data point should belong to (or a logical composition of selections).\n\n4) a [logical composition](https://vega.github.io/vega-lite/docs/predicate.html#composition) of (1), (2), or (3)." } }, "required": [ "filter" ], "type": "object" }, "Fit": { "anyOf": [ { "$ref": "#/definitions/GeoJsonFeature" }, { "$ref": "#/definitions/GeoJsonFeatureCollection" }, { "items": { "$ref": "#/definitions/GeoJsonFeature" }, "type": "array" } ] }, "FlattenTransform": { "additionalProperties": false, "properties": { "as": { "description": "The output field names for extracted array values.\n\n__Default value:__ The field name of the corresponding array field", "items": { "$ref": "#/definitions/FieldName" }, "type": "array" }, "flatten": { "description": "An array of one or more data fields containing arrays to flatten. If multiple fields are specified, their array values should have a parallel structure, ideally with the same length. If the lengths of parallel arrays do not match, the longest array will be used with `null` values added for missing entries.", "items": { "$ref": "#/definitions/FieldName" }, "type": "array" } }, "required": [ "flatten" ], "type": "object" }, "FoldTransform": { "additionalProperties": false, "properties": { "as": { "description": "The output field names for the key and value properties produced by the fold transform. __Default value:__ `[\"key\", \"value\"]`", "items": { "$ref": "#/definitions/FieldName" }, "maxItems": 2, "minItems": 2, "type": "array" }, "fold": { "description": "An array of data fields indicating the properties to fold.", "items": { "$ref": "#/definitions/FieldName" }, "type": "array" } }, "required": [ "fold" ], "type": "object" }, "FontStyle": { "type": "string" }, "FontWeight": { "enum": [ "normal", "bold", "lighter", "bolder", 100, 200, 300, 400, 500, 600, 700, 800, 900 ], "type": [ "string", "number" ] }, "FormatConfig": { "additionalProperties": false, "properties": { "normalizedNumberFormat": { "description": "If normalizedNumberFormatType is not specified, D3 number format for axis labels, text marks, and tooltips of normalized stacked fields (fields with `stack: \"normalize\"`). For example `\"s\"` for SI units. Use [D3's number format pattern](https://github.com/d3/d3-format#locale_format).\n\nIf `config.normalizedNumberFormatType` is specified and `config.customFormatTypes` is `true`, this value will be passed as `format` alongside `datum.value` to the `config.numberFormatType` function. __Default value:__ `%`", "type": "string" }, "normalizedNumberFormatType": { "description": "[Custom format type](https://vega.github.io/vega-lite/docs/config.html#custom-format-type) for `config.normalizedNumberFormat`.\n\n__Default value:__ `undefined` -- This is equilvalent to call D3-format, which is exposed as [`format` in Vega-Expression](https://vega.github.io/vega/docs/expressions/#format). __Note:__ You must also set `customFormatTypes` to `true` to use this feature.", "type": "string" }, "numberFormat": { "description": "If numberFormatType is not specified, D3 number format for guide labels, text marks, and tooltips of non-normalized fields (fields *without* `stack: \"normalize\"`). For example `\"s\"` for SI units. Use [D3's number format pattern](https://github.com/d3/d3-format#locale_format).\n\nIf `config.numberFormatType` is specified and `config.customFormatTypes` is `true`, this value will be passed as `format` alongside `datum.value` to the `config.numberFormatType` function.", "type": "string" }, "numberFormatType": { "description": "[Custom format type](https://vega.github.io/vega-lite/docs/config.html#custom-format-type) for `config.numberFormat`.\n\n__Default value:__ `undefined` -- This is equilvalent to call D3-format, which is exposed as [`format` in Vega-Expression](https://vega.github.io/vega/docs/expressions/#format). __Note:__ You must also set `customFormatTypes` to `true` to use this feature.", "type": "string" }, "timeFormat": { "description": "Default time format for raw time values (without time units) in text marks, legend labels and header labels.\n\n__Default value:__ `\"%b %d, %Y\"` __Note:__ Axes automatically determine the format for each label automatically so this config does not affect axes.", "type": "string" }, "timeFormatType": { "description": "[Custom format type](https://vega.github.io/vega-lite/docs/config.html#custom-format-type) for `config.timeFormat`.\n\n__Default value:__ `undefined` -- This is equilvalent to call D3-time-format, which is exposed as [`timeFormat` in Vega-Expression](https://vega.github.io/vega/docs/expressions/#timeFormat). __Note:__ You must also set `customFormatTypes` to `true` and there must *not* be a `timeUnit` defined to use this feature.", "type": "string" } }, "type": "object" }, "Generator": { "anyOf": [ { "$ref": "#/definitions/SequenceGenerator" }, { "$ref": "#/definitions/SphereGenerator" }, { "$ref": "#/definitions/GraticuleGenerator" } ] }, "ConcatSpec": { "additionalProperties": false, "description": "Base interface for a generalized concatenation specification.", "properties": { "align": { "anyOf": [ { "$ref": "#/definitions/LayoutAlign" }, { "$ref": "#/definitions/RowCol" } ], "description": "The alignment to apply to grid rows and columns. The supported string values are `\"all\"`, `\"each\"`, and `\"none\"`.\n\n- For `\"none\"`, a flow layout will be used, in which adjacent subviews are simply placed one after the other.\n- For `\"each\"`, subviews will be aligned into a clean grid structure, but each row or column may be of variable size.\n- For `\"all\"`, subviews will be aligned and each row or column will be sized identically based on the maximum observed size. String values for this property will be applied to both grid rows and columns.\n\nAlternatively, an object value of the form `{\"row\": string, \"column\": string}` can be used to supply different alignments for rows and columns.\n\n__Default value:__ `\"all\"`." }, "bounds": { "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used.\n- If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", "enum": [ "full", "flush" ], "type": "string" }, "center": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/RowCol" } ], "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\nAn object value of the form `{\"row\": boolean, \"column\": boolean}` can be used to supply different centering values for rows and columns.\n\n__Default value:__ `false`" }, "columns": { "description": "The number of columns to include in the view composition layout.\n\n__Default value__: `undefined` -- An infinite number of columns (a single row) will be assumed. This is equivalent to `hconcat` (for `concat`) and to using the `column` channel (for `facet` and `repeat`).\n\n__Note__:\n\n1) This property is only for:\n- the general (wrappable) `concat` operator (not `hconcat`/`vconcat`)\n- the `facet` and `repeat` operator with one field/repetition definition (without row/column nesting)\n\n2) Setting the `columns` to `1` is equivalent to `vconcat` (for `concat`) and to using the `row` channel (for `facet` and `repeat`).", "type": "number" }, "concat": { "description": "A list of views to be concatenated.", "items": { "$ref": "#/definitions/Spec" }, "type": "array" }, "data": { "anyOf": [ { "$ref": "#/definitions/Data" }, { "type": "null" } ], "description": "An object describing the data source. Set to `null` to ignore the parent's data source. If no data is set, it is derived from the parent." }, "description": { "description": "Description of this mark for commenting purpose.", "type": "string" }, "name": { "description": "Name of the visualization for later reference.", "type": "string" }, "resolve": { "$ref": "#/definitions/Resolve", "description": "Scale, axis, and legend resolutions for view composition specifications." }, "spacing": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/RowCol" } ], "description": "The spacing in pixels between sub-views of the composition operator. An object of the form `{\"row\": number, \"column\": number}` can be used to set different spacing values for rows and columns.\n\n__Default value__: Depends on `\"spacing\"` property of [the view composition configuration](https://vega.github.io/vega-lite/docs/config.html#view-config) (`20` by default)" }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "$ref": "#/definitions/TitleParams" } ], "description": "Title for the plot." }, "transform": { "description": "An array of data transformations such as filter and new field calculation.", "items": { "$ref": "#/definitions/Transform" }, "type": "array" } }, "required": [ "concat" ], "type": "object" }, "FacetSpec": { "additionalProperties": false, "description": "Base interface for a facet specification.", "properties": { "align": { "anyOf": [ { "$ref": "#/definitions/LayoutAlign" }, { "$ref": "#/definitions/RowCol" } ], "description": "The alignment to apply to grid rows and columns. The supported string values are `\"all\"`, `\"each\"`, and `\"none\"`.\n\n- For `\"none\"`, a flow layout will be used, in which adjacent subviews are simply placed one after the other.\n- For `\"each\"`, subviews will be aligned into a clean grid structure, but each row or column may be of variable size.\n- For `\"all\"`, subviews will be aligned and each row or column will be sized identically based on the maximum observed size. String values for this property will be applied to both grid rows and columns.\n\nAlternatively, an object value of the form `{\"row\": string, \"column\": string}` can be used to supply different alignments for rows and columns.\n\n__Default value:__ `\"all\"`." }, "bounds": { "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used.\n- If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", "enum": [ "full", "flush" ], "type": "string" }, "center": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/RowCol" } ], "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\nAn object value of the form `{\"row\": boolean, \"column\": boolean}` can be used to supply different centering values for rows and columns.\n\n__Default value:__ `false`" }, "columns": { "description": "The number of columns to include in the view composition layout.\n\n__Default value__: `undefined` -- An infinite number of columns (a single row) will be assumed. This is equivalent to `hconcat` (for `concat`) and to using the `column` channel (for `facet` and `repeat`).\n\n__Note__:\n\n1) This property is only for:\n- the general (wrappable) `concat` operator (not `hconcat`/`vconcat`)\n- the `facet` and `repeat` operator with one field/repetition definition (without row/column nesting)\n\n2) Setting the `columns` to `1` is equivalent to `vconcat` (for `concat`) and to using the `row` channel (for `facet` and `repeat`).", "type": "number" }, "data": { "anyOf": [ { "$ref": "#/definitions/Data" }, { "type": "null" } ], "description": "An object describing the data source. Set to `null` to ignore the parent's data source. If no data is set, it is derived from the parent." }, "description": { "description": "Description of this mark for commenting purpose.", "type": "string" }, "facet": { "anyOf": [ { "$ref": "#/definitions/FacetFieldDef" }, { "$ref": "#/definitions/FacetMapping" } ], "description": "Definition for how to facet the data. One of: 1) [a field definition for faceting the plot by one field](https://vega.github.io/vega-lite/docs/facet.html#field-def) 2) [An object that maps `row` and `column` channels to their field definitions](https://vega.github.io/vega-lite/docs/facet.html#mapping)" }, "name": { "description": "Name of the visualization for later reference.", "type": "string" }, "resolve": { "$ref": "#/definitions/Resolve", "description": "Scale, axis, and legend resolutions for view composition specifications." }, "spacing": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/RowCol" } ], "description": "The spacing in pixels between sub-views of the composition operator. An object of the form `{\"row\": number, \"column\": number}` can be used to set different spacing values for rows and columns.\n\n__Default value__: Depends on `\"spacing\"` property of [the view composition configuration](https://vega.github.io/vega-lite/docs/config.html#view-config) (`20` by default)" }, "spec": { "anyOf": [ { "$ref": "#/definitions/LayerSpec" }, { "$ref": "#/definitions/FacetedUnitSpec" } ], "description": "A specification of the view that gets faceted." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "$ref": "#/definitions/TitleParams" } ], "description": "Title for the plot." }, "transform": { "description": "An array of data transformations such as filter and new field calculation.", "items": { "$ref": "#/definitions/Transform" }, "type": "array" } }, "required": [ "facet", "spec" ], "type": "object" }, "HConcatSpec": { "additionalProperties": false, "description": "Base interface for a horizontal concatenation specification.", "properties": { "bounds": { "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used.\n- If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", "enum": [ "full", "flush" ], "type": "string" }, "center": { "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\n__Default value:__ `false`", "type": "boolean" }, "data": { "anyOf": [ { "$ref": "#/definitions/Data" }, { "type": "null" } ], "description": "An object describing the data source. Set to `null` to ignore the parent's data source. If no data is set, it is derived from the parent." }, "description": { "description": "Description of this mark for commenting purpose.", "type": "string" }, "hconcat": { "description": "A list of views to be concatenated and put into a row.", "items": { "$ref": "#/definitions/Spec" }, "type": "array" }, "name": { "description": "Name of the visualization for later reference.", "type": "string" }, "resolve": { "$ref": "#/definitions/Resolve", "description": "Scale, axis, and legend resolutions for view composition specifications." }, "spacing": { "description": "The spacing in pixels between sub-views of the concat operator.\n\n__Default value__: `10`", "type": "number" }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "$ref": "#/definitions/TitleParams" } ], "description": "Title for the plot." }, "transform": { "description": "An array of data transformations such as filter and new field calculation.", "items": { "$ref": "#/definitions/Transform" }, "type": "array" } }, "required": [ "hconcat" ], "type": "object" }, "Spec": { "anyOf": [ { "$ref": "#/definitions/FacetedUnitSpec" }, { "$ref": "#/definitions/LayerSpec" }, { "$ref": "#/definitions/RepeatSpec" }, { "$ref": "#/definitions/FacetSpec" }, { "$ref": "#/definitions/ConcatSpec" }, { "$ref": "#/definitions/VConcatSpec" }, { "$ref": "#/definitions/HConcatSpec" } ], "description": "Any specification in Vega-Lite." }, "GenericUnitSpec": { "additionalProperties": false, "description": "Base interface for a unit (single-view) specification.", "properties": { "data": { "anyOf": [ { "$ref": "#/definitions/Data" }, { "type": "null" } ], "description": "An object describing the data source. Set to `null` to ignore the parent's data source. If no data is set, it is derived from the parent." }, "description": { "description": "Description of this mark for commenting purpose.", "type": "string" }, "encoding": { "$ref": "#/definitions/Encoding", "description": "A key-value mapping between encoding channels and definition of fields." }, "mark": { "$ref": "#/definitions/AnyMark", "description": "A string describing the mark type (one of `\"bar\"`, `\"circle\"`, `\"square\"`, `\"tick\"`, `\"line\"`, `\"area\"`, `\"point\"`, `\"rule\"`, `\"geoshape\"`, and `\"text\"`) or a [mark definition object](https://vega.github.io/vega-lite/docs/mark.html#mark-def)." }, "name": { "description": "Name of the visualization for later reference.", "type": "string" }, "params": { "description": "An array of parameters that may either be simple variables, or more complex selections that map user input to data queries.", "items": { "$ref": "#/definitions/SelectionParameter" }, "type": "array" }, "projection": { "$ref": "#/definitions/Projection", "description": "An object defining properties of geographic projection, which will be applied to `shape` path for `\"geoshape\"` marks and to `latitude` and `\"longitude\"` channels for other marks." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "$ref": "#/definitions/TitleParams" } ], "description": "Title for the plot." }, "transform": { "description": "An array of data transformations such as filter and new field calculation.", "items": { "$ref": "#/definitions/Transform" }, "type": "array" } }, "required": [ "mark" ], "type": "object" }, "VConcatSpec": { "additionalProperties": false, "description": "Base interface for a vertical concatenation specification.", "properties": { "bounds": { "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used.\n- If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", "enum": [ "full", "flush" ], "type": "string" }, "center": { "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\n__Default value:__ `false`", "type": "boolean" }, "data": { "anyOf": [ { "$ref": "#/definitions/Data" }, { "type": "null" } ], "description": "An object describing the data source. Set to `null` to ignore the parent's data source. If no data is set, it is derived from the parent." }, "description": { "description": "Description of this mark for commenting purpose.", "type": "string" }, "name": { "description": "Name of the visualization for later reference.", "type": "string" }, "resolve": { "$ref": "#/definitions/Resolve", "description": "Scale, axis, and legend resolutions for view composition specifications." }, "spacing": { "description": "The spacing in pixels between sub-views of the concat operator.\n\n__Default value__: `10`", "type": "number" }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "$ref": "#/definitions/TitleParams" } ], "description": "Title for the plot." }, "transform": { "description": "An array of data transformations such as filter and new field calculation.", "items": { "$ref": "#/definitions/Transform" }, "type": "array" }, "vconcat": { "description": "A list of views to be concatenated and put into a column.", "items": { "$ref": "#/definitions/Spec" }, "type": "array" } }, "required": [ "vconcat" ], "type": "object" }, "GeoJsonFeature": { "$ref": "#/definitions/Feature" }, "GeoJsonFeatureCollection": { "$ref": "#/definitions/FeatureCollection" }, "GeoJsonProperties": { "anyOf": [ { "type": "object" }, { "type": "null" } ] }, "Geometry": { "anyOf": [ { "$ref": "#/definitions/Point" }, { "$ref": "#/definitions/MultiPoint" }, { "$ref": "#/definitions/LineString" }, { "$ref": "#/definitions/MultiLineString" }, { "$ref": "#/definitions/Polygon" }, { "$ref": "#/definitions/MultiPolygon" }, { "$ref": "#/definitions/GeometryCollection" } ], "description": "Union of geometry objects. https://tools.ietf.org/html/rfc7946#section-3" }, "GeometryCollection": { "additionalProperties": false, "description": "Geometry Collection https://tools.ietf.org/html/rfc7946#section-3.1.8", "properties": { "bbox": { "$ref": "#/definitions/BBox", "description": "Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. https://tools.ietf.org/html/rfc7946#section-5" }, "geometries": { "items": { "$ref": "#/definitions/Geometry" }, "type": "array" }, "type": { "const": "GeometryCollection", "description": "Specifies the type of GeoJSON object.", "type": "string" } }, "required": [ "geometries", "type" ], "type": "object" }, "Gradient": { "anyOf": [ { "$ref": "#/definitions/LinearGradient" }, { "$ref": "#/definitions/RadialGradient" } ] }, "GradientStop": { "additionalProperties": false, "properties": { "color": { "$ref": "#/definitions/Color", "description": "The color value at this point in the gradient." }, "offset": { "description": "The offset fraction for the color stop, indicating its position within the gradient.", "type": "number" } }, "required": [ "offset", "color" ], "type": "object" }, "GraticuleGenerator": { "additionalProperties": false, "properties": { "graticule": { "anyOf": [ { "const": true, "type": "boolean" }, { "$ref": "#/definitions/GraticuleParams" } ], "description": "Generate graticule GeoJSON data for geographic reference lines." }, "name": { "description": "Provide a placeholder name and bind data at runtime.", "type": "string" } }, "required": [ "graticule" ], "type": "object" }, "GraticuleParams": { "additionalProperties": false, "properties": { "extent": { "$ref": "#/definitions/Vector2>", "description": "Sets both the major and minor extents to the same values." }, "extentMajor": { "$ref": "#/definitions/Vector2>", "description": "The major extent of the graticule as a two-element array of coordinates." }, "extentMinor": { "$ref": "#/definitions/Vector2>", "description": "The minor extent of the graticule as a two-element array of coordinates." }, "precision": { "description": "The precision of the graticule in degrees.\n\n__Default value:__ `2.5`", "type": "number" }, "step": { "$ref": "#/definitions/Vector2", "description": "Sets both the major and minor step angles to the same values." }, "stepMajor": { "$ref": "#/definitions/Vector2", "description": "The major step angles of the graticule.\n\n\n__Default value:__ `[90, 360]`" }, "stepMinor": { "$ref": "#/definitions/Vector2", "description": "The minor step angles of the graticule.\n\n__Default value:__ `[10, 10]`" } }, "type": "object" }, "Header": { "additionalProperties": false, "description": "Headers of row / column channels for faceted plots.", "properties": { "format": { "anyOf": [ { "type": "string" }, { "$ref": "#/definitions/Dict" } ], "description": "When used with the default `\"number\"` and `\"time\"` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks.\n\n- If the format type is `\"number\"` (e.g., for quantitative fields), this is D3's [number format pattern](https://github.com/d3/d3-format#locale_format).\n- If the format type is `\"time\"` (e.g., for temporal fields), this is D3's [time format pattern](https://github.com/d3/d3-time-format#locale_format).\n\nSee the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for more examples.\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." }, "formatType": { "description": "The format type for labels. One of `\"number\"`, `\"time\"`, or a [registered custom format type](https://vega.github.io/vega-lite/docs/config.html#custom-format-type).\n\n__Default value:__\n- `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`.\n- `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", "type": "string" }, "labelAlign": { "anyOf": [ { "$ref": "#/definitions/Align" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Horizontal text alignment of header labels. One of `\"left\"`, `\"center\"`, or `\"right\"`." }, "labelAnchor": { "$ref": "#/definitions/TitleAnchor", "description": "The anchor position for placing the labels. One of `\"start\"`, `\"middle\"`, or `\"end\"`. For example, with a label orientation of top these anchor positions map to a left-, center-, or right-aligned label." }, "labelAngle": { "description": "The rotation angle of the header labels.\n\n__Default value:__ `0` for column header, `-90` for row header.", "maximum": 360, "minimum": -360, "type": "number" }, "labelBaseline": { "anyOf": [ { "$ref": "#/definitions/TextBaseline" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The vertical text baseline for the header labels. One of `\"alphabetic\"` (default), `\"top\"`, `\"middle\"`, `\"bottom\"`, `\"line-top\"`, or `\"line-bottom\"`. The `\"line-top\"` and `\"line-bottom\"` values operate similarly to `\"top\"` and `\"bottom\"`, but are calculated relative to the `titleLineHeight` rather than `titleFontSize` alone." }, "labelColor": { "anyOf": [ { "$ref": "#/definitions/Color" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The color of the header label, can be in hex color code or regular color name." }, "labelExpr": { "description": "[Vega expression](https://vega.github.io/vega/docs/expressions/) for customizing labels.\n\n__Note:__ The label text and value can be assessed via the `label` and `value` properties of the header's backing `datum` object.", "type": "string" }, "labelFont": { "anyOf": [ { "type": "string" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The font of the header label." }, "labelFontSize": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The font size of the header label, in pixels.", "minimum": 0 }, "labelFontStyle": { "anyOf": [ { "$ref": "#/definitions/FontStyle" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The font style of the header label." }, "labelFontWeight": { "anyOf": [ { "$ref": "#/definitions/FontWeight" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The font weight of the header label." }, "labelLimit": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The maximum length of the header label in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.\n\n__Default value:__ `0`, indicating no limit" }, "labelLineHeight": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Line height in pixels for multi-line header labels or title text with `\"line-top\"` or `\"line-bottom\"` baseline." }, "labelOrient": { "$ref": "#/definitions/Orient", "description": "The orientation of the header label. One of `\"top\"`, `\"bottom\"`, `\"left\"` or `\"right\"`." }, "labelPadding": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The padding, in pixel, between facet header's label and the plot.\n\n__Default value:__ `10`" }, "labels": { "description": "A boolean flag indicating if labels should be included as part of the header.\n\n__Default value:__ `true`.", "type": "boolean" }, "orient": { "$ref": "#/definitions/Orient", "description": "Shortcut for setting both labelOrient and titleOrient." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "titleAlign": { "anyOf": [ { "$ref": "#/definitions/Align" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Horizontal text alignment (to the anchor) of header titles." }, "titleAnchor": { "$ref": "#/definitions/TitleAnchor", "description": "The anchor position for placing the title. One of `\"start\"`, `\"middle\"`, or `\"end\"`. For example, with an orientation of top these anchor positions map to a left-, center-, or right-aligned title." }, "titleAngle": { "description": "The rotation angle of the header title.\n\n__Default value:__ `0`.", "maximum": 360, "minimum": -360, "type": "number" }, "titleBaseline": { "anyOf": [ { "$ref": "#/definitions/TextBaseline" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The vertical text baseline for the header title. One of `\"alphabetic\"` (default), `\"top\"`, `\"middle\"`, `\"bottom\"`, `\"line-top\"`, or `\"line-bottom\"`. The `\"line-top\"` and `\"line-bottom\"` values operate similarly to `\"top\"` and `\"bottom\"`, but are calculated relative to the `titleLineHeight` rather than `titleFontSize` alone.\n\n__Default value:__ `\"middle\"`" }, "titleColor": { "anyOf": [ { "$ref": "#/definitions/Color" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Color of the header title, can be in hex color code or regular color name." }, "titleFont": { "anyOf": [ { "type": "string" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Font of the header title. (e.g., `\"Helvetica Neue\"`)." }, "titleFontSize": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Font size of the header title.", "minimum": 0 }, "titleFontStyle": { "anyOf": [ { "$ref": "#/definitions/FontStyle" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The font style of the header title." }, "titleFontWeight": { "anyOf": [ { "$ref": "#/definitions/FontWeight" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Font weight of the header title. This can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." }, "titleLimit": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The maximum length of the header title in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.\n\n__Default value:__ `0`, indicating no limit" }, "titleLineHeight": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Line height in pixels for multi-line header title text or title text with `\"line-top\"` or `\"line-bottom\"` baseline." }, "titleOrient": { "$ref": "#/definitions/Orient", "description": "The orientation of the header title. One of `\"top\"`, `\"bottom\"`, `\"left\"` or `\"right\"`." }, "titlePadding": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The padding, in pixel, between facet header's title and the label.\n\n__Default value:__ `10`" } }, "type": "object" }, "HeaderConfig": { "additionalProperties": false, "properties": { "format": { "anyOf": [ { "type": "string" }, { "$ref": "#/definitions/Dict" } ], "description": "When used with the default `\"number\"` and `\"time\"` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks.\n\n- If the format type is `\"number\"` (e.g., for quantitative fields), this is D3's [number format pattern](https://github.com/d3/d3-format#locale_format).\n- If the format type is `\"time\"` (e.g., for temporal fields), this is D3's [time format pattern](https://github.com/d3/d3-time-format#locale_format).\n\nSee the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for more examples.\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." }, "formatType": { "description": "The format type for labels. One of `\"number\"`, `\"time\"`, or a [registered custom format type](https://vega.github.io/vega-lite/docs/config.html#custom-format-type).\n\n__Default value:__\n- `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`.\n- `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", "type": "string" }, "labelAlign": { "anyOf": [ { "$ref": "#/definitions/Align" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Horizontal text alignment of header labels. One of `\"left\"`, `\"center\"`, or `\"right\"`." }, "labelAnchor": { "$ref": "#/definitions/TitleAnchor", "description": "The anchor position for placing the labels. One of `\"start\"`, `\"middle\"`, or `\"end\"`. For example, with a label orientation of top these anchor positions map to a left-, center-, or right-aligned label." }, "labelAngle": { "description": "The rotation angle of the header labels.\n\n__Default value:__ `0` for column header, `-90` for row header.", "maximum": 360, "minimum": -360, "type": "number" }, "labelBaseline": { "anyOf": [ { "$ref": "#/definitions/TextBaseline" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The vertical text baseline for the header labels. One of `\"alphabetic\"` (default), `\"top\"`, `\"middle\"`, `\"bottom\"`, `\"line-top\"`, or `\"line-bottom\"`. The `\"line-top\"` and `\"line-bottom\"` values operate similarly to `\"top\"` and `\"bottom\"`, but are calculated relative to the `titleLineHeight` rather than `titleFontSize` alone." }, "labelColor": { "anyOf": [ { "$ref": "#/definitions/Color" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The color of the header label, can be in hex color code or regular color name." }, "labelExpr": { "description": "[Vega expression](https://vega.github.io/vega/docs/expressions/) for customizing labels.\n\n__Note:__ The label text and value can be assessed via the `label` and `value` properties of the header's backing `datum` object.", "type": "string" }, "labelFont": { "anyOf": [ { "type": "string" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The font of the header label." }, "labelFontSize": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The font size of the header label, in pixels.", "minimum": 0 }, "labelFontStyle": { "anyOf": [ { "$ref": "#/definitions/FontStyle" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The font style of the header label." }, "labelFontWeight": { "anyOf": [ { "$ref": "#/definitions/FontWeight" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The font weight of the header label." }, "labelLimit": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The maximum length of the header label in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.\n\n__Default value:__ `0`, indicating no limit" }, "labelLineHeight": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Line height in pixels for multi-line header labels or title text with `\"line-top\"` or `\"line-bottom\"` baseline." }, "labelOrient": { "$ref": "#/definitions/Orient", "description": "The orientation of the header label. One of `\"top\"`, `\"bottom\"`, `\"left\"` or `\"right\"`." }, "labelPadding": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The padding, in pixel, between facet header's label and the plot.\n\n__Default value:__ `10`" }, "labels": { "description": "A boolean flag indicating if labels should be included as part of the header.\n\n__Default value:__ `true`.", "type": "boolean" }, "orient": { "$ref": "#/definitions/Orient", "description": "Shortcut for setting both labelOrient and titleOrient." }, "title": { "description": "Set to null to disable title for the axis, legend, or header.", "type": "null" }, "titleAlign": { "anyOf": [ { "$ref": "#/definitions/Align" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Horizontal text alignment (to the anchor) of header titles." }, "titleAnchor": { "$ref": "#/definitions/TitleAnchor", "description": "The anchor position for placing the title. One of `\"start\"`, `\"middle\"`, or `\"end\"`. For example, with an orientation of top these anchor positions map to a left-, center-, or right-aligned title." }, "titleAngle": { "description": "The rotation angle of the header title.\n\n__Default value:__ `0`.", "maximum": 360, "minimum": -360, "type": "number" }, "titleBaseline": { "anyOf": [ { "$ref": "#/definitions/TextBaseline" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The vertical text baseline for the header title. One of `\"alphabetic\"` (default), `\"top\"`, `\"middle\"`, `\"bottom\"`, `\"line-top\"`, or `\"line-bottom\"`. The `\"line-top\"` and `\"line-bottom\"` values operate similarly to `\"top\"` and `\"bottom\"`, but are calculated relative to the `titleLineHeight` rather than `titleFontSize` alone.\n\n__Default value:__ `\"middle\"`" }, "titleColor": { "anyOf": [ { "$ref": "#/definitions/Color" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Color of the header title, can be in hex color code or regular color name." }, "titleFont": { "anyOf": [ { "type": "string" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Font of the header title. (e.g., `\"Helvetica Neue\"`)." }, "titleFontSize": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Font size of the header title.", "minimum": 0 }, "titleFontStyle": { "anyOf": [ { "$ref": "#/definitions/FontStyle" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The font style of the header title." }, "titleFontWeight": { "anyOf": [ { "$ref": "#/definitions/FontWeight" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Font weight of the header title. This can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." }, "titleLimit": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The maximum length of the header title in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.\n\n__Default value:__ `0`, indicating no limit" }, "titleLineHeight": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Line height in pixels for multi-line header title text or title text with `\"line-top\"` or `\"line-bottom\"` baseline." }, "titleOrient": { "$ref": "#/definitions/Orient", "description": "The orientation of the header title. One of `\"top\"`, `\"bottom\"`, `\"left\"` or `\"right\"`." }, "titlePadding": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The padding, in pixel, between facet header's title and the label.\n\n__Default value:__ `10`" } }, "type": "object" }, "HexColor": { "format": "color-hex", "type": "string" }, "ImputeMethod": { "enum": [ "value", "median", "max", "min", "mean" ], "type": "string" }, "ImputeParams": { "additionalProperties": false, "properties": { "frame": { "description": "A frame specification as a two-element array used to control the window over which the specified method is applied. The array entries should either be a number indicating the offset from the current data object, or null to indicate unbounded rows preceding or following the current data object. For example, the value `[-5, 5]` indicates that the window should include five objects preceding and five objects following the current object.\n\n__Default value:__: `[null, null]` indicating that the window includes all objects.", "items": { "type": [ "null", "number" ] }, "maxItems": 2, "minItems": 2, "type": "array" }, "keyvals": { "anyOf": [ { "items": {}, "type": "array" }, { "$ref": "#/definitions/ImputeSequence" } ], "description": "Defines the key values that should be considered for imputation. An array of key values or an object defining a [number sequence](https://vega.github.io/vega-lite/docs/impute.html#sequence-def).\n\nIf provided, this will be used in addition to the key values observed within the input data. If not provided, the values will be derived from all unique values of the `key` field. For `impute` in `encoding`, the key field is the x-field if the y-field is imputed, or vice versa.\n\nIf there is no impute grouping, this property _must_ be specified." }, "method": { "$ref": "#/definitions/ImputeMethod", "description": "The imputation method to use for the field value of imputed data objects. One of `\"value\"`, `\"mean\"`, `\"median\"`, `\"max\"` or `\"min\"`.\n\n__Default value:__ `\"value\"`" }, "value": { "description": "The field value to use when the imputation `method` is `\"value\"`." } }, "type": "object" }, "ImputeSequence": { "additionalProperties": false, "properties": { "start": { "description": "The starting value of the sequence. __Default value:__ `0`", "type": "number" }, "step": { "description": "The step value between sequence entries. __Default value:__ `1` or `-1` if `stop < start`", "type": "number" }, "stop": { "description": "The ending value(exclusive) of the sequence.", "type": "number" } }, "required": [ "stop" ], "type": "object" }, "ImputeTransform": { "additionalProperties": false, "properties": { "frame": { "description": "A frame specification as a two-element array used to control the window over which the specified method is applied. The array entries should either be a number indicating the offset from the current data object, or null to indicate unbounded rows preceding or following the current data object. For example, the value `[-5, 5]` indicates that the window should include five objects preceding and five objects following the current object.\n\n__Default value:__: `[null, null]` indicating that the window includes all objects.", "items": { "type": [ "null", "number" ] }, "maxItems": 2, "minItems": 2, "type": "array" }, "groupby": { "description": "An optional array of fields by which to group the values. Imputation will then be performed on a per-group basis.", "items": { "$ref": "#/definitions/FieldName" }, "type": "array" }, "impute": { "$ref": "#/definitions/FieldName", "description": "The data field for which the missing values should be imputed." }, "key": { "$ref": "#/definitions/FieldName", "description": "A key field that uniquely identifies data objects within a group. Missing key values (those occurring in the data but not in the current group) will be imputed." }, "keyvals": { "anyOf": [ { "items": {}, "type": "array" }, { "$ref": "#/definitions/ImputeSequence" } ], "description": "Defines the key values that should be considered for imputation. An array of key values or an object defining a [number sequence](https://vega.github.io/vega-lite/docs/impute.html#sequence-def).\n\nIf provided, this will be used in addition to the key values observed within the input data. If not provided, the values will be derived from all unique values of the `key` field. For `impute` in `encoding`, the key field is the x-field if the y-field is imputed, or vice versa.\n\nIf there is no impute grouping, this property _must_ be specified." }, "method": { "$ref": "#/definitions/ImputeMethod", "description": "The imputation method to use for the field value of imputed data objects. One of `\"value\"`, `\"mean\"`, `\"median\"`, `\"max\"` or `\"min\"`.\n\n__Default value:__ `\"value\"`" }, "value": { "description": "The field value to use when the imputation `method` is `\"value\"`." } }, "required": [ "impute", "key" ], "type": "object" }, "InlineData": { "additionalProperties": false, "properties": { "format": { "$ref": "#/definitions/DataFormat", "description": "An object that specifies the format for parsing the data." }, "name": { "description": "Provide a placeholder name and bind data at runtime.", "type": "string" }, "values": { "$ref": "#/definitions/InlineDataset", "description": "The full data set, included inline. This can be an array of objects or primitive values, an object, or a string. Arrays of primitive values are ingested as objects with a `data` property. Strings are parsed according to the specified format type." } }, "required": [ "values" ], "type": "object" }, "InlineDataset": { "anyOf": [ { "items": { "type": "number" }, "type": "array" }, { "items": { "type": "string" }, "type": "array" }, { "items": { "type": "boolean" }, "type": "array" }, { "items": { "type": "object" }, "type": "array" }, { "type": "string" }, { "type": "object" } ] }, "Interpolate": { "enum": [ "basis", "basis-open", "basis-closed", "bundle", "cardinal", "cardinal-open", "cardinal-closed", "catmull-rom", "linear", "linear-closed", "monotone", "natural", "step", "step-before", "step-after" ], "type": "string" }, "IntervalSelectionConfig": { "additionalProperties": false, "properties": { "clear": { "anyOf": [ { "$ref": "#/definitions/Stream" }, { "type": "string" }, { "type": "boolean" } ], "description": "Clears the selection, emptying it of all values. This property can be a [Event Stream](https://vega.github.io/vega/docs/event-streams/) or `false` to disable clear.\n\n__Default value:__ `dblclick`.\n\n__See also:__ [`clear` examples ](https://vega.github.io/vega-lite/docs/selection.html#clear) in the documentation." }, "encodings": { "description": "An array of encoding channels. The corresponding data field values must match for a data tuple to fall within the selection.\n\n__See also:__ The [projection with `encodings` and `fields` section](https://vega.github.io/vega-lite/docs/selection.html#project) in the documentation.", "items": { "$ref": "#/definitions/SingleDefUnitChannel" }, "type": "array" }, "fields": { "description": "An array of field names whose values must match for a data tuple to fall within the selection.\n\n__See also:__ The [projection with `encodings` and `fields` section](https://vega.github.io/vega-lite/docs/selection.html#project) in the documentation.", "items": { "$ref": "#/definitions/FieldName" }, "type": "array" }, "mark": { "$ref": "#/definitions/BrushConfig", "description": "An interval selection also adds a rectangle mark to depict the extents of the interval. The `mark` property can be used to customize the appearance of the mark.\n\n__See also:__ [`mark` examples](https://vega.github.io/vega-lite/docs/selection.html#mark) in the documentation." }, "on": { "anyOf": [ { "$ref": "#/definitions/Stream" }, { "type": "string" } ], "description": "A [Vega event stream](https://vega.github.io/vega/docs/event-streams/) (object or selector) that triggers the selection. For interval selections, the event stream must specify a [start and end](https://vega.github.io/vega/docs/event-streams/#between-filters).\n\n__See also:__ [`on` examples](https://vega.github.io/vega-lite/docs/selection.html#on) in the documentation." }, "resolve": { "$ref": "#/definitions/SelectionResolution", "description": "With layered and multi-view displays, a strategy that determines how selections' data queries are resolved when applied in a filter transform, conditional encoding rule, or scale domain.\n\nOne of:\n- `\"global\"` -- only one brush exists for the entire SPLOM. When the user begins to drag, any previous brushes are cleared, and a new one is constructed.\n- `\"union\"` -- each cell contains its own brush, and points are highlighted if they lie within _any_ of these individual brushes.\n- `\"intersect\"` -- each cell contains its own brush, and points are highlighted only if they fall within _all_ of these individual brushes.\n\n__Default value:__ `global`.\n\n__See also:__ [`resolve` examples](https://vega.github.io/vega-lite/docs/selection.html#resolve) in the documentation." }, "translate": { "description": "When truthy, allows a user to interactively move an interval selection back-and-forth. Can be `true`, `false` (to disable panning), or a [Vega event stream definition](https://vega.github.io/vega/docs/event-streams/) which must include a start and end event to trigger continuous panning. Discrete panning (e.g., pressing the left/right arrow keys) will be supported in future versions.\n\n__Default value:__ `true`, which corresponds to `[pointerdown, window:pointerup] > window:pointermove!`. This default allows users to clicks and drags within an interval selection to reposition it.\n\n__See also:__ [`translate` examples](https://vega.github.io/vega-lite/docs/selection.html#translate) in the documentation.", "type": [ "string", "boolean" ] }, "type": { "const": "interval", "description": "Determines the default event processing and data query for the selection. Vega-Lite currently supports two selection types:\n\n- `\"point\"` -- to select multiple discrete data values; the first value is selected on `click` and additional values toggled on shift-click.\n- `\"interval\"` -- to select a continuous range of data values on `drag`.", "type": "string" }, "zoom": { "description": "When truthy, allows a user to interactively resize an interval selection. Can be `true`, `false` (to disable zooming), or a [Vega event stream definition](https://vega.github.io/vega/docs/event-streams/). Currently, only `wheel` events are supported, but custom event streams can still be used to specify filters, debouncing, and throttling. Future versions will expand the set of events that can trigger this transformation.\n\n__Default value:__ `true`, which corresponds to `wheel!`. This default allows users to use the mouse wheel to resize an interval selection.\n\n__See also:__ [`zoom` examples](https://vega.github.io/vega-lite/docs/selection.html#zoom) in the documentation.", "type": [ "string", "boolean" ] } }, "required": [ "type" ], "type": "object" }, "IntervalSelectionConfigWithoutType": { "additionalProperties": false, "properties": { "clear": { "anyOf": [ { "$ref": "#/definitions/Stream" }, { "type": "string" }, { "type": "boolean" } ], "description": "Clears the selection, emptying it of all values. This property can be a [Event Stream](https://vega.github.io/vega/docs/event-streams/) or `false` to disable clear.\n\n__Default value:__ `dblclick`.\n\n__See also:__ [`clear` examples ](https://vega.github.io/vega-lite/docs/selection.html#clear) in the documentation." }, "encodings": { "description": "An array of encoding channels. The corresponding data field values must match for a data tuple to fall within the selection.\n\n__See also:__ The [projection with `encodings` and `fields` section](https://vega.github.io/vega-lite/docs/selection.html#project) in the documentation.", "items": { "$ref": "#/definitions/SingleDefUnitChannel" }, "type": "array" }, "fields": { "description": "An array of field names whose values must match for a data tuple to fall within the selection.\n\n__See also:__ The [projection with `encodings` and `fields` section](https://vega.github.io/vega-lite/docs/selection.html#project) in the documentation.", "items": { "$ref": "#/definitions/FieldName" }, "type": "array" }, "mark": { "$ref": "#/definitions/BrushConfig", "description": "An interval selection also adds a rectangle mark to depict the extents of the interval. The `mark` property can be used to customize the appearance of the mark.\n\n__See also:__ [`mark` examples](https://vega.github.io/vega-lite/docs/selection.html#mark) in the documentation." }, "on": { "anyOf": [ { "$ref": "#/definitions/Stream" }, { "type": "string" } ], "description": "A [Vega event stream](https://vega.github.io/vega/docs/event-streams/) (object or selector) that triggers the selection. For interval selections, the event stream must specify a [start and end](https://vega.github.io/vega/docs/event-streams/#between-filters).\n\n__See also:__ [`on` examples](https://vega.github.io/vega-lite/docs/selection.html#on) in the documentation." }, "resolve": { "$ref": "#/definitions/SelectionResolution", "description": "With layered and multi-view displays, a strategy that determines how selections' data queries are resolved when applied in a filter transform, conditional encoding rule, or scale domain.\n\nOne of:\n- `\"global\"` -- only one brush exists for the entire SPLOM. When the user begins to drag, any previous brushes are cleared, and a new one is constructed.\n- `\"union\"` -- each cell contains its own brush, and points are highlighted if they lie within _any_ of these individual brushes.\n- `\"intersect\"` -- each cell contains its own brush, and points are highlighted only if they fall within _all_ of these individual brushes.\n\n__Default value:__ `global`.\n\n__See also:__ [`resolve` examples](https://vega.github.io/vega-lite/docs/selection.html#resolve) in the documentation." }, "translate": { "description": "When truthy, allows a user to interactively move an interval selection back-and-forth. Can be `true`, `false` (to disable panning), or a [Vega event stream definition](https://vega.github.io/vega/docs/event-streams/) which must include a start and end event to trigger continuous panning. Discrete panning (e.g., pressing the left/right arrow keys) will be supported in future versions.\n\n__Default value:__ `true`, which corresponds to `[pointerdown, window:pointerup] > window:pointermove!`. This default allows users to clicks and drags within an interval selection to reposition it.\n\n__See also:__ [`translate` examples](https://vega.github.io/vega-lite/docs/selection.html#translate) in the documentation.", "type": [ "string", "boolean" ] }, "zoom": { "description": "When truthy, allows a user to interactively resize an interval selection. Can be `true`, `false` (to disable zooming), or a [Vega event stream definition](https://vega.github.io/vega/docs/event-streams/). Currently, only `wheel` events are supported, but custom event streams can still be used to specify filters, debouncing, and throttling. Future versions will expand the set of events that can trigger this transformation.\n\n__Default value:__ `true`, which corresponds to `wheel!`. This default allows users to use the mouse wheel to resize an interval selection.\n\n__See also:__ [`zoom` examples](https://vega.github.io/vega-lite/docs/selection.html#zoom) in the documentation.", "type": [ "string", "boolean" ] } }, "type": "object" }, "JoinAggregateFieldDef": { "additionalProperties": false, "properties": { "as": { "$ref": "#/definitions/FieldName", "description": "The output name for the join aggregate operation." }, "field": { "$ref": "#/definitions/FieldName", "description": "The data field for which to compute the aggregate function. This can be omitted for functions that do not operate over a field such as `\"count\"`." }, "op": { "$ref": "#/definitions/AggregateOp", "description": "The aggregation operation to apply (e.g., `\"sum\"`, `\"average\"` or `\"count\"`). See the list of all supported operations [here](https://vega.github.io/vega-lite/docs/aggregate.html#ops)." } }, "required": [ "op", "as" ], "type": "object" }, "JoinAggregateTransform": { "additionalProperties": false, "properties": { "groupby": { "description": "The data fields for partitioning the data objects into separate groups. If unspecified, all data points will be in a single group.", "items": { "$ref": "#/definitions/FieldName" }, "type": "array" }, "joinaggregate": { "description": "The definition of the fields in the join aggregate, and what calculations to use.", "items": { "$ref": "#/definitions/JoinAggregateFieldDef" }, "type": "array" } }, "required": [ "joinaggregate" ], "type": "object" }, "JsonDataFormat": { "additionalProperties": false, "properties": { "parse": { "anyOf": [ { "$ref": "#/definitions/Parse" }, { "type": "null" } ], "description": "If set to `null`, disable type inference based on the spec and only use type inference based on the data. Alternatively, a parsing directive object can be provided for explicit data types. Each property of the object corresponds to a field name, and the value to the desired data type (one of `\"number\"`, `\"boolean\"`, `\"date\"`, or null (do not parse the field)). For example, `\"parse\": {\"modified_on\": \"date\"}` parses the `modified_on` field in each input record a Date value.\n\nFor `\"date\"`, we parse data based using JavaScript's [`Date.parse()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse). For Specific date formats can be provided (e.g., `{foo: \"date:'%m%d%Y'\"}`), using the [d3-time-format syntax](https://github.com/d3/d3-time-format#locale_format). UTC date format parsing is supported similarly (e.g., `{foo: \"utc:'%m%d%Y'\"}`). See more about [UTC time](https://vega.github.io/vega-lite/docs/timeunit.html#utc)" }, "property": { "description": "The JSON property containing the desired data. This parameter can be used when the loaded JSON file may have surrounding structure or meta-data. For example `\"property\": \"values.features\"` is equivalent to retrieving `json.values.features` from the loaded JSON object.", "type": "string" }, "type": { "const": "json", "description": "Type of input data: `\"json\"`, `\"csv\"`, `\"tsv\"`, `\"dsv\"`.\n\n__Default value:__ The default format type is determined by the extension of the file URL. If no extension is detected, `\"json\"` will be used by default.", "type": "string" } }, "type": "object" }, "LabelOverlap": { "anyOf": [ { "type": "boolean" }, { "const": "parity", "type": "string" }, { "const": "greedy", "type": "string" } ] }, "LatLongDef": { "anyOf": [ { "$ref": "#/definitions/LatLongFieldDef" }, { "$ref": "#/definitions/DatumDef" } ] }, "LatLongFieldDef": { "additionalProperties": false, "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation.", "type": "null" }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "const": "quantitative", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation.", "type": "string" } }, "type": "object" }, "LayerRepeatMapping": { "additionalProperties": false, "properties": { "column": { "description": "An array of fields to be repeated horizontally.", "items": { "type": "string" }, "type": "array" }, "layer": { "description": "An array of fields to be repeated as layers.", "items": { "type": "string" }, "type": "array" }, "row": { "description": "An array of fields to be repeated vertically.", "items": { "type": "string" }, "type": "array" } }, "required": [ "layer" ], "type": "object" }, "LayerRepeatSpec": { "additionalProperties": false, "properties": { "align": { "anyOf": [ { "$ref": "#/definitions/LayoutAlign" }, { "$ref": "#/definitions/RowCol" } ], "description": "The alignment to apply to grid rows and columns. The supported string values are `\"all\"`, `\"each\"`, and `\"none\"`.\n\n- For `\"none\"`, a flow layout will be used, in which adjacent subviews are simply placed one after the other.\n- For `\"each\"`, subviews will be aligned into a clean grid structure, but each row or column may be of variable size.\n- For `\"all\"`, subviews will be aligned and each row or column will be sized identically based on the maximum observed size. String values for this property will be applied to both grid rows and columns.\n\nAlternatively, an object value of the form `{\"row\": string, \"column\": string}` can be used to supply different alignments for rows and columns.\n\n__Default value:__ `\"all\"`." }, "bounds": { "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used.\n- If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", "enum": [ "full", "flush" ], "type": "string" }, "center": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/RowCol" } ], "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\nAn object value of the form `{\"row\": boolean, \"column\": boolean}` can be used to supply different centering values for rows and columns.\n\n__Default value:__ `false`" }, "columns": { "description": "The number of columns to include in the view composition layout.\n\n__Default value__: `undefined` -- An infinite number of columns (a single row) will be assumed. This is equivalent to `hconcat` (for `concat`) and to using the `column` channel (for `facet` and `repeat`).\n\n__Note__:\n\n1) This property is only for:\n- the general (wrappable) `concat` operator (not `hconcat`/`vconcat`)\n- the `facet` and `repeat` operator with one field/repetition definition (without row/column nesting)\n\n2) Setting the `columns` to `1` is equivalent to `vconcat` (for `concat`) and to using the `row` channel (for `facet` and `repeat`).", "type": "number" }, "data": { "anyOf": [ { "$ref": "#/definitions/Data" }, { "type": "null" } ], "description": "An object describing the data source. Set to `null` to ignore the parent's data source. If no data is set, it is derived from the parent." }, "description": { "description": "Description of this mark for commenting purpose.", "type": "string" }, "name": { "description": "Name of the visualization for later reference.", "type": "string" }, "repeat": { "$ref": "#/definitions/LayerRepeatMapping", "description": "Definition for fields to be repeated. One of: 1) An array of fields to be repeated. If `\"repeat\"` is an array, the field can be referred to as `{\"repeat\": \"repeat\"}`. The repeated views are laid out in a wrapped row. You can set the number of columns to control the wrapping. 2) An object that maps `\"row\"` and/or `\"column\"` to the listed fields to be repeated along the particular orientations. The objects `{\"repeat\": \"row\"}` and `{\"repeat\": \"column\"}` can be used to refer to the repeated field respectively." }, "resolve": { "$ref": "#/definitions/Resolve", "description": "Scale, axis, and legend resolutions for view composition specifications." }, "spacing": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/RowCol" } ], "description": "The spacing in pixels between sub-views of the composition operator. An object of the form `{\"row\": number, \"column\": number}` can be used to set different spacing values for rows and columns.\n\n__Default value__: Depends on `\"spacing\"` property of [the view composition configuration](https://vega.github.io/vega-lite/docs/config.html#view-config) (`20` by default)" }, "spec": { "anyOf": [ { "$ref": "#/definitions/LayerSpec" }, { "$ref": "#/definitions/UnitSpecWithFrame" } ], "description": "A specification of the view that gets repeated." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "$ref": "#/definitions/TitleParams" } ], "description": "Title for the plot." }, "transform": { "description": "An array of data transformations such as filter and new field calculation.", "items": { "$ref": "#/definitions/Transform" }, "type": "array" } }, "required": [ "repeat", "spec" ], "type": "object" }, "LayerSpec": { "additionalProperties": false, "description": "A full layered plot specification, which may contains `encoding` and `projection` properties that will be applied to underlying unit (single-view) specifications.", "properties": { "data": { "anyOf": [ { "$ref": "#/definitions/Data" }, { "type": "null" } ], "description": "An object describing the data source. Set to `null` to ignore the parent's data source. If no data is set, it is derived from the parent." }, "description": { "description": "Description of this mark for commenting purpose.", "type": "string" }, "encoding": { "$ref": "#/definitions/SharedEncoding", "description": "A shared key-value mapping between encoding channels and definition of fields in the underlying layers." }, "height": { "anyOf": [ { "type": "number" }, { "const": "container", "type": "string" }, { "$ref": "#/definitions/Step" } ], "description": "The height of a visualization.\n\n- For a plot with a continuous y-field, height should be a number.\n- For a plot with either a discrete y-field or no y-field, height can be either a number indicating a fixed height or an object in the form of `{step: number}` defining the height per discrete step. (No y-field is equivalent to having one discrete step.)\n- To enable responsive sizing on height, it should be set to `\"container\"`.\n\n__Default value:__ Based on `config.view.continuousHeight` for a plot with a continuous y-field and `config.view.discreteHeight` otherwise.\n\n__Note:__ For plots with [`row` and `column` channels](https://vega.github.io/vega-lite/docs/encoding.html#facet), this represents the height of a single view and the `\"container\"` option cannot be used.\n\n__See also:__ [`height`](https://vega.github.io/vega-lite/docs/size.html) documentation." }, "layer": { "description": "Layer or single view specifications to be layered.\n\n__Note__: Specifications inside `layer` cannot use `row` and `column` channels as layering facet specifications is not allowed. Instead, use the [facet operator](https://vega.github.io/vega-lite/docs/facet.html) and place a layer inside a facet.", "items": { "anyOf": [ { "$ref": "#/definitions/LayerSpec" }, { "$ref": "#/definitions/UnitSpec" } ] }, "type": "array" }, "name": { "description": "Name of the visualization for later reference.", "type": "string" }, "projection": { "$ref": "#/definitions/Projection", "description": "An object defining properties of the geographic projection shared by underlying layers." }, "resolve": { "$ref": "#/definitions/Resolve", "description": "Scale, axis, and legend resolutions for view composition specifications." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "$ref": "#/definitions/TitleParams" } ], "description": "Title for the plot." }, "transform": { "description": "An array of data transformations such as filter and new field calculation.", "items": { "$ref": "#/definitions/Transform" }, "type": "array" }, "view": { "$ref": "#/definitions/ViewBackground", "description": "An object defining the view background's fill and stroke.\n\n__Default value:__ none (transparent)" }, "width": { "anyOf": [ { "type": "number" }, { "const": "container", "type": "string" }, { "$ref": "#/definitions/Step" } ], "description": "The width of a visualization.\n\n- For a plot with a continuous x-field, width should be a number.\n- For a plot with either a discrete x-field or no x-field, width can be either a number indicating a fixed width or an object in the form of `{step: number}` defining the width per discrete step. (No x-field is equivalent to having one discrete step.)\n- To enable responsive sizing on width, it should be set to `\"container\"`.\n\n__Default value:__ Based on `config.view.continuousWidth` for a plot with a continuous x-field and `config.view.discreteWidth` otherwise.\n\n__Note:__ For plots with [`row` and `column` channels](https://vega.github.io/vega-lite/docs/encoding.html#facet), this represents the width of a single view and the `\"container\"` option cannot be used.\n\n__See also:__ [`width`](https://vega.github.io/vega-lite/docs/size.html) documentation." } }, "required": [ "layer" ], "type": "object" }, "LayoutAlign": { "enum": [ "all", "each", "none" ], "type": "string" }, "Legend": { "additionalProperties": false, "description": "Properties of a legend or boolean flag for determining whether to show it.", "properties": { "aria": { "anyOf": [ { "description": "A boolean flag indicating if [ARIA attributes](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) should be included (SVG output only). If `false`, the \"aria-hidden\" attribute will be set on the output SVG group, removing the legend from the ARIA accessibility tree.\n\n__Default value:__ `true`", "type": "boolean" }, { "$ref": "#/definitions/ExprRef" } ] }, "clipHeight": { "anyOf": [ { "description": "The height in pixels to clip symbol legend entries and limit their size.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "columnPadding": { "anyOf": [ { "description": "The horizontal padding in pixels between symbol legend entries.\n\n__Default value:__ `10`.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "columns": { "anyOf": [ { "description": "The number of columns in which to arrange symbol legend entries. A value of `0` or lower indicates a single row with one column per entry.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "cornerRadius": { "anyOf": [ { "description": "Corner radius for the full legend.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "description": { "anyOf": [ { "description": "A text description of this legend for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only). If the `aria` property is true, for SVG output the [\"aria-label\" attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute) will be set to this description. If the description is unspecified it will be automatically generated.", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "direction": { "$ref": "#/definitions/Orientation", "description": "The direction of the legend, one of `\"vertical\"` or `\"horizontal\"`.\n\n__Default value:__\n- For top-/bottom-`orient`ed legends, `\"horizontal\"`\n- For left-/right-`orient`ed legends, `\"vertical\"`\n- For top/bottom-left/right-`orient`ed legends, `\"horizontal\"` for gradient legends and `\"vertical\"` for symbol legends." }, "fillColor": { "anyOf": [ { "anyOf": [ { "type": "null" }, { "$ref": "#/definitions/Color" } ], "description": "Background fill color for the full legend." }, { "$ref": "#/definitions/ExprRef" } ] }, "format": { "anyOf": [ { "type": "string" }, { "$ref": "#/definitions/Dict" } ], "description": "When used with the default `\"number\"` and `\"time\"` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks.\n\n- If the format type is `\"number\"` (e.g., for quantitative fields), this is D3's [number format pattern](https://github.com/d3/d3-format#locale_format).\n- If the format type is `\"time\"` (e.g., for temporal fields), this is D3's [time format pattern](https://github.com/d3/d3-time-format#locale_format).\n\nSee the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for more examples.\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." }, "formatType": { "description": "The format type for labels. One of `\"number\"`, `\"time\"`, or a [registered custom format type](https://vega.github.io/vega-lite/docs/config.html#custom-format-type).\n\n__Default value:__\n- `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`.\n- `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", "type": "string" }, "gradientLength": { "anyOf": [ { "description": "The length in pixels of the primary axis of a color gradient. This value corresponds to the height of a vertical gradient or the width of a horizontal gradient.\n\n__Default value:__ `200`.", "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "gradientOpacity": { "anyOf": [ { "description": "Opacity of the color gradient.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "gradientStrokeColor": { "anyOf": [ { "anyOf": [ { "type": "null" }, { "$ref": "#/definitions/Color" } ], "description": "The color of the gradient stroke, can be in hex color code or regular color name.\n\n__Default value:__ `\"lightGray\"`." }, { "$ref": "#/definitions/ExprRef" } ] }, "gradientStrokeWidth": { "anyOf": [ { "description": "The width of the gradient stroke, in pixels.\n\n__Default value:__ `0`.", "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "gradientThickness": { "anyOf": [ { "description": "The thickness in pixels of the color gradient. This value corresponds to the width of a vertical gradient or the height of a horizontal gradient.\n\n__Default value:__ `16`.", "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "gridAlign": { "anyOf": [ { "$ref": "#/definitions/LayoutAlign", "description": "The alignment to apply to symbol legends rows and columns. The supported string values are `\"all\"`, `\"each\"` (the default), and `none`. For more information, see the [grid layout documentation](https://vega.github.io/vega/docs/layout).\n\n__Default value:__ `\"each\"`." }, { "$ref": "#/definitions/ExprRef" } ] }, "labelAlign": { "anyOf": [ { "$ref": "#/definitions/Align", "description": "The alignment of the legend label, can be left, center, or right." }, { "$ref": "#/definitions/ExprRef" } ] }, "labelBaseline": { "anyOf": [ { "$ref": "#/definitions/TextBaseline", "description": "The position of the baseline of legend label, can be `\"top\"`, `\"middle\"`, `\"bottom\"`, or `\"alphabetic\"`.\n\n__Default value:__ `\"middle\"`." }, { "$ref": "#/definitions/ExprRef" } ] }, "labelColor": { "anyOf": [ { "anyOf": [ { "type": "null" }, { "$ref": "#/definitions/Color" } ], "description": "The color of the legend label, can be in hex color code or regular color name." }, { "$ref": "#/definitions/ExprRef" } ] }, "labelExpr": { "description": "[Vega expression](https://vega.github.io/vega/docs/expressions/) for customizing labels.\n\n__Note:__ The label text and value can be assessed via the `label` and `value` properties of the legend's backing `datum` object.", "type": "string" }, "labelFont": { "anyOf": [ { "description": "The font of the legend label.", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "labelFontSize": { "anyOf": [ { "description": "The font size of legend label.\n\n__Default value:__ `10`.", "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "labelFontStyle": { "anyOf": [ { "$ref": "#/definitions/FontStyle", "description": "The font style of legend label." }, { "$ref": "#/definitions/ExprRef" } ] }, "labelFontWeight": { "anyOf": [ { "$ref": "#/definitions/FontWeight", "description": "The font weight of legend label." }, { "$ref": "#/definitions/ExprRef" } ] }, "labelLimit": { "anyOf": [ { "description": "Maximum allowed pixel width of legend tick labels.\n\n__Default value:__ `160`.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "labelOffset": { "anyOf": [ { "description": "The offset of the legend label.\n\n__Default value:__ `4`.", "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "labelOpacity": { "anyOf": [ { "description": "Opacity of labels.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "labelOverlap": { "anyOf": [ { "$ref": "#/definitions/LabelOverlap", "description": "The strategy to use for resolving overlap of labels in gradient legends. If `false`, no overlap reduction is attempted. If set to `true` (default) or `\"parity\"`, a strategy of removing every other label is used. If set to `\"greedy\"`, a linear scan of the labels is performed, removing any label that overlaps with the last visible label (this often works better for log-scaled axes).\n\n__Default value:__ `true`." }, { "$ref": "#/definitions/ExprRef" } ] }, "labelPadding": { "anyOf": [ { "description": "Padding in pixels between the legend and legend labels.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "labelSeparation": { "anyOf": [ { "description": "The minimum separation that must be between label bounding boxes for them to be considered non-overlapping (default `0`). This property is ignored if *labelOverlap* resolution is not enabled.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "legendX": { "anyOf": [ { "description": "Custom x-position for legend with orient \"none\".", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "legendY": { "anyOf": [ { "description": "Custom y-position for legend with orient \"none\".", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "offset": { "anyOf": [ { "description": "The offset in pixels by which to displace the legend from the data rectangle and axes.\n\n__Default value:__ `18`.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "orient": { "$ref": "#/definitions/LegendOrient", "description": "The orientation of the legend, which determines how the legend is positioned within the scene. One of `\"left\"`, `\"right\"`, `\"top\"`, `\"bottom\"`, `\"top-left\"`, `\"top-right\"`, `\"bottom-left\"`, `\"bottom-right\"`, `\"none\"`.\n\n__Default value:__ `\"right\"`" }, "padding": { "anyOf": [ { "description": "The padding between the border and content of the legend group.\n\n__Default value:__ `0`.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "rowPadding": { "anyOf": [ { "description": "The vertical padding in pixels between symbol legend entries.\n\n__Default value:__ `2`.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeColor": { "anyOf": [ { "anyOf": [ { "type": "null" }, { "$ref": "#/definitions/Color" } ], "description": "Border stroke color for the full legend." }, { "$ref": "#/definitions/ExprRef" } ] }, "symbolDash": { "anyOf": [ { "description": "An array of alternating [stroke, space] lengths for dashed symbol strokes.", "items": { "type": "number" }, "type": "array" }, { "$ref": "#/definitions/ExprRef" } ] }, "symbolDashOffset": { "anyOf": [ { "description": "The pixel offset at which to start drawing with the symbol stroke dash array.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "symbolFillColor": { "anyOf": [ { "anyOf": [ { "type": "null" }, { "$ref": "#/definitions/Color" } ], "description": "The color of the legend symbol," }, { "$ref": "#/definitions/ExprRef" } ] }, "symbolLimit": { "anyOf": [ { "description": "The maximum number of allowed entries for a symbol legend. Additional entries will be dropped.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "symbolOffset": { "anyOf": [ { "description": "Horizontal pixel offset for legend symbols.\n\n__Default value:__ `0`.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "symbolOpacity": { "anyOf": [ { "description": "Opacity of the legend symbols.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "symbolSize": { "anyOf": [ { "description": "The size of the legend symbol, in pixels.\n\n__Default value:__ `100`.", "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "symbolStrokeColor": { "anyOf": [ { "anyOf": [ { "type": "null" }, { "$ref": "#/definitions/Color" } ], "description": "Stroke color for legend symbols." }, { "$ref": "#/definitions/ExprRef" } ] }, "symbolStrokeWidth": { "anyOf": [ { "description": "The width of the symbol's stroke.\n\n__Default value:__ `1.5`.", "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "symbolType": { "anyOf": [ { "$ref": "#/definitions/SymbolShape", "description": "The symbol shape. One of the plotting shapes `circle` (default), `square`, `cross`, `diamond`, `triangle-up`, `triangle-down`, `triangle-right`, or `triangle-left`, the line symbol `stroke`, or one of the centered directional shapes `arrow`, `wedge`, or `triangle`. Alternatively, a custom [SVG path string](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths) can be provided. For correct sizing, custom shape paths should be defined within a square bounding box with coordinates ranging from -1 to 1 along both the x and y dimensions.\n\n__Default value:__ `\"circle\"`." }, { "$ref": "#/definitions/ExprRef" } ] }, "tickCount": { "anyOf": [ { "$ref": "#/definitions/TickCount", "description": "The desired number of tick values for quantitative legends." }, { "$ref": "#/definitions/ExprRef" } ] }, "tickMinStep": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The minimum desired step between legend ticks, in terms of scale domain values. For example, a value of `1` indicates that ticks should not be less than 1 unit apart. If `tickMinStep` is specified, the `tickCount` value will be adjusted, if necessary, to enforce the minimum step value.\n\n__Default value__: `undefined`" }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "titleAlign": { "anyOf": [ { "$ref": "#/definitions/Align", "description": "Horizontal text alignment for legend titles.\n\n__Default value:__ `\"left\"`." }, { "$ref": "#/definitions/ExprRef" } ] }, "titleAnchor": { "anyOf": [ { "$ref": "#/definitions/TitleAnchor", "description": "Text anchor position for placing legend titles." }, { "$ref": "#/definitions/ExprRef" } ] }, "titleBaseline": { "anyOf": [ { "$ref": "#/definitions/TextBaseline", "description": "Vertical text baseline for legend titles. One of `\"alphabetic\"` (default), `\"top\"`, `\"middle\"`, `\"bottom\"`, `\"line-top\"`, or `\"line-bottom\"`. The `\"line-top\"` and `\"line-bottom\"` values operate similarly to `\"top\"` and `\"bottom\"`, but are calculated relative to the *lineHeight* rather than *fontSize* alone.\n\n__Default value:__ `\"top\"`." }, { "$ref": "#/definitions/ExprRef" } ] }, "titleColor": { "anyOf": [ { "anyOf": [ { "type": "null" }, { "$ref": "#/definitions/Color" } ], "description": "The color of the legend title, can be in hex color code or regular color name." }, { "$ref": "#/definitions/ExprRef" } ] }, "titleFont": { "anyOf": [ { "description": "The font of the legend title.", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "titleFontSize": { "anyOf": [ { "description": "The font size of the legend title.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "titleFontStyle": { "anyOf": [ { "$ref": "#/definitions/FontStyle", "description": "The font style of the legend title." }, { "$ref": "#/definitions/ExprRef" } ] }, "titleFontWeight": { "anyOf": [ { "$ref": "#/definitions/FontWeight", "description": "The font weight of the legend title. This can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." }, { "$ref": "#/definitions/ExprRef" } ] }, "titleLimit": { "anyOf": [ { "description": "Maximum allowed pixel width of legend titles.\n\n__Default value:__ `180`.", "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "titleLineHeight": { "anyOf": [ { "description": "Line height in pixels for multi-line title text or title text with `\"line-top\"` or `\"line-bottom\"` baseline.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "titleOpacity": { "anyOf": [ { "description": "Opacity of the legend title.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "titleOrient": { "anyOf": [ { "$ref": "#/definitions/Orient", "description": "Orientation of the legend title." }, { "$ref": "#/definitions/ExprRef" } ] }, "titlePadding": { "anyOf": [ { "description": "The padding, in pixels, between title and legend.\n\n__Default value:__ `5`.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "type": { "description": "The type of the legend. Use `\"symbol\"` to create a discrete legend and `\"gradient\"` for a continuous color gradient.\n\n__Default value:__ `\"gradient\"` for non-binned quantitative fields and temporal fields; `\"symbol\"` otherwise.", "enum": [ "symbol", "gradient" ], "type": "string" }, "values": { "anyOf": [ { "items": { "type": "number" }, "type": "array" }, { "items": { "type": "string" }, "type": "array" }, { "items": { "type": "boolean" }, "type": "array" }, { "items": { "$ref": "#/definitions/DateTime" }, "type": "array" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Explicitly set the visible legend values." }, "zindex": { "description": "A non-negative integer indicating the z-index of the legend. If zindex is 0, legend should be drawn behind all chart elements. To put them in front, use zindex = 1.", "minimum": 0, "type": "number" } }, "type": "object" }, "LegendBinding": { "anyOf": [ { "const": "legend", "type": "string" }, { "$ref": "#/definitions/LegendStreamBinding" } ] }, "LegendConfig": { "additionalProperties": false, "properties": { "aria": { "anyOf": [ { "description": "A boolean flag indicating if [ARIA attributes](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) should be included (SVG output only). If `false`, the \"aria-hidden\" attribute will be set on the output SVG group, removing the legend from the ARIA accessibility tree.\n\n__Default value:__ `true`", "type": "boolean" }, { "$ref": "#/definitions/ExprRef" } ] }, "clipHeight": { "anyOf": [ { "description": "The height in pixels to clip symbol legend entries and limit their size.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "columnPadding": { "anyOf": [ { "description": "The horizontal padding in pixels between symbol legend entries.\n\n__Default value:__ `10`.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "columns": { "anyOf": [ { "description": "The number of columns in which to arrange symbol legend entries. A value of `0` or lower indicates a single row with one column per entry.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "cornerRadius": { "anyOf": [ { "description": "Corner radius for the full legend.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "description": { "anyOf": [ { "description": "A text description of this legend for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only). If the `aria` property is true, for SVG output the [\"aria-label\" attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute) will be set to this description. If the description is unspecified it will be automatically generated.", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "direction": { "$ref": "#/definitions/Orientation", "description": "The direction of the legend, one of `\"vertical\"` or `\"horizontal\"`.\n\n__Default value:__\n- For top-/bottom-`orient`ed legends, `\"horizontal\"`\n- For left-/right-`orient`ed legends, `\"vertical\"`\n- For top/bottom-left/right-`orient`ed legends, `\"horizontal\"` for gradient legends and `\"vertical\"` for symbol legends." }, "disable": { "description": "Disable legend by default", "type": "boolean" }, "fillColor": { "anyOf": [ { "anyOf": [ { "type": "null" }, { "$ref": "#/definitions/Color" } ], "description": "Background fill color for the full legend." }, { "$ref": "#/definitions/ExprRef" } ] }, "gradientDirection": { "anyOf": [ { "$ref": "#/definitions/Orientation", "description": "The default direction (`\"horizontal\"` or `\"vertical\"`) for gradient legends.\n\n__Default value:__ `\"vertical\"`." }, { "$ref": "#/definitions/ExprRef" } ] }, "gradientHorizontalMaxLength": { "description": "Max legend length for a horizontal gradient when `config.legend.gradientLength` is undefined.\n\n__Default value:__ `200`", "type": "number" }, "gradientHorizontalMinLength": { "description": "Min legend length for a horizontal gradient when `config.legend.gradientLength` is undefined.\n\n__Default value:__ `100`", "type": "number" }, "gradientLabelLimit": { "anyOf": [ { "description": "The maximum allowed length in pixels of color ramp gradient labels.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "gradientLabelOffset": { "anyOf": [ { "description": "Vertical offset in pixels for color ramp gradient labels.\n\n__Default value:__ `2`.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "gradientLength": { "anyOf": [ { "description": "The length in pixels of the primary axis of a color gradient. This value corresponds to the height of a vertical gradient or the width of a horizontal gradient.\n\n__Default value:__ `200`.", "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "gradientOpacity": { "anyOf": [ { "description": "Opacity of the color gradient.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "gradientStrokeColor": { "anyOf": [ { "anyOf": [ { "type": "null" }, { "$ref": "#/definitions/Color" } ], "description": "The color of the gradient stroke, can be in hex color code or regular color name.\n\n__Default value:__ `\"lightGray\"`." }, { "$ref": "#/definitions/ExprRef" } ] }, "gradientStrokeWidth": { "anyOf": [ { "description": "The width of the gradient stroke, in pixels.\n\n__Default value:__ `0`.", "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "gradientThickness": { "anyOf": [ { "description": "The thickness in pixels of the color gradient. This value corresponds to the width of a vertical gradient or the height of a horizontal gradient.\n\n__Default value:__ `16`.", "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "gradientVerticalMaxLength": { "description": "Max legend length for a vertical gradient when `config.legend.gradientLength` is undefined.\n\n__Default value:__ `200`", "type": "number" }, "gradientVerticalMinLength": { "description": "Min legend length for a vertical gradient when `config.legend.gradientLength` is undefined.\n\n__Default value:__ `100`", "type": "number" }, "gridAlign": { "anyOf": [ { "$ref": "#/definitions/LayoutAlign", "description": "The alignment to apply to symbol legends rows and columns. The supported string values are `\"all\"`, `\"each\"` (the default), and `none`. For more information, see the [grid layout documentation](https://vega.github.io/vega/docs/layout).\n\n__Default value:__ `\"each\"`." }, { "$ref": "#/definitions/ExprRef" } ] }, "labelAlign": { "anyOf": [ { "$ref": "#/definitions/Align", "description": "The alignment of the legend label, can be left, center, or right." }, { "$ref": "#/definitions/ExprRef" } ] }, "labelBaseline": { "anyOf": [ { "$ref": "#/definitions/TextBaseline", "description": "The position of the baseline of legend label, can be `\"top\"`, `\"middle\"`, `\"bottom\"`, or `\"alphabetic\"`.\n\n__Default value:__ `\"middle\"`." }, { "$ref": "#/definitions/ExprRef" } ] }, "labelColor": { "anyOf": [ { "anyOf": [ { "type": "null" }, { "$ref": "#/definitions/Color" } ], "description": "The color of the legend label, can be in hex color code or regular color name." }, { "$ref": "#/definitions/ExprRef" } ] }, "labelFont": { "anyOf": [ { "description": "The font of the legend label.", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "labelFontSize": { "anyOf": [ { "description": "The font size of legend label.\n\n__Default value:__ `10`.", "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "labelFontStyle": { "anyOf": [ { "$ref": "#/definitions/FontStyle", "description": "The font style of legend label." }, { "$ref": "#/definitions/ExprRef" } ] }, "labelFontWeight": { "anyOf": [ { "$ref": "#/definitions/FontWeight", "description": "The font weight of legend label." }, { "$ref": "#/definitions/ExprRef" } ] }, "labelLimit": { "anyOf": [ { "description": "Maximum allowed pixel width of legend tick labels.\n\n__Default value:__ `160`.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "labelOffset": { "anyOf": [ { "description": "The offset of the legend label.\n\n__Default value:__ `4`.", "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "labelOpacity": { "anyOf": [ { "description": "Opacity of labels.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "labelOverlap": { "anyOf": [ { "$ref": "#/definitions/LabelOverlap" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The strategy to use for resolving overlap of labels in gradient legends. If `false`, no overlap reduction is attempted. If set to `true` or `\"parity\"`, a strategy of removing every other label is used. If set to `\"greedy\"`, a linear scan of the labels is performed, removing any label that overlaps with the last visible label (this often works better for log-scaled axes).\n\n__Default value:__ `\"greedy\"` for `log scales otherwise `true`." }, "labelPadding": { "anyOf": [ { "description": "Padding in pixels between the legend and legend labels.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "labelSeparation": { "anyOf": [ { "description": "The minimum separation that must be between label bounding boxes for them to be considered non-overlapping (default `0`). This property is ignored if *labelOverlap* resolution is not enabled.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "layout": { "$ref": "#/definitions/ExprRef" }, "legendX": { "anyOf": [ { "description": "Custom x-position for legend with orient \"none\".", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "legendY": { "anyOf": [ { "description": "Custom y-position for legend with orient \"none\".", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "offset": { "anyOf": [ { "description": "The offset in pixels by which to displace the legend from the data rectangle and axes.\n\n__Default value:__ `18`.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "orient": { "$ref": "#/definitions/LegendOrient", "description": "The orientation of the legend, which determines how the legend is positioned within the scene. One of `\"left\"`, `\"right\"`, `\"top\"`, `\"bottom\"`, `\"top-left\"`, `\"top-right\"`, `\"bottom-left\"`, `\"bottom-right\"`, `\"none\"`.\n\n__Default value:__ `\"right\"`" }, "padding": { "anyOf": [ { "description": "The padding between the border and content of the legend group.\n\n__Default value:__ `0`.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "rowPadding": { "anyOf": [ { "description": "The vertical padding in pixels between symbol legend entries.\n\n__Default value:__ `2`.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeColor": { "anyOf": [ { "anyOf": [ { "type": "null" }, { "$ref": "#/definitions/Color" } ], "description": "Border stroke color for the full legend." }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeDash": { "anyOf": [ { "description": "Border stroke dash pattern for the full legend.", "items": { "type": "number" }, "type": "array" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeWidth": { "anyOf": [ { "description": "Border stroke width for the full legend.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "symbolBaseFillColor": { "anyOf": [ { "anyOf": [ { "type": "null" }, { "$ref": "#/definitions/Color" } ], "description": "Default fill color for legend symbols. Only applied if there is no `\"fill\"` scale color encoding for the legend.\n\n__Default value:__ `\"transparent\"`." }, { "$ref": "#/definitions/ExprRef" } ] }, "symbolBaseStrokeColor": { "anyOf": [ { "anyOf": [ { "type": "null" }, { "$ref": "#/definitions/Color" } ], "description": "Default stroke color for legend symbols. Only applied if there is no `\"fill\"` scale color encoding for the legend.\n\n__Default value:__ `\"gray\"`." }, { "$ref": "#/definitions/ExprRef" } ] }, "symbolDash": { "anyOf": [ { "description": "An array of alternating [stroke, space] lengths for dashed symbol strokes.", "items": { "type": "number" }, "type": "array" }, { "$ref": "#/definitions/ExprRef" } ] }, "symbolDashOffset": { "anyOf": [ { "description": "The pixel offset at which to start drawing with the symbol stroke dash array.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "symbolDirection": { "anyOf": [ { "$ref": "#/definitions/Orientation", "description": "The default direction (`\"horizontal\"` or `\"vertical\"`) for symbol legends.\n\n__Default value:__ `\"vertical\"`." }, { "$ref": "#/definitions/ExprRef" } ] }, "symbolFillColor": { "anyOf": [ { "anyOf": [ { "type": "null" }, { "$ref": "#/definitions/Color" } ], "description": "The color of the legend symbol," }, { "$ref": "#/definitions/ExprRef" } ] }, "symbolLimit": { "anyOf": [ { "description": "The maximum number of allowed entries for a symbol legend. Additional entries will be dropped.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "symbolOffset": { "anyOf": [ { "description": "Horizontal pixel offset for legend symbols.\n\n__Default value:__ `0`.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "symbolOpacity": { "anyOf": [ { "description": "Opacity of the legend symbols.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "symbolSize": { "anyOf": [ { "description": "The size of the legend symbol, in pixels.\n\n__Default value:__ `100`.", "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "symbolStrokeColor": { "anyOf": [ { "anyOf": [ { "type": "null" }, { "$ref": "#/definitions/Color" } ], "description": "Stroke color for legend symbols." }, { "$ref": "#/definitions/ExprRef" } ] }, "symbolStrokeWidth": { "anyOf": [ { "description": "The width of the symbol's stroke.\n\n__Default value:__ `1.5`.", "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "symbolType": { "anyOf": [ { "$ref": "#/definitions/SymbolShape", "description": "The symbol shape. One of the plotting shapes `circle` (default), `square`, `cross`, `diamond`, `triangle-up`, `triangle-down`, `triangle-right`, or `triangle-left`, the line symbol `stroke`, or one of the centered directional shapes `arrow`, `wedge`, or `triangle`. Alternatively, a custom [SVG path string](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths) can be provided. For correct sizing, custom shape paths should be defined within a square bounding box with coordinates ranging from -1 to 1 along both the x and y dimensions.\n\n__Default value:__ `\"circle\"`." }, { "$ref": "#/definitions/ExprRef" } ] }, "tickCount": { "anyOf": [ { "$ref": "#/definitions/TickCount", "description": "The desired number of tick values for quantitative legends." }, { "$ref": "#/definitions/ExprRef" } ] }, "title": { "description": "Set to null to disable title for the axis, legend, or header.", "type": "null" }, "titleAlign": { "anyOf": [ { "$ref": "#/definitions/Align", "description": "Horizontal text alignment for legend titles.\n\n__Default value:__ `\"left\"`." }, { "$ref": "#/definitions/ExprRef" } ] }, "titleAnchor": { "anyOf": [ { "$ref": "#/definitions/TitleAnchor", "description": "Text anchor position for placing legend titles." }, { "$ref": "#/definitions/ExprRef" } ] }, "titleBaseline": { "anyOf": [ { "$ref": "#/definitions/TextBaseline", "description": "Vertical text baseline for legend titles. One of `\"alphabetic\"` (default), `\"top\"`, `\"middle\"`, `\"bottom\"`, `\"line-top\"`, or `\"line-bottom\"`. The `\"line-top\"` and `\"line-bottom\"` values operate similarly to `\"top\"` and `\"bottom\"`, but are calculated relative to the *lineHeight* rather than *fontSize* alone.\n\n__Default value:__ `\"top\"`." }, { "$ref": "#/definitions/ExprRef" } ] }, "titleColor": { "anyOf": [ { "anyOf": [ { "type": "null" }, { "$ref": "#/definitions/Color" } ], "description": "The color of the legend title, can be in hex color code or regular color name." }, { "$ref": "#/definitions/ExprRef" } ] }, "titleFont": { "anyOf": [ { "description": "The font of the legend title.", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "titleFontSize": { "anyOf": [ { "description": "The font size of the legend title.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "titleFontStyle": { "anyOf": [ { "$ref": "#/definitions/FontStyle", "description": "The font style of the legend title." }, { "$ref": "#/definitions/ExprRef" } ] }, "titleFontWeight": { "anyOf": [ { "$ref": "#/definitions/FontWeight", "description": "The font weight of the legend title. This can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." }, { "$ref": "#/definitions/ExprRef" } ] }, "titleLimit": { "anyOf": [ { "description": "Maximum allowed pixel width of legend titles.\n\n__Default value:__ `180`.", "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "titleLineHeight": { "anyOf": [ { "description": "Line height in pixels for multi-line title text or title text with `\"line-top\"` or `\"line-bottom\"` baseline.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "titleOpacity": { "anyOf": [ { "description": "Opacity of the legend title.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "titleOrient": { "anyOf": [ { "$ref": "#/definitions/Orient", "description": "Orientation of the legend title." }, { "$ref": "#/definitions/ExprRef" } ] }, "titlePadding": { "anyOf": [ { "description": "The padding, in pixels, between title and legend.\n\n__Default value:__ `5`.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "unselectedOpacity": { "description": "The opacity of unselected legend entries.\n\n__Default value:__ 0.35.", "type": "number" }, "zindex": { "anyOf": [ { "description": "The integer z-index indicating the layering of the legend group relative to other axis, mark, and legend groups.", "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] } }, "type": "object" }, "LegendOrient": { "enum": [ "none", "left", "right", "top", "bottom", "top-left", "top-right", "bottom-left", "bottom-right" ], "type": "string" }, "LegendResolveMap": { "additionalProperties": false, "properties": { "angle": { "$ref": "#/definitions/ResolveMode" }, "color": { "$ref": "#/definitions/ResolveMode" }, "fill": { "$ref": "#/definitions/ResolveMode" }, "fillOpacity": { "$ref": "#/definitions/ResolveMode" }, "opacity": { "$ref": "#/definitions/ResolveMode" }, "shape": { "$ref": "#/definitions/ResolveMode" }, "size": { "$ref": "#/definitions/ResolveMode" }, "stroke": { "$ref": "#/definitions/ResolveMode" }, "strokeDash": { "$ref": "#/definitions/ResolveMode" }, "strokeOpacity": { "$ref": "#/definitions/ResolveMode" }, "strokeWidth": { "$ref": "#/definitions/ResolveMode" }, "time": { "$ref": "#/definitions/ResolveMode" } }, "type": "object" }, "LegendStreamBinding": { "additionalProperties": false, "properties": { "legend": { "anyOf": [ { "type": "string" }, { "$ref": "#/definitions/Stream" } ] } }, "required": [ "legend" ], "type": "object" }, "LineConfig": { "additionalProperties": false, "properties": { "align": { "anyOf": [ { "$ref": "#/definitions/Align" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of `\"left\"`, `\"right\"`, `\"center\"`.\n\n__Note:__ Expression reference is *not* supported for range marks." }, "angle": { "anyOf": [ { "description": "The rotation angle of the text, in degrees.", "maximum": 360, "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "aria": { "anyOf": [ { "description": "A boolean flag indicating if [ARIA attributes](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) should be included (SVG output only). If `false`, the \"aria-hidden\" attribute will be set on the output SVG element, removing the mark item from the ARIA accessibility tree.", "type": "boolean" }, { "$ref": "#/definitions/ExprRef" } ] }, "ariaRole": { "anyOf": [ { "description": "Sets the type of user interface element of the mark item for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only). If specified, this property determines the \"role\" attribute. Warning: this property is experimental and may be changed in the future.", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "ariaRoleDescription": { "anyOf": [ { "description": "A human-readable, author-localized description for the role of the mark item for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only). If specified, this property determines the \"aria-roledescription\" attribute. Warning: this property is experimental and may be changed in the future.", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "aspect": { "anyOf": [ { "description": "Whether to keep aspect ratio of image marks.", "type": "boolean" }, { "$ref": "#/definitions/ExprRef" } ] }, "baseline": { "anyOf": [ { "$ref": "#/definitions/TextBaseline" }, { "$ref": "#/definitions/ExprRef" } ], "description": "For text marks, the vertical text baseline. One of `\"alphabetic\"` (default), `\"top\"`, `\"middle\"`, `\"bottom\"`, `\"line-top\"`, `\"line-bottom\"`, or an expression reference that provides one of the valid values. The `\"line-top\"` and `\"line-bottom\"` values operate similarly to `\"top\"` and `\"bottom\"`, but are calculated relative to the `lineHeight` rather than `fontSize` alone.\n\nFor range marks, the vertical alignment of the marks. One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Note:__ Expression reference is *not* supported for range marks." }, "blend": { "anyOf": [ { "$ref": "#/definitions/Blend", "description": "The color blend mode for drawing an item on its current background. Any valid [CSS mix-blend-mode](https://developer.mozilla.org/en-US/docs/Web/CSS/mix-blend-mode) value can be used.\n\n__Default value: `\"source-over\"`" }, { "$ref": "#/definitions/ExprRef" } ] }, "color": { "anyOf": [ { "$ref": "#/definitions/Color" }, { "$ref": "#/definitions/Gradient" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Default color.\n\n__Default value:__ `\"#4682b4\"`\n\n__Note:__\n- This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).\n- The `fill` and `stroke` properties have higher precedence than `color` and will override `color`." }, "cornerRadius": { "anyOf": [ { "description": "The radius in pixels of rounded rectangles or arcs' corners.\n\n__Default value:__ `0`", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "cornerRadiusBottomLeft": { "anyOf": [ { "description": "The radius in pixels of rounded rectangles' bottom left corner.\n\n__Default value:__ `0`", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "cornerRadiusBottomRight": { "anyOf": [ { "description": "The radius in pixels of rounded rectangles' bottom right corner.\n\n__Default value:__ `0`", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "cornerRadiusTopLeft": { "anyOf": [ { "description": "The radius in pixels of rounded rectangles' top right corner.\n\n__Default value:__ `0`", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "cornerRadiusTopRight": { "anyOf": [ { "description": "The radius in pixels of rounded rectangles' top left corner.\n\n__Default value:__ `0`", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "cursor": { "anyOf": [ { "$ref": "#/definitions/Cursor", "description": "The mouse cursor used over the mark. Any valid [CSS cursor type](https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values) can be used." }, { "$ref": "#/definitions/ExprRef" } ] }, "description": { "anyOf": [ { "description": "A text description of the mark item for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only). If specified, this property determines the [\"aria-label\" attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute).", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "dir": { "anyOf": [ { "$ref": "#/definitions/TextDirection", "description": "The direction of the text. One of `\"ltr\"` (left-to-right) or `\"rtl\"` (right-to-left). This property determines on which side is truncated in response to the limit parameter.\n\n__Default value:__ `\"ltr\"`" }, { "$ref": "#/definitions/ExprRef" } ] }, "dx": { "anyOf": [ { "description": "The horizontal offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "dy": { "anyOf": [ { "description": "The vertical offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "ellipsis": { "anyOf": [ { "description": "The ellipsis string for text truncated in response to the limit parameter.\n\n__Default value:__ `\"…\"`", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "endAngle": { "anyOf": [ { "description": "The end angle in radians for arc marks. A value of `0` indicates up (north), increasing values proceed clockwise.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "fill": { "anyOf": [ { "$ref": "#/definitions/Color" }, { "$ref": "#/definitions/Gradient" }, { "type": "null" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Default fill color. This property has higher precedence than `config.color`. Set to `null` to remove fill.\n\n__Default value:__ (None)" }, "fillOpacity": { "anyOf": [ { "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", "maximum": 1, "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "filled": { "description": "Whether the mark's color should be used as fill color instead of stroke color.\n\n__Default value:__ `false` for all `point`, `line`, and `rule` marks as well as `geoshape` marks for [`graticule`](https://vega.github.io/vega-lite/docs/data.html#graticule) data sources; otherwise, `true`.\n\n__Note:__ This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).", "type": "boolean" }, "font": { "anyOf": [ { "description": "The typeface to set the text in (e.g., `\"Helvetica Neue\"`).", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "fontSize": { "anyOf": [ { "description": "The font size, in pixels.\n\n__Default value:__ `11`", "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "fontStyle": { "anyOf": [ { "$ref": "#/definitions/FontStyle", "description": "The font style (e.g., `\"italic\"`)." }, { "$ref": "#/definitions/ExprRef" } ] }, "fontWeight": { "anyOf": [ { "$ref": "#/definitions/FontWeight", "description": "The font weight. This can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." }, { "$ref": "#/definitions/ExprRef" } ] }, "height": { "anyOf": [ { "description": "Height of the marks.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "href": { "anyOf": [ { "$ref": "#/definitions/URI", "description": "A URL to load upon mouse click. If defined, the mark acts as a hyperlink." }, { "$ref": "#/definitions/ExprRef" } ] }, "innerRadius": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The inner radius in pixels of arc marks. `innerRadius` is an alias for `radius2`.\n\n__Default value:__ `0`", "minimum": 0 }, "interpolate": { "anyOf": [ { "$ref": "#/definitions/Interpolate", "description": "The line interpolation method to use for line and area marks. One of the following:\n- `\"linear\"`: piecewise linear segments, as in a polyline.\n- `\"linear-closed\"`: close the linear segments to form a polygon.\n- `\"step\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"step-before\"`: alternate between vertical and horizontal segments, as in a step function.\n- `\"step-after\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"basis\"`: a B-spline, with control point duplication on the ends.\n- `\"basis-open\"`: an open B-spline; may not intersect the start or end.\n- `\"basis-closed\"`: a closed B-spline, as in a loop.\n- `\"cardinal\"`: a Cardinal spline, with control point duplication on the ends.\n- `\"cardinal-open\"`: an open Cardinal spline; may not intersect the start or end, but will intersect other control points.\n- `\"cardinal-closed\"`: a closed Cardinal spline, as in a loop.\n- `\"bundle\"`: equivalent to basis, except the tension parameter is used to straighten the spline.\n- `\"monotone\"`: cubic interpolation that preserves monotonicity in y." }, { "$ref": "#/definitions/ExprRef" } ] }, "invalid": { "anyOf": [ { "$ref": "#/definitions/MarkInvalidDataMode" }, { "type": "null" } ], "description": "Invalid data mode, which defines how the marks and corresponding scales should represent invalid values (`null` and `NaN` in continuous scales *without* defined output for invalid values).\n\n- `\"filter\"` — *Exclude* all invalid values from the visualization's *marks* and *scales*. For path marks (for line, area, trail), this option will create paths that connect valid points, as if the data rows with invalid values do not exist.\n\n- `\"break-paths-filter-domains\"` — Break path marks (for line, area, trail) at invalid values. For non-path marks, this is equivalent to `\"filter\"`. All *scale* domains will *exclude* these filtered data points.\n\n- `\"break-paths-show-domains\"` — Break paths (for line, area, trail) at invalid values. Hide invalid values for non-path marks. All *scale* domains will *include* these filtered data points (for both path and non-path marks).\n\n- `\"show\"` or `null` — Show all data points in the marks and scale domains. Each scale will use the output for invalid values defined in `config.scale.invalid` or, if unspecified, by default invalid values will produce the same visual values as zero (if the scale includes zero) or the minimum value (if the scale does not include zero).\n\n- `\"break-paths-show-path-domains\"` (default) — This is equivalent to `\"break-paths-show-domains\"` for path-based marks (line/area/trail) and `\"filter\"` for non-path marks.\n\n__Note__: If any channel's scale has an output for invalid values defined in `config.scale.invalid`, all values for the scales will be considered \"valid\" since they can produce a reasonable output for the scales. Thus, fields for such channels will not be filtered and will not cause path breaks." }, "limit": { "anyOf": [ { "description": "The maximum length of the text mark in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.\n\n__Default value:__ `0` -- indicating no limit", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "lineBreak": { "anyOf": [ { "description": "A delimiter, such as a newline character, upon which to break text strings into multiple lines. This property is ignored if the text is array-valued.", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "lineHeight": { "anyOf": [ { "description": "The line height in pixels (the spacing between subsequent lines of text) for multi-line text marks.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "opacity": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The overall opacity (value between [0,1]).\n\n__Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or `square` marks or layered `bar` charts and `1` otherwise.", "maximum": 1, "minimum": 0 }, "order": { "description": "For line and trail marks, this `order` property can be set to `null` or `false` to make the lines use the original order in the data sources.", "type": [ "null", "boolean" ] }, "orient": { "$ref": "#/definitions/Orientation", "description": "The orientation of a non-stacked bar, tick, area, and line charts. The value is either horizontal (default) or vertical.\n- For bar, rule and tick, this determines whether the size of the bar and tick should be applied to x or y dimension.\n- For area, this property determines the orient property of the Vega output.\n- For line and trail marks, this property determines the sort order of the points in the line if `config.sortLineBy` is not specified. For stacked charts, this is always determined by the orientation of the stack; therefore explicitly specified value will be ignored." }, "outerRadius": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The outer radius in pixels of arc marks. `outerRadius` is an alias for `radius`.\n\n__Default value:__ `0`", "minimum": 0 }, "padAngle": { "anyOf": [ { "description": "The angular padding applied to sides of the arc, in radians.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "point": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/OverlayMarkDef" }, { "const": "transparent", "type": "string" } ], "description": "A flag for overlaying points on top of line or area marks, or an object defining the properties of the overlayed points.\n\n- If this property is `\"transparent\"`, transparent points will be used (for enhancing tooltips and selections).\n\n- If this property is an empty object (`{}`) or `true`, filled points with default properties will be used.\n\n- If this property is `false`, no points would be automatically added to line or area marks.\n\n__Default value:__ `false`." }, "radius": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "For arc mark, the primary (outer) radius in pixels.\n\nFor text marks, polar coordinate radial offset, in pixels, of the text from the origin determined by the `x` and `y` properties.\n\n__Default value:__ `min(plot_width, plot_height)/2`", "minimum": 0 }, "radius2": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The secondary (inner) radius in pixels of arc marks.\n\n__Default value:__ `0`", "minimum": 0 }, "shape": { "anyOf": [ { "anyOf": [ { "$ref": "#/definitions/SymbolShape" }, { "type": "string" } ], "description": "Shape of the point marks. Supported values include:\n- plotting shapes: `\"circle\"`, `\"square\"`, `\"cross\"`, `\"diamond\"`, `\"triangle-up\"`, `\"triangle-down\"`, `\"triangle-right\"`, or `\"triangle-left\"`.\n- the line symbol `\"stroke\"`\n- centered directional shapes `\"arrow\"`, `\"wedge\"`, or `\"triangle\"`\n- a custom [SVG path string](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths) (For correct sizing, custom shape paths should be defined within a square bounding box with coordinates ranging from -1 to 1 along both the x and y dimensions.)\n\n__Default value:__ `\"circle\"`" }, { "$ref": "#/definitions/ExprRef" } ] }, "size": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Default size for marks.\n- For `point`/`circle`/`square`, this represents the pixel area of the marks. Note that this value sets the area of the symbol; the side lengths will increase with the square root of this value.\n- For `bar`, this represents the band size of the bar, in pixels.\n- For `text`, this represents the font size, in pixels.\n\n__Default value:__\n- `30` for point, circle, square marks; width/height's `step`\n- `2` for bar marks with discrete dimensions;\n- `5` for bar marks with continuous dimensions;\n- `11` for text marks.", "minimum": 0 }, "smooth": { "anyOf": [ { "description": "A boolean flag (default true) indicating if the image should be smoothed when resized. If false, individual pixels should be scaled directly rather than interpolated with smoothing. For SVG rendering, this option may not work in some browsers due to lack of standardization.", "type": "boolean" }, { "$ref": "#/definitions/ExprRef" } ] }, "startAngle": { "anyOf": [ { "description": "The start angle in radians for arc marks. A value of `0` indicates up (north), increasing values proceed clockwise.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "stroke": { "anyOf": [ { "$ref": "#/definitions/Color" }, { "$ref": "#/definitions/Gradient" }, { "type": "null" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Default stroke color. This property has higher precedence than `config.color`. Set to `null` to remove stroke.\n\n__Default value:__ (None)" }, "strokeCap": { "anyOf": [ { "$ref": "#/definitions/StrokeCap", "description": "The stroke cap for line ending style. One of `\"butt\"`, `\"round\"`, or `\"square\"`.\n\n__Default value:__ `\"butt\"`" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeDash": { "anyOf": [ { "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", "items": { "type": "number" }, "type": "array" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeDashOffset": { "anyOf": [ { "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeJoin": { "anyOf": [ { "$ref": "#/definitions/StrokeJoin", "description": "The stroke line join method. One of `\"miter\"`, `\"round\"` or `\"bevel\"`.\n\n__Default value:__ `\"miter\"`" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeMiterLimit": { "anyOf": [ { "description": "The miter limit at which to bevel a line join.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeOffset": { "anyOf": [ { "description": "The offset in pixels at which to draw the group stroke and fill. If unspecified, the default behavior is to dynamically offset stroked groups such that 1 pixel stroke widths align with the pixel grid.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeOpacity": { "anyOf": [ { "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", "maximum": 1, "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeWidth": { "anyOf": [ { "description": "The stroke width, in pixels.", "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "tension": { "anyOf": [ { "description": "Depending on the interpolation type, sets the tension parameter (for line and area marks).", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "text": { "anyOf": [ { "$ref": "#/definitions/Text", "description": "Placeholder text if the `text` channel is not specified" }, { "$ref": "#/definitions/ExprRef" } ] }, "theta": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "- For arc marks, the arc length in radians if theta2 is not specified, otherwise the start arc angle. (A value of 0 indicates up or “north”, increasing values proceed clockwise.)\n\n- For text marks, polar coordinate angle in radians.", "maximum": 360, "minimum": 0 }, "theta2": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise." }, "time": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "timeUnitBandPosition": { "description": "Default relative band position for a time unit. If set to `0`, the marks will be positioned at the beginning of the time unit band step. If set to `0.5`, the marks will be positioned in the middle of the time unit band step.", "type": "number" }, "timeUnitBandSize": { "description": "Default relative band size for a time unit. If set to `1`, the bandwidth of the marks will be equal to the time unit band step. If set to `0.5`, bandwidth of the marks will be half of the time unit band step.", "type": "number" }, "tooltip": { "anyOf": [ { "type": "number" }, { "type": "string" }, { "type": "boolean" }, { "$ref": "#/definitions/TooltipContent" }, { "$ref": "#/definitions/ExprRef" }, { "type": "null" } ], "description": "The tooltip text string to show upon mouse hover or an object defining which fields should the tooltip be derived from.\n\n- If `tooltip` is `true` or `{\"content\": \"encoding\"}`, then all fields from `encoding` will be used.\n- If `tooltip` is `{\"content\": \"data\"}`, then all fields that appear in the highlighted data point will be used.\n- If set to `null` or `false`, then no tooltip will be used.\n\nSee the [`tooltip`](https://vega.github.io/vega-lite/docs/tooltip.html) documentation for a detailed discussion about tooltip in Vega-Lite.\n\n__Default value:__ `null`" }, "url": { "anyOf": [ { "$ref": "#/definitions/URI", "description": "The URL of the image file for image marks." }, { "$ref": "#/definitions/ExprRef" } ] }, "width": { "anyOf": [ { "description": "Width of the marks.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "x": { "anyOf": [ { "type": "number" }, { "const": "width", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ], "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"` without specified `x2` or `width`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." }, "x2": { "anyOf": [ { "type": "number" }, { "const": "width", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ], "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." }, "y": { "anyOf": [ { "type": "number" }, { "const": "height", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"` without specified `y2` or `height`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." }, "y2": { "anyOf": [ { "type": "number" }, { "const": "height", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." } }, "type": "object" }, "LineString": { "additionalProperties": false, "description": "LineString geometry object. https://tools.ietf.org/html/rfc7946#section-3.1.4", "properties": { "bbox": { "$ref": "#/definitions/BBox", "description": "Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. https://tools.ietf.org/html/rfc7946#section-5" }, "coordinates": { "items": { "$ref": "#/definitions/Position" }, "type": "array" }, "type": { "const": "LineString", "description": "Specifies the type of GeoJSON object.", "type": "string" } }, "required": [ "coordinates", "type" ], "type": "object" }, "LinearGradient": { "additionalProperties": false, "properties": { "gradient": { "const": "linear", "description": "The type of gradient. Use `\"linear\"` for a linear gradient.", "type": "string" }, "id": { "type": "string" }, "stops": { "description": "An array of gradient stops defining the gradient color sequence.", "items": { "$ref": "#/definitions/GradientStop" }, "type": "array" }, "x1": { "description": "The starting x-coordinate, in normalized [0, 1] coordinates, of the linear gradient.\n\n__Default value:__ `0`", "type": "number" }, "x2": { "description": "The ending x-coordinate, in normalized [0, 1] coordinates, of the linear gradient.\n\n__Default value:__ `1`", "type": "number" }, "y1": { "description": "The starting y-coordinate, in normalized [0, 1] coordinates, of the linear gradient.\n\n__Default value:__ `0`", "type": "number" }, "y2": { "description": "The ending y-coordinate, in normalized [0, 1] coordinates, of the linear gradient.\n\n__Default value:__ `0`", "type": "number" } }, "required": [ "gradient", "stops" ], "type": "object" }, "LocalMultiTimeUnit": { "enum": [ "yearquarter", "yearquartermonth", "yearmonth", "yearmonthdate", "yearmonthdatehours", "yearmonthdatehoursminutes", "yearmonthdatehoursminutesseconds", "yearweek", "yearweekday", "yearweekdayhours", "yearweekdayhoursminutes", "yearweekdayhoursminutesseconds", "yeardayofyear", "quartermonth", "monthdate", "monthdatehours", "monthdatehoursminutes", "monthdatehoursminutesseconds", "weekday", "weekdayhours", "weekdayhoursminutes", "weekdayhoursminutesseconds", "dayhours", "dayhoursminutes", "dayhoursminutesseconds", "hoursminutes", "hoursminutesseconds", "minutesseconds", "secondsmilliseconds" ], "type": "string" }, "LocalSingleTimeUnit": { "enum": [ "year", "quarter", "month", "week", "day", "dayofyear", "date", "hours", "minutes", "seconds", "milliseconds" ], "type": "string" }, "Locale": { "additionalProperties": false, "properties": { "number": { "$ref": "#/definitions/NumberLocale" }, "time": { "$ref": "#/definitions/TimeLocale" } }, "type": "object" }, "LoessTransform": { "additionalProperties": false, "properties": { "as": { "description": "The output field names for the smoothed points generated by the loess transform.\n\n__Default value:__ The field names of the input x and y values.", "items": { "$ref": "#/definitions/FieldName" }, "maxItems": 2, "minItems": 2, "type": "array" }, "bandwidth": { "description": "A bandwidth parameter in the range `[0, 1]` that determines the amount of smoothing.\n\n__Default value:__ `0.3`", "type": "number" }, "groupby": { "description": "The data fields to group by. If not specified, a single group containing all data objects will be used.", "items": { "$ref": "#/definitions/FieldName" }, "type": "array" }, "loess": { "$ref": "#/definitions/FieldName", "description": "The data field of the dependent variable to smooth." }, "on": { "$ref": "#/definitions/FieldName", "description": "The data field of the independent variable to use a predictor." } }, "required": [ "loess", "on" ], "type": "object" }, "LogicalAnd": { "additionalProperties": false, "properties": { "and": { "items": { "$ref": "#/definitions/PredicateComposition" }, "type": "array" } }, "required": [ "and" ], "type": "object" }, "PredicateComposition": { "anyOf": [ { "$ref": "#/definitions/LogicalNot" }, { "$ref": "#/definitions/LogicalAnd" }, { "$ref": "#/definitions/LogicalOr" }, { "$ref": "#/definitions/Predicate" } ] }, "LogicalNot": { "additionalProperties": false, "properties": { "not": { "$ref": "#/definitions/PredicateComposition" } }, "required": [ "not" ], "type": "object" }, "LogicalOr": { "additionalProperties": false, "properties": { "or": { "items": { "$ref": "#/definitions/PredicateComposition" }, "type": "array" } }, "required": [ "or" ], "type": "object" }, "LookupData": { "additionalProperties": false, "properties": { "data": { "$ref": "#/definitions/Data", "description": "Secondary data source to lookup in." }, "fields": { "description": "Fields in foreign data or selection to lookup. If not specified, the entire object is queried.", "items": { "$ref": "#/definitions/FieldName" }, "type": "array" }, "key": { "$ref": "#/definitions/FieldName", "description": "Key in data to lookup." } }, "required": [ "data", "key" ], "type": "object" }, "LookupSelection": { "additionalProperties": false, "properties": { "fields": { "description": "Fields in foreign data or selection to lookup. If not specified, the entire object is queried.", "items": { "$ref": "#/definitions/FieldName" }, "type": "array" }, "key": { "$ref": "#/definitions/FieldName", "description": "Key in data to lookup." }, "param": { "$ref": "#/definitions/ParameterName", "description": "Selection parameter name to look up." } }, "required": [ "key", "param" ], "type": "object" }, "LookupTransform": { "additionalProperties": false, "properties": { "as": { "anyOf": [ { "$ref": "#/definitions/FieldName" }, { "items": { "$ref": "#/definitions/FieldName" }, "type": "array" } ], "description": "The output fields on which to store the looked up data values.\n\nFor data lookups, this property may be left blank if `from.fields` has been specified (those field names will be used); if `from.fields` has not been specified, `as` must be a string.\n\nFor selection lookups, this property is optional: if unspecified, looked up values will be stored under a property named for the selection; and if specified, it must correspond to `from.fields`." }, "default": { "description": "The default value to use if lookup fails.\n\n__Default value:__ `null`" }, "from": { "anyOf": [ { "$ref": "#/definitions/LookupData" }, { "$ref": "#/definitions/LookupSelection" } ], "description": "Data source or selection for secondary data reference." }, "lookup": { "description": "Key in primary data source.", "type": "string" } }, "required": [ "lookup", "from" ], "type": "object" }, "Mark": { "description": "All types of primitive marks.", "enum": [ "arc", "area", "bar", "image", "line", "point", "rect", "rule", "text", "tick", "trail", "circle", "square", "geoshape" ], "type": "string" }, "MarkConfig": { "additionalProperties": false, "properties": { "align": { "anyOf": [ { "$ref": "#/definitions/Align" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of `\"left\"`, `\"right\"`, `\"center\"`.\n\n__Note:__ Expression reference is *not* supported for range marks." }, "angle": { "anyOf": [ { "description": "The rotation angle of the text, in degrees.", "maximum": 360, "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "aria": { "anyOf": [ { "description": "A boolean flag indicating if [ARIA attributes](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) should be included (SVG output only). If `false`, the \"aria-hidden\" attribute will be set on the output SVG element, removing the mark item from the ARIA accessibility tree.", "type": "boolean" }, { "$ref": "#/definitions/ExprRef" } ] }, "ariaRole": { "anyOf": [ { "description": "Sets the type of user interface element of the mark item for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only). If specified, this property determines the \"role\" attribute. Warning: this property is experimental and may be changed in the future.", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "ariaRoleDescription": { "anyOf": [ { "description": "A human-readable, author-localized description for the role of the mark item for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only). If specified, this property determines the \"aria-roledescription\" attribute. Warning: this property is experimental and may be changed in the future.", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "aspect": { "anyOf": [ { "description": "Whether to keep aspect ratio of image marks.", "type": "boolean" }, { "$ref": "#/definitions/ExprRef" } ] }, "baseline": { "anyOf": [ { "$ref": "#/definitions/TextBaseline" }, { "$ref": "#/definitions/ExprRef" } ], "description": "For text marks, the vertical text baseline. One of `\"alphabetic\"` (default), `\"top\"`, `\"middle\"`, `\"bottom\"`, `\"line-top\"`, `\"line-bottom\"`, or an expression reference that provides one of the valid values. The `\"line-top\"` and `\"line-bottom\"` values operate similarly to `\"top\"` and `\"bottom\"`, but are calculated relative to the `lineHeight` rather than `fontSize` alone.\n\nFor range marks, the vertical alignment of the marks. One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Note:__ Expression reference is *not* supported for range marks." }, "blend": { "anyOf": [ { "$ref": "#/definitions/Blend", "description": "The color blend mode for drawing an item on its current background. Any valid [CSS mix-blend-mode](https://developer.mozilla.org/en-US/docs/Web/CSS/mix-blend-mode) value can be used.\n\n__Default value: `\"source-over\"`" }, { "$ref": "#/definitions/ExprRef" } ] }, "color": { "anyOf": [ { "$ref": "#/definitions/Color" }, { "$ref": "#/definitions/Gradient" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Default color.\n\n__Default value:__ `\"#4682b4\"`\n\n__Note:__\n- This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).\n- The `fill` and `stroke` properties have higher precedence than `color` and will override `color`." }, "cornerRadius": { "anyOf": [ { "description": "The radius in pixels of rounded rectangles or arcs' corners.\n\n__Default value:__ `0`", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "cornerRadiusBottomLeft": { "anyOf": [ { "description": "The radius in pixels of rounded rectangles' bottom left corner.\n\n__Default value:__ `0`", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "cornerRadiusBottomRight": { "anyOf": [ { "description": "The radius in pixels of rounded rectangles' bottom right corner.\n\n__Default value:__ `0`", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "cornerRadiusTopLeft": { "anyOf": [ { "description": "The radius in pixels of rounded rectangles' top right corner.\n\n__Default value:__ `0`", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "cornerRadiusTopRight": { "anyOf": [ { "description": "The radius in pixels of rounded rectangles' top left corner.\n\n__Default value:__ `0`", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "cursor": { "anyOf": [ { "$ref": "#/definitions/Cursor", "description": "The mouse cursor used over the mark. Any valid [CSS cursor type](https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values) can be used." }, { "$ref": "#/definitions/ExprRef" } ] }, "description": { "anyOf": [ { "description": "A text description of the mark item for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only). If specified, this property determines the [\"aria-label\" attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute).", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "dir": { "anyOf": [ { "$ref": "#/definitions/TextDirection", "description": "The direction of the text. One of `\"ltr\"` (left-to-right) or `\"rtl\"` (right-to-left). This property determines on which side is truncated in response to the limit parameter.\n\n__Default value:__ `\"ltr\"`" }, { "$ref": "#/definitions/ExprRef" } ] }, "dx": { "anyOf": [ { "description": "The horizontal offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "dy": { "anyOf": [ { "description": "The vertical offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "ellipsis": { "anyOf": [ { "description": "The ellipsis string for text truncated in response to the limit parameter.\n\n__Default value:__ `\"…\"`", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "endAngle": { "anyOf": [ { "description": "The end angle in radians for arc marks. A value of `0` indicates up (north), increasing values proceed clockwise.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "fill": { "anyOf": [ { "$ref": "#/definitions/Color" }, { "$ref": "#/definitions/Gradient" }, { "type": "null" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Default fill color. This property has higher precedence than `config.color`. Set to `null` to remove fill.\n\n__Default value:__ (None)" }, "fillOpacity": { "anyOf": [ { "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", "maximum": 1, "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "filled": { "description": "Whether the mark's color should be used as fill color instead of stroke color.\n\n__Default value:__ `false` for all `point`, `line`, and `rule` marks as well as `geoshape` marks for [`graticule`](https://vega.github.io/vega-lite/docs/data.html#graticule) data sources; otherwise, `true`.\n\n__Note:__ This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).", "type": "boolean" }, "font": { "anyOf": [ { "description": "The typeface to set the text in (e.g., `\"Helvetica Neue\"`).", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "fontSize": { "anyOf": [ { "description": "The font size, in pixels.\n\n__Default value:__ `11`", "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "fontStyle": { "anyOf": [ { "$ref": "#/definitions/FontStyle", "description": "The font style (e.g., `\"italic\"`)." }, { "$ref": "#/definitions/ExprRef" } ] }, "fontWeight": { "anyOf": [ { "$ref": "#/definitions/FontWeight", "description": "The font weight. This can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." }, { "$ref": "#/definitions/ExprRef" } ] }, "height": { "anyOf": [ { "description": "Height of the marks.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "href": { "anyOf": [ { "$ref": "#/definitions/URI", "description": "A URL to load upon mouse click. If defined, the mark acts as a hyperlink." }, { "$ref": "#/definitions/ExprRef" } ] }, "innerRadius": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The inner radius in pixels of arc marks. `innerRadius` is an alias for `radius2`.\n\n__Default value:__ `0`", "minimum": 0 }, "interpolate": { "anyOf": [ { "$ref": "#/definitions/Interpolate", "description": "The line interpolation method to use for line and area marks. One of the following:\n- `\"linear\"`: piecewise linear segments, as in a polyline.\n- `\"linear-closed\"`: close the linear segments to form a polygon.\n- `\"step\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"step-before\"`: alternate between vertical and horizontal segments, as in a step function.\n- `\"step-after\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"basis\"`: a B-spline, with control point duplication on the ends.\n- `\"basis-open\"`: an open B-spline; may not intersect the start or end.\n- `\"basis-closed\"`: a closed B-spline, as in a loop.\n- `\"cardinal\"`: a Cardinal spline, with control point duplication on the ends.\n- `\"cardinal-open\"`: an open Cardinal spline; may not intersect the start or end, but will intersect other control points.\n- `\"cardinal-closed\"`: a closed Cardinal spline, as in a loop.\n- `\"bundle\"`: equivalent to basis, except the tension parameter is used to straighten the spline.\n- `\"monotone\"`: cubic interpolation that preserves monotonicity in y." }, { "$ref": "#/definitions/ExprRef" } ] }, "invalid": { "anyOf": [ { "$ref": "#/definitions/MarkInvalidDataMode" }, { "type": "null" } ], "description": "Invalid data mode, which defines how the marks and corresponding scales should represent invalid values (`null` and `NaN` in continuous scales *without* defined output for invalid values).\n\n- `\"filter\"` — *Exclude* all invalid values from the visualization's *marks* and *scales*. For path marks (for line, area, trail), this option will create paths that connect valid points, as if the data rows with invalid values do not exist.\n\n- `\"break-paths-filter-domains\"` — Break path marks (for line, area, trail) at invalid values. For non-path marks, this is equivalent to `\"filter\"`. All *scale* domains will *exclude* these filtered data points.\n\n- `\"break-paths-show-domains\"` — Break paths (for line, area, trail) at invalid values. Hide invalid values for non-path marks. All *scale* domains will *include* these filtered data points (for both path and non-path marks).\n\n- `\"show\"` or `null` — Show all data points in the marks and scale domains. Each scale will use the output for invalid values defined in `config.scale.invalid` or, if unspecified, by default invalid values will produce the same visual values as zero (if the scale includes zero) or the minimum value (if the scale does not include zero).\n\n- `\"break-paths-show-path-domains\"` (default) — This is equivalent to `\"break-paths-show-domains\"` for path-based marks (line/area/trail) and `\"filter\"` for non-path marks.\n\n__Note__: If any channel's scale has an output for invalid values defined in `config.scale.invalid`, all values for the scales will be considered \"valid\" since they can produce a reasonable output for the scales. Thus, fields for such channels will not be filtered and will not cause path breaks." }, "limit": { "anyOf": [ { "description": "The maximum length of the text mark in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.\n\n__Default value:__ `0` -- indicating no limit", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "lineBreak": { "anyOf": [ { "description": "A delimiter, such as a newline character, upon which to break text strings into multiple lines. This property is ignored if the text is array-valued.", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "lineHeight": { "anyOf": [ { "description": "The line height in pixels (the spacing between subsequent lines of text) for multi-line text marks.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "opacity": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The overall opacity (value between [0,1]).\n\n__Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or `square` marks or layered `bar` charts and `1` otherwise.", "maximum": 1, "minimum": 0 }, "order": { "description": "For line and trail marks, this `order` property can be set to `null` or `false` to make the lines use the original order in the data sources.", "type": [ "null", "boolean" ] }, "orient": { "$ref": "#/definitions/Orientation", "description": "The orientation of a non-stacked bar, tick, area, and line charts. The value is either horizontal (default) or vertical.\n- For bar, rule and tick, this determines whether the size of the bar and tick should be applied to x or y dimension.\n- For area, this property determines the orient property of the Vega output.\n- For line and trail marks, this property determines the sort order of the points in the line if `config.sortLineBy` is not specified. For stacked charts, this is always determined by the orientation of the stack; therefore explicitly specified value will be ignored." }, "outerRadius": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The outer radius in pixels of arc marks. `outerRadius` is an alias for `radius`.\n\n__Default value:__ `0`", "minimum": 0 }, "padAngle": { "anyOf": [ { "description": "The angular padding applied to sides of the arc, in radians.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "radius": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "For arc mark, the primary (outer) radius in pixels.\n\nFor text marks, polar coordinate radial offset, in pixels, of the text from the origin determined by the `x` and `y` properties.\n\n__Default value:__ `min(plot_width, plot_height)/2`", "minimum": 0 }, "radius2": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The secondary (inner) radius in pixels of arc marks.\n\n__Default value:__ `0`", "minimum": 0 }, "shape": { "anyOf": [ { "anyOf": [ { "$ref": "#/definitions/SymbolShape" }, { "type": "string" } ], "description": "Shape of the point marks. Supported values include:\n- plotting shapes: `\"circle\"`, `\"square\"`, `\"cross\"`, `\"diamond\"`, `\"triangle-up\"`, `\"triangle-down\"`, `\"triangle-right\"`, or `\"triangle-left\"`.\n- the line symbol `\"stroke\"`\n- centered directional shapes `\"arrow\"`, `\"wedge\"`, or `\"triangle\"`\n- a custom [SVG path string](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths) (For correct sizing, custom shape paths should be defined within a square bounding box with coordinates ranging from -1 to 1 along both the x and y dimensions.)\n\n__Default value:__ `\"circle\"`" }, { "$ref": "#/definitions/ExprRef" } ] }, "size": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Default size for marks.\n- For `point`/`circle`/`square`, this represents the pixel area of the marks. Note that this value sets the area of the symbol; the side lengths will increase with the square root of this value.\n- For `bar`, this represents the band size of the bar, in pixels.\n- For `text`, this represents the font size, in pixels.\n\n__Default value:__\n- `30` for point, circle, square marks; width/height's `step`\n- `2` for bar marks with discrete dimensions;\n- `5` for bar marks with continuous dimensions;\n- `11` for text marks.", "minimum": 0 }, "smooth": { "anyOf": [ { "description": "A boolean flag (default true) indicating if the image should be smoothed when resized. If false, individual pixels should be scaled directly rather than interpolated with smoothing. For SVG rendering, this option may not work in some browsers due to lack of standardization.", "type": "boolean" }, { "$ref": "#/definitions/ExprRef" } ] }, "startAngle": { "anyOf": [ { "description": "The start angle in radians for arc marks. A value of `0` indicates up (north), increasing values proceed clockwise.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "stroke": { "anyOf": [ { "$ref": "#/definitions/Color" }, { "$ref": "#/definitions/Gradient" }, { "type": "null" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Default stroke color. This property has higher precedence than `config.color`. Set to `null` to remove stroke.\n\n__Default value:__ (None)" }, "strokeCap": { "anyOf": [ { "$ref": "#/definitions/StrokeCap", "description": "The stroke cap for line ending style. One of `\"butt\"`, `\"round\"`, or `\"square\"`.\n\n__Default value:__ `\"butt\"`" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeDash": { "anyOf": [ { "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", "items": { "type": "number" }, "type": "array" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeDashOffset": { "anyOf": [ { "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeJoin": { "anyOf": [ { "$ref": "#/definitions/StrokeJoin", "description": "The stroke line join method. One of `\"miter\"`, `\"round\"` or `\"bevel\"`.\n\n__Default value:__ `\"miter\"`" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeMiterLimit": { "anyOf": [ { "description": "The miter limit at which to bevel a line join.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeOffset": { "anyOf": [ { "description": "The offset in pixels at which to draw the group stroke and fill. If unspecified, the default behavior is to dynamically offset stroked groups such that 1 pixel stroke widths align with the pixel grid.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeOpacity": { "anyOf": [ { "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", "maximum": 1, "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeWidth": { "anyOf": [ { "description": "The stroke width, in pixels.", "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "tension": { "anyOf": [ { "description": "Depending on the interpolation type, sets the tension parameter (for line and area marks).", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "text": { "anyOf": [ { "$ref": "#/definitions/Text", "description": "Placeholder text if the `text` channel is not specified" }, { "$ref": "#/definitions/ExprRef" } ] }, "theta": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "- For arc marks, the arc length in radians if theta2 is not specified, otherwise the start arc angle. (A value of 0 indicates up or “north”, increasing values proceed clockwise.)\n\n- For text marks, polar coordinate angle in radians.", "maximum": 360, "minimum": 0 }, "theta2": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise." }, "time": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "timeUnitBandPosition": { "description": "Default relative band position for a time unit. If set to `0`, the marks will be positioned at the beginning of the time unit band step. If set to `0.5`, the marks will be positioned in the middle of the time unit band step.", "type": "number" }, "timeUnitBandSize": { "description": "Default relative band size for a time unit. If set to `1`, the bandwidth of the marks will be equal to the time unit band step. If set to `0.5`, bandwidth of the marks will be half of the time unit band step.", "type": "number" }, "tooltip": { "anyOf": [ { "type": "number" }, { "type": "string" }, { "type": "boolean" }, { "$ref": "#/definitions/TooltipContent" }, { "$ref": "#/definitions/ExprRef" }, { "type": "null" } ], "description": "The tooltip text string to show upon mouse hover or an object defining which fields should the tooltip be derived from.\n\n- If `tooltip` is `true` or `{\"content\": \"encoding\"}`, then all fields from `encoding` will be used.\n- If `tooltip` is `{\"content\": \"data\"}`, then all fields that appear in the highlighted data point will be used.\n- If set to `null` or `false`, then no tooltip will be used.\n\nSee the [`tooltip`](https://vega.github.io/vega-lite/docs/tooltip.html) documentation for a detailed discussion about tooltip in Vega-Lite.\n\n__Default value:__ `null`" }, "url": { "anyOf": [ { "$ref": "#/definitions/URI", "description": "The URL of the image file for image marks." }, { "$ref": "#/definitions/ExprRef" } ] }, "width": { "anyOf": [ { "description": "Width of the marks.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "x": { "anyOf": [ { "type": "number" }, { "const": "width", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ], "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"` without specified `x2` or `width`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." }, "x2": { "anyOf": [ { "type": "number" }, { "const": "width", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ], "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." }, "y": { "anyOf": [ { "type": "number" }, { "const": "height", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"` without specified `y2` or `height`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." }, "y2": { "anyOf": [ { "type": "number" }, { "const": "height", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." } }, "type": "object" }, "MarkDef": { "additionalProperties": false, "properties": { "align": { "anyOf": [ { "$ref": "#/definitions/Align" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of `\"left\"`, `\"right\"`, `\"center\"`.\n\n__Note:__ Expression reference is *not* supported for range marks." }, "angle": { "anyOf": [ { "description": "The rotation angle of the text, in degrees.", "maximum": 360, "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "aria": { "anyOf": [ { "description": "A boolean flag indicating if [ARIA attributes](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) should be included (SVG output only). If `false`, the \"aria-hidden\" attribute will be set on the output SVG element, removing the mark item from the ARIA accessibility tree.", "type": "boolean" }, { "$ref": "#/definitions/ExprRef" } ] }, "ariaRole": { "anyOf": [ { "description": "Sets the type of user interface element of the mark item for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only). If specified, this property determines the \"role\" attribute. Warning: this property is experimental and may be changed in the future.", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "ariaRoleDescription": { "anyOf": [ { "description": "A human-readable, author-localized description for the role of the mark item for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only). If specified, this property determines the \"aria-roledescription\" attribute. Warning: this property is experimental and may be changed in the future.", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "aspect": { "anyOf": [ { "description": "Whether to keep aspect ratio of image marks.", "type": "boolean" }, { "$ref": "#/definitions/ExprRef" } ] }, "bandSize": { "description": "The width of the ticks.\n\n__Default value:__ 3/4 of step (width step for horizontal ticks and height step for vertical ticks).", "minimum": 0, "type": "number" }, "baseline": { "anyOf": [ { "$ref": "#/definitions/TextBaseline" }, { "$ref": "#/definitions/ExprRef" } ], "description": "For text marks, the vertical text baseline. One of `\"alphabetic\"` (default), `\"top\"`, `\"middle\"`, `\"bottom\"`, `\"line-top\"`, `\"line-bottom\"`, or an expression reference that provides one of the valid values. The `\"line-top\"` and `\"line-bottom\"` values operate similarly to `\"top\"` and `\"bottom\"`, but are calculated relative to the `lineHeight` rather than `fontSize` alone.\n\nFor range marks, the vertical alignment of the marks. One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Note:__ Expression reference is *not* supported for range marks." }, "binSpacing": { "description": "Offset between bars for binned field. The ideal value for this is either 0 (preferred by statisticians) or 1 (Vega-Lite default, D3 example style).\n\n__Default value:__ `1`", "minimum": 0, "type": "number" }, "blend": { "anyOf": [ { "$ref": "#/definitions/Blend", "description": "The color blend mode for drawing an item on its current background. Any valid [CSS mix-blend-mode](https://developer.mozilla.org/en-US/docs/Web/CSS/mix-blend-mode) value can be used.\n\n__Default value: `\"source-over\"`" }, { "$ref": "#/definitions/ExprRef" } ] }, "clip": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Whether a mark be clipped to the enclosing group’s width and height." }, "color": { "anyOf": [ { "$ref": "#/definitions/Color" }, { "$ref": "#/definitions/Gradient" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Default color.\n\n__Default value:__ `\"#4682b4\"`\n\n__Note:__\n- This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).\n- The `fill` and `stroke` properties have higher precedence than `color` and will override `color`." }, "continuousBandSize": { "description": "The default size of the bars on continuous scales.\n\n__Default value:__ `5`", "minimum": 0, "type": "number" }, "cornerRadius": { "anyOf": [ { "description": "The radius in pixels of rounded rectangles or arcs' corners.\n\n__Default value:__ `0`", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "cornerRadiusBottomLeft": { "anyOf": [ { "description": "The radius in pixels of rounded rectangles' bottom left corner.\n\n__Default value:__ `0`", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "cornerRadiusBottomRight": { "anyOf": [ { "description": "The radius in pixels of rounded rectangles' bottom right corner.\n\n__Default value:__ `0`", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "cornerRadiusEnd": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "- For vertical bars, top-left and top-right corner radius.\n\n- For horizontal bars, top-right and bottom-right corner radius." }, "cornerRadiusTopLeft": { "anyOf": [ { "description": "The radius in pixels of rounded rectangles' top right corner.\n\n__Default value:__ `0`", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "cornerRadiusTopRight": { "anyOf": [ { "description": "The radius in pixels of rounded rectangles' top left corner.\n\n__Default value:__ `0`", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "cursor": { "anyOf": [ { "$ref": "#/definitions/Cursor", "description": "The mouse cursor used over the mark. Any valid [CSS cursor type](https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values) can be used." }, { "$ref": "#/definitions/ExprRef" } ] }, "description": { "anyOf": [ { "description": "A text description of the mark item for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only). If specified, this property determines the [\"aria-label\" attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute).", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "dir": { "anyOf": [ { "$ref": "#/definitions/TextDirection", "description": "The direction of the text. One of `\"ltr\"` (left-to-right) or `\"rtl\"` (right-to-left). This property determines on which side is truncated in response to the limit parameter.\n\n__Default value:__ `\"ltr\"`" }, { "$ref": "#/definitions/ExprRef" } ] }, "discreteBandSize": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/RelativeBandSize" } ], "description": "The default size of the bars with discrete dimensions. If unspecified, the default size is `step-2`, which provides 2 pixel offset between bars.", "minimum": 0 }, "dx": { "anyOf": [ { "description": "The horizontal offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "dy": { "anyOf": [ { "description": "The vertical offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "ellipsis": { "anyOf": [ { "description": "The ellipsis string for text truncated in response to the limit parameter.\n\n__Default value:__ `\"…\"`", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "fill": { "anyOf": [ { "$ref": "#/definitions/Color" }, { "$ref": "#/definitions/Gradient" }, { "type": "null" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Default fill color. This property has higher precedence than `config.color`. Set to `null` to remove fill.\n\n__Default value:__ (None)" }, "fillOpacity": { "anyOf": [ { "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", "maximum": 1, "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "filled": { "description": "Whether the mark's color should be used as fill color instead of stroke color.\n\n__Default value:__ `false` for all `point`, `line`, and `rule` marks as well as `geoshape` marks for [`graticule`](https://vega.github.io/vega-lite/docs/data.html#graticule) data sources; otherwise, `true`.\n\n__Note:__ This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).", "type": "boolean" }, "font": { "anyOf": [ { "description": "The typeface to set the text in (e.g., `\"Helvetica Neue\"`).", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "fontSize": { "anyOf": [ { "description": "The font size, in pixels.\n\n__Default value:__ `11`", "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "fontStyle": { "anyOf": [ { "$ref": "#/definitions/FontStyle", "description": "The font style (e.g., `\"italic\"`)." }, { "$ref": "#/definitions/ExprRef" } ] }, "fontWeight": { "anyOf": [ { "$ref": "#/definitions/FontWeight", "description": "The font weight. This can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." }, { "$ref": "#/definitions/ExprRef" } ] }, "height": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/RelativeBandSize" } ], "description": "Height of the marks. One of:\n\n- A number representing a fixed pixel height.\n\n- A relative band size definition. For example, `{band: 0.5}` represents half of the band" }, "href": { "anyOf": [ { "$ref": "#/definitions/URI", "description": "A URL to load upon mouse click. If defined, the mark acts as a hyperlink." }, { "$ref": "#/definitions/ExprRef" } ] }, "innerRadius": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The inner radius in pixels of arc marks. `innerRadius` is an alias for `radius2`.\n\n__Default value:__ `0`", "minimum": 0 }, "interpolate": { "anyOf": [ { "$ref": "#/definitions/Interpolate", "description": "The line interpolation method to use for line and area marks. One of the following:\n- `\"linear\"`: piecewise linear segments, as in a polyline.\n- `\"linear-closed\"`: close the linear segments to form a polygon.\n- `\"step\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"step-before\"`: alternate between vertical and horizontal segments, as in a step function.\n- `\"step-after\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"basis\"`: a B-spline, with control point duplication on the ends.\n- `\"basis-open\"`: an open B-spline; may not intersect the start or end.\n- `\"basis-closed\"`: a closed B-spline, as in a loop.\n- `\"cardinal\"`: a Cardinal spline, with control point duplication on the ends.\n- `\"cardinal-open\"`: an open Cardinal spline; may not intersect the start or end, but will intersect other control points.\n- `\"cardinal-closed\"`: a closed Cardinal spline, as in a loop.\n- `\"bundle\"`: equivalent to basis, except the tension parameter is used to straighten the spline.\n- `\"monotone\"`: cubic interpolation that preserves monotonicity in y." }, { "$ref": "#/definitions/ExprRef" } ] }, "invalid": { "anyOf": [ { "$ref": "#/definitions/MarkInvalidDataMode" }, { "type": "null" } ], "description": "Invalid data mode, which defines how the marks and corresponding scales should represent invalid values (`null` and `NaN` in continuous scales *without* defined output for invalid values).\n\n- `\"filter\"` — *Exclude* all invalid values from the visualization's *marks* and *scales*. For path marks (for line, area, trail), this option will create paths that connect valid points, as if the data rows with invalid values do not exist.\n\n- `\"break-paths-filter-domains\"` — Break path marks (for line, area, trail) at invalid values. For non-path marks, this is equivalent to `\"filter\"`. All *scale* domains will *exclude* these filtered data points.\n\n- `\"break-paths-show-domains\"` — Break paths (for line, area, trail) at invalid values. Hide invalid values for non-path marks. All *scale* domains will *include* these filtered data points (for both path and non-path marks).\n\n- `\"show\"` or `null` — Show all data points in the marks and scale domains. Each scale will use the output for invalid values defined in `config.scale.invalid` or, if unspecified, by default invalid values will produce the same visual values as zero (if the scale includes zero) or the minimum value (if the scale does not include zero).\n\n- `\"break-paths-show-path-domains\"` (default) — This is equivalent to `\"break-paths-show-domains\"` for path-based marks (line/area/trail) and `\"filter\"` for non-path marks.\n\n__Note__: If any channel's scale has an output for invalid values defined in `config.scale.invalid`, all values for the scales will be considered \"valid\" since they can produce a reasonable output for the scales. Thus, fields for such channels will not be filtered and will not cause path breaks." }, "limit": { "anyOf": [ { "description": "The maximum length of the text mark in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.\n\n__Default value:__ `0` -- indicating no limit", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "line": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/OverlayMarkDef" } ], "description": "A flag for overlaying line on top of area marks, or an object defining the properties of the overlayed lines.\n\n- If this value is an empty object (`{}`) or `true`, lines with default properties will be used.\n\n- If this value is `false`, no lines would be automatically added to area marks.\n\n__Default value:__ `false`." }, "lineBreak": { "anyOf": [ { "description": "A delimiter, such as a newline character, upon which to break text strings into multiple lines. This property is ignored if the text is array-valued.", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "lineHeight": { "anyOf": [ { "description": "The line height in pixels (the spacing between subsequent lines of text) for multi-line text marks.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "minBandSize": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The minimum band size for bar and rectangle marks. __Default value:__ `0.25`" }, "opacity": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The overall opacity (value between [0,1]).\n\n__Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or `square` marks or layered `bar` charts and `1` otherwise.", "maximum": 1, "minimum": 0 }, "order": { "description": "For line and trail marks, this `order` property can be set to `null` or `false` to make the lines use the original order in the data sources.", "type": [ "null", "boolean" ] }, "orient": { "$ref": "#/definitions/Orientation", "description": "The orientation of a non-stacked bar, tick, area, and line charts. The value is either horizontal (default) or vertical.\n- For bar, rule and tick, this determines whether the size of the bar and tick should be applied to x or y dimension.\n- For area, this property determines the orient property of the Vega output.\n- For line and trail marks, this property determines the sort order of the points in the line if `config.sortLineBy` is not specified. For stacked charts, this is always determined by the orientation of the stack; therefore explicitly specified value will be ignored." }, "outerRadius": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The outer radius in pixels of arc marks. `outerRadius` is an alias for `radius`.\n\n__Default value:__ `0`", "minimum": 0 }, "padAngle": { "anyOf": [ { "description": "The angular padding applied to sides of the arc, in radians.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "point": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/OverlayMarkDef" }, { "const": "transparent", "type": "string" } ], "description": "A flag for overlaying points on top of line or area marks, or an object defining the properties of the overlayed points.\n\n- If this property is `\"transparent\"`, transparent points will be used (for enhancing tooltips and selections).\n\n- If this property is an empty object (`{}`) or `true`, filled points with default properties will be used.\n\n- If this property is `false`, no points would be automatically added to line or area marks.\n\n__Default value:__ `false`." }, "radius": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "For arc mark, the primary (outer) radius in pixels.\n\nFor text marks, polar coordinate radial offset, in pixels, of the text from the origin determined by the `x` and `y` properties.\n\n__Default value:__ `min(plot_width, plot_height)/2`", "minimum": 0 }, "radius2": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The secondary (inner) radius in pixels of arc marks.\n\n__Default value:__ `0`", "minimum": 0 }, "radius2Offset": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Offset for radius2." }, "radiusOffset": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Offset for radius." }, "shape": { "anyOf": [ { "anyOf": [ { "$ref": "#/definitions/SymbolShape" }, { "type": "string" } ], "description": "Shape of the point marks. Supported values include:\n- plotting shapes: `\"circle\"`, `\"square\"`, `\"cross\"`, `\"diamond\"`, `\"triangle-up\"`, `\"triangle-down\"`, `\"triangle-right\"`, or `\"triangle-left\"`.\n- the line symbol `\"stroke\"`\n- centered directional shapes `\"arrow\"`, `\"wedge\"`, or `\"triangle\"`\n- a custom [SVG path string](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths) (For correct sizing, custom shape paths should be defined within a square bounding box with coordinates ranging from -1 to 1 along both the x and y dimensions.)\n\n__Default value:__ `\"circle\"`" }, { "$ref": "#/definitions/ExprRef" } ] }, "size": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Default size for marks.\n- For `point`/`circle`/`square`, this represents the pixel area of the marks. Note that this value sets the area of the symbol; the side lengths will increase with the square root of this value.\n- For `bar`, this represents the band size of the bar, in pixels.\n- For `text`, this represents the font size, in pixels.\n\n__Default value:__\n- `30` for point, circle, square marks; width/height's `step`\n- `2` for bar marks with discrete dimensions;\n- `5` for bar marks with continuous dimensions;\n- `11` for text marks.", "minimum": 0 }, "smooth": { "anyOf": [ { "description": "A boolean flag (default true) indicating if the image should be smoothed when resized. If false, individual pixels should be scaled directly rather than interpolated with smoothing. For SVG rendering, this option may not work in some browsers due to lack of standardization.", "type": "boolean" }, { "$ref": "#/definitions/ExprRef" } ] }, "stroke": { "anyOf": [ { "$ref": "#/definitions/Color" }, { "$ref": "#/definitions/Gradient" }, { "type": "null" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Default stroke color. This property has higher precedence than `config.color`. Set to `null` to remove stroke.\n\n__Default value:__ (None)" }, "strokeCap": { "anyOf": [ { "$ref": "#/definitions/StrokeCap", "description": "The stroke cap for line ending style. One of `\"butt\"`, `\"round\"`, or `\"square\"`.\n\n__Default value:__ `\"butt\"`" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeDash": { "anyOf": [ { "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", "items": { "type": "number" }, "type": "array" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeDashOffset": { "anyOf": [ { "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeJoin": { "anyOf": [ { "$ref": "#/definitions/StrokeJoin", "description": "The stroke line join method. One of `\"miter\"`, `\"round\"` or `\"bevel\"`.\n\n__Default value:__ `\"miter\"`" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeMiterLimit": { "anyOf": [ { "description": "The miter limit at which to bevel a line join.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeOffset": { "anyOf": [ { "description": "The offset in pixels at which to draw the group stroke and fill. If unspecified, the default behavior is to dynamically offset stroked groups such that 1 pixel stroke widths align with the pixel grid.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeOpacity": { "anyOf": [ { "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", "maximum": 1, "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeWidth": { "anyOf": [ { "description": "The stroke width, in pixels.", "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "style": { "anyOf": [ { "type": "string" }, { "items": { "type": "string" }, "type": "array" } ], "description": "A string or array of strings indicating the name of custom styles to apply to the mark. A style is a named collection of mark property defaults defined within the [style configuration](https://vega.github.io/vega-lite/docs/mark.html#style-config). If style is an array, later styles will override earlier styles. Any [mark properties](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) explicitly defined within the `encoding` will override a style default.\n\n__Default value:__ The mark's name. For example, a bar mark will have style `\"bar\"` by default. __Note:__ Any specified style will augment the default style. For example, a bar mark with `\"style\": \"foo\"` will receive from `config.style.bar` and `config.style.foo` (the specified style `\"foo\"` has higher precedence)." }, "tension": { "anyOf": [ { "description": "Depending on the interpolation type, sets the tension parameter (for line and area marks).", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "text": { "anyOf": [ { "$ref": "#/definitions/Text", "description": "Placeholder text if the `text` channel is not specified" }, { "$ref": "#/definitions/ExprRef" } ] }, "theta": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "- For arc marks, the arc length in radians if theta2 is not specified, otherwise the start arc angle. (A value of 0 indicates up or “north”, increasing values proceed clockwise.)\n\n- For text marks, polar coordinate angle in radians.", "maximum": 360, "minimum": 0 }, "theta2": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise." }, "theta2Offset": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Offset for theta2." }, "thetaOffset": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Offset for theta." }, "thickness": { "description": "Thickness of the tick mark.\n\n__Default value:__ `1`", "minimum": 0, "type": "number" }, "time": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "timeUnitBandPosition": { "description": "Default relative band position for a time unit. If set to `0`, the marks will be positioned at the beginning of the time unit band step. If set to `0.5`, the marks will be positioned in the middle of the time unit band step.", "type": "number" }, "timeUnitBandSize": { "description": "Default relative band size for a time unit. If set to `1`, the bandwidth of the marks will be equal to the time unit band step. If set to `0.5`, bandwidth of the marks will be half of the time unit band step.", "type": "number" }, "tooltip": { "anyOf": [ { "type": "number" }, { "type": "string" }, { "type": "boolean" }, { "$ref": "#/definitions/TooltipContent" }, { "$ref": "#/definitions/ExprRef" }, { "type": "null" } ], "description": "The tooltip text string to show upon mouse hover or an object defining which fields should the tooltip be derived from.\n\n- If `tooltip` is `true` or `{\"content\": \"encoding\"}`, then all fields from `encoding` will be used.\n- If `tooltip` is `{\"content\": \"data\"}`, then all fields that appear in the highlighted data point will be used.\n- If set to `null` or `false`, then no tooltip will be used.\n\nSee the [`tooltip`](https://vega.github.io/vega-lite/docs/tooltip.html) documentation for a detailed discussion about tooltip in Vega-Lite.\n\n__Default value:__ `null`" }, "type": { "$ref": "#/definitions/Mark", "description": "The mark type. This could a primitive mark type (one of `\"bar\"`, `\"circle\"`, `\"square\"`, `\"tick\"`, `\"line\"`, `\"area\"`, `\"point\"`, `\"geoshape\"`, `\"rule\"`, and `\"text\"`) or a composite mark type (`\"boxplot\"`, `\"errorband\"`, `\"errorbar\"`)." }, "url": { "anyOf": [ { "$ref": "#/definitions/URI", "description": "The URL of the image file for image marks." }, { "$ref": "#/definitions/ExprRef" } ] }, "width": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/RelativeBandSize" } ], "description": "Width of the marks. One of:\n\n- A number representing a fixed pixel width.\n\n- A relative band size definition. For example, `{band: 0.5}` represents half of the band." }, "x": { "anyOf": [ { "type": "number" }, { "const": "width", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ], "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"` without specified `x2` or `width`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." }, "x2": { "anyOf": [ { "type": "number" }, { "const": "width", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ], "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." }, "x2Offset": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Offset for x2-position." }, "xOffset": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Offset for x-position." }, "y": { "anyOf": [ { "type": "number" }, { "const": "height", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"` without specified `y2` or `height`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." }, "y2": { "anyOf": [ { "type": "number" }, { "const": "height", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." }, "y2Offset": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Offset for y2-position." }, "yOffset": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Offset for y-position." } }, "required": [ "type" ], "type": "object" }, "MarkInvalidDataMode": { "enum": [ "filter", "break-paths-filter-domains", "break-paths-show-domains", "break-paths-show-path-domains", "show" ], "type": "string" }, "MarkPropDef<(Gradient|string|null)>": { "anyOf": [ { "$ref": "#/definitions/FieldOrDatumDefWithCondition" }, { "$ref": "#/definitions/FieldOrDatumDefWithCondition" }, { "$ref": "#/definitions/ValueDefWithCondition" } ] }, "MarkPropDef<(string|null),TypeForShape>": { "anyOf": [ { "$ref": "#/definitions/FieldOrDatumDefWithCondition,(string|null)>" }, { "$ref": "#/definitions/FieldOrDatumDefWithCondition" }, { "$ref": "#/definitions/ValueDefWithCondition,(string|null)>" } ] }, "MarkPropDef": { "anyOf": [ { "$ref": "#/definitions/FieldOrDatumDefWithCondition" }, { "$ref": "#/definitions/FieldOrDatumDefWithCondition" }, { "$ref": "#/definitions/ValueDefWithCondition" } ] }, "MarkPropDef": { "anyOf": [ { "$ref": "#/definitions/FieldOrDatumDefWithCondition" }, { "$ref": "#/definitions/FieldOrDatumDefWithCondition" }, { "$ref": "#/definitions/ValueDefWithCondition" } ] }, "MarkType": { "enum": [ "arc", "area", "image", "group", "line", "path", "rect", "rule", "shape", "symbol", "text", "trail" ], "type": "string" }, "MergedStream": { "additionalProperties": false, "properties": { "between": { "items": { "$ref": "#/definitions/Stream" }, "type": "array" }, "consume": { "type": "boolean" }, "debounce": { "type": "number" }, "filter": { "anyOf": [ { "$ref": "#/definitions/Expr" }, { "items": { "$ref": "#/definitions/Expr" }, "type": "array" } ] }, "markname": { "type": "string" }, "marktype": { "$ref": "#/definitions/MarkType" }, "merge": { "items": { "$ref": "#/definitions/Stream" }, "type": "array" }, "throttle": { "type": "number" } }, "required": [ "merge" ], "type": "object" }, "Month": { "maximum": 12, "minimum": 1, "type": "number" }, "MultiLineString": { "additionalProperties": false, "description": "MultiLineString geometry object. https://tools.ietf.org/html/rfc7946#section-3.1.5", "properties": { "bbox": { "$ref": "#/definitions/BBox", "description": "Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. https://tools.ietf.org/html/rfc7946#section-5" }, "coordinates": { "items": { "items": { "$ref": "#/definitions/Position" }, "type": "array" }, "type": "array" }, "type": { "const": "MultiLineString", "description": "Specifies the type of GeoJSON object.", "type": "string" } }, "required": [ "coordinates", "type" ], "type": "object" }, "MultiPoint": { "additionalProperties": false, "description": "MultiPoint geometry object. https://tools.ietf.org/html/rfc7946#section-3.1.3", "properties": { "bbox": { "$ref": "#/definitions/BBox", "description": "Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. https://tools.ietf.org/html/rfc7946#section-5" }, "coordinates": { "items": { "$ref": "#/definitions/Position" }, "type": "array" }, "type": { "const": "MultiPoint", "description": "Specifies the type of GeoJSON object.", "type": "string" } }, "required": [ "coordinates", "type" ], "type": "object" }, "MultiPolygon": { "additionalProperties": false, "description": "MultiPolygon geometry object. https://tools.ietf.org/html/rfc7946#section-3.1.7", "properties": { "bbox": { "$ref": "#/definitions/BBox", "description": "Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. https://tools.ietf.org/html/rfc7946#section-5" }, "coordinates": { "items": { "items": { "items": { "$ref": "#/definitions/Position" }, "type": "array" }, "type": "array" }, "type": "array" }, "type": { "const": "MultiPolygon", "description": "Specifies the type of GeoJSON object.", "type": "string" } }, "required": [ "coordinates", "type" ], "type": "object" }, "MultiTimeUnit": { "anyOf": [ { "$ref": "#/definitions/LocalMultiTimeUnit" }, { "$ref": "#/definitions/UtcMultiTimeUnit" } ] }, "NamedData": { "additionalProperties": false, "properties": { "format": { "$ref": "#/definitions/DataFormat", "description": "An object that specifies the format for parsing the data." }, "name": { "description": "Provide a placeholder name and bind data at runtime.\n\nNew data may change the layout but Vega does not always resize the chart. To update the layout when the data updates, set [autosize](https://vega.github.io/vega-lite/docs/size.html#autosize) or explicitly use [view.resize](https://vega.github.io/vega/docs/api/view/#view_resize).", "type": "string" } }, "required": [ "name" ], "type": "object" }, "NonArgAggregateOp": { "enum": [ "average", "count", "distinct", "max", "mean", "median", "min", "missing", "product", "q1", "q3", "ci0", "ci1", "stderr", "stdev", "stdevp", "sum", "valid", "values", "variance", "variancep", "exponential", "exponentialb" ], "type": "string" }, "NonLayerRepeatSpec": { "additionalProperties": false, "description": "Base interface for a repeat specification.", "properties": { "align": { "anyOf": [ { "$ref": "#/definitions/LayoutAlign" }, { "$ref": "#/definitions/RowCol" } ], "description": "The alignment to apply to grid rows and columns. The supported string values are `\"all\"`, `\"each\"`, and `\"none\"`.\n\n- For `\"none\"`, a flow layout will be used, in which adjacent subviews are simply placed one after the other.\n- For `\"each\"`, subviews will be aligned into a clean grid structure, but each row or column may be of variable size.\n- For `\"all\"`, subviews will be aligned and each row or column will be sized identically based on the maximum observed size. String values for this property will be applied to both grid rows and columns.\n\nAlternatively, an object value of the form `{\"row\": string, \"column\": string}` can be used to supply different alignments for rows and columns.\n\n__Default value:__ `\"all\"`." }, "bounds": { "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used.\n- If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", "enum": [ "full", "flush" ], "type": "string" }, "center": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/RowCol" } ], "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\nAn object value of the form `{\"row\": boolean, \"column\": boolean}` can be used to supply different centering values for rows and columns.\n\n__Default value:__ `false`" }, "columns": { "description": "The number of columns to include in the view composition layout.\n\n__Default value__: `undefined` -- An infinite number of columns (a single row) will be assumed. This is equivalent to `hconcat` (for `concat`) and to using the `column` channel (for `facet` and `repeat`).\n\n__Note__:\n\n1) This property is only for:\n- the general (wrappable) `concat` operator (not `hconcat`/`vconcat`)\n- the `facet` and `repeat` operator with one field/repetition definition (without row/column nesting)\n\n2) Setting the `columns` to `1` is equivalent to `vconcat` (for `concat`) and to using the `row` channel (for `facet` and `repeat`).", "type": "number" }, "data": { "anyOf": [ { "$ref": "#/definitions/Data" }, { "type": "null" } ], "description": "An object describing the data source. Set to `null` to ignore the parent's data source. If no data is set, it is derived from the parent." }, "description": { "description": "Description of this mark for commenting purpose.", "type": "string" }, "name": { "description": "Name of the visualization for later reference.", "type": "string" }, "repeat": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "$ref": "#/definitions/RepeatMapping" } ], "description": "Definition for fields to be repeated. One of: 1) An array of fields to be repeated. If `\"repeat\"` is an array, the field can be referred to as `{\"repeat\": \"repeat\"}`. The repeated views are laid out in a wrapped row. You can set the number of columns to control the wrapping. 2) An object that maps `\"row\"` and/or `\"column\"` to the listed fields to be repeated along the particular orientations. The objects `{\"repeat\": \"row\"}` and `{\"repeat\": \"column\"}` can be used to refer to the repeated field respectively." }, "resolve": { "$ref": "#/definitions/Resolve", "description": "Scale, axis, and legend resolutions for view composition specifications." }, "spacing": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/RowCol" } ], "description": "The spacing in pixels between sub-views of the composition operator. An object of the form `{\"row\": number, \"column\": number}` can be used to set different spacing values for rows and columns.\n\n__Default value__: Depends on `\"spacing\"` property of [the view composition configuration](https://vega.github.io/vega-lite/docs/config.html#view-config) (`20` by default)" }, "spec": { "$ref": "#/definitions/NonNormalizedSpec", "description": "A specification of the view that gets repeated." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "$ref": "#/definitions/TitleParams" } ], "description": "Title for the plot." }, "transform": { "description": "An array of data transformations such as filter and new field calculation.", "items": { "$ref": "#/definitions/Transform" }, "type": "array" } }, "required": [ "repeat", "spec" ], "type": "object" }, "NonNormalizedSpec": { "$ref": "#/definitions/Spec" }, "NumberLocale": { "additionalProperties": false, "description": "Locale definition for formatting numbers.", "properties": { "currency": { "$ref": "#/definitions/Vector2", "description": "The currency prefix and suffix (e.g., [\"$\", \"\"])." }, "decimal": { "description": "The decimal point (e.g., \".\").", "type": "string" }, "grouping": { "description": "The array of group sizes (e.g., [3]), cycled as needed.", "items": { "type": "number" }, "type": "array" }, "minus": { "description": "The minus sign (defaults to hyphen-minus, \"-\").", "type": "string" }, "nan": { "description": "The not-a-number value (defaults to \"NaN\").", "type": "string" }, "numerals": { "$ref": "#/definitions/Vector10", "description": "An array of ten strings to replace the numerals 0-9." }, "percent": { "description": "The percent sign (defaults to \"%\").", "type": "string" }, "thousands": { "description": "The group separator (e.g., \",\").", "type": "string" } }, "required": [ "decimal", "thousands", "grouping", "currency" ], "type": "object" }, "NumericArrayMarkPropDef": { "$ref": "#/definitions/MarkPropDef" }, "NumericMarkPropDef": { "$ref": "#/definitions/MarkPropDef" }, "OffsetDef": { "anyOf": [ { "$ref": "#/definitions/ScaleFieldDef" }, { "$ref": "#/definitions/ScaleDatumDef" }, { "$ref": "#/definitions/ValueDef" } ] }, "OrderFieldDef": { "additionalProperties": false, "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/BinParams" }, { "const": "binned", "type": "string" }, { "type": "null" } ], "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "sort": { "$ref": "#/definitions/SortOrder", "description": "The sort order. One of `\"ascending\"` (default) or `\"descending\"`." }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "$ref": "#/definitions/StandardType", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } }, "type": "object" }, "OrderOnlyDef": { "additionalProperties": false, "properties": { "sort": { "$ref": "#/definitions/SortOrder", "description": "The sort order. One of `\"ascending\"` (default) or `\"descending\"`." } }, "type": "object" }, "OrderValueDef": { "additionalProperties": false, "properties": { "condition": { "anyOf": [ { "$ref": "#/definitions/ConditionalValueDef" }, { "items": { "$ref": "#/definitions/ConditionalValueDef" }, "type": "array" } ], "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." }, "value": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." } }, "required": [ "value" ], "type": "object" }, "Orient": { "enum": [ "left", "right", "top", "bottom" ], "type": "string" }, "Orientation": { "enum": [ "horizontal", "vertical" ], "type": "string" }, "OverlayMarkDef": { "additionalProperties": false, "properties": { "align": { "anyOf": [ { "$ref": "#/definitions/Align" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of `\"left\"`, `\"right\"`, `\"center\"`.\n\n__Note:__ Expression reference is *not* supported for range marks." }, "angle": { "anyOf": [ { "description": "The rotation angle of the text, in degrees.", "maximum": 360, "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "aria": { "anyOf": [ { "description": "A boolean flag indicating if [ARIA attributes](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) should be included (SVG output only). If `false`, the \"aria-hidden\" attribute will be set on the output SVG element, removing the mark item from the ARIA accessibility tree.", "type": "boolean" }, { "$ref": "#/definitions/ExprRef" } ] }, "ariaRole": { "anyOf": [ { "description": "Sets the type of user interface element of the mark item for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only). If specified, this property determines the \"role\" attribute. Warning: this property is experimental and may be changed in the future.", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "ariaRoleDescription": { "anyOf": [ { "description": "A human-readable, author-localized description for the role of the mark item for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only). If specified, this property determines the \"aria-roledescription\" attribute. Warning: this property is experimental and may be changed in the future.", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "aspect": { "anyOf": [ { "description": "Whether to keep aspect ratio of image marks.", "type": "boolean" }, { "$ref": "#/definitions/ExprRef" } ] }, "baseline": { "anyOf": [ { "$ref": "#/definitions/TextBaseline" }, { "$ref": "#/definitions/ExprRef" } ], "description": "For text marks, the vertical text baseline. One of `\"alphabetic\"` (default), `\"top\"`, `\"middle\"`, `\"bottom\"`, `\"line-top\"`, `\"line-bottom\"`, or an expression reference that provides one of the valid values. The `\"line-top\"` and `\"line-bottom\"` values operate similarly to `\"top\"` and `\"bottom\"`, but are calculated relative to the `lineHeight` rather than `fontSize` alone.\n\nFor range marks, the vertical alignment of the marks. One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Note:__ Expression reference is *not* supported for range marks." }, "blend": { "anyOf": [ { "$ref": "#/definitions/Blend", "description": "The color blend mode for drawing an item on its current background. Any valid [CSS mix-blend-mode](https://developer.mozilla.org/en-US/docs/Web/CSS/mix-blend-mode) value can be used.\n\n__Default value: `\"source-over\"`" }, { "$ref": "#/definitions/ExprRef" } ] }, "clip": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Whether a mark be clipped to the enclosing group’s width and height." }, "color": { "anyOf": [ { "$ref": "#/definitions/Color" }, { "$ref": "#/definitions/Gradient" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Default color.\n\n__Default value:__ `\"#4682b4\"`\n\n__Note:__\n- This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).\n- The `fill` and `stroke` properties have higher precedence than `color` and will override `color`." }, "cornerRadius": { "anyOf": [ { "description": "The radius in pixels of rounded rectangles or arcs' corners.\n\n__Default value:__ `0`", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "cornerRadiusBottomLeft": { "anyOf": [ { "description": "The radius in pixels of rounded rectangles' bottom left corner.\n\n__Default value:__ `0`", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "cornerRadiusBottomRight": { "anyOf": [ { "description": "The radius in pixels of rounded rectangles' bottom right corner.\n\n__Default value:__ `0`", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "cornerRadiusTopLeft": { "anyOf": [ { "description": "The radius in pixels of rounded rectangles' top right corner.\n\n__Default value:__ `0`", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "cornerRadiusTopRight": { "anyOf": [ { "description": "The radius in pixels of rounded rectangles' top left corner.\n\n__Default value:__ `0`", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "cursor": { "anyOf": [ { "$ref": "#/definitions/Cursor", "description": "The mouse cursor used over the mark. Any valid [CSS cursor type](https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values) can be used." }, { "$ref": "#/definitions/ExprRef" } ] }, "description": { "anyOf": [ { "description": "A text description of the mark item for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only). If specified, this property determines the [\"aria-label\" attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute).", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "dir": { "anyOf": [ { "$ref": "#/definitions/TextDirection", "description": "The direction of the text. One of `\"ltr\"` (left-to-right) or `\"rtl\"` (right-to-left). This property determines on which side is truncated in response to the limit parameter.\n\n__Default value:__ `\"ltr\"`" }, { "$ref": "#/definitions/ExprRef" } ] }, "dx": { "anyOf": [ { "description": "The horizontal offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "dy": { "anyOf": [ { "description": "The vertical offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "ellipsis": { "anyOf": [ { "description": "The ellipsis string for text truncated in response to the limit parameter.\n\n__Default value:__ `\"…\"`", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "endAngle": { "anyOf": [ { "description": "The end angle in radians for arc marks. A value of `0` indicates up (north), increasing values proceed clockwise.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "fill": { "anyOf": [ { "$ref": "#/definitions/Color" }, { "$ref": "#/definitions/Gradient" }, { "type": "null" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Default fill color. This property has higher precedence than `config.color`. Set to `null` to remove fill.\n\n__Default value:__ (None)" }, "fillOpacity": { "anyOf": [ { "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", "maximum": 1, "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "filled": { "description": "Whether the mark's color should be used as fill color instead of stroke color.\n\n__Default value:__ `false` for all `point`, `line`, and `rule` marks as well as `geoshape` marks for [`graticule`](https://vega.github.io/vega-lite/docs/data.html#graticule) data sources; otherwise, `true`.\n\n__Note:__ This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).", "type": "boolean" }, "font": { "anyOf": [ { "description": "The typeface to set the text in (e.g., `\"Helvetica Neue\"`).", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "fontSize": { "anyOf": [ { "description": "The font size, in pixels.\n\n__Default value:__ `11`", "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "fontStyle": { "anyOf": [ { "$ref": "#/definitions/FontStyle", "description": "The font style (e.g., `\"italic\"`)." }, { "$ref": "#/definitions/ExprRef" } ] }, "fontWeight": { "anyOf": [ { "$ref": "#/definitions/FontWeight", "description": "The font weight. This can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." }, { "$ref": "#/definitions/ExprRef" } ] }, "height": { "anyOf": [ { "description": "Height of the marks.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "href": { "anyOf": [ { "$ref": "#/definitions/URI", "description": "A URL to load upon mouse click. If defined, the mark acts as a hyperlink." }, { "$ref": "#/definitions/ExprRef" } ] }, "innerRadius": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The inner radius in pixels of arc marks. `innerRadius` is an alias for `radius2`.\n\n__Default value:__ `0`", "minimum": 0 }, "interpolate": { "anyOf": [ { "$ref": "#/definitions/Interpolate", "description": "The line interpolation method to use for line and area marks. One of the following:\n- `\"linear\"`: piecewise linear segments, as in a polyline.\n- `\"linear-closed\"`: close the linear segments to form a polygon.\n- `\"step\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"step-before\"`: alternate between vertical and horizontal segments, as in a step function.\n- `\"step-after\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"basis\"`: a B-spline, with control point duplication on the ends.\n- `\"basis-open\"`: an open B-spline; may not intersect the start or end.\n- `\"basis-closed\"`: a closed B-spline, as in a loop.\n- `\"cardinal\"`: a Cardinal spline, with control point duplication on the ends.\n- `\"cardinal-open\"`: an open Cardinal spline; may not intersect the start or end, but will intersect other control points.\n- `\"cardinal-closed\"`: a closed Cardinal spline, as in a loop.\n- `\"bundle\"`: equivalent to basis, except the tension parameter is used to straighten the spline.\n- `\"monotone\"`: cubic interpolation that preserves monotonicity in y." }, { "$ref": "#/definitions/ExprRef" } ] }, "invalid": { "anyOf": [ { "$ref": "#/definitions/MarkInvalidDataMode" }, { "type": "null" } ], "description": "Invalid data mode, which defines how the marks and corresponding scales should represent invalid values (`null` and `NaN` in continuous scales *without* defined output for invalid values).\n\n- `\"filter\"` — *Exclude* all invalid values from the visualization's *marks* and *scales*. For path marks (for line, area, trail), this option will create paths that connect valid points, as if the data rows with invalid values do not exist.\n\n- `\"break-paths-filter-domains\"` — Break path marks (for line, area, trail) at invalid values. For non-path marks, this is equivalent to `\"filter\"`. All *scale* domains will *exclude* these filtered data points.\n\n- `\"break-paths-show-domains\"` — Break paths (for line, area, trail) at invalid values. Hide invalid values for non-path marks. All *scale* domains will *include* these filtered data points (for both path and non-path marks).\n\n- `\"show\"` or `null` — Show all data points in the marks and scale domains. Each scale will use the output for invalid values defined in `config.scale.invalid` or, if unspecified, by default invalid values will produce the same visual values as zero (if the scale includes zero) or the minimum value (if the scale does not include zero).\n\n- `\"break-paths-show-path-domains\"` (default) — This is equivalent to `\"break-paths-show-domains\"` for path-based marks (line/area/trail) and `\"filter\"` for non-path marks.\n\n__Note__: If any channel's scale has an output for invalid values defined in `config.scale.invalid`, all values for the scales will be considered \"valid\" since they can produce a reasonable output for the scales. Thus, fields for such channels will not be filtered and will not cause path breaks." }, "limit": { "anyOf": [ { "description": "The maximum length of the text mark in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.\n\n__Default value:__ `0` -- indicating no limit", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "lineBreak": { "anyOf": [ { "description": "A delimiter, such as a newline character, upon which to break text strings into multiple lines. This property is ignored if the text is array-valued.", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "lineHeight": { "anyOf": [ { "description": "The line height in pixels (the spacing between subsequent lines of text) for multi-line text marks.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "opacity": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The overall opacity (value between [0,1]).\n\n__Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or `square` marks or layered `bar` charts and `1` otherwise.", "maximum": 1, "minimum": 0 }, "order": { "description": "For line and trail marks, this `order` property can be set to `null` or `false` to make the lines use the original order in the data sources.", "type": [ "null", "boolean" ] }, "orient": { "$ref": "#/definitions/Orientation", "description": "The orientation of a non-stacked bar, tick, area, and line charts. The value is either horizontal (default) or vertical.\n- For bar, rule and tick, this determines whether the size of the bar and tick should be applied to x or y dimension.\n- For area, this property determines the orient property of the Vega output.\n- For line and trail marks, this property determines the sort order of the points in the line if `config.sortLineBy` is not specified. For stacked charts, this is always determined by the orientation of the stack; therefore explicitly specified value will be ignored." }, "outerRadius": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The outer radius in pixels of arc marks. `outerRadius` is an alias for `radius`.\n\n__Default value:__ `0`", "minimum": 0 }, "padAngle": { "anyOf": [ { "description": "The angular padding applied to sides of the arc, in radians.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "radius": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "For arc mark, the primary (outer) radius in pixels.\n\nFor text marks, polar coordinate radial offset, in pixels, of the text from the origin determined by the `x` and `y` properties.\n\n__Default value:__ `min(plot_width, plot_height)/2`", "minimum": 0 }, "radius2": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The secondary (inner) radius in pixels of arc marks.\n\n__Default value:__ `0`", "minimum": 0 }, "radius2Offset": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Offset for radius2." }, "radiusOffset": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Offset for radius." }, "shape": { "anyOf": [ { "anyOf": [ { "$ref": "#/definitions/SymbolShape" }, { "type": "string" } ], "description": "Shape of the point marks. Supported values include:\n- plotting shapes: `\"circle\"`, `\"square\"`, `\"cross\"`, `\"diamond\"`, `\"triangle-up\"`, `\"triangle-down\"`, `\"triangle-right\"`, or `\"triangle-left\"`.\n- the line symbol `\"stroke\"`\n- centered directional shapes `\"arrow\"`, `\"wedge\"`, or `\"triangle\"`\n- a custom [SVG path string](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths) (For correct sizing, custom shape paths should be defined within a square bounding box with coordinates ranging from -1 to 1 along both the x and y dimensions.)\n\n__Default value:__ `\"circle\"`" }, { "$ref": "#/definitions/ExprRef" } ] }, "size": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Default size for marks.\n- For `point`/`circle`/`square`, this represents the pixel area of the marks. Note that this value sets the area of the symbol; the side lengths will increase with the square root of this value.\n- For `bar`, this represents the band size of the bar, in pixels.\n- For `text`, this represents the font size, in pixels.\n\n__Default value:__\n- `30` for point, circle, square marks; width/height's `step`\n- `2` for bar marks with discrete dimensions;\n- `5` for bar marks with continuous dimensions;\n- `11` for text marks.", "minimum": 0 }, "smooth": { "anyOf": [ { "description": "A boolean flag (default true) indicating if the image should be smoothed when resized. If false, individual pixels should be scaled directly rather than interpolated with smoothing. For SVG rendering, this option may not work in some browsers due to lack of standardization.", "type": "boolean" }, { "$ref": "#/definitions/ExprRef" } ] }, "startAngle": { "anyOf": [ { "description": "The start angle in radians for arc marks. A value of `0` indicates up (north), increasing values proceed clockwise.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "stroke": { "anyOf": [ { "$ref": "#/definitions/Color" }, { "$ref": "#/definitions/Gradient" }, { "type": "null" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Default stroke color. This property has higher precedence than `config.color`. Set to `null` to remove stroke.\n\n__Default value:__ (None)" }, "strokeCap": { "anyOf": [ { "$ref": "#/definitions/StrokeCap", "description": "The stroke cap for line ending style. One of `\"butt\"`, `\"round\"`, or `\"square\"`.\n\n__Default value:__ `\"butt\"`" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeDash": { "anyOf": [ { "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", "items": { "type": "number" }, "type": "array" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeDashOffset": { "anyOf": [ { "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeJoin": { "anyOf": [ { "$ref": "#/definitions/StrokeJoin", "description": "The stroke line join method. One of `\"miter\"`, `\"round\"` or `\"bevel\"`.\n\n__Default value:__ `\"miter\"`" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeMiterLimit": { "anyOf": [ { "description": "The miter limit at which to bevel a line join.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeOffset": { "anyOf": [ { "description": "The offset in pixels at which to draw the group stroke and fill. If unspecified, the default behavior is to dynamically offset stroked groups such that 1 pixel stroke widths align with the pixel grid.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeOpacity": { "anyOf": [ { "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", "maximum": 1, "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeWidth": { "anyOf": [ { "description": "The stroke width, in pixels.", "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "style": { "anyOf": [ { "type": "string" }, { "items": { "type": "string" }, "type": "array" } ], "description": "A string or array of strings indicating the name of custom styles to apply to the mark. A style is a named collection of mark property defaults defined within the [style configuration](https://vega.github.io/vega-lite/docs/mark.html#style-config). If style is an array, later styles will override earlier styles. Any [mark properties](https://vega.github.io/vega-lite/docs/encoding.html#mark-prop) explicitly defined within the `encoding` will override a style default.\n\n__Default value:__ The mark's name. For example, a bar mark will have style `\"bar\"` by default. __Note:__ Any specified style will augment the default style. For example, a bar mark with `\"style\": \"foo\"` will receive from `config.style.bar` and `config.style.foo` (the specified style `\"foo\"` has higher precedence)." }, "tension": { "anyOf": [ { "description": "Depending on the interpolation type, sets the tension parameter (for line and area marks).", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "text": { "anyOf": [ { "$ref": "#/definitions/Text", "description": "Placeholder text if the `text` channel is not specified" }, { "$ref": "#/definitions/ExprRef" } ] }, "theta": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "- For arc marks, the arc length in radians if theta2 is not specified, otherwise the start arc angle. (A value of 0 indicates up or “north”, increasing values proceed clockwise.)\n\n- For text marks, polar coordinate angle in radians.", "maximum": 360, "minimum": 0 }, "theta2": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise." }, "theta2Offset": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Offset for theta2." }, "thetaOffset": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Offset for theta." }, "time": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "timeUnitBandPosition": { "description": "Default relative band position for a time unit. If set to `0`, the marks will be positioned at the beginning of the time unit band step. If set to `0.5`, the marks will be positioned in the middle of the time unit band step.", "type": "number" }, "timeUnitBandSize": { "description": "Default relative band size for a time unit. If set to `1`, the bandwidth of the marks will be equal to the time unit band step. If set to `0.5`, bandwidth of the marks will be half of the time unit band step.", "type": "number" }, "tooltip": { "anyOf": [ { "type": "number" }, { "type": "string" }, { "type": "boolean" }, { "$ref": "#/definitions/TooltipContent" }, { "$ref": "#/definitions/ExprRef" }, { "type": "null" } ], "description": "The tooltip text string to show upon mouse hover or an object defining which fields should the tooltip be derived from.\n\n- If `tooltip` is `true` or `{\"content\": \"encoding\"}`, then all fields from `encoding` will be used.\n- If `tooltip` is `{\"content\": \"data\"}`, then all fields that appear in the highlighted data point will be used.\n- If set to `null` or `false`, then no tooltip will be used.\n\nSee the [`tooltip`](https://vega.github.io/vega-lite/docs/tooltip.html) documentation for a detailed discussion about tooltip in Vega-Lite.\n\n__Default value:__ `null`" }, "url": { "anyOf": [ { "$ref": "#/definitions/URI", "description": "The URL of the image file for image marks." }, { "$ref": "#/definitions/ExprRef" } ] }, "width": { "anyOf": [ { "description": "Width of the marks.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "x": { "anyOf": [ { "type": "number" }, { "const": "width", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ], "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"` without specified `x2` or `width`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." }, "x2": { "anyOf": [ { "type": "number" }, { "const": "width", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ], "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." }, "x2Offset": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Offset for x2-position." }, "xOffset": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Offset for x-position." }, "y": { "anyOf": [ { "type": "number" }, { "const": "height", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"` without specified `y2` or `height`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." }, "y2": { "anyOf": [ { "type": "number" }, { "const": "height", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." }, "y2Offset": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Offset for y2-position." }, "yOffset": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Offset for y-position." } }, "type": "object" }, "Padding": { "anyOf": [ { "type": "number" }, { "additionalProperties": false, "properties": { "bottom": { "type": "number" }, "left": { "type": "number" }, "right": { "type": "number" }, "top": { "type": "number" } }, "type": "object" } ], "minimum": 0 }, "ParameterExtent": { "anyOf": [ { "additionalProperties": false, "properties": { "field": { "$ref": "#/definitions/FieldName", "description": "If a selection parameter is specified, the field name to extract selected values for when the selection is [projected](https://vega.github.io/vega-lite/docs/selection.html#project) over multiple fields or encodings." }, "param": { "$ref": "#/definitions/ParameterName", "description": "The name of a parameter." } }, "required": [ "param" ], "type": "object" }, { "additionalProperties": false, "properties": { "encoding": { "$ref": "#/definitions/SingleDefUnitChannel", "description": "If a selection parameter is specified, the encoding channel to extract selected values for when a selection is [projected](https://vega.github.io/vega-lite/docs/selection.html#project) over multiple fields or encodings." }, "param": { "$ref": "#/definitions/ParameterName", "description": "The name of a parameter." } }, "required": [ "param" ], "type": "object" } ] }, "ParameterName": { "type": "string" }, "ParameterPredicate": { "additionalProperties": false, "properties": { "empty": { "description": "For selection parameters, the predicate of empty selections returns true by default. Override this behavior, by setting this property `empty: false`.", "type": "boolean" }, "param": { "$ref": "#/definitions/ParameterName", "description": "Filter using a parameter name." } }, "required": [ "param" ], "type": "object" }, "Parse": { "additionalProperties": { "$ref": "#/definitions/ParseValue" }, "type": "object" }, "ParseValue": { "type": [ "string", "null" ] }, "PivotTransform": { "additionalProperties": false, "properties": { "groupby": { "description": "The optional data fields to group by. If not specified, a single group containing all data objects will be used.", "items": { "$ref": "#/definitions/FieldName" }, "type": "array" }, "limit": { "description": "An optional parameter indicating the maximum number of pivoted fields to generate. The default (`0`) applies no limit. The pivoted `pivot` names are sorted in ascending order prior to enforcing the limit. __Default value:__ `0`", "type": "number" }, "op": { "$ref": "#/definitions/AggregateOp", "description": "The aggregation operation to apply to grouped `value` field values. __Default value:__ `sum`" }, "pivot": { "$ref": "#/definitions/FieldName", "description": "The data field to pivot on. The unique values of this field become new field names in the output stream." }, "value": { "$ref": "#/definitions/FieldName", "description": "The data field to populate pivoted fields. The aggregate values of this field become the values of the new pivoted fields." } }, "required": [ "pivot", "value" ], "type": "object" }, "Point": { "additionalProperties": false, "description": "Point geometry object. https://tools.ietf.org/html/rfc7946#section-3.1.2", "properties": { "bbox": { "$ref": "#/definitions/BBox", "description": "Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. https://tools.ietf.org/html/rfc7946#section-5" }, "coordinates": { "$ref": "#/definitions/Position" }, "type": { "const": "Point", "description": "Specifies the type of GeoJSON object.", "type": "string" } }, "required": [ "coordinates", "type" ], "type": "object" }, "PointSelectionConfig": { "additionalProperties": false, "properties": { "clear": { "anyOf": [ { "$ref": "#/definitions/Stream" }, { "type": "string" }, { "type": "boolean" } ], "description": "Clears the selection, emptying it of all values. This property can be a [Event Stream](https://vega.github.io/vega/docs/event-streams/) or `false` to disable clear.\n\n__Default value:__ `dblclick`.\n\n__See also:__ [`clear` examples ](https://vega.github.io/vega-lite/docs/selection.html#clear) in the documentation." }, "encodings": { "description": "An array of encoding channels. The corresponding data field values must match for a data tuple to fall within the selection.\n\n__See also:__ The [projection with `encodings` and `fields` section](https://vega.github.io/vega-lite/docs/selection.html#project) in the documentation.", "items": { "$ref": "#/definitions/SingleDefUnitChannel" }, "type": "array" }, "fields": { "description": "An array of field names whose values must match for a data tuple to fall within the selection.\n\n__See also:__ The [projection with `encodings` and `fields` section](https://vega.github.io/vega-lite/docs/selection.html#project) in the documentation.", "items": { "$ref": "#/definitions/FieldName" }, "type": "array" }, "nearest": { "description": "When true, an invisible voronoi diagram is computed to accelerate discrete selection. The data value _nearest_ the mouse cursor is added to the selection.\n\n__Default value:__ `false`, which means that data values must be interacted with directly (e.g., clicked on) to be added to the selection.\n\n__See also:__ [`nearest` examples](https://vega.github.io/vega-lite/docs/selection.html#nearest) documentation.", "type": "boolean" }, "on": { "anyOf": [ { "$ref": "#/definitions/Stream" }, { "type": "string" } ], "description": "A [Vega event stream](https://vega.github.io/vega/docs/event-streams/) (object or selector) that triggers the selection. For interval selections, the event stream must specify a [start and end](https://vega.github.io/vega/docs/event-streams/#between-filters).\n\n__See also:__ [`on` examples](https://vega.github.io/vega-lite/docs/selection.html#on) in the documentation." }, "resolve": { "$ref": "#/definitions/SelectionResolution", "description": "With layered and multi-view displays, a strategy that determines how selections' data queries are resolved when applied in a filter transform, conditional encoding rule, or scale domain.\n\nOne of:\n- `\"global\"` -- only one brush exists for the entire SPLOM. When the user begins to drag, any previous brushes are cleared, and a new one is constructed.\n- `\"union\"` -- each cell contains its own brush, and points are highlighted if they lie within _any_ of these individual brushes.\n- `\"intersect\"` -- each cell contains its own brush, and points are highlighted only if they fall within _all_ of these individual brushes.\n\n__Default value:__ `global`.\n\n__See also:__ [`resolve` examples](https://vega.github.io/vega-lite/docs/selection.html#resolve) in the documentation." }, "toggle": { "description": "Controls whether data values should be toggled (inserted or removed from a point selection) or only ever inserted into point selections.\n\nOne of:\n- `true` -- the default behavior, which corresponds to `\"event.shiftKey\"`. As a result, data values are toggled when the user interacts with the shift-key pressed.\n- `false` -- disables toggling behaviour; the selection will only ever contain a single data value corresponding to the most recent interaction.\n- A [Vega expression](https://vega.github.io/vega/docs/expressions/) which is re-evaluated as the user interacts. If the expression evaluates to `true`, the data value is toggled into or out of the point selection. If the expression evaluates to `false`, the point selection is first cleared, and the data value is then inserted. For example, setting the value to the Vega expression `\"true\"` will toggle data values without the user pressing the shift-key.\n\n__Default value:__ `true`\n\n__See also:__ [`toggle` examples](https://vega.github.io/vega-lite/docs/selection.html#toggle) in the documentation.", "type": [ "string", "boolean" ] }, "type": { "const": "point", "description": "Determines the default event processing and data query for the selection. Vega-Lite currently supports two selection types:\n\n- `\"point\"` -- to select multiple discrete data values; the first value is selected on `click` and additional values toggled on shift-click.\n- `\"interval\"` -- to select a continuous range of data values on `drag`.", "type": "string" } }, "required": [ "type" ], "type": "object" }, "PointSelectionConfigWithoutType": { "additionalProperties": false, "properties": { "clear": { "anyOf": [ { "$ref": "#/definitions/Stream" }, { "type": "string" }, { "type": "boolean" } ], "description": "Clears the selection, emptying it of all values. This property can be a [Event Stream](https://vega.github.io/vega/docs/event-streams/) or `false` to disable clear.\n\n__Default value:__ `dblclick`.\n\n__See also:__ [`clear` examples ](https://vega.github.io/vega-lite/docs/selection.html#clear) in the documentation." }, "encodings": { "description": "An array of encoding channels. The corresponding data field values must match for a data tuple to fall within the selection.\n\n__See also:__ The [projection with `encodings` and `fields` section](https://vega.github.io/vega-lite/docs/selection.html#project) in the documentation.", "items": { "$ref": "#/definitions/SingleDefUnitChannel" }, "type": "array" }, "fields": { "description": "An array of field names whose values must match for a data tuple to fall within the selection.\n\n__See also:__ The [projection with `encodings` and `fields` section](https://vega.github.io/vega-lite/docs/selection.html#project) in the documentation.", "items": { "$ref": "#/definitions/FieldName" }, "type": "array" }, "nearest": { "description": "When true, an invisible voronoi diagram is computed to accelerate discrete selection. The data value _nearest_ the mouse cursor is added to the selection.\n\n__Default value:__ `false`, which means that data values must be interacted with directly (e.g., clicked on) to be added to the selection.\n\n__See also:__ [`nearest` examples](https://vega.github.io/vega-lite/docs/selection.html#nearest) documentation.", "type": "boolean" }, "on": { "anyOf": [ { "$ref": "#/definitions/Stream" }, { "type": "string" } ], "description": "A [Vega event stream](https://vega.github.io/vega/docs/event-streams/) (object or selector) that triggers the selection. For interval selections, the event stream must specify a [start and end](https://vega.github.io/vega/docs/event-streams/#between-filters).\n\n__See also:__ [`on` examples](https://vega.github.io/vega-lite/docs/selection.html#on) in the documentation." }, "resolve": { "$ref": "#/definitions/SelectionResolution", "description": "With layered and multi-view displays, a strategy that determines how selections' data queries are resolved when applied in a filter transform, conditional encoding rule, or scale domain.\n\nOne of:\n- `\"global\"` -- only one brush exists for the entire SPLOM. When the user begins to drag, any previous brushes are cleared, and a new one is constructed.\n- `\"union\"` -- each cell contains its own brush, and points are highlighted if they lie within _any_ of these individual brushes.\n- `\"intersect\"` -- each cell contains its own brush, and points are highlighted only if they fall within _all_ of these individual brushes.\n\n__Default value:__ `global`.\n\n__See also:__ [`resolve` examples](https://vega.github.io/vega-lite/docs/selection.html#resolve) in the documentation." }, "toggle": { "description": "Controls whether data values should be toggled (inserted or removed from a point selection) or only ever inserted into point selections.\n\nOne of:\n- `true` -- the default behavior, which corresponds to `\"event.shiftKey\"`. As a result, data values are toggled when the user interacts with the shift-key pressed.\n- `false` -- disables toggling behaviour; the selection will only ever contain a single data value corresponding to the most recent interaction.\n- A [Vega expression](https://vega.github.io/vega/docs/expressions/) which is re-evaluated as the user interacts. If the expression evaluates to `true`, the data value is toggled into or out of the point selection. If the expression evaluates to `false`, the point selection is first cleared, and the data value is then inserted. For example, setting the value to the Vega expression `\"true\"` will toggle data values without the user pressing the shift-key.\n\n__Default value:__ `true`\n\n__See also:__ [`toggle` examples](https://vega.github.io/vega-lite/docs/selection.html#toggle) in the documentation.", "type": [ "string", "boolean" ] } }, "type": "object" }, "PolarDef": { "anyOf": [ { "$ref": "#/definitions/PositionFieldDefBase" }, { "$ref": "#/definitions/PositionDatumDefBase" }, { "$ref": "#/definitions/PositionValueDef" } ] }, "Polygon": { "additionalProperties": false, "description": "Polygon geometry object. https://tools.ietf.org/html/rfc7946#section-3.1.6", "properties": { "bbox": { "$ref": "#/definitions/BBox", "description": "Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. https://tools.ietf.org/html/rfc7946#section-5" }, "coordinates": { "items": { "items": { "$ref": "#/definitions/Position" }, "type": "array" }, "type": "array" }, "type": { "const": "Polygon", "description": "Specifies the type of GeoJSON object.", "type": "string" } }, "required": [ "coordinates", "type" ], "type": "object" }, "Position": { "description": "A Position is an array of coordinates. https://tools.ietf.org/html/rfc7946#section-3.1.1 Array should contain between two and three elements. The previous GeoJSON specification allowed more elements (e.g., which could be used to represent M values), but the current specification only allows X, Y, and (optionally) Z to be defined.", "items": { "type": "number" }, "type": "array" }, "Position2Def": { "anyOf": [ { "$ref": "#/definitions/SecondaryFieldDef" }, { "$ref": "#/definitions/DatumDef" }, { "$ref": "#/definitions/PositionValueDef" } ] }, "PositionDatumDef": { "additionalProperties": false, "properties": { "axis": { "anyOf": [ { "$ref": "#/definitions/Axis" }, { "type": "null" } ], "description": "An object defining properties of axis's gridlines, ticks and labels. If `null`, the axis for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [axis properties](https://vega.github.io/vega-lite/docs/axis.html) are applied.\n\n__See also:__ [`axis`](https://vega.github.io/vega-lite/docs/axis.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "datum": { "anyOf": [ { "$ref": "#/definitions/PrimitiveValue" }, { "$ref": "#/definitions/DateTime" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/RepeatRef" } ], "description": "A constant value in data domain." }, "impute": { "anyOf": [ { "$ref": "#/definitions/ImputeParams" }, { "type": "null" } ], "description": "An object defining the properties of the Impute Operation to be applied. The field value of the other positional channel is taken as `key` of the `Impute` Operation. The field of the `color` channel if specified is used as `groupby` of the `Impute` Operation.\n\n__See also:__ [`impute`](https://vega.github.io/vega-lite/docs/impute.html) documentation." }, "scale": { "anyOf": [ { "$ref": "#/definitions/Scale" }, { "type": "null" } ], "description": "An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." }, "stack": { "anyOf": [ { "$ref": "#/definitions/StackOffset" }, { "type": "null" }, { "type": "boolean" } ], "description": "Type of stacking offset if the field should be stacked. `stack` is only applicable for `x`, `y`, `theta`, and `radius` channels with continuous domains. For example, `stack` of `y` can be used to customize stacking for a vertical bar chart.\n\n`stack` can be one of the following values:\n- `\"zero\"` or `true`: stacking with baseline offset at zero value of the scale (for creating typical stacked [bar](https://vega.github.io/vega-lite/docs/stack.html#bar) and [area](https://vega.github.io/vega-lite/docs/stack.html#area) chart).\n- `\"normalize\"` - stacking with normalized domain (for creating [normalized stacked bar and area charts](https://vega.github.io/vega-lite/docs/stack.html#normalized) and pie charts [with percentage tooltip](https://vega.github.io/vega-lite/docs/arc.html#tooltip)).
\n-`\"center\"` - stacking with center baseline (for [streamgraph](https://vega.github.io/vega-lite/docs/stack.html#streamgraph)).\n- `null` or `false` - No-stacking. This will produce layered [bar](https://vega.github.io/vega-lite/docs/stack.html#layered-bar-chart) and area chart.\n\n__Default value:__ `zero` for plots with all of the following conditions are true: (1) the mark is `bar`, `area`, or `arc`; (2) the stacked measure channel (x or y) has a linear scale; (3) At least one of non-position channels mapped to an unaggregated field that is different from x and y. Otherwise, `null` by default.\n\n__See also:__ [`stack`](https://vega.github.io/vega-lite/docs/stack.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "$ref": "#/definitions/Type", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } }, "type": "object" }, "PositionDatumDefBase": { "additionalProperties": false, "properties": { "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "datum": { "anyOf": [ { "$ref": "#/definitions/PrimitiveValue" }, { "$ref": "#/definitions/DateTime" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/RepeatRef" } ], "description": "A constant value in data domain." }, "scale": { "anyOf": [ { "$ref": "#/definitions/Scale" }, { "type": "null" } ], "description": "An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." }, "stack": { "anyOf": [ { "$ref": "#/definitions/StackOffset" }, { "type": "null" }, { "type": "boolean" } ], "description": "Type of stacking offset if the field should be stacked. `stack` is only applicable for `x`, `y`, `theta`, and `radius` channels with continuous domains. For example, `stack` of `y` can be used to customize stacking for a vertical bar chart.\n\n`stack` can be one of the following values:\n- `\"zero\"` or `true`: stacking with baseline offset at zero value of the scale (for creating typical stacked [bar](https://vega.github.io/vega-lite/docs/stack.html#bar) and [area](https://vega.github.io/vega-lite/docs/stack.html#area) chart).\n- `\"normalize\"` - stacking with normalized domain (for creating [normalized stacked bar and area charts](https://vega.github.io/vega-lite/docs/stack.html#normalized) and pie charts [with percentage tooltip](https://vega.github.io/vega-lite/docs/arc.html#tooltip)).
\n-`\"center\"` - stacking with center baseline (for [streamgraph](https://vega.github.io/vega-lite/docs/stack.html#streamgraph)).\n- `null` or `false` - No-stacking. This will produce layered [bar](https://vega.github.io/vega-lite/docs/stack.html#layered-bar-chart) and area chart.\n\n__Default value:__ `zero` for plots with all of the following conditions are true: (1) the mark is `bar`, `area`, or `arc`; (2) the stacked measure channel (x or y) has a linear scale; (3) At least one of non-position channels mapped to an unaggregated field that is different from x and y. Otherwise, `null` by default.\n\n__See also:__ [`stack`](https://vega.github.io/vega-lite/docs/stack.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "$ref": "#/definitions/Type", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } }, "type": "object" }, "PositionDef": { "anyOf": [ { "$ref": "#/definitions/PositionFieldDef" }, { "$ref": "#/definitions/PositionDatumDef" }, { "$ref": "#/definitions/PositionValueDef" } ] }, "PositionFieldDef": { "additionalProperties": false, "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "axis": { "anyOf": [ { "$ref": "#/definitions/Axis" }, { "type": "null" } ], "description": "An object defining properties of axis's gridlines, ticks and labels. If `null`, the axis for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [axis properties](https://vega.github.io/vega-lite/docs/axis.html) are applied.\n\n__See also:__ [`axis`](https://vega.github.io/vega-lite/docs/axis.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/BinParams" }, { "const": "binned", "type": "string" }, { "type": "null" } ], "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "impute": { "anyOf": [ { "$ref": "#/definitions/ImputeParams" }, { "type": "null" } ], "description": "An object defining the properties of the Impute Operation to be applied. The field value of the other positional channel is taken as `key` of the `Impute` Operation. The field of the `color` channel if specified is used as `groupby` of the `Impute` Operation.\n\n__See also:__ [`impute`](https://vega.github.io/vega-lite/docs/impute.html) documentation." }, "scale": { "anyOf": [ { "$ref": "#/definitions/Scale" }, { "type": "null" } ], "description": "An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." }, "sort": { "$ref": "#/definitions/Sort", "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript.\n- [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`.\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." }, "stack": { "anyOf": [ { "$ref": "#/definitions/StackOffset" }, { "type": "null" }, { "type": "boolean" } ], "description": "Type of stacking offset if the field should be stacked. `stack` is only applicable for `x`, `y`, `theta`, and `radius` channels with continuous domains. For example, `stack` of `y` can be used to customize stacking for a vertical bar chart.\n\n`stack` can be one of the following values:\n- `\"zero\"` or `true`: stacking with baseline offset at zero value of the scale (for creating typical stacked [bar](https://vega.github.io/vega-lite/docs/stack.html#bar) and [area](https://vega.github.io/vega-lite/docs/stack.html#area) chart).\n- `\"normalize\"` - stacking with normalized domain (for creating [normalized stacked bar and area charts](https://vega.github.io/vega-lite/docs/stack.html#normalized) and pie charts [with percentage tooltip](https://vega.github.io/vega-lite/docs/arc.html#tooltip)).
\n-`\"center\"` - stacking with center baseline (for [streamgraph](https://vega.github.io/vega-lite/docs/stack.html#streamgraph)).\n- `null` or `false` - No-stacking. This will produce layered [bar](https://vega.github.io/vega-lite/docs/stack.html#layered-bar-chart) and area chart.\n\n__Default value:__ `zero` for plots with all of the following conditions are true: (1) the mark is `bar`, `area`, or `arc`; (2) the stacked measure channel (x or y) has a linear scale; (3) At least one of non-position channels mapped to an unaggregated field that is different from x and y. Otherwise, `null` by default.\n\n__See also:__ [`stack`](https://vega.github.io/vega-lite/docs/stack.html) documentation." }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "$ref": "#/definitions/StandardType", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } }, "type": "object" }, "PositionFieldDefBase": { "additionalProperties": false, "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/BinParams" }, { "const": "binned", "type": "string" }, { "type": "null" } ], "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "scale": { "anyOf": [ { "$ref": "#/definitions/Scale" }, { "type": "null" } ], "description": "An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." }, "sort": { "$ref": "#/definitions/Sort", "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript.\n- [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`.\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." }, "stack": { "anyOf": [ { "$ref": "#/definitions/StackOffset" }, { "type": "null" }, { "type": "boolean" } ], "description": "Type of stacking offset if the field should be stacked. `stack` is only applicable for `x`, `y`, `theta`, and `radius` channels with continuous domains. For example, `stack` of `y` can be used to customize stacking for a vertical bar chart.\n\n`stack` can be one of the following values:\n- `\"zero\"` or `true`: stacking with baseline offset at zero value of the scale (for creating typical stacked [bar](https://vega.github.io/vega-lite/docs/stack.html#bar) and [area](https://vega.github.io/vega-lite/docs/stack.html#area) chart).\n- `\"normalize\"` - stacking with normalized domain (for creating [normalized stacked bar and area charts](https://vega.github.io/vega-lite/docs/stack.html#normalized) and pie charts [with percentage tooltip](https://vega.github.io/vega-lite/docs/arc.html#tooltip)).
\n-`\"center\"` - stacking with center baseline (for [streamgraph](https://vega.github.io/vega-lite/docs/stack.html#streamgraph)).\n- `null` or `false` - No-stacking. This will produce layered [bar](https://vega.github.io/vega-lite/docs/stack.html#layered-bar-chart) and area chart.\n\n__Default value:__ `zero` for plots with all of the following conditions are true: (1) the mark is `bar`, `area`, or `arc`; (2) the stacked measure channel (x or y) has a linear scale; (3) At least one of non-position channels mapped to an unaggregated field that is different from x and y. Otherwise, `null` by default.\n\n__See also:__ [`stack`](https://vega.github.io/vega-lite/docs/stack.html) documentation." }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "$ref": "#/definitions/StandardType", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } }, "type": "object" }, "PositionValueDef": { "$ref": "#/definitions/ValueDef<(number|\"width\"|\"height\"|ExprRef)>" }, "Predicate": { "anyOf": [ { "$ref": "#/definitions/FieldEqualPredicate" }, { "$ref": "#/definitions/FieldRangePredicate" }, { "$ref": "#/definitions/FieldOneOfPredicate" }, { "$ref": "#/definitions/FieldLTPredicate" }, { "$ref": "#/definitions/FieldGTPredicate" }, { "$ref": "#/definitions/FieldLTEPredicate" }, { "$ref": "#/definitions/FieldGTEPredicate" }, { "$ref": "#/definitions/FieldValidPredicate" }, { "$ref": "#/definitions/ParameterPredicate" }, { "type": "string" } ] }, "PrimitiveValue": { "type": [ "number", "string", "boolean", "null" ] }, "Projection": { "additionalProperties": false, "properties": { "center": { "anyOf": [ { "$ref": "#/definitions/Vector2", "description": "The projection's center, a two-element array of longitude and latitude in degrees.\n\n__Default value:__ `[0, 0]`" }, { "$ref": "#/definitions/ExprRef" } ] }, "clipAngle": { "anyOf": [ { "description": "The projection's clipping circle radius to the specified angle in degrees. If `null`, switches to [antimeridian](http://bl.ocks.org/mbostock/3788999) cutting rather than small-circle clipping.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "clipExtent": { "anyOf": [ { "$ref": "#/definitions/Vector2>", "description": "The projection's viewport clip extent to the specified bounds in pixels. The extent bounds are specified as an array `[[x0, y0], [x1, y1]]`, where `x0` is the left-side of the viewport, `y0` is the top, `x1` is the right and `y1` is the bottom. If `null`, no viewport clipping is performed." }, { "$ref": "#/definitions/ExprRef" } ] }, "coefficient": { "anyOf": [ { "description": "The coefficient parameter for the `hammer` projection.\n\n__Default value:__ `2`", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "distance": { "anyOf": [ { "description": "For the `satellite` projection, the distance from the center of the sphere to the point of view, as a proportion of the sphere’s radius. The recommended maximum clip angle for a given `distance` is acos(1 / distance) converted to degrees. If tilt is also applied, then more conservative clipping may be necessary.\n\n__Default value:__ `2.0`", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "extent": { "anyOf": [ { "$ref": "#/definitions/Vector2>" }, { "$ref": "#/definitions/ExprRef" } ] }, "fit": { "anyOf": [ { "$ref": "#/definitions/Fit" }, { "items": { "$ref": "#/definitions/Fit" }, "type": "array" }, { "$ref": "#/definitions/ExprRef" } ] }, "fraction": { "anyOf": [ { "description": "The fraction parameter for the `bottomley` projection.\n\n__Default value:__ `0.5`, corresponding to a sin(ψ) where ψ = π/6.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "lobes": { "anyOf": [ { "description": "The number of lobes in projections that support multi-lobe views: `berghaus`, `gingery`, or `healpix`. The default value varies based on the projection type.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "parallel": { "anyOf": [ { "description": "The parallel parameter for projections that support it: `armadillo`, `bonne`, `craig`, `cylindricalEqualArea`, `cylindricalStereographic`, `hammerRetroazimuthal`, `loximuthal`, or `rectangularPolyconic`. The default value varies based on the projection type.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "parallels": { "anyOf": [ { "description": "For conic projections, the [two standard parallels](https://en.wikipedia.org/wiki/Map_projection#Conic) that define the map layout. The default depends on the specific conic projection used.", "items": { "type": "number" }, "type": "array" }, { "$ref": "#/definitions/ExprRef" } ] }, "pointRadius": { "anyOf": [ { "description": "The default radius (in pixels) to use when drawing GeoJSON `Point` and `MultiPoint` geometries. This parameter sets a constant default value. To modify the point radius in response to data, see the corresponding parameter of the GeoPath and GeoShape transforms.\n\n__Default value:__ `4.5`", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "precision": { "anyOf": [ { "description": "The threshold for the projection's [adaptive resampling](http://bl.ocks.org/mbostock/3795544) to the specified value in pixels. This value corresponds to the [Douglas–Peucker distance](http://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm). If precision is not specified, returns the projection's current resampling precision which defaults to `√0.5 ≅ 0.70710…`.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "radius": { "anyOf": [ { "description": "The radius parameter for the `airy` or `gingery` projection. The default value varies based on the projection type.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "ratio": { "anyOf": [ { "description": "The ratio parameter for the `hill`, `hufnagel`, or `wagner` projections. The default value varies based on the projection type.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "reflectX": { "anyOf": [ { "description": "Sets whether or not the x-dimension is reflected (negated) in the output.", "type": "boolean" }, { "$ref": "#/definitions/ExprRef" } ] }, "reflectY": { "anyOf": [ { "description": "Sets whether or not the y-dimension is reflected (negated) in the output.", "type": "boolean" }, { "$ref": "#/definitions/ExprRef" } ] }, "rotate": { "anyOf": [ { "anyOf": [ { "$ref": "#/definitions/Vector2" }, { "$ref": "#/definitions/Vector3" } ], "description": "The projection's three-axis rotation to the specified angles, which must be a two- or three-element array of numbers [`lambda`, `phi`, `gamma`] specifying the rotation angles in degrees about each spherical axis. (These correspond to yaw, pitch and roll.)\n\n__Default value:__ `[0, 0, 0]`" }, { "$ref": "#/definitions/ExprRef" } ] }, "scale": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The projection’s scale (zoom) factor, overriding automatic fitting. The default scale is projection-specific. The scale factor corresponds linearly to the distance between projected points; however, scale factor values are not equivalent across projections." }, "size": { "anyOf": [ { "$ref": "#/definitions/Vector2", "description": "Used in conjunction with fit, provides the width and height in pixels of the area to which the projection should be automatically fit." }, { "$ref": "#/definitions/ExprRef" } ] }, "spacing": { "anyOf": [ { "description": "The spacing parameter for the `lagrange` projection.\n\n__Default value:__ `0.5`", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "tilt": { "anyOf": [ { "description": "The tilt angle (in degrees) for the `satellite` projection.\n\n__Default value:__ `0`.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "translate": { "anyOf": [ { "$ref": "#/definitions/Vector2" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The projection’s translation offset as a two-element array `[tx, ty]`." }, "type": { "anyOf": [ { "$ref": "#/definitions/ProjectionType" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The cartographic projection to use. This value is case-insensitive, for example `\"albers\"` and `\"Albers\"` indicate the same projection type. You can find all valid projection types [in the documentation](https://vega.github.io/vega-lite/docs/projection.html#projection-types).\n\n__Default value:__ `equalEarth`" } }, "type": "object" }, "ProjectionConfig": { "$ref": "#/definitions/Projection", "description": "Any property of Projection can be in config" }, "ProjectionType": { "enum": [ "albers", "albersUsa", "azimuthalEqualArea", "azimuthalEquidistant", "conicConformal", "conicEqualArea", "conicEquidistant", "equalEarth", "equirectangular", "gnomonic", "identity", "mercator", "naturalEarth1", "orthographic", "stereographic", "transverseMercator" ], "type": "string" }, "QuantileTransform": { "additionalProperties": false, "properties": { "as": { "description": "The output field names for the probability and quantile values.\n\n__Default value:__ `[\"prob\", \"value\"]`", "items": { "$ref": "#/definitions/FieldName" }, "maxItems": 2, "minItems": 2, "type": "array" }, "groupby": { "description": "The data fields to group by. If not specified, a single group containing all data objects will be used.", "items": { "$ref": "#/definitions/FieldName" }, "type": "array" }, "probs": { "description": "An array of probabilities in the range (0, 1) for which to compute quantile values. If not specified, the *step* parameter will be used.", "items": { "type": "number" }, "type": "array" }, "quantile": { "$ref": "#/definitions/FieldName", "description": "The data field for which to perform quantile estimation." }, "step": { "description": "A probability step size (default 0.01) for sampling quantile values. All values from one-half the step size up to 1 (exclusive) will be sampled. This parameter is only used if the *probs* parameter is not provided.", "type": "number" } }, "required": [ "quantile" ], "type": "object" }, "RadialGradient": { "additionalProperties": false, "properties": { "gradient": { "const": "radial", "description": "The type of gradient. Use `\"radial\"` for a radial gradient.", "type": "string" }, "id": { "type": "string" }, "r1": { "description": "The radius length, in normalized [0, 1] coordinates, of the inner circle for the gradient.\n\n__Default value:__ `0`", "type": "number" }, "r2": { "description": "The radius length, in normalized [0, 1] coordinates, of the outer circle for the gradient.\n\n__Default value:__ `0.5`", "type": "number" }, "stops": { "description": "An array of gradient stops defining the gradient color sequence.", "items": { "$ref": "#/definitions/GradientStop" }, "type": "array" }, "x1": { "description": "The x-coordinate, in normalized [0, 1] coordinates, for the center of the inner circle for the gradient.\n\n__Default value:__ `0.5`", "type": "number" }, "x2": { "description": "The x-coordinate, in normalized [0, 1] coordinates, for the center of the outer circle for the gradient.\n\n__Default value:__ `0.5`", "type": "number" }, "y1": { "description": "The y-coordinate, in normalized [0, 1] coordinates, for the center of the inner circle for the gradient.\n\n__Default value:__ `0.5`", "type": "number" }, "y2": { "description": "The y-coordinate, in normalized [0, 1] coordinates, for the center of the outer circle for the gradient.\n\n__Default value:__ `0.5`", "type": "number" } }, "required": [ "gradient", "stops" ], "type": "object" }, "RangeConfig": { "additionalProperties": { "anyOf": [ { "$ref": "#/definitions/RangeScheme" }, { "type": "array" } ] }, "properties": { "category": { "anyOf": [ { "$ref": "#/definitions/RangeScheme" }, { "items": { "$ref": "#/definitions/Color" }, "type": "array" } ], "description": "Default [color scheme](https://vega.github.io/vega/docs/schemes/) for categorical data." }, "diverging": { "anyOf": [ { "$ref": "#/definitions/RangeScheme" }, { "items": { "$ref": "#/definitions/Color" }, "type": "array" } ], "description": "Default [color scheme](https://vega.github.io/vega/docs/schemes/) for diverging quantitative ramps." }, "heatmap": { "anyOf": [ { "$ref": "#/definitions/RangeScheme" }, { "items": { "$ref": "#/definitions/Color" }, "type": "array" } ], "description": "Default [color scheme](https://vega.github.io/vega/docs/schemes/) for quantitative heatmaps." }, "ordinal": { "anyOf": [ { "$ref": "#/definitions/RangeScheme" }, { "items": { "$ref": "#/definitions/Color" }, "type": "array" } ], "description": "Default [color scheme](https://vega.github.io/vega/docs/schemes/) for rank-ordered data." }, "ramp": { "anyOf": [ { "$ref": "#/definitions/RangeScheme" }, { "items": { "$ref": "#/definitions/Color" }, "type": "array" } ], "description": "Default [color scheme](https://vega.github.io/vega/docs/schemes/) for sequential quantitative ramps." }, "symbol": { "description": "Array of [symbol](https://vega.github.io/vega/docs/marks/symbol/) names or paths for the default shape palette.", "items": { "$ref": "#/definitions/SymbolShape" }, "type": "array" } }, "type": "object" }, "RangeEnum": { "enum": [ "width", "height", "symbol", "category", "ordinal", "ramp", "diverging", "heatmap" ], "type": "string" }, "RangeRaw": { "items": { "anyOf": [ { "type": "null" }, { "type": "boolean" }, { "type": "string" }, { "type": "number" }, { "$ref": "#/definitions/RangeRawArray" } ] }, "type": "array" }, "RangeRawArray": { "items": { "type": "number" }, "type": "array" }, "RangeScheme": { "anyOf": [ { "$ref": "#/definitions/RangeEnum" }, { "$ref": "#/definitions/RangeRaw" }, { "additionalProperties": false, "properties": { "count": { "type": "number" }, "extent": { "items": { "type": "number" }, "type": "array" }, "scheme": { "anyOf": [ { "type": "string" }, { "items": { "type": "string" }, "type": "array" }, { "$ref": "#/definitions/ColorScheme" } ] } }, "required": [ "scheme" ], "type": "object" } ] }, "RectConfig": { "additionalProperties": false, "properties": { "align": { "anyOf": [ { "$ref": "#/definitions/Align" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of `\"left\"`, `\"right\"`, `\"center\"`.\n\n__Note:__ Expression reference is *not* supported for range marks." }, "angle": { "anyOf": [ { "description": "The rotation angle of the text, in degrees.", "maximum": 360, "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "aria": { "anyOf": [ { "description": "A boolean flag indicating if [ARIA attributes](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) should be included (SVG output only). If `false`, the \"aria-hidden\" attribute will be set on the output SVG element, removing the mark item from the ARIA accessibility tree.", "type": "boolean" }, { "$ref": "#/definitions/ExprRef" } ] }, "ariaRole": { "anyOf": [ { "description": "Sets the type of user interface element of the mark item for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only). If specified, this property determines the \"role\" attribute. Warning: this property is experimental and may be changed in the future.", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "ariaRoleDescription": { "anyOf": [ { "description": "A human-readable, author-localized description for the role of the mark item for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only). If specified, this property determines the \"aria-roledescription\" attribute. Warning: this property is experimental and may be changed in the future.", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "aspect": { "anyOf": [ { "description": "Whether to keep aspect ratio of image marks.", "type": "boolean" }, { "$ref": "#/definitions/ExprRef" } ] }, "baseline": { "anyOf": [ { "$ref": "#/definitions/TextBaseline" }, { "$ref": "#/definitions/ExprRef" } ], "description": "For text marks, the vertical text baseline. One of `\"alphabetic\"` (default), `\"top\"`, `\"middle\"`, `\"bottom\"`, `\"line-top\"`, `\"line-bottom\"`, or an expression reference that provides one of the valid values. The `\"line-top\"` and `\"line-bottom\"` values operate similarly to `\"top\"` and `\"bottom\"`, but are calculated relative to the `lineHeight` rather than `fontSize` alone.\n\nFor range marks, the vertical alignment of the marks. One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Note:__ Expression reference is *not* supported for range marks." }, "binSpacing": { "description": "Offset between bars for binned field. The ideal value for this is either 0 (preferred by statisticians) or 1 (Vega-Lite default, D3 example style).\n\n__Default value:__ `1`", "minimum": 0, "type": "number" }, "blend": { "anyOf": [ { "$ref": "#/definitions/Blend", "description": "The color blend mode for drawing an item on its current background. Any valid [CSS mix-blend-mode](https://developer.mozilla.org/en-US/docs/Web/CSS/mix-blend-mode) value can be used.\n\n__Default value: `\"source-over\"`" }, { "$ref": "#/definitions/ExprRef" } ] }, "color": { "anyOf": [ { "$ref": "#/definitions/Color" }, { "$ref": "#/definitions/Gradient" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Default color.\n\n__Default value:__ `\"#4682b4\"`\n\n__Note:__\n- This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).\n- The `fill` and `stroke` properties have higher precedence than `color` and will override `color`." }, "continuousBandSize": { "description": "The default size of the bars on continuous scales.\n\n__Default value:__ `5`", "minimum": 0, "type": "number" }, "cornerRadius": { "anyOf": [ { "description": "The radius in pixels of rounded rectangles or arcs' corners.\n\n__Default value:__ `0`", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "cornerRadiusBottomLeft": { "anyOf": [ { "description": "The radius in pixels of rounded rectangles' bottom left corner.\n\n__Default value:__ `0`", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "cornerRadiusBottomRight": { "anyOf": [ { "description": "The radius in pixels of rounded rectangles' bottom right corner.\n\n__Default value:__ `0`", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "cornerRadiusTopLeft": { "anyOf": [ { "description": "The radius in pixels of rounded rectangles' top right corner.\n\n__Default value:__ `0`", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "cornerRadiusTopRight": { "anyOf": [ { "description": "The radius in pixels of rounded rectangles' top left corner.\n\n__Default value:__ `0`", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "cursor": { "anyOf": [ { "$ref": "#/definitions/Cursor", "description": "The mouse cursor used over the mark. Any valid [CSS cursor type](https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values) can be used." }, { "$ref": "#/definitions/ExprRef" } ] }, "description": { "anyOf": [ { "description": "A text description of the mark item for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only). If specified, this property determines the [\"aria-label\" attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute).", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "dir": { "anyOf": [ { "$ref": "#/definitions/TextDirection", "description": "The direction of the text. One of `\"ltr\"` (left-to-right) or `\"rtl\"` (right-to-left). This property determines on which side is truncated in response to the limit parameter.\n\n__Default value:__ `\"ltr\"`" }, { "$ref": "#/definitions/ExprRef" } ] }, "discreteBandSize": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/RelativeBandSize" } ], "description": "The default size of the bars with discrete dimensions. If unspecified, the default size is `step-2`, which provides 2 pixel offset between bars.", "minimum": 0 }, "dx": { "anyOf": [ { "description": "The horizontal offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "dy": { "anyOf": [ { "description": "The vertical offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "ellipsis": { "anyOf": [ { "description": "The ellipsis string for text truncated in response to the limit parameter.\n\n__Default value:__ `\"…\"`", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "endAngle": { "anyOf": [ { "description": "The end angle in radians for arc marks. A value of `0` indicates up (north), increasing values proceed clockwise.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "fill": { "anyOf": [ { "$ref": "#/definitions/Color" }, { "$ref": "#/definitions/Gradient" }, { "type": "null" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Default fill color. This property has higher precedence than `config.color`. Set to `null` to remove fill.\n\n__Default value:__ (None)" }, "fillOpacity": { "anyOf": [ { "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", "maximum": 1, "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "filled": { "description": "Whether the mark's color should be used as fill color instead of stroke color.\n\n__Default value:__ `false` for all `point`, `line`, and `rule` marks as well as `geoshape` marks for [`graticule`](https://vega.github.io/vega-lite/docs/data.html#graticule) data sources; otherwise, `true`.\n\n__Note:__ This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).", "type": "boolean" }, "font": { "anyOf": [ { "description": "The typeface to set the text in (e.g., `\"Helvetica Neue\"`).", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "fontSize": { "anyOf": [ { "description": "The font size, in pixels.\n\n__Default value:__ `11`", "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "fontStyle": { "anyOf": [ { "$ref": "#/definitions/FontStyle", "description": "The font style (e.g., `\"italic\"`)." }, { "$ref": "#/definitions/ExprRef" } ] }, "fontWeight": { "anyOf": [ { "$ref": "#/definitions/FontWeight", "description": "The font weight. This can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." }, { "$ref": "#/definitions/ExprRef" } ] }, "height": { "anyOf": [ { "description": "Height of the marks.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "href": { "anyOf": [ { "$ref": "#/definitions/URI", "description": "A URL to load upon mouse click. If defined, the mark acts as a hyperlink." }, { "$ref": "#/definitions/ExprRef" } ] }, "innerRadius": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The inner radius in pixels of arc marks. `innerRadius` is an alias for `radius2`.\n\n__Default value:__ `0`", "minimum": 0 }, "interpolate": { "anyOf": [ { "$ref": "#/definitions/Interpolate", "description": "The line interpolation method to use for line and area marks. One of the following:\n- `\"linear\"`: piecewise linear segments, as in a polyline.\n- `\"linear-closed\"`: close the linear segments to form a polygon.\n- `\"step\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"step-before\"`: alternate between vertical and horizontal segments, as in a step function.\n- `\"step-after\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"basis\"`: a B-spline, with control point duplication on the ends.\n- `\"basis-open\"`: an open B-spline; may not intersect the start or end.\n- `\"basis-closed\"`: a closed B-spline, as in a loop.\n- `\"cardinal\"`: a Cardinal spline, with control point duplication on the ends.\n- `\"cardinal-open\"`: an open Cardinal spline; may not intersect the start or end, but will intersect other control points.\n- `\"cardinal-closed\"`: a closed Cardinal spline, as in a loop.\n- `\"bundle\"`: equivalent to basis, except the tension parameter is used to straighten the spline.\n- `\"monotone\"`: cubic interpolation that preserves monotonicity in y." }, { "$ref": "#/definitions/ExprRef" } ] }, "invalid": { "anyOf": [ { "$ref": "#/definitions/MarkInvalidDataMode" }, { "type": "null" } ], "description": "Invalid data mode, which defines how the marks and corresponding scales should represent invalid values (`null` and `NaN` in continuous scales *without* defined output for invalid values).\n\n- `\"filter\"` — *Exclude* all invalid values from the visualization's *marks* and *scales*. For path marks (for line, area, trail), this option will create paths that connect valid points, as if the data rows with invalid values do not exist.\n\n- `\"break-paths-filter-domains\"` — Break path marks (for line, area, trail) at invalid values. For non-path marks, this is equivalent to `\"filter\"`. All *scale* domains will *exclude* these filtered data points.\n\n- `\"break-paths-show-domains\"` — Break paths (for line, area, trail) at invalid values. Hide invalid values for non-path marks. All *scale* domains will *include* these filtered data points (for both path and non-path marks).\n\n- `\"show\"` or `null` — Show all data points in the marks and scale domains. Each scale will use the output for invalid values defined in `config.scale.invalid` or, if unspecified, by default invalid values will produce the same visual values as zero (if the scale includes zero) or the minimum value (if the scale does not include zero).\n\n- `\"break-paths-show-path-domains\"` (default) — This is equivalent to `\"break-paths-show-domains\"` for path-based marks (line/area/trail) and `\"filter\"` for non-path marks.\n\n__Note__: If any channel's scale has an output for invalid values defined in `config.scale.invalid`, all values for the scales will be considered \"valid\" since they can produce a reasonable output for the scales. Thus, fields for such channels will not be filtered and will not cause path breaks." }, "limit": { "anyOf": [ { "description": "The maximum length of the text mark in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.\n\n__Default value:__ `0` -- indicating no limit", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "lineBreak": { "anyOf": [ { "description": "A delimiter, such as a newline character, upon which to break text strings into multiple lines. This property is ignored if the text is array-valued.", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "lineHeight": { "anyOf": [ { "description": "The line height in pixels (the spacing between subsequent lines of text) for multi-line text marks.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "minBandSize": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The minimum band size for bar and rectangle marks. __Default value:__ `0.25`" }, "opacity": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The overall opacity (value between [0,1]).\n\n__Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or `square` marks or layered `bar` charts and `1` otherwise.", "maximum": 1, "minimum": 0 }, "order": { "description": "For line and trail marks, this `order` property can be set to `null` or `false` to make the lines use the original order in the data sources.", "type": [ "null", "boolean" ] }, "orient": { "$ref": "#/definitions/Orientation", "description": "The orientation of a non-stacked bar, tick, area, and line charts. The value is either horizontal (default) or vertical.\n- For bar, rule and tick, this determines whether the size of the bar and tick should be applied to x or y dimension.\n- For area, this property determines the orient property of the Vega output.\n- For line and trail marks, this property determines the sort order of the points in the line if `config.sortLineBy` is not specified. For stacked charts, this is always determined by the orientation of the stack; therefore explicitly specified value will be ignored." }, "outerRadius": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The outer radius in pixels of arc marks. `outerRadius` is an alias for `radius`.\n\n__Default value:__ `0`", "minimum": 0 }, "padAngle": { "anyOf": [ { "description": "The angular padding applied to sides of the arc, in radians.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "radius": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "For arc mark, the primary (outer) radius in pixels.\n\nFor text marks, polar coordinate radial offset, in pixels, of the text from the origin determined by the `x` and `y` properties.\n\n__Default value:__ `min(plot_width, plot_height)/2`", "minimum": 0 }, "radius2": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The secondary (inner) radius in pixels of arc marks.\n\n__Default value:__ `0`", "minimum": 0 }, "shape": { "anyOf": [ { "anyOf": [ { "$ref": "#/definitions/SymbolShape" }, { "type": "string" } ], "description": "Shape of the point marks. Supported values include:\n- plotting shapes: `\"circle\"`, `\"square\"`, `\"cross\"`, `\"diamond\"`, `\"triangle-up\"`, `\"triangle-down\"`, `\"triangle-right\"`, or `\"triangle-left\"`.\n- the line symbol `\"stroke\"`\n- centered directional shapes `\"arrow\"`, `\"wedge\"`, or `\"triangle\"`\n- a custom [SVG path string](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths) (For correct sizing, custom shape paths should be defined within a square bounding box with coordinates ranging from -1 to 1 along both the x and y dimensions.)\n\n__Default value:__ `\"circle\"`" }, { "$ref": "#/definitions/ExprRef" } ] }, "size": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Default size for marks.\n- For `point`/`circle`/`square`, this represents the pixel area of the marks. Note that this value sets the area of the symbol; the side lengths will increase with the square root of this value.\n- For `bar`, this represents the band size of the bar, in pixels.\n- For `text`, this represents the font size, in pixels.\n\n__Default value:__\n- `30` for point, circle, square marks; width/height's `step`\n- `2` for bar marks with discrete dimensions;\n- `5` for bar marks with continuous dimensions;\n- `11` for text marks.", "minimum": 0 }, "smooth": { "anyOf": [ { "description": "A boolean flag (default true) indicating if the image should be smoothed when resized. If false, individual pixels should be scaled directly rather than interpolated with smoothing. For SVG rendering, this option may not work in some browsers due to lack of standardization.", "type": "boolean" }, { "$ref": "#/definitions/ExprRef" } ] }, "startAngle": { "anyOf": [ { "description": "The start angle in radians for arc marks. A value of `0` indicates up (north), increasing values proceed clockwise.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "stroke": { "anyOf": [ { "$ref": "#/definitions/Color" }, { "$ref": "#/definitions/Gradient" }, { "type": "null" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Default stroke color. This property has higher precedence than `config.color`. Set to `null` to remove stroke.\n\n__Default value:__ (None)" }, "strokeCap": { "anyOf": [ { "$ref": "#/definitions/StrokeCap", "description": "The stroke cap for line ending style. One of `\"butt\"`, `\"round\"`, or `\"square\"`.\n\n__Default value:__ `\"butt\"`" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeDash": { "anyOf": [ { "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", "items": { "type": "number" }, "type": "array" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeDashOffset": { "anyOf": [ { "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeJoin": { "anyOf": [ { "$ref": "#/definitions/StrokeJoin", "description": "The stroke line join method. One of `\"miter\"`, `\"round\"` or `\"bevel\"`.\n\n__Default value:__ `\"miter\"`" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeMiterLimit": { "anyOf": [ { "description": "The miter limit at which to bevel a line join.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeOffset": { "anyOf": [ { "description": "The offset in pixels at which to draw the group stroke and fill. If unspecified, the default behavior is to dynamically offset stroked groups such that 1 pixel stroke widths align with the pixel grid.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeOpacity": { "anyOf": [ { "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", "maximum": 1, "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeWidth": { "anyOf": [ { "description": "The stroke width, in pixels.", "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "tension": { "anyOf": [ { "description": "Depending on the interpolation type, sets the tension parameter (for line and area marks).", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "text": { "anyOf": [ { "$ref": "#/definitions/Text", "description": "Placeholder text if the `text` channel is not specified" }, { "$ref": "#/definitions/ExprRef" } ] }, "theta": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "- For arc marks, the arc length in radians if theta2 is not specified, otherwise the start arc angle. (A value of 0 indicates up or “north”, increasing values proceed clockwise.)\n\n- For text marks, polar coordinate angle in radians.", "maximum": 360, "minimum": 0 }, "theta2": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise." }, "time": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "timeUnitBandPosition": { "description": "Default relative band position for a time unit. If set to `0`, the marks will be positioned at the beginning of the time unit band step. If set to `0.5`, the marks will be positioned in the middle of the time unit band step.", "type": "number" }, "timeUnitBandSize": { "description": "Default relative band size for a time unit. If set to `1`, the bandwidth of the marks will be equal to the time unit band step. If set to `0.5`, bandwidth of the marks will be half of the time unit band step.", "type": "number" }, "tooltip": { "anyOf": [ { "type": "number" }, { "type": "string" }, { "type": "boolean" }, { "$ref": "#/definitions/TooltipContent" }, { "$ref": "#/definitions/ExprRef" }, { "type": "null" } ], "description": "The tooltip text string to show upon mouse hover or an object defining which fields should the tooltip be derived from.\n\n- If `tooltip` is `true` or `{\"content\": \"encoding\"}`, then all fields from `encoding` will be used.\n- If `tooltip` is `{\"content\": \"data\"}`, then all fields that appear in the highlighted data point will be used.\n- If set to `null` or `false`, then no tooltip will be used.\n\nSee the [`tooltip`](https://vega.github.io/vega-lite/docs/tooltip.html) documentation for a detailed discussion about tooltip in Vega-Lite.\n\n__Default value:__ `null`" }, "url": { "anyOf": [ { "$ref": "#/definitions/URI", "description": "The URL of the image file for image marks." }, { "$ref": "#/definitions/ExprRef" } ] }, "width": { "anyOf": [ { "description": "Width of the marks.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "x": { "anyOf": [ { "type": "number" }, { "const": "width", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ], "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"` without specified `x2` or `width`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." }, "x2": { "anyOf": [ { "type": "number" }, { "const": "width", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ], "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." }, "y": { "anyOf": [ { "type": "number" }, { "const": "height", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"` without specified `y2` or `height`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." }, "y2": { "anyOf": [ { "type": "number" }, { "const": "height", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." } }, "type": "object" }, "RegressionTransform": { "additionalProperties": false, "properties": { "as": { "description": "The output field names for the smoothed points generated by the regression transform.\n\n__Default value:__ The field names of the input x and y values.", "items": { "$ref": "#/definitions/FieldName" }, "maxItems": 2, "minItems": 2, "type": "array" }, "extent": { "description": "A [min, max] domain over the independent (x) field for the starting and ending points of the generated trend line.", "items": { "type": "number" }, "maxItems": 2, "minItems": 2, "type": "array" }, "groupby": { "description": "The data fields to group by. If not specified, a single group containing all data objects will be used.", "items": { "$ref": "#/definitions/FieldName" }, "type": "array" }, "method": { "description": "The functional form of the regression model. One of `\"linear\"`, `\"log\"`, `\"exp\"`, `\"pow\"`, `\"quad\"`, or `\"poly\"`.\n\n__Default value:__ `\"linear\"`", "enum": [ "linear", "log", "exp", "pow", "quad", "poly" ], "type": "string" }, "on": { "$ref": "#/definitions/FieldName", "description": "The data field of the independent variable to use a predictor." }, "order": { "description": "The polynomial order (number of coefficients) for the 'poly' method.\n\n__Default value:__ `3`", "type": "number" }, "params": { "description": "A boolean flag indicating if the transform should return the regression model parameters (one object per group), rather than trend line points. The resulting objects include a `coef` array of fitted coefficient values (starting with the intercept term and then including terms of increasing order) and an `rSquared` value (indicating the total variance explained by the model).\n\n__Default value:__ `false`", "type": "boolean" }, "regression": { "$ref": "#/definitions/FieldName", "description": "The data field of the dependent variable to predict." } }, "required": [ "regression", "on" ], "type": "object" }, "RelativeBandSize": { "additionalProperties": false, "properties": { "band": { "description": "The relative band size. For example `0.5` means half of the band scale's band width.", "type": "number" } }, "required": [ "band" ], "type": "object" }, "RepeatMapping": { "additionalProperties": false, "properties": { "column": { "description": "An array of fields to be repeated horizontally.", "items": { "type": "string" }, "type": "array" }, "row": { "description": "An array of fields to be repeated vertically.", "items": { "type": "string" }, "type": "array" } }, "type": "object" }, "RepeatRef": { "additionalProperties": false, "description": "Reference to a repeated value.", "properties": { "repeat": { "enum": [ "row", "column", "repeat", "layer" ], "type": "string" } }, "required": [ "repeat" ], "type": "object" }, "RepeatSpec": { "anyOf": [ { "$ref": "#/definitions/NonLayerRepeatSpec" }, { "$ref": "#/definitions/LayerRepeatSpec" } ] }, "Resolve": { "additionalProperties": false, "description": "Defines how scales, axes, and legends from different specs should be combined. Resolve is a mapping from `scale`, `axis`, and `legend` to a mapping from channels to resolutions. Scales and guides can be resolved to be `\"independent\"` or `\"shared\"`.", "properties": { "axis": { "$ref": "#/definitions/AxisResolveMap" }, "legend": { "$ref": "#/definitions/LegendResolveMap" }, "scale": { "$ref": "#/definitions/ScaleResolveMap" } }, "type": "object" }, "ResolveMode": { "enum": [ "independent", "shared" ], "type": "string" }, "RowCol": { "additionalProperties": false, "properties": { "column": { "$ref": "#/definitions/LayoutAlign" }, "row": { "$ref": "#/definitions/LayoutAlign" } }, "type": "object" }, "RowCol": { "additionalProperties": false, "properties": { "column": { "type": "boolean" }, "row": { "type": "boolean" } }, "type": "object" }, "RowCol": { "additionalProperties": false, "properties": { "column": { "type": "number" }, "row": { "type": "number" } }, "type": "object" }, "RowColumnEncodingFieldDef": { "additionalProperties": false, "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "align": { "$ref": "#/definitions/LayoutAlign", "description": "The alignment to apply to row/column facet's subplot. The supported string values are `\"all\"`, `\"each\"`, and `\"none\"`.\n\n- For `\"none\"`, a flow layout will be used, in which adjacent subviews are simply placed one after the other.\n- For `\"each\"`, subviews will be aligned into a clean grid structure, but each row or column may be of variable size.\n- For `\"all\"`, subviews will be aligned and each row or column will be sized identically based on the maximum observed size. String values for this property will be applied to both grid rows and columns.\n\n__Default value:__ `\"all\"`." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/BinParams" }, { "type": "null" } ], "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." }, "center": { "description": "Boolean flag indicating if facet's subviews should be centered relative to their respective rows or columns.\n\n__Default value:__ `false`", "type": "boolean" }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "header": { "anyOf": [ { "$ref": "#/definitions/Header" }, { "type": "null" } ], "description": "An object defining properties of a facet's header." }, "sort": { "anyOf": [ { "$ref": "#/definitions/SortArray" }, { "$ref": "#/definitions/SortOrder" }, { "$ref": "#/definitions/EncodingSortField" }, { "type": "null" } ], "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript.\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` is not supported for `row` and `column`." }, "spacing": { "description": "The spacing in pixels between facet's sub-views.\n\n__Default value__: Depends on `\"spacing\"` property of [the view composition configuration](https://vega.github.io/vega-lite/docs/config.html#view-config) (`20` by default)", "type": "number" }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "$ref": "#/definitions/StandardType", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } }, "type": "object" }, "SampleTransform": { "additionalProperties": false, "properties": { "sample": { "description": "The maximum number of data objects to include in the sample.\n\n__Default value:__ `1000`", "type": "number" } }, "required": [ "sample" ], "type": "object" }, "Scale": { "additionalProperties": false, "properties": { "align": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The alignment of the steps within the scale range.\n\nThis value must lie in the range `[0,1]`. A value of `0.5` indicates that the steps should be centered within the range. A value of `0` or `1` may be used to shift the bands to one side, say to position them adjacent to an axis.\n\n__Default value:__ `0.5`" }, "base": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The logarithm base of the `log` scale (default `10`)." }, "bins": { "$ref": "#/definitions/ScaleBins", "description": "Bin boundaries can be provided to scales as either an explicit array of bin boundaries or as a bin specification object. The legal values are:\n- An [array](../types/#Array) literal of bin boundary values. For example, `[0, 5, 10, 15, 20]`. The array must include both starting and ending boundaries. The previous example uses five values to indicate a total of four bin intervals: [0-5), [5-10), [10-15), [15-20]. Array literals may include signal references as elements.\n- A [bin specification object](https://vega.github.io/vega-lite/docs/scale.html#bins) that indicates the bin _step_ size, and optionally the _start_ and _stop_ boundaries.\n- An array of bin boundaries over the scale domain. If provided, axes and legends will use the bin boundaries to inform the choice of tick marks and text labels." }, "clamp": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/ExprRef" } ], "description": "If `true`, values that exceed the data domain are clamped to either the minimum or maximum range value\n\n__Default value:__ derived from the [scale config](https://vega.github.io/vega-lite/docs/config.html#scale-config)'s `clamp` (`true` by default)." }, "constant": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "A constant determining the slope of the symlog function around zero. Only used for `symlog` scales.\n\n__Default value:__ `1`" }, "domain": { "anyOf": [ { "items": { "anyOf": [ { "type": "null" }, { "type": "string" }, { "type": "number" }, { "type": "boolean" }, { "$ref": "#/definitions/DateTime" }, { "$ref": "#/definitions/ExprRef" } ] }, "type": "array" }, { "const": "unaggregated", "type": "string" }, { "$ref": "#/definitions/ParameterExtent" }, { "$ref": "#/definitions/DomainUnionWith" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Customized domain values in the form of constant values or dynamic values driven by a parameter.\n\n1) Constant `domain` for _quantitative_ fields can take one of the following forms:\n\n- A two-element array with minimum and maximum values. To create a diverging scale, this two-element array can be combined with the `domainMid` property.\n- An array with more than two entries, for [Piecewise quantitative scales](https://vega.github.io/vega-lite/docs/scale.html#piecewise).\n- A string value `\"unaggregated\"`, if the input field is aggregated, to indicate that the domain should include the raw data values prior to the aggregation.\n\n2) Constant `domain` for _temporal_ fields can be a two-element array with minimum and maximum values, in the form of either timestamps or the [DateTime definition objects](https://vega.github.io/vega-lite/docs/types.html#datetime).\n\n3) Constant `domain` for _ordinal_ and _nominal_ fields can be an array that lists valid input values.\n\n4) To combine (union) specified constant domain with the field's values, `domain` can be an object with a `unionWith` property that specify constant domain to be combined. For example, `domain: {unionWith: [0, 100]}` for a quantitative scale means that the scale domain always includes `[0, 100]`, but will include other values in the fields beyond `[0, 100]`.\n\n5) Domain can also takes an object defining a field or encoding of a parameter that [interactively determines](https://vega.github.io/vega-lite/docs/selection.html#scale-domains) the scale domain." }, "domainMax": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/DateTime" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Sets the maximum value in the scale domain, overriding the `domain` property. This property is only intended for use with scales having continuous domains." }, "domainMid": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Inserts a single mid-point value into a two-element domain. The mid-point value must lie between the domain minimum and maximum values. This property can be useful for setting a midpoint for [diverging color scales](https://vega.github.io/vega-lite/docs/scale.html#piecewise). The domainMid property is only intended for use with scales supporting continuous, piecewise domains." }, "domainMin": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/DateTime" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Sets the minimum value in the scale domain, overriding the domain property. This property is only intended for use with scales having continuous domains." }, "domainRaw": { "$ref": "#/definitions/ExprRef", "description": "An expression for an array of raw values that, if non-null, directly overrides the _domain_ property. This is useful for supporting interactions such as panning or zooming a scale. The scale may be initially determined using a data-driven domain, then modified in response to user input by setting the rawDomain value." }, "exponent": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The exponent of the `pow` scale." }, "interpolate": { "anyOf": [ { "$ref": "#/definitions/ScaleInterpolateEnum" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/ScaleInterpolateParams" } ], "description": "The interpolation method for range values. By default, a general interpolator for numbers, dates, strings and colors (in HCL space) is used. For color ranges, this property allows interpolation in alternative color spaces. Legal values include `rgb`, `hsl`, `hsl-long`, `lab`, `hcl`, `hcl-long`, `cubehelix` and `cubehelix-long` ('-long' variants use longer paths in polar coordinate spaces). If object-valued, this property accepts an object with a string-valued _type_ property and an optional numeric _gamma_ property applicable to rgb and cubehelix interpolators. For more, see the [d3-interpolate documentation](https://github.com/d3/d3-interpolate).\n\n* __Default value:__ `hcl`" }, "nice": { "anyOf": [ { "type": "boolean" }, { "type": "number" }, { "$ref": "#/definitions/TimeInterval" }, { "$ref": "#/definitions/TimeIntervalStep" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Extending the domain so that it starts and ends on nice round values. This method typically modifies the scale’s domain, and may only extend the bounds to the nearest round value. Nicing is useful if the domain is computed from data and may be irregular. For example, for a domain of _[0.201479…, 0.996679…]_, a nice domain might be _[0.2, 1.0]_.\n\nFor quantitative scales such as linear, `nice` can be either a boolean flag or a number. If `nice` is a number, it will represent a desired tick count. This allows greater control over the step size used to extend the bounds, guaranteeing that the returned ticks will exactly cover the domain.\n\nFor temporal fields with time and utc scales, the `nice` value can be a string indicating the desired time interval. Legal values are `\"millisecond\"`, `\"second\"`, `\"minute\"`, `\"hour\"`, `\"day\"`, `\"week\"`, `\"month\"`, and `\"year\"`. Alternatively, `time` and `utc` scales can accept an object-valued interval specifier of the form `{\"interval\": \"month\", \"step\": 3}`, which includes a desired number of interval steps. Here, the domain would snap to quarter (Jan, Apr, Jul, Oct) boundaries.\n\n__Default value:__ `true` for unbinned _quantitative_ fields without explicit domain bounds; `false` otherwise." }, "padding": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "For _[continuous](https://vega.github.io/vega-lite/docs/scale.html#continuous)_ scales, expands the scale domain to accommodate the specified number of pixels on each of the scale range. The scale range must represent pixels for this parameter to function as intended. Padding adjustment is performed prior to all other adjustments, including the effects of the `zero`, `nice`, `domainMin`, and `domainMax` properties.\n\nFor _[band](https://vega.github.io/vega-lite/docs/scale.html#band)_ scales, shortcut for setting `paddingInner` and `paddingOuter` to the same value.\n\nFor _[point](https://vega.github.io/vega-lite/docs/scale.html#point)_ scales, alias for `paddingOuter`.\n\n__Default value:__ For _continuous_ scales, derived from the [scale config](https://vega.github.io/vega-lite/docs/scale.html#config)'s `continuousPadding`. For _band and point_ scales, see `paddingInner` and `paddingOuter`. By default, Vega-Lite sets padding such that _width/height = number of unique values * step_.", "minimum": 0 }, "paddingInner": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The inner padding (spacing) within each band step of band scales, as a fraction of the step size. This value must lie in the range [0,1].\n\nFor point scale, this property is invalid as point scales do not have internal band widths (only step sizes between bands).\n\n__Default value:__ derived from the [scale config](https://vega.github.io/vega-lite/docs/scale.html#config)'s `bandPaddingInner`.", "maximum": 1, "minimum": 0 }, "paddingOuter": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The outer padding (spacing) at the ends of the range of band and point scales, as a fraction of the step size. This value must lie in the range [0,1].\n\n__Default value:__ derived from the [scale config](https://vega.github.io/vega-lite/docs/scale.html#config)'s `bandPaddingOuter` for band scales and `pointPadding` for point scales. By default, Vega-Lite sets outer padding such that _width/height = number of unique values * step_.", "maximum": 1, "minimum": 0 }, "range": { "anyOf": [ { "$ref": "#/definitions/RangeEnum" }, { "items": { "anyOf": [ { "type": "number" }, { "type": "string" }, { "items": { "type": "number" }, "type": "array" }, { "$ref": "#/definitions/ExprRef" } ] }, "type": "array" }, { "$ref": "#/definitions/FieldRange" } ], "description": "The range of the scale. One of:\n\n- A string indicating a [pre-defined named scale range](https://vega.github.io/vega-lite/docs/scale.html#range-config) (e.g., example, `\"symbol\"`, or `\"diverging\"`).\n\n- For [continuous scales](https://vega.github.io/vega-lite/docs/scale.html#continuous), two-element array indicating minimum and maximum values, or an array with more than two entries for specifying a [piecewise scale](https://vega.github.io/vega-lite/docs/scale.html#piecewise).\n\n- For [discrete](https://vega.github.io/vega-lite/docs/scale.html#discrete) and [discretizing](https://vega.github.io/vega-lite/docs/scale.html#discretizing) scales, an array of desired output values or an object with a `field` property representing the range values. For example, if a field `color` contains CSS color names, we can set `range` to `{field: \"color\"}`.\n\n__Notes:__\n\n1) For color scales you can also specify a color [`scheme`](https://vega.github.io/vega-lite/docs/scale.html#scheme) instead of `range`.\n\n2) Any directly specified `range` for `x` and `y` channels will be ignored. Range can be customized via the view's corresponding [size](https://vega.github.io/vega-lite/docs/size.html) (`width` and `height`)." }, "rangeMax": { "anyOf": [ { "type": "number" }, { "type": "string" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Sets the maximum value in the scale range, overriding the `range` property or the default range. This property is only intended for use with scales having continuous ranges." }, "rangeMin": { "anyOf": [ { "type": "number" }, { "type": "string" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Sets the minimum value in the scale range, overriding the `range` property or the default range. This property is only intended for use with scales having continuous ranges." }, "reverse": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/ExprRef" } ], "description": "If true, reverses the order of the scale range. __Default value:__ `false`." }, "round": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/ExprRef" } ], "description": "If `true`, rounds numeric output values to integers. This can be helpful for snapping to the pixel grid.\n\n__Default value:__ `false`." }, "scheme": { "anyOf": [ { "$ref": "#/definitions/ColorScheme" }, { "$ref": "#/definitions/SchemeParams" }, { "$ref": "#/definitions/ExprRef" } ], "description": "A string indicating a color [scheme](https://vega.github.io/vega-lite/docs/scale.html#scheme) name (e.g., `\"category10\"` or `\"blues\"`) or a [scheme parameter object](https://vega.github.io/vega-lite/docs/scale.html#scheme-params).\n\nDiscrete color schemes may be used with [discrete](https://vega.github.io/vega-lite/docs/scale.html#discrete) or [discretizing](https://vega.github.io/vega-lite/docs/scale.html#discretizing) scales. Continuous color schemes are intended for use with color scales.\n\nTo set a custom scheme, instead set the list of values [as the scale range](https://vega.github.io/vega-lite/docs/scale.html#2-setting-the-range-property-to-an-array-of-valid-css-color-strings).\n\nFor the full list of supported schemes, please refer to the [Vega Scheme](https://vega.github.io/vega/docs/schemes/#reference) reference." }, "type": { "$ref": "#/definitions/ScaleType", "description": "The type of scale. Vega-Lite supports the following categories of scale types:\n\n1) [**Continuous Scales**](https://vega.github.io/vega-lite/docs/scale.html#continuous) -- mapping continuous domains to continuous output ranges ([`\"linear\"`](https://vega.github.io/vega-lite/docs/scale.html#linear), [`\"pow\"`](https://vega.github.io/vega-lite/docs/scale.html#pow), [`\"sqrt\"`](https://vega.github.io/vega-lite/docs/scale.html#sqrt), [`\"symlog\"`](https://vega.github.io/vega-lite/docs/scale.html#symlog), [`\"log\"`](https://vega.github.io/vega-lite/docs/scale.html#log), [`\"time\"`](https://vega.github.io/vega-lite/docs/scale.html#time), [`\"utc\"`](https://vega.github.io/vega-lite/docs/scale.html#utc).\n\n2) [**Discrete Scales**](https://vega.github.io/vega-lite/docs/scale.html#discrete) -- mapping discrete domains to discrete ([`\"ordinal\"`](https://vega.github.io/vega-lite/docs/scale.html#ordinal)) or continuous ([`\"band\"`](https://vega.github.io/vega-lite/docs/scale.html#band) and [`\"point\"`](https://vega.github.io/vega-lite/docs/scale.html#point)) output ranges.\n\n3) [**Discretizing Scales**](https://vega.github.io/vega-lite/docs/scale.html#discretizing) -- mapping continuous domains to discrete output ranges [`\"bin-ordinal\"`](https://vega.github.io/vega-lite/docs/scale.html#bin-ordinal), [`\"quantile\"`](https://vega.github.io/vega-lite/docs/scale.html#quantile), [`\"quantize\"`](https://vega.github.io/vega-lite/docs/scale.html#quantize) and [`\"threshold\"`](https://vega.github.io/vega-lite/docs/scale.html#threshold).\n\n__Default value:__ please see the [scale type table](https://vega.github.io/vega-lite/docs/scale.html#type)." }, "zero": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/ExprRef" } ], "description": "If `true`, ensures that a zero baseline value is included in the scale domain.\n\n__Default value:__ `true` for x and y channels if the quantitative field is not binned and no custom `domain` is provided; `false` otherwise.\n\n__Note:__ Log, time, and utc scales do not support `zero`." } }, "type": "object" }, "ScaleBinParams": { "additionalProperties": false, "properties": { "start": { "description": "The starting (lowest-valued) bin boundary.\n\n__Default value:__ The lowest value of the scale domain will be used.", "type": "number" }, "step": { "description": "The step size defining the bin interval width.", "type": "number" }, "stop": { "description": "The stopping (highest-valued) bin boundary.\n\n__Default value:__ The highest value of the scale domain will be used.", "type": "number" } }, "required": [ "step" ], "type": "object" }, "ScaleBins": { "anyOf": [ { "items": { "type": "number" }, "type": "array" }, { "$ref": "#/definitions/ScaleBinParams" } ] }, "ScaleConfig": { "additionalProperties": false, "properties": { "animationDuration": { "description": "Default animation duration (in seconds) for time encodings, except for [`band`](https://vega.github.io/vega-lite/docs/scale.html#band) scales.\n\n__Default value:__ `5`", "type": "number" }, "bandPaddingInner": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Default inner padding for `x` and `y` band scales.\n\n__Default value:__\n- `nestedOffsetPaddingInner` for x/y scales with nested x/y offset scales.\n- `barBandPaddingInner` for bar marks (`0.1` by default)\n- `rectBandPaddingInner` for rect and other marks (`0` by default)", "maximum": 1, "minimum": 0 }, "bandPaddingOuter": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Default outer padding for `x` and `y` band scales.\n\n__Default value:__ `paddingInner/2` (which makes _width/height = number of unique values * step_)", "maximum": 1, "minimum": 0 }, "bandWithNestedOffsetPaddingInner": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Default inner padding for `x` and `y` band scales with nested `xOffset` and `yOffset` encoding.\n\n__Default value:__ `0.2`", "maximum": 1, "minimum": 0 }, "bandWithNestedOffsetPaddingOuter": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Default outer padding for `x` and `y` band scales with nested `xOffset` and `yOffset` encoding.\n\n__Default value:__ `0.2`", "maximum": 1, "minimum": 0 }, "barBandPaddingInner": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Default inner padding for `x` and `y` band-ordinal scales of `\"bar\"` marks.\n\n__Default value:__ `0.1`", "maximum": 1, "minimum": 0 }, "clamp": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/ExprRef" } ], "description": "If true, values that exceed the data domain are clamped to either the minimum or maximum range value" }, "continuousPadding": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Default padding for continuous x/y scales.\n\n__Default:__ The bar width for continuous x-scale of a vertical bar and continuous y-scale of a horizontal bar.; `0` otherwise.", "minimum": 0 }, "framesPerSecond": { "description": "Default framerate (frames per second) for time [`band`](https://vega.github.io/vega-lite/docs/scale.html#band) scales.\n\n__Default value:__ `2`", "type": "number" }, "invalid": { "$ref": "#/definitions/ScaleInvalidDataConfig", "description": "An object that defines scale outputs per channel for invalid values (nulls and NaNs on a continuous scale).\n- The keys in this object are the scale channels.\n- The values is either `\"zero-or-min\"` (use zero if the scale includes zero or min value otherwise) or a value definition `{value: ...}`.\n\n_Example:_ Setting this `config.scale.invalid` property to `{color: {value: '#aaa'}}` will make the visualization color all invalid values with '#aaa'.\n\nSee [https://vega.github.io/vega-lite/docs/invalid-data.html](Invalid Data Docs) for more details." }, "maxBandSize": { "description": "The default max value for mapping quantitative fields to bar's size/bandSize.\n\nIf undefined (default), we will use the axis's size (width or height) - 1.", "minimum": 0, "type": "number" }, "maxFontSize": { "description": "The default max value for mapping quantitative fields to text's size/fontSize scale.\n\n__Default value:__ `40`", "minimum": 0, "type": "number" }, "maxOpacity": { "description": "Default max opacity for mapping a field to opacity.\n\n__Default value:__ `0.8`", "maximum": 1, "minimum": 0, "type": "number" }, "maxSize": { "description": "Default max value for point size scale.", "minimum": 0, "type": "number" }, "maxStrokeWidth": { "description": "Default max strokeWidth for the scale of strokeWidth for rule and line marks and of size for trail marks.\n\n__Default value:__ `4`", "minimum": 0, "type": "number" }, "minBandSize": { "description": "The default min value for mapping quantitative fields to bar and tick's size/bandSize scale.\n\n__Default value:__ `2`", "minimum": 0, "type": "number" }, "minFontSize": { "description": "The default min value for mapping quantitative fields to text's size/fontSize scale.\n\n__Default value:__ `8`", "minimum": 0, "type": "number" }, "minOpacity": { "description": "Default minimum opacity for mapping a field to opacity.\n\n__Default value:__ `0.3`", "maximum": 1, "minimum": 0, "type": "number" }, "minSize": { "description": "Default minimum value for point size scale.\n\n__Default value:__ `9`", "minimum": 0, "type": "number" }, "minStrokeWidth": { "description": "Default minimum strokeWidth for the scale of strokeWidth for rule and line marks and of size for trail marks.\n\n__Default value:__ `1`", "minimum": 0, "type": "number" }, "offsetBandPaddingInner": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Default padding inner for xOffset/yOffset's band scales.\n\n__Default Value:__ `0`" }, "offsetBandPaddingOuter": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Default padding outer for xOffset/yOffset's band scales.\n\n__Default Value:__ `0`" }, "pointPadding": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Default outer padding for `x` and `y` point-ordinal scales.\n\n__Default value:__ `0.5` (which makes _width/height = number of unique values * step_)", "maximum": 1, "minimum": 0 }, "quantileCount": { "description": "Default range cardinality for [`quantile`](https://vega.github.io/vega-lite/docs/scale.html#quantile) scale.\n\n__Default value:__ `4`", "minimum": 0, "type": "number" }, "quantizeCount": { "description": "Default range cardinality for [`quantize`](https://vega.github.io/vega-lite/docs/scale.html#quantize) scale.\n\n__Default value:__ `4`", "minimum": 0, "type": "number" }, "rectBandPaddingInner": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Default inner padding for `x` and `y` band-ordinal scales of `\"rect\"` marks.\n\n__Default value:__ `0`", "maximum": 1, "minimum": 0 }, "round": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/ExprRef" } ], "description": "If true, rounds numeric output values to integers. This can be helpful for snapping to the pixel grid. (Only available for `x`, `y`, and `size` scales.)" }, "tickBandPaddingInner": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Default inner padding for `x` and `y` band-ordinal scales of `\"tick\"` marks.\n\n__Default value:__ `0.25`", "maximum": 1, "minimum": 0 }, "useUnaggregatedDomain": { "description": "Use the source data range before aggregation as scale domain instead of aggregated data for aggregate axis.\n\nThis is equivalent to setting `domain` to `\"unaggregate\"` for aggregated _quantitative_ fields by default.\n\nThis property only works with aggregate functions that produce values within the raw data domain (`\"mean\"`, `\"average\"`, `\"median\"`, `\"q1\"`, `\"q3\"`, `\"min\"`, `\"max\"`). For other aggregations that produce values outside of the raw data domain (e.g. `\"count\"`, `\"sum\"`), this property is ignored.\n\n__Default value:__ `false`", "type": "boolean" }, "xReverse": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Reverse x-scale by default (useful for right-to-left charts)." }, "zero": { "description": "Default `scale.zero` for [`continuous`](https://vega.github.io/vega-lite/docs/scale.html#continuous) scales except for (1) x/y-scales of non-ranged bar or area charts and (2) size scales.\n\n__Default value:__ `true`", "type": "boolean" } }, "type": "object" }, "ScaleDatumDef": { "additionalProperties": false, "properties": { "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "datum": { "anyOf": [ { "$ref": "#/definitions/PrimitiveValue" }, { "$ref": "#/definitions/DateTime" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/RepeatRef" } ], "description": "A constant value in data domain." }, "scale": { "anyOf": [ { "$ref": "#/definitions/Scale" }, { "type": "null" } ], "description": "An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "$ref": "#/definitions/Type", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } }, "type": "object" }, "ScaleFieldDef": { "additionalProperties": false, "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/BinParams" }, { "type": "null" } ], "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "scale": { "anyOf": [ { "$ref": "#/definitions/Scale" }, { "type": "null" } ], "description": "An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." }, "sort": { "$ref": "#/definitions/Sort", "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript.\n- [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`.\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "$ref": "#/definitions/StandardType", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } }, "type": "object" }, "ScaleInterpolateEnum": { "enum": [ "rgb", "lab", "hcl", "hsl", "hsl-long", "hcl-long", "cubehelix", "cubehelix-long" ], "type": "string" }, "ScaleInterpolateParams": { "additionalProperties": false, "properties": { "gamma": { "type": "number" }, "type": { "enum": [ "rgb", "cubehelix", "cubehelix-long" ], "type": "string" } }, "required": [ "type" ], "type": "object" }, "ScaleInvalidDataConfig": { "additionalProperties": false, "properties": { "angle": { "$ref": "#/definitions/ScaleInvalidDataShowAs<\"angle\">" }, "color": { "$ref": "#/definitions/ScaleInvalidDataShowAs<\"color\">" }, "fill": { "$ref": "#/definitions/ScaleInvalidDataShowAs<\"fill\">" }, "fillOpacity": { "$ref": "#/definitions/ScaleInvalidDataShowAs<\"fillOpacity\">" }, "opacity": { "$ref": "#/definitions/ScaleInvalidDataShowAs<\"opacity\">" }, "radius": { "$ref": "#/definitions/ScaleInvalidDataShowAs<\"radius\">" }, "shape": { "$ref": "#/definitions/ScaleInvalidDataShowAs<\"shape\">" }, "size": { "$ref": "#/definitions/ScaleInvalidDataShowAs<\"size\">" }, "stroke": { "$ref": "#/definitions/ScaleInvalidDataShowAs<\"stroke\">" }, "strokeDash": { "$ref": "#/definitions/ScaleInvalidDataShowAs<\"strokeDash\">" }, "strokeOpacity": { "$ref": "#/definitions/ScaleInvalidDataShowAs<\"strokeOpacity\">" }, "strokeWidth": { "$ref": "#/definitions/ScaleInvalidDataShowAs<\"strokeWidth\">" }, "theta": { "$ref": "#/definitions/ScaleInvalidDataShowAs<\"theta\">" }, "time": { "$ref": "#/definitions/ScaleInvalidDataShowAs<\"time\">" }, "x": { "$ref": "#/definitions/ScaleInvalidDataShowAs<\"x\">" }, "xOffset": { "$ref": "#/definitions/ScaleInvalidDataShowAs<\"xOffset\">" }, "y": { "$ref": "#/definitions/ScaleInvalidDataShowAs<\"y\">" }, "yOffset": { "$ref": "#/definitions/ScaleInvalidDataShowAs<\"yOffset\">" } }, "type": "object" }, "ScaleInvalidDataShowAs<\"angle\">": { "anyOf": [ { "$ref": "#/definitions/ScaleInvalidDataShowAsValue<\"angle\">" }, { "const": "zero-or-min", "type": "string" } ] }, "ScaleInvalidDataShowAs<\"color\">": { "anyOf": [ { "$ref": "#/definitions/ScaleInvalidDataShowAsValue<\"color\">" }, { "const": "zero-or-min", "type": "string" } ] }, "ScaleInvalidDataShowAs<\"fill\">": { "anyOf": [ { "$ref": "#/definitions/ScaleInvalidDataShowAsValue<\"fill\">" }, { "const": "zero-or-min", "type": "string" } ] }, "ScaleInvalidDataShowAs<\"fillOpacity\">": { "anyOf": [ { "$ref": "#/definitions/ScaleInvalidDataShowAsValue<\"fillOpacity\">" }, { "const": "zero-or-min", "type": "string" } ] }, "ScaleInvalidDataShowAs<\"opacity\">": { "anyOf": [ { "$ref": "#/definitions/ScaleInvalidDataShowAsValue<\"opacity\">" }, { "const": "zero-or-min", "type": "string" } ] }, "ScaleInvalidDataShowAs<\"radius\">": { "anyOf": [ { "$ref": "#/definitions/ScaleInvalidDataShowAsValue<\"radius\">" }, { "const": "zero-or-min", "type": "string" } ] }, "ScaleInvalidDataShowAs<\"shape\">": { "anyOf": [ { "$ref": "#/definitions/ScaleInvalidDataShowAsValue<\"shape\">" }, { "const": "zero-or-min", "type": "string" } ] }, "ScaleInvalidDataShowAs<\"size\">": { "anyOf": [ { "$ref": "#/definitions/ScaleInvalidDataShowAsValue<\"size\">" }, { "const": "zero-or-min", "type": "string" } ] }, "ScaleInvalidDataShowAs<\"stroke\">": { "anyOf": [ { "$ref": "#/definitions/ScaleInvalidDataShowAsValue<\"stroke\">" }, { "const": "zero-or-min", "type": "string" } ] }, "ScaleInvalidDataShowAs<\"strokeDash\">": { "anyOf": [ { "$ref": "#/definitions/ScaleInvalidDataShowAsValue<\"strokeDash\">" }, { "const": "zero-or-min", "type": "string" } ] }, "ScaleInvalidDataShowAs<\"strokeOpacity\">": { "anyOf": [ { "$ref": "#/definitions/ScaleInvalidDataShowAsValue<\"strokeOpacity\">" }, { "const": "zero-or-min", "type": "string" } ] }, "ScaleInvalidDataShowAs<\"strokeWidth\">": { "anyOf": [ { "$ref": "#/definitions/ScaleInvalidDataShowAsValue<\"strokeWidth\">" }, { "const": "zero-or-min", "type": "string" } ] }, "ScaleInvalidDataShowAs<\"theta\">": { "anyOf": [ { "$ref": "#/definitions/ScaleInvalidDataShowAsValue<\"theta\">" }, { "const": "zero-or-min", "type": "string" } ] }, "ScaleInvalidDataShowAs<\"time\">": { "anyOf": [ { "$ref": "#/definitions/ScaleInvalidDataShowAsValue<\"time\">" }, { "const": "zero-or-min", "type": "string" } ] }, "ScaleInvalidDataShowAs<\"x\">": { "anyOf": [ { "$ref": "#/definitions/ScaleInvalidDataShowAsValue<\"x\">" }, { "const": "zero-or-min", "type": "string" } ] }, "ScaleInvalidDataShowAs<\"xOffset\">": { "anyOf": [ { "$ref": "#/definitions/ScaleInvalidDataShowAsValue<\"xOffset\">" }, { "const": "zero-or-min", "type": "string" } ] }, "ScaleInvalidDataShowAs<\"y\">": { "anyOf": [ { "$ref": "#/definitions/ScaleInvalidDataShowAsValue<\"y\">" }, { "const": "zero-or-min", "type": "string" } ] }, "ScaleInvalidDataShowAs<\"yOffset\">": { "anyOf": [ { "$ref": "#/definitions/ScaleInvalidDataShowAsValue<\"yOffset\">" }, { "const": "zero-or-min", "type": "string" } ] }, "ScaleInvalidDataShowAsValue<\"angle\">": { "additionalProperties": false, "properties": { "value": { "description": "The rotation angle of the text, in degrees.", "maximum": 360, "minimum": 0, "type": "number" } }, "type": "object" }, "ScaleInvalidDataShowAsValue<\"color\">": { "additionalProperties": false, "properties": { "value": { "anyOf": [ { "$ref": "#/definitions/Color" }, { "$ref": "#/definitions/Gradient" } ], "description": "Default color.\n\n__Default value:__ `\"#4682b4\"`\n\n__Note:__\n- This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).\n- The `fill` and `stroke` properties have higher precedence than `color` and will override `color`." } }, "type": "object" }, "ScaleInvalidDataShowAsValue<\"fill\">": { "additionalProperties": false, "properties": { "value": { "anyOf": [ { "$ref": "#/definitions/Color" }, { "$ref": "#/definitions/Gradient" }, { "type": "null" } ], "description": "Default fill color. This property has higher precedence than `config.color`. Set to `null` to remove fill.\n\n__Default value:__ (None)" } }, "type": "object" }, "ScaleInvalidDataShowAsValue<\"fillOpacity\">": { "additionalProperties": false, "properties": { "value": { "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", "maximum": 1, "minimum": 0, "type": "number" } }, "type": "object" }, "ScaleInvalidDataShowAsValue<\"opacity\">": { "additionalProperties": false, "properties": { "value": { "description": "The overall opacity (value between [0,1]).\n\n__Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or `square` marks or layered `bar` charts and `1` otherwise.", "maximum": 1, "minimum": 0, "type": "number" } }, "type": "object" }, "ScaleInvalidDataShowAsValue<\"radius\">": { "additionalProperties": false, "properties": { "value": { "description": "For arc mark, the primary (outer) radius in pixels.\n\nFor text marks, polar coordinate radial offset, in pixels, of the text from the origin determined by the `x` and `y` properties.\n\n__Default value:__ `min(plot_width, plot_height)/2`", "minimum": 0, "type": "number" } }, "type": "object" }, "ScaleInvalidDataShowAsValue<\"shape\">": { "additionalProperties": false, "properties": { "value": { "anyOf": [ { "$ref": "#/definitions/SymbolShape" }, { "type": "string" } ], "description": "Shape of the point marks. Supported values include:\n- plotting shapes: `\"circle\"`, `\"square\"`, `\"cross\"`, `\"diamond\"`, `\"triangle-up\"`, `\"triangle-down\"`, `\"triangle-right\"`, or `\"triangle-left\"`.\n- the line symbol `\"stroke\"`\n- centered directional shapes `\"arrow\"`, `\"wedge\"`, or `\"triangle\"`\n- a custom [SVG path string](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths) (For correct sizing, custom shape paths should be defined within a square bounding box with coordinates ranging from -1 to 1 along both the x and y dimensions.)\n\n__Default value:__ `\"circle\"`" } }, "type": "object" }, "ScaleInvalidDataShowAsValue<\"size\">": { "additionalProperties": false, "properties": { "value": { "description": "Default size for marks.\n- For `point`/`circle`/`square`, this represents the pixel area of the marks. Note that this value sets the area of the symbol; the side lengths will increase with the square root of this value.\n- For `bar`, this represents the band size of the bar, in pixels.\n- For `text`, this represents the font size, in pixels.\n\n__Default value:__\n- `30` for point, circle, square marks; width/height's `step`\n- `2` for bar marks with discrete dimensions;\n- `5` for bar marks with continuous dimensions;\n- `11` for text marks.", "minimum": 0, "type": "number" } }, "type": "object" }, "ScaleInvalidDataShowAsValue<\"stroke\">": { "additionalProperties": false, "properties": { "value": { "anyOf": [ { "$ref": "#/definitions/Color" }, { "$ref": "#/definitions/Gradient" }, { "type": "null" } ], "description": "Default stroke color. This property has higher precedence than `config.color`. Set to `null` to remove stroke.\n\n__Default value:__ (None)" } }, "type": "object" }, "ScaleInvalidDataShowAsValue<\"strokeDash\">": { "additionalProperties": false, "properties": { "value": { "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", "items": { "type": "number" }, "type": "array" } }, "type": "object" }, "ScaleInvalidDataShowAsValue<\"strokeOpacity\">": { "additionalProperties": false, "properties": { "value": { "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", "maximum": 1, "minimum": 0, "type": "number" } }, "type": "object" }, "ScaleInvalidDataShowAsValue<\"strokeWidth\">": { "additionalProperties": false, "properties": { "value": { "description": "The stroke width, in pixels.", "minimum": 0, "type": "number" } }, "type": "object" }, "ScaleInvalidDataShowAsValue<\"theta\">": { "additionalProperties": false, "properties": { "value": { "description": "- For arc marks, the arc length in radians if theta2 is not specified, otherwise the start arc angle. (A value of 0 indicates up or “north”, increasing values proceed clockwise.)\n\n- For text marks, polar coordinate angle in radians.", "maximum": 360, "minimum": 0, "type": "number" } }, "type": "object" }, "ScaleInvalidDataShowAsValue<\"time\">": { "additionalProperties": false, "properties": { "value": { "type": "number" } }, "type": "object" }, "ScaleInvalidDataShowAsValue<\"x\">": { "additionalProperties": false, "properties": { "value": { "anyOf": [ { "type": "number" }, { "const": "width", "type": "string" } ], "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"` without specified `x2` or `width`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." } }, "type": "object" }, "ScaleInvalidDataShowAsValue<\"xOffset\">": { "additionalProperties": false, "properties": { "value": { "description": "Offset for x-position.", "type": "number" } }, "type": "object" }, "ScaleInvalidDataShowAsValue<\"y\">": { "additionalProperties": false, "properties": { "value": { "anyOf": [ { "type": "number" }, { "const": "height", "type": "string" } ], "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"` without specified `y2` or `height`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." } }, "type": "object" }, "ScaleInvalidDataShowAsValue<\"yOffset\">": { "additionalProperties": false, "properties": { "value": { "description": "Offset for y-position.", "type": "number" } }, "type": "object" }, "ScaleResolveMap": { "additionalProperties": false, "properties": { "angle": { "$ref": "#/definitions/ResolveMode" }, "color": { "$ref": "#/definitions/ResolveMode" }, "fill": { "$ref": "#/definitions/ResolveMode" }, "fillOpacity": { "$ref": "#/definitions/ResolveMode" }, "opacity": { "$ref": "#/definitions/ResolveMode" }, "radius": { "$ref": "#/definitions/ResolveMode" }, "shape": { "$ref": "#/definitions/ResolveMode" }, "size": { "$ref": "#/definitions/ResolveMode" }, "stroke": { "$ref": "#/definitions/ResolveMode" }, "strokeDash": { "$ref": "#/definitions/ResolveMode" }, "strokeOpacity": { "$ref": "#/definitions/ResolveMode" }, "strokeWidth": { "$ref": "#/definitions/ResolveMode" }, "theta": { "$ref": "#/definitions/ResolveMode" }, "time": { "$ref": "#/definitions/ResolveMode" }, "x": { "$ref": "#/definitions/ResolveMode" }, "xOffset": { "$ref": "#/definitions/ResolveMode" }, "y": { "$ref": "#/definitions/ResolveMode" }, "yOffset": { "$ref": "#/definitions/ResolveMode" } }, "type": "object" }, "ScaleType": { "enum": [ "linear", "log", "pow", "sqrt", "symlog", "identity", "sequential", "time", "utc", "quantile", "quantize", "threshold", "bin-ordinal", "ordinal", "point", "band" ], "type": "string" }, "SchemeParams": { "additionalProperties": false, "properties": { "count": { "description": "The number of colors to use in the scheme. This can be useful for scale types such as `\"quantize\"`, which use the length of the scale range to determine the number of discrete bins for the scale domain.", "type": "number" }, "extent": { "description": "The extent of the color range to use. For example `[0.2, 1]` will rescale the color scheme such that color values in the range _[0, 0.2)_ are excluded from the scheme.", "items": { "type": "number" }, "type": "array" }, "name": { "$ref": "#/definitions/ColorScheme", "description": "A color scheme name for ordinal scales (e.g., `\"category10\"` or `\"blues\"`).\n\nFor the full list of supported schemes, please refer to the [Vega Scheme](https://vega.github.io/vega/docs/schemes/#reference) reference." } }, "required": [ "name" ], "type": "object" }, "SecondaryFieldDef": { "additionalProperties": false, "description": "A field definition of a secondary channel that shares a scale with another primary channel. For example, `x2`, `xError` and `xError2` share the same scale with `x`.", "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation.", "type": "null" }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." } }, "type": "object" }, "SelectionConfig": { "additionalProperties": false, "properties": { "interval": { "$ref": "#/definitions/IntervalSelectionConfigWithoutType", "description": "The default definition for an [`interval`](https://vega.github.io/vega-lite/docs/parameter.html#select) selection. All properties and transformations for an interval selection definition (except `type`) may be specified here.\n\nFor instance, setting `interval` to `{\"translate\": false}` disables the ability to move interval selections by default." }, "point": { "$ref": "#/definitions/PointSelectionConfigWithoutType", "description": "The default definition for a [`point`](https://vega.github.io/vega-lite/docs/parameter.html#select) selection. All properties and transformations for a point selection definition (except `type`) may be specified here.\n\nFor instance, setting `point` to `{\"on\": \"dblclick\"}` populates point selections on double-click by default." } }, "type": "object" }, "SelectionInit": { "anyOf": [ { "$ref": "#/definitions/PrimitiveValue" }, { "$ref": "#/definitions/DateTime" } ] }, "SelectionInitInterval": { "anyOf": [ { "$ref": "#/definitions/Vector2" }, { "$ref": "#/definitions/Vector2" }, { "$ref": "#/definitions/Vector2" }, { "$ref": "#/definitions/Vector2" } ] }, "SelectionInitIntervalMapping": { "$ref": "#/definitions/Dict" }, "SelectionInitMapping": { "$ref": "#/definitions/Dict" }, "SelectionParameter": { "additionalProperties": false, "properties": { "bind": { "anyOf": [ { "$ref": "#/definitions/Binding" }, { "additionalProperties": { "$ref": "#/definitions/Binding" }, "type": "object" }, { "$ref": "#/definitions/LegendBinding" }, { "const": "scales", "type": "string" } ], "description": "When set, a selection is populated by input elements (also known as dynamic query widgets) or by interacting with the corresponding legend. Direct manipulation interaction is disabled by default; to re-enable it, set the selection's [`on`](https://vega.github.io/vega-lite/docs/selection.html#common-selection-properties) property.\n\nLegend bindings are restricted to selections that only specify a single field or encoding.\n\nQuery widget binding takes the form of Vega's [input element binding definition](https://vega.github.io/vega/docs/signals/#bind) or can be a mapping between projected field/encodings and binding definitions.\n\n__See also:__ [`bind`](https://vega.github.io/vega-lite/docs/bind.html) documentation." }, "name": { "$ref": "#/definitions/ParameterName", "description": "Required. A unique name for the selection parameter. Selection names should be valid JavaScript identifiers: they should contain only alphanumeric characters (or \"$\", or \"_\") and may not start with a digit. Reserved keywords that may not be used as parameter names are \"datum\", \"event\", \"item\", and \"parent\"." }, "select": { "anyOf": [ { "$ref": "#/definitions/SelectionType" }, { "$ref": "#/definitions/PointSelectionConfig" }, { "$ref": "#/definitions/IntervalSelectionConfig" } ], "description": "Determines the default event processing and data query for the selection. Vega-Lite currently supports two selection types:\n\n- `\"point\"` -- to select multiple discrete data values; the first value is selected on `click` and additional values toggled on shift-click.\n- `\"interval\"` -- to select a continuous range of data values on `drag`." }, "value": { "anyOf": [ { "$ref": "#/definitions/SelectionInit" }, { "items": { "$ref": "#/definitions/SelectionInitMapping" }, "type": "array" }, { "$ref": "#/definitions/SelectionInitIntervalMapping" } ], "description": "Initialize the selection with a mapping between [projected channels or field names](https://vega.github.io/vega-lite/docs/selection.html#project) and initial values.\n\n__See also:__ [`init`](https://vega.github.io/vega-lite/docs/value.html) documentation." } }, "required": [ "name", "select" ], "type": "object" }, "SelectionResolution": { "enum": [ "global", "union", "intersect" ], "type": "string" }, "SelectionType": { "enum": [ "point", "interval" ], "type": "string" }, "SequenceGenerator": { "additionalProperties": false, "properties": { "name": { "description": "Provide a placeholder name and bind data at runtime.", "type": "string" }, "sequence": { "$ref": "#/definitions/SequenceParams", "description": "Generate a sequence of numbers." } }, "required": [ "sequence" ], "type": "object" }, "SequenceParams": { "additionalProperties": false, "properties": { "as": { "$ref": "#/definitions/FieldName", "description": "The name of the generated sequence field.\n\n__Default value:__ `\"data\"`" }, "start": { "description": "The starting value of the sequence (inclusive).", "type": "number" }, "step": { "description": "The step value between sequence entries.\n\n__Default value:__ `1`", "type": "number" }, "stop": { "description": "The ending value of the sequence (exclusive).", "type": "number" } }, "required": [ "start", "stop" ], "type": "object" }, "SequentialMultiHue": { "enum": [ "turbo", "viridis", "inferno", "magma", "plasma", "cividis", "bluegreen", "bluegreen-3", "bluegreen-4", "bluegreen-5", "bluegreen-6", "bluegreen-7", "bluegreen-8", "bluegreen-9", "bluepurple", "bluepurple-3", "bluepurple-4", "bluepurple-5", "bluepurple-6", "bluepurple-7", "bluepurple-8", "bluepurple-9", "goldgreen", "goldgreen-3", "goldgreen-4", "goldgreen-5", "goldgreen-6", "goldgreen-7", "goldgreen-8", "goldgreen-9", "goldorange", "goldorange-3", "goldorange-4", "goldorange-5", "goldorange-6", "goldorange-7", "goldorange-8", "goldorange-9", "goldred", "goldred-3", "goldred-4", "goldred-5", "goldred-6", "goldred-7", "goldred-8", "goldred-9", "greenblue", "greenblue-3", "greenblue-4", "greenblue-5", "greenblue-6", "greenblue-7", "greenblue-8", "greenblue-9", "orangered", "orangered-3", "orangered-4", "orangered-5", "orangered-6", "orangered-7", "orangered-8", "orangered-9", "purplebluegreen", "purplebluegreen-3", "purplebluegreen-4", "purplebluegreen-5", "purplebluegreen-6", "purplebluegreen-7", "purplebluegreen-8", "purplebluegreen-9", "purpleblue", "purpleblue-3", "purpleblue-4", "purpleblue-5", "purpleblue-6", "purpleblue-7", "purpleblue-8", "purpleblue-9", "purplered", "purplered-3", "purplered-4", "purplered-5", "purplered-6", "purplered-7", "purplered-8", "purplered-9", "redpurple", "redpurple-3", "redpurple-4", "redpurple-5", "redpurple-6", "redpurple-7", "redpurple-8", "redpurple-9", "yellowgreenblue", "yellowgreenblue-3", "yellowgreenblue-4", "yellowgreenblue-5", "yellowgreenblue-6", "yellowgreenblue-7", "yellowgreenblue-8", "yellowgreenblue-9", "yellowgreen", "yellowgreen-3", "yellowgreen-4", "yellowgreen-5", "yellowgreen-6", "yellowgreen-7", "yellowgreen-8", "yellowgreen-9", "yelloworangebrown", "yelloworangebrown-3", "yelloworangebrown-4", "yelloworangebrown-5", "yelloworangebrown-6", "yelloworangebrown-7", "yelloworangebrown-8", "yelloworangebrown-9", "yelloworangered", "yelloworangered-3", "yelloworangered-4", "yelloworangered-5", "yelloworangered-6", "yelloworangered-7", "yelloworangered-8", "yelloworangered-9", "darkblue", "darkblue-3", "darkblue-4", "darkblue-5", "darkblue-6", "darkblue-7", "darkblue-8", "darkblue-9", "darkgold", "darkgold-3", "darkgold-4", "darkgold-5", "darkgold-6", "darkgold-7", "darkgold-8", "darkgold-9", "darkgreen", "darkgreen-3", "darkgreen-4", "darkgreen-5", "darkgreen-6", "darkgreen-7", "darkgreen-8", "darkgreen-9", "darkmulti", "darkmulti-3", "darkmulti-4", "darkmulti-5", "darkmulti-6", "darkmulti-7", "darkmulti-8", "darkmulti-9", "darkred", "darkred-3", "darkred-4", "darkred-5", "darkred-6", "darkred-7", "darkred-8", "darkred-9", "lightgreyred", "lightgreyred-3", "lightgreyred-4", "lightgreyred-5", "lightgreyred-6", "lightgreyred-7", "lightgreyred-8", "lightgreyred-9", "lightgreyteal", "lightgreyteal-3", "lightgreyteal-4", "lightgreyteal-5", "lightgreyteal-6", "lightgreyteal-7", "lightgreyteal-8", "lightgreyteal-9", "lightmulti", "lightmulti-3", "lightmulti-4", "lightmulti-5", "lightmulti-6", "lightmulti-7", "lightmulti-8", "lightmulti-9", "lightorange", "lightorange-3", "lightorange-4", "lightorange-5", "lightorange-6", "lightorange-7", "lightorange-8", "lightorange-9", "lighttealblue", "lighttealblue-3", "lighttealblue-4", "lighttealblue-5", "lighttealblue-6", "lighttealblue-7", "lighttealblue-8", "lighttealblue-9" ], "type": "string" }, "SequentialSingleHue": { "enum": [ "blues", "tealblues", "teals", "greens", "browns", "greys", "purples", "warmgreys", "reds", "oranges" ], "type": "string" }, "ShapeDef": { "$ref": "#/definitions/MarkPropDef<(string|null),TypeForShape>" }, "SharedEncoding": { "additionalProperties": false, "properties": { "angle": { "additionalProperties": false, "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/BinParams" }, { "type": "null" } ], "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." }, "condition": { "anyOf": [ { "anyOf": [ { "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" }, "type": "array" } ], "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." }, { "anyOf": [ { "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" }, { "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" }, "type": "array" } ], "description": "A field definition or one or more value definition(s) with a parameter predicate." } ], "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." }, "datum": { "anyOf": [ { "$ref": "#/definitions/PrimitiveValue" }, { "$ref": "#/definitions/DateTime" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/RepeatRef" } ], "description": "A constant value in data domain." }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "legend": { "anyOf": [ { "$ref": "#/definitions/Legend" }, { "type": "null" } ], "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." }, "scale": { "anyOf": [ { "$ref": "#/definitions/Scale" }, { "type": "null" } ], "description": "An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." }, "sort": { "$ref": "#/definitions/Sort", "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript.\n- [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`.\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "anyOf": [ { "$ref": "#/definitions/StandardType", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." }, { "$ref": "#/definitions/Type", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } ], "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." }, "value": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." } }, "type": "object" }, "color": { "additionalProperties": false, "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/BinParams" }, { "type": "null" } ], "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." }, "condition": { "anyOf": [ { "anyOf": [ { "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" }, "type": "array" } ], "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." }, { "anyOf": [ { "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" }, { "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" }, "type": "array" } ], "description": "A field definition or one or more value definition(s) with a parameter predicate." } ], "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." }, "datum": { "anyOf": [ { "$ref": "#/definitions/PrimitiveValue" }, { "$ref": "#/definitions/DateTime" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/RepeatRef" } ], "description": "A constant value in data domain." }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "legend": { "anyOf": [ { "$ref": "#/definitions/Legend" }, { "type": "null" } ], "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." }, "scale": { "anyOf": [ { "$ref": "#/definitions/Scale" }, { "type": "null" } ], "description": "An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." }, "sort": { "$ref": "#/definitions/Sort", "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript.\n- [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`.\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "anyOf": [ { "$ref": "#/definitions/StandardType", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." }, { "$ref": "#/definitions/Type", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } ], "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." }, "value": { "anyOf": [ { "$ref": "#/definitions/Gradient" }, { "type": "string" }, { "type": "null" }, { "$ref": "#/definitions/ExprRef" } ], "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." } }, "type": "object" }, "description": { "additionalProperties": false, "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/BinParams" }, { "const": "binned", "type": "string" }, { "type": "null" } ], "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." }, "condition": { "anyOf": [ { "anyOf": [ { "$ref": "#/definitions/ConditionalValueDef<(string|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalValueDef<(string|ExprRef)>" }, "type": "array" } ], "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." }, { "anyOf": [ { "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" }, { "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" }, "type": "array" } ], "description": "A field definition or one or more value definition(s) with a parameter predicate." } ], "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "format": { "anyOf": [ { "type": "string" }, { "$ref": "#/definitions/Dict" } ], "description": "When used with the default `\"number\"` and `\"time\"` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks.\n\n- If the format type is `\"number\"` (e.g., for quantitative fields), this is D3's [number format pattern](https://github.com/d3/d3-format#locale_format).\n- If the format type is `\"time\"` (e.g., for temporal fields), this is D3's [time format pattern](https://github.com/d3/d3-time-format#locale_format).\n\nSee the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for more examples.\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." }, "formatType": { "description": "The format type for labels. One of `\"number\"`, `\"time\"`, or a [registered custom format type](https://vega.github.io/vega-lite/docs/config.html#custom-format-type).\n\n__Default value:__\n- `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`.\n- `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", "type": "string" }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "$ref": "#/definitions/StandardType", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." }, "value": { "anyOf": [ { "type": "string" }, { "type": "null" }, { "$ref": "#/definitions/ExprRef" } ], "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." } }, "type": "object" }, "detail": { "anyOf": [ { "$ref": "#/definitions/FieldDefWithoutScale" }, { "items": { "$ref": "#/definitions/FieldDefWithoutScale" }, "type": "array" } ], "description": "Additional levels of detail for grouping data in aggregate views and in line, trail, and area marks without mapping data to a specific visual channel." }, "fill": { "additionalProperties": false, "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/BinParams" }, { "type": "null" } ], "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." }, "condition": { "anyOf": [ { "anyOf": [ { "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" }, "type": "array" } ], "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." }, { "anyOf": [ { "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" }, { "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" }, "type": "array" } ], "description": "A field definition or one or more value definition(s) with a parameter predicate." } ], "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." }, "datum": { "anyOf": [ { "$ref": "#/definitions/PrimitiveValue" }, { "$ref": "#/definitions/DateTime" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/RepeatRef" } ], "description": "A constant value in data domain." }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "legend": { "anyOf": [ { "$ref": "#/definitions/Legend" }, { "type": "null" } ], "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." }, "scale": { "anyOf": [ { "$ref": "#/definitions/Scale" }, { "type": "null" } ], "description": "An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." }, "sort": { "$ref": "#/definitions/Sort", "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript.\n- [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`.\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "anyOf": [ { "$ref": "#/definitions/StandardType", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." }, { "$ref": "#/definitions/Type", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } ], "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." }, "value": { "anyOf": [ { "$ref": "#/definitions/Gradient" }, { "type": "string" }, { "type": "null" }, { "$ref": "#/definitions/ExprRef" } ], "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." } }, "type": "object" }, "fillOpacity": { "additionalProperties": false, "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/BinParams" }, { "type": "null" } ], "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." }, "condition": { "anyOf": [ { "anyOf": [ { "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" }, "type": "array" } ], "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." }, { "anyOf": [ { "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" }, { "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" }, "type": "array" } ], "description": "A field definition or one or more value definition(s) with a parameter predicate." } ], "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." }, "datum": { "anyOf": [ { "$ref": "#/definitions/PrimitiveValue" }, { "$ref": "#/definitions/DateTime" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/RepeatRef" } ], "description": "A constant value in data domain." }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "legend": { "anyOf": [ { "$ref": "#/definitions/Legend" }, { "type": "null" } ], "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." }, "scale": { "anyOf": [ { "$ref": "#/definitions/Scale" }, { "type": "null" } ], "description": "An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." }, "sort": { "$ref": "#/definitions/Sort", "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript.\n- [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`.\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "anyOf": [ { "$ref": "#/definitions/StandardType", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." }, { "$ref": "#/definitions/Type", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } ], "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." }, "value": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." } }, "type": "object" }, "href": { "additionalProperties": false, "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/BinParams" }, { "const": "binned", "type": "string" }, { "type": "null" } ], "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." }, "condition": { "anyOf": [ { "anyOf": [ { "$ref": "#/definitions/ConditionalValueDef<(string|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalValueDef<(string|ExprRef)>" }, "type": "array" } ], "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." }, { "anyOf": [ { "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" }, { "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" }, "type": "array" } ], "description": "A field definition or one or more value definition(s) with a parameter predicate." } ], "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "format": { "anyOf": [ { "type": "string" }, { "$ref": "#/definitions/Dict" } ], "description": "When used with the default `\"number\"` and `\"time\"` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks.\n\n- If the format type is `\"number\"` (e.g., for quantitative fields), this is D3's [number format pattern](https://github.com/d3/d3-format#locale_format).\n- If the format type is `\"time\"` (e.g., for temporal fields), this is D3's [time format pattern](https://github.com/d3/d3-time-format#locale_format).\n\nSee the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for more examples.\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." }, "formatType": { "description": "The format type for labels. One of `\"number\"`, `\"time\"`, or a [registered custom format type](https://vega.github.io/vega-lite/docs/config.html#custom-format-type).\n\n__Default value:__\n- `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`.\n- `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", "type": "string" }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "$ref": "#/definitions/StandardType", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." }, "value": { "anyOf": [ { "type": "string" }, { "type": "null" }, { "$ref": "#/definitions/ExprRef" } ], "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." } }, "type": "object" }, "key": { "additionalProperties": false, "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/BinParams" }, { "const": "binned", "type": "string" }, { "type": "null" } ], "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "$ref": "#/definitions/StandardType", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } }, "type": "object" }, "latitude": { "additionalProperties": false, "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation.", "type": "null" }, "datum": { "anyOf": [ { "$ref": "#/definitions/PrimitiveValue" }, { "$ref": "#/definitions/DateTime" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/RepeatRef" } ], "description": "A constant value in data domain." }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "anyOf": [ { "const": "quantitative", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation.", "type": "string" }, { "$ref": "#/definitions/Type", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } ], "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } }, "type": "object" }, "latitude2": { "additionalProperties": false, "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation.", "type": "null" }, "datum": { "anyOf": [ { "$ref": "#/definitions/PrimitiveValue" }, { "$ref": "#/definitions/DateTime" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/RepeatRef" } ], "description": "A constant value in data domain." }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "$ref": "#/definitions/Type", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." }, "value": { "anyOf": [ { "type": "number" }, { "const": "width", "type": "string" }, { "const": "height", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ], "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." } }, "type": "object" }, "longitude": { "additionalProperties": false, "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation.", "type": "null" }, "datum": { "anyOf": [ { "$ref": "#/definitions/PrimitiveValue" }, { "$ref": "#/definitions/DateTime" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/RepeatRef" } ], "description": "A constant value in data domain." }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "anyOf": [ { "const": "quantitative", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation.", "type": "string" }, { "$ref": "#/definitions/Type", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } ], "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } }, "type": "object" }, "longitude2": { "additionalProperties": false, "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation.", "type": "null" }, "datum": { "anyOf": [ { "$ref": "#/definitions/PrimitiveValue" }, { "$ref": "#/definitions/DateTime" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/RepeatRef" } ], "description": "A constant value in data domain." }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "$ref": "#/definitions/Type", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." }, "value": { "anyOf": [ { "type": "number" }, { "const": "width", "type": "string" }, { "const": "height", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ], "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." } }, "type": "object" }, "opacity": { "additionalProperties": false, "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/BinParams" }, { "type": "null" } ], "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." }, "condition": { "anyOf": [ { "anyOf": [ { "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" }, "type": "array" } ], "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." }, { "anyOf": [ { "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" }, { "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" }, "type": "array" } ], "description": "A field definition or one or more value definition(s) with a parameter predicate." } ], "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." }, "datum": { "anyOf": [ { "$ref": "#/definitions/PrimitiveValue" }, { "$ref": "#/definitions/DateTime" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/RepeatRef" } ], "description": "A constant value in data domain." }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "legend": { "anyOf": [ { "$ref": "#/definitions/Legend" }, { "type": "null" } ], "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." }, "scale": { "anyOf": [ { "$ref": "#/definitions/Scale" }, { "type": "null" } ], "description": "An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." }, "sort": { "$ref": "#/definitions/Sort", "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript.\n- [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`.\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "anyOf": [ { "$ref": "#/definitions/StandardType", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." }, { "$ref": "#/definitions/Type", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } ], "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." }, "value": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." } }, "type": "object" }, "order": { "anyOf": [ { "$ref": "#/definitions/OrderFieldDef" }, { "items": { "$ref": "#/definitions/OrderFieldDef" }, "type": "array" }, { "$ref": "#/definitions/OrderValueDef" }, { "$ref": "#/definitions/OrderOnlyDef" } ], "description": "Order of the marks.\n- For stacked marks, this `order` channel encodes [stack order](https://vega.github.io/vega-lite/docs/stack.html#order).\n- For line and trail marks, this `order` channel encodes order of data points in the lines. This can be useful for creating [a connected scatterplot](https://vega.github.io/vega-lite/examples/connected_scatterplot.html). Setting `order` to `{\"value\": null}` makes the line marks use the original order in the data sources.\n- Otherwise, this `order` channel encodes layer order of the marks.\n\n__Note__: In aggregate plots, `order` field should be `aggregate`d to avoid creating additional aggregation grouping." }, "radius": { "additionalProperties": false, "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/BinParams" }, { "const": "binned", "type": "string" }, { "type": "null" } ], "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." }, "datum": { "anyOf": [ { "$ref": "#/definitions/PrimitiveValue" }, { "$ref": "#/definitions/DateTime" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/RepeatRef" } ], "description": "A constant value in data domain." }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "scale": { "anyOf": [ { "$ref": "#/definitions/Scale" }, { "type": "null" } ], "description": "An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." }, "sort": { "$ref": "#/definitions/Sort", "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript.\n- [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`.\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." }, "stack": { "anyOf": [ { "$ref": "#/definitions/StackOffset" }, { "type": "null" }, { "type": "boolean" } ], "description": "Type of stacking offset if the field should be stacked. `stack` is only applicable for `x`, `y`, `theta`, and `radius` channels with continuous domains. For example, `stack` of `y` can be used to customize stacking for a vertical bar chart.\n\n`stack` can be one of the following values:\n- `\"zero\"` or `true`: stacking with baseline offset at zero value of the scale (for creating typical stacked [bar](https://vega.github.io/vega-lite/docs/stack.html#bar) and [area](https://vega.github.io/vega-lite/docs/stack.html#area) chart).\n- `\"normalize\"` - stacking with normalized domain (for creating [normalized stacked bar and area charts](https://vega.github.io/vega-lite/docs/stack.html#normalized) and pie charts [with percentage tooltip](https://vega.github.io/vega-lite/docs/arc.html#tooltip)).
\n-`\"center\"` - stacking with center baseline (for [streamgraph](https://vega.github.io/vega-lite/docs/stack.html#streamgraph)).\n- `null` or `false` - No-stacking. This will produce layered [bar](https://vega.github.io/vega-lite/docs/stack.html#layered-bar-chart) and area chart.\n\n__Default value:__ `zero` for plots with all of the following conditions are true: (1) the mark is `bar`, `area`, or `arc`; (2) the stacked measure channel (x or y) has a linear scale; (3) At least one of non-position channels mapped to an unaggregated field that is different from x and y. Otherwise, `null` by default.\n\n__See also:__ [`stack`](https://vega.github.io/vega-lite/docs/stack.html) documentation." }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "anyOf": [ { "$ref": "#/definitions/StandardType", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." }, { "$ref": "#/definitions/Type", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } ], "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." }, "value": { "anyOf": [ { "type": "number" }, { "const": "width", "type": "string" }, { "const": "height", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ], "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." } }, "type": "object" }, "radius2": { "additionalProperties": false, "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation.", "type": "null" }, "datum": { "anyOf": [ { "$ref": "#/definitions/PrimitiveValue" }, { "$ref": "#/definitions/DateTime" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/RepeatRef" } ], "description": "A constant value in data domain." }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "$ref": "#/definitions/Type", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." }, "value": { "anyOf": [ { "type": "number" }, { "const": "width", "type": "string" }, { "const": "height", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ], "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." } }, "type": "object" }, "shape": { "additionalProperties": false, "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/BinParams" }, { "type": "null" } ], "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." }, "condition": { "anyOf": [ { "anyOf": [ { "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" }, "type": "array" } ], "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." }, { "anyOf": [ { "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" }, { "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" }, "type": "array" } ], "description": "A field definition or one or more value definition(s) with a parameter predicate." } ], "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." }, "datum": { "anyOf": [ { "$ref": "#/definitions/PrimitiveValue" }, { "$ref": "#/definitions/DateTime" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/RepeatRef" } ], "description": "A constant value in data domain." }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "legend": { "anyOf": [ { "$ref": "#/definitions/Legend" }, { "type": "null" } ], "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." }, "scale": { "anyOf": [ { "$ref": "#/definitions/Scale" }, { "type": "null" } ], "description": "An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." }, "sort": { "$ref": "#/definitions/Sort", "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript.\n- [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`.\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "anyOf": [ { "$ref": "#/definitions/TypeForShape", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." }, { "$ref": "#/definitions/Type", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } ], "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." }, "value": { "anyOf": [ { "type": "string" }, { "type": "null" }, { "$ref": "#/definitions/ExprRef" } ], "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." } }, "type": "object" }, "size": { "additionalProperties": false, "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/BinParams" }, { "type": "null" } ], "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." }, "condition": { "anyOf": [ { "anyOf": [ { "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" }, "type": "array" } ], "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." }, { "anyOf": [ { "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" }, { "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" }, "type": "array" } ], "description": "A field definition or one or more value definition(s) with a parameter predicate." } ], "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." }, "datum": { "anyOf": [ { "$ref": "#/definitions/PrimitiveValue" }, { "$ref": "#/definitions/DateTime" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/RepeatRef" } ], "description": "A constant value in data domain." }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "legend": { "anyOf": [ { "$ref": "#/definitions/Legend" }, { "type": "null" } ], "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." }, "scale": { "anyOf": [ { "$ref": "#/definitions/Scale" }, { "type": "null" } ], "description": "An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." }, "sort": { "$ref": "#/definitions/Sort", "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript.\n- [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`.\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "anyOf": [ { "$ref": "#/definitions/StandardType", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." }, { "$ref": "#/definitions/Type", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } ], "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." }, "value": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." } }, "type": "object" }, "stroke": { "additionalProperties": false, "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/BinParams" }, { "type": "null" } ], "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." }, "condition": { "anyOf": [ { "anyOf": [ { "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" }, "type": "array" } ], "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." }, { "anyOf": [ { "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" }, { "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" }, "type": "array" } ], "description": "A field definition or one or more value definition(s) with a parameter predicate." } ], "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." }, "datum": { "anyOf": [ { "$ref": "#/definitions/PrimitiveValue" }, { "$ref": "#/definitions/DateTime" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/RepeatRef" } ], "description": "A constant value in data domain." }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "legend": { "anyOf": [ { "$ref": "#/definitions/Legend" }, { "type": "null" } ], "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." }, "scale": { "anyOf": [ { "$ref": "#/definitions/Scale" }, { "type": "null" } ], "description": "An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." }, "sort": { "$ref": "#/definitions/Sort", "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript.\n- [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`.\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "anyOf": [ { "$ref": "#/definitions/StandardType", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." }, { "$ref": "#/definitions/Type", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } ], "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." }, "value": { "anyOf": [ { "$ref": "#/definitions/Gradient" }, { "type": "string" }, { "type": "null" }, { "$ref": "#/definitions/ExprRef" } ], "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." } }, "type": "object" }, "strokeDash": { "additionalProperties": false, "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/BinParams" }, { "type": "null" } ], "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." }, "condition": { "anyOf": [ { "anyOf": [ { "$ref": "#/definitions/ConditionalValueDef<(number[]|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalValueDef<(number[]|ExprRef)>" }, "type": "array" } ], "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." }, { "anyOf": [ { "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" }, { "$ref": "#/definitions/ConditionalValueDef<(number[]|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalValueDef<(number[]|ExprRef)>" }, "type": "array" } ], "description": "A field definition or one or more value definition(s) with a parameter predicate." } ], "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." }, "datum": { "anyOf": [ { "$ref": "#/definitions/PrimitiveValue" }, { "$ref": "#/definitions/DateTime" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/RepeatRef" } ], "description": "A constant value in data domain." }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "legend": { "anyOf": [ { "$ref": "#/definitions/Legend" }, { "type": "null" } ], "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." }, "scale": { "anyOf": [ { "$ref": "#/definitions/Scale" }, { "type": "null" } ], "description": "An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." }, "sort": { "$ref": "#/definitions/Sort", "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript.\n- [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`.\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "anyOf": [ { "$ref": "#/definitions/StandardType", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." }, { "$ref": "#/definitions/Type", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } ], "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." }, "value": { "anyOf": [ { "items": { "type": "number" }, "type": "array" }, { "$ref": "#/definitions/ExprRef" } ], "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." } }, "type": "object" }, "strokeOpacity": { "additionalProperties": false, "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/BinParams" }, { "type": "null" } ], "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." }, "condition": { "anyOf": [ { "anyOf": [ { "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" }, "type": "array" } ], "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." }, { "anyOf": [ { "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" }, { "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" }, "type": "array" } ], "description": "A field definition or one or more value definition(s) with a parameter predicate." } ], "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." }, "datum": { "anyOf": [ { "$ref": "#/definitions/PrimitiveValue" }, { "$ref": "#/definitions/DateTime" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/RepeatRef" } ], "description": "A constant value in data domain." }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "legend": { "anyOf": [ { "$ref": "#/definitions/Legend" }, { "type": "null" } ], "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." }, "scale": { "anyOf": [ { "$ref": "#/definitions/Scale" }, { "type": "null" } ], "description": "An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." }, "sort": { "$ref": "#/definitions/Sort", "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript.\n- [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`.\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "anyOf": [ { "$ref": "#/definitions/StandardType", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." }, { "$ref": "#/definitions/Type", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } ], "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." }, "value": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." } }, "type": "object" }, "strokeWidth": { "additionalProperties": false, "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/BinParams" }, { "type": "null" } ], "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." }, "condition": { "anyOf": [ { "anyOf": [ { "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" }, "type": "array" } ], "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." }, { "anyOf": [ { "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" }, { "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" }, "type": "array" } ], "description": "A field definition or one or more value definition(s) with a parameter predicate." } ], "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." }, "datum": { "anyOf": [ { "$ref": "#/definitions/PrimitiveValue" }, { "$ref": "#/definitions/DateTime" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/RepeatRef" } ], "description": "A constant value in data domain." }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "legend": { "anyOf": [ { "$ref": "#/definitions/Legend" }, { "type": "null" } ], "description": "An object defining properties of the legend. If `null`, the legend for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [legend properties](https://vega.github.io/vega-lite/docs/legend.html) are applied.\n\n__See also:__ [`legend`](https://vega.github.io/vega-lite/docs/legend.html) documentation." }, "scale": { "anyOf": [ { "$ref": "#/definitions/Scale" }, { "type": "null" } ], "description": "An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." }, "sort": { "$ref": "#/definitions/Sort", "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript.\n- [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`.\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "anyOf": [ { "$ref": "#/definitions/StandardType", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." }, { "$ref": "#/definitions/Type", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } ], "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." }, "value": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." } }, "type": "object" }, "text": { "additionalProperties": false, "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/BinParams" }, { "const": "binned", "type": "string" }, { "type": "null" } ], "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." }, "condition": { "anyOf": [ { "anyOf": [ { "$ref": "#/definitions/ConditionalValueDef<(Text|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalValueDef<(Text|ExprRef)>" }, "type": "array" } ], "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." }, { "anyOf": [ { "$ref": "#/definitions/ConditionalStringFieldDef" }, { "$ref": "#/definitions/ConditionalValueDef<(Text|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalValueDef<(Text|ExprRef)>" }, "type": "array" } ], "description": "A field definition or one or more value definition(s) with a parameter predicate." } ], "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." }, "datum": { "anyOf": [ { "$ref": "#/definitions/PrimitiveValue" }, { "$ref": "#/definitions/DateTime" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/RepeatRef" } ], "description": "A constant value in data domain." }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "format": { "anyOf": [ { "type": "string" }, { "$ref": "#/definitions/Dict" } ], "description": "When used with the default `\"number\"` and `\"time\"` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks.\n\n- If the format type is `\"number\"` (e.g., for quantitative fields), this is D3's [number format pattern](https://github.com/d3/d3-format#locale_format).\n- If the format type is `\"time\"` (e.g., for temporal fields), this is D3's [time format pattern](https://github.com/d3/d3-time-format#locale_format).\n\nSee the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for more examples.\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." }, "formatType": { "description": "The format type for labels. One of `\"number\"`, `\"time\"`, or a [registered custom format type](https://vega.github.io/vega-lite/docs/config.html#custom-format-type).\n\n__Default value:__\n- `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`.\n- `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", "type": "string" }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "anyOf": [ { "$ref": "#/definitions/StandardType", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." }, { "$ref": "#/definitions/Type", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } ], "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." }, "value": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "$ref": "#/definitions/ExprRef" } ], "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." } }, "type": "object" }, "theta": { "additionalProperties": false, "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/BinParams" }, { "const": "binned", "type": "string" }, { "type": "null" } ], "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." }, "datum": { "anyOf": [ { "$ref": "#/definitions/PrimitiveValue" }, { "$ref": "#/definitions/DateTime" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/RepeatRef" } ], "description": "A constant value in data domain." }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "scale": { "anyOf": [ { "$ref": "#/definitions/Scale" }, { "type": "null" } ], "description": "An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." }, "sort": { "$ref": "#/definitions/Sort", "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript.\n- [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`.\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." }, "stack": { "anyOf": [ { "$ref": "#/definitions/StackOffset" }, { "type": "null" }, { "type": "boolean" } ], "description": "Type of stacking offset if the field should be stacked. `stack` is only applicable for `x`, `y`, `theta`, and `radius` channels with continuous domains. For example, `stack` of `y` can be used to customize stacking for a vertical bar chart.\n\n`stack` can be one of the following values:\n- `\"zero\"` or `true`: stacking with baseline offset at zero value of the scale (for creating typical stacked [bar](https://vega.github.io/vega-lite/docs/stack.html#bar) and [area](https://vega.github.io/vega-lite/docs/stack.html#area) chart).\n- `\"normalize\"` - stacking with normalized domain (for creating [normalized stacked bar and area charts](https://vega.github.io/vega-lite/docs/stack.html#normalized) and pie charts [with percentage tooltip](https://vega.github.io/vega-lite/docs/arc.html#tooltip)).
\n-`\"center\"` - stacking with center baseline (for [streamgraph](https://vega.github.io/vega-lite/docs/stack.html#streamgraph)).\n- `null` or `false` - No-stacking. This will produce layered [bar](https://vega.github.io/vega-lite/docs/stack.html#layered-bar-chart) and area chart.\n\n__Default value:__ `zero` for plots with all of the following conditions are true: (1) the mark is `bar`, `area`, or `arc`; (2) the stacked measure channel (x or y) has a linear scale; (3) At least one of non-position channels mapped to an unaggregated field that is different from x and y. Otherwise, `null` by default.\n\n__See also:__ [`stack`](https://vega.github.io/vega-lite/docs/stack.html) documentation." }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "anyOf": [ { "$ref": "#/definitions/StandardType", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." }, { "$ref": "#/definitions/Type", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } ], "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." }, "value": { "anyOf": [ { "type": "number" }, { "const": "width", "type": "string" }, { "const": "height", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ], "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." } }, "type": "object" }, "theta2": { "additionalProperties": false, "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation.", "type": "null" }, "datum": { "anyOf": [ { "$ref": "#/definitions/PrimitiveValue" }, { "$ref": "#/definitions/DateTime" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/RepeatRef" } ], "description": "A constant value in data domain." }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "$ref": "#/definitions/Type", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." }, "value": { "anyOf": [ { "type": "number" }, { "const": "width", "type": "string" }, { "const": "height", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ], "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." } }, "type": "object" }, "time": { "additionalProperties": false, "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/BinParams" }, { "type": "null" } ], "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "rescale": { "type": "boolean" }, "scale": { "anyOf": [ { "$ref": "#/definitions/Scale" }, { "type": "null" } ], "description": "An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." }, "sort": { "$ref": "#/definitions/Sort", "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript.\n- [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`.\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "$ref": "#/definitions/StandardType", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } }, "type": "object" }, "tooltip": { "anyOf": [ { "$ref": "#/definitions/StringFieldDefWithCondition" }, { "$ref": "#/definitions/StringValueDefWithCondition" }, { "items": { "$ref": "#/definitions/StringFieldDef" }, "type": "array" }, { "type": "null" } ], "description": "The tooltip text to show upon mouse hover. Specifying `tooltip` encoding overrides [the `tooltip` property in the mark definition](https://vega.github.io/vega-lite/docs/mark.html#mark-def).\n\nSee the [`tooltip`](https://vega.github.io/vega-lite/docs/tooltip.html) documentation for a detailed discussion about tooltip in Vega-Lite." }, "url": { "additionalProperties": false, "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/BinParams" }, { "const": "binned", "type": "string" }, { "type": "null" } ], "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." }, "condition": { "anyOf": [ { "anyOf": [ { "$ref": "#/definitions/ConditionalValueDef<(string|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalValueDef<(string|ExprRef)>" }, "type": "array" } ], "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." }, { "anyOf": [ { "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" }, { "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" }, "type": "array" } ], "description": "A field definition or one or more value definition(s) with a parameter predicate." } ], "description": "One or more value definition(s) with [a parameter or a test predicate](https://vega.github.io/vega-lite/docs/condition.html).\n\n__Note:__ A field definition's `condition` property can only contain [conditional value definitions](https://vega.github.io/vega-lite/docs/condition.html#value) since Vega-Lite only allows at most one encoded field per encoding channel." }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "format": { "anyOf": [ { "type": "string" }, { "$ref": "#/definitions/Dict" } ], "description": "When used with the default `\"number\"` and `\"time\"` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks.\n\n- If the format type is `\"number\"` (e.g., for quantitative fields), this is D3's [number format pattern](https://github.com/d3/d3-format#locale_format).\n- If the format type is `\"time\"` (e.g., for temporal fields), this is D3's [time format pattern](https://github.com/d3/d3-time-format#locale_format).\n\nSee the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for more examples.\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." }, "formatType": { "description": "The format type for labels. One of `\"number\"`, `\"time\"`, or a [registered custom format type](https://vega.github.io/vega-lite/docs/config.html#custom-format-type).\n\n__Default value:__\n- `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`.\n- `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", "type": "string" }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "$ref": "#/definitions/StandardType", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." }, "value": { "anyOf": [ { "type": "string" }, { "type": "null" }, { "$ref": "#/definitions/ExprRef" } ], "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." } }, "type": "object" }, "x": { "additionalProperties": false, "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "axis": { "anyOf": [ { "$ref": "#/definitions/Axis" }, { "type": "null" } ], "description": "An object defining properties of axis's gridlines, ticks and labels. If `null`, the axis for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [axis properties](https://vega.github.io/vega-lite/docs/axis.html) are applied.\n\n__See also:__ [`axis`](https://vega.github.io/vega-lite/docs/axis.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/BinParams" }, { "const": "binned", "type": "string" }, { "type": "null" } ], "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." }, "datum": { "anyOf": [ { "$ref": "#/definitions/PrimitiveValue" }, { "$ref": "#/definitions/DateTime" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/RepeatRef" } ], "description": "A constant value in data domain." }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "impute": { "anyOf": [ { "$ref": "#/definitions/ImputeParams" }, { "type": "null" } ], "description": "An object defining the properties of the Impute Operation to be applied. The field value of the other positional channel is taken as `key` of the `Impute` Operation. The field of the `color` channel if specified is used as `groupby` of the `Impute` Operation.\n\n__See also:__ [`impute`](https://vega.github.io/vega-lite/docs/impute.html) documentation." }, "scale": { "anyOf": [ { "$ref": "#/definitions/Scale" }, { "type": "null" } ], "description": "An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." }, "sort": { "$ref": "#/definitions/Sort", "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript.\n- [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`.\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." }, "stack": { "anyOf": [ { "$ref": "#/definitions/StackOffset" }, { "type": "null" }, { "type": "boolean" } ], "description": "Type of stacking offset if the field should be stacked. `stack` is only applicable for `x`, `y`, `theta`, and `radius` channels with continuous domains. For example, `stack` of `y` can be used to customize stacking for a vertical bar chart.\n\n`stack` can be one of the following values:\n- `\"zero\"` or `true`: stacking with baseline offset at zero value of the scale (for creating typical stacked [bar](https://vega.github.io/vega-lite/docs/stack.html#bar) and [area](https://vega.github.io/vega-lite/docs/stack.html#area) chart).\n- `\"normalize\"` - stacking with normalized domain (for creating [normalized stacked bar and area charts](https://vega.github.io/vega-lite/docs/stack.html#normalized) and pie charts [with percentage tooltip](https://vega.github.io/vega-lite/docs/arc.html#tooltip)).
\n-`\"center\"` - stacking with center baseline (for [streamgraph](https://vega.github.io/vega-lite/docs/stack.html#streamgraph)).\n- `null` or `false` - No-stacking. This will produce layered [bar](https://vega.github.io/vega-lite/docs/stack.html#layered-bar-chart) and area chart.\n\n__Default value:__ `zero` for plots with all of the following conditions are true: (1) the mark is `bar`, `area`, or `arc`; (2) the stacked measure channel (x or y) has a linear scale; (3) At least one of non-position channels mapped to an unaggregated field that is different from x and y. Otherwise, `null` by default.\n\n__See also:__ [`stack`](https://vega.github.io/vega-lite/docs/stack.html) documentation." }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "anyOf": [ { "$ref": "#/definitions/StandardType", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." }, { "$ref": "#/definitions/Type", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } ], "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." }, "value": { "anyOf": [ { "type": "number" }, { "const": "width", "type": "string" }, { "const": "height", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ], "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." } }, "type": "object" }, "x2": { "additionalProperties": false, "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation.", "type": "null" }, "datum": { "anyOf": [ { "$ref": "#/definitions/PrimitiveValue" }, { "$ref": "#/definitions/DateTime" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/RepeatRef" } ], "description": "A constant value in data domain." }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "$ref": "#/definitions/Type", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." }, "value": { "anyOf": [ { "type": "number" }, { "const": "width", "type": "string" }, { "const": "height", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ], "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." } }, "type": "object" }, "xError": { "additionalProperties": false, "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation.", "type": "null" }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "value": { "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity).", "type": "number" } }, "type": "object" }, "xError2": { "additionalProperties": false, "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation.", "type": "null" }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "value": { "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity).", "type": "number" } }, "type": "object" }, "xOffset": { "additionalProperties": false, "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/BinParams" }, { "type": "null" } ], "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." }, "datum": { "anyOf": [ { "$ref": "#/definitions/PrimitiveValue" }, { "$ref": "#/definitions/DateTime" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/RepeatRef" } ], "description": "A constant value in data domain." }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "scale": { "anyOf": [ { "$ref": "#/definitions/Scale" }, { "type": "null" } ], "description": "An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." }, "sort": { "$ref": "#/definitions/Sort", "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript.\n- [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`.\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "anyOf": [ { "$ref": "#/definitions/StandardType", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." }, { "$ref": "#/definitions/Type", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } ], "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." }, "value": { "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity).", "type": "number" } }, "type": "object" }, "y": { "additionalProperties": false, "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "axis": { "anyOf": [ { "$ref": "#/definitions/Axis" }, { "type": "null" } ], "description": "An object defining properties of axis's gridlines, ticks and labels. If `null`, the axis for the encoding channel will be removed.\n\n__Default value:__ If undefined, default [axis properties](https://vega.github.io/vega-lite/docs/axis.html) are applied.\n\n__See also:__ [`axis`](https://vega.github.io/vega-lite/docs/axis.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/BinParams" }, { "const": "binned", "type": "string" }, { "type": "null" } ], "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." }, "datum": { "anyOf": [ { "$ref": "#/definitions/PrimitiveValue" }, { "$ref": "#/definitions/DateTime" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/RepeatRef" } ], "description": "A constant value in data domain." }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "impute": { "anyOf": [ { "$ref": "#/definitions/ImputeParams" }, { "type": "null" } ], "description": "An object defining the properties of the Impute Operation to be applied. The field value of the other positional channel is taken as `key` of the `Impute` Operation. The field of the `color` channel if specified is used as `groupby` of the `Impute` Operation.\n\n__See also:__ [`impute`](https://vega.github.io/vega-lite/docs/impute.html) documentation." }, "scale": { "anyOf": [ { "$ref": "#/definitions/Scale" }, { "type": "null" } ], "description": "An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." }, "sort": { "$ref": "#/definitions/Sort", "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript.\n- [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`.\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." }, "stack": { "anyOf": [ { "$ref": "#/definitions/StackOffset" }, { "type": "null" }, { "type": "boolean" } ], "description": "Type of stacking offset if the field should be stacked. `stack` is only applicable for `x`, `y`, `theta`, and `radius` channels with continuous domains. For example, `stack` of `y` can be used to customize stacking for a vertical bar chart.\n\n`stack` can be one of the following values:\n- `\"zero\"` or `true`: stacking with baseline offset at zero value of the scale (for creating typical stacked [bar](https://vega.github.io/vega-lite/docs/stack.html#bar) and [area](https://vega.github.io/vega-lite/docs/stack.html#area) chart).\n- `\"normalize\"` - stacking with normalized domain (for creating [normalized stacked bar and area charts](https://vega.github.io/vega-lite/docs/stack.html#normalized) and pie charts [with percentage tooltip](https://vega.github.io/vega-lite/docs/arc.html#tooltip)).
\n-`\"center\"` - stacking with center baseline (for [streamgraph](https://vega.github.io/vega-lite/docs/stack.html#streamgraph)).\n- `null` or `false` - No-stacking. This will produce layered [bar](https://vega.github.io/vega-lite/docs/stack.html#layered-bar-chart) and area chart.\n\n__Default value:__ `zero` for plots with all of the following conditions are true: (1) the mark is `bar`, `area`, or `arc`; (2) the stacked measure channel (x or y) has a linear scale; (3) At least one of non-position channels mapped to an unaggregated field that is different from x and y. Otherwise, `null` by default.\n\n__See also:__ [`stack`](https://vega.github.io/vega-lite/docs/stack.html) documentation." }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "anyOf": [ { "$ref": "#/definitions/StandardType", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." }, { "$ref": "#/definitions/Type", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } ], "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." }, "value": { "anyOf": [ { "type": "number" }, { "const": "width", "type": "string" }, { "const": "height", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ], "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." } }, "type": "object" }, "y2": { "additionalProperties": false, "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation.", "type": "null" }, "datum": { "anyOf": [ { "$ref": "#/definitions/PrimitiveValue" }, { "$ref": "#/definitions/DateTime" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/RepeatRef" } ], "description": "A constant value in data domain." }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "$ref": "#/definitions/Type", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." }, "value": { "anyOf": [ { "type": "number" }, { "const": "width", "type": "string" }, { "const": "height", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ], "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." } }, "type": "object" }, "yError": { "additionalProperties": false, "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation.", "type": "null" }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "value": { "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity).", "type": "number" } }, "type": "object" }, "yError2": { "additionalProperties": false, "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation.", "type": "null" }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "value": { "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity).", "type": "number" } }, "type": "object" }, "yOffset": { "additionalProperties": false, "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/BinParams" }, { "type": "null" } ], "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." }, "datum": { "anyOf": [ { "$ref": "#/definitions/PrimitiveValue" }, { "$ref": "#/definitions/DateTime" }, { "$ref": "#/definitions/ExprRef" }, { "$ref": "#/definitions/RepeatRef" } ], "description": "A constant value in data domain." }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "scale": { "anyOf": [ { "$ref": "#/definitions/Scale" }, { "type": "null" } ], "description": "An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." }, "sort": { "$ref": "#/definitions/Sort", "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript.\n- [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`.\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "anyOf": [ { "$ref": "#/definitions/StandardType", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." }, { "$ref": "#/definitions/Type", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } ], "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." }, "value": { "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity).", "type": "number" } }, "type": "object" } }, "type": "object" }, "SingleDefUnitChannel": { "enum": [ "text", "shape", "x", "y", "xOffset", "yOffset", "x2", "y2", "longitude", "latitude", "longitude2", "latitude2", "theta", "theta2", "radius", "radius2", "time", "color", "fill", "stroke", "opacity", "fillOpacity", "strokeOpacity", "strokeWidth", "strokeDash", "size", "angle", "key", "href", "url", "description" ], "type": "string" }, "SingleTimeUnit": { "anyOf": [ { "$ref": "#/definitions/LocalSingleTimeUnit" }, { "$ref": "#/definitions/UtcSingleTimeUnit" } ] }, "Sort": { "anyOf": [ { "$ref": "#/definitions/SortArray" }, { "$ref": "#/definitions/AllSortString" }, { "$ref": "#/definitions/EncodingSortField" }, { "$ref": "#/definitions/SortByEncoding" }, { "type": "null" } ] }, "SortArray": { "anyOf": [ { "items": { "type": "number" }, "type": "array" }, { "items": { "type": "string" }, "type": "array" }, { "items": { "type": "boolean" }, "type": "array" }, { "items": { "$ref": "#/definitions/DateTime" }, "type": "array" } ] }, "SortByChannel": { "enum": [ "x", "y", "color", "fill", "stroke", "strokeWidth", "size", "shape", "fillOpacity", "strokeOpacity", "opacity", "text" ], "type": "string" }, "SortByChannelDesc": { "enum": [ "-x", "-y", "-color", "-fill", "-stroke", "-strokeWidth", "-size", "-shape", "-fillOpacity", "-strokeOpacity", "-opacity", "-text" ], "type": "string" }, "SortByEncoding": { "additionalProperties": false, "properties": { "encoding": { "$ref": "#/definitions/SortByChannel", "description": "The [encoding channel](https://vega.github.io/vega-lite/docs/encoding.html#channels) to sort by (e.g., `\"x\"`, `\"y\"`)" }, "order": { "anyOf": [ { "$ref": "#/definitions/SortOrder" }, { "type": "null" } ], "description": "The sort order. One of `\"ascending\"` (default), `\"descending\"`, or `null` (no not sort)." } }, "required": [ "encoding" ], "type": "object" }, "SortField": { "additionalProperties": false, "description": "A sort definition for transform", "properties": { "field": { "$ref": "#/definitions/FieldName", "description": "The name of the field to sort." }, "order": { "anyOf": [ { "$ref": "#/definitions/SortOrder" }, { "type": "null" } ], "description": "Whether to sort the field in ascending or descending order. One of `\"ascending\"` (default), `\"descending\"`, or `null` (no not sort)." } }, "required": [ "field" ], "type": "object" }, "SortOrder": { "enum": [ "ascending", "descending" ], "type": "string" }, "SphereGenerator": { "additionalProperties": false, "properties": { "name": { "description": "Provide a placeholder name and bind data at runtime.", "type": "string" }, "sphere": { "anyOf": [ { "const": true, "type": "boolean" }, { "additionalProperties": false, "type": "object" } ], "description": "Generate sphere GeoJSON data for the full globe." } }, "required": [ "sphere" ], "type": "object" }, "StackOffset": { "enum": [ "zero", "center", "normalize" ], "type": "string" }, "StackTransform": { "additionalProperties": false, "properties": { "as": { "anyOf": [ { "$ref": "#/definitions/FieldName" }, { "items": { "$ref": "#/definitions/FieldName" }, "maxItems": 2, "minItems": 2, "type": "array" } ], "description": "Output field names. This can be either a string or an array of strings with two elements denoting the name for the fields for stack start and stack end respectively. If a single string(e.g., `\"val\"`) is provided, the end field will be `\"val_end\"`." }, "groupby": { "description": "The data fields to group by.", "items": { "$ref": "#/definitions/FieldName" }, "type": "array" }, "offset": { "description": "Mode for stacking marks. One of `\"zero\"` (default), `\"center\"`, or `\"normalize\"`. The `\"zero\"` offset will stack starting at `0`. The `\"center\"` offset will center the stacks. The `\"normalize\"` offset will compute percentage values for each stack point, with output values in the range `[0,1]`.\n\n__Default value:__ `\"zero\"`", "enum": [ "zero", "center", "normalize" ], "type": "string" }, "sort": { "description": "Field that determines the order of leaves in the stacked charts.", "items": { "$ref": "#/definitions/SortField" }, "type": "array" }, "stack": { "$ref": "#/definitions/FieldName", "description": "The field which is stacked." } }, "required": [ "stack", "groupby", "as" ], "type": "object" }, "StandardType": { "enum": [ "quantitative", "ordinal", "temporal", "nominal" ], "type": "string" }, "Step": { "additionalProperties": false, "properties": { "for": { "$ref": "#/definitions/StepFor", "description": "Whether to apply the step to position scale or offset scale when there are both `x` and `xOffset` or both `y` and `yOffset` encodings." }, "step": { "description": "The size (width/height) per discrete step.", "type": "number" } }, "required": [ "step" ], "type": "object" }, "StepFor": { "enum": [ "position", "offset" ], "type": "string" }, "Stream": { "anyOf": [ { "$ref": "#/definitions/EventStream" }, { "$ref": "#/definitions/DerivedStream" }, { "$ref": "#/definitions/MergedStream" } ] }, "StringFieldDef": { "additionalProperties": false, "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/BinParams" }, { "const": "binned", "type": "string" }, { "type": "null" } ], "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "format": { "anyOf": [ { "type": "string" }, { "$ref": "#/definitions/Dict" } ], "description": "When used with the default `\"number\"` and `\"time\"` format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks.\n\n- If the format type is `\"number\"` (e.g., for quantitative fields), this is D3's [number format pattern](https://github.com/d3/d3-format#locale_format).\n- If the format type is `\"time\"` (e.g., for temporal fields), this is D3's [time format pattern](https://github.com/d3/d3-time-format#locale_format).\n\nSee the [format documentation](https://vega.github.io/vega-lite/docs/format.html) for more examples.\n\nWhen used with a [custom `formatType`](https://vega.github.io/vega-lite/docs/config.html#custom-format-type), this value will be passed as `format` alongside `datum.value` to the registered function.\n\n__Default value:__ Derived from [numberFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for number format and from [timeFormat](https://vega.github.io/vega-lite/docs/config.html#format) config for time format." }, "formatType": { "description": "The format type for labels. One of `\"number\"`, `\"time\"`, or a [registered custom format type](https://vega.github.io/vega-lite/docs/config.html#custom-format-type).\n\n__Default value:__\n- `\"time\"` for temporal fields and ordinal and nominal fields with `timeUnit`.\n- `\"number\"` for quantitative fields as well as ordinal and nominal fields without `timeUnit`.", "type": "string" }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "$ref": "#/definitions/StandardType", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } }, "type": "object" }, "StringFieldDefWithCondition": { "$ref": "#/definitions/FieldOrDatumDefWithCondition" }, "StringValueDefWithCondition": { "$ref": "#/definitions/ValueDefWithCondition" }, "StrokeCap": { "enum": [ "butt", "round", "square" ], "type": "string" }, "StrokeJoin": { "enum": [ "miter", "round", "bevel" ], "type": "string" }, "StyleConfigIndex": { "additionalProperties": { "anyOf": [ { "$ref": "#/definitions/AnyMarkConfig" }, { "$ref": "#/definitions/Axis" } ] }, "properties": { "arc": { "$ref": "#/definitions/RectConfig", "description": "Arc-specific Config" }, "area": { "$ref": "#/definitions/AreaConfig", "description": "Area-Specific Config" }, "bar": { "$ref": "#/definitions/BarConfig", "description": "Bar-Specific Config" }, "circle": { "$ref": "#/definitions/MarkConfig", "description": "Circle-Specific Config" }, "geoshape": { "$ref": "#/definitions/MarkConfig", "description": "Geoshape-Specific Config" }, "group-subtitle": { "$ref": "#/definitions/MarkConfig", "description": "Default style for chart subtitles" }, "group-title": { "$ref": "#/definitions/MarkConfig", "description": "Default style for chart titles" }, "guide-label": { "$ref": "#/definitions/MarkConfig", "description": "Default style for axis, legend, and header labels." }, "guide-title": { "$ref": "#/definitions/MarkConfig", "description": "Default style for axis, legend, and header titles." }, "image": { "$ref": "#/definitions/RectConfig", "description": "Image-specific Config" }, "line": { "$ref": "#/definitions/LineConfig", "description": "Line-Specific Config" }, "mark": { "$ref": "#/definitions/MarkConfig", "description": "Mark Config" }, "point": { "$ref": "#/definitions/MarkConfig", "description": "Point-Specific Config" }, "rect": { "$ref": "#/definitions/RectConfig", "description": "Rect-Specific Config" }, "rule": { "$ref": "#/definitions/MarkConfig", "description": "Rule-Specific Config" }, "square": { "$ref": "#/definitions/MarkConfig", "description": "Square-Specific Config" }, "text": { "$ref": "#/definitions/MarkConfig", "description": "Text-Specific Config" }, "tick": { "$ref": "#/definitions/TickConfig", "description": "Tick-Specific Config" }, "trail": { "$ref": "#/definitions/LineConfig", "description": "Trail-Specific Config" } }, "type": "object" }, "SymbolShape": { "type": "string" }, "Text": { "anyOf": [ { "type": "string" }, { "items": { "type": "string" }, "type": "array" } ] }, "TextBaseline": { "anyOf": [ { "const": "alphabetic", "type": "string" }, { "$ref": "#/definitions/Baseline" }, { "const": "line-top", "type": "string" }, { "const": "line-bottom", "type": "string" } ] }, "TextDef": { "anyOf": [ { "$ref": "#/definitions/FieldOrDatumDefWithCondition" }, { "$ref": "#/definitions/FieldOrDatumDefWithCondition" }, { "$ref": "#/definitions/ValueDefWithCondition" } ] }, "TextDirection": { "enum": [ "ltr", "rtl" ], "type": "string" }, "TickConfig": { "additionalProperties": false, "properties": { "align": { "anyOf": [ { "$ref": "#/definitions/Align" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One of `\"left\"`, `\"right\"`, `\"center\"`.\n\n__Note:__ Expression reference is *not* supported for range marks." }, "angle": { "anyOf": [ { "description": "The rotation angle of the text, in degrees.", "maximum": 360, "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "aria": { "anyOf": [ { "description": "A boolean flag indicating if [ARIA attributes](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) should be included (SVG output only). If `false`, the \"aria-hidden\" attribute will be set on the output SVG element, removing the mark item from the ARIA accessibility tree.", "type": "boolean" }, { "$ref": "#/definitions/ExprRef" } ] }, "ariaRole": { "anyOf": [ { "description": "Sets the type of user interface element of the mark item for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only). If specified, this property determines the \"role\" attribute. Warning: this property is experimental and may be changed in the future.", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "ariaRoleDescription": { "anyOf": [ { "description": "A human-readable, author-localized description for the role of the mark item for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only). If specified, this property determines the \"aria-roledescription\" attribute. Warning: this property is experimental and may be changed in the future.", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "aspect": { "anyOf": [ { "description": "Whether to keep aspect ratio of image marks.", "type": "boolean" }, { "$ref": "#/definitions/ExprRef" } ] }, "bandSize": { "description": "The width of the ticks.\n\n__Default value:__ 3/4 of step (width step for horizontal ticks and height step for vertical ticks).", "minimum": 0, "type": "number" }, "baseline": { "anyOf": [ { "$ref": "#/definitions/TextBaseline" }, { "$ref": "#/definitions/ExprRef" } ], "description": "For text marks, the vertical text baseline. One of `\"alphabetic\"` (default), `\"top\"`, `\"middle\"`, `\"bottom\"`, `\"line-top\"`, `\"line-bottom\"`, or an expression reference that provides one of the valid values. The `\"line-top\"` and `\"line-bottom\"` values operate similarly to `\"top\"` and `\"bottom\"`, but are calculated relative to the `lineHeight` rather than `fontSize` alone.\n\nFor range marks, the vertical alignment of the marks. One of `\"top\"`, `\"middle\"`, `\"bottom\"`.\n\n__Note:__ Expression reference is *not* supported for range marks." }, "binSpacing": { "description": "Offset between bars for binned field. The ideal value for this is either 0 (preferred by statisticians) or 1 (Vega-Lite default, D3 example style).\n\n__Default value:__ `1`", "minimum": 0, "type": "number" }, "blend": { "anyOf": [ { "$ref": "#/definitions/Blend", "description": "The color blend mode for drawing an item on its current background. Any valid [CSS mix-blend-mode](https://developer.mozilla.org/en-US/docs/Web/CSS/mix-blend-mode) value can be used.\n\n__Default value: `\"source-over\"`" }, { "$ref": "#/definitions/ExprRef" } ] }, "color": { "anyOf": [ { "$ref": "#/definitions/Color" }, { "$ref": "#/definitions/Gradient" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Default color.\n\n__Default value:__ `\"#4682b4\"`\n\n__Note:__\n- This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).\n- The `fill` and `stroke` properties have higher precedence than `color` and will override `color`." }, "continuousBandSize": { "description": "The default size of the bars on continuous scales.\n\n__Default value:__ `5`", "minimum": 0, "type": "number" }, "cornerRadius": { "anyOf": [ { "description": "The radius in pixels of rounded rectangles or arcs' corners.\n\n__Default value:__ `0`", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "cornerRadiusBottomLeft": { "anyOf": [ { "description": "The radius in pixels of rounded rectangles' bottom left corner.\n\n__Default value:__ `0`", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "cornerRadiusBottomRight": { "anyOf": [ { "description": "The radius in pixels of rounded rectangles' bottom right corner.\n\n__Default value:__ `0`", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "cornerRadiusTopLeft": { "anyOf": [ { "description": "The radius in pixels of rounded rectangles' top right corner.\n\n__Default value:__ `0`", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "cornerRadiusTopRight": { "anyOf": [ { "description": "The radius in pixels of rounded rectangles' top left corner.\n\n__Default value:__ `0`", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "cursor": { "anyOf": [ { "$ref": "#/definitions/Cursor", "description": "The mouse cursor used over the mark. Any valid [CSS cursor type](https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values) can be used." }, { "$ref": "#/definitions/ExprRef" } ] }, "description": { "anyOf": [ { "description": "A text description of the mark item for [ARIA accessibility](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) (SVG output only). If specified, this property determines the [\"aria-label\" attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute).", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "dir": { "anyOf": [ { "$ref": "#/definitions/TextDirection", "description": "The direction of the text. One of `\"ltr\"` (left-to-right) or `\"rtl\"` (right-to-left). This property determines on which side is truncated in response to the limit parameter.\n\n__Default value:__ `\"ltr\"`" }, { "$ref": "#/definitions/ExprRef" } ] }, "discreteBandSize": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/RelativeBandSize" } ], "description": "The default size of the bars with discrete dimensions. If unspecified, the default size is `step-2`, which provides 2 pixel offset between bars.", "minimum": 0 }, "dx": { "anyOf": [ { "description": "The horizontal offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "dy": { "anyOf": [ { "description": "The vertical offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the _angle_ property.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "ellipsis": { "anyOf": [ { "description": "The ellipsis string for text truncated in response to the limit parameter.\n\n__Default value:__ `\"…\"`", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "endAngle": { "anyOf": [ { "description": "The end angle in radians for arc marks. A value of `0` indicates up (north), increasing values proceed clockwise.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "fill": { "anyOf": [ { "$ref": "#/definitions/Color" }, { "$ref": "#/definitions/Gradient" }, { "type": "null" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Default fill color. This property has higher precedence than `config.color`. Set to `null` to remove fill.\n\n__Default value:__ (None)" }, "fillOpacity": { "anyOf": [ { "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", "maximum": 1, "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "filled": { "description": "Whether the mark's color should be used as fill color instead of stroke color.\n\n__Default value:__ `false` for all `point`, `line`, and `rule` marks as well as `geoshape` marks for [`graticule`](https://vega.github.io/vega-lite/docs/data.html#graticule) data sources; otherwise, `true`.\n\n__Note:__ This property cannot be used in a [style config](https://vega.github.io/vega-lite/docs/mark.html#style-config).", "type": "boolean" }, "font": { "anyOf": [ { "description": "The typeface to set the text in (e.g., `\"Helvetica Neue\"`).", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "fontSize": { "anyOf": [ { "description": "The font size, in pixels.\n\n__Default value:__ `11`", "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "fontStyle": { "anyOf": [ { "$ref": "#/definitions/FontStyle", "description": "The font style (e.g., `\"italic\"`)." }, { "$ref": "#/definitions/ExprRef" } ] }, "fontWeight": { "anyOf": [ { "$ref": "#/definitions/FontWeight", "description": "The font weight. This can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." }, { "$ref": "#/definitions/ExprRef" } ] }, "height": { "anyOf": [ { "description": "Height of the marks.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "href": { "anyOf": [ { "$ref": "#/definitions/URI", "description": "A URL to load upon mouse click. If defined, the mark acts as a hyperlink." }, { "$ref": "#/definitions/ExprRef" } ] }, "innerRadius": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The inner radius in pixels of arc marks. `innerRadius` is an alias for `radius2`.\n\n__Default value:__ `0`", "minimum": 0 }, "interpolate": { "anyOf": [ { "$ref": "#/definitions/Interpolate", "description": "The line interpolation method to use for line and area marks. One of the following:\n- `\"linear\"`: piecewise linear segments, as in a polyline.\n- `\"linear-closed\"`: close the linear segments to form a polygon.\n- `\"step\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"step-before\"`: alternate between vertical and horizontal segments, as in a step function.\n- `\"step-after\"`: alternate between horizontal and vertical segments, as in a step function.\n- `\"basis\"`: a B-spline, with control point duplication on the ends.\n- `\"basis-open\"`: an open B-spline; may not intersect the start or end.\n- `\"basis-closed\"`: a closed B-spline, as in a loop.\n- `\"cardinal\"`: a Cardinal spline, with control point duplication on the ends.\n- `\"cardinal-open\"`: an open Cardinal spline; may not intersect the start or end, but will intersect other control points.\n- `\"cardinal-closed\"`: a closed Cardinal spline, as in a loop.\n- `\"bundle\"`: equivalent to basis, except the tension parameter is used to straighten the spline.\n- `\"monotone\"`: cubic interpolation that preserves monotonicity in y." }, { "$ref": "#/definitions/ExprRef" } ] }, "invalid": { "anyOf": [ { "$ref": "#/definitions/MarkInvalidDataMode" }, { "type": "null" } ], "description": "Invalid data mode, which defines how the marks and corresponding scales should represent invalid values (`null` and `NaN` in continuous scales *without* defined output for invalid values).\n\n- `\"filter\"` — *Exclude* all invalid values from the visualization's *marks* and *scales*. For path marks (for line, area, trail), this option will create paths that connect valid points, as if the data rows with invalid values do not exist.\n\n- `\"break-paths-filter-domains\"` — Break path marks (for line, area, trail) at invalid values. For non-path marks, this is equivalent to `\"filter\"`. All *scale* domains will *exclude* these filtered data points.\n\n- `\"break-paths-show-domains\"` — Break paths (for line, area, trail) at invalid values. Hide invalid values for non-path marks. All *scale* domains will *include* these filtered data points (for both path and non-path marks).\n\n- `\"show\"` or `null` — Show all data points in the marks and scale domains. Each scale will use the output for invalid values defined in `config.scale.invalid` or, if unspecified, by default invalid values will produce the same visual values as zero (if the scale includes zero) or the minimum value (if the scale does not include zero).\n\n- `\"break-paths-show-path-domains\"` (default) — This is equivalent to `\"break-paths-show-domains\"` for path-based marks (line/area/trail) and `\"filter\"` for non-path marks.\n\n__Note__: If any channel's scale has an output for invalid values defined in `config.scale.invalid`, all values for the scales will be considered \"valid\" since they can produce a reasonable output for the scales. Thus, fields for such channels will not be filtered and will not cause path breaks." }, "limit": { "anyOf": [ { "description": "The maximum length of the text mark in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.\n\n__Default value:__ `0` -- indicating no limit", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "lineBreak": { "anyOf": [ { "description": "A delimiter, such as a newline character, upon which to break text strings into multiple lines. This property is ignored if the text is array-valued.", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "lineHeight": { "anyOf": [ { "description": "The line height in pixels (the spacing between subsequent lines of text) for multi-line text marks.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "minBandSize": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The minimum band size for bar and rectangle marks. __Default value:__ `0.25`" }, "opacity": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The overall opacity (value between [0,1]).\n\n__Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or `square` marks or layered `bar` charts and `1` otherwise.", "maximum": 1, "minimum": 0 }, "order": { "description": "For line and trail marks, this `order` property can be set to `null` or `false` to make the lines use the original order in the data sources.", "type": [ "null", "boolean" ] }, "orient": { "$ref": "#/definitions/Orientation", "description": "The orientation of a non-stacked bar, tick, area, and line charts. The value is either horizontal (default) or vertical.\n- For bar, rule and tick, this determines whether the size of the bar and tick should be applied to x or y dimension.\n- For area, this property determines the orient property of the Vega output.\n- For line and trail marks, this property determines the sort order of the points in the line if `config.sortLineBy` is not specified. For stacked charts, this is always determined by the orientation of the stack; therefore explicitly specified value will be ignored." }, "outerRadius": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The outer radius in pixels of arc marks. `outerRadius` is an alias for `radius`.\n\n__Default value:__ `0`", "minimum": 0 }, "padAngle": { "anyOf": [ { "description": "The angular padding applied to sides of the arc, in radians.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "radius": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "For arc mark, the primary (outer) radius in pixels.\n\nFor text marks, polar coordinate radial offset, in pixels, of the text from the origin determined by the `x` and `y` properties.\n\n__Default value:__ `min(plot_width, plot_height)/2`", "minimum": 0 }, "radius2": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The secondary (inner) radius in pixels of arc marks.\n\n__Default value:__ `0`", "minimum": 0 }, "shape": { "anyOf": [ { "anyOf": [ { "$ref": "#/definitions/SymbolShape" }, { "type": "string" } ], "description": "Shape of the point marks. Supported values include:\n- plotting shapes: `\"circle\"`, `\"square\"`, `\"cross\"`, `\"diamond\"`, `\"triangle-up\"`, `\"triangle-down\"`, `\"triangle-right\"`, or `\"triangle-left\"`.\n- the line symbol `\"stroke\"`\n- centered directional shapes `\"arrow\"`, `\"wedge\"`, or `\"triangle\"`\n- a custom [SVG path string](https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths) (For correct sizing, custom shape paths should be defined within a square bounding box with coordinates ranging from -1 to 1 along both the x and y dimensions.)\n\n__Default value:__ `\"circle\"`" }, { "$ref": "#/definitions/ExprRef" } ] }, "size": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Default size for marks.\n- For `point`/`circle`/`square`, this represents the pixel area of the marks. Note that this value sets the area of the symbol; the side lengths will increase with the square root of this value.\n- For `bar`, this represents the band size of the bar, in pixels.\n- For `text`, this represents the font size, in pixels.\n\n__Default value:__\n- `30` for point, circle, square marks; width/height's `step`\n- `2` for bar marks with discrete dimensions;\n- `5` for bar marks with continuous dimensions;\n- `11` for text marks.", "minimum": 0 }, "smooth": { "anyOf": [ { "description": "A boolean flag (default true) indicating if the image should be smoothed when resized. If false, individual pixels should be scaled directly rather than interpolated with smoothing. For SVG rendering, this option may not work in some browsers due to lack of standardization.", "type": "boolean" }, { "$ref": "#/definitions/ExprRef" } ] }, "startAngle": { "anyOf": [ { "description": "The start angle in radians for arc marks. A value of `0` indicates up (north), increasing values proceed clockwise.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "stroke": { "anyOf": [ { "$ref": "#/definitions/Color" }, { "$ref": "#/definitions/Gradient" }, { "type": "null" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Default stroke color. This property has higher precedence than `config.color`. Set to `null` to remove stroke.\n\n__Default value:__ (None)" }, "strokeCap": { "anyOf": [ { "$ref": "#/definitions/StrokeCap", "description": "The stroke cap for line ending style. One of `\"butt\"`, `\"round\"`, or `\"square\"`.\n\n__Default value:__ `\"butt\"`" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeDash": { "anyOf": [ { "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", "items": { "type": "number" }, "type": "array" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeDashOffset": { "anyOf": [ { "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeJoin": { "anyOf": [ { "$ref": "#/definitions/StrokeJoin", "description": "The stroke line join method. One of `\"miter\"`, `\"round\"` or `\"bevel\"`.\n\n__Default value:__ `\"miter\"`" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeMiterLimit": { "anyOf": [ { "description": "The miter limit at which to bevel a line join.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeOffset": { "anyOf": [ { "description": "The offset in pixels at which to draw the group stroke and fill. If unspecified, the default behavior is to dynamically offset stroked groups such that 1 pixel stroke widths align with the pixel grid.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeOpacity": { "anyOf": [ { "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", "maximum": 1, "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeWidth": { "anyOf": [ { "description": "The stroke width, in pixels.", "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "tension": { "anyOf": [ { "description": "Depending on the interpolation type, sets the tension parameter (for line and area marks).", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "text": { "anyOf": [ { "$ref": "#/definitions/Text", "description": "Placeholder text if the `text` channel is not specified" }, { "$ref": "#/definitions/ExprRef" } ] }, "theta": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "- For arc marks, the arc length in radians if theta2 is not specified, otherwise the start arc angle. (A value of 0 indicates up or “north”, increasing values proceed clockwise.)\n\n- For text marks, polar coordinate angle in radians.", "maximum": 360, "minimum": 0 }, "theta2": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise." }, "thickness": { "description": "Thickness of the tick mark.\n\n__Default value:__ `1`", "minimum": 0, "type": "number" }, "time": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "timeUnitBandPosition": { "description": "Default relative band position for a time unit. If set to `0`, the marks will be positioned at the beginning of the time unit band step. If set to `0.5`, the marks will be positioned in the middle of the time unit band step.", "type": "number" }, "timeUnitBandSize": { "description": "Default relative band size for a time unit. If set to `1`, the bandwidth of the marks will be equal to the time unit band step. If set to `0.5`, bandwidth of the marks will be half of the time unit band step.", "type": "number" }, "tooltip": { "anyOf": [ { "type": "number" }, { "type": "string" }, { "type": "boolean" }, { "$ref": "#/definitions/TooltipContent" }, { "$ref": "#/definitions/ExprRef" }, { "type": "null" } ], "description": "The tooltip text string to show upon mouse hover or an object defining which fields should the tooltip be derived from.\n\n- If `tooltip` is `true` or `{\"content\": \"encoding\"}`, then all fields from `encoding` will be used.\n- If `tooltip` is `{\"content\": \"data\"}`, then all fields that appear in the highlighted data point will be used.\n- If set to `null` or `false`, then no tooltip will be used.\n\nSee the [`tooltip`](https://vega.github.io/vega-lite/docs/tooltip.html) documentation for a detailed discussion about tooltip in Vega-Lite.\n\n__Default value:__ `null`" }, "url": { "anyOf": [ { "$ref": "#/definitions/URI", "description": "The URL of the image file for image marks." }, { "$ref": "#/definitions/ExprRef" } ] }, "width": { "anyOf": [ { "description": "Width of the marks.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "x": { "anyOf": [ { "type": "number" }, { "const": "width", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ], "description": "X coordinates of the marks, or width of horizontal `\"bar\"` and `\"area\"` without specified `x2` or `width`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." }, "x2": { "anyOf": [ { "type": "number" }, { "const": "width", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ], "description": "X2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"width\"` for the width of the plot." }, "y": { "anyOf": [ { "type": "number" }, { "const": "height", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Y coordinates of the marks, or height of vertical `\"bar\"` and `\"area\"` without specified `y2` or `height`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." }, "y2": { "anyOf": [ { "type": "number" }, { "const": "height", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ], "description": "Y2 coordinates for ranged `\"area\"`, `\"bar\"`, `\"rect\"`, and `\"rule\"`.\n\nThe `value` of this channel can be a number or a string `\"height\"` for the height of the plot." } }, "type": "object" }, "TickCount": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/TimeInterval" }, { "$ref": "#/definitions/TimeIntervalStep" } ] }, "TimeDef": { "$ref": "#/definitions/TimeFieldDef" }, "TimeFieldDef": { "additionalProperties": false, "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/BinParams" }, { "type": "null" } ], "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "rescale": { "type": "boolean" }, "scale": { "anyOf": [ { "$ref": "#/definitions/Scale" }, { "type": "null" } ], "description": "An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels.\n\nIf `null`, the scale will be [disabled and the data value will be directly encoded](https://vega.github.io/vega-lite/docs/scale.html#disable).\n\n__Default value:__ If undefined, default [scale properties](https://vega.github.io/vega-lite/docs/scale.html) are applied.\n\n__See also:__ [`scale`](https://vega.github.io/vega-lite/docs/scale.html) documentation." }, "sort": { "$ref": "#/definitions/Sort", "description": "Sort order for the encoded field.\n\nFor continuous fields (quantitative or temporal), `sort` can be either `\"ascending\"` or `\"descending\"`.\n\nFor discrete fields, `sort` can be one of the following:\n- `\"ascending\"` or `\"descending\"` -- for sorting by the values' natural order in JavaScript.\n- [A string indicating an encoding channel name to sort by](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding) (e.g., `\"x\"` or `\"y\"`) with an optional minus prefix for descending sort (e.g., `\"-x\"` to sort by x-field, descending). This channel string is short-form of [a sort-by-encoding definition](https://vega.github.io/vega-lite/docs/sort.html#sort-by-encoding). For example, `\"sort\": \"-x\"` is equivalent to `\"sort\": {\"encoding\": \"x\", \"order\": \"descending\"}`.\n- [A sort field definition](https://vega.github.io/vega-lite/docs/sort.html#sort-field) for sorting by another field.\n- [An array specifying the field values in preferred order](https://vega.github.io/vega-lite/docs/sort.html#sort-array). In this case, the sort order will obey the values in the array, followed by any unspecified values in their original order. For discrete time field, values in the sort array can be [date-time definition objects](types#datetime). In addition, for time units `\"month\"` and `\"day\"`, the values can be the month or day names (case insensitive) or their 3-letter initials (e.g., `\"Mon\"`, `\"Tue\"`).\n- `null` indicating no sort.\n\n__Default value:__ `\"ascending\"`\n\n__Note:__ `null` and sorting by another channel is not supported for `row` and `column`.\n\n__See also:__ [`sort`](https://vega.github.io/vega-lite/docs/sort.html) documentation." }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "$ref": "#/definitions/StandardType", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } }, "type": "object" }, "TimeInterval": { "enum": [ "millisecond", "second", "minute", "hour", "day", "week", "month", "year" ], "type": "string" }, "TimeIntervalStep": { "additionalProperties": false, "properties": { "interval": { "$ref": "#/definitions/TimeInterval" }, "step": { "type": "number" } }, "required": [ "interval", "step" ], "type": "object" }, "TimeLocale": { "additionalProperties": false, "description": "Locale definition for formatting dates and times.", "properties": { "date": { "description": "The date (%x) format specifier (e.g., \"%m/%d/%Y\").", "type": "string" }, "dateTime": { "description": "The date and time (%c) format specifier (e.g., \"%a %b %e %X %Y\").", "type": "string" }, "days": { "$ref": "#/definitions/Vector7", "description": "The full names of the weekdays, starting with Sunday." }, "months": { "$ref": "#/definitions/Vector12", "description": "The full names of the months (starting with January)." }, "periods": { "$ref": "#/definitions/Vector2", "description": "The A.M. and P.M. equivalents (e.g., [\"AM\", \"PM\"])." }, "shortDays": { "$ref": "#/definitions/Vector7", "description": "The abbreviated names of the weekdays, starting with Sunday." }, "shortMonths": { "$ref": "#/definitions/Vector12", "description": "The abbreviated names of the months (starting with January)." }, "time": { "description": "The time (%X) format specifier (e.g., \"%H:%M:%S\").", "type": "string" } }, "required": [ "dateTime", "date", "time", "periods", "days", "shortDays", "months", "shortMonths" ], "type": "object" }, "TimeUnit": { "anyOf": [ { "$ref": "#/definitions/SingleTimeUnit" }, { "$ref": "#/definitions/MultiTimeUnit" } ] }, "TimeUnitParams": { "additionalProperties": false, "description": "Time Unit Params for encoding predicate, which can specified if the data is already \"binned\".", "properties": { "binned": { "description": "Whether the data has already been binned to this time unit. If true, Vega-Lite will only format the data, marks, and guides, without applying the timeUnit transform to re-bin the data again.", "type": "boolean" }, "maxbins": { "description": "If no `unit` is specified, maxbins is used to infer time units.", "type": "number" }, "step": { "description": "The number of steps between bins, in terms of the least significant unit provided.", "type": "number" }, "unit": { "$ref": "#/definitions/TimeUnit", "description": "Defines how date-time values should be binned." }, "utc": { "description": "True to use UTC timezone. Equivalent to using a `utc` prefixed `TimeUnit`.", "type": "boolean" } }, "type": "object" }, "TimeUnitTransform": { "additionalProperties": false, "properties": { "as": { "$ref": "#/definitions/FieldName", "description": "The output field to write the timeUnit value." }, "field": { "$ref": "#/definitions/FieldName", "description": "The data field to apply time unit." }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/TimeUnitTransformParams" } ], "description": "The timeUnit." } }, "required": [ "timeUnit", "field", "as" ], "type": "object" }, "TimeUnitTransformParams": { "additionalProperties": false, "properties": { "maxbins": { "description": "If no `unit` is specified, maxbins is used to infer time units.", "type": "number" }, "step": { "description": "The number of steps between bins, in terms of the least significant unit provided.", "type": "number" }, "unit": { "$ref": "#/definitions/TimeUnit", "description": "Defines how date-time values should be binned." }, "utc": { "description": "True to use UTC timezone. Equivalent to using a `utc` prefixed `TimeUnit`.", "type": "boolean" } }, "type": "object" }, "TitleAnchor": { "enum": [ null, "start", "middle", "end" ], "type": [ "null", "string" ] }, "TitleConfig": { "$ref": "#/definitions/BaseTitleNoValueRefs" }, "TitleFrame": { "enum": [ "bounds", "group" ], "type": "string" }, "TitleOrient": { "enum": [ "none", "left", "right", "top", "bottom" ], "type": "string" }, "TitleParams": { "additionalProperties": false, "properties": { "align": { "$ref": "#/definitions/Align", "description": "Horizontal text alignment for title text. One of `\"left\"`, `\"center\"`, or `\"right\"`." }, "anchor": { "$ref": "#/definitions/TitleAnchor", "description": "The anchor position for placing the title. One of `\"start\"`, `\"middle\"`, or `\"end\"`. For example, with an orientation of top these anchor positions map to a left-, center-, or right-aligned title.\n\n__Default value:__ `\"middle\"` for [single](https://vega.github.io/vega-lite/docs/spec.html) and [layered](https://vega.github.io/vega-lite/docs/layer.html) views. `\"start\"` for other composite views.\n\n__Note:__ [For now](https://github.com/vega/vega-lite/issues/2875), `anchor` is only customizable only for [single](https://vega.github.io/vega-lite/docs/spec.html) and [layered](https://vega.github.io/vega-lite/docs/layer.html) views. For other composite views, `anchor` is always `\"start\"`." }, "angle": { "anyOf": [ { "description": "Angle in degrees of title and subtitle text.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "aria": { "anyOf": [ { "description": "A boolean flag indicating if [ARIA attributes](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA) should be included (SVG output only). If `false`, the \"aria-hidden\" attribute will be set on the output SVG group, removing the title from the ARIA accessibility tree.\n\n__Default value:__ `true`", "type": "boolean" }, { "$ref": "#/definitions/ExprRef" } ] }, "baseline": { "$ref": "#/definitions/TextBaseline", "description": "Vertical text baseline for title and subtitle text. One of `\"alphabetic\"` (default), `\"top\"`, `\"middle\"`, `\"bottom\"`, `\"line-top\"`, or `\"line-bottom\"`. The `\"line-top\"` and `\"line-bottom\"` values operate similarly to `\"top\"` and `\"bottom\"`, but are calculated relative to the *lineHeight* rather than *fontSize* alone." }, "color": { "anyOf": [ { "anyOf": [ { "type": "null" }, { "$ref": "#/definitions/Color" } ], "description": "Text color for title text." }, { "$ref": "#/definitions/ExprRef" } ] }, "dx": { "anyOf": [ { "description": "Delta offset for title and subtitle text x-coordinate.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "dy": { "anyOf": [ { "description": "Delta offset for title and subtitle text y-coordinate.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "font": { "anyOf": [ { "description": "Font name for title text.", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "fontSize": { "anyOf": [ { "description": "Font size in pixels for title text.", "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "fontStyle": { "anyOf": [ { "$ref": "#/definitions/FontStyle", "description": "Font style for title text." }, { "$ref": "#/definitions/ExprRef" } ] }, "fontWeight": { "anyOf": [ { "$ref": "#/definitions/FontWeight", "description": "Font weight for title text. This can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." }, { "$ref": "#/definitions/ExprRef" } ] }, "frame": { "anyOf": [ { "anyOf": [ { "$ref": "#/definitions/TitleFrame" }, { "type": "string" } ], "description": "The reference frame for the anchor position, one of `\"bounds\"` (to anchor relative to the full bounding box) or `\"group\"` (to anchor relative to the group width or height)." }, { "$ref": "#/definitions/ExprRef" } ] }, "limit": { "anyOf": [ { "description": "The maximum allowed length in pixels of title and subtitle text.", "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "lineHeight": { "anyOf": [ { "description": "Line height in pixels for multi-line title text or title text with `\"line-top\"` or `\"line-bottom\"` baseline.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "offset": { "anyOf": [ { "description": "The orthogonal offset in pixels by which to displace the title group from its position along the edge of the chart.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "orient": { "anyOf": [ { "$ref": "#/definitions/TitleOrient", "description": "Default title orientation (`\"top\"`, `\"bottom\"`, `\"left\"`, or `\"right\"`)" }, { "$ref": "#/definitions/ExprRef" } ] }, "style": { "anyOf": [ { "type": "string" }, { "items": { "type": "string" }, "type": "array" } ], "description": "A [mark style property](https://vega.github.io/vega-lite/docs/config.html#style) to apply to the title text mark.\n\n__Default value:__ `\"group-title\"`." }, "subtitle": { "$ref": "#/definitions/Text", "description": "The subtitle Text." }, "subtitleColor": { "anyOf": [ { "anyOf": [ { "type": "null" }, { "$ref": "#/definitions/Color" } ], "description": "Text color for subtitle text." }, { "$ref": "#/definitions/ExprRef" } ] }, "subtitleFont": { "anyOf": [ { "description": "Font name for subtitle text.", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ] }, "subtitleFontSize": { "anyOf": [ { "description": "Font size in pixels for subtitle text.", "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "subtitleFontStyle": { "anyOf": [ { "$ref": "#/definitions/FontStyle", "description": "Font style for subtitle text." }, { "$ref": "#/definitions/ExprRef" } ] }, "subtitleFontWeight": { "anyOf": [ { "$ref": "#/definitions/FontWeight", "description": "Font weight for subtitle text. This can be either a string (e.g `\"bold\"`, `\"normal\"`) or a number (`100`, `200`, `300`, ..., `900` where `\"normal\"` = `400` and `\"bold\"` = `700`)." }, { "$ref": "#/definitions/ExprRef" } ] }, "subtitleLineHeight": { "anyOf": [ { "description": "Line height in pixels for multi-line subtitle text.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "subtitlePadding": { "anyOf": [ { "description": "The padding in pixels between title and subtitle text.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "text": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The title text." }, "zindex": { "description": "The integer z-index indicating the layering of the title group relative to other axis, mark and legend groups.\n\n__Default value:__ `0`.", "minimum": 0, "type": "number" } }, "required": [ "text" ], "type": "object" }, "TooltipContent": { "additionalProperties": false, "properties": { "content": { "enum": [ "encoding", "data" ], "type": "string" } }, "required": [ "content" ], "type": "object" }, "TopLevelConcatSpec": { "additionalProperties": false, "properties": { "$schema": { "description": "URL to [JSON schema](http://json-schema.org/) for a Vega-Lite specification. Unless you have a reason to change this, use `https://vega.github.io/schema/vega-lite/v5.json`. Setting the `$schema` property allows automatic validation and autocomplete in editors that support JSON schema.", "format": "uri", "type": "string" }, "align": { "anyOf": [ { "$ref": "#/definitions/LayoutAlign" }, { "$ref": "#/definitions/RowCol" } ], "description": "The alignment to apply to grid rows and columns. The supported string values are `\"all\"`, `\"each\"`, and `\"none\"`.\n\n- For `\"none\"`, a flow layout will be used, in which adjacent subviews are simply placed one after the other.\n- For `\"each\"`, subviews will be aligned into a clean grid structure, but each row or column may be of variable size.\n- For `\"all\"`, subviews will be aligned and each row or column will be sized identically based on the maximum observed size. String values for this property will be applied to both grid rows and columns.\n\nAlternatively, an object value of the form `{\"row\": string, \"column\": string}` can be used to supply different alignments for rows and columns.\n\n__Default value:__ `\"all\"`." }, "autosize": { "anyOf": [ { "$ref": "#/definitions/AutosizeType" }, { "$ref": "#/definitions/AutoSizeParams" } ], "description": "How the visualization size should be determined. If a string, should be one of `\"pad\"`, `\"fit\"` or `\"none\"`. Object values can additionally specify parameters for content sizing and automatic resizing.\n\n__Default value__: `pad`" }, "background": { "anyOf": [ { "$ref": "#/definitions/Color" }, { "$ref": "#/definitions/ExprRef" } ], "description": "CSS color property to use as the background of the entire view.\n\n__Default value:__ `\"white\"`" }, "bounds": { "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used.\n- If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", "enum": [ "full", "flush" ], "type": "string" }, "center": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/RowCol" } ], "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\nAn object value of the form `{\"row\": boolean, \"column\": boolean}` can be used to supply different centering values for rows and columns.\n\n__Default value:__ `false`" }, "columns": { "description": "The number of columns to include in the view composition layout.\n\n__Default value__: `undefined` -- An infinite number of columns (a single row) will be assumed. This is equivalent to `hconcat` (for `concat`) and to using the `column` channel (for `facet` and `repeat`).\n\n__Note__:\n\n1) This property is only for:\n- the general (wrappable) `concat` operator (not `hconcat`/`vconcat`)\n- the `facet` and `repeat` operator with one field/repetition definition (without row/column nesting)\n\n2) Setting the `columns` to `1` is equivalent to `vconcat` (for `concat`) and to using the `row` channel (for `facet` and `repeat`).", "type": "number" }, "concat": { "description": "A list of views to be concatenated.", "items": { "$ref": "#/definitions/NonNormalizedSpec" }, "type": "array" }, "config": { "$ref": "#/definitions/Config", "description": "Vega-Lite configuration object. This property can only be defined at the top-level of a specification." }, "data": { "anyOf": [ { "$ref": "#/definitions/Data" }, { "type": "null" } ], "description": "An object describing the data source. Set to `null` to ignore the parent's data source. If no data is set, it is derived from the parent." }, "datasets": { "$ref": "#/definitions/Datasets", "description": "A global data store for named datasets. This is a mapping from names to inline datasets. This can be an array of objects or primitive values or a string. Arrays of primitive values are ingested as objects with a `data` property." }, "description": { "description": "Description of this mark for commenting purpose.", "type": "string" }, "name": { "description": "Name of the visualization for later reference.", "type": "string" }, "padding": { "anyOf": [ { "$ref": "#/definitions/Padding" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The default visualization padding, in pixels, from the edge of the visualization canvas to the data rectangle. If a number, specifies padding for all sides. If an object, the value should have the format `{\"left\": 5, \"top\": 5, \"right\": 5, \"bottom\": 5}` to specify padding for each side of the visualization.\n\n__Default value__: `5`" }, "params": { "description": "Dynamic variables or selections that parameterize a visualization.", "items": { "$ref": "#/definitions/TopLevelParameter" }, "type": "array" }, "resolve": { "$ref": "#/definitions/Resolve", "description": "Scale, axis, and legend resolutions for view composition specifications." }, "spacing": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/RowCol" } ], "description": "The spacing in pixels between sub-views of the composition operator. An object of the form `{\"row\": number, \"column\": number}` can be used to set different spacing values for rows and columns.\n\n__Default value__: Depends on `\"spacing\"` property of [the view composition configuration](https://vega.github.io/vega-lite/docs/config.html#view-config) (`20` by default)" }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "$ref": "#/definitions/TitleParams" } ], "description": "Title for the plot." }, "transform": { "description": "An array of data transformations such as filter and new field calculation.", "items": { "$ref": "#/definitions/Transform" }, "type": "array" }, "usermeta": { "$ref": "#/definitions/Dict", "description": "Optional metadata that will be passed to Vega. This object is completely ignored by Vega and Vega-Lite and can be used for custom metadata." } }, "required": [ "concat" ], "type": "object" }, "TopLevelHConcatSpec": { "additionalProperties": false, "properties": { "$schema": { "description": "URL to [JSON schema](http://json-schema.org/) for a Vega-Lite specification. Unless you have a reason to change this, use `https://vega.github.io/schema/vega-lite/v5.json`. Setting the `$schema` property allows automatic validation and autocomplete in editors that support JSON schema.", "format": "uri", "type": "string" }, "autosize": { "anyOf": [ { "$ref": "#/definitions/AutosizeType" }, { "$ref": "#/definitions/AutoSizeParams" } ], "description": "How the visualization size should be determined. If a string, should be one of `\"pad\"`, `\"fit\"` or `\"none\"`. Object values can additionally specify parameters for content sizing and automatic resizing.\n\n__Default value__: `pad`" }, "background": { "anyOf": [ { "$ref": "#/definitions/Color" }, { "$ref": "#/definitions/ExprRef" } ], "description": "CSS color property to use as the background of the entire view.\n\n__Default value:__ `\"white\"`" }, "bounds": { "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used.\n- If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", "enum": [ "full", "flush" ], "type": "string" }, "center": { "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\n__Default value:__ `false`", "type": "boolean" }, "config": { "$ref": "#/definitions/Config", "description": "Vega-Lite configuration object. This property can only be defined at the top-level of a specification." }, "data": { "anyOf": [ { "$ref": "#/definitions/Data" }, { "type": "null" } ], "description": "An object describing the data source. Set to `null` to ignore the parent's data source. If no data is set, it is derived from the parent." }, "datasets": { "$ref": "#/definitions/Datasets", "description": "A global data store for named datasets. This is a mapping from names to inline datasets. This can be an array of objects or primitive values or a string. Arrays of primitive values are ingested as objects with a `data` property." }, "description": { "description": "Description of this mark for commenting purpose.", "type": "string" }, "hconcat": { "description": "A list of views to be concatenated and put into a row.", "items": { "$ref": "#/definitions/NonNormalizedSpec" }, "type": "array" }, "name": { "description": "Name of the visualization for later reference.", "type": "string" }, "padding": { "anyOf": [ { "$ref": "#/definitions/Padding" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The default visualization padding, in pixels, from the edge of the visualization canvas to the data rectangle. If a number, specifies padding for all sides. If an object, the value should have the format `{\"left\": 5, \"top\": 5, \"right\": 5, \"bottom\": 5}` to specify padding for each side of the visualization.\n\n__Default value__: `5`" }, "params": { "description": "Dynamic variables or selections that parameterize a visualization.", "items": { "$ref": "#/definitions/TopLevelParameter" }, "type": "array" }, "resolve": { "$ref": "#/definitions/Resolve", "description": "Scale, axis, and legend resolutions for view composition specifications." }, "spacing": { "description": "The spacing in pixels between sub-views of the concat operator.\n\n__Default value__: `10`", "type": "number" }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "$ref": "#/definitions/TitleParams" } ], "description": "Title for the plot." }, "transform": { "description": "An array of data transformations such as filter and new field calculation.", "items": { "$ref": "#/definitions/Transform" }, "type": "array" }, "usermeta": { "$ref": "#/definitions/Dict", "description": "Optional metadata that will be passed to Vega. This object is completely ignored by Vega and Vega-Lite and can be used for custom metadata." } }, "required": [ "hconcat" ], "type": "object" }, "TopLevelVConcatSpec": { "additionalProperties": false, "properties": { "$schema": { "description": "URL to [JSON schema](http://json-schema.org/) for a Vega-Lite specification. Unless you have a reason to change this, use `https://vega.github.io/schema/vega-lite/v5.json`. Setting the `$schema` property allows automatic validation and autocomplete in editors that support JSON schema.", "format": "uri", "type": "string" }, "autosize": { "anyOf": [ { "$ref": "#/definitions/AutosizeType" }, { "$ref": "#/definitions/AutoSizeParams" } ], "description": "How the visualization size should be determined. If a string, should be one of `\"pad\"`, `\"fit\"` or `\"none\"`. Object values can additionally specify parameters for content sizing and automatic resizing.\n\n__Default value__: `pad`" }, "background": { "anyOf": [ { "$ref": "#/definitions/Color" }, { "$ref": "#/definitions/ExprRef" } ], "description": "CSS color property to use as the background of the entire view.\n\n__Default value:__ `\"white\"`" }, "bounds": { "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used.\n- If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", "enum": [ "full", "flush" ], "type": "string" }, "center": { "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\n__Default value:__ `false`", "type": "boolean" }, "config": { "$ref": "#/definitions/Config", "description": "Vega-Lite configuration object. This property can only be defined at the top-level of a specification." }, "data": { "anyOf": [ { "$ref": "#/definitions/Data" }, { "type": "null" } ], "description": "An object describing the data source. Set to `null` to ignore the parent's data source. If no data is set, it is derived from the parent." }, "datasets": { "$ref": "#/definitions/Datasets", "description": "A global data store for named datasets. This is a mapping from names to inline datasets. This can be an array of objects or primitive values or a string. Arrays of primitive values are ingested as objects with a `data` property." }, "description": { "description": "Description of this mark for commenting purpose.", "type": "string" }, "name": { "description": "Name of the visualization for later reference.", "type": "string" }, "padding": { "anyOf": [ { "$ref": "#/definitions/Padding" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The default visualization padding, in pixels, from the edge of the visualization canvas to the data rectangle. If a number, specifies padding for all sides. If an object, the value should have the format `{\"left\": 5, \"top\": 5, \"right\": 5, \"bottom\": 5}` to specify padding for each side of the visualization.\n\n__Default value__: `5`" }, "params": { "description": "Dynamic variables or selections that parameterize a visualization.", "items": { "$ref": "#/definitions/TopLevelParameter" }, "type": "array" }, "resolve": { "$ref": "#/definitions/Resolve", "description": "Scale, axis, and legend resolutions for view composition specifications." }, "spacing": { "description": "The spacing in pixels between sub-views of the concat operator.\n\n__Default value__: `10`", "type": "number" }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "$ref": "#/definitions/TitleParams" } ], "description": "Title for the plot." }, "transform": { "description": "An array of data transformations such as filter and new field calculation.", "items": { "$ref": "#/definitions/Transform" }, "type": "array" }, "usermeta": { "$ref": "#/definitions/Dict", "description": "Optional metadata that will be passed to Vega. This object is completely ignored by Vega and Vega-Lite and can be used for custom metadata." }, "vconcat": { "description": "A list of views to be concatenated and put into a column.", "items": { "$ref": "#/definitions/NonNormalizedSpec" }, "type": "array" } }, "required": [ "vconcat" ], "type": "object" }, "TopLevelLayerSpec": { "additionalProperties": false, "properties": { "$schema": { "description": "URL to [JSON schema](http://json-schema.org/) for a Vega-Lite specification. Unless you have a reason to change this, use `https://vega.github.io/schema/vega-lite/v5.json`. Setting the `$schema` property allows automatic validation and autocomplete in editors that support JSON schema.", "format": "uri", "type": "string" }, "autosize": { "anyOf": [ { "$ref": "#/definitions/AutosizeType" }, { "$ref": "#/definitions/AutoSizeParams" } ], "description": "How the visualization size should be determined. If a string, should be one of `\"pad\"`, `\"fit\"` or `\"none\"`. Object values can additionally specify parameters for content sizing and automatic resizing.\n\n__Default value__: `pad`" }, "background": { "anyOf": [ { "$ref": "#/definitions/Color" }, { "$ref": "#/definitions/ExprRef" } ], "description": "CSS color property to use as the background of the entire view.\n\n__Default value:__ `\"white\"`" }, "config": { "$ref": "#/definitions/Config", "description": "Vega-Lite configuration object. This property can only be defined at the top-level of a specification." }, "data": { "anyOf": [ { "$ref": "#/definitions/Data" }, { "type": "null" } ], "description": "An object describing the data source. Set to `null` to ignore the parent's data source. If no data is set, it is derived from the parent." }, "datasets": { "$ref": "#/definitions/Datasets", "description": "A global data store for named datasets. This is a mapping from names to inline datasets. This can be an array of objects or primitive values or a string. Arrays of primitive values are ingested as objects with a `data` property." }, "description": { "description": "Description of this mark for commenting purpose.", "type": "string" }, "encoding": { "$ref": "#/definitions/SharedEncoding", "description": "A shared key-value mapping between encoding channels and definition of fields in the underlying layers." }, "height": { "anyOf": [ { "type": "number" }, { "const": "container", "type": "string" }, { "$ref": "#/definitions/Step" } ], "description": "The height of a visualization.\n\n- For a plot with a continuous y-field, height should be a number.\n- For a plot with either a discrete y-field or no y-field, height can be either a number indicating a fixed height or an object in the form of `{step: number}` defining the height per discrete step. (No y-field is equivalent to having one discrete step.)\n- To enable responsive sizing on height, it should be set to `\"container\"`.\n\n__Default value:__ Based on `config.view.continuousHeight` for a plot with a continuous y-field and `config.view.discreteHeight` otherwise.\n\n__Note:__ For plots with [`row` and `column` channels](https://vega.github.io/vega-lite/docs/encoding.html#facet), this represents the height of a single view and the `\"container\"` option cannot be used.\n\n__See also:__ [`height`](https://vega.github.io/vega-lite/docs/size.html) documentation." }, "layer": { "description": "Layer or single view specifications to be layered.\n\n__Note__: Specifications inside `layer` cannot use `row` and `column` channels as layering facet specifications is not allowed. Instead, use the [facet operator](https://vega.github.io/vega-lite/docs/facet.html) and place a layer inside a facet.", "items": { "anyOf": [ { "$ref": "#/definitions/LayerSpec" }, { "$ref": "#/definitions/UnitSpec" } ] }, "type": "array" }, "name": { "description": "Name of the visualization for later reference.", "type": "string" }, "padding": { "anyOf": [ { "$ref": "#/definitions/Padding" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The default visualization padding, in pixels, from the edge of the visualization canvas to the data rectangle. If a number, specifies padding for all sides. If an object, the value should have the format `{\"left\": 5, \"top\": 5, \"right\": 5, \"bottom\": 5}` to specify padding for each side of the visualization.\n\n__Default value__: `5`" }, "params": { "description": "Dynamic variables or selections that parameterize a visualization.", "items": { "$ref": "#/definitions/TopLevelParameter" }, "type": "array" }, "projection": { "$ref": "#/definitions/Projection", "description": "An object defining properties of the geographic projection shared by underlying layers." }, "resolve": { "$ref": "#/definitions/Resolve", "description": "Scale, axis, and legend resolutions for view composition specifications." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "$ref": "#/definitions/TitleParams" } ], "description": "Title for the plot." }, "transform": { "description": "An array of data transformations such as filter and new field calculation.", "items": { "$ref": "#/definitions/Transform" }, "type": "array" }, "usermeta": { "$ref": "#/definitions/Dict", "description": "Optional metadata that will be passed to Vega. This object is completely ignored by Vega and Vega-Lite and can be used for custom metadata." }, "view": { "$ref": "#/definitions/ViewBackground", "description": "An object defining the view background's fill and stroke.\n\n__Default value:__ none (transparent)" }, "width": { "anyOf": [ { "type": "number" }, { "const": "container", "type": "string" }, { "$ref": "#/definitions/Step" } ], "description": "The width of a visualization.\n\n- For a plot with a continuous x-field, width should be a number.\n- For a plot with either a discrete x-field or no x-field, width can be either a number indicating a fixed width or an object in the form of `{step: number}` defining the width per discrete step. (No x-field is equivalent to having one discrete step.)\n- To enable responsive sizing on width, it should be set to `\"container\"`.\n\n__Default value:__ Based on `config.view.continuousWidth` for a plot with a continuous x-field and `config.view.discreteWidth` otherwise.\n\n__Note:__ For plots with [`row` and `column` channels](https://vega.github.io/vega-lite/docs/encoding.html#facet), this represents the width of a single view and the `\"container\"` option cannot be used.\n\n__See also:__ [`width`](https://vega.github.io/vega-lite/docs/size.html) documentation." } }, "required": [ "layer" ], "type": "object" }, "TopLevelRepeatSpec": { "anyOf": [ { "additionalProperties": false, "properties": { "$schema": { "description": "URL to [JSON schema](http://json-schema.org/) for a Vega-Lite specification. Unless you have a reason to change this, use `https://vega.github.io/schema/vega-lite/v5.json`. Setting the `$schema` property allows automatic validation and autocomplete in editors that support JSON schema.", "format": "uri", "type": "string" }, "align": { "anyOf": [ { "$ref": "#/definitions/LayoutAlign" }, { "$ref": "#/definitions/RowCol" } ], "description": "The alignment to apply to grid rows and columns. The supported string values are `\"all\"`, `\"each\"`, and `\"none\"`.\n\n- For `\"none\"`, a flow layout will be used, in which adjacent subviews are simply placed one after the other.\n- For `\"each\"`, subviews will be aligned into a clean grid structure, but each row or column may be of variable size.\n- For `\"all\"`, subviews will be aligned and each row or column will be sized identically based on the maximum observed size. String values for this property will be applied to both grid rows and columns.\n\nAlternatively, an object value of the form `{\"row\": string, \"column\": string}` can be used to supply different alignments for rows and columns.\n\n__Default value:__ `\"all\"`." }, "autosize": { "anyOf": [ { "$ref": "#/definitions/AutosizeType" }, { "$ref": "#/definitions/AutoSizeParams" } ], "description": "How the visualization size should be determined. If a string, should be one of `\"pad\"`, `\"fit\"` or `\"none\"`. Object values can additionally specify parameters for content sizing and automatic resizing.\n\n__Default value__: `pad`" }, "background": { "anyOf": [ { "$ref": "#/definitions/Color" }, { "$ref": "#/definitions/ExprRef" } ], "description": "CSS color property to use as the background of the entire view.\n\n__Default value:__ `\"white\"`" }, "bounds": { "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used.\n- If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", "enum": [ "full", "flush" ], "type": "string" }, "center": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/RowCol" } ], "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\nAn object value of the form `{\"row\": boolean, \"column\": boolean}` can be used to supply different centering values for rows and columns.\n\n__Default value:__ `false`" }, "columns": { "description": "The number of columns to include in the view composition layout.\n\n__Default value__: `undefined` -- An infinite number of columns (a single row) will be assumed. This is equivalent to `hconcat` (for `concat`) and to using the `column` channel (for `facet` and `repeat`).\n\n__Note__:\n\n1) This property is only for:\n- the general (wrappable) `concat` operator (not `hconcat`/`vconcat`)\n- the `facet` and `repeat` operator with one field/repetition definition (without row/column nesting)\n\n2) Setting the `columns` to `1` is equivalent to `vconcat` (for `concat`) and to using the `row` channel (for `facet` and `repeat`).", "type": "number" }, "config": { "$ref": "#/definitions/Config", "description": "Vega-Lite configuration object. This property can only be defined at the top-level of a specification." }, "data": { "anyOf": [ { "$ref": "#/definitions/Data" }, { "type": "null" } ], "description": "An object describing the data source. Set to `null` to ignore the parent's data source. If no data is set, it is derived from the parent." }, "datasets": { "$ref": "#/definitions/Datasets", "description": "A global data store for named datasets. This is a mapping from names to inline datasets. This can be an array of objects or primitive values or a string. Arrays of primitive values are ingested as objects with a `data` property." }, "description": { "description": "Description of this mark for commenting purpose.", "type": "string" }, "name": { "description": "Name of the visualization for later reference.", "type": "string" }, "padding": { "anyOf": [ { "$ref": "#/definitions/Padding" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The default visualization padding, in pixels, from the edge of the visualization canvas to the data rectangle. If a number, specifies padding for all sides. If an object, the value should have the format `{\"left\": 5, \"top\": 5, \"right\": 5, \"bottom\": 5}` to specify padding for each side of the visualization.\n\n__Default value__: `5`" }, "params": { "description": "Dynamic variables or selections that parameterize a visualization.", "items": { "$ref": "#/definitions/TopLevelParameter" }, "type": "array" }, "repeat": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "$ref": "#/definitions/RepeatMapping" } ], "description": "Definition for fields to be repeated. One of: 1) An array of fields to be repeated. If `\"repeat\"` is an array, the field can be referred to as `{\"repeat\": \"repeat\"}`. The repeated views are laid out in a wrapped row. You can set the number of columns to control the wrapping. 2) An object that maps `\"row\"` and/or `\"column\"` to the listed fields to be repeated along the particular orientations. The objects `{\"repeat\": \"row\"}` and `{\"repeat\": \"column\"}` can be used to refer to the repeated field respectively." }, "resolve": { "$ref": "#/definitions/Resolve", "description": "Scale, axis, and legend resolutions for view composition specifications." }, "spacing": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/RowCol" } ], "description": "The spacing in pixels between sub-views of the composition operator. An object of the form `{\"row\": number, \"column\": number}` can be used to set different spacing values for rows and columns.\n\n__Default value__: Depends on `\"spacing\"` property of [the view composition configuration](https://vega.github.io/vega-lite/docs/config.html#view-config) (`20` by default)" }, "spec": { "$ref": "#/definitions/NonNormalizedSpec", "description": "A specification of the view that gets repeated." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "$ref": "#/definitions/TitleParams" } ], "description": "Title for the plot." }, "transform": { "description": "An array of data transformations such as filter and new field calculation.", "items": { "$ref": "#/definitions/Transform" }, "type": "array" }, "usermeta": { "$ref": "#/definitions/Dict", "description": "Optional metadata that will be passed to Vega. This object is completely ignored by Vega and Vega-Lite and can be used for custom metadata." } }, "required": [ "repeat", "spec" ], "type": "object" }, { "additionalProperties": false, "properties": { "$schema": { "description": "URL to [JSON schema](http://json-schema.org/) for a Vega-Lite specification. Unless you have a reason to change this, use `https://vega.github.io/schema/vega-lite/v5.json`. Setting the `$schema` property allows automatic validation and autocomplete in editors that support JSON schema.", "format": "uri", "type": "string" }, "align": { "anyOf": [ { "$ref": "#/definitions/LayoutAlign" }, { "$ref": "#/definitions/RowCol" } ], "description": "The alignment to apply to grid rows and columns. The supported string values are `\"all\"`, `\"each\"`, and `\"none\"`.\n\n- For `\"none\"`, a flow layout will be used, in which adjacent subviews are simply placed one after the other.\n- For `\"each\"`, subviews will be aligned into a clean grid structure, but each row or column may be of variable size.\n- For `\"all\"`, subviews will be aligned and each row or column will be sized identically based on the maximum observed size. String values for this property will be applied to both grid rows and columns.\n\nAlternatively, an object value of the form `{\"row\": string, \"column\": string}` can be used to supply different alignments for rows and columns.\n\n__Default value:__ `\"all\"`." }, "autosize": { "anyOf": [ { "$ref": "#/definitions/AutosizeType" }, { "$ref": "#/definitions/AutoSizeParams" } ], "description": "How the visualization size should be determined. If a string, should be one of `\"pad\"`, `\"fit\"` or `\"none\"`. Object values can additionally specify parameters for content sizing and automatic resizing.\n\n__Default value__: `pad`" }, "background": { "anyOf": [ { "$ref": "#/definitions/Color" }, { "$ref": "#/definitions/ExprRef" } ], "description": "CSS color property to use as the background of the entire view.\n\n__Default value:__ `\"white\"`" }, "bounds": { "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used.\n- If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", "enum": [ "full", "flush" ], "type": "string" }, "center": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/RowCol" } ], "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\nAn object value of the form `{\"row\": boolean, \"column\": boolean}` can be used to supply different centering values for rows and columns.\n\n__Default value:__ `false`" }, "columns": { "description": "The number of columns to include in the view composition layout.\n\n__Default value__: `undefined` -- An infinite number of columns (a single row) will be assumed. This is equivalent to `hconcat` (for `concat`) and to using the `column` channel (for `facet` and `repeat`).\n\n__Note__:\n\n1) This property is only for:\n- the general (wrappable) `concat` operator (not `hconcat`/`vconcat`)\n- the `facet` and `repeat` operator with one field/repetition definition (without row/column nesting)\n\n2) Setting the `columns` to `1` is equivalent to `vconcat` (for `concat`) and to using the `row` channel (for `facet` and `repeat`).", "type": "number" }, "config": { "$ref": "#/definitions/Config", "description": "Vega-Lite configuration object. This property can only be defined at the top-level of a specification." }, "data": { "anyOf": [ { "$ref": "#/definitions/Data" }, { "type": "null" } ], "description": "An object describing the data source. Set to `null` to ignore the parent's data source. If no data is set, it is derived from the parent." }, "datasets": { "$ref": "#/definitions/Datasets", "description": "A global data store for named datasets. This is a mapping from names to inline datasets. This can be an array of objects or primitive values or a string. Arrays of primitive values are ingested as objects with a `data` property." }, "description": { "description": "Description of this mark for commenting purpose.", "type": "string" }, "name": { "description": "Name of the visualization for later reference.", "type": "string" }, "padding": { "anyOf": [ { "$ref": "#/definitions/Padding" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The default visualization padding, in pixels, from the edge of the visualization canvas to the data rectangle. If a number, specifies padding for all sides. If an object, the value should have the format `{\"left\": 5, \"top\": 5, \"right\": 5, \"bottom\": 5}` to specify padding for each side of the visualization.\n\n__Default value__: `5`" }, "params": { "description": "Dynamic variables or selections that parameterize a visualization.", "items": { "$ref": "#/definitions/TopLevelParameter" }, "type": "array" }, "repeat": { "$ref": "#/definitions/LayerRepeatMapping", "description": "Definition for fields to be repeated. One of: 1) An array of fields to be repeated. If `\"repeat\"` is an array, the field can be referred to as `{\"repeat\": \"repeat\"}`. The repeated views are laid out in a wrapped row. You can set the number of columns to control the wrapping. 2) An object that maps `\"row\"` and/or `\"column\"` to the listed fields to be repeated along the particular orientations. The objects `{\"repeat\": \"row\"}` and `{\"repeat\": \"column\"}` can be used to refer to the repeated field respectively." }, "resolve": { "$ref": "#/definitions/Resolve", "description": "Scale, axis, and legend resolutions for view composition specifications." }, "spacing": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/RowCol" } ], "description": "The spacing in pixels between sub-views of the composition operator. An object of the form `{\"row\": number, \"column\": number}` can be used to set different spacing values for rows and columns.\n\n__Default value__: Depends on `\"spacing\"` property of [the view composition configuration](https://vega.github.io/vega-lite/docs/config.html#view-config) (`20` by default)" }, "spec": { "anyOf": [ { "$ref": "#/definitions/LayerSpec" }, { "$ref": "#/definitions/UnitSpecWithFrame" } ], "description": "A specification of the view that gets repeated." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "$ref": "#/definitions/TitleParams" } ], "description": "Title for the plot." }, "transform": { "description": "An array of data transformations such as filter and new field calculation.", "items": { "$ref": "#/definitions/Transform" }, "type": "array" }, "usermeta": { "$ref": "#/definitions/Dict", "description": "Optional metadata that will be passed to Vega. This object is completely ignored by Vega and Vega-Lite and can be used for custom metadata." } }, "required": [ "repeat", "spec" ], "type": "object" } ] }, "TopLevelFacetSpec": { "additionalProperties": false, "properties": { "$schema": { "description": "URL to [JSON schema](http://json-schema.org/) for a Vega-Lite specification. Unless you have a reason to change this, use `https://vega.github.io/schema/vega-lite/v5.json`. Setting the `$schema` property allows automatic validation and autocomplete in editors that support JSON schema.", "format": "uri", "type": "string" }, "align": { "anyOf": [ { "$ref": "#/definitions/LayoutAlign" }, { "$ref": "#/definitions/RowCol" } ], "description": "The alignment to apply to grid rows and columns. The supported string values are `\"all\"`, `\"each\"`, and `\"none\"`.\n\n- For `\"none\"`, a flow layout will be used, in which adjacent subviews are simply placed one after the other.\n- For `\"each\"`, subviews will be aligned into a clean grid structure, but each row or column may be of variable size.\n- For `\"all\"`, subviews will be aligned and each row or column will be sized identically based on the maximum observed size. String values for this property will be applied to both grid rows and columns.\n\nAlternatively, an object value of the form `{\"row\": string, \"column\": string}` can be used to supply different alignments for rows and columns.\n\n__Default value:__ `\"all\"`." }, "autosize": { "anyOf": [ { "$ref": "#/definitions/AutosizeType" }, { "$ref": "#/definitions/AutoSizeParams" } ], "description": "How the visualization size should be determined. If a string, should be one of `\"pad\"`, `\"fit\"` or `\"none\"`. Object values can additionally specify parameters for content sizing and automatic resizing.\n\n__Default value__: `pad`" }, "background": { "anyOf": [ { "$ref": "#/definitions/Color" }, { "$ref": "#/definitions/ExprRef" } ], "description": "CSS color property to use as the background of the entire view.\n\n__Default value:__ `\"white\"`" }, "bounds": { "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used.\n- If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", "enum": [ "full", "flush" ], "type": "string" }, "center": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/RowCol" } ], "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\nAn object value of the form `{\"row\": boolean, \"column\": boolean}` can be used to supply different centering values for rows and columns.\n\n__Default value:__ `false`" }, "columns": { "description": "The number of columns to include in the view composition layout.\n\n__Default value__: `undefined` -- An infinite number of columns (a single row) will be assumed. This is equivalent to `hconcat` (for `concat`) and to using the `column` channel (for `facet` and `repeat`).\n\n__Note__:\n\n1) This property is only for:\n- the general (wrappable) `concat` operator (not `hconcat`/`vconcat`)\n- the `facet` and `repeat` operator with one field/repetition definition (without row/column nesting)\n\n2) Setting the `columns` to `1` is equivalent to `vconcat` (for `concat`) and to using the `row` channel (for `facet` and `repeat`).", "type": "number" }, "config": { "$ref": "#/definitions/Config", "description": "Vega-Lite configuration object. This property can only be defined at the top-level of a specification." }, "data": { "anyOf": [ { "$ref": "#/definitions/Data" }, { "type": "null" } ], "description": "An object describing the data source. Set to `null` to ignore the parent's data source. If no data is set, it is derived from the parent." }, "datasets": { "$ref": "#/definitions/Datasets", "description": "A global data store for named datasets. This is a mapping from names to inline datasets. This can be an array of objects or primitive values or a string. Arrays of primitive values are ingested as objects with a `data` property." }, "description": { "description": "Description of this mark for commenting purpose.", "type": "string" }, "facet": { "anyOf": [ { "$ref": "#/definitions/FacetFieldDef" }, { "$ref": "#/definitions/FacetMapping" } ], "description": "Definition for how to facet the data. One of: 1) [a field definition for faceting the plot by one field](https://vega.github.io/vega-lite/docs/facet.html#field-def) 2) [An object that maps `row` and `column` channels to their field definitions](https://vega.github.io/vega-lite/docs/facet.html#mapping)" }, "name": { "description": "Name of the visualization for later reference.", "type": "string" }, "padding": { "anyOf": [ { "$ref": "#/definitions/Padding" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The default visualization padding, in pixels, from the edge of the visualization canvas to the data rectangle. If a number, specifies padding for all sides. If an object, the value should have the format `{\"left\": 5, \"top\": 5, \"right\": 5, \"bottom\": 5}` to specify padding for each side of the visualization.\n\n__Default value__: `5`" }, "params": { "description": "Dynamic variables or selections that parameterize a visualization.", "items": { "$ref": "#/definitions/TopLevelParameter" }, "type": "array" }, "resolve": { "$ref": "#/definitions/Resolve", "description": "Scale, axis, and legend resolutions for view composition specifications." }, "spacing": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/RowCol" } ], "description": "The spacing in pixels between sub-views of the composition operator. An object of the form `{\"row\": number, \"column\": number}` can be used to set different spacing values for rows and columns.\n\n__Default value__: Depends on `\"spacing\"` property of [the view composition configuration](https://vega.github.io/vega-lite/docs/config.html#view-config) (`20` by default)" }, "spec": { "anyOf": [ { "$ref": "#/definitions/LayerSpec" }, { "$ref": "#/definitions/UnitSpecWithFrame" } ], "description": "A specification of the view that gets faceted." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "$ref": "#/definitions/TitleParams" } ], "description": "Title for the plot." }, "transform": { "description": "An array of data transformations such as filter and new field calculation.", "items": { "$ref": "#/definitions/Transform" }, "type": "array" }, "usermeta": { "$ref": "#/definitions/Dict", "description": "Optional metadata that will be passed to Vega. This object is completely ignored by Vega and Vega-Lite and can be used for custom metadata." } }, "required": [ "data", "facet", "spec" ], "type": "object" }, "TopLevelParameter": { "anyOf": [ { "$ref": "#/definitions/VariableParameter" }, { "$ref": "#/definitions/TopLevelSelectionParameter" } ] }, "TopLevelSelectionParameter": { "additionalProperties": false, "properties": { "bind": { "anyOf": [ { "$ref": "#/definitions/Binding" }, { "additionalProperties": { "$ref": "#/definitions/Binding" }, "type": "object" }, { "$ref": "#/definitions/LegendBinding" }, { "const": "scales", "type": "string" } ], "description": "When set, a selection is populated by input elements (also known as dynamic query widgets) or by interacting with the corresponding legend. Direct manipulation interaction is disabled by default; to re-enable it, set the selection's [`on`](https://vega.github.io/vega-lite/docs/selection.html#common-selection-properties) property.\n\nLegend bindings are restricted to selections that only specify a single field or encoding.\n\nQuery widget binding takes the form of Vega's [input element binding definition](https://vega.github.io/vega/docs/signals/#bind) or can be a mapping between projected field/encodings and binding definitions.\n\n__See also:__ [`bind`](https://vega.github.io/vega-lite/docs/bind.html) documentation." }, "name": { "$ref": "#/definitions/ParameterName", "description": "Required. A unique name for the selection parameter. Selection names should be valid JavaScript identifiers: they should contain only alphanumeric characters (or \"$\", or \"_\") and may not start with a digit. Reserved keywords that may not be used as parameter names are \"datum\", \"event\", \"item\", and \"parent\"." }, "select": { "anyOf": [ { "$ref": "#/definitions/SelectionType" }, { "$ref": "#/definitions/PointSelectionConfig" }, { "$ref": "#/definitions/IntervalSelectionConfig" } ], "description": "Determines the default event processing and data query for the selection. Vega-Lite currently supports two selection types:\n\n- `\"point\"` -- to select multiple discrete data values; the first value is selected on `click` and additional values toggled on shift-click.\n- `\"interval\"` -- to select a continuous range of data values on `drag`." }, "value": { "anyOf": [ { "$ref": "#/definitions/SelectionInit" }, { "items": { "$ref": "#/definitions/SelectionInitMapping" }, "type": "array" }, { "$ref": "#/definitions/SelectionInitIntervalMapping" } ], "description": "Initialize the selection with a mapping between [projected channels or field names](https://vega.github.io/vega-lite/docs/selection.html#project) and initial values.\n\n__See also:__ [`init`](https://vega.github.io/vega-lite/docs/value.html) documentation." }, "views": { "description": "By default, top-level selections are applied to every view in the visualization. If this property is specified, selections will only be applied to views with the given names.", "items": { "type": "string" }, "type": "array" } }, "required": [ "name", "select" ], "type": "object" }, "TopLevelSpec": { "anyOf": [ { "$ref": "#/definitions/TopLevelUnitSpec" }, { "$ref": "#/definitions/TopLevelFacetSpec" }, { "$ref": "#/definitions/TopLevelLayerSpec" }, { "$ref": "#/definitions/TopLevelRepeatSpec" }, { "$ref": "#/definitions/TopLevelConcatSpec" }, { "$ref": "#/definitions/TopLevelVConcatSpec" }, { "$ref": "#/definitions/TopLevelHConcatSpec" } ], "description": "A Vega-Lite top-level specification. This is the root class for all Vega-Lite specifications. (The json schema is generated from this type.)" }, "TopLevelUnitSpec": { "additionalProperties": false, "properties": { "$schema": { "description": "URL to [JSON schema](http://json-schema.org/) for a Vega-Lite specification. Unless you have a reason to change this, use `https://vega.github.io/schema/vega-lite/v5.json`. Setting the `$schema` property allows automatic validation and autocomplete in editors that support JSON schema.", "format": "uri", "type": "string" }, "align": { "anyOf": [ { "$ref": "#/definitions/LayoutAlign" }, { "$ref": "#/definitions/RowCol" } ], "description": "The alignment to apply to grid rows and columns. The supported string values are `\"all\"`, `\"each\"`, and `\"none\"`.\n\n- For `\"none\"`, a flow layout will be used, in which adjacent subviews are simply placed one after the other.\n- For `\"each\"`, subviews will be aligned into a clean grid structure, but each row or column may be of variable size.\n- For `\"all\"`, subviews will be aligned and each row or column will be sized identically based on the maximum observed size. String values for this property will be applied to both grid rows and columns.\n\nAlternatively, an object value of the form `{\"row\": string, \"column\": string}` can be used to supply different alignments for rows and columns.\n\n__Default value:__ `\"all\"`." }, "autosize": { "anyOf": [ { "$ref": "#/definitions/AutosizeType" }, { "$ref": "#/definitions/AutoSizeParams" } ], "description": "How the visualization size should be determined. If a string, should be one of `\"pad\"`, `\"fit\"` or `\"none\"`. Object values can additionally specify parameters for content sizing and automatic resizing.\n\n__Default value__: `pad`" }, "background": { "anyOf": [ { "$ref": "#/definitions/Color" }, { "$ref": "#/definitions/ExprRef" } ], "description": "CSS color property to use as the background of the entire view.\n\n__Default value:__ `\"white\"`" }, "bounds": { "description": "The bounds calculation method to use for determining the extent of a sub-plot. One of `full` (the default) or `flush`.\n\n- If set to `full`, the entire calculated bounds (including axes, title, and legend) will be used.\n- If set to `flush`, only the specified width and height values for the sub-view will be used. The `flush` setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.\n\n__Default value:__ `\"full\"`", "enum": [ "full", "flush" ], "type": "string" }, "center": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/RowCol" } ], "description": "Boolean flag indicating if subviews should be centered relative to their respective rows or columns.\n\nAn object value of the form `{\"row\": boolean, \"column\": boolean}` can be used to supply different centering values for rows and columns.\n\n__Default value:__ `false`" }, "config": { "$ref": "#/definitions/Config", "description": "Vega-Lite configuration object. This property can only be defined at the top-level of a specification." }, "data": { "anyOf": [ { "$ref": "#/definitions/Data" }, { "type": "null" } ], "description": "An object describing the data source. Set to `null` to ignore the parent's data source. If no data is set, it is derived from the parent." }, "datasets": { "$ref": "#/definitions/Datasets", "description": "A global data store for named datasets. This is a mapping from names to inline datasets. This can be an array of objects or primitive values or a string. Arrays of primitive values are ingested as objects with a `data` property." }, "description": { "description": "Description of this mark for commenting purpose.", "type": "string" }, "encoding": { "$ref": "#/definitions/FacetedEncoding", "description": "A key-value mapping between encoding channels and definition of fields." }, "height": { "anyOf": [ { "type": "number" }, { "const": "container", "type": "string" }, { "$ref": "#/definitions/Step" } ], "description": "The height of a visualization.\n\n- For a plot with a continuous y-field, height should be a number.\n- For a plot with either a discrete y-field or no y-field, height can be either a number indicating a fixed height or an object in the form of `{step: number}` defining the height per discrete step. (No y-field is equivalent to having one discrete step.)\n- To enable responsive sizing on height, it should be set to `\"container\"`.\n\n__Default value:__ Based on `config.view.continuousHeight` for a plot with a continuous y-field and `config.view.discreteHeight` otherwise.\n\n__Note:__ For plots with [`row` and `column` channels](https://vega.github.io/vega-lite/docs/encoding.html#facet), this represents the height of a single view and the `\"container\"` option cannot be used.\n\n__See also:__ [`height`](https://vega.github.io/vega-lite/docs/size.html) documentation." }, "mark": { "$ref": "#/definitions/AnyMark", "description": "A string describing the mark type (one of `\"bar\"`, `\"circle\"`, `\"square\"`, `\"tick\"`, `\"line\"`, `\"area\"`, `\"point\"`, `\"rule\"`, `\"geoshape\"`, and `\"text\"`) or a [mark definition object](https://vega.github.io/vega-lite/docs/mark.html#mark-def)." }, "name": { "description": "Name of the visualization for later reference.", "type": "string" }, "padding": { "anyOf": [ { "$ref": "#/definitions/Padding" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The default visualization padding, in pixels, from the edge of the visualization canvas to the data rectangle. If a number, specifies padding for all sides. If an object, the value should have the format `{\"left\": 5, \"top\": 5, \"right\": 5, \"bottom\": 5}` to specify padding for each side of the visualization.\n\n__Default value__: `5`" }, "params": { "description": "An array of parameters that may either be simple variables, or more complex selections that map user input to data queries.", "items": { "$ref": "#/definitions/TopLevelParameter" }, "type": "array" }, "projection": { "$ref": "#/definitions/Projection", "description": "An object defining properties of geographic projection, which will be applied to `shape` path for `\"geoshape\"` marks and to `latitude` and `\"longitude\"` channels for other marks." }, "resolve": { "$ref": "#/definitions/Resolve", "description": "Scale, axis, and legend resolutions for view composition specifications." }, "spacing": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/RowCol" } ], "description": "The spacing in pixels between sub-views of the composition operator. An object of the form `{\"row\": number, \"column\": number}` can be used to set different spacing values for rows and columns.\n\n__Default value__: Depends on `\"spacing\"` property of [the view composition configuration](https://vega.github.io/vega-lite/docs/config.html#view-config) (`20` by default)" }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "$ref": "#/definitions/TitleParams" } ], "description": "Title for the plot." }, "transform": { "description": "An array of data transformations such as filter and new field calculation.", "items": { "$ref": "#/definitions/Transform" }, "type": "array" }, "usermeta": { "$ref": "#/definitions/Dict", "description": "Optional metadata that will be passed to Vega. This object is completely ignored by Vega and Vega-Lite and can be used for custom metadata." }, "view": { "$ref": "#/definitions/ViewBackground", "description": "An object defining the view background's fill and stroke.\n\n__Default value:__ none (transparent)" }, "width": { "anyOf": [ { "type": "number" }, { "const": "container", "type": "string" }, { "$ref": "#/definitions/Step" } ], "description": "The width of a visualization.\n\n- For a plot with a continuous x-field, width should be a number.\n- For a plot with either a discrete x-field or no x-field, width can be either a number indicating a fixed width or an object in the form of `{step: number}` defining the width per discrete step. (No x-field is equivalent to having one discrete step.)\n- To enable responsive sizing on width, it should be set to `\"container\"`.\n\n__Default value:__ Based on `config.view.continuousWidth` for a plot with a continuous x-field and `config.view.discreteWidth` otherwise.\n\n__Note:__ For plots with [`row` and `column` channels](https://vega.github.io/vega-lite/docs/encoding.html#facet), this represents the width of a single view and the `\"container\"` option cannot be used.\n\n__See also:__ [`width`](https://vega.github.io/vega-lite/docs/size.html) documentation." } }, "required": [ "data", "mark" ], "type": "object" }, "TopoDataFormat": { "additionalProperties": false, "properties": { "feature": { "description": "The name of the TopoJSON object set to convert to a GeoJSON feature collection. For example, in a map of the world, there may be an object set named `\"countries\"`. Using the feature property, we can extract this set and generate a GeoJSON feature object for each country.", "type": "string" }, "mesh": { "description": "The name of the TopoJSON object set to convert to mesh. Similar to the `feature` option, `mesh` extracts a named TopoJSON object set. Unlike the `feature` option, the corresponding geo data is returned as a single, unified mesh instance, not as individual GeoJSON features. Extracting a mesh is useful for more efficiently drawing borders or other geographic elements that you do not need to associate with specific regions such as individual countries, states or counties.", "type": "string" }, "parse": { "anyOf": [ { "$ref": "#/definitions/Parse" }, { "type": "null" } ], "description": "If set to `null`, disable type inference based on the spec and only use type inference based on the data. Alternatively, a parsing directive object can be provided for explicit data types. Each property of the object corresponds to a field name, and the value to the desired data type (one of `\"number\"`, `\"boolean\"`, `\"date\"`, or null (do not parse the field)). For example, `\"parse\": {\"modified_on\": \"date\"}` parses the `modified_on` field in each input record a Date value.\n\nFor `\"date\"`, we parse data based using JavaScript's [`Date.parse()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse). For Specific date formats can be provided (e.g., `{foo: \"date:'%m%d%Y'\"}`), using the [d3-time-format syntax](https://github.com/d3/d3-time-format#locale_format). UTC date format parsing is supported similarly (e.g., `{foo: \"utc:'%m%d%Y'\"}`). See more about [UTC time](https://vega.github.io/vega-lite/docs/timeunit.html#utc)" }, "type": { "const": "topojson", "description": "Type of input data: `\"json\"`, `\"csv\"`, `\"tsv\"`, `\"dsv\"`.\n\n__Default value:__ The default format type is determined by the extension of the file URL. If no extension is detected, `\"json\"` will be used by default.", "type": "string" } }, "type": "object" }, "Transform": { "anyOf": [ { "$ref": "#/definitions/AggregateTransform" }, { "$ref": "#/definitions/BinTransform" }, { "$ref": "#/definitions/CalculateTransform" }, { "$ref": "#/definitions/DensityTransform" }, { "$ref": "#/definitions/ExtentTransform" }, { "$ref": "#/definitions/FilterTransform" }, { "$ref": "#/definitions/FlattenTransform" }, { "$ref": "#/definitions/FoldTransform" }, { "$ref": "#/definitions/ImputeTransform" }, { "$ref": "#/definitions/JoinAggregateTransform" }, { "$ref": "#/definitions/LoessTransform" }, { "$ref": "#/definitions/LookupTransform" }, { "$ref": "#/definitions/QuantileTransform" }, { "$ref": "#/definitions/RegressionTransform" }, { "$ref": "#/definitions/TimeUnitTransform" }, { "$ref": "#/definitions/SampleTransform" }, { "$ref": "#/definitions/StackTransform" }, { "$ref": "#/definitions/WindowTransform" }, { "$ref": "#/definitions/PivotTransform" } ] }, "Type": { "description": "Data type based on level of measurement", "enum": [ "quantitative", "ordinal", "temporal", "nominal", "geojson" ], "type": "string" }, "TypeForShape": { "enum": [ "nominal", "ordinal", "geojson" ], "type": "string" }, "TypedFieldDef": { "additionalProperties": false, "description": "Definition object for a data field, its type and transformation of an encoding channel.", "properties": { "aggregate": { "$ref": "#/definitions/Aggregate", "description": "Aggregation function for the field (e.g., `\"mean\"`, `\"sum\"`, `\"median\"`, `\"min\"`, `\"max\"`, `\"count\"`).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html) documentation." }, "bandPosition": { "description": "Relative position on a band of a stacked, binned, time unit, or band scale. For example, the marks will be positioned at the beginning of the band if set to `0`, and at the middle of the band if set to `0.5`.", "maximum": 1, "minimum": 0, "type": "number" }, "bin": { "anyOf": [ { "type": "boolean" }, { "$ref": "#/definitions/BinParams" }, { "const": "binned", "type": "string" }, { "type": "null" } ], "description": "A flag for binning a `quantitative` field, [an object defining binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters), or indicating that the data for `x` or `y` channel are binned before they are imported into Vega-Lite (`\"binned\"`).\n\n- If `true`, default [binning parameters](https://vega.github.io/vega-lite/docs/bin.html#bin-parameters) will be applied.\n\n- If `\"binned\"`, this indicates that the data for the `x` (or `y`) channel are already binned. You can map the bin-start field to `x` (or `y`) and the bin-end field to `x2` (or `y2`). The scale and axis will be formatted similar to binning in Vega-Lite. To adjust the axis ticks based on the bin step, you can also set the axis's [`tickMinStep`](https://vega.github.io/vega-lite/docs/axis.html#ticks) property.\n\n__Default value:__ `false`\n\n__See also:__ [`bin`](https://vega.github.io/vega-lite/docs/bin.html) documentation." }, "field": { "$ref": "#/definitions/Field", "description": "__Required.__ A string defining the name of the field from which to pull a data value or an object defining iterated values from the [`repeat`](https://vega.github.io/vega-lite/docs/repeat.html) operator.\n\n__See also:__ [`field`](https://vega.github.io/vega-lite/docs/field.html) documentation.\n\n__Notes:__ 1) Dots (`.`) and brackets (`[` and `]`) can be used to access nested objects (e.g., `\"field\": \"foo.bar\"` and `\"field\": \"foo['bar']\"`). If field names contain dots or brackets but are not nested, you can use `\\\\` to escape dots and brackets (e.g., `\"a\\\\.b\"` and `\"a\\\\[0\\\\]\"`). See more details about escaping in the [field documentation](https://vega.github.io/vega-lite/docs/field.html). 2) `field` is not required if `aggregate` is `count`." }, "timeUnit": { "anyOf": [ { "$ref": "#/definitions/TimeUnit" }, { "$ref": "#/definitions/BinnedTimeUnit" }, { "$ref": "#/definitions/TimeUnitParams" } ], "description": "Time unit (e.g., `year`, `yearmonth`, `month`, `hours`) for a temporal field. or [a temporal field that gets casted as ordinal](https://vega.github.io/vega-lite/docs/type.html#cast).\n\n__Default value:__ `undefined` (None)\n\n__See also:__ [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html) documentation." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "type": "null" } ], "description": "A title for the field. If `null`, the title will be removed.\n\n__Default value:__ derived from the field's name and transformation function (`aggregate`, `bin` and `timeUnit`). If the field has an aggregate function, the function is displayed as part of the title (e.g., `\"Sum of Profit\"`). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., `\"Profit (binned)\"`, `\"Transaction Date (year-month)\"`). Otherwise, the title is simply the field name.\n\n__Notes__:\n\n1) You can customize the default field title format by providing the [`fieldTitle`](https://vega.github.io/vega-lite/docs/config.html#top-level-config) property in the [config](https://vega.github.io/vega-lite/docs/config.html) or [`fieldTitle` function via the `compile` function's options](https://vega.github.io/vega-lite/usage/compile.html#field-title).\n\n2) If both field definition's `title` and axis, header, or legend `title` are defined, axis/header/legend title will be used." }, "type": { "$ref": "#/definitions/StandardType", "description": "The type of measurement (`\"quantitative\"`, `\"temporal\"`, `\"ordinal\"`, or `\"nominal\"`) for the encoded field or constant value (`datum`). It can also be a `\"geojson\"` type for encoding ['geoshape'](https://vega.github.io/vega-lite/docs/geoshape.html).\n\nVega-Lite automatically infers data types in many cases as discussed below. However, type is required for a field if: (1) the field is not nominal and the field encoding has no specified `aggregate` (except `argmin` and `argmax`), `bin`, scale type, custom `sort` order, nor `timeUnit` or (2) if you wish to use an ordinal scale for a field with `bin` or `timeUnit`.\n\n__Default value:__\n\n1) For a data `field`, `\"nominal\"` is the default data type unless the field encoding has `aggregate`, `channel`, `bin`, scale type, `sort`, or `timeUnit` that satisfies the following criteria:\n- `\"quantitative\"` is the default type if (1) the encoded field contains `bin` or `aggregate` except `\"argmin\"` and `\"argmax\"`, (2) the encoding channel is `latitude` or `longitude` channel or (3) if the specified scale type is [a quantitative scale](https://vega.github.io/vega-lite/docs/scale.html#type).\n- `\"temporal\"` is the default type if (1) the encoded field contains `timeUnit` or (2) the specified scale type is a time or utc scale\n- `\"ordinal\"` is the default type if (1) the encoded field contains a [custom `sort` order](https://vega.github.io/vega-lite/docs/sort.html#specifying-custom-sort-order), (2) the specified scale type is an ordinal/point/band scale, or (3) the encoding channel is `order`.\n\n2) For a constant value in data domain (`datum`):\n- `\"quantitative\"` if the datum is a number\n- `\"nominal\"` if the datum is a string\n- `\"temporal\"` if the datum is [a date time object](https://vega.github.io/vega-lite/docs/datetime.html)\n\n__Note:__\n- Data `type` describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data.\n- Data values for a temporal field can be either a date-time string (e.g., `\"2015-03-07 12:32:17\"`, `\"17:01\"`, `\"2015-03-16\"`. `\"2015\"`) or a timestamp number (e.g., `1552199579097`).\n- When using with [`bin`](https://vega.github.io/vega-lite/docs/bin.html), the `type` property can be either `\"quantitative\"` (for using a linear bin scale) or [`\"ordinal\"` (for using an ordinal bin scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the `type` property can be either `\"temporal\"` (default, for using a temporal scale) or [`\"ordinal\"` (for using an ordinal scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin).\n- When using with [`aggregate`](https://vega.github.io/vega-lite/docs/aggregate.html), the `type` property refers to the post-aggregation data type. For example, we can calculate count `distinct` of a categorical field `\"cat\"` using `{\"aggregate\": \"distinct\", \"field\": \"cat\"}`. The `\"type\"` of the aggregate output is `\"quantitative\"`.\n- Secondary channels (e.g., `x2`, `y2`, `xError`, `yError`) do not have `type` as they must have exactly the same type as their primary channels (e.g., `x`, `y`).\n\n__See also:__ [`type`](https://vega.github.io/vega-lite/docs/type.html) documentation." } }, "type": "object" }, "URI": { "format": "uri-reference", "type": "string" }, "UnitSpec": { "$ref": "#/definitions/GenericUnitSpec", "description": "A unit specification, which can contain either [primitive marks or composite marks](https://vega.github.io/vega-lite/docs/mark.html#types)." }, "UnitSpecWithFrame": { "additionalProperties": false, "properties": { "data": { "anyOf": [ { "$ref": "#/definitions/Data" }, { "type": "null" } ], "description": "An object describing the data source. Set to `null` to ignore the parent's data source. If no data is set, it is derived from the parent." }, "description": { "description": "Description of this mark for commenting purpose.", "type": "string" }, "encoding": { "$ref": "#/definitions/Encoding", "description": "A key-value mapping between encoding channels and definition of fields." }, "height": { "anyOf": [ { "type": "number" }, { "const": "container", "type": "string" }, { "$ref": "#/definitions/Step" } ], "description": "The height of a visualization.\n\n- For a plot with a continuous y-field, height should be a number.\n- For a plot with either a discrete y-field or no y-field, height can be either a number indicating a fixed height or an object in the form of `{step: number}` defining the height per discrete step. (No y-field is equivalent to having one discrete step.)\n- To enable responsive sizing on height, it should be set to `\"container\"`.\n\n__Default value:__ Based on `config.view.continuousHeight` for a plot with a continuous y-field and `config.view.discreteHeight` otherwise.\n\n__Note:__ For plots with [`row` and `column` channels](https://vega.github.io/vega-lite/docs/encoding.html#facet), this represents the height of a single view and the `\"container\"` option cannot be used.\n\n__See also:__ [`height`](https://vega.github.io/vega-lite/docs/size.html) documentation." }, "mark": { "$ref": "#/definitions/AnyMark", "description": "A string describing the mark type (one of `\"bar\"`, `\"circle\"`, `\"square\"`, `\"tick\"`, `\"line\"`, `\"area\"`, `\"point\"`, `\"rule\"`, `\"geoshape\"`, and `\"text\"`) or a [mark definition object](https://vega.github.io/vega-lite/docs/mark.html#mark-def)." }, "name": { "description": "Name of the visualization for later reference.", "type": "string" }, "params": { "description": "An array of parameters that may either be simple variables, or more complex selections that map user input to data queries.", "items": { "$ref": "#/definitions/SelectionParameter" }, "type": "array" }, "projection": { "$ref": "#/definitions/Projection", "description": "An object defining properties of geographic projection, which will be applied to `shape` path for `\"geoshape\"` marks and to `latitude` and `\"longitude\"` channels for other marks." }, "title": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "$ref": "#/definitions/TitleParams" } ], "description": "Title for the plot." }, "transform": { "description": "An array of data transformations such as filter and new field calculation.", "items": { "$ref": "#/definitions/Transform" }, "type": "array" }, "view": { "$ref": "#/definitions/ViewBackground", "description": "An object defining the view background's fill and stroke.\n\n__Default value:__ none (transparent)" }, "width": { "anyOf": [ { "type": "number" }, { "const": "container", "type": "string" }, { "$ref": "#/definitions/Step" } ], "description": "The width of a visualization.\n\n- For a plot with a continuous x-field, width should be a number.\n- For a plot with either a discrete x-field or no x-field, width can be either a number indicating a fixed width or an object in the form of `{step: number}` defining the width per discrete step. (No x-field is equivalent to having one discrete step.)\n- To enable responsive sizing on width, it should be set to `\"container\"`.\n\n__Default value:__ Based on `config.view.continuousWidth` for a plot with a continuous x-field and `config.view.discreteWidth` otherwise.\n\n__Note:__ For plots with [`row` and `column` channels](https://vega.github.io/vega-lite/docs/encoding.html#facet), this represents the width of a single view and the `\"container\"` option cannot be used.\n\n__See also:__ [`width`](https://vega.github.io/vega-lite/docs/size.html) documentation." } }, "required": [ "mark" ], "type": "object" }, "UrlData": { "additionalProperties": false, "properties": { "format": { "$ref": "#/definitions/DataFormat", "description": "An object that specifies the format for parsing the data." }, "name": { "description": "Provide a placeholder name and bind data at runtime.", "type": "string" }, "url": { "description": "An URL from which to load the data set. Use the `format.type` property to ensure the loaded data is correctly parsed.", "type": "string" } }, "required": [ "url" ], "type": "object" }, "UtcMultiTimeUnit": { "enum": [ "utcyearquarter", "utcyearquartermonth", "utcyearmonth", "utcyearmonthdate", "utcyearmonthdatehours", "utcyearmonthdatehoursminutes", "utcyearmonthdatehoursminutesseconds", "utcyearweek", "utcyearweekday", "utcyearweekdayhours", "utcyearweekdayhoursminutes", "utcyearweekdayhoursminutesseconds", "utcyeardayofyear", "utcquartermonth", "utcmonthdate", "utcmonthdatehours", "utcmonthdatehoursminutes", "utcmonthdatehoursminutesseconds", "utcweekday", "utcweekdayhours", "utcweekdayhoursminutes", "utcweekdayhoursminutesseconds", "utcdayhours", "utcdayhoursminutes", "utcdayhoursminutesseconds", "utchoursminutes", "utchoursminutesseconds", "utcminutesseconds", "utcsecondsmilliseconds" ], "type": "string" }, "UtcSingleTimeUnit": { "enum": [ "utcyear", "utcquarter", "utcmonth", "utcweek", "utcday", "utcdayofyear", "utcdate", "utchours", "utcminutes", "utcseconds", "utcmilliseconds" ], "type": "string" }, "ValueDef<(number|\"width\"|\"height\"|ExprRef)>": { "additionalProperties": false, "description": "Definition object for a constant value (primitive value or gradient definition) of an encoding channel.", "properties": { "value": { "anyOf": [ { "type": "number" }, { "const": "width", "type": "string" }, { "const": "height", "type": "string" }, { "$ref": "#/definitions/ExprRef" } ], "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." } }, "required": [ "value" ], "type": "object" }, "ValueDef": { "additionalProperties": false, "description": "Definition object for a constant value (primitive value or gradient definition) of an encoding channel.", "properties": { "value": { "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity).", "type": "number" } }, "required": [ "value" ], "type": "object" }, "ValueDefWithCondition": { "additionalProperties": false, "minProperties": 1, "properties": { "condition": { "anyOf": [ { "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" }, { "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalValueDef<(Gradient|string|null|ExprRef)>" }, "type": "array" } ], "description": "A field definition or one or more value definition(s) with a parameter predicate." }, "value": { "anyOf": [ { "$ref": "#/definitions/Gradient" }, { "type": "string" }, { "type": "null" }, { "$ref": "#/definitions/ExprRef" } ], "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." } }, "type": "object" }, "ValueDefWithCondition": { "additionalProperties": false, "minProperties": 1, "properties": { "condition": { "anyOf": [ { "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" }, { "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" }, "type": "array" } ], "description": "A field definition or one or more value definition(s) with a parameter predicate." }, "value": { "anyOf": [ { "type": "string" }, { "type": "null" }, { "$ref": "#/definitions/ExprRef" } ], "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." } }, "type": "object" }, "ValueDefWithCondition": { "additionalProperties": false, "minProperties": 1, "properties": { "condition": { "anyOf": [ { "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" }, { "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalValueDef<(number|ExprRef)>" }, "type": "array" } ], "description": "A field definition or one or more value definition(s) with a parameter predicate." }, "value": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." } }, "type": "object" }, "ValueDefWithCondition": { "additionalProperties": false, "minProperties": 1, "properties": { "condition": { "anyOf": [ { "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" }, { "$ref": "#/definitions/ConditionalValueDef<(number[]|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalValueDef<(number[]|ExprRef)>" }, "type": "array" } ], "description": "A field definition or one or more value definition(s) with a parameter predicate." }, "value": { "anyOf": [ { "items": { "type": "number" }, "type": "array" }, { "$ref": "#/definitions/ExprRef" } ], "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." } }, "type": "object" }, "ValueDefWithCondition,(string|null)>": { "additionalProperties": false, "minProperties": 1, "properties": { "condition": { "anyOf": [ { "$ref": "#/definitions/ConditionalMarkPropFieldOrDatumDef" }, { "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalValueDef<(string|null|ExprRef)>" }, "type": "array" } ], "description": "A field definition or one or more value definition(s) with a parameter predicate." }, "value": { "anyOf": [ { "type": "string" }, { "type": "null" }, { "$ref": "#/definitions/ExprRef" } ], "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." } }, "type": "object" }, "ValueDefWithCondition": { "additionalProperties": false, "minProperties": 1, "properties": { "condition": { "anyOf": [ { "$ref": "#/definitions/ConditionalStringFieldDef" }, { "$ref": "#/definitions/ConditionalValueDef<(Text|ExprRef)>" }, { "items": { "$ref": "#/definitions/ConditionalValueDef<(Text|ExprRef)>" }, "type": "array" } ], "description": "A field definition or one or more value definition(s) with a parameter predicate." }, "value": { "anyOf": [ { "$ref": "#/definitions/Text" }, { "$ref": "#/definitions/ExprRef" } ], "description": "A constant value in visual domain (e.g., `\"red\"` / `\"#0099ff\"` / [gradient definition](https://vega.github.io/vega-lite/docs/types.html#gradient) for color, values between `0` to `1` for opacity)." } }, "type": "object" }, "VariableParameter": { "additionalProperties": false, "properties": { "bind": { "$ref": "#/definitions/Binding", "description": "Binds the parameter to an external input element such as a slider, selection list or radio button group." }, "expr": { "$ref": "#/definitions/Expr", "description": "An expression for the value of the parameter. This expression may include other parameters, in which case the parameter will automatically update in response to upstream parameter changes." }, "name": { "$ref": "#/definitions/ParameterName", "description": "A unique name for the variable parameter. Parameter names should be valid JavaScript identifiers: they should contain only alphanumeric characters (or \"$\", or \"_\") and may not start with a digit. Reserved keywords that may not be used as parameter names are \"datum\", \"event\", \"item\", and \"parent\"." }, "react": { "description": "A boolean flag (default `true`) indicating if the update expression should be automatically re-evaluated when any upstream signal dependencies update. If `false`, the update expression will not register any dependencies on other signals, even for initialization.\n\n __Default value:__ `true`", "type": "boolean" }, "value": { "description": "The [initial value](http://vega.github.io/vega-lite/docs/value.html) of the parameter.\n\n__Default value:__ `undefined`" } }, "required": [ "name" ], "type": "object" }, "Vector10": { "items": { "type": "string" }, "maxItems": 10, "minItems": 10, "type": "array" }, "Vector12": { "items": { "type": "string" }, "maxItems": 12, "minItems": 12, "type": "array" }, "Vector2": { "items": { "$ref": "#/definitions/DateTime" }, "maxItems": 2, "minItems": 2, "type": "array" }, "Vector2>": { "items": { "$ref": "#/definitions/Vector2" }, "maxItems": 2, "minItems": 2, "type": "array" }, "Vector2": { "items": { "type": "boolean" }, "maxItems": 2, "minItems": 2, "type": "array" }, "Vector2": { "items": { "type": "number" }, "maxItems": 2, "minItems": 2, "type": "array" }, "Vector2": { "items": { "type": "string" }, "maxItems": 2, "minItems": 2, "type": "array" }, "Vector3": { "items": { "type": "number" }, "maxItems": 3, "minItems": 3, "type": "array" }, "Vector7": { "items": { "type": "string" }, "maxItems": 7, "minItems": 7, "type": "array" }, "ViewBackground": { "additionalProperties": false, "properties": { "cornerRadius": { "anyOf": [ { "description": "The radius in pixels of rounded rectangles or arcs' corners.\n\n__Default value:__ `0`", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "cursor": { "$ref": "#/definitions/Cursor", "description": "The mouse cursor used over the view. Any valid [CSS cursor type](https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values) can be used." }, "fill": { "anyOf": [ { "$ref": "#/definitions/Color" }, { "type": "null" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The fill color.\n\n__Default value:__ `undefined`" }, "fillOpacity": { "anyOf": [ { "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", "maximum": 1, "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "opacity": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The overall opacity (value between [0,1]).\n\n__Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or `square` marks or layered `bar` charts and `1` otherwise.", "maximum": 1, "minimum": 0 }, "stroke": { "anyOf": [ { "$ref": "#/definitions/Color" }, { "type": "null" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The stroke color.\n\n__Default value:__ `\"#ddd\"`" }, "strokeCap": { "anyOf": [ { "$ref": "#/definitions/StrokeCap", "description": "The stroke cap for line ending style. One of `\"butt\"`, `\"round\"`, or `\"square\"`.\n\n__Default value:__ `\"butt\"`" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeDash": { "anyOf": [ { "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", "items": { "type": "number" }, "type": "array" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeDashOffset": { "anyOf": [ { "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeJoin": { "anyOf": [ { "$ref": "#/definitions/StrokeJoin", "description": "The stroke line join method. One of `\"miter\"`, `\"round\"` or `\"bevel\"`.\n\n__Default value:__ `\"miter\"`" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeMiterLimit": { "anyOf": [ { "description": "The miter limit at which to bevel a line join.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeOpacity": { "anyOf": [ { "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", "maximum": 1, "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeWidth": { "anyOf": [ { "description": "The stroke width, in pixels.", "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "style": { "anyOf": [ { "type": "string" }, { "items": { "type": "string" }, "type": "array" } ], "description": "A string or array of strings indicating the name of custom styles to apply to the view background. A style is a named collection of mark property defaults defined within the [style configuration](https://vega.github.io/vega-lite/docs/mark.html#style-config). If style is an array, later styles will override earlier styles.\n\n__Default value:__ `\"cell\"` __Note:__ Any specified view background properties will augment the default style." } }, "type": "object" }, "ViewConfig": { "additionalProperties": false, "properties": { "clip": { "description": "Whether the view should be clipped.", "type": "boolean" }, "continuousHeight": { "description": "The default height when the plot has a continuous y-field for x or latitude, or has arc marks.\n\n__Default value:__ `200`", "type": "number" }, "continuousWidth": { "description": "The default width when the plot has a continuous field for x or longitude, or has arc marks.\n\n__Default value:__ `200`", "type": "number" }, "cornerRadius": { "anyOf": [ { "description": "The radius in pixels of rounded rectangles or arcs' corners.\n\n__Default value:__ `0`", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "cursor": { "$ref": "#/definitions/Cursor", "description": "The mouse cursor used over the view. Any valid [CSS cursor type](https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Values) can be used." }, "discreteHeight": { "anyOf": [ { "type": "number" }, { "additionalProperties": false, "properties": { "step": { "type": "number" } }, "required": [ "step" ], "type": "object" } ], "description": "The default height when the plot has non arc marks and either a discrete y-field or no y-field. The height can be either a number indicating a fixed height or an object in the form of `{step: number}` defining the height per discrete step.\n\n__Default value:__ a step size based on `config.view.step`." }, "discreteWidth": { "anyOf": [ { "type": "number" }, { "additionalProperties": false, "properties": { "step": { "type": "number" } }, "required": [ "step" ], "type": "object" } ], "description": "The default width when the plot has non-arc marks and either a discrete x-field or no x-field. The width can be either a number indicating a fixed width or an object in the form of `{step: number}` defining the width per discrete step.\n\n__Default value:__ a step size based on `config.view.step`." }, "fill": { "anyOf": [ { "$ref": "#/definitions/Color" }, { "type": "null" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The fill color.\n\n__Default value:__ `undefined`" }, "fillOpacity": { "anyOf": [ { "description": "The fill opacity (value between [0,1]).\n\n__Default value:__ `1`", "maximum": 1, "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "opacity": { "anyOf": [ { "type": "number" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The overall opacity (value between [0,1]).\n\n__Default value:__ `0.7` for non-aggregate plots with `point`, `tick`, `circle`, or `square` marks or layered `bar` charts and `1` otherwise.", "maximum": 1, "minimum": 0 }, "step": { "description": "Default step size for x-/y- discrete fields.", "type": "number" }, "stroke": { "anyOf": [ { "$ref": "#/definitions/Color" }, { "type": "null" }, { "$ref": "#/definitions/ExprRef" } ], "description": "The stroke color.\n\n__Default value:__ `\"#ddd\"`" }, "strokeCap": { "anyOf": [ { "$ref": "#/definitions/StrokeCap", "description": "The stroke cap for line ending style. One of `\"butt\"`, `\"round\"`, or `\"square\"`.\n\n__Default value:__ `\"butt\"`" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeDash": { "anyOf": [ { "description": "An array of alternating stroke, space lengths for creating dashed or dotted lines.", "items": { "type": "number" }, "type": "array" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeDashOffset": { "anyOf": [ { "description": "The offset (in pixels) into which to begin drawing with the stroke dash array.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeJoin": { "anyOf": [ { "$ref": "#/definitions/StrokeJoin", "description": "The stroke line join method. One of `\"miter\"`, `\"round\"` or `\"bevel\"`.\n\n__Default value:__ `\"miter\"`" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeMiterLimit": { "anyOf": [ { "description": "The miter limit at which to bevel a line join.", "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeOpacity": { "anyOf": [ { "description": "The stroke opacity (value between [0,1]).\n\n__Default value:__ `1`", "maximum": 1, "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] }, "strokeWidth": { "anyOf": [ { "description": "The stroke width, in pixels.", "minimum": 0, "type": "number" }, { "$ref": "#/definitions/ExprRef" } ] } }, "type": "object" }, "WindowEventType": { "anyOf": [ { "$ref": "#/definitions/EventType" }, { "type": "string" } ] }, "WindowFieldDef": { "additionalProperties": false, "properties": { "as": { "$ref": "#/definitions/FieldName", "description": "The output name for the window operation." }, "field": { "$ref": "#/definitions/FieldName", "description": "The data field for which to compute the aggregate or window function. This can be omitted for window functions that do not operate over a field such as `\"count\"`, `\"rank\"`, `\"dense_rank\"`." }, "op": { "anyOf": [ { "$ref": "#/definitions/AggregateOp" }, { "$ref": "#/definitions/WindowOnlyOp" } ], "description": "The window or aggregation operation to apply within a window (e.g., `\"rank\"`, `\"lead\"`, `\"sum\"`, `\"average\"` or `\"count\"`). See the list of all supported operations [here](https://vega.github.io/vega-lite/docs/window.html#ops)." }, "param": { "description": "Parameter values for the window functions. Parameter values can be omitted for operations that do not accept a parameter.\n\nSee the list of all supported operations and their parameters [here](https://vega.github.io/vega-lite/docs/transforms/window.html).", "type": "number" } }, "required": [ "op", "as" ], "type": "object" }, "WindowOnlyOp": { "enum": [ "row_number", "rank", "dense_rank", "percent_rank", "cume_dist", "ntile", "lag", "lead", "first_value", "last_value", "nth_value" ], "type": "string" }, "WindowTransform": { "additionalProperties": false, "properties": { "frame": { "description": "A frame specification as a two-element array indicating how the sliding window should proceed. The array entries should either be a number indicating the offset from the current data object, or null to indicate unbounded rows preceding or following the current data object. The default value is `[null, 0]`, indicating that the sliding window includes the current object and all preceding objects. The value `[-5, 5]` indicates that the window should include five objects preceding and five objects following the current object. Finally, `[null, null]` indicates that the window frame should always include all data objects. If you this frame and want to assign the same value to add objects, you can use the simpler [join aggregate transform](https://vega.github.io/vega-lite/docs/joinaggregate.html). The only operators affected are the aggregation operations and the `first_value`, `last_value`, and `nth_value` window operations. The other window operations are not affected by this.\n\n__Default value:__: `[null, 0]` (includes the current object and all preceding objects)", "items": { "type": [ "null", "number" ] }, "type": "array" }, "groupby": { "description": "The data fields for partitioning the data objects into separate windows. If unspecified, all data points will be in a single window.", "items": { "$ref": "#/definitions/FieldName" }, "type": "array" }, "ignorePeers": { "description": "Indicates if the sliding window frame should ignore peer values (data that are considered identical by the sort criteria). The default is false, causing the window frame to expand to include all peer values. If set to true, the window frame will be defined by offset values only. This setting only affects those operations that depend on the window frame, namely aggregation operations and the first_value, last_value, and nth_value window operations.\n\n__Default value:__ `false`", "type": "boolean" }, "sort": { "description": "A sort field definition for sorting data objects within a window. If two data objects are considered equal by the comparator, they are considered \"peer\" values of equal rank. If sort is not specified, the order is undefined: data objects are processed in the order they are observed and none are considered peers (the ignorePeers parameter is ignored and treated as if set to `true`).", "items": { "$ref": "#/definitions/SortField" }, "type": "array" }, "window": { "description": "The definition of the fields in the window, and what calculations to use.", "items": { "$ref": "#/definitions/WindowFieldDef" }, "type": "array" } }, "required": [ "window" ], "type": "object" } } } ================================================ FILE: wren-ai-service/src/pipelines/indexing/__init__.py ================================================ import asyncio import json import logging import re from typing import Any, Dict, List, Optional import orjson from haystack import Document, component from haystack.components.writers import DocumentWriter from haystack.document_stores.types import DocumentStore, DuplicatePolicy logger = logging.getLogger("wren-ai-service") @component class DocumentCleaner: """ This component is used to clear all the documents in the specified document store(s). """ def __init__(self, stores: List[DocumentStore]) -> None: self._stores = stores @component.output_types() async def run(self, project_id: Optional[str] = None) -> None: async def _clear_documents( store: DocumentStore, project_id: Optional[str] = None ) -> None: store_name = ( store.to_dict().get("init_parameters", {}).get("index", "unknown") ) logger.info(f"Project ID: {project_id}, Cleaning documents in {store_name}") filters = ( { "operator": "AND", "conditions": [ {"field": "project_id", "operator": "==", "value": project_id}, ], } if project_id else None ) await store.delete_documents(filters) await asyncio.gather( *[_clear_documents(store, project_id) for store in self._stores] ) @component class MDLValidator: """ Validate the MDL to check if it is a valid JSON and contains the required keys. """ @component.output_types(mdl=Dict[str, Any]) def run(self, mdl: str) -> str: try: mdl_json = orjson.loads(mdl) logger.info(f"MDL JSON: {mdl_json}") except json.JSONDecodeError as e: raise ValueError(f"Invalid JSON: {e}") if "models" not in mdl_json: mdl_json["models"] = [] if "views" not in mdl_json: mdl_json["views"] = [] if "relationships" not in mdl_json: mdl_json["relationships"] = [] if "metrics" not in mdl_json: mdl_json["metrics"] = [] return {"mdl": mdl_json} @component class AsyncDocumentWriter(DocumentWriter): @component.output_types(documents_written=int) async def run( self, documents: List[Document], policy: Optional[DuplicatePolicy] = None ): if policy is None: policy = self.policy documents_written = await self.document_store.write_documents( documents=documents, policy=policy ) return {"documents_written": documents_written} def clean_display_name(display_name: str) -> str: if not display_name: return display_name # Define invalid character sets based on comments and test expectations # Numbers are only invalid at prefix, not in middle or suffix prefix_invalid = set( [ "-", "&", "%", "=", "+", "'", '"', "<", ">", "#", "|", "!", "(", ")", "*", ",", "/", ";", "[", "\\", "]", "^", "{", "}", "~", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "\x00", ".", ] ) middle_invalid = set( [ "-", "&", "%", "=", "+", "'", '"', "<", ">", "#", "|", "!", "(", ")", "/", "?", "[", "\\", "]", "^", "`", "{", "}", "~", ".", "*", "@", "$", ] ) suffix_invalid = set( [ "-", "&", "%", "=", "+", ":", "'", '"', "<", ">", "#", "|", "!", "(", ")", ",", ".", "/", "@", "[", "\\", "]", "^", "{", "}", "~", ] ) result = list(display_name) prefix_prepended = False # Handle prefix invalid characters if len(result) > 0 and result[0] in prefix_invalid: # For numbers, prepend underscore; for other chars, replace with underscore if result[0].isdigit(): result.insert(0, "_") prefix_prepended = True else: result[0] = "_" # Handle middle invalid characters (account for prepended prefix) start_idx = 2 if prefix_prepended else 1 end_idx = len(result) - 1 for i in range(start_idx, end_idx): if result[i] in middle_invalid: result[i] = "_" # Handle suffix invalid characters if len(result) > 1 and result[-1] in suffix_invalid: result[-1] = "_" # Handle single character case original_len = len(display_name) if original_len == 1: char = display_name[0] # For single character, always replace with underscore (don't prepend) if char in prefix_invalid or char in suffix_invalid: result = ["_"] cleaned = "".join(result) # Collapse multiple consecutive underscores cleaned = re.sub(r"_+", "_", cleaned) return cleaned # Put the pipelines imports here to avoid circular imports and make them accessible directly to the rest of packages from .db_schema import DBSchema # noqa: E402 from .historical_question import HistoricalQuestion # noqa: E402 from .instructions import Instructions # noqa: E402 from .project_meta import ProjectMeta # noqa: E402 from .sql_pairs import SqlPairs # noqa: E402 from .table_description import TableDescription # noqa: E402 __all__ = [ "DBSchema", "TableDescription", "HistoricalQuestion", "SqlPairs", "Instructions", "ProjectMeta", ] ================================================ FILE: wren-ai-service/src/pipelines/indexing/db_schema.py ================================================ import asyncio import logging import sys import uuid from typing import Any, Dict, List, Optional from hamilton import base from hamilton.async_driver import AsyncDriver from hamilton.function_modifiers import extract_fields from haystack import Document, component from haystack.components.writers import DocumentWriter from haystack.document_stores.types import DuplicatePolicy from langfuse.decorators import observe from tqdm import tqdm from src.core.pipeline import BasicPipeline from src.core.provider import DocumentStoreProvider, EmbedderProvider from src.pipelines.indexing import ( AsyncDocumentWriter, DocumentCleaner, MDLValidator, clean_display_name, ) from src.pipelines.indexing.utils import helper logger = logging.getLogger("wren-ai-service") @component class DDLChunker: @component.output_types(documents=List[Document]) async def run( self, mdl: Dict[str, Any], column_batch_size: int, project_id: Optional[str] = None, ): def _additional_meta() -> Dict[str, Any]: return {"project_id": project_id} if project_id else {} chunks = [ { "id": str(uuid.uuid4()), "meta": { "type": "TABLE_SCHEMA", "name": chunk["name"], **_additional_meta(), }, "content": chunk["payload"], } for chunk in await self._get_ddl_commands( **mdl, column_batch_size=column_batch_size ) ] return { "documents": [ Document(**chunk) for chunk in tqdm( chunks, desc=f"Project ID: {project_id}, Chunking DDL commands into documents", ) ] } async def _model_preprocessor( self, models: List[Dict[str, Any]], **kwargs ) -> List[Dict[str, Any]]: def _column_preprocessor( column: Dict[str, Any], addition: Dict[str, Any] ) -> Dict[str, Any]: addition = { key: helper(column, **addition) for key, helper in helper.COLUMN_PREPROCESSORS.items() if helper.condition(column, **addition) } return { "name": column.get("name", ""), "type": column.get("type", ""), **addition, } async def _preprocessor(model: Dict[str, Any], **kwargs) -> Dict[str, Any]: addition = { key: await helper(model, **kwargs) for key, helper in helper.MODEL_PREPROCESSORS.items() if helper.condition(model, **kwargs) } columns = [ _column_preprocessor(column, addition) for column in model.get("columns", []) if column.get("isHidden") is not True ] return { "name": model.get("name", ""), "properties": model.get("properties", {}), "columns": columns, "primaryKey": model.get("primaryKey", ""), } tasks = [_preprocessor(model, **kwargs) for model in models] return await asyncio.gather(*tasks) async def _get_ddl_commands( self, models: List[Dict[str, Any]], relationships: List[Dict[str, Any]], views: List[Dict[str, Any]], metrics: List[Dict[str, Any]], column_batch_size: int = 50, **kwargs, ) -> List[dict]: return ( self._convert_models_and_relationships( await self._model_preprocessor(models, **kwargs), relationships, column_batch_size, ) + self._convert_views(views) + self._convert_metrics(metrics) ) def _convert_models_and_relationships( self, models: List[Dict[str, Any]], relationships: List[Dict[str, Any]], column_batch_size: int, ) -> List[Dict[str, str]]: def _model_command(model: Dict[str, Any]) -> dict: properties = model.get("properties", {}) model_properties = { "alias": clean_display_name(properties.get("displayName", "")), "description": properties.get("description", ""), } comment = f"\n/* {str(model_properties)} */\n" table_name = model["name"] payload = { "type": "TABLE", "comment": comment, "name": table_name, } return {"name": table_name, "payload": str(payload)} def _column_command(column: Dict[str, Any], model: Dict[str, Any]) -> dict: if column.get("relationship"): return None comments = [ helper(column, model=model) for helper in helper.COLUMN_COMMENT_HELPERS.values() if helper.condition(column) ] return { "type": "COLUMN", "comment": "".join(comments), "name": column["name"], "data_type": column["type"], "is_primary_key": column["name"] == model["primaryKey"], } def _relationship_command( relationship: Dict[str, Any], table_name: str, primary_keys_map: Dict[str, str], ) -> dict: condition = relationship.get("condition", "") join_type = relationship.get("joinType", "") models = relationship.get("models", []) if len(models) != 2: return None if table_name not in models: return None if join_type not in ["MANY_TO_ONE", "ONE_TO_MANY", "ONE_TO_ONE"]: return None # Get related table and foreign key column is_source = table_name == models[0] related_table = models[1] if is_source else models[0] condition_parts = condition.split(" = ") fk_column = condition_parts[0 if is_source else 1].split(".")[1] # Build foreign key constraint fk_constraint = f"FOREIGN KEY ({fk_column}) REFERENCES {related_table}({primary_keys_map[related_table]})" return { "type": "FOREIGN_KEY", "comment": f'-- {{"condition": {condition}, "joinType": {join_type}}}\n ', "constraint": fk_constraint, "tables": models, } def _column_batch( model: Dict[str, Any], primary_keys_map: Dict[str, str] ) -> List[dict]: commands = [ _column_command(column, model) for column in model["columns"] ] + [ _relationship_command(relationship, model["name"], primary_keys_map) for relationship in relationships ] filtered = [command for command in commands if command is not None] return [ { "name": model["name"], "payload": str( { "type": "TABLE_COLUMNS", "columns": filtered[i : i + column_batch_size], } ), } for i in range(0, len(filtered), column_batch_size) ] # A map to store model primary keys for foreign key relationships primary_keys_map = {model["name"]: model["primaryKey"] for model in models} return [ command for model in models for command in _column_batch(model, primary_keys_map) + [_model_command(model)] ] def _convert_views(self, views: List[Dict[str, Any]]) -> List[Dict[str, str]]: def _payload(view: Dict[str, Any]) -> dict: return { "type": "VIEW", "comment": f"/* {view['properties']} */\n" if "properties" in view else "", "name": view["name"], "statement": view["statement"], } return [ {"name": view["name"], "payload": str(_payload(view))} for view in views ] def _convert_metrics(self, metrics: List[Dict[str, Any]]) -> List[Dict[str, str]]: def _create_column(name: str, data_type: str, comment: str) -> dict: return { "type": "COLUMN", "comment": comment, "name": name, "data_type": data_type, } def _dimensions(metric: Dict[str, Any]) -> List[dict]: return [ _create_column( name=dim.get("name", ""), data_type=dim.get("type", ""), comment="-- This column is a dimension\n ", ) for dim in metric.get("dimension", []) ] def _measures(metric: Dict[str, Any]) -> List[dict]: return [ _create_column( name=measure.get("name", ""), data_type=measure.get("type", ""), comment=f"-- This column is a measure\n -- expression: {measure['expression']}\n ", ) for measure in metric.get("measure", []) ] def _payload(metric: Dict[str, Any]) -> dict: return { "type": "METRIC", "comment": f"\n/* This table is a metric */\n/* Metric Base Object: {metric['baseObject']} */\n", "name": metric["name"], "columns": _dimensions(metric) + _measures(metric), } return [ {"name": metric["name"], "payload": str(_payload(metric))} for metric in metrics ] ## Start of Pipeline @observe(capture_input=False, capture_output=False) @extract_fields(dict(mdl=Dict[str, Any])) def validate_mdl(mdl_str: str, validator: MDLValidator) -> Dict[str, Any]: res = validator.run(mdl=mdl_str) return dict(mdl=res["mdl"]) @observe(capture_input=False) async def chunk( mdl: Dict[str, Any], chunker: DDLChunker, column_batch_size: int, project_id: Optional[str] = None, ) -> Dict[str, Any]: return await chunker.run( mdl=mdl, column_batch_size=column_batch_size, project_id=project_id, ) @observe(capture_input=False, capture_output=False) async def embedding(chunk: Dict[str, Any], embedder: Any) -> Dict[str, Any]: return await embedder.run(documents=chunk["documents"]) @observe(capture_input=False, capture_output=False) async def clean( embedding: Dict[str, Any], cleaner: DocumentCleaner, project_id: Optional[str] = None, ) -> Dict[str, Any]: await cleaner.run(project_id=project_id) return embedding @observe(capture_input=False) async def write(clean: Dict[str, Any], writer: DocumentWriter) -> None: return await writer.run(documents=clean["documents"]) ## End of Pipeline class DBSchema(BasicPipeline): def __init__( self, embedder_provider: EmbedderProvider, document_store_provider: DocumentStoreProvider, column_batch_size: int = 50, **kwargs, ) -> None: dbschema_store = document_store_provider.get_store() self._components = { "cleaner": DocumentCleaner([dbschema_store]), "validator": MDLValidator(), "embedder": embedder_provider.get_document_embedder(), "chunker": DDLChunker(), "writer": AsyncDocumentWriter( document_store=dbschema_store, policy=DuplicatePolicy.OVERWRITE, ), } self._configs = { "column_batch_size": column_batch_size, } self._final = "write" helper.load_helpers() super().__init__( AsyncDriver({}, sys.modules[__name__], result_builder=base.DictResult()) ) @observe(name="DB Schema Indexing") async def run( self, mdl_str: str, project_id: Optional[str] = None ) -> Dict[str, Any]: logger.info( f"Project ID: {project_id}, DB Schema Indexing pipeline is running..." ) return await self._pipe.execute( [self._final], inputs={ "mdl_str": mdl_str, "project_id": project_id, **self._components, **self._configs, }, ) @observe(name="Clean Documents for DB Schema") async def clean(self, project_id: Optional[str] = None) -> None: await clean( embedding={"documents": []}, cleaner=self._components["cleaner"], project_id=project_id, ) ================================================ FILE: wren-ai-service/src/pipelines/indexing/historical_question.py ================================================ import logging import sys import uuid from typing import Any, Dict, List, Optional from hamilton import base from hamilton.async_driver import AsyncDriver from hamilton.function_modifiers import extract_fields from haystack import Document, component from haystack.components.writers import DocumentWriter from haystack.document_stores.types import DuplicatePolicy from langfuse.decorators import observe from tqdm import tqdm from src.core.pipeline import BasicPipeline from src.core.provider import DocumentStoreProvider, EmbedderProvider from src.pipelines.indexing import AsyncDocumentWriter, DocumentCleaner, MDLValidator logger = logging.getLogger("wren-ai-service") @component class ViewChunker: """ A component that processes views from an MDL (Model Definition Language) file and converts them into Document objects. The component takes views in the following MDL format: { "views": [ { "statement": "SELECT * FROM employees", "properties": { "historical_queries": [], # List of previous related queries "question": "What is the average salary of employees?", # Current query "summary": "The average salary of employees is $50,000.", # Summary for the query "viewId": "1234567890" # Unique identifier } } ] } And converts each view into a Document with: - content: Concatenated string of historical queries and current question - meta: Dictionary containing: { "summary": "Generated description/answer", "statement": "SQL statement", "viewId": "Unique view identifier", "project_id": "Optional project identifier" } The Documents are then stored in the document store for later retrieval. """ @component.output_types(documents=List[Document]) def run(self, mdl: Dict[str, Any], project_id: Optional[str] = None) -> None: def _get_content(view: Dict[str, Any]) -> str: properties = view.get("properties", {}) historical_queries = properties.get("historical_queries", []) question = properties.get("question", "") return " ".join(historical_queries + [question]) def _get_meta(view: Dict[str, Any]) -> Dict[str, Any]: properties = view.get("properties", {}) return { "summary": properties.get("summary", ""), "statement": view.get("statement", ""), "viewId": properties.get("viewId", ""), } def _additional_meta() -> Dict[str, Any]: return {"project_id": project_id} if project_id else {} chunks = [ { "id": str(uuid.uuid4()), "content": _get_content(view), "meta": {**_get_meta(view), **_additional_meta()}, } for view in mdl["views"] ] return { "documents": [ Document(**chunk) for chunk in tqdm( chunks, desc=f"Project ID: {project_id}, Chunking views into documents", ) ] } ## Start of Pipeline @observe(capture_input=False, capture_output=False) @extract_fields(dict(mdl=Dict[str, Any])) def validate_mdl(mdl_str: str, validator: MDLValidator) -> Dict[str, Any]: res = validator.run(mdl=mdl_str) return dict(mdl=res["mdl"]) @observe(capture_input=False) def chunk( mdl: Dict[str, Any], chunker: ViewChunker, project_id: Optional[str] = None, ) -> Dict[str, Any]: return chunker.run(mdl=mdl, project_id=project_id) @observe(capture_input=False, capture_output=False) async def embedding(chunk: Dict[str, Any], embedder: Any) -> Dict[str, Any]: return await embedder.run(documents=chunk["documents"]) @observe(capture_input=False, capture_output=False) async def clean( embedding: Dict[str, Any], cleaner: DocumentCleaner, project_id: Optional[str] = None, ) -> Dict[str, Any]: await cleaner.run(project_id=project_id) return embedding @observe(capture_input=False) async def write(clean: Dict[str, Any], writer: DocumentWriter) -> None: return await writer.run(documents=clean["documents"]) ## End of Pipeline class HistoricalQuestion(BasicPipeline): def __init__( self, embedder_provider: EmbedderProvider, document_store_provider: DocumentStoreProvider, **kwargs, ) -> None: # keep the store name as it is for now, might change in the future store = document_store_provider.get_store(dataset_name="view_questions") self._components = { "cleaner": DocumentCleaner([store]), "validator": MDLValidator(), "embedder": embedder_provider.get_document_embedder(), "chunker": ViewChunker(), "writer": AsyncDocumentWriter( document_store=store, policy=DuplicatePolicy.OVERWRITE, ), } self._configs = {} self._final = "write" super().__init__( AsyncDriver({}, sys.modules[__name__], result_builder=base.DictResult()) ) @observe(name="Historical Question Indexing") async def run( self, mdl_str: str, project_id: Optional[str] = None ) -> Dict[str, Any]: logger.info( f"Project ID: {project_id}, Historical Question Indexing pipeline is running..." ) return await self._pipe.execute( [self._final], inputs={ "mdl_str": mdl_str, "project_id": project_id, **self._components, **self._configs, }, ) @observe(name="Clean Documents for Historical Question") async def clean(self, project_id: Optional[str] = None) -> None: await clean( embedding={"documents": []}, cleaner=self._components["cleaner"], project_id=project_id, ) ================================================ FILE: wren-ai-service/src/pipelines/indexing/instructions.py ================================================ import logging import sys import uuid from typing import Any, Dict, List, Literal, Optional from hamilton import base from hamilton.async_driver import AsyncDriver from haystack import Document, component from haystack.document_stores.types import DocumentStore, DuplicatePolicy from langfuse.decorators import observe from pydantic import BaseModel from src.core.pipeline import BasicPipeline from src.core.provider import DocumentStoreProvider, EmbedderProvider from src.pipelines.indexing import AsyncDocumentWriter logger = logging.getLogger("wren-ai-service") class Instruction(BaseModel): id: str instruction: str = "" question: str = "" # This is used to identify the default instruction needed to be retrieved for the project is_default: bool = False scope: Literal["sql", "answer", "chart"] = "sql" @component class InstructionsConverter: @component.output_types(documents=List[Document]) def run(self, instructions: list[Instruction], project_id: str = ""): logger.info(f"Project ID: {project_id} Converting instructions to documents...") addition = {"project_id": project_id} if project_id else {} return { "documents": [ Document( id=str(uuid.uuid4()), meta={ "instruction_id": instruction.id, "instruction": instruction.instruction, "is_default": instruction.is_default, "scope": instruction.scope, **addition, }, content="this is a global instruction, so no question is provided" if instruction.is_default else instruction.question, ) for instruction in instructions ] } @component class InstructionsCleaner: def __init__(self, instructions_store: DocumentStore) -> None: self.store = instructions_store @component.output_types() async def run( self, instruction_ids: List[str], project_id: Optional[str] = None ) -> None: filter = { "operator": "AND", "conditions": [ {"field": "instruction_id", "operator": "in", "value": instruction_ids}, ], } if project_id: filter["conditions"].append( {"field": "project_id", "operator": "==", "value": project_id} ) return await self.store.delete_documents(filter) ## Start of Pipeline @observe(capture_input=False) def to_documents( instructions: List[Instruction], document_converter: InstructionsConverter, project_id: str = "", ) -> Dict[str, Any]: return document_converter.run(instructions=instructions, project_id=project_id) @observe(capture_input=False, capture_output=False) async def embedding( to_documents: Dict[str, Any], embedder: Any, ) -> Dict[str, Any]: return await embedder.run(documents=to_documents["documents"]) @observe(capture_input=False, capture_output=False) async def clean( cleaner: InstructionsCleaner, instructions: List[Instruction], embedding: Dict[str, Any] = {}, project_id: str = "", delete_all: bool = False, ) -> Dict[str, Any]: instruction_ids = [instruction.id for instruction in instructions] if instruction_ids or delete_all: await cleaner.run(instruction_ids=instruction_ids, project_id=project_id) return embedding @observe(capture_input=False) async def write( clean: Dict[str, Any], writer: AsyncDocumentWriter, ) -> None: return await writer.run(documents=clean["documents"]) ## End of Pipeline class Instructions(BasicPipeline): def __init__( self, embedder_provider: EmbedderProvider, document_store_provider: DocumentStoreProvider, **kwargs, ) -> None: store = document_store_provider.get_store(dataset_name="instructions") self._components = { "cleaner": InstructionsCleaner(store), "embedder": embedder_provider.get_document_embedder(), "document_converter": InstructionsConverter(), "writer": AsyncDocumentWriter( document_store=store, policy=DuplicatePolicy.OVERWRITE, ), } super().__init__( AsyncDriver({}, sys.modules[__name__], result_builder=base.DictResult()) ) @observe(name="Instructions Indexing") async def run( self, instructions: list[Instruction], project_id: str = "", ) -> Dict[str, Any]: logger.info( f"Project ID: {project_id} Instructions Indexing pipeline is running..." ) input = { "project_id": project_id, "instructions": instructions, **self._components, } return await self._pipe.execute(["write"], inputs=input) @observe(name="Clean Documents for Instructions") async def clean( self, instructions: Optional[List[Instruction]] = None, project_id: Optional[str] = None, delete_all: bool = False, ) -> None: await clean( instructions=instructions or [], cleaner=self._components["cleaner"], project_id=project_id, delete_all=delete_all, ) ================================================ FILE: wren-ai-service/src/pipelines/indexing/project_meta.py ================================================ import logging import sys import uuid from typing import Any, Optional from hamilton import base from hamilton.async_driver import AsyncDriver from hamilton.function_modifiers import extract_fields from haystack import Document from haystack.components.writers import DocumentWriter from haystack.document_stores.types import DuplicatePolicy from langfuse.decorators import observe from src.core.pipeline import BasicPipeline from src.core.provider import DocumentStoreProvider from src.pipelines.indexing import AsyncDocumentWriter, DocumentCleaner, MDLValidator logger = logging.getLogger("wren-ai-service") ## Start of Pipeline @observe(capture_input=False, capture_output=False) @extract_fields(dict(mdl=dict[str, Any])) def validate_mdl(mdl_str: str, validator: MDLValidator) -> dict[str, Any]: res = validator.run(mdl=mdl_str) return dict(mdl=res["mdl"]) @observe(capture_input=False) def chunk( mdl: dict[str, Any], project_id: Optional[str] = None, ) -> dict[str, Any]: addition = {"project_id": project_id} if project_id else {} data_source = mdl.get("dataSource", "local_file").lower() if data_source == "duckdb": # fix duckdb to local_file due to wren-ibis implementation at the moment data_source = "local_file" document = Document( id=str(uuid.uuid4()), meta={"data_source": data_source, **addition}, ) return {"documents": [document]} @observe(capture_input=False, capture_output=False) async def clean( chunk: dict[str, Any], cleaner: DocumentCleaner, project_id: Optional[str] = None, ) -> dict[str, Any]: await cleaner.run(project_id=project_id) return chunk @observe(capture_input=False) async def write(clean: dict[str, Any], writer: DocumentWriter) -> None: return await writer.run(documents=clean["documents"]) ## End of Pipeline class ProjectMeta(BasicPipeline): def __init__( self, document_store_provider: DocumentStoreProvider, **kwargs, ) -> None: store = document_store_provider.get_store(dataset_name="project_meta") self._components = { "validator": MDLValidator(), "cleaner": DocumentCleaner([store]), "writer": AsyncDocumentWriter( document_store=store, policy=DuplicatePolicy.OVERWRITE, ), } self._final = "write" super().__init__( AsyncDriver({}, sys.modules[__name__], result_builder=base.DictResult()) ) @observe(name="Project Meta Indexing") async def run( self, mdl_str: str, project_id: Optional[str] = None ) -> dict[str, Any]: logger.info( f"Project ID: {project_id}, Project Meta Indexing pipeline is running..." ) return await self._pipe.execute( [self._final], inputs={ "mdl_str": mdl_str, "project_id": project_id, **self._components, }, ) @observe(name="Clean Documents for Project Meta") async def clean(self, project_id: Optional[str] = None) -> None: await self._components["cleaner"].run(project_id=project_id) ================================================ FILE: wren-ai-service/src/pipelines/indexing/sql_pairs.py ================================================ import logging import os import sys import uuid from typing import Any, Dict, List, Optional, Set import orjson from hamilton import base from hamilton.async_driver import AsyncDriver from haystack import Document, component from haystack.document_stores.types import DocumentStore, DuplicatePolicy from langfuse.decorators import observe from pydantic import BaseModel from src.core.pipeline import BasicPipeline from src.core.provider import DocumentStoreProvider, EmbedderProvider from src.pipelines.indexing import AsyncDocumentWriter logger = logging.getLogger("wren-ai-service") class SqlPair(BaseModel): id: str sql: str = "" question: str = "" @component class SqlPairsConverter: @component.output_types(documents=List[Document]) def run(self, sql_pairs: List[SqlPair], project_id: str = ""): logger.info(f"Project ID: {project_id} Converting SQL pairs to documents...") addition = {"project_id": project_id} if project_id else {} return { "documents": [ Document( id=str(uuid.uuid4()), meta={ "sql_pair_id": sql_pair.id, "sql": sql_pair.sql, **addition, }, content=sql_pair.question, ) for sql_pair in sql_pairs ] } @component class SqlPairsCleaner: def __init__(self, sql_pairs_store: DocumentStore) -> None: self.store = sql_pairs_store @component.output_types() async def run( self, sql_pair_ids: List[str], project_id: Optional[str] = None ) -> None: filter = { "operator": "AND", "conditions": [ {"field": "sql_pair_id", "operator": "in", "value": sql_pair_ids}, ], } if project_id: filter["conditions"].append( {"field": "project_id", "operator": "==", "value": project_id} ) return await self.store.delete_documents(filter) ## Start of Pipeline @observe(capture_input=False) def boilerplates( mdl_str: str, ) -> Set[str]: mdl = orjson.loads(mdl_str) return { boilerplate.lower() for model in mdl.get("models", []) if (boilerplate := model.get("properties", {}).get("boilerplate")) } @observe(capture_input=False) def sql_pairs( boilerplates: Set[str], external_pairs: Dict[str, Any], ) -> List[SqlPair]: return [ SqlPair( id=pair.get("id"), question=pair.get("question"), sql=pair.get("sql"), ) for boilerplate in boilerplates if boilerplate in external_pairs for pair in external_pairs[boilerplate] ] @observe(capture_input=False) def to_documents( sql_pairs: List[SqlPair], document_converter: SqlPairsConverter, project_id: str = "", ) -> Dict[str, Any]: return document_converter.run(sql_pairs=sql_pairs, project_id=project_id) @observe(capture_input=False, capture_output=False) async def embedding( to_documents: Dict[str, Any], embedder: Any, ) -> Dict[str, Any]: return await embedder.run(documents=to_documents["documents"]) @observe(capture_input=False, capture_output=False) async def clean( cleaner: SqlPairsCleaner, sql_pairs: List[SqlPair], embedding: Dict[str, Any] = {}, project_id: str = "", delete_all: bool = False, ) -> Dict[str, Any]: sql_pair_ids = [sql_pair.id for sql_pair in sql_pairs] if sql_pair_ids or delete_all: await cleaner.run(sql_pair_ids=sql_pair_ids, project_id=project_id) return embedding @observe(capture_input=False) async def write( clean: Dict[str, Any], writer: AsyncDocumentWriter, ) -> None: return await writer.run(documents=clean["documents"]) ## End of Pipeline def _load_sql_pairs(sql_pairs_path: str) -> Dict[str, Any]: if not sql_pairs_path: return {} if not os.path.exists(sql_pairs_path): logger.warning(f"SQL pairs file not found: {sql_pairs_path}") return {} try: with open(sql_pairs_path, "r") as file: return orjson.loads(file.read()) except Exception as e: logger.error(f"Error loading SQL pairs file: {e}") return {} class SqlPairs(BasicPipeline): def __init__( self, embedder_provider: EmbedderProvider, document_store_provider: DocumentStoreProvider, sql_pairs_path: str = "sql_pairs.json", **kwargs, ) -> None: store = document_store_provider.get_store(dataset_name="sql_pairs") self._components = { "cleaner": SqlPairsCleaner(store), "embedder": embedder_provider.get_document_embedder(), "document_converter": SqlPairsConverter(), "writer": AsyncDocumentWriter( document_store=store, policy=DuplicatePolicy.OVERWRITE, ), } self._external_pairs = _load_sql_pairs(sql_pairs_path) super().__init__( AsyncDriver({}, sys.modules[__name__], result_builder=base.DictResult()) ) @observe(name="SQL Pairs Indexing") async def run( self, mdl_str: str, project_id: str = "", external_pairs: Optional[Dict[str, Any]] = None, ) -> Dict[str, Any]: logger.info( f"Project ID: {project_id} SQL Pairs Indexing pipeline is running..." ) input = { "mdl_str": mdl_str, "project_id": project_id, "external_pairs": { **self._external_pairs, **(external_pairs or {}), }, **self._components, } return await self._pipe.execute(["write"], inputs=input) @observe(name="Clean Documents for SQL Pairs") async def clean( self, sql_pairs: List[SqlPair] = [], project_id: Optional[str] = None, delete_all: bool = False, ) -> None: await clean( sql_pairs=sql_pairs, cleaner=self._components["cleaner"], project_id=project_id, delete_all=delete_all, ) ================================================ FILE: wren-ai-service/src/pipelines/indexing/table_description.py ================================================ import logging import sys import uuid from typing import Any, Dict, List, Optional from hamilton import base from hamilton.async_driver import AsyncDriver from hamilton.function_modifiers import extract_fields from haystack import Document, component from haystack.components.writers import DocumentWriter from haystack.document_stores.types import DuplicatePolicy from langfuse.decorators import observe from tqdm import tqdm from src.core.pipeline import BasicPipeline from src.core.provider import DocumentStoreProvider, EmbedderProvider from src.pipelines.indexing import AsyncDocumentWriter, DocumentCleaner, MDLValidator logger = logging.getLogger("wren-ai-service") @component class TableDescriptionChunker: @component.output_types(documents=List[Document]) def run(self, mdl: Dict[str, Any], project_id: Optional[str] = None): def _additional_meta() -> Dict[str, Any]: return {"project_id": project_id} if project_id else {} chunks = [ { "id": str(uuid.uuid4()), "meta": { "type": "TABLE_DESCRIPTION", "name": chunk["name"], **_additional_meta(), }, "content": str(chunk), } for chunk in self._get_table_descriptions(mdl) ] return { "documents": [ Document(**chunk) for chunk in tqdm( chunks, desc=f"Project ID: {project_id}, Chunking table descriptions into documents", ) ] } def _get_table_descriptions(self, mdl: Dict[str, Any]) -> List[str]: def _structure_data(mdl_type: str, payload: Dict[str, Any]) -> Dict[str, Any]: return { "mdl_type": mdl_type, "name": payload.get("name"), "columns": [column["name"] for column in payload.get("columns", [])], "properties": payload.get("properties", {}), } resources = ( [_structure_data("MODEL", model) for model in mdl["models"]] + [_structure_data("METRIC", metric) for metric in mdl["metrics"]] + [_structure_data("VIEW", view) for view in mdl["views"]] ) return [ { "name": resource["name"], "description": resource["properties"].get("description", ""), "columns": ", ".join(resource["columns"]), } for resource in resources if resource["name"] is not None ] ## Start of Pipeline @observe(capture_input=False, capture_output=False) @extract_fields(dict(mdl=Dict[str, Any])) def validate_mdl(mdl_str: str, validator: MDLValidator) -> Dict[str, Any]: res = validator.run(mdl=mdl_str) return dict(mdl=res["mdl"]) @observe(capture_input=False) def chunk( mdl: Dict[str, Any], chunker: TableDescriptionChunker, project_id: Optional[str] = None, ) -> Dict[str, Any]: return chunker.run(mdl=mdl, project_id=project_id) @observe(capture_input=False, capture_output=False) async def embedding(chunk: Dict[str, Any], embedder: Any) -> Dict[str, Any]: return await embedder.run(documents=chunk["documents"]) @observe(capture_input=False, capture_output=False) async def clean( embedding: Dict[str, Any], cleaner: DocumentCleaner, project_id: Optional[str] = None, ) -> Dict[str, Any]: await cleaner.run(project_id=project_id) return embedding @observe(capture_input=False) async def write(clean: Dict[str, Any], writer: DocumentWriter) -> None: return await writer.run(documents=clean["documents"]) ## End of Pipeline class TableDescription(BasicPipeline): def __init__( self, embedder_provider: EmbedderProvider, document_store_provider: DocumentStoreProvider, **kwargs, ) -> None: table_description_store = document_store_provider.get_store( dataset_name="table_descriptions" ) self._components = { "cleaner": DocumentCleaner([table_description_store]), "validator": MDLValidator(), "embedder": embedder_provider.get_document_embedder(), "chunker": TableDescriptionChunker(), "writer": AsyncDocumentWriter( document_store=table_description_store, policy=DuplicatePolicy.OVERWRITE, ), } self._configs = {} self._final = "write" super().__init__( AsyncDriver({}, sys.modules[__name__], result_builder=base.DictResult()) ) @observe(name="Table Description Indexing") async def run( self, mdl_str: str, project_id: Optional[str] = None ) -> Dict[str, Any]: logger.info( f"Project ID: {project_id}, Table Description Indexing pipeline is running..." ) return await self._pipe.execute( [self._final], inputs={ "mdl_str": mdl_str, "project_id": project_id, **self._components, **self._configs, }, ) @observe(name="Clean Documents for Table Description") async def clean(self, project_id: Optional[str] = None) -> None: await clean( embedding={"documents": []}, cleaner=self._components["cleaner"], project_id=project_id, ) ================================================ FILE: wren-ai-service/src/pipelines/indexing/utils/helper.py ================================================ import importlib import logging import pkgutil import re import sys from typing import Any, Callable, Dict import orjson from src.pipelines.indexing import clean_display_name logger = logging.getLogger("wren-ai-service") class Helper: def __init__( self, condition: Callable[[Dict[str, Any]], bool], helper: Callable[[Dict[str, Any]], Any], ): self.condiction = condition self.helper = helper def condition(self, column: Dict[str, Any], **kwargs) -> bool: return self.condiction(column, **kwargs) def __call__(self, column: Dict[str, Any], **kwargs) -> Any: return self.helper(column, **kwargs) def _properties_comment(column: Dict[str, Any], **_) -> str: props = column["properties"] column_properties = { "alias": clean_display_name(props.get("displayName", "")), "description": props.get("description", ""), } # Add any nested columns if they exist nested = {k: v for k, v in props.items() if k.startswith("nested")} if nested: column_properties["nested_columns"] = nested if (json_type := props.get("json_type", "")) and json_type in [ "JSON", "JSON_ARRAY", ]: json_fields = { k: v for k, v in column["properties"].items() if re.match(r".*json.*", k) } if json_fields: column_properties["json_type"] = json_type column_properties["json_fields"] = json_fields return f"-- {orjson.dumps(column_properties).decode('utf-8')}\n " COLUMN_PREPROCESSORS = { "properties": Helper( condition=lambda column, **_: "properties" in column, helper=lambda column, **_: column.get("properties"), ), "relationship": Helper( condition=lambda column, **_: "relationship" in column, helper=lambda column, **_: column.get("relationship"), ), "expression": Helper( condition=lambda column, **_: "expression" in column, helper=lambda column, **_: column.get("expression"), ), "isCalculated": Helper( condition=lambda column, **_: column.get("isCalculated", False), helper=lambda column, **_: column.get("isCalculated"), ), } COLUMN_COMMENT_HELPERS = { "properties": Helper( condition=lambda column, **_: "properties" in column, helper=_properties_comment, ), "isCalculated": Helper( condition=lambda column, **_: column.get("isCalculated", False), helper=lambda column, **_: f"-- This column is a Calculated Field\n -- column expression: {column['expression']}\n ", ), } MODEL_PREPROCESSORS = {} def load_helpers(package_path: str = "src.pipelines.indexing.utils"): """ Dynamically loads preprocessors and comment helpers from modules within a specified package path. This function walks through all modules in the given package path and looks for modules that define MODEL_PREPROCESSORS, COLUMN_PREPROCESSORS and COLUMN_COMMENT_HELPERS dictionaries. When found, these helpers are added to the corresponding global dictionaries. The helpers are used to preprocess and format comments for database schema elements like models and columns during the DB Schema indexing pipeline. Args: package_path (str): The Python package path to search for helper modules. Defaults to "src.pipelines.indexing.utils". Returns: None: The function updates the global MODEL_PREPROCESSORS, COLUMN_PREPROCESSORS and COLUMN_COMMENT_HELPERS dictionaries in place. Example: If a module in the package path contains: MODEL_PREPROCESSORS = { "example": Helper( condition=lambda model: True, helper=lambda model, **_: model.get("example", ""), ) } COLUMN_PREPROCESSORS = { "example": Helper( condition=lambda column: True, helper=lambda column, **_: column.get("example", ""), ) } COLUMN_COMMENT_HELPERS = { "example": Helper( condition=lambda column: True, helper=lambda column, **_: f"-- {column.get('example')}\n ", ) } These will be added to their respective global dictionaries. """ package = importlib.import_module(package_path) for _, name, _ in pkgutil.walk_packages(package.__path__, package.__name__ + "."): if name in sys.modules: continue module = importlib.import_module(name) logger.info(f"Imported Helper from {name}") if hasattr(module, "MODEL_PREPROCESSORS"): MODEL_PREPROCESSORS.update(module.MODEL_PREPROCESSORS) logger.info(f"Updated Helper for model preprocessors: {name}") if hasattr(module, "COLUMN_PREPROCESSORS"): COLUMN_PREPROCESSORS.update(module.COLUMN_PREPROCESSORS) logger.info(f"Updated Helper for column preprocessors: {name}") if hasattr(module, "COLUMN_COMMENT_HELPERS"): COLUMN_COMMENT_HELPERS.update(module.COLUMN_COMMENT_HELPERS) logger.info(f"Updated Helper for column comment helpers: {name}") ================================================ FILE: wren-ai-service/src/pipelines/retrieval/__init__.py ================================================ from .db_schema_retrieval import DbSchemaRetrieval from .historical_question_retrieval import HistoricalQuestionRetrieval from .instructions import Instructions from .preprocess_sql_data import PreprocessSqlData from .sql_executor import SQLExecutor from .sql_functions import SqlFunctions from .sql_knowledge import SqlKnowledges from .sql_pairs_retrieval import SqlPairsRetrieval __all__ = [ "HistoricalQuestionRetrieval", "PreprocessSqlData", "DbSchemaRetrieval", "SQLExecutor", "SqlPairsRetrieval", "Instructions", "SqlFunctions", "SqlKnowledges", ] ================================================ FILE: wren-ai-service/src/pipelines/retrieval/db_schema_retrieval.py ================================================ import ast import logging import sys from typing import Any, Optional import orjson import tiktoken from hamilton import base from hamilton.async_driver import AsyncDriver from haystack import Document from haystack.components.builders.prompt_builder import PromptBuilder from langfuse.decorators import observe from pydantic import BaseModel from src.core.pipeline import BasicPipeline from src.core.provider import DocumentStoreProvider, EmbedderProvider, LLMProvider from src.pipelines.common import ( build_table_ddl, clean_up_new_lines, get_engine_supported_data_type, ) from src.utils import trace_cost from src.web.v1.services.ask import AskHistory logger = logging.getLogger("wren-ai-service") table_columns_selection_system_prompt = """ ### TASK ### You are a highly skilled data analyst. Your goal is to examine the provided database schema, interpret the posed question, and identify the specific columns from the relevant tables required to construct an accurate SQL query. The database schema includes tables, columns, primary keys, foreign keys, relationships, and any relevant constraints. ### INSTRUCTIONS ### 1. Carefully analyze the schema and identify the essential tables and columns needed to answer the question. 2. For each table, provide a clear and concise reasoning for why specific columns are selected. 3. List each reason as part of a step-by-step chain of thought, justifying the inclusion of each column. 4. If a "." is included in columns, put the name before the first dot into chosen columns. 5. The number of columns chosen must match the number of reasoning. 6. Final chosen columns must be only column names, don't prefix it with table names. 7. If the chosen column is a child column of a STRUCT type column, choose the parent column instead of the child column. ### FINAL ANSWER FORMAT ### Please provide your response as a JSON object, structured as follows: { "results": [ { "table_selection_reason": "Reason for selecting tablename1", "table_contents": { "chain_of_thought_reasoning": [ "Reason 1 for selecting column1", "Reason 2 for selecting column2", ... ], "columns": ["column1", "column2", ...] }, "table_name":"tablename1", }, { "table_selection_reason": "Reason for selecting tablename2", "table_contents": { "chain_of_thought_reasoning": [ "Reason 1 for selecting column1", "Reason 2 for selecting column2", ... ], "columns": ["column1", "column2", ...] }, "table_name":"tablename2" }, ... ] } ### ADDITIONAL NOTES ### - Each table key must list only the columns relevant to answering the question. - Provide a reasoning list (`chain_of_thought_reasoning`) for each table, explaining why each column is necessary. - Provide the reason of selecting the table in (`table_selection_reason`) for each table. - Be logical, concise, and ensure the output strictly follows the required JSON format. - Use table name used in the "Create Table" statement, don't use "alias". - Match Column names with the definition in the "Create Table" statement. - Match Table names with the definition in the "Create Table" statement. Good luck! """ table_columns_selection_user_prompt_template = """ ### Database Schema ### {% for db_schema in db_schemas %} {{ db_schema }} {% endfor %} ### INPUT ### {{ question }} """ def _build_metric_ddl(content: dict) -> str: columns_ddl = [ f"{column['comment']}{column['name']} {get_engine_supported_data_type(column['data_type'])}" for column in content["columns"] if column["data_type"].lower() != "unknown" # quick fix: filtering out UNKNOWN column type ] return ( f"{content['comment']}CREATE TABLE {content['name']} (\n " + ",\n ".join(columns_ddl) + "\n);" ) def _build_view_ddl(content: dict) -> str: return ( f"{content['comment']}CREATE VIEW {content['name']}\nAS {content['statement']}" ) ## Start of Pipeline @observe(capture_input=False, capture_output=False) async def embedding(query: str, embedder: Any, histories: list[AskHistory]) -> dict: if query: if histories: previous_query_summaries = [history.question for history in histories] else: previous_query_summaries = [] query = "\n".join(previous_query_summaries) + "\n" + query return await embedder.run(query) else: return {} @observe(capture_input=False) async def table_retrieval( embedding: dict, project_id: str, tables: list[str], table_retriever: Any ) -> dict: filters = { "operator": "AND", "conditions": [ {"field": "type", "operator": "==", "value": "TABLE_DESCRIPTION"}, ], } if project_id: filters["conditions"].append( {"field": "project_id", "operator": "==", "value": project_id} ) if embedding: return await table_retriever.run( query_embedding=embedding.get("embedding"), filters=filters, ) else: filters["conditions"].append( {"field": "name", "operator": "in", "value": tables} ) return await table_retriever.run( query_embedding=[], filters=filters, ) @observe(capture_input=False) async def dbschema_retrieval( table_retrieval: dict, project_id: str, dbschema_retriever: Any ) -> list[Document]: tables = table_retrieval.get("documents", []) table_names = [] for table in tables: content = ast.literal_eval(table.content) table_names.append(content["name"]) table_name_conditions = [ {"field": "name", "operator": "==", "value": table_name} for table_name in table_names ] if table_name_conditions: filters = { "operator": "AND", "conditions": [ {"field": "type", "operator": "==", "value": "TABLE_SCHEMA"}, {"operator": "OR", "conditions": table_name_conditions}, ], } if project_id: filters["conditions"].append( {"field": "project_id", "operator": "==", "value": project_id} ) results = await dbschema_retriever.run(query_embedding=[], filters=filters) return results["documents"] return [] @observe() def construct_db_schemas(dbschema_retrieval: list[Document]) -> list[dict]: db_schemas = {} for document in dbschema_retrieval: content = ast.literal_eval(document.content) if content["type"] == "TABLE": if document.meta["name"] not in db_schemas: db_schemas[document.meta["name"]] = content else: db_schemas[document.meta["name"]] = { **content, "columns": db_schemas[document.meta["name"]].get("columns", []), } elif content["type"] == "TABLE_COLUMNS": if document.meta["name"] not in db_schemas: db_schemas[document.meta["name"]] = {"columns": content["columns"]} else: if "columns" not in db_schemas[document.meta["name"]]: db_schemas[document.meta["name"]]["columns"] = content["columns"] else: db_schemas[document.meta["name"]]["columns"] += content["columns"] # remove incomplete schemas db_schemas = {k: v for k, v in db_schemas.items() if "type" in v and "columns" in v} return list(db_schemas.values()) @observe(capture_input=False) def check_using_db_schemas_without_pruning( construct_db_schemas: list[dict], dbschema_retrieval: list[Document], encoding: tiktoken.Encoding, enable_column_pruning: bool, context_window_size: int, ) -> dict: retrieval_results = [] has_calculated_field = False has_metric = False has_json_field = False for table_schema in construct_db_schemas: if table_schema["type"] == "TABLE": ddl, _has_calculated_field, _has_json_field = build_table_ddl(table_schema) retrieval_results.append( { "table_name": table_schema["name"], "table_ddl": ddl, } ) if _has_calculated_field: has_calculated_field = True if _has_json_field: has_json_field = True for document in dbschema_retrieval: content = ast.literal_eval(document.content) if content["type"] == "METRIC": retrieval_results.append( { "table_name": content["name"], "table_ddl": _build_metric_ddl(content), } ) has_metric = True elif content["type"] == "VIEW": retrieval_results.append( { "table_name": content["name"], "table_ddl": _build_view_ddl(content), } ) table_ddls = [ retrieval_result["table_ddl"] for retrieval_result in retrieval_results ] _token_count = len(encoding.encode(" ".join(table_ddls))) if _token_count > context_window_size or enable_column_pruning: return { "db_schemas": [], "tokens": _token_count, "has_calculated_field": has_calculated_field, "has_metric": has_metric, "has_json_field": has_json_field, } return { "db_schemas": retrieval_results, "tokens": _token_count, "has_calculated_field": has_calculated_field, "has_metric": has_metric, "has_json_field": has_json_field, } @observe(capture_input=False) def prompt( query: str, construct_db_schemas: list[dict], prompt_builder: PromptBuilder, check_using_db_schemas_without_pruning: dict, histories: list[AskHistory], ) -> dict: if not check_using_db_schemas_without_pruning["db_schemas"]: db_schemas = [ build_table_ddl(construct_db_schema)[0] for construct_db_schema in construct_db_schemas ] previous_query_summaries = ( [history.question for history in histories] if histories else [] ) query = "\n".join(previous_query_summaries) + "\n" + query _prompt = prompt_builder.run(question=query, db_schemas=db_schemas) return {"prompt": clean_up_new_lines(_prompt.get("prompt"))} else: return {} @observe(as_type="generation", capture_input=False) @trace_cost async def filter_columns_in_tables( prompt: dict, table_columns_selection_generator: Any, generator_name: str ) -> dict: if prompt: return await table_columns_selection_generator( prompt=prompt.get("prompt") ), generator_name else: return {}, generator_name @observe() def construct_retrieval_results( check_using_db_schemas_without_pruning: dict, filter_columns_in_tables: dict, construct_db_schemas: list[dict], dbschema_retrieval: list[Document], ) -> dict[str, Any]: if filter_columns_in_tables: columns_and_tables_needed = orjson.loads( filter_columns_in_tables["replies"][0] )["results"] # we need to change the below code to match the new schema of structured output # the objective of this loop is to change the structure of JSON to match the needed format reformated_json = {} for table in columns_and_tables_needed: reformated_json[table["table_name"]] = table["table_contents"] columns_and_tables_needed = reformated_json tables = set(columns_and_tables_needed.keys()) retrieval_results = [] has_calculated_field = False has_metric = False has_json_field = False for table_schema in construct_db_schemas: if table_schema["type"] == "TABLE" and table_schema["name"] in tables: ddl, _has_calculated_field, _has_json_field = build_table_ddl( table_schema, columns=set( columns_and_tables_needed[table_schema["name"]]["columns"] ), tables=tables, ) if _has_calculated_field: has_calculated_field = True if _has_json_field: has_json_field = True retrieval_results.append( { "table_name": table_schema["name"], "table_ddl": ddl, } ) for document in dbschema_retrieval: if document.meta["name"] in columns_and_tables_needed: content = ast.literal_eval(document.content) if content["type"] == "METRIC": retrieval_results.append( { "table_name": content["name"], "table_ddl": _build_metric_ddl(content), } ) has_metric = True elif content["type"] == "VIEW": retrieval_results.append( { "table_name": content["name"], "table_ddl": _build_view_ddl(content), } ) return { "retrieval_results": retrieval_results, "has_calculated_field": has_calculated_field, "has_metric": has_metric, "has_json_field": has_json_field, } else: retrieval_results = check_using_db_schemas_without_pruning["db_schemas"] return { "retrieval_results": retrieval_results, "has_calculated_field": check_using_db_schemas_without_pruning[ "has_calculated_field" ], "has_metric": check_using_db_schemas_without_pruning["has_metric"], "has_json_field": check_using_db_schemas_without_pruning["has_json_field"], } ## End of Pipeline class MatchingTableContents(BaseModel): chain_of_thought_reasoning: list[str] columns: list[str] class MatchingTable(BaseModel): table_name: str table_contents: MatchingTableContents table_selection_reason: str class RetrievalResults(BaseModel): results: list[MatchingTable] RETRIEVAL_MODEL_KWARGS = { "response_format": { "type": "json_schema", "json_schema": { "name": "retrieval_schema", "schema": RetrievalResults.model_json_schema(), }, } } class DbSchemaRetrieval(BasicPipeline): def __init__( self, llm_provider: LLMProvider, embedder_provider: EmbedderProvider, document_store_provider: DocumentStoreProvider, table_retrieval_size: int = 10, table_column_retrieval_size: int = 100, **kwargs, ): self._components = { "embedder": embedder_provider.get_text_embedder(), "table_retriever": document_store_provider.get_retriever( document_store_provider.get_store(dataset_name="table_descriptions"), top_k=table_retrieval_size, ), "dbschema_retriever": document_store_provider.get_retriever( document_store_provider.get_store(), top_k=table_column_retrieval_size, ), "table_columns_selection_generator": llm_provider.get_generator( system_prompt=table_columns_selection_system_prompt, generation_kwargs=RETRIEVAL_MODEL_KWARGS, ), "generator_name": llm_provider.get_model(), "prompt_builder": PromptBuilder( template=table_columns_selection_user_prompt_template ), } # for the first time, we need to load the encodings _model = llm_provider.get_model() if "gpt-4o" in _model or "gpt-4o-mini" in _model: _encoding = tiktoken.get_encoding("o200k_base") else: _encoding = tiktoken.get_encoding("cl100k_base") self._configs = { "encoding": _encoding, "context_window_size": llm_provider.get_context_window_size(), } super().__init__( AsyncDriver({}, sys.modules[__name__], result_builder=base.DictResult()) ) @observe(name="Ask Retrieval") async def run( self, query: str = "", tables: Optional[list[str]] = None, project_id: Optional[str] = None, histories: Optional[list[AskHistory]] = None, enable_column_pruning: bool = False, ): logger.info("Ask Retrieval pipeline is running...") return await self._pipe.execute( ["construct_retrieval_results"], inputs={ "query": query, "tables": tables, "project_id": project_id or "", "histories": histories or [], "enable_column_pruning": enable_column_pruning, **self._components, **self._configs, }, ) ================================================ FILE: wren-ai-service/src/pipelines/retrieval/historical_question_retrieval.py ================================================ import logging import sys from typing import Any, Dict, List, Optional from hamilton import base from hamilton.async_driver import AsyncDriver from haystack import Document, component from haystack_integrations.document_stores.qdrant import QdrantDocumentStore from langfuse.decorators import observe from src.core.pipeline import BasicPipeline from src.core.provider import DocumentStoreProvider, EmbedderProvider from src.pipelines.common import ScoreFilter logger = logging.getLogger("wren-ai-service") @component class OutputFormatter: @component.output_types( documents=List[Optional[Dict]], ) def run(self, documents: List[Document]): list = [ { "question": doc.content, "summary": doc.meta.get("summary", ""), "statement": doc.meta.get("statement") or doc.meta.get("sql"), "viewId": doc.meta.get("viewId", ""), } for doc in documents ] return {"documents": list} ## Start of Pipeline @observe(capture_input=False) async def count_documents( view_questions_store: QdrantDocumentStore, project_id: Optional[str] = None, ) -> int: filters = ( { "operator": "AND", "conditions": [ {"field": "project_id", "operator": "==", "value": project_id}, ], } if project_id else None ) return await view_questions_store.count_documents(filters=filters) @observe(capture_input=False, capture_output=False) async def embedding(count_documents: int, query: str, embedder: Any) -> dict: if count_documents: return await embedder.run(query) return {} @observe(capture_input=False) async def retrieval( embedding: dict, project_id: str, view_questions_retriever: Any, ) -> dict: if embedding: filters = ( { "operator": "AND", "conditions": [ {"field": "project_id", "operator": "==", "value": project_id}, ], } if project_id else None ) view_question_res = await view_questions_retriever.run( query_embedding=embedding.get("embedding"), filters=filters, ) return dict(documents=view_question_res.get("documents")) return {} @observe(capture_input=False) def filtered_documents( retrieval: dict, score_filter: ScoreFilter, historical_question_retrieval_similarity_threshold: float, ) -> dict: if retrieval: return score_filter.run( documents=retrieval.get("documents"), score=historical_question_retrieval_similarity_threshold, ) return {} @observe(capture_input=False) def formatted_output( filtered_documents: dict, output_formatter: OutputFormatter ) -> dict: if filtered_documents: return output_formatter.run(documents=filtered_documents.get("documents")) return {"documents": []} ## End of Pipeline class HistoricalQuestionRetrieval(BasicPipeline): def __init__( self, embedder_provider: EmbedderProvider, document_store_provider: DocumentStoreProvider, historical_question_retrieval_similarity_threshold: float = 0.9, **kwargs, ) -> None: view_questions_store = document_store_provider.get_store( dataset_name="view_questions" ) self._components = { "view_questions_store": view_questions_store, "embedder": embedder_provider.get_text_embedder(), "view_questions_retriever": document_store_provider.get_retriever( document_store=view_questions_store, ), "score_filter": ScoreFilter(), # TODO: add a llm filter to filter out low scoring document, in case ScoreFilter is not accurate enough "output_formatter": OutputFormatter(), } self._configs = { "historical_question_retrieval_similarity_threshold": historical_question_retrieval_similarity_threshold, } super().__init__( AsyncDriver({}, sys.modules[__name__], result_builder=base.DictResult()) ) @observe(name="Historical Question") async def run(self, query: str, project_id: Optional[str] = None): logger.info("HistoricalQuestion Retrieval pipeline is running...") return await self._pipe.execute( ["formatted_output"], inputs={ "query": query, "project_id": project_id or "", **self._components, **self._configs, }, ) ================================================ FILE: wren-ai-service/src/pipelines/retrieval/instructions.py ================================================ import logging import sys from typing import Any, Dict, List, Optional from hamilton import base from hamilton.async_driver import AsyncDriver from haystack import Document, component from haystack_integrations.document_stores.qdrant import QdrantDocumentStore from langfuse.decorators import observe from src.core.pipeline import BasicPipeline from src.core.provider import DocumentStoreProvider, EmbedderProvider from src.pipelines.common import ScoreFilter logger = logging.getLogger("wren-ai-service") @component class OutputFormatter: @component.output_types( documents=List[Optional[Dict]], ) def run(self, documents: List[Document]): list = [] for doc in documents: formatted = { "instruction": doc.meta.get("instruction", ""), "question": doc.content, "instruction_id": doc.meta.get("instruction_id", ""), } list.append(formatted) return {"documents": list} @component class ScopeFilter: @component.output_types( documents=List[Document], ) def run( self, documents: List[Document], scope: str = "sql", ): return { "documents": list( filter( lambda document: document.meta.get("scope", "sql") == scope, documents, ), ) } ## Start of Pipeline @observe(capture_input=False) async def count_documents( store: QdrantDocumentStore, project_id: Optional[str] = None ) -> int: filters = ( { "operator": "AND", "conditions": [ {"field": "project_id", "operator": "==", "value": project_id}, ], } if project_id else None ) document_count = await store.count_documents(filters=filters) return document_count @observe(capture_input=False, capture_output=False) async def embedding(count_documents: int, query: str, embedder: Any) -> dict: if count_documents: return await embedder.run(query) return {} @observe(capture_input=False) async def retrieval(embedding: dict, project_id: str, retriever: Any) -> dict: if not embedding: return {} filters = { "operator": "AND", "conditions": [ {"field": "is_default", "operator": "==", "value": False}, ], } if project_id: filters["conditions"].append( {"field": "project_id", "operator": "==", "value": project_id} ) res = await retriever.run( query_embedding=embedding.get("embedding"), filters=filters, ) return dict(documents=res.get("documents")) @observe(capture_input=False) def filtered_documents( retrieval: dict, scope: str, scope_filter: ScopeFilter, score_filter: ScoreFilter, similarity_threshold: float, top_k: int, ) -> dict: if not retrieval: return {} res = scope_filter.run( documents=retrieval.get("documents"), scope=scope, ) return score_filter.run( documents=res.get("documents"), score=similarity_threshold, max_size=top_k, ) @observe(capture_input=False) async def default_instructions( count_documents: int, retriever: Any, project_id: str, scope_filter: ScopeFilter, scope: str, ) -> list[Document]: if not count_documents: return [] filters = { "operator": "AND", "conditions": [ {"field": "is_default", "operator": "==", "value": True}, ], } if project_id: filters["conditions"].append( {"field": "project_id", "operator": "==", "value": project_id} ) _res = await retriever.run( query_embedding=None, filters=filters, ) res = scope_filter.run( documents=_res.get("documents"), scope=scope, ) return dict(documents=res.get("documents")) @observe(capture_input=False) def formatted_output( default_instructions: list[Document], filtered_documents: dict, output_formatter: OutputFormatter, ) -> dict: if not filtered_documents and not default_instructions: return {"documents": []} merged = default_instructions.get("documents") + filtered_documents.get("documents") documents = output_formatter.run(documents=merged) return documents ## End of Pipeline class Instructions(BasicPipeline): def __init__( self, embedder_provider: EmbedderProvider, document_store_provider: DocumentStoreProvider, similarity_threshold: float = 0.7, top_k: int = 10, **kwargs, ) -> None: store = document_store_provider.get_store(dataset_name="instructions") self._components = { "store": store, "embedder": embedder_provider.get_text_embedder(), "retriever": document_store_provider.get_retriever( document_store=store, ), "scope_filter": ScopeFilter(), "score_filter": ScoreFilter(), "output_formatter": OutputFormatter(), } self._configs = { "similarity_threshold": similarity_threshold, "top_k": top_k, } super().__init__( AsyncDriver({}, sys.modules[__name__], result_builder=base.DictResult()) ) @observe(name="Instructions Retrieval") async def run( self, query: str, project_id: Optional[str] = None, scope: str = "sql" ): logger.info("Instructions Retrieval pipeline is running...") return await self._pipe.execute( ["formatted_output"], inputs={ "query": query, "project_id": project_id or "", "scope": scope, **self._components, **self._configs, }, ) ================================================ FILE: wren-ai-service/src/pipelines/retrieval/preprocess_sql_data.py ================================================ import logging import sys from typing import Dict import tiktoken from hamilton import base from hamilton.driver import Driver from langfuse.decorators import observe from src.core.pipeline import BasicPipeline from src.core.provider import LLMProvider logger = logging.getLogger("wren-ai-service") ## Start of Pipeline @observe(capture_input=False, capture_output=False) def preprocess( sql_data: Dict, encoding: tiktoken.Encoding, context_window_size: int, ) -> Dict: def reduce_data_size(data: list, reduction_step: int = 50) -> list: """Reduce the size of data by removing elements from the end. Args: data: The input list to reduce reduction_step: Number of elements to remove (must be positive) Returns: list: A list with reduced size Raises: ValueError: If reduction_step is not positive """ if reduction_step <= 0: raise ValueError("reduction_step must be positive") elements_to_keep = max(0, len(data) - reduction_step) returned_data = data[:elements_to_keep] logger.info( f"Reducing data size by {reduction_step} rows. " f"Original size: {len(data)}, New size: {len(returned_data)}" ) return returned_data _token_count = len(encoding.encode(str(sql_data))) num_rows_used_in_llm = len(sql_data.get("data", [])) iteration = 0 while _token_count > context_window_size: if iteration > 1000: """ Avoid infinite loop If the token count is still too high after 1000 iterations, break """ break iteration += 1 data = sql_data.get("data", []) sql_data["data"] = reduce_data_size(data) num_rows_used_in_llm = len(sql_data.get("data", [])) _token_count = len(encoding.encode(str(sql_data))) logger.info(f"Token count: {_token_count}") return { "sql_data": sql_data, "num_rows_used_in_llm": num_rows_used_in_llm, "tokens": _token_count, } ## End of Pipeline class PreprocessSqlData(BasicPipeline): def __init__( self, llm_provider: LLMProvider, **kwargs, ): _model = llm_provider.get_model() if _model == "gpt-4o-mini" or _model == "gpt-4o": _encoding = tiktoken.get_encoding("o200k_base") else: _encoding = tiktoken.get_encoding("cl100k_base") self._configs = { "encoding": _encoding, "context_window_size": llm_provider.get_context_window_size(), } super().__init__(Driver({}, sys.modules[__name__], adapter=base.DictResult())) @observe(name="Preprocess SQL Data") def run( self, sql_data: Dict, ): logger.info("Preprocess SQL Data pipeline is running...") return self._pipe.execute( ["preprocess"], inputs={ "sql_data": sql_data, **self._configs, }, ) ================================================ FILE: wren-ai-service/src/pipelines/retrieval/sql_executor.py ================================================ import logging import sys from typing import Any, Dict, Optional import aiohttp from hamilton import base from hamilton.async_driver import AsyncDriver from haystack import component from langfuse.decorators import observe from src.core.engine import Engine from src.core.pipeline import BasicPipeline logger = logging.getLogger("wren-ai-service") @component class DataFetcher: def __init__(self, engine: Engine): self._engine = engine @component.output_types( results=Optional[Dict[str, Any]], ) async def run( self, sql: str, project_id: str | None = None, limit: int = 500, ): async with aiohttp.ClientSession() as session: _, data, addition = await self._engine.execute_sql( sql, session, project_id=project_id, dry_run=False, limit=limit, ) if addition.get("error_message"): return {"results": data, "error_message": addition.get("error_message")} return {"results": data} ## Start of Pipeline @observe(capture_input=False) async def execute_sql( sql: str, data_fetcher: DataFetcher, project_id: str | None = None, limit: int = 500, ) -> dict: return await data_fetcher.run( sql=sql, project_id=project_id, limit=limit, ) ## End of Pipeline class SQLExecutor(BasicPipeline): def __init__( self, engine: Engine, **kwargs, ): self._components = { "data_fetcher": DataFetcher(engine=engine), } super().__init__( AsyncDriver({}, sys.modules[__name__], result_builder=base.DictResult()) ) @observe(name="SQL Execution") async def run( self, sql: str, project_id: str | None = None, limit: int = 500 ) -> dict: logger.info("SQL Execution pipeline is running...") return await self._pipe.execute( ["execute_sql"], inputs={ "sql": sql, "project_id": project_id, "limit": limit, **self._components, }, ) ================================================ FILE: wren-ai-service/src/pipelines/retrieval/sql_functions.py ================================================ import logging import sys from typing import List, Optional import aiohttp from cachetools import TTLCache from hamilton import base from hamilton.async_driver import AsyncDriver from langfuse.decorators import observe from src.core.engine import Engine from src.core.pipeline import BasicPipeline from src.core.provider import DocumentStoreProvider from src.pipelines.common import retrieve_metadata from src.providers.engine.wren import WrenIbis logger = logging.getLogger("wren-ai-service") class SqlFunction: _expr: str = None def __init__(self, definition: dict): def _extract() -> tuple[str, list, str]: return ( definition.get("name", "").upper(), definition.get("function_type", ""), definition.get("description", ""), ) name, function_type, description = _extract() self._expr = f"type: {function_type}, name: {name}, description: {description}" @classmethod def empty(cls, definition: dict): return ( not definition.get("name", "") or not definition.get("function_type", "") or not definition.get("description", "") ) def __str__(self): return self._expr def __repr__(self): return self._expr ## Start of Pipeline @observe(capture_input=False) async def get_functions( engine: WrenIbis, data_source: str, ) -> List[SqlFunction]: async with aiohttp.ClientSession() as session: func_list = await engine.get_func_list( session=session, data_source=data_source, ) return [ SqlFunction(definition=func) for func in func_list if not SqlFunction.empty(func) ] @observe(capture_input=False) def cache( data_source: str, get_functions: List[SqlFunction], ttl_cache: TTLCache, ) -> List[SqlFunction]: ttl_cache[data_source] = get_functions return get_functions ## End of Pipeline class SqlFunctions(BasicPipeline): def __init__( self, engine: Engine, document_store_provider: DocumentStoreProvider, ttl: int = 60 * 60 * 24, **kwargs, ) -> None: self._retriever = document_store_provider.get_retriever( document_store_provider.get_store("project_meta") ) self._cache = TTLCache(maxsize=100, ttl=ttl) self._components = { "engine": engine, "ttl_cache": self._cache, } super().__init__( AsyncDriver({}, sys.modules[__name__], result_builder=base.DictResult()) ) @observe(name="SQL Functions Retrieval") async def run( self, project_id: Optional[str] = None, ) -> List[SqlFunction]: logger.info( f"Project ID: {project_id} SQL Functions Retrieval pipeline is running..." ) metadata = await retrieve_metadata(project_id or "", self._retriever) _data_source = metadata.get("data_source", "local_file") if _data_source in self._cache: logger.info(f"Hit cache of SQL Functions for {_data_source}") return self._cache[_data_source] input = { "data_source": _data_source, "project_id": project_id, **self._components, } result = await self._pipe.execute(["cache"], inputs=input) return result["cache"] ================================================ FILE: wren-ai-service/src/pipelines/retrieval/sql_knowledge.py ================================================ import logging import sys from typing import Dict, Optional import aiohttp from cachetools import TTLCache from hamilton import base from hamilton.async_driver import AsyncDriver from langfuse.decorators import observe from src.core.engine import Engine from src.core.pipeline import BasicPipeline from src.core.provider import DocumentStoreProvider from src.pipelines.common import retrieve_metadata from src.providers.engine.wren import WrenIbis logger = logging.getLogger("wren-ai-service") class SqlKnowledge: def __init__(self, sql_knowledge: dict): self._data: Dict = sql_knowledge @classmethod def empty(cls, sql_knowledge: dict): return ( not sql_knowledge or not sql_knowledge.get("text_to_sql_rule") or not sql_knowledge.get("instructions") ) @property def text_to_sql_rule(self) -> str: return self._data.get("text_to_sql_rule", "") @property def instructions(self) -> dict: return self._data.get("instructions", {}) @property def calculated_field_instructions(self) -> str: return self.instructions.get("calculated_field_instructions", "") @property def metric_instructions(self) -> str: return self.instructions.get("metric_instructions", "") @property def json_field_instructions(self) -> str: return self.instructions.get("json_field_instructions", "") def __str__(self): return f"text_to_sql_rule: {self.text_to_sql_rule}, instructions: {self.instructions}" def __repr__(self): return self.__str__() ## Start of Pipeline @observe(capture_input=False) async def get_knowledge( engine: WrenIbis, data_source: str, ) -> Optional[SqlKnowledge]: async with aiohttp.ClientSession() as session: knowledge_dict = await engine.get_sql_knowledge( session=session, data_source=data_source, ) if not knowledge_dict or SqlKnowledge.empty(knowledge_dict): return None return SqlKnowledge(sql_knowledge=knowledge_dict) @observe(capture_input=False) def cache( data_source: str, get_knowledge: Optional[SqlKnowledge], ttl_cache: TTLCache, ) -> Optional[SqlKnowledge]: if get_knowledge: ttl_cache[data_source] = get_knowledge return get_knowledge ## End of Pipeline class SqlKnowledges(BasicPipeline): def __init__( self, engine: Engine, document_store_provider: DocumentStoreProvider, ttl: int = 60 * 60 * 24, **kwargs, ) -> None: self._retriever = document_store_provider.get_retriever( document_store_provider.get_store("project_meta") ) self._cache = TTLCache(maxsize=100, ttl=ttl) self._components = { "engine": engine, "ttl_cache": self._cache, } super().__init__( AsyncDriver({}, sys.modules[__name__], result_builder=base.DictResult()) ) @observe(name="SQL Knowledge Retrieval") async def run( self, project_id: Optional[str] = None, ) -> Optional[SqlKnowledge]: logger.info( f"Project ID: {project_id} SQL Knowledge Retrieval pipeline is running..." ) metadata = await retrieve_metadata(project_id or "", self._retriever) _data_source = metadata.get("data_source", "local_file") if _data_source in self._cache: logger.info(f"Hit cache of SQL Knowledge for {_data_source}") return self._cache[_data_source] input = { "data_source": _data_source, "project_id": project_id, **self._components, } result = await self._pipe.execute(["cache"], inputs=input) return result["cache"] ================================================ FILE: wren-ai-service/src/pipelines/retrieval/sql_pairs_retrieval.py ================================================ import logging import sys from typing import Any, Dict, List, Optional from hamilton import base from hamilton.async_driver import AsyncDriver from haystack import Document, component from haystack_integrations.document_stores.qdrant import QdrantDocumentStore from langfuse.decorators import observe from src.core.pipeline import BasicPipeline from src.core.provider import DocumentStoreProvider, EmbedderProvider from src.pipelines.common import ScoreFilter logger = logging.getLogger("wren-ai-service") @component class OutputFormatter: @component.output_types( documents=List[Optional[Dict]], ) def run(self, documents: List[Document]): list = [] for doc in documents: formatted = { "question": doc.content, "sql": doc.meta.get("sql"), } list.append(formatted) return {"documents": list} ## Start of Pipeline @observe(capture_input=False) async def count_documents( store: QdrantDocumentStore, project_id: Optional[str] = None ) -> int: filters = ( { "operator": "AND", "conditions": [ {"field": "project_id", "operator": "==", "value": project_id}, ], } if project_id else None ) document_count = await store.count_documents(filters=filters) return document_count @observe(capture_input=False, capture_output=False) async def embedding(count_documents: int, query: str, embedder: Any) -> dict: if count_documents: return await embedder.run(query) return {} @observe(capture_input=False) async def retrieval(embedding: dict, project_id: str, retriever: Any) -> dict: if embedding: filters = ( { "operator": "AND", "conditions": [ {"field": "project_id", "operator": "==", "value": project_id}, ], } if project_id else None ) res = await retriever.run( query_embedding=embedding.get("embedding"), filters=filters, ) return dict(documents=res.get("documents")) return {} @observe(capture_input=False) def filtered_documents( retrieval: dict, score_filter: ScoreFilter, sql_pairs_similarity_threshold: float, sql_pairs_retrieval_max_size: int, ) -> dict: if retrieval: return score_filter.run( documents=retrieval.get("documents"), score=sql_pairs_similarity_threshold, max_size=sql_pairs_retrieval_max_size, ) return {} @observe(capture_input=False) def formatted_output( filtered_documents: dict, output_formatter: OutputFormatter ) -> dict: if filtered_documents: return output_formatter.run(documents=filtered_documents.get("documents")) return {"documents": []} ## End of Pipeline class SqlPairsRetrieval(BasicPipeline): def __init__( self, embedder_provider: EmbedderProvider, document_store_provider: DocumentStoreProvider, sql_pairs_similarity_threshold: float = 0.7, sql_pairs_retrieval_max_size: int = 10, **kwargs, ) -> None: store = document_store_provider.get_store(dataset_name="sql_pairs") self._components = { "store": store, "embedder": embedder_provider.get_text_embedder(), "retriever": document_store_provider.get_retriever( document_store=store, ), "score_filter": ScoreFilter(), # TODO: add a llm filter to filter out low scoring document, in case ScoreFilter is not accurate enough "output_formatter": OutputFormatter(), } self._configs = { "sql_pairs_similarity_threshold": sql_pairs_similarity_threshold, "sql_pairs_retrieval_max_size": sql_pairs_retrieval_max_size, } super().__init__( AsyncDriver({}, sys.modules[__name__], result_builder=base.DictResult()) ) @observe(name="SqlPairs Retrieval") async def run(self, query: str, project_id: Optional[str] = None): logger.info("SqlPairs Retrieval pipeline is running...") return await self._pipe.execute( ["formatted_output"], inputs={ "query": query, "project_id": project_id or "", **self._components, **self._configs, }, ) ================================================ FILE: wren-ai-service/src/providers/__init__.py ================================================ import logging from dataclasses import dataclass from src.core.engine import Engine from src.core.pipeline import PipelineComponent from src.core.provider import DocumentStoreProvider, EmbedderProvider, LLMProvider from src.providers import loader logger = logging.getLogger("wren-ai-service") def provider_factory( config: dict = {}, ) -> LLMProvider | EmbedderProvider | DocumentStoreProvider | Engine: return loader.get_provider(config.get("provider"))(**config) def llm_processor(entry: dict) -> dict: """ Process the LLM configuration entry. This function takes a dictionary containing LLM configuration and processes it into a standardized format. The input dictionary is expected to have the following structure: { "type": "llm", "provider": "openai_llm", "models": [ { "model": "gpt-4o-mini", "kwargs": { "temperature": 0, "n": 1, "max_tokens": 4096, "response_format": {"type": "json_object"} }, "context_window_size": 100000 } ], "api_base": "https://api.openai.com/v1" } The function processes this input and returns a dictionary with the following structure: { "openai_llm.gpt-4o-mini": { "provider": "openai_llm", "model": "gpt-4o-mini", "kwargs": { "temperature": 0, "n": 1, "max_tokens": 4096, "response_format": {"type": "json_object"} }, "context_window_size": 100000, "api_base": "https://api.openai.com/v1" } } Args: entry (dict): The input LLM configuration dictionary. Returns: dict: A processed dictionary with standardized LLM configuration. Note: The function does not handle the `api_key` field. It is to be handled by the provider itself. """ def build_fallback_params(all_models: dict) -> dict: result = {} for model_name, model in all_models.items(): result[model_name] = { "model_name": model_name, "litellm_params": { "model": model["model"], **({"api_base": model["api_base"]} if "api_base" in model else {}), **( {"api_version": model["api_version"]} if "api_version" in model else {} ), "timeout": model.get("timeout", 120.0), **model.get("kwargs", {}), }, } return result others = {k: v for k, v in entry.items() if k not in ["type", "provider", "models"]} returned = {} all_models = {m["model"]: m for m in entry.get("models", [])} fallback_model_params = build_fallback_params(all_models) for model in entry.get("models", []): model_name = f"{entry.get('provider')}.{model.get('alias', model.get('model'))}" model_additional_params = { k: v for k, v in model.items() if k not in ["model", "kwargs", "alias", "context_window_size"] } fallback_model_names = [model["model"]] + model.get("fallbacks", []) fallback_model_list = [ fallback_model_params[m] for m in fallback_model_names if m in fallback_model_params ] returned[model_name] = { "provider": entry["provider"], "model": model["model"], "kwargs": model["kwargs"], "context_window_size": model.get("context_window_size", 100000), "fallback_model_list": fallback_model_list, **model_additional_params, **others, } return returned def embedder_processor(entry: dict) -> dict: """ Process the embedder configuration entry. This function takes a dictionary containing embedder configuration and processes it into a standardized format. The input dictionary is expected to have the following structure: { "type": "embedder", "provider": "openai_embedder", "models": [ { "model": "text-embedding-ada-002", "dimension": 1536 } ] } The function processes this input and returns a dictionary with the following structure: { "openai_embedder.text-embedding-ada-002": { "provider": "openai_embedder", "model": "text-embedding-ada-002", "dimension": 1536 } } Args: entry (dict): The input embedder configuration dictionary. Returns: dict: A processed dictionary with standardized embedder configuration. Note: The function does not handle the `api_key` field. It is to be handled by the provider itself. """ others = {k: v for k, v in entry.items() if k not in ["type", "provider", "models"]} returned = {} for model in entry["models"]: identifier = f"{entry['provider']}.{model.get('alias', model.get('model'))}" model_additional_params = { k: v for k, v in model.items() if k not in ["model", "kwargs", "alias"] } returned[identifier] = { "provider": entry["provider"], "model": model["model"], **model_additional_params, **others, } return returned def document_store_processor(entry: dict) -> dict: """ Process the document store configuration entry. This function takes a dictionary containing document store configuration and processes it into a standardized format. The input dictionary is expected to have the following structure: { "type": "document_store", "provider": "qdrant", "location": "http://localhost:6333", "embedding_model_dim": 3072, "timeout": 120, "recreate_index": False, } The function processes this input and returns a dictionary with the following structure: { "qdrant": { "provider": "qdrant", "location": "http://localhost:6333", "embedding_model_dim": 3072, "timeout": 120, "recreate_index": False, } } Args: entry (dict): The input document store configuration dictionary. Returns: dict: A processed dictionary with standardized document store configuration. Note: The function does not handle the `api_key` field. It is to be handled by the provider itself. """ return {entry["provider"]: {k: v for k, v in entry.items() if k not in ["type"]}} def engine_processor(entry: dict) -> dict: """ Process the engine configuration entry. This function takes a dictionary containing engine configuration and processes it into a standardized format. The input dictionary is expected to have the following structure: { "type": "engine", "provider": "wren_ui", "kwargs": { "host": "localhost", "port": 8000 } } The function processes this input and returns a dictionary with the following structure: { "wren_ui": { "provider": "wren_ui", "kwargs": { "host": "localhost", "port": 8000 } } } Args: entry (dict): The input engine configuration dictionary. Returns: dict: A processed dictionary with standardized engine configuration. """ return {entry["provider"]: {k: v for k, v in entry.items() if k not in ["type"]}} def pipeline_processor(entry: dict) -> dict: """ Process the pipeline configuration entry. This function takes a dictionary containing pipeline configuration and processes it into a standardized format. The input dictionary is expected to have the following structure: { "type": "pipeline", "pipes": [ { "name": "indexing", "llm": "openai_llm.gpt-4o-mini", "embedder": "openai_embedder.text-embedding-3-large", "document_store": "qdrant", "engine": "wren_ui" } ] } The function processes this input and returns a dictionary with the following structure: { "indexing": { "llm": "openai_llm.gpt-4o-mini", "embedder": "openai_embedder.text-embedding-3-large", "document_store": "qdrant", "engine": "wren_ui", } } Args: entry (dict): The input pipeline configuration dictionary. Returns: dict: A processed dictionary with standardized pipeline configuration. """ return { pipe["name"]: { "llm": pipe.get("llm"), "embedder": pipe.get("embedder"), "document_store": pipe.get("document_store"), "engine": pipe.get("engine"), } for pipe in entry["pipes"] } @dataclass class Configuration: providers: dict pipelines: dict def transform(config: list[dict]) -> Configuration: _TYPE_TO_PROCESSOR = { "llm": llm_processor, "embedder": embedder_processor, "document_store": document_store_processor, "engine": engine_processor, "pipeline": pipeline_processor, } returned = { "embedder": {}, "llm": {}, "document_store": {}, "engine": {}, "pipeline": {}, } for entry in config: type = entry["type"] processor = _TYPE_TO_PROCESSOR.get(type) if not processor: logger.error(f"Unknown type: {type}") raise ValueError(f"Unknown type: {type}") converted = processor(entry) returned[type].update(converted) return Configuration( providers={k: v for k, v in returned.items() if k != "pipeline"}, pipelines=returned["pipeline"], ) def generate_components(configs: list[dict]) -> dict[str, PipelineComponent]: """ Generate pipeline components from configuration. This function takes a list of configuration dictionaries and generates pipeline components based on the provided configurations. The configurations are processed into a standardized format and then instantiated into actual provider objects. Args: configs (list[dict]): A list of configuration dictionaries. Returns: dict: A dictionary of pipeline components. Note: instantiated_providers example: { "embedder": { "openai_embedder.text-embedding-3-large": }, "llm": { "openai_llm.gpt-4o-mini": }, ... } """ loader.import_mods() config = transform(configs) instantiated_providers = { type: { identifier: provider_factory(config) for identifier, config in configs.items() } for type, configs in config.providers.items() } def get(type: str, components: dict, instantiated_providers: dict): identifier = components.get(type) return instantiated_providers[type].get(identifier) def componentize(components: dict, instantiated_providers: dict): return PipelineComponent( embedder_provider=get("embedder", components, instantiated_providers), llm_provider=get("llm", components, instantiated_providers), document_store_provider=get( "document_store", components, instantiated_providers ), engine=get("engine", components, instantiated_providers), ) return { pipe_name: componentize(components, instantiated_providers) for pipe_name, components in config.pipelines.items() } ================================================ FILE: wren-ai-service/src/providers/document_store/__init__.py ================================================ ================================================ FILE: wren-ai-service/src/providers/document_store/qdrant.py ================================================ import logging import os from typing import Any, Dict, List, Optional import numpy as np import qdrant_client from haystack import Document, component from haystack.document_stores.types import DuplicatePolicy from haystack.utils import Secret from haystack_integrations.components.retrievers.qdrant import QdrantEmbeddingRetriever from haystack_integrations.document_stores.qdrant import ( QdrantDocumentStore, document_store, ) from haystack_integrations.document_stores.qdrant.converters import ( DENSE_VECTORS_NAME, SPARSE_VECTORS_NAME, convert_id, convert_qdrant_point_to_haystack_document, ) from haystack_integrations.document_stores.qdrant.filters import ( convert_filters_to_qdrant, ) from qdrant_client.http import models as rest from tqdm import tqdm from src.core.provider import DocumentStoreProvider from src.providers.loader import provider logger = logging.getLogger("wren-ai-service") def convert_haystack_documents_to_qdrant_points( documents: List[Document], *, use_sparse_embeddings: bool, ) -> List[rest.PointStruct]: points = [] for document in documents: payload = document.to_dict(flatten=True) if use_sparse_embeddings: vector = {} dense_vector = payload.pop("embedding", None) if dense_vector is not None: vector[DENSE_VECTORS_NAME] = dense_vector sparse_vector = payload.pop("sparse_embedding", None) if sparse_vector is not None: sparse_vector_instance = rest.SparseVector(**sparse_vector) vector[SPARSE_VECTORS_NAME] = sparse_vector_instance else: vector = payload.pop("embedding") or {} _id = convert_id(payload.get("id")) point = rest.PointStruct( payload=payload, vector=vector, id=_id, ) points.append(point) return points class AsyncQdrantDocumentStore(QdrantDocumentStore): def __init__( self, location: Optional[str] = None, url: Optional[str] = None, port: int = 6333, grpc_port: int = 6334, prefer_grpc: bool = False, https: Optional[bool] = None, api_key: Optional[Secret] = None, prefix: Optional[str] = None, timeout: Optional[int] = None, host: Optional[str] = None, path: Optional[str] = None, force_disable_check_same_thread: bool = False, index: str = "Document", embedding_dim: int = 768, on_disk: bool = False, use_sparse_embeddings: bool = False, sparse_idf: bool = False, similarity: str = "cosine", return_embedding: bool = False, progress_bar: bool = True, recreate_index: bool = False, shard_number: Optional[int] = None, replication_factor: Optional[int] = None, write_consistency_factor: Optional[int] = None, on_disk_payload: Optional[bool] = None, hnsw_config: Optional[dict] = None, optimizers_config: Optional[dict] = None, wal_config: Optional[dict] = None, quantization_config: Optional[dict] = None, init_from: Optional[dict] = None, wait_result_from_api: bool = True, metadata: Optional[dict] = None, write_batch_size: int = 100, scroll_size: int = 10_000, payload_fields_to_index: Optional[List[dict]] = None, ): super(AsyncQdrantDocumentStore, self).__init__( location=location, url=url, port=port, grpc_port=grpc_port, prefer_grpc=prefer_grpc, https=https, api_key=api_key, prefix=prefix, timeout=timeout, host=host, path=path, force_disable_check_same_thread=force_disable_check_same_thread, index=index, embedding_dim=embedding_dim, on_disk=on_disk, use_sparse_embeddings=use_sparse_embeddings, sparse_idf=sparse_idf, similarity=similarity, return_embedding=return_embedding, progress_bar=progress_bar, recreate_index=recreate_index, shard_number=shard_number, replication_factor=replication_factor, write_consistency_factor=write_consistency_factor, on_disk_payload=on_disk_payload, hnsw_config=hnsw_config, optimizers_config=optimizers_config, wal_config=wal_config, quantization_config=quantization_config, init_from=init_from, wait_result_from_api=wait_result_from_api, metadata=metadata, write_batch_size=write_batch_size, scroll_size=scroll_size, payload_fields_to_index=payload_fields_to_index, ) self.async_client = qdrant_client.AsyncQdrantClient( location=location, url=url, port=port, grpc_port=grpc_port, prefer_grpc=prefer_grpc, https=https, api_key=api_key.resolve_value() if api_key else None, prefix=prefix, timeout=timeout, host=host, path=path, force_disable_check_same_thread=force_disable_check_same_thread, metadata=metadata or {}, ) # to improve the indexing performance # see https://qdrant.tech/documentation/guides/multiple-partitions/?q=mul#calibrate-performance self.client.create_payload_index( collection_name=index, field_name="project_id", field_schema="keyword" ) async def _query_by_embedding( self, query_embedding: List[float], filters: Optional[Dict[str, Any]] = None, top_k: int = 10, scale_score: bool = True, return_embedding: bool = False, ) -> List[Document]: qdrant_filters = convert_filters_to_qdrant(filters) points = await self.async_client.search( collection_name=self.index, query_vector=rest.NamedVector( name=DENSE_VECTORS_NAME if self.use_sparse_embeddings else "", vector=query_embedding, ), search_params=( rest.SearchParams( quantization=rest.QuantizationSearchParams( rescore=True, oversampling=3.0, ), ) if len(query_embedding) >= 1024 # reference: https://qdrant.tech/articles/binary-quantization/#when-should-you-not-use-bq else None ), query_filter=qdrant_filters, limit=top_k, with_vectors=return_embedding, ) results = [ convert_qdrant_point_to_haystack_document( point, use_sparse_embeddings=self.use_sparse_embeddings ) for point in points ] if scale_score: for document in results: score = document.score if self.similarity == "cosine": score = (score + 1) / 2 else: score = float(1 / (1 + np.exp(-score / 100))) document.score = score return results async def _query_by_filters( self, filters: Optional[Dict[str, Any]] = None, top_k: Optional[int] = None, ) -> List[Document]: qdrant_filters = convert_filters_to_qdrant(filters) points_list = [] offset = None while True: points = await self.async_client.scroll( collection_name=self.index, offset=offset, scroll_filter=qdrant_filters, limit=top_k, ) points_list.extend(points[0]) if points[1] is None: break offset = points[1] if points_list: return [ convert_qdrant_point_to_haystack_document( point, use_sparse_embeddings=self.use_sparse_embeddings ) for point in points_list ] else: return [] async def delete_documents(self, filters: Optional[Dict[str, Any]] = None): if not filters: qdrant_filters = rest.Filter() else: qdrant_filters = convert_filters_to_qdrant(filters) try: await self.async_client.delete( collection_name=self.index, points_selector=qdrant_filters, wait=self.wait_result_from_api, ) except KeyError: logger.warning( "Called QdrantDocumentStore.delete_documents() on a non-existing ID", ) async def count_documents(self, filters: Optional[Dict[str, Any]] = None) -> int: if not filters: qdrant_filters = rest.Filter() else: qdrant_filters = convert_filters_to_qdrant(filters) return ( await self.async_client.count( collection_name=self.index, count_filter=qdrant_filters ) ).count async def write_documents( self, documents: List[Document], policy: DuplicatePolicy = DuplicatePolicy.FAIL ): for doc in documents: if not isinstance(doc, Document): msg = f"DocumentStore.write_documents() expects a list of Documents but got an element of {type(doc)}." raise ValueError(msg) self._set_up_collection( self.index, self.embedding_dim, False, self.similarity, self.use_sparse_embeddings, self.sparse_idf, self.on_disk, self.payload_fields_to_index, ) if len(documents) == 0: logger.warning( "Calling QdrantDocumentStore.write_documents() with empty list" ) return document_objects = self._handle_duplicate_documents( documents=documents, policy=policy, ) batched_documents = document_store.get_batches_from_generator( document_objects, self.write_batch_size ) with tqdm( total=len(document_objects), disable=not self.progress_bar ) as progress_bar: for document_batch in batched_documents: batch = convert_haystack_documents_to_qdrant_points( document_batch, use_sparse_embeddings=self.use_sparse_embeddings, ) await self.async_client.upsert( collection_name=self.index, points=batch, wait=self.wait_result_from_api, ) progress_bar.update(self.write_batch_size) return len(document_objects) class AsyncQdrantEmbeddingRetriever(QdrantEmbeddingRetriever): def __init__( self, document_store: AsyncQdrantDocumentStore, filters: Optional[Dict[str, Any]] = None, top_k: int = 10, scale_score: bool = True, return_embedding: bool = False, ): super(AsyncQdrantEmbeddingRetriever, self).__init__( document_store=document_store, filters=filters, top_k=top_k, scale_score=scale_score, return_embedding=return_embedding, ) self._document_store = document_store @component.output_types(documents=List[Document]) async def run( self, query_embedding: List[float], filters: Optional[Dict[str, Any]] = None, top_k: Optional[int] = None, scale_score: Optional[bool] = None, return_embedding: Optional[bool] = None, ): if query_embedding: docs = await self._document_store._query_by_embedding( query_embedding=query_embedding, filters=filters or self._filters, top_k=top_k or self._top_k, scale_score=scale_score or self._scale_score, return_embedding=return_embedding or self._return_embedding, ) else: docs = await self._document_store._query_by_filters( filters=filters, top_k=top_k, ) return {"documents": docs} @provider("qdrant") class QdrantProvider(DocumentStoreProvider): def __init__( self, location: str = os.getenv("QDRANT_HOST", "qdrant"), api_key: Optional[str] = os.getenv("QDRANT_API_KEY", None), timeout: Optional[int] = ( int(os.getenv("QDRANT_TIMEOUT")) if os.getenv("QDRANT_TIMEOUT") else 120 ), embedding_model_dim: int = ( int(os.getenv("EMBEDDING_MODEL_DIMENSION")) if os.getenv("EMBEDDING_MODEL_DIMENSION") else 0 ), recreate_index: bool = ( bool(os.getenv("SHOULD_FORCE_DEPLOY")) if os.getenv("SHOULD_FORCE_DEPLOY") else False ), **_, ): self._location = location self._api_key = Secret.from_token(api_key) if api_key else None self._timeout = timeout self._embedding_model_dim = embedding_model_dim self._reset_document_store(recreate_index) def _reset_document_store(self, recreate_index: bool): self.get_store(recreate_index=recreate_index) self.get_store(dataset_name="table_descriptions", recreate_index=recreate_index) self.get_store(dataset_name="view_questions", recreate_index=recreate_index) self.get_store(dataset_name="sql_pairs", recreate_index=recreate_index) self.get_store(dataset_name="instructions", recreate_index=recreate_index) self.get_store(dataset_name="project_meta", recreate_index=recreate_index) def get_store( self, dataset_name: Optional[str] = None, recreate_index: bool = False, ): return AsyncQdrantDocumentStore( location=self._location, api_key=self._api_key, embedding_dim=self._embedding_model_dim, index=dataset_name or "Document", recreate_index=recreate_index, on_disk=True, timeout=self._timeout, quantization_config=( rest.BinaryQuantization( binary=rest.BinaryQuantizationConfig( always_ram=True, ) ) if self._embedding_model_dim >= 1024 else None ), # to improve the indexing performance, we disable building global index for the whole collection # see https://qdrant.tech/documentation/guides/multiple-partitions/?q=mul#calibrate-performance hnsw_config=rest.HnswConfigDiff( payload_m=16, m=0, ), ) def get_retriever( self, document_store: AsyncQdrantDocumentStore, top_k: int = 10, ): return AsyncQdrantEmbeddingRetriever( document_store=document_store, top_k=top_k, ) ================================================ FILE: wren-ai-service/src/providers/embedder/__init__.py ================================================ ================================================ FILE: wren-ai-service/src/providers/embedder/litellm.py ================================================ import asyncio import logging import os from typing import Any, Dict, List, Optional, Tuple import backoff import openai from haystack import Document, component from litellm import aembedding from src.core.provider import EmbedderProvider from src.providers.loader import provider from src.utils import remove_trailing_slash logger = logging.getLogger("wren-ai-service") def _prepare_texts_to_embed(documents: List[Document]) -> List[str]: """ Prepare the texts to embed by concatenating the Document text with the metadata fields to embed. """ texts_to_embed = [] for doc in documents: text_to_embed = "\n".join([doc.content or ""]) # copied from OpenAI embedding_utils (https://github.com/openai/openai-python/blob/main/openai/embeddings_utils.py) # replace newlines, which can negatively affect performance. text_to_embed = text_to_embed.replace("\n", " ") texts_to_embed.append(text_to_embed) return texts_to_embed @component class AsyncTextEmbedder: def __init__( self, model: str, api_key: Optional[str] = None, api_base_url: Optional[str] = None, timeout: Optional[float] = None, **kwargs, ): self._api_key = api_key self._model = model self._api_base_url = api_base_url self._timeout = timeout self._kwargs = kwargs @component.output_types(embedding=List[float], meta=Dict[str, Any]) @backoff.on_exception(backoff.expo, openai.APIError, max_time=60.0, max_tries=3) async def run(self, text: str): if not isinstance(text, str): raise TypeError( "AsyncTextEmbedder expects a string as an input." "In case you want to embed a list of Documents, please use the AsyncDocumentEmbedder." ) # copied from OpenAI embedding_utils (https://github.com/openai/openai-python/blob/main/openai/embeddings_utils.py) # replace newlines, which can negatively affect performance. text_to_embed = text.replace("\n", " ") response = await aembedding( model=self._model, input=[text_to_embed], api_key=self._api_key, api_base=self._api_base_url, timeout=self._timeout, **self._kwargs, ) meta = { "model": response.model, "usage": dict(response.usage) if hasattr(response, "usage") else {}, } return {"embedding": response.data[0]["embedding"], "meta": meta} @component class AsyncDocumentEmbedder: def __init__( self, model: str, batch_size: int = 32, api_key: Optional[str] = None, api_base_url: Optional[str] = None, timeout: Optional[float] = None, **kwargs, ): self._api_key = api_key self._model = model self._batch_size = batch_size self._api_base_url = api_base_url self._timeout = timeout self._kwargs = kwargs async def _embed_batch( self, texts_to_embed: List[str], batch_size: int ) -> Tuple[List[List[float]], Dict[str, Any]]: async def embed_single_batch(batch: List[str]) -> Any: return await aembedding( model=self._model, input=batch, api_key=self._api_key, api_base=self._api_base_url, timeout=self._timeout, **self._kwargs, ) batches = [ texts_to_embed[i : i + batch_size] for i in range(0, len(texts_to_embed), batch_size) ] responses = await asyncio.gather( *[embed_single_batch(batch) for batch in batches] ) all_embeddings = [] meta: Dict[str, Any] = {} for response in responses: embeddings = [el["embedding"] for el in response.data] all_embeddings.extend(embeddings) if "model" not in meta: meta["model"] = response.model if "usage" not in meta: meta["usage"] = ( dict(response.usage) if hasattr(response, "usage") else {} ) else: if hasattr(response, "usage"): meta["usage"]["prompt_tokens"] += response.usage.prompt_tokens meta["usage"]["total_tokens"] += response.usage.total_tokens return all_embeddings, meta @component.output_types(documents=List[Document], meta=Dict[str, Any]) @backoff.on_exception(backoff.expo, openai.APIError, max_time=60.0, max_tries=3) async def run(self, documents: List[Document]): if ( not isinstance(documents, list) or documents and not isinstance(documents[0], Document) ): raise TypeError( "AsyncDocumentEmbedder expects a list of Documents as input." "In case you want to embed a string, please use the AsyncTextEmbedder." ) texts_to_embed = _prepare_texts_to_embed(documents=documents) embeddings, meta = await self._embed_batch( texts_to_embed=texts_to_embed, batch_size=self._batch_size, ) for doc, emb in zip(documents, embeddings): doc.embedding = emb return {"documents": documents, "meta": meta} @provider("litellm_embedder") class LitellmEmbedderProvider(EmbedderProvider): def __init__( self, model: str, api_key_name: Optional[ str ] = None, # e.g. EMBEDDER_OPENAI_API_KEY, EMBEDDER_ANTHROPIC_API_KEY, etc. api_base: Optional[str] = None, timeout: float = 120.0, **kwargs, ): self._api_key = os.getenv(api_key_name) if api_key_name else None self._api_base = remove_trailing_slash(api_base) if api_base else None self._embedding_model = model self._timeout = timeout if "provider" in kwargs: del kwargs["provider"] self._kwargs = kwargs def get_text_embedder(self): return AsyncTextEmbedder( api_key=self._api_key, api_base_url=self._api_base, model=self._embedding_model, timeout=self._timeout, **self._kwargs, ) def get_document_embedder(self): return AsyncDocumentEmbedder( api_key=self._api_key, api_base_url=self._api_base, model=self._embedding_model, timeout=self._timeout, **self._kwargs, ) ================================================ FILE: wren-ai-service/src/providers/engine/__init__.py ================================================ ================================================ FILE: wren-ai-service/src/providers/engine/wren.py ================================================ import asyncio import base64 import logging import os from typing import Any, Dict, Optional, Tuple import aiohttp import orjson from src.config import settings from src.core.engine import Engine, remove_limit_statement from src.providers.loader import provider logger = logging.getLogger("wren-ai-service") @provider("wren_ui") class WrenUI(Engine): def __init__( self, endpoint: str = os.getenv("WREN_UI_ENDPOINT"), **_, ): self._endpoint = endpoint async def execute_sql( self, sql: str, session: aiohttp.ClientSession, project_id: str | None = None, dry_run: bool = True, timeout: float = settings.engine_timeout, limit: int = 500, **kwargs, ) -> Tuple[bool, Optional[Dict[str, Any]], Optional[Dict[str, Any]]]: data = { "sql": remove_limit_statement(sql), "projectId": project_id, } if dry_run: data["dryRun"] = True data["limit"] = 1 else: data["limit"] = limit try: async with session.post( f"{self._endpoint}/api/graphql", json={ "query": "mutation PreviewSql($data: PreviewSQLDataInput) { previewSql(data: $data) }", "variables": {"data": data}, }, timeout=aiohttp.ClientTimeout(total=timeout), ) as response: res_json = await response.json() if res_data := res_json.get("data"): res = res_data.get("previewSql", {}) if res_data else {} if dry_run: return ( True, res, { "correlation_id": res_json.get("correlationId", ""), }, ) data = res.get("data", []) if res else [] if len(data) > 0: return ( True, res, { "correlation_id": res_json.get("correlationId", ""), }, ) return ( False, res, { "correlation_id": res_json.get("correlationId", ""), }, ) error_message = res_json.get("errors", [{}])[0].get( "message", "Unknown error" ) logger.error(f"Error executing SQL: {error_message}") dialect_sql = ( ( ( (res_json.get("errors", [{}])[0] or {}).get( "extensions", {} ) or {} ).get("other", {}) or {} ).get("metadata", {}) or {} ).get("dialectSql", "") or "" planned_sql = ( ( ( (res_json.get("errors", [{}])[0] or {}).get( "extensions", {} ) or {} ).get("other", {}) or {} ).get("metadata", {}) or {} ).get("plannedSql", "") or "" return ( False, {}, { "error_message": error_message, "error_sql": dialect_sql or planned_sql or sql, "correlation_id": ( ( ( (res_json.get("errors", [{}])[0] or {}).get( "extensions", {} ) or {} ).get("other", {}) or {} ).get("correlationId") or "" ), }, ) except asyncio.TimeoutError: return ( False, {}, {"error_message": f"Request timed out: {timeout} seconds"}, ) @provider("wren_ibis") class WrenIbis(Engine): def __init__( self, endpoint: str = os.getenv("WREN_IBIS_ENDPOINT"), source: str = os.getenv("WREN_IBIS_SOURCE"), manifest: str = os.getenv("WREN_IBIS_MANIFEST"), connection_info: str = os.getenv("WREN_IBIS_CONNECTION_INFO"), **_, ): self._endpoint = endpoint self._source = source self._manifest = manifest self._connection_info = ( orjson.loads(base64.b64decode(connection_info)) if connection_info else {} ) async def execute_sql( self, sql: str, session: aiohttp.ClientSession, dry_run: bool = True, timeout: float = settings.engine_timeout, limit: int = 500, **kwargs, ) -> Tuple[bool, Optional[Dict[str, Any]]]: api_endpoint = f"{self._endpoint}/v3/connector/{self._source}/query" if dry_run: api_endpoint += "?dryRun=true&limit=1" else: api_endpoint += f"?limit={limit}" try: async with session.post( api_endpoint, json={ "sql": remove_limit_statement(sql), "manifestStr": self._manifest, "connectionInfo": self._connection_info, }, timeout=aiohttp.ClientTimeout(total=timeout), ) as response: if dry_run: res = await response.text() else: res = await response.json() if response.status == 200 or response.status == 204: return ( True, res, { "correlation_id": "", }, ) return ( False, None, { "error_message": res, "correlation_id": "", }, ) except asyncio.TimeoutError: return False, None, f"Request timed out: {timeout} seconds" async def dry_plan( self, session: aiohttp.ClientSession, sql: str, data_source: str, timeout: float = settings.engine_timeout, allow_fallback: bool = True, **kwargs, ) -> Tuple[bool, str]: api_endpoint = f"{self._endpoint}/v3/connector/{data_source}/dry-plan" try: async with session.post( api_endpoint, headers={ "x-wren-fallback_disable": "false" if allow_fallback else "true", }, json={ "sql": sql, "manifestStr": self._manifest, }, timeout=aiohttp.ClientTimeout(total=timeout), ) as response: res = await response.text() if response.status != 200: raise Exception(f"Request failed with message: {res}") return True, "" except asyncio.TimeoutError: logger.error(f"Request timed out: {timeout} seconds") return False, f"Request timed out: {timeout} seconds" except Exception as e: logger.exception(f"Unexpected error during dry_plan: {str(e)}") return False, f"Unexpected error during dry_plan: {str(e)}" async def get_func_list( self, session: aiohttp.ClientSession, data_source: str, timeout: float = settings.engine_timeout, ) -> list[str]: api_endpoint = f"{self._endpoint}/v3/connector/{data_source}/functions" try: async with session.get(api_endpoint, timeout=timeout) as response: res = await response.json() if response.status != 200: raise Exception(f"Request failed with message: {res}") return res except asyncio.TimeoutError: logger.error(f"Request timed out: {timeout} seconds") return [] except Exception as e: logger.exception(f"Unexpected error during get_func_list: {str(e)}") return [] async def get_sql_knowledge( self, session: aiohttp.ClientSession, data_source: str, timeout: float = settings.engine_timeout, ) -> Optional[Dict[str, Any]]: api_endpoint = f"{self._endpoint}/v3/connector/{data_source}/knowledge" try: async with session.get(api_endpoint, timeout=timeout) as response: res = await response.json() if response.status != 200: raise Exception(f"Request failed with message: {res}") return res except asyncio.TimeoutError: logger.error(f"Request timed out: {timeout} seconds") return None except Exception as e: logger.exception(f"Unexpected error during get_sql_knowledge: {str(e)}") return None @provider("wren_engine") class WrenEngine(Engine): def __init__( self, endpoint: str = os.getenv("WREN_ENGINE_ENDPOINT"), manifest: str = os.getenv("WREN_ENGINE_MANIFEST"), **_, ): self._endpoint = endpoint self._manifest = manifest async def execute_sql( self, sql: str, session: aiohttp.ClientSession, dry_run: bool = True, timeout: float = settings.engine_timeout, limit: int = 500, **kwargs, ) -> Tuple[bool, Optional[Dict[str, Any]], Optional[str]]: api_endpoint = ( f"{self._endpoint}/v1/mdl/dry-run" if dry_run else f"{self._endpoint}/v1/mdl/preview" ) try: async with session.get( api_endpoint, json={ "manifest": orjson.loads(base64.b64decode(self._manifest)) if self._manifest else {}, "sql": remove_limit_statement(sql), "limit": 1 if dry_run else limit, }, timeout=aiohttp.ClientTimeout(total=timeout), ) as response: if dry_run: res = await response.text() else: res = await response.json() if response.status == 200: return ( True, res, { "correlation_id": "", }, ) return ( False, None, { "error_message": res, "correlation_id": "", }, ) except asyncio.TimeoutError: return False, None, f"Request timed out: {timeout} seconds" ================================================ FILE: wren-ai-service/src/providers/llm/__init__.py ================================================ import logging from dataclasses import asdict, dataclass, field from enum import Enum from typing import Any, Dict, List, Optional logger = logging.getLogger("wren-ai-service") class ChatRole(str, Enum): """Enumeration representing the roles within a chat.""" ASSISTANT = "assistant" USER = "user" SYSTEM = "system" FUNCTION = "function" @dataclass class ChatMessage: """ Represents a message in a LLM chat conversation. :param content: The text content of the message. :param role: The role of the entity sending the message. :param name: The name of the function being called (only applicable for role FUNCTION). :param meta: Additional metadata associated with the message. """ content: str role: ChatRole name: Optional[str] = None image_url: Optional[str] = None meta: Dict[str, Any] = field(default_factory=dict, hash=False) def is_from(self, role: ChatRole) -> bool: """ Check if the message is from a specific role. :param role: The role to check against. :returns: True if the message is from the specified role, False otherwise. """ return self.role == role @classmethod def from_assistant( cls, content: str, meta: Optional[Dict[str, Any]] = None ) -> "ChatMessage": """ Create a message from the assistant. :param content: The text content of the message. :param meta: Additional metadata associated with the message. :returns: A new ChatMessage instance. """ return cls( content, ChatRole.ASSISTANT, name=None, image_url=None, meta=meta or {} ) @classmethod def from_user(cls, content: str, image_url: Optional[str] = None) -> "ChatMessage": """ Create a message from the user. :param content: The text content of the message. :returns: A new ChatMessage instance. """ return cls(content, ChatRole.USER, name=None, image_url=image_url) @classmethod def from_system(cls, content: str) -> "ChatMessage": """ Create a message from the system. :param content: The text content of the message. :returns: A new ChatMessage instance. """ return cls(content, ChatRole.SYSTEM, name=None, image_url=None) @classmethod def from_function(cls, content: str, name: str) -> "ChatMessage": """ Create a message from a function call. :param content: The text content of the message. :param name: The name of the function being called. :returns: A new ChatMessage instance. """ return cls(content, ChatRole.FUNCTION, name=name, image_url=None, meta=None) def to_dict(self) -> Dict[str, Any]: """ Converts ChatMessage into a dictionary. :returns: Serialized version of the object. """ data = asdict(self) data["role"] = self.role.value return data @classmethod def from_dict(cls, data: Dict[str, Any]) -> "ChatMessage": """ Creates a new ChatMessage object from a dictionary. :param data: The dictionary to build the ChatMessage object. :returns: The created object. """ data["role"] = ChatRole(data["role"]) return cls(**data) @dataclass class StreamingChunk: """ The StreamingChunk class encapsulates a segment of streamed content along with associated metadata. This structure facilitates the handling and processing of streamed data in a systematic manner. :param content: The content of the message chunk as a string. :param meta: A dictionary containing metadata related to the message chunk. """ content: str meta: Dict[str, Any] = field(default_factory=dict, hash=False) def build_message(completion: Any, choice: Any) -> ChatMessage: """ Converts the response from the OpenAI API to a ChatMessage. :param completion: The completion returned by the OpenAI API. :param choice: The choice returned by the OpenAI API. :returns: The ChatMessage. """ # function or tools calls are not going to happen in non-chat generation # as users can not send ChatMessage with function or tools calls chat_message = ChatMessage.from_assistant(choice.message.content or "") chat_message.meta.update( { "model": completion.model, "index": choice.index, "finish_reason": choice.finish_reason, "usage": dict(completion.usage) if hasattr(completion, "usage") else {}, } ) return chat_message def check_finish_reason(message: ChatMessage) -> None: """ Check the `finish_reason` returned with the OpenAI completions. If the `finish_reason` is `length`, log a warning to the user. :param message: The message returned by the LLM. """ if message.meta["finish_reason"] == "length": logger.warning( "The completion for index %s has been truncated before reaching a natural stopping point. " "Finish reason: %s. Increase the max_tokens parameter to allow for longer completions.", message.meta["index"], message.meta["finish_reason"], ) if message.meta["finish_reason"] == "content_filter": logger.warning( "The completion for index %s has been truncated due to the content filter. " "Finish reason: %s.", message.meta["index"], message.meta["finish_reason"], ) def connect_chunks(chunk: Any, chunks: List[StreamingChunk]) -> ChatMessage: """ Connects the streaming chunks into a single ChatMessage. """ complete_response = ChatMessage.from_assistant( "".join([chunk.content for chunk in chunks]) ) complete_response.meta.update( { "model": chunk.model, "index": 0, "finish_reason": chunk.choices[0].finish_reason, "usage": dict(chunk.usage) if hasattr(chunk, "usage") else {}, } ) return complete_response def build_chunk(chunk: Any) -> StreamingChunk: """ Converts the response from the OpenAI API to a StreamingChunk. :param chunk: The chunk returned by the OpenAI API. :returns: The StreamingChunk. """ # function or tools calls are not going to happen in non-chat generation # as users can not send ChatMessage with function or tools calls choice = chunk.choices[0] content = choice.delta.content or "" chunk_message = StreamingChunk(content) chunk_message.meta.update( { "model": chunk.model, "index": choice.index, "finish_reason": choice.finish_reason, } ) return chunk_message def convert_message_to_openai_format(message: ChatMessage) -> Dict[str, str]: """ Convert a message to the format expected by OpenAI's Chat API. See the [API reference](https://platform.openai.com/docs/api-reference/chat/create) for details. :returns: A dictionary with the following key: - `role` - `content` - `name` (optional) """ openai_msg = {"role": message.role.value} if message.content and hasattr(message, "image_url") and message.image_url: openai_msg["content"] = [ {"type": "text", "text": message.content}, {"type": "image_url", "image_url": {"url": message.image_url}}, ] elif message.content: openai_msg["content"] = message.content elif hasattr(message, "image_url") and message.image_url: openai_msg["content"] = [ {"type": "image_url", "image_url": {"url": message.image_url}} ] if hasattr(message, "name") and message.name: openai_msg["name"] = message.name return openai_msg ================================================ FILE: wren-ai-service/src/providers/llm/litellm.py ================================================ import os from typing import Any, Callable, Dict, List, Optional import backoff import openai from litellm import Router, acompletion from src.core.provider import LLMProvider from src.providers.llm import ( ChatMessage, StreamingChunk, build_chunk, build_message, check_finish_reason, connect_chunks, convert_message_to_openai_format, ) from src.providers.loader import provider from src.utils import extract_braces_content, remove_trailing_slash @provider("litellm_llm") class LitellmLLMProvider(LLMProvider): def __init__( self, model: str, api_key_name: Optional[ str ] = None, # e.g. OPENAI_API_KEY, LLM_ANTHROPIC_API_KEY, etc. api_base: Optional[str] = None, api_version: Optional[str] = None, kwargs: Optional[Dict[str, Any]] = None, timeout: float = 120.0, context_window_size: int = 100000, fallback_model_list: Optional[List[Dict[str, Any]]] = None, fallback_testing: bool = False, **_, ): self._model = model # TODO: remove _api_key, _api_base, _api_version in the future, as it is not used in litellm self._api_key = os.getenv(api_key_name) if api_key_name else None self._api_base = remove_trailing_slash(api_base) if api_base else None self._api_version = api_version self._model_kwargs = kwargs or {} self._timeout = timeout self._context_window_size = context_window_size # build a dynamic list of all fallback model names (beyond the first) self._has_fallbacks = ( fallback_model_list is not None and len(fallback_model_list) > 1 ) fallbacks = ( [{self._model: [m["model_name"] for m in fallback_model_list[1:]]}] if self._has_fallbacks else [] ) self._router = Router( model_list=fallback_model_list or [], fallbacks=fallbacks, ) self._enable_fallback_testing = fallback_testing and self._has_fallbacks def get_generator( self, system_prompt: Optional[str] = None, generation_kwargs: Optional[Dict[str, Any]] = None, streaming_callback: Optional[Callable[[StreamingChunk], None]] = None, ): combined_generation_kwargs = { **(generation_kwargs or {}), **(self._model_kwargs or {}), } @backoff.on_exception(backoff.expo, openai.APIError, max_time=60.0, max_tries=3) async def _run( prompt: str, image_url: Optional[str] = None, current_system_prompt: Optional[str] = None, history_messages: Optional[List[ChatMessage]] = None, generation_kwargs: Optional[Dict[str, Any]] = None, query_id: Optional[str] = None, ): message = ChatMessage.from_user(prompt, image_url) _system_prompt = system_prompt if current_system_prompt: _system_prompt = current_system_prompt if _system_prompt: messages = [ChatMessage.from_system(_system_prompt)] if history_messages: messages.extend(history_messages) messages.append(message) else: if history_messages: messages = history_messages + [message] else: messages = [message] openai_formatted_messages = [ convert_message_to_openai_format(message) for message in messages ] generation_kwargs = { **combined_generation_kwargs, **(generation_kwargs or {}), } allowed_openai_params = generation_kwargs.get( "allowed_openai_params", [] ) + (["reasoning_effort"] if self._model.startswith("gpt-5") else []) if self._has_fallbacks: completion = await self._router.acompletion( model=self._model, messages=openai_formatted_messages, stream=streaming_callback is not None, allowed_openai_params=allowed_openai_params, mock_testing_fallbacks=self._enable_fallback_testing, **generation_kwargs, ) else: completion = await acompletion( model=self._model, api_key=self._api_key, api_base=self._api_base, api_version=self._api_version, timeout=self._timeout, messages=openai_formatted_messages, stream=streaming_callback is not None, allowed_openai_params=allowed_openai_params, **generation_kwargs, ) completions: List[ChatMessage] = [] if streaming_callback is not None: num_responses = generation_kwargs.pop("n", 1) if num_responses > 1: raise ValueError( "Cannot stream multiple responses, please set n=1." ) chunks: List[StreamingChunk] = [] async for chunk in completion: if chunk.choices and streaming_callback: chunk_delta: StreamingChunk = build_chunk(chunk) chunks.append(chunk_delta) streaming_callback( chunk_delta, query_id ) # invoke callback with the chunk_delta completions = [connect_chunks(chunk, chunks)] else: completions = [ build_message(completion, choice) for choice in completion.choices ] # before returning, do post-processing of the completions for response in completions: check_finish_reason(response) return { "replies": [ extract_braces_content(message.content) for message in completions ], "meta": [message.meta for message in completions], } return _run ================================================ FILE: wren-ai-service/src/providers/loader.py ================================================ import importlib import logging import pkgutil logger = logging.getLogger("wren-ai-service") PROVIDERS_PATH = "src.providers" PROVIDERS = {} def import_mods(package_name=PROVIDERS_PATH): """ This function is designed to import all submodules within a given package, including those in nested packages. The function works by first importing the initial package using its name. It then iterates through the package directory and imports each submodule it encounters. This includes submodules in any nested packages. This is particularly useful in scenarios where you want to ensure that all submodules are loaded and ready for use, without having to manually import each one individually. Parameters: package_name (str): The name of the initial package to import submodules from. Defaults to the value of PROVIDERS_PATH. Returns: None: This function doesn't return anything; it simply imports the submodules. Raises: ModuleNotFoundError: If a submodule cannot be found. """ package = importlib.import_module(package_name) # Iterate through all the submodules in the package for _, name, _ in pkgutil.walk_packages(package.__path__, package.__name__ + "."): # Import each submodule importlib.import_module(name) def provider(name: str): """ This decorator is designed to register a provider class and add it to the PROVIDERS dictionary. The decorator works by taking a name as an argument, which is used as a key in the PROVIDERS dictionary. The value associated with this key is the provider class that the decorator is applied to. This is particularly useful in scenarios where you want to maintain a registry of provider classes, and you want to be able to access these classes using a unique name. Parameters: name (str): The name of the provider. This is used as a key in the PROVIDERS dictionary. Returns: function: The decorator function that registers the provider class. Raises: KeyError: If a provider with the same name is already registered in the PROVIDERS dictionary. """ def wrapper(cls): PROVIDERS[name] = cls return cls return wrapper def get_provider(name: str): """ This function is designed to return a provider class by its name. The function works by taking a name as an argument, which is used to look up the corresponding provider class in a dictionary of registered providers. This is particularly useful in scenarios where you have a registry of provider classes and you want to be able to retrieve a specific provider class using its unique name. Parameters: name (str): The name of the provider. This is used as a key to look up the provider class in the dictionary of registered providers. Returns: type: The provider class corresponding to the given name. Raises: KeyError: If a provider with the given name is not found in the dictionary of registered providers. """ return PROVIDERS[name] ================================================ FILE: wren-ai-service/src/utils.py ================================================ import functools import logging import os import re from pathlib import Path import requests from dotenv import load_dotenv from langfuse.decorators import langfuse_context from src.config import Settings logger = logging.getLogger("wren-ai-service") class CustomFormatter(logging.Formatter): def __init__(self, is_dev: bool): super().__init__() try: if not is_dev: # Imports the Cloud Logging client library import google.cloud.logging # Instantiates a client client = google.cloud.logging.Client() # Retrieves a Cloud Logging handler based on the environment # you're running in and integrates the handler with the # Python logging module. By default this captures all logs # at INFO level and higher client.setup_logging() except Exception: pass def format(self, record): _LOGGING_FORMAT = "{levelname:<.1}{asctime}.{msecs:03.0f} {process} {name}:{lineno}] {message}" _DATE_FMT = "%m%d %H:%M:%S" formatter = logging.Formatter( fmt=_LOGGING_FORMAT, datefmt=_DATE_FMT, style="{", ) return formatter.format(record) def setup_custom_logger(name, level_str: str, is_dev: bool): level_str = level_str.upper() if level_str not in logging._nameToLevel: raise ValueError(f"Invalid logging level: {level_str}") level = logging._nameToLevel[level_str] handler = logging.StreamHandler() handler.setFormatter(CustomFormatter(is_dev)) logger = logging.getLogger(name) logger.setLevel(level) logger.addHandler(handler) return logger def load_env_vars() -> str: # DEPRECATED: This method is deprecated and will be removed in the future if Path(".env.dev").exists(): load_dotenv(".env.dev", override=True) return "dev" return "prod" def remove_trailing_slash(endpoint: str) -> str: return endpoint.rstrip("/") if endpoint.endswith("/") else endpoint def init_langfuse(settings: Settings): langfuse_context.configure( enabled=settings.langfuse_enable, host=settings.langfuse_host, public_key=os.getenv("LANGFUSE_PUBLIC_KEY"), secret_key=os.getenv("LANGFUSE_SECRET_KEY"), ) logger.info(f"LANGFUSE_ENABLE: {settings.langfuse_enable}") logger.info(f"LANGFUSE_HOST: {settings.langfuse_host}") def trace_metadata(func): """ This decorator is used to add metadata to the current Langfuse trace. It should be applied after creating a trace. Here’s an example of how to use it: ```python @observe(name="Mock") @trace_metadata async def mock(): return "Mock" ``` Args: func (Callable): the function to decorate Returns: Callable: the decorated function """ def extract(*args) -> dict: request = args[1] # fix the position of the request object metadata = {} if hasattr(request, "project_id"): metadata["project_id"] = request.project_id if hasattr(request, "thread_id"): metadata["thread_id"] = request.thread_id if hasattr(request, "mdl_hash"): metadata["mdl_hash"] = request.mdl_hash if hasattr(request, "user_id"): metadata["user_id"] = request.user_id if hasattr(request, "query"): metadata["query"] = request.query return metadata @functools.wraps(func) async def wrapper(*args, **kwargs): trace_id = langfuse_context.get_current_trace_id() results = await func(*args, **kwargs, trace_id=trace_id) addition = {} if isinstance(results, dict): additional_metadata = results.get("metadata", {}) addition.update(additional_metadata) metadata = extract(*args) service_metadata = kwargs.get( "service_metadata", { "pipes_metadata": {}, "service_version": "", }, ) langfuse_metadata = { **service_metadata.get("pipes_metadata"), **addition, "mdl_hash": metadata.get("mdl_hash"), "project_id": metadata.get("project_id"), "query": metadata.get("query"), } langfuse_context.update_current_trace( user_id=metadata.get("user_id"), session_id=metadata.get("thread_id"), release=service_metadata.get("service_version"), metadata=langfuse_metadata, ) return results return wrapper def trace_cost(func): @functools.wraps(func) async def wrapper(*args, **kwargs): result, generator_name = await func(*args, **kwargs) if isinstance(result, dict): if meta := result.get("meta", []): model = meta[0].get("model") langfuse_context.update_current_observation( model=model, usage_details=meta[0].get("usage", {}), ) langfuse_context.update_current_trace( metadata={"fallback_is_triggered": model != generator_name} ) return result return wrapper def fetch_wren_ai_docs(doc_endpoint: str, is_oss: bool) -> list[dict]: doc_endpoint = remove_trailing_slash(doc_endpoint) api_endpoint = ( f"{doc_endpoint}/oss/llms.md" if is_oss else f"{doc_endpoint}/cloud/llms.md" ) try: response = requests.get(api_endpoint, timeout=10) response.raise_for_status() # Raise exception for 4XX/5XX responses docs = response.text.split("\n---\n") except requests.RequestException as e: logger.error(f"Failed to fetch Wren AI docs: {str(e)}") return [] # Return empty list on error doc_endpoint_base = f"{doc_endpoint}/oss" if is_oss else f"{doc_endpoint}/cloud" results = [] for doc in docs: if doc: path, content = doc.split("\n") results.append( { "path": f'{doc_endpoint_base}/{path.replace(".md", "")}', "content": content, } ) return results def extract_braces_content(resp: str) -> str: """ Extracts JSON content enclosed in a markdown code block that starts with ```json. Returns the JSON string including braces, or the original string if no match is found. """ match = re.search(r"```json\s*(\{.*?\})\s*```", resp, re.DOTALL) return match.group(1) if match else resp ================================================ FILE: wren-ai-service/src/web/__init__.py ================================================ ================================================ FILE: wren-ai-service/src/web/development.py ================================================ import inspect import logging from typing import Any, Dict, get_type_hints from fastapi import APIRouter, HTTPException logger = logging.getLogger("wren-ai-service") router = APIRouter() def _extract_run_method_params(pipeline_instance) -> Dict[str, str]: """Extract parameter information from a pipeline's run method""" run_method = getattr(pipeline_instance, "run", None) if not run_method: return {} try: # Get the method signature sig = inspect.signature(run_method) # Get type hints type_hints = get_type_hints(run_method) params = {} for param_name, param in sig.parameters.items(): if param_name == "self": continue # Get the type annotation as string param_type = type_hints.get(param_name) if param_type: # Handle complex types by getting their string representation type_str = str(param_type).replace("typing.", "") else: # Fallback to parameter annotation if param.annotation != inspect.Parameter.empty: type_str = str(param.annotation).replace("typing.", "") else: type_str = "Any" params[param_name] = type_str return params except Exception as e: logger.warning(f"Failed to extract parameters from pipeline run method: {e}") return {} @router.get("/pipelines") async def get_pipelines() -> dict: from src.__main__ import app service_container = app.state.service_container pipeline_params = {} # Extract pipelines from all services for _, service in service_container.__dict__.items(): if hasattr(service, "_pipelines"): for pipeline_name, pipeline_instance in service._pipelines.items(): pipeline_params[pipeline_name] = _extract_run_method_params( pipeline_instance ) return pipeline_params @router.post("/pipelines/{pipeline_name}") async def run_pipeline(pipeline_name: str, request_body: Dict[str, Any]) -> dict: from src.__main__ import app service_container = app.state.service_container pipe_components = {} for _, service in service_container.__dict__.items(): if hasattr(service, "_pipelines"): for _pipeline_name, pipeline_instance in service._pipelines.items(): pipe_components[_pipeline_name] = pipeline_instance if pipeline_name not in pipe_components: logger.error(f"Pipeline {pipeline_name} not found") raise HTTPException( status_code=404, detail=f"Pipeline '{pipeline_name}' not found" ) try: pipeline = pipe_components[pipeline_name] result = await pipeline.run(**request_body) return result except Exception as e: logger.error(f"Error running pipeline {pipeline_name}: {e}") raise HTTPException( status_code=500, detail=f"Error running pipeline '{pipeline_name}': {e}" ) ================================================ FILE: wren-ai-service/src/web/v1/__init__.py ================================================ ================================================ FILE: wren-ai-service/src/web/v1/routers/__init__.py ================================================ from fastapi import APIRouter from src.web.v1.routers import ( ask, ask_feedbacks, chart, chart_adjustment, instructions, question_recommendation, relationship_recommendation, semantics_description, semantics_preparation, sql_answers, sql_corrections, sql_pairs, sql_question, ) router = APIRouter() router.include_router(ask.router) router.include_router(ask_feedbacks.router) router.include_router(question_recommendation.router) router.include_router(relationship_recommendation.router) router.include_router(semantics_description.router) router.include_router(semantics_preparation.router) router.include_router(sql_answers.router) router.include_router(chart.router) router.include_router(chart_adjustment.router) router.include_router(sql_pairs.router) router.include_router(sql_question.router) router.include_router(instructions.router) router.include_router(sql_corrections.router) ================================================ FILE: wren-ai-service/src/web/v1/routers/ask.py ================================================ import uuid from dataclasses import asdict from fastapi import APIRouter, BackgroundTasks, Depends from fastapi.responses import StreamingResponse from src.globals import ( ServiceContainer, ServiceMetadata, get_service_container, get_service_metadata, ) from src.web.v1.services.ask import ( AskRequest, AskResponse, AskResultRequest, AskResultResponse, StopAskRequest, StopAskResponse, ) router = APIRouter() @router.post("/asks") async def ask( ask_request: AskRequest, background_tasks: BackgroundTasks, service_container: ServiceContainer = Depends(get_service_container), service_metadata: ServiceMetadata = Depends(get_service_metadata), ) -> AskResponse: query_id = str(uuid.uuid4()) ask_request.query_id = query_id service_container.ask_service._ask_results[query_id] = AskResultResponse( status="understanding", ) background_tasks.add_task( service_container.ask_service.ask, ask_request, service_metadata=asdict(service_metadata), ) return AskResponse(query_id=query_id) @router.patch("/asks/{query_id}") async def stop_ask( query_id: str, stop_ask_request: StopAskRequest, background_tasks: BackgroundTasks, service_container: ServiceContainer = Depends(get_service_container), ) -> StopAskResponse: stop_ask_request.query_id = query_id background_tasks.add_task( service_container.ask_service.stop_ask, stop_ask_request, ) return StopAskResponse(query_id=query_id) @router.get("/asks/{query_id}/result") async def get_ask_result( query_id: str, service_container: ServiceContainer = Depends(get_service_container), ) -> AskResultResponse: return service_container.ask_service.get_ask_result( AskResultRequest(query_id=query_id) ) @router.get("/asks/{query_id}/streaming-result") async def get_ask_streaming_result( query_id: str, service_container: ServiceContainer = Depends(get_service_container), ) -> StreamingResponse: return StreamingResponse( service_container.ask_service.get_ask_streaming_result(query_id), media_type="text/event-stream", ) ================================================ FILE: wren-ai-service/src/web/v1/routers/ask_feedbacks.py ================================================ import uuid from dataclasses import asdict from fastapi import APIRouter, BackgroundTasks, Depends from src.globals import ( ServiceContainer, ServiceMetadata, get_service_container, get_service_metadata, ) from src.web.v1.services.ask_feedback import ( AskFeedbackRequest, AskFeedbackResponse, AskFeedbackResultRequest, AskFeedbackResultResponse, StopAskFeedbackRequest, StopAskFeedbackResponse, ) router = APIRouter() @router.post("/ask-feedbacks") async def ask_feedback( ask_feedback_request: AskFeedbackRequest, background_tasks: BackgroundTasks, service_container: ServiceContainer = Depends(get_service_container), service_metadata: ServiceMetadata = Depends(get_service_metadata), ) -> AskFeedbackResponse: query_id = str(uuid.uuid4()) ask_feedback_request.query_id = query_id service_container.ask_feedback_service._ask_feedback_results[ query_id ] = AskFeedbackResultResponse( status="searching", ) background_tasks.add_task( service_container.ask_feedback_service.ask_feedback, ask_feedback_request, service_metadata=asdict(service_metadata), ) return AskFeedbackResponse(query_id=query_id) @router.patch("/ask-feedbacks/{query_id}") async def stop_ask_feedback( query_id: str, stop_ask_feedback_request: StopAskFeedbackRequest, background_tasks: BackgroundTasks, service_container: ServiceContainer = Depends(get_service_container), ) -> StopAskFeedbackResponse: stop_ask_feedback_request.query_id = query_id background_tasks.add_task( service_container.ask_feedback_service.stop_ask_feedback, stop_ask_feedback_request, ) return StopAskFeedbackResponse(query_id=query_id) @router.get("/ask-feedbacks/{query_id}") async def get_ask_feedback_result( query_id: str, service_container: ServiceContainer = Depends(get_service_container), ) -> AskFeedbackResultResponse: return service_container.ask_feedback_service.get_ask_feedback_result( AskFeedbackResultRequest(query_id=query_id) ) ================================================ FILE: wren-ai-service/src/web/v1/routers/chart.py ================================================ import uuid from dataclasses import asdict from fastapi import APIRouter, BackgroundTasks, Depends from src.globals import ( ServiceContainer, ServiceMetadata, get_service_container, get_service_metadata, ) from src.web.v1.services.chart import ( ChartRequest, ChartResponse, ChartResultRequest, ChartResultResponse, StopChartRequest, StopChartResponse, ) router = APIRouter() @router.post("/charts") async def chart( chart_request: ChartRequest, background_tasks: BackgroundTasks, service_container: ServiceContainer = Depends(get_service_container), service_metadata: ServiceMetadata = Depends(get_service_metadata), ) -> ChartResponse: query_id = str(uuid.uuid4()) chart_request.query_id = query_id service_container.chart_service._chart_results[query_id] = ChartResultResponse( status="fetching", ) background_tasks.add_task( service_container.chart_service.chart, chart_request, service_metadata=asdict(service_metadata), ) return ChartResponse(query_id=query_id) @router.patch("/charts/{query_id}") async def stop_chart( query_id: str, stop_chart_request: StopChartRequest, background_tasks: BackgroundTasks, service_container: ServiceContainer = Depends(get_service_container), ) -> StopChartResponse: stop_chart_request.query_id = query_id background_tasks.add_task( service_container.ask_service.stop_ask, stop_chart_request, ) return StopChartResponse(query_id=query_id) @router.get("/charts/{query_id}") async def get_chart_result( query_id: str, service_container: ServiceContainer = Depends(get_service_container), ) -> ChartResultResponse: return service_container.chart_service.get_chart_result( ChartResultRequest(query_id=query_id) ) ================================================ FILE: wren-ai-service/src/web/v1/routers/chart_adjustment.py ================================================ import uuid from dataclasses import asdict from fastapi import APIRouter, BackgroundTasks, Depends from src.globals import ( ServiceContainer, ServiceMetadata, get_service_container, get_service_metadata, ) from src.web.v1.services.chart_adjustment import ( ChartAdjustmentRequest, ChartAdjustmentResponse, ChartAdjustmentResultRequest, ChartAdjustmentResultResponse, StopChartAdjustmentRequest, StopChartAdjustmentResponse, ) router = APIRouter() @router.post("/chart-adjustments") async def chart_adjustment( chart_adjustment_request: ChartAdjustmentRequest, background_tasks: BackgroundTasks, service_container: ServiceContainer = Depends(get_service_container), service_metadata: ServiceMetadata = Depends(get_service_metadata), ) -> ChartAdjustmentResponse: query_id = str(uuid.uuid4()) chart_adjustment_request.query_id = query_id service_container.chart_adjustment_service._chart_adjustment_results[ query_id ] = ChartAdjustmentResultResponse( status="fetching", ) background_tasks.add_task( service_container.chart_adjustment_service.chart_adjustment, chart_adjustment_request, service_metadata=asdict(service_metadata), ) return ChartAdjustmentResponse(query_id=query_id) @router.patch("/chart-adjustments/{query_id}") async def stop_chart_adjustment( query_id: str, stop_chart_adjustment_request: StopChartAdjustmentRequest, background_tasks: BackgroundTasks, service_container: ServiceContainer = Depends(get_service_container), ) -> StopChartAdjustmentResponse: stop_chart_adjustment_request.query_id = query_id background_tasks.add_task( service_container.chart_adjustment_service.stop_chart_adjustment, stop_chart_adjustment_request, ) return StopChartAdjustmentResponse(query_id=query_id) @router.get("/chart-adjustments/{query_id}") async def get_chart_adjustment_result( query_id: str, service_container: ServiceContainer = Depends(get_service_container), ) -> ChartAdjustmentResultResponse: return service_container.chart_adjustment_service.get_chart_adjustment_result( ChartAdjustmentResultRequest(query_id=query_id) ) ================================================ FILE: wren-ai-service/src/web/v1/routers/instructions.py ================================================ import uuid from dataclasses import asdict from typing import List, Literal, Optional from fastapi import APIRouter, BackgroundTasks, Depends, Response from pydantic import BaseModel from src.globals import ( ServiceContainer, ServiceMetadata, get_service_container, get_service_metadata, ) from src.web.v1.services import BaseRequest, InstructionsService router = APIRouter() class PostRequest(BaseRequest): instructions: List[InstructionsService.Instruction] class PostResponse(BaseModel): event_id: str @router.post("/instructions") async def index( request: PostRequest, background_tasks: BackgroundTasks, service_container: ServiceContainer = Depends(get_service_container), service_metadata: ServiceMetadata = Depends(get_service_metadata), ) -> PostResponse: event_id = str(uuid.uuid4()) service = service_container.instructions_service service[event_id] = InstructionsService.Event(event_id=event_id) index_request = InstructionsService.IndexRequest( event_id=event_id, **request.model_dump() ) background_tasks.add_task( service.index, index_request, service_metadata=asdict(service_metadata), ) return PostResponse(event_id=event_id) class DeleteRequest(BaseRequest): instruction_ids: List[str] @router.delete("/instructions") async def delete( request: DeleteRequest, response: Response, service_container: ServiceContainer = Depends(get_service_container), service_metadata: ServiceMetadata = Depends(get_service_metadata), ) -> None | InstructionsService.Error: event_id = str(uuid.uuid4()) service = service_container.instructions_service service[event_id] = InstructionsService.Event(event_id=event_id, status="deleting") delete_request = InstructionsService.DeleteRequest( event_id=event_id, **request.model_dump(), ) await service.delete(delete_request, service_metadata=asdict(service_metadata)) event: InstructionsService.Event = service[event_id] if event.status == "failed": response.status_code = 500 return event.error class GetResponse(BaseModel): event_id: str status: Literal["indexing", "deleting", "finished", "failed"] error: Optional[dict] trace_id: Optional[str] @router.get("/instructions/{event_id}") async def get( event_id: str, container: ServiceContainer = Depends(get_service_container), ) -> GetResponse: event: InstructionsService.Event = container.instructions_service[event_id] return GetResponse(**event.model_dump()) ================================================ FILE: wren-ai-service/src/web/v1/routers/question_recommendation.py ================================================ import uuid from dataclasses import asdict from typing import Literal, Optional from fastapi import APIRouter, BackgroundTasks, Depends from pydantic import BaseModel from src.globals import ( ServiceContainer, ServiceMetadata, get_service_container, get_service_metadata, ) from src.web.v1.services import BaseRequest, QuestionRecommendation router = APIRouter() class PostRequest(BaseRequest): mdl: str previous_questions: list[str] = [] max_questions: int = 5 max_categories: int = 3 regenerate: bool = False allow_data_preview: bool = True class PostResponse(BaseModel): id: str @router.post( "/question-recommendations", response_model=PostResponse, ) async def recommend( request: PostRequest, background_tasks: BackgroundTasks, service_container: ServiceContainer = Depends(get_service_container), service_metadata: ServiceMetadata = Depends(get_service_metadata), ) -> PostResponse: event_id = str(uuid.uuid4()) service = service_container.question_recommendation service[event_id] = QuestionRecommendation.Event(event_id=event_id) _request = QuestionRecommendation.Request(event_id=event_id, **request.model_dump()) background_tasks.add_task( service.recommend, _request, service_metadata=asdict(service_metadata), ) return PostResponse(id=event_id) class GetResponse(BaseModel): id: str status: Literal["generating", "finished", "failed"] response: Optional[dict] error: Optional[dict] trace_id: Optional[str] = None @router.get( "/question-recommendations/{event_id}", response_model=GetResponse, ) async def get( event_id: str, service_container: ServiceContainer = Depends(get_service_container), ) -> GetResponse: event: QuestionRecommendation.Event = service_container.question_recommendation[ event_id ] def _formatter(response: dict) -> dict: questions = [ question for _, questions in response["questions"].items() for question in questions ] return {"questions": questions} return GetResponse( id=event.event_id, status=event.status, response=_formatter(event.response), error=event.error and event.error.model_dump(), trace_id=event.trace_id, ) ================================================ FILE: wren-ai-service/src/web/v1/routers/relationship_recommendation.py ================================================ import uuid from dataclasses import asdict from typing import Literal, Optional from fastapi import APIRouter, BackgroundTasks, Depends from pydantic import BaseModel from src.globals import ( ServiceContainer, ServiceMetadata, get_service_container, get_service_metadata, ) from src.web.v1.services import BaseRequest, RelationshipRecommendation router = APIRouter() class PostRequest(BaseRequest): mdl: str class PostResponse(BaseModel): id: str @router.post( "/relationship-recommendations", response_model=PostResponse, ) async def recommend( request: PostRequest, background_tasks: BackgroundTasks, service_container: ServiceContainer = Depends(get_service_container), service_metadata: ServiceMetadata = Depends(get_service_metadata), ) -> PostResponse: id = str(uuid.uuid4()) service = service_container.relationship_recommendation service[id] = RelationshipRecommendation.Resource(id=id) input = RelationshipRecommendation.Input( id=id, mdl=request.mdl, project_id=request.project_id, configuration=request.configurations, ) background_tasks.add_task( service.recommend, input, service_metadata=asdict(service_metadata) ) return PostResponse(id=id) class GetResponse(BaseModel): id: str status: Literal["generating", "finished", "failed"] response: Optional[dict] error: Optional[dict] trace_id: Optional[str] = None @router.get( "/relationship-recommendations/{id}", response_model=GetResponse, ) async def get( id: str, service_container: ServiceContainer = Depends(get_service_container), ) -> GetResponse: resource = service_container.relationship_recommendation[id] return GetResponse( id=resource.id, status=resource.status, response=resource.response, error=resource.error and resource.error.model_dump(), trace_id=resource.trace_id, ) ================================================ FILE: wren-ai-service/src/web/v1/routers/semantics_description.py ================================================ import uuid from dataclasses import asdict from typing import Literal, Optional from fastapi import APIRouter, BackgroundTasks, Depends from pydantic import BaseModel from src.globals import ( ServiceContainer, ServiceMetadata, get_service_container, get_service_metadata, ) from src.web.v1.services import BaseRequest, SemanticsDescription router = APIRouter() class PostRequest(BaseRequest): selected_models: list[str] user_prompt: str mdl: str class PostResponse(BaseModel): id: str @router.post( "/semantics-descriptions", response_model=PostResponse, ) async def generate( request: PostRequest, background_tasks: BackgroundTasks, service_container: ServiceContainer = Depends(get_service_container), service_metadata: ServiceMetadata = Depends(get_service_metadata), ) -> PostResponse: id = str(uuid.uuid4()) service = service_container.semantics_description service[id] = SemanticsDescription.Resource(id=id) generate_request = SemanticsDescription.GenerateRequest( id=id, **request.model_dump() ) background_tasks.add_task( service.generate, generate_request, service_metadata=asdict(service_metadata), ) return PostResponse(id=id) class GetResponse(BaseModel): id: str status: Literal["generating", "finished", "failed"] response: Optional[list[dict]] error: Optional[dict] trace_id: Optional[str] = None @router.get( "/semantics-descriptions/{id}", response_model=GetResponse, ) async def get( id: str, service_container: ServiceContainer = Depends(get_service_container), ) -> GetResponse: resource = service_container.semantics_description[id] def _formatter(response: Optional[dict]) -> Optional[list[dict]]: if response is None: return None return [ { "name": model_name, "columns": [ { "name": column["name"], "description": column["properties"].get("description", ""), } for column in model_data["columns"] ], "description": model_data["properties"].get("description", ""), } for model_name, model_data in response.items() ] return GetResponse( id=resource.id, status=resource.status, response=resource.response and _formatter(resource.response), error=resource.error and resource.error.model_dump(), trace_id=resource.trace_id, ) ================================================ FILE: wren-ai-service/src/web/v1/routers/semantics_preparation.py ================================================ from dataclasses import asdict from fastapi import APIRouter, BackgroundTasks, Depends, HTTPException from src.globals import ( ServiceContainer, ServiceMetadata, get_service_container, get_service_metadata, ) from src.web.v1.services.semantics_preparation import ( SemanticsPreparationRequest, SemanticsPreparationResponse, SemanticsPreparationStatusRequest, SemanticsPreparationStatusResponse, ) router = APIRouter() @router.post("/semantics-preparations") async def prepare_semantics( prepare_semantics_request: SemanticsPreparationRequest, background_tasks: BackgroundTasks, service_container: ServiceContainer = Depends(get_service_container), service_metadata: ServiceMetadata = Depends(get_service_metadata), ) -> SemanticsPreparationResponse: service_container.semantics_preparation_service._prepare_semantics_statuses[ prepare_semantics_request.mdl_hash ] = SemanticsPreparationStatusResponse( status="indexing", ) background_tasks.add_task( service_container.semantics_preparation_service.prepare_semantics, prepare_semantics_request, service_metadata=asdict(service_metadata), ) return SemanticsPreparationResponse(mdl_hash=prepare_semantics_request.mdl_hash) @router.get("/semantics-preparations/{mdl_hash}/status") async def get_prepare_semantics_status( mdl_hash: str, service_container: ServiceContainer = Depends(get_service_container), ) -> SemanticsPreparationStatusResponse: return service_container.semantics_preparation_service.get_prepare_semantics_status( SemanticsPreparationStatusRequest(mdl_hash=mdl_hash) ) @router.delete("/semantics") async def delete_semantics( project_id: str, service_container: ServiceContainer = Depends(get_service_container), ) -> None: if not project_id: raise HTTPException(status_code=400, detail="Project ID is required") await service_container.semantics_preparation_service.delete_semantics(project_id) ================================================ FILE: wren-ai-service/src/web/v1/routers/sql_answers.py ================================================ import uuid from dataclasses import asdict from fastapi import APIRouter, BackgroundTasks, Depends from fastapi.responses import StreamingResponse from src.globals import ( ServiceContainer, ServiceMetadata, get_service_container, get_service_metadata, ) from src.web.v1.services.sql_answer import ( SqlAnswerRequest, SqlAnswerResponse, SqlAnswerResultRequest, SqlAnswerResultResponse, ) router = APIRouter() @router.post("/sql-answers") async def sql_answer( sql_answer_request: SqlAnswerRequest, background_tasks: BackgroundTasks, service_container: ServiceContainer = Depends(get_service_container), service_metadata: ServiceMetadata = Depends(get_service_metadata), ) -> SqlAnswerResponse: query_id = str(uuid.uuid4()) sql_answer_request.query_id = query_id service_container.sql_answer_service._sql_answer_results[ query_id ] = SqlAnswerResultResponse( status="preprocessing", ) background_tasks.add_task( service_container.sql_answer_service.sql_answer, sql_answer_request, service_metadata=asdict(service_metadata), ) return SqlAnswerResponse(query_id=query_id) @router.get("/sql-answers/{query_id}") async def get_sql_answer_result( query_id: str, service_container: ServiceContainer = Depends(get_service_container), ) -> SqlAnswerResultResponse: return service_container.sql_answer_service.get_sql_answer_result( SqlAnswerResultRequest(query_id=query_id) ) @router.get("/sql-answers/{query_id}/streaming") async def get_sql_answer_streaming_result( query_id: str, service_container: ServiceContainer = Depends(get_service_container), ) -> StreamingResponse: return StreamingResponse( service_container.sql_answer_service.get_sql_answer_streaming_result(query_id), media_type="text/event-stream", ) ================================================ FILE: wren-ai-service/src/web/v1/routers/sql_corrections.py ================================================ import uuid from dataclasses import asdict from typing import List, Literal, Optional from fastapi import APIRouter, BackgroundTasks, Depends from pydantic import BaseModel from src.globals import ( ServiceContainer, ServiceMetadata, get_service_container, get_service_metadata, ) from src.web.v1.services import BaseRequest, SqlCorrectionService router = APIRouter() class PostRequest(BaseRequest): sql: str error: str retrieved_tables: Optional[List[str]] = None use_dry_plan: bool = False allow_dry_plan_fallback: bool = True class PostResponse(BaseModel): event_id: str @router.post("/sql-corrections") async def correct( request: PostRequest, background_tasks: BackgroundTasks, service_container: ServiceContainer = Depends(get_service_container), service_metadata: ServiceMetadata = Depends(get_service_metadata), ) -> PostResponse: event_id = str(uuid.uuid4()) service = service_container.sql_correction_service service[event_id] = SqlCorrectionService.Event(event_id=event_id) _request = SqlCorrectionService.CorrectionRequest( event_id=event_id, **request.model_dump() ) background_tasks.add_task( service.correct, _request, service_metadata=asdict(service_metadata), ) return PostResponse(event_id=event_id) class GetResponse(BaseModel): event_id: str status: Literal["correcting", "finished", "failed"] response: Optional[str] = None error: Optional[dict] = None trace_id: Optional[str] = None invalid_sql: Optional[str] = None @router.get("/sql-corrections/{event_id}") async def get( event_id: str, container: ServiceContainer = Depends(get_service_container), ) -> GetResponse: event: SqlCorrectionService.Event = container.sql_correction_service[event_id] return GetResponse(**event.model_dump()) ================================================ FILE: wren-ai-service/src/web/v1/routers/sql_pairs.py ================================================ import uuid from dataclasses import asdict from typing import List, Literal, Optional from fastapi import APIRouter, BackgroundTasks, Depends, Response from pydantic import BaseModel from src.globals import ( ServiceContainer, ServiceMetadata, get_service_container, get_service_metadata, ) from src.pipelines.indexing.sql_pairs import SqlPair from src.web.v1.services import BaseRequest, SqlPairsService router = APIRouter() class PostRequest(BaseRequest): sql_pairs: List[SqlPair] class PostResponse(BaseModel): event_id: str @router.post("/sql-pairs") async def prepare( request: PostRequest, background_tasks: BackgroundTasks, service_container: ServiceContainer = Depends(get_service_container), service_metadata: ServiceMetadata = Depends(get_service_metadata), ) -> PostResponse: event_id = str(uuid.uuid4()) service = service_container.sql_pairs_service service[event_id] = SqlPairsService.Event(id=event_id, status="indexing") index_request = SqlPairsService.IndexRequest(id=event_id, **request.model_dump()) background_tasks.add_task( service.index, index_request, service_metadata=asdict(service_metadata), ) return PostResponse(event_id=event_id) class DeleteRequest(BaseRequest): sql_pair_ids: List[str] @router.delete("/sql-pairs") async def delete( request: DeleteRequest, response: Response, service_container: ServiceContainer = Depends(get_service_container), service_metadata: ServiceMetadata = Depends(get_service_metadata), ) -> None | SqlPairsService.Event.Error: event_id = str(uuid.uuid4()) service = service_container.sql_pairs_service service[event_id] = SqlPairsService.Event(id=event_id, status="deleting") delete_request = SqlPairsService.DeleteRequest( id=event_id, **request.model_dump(), ) await service.delete(delete_request, service_metadata=asdict(service_metadata)) event: SqlPairsService.Event = service[event_id] if event.status == "failed": response.status_code = 500 return event.error class GetResponse(BaseModel): event_id: str status: Literal["indexing", "deleting", "finished", "failed"] error: Optional[dict] trace_id: Optional[str] @router.get("/sql-pairs/{event_id}") async def get( event_id: str, container: ServiceContainer = Depends(get_service_container), ) -> GetResponse: event: SqlPairsService.Event = container.sql_pairs_service[event_id] return GetResponse( event_id=event.id, status=event.status, error=event.error and event.error.model_dump(), trace_id=event.trace_id, ) ================================================ FILE: wren-ai-service/src/web/v1/routers/sql_question.py ================================================ import uuid from dataclasses import asdict from fastapi import APIRouter, BackgroundTasks, Depends from src.globals import ( ServiceContainer, ServiceMetadata, get_service_container, get_service_metadata, ) from src.web.v1.services.sql_question import ( SqlQuestionRequest, SqlQuestionResponse, SqlQuestionResultRequest, SqlQuestionResultResponse, ) router = APIRouter() @router.post("/sql-questions") async def sql_question( sql_question_request: SqlQuestionRequest, background_tasks: BackgroundTasks, service_container: ServiceContainer = Depends(get_service_container), service_metadata: ServiceMetadata = Depends(get_service_metadata), ) -> SqlQuestionResponse: query_id = str(uuid.uuid4()) sql_question_request.query_id = query_id service_container.sql_question_service._sql_question_results[ query_id ] = SqlQuestionResultResponse( status="generating", ) background_tasks.add_task( service_container.sql_question_service.sql_question, sql_question_request, service_metadata=asdict(service_metadata), ) return SqlQuestionResponse(query_id=query_id) @router.get("/sql-questions/{query_id}") async def get_sql_question_result( query_id: str, service_container: ServiceContainer = Depends(get_service_container), ) -> SqlQuestionResultResponse: return service_container.sql_question_service.get_sql_question_result( SqlQuestionResultRequest(query_id=query_id) ) ================================================ FILE: wren-ai-service/src/web/v1/services/__init__.py ================================================ from datetime import datetime from typing import Literal, Optional import orjson import pytz from pydantic import AliasChoices, BaseModel, Field class MetadataTraceable: def with_metadata(self) -> dict: return { "resource": self, "metadata": { **self._error_metadata(), }, } def _error_metadata(self): return { "error_type": self.error and self.error.code, "error_message": self.error and self.error.message, "request_from": self.request_from, } class Configuration(BaseModel): class Timezone(BaseModel): name: str = "UTC" utc_offset: str = "" # Deprecated, will be removed in the future def show_current_time(self): # Get the current time in the specified timezone tz = pytz.timezone( self.timezone.name ) # Assuming timezone.name contains the timezone string current_time = datetime.now(tz) return f"{current_time.strftime('%Y-%m-%d %A %H:%M:%S')}" # YYYY-MM-DD weekday_name HH:MM:SS, ex: 2024-10-23 Wednesday 12:00:00 language: str = "English" timezone: Timezone = Timezone() class SSEEvent(BaseModel): class SSEEventMessage(BaseModel): message: str def to_dict(self): return {"message": self.message} data: SSEEventMessage def serialize(self): return f"data: {orjson.dumps(self.data.to_dict()).decode()}\n\n" # for POST, PATCH, UPDATE, DELETE requests class BaseRequest(BaseModel): _query_id: str | None = None project_id: Optional[str] = None thread_id: Optional[str] = None configurations: Configuration = Field( default_factory=Configuration, alias=AliasChoices("configurations", "configuration"), # accept both keys ) request_from: Literal["ui", "api"] = "ui" @property def query_id(self) -> str: return self._query_id @query_id.setter def query_id(self, query_id: str): self._query_id = query_id # Put the services imports here to avoid circular imports and make them accessible directly to the rest of packages from .ask import AskService # noqa: E402 from .ask_feedback import AskFeedbackService # noqa: E402 from .chart import ChartService # noqa: E402 from .chart_adjustment import ChartAdjustmentService # noqa: E402 from .instructions import InstructionsService # noqa: E402 from .question_recommendation import QuestionRecommendation # noqa: E402 from .relationship_recommendation import RelationshipRecommendation # noqa: E402 from .semantics_description import SemanticsDescription # noqa: E402 from .semantics_preparation import SemanticsPreparationService # noqa: E402 from .sql_answer import SqlAnswerService # noqa: E402 from .sql_corrections import SqlCorrectionService # noqa: E402 from .sql_pairs import SqlPairsService # noqa: E402 from .sql_question import SqlQuestionService # noqa: E402 __all__ = [ "AskService", "AskFeedbackService", "ChartService", "ChartAdjustmentService", "QuestionRecommendation", "RelationshipRecommendation", "SemanticsDescription", "SemanticsPreparationService", "SqlAnswerService", "SqlCorrectionService", "SqlPairsService", "SqlQuestionService", "InstructionsService", ] ================================================ FILE: wren-ai-service/src/web/v1/services/ask.py ================================================ import asyncio import logging from typing import Dict, List, Literal, Optional from cachetools import TTLCache from langfuse.decorators import observe from pydantic import AliasChoices, BaseModel, Field from src.core.pipeline import BasicPipeline from src.utils import trace_metadata from src.web.v1.services import BaseRequest, SSEEvent logger = logging.getLogger("wren-ai-service") class AskHistory(BaseModel): sql: str question: str # POST /v1/asks class AskRequest(BaseRequest): query: str # don't recommend to use id as a field name, but it's used in the older version of API spec # so we need to support as a choice, and will remove it in the future mdl_hash: Optional[str] = Field(validation_alias=AliasChoices("mdl_hash", "id")) histories: Optional[list[AskHistory]] = Field(default_factory=list) ignore_sql_generation_reasoning: bool = False enable_column_pruning: bool = False use_dry_plan: bool = False allow_dry_plan_fallback: bool = True custom_instruction: Optional[str] = None class AskResponse(BaseModel): query_id: str # PATCH /v1/asks/{query_id} class StopAskRequest(BaseRequest): status: Literal["stopped"] class StopAskResponse(BaseModel): query_id: str # GET /v1/asks/{query_id}/result class AskResult(BaseModel): sql: str type: Literal["llm", "view"] = "llm" viewId: Optional[str] = None class AskError(BaseModel): code: Literal["NO_RELEVANT_DATA", "NO_RELEVANT_SQL", "OTHERS"] message: str class AskResultRequest(BaseModel): query_id: str class _AskResultResponse(BaseModel): status: Literal[ "understanding", "searching", "planning", "generating", "correcting", "finished", "failed", "stopped", ] rephrased_question: Optional[str] = None intent_reasoning: Optional[str] = None sql_generation_reasoning: Optional[str] = None type: Optional[Literal["GENERAL", "TEXT_TO_SQL"]] = None retrieved_tables: Optional[List[str]] = None response: Optional[List[AskResult]] = None invalid_sql: Optional[str] = None error: Optional[AskError] = None trace_id: Optional[str] = None is_followup: bool = False general_type: Optional[ Literal["MISLEADING_QUERY", "DATA_ASSISTANCE", "USER_GUIDE"] ] = None class AskResultResponse(_AskResultResponse): is_followup: Optional[bool] = Field(False, exclude=True) general_type: Optional[ Literal["MISLEADING_QUERY", "DATA_ASSISTANCE", "USER_GUIDE"] ] = Field(None, exclude=True) class AskService: def __init__( self, pipelines: Dict[str, BasicPipeline], allow_intent_classification: bool = True, allow_sql_generation_reasoning: bool = True, allow_sql_functions_retrieval: bool = True, allow_sql_diagnosis: bool = True, allow_sql_knowledge_retrieval: bool = True, enable_column_pruning: bool = False, max_sql_correction_retries: int = 3, max_histories: int = 5, maxsize: int = 1_000_000, ttl: int = 120, ): self._pipelines = pipelines self._ask_results: Dict[str, AskResultResponse] = TTLCache( maxsize=maxsize, ttl=ttl ) self._allow_sql_generation_reasoning = allow_sql_generation_reasoning self._allow_sql_functions_retrieval = allow_sql_functions_retrieval self._allow_intent_classification = allow_intent_classification self._allow_sql_diagnosis = allow_sql_diagnosis self._allow_sql_knowledge_retrieval = allow_sql_knowledge_retrieval self._enable_column_pruning = enable_column_pruning self._max_histories = max_histories self._max_sql_correction_retries = max_sql_correction_retries def _is_stopped(self, query_id: str, container: dict): if ( result := container.get(query_id) ) is not None and result.status == "stopped": return True return False @observe(name="Ask Question") @trace_metadata async def ask( self, ask_request: AskRequest, **kwargs, ): trace_id = kwargs.get("trace_id") results = { "ask_result": {}, "metadata": { "type": "", "error_type": "", "error_message": "", "request_from": ask_request.request_from, }, } query_id = ask_request.query_id histories = ask_request.histories[: self._max_histories][ ::-1 ] # reverse the order of histories rephrased_question = None intent_reasoning = None sql_generation_reasoning = None sql_samples = [] instructions = [] api_results = [] table_names = [] error_message = None invalid_sql = None allow_sql_generation_reasoning = ( self._allow_sql_generation_reasoning and not ask_request.ignore_sql_generation_reasoning ) enable_column_pruning = ( self._enable_column_pruning or ask_request.enable_column_pruning ) allow_sql_functions_retrieval = self._allow_sql_functions_retrieval allow_sql_diagnosis = self._allow_sql_diagnosis allow_sql_knowledge_retrieval = self._allow_sql_knowledge_retrieval max_sql_correction_retries = self._max_sql_correction_retries current_sql_correction_retries = 0 use_dry_plan = ask_request.use_dry_plan allow_dry_plan_fallback = ask_request.allow_dry_plan_fallback sql_knowledge = None try: user_query = ask_request.query # ask status can be understanding, searching, generating, finished, failed, stopped # we will need to handle business logic for each status if not self._is_stopped(query_id, self._ask_results): self._ask_results[query_id] = AskResultResponse( status="understanding", trace_id=trace_id, is_followup=True if histories else False, ) historical_question = await self._pipelines["historical_question"].run( query=user_query, project_id=ask_request.project_id, ) # we only return top 1 result historical_question_result = historical_question.get( "formatted_output", {} ).get("documents", [])[:1] if historical_question_result: api_results = [ AskResult( **{ "sql": result.get("statement"), "type": "view" if result.get("viewId") else "llm", "viewId": result.get("viewId"), } ) for result in historical_question_result ] sql_generation_reasoning = "" else: # Run both pipeline operations concurrently sql_samples_task, instructions_task = await asyncio.gather( self._pipelines["sql_pairs_retrieval"].run( query=user_query, project_id=ask_request.project_id, ), self._pipelines["instructions_retrieval"].run( query=user_query, project_id=ask_request.project_id, scope="sql", ), ) # Extract results from completed tasks sql_samples = sql_samples_task["formatted_output"].get( "documents", [] ) instructions = instructions_task["formatted_output"].get( "documents", [] ) if self._allow_intent_classification: intent_classification_result = ( await self._pipelines["intent_classification"].run( query=user_query, histories=histories, sql_samples=sql_samples, instructions=instructions, project_id=ask_request.project_id, configuration=ask_request.configurations, ) ).get("post_process", {}) intent = intent_classification_result.get("intent") rephrased_question = intent_classification_result.get( "rephrased_question" ) intent_reasoning = intent_classification_result.get("reasoning") if rephrased_question: user_query = rephrased_question if intent == "MISLEADING_QUERY": asyncio.create_task( self._pipelines["misleading_assistance"].run( query=user_query, histories=histories, db_schemas=intent_classification_result.get( "db_schemas" ), language=ask_request.configurations.language, query_id=ask_request.query_id, custom_instruction=ask_request.custom_instruction, ) ) self._ask_results[query_id] = AskResultResponse( status="finished", type="GENERAL", rephrased_question=rephrased_question, intent_reasoning=intent_reasoning, trace_id=trace_id, is_followup=True if histories else False, general_type="MISLEADING_QUERY", ) results["metadata"]["type"] = "MISLEADING_QUERY" return results elif intent == "GENERAL": asyncio.create_task( self._pipelines["data_assistance"].run( query=user_query, histories=histories, db_schemas=intent_classification_result.get( "db_schemas" ), language=ask_request.configurations.language, query_id=ask_request.query_id, custom_instruction=ask_request.custom_instruction, ) ) self._ask_results[query_id] = AskResultResponse( status="finished", type="GENERAL", rephrased_question=rephrased_question, intent_reasoning=intent_reasoning, trace_id=trace_id, is_followup=True if histories else False, general_type="DATA_ASSISTANCE", ) results["metadata"]["type"] = "GENERAL" return results elif intent == "USER_GUIDE": asyncio.create_task( self._pipelines["user_guide_assistance"].run( query=user_query, language=ask_request.configurations.language, query_id=ask_request.query_id, custom_instruction=ask_request.custom_instruction, ) ) self._ask_results[query_id] = AskResultResponse( status="finished", type="GENERAL", rephrased_question=rephrased_question, intent_reasoning=intent_reasoning, trace_id=trace_id, is_followup=True if histories else False, general_type="USER_GUIDE", ) results["metadata"]["type"] = "GENERAL" return results else: self._ask_results[query_id] = AskResultResponse( status="understanding", type="TEXT_TO_SQL", rephrased_question=rephrased_question, intent_reasoning=intent_reasoning, trace_id=trace_id, is_followup=True if histories else False, ) if not self._is_stopped(query_id, self._ask_results) and not api_results: self._ask_results[query_id] = AskResultResponse( status="searching", type="TEXT_TO_SQL", rephrased_question=rephrased_question, intent_reasoning=intent_reasoning, trace_id=trace_id, is_followup=True if histories else False, ) retrieval_result = await self._pipelines["db_schema_retrieval"].run( query=user_query, histories=histories, project_id=ask_request.project_id, enable_column_pruning=enable_column_pruning, ) _retrieval_result = retrieval_result.get( "construct_retrieval_results", {} ) documents = _retrieval_result.get("retrieval_results", []) table_names = [document.get("table_name") for document in documents] table_ddls = [document.get("table_ddl") for document in documents] if not documents: logger.exception(f"ask pipeline - NO_RELEVANT_DATA: {user_query}") if not self._is_stopped(query_id, self._ask_results): self._ask_results[query_id] = AskResultResponse( status="failed", type="TEXT_TO_SQL", error=AskError( code="NO_RELEVANT_DATA", message="No relevant data", ), rephrased_question=rephrased_question, intent_reasoning=intent_reasoning, trace_id=trace_id, is_followup=True if histories else False, ) results["metadata"]["error_type"] = "NO_RELEVANT_DATA" results["metadata"]["type"] = "TEXT_TO_SQL" return results if ( not self._is_stopped(query_id, self._ask_results) and not api_results and allow_sql_generation_reasoning ): self._ask_results[query_id] = AskResultResponse( status="planning", type="TEXT_TO_SQL", rephrased_question=rephrased_question, intent_reasoning=intent_reasoning, retrieved_tables=table_names, trace_id=trace_id, is_followup=True if histories else False, ) if histories: sql_generation_reasoning = ( await self._pipelines["followup_sql_generation_reasoning"].run( query=user_query, contexts=table_ddls, histories=histories, sql_samples=sql_samples, instructions=instructions, configuration=ask_request.configurations, query_id=query_id, ) ).get("post_process", {}) else: sql_generation_reasoning = ( await self._pipelines["sql_generation_reasoning"].run( query=user_query, contexts=table_ddls, sql_samples=sql_samples, instructions=instructions, configuration=ask_request.configurations, query_id=query_id, ) ).get("post_process", {}) self._ask_results[query_id] = AskResultResponse( status="planning", type="TEXT_TO_SQL", rephrased_question=rephrased_question, intent_reasoning=intent_reasoning, retrieved_tables=table_names, sql_generation_reasoning=sql_generation_reasoning, trace_id=trace_id, is_followup=True if histories else False, ) if not self._is_stopped(query_id, self._ask_results) and not api_results: self._ask_results[query_id] = AskResultResponse( status="generating", type="TEXT_TO_SQL", rephrased_question=rephrased_question, intent_reasoning=intent_reasoning, retrieved_tables=table_names, sql_generation_reasoning=sql_generation_reasoning, trace_id=trace_id, is_followup=True if histories else False, ) if allow_sql_functions_retrieval: sql_functions = await self._pipelines[ "sql_functions_retrieval" ].run( project_id=ask_request.project_id, ) else: sql_functions = [] if allow_sql_knowledge_retrieval: sql_knowledge = await self._pipelines[ "sql_knowledge_retrieval" ].run( project_id=ask_request.project_id, ) has_calculated_field = _retrieval_result.get( "has_calculated_field", False ) has_metric = _retrieval_result.get("has_metric", False) has_json_field = _retrieval_result.get("has_json_field", False) if histories: text_to_sql_generation_results = await self._pipelines[ "followup_sql_generation" ].run( query=user_query, contexts=table_ddls, sql_generation_reasoning=sql_generation_reasoning, histories=histories, project_id=ask_request.project_id, sql_samples=sql_samples, instructions=instructions, has_calculated_field=has_calculated_field, has_metric=has_metric, has_json_field=has_json_field, sql_functions=sql_functions, use_dry_plan=use_dry_plan, allow_dry_plan_fallback=allow_dry_plan_fallback, sql_knowledge=sql_knowledge, ) else: text_to_sql_generation_results = await self._pipelines[ "sql_generation" ].run( query=user_query, contexts=table_ddls, sql_generation_reasoning=sql_generation_reasoning, project_id=ask_request.project_id, sql_samples=sql_samples, instructions=instructions, has_calculated_field=has_calculated_field, has_metric=has_metric, has_json_field=has_json_field, sql_functions=sql_functions, use_dry_plan=use_dry_plan, allow_dry_plan_fallback=allow_dry_plan_fallback, sql_knowledge=sql_knowledge, ) if sql_valid_result := text_to_sql_generation_results["post_process"][ "valid_generation_result" ]: api_results = [ AskResult( **{ "sql": sql_valid_result.get("sql"), "type": "llm", } ) ] elif failed_dry_run_result := text_to_sql_generation_results[ "post_process" ]["invalid_generation_result"]: while current_sql_correction_retries < max_sql_correction_retries: if failed_dry_run_result["type"] == "TIME_OUT": break original_sql = failed_dry_run_result["original_sql"] invalid_sql = failed_dry_run_result["sql"] error_message = failed_dry_run_result["error"] current_sql_correction_retries += 1 self._ask_results[query_id] = AskResultResponse( status="correcting", type="TEXT_TO_SQL", rephrased_question=rephrased_question, intent_reasoning=intent_reasoning, retrieved_tables=table_names, sql_generation_reasoning=sql_generation_reasoning, trace_id=trace_id, is_followup=True if histories else False, ) if allow_sql_diagnosis: sql_diagnosis_results = await self._pipelines[ "sql_diagnosis" ].run( contexts=table_ddls, original_sql=original_sql, invalid_sql=invalid_sql, error_message=error_message, language=ask_request.configurations.language, ) sql_diagnosis_reasoning = sql_diagnosis_results[ "post_process" ].get("reasoning") sql_correction_results = await self._pipelines[ "sql_correction" ].run( contexts=table_ddls, instructions=instructions, invalid_generation_result={ "sql": original_sql, "error": sql_diagnosis_reasoning if allow_sql_diagnosis else error_message, }, project_id=ask_request.project_id, use_dry_plan=use_dry_plan, allow_dry_plan_fallback=allow_dry_plan_fallback, sql_functions=sql_functions, sql_knowledge=sql_knowledge, ) if valid_generation_result := sql_correction_results[ "post_process" ]["valid_generation_result"]: api_results = [ AskResult( **{ "sql": valid_generation_result.get("sql"), "type": "llm", } ) ] break failed_dry_run_result = sql_correction_results["post_process"][ "invalid_generation_result" ] if api_results: if not self._is_stopped(query_id, self._ask_results): self._ask_results[query_id] = AskResultResponse( status="finished", type="TEXT_TO_SQL", response=api_results, rephrased_question=rephrased_question, intent_reasoning=intent_reasoning, retrieved_tables=table_names, sql_generation_reasoning=sql_generation_reasoning, trace_id=trace_id, is_followup=True if histories else False, ) results["ask_result"] = api_results results["metadata"]["type"] = "TEXT_TO_SQL" else: logger.exception(f"ask pipeline - NO_RELEVANT_SQL: {user_query}") if not self._is_stopped(query_id, self._ask_results): self._ask_results[query_id] = AskResultResponse( status="failed", type="TEXT_TO_SQL", error=AskError( code="NO_RELEVANT_SQL", message=error_message or "No relevant SQL", ), rephrased_question=rephrased_question, intent_reasoning=intent_reasoning, retrieved_tables=table_names, sql_generation_reasoning=sql_generation_reasoning, invalid_sql=invalid_sql, trace_id=trace_id, is_followup=True if histories else False, ) results["metadata"]["error_type"] = "NO_RELEVANT_SQL" results["metadata"]["error_message"] = error_message results["metadata"]["type"] = "TEXT_TO_SQL" return results except Exception as e: logger.exception(f"ask pipeline - OTHERS: {e}") self._ask_results[query_id] = AskResultResponse( status="failed", type="TEXT_TO_SQL", error=AskError( code="OTHERS", message=str(e), ), trace_id=trace_id, is_followup=True if histories else False, ) results["metadata"]["error_type"] = "OTHERS" results["metadata"]["error_message"] = str(e) results["metadata"]["type"] = "TEXT_TO_SQL" return results def stop_ask( self, stop_ask_request: StopAskRequest, ): self._ask_results[stop_ask_request.query_id] = AskResultResponse( status="stopped", ) def get_ask_result( self, ask_result_request: AskResultRequest, ) -> AskResultResponse: if (result := self._ask_results.get(ask_result_request.query_id)) is None: logger.exception( f"ask pipeline - OTHERS: {ask_result_request.query_id} is not found" ) return AskResultResponse( status="failed", type="TEXT_TO_SQL", error=AskError( code="OTHERS", message=f"{ask_result_request.query_id} is not found", ), ) return result async def get_ask_streaming_result( self, query_id: str, ): if self._ask_results.get(query_id): _pipeline_name = "" if self._ask_results.get(query_id).type == "GENERAL": if self._ask_results.get(query_id).general_type == "USER_GUIDE": _pipeline_name = "user_guide_assistance" elif self._ask_results.get(query_id).general_type == "DATA_ASSISTANCE": _pipeline_name = "data_assistance" elif self._ask_results.get(query_id).general_type == "MISLEADING_QUERY": _pipeline_name = "misleading_assistance" elif self._ask_results.get(query_id).status == "planning": if self._ask_results.get(query_id).is_followup: _pipeline_name = "followup_sql_generation_reasoning" else: _pipeline_name = "sql_generation_reasoning" if _pipeline_name: async for chunk in self._pipelines[ _pipeline_name ].get_streaming_results(query_id): event = SSEEvent( data=SSEEvent.SSEEventMessage(message=chunk), ) yield event.serialize() ================================================ FILE: wren-ai-service/src/web/v1/services/ask_feedback.py ================================================ import asyncio import logging from typing import Dict, List, Literal, Optional from cachetools import TTLCache from langfuse.decorators import observe from pydantic import BaseModel from src.core.pipeline import BasicPipeline from src.utils import trace_metadata from src.web.v1.services import BaseRequest from src.web.v1.services.ask import AskError, AskResult logger = logging.getLogger("wren-ai-service") # POST /v1/ask-feedbacks class AskFeedbackRequest(BaseRequest): question: str tables: List[str] sql_generation_reasoning: str sql: str class AskFeedbackResponse(BaseModel): query_id: str # PATCH /v1/ask-feedbacks/{query_id} class StopAskFeedbackRequest(BaseRequest): status: Literal["stopped"] class StopAskFeedbackResponse(BaseModel): query_id: str # GET /v1/ask-feedbacks/{query_id} class AskFeedbackResultRequest(BaseModel): query_id: str class AskFeedbackResultResponse(BaseModel): status: Literal[ "searching", "generating", "correcting", "finished", "failed", "stopped", ] invalid_sql: Optional[str] = None error: Optional[AskError] = None response: Optional[List[AskResult]] = None trace_id: Optional[str] = None class AskFeedbackService: def __init__( self, pipelines: Dict[str, BasicPipeline], allow_sql_knowledge_retrieval: bool = True, allow_sql_functions_retrieval: bool = True, allow_sql_diagnosis: bool = True, maxsize: int = 1_000_000, ttl: int = 120, ): self._pipelines = pipelines self._ask_feedback_results: Dict[str, AskFeedbackResultResponse] = TTLCache( maxsize=maxsize, ttl=ttl ) self._allow_sql_knowledge_retrieval = allow_sql_knowledge_retrieval self._allow_sql_functions_retrieval = allow_sql_functions_retrieval self._allow_sql_diagnosis = allow_sql_diagnosis def _is_stopped(self, query_id: str, container: dict): if ( result := container.get(query_id) ) is not None and result.status == "stopped": return True return False @observe(name="Ask Feedback") @trace_metadata async def ask_feedback( self, ask_feedback_request: AskFeedbackRequest, **kwargs, ): trace_id = kwargs.get("trace_id") results = { "ask_feedback_result": {}, "metadata": { "error_type": "", "error_message": "", "request_from": ask_feedback_request.request_from, }, } query_id = ask_feedback_request.query_id allow_sql_functions_retrieval = self._allow_sql_functions_retrieval allow_sql_diagnosis = self._allow_sql_diagnosis api_results = [] error_message = None invalid_sql = None sql_knowledge = None allow_sql_knowledge_retrieval = self._allow_sql_knowledge_retrieval try: if not self._is_stopped(query_id, self._ask_feedback_results): self._ask_feedback_results[query_id] = AskFeedbackResultResponse( status="searching", trace_id=trace_id, ) ( retrieval_task, sql_samples_task, instructions_task, ) = await asyncio.gather( self._pipelines["db_schema_retrieval"].run( tables=ask_feedback_request.tables, project_id=ask_feedback_request.project_id, ), self._pipelines["sql_pairs_retrieval"].run( query=ask_feedback_request.question, project_id=ask_feedback_request.project_id, ), self._pipelines["instructions_retrieval"].run( query=ask_feedback_request.question, project_id=ask_feedback_request.project_id, scope="sql", ), ) if allow_sql_functions_retrieval: sql_functions = await self._pipelines[ "sql_functions_retrieval" ].run( project_id=ask_feedback_request.project_id, ) else: sql_functions = [] if allow_sql_knowledge_retrieval: sql_knowledge = await self._pipelines[ "sql_knowledge_retrieval" ].run( project_id=ask_feedback_request.project_id, ) # Extract results from completed tasks _retrieval_result = retrieval_task.get( "construct_retrieval_results", {} ) has_calculated_field = _retrieval_result.get( "has_calculated_field", False ) has_metric = _retrieval_result.get("has_metric", False) has_json_field = _retrieval_result.get("has_json_field", False) documents = _retrieval_result.get("retrieval_results", []) table_ddls = [document.get("table_ddl") for document in documents] sql_samples = sql_samples_task["formatted_output"].get("documents", []) instructions = instructions_task["formatted_output"].get( "documents", [] ) if not self._is_stopped(query_id, self._ask_feedback_results): self._ask_feedback_results[query_id] = AskFeedbackResultResponse( status="generating", trace_id=trace_id, ) text_to_sql_generation_results = await self._pipelines[ "sql_regeneration" ].run( contexts=table_ddls, sql_generation_reasoning=ask_feedback_request.sql_generation_reasoning, sql=ask_feedback_request.sql, project_id=ask_feedback_request.project_id, sql_samples=sql_samples, instructions=instructions, has_calculated_field=has_calculated_field, has_metric=has_metric, has_json_field=has_json_field, sql_functions=sql_functions, sql_knowledge=sql_knowledge, ) if sql_valid_result := text_to_sql_generation_results["post_process"][ "valid_generation_result" ]: api_results = [ AskResult( **{ "sql": sql_valid_result.get("sql"), "type": "llm", } ) ] elif failed_dry_run_result := text_to_sql_generation_results[ "post_process" ]["invalid_generation_result"]: if failed_dry_run_result["type"] != "TIME_OUT": original_sql = failed_dry_run_result["original_sql"] invalid_sql = failed_dry_run_result["sql"] error_message = failed_dry_run_result["error"] self._ask_feedback_results[ query_id ] = AskFeedbackResultResponse( status="correcting", trace_id=trace_id, ) if allow_sql_diagnosis: sql_diagnosis_results = await self._pipelines[ "sql_diagnosis" ].run( contexts=table_ddls, original_sql=original_sql, invalid_sql=invalid_sql, error_message=error_message, ) sql_diagnosis_reasoning = sql_diagnosis_results[ "post_process" ].get("reasoning") sql_correction_results = await self._pipelines[ "sql_correction" ].run( contexts=table_ddls, instructions=instructions, invalid_generation_result={ "sql": original_sql, "error": sql_diagnosis_reasoning if allow_sql_diagnosis else error_message, }, project_id=ask_feedback_request.project_id, sql_functions=sql_functions, sql_knowledge=sql_knowledge, ) if valid_generation_result := sql_correction_results[ "post_process" ]["valid_generation_result"]: api_results = [ AskResult( **{ "sql": valid_generation_result.get("sql"), "type": "llm", } ) ] elif failed_dry_run_result := sql_correction_results[ "post_process" ]["invalid_generation_result"]: invalid_sql = failed_dry_run_result["sql"] error_message = failed_dry_run_result["error"] else: invalid_sql = failed_dry_run_result["sql"] error_message = failed_dry_run_result["error"] if api_results: if not self._is_stopped(query_id, self._ask_feedback_results): self._ask_feedback_results[query_id] = AskFeedbackResultResponse( status="finished", response=api_results, trace_id=trace_id, ) results["ask_feedback_result"] = api_results else: logger.exception("ask feedback pipeline - NO_RELEVANT_SQL") if not self._is_stopped(query_id, self._ask_feedback_results): self._ask_feedback_results[query_id] = AskFeedbackResultResponse( status="failed", error=AskError( code="NO_RELEVANT_SQL", message=error_message or "No relevant SQL", ), invalid_sql=invalid_sql, trace_id=trace_id, ) results["metadata"]["error_type"] = "NO_RELEVANT_SQL" results["metadata"]["error_message"] = error_message return results except Exception as e: logger.exception(f"ask feedback pipeline - OTHERS: {e}") self._ask_feedback_results[query_id] = AskFeedbackResultResponse( status="failed", error=AskError( code="OTHERS", message=str(e), ), trace_id=trace_id, ) results["metadata"]["error_type"] = "OTHERS" results["metadata"]["error_message"] = str(e) return results def stop_ask_feedback( self, stop_ask_feedback_request: StopAskFeedbackRequest, ): self._ask_feedback_results[ stop_ask_feedback_request.query_id ] = AskFeedbackResultResponse( status="stopped", ) def get_ask_feedback_result( self, ask_feedback_result_request: AskFeedbackResultRequest, ) -> AskFeedbackResultResponse: if ( result := self._ask_feedback_results.get( ask_feedback_result_request.query_id ) ) is None: logger.exception( f"ask feedback pipeline - OTHERS: {ask_feedback_result_request.query_id} is not found" ) return AskFeedbackResultResponse( status="failed", error=AskError( code="OTHERS", message=f"{ask_feedback_result_request.query_id} is not found", ), ) return result ================================================ FILE: wren-ai-service/src/web/v1/services/chart.py ================================================ import logging from typing import Any, Dict, Literal, Optional from cachetools import TTLCache from langfuse.decorators import observe from pydantic import BaseModel from src.core.pipeline import BasicPipeline from src.utils import trace_metadata from src.web.v1.services import BaseRequest logger = logging.getLogger("wren-ai-service") # POST /v1/charts class ChartRequest(BaseRequest): query: str sql: str data: Optional[Dict[str, Any]] = None remove_data_from_chart_schema: bool = True custom_instruction: Optional[str] = None class ChartResponse(BaseModel): query_id: str # PATCH /v1/charts/{query_id} class StopChartRequest(BaseRequest): status: Literal["stopped"] class StopChartResponse(BaseModel): query_id: str # GET /v1/charts/{query_id}/result class ChartError(BaseModel): code: Literal["NO_CHART", "OTHERS"] message: str class ChartResultRequest(BaseModel): query_id: str class ChartResult(BaseModel): reasoning: str chart_type: Literal[ "line", "bar", "pie", "grouped_bar", "stacked_bar", "area", "multi_line", "" ] # empty string for no chart chart_schema: dict class ChartResultResponse(BaseModel): status: Literal["fetching", "generating", "finished", "failed", "stopped"] response: Optional[ChartResult] = None error: Optional[ChartError] = None trace_id: Optional[str] = None class ChartService: def __init__( self, pipelines: Dict[str, BasicPipeline], maxsize: int = 1_000_000, ttl: int = 120, ): self._pipelines = pipelines self._chart_results: Dict[str, ChartResultResponse] = TTLCache( maxsize=maxsize, ttl=ttl ) def _is_stopped(self, query_id: str): if ( result := self._chart_results.get(query_id) ) is not None and result.status == "stopped": return True return False @observe(name="Generate Chart") @trace_metadata async def chart( self, chart_request: ChartRequest, **kwargs, ): trace_id = kwargs.get("trace_id") results = { "chart_result": {}, "metadata": { "error_type": "", "error_message": "", "request_from": chart_request.request_from, }, } try: query_id = chart_request.query_id execute_sql_error_message = None if not chart_request.data: self._chart_results[query_id] = ChartResultResponse( status="fetching", trace_id=trace_id, ) execute_sql_result = ( await self._pipelines["sql_executor"].run( sql=chart_request.sql, project_id=chart_request.project_id, ) )["execute_sql"] sql_data = execute_sql_result["results"] execute_sql_error_message = execute_sql_result.get( "error_message", None ) else: sql_data = chart_request.data execute_sql_error_message = None if execute_sql_error_message: self._chart_results[query_id] = ChartResultResponse( status="failed", error=ChartError( code="OTHERS", message=execute_sql_error_message, ), trace_id=trace_id, ) results["metadata"]["error_type"] = "OTHERS" results["metadata"]["error_message"] = execute_sql_error_message return results self._chart_results[query_id] = ChartResultResponse( status="generating", trace_id=trace_id, ) chart_generation_result = await self._pipelines["chart_generation"].run( query=chart_request.query, sql=chart_request.sql, data=sql_data, language=chart_request.configurations.language, remove_data_from_chart_schema=chart_request.remove_data_from_chart_schema, custom_instruction=chart_request.custom_instruction, ) chart_result = chart_generation_result["post_process"]["results"] if not chart_result.get("chart_schema", {}) and not chart_result.get( "reasoning", "" ): self._chart_results[query_id] = ChartResultResponse( status="failed", error=ChartError( code="NO_CHART", message="chart generation failed" ), trace_id=trace_id, ) results["metadata"]["error_type"] = "NO_CHART" results["metadata"]["error_message"] = "chart generation failed" else: self._chart_results[query_id] = ChartResultResponse( status="finished", response=ChartResult(**chart_result), trace_id=trace_id, ) results["chart_result"] = chart_result return results except Exception as e: logger.exception(f"chart pipeline - OTHERS: {e}") self._chart_results[chart_request.query_id] = ChartResultResponse( status="failed", error=ChartError( code="OTHERS", message=str(e), ), trace_id=trace_id, ) results["metadata"]["error_type"] = "OTHERS" results["metadata"]["error_message"] = str(e) return results def stop_chart( self, stop_chart_request: StopChartRequest, ): self._chart_results[stop_chart_request.query_id] = ChartResultResponse( status="stopped", ) def get_chart_result( self, chart_result_request: ChartResultRequest, ) -> ChartResultResponse: if (result := self._chart_results.get(chart_result_request.query_id)) is None: logger.exception( f"chart pipeline - OTHERS: {chart_result_request.query_id} is not found" ) return ChartResultResponse( status="failed", error=ChartError( code="OTHERS", message=f"{chart_result_request.query_id} is not found", ), ) return result ================================================ FILE: wren-ai-service/src/web/v1/services/chart_adjustment.py ================================================ import logging from typing import Dict, Literal, Optional from cachetools import TTLCache from langfuse.decorators import observe from pydantic import BaseModel from src.core.pipeline import BasicPipeline from src.utils import trace_metadata from src.web.v1.services import BaseRequest logger = logging.getLogger("wren-ai-service") # POST /v1/chart-adjustments class ChartAdjustmentOption(BaseModel): chart_type: Literal[ "bar", "grouped_bar", "line", "pie", "stacked_bar", "area", "multi_line" ] x_axis: Optional[str] = None y_axis: Optional[str] = None x_offset: Optional[str] = None color: Optional[str] = None theta: Optional[str] = None class ChartAdjustmentRequest(BaseRequest): query: str sql: str adjustment_option: ChartAdjustmentOption chart_schema: dict class ChartAdjustmentResponse(BaseModel): query_id: str # PATCH /v1/chart-adjustments/{query_id} class StopChartAdjustmentRequest(BaseRequest): status: Literal["stopped"] class StopChartAdjustmentResponse(BaseModel): query_id: str # GET /v1/chart-adjustments/{query_id}/result class ChartAdjustmentError(BaseModel): code: Literal["NO_CHART", "OTHERS"] message: str class ChartAdjustmentResultRequest(BaseModel): query_id: str class ChartAdjustmentResult(BaseModel): reasoning: str chart_type: Literal[ "line", "bar", "pie", "grouped_bar", "stacked_bar", "area", "multi_line", "" ] # empty string for no chart chart_schema: dict class ChartAdjustmentResultResponse(BaseModel): status: Literal[ "understanding", "fetching", "generating", "finished", "failed", "stopped" ] response: Optional[ChartAdjustmentResult] = None error: Optional[ChartAdjustmentError] = None trace_id: Optional[str] = None class ChartAdjustmentService: def __init__( self, pipelines: Dict[str, BasicPipeline], maxsize: int = 1_000_000, ttl: int = 120, ): self._pipelines = pipelines self._chart_adjustment_results: Dict[ str, ChartAdjustmentResultResponse ] = TTLCache(maxsize=maxsize, ttl=ttl) def _is_stopped(self, query_id: str): if ( result := self._chart_adjustment_results.get(query_id) ) is not None and result.status == "stopped": return True return False @observe(name="Adjust Chart") @trace_metadata async def chart_adjustment( self, chart_adjustment_request: ChartAdjustmentRequest, **kwargs, ): trace_id = kwargs.get("trace_id") results = { "chart_adjustment_result": {}, "metadata": { "error_type": "", "error_message": "", "request_from": chart_adjustment_request.request_from, }, } try: query_id = chart_adjustment_request.query_id execute_sql_error_message = None self._chart_adjustment_results[query_id] = ChartAdjustmentResultResponse( status="fetching", trace_id=trace_id, ) execute_sql_result = ( await self._pipelines["sql_executor"].run( sql=chart_adjustment_request.sql, project_id=chart_adjustment_request.project_id, ) )["execute_sql"] sql_data = execute_sql_result["results"] execute_sql_error_message = execute_sql_result.get("error_message", None) if execute_sql_error_message: self._chart_adjustment_results[ query_id ] = ChartAdjustmentResultResponse( status="failed", error=ChartAdjustmentError( code="OTHERS", message=execute_sql_error_message, ), ) results["metadata"]["error_type"] = "OTHERS" results["metadata"]["error_message"] = execute_sql_error_message return results self._chart_adjustment_results[query_id] = ChartAdjustmentResultResponse( status="generating", trace_id=trace_id, ) chart_adjustment_result = await self._pipelines["chart_adjustment"].run( query=chart_adjustment_request.query, sql=chart_adjustment_request.sql, adjustment_option=chart_adjustment_request.adjustment_option, chart_schema=chart_adjustment_request.chart_schema, data=sql_data, language=chart_adjustment_request.configurations.language, ) chart_result = chart_adjustment_result["post_process"]["results"] if not chart_result.get("chart_schema", {}) and not chart_result.get( "reasoning", "" ): self._chart_adjustment_results[ query_id ] = ChartAdjustmentResultResponse( status="failed", error=ChartAdjustmentError( code="NO_CHART", message="chart generation failed" ), trace_id=trace_id, ) results["metadata"]["error_type"] = "NO_CHART" results["metadata"]["error_message"] = "chart generation failed" else: self._chart_adjustment_results[ query_id ] = ChartAdjustmentResultResponse( status="finished", response=ChartAdjustmentResult(**chart_result), trace_id=trace_id, ) results["chart_adjustment_result"] = chart_result return results except Exception as e: logger.exception(f"chart adjustment pipeline - OTHERS: {e}") self._chart_adjustment_results[ chart_adjustment_request.query_id ] = ChartAdjustmentResultResponse( status="failed", error=ChartAdjustmentError( code="OTHERS", message=str(e), ), trace_id=trace_id, ) results["metadata"]["error_type"] = "OTHERS" results["metadata"]["error_message"] = str(e) return results def stop_chart_adjustment( self, stop_chart_adjustment_request: StopChartAdjustmentRequest, ): self._chart_adjustment_results[ stop_chart_adjustment_request.query_id ] = ChartAdjustmentResultResponse( status="stopped", ) def get_chart_adjustment_result( self, chart_adjustment_result_request: ChartAdjustmentResultRequest, ) -> ChartAdjustmentResultResponse: if ( result := self._chart_adjustment_results.get( chart_adjustment_result_request.query_id ) ) is None: logger.exception( f"chart adjustment pipeline - OTHERS: {chart_adjustment_result_request.query_id} is not found" ) return ChartAdjustmentResultResponse( status="failed", error=ChartAdjustmentError( code="OTHERS", message=f"{chart_adjustment_result_request.query_id} is not found", ), ) return result ================================================ FILE: wren-ai-service/src/web/v1/services/instructions.py ================================================ import logging from typing import Dict, List, Literal, Optional from cachetools import TTLCache from langfuse.decorators import observe from pydantic import BaseModel from src.core.pipeline import BasicPipeline from src.pipelines.indexing.instructions import Instruction from src.utils import trace_metadata from src.web.v1.services import BaseRequest, MetadataTraceable logger = logging.getLogger("wren-ai-service") class InstructionsService: class Instruction(BaseModel): id: str instruction: str questions: List[str] # This is used to identify the default instruction needed to be retrieved for the project is_default: bool = False scope: Literal["sql", "answer", "chart"] = "sql" class Error(BaseModel): code: Literal["OTHERS"] message: str class Event(BaseModel, MetadataTraceable): event_id: str status: Literal["indexing", "deleting", "finished", "failed"] = "indexing" error: Optional["InstructionsService.Error"] = None trace_id: Optional[str] = None request_from: Literal["ui", "api"] = "ui" def __init__( self, pipelines: Dict[str, BasicPipeline], maxsize: int = 1_000_000, ttl: int = 120, ): self._pipelines = pipelines self._cache: Dict[str, self.Event] = TTLCache(maxsize=maxsize, ttl=ttl) # todo: move it to utils for super class? def _handle_exception( self, id: str, error_message: str, code: str = "OTHERS", trace_id: Optional[str] = None, request_from: Literal["ui", "api"] = "ui", ): self._cache[id] = self.Event( event_id=id, status="failed", error=self.Error(code=code, message=error_message), trace_id=trace_id, request_from=request_from, ) logger.error(error_message) class IndexRequest(BaseRequest): event_id: str instructions: List["InstructionsService.Instruction"] @observe(name="Index Instructions") @trace_metadata async def index( self, request: IndexRequest, **kwargs, ): logger.info( f"Request {request.event_id}: Instructions Indexing process is running..." ) trace_id = kwargs.get("trace_id") try: instructions = [] for instruction in request.instructions: if instruction.is_default: instructions.append( Instruction( id=instruction.id, instruction=instruction.instruction, question="", is_default=True, scope=instruction.scope, ) ) else: for question in instruction.questions: instructions.append( Instruction( id=instruction.id, instruction=instruction.instruction, question=question, is_default=False, scope=instruction.scope, ) ) await self._pipelines["instructions_indexing"].run( project_id=request.project_id, instructions=instructions, ) self._cache[request.event_id] = self.Event( event_id=request.event_id, status="finished", trace_id=trace_id, request_from=request.request_from, ) except Exception as e: self._handle_exception( request.event_id, f"An error occurred during instructions indexing: {str(e)}", trace_id=trace_id, request_from=request.request_from, ) return self._cache[request.event_id].with_metadata() class DeleteRequest(BaseRequest): event_id: str instruction_ids: List[str] @observe(name="Delete Instructions") @trace_metadata async def delete( self, request: DeleteRequest, **kwargs, ): logger.info( f"Request {request.event_id}: Instructions Deletion process is running..." ) trace_id = kwargs.get("trace_id") try: instructions = [Instruction(id=id) for id in request.instruction_ids] await self._pipelines["instructions_indexing"].clean( instructions=instructions, project_id=request.project_id ) self._cache[request.event_id] = self.Event( event_id=request.event_id, status="finished", trace_id=trace_id, request_from=request.request_from, ) except Exception as e: self._handle_exception( request.event_id, f"Failed to delete instructions: {e}", trace_id=trace_id, request_from=request.request_from, ) return self._cache[request.event_id].with_metadata() def __getitem__(self, event_id: str) -> Event: response = self._cache.get(event_id) if response is None: message = f"Instructions Event with ID '{event_id}' not found." logger.exception(message) return self.Event( event_id=event_id, status="failed", error=self.Error(code="OTHERS", message=message), ) return response def __setitem__(self, event_id: str, value: Event): self._cache[event_id] = value ================================================ FILE: wren-ai-service/src/web/v1/services/question_recommendation.py ================================================ import asyncio import logging from typing import Dict, Literal, Optional import orjson from cachetools import TTLCache from langfuse.decorators import observe from pydantic import BaseModel from src.core.pipeline import BasicPipeline from src.utils import trace_metadata from src.web.v1.services import BaseRequest, MetadataTraceable logger = logging.getLogger("wren-ai-service") class QuestionRecommendation: class Error(BaseModel): code: Literal["OTHERS", "MDL_PARSE_ERROR", "RESOURCE_NOT_FOUND"] message: str class Event(BaseModel, MetadataTraceable): event_id: str status: Literal["generating", "finished", "failed"] = "generating" response: dict = {"questions": {}} error: Optional["QuestionRecommendation.Error"] = None trace_id: Optional[str] = None request_from: Literal["ui", "api"] = "ui" def __init__( self, pipelines: Dict[str, BasicPipeline], allow_sql_functions_retrieval: bool = True, maxsize: int = 1_000_000, ttl: int = 120, allow_sql_knowledge_retrieval: bool = True, ): self._pipelines = pipelines self._cache: Dict[str, QuestionRecommendation.Event] = TTLCache( maxsize=maxsize, ttl=ttl ) self._allow_sql_functions_retrieval = allow_sql_functions_retrieval self._allow_sql_knowledge_retrieval = allow_sql_knowledge_retrieval def _handle_exception( self, event_id: str, error_message: str, code: str = "OTHERS", trace_id: Optional[str] = None, request_from: Literal["ui", "api"] = "ui", ): self._cache[event_id] = self.Event( event_id=event_id, status="failed", error=self.Error(code=code, message=error_message), trace_id=trace_id, request_from=request_from, ) logger.error(error_message) @observe(name="Validate Question") async def _validate_question( self, candidate: dict, request_id: str, max_questions: int, max_categories: int, project_id: Optional[str] = None, allow_data_preview: bool = True, ): async def _document_retrieval() -> tuple[list[str], bool, bool, bool]: retrieval_result = await self._pipelines["db_schema_retrieval"].run( query=candidate["question"], project_id=project_id, ) _retrieval_result = retrieval_result.get("construct_retrieval_results", {}) documents = _retrieval_result.get("retrieval_results", []) table_ddls = [document.get("table_ddl") for document in documents] has_calculated_field = _retrieval_result.get("has_calculated_field", False) has_metric = _retrieval_result.get("has_metric", False) has_json_field = _retrieval_result.get("has_json_field", False) return table_ddls, has_calculated_field, has_metric, has_json_field async def _sql_pairs_retrieval() -> list[dict]: sql_pairs_result = await self._pipelines["sql_pairs_retrieval"].run( query=candidate["question"], project_id=project_id, ) sql_samples = sql_pairs_result["formatted_output"].get("documents", []) return sql_samples async def _instructions_retrieval() -> list[dict]: result = await self._pipelines["instructions_retrieval"].run( query=candidate["question"], project_id=project_id, scope="sql", ) instructions = result["formatted_output"].get("instructions", []) return instructions try: _document, sql_samples, instructions = await asyncio.gather( _document_retrieval(), _sql_pairs_retrieval(), _instructions_retrieval(), ) table_ddls, has_calculated_field, has_metric, has_json_field = _document if self._allow_sql_functions_retrieval: sql_functions = await self._pipelines["sql_functions_retrieval"].run( project_id=project_id, ) else: sql_functions = [] if self._allow_sql_knowledge_retrieval: sql_knowledge = await self._pipelines["sql_knowledge_retrieval"].run( project_id=project_id, ) else: sql_knowledge = None generated_sql = await self._pipelines["sql_generation"].run( query=candidate["question"], contexts=table_ddls, project_id=project_id, sql_samples=sql_samples, instructions=instructions, has_calculated_field=has_calculated_field, has_metric=has_metric, has_json_field=has_json_field, sql_functions=sql_functions, allow_data_preview=allow_data_preview, sql_knowledge=sql_knowledge, ) post_process = generated_sql["post_process"] if len(post_process["valid_generation_result"]) == 0: return post_process valid_sql = post_process["valid_generation_result"]["sql"] # Partial update the resource current = self._cache[request_id] questions = current.response["questions"] if ( candidate["category"] not in questions and len(questions) >= max_categories ): # Skip to update the question dictionary if it is already full return post_process currnet_category = questions.setdefault(candidate["category"], []) if len(currnet_category) >= max_questions: # Skip to update the questions for the category if it is already full return post_process currnet_category.append({**candidate, "sql": valid_sql}) return post_process except Exception as e: logger.error(f"Request {request_id}: Error validating question: {str(e)}") class Request(BaseRequest): event_id: str mdl: str previous_questions: list[str] = [] max_questions: int = 5 max_categories: int = 3 regenerate: bool = False allow_data_preview: bool = True async def _recommend(self, request: dict): resp = await self._pipelines["question_recommendation"].run(**request) questions = resp.get("normalized", {}).get("questions", []) validation_tasks = [ self._validate_question( question, request["event_id"], request["max_questions"], request["max_categories"], project_id=request["project_id"], allow_data_preview=request["allow_data_preview"], ) for question in questions ] await asyncio.gather(*validation_tasks, return_exceptions=True) @observe(name="Generate Question Recommendation") @trace_metadata async def recommend(self, input: Request, **kwargs) -> Event: logger.info( f"Request {input.event_id}: Generate Question Recommendation pipeline is running..." ) trace_id = kwargs.get("trace_id") try: mdl = orjson.loads(input.mdl) retrieval_result = await self._pipelines["db_schema_retrieval"].run( tables=[model["name"] for model in mdl["models"]], project_id=input.project_id, ) _retrieval_result = retrieval_result.get("construct_retrieval_results", {}) documents = _retrieval_result.get("retrieval_results", []) table_ddls = [document.get("table_ddl") for document in documents] request = { "contexts": table_ddls, "previous_questions": input.previous_questions, "language": input.configurations.language, "max_questions": input.max_questions, "max_categories": input.max_categories, "project_id": input.project_id, "event_id": input.event_id, "allow_data_preview": input.allow_data_preview, } await self._recommend(request) resource = self._cache[input.event_id] resource.trace_id = trace_id response = resource.response categories_count = { category: input.max_questions - len(questions) for category, questions in response["questions"].items() if len(questions) < input.max_questions } categories = list(categories_count.keys()) need_regenerate = len(categories) > 0 and input.regenerate resource.status = "generating" if need_regenerate else "finished" if resource.status == "finished": return resource.with_metadata() await self._recommend( { **request, "categories": categories, "max_categories": len(categories), }, ) self._cache[input.event_id].status = "finished" self._cache[input.event_id].request_from = input.request_from except orjson.JSONDecodeError as e: self._handle_exception( input.event_id, f"Failed to parse MDL: {str(e)}", code="MDL_PARSE_ERROR", trace_id=trace_id, request_from=input.request_from, ) except Exception as e: self._handle_exception( input.event_id, f"An error occurred during question recommendation generation: {str(e)}", trace_id=trace_id, request_from=input.request_from, ) return self._cache[input.event_id].with_metadata() def __getitem__(self, id: str) -> Event: response = self._cache.get(id) if response is None: message = f"Question Recommendation Resource with ID '{id}' not found." logger.exception(message) return self.Event( event_id=id, status="failed", error=self.Error(code="RESOURCE_NOT_FOUND", message=message), ) return response def __setitem__(self, id: str, value: Event): self._cache[id] = value ================================================ FILE: wren-ai-service/src/web/v1/services/relationship_recommendation.py ================================================ import logging from typing import Dict, Literal, Optional import orjson from cachetools import TTLCache from langfuse.decorators import observe from pydantic import BaseModel from src.core.pipeline import BasicPipeline from src.utils import trace_metadata from src.web.v1.services import BaseRequest, MetadataTraceable logger = logging.getLogger("wren-ai-service") class RelationshipRecommendation: class Input(BaseRequest): id: str mdl: str class Resource(BaseModel, MetadataTraceable): class Error(BaseModel): code: Literal["OTHERS", "MDL_PARSE_ERROR", "RESOURCE_NOT_FOUND"] message: str id: str status: Literal["generating", "finished", "failed"] = "generating" response: Optional[dict] = None error: Optional[Error] = None trace_id: Optional[str] = None request_from: Literal["ui", "api"] = "ui" def __init__( self, pipelines: Dict[str, BasicPipeline], maxsize: int = 1_000_000, ttl: int = 120, ): self._pipelines = pipelines self._cache: Dict[str, RelationshipRecommendation.Resource] = TTLCache( maxsize=maxsize, ttl=ttl ) def _handle_exception( self, input: Input, error_message: str, code: str = "OTHERS", trace_id: Optional[str] = None, request_from: Literal["ui", "api"] = "ui", ): self._cache[input.id] = self.Resource( id=input.id, status="failed", error=self.Resource.Error(code=code, message=error_message), trace_id=trace_id, request_from=request_from, ) logger.error(error_message) @observe(name="Generate Relationship Recommendation") @trace_metadata async def recommend(self, request: Input, **kwargs) -> Resource: logger.info("Generate Relationship Recommendation pipeline is running...") trace_id = kwargs.get("trace_id") try: mdl_dict = orjson.loads(request.mdl) input = { "mdl": mdl_dict, "language": request.configurations.language, } resp = await self._pipelines["relationship_recommendation"].run(**input) self._cache[request.id] = self.Resource( id=request.id, status="finished", response=resp.get("validated"), trace_id=trace_id, request_from=request.request_from, ) except orjson.JSONDecodeError as e: self._handle_exception( request, f"Failed to parse MDL: {str(e)}", code="MDL_PARSE_ERROR", trace_id=trace_id, request_from=request.request_from, ) except Exception as e: self._handle_exception( request, f"An error occurred during relationship recommendation generation: {str(e)}", trace_id=trace_id, request_from=request.request_from, ) return self._cache[request.id].with_metadata() def __getitem__(self, id: str) -> Resource: response = self._cache.get(id) if response is None: message = f"Relationship Recommendation Resource with ID '{id}' not found." logger.exception(message) return self.Resource( id=id, status="failed", error=self.Resource.Error(code="RESOURCE_NOT_FOUND", message=message), ) return response def __setitem__(self, id: str, value: Resource): self._cache[id] = value ================================================ FILE: wren-ai-service/src/web/v1/services/semantics_description.py ================================================ import asyncio import logging from typing import Dict, Literal, Optional import orjson from cachetools import TTLCache from langfuse.decorators import observe from pydantic import BaseModel from src.core.pipeline import BasicPipeline from src.utils import trace_metadata from src.web.v1.services import BaseRequest, MetadataTraceable logger = logging.getLogger("wren-ai-service") class SemanticsDescription: class Resource(BaseModel, MetadataTraceable): class Error(BaseModel): code: Literal["OTHERS", "MDL_PARSE_ERROR", "RESOURCE_NOT_FOUND"] message: str id: str status: Literal["generating", "finished", "failed"] = "generating" response: Optional[dict] = None error: Optional[Error] = None trace_id: Optional[str] = None request_from: Literal["ui", "api"] = "ui" def __init__( self, pipelines: Dict[str, BasicPipeline], maxsize: int = 1_000_000, ttl: int = 120, ): self._pipelines = pipelines self._cache: Dict[str, self.Resource] = TTLCache(maxsize=maxsize, ttl=ttl) def _handle_exception( self, id: str, error_message: str, code: str = "OTHERS", trace_id: Optional[str] = None, request_from: Literal["ui", "api"] = "ui", ): self[id] = self.Resource( id=id, status="failed", error=self.Resource.Error(code=code, message=error_message), trace_id=trace_id, request_from=request_from, ) logger.error(error_message) class GenerateRequest(BaseRequest): id: str selected_models: list[str] user_prompt: str mdl: str def _chunking( self, mdl_dict: dict, request: GenerateRequest, chunk_size: int = 50 ) -> list[dict]: template = { "user_prompt": request.user_prompt, "language": request.configurations.language, } chunks = [ { **model, "columns": model["columns"][i : i + chunk_size], } for model in mdl_dict["models"] if model["name"] in request.selected_models for i in range(0, len(model["columns"]), chunk_size) ] return [ { **template, "mdl": {"models": [chunk]}, "selected_models": [chunk["name"]], } for chunk in chunks ] async def _generate_task(self, request_id: str, chunk: dict): resp = await self._pipelines["semantics_description"].run(**chunk) output = resp.get("output") current = self[request_id] current.response = current.response or {} for key in output.keys(): if key not in current.response: current.response[key] = output[key] continue current.response[key]["columns"].extend(output[key]["columns"]) @observe(name="Generate Semantics Description") @trace_metadata async def generate(self, request: GenerateRequest, **kwargs) -> Resource: logger.info("Generate Semantics Description pipeline is running...") trace_id = kwargs.get("trace_id") try: mdl_dict = orjson.loads(request.mdl) chunks = self._chunking(mdl_dict, request) tasks = [self._generate_task(request.id, chunk) for chunk in chunks] await asyncio.gather(*tasks) self[request.id].status = "finished" self[request.id].trace_id = trace_id self[request.id].request_from = request.request_from except orjson.JSONDecodeError as e: self._handle_exception( request.id, f"Failed to parse MDL: {str(e)}", code="MDL_PARSE_ERROR", trace_id=trace_id, request_from=request.request_from, ) except Exception as e: self._handle_exception( request.id, f"An error occurred during semantics description generation: {str(e)}", trace_id=trace_id, request_from=request.request_from, ) return self[request.id].with_metadata() def __getitem__(self, id: str) -> Resource: response = self._cache.get(id) if response is None: message = f"Semantics Description Resource with ID '{id}' not found." logger.exception(message) return self.Resource( id=id, status="failed", error=self.Resource.Error(code="RESOURCE_NOT_FOUND", message=message), ) return response def __setitem__(self, id: str, value: Resource): self._cache[id] = value ================================================ FILE: wren-ai-service/src/web/v1/services/semantics_preparation.py ================================================ import asyncio import logging from typing import Dict, Literal, Optional from cachetools import TTLCache from langfuse.decorators import observe from pydantic import AliasChoices, BaseModel, Field from src.core.pipeline import BasicPipeline from src.utils import trace_metadata from src.web.v1.services import BaseRequest logger = logging.getLogger("wren-ai-service") # POST /v1/semantics-preparations class SemanticsPreparationRequest(BaseRequest): mdl: str # don't recommend to use id as a field name, but it's used in the API spec # so we need to support as a choice, and will remove it in the future mdl_hash: str = Field(validation_alias=AliasChoices("mdl_hash", "id")) class SemanticsPreparationResponse(BaseModel): # don't recommend to use id as a field name, but it's used in the API spec # so we need to support as a choice, and will remove it in the future mdl_hash: str = Field(serialization_alias="id") # GET /v1/semantics-preparations/{mdl_hash}/status class SemanticsPreparationStatusRequest(BaseModel): # don't recommend to use id as a field name, but it's used in the API spec # so we need to support as a choice, and will remove it in the future mdl_hash: str = Field(validation_alias=AliasChoices("mdl_hash", "id")) class SemanticsPreparationStatusResponse(BaseModel): class SemanticsPreparationError(BaseModel): code: Literal["OTHERS"] message: str status: Literal["indexing", "finished", "failed"] error: Optional[SemanticsPreparationError] = None class SemanticsPreparationService: def __init__( self, pipelines: Dict[str, BasicPipeline], maxsize: int = 1_000_000, ttl: int = 120, ): self._pipelines = pipelines self._prepare_semantics_statuses: Dict[ str, SemanticsPreparationStatusResponse ] = TTLCache(maxsize=maxsize, ttl=ttl) @observe(name="Prepare Semantics") @trace_metadata async def prepare_semantics( self, prepare_semantics_request: SemanticsPreparationRequest, **kwargs, ): results = { "metadata": { "error_type": "", "error_message": "", "request_from": prepare_semantics_request.request_from, }, } try: logger.info(f"MDL: {prepare_semantics_request.mdl}") input = { "mdl_str": prepare_semantics_request.mdl, "project_id": prepare_semantics_request.project_id, } tasks = [ self._pipelines[name].run(**input) for name in [ "db_schema", "historical_question", "table_description", "sql_pairs", "project_meta", ] ] await asyncio.gather(*tasks) self._prepare_semantics_statuses[ prepare_semantics_request.mdl_hash ] = SemanticsPreparationStatusResponse( status="finished", ) except Exception as e: logger.exception(f"Failed to prepare semantics: {e}") self._prepare_semantics_statuses[ prepare_semantics_request.mdl_hash ] = SemanticsPreparationStatusResponse( status="failed", error=SemanticsPreparationStatusResponse.SemanticsPreparationError( code="OTHERS", message=f"Failed to prepare semantics: {e}", ), ) results["metadata"]["error_type"] = "INDEXING_FAILED" results["metadata"]["error_message"] = str(e) return results def get_prepare_semantics_status( self, prepare_semantics_status_request: SemanticsPreparationStatusRequest ) -> SemanticsPreparationStatusResponse: if ( result := self._prepare_semantics_statuses.get( prepare_semantics_status_request.mdl_hash ) ) is None: logger.exception( f"id is not found for SemanticsPreparation: {prepare_semantics_status_request.mdl_hash}" ) return SemanticsPreparationStatusResponse( status="failed", error=SemanticsPreparationStatusResponse.SemanticsPreparationError( code="OTHERS", message="{prepare_semantics_status_request.id} is not found", ), ) return result @observe(name="Delete Semantics Documents") @trace_metadata async def delete_semantics(self, project_id: str, **kwargs): logger.info(f"Project ID: {project_id}, Deleting semantics documents...") tasks = [ self._pipelines[name].clean(project_id=project_id) for name in [ "db_schema", "historical_question", "table_description", "project_meta", ] ] + [ self._pipelines[name].clean( project_id=project_id, delete_all=True, ) for name in ["sql_pairs", "instructions"] ] await asyncio.gather(*tasks) ================================================ FILE: wren-ai-service/src/web/v1/services/sql_answer.py ================================================ import asyncio import logging from typing import Dict, Literal, Optional from cachetools import TTLCache from langfuse.decorators import observe from pydantic import BaseModel from src.core.pipeline import BasicPipeline from src.utils import trace_metadata from src.web.v1.services import BaseRequest, SSEEvent logger = logging.getLogger("wren-ai-service") # POST /v1/sql-answers class SqlAnswerRequest(BaseRequest): query: str sql: str sql_data: Dict custom_instruction: Optional[str] = None class SqlAnswerResponse(BaseModel): query_id: str # GET /v1/sql-answers/{query_id} class SqlAnswerResultRequest(BaseModel): query_id: str class SqlAnswerResultResponse(BaseModel): class SqlAnswerError(BaseModel): code: Literal["OTHERS"] message: str status: Literal["preprocessing", "succeeded", "failed"] num_rows_used_in_llm: Optional[int] = None error: Optional[SqlAnswerError] = None trace_id: Optional[str] = None class SqlAnswerService: def __init__( self, pipelines: Dict[str, BasicPipeline], maxsize: int = 1_000_000, ttl: int = 120, ): self._pipelines = pipelines self._sql_answer_results: Dict[str, SqlAnswerResultResponse] = TTLCache( maxsize=maxsize, ttl=ttl ) @observe(name="SQL Answer") @trace_metadata async def sql_answer( self, sql_answer_request: SqlAnswerRequest, **kwargs, ): trace_id = kwargs.get("trace_id") results = { "metadata": { "error": { "type": "", "message": "", }, "request_from": sql_answer_request.request_from, }, } try: query_id = sql_answer_request.query_id self._sql_answer_results[query_id] = SqlAnswerResultResponse( status="preprocessing", trace_id=trace_id, ) preprocessed_sql_data = self._pipelines["preprocess_sql_data"].run( sql_data=sql_answer_request.sql_data, )["preprocess"] if preprocessed_sql_data.get("num_rows_used_in_llm") == 0: results["metadata"]["error_type"] = "NO_DATA" results["metadata"]["error_message"] = "No data to answer" self._sql_answer_results[query_id] = SqlAnswerResultResponse( status="succeeded", num_rows_used_in_llm=preprocessed_sql_data.get("num_rows_used_in_llm"), trace_id=trace_id, ) asyncio.create_task( self._pipelines["sql_answer"].run( query=sql_answer_request.query, sql=sql_answer_request.sql, sql_data=preprocessed_sql_data.get("sql_data", {}), language=sql_answer_request.configurations.language, current_time=sql_answer_request.configurations.show_current_time(), query_id=query_id, custom_instruction=sql_answer_request.custom_instruction, ) ) return results except Exception as e: logger.exception(f"sql answer pipeline - OTHERS: {e}") self._sql_answer_results[ sql_answer_request.query_id ] = SqlAnswerResultResponse( status="failed", error=SqlAnswerResultResponse.SqlAnswerError( code="OTHERS", message=str(e), ), trace_id=trace_id, ) results["metadata"]["error_type"] = "OTHERS" results["metadata"]["error_message"] = str(e) return results def get_sql_answer_result( self, sql_answer_result_request: SqlAnswerResultRequest, ) -> SqlAnswerResultResponse: if ( result := self._sql_answer_results.get(sql_answer_result_request.query_id) ) is None: logger.exception( f"sql answer pipeline - OTHERS: {sql_answer_result_request.query_id} is not found" ) return SqlAnswerResultResponse( status="failed", error=SqlAnswerResultResponse.SqlAnswerError( code="OTHERS", message=f"{sql_answer_result_request.query_id} is not found", ), ) return result async def get_sql_answer_streaming_result( self, query_id: str, ): if ( self._sql_answer_results.get(query_id) and self._sql_answer_results.get(query_id).status == "succeeded" ): async for chunk in self._pipelines["sql_answer"].get_streaming_results( query_id ): event = SSEEvent( data=SSEEvent.SSEEventMessage(message=chunk), ) yield event.serialize() ================================================ FILE: wren-ai-service/src/web/v1/services/sql_corrections.py ================================================ import logging from typing import List, Literal, Optional from cachetools import TTLCache from langfuse.decorators import observe from pydantic import BaseModel from src.core.pipeline import BasicPipeline from src.utils import trace_metadata from src.web.v1.services import BaseRequest, MetadataTraceable logger = logging.getLogger("wren-ai-service") class SqlCorrectionService: class Error(BaseModel): code: Literal["OTHERS"] message: str class Event(BaseModel, MetadataTraceable): event_id: str status: Literal["correcting", "finished", "failed"] = "correcting" response: Optional[str] = None error: Optional["SqlCorrectionService.Error"] = None invalid_sql: Optional[str] = None trace_id: Optional[str] = None request_from: Literal["ui", "api"] = "ui" def __init__( self, pipelines: dict[str, BasicPipeline], maxsize: int = 1_000_000, ttl: int = 120, allow_sql_knowledge_retrieval: bool = True, ): self._pipelines = pipelines self._cache: dict[str, self.Event] = TTLCache(maxsize=maxsize, ttl=ttl) self._allow_sql_knowledge_retrieval = allow_sql_knowledge_retrieval def _handle_exception( self, event_id: str, error_message: str, code: str = "OTHERS", invalid_sql: Optional[str] = None, trace_id: Optional[str] = None, request_from: Literal["ui", "api"] = "ui", ): self._cache[event_id] = self.Event( event_id=event_id, status="failed", error=self.Error(code=code, message=error_message), trace_id=trace_id, invalid_sql=invalid_sql, request_from=request_from, ) logger.error(error_message) class CorrectionRequest(BaseRequest): event_id: str sql: str error: str retrieved_tables: Optional[List[str]] = None use_dry_plan: bool = False allow_dry_plan_fallback: bool = True @observe(name="SQL Correction") @trace_metadata async def correct( self, request: CorrectionRequest, **kwargs, ): logger.info(f"Request {request.event_id}: SQL Correction process is running...") trace_id = kwargs.get("trace_id") event_id = request.event_id sql = request.sql error = request.error project_id = request.project_id retrieved_tables = request.retrieved_tables use_dry_plan = request.use_dry_plan allow_dry_plan_fallback = request.allow_dry_plan_fallback sql_knowledge = None try: _invalid = { "sql": sql, "error": error, } if not retrieved_tables: retrieved_tables = ( await self._pipelines["sql_tables_extraction"].run( sql=sql, ) )["post_process"] if self._allow_sql_knowledge_retrieval: sql_knowledge = await self._pipelines["sql_knowledge_retrieval"].run( project_id=project_id, ) documents = ( ( await self._pipelines["db_schema_retrieval"].run( project_id=project_id, tables=retrieved_tables, ) ) .get("construct_retrieval_results", {}) .get("retrieval_results", []) ) table_ddls = [document.get("table_ddl") for document in documents] res = await self._pipelines["sql_correction"].run( contexts=table_ddls, invalid_generation_result=_invalid, project_id=project_id, use_dry_plan=use_dry_plan, allow_dry_plan_fallback=allow_dry_plan_fallback, sql_knowledge=sql_knowledge, ) post_process = res["post_process"] valid = post_process["valid_generation_result"] invalid = post_process["invalid_generation_result"] if not valid: error_message = invalid["error"] self._handle_exception( event_id, f"An error occurred during SQL correction: {error_message}", trace_id=trace_id, invalid_sql=invalid["sql"], request_from=request.request_from, ) else: corrected = valid["sql"] self._cache[event_id] = self.Event( event_id=event_id, status="finished", trace_id=trace_id, response=corrected, request_from=request.request_from, ) except Exception as e: self._handle_exception( event_id, f"An error occurred during SQL correction: {str(e)}", trace_id=trace_id, request_from=request.request_from, ) return self._cache[event_id].with_metadata() def __getitem__(self, event_id: str) -> Event: response = self._cache.get(event_id) if response is None: message = f"SQL Correction Event with ID '{event_id}' not found." logger.exception(message) return self.Event( event_id=event_id, status="failed", error=self.Error(code="OTHERS", message=message), ) return response def __setitem__(self, event_id: str, value: Event): self._cache[event_id] = value ================================================ FILE: wren-ai-service/src/web/v1/services/sql_pairs.py ================================================ import logging from typing import Dict, List, Literal, Optional from cachetools import TTLCache from langfuse.decorators import observe from pydantic import BaseModel from src.core.pipeline import BasicPipeline from src.pipelines.indexing.sql_pairs import SqlPair from src.utils import trace_metadata from src.web.v1.services import BaseRequest, MetadataTraceable logger = logging.getLogger("wren-ai-service") class SqlPairsService: class Event(BaseModel, MetadataTraceable): class Error(BaseModel): code: Literal["OTHERS"] message: str id: str status: Literal["indexing", "deleting", "finished", "failed"] = "indexing" error: Optional[Error] = None trace_id: Optional[str] = None request_from: Literal["ui", "api"] = "ui" def __init__( self, pipelines: Dict[str, BasicPipeline], maxsize: int = 1_000_000, ttl: int = 120, ): self._pipelines = pipelines self._cache: Dict[str, self.Event] = TTLCache(maxsize=maxsize, ttl=ttl) def _handle_exception( self, id: str, error_message: str, code: str = "OTHERS", trace_id: Optional[str] = None, request_from: Literal["ui", "api"] = "ui", ): self._cache[id] = self.Event( id=id, status="failed", error=self.Event.Error(code=code, message=error_message), trace_id=trace_id, request_from=request_from, ) logger.error(error_message) class IndexRequest(BaseRequest): id: str sql_pairs: List[SqlPair] @observe(name="Prepare SQL Pairs") @trace_metadata async def index( self, request: IndexRequest, **kwargs, ): logger.info(f"Request {request.id}: SQL Pairs Indexing process is running...") trace_id = kwargs.get("trace_id") try: input = { "mdl_str": '{"models": [{"properties": {"boilerplate": "sql_pairs"}}]}', "project_id": request.project_id, "external_pairs": { "sql_pairs": [ sql_pair.model_dump() for sql_pair in request.sql_pairs ], }, } await self._pipelines["sql_pairs"].run(**input) self._cache[request.id] = self.Event( id=request.id, status="finished", trace_id=trace_id, request_from=request.request_from, ) except Exception as e: self._handle_exception( request.id, f"An error occurred during SQL pairs indexing: {str(e)}", trace_id=trace_id, request_from=request.request_from, ) return self._cache[request.id].with_metadata() class DeleteRequest(BaseRequest): id: str sql_pair_ids: List[str] @observe(name="Delete SQL Pairs") @trace_metadata async def delete( self, request: DeleteRequest, **kwargs, ): logger.info(f"Request {request.id}: SQL Pairs Deletion process is running...") try: sql_pairs = [SqlPair(id=id) for id in request.sql_pair_ids] await self._pipelines["sql_pairs"].clean( sql_pairs=sql_pairs, project_id=request.project_id ) self._cache[request.id] = self.Event( id=request.id, status="finished", request_from=request.request_from, ) except Exception as e: self._handle_exception( request.id, f"Failed to delete SQL pairs: {e}", request_from=request.request_from, ) return self._cache[request.id].with_metadata() def __getitem__(self, id: str) -> Event: response = self._cache.get(id) if response is None: message = f"SQL Pairs Event with ID '{id}' not found." logger.exception(message) return self.Event( id=id, status="failed", error=self.Event.Error(code="OTHERS", message=message), ) return response def __setitem__(self, id: str, value: Event): self._cache[id] = value ================================================ FILE: wren-ai-service/src/web/v1/services/sql_question.py ================================================ import asyncio import logging from typing import Dict, Literal, Optional from cachetools import TTLCache from langfuse.decorators import observe from pydantic import BaseModel from src.core.pipeline import BasicPipeline from src.utils import trace_metadata from src.web.v1.services import BaseRequest logger = logging.getLogger("wren-ai-service") # POST /v1/sql-questions class SqlQuestionRequest(BaseRequest): sqls: list[str] class SqlQuestionResponse(BaseModel): query_id: str # GET /v1/sql-questions/{query_id} class SqlQuestionResultRequest(BaseModel): query_id: str class SqlQuestionResultResponse(BaseModel): class SqlQuestionError(BaseModel): code: Literal["OTHERS"] message: str status: Literal["generating", "succeeded", "failed"] error: Optional[SqlQuestionError] = None questions: Optional[list[str]] = None trace_id: Optional[str] = None class SqlQuestionService: def __init__( self, pipelines: Dict[str, BasicPipeline], maxsize: int = 1_000_000, ttl: int = 120, ): self._pipelines = pipelines self._sql_question_results: Dict[str, SqlQuestionResultResponse] = TTLCache( maxsize=maxsize, ttl=ttl ) @observe(name="SQL Question") @trace_metadata async def sql_question( self, sql_question_request: SqlQuestionRequest, **kwargs, ): trace_id = kwargs.get("trace_id") results = { "sql_question_result": {}, "metadata": { "error_type": "", "error_message": "", }, "request_from": sql_question_request.request_from, } try: query_id = sql_question_request.query_id self._sql_question_results[query_id] = SqlQuestionResultResponse( status="generating", trace_id=trace_id, ) tasks = [ self._pipelines["sql_question_generation"].run( sql=sql, configuration=sql_question_request.configurations, ) for sql in sql_question_request.sqls ] sql_questions_results = await asyncio.gather(*tasks) sql_questions = [res["post_process"] for res in sql_questions_results] self._sql_question_results[query_id] = SqlQuestionResultResponse( status="succeeded", questions=sql_questions, trace_id=trace_id, ) results["sql_question_result"] = sql_questions return results except Exception as e: logger.exception(f"sql question pipeline - OTHERS: {e}") self._sql_question_results[ sql_question_request.query_id ] = SqlQuestionResultResponse( status="failed", error=SqlQuestionResultResponse.SqlQuestionError( code="OTHERS", message=str(e), ), trace_id=trace_id, ) results["metadata"]["error_type"] = "OTHERS" results["metadata"]["error_message"] = str(e) return results def get_sql_question_result( self, sql_question_result_request: SqlQuestionResultRequest, ) -> SqlQuestionResultResponse: if ( result := self._sql_question_results.get( sql_question_result_request.query_id ) ) is None: logger.exception( f"sql question pipeline - OTHERS: {sql_question_result_request.query_id} is not found" ) return SqlQuestionResultResponse( status="failed", error=SqlQuestionResultResponse.SqlQuestionError( code="OTHERS", message=f"{sql_question_result_request.query_id} is not found", ), ) return result ================================================ FILE: wren-ai-service/tests/__init__.py ================================================ ================================================ FILE: wren-ai-service/tests/data/book_2_mdl.json ================================================ { "catalog": "wrenai", "schema": "spider", "models": [ { "name": "book", "properties": {}, "refSql": "select * from \"wrenai\".spider.\"book_2-book\"", "columns": [ { "name": "Book_ID", "type": "INTEGER", "notNull": false, "isCalculated": false, "expression": "Book_ID", "properties": {} }, { "name": "Title", "type": "VARCHAR", "notNull": false, "isCalculated": false, "expression": "Title", "properties": {} }, { "name": "Issues", "type": "REAL", "notNull": false, "isCalculated": false, "expression": "Issues", "properties": {} }, { "name": "Writer", "type": "VARCHAR", "notNull": false, "isCalculated": false, "expression": "Writer", "properties": {} } ], "primaryKey": "" }, { "name": "publication", "properties": {}, "refSql": "select * from \"wrenai\".spider.\"book_2-publication\"", "columns": [ { "name": "Publication_ID", "type": "INTEGER", "notNull": false, "isCalculated": false, "expression": "Publication_ID", "properties": {} }, { "name": "Book_ID", "type": "INTEGER", "notNull": false, "isCalculated": false, "expression": "Book_ID", "properties": {} }, { "name": "Publisher", "type": "VARCHAR", "notNull": false, "isCalculated": false, "expression": "Publisher", "properties": {} }, { "name": "Publication_Date", "type": "VARCHAR", "notNull": false, "isCalculated": false, "expression": "Publication_Date", "properties": {} }, { "name": "Price", "type": "REAL", "notNull": false, "isCalculated": false, "expression": "Price", "properties": {} } ], "primaryKey": "" } ], "relationships": [], "metrics": [], "cumulativeMetrics": [], "enumDefinitions": [], "views": [ { "name": "book", "statement": "SELECT * FROM book", "properties": { "question": "How many books are there?", "summary": "Retrieve the number of books", "viewId": "fake-id-1" } } ], "macros": [] } ================================================ FILE: wren-ai-service/tests/data/config.test.yaml ================================================ type: llm provider: litellm_llm models: - model: gpt-4.1-nano-2025-04-14 alias: default kwargs: max_tokens: 4096 n: 1 seed: 0 temperature: 0 timeout: 120 --- type: embedder provider: litellm_embedder models: - model: text-embedding-3-large alias: default timeout: 120 --- type: engine provider: wren_ui endpoint: http://localhost:3000 --- type: document_store provider: qdrant location: http://localhost:6333 embedding_model_dim: 3072 timeout: 120 --- type: pipeline pipes: - name: indexing embedder: litellm_embedder.default document_store: qdrant - name: retrieval llm: litellm_llm.default embedder: litellm_embedder.default document_store: qdrant - name: historical_question_retrieval embedder: litellm_embedder.default document_store: qdrant - name: sql_generation llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: sql_correction llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: followup_sql_generation llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: sql_answer llm: litellm_llm.default engine: wren_ui - name: sql_explanation llm: litellm_llm.default - name: sql_regeneration llm: litellm_llm.default engine: wren_ui - name: semantics_description llm: litellm_llm.default - name: relationship_recommendation llm: litellm_llm.default engine: wren_ui - name: user_guide_assistance llm: litellm_llm.default - name: data_assistance llm: litellm_llm.default --- settings: host: 127.0.0.1 port: 5556 column_indexing_batch_size: 50 doc_endpoint: https://docs.getwren.ai is_oss: true table_retrieval_size: 10 table_column_retrieval_size: 1000 query_cache_maxsize: 1000 query_cache_ttl: 3600 langfuse_host: https://cloud.langfuse.com langfuse_enable: false logging_level: INFO development: false ================================================ FILE: wren-ai-service/tests/data/mock_pyproject.toml ================================================ [tool.poetry] version = "0.8.0-mock" ================================================ FILE: wren-ai-service/tests/data/pairs.json ================================================ { "test": [ { "id": "1", "question": "What is the book?", "sql": "SELECT * FROM book" }, { "id": "2", "question": "What is the author?", "sql": "SELECT * FROM author" } ] } ================================================ FILE: wren-ai-service/tests/locust/__init__.py ================================================ ================================================ FILE: wren-ai-service/tests/locust/config_users.json ================================================ [ { "user_class_name": "IndexingUser", "fixed_count": 0 }, { "user_class_name": "AskUser", "fixed_count": 0 }, { "user_class_name": "AskDetailsUser", "fixed_count": 0 }, { "user_class_name": "DummyUser", "fixed_count": 0 }, { "user_class_name": "DummyAskUser", "fixed_count": 100 } ] ================================================ FILE: wren-ai-service/tests/locust/locust.conf ================================================ locustfile = tests/locust/locustfile.py headless = true host = http://localhost:5556 users = 100 spawn-rate = 10 run-time = 60s config-users = tests/locust/config_users.json ================================================ FILE: wren-ai-service/tests/locust/locust_script.py ================================================ import json import os import time from pathlib import Path from src.utils import load_env_vars load_env_vars() filename = f"locust_report_{time.strftime("%Y%m%d_%H%M%S")}" if not Path("./outputs/locust").exists(): Path("./outputs/locust").mkdir(parents=True, exist_ok=True) os.system( f""" poetry run locust \ --config tests/locust/locust.conf \ --logfile outputs/locust/{filename}.log \ --html outputs/locust/{filename}.html \ --json > outputs/locust/{filename}.json """ ) with open(f"./outputs/locust/{filename}.json", "r") as f: test_results = json.load(f) formatted = { "llm provider": os.getenv("LLM_PROVIDER"), "generation model": os.getenv("GENERATION_MODEL"), "embedding model": os.getenv("EMBEDDING_MODEL"), "locustfile": "tests/locust/locustfile.py", "test results": test_results, } with open(f"./outputs/locust/{filename}.json", "w") as f: json.dump(formatted, f, indent=2) print(f"get the test results in {filename}.json and {filename}.html") ================================================ FILE: wren-ai-service/tests/locust/locustfile.py ================================================ import json import logging import os import time import uuid import orjson import requests from locust import FastHttpUser, events, task from src.utils import load_env_vars deployment_id = str(uuid.uuid4()) mdl_str = "" finished_ask_query = [] successful_ask_query = [] finished_ask_details_query = [] successful_ask_details_query = [] load_env_vars() with open(f"tests/data/{os.getenv("DATASET_NAME")}_mdl.json", "r") as f: mdl_str = orjson.dumps(json.load(f)).decode("utf-8") @events.test_start.add_listener def on_test_start(environment, **kwargs): logging.info(f"Using dataset: {os.getenv("DATASET_NAME")}") requests.post( f"{environment.host}/v1/semantics-preparations", json={ "mdl": mdl_str, "id": deployment_id, }, ) status = "indexing" while status == "indexing": response = requests.get( f"{environment.host}/v1/semantics-preparations/{deployment_id}/status", ) status = response.json()["status"] logging.info(f"Indexing status: {status}") logging.info("Indexing document completed. Start load testing.") @events.test_stop.add_listener def on_test_stop(environment, **kwargs): logging.info(f"Total finished ask queries: {len(finished_ask_query)}") logging.info(f"Total successful ask queries: {len(successful_ask_query)}") class IndexingUser(FastHttpUser): @task def indexing(self): semantics_preperation_id = str(uuid.uuid4()) with self.client.post( url="/v1/semantics-preparations", json={ "mdl": mdl_str, "id": semantics_preperation_id, }, catch_response=True, ) as response: try: assert response.status_code == 200 assert ( json.loads(response.content.decode("utf-8"))["id"] == semantics_preperation_id ) except AssertionError: response.failure(response.content.decode("utf-8")) status = "indexing" while status == "indexing": with self.client.get( url=f"/v1/semantics-preparations/{semantics_preperation_id}/status", catch_response=True, ) as response: try: assert response.status_code == 200 status = json.loads(response.content.decode("utf-8"))["status"] assert status in ["indexing", "finished"] response.success() time.sleep(1.0) except AssertionError: response.failure(response.content.decode("utf-8")) class AskUser(FastHttpUser): @task def ask(self): with self.client.post( url="/v1/asks", json={ "query": "How many books?", "id": deployment_id, }, catch_response=True, ) as response: query_id = json.loads(response.content.decode("utf-8"))["query_id"] try: assert response.status_code == 200 assert query_id != "" response.success() except AssertionError: response.failure(response.content.decode("utf-8")) status = "understanding" while status in ["understanding", "searching", "generating"]: with self.client.get( url=f"/v1/asks/{query_id}/result", catch_response=True, ) as response: try: assert response.status_code == 200 status = json.loads(response.content.decode("utf-8"))["status"] assert status in [ "understanding", "searching", "generating", "finished", ] response.success() if status == "finished": finished_ask_query.append(query_id) successful_ask_query.append(response.content.decode("utf-8")) else: time.sleep(1.0) except AssertionError: finished_ask_query.append(query_id) response.failure(response.content.decode("utf-8")) class DummyUser(FastHttpUser): @task def dummy(self): self.client.get(url="/dev/dummy") class DummyAskUser(FastHttpUser): @task def ask(self): with self.client.post( url="/dev/dummy-asks", json={ "query": "How many books?", "id": deployment_id, }, catch_response=True, ) as response: query_id = json.loads(response.content.decode("utf-8"))["query_id"] try: assert response.status_code == 200 assert query_id != "" response.success() except AssertionError: response.failure(response.content.decode("utf-8")) status = "understanding" while status in ["understanding", "searching", "generating"]: with self.client.get( url=f"/dev/dummy-asks/{query_id}/result", catch_response=True, ) as response: try: assert response.status_code == 200 status = json.loads(response.content.decode("utf-8"))["status"] assert status in [ "understanding", "searching", "generating", "finished", ] response.success() if status == "finished": finished_ask_query.append(query_id) successful_ask_query.append(response.content.decode("utf-8")) else: time.sleep(1.0) except AssertionError: finished_ask_query.append(query_id) response.failure(response.content.decode("utf-8")) ================================================ FILE: wren-ai-service/tests/pytest/__init__.py ================================================ ================================================ FILE: wren-ai-service/tests/pytest/eval/__init__.py ================================================ ================================================ FILE: wren-ai-service/tests/pytest/eval/test_metrics.py ================================================ import sys from pathlib import Path import pandas as pd import pytest from aioresponses import aioresponses from deepeval.test_case import LLMTestCase sys.path.append(f"{Path().parent.resolve()}") from eval.metrics import ( AccuracyMetric, AnswerRelevancyMetric, ContextualPrecisionMetric, ContextualRecallMetric, ContextualRelevancyMetric, FaithfulnessMetric, ) @pytest.fixture def engine_config(): return { "mdl_json": {}, "api_endpoint": "http://example.com/endpoint", "timeout": 10, } @pytest.fixture def test_case(): return LLMTestCase( input="This is a test case", actual_output="select foo, boo from t", expected_output="select foo, boo from t", context=["t.foo", "t.boo"], retrieval_context=["t.foo", "t.boo"], additional_metadata={}, ) @pytest.fixture def mocker(): with aioresponses() as m: yield m def _success_analysis_sql(m, engine_config, repeat=1): for _ in range(repeat): m.get( f"{engine_config['api_endpoint']}/v2/analysis/sql", payload=[ { "selectItems": [ { "exprSources": [ {"sourceDataset": "t", "sourceColumn": "foo"}, {"sourceDataset": "t", "sourceColumn": "boo"}, ] } ] } ], ) def _success_retrive_data(m, ibis_config, repeat=1): df = pd.DataFrame({"foo": ["a", "b"], "boo": [1, 2]}).to_dict(orient="split") for _ in range(repeat): m.post( f"{ibis_config['api_endpoint']}/v3/connector/{ibis_config['data_source']}/query?limit={ibis_config['limit']}", payload={ "data": df.get("data"), "columns": df.get("columns"), }, ) def test_accuracy_metric(test_case, mocker): ibis_config = { "api_endpoint": "http://example.com/endpoint", "data_source": "bigquery", "mdl_json": {}, "connection_info": { "project_id": "fake-id", "dataset_id": "fake-id", "credentials": "fake-credentials", }, "timeout": 10, "limit": 10, } _success_retrive_data(mocker, ibis_config, 2) metric = AccuracyMetric(ibis_config) metric.measure(test_case) assert metric.is_successful() assert metric.score == 1.0 def test_answer_relevancy_metric(engine_config, test_case, mocker): _success_analysis_sql(mocker, engine_config, 2) metric = AnswerRelevancyMetric(engine_config) metric.measure(test_case) assert metric.is_successful() assert metric.score == 1.0 def test_faithfulness_metric(engine_config, test_case, mocker): _success_analysis_sql(mocker, engine_config) metric = FaithfulnessMetric(engine_config) metric.measure(test_case) assert metric.is_successful() assert metric.score == 1.0 def test_contextual_relevancy_metric(test_case): metric = ContextualRelevancyMetric() metric.measure(test_case) assert metric.is_successful() assert metric.score == 1.0 def test_contextual_recall_metric(engine_config, test_case, mocker): _success_analysis_sql(mocker, engine_config) metric = ContextualRecallMetric(engine_config) metric.measure(test_case) assert metric.is_successful() assert metric.score == 1.0 def test_contextual_precision_metric(test_case): metric = ContextualPrecisionMetric() metric.measure(test_case) assert metric.is_successful() assert metric.score == 1.0 ================================================ FILE: wren-ai-service/tests/pytest/pipelines/__init__.py ================================================ ================================================ FILE: wren-ai-service/tests/pytest/pipelines/generation/__init__.py ================================================ ================================================ FILE: wren-ai-service/tests/pytest/pipelines/generation/test_ask.py ================================================ import json import orjson import pytest from src.pipelines.generation.followup_sql_generation import FollowUpSQLGeneration from src.pipelines.generation.sql_correction import SQLCorrection from src.pipelines.generation.sql_generation import SQLGeneration from src.pipelines.retrieval.db_schema_retrieval import DbSchemaRetrieval from src.web.v1.services import Configuration from src.web.v1.services.ask import AskHistory GLOBAL_DATA = { "contexts": None, } @pytest.fixture def mdl_str(): with open("tests/data/book_2_mdl.json", "r") as f: return orjson.dumps(json.load(f)).decode("utf-8") @pytest.fixture def pipeline_components(): from src.config import settings from src.providers import generate_components return generate_components(settings.components) @pytest.mark.skip( reason="Temporarily disabled as it depends on vector store and other tests" ) @pytest.mark.asyncio async def test_retrieval_pipeline(pipeline_components): retrieval_pipeline = DbSchemaRetrieval(**pipeline_components["db_schema_retrieval"]) retrieval_result = await retrieval_pipeline.run( "How many books are there?", ) assert retrieval_result is not None assert len(retrieval_result["construct_retrieval_results"]) > 0 GLOBAL_DATA["contexts"] = retrieval_result["construct_retrieval_results"] @pytest.mark.skip( reason="Temporarily disabled as it depends on vector store and other tests" ) @pytest.mark.asyncio async def test_generation_pipeline(): generation_pipeline = SQLGeneration(**pipeline_components["sql_generation"]) generation_result = await generation_pipeline.run( "How many authors are there?", contexts=GLOBAL_DATA["contexts"], configuration=Configuration(), ) # TODO: we'll refactor almost all test case with a mock server, thus temporarily only assert it is not None. assert generation_result["post_process"]["valid_generation_results"] is not None assert generation_result["post_process"]["invalid_generation_results"] is not None generation_result = await generation_pipeline.run( "How many authors are there?", contexts=GLOBAL_DATA["contexts"], configuration=Configuration(), ) assert generation_result["post_process"]["valid_generation_results"] is not None assert generation_result["post_process"]["invalid_generation_results"] is not None @pytest.mark.skip( reason="Temporarily disabled as it depends on vector store and other tests" ) @pytest.mark.asyncio async def test_followup_generation_pipeline(): generation_pipeline = FollowUpSQLGeneration( **pipeline_components["followup_sql_generation"] ) generation_result = await generation_pipeline.run( "What are names of the books?", contexts=GLOBAL_DATA["contexts"], history=AskHistory( sql="SELECT COUNT(*) FROM book", summary="Retrieve the number of books", ), configuration=Configuration(), ) # TODO: we'll refactor almost all test case with a mock server, thus temporarily only assert it is not None. assert generation_result["post_process"]["valid_generation_results"] is not None assert generation_result["post_process"]["invalid_generation_results"] is not None @pytest.mark.skip( reason="Temporarily disabled as it depends on vector store and other tests" ) @pytest.mark.asyncio async def test_sql_correction_pipeline(): sql_correction_pipeline = SQLCorrection(**pipeline_components["sql_correction"]) sql_correction_result = await sql_correction_pipeline.run( contexts=GLOBAL_DATA["contexts"], invalid_generation_results=[ { "sql": "Select count(*) from books", "summary": "Retrieve the number of books", "error": 'ERROR: com.google.cloud.bigquery.BigQueryException: Table "books" must be qualified with a dataset (e.g. dataset.table).', } ], ) assert isinstance( sql_correction_result["post_process"]["valid_generation_results"], list ) assert isinstance( sql_correction_result["post_process"]["invalid_generation_results"], list ) ================================================ FILE: wren-ai-service/tests/pytest/pipelines/generation/test_semantics_enrichment.py ================================================ from src.pipelines.generation.semantics_description import output def test_without_hallucination(): test_normalize = { "model1": { "name": "model1", "columns": [{"name": "column1"}], } } test_picked_models = [ { "name": "model1", "columns": [{"name": "column1"}], } ] result = output(test_normalize, test_picked_models) assert "model1" in result assert result["model1"]["name"] == "model1" assert len(result["model1"]["columns"]) == 1 assert result["model1"]["columns"][0]["name"] == "column1" def test_with_hallucination(): test_normalize = { "model1": { "name": "model1", "columns": [{"name": "column1"}, {"name": "$column2$"}], } } test_picked_models = [ { "name": "model1", "columns": [{"name": "column1"}, {"name": "column2"}], } ] result = output(test_normalize, test_picked_models) assert "model1" in result assert result["model1"]["name"] == "model1" assert len(result["model1"]["columns"]) == 1 assert result["model1"]["columns"][0]["name"] == "column1" def test_with_hallucination_and_no_columns(): test_normalize = { "model1": { "name": "model1", "columns": [{"name": "$column2$"}], } } test_picked_models = [ { "name": "model1", "columns": [{"name": "column1"}], } ] result = output(test_normalize, test_picked_models) assert "model1" in result assert result["model1"]["name"] == "model1" assert len(result["model1"]["columns"]) == 0 ================================================ FILE: wren-ai-service/tests/pytest/pipelines/indexing/__init__.py ================================================ ================================================ FILE: wren-ai-service/tests/pytest/pipelines/indexing/test_db_schema.py ================================================ from unittest.mock import AsyncMock import orjson import pytest from haystack import Document from pytest_mock import MockFixture from src.pipelines.indexing.db_schema import DBSchema, DDLChunker @pytest.mark.asyncio async def test_empty_mdl(): chunker = DDLChunker() mdl = {"models": [], "views": [], "relationships": [], "metrics": []} document = await chunker.run(mdl, column_batch_size=1) assert document == {"documents": []} @pytest.mark.asyncio async def test_single_model(): chunker = DDLChunker() mdl = { "models": [ { "name": "user", "properties": { "description": "A table containing user information.", "displayName": "user", }, } ], "views": [], "relationships": [], "metrics": [], } actual = await chunker.run(mdl, column_batch_size=1) assert len(actual["documents"]) == 1 document: Document = actual["documents"][0] assert document.meta == {"type": "TABLE_SCHEMA", "name": "user"} assert document.content == str( { "type": "TABLE", "comment": "\n/* {'alias': 'user', 'description': 'A table containing user information.'} */\n", "name": "user", } ) @pytest.mark.asyncio async def test_multiple_models(): chunker = DDLChunker() mdl = { "models": [ { "name": "user", "properties": { "description": "A table containing user information.", "displayName": "user", }, }, { "name": "order", "properties": { "description": "A table containing order details.", "displayName": "order", }, }, ], "views": [], "relationships": [], "metrics": [], } actual = await chunker.run(mdl, column_batch_size=1) assert len(actual["documents"]) == 2 document_1: Document = actual["documents"][0] assert document_1.meta == {"type": "TABLE_SCHEMA", "name": "user"} assert document_1.content == str( { "type": "TABLE", "comment": "\n/* {'alias': 'user', 'description': 'A table containing user information.'} */\n", "name": "user", } ) document_2: Document = actual["documents"][1] assert document_2.meta == {"type": "TABLE_SCHEMA", "name": "order"} assert document_2.content == str( { "type": "TABLE", "comment": "\n/* {'alias': 'order', 'description': 'A table containing order details.'} */\n", "name": "order", } ) @pytest.mark.asyncio async def test_column_is_primary_key(): chunker = DDLChunker() mdl = { "models": [ { "name": "user", "columns": [ { "name": "id", "type": "INTEGER", } ], "primaryKey": "id", } ], "views": [], "relationships": [], "metrics": [], } actual = await chunker.run(mdl, column_batch_size=1) assert len(actual["documents"]) == 2 document_0: Document = actual["documents"][0] assert document_0.meta == {"type": "TABLE_SCHEMA", "name": "user"} assert document_0.content == str( { "type": "TABLE_COLUMNS", "columns": [ { "type": "COLUMN", "comment": "", "name": "id", "data_type": "INTEGER", "is_primary_key": True, } ], } ) @pytest.mark.asyncio async def test_column_with_properties(): chunker = DDLChunker() mdl = { "models": [ { "name": "user", "columns": [ { "name": "id", "type": "INTEGER", "properties": { "displayName": "iid", "description": "The unique identifier for a user.", }, } ], } ], "views": [], "relationships": [], "metrics": [], } actual = await chunker.run(mdl, column_batch_size=1) assert len(actual["documents"]) == 2 document_0: Document = actual["documents"][0] assert document_0.meta == {"type": "TABLE_SCHEMA", "name": "user"} assert document_0.content == str( { "type": "TABLE_COLUMNS", "columns": [ { "type": "COLUMN", "comment": '-- {"alias":"iid","description":"The unique identifier for a user."}\n ', "name": "id", "data_type": "INTEGER", "is_primary_key": False, } ], } ) document_1: Document = actual["documents"][1] assert document_1.meta == {"type": "TABLE_SCHEMA", "name": "user"} assert document_1.content == str( { "type": "TABLE", "comment": "\n/* {'alias': '', 'description': ''} */\n", "name": "user", } ) @pytest.mark.asyncio async def test_column_with_nested_columns(): chunker = DDLChunker() mdl = { "models": [ { "name": "user", "columns": [ { "name": "id", "type": "INTEGER", "properties": { "displayName": "iid", "description": "The unique identifier for a user.", "nested.address": {"name": "address", "type": "VARCHAR"}, "nested.orders": {"name": "orders", "type": "ARRAY"}, }, } ], } ], "views": [], "relationships": [], "metrics": [], } actual = await chunker.run(mdl, column_batch_size=1) assert len(actual["documents"]) == 2 document_0: Document = actual["documents"][0] assert document_0.meta == {"type": "TABLE_SCHEMA", "name": "user"} assert document_0.content == str( { "type": "TABLE_COLUMNS", "columns": [ { "type": "COLUMN", "comment": '-- {"alias":"iid","description":"The unique identifier for a user.","nested_columns":{"nested.address":{"name":"address","type":"VARCHAR"},"nested.orders":{"name":"orders","type":"ARRAY"}}}\n ', "name": "id", "data_type": "INTEGER", "is_primary_key": False, } ], } ) @pytest.mark.asyncio async def test_column_with_calculated_property(): chunker = DDLChunker() mdl = { "models": [ { "name": "user", "columns": [ { "name": "id", "type": "INTEGER", "expression": "id + 1", "isCalculated": True, } ], } ], "views": [], "relationships": [], "metrics": [], } actual = await chunker.run(mdl, column_batch_size=1) assert len(actual["documents"]) == 2 document_0: Document = actual["documents"][0] assert document_0.meta == {"type": "TABLE_SCHEMA", "name": "user"} assert document_0.content == str( { "type": "TABLE_COLUMNS", "columns": [ { "type": "COLUMN", "comment": "-- This column is a Calculated Field\n -- column expression: id + 1\n ", "name": "id", "data_type": "INTEGER", "is_primary_key": False, } ], } ) @pytest.mark.asyncio async def test_column_with_relationship(): chunker = DDLChunker() mdl = { "models": [ { "name": "user", "columns": [ { "name": "id", "type": "INTEGER", }, { "name": "order_id", "type": "INTEGER", "relationship": "relationship_1", }, ], "primaryKey": "id", }, { "name": "order", "columns": [ { "name": "user_id", "type": "INTEGER", } ], "primaryKey": "user_id", }, ], "views": [], "relationships": [ { "name": "relationship_1", "condition": "user.id = order.user_id", "joinType": "ONE_TO_MANY", "models": ["user", "order"], } ], "metrics": [], } actual = await chunker.run(mdl, column_batch_size=1) assert len(actual["documents"]) == 6 document_0: Document = actual["documents"][0] assert document_0.meta == {"type": "TABLE_SCHEMA", "name": "user"} assert document_0.content == str( { "type": "TABLE_COLUMNS", "columns": [ { "type": "COLUMN", "comment": "", "name": "id", "data_type": "INTEGER", "is_primary_key": True, } ], } ) document_1: Document = actual["documents"][1] assert document_1.meta == {"type": "TABLE_SCHEMA", "name": "user"} assert document_1.content == str( { "type": "TABLE_COLUMNS", "columns": [ { "type": "FOREIGN_KEY", "comment": '-- {"condition": user.id = order.user_id, "joinType": ONE_TO_MANY}\n ', "constraint": "FOREIGN KEY (id) REFERENCES order(user_id)", "tables": ["user", "order"], } ], } ) document_4: Document = actual["documents"][4] assert document_4.meta == {"type": "TABLE_SCHEMA", "name": "order"} assert document_4.content == str( { "type": "TABLE_COLUMNS", "columns": [ { "type": "FOREIGN_KEY", "comment": '-- {"condition": user.id = order.user_id, "joinType": ONE_TO_MANY}\n ', "constraint": "FOREIGN KEY (user_id) REFERENCES user(id)", "tables": ["user", "order"], } ], } ) @pytest.mark.asyncio async def test_column_batch_size(): chunker = DDLChunker() mdl = { "models": [ { "name": "user", "columns": [ {"name": "id", "type": "INTEGER"}, {"name": "name", "type": "VARCHAR"}, {"name": "age", "type": "INTEGER"}, ], } ], "views": [], "relationships": [], "metrics": [], } actual = await chunker.run(mdl, column_batch_size=2) assert len(actual["documents"]) == 3 document_0: Document = actual["documents"][0] assert document_0.meta == {"type": "TABLE_SCHEMA", "name": "user"} assert document_0.content == str( { "type": "TABLE_COLUMNS", "columns": [ { "type": "COLUMN", "comment": "", "name": "id", "data_type": "INTEGER", "is_primary_key": False, }, { "type": "COLUMN", "comment": "", "name": "name", "data_type": "VARCHAR", "is_primary_key": False, }, ], } ) document_1: Document = actual["documents"][1] assert document_1.meta == {"type": "TABLE_SCHEMA", "name": "user"} assert document_1.content == str( { "type": "TABLE_COLUMNS", "columns": [ { "type": "COLUMN", "comment": "", "name": "age", "data_type": "INTEGER", "is_primary_key": False, } ], } ) @pytest.mark.asyncio async def test_view(): chunker = DDLChunker() mdl = { "models": [], "views": [{"name": "view_1", "statement": "SELECT * FROM user"}], "relationships": [], "metrics": [], } actual = await chunker.run(mdl, column_batch_size=1) assert len(actual["documents"]) == 1 document_0: Document = actual["documents"][0] assert document_0.meta == {"type": "TABLE_SCHEMA", "name": "view_1"} assert document_0.content == str( { "type": "VIEW", "comment": "", "name": "view_1", "statement": "SELECT * FROM user", } ) @pytest.mark.asyncio async def test_view_with_properties(): chunker = DDLChunker() mdl = { "models": [], "views": [ { "name": "view_1", "statement": "SELECT * FROM user", "properties": {"description": "A view containing user information."}, } ], "relationships": [], "metrics": [], } actual = await chunker.run(mdl, column_batch_size=1) assert len(actual["documents"]) == 1 document_0: Document = actual["documents"][0] assert document_0.meta == {"type": "TABLE_SCHEMA", "name": "view_1"} assert document_0.content == str( { "type": "VIEW", "comment": "/* {'description': 'A view containing user information.'} */\n", "name": "view_1", "statement": "SELECT * FROM user", } ) @pytest.mark.asyncio async def test_metric(): chunker = DDLChunker() mdl = { "models": [], "views": [], "relationships": [], "metrics": [ { "name": "metric_1", "baseObject": "user", "measure": [ {"name": "age", "type": "INTEGER", "expression": "SUM(age)"} ], "dimension": [ {"name": "gender", "type": "VARCHAR"}, ], } ], } actual = await chunker.run(mdl, column_batch_size=1) assert len(actual["documents"]) == 1 document_0: Document = actual["documents"][0] assert document_0.meta == {"type": "TABLE_SCHEMA", "name": "metric_1"} assert document_0.content == str( { "type": "METRIC", "comment": "\n/* This table is a metric */\n/* Metric Base Object: user */\n", "name": "metric_1", "columns": [ { "type": "COLUMN", "comment": "-- This column is a dimension\n ", "name": "gender", "data_type": "VARCHAR", }, { "type": "COLUMN", "comment": "-- This column is a measure\n -- expression: SUM(age)\n ", "name": "age", "data_type": "INTEGER", }, ], } ) @pytest.mark.asyncio async def test_pipeline_run(mocker: MockFixture): test_mdl = { "models": [ { "name": "user", "columns": [{"name": "id", "type": "INTEGER"}], "primaryKey": "id", }, { "name": "order", "columns": [{"name": "user_id", "type": "INTEGER"}], "primaryKey": "user_id", }, ], "views": [ { "name": "view_1", "statement": "SELECT * FROM user", } ], "relationships": [ { "name": "relationship_1", "condition": "user.id = order.user_id", "joinType": "ONE_TO_MANY", "models": ["user", "order"], } ], "metrics": [ { "name": "metric_1", "baseObject": "user", "measure": [ {"name": "age", "type": "INTEGER", "expression": "SUM(age)"} ], "dimension": [{"name": "gender", "type": "VARCHAR"}], } ], } # Mock embedder provider embedder_provider = mocker.patch("src.core.provider.EmbedderProvider") embedder = mocker.Mock() mocker.patch.object( embedder, "run", new_callable=AsyncMock, side_effect=lambda documents: {"documents": documents}, ) embedder_provider.get_document_embedder.return_value = embedder # Mock document store provider document_store = mocker.Mock() mocker.patch.object( document_store, "delete_documents", new_callable=AsyncMock, return_value=None ) mocker.patch.object( document_store, "write_documents", new_callable=AsyncMock, side_effect=lambda documents, *_, **__: len(documents), ) document_store_provider = mocker.patch("src.core.provider.DocumentStoreProvider") document_store_provider.get_store.return_value = document_store pipe = DBSchema( embedder_provider=embedder_provider, document_store_provider=document_store_provider, ) result = await pipe.run(orjson.dumps(test_mdl), project_id="test-project") assert result is not None assert result == {"write": {"documents_written": 6}} ================================================ FILE: wren-ai-service/tests/pytest/pipelines/indexing/test_helper.py ================================================ from pytest_mock import MockerFixture from src.pipelines.indexing.utils.helper import ( COLUMN_COMMENT_HELPERS, COLUMN_PREPROCESSORS, MODEL_PREPROCESSORS, Helper, load_helpers, ) def test_helper(): test_helper = Helper( condition=lambda x, **_: x.get("test", False), helper=lambda x, **_: x.get("value", ""), ) assert test_helper.condition({"test": True}) is True assert test_helper.condition({"test": False}) is False assert test_helper({"test": True, "value": "test_value"}) == "test_value" assert test_helper({"test": False, "value": "test_value"}) == "test_value" def test_column_properties_preprocessor(): helper = COLUMN_PREPROCESSORS["properties"] test_column = { "name": "test_column", "properties": {"displayName": "Test Column", "description": "Test description"}, } assert helper.condition(test_column) is True assert helper(test_column) == { "displayName": "Test Column", "description": "Test description", } def test_column_relationship_preprocessor(): helper = COLUMN_PREPROCESSORS["relationship"] test_column = { "name": "test_column", "relationship": "test_relationship", } assert helper.condition(test_column) is True assert helper(test_column) == "test_relationship" def test_column_expression_preprocessor(): helper = COLUMN_PREPROCESSORS["expression"] test_column = { "name": "test_column", "expression": "SUM(value)", } assert helper.condition(test_column) is True assert helper(test_column) == "SUM(value)" def test_column_is_calculated_preprocessor(): helper = COLUMN_PREPROCESSORS["isCalculated"] test_column = { "name": "test_column", "isCalculated": True, } assert helper.condition(test_column) is True assert helper(test_column) is True def test_properties_comment_helper(): helper = COLUMN_COMMENT_HELPERS["properties"] test_column = { "name": "test_column", "properties": { "displayName": "Test Column", "description": "Test description", }, } assert helper.condition(test_column) is True expected_comment = '-- {"alias":"Test Column","description":"Test description"}\n ' assert helper(test_column) == expected_comment def test_calculated_field_helpers(): helper = COLUMN_COMMENT_HELPERS["isCalculated"] test_column = { "name": "calculated_column", "isCalculated": True, "expression": "SUM(value)", } assert helper.condition(test_column) is True expected_comment = ( "-- This column is a Calculated Field\n -- column expression: SUM(value)\n " ) assert helper(test_column) == expected_comment def test_load_helpers(mocker: MockerFixture): mock_module = mocker.Mock() mock_module.__path__ = ["test/path"] mock_module.__name__ = "test.package" mocker.patch("pkgutil.walk_packages", return_value=[(None, "test_module", None)]) mock_test_module = mocker.Mock() mock_test_module.MODEL_PREPROCESSORS = {"test": "test_preprocessor"} mock_test_module.COLUMN_PREPROCESSORS = {"test": "test_column_preprocessor"} mock_test_module.COLUMN_COMMENT_HELPERS = {"test": "test_comment_helper"} mocker.patch("importlib.import_module", side_effect=[mock_module, mock_test_module]) load_helpers("test.package") assert len(MODEL_PREPROCESSORS) == 1 assert MODEL_PREPROCESSORS.get("test") == "test_preprocessor" del MODEL_PREPROCESSORS["test"] assert len(COLUMN_PREPROCESSORS) == 5 assert COLUMN_PREPROCESSORS.get("test") == "test_column_preprocessor" del COLUMN_PREPROCESSORS["test"] assert len(COLUMN_COMMENT_HELPERS) == 3 assert COLUMN_COMMENT_HELPERS.get("test") == "test_comment_helper" del COLUMN_COMMENT_HELPERS["test"] ================================================ FILE: wren-ai-service/tests/pytest/pipelines/indexing/test_historical_questions.py ================================================ import json from unittest.mock import AsyncMock import pytest from haystack import Document from pytest_mock import MockFixture from src.pipelines.indexing.historical_question import HistoricalQuestion, ViewChunker def test_empty_views(): chunker = ViewChunker() mdl = {"views": []} document = chunker.run(mdl) assert document == {"documents": []} def test_single_view(): chunker = ViewChunker() mdl = { "views": [ { "name": "book", "statement": "SELECT * FROM book", "properties": { "question": "How many books are there?", "summary": "Retrieve the number of books", "viewId": "fake-id-1", }, } ] } actual = chunker.run(mdl) assert len(actual["documents"]) == 1 document: Document = actual["documents"][0] assert document.meta == { "summary": "Retrieve the number of books", "statement": "SELECT * FROM book", "viewId": "fake-id-1", } assert document.content == "How many books are there?" def test_view_missing_properties(): chunker = ViewChunker() mdl = { "views": [ { "name": "book", "statement": "SELECT * FROM book", } ] } actual = chunker.run(mdl) assert len(actual["documents"]) == 1 document: Document = actual["documents"][0] assert document.meta == { "summary": "", "statement": "SELECT * FROM book", "viewId": "", } assert document.content == "" def test_view_missing_question(): chunker = ViewChunker() mdl = { "views": [ { "name": "book", "statement": "SELECT * FROM book", "properties": { "summary": "Retrieve the number of books", "viewId": "fake-id-1", }, } ] } actual = chunker.run(mdl) assert len(actual["documents"]) == 1 document: Document = actual["documents"][0] assert document.meta == { "summary": "Retrieve the number of books", "statement": "SELECT * FROM book", "viewId": "fake-id-1", } assert document.content == "" def test_view_missing_summary(): chunker = ViewChunker() mdl = { "views": [ { "name": "book", "statement": "SELECT * FROM book", "properties": { "question": "How many books are there?", "viewId": "fake-id-1", }, } ] } actual = chunker.run(mdl) assert len(actual["documents"]) == 1 document: Document = actual["documents"][0] assert document.meta == { "summary": "", "statement": "SELECT * FROM book", "viewId": "fake-id-1", } assert document.content == "How many books are there?" def test_view_missing_id(): chunker = ViewChunker() mdl = { "views": [ { "name": "book", "statement": "SELECT * FROM book", "properties": { "question": "How many books are there?", "summary": "Retrieve the number of books", }, } ] } actual = chunker.run(mdl) assert len(actual["documents"]) == 1 document: Document = actual["documents"][0] assert document.meta == { "summary": "Retrieve the number of books", "statement": "SELECT * FROM book", "viewId": "", } assert document.content == "How many books are there?" def test_multi_views(): chunker = ViewChunker() mdl = { "views": [ { "name": "book-1", "statement": "SELECT * FROM book", "properties": { "question": "How many books are there?", "summary": "Retrieve the number of books", "viewId": "fake-id-1", }, }, { "name": "book-2", "statement": "SELECT * FROM book", "properties": { "question": "How many books are there?", "summary": "Retrieve the number of books", "viewId": "fake-id-2", }, }, ] } actual = chunker.run(mdl) assert len(actual["documents"]) == 2 document_1: Document = actual["documents"][0] assert document_1.meta == { "summary": "Retrieve the number of books", "statement": "SELECT * FROM book", "viewId": "fake-id-1", } assert document_1.content == "How many books are there?" document_2: Document = actual["documents"][1] assert document_2.meta == { "summary": "Retrieve the number of books", "statement": "SELECT * FROM book", "viewId": "fake-id-2", } assert document_2.content == "How many books are there?" def test_view_with_historical_query(): chunker = ViewChunker() mdl = { "views": [ { "name": "book", "statement": "SELECT * FROM book where created_at = 2020", "properties": { "question": "in 2020", "summary": "Retrieve the number of books in 2020", "viewId": "fake-id-1", "historical_queries": ["Retrieve the number of books"], }, } ] } actual = chunker.run(mdl) assert len(actual["documents"]) == 1 document: Document = actual["documents"][0] assert document.meta == { "summary": "Retrieve the number of books in 2020", "statement": "SELECT * FROM book where created_at = 2020", "viewId": "fake-id-1", } assert document.content == "Retrieve the number of books in 2020" def test_view_with_historical_queries(): chunker = ViewChunker() mdl = { "views": [ { "name": "book", "statement": "SELECT * FROM book where city = 'taipei' and created_at = 2020", "properties": { "question": "in 2020", "summary": "Retrieve the number of books in taipei in 2020", "viewId": "fake-id-1", "historical_queries": ["Retrieve the number of books", "in taipei"], }, } ] } actual = chunker.run(mdl) assert len(actual["documents"]) == 1 document: Document = actual["documents"][0] assert document.meta == { "summary": "Retrieve the number of books in taipei in 2020", "statement": "SELECT * FROM book where city = 'taipei' and created_at = 2020", "viewId": "fake-id-1", } assert document.content == "Retrieve the number of books in taipei in 2020" def test_view_with_project_id(): chunker = ViewChunker() project_id = "test-project" mdl = { "views": [ { "name": "book", "statement": "SELECT * FROM book", "properties": { "question": "How many books are there?", "summary": "Retrieve the number of books", "viewId": "fake-id-1", }, } ] } actual = chunker.run(mdl, project_id=project_id) assert len(actual["documents"]) == 1 document: Document = actual["documents"][0] assert document.meta == { "summary": "Retrieve the number of books", "statement": "SELECT * FROM book", "viewId": "fake-id-1", "project_id": project_id, } assert document.content == "How many books are there?" @pytest.mark.asyncio async def test_pipeline_run(mocker: MockFixture): # Mock embedder provider embedder_provider = mocker.patch("src.core.provider.EmbedderProvider") embedder = mocker.Mock() mocker.patch.object( embedder, "run", new_callable=AsyncMock, side_effect=lambda documents: {"documents": documents}, ) embedder_provider.get_document_embedder.return_value = embedder # Mock document store provider document_store = mocker.Mock() mocker.patch.object( document_store, "delete_documents", new_callable=AsyncMock, return_value=None ) mocker.patch.object( document_store, "write_documents", new_callable=AsyncMock, side_effect=lambda documents, *_, **__: len(documents), ) document_store_provider = mocker.patch("src.core.provider.DocumentStoreProvider") document_store_provider.get_store.return_value = document_store pipeline = HistoricalQuestion( embedder_provider=embedder_provider, document_store_provider=document_store_provider, ) test_mdl = { "models": [], "views": [ { "name": "test_view", "statement": "SELECT * FROM test", "properties": { "question": "Test question?", "summary": "Test summary", "viewId": "test-id", }, } ], "relationships": [], "metrics": [], } result = await pipeline.run(json.dumps(test_mdl), project_id="test-project") assert result is not None assert result == {"write": {"documents_written": 1}} @pytest.mark.asyncio async def test_pipeline_run_embedder_error(mocker: MockFixture): # Mock embedder provider embedder_provider = mocker.patch("src.core.provider.EmbedderProvider") embedder = mocker.Mock() mocker.patch.object( embedder, "run", new_callable=AsyncMock, side_effect=Exception("Embedder error") ) embedder_provider.get_document_embedder.return_value = embedder # Mock document store provider document_store = mocker.Mock() mocker.patch.object( document_store, "delete_documents", new_callable=AsyncMock, return_value=None ) mocker.patch.object( document_store, "write_documents", new_callable=AsyncMock, side_effect=lambda documents, *_, **__: len(documents), ) document_store_provider = mocker.patch("src.core.provider.DocumentStoreProvider") document_store_provider.get_store.return_value = document_store pipeline = HistoricalQuestion( embedder_provider=embedder_provider, document_store_provider=document_store_provider, ) with pytest.raises(Exception) as excinfo: await pipeline.run(json.dumps({}), project_id="test-project") assert str(excinfo.value) == "Embedder error" ================================================ FILE: wren-ai-service/tests/pytest/pipelines/indexing/test_indexing.py ================================================ import pytest from haystack import Document from haystack.document_stores.types import DocumentStore from src.pipelines.indexing import AsyncDocumentWriter, DocumentCleaner, MDLValidator class MockDocumentStore(DocumentStore): """Mock document store for testing""" def __init__(self, documents=[]): self.documents = documents self.deleted = False async def write_documents(self, documents, policy): self.documents.extend(documents) return len(documents) async def delete_documents(self, filters=None): self.deleted = True self.documents = [] def to_dict(self): return {} @pytest.mark.asyncio async def test_document_cleaner(): store1 = MockDocumentStore(["document 1", "document 2"]) store2 = MockDocumentStore(["document 1", "document 2"]) cleaner = DocumentCleaner(stores=[store1, store2]) # Test without project_id await cleaner.run() assert store1.deleted assert store2.deleted # Test with project_id await cleaner.run(project_id="123") assert store1.deleted assert store2.deleted def test_mdl_validator(): validator = MDLValidator() # Test valid JSON with all fields valid_mdl = """ { "models": [], "views": [], "relationships": [], "metrics": [] } """ result = validator.run(valid_mdl) assert "mdl" in result assert all( key in result["mdl"] for key in ["models", "views", "relationships", "metrics"] ) # Test JSON missing fields minimal_mdl = "{}" result = validator.run(minimal_mdl) assert "mdl" in result assert all( key in result["mdl"] for key in ["models", "views", "relationships", "metrics"] ) # Test invalid JSON with pytest.raises(ValueError): validator.run("invalid json") @pytest.mark.asyncio async def test_async_document_writer(): store = MockDocumentStore() writer = AsyncDocumentWriter(document_store=store) docs = [Document(content="test1"), Document(content="test2")] result = await writer.run(documents=docs) assert result["documents_written"] == 2 assert len(store.documents) == 2 ================================================ FILE: wren-ai-service/tests/pytest/pipelines/indexing/test_instructions.py ================================================ import pytest from src.config import settings from src.core.provider import DocumentStoreProvider from src.pipelines.indexing import Instructions from src.pipelines.indexing.instructions import Instruction from src.providers import generate_components @pytest.mark.asyncio async def test_instructions_indexing(): pipe_components = generate_components(settings.components) document_store_provider: DocumentStoreProvider = pipe_components[ "instructions_indexing" ]["document_store_provider"] store = document_store_provider.get_store( dataset_name="instructions", recreate_index=True, ) instructions = Instructions(**pipe_components["instructions_indexing"]) test_instructions = [ Instruction( id="test-id-1", instruction="This is a test instruction", question="What is the test question?", is_default=False, ), Instruction( id="test-id-2", instruction="This is another test instruction", question="What is another test question?", is_default=True, ), ] await instructions.run( project_id="fake-id", instructions=test_instructions, ) assert await store.count_documents() == 2 documents = store.filter_documents() for document in documents: assert document.content, "content should not be empty" assert document.meta, "meta should not be empty" assert document.meta.get("instruction_id"), "instruction_id should be in meta" assert document.meta.get("instruction"), "instruction should be in meta" assert "is_default" in document.meta, "is_default should be in meta" @pytest.mark.asyncio async def test_instructions_indexing_with_multiple_project_ids(): pipe_components = generate_components(settings.components) document_store_provider: DocumentStoreProvider = pipe_components[ "instructions_indexing" ]["document_store_provider"] store = document_store_provider.get_store( dataset_name="instructions", recreate_index=True, ) instructions = Instructions(**pipe_components["instructions_indexing"]) test_instructions = [ Instruction( id="test-id-1", instruction="This is a test instruction", question="What is the test question?", ), ] await instructions.run( project_id="fake-id", instructions=test_instructions, ) await instructions.run( project_id="fake-id-2", instructions=test_instructions, ) assert await store.count_documents() == 2 documents = store.filter_documents( filters={ "operator": "AND", "conditions": [ {"field": "project_id", "operator": "==", "value": "fake-id"}, ], } ) assert len(documents) == 1 @pytest.mark.asyncio async def test_instructions_deletion(): pipe_components = generate_components(settings.components) document_store_provider: DocumentStoreProvider = pipe_components[ "instructions_indexing" ]["document_store_provider"] store = document_store_provider.get_store( dataset_name="instructions", recreate_index=True, ) instructions = Instructions(**pipe_components["instructions_indexing"]) test_instructions = [ Instruction( id="test-id-1", instruction="This is a test instruction", question="What is the test question?", ), Instruction( id="test-id-2", instruction="This is another test instruction", question="What is another test question?", ), ] await instructions.run( project_id="fake-id", instructions=test_instructions, ) await instructions.clean( instructions=[Instruction(id="test-id-1")], project_id="fake-id-2", ) assert await store.count_documents() == 2 await instructions.clean( instructions=[Instruction(id="test-id-1")], project_id="fake-id", ) assert await store.count_documents() == 1 await instructions.clean( instructions=[], delete_all=True, project_id="fake-id", ) assert await store.count_documents() == 0 ================================================ FILE: wren-ai-service/tests/pytest/pipelines/indexing/test_sql_pairs.py ================================================ import pytest from src.config import settings from src.core.provider import DocumentStoreProvider from src.pipelines.indexing import SqlPairs from src.providers import generate_components @pytest.mark.asyncio async def test_sql_pairs_indexing_saving_to_document_store(): pipe_components = generate_components(settings.components) document_store_provider: DocumentStoreProvider = pipe_components[ "sql_pairs_indexing" ]["document_store_provider"] store = document_store_provider.get_store( dataset_name="sql_pairs", recreate_index=True, ) sql_pairs = SqlPairs( **pipe_components["sql_pairs_indexing"], sql_pairs_path="tests/data/pairs.json" ) await sql_pairs.run( mdl_str='{"models": [{"properties": {"boilerplate": "test"}}]}', project_id="fake-id", ) assert await store.count_documents() == 2 documents = store.filter_documents() for document in documents: assert document.content, "content should not be empty" assert document.meta, "meta should not be empty" assert document.meta.get("sql_pair_id"), "sql_pair_id should be in meta" assert document.meta.get("sql"), "sql should be in meta" @pytest.mark.asyncio async def test_sql_pairs_indexing_saving_to_document_store_with_multiple_project_ids(): pipe_components = generate_components(settings.components) document_store_provider: DocumentStoreProvider = pipe_components[ "sql_pairs_indexing" ]["document_store_provider"] store = document_store_provider.get_store( dataset_name="sql_pairs", recreate_index=True, ) sql_pairs = SqlPairs( **pipe_components["sql_pairs_indexing"], sql_pairs_path="tests/data/pairs.json" ) await sql_pairs.run( mdl_str='{"models": [{"properties": {"boilerplate": "test"}}]}', project_id="fake-id", ) await sql_pairs.run( mdl_str='{"models": [{"properties": {"boilerplate": "test"}}]}', project_id="fake-id-2", ) assert await store.count_documents() == 4 documents = store.filter_documents( filters={ "operator": "AND", "conditions": [ {"field": "project_id", "operator": "==", "value": "fake-id"}, ], } ) assert len(documents) == 2 @pytest.mark.asyncio async def test_sql_pairs_deletion(): pipe_components = generate_components(settings.components) document_store_provider: DocumentStoreProvider = pipe_components[ "sql_pairs_indexing" ]["document_store_provider"] store = document_store_provider.get_store( dataset_name="sql_pairs", recreate_index=True, ) pipe = SqlPairs( **pipe_components["sql_pairs_indexing"], sql_pairs_path="tests/data/pairs.json" ) await pipe.run( mdl_str='{"models": [{"properties": {"boilerplate": "test"}}]}', project_id="fake-id", ) await pipe.clean(sql_pairs=[], project_id="fake-id-2") assert await store.count_documents() == 2 await pipe.clean(sql_pairs=[], project_id="fake-id") assert await store.count_documents() == 2 ================================================ FILE: wren-ai-service/tests/pytest/pipelines/indexing/test_table_description.py ================================================ from unittest.mock import AsyncMock import orjson import pytest from haystack import Document from pytest_mock import MockFixture from src.pipelines.indexing.table_description import ( TableDescription, TableDescriptionChunker, ) def test_empty_table_descriptions(): chunker = TableDescriptionChunker() mdl = {"models": [], "views": [], "relationships": [], "metrics": []} document = chunker.run(mdl) assert document == {"documents": []} def test_single_table_description(): chunker = TableDescriptionChunker() mdl = { "models": [ { "name": "user", "properties": {"description": "A table containing user information."}, } ], "views": [], "relationships": [], "metrics": [], } actual = chunker.run(mdl) assert len(actual["documents"]) == 1 document: Document = actual["documents"][0] assert document.meta == {"type": "TABLE_DESCRIPTION", "name": "user"} assert document.content == str( { "name": "user", "description": "A table containing user information.", "columns": "", } ) def test_multiple_table_descriptions(): chunker = TableDescriptionChunker() mdl = { "models": [ { "name": "user", "properties": {"description": "A table containing user information."}, }, { "name": "order", "properties": {"description": "A table containing order details."}, }, ], "views": [], "relationships": [], "metrics": [], } actual = chunker.run(mdl) assert len(actual["documents"]) == 2 document_1: Document = actual["documents"][0] assert document_1.meta == { "type": "TABLE_DESCRIPTION", "name": "user", } assert document_1.content == str( { "name": "user", "description": "A table containing user information.", "columns": "", } ) document_2: Document = actual["documents"][1] assert document_2.meta == {"type": "TABLE_DESCRIPTION", "name": "order"} assert document_2.content == str( { "name": "order", "description": "A table containing order details.", "columns": "", } ) def test_table_description_missing_name(): chunker = TableDescriptionChunker() mdl = { "models": [ { "properties": {"description": "A table without a name."}, } ], "views": [], "relationships": [], "metrics": [], } actual = chunker.run(mdl) assert len(actual["documents"]) == 0 def test_table_description_missing_description(): chunker = TableDescriptionChunker() mdl = { "models": [{"name": "user"}], "views": [], "relationships": [], "metrics": [], } actual = chunker.run(mdl) assert len(actual["documents"]) == 1 document: Document = actual["documents"][0] assert document.meta == {"type": "TABLE_DESCRIPTION", "name": "user"} assert document.content == str({"name": "user", "description": "", "columns": ""}) @pytest.mark.asyncio async def test_pipeline_run(mocker: MockFixture): test_mdl = { "models": [ { "name": "user", "properties": {"description": "A table containing user information."}, }, { "name": "order", "properties": {"description": "A table containing order details."}, }, ], "views": [], "relationships": [], "metrics": [], } # Mock embedder provider embedder_provider = mocker.patch("src.core.provider.EmbedderProvider") embedder = mocker.Mock() mocker.patch.object( embedder, "run", new_callable=AsyncMock, side_effect=lambda documents: {"documents": documents}, ) embedder_provider.get_document_embedder.return_value = embedder # Mock document store provider document_store = mocker.Mock() mocker.patch.object( document_store, "delete_documents", new_callable=AsyncMock, return_value=None ) mocker.patch.object( document_store, "write_documents", new_callable=AsyncMock, side_effect=lambda documents, *_, **__: len(documents), ) document_store_provider = mocker.patch("src.core.provider.DocumentStoreProvider") document_store_provider.get_store.return_value = document_store pipeline = TableDescription( embedder_provider=embedder_provider, document_store_provider=document_store_provider, ) result = await pipeline.run(orjson.dumps(test_mdl), project_id="test-project") assert result is not None assert result == {"write": {"documents_written": 2}} ================================================ FILE: wren-ai-service/tests/pytest/pipelines/retrieval/__init__.py ================================================ ================================================ FILE: wren-ai-service/tests/pytest/pipelines/retrieval/sql_function.py ================================================ from unittest.mock import AsyncMock, MagicMock import pytest from src.pipelines.retrieval.sql_functions import SqlFunction, SqlFunctions MOCK_FUNCTION_DEFINITION = { "name": "test_func", "param_types": "int,text", "return_type": "boolean", } MOCK_FUNCTION_LIST = [ {"name": "func1", "param_types": "int", "return_type": "text"}, {"name": "func2", "param_types": "text,text", "return_type": "boolean"}, ] @pytest.fixture def mock_engine(): engine = MagicMock() engine.get_func_list = AsyncMock(return_value=MOCK_FUNCTION_LIST) return engine @pytest.fixture def sql_functions_pipeline(mock_engine): return SqlFunctions(engine=mock_engine) def test_sql_function_init(): func = SqlFunction(MOCK_FUNCTION_DEFINITION) expected = "test_func($0: int, $1: text) -> boolean" assert str(func) == expected assert repr(func) == expected def test_sql_function_empty_params(): func = SqlFunction({"name": "test_func", "return_type": "text"}) assert str(func) == "test_func(any) -> text" @pytest.mark.asyncio async def test_sql_functions_pipeline_run(sql_functions_pipeline): result = await sql_functions_pipeline.run("postgres") assert len(result) == 2 assert str(result[0]) == "func1($0: int) -> text" assert str(result[1]) == "func2($0: text, $1: text) -> boolean" cached_result = await sql_functions_pipeline.run("postgres") assert result == cached_result sql_functions_pipeline._components["engine"].get_func_list.assert_called_once() @pytest.mark.asyncio async def test_sql_functions_pipeline_different_datasource(sql_functions_pipeline): await sql_functions_pipeline.run("postgres") await sql_functions_pipeline.run("mysql") assert sql_functions_pipeline._components["engine"].get_func_list.call_count == 2 @pytest.mark.asyncio async def test_sql_functions_pipeline_case_insensitive(sql_functions_pipeline): result1 = await sql_functions_pipeline.run("POSTGRES") result2 = await sql_functions_pipeline.run("postgres") assert sql_functions_pipeline._components["engine"].get_func_list.call_count == 1 assert result1 == result2 def test_sql_function_param_type_none(): func = SqlFunction( {"name": "test_func", "param_types": None, "return_type": "text"} ) assert str(func) == "test_func(any) -> text" def test_sql_function_return_type_none(): func = SqlFunction( {"name": "test_func", "param_types": "int,text", "return_type": None} ) assert str(func) == "test_func($0: int, $1: text) -> any" def test_sql_function_return_type_same_as_args(): func = SqlFunction( { "name": "test_func", "param_types": "int,text", "return_type": "same as arg types", } ) assert str(func) == "test_func($0: int, $1: text) -> ['int', 'text']" ================================================ FILE: wren-ai-service/tests/pytest/providers/__init__.py ================================================ ================================================ FILE: wren-ai-service/tests/pytest/providers/test_loader.py ================================================ from src.providers import loader def test_import_mods(): loader.import_mods("src.providers") assert len(loader.PROVIDERS) == 6 def test_get_provider(): loader.import_mods("src.providers") # llm provider provider = loader.get_provider("litellm_llm") assert provider.__name__ == "LitellmLLMProvider" # embedder provider provider = loader.get_provider("litellm_embedder") assert provider.__name__ == "LitellmEmbedderProvider" # document store provider provider = loader.get_provider("qdrant") assert provider.__name__ == "QdrantProvider" # engine provider provider = loader.get_provider("wren_ui") assert provider.__name__ == "WrenUI" provider = loader.get_provider("wren_ibis") assert provider.__name__ == "WrenIbis" provider = loader.get_provider("wren_engine") assert provider.__name__ == "WrenEngine" ================================================ FILE: wren-ai-service/tests/pytest/providers/test_providers.py ================================================ from pytest_mock import MockerFixture from src.core.engine import Engine from src.core.pipeline import PipelineComponent from src.core.provider import DocumentStoreProvider, EmbedderProvider, LLMProvider from src.providers import Configuration, generate_components, transform def test_transform(): config = [ { "type": "llm", "provider": "openai_llm", "models": [ {"model": "gpt-4", "kwargs": {"temperature": 0, "max_tokens": 4096}} ], }, { "type": "embedder", "provider": "openai_embedder", "models": [{"model": "text-embedding-ada-002", "dimension": 1536}], }, { "type": "document_store", "provider": "qdrant", "kwargs": {"host": "localhost", "port": 6333}, }, { "type": "engine", "provider": "wren_ui", "kwargs": {"host": "localhost", "port": 8000}, }, { "type": "pipeline", "pipes": [ { "name": "indexing", "llm": "openai_llm.gpt-4", "embedder": "openai_embedder.text-embedding-ada-002", "document_store": "qdrant", "engine": "wren_ui", } ], }, ] result = transform(config) assert isinstance(result, Configuration) assert "openai_llm.gpt-4" in result.providers["llm"] assert "openai_embedder.text-embedding-ada-002" in result.providers["embedder"] assert "qdrant" in result.providers["document_store"] assert "wren_ui" in result.providers["engine"] assert "indexing" in result.pipelines def test_generate_components(mocker: MockerFixture): # Mock the provider_factory to return mock objects mocker.patch( "src.providers.provider_factory", side_effect=[ mocker.Mock(spec=EmbedderProvider), mocker.Mock(spec=LLMProvider), mocker.Mock(spec=DocumentStoreProvider), mocker.Mock(spec=Engine), ], ) config = [ { "type": "llm", "provider": "openai_llm", "models": [{"model": "gpt-4", "kwargs": {}}], }, { "type": "embedder", "provider": "openai_embedder", "models": [{"model": "text-embedding-ada-002", "dimension": 1536}], }, {"type": "document_store", "provider": "qdrant", "kwargs": {}}, {"type": "engine", "provider": "wren_ui", "kwargs": {}}, { "type": "pipeline", "pipes": [ { "name": "indexing", "llm": "openai_llm.gpt-4", "embedder": "openai_embedder.text-embedding-ada-002", "document_store": "qdrant", "engine": "wren_ui", } ], }, ] result = generate_components(config) assert "indexing" in result assert isinstance(result["indexing"], PipelineComponent) assert isinstance(result["indexing"].embedder_provider, EmbedderProvider) assert isinstance(result["indexing"].llm_provider, LLMProvider) assert isinstance(result["indexing"].document_store_provider, DocumentStoreProvider) assert isinstance(result["indexing"].engine, Engine) ================================================ FILE: wren-ai-service/tests/pytest/services/__init__.py ================================================ ================================================ FILE: wren-ai-service/tests/pytest/services/mocks.py ================================================ from typing import Optional from src.pipelines import generation, retrieval from src.web.v1.services import Configuration from src.web.v1.services.ask import AskHistory class RetrievalMock(retrieval.DbSchemaRetrieval): def __init__(self, documents: list = []): self._documents = documents async def run(self, query: str, project_id: Optional[str] = None): return {"construct_retrieval_results": self._documents} class SqlPairsRetrievalMock(retrieval.SqlPairsRetrieval): def __init__(self, documents: list = []): self._documents = documents async def run(self, query: str, project_id: Optional[str] = None): return {"formatted_output": {"documents": self._documents}} class InstructionsRetrievalMock(retrieval.Instructions): def __init__(self, documents: list = []): self._documents = documents async def run(self, query: str, project_id: Optional[str] = None): return {"formatted_output": {"documents": self._documents}} class HistoricalQuestionMock(retrieval.HistoricalQuestionRetrieval): def __init__(self, documents: list = []): self._documents = documents async def run(self, query: str, project_id: Optional[str] = None): return {"formatted_output": {"documents": self._documents}} class IntentClassificationMock(generation.IntentClassification): def __init__(self, intent: str = "TEXT_TO_SQL"): self._intent = intent async def run( self, query: str, project_id: Optional[str] = None, histories: Optional[list[AskHistory]] = None, configuration: Configuration | None = None, sql_samples: Optional[list[dict]] = None, instructions: Optional[list[dict]] = None, ): return {"post_process": {"intent": self._intent, "db_schemas": []}} class GenerationMock(generation.SQLGeneration): def __init__(self, valid: list = [], invalid: list = []): self._valid = valid self._invalid = invalid async def run( self, query: str, contexts: list[str], exclude: list[dict], project_id: str | None = None, configuration: Configuration | None = None, ): return { "post_process": { "valid_generation_results": self._valid, "invalid_generation_results": self._invalid, } } ================================================ FILE: wren-ai-service/tests/pytest/services/test_ask.py ================================================ import json import uuid import orjson import pytest from src.config import settings from src.pipelines import generation, indexing, retrieval from src.providers import generate_components from src.utils import fetch_wren_ai_docs from src.web.v1.services.ask import ( AskRequest, AskResultRequest, AskService, ) from src.web.v1.services.semantics_preparation import ( SemanticsPreparationRequest, SemanticsPreparationService, ) @pytest.fixture def ask_service(): pipe_components = generate_components(settings.components) wren_ai_docs = fetch_wren_ai_docs(settings.doc_endpoint, settings.is_oss) return AskService( { "intent_classification": generation.IntentClassification( **pipe_components["intent_classification"], wren_ai_docs=wren_ai_docs, ), "misleading_assistance": generation.MisleadingAssistance( **pipe_components["misleading_assistance"], ), "data_assistance": generation.DataAssistance( **pipe_components["data_assistance"], ), "user_guide_assistance": generation.UserGuideAssistance( **pipe_components["user_guide_assistance"], wren_ai_docs=wren_ai_docs, ), "retrieval": retrieval.DbSchemaRetrieval( **pipe_components["db_schema_retrieval"], ), "historical_question": retrieval.HistoricalQuestionRetrieval( **pipe_components["historical_question_retrieval"], ), "sql_generation": generation.SQLGeneration( **pipe_components["sql_generation"], ), "sql_correction": generation.SQLCorrection( **pipe_components["sql_correction"], ), "sql_pairs_retrieval": retrieval.SqlPairsRetrieval( **pipe_components["sql_pairs_retrieval"], ), "instructions_retrieval": retrieval.Instructions( **pipe_components["instructions_retrieval"], ), } ) @pytest.fixture def indexing_service(): pipe_components = generate_components(settings.components) return SemanticsPreparationService( { "db_schema": indexing.DBSchema( **pipe_components["db_schema_indexing"], ), "historical_question": indexing.HistoricalQuestion( **pipe_components["historical_question_indexing"], ), "table_description": indexing.TableDescription( **pipe_components["table_description_indexing"], ), } ) @pytest.fixture def service_metadata(): return { "pipes_metadata": { "mock": { "generation_model": "mock-llm-model", "generation_model_kwargs": {}, "embedding_model": "mock-embedding-model", "embedding_model_dim": 768, }, }, "service_version": "0.8.0-mock", } @pytest.fixture def mdl_str(): with open("tests/data/book_2_mdl.json", "r") as f: return orjson.dumps(json.load(f)).decode("utf-8") @pytest.mark.asyncio async def test_ask_with_successful_query( indexing_service: SemanticsPreparationService, ask_service: AskService, mdl_str: str, service_metadata: dict, ): id = str(uuid.uuid4()) await indexing_service.prepare_semantics( SemanticsPreparationRequest( mdl=mdl_str, mdl_hash=id, ), service_metadata=service_metadata, ) # asking query_id = str(uuid.uuid4()) ask_request = AskRequest( query="How many books are there?", mdl_hash=id, ) ask_request.query_id = query_id await ask_service.ask(ask_request, service_metadata=service_metadata) # getting ask result ask_result_response = ask_service.get_ask_result( AskResultRequest( query_id=query_id, ) ) # from Pao Sheng: I think it has a potential risk if a dangling status case happens. # maybe we could consider adding an approach that if over a time limit, # the process will throw an exception. while ( ask_result_response.status != "finished" and ask_result_response.status != "failed" ): ask_result_response = ask_service.get_ask_result( AskResultRequest( query_id=query_id, ) ) # TODO: we'll refactor almost all test case with a mock server, thus temporarily only assert it is not None. assert ask_result_response.status == "finished" or "failed" # assert ask_result_response.response is not None # assert ask_result_response.response[0].sql != "" # assert ask_result_response.response[0].summary != "" # assert ask_result_response.response[0].type == "llm" or "view" ================================================ FILE: wren-ai-service/tests/pytest/services/test_instructions.py ================================================ import uuid import pytest from src.config import settings from src.core.provider import DocumentStoreProvider from src.globals import create_service_container from src.providers import generate_components from src.web.v1.services.instructions import InstructionsService @pytest.fixture def instructions_service(): pipe_components = generate_components(settings.components) service_container = create_service_container(pipe_components, settings) document_store_provider: DocumentStoreProvider = pipe_components[ "instructions_indexing" ]["document_store_provider"] document_store_provider.get_store( dataset_name="instructions", recreate_index=True, ) return service_container.instructions_service @pytest.mark.asyncio async def test_preparation( instructions_service: InstructionsService, ): id = str(uuid.uuid4()) instructions = [ InstructionsService.Instruction( id="1", instruction="This is a test instruction", questions=["What is the test question?"], is_default=False, ), InstructionsService.Instruction( id="2", instruction="This is another test instruction", questions=["What is another test question?"], is_default=True, ), ] request = InstructionsService.IndexRequest( event_id=id, instructions=instructions, project_id="fake-id", ) await instructions_service.index(request) response = instructions_service[id] assert response.status == "finished" pipe_components = generate_components(settings.components) document_store_provider: DocumentStoreProvider = pipe_components[ "instructions_indexing" ]["document_store_provider"] store = document_store_provider.get_store( dataset_name="instructions", ) assert await store.count_documents() == 2 @pytest.mark.asyncio async def test_with_empty_questions( instructions_service: InstructionsService, ): id = str(uuid.uuid4()) request = InstructionsService.IndexRequest( event_id=id, instructions=[ InstructionsService.Instruction( id="1", instruction="This is a test instruction", questions=[], is_default=False, ) ], project_id="fake-id", ) await instructions_service.index(request) response = instructions_service[id] assert response.status == "finished" # No documents should be indexed since there were no questions pipe_components = generate_components(settings.components) document_store_provider: DocumentStoreProvider = pipe_components[ "instructions_indexing" ]["document_store_provider"] store = document_store_provider.get_store( dataset_name="instructions", ) assert await store.count_documents() == 0 @pytest.mark.asyncio async def test_with_empty_instructions( instructions_service: InstructionsService, ): id = str(uuid.uuid4()) request = InstructionsService.IndexRequest( event_id=id, instructions=[], project_id="fake-id", ) await instructions_service.index(request) response = instructions_service[id] assert response.status == "finished" @pytest.mark.asyncio async def test_deletion( instructions_service: InstructionsService, ): id = str(uuid.uuid4()) instructions = [ InstructionsService.Instruction( id="1", instruction="This is a test instruction", questions=["What is the test question?"], is_default=False, ), InstructionsService.Instruction( id="2", instruction="This is another test instruction", questions=["What is another test question?"], is_default=True, ), ] index_request = InstructionsService.IndexRequest( event_id=id, instructions=instructions, project_id="fake-id", ) await instructions_service.index(index_request) response = instructions_service[id] assert response.status == "finished" id = str(uuid.uuid4()) delete_request = InstructionsService.DeleteRequest( event_id=id, instruction_ids=["1", "2"], project_id="fake-id", ) await instructions_service.delete(delete_request) response = instructions_service[id] assert response.status == "finished" pipe_components = generate_components(settings.components) document_store_provider: DocumentStoreProvider = pipe_components[ "instructions_indexing" ]["document_store_provider"] store = document_store_provider.get_store( dataset_name="instructions", ) assert await store.count_documents() == 0 @pytest.mark.asyncio async def test_delete_single_instruction( instructions_service: InstructionsService, ): id = str(uuid.uuid4()) instructions = [ InstructionsService.Instruction( id="1", instruction="This is a test instruction", questions=["What is the test question?"], is_default=False, ), InstructionsService.Instruction( id="2", instruction="This is another test instruction", questions=["What is another test question?"], is_default=True, ), ] index_request = InstructionsService.IndexRequest( event_id=id, instructions=instructions, project_id="fake-id", ) await instructions_service.index(index_request) response = instructions_service[id] assert response.status == "finished" id = str(uuid.uuid4()) delete_request = InstructionsService.DeleteRequest( event_id=id, instruction_ids=["1"], project_id="fake-id", ) await instructions_service.delete(delete_request) response = instructions_service[id] assert response.status == "finished" pipe_components = generate_components(settings.components) document_store_provider: DocumentStoreProvider = pipe_components[ "instructions_indexing" ]["document_store_provider"] store = document_store_provider.get_store( dataset_name="instructions", ) assert await store.count_documents() == 1 @pytest.mark.asyncio async def test_delete_cross_project_instruction( instructions_service: InstructionsService, ): async def index_instructions(project_id: str): id = str(uuid.uuid4()) instructions = [ InstructionsService.Instruction( id="1", instruction="This is a test instruction", questions=["What is the test question?"], is_default=False, ), ] index_request = InstructionsService.IndexRequest( event_id=id, instructions=instructions, project_id=project_id, ) await instructions_service.index(index_request) response = instructions_service[id] assert response.status == "finished" await index_instructions("project-a") await index_instructions("project-b") id = str(uuid.uuid4()) delete_request = InstructionsService.DeleteRequest( event_id=id, instruction_ids=["1"], project_id="project-a", ) await instructions_service.delete(delete_request) response = instructions_service[id] assert response.status == "finished" pipe_components = generate_components(settings.components) document_store_provider: DocumentStoreProvider = pipe_components[ "instructions_indexing" ]["document_store_provider"] store = document_store_provider.get_store(dataset_name="instructions") assert await store.count_documents() == 1 ================================================ FILE: wren-ai-service/tests/pytest/services/test_relationship_recommendation.py ================================================ from unittest.mock import AsyncMock import pytest from src.web.v1.services.relationship_recommendation import RelationshipRecommendation @pytest.fixture def mock_pipeline(): return AsyncMock() @pytest.fixture def relationship_recommendation_service(mock_pipeline): pipelines = {"relationship_recommendation": mock_pipeline} return RelationshipRecommendation(pipelines) @pytest.mark.asyncio async def test_recommend_success(relationship_recommendation_service, mock_pipeline): request = RelationshipRecommendation.Input(id="test_id", mdl='{"key": "value"}') mock_pipeline.run.return_value = {"validated": {"test": "data"}} await relationship_recommendation_service.recommend(request) response = relationship_recommendation_service[request.id] assert response.id == "test_id" assert response.status == "finished" assert response.response == {"test": "data"} mock_pipeline.run.assert_called_once_with(mdl={"key": "value"}, language="English") @pytest.mark.asyncio async def test_recommend_invalid_mdl(relationship_recommendation_service): request = RelationshipRecommendation.Input(id="test_id", mdl="invalid_json") await relationship_recommendation_service.recommend(request) response = relationship_recommendation_service[request.id] assert response.id == "test_id" assert response.status == "failed" assert response.error.code == "MDL_PARSE_ERROR" assert "Failed to parse MDL" in response.error.message @pytest.mark.asyncio async def test_recommend_pipeline_error( relationship_recommendation_service, mock_pipeline ): request = RelationshipRecommendation.Input(id="test_id", mdl='{"key": "value"}') mock_pipeline.run.side_effect = Exception("Pipeline error") await relationship_recommendation_service.recommend(request) response = relationship_recommendation_service[request.id] assert response.id == "test_id" assert response.status == "failed" assert response.error.code == "OTHERS" assert ( "An error occurred during relationship recommendation generation" in response.error.message ) def test_getitem_existing(relationship_recommendation_service): test_id = "test_id" expected_response = RelationshipRecommendation.Resource( id=test_id, status="finished" ) relationship_recommendation_service._cache[test_id] = expected_response response = relationship_recommendation_service[test_id] assert response == expected_response assert response.id == test_id assert response.status == "finished" def test_getitem_not_found(relationship_recommendation_service): id = "non_existent_id" response = relationship_recommendation_service[id] assert response.id == "non_existent_id" assert response.status == "failed" assert response.error.code == "RESOURCE_NOT_FOUND" assert "not found" in response.error.message def test_setitem(relationship_recommendation_service): id = "test_id" value = RelationshipRecommendation.Resource(id="test_id", status="finished") relationship_recommendation_service[id] = value assert relationship_recommendation_service._cache["test_id"] == value ================================================ FILE: wren-ai-service/tests/pytest/services/test_semantics_description.py ================================================ import asyncio from unittest.mock import AsyncMock import orjson import pytest from src.web.v1.services import SemanticsDescription @pytest.fixture def service(): mock_pipeline = AsyncMock() mock_pipeline.run.return_value = { "output": { "model1": { "columns": [], "properties": {"description": "Test description"}, } } } pipelines = {"semantics_description": mock_pipeline} return SemanticsDescription(pipelines=pipelines) @pytest.mark.asyncio async def test_generate_semantics_description( service: SemanticsDescription, ): service["test_id"] = SemanticsDescription.Resource(id="test_id") request = SemanticsDescription.GenerateRequest( id="test_id", user_prompt="Describe the model", selected_models=["model1"], mdl='{"models": [{"name": "model1", "columns": [{"name": "column1", "type": "varchar", "notNull": false}]}]}', ) await service.generate(request) response = service[request.id] assert response.id == "test_id" assert response.status == "finished" assert response.response == { "model1": { "columns": [], "properties": {"description": "Test description"}, } } assert response.error is None @pytest.mark.asyncio async def test_generate_semantics_description_with_invalid_mdl( service: SemanticsDescription, ): service["test_id"] = SemanticsDescription.Resource(id="test_id") request = SemanticsDescription.GenerateRequest( id="test_id", user_prompt="Describe the model", selected_models=["model1"], mdl="invalid_json", ) await service.generate(request) response = service[request.id] assert response.id == "test_id" assert response.status == "failed" assert response.response is None assert response.error.code == "MDL_PARSE_ERROR" assert "Failed to parse MDL" in response.error.message @pytest.mark.asyncio async def test_generate_semantics_description_with_exception( service: SemanticsDescription, ): service["test_id"] = SemanticsDescription.Resource(id="test_id") request = SemanticsDescription.GenerateRequest( id="test_id", user_prompt="Describe the model", selected_models=["model1"], mdl='{"models": [{"name": "model1", "columns": [{"name": "column1", "type": "varchar", "notNull": false}]}]}', ) service._pipelines["semantics_description"].run.side_effect = Exception( "Test exception" ) await service.generate(request) response = service[request.id] assert response.id == "test_id" assert response.status == "failed" assert response.response is None assert response.error.code == "OTHERS" assert ( "An error occurred during semantics description generation" in response.error.message ) def test_get_semantics_description_result( service: SemanticsDescription, ): expected_response = SemanticsDescription.Resource( id="test_id", status="finished", response={"model1": {"description": "Test description"}}, ) service["test_id"] = expected_response result = service["test_id"] assert result == expected_response def test_get_non_existent_semantics_description_result( service: SemanticsDescription, ): result = service["non_existent_id"] assert result.id == "non_existent_id" assert result.status == "failed" assert result.response is None assert result.error.code == "RESOURCE_NOT_FOUND" assert "not found" in result.error.message @pytest.mark.asyncio async def test_batch_processing_with_multiple_models( service: SemanticsDescription, ): service["test_id"] = SemanticsDescription.Resource(id="test_id") request = SemanticsDescription.GenerateRequest( id="test_id", user_prompt="Describe the models", selected_models=["model1", "model2", "model3"], mdl='{"models": [{"name": "model1", "columns": [{"name": "column1", "type": "varchar", "notNull": false}]}, {"name": "model2", "columns": [{"name": "column1", "type": "varchar", "notNull": false}]}, {"name": "model3", "columns": [{"name": "column1", "type": "varchar", "notNull": false}]}]}', ) # Mock pipeline responses for each chunk service._pipelines["semantics_description"].run.side_effect = [ {"output": {"model1": {"description": "Description 1"}}}, {"output": {"model2": {"description": "Description 2"}}}, {"output": {"model3": {"description": "Description 3"}}}, ] await service.generate(request) response = service[request.id] assert response.id == "test_id" assert response.status == "finished" assert response.response == { "model1": {"description": "Description 1"}, "model2": {"description": "Description 2"}, "model3": {"description": "Description 3"}, } chunks = service._chunking(orjson.loads(request.mdl), request) assert len(chunks) == 3 # Default chunk_size=1 assert all("user_prompt" in chunk for chunk in chunks) assert all("mdl" in chunk for chunk in chunks) assert [len(chunk["selected_models"]) for chunk in chunks] == [1, 1, 1] def test_batch_processing_with_custom_chunk_size( service: SemanticsDescription, ): service["test_id"] = SemanticsDescription.Resource(id="test_id") request = SemanticsDescription.GenerateRequest( id="test_id", user_prompt="Describe the models", selected_models=["model1", "model2", "model3", "model4"], mdl='{"models": [{"name": "model1", "columns": [{"name": "column1", "type": "varchar", "notNull": false}]}, {"name": "model2", "columns": [{"name": "column1", "type": "varchar", "notNull": false}]}, {"name": "model3", "columns": [{"name": "column1", "type": "varchar", "notNull": false}]}, {"name": "model4", "columns": [{"name": "column1", "type": "varchar", "notNull": false}]}]}', ) # Test chunking with custom chunk size chunks = service._chunking(orjson.loads(request.mdl), request, chunk_size=2) assert len(chunks) == 4 assert [len(chunk["selected_models"]) for chunk in chunks] == [1, 1, 1, 1] assert chunks[0]["selected_models"] == ["model1"] assert chunks[1]["selected_models"] == ["model2"] assert chunks[2]["selected_models"] == ["model3"] assert chunks[3]["selected_models"] == ["model4"] @pytest.mark.asyncio async def test_batch_processing_partial_failure( service: SemanticsDescription, ): service["test_id"] = SemanticsDescription.Resource(id="test_id") request = SemanticsDescription.GenerateRequest( id="test_id", user_prompt="Describe the models", selected_models=["model1", "model2"], mdl='{"models": [{"name": "model1", "columns": [{"name": "column1", "type": "varchar", "notNull": false}]}, {"name": "model2", "columns": [{"name": "column1", "type": "varchar", "notNull": false}]}]}', ) # Mock first chunk succeeds, second chunk fails service._pipelines["semantics_description"].run.side_effect = [ {"output": {"model1": {"description": "Description 1"}}}, Exception("Failed processing model2"), ] await service.generate(request) response = service[request.id] assert response.id == "test_id" assert response.status == "failed" assert response.error.code == "OTHERS" assert "Failed processing model2" in response.error.message @pytest.mark.asyncio async def test_concurrent_updates_no_race_condition( service: SemanticsDescription, ): test_id = "concurrent_test" service[test_id] = SemanticsDescription.Resource(id=test_id) request = SemanticsDescription.GenerateRequest( id=test_id, user_prompt="Test concurrent updates", selected_models=["model1", "model2", "model3", "model4", "model5"], mdl='{"models": [{"name": "model1", "columns": [{"name": "column1", "type": "varchar", "notNull": false}]}, {"name": "model2", "columns": [{"name": "column1", "type": "varchar", "notNull": false}]}, {"name": "model3", "columns": [{"name": "column1", "type": "varchar", "notNull": false}]}, {"name": "model4", "columns": [{"name": "column1", "type": "varchar", "notNull": false}]}, {"name": "model5", "columns": [{"name": "column1", "type": "varchar", "notNull": false}]}]}', ) # Mock pipeline responses with delays to simulate concurrent execution async def delayed_response(model_num, delay=0.1): await asyncio.sleep(delay) # Add delay to increase chance of race condition return { "output": {f"model{model_num}": {"description": f"Description {model_num}"}} } service._pipelines["semantics_description"].run.side_effect = [ await delayed_response(1), await delayed_response(2), await delayed_response(3), await delayed_response(4), await delayed_response(5), ] # Generate response which will process chunks concurrently await service.generate(request) response = service[request.id] assert response.status == "finished" assert response.response is not None assert len(response.response) == 5 assert all(f"model{i}" in response.response for i in range(1, 6)) assert all( response.response[f"model{i}"]["description"] == f"Description {i}" for i in range(1, 6) ) ================================================ FILE: wren-ai-service/tests/pytest/services/test_sql_pairs.py ================================================ import uuid import pytest from src.config import settings from src.core.provider import DocumentStoreProvider from src.globals import create_service_container from src.providers import generate_components from src.web.v1.services.sql_pairs import SqlPair, SqlPairsService @pytest.fixture def sql_pairs_service(): pipe_components = generate_components(settings.components) service_container = create_service_container(pipe_components, settings) document_store_provider: DocumentStoreProvider = pipe_components[ "sql_pairs_indexing" ]["document_store_provider"] document_store_provider.get_store( dataset_name="sql_pairs", recreate_index=True, ) return service_container.sql_pairs_service @pytest.mark.asyncio async def test_preparation( sql_pairs_service: SqlPairsService, ): id = str(uuid.uuid4()) sql_pairs = [ SqlPair(sql="SELECT * FROM book", id="1", question="What is the book?"), SqlPair(sql="SELECT * FROM author", id="2", question="What is the author?"), ] request = SqlPairsService.IndexRequest( id=id, sql_pairs=sql_pairs, project_id="fake-id", ) await sql_pairs_service.index(request) response = sql_pairs_service[id] assert response.status == "finished" pipe_components = generate_components(settings.components) document_store_provider: DocumentStoreProvider = pipe_components[ "sql_pairs_indexing" ]["document_store_provider"] store = document_store_provider.get_store( dataset_name="sql_pairs", ) assert await store.count_documents() == 2 @pytest.mark.asyncio async def test_with_empty_question( sql_pairs_service: SqlPairsService, ): id = str(uuid.uuid4()) request = SqlPairsService.IndexRequest( id=id, sql_pairs=[SqlPair(sql="SELECT * FROM book", id="1", question="")], project_id="fake-id", ) await sql_pairs_service.index(request) response = sql_pairs_service[id] assert response.status == "failed" assert response.error is not None assert response.error.code == "OTHERS" assert "error occurred during SQL pairs indexing" in response.error.message pipe_components = generate_components(settings.components) document_store_provider: DocumentStoreProvider = pipe_components[ "sql_pairs_indexing" ]["document_store_provider"] store = document_store_provider.get_store( dataset_name="sql_pairs", ) assert await store.count_documents() == 0 @pytest.mark.asyncio async def test_with_empty_sql_pairs( sql_pairs_service: SqlPairsService, ): id = str(uuid.uuid4()) request = SqlPairsService.IndexRequest( id=id, sql_pairs=[], project_id="fake-id", ) await sql_pairs_service.index(request) response = sql_pairs_service[id] assert response.status == "finished" @pytest.mark.asyncio async def test_deletion( sql_pairs_service: SqlPairsService, ): id = str(uuid.uuid4()) sql_pairs = [ SqlPair(sql="SELECT * FROM book", id="1", question="What is the book?"), SqlPair(sql="SELECT * FROM author", id="2", question="What is the author?"), ] index_request = SqlPairsService.IndexRequest( id=id, sql_pairs=sql_pairs, project_id="fake-id", ) await sql_pairs_service.index(index_request) response = sql_pairs_service[id] assert response.status == "finished" id = str(uuid.uuid4()) delete_request = SqlPairsService.DeleteRequest( id=id, sql_pair_ids=["1", "2"], project_id="fake-id", ) await sql_pairs_service.delete(delete_request) response = sql_pairs_service[id] assert response.status == "finished" pipe_components = generate_components(settings.components) document_store_provider: DocumentStoreProvider = pipe_components[ "sql_pairs_indexing" ]["document_store_provider"] store = document_store_provider.get_store( dataset_name="sql_pairs", ) assert await store.count_documents() == 0 @pytest.mark.asyncio async def test_delete_single_sql_pair( sql_pairs_service: SqlPairsService, ): id = str(uuid.uuid4()) sql_pairs = [ SqlPair(sql="SELECT * FROM book", id="1", question="What is the book?"), SqlPair(sql="SELECT * FROM author", id="2", question="What is the author?"), ] index_request = SqlPairsService.IndexRequest( id=id, sql_pairs=sql_pairs, project_id="fake-id", ) await sql_pairs_service.index(index_request) response = sql_pairs_service[id] assert response.status == "finished" id = str(uuid.uuid4()) delete_request = SqlPairsService.DeleteRequest( id=id, sql_pair_ids=["1"], project_id="fake-id", ) await sql_pairs_service.delete(delete_request) response = sql_pairs_service[id] assert response.status == "finished" pipe_components = generate_components(settings.components) document_store_provider: DocumentStoreProvider = pipe_components[ "sql_pairs_indexing" ]["document_store_provider"] store = document_store_provider.get_store( dataset_name="sql_pairs", ) assert await store.count_documents() == 1 @pytest.mark.asyncio async def test_delete_cross_project_sql_pair( sql_pairs_service: SqlPairsService, ): async def index_sql_pairs(project_id: str): id = str(uuid.uuid4()) sql_pairs = [ SqlPair(sql="SELECT * FROM book", id="1", question="What is the book?"), ] index_request = SqlPairsService.IndexRequest( id=id, sql_pairs=sql_pairs, project_id=project_id, ) await sql_pairs_service.index(index_request) response = sql_pairs_service[id] assert response.status == "finished" await index_sql_pairs("project-a") await index_sql_pairs("project-b") id = str(uuid.uuid4()) delete_request = SqlPairsService.DeleteRequest( id=id, sql_pair_ids=["1"], project_id="project-a", ) await sql_pairs_service.delete(delete_request) response = sql_pairs_service[id] assert response.status == "finished" pipe_components = generate_components(settings.components) document_store_provider: DocumentStoreProvider = pipe_components[ "sql_pairs_indexing" ]["document_store_provider"] store = document_store_provider.get_store(dataset_name="sql_pairs") assert await store.count_documents() == 1 ================================================ FILE: wren-ai-service/tests/pytest/test_config.py ================================================ from unittest.mock import mock_open, patch import yaml from src.config import Settings def test_settings_default_values(): with patch("src.config.Settings.config_loader", return_value=[]): settings = Settings() assert settings.host == "127.0.0.1" assert settings.port == 5555 assert settings.column_indexing_batch_size == 50 assert settings.table_retrieval_size == 10 assert settings.table_column_retrieval_size == 100 assert settings.query_cache_ttl == 3600 assert settings.query_cache_maxsize == 1_000_000 assert settings.langfuse_host == "https://cloud.langfuse.com" assert settings.langfuse_enable is True assert settings.logging_level == "INFO" assert settings.development is False assert settings.config_path == "config.yaml" def test_settings_env_var_override(): env_vars = { "WREN_AI_SERVICE_HOST": "0.0.0.0", "WREN_AI_SERVICE_PORT": "8000", "LOGGING_LEVEL": "DEBUG", } with patch("src.config.Settings.config_loader", return_value=[]), patch.dict( "os.environ", env_vars ): settings = Settings() assert settings.host == env_vars["WREN_AI_SERVICE_HOST"] assert settings.port == int(env_vars["WREN_AI_SERVICE_PORT"]) assert settings.logging_level == env_vars["LOGGING_LEVEL"] def test_settings_env_dev_override(): # Mock the content of .env.dev file mock_env_dev_content = """ WREN_AI_SERVICE_HOST=localhost WREN_AI_SERVICE_PORT=7000 LOGGING_LEVEL=WARNING """ # Mock the load_dotenv function with patch("src.config.Settings.config_loader", return_value=[]), patch( "src.config.load_dotenv" ) as mock_load_dotenv: # Set up the mock to load our custom environment variables def side_effect(path, override): import os for line in mock_env_dev_content.strip().split("\n"): key, value = line.strip().split("=") os.environ[key] = value mock_load_dotenv.side_effect = side_effect settings = Settings() assert settings.host == "localhost" assert settings.port == 7000 assert settings.logging_level == "WARNING" def test_settings_yaml_config_override(): # Mock YAML config content mock_yaml_content = """ settings: host: 192.168.1.100 port: 9000 column_indexing_batch_size: 75 table_retrieval_size: 15 logging_level: ERROR development: true """ # Patch the open function to return our mock YAML content with patch("builtins.open", mock_open(read_data=mock_yaml_content)): # Patch os.path.exists to return True for our config file with patch("os.path.exists", return_value=True): settings = Settings() assert settings.host == "192.168.1.100" assert settings.port == 9000 assert settings.column_indexing_batch_size == 75 assert settings.table_retrieval_size == 15 assert settings.logging_level == "ERROR" assert settings.development is True # Check that a value not in the YAML config remains at its default assert settings.query_cache_maxsize == 1_000_000 def test_settings_components(): mock_config_content = [ { "settings": { "host": "0.0.0.0", "port": 8000, "column_indexing_batch_size": 100, "table_retrieval_size": 20, "logging_level": "DEBUG", } }, { "type": "llm", "provider": "openai_llm", "models": [{"model": "gpt-4", "kwargs": {}}], }, ] with patch( "builtins.open", new_callable=mock_open, read_data=yaml.dump_all(mock_config_content), ): settings = Settings() assert len(settings._components) == 1 assert settings._components[0]["type"] == "llm" assert settings._components[0]["provider"] == "openai_llm" ================================================ FILE: wren-ai-service/tests/pytest/test_main.py ================================================ import json import os import uuid import orjson import pytest from fastapi.testclient import TestClient @pytest.fixture(scope="module", autouse=True) def app(): os.environ["CONFIG_PATH"] = "tests/data/config.test.yaml" from src.__main__ import app yield app # Clean up (if necessary) del os.environ["CONFIG_PATH"] GLOBAL_DATA = { "semantics_preperation_id": str(uuid.uuid4()), "query_id": None, } def test_semantics_preparation(app): with TestClient(app) as client: semantics_preperation_id = GLOBAL_DATA["semantics_preperation_id"] with open("tests/data/book_2_mdl.json", "r") as f: mdl_str = orjson.dumps(json.load(f)).decode("utf-8") response = client.post( url="/v1/semantics-preparations", json={ "mdl": mdl_str, "id": semantics_preperation_id, }, ) assert response.status_code == 200 assert response.json()["id"] == semantics_preperation_id status = "indexing" while status == "indexing": response = client.get( url=f"/v1/semantics-preparations/{semantics_preperation_id}/status" ) assert response.status_code == 200 assert response.json()["status"] in ["indexing", "finished", "failed"] status = response.json()["status"] assert status == "finished" def test_asks_with_successful_query(app): with TestClient(app) as client: semantics_preparation_id = GLOBAL_DATA["semantics_preperation_id"] response = client.post( url="/v1/asks", json={ "query": "How many books are there?", "id": semantics_preparation_id, }, ) assert response.status_code == 200 assert response.json()["query_id"] != "" query_id = response.json()["query_id"] GLOBAL_DATA["query_id"] = query_id response = client.get(url=f"/v1/asks/{query_id}/result") while ( response.json()["status"] != "finished" and response.json()["status"] != "failed" ): response = client.get(url=f"/v1/asks/{query_id}/result") # TODO: we'll refactor almost all test case with a mock server, thus temporarily only assert the status is finished or failed. assert response.status_code == 200 assert response.json()["status"] == "finished" or "failed" # for r in response.json()["response"]: # assert r["sql"] is not None and r["sql"] != "" # assert r["summary"] is not None and r["summary"] != "" def test_stop_asks(app): with TestClient(app) as client: query_id = GLOBAL_DATA["query_id"] response = client.patch( url=f"/v1/asks/{query_id}", json={ "status": "stopped", }, ) assert response.status_code == 200 assert response.json()["query_id"] == query_id response = client.get(url=f"/v1/asks/{query_id}/result") while response.json()["status"] != "stopped": response = client.get(url=f"/v1/asks/{query_id}/result") assert response.status_code == 200 assert response.json()["status"] == "stopped" def test_web_error_handler(app): with TestClient(app) as client: response = client.post( url="/v1/asks", json={}, ) assert response.status_code == 400 assert response.json()["detail"] != "" ================================================ FILE: wren-ai-service/tests/pytest/test_usecases.py ================================================ import argparse import asyncio import base64 import json import os import time import uuid from datetime import datetime import aiohttp import orjson import requests import sqlparse import yaml from dotenv import load_dotenv load_dotenv(".env.dev", override=True) WREN_AI_SERVICE_BASE_URL = "http://localhost:5556" WREN_ENGINE_API_URL = "http://localhost:8080" def _get_connection_info(data_source: str): if data_source == "bigquery": return { "project_id": os.getenv("bigquery.project-id"), "dataset_id": os.getenv("bigquery.dataset-id"), "credentials": os.getenv("bigquery.credentials-key"), } elif data_source == "postgres": return { "host": os.getenv("postgres.host"), "port": os.getenv("postgres.port"), "database": os.getenv("postgres.database"), "user": os.getenv("postgres.user"), "password": os.getenv("postgres.password"), } def _prepare_duckdb(dataset_name: str): assert dataset_name in ["ecommerce", "hr"] init_sqls = { "ecommerce": """ CREATE TABLE olist_customers_dataset AS FROM read_parquet('https://assets.getwren.ai/sample_data/brazilian-ecommerce/olist_customers_dataset.parquet'); CREATE TABLE olist_order_items_dataset AS FROM read_parquet('https://assets.getwren.ai/sample_data/brazilian-ecommerce/olist_order_items_dataset.parquet'); CREATE TABLE olist_orders_dataset AS FROM read_parquet('https://assets.getwren.ai/sample_data/brazilian-ecommerce/olist_orders_dataset.parquet'); CREATE TABLE olist_order_payments_dataset AS FROM read_parquet('https://assets.getwren.ai/sample_data/brazilian-ecommerce/olist_order_payments_dataset.parquet'); CREATE TABLE olist_products_dataset AS FROM read_parquet('https://assets.getwren.ai/sample_data/brazilian-ecommerce/olist_products_dataset.parquet'); CREATE TABLE olist_order_reviews_dataset AS FROM read_parquet('https://assets.getwren.ai/sample_data/brazilian-ecommerce/olist_order_reviews_dataset.parquet'); CREATE TABLE olist_geolocation_dataset AS FROM read_parquet('https://assets.getwren.ai/sample_data/brazilian-ecommerce/olist_geolocation_dataset.parquet'); CREATE TABLE olist_sellers_dataset AS FROM read_parquet('https://assets.getwren.ai/sample_data/brazilian-ecommerce/olist_sellers_dataset.parquet'); CREATE TABLE product_category_name_translation AS FROM read_parquet('https://assets.getwren.ai/sample_data/brazilian-ecommerce/product_category_name_translation.parquet'); """, "hr": """ CREATE TABLE salaries AS FROM read_parquet('https://assets.getwren.ai/sample_data/employees/salaries.parquet'); CREATE TABLE titles AS FROM read_parquet('https://assets.getwren.ai/sample_data/employees/titles.parquet'); CREATE TABLE dept_emp AS FROM read_parquet('https://assets.getwren.ai/sample_data/employees/dept_emp.parquet'); CREATE TABLE departments AS FROM read_parquet('https://assets.getwren.ai/sample_data/employees/departments.parquet'); CREATE TABLE employees AS FROM read_parquet('https://assets.getwren.ai/sample_data/employees/employees.parquet'); CREATE TABLE dept_manager AS FROM read_parquet('https://assets.getwren.ai/sample_data/employees/dept_manager.parquet'); """, } with open("./tools/dev/etc/duckdb-init.sql", "w") as f: f.write("") response = requests.put( f"{WREN_ENGINE_API_URL}/v1/data-source/duckdb/settings/init-sql", data=init_sqls[dataset_name], ) assert response.status_code == 200, response.text def _update_wren_engine_configs(configs: list[dict]): response = requests.patch( f"{WREN_ENGINE_API_URL}/v1/config", json=configs, ) assert response.status_code == 200 def _replace_wren_engine_env_variables(engine_type: str, data: dict): assert engine_type in ("wren_engine", "wren_ibis") with open("config.yaml", "r") as f: configs = list(yaml.safe_load_all(f)) for config in configs: if config.get("type") == "engine" and config.get("provider") == engine_type: for key, value in data.items(): config[key] = value if "pipes" in config: for i, pipe in enumerate(config["pipes"]): if "engine" in pipe and pipe["name"] != "sql_functions_retrieval": config["pipes"][i]["engine"] = engine_type with open("config.yaml", "w") as f: yaml.safe_dump_all(configs, f, default_flow_style=False) def is_ai_service_ready(url: str): try: response = requests.get(f"{url}/health") return response.status_code == 200 except requests.exceptions.ConnectionError: return False def test_load_mdl_and_questions(usecases: list[str]): mdls_and_questions = {} for usecase in usecases: try: with open(f"tests/data/usecases/{usecase}/mdl.json", "r") as f: mdl_str = orjson.dumps(json.load(f)).decode("utf-8") with open(f"tests/data/usecases/{usecase}/questions.yaml", "r") as f: questions = yaml.safe_load(f) mdls_and_questions[usecase] = { "mdl_str": mdl_str, "questions": [question["question"] for question in questions], } except FileNotFoundError: raise Exception( f"tests/data/usecases/{usecase}/mdl.json or tests/data/usecases/{usecase}/questions.yaml not found" ) return mdls_and_questions def setup_datasource(mdl_str: str, dataset: str, dataset_type: str, url: str): assert dataset_type in ["bigquery", "duckdb"] manifest = base64.b64encode(mdl_str.encode("utf-8")).decode("utf-8") if dataset_type == "bigquery": connection_info = _get_connection_info(dataset_type) _replace_wren_engine_env_variables( "wren_ibis", { "manifest": manifest, "source": dataset_type, "connection_info": base64.b64encode( orjson.dumps(connection_info) ).decode(), }, ) elif dataset_type == "duckdb": _update_wren_engine_configs( [ { "name": "duckdb.connector.init-sql-path", "value": "/usr/src/app/etc/duckdb-init.sql", }, ] ) _prepare_duckdb(dataset) _replace_wren_engine_env_variables("wren_engine", {"manifest": manifest}) ready = False while not ready: ready = is_ai_service_ready(url) time.sleep(1) def deploy_mdl(mdl_str: str, url: str): semantics_preperation_id = str(uuid.uuid4()) response = requests.post( f"{url}/v1/semantics-preparations", json={"mdl": mdl_str, "id": semantics_preperation_id}, ) assert response.status_code == 200 status = "indexing" while status == "indexing": response = requests.get( f"{url}/v1/semantics-preparations/{semantics_preperation_id}/status" ) assert response.status_code == 200 status = response.json()["status"] assert status == "finished" return semantics_preperation_id async def ask_question( question: str, url: str, semantics_preperation_id: str, lang: str = "English" ): print(f"preparing to ask question: {question}") async with aiohttp.ClientSession() as session: start = time.time() response = await session.post( f"{url}/v1/asks", json={ "query": question, "id": semantics_preperation_id, "configurations": {"language": lang}, }, ) assert response.status == 200 query_id = (await response.json())["query_id"] response = await session.get(f"{url}/v1/asks/{query_id}/result") while (await response.json())["status"] != "finished" and ( await response.json() )["status"] != "failed": response = await session.get(f"{url}/v1/asks/{query_id}/result") assert response.status == 200 result = await response.json() result["time"] = time.time() - start print(f"got the result of question: {question}") return result async def ask_questions( questions: list[str], url: str, semantics_preperation_id: str, lang: str = "English" ): tasks = [] for question in questions: task = asyncio.ensure_future( ask_question(question, url, semantics_preperation_id, lang) ) tasks.append(task) await asyncio.sleep(10) return await asyncio.gather(*tasks) def str_presenter(dumper, data): """configures yaml for dumping multiline strings Ref: https://stackoverflow.com/questions/8640959/how-can-i-control-what-scalar-form-pyyaml-uses-for-my-data""" if len(data.splitlines()) > 1: # check for multiline string return dumper.represent_scalar("tag:yaml.org,2002:str", data, style="|") return dumper.represent_scalar("tag:yaml.org,2002:str", data) if __name__ == "__main__": usecase_to_dataset_type = { "hubspot": "bigquery", "ga4": "bigquery", "woocommerce": "bigquery", "stripe": "bigquery", "ecommerce": "duckdb", # "hr": "duckdb", "facebook_marketing": "bigquery", "google_ads": "bigquery", } usecases = list(usecase_to_dataset_type.keys()) parser = argparse.ArgumentParser() parser.add_argument( "--usecases", type=str, nargs="+", default=["all"], choices=["all"] + usecases, ) parser.add_argument( "--lang", type=str, choices=["en", "zh-TW", "zh-CN"], default="en", ) args = parser.parse_args() if "all" not in args.usecases: usecases = args.usecases lang = { "en": "English", "zh-TW": "Traditional Chinese", "zh-CN": "Simplified Chinese", }[args.lang] assert is_ai_service_ready( WREN_AI_SERVICE_BASE_URL ), "WrenAI AI service is not running, please start it first via 'just up && just start'" mdls_and_questions_by_usecase = test_load_mdl_and_questions(usecases) final_results = {} for usecase, data in mdls_and_questions_by_usecase.items(): print(f"testing usecase: {usecase}") setup_datasource( data["mdl_str"], usecase, usecase_to_dataset_type[usecase], WREN_AI_SERVICE_BASE_URL, ) semantics_preperation_id = deploy_mdl(data["mdl_str"], WREN_AI_SERVICE_BASE_URL) # ask questions results = asyncio.run( ask_questions( data["questions"], WREN_AI_SERVICE_BASE_URL, semantics_preperation_id, lang, ) ) assert len(results) == len(data["questions"]) final_results[usecase] = { "results": [], } # count the number of results that are failed for question, result in zip(data["questions"], results): if ( result.get("status") == "finished" and not result.get("error") and result.get("response", []) ): result["response"][0]["sql"] = sqlparse.format( result["response"][0]["sql"], reindent=True, keyword_case="upper", ) final_results[usecase]["results"].append( { "question": question, "result": result, } ) final_results[usecase]["total"] = len(results) final_results[usecase]["failed"] = sum( 1 for result in results if result["status"] == "failed" ) # write final_results to a json file if not os.path.exists("outputs"): os.makedirs("outputs") with open( f"outputs/usecases_final_results_{datetime.now().strftime('%Y-%m-%d_%H-%M-%S')}.yaml", "w", ) as f: yaml.add_representer(str, str_presenter) yaml.representer.SafeRepresenter.add_representer( str, str_presenter ) # to use with safe_dum yaml.safe_dump(final_results, f, sort_keys=False, allow_unicode=True) ================================================ FILE: wren-ai-service/tests/pytest/test_utils.py ================================================ import asyncio import os from dataclasses import asdict import pytest from pytest_mock import MockFixture import src.utils as utils from src.core.pipeline import PipelineComponent from src.globals import ServiceMetadata, create_service_metadata from src.pipelines.indexing import clean_display_name def _mock(mocker: MockFixture) -> tuple: llm_provider = mocker.patch("src.core.provider.LLMProvider") mocker.patch( "src.core.provider.LLMProvider.get_model", return_value="mock-llm-model" ) mocker.patch( "src.core.provider.LLMProvider.get_model_kwargs", return_value={}, ) embedder_provider = mocker.patch("src.core.provider.EmbedderProvider") mocker.patch( "src.core.provider.EmbedderProvider.get_model", return_value="mock-embedding-model", ) mocker.patch( "src.core.provider.EmbedderProvider.get_model_dimension", return_value=768, ) return llm_provider, embedder_provider @pytest.fixture def service_metadata(mocker: MockFixture): current_path = os.path.dirname(__file__) return create_service_metadata( pipe_components={"mock": PipelineComponent(*_mock(mocker))}, pyproject_path=os.path.join(current_path, "../data/mock_pyproject.toml"), ) def test_service_metadata(service_metadata: ServiceMetadata): assert service_metadata.pipes_metadata == { "mock": { "llm_model": "mock-llm-model", "llm_model_kwargs": {}, "embedding_model": "mock-embedding-model", }, } assert service_metadata.service_version == "0.8.0-mock" def test_trace_metadata(service_metadata: ServiceMetadata, mocker: MockFixture): function = mocker.patch( "src.utils.langfuse_context.update_current_trace", return_value=None ) class Request: project_id = "mock-project-id" thread_id = "mock-thread-id" mdl_hash = "mock-mdl-hash" query = "mock-user-query" @utils.trace_metadata async def my_function(_: str, b: Request, **kwargs): return "Hello, World!" asyncio.run(my_function("", Request(), service_metadata=asdict(service_metadata))) function.assert_called_once_with( user_id=None, session_id="mock-thread-id", release=service_metadata.service_version, metadata={ "mdl_hash": "mock-mdl-hash", "project_id": "mock-project-id", "query": "mock-user-query", **service_metadata.pipes_metadata, }, ) def test_clean_display_name(): # Test empty and None cases assert clean_display_name("") == "" # Test simple valid names (should remain unchanged) assert clean_display_name("valid_name") == "valid_name" assert clean_display_name("ValidName") == "ValidName" assert clean_display_name("valid123") == "valid123" # Test prefix invalid characters - numbers and special chars assert clean_display_name("123name") == "_123name" assert clean_display_name("-name") == "_name" assert clean_display_name("&name") == "_name" assert clean_display_name("%name") == "_name" assert clean_display_name("=name") == "_name" assert clean_display_name("+name") == "_name" assert clean_display_name("'name") == "_name" assert clean_display_name('"name') == "_name" assert clean_display_name("name") == "_name" assert clean_display_name("#name") == "_name" assert clean_display_name("|name") == "_name" assert clean_display_name("!name") == "_name" assert clean_display_name("(name") == "_name" assert clean_display_name(")name") == "_name" assert clean_display_name("*name") == "_name" assert clean_display_name(",name") == "_name" assert clean_display_name("/name") == "_name" assert clean_display_name(".name") == "_name" assert clean_display_name(";name") == "_name" assert clean_display_name("[name") == "_name" assert clean_display_name("\\name") == "_name" assert clean_display_name("]name") == "_name" assert clean_display_name("^name") == "_name" assert clean_display_name("{name") == "_name" assert clean_display_name("}name") == "_name" assert clean_display_name("~name") == "_name" # Test middle invalid characters assert clean_display_name("na-me") == "na_me" assert clean_display_name("na&me") == "na_me" assert clean_display_name("na%me") == "na_me" assert clean_display_name("na=me") == "na_me" assert clean_display_name("na+me") == "na_me" assert clean_display_name("na'me") == "na_me" assert clean_display_name('na"me') == "na_me" assert clean_display_name("name") == "na_me" assert clean_display_name("na#me") == "na_me" assert clean_display_name("na|me") == "na_me" assert clean_display_name("na!me") == "na_me" assert clean_display_name("na(me") == "na_me" assert clean_display_name("na)me") == "na_me" assert clean_display_name("na/me") == "na_me" assert clean_display_name("na.me") == "na_me" assert clean_display_name("na?me") == "na_me" assert clean_display_name("na[me") == "na_me" assert clean_display_name("na\\me") == "na_me" assert clean_display_name("na]me") == "na_me" assert clean_display_name("na^me") == "na_me" assert clean_display_name("na`me") == "na_me" assert clean_display_name("na{me") == "na_me" assert clean_display_name("na}me") == "na_me" assert clean_display_name("na~me") == "na_me" # Test suffix invalid characters assert clean_display_name("name-") == "name_" assert clean_display_name("name&") == "name_" assert clean_display_name("name%") == "name_" assert clean_display_name("name=") == "name_" assert clean_display_name("name+") == "name_" assert clean_display_name("name:") == "name_" assert clean_display_name("name'") == "name_" assert clean_display_name('name"') == "name_" assert clean_display_name("name<") == "name_" assert clean_display_name("name>") == "name_" assert clean_display_name("name#") == "name_" assert clean_display_name("name|") == "name_" assert clean_display_name("name!") == "name_" assert clean_display_name("name(") == "name_" assert clean_display_name("name)") == "name_" assert clean_display_name("name,") == "name_" assert clean_display_name("name.") == "name_" assert clean_display_name("name/") == "name_" assert clean_display_name("name@") == "name_" assert clean_display_name("name[") == "name_" assert clean_display_name("name\\") == "name_" assert clean_display_name("name]") == "name_" assert clean_display_name("name^") == "name_" assert clean_display_name("name{") == "name_" assert clean_display_name("name}") == "name_" assert clean_display_name("name~") == "name_" # Test single character cases assert clean_display_name("1") == "_" assert clean_display_name("-") == "_" assert clean_display_name(".") == "_" assert clean_display_name("a") == "a" # valid single character # Test multiple consecutive underscores collapse assert ( clean_display_name("na--me") == "na_me" ) # middle chars become underscores, then collapsed assert ( clean_display_name("na..me") == "na_me" ) # dots become underscores, then collapsed # Test complex cases with multiple invalid characters assert clean_display_name("123-test.name@") == "_123_test_name_" assert clean_display_name(".table.name.") == "_table_name_" assert clean_display_name("!@#$%^&*()") == "_" # Test underscore collapsing in complex scenarios result = clean_display_name("!@#$%^&*()") assert result == "_" # All get replaced, then collapsed # Test real-world examples assert clean_display_name("user.email") == "user_email" assert ( clean_display_name("order-total") == "order_total" ) # prefix 'o' stays, '-' becomes '_' assert clean_display_name("2023_sales") == "_2023_sales" assert clean_display_name("product_name!") == "product_name_" ================================================ FILE: wren-ai-service/tools/.env.example ================================================ bigquery.project-id= bigquery.dataset-id= bigquery.credentials-key= postgres.host=postgres postgres.port=5432 postgres.database=test postgres.user=postgres postgres.password=postgres ================================================ FILE: wren-ai-service/tools/config/config.example.yaml ================================================ type: llm provider: litellm_llm timeout: 120 models: - alias: default model: gpt-4.1-nano-2025-04-14 context_window_size: 1000000 kwargs: max_tokens: 4096 n: 1 seed: 0 temperature: 0 - model: gpt-4.1-mini-2025-04-14 context_window_size: 1000000 kwargs: max_tokens: 4096 n: 1 seed: 0 temperature: 0 - model: gpt-4.1-2025-04-14 context_window_size: 1000000 kwargs: max_tokens: 4096 n: 1 seed: 0 temperature: 0 - model: gpt-5-nano-2025-08-07 context_window_size: 380000 kwargs: max_completion_tokens: 4096 n: 1 seed: 0 reasoning_effort: minimal - model: gpt-5-mini-2025-08-07 context_window_size: 380000 kwargs: max_completion_tokens: 4096 n: 1 seed: 0 reasoning_effort: minimal - model: gpt-5-2025-08-07 context_window_size: 380000 kwargs: max_completion_tokens: 4096 n: 1 seed: 0 reasoning_effort: minimal --- type: embedder provider: litellm_embedder models: - model: text-embedding-3-large alias: default timeout: 120 --- type: engine provider: wren_ui endpoint: http://localhost:3000 --- type: engine provider: wren_ibis endpoint: http://localhost:8000 source: bigquery manifest: "" # base64 encoded string of the MDL connection_info: "" # base64 encoded string of the connection info --- type: engine provider: wren_engine endpoint: http://localhost:8080 manifest: "" --- type: document_store provider: qdrant location: http://localhost:6333 embedding_model_dim: 3072 timeout: 120 recreate_index: false --- type: pipeline pipes: - name: db_schema_indexing embedder: litellm_embedder.default document_store: qdrant - name: historical_question_indexing embedder: litellm_embedder.default document_store: qdrant - name: table_description_indexing embedder: litellm_embedder.default document_store: qdrant - name: db_schema_retrieval llm: litellm_llm.default embedder: litellm_embedder.default document_store: qdrant - name: historical_question_retrieval embedder: litellm_embedder.default document_store: qdrant - name: sql_generation llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: sql_correction llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: followup_sql_generation llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: sql_answer llm: litellm_llm.default - name: semantics_description llm: litellm_llm.default - name: relationship_recommendation llm: litellm_llm.default - name: question_recommendation llm: litellm_llm.default - name: question_recommendation_sql_generation llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: chart_generation llm: litellm_llm.default - name: chart_adjustment llm: litellm_llm.default - name: intent_classification llm: litellm_llm.default embedder: litellm_embedder.default document_store: qdrant - name: misleading_assistance llm: litellm_llm.default - name: data_assistance llm: litellm_llm.default - name: sql_pairs_indexing document_store: qdrant embedder: litellm_embedder.default - name: sql_pairs_retrieval document_store: qdrant embedder: litellm_embedder.default llm: litellm_llm.default - name: preprocess_sql_data llm: litellm_llm.default - name: sql_executor engine: wren_ui - name: user_guide_assistance llm: litellm_llm.default - name: sql_question_generation llm: litellm_llm.default - name: sql_generation_reasoning llm: litellm_llm.default - name: followup_sql_generation_reasoning llm: litellm_llm.default - name: sql_regeneration llm: litellm_llm.default engine: wren_ui - name: evaluation llm: litellm_llm.default - name: instructions_indexing embedder: litellm_embedder.default document_store: qdrant - name: instructions_retrieval embedder: litellm_embedder.default document_store: qdrant - name: sql_functions_retrieval engine: wren_ibis document_store: qdrant - name: project_meta_indexing document_store: qdrant - name: sql_tables_extraction llm: litellm_llm.default - name: sql_diagnosis llm: litellm_llm.default - name: sql_knowledge_retrieval engine: wren_ibis document_store: qdrant --- settings: host: 127.0.0.1 port: 5556 doc_endpoint: https://docs.getwren.ai is_oss: true engine_timeout: 30 column_indexing_batch_size: 50 table_retrieval_size: 10 table_column_retrieval_size: 100 allow_intent_classification: true allow_sql_generation_reasoning: true allow_sql_functions_retrieval: true enable_column_pruning: false max_sql_correction_retries: 3 query_cache_maxsize: 1000 query_cache_ttl: 3600 langfuse_host: https://cloud.langfuse.com langfuse_enable: true logging_level: DEBUG development: true historical_question_retrieval_similarity_threshold: 0.9 sql_pairs_similarity_threshold: 0.7 sql_pairs_retrieval_max_size: 10 instructions_similarity_threshold: 0.7 instructions_top_k: 10 ================================================ FILE: wren-ai-service/tools/config/config.full.yaml ================================================ type: llm provider: litellm_llm timeout: 120 models: - alias: default model: gpt-4.1-nano-2025-04-14 context_window_size: 1000000 kwargs: max_tokens: 4096 n: 1 seed: 0 temperature: 0 - model: gpt-4.1-mini-2025-04-14 context_window_size: 1000000 kwargs: max_tokens: 4096 n: 1 seed: 0 temperature: 0 - model: gpt-4.1-2025-04-14 context_window_size: 1000000 kwargs: max_tokens: 4096 n: 1 seed: 0 temperature: 0 - model: gpt-5-nano-2025-08-07 context_window_size: 380000 kwargs: max_completion_tokens: 4096 n: 1 seed: 0 reasoning_effort: minimal - model: gpt-5-mini-2025-08-07 context_window_size: 380000 kwargs: max_completion_tokens: 4096 n: 1 seed: 0 reasoning_effort: minimal - model: gpt-5-2025-08-07 context_window_size: 380000 kwargs: max_completion_tokens: 4096 n: 1 seed: 0 reasoning_effort: minimal --- type: embedder provider: litellm_embedder models: - model: text-embedding-3-large alias: default timeout: 120 --- type: engine provider: wren_ui endpoint: http://localhost:3000 --- type: engine provider: wren_ibis endpoint: http://localhost:8000 source: bigquery manifest: "" # base64 encoded string of the MDL connection_info: "" # base64 encoded string of the connection info --- type: engine provider: wren_engine endpoint: http://localhost:8080 manifest: "" --- type: document_store provider: qdrant location: http://localhost:6333 embedding_model_dim: 3072 timeout: 120 recreate_index: false --- type: pipeline pipes: - name: db_schema_indexing embedder: litellm_embedder.default document_store: qdrant - name: historical_question_indexing embedder: litellm_embedder.default document_store: qdrant - name: table_description_indexing embedder: litellm_embedder.default document_store: qdrant - name: db_schema_retrieval llm: litellm_llm.default embedder: litellm_embedder.default document_store: qdrant - name: historical_question_retrieval embedder: litellm_embedder.default document_store: qdrant - name: sql_generation llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: sql_correction llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: followup_sql_generation llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: sql_answer llm: litellm_llm.default - name: semantics_description llm: litellm_llm.default - name: relationship_recommendation llm: litellm_llm.default - name: question_recommendation llm: litellm_llm.default - name: question_recommendation_sql_generation llm: litellm_llm.default engine: wren_ui document_store: qdrant - name: chart_generation llm: litellm_llm.default - name: chart_adjustment llm: litellm_llm.default - name: intent_classification llm: litellm_llm.default embedder: litellm_embedder.default document_store: qdrant - name: misleading_assistance llm: litellm_llm.default - name: data_assistance llm: litellm_llm.default - name: sql_pairs_indexing document_store: qdrant embedder: litellm_embedder.default - name: sql_pairs_retrieval document_store: qdrant embedder: litellm_embedder.default llm: litellm_llm.default - name: preprocess_sql_data llm: litellm_llm.default - name: sql_executor engine: wren_ui - name: user_guide_assistance llm: litellm_llm.default - name: sql_question_generation llm: litellm_llm.default - name: sql_generation_reasoning llm: litellm_llm.default - name: followup_sql_generation_reasoning llm: litellm_llm.default - name: sql_regeneration llm: litellm_llm.default engine: wren_ui - name: evaluation llm: litellm_llm.default - name: instructions_indexing embedder: litellm_embedder.default document_store: qdrant - name: instructions_retrieval embedder: litellm_embedder.default document_store: qdrant - name: sql_functions_retrieval engine: wren_ibis document_store: qdrant - name: project_meta_indexing document_store: qdrant - name: sql_tables_extraction llm: litellm_llm.default - name: sql_diagnosis llm: litellm_llm.default --- settings: host: 127.0.0.1 port: 5556 doc_endpoint: https://docs.getwren.ai is_oss: true engine_timeout: 30 column_indexing_batch_size: 50 table_retrieval_size: 10 table_column_retrieval_size: 100 query_cache_maxsize: 1000 allow_intent_classification: true allow_sql_generation_reasoning: true allow_sql_functions_retrieval: true enable_column_pruning: false max_sql_correction_retries: 3 query_cache_ttl: 3600 langfuse_host: https://cloud.langfuse.com langfuse_enable: true logging_level: INFO development: false historical_question_retrieval_similarity_threshold: 0.9 sql_pairs_similarity_threshold: 0.7 sql_pairs_retrieval_max_size: 10 instructions_similarity_threshold: 0.7 instructions_top_k: 10 ================================================ FILE: wren-ai-service/tools/dev/config.properties.example ================================================ node.environment=production wren.directory=/usr/src/app/etc/mdl wren.experimental-enable-dynamic-fields=true wren.datasource.type=duckdb duckdb.connector.init-sql-path=/usr/src/app/etc/duckdb/init.sql duckdb.storage.access-key= duckdb.storage.secret-key= ================================================ FILE: wren-ai-service/tools/dev/docker-compose-dev.yaml ================================================ version: "3.8" volumes: data: networks: wren: driver: bridge services: wren-engine: image: ghcr.io/canner/wren-engine:${WREN_ENGINE_VERSION} pull_policy: always platform: ${PLATFORM} ports: - ${WREN_ENGINE_SQL_PORT}:${WREN_ENGINE_SQL_PORT} - ${WREN_ENGINE_PORT}:${WREN_ENGINE_PORT} volumes: - ./etc:/usr/src/app/etc networks: - wren ibis-server: image: ghcr.io/canner/wren-engine-ibis:${IBIS_SERVER_VERSION} pull_policy: always platform: ${PLATFORM} ports: - ${IBIS_SERVER_PORT}:${IBIS_SERVER_PORT} environment: WREN_ENGINE_ENDPOINT: http://wren-engine:${WREN_ENGINE_PORT} LOG_LEVEL: DEBUG networks: - wren qdrant: image: qdrant/qdrant:v1.11.0 pull_policy: always ports: - 6333:6333 - 6334:6334 networks: - wren wren-ui: image: ghcr.io/canner/wren-ui:${WREN_UI_VERSION} pull_policy: always platform: ${PLATFORM} environment: DB_TYPE: sqlite # /app is the working directory in the container SQLITE_FILE: /app/data/db.sqlite3 WREN_ENGINE_ENDPOINT: http://wren-engine:${WREN_ENGINE_PORT} WREN_AI_ENDPOINT: http://host.docker.internal:${WREN_AI_SERVICE_PORT} IBIS_SERVER_ENDPOINT: http://ibis-server:${IBIS_SERVER_PORT} GENERATION_MODEL: ${GENERATION_MODEL} # telemetry WREN_ENGINE_PORT: ${WREN_ENGINE_PORT} WREN_AI_SERVICE_VERSION: ${WREN_AI_SERVICE_VERSION} WREN_UI_VERSION: ${WREN_UI_VERSION} WREN_ENGINE_VERSION: ${WREN_ENGINE_VERSION} USER_UUID: ${USER_UUID} POSTHOG_API_KEY: ${POSTHOG_API_KEY} POSTHOG_HOST: ${POSTHOG_HOST} TELEMETRY_ENABLED: ${TELEMETRY_ENABLED} # client side NEXT_PUBLIC_USER_UUID: ${USER_UUID} NEXT_PUBLIC_POSTHOG_API_KEY: ${POSTHOG_API_KEY} NEXT_PUBLIC_POSTHOG_HOST: ${POSTHOG_HOST} NEXT_PUBLIC_TELEMETRY_ENABLED: ${TELEMETRY_ENABLED} # configs WREN_PRODUCT_VERSION: ${WREN_PRODUCT_VERSION} ports: - ${WREN_UI_PORT}:3000 volumes: - ./etc:/app/data networks: - wren depends_on: - wren-engine - ibis-server postgres: image: postgres:14-alpine platform: ${PLATFORM} ports: - 5432:5432 volumes: - data:/var/lib/postgresql/data environment: - POSTGRES_PASSWORD=postgres - POSTGRES_USER=postgres - POSTGRES_DB=test - PGDATA=/var/lib/postgresql/data/pgdata networks: - wren ================================================ FILE: wren-ai-service/tools/mdl_to_str.py ================================================ import argparse import orjson def to_str(mdl: dict) -> str: """Convert MDL dictionary to string format with proper escaping. Args: mdl (dict): The MDL dictionary containing schema information Returns: str: Properly escaped string representation of the MDL Example: mdl = { "schema": "public", "models": [ {"name": "table1"} ] } result = to_str(mdl) # Returns escaped string representation """ mdl_str = orjson.dumps(mdl).decode("utf-8") mdl_str = mdl_str.replace("\\", "\\\\") # Escape backslashes mdl_str = mdl_str.replace('"', '\\"') # Escape double quotes return mdl_str def _args(): parser = argparse.ArgumentParser( description="Convert MDL JSON file to escaped string format" ) parser.add_argument("-p", "--path", help="Path to input MDL JSON file") return parser.parse_args() if __name__ == "__main__": args = _args() mdl = orjson.loads(open(args.path).read()) print(to_str(mdl)) ================================================ FILE: wren-ai-service/tools/run_sql.py ================================================ import argparse import base64 import json import os import time from typing import Dict, Optional import orjson import pandas as pd import requests import yaml from dotenv import load_dotenv load_dotenv("tools/.env", override=True) WREN_ENGINE_API_URL = "http://localhost:8080" WREN_IBIS_API_URL = "http://localhost:8000" DATA_SOURCES = ["duckdb", "bigquery", "postgres"] def _get_connection_info(data_source: str): if data_source == "bigquery": return { "project_id": os.getenv("bigquery.project-id"), "dataset_id": os.getenv("bigquery.dataset-id"), "credentials": os.getenv("bigquery.credentials-key"), } elif data_source == "postgres": return { "host": os.getenv("postgres.host"), "port": os.getenv("postgres.port"), "database": os.getenv("postgres.database"), "user": os.getenv("postgres.user"), "password": os.getenv("postgres.password"), } def get_data_from_wren_engine( sql: str, dataset_type: str, manifest: dict, limit: int = 100, return_df: bool = True, ): if dataset_type == "duckdb": response = requests.get( f"{WREN_ENGINE_API_URL}/v1/mdl/preview", json={ "sql": sql, "manifest": manifest, "limit": limit, }, ) assert response.status_code == 200, response.text data = response.json() if return_df: column_names = [col["name"] for col in data["columns"]] return pd.DataFrame(data["data"], columns=column_names) else: return data else: response = requests.post( f"{WREN_IBIS_API_URL}/v3/connector/{dataset_type}/query?limit={limit}", json={ "sql": sql, "manifestStr": base64.b64encode(orjson.dumps(manifest)).decode(), "connectionInfo": _get_connection_info(dataset_type), }, ) assert response.status_code == 200, response.text data = response.json() if return_df: column_names = [col for col in data["columns"]] return pd.DataFrame(data["data"], columns=column_names) else: return data def _update_wren_engine_configs(configs: list[dict]): response = requests.patch( f"{WREN_ENGINE_API_URL}/v1/config", json=configs, ) assert response.status_code == 200 def _prepare_duckdb(dataset_name: str): assert dataset_name in ["ecommerce", "hr"] init_sqls = { "ecommerce": """ CREATE TABLE olist_customers_dataset AS FROM read_parquet('https://assets.getwren.ai/sample_data/brazilian-ecommerce/olist_customers_dataset.parquet'); CREATE TABLE olist_order_items_dataset AS FROM read_parquet('https://assets.getwren.ai/sample_data/brazilian-ecommerce/olist_order_items_dataset.parquet'); CREATE TABLE olist_orders_dataset AS FROM read_parquet('https://assets.getwren.ai/sample_data/brazilian-ecommerce/olist_orders_dataset.parquet'); CREATE TABLE olist_order_payments_dataset AS FROM read_parquet('https://assets.getwren.ai/sample_data/brazilian-ecommerce/olist_order_payments_dataset.parquet'); CREATE TABLE olist_products_dataset AS FROM read_parquet('https://assets.getwren.ai/sample_data/brazilian-ecommerce/olist_products_dataset.parquet'); CREATE TABLE olist_order_reviews_dataset AS FROM read_parquet('https://assets.getwren.ai/sample_data/brazilian-ecommerce/olist_order_reviews_dataset.parquet'); CREATE TABLE olist_geolocation_dataset AS FROM read_parquet('https://assets.getwren.ai/sample_data/brazilian-ecommerce/olist_geolocation_dataset.parquet'); CREATE TABLE olist_sellers_dataset AS FROM read_parquet('https://assets.getwren.ai/sample_data/brazilian-ecommerce/olist_sellers_dataset.parquet'); CREATE TABLE product_category_name_translation AS FROM read_parquet('https://assets.getwren.ai/sample_data/brazilian-ecommerce/product_category_name_translation.parquet'); """, "hr": """ CREATE TABLE salaries AS FROM read_parquet('https://assets.getwren.ai/sample_data/employees/salaries.parquet'); CREATE TABLE titles AS FROM read_parquet('https://assets.getwren.ai/sample_data/employees/titles.parquet'); CREATE TABLE dept_emp AS FROM read_parquet('https://assets.getwren.ai/sample_data/employees/dept_emp.parquet'); CREATE TABLE departments AS FROM read_parquet('https://assets.getwren.ai/sample_data/employees/departments.parquet'); CREATE TABLE employees AS FROM read_parquet('https://assets.getwren.ai/sample_data/employees/employees.parquet'); CREATE TABLE dept_manager AS FROM read_parquet('https://assets.getwren.ai/sample_data/employees/dept_manager.parquet'); """, } with open("./tools/dev/etc/duckdb-init.sql", "w") as f: f.write("") response = requests.put( f"{WREN_ENGINE_API_URL}/v1/data-source/duckdb/settings/init-sql", data=init_sqls[dataset_name], ) assert response.status_code == 200, response.text def _replace_wren_engine_env_variables(engine_type: str, data: dict): assert engine_type in ("wren_engine", "wren_ibis") with open("config.yaml", "r") as f: configs = list(yaml.safe_load_all(f)) for config in configs: if config.get("type") == "engine" and config.get("provider") == engine_type: for key, value in data.items(): config[key] = value if "pipes" in config: for i, pipe in enumerate(config["pipes"]): if "engine" in pipe and pipe["name"] != "sql_functions_retrieval": config["pipes"][i]["engine"] = engine_type with open("config.yaml", "w") as f: yaml.safe_dump_all(configs, f, default_flow_style=False) def rerun_wren_engine(mdl_json: Dict, dataset_type: str, dataset: Optional[str] = None): assert dataset_type in DATA_SOURCES SOURCE = dataset_type MANIFEST = base64.b64encode(orjson.dumps(mdl_json)).decode() if dataset_type == "duckdb": _update_wren_engine_configs( [ { "name": "duckdb.connector.init-sql-path", "value": "/usr/src/app/etc/duckdb-init.sql", }, ] ) _prepare_duckdb(dataset) _replace_wren_engine_env_variables("wren_engine", {"manifest": MANIFEST}) else: WREN_IBIS_CONNECTION_INFO = base64.b64encode( orjson.dumps(_get_connection_info(dataset_type)) ).decode() _replace_wren_engine_env_variables( "wren_ibis", { "manifest": MANIFEST, "source": SOURCE, "connection_info": WREN_IBIS_CONNECTION_INFO, }, ) # wait for wren-ai-service to restart time.sleep(5) def main(): parser = argparse.ArgumentParser( description="Execute SQL query against MDL manifest" ) parser.add_argument( "--mdl-path", type=str, required=True, help="Path to MDL JSON file", ) parser.add_argument( "--data-source", type=str, default="bigquery", choices=["bigquery", "duckdb", "postgres"], help="Data source (default: bigquery)", ) parser.add_argument( "--sample-dataset", type=str, default="ecommerce", choices=["ecommerce", "hr", ""], help="Sample dataset (default: ecommerce)", ) args = parser.parse_args() mdl_path = args.mdl_path data_source = args.data_source sample_dataset = args.sample_dataset # Load MDL JSON file try: with open(mdl_path, "r") as f: mdl_json = json.load(f) except FileNotFoundError: print(f"Error: MDL file not found at {mdl_path}") return except json.JSONDecodeError: print(f"Error: Invalid JSON in MDL file {mdl_path}") return rerun_wren_engine(mdl_json, data_source, sample_dataset) # Execute query print("Enter SQL query (end with semicolon on a new line to execute, 'q' to quit):") lines = [] while True: line = input() if line.strip() == "q": break if line.strip() == ";": command = "\n".join(lines) lines = [] try: df = get_data_from_wren_engine( sql=command, dataset_type=data_source, manifest=mdl_json, limit=50, ) print(f"\nExecution result:\n{df.to_string()}\n") except Exception as e: print(f"\nError executing query: {str(e)}") else: lines.append(line) if __name__ == "__main__": main() ================================================ FILE: wren-launcher/.golangci.yml ================================================ # golangci-lint configuration for WrenAI wren-launcher version: "2" run: timeout: 5m linters: enable: - errcheck - govet - ineffassign - staticcheck - unused - misspell - unconvert - gosec - dupl - goconst - gocyclo - bodyclose - whitespace issues: max-issues-per-linter: 0 max-same-issues: 0 ================================================ FILE: wren-launcher/Makefile ================================================ BINARY_NAME=wren-launcher # Build targets build: env GOARCH=amd64 GOOS=darwin CGO_ENABLED=1 go build -o dist/${BINARY_NAME}-darwin main.go env GOARCH=arm64 GOOS=darwin CGO_ENABLED=1 go build -o dist/${BINARY_NAME}-darwin-arm64 main.go env GOARCH=amd64 GOOS=linux CGO_ENABLED=0 go build -o dist/${BINARY_NAME}-linux main.go env GOARCH=arm64 GOOS=linux CGO_ENABLED=0 go build -o dist/${BINARY_NAME}-linux-arm64 main.go env GOARCH=amd64 GOOS=windows CGO_ENABLED=0 go build -o dist/${BINARY_NAME}-windows.exe main.go cd ./dist; chmod +x ${BINARY_NAME}-darwin && chmod +x ${BINARY_NAME}-darwin-arm64 && chmod +x ${BINARY_NAME}-linux && chmod +x ${BINARY_NAME}-linux-arm64 \ && tar zcvf ${BINARY_NAME}-darwin.tar.gz ${BINARY_NAME}-darwin \ && tar zcvf ${BINARY_NAME}-darwin-arm64.tar.gz ${BINARY_NAME}-darwin-arm64 \ && tar zcvf ${BINARY_NAME}-linux.tar.gz ${BINARY_NAME}-linux \ && tar zcvf ${BINARY_NAME}-linux-arm64.tar.gz ${BINARY_NAME}-linux-arm64 \ && zip ${BINARY_NAME}-windows.zip ${BINARY_NAME}-windows.exe clean: go clean rm -rf dist rebuild: clean build # Code quality targets .PHONY: fmt fmt: go fmt ./... .PHONY: imports imports: $(shell go env GOPATH)/bin/goimports -w . .PHONY: vet vet: go vet ./... .PHONY: lint lint: golangci-lint run .PHONY: lint-fix lint-fix: golangci-lint run --fix .PHONY: check check: fmt vet lint .PHONY: fix fix: fmt imports lint-fix .PHONY: test test: go test ./... .PHONY: help help: @echo "Available targets:" @echo " build - Build binaries for all platforms" @echo " clean - Clean build artifacts" @echo " rebuild - Clean and build" @echo " fmt - Format Go code" @echo " imports - Fix imports" @echo " vet - Run go vet" @echo " lint - Run golangci-lint" @echo " lint-fix - Run golangci-lint with auto-fix" @echo " check - Run fmt, vet, and lint" @echo " fix - Run fmt, imports, and lint-fix" @echo " test - Run tests" @echo " help - Show this help" ================================================ FILE: wren-launcher/README.md ================================================ ## How to build ```bash # mac go build main.go # windows env GOOS=windows GOARCH=amd64 go build main.go ``` ## Code Quality ```bash make check # Run all checks (fmt, vet, lint) make test # Run tests make fmt # Format code make vet # Run go vet make lint # Run golangci-lint ``` ## Continuous Integration This project uses GitHub Actions for CI/CD. The workflow runs automatically on: - **Push to main branch**: Runs all checks and tests - **Pull Request with label `launcher`**: Runs all checks and tests when PR is labeled - **Manual trigger**: Can be triggered manually via GitHub Actions UI ### CI Jobs: 1. **Lint and Test**: - Code formatting check - Go vet analysis - golangci-lint checks - Unit tests - All quality checks 2. **Security Scan**: - Gosec security analysis - Go module verification ## How to update dependencies ```bash # Update a single dependency go get example.com/some/package@latest # Update all dependencies go get -u ./... # Clean up and ensure the module files are correct go mod tidy # Verify the updates go test ./... ``` ================================================ FILE: wren-launcher/commands/dbt/README.md ================================================ # Requirement for DBT project This part outlines some requirements for the target dbt project: - Ensure the DBT project is qualified and generates the required files: - `catalog.json` - `manifest.json` Execute the following commands: ``` dbt build dbt docs generate ``` - Prepare the profile of the dbt project for the connection info of your database. - `profiles.yml` # How to Support a New Data Source This document outlines the steps required to add support for a new data source to the dbt project converter. The target data source must be supported by both dbt and the Wren engine: - [dbt supported databases](https://docs.getdbt.com/docs/supported-data-platforms) - [Wren engine supported data sources](https://docs.getwren.ai/oss/wren_engine_api#tag/AthenaConnectionInfo) ## 1. Implement the DataSource Interface The first step is to define a new struct for your data source and implement the `DataSource` interface defined in `data_source.go`. The `DataSource` interface is as follows: ```go type DataSource interface { GetType() string Validate() error MapType(sourceType string) string } ``` ### Steps: 1. **Define Your Struct**: Create a new struct that represents the connection properties for your data source. The fields in this struct should correspond to the properties defined in the [Wren engine's API documentation](https://docs.getwren.ai/oss/wren_engine_api#tag/SnowflakeConnectionInfo) for the target data source. For example, to add support for `Snowflake`, you would define the following struct: ```go type WrenSnowflakeDataSource struct { Account string `json:"account"` User string `json:"user"` Password string `json:"password"` Database string `json:"database"` Warehouse string `json:"warehouse"` // ... other properties } ``` 2. **Implement `GetType()`**: This method should return a string that identifies your data source type (e.g., `"snowflake"`). 3. **Implement `Validate()`**: This method should check if the essential properties of your data source are set and valid. Return an error if validation fails. 4. **Implement `MapType()`**: This method is crucial for mapping data types from the source system (as defined in `catalog.json`) to Wren's supported data types (e.g., `integer`, `varchar`, `timestamp`). ## 2. Add Conversion Logic in `data_source.go` After implementing the interface, you need to integrate your new data source into the conversion logic. This is done by updating the `convertConnectionToDataSource` function in `data_source.go`. Add a new `case` to the `switch` statement that matches the `type` field from the dbt `profiles.yml` file. This new case will be responsible for creating an instance of your new data source struct from the dbt connection details. ### Example: ```go // in data_source.go func convertConnectionToDataSource(conn DbtConnection, dbtHomePath, profileName, outputName string) (DataSource, error) { switch strings.ToLower(conn.Type) { case "postgres", "postgresql": return convertToPostgresDataSource(conn) case "duckdb": return convertToLocalFileDataSource(conn, dbtHomePath) // Add your new case here case "snowflake": return convertToSnowflakeDataSource(conn) // Implement this function default: // ... } } // Implement the conversion function func convertToSnowflakeDataSource(conn DbtConnection) (*WrenSnowflakeDataSource, error) { // Logic to extract snowflake properties from conn // and return a new *WrenSnowflakeDataSource } ``` ## 3. Handle the New Data Source in `ConvertDbtProjectCore` The `ConvertDbtProjectCore` function in `converter.go` is responsible for generating the `wren-datasource.json` file. You must add your new data source to the `switch` statement within this function to ensure it is correctly serialized. ### Steps: 1. **Locate the `switch` statement**: Find the `switch typedDS := ds.(type)` block inside `ConvertDbtProjectCore`. 2. **Add a new `case`**: Add a new `case` for your data source struct. Inside this case, construct the `wrenDataSource` map with the correct `type` and `properties`. ### Example: ```go // in converter.go's ConvertDbtProjectCore function // ... switch typedDS := ds.(type) { case *WrenPostgresDataSource: // ... case *WrenLocalFileDataSource: // ... // Add your new case here case *WrenSnowflakeDataSource: wrenDataSource = map[string]interface{}{ "type": "snowflake", "properties": map[string]interface{}{ "account": typedDS.Account, "user": typedDS.User, "password": typedDS.Password, "database": typedDS.Database, "warehouse": typedDS.Warehouse, // ... other properties }, } default: // ... } // ... ``` **Note on File-Based Data Sources**: If your data source is file-based (like `duckdb`), you also need to add logic to set the `localStoragePath` variable correctly within `ConvertDbtProjectCore`. This path tells the Wren engine where to find the data files. ================================================ FILE: wren-launcher/commands/dbt/converter.go ================================================ package dbt import ( "encoding/json" "fmt" "os" "path/filepath" "regexp" "sort" "strings" "github.com/pterm/pterm" ) // Note: All struct definitions (WrenMDLManifest, WrenModel, etc.) are defined // in wren_mdl.go to prevent "redeclared in this block" compilation errors. // ConvertOptions holds the options for dbt project conversion type ConvertOptions struct { ProjectPath string OutputDir string ProfileName string Target string RequireCatalog bool // if true, missing catalog.json is an error; if false, it's a warning UsedByContainer bool // if true, used by container, no need to print usage info IncludeStagingModels bool // if true, staging models will be included in the conversion } // ConvertResult holds the result of dbt project conversion type ConvertResult struct { LocalStoragePath string DataSourceGenerated bool ModelsCount int } // ConvertDbtProjectCore contains the core logic for converting dbt projects // This function is used by both DbtAutoConvert and processDbtProject // //nolint:gocyclo // This function has high cyclomatic complexity due to extensive dbt project validation and conversion logic func ConvertDbtProjectCore(opts ConvertOptions) (*ConvertResult, error) { // Validate dbt project if !IsDbtProjectValid(opts.ProjectPath) { return nil, fmt.Errorf("invalid dbt project path: %s", opts.ProjectPath) } // Create output directory if it doesn't exist if err := os.MkdirAll(opts.OutputDir, 0750); err != nil { return nil, fmt.Errorf("failed to create output directory: %w", err) } pterm.Info.Printf("Processing dbt project at: %s\n", opts.ProjectPath) pterm.Info.Printf("Output directory: %s\n", opts.OutputDir) // Search for profiles.yml profilesPath, err := FindProfilesFile(opts.ProjectPath) if err != nil { pterm.Warning.Printf("Warning: Could not find profiles.yml: %v\n", err) pterm.Info.Println("Skipping data source conversion...") } // Search for catalog.json, manifest.json, and semantic_manifest.json in target directory targetDir := filepath.Join(opts.ProjectPath, "target") catalogPath := filepath.Join(targetDir, "catalog.json") manifestPath := filepath.Join(targetDir, "manifest.json") semanticManifestPath := filepath.Join(targetDir, "semantic_manifest.json") if !FileExists(catalogPath) { if opts.RequireCatalog { return nil, fmt.Errorf("catalog.json not found at: %s. Hint: Run 'dbt docs generate' to create catalog.json", catalogPath) } else { pterm.Warning.Printf("Warning: catalog.json not found at: %s\n", catalogPath) pterm.Info.Println("Hint: Run 'dbt docs generate' to create catalog.json") return &ConvertResult{LocalStoragePath: "."}, nil } } // Check for manifest.json (optional but recommended for descriptions and relationships) var manifestPathForConversion string if FileExists(manifestPath) { pterm.Info.Printf("Found manifest.json at: %s\n", manifestPath) manifestPathForConversion = manifestPath } else { pterm.Warning.Printf("Warning: manifest.json not found at: %s\n", manifestPath) pterm.Info.Println("Model descriptions, column descriptions, and relationships will not be included") } // Check for semantic_manifest.json (optional) var semanticManifestPathForConversion string if FileExists(semanticManifestPath) { pterm.Info.Printf("Found semantic_manifest.json at: %s\n", semanticManifestPath) semanticManifestPathForConversion = semanticManifestPath } else { pterm.Info.Println("semantic_manifest.json not found, skipping metric and primary key conversion.") } // Convert profiles.yml to WrenDataSource (if profiles found) var dataSourceGenerated bool var ds DataSource localStoragePath := "." // default value if profilesPath != "" { pterm.Info.Printf("Found profiles.yml at: %s\n", profilesPath) // Analyze profiles profiles, err := AnalyzeDbtProfiles(profilesPath) if err != nil { return nil, fmt.Errorf("failed to analyze profiles: %w", err) } // Display available profiles if no specific profile is requested if opts.ProfileName == "" { pterm.Info.Println("Available profiles:") for name := range profiles.Profiles { pterm.Info.Printf(" - %s\n", name) } pterm.Info.Println("Using first available profile (specify --profile to select a specific one)") } // Get active data sources dataSources, err := GetActiveDataSources(profiles, opts.ProjectPath, opts.ProfileName, opts.Target) if err != nil { return nil, fmt.Errorf("failed to get data sources: %w", err) } if len(dataSources) == 0 { pterm.Warning.Println("Warning: No active data sources found") dataSourceGenerated = false } else { // Use the first data source ds = dataSources[0] // Check if the first data source is duckdb (local file) if localFileDS, ok := dataSources[0].(*WrenLocalFileDataSource); ok { localStoragePath = localFileDS.Url pterm.Info.Printf("Found DuckDB data source, using local storage path: %s\n", localStoragePath) } // Create WrenDataSource JSON var wrenDataSource map[string]interface{} switch typedDS := ds.(type) { case *WrenPostgresDataSource: var host string if opts.UsedByContainer { host = handleLocalhostForContainer(typedDS.Host) } else { host = typedDS.Host } wrenDataSource = map[string]interface{}{ "type": "postgres", "properties": map[string]interface{}{ "host": host, "port": typedDS.Port, "database": typedDS.Database, "user": typedDS.User, "password": typedDS.Password, }, } case *WrenMSSQLDataSource: var host string if opts.UsedByContainer { host = handleLocalhostForContainer(typedDS.Host) } else { host = typedDS.Host } wrenDataSource = map[string]interface{}{ "type": "mssql", "properties": map[string]interface{}{ "host": host, "port": typedDS.Port, "database": typedDS.Database, "user": typedDS.User, "password": typedDS.Password, "tds_version": typedDS.TdsVersion, "driver": typedDS.Driver, "kwargs": typedDS.Kwargs, }, } case *WrenLocalFileDataSource: var url string if opts.UsedByContainer { // For container usage, the file path will be mounted to the following path url = "/usr/src/app/data" } else { url = typedDS.Url } wrenDataSource = map[string]interface{}{ "type": "local_file", "properties": map[string]interface{}{ "url": url, "format": typedDS.Format, }, } case *WrenBigQueryDataSource: wrenDataSource = map[string]interface{}{ "type": "bigquery", "properties": map[string]interface{}{ "project_id": typedDS.Project, "dataset_id": typedDS.Dataset, "credentials": typedDS.Credentials, }, } case *WrenMysqlDataSource: wrenDataSource = map[string]interface{}{ "type": "mysql", "properties": map[string]interface{}{ "host": typedDS.Host, "port": typedDS.Port, "database": typedDS.Database, "user": typedDS.User, "password": typedDS.Password, "sslMode": typedDS.SslMode, }, } default: pterm.Warning.Printf("Warning: Unsupported data source type: %s\n", ds.GetType()) wrenDataSource = map[string]interface{}{ "type": ds.GetType(), "properties": map[string]interface{}{}, } } // Write WrenDataSource JSON dataSourcePath := filepath.Join(opts.OutputDir, "wren-datasource.json") dataSourceJSON, err := json.MarshalIndent(wrenDataSource, "", " ") if err != nil { return nil, fmt.Errorf("failed to marshal data source JSON: %w", err) } if err := os.WriteFile(dataSourcePath, dataSourceJSON, 0600); err != nil { return nil, fmt.Errorf("failed to write data source file: %w", err) } pterm.Success.Printf("✓ WrenDataSource saved to: %s\n", dataSourcePath) dataSourceGenerated = true } } // Convert catalog.json to Wren MDL pterm.Info.Printf("Converting catalog.json from: %s\n", catalogPath) // Create a default data source if none was found if ds == nil { ds = &DefaultDataSource{} } manifest, err := ConvertDbtCatalogToWrenMDL(catalogPath, ds, manifestPathForConversion, semanticManifestPathForConversion, opts.IncludeStagingModels) if err != nil { return nil, fmt.Errorf("failed to convert catalog: %w", err) } // Write Wren MDL JSON mdlPath := filepath.Join(opts.OutputDir, "wren-mdl.json") mdlJSON, err := json.MarshalIndent(manifest, "", " ") if err != nil { return nil, fmt.Errorf("failed to marshal MDL JSON: %w", err) } if err := os.WriteFile(mdlPath, mdlJSON, 0600); err != nil { return nil, fmt.Errorf("failed to write MDL file: %w", err) } pterm.Success.Printf("✓ Wren MDL saved to: %s\n", mdlPath) // Summary pterm.Success.Println("\n🎉 Conversion completed successfully!") pterm.Info.Printf("Models converted: %d\n", len(manifest.Models)) pterm.Info.Printf("Relationships generated: %d\n", len(manifest.Relationships)) pterm.Info.Printf("Metrics generated: %d\n", len(manifest.Metrics)) pterm.Info.Printf("Enums generated: %d\n", len(manifest.EnumDefinitions)) if dataSourceGenerated { pterm.Info.Println("Generated files:") pterm.Info.Printf(" - WrenDataSource: %s\n", filepath.Join(opts.OutputDir, "wren-datasource.json")) pterm.Info.Printf(" - Wren MDL: %s\n", filepath.Join(opts.OutputDir, "wren-mdl.json")) } else { pterm.Info.Println("Generated files:") pterm.Info.Printf(" - Wren MDL: %s\n", filepath.Join(opts.OutputDir, "wren-mdl.json")) if profilesPath != "" { pterm.Warning.Println(" - WrenDataSource: Not generated (no compatible data sources found)") } else { pterm.Warning.Println(" - WrenDataSource: Not generated (profiles.yml not found)") } } return &ConvertResult{ LocalStoragePath: localStoragePath, DataSourceGenerated: dataSourceGenerated, ModelsCount: len(manifest.Models), }, nil } func handleLocalhostForContainer(host string) string { // If the host is localhost, we need to handle it for container usage if host == "localhost" || host == "127.0.0.1" { // For container usage, we can use the host network or a specific IP. // "host.docker.internal" is a special DNS name that resolves to the internal IP address of the host. // It's supported on Docker Desktop for Mac and Windows, and in Docker Engine 20.10+ for Linux. // This makes it a reliable default for accessing host services from within a container. return "host.docker.internal" } return host } // ConvertDbtCatalogToWrenMDL is the main function to convert a dbt catalog into a Wren MDL manifest. // It orchestrates the reading of dbt artifacts and processes each dbt node to convert it into a Wren model. func ConvertDbtCatalogToWrenMDL(catalogPath string, dataSource DataSource, manifestPath string, semanticManifestPath string, includeStagingModels bool) (*WrenMDLManifest, error) { // --- 1. Read and Parse All Necessary DBT Artifact Files --- // Read and unmarshal the primary catalog.json file. catalogBytes, err := os.ReadFile(filepath.Clean(catalogPath)) if err != nil { return nil, fmt.Errorf("failed to read catalog file %s: %w", catalogPath, err) } var catalogData map[string]interface{} if err := json.Unmarshal(catalogBytes, &catalogData); err != nil { return nil, fmt.Errorf("failed to parse catalog JSON: %w", err) } // Read and unmarshal the manifest.json file, which contains rich metadata. var manifestData map[string]interface{} if manifestPath != "" { pterm.Info.Printf("Reading manifest.json for descriptions and relationships from: %s\n", manifestPath) manifestBytes, err := os.ReadFile(filepath.Clean(manifestPath)) // #nosec G304 -- manifestPath is controlled by application if err != nil { pterm.Warning.Printf("Could not read manifest file %s: %v. Descriptions and relationships will be missing.\n", manifestPath, err) } else if err := json.Unmarshal(manifestBytes, &manifestData); err != nil { pterm.Warning.Printf("Could not parse manifest file %s: %v. Descriptions and relationships will be missing.\n", manifestPath, err) } } // Read and unmarshal the semantic_manifest.json file for metrics and primary keys. var semanticManifestData map[string]interface{} if semanticManifestPath != "" { semanticBytes, err := os.ReadFile(filepath.Clean(semanticManifestPath)) if err != nil { pterm.Warning.Printf("Could not read semantic_manifest.json: %v. Metrics and primary keys will be missing.\n", err) } else if err := json.Unmarshal(semanticBytes, &semanticManifestData); err != nil { pterm.Warning.Printf("Could not parse semantic_manifest.json: %v. Metrics and primary keys will be missing.\n", err) } } // --- 2. Initialize Wren Manifest and Pre-process Metadata --- manifest := &WrenMDLManifest{ JsonSchema: "https://raw.githubusercontent.com/Canner/WrenAI/main/wren-mdl/mdl.schema.json", Catalog: "wren", Schema: "public", EnumDefinitions: []EnumDefinition{}, Models: []WrenModel{}, Relationships: []Relationship{}, Metrics: []Metric{}, Views: []View{}, DataSource: dataSource.GetType(), } // Create lookup maps to store pre-processed information for quick access. enumValueToNameMap := make(map[string]string) columnToEnumNameMap := make(map[string]string) columnToNotNullMap := make(map[string]bool) modelToPrimaryKeyMap := make(map[string]string) // Pre-process the manifest to extract test data (enums, not-null constraints). if manifestData != nil { preprocessManifestForTests(manifestData, &manifest.EnumDefinitions, enumValueToNameMap, columnToEnumNameMap, columnToNotNullMap) } // Pre-process the semantic manifest to extract primary key information. if semanticManifestData != nil { preprocessSemanticManifestForPrimaryKeys(semanticManifestData, modelToPrimaryKeyMap) } // --- 3. Convert dbt Nodes to Wren Models --- nodesValue, exists := catalogData["nodes"] if !exists { return nil, fmt.Errorf("no 'nodes' section found in catalog") } nodesMap, ok := nodesValue.(map[string]interface{}) if !ok { return nil, fmt.Errorf("invalid 'nodes' format in catalog") } // Iterate through each node in the catalog and convert it to a Wren model. for nodeKey, nodeValue := range nodesMap { nodeMap, ok := nodeValue.(map[string]interface{}) if !ok { continue } // We are only interested in nodes that represent dbt models. if !strings.HasPrefix(nodeKey, "model.") { continue } // Skip staging models if the user has opted to exclude them. modelName := getModelNameFromNodeKey(nodeKey) if !includeStagingModels && (strings.HasPrefix(modelName, "stg_") || strings.HasPrefix(modelName, "staging_")) { continue } // Perform the conversion for the single node. model, err := convertDbtNodeToWrenModel(nodeKey, nodeMap, dataSource, manifestData, columnToEnumNameMap, columnToNotNullMap, modelToPrimaryKeyMap) if err != nil { pterm.Warning.Printf("Failed to convert model %s: %v\n", nodeKey, err) continue } manifest.Models = append(manifest.Models, *model) } // --- 4. Generate Relationships and Metrics --- // Generate relationships between models based on the dbt manifest. if manifestData != nil { manifest.Relationships = generateRelationships(manifestData) } // Generate metrics from the semantic manifest. if semanticManifestData != nil { manifest.Metrics = convertDbtMetricsToWrenMetrics(semanticManifestData) } return manifest, nil } // preprocessManifestForTests extracts information from dbt tests (like 'not_null' and 'accepted_values') // and populates maps that will be used later during model conversion. func preprocessManifestForTests(manifestData map[string]interface{}, enums *[]EnumDefinition, enumValueToNameMap, columnToEnumNameMap map[string]string, columnToNotNullMap map[string]bool) { nodes, ok := manifestData["nodes"].(map[string]interface{}) if !ok { return } for nodeKey, nodeValue := range nodes { nodeMap, ok := nodeValue.(map[string]interface{}) if !ok { continue } // Process tests defined directly on model columns. if strings.HasPrefix(nodeKey, "model.") { modelName := getModelNameFromNodeKey(nodeKey) if columns, ok := nodeMap["columns"].(map[string]interface{}); ok { for columnName, colData := range columns { if colMap, ok := colData.(map[string]interface{}); ok { processColumnForTests(nodeKey, modelName, columnName, colMap, enums, enumValueToNameMap, columnToEnumNameMap, columnToNotNullMap) } } } } // Process compiled test nodes which are separate entries in the manifest. if strings.HasPrefix(nodeKey, "test.") { testMeta, _ := nodeMap["test_metadata"].(map[string]interface{}) testName := getStringFromMap(testMeta, "name", "") attachedNodeID := getStringFromMap(nodeMap, "attached_node", "") columnName := getStringFromMap(nodeMap, "column_name", "") if attachedNodeID != "" && columnName != "" { columnKey := fmt.Sprintf("%s.%s", attachedNodeID, columnName) modelName := getModelNameFromNodeKey(attachedNodeID) if testName == "not_null" { columnToNotNullMap[columnKey] = true } if testName == "accepted_values" { if kwargs, ok := testMeta["kwargs"].(map[string]interface{}); ok { if values, ok := kwargs["values"].([]interface{}); ok && len(values) > 0 { createOrLinkEnum(modelName, columnName, columnKey, values, enums, enumValueToNameMap, columnToEnumNameMap) } } } } } } } // preprocessSemanticManifestForPrimaryKeys extracts primary key information from the semantic manifest. func preprocessSemanticManifestForPrimaryKeys(semanticData map[string]interface{}, modelToPrimaryKeyMap map[string]string) { semanticModels, ok := semanticData["semantic_models"].([]interface{}) if !ok { return } for _, sm := range semanticModels { smMap, ok := sm.(map[string]interface{}) if !ok { continue } var modelName string if nr, ok := smMap["node_relation"].(map[string]interface{}); ok { modelName = getStringFromMap(nr, "alias", "") } if entities, ok := smMap["entities"].([]interface{}); ok { for _, entity := range entities { if entityMap, ok := entity.(map[string]interface{}); ok { if getStringFromMap(entityMap, "type", "") == "primary" { pk := getStringFromMap(entityMap, "expr", "") if modelName != "" && pk != "" { modelToPrimaryKeyMap[modelName] = pk } } } } } } } // generateRelationships iterates through the manifest and creates relationship definitions. func generateRelationships(manifestData map[string]interface{}) []Relationship { var relationships []Relationship if nodes, ok := manifestData["nodes"].(map[string]interface{}); ok { for nodeKey, nodeValue := range nodes { nodeMap, ok := nodeValue.(map[string]interface{}) if !ok { continue } // Case 1: Handle tests on model columns (including structs) if strings.HasPrefix(nodeKey, "model.") { fromModelName := getModelNameFromNodeKey(nodeKey) if fromModelName == "" { continue } if columns, ok := nodeMap["columns"].(map[string]interface{}); ok { for columnName, colData := range columns { if colMap, ok := colData.(map[string]interface{}); ok { relationships = append(relationships, parseTestsForRelationships(fromModelName, columnName, colMap)...) } } } } // Case 2: Handle compiled test nodes for simple columns if strings.HasPrefix(nodeKey, "test.") { if testMeta, ok := nodeMap["test_metadata"].(map[string]interface{}); ok { if getStringFromMap(testMeta, "name", "") == "relationships" { if kwargs, ok := testMeta["kwargs"].(map[string]interface{}); ok { toRef := getStringFromMap(kwargs, "to", "") toField := getStringFromMap(kwargs, "field", "") toModelName := parseRef(toRef) fromColumnName := getStringFromMap(nodeMap, "column_name", "") attachedNodeID := getStringFromMap(nodeMap, "attached_node", "") fromModelName := getModelNameFromNodeKey(attachedNodeID) if toModelName != "" && toField != "" && fromModelName != "" && fromColumnName != "" { rel := Relationship{ Name: fmt.Sprintf("%s_to_%s_by_%s", fromModelName, toModelName, fromColumnName), Models: []string{fromModelName, toModelName}, JoinType: "MANY_TO_ONE", Condition: fmt.Sprintf("\"%s\".\"%s\" = \"%s\".\"%s\"", fromModelName, fromColumnName, toModelName, toField), } relationships = append(relationships, rel) } } } } } } } seen := make(map[string]struct{}, len(relationships)) // if relationship is empty, return empty slice instead of nil unique := []Relationship{} for _, r := range relationships { key := r.Name + "|" + r.JoinType + "|" + r.Condition if _, ok := seen[key]; ok { continue } seen[key] = struct{}{} unique = append(unique, r) } return unique } // parseTestsForRelationships is a helper function to extract relationship tests from a column or its fields. func parseTestsForRelationships(fromModelName, columnName string, colMap map[string]interface{}) []Relationship { var relationships []Relationship // Case 1: Tests are directly on the column. if tests, ok := colMap["tests"].([]interface{}); ok { relationships = append(relationships, extractRelationshipsFromTests(fromModelName, columnName, tests)...) } // Case 2: Tests are on fields within a struct column. if fields, ok := colMap["fields"].([]interface{}); ok { for _, fieldData := range fields { if fieldMap, ok := fieldData.(map[string]interface{}); ok { fieldName := getStringFromMap(fieldMap, "name", "") if fieldName == "" { continue } if tests, ok := fieldMap["tests"].([]interface{}); ok { relationships = append(relationships, extractRelationshipsFromTests(fromModelName, fieldName, tests)...) } } } } return relationships } // extractRelationshipsFromTests extracts relationship info from a 'tests' array. func extractRelationshipsFromTests(fromModelName, fromColumnName string, tests []interface{}) []Relationship { // if relationship is empty, return empty slice instead of nil relationships := []Relationship{} for _, test := range tests { if relTest, ok := test.(map[string]interface{}); ok { if relData, ok := relTest["relationships"].(map[string]interface{}); ok { toRef := getStringFromMap(relData, "to", "") toField := getStringFromMap(relData, "field", "") toModelName := parseRef(toRef) if toModelName != "" && toField != "" { rel := Relationship{ Name: fmt.Sprintf("%s_to_%s_by_%s", fromModelName, toModelName, fromColumnName), Models: []string{fromModelName, toModelName}, JoinType: "MANY_TO_ONE", Condition: fmt.Sprintf("\"%s\".\"%s\" = \"%s\".\"%s\"", fromModelName, fromColumnName, toModelName, toField), } relationships = append(relationships, rel) } } } } return relationships } // createOrLinkEnum is a helper to de-duplicate and manage enum creation based on 'accepted_values' tests. func createOrLinkEnum(modelName, columnName, columnKey string, values []interface{}, allEnums *[]EnumDefinition, enumValueToNameMap, columnToEnumNameMap map[string]string) { var strValues []string var enumValues []EnumValue for _, v := range values { if s, ok := v.(string); ok { strValues = append(strValues, s) enumValues = append(enumValues, EnumValue{Name: s}) } } if len(strValues) == 0 { return } sort.Strings(strValues) valueKey := strings.Join(strValues, ",") enumName, exists := enumValueToNameMap[valueKey] if !exists { enumName = fmt.Sprintf("%s_%s_Enum", modelName, columnName) // Sanitize enum name to be a valid identifier re := regexp.MustCompile(`[^a-zA-Z0-9_]`) enumName = re.ReplaceAllString(enumName, "_") if len(enumName) > 0 && enumName[0] >= '0' && enumName[0] <= '9' { enumName = "_" + enumName } *allEnums = append(*allEnums, EnumDefinition{ Name: enumName, Values: enumValues, }) enumValueToNameMap[valueKey] = enumName } columnToEnumNameMap[columnKey] = enumName } // processColumnForTests finds tests in a column definition (including nested fields) and processes them. func processColumnForTests(nodeKey, modelName, columnName string, colMap map[string]interface{}, allEnums *[]EnumDefinition, enumValueToNameMap, columnToEnumNameMap map[string]string, columnToNotNullMap map[string]bool) { // Helper to handle the actual test processing for a given column/field processTests := func(currentColumnKey, currentColumnName string, tests []interface{}) { for _, test := range tests { // Handle not_null test (string format) if testStr, ok := test.(string); ok && testStr == "not_null" { columnToNotNullMap[currentColumnKey] = true } // Handle tests in map format (e.g., accepted_values) if testMap, ok := test.(map[string]interface{}); ok { if accepted, ok := testMap["accepted_values"].(map[string]interface{}); ok { if values, ok := accepted["values"].([]interface{}); ok && len(values) > 0 { createOrLinkEnum(modelName, currentColumnName, currentColumnKey, values, allEnums, enumValueToNameMap, columnToEnumNameMap) } } } } } // Case 1: Tests are directly on the column itself. if tests, ok := colMap["tests"].([]interface{}); ok { columnKey := fmt.Sprintf("%s.%s", nodeKey, columnName) processTests(columnKey, columnName, tests) } // Case 2: The column is a struct, and tests are on its fields. if fields, ok := colMap["fields"].([]interface{}); ok { for _, fieldData := range fields { if fieldMap, ok := fieldData.(map[string]interface{}); ok { fieldName := getStringFromMap(fieldMap, "name", "") if fieldName == "" { continue } if tests, ok := fieldMap["tests"].([]interface{}); ok { // The unique key for a field is based on the field name. columnKey := fmt.Sprintf("%s.%s", nodeKey, fieldName) processTests(columnKey, fieldName, tests) } } } } } // convertDbtMetricsToWrenMetrics converts dbt metrics from the semantic manifest into the Wren MDL format. // It serves as the main entry point for metric conversion, orchestrating the creation of lookup tables // and processing each metric definition. func convertDbtMetricsToWrenMetrics(semanticData map[string]interface{}) []Metric { var wrenMetrics []Metric // --- 1. Pre-process semantic models to build fast lookup maps --- // These maps are essential for quickly finding the model a measure belongs to and its details. measureToModelMap, measureDataLookup := buildMeasureLookups(semanticData) // --- 2. Iterate through each metric and convert it --- metrics, ok := semanticData["metrics"].([]interface{}) if !ok { // If there's no 'metrics' array, there's nothing to do. return wrenMetrics } for _, m := range metrics { metricMap, ok := m.(map[string]interface{}) if !ok { continue // Skip if the item is not a valid map. } // --- 3. Extract basic metric information --- metricName := getStringFromMap(metricMap, "name", "") if metricName == "" { continue // A metric must have a name. } wrenMetric := Metric{ Name: metricName, DisplayName: getStringFromMap(metricMap, "label", metricName), Description: getStringFromMap(metricMap, "description", ""), } typeParams, _ := metricMap["type_params"].(map[string]interface{}) // --- 4. Determine the base model and time dimensions for the metric --- baseModel := findBaseModelForMetric(typeParams, measureToModelMap) if baseModel == "" { pterm.Warning.Printf("Could not find a parent model for metric '%s'\n", metricName) continue // Skip metric if we can't associate it with a model. } wrenMetric.Models = []string{baseModel} wrenMetric.Dimensions = findTimeDimensionsForModel(semanticData, baseModel) // --- 5. Build the specific aggregation expression based on the metric type --- metricType := getStringFromMap(metricMap, "type", "") wrenMetric.Aggregation = buildAggregationExpression(metricType, typeParams, measureDataLookup) // --- 6. Final validation before adding to the list --- // A metric is only valid if it has a base model and a valid aggregation expression. if wrenMetric.Aggregation != "" && len(wrenMetric.Models) > 0 { wrenMetrics = append(wrenMetrics, wrenMetric) } } return wrenMetrics } // buildMeasureLookups preprocesses the semantic models to create two essential maps: // 1. measureToModelMap: Maps a measure's name to the name of the model it belongs to. // 2. measureDataLookup: Maps a measure's name to its full data map for easy access to properties like `agg` and `expr`. func buildMeasureLookups(semanticData map[string]interface{}) (map[string]string, map[string]map[string]interface{}) { measureToModelMap := make(map[string]string) measureDataLookup := make(map[string]map[string]interface{}) semanticModels, ok := semanticData["semantic_models"].([]interface{}) if !ok { return measureToModelMap, measureDataLookup } for _, sm := range semanticModels { smMap, ok := sm.(map[string]interface{}) if !ok { continue } modelName := getStringFromMap(smMap, "name", "") if modelName == "" { continue } if measures, ok := smMap["measures"].([]interface{}); ok { for _, m := range measures { if measureMap, ok := m.(map[string]interface{}); ok { measureName := getStringFromMap(measureMap, "name", "") if measureName != "" { measureToModelMap[measureName] = modelName measureDataLookup[measureName] = measureMap } } } } } return measureToModelMap, measureDataLookup } // findBaseModelForMetric identifies the underlying base model for a given metric // by looking at its "input_measures". func findBaseModelForMetric(typeParams map[string]interface{}, measureToModelMap map[string]string) string { inputMeasuresValue, ok := typeParams["input_measures"] if !ok { // Fallback for simple metrics that use "measure" instead of "input_measures" if measureValue, ok := typeParams["measure"]; ok { if measureMap, ok := measureValue.(map[string]interface{}); ok { measureName := getStringFromMap(measureMap, "name", "") if model, exists := measureToModelMap[measureName]; exists { return model } } } return "" } inputMeasuresList, ok := inputMeasuresValue.([]interface{}) if !ok || len(inputMeasuresList) == 0 { return "" } // Assume all measures for a given metric come from the same base model. // We only need to find the first valid one. for _, inputMeasure := range inputMeasuresList { if imMap, ok := inputMeasure.(map[string]interface{}); ok { imName := getStringFromMap(imMap, "name", "") if model, exists := measureToModelMap[imName]; exists { return model // Return the first model we find. } } } return "" } // findTimeDimensionsForModel scans the semantic models to find all columns // marked with type "time" for a specific model name. func findTimeDimensionsForModel(semanticData map[string]interface{}, baseModelName string) []string { var timeDimensions []string semanticModels, ok := semanticData["semantic_models"].([]interface{}) if !ok { return timeDimensions } for _, sm := range semanticModels { smMap, ok := sm.(map[string]interface{}) if !ok { continue } if getStringFromMap(smMap, "name", "") == baseModelName { if dims, ok := smMap["dimensions"].([]interface{}); ok { for _, d := range dims { if dimMap, ok := d.(map[string]interface{}); ok { if getStringFromMap(dimMap, "type", "") == "time" { timeDimensions = append(timeDimensions, getStringFromMap(dimMap, "name", "")) } } } } break // Found the model, no need to continue looping. } } return timeDimensions } // buildAggregationExpression constructs the SQL aggregation string for a Wren metric // based on its dbt type ('simple', 'ratio', or 'derived'). func buildAggregationExpression(metricType string, typeParams map[string]interface{}, measureDataLookup map[string]map[string]interface{}) string { switch metricType { case "simple": // A simple metric is a direct aggregation of one measure (e.g., SUM(revenue)). if measure, ok := typeParams["measure"].(map[string]interface{}); ok { measureName := getStringFromMap(measure, "name", "") if measureData, ok := measureDataLookup[measureName]; ok { agg := getStringFromMap(measureData, "agg", "sum") // Default to SUM expr := getStringFromMap(measureData, "expr", measureName) // Fallback to measure name return fmt.Sprintf("%s(%s)", strings.ToUpper(agg), expr) } } case "ratio": // A ratio metric is a division of two measures (e.g., SUM(profit) / SUM(revenue)). num, numOK := typeParams["numerator"].(map[string]interface{}) den, denOK := typeParams["denominator"].(map[string]interface{}) if !numOK || !denOK { return "" } numName := getStringFromMap(num, "name", "") denName := getStringFromMap(den, "name", "") numData, numDataOK := measureDataLookup[numName] denData, denDataOK := measureDataLookup[denName] if numDataOK && denDataOK { numAgg := strings.ToUpper(getStringFromMap(numData, "agg", "sum")) denAgg := strings.ToUpper(getStringFromMap(denData, "agg", "sum")) numExpr := getStringFromMap(numData, "expr", numName) denExpr := getStringFromMap(denData, "expr", denName) return fmt.Sprintf("(%s(%s)) / (%s(%s))", numAgg, numExpr, denAgg, denExpr) } case "derived": // A derived metric uses a freeform SQL expression. return getStringFromMap(typeParams, "expr", "") } return "" // Return empty string if no valid aggregation could be built. } // extractDescriptionsFromManifest parses the manifest.json data to find the // model-level description and a map of all column-level descriptions. func extractDescriptionsFromManifest(manifestData map[string]interface{}, nodeKey string) (string, map[string]string) { if manifestData == nil { return "", nil } nodes, ok := manifestData["nodes"].(map[string]interface{}) if !ok { return "", nil } manifestNode, ok := nodes[nodeKey].(map[string]interface{}) if !ok { return "", nil } // Extract the top-level model description modelDescription := getStringFromMap(manifestNode, "description", "") columnDescriptions := make(map[string]string) manifestColumns, ok := manifestNode["columns"].(map[string]interface{}) if !ok { // Return the model description even if columns aren't found return modelDescription, nil } // Iterate through columns to extract their descriptions for colName, colData := range manifestColumns { if colMap, ok := colData.(map[string]interface{}); ok { if description := getStringFromMap(colMap, "description", ""); description != "" { columnDescriptions[colName] = description } } } return modelDescription, columnDescriptions } // buildWrenColumn creates a single WrenColumn from its corresponding dbt column data map. // It populates the name, type, and properties like enums, descriptions, and comments. func buildWrenColumn(colMap map[string]interface{}, nodeKey string, dataSource DataSource, columnDescriptions map[string]string, columnToEnumNameMap map[string]string, columnToNotNullMap map[string]bool) WrenColumn { columnName := getStringFromMap(colMap, "name", "") columnKey := fmt.Sprintf("%s.%s", nodeKey, columnName) column := WrenColumn{ Name: columnName, DisplayName: getStringFromMap(getMapFromMap(colMap, "meta", nil), "label", ""), Type: dataSource.MapType(getStringFromMap(colMap, "type", "")), NotNull: columnToNotNullMap[columnKey], // Defaults to false if not found } // Use a temporary map to build the properties properties := make(map[string]string) if description, exists := columnDescriptions[column.Name]; exists && description != "" { properties["description"] = description } if comment := getStringFromMap(colMap, "comment", ""); comment != "" { properties["comment"] = comment } // Assign an enum if one was derived from dbt tests // TODO: enum isn't implemented in Wren yet, putting this here for future use if enumName, ok := columnToEnumNameMap[columnKey]; ok { properties["enumDefinition"] = enumName } // Assign the properties map only if it's not empty if len(properties) > 0 { column.Properties = properties } return column } // convertAndSortColumns extracts, sorts, and converts dbt columns to the WrenColumn format. func convertAndSortColumns(nodeData map[string]interface{}, nodeKey string, dataSource DataSource, columnDescriptions map[string]string, columnToEnumNameMap map[string]string, columnToNotNullMap map[string]bool) ([]WrenColumn, error) { columnsValue, exists := nodeData["columns"] if !exists { return nil, fmt.Errorf("no columns found for model %s", nodeKey) } columnsMap, ok := columnsValue.(map[string]interface{}) if !ok { return nil, fmt.Errorf("invalid columns format for model %s", nodeKey) } // Convert map to a slice for sorting var columnsData []map[string]interface{} for _, colValue := range columnsMap { if colMap, ok := colValue.(map[string]interface{}); ok { columnsData = append(columnsData, colMap) } } // Sort columns by the 'index' field, falling back to name sort.Slice(columnsData, func(i, j int) bool { indexI, okI := columnsData[i]["index"].(float64) indexJ, okJ := columnsData[j]["index"].(float64) if okI && okJ { return indexI < indexJ } return getStringFromMap(columnsData[i], "name", "") < getStringFromMap(columnsData[j], "name", "") }) // Build the final slice of WrenColumns var wrenColumns []WrenColumn for _, colMap := range columnsData { if getStringFromMap(colMap, "name", "") == "" { continue } column := buildWrenColumn(colMap, nodeKey, dataSource, columnDescriptions, columnToEnumNameMap, columnToNotNullMap) wrenColumns = append(wrenColumns, column) } return wrenColumns, nil } // convertDbtNodeToWrenModel converts a single dbt node to a Wren model. // This function now orchestrates calls to helpers to perform the conversion. func convertDbtNodeToWrenModel(nodeKey string, nodeData map[string]interface{}, dataSource DataSource, manifestData map[string]interface{}, columnToEnumNameMap map[string]string, columnToNotNullMap map[string]bool, modelToPrimaryKeyMap map[string]string) (*WrenModel, error) { modelName := getModelNameFromNodeKey(nodeKey) if modelName == "" { return nil, fmt.Errorf("invalid node key format: %s", nodeKey) } // --- 1. Extract Metadata and Table Reference --- metadataValue, exists := nodeData["metadata"] if !exists { return nil, fmt.Errorf("no metadata found for model %s", nodeKey) } metadata, ok := metadataValue.(map[string]interface{}) if !ok { return nil, fmt.Errorf("invalid metadata format for model %s", nodeKey) } tableRef := TableReference{ Table: getStringFromMap(metadata, "name", modelName), Catalog: getStringFromMap(metadata, "database", ""), Schema: getStringFromMap(metadata, "schema", ""), } // --- 2. Extract Descriptions from Manifest --- modelDescription, columnDescriptions := extractDescriptionsFromManifest(manifestData, nodeKey) // --- 3. Convert and Sort Columns --- wrenColumns, err := convertAndSortColumns(nodeData, nodeKey, dataSource, columnDescriptions, columnToEnumNameMap, columnToNotNullMap) if err != nil { return nil, err } // --- 4. Assemble the Final WrenModel --- model := &WrenModel{ Name: modelName, TableReference: tableRef, Columns: wrenColumns, } // Set primary key if available if pk, ok := modelToPrimaryKeyMap[modelName]; ok { model.PrimaryKey = pk } // Set model description if available if modelDescription != "" { model.Properties = map[string]string{"description": modelDescription} } return model, nil } // getStringFromMap safely extracts a string value from a map func getStringFromMap(m map[string]interface{}, key, defaultValue string) string { if m == nil { return defaultValue } if value, exists := m[key]; exists { if str, ok := value.(string); ok { return str } } return defaultValue } // getMapFromMap safely extracts a map value from a map func getMapFromMap(m map[string]interface{}, key string, defaultValue map[string]interface{}) map[string]interface{} { if value, exists := m[key]; exists { if str, ok := value.(map[string]interface{}); ok { return str } } return defaultValue } // getModelNameFromNodeKey extracts the model name from a dbt node key. // e.g., "model.jaffle_shop.customers" -> "customers" func getModelNameFromNodeKey(nodeKey string) string { parts := strings.Split(nodeKey, ".") if len(parts) > 0 { return parts[len(parts)-1] } return "" } var refRegex = regexp.MustCompile(`ref\s*\(\s*['"]([^'"]+)['"]\s*\)`) // parseRef extracts the model name from a dbt ref string. // e.g., "ref('stg_orders')" func parseRef(refStr string) string { // Use the precompiled regex to find matches. matches := refRegex.FindStringSubmatch(refStr) if len(matches) > 1 { // The first submatch (index 1) is the captured group, // which is the model name we want. return matches[1] } return "" } ================================================ FILE: wren-launcher/commands/dbt/data_source.go ================================================ package dbt import ( "encoding/base64" "encoding/json" "fmt" "os" "path/filepath" "strconv" "strings" "github.com/pterm/pterm" ) // Constants for data types const ( integerType = "integer" smallintType = "smallint" bigintType = "bigint" floatType = "float" decimalType = "decimal" varcharType = "varchar" charType = "char" textType = "text" dateType = "date" timestampType = "timestamp" timestamptzType = "timestamptz" doubleType = "double" booleanType = "boolean" jsonType = "json" intervalType = "interval" postgresType = "postgres" ) // Constants for SQL data types const ( integerSQL = "INTEGER" intSQL = "INT" bigintSQL = "BIGINT" varcharSQL = "VARCHAR" textSQL = "TEXT" stringSQL = "STRING" dateSQL = "DATE" timestampSQL = "TIMESTAMP" datetimeSQL = "DATETIME" doubleSQL = "DOUBLE" floatSQL = "FLOAT" numericSQL = "NUMERIC" decimalSQL = "DECIMAL" booleanSQL = "BOOLEAN" boolSQL = "BOOL" jsonSQL = "JSON" ) // DataSource is a common interface for all data source types type DataSource interface { GetType() string Validate() error MapType(sourceType string) string } // FromDbtProfiles converts DBT profiles to DataSources // Returns a DataSource slice since a profile may contain multiple outputs func FromDbtProfiles(profiles *DbtProfiles) ([]DataSource, error) { if profiles == nil { return nil, fmt.Errorf("profiles cannot be nil") } var dataSources []DataSource // Iterate through all profiles for profileName, profile := range profiles.Profiles { // Iterate through each profile's outputs for outputName, connection := range profile.Outputs { dataSource, err := convertConnectionToDataSource(connection, "", profileName, outputName) if err != nil { return nil, fmt.Errorf("failed to convert connection %s.%s: %w", profileName, outputName, err) } if dataSource != nil { dataSources = append(dataSources, dataSource) } } } return dataSources, nil } // convertConnectionToDataSource converts connection to corresponding DataSource based on connection type func convertConnectionToDataSource(conn DbtConnection, dbtHomePath, profileName, outputName string) (DataSource, error) { switch strings.ToLower(conn.Type) { case postgresType, "postgresql": return convertToPostgresDataSource(conn) case "duckdb": return convertToLocalFileDataSource(conn, dbtHomePath) case "sqlserver": return convertToMSSQLDataSource(conn) case "mysql": return convertToMysqlDataSource(conn) case "bigquery": // Pass the dbtHomePath to the BigQuery converter return convertToBigQueryDataSource(conn, dbtHomePath) default: // For unsupported database types, we can choose to ignore or return error // Here we choose to return nil and log a warning pterm.Warning.Printf("Unsupported database type '%s' for %s.%s\n", conn.Type, profileName, outputName) return nil, nil } } // convertToPostgresDataSource converts to PostgreSQL data source func convertToPostgresDataSource(conn DbtConnection) (*WrenPostgresDataSource, error) { // For PostgreSQL, prefer dbname over database field dbName := conn.DbName if dbName == "" { dbName = conn.Database } pterm.Info.Printf("Converting Postgres data source: %s:%d/%s\n", conn.Host, conn.Port, dbName) port := strconv.Itoa(conn.Port) if conn.Port == 0 { port = "5432" } ds := &WrenPostgresDataSource{ Host: conn.Host, Port: port, Database: dbName, User: conn.User, Password: conn.Password, } return ds, nil } func convertToMSSQLDataSource(conn DbtConnection) (*WrenMSSQLDataSource, error) { port := strconv.Itoa(conn.Port) if conn.Port == 0 { port = "1433" } ds := &WrenMSSQLDataSource{ Database: conn.Database, Host: conn.Server, Port: port, User: conn.User, Password: conn.Password, TdsVersion: "8.0", // the default tds version for Wren engine image Driver: "ODBC Driver 18 for SQL Server", // the driver used by Wren engine image Kwargs: map[string]interface{}{"TrustServerCertificate": "YES"}, } return ds, nil } // convertToLocalFileDataSource converts to local file data source func convertToLocalFileDataSource(conn DbtConnection, dbtHome string) (*WrenLocalFileDataSource, error) { // For file types, we need to get URL and format info from Additional fields // or use some conventional field names resolvePath := func(path string) string { if filepath.IsAbs(path) { return filepath.Dir(path) } relativeDir := filepath.Dir(path) if dbtHome != "" { return filepath.Join(dbtHome, relativeDir) } return relativeDir } var url, format string // Try to get file path from different fields if conn.Path != "" { url = resolvePath(conn.Path) } else if file, exists := conn.Additional["file"]; exists { if fileStr, ok := file.(string); ok { url = resolvePath(fileStr) } } // Try to get format information format = "duckdb" // Default to duckdb if not specified if url == "" { return nil, fmt.Errorf("file path not found in connection configuration") } return &WrenLocalFileDataSource{ Url: url, Format: format, }, nil } func convertToMysqlDataSource(conn DbtConnection) (*WrenMysqlDataSource, error) { pterm.Info.Printf("Converting MySQL data source: %s:%d/%s\n", conn.Host, conn.Port, conn.Database) sslMode := "ENABLED" // Default SSL mode if conn.SslDisable { sslMode = "DISABLED" } port := strconv.Itoa(conn.Port) if conn.Port == 0 { port = "3306" } ds := &WrenMysqlDataSource{ Host: conn.Host, Port: port, Database: conn.Database, User: conn.User, Password: conn.Password, SslMode: sslMode, } return ds, nil } // convertToBigQueryDataSource converts to BigQuery data source func convertToBigQueryDataSource(conn DbtConnection, dbtHomePath string) (*WrenBigQueryDataSource, error) { method := strings.ToLower(strings.TrimSpace(conn.Method)) var credentials string // Helper: validate JSON and base64 encode encodeJSON := func(b []byte) (string, error) { var js map[string]interface{} if err := json.Unmarshal(b, &js); err != nil { return "", fmt.Errorf("service account JSON is invalid: %w", err) } return base64.StdEncoding.EncodeToString(b), nil } switch method { case "service-account-json": // Extract inline JSON from Additional["keyfile_json"] var keyfileJSON string if kfj, exists := conn.Additional["keyfile_json"]; exists { if kfjStr, ok := kfj.(string); ok { keyfileJSON = kfjStr } } if keyfileJSON == "" { return nil, fmt.Errorf("bigquery: method 'service-account-json' requires 'keyfile_json'") } enc, err := encodeJSON([]byte(keyfileJSON)) if err != nil { return nil, err } credentials = enc case "service-account", "": // Prefer structured field; fall back to Additional["keyfile"] keyfilePath := strings.TrimSpace(conn.Keyfile) if keyfilePath == "" { if kf, ok := conn.Additional["keyfile"]; ok { if kfStr, ok := kf.(string); ok { keyfilePath = strings.TrimSpace(kfStr) } } } if keyfilePath == "" { // If method was omitted (""), try as a fallback to inline json if kfj, ok := conn.Additional["keyfile_json"]; ok { if kfjStr, ok := kfj.(string); ok && kfjStr != "" { enc, err := encodeJSON([]byte(kfjStr)) if err != nil { return nil, err } credentials = enc } } if credentials == "" { return nil, fmt.Errorf("bigquery: method 'service-account' requires 'keyfile' path") } } else { // If keyfile path is not absolute, join it // with the dbt project's home directory path. resolvedKeyfilePath := keyfilePath if !filepath.IsAbs(keyfilePath) && dbtHomePath != "" { resolvedKeyfilePath = filepath.Join(dbtHomePath, keyfilePath) } cleanPath := filepath.Clean(resolvedKeyfilePath) b, err := os.ReadFile(cleanPath) if err != nil { // Update the error message to show the path that was attempted return nil, fmt.Errorf("failed to read keyfile '%s': %w", cleanPath, err) } enc, err := encodeJSON(b) if err != nil { return nil, err } credentials = enc } case "oauth": pterm.Warning.Println("bigquery: oauth auth method is not supported; skipping data source") return nil, nil default: pterm.Warning.Printf("bigquery: unsupported auth method '%s'; supported: service-account, service-account-json\n", method) return nil, nil } ds := &WrenBigQueryDataSource{ Project: conn.Project, Dataset: conn.Dataset, Credentials: credentials, } return ds, nil } type WrenLocalFileDataSource struct { Url string `json:"url"` Format string `json:"format"` } // GetType implements DataSource interface func (ds *WrenLocalFileDataSource) GetType() string { return "local_file" } // Validate implements DataSource interface func (ds *WrenLocalFileDataSource) Validate() error { if ds.Url == "" { return fmt.Errorf("file URL cannot be empty") } if ds.Format == "" { return fmt.Errorf("file format cannot be empty") } return nil } func (ds *WrenLocalFileDataSource) MapType(sourceType string) string { // Convert to uppercase for consistent mapping sourceType = strings.ToUpper(sourceType) switch sourceType { case integerSQL, intSQL, bigintSQL: return integerType case varcharSQL, textSQL, stringSQL: return varcharType case dateSQL: return dateType case timestampSQL, datetimeSQL: return timestampType case doubleSQL, floatSQL, numericSQL, decimalSQL: return doubleType case booleanSQL, boolSQL: return booleanType default: // Return the original type if no mapping is found return strings.ToLower(sourceType) } } type WrenPostgresDataSource struct { Host string `json:"host"` Port string `json:"port"` Database string `json:"database"` User string `json:"user"` Password string `json:"password"` } // GetType implements DataSource interface func (ds *WrenPostgresDataSource) GetType() string { return postgresType } // Validate implements DataSource interface func (ds *WrenPostgresDataSource) Validate() error { if ds.Host == "" { return fmt.Errorf("host cannot be empty") } if ds.Database == "" { return fmt.Errorf("database cannot be empty") } if ds.User == "" { return fmt.Errorf("user cannot be empty") } if ds.Port == "" { return fmt.Errorf("port must be specified") } port, err := strconv.Atoi(ds.Port) if err != nil { return fmt.Errorf("port must be a valid number") } if port <= 0 || port > 65535 { return fmt.Errorf("port must be between 1 and 65535") } return nil } func (ds *WrenPostgresDataSource) MapType(sourceType string) string { // This method is not used in WrenPostgresDataSource, but required by DataSource interface return sourceType } type WrenMSSQLDataSource struct { Database string `json:"database"` Host string `json:"host"` Port string `json:"port"` User string `json:"user"` Password string `json:"password"` TdsVersion string `json:"tds_version"` Driver string `json:"driver"` Kwargs map[string]interface{} `json:"kwargs"` } func (ds *WrenMSSQLDataSource) GetType() string { return "mssql" } func (ds *WrenMSSQLDataSource) Validate() error { if ds.Host == "" { return fmt.Errorf("host cannot be empty") } if ds.Database == "" { return fmt.Errorf("database cannot be empty") } if ds.User == "" { return fmt.Errorf("user cannot be empty") } if ds.Port == "" { return fmt.Errorf("port must be specified") } port, err := strconv.Atoi(ds.Port) if err != nil { return fmt.Errorf("port must be a valid number") } if port <= 0 || port > 65535 { return fmt.Errorf("port must be between 1 and 65535") } if ds.Password == "" { return fmt.Errorf("password cannot be empty") } return nil } func (ds *WrenMSSQLDataSource) MapType(sourceType string) string { // This method is not used in WrenMSSQLDataSource, but required by DataSource interface switch strings.ToLower(sourceType) { case charType, "nchar": return charType case varcharType, "nvarchar": return varcharType case textType, "ntext": return textType case "bit", "tinyint": return booleanType case "smallint": return smallintType case "int": return integerType case "bigint": return bigintType case booleanType: return booleanType case "float", "real": return floatType case "decimal", "numeric", "money", "smallmoney": return decimalType case "date": return dateType case "datetime", "datetime2", "smalldatetime": return timestampType case "time": return intervalType case "datetimeoffset": return timestamptzType case "json": return jsonType default: return strings.ToLower(sourceType) } } type WrenMysqlDataSource struct { Database string `json:"database"` Host string `json:"host"` Password string `json:"password"` Port string `json:"port"` User string `json:"user"` SslCA string `json:"ssl_ca,omitempty"` // Optional SSL CA file for MySQL SslMode string `json:"ssl_mode,omitempty"` // Optional SSL mode for MySQL } // GetType implements DataSource interface func (ds *WrenMysqlDataSource) GetType() string { return "mysql" } // Validate implements DataSource interface func (ds *WrenMysqlDataSource) Validate() error { if ds.Host == "" { return fmt.Errorf("host cannot be empty") } if ds.Database == "" { return fmt.Errorf("database cannot be empty") } if ds.User == "" { return fmt.Errorf("user cannot be empty") } if ds.Port == "" { return fmt.Errorf("port must be specified") } port, err := strconv.Atoi(ds.Port) if err != nil { return fmt.Errorf("port must be a valid number") } if port <= 0 || port > 65535 { return fmt.Errorf("port must be between 1 and 65535") } return nil } func (ds *WrenMysqlDataSource) MapType(sourceType string) string { // This method is not used in WrenMysqlDataSource, but required by DataSource interface sourceType = strings.ToUpper(sourceType) switch sourceType { case "CHAR": return "char" case "VARCHAR": return varcharType case "TEXT", "TINYTEXT", "MEDIUMTEXT", "LONGTEXT", "ENUM", "SET": return "text" case "BIT", "TINYINT": return "TINYINT" case "SMALLINT": return "SMALLINT" case "MEDIUMINT", "INT", integerSQL: return "INTEGER" case "BIGINT": return "BIGINT" case "FLOAT", "DOUBLE": return "DOUBLE" case decimalSQL, "NUMERIC": return decimalSQL case dateSQL: return dateSQL case datetimeSQL: return datetimeSQL case "TIMESTAMP": return "TIMESTAMPTZ" case booleanSQL, "BOOL": return booleanSQL case jsonSQL: return jsonSQL default: // Return the original type if no mapping is found return strings.ToLower(sourceType) } } type WrenBigQueryDataSource struct { Project string `json:"project_id"` Dataset string `json:"dataset_id"` Credentials string `json:"credentials"` } // GetType implements DataSource interface func (ds *WrenBigQueryDataSource) GetType() string { return "bigquery" } // Validate implements DataSource interface func (ds *WrenBigQueryDataSource) Validate() error { if strings.TrimSpace(ds.Project) == "" { return fmt.Errorf("project_id cannot be empty") } if strings.TrimSpace(ds.Dataset) == "" { return fmt.Errorf("dataset_id cannot be empty") } if strings.TrimSpace(ds.Credentials) == "" { return fmt.Errorf("credentials cannot be empty") } return nil } // MapType implements DataSource interface func (ds *WrenBigQueryDataSource) MapType(sourceType string) string { switch strings.ToUpper(sourceType) { case "INT64", "INTEGER": return integerType case "FLOAT64", "FLOAT": return doubleType case "STRING": return varcharType case "BOOL", "BOOLEAN": return booleanType case "DATE": return dateType case "TIMESTAMP", "DATETIME": return timestampType case "NUMERIC", "DECIMAL", "BIGNUMERIC": return doubleType case "BYTES": return varcharType case "JSON": return varcharType default: return strings.ToLower(sourceType) } } // GetActiveDataSources gets active data sources based on specified profile and target // If profileName is empty, it will use the first found profile // If targetName is empty, it will use the profile's default target func GetActiveDataSources(profiles *DbtProfiles, dbtHomePath, profileName, targetName string) ([]DataSource, error) { if profiles == nil { return nil, fmt.Errorf("profiles cannot be nil") } // If no profile is specified, use the first one if profileName == "" { for name := range profiles.Profiles { profileName = name break } } profile, exists := profiles.Profiles[profileName] if !exists { return nil, fmt.Errorf("profile '%s' not found", profileName) } // If no target is specified, use the default one if targetName == "" { targetName = profile.Target } connection, exists := profile.Outputs[targetName] if !exists { return nil, fmt.Errorf("target '%s' not found in profile '%s'", targetName, profileName) } dataSource, err := convertConnectionToDataSource(connection, dbtHomePath, profileName, targetName) if err != nil { return nil, fmt.Errorf("failed to convert connection %s.%s: %w", profileName, targetName, err) } if dataSource == nil { return []DataSource{}, nil } return []DataSource{dataSource}, nil } // GetDataSourceByType gets all data sources of specified type from profiles func GetDataSourceByType(profiles *DbtProfiles, dsType string) ([]DataSource, error) { dataSources, err := FromDbtProfiles(profiles) if err != nil { return nil, err } var filtered []DataSource for _, ds := range dataSources { if ds.GetType() == dsType { filtered = append(filtered, ds) } } return filtered, nil } // ValidateAllDataSources validates all converted data sources func ValidateAllDataSources(profiles *DbtProfiles) error { dataSources, err := FromDbtProfiles(profiles) if err != nil { return err } var errors []error for i, ds := range dataSources { if err := ds.Validate(); err != nil { errors = append(errors, fmt.Errorf("data source %d (%s): %w", i, ds.GetType(), err)) } } if len(errors) > 0 { var errorMsg string for _, err := range errors { errorMsg += err.Error() + "; " } return fmt.Errorf("validation errors: %s", errorMsg) } return nil } // DefaultDataSource is a default data source when no profiles.yml is found type DefaultDataSource struct{} // GetType implements DataSource interface func (d *DefaultDataSource) GetType() string { return "default" } // Validate implements DataSource interface func (d *DefaultDataSource) Validate() error { return nil } func (d *DefaultDataSource) MapType(sourceType string) string { // Default type mapping switch strings.ToLower(sourceType) { case "integer", "int", "bigint", "int64": return "integer" case "varchar", "text", "string", "char": return varcharType case "timestamp", "datetime", "date": return "timestamp" case "double", "float", "decimal", "numeric": return "double" case "boolean", "bool": return "boolean" default: return strings.ToLower(sourceType) } } ================================================ FILE: wren-launcher/commands/dbt/data_source_test.go ================================================ package dbt import ( "encoding/base64" "os" "path/filepath" "testing" ) // Test constants const ( testHost = "localhost" testUser = "test_user" testPassword = "test_pass" pgType = "postgres" duckdbType = "duckdb" ) // Helper function to validate PostgreSQL data source func validatePostgresDataSource(t *testing.T, ds *WrenPostgresDataSource, expectedDB string) { t.Helper() if ds.Host != testHost { t.Errorf("Expected host '%s', got '%s'", testHost, ds.Host) } if ds.Port != "5432" { t.Errorf("Expected port 5432, got %s", ds.Port) } if ds.Database != expectedDB { t.Errorf("Expected database '%s', got '%s'", expectedDB, ds.Database) } if ds.User != testUser { t.Errorf("Expected user '%s', got '%s'", testUser, ds.User) } if ds.Password != testPassword { t.Errorf("Expected password '%s', got '%s'", testPassword, ds.Password) } // Test validation if err := ds.Validate(); err != nil { t.Errorf("Validation failed: %v", err) } // Test type if ds.GetType() != pgType { t.Errorf("Expected type '%s', got '%s'", pgType, ds.GetType()) } } func TestFromDbtProfiles_Postgres(t *testing.T) { // Test PostgreSQL connection conversion profiles := &DbtProfiles{ Profiles: map[string]DbtProfile{ "test_profile": { Target: "dev", Outputs: map[string]DbtConnection{ "dev": { Type: pgType, Host: testHost, Port: 5432, Database: "test_db", User: testUser, Password: testPassword, }, }, }, }, } dataSources, err := FromDbtProfiles(profiles) if err != nil { t.Fatalf("FromDbtProfiles failed: %v", err) } if len(dataSources) != 1 { t.Fatalf("Expected 1 data source, got %d", len(dataSources)) } ds, ok := dataSources[0].(*WrenPostgresDataSource) if !ok { t.Fatalf("Expected WrenPostgresDataSource, got %T", dataSources[0]) } validatePostgresDataSource(t, ds, "test_db") } func TestFromDbtProfiles_PostgresWithDefaultPort(t *testing.T) { // Test PostgreSQL connection conversion when port is not specified profiles := &DbtProfiles{ Profiles: map[string]DbtProfile{ "test_profile": { Target: "dev", Outputs: map[string]DbtConnection{ "dev": { Type: "postgres", Host: "localhost", Port: 5432, DbName: "jaffle_shop", // Using dbname instead of database User: "test_user", Password: "test_pass", }, }, }, }, } dataSources, err := FromDbtProfiles(profiles) if err != nil { t.Fatalf("FromDbtProfiles failed: %v", err) } if len(dataSources) != 1 { t.Fatalf("Expected 1 data source, got %d", len(dataSources)) } ds, ok := dataSources[0].(*WrenPostgresDataSource) if !ok { t.Fatalf("Expected WrenPostgresDataSource, got %T", dataSources[0]) } if ds.Host != "localhost" { t.Errorf("Expected host 'localhost', got '%s'", ds.Host) } if ds.Port != "5432" { t.Errorf("Expected port 5432, got %s", ds.Port) } if ds.Database != "jaffle_shop" { t.Errorf("Expected database 'jaffle_shop', got '%s'", ds.Database) } if ds.User != "test_user" { t.Errorf("Expected user 'test_user', got '%s'", ds.User) } if ds.Password != "test_pass" { t.Errorf("Expected password 'test_pass', got '%s'", ds.Password) } // Test validation if err := ds.Validate(); err != nil { t.Errorf("Validation failed: %v", err) } // Test type if ds.GetType() != "postgres" { t.Errorf("Expected type 'postgres', got '%s'", ds.GetType()) } } func TestFromDbtProfiles_LocalFile(t *testing.T) { // Test local file connection conversion profiles := &DbtProfiles{ Profiles: map[string]DbtProfile{ "test_profile": { Target: "dev", Outputs: map[string]DbtConnection{ "dev": { Type: duckdbType, Path: "/abs_path/jaffle_shop.duckdb", }, }, }, }, } dataSources, err := FromDbtProfiles(profiles) if err != nil { t.Fatalf("FromDbtProfiles failed: %v", err) } if len(dataSources) != 1 { t.Fatalf("Expected 1 data source, got %d", len(dataSources)) } ds, ok := dataSources[0].(*WrenLocalFileDataSource) if !ok { t.Fatalf("Expected WrenLocalFileDataSource, got %T", dataSources[0]) } if filepath.ToSlash(ds.Url) != "/abs_path" { t.Errorf("Expected url '/abs_path', got '%s'", ds.Url) } if ds.Format != duckdbType { t.Errorf("Expected format '%s', got '%s'", duckdbType, ds.Format) } // Test validation if err := ds.Validate(); err != nil { t.Errorf("Validation failed: %v", err) } // Test type if ds.GetType() != "local_file" { t.Errorf("Expected type 'local_file', got '%s'", ds.GetType()) } } func TestFromDbtProfiles_UnsupportedType(t *testing.T) { // Test unsupported database type profiles := &DbtProfiles{ Profiles: map[string]DbtProfile{ "test_profile": { Target: "dev", Outputs: map[string]DbtConnection{ "dev": { Type: "unsupported_db", Host: "localhost", }, }, }, }, } dataSources, err := FromDbtProfiles(profiles) if err != nil { t.Fatalf("FromDbtProfiles failed: %v", err) } // Unsupported types should be ignored, returning empty list if len(dataSources) != 0 { t.Fatalf("Expected 0 data sources for unsupported type, got %d", len(dataSources)) } } func TestFromMssqlProfiles(t *testing.T) { // Test MSSQL connection conversion profiles := &DbtProfiles{ Profiles: map[string]DbtProfile{ "test_profile": { Target: "dev", Outputs: map[string]DbtConnection{ "dev": { Type: "sqlserver", Server: testHost, Port: 1433, Database: "test_db", User: testUser, Password: testPassword, }, }, }, }, } dataSources, err := FromDbtProfiles(profiles) if err != nil { t.Fatalf("FromDbtProfiles failed: %v", err) } if len(dataSources) != 1 { t.Fatalf("Expected 1 data source, got %d", len(dataSources)) } ds, ok := dataSources[0].(*WrenMSSQLDataSource) if !ok { t.Fatalf("Expected WrenMSSQLDataSource, got %T", dataSources[0]) } if ds.Host != testHost { t.Errorf("Expected host '%s', got '%s'", testHost, ds.Host) } if ds.Port != "1433" { t.Errorf("Expected port 1433, got %s", ds.Port) } if ds.Database != "test_db" { t.Errorf("Expected database 'test_db', got '%s'", ds.Database) } if ds.User != testUser { t.Errorf("Expected user '%s', got '%s'", testUser, ds.User) } if ds.Password != testPassword { t.Errorf("Expected password '%s', got '%s'", testPassword, ds.Password) } if ds.TdsVersion != "8.0" { t.Errorf("Expected TDS version '8.0', got '%s'", ds.TdsVersion) } if ds.Driver != "ODBC Driver 18 for SQL Server" { t.Errorf("Expected driver 'ODBC Driver 18 for SQL Server', got '%s'", ds.Driver) } if ds.Kwargs["TrustServerCertificate"] != "YES" { t.Errorf("Expected TrustServerCertificate 'YES', got '%s'", ds.Kwargs["TrustServerCertificate"]) } } func TestFromDbtProfiles_NilProfiles(t *testing.T) { // Test nil profiles _, err := FromDbtProfiles(nil) if err == nil { t.Fatal("Expected error for nil profiles") } } func TestValidateAllDataSources(t *testing.T) { // Test valid profiles validProfiles := &DbtProfiles{ Profiles: map[string]DbtProfile{ "valid_project": { Target: "dev", Outputs: map[string]DbtConnection{ "dev": { Type: "postgres", Host: "localhost", Port: 5432, Database: "test_db", User: "user", }, }, }, }, } err := ValidateAllDataSources(validProfiles) if err != nil { t.Errorf("ValidateAllDataSources failed for valid profiles: %v", err) } // Test invalid profiles invalidProfiles := &DbtProfiles{ Profiles: map[string]DbtProfile{ "invalid_project": { Target: "dev", Outputs: map[string]DbtConnection{ "dev": { Type: "postgres", Host: "localhost", // Missing required fields }, }, }, }, } err = ValidateAllDataSources(invalidProfiles) if err == nil { t.Error("ValidateAllDataSources should fail for invalid profiles") } } func TestFromDbtProfiles_BigQuery(t *testing.T) { tempDir, err := os.MkdirTemp("", "test-dbt-home") if err != nil { t.Fatal(err) } defer func() { if err := os.RemoveAll(tempDir); err != nil { t.Logf("Failed to remove temporary directory %s: %v", tempDir, err) } }() t.Run("service-account-json", func(t *testing.T) { keyfileContent := `{"type": "service_account", "project_id": "test-project", "private_key_id": "test-key-id", "private_key": "test-private-key", "client_email": "test-client-email", "client_id": "test-client-id", "auth_uri": "test-auth-uri", "token_uri": "test-token-uri", "auth_provider_x509_cert_url": "test-cert-url", "client_x509_cert_url": "test-client-cert-url"}` // #nosec G101 profiles := &DbtProfiles{ Profiles: map[string]DbtProfile{ "test_profile": { Target: "dev", Outputs: map[string]DbtConnection{ "dev": { Type: "bigquery", Method: "service-account-json", Project: "test-project", Dataset: "test-dataset", Additional: map[string]interface{}{ "keyfile_json": keyfileContent, }, }, }, }, }, } dataSources, err := GetActiveDataSources(profiles, "", "test_profile", "dev") if err != nil { t.Fatalf("GetActiveDataSources failed: %v", err) } if len(dataSources) != 1 { t.Fatalf("Expected 1 data source, got %d", len(dataSources)) } ds, ok := dataSources[0].(*WrenBigQueryDataSource) if !ok { t.Fatalf("Expected WrenBigQueryDataSource, got %T", dataSources[0]) } if ds.Project != "test-project" { t.Errorf("Expected project 'test-project', got '%s'", ds.Project) } if ds.Dataset != "test-dataset" { t.Errorf("Expected dataset 'test-dataset', got '%s'", ds.Dataset) } encodedContent, _ := base64.StdEncoding.DecodeString(ds.Credentials) if string(encodedContent) != keyfileContent { t.Errorf("Expected base64-encoded keyfile JSON content, got different content") } }) t.Run("service-account-with-absolute-keyfile-path", func(t *testing.T) { keyfileContent := `{"type": "service_account"}` // #nosec G101 keyfilePath := filepath.Join(tempDir, "keyfile.json") if err := os.WriteFile(keyfilePath, []byte(keyfileContent), 0600); err != nil { t.Fatal(err) } profiles := &DbtProfiles{ Profiles: map[string]DbtProfile{ "test_profile": { Target: "dev", Outputs: map[string]DbtConnection{ "dev": { Type: "bigquery", Method: "service-account", Project: "test-project", Dataset: "test-dataset", Keyfile: keyfilePath, }, }, }, }, } dataSources, err := GetActiveDataSources(profiles, "", "test_profile", "dev") if err != nil { t.Fatalf("GetActiveDataSources failed: %v", err) } if len(dataSources) != 1 { t.Fatalf("Expected 1 data source, got %d", len(dataSources)) } ds, ok := dataSources[0].(*WrenBigQueryDataSource) if !ok { t.Fatalf("Expected WrenBigQueryDataSource, got %T", dataSources[0]) } encodedContent, _ := base64.StdEncoding.DecodeString(ds.Credentials) if string(encodedContent) != keyfileContent { t.Errorf("Expected base64-encoded keyfile content, got different content") } }) t.Run("service-account-with-relative-keyfile-path", func(t *testing.T) { dbtHomePath := tempDir keyfileContent := `{"type": "service_account"}` // #nosec G101 keyfilePath := "keys/keyfile.json" fullKeyfilePath := filepath.Join(dbtHomePath, keyfilePath) if err := os.MkdirAll(filepath.Dir(fullKeyfilePath), 0750); err != nil { t.Fatal(err) } if err := os.WriteFile(fullKeyfilePath, []byte(keyfileContent), 0600); err != nil { t.Fatal(err) } profiles := &DbtProfiles{ Profiles: map[string]DbtProfile{ "test_profile": { Target: "dev", Outputs: map[string]DbtConnection{ "dev": { Type: "bigquery", Method: "service-account", Project: "test-project", Dataset: "test-dataset", Keyfile: keyfilePath, }, }, }, }, } dataSources, err := GetActiveDataSources(profiles, dbtHomePath, "test_profile", "dev") if err != nil { t.Fatalf("GetActiveDataSources failed: %v", err) } if len(dataSources) != 1 { t.Fatalf("Expected 1 data source, got %d", len(dataSources)) } ds, ok := dataSources[0].(*WrenBigQueryDataSource) if !ok { t.Fatalf("Expected WrenBigQueryDataSource, got %T", dataSources[0]) } encodedContent, _ := base64.StdEncoding.DecodeString(ds.Credentials) if string(encodedContent) != keyfileContent { t.Errorf("Expected base64-encoded keyfile content, got different content") } }) } func TestBigQueryDataSourceValidation(t *testing.T) { tests := []struct { name string ds *WrenBigQueryDataSource wantErr bool }{ { name: "valid", ds: &WrenBigQueryDataSource{ Project: "test-project", Dataset: "test-dataset", Credentials: "dGVzdC1jcmVkZW50aWFscw==", // "test-credentials" }, wantErr: false, }, { name: "invalid - missing project", ds: &WrenBigQueryDataSource{ Project: "", Dataset: "test-dataset", Credentials: "dGVzdC1jcmVkZW50aWFscw==", }, wantErr: true, }, { name: "invalid - missing dataset", ds: &WrenBigQueryDataSource{ Project: "test-project", Dataset: "", Credentials: "dGVzdC1jcmVkZW50aWFscw==", }, wantErr: true, }, { name: "invalid - missing credentials", ds: &WrenBigQueryDataSource{ Project: "test-project", Dataset: "test-dataset", Credentials: "", }, wantErr: true, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { err := tt.ds.Validate() if (err != nil) != tt.wantErr { t.Errorf("Validate() error = %v, wantErr %v", err, tt.wantErr) } }) } } func TestPostgresDataSourceValidation(t *testing.T) { validDS := &WrenPostgresDataSource{ Host: testHost, Port: "5432", Database: "test", User: "user", } invalidCases := []struct { name string ds Validator }{ { "empty host", &WrenPostgresDataSource{ Port: "5432", Database: "test", User: "user", }, }, { "empty database", &WrenPostgresDataSource{ Host: testHost, Port: "5432", User: "user", }, }, { "invalid port", &WrenPostgresDataSource{ Host: testHost, Port: "0", Database: "test", User: "user", }, }, } testDataSourceValidation(t, "postgres", validDS, invalidCases) } func TestMysqlDataSourceValidation(t *testing.T) { // Test MySQL data source validation tests := []struct { name string ds *WrenMysqlDataSource wantErr bool }{ { name: "valid", ds: &WrenMysqlDataSource{ Host: "localhost", Port: "3306", Database: "test", User: "user", }, wantErr: false, }, { name: "empty host", ds: &WrenMysqlDataSource{ Port: "3306", Database: "test", User: "user", }, wantErr: true, }, { name: "empty database", ds: &WrenMysqlDataSource{ Host: "localhost", Port: "3306", User: "user", }, wantErr: true, }, { name: "invalid port", ds: &WrenMysqlDataSource{ Host: "localhost", Port: "", Database: "test", User: "user", }, wantErr: true, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { err := tt.ds.Validate() if (err != nil) != tt.wantErr { t.Errorf("Validate() error = %v, wantErr %v", err, tt.wantErr) } }) } } func TestGetActiveDataSources(t *testing.T) { profiles := &DbtProfiles{ Profiles: map[string]DbtProfile{ "project1": { Target: "dev", Outputs: map[string]DbtConnection{ "dev": { Type: "postgres", Host: "localhost", Port: 5432, Database: "dev_db", User: "dev_user", }, "prod": { Type: "postgres", Host: "prod-host", Port: 5432, Database: "prod_db", User: "prod_user", }, }, }, }, } // Test getting default target dataSources, err := GetActiveDataSources(profiles, "", "project1", "") if err != nil { t.Fatalf("GetActiveDataSources failed: %v", err) } if len(dataSources) != 1 { t.Fatalf("Expected 1 data source, got %d", len(dataSources)) } ds := dataSources[0].(*WrenPostgresDataSource) if ds.Database != "dev_db" { t.Errorf("Expected dev database, got %s", ds.Database) } // Test specified target dataSources, err = GetActiveDataSources(profiles, "", "project1", "prod") if err != nil { t.Fatalf("GetActiveDataSources failed: %v", err) } if len(dataSources) != 1 { t.Fatalf("Expected 1 data source, got %d", len(dataSources)) } ds = dataSources[0].(*WrenPostgresDataSource) if ds.Database != "prod_db" { t.Errorf("Expected prod database, got %s", ds.Database) } // Test nonexistent profile _, err = GetActiveDataSources(profiles, "", "nonexistent", "") if err == nil { t.Error("Expected error for nonexistent profile") } // Test nonexistent target _, err = GetActiveDataSources(profiles, "", "project1", "nonexistent") if err == nil { t.Error("Expected error for nonexistent target") } } func TestGetDataSourceByType(t *testing.T) { profiles := &DbtProfiles{ Profiles: map[string]DbtProfile{ "mixed_project": { Target: "dev", Outputs: map[string]DbtConnection{ "postgres_dev": { Type: "postgres", Host: "localhost", Port: 5432, Database: "dev_db", User: "user", }, "file_dev": { Type: duckdbType, Path: "/data/test.csv", }, "postgres_prod": { Type: "postgres", Host: "prod-host", Port: 5432, Database: "prod_db", User: "user", }, }, }, }, } // Test getting postgres type postgresSources, err := GetDataSourceByType(profiles, "postgres") if err != nil { t.Fatalf("GetDataSourceByType failed: %v", err) } if len(postgresSources) != 2 { t.Fatalf("Expected 2 postgres data sources, got %d", len(postgresSources)) } // Test getting local_file type fileSources, err := GetDataSourceByType(profiles, "local_file") if err != nil { t.Fatalf("GetDataSourceByType failed: %v", err) } if len(fileSources) != 1 { t.Fatalf("Expected 1 file data source, got %d", len(fileSources)) } // Test getting nonexistent type nonexistentSources, err := GetDataSourceByType(profiles, "nonexistent") if err != nil { t.Fatalf("GetDataSourceByType failed: %v", err) } if len(nonexistentSources) != 0 { t.Fatalf("Expected 0 nonexistent data sources, got %d", len(nonexistentSources)) } } func TestMapType(t *testing.T) { tests := []struct { name string dataSource DataSource sourceType string want string }{ { name: "BigQuery INT64 to integer", dataSource: &WrenBigQueryDataSource{}, sourceType: "INT64", want: "integer", }, { name: "BigQuery STRING to varchar", dataSource: &WrenBigQueryDataSource{}, sourceType: "STRING", want: "varchar", }, { name: "LocalFile INTEGER to integer", dataSource: &WrenLocalFileDataSource{}, sourceType: "INTEGER", want: "integer", }, { name: "LocalFile VARCHAR to varchar", dataSource: &WrenLocalFileDataSource{}, sourceType: "VARCHAR", want: "varchar", }, { name: "DefaultDataSource int to integer", dataSource: &DefaultDataSource{}, sourceType: "int", want: "integer", }, { name: "PostgresDataSource (no mapping)", dataSource: &WrenPostgresDataSource{}, sourceType: "unknown_type", want: "unknown_type", }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { got := tt.dataSource.MapType(tt.sourceType) if got != tt.want { t.Errorf("MapType(%s) = %s; want %s", tt.sourceType, got, tt.want) } }) } } // Validator interface for data sources type Validator interface { Validate() error } // Helper function to test data source validation func testDataSourceValidation(t *testing.T, testName string, validDS Validator, invalidDSCases []struct { name string ds Validator }) { t.Helper() t.Run(testName+" valid", func(t *testing.T) { if err := validDS.Validate(); err != nil { t.Errorf("Valid data source validation failed: %v", err) } }) for _, tt := range invalidDSCases { t.Run(testName+" "+tt.name, func(t *testing.T) { if err := tt.ds.Validate(); err == nil { t.Errorf("Expected validation error for %s, but got none", tt.name) } }) } } ================================================ FILE: wren-launcher/commands/dbt/profiles.go ================================================ package dbt // DbtProfiles represents the structure of dbt profiles.yml type DbtProfiles struct { Config map[string]interface{} `yaml:"config" json:"config,omitempty"` Profiles map[string]DbtProfile `yaml:",inline" json:"profiles"` } // DbtProfile represents a single profile in profiles.yml type DbtProfile struct { Target string `yaml:"target" json:"target"` Outputs map[string]DbtConnection `yaml:"outputs" json:"outputs"` } // DbtConnection represents a database connection configuration type DbtConnection struct { Type string `yaml:"type" json:"type"` Host string `yaml:"host,omitempty" json:"host,omitempty"` Server string `yaml:"server,omitempty" json:"server,omitempty"` // MSSQL Port int `yaml:"port,omitempty" json:"port,omitempty"` User string `yaml:"user,omitempty" json:"user,omitempty"` Password string `yaml:"password,omitempty" json:"password,omitempty"` DbName string `yaml:"dbname,omitempty" json:"dbname,omitempty"` // Postgres Database string `yaml:"database,omitempty" json:"database,omitempty"` Schema string `yaml:"schema,omitempty" json:"schema,omitempty"` // Additional fields for different database types Project string `yaml:"project,omitempty" json:"project,omitempty"` // BigQuery Dataset string `yaml:"dataset,omitempty" json:"dataset,omitempty"` // BigQuery Keyfile string `yaml:"keyfile,omitempty" json:"keyfile,omitempty"` // BigQuery Method string `yaml:"method,omitempty" json:"method,omitempty"` // BigQuery Account string `yaml:"account,omitempty" json:"account,omitempty"` // Snowflake Warehouse string `yaml:"warehouse,omitempty" json:"warehouse,omitempty"` // Snowflake Role string `yaml:"role,omitempty" json:"role,omitempty"` // Snowflake KeepAlive bool `yaml:"keepalive,omitempty" json:"keepalive,omitempty"` // Postgres SearchPath string `yaml:"search_path,omitempty" json:"search_path,omitempty"` // Postgres SSLMode string `yaml:"sslmode,omitempty" json:"sslmode,omitempty"` // Postgres SslDisable bool `yaml:"ssl_disable,omitempty" json:"ssl_disable,omitempty"` // MySQL Path string `yaml:"path,omitempty" json:"path,omitempty"` // DuckDB // Flexible additional properties Additional map[string]interface{} `yaml:",inline" json:"additional,omitempty"` } ================================================ FILE: wren-launcher/commands/dbt/profiles_analyzer.go ================================================ package dbt import ( "fmt" "os" "path/filepath" "runtime" "strconv" "gopkg.in/yaml.v3" ) // AnalyzeDbtProfiles reads and analyzes a dbt profiles.yml file func AnalyzeDbtProfiles(profilesPath string) (*DbtProfiles, error) { // Read the profiles.yml file data, err := os.ReadFile(profilesPath) // #nosec G304 -- profilesPath is controlled by application if err != nil { return nil, fmt.Errorf("failed to read profiles file %s: %w", profilesPath, err) } // Parse YAML var rawProfiles map[string]interface{} if err := yaml.Unmarshal(data, &rawProfiles); err != nil { return nil, fmt.Errorf("failed to parse YAML in file %s: %w", profilesPath, err) } // Convert to structured format profiles := &DbtProfiles{ Profiles: make(map[string]DbtProfile), } // Extract config if present if config, exists := rawProfiles["config"]; exists { if configMap, ok := config.(map[string]interface{}); ok { profiles.Config = configMap } delete(rawProfiles, "config") } // Process each profile for profileName, profileData := range rawProfiles { if profileMap, ok := profileData.(map[string]interface{}); ok { profile, err := parseProfile(profileMap) if err != nil { return nil, fmt.Errorf("failed to parse profile %s: %w", profileName, err) } profiles.Profiles[profileName] = *profile } } return profiles, nil } // parseProfile converts a raw profile map to DbtProfile struct func parseProfile(profileMap map[string]interface{}) (*DbtProfile, error) { profile := &DbtProfile{ Outputs: make(map[string]DbtConnection), } // Extract target if target, exists := profileMap["target"]; exists { if targetStr, ok := target.(string); ok { profile.Target = targetStr } } // Extract outputs if outputs, exists := profileMap["outputs"]; exists { if outputsMap, ok := outputs.(map[string]interface{}); ok { for outputName, outputData := range outputsMap { if outputMap, ok := outputData.(map[string]interface{}); ok { connection, err := parseConnection(outputMap) if err != nil { return nil, fmt.Errorf("failed to parse output %s: %w", outputName, err) } profile.Outputs[outputName] = *connection } } } } return profile, nil } // parseConnection converts a raw connection map to DbtConnection struct func parseConnection(connectionMap map[string]interface{}) (*DbtConnection, error) { connection := &DbtConnection{ Additional: make(map[string]interface{}), } // Helper function to safely extract string values getString := func(key string) string { if value, exists := connectionMap[key]; exists { if str, ok := value.(string); ok { return str } } return "" } // Helper function to safely extract int values getInt := func(key string) int { if value, exists := connectionMap[key]; exists { switch v := value.(type) { case int: return v case float64: return int(v) case int64: return int(v) case string: if i, err := strconv.Atoi(v); err == nil { return i } } } return 0 } // Helper function to safely extract bool values getBool := func(key string) bool { if value, exists := connectionMap[key]; exists { if b, ok := value.(bool); ok { return b } } return false } // Extract standard fields connection.Type = getString("type") connection.Host = getString("host") connection.Port = getInt("port") connection.User = getString("user") connection.Password = getString("password") connection.Database = getString("database") connection.DbName = getString("dbname") // PostgreSQL specific connection.Schema = getString("schema") // Extract database-specific fields connection.Project = getString("project") connection.Dataset = getString("dataset") connection.Keyfile = getString("keyfile") connection.Method = getString("method") connection.Account = getString("account") connection.Warehouse = getString("warehouse") connection.Role = getString("role") connection.KeepAlive = getBool("keepalive") connection.SearchPath = getString("search_path") connection.SSLMode = getString("sslmode") connection.Path = getString("path") connection.SslDisable = getBool("ssl_disable") // MySQL specific connection.Server = getString("server") // Store any additional fields that weren't mapped knownFields := map[string]bool{ "type": true, "host": true, "port": true, "user": true, "password": true, "database": true, "dbname": true, "schema": true, "project": true, "dataset": true, "keyfile": true, "method": true, "account": true, "warehouse": true, "role": true, "keepalive": true, "search_path": true, "sslmode": true, "path": true, "server": true, "ssl_disable": true, } for key, value := range connectionMap { if !knownFields[key] { connection.Additional[key] = value } } // Clean up empty Additional map if len(connection.Additional) == 0 { connection.Additional = nil } return connection, nil } // GetDefaultProfilesPath returns the default path to dbt profiles.yml func GetDefaultProfilesPath() string { homeDir, err := os.UserHomeDir() if err != nil { return "" } if runtime.GOOS == "windows" { return filepath.Join(homeDir, ".dbt", "profiles.yml") } return filepath.Join(homeDir, ".dbt", "profiles.yml") } // FindProfilesFile searches for profiles.yml in common locations func FindProfilesFile(projectPath string) (string, error) { // Try locations in order of preference searchPaths := []string{ // Current directory filepath.Join(projectPath, "profiles.yml"), // Project .dbt directory filepath.Join(projectPath, ".dbt", "profiles.yml"), // User home .dbt directory GetDefaultProfilesPath(), } for _, path := range searchPaths { if FileExists(path) { return path, nil } } return "", fmt.Errorf("profiles.yml not found in any of the expected locations: %v", searchPaths) } ================================================ FILE: wren-launcher/commands/dbt/utils.go ================================================ package dbt import ( "os" "path/filepath" ) // isDbtProjectValid checks if the given path is a valid dbt project directory func IsDbtProjectValid(projectPath string) bool { // Check if path exists and is a directory if !DirExists(projectPath) { return false } // Check for dbt_project.yml (required file for dbt projects) dbtProjectFile := filepath.Join(projectPath, "dbt_project.yml") return FileExists(dbtProjectFile) } // DirExists checks if a directory exists func DirExists(path string) bool { info, err := os.Stat(path) if os.IsNotExist(err) { return false } return info.IsDir() } // FileExists checks if a file exists func FileExists(path string) bool { info, err := os.Stat(path) if os.IsNotExist(err) { return false } return !info.IsDir() } ================================================ FILE: wren-launcher/commands/dbt/wren_mdl.go ================================================ package dbt // WrenMDLManifest represents the complete Wren MDL structure type WrenMDLManifest struct { JsonSchema string `json:"$schema"` Catalog string `json:"catalog"` Schema string `json:"schema"` EnumDefinitions []EnumDefinition `json:"enumDefinitions,omitempty"` Models []WrenModel `json:"models"` Relationships []Relationship `json:"relationships"` Metrics []Metric `json:"metrics,omitempty"` Views []View `json:"views"` DataSource string `json:"dataSource,omitempty"` } // EnumDefinition represents a named list of values that can be used by columns. type EnumDefinition struct { Name string `json:"name"` Values []EnumValue `json:"values"` } type EnumValue struct { Name string `json:"name"` Value string `json:"value,omitempty"` } // WrenModel represents a model in the Wren MDL format type WrenModel struct { Name string `json:"name"` TableReference TableReference `json:"tableReference"` Columns []WrenColumn `json:"columns"` PrimaryKey string `json:"primaryKey,omitempty"` Cached bool `json:"cached,omitempty"` RefreshTime string `json:"refreshTime,omitempty"` Properties map[string]string `json:"properties,omitempty"` } // TableReference represents a reference to a table type TableReference struct { Catalog string `json:"catalog,omitempty"` Schema string `json:"schema,omitempty"` Table string `json:"table"` } // WrenColumn represents a column in the Wren MDL format type WrenColumn struct { Name string `json:"name"` DisplayName string `json:"displayName,omitempty"` Type string `json:"type"` Relationship string `json:"relationship,omitempty"` IsCalculated bool `json:"isCalculated,omitempty"` NotNull bool `json:"notNull,omitempty"` Expression *string `json:"expression,omitempty"` Properties map[string]string `json:"properties,omitempty"` } // Relationship represents a relationship between models type Relationship struct { Name string `json:"name"` Models []string `json:"models"` JoinType string `json:"joinType"` Condition string `json:"condition"` Properties map[string]string `json:"properties,omitempty"` } // Metric defines a business-level calculation in Wren MDL. type Metric struct { Name string `json:"name"` Models []string `json:"models"` Dimensions []string `json:"dimensions"` Aggregation string `json:"aggregation"` DisplayName string `json:"displayName"` Description string `json:"description,omitempty"` } // View represents a view in the Wren MDL format type View struct { Name string `json:"name"` Statement string `json:"statement"` Properties map[string]string `json:"properties,omitempty"` } ================================================ FILE: wren-launcher/commands/dbt.go ================================================ package commands import ( "flag" "os" "github.com/Canner/WrenAI/wren-launcher/commands/dbt" "github.com/pterm/pterm" ) // DbtAutoConvert automatically searches for dbt profiles and catalog.json, // then converts them to WrenDataSource and Wren MDL format func DbtAutoConvert() { var opts struct { ProjectPath string OutputDir string ProfileName string Target string IncludeStagingModels bool } // Define command line flags flag.StringVar(&opts.ProjectPath, "path", "", "Path to the dbt project root directory") flag.StringVar(&opts.OutputDir, "output", "", "Output directory for generated JSON files") flag.StringVar(&opts.ProfileName, "profile", "", "Specific profile name to use (optional, uses first found if not provided)") flag.StringVar(&opts.Target, "target", "", "Specific target to use (optional, uses profile default if not provided)") flag.BoolVar(&opts.IncludeStagingModels, "include-staging-models", false, "If set, staging models will be included during conversion") flag.Parse() // Validate required parameters if opts.ProjectPath == "" { pterm.Error.Println("Error: --path parameter is required") pterm.Info.Println("Usage: wren-launcher dbt-auto-convert --path /path/to/dbt/project --output /path/to/output") os.Exit(1) } if opts.OutputDir == "" { pterm.Error.Println("Error: --output parameter is required") pterm.Info.Println("Usage: wren-launcher dbt-auto-convert --path /path/to/dbt/project --output /path/to/output") os.Exit(1) } // ConvertOptions struct for core conversion logic convertOpts := dbt.ConvertOptions{ ProjectPath: opts.ProjectPath, OutputDir: opts.OutputDir, ProfileName: opts.ProfileName, Target: opts.Target, RequireCatalog: true, // DbtAutoConvert requires catalog.json to exist IncludeStagingModels: opts.IncludeStagingModels, } // Call the core conversion logic _, err := dbt.ConvertDbtProjectCore(convertOpts) if err != nil { pterm.Error.Printf("Error: Conversion failed: %v\n", err) os.Exit(1) } } // DbtConvertProject is a public wrapper function for processDbtProject to use // It converts a dbt project without requiring catalog.json to exist func DbtConvertProject(projectPath, outputDir, profileName, target string, usedByContainer bool, IncludeStagingModels bool) (*dbt.ConvertResult, error) { convertOpts := dbt.ConvertOptions{ ProjectPath: projectPath, OutputDir: outputDir, ProfileName: profileName, Target: target, RequireCatalog: false, // Allow processDbtProject to continue without catalog.json UsedByContainer: usedByContainer, IncludeStagingModels: IncludeStagingModels, } return dbt.ConvertDbtProjectCore(convertOpts) } ================================================ FILE: wren-launcher/commands/launch.go ================================================ package commands import ( "context" "errors" "fmt" "os" "os/signal" "path" "path/filepath" "strings" "time" "github.com/Canner/WrenAI/wren-launcher/config" utils "github.com/Canner/WrenAI/wren-launcher/utils" "github.com/common-nighthawk/go-figure" "github.com/manifoldco/promptui" "github.com/pterm/pterm" openai "github.com/sashabaranov/go-openai" ) func prepareProjectDir() string { // create a project directory under ~/.wrenai homedir, err := os.UserHomeDir() if err != nil { panic(err) } projectDir := path.Join(homedir, ".wrenai") if _, err := os.Stat(projectDir); os.IsNotExist(err) { if err := os.Mkdir(projectDir, 0750); err != nil { return "" } } return projectDir } func evaluateTelemetryPreferences() (bool, error) { // let users know we're asking for telemetry consent disableTelemetry := config.IsTelemetryDisabled() if disableTelemetry { fmt.Println("You have disabled telemetry, Wren AI will not collect any data.") return false, nil } fmt.Println("Wren AI relies on anonymous usage statistics to continuously improve.") fmt.Println("You can opt out of sharing these statistics by manually adding flag `--disable-telemetry` as described at https://docs.getwren.ai/oss/overview/telemetry") return true, nil } func askForLLMProvider() (string, error) { // let users know we're asking for a LLM provider pterm.Warning.Println("We highly recommend using OpenAI models with Wren AI, especially the latest models.") pterm.Warning.Println("These models have been extensively tested to ensure optimal performance and compatibility.") pterm.Warning.Println("While it is technically possible to integrate other AI models, please note that they have not been fully tested with our system.") pterm.Warning.Println("Therefore, using alternative models is at your own risk and may result in unexpected behavior or suboptimal performance.") fmt.Println("") fmt.Println("Please provide the LLM provider you want to use") fmt.Println("You can learn more about how to set up custom LLMs at https://docs.getwren.ai/oss/ai_service/guide/custom_llm#running-wren-ai-with-your-custom-llm-or-document-store") prompt := promptui.Select{ Label: "Select an LLM provider", Items: []string{"OpenAI", "Custom"}, } _, result, err := prompt.Run() if err != nil { fmt.Printf("Prompt failed %v\n", err) return "", err } return result, nil } func askForAPIKey() (string, error) { // let users know we're asking for an API key fmt.Println("Please provide your OpenAI API key") fmt.Println("Please use the key with full permission, more details at https://help.openai.com/en/articles/8867743-assign-api-key-permissions") validate := func(input string) error { // check if input is a valid API key // OpenAI API keys are starting with "sk-" if !strings.HasPrefix(input, "sk-") { return errors.New("invalid API key") } return nil } prompt := promptui.Prompt{ Label: "OpenAI API key", Validate: validate, Mask: '*', } result, err := prompt.Run() if err != nil { fmt.Printf("Prompt failed %v\n", err) return "", err } return result, nil } func askForGenerationModel() (string, error) { // let users know we're asking for a generation model fmt.Println("Please provide the generation model you want to use") fmt.Println("You can learn more about OpenAI's generation models at https://platform.openai.com/docs/models/models") prompt := promptui.Select{ Label: "Select an OpenAI's generation model", Items: []string{"gpt-4.1", "gpt-4.1-mini", "gpt-4.1-nano", "gpt-5", "gpt-5-mini", "gpt-5-nano"}, } _, result, err := prompt.Run() if err != nil { fmt.Printf("Prompt failed %v\n", err) return "", err } return result, nil } func askForDbtProjectPath() (string, error) { // let users know we're asking for a dbt project path fmt.Println("Please provide the dbt project path you want to convert") fmt.Println("This should be the root directory of your dbt project containing dbt_project.yml") fmt.Println("Press Enter to ignore this step if you don't have a dbt project to convert.") prompt := promptui.Prompt{ Label: "dbt project path (leave empty to skip)", Default: "", } result, err := prompt.Run() if err != nil { fmt.Printf("Prompt failed %v\n", err) return "", err } return result, nil } func askForDbtProfileName() (string, error) { // let users know we're asking for a dbt profile name fmt.Println("Please provide the dbt profile name you want to use") fmt.Println("This should be the profile name defined in your profiles.yml file") fmt.Println("Press Enter to use the default profile.") prompt := promptui.Prompt{ Label: "dbt profile name (leave empty to use default)", Default: "", } result, err := prompt.Run() if err != nil { fmt.Printf("Prompt failed %v\n", err) return "", err } return result, nil } func askForDbtTarget() (string, error) { // let users know we're asking for a dbt target fmt.Println("Please provide the dbt target you want to use") fmt.Println("This should be the target name defined in your profiles.yml file") fmt.Println("Press Enter to use the default target.") prompt := promptui.Prompt{ Label: "dbt target (leave empty to use default)", Default: "", } result, err := prompt.Run() if err != nil { fmt.Printf("Prompt failed %v\n", err) return "", err } return result, nil } func askForIncludeStagingModels() (bool, error) { prompt := promptui.Select{ Label: "Include staging models (stg_*, staging_*)?", Items: []string{"No", "Yes"}, } _, result, err := prompt.Run() if err != nil { return false, err } return result == "Yes", nil } func Launch() { // recover from panic defer func() { if r := recover(); r != nil { pterm.Error.Println("An error occurred:", r) var dummy string _, _ = fmt.Scanf("%s", &dummy) } }() // Setup a channel to receive a signal done := make(chan os.Signal, 1) signal.Notify(done, os.Interrupt) // Fire off a goroutine to loop until that channel receives a signal. // When a signal is received simply exit the program go func() { for range done { os.Exit(0) } }() // print Wren AI header fmt.Println(strings.Repeat("=", 55)) myFigure := figure.NewFigure("WrenAI", "", true) myFigure.Print() fmt.Println(strings.Repeat("=", 55)) // prepare a project directory pterm.Info.Println("Preparing project directory") projectDir := prepareProjectDir() // get platform platform := config.GetPlatform() if platform != "linux/amd64" && platform != "linux/arm64" { pterm.Error.Println("Invalid platform, valid values are: linux/amd64, linux/arm64") os.Exit(1) } pterm.Info.Println("Platform: ", platform) // get experimental engine rust version experimentalEngineRustVersion := config.IsExperimentalEngineRustVersion() pterm.Info.Println("Use Experimental Rust Engine: ", experimentalEngineRustVersion) // ask for LLM provider pterm.Print("\n") llmProvider, shouldReturn := getLLMProvider() if shouldReturn { return } openaiApiKey := "" openaiGenerationModel := "" if strings.ToLower(llmProvider) == "openai" { // if openaiApiKey is not provided, ask for it // ask for OpenAI API key openaiApiKey, shouldReturn = getOpenaiApiKey() if shouldReturn { return } // check if OpenAI API key is valid shouldReturn = validateOpenaiApiKey(openaiApiKey) if shouldReturn { return } // ask for OpenAI generation model pterm.Print("\n") openaiGenerationModel, shouldReturn = getOpenaiGenerationModel() if shouldReturn { return } // prepare config.yaml file for OpenAI err := utils.PrepareConfigFileForOpenAI(projectDir, openaiGenerationModel) if err != nil { panic(err) } } // ask for telemetry consent pterm.Print("\n") telemetryEnabled, err := evaluateTelemetryPreferences() if err != nil { pterm.Error.Println("Failed to get API key") panic(err) } // check if docker daemon is running, if not, open it and loop to check again pterm.Info.Println("Checking if Docker daemon is running") for { _, err = utils.CheckDockerDaemonRunning() if err == nil { break } pterm.Info.Println("Docker daemon is not running, opening Docker Desktop") err = utils.OpenDockerDaemon() if err != nil { panic(err) } time.Sleep(5 * time.Second) } // download docker-compose file and env file template for Wren AI pterm.Info.Println("Downloading docker-compose file and env file") // find an available port uiPort := utils.FindAvailablePort(3000) aiPort := utils.FindAvailablePort(5555) var localStorage string if config.IsDbtEnabled() { localStorage, err = processDbtProject(projectDir) if err != nil { pterm.Error.Println("Failed to process dbt project:", err) panic(err) } } else { localStorage = "" } // process dbt project conversion err = utils.PrepareDockerFiles( openaiApiKey, openaiGenerationModel, uiPort, aiPort, projectDir, telemetryEnabled, llmProvider, platform, localStorage, ) if err != nil { panic(err) } // launch Wren AI pterm.Info.Println("Launching Wren AI") const projectName string = "wrenai" err = utils.RunDockerCompose(projectName, projectDir, llmProvider) if err != nil { panic(err) } pterm.Info.Println("Wren AI is starting, please wait for a moment...") uiUrl := fmt.Sprintf("http://localhost:%d", uiPort) aiUrl := fmt.Sprintf("http://localhost:%d", aiPort) // wait until checking if CheckUIServiceStarted return without error // if timeout 2 minutes, panic timeoutTime := time.Now().Add(2 * time.Minute) for { if time.Now().After(timeoutTime) { panic("Timeout") } // check if ui is ready err := utils.CheckUIServiceStarted(uiUrl) if err == nil { pterm.Info.Println("UI Service is ready") break } time.Sleep(5 * time.Second) } // wait until checking if CheckWrenAIStarted return without error // if timeout 30 minutes, panic timeoutTime = time.Now().Add(30 * time.Minute) for { if time.Now().After(timeoutTime) { panic("Timeout") } // check if ai service is ready err := utils.CheckAIServiceStarted(aiUrl) if err == nil { pterm.Info.Println("AI Service is Ready") break } time.Sleep(5 * time.Second) } // open browser pterm.Info.Println("Opening browser") _ = utils.Openbrowser(uiUrl) pterm.Info.Println("You can now safely close this terminal window") var dummy string _, _ = fmt.Scanf("%s", &dummy) } func getOpenaiGenerationModel() (string, bool) { // get openai generation model from initialize arguments openaiGenerationModel := config.GetOpenaiGenerationModel() if openaiGenerationModel == "" { // not provided in args, ask user to provide openai generation model openaiGenerationModel, _ = askForGenerationModel() } else { // validate if input args is a valid generation model pterm.Info.Println("OpenAI generation model is provided") validModels := map[string]bool{ "gpt-4.1": true, "gpt-4.1-mini": true, "gpt-4.1-nano": true, "gpt-5": true, "gpt-5-mini": true, "gpt-5-nano": true, } if !validModels[openaiGenerationModel] { pterm.Error.Println("Invalid generation model", openaiGenerationModel) return "", true } } return openaiGenerationModel, false } func getOpenaiApiKey() (string, bool) { // get openai api key from initialize arguments openaiApiKey := config.GetOpenaiAPIKey() if openaiApiKey == "" { // not provided in args, ask user to provide openai api key pterm.Print("\n") openaiApiKey, _ = askForAPIKey() } else { // validate if input args is a valid API key if !strings.HasPrefix(openaiApiKey, "sk-") { pterm.Error.Println("Invalid API key, API key should start with 'sk-'") return "", true } pterm.Info.Println("OpenAI API key is provided") } return openaiApiKey, false } func getLLMProvider() (string, bool) { // get llm provider from initialize arguments llmProvider := config.GetLLMProvider() if llmProvider == "" { // not provided in args, ask user to provide llm provider result, err := askForLLMProvider() if err != nil { panic(err) } llmProvider = result } else { // validate if input args is a valid LLM provider validProvider := map[string]bool{ "openai": true, "custom": true, } if !validProvider[llmProvider] { pterm.Error.Println("Invalid LLM provider", llmProvider, "valid values are: openai, custom") return "", true } } return llmProvider, false } func validateOpenaiApiKey(apiKey string) bool { // validate if input api key is valid by sending a hello request pterm.Info.Println("Sending a hello request to OpenAI...") client := openai.NewClient(apiKey) resp, err := client.CreateChatCompletion( context.Background(), openai.ChatCompletionRequest{ Model: openai.GPT4oMini20240718, Messages: []openai.ChatCompletionMessage{ { Role: openai.ChatMessageRoleUser, Content: "Hello!", }, }, }, ) // insufficient credit balance error if err != nil { pterm.Error.Println("Invalid API key", err) _, _ = fmt.Scanln() return true } pterm.Info.Println("Valid API key, Response:", resp.Choices[0].Message.Content) return false } func getDbtProfileAndTarget() (string, string, error) { // ask for profile name and target profileName, err := askForDbtProfileName() if err != nil { return "", "", fmt.Errorf("failed to get dbt profile name: %w", err) } // if profile name is empty, doesn't ask for target var target string if profileName == "" { target = "" // use default target } else { target, err = askForDbtTarget() if err != nil { return "", "", fmt.Errorf("failed to get dbt target: %w", err) } } return profileName, target, nil } func processDbtProject(projectDir string) (string, error) { // ask for dbt project path dbtProjectPath, err := askForDbtProjectPath() if err != nil { return "", fmt.Errorf("failed to get dbt project path: %w", err) } // if user provides empty path, skip dbt conversion if strings.TrimSpace(dbtProjectPath) == "" { pterm.Info.Println("Skipping dbt project conversion") return ".", nil // return default local storage path } // create target directory in project dir targetDir := filepath.Join(projectDir, "target") err = os.MkdirAll(targetDir, 0750) if err != nil { return "", fmt.Errorf("failed to create target directory: %w", err) } profileName, target, err := getDbtProfileAndTarget() if err != nil { return "", err } // Ask the user whether to include staging models includeStagingModels, err := askForIncludeStagingModels() if err != nil { pterm.Warning.Println("Could not get staging model preference, defaulting to 'No'.") includeStagingModels = false } // Use the core conversion function from dbt package, passing the user's choice result, err := DbtConvertProject(dbtProjectPath, targetDir, profileName, target, true, includeStagingModels) if err != nil { return "", fmt.Errorf("failed to convert dbt project: %w", err) } pterm.Info.Printf("Successfully processed dbt project to target directory: %s\n", targetDir) return result.LocalStoragePath, nil } ================================================ FILE: wren-launcher/config/config.go ================================================ package config import ( "flag" "runtime" ) // Platform constants const ( platformLinuxAmd64 = "linux/amd64" platformLinuxArm64 = "linux/arm64" ) // private variable within the config package var disableTelemetry bool var openaiAPIKey string var openaiGenerationModel string var llmProvider string var experimentalEngineRustVersion bool var platform string var enableDbt bool // InitFlags initializes the flag func InitFlags() { flag.BoolVar(&disableTelemetry, "disable-telemetry", false, "Disable telemetry if set to true") flag.StringVar(&llmProvider, "llm-provider", "", "The LLM provider to use, valid values are: openai, custom") flag.StringVar(&openaiAPIKey, "openai-api-key", "", "The OPENAI API key") flag.StringVar(&openaiGenerationModel, "openai-generation-model", "", "The OPENAI generation model, valid values are: gpt-4.1, gpt-4.1-mini, gpt-4.1-nano") flag.BoolVar(&experimentalEngineRustVersion, "experimental-engine-rust-version", true, "Use the experimental Rust version of the Wren Engine") flag.StringVar(&platform, "platform", GetPlatform(), "The platform to use, valid values are: linux/amd64, linux/arm64") flag.BoolVar(&enableDbt, "enable-dbt", false, "Enable dbt support if set to true") } func IsExperimentalEngineRustVersion() bool { return experimentalEngineRustVersion } func GetPlatform() string { switch runtime.GOOS { case "darwin": if runtime.GOARCH == "arm64" { return platformLinuxArm64 } return platformLinuxAmd64 case "linux": if runtime.GOARCH == "arm64" { return platformLinuxArm64 } return platformLinuxAmd64 case "windows": return platformLinuxAmd64 // Windows typically uses amd64 default: return platformLinuxAmd64 // Default to amd64 for unknown platforms } } // IsTelemetryDisabled exposes the state of the telemetry flag func IsTelemetryDisabled() bool { return disableTelemetry } func GetOpenaiAPIKey() string { return openaiAPIKey } func GetOpenaiGenerationModel() string { return openaiGenerationModel } func GetLLMProvider() string { return llmProvider } func IsDbtEnabled() bool { return enableDbt } ================================================ FILE: wren-launcher/go.mod ================================================ module github.com/Canner/WrenAI/wren-launcher go 1.24.9 require ( github.com/common-nighthawk/go-figure v0.0.0-20210622060536-734e95fb86be github.com/docker/compose/v2 v2.40.2 github.com/docker/docker v28.5.1+incompatible github.com/google/uuid v1.6.0 github.com/manifoldco/promptui v0.9.0 github.com/sashabaranov/go-openai v1.36.0 ) require ( atomicgo.dev/cursor v0.2.0 // indirect atomicgo.dev/keyboard v0.2.9 // indirect atomicgo.dev/schedule v0.1.0 // indirect github.com/AlecAivazis/survey/v2 v2.3.7 // indirect github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect github.com/DefangLabs/secret-detector v0.0.0-20250403165618-22662109213e // indirect github.com/Masterminds/semver/v3 v3.4.0 // indirect github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d // indirect github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect github.com/aws/aws-sdk-go-v2 v1.30.3 // indirect github.com/aws/aws-sdk-go-v2/config v1.27.27 // indirect github.com/aws/aws-sdk-go-v2/credentials v1.17.27 // indirect github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.11 // indirect github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.15 // indirect github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.15 // indirect github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 // indirect github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.3 // indirect github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.17 // indirect github.com/aws/aws-sdk-go-v2/service/sso v1.22.4 // indirect github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.4 // indirect github.com/aws/aws-sdk-go-v2/service/sts v1.30.3 // indirect github.com/aws/smithy-go v1.20.3 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/buger/goterm v1.0.4 // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/compose-spec/compose-go/v2 v2.9.0 // indirect github.com/containerd/console v1.0.5 // indirect github.com/containerd/containerd/api v1.9.0 // indirect github.com/containerd/containerd/v2 v2.1.5 // indirect github.com/containerd/continuity v0.4.5 // indirect github.com/containerd/errdefs v1.0.0 // indirect github.com/containerd/errdefs/pkg v0.3.0 // indirect github.com/containerd/platforms v1.0.0-rc.1 // indirect github.com/containerd/ttrpc v1.2.7 // indirect github.com/containerd/typeurl/v2 v2.2.3 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/docker/buildx v0.29.1 // indirect github.com/docker/cli-docs-tool v0.10.0 // indirect github.com/docker/distribution v2.8.3+incompatible // indirect github.com/docker/docker-credential-helpers v0.9.3 // indirect github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c // indirect github.com/docker/go-metrics v0.0.1 // indirect github.com/eiannone/keyboard v0.0.0-20220611211555-0d226195f203 // indirect github.com/emicklei/go-restful/v3 v3.11.0 // indirect github.com/fsnotify/fsevents v0.2.0 // indirect github.com/fvbommel/sortorder v1.1.0 // indirect github.com/fxamacker/cbor/v2 v2.7.0 // indirect github.com/go-openapi/jsonpointer v0.21.0 // indirect github.com/go-openapi/jsonreference v0.20.2 // indirect github.com/go-openapi/swag v0.23.0 // indirect github.com/go-viper/mapstructure/v2 v2.4.0 // indirect github.com/gofrs/flock v0.12.1 // indirect github.com/golang-jwt/jwt/v5 v5.2.2 // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/google/gnostic-models v0.6.8 // indirect github.com/google/go-cmp v0.7.0 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect github.com/gookit/color v1.5.4 // indirect github.com/gorilla/mux v1.8.1 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.1 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/hashicorp/go-version v1.7.0 // indirect github.com/in-toto/in-toto-golang v0.9.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/inhies/go-bytesize v0.0.0-20220417184213-4913239db9cf // indirect github.com/jonboulle/clockwork v0.5.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect github.com/klauspost/compress v1.18.0 // indirect github.com/lithammer/fuzzysearch v1.1.8 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.16 // indirect github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b // indirect github.com/miekg/pkcs11 v1.1.1 // indirect github.com/mitchellh/go-ps v1.0.0 // indirect github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect github.com/moby/buildkit v0.25.1 // indirect github.com/moby/go-archive v0.1.0 // indirect github.com/moby/locker v1.0.1 // indirect github.com/moby/patternmatcher v0.6.0 // indirect github.com/moby/spdystream v0.5.0 // indirect github.com/moby/sys/atomicwriter v0.1.0 // indirect github.com/moby/sys/capability v0.4.0 // indirect github.com/moby/sys/mountinfo v0.7.2 // indirect github.com/moby/sys/sequential v0.6.0 // indirect github.com/moby/sys/signal v0.7.1 // indirect github.com/moby/sys/symlink v0.3.0 // indirect github.com/moby/sys/user v0.4.0 // indirect github.com/moby/sys/userns v0.1.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect github.com/pelletier/go-toml v1.9.5 // indirect github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_golang v1.22.0 // indirect github.com/prometheus/client_model v0.6.1 // indirect github.com/prometheus/common v0.62.0 // indirect github.com/prometheus/procfs v0.15.1 // indirect github.com/rivo/uniseg v0.4.4 // indirect github.com/santhosh-tekuri/jsonschema/v6 v6.0.1 // indirect github.com/secure-systems-lab/go-securesystemslib v0.6.0 // indirect github.com/serialx/hashring v0.0.0-20200727003509-22c0c7ab6b1b // indirect github.com/shibumi/go-pathspec v1.3.0 // indirect github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 // indirect github.com/spf13/cobra v1.10.1 // indirect github.com/spf13/pflag v1.0.10 // indirect github.com/stretchr/testify v1.11.1 // indirect github.com/theupdateframework/notary v0.7.0 // indirect github.com/tilt-dev/fsnotify v1.4.8-0.20220602155310-fff9c274a375 // indirect github.com/tonistiigi/dchapes-mode v0.0.0-20250318174251-73d941a28323 // indirect github.com/tonistiigi/fsutil v0.0.0-20250605211040-586307ad452f // indirect github.com/tonistiigi/go-csvvalue v0.0.0-20240814133006-030d3b2625d0 // indirect github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea // indirect github.com/tonistiigi/vt100 v0.0.0-20240514184818-90bafcd6abab // indirect github.com/x448/float16 v0.8.4 // indirect github.com/xhit/go-str2duration/v2 v2.1.0 // indirect github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect github.com/zclconf/go-cty v1.17.0 // indirect go.opentelemetry.io/auto/sdk v1.1.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.60.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.60.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.35.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.35.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.35.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.35.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.36.0 // indirect go.opentelemetry.io/proto/otlp v1.5.0 // indirect go.uber.org/mock v0.6.0 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect golang.org/x/crypto v0.45.0 // indirect golang.org/x/net v0.47.0 // indirect golang.org/x/oauth2 v0.30.0 // indirect golang.org/x/term v0.37.0 // indirect golang.org/x/text v0.31.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20250528174236-200df99c418a // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20250528174236-200df99c418a // indirect google.golang.org/grpc v1.74.2 // indirect google.golang.org/protobuf v1.36.9 // indirect gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect k8s.io/api v0.32.3 // indirect k8s.io/apimachinery v0.32.3 // indirect k8s.io/client-go v0.32.3 // indirect k8s.io/klog/v2 v2.130.1 // indirect k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f // indirect k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 // indirect sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect sigs.k8s.io/structured-merge-diff/v4 v4.4.2 // indirect sigs.k8s.io/yaml v1.4.0 // indirect tags.cncf.io/container-device-interface v1.0.1 // indirect ) require ( github.com/Microsoft/go-winio v0.6.2 // indirect github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e // indirect github.com/containerd/log v0.1.0 // indirect github.com/distribution/reference v0.6.0 // indirect github.com/docker/cli v28.5.1+incompatible github.com/docker/go-connections v0.6.0 // indirect github.com/docker/go-units v0.5.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/go-logr/logr v1.4.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/mattn/go-shellwords v1.0.12 // indirect github.com/moby/docker-image-spec v1.3.1 // indirect github.com/moby/term v0.5.2 // indirect github.com/morikuni/aec v1.0.0 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.1 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pterm/pterm v0.12.79 github.com/sirupsen/logrus v1.9.3 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.60.0 // indirect go.opentelemetry.io/otel v1.36.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.35.0 // indirect go.opentelemetry.io/otel/metric v1.36.0 // indirect go.opentelemetry.io/otel/sdk v1.36.0 // indirect go.opentelemetry.io/otel/trace v1.36.0 // indirect golang.org/x/sync v0.18.0 // indirect golang.org/x/sys v0.38.0 // indirect golang.org/x/time v0.11.0 // indirect gopkg.in/yaml.v3 v3.0.1 ) ================================================ FILE: wren-launcher/go.sum ================================================ atomicgo.dev/assert v0.0.2 h1:FiKeMiZSgRrZsPo9qn/7vmr7mCsh5SZyXY4YGYiYwrg= atomicgo.dev/assert v0.0.2/go.mod h1:ut4NcI3QDdJtlmAxQULOmA13Gz6e2DWbSAS8RUOmNYQ= atomicgo.dev/cursor v0.2.0 h1:H6XN5alUJ52FZZUkI7AlJbUc1aW38GWZalpYRPpoPOw= atomicgo.dev/cursor v0.2.0/go.mod h1:Lr4ZJB3U7DfPPOkbH7/6TOtJ4vFGHlgj1nc+n900IpU= atomicgo.dev/keyboard v0.2.9 h1:tOsIid3nlPLZ3lwgG8KZMp/SFmr7P0ssEN5JUsm78K8= atomicgo.dev/keyboard v0.2.9/go.mod h1:BC4w9g00XkxH/f1HXhW2sXmJFOCWbKn9xrOunSFtExQ= atomicgo.dev/schedule v0.1.0 h1:nTthAbhZS5YZmgYbb2+DH8uQIZcTlIrd4eYr3UQxEjs= atomicgo.dev/schedule v0.1.0/go.mod h1:xeUa3oAkiuHYh8bKiQBRojqAMq3PXXbJujjb0hw8pEU= github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6 h1:He8afgbRMd7mFxO99hRNu+6tazq8nFF9lIwo9JFroBk= github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8= github.com/AlecAivazis/survey/v2 v2.3.7 h1:6I/u8FvytdGsgonrYsVn2t8t4QiRnh6QSTqkkhIiSjQ= github.com/AlecAivazis/survey/v2 v2.3.7/go.mod h1:xUTIdE4KCOIjsBAE1JYsUPoCqYdZ1reCfTwbto0Fduo= github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c h1:udKWzYgxTojEKWjV8V+WSxDXJ4NFATAsZjh8iIbsQIg= github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/DefangLabs/secret-detector v0.0.0-20250403165618-22662109213e h1:rd4bOvKmDIx0WeTv9Qz+hghsgyjikFiPrseXHlKepO0= github.com/DefangLabs/secret-detector v0.0.0-20250403165618-22662109213e/go.mod h1:blbwPQh4DTlCZEfk1BLU4oMIhLda2U+A840Uag9DsZw= github.com/MarvinJWendt/testza v0.1.0/go.mod h1:7AxNvlfeHP7Z/hDQ5JtE3OKYT3XFUeLCDE2DQninSqs= github.com/MarvinJWendt/testza v0.2.1/go.mod h1:God7bhG8n6uQxwdScay+gjm9/LnO4D3kkcZX4hv9Rp8= github.com/MarvinJWendt/testza v0.2.8/go.mod h1:nwIcjmr0Zz+Rcwfh3/4UhBp7ePKVhuBExvZqnKYWlII= github.com/MarvinJWendt/testza v0.2.10/go.mod h1:pd+VWsoGUiFtq+hRKSU1Bktnn+DMCSrDrXDpX2bG66k= github.com/MarvinJWendt/testza v0.2.12/go.mod h1:JOIegYyV7rX+7VZ9r77L/eH6CfJHHzXjB69adAhzZkI= github.com/MarvinJWendt/testza v0.3.0/go.mod h1:eFcL4I0idjtIx8P9C6KkAuLgATNKpX4/2oUqKc6bF2c= github.com/MarvinJWendt/testza v0.4.2/go.mod h1:mSdhXiKH8sg/gQehJ63bINcCKp7RtYewEjXsvsVUPbE= github.com/MarvinJWendt/testza v0.5.2 h1:53KDo64C1z/h/d/stCYCPY69bt/OSwjq5KpFNwi+zB4= github.com/MarvinJWendt/testza v0.5.2/go.mod h1:xu53QFE5sCdjtMCKk8YMQ2MnymimEctc4n3EjyIYvEY= github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1Xbatp0= github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/Microsoft/hcsshim v0.13.0 h1:/BcXOiS6Qi7N9XqUcv27vkIuVOkBEcWstd2pMlWSeaA= github.com/Microsoft/hcsshim v0.13.0/go.mod h1:9KWJ/8DgU+QzYGupX4tzMhRQE8h6w90lH6HAaclpEok= github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2 h1:+vx7roKuyA63nhn5WAunQHLTznkw5W8b1Xc0dNjp83s= github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2/go.mod h1:HBCaDeC1lPdgDeDbhX8XFpy1jqjK0IBG8W5K+xYqA0w= github.com/Shopify/logrus-bugsnag v0.0.0-20170309145241-6dbc35f2c30d h1:hi6J4K6DKrR4/ljxn6SF6nURyu785wKMuQcjt7H3VCQ= github.com/Shopify/logrus-bugsnag v0.0.0-20170309145241-6dbc35f2c30d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ= github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d h1:licZJFw2RwpHMqeKTCYkitsPqHNxTmd4SNR5r94FGM8= github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d/go.mod h1:asat636LX7Bqt5lYEZ27JNDcqxfjdBQuJ/MM4CN/Lzo= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/anchore/go-struct-converter v0.0.0-20221118182256-c68fdcfa2092 h1:aM1rlcoLz8y5B2r4tTLMiVTrMtpfY0O8EScKJxaSaEc= github.com/anchore/go-struct-converter v0.0.0-20221118182256-c68fdcfa2092/go.mod h1:rYqSE9HbjzpHTI74vwPvae4ZVYZd1lue2ta6xHPdblA= github.com/apparentlymart/go-textseg/v15 v15.0.0 h1:uYvfpb3DyLSCGWnctWKGj857c6ew1u1fNQOlOtuGxQY= github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmmsvpAG721bKi0joRfFdHIWJ4= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/atomicgo/cursor v0.0.1/go.mod h1:cBON2QmmrysudxNBFthvMtN32r3jxVRIvzkUiF/RuIk= github.com/aws/aws-sdk-go-v2 v1.30.3 h1:jUeBtG0Ih+ZIFH0F4UkmL9w3cSpaMv9tYYDbzILP8dY= github.com/aws/aws-sdk-go-v2 v1.30.3/go.mod h1:nIQjQVp5sfpQcTc9mPSr1B0PaWK5ByX9MOoDadSN4lc= github.com/aws/aws-sdk-go-v2/config v1.27.27 h1:HdqgGt1OAP0HkEDDShEl0oSYa9ZZBSOmKpdpsDMdO90= github.com/aws/aws-sdk-go-v2/config v1.27.27/go.mod h1:MVYamCg76dFNINkZFu4n4RjDixhVr51HLj4ErWzrVwg= github.com/aws/aws-sdk-go-v2/credentials v1.17.27 h1:2raNba6gr2IfA0eqqiP2XiQ0UVOpGPgDSi0I9iAP+UI= github.com/aws/aws-sdk-go-v2/credentials v1.17.27/go.mod h1:gniiwbGahQByxan6YjQUMcW4Aov6bLC3m+evgcoN4r4= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.11 h1:KreluoV8FZDEtI6Co2xuNk/UqI9iwMrOx/87PBNIKqw= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.11/go.mod h1:SeSUYBLsMYFoRvHE0Tjvn7kbxaUhl75CJi1sbfhMxkU= github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.15 h1:SoNJ4RlFEQEbtDcCEt+QG56MY4fm4W8rYirAmq+/DdU= github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.15/go.mod h1:U9ke74k1n2bf+RIgoX1SXFed1HLs51OgUSs+Ph0KJP8= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.15 h1:C6WHdGnTDIYETAm5iErQUiVNsclNx9qbJVPIt03B6bI= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.15/go.mod h1:ZQLZqhcu+JhSrA9/NXRm8SkDvsycE+JkV3WGY41e+IM= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 h1:hT8rVHwugYE2lEfdFE0QWVo81lF7jMrYJVDWI+f+VxU= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0/go.mod h1:8tu/lYfQfFe6IGnaOdrpVgEL2IrrDOf6/m9RQum4NkY= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.3 h1:dT3MqvGhSoaIhRseqw2I0yH81l7wiR2vjs57O51EAm8= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.3/go.mod h1:GlAeCkHwugxdHaueRr4nhPuY+WW+gR8UjlcqzPr1SPI= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.17 h1:HGErhhrxZlQ044RiM+WdoZxp0p+EGM62y3L6pwA4olE= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.17/go.mod h1:RkZEx4l0EHYDJpWppMJ3nD9wZJAa8/0lq9aVC+r2UII= github.com/aws/aws-sdk-go-v2/service/sso v1.22.4 h1:BXx0ZIxvrJdSgSvKTZ+yRBeSqqgPM89VPlulEcl37tM= github.com/aws/aws-sdk-go-v2/service/sso v1.22.4/go.mod h1:ooyCOXjvJEsUw7x+ZDHeISPMhtwI3ZCB7ggFMcFfWLU= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.4 h1:yiwVzJW2ZxZTurVbYWA7QOrAaCYQR72t0wrSBfoesUE= github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.4/go.mod h1:0oxfLkpz3rQ/CHlx5hB7H69YUpFiI1tql6Q6Ne+1bCw= github.com/aws/aws-sdk-go-v2/service/sts v1.30.3 h1:ZsDKRLXGWHk8WdtyYMoGNO7bTudrvuKpDKgMVRlepGE= github.com/aws/aws-sdk-go-v2/service/sts v1.30.3/go.mod h1:zwySh8fpFyXp9yOr/KVzxOl8SRqgf/IDw5aUt9UKFcQ= github.com/aws/smithy-go v1.20.3 h1:ryHwveWzPV5BIof6fyDvor6V3iUL7nTfiTKXHiW05nE= github.com/aws/smithy-go v1.20.3/go.mod h1:krry+ya/rV9RDcV/Q16kpu6ypI4K2czasz0NC3qS14E= github.com/beorn7/perks v0.0.0-20150223135152-b965b613227f/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bitly/go-hostpool v0.1.0/go.mod h1:4gOCgp6+NZnVqlKyZ/iBZFTAJKembaVENUpMkpg42fw= github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= github.com/buger/goterm v1.0.4 h1:Z9YvGmOih81P0FbVtEYTFF6YsSgxSUKEhf/f9bTMXbY= github.com/buger/goterm v1.0.4/go.mod h1:HiFWV3xnkolgrBV3mY8m0X0Pumt4zg4QhbdOzQtB8tE= github.com/bugsnag/bugsnag-go v1.0.5-0.20150529004307-13fd6b8acda0 h1:s7+5BfS4WFJoVF9pnB8kBk03S7pZXRdKamnV0FOl5Sc= github.com/bugsnag/bugsnag-go v1.0.5-0.20150529004307-13fd6b8acda0/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8= github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b h1:otBG+dV+YK+Soembjv71DPz3uX/V/6MMlSyD9JBQ6kQ= github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b/go.mod h1:obH5gd0BsqsP2LwDJ9aOkm/6J86V6lyAXCoQWGw3K50= github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0 h1:nvj0OLI3YqYXer/kZD8Ri1aaunCxIEsOst1BVJswV0o= github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE= github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chzyer/logex v1.1.10 h1:Swpa1K6QvQznwJRcfTfQJmTE72DqScAa40E+fbHEXEE= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e h1:fY5BOSpyZCqRo5OhCuC+XN+r/bBCmeuuJtjz+bCNIf8= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 h1:q763qf9huN11kDQavWsoZXJNW3xEE4JJyHa5Q25/sd8= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/cloudflare/cfssl v0.0.0-20180223231731-4e2dcbde5004 h1:lkAMpLVBDaj17e85keuznYcH5rqI438v41pKcBl4ZxQ= github.com/cloudflare/cfssl v0.0.0-20180223231731-4e2dcbde5004/go.mod h1:yMWuSON2oQp+43nFtAV/uvKQIFpSPerB57DCt9t8sSA= github.com/codahale/rfc6979 v0.0.0-20141003034818-6a90f24967eb h1:EDmT6Q9Zs+SbUoc7Ik9EfrFqcylYqgPZ9ANSbTAntnE= github.com/codahale/rfc6979 v0.0.0-20141003034818-6a90f24967eb/go.mod h1:ZjrT6AXHbDs86ZSdt/osfBi5qfexBrKUdONk989Wnk4= github.com/common-nighthawk/go-figure v0.0.0-20210622060536-734e95fb86be h1:J5BL2kskAlV9ckgEsNQXscjIaLiOYiZ75d4e94E6dcQ= github.com/common-nighthawk/go-figure v0.0.0-20210622060536-734e95fb86be/go.mod h1:mk5IQ+Y0ZeO87b858TlA645sVcEcbiX6YqP98kt+7+w= github.com/compose-spec/compose-go/v2 v2.9.0 h1:UHSv/QHlo6QJtrT4igF1rdORgIUhDo1gWuyJUoiNNIM= github.com/compose-spec/compose-go/v2 v2.9.0/go.mod h1:Oky9AZGTRB4E+0VbTPZTUu4Kp+oEMMuwZXZtPPVT1iE= github.com/containerd/cgroups/v3 v3.0.5 h1:44na7Ud+VwyE7LIoJ8JTNQOa549a8543BmzaJHo6Bzo= github.com/containerd/cgroups/v3 v3.0.5/go.mod h1:SA5DLYnXO8pTGYiAHXz94qvLQTKfVM5GEVisn4jpins= github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U= github.com/containerd/console v1.0.5 h1:R0ymNeydRqH2DmakFNdmjR2k0t7UPuiOV/N/27/qqsc= github.com/containerd/console v1.0.5/go.mod h1:YynlIjWYF8myEu6sdkwKIvGQq+cOckRm6So2avqoYAk= github.com/containerd/containerd/api v1.9.0 h1:HZ/licowTRazus+wt9fM6r/9BQO7S0vD5lMcWspGIg0= github.com/containerd/containerd/api v1.9.0/go.mod h1:GhghKFmTR3hNtyznBoQ0EMWr9ju5AqHjcZPsSpTKutI= github.com/containerd/containerd/v2 v2.1.5 h1:pWSmPxUszaLZKQPvOx27iD4iH+aM6o0BoN9+hg77cro= github.com/containerd/containerd/v2 v2.1.5/go.mod h1:8C5QV9djwsYDNhxfTCFjWtTBZrqjditQ4/ghHSYjnHM= github.com/containerd/continuity v0.4.5 h1:ZRoN1sXq9u7V6QoHMcVWGhOwDFqZ4B9i5H6un1Wh0x4= github.com/containerd/continuity v0.4.5/go.mod h1:/lNJvtJKUQStBzpVQ1+rasXO1LAWtUQssk28EZvJ3nE= github.com/containerd/errdefs v1.0.0 h1:tg5yIfIlQIrxYtu9ajqY42W3lpS19XqdxRQeEwYG8PI= github.com/containerd/errdefs v1.0.0/go.mod h1:+YBYIdtsnF4Iw6nWZhJcqGSg/dwvV7tyJ/kCkyJ2k+M= github.com/containerd/errdefs/pkg v0.3.0 h1:9IKJ06FvyNlexW690DXuQNx2KA2cUJXx151Xdx3ZPPE= github.com/containerd/errdefs/pkg v0.3.0/go.mod h1:NJw6s9HwNuRhnjJhM7pylWwMyAkmCQvQ4GpJHEqRLVk= github.com/containerd/fifo v1.1.0 h1:4I2mbh5stb1u6ycIABlBw9zgtlK8viPI9QkQNRQEEmY= github.com/containerd/fifo v1.1.0/go.mod h1:bmC4NWMbXlt2EZ0Hc7Fx7QzTFxgPID13eH0Qu+MAb2o= github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= github.com/containerd/nydus-snapshotter v0.15.2 h1:qsHI4M+Wwrf6Jr4eBqhNx8qh+YU0dSiJ+WPmcLFWNcg= github.com/containerd/nydus-snapshotter v0.15.2/go.mod h1:FfwH2KBkNYoisK/e+KsmNr7xTU53DmnavQHMFOcXwfM= github.com/containerd/platforms v1.0.0-rc.1 h1:83KIq4yy1erSRgOVHNk1HYdPvzdJ5CnsWaRoJX4C41E= github.com/containerd/platforms v1.0.0-rc.1/go.mod h1:J71L7B+aiM5SdIEqmd9wp6THLVRzJGXfNuWCZCllLA4= github.com/containerd/plugin v1.0.0 h1:c8Kf1TNl6+e2TtMHZt+39yAPDbouRH9WAToRjex483Y= github.com/containerd/plugin v1.0.0/go.mod h1:hQfJe5nmWfImiqT1q8Si3jLv3ynMUIBB47bQ+KexvO8= github.com/containerd/stargz-snapshotter v0.16.3 h1:zbQMm8dRuPHEOD4OqAYGajJJUwCeUzt4j7w9Iaw58u4= github.com/containerd/stargz-snapshotter/estargz v0.16.3 h1:7evrXtoh1mSbGj/pfRccTampEyKpjpOnS3CyiV1Ebr8= github.com/containerd/stargz-snapshotter/estargz v0.16.3/go.mod h1:uyr4BfYfOj3G9WBVE8cOlQmXAbPN9VEQpBBeJIuOipU= github.com/containerd/ttrpc v1.2.7 h1:qIrroQvuOL9HQ1X6KHe2ohc7p+HP/0VE6XPU7elJRqQ= github.com/containerd/ttrpc v1.2.7/go.mod h1:YCXHsb32f+Sq5/72xHubdiJRQY9inL4a4ZQrAbN1q9o= github.com/containerd/typeurl/v2 v2.2.3 h1:yNA/94zxWdvYACdYO8zofhrTVuQY73fFU1y++dYSw40= github.com/containerd/typeurl/v2 v2.2.3/go.mod h1:95ljDnPfD3bAbDJRugOiShd/DlAAsxGtUBhJxIn7SCk= github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.17/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= github.com/creack/pty v1.1.24 h1:bJrF4RRfyJnbTJqzRLHzcGaZK1NeM5kTC9jGgovnR1s= github.com/creack/pty v1.1.24/go.mod h1:08sCNb52WyoAwi2QDyzUCTgcvVFhUzewun7wtTfvcwE= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/denisenkom/go-mssqldb v0.0.0-20191128021309-1d7a30a10f73/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk= github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= github.com/dlclark/regexp2 v1.11.0 h1:G/nrcoOa7ZXlpoa/91N3X7mM3r8eIlMBBJZvsz/mxKI= github.com/dlclark/regexp2 v1.11.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= github.com/docker/buildx v0.29.1 h1:58hxM5Z4mnNje3G5NKfULT9xCr8ooM8XFtlfUK9bKaA= github.com/docker/buildx v0.29.1/go.mod h1:J4EFv6oxlPiV1MjO0VyJx2u5tLM7ImDEl9zyB8d4wPI= github.com/docker/cli v28.5.1+incompatible h1:ESutzBALAD6qyCLqbQSEf1a/U8Ybms5agw59yGVc+yY= github.com/docker/cli v28.5.1+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/cli-docs-tool v0.10.0 h1:bOD6mKynPQgojQi3s2jgcUWGp/Ebqy1SeCr9VfKQLLU= github.com/docker/cli-docs-tool v0.10.0/go.mod h1:5EM5zPnT2E7yCLERZmrDA234Vwn09fzRHP4aX1qwp1U= github.com/docker/compose/v2 v2.40.2 h1:h2bDBJkOuqmj93XvT2oI0ArPQonE0lGtWiILXdiXvbA= github.com/docker/compose/v2 v2.40.2/go.mod h1:CbSJpKGw20LInVsPjglZ8z7Squ3OBQOD7Ux5nkjGfIU= github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk= github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/docker v28.5.1+incompatible h1:Bm8DchhSD2J6PsFzxC35TZo4TLGR2PdW/E69rU45NhM= github.com/docker/docker v28.5.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker-credential-helpers v0.9.3 h1:gAm/VtF9wgqJMoxzT3Gj5p4AqIjCBS4wrsOh9yRqcz8= github.com/docker/docker-credential-helpers v0.9.3/go.mod h1:x+4Gbw9aGmChi3qTLZj8Dfn0TD20M/fuWy0E5+WDeCo= github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c h1:lzqkGL9b3znc+ZUgi7FlLnqjQhcXxkNM/quxIjBVMD0= github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c/go.mod h1:CADgU4DSXK5QUlFslkQu2yW2TKzFZcXq/leZfM0UH5Q= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-connections v0.6.0 h1:LlMG9azAe1TqfR7sO+NJttz1gy6KO7VJBh+pMmjSD94= github.com/docker/go-connections v0.6.0/go.mod h1:AahvXYshr6JgfUJGdDCs2b5EZG/vmaMAntpSFH5BFKE= github.com/docker/go-metrics v0.0.0-20180209012529-399ea8c73916/go.mod h1:/u0gXw0Gay3ceNrsHubL3BtdOL2fHf93USgMTe0W5dI= github.com/docker/go-metrics v0.0.1 h1:AgB/0SvBxihN0X8OR4SjsblXkbMvalQ8cjmtKQ2rQV8= github.com/docker/go-metrics v0.0.1/go.mod h1:cG1hvH2utMXtqgqqYE9plW6lDxS3/5ayHzueweSI3Vw= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7 h1:UhxFibDNY/bfvqU5CAUmr9zpesgbU6SWc8/B4mflAE4= github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7/go.mod h1:cyGadeNEkKy96OOhEzfZl+yxihPEzKnqJwvfuSUqbZE= github.com/dvsekhvalnov/jose2go v0.0.0-20170216131308-f21a8cedbbae/go.mod h1:7BvyPhdbLxMXIYTFPLsyJRFMsKmOZnQmzh6Gb+uquuM= github.com/eiannone/keyboard v0.0.0-20220611211555-0d226195f203 h1:XBBHcIb256gUJtLmY22n99HaZTz+r2Z51xUPi01m3wg= github.com/eiannone/keyboard v0.0.0-20220611211555-0d226195f203/go.mod h1:E1jcSv8FaEny+OP/5k9UxZVw9YFWGj7eI4KR/iOBqCg= github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5/go.mod h1:a2zkGnVExMxdzMo3M0Hi/3sEU+cWnZpSni0O6/Yb/P0= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fsnotify/fsevents v0.2.0 h1:BRlvlqjvNTfogHfeBOFvSC9N0Ddy+wzQCQukyoD7o/c= github.com/fsnotify/fsevents v0.2.0/go.mod h1:B3eEk39i4hz8y1zaWS/wPrAP4O6wkIl7HQwKBr1qH/w= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fvbommel/sortorder v1.1.0 h1:fUmoe+HLsBTctBDoaBwpQo5N+nrCp8g/BjKb/6ZQmYw= github.com/fvbommel/sortorder v1.1.0/go.mod h1:uk88iVf1ovNn1iLfgUVU2F9o5eO30ui720w+kxuqRs0= github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E= github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ= github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY= github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-openapi/swag v0.23.0 h1:vsEVJDUo2hPJ2tu0/Xc+4noaxyEffXNIs3cOULZ+GrE= github.com/go-openapi/swag v0.23.0/go.mod h1:esZ8ITTYEsH1V2trKHjAN8Ai7xHb8RV+YSZ577vPjgQ= github.com/go-sql-driver/mysql v1.3.0 h1:pgwjLi/dvffoP9aabwkT3AKpXQM93QARkjFhDDqC1UE= github.com/go-sql-driver/mysql v1.3.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/go-viper/mapstructure/v2 v2.4.0 h1:EBsztssimR/CONLSZZ04E8qAkxNYq4Qp9LvH92wZUgs= github.com/go-viper/mapstructure/v2 v2.4.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/gofrs/flock v0.12.1 h1:MTLVXXHf8ekldpJk3AKicLij9MdwOWkZ+a/jHHZby9E= github.com/gofrs/flock v0.12.1/go.mod h1:9zxTsyu5xtJ9DK+1tFZyibEV7y3uwDxPPfbxeeHCoD0= github.com/gogo/protobuf v1.0.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v5 v5.2.2 h1:Rl4B7itRWVtYIHFrSNd7vhTiz9UpLdi6gZhZ3wEeDy8= github.com/golang-jwt/jwt/v5 v5.2.2/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/google/certificate-transparency-go v1.0.10-0.20180222191210-5ab67e519c93 h1:jc2UWq7CbdszqeH6qu1ougXMIUBfSy8Pbh/anURYbGI= github.com/google/certificate-transparency-go v1.0.10-0.20180222191210-5ab67e519c93/go.mod h1:QeJfpSbVSfYc7RgB3gJFj9cbuQMMchQxrWXz8Ruopmg= github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/pprof v0.0.0-20250403155104-27863c87afa6 h1:BHT72Gu3keYf3ZEu2J0b1vyeLSOYI8bm5wbJM/8yDe8= github.com/google/pprof v0.0.0-20250403155104-27863c87afa6/go.mod h1:boTsfXsheKC2y+lKOCMpSfarhxDeIzfZG1jqGcPl3cA= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gookit/color v1.4.2/go.mod h1:fqRyamkC1W8uxl+lxCQxOT09l/vYfZ+QeiX3rKQHCoQ= github.com/gookit/color v1.5.0/go.mod h1:43aQb+Zerm/BWh2GnrgOQm7ffz7tvQXEKV6BFMl7wAo= github.com/gookit/color v1.5.4 h1:FZmqs7XOyGgCAxmWyPslpiok1k05wmY3SJTytgvYFs0= github.com/gookit/color v1.5.4/go.mod h1:pZJOeOS8DM43rXbp4AZo1n9zCU2qjpcRko0b6/QJi9w= github.com/gorilla/mux v1.7.0/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.1 h1:e9Rjr40Z98/clHv5Yg79Is0NtosR5LXRvdr7o/6NwbA= github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.1/go.mod h1:tIxuGz/9mpox++sgp9fJjHO0+q1X9/UOWd798aAm22M= github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed h1:5upAirOpQc1Q53c0bnx2ufif5kANL7bfZWcc6VJWJd8= github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed/go.mod h1:tMWxXQ9wFIaZeTI9F+hmhFiGpFmhOHzyShyFUhRm0H4= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hinshun/vt10x v0.0.0-20220119200601-820417d04eec h1:qv2VnGeEQHchGaZ/u7lxST/RaJw+cv273q79D81Xbog= github.com/hinshun/vt10x v0.0.0-20220119200601-820417d04eec/go.mod h1:Q48J4R4DvxnHolD5P8pOtXigYlRuPLGl6moFx3ulM68= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/in-toto/in-toto-golang v0.9.0 h1:tHny7ac4KgtsfrG6ybU8gVOZux2H8jN05AXJ9EBM1XU= github.com/in-toto/in-toto-golang v0.9.0/go.mod h1:xsBVrVsHNsB61++S6Dy2vWosKhuA3lUTQd+eF9HdeMo= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/inhies/go-bytesize v0.0.0-20220417184213-4913239db9cf h1:FtEj8sfIcaaBfAKrE1Cwb61YDtYq9JxChK1c7AKce7s= github.com/inhies/go-bytesize v0.0.0-20220417184213-4913239db9cf/go.mod h1:yrqSXGoD/4EKfF26AOGzscPOgTTJcyAwM2rpixWT+t4= github.com/jinzhu/gorm v0.0.0-20170222002820-5409931a1bb8 h1:CZkYfurY6KGhVtlalI4QwQ6T0Cu6iuY3e0x5RLu96WE= github.com/jinzhu/gorm v0.0.0-20170222002820-5409931a1bb8/go.mod h1:Vla75njaFJ8clLU1W44h34PjIkijhjHIYnZxMqCdxqo= github.com/jinzhu/inflection v0.0.0-20170102125226-1c35d901db3d h1:jRQLvyVGL+iVtDElaEIDdKwpPqUIZJfzkNLV34htpEc= github.com/jinzhu/inflection v0.0.0-20170102125226-1c35d901db3d/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= github.com/jinzhu/now v1.1.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= github.com/jonboulle/clockwork v0.5.0 h1:Hyh9A8u51kptdkR+cqRpT1EebBwTn1oK9YfGYbdFz6I= github.com/jonboulle/clockwork v0.5.0/go.mod h1:3mZlmanh0g2NDKO5TWZVJAfofYk64M7XN3SzBPjZF60= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/juju/loggo v0.0.0-20190526231331-6e530bcce5d8/go.mod h1:vgyd7OREkbtVEN/8IXZe5Ooef3LQePvuBm9UWj6ZL8U= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo= github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.0.10/go.mod h1:g2LTdtYhdyuGPqyWyv7qRAmj1WBqxuObKfj5c0PQa7c= github.com/klauspost/cpuid/v2 v2.0.12/go.mod h1:g2LTdtYhdyuGPqyWyv7qRAmj1WBqxuObKfj5c0PQa7c= github.com/klauspost/cpuid/v2 v2.2.3 h1:sxCkb+qR91z4vsqw4vGGZlDgPz3G7gjaLyK3V8y70BU= github.com/klauspost/cpuid/v2 v2.2.3/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/lib/pq v0.0.0-20150723085316-0dad96c0b94f/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lithammer/fuzzysearch v1.1.8 h1:/HIuJnjHuXS8bKaiTMeeDlW2/AyIWk2brx1V8LFgLN4= github.com/lithammer/fuzzysearch v1.1.8/go.mod h1:IdqeyBClc3FFqSzYq/MXESsS4S0FsZ5ajtkr5xPLts4= github.com/magiconair/properties v1.5.3/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.9 h1:nWcCbLq1N2v/cpNsy5WvQ37Fb+YElfq20WJ/a8RkpQM= github.com/magiconair/properties v1.8.9/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA= github.com/manifoldco/promptui v0.9.0/go.mod h1:ka04sppxSGFAtxX0qhlYQjISsg9mR4GWtQEhdbn6Pgg= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-shellwords v1.0.12 h1:M2zGm7EW6UQJvDeQxo4T51eKPurbeFbe8WtebGE2xrk= github.com/mattn/go-shellwords v1.0.12/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y= github.com/mattn/go-sqlite3 v1.6.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b h1:j7+1HpAFS1zy5+Q4qx1fWh90gTKwiN4QCGoY9TWyyO4= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= github.com/miekg/pkcs11 v1.0.2/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= github.com/miekg/pkcs11 v1.1.1 h1:Ugu9pdy6vAYku5DEpVWVFPYnzV+bxB+iRdbuFSu7TvU= github.com/miekg/pkcs11 v1.1.1/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= github.com/mitchellh/go-ps v1.0.0 h1:i6ampVEEF4wQFF+bkYfwYgY+F/uYJDktmvLPf7qIgjc= github.com/mitchellh/go-ps v1.0.0/go.mod h1:J4lOc8z8yJs6vUwklHw2XEIiT4z4C40KtWVN3nvg8Pg= github.com/mitchellh/hashstructure/v2 v2.0.2 h1:vGKWl0YJqUNxE8d+h8f6NJLcCJrgbhC4NcD46KavDd4= github.com/mitchellh/hashstructure/v2 v2.0.2/go.mod h1:MG3aRVU/N29oo/V/IhBX8GR/zz4kQkprJgF2EVszyDE= github.com/mitchellh/mapstructure v0.0.0-20150613213606-2caf8efc9366/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/moby/buildkit v0.25.1 h1:j7IlVkeNbEo+ZLoxdudYCHpmTsbwKvhgc/6UJ/mY/o8= github.com/moby/buildkit v0.25.1/go.mod h1:phM8sdqnvgK2y1dPDnbwI6veUCXHOZ6KFSl6E164tkc= github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0= github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo= github.com/moby/go-archive v0.1.0 h1:Kk/5rdW/g+H8NHdJW2gsXyZ7UnzvJNOy6VKJqueWdcQ= github.com/moby/go-archive v0.1.0/go.mod h1:G9B+YoujNohJmrIYFBpSd54GTUB4lt9S+xVQvsJyFuo= github.com/moby/locker v1.0.1 h1:fOXqR41zeveg4fFODix+1Ch4mj/gT0NE1XJbp/epuBg= github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc= github.com/moby/patternmatcher v0.6.0 h1:GmP9lR19aU5GqSSFko+5pRqHi+Ohk1O69aFiKkVGiPk= github.com/moby/patternmatcher v0.6.0/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc= github.com/moby/spdystream v0.5.0 h1:7r0J1Si3QO/kjRitvSLVVFUjxMEb/YLj6S9FF62JBCU= github.com/moby/spdystream v0.5.0/go.mod h1:xBAYlnt/ay+11ShkdFKNAG7LsyK/tmNBVvVOwrfMgdI= github.com/moby/sys/atomicwriter v0.1.0 h1:kw5D/EqkBwsBFi0ss9v1VG3wIkVhzGvLklJ+w3A14Sw= github.com/moby/sys/atomicwriter v0.1.0/go.mod h1:Ul8oqv2ZMNHOceF643P6FKPXeCmYtlQMvpizfsSoaWs= github.com/moby/sys/capability v0.4.0 h1:4D4mI6KlNtWMCM1Z/K0i7RV1FkX+DBDHKVJpCndZoHk= github.com/moby/sys/capability v0.4.0/go.mod h1:4g9IK291rVkms3LKCDOoYlnV8xKwoDTpIrNEE35Wq0I= github.com/moby/sys/mountinfo v0.7.2 h1:1shs6aH5s4o5H2zQLn796ADW1wMrIwHsyJ2v9KouLrg= github.com/moby/sys/mountinfo v0.7.2/go.mod h1:1YOa8w8Ih7uW0wALDUgT1dTTSBrZ+HiBLGws92L2RU4= github.com/moby/sys/sequential v0.6.0 h1:qrx7XFUd/5DxtqcoH1h438hF5TmOvzC/lspjy7zgvCU= github.com/moby/sys/sequential v0.6.0/go.mod h1:uyv8EUTrca5PnDsdMGXhZe6CCe8U/UiTWd+lL+7b/Ko= github.com/moby/sys/signal v0.7.1 h1:PrQxdvxcGijdo6UXXo/lU/TvHUWyPhj7UOpSo8tuvk0= github.com/moby/sys/signal v0.7.1/go.mod h1:Se1VGehYokAkrSQwL4tDzHvETwUZlnY7S5XtQ50mQp8= github.com/moby/sys/symlink v0.3.0 h1:GZX89mEZ9u53f97npBy4Rc3vJKj7JBDj/PN2I22GrNU= github.com/moby/sys/symlink v0.3.0/go.mod h1:3eNdhduHmYPcgsJtZXW1W4XUJdZGBIkttZ8xKqPUJq0= github.com/moby/sys/user v0.4.0 h1:jhcMKit7SA80hivmFJcbB1vqmw//wU61Zdui2eQXuMs= github.com/moby/sys/user v0.4.0/go.mod h1:bG+tYYYJgaMtRKgEmuueC0hJEAZWwtIbZTB+85uoHjs= github.com/moby/sys/userns v0.1.0 h1:tVLXkFOxVu9A64/yh59slHVv9ahO9UIev4JZusOLG/g= github.com/moby/sys/userns v0.1.0/go.mod h1:IHUYgu/kao6N8YZlp9Cf444ySSvCmDlmzUcYfDHOl28= github.com/moby/term v0.5.2 h1:6qk3FJAFDs6i/q3W/pQ97SX192qKfZgGjCQqfCJkgzQ= github.com/moby/term v0.5.2/go.mod h1:d3djjFCrjnB+fl8NJux+EJzu0msscUP+f8it8hPkFLc= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.0 h1:Iw5WCbBcaAAd0fpRb1c9r5YCylv4XDoCSigm1zLevwU= github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= github.com/onsi/ginkgo/v2 v2.21.0 h1:7rg/4f3rB88pb5obDgNZrNHrQ4e6WpjonchcpuBRnZM= github.com/onsi/ginkgo/v2 v2.21.0/go.mod h1:7Du3c42kxCUegi0IImZ1wUQzMBVecgIHjR1C+NkhLQo= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/onsi/gomega v1.35.1 h1:Cwbd75ZBPxFSuZ6T+rN/WCb/gOc6YgFBXLlZLhC7Ds4= github.com/onsi/gomega v1.35.1/go.mod h1:PvZbdDc8J6XJEpDK4HCuRBm8a6Fzp9/DmhC9C7yFlog= github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/opencontainers/image-spec v1.1.1 h1:y0fUlFfIZhPF1W537XOLg0/fcx6zcHCJwooC2xJA040= github.com/opencontainers/image-spec v1.1.1/go.mod h1:qpqAh3Dmcf36wStyyWU+kCeDgrGnAve2nCC8+7h8Q0M= github.com/opencontainers/runtime-spec v1.2.1 h1:S4k4ryNgEpxW1dzyqffOmhI1BHYcjzU8lpJfSlR0xww= github.com/opencontainers/runtime-spec v1.2.1/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/selinux v1.12.0 h1:6n5JV4Cf+4y0KNXW48TLj5DwfXpvWlxXplUkdTrmPb8= github.com/opencontainers/selinux v1.12.0/go.mod h1:BTPX+bjVbWGXw7ZZWUbdENt8w0htPSrlgOOysQaU62U= github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 h1:GFCKgmp0tecUJ0sJuv4pzYCqS9+RGSn52M3FUwPs+uo= github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10/go.mod h1:t/avpk3KcrXxUnYOhZhMXJlSEyie6gQbtLq5NM3loB8= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_golang v0.9.0-pre1.0.20180209125602-c332b6f63c06/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g= github.com/prometheus/client_golang v1.22.0 h1:rb93p9lokFEsctTys46VnV1kLCDpVZ0a/Y92Vm0Zc6Q= github.com/prometheus/client_golang v1.22.0/go.mod h1:R7ljNsLXhuQXYZYtw6GAE9AZg8Y7vEW5scdCXrWRXC0= github.com/prometheus/client_model v0.0.0-20171117100541-99fa1f4be8e5/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.0.0-20180110214958-89604d197083/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= github.com/prometheus/common v0.62.0 h1:xasJaQlnWAeyHdUBeGjXmutelfJHWMRr+Fg4QszZ2Io= github.com/prometheus/common v0.62.0/go.mod h1:vyBcEuLSvWos9B1+CyL7JZ2up+uFzXhkqml0W5zIY1I= github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/pterm/pterm v0.12.27/go.mod h1:PhQ89w4i95rhgE+xedAoqous6K9X+r6aSOI2eFF7DZI= github.com/pterm/pterm v0.12.29/go.mod h1:WI3qxgvoQFFGKGjGnJR849gU0TsEOvKn5Q8LlY1U7lg= github.com/pterm/pterm v0.12.30/go.mod h1:MOqLIyMOgmTDz9yorcYbcw+HsgoZo3BQfg2wtl3HEFE= github.com/pterm/pterm v0.12.31/go.mod h1:32ZAWZVXD7ZfG0s8qqHXePte42kdz8ECtRyEejaWgXU= github.com/pterm/pterm v0.12.33/go.mod h1:x+h2uL+n7CP/rel9+bImHD5lF3nM9vJj80k9ybiiTTE= github.com/pterm/pterm v0.12.36/go.mod h1:NjiL09hFhT/vWjQHSj1athJpx6H8cjpHXNAK5bUw8T8= github.com/pterm/pterm v0.12.40/go.mod h1:ffwPLwlbXxP+rxT0GsgDTzS3y3rmpAO1NMjUkGTYf8s= github.com/pterm/pterm v0.12.79 h1:lH3yrYMhdpeqX9y5Ep1u7DejyHy7NSQg9qrBjF9dFT4= github.com/pterm/pterm v0.12.79/go.mod h1:1v/gzOF1N0FsjbgTHZ1wVycRkKiatFvJSJC4IGaQAAo= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/santhosh-tekuri/jsonschema/v6 v6.0.1 h1:PKK9DyHxif4LZo+uQSgXNqs0jj5+xZwwfKHgph2lxBw= github.com/santhosh-tekuri/jsonschema/v6 v6.0.1/go.mod h1:JXeL+ps8p7/KNMjDQk3TCwPpBy0wYklyWTfbkIzdIFU= github.com/sashabaranov/go-openai v1.36.0 h1:fcSrn8uGuorzPWCBp8L0aCR95Zjb/Dd+ZSML0YZy9EI= github.com/sashabaranov/go-openai v1.36.0/go.mod h1:lj5b/K+zjTSFxVLijLSTDZuP7adOgerWeFyZLUhAKRg= github.com/secure-systems-lab/go-securesystemslib v0.6.0 h1:T65atpAVCJQK14UA57LMdZGpHi4QYSH/9FZyNGqMYIA= github.com/secure-systems-lab/go-securesystemslib v0.6.0/go.mod h1:8Mtpo9JKks/qhPG4HGZ2LGMvrPbzuxwfz/f/zLfEWkk= github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/serialx/hashring v0.0.0-20200727003509-22c0c7ab6b1b h1:h+3JX2VoWTFuyQEo87pStk/a99dzIO1mM9KxIyLPGTU= github.com/serialx/hashring v0.0.0-20200727003509-22c0c7ab6b1b/go.mod h1:/yeG0My1xr/u+HZrFQ1tOQQQQrOawfyMUH13ai5brBc= github.com/shibumi/go-pathspec v1.3.0 h1:QUyMZhFo0Md5B8zV8x2tesohbb5kfbpTi9rBnKh5dkI= github.com/shibumi/go-pathspec v1.3.0/go.mod h1:Xutfslp817l2I1cZvgcfeMQJG5QnU2lh5tVaaMCl3jE= github.com/sirupsen/logrus v1.0.6/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 h1:JIAuq3EEf9cgbU6AtGPK4CTG3Zf6CKMNqf0MHTggAUA= github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966/go.mod h1:sUM3LWHvSMaG192sy56D9F7CNvL7jUJVXoqM1QKLnog= github.com/spdx/tools-golang v0.5.5 h1:61c0KLfAcNqAjlg6UNMdkwpMernhw3zVRwDZ2x9XOmk= github.com/spdx/tools-golang v0.5.5/go.mod h1:MVIsXx8ZZzaRWNQpUDhC4Dud34edUYJYecciXgrw5vE= github.com/spf13/cast v0.0.0-20150508191742-4d07383ffe94 h1:JmfC365KywYwHB946TTiQWEb8kqPY+pybPLoGE9GgVk= github.com/spf13/cast v0.0.0-20150508191742-4d07383ffe94/go.mod h1:r2rcYCSwa1IExKTDiTfzaxqT2FNHs8hODu4LnUfgKEg= github.com/spf13/cobra v0.0.1/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v1.10.1 h1:lJeBwCfmrnXthfAupyUTzJ/J4Nc1RsHC/mSRU2dll/s= github.com/spf13/cobra v1.10.1/go.mod h1:7SmJGaTHFVBY0jW4NXGluQoLvhqFQM+6XSKD+P4XaB0= github.com/spf13/jwalterweatherman v0.0.0-20141219030609-3d60171a6431 h1:XTHrT015sxHyJ5FnQ0AeemSspZWaDq7DoTRW0EVsDCE= github.com/spf13/jwalterweatherman v0.0.0-20141219030609-3d60171a6431/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/pflag v1.0.0/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk= github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v0.0.0-20150530192845-be5ff3e4840c h1:2EejZtjFjKJGk71ANb+wtFK5EjUzUkEM3R0xnp559xg= github.com/spf13/viper v0.0.0-20150530192845-be5ff3e4840c/go.mod h1:A8kyI5cUJhb8N+3pkfONlcEcZbueH6nhAm0Fq7SrnBM= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= github.com/theupdateframework/notary v0.7.0 h1:QyagRZ7wlSpjT5N2qQAh/pN+DVqgekv4DzbAiAiEL3c= github.com/theupdateframework/notary v0.7.0/go.mod h1:c9DRxcmhHmVLDay4/2fUYdISnHqbFDGRSlXPO0AhYWw= github.com/tilt-dev/fsnotify v1.4.8-0.20220602155310-fff9c274a375 h1:QB54BJwA6x8QU9nHY3xJSZR2kX9bgpZekRKGkLTmEXA= github.com/tilt-dev/fsnotify v1.4.8-0.20220602155310-fff9c274a375/go.mod h1:xRroudyp5iVtxKqZCrA6n2TLFRBf8bmnjr1UD4x+z7g= github.com/tonistiigi/dchapes-mode v0.0.0-20250318174251-73d941a28323 h1:r0p7fK56l8WPequOaR3i9LBqfPtEdXIQbUTzT55iqT4= github.com/tonistiigi/dchapes-mode v0.0.0-20250318174251-73d941a28323/go.mod h1:3Iuxbr0P7D3zUzBMAZB+ois3h/et0shEz0qApgHYGpY= github.com/tonistiigi/fsutil v0.0.0-20250605211040-586307ad452f h1:MoxeMfHAe5Qj/ySSBfL8A7l1V+hxuluj8owsIEEZipI= github.com/tonistiigi/fsutil v0.0.0-20250605211040-586307ad452f/go.mod h1:BKdcez7BiVtBvIcef90ZPc6ebqIWr4JWD7+EvLm6J98= github.com/tonistiigi/go-csvvalue v0.0.0-20240814133006-030d3b2625d0 h1:2f304B10LaZdB8kkVEaoXvAMVan2tl9AiK4G0odjQtE= github.com/tonistiigi/go-csvvalue v0.0.0-20240814133006-030d3b2625d0/go.mod h1:278M4p8WsNh3n4a1eqiFcV2FGk7wE5fwUpUom9mK9lE= github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea h1:SXhTLE6pb6eld/v/cCndK0AMpt1wiVFb/YYmqB3/QG0= github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea/go.mod h1:WPnis/6cRcDZSUvVmezrxJPkiO87ThFYsoUiMwWNDJk= github.com/tonistiigi/vt100 v0.0.0-20240514184818-90bafcd6abab h1:H6aJ0yKQ0gF49Qb2z5hI1UHxSQt4JMyxebFR15KnApw= github.com/tonistiigi/vt100 v0.0.0-20240514184818-90bafcd6abab/go.mod h1:ulncasL3N9uLrVann0m+CDlJKWsIAP34MPcOJF6VRvc= github.com/vbatts/tar-split v0.12.1 h1:CqKoORW7BUWBe7UL/iqTVvkTBOF8UvOMKOIZykxnnbo= github.com/vbatts/tar-split v0.12.1/go.mod h1:eF6B6i6ftWQcDqEn3/iGFRFRo8cBIMSJVOpnNdfTMFA= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/xhit/go-str2duration/v2 v2.1.0 h1:lxklc02Drh6ynqX+DdPyp5pCKLUQpRT8bp8Ydu2Bstc= github.com/xhit/go-str2duration/v2 v2.1.0/go.mod h1:ohY8p+0f07DiV6Em5LKB0s2YpLtXVyJfNt1+BlmyAsU= github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778/go.mod h1:2MuV+tbUrU1zIOPMxZ5EncGwgmMJsa+9ucAQZXxsObs= github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no= github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/zclconf/go-cty v1.17.0 h1:seZvECve6XX4tmnvRzWtJNHdscMtYEx5R7bnnVyd/d0= github.com/zclconf/go-cty v1.17.0/go.mod h1:wqFzcImaLTI6A5HfsRwB0nj5n0MRZFwmey8YoFPPs3U= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.60.0 h1:x7wzEgXfnzJcHDwStJT+mxOz4etr2EcexjqhBvmoakw= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.60.0/go.mod h1:rg+RlpR5dKwaS95IyyZqj5Wd4E13lk/msnTS0Xl9lJM= go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.60.0 h1:0tY123n7CdWMem7MOVdKOt0YfshufLCwfE5Bob+hQuM= go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.60.0/go.mod h1:CosX/aS4eHnG9D7nESYpV753l4j9q5j3SL/PUYd2lR8= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.60.0 h1:sbiXRNDSWJOTobXh5HyQKjq6wUC5tNybqjIqDpAY4CU= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.60.0/go.mod h1:69uWxva0WgAA/4bu2Yy70SLDBwZXuQ6PbBpbsa5iZrQ= go.opentelemetry.io/otel v1.36.0 h1:UumtzIklRBY6cI/lllNZlALOF5nNIzJVb16APdvgTXg= go.opentelemetry.io/otel v1.36.0/go.mod h1:/TcFMXYjyRNh8khOAO9ybYkqaDBb/70aVwkNML4pP8E= go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.35.0 h1:QcFwRrZLc82r8wODjvyCbP7Ifp3UANaBSmhDSFjnqSc= go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.35.0/go.mod h1:CXIWhUomyWBG/oY2/r/kLp6K/cmx9e/7DLpBuuGdLCA= go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.35.0 h1:0NIXxOCFx+SKbhCVxwl3ETG8ClLPAa0KuKV6p3yhxP8= go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.35.0/go.mod h1:ChZSJbbfbl/DcRZNc9Gqh6DYGlfjw4PvO1pEOZH1ZsE= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.35.0 h1:1fTNlAIJZGWLP5FVu0fikVry1IsiUnXjf7QFvoNN3Xw= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.35.0/go.mod h1:zjPK58DtkqQFn+YUMbx0M2XV3QgKU0gS9LeGohREyK4= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.35.0 h1:m639+BofXTvcY1q8CGs4ItwQarYtJPOWmVobfM1HpVI= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.35.0/go.mod h1:LjReUci/F4BUyv+y4dwnq3h/26iNOeC3wAIqgvTIZVo= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.35.0 h1:xJ2qHD0C1BeYVTLLR9sX12+Qb95kfeD/byKj6Ky1pXg= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.35.0/go.mod h1:u5BF1xyjstDowA1R5QAO9JHzqK+ublenEW/dyqTjBVk= go.opentelemetry.io/otel/metric v1.36.0 h1:MoWPKVhQvJ+eeXWHFBOPoBOi20jh6Iq2CcCREuTYufE= go.opentelemetry.io/otel/metric v1.36.0/go.mod h1:zC7Ks+yeyJt4xig9DEw9kuUFe5C3zLbVjV2PzT6qzbs= go.opentelemetry.io/otel/sdk v1.36.0 h1:b6SYIuLRs88ztox4EyrvRti80uXIFy+Sqzoh9kFULbs= go.opentelemetry.io/otel/sdk v1.36.0/go.mod h1:+lC+mTgD+MUWfjJubi2vvXWcVxyr9rmlshZni72pXeY= go.opentelemetry.io/otel/sdk/metric v1.36.0 h1:r0ntwwGosWGaa0CrSt8cuNuTcccMXERFwHX4dThiPis= go.opentelemetry.io/otel/sdk/metric v1.36.0/go.mod h1:qTNOhFDfKRwX0yXOqJYegL5WRaW376QbB7P4Pb0qva4= go.opentelemetry.io/otel/trace v1.36.0 h1:ahxWNuqZjpdiFAyrIoQ4GIiAIhxAunQR6MUoKrsNd4w= go.opentelemetry.io/otel/trace v1.36.0/go.mod h1:gQ+OnDZzrybY4k4seLzPAWNwVBBVlF2szhehOBB/tGA= go.opentelemetry.io/proto/otlp v1.5.0 h1:xJvq7gMzB31/d406fB8U5CBdyQGw4P399D1aQWU/3i4= go.opentelemetry.io/proto/otlp v1.5.0/go.mod h1:keN8WnHxOy8PG0rQZjJJ5A2ebUoafqWp0eVQ4yIXvJ4= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/mock v0.6.0 h1:hyF9dfmbgIX5EfOdasqLsWD6xqpNZlXblLB/Dbnwv3Y= go.uber.org/mock v0.6.0/go.mod h1:KiVJ4BqZJaMj4svdfmHM0AUx4NJYO8ZNpPnZn1Z+BBU= go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.45.0 h1:jMBrvKuj23MTlT0bQEOBcAE0mjg8mK9RXFhRH6nyF3Q= golang.org/x/crypto v0.45.0/go.mod h1:XTGrrkGJve7CYK7J8PEww4aY7gM3qMCElcJQ8n8JdX4= golang.org/x/exp v0.0.0-20250408133849-7e4ce0ab07d0 h1:R84qjqJb5nVJMxqWYb3np9L5ZsaDtB+a39EqjV0JSUM= golang.org/x/exp v0.0.0-20250408133849-7e4ce0ab07d0/go.mod h1:S9Xr4PYopiDyqSyp5NjCrhFrqg6A5zA2E/iPHPhqnS8= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.29.0 h1:HV8lRxZC4l2cr3Zq1LvtOsi/ThTgWnUk/y64QSs8GwA= golang.org/x/mod v0.29.0/go.mod h1:NyhrlYXJ2H4eJiRy/WDBO6HMqZQ6q9nk4JzS3NuCK+w= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.47.0 h1:Mx+4dIFzqraBXUugkia1OOvlD6LemFo1ALMHjrXDOhY= golang.org/x/net v0.47.0/go.mod h1:/jNxtkgq5yWUGYkaZGqo27cfGZ1c5Nen03aYrrKpVRU= golang.org/x/oauth2 v0.30.0 h1:dnDm7JmhM45NNpd8FDDeLhK6FwqbOf4MLCM9zb1BOHI= golang.org/x/oauth2 v0.30.0/go.mod h1:B++QgG3ZKulg6sRPGD/mqlHQs5rB3Ml9erfeDY7xKlU= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.18.0 h1:kr88TuHDroi+UVf+0hZnirlk8o8T+4MrK6mr60WkH/I= golang.org/x/sync v0.18.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210331175145-43e1dd70ce54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211013075003-97ac67df715c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc= golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.37.0 h1:8EGAD0qCmHYZg6J17DvsMy9/wJ7/D/4pV/wfnld5lTU= golang.org/x/term v0.37.0/go.mod h1:5pB4lxRNYYVZuTLmy8oR2BH8dflOR+IbTYFD8fi3254= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.31.0 h1:aC8ghyu4JhP8VojJ2lEHBnochRno1sgL6nEi9WGFGMM= golang.org/x/text v0.31.0/go.mod h1:tKRAlv61yKIjGGHX/4tP1LTbc13YSec1pxVEWXzfoeM= golang.org/x/time v0.11.0 h1:/bpjEDfN9tkoN/ryeYHnv5hcMlc8ncjMcM4XBk5NWV0= golang.org/x/time v0.11.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.38.0 h1:Hx2Xv8hISq8Lm16jvBZ2VQf+RLmbd7wVUsALibYI/IQ= golang.org/x/tools v0.38.0/go.mod h1:yEsQ/d/YK8cjh0L6rZlY8tgtlKiBNTL14pGDJPJpYQs= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/genproto/googleapis/api v0.0.0-20250528174236-200df99c418a h1:SGktgSolFCo75dnHJF2yMvnns6jCmHFJ0vE4Vn2JKvQ= google.golang.org/genproto/googleapis/api v0.0.0-20250528174236-200df99c418a/go.mod h1:a77HrdMjoeKbnd2jmgcWdaS++ZLZAEq3orIOAEIKiVw= google.golang.org/genproto/googleapis/rpc v0.0.0-20250528174236-200df99c418a h1:v2PbRU4K3llS09c7zodFpNePeamkAwG3mPrAery9VeE= google.golang.org/genproto/googleapis/rpc v0.0.0-20250528174236-200df99c418a/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A= google.golang.org/grpc v1.0.5/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.74.2 h1:WoosgB65DlWVC9FqI82dGsZhWFNBSLjQ84bjROOpMu4= google.golang.org/grpc v1.74.2/go.mod h1:CtQ+BGjaAIXHs/5YS3i473GqwBBa1zGQNevxdeBEXrM= google.golang.org/protobuf v1.36.9 h1:w2gp2mA27hUeUzj9Ex9FBjsBm40zfaDtEWow293U7Iw= google.golang.org/protobuf v1.36.9/go.mod h1:fuxRtAxBytpl4zzqUh6/eyUujkJdNiuEkXntxiD/uRU= gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/cenkalti/backoff.v2 v2.2.1 h1:eJ9UAg01/HIHG987TwxvnzK2MgxXq97YY6rYDpY9aII= gopkg.in/cenkalti/backoff.v2 v2.2.1/go.mod h1:S0QdOvT2AlerfSBkp0O+dk+bbIMaNbEmVk876gPCthU= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/evanphx/json-patch.v4 v4.12.0 h1:n6jtcsulIzXPJaxegRbvFNNrZDjbij7ny3gmSPG+6V4= gopkg.in/evanphx/json-patch.v4 v4.12.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/rethinkdb/rethinkdb-go.v6 v6.2.1 h1:d4KQkxAaAiRY2h5Zqis161Pv91A37uZyJOx73duwUwM= gopkg.in/rethinkdb/rethinkdb-go.v6 v6.2.1/go.mod h1:WbjuEoo1oadwzQ4apSDU+JTvmllEHtsNHS6y7vFc7iw= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools/v3 v3.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q= gotest.tools/v3 v3.5.2/go.mod h1:LtdLGcnqToBH83WByAAi/wiwSFCArdFIUV/xxN4pcjA= k8s.io/api v0.32.3 h1:Hw7KqxRusq+6QSplE3NYG4MBxZw1BZnq4aP4cJVINls= k8s.io/api v0.32.3/go.mod h1:2wEDTXADtm/HA7CCMD8D8bK4yuBUptzaRhYcYEEYA3k= k8s.io/apimachinery v0.32.3 h1:JmDuDarhDmA/Li7j3aPrwhpNBA94Nvk5zLeOge9HH1U= k8s.io/apimachinery v0.32.3/go.mod h1:GpHVgxoKlTxClKcteaeuF1Ul/lDVb74KpZcxcmLDElE= k8s.io/client-go v0.32.3 h1:RKPVltzopkSgHS7aS98QdscAgtgah/+zmpAogooIqVU= k8s.io/client-go v0.32.3/go.mod h1:3v0+3k4IcT9bXTc4V2rt+d2ZPPG700Xy6Oi0Gdl2PaY= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f h1:GA7//TjRY9yWGy1poLzYYJJ4JRdzg3+O6e8I+e+8T5Y= k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f/go.mod h1:R/HEjbvWI0qdfb8viZUeVZm0X6IZnxAydC7YU42CMw4= k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 h1:M3sRQVHv7vB20Xc2ybTt7ODCeFj6JSWYFzOFnYeS6Ro= k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 h1:/Rv+M11QRah1itp8VhT6HoVx1Ray9eB4DBr+K+/sCJ8= sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3/go.mod h1:18nIHnGi6636UCz6m8i4DhaJ65T6EruyzmoQqI2BVDo= sigs.k8s.io/structured-merge-diff/v4 v4.4.2 h1:MdmvkGuXi/8io6ixD5wud3vOLwc1rj0aNqRlpuvjmwA= sigs.k8s.io/structured-merge-diff/v4 v4.4.2/go.mod h1:N8f93tFZh9U6vpxwRArLiikrE5/2tiu1w1AGfACIGE4= sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= tags.cncf.io/container-device-interface v1.0.1 h1:KqQDr4vIlxwfYh0Ed/uJGVgX+CHAkahrgabg6Q8GYxc= tags.cncf.io/container-device-interface v1.0.1/go.mod h1:JojJIOeW3hNbcnOH2q0NrWNha/JuHoDZcmYxAZwb2i0= ================================================ FILE: wren-launcher/main.go ================================================ package main import ( "flag" "os" "github.com/Canner/WrenAI/wren-launcher/commands" "github.com/Canner/WrenAI/wren-launcher/config" "github.com/pterm/pterm" ) func main() { config.InitFlags() // Check if we have subcommands if len(os.Args) > 1 { switch os.Args[1] { case "dbt-auto-convert": // Remove the subcommand from args so flag.Parse() works correctly os.Args = append([]string{os.Args[0]}, os.Args[2:]...) commands.DbtAutoConvert() return case "help", "-h", "--help": showHelp() return } } // help flag help := flag.Bool("h", false, "Display help") flag.Parse() if *help { showHelp() return } commands.Launch() } func showHelp() { pterm.Info.Println("Usage of Wren launcher:") pterm.Info.Println("") pterm.Info.Println("Commands:") pterm.Info.Println(" (default) Launch Wren AI service") pterm.Info.Println(" dbt-auto-convert --path --output [--profile] [--target] Auto-convert dbt project to WrenDataSource and Wren MDL") pterm.Info.Println("") pterm.Info.Println("Flags:") flag.PrintDefaults() pterm.Info.Println("") pterm.Info.Println("Examples:") pterm.Info.Println(" wren-launcher # Launch Wren AI") pterm.Info.Println(" wren-launcher dbt-auto-convert --path /path/to/dbt --output ./output # Auto-convert dbt project") pterm.Info.Println(" wren-launcher dbt-auto-convert --path /path/to/dbt --output ./output --profile my_profile --target dev # Convert with specific profile/target") } ================================================ FILE: wren-launcher/utils/docker.go ================================================ package utils import ( "context" "fmt" "io" "net/http" "os" "path" "regexp" "strings" "github.com/Canner/WrenAI/wren-launcher/config" "github.com/docker/cli/cli/command" "github.com/docker/cli/cli/flags" cmdCompose "github.com/docker/compose/v2/cmd/compose" "github.com/docker/compose/v2/pkg/api" "github.com/docker/compose/v2/pkg/compose" "github.com/docker/docker/api/types/container" "github.com/google/uuid" "github.com/pterm/pterm" ) const ( // please change the version when the version is updated WREN_PRODUCT_VERSION string = "0.29.1" DOCKER_COMPOSE_YAML_URL string = "https://raw.githubusercontent.com/Canner/WrenAI/" + WREN_PRODUCT_VERSION + "/docker/docker-compose.yaml" DOCKER_COMPOSE_ENV_URL string = "https://raw.githubusercontent.com/Canner/WrenAI/" + WREN_PRODUCT_VERSION + "/docker/.env.example" AI_SERVICE_CONFIG_URL string = "https://raw.githubusercontent.com/Canner/WrenAI/" + WREN_PRODUCT_VERSION + "/docker/config.example.yaml" ) var generationModelToModelName = map[string]string{ "gpt-4.1": "gpt-4.1-2025-04-14", "gpt-4.1-mini": "gpt-4.1-mini-2025-04-14", "gpt-4.1-nano": "gpt-4.1-nano-2025-04-14", "gpt-5": "gpt-5-2025-08-07", "gpt-5-mini": "gpt-5-mini-2025-08-07", "gpt-5-nano": "gpt-5-nano-2025-08-07", } func replaceEnvFileContent(content string, projectDir string, openaiApiKey string, openAIGenerationModel string, hostPort int, aiPort int, userUUID string, telemetryEnabled bool, platform string, localStorage string) string { // replace PLATFORM reg := regexp.MustCompile(`PLATFORM=(.*)`) str := reg.ReplaceAllString(content, "PLATFORM="+platform) // replace PROJECT_DIR reg = regexp.MustCompile(`PROJECT_DIR=(.*)`) str = reg.ReplaceAllString(str, "PROJECT_DIR="+projectDir) // replace SHOULD_FORCE_DEPLOY reg = regexp.MustCompile(`SHOULD_FORCE_DEPLOY=(.*)`) str = reg.ReplaceAllString(str, "SHOULD_FORCE_DEPLOY=1") // replace OPENAI_API_KEY reg = regexp.MustCompile(`OPENAI_API_KEY=(.*)`) str = reg.ReplaceAllString(str, "OPENAI_API_KEY="+openaiApiKey) // replace GENERATION_MODEL // it seems like using for telemetry to know the model, might be we can remove this in the future and provide a endpoint to get the information reg = regexp.MustCompile(`GENERATION_MODEL=(.*)`) str = reg.ReplaceAllString(str, "GENERATION_MODEL="+openAIGenerationModel) // replace USER_UUID reg = regexp.MustCompile(`USER_UUID=(.*)`) str = reg.ReplaceAllString(str, "USER_UUID="+userUUID) // replace PORT reg = regexp.MustCompile(`HOST_PORT=(.*)`) str = reg.ReplaceAllString(str, "HOST_PORT="+fmt.Sprintf("%d", hostPort)) // replace AI_SERVICE_FORWARD_PORT reg = regexp.MustCompile(`AI_SERVICE_FORWARD_PORT=(.*)`) str = reg.ReplaceAllString(str, "AI_SERVICE_FORWARD_PORT="+fmt.Sprintf("%d", aiPort)) // replace TELEMETRY_ENABLED reg = regexp.MustCompile(`TELEMETRY_ENABLED=(.*)`) str = reg.ReplaceAllString(str, "TELEMETRY_ENABLED="+fmt.Sprintf("%t", telemetryEnabled)) // replace EXPERIMENTAL_ENGINE_RUST_VERSION reg = regexp.MustCompile(`EXPERIMENTAL_ENGINE_RUST_VERSION=(.*)`) str = reg.ReplaceAllString(str, "EXPERIMENTAL_ENGINE_RUST_VERSION="+fmt.Sprintf("%t", config.IsExperimentalEngineRustVersion())) // replace LOCAL_STORAGE if localStorage == "" { localStorage = "." } reg = regexp.MustCompile(`LOCAL_STORAGE=(.*)`) str = reg.ReplaceAllString(str, "LOCAL_STORAGE="+localStorage) return str } func downloadFile(filepath string, url string) error { // Get the data resp, err := http.Get(url) // #nosec G107 -- URL is from trusted source constants if err != nil { return err } defer func() { _ = resp.Body.Close() }() // Create the file out, err := os.Create(filepath) // #nosec G304 -- filepath is controlled by application if err != nil { return err } defer func() { _ = out.Close() }() // Write the body to file _, err = io.Copy(out, resp.Body) return err } func CheckDockerDaemonRunning() (bool, error) { ctx := context.Background() dockerCli, err := command.NewDockerCli() if err != nil { return false, err } err = dockerCli.Initialize(flags.NewClientOptions()) if err != nil { return false, err } _, err = dockerCli.Client().Info(ctx) if err != nil { return false, err } return true, nil } func prepareUserUUID(projectDir string) (string, error) { wrenRC := WrenRC{projectDir} err := wrenRC.Set("USER_UUID", uuid.New().String(), false) if err != nil { return "", err } userUUID, err := wrenRC.Read("USER_UUID") if err != nil { return "", err } return userUUID, nil } func PrepareConfigFileForOpenAI(projectDir string, generationModel string) error { // download config.yaml file configPath := path.Join(projectDir, "config.yaml") pterm.Info.Println("Downloading config.yaml file to", configPath) err := downloadFile(configPath, AI_SERVICE_CONFIG_URL) if err != nil { return err } // read the config.yaml file content, err := os.ReadFile(configPath) // #nosec G304 -- configPath is controlled by application if err != nil { return err } // replace the generation model in config.yaml config := string(content) // gpt-4.1-nano is the default model, so we don't need to replace it if generationModel != "gpt-4.1-nano" { config = strings.ReplaceAll(config, "litellm_llm.default", "litellm_llm."+generationModelToModelName[generationModel]) } // write back to config.yaml err = os.WriteFile(configPath, []byte(config), 0600) if err != nil { return err } return nil } func mergeEnvContent(newEnvFile string, envFileContent string) (string, error) { // Check if .env file does not exist if _, err := os.Stat(newEnvFile); err != nil { return envFileContent, nil } // File exists, read existing content existingContent, err := os.ReadFile(newEnvFile) // #nosec G304 -- newEnvFile is controlled by application if err != nil { return "", err } // Split both contents into lines existingLines := strings.Split(string(existingContent), "\n") newLines := strings.Split(envFileContent, "\n") // Create map of existing env vars existingEnvVars := make(map[string]string) // Helper function to parse env var line parseEnvVar := func(line string) (string, string, bool) { line = strings.TrimSpace(line) if line == "" || strings.HasPrefix(line, "#") { return "", "", false } parts := strings.SplitN(line, "=", 2) if len(parts) != 2 { return "", "", false } return parts[0], parts[1], true } // Parse existing env vars for _, line := range existingLines { if key, val, ok := parseEnvVar(line); ok { existingEnvVars[key] = val } } // Merge with new values for _, line := range newLines { if key, val, ok := parseEnvVar(line); ok && val != "" { existingEnvVars[key] = val } } // Build merged content var mergedLines []string for _, line := range newLines { line = strings.TrimSpace(line) if line == "" || strings.HasPrefix(line, "#") { mergedLines = append(mergedLines, line) continue } if key, _, ok := parseEnvVar(line); ok { if val, exists := existingEnvVars[key]; exists { mergedLines = append(mergedLines, key+"="+val) } } } // Update envFileContent with merged content envFileContent = strings.Join(mergedLines, "\n") return envFileContent, nil } func PrepareDockerFiles(openaiApiKey string, openaiGenerationModel string, hostPort int, aiPort int, projectDir string, telemetryEnabled bool, llmProvider string, platform string, localStorage string) error { // download docker-compose file composeFile := path.Join(projectDir, "docker-compose.yaml") pterm.Info.Println("Downloading docker-compose file to", composeFile) err := downloadFile(composeFile, DOCKER_COMPOSE_YAML_URL) if err != nil { return err } if strings.ToLower(llmProvider) == "openai" { userUUID, err := prepareUserUUID(projectDir) if err != nil { return err } // download env file envExampleFile := path.Join(projectDir, ".env.example") pterm.Info.Println("Downloading env file to", envExampleFile) err = downloadFile(envExampleFile, DOCKER_COMPOSE_ENV_URL) if err != nil { return err } // read the file envExampleFileContent, err := os.ReadFile(envExampleFile) // #nosec G304 -- envExampleFile is controlled by application if err != nil { return err } // replace the content with regex envFileContent := replaceEnvFileContent( string(envExampleFileContent), projectDir, openaiApiKey, openaiGenerationModel, hostPort, aiPort, userUUID, telemetryEnabled, platform, localStorage, ) newEnvFile := getEnvFilePath(projectDir) // merge the env file content with the existing env file envFileContent, err = mergeEnvContent(newEnvFile, envFileContent) if err != nil { return err } // write the file err = os.WriteFile(newEnvFile, []byte(envFileContent), 0600) if err != nil { return err } // remove the old env file err = os.Remove(envExampleFile) if err != nil { return err } } else if strings.ToLower(llmProvider) == "custom" { // if .env file does not exist, return error if _, err := os.Stat(getEnvFilePath(projectDir)); os.IsNotExist(err) { return fmt.Errorf(".env file does not exist, please download the env file from %s to ~/.wrenai, rename it to .env and fill in the required information", DOCKER_COMPOSE_ENV_URL) } // if config.yaml file does not exist, return error if _, err := os.Stat(getConfigFilePath(projectDir)); os.IsNotExist(err) { return fmt.Errorf("config.yaml file does not exist, please download the config.yaml file from %s to ~/.wrenai, rename it to config.yaml and fill in the required information", AI_SERVICE_CONFIG_URL) } } return nil } func getEnvFilePath(projectDir string) string { return path.Join(projectDir, ".env") } func getConfigFilePath(projectDir string) string { return path.Join(projectDir, "config.yaml") } // RunDockerCompose starts Docker services for a project using docker-compose. // It initializes Docker CLI, checks Docker engine availability, and runs docker-compose up. // For custom LLM providers, it specifically recreates the wren-ai-service container. // // Parameters: // - projectName: Name of the Docker Compose project // - projectDir: Directory containing docker-compose.yaml and .env files // - llmProvider: Type of LLM provider (e.g., "custom" or default) // // Returns an error if Docker initialization, configuration, or service startup fails. // Supports both default and custom LLM provider configurations. // // Example: // // err := RunDockerCompose("wren", "/path/to/project", "openai") func RunDockerCompose(projectName string, projectDir string, llmProvider string) error { ctx := context.Background() composeFilePath := path.Join(projectDir, "docker-compose.yaml") envFile := path.Join(projectDir, ".env") envFiles := []string{envFile} configPaths := []string{composeFilePath} // docker-compose up dockerCli, err := command.NewDockerCli() if err != nil { return err } err = dockerCli.Initialize(flags.NewClientOptions()) if err != nil { return err } // check if docker engine is running _, err = dockerCli.Client().Info(ctx) if err != nil { return err } // Create the compose API service instance with the Docker cli apiService := compose.NewComposeService(dockerCli) // Create a default project options struct projectOptions := cmdCompose.ProjectOptions{ ProjectName: projectName, ConfigPaths: configPaths, WorkDir: projectDir, EnvFiles: envFiles, } // Turn projectOptions into a project with default values projectType, _, err := projectOptions.ToProject(ctx, dockerCli, []string{}) if err != nil { return err } // Run the up command err = apiService.Up(ctx, projectType, api.UpOptions{}) if err != nil { return err } if strings.ToLower(llmProvider) == "custom" { // Create up options for force recreating only wren-ai-service upOptions := api.UpOptions{ Create: api.CreateOptions{ Recreate: api.RecreateForce, Services: []string{"wren-ai-service"}, }, } // Run the up command with specific options for wren-ai-service err = apiService.Up(ctx, projectType, upOptions) if err != nil { return err } } return nil } func listProcess() ([]container.Summary, error) { ctx := context.Background() dockerCli, err := command.NewDockerCli() if err != nil { return nil, err } err = dockerCli.Initialize(flags.NewClientOptions()) if err != nil { return nil, err } containerListOptions := container.ListOptions{ All: true, } containers, err := dockerCli.Client().ContainerList(ctx, containerListOptions) if err != nil { return nil, err } return containers, nil } func findWrenUIContainer() (container.Summary, error) { containers, err := listProcess() if err != nil { return container.Summary{}, err } for _, cont := range containers { // return if com.docker.compose.project == wrenai && com.docker.compose.service=wren-ui if cont.Labels["com.docker.compose.project"] == "wrenai" && cont.Labels["com.docker.compose.service"] == "wren-ui" { return cont, nil } } return container.Summary{}, fmt.Errorf("WrenUI container not found") } func findAIServiceContainer() (container.Summary, error) { containers, err := listProcess() if err != nil { return container.Summary{}, err } for _, cont := range containers { if cont.Labels["com.docker.compose.project"] == "wrenai" && cont.Labels["com.docker.compose.service"] == "wren-ai-service" { return cont, nil } } return container.Summary{}, fmt.Errorf("WrenAI service container not found") } func IfPortUsedByWrenUI(port int) bool { container, err := findWrenUIContainer() if err != nil { return false } for _, containerPort := range container.Ports { if port >= 0 && port <= 65535 && containerPort.PublicPort == uint16(port) { return true } } return false } func IfPortUsedByAIService(port int) bool { container, err := findAIServiceContainer() if err != nil { return false } for _, containerPort := range container.Ports { if port >= 0 && port <= 65535 && containerPort.PublicPort == uint16(port) { return true } } return false } func CheckUIServiceStarted(url string) error { // check response from localhost:3000 resp, err := http.Get(url) // #nosec G107 -- URL is validated by application logic if err != nil { return err } defer func() { _ = resp.Body.Close() }() if resp.StatusCode != 200 { return fmt.Errorf("wren AI is not started yet") } return nil } func CheckAIServiceStarted(url string) error { // health check resp, err := http.Get(url) // #nosec G107 -- URL is validated by application logic if err != nil { return err } defer func() { _ = resp.Body.Close() }() if resp.StatusCode != 200 { return fmt.Errorf("AI service is not started yet") } return nil } ================================================ FILE: wren-launcher/utils/docker_test.go ================================================ package utils import ( "testing" ) func TestFindWrenUIContainer(t *testing.T) { container, error := findWrenUIContainer() if error != nil { t.Errorf("Error: %v", error) } t.Logf("Container ID: %s", container.ID) t.Logf("Container Name: %s", container.Names[0]) for _, port := range container.Ports { t.Logf("Container IP: %s", port.IP) t.Logf("Container Port Type: %s", port.Type) t.Logf("Container PublicPort: %d", port.PublicPort) t.Logf("Container PrivatePort: %d", port.PrivatePort) } } ================================================ FILE: wren-launcher/utils/network.go ================================================ package utils import ( "fmt" "net" "github.com/pterm/pterm" ) func ifPortUsed(port int) bool { // listen on port to check if it's used _, err := net.Listen("tcp", fmt.Sprintf(":%d", port)) return err != nil } func FindAvailablePort(defaultPort int) int { // Find an available port // Start from the default port and increment by 1 // until a port is found that is not in use for port := defaultPort; port < defaultPort+100; port++ { pterm.Info.Printf("Checking if port %d is available\n", port) if !ifPortUsed(port) { // Return the port if it's not used return port } else if IfPortUsedByWrenUI(port) || IfPortUsedByAIService(port) { // Return the port if it's used, but used by wrenAI return port } } // If no port is available, return 0 return 0 } ================================================ FILE: wren-launcher/utils/os.go ================================================ package utils import ( "fmt" "os/exec" "runtime" ) type OS int const ( // Windows is the Windows operating system. Windows OS = iota // Darwin is the Apple operating system. Darwin // Linux is the Linux operating system. Linux // Unknown is an unknown operating system. Unknown ) func DetectOS() OS { switch runtime.GOOS { case "windows": return Windows case "darwin": return Darwin case "linux": return Linux default: return Unknown } } func Openbrowser(url string) error { var err error switch DetectOS() { case Linux: err = exec.Command("xdg-open", url).Start() case Windows: err = exec.Command("rundll32", "url.dll,FileProtocolHandler", url).Start() case Darwin: err = exec.Command("open", url).Start() default: err = fmt.Errorf("unsupported platform") } return err } func OpenDockerDaemon() error { var err error switch DetectOS() { case Linux: // systemctl --user start docker-desktop err = exec.Command("systemctl", "--user", "start", "docker-desktop").Run() case Windows: // C:\Program Files\Docker\Docker\Docker Desktop.exe err = exec.Command("C:\\Program Files\\Docker\\Docker\\Docker Desktop.exe").Run() case Darwin: cmd := exec.Command("open", "-a", "Docker") err = cmd.Run() default: err = fmt.Errorf("unsupported platform") } return err } ================================================ FILE: wren-launcher/utils/rc.go ================================================ // the wrenrc.go package is responsible for writing and reading rcfile // the rc file should located in ~/.wrenai/.wrenrc // should have public methods "append" and "read"(read by key or all) // the structure of the rcfile is a env like file with key value pairs, // eg: // "foo=bar" // "bar=baz" package utils import ( "bufio" "fmt" "os" "path" "strings" ) type WrenRC struct { rcFileDir string } func (w *WrenRC) getWrenRcFilePath() string { return path.Join(w.rcFileDir, ".wrenrc") } func (w *WrenRC) ensureRcFile() (string, error) { // ensure folder created err := os.MkdirAll(w.rcFileDir, 0750) if err != nil { return "", err } // ensure file created rcFilePath := w.getWrenRcFilePath() _, err = os.Stat(rcFilePath) if os.IsNotExist(err) { f, err := os.Create(rcFilePath) // #nosec G304 -- rcFilePath is controlled by application if err != nil { return "", err } _ = f.Close() } return rcFilePath, nil } func (w *WrenRC) parseInto() (map[string]string, error) { rcFilePath, err := w.ensureRcFile() if err != nil { return nil, err } f, err := os.Open(rcFilePath) // #nosec G304 -- rcFilePath is controlled by application if err != nil { return nil, err } defer func() { _ = f.Close() }() // prepare a map to store the key value pairs m := make(map[string]string) // read the file line by line r := bufio.NewReader(f) lineno := 0 for { // read the line line, err := r.ReadString('\n') if err != nil { if err.Error() != "EOF" { return nil, err // return an error if it's not EOF } break } lineno++ line = strings.Trim(line, " \t\v\r\n") // Skip empty lines and comments if line == "" || line[0] == '#' || line[0] == ';' { continue } // Split the line into key and value based on the '=' character parts := strings.SplitN(line, "=", 2) if len(parts) != 2 { return nil, fmt.Errorf("syntax error on line %d: no '=' character found", lineno) } // Trim spaces around key and value key := strings.TrimSpace(parts[0]) value := strings.TrimSpace(parts[1]) // Store the key-value pair in the map m[key] = value } return m, nil } // set a key value pair to the rc file func (w *WrenRC) Set(key string, value string, override bool) error { // get the parsed key value pairs m, err := w.parseInto() if err != nil { return err } // put the new key value pair in the map _, ok := m[key] if ok && !override { // simply return without error return nil } m[key] = value // open the rc file for writing err = w.write(m) if err != nil { return err } return nil } // overrite the rc file with the given key value pairs func (w *WrenRC) write(m map[string]string) error { rcFilePath := w.getWrenRcFilePath() f, err := os.Create(rcFilePath) // #nosec G304 -- rcFilePath is controlled by application if err != nil { return err } defer func() { _ = f.Close() }() for k, v := range m { _, err = fmt.Fprintf(f, "%s=%s\n", k, v) if err != nil { return err } } return nil } // read the value of a key from the rc file func (w *WrenRC) Read(key string) (string, error) { m, err := w.parseInto() if err != nil { return "", err } v, ok := m[key] if !ok { return "", nil } return v, nil } ================================================ FILE: wren-launcher/utils/rc_test.go ================================================ package utils import ( "os" "testing" ) func TestReadWriteRcFile(t *testing.T) { dir, err := os.MkdirTemp("", "wrenrc") if err != nil { t.Errorf("Error: %v", err) } defer func() { _ = os.RemoveAll(dir) }() // create a WrenRC struct w := WrenRC{dir} // write a key value pair to the rc file err = w.Set("key", "value", false) if err != nil { t.Errorf("Error: %v", err) } // read the value of the key from the rc file v, err := w.Read("key") if err != nil { t.Errorf("Error: %v", err) } if v != "value" { t.Errorf("Expected value: value, got: %s", v) } } // read the value of a non-existent key from the rc file func TestSet(t *testing.T) { // create a temp directory dir, err := os.MkdirTemp("", "wrenrc") if err != nil { t.Errorf("Error: %v", err) } defer func() { _ = os.RemoveAll(dir) }() // create a WrenRC struct w := WrenRC{dir} // read the value of a non-existent key from the rc file v, err := w.Read("key") if err != nil { t.Errorf("Error: %v", err) } if v != "" { t.Errorf("Expected value: \"\", got: %s", v) } } ================================================ FILE: wren-mdl/mdl.schema.json ================================================ { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://raw.githubusercontent.com/Canner/WrenAI/main/wren-mdl/mdl.schema.json", "title": "WrenMDL Manifest Schema", "description": "A schema for WrenMDL manifest file", "$defs": { "column": { "type": "object", "properties": { "name": { "description": "the name of the column", "type": "string", "minLength": 1 }, "type": { "description": "the type of the column", "type": "string", "minLength": 1 }, "relationship": { "description": "the relationship used by the column. If the type is a relationship, this field is required", "type": "string" }, "isCalculated": { "description": "whether the column is calculated or not. If the column expression used relationship, this field is required", "type": "boolean" }, "notNull": { "description": "whether the column is not null or not", "type": "boolean" }, "expression": { "description": "the expression of the column. If the column is calculated, this field is required", "type": ["string", "null"] }, "isHidden": { "description": "whether the column is hidden or not", "type": "boolean" }, "columnLevelAccessControl": { "description": "the access-control rule for the column", "type": "object", "properties": { "name": { "description": "the name of the access-control rule", "type": "string" }, "operator": { "description": "the operator of the access-control rule", "type": "string", "enum": [ "EQUALS", "NOT_EQUALS", "GREATER_THAN", "LESS_THAN", "GREATER_THAN_OR_EQUALS", "LESS_THAN_OR_EQUALS" ] }, "requiredProperties": { "description": "the required properties for the access-control rule", "type": "array", "items": { "$ref": "#/$defs/sessionProperty" }, "minItems": 1, "maxItems": 1 }, "threshold": { "description": "the threshold value of the access-control rule", "type": "object", "properties": { "value": { "description": "the value of the threshold", "type": "string" }, "dataType": { "description": "the data type of the threshold", "type": "string", "enum": [ "NUMERIC", "STRING" ] } }, "required": ["value", "dataType"], "additionalProperties": false } }, "required": ["name", "operator", "requiredProperties"], "additionalProperties": false }, "properties": { "description": "the customize properties of the column", "type": "object", "additionalProperties": { "type": "string" } } }, "required": ["name", "type"], "additionalProperties": false }, "sessionProperty": { "type": "object", "properties": { "name": { "description": "the name of the session property", "type": "string", "minLength": 1 }, "required": { "description": "whether the session property is required or not", "type": "boolean" }, "defaultExpr": { "description": "the default SQL expression of the session property", "type": ["string", "null"] } }, "required": ["name", "required"], "additionalProperties": false } }, "type": "object", "properties": { "$schema": { "description": "the schema of WrenMDL", "type": "string", "const": "https://raw.githubusercontent.com/Canner/WrenAI/main/wren-mdl/mdl.schema.json" }, "catalog": { "description": "the catalog name of WrenMDL", "type": "string", "minLength": 1 }, "schema": { "description": "the schema name of WrenMDL", "type": "string", "minLength": 1 }, "sampleDataFolder": { "description": "the folder path for sample data", "type": "string", "minLength": 1 }, "dataSource": { "description": "the data source type (case insensitive). Valid values are: BIGQUERY, CLICKHOUSE, CANNER, TRINO, MSSQL, MYSQL, POSTGRES, SNOWFLAKE, DUCKDB, LOCAL_FILE, S3_FILE, GCS_FILE, MINIO_FILE, ORACLE, ATHENA, REDSHIFT", "type": "string", "pattern": "^(?:[Bb][Ii][Gg][Qq][Uu][Ee][Rr][Yy]|[Cc][Ll][Ii][Cc][Kk][Hh][Oo][Uu][Ss][Ee]|[Cc][Aa][Nn][Nn][Ee][Rr]|[Tt][Rr][Ii][Nn][Oo]|[Mm][Ss][Ss][Qq][Ll]|[Mm][Yy][Ss][Qq][Ll]|[Pp][Oo][Ss][Tt][Gg][Rr][Ee][Ss]|[Ss][Nn][Oo][Ww][Ff][Ll][Aa][Kk][Ee]|[Dd][Uu][Cc][Kk][Dd][Bb]|[Ll][Oo][Cc][Aa][Ll]_[Ff][Ii][Ll][Ee]|[Ss]3_[Ff][Ii][Ll][Ee]|[Gg][Cc][Ss]_[Ff][Ii][Ll][Ee]|[Mm][Ii][Nn][Ii][Oo]_[Ff][Ii][Ll][Ee]|[Oo][Rr][Aa][Cc][Ll][Ee]|[Aa][Tt][Hh][Ee][Nn][Aa]|[Rr][Ee][Dd][Ss][Hh][Ii][Ff][Tt])$", "minLength": 1 }, "models": { "description": "the list of models", "type": "array", "unevaluatedItems": false, "items": { "type": "object", "properties": { "name": { "description": "the name of the model", "type": "string", "minLength": 1 }, "refSql": { "description": "(WIP) the sql reference of the model", "type": "string", "minLength": 1 }, "baseObject": { "description": "(WIP) the base object of the model", "type": "string", "minLength": 1 }, "tableReference": { "description": "the table reference of the model", "type": "object", "properties": { "catalog": { "type": "string" }, "schema": { "type": "string" }, "table": { "type": "string", "minLength": 1 } }, "required": ["table"] }, "columns": { "description": "the list of columns", "type": "array", "items": { "$ref": "#/$defs/column" } }, "primaryKey": { "description": "the primary key of the model. It's required if the model is the one side of any OEN_TO_MANY or MANY_TO_ONE relationship", "type": "string" }, "cached": { "description": "(WIP) whether the model is cached or not", "type": "boolean" }, "refreshTime": { "description": "(WIP) the cache refresh time of the model", "type": "string", "pattern": "^\\s*(\\d+(?:\\.\\d+)?)\\s*([a-zA-Z]+)\\s*$" }, "rowLevelAccessControls": { "type": "array", "items": { "description": "the row-level access-control rule for the model", "type": "object", "properties": { "name": { "description": "the name of the access-control rule", "type": "string" }, "requiredProperties": { "description": "the required properties for the access-control rule", "type": "array", "items": { "$ref": "#/$defs/sessionProperty" } }, "condition": { "description": "The condition of the access-control rule. A condition is a SQL expression that evaluates to true or false.", "type": "string" } }, "required": ["name", "requiredProperties", "condition"], "additionalProperties": false } }, "properties": { "description": "the customize properties of the model", "type": "object", "additionalProperties": { "type": ["string", "number", "boolean", "object", "array", "null"] } } }, "required": ["name"], "oneOf": [ { "required": ["refSql"] }, { "required": ["baseObject"] }, { "required": ["tableReference"] } ], "additionalProperties": false } }, "relationships": { "description": "the list of relationships", "type": "array", "unevaluatedItems": false, "items": { "type": "object", "properties": { "name": { "description": "the name of the relationship", "type": "string", "minLength": 1 }, "models": { "description": "the list of models", "type": "array", "items": { "type": "string", "minLength": 1 }, "minItems": 2, "maxItems": 2 }, "joinType": { "description": "the join type of the relationship", "type": "string", "enum": ["ONE_TO_ONE", "ONE_TO_MANY", "MANY_TO_ONE", "MANY_TO_MANY"] }, "condition": { "description": "the condition of the relationship", "type": "string", "minLength": 1 }, "properties": { "description": "the customize properties of the relationship", "type": "object", "additionalProperties": { "type": ["string", "number", "boolean", "object", "array", "null"] } } }, "required": ["name", "models", "joinType", "condition"] } }, "metrics": { "description": "(WIP) the list of metrics", "type": "array", "unevaluatedItems": false, "items": { "description": "(WIP) the metric", "type": "object", "properties": { "name": { "description": "the name of the metric", "type": "string", "minLength": 1 }, "baseObject": { "description": "the base object of the metric", "type": "string", "minLength": 1 }, "dimension": { "description": "the list of dimensions", "type": "array", "items": { "$ref": "#/$defs/column" } }, "measure": { "description": "the list of measures", "type": "array", "items": { "$ref": "#/$defs/column" }, "minItems": 1 }, "timeGrain": { "description": "the time grain fields of the metric", "type": "array", "unevaluatedItems": false, "items": { "description": "the time grain field. It's should belong to the dimension fields", "type": "object", "properties": { "name": { "description": "the name of the time grain field", "type": "string", "minLength": 1 }, "refColumn": { "description": "the reference column name of the time grain field", "type": "string", "minLength": 1 }, "dateParts": { "description": "the acceptable time units of the time grain field", "type": "array", "items": { "type": "string", "enum": [ "YEAR", "QUARTER", "MONTH", "WEEK", "DAY", "HOUR", "MINUTE", "SECOND" ] } } }, "required": ["name", "refColumn", "dateParts"] } }, "cached": { "type": "boolean" }, "refreshTime": { "type": "string", "description": "the cache refresh time of the metric", "pattern": "^\\s*(\\d+(?:\\.\\d+)?)\\s*([a-zA-Z]+)\\s*$" }, "properties": { "type": "object", "additionalProperties": { "type": ["string", "number", "boolean", "object", "array", "null"] } } }, "required": ["name", "baseObject", "dimension", "measure"] } }, "views": { "description": "the list of views", "type": "array", "unevaluatedItems": false, "items": { "type": "object", "properties": { "name": { "description": "the name of the view", "type": "string", "minLength": 1 }, "statement": { "description": "the sql statement of the view", "type": "string", "minLength": 1 }, "properties": { "description": "the customize properties of the view", "type": "object", "additionalProperties": { "type": ["string", "number", "boolean", "object", "array", "null"] } } }, "required": ["name", "statement"] } }, "enumDefinitions": { "description": "(WIP) the list of enum definitions", "type": "array", "unevaluatedItems": false, "items": { "description": "(WIP) the enum definition", "type": "object", "properties": { "name": { "description": "the name of the enum", "type": "string", "minLength": 1 }, "values": { "type": "array", "unevaluatedItems": false, "items": { "description": "the member of enum", "type": "object", "properties": { "name": { "description": "the name of the member", "type": "string", "minLength": 1 }, "value": { "description": "the value of the member. If not provided, the value is the same as the name", "type": "string", "minLength": 1 }, "properties": { "description": "the customize properties of the member", "type": "object", "additionalProperties": { "type": ["string", "number", "boolean", "object", "array", "null"] } } }, "required": ["name"] } }, "properties": { "description": "the customize properties of the enum", "type": "object", "additionalProperties": { "type": ["string", "number", "boolean", "object", "array", "null"] } } }, "required": ["name", "values"] } } }, "required": ["catalog", "schema"], "additionalProperties": false } ================================================ FILE: wren-ui/.dockerignore ================================================ Dockerfile .dockerignore node_modules npm-debug.log README.md .next .git *.sqlite *.sqlite3 .env*.local ================================================ FILE: wren-ui/.eslintignore ================================================ **/node_modules ================================================ FILE: wren-ui/.eslintrc.json ================================================ { "root": true, "parser": "@typescript-eslint/parser", "extends": ["next/core-web-vitals", "plugin:@typescript-eslint/recommended", "prettier"], "plugins": ["@typescript-eslint", "eslint-plugin-prettier"], "ignorePatterns": [ "!**/*", ".next/**/*", "src/apollo/client/graphql/__types__.ts", "src/apollo/client/graphql/*.generated.ts" ], "overrides": [ { "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], "rules": { "@next/next/no-html-link-for-pages": [ "error", "src/pages" ], "@next/next/no-img-element": "off", "react-hooks/exhaustive-deps": "off" } }, { "files": ["*.ts", "*.tsx"], "rules": {} }, { "files": ["*.js", "*.jsx"], "rules": {} } ], "rules": { "prettier/prettier": "error", "@next/next/no-html-link-for-pages": "off", "react/display-name": 0, "react/no-unescaped-entities": 0, "@typescript-eslint/no-explicit-any": "off", "@typescript-eslint/no-non-null-assertion": "off", "@typescript-eslint/no-unused-vars": [ "error", { "args": "all", "argsIgnorePattern": "^_", "caughtErrors": "all", "caughtErrorsIgnorePattern": "^_", "destructuredArrayIgnorePattern": "^_", "varsIgnorePattern": "^_", "ignoreRestSiblings": true } ] }, "env": { "jest": true } } ================================================ FILE: wren-ui/.prettierrc ================================================ { "singleQuote": true } ================================================ FILE: wren-ui/.yarn/releases/yarn-4.5.3.cjs ================================================ #!/usr/bin/env node /* eslint-disable */ //prettier-ignore (()=>{var j3e=Object.create;var gT=Object.defineProperty;var G3e=Object.getOwnPropertyDescriptor;var W3e=Object.getOwnPropertyNames;var Y3e=Object.getPrototypeOf,K3e=Object.prototype.hasOwnProperty;var ve=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var It=(t,e)=>()=>(t&&(e=t(t=0)),e);var _=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Kt=(t,e)=>{for(var r in e)gT(t,r,{get:e[r],enumerable:!0})},V3e=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of W3e(e))!K3e.call(t,a)&&a!==r&&gT(t,a,{get:()=>e[a],enumerable:!(o=G3e(e,a))||o.enumerable});return t};var et=(t,e,r)=>(r=t!=null?j3e(Y3e(t)):{},V3e(e||!t||!t.__esModule?gT(r,"default",{value:t,enumerable:!0}):r,t));var Pi={};Kt(Pi,{SAFE_TIME:()=>cW,S_IFDIR:()=>VD,S_IFLNK:()=>zD,S_IFMT:()=>Hu,S_IFREG:()=>ow});var Hu,VD,ow,zD,cW,uW=It(()=>{Hu=61440,VD=16384,ow=32768,zD=40960,cW=456789e3});var sr={};Kt(sr,{EBADF:()=>ho,EBUSY:()=>z3e,EEXIST:()=>t_e,EINVAL:()=>X3e,EISDIR:()=>e_e,ENOENT:()=>Z3e,ENOSYS:()=>J3e,ENOTDIR:()=>$3e,ENOTEMPTY:()=>n_e,EOPNOTSUPP:()=>i_e,EROFS:()=>r_e,ERR_DIR_CLOSED:()=>dT});function Nl(t,e){return Object.assign(new Error(`${t}: ${e}`),{code:t})}function z3e(t){return Nl("EBUSY",t)}function J3e(t,e){return Nl("ENOSYS",`${t}, ${e}`)}function X3e(t){return Nl("EINVAL",`invalid argument, ${t}`)}function ho(t){return Nl("EBADF",`bad file descriptor, ${t}`)}function Z3e(t){return Nl("ENOENT",`no such file or directory, ${t}`)}function $3e(t){return Nl("ENOTDIR",`not a directory, ${t}`)}function e_e(t){return Nl("EISDIR",`illegal operation on a directory, ${t}`)}function t_e(t){return Nl("EEXIST",`file already exists, ${t}`)}function r_e(t){return Nl("EROFS",`read-only filesystem, ${t}`)}function n_e(t){return Nl("ENOTEMPTY",`directory not empty, ${t}`)}function i_e(t){return Nl("EOPNOTSUPP",`operation not supported, ${t}`)}function dT(){return Nl("ERR_DIR_CLOSED","Directory handle was closed")}var JD=It(()=>{});var wa={};Kt(wa,{BigIntStatsEntry:()=>cm,DEFAULT_MODE:()=>ET,DirEntry:()=>mT,StatEntry:()=>lm,areStatsEqual:()=>CT,clearStats:()=>XD,convertToBigIntStats:()=>o_e,makeDefaultStats:()=>AW,makeEmptyStats:()=>s_e});function AW(){return new lm}function s_e(){return XD(AW())}function XD(t){for(let e in t)if(Object.hasOwn(t,e)){let r=t[e];typeof r=="number"?t[e]=0:typeof r=="bigint"?t[e]=BigInt(0):yT.types.isDate(r)&&(t[e]=new Date(0))}return t}function o_e(t){let e=new cm;for(let r in t)if(Object.hasOwn(t,r)){let o=t[r];typeof o=="number"?e[r]=BigInt(o):yT.types.isDate(o)&&(e[r]=new Date(o))}return e.atimeNs=e.atimeMs*BigInt(1e6),e.mtimeNs=e.mtimeMs*BigInt(1e6),e.ctimeNs=e.ctimeMs*BigInt(1e6),e.birthtimeNs=e.birthtimeMs*BigInt(1e6),e}function CT(t,e){if(t.atimeMs!==e.atimeMs||t.birthtimeMs!==e.birthtimeMs||t.blksize!==e.blksize||t.blocks!==e.blocks||t.ctimeMs!==e.ctimeMs||t.dev!==e.dev||t.gid!==e.gid||t.ino!==e.ino||t.isBlockDevice()!==e.isBlockDevice()||t.isCharacterDevice()!==e.isCharacterDevice()||t.isDirectory()!==e.isDirectory()||t.isFIFO()!==e.isFIFO()||t.isFile()!==e.isFile()||t.isSocket()!==e.isSocket()||t.isSymbolicLink()!==e.isSymbolicLink()||t.mode!==e.mode||t.mtimeMs!==e.mtimeMs||t.nlink!==e.nlink||t.rdev!==e.rdev||t.size!==e.size||t.uid!==e.uid)return!1;let r=t,o=e;return!(r.atimeNs!==o.atimeNs||r.mtimeNs!==o.mtimeNs||r.ctimeNs!==o.ctimeNs||r.birthtimeNs!==o.birthtimeNs)}var yT,ET,mT,lm,cm,IT=It(()=>{yT=et(ve("util")),ET=33188,mT=class{constructor(){this.name="";this.path="";this.mode=0}isBlockDevice(){return!1}isCharacterDevice(){return!1}isDirectory(){return(this.mode&61440)===16384}isFIFO(){return!1}isFile(){return(this.mode&61440)===32768}isSocket(){return!1}isSymbolicLink(){return(this.mode&61440)===40960}},lm=class{constructor(){this.uid=0;this.gid=0;this.size=0;this.blksize=0;this.atimeMs=0;this.mtimeMs=0;this.ctimeMs=0;this.birthtimeMs=0;this.atime=new Date(0);this.mtime=new Date(0);this.ctime=new Date(0);this.birthtime=new Date(0);this.dev=0;this.ino=0;this.mode=ET;this.nlink=1;this.rdev=0;this.blocks=1}isBlockDevice(){return!1}isCharacterDevice(){return!1}isDirectory(){return(this.mode&61440)===16384}isFIFO(){return!1}isFile(){return(this.mode&61440)===32768}isSocket(){return!1}isSymbolicLink(){return(this.mode&61440)===40960}},cm=class{constructor(){this.uid=BigInt(0);this.gid=BigInt(0);this.size=BigInt(0);this.blksize=BigInt(0);this.atimeMs=BigInt(0);this.mtimeMs=BigInt(0);this.ctimeMs=BigInt(0);this.birthtimeMs=BigInt(0);this.atimeNs=BigInt(0);this.mtimeNs=BigInt(0);this.ctimeNs=BigInt(0);this.birthtimeNs=BigInt(0);this.atime=new Date(0);this.mtime=new Date(0);this.ctime=new Date(0);this.birthtime=new Date(0);this.dev=BigInt(0);this.ino=BigInt(0);this.mode=BigInt(ET);this.nlink=BigInt(1);this.rdev=BigInt(0);this.blocks=BigInt(1)}isBlockDevice(){return!1}isCharacterDevice(){return!1}isDirectory(){return(this.mode&BigInt(61440))===BigInt(16384)}isFIFO(){return!1}isFile(){return(this.mode&BigInt(61440))===BigInt(32768)}isSocket(){return!1}isSymbolicLink(){return(this.mode&BigInt(61440))===BigInt(40960)}}});function A_e(t){let e,r;if(e=t.match(c_e))t=e[1];else if(r=t.match(u_e))t=`\\\\${r[1]?".\\":""}${r[2]}`;else return t;return t.replace(/\//g,"\\")}function f_e(t){t=t.replace(/\\/g,"/");let e,r;return(e=t.match(a_e))?t=`/${e[1]}`:(r=t.match(l_e))&&(t=`/unc/${r[1]?".dot/":""}${r[2]}`),t}function ZD(t,e){return t===Ae?pW(e):wT(e)}var aw,Bt,mr,Ae,K,fW,a_e,l_e,c_e,u_e,wT,pW,Ba=It(()=>{aw=et(ve("path")),Bt={root:"/",dot:".",parent:".."},mr={home:"~",nodeModules:"node_modules",manifest:"package.json",lockfile:"yarn.lock",virtual:"__virtual__",pnpJs:".pnp.js",pnpCjs:".pnp.cjs",pnpData:".pnp.data.json",pnpEsmLoader:".pnp.loader.mjs",rc:".yarnrc.yml",env:".env"},Ae=Object.create(aw.default),K=Object.create(aw.default.posix);Ae.cwd=()=>process.cwd();K.cwd=process.platform==="win32"?()=>wT(process.cwd()):process.cwd;process.platform==="win32"&&(K.resolve=(...t)=>t.length>0&&K.isAbsolute(t[0])?aw.default.posix.resolve(...t):aw.default.posix.resolve(K.cwd(),...t));fW=function(t,e,r){return e=t.normalize(e),r=t.normalize(r),e===r?".":(e.endsWith(t.sep)||(e=e+t.sep),r.startsWith(e)?r.slice(e.length):null)};Ae.contains=(t,e)=>fW(Ae,t,e);K.contains=(t,e)=>fW(K,t,e);a_e=/^([a-zA-Z]:.*)$/,l_e=/^\/\/(\.\/)?(.*)$/,c_e=/^\/([a-zA-Z]:.*)$/,u_e=/^\/unc\/(\.dot\/)?(.*)$/;wT=process.platform==="win32"?f_e:t=>t,pW=process.platform==="win32"?A_e:t=>t;Ae.fromPortablePath=pW;Ae.toPortablePath=wT});async function $D(t,e){let r="0123456789abcdef";await t.mkdirPromise(e.indexPath,{recursive:!0});let o=[];for(let a of r)for(let n of r)o.push(t.mkdirPromise(t.pathUtils.join(e.indexPath,`${a}${n}`),{recursive:!0}));return await Promise.all(o),e.indexPath}async function hW(t,e,r,o,a){let n=t.pathUtils.normalize(e),u=r.pathUtils.normalize(o),A=[],p=[],{atime:h,mtime:E}=a.stableTime?{atime:H0,mtime:H0}:await r.lstatPromise(u);await t.mkdirpPromise(t.pathUtils.dirname(e),{utimes:[h,E]}),await BT(A,p,t,n,r,u,{...a,didParentExist:!0});for(let w of A)await w();await Promise.all(p.map(w=>w()))}async function BT(t,e,r,o,a,n,u){let A=u.didParentExist?await gW(r,o):null,p=await a.lstatPromise(n),{atime:h,mtime:E}=u.stableTime?{atime:H0,mtime:H0}:p,w;switch(!0){case p.isDirectory():w=await h_e(t,e,r,o,A,a,n,p,u);break;case p.isFile():w=await m_e(t,e,r,o,A,a,n,p,u);break;case p.isSymbolicLink():w=await y_e(t,e,r,o,A,a,n,p,u);break;default:throw new Error(`Unsupported file type (${p.mode})`)}return(u.linkStrategy?.type!=="HardlinkFromIndex"||!p.isFile())&&((w||A?.mtime?.getTime()!==E.getTime()||A?.atime?.getTime()!==h.getTime())&&(e.push(()=>r.lutimesPromise(o,h,E)),w=!0),(A===null||(A.mode&511)!==(p.mode&511))&&(e.push(()=>r.chmodPromise(o,p.mode&511)),w=!0)),w}async function gW(t,e){try{return await t.lstatPromise(e)}catch{return null}}async function h_e(t,e,r,o,a,n,u,A,p){if(a!==null&&!a.isDirectory())if(p.overwrite)t.push(async()=>r.removePromise(o)),a=null;else return!1;let h=!1;a===null&&(t.push(async()=>{try{await r.mkdirPromise(o,{mode:A.mode})}catch(D){if(D.code!=="EEXIST")throw D}}),h=!0);let E=await n.readdirPromise(u),w=p.didParentExist&&!a?{...p,didParentExist:!1}:p;if(p.stableSort)for(let D of E.sort())await BT(t,e,r,r.pathUtils.join(o,D),n,n.pathUtils.join(u,D),w)&&(h=!0);else(await Promise.all(E.map(async b=>{await BT(t,e,r,r.pathUtils.join(o,b),n,n.pathUtils.join(u,b),w)}))).some(b=>b)&&(h=!0);return h}async function g_e(t,e,r,o,a,n,u,A,p,h){let E=await n.checksumFilePromise(u,{algorithm:"sha1"}),w=420,D=A.mode&511,b=`${E}${D!==w?D.toString(8):""}`,C=r.pathUtils.join(h.indexPath,E.slice(0,2),`${b}.dat`),T;(ue=>(ue[ue.Lock=0]="Lock",ue[ue.Rename=1]="Rename"))(T||={});let N=1,U=await gW(r,C);if(a){let le=U&&a.dev===U.dev&&a.ino===U.ino,ce=U?.mtimeMs!==p_e;if(le&&ce&&h.autoRepair&&(N=0,U=null),!le)if(p.overwrite)t.push(async()=>r.removePromise(o)),a=null;else return!1}let z=!U&&N===1?`${C}.${Math.floor(Math.random()*4294967296).toString(16).padStart(8,"0")}`:null,te=!1;return t.push(async()=>{if(!U&&(N===0&&await r.lockPromise(C,async()=>{let le=await n.readFilePromise(u);await r.writeFilePromise(C,le)}),N===1&&z)){let le=await n.readFilePromise(u);await r.writeFilePromise(z,le);try{await r.linkPromise(z,C)}catch(ce){if(ce.code==="EEXIST")te=!0,await r.unlinkPromise(z);else throw ce}}a||await r.linkPromise(C,o)}),e.push(async()=>{U||(await r.lutimesPromise(C,H0,H0),D!==w&&await r.chmodPromise(C,D)),z&&!te&&await r.unlinkPromise(z)}),!1}async function d_e(t,e,r,o,a,n,u,A,p){if(a!==null)if(p.overwrite)t.push(async()=>r.removePromise(o)),a=null;else return!1;return t.push(async()=>{let h=await n.readFilePromise(u);await r.writeFilePromise(o,h)}),!0}async function m_e(t,e,r,o,a,n,u,A,p){return p.linkStrategy?.type==="HardlinkFromIndex"?g_e(t,e,r,o,a,n,u,A,p,p.linkStrategy):d_e(t,e,r,o,a,n,u,A,p)}async function y_e(t,e,r,o,a,n,u,A,p){if(a!==null)if(p.overwrite)t.push(async()=>r.removePromise(o)),a=null;else return!1;return t.push(async()=>{await r.symlinkPromise(ZD(r.pathUtils,await n.readlinkPromise(u)),o)}),!0}var H0,p_e,vT=It(()=>{Ba();H0=new Date(456789e3*1e3),p_e=H0.getTime()});function eP(t,e,r,o){let a=()=>{let n=r.shift();if(typeof n>"u")return null;let u=t.pathUtils.join(e,n);return Object.assign(t.statSync(u),{name:n,path:void 0})};return new lw(e,a,o)}var lw,dW=It(()=>{JD();lw=class{constructor(e,r,o={}){this.path=e;this.nextDirent=r;this.opts=o;this.closed=!1}throwIfClosed(){if(this.closed)throw dT()}async*[Symbol.asyncIterator](){try{let e;for(;(e=await this.read())!==null;)yield e}finally{await this.close()}}read(e){let r=this.readSync();return typeof e<"u"?e(null,r):Promise.resolve(r)}readSync(){return this.throwIfClosed(),this.nextDirent()}close(e){return this.closeSync(),typeof e<"u"?e(null):Promise.resolve()}closeSync(){this.throwIfClosed(),this.opts.onClose?.(),this.closed=!0}}});function mW(t,e){if(t!==e)throw new Error(`Invalid StatWatcher status: expected '${e}', got '${t}'`)}var yW,tP,EW=It(()=>{yW=ve("events");IT();tP=class t extends yW.EventEmitter{constructor(r,o,{bigint:a=!1}={}){super();this.status="ready";this.changeListeners=new Map;this.startTimeout=null;this.fakeFs=r,this.path=o,this.bigint=a,this.lastStats=this.stat()}static create(r,o,a){let n=new t(r,o,a);return n.start(),n}start(){mW(this.status,"ready"),this.status="running",this.startTimeout=setTimeout(()=>{this.startTimeout=null,this.fakeFs.existsSync(this.path)||this.emit("change",this.lastStats,this.lastStats)},3)}stop(){mW(this.status,"running"),this.status="stopped",this.startTimeout!==null&&(clearTimeout(this.startTimeout),this.startTimeout=null),this.emit("stop")}stat(){try{return this.fakeFs.statSync(this.path,{bigint:this.bigint})}catch{let o=this.bigint?new cm:new lm;return XD(o)}}makeInterval(r){let o=setInterval(()=>{let a=this.stat(),n=this.lastStats;CT(a,n)||(this.lastStats=a,this.emit("change",a,n))},r.interval);return r.persistent?o:o.unref()}registerChangeListener(r,o){this.addListener("change",r),this.changeListeners.set(r,this.makeInterval(o))}unregisterChangeListener(r){this.removeListener("change",r);let o=this.changeListeners.get(r);typeof o<"u"&&clearInterval(o),this.changeListeners.delete(r)}unregisterAllChangeListeners(){for(let r of this.changeListeners.keys())this.unregisterChangeListener(r)}hasChangeListeners(){return this.changeListeners.size>0}ref(){for(let r of this.changeListeners.values())r.ref();return this}unref(){for(let r of this.changeListeners.values())r.unref();return this}}});function um(t,e,r,o){let a,n,u,A;switch(typeof r){case"function":a=!1,n=!0,u=5007,A=r;break;default:({bigint:a=!1,persistent:n=!0,interval:u=5007}=r),A=o;break}let p=rP.get(t);typeof p>"u"&&rP.set(t,p=new Map);let h=p.get(e);return typeof h>"u"&&(h=tP.create(t,e,{bigint:a}),p.set(e,h)),h.registerChangeListener(A,{persistent:n,interval:u}),h}function q0(t,e,r){let o=rP.get(t);if(typeof o>"u")return;let a=o.get(e);typeof a>"u"||(typeof r>"u"?a.unregisterAllChangeListeners():a.unregisterChangeListener(r),a.hasChangeListeners()||(a.stop(),o.delete(e)))}function j0(t){let e=rP.get(t);if(!(typeof e>"u"))for(let r of e.keys())q0(t,r)}var rP,DT=It(()=>{EW();rP=new WeakMap});function E_e(t){let e=t.match(/\r?\n/g);if(e===null)return IW.EOL;let r=e.filter(a=>a===`\r `).length,o=e.length-r;return r>o?`\r `:` `}function G0(t,e){return e.replace(/\r?\n/g,E_e(t))}var CW,IW,hf,qu,W0=It(()=>{CW=ve("crypto"),IW=ve("os");vT();Ba();hf=class{constructor(e){this.pathUtils=e}async*genTraversePromise(e,{stableSort:r=!1}={}){let o=[e];for(;o.length>0;){let a=o.shift();if((await this.lstatPromise(a)).isDirectory()){let u=await this.readdirPromise(a);if(r)for(let A of u.sort())o.push(this.pathUtils.join(a,A));else throw new Error("Not supported")}else yield a}}async checksumFilePromise(e,{algorithm:r="sha512"}={}){let o=await this.openPromise(e,"r");try{let n=Buffer.allocUnsafeSlow(65536),u=(0,CW.createHash)(r),A=0;for(;(A=await this.readPromise(o,n,0,65536))!==0;)u.update(A===65536?n:n.slice(0,A));return u.digest("hex")}finally{await this.closePromise(o)}}async removePromise(e,{recursive:r=!0,maxRetries:o=5}={}){let a;try{a=await this.lstatPromise(e)}catch(n){if(n.code==="ENOENT")return;throw n}if(a.isDirectory()){if(r){let n=await this.readdirPromise(e);await Promise.all(n.map(u=>this.removePromise(this.pathUtils.resolve(e,u))))}for(let n=0;n<=o;n++)try{await this.rmdirPromise(e);break}catch(u){if(u.code!=="EBUSY"&&u.code!=="ENOTEMPTY")throw u;nsetTimeout(A,n*100))}}else await this.unlinkPromise(e)}removeSync(e,{recursive:r=!0}={}){let o;try{o=this.lstatSync(e)}catch(a){if(a.code==="ENOENT")return;throw a}if(o.isDirectory()){if(r)for(let a of this.readdirSync(e))this.removeSync(this.pathUtils.resolve(e,a));this.rmdirSync(e)}else this.unlinkSync(e)}async mkdirpPromise(e,{chmod:r,utimes:o}={}){if(e=this.resolve(e),e===this.pathUtils.dirname(e))return;let a=e.split(this.pathUtils.sep),n;for(let u=2;u<=a.length;++u){let A=a.slice(0,u).join(this.pathUtils.sep);if(!this.existsSync(A)){try{await this.mkdirPromise(A)}catch(p){if(p.code==="EEXIST")continue;throw p}if(n??=A,r!=null&&await this.chmodPromise(A,r),o!=null)await this.utimesPromise(A,o[0],o[1]);else{let p=await this.statPromise(this.pathUtils.dirname(A));await this.utimesPromise(A,p.atime,p.mtime)}}}return n}mkdirpSync(e,{chmod:r,utimes:o}={}){if(e=this.resolve(e),e===this.pathUtils.dirname(e))return;let a=e.split(this.pathUtils.sep),n;for(let u=2;u<=a.length;++u){let A=a.slice(0,u).join(this.pathUtils.sep);if(!this.existsSync(A)){try{this.mkdirSync(A)}catch(p){if(p.code==="EEXIST")continue;throw p}if(n??=A,r!=null&&this.chmodSync(A,r),o!=null)this.utimesSync(A,o[0],o[1]);else{let p=this.statSync(this.pathUtils.dirname(A));this.utimesSync(A,p.atime,p.mtime)}}}return n}async copyPromise(e,r,{baseFs:o=this,overwrite:a=!0,stableSort:n=!1,stableTime:u=!1,linkStrategy:A=null}={}){return await hW(this,e,o,r,{overwrite:a,stableSort:n,stableTime:u,linkStrategy:A})}copySync(e,r,{baseFs:o=this,overwrite:a=!0}={}){let n=o.lstatSync(r),u=this.existsSync(e);if(n.isDirectory()){this.mkdirpSync(e);let p=o.readdirSync(r);for(let h of p)this.copySync(this.pathUtils.join(e,h),o.pathUtils.join(r,h),{baseFs:o,overwrite:a})}else if(n.isFile()){if(!u||a){u&&this.removeSync(e);let p=o.readFileSync(r);this.writeFileSync(e,p)}}else if(n.isSymbolicLink()){if(!u||a){u&&this.removeSync(e);let p=o.readlinkSync(r);this.symlinkSync(ZD(this.pathUtils,p),e)}}else throw new Error(`Unsupported file type (file: ${r}, mode: 0o${n.mode.toString(8).padStart(6,"0")})`);let A=n.mode&511;this.chmodSync(e,A)}async changeFilePromise(e,r,o={}){return Buffer.isBuffer(r)?this.changeFileBufferPromise(e,r,o):this.changeFileTextPromise(e,r,o)}async changeFileBufferPromise(e,r,{mode:o}={}){let a=Buffer.alloc(0);try{a=await this.readFilePromise(e)}catch{}Buffer.compare(a,r)!==0&&await this.writeFilePromise(e,r,{mode:o})}async changeFileTextPromise(e,r,{automaticNewlines:o,mode:a}={}){let n="";try{n=await this.readFilePromise(e,"utf8")}catch{}let u=o?G0(n,r):r;n!==u&&await this.writeFilePromise(e,u,{mode:a})}changeFileSync(e,r,o={}){return Buffer.isBuffer(r)?this.changeFileBufferSync(e,r,o):this.changeFileTextSync(e,r,o)}changeFileBufferSync(e,r,{mode:o}={}){let a=Buffer.alloc(0);try{a=this.readFileSync(e)}catch{}Buffer.compare(a,r)!==0&&this.writeFileSync(e,r,{mode:o})}changeFileTextSync(e,r,{automaticNewlines:o=!1,mode:a}={}){let n="";try{n=this.readFileSync(e,"utf8")}catch{}let u=o?G0(n,r):r;n!==u&&this.writeFileSync(e,u,{mode:a})}async movePromise(e,r){try{await this.renamePromise(e,r)}catch(o){if(o.code==="EXDEV")await this.copyPromise(r,e),await this.removePromise(e);else throw o}}moveSync(e,r){try{this.renameSync(e,r)}catch(o){if(o.code==="EXDEV")this.copySync(r,e),this.removeSync(e);else throw o}}async lockPromise(e,r){let o=`${e}.flock`,a=1e3/60,n=Date.now(),u=null,A=async()=>{let p;try{[p]=await this.readJsonPromise(o)}catch{return Date.now()-n<500}try{return process.kill(p,0),!0}catch{return!1}};for(;u===null;)try{u=await this.openPromise(o,"wx")}catch(p){if(p.code==="EEXIST"){if(!await A())try{await this.unlinkPromise(o);continue}catch{}if(Date.now()-n<60*1e3)await new Promise(h=>setTimeout(h,a));else throw new Error(`Couldn't acquire a lock in a reasonable time (via ${o})`)}else throw p}await this.writePromise(u,JSON.stringify([process.pid]));try{return await r()}finally{try{await this.closePromise(u),await this.unlinkPromise(o)}catch{}}}async readJsonPromise(e){let r=await this.readFilePromise(e,"utf8");try{return JSON.parse(r)}catch(o){throw o.message+=` (in ${e})`,o}}readJsonSync(e){let r=this.readFileSync(e,"utf8");try{return JSON.parse(r)}catch(o){throw o.message+=` (in ${e})`,o}}async writeJsonPromise(e,r,{compact:o=!1}={}){let a=o?0:2;return await this.writeFilePromise(e,`${JSON.stringify(r,null,a)} `)}writeJsonSync(e,r,{compact:o=!1}={}){let a=o?0:2;return this.writeFileSync(e,`${JSON.stringify(r,null,a)} `)}async preserveTimePromise(e,r){let o=await this.lstatPromise(e),a=await r();typeof a<"u"&&(e=a),await this.lutimesPromise(e,o.atime,o.mtime)}async preserveTimeSync(e,r){let o=this.lstatSync(e),a=r();typeof a<"u"&&(e=a),this.lutimesSync(e,o.atime,o.mtime)}},qu=class extends hf{constructor(){super(K)}}});var ws,gf=It(()=>{W0();ws=class extends hf{getExtractHint(e){return this.baseFs.getExtractHint(e)}resolve(e){return this.mapFromBase(this.baseFs.resolve(this.mapToBase(e)))}getRealPath(){return this.mapFromBase(this.baseFs.getRealPath())}async openPromise(e,r,o){return this.baseFs.openPromise(this.mapToBase(e),r,o)}openSync(e,r,o){return this.baseFs.openSync(this.mapToBase(e),r,o)}async opendirPromise(e,r){return Object.assign(await this.baseFs.opendirPromise(this.mapToBase(e),r),{path:e})}opendirSync(e,r){return Object.assign(this.baseFs.opendirSync(this.mapToBase(e),r),{path:e})}async readPromise(e,r,o,a,n){return await this.baseFs.readPromise(e,r,o,a,n)}readSync(e,r,o,a,n){return this.baseFs.readSync(e,r,o,a,n)}async writePromise(e,r,o,a,n){return typeof r=="string"?await this.baseFs.writePromise(e,r,o):await this.baseFs.writePromise(e,r,o,a,n)}writeSync(e,r,o,a,n){return typeof r=="string"?this.baseFs.writeSync(e,r,o):this.baseFs.writeSync(e,r,o,a,n)}async closePromise(e){return this.baseFs.closePromise(e)}closeSync(e){this.baseFs.closeSync(e)}createReadStream(e,r){return this.baseFs.createReadStream(e!==null?this.mapToBase(e):e,r)}createWriteStream(e,r){return this.baseFs.createWriteStream(e!==null?this.mapToBase(e):e,r)}async realpathPromise(e){return this.mapFromBase(await this.baseFs.realpathPromise(this.mapToBase(e)))}realpathSync(e){return this.mapFromBase(this.baseFs.realpathSync(this.mapToBase(e)))}async existsPromise(e){return this.baseFs.existsPromise(this.mapToBase(e))}existsSync(e){return this.baseFs.existsSync(this.mapToBase(e))}accessSync(e,r){return this.baseFs.accessSync(this.mapToBase(e),r)}async accessPromise(e,r){return this.baseFs.accessPromise(this.mapToBase(e),r)}async statPromise(e,r){return this.baseFs.statPromise(this.mapToBase(e),r)}statSync(e,r){return this.baseFs.statSync(this.mapToBase(e),r)}async fstatPromise(e,r){return this.baseFs.fstatPromise(e,r)}fstatSync(e,r){return this.baseFs.fstatSync(e,r)}lstatPromise(e,r){return this.baseFs.lstatPromise(this.mapToBase(e),r)}lstatSync(e,r){return this.baseFs.lstatSync(this.mapToBase(e),r)}async fchmodPromise(e,r){return this.baseFs.fchmodPromise(e,r)}fchmodSync(e,r){return this.baseFs.fchmodSync(e,r)}async chmodPromise(e,r){return this.baseFs.chmodPromise(this.mapToBase(e),r)}chmodSync(e,r){return this.baseFs.chmodSync(this.mapToBase(e),r)}async fchownPromise(e,r,o){return this.baseFs.fchownPromise(e,r,o)}fchownSync(e,r,o){return this.baseFs.fchownSync(e,r,o)}async chownPromise(e,r,o){return this.baseFs.chownPromise(this.mapToBase(e),r,o)}chownSync(e,r,o){return this.baseFs.chownSync(this.mapToBase(e),r,o)}async renamePromise(e,r){return this.baseFs.renamePromise(this.mapToBase(e),this.mapToBase(r))}renameSync(e,r){return this.baseFs.renameSync(this.mapToBase(e),this.mapToBase(r))}async copyFilePromise(e,r,o=0){return this.baseFs.copyFilePromise(this.mapToBase(e),this.mapToBase(r),o)}copyFileSync(e,r,o=0){return this.baseFs.copyFileSync(this.mapToBase(e),this.mapToBase(r),o)}async appendFilePromise(e,r,o){return this.baseFs.appendFilePromise(this.fsMapToBase(e),r,o)}appendFileSync(e,r,o){return this.baseFs.appendFileSync(this.fsMapToBase(e),r,o)}async writeFilePromise(e,r,o){return this.baseFs.writeFilePromise(this.fsMapToBase(e),r,o)}writeFileSync(e,r,o){return this.baseFs.writeFileSync(this.fsMapToBase(e),r,o)}async unlinkPromise(e){return this.baseFs.unlinkPromise(this.mapToBase(e))}unlinkSync(e){return this.baseFs.unlinkSync(this.mapToBase(e))}async utimesPromise(e,r,o){return this.baseFs.utimesPromise(this.mapToBase(e),r,o)}utimesSync(e,r,o){return this.baseFs.utimesSync(this.mapToBase(e),r,o)}async lutimesPromise(e,r,o){return this.baseFs.lutimesPromise(this.mapToBase(e),r,o)}lutimesSync(e,r,o){return this.baseFs.lutimesSync(this.mapToBase(e),r,o)}async mkdirPromise(e,r){return this.baseFs.mkdirPromise(this.mapToBase(e),r)}mkdirSync(e,r){return this.baseFs.mkdirSync(this.mapToBase(e),r)}async rmdirPromise(e,r){return this.baseFs.rmdirPromise(this.mapToBase(e),r)}rmdirSync(e,r){return this.baseFs.rmdirSync(this.mapToBase(e),r)}async rmPromise(e,r){return this.baseFs.rmPromise(this.mapToBase(e),r)}rmSync(e,r){return this.baseFs.rmSync(this.mapToBase(e),r)}async linkPromise(e,r){return this.baseFs.linkPromise(this.mapToBase(e),this.mapToBase(r))}linkSync(e,r){return this.baseFs.linkSync(this.mapToBase(e),this.mapToBase(r))}async symlinkPromise(e,r,o){let a=this.mapToBase(r);if(this.pathUtils.isAbsolute(e))return this.baseFs.symlinkPromise(this.mapToBase(e),a,o);let n=this.mapToBase(this.pathUtils.join(this.pathUtils.dirname(r),e)),u=this.baseFs.pathUtils.relative(this.baseFs.pathUtils.dirname(a),n);return this.baseFs.symlinkPromise(u,a,o)}symlinkSync(e,r,o){let a=this.mapToBase(r);if(this.pathUtils.isAbsolute(e))return this.baseFs.symlinkSync(this.mapToBase(e),a,o);let n=this.mapToBase(this.pathUtils.join(this.pathUtils.dirname(r),e)),u=this.baseFs.pathUtils.relative(this.baseFs.pathUtils.dirname(a),n);return this.baseFs.symlinkSync(u,a,o)}async readFilePromise(e,r){return this.baseFs.readFilePromise(this.fsMapToBase(e),r)}readFileSync(e,r){return this.baseFs.readFileSync(this.fsMapToBase(e),r)}readdirPromise(e,r){return this.baseFs.readdirPromise(this.mapToBase(e),r)}readdirSync(e,r){return this.baseFs.readdirSync(this.mapToBase(e),r)}async readlinkPromise(e){return this.mapFromBase(await this.baseFs.readlinkPromise(this.mapToBase(e)))}readlinkSync(e){return this.mapFromBase(this.baseFs.readlinkSync(this.mapToBase(e)))}async truncatePromise(e,r){return this.baseFs.truncatePromise(this.mapToBase(e),r)}truncateSync(e,r){return this.baseFs.truncateSync(this.mapToBase(e),r)}async ftruncatePromise(e,r){return this.baseFs.ftruncatePromise(e,r)}ftruncateSync(e,r){return this.baseFs.ftruncateSync(e,r)}watch(e,r,o){return this.baseFs.watch(this.mapToBase(e),r,o)}watchFile(e,r,o){return this.baseFs.watchFile(this.mapToBase(e),r,o)}unwatchFile(e,r){return this.baseFs.unwatchFile(this.mapToBase(e),r)}fsMapToBase(e){return typeof e=="number"?e:this.mapToBase(e)}}});var ju,wW=It(()=>{gf();ju=class extends ws{constructor(e,{baseFs:r,pathUtils:o}){super(o),this.target=e,this.baseFs=r}getRealPath(){return this.target}getBaseFs(){return this.baseFs}mapFromBase(e){return e}mapToBase(e){return e}}});function BW(t){let e=t;return typeof t.path=="string"&&(e.path=Ae.toPortablePath(t.path)),e}var vW,_n,Y0=It(()=>{vW=et(ve("fs"));W0();Ba();_n=class extends qu{constructor(e=vW.default){super(),this.realFs=e}getExtractHint(){return!1}getRealPath(){return Bt.root}resolve(e){return K.resolve(e)}async openPromise(e,r,o){return await new Promise((a,n)=>{this.realFs.open(Ae.fromPortablePath(e),r,o,this.makeCallback(a,n))})}openSync(e,r,o){return this.realFs.openSync(Ae.fromPortablePath(e),r,o)}async opendirPromise(e,r){return await new Promise((o,a)=>{typeof r<"u"?this.realFs.opendir(Ae.fromPortablePath(e),r,this.makeCallback(o,a)):this.realFs.opendir(Ae.fromPortablePath(e),this.makeCallback(o,a))}).then(o=>{let a=o;return Object.defineProperty(a,"path",{value:e,configurable:!0,writable:!0}),a})}opendirSync(e,r){let a=typeof r<"u"?this.realFs.opendirSync(Ae.fromPortablePath(e),r):this.realFs.opendirSync(Ae.fromPortablePath(e));return Object.defineProperty(a,"path",{value:e,configurable:!0,writable:!0}),a}async readPromise(e,r,o=0,a=0,n=-1){return await new Promise((u,A)=>{this.realFs.read(e,r,o,a,n,(p,h)=>{p?A(p):u(h)})})}readSync(e,r,o,a,n){return this.realFs.readSync(e,r,o,a,n)}async writePromise(e,r,o,a,n){return await new Promise((u,A)=>typeof r=="string"?this.realFs.write(e,r,o,this.makeCallback(u,A)):this.realFs.write(e,r,o,a,n,this.makeCallback(u,A)))}writeSync(e,r,o,a,n){return typeof r=="string"?this.realFs.writeSync(e,r,o):this.realFs.writeSync(e,r,o,a,n)}async closePromise(e){await new Promise((r,o)=>{this.realFs.close(e,this.makeCallback(r,o))})}closeSync(e){this.realFs.closeSync(e)}createReadStream(e,r){let o=e!==null?Ae.fromPortablePath(e):e;return this.realFs.createReadStream(o,r)}createWriteStream(e,r){let o=e!==null?Ae.fromPortablePath(e):e;return this.realFs.createWriteStream(o,r)}async realpathPromise(e){return await new Promise((r,o)=>{this.realFs.realpath(Ae.fromPortablePath(e),{},this.makeCallback(r,o))}).then(r=>Ae.toPortablePath(r))}realpathSync(e){return Ae.toPortablePath(this.realFs.realpathSync(Ae.fromPortablePath(e),{}))}async existsPromise(e){return await new Promise(r=>{this.realFs.exists(Ae.fromPortablePath(e),r)})}accessSync(e,r){return this.realFs.accessSync(Ae.fromPortablePath(e),r)}async accessPromise(e,r){return await new Promise((o,a)=>{this.realFs.access(Ae.fromPortablePath(e),r,this.makeCallback(o,a))})}existsSync(e){return this.realFs.existsSync(Ae.fromPortablePath(e))}async statPromise(e,r){return await new Promise((o,a)=>{r?this.realFs.stat(Ae.fromPortablePath(e),r,this.makeCallback(o,a)):this.realFs.stat(Ae.fromPortablePath(e),this.makeCallback(o,a))})}statSync(e,r){return r?this.realFs.statSync(Ae.fromPortablePath(e),r):this.realFs.statSync(Ae.fromPortablePath(e))}async fstatPromise(e,r){return await new Promise((o,a)=>{r?this.realFs.fstat(e,r,this.makeCallback(o,a)):this.realFs.fstat(e,this.makeCallback(o,a))})}fstatSync(e,r){return r?this.realFs.fstatSync(e,r):this.realFs.fstatSync(e)}async lstatPromise(e,r){return await new Promise((o,a)=>{r?this.realFs.lstat(Ae.fromPortablePath(e),r,this.makeCallback(o,a)):this.realFs.lstat(Ae.fromPortablePath(e),this.makeCallback(o,a))})}lstatSync(e,r){return r?this.realFs.lstatSync(Ae.fromPortablePath(e),r):this.realFs.lstatSync(Ae.fromPortablePath(e))}async fchmodPromise(e,r){return await new Promise((o,a)=>{this.realFs.fchmod(e,r,this.makeCallback(o,a))})}fchmodSync(e,r){return this.realFs.fchmodSync(e,r)}async chmodPromise(e,r){return await new Promise((o,a)=>{this.realFs.chmod(Ae.fromPortablePath(e),r,this.makeCallback(o,a))})}chmodSync(e,r){return this.realFs.chmodSync(Ae.fromPortablePath(e),r)}async fchownPromise(e,r,o){return await new Promise((a,n)=>{this.realFs.fchown(e,r,o,this.makeCallback(a,n))})}fchownSync(e,r,o){return this.realFs.fchownSync(e,r,o)}async chownPromise(e,r,o){return await new Promise((a,n)=>{this.realFs.chown(Ae.fromPortablePath(e),r,o,this.makeCallback(a,n))})}chownSync(e,r,o){return this.realFs.chownSync(Ae.fromPortablePath(e),r,o)}async renamePromise(e,r){return await new Promise((o,a)=>{this.realFs.rename(Ae.fromPortablePath(e),Ae.fromPortablePath(r),this.makeCallback(o,a))})}renameSync(e,r){return this.realFs.renameSync(Ae.fromPortablePath(e),Ae.fromPortablePath(r))}async copyFilePromise(e,r,o=0){return await new Promise((a,n)=>{this.realFs.copyFile(Ae.fromPortablePath(e),Ae.fromPortablePath(r),o,this.makeCallback(a,n))})}copyFileSync(e,r,o=0){return this.realFs.copyFileSync(Ae.fromPortablePath(e),Ae.fromPortablePath(r),o)}async appendFilePromise(e,r,o){return await new Promise((a,n)=>{let u=typeof e=="string"?Ae.fromPortablePath(e):e;o?this.realFs.appendFile(u,r,o,this.makeCallback(a,n)):this.realFs.appendFile(u,r,this.makeCallback(a,n))})}appendFileSync(e,r,o){let a=typeof e=="string"?Ae.fromPortablePath(e):e;o?this.realFs.appendFileSync(a,r,o):this.realFs.appendFileSync(a,r)}async writeFilePromise(e,r,o){return await new Promise((a,n)=>{let u=typeof e=="string"?Ae.fromPortablePath(e):e;o?this.realFs.writeFile(u,r,o,this.makeCallback(a,n)):this.realFs.writeFile(u,r,this.makeCallback(a,n))})}writeFileSync(e,r,o){let a=typeof e=="string"?Ae.fromPortablePath(e):e;o?this.realFs.writeFileSync(a,r,o):this.realFs.writeFileSync(a,r)}async unlinkPromise(e){return await new Promise((r,o)=>{this.realFs.unlink(Ae.fromPortablePath(e),this.makeCallback(r,o))})}unlinkSync(e){return this.realFs.unlinkSync(Ae.fromPortablePath(e))}async utimesPromise(e,r,o){return await new Promise((a,n)=>{this.realFs.utimes(Ae.fromPortablePath(e),r,o,this.makeCallback(a,n))})}utimesSync(e,r,o){this.realFs.utimesSync(Ae.fromPortablePath(e),r,o)}async lutimesPromise(e,r,o){return await new Promise((a,n)=>{this.realFs.lutimes(Ae.fromPortablePath(e),r,o,this.makeCallback(a,n))})}lutimesSync(e,r,o){this.realFs.lutimesSync(Ae.fromPortablePath(e),r,o)}async mkdirPromise(e,r){return await new Promise((o,a)=>{this.realFs.mkdir(Ae.fromPortablePath(e),r,this.makeCallback(o,a))})}mkdirSync(e,r){return this.realFs.mkdirSync(Ae.fromPortablePath(e),r)}async rmdirPromise(e,r){return await new Promise((o,a)=>{r?this.realFs.rmdir(Ae.fromPortablePath(e),r,this.makeCallback(o,a)):this.realFs.rmdir(Ae.fromPortablePath(e),this.makeCallback(o,a))})}rmdirSync(e,r){return this.realFs.rmdirSync(Ae.fromPortablePath(e),r)}async rmPromise(e,r){return await new Promise((o,a)=>{r?this.realFs.rm(Ae.fromPortablePath(e),r,this.makeCallback(o,a)):this.realFs.rm(Ae.fromPortablePath(e),this.makeCallback(o,a))})}rmSync(e,r){return this.realFs.rmSync(Ae.fromPortablePath(e),r)}async linkPromise(e,r){return await new Promise((o,a)=>{this.realFs.link(Ae.fromPortablePath(e),Ae.fromPortablePath(r),this.makeCallback(o,a))})}linkSync(e,r){return this.realFs.linkSync(Ae.fromPortablePath(e),Ae.fromPortablePath(r))}async symlinkPromise(e,r,o){return await new Promise((a,n)=>{this.realFs.symlink(Ae.fromPortablePath(e.replace(/\/+$/,"")),Ae.fromPortablePath(r),o,this.makeCallback(a,n))})}symlinkSync(e,r,o){return this.realFs.symlinkSync(Ae.fromPortablePath(e.replace(/\/+$/,"")),Ae.fromPortablePath(r),o)}async readFilePromise(e,r){return await new Promise((o,a)=>{let n=typeof e=="string"?Ae.fromPortablePath(e):e;this.realFs.readFile(n,r,this.makeCallback(o,a))})}readFileSync(e,r){let o=typeof e=="string"?Ae.fromPortablePath(e):e;return this.realFs.readFileSync(o,r)}async readdirPromise(e,r){return await new Promise((o,a)=>{r?r.recursive&&process.platform==="win32"?r.withFileTypes?this.realFs.readdir(Ae.fromPortablePath(e),r,this.makeCallback(n=>o(n.map(BW)),a)):this.realFs.readdir(Ae.fromPortablePath(e),r,this.makeCallback(n=>o(n.map(Ae.toPortablePath)),a)):this.realFs.readdir(Ae.fromPortablePath(e),r,this.makeCallback(o,a)):this.realFs.readdir(Ae.fromPortablePath(e),this.makeCallback(o,a))})}readdirSync(e,r){return r?r.recursive&&process.platform==="win32"?r.withFileTypes?this.realFs.readdirSync(Ae.fromPortablePath(e),r).map(BW):this.realFs.readdirSync(Ae.fromPortablePath(e),r).map(Ae.toPortablePath):this.realFs.readdirSync(Ae.fromPortablePath(e),r):this.realFs.readdirSync(Ae.fromPortablePath(e))}async readlinkPromise(e){return await new Promise((r,o)=>{this.realFs.readlink(Ae.fromPortablePath(e),this.makeCallback(r,o))}).then(r=>Ae.toPortablePath(r))}readlinkSync(e){return Ae.toPortablePath(this.realFs.readlinkSync(Ae.fromPortablePath(e)))}async truncatePromise(e,r){return await new Promise((o,a)=>{this.realFs.truncate(Ae.fromPortablePath(e),r,this.makeCallback(o,a))})}truncateSync(e,r){return this.realFs.truncateSync(Ae.fromPortablePath(e),r)}async ftruncatePromise(e,r){return await new Promise((o,a)=>{this.realFs.ftruncate(e,r,this.makeCallback(o,a))})}ftruncateSync(e,r){return this.realFs.ftruncateSync(e,r)}watch(e,r,o){return this.realFs.watch(Ae.fromPortablePath(e),r,o)}watchFile(e,r,o){return this.realFs.watchFile(Ae.fromPortablePath(e),r,o)}unwatchFile(e,r){return this.realFs.unwatchFile(Ae.fromPortablePath(e),r)}makeCallback(e,r){return(o,a)=>{o?r(o):e(a)}}}});var En,DW=It(()=>{Y0();gf();Ba();En=class extends ws{constructor(e,{baseFs:r=new _n}={}){super(K),this.target=this.pathUtils.normalize(e),this.baseFs=r}getRealPath(){return this.pathUtils.resolve(this.baseFs.getRealPath(),this.target)}resolve(e){return this.pathUtils.isAbsolute(e)?K.normalize(e):this.baseFs.resolve(K.join(this.target,e))}mapFromBase(e){return e}mapToBase(e){return this.pathUtils.isAbsolute(e)?e:this.pathUtils.join(this.target,e)}}});var PW,Gu,SW=It(()=>{Y0();gf();Ba();PW=Bt.root,Gu=class extends ws{constructor(e,{baseFs:r=new _n}={}){super(K),this.target=this.pathUtils.resolve(Bt.root,e),this.baseFs=r}getRealPath(){return this.pathUtils.resolve(this.baseFs.getRealPath(),this.pathUtils.relative(Bt.root,this.target))}getTarget(){return this.target}getBaseFs(){return this.baseFs}mapToBase(e){let r=this.pathUtils.normalize(e);if(this.pathUtils.isAbsolute(e))return this.pathUtils.resolve(this.target,this.pathUtils.relative(PW,e));if(r.match(/^\.\.\/?/))throw new Error(`Resolving this path (${e}) would escape the jail`);return this.pathUtils.resolve(this.target,e)}mapFromBase(e){return this.pathUtils.resolve(PW,this.pathUtils.relative(this.target,e))}}});var Am,xW=It(()=>{gf();Am=class extends ws{constructor(r,o){super(o);this.instance=null;this.factory=r}get baseFs(){return this.instance||(this.instance=this.factory()),this.instance}set baseFs(r){this.instance=r}mapFromBase(r){return r}mapToBase(r){return r}}});var K0,va,Gp,bW=It(()=>{K0=ve("fs");W0();Y0();DT();JD();Ba();va=4278190080,Gp=class extends qu{constructor({baseFs:r=new _n,filter:o=null,magicByte:a=42,maxOpenFiles:n=1/0,useCache:u=!0,maxAge:A=5e3,typeCheck:p=K0.constants.S_IFREG,getMountPoint:h,factoryPromise:E,factorySync:w}){if(Math.floor(a)!==a||!(a>1&&a<=127))throw new Error("The magic byte must be set to a round value between 1 and 127 included");super();this.fdMap=new Map;this.nextFd=3;this.isMount=new Set;this.notMount=new Set;this.realPaths=new Map;this.limitOpenFilesTimeout=null;this.baseFs=r,this.mountInstances=u?new Map:null,this.factoryPromise=E,this.factorySync=w,this.filter=o,this.getMountPoint=h,this.magic=a<<24,this.maxAge=A,this.maxOpenFiles=n,this.typeCheck=p}getExtractHint(r){return this.baseFs.getExtractHint(r)}getRealPath(){return this.baseFs.getRealPath()}saveAndClose(){if(j0(this),this.mountInstances)for(let[r,{childFs:o}]of this.mountInstances.entries())o.saveAndClose?.(),this.mountInstances.delete(r)}discardAndClose(){if(j0(this),this.mountInstances)for(let[r,{childFs:o}]of this.mountInstances.entries())o.discardAndClose?.(),this.mountInstances.delete(r)}resolve(r){return this.baseFs.resolve(r)}remapFd(r,o){let a=this.nextFd++|this.magic;return this.fdMap.set(a,[r,o]),a}async openPromise(r,o,a){return await this.makeCallPromise(r,async()=>await this.baseFs.openPromise(r,o,a),async(n,{subPath:u})=>this.remapFd(n,await n.openPromise(u,o,a)))}openSync(r,o,a){return this.makeCallSync(r,()=>this.baseFs.openSync(r,o,a),(n,{subPath:u})=>this.remapFd(n,n.openSync(u,o,a)))}async opendirPromise(r,o){return await this.makeCallPromise(r,async()=>await this.baseFs.opendirPromise(r,o),async(a,{subPath:n})=>await a.opendirPromise(n,o),{requireSubpath:!1})}opendirSync(r,o){return this.makeCallSync(r,()=>this.baseFs.opendirSync(r,o),(a,{subPath:n})=>a.opendirSync(n,o),{requireSubpath:!1})}async readPromise(r,o,a,n,u){if((r&va)!==this.magic)return await this.baseFs.readPromise(r,o,a,n,u);let A=this.fdMap.get(r);if(typeof A>"u")throw ho("read");let[p,h]=A;return await p.readPromise(h,o,a,n,u)}readSync(r,o,a,n,u){if((r&va)!==this.magic)return this.baseFs.readSync(r,o,a,n,u);let A=this.fdMap.get(r);if(typeof A>"u")throw ho("readSync");let[p,h]=A;return p.readSync(h,o,a,n,u)}async writePromise(r,o,a,n,u){if((r&va)!==this.magic)return typeof o=="string"?await this.baseFs.writePromise(r,o,a):await this.baseFs.writePromise(r,o,a,n,u);let A=this.fdMap.get(r);if(typeof A>"u")throw ho("write");let[p,h]=A;return typeof o=="string"?await p.writePromise(h,o,a):await p.writePromise(h,o,a,n,u)}writeSync(r,o,a,n,u){if((r&va)!==this.magic)return typeof o=="string"?this.baseFs.writeSync(r,o,a):this.baseFs.writeSync(r,o,a,n,u);let A=this.fdMap.get(r);if(typeof A>"u")throw ho("writeSync");let[p,h]=A;return typeof o=="string"?p.writeSync(h,o,a):p.writeSync(h,o,a,n,u)}async closePromise(r){if((r&va)!==this.magic)return await this.baseFs.closePromise(r);let o=this.fdMap.get(r);if(typeof o>"u")throw ho("close");this.fdMap.delete(r);let[a,n]=o;return await a.closePromise(n)}closeSync(r){if((r&va)!==this.magic)return this.baseFs.closeSync(r);let o=this.fdMap.get(r);if(typeof o>"u")throw ho("closeSync");this.fdMap.delete(r);let[a,n]=o;return a.closeSync(n)}createReadStream(r,o){return r===null?this.baseFs.createReadStream(r,o):this.makeCallSync(r,()=>this.baseFs.createReadStream(r,o),(a,{archivePath:n,subPath:u})=>{let A=a.createReadStream(u,o);return A.path=Ae.fromPortablePath(this.pathUtils.join(n,u)),A})}createWriteStream(r,o){return r===null?this.baseFs.createWriteStream(r,o):this.makeCallSync(r,()=>this.baseFs.createWriteStream(r,o),(a,{subPath:n})=>a.createWriteStream(n,o))}async realpathPromise(r){return await this.makeCallPromise(r,async()=>await this.baseFs.realpathPromise(r),async(o,{archivePath:a,subPath:n})=>{let u=this.realPaths.get(a);return typeof u>"u"&&(u=await this.baseFs.realpathPromise(a),this.realPaths.set(a,u)),this.pathUtils.join(u,this.pathUtils.relative(Bt.root,await o.realpathPromise(n)))})}realpathSync(r){return this.makeCallSync(r,()=>this.baseFs.realpathSync(r),(o,{archivePath:a,subPath:n})=>{let u=this.realPaths.get(a);return typeof u>"u"&&(u=this.baseFs.realpathSync(a),this.realPaths.set(a,u)),this.pathUtils.join(u,this.pathUtils.relative(Bt.root,o.realpathSync(n)))})}async existsPromise(r){return await this.makeCallPromise(r,async()=>await this.baseFs.existsPromise(r),async(o,{subPath:a})=>await o.existsPromise(a))}existsSync(r){return this.makeCallSync(r,()=>this.baseFs.existsSync(r),(o,{subPath:a})=>o.existsSync(a))}async accessPromise(r,o){return await this.makeCallPromise(r,async()=>await this.baseFs.accessPromise(r,o),async(a,{subPath:n})=>await a.accessPromise(n,o))}accessSync(r,o){return this.makeCallSync(r,()=>this.baseFs.accessSync(r,o),(a,{subPath:n})=>a.accessSync(n,o))}async statPromise(r,o){return await this.makeCallPromise(r,async()=>await this.baseFs.statPromise(r,o),async(a,{subPath:n})=>await a.statPromise(n,o))}statSync(r,o){return this.makeCallSync(r,()=>this.baseFs.statSync(r,o),(a,{subPath:n})=>a.statSync(n,o))}async fstatPromise(r,o){if((r&va)!==this.magic)return this.baseFs.fstatPromise(r,o);let a=this.fdMap.get(r);if(typeof a>"u")throw ho("fstat");let[n,u]=a;return n.fstatPromise(u,o)}fstatSync(r,o){if((r&va)!==this.magic)return this.baseFs.fstatSync(r,o);let a=this.fdMap.get(r);if(typeof a>"u")throw ho("fstatSync");let[n,u]=a;return n.fstatSync(u,o)}async lstatPromise(r,o){return await this.makeCallPromise(r,async()=>await this.baseFs.lstatPromise(r,o),async(a,{subPath:n})=>await a.lstatPromise(n,o))}lstatSync(r,o){return this.makeCallSync(r,()=>this.baseFs.lstatSync(r,o),(a,{subPath:n})=>a.lstatSync(n,o))}async fchmodPromise(r,o){if((r&va)!==this.magic)return this.baseFs.fchmodPromise(r,o);let a=this.fdMap.get(r);if(typeof a>"u")throw ho("fchmod");let[n,u]=a;return n.fchmodPromise(u,o)}fchmodSync(r,o){if((r&va)!==this.magic)return this.baseFs.fchmodSync(r,o);let a=this.fdMap.get(r);if(typeof a>"u")throw ho("fchmodSync");let[n,u]=a;return n.fchmodSync(u,o)}async chmodPromise(r,o){return await this.makeCallPromise(r,async()=>await this.baseFs.chmodPromise(r,o),async(a,{subPath:n})=>await a.chmodPromise(n,o))}chmodSync(r,o){return this.makeCallSync(r,()=>this.baseFs.chmodSync(r,o),(a,{subPath:n})=>a.chmodSync(n,o))}async fchownPromise(r,o,a){if((r&va)!==this.magic)return this.baseFs.fchownPromise(r,o,a);let n=this.fdMap.get(r);if(typeof n>"u")throw ho("fchown");let[u,A]=n;return u.fchownPromise(A,o,a)}fchownSync(r,o,a){if((r&va)!==this.magic)return this.baseFs.fchownSync(r,o,a);let n=this.fdMap.get(r);if(typeof n>"u")throw ho("fchownSync");let[u,A]=n;return u.fchownSync(A,o,a)}async chownPromise(r,o,a){return await this.makeCallPromise(r,async()=>await this.baseFs.chownPromise(r,o,a),async(n,{subPath:u})=>await n.chownPromise(u,o,a))}chownSync(r,o,a){return this.makeCallSync(r,()=>this.baseFs.chownSync(r,o,a),(n,{subPath:u})=>n.chownSync(u,o,a))}async renamePromise(r,o){return await this.makeCallPromise(r,async()=>await this.makeCallPromise(o,async()=>await this.baseFs.renamePromise(r,o),async()=>{throw Object.assign(new Error("EEXDEV: cross-device link not permitted"),{code:"EEXDEV"})}),async(a,{subPath:n})=>await this.makeCallPromise(o,async()=>{throw Object.assign(new Error("EEXDEV: cross-device link not permitted"),{code:"EEXDEV"})},async(u,{subPath:A})=>{if(a!==u)throw Object.assign(new Error("EEXDEV: cross-device link not permitted"),{code:"EEXDEV"});return await a.renamePromise(n,A)}))}renameSync(r,o){return this.makeCallSync(r,()=>this.makeCallSync(o,()=>this.baseFs.renameSync(r,o),()=>{throw Object.assign(new Error("EEXDEV: cross-device link not permitted"),{code:"EEXDEV"})}),(a,{subPath:n})=>this.makeCallSync(o,()=>{throw Object.assign(new Error("EEXDEV: cross-device link not permitted"),{code:"EEXDEV"})},(u,{subPath:A})=>{if(a!==u)throw Object.assign(new Error("EEXDEV: cross-device link not permitted"),{code:"EEXDEV"});return a.renameSync(n,A)}))}async copyFilePromise(r,o,a=0){let n=async(u,A,p,h)=>{if(a&K0.constants.COPYFILE_FICLONE_FORCE)throw Object.assign(new Error(`EXDEV: cross-device clone not permitted, copyfile '${A}' -> ${h}'`),{code:"EXDEV"});if(a&K0.constants.COPYFILE_EXCL&&await this.existsPromise(A))throw Object.assign(new Error(`EEXIST: file already exists, copyfile '${A}' -> '${h}'`),{code:"EEXIST"});let E;try{E=await u.readFilePromise(A)}catch{throw Object.assign(new Error(`EINVAL: invalid argument, copyfile '${A}' -> '${h}'`),{code:"EINVAL"})}await p.writeFilePromise(h,E)};return await this.makeCallPromise(r,async()=>await this.makeCallPromise(o,async()=>await this.baseFs.copyFilePromise(r,o,a),async(u,{subPath:A})=>await n(this.baseFs,r,u,A)),async(u,{subPath:A})=>await this.makeCallPromise(o,async()=>await n(u,A,this.baseFs,o),async(p,{subPath:h})=>u!==p?await n(u,A,p,h):await u.copyFilePromise(A,h,a)))}copyFileSync(r,o,a=0){let n=(u,A,p,h)=>{if(a&K0.constants.COPYFILE_FICLONE_FORCE)throw Object.assign(new Error(`EXDEV: cross-device clone not permitted, copyfile '${A}' -> ${h}'`),{code:"EXDEV"});if(a&K0.constants.COPYFILE_EXCL&&this.existsSync(A))throw Object.assign(new Error(`EEXIST: file already exists, copyfile '${A}' -> '${h}'`),{code:"EEXIST"});let E;try{E=u.readFileSync(A)}catch{throw Object.assign(new Error(`EINVAL: invalid argument, copyfile '${A}' -> '${h}'`),{code:"EINVAL"})}p.writeFileSync(h,E)};return this.makeCallSync(r,()=>this.makeCallSync(o,()=>this.baseFs.copyFileSync(r,o,a),(u,{subPath:A})=>n(this.baseFs,r,u,A)),(u,{subPath:A})=>this.makeCallSync(o,()=>n(u,A,this.baseFs,o),(p,{subPath:h})=>u!==p?n(u,A,p,h):u.copyFileSync(A,h,a)))}async appendFilePromise(r,o,a){return await this.makeCallPromise(r,async()=>await this.baseFs.appendFilePromise(r,o,a),async(n,{subPath:u})=>await n.appendFilePromise(u,o,a))}appendFileSync(r,o,a){return this.makeCallSync(r,()=>this.baseFs.appendFileSync(r,o,a),(n,{subPath:u})=>n.appendFileSync(u,o,a))}async writeFilePromise(r,o,a){return await this.makeCallPromise(r,async()=>await this.baseFs.writeFilePromise(r,o,a),async(n,{subPath:u})=>await n.writeFilePromise(u,o,a))}writeFileSync(r,o,a){return this.makeCallSync(r,()=>this.baseFs.writeFileSync(r,o,a),(n,{subPath:u})=>n.writeFileSync(u,o,a))}async unlinkPromise(r){return await this.makeCallPromise(r,async()=>await this.baseFs.unlinkPromise(r),async(o,{subPath:a})=>await o.unlinkPromise(a))}unlinkSync(r){return this.makeCallSync(r,()=>this.baseFs.unlinkSync(r),(o,{subPath:a})=>o.unlinkSync(a))}async utimesPromise(r,o,a){return await this.makeCallPromise(r,async()=>await this.baseFs.utimesPromise(r,o,a),async(n,{subPath:u})=>await n.utimesPromise(u,o,a))}utimesSync(r,o,a){return this.makeCallSync(r,()=>this.baseFs.utimesSync(r,o,a),(n,{subPath:u})=>n.utimesSync(u,o,a))}async lutimesPromise(r,o,a){return await this.makeCallPromise(r,async()=>await this.baseFs.lutimesPromise(r,o,a),async(n,{subPath:u})=>await n.lutimesPromise(u,o,a))}lutimesSync(r,o,a){return this.makeCallSync(r,()=>this.baseFs.lutimesSync(r,o,a),(n,{subPath:u})=>n.lutimesSync(u,o,a))}async mkdirPromise(r,o){return await this.makeCallPromise(r,async()=>await this.baseFs.mkdirPromise(r,o),async(a,{subPath:n})=>await a.mkdirPromise(n,o))}mkdirSync(r,o){return this.makeCallSync(r,()=>this.baseFs.mkdirSync(r,o),(a,{subPath:n})=>a.mkdirSync(n,o))}async rmdirPromise(r,o){return await this.makeCallPromise(r,async()=>await this.baseFs.rmdirPromise(r,o),async(a,{subPath:n})=>await a.rmdirPromise(n,o))}rmdirSync(r,o){return this.makeCallSync(r,()=>this.baseFs.rmdirSync(r,o),(a,{subPath:n})=>a.rmdirSync(n,o))}async rmPromise(r,o){return await this.makeCallPromise(r,async()=>await this.baseFs.rmPromise(r,o),async(a,{subPath:n})=>await a.rmPromise(n,o))}rmSync(r,o){return this.makeCallSync(r,()=>this.baseFs.rmSync(r,o),(a,{subPath:n})=>a.rmSync(n,o))}async linkPromise(r,o){return await this.makeCallPromise(o,async()=>await this.baseFs.linkPromise(r,o),async(a,{subPath:n})=>await a.linkPromise(r,n))}linkSync(r,o){return this.makeCallSync(o,()=>this.baseFs.linkSync(r,o),(a,{subPath:n})=>a.linkSync(r,n))}async symlinkPromise(r,o,a){return await this.makeCallPromise(o,async()=>await this.baseFs.symlinkPromise(r,o,a),async(n,{subPath:u})=>await n.symlinkPromise(r,u))}symlinkSync(r,o,a){return this.makeCallSync(o,()=>this.baseFs.symlinkSync(r,o,a),(n,{subPath:u})=>n.symlinkSync(r,u))}async readFilePromise(r,o){return this.makeCallPromise(r,async()=>await this.baseFs.readFilePromise(r,o),async(a,{subPath:n})=>await a.readFilePromise(n,o))}readFileSync(r,o){return this.makeCallSync(r,()=>this.baseFs.readFileSync(r,o),(a,{subPath:n})=>a.readFileSync(n,o))}async readdirPromise(r,o){return await this.makeCallPromise(r,async()=>await this.baseFs.readdirPromise(r,o),async(a,{subPath:n})=>await a.readdirPromise(n,o),{requireSubpath:!1})}readdirSync(r,o){return this.makeCallSync(r,()=>this.baseFs.readdirSync(r,o),(a,{subPath:n})=>a.readdirSync(n,o),{requireSubpath:!1})}async readlinkPromise(r){return await this.makeCallPromise(r,async()=>await this.baseFs.readlinkPromise(r),async(o,{subPath:a})=>await o.readlinkPromise(a))}readlinkSync(r){return this.makeCallSync(r,()=>this.baseFs.readlinkSync(r),(o,{subPath:a})=>o.readlinkSync(a))}async truncatePromise(r,o){return await this.makeCallPromise(r,async()=>await this.baseFs.truncatePromise(r,o),async(a,{subPath:n})=>await a.truncatePromise(n,o))}truncateSync(r,o){return this.makeCallSync(r,()=>this.baseFs.truncateSync(r,o),(a,{subPath:n})=>a.truncateSync(n,o))}async ftruncatePromise(r,o){if((r&va)!==this.magic)return this.baseFs.ftruncatePromise(r,o);let a=this.fdMap.get(r);if(typeof a>"u")throw ho("ftruncate");let[n,u]=a;return n.ftruncatePromise(u,o)}ftruncateSync(r,o){if((r&va)!==this.magic)return this.baseFs.ftruncateSync(r,o);let a=this.fdMap.get(r);if(typeof a>"u")throw ho("ftruncateSync");let[n,u]=a;return n.ftruncateSync(u,o)}watch(r,o,a){return this.makeCallSync(r,()=>this.baseFs.watch(r,o,a),(n,{subPath:u})=>n.watch(u,o,a))}watchFile(r,o,a){return this.makeCallSync(r,()=>this.baseFs.watchFile(r,o,a),()=>um(this,r,o,a))}unwatchFile(r,o){return this.makeCallSync(r,()=>this.baseFs.unwatchFile(r,o),()=>q0(this,r,o))}async makeCallPromise(r,o,a,{requireSubpath:n=!0}={}){if(typeof r!="string")return await o();let u=this.resolve(r),A=this.findMount(u);return A?n&&A.subPath==="/"?await o():await this.getMountPromise(A.archivePath,async p=>await a(p,A)):await o()}makeCallSync(r,o,a,{requireSubpath:n=!0}={}){if(typeof r!="string")return o();let u=this.resolve(r),A=this.findMount(u);return!A||n&&A.subPath==="/"?o():this.getMountSync(A.archivePath,p=>a(p,A))}findMount(r){if(this.filter&&!this.filter.test(r))return null;let o="";for(;;){let a=r.substring(o.length),n=this.getMountPoint(a,o);if(!n)return null;if(o=this.pathUtils.join(o,n),!this.isMount.has(o)){if(this.notMount.has(o))continue;try{if(this.typeCheck!==null&&(this.baseFs.statSync(o).mode&K0.constants.S_IFMT)!==this.typeCheck){this.notMount.add(o);continue}}catch{return null}this.isMount.add(o)}return{archivePath:o,subPath:this.pathUtils.join(Bt.root,r.substring(o.length))}}}limitOpenFiles(r){if(this.mountInstances===null)return;let o=Date.now(),a=o+this.maxAge,n=r===null?0:this.mountInstances.size-r;for(let[u,{childFs:A,expiresAt:p,refCount:h}]of this.mountInstances.entries())if(!(h!==0||A.hasOpenFileHandles?.())){if(o>=p){A.saveAndClose?.(),this.mountInstances.delete(u),n-=1;continue}else if(r===null||n<=0){a=p;break}A.saveAndClose?.(),this.mountInstances.delete(u),n-=1}this.limitOpenFilesTimeout===null&&(r===null&&this.mountInstances.size>0||r!==null)&&isFinite(a)&&(this.limitOpenFilesTimeout=setTimeout(()=>{this.limitOpenFilesTimeout=null,this.limitOpenFiles(null)},a-o).unref())}async getMountPromise(r,o){if(this.mountInstances){let a=this.mountInstances.get(r);if(!a){let n=await this.factoryPromise(this.baseFs,r);a=this.mountInstances.get(r),a||(a={childFs:n(),expiresAt:0,refCount:0})}this.mountInstances.delete(r),this.limitOpenFiles(this.maxOpenFiles-1),this.mountInstances.set(r,a),a.expiresAt=Date.now()+this.maxAge,a.refCount+=1;try{return await o(a.childFs)}finally{a.refCount-=1}}else{let a=(await this.factoryPromise(this.baseFs,r))();try{return await o(a)}finally{a.saveAndClose?.()}}}getMountSync(r,o){if(this.mountInstances){let a=this.mountInstances.get(r);return a||(a={childFs:this.factorySync(this.baseFs,r),expiresAt:0,refCount:0}),this.mountInstances.delete(r),this.limitOpenFiles(this.maxOpenFiles-1),this.mountInstances.set(r,a),a.expiresAt=Date.now()+this.maxAge,o(a.childFs)}else{let a=this.factorySync(this.baseFs,r);try{return o(a)}finally{a.saveAndClose?.()}}}}});var $t,nP,kW=It(()=>{W0();Ba();$t=()=>Object.assign(new Error("ENOSYS: unsupported filesystem access"),{code:"ENOSYS"}),nP=class t extends hf{static{this.instance=new t}constructor(){super(K)}getExtractHint(){throw $t()}getRealPath(){throw $t()}resolve(){throw $t()}async openPromise(){throw $t()}openSync(){throw $t()}async opendirPromise(){throw $t()}opendirSync(){throw $t()}async readPromise(){throw $t()}readSync(){throw $t()}async writePromise(){throw $t()}writeSync(){throw $t()}async closePromise(){throw $t()}closeSync(){throw $t()}createWriteStream(){throw $t()}createReadStream(){throw $t()}async realpathPromise(){throw $t()}realpathSync(){throw $t()}async readdirPromise(){throw $t()}readdirSync(){throw $t()}async existsPromise(e){throw $t()}existsSync(e){throw $t()}async accessPromise(){throw $t()}accessSync(){throw $t()}async statPromise(){throw $t()}statSync(){throw $t()}async fstatPromise(e){throw $t()}fstatSync(e){throw $t()}async lstatPromise(e){throw $t()}lstatSync(e){throw $t()}async fchmodPromise(){throw $t()}fchmodSync(){throw $t()}async chmodPromise(){throw $t()}chmodSync(){throw $t()}async fchownPromise(){throw $t()}fchownSync(){throw $t()}async chownPromise(){throw $t()}chownSync(){throw $t()}async mkdirPromise(){throw $t()}mkdirSync(){throw $t()}async rmdirPromise(){throw $t()}rmdirSync(){throw $t()}async rmPromise(){throw $t()}rmSync(){throw $t()}async linkPromise(){throw $t()}linkSync(){throw $t()}async symlinkPromise(){throw $t()}symlinkSync(){throw $t()}async renamePromise(){throw $t()}renameSync(){throw $t()}async copyFilePromise(){throw $t()}copyFileSync(){throw $t()}async appendFilePromise(){throw $t()}appendFileSync(){throw $t()}async writeFilePromise(){throw $t()}writeFileSync(){throw $t()}async unlinkPromise(){throw $t()}unlinkSync(){throw $t()}async utimesPromise(){throw $t()}utimesSync(){throw $t()}async lutimesPromise(){throw $t()}lutimesSync(){throw $t()}async readFilePromise(){throw $t()}readFileSync(){throw $t()}async readlinkPromise(){throw $t()}readlinkSync(){throw $t()}async truncatePromise(){throw $t()}truncateSync(){throw $t()}async ftruncatePromise(e,r){throw $t()}ftruncateSync(e,r){throw $t()}watch(){throw $t()}watchFile(){throw $t()}unwatchFile(){throw $t()}}});var Wp,QW=It(()=>{gf();Ba();Wp=class extends ws{constructor(e){super(Ae),this.baseFs=e}mapFromBase(e){return Ae.fromPortablePath(e)}mapToBase(e){return Ae.toPortablePath(e)}}});var C_e,PT,I_e,qs,FW=It(()=>{Y0();gf();Ba();C_e=/^[0-9]+$/,PT=/^(\/(?:[^/]+\/)*?(?:\$\$virtual|__virtual__))((?:\/((?:[^/]+-)?[a-f0-9]+)(?:\/([^/]+))?)?((?:\/.*)?))$/,I_e=/^([^/]+-)?[a-f0-9]+$/,qs=class t extends ws{static makeVirtualPath(e,r,o){if(K.basename(e)!=="__virtual__")throw new Error('Assertion failed: Virtual folders must be named "__virtual__"');if(!K.basename(r).match(I_e))throw new Error("Assertion failed: Virtual components must be ended by an hexadecimal hash");let n=K.relative(K.dirname(e),o).split("/"),u=0;for(;u{ST=et(ve("buffer")),RW=ve("url"),TW=ve("util");gf();Ba();iP=class extends ws{constructor(e){super(Ae),this.baseFs=e}mapFromBase(e){return e}mapToBase(e){if(typeof e=="string")return e;if(e instanceof URL)return(0,RW.fileURLToPath)(e);if(Buffer.isBuffer(e)){let r=e.toString();if(!w_e(e,r))throw new Error("Non-utf8 buffers are not supported at the moment. Please upvote the following issue if you encounter this error: https://github.com/yarnpkg/berry/issues/4942");return r}throw new Error(`Unsupported path type: ${(0,TW.inspect)(e)}`)}}});var _W,go,df,Yp,sP,oP,fm,_c,Hc,NW,OW,MW,UW,cw,HW=It(()=>{_W=ve("readline"),go=Symbol("kBaseFs"),df=Symbol("kFd"),Yp=Symbol("kClosePromise"),sP=Symbol("kCloseResolve"),oP=Symbol("kCloseReject"),fm=Symbol("kRefs"),_c=Symbol("kRef"),Hc=Symbol("kUnref"),cw=class{constructor(e,r){this[UW]=1;this[MW]=void 0;this[OW]=void 0;this[NW]=void 0;this[go]=r,this[df]=e}get fd(){return this[df]}async appendFile(e,r){try{this[_c](this.appendFile);let o=(typeof r=="string"?r:r?.encoding)??void 0;return await this[go].appendFilePromise(this.fd,e,o?{encoding:o}:void 0)}finally{this[Hc]()}}async chown(e,r){try{return this[_c](this.chown),await this[go].fchownPromise(this.fd,e,r)}finally{this[Hc]()}}async chmod(e){try{return this[_c](this.chmod),await this[go].fchmodPromise(this.fd,e)}finally{this[Hc]()}}createReadStream(e){return this[go].createReadStream(null,{...e,fd:this.fd})}createWriteStream(e){return this[go].createWriteStream(null,{...e,fd:this.fd})}datasync(){throw new Error("Method not implemented.")}sync(){throw new Error("Method not implemented.")}async read(e,r,o,a){try{this[_c](this.read);let n;return Buffer.isBuffer(e)?n=e:(e??={},n=e.buffer??Buffer.alloc(16384),r=e.offset||0,o=e.length??n.byteLength,a=e.position??null),r??=0,o??=0,o===0?{bytesRead:o,buffer:n}:{bytesRead:await this[go].readPromise(this.fd,n,r,o,a),buffer:n}}finally{this[Hc]()}}async readFile(e){try{this[_c](this.readFile);let r=(typeof e=="string"?e:e?.encoding)??void 0;return await this[go].readFilePromise(this.fd,r)}finally{this[Hc]()}}readLines(e){return(0,_W.createInterface)({input:this.createReadStream(e),crlfDelay:1/0})}async stat(e){try{return this[_c](this.stat),await this[go].fstatPromise(this.fd,e)}finally{this[Hc]()}}async truncate(e){try{return this[_c](this.truncate),await this[go].ftruncatePromise(this.fd,e)}finally{this[Hc]()}}utimes(e,r){throw new Error("Method not implemented.")}async writeFile(e,r){try{this[_c](this.writeFile);let o=(typeof r=="string"?r:r?.encoding)??void 0;await this[go].writeFilePromise(this.fd,e,o)}finally{this[Hc]()}}async write(...e){try{if(this[_c](this.write),ArrayBuffer.isView(e[0])){let[r,o,a,n]=e;return{bytesWritten:await this[go].writePromise(this.fd,r,o??void 0,a??void 0,n??void 0),buffer:r}}else{let[r,o,a]=e;return{bytesWritten:await this[go].writePromise(this.fd,r,o,a),buffer:r}}}finally{this[Hc]()}}async writev(e,r){try{this[_c](this.writev);let o=0;if(typeof r<"u")for(let a of e){let n=await this.write(a,void 0,void 0,r);o+=n.bytesWritten,r+=n.bytesWritten}else for(let a of e){let n=await this.write(a);o+=n.bytesWritten}return{buffers:e,bytesWritten:o}}finally{this[Hc]()}}readv(e,r){throw new Error("Method not implemented.")}close(){if(this[df]===-1)return Promise.resolve();if(this[Yp])return this[Yp];if(this[fm]--,this[fm]===0){let e=this[df];this[df]=-1,this[Yp]=this[go].closePromise(e).finally(()=>{this[Yp]=void 0})}else this[Yp]=new Promise((e,r)=>{this[sP]=e,this[oP]=r}).finally(()=>{this[Yp]=void 0,this[oP]=void 0,this[sP]=void 0});return this[Yp]}[(go,df,UW=fm,MW=Yp,OW=sP,NW=oP,_c)](e){if(this[df]===-1){let r=new Error("file closed");throw r.code="EBADF",r.syscall=e.name,r}this[fm]++}[Hc](){if(this[fm]--,this[fm]===0){let e=this[df];this[df]=-1,this[go].closePromise(e).then(this[sP],this[oP])}}}});function uw(t,e){e=new iP(e);let r=(o,a,n)=>{let u=o[a];o[a]=n,typeof u?.[pm.promisify.custom]<"u"&&(n[pm.promisify.custom]=u[pm.promisify.custom])};{r(t,"exists",(o,...a)=>{let u=typeof a[a.length-1]=="function"?a.pop():()=>{};process.nextTick(()=>{e.existsPromise(o).then(A=>{u(A)},()=>{u(!1)})})}),r(t,"read",(...o)=>{let[a,n,u,A,p,h]=o;if(o.length<=3){let E={};o.length<3?h=o[1]:(E=o[1],h=o[2]),{buffer:n=Buffer.alloc(16384),offset:u=0,length:A=n.byteLength,position:p}=E}if(u==null&&(u=0),A|=0,A===0){process.nextTick(()=>{h(null,0,n)});return}p==null&&(p=-1),process.nextTick(()=>{e.readPromise(a,n,u,A,p).then(E=>{h(null,E,n)},E=>{h(E,0,n)})})});for(let o of qW){let a=o.replace(/Promise$/,"");if(typeof t[a]>"u")continue;let n=e[o];if(typeof n>"u")continue;r(t,a,(...A)=>{let h=typeof A[A.length-1]=="function"?A.pop():()=>{};process.nextTick(()=>{n.apply(e,A).then(E=>{h(null,E)},E=>{h(E)})})})}t.realpath.native=t.realpath}{r(t,"existsSync",o=>{try{return e.existsSync(o)}catch{return!1}}),r(t,"readSync",(...o)=>{let[a,n,u,A,p]=o;return o.length<=3&&({offset:u=0,length:A=n.byteLength,position:p}=o[2]||{}),u==null&&(u=0),A|=0,A===0?0:(p==null&&(p=-1),e.readSync(a,n,u,A,p))});for(let o of B_e){let a=o;if(typeof t[a]>"u")continue;let n=e[o];typeof n>"u"||r(t,a,n.bind(e))}t.realpathSync.native=t.realpathSync}{let o=t.promises;for(let a of qW){let n=a.replace(/Promise$/,"");if(typeof o[n]>"u")continue;let u=e[a];typeof u>"u"||a!=="open"&&r(o,n,(A,...p)=>A instanceof cw?A[n].apply(A,p):u.call(e,A,...p))}r(o,"open",async(...a)=>{let n=await e.openPromise(...a);return new cw(n,e)})}t.read[pm.promisify.custom]=async(o,a,...n)=>({bytesRead:await e.readPromise(o,a,...n),buffer:a}),t.write[pm.promisify.custom]=async(o,a,...n)=>({bytesWritten:await e.writePromise(o,a,...n),buffer:a})}function aP(t,e){let r=Object.create(t);return uw(r,e),r}var pm,B_e,qW,jW=It(()=>{pm=ve("util");LW();HW();B_e=new Set(["accessSync","appendFileSync","createReadStream","createWriteStream","chmodSync","fchmodSync","chownSync","fchownSync","closeSync","copyFileSync","linkSync","lstatSync","fstatSync","lutimesSync","mkdirSync","openSync","opendirSync","readlinkSync","readFileSync","readdirSync","readlinkSync","realpathSync","renameSync","rmdirSync","rmSync","statSync","symlinkSync","truncateSync","ftruncateSync","unlinkSync","unwatchFile","utimesSync","watch","watchFile","writeFileSync","writeSync"]),qW=new Set(["accessPromise","appendFilePromise","fchmodPromise","chmodPromise","fchownPromise","chownPromise","closePromise","copyFilePromise","linkPromise","fstatPromise","lstatPromise","lutimesPromise","mkdirPromise","openPromise","opendirPromise","readdirPromise","realpathPromise","readFilePromise","readdirPromise","readlinkPromise","renamePromise","rmdirPromise","rmPromise","statPromise","symlinkPromise","truncatePromise","ftruncatePromise","unlinkPromise","utimesPromise","writeFilePromise","writeSync"])});function GW(t){let e=Math.ceil(Math.random()*4294967296).toString(16).padStart(8,"0");return`${t}${e}`}function WW(){if(xT)return xT;let t=Ae.toPortablePath(YW.default.tmpdir()),e=ae.realpathSync(t);return process.once("exit",()=>{ae.rmtempSync()}),xT={tmpdir:t,realTmpdir:e}}var YW,qc,xT,ae,KW=It(()=>{YW=et(ve("os"));Y0();Ba();qc=new Set,xT=null;ae=Object.assign(new _n,{detachTemp(t){qc.delete(t)},mktempSync(t){let{tmpdir:e,realTmpdir:r}=WW();for(;;){let o=GW("xfs-");try{this.mkdirSync(K.join(e,o))}catch(n){if(n.code==="EEXIST")continue;throw n}let a=K.join(r,o);if(qc.add(a),typeof t>"u")return a;try{return t(a)}finally{if(qc.has(a)){qc.delete(a);try{this.removeSync(a)}catch{}}}}},async mktempPromise(t){let{tmpdir:e,realTmpdir:r}=WW();for(;;){let o=GW("xfs-");try{await this.mkdirPromise(K.join(e,o))}catch(n){if(n.code==="EEXIST")continue;throw n}let a=K.join(r,o);if(qc.add(a),typeof t>"u")return a;try{return await t(a)}finally{if(qc.has(a)){qc.delete(a);try{await this.removePromise(a)}catch{}}}}},async rmtempPromise(){await Promise.all(Array.from(qc.values()).map(async t=>{try{await ae.removePromise(t,{maxRetries:0}),qc.delete(t)}catch{}}))},rmtempSync(){for(let t of qc)try{ae.removeSync(t),qc.delete(t)}catch{}}})});var Aw={};Kt(Aw,{AliasFS:()=>ju,BasePortableFakeFS:()=>qu,CustomDir:()=>lw,CwdFS:()=>En,FakeFS:()=>hf,Filename:()=>mr,JailFS:()=>Gu,LazyFS:()=>Am,MountFS:()=>Gp,NoFS:()=>nP,NodeFS:()=>_n,PortablePath:()=>Bt,PosixFS:()=>Wp,ProxiedFS:()=>ws,VirtualFS:()=>qs,constants:()=>Pi,errors:()=>sr,extendFs:()=>aP,normalizeLineEndings:()=>G0,npath:()=>Ae,opendir:()=>eP,patchFs:()=>uw,ppath:()=>K,setupCopyIndex:()=>$D,statUtils:()=>wa,unwatchAllFiles:()=>j0,unwatchFile:()=>q0,watchFile:()=>um,xfs:()=>ae});var Pt=It(()=>{uW();JD();IT();vT();dW();DT();W0();Ba();Ba();wW();W0();DW();SW();xW();bW();kW();Y0();QW();gf();FW();jW();KW()});var ZW=_((qSt,XW)=>{XW.exports=JW;JW.sync=D_e;var VW=ve("fs");function v_e(t,e){var r=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var o=0;o{rY.exports=eY;eY.sync=P_e;var $W=ve("fs");function eY(t,e,r){$W.stat(t,function(o,a){r(o,o?!1:tY(a,e))})}function P_e(t,e){return tY($W.statSync(t),e)}function tY(t,e){return t.isFile()&&S_e(t,e)}function S_e(t,e){var r=t.mode,o=t.uid,a=t.gid,n=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),u=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),A=parseInt("100",8),p=parseInt("010",8),h=parseInt("001",8),E=A|p,w=r&h||r&p&&a===u||r&A&&o===n||r&E&&n===0;return w}});var sY=_((WSt,iY)=>{var GSt=ve("fs"),lP;process.platform==="win32"||global.TESTING_WINDOWS?lP=ZW():lP=nY();iY.exports=bT;bT.sync=x_e;function bT(t,e,r){if(typeof e=="function"&&(r=e,e={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(o,a){bT(t,e||{},function(n,u){n?a(n):o(u)})})}lP(t,e||{},function(o,a){o&&(o.code==="EACCES"||e&&e.ignoreErrors)&&(o=null,a=!1),r(o,a)})}function x_e(t,e){try{return lP.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var fY=_((YSt,AY)=>{var hm=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",oY=ve("path"),b_e=hm?";":":",aY=sY(),lY=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),cY=(t,e)=>{let r=e.colon||b_e,o=t.match(/\//)||hm&&t.match(/\\/)?[""]:[...hm?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],a=hm?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",n=hm?a.split(r):[""];return hm&&t.indexOf(".")!==-1&&n[0]!==""&&n.unshift(""),{pathEnv:o,pathExt:n,pathExtExe:a}},uY=(t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:o,pathExt:a,pathExtExe:n}=cY(t,e),u=[],A=h=>new Promise((E,w)=>{if(h===o.length)return e.all&&u.length?E(u):w(lY(t));let D=o[h],b=/^".*"$/.test(D)?D.slice(1,-1):D,C=oY.join(b,t),T=!b&&/^\.[\\\/]/.test(t)?t.slice(0,2)+C:C;E(p(T,h,0))}),p=(h,E,w)=>new Promise((D,b)=>{if(w===a.length)return D(A(E+1));let C=a[w];aY(h+C,{pathExt:n},(T,N)=>{if(!T&&N)if(e.all)u.push(h+C);else return D(h+C);return D(p(h,E,w+1))})});return r?A(0).then(h=>r(null,h),r):A(0)},k_e=(t,e)=>{e=e||{};let{pathEnv:r,pathExt:o,pathExtExe:a}=cY(t,e),n=[];for(let u=0;u{"use strict";var pY=(t={})=>{let e=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(o=>o.toUpperCase()==="PATH")||"Path"};kT.exports=pY;kT.exports.default=pY});var yY=_((VSt,mY)=>{"use strict";var gY=ve("path"),Q_e=fY(),F_e=hY();function dY(t,e){let r=t.options.env||process.env,o=process.cwd(),a=t.options.cwd!=null,n=a&&process.chdir!==void 0&&!process.chdir.disabled;if(n)try{process.chdir(t.options.cwd)}catch{}let u;try{u=Q_e.sync(t.command,{path:r[F_e({env:r})],pathExt:e?gY.delimiter:void 0})}catch{}finally{n&&process.chdir(o)}return u&&(u=gY.resolve(a?t.options.cwd:"",u)),u}function R_e(t){return dY(t)||dY(t,!0)}mY.exports=R_e});var EY=_((zSt,FT)=>{"use strict";var QT=/([()\][%!^"`<>&|;, *?])/g;function T_e(t){return t=t.replace(QT,"^$1"),t}function L_e(t,e){return t=`${t}`,t=t.replace(/(\\*)"/g,'$1$1\\"'),t=t.replace(/(\\*)$/,"$1$1"),t=`"${t}"`,t=t.replace(QT,"^$1"),e&&(t=t.replace(QT,"^$1")),t}FT.exports.command=T_e;FT.exports.argument=L_e});var IY=_((JSt,CY)=>{"use strict";CY.exports=/^#!(.*)/});var BY=_((XSt,wY)=>{"use strict";var N_e=IY();wY.exports=(t="")=>{let e=t.match(N_e);if(!e)return null;let[r,o]=e[0].replace(/#! ?/,"").split(" "),a=r.split("/").pop();return a==="env"?o:o?`${a} ${o}`:a}});var DY=_((ZSt,vY)=>{"use strict";var RT=ve("fs"),O_e=BY();function M_e(t){let r=Buffer.alloc(150),o;try{o=RT.openSync(t,"r"),RT.readSync(o,r,0,150,0),RT.closeSync(o)}catch{}return O_e(r.toString())}vY.exports=M_e});var bY=_(($St,xY)=>{"use strict";var U_e=ve("path"),PY=yY(),SY=EY(),__e=DY(),H_e=process.platform==="win32",q_e=/\.(?:com|exe)$/i,j_e=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function G_e(t){t.file=PY(t);let e=t.file&&__e(t.file);return e?(t.args.unshift(t.file),t.command=e,PY(t)):t.file}function W_e(t){if(!H_e)return t;let e=G_e(t),r=!q_e.test(e);if(t.options.forceShell||r){let o=j_e.test(e);t.command=U_e.normalize(t.command),t.command=SY.command(t.command),t.args=t.args.map(n=>SY.argument(n,o));let a=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${a}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}function Y_e(t,e,r){e&&!Array.isArray(e)&&(r=e,e=null),e=e?e.slice(0):[],r=Object.assign({},r);let o={command:t,args:e,options:r,file:void 0,original:{command:t,args:e}};return r.shell?o:W_e(o)}xY.exports=Y_e});var FY=_((ext,QY)=>{"use strict";var TT=process.platform==="win32";function LT(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}function K_e(t,e){if(!TT)return;let r=t.emit;t.emit=function(o,a){if(o==="exit"){let n=kY(a,e,"spawn");if(n)return r.call(t,"error",n)}return r.apply(t,arguments)}}function kY(t,e){return TT&&t===1&&!e.file?LT(e.original,"spawn"):null}function V_e(t,e){return TT&&t===1&&!e.file?LT(e.original,"spawnSync"):null}QY.exports={hookChildProcess:K_e,verifyENOENT:kY,verifyENOENTSync:V_e,notFoundError:LT}});var MT=_((txt,gm)=>{"use strict";var RY=ve("child_process"),NT=bY(),OT=FY();function TY(t,e,r){let o=NT(t,e,r),a=RY.spawn(o.command,o.args,o.options);return OT.hookChildProcess(a,o),a}function z_e(t,e,r){let o=NT(t,e,r),a=RY.spawnSync(o.command,o.args,o.options);return a.error=a.error||OT.verifyENOENTSync(a.status,o),a}gm.exports=TY;gm.exports.spawn=TY;gm.exports.sync=z_e;gm.exports._parse=NT;gm.exports._enoent=OT});var NY=_((rxt,LY)=>{"use strict";function J_e(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}function V0(t,e,r,o){this.message=t,this.expected=e,this.found=r,this.location=o,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,V0)}J_e(V0,Error);V0.buildMessage=function(t,e){var r={literal:function(h){return'"'+a(h.text)+'"'},class:function(h){var E="",w;for(w=0;w0){for(w=1,D=1;w>",S=cr(">>",!1),y=">&",R=cr(">&",!1),J=">",X=cr(">",!1),$="<<<",se=cr("<<<",!1),be="<&",Fe=cr("<&",!1),lt="<",Et=cr("<",!1),qt=function(L){return{type:"argument",segments:[].concat(...L)}},nr=function(L){return L},St="$'",cn=cr("$'",!1),Pr="'",yr=cr("'",!1),Rr=function(L){return[{type:"text",text:L}]},Xr='""',$n=cr('""',!1),Xs=function(){return{type:"text",text:""}},Hi='"',Qs=cr('"',!1),Zs=function(L){return L},bi=function(L){return{type:"arithmetic",arithmetic:L,quoted:!0}},Fs=function(L){return{type:"shell",shell:L,quoted:!0}},$s=function(L){return{type:"variable",...L,quoted:!0}},SA=function(L){return{type:"text",text:L}},gu=function(L){return{type:"arithmetic",arithmetic:L,quoted:!1}},op=function(L){return{type:"shell",shell:L,quoted:!1}},ap=function(L){return{type:"variable",...L,quoted:!1}},Rs=function(L){return{type:"glob",pattern:L}},Nn=/^[^']/,hs=Ni(["'"],!0,!1),Ts=function(L){return L.join("")},pc=/^[^$"]/,hc=Ni(["$",'"'],!0,!1),gc=`\\ `,xA=cr(`\\ `,!1),bA=function(){return""},Ro="\\",To=cr("\\",!1),kA=/^[\\$"`]/,pr=Ni(["\\","$",'"',"`"],!1,!1),Me=function(L){return L},ia="\\a",dc=cr("\\a",!1),Er=function(){return"a"},du="\\b",QA=cr("\\b",!1),FA=function(){return"\b"},mc=/^[Ee]/,yc=Ni(["E","e"],!1,!1),Il=function(){return"\x1B"},we="\\f",Tt=cr("\\f",!1),wl=function(){return"\f"},Bi="\\n",Ls=cr("\\n",!1),Ft=function(){return` `},Bn="\\r",Lo=cr("\\r",!1),ki=function(){return"\r"},vi="\\t",sa=cr("\\t",!1),un=function(){return" "},qn="\\v",Ec=cr("\\v",!1),lp=function(){return"\v"},oa=/^[\\'"?]/,aa=Ni(["\\","'",'"',"?"],!1,!1),la=function(L){return String.fromCharCode(parseInt(L,16))},Ze="\\x",ca=cr("\\x",!1),mu="\\u",Bl=cr("\\u",!1),dn="\\U",No=cr("\\U",!1),RA=function(L){return String.fromCodePoint(parseInt(L,16))},TA=/^[0-7]/,Oo=Ni([["0","7"]],!1,!1),qa=/^[0-9a-fA-f]/,Ot=Ni([["0","9"],["a","f"],["A","f"]],!1,!1),vn=Iu(),Mo="{}",ua=cr("{}",!1),qi=function(){return"{}"},vl="-",Cc=cr("-",!1),Dl="+",Aa=cr("+",!1),Di=".",rs=cr(".",!1),ja=function(L,V,re){return{type:"number",value:(L==="-"?-1:1)*parseFloat(V.join("")+"."+re.join(""))}},yu=function(L,V){return{type:"number",value:(L==="-"?-1:1)*parseInt(V.join(""))}},Pl=function(L){return{type:"variable",...L}},pi=function(L){return{type:"variable",name:L}},Dn=function(L){return L},Sl="*",ze=cr("*",!1),it="/",vt=cr("/",!1),ar=function(L,V,re){return{type:V==="*"?"multiplication":"division",right:re}},ee=function(L,V){return V.reduce((re,ge)=>({left:re,...ge}),L)},ye=function(L,V,re){return{type:V==="+"?"addition":"subtraction",right:re}},Ne="$((",gt=cr("$((",!1),mt="))",Dt=cr("))",!1),er=function(L){return L},sn="$(",ei=cr("$(",!1),Qi=function(L){return L},Pn="${",fa=cr("${",!1),wd=":-",BI=cr(":-",!1),eo=function(L,V){return{name:L,defaultValue:V}},Bd=":-}",cp=cr(":-}",!1),vI=function(L){return{name:L,defaultValue:[]}},to=":+",up=cr(":+",!1),Ap=function(L,V){return{name:L,alternativeValue:V}},Ic=":+}",fp=cr(":+}",!1),s0=function(L){return{name:L,alternativeValue:[]}},o0=function(L){return{name:L}},a0="$",vd=cr("$",!1),Eu=function(L){return e.isGlobPattern(L)},ro=function(L){return L},Ga=/^[a-zA-Z0-9_]/,pp=Ni([["a","z"],["A","Z"],["0","9"],"_"],!1,!1),l0=function(){return xd()},Wa=/^[$@*?#a-zA-Z0-9_\-]/,Ya=Ni(["$","@","*","?","#",["a","z"],["A","Z"],["0","9"],"_","-"],!1,!1),Dd=/^[()}<>$|&; \t"']/,LA=Ni(["(",")","}","<",">","$","|","&",";"," "," ",'"',"'"],!1,!1),Pd=/^[<>&; \t"']/,Sd=Ni(["<",">","&",";"," "," ",'"',"'"],!1,!1),NA=/^[ \t]/,OA=Ni([" "," "],!1,!1),W=0,xt=0,MA=[{line:1,column:1}],no=0,Cu=[],dt=0,wc;if("startRule"in e){if(!(e.startRule in o))throw new Error(`Can't start parsing from rule "`+e.startRule+'".');a=o[e.startRule]}function xd(){return t.substring(xt,W)}function c0(){return wu(xt,W)}function DI(L,V){throw V=V!==void 0?V:wu(xt,W),UA([u0(L)],t.substring(xt,W),V)}function hp(L,V){throw V=V!==void 0?V:wu(xt,W),oi(L,V)}function cr(L,V){return{type:"literal",text:L,ignoreCase:V}}function Ni(L,V,re){return{type:"class",parts:L,inverted:V,ignoreCase:re}}function Iu(){return{type:"any"}}function pa(){return{type:"end"}}function u0(L){return{type:"other",description:L}}function Bc(L){var V=MA[L],re;if(V)return V;for(re=L-1;!MA[re];)re--;for(V=MA[re],V={line:V.line,column:V.column};reno&&(no=W,Cu=[]),Cu.push(L))}function oi(L,V){return new V0(L,null,null,V)}function UA(L,V,re){return new V0(V0.buildMessage(L,V),L,V,re)}function ha(){var L,V,re;for(L=W,V=[],re=bt();re!==r;)V.push(re),re=bt();return V!==r?(re=Uo(),re===r&&(re=null),re!==r?(xt=L,V=n(re),L=V):(W=L,L=r)):(W=L,L=r),L}function Uo(){var L,V,re,ge,Ye;if(L=W,V=gp(),V!==r){for(re=[],ge=bt();ge!==r;)re.push(ge),ge=bt();re!==r?(ge=A0(),ge!==r?(Ye=ga(),Ye===r&&(Ye=null),Ye!==r?(xt=L,V=u(V,ge,Ye),L=V):(W=L,L=r)):(W=L,L=r)):(W=L,L=r)}else W=L,L=r;if(L===r)if(L=W,V=gp(),V!==r){for(re=[],ge=bt();ge!==r;)re.push(ge),ge=bt();re!==r?(ge=A0(),ge===r&&(ge=null),ge!==r?(xt=L,V=A(V,ge),L=V):(W=L,L=r)):(W=L,L=r)}else W=L,L=r;return L}function ga(){var L,V,re,ge,Ye;for(L=W,V=[],re=bt();re!==r;)V.push(re),re=bt();if(V!==r)if(re=Uo(),re!==r){for(ge=[],Ye=bt();Ye!==r;)ge.push(Ye),Ye=bt();ge!==r?(xt=L,V=p(re),L=V):(W=L,L=r)}else W=L,L=r;else W=L,L=r;return L}function A0(){var L;return t.charCodeAt(W)===59?(L=h,W++):(L=r,dt===0&&wt(E)),L===r&&(t.charCodeAt(W)===38?(L=w,W++):(L=r,dt===0&&wt(D))),L}function gp(){var L,V,re;return L=W,V=_A(),V!==r?(re=f0(),re===r&&(re=null),re!==r?(xt=L,V=b(V,re),L=V):(W=L,L=r)):(W=L,L=r),L}function f0(){var L,V,re,ge,Ye,At,hr;for(L=W,V=[],re=bt();re!==r;)V.push(re),re=bt();if(V!==r)if(re=bd(),re!==r){for(ge=[],Ye=bt();Ye!==r;)ge.push(Ye),Ye=bt();if(ge!==r)if(Ye=gp(),Ye!==r){for(At=[],hr=bt();hr!==r;)At.push(hr),hr=bt();At!==r?(xt=L,V=C(re,Ye),L=V):(W=L,L=r)}else W=L,L=r;else W=L,L=r}else W=L,L=r;else W=L,L=r;return L}function bd(){var L;return t.substr(W,2)===T?(L=T,W+=2):(L=r,dt===0&&wt(N)),L===r&&(t.substr(W,2)===U?(L=U,W+=2):(L=r,dt===0&&wt(z))),L}function _A(){var L,V,re;return L=W,V=Bu(),V!==r?(re=p0(),re===r&&(re=null),re!==r?(xt=L,V=te(V,re),L=V):(W=L,L=r)):(W=L,L=r),L}function p0(){var L,V,re,ge,Ye,At,hr;for(L=W,V=[],re=bt();re!==r;)V.push(re),re=bt();if(V!==r)if(re=vc(),re!==r){for(ge=[],Ye=bt();Ye!==r;)ge.push(Ye),Ye=bt();if(ge!==r)if(Ye=_A(),Ye!==r){for(At=[],hr=bt();hr!==r;)At.push(hr),hr=bt();At!==r?(xt=L,V=le(re,Ye),L=V):(W=L,L=r)}else W=L,L=r;else W=L,L=r}else W=L,L=r;else W=L,L=r;return L}function vc(){var L;return t.substr(W,2)===ce?(L=ce,W+=2):(L=r,dt===0&&wt(ue)),L===r&&(t.charCodeAt(W)===124?(L=Ie,W++):(L=r,dt===0&&wt(he))),L}function Dc(){var L,V,re,ge,Ye,At;if(L=W,V=yp(),V!==r)if(t.charCodeAt(W)===61?(re=De,W++):(re=r,dt===0&&wt(Ee)),re!==r)if(ge=HA(),ge!==r){for(Ye=[],At=bt();At!==r;)Ye.push(At),At=bt();Ye!==r?(xt=L,V=g(V,ge),L=V):(W=L,L=r)}else W=L,L=r;else W=L,L=r;else W=L,L=r;if(L===r)if(L=W,V=yp(),V!==r)if(t.charCodeAt(W)===61?(re=De,W++):(re=r,dt===0&&wt(Ee)),re!==r){for(ge=[],Ye=bt();Ye!==r;)ge.push(Ye),Ye=bt();ge!==r?(xt=L,V=me(V),L=V):(W=L,L=r)}else W=L,L=r;else W=L,L=r;return L}function Bu(){var L,V,re,ge,Ye,At,hr,Ir,Rn,ai,ns;for(L=W,V=[],re=bt();re!==r;)V.push(re),re=bt();if(V!==r)if(t.charCodeAt(W)===40?(re=Ce,W++):(re=r,dt===0&&wt(fe)),re!==r){for(ge=[],Ye=bt();Ye!==r;)ge.push(Ye),Ye=bt();if(ge!==r)if(Ye=Uo(),Ye!==r){for(At=[],hr=bt();hr!==r;)At.push(hr),hr=bt();if(At!==r)if(t.charCodeAt(W)===41?(hr=ie,W++):(hr=r,dt===0&&wt(Z)),hr!==r){for(Ir=[],Rn=bt();Rn!==r;)Ir.push(Rn),Rn=bt();if(Ir!==r){for(Rn=[],ai=On();ai!==r;)Rn.push(ai),ai=On();if(Rn!==r){for(ai=[],ns=bt();ns!==r;)ai.push(ns),ns=bt();ai!==r?(xt=L,V=Pe(Ye,Rn),L=V):(W=L,L=r)}else W=L,L=r}else W=L,L=r}else W=L,L=r;else W=L,L=r}else W=L,L=r;else W=L,L=r}else W=L,L=r;else W=L,L=r;if(L===r){for(L=W,V=[],re=bt();re!==r;)V.push(re),re=bt();if(V!==r)if(t.charCodeAt(W)===123?(re=Re,W++):(re=r,dt===0&&wt(ht)),re!==r){for(ge=[],Ye=bt();Ye!==r;)ge.push(Ye),Ye=bt();if(ge!==r)if(Ye=Uo(),Ye!==r){for(At=[],hr=bt();hr!==r;)At.push(hr),hr=bt();if(At!==r)if(t.charCodeAt(W)===125?(hr=q,W++):(hr=r,dt===0&&wt(nt)),hr!==r){for(Ir=[],Rn=bt();Rn!==r;)Ir.push(Rn),Rn=bt();if(Ir!==r){for(Rn=[],ai=On();ai!==r;)Rn.push(ai),ai=On();if(Rn!==r){for(ai=[],ns=bt();ns!==r;)ai.push(ns),ns=bt();ai!==r?(xt=L,V=Le(Ye,Rn),L=V):(W=L,L=r)}else W=L,L=r}else W=L,L=r}else W=L,L=r;else W=L,L=r}else W=L,L=r;else W=L,L=r}else W=L,L=r;else W=L,L=r;if(L===r){for(L=W,V=[],re=bt();re!==r;)V.push(re),re=bt();if(V!==r){for(re=[],ge=Dc();ge!==r;)re.push(ge),ge=Dc();if(re!==r){for(ge=[],Ye=bt();Ye!==r;)ge.push(Ye),Ye=bt();if(ge!==r){if(Ye=[],At=Pc(),At!==r)for(;At!==r;)Ye.push(At),At=Pc();else Ye=r;if(Ye!==r){for(At=[],hr=bt();hr!==r;)At.push(hr),hr=bt();At!==r?(xt=L,V=Te(re,Ye),L=V):(W=L,L=r)}else W=L,L=r}else W=L,L=r}else W=L,L=r}else W=L,L=r;if(L===r){for(L=W,V=[],re=bt();re!==r;)V.push(re),re=bt();if(V!==r){if(re=[],ge=Dc(),ge!==r)for(;ge!==r;)re.push(ge),ge=Dc();else re=r;if(re!==r){for(ge=[],Ye=bt();Ye!==r;)ge.push(Ye),Ye=bt();ge!==r?(xt=L,V=ke(re),L=V):(W=L,L=r)}else W=L,L=r}else W=L,L=r}}}return L}function gs(){var L,V,re,ge,Ye;for(L=W,V=[],re=bt();re!==r;)V.push(re),re=bt();if(V!==r){if(re=[],ge=Ci(),ge!==r)for(;ge!==r;)re.push(ge),ge=Ci();else re=r;if(re!==r){for(ge=[],Ye=bt();Ye!==r;)ge.push(Ye),Ye=bt();ge!==r?(xt=L,V=Ve(re),L=V):(W=L,L=r)}else W=L,L=r}else W=L,L=r;return L}function Pc(){var L,V,re;for(L=W,V=[],re=bt();re!==r;)V.push(re),re=bt();if(V!==r?(re=On(),re!==r?(xt=L,V=xe(re),L=V):(W=L,L=r)):(W=L,L=r),L===r){for(L=W,V=[],re=bt();re!==r;)V.push(re),re=bt();V!==r?(re=Ci(),re!==r?(xt=L,V=xe(re),L=V):(W=L,L=r)):(W=L,L=r)}return L}function On(){var L,V,re,ge,Ye;for(L=W,V=[],re=bt();re!==r;)V.push(re),re=bt();return V!==r?(tt.test(t.charAt(W))?(re=t.charAt(W),W++):(re=r,dt===0&&wt(He)),re===r&&(re=null),re!==r?(ge=ji(),ge!==r?(Ye=Ci(),Ye!==r?(xt=L,V=x(re,ge,Ye),L=V):(W=L,L=r)):(W=L,L=r)):(W=L,L=r)):(W=L,L=r),L}function ji(){var L;return t.substr(W,2)===I?(L=I,W+=2):(L=r,dt===0&&wt(S)),L===r&&(t.substr(W,2)===y?(L=y,W+=2):(L=r,dt===0&&wt(R)),L===r&&(t.charCodeAt(W)===62?(L=J,W++):(L=r,dt===0&&wt(X)),L===r&&(t.substr(W,3)===$?(L=$,W+=3):(L=r,dt===0&&wt(se)),L===r&&(t.substr(W,2)===be?(L=be,W+=2):(L=r,dt===0&&wt(Fe)),L===r&&(t.charCodeAt(W)===60?(L=lt,W++):(L=r,dt===0&&wt(Et))))))),L}function Ci(){var L,V,re;for(L=W,V=[],re=bt();re!==r;)V.push(re),re=bt();return V!==r?(re=HA(),re!==r?(xt=L,V=xe(re),L=V):(W=L,L=r)):(W=L,L=r),L}function HA(){var L,V,re;if(L=W,V=[],re=vu(),re!==r)for(;re!==r;)V.push(re),re=vu();else V=r;return V!==r&&(xt=L,V=qt(V)),L=V,L}function vu(){var L,V;return L=W,V=An(),V!==r&&(xt=L,V=nr(V)),L=V,L===r&&(L=W,V=h0(),V!==r&&(xt=L,V=nr(V)),L=V,L===r&&(L=W,V=g0(),V!==r&&(xt=L,V=nr(V)),L=V,L===r&&(L=W,V=Gi(),V!==r&&(xt=L,V=nr(V)),L=V))),L}function An(){var L,V,re,ge;return L=W,t.substr(W,2)===St?(V=St,W+=2):(V=r,dt===0&&wt(cn)),V!==r?(re=fn(),re!==r?(t.charCodeAt(W)===39?(ge=Pr,W++):(ge=r,dt===0&&wt(yr)),ge!==r?(xt=L,V=Rr(re),L=V):(W=L,L=r)):(W=L,L=r)):(W=L,L=r),L}function h0(){var L,V,re,ge;return L=W,t.charCodeAt(W)===39?(V=Pr,W++):(V=r,dt===0&&wt(yr)),V!==r?(re=Du(),re!==r?(t.charCodeAt(W)===39?(ge=Pr,W++):(ge=r,dt===0&&wt(yr)),ge!==r?(xt=L,V=Rr(re),L=V):(W=L,L=r)):(W=L,L=r)):(W=L,L=r),L}function g0(){var L,V,re,ge;if(L=W,t.substr(W,2)===Xr?(V=Xr,W+=2):(V=r,dt===0&&wt($n)),V!==r&&(xt=L,V=Xs()),L=V,L===r)if(L=W,t.charCodeAt(W)===34?(V=Hi,W++):(V=r,dt===0&&wt(Qs)),V!==r){for(re=[],ge=Ka();ge!==r;)re.push(ge),ge=Ka();re!==r?(t.charCodeAt(W)===34?(ge=Hi,W++):(ge=r,dt===0&&wt(Qs)),ge!==r?(xt=L,V=Zs(re),L=V):(W=L,L=r)):(W=L,L=r)}else W=L,L=r;return L}function Gi(){var L,V,re;if(L=W,V=[],re=io(),re!==r)for(;re!==r;)V.push(re),re=io();else V=r;return V!==r&&(xt=L,V=Zs(V)),L=V,L}function Ka(){var L,V;return L=W,V=Kr(),V!==r&&(xt=L,V=bi(V)),L=V,L===r&&(L=W,V=mp(),V!==r&&(xt=L,V=Fs(V)),L=V,L===r&&(L=W,V=jA(),V!==r&&(xt=L,V=$s(V)),L=V,L===r&&(L=W,V=Pu(),V!==r&&(xt=L,V=SA(V)),L=V))),L}function io(){var L,V;return L=W,V=Kr(),V!==r&&(xt=L,V=gu(V)),L=V,L===r&&(L=W,V=mp(),V!==r&&(xt=L,V=op(V)),L=V,L===r&&(L=W,V=jA(),V!==r&&(xt=L,V=ap(V)),L=V,L===r&&(L=W,V=kd(),V!==r&&(xt=L,V=Rs(V)),L=V,L===r&&(L=W,V=dp(),V!==r&&(xt=L,V=SA(V)),L=V)))),L}function Du(){var L,V,re;for(L=W,V=[],Nn.test(t.charAt(W))?(re=t.charAt(W),W++):(re=r,dt===0&&wt(hs));re!==r;)V.push(re),Nn.test(t.charAt(W))?(re=t.charAt(W),W++):(re=r,dt===0&&wt(hs));return V!==r&&(xt=L,V=Ts(V)),L=V,L}function Pu(){var L,V,re;if(L=W,V=[],re=Va(),re===r&&(pc.test(t.charAt(W))?(re=t.charAt(W),W++):(re=r,dt===0&&wt(hc))),re!==r)for(;re!==r;)V.push(re),re=Va(),re===r&&(pc.test(t.charAt(W))?(re=t.charAt(W),W++):(re=r,dt===0&&wt(hc)));else V=r;return V!==r&&(xt=L,V=Ts(V)),L=V,L}function Va(){var L,V,re;return L=W,t.substr(W,2)===gc?(V=gc,W+=2):(V=r,dt===0&&wt(xA)),V!==r&&(xt=L,V=bA()),L=V,L===r&&(L=W,t.charCodeAt(W)===92?(V=Ro,W++):(V=r,dt===0&&wt(To)),V!==r?(kA.test(t.charAt(W))?(re=t.charAt(W),W++):(re=r,dt===0&&wt(pr)),re!==r?(xt=L,V=Me(re),L=V):(W=L,L=r)):(W=L,L=r)),L}function fn(){var L,V,re;for(L=W,V=[],re=so(),re===r&&(Nn.test(t.charAt(W))?(re=t.charAt(W),W++):(re=r,dt===0&&wt(hs)));re!==r;)V.push(re),re=so(),re===r&&(Nn.test(t.charAt(W))?(re=t.charAt(W),W++):(re=r,dt===0&&wt(hs)));return V!==r&&(xt=L,V=Ts(V)),L=V,L}function so(){var L,V,re;return L=W,t.substr(W,2)===ia?(V=ia,W+=2):(V=r,dt===0&&wt(dc)),V!==r&&(xt=L,V=Er()),L=V,L===r&&(L=W,t.substr(W,2)===du?(V=du,W+=2):(V=r,dt===0&&wt(QA)),V!==r&&(xt=L,V=FA()),L=V,L===r&&(L=W,t.charCodeAt(W)===92?(V=Ro,W++):(V=r,dt===0&&wt(To)),V!==r?(mc.test(t.charAt(W))?(re=t.charAt(W),W++):(re=r,dt===0&&wt(yc)),re!==r?(xt=L,V=Il(),L=V):(W=L,L=r)):(W=L,L=r),L===r&&(L=W,t.substr(W,2)===we?(V=we,W+=2):(V=r,dt===0&&wt(Tt)),V!==r&&(xt=L,V=wl()),L=V,L===r&&(L=W,t.substr(W,2)===Bi?(V=Bi,W+=2):(V=r,dt===0&&wt(Ls)),V!==r&&(xt=L,V=Ft()),L=V,L===r&&(L=W,t.substr(W,2)===Bn?(V=Bn,W+=2):(V=r,dt===0&&wt(Lo)),V!==r&&(xt=L,V=ki()),L=V,L===r&&(L=W,t.substr(W,2)===vi?(V=vi,W+=2):(V=r,dt===0&&wt(sa)),V!==r&&(xt=L,V=un()),L=V,L===r&&(L=W,t.substr(W,2)===qn?(V=qn,W+=2):(V=r,dt===0&&wt(Ec)),V!==r&&(xt=L,V=lp()),L=V,L===r&&(L=W,t.charCodeAt(W)===92?(V=Ro,W++):(V=r,dt===0&&wt(To)),V!==r?(oa.test(t.charAt(W))?(re=t.charAt(W),W++):(re=r,dt===0&&wt(aa)),re!==r?(xt=L,V=Me(re),L=V):(W=L,L=r)):(W=L,L=r),L===r&&(L=Sc()))))))))),L}function Sc(){var L,V,re,ge,Ye,At,hr,Ir,Rn,ai,ns,GA;return L=W,t.charCodeAt(W)===92?(V=Ro,W++):(V=r,dt===0&&wt(To)),V!==r?(re=_o(),re!==r?(xt=L,V=la(re),L=V):(W=L,L=r)):(W=L,L=r),L===r&&(L=W,t.substr(W,2)===Ze?(V=Ze,W+=2):(V=r,dt===0&&wt(ca)),V!==r?(re=W,ge=W,Ye=_o(),Ye!==r?(At=ds(),At!==r?(Ye=[Ye,At],ge=Ye):(W=ge,ge=r)):(W=ge,ge=r),ge===r&&(ge=_o()),ge!==r?re=t.substring(re,W):re=ge,re!==r?(xt=L,V=la(re),L=V):(W=L,L=r)):(W=L,L=r),L===r&&(L=W,t.substr(W,2)===mu?(V=mu,W+=2):(V=r,dt===0&&wt(Bl)),V!==r?(re=W,ge=W,Ye=ds(),Ye!==r?(At=ds(),At!==r?(hr=ds(),hr!==r?(Ir=ds(),Ir!==r?(Ye=[Ye,At,hr,Ir],ge=Ye):(W=ge,ge=r)):(W=ge,ge=r)):(W=ge,ge=r)):(W=ge,ge=r),ge!==r?re=t.substring(re,W):re=ge,re!==r?(xt=L,V=la(re),L=V):(W=L,L=r)):(W=L,L=r),L===r&&(L=W,t.substr(W,2)===dn?(V=dn,W+=2):(V=r,dt===0&&wt(No)),V!==r?(re=W,ge=W,Ye=ds(),Ye!==r?(At=ds(),At!==r?(hr=ds(),hr!==r?(Ir=ds(),Ir!==r?(Rn=ds(),Rn!==r?(ai=ds(),ai!==r?(ns=ds(),ns!==r?(GA=ds(),GA!==r?(Ye=[Ye,At,hr,Ir,Rn,ai,ns,GA],ge=Ye):(W=ge,ge=r)):(W=ge,ge=r)):(W=ge,ge=r)):(W=ge,ge=r)):(W=ge,ge=r)):(W=ge,ge=r)):(W=ge,ge=r)):(W=ge,ge=r),ge!==r?re=t.substring(re,W):re=ge,re!==r?(xt=L,V=RA(re),L=V):(W=L,L=r)):(W=L,L=r)))),L}function _o(){var L;return TA.test(t.charAt(W))?(L=t.charAt(W),W++):(L=r,dt===0&&wt(Oo)),L}function ds(){var L;return qa.test(t.charAt(W))?(L=t.charAt(W),W++):(L=r,dt===0&&wt(Ot)),L}function dp(){var L,V,re,ge,Ye;if(L=W,V=[],re=W,t.charCodeAt(W)===92?(ge=Ro,W++):(ge=r,dt===0&&wt(To)),ge!==r?(t.length>W?(Ye=t.charAt(W),W++):(Ye=r,dt===0&&wt(vn)),Ye!==r?(xt=re,ge=Me(Ye),re=ge):(W=re,re=r)):(W=re,re=r),re===r&&(re=W,t.substr(W,2)===Mo?(ge=Mo,W+=2):(ge=r,dt===0&&wt(ua)),ge!==r&&(xt=re,ge=qi()),re=ge,re===r&&(re=W,ge=W,dt++,Ye=Qd(),dt--,Ye===r?ge=void 0:(W=ge,ge=r),ge!==r?(t.length>W?(Ye=t.charAt(W),W++):(Ye=r,dt===0&&wt(vn)),Ye!==r?(xt=re,ge=Me(Ye),re=ge):(W=re,re=r)):(W=re,re=r))),re!==r)for(;re!==r;)V.push(re),re=W,t.charCodeAt(W)===92?(ge=Ro,W++):(ge=r,dt===0&&wt(To)),ge!==r?(t.length>W?(Ye=t.charAt(W),W++):(Ye=r,dt===0&&wt(vn)),Ye!==r?(xt=re,ge=Me(Ye),re=ge):(W=re,re=r)):(W=re,re=r),re===r&&(re=W,t.substr(W,2)===Mo?(ge=Mo,W+=2):(ge=r,dt===0&&wt(ua)),ge!==r&&(xt=re,ge=qi()),re=ge,re===r&&(re=W,ge=W,dt++,Ye=Qd(),dt--,Ye===r?ge=void 0:(W=ge,ge=r),ge!==r?(t.length>W?(Ye=t.charAt(W),W++):(Ye=r,dt===0&&wt(vn)),Ye!==r?(xt=re,ge=Me(Ye),re=ge):(W=re,re=r)):(W=re,re=r)));else V=r;return V!==r&&(xt=L,V=Ts(V)),L=V,L}function qA(){var L,V,re,ge,Ye,At;if(L=W,t.charCodeAt(W)===45?(V=vl,W++):(V=r,dt===0&&wt(Cc)),V===r&&(t.charCodeAt(W)===43?(V=Dl,W++):(V=r,dt===0&&wt(Aa))),V===r&&(V=null),V!==r){if(re=[],tt.test(t.charAt(W))?(ge=t.charAt(W),W++):(ge=r,dt===0&&wt(He)),ge!==r)for(;ge!==r;)re.push(ge),tt.test(t.charAt(W))?(ge=t.charAt(W),W++):(ge=r,dt===0&&wt(He));else re=r;if(re!==r)if(t.charCodeAt(W)===46?(ge=Di,W++):(ge=r,dt===0&&wt(rs)),ge!==r){if(Ye=[],tt.test(t.charAt(W))?(At=t.charAt(W),W++):(At=r,dt===0&&wt(He)),At!==r)for(;At!==r;)Ye.push(At),tt.test(t.charAt(W))?(At=t.charAt(W),W++):(At=r,dt===0&&wt(He));else Ye=r;Ye!==r?(xt=L,V=ja(V,re,Ye),L=V):(W=L,L=r)}else W=L,L=r;else W=L,L=r}else W=L,L=r;if(L===r){if(L=W,t.charCodeAt(W)===45?(V=vl,W++):(V=r,dt===0&&wt(Cc)),V===r&&(t.charCodeAt(W)===43?(V=Dl,W++):(V=r,dt===0&&wt(Aa))),V===r&&(V=null),V!==r){if(re=[],tt.test(t.charAt(W))?(ge=t.charAt(W),W++):(ge=r,dt===0&&wt(He)),ge!==r)for(;ge!==r;)re.push(ge),tt.test(t.charAt(W))?(ge=t.charAt(W),W++):(ge=r,dt===0&&wt(He));else re=r;re!==r?(xt=L,V=yu(V,re),L=V):(W=L,L=r)}else W=L,L=r;if(L===r&&(L=W,V=jA(),V!==r&&(xt=L,V=Pl(V)),L=V,L===r&&(L=W,V=xl(),V!==r&&(xt=L,V=pi(V)),L=V,L===r)))if(L=W,t.charCodeAt(W)===40?(V=Ce,W++):(V=r,dt===0&&wt(fe)),V!==r){for(re=[],ge=bt();ge!==r;)re.push(ge),ge=bt();if(re!==r)if(ge=Ns(),ge!==r){for(Ye=[],At=bt();At!==r;)Ye.push(At),At=bt();Ye!==r?(t.charCodeAt(W)===41?(At=ie,W++):(At=r,dt===0&&wt(Z)),At!==r?(xt=L,V=Dn(ge),L=V):(W=L,L=r)):(W=L,L=r)}else W=L,L=r;else W=L,L=r}else W=L,L=r}return L}function Su(){var L,V,re,ge,Ye,At,hr,Ir;if(L=W,V=qA(),V!==r){for(re=[],ge=W,Ye=[],At=bt();At!==r;)Ye.push(At),At=bt();if(Ye!==r)if(t.charCodeAt(W)===42?(At=Sl,W++):(At=r,dt===0&&wt(ze)),At===r&&(t.charCodeAt(W)===47?(At=it,W++):(At=r,dt===0&&wt(vt))),At!==r){for(hr=[],Ir=bt();Ir!==r;)hr.push(Ir),Ir=bt();hr!==r?(Ir=qA(),Ir!==r?(xt=ge,Ye=ar(V,At,Ir),ge=Ye):(W=ge,ge=r)):(W=ge,ge=r)}else W=ge,ge=r;else W=ge,ge=r;for(;ge!==r;){for(re.push(ge),ge=W,Ye=[],At=bt();At!==r;)Ye.push(At),At=bt();if(Ye!==r)if(t.charCodeAt(W)===42?(At=Sl,W++):(At=r,dt===0&&wt(ze)),At===r&&(t.charCodeAt(W)===47?(At=it,W++):(At=r,dt===0&&wt(vt))),At!==r){for(hr=[],Ir=bt();Ir!==r;)hr.push(Ir),Ir=bt();hr!==r?(Ir=qA(),Ir!==r?(xt=ge,Ye=ar(V,At,Ir),ge=Ye):(W=ge,ge=r)):(W=ge,ge=r)}else W=ge,ge=r;else W=ge,ge=r}re!==r?(xt=L,V=ee(V,re),L=V):(W=L,L=r)}else W=L,L=r;return L}function Ns(){var L,V,re,ge,Ye,At,hr,Ir;if(L=W,V=Su(),V!==r){for(re=[],ge=W,Ye=[],At=bt();At!==r;)Ye.push(At),At=bt();if(Ye!==r)if(t.charCodeAt(W)===43?(At=Dl,W++):(At=r,dt===0&&wt(Aa)),At===r&&(t.charCodeAt(W)===45?(At=vl,W++):(At=r,dt===0&&wt(Cc))),At!==r){for(hr=[],Ir=bt();Ir!==r;)hr.push(Ir),Ir=bt();hr!==r?(Ir=Su(),Ir!==r?(xt=ge,Ye=ye(V,At,Ir),ge=Ye):(W=ge,ge=r)):(W=ge,ge=r)}else W=ge,ge=r;else W=ge,ge=r;for(;ge!==r;){for(re.push(ge),ge=W,Ye=[],At=bt();At!==r;)Ye.push(At),At=bt();if(Ye!==r)if(t.charCodeAt(W)===43?(At=Dl,W++):(At=r,dt===0&&wt(Aa)),At===r&&(t.charCodeAt(W)===45?(At=vl,W++):(At=r,dt===0&&wt(Cc))),At!==r){for(hr=[],Ir=bt();Ir!==r;)hr.push(Ir),Ir=bt();hr!==r?(Ir=Su(),Ir!==r?(xt=ge,Ye=ye(V,At,Ir),ge=Ye):(W=ge,ge=r)):(W=ge,ge=r)}else W=ge,ge=r;else W=ge,ge=r}re!==r?(xt=L,V=ee(V,re),L=V):(W=L,L=r)}else W=L,L=r;return L}function Kr(){var L,V,re,ge,Ye,At;if(L=W,t.substr(W,3)===Ne?(V=Ne,W+=3):(V=r,dt===0&&wt(gt)),V!==r){for(re=[],ge=bt();ge!==r;)re.push(ge),ge=bt();if(re!==r)if(ge=Ns(),ge!==r){for(Ye=[],At=bt();At!==r;)Ye.push(At),At=bt();Ye!==r?(t.substr(W,2)===mt?(At=mt,W+=2):(At=r,dt===0&&wt(Dt)),At!==r?(xt=L,V=er(ge),L=V):(W=L,L=r)):(W=L,L=r)}else W=L,L=r;else W=L,L=r}else W=L,L=r;return L}function mp(){var L,V,re,ge;return L=W,t.substr(W,2)===sn?(V=sn,W+=2):(V=r,dt===0&&wt(ei)),V!==r?(re=Uo(),re!==r?(t.charCodeAt(W)===41?(ge=ie,W++):(ge=r,dt===0&&wt(Z)),ge!==r?(xt=L,V=Qi(re),L=V):(W=L,L=r)):(W=L,L=r)):(W=L,L=r),L}function jA(){var L,V,re,ge,Ye,At;return L=W,t.substr(W,2)===Pn?(V=Pn,W+=2):(V=r,dt===0&&wt(fa)),V!==r?(re=xl(),re!==r?(t.substr(W,2)===wd?(ge=wd,W+=2):(ge=r,dt===0&&wt(BI)),ge!==r?(Ye=gs(),Ye!==r?(t.charCodeAt(W)===125?(At=q,W++):(At=r,dt===0&&wt(nt)),At!==r?(xt=L,V=eo(re,Ye),L=V):(W=L,L=r)):(W=L,L=r)):(W=L,L=r)):(W=L,L=r)):(W=L,L=r),L===r&&(L=W,t.substr(W,2)===Pn?(V=Pn,W+=2):(V=r,dt===0&&wt(fa)),V!==r?(re=xl(),re!==r?(t.substr(W,3)===Bd?(ge=Bd,W+=3):(ge=r,dt===0&&wt(cp)),ge!==r?(xt=L,V=vI(re),L=V):(W=L,L=r)):(W=L,L=r)):(W=L,L=r),L===r&&(L=W,t.substr(W,2)===Pn?(V=Pn,W+=2):(V=r,dt===0&&wt(fa)),V!==r?(re=xl(),re!==r?(t.substr(W,2)===to?(ge=to,W+=2):(ge=r,dt===0&&wt(up)),ge!==r?(Ye=gs(),Ye!==r?(t.charCodeAt(W)===125?(At=q,W++):(At=r,dt===0&&wt(nt)),At!==r?(xt=L,V=Ap(re,Ye),L=V):(W=L,L=r)):(W=L,L=r)):(W=L,L=r)):(W=L,L=r)):(W=L,L=r),L===r&&(L=W,t.substr(W,2)===Pn?(V=Pn,W+=2):(V=r,dt===0&&wt(fa)),V!==r?(re=xl(),re!==r?(t.substr(W,3)===Ic?(ge=Ic,W+=3):(ge=r,dt===0&&wt(fp)),ge!==r?(xt=L,V=s0(re),L=V):(W=L,L=r)):(W=L,L=r)):(W=L,L=r),L===r&&(L=W,t.substr(W,2)===Pn?(V=Pn,W+=2):(V=r,dt===0&&wt(fa)),V!==r?(re=xl(),re!==r?(t.charCodeAt(W)===125?(ge=q,W++):(ge=r,dt===0&&wt(nt)),ge!==r?(xt=L,V=o0(re),L=V):(W=L,L=r)):(W=L,L=r)):(W=L,L=r),L===r&&(L=W,t.charCodeAt(W)===36?(V=a0,W++):(V=r,dt===0&&wt(vd)),V!==r?(re=xl(),re!==r?(xt=L,V=o0(re),L=V):(W=L,L=r)):(W=L,L=r)))))),L}function kd(){var L,V,re;return L=W,V=d0(),V!==r?(xt=W,re=Eu(V),re?re=void 0:re=r,re!==r?(xt=L,V=ro(V),L=V):(W=L,L=r)):(W=L,L=r),L}function d0(){var L,V,re,ge,Ye;if(L=W,V=[],re=W,ge=W,dt++,Ye=Ep(),dt--,Ye===r?ge=void 0:(W=ge,ge=r),ge!==r?(t.length>W?(Ye=t.charAt(W),W++):(Ye=r,dt===0&&wt(vn)),Ye!==r?(xt=re,ge=Me(Ye),re=ge):(W=re,re=r)):(W=re,re=r),re!==r)for(;re!==r;)V.push(re),re=W,ge=W,dt++,Ye=Ep(),dt--,Ye===r?ge=void 0:(W=ge,ge=r),ge!==r?(t.length>W?(Ye=t.charAt(W),W++):(Ye=r,dt===0&&wt(vn)),Ye!==r?(xt=re,ge=Me(Ye),re=ge):(W=re,re=r)):(W=re,re=r);else V=r;return V!==r&&(xt=L,V=Ts(V)),L=V,L}function yp(){var L,V,re;if(L=W,V=[],Ga.test(t.charAt(W))?(re=t.charAt(W),W++):(re=r,dt===0&&wt(pp)),re!==r)for(;re!==r;)V.push(re),Ga.test(t.charAt(W))?(re=t.charAt(W),W++):(re=r,dt===0&&wt(pp));else V=r;return V!==r&&(xt=L,V=l0()),L=V,L}function xl(){var L,V,re;if(L=W,V=[],Wa.test(t.charAt(W))?(re=t.charAt(W),W++):(re=r,dt===0&&wt(Ya)),re!==r)for(;re!==r;)V.push(re),Wa.test(t.charAt(W))?(re=t.charAt(W),W++):(re=r,dt===0&&wt(Ya));else V=r;return V!==r&&(xt=L,V=l0()),L=V,L}function Qd(){var L;return Dd.test(t.charAt(W))?(L=t.charAt(W),W++):(L=r,dt===0&&wt(LA)),L}function Ep(){var L;return Pd.test(t.charAt(W))?(L=t.charAt(W),W++):(L=r,dt===0&&wt(Sd)),L}function bt(){var L,V;if(L=[],NA.test(t.charAt(W))?(V=t.charAt(W),W++):(V=r,dt===0&&wt(OA)),V!==r)for(;V!==r;)L.push(V),NA.test(t.charAt(W))?(V=t.charAt(W),W++):(V=r,dt===0&&wt(OA));else L=r;return L}if(wc=a(),wc!==r&&W===t.length)return wc;throw wc!==r&&W!1}){try{return(0,OY.parse)(t,e)}catch(r){throw r.location&&(r.message=r.message.replace(/(\.)?$/,` (line ${r.location.start.line}, column ${r.location.start.column})$1`)),r}}function dm(t,{endSemicolon:e=!1}={}){return t.map(({command:r,type:o},a)=>`${AP(r)}${o===";"?a!==t.length-1||e?";":"":" &"}`).join(" ")}function AP(t){return`${mm(t.chain)}${t.then?` ${UT(t.then)}`:""}`}function UT(t){return`${t.type} ${AP(t.line)}`}function mm(t){return`${HT(t)}${t.then?` ${_T(t.then)}`:""}`}function _T(t){return`${t.type} ${mm(t.chain)}`}function HT(t){switch(t.type){case"command":return`${t.envs.length>0?`${t.envs.map(e=>cP(e)).join(" ")} `:""}${t.args.map(e=>qT(e)).join(" ")}`;case"subshell":return`(${dm(t.subshell)})${t.args.length>0?` ${t.args.map(e=>fw(e)).join(" ")}`:""}`;case"group":return`{ ${dm(t.group,{endSemicolon:!0})} }${t.args.length>0?` ${t.args.map(e=>fw(e)).join(" ")}`:""}`;case"envs":return t.envs.map(e=>cP(e)).join(" ");default:throw new Error(`Unsupported command type: "${t.type}"`)}}function cP(t){return`${t.name}=${t.args[0]?z0(t.args[0]):""}`}function qT(t){switch(t.type){case"redirection":return fw(t);case"argument":return z0(t);default:throw new Error(`Unsupported argument type: "${t.type}"`)}}function fw(t){return`${t.subtype} ${t.args.map(e=>z0(e)).join(" ")}`}function z0(t){return t.segments.map(e=>jT(e)).join("")}function jT(t){let e=(o,a)=>a?`"${o}"`:o,r=o=>o===""?"''":o.match(/[()}<>$|&;"'\n\t ]/)?o.match(/['\t\p{C}]/u)?o.match(/'/)?`"${o.replace(/["$\t\p{C}]/u,$_e)}"`:`$'${o.replace(/[\t\p{C}]/u,UY)}'`:`'${o}'`:o;switch(t.type){case"text":return r(t.text);case"glob":return t.pattern;case"shell":return e(`$(${dm(t.shell)})`,t.quoted);case"variable":return e(typeof t.defaultValue>"u"?typeof t.alternativeValue>"u"?`\${${t.name}}`:t.alternativeValue.length===0?`\${${t.name}:+}`:`\${${t.name}:+${t.alternativeValue.map(o=>z0(o)).join(" ")}}`:t.defaultValue.length===0?`\${${t.name}:-}`:`\${${t.name}:-${t.defaultValue.map(o=>z0(o)).join(" ")}}`,t.quoted);case"arithmetic":return`$(( ${fP(t.arithmetic)} ))`;default:throw new Error(`Unsupported argument segment type: "${t.type}"`)}}function fP(t){let e=a=>{switch(a){case"addition":return"+";case"subtraction":return"-";case"multiplication":return"*";case"division":return"/";default:throw new Error(`Can't extract operator from arithmetic expression of type "${a}"`)}},r=(a,n)=>n?`( ${a} )`:a,o=a=>r(fP(a),!["number","variable"].includes(a.type));switch(t.type){case"number":return String(t.value);case"variable":return t.name;default:return`${o(t.left)} ${e(t.type)} ${o(t.right)}`}}var OY,MY,Z_e,UY,$_e,_Y=It(()=>{OY=et(NY());MY=new Map([["\f","\\f"],[` `,"\\n"],["\r","\\r"],[" ","\\t"],["\v","\\v"],["\0","\\0"]]),Z_e=new Map([["\\","\\\\"],["$","\\$"],['"','\\"'],...Array.from(MY,([t,e])=>[t,`"$'${e}'"`])]),UY=t=>MY.get(t)??`\\x${t.charCodeAt(0).toString(16).padStart(2,"0")}`,$_e=t=>Z_e.get(t)??`"$'${UY(t)}'"`});var qY=_((dxt,HY)=>{"use strict";function e8e(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}function J0(t,e,r,o){this.message=t,this.expected=e,this.found=r,this.location=o,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,J0)}e8e(J0,Error);J0.buildMessage=function(t,e){var r={literal:function(h){return'"'+a(h.text)+'"'},class:function(h){var E="",w;for(w=0;w0){for(w=1,D=1;wce&&(ce=z,ue=[]),ue.push(He))}function nt(He,x){return new J0(He,null,null,x)}function Le(He,x,I){return new J0(J0.buildMessage(He,x),He,x,I)}function Te(){var He,x,I,S;return He=z,x=ke(),x!==r?(t.charCodeAt(z)===47?(I=n,z++):(I=r,Ie===0&&q(u)),I!==r?(S=ke(),S!==r?(te=He,x=A(x,S),He=x):(z=He,He=r)):(z=He,He=r)):(z=He,He=r),He===r&&(He=z,x=ke(),x!==r&&(te=He,x=p(x)),He=x),He}function ke(){var He,x,I,S;return He=z,x=Ve(),x!==r?(t.charCodeAt(z)===64?(I=h,z++):(I=r,Ie===0&&q(E)),I!==r?(S=tt(),S!==r?(te=He,x=w(x,S),He=x):(z=He,He=r)):(z=He,He=r)):(z=He,He=r),He===r&&(He=z,x=Ve(),x!==r&&(te=He,x=D(x)),He=x),He}function Ve(){var He,x,I,S,y;return He=z,t.charCodeAt(z)===64?(x=h,z++):(x=r,Ie===0&&q(E)),x!==r?(I=xe(),I!==r?(t.charCodeAt(z)===47?(S=n,z++):(S=r,Ie===0&&q(u)),S!==r?(y=xe(),y!==r?(te=He,x=b(),He=x):(z=He,He=r)):(z=He,He=r)):(z=He,He=r)):(z=He,He=r),He===r&&(He=z,x=xe(),x!==r&&(te=He,x=b()),He=x),He}function xe(){var He,x,I;if(He=z,x=[],C.test(t.charAt(z))?(I=t.charAt(z),z++):(I=r,Ie===0&&q(T)),I!==r)for(;I!==r;)x.push(I),C.test(t.charAt(z))?(I=t.charAt(z),z++):(I=r,Ie===0&&q(T));else x=r;return x!==r&&(te=He,x=b()),He=x,He}function tt(){var He,x,I;if(He=z,x=[],N.test(t.charAt(z))?(I=t.charAt(z),z++):(I=r,Ie===0&&q(U)),I!==r)for(;I!==r;)x.push(I),N.test(t.charAt(z))?(I=t.charAt(z),z++):(I=r,Ie===0&&q(U));else x=r;return x!==r&&(te=He,x=b()),He=x,He}if(he=a(),he!==r&&z===t.length)return he;throw he!==r&&z{jY=et(qY())});var Z0=_((yxt,X0)=>{"use strict";function WY(t){return typeof t>"u"||t===null}function r8e(t){return typeof t=="object"&&t!==null}function n8e(t){return Array.isArray(t)?t:WY(t)?[]:[t]}function i8e(t,e){var r,o,a,n;if(e)for(n=Object.keys(e),r=0,o=n.length;r{"use strict";function pw(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=(this.reason||"(unknown reason)")+(this.mark?" "+this.mark.toString():""),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}pw.prototype=Object.create(Error.prototype);pw.prototype.constructor=pw;pw.prototype.toString=function(e){var r=this.name+": ";return r+=this.reason||"(unknown reason)",!e&&this.mark&&(r+=" "+this.mark.toString()),r};YY.exports=pw});var zY=_((Cxt,VY)=>{"use strict";var KY=Z0();function GT(t,e,r,o,a){this.name=t,this.buffer=e,this.position=r,this.line=o,this.column=a}GT.prototype.getSnippet=function(e,r){var o,a,n,u,A;if(!this.buffer)return null;for(e=e||4,r=r||75,o="",a=this.position;a>0&&`\0\r \x85\u2028\u2029`.indexOf(this.buffer.charAt(a-1))===-1;)if(a-=1,this.position-a>r/2-1){o=" ... ",a+=5;break}for(n="",u=this.position;ur/2-1){n=" ... ",u-=5;break}return A=this.buffer.slice(a,u),KY.repeat(" ",e)+o+A+n+` `+KY.repeat(" ",e+this.position-a+o.length)+"^"};GT.prototype.toString=function(e){var r,o="";return this.name&&(o+='in "'+this.name+'" '),o+="at line "+(this.line+1)+", column "+(this.column+1),e||(r=this.getSnippet(),r&&(o+=`: `+r)),o};VY.exports=GT});var as=_((Ixt,XY)=>{"use strict";var JY=ym(),a8e=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],l8e=["scalar","sequence","mapping"];function c8e(t){var e={};return t!==null&&Object.keys(t).forEach(function(r){t[r].forEach(function(o){e[String(o)]=r})}),e}function u8e(t,e){if(e=e||{},Object.keys(e).forEach(function(r){if(a8e.indexOf(r)===-1)throw new JY('Unknown option "'+r+'" is met in definition of "'+t+'" YAML type.')}),this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(r){return r},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.defaultStyle=e.defaultStyle||null,this.styleAliases=c8e(e.styleAliases||null),l8e.indexOf(this.kind)===-1)throw new JY('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}XY.exports=u8e});var $0=_((wxt,$Y)=>{"use strict";var ZY=Z0(),gP=ym(),A8e=as();function WT(t,e,r){var o=[];return t.include.forEach(function(a){r=WT(a,e,r)}),t[e].forEach(function(a){r.forEach(function(n,u){n.tag===a.tag&&n.kind===a.kind&&o.push(u)}),r.push(a)}),r.filter(function(a,n){return o.indexOf(n)===-1})}function f8e(){var t={scalar:{},sequence:{},mapping:{},fallback:{}},e,r;function o(a){t[a.kind][a.tag]=t.fallback[a.tag]=a}for(e=0,r=arguments.length;e{"use strict";var p8e=as();eK.exports=new p8e("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return t!==null?t:""}})});var nK=_((vxt,rK)=>{"use strict";var h8e=as();rK.exports=new h8e("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return t!==null?t:[]}})});var sK=_((Dxt,iK)=>{"use strict";var g8e=as();iK.exports=new g8e("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return t!==null?t:{}}})});var dP=_((Pxt,oK)=>{"use strict";var d8e=$0();oK.exports=new d8e({explicit:[tK(),nK(),sK()]})});var lK=_((Sxt,aK)=>{"use strict";var m8e=as();function y8e(t){if(t===null)return!0;var e=t.length;return e===1&&t==="~"||e===4&&(t==="null"||t==="Null"||t==="NULL")}function E8e(){return null}function C8e(t){return t===null}aK.exports=new m8e("tag:yaml.org,2002:null",{kind:"scalar",resolve:y8e,construct:E8e,predicate:C8e,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})});var uK=_((xxt,cK)=>{"use strict";var I8e=as();function w8e(t){if(t===null)return!1;var e=t.length;return e===4&&(t==="true"||t==="True"||t==="TRUE")||e===5&&(t==="false"||t==="False"||t==="FALSE")}function B8e(t){return t==="true"||t==="True"||t==="TRUE"}function v8e(t){return Object.prototype.toString.call(t)==="[object Boolean]"}cK.exports=new I8e("tag:yaml.org,2002:bool",{kind:"scalar",resolve:w8e,construct:B8e,predicate:v8e,represent:{lowercase:function(t){return t?"true":"false"},uppercase:function(t){return t?"TRUE":"FALSE"},camelcase:function(t){return t?"True":"False"}},defaultStyle:"lowercase"})});var fK=_((bxt,AK)=>{"use strict";var D8e=Z0(),P8e=as();function S8e(t){return 48<=t&&t<=57||65<=t&&t<=70||97<=t&&t<=102}function x8e(t){return 48<=t&&t<=55}function b8e(t){return 48<=t&&t<=57}function k8e(t){if(t===null)return!1;var e=t.length,r=0,o=!1,a;if(!e)return!1;if(a=t[r],(a==="-"||a==="+")&&(a=t[++r]),a==="0"){if(r+1===e)return!0;if(a=t[++r],a==="b"){for(r++;r=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},octal:function(t){return t>=0?"0"+t.toString(8):"-0"+t.toString(8).slice(1)},decimal:function(t){return t.toString(10)},hexadecimal:function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})});var gK=_((kxt,hK)=>{"use strict";var pK=Z0(),R8e=as(),T8e=new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function L8e(t){return!(t===null||!T8e.test(t)||t[t.length-1]==="_")}function N8e(t){var e,r,o,a;return e=t.replace(/_/g,"").toLowerCase(),r=e[0]==="-"?-1:1,a=[],"+-".indexOf(e[0])>=0&&(e=e.slice(1)),e===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:e===".nan"?NaN:e.indexOf(":")>=0?(e.split(":").forEach(function(n){a.unshift(parseFloat(n,10))}),e=0,o=1,a.forEach(function(n){e+=n*o,o*=60}),r*e):r*parseFloat(e,10)}var O8e=/^[-+]?[0-9]+e/;function M8e(t,e){var r;if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(pK.isNegativeZero(t))return"-0.0";return r=t.toString(10),O8e.test(r)?r.replace("e",".e"):r}function U8e(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!==0||pK.isNegativeZero(t))}hK.exports=new R8e("tag:yaml.org,2002:float",{kind:"scalar",resolve:L8e,construct:N8e,predicate:U8e,represent:M8e,defaultStyle:"lowercase"})});var YT=_((Qxt,dK)=>{"use strict";var _8e=$0();dK.exports=new _8e({include:[dP()],implicit:[lK(),uK(),fK(),gK()]})});var KT=_((Fxt,mK)=>{"use strict";var H8e=$0();mK.exports=new H8e({include:[YT()]})});var IK=_((Rxt,CK)=>{"use strict";var q8e=as(),yK=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),EK=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function j8e(t){return t===null?!1:yK.exec(t)!==null||EK.exec(t)!==null}function G8e(t){var e,r,o,a,n,u,A,p=0,h=null,E,w,D;if(e=yK.exec(t),e===null&&(e=EK.exec(t)),e===null)throw new Error("Date resolve error");if(r=+e[1],o=+e[2]-1,a=+e[3],!e[4])return new Date(Date.UTC(r,o,a));if(n=+e[4],u=+e[5],A=+e[6],e[7]){for(p=e[7].slice(0,3);p.length<3;)p+="0";p=+p}return e[9]&&(E=+e[10],w=+(e[11]||0),h=(E*60+w)*6e4,e[9]==="-"&&(h=-h)),D=new Date(Date.UTC(r,o,a,n,u,A,p)),h&&D.setTime(D.getTime()-h),D}function W8e(t){return t.toISOString()}CK.exports=new q8e("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:j8e,construct:G8e,instanceOf:Date,represent:W8e})});var BK=_((Txt,wK)=>{"use strict";var Y8e=as();function K8e(t){return t==="<<"||t===null}wK.exports=new Y8e("tag:yaml.org,2002:merge",{kind:"scalar",resolve:K8e})});var PK=_((Lxt,DK)=>{"use strict";var eg;try{vK=ve,eg=vK("buffer").Buffer}catch{}var vK,V8e=as(),VT=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/= \r`;function z8e(t){if(t===null)return!1;var e,r,o=0,a=t.length,n=VT;for(r=0;r64)){if(e<0)return!1;o+=6}return o%8===0}function J8e(t){var e,r,o=t.replace(/[\r\n=]/g,""),a=o.length,n=VT,u=0,A=[];for(e=0;e>16&255),A.push(u>>8&255),A.push(u&255)),u=u<<6|n.indexOf(o.charAt(e));return r=a%4*6,r===0?(A.push(u>>16&255),A.push(u>>8&255),A.push(u&255)):r===18?(A.push(u>>10&255),A.push(u>>2&255)):r===12&&A.push(u>>4&255),eg?eg.from?eg.from(A):new eg(A):A}function X8e(t){var e="",r=0,o,a,n=t.length,u=VT;for(o=0;o>18&63],e+=u[r>>12&63],e+=u[r>>6&63],e+=u[r&63]),r=(r<<8)+t[o];return a=n%3,a===0?(e+=u[r>>18&63],e+=u[r>>12&63],e+=u[r>>6&63],e+=u[r&63]):a===2?(e+=u[r>>10&63],e+=u[r>>4&63],e+=u[r<<2&63],e+=u[64]):a===1&&(e+=u[r>>2&63],e+=u[r<<4&63],e+=u[64],e+=u[64]),e}function Z8e(t){return eg&&eg.isBuffer(t)}DK.exports=new V8e("tag:yaml.org,2002:binary",{kind:"scalar",resolve:z8e,construct:J8e,predicate:Z8e,represent:X8e})});var xK=_((Oxt,SK)=>{"use strict";var $8e=as(),eHe=Object.prototype.hasOwnProperty,tHe=Object.prototype.toString;function rHe(t){if(t===null)return!0;var e=[],r,o,a,n,u,A=t;for(r=0,o=A.length;r{"use strict";var iHe=as(),sHe=Object.prototype.toString;function oHe(t){if(t===null)return!0;var e,r,o,a,n,u=t;for(n=new Array(u.length),e=0,r=u.length;e{"use strict";var lHe=as(),cHe=Object.prototype.hasOwnProperty;function uHe(t){if(t===null)return!0;var e,r=t;for(e in r)if(cHe.call(r,e)&&r[e]!==null)return!1;return!0}function AHe(t){return t!==null?t:{}}QK.exports=new lHe("tag:yaml.org,2002:set",{kind:"mapping",resolve:uHe,construct:AHe})});var Cm=_((_xt,RK)=>{"use strict";var fHe=$0();RK.exports=new fHe({include:[KT()],implicit:[IK(),BK()],explicit:[PK(),xK(),kK(),FK()]})});var LK=_((Hxt,TK)=>{"use strict";var pHe=as();function hHe(){return!0}function gHe(){}function dHe(){return""}function mHe(t){return typeof t>"u"}TK.exports=new pHe("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:hHe,construct:gHe,predicate:mHe,represent:dHe})});var OK=_((qxt,NK)=>{"use strict";var yHe=as();function EHe(t){if(t===null||t.length===0)return!1;var e=t,r=/\/([gim]*)$/.exec(t),o="";return!(e[0]==="/"&&(r&&(o=r[1]),o.length>3||e[e.length-o.length-1]!=="/"))}function CHe(t){var e=t,r=/\/([gim]*)$/.exec(t),o="";return e[0]==="/"&&(r&&(o=r[1]),e=e.slice(1,e.length-o.length-1)),new RegExp(e,o)}function IHe(t){var e="/"+t.source+"/";return t.global&&(e+="g"),t.multiline&&(e+="m"),t.ignoreCase&&(e+="i"),e}function wHe(t){return Object.prototype.toString.call(t)==="[object RegExp]"}NK.exports=new yHe("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:EHe,construct:CHe,predicate:wHe,represent:IHe})});var _K=_((jxt,UK)=>{"use strict";var mP;try{MK=ve,mP=MK("esprima")}catch{typeof window<"u"&&(mP=window.esprima)}var MK,BHe=as();function vHe(t){if(t===null)return!1;try{var e="("+t+")",r=mP.parse(e,{range:!0});return!(r.type!=="Program"||r.body.length!==1||r.body[0].type!=="ExpressionStatement"||r.body[0].expression.type!=="ArrowFunctionExpression"&&r.body[0].expression.type!=="FunctionExpression")}catch{return!1}}function DHe(t){var e="("+t+")",r=mP.parse(e,{range:!0}),o=[],a;if(r.type!=="Program"||r.body.length!==1||r.body[0].type!=="ExpressionStatement"||r.body[0].expression.type!=="ArrowFunctionExpression"&&r.body[0].expression.type!=="FunctionExpression")throw new Error("Failed to resolve function");return r.body[0].expression.params.forEach(function(n){o.push(n.name)}),a=r.body[0].expression.body.range,r.body[0].expression.body.type==="BlockStatement"?new Function(o,e.slice(a[0]+1,a[1]-1)):new Function(o,"return "+e.slice(a[0],a[1]))}function PHe(t){return t.toString()}function SHe(t){return Object.prototype.toString.call(t)==="[object Function]"}UK.exports=new BHe("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:vHe,construct:DHe,predicate:SHe,represent:PHe})});var hw=_((Wxt,qK)=>{"use strict";var HK=$0();qK.exports=HK.DEFAULT=new HK({include:[Cm()],explicit:[LK(),OK(),_K()]})});var aV=_((Yxt,gw)=>{"use strict";var mf=Z0(),zK=ym(),xHe=zY(),JK=Cm(),bHe=hw(),Vp=Object.prototype.hasOwnProperty,yP=1,XK=2,ZK=3,EP=4,zT=1,kHe=2,jK=3,QHe=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,FHe=/[\x85\u2028\u2029]/,RHe=/[,\[\]\{\}]/,$K=/^(?:!|!!|![a-z\-]+!)$/i,eV=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function GK(t){return Object.prototype.toString.call(t)}function Wu(t){return t===10||t===13}function rg(t){return t===9||t===32}function Da(t){return t===9||t===32||t===10||t===13}function Im(t){return t===44||t===91||t===93||t===123||t===125}function THe(t){var e;return 48<=t&&t<=57?t-48:(e=t|32,97<=e&&e<=102?e-97+10:-1)}function LHe(t){return t===120?2:t===117?4:t===85?8:0}function NHe(t){return 48<=t&&t<=57?t-48:-1}function WK(t){return t===48?"\0":t===97?"\x07":t===98?"\b":t===116||t===9?" ":t===110?` `:t===118?"\v":t===102?"\f":t===114?"\r":t===101?"\x1B":t===32?" ":t===34?'"':t===47?"/":t===92?"\\":t===78?"\x85":t===95?"\xA0":t===76?"\u2028":t===80?"\u2029":""}function OHe(t){return t<=65535?String.fromCharCode(t):String.fromCharCode((t-65536>>10)+55296,(t-65536&1023)+56320)}var tV=new Array(256),rV=new Array(256);for(tg=0;tg<256;tg++)tV[tg]=WK(tg)?1:0,rV[tg]=WK(tg);var tg;function MHe(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||bHe,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function nV(t,e){return new zK(e,new xHe(t.filename,t.input,t.position,t.line,t.position-t.lineStart))}function Qr(t,e){throw nV(t,e)}function CP(t,e){t.onWarning&&t.onWarning.call(null,nV(t,e))}var YK={YAML:function(e,r,o){var a,n,u;e.version!==null&&Qr(e,"duplication of %YAML directive"),o.length!==1&&Qr(e,"YAML directive accepts exactly one argument"),a=/^([0-9]+)\.([0-9]+)$/.exec(o[0]),a===null&&Qr(e,"ill-formed argument of the YAML directive"),n=parseInt(a[1],10),u=parseInt(a[2],10),n!==1&&Qr(e,"unacceptable YAML version of the document"),e.version=o[0],e.checkLineBreaks=u<2,u!==1&&u!==2&&CP(e,"unsupported YAML version of the document")},TAG:function(e,r,o){var a,n;o.length!==2&&Qr(e,"TAG directive accepts exactly two arguments"),a=o[0],n=o[1],$K.test(a)||Qr(e,"ill-formed tag handle (first argument) of the TAG directive"),Vp.call(e.tagMap,a)&&Qr(e,'there is a previously declared suffix for "'+a+'" tag handle'),eV.test(n)||Qr(e,"ill-formed tag prefix (second argument) of the TAG directive"),e.tagMap[a]=n}};function Kp(t,e,r,o){var a,n,u,A;if(e1&&(t.result+=mf.repeat(` `,e-1))}function UHe(t,e,r){var o,a,n,u,A,p,h,E,w=t.kind,D=t.result,b;if(b=t.input.charCodeAt(t.position),Da(b)||Im(b)||b===35||b===38||b===42||b===33||b===124||b===62||b===39||b===34||b===37||b===64||b===96||(b===63||b===45)&&(a=t.input.charCodeAt(t.position+1),Da(a)||r&&Im(a)))return!1;for(t.kind="scalar",t.result="",n=u=t.position,A=!1;b!==0;){if(b===58){if(a=t.input.charCodeAt(t.position+1),Da(a)||r&&Im(a))break}else if(b===35){if(o=t.input.charCodeAt(t.position-1),Da(o))break}else{if(t.position===t.lineStart&&IP(t)||r&&Im(b))break;if(Wu(b))if(p=t.line,h=t.lineStart,E=t.lineIndent,Yi(t,!1,-1),t.lineIndent>=e){A=!0,b=t.input.charCodeAt(t.position);continue}else{t.position=u,t.line=p,t.lineStart=h,t.lineIndent=E;break}}A&&(Kp(t,n,u,!1),XT(t,t.line-p),n=u=t.position,A=!1),rg(b)||(u=t.position+1),b=t.input.charCodeAt(++t.position)}return Kp(t,n,u,!1),t.result?!0:(t.kind=w,t.result=D,!1)}function _He(t,e){var r,o,a;if(r=t.input.charCodeAt(t.position),r!==39)return!1;for(t.kind="scalar",t.result="",t.position++,o=a=t.position;(r=t.input.charCodeAt(t.position))!==0;)if(r===39)if(Kp(t,o,t.position,!0),r=t.input.charCodeAt(++t.position),r===39)o=t.position,t.position++,a=t.position;else return!0;else Wu(r)?(Kp(t,o,a,!0),XT(t,Yi(t,!1,e)),o=a=t.position):t.position===t.lineStart&&IP(t)?Qr(t,"unexpected end of the document within a single quoted scalar"):(t.position++,a=t.position);Qr(t,"unexpected end of the stream within a single quoted scalar")}function HHe(t,e){var r,o,a,n,u,A;if(A=t.input.charCodeAt(t.position),A!==34)return!1;for(t.kind="scalar",t.result="",t.position++,r=o=t.position;(A=t.input.charCodeAt(t.position))!==0;){if(A===34)return Kp(t,r,t.position,!0),t.position++,!0;if(A===92){if(Kp(t,r,t.position,!0),A=t.input.charCodeAt(++t.position),Wu(A))Yi(t,!1,e);else if(A<256&&tV[A])t.result+=rV[A],t.position++;else if((u=LHe(A))>0){for(a=u,n=0;a>0;a--)A=t.input.charCodeAt(++t.position),(u=THe(A))>=0?n=(n<<4)+u:Qr(t,"expected hexadecimal character");t.result+=OHe(n),t.position++}else Qr(t,"unknown escape sequence");r=o=t.position}else Wu(A)?(Kp(t,r,o,!0),XT(t,Yi(t,!1,e)),r=o=t.position):t.position===t.lineStart&&IP(t)?Qr(t,"unexpected end of the document within a double quoted scalar"):(t.position++,o=t.position)}Qr(t,"unexpected end of the stream within a double quoted scalar")}function qHe(t,e){var r=!0,o,a=t.tag,n,u=t.anchor,A,p,h,E,w,D={},b,C,T,N;if(N=t.input.charCodeAt(t.position),N===91)p=93,w=!1,n=[];else if(N===123)p=125,w=!0,n={};else return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=n),N=t.input.charCodeAt(++t.position);N!==0;){if(Yi(t,!0,e),N=t.input.charCodeAt(t.position),N===p)return t.position++,t.tag=a,t.anchor=u,t.kind=w?"mapping":"sequence",t.result=n,!0;r||Qr(t,"missed comma between flow collection entries"),C=b=T=null,h=E=!1,N===63&&(A=t.input.charCodeAt(t.position+1),Da(A)&&(h=E=!0,t.position++,Yi(t,!0,e))),o=t.line,Bm(t,e,yP,!1,!0),C=t.tag,b=t.result,Yi(t,!0,e),N=t.input.charCodeAt(t.position),(E||t.line===o)&&N===58&&(h=!0,N=t.input.charCodeAt(++t.position),Yi(t,!0,e),Bm(t,e,yP,!1,!0),T=t.result),w?wm(t,n,D,C,b,T):h?n.push(wm(t,null,D,C,b,T)):n.push(b),Yi(t,!0,e),N=t.input.charCodeAt(t.position),N===44?(r=!0,N=t.input.charCodeAt(++t.position)):r=!1}Qr(t,"unexpected end of the stream within a flow collection")}function jHe(t,e){var r,o,a=zT,n=!1,u=!1,A=e,p=0,h=!1,E,w;if(w=t.input.charCodeAt(t.position),w===124)o=!1;else if(w===62)o=!0;else return!1;for(t.kind="scalar",t.result="";w!==0;)if(w=t.input.charCodeAt(++t.position),w===43||w===45)zT===a?a=w===43?jK:kHe:Qr(t,"repeat of a chomping mode identifier");else if((E=NHe(w))>=0)E===0?Qr(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):u?Qr(t,"repeat of an indentation width identifier"):(A=e+E-1,u=!0);else break;if(rg(w)){do w=t.input.charCodeAt(++t.position);while(rg(w));if(w===35)do w=t.input.charCodeAt(++t.position);while(!Wu(w)&&w!==0)}for(;w!==0;){for(JT(t),t.lineIndent=0,w=t.input.charCodeAt(t.position);(!u||t.lineIndentA&&(A=t.lineIndent),Wu(w)){p++;continue}if(t.lineIndente)&&p!==0)Qr(t,"bad indentation of a sequence entry");else if(t.lineIndente)&&(Bm(t,e,EP,!0,a)&&(C?D=t.result:b=t.result),C||(wm(t,h,E,w,D,b,n,u),w=D=b=null),Yi(t,!0,-1),N=t.input.charCodeAt(t.position)),t.lineIndent>e&&N!==0)Qr(t,"bad indentation of a mapping entry");else if(t.lineIndente?p=1:t.lineIndent===e?p=0:t.lineIndente?p=1:t.lineIndent===e?p=0:t.lineIndent tag; it should be "scalar", not "'+t.kind+'"'),w=0,D=t.implicitTypes.length;w tag; it should be "'+b.kind+'", not "'+t.kind+'"'),b.resolve(t.result)?(t.result=b.construct(t.result),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):Qr(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")):Qr(t,"unknown tag !<"+t.tag+">");return t.listener!==null&&t.listener("close",t),t.tag!==null||t.anchor!==null||E}function VHe(t){var e=t.position,r,o,a,n=!1,u;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap={},t.anchorMap={};(u=t.input.charCodeAt(t.position))!==0&&(Yi(t,!0,-1),u=t.input.charCodeAt(t.position),!(t.lineIndent>0||u!==37));){for(n=!0,u=t.input.charCodeAt(++t.position),r=t.position;u!==0&&!Da(u);)u=t.input.charCodeAt(++t.position);for(o=t.input.slice(r,t.position),a=[],o.length<1&&Qr(t,"directive name must not be less than one character in length");u!==0;){for(;rg(u);)u=t.input.charCodeAt(++t.position);if(u===35){do u=t.input.charCodeAt(++t.position);while(u!==0&&!Wu(u));break}if(Wu(u))break;for(r=t.position;u!==0&&!Da(u);)u=t.input.charCodeAt(++t.position);a.push(t.input.slice(r,t.position))}u!==0&&JT(t),Vp.call(YK,o)?YK[o](t,o,a):CP(t,'unknown document directive "'+o+'"')}if(Yi(t,!0,-1),t.lineIndent===0&&t.input.charCodeAt(t.position)===45&&t.input.charCodeAt(t.position+1)===45&&t.input.charCodeAt(t.position+2)===45?(t.position+=3,Yi(t,!0,-1)):n&&Qr(t,"directives end mark is expected"),Bm(t,t.lineIndent-1,EP,!1,!0),Yi(t,!0,-1),t.checkLineBreaks&&FHe.test(t.input.slice(e,t.position))&&CP(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&IP(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,Yi(t,!0,-1));return}if(t.position"u"&&(r=e,e=null);var o=iV(t,r);if(typeof e!="function")return o;for(var a=0,n=o.length;a"u"&&(r=e,e=null),sV(t,e,mf.extend({schema:JK},r))}function JHe(t,e){return oV(t,mf.extend({schema:JK},e))}gw.exports.loadAll=sV;gw.exports.load=oV;gw.exports.safeLoadAll=zHe;gw.exports.safeLoad=JHe});var kV=_((Kxt,tL)=>{"use strict";var mw=Z0(),yw=ym(),XHe=hw(),ZHe=Cm(),gV=Object.prototype.toString,dV=Object.prototype.hasOwnProperty,$He=9,dw=10,e6e=13,t6e=32,r6e=33,n6e=34,mV=35,i6e=37,s6e=38,o6e=39,a6e=42,yV=44,l6e=45,EV=58,c6e=61,u6e=62,A6e=63,f6e=64,CV=91,IV=93,p6e=96,wV=123,h6e=124,BV=125,mo={};mo[0]="\\0";mo[7]="\\a";mo[8]="\\b";mo[9]="\\t";mo[10]="\\n";mo[11]="\\v";mo[12]="\\f";mo[13]="\\r";mo[27]="\\e";mo[34]='\\"';mo[92]="\\\\";mo[133]="\\N";mo[160]="\\_";mo[8232]="\\L";mo[8233]="\\P";var g6e=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function d6e(t,e){var r,o,a,n,u,A,p;if(e===null)return{};for(r={},o=Object.keys(e),a=0,n=o.length;a0?t.charCodeAt(n-1):null,D=D&&uV(u,A)}else{for(n=0;no&&t[w+1]!==" ",w=n);else if(!vm(u))return wP;A=n>0?t.charCodeAt(n-1):null,D=D&&uV(u,A)}h=h||E&&n-w-1>o&&t[w+1]!==" "}return!p&&!h?D&&!a(t)?DV:PV:r>9&&vV(t)?wP:h?xV:SV}function w6e(t,e,r,o){t.dump=function(){if(e.length===0)return"''";if(!t.noCompatMode&&g6e.indexOf(e)!==-1)return"'"+e+"'";var a=t.indent*Math.max(1,r),n=t.lineWidth===-1?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-a),u=o||t.flowLevel>-1&&r>=t.flowLevel;function A(p){return y6e(t,p)}switch(I6e(e,u,t.indent,n,A)){case DV:return e;case PV:return"'"+e.replace(/'/g,"''")+"'";case SV:return"|"+AV(e,t.indent)+fV(cV(e,a));case xV:return">"+AV(e,t.indent)+fV(cV(B6e(e,n),a));case wP:return'"'+v6e(e,n)+'"';default:throw new yw("impossible error: invalid scalar style")}}()}function AV(t,e){var r=vV(t)?String(e):"",o=t[t.length-1]===` `,a=o&&(t[t.length-2]===` `||t===` `),n=a?"+":o?"":"-";return r+n+` `}function fV(t){return t[t.length-1]===` `?t.slice(0,-1):t}function B6e(t,e){for(var r=/(\n+)([^\n]*)/g,o=function(){var h=t.indexOf(` `);return h=h!==-1?h:t.length,r.lastIndex=h,pV(t.slice(0,h),e)}(),a=t[0]===` `||t[0]===" ",n,u;u=r.exec(t);){var A=u[1],p=u[2];n=p[0]===" ",o+=A+(!a&&!n&&p!==""?` `:"")+pV(p,e),a=n}return o}function pV(t,e){if(t===""||t[0]===" ")return t;for(var r=/ [^ ]/g,o,a=0,n,u=0,A=0,p="";o=r.exec(t);)A=o.index,A-a>e&&(n=u>a?u:A,p+=` `+t.slice(a,n),a=n+1),u=A;return p+=` `,t.length-a>e&&u>a?p+=t.slice(a,u)+` `+t.slice(u+1):p+=t.slice(a),p.slice(1)}function v6e(t){for(var e="",r,o,a,n=0;n=55296&&r<=56319&&(o=t.charCodeAt(n+1),o>=56320&&o<=57343)){e+=lV((r-55296)*1024+o-56320+65536),n++;continue}a=mo[r],e+=!a&&vm(r)?t[n]:a||lV(r)}return e}function D6e(t,e,r){var o="",a=t.tag,n,u;for(n=0,u=r.length;n1024&&(E+="? "),E+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),ng(t,e,h,!1,!1)&&(E+=t.dump,o+=E));t.tag=a,t.dump="{"+o+"}"}function x6e(t,e,r,o){var a="",n=t.tag,u=Object.keys(r),A,p,h,E,w,D;if(t.sortKeys===!0)u.sort();else if(typeof t.sortKeys=="function")u.sort(t.sortKeys);else if(t.sortKeys)throw new yw("sortKeys must be a boolean or a function");for(A=0,p=u.length;A1024,w&&(t.dump&&dw===t.dump.charCodeAt(0)?D+="?":D+="? "),D+=t.dump,w&&(D+=ZT(t,e)),ng(t,e+1,E,!0,w)&&(t.dump&&dw===t.dump.charCodeAt(0)?D+=":":D+=": ",D+=t.dump,a+=D));t.tag=n,t.dump=a||"{}"}function hV(t,e,r){var o,a,n,u,A,p;for(a=r?t.explicitTypes:t.implicitTypes,n=0,u=a.length;n tag resolver accepts not "'+p+'" style');t.dump=o}return!0}return!1}function ng(t,e,r,o,a,n){t.tag=null,t.dump=r,hV(t,r,!1)||hV(t,r,!0);var u=gV.call(t.dump);o&&(o=t.flowLevel<0||t.flowLevel>e);var A=u==="[object Object]"||u==="[object Array]",p,h;if(A&&(p=t.duplicates.indexOf(r),h=p!==-1),(t.tag!==null&&t.tag!=="?"||h||t.indent!==2&&e>0)&&(a=!1),h&&t.usedDuplicates[p])t.dump="*ref_"+p;else{if(A&&h&&!t.usedDuplicates[p]&&(t.usedDuplicates[p]=!0),u==="[object Object]")o&&Object.keys(t.dump).length!==0?(x6e(t,e,t.dump,a),h&&(t.dump="&ref_"+p+t.dump)):(S6e(t,e,t.dump),h&&(t.dump="&ref_"+p+" "+t.dump));else if(u==="[object Array]"){var E=t.noArrayIndent&&e>0?e-1:e;o&&t.dump.length!==0?(P6e(t,E,t.dump,a),h&&(t.dump="&ref_"+p+t.dump)):(D6e(t,E,t.dump),h&&(t.dump="&ref_"+p+" "+t.dump))}else if(u==="[object String]")t.tag!=="?"&&w6e(t,t.dump,e,n);else{if(t.skipInvalid)return!1;throw new yw("unacceptable kind of an object to dump "+u)}t.tag!==null&&t.tag!=="?"&&(t.dump="!<"+t.tag+"> "+t.dump)}return!0}function b6e(t,e){var r=[],o=[],a,n;for($T(t,r,o),a=0,n=o.length;a{"use strict";var BP=aV(),QV=kV();function vP(t){return function(){throw new Error("Function "+t+" is deprecated and cannot be used.")}}Fi.exports.Type=as();Fi.exports.Schema=$0();Fi.exports.FAILSAFE_SCHEMA=dP();Fi.exports.JSON_SCHEMA=YT();Fi.exports.CORE_SCHEMA=KT();Fi.exports.DEFAULT_SAFE_SCHEMA=Cm();Fi.exports.DEFAULT_FULL_SCHEMA=hw();Fi.exports.load=BP.load;Fi.exports.loadAll=BP.loadAll;Fi.exports.safeLoad=BP.safeLoad;Fi.exports.safeLoadAll=BP.safeLoadAll;Fi.exports.dump=QV.dump;Fi.exports.safeDump=QV.safeDump;Fi.exports.YAMLException=ym();Fi.exports.MINIMAL_SCHEMA=dP();Fi.exports.SAFE_SCHEMA=Cm();Fi.exports.DEFAULT_SCHEMA=hw();Fi.exports.scan=vP("scan");Fi.exports.parse=vP("parse");Fi.exports.compose=vP("compose");Fi.exports.addConstructor=vP("addConstructor")});var TV=_((zxt,RV)=>{"use strict";var Q6e=FV();RV.exports=Q6e});var NV=_((Jxt,LV)=>{"use strict";function F6e(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}function ig(t,e,r,o){this.message=t,this.expected=e,this.found=r,this.location=o,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,ig)}F6e(ig,Error);ig.buildMessage=function(t,e){var r={literal:function(h){return'"'+a(h.text)+'"'},class:function(h){var E="",w;for(w=0;w0){for(w=1,D=1;w({[gt]:Ne})))},ce=function(ee){return ee},ue=function(ee){return ee},Ie=oa("correct indentation"),he=" ",De=un(" ",!1),Ee=function(ee){return ee.length===ar*vt},g=function(ee){return ee.length===(ar+1)*vt},me=function(){return ar++,!0},Ce=function(){return ar--,!0},fe=function(){return Lo()},ie=oa("pseudostring"),Z=/^[^\r\n\t ?:,\][{}#&*!|>'"%@`\-]/,Pe=qn(["\r",` `," "," ","?",":",",","]","[","{","}","#","&","*","!","|",">","'",'"',"%","@","`","-"],!0,!1),Re=/^[^\r\n\t ,\][{}:#"']/,ht=qn(["\r",` `," "," ",",","]","[","{","}",":","#",'"',"'"],!0,!1),q=function(){return Lo().replace(/^ *| *$/g,"")},nt="--",Le=un("--",!1),Te=/^[a-zA-Z\/0-9]/,ke=qn([["a","z"],["A","Z"],"/",["0","9"]],!1,!1),Ve=/^[^\r\n\t :,]/,xe=qn(["\r",` `," "," ",":",","],!0,!1),tt="null",He=un("null",!1),x=function(){return null},I="true",S=un("true",!1),y=function(){return!0},R="false",J=un("false",!1),X=function(){return!1},$=oa("string"),se='"',be=un('"',!1),Fe=function(){return""},lt=function(ee){return ee},Et=function(ee){return ee.join("")},qt=/^[^"\\\0-\x1F\x7F]/,nr=qn(['"',"\\",["\0",""],"\x7F"],!0,!1),St='\\"',cn=un('\\"',!1),Pr=function(){return'"'},yr="\\\\",Rr=un("\\\\",!1),Xr=function(){return"\\"},$n="\\/",Xs=un("\\/",!1),Hi=function(){return"/"},Qs="\\b",Zs=un("\\b",!1),bi=function(){return"\b"},Fs="\\f",$s=un("\\f",!1),SA=function(){return"\f"},gu="\\n",op=un("\\n",!1),ap=function(){return` `},Rs="\\r",Nn=un("\\r",!1),hs=function(){return"\r"},Ts="\\t",pc=un("\\t",!1),hc=function(){return" "},gc="\\u",xA=un("\\u",!1),bA=function(ee,ye,Ne,gt){return String.fromCharCode(parseInt(`0x${ee}${ye}${Ne}${gt}`))},Ro=/^[0-9a-fA-F]/,To=qn([["0","9"],["a","f"],["A","F"]],!1,!1),kA=oa("blank space"),pr=/^[ \t]/,Me=qn([" "," "],!1,!1),ia=oa("white space"),dc=/^[ \t\n\r]/,Er=qn([" "," ",` `,"\r"],!1,!1),du=`\r `,QA=un(`\r `,!1),FA=` `,mc=un(` `,!1),yc="\r",Il=un("\r",!1),we=0,Tt=0,wl=[{line:1,column:1}],Bi=0,Ls=[],Ft=0,Bn;if("startRule"in e){if(!(e.startRule in o))throw new Error(`Can't start parsing from rule "`+e.startRule+'".');a=o[e.startRule]}function Lo(){return t.substring(Tt,we)}function ki(){return la(Tt,we)}function vi(ee,ye){throw ye=ye!==void 0?ye:la(Tt,we),mu([oa(ee)],t.substring(Tt,we),ye)}function sa(ee,ye){throw ye=ye!==void 0?ye:la(Tt,we),ca(ee,ye)}function un(ee,ye){return{type:"literal",text:ee,ignoreCase:ye}}function qn(ee,ye,Ne){return{type:"class",parts:ee,inverted:ye,ignoreCase:Ne}}function Ec(){return{type:"any"}}function lp(){return{type:"end"}}function oa(ee){return{type:"other",description:ee}}function aa(ee){var ye=wl[ee],Ne;if(ye)return ye;for(Ne=ee-1;!wl[Ne];)Ne--;for(ye=wl[Ne],ye={line:ye.line,column:ye.column};NeBi&&(Bi=we,Ls=[]),Ls.push(ee))}function ca(ee,ye){return new ig(ee,null,null,ye)}function mu(ee,ye,Ne){return new ig(ig.buildMessage(ee,ye),ee,ye,Ne)}function Bl(){var ee;return ee=RA(),ee}function dn(){var ee,ye,Ne;for(ee=we,ye=[],Ne=No();Ne!==r;)ye.push(Ne),Ne=No();return ye!==r&&(Tt=ee,ye=n(ye)),ee=ye,ee}function No(){var ee,ye,Ne,gt,mt;return ee=we,ye=qa(),ye!==r?(t.charCodeAt(we)===45?(Ne=u,we++):(Ne=r,Ft===0&&Ze(A)),Ne!==r?(gt=Dn(),gt!==r?(mt=Oo(),mt!==r?(Tt=ee,ye=p(mt),ee=ye):(we=ee,ee=r)):(we=ee,ee=r)):(we=ee,ee=r)):(we=ee,ee=r),ee}function RA(){var ee,ye,Ne;for(ee=we,ye=[],Ne=TA();Ne!==r;)ye.push(Ne),Ne=TA();return ye!==r&&(Tt=ee,ye=h(ye)),ee=ye,ee}function TA(){var ee,ye,Ne,gt,mt,Dt,er,sn,ei;if(ee=we,ye=Dn(),ye===r&&(ye=null),ye!==r){if(Ne=we,t.charCodeAt(we)===35?(gt=E,we++):(gt=r,Ft===0&&Ze(w)),gt!==r){if(mt=[],Dt=we,er=we,Ft++,sn=it(),Ft--,sn===r?er=void 0:(we=er,er=r),er!==r?(t.length>we?(sn=t.charAt(we),we++):(sn=r,Ft===0&&Ze(D)),sn!==r?(er=[er,sn],Dt=er):(we=Dt,Dt=r)):(we=Dt,Dt=r),Dt!==r)for(;Dt!==r;)mt.push(Dt),Dt=we,er=we,Ft++,sn=it(),Ft--,sn===r?er=void 0:(we=er,er=r),er!==r?(t.length>we?(sn=t.charAt(we),we++):(sn=r,Ft===0&&Ze(D)),sn!==r?(er=[er,sn],Dt=er):(we=Dt,Dt=r)):(we=Dt,Dt=r);else mt=r;mt!==r?(gt=[gt,mt],Ne=gt):(we=Ne,Ne=r)}else we=Ne,Ne=r;if(Ne===r&&(Ne=null),Ne!==r){if(gt=[],mt=ze(),mt!==r)for(;mt!==r;)gt.push(mt),mt=ze();else gt=r;gt!==r?(Tt=ee,ye=b(),ee=ye):(we=ee,ee=r)}else we=ee,ee=r}else we=ee,ee=r;if(ee===r&&(ee=we,ye=qa(),ye!==r?(Ne=ua(),Ne!==r?(gt=Dn(),gt===r&&(gt=null),gt!==r?(t.charCodeAt(we)===58?(mt=C,we++):(mt=r,Ft===0&&Ze(T)),mt!==r?(Dt=Dn(),Dt===r&&(Dt=null),Dt!==r?(er=Oo(),er!==r?(Tt=ee,ye=N(Ne,er),ee=ye):(we=ee,ee=r)):(we=ee,ee=r)):(we=ee,ee=r)):(we=ee,ee=r)):(we=ee,ee=r)):(we=ee,ee=r),ee===r&&(ee=we,ye=qa(),ye!==r?(Ne=qi(),Ne!==r?(gt=Dn(),gt===r&&(gt=null),gt!==r?(t.charCodeAt(we)===58?(mt=C,we++):(mt=r,Ft===0&&Ze(T)),mt!==r?(Dt=Dn(),Dt===r&&(Dt=null),Dt!==r?(er=Oo(),er!==r?(Tt=ee,ye=N(Ne,er),ee=ye):(we=ee,ee=r)):(we=ee,ee=r)):(we=ee,ee=r)):(we=ee,ee=r)):(we=ee,ee=r)):(we=ee,ee=r),ee===r))){if(ee=we,ye=qa(),ye!==r)if(Ne=qi(),Ne!==r)if(gt=Dn(),gt!==r)if(mt=Cc(),mt!==r){if(Dt=[],er=ze(),er!==r)for(;er!==r;)Dt.push(er),er=ze();else Dt=r;Dt!==r?(Tt=ee,ye=N(Ne,mt),ee=ye):(we=ee,ee=r)}else we=ee,ee=r;else we=ee,ee=r;else we=ee,ee=r;else we=ee,ee=r;if(ee===r)if(ee=we,ye=qa(),ye!==r)if(Ne=qi(),Ne!==r){if(gt=[],mt=we,Dt=Dn(),Dt===r&&(Dt=null),Dt!==r?(t.charCodeAt(we)===44?(er=U,we++):(er=r,Ft===0&&Ze(z)),er!==r?(sn=Dn(),sn===r&&(sn=null),sn!==r?(ei=qi(),ei!==r?(Tt=mt,Dt=te(Ne,ei),mt=Dt):(we=mt,mt=r)):(we=mt,mt=r)):(we=mt,mt=r)):(we=mt,mt=r),mt!==r)for(;mt!==r;)gt.push(mt),mt=we,Dt=Dn(),Dt===r&&(Dt=null),Dt!==r?(t.charCodeAt(we)===44?(er=U,we++):(er=r,Ft===0&&Ze(z)),er!==r?(sn=Dn(),sn===r&&(sn=null),sn!==r?(ei=qi(),ei!==r?(Tt=mt,Dt=te(Ne,ei),mt=Dt):(we=mt,mt=r)):(we=mt,mt=r)):(we=mt,mt=r)):(we=mt,mt=r);else gt=r;gt!==r?(mt=Dn(),mt===r&&(mt=null),mt!==r?(t.charCodeAt(we)===58?(Dt=C,we++):(Dt=r,Ft===0&&Ze(T)),Dt!==r?(er=Dn(),er===r&&(er=null),er!==r?(sn=Oo(),sn!==r?(Tt=ee,ye=le(Ne,gt,sn),ee=ye):(we=ee,ee=r)):(we=ee,ee=r)):(we=ee,ee=r)):(we=ee,ee=r)):(we=ee,ee=r)}else we=ee,ee=r;else we=ee,ee=r}return ee}function Oo(){var ee,ye,Ne,gt,mt,Dt,er;if(ee=we,ye=we,Ft++,Ne=we,gt=it(),gt!==r?(mt=Ot(),mt!==r?(t.charCodeAt(we)===45?(Dt=u,we++):(Dt=r,Ft===0&&Ze(A)),Dt!==r?(er=Dn(),er!==r?(gt=[gt,mt,Dt,er],Ne=gt):(we=Ne,Ne=r)):(we=Ne,Ne=r)):(we=Ne,Ne=r)):(we=Ne,Ne=r),Ft--,Ne!==r?(we=ye,ye=void 0):ye=r,ye!==r?(Ne=ze(),Ne!==r?(gt=vn(),gt!==r?(mt=dn(),mt!==r?(Dt=Mo(),Dt!==r?(Tt=ee,ye=ce(mt),ee=ye):(we=ee,ee=r)):(we=ee,ee=r)):(we=ee,ee=r)):(we=ee,ee=r)):(we=ee,ee=r),ee===r&&(ee=we,ye=it(),ye!==r?(Ne=vn(),Ne!==r?(gt=RA(),gt!==r?(mt=Mo(),mt!==r?(Tt=ee,ye=ce(gt),ee=ye):(we=ee,ee=r)):(we=ee,ee=r)):(we=ee,ee=r)):(we=ee,ee=r),ee===r))if(ee=we,ye=vl(),ye!==r){if(Ne=[],gt=ze(),gt!==r)for(;gt!==r;)Ne.push(gt),gt=ze();else Ne=r;Ne!==r?(Tt=ee,ye=ue(ye),ee=ye):(we=ee,ee=r)}else we=ee,ee=r;return ee}function qa(){var ee,ye,Ne;for(Ft++,ee=we,ye=[],t.charCodeAt(we)===32?(Ne=he,we++):(Ne=r,Ft===0&&Ze(De));Ne!==r;)ye.push(Ne),t.charCodeAt(we)===32?(Ne=he,we++):(Ne=r,Ft===0&&Ze(De));return ye!==r?(Tt=we,Ne=Ee(ye),Ne?Ne=void 0:Ne=r,Ne!==r?(ye=[ye,Ne],ee=ye):(we=ee,ee=r)):(we=ee,ee=r),Ft--,ee===r&&(ye=r,Ft===0&&Ze(Ie)),ee}function Ot(){var ee,ye,Ne;for(ee=we,ye=[],t.charCodeAt(we)===32?(Ne=he,we++):(Ne=r,Ft===0&&Ze(De));Ne!==r;)ye.push(Ne),t.charCodeAt(we)===32?(Ne=he,we++):(Ne=r,Ft===0&&Ze(De));return ye!==r?(Tt=we,Ne=g(ye),Ne?Ne=void 0:Ne=r,Ne!==r?(ye=[ye,Ne],ee=ye):(we=ee,ee=r)):(we=ee,ee=r),ee}function vn(){var ee;return Tt=we,ee=me(),ee?ee=void 0:ee=r,ee}function Mo(){var ee;return Tt=we,ee=Ce(),ee?ee=void 0:ee=r,ee}function ua(){var ee;return ee=ja(),ee===r&&(ee=Dl()),ee}function qi(){var ee,ye,Ne;if(ee=ja(),ee===r){if(ee=we,ye=[],Ne=Aa(),Ne!==r)for(;Ne!==r;)ye.push(Ne),Ne=Aa();else ye=r;ye!==r&&(Tt=ee,ye=fe()),ee=ye}return ee}function vl(){var ee;return ee=Di(),ee===r&&(ee=rs(),ee===r&&(ee=ja(),ee===r&&(ee=Dl()))),ee}function Cc(){var ee;return ee=Di(),ee===r&&(ee=ja(),ee===r&&(ee=Aa())),ee}function Dl(){var ee,ye,Ne,gt,mt,Dt;if(Ft++,ee=we,Z.test(t.charAt(we))?(ye=t.charAt(we),we++):(ye=r,Ft===0&&Ze(Pe)),ye!==r){for(Ne=[],gt=we,mt=Dn(),mt===r&&(mt=null),mt!==r?(Re.test(t.charAt(we))?(Dt=t.charAt(we),we++):(Dt=r,Ft===0&&Ze(ht)),Dt!==r?(mt=[mt,Dt],gt=mt):(we=gt,gt=r)):(we=gt,gt=r);gt!==r;)Ne.push(gt),gt=we,mt=Dn(),mt===r&&(mt=null),mt!==r?(Re.test(t.charAt(we))?(Dt=t.charAt(we),we++):(Dt=r,Ft===0&&Ze(ht)),Dt!==r?(mt=[mt,Dt],gt=mt):(we=gt,gt=r)):(we=gt,gt=r);Ne!==r?(Tt=ee,ye=q(),ee=ye):(we=ee,ee=r)}else we=ee,ee=r;return Ft--,ee===r&&(ye=r,Ft===0&&Ze(ie)),ee}function Aa(){var ee,ye,Ne,gt,mt;if(ee=we,t.substr(we,2)===nt?(ye=nt,we+=2):(ye=r,Ft===0&&Ze(Le)),ye===r&&(ye=null),ye!==r)if(Te.test(t.charAt(we))?(Ne=t.charAt(we),we++):(Ne=r,Ft===0&&Ze(ke)),Ne!==r){for(gt=[],Ve.test(t.charAt(we))?(mt=t.charAt(we),we++):(mt=r,Ft===0&&Ze(xe));mt!==r;)gt.push(mt),Ve.test(t.charAt(we))?(mt=t.charAt(we),we++):(mt=r,Ft===0&&Ze(xe));gt!==r?(Tt=ee,ye=q(),ee=ye):(we=ee,ee=r)}else we=ee,ee=r;else we=ee,ee=r;return ee}function Di(){var ee,ye;return ee=we,t.substr(we,4)===tt?(ye=tt,we+=4):(ye=r,Ft===0&&Ze(He)),ye!==r&&(Tt=ee,ye=x()),ee=ye,ee}function rs(){var ee,ye;return ee=we,t.substr(we,4)===I?(ye=I,we+=4):(ye=r,Ft===0&&Ze(S)),ye!==r&&(Tt=ee,ye=y()),ee=ye,ee===r&&(ee=we,t.substr(we,5)===R?(ye=R,we+=5):(ye=r,Ft===0&&Ze(J)),ye!==r&&(Tt=ee,ye=X()),ee=ye),ee}function ja(){var ee,ye,Ne,gt;return Ft++,ee=we,t.charCodeAt(we)===34?(ye=se,we++):(ye=r,Ft===0&&Ze(be)),ye!==r?(t.charCodeAt(we)===34?(Ne=se,we++):(Ne=r,Ft===0&&Ze(be)),Ne!==r?(Tt=ee,ye=Fe(),ee=ye):(we=ee,ee=r)):(we=ee,ee=r),ee===r&&(ee=we,t.charCodeAt(we)===34?(ye=se,we++):(ye=r,Ft===0&&Ze(be)),ye!==r?(Ne=yu(),Ne!==r?(t.charCodeAt(we)===34?(gt=se,we++):(gt=r,Ft===0&&Ze(be)),gt!==r?(Tt=ee,ye=lt(Ne),ee=ye):(we=ee,ee=r)):(we=ee,ee=r)):(we=ee,ee=r)),Ft--,ee===r&&(ye=r,Ft===0&&Ze($)),ee}function yu(){var ee,ye,Ne;if(ee=we,ye=[],Ne=Pl(),Ne!==r)for(;Ne!==r;)ye.push(Ne),Ne=Pl();else ye=r;return ye!==r&&(Tt=ee,ye=Et(ye)),ee=ye,ee}function Pl(){var ee,ye,Ne,gt,mt,Dt;return qt.test(t.charAt(we))?(ee=t.charAt(we),we++):(ee=r,Ft===0&&Ze(nr)),ee===r&&(ee=we,t.substr(we,2)===St?(ye=St,we+=2):(ye=r,Ft===0&&Ze(cn)),ye!==r&&(Tt=ee,ye=Pr()),ee=ye,ee===r&&(ee=we,t.substr(we,2)===yr?(ye=yr,we+=2):(ye=r,Ft===0&&Ze(Rr)),ye!==r&&(Tt=ee,ye=Xr()),ee=ye,ee===r&&(ee=we,t.substr(we,2)===$n?(ye=$n,we+=2):(ye=r,Ft===0&&Ze(Xs)),ye!==r&&(Tt=ee,ye=Hi()),ee=ye,ee===r&&(ee=we,t.substr(we,2)===Qs?(ye=Qs,we+=2):(ye=r,Ft===0&&Ze(Zs)),ye!==r&&(Tt=ee,ye=bi()),ee=ye,ee===r&&(ee=we,t.substr(we,2)===Fs?(ye=Fs,we+=2):(ye=r,Ft===0&&Ze($s)),ye!==r&&(Tt=ee,ye=SA()),ee=ye,ee===r&&(ee=we,t.substr(we,2)===gu?(ye=gu,we+=2):(ye=r,Ft===0&&Ze(op)),ye!==r&&(Tt=ee,ye=ap()),ee=ye,ee===r&&(ee=we,t.substr(we,2)===Rs?(ye=Rs,we+=2):(ye=r,Ft===0&&Ze(Nn)),ye!==r&&(Tt=ee,ye=hs()),ee=ye,ee===r&&(ee=we,t.substr(we,2)===Ts?(ye=Ts,we+=2):(ye=r,Ft===0&&Ze(pc)),ye!==r&&(Tt=ee,ye=hc()),ee=ye,ee===r&&(ee=we,t.substr(we,2)===gc?(ye=gc,we+=2):(ye=r,Ft===0&&Ze(xA)),ye!==r?(Ne=pi(),Ne!==r?(gt=pi(),gt!==r?(mt=pi(),mt!==r?(Dt=pi(),Dt!==r?(Tt=ee,ye=bA(Ne,gt,mt,Dt),ee=ye):(we=ee,ee=r)):(we=ee,ee=r)):(we=ee,ee=r)):(we=ee,ee=r)):(we=ee,ee=r)))))))))),ee}function pi(){var ee;return Ro.test(t.charAt(we))?(ee=t.charAt(we),we++):(ee=r,Ft===0&&Ze(To)),ee}function Dn(){var ee,ye;if(Ft++,ee=[],pr.test(t.charAt(we))?(ye=t.charAt(we),we++):(ye=r,Ft===0&&Ze(Me)),ye!==r)for(;ye!==r;)ee.push(ye),pr.test(t.charAt(we))?(ye=t.charAt(we),we++):(ye=r,Ft===0&&Ze(Me));else ee=r;return Ft--,ee===r&&(ye=r,Ft===0&&Ze(kA)),ee}function Sl(){var ee,ye;if(Ft++,ee=[],dc.test(t.charAt(we))?(ye=t.charAt(we),we++):(ye=r,Ft===0&&Ze(Er)),ye!==r)for(;ye!==r;)ee.push(ye),dc.test(t.charAt(we))?(ye=t.charAt(we),we++):(ye=r,Ft===0&&Ze(Er));else ee=r;return Ft--,ee===r&&(ye=r,Ft===0&&Ze(ia)),ee}function ze(){var ee,ye,Ne,gt,mt,Dt;if(ee=we,ye=it(),ye!==r){for(Ne=[],gt=we,mt=Dn(),mt===r&&(mt=null),mt!==r?(Dt=it(),Dt!==r?(mt=[mt,Dt],gt=mt):(we=gt,gt=r)):(we=gt,gt=r);gt!==r;)Ne.push(gt),gt=we,mt=Dn(),mt===r&&(mt=null),mt!==r?(Dt=it(),Dt!==r?(mt=[mt,Dt],gt=mt):(we=gt,gt=r)):(we=gt,gt=r);Ne!==r?(ye=[ye,Ne],ee=ye):(we=ee,ee=r)}else we=ee,ee=r;return ee}function it(){var ee;return t.substr(we,2)===du?(ee=du,we+=2):(ee=r,Ft===0&&Ze(QA)),ee===r&&(t.charCodeAt(we)===10?(ee=FA,we++):(ee=r,Ft===0&&Ze(mc)),ee===r&&(t.charCodeAt(we)===13?(ee=yc,we++):(ee=r,Ft===0&&Ze(Il)))),ee}let vt=2,ar=0;if(Bn=a(),Bn!==r&&we===t.length)return Bn;throw Bn!==r&&we"u"?!0:typeof t=="object"&&t!==null&&!Array.isArray(t)?Object.keys(t).every(e=>_V(t[e])):!1}function rL(t,e,r){if(t===null)return`null `;if(typeof t=="number"||typeof t=="boolean")return`${t.toString()} `;if(typeof t=="string")return`${MV(t)} `;if(Array.isArray(t)){if(t.length===0)return`[] `;let o=" ".repeat(e);return` ${t.map(n=>`${o}- ${rL(n,e+1,!1)}`).join("")}`}if(typeof t=="object"&&t){let[o,a]=t instanceof DP?[t.data,!1]:[t,!0],n=" ".repeat(e),u=Object.keys(o);a&&u.sort((p,h)=>{let E=OV.indexOf(p),w=OV.indexOf(h);return E===-1&&w===-1?ph?1:0:E!==-1&&w===-1?-1:E===-1&&w!==-1?1:E-w});let A=u.filter(p=>!_V(o[p])).map((p,h)=>{let E=o[p],w=MV(p),D=rL(E,e+1,!0),b=h>0||r?n:"",C=w.length>1024?`? ${w} ${b}:`:`${w}:`,T=D.startsWith(` `)?D:` ${D}`;return`${b}${C}${T}`}).join(e===0?` `:"")||` `;return r?` ${A}`:`${A}`}throw new Error(`Unsupported value type (${t})`)}function Pa(t){try{let e=rL(t,0,!1);return e!==` `?e:""}catch(e){throw e.location&&(e.message=e.message.replace(/(\.)?$/,` (line ${e.location.start.line}, column ${e.location.start.column})$1`)),e}}function L6e(t){return t.endsWith(` `)||(t+=` `),(0,UV.parse)(t)}function O6e(t){if(N6e.test(t))return L6e(t);let e=(0,PP.safeLoad)(t,{schema:PP.FAILSAFE_SCHEMA,json:!0});if(e==null)return{};if(typeof e!="object")throw new Error(`Expected an indexed object, got a ${typeof e} instead. Does your file follow Yaml's rules?`);if(Array.isArray(e))throw new Error("Expected an indexed object, got an array instead. Does your file follow Yaml's rules?");return e}function Ki(t){return O6e(t)}var PP,UV,T6e,OV,DP,N6e,HV=It(()=>{PP=et(TV()),UV=et(NV()),T6e=/^(?![-?:,\][{}#&*!|>'"%@` \t\r\n]).([ \t]*(?![,\][{}:# \t\r\n]).)*$/,OV=["__metadata","version","resolution","dependencies","peerDependencies","dependenciesMeta","peerDependenciesMeta","binaries"],DP=class{constructor(e){this.data=e}};Pa.PreserveOrdering=DP;N6e=/^(#.*(\r?\n))*?#\s+yarn\s+lockfile\s+v1\r?\n/i});var Ew={};Kt(Ew,{parseResolution:()=>pP,parseShell:()=>uP,parseSyml:()=>Ki,stringifyArgument:()=>qT,stringifyArgumentSegment:()=>jT,stringifyArithmeticExpression:()=>fP,stringifyCommand:()=>HT,stringifyCommandChain:()=>mm,stringifyCommandChainThen:()=>_T,stringifyCommandLine:()=>AP,stringifyCommandLineThen:()=>UT,stringifyEnvSegment:()=>cP,stringifyRedirectArgument:()=>fw,stringifyResolution:()=>hP,stringifyShell:()=>dm,stringifyShellLine:()=>dm,stringifySyml:()=>Pa,stringifyValueArgument:()=>z0});var Ol=It(()=>{_Y();GY();HV()});var jV=_((tbt,nL)=>{"use strict";var M6e=t=>{let e=!1,r=!1,o=!1;for(let a=0;a{if(!(typeof t=="string"||Array.isArray(t)))throw new TypeError("Expected the input to be `string | string[]`");e=Object.assign({pascalCase:!1},e);let r=a=>e.pascalCase?a.charAt(0).toUpperCase()+a.slice(1):a;return Array.isArray(t)?t=t.map(a=>a.trim()).filter(a=>a.length).join("-"):t=t.trim(),t.length===0?"":t.length===1?e.pascalCase?t.toUpperCase():t.toLowerCase():(t!==t.toLowerCase()&&(t=M6e(t)),t=t.replace(/^[_.\- ]+/,"").toLowerCase().replace(/[_.\- ]+(\w|$)/g,(a,n)=>n.toUpperCase()).replace(/\d+(\w|$)/g,a=>a.toUpperCase()),r(t))};nL.exports=qV;nL.exports.default=qV});var GV=_((rbt,U6e)=>{U6e.exports=[{name:"Agola CI",constant:"AGOLA",env:"AGOLA_GIT_REF",pr:"AGOLA_PULL_REQUEST_ID"},{name:"Appcircle",constant:"APPCIRCLE",env:"AC_APPCIRCLE"},{name:"AppVeyor",constant:"APPVEYOR",env:"APPVEYOR",pr:"APPVEYOR_PULL_REQUEST_NUMBER"},{name:"AWS CodeBuild",constant:"CODEBUILD",env:"CODEBUILD_BUILD_ARN"},{name:"Azure Pipelines",constant:"AZURE_PIPELINES",env:"TF_BUILD",pr:{BUILD_REASON:"PullRequest"}},{name:"Bamboo",constant:"BAMBOO",env:"bamboo_planKey"},{name:"Bitbucket Pipelines",constant:"BITBUCKET",env:"BITBUCKET_COMMIT",pr:"BITBUCKET_PR_ID"},{name:"Bitrise",constant:"BITRISE",env:"BITRISE_IO",pr:"BITRISE_PULL_REQUEST"},{name:"Buddy",constant:"BUDDY",env:"BUDDY_WORKSPACE_ID",pr:"BUDDY_EXECUTION_PULL_REQUEST_ID"},{name:"Buildkite",constant:"BUILDKITE",env:"BUILDKITE",pr:{env:"BUILDKITE_PULL_REQUEST",ne:"false"}},{name:"CircleCI",constant:"CIRCLE",env:"CIRCLECI",pr:"CIRCLE_PULL_REQUEST"},{name:"Cirrus CI",constant:"CIRRUS",env:"CIRRUS_CI",pr:"CIRRUS_PR"},{name:"Codefresh",constant:"CODEFRESH",env:"CF_BUILD_ID",pr:{any:["CF_PULL_REQUEST_NUMBER","CF_PULL_REQUEST_ID"]}},{name:"Codemagic",constant:"CODEMAGIC",env:"CM_BUILD_ID",pr:"CM_PULL_REQUEST"},{name:"Codeship",constant:"CODESHIP",env:{CI_NAME:"codeship"}},{name:"Drone",constant:"DRONE",env:"DRONE",pr:{DRONE_BUILD_EVENT:"pull_request"}},{name:"dsari",constant:"DSARI",env:"DSARI"},{name:"Earthly",constant:"EARTHLY",env:"EARTHLY_CI"},{name:"Expo Application Services",constant:"EAS",env:"EAS_BUILD"},{name:"Gerrit",constant:"GERRIT",env:"GERRIT_PROJECT"},{name:"Gitea Actions",constant:"GITEA_ACTIONS",env:"GITEA_ACTIONS"},{name:"GitHub Actions",constant:"GITHUB_ACTIONS",env:"GITHUB_ACTIONS",pr:{GITHUB_EVENT_NAME:"pull_request"}},{name:"GitLab CI",constant:"GITLAB",env:"GITLAB_CI",pr:"CI_MERGE_REQUEST_ID"},{name:"GoCD",constant:"GOCD",env:"GO_PIPELINE_LABEL"},{name:"Google Cloud Build",constant:"GOOGLE_CLOUD_BUILD",env:"BUILDER_OUTPUT"},{name:"Harness CI",constant:"HARNESS",env:"HARNESS_BUILD_ID"},{name:"Heroku",constant:"HEROKU",env:{env:"NODE",includes:"/app/.heroku/node/bin/node"}},{name:"Hudson",constant:"HUDSON",env:"HUDSON_URL"},{name:"Jenkins",constant:"JENKINS",env:["JENKINS_URL","BUILD_ID"],pr:{any:["ghprbPullId","CHANGE_ID"]}},{name:"LayerCI",constant:"LAYERCI",env:"LAYERCI",pr:"LAYERCI_PULL_REQUEST"},{name:"Magnum CI",constant:"MAGNUM",env:"MAGNUM"},{name:"Netlify CI",constant:"NETLIFY",env:"NETLIFY",pr:{env:"PULL_REQUEST",ne:"false"}},{name:"Nevercode",constant:"NEVERCODE",env:"NEVERCODE",pr:{env:"NEVERCODE_PULL_REQUEST",ne:"false"}},{name:"Prow",constant:"PROW",env:"PROW_JOB_ID"},{name:"ReleaseHub",constant:"RELEASEHUB",env:"RELEASE_BUILD_ID"},{name:"Render",constant:"RENDER",env:"RENDER",pr:{IS_PULL_REQUEST:"true"}},{name:"Sail CI",constant:"SAIL",env:"SAILCI",pr:"SAIL_PULL_REQUEST_NUMBER"},{name:"Screwdriver",constant:"SCREWDRIVER",env:"SCREWDRIVER",pr:{env:"SD_PULL_REQUEST",ne:"false"}},{name:"Semaphore",constant:"SEMAPHORE",env:"SEMAPHORE",pr:"PULL_REQUEST_NUMBER"},{name:"Sourcehut",constant:"SOURCEHUT",env:{CI_NAME:"sourcehut"}},{name:"Strider CD",constant:"STRIDER",env:"STRIDER"},{name:"TaskCluster",constant:"TASKCLUSTER",env:["TASK_ID","RUN_ID"]},{name:"TeamCity",constant:"TEAMCITY",env:"TEAMCITY_VERSION"},{name:"Travis CI",constant:"TRAVIS",env:"TRAVIS",pr:{env:"TRAVIS_PULL_REQUEST",ne:"false"}},{name:"Vela",constant:"VELA",env:"VELA",pr:{VELA_PULL_REQUEST:"1"}},{name:"Vercel",constant:"VERCEL",env:{any:["NOW_BUILDER","VERCEL"]},pr:"VERCEL_GIT_PULL_REQUEST_ID"},{name:"Visual Studio App Center",constant:"APPCENTER",env:"APPCENTER_BUILD_ID"},{name:"Woodpecker",constant:"WOODPECKER",env:{CI:"woodpecker"},pr:{CI_BUILD_EVENT:"pull_request"}},{name:"Xcode Cloud",constant:"XCODE_CLOUD",env:"CI_XCODE_PROJECT",pr:"CI_PULL_REQUEST_NUMBER"},{name:"Xcode Server",constant:"XCODE_SERVER",env:"XCS"}]});var sg=_(nl=>{"use strict";var YV=GV(),ls=process.env;Object.defineProperty(nl,"_vendors",{value:YV.map(function(t){return t.constant})});nl.name=null;nl.isPR=null;YV.forEach(function(t){let r=(Array.isArray(t.env)?t.env:[t.env]).every(function(o){return WV(o)});if(nl[t.constant]=r,!!r)switch(nl.name=t.name,typeof t.pr){case"string":nl.isPR=!!ls[t.pr];break;case"object":"env"in t.pr?nl.isPR=t.pr.env in ls&&ls[t.pr.env]!==t.pr.ne:"any"in t.pr?nl.isPR=t.pr.any.some(function(o){return!!ls[o]}):nl.isPR=WV(t.pr);break;default:nl.isPR=null}});nl.isCI=!!(ls.CI!=="false"&&(ls.BUILD_ID||ls.BUILD_NUMBER||ls.CI||ls.CI_APP_ID||ls.CI_BUILD_ID||ls.CI_BUILD_NUMBER||ls.CI_NAME||ls.CONTINUOUS_INTEGRATION||ls.RUN_ID||nl.name));function WV(t){return typeof t=="string"?!!ls[t]:"env"in t?ls[t.env]&&ls[t.env].includes(t.includes):"any"in t?t.any.some(function(e){return!!ls[e]}):Object.keys(t).every(function(e){return ls[e]===t[e]})}});var Kn,pn,og,iL,SP,KV,sL,oL,xP=It(()=>{(function(t){t.StartOfInput="\0",t.EndOfInput="",t.EndOfPartialInput=""})(Kn||(Kn={}));(function(t){t[t.InitialNode=0]="InitialNode",t[t.SuccessNode=1]="SuccessNode",t[t.ErrorNode=2]="ErrorNode",t[t.CustomNode=3]="CustomNode"})(pn||(pn={}));og=-1,iL=/^(-h|--help)(?:=([0-9]+))?$/,SP=/^(--[a-z]+(?:-[a-z]+)*|-[a-zA-Z]+)$/,KV=/^-[a-zA-Z]{2,}$/,sL=/^([^=]+)=([\s\S]*)$/,oL=process.env.DEBUG_CLI==="1"});var ot,Dm,bP,aL,kP=It(()=>{xP();ot=class extends Error{constructor(e){super(e),this.clipanion={type:"usage"},this.name="UsageError"}},Dm=class extends Error{constructor(e,r){if(super(),this.input=e,this.candidates=r,this.clipanion={type:"none"},this.name="UnknownSyntaxError",this.candidates.length===0)this.message="Command not found, but we're not sure what's the alternative.";else if(this.candidates.every(o=>o.reason!==null&&o.reason===r[0].reason)){let[{reason:o}]=this.candidates;this.message=`${o} ${this.candidates.map(({usage:a})=>`$ ${a}`).join(` `)}`}else if(this.candidates.length===1){let[{usage:o}]=this.candidates;this.message=`Command not found; did you mean: $ ${o} ${aL(e)}`}else this.message=`Command not found; did you mean one of: ${this.candidates.map(({usage:o},a)=>`${`${a}.`.padStart(4)} ${o}`).join(` `)} ${aL(e)}`}},bP=class extends Error{constructor(e,r){super(),this.input=e,this.usages=r,this.clipanion={type:"none"},this.name="AmbiguousSyntaxError",this.message=`Cannot find which to pick amongst the following alternatives: ${this.usages.map((o,a)=>`${`${a}.`.padStart(4)} ${o}`).join(` `)} ${aL(e)}`}},aL=t=>`While running ${t.filter(e=>e!==Kn.EndOfInput&&e!==Kn.EndOfPartialInput).map(e=>{let r=JSON.stringify(e);return e.match(/\s/)||e.length===0||r!==`"${e}"`?r:e}).join(" ")}`});function _6e(t){let e=t.split(` `),r=e.filter(a=>a.match(/\S/)),o=r.length>0?r.reduce((a,n)=>Math.min(a,n.length-n.trimStart().length),Number.MAX_VALUE):0;return e.map(a=>a.slice(o).trimRight()).join(` `)}function yo(t,{format:e,paragraphs:r}){return t=t.replace(/\r\n?/g,` `),t=_6e(t),t=t.replace(/^\n+|\n+$/g,""),t=t.replace(/^(\s*)-([^\n]*?)\n+/gm,`$1-$2 `),t=t.replace(/\n(\n)?\n*/g,(o,a)=>a||" "),r&&(t=t.split(/\n/).map(o=>{let a=o.match(/^\s*[*-][\t ]+(.*)/);if(!a)return o.match(/(.{1,80})(?: |$)/g).join(` `);let n=o.length-o.trimStart().length;return a[1].match(new RegExp(`(.{1,${78-n}})(?: |$)`,"g")).map((u,A)=>" ".repeat(n)+(A===0?"- ":" ")+u).join(` `)}).join(` `)),t=t.replace(/(`+)((?:.|[\n])*?)\1/g,(o,a,n)=>e.code(a+n+a)),t=t.replace(/(\*\*)((?:.|[\n])*?)\1/g,(o,a,n)=>e.bold(a+n+a)),t?`${t} `:""}var lL,VV,zV,cL=It(()=>{lL=Array(80).fill("\u2501");for(let t=0;t<=24;++t)lL[lL.length-t]=`\x1B[38;5;${232+t}m\u2501`;VV={header:t=>`\x1B[1m\u2501\u2501\u2501 ${t}${t.length<75?` ${lL.slice(t.length+5).join("")}`:":"}\x1B[0m`,bold:t=>`\x1B[1m${t}\x1B[22m`,error:t=>`\x1B[31m\x1B[1m${t}\x1B[22m\x1B[39m`,code:t=>`\x1B[36m${t}\x1B[39m`},zV={header:t=>t,bold:t=>t,error:t=>t,code:t=>t}});function Wo(t){return{...t,[Cw]:!0}}function Yu(t,e){return typeof t>"u"?[t,e]:typeof t=="object"&&t!==null&&!Array.isArray(t)?[void 0,t]:[t,e]}function QP(t,{mergeName:e=!1}={}){let r=t.match(/^([^:]+): (.*)$/m);if(!r)return"validation failed";let[,o,a]=r;return e&&(a=a[0].toLowerCase()+a.slice(1)),a=o!=="."||!e?`${o.replace(/^\.(\[|$)/,"$1")}: ${a}`:`: ${a}`,a}function Iw(t,e){return e.length===1?new ot(`${t}${QP(e[0],{mergeName:!0})}`):new ot(`${t}: ${e.map(r=>` - ${QP(r)}`).join("")}`)}function ag(t,e,r){if(typeof r>"u")return e;let o=[],a=[],n=A=>{let p=e;return e=A,n.bind(null,p)};if(!r(e,{errors:o,coercions:a,coercion:n}))throw Iw(`Invalid value for ${t}`,o);for(let[,A]of a)A();return e}var Cw,yf=It(()=>{kP();Cw=Symbol("clipanion/isOption")});var Yo={};Kt(Yo,{KeyRelationship:()=>Ku,TypeAssertionError:()=>Jp,applyCascade:()=>vw,as:()=>sqe,assert:()=>rqe,assertWithErrors:()=>nqe,cascade:()=>LP,fn:()=>oqe,hasAtLeastOneKey:()=>dL,hasExactLength:()=>ez,hasForbiddenKeys:()=>Dqe,hasKeyRelationship:()=>Pw,hasMaxLength:()=>lqe,hasMinLength:()=>aqe,hasMutuallyExclusiveKeys:()=>Pqe,hasRequiredKeys:()=>vqe,hasUniqueItems:()=>cqe,isArray:()=>FP,isAtLeast:()=>hL,isAtMost:()=>fqe,isBase64:()=>Cqe,isBoolean:()=>V6e,isDate:()=>J6e,isDict:()=>$6e,isEnum:()=>js,isHexColor:()=>Eqe,isISO8601:()=>yqe,isInExclusiveRange:()=>hqe,isInInclusiveRange:()=>pqe,isInstanceOf:()=>tqe,isInteger:()=>gL,isJSON:()=>Iqe,isLiteral:()=>XV,isLowerCase:()=>gqe,isMap:()=>Z6e,isNegative:()=>uqe,isNullable:()=>Bqe,isNumber:()=>fL,isObject:()=>ZV,isOneOf:()=>pL,isOptional:()=>wqe,isPartial:()=>eqe,isPayload:()=>z6e,isPositive:()=>Aqe,isRecord:()=>TP,isSet:()=>X6e,isString:()=>Sm,isTuple:()=>RP,isUUID4:()=>mqe,isUnknown:()=>AL,isUpperCase:()=>dqe,makeTrait:()=>$V,makeValidator:()=>qr,matchesRegExp:()=>Bw,softAssert:()=>iqe});function Vn(t){return t===null?"null":t===void 0?"undefined":t===""?"an empty string":typeof t=="symbol"?`<${t.toString()}>`:Array.isArray(t)?"an array":JSON.stringify(t)}function Pm(t,e){if(t.length===0)return"nothing";if(t.length===1)return Vn(t[0]);let r=t.slice(0,-1),o=t[t.length-1],a=t.length>2?`, ${e} `:` ${e} `;return`${r.map(n=>Vn(n)).join(", ")}${a}${Vn(o)}`}function zp(t,e){var r,o,a;return typeof e=="number"?`${(r=t?.p)!==null&&r!==void 0?r:"."}[${e}]`:H6e.test(e)?`${(o=t?.p)!==null&&o!==void 0?o:""}.${e}`:`${(a=t?.p)!==null&&a!==void 0?a:"."}[${JSON.stringify(e)}]`}function uL(t,e,r){return t===1?e:r}function gr({errors:t,p:e}={},r){return t?.push(`${e??"."}: ${r}`),!1}function Y6e(t,e){return r=>{t[e]=r}}function Vu(t,e){return r=>{let o=t[e];return t[e]=r,Vu(t,e).bind(null,o)}}function ww(t,e,r){let o=()=>(t(r()),a),a=()=>(t(e),o);return o}function AL(){return qr({test:(t,e)=>!0})}function XV(t){return qr({test:(e,r)=>e!==t?gr(r,`Expected ${Vn(t)} (got ${Vn(e)})`):!0})}function Sm(){return qr({test:(t,e)=>typeof t!="string"?gr(e,`Expected a string (got ${Vn(t)})`):!0})}function js(t){let e=Array.isArray(t)?t:Object.values(t),r=e.every(a=>typeof a=="string"||typeof a=="number"),o=new Set(e);return o.size===1?XV([...o][0]):qr({test:(a,n)=>o.has(a)?!0:r?gr(n,`Expected one of ${Pm(e,"or")} (got ${Vn(a)})`):gr(n,`Expected a valid enumeration value (got ${Vn(a)})`)})}function V6e(){return qr({test:(t,e)=>{var r;if(typeof t!="boolean"){if(typeof e?.coercions<"u"){if(typeof e?.coercion>"u")return gr(e,"Unbound coercion result");let o=K6e.get(t);if(typeof o<"u")return e.coercions.push([(r=e.p)!==null&&r!==void 0?r:".",e.coercion.bind(null,o)]),!0}return gr(e,`Expected a boolean (got ${Vn(t)})`)}return!0}})}function fL(){return qr({test:(t,e)=>{var r;if(typeof t!="number"){if(typeof e?.coercions<"u"){if(typeof e?.coercion>"u")return gr(e,"Unbound coercion result");let o;if(typeof t=="string"){let a;try{a=JSON.parse(t)}catch{}if(typeof a=="number")if(JSON.stringify(a)===t)o=a;else return gr(e,`Received a number that can't be safely represented by the runtime (${t})`)}if(typeof o<"u")return e.coercions.push([(r=e.p)!==null&&r!==void 0?r:".",e.coercion.bind(null,o)]),!0}return gr(e,`Expected a number (got ${Vn(t)})`)}return!0}})}function z6e(t){return qr({test:(e,r)=>{var o;if(typeof r?.coercions>"u")return gr(r,"The isPayload predicate can only be used with coercion enabled");if(typeof r.coercion>"u")return gr(r,"Unbound coercion result");if(typeof e!="string")return gr(r,`Expected a string (got ${Vn(e)})`);let a;try{a=JSON.parse(e)}catch{return gr(r,`Expected a JSON string (got ${Vn(e)})`)}let n={value:a};return t(a,Object.assign(Object.assign({},r),{coercion:Vu(n,"value")}))?(r.coercions.push([(o=r.p)!==null&&o!==void 0?o:".",r.coercion.bind(null,n.value)]),!0):!1}})}function J6e(){return qr({test:(t,e)=>{var r;if(!(t instanceof Date)){if(typeof e?.coercions<"u"){if(typeof e?.coercion>"u")return gr(e,"Unbound coercion result");let o;if(typeof t=="string"&&JV.test(t))o=new Date(t);else{let a;if(typeof t=="string"){let n;try{n=JSON.parse(t)}catch{}typeof n=="number"&&(a=n)}else typeof t=="number"&&(a=t);if(typeof a<"u")if(Number.isSafeInteger(a)||!Number.isSafeInteger(a*1e3))o=new Date(a*1e3);else return gr(e,`Received a timestamp that can't be safely represented by the runtime (${t})`)}if(typeof o<"u")return e.coercions.push([(r=e.p)!==null&&r!==void 0?r:".",e.coercion.bind(null,o)]),!0}return gr(e,`Expected a date (got ${Vn(t)})`)}return!0}})}function FP(t,{delimiter:e}={}){return qr({test:(r,o)=>{var a;let n=r;if(typeof r=="string"&&typeof e<"u"&&typeof o?.coercions<"u"){if(typeof o?.coercion>"u")return gr(o,"Unbound coercion result");r=r.split(e)}if(!Array.isArray(r))return gr(o,`Expected an array (got ${Vn(r)})`);let u=!0;for(let A=0,p=r.length;A{var n,u;if(Object.getPrototypeOf(o).toString()==="[object Set]")if(typeof a?.coercions<"u"){if(typeof a?.coercion>"u")return gr(a,"Unbound coercion result");let A=[...o],p=[...o];if(!r(p,Object.assign(Object.assign({},a),{coercion:void 0})))return!1;let h=()=>p.some((E,w)=>E!==A[w])?new Set(p):o;return a.coercions.push([(n=a.p)!==null&&n!==void 0?n:".",ww(a.coercion,o,h)]),!0}else{let A=!0;for(let p of o)if(A=t(p,Object.assign({},a))&&A,!A&&a?.errors==null)break;return A}if(typeof a?.coercions<"u"){if(typeof a?.coercion>"u")return gr(a,"Unbound coercion result");let A={value:o};return r(o,Object.assign(Object.assign({},a),{coercion:Vu(A,"value")}))?(a.coercions.push([(u=a.p)!==null&&u!==void 0?u:".",ww(a.coercion,o,()=>new Set(A.value))]),!0):!1}return gr(a,`Expected a set (got ${Vn(o)})`)}})}function Z6e(t,e){let r=FP(RP([t,e])),o=TP(e,{keys:t});return qr({test:(a,n)=>{var u,A,p;if(Object.getPrototypeOf(a).toString()==="[object Map]")if(typeof n?.coercions<"u"){if(typeof n?.coercion>"u")return gr(n,"Unbound coercion result");let h=[...a],E=[...a];if(!r(E,Object.assign(Object.assign({},n),{coercion:void 0})))return!1;let w=()=>E.some((D,b)=>D[0]!==h[b][0]||D[1]!==h[b][1])?new Map(E):a;return n.coercions.push([(u=n.p)!==null&&u!==void 0?u:".",ww(n.coercion,a,w)]),!0}else{let h=!0;for(let[E,w]of a)if(h=t(E,Object.assign({},n))&&h,!h&&n?.errors==null||(h=e(w,Object.assign(Object.assign({},n),{p:zp(n,E)}))&&h,!h&&n?.errors==null))break;return h}if(typeof n?.coercions<"u"){if(typeof n?.coercion>"u")return gr(n,"Unbound coercion result");let h={value:a};return Array.isArray(a)?r(a,Object.assign(Object.assign({},n),{coercion:void 0}))?(n.coercions.push([(A=n.p)!==null&&A!==void 0?A:".",ww(n.coercion,a,()=>new Map(h.value))]),!0):!1:o(a,Object.assign(Object.assign({},n),{coercion:Vu(h,"value")}))?(n.coercions.push([(p=n.p)!==null&&p!==void 0?p:".",ww(n.coercion,a,()=>new Map(Object.entries(h.value)))]),!0):!1}return gr(n,`Expected a map (got ${Vn(a)})`)}})}function RP(t,{delimiter:e}={}){let r=ez(t.length);return qr({test:(o,a)=>{var n;if(typeof o=="string"&&typeof e<"u"&&typeof a?.coercions<"u"){if(typeof a?.coercion>"u")return gr(a,"Unbound coercion result");o=o.split(e),a.coercions.push([(n=a.p)!==null&&n!==void 0?n:".",a.coercion.bind(null,o)])}if(!Array.isArray(o))return gr(a,`Expected a tuple (got ${Vn(o)})`);let u=r(o,Object.assign({},a));for(let A=0,p=o.length;A{var n;if(Array.isArray(o)&&typeof a?.coercions<"u")return typeof a?.coercion>"u"?gr(a,"Unbound coercion result"):r(o,Object.assign(Object.assign({},a),{coercion:void 0}))?(o=Object.fromEntries(o),a.coercions.push([(n=a.p)!==null&&n!==void 0?n:".",a.coercion.bind(null,o)]),!0):!1;if(typeof o!="object"||o===null)return gr(a,`Expected an object (got ${Vn(o)})`);let u=Object.keys(o),A=!0;for(let p=0,h=u.length;p{if(typeof a!="object"||a===null)return gr(n,`Expected an object (got ${Vn(a)})`);let u=new Set([...r,...Object.keys(a)]),A={},p=!0;for(let h of u){if(h==="constructor"||h==="__proto__")p=gr(Object.assign(Object.assign({},n),{p:zp(n,h)}),"Unsafe property name");else{let E=Object.prototype.hasOwnProperty.call(t,h)?t[h]:void 0,w=Object.prototype.hasOwnProperty.call(a,h)?a[h]:void 0;typeof E<"u"?p=E(w,Object.assign(Object.assign({},n),{p:zp(n,h),coercion:Vu(a,h)}))&&p:e===null?p=gr(Object.assign(Object.assign({},n),{p:zp(n,h)}),`Extraneous property (got ${Vn(w)})`):Object.defineProperty(A,h,{enumerable:!0,get:()=>w,set:Y6e(a,h)})}if(!p&&n?.errors==null)break}return e!==null&&(p||n?.errors!=null)&&(p=e(A,n)&&p),p}});return Object.assign(o,{properties:t})}function eqe(t){return ZV(t,{extra:TP(AL())})}function $V(t){return()=>t}function qr({test:t}){return $V(t)()}function rqe(t,e){if(!e(t))throw new Jp}function nqe(t,e){let r=[];if(!e(t,{errors:r}))throw new Jp({errors:r})}function iqe(t,e){}function sqe(t,e,{coerce:r=!1,errors:o,throw:a}={}){let n=o?[]:void 0;if(!r){if(e(t,{errors:n}))return a?t:{value:t,errors:void 0};if(a)throw new Jp({errors:n});return{value:void 0,errors:n??!0}}let u={value:t},A=Vu(u,"value"),p=[];if(!e(t,{errors:n,coercion:A,coercions:p})){if(a)throw new Jp({errors:n});return{value:void 0,errors:n??!0}}for(let[,h]of p)h();return a?u.value:{value:u.value,errors:void 0}}function oqe(t,e){let r=RP(t);return(...o)=>{if(!r(o))throw new Jp;return e(...o)}}function aqe(t){return qr({test:(e,r)=>e.length>=t?!0:gr(r,`Expected to have a length of at least ${t} elements (got ${e.length})`)})}function lqe(t){return qr({test:(e,r)=>e.length<=t?!0:gr(r,`Expected to have a length of at most ${t} elements (got ${e.length})`)})}function ez(t){return qr({test:(e,r)=>e.length!==t?gr(r,`Expected to have a length of exactly ${t} elements (got ${e.length})`):!0})}function cqe({map:t}={}){return qr({test:(e,r)=>{let o=new Set,a=new Set;for(let n=0,u=e.length;nt<=0?!0:gr(e,`Expected to be negative (got ${t})`)})}function Aqe(){return qr({test:(t,e)=>t>=0?!0:gr(e,`Expected to be positive (got ${t})`)})}function hL(t){return qr({test:(e,r)=>e>=t?!0:gr(r,`Expected to be at least ${t} (got ${e})`)})}function fqe(t){return qr({test:(e,r)=>e<=t?!0:gr(r,`Expected to be at most ${t} (got ${e})`)})}function pqe(t,e){return qr({test:(r,o)=>r>=t&&r<=e?!0:gr(o,`Expected to be in the [${t}; ${e}] range (got ${r})`)})}function hqe(t,e){return qr({test:(r,o)=>r>=t&&re!==Math.round(e)?gr(r,`Expected to be an integer (got ${e})`):!t&&!Number.isSafeInteger(e)?gr(r,`Expected to be a safe integer (got ${e})`):!0})}function Bw(t){return qr({test:(e,r)=>t.test(e)?!0:gr(r,`Expected to match the pattern ${t.toString()} (got ${Vn(e)})`)})}function gqe(){return qr({test:(t,e)=>t!==t.toLowerCase()?gr(e,`Expected to be all-lowercase (got ${t})`):!0})}function dqe(){return qr({test:(t,e)=>t!==t.toUpperCase()?gr(e,`Expected to be all-uppercase (got ${t})`):!0})}function mqe(){return qr({test:(t,e)=>W6e.test(t)?!0:gr(e,`Expected to be a valid UUID v4 (got ${Vn(t)})`)})}function yqe(){return qr({test:(t,e)=>JV.test(t)?!0:gr(e,`Expected to be a valid ISO 8601 date string (got ${Vn(t)})`)})}function Eqe({alpha:t=!1}){return qr({test:(e,r)=>(t?q6e.test(e):j6e.test(e))?!0:gr(r,`Expected to be a valid hexadecimal color string (got ${Vn(e)})`)})}function Cqe(){return qr({test:(t,e)=>G6e.test(t)?!0:gr(e,`Expected to be a valid base 64 string (got ${Vn(t)})`)})}function Iqe(t=AL()){return qr({test:(e,r)=>{let o;try{o=JSON.parse(e)}catch{return gr(r,`Expected to be a valid JSON string (got ${Vn(e)})`)}return t(o,r)}})}function LP(t,...e){let r=Array.isArray(e[0])?e[0]:e;return qr({test:(o,a)=>{var n,u;let A={value:o},p=typeof a?.coercions<"u"?Vu(A,"value"):void 0,h=typeof a?.coercions<"u"?[]:void 0;if(!t(o,Object.assign(Object.assign({},a),{coercion:p,coercions:h})))return!1;let E=[];if(typeof h<"u")for(let[,w]of h)E.push(w());try{if(typeof a?.coercions<"u"){if(A.value!==o){if(typeof a?.coercion>"u")return gr(a,"Unbound coercion result");a.coercions.push([(n=a.p)!==null&&n!==void 0?n:".",a.coercion.bind(null,A.value)])}(u=a?.coercions)===null||u===void 0||u.push(...h)}return r.every(w=>w(A.value,a))}finally{for(let w of E)w()}}})}function vw(t,...e){let r=Array.isArray(e[0])?e[0]:e;return LP(t,r)}function wqe(t){return qr({test:(e,r)=>typeof e>"u"?!0:t(e,r)})}function Bqe(t){return qr({test:(e,r)=>e===null?!0:t(e,r)})}function vqe(t,e){var r;let o=new Set(t),a=Dw[(r=e?.missingIf)!==null&&r!==void 0?r:"missing"];return qr({test:(n,u)=>{let A=new Set(Object.keys(n)),p=[];for(let h of o)a(A,h,n)||p.push(h);return p.length>0?gr(u,`Missing required ${uL(p.length,"property","properties")} ${Pm(p,"and")}`):!0}})}function dL(t,e){var r;let o=new Set(t),a=Dw[(r=e?.missingIf)!==null&&r!==void 0?r:"missing"];return qr({test:(n,u)=>Object.keys(n).some(h=>a(o,h,n))?!0:gr(u,`Missing at least one property from ${Pm(Array.from(o),"or")}`)})}function Dqe(t,e){var r;let o=new Set(t),a=Dw[(r=e?.missingIf)!==null&&r!==void 0?r:"missing"];return qr({test:(n,u)=>{let A=new Set(Object.keys(n)),p=[];for(let h of o)a(A,h,n)&&p.push(h);return p.length>0?gr(u,`Forbidden ${uL(p.length,"property","properties")} ${Pm(p,"and")}`):!0}})}function Pqe(t,e){var r;let o=new Set(t),a=Dw[(r=e?.missingIf)!==null&&r!==void 0?r:"missing"];return qr({test:(n,u)=>{let A=new Set(Object.keys(n)),p=[];for(let h of o)a(A,h,n)&&p.push(h);return p.length>1?gr(u,`Mutually exclusive properties ${Pm(p,"and")}`):!0}})}function Pw(t,e,r,o){var a,n;let u=new Set((a=o?.ignore)!==null&&a!==void 0?a:[]),A=Dw[(n=o?.missingIf)!==null&&n!==void 0?n:"missing"],p=new Set(r),h=Sqe[e],E=e===Ku.Forbids?"or":"and";return qr({test:(w,D)=>{let b=new Set(Object.keys(w));if(!A(b,t,w)||u.has(w[t]))return!0;let C=[];for(let T of p)(A(b,T,w)&&!u.has(w[T]))!==h.expect&&C.push(T);return C.length>=1?gr(D,`Property "${t}" ${h.message} ${uL(C.length,"property","properties")} ${Pm(C,E)}`):!0}})}var H6e,q6e,j6e,G6e,W6e,JV,K6e,tqe,pL,Jp,Dw,Ku,Sqe,il=It(()=>{H6e=/^[a-zA-Z_][a-zA-Z0-9_]*$/;q6e=/^#[0-9a-f]{6}$/i,j6e=/^#[0-9a-f]{6}([0-9a-f]{2})?$/i,G6e=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,W6e=/^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}$/i,JV=/^(?:[1-9]\d{3}(-?)(?:(?:0[1-9]|1[0-2])\1(?:0[1-9]|1\d|2[0-8])|(?:0[13-9]|1[0-2])\1(?:29|30)|(?:0[13578]|1[02])(?:\1)31|00[1-9]|0[1-9]\d|[12]\d{2}|3(?:[0-5]\d|6[0-5]))|(?:[1-9]\d(?:0[48]|[2468][048]|[13579][26])|(?:[2468][048]|[13579][26])00)(?:(-?)02(?:\2)29|-?366))T(?:[01]\d|2[0-3])(:?)[0-5]\d(?:\3[0-5]\d)?(?:Z|[+-][01]\d(?:\3[0-5]\d)?)$/;K6e=new Map([["true",!0],["True",!0],["1",!0],[1,!0],["false",!1],["False",!1],["0",!1],[0,!1]]);tqe=t=>qr({test:(e,r)=>e instanceof t?!0:gr(r,`Expected an instance of ${t.name} (got ${Vn(e)})`)}),pL=(t,{exclusive:e=!1}={})=>qr({test:(r,o)=>{var a,n,u;let A=[],p=typeof o?.errors<"u"?[]:void 0;for(let h=0,E=t.length;h1?gr(o,`Expected to match exactly a single predicate (matched ${A.join(", ")})`):(u=o?.errors)===null||u===void 0||u.push(...p),!1}});Jp=class extends Error{constructor({errors:e}={}){let r="Type mismatch";if(e&&e.length>0){r+=` `;for(let o of e)r+=` - ${o}`}super(r)}};Dw={missing:(t,e)=>t.has(e),undefined:(t,e,r)=>t.has(e)&&typeof r[e]<"u",nil:(t,e,r)=>t.has(e)&&r[e]!=null,falsy:(t,e,r)=>t.has(e)&&!!r[e]};(function(t){t.Forbids="Forbids",t.Requires="Requires"})(Ku||(Ku={}));Sqe={[Ku.Forbids]:{expect:!1,message:"forbids using"},[Ku.Requires]:{expect:!0,message:"requires using"}}});var st,Xp=It(()=>{yf();st=class{constructor(){this.help=!1}static Usage(e){return e}async catch(e){throw e}async validateAndExecute(){let r=this.constructor.schema;if(Array.isArray(r)){let{isDict:a,isUnknown:n,applyCascade:u}=await Promise.resolve().then(()=>(il(),Yo)),A=u(a(n()),r),p=[],h=[];if(!A(this,{errors:p,coercions:h}))throw Iw("Invalid option schema",p);for(let[,w]of h)w()}else if(r!=null)throw new Error("Invalid command schema");let o=await this.execute();return typeof o<"u"?o:0}};st.isOption=Cw;st.Default=[]});function Sa(t){oL&&console.log(t)}function rz(){let t={nodes:[]};for(let e=0;e{if(e.has(o))return;e.add(o);let a=t.nodes[o];for(let u of Object.values(a.statics))for(let{to:A}of u)r(A);for(let[,{to:u}]of a.dynamics)r(u);for(let{to:u}of a.shortcuts)r(u);let n=new Set(a.shortcuts.map(({to:u})=>u));for(;a.shortcuts.length>0;){let{to:u}=a.shortcuts.shift(),A=t.nodes[u];for(let[p,h]of Object.entries(A.statics)){let E=Object.prototype.hasOwnProperty.call(a.statics,p)?a.statics[p]:a.statics[p]=[];for(let w of h)E.some(({to:D})=>w.to===D)||E.push(w)}for(let[p,h]of A.dynamics)a.dynamics.some(([E,{to:w}])=>p===E&&h.to===w)||a.dynamics.push([p,h]);for(let p of A.shortcuts)n.has(p.to)||(a.shortcuts.push(p),n.add(p.to))}};r(pn.InitialNode)}function kqe(t,{prefix:e=""}={}){if(oL){Sa(`${e}Nodes are:`);for(let r=0;rE!==pn.ErrorNode).map(({state:E})=>({usage:E.candidateUsage,reason:null})));if(h.every(({node:E})=>E===pn.ErrorNode))throw new Dm(e,h.map(({state:E})=>({usage:E.candidateUsage,reason:E.errorMessage})));o=Rqe(h)}if(o.length>0){Sa(" Results:");for(let n of o)Sa(` - ${n.node} -> ${JSON.stringify(n.state)}`)}else Sa(" No results");return o}function Fqe(t,e,{endToken:r=Kn.EndOfInput}={}){let o=Qqe(t,[...e,r]);return Tqe(e,o.map(({state:a})=>a))}function Rqe(t){let e=0;for(let{state:r}of t)r.path.length>e&&(e=r.path.length);return t.filter(({state:r})=>r.path.length===e)}function Tqe(t,e){let r=e.filter(D=>D.selectedIndex!==null),o=r.filter(D=>!D.partial);if(o.length>0&&(r=o),r.length===0)throw new Error;let a=r.filter(D=>D.selectedIndex===og||D.requiredOptions.every(b=>b.some(C=>D.options.find(T=>T.name===C))));if(a.length===0)throw new Dm(t,r.map(D=>({usage:D.candidateUsage,reason:null})));let n=0;for(let D of a)D.path.length>n&&(n=D.path.length);let u=a.filter(D=>D.path.length===n),A=D=>D.positionals.filter(({extra:b})=>!b).length+D.options.length,p=u.map(D=>({state:D,positionalCount:A(D)})),h=0;for(let{positionalCount:D}of p)D>h&&(h=D);let E=p.filter(({positionalCount:D})=>D===h).map(({state:D})=>D),w=Lqe(E);if(w.length>1)throw new bP(t,w.map(D=>D.candidateUsage));return w[0]}function Lqe(t){let e=[],r=[];for(let o of t)o.selectedIndex===og?r.push(o):e.push(o);return r.length>0&&e.push({...tz,path:nz(...r.map(o=>o.path)),options:r.reduce((o,a)=>o.concat(a.options),[])}),e}function nz(t,e,...r){return e===void 0?Array.from(t):nz(t.filter((o,a)=>o===e[a]),...r)}function sl(){return{dynamics:[],shortcuts:[],statics:{}}}function iz(t){return t===pn.SuccessNode||t===pn.ErrorNode}function mL(t,e=0){return{to:iz(t.to)?t.to:t.to>=pn.CustomNode?t.to+e-pn.CustomNode+1:t.to+e,reducer:t.reducer}}function Nqe(t,e=0){let r=sl();for(let[o,a]of t.dynamics)r.dynamics.push([o,mL(a,e)]);for(let o of t.shortcuts)r.shortcuts.push(mL(o,e));for(let[o,a]of Object.entries(t.statics))r.statics[o]=a.map(n=>mL(n,e));return r}function Bs(t,e,r,o,a){t.nodes[e].dynamics.push([r,{to:o,reducer:a}])}function xm(t,e,r,o){t.nodes[e].shortcuts.push({to:r,reducer:o})}function Ko(t,e,r,o,a){(Object.prototype.hasOwnProperty.call(t.nodes[e].statics,r)?t.nodes[e].statics[r]:t.nodes[e].statics[r]=[]).push({to:o,reducer:a})}function NP(t,e,r,o,a){if(Array.isArray(e)){let[n,...u]=e;return t[n](r,o,a,...u)}else return t[e](r,o,a)}var tz,Oqe,yL,ol,EL,OP,MP=It(()=>{xP();kP();tz={candidateUsage:null,requiredOptions:[],errorMessage:null,ignoreOptions:!1,path:[],positionals:[],options:[],remainder:null,selectedIndex:og,partial:!1,tokens:[]};Oqe={always:()=>!0,isOptionLike:(t,e)=>!t.ignoreOptions&&e!=="-"&&e.startsWith("-"),isNotOptionLike:(t,e)=>t.ignoreOptions||e==="-"||!e.startsWith("-"),isOption:(t,e,r,o)=>!t.ignoreOptions&&e===o,isBatchOption:(t,e,r,o)=>!t.ignoreOptions&&KV.test(e)&&[...e.slice(1)].every(a=>o.has(`-${a}`)),isBoundOption:(t,e,r,o,a)=>{let n=e.match(sL);return!t.ignoreOptions&&!!n&&SP.test(n[1])&&o.has(n[1])&&a.filter(u=>u.nameSet.includes(n[1])).every(u=>u.allowBinding)},isNegatedOption:(t,e,r,o)=>!t.ignoreOptions&&e===`--no-${o.slice(2)}`,isHelp:(t,e)=>!t.ignoreOptions&&iL.test(e),isUnsupportedOption:(t,e,r,o)=>!t.ignoreOptions&&e.startsWith("-")&&SP.test(e)&&!o.has(e),isInvalidOption:(t,e)=>!t.ignoreOptions&&e.startsWith("-")&&!SP.test(e)},yL={setCandidateState:(t,e,r,o)=>({...t,...o}),setSelectedIndex:(t,e,r,o)=>({...t,selectedIndex:o}),setPartialIndex:(t,e,r,o)=>({...t,selectedIndex:o,partial:!0}),pushBatch:(t,e,r,o)=>{let a=t.options.slice(),n=t.tokens.slice();for(let u=1;u{let[,o,a]=e.match(sL),n=t.options.concat({name:o,value:a}),u=t.tokens.concat([{segmentIndex:r,type:"option",slice:[0,o.length],option:o},{segmentIndex:r,type:"assign",slice:[o.length,o.length+1]},{segmentIndex:r,type:"value",slice:[o.length+1,o.length+a.length+1]}]);return{...t,options:n,tokens:u}},pushPath:(t,e,r)=>{let o=t.path.concat(e),a=t.tokens.concat({segmentIndex:r,type:"path"});return{...t,path:o,tokens:a}},pushPositional:(t,e,r)=>{let o=t.positionals.concat({value:e,extra:!1}),a=t.tokens.concat({segmentIndex:r,type:"positional"});return{...t,positionals:o,tokens:a}},pushExtra:(t,e,r)=>{let o=t.positionals.concat({value:e,extra:!0}),a=t.tokens.concat({segmentIndex:r,type:"positional"});return{...t,positionals:o,tokens:a}},pushExtraNoLimits:(t,e,r)=>{let o=t.positionals.concat({value:e,extra:ol}),a=t.tokens.concat({segmentIndex:r,type:"positional"});return{...t,positionals:o,tokens:a}},pushTrue:(t,e,r,o)=>{let a=t.options.concat({name:o,value:!0}),n=t.tokens.concat({segmentIndex:r,type:"option",option:o});return{...t,options:a,tokens:n}},pushFalse:(t,e,r,o)=>{let a=t.options.concat({name:o,value:!1}),n=t.tokens.concat({segmentIndex:r,type:"option",option:o});return{...t,options:a,tokens:n}},pushUndefined:(t,e,r,o)=>{let a=t.options.concat({name:e,value:void 0}),n=t.tokens.concat({segmentIndex:r,type:"option",option:e});return{...t,options:a,tokens:n}},pushStringValue:(t,e,r)=>{var o;let a=t.options[t.options.length-1],n=t.options.slice(),u=t.tokens.concat({segmentIndex:r,type:"value"});return a.value=((o=a.value)!==null&&o!==void 0?o:[]).concat([e]),{...t,options:n,tokens:u}},setStringValue:(t,e,r)=>{let o=t.options[t.options.length-1],a=t.options.slice(),n=t.tokens.concat({segmentIndex:r,type:"value"});return o.value=e,{...t,options:a,tokens:n}},inhibateOptions:t=>({...t,ignoreOptions:!0}),useHelp:(t,e,r,o)=>{let[,,a]=e.match(iL);return typeof a<"u"?{...t,options:[{name:"-c",value:String(o)},{name:"-i",value:a}]}:{...t,options:[{name:"-c",value:String(o)}]}},setError:(t,e,r,o)=>e===Kn.EndOfInput||e===Kn.EndOfPartialInput?{...t,errorMessage:`${o}.`}:{...t,errorMessage:`${o} ("${e}").`},setOptionArityError:(t,e)=>{let r=t.options[t.options.length-1];return{...t,errorMessage:`Not enough arguments to option ${r.name}.`}}},ol=Symbol(),EL=class{constructor(e,r){this.allOptionNames=new Map,this.arity={leading:[],trailing:[],extra:[],proxy:!1},this.options=[],this.paths=[],this.cliIndex=e,this.cliOpts=r}addPath(e){this.paths.push(e)}setArity({leading:e=this.arity.leading,trailing:r=this.arity.trailing,extra:o=this.arity.extra,proxy:a=this.arity.proxy}){Object.assign(this.arity,{leading:e,trailing:r,extra:o,proxy:a})}addPositional({name:e="arg",required:r=!0}={}){if(!r&&this.arity.extra===ol)throw new Error("Optional parameters cannot be declared when using .rest() or .proxy()");if(!r&&this.arity.trailing.length>0)throw new Error("Optional parameters cannot be declared after the required trailing positional arguments");!r&&this.arity.extra!==ol?this.arity.extra.push(e):this.arity.extra!==ol&&this.arity.extra.length===0?this.arity.leading.push(e):this.arity.trailing.push(e)}addRest({name:e="arg",required:r=0}={}){if(this.arity.extra===ol)throw new Error("Infinite lists cannot be declared multiple times in the same command");if(this.arity.trailing.length>0)throw new Error("Infinite lists cannot be declared after the required trailing positional arguments");for(let o=0;o1)throw new Error("The arity cannot be higher than 1 when the option only supports the --arg=value syntax");if(!Number.isInteger(o))throw new Error(`The arity must be an integer, got ${o}`);if(o<0)throw new Error(`The arity must be positive, got ${o}`);let A=e.reduce((p,h)=>h.length>p.length?h:p,"");for(let p of e)this.allOptionNames.set(p,A);this.options.push({preferredName:A,nameSet:e,description:r,arity:o,hidden:a,required:n,allowBinding:u})}setContext(e){this.context=e}usage({detailed:e=!0,inlineOptions:r=!0}={}){let o=[this.cliOpts.binaryName],a=[];if(this.paths.length>0&&o.push(...this.paths[0]),e){for(let{preferredName:u,nameSet:A,arity:p,hidden:h,description:E,required:w}of this.options){if(h)continue;let D=[];for(let C=0;C`:`[${b}]`)}o.push(...this.arity.leading.map(u=>`<${u}>`)),this.arity.extra===ol?o.push("..."):o.push(...this.arity.extra.map(u=>`[${u}]`)),o.push(...this.arity.trailing.map(u=>`<${u}>`))}return{usage:o.join(" "),options:a}}compile(){if(typeof this.context>"u")throw new Error("Assertion failed: No context attached");let e=rz(),r=pn.InitialNode,o=this.usage().usage,a=this.options.filter(A=>A.required).map(A=>A.nameSet);r=jc(e,sl()),Ko(e,pn.InitialNode,Kn.StartOfInput,r,["setCandidateState",{candidateUsage:o,requiredOptions:a}]);let n=this.arity.proxy?"always":"isNotOptionLike",u=this.paths.length>0?this.paths:[[]];for(let A of u){let p=r;if(A.length>0){let D=jc(e,sl());xm(e,p,D),this.registerOptions(e,D),p=D}for(let D=0;D0||!this.arity.proxy){let D=jc(e,sl());Bs(e,p,"isHelp",D,["useHelp",this.cliIndex]),Bs(e,D,"always",D,"pushExtra"),Ko(e,D,Kn.EndOfInput,pn.SuccessNode,["setSelectedIndex",og]),this.registerOptions(e,p)}this.arity.leading.length>0&&(Ko(e,p,Kn.EndOfInput,pn.ErrorNode,["setError","Not enough positional arguments"]),Ko(e,p,Kn.EndOfPartialInput,pn.SuccessNode,["setPartialIndex",this.cliIndex]));let h=p;for(let D=0;D0||D+1!==this.arity.leading.length)&&(Ko(e,b,Kn.EndOfInput,pn.ErrorNode,["setError","Not enough positional arguments"]),Ko(e,b,Kn.EndOfPartialInput,pn.SuccessNode,["setPartialIndex",this.cliIndex])),Bs(e,h,"isNotOptionLike",b,"pushPositional"),h=b}let E=h;if(this.arity.extra===ol||this.arity.extra.length>0){let D=jc(e,sl());if(xm(e,h,D),this.arity.extra===ol){let b=jc(e,sl());this.arity.proxy||this.registerOptions(e,b),Bs(e,h,n,b,"pushExtraNoLimits"),Bs(e,b,n,b,"pushExtraNoLimits"),xm(e,b,D)}else for(let b=0;b0)&&this.registerOptions(e,C),Bs(e,E,n,C,"pushExtra"),xm(e,C,D),E=C}E=D}this.arity.trailing.length>0&&(Ko(e,E,Kn.EndOfInput,pn.ErrorNode,["setError","Not enough positional arguments"]),Ko(e,E,Kn.EndOfPartialInput,pn.SuccessNode,["setPartialIndex",this.cliIndex]));let w=E;for(let D=0;D=0&&e{let u=n?Kn.EndOfPartialInput:Kn.EndOfInput;return Fqe(o,a,{endToken:u})}}}}});function oz(){return UP.default&&"getColorDepth"in UP.default.WriteStream.prototype?UP.default.WriteStream.prototype.getColorDepth():process.env.FORCE_COLOR==="0"?1:process.env.FORCE_COLOR==="1"||typeof process.stdout<"u"&&process.stdout.isTTY?8:1}function az(t){let e=sz;if(typeof e>"u"){if(t.stdout===process.stdout&&t.stderr===process.stderr)return null;let{AsyncLocalStorage:r}=ve("async_hooks");e=sz=new r;let o=process.stdout._write;process.stdout._write=function(n,u,A){let p=e.getStore();return typeof p>"u"?o.call(this,n,u,A):p.stdout.write(n,u,A)};let a=process.stderr._write;process.stderr._write=function(n,u,A){let p=e.getStore();return typeof p>"u"?a.call(this,n,u,A):p.stderr.write(n,u,A)}}return r=>e.run(t,r)}var UP,sz,lz=It(()=>{UP=et(ve("tty"),1)});var _P,cz=It(()=>{Xp();_P=class t extends st{constructor(e){super(),this.contexts=e,this.commands=[]}static from(e,r){let o=new t(r);o.path=e.path;for(let a of e.options)switch(a.name){case"-c":o.commands.push(Number(a.value));break;case"-i":o.index=Number(a.value);break}return o}async execute(){let e=this.commands;if(typeof this.index<"u"&&this.index>=0&&this.index1){this.context.stdout.write(`Multiple commands match your selection: `),this.context.stdout.write(` `);let r=0;for(let o of this.commands)this.context.stdout.write(this.cli.usage(this.contexts[o].commandClass,{prefix:`${r++}. `.padStart(5)}));this.context.stdout.write(` `),this.context.stdout.write(`Run again with -h= to see the longer details of any of those commands. `)}}}});async function fz(...t){let{resolvedOptions:e,resolvedCommandClasses:r,resolvedArgv:o,resolvedContext:a}=hz(t);return Vo.from(r,e).runExit(o,a)}async function pz(...t){let{resolvedOptions:e,resolvedCommandClasses:r,resolvedArgv:o,resolvedContext:a}=hz(t);return Vo.from(r,e).run(o,a)}function hz(t){let e,r,o,a;switch(typeof process<"u"&&typeof process.argv<"u"&&(o=process.argv.slice(2)),t.length){case 1:r=t[0];break;case 2:t[0]&&t[0].prototype instanceof st||Array.isArray(t[0])?(r=t[0],Array.isArray(t[1])?o=t[1]:a=t[1]):(e=t[0],r=t[1]);break;case 3:Array.isArray(t[2])?(e=t[0],r=t[1],o=t[2]):t[0]&&t[0].prototype instanceof st||Array.isArray(t[0])?(r=t[0],o=t[1],a=t[2]):(e=t[0],r=t[1],a=t[2]);break;default:e=t[0],r=t[1],o=t[2],a=t[3];break}if(typeof o>"u")throw new Error("The argv parameter must be provided when running Clipanion outside of a Node context");return{resolvedOptions:e,resolvedCommandClasses:r,resolvedArgv:o,resolvedContext:a}}function Az(t){return t()}var uz,Vo,gz=It(()=>{xP();MP();cL();lz();Xp();cz();uz=Symbol("clipanion/errorCommand");Vo=class t{constructor({binaryLabel:e,binaryName:r="...",binaryVersion:o,enableCapture:a=!1,enableColors:n}={}){this.registrations=new Map,this.builder=new OP({binaryName:r}),this.binaryLabel=e,this.binaryName=r,this.binaryVersion=o,this.enableCapture=a,this.enableColors=n}static from(e,r={}){let o=new t(r),a=Array.isArray(e)?e:[e];for(let n of a)o.register(n);return o}register(e){var r;let o=new Map,a=new e;for(let p in a){let h=a[p];typeof h=="object"&&h!==null&&h[st.isOption]&&o.set(p,h)}let n=this.builder.command(),u=n.cliIndex,A=(r=e.paths)!==null&&r!==void 0?r:a.paths;if(typeof A<"u")for(let p of A)n.addPath(p);this.registrations.set(e,{specs:o,builder:n,index:u});for(let[p,{definition:h}]of o.entries())h(n,p);n.setContext({commandClass:e})}process(e,r){let{input:o,context:a,partial:n}=typeof e=="object"&&Array.isArray(e)?{input:e,context:r}:e,{contexts:u,process:A}=this.builder.compile(),p=A(o,{partial:n}),h={...t.defaultContext,...a};switch(p.selectedIndex){case og:{let E=_P.from(p,u);return E.context=h,E.tokens=p.tokens,E}default:{let{commandClass:E}=u[p.selectedIndex],w=this.registrations.get(E);if(typeof w>"u")throw new Error("Assertion failed: Expected the command class to have been registered.");let D=new E;D.context=h,D.tokens=p.tokens,D.path=p.path;try{for(let[b,{transformer:C}]of w.specs.entries())D[b]=C(w.builder,b,p,h);return D}catch(b){throw b[uz]=D,b}}break}}async run(e,r){var o,a;let n,u={...t.defaultContext,...r},A=(o=this.enableColors)!==null&&o!==void 0?o:u.colorDepth>1;if(!Array.isArray(e))n=e;else try{n=this.process(e,u)}catch(E){return u.stdout.write(this.error(E,{colored:A})),1}if(n.help)return u.stdout.write(this.usage(n,{colored:A,detailed:!0})),0;n.context=u,n.cli={binaryLabel:this.binaryLabel,binaryName:this.binaryName,binaryVersion:this.binaryVersion,enableCapture:this.enableCapture,enableColors:this.enableColors,definitions:()=>this.definitions(),definition:E=>this.definition(E),error:(E,w)=>this.error(E,w),format:E=>this.format(E),process:(E,w)=>this.process(E,{...u,...w}),run:(E,w)=>this.run(E,{...u,...w}),usage:(E,w)=>this.usage(E,w)};let p=this.enableCapture&&(a=az(u))!==null&&a!==void 0?a:Az,h;try{h=await p(()=>n.validateAndExecute().catch(E=>n.catch(E).then(()=>0)))}catch(E){return u.stdout.write(this.error(E,{colored:A,command:n})),1}return h}async runExit(e,r){process.exitCode=await this.run(e,r)}definition(e,{colored:r=!1}={}){if(!e.usage)return null;let{usage:o}=this.getUsageByRegistration(e,{detailed:!1}),{usage:a,options:n}=this.getUsageByRegistration(e,{detailed:!0,inlineOptions:!1}),u=typeof e.usage.category<"u"?yo(e.usage.category,{format:this.format(r),paragraphs:!1}):void 0,A=typeof e.usage.description<"u"?yo(e.usage.description,{format:this.format(r),paragraphs:!1}):void 0,p=typeof e.usage.details<"u"?yo(e.usage.details,{format:this.format(r),paragraphs:!0}):void 0,h=typeof e.usage.examples<"u"?e.usage.examples.map(([E,w])=>[yo(E,{format:this.format(r),paragraphs:!1}),w.replace(/\$0/g,this.binaryName)]):void 0;return{path:o,usage:a,category:u,description:A,details:p,examples:h,options:n}}definitions({colored:e=!1}={}){let r=[];for(let o of this.registrations.keys()){let a=this.definition(o,{colored:e});a&&r.push(a)}return r}usage(e=null,{colored:r,detailed:o=!1,prefix:a="$ "}={}){var n;if(e===null){for(let p of this.registrations.keys()){let h=p.paths,E=typeof p.usage<"u";if(!h||h.length===0||h.length===1&&h[0].length===0||((n=h?.some(b=>b.length===0))!==null&&n!==void 0?n:!1))if(e){e=null;break}else e=p;else if(E){e=null;continue}}e&&(o=!0)}let u=e!==null&&e instanceof st?e.constructor:e,A="";if(u)if(o){let{description:p="",details:h="",examples:E=[]}=u.usage||{};p!==""&&(A+=yo(p,{format:this.format(r),paragraphs:!1}).replace(/^./,b=>b.toUpperCase()),A+=` `),(h!==""||E.length>0)&&(A+=`${this.format(r).header("Usage")} `,A+=` `);let{usage:w,options:D}=this.getUsageByRegistration(u,{inlineOptions:!1});if(A+=`${this.format(r).bold(a)}${w} `,D.length>0){A+=` `,A+=`${this.format(r).header("Options")} `;let b=D.reduce((C,T)=>Math.max(C,T.definition.length),0);A+=` `;for(let{definition:C,description:T}of D)A+=` ${this.format(r).bold(C.padEnd(b))} ${yo(T,{format:this.format(r),paragraphs:!1})}`}if(h!==""&&(A+=` `,A+=`${this.format(r).header("Details")} `,A+=` `,A+=yo(h,{format:this.format(r),paragraphs:!0})),E.length>0){A+=` `,A+=`${this.format(r).header("Examples")} `;for(let[b,C]of E)A+=` `,A+=yo(b,{format:this.format(r),paragraphs:!1}),A+=`${C.replace(/^/m,` ${this.format(r).bold(a)}`).replace(/\$0/g,this.binaryName)} `}}else{let{usage:p}=this.getUsageByRegistration(u);A+=`${this.format(r).bold(a)}${p} `}else{let p=new Map;for(let[D,{index:b}]of this.registrations.entries()){if(typeof D.usage>"u")continue;let C=typeof D.usage.category<"u"?yo(D.usage.category,{format:this.format(r),paragraphs:!1}):null,T=p.get(C);typeof T>"u"&&p.set(C,T=[]);let{usage:N}=this.getUsageByIndex(b);T.push({commandClass:D,usage:N})}let h=Array.from(p.keys()).sort((D,b)=>D===null?-1:b===null?1:D.localeCompare(b,"en",{usage:"sort",caseFirst:"upper"})),E=typeof this.binaryLabel<"u",w=typeof this.binaryVersion<"u";E||w?(E&&w?A+=`${this.format(r).header(`${this.binaryLabel} - ${this.binaryVersion}`)} `:E?A+=`${this.format(r).header(`${this.binaryLabel}`)} `:A+=`${this.format(r).header(`${this.binaryVersion}`)} `,A+=` ${this.format(r).bold(a)}${this.binaryName} `):A+=`${this.format(r).bold(a)}${this.binaryName} `;for(let D of h){let b=p.get(D).slice().sort((T,N)=>T.usage.localeCompare(N.usage,"en",{usage:"sort",caseFirst:"upper"})),C=D!==null?D.trim():"General commands";A+=` `,A+=`${this.format(r).header(`${C}`)} `;for(let{commandClass:T,usage:N}of b){let U=T.usage.description||"undocumented";A+=` `,A+=` ${this.format(r).bold(N)} `,A+=` ${yo(U,{format:this.format(r),paragraphs:!1})}`}}A+=` `,A+=yo("You can also print more details about any of these commands by calling them with the `-h,--help` flag right after the command name.",{format:this.format(r),paragraphs:!0})}return A}error(e,r){var o,{colored:a,command:n=(o=e[uz])!==null&&o!==void 0?o:null}=r===void 0?{}:r;(!e||typeof e!="object"||!("stack"in e))&&(e=new Error(`Execution failed with a non-error rejection (rejected value: ${JSON.stringify(e)})`));let u="",A=e.name.replace(/([a-z])([A-Z])/g,"$1 $2");A==="Error"&&(A="Internal Error"),u+=`${this.format(a).error(A)}: ${e.message} `;let p=e.clipanion;return typeof p<"u"?p.type==="usage"&&(u+=` `,u+=this.usage(n)):e.stack&&(u+=`${e.stack.replace(/^.*\n/,"")} `),u}format(e){var r;return((r=e??this.enableColors)!==null&&r!==void 0?r:t.defaultContext.colorDepth>1)?VV:zV}getUsageByRegistration(e,r){let o=this.registrations.get(e);if(typeof o>"u")throw new Error("Assertion failed: Unregistered command");return this.getUsageByIndex(o.index,r)}getUsageByIndex(e,r){return this.builder.getBuilderByIndex(e).usage(r)}};Vo.defaultContext={env:process.env,stdin:process.stdin,stdout:process.stdout,stderr:process.stderr,colorDepth:oz()}});var Sw,dz=It(()=>{Xp();Sw=class extends st{async execute(){this.context.stdout.write(`${JSON.stringify(this.cli.definitions(),null,2)} `)}};Sw.paths=[["--clipanion=definitions"]]});var xw,mz=It(()=>{Xp();xw=class extends st{async execute(){this.context.stdout.write(this.cli.usage())}};xw.paths=[["-h"],["--help"]]});function HP(t={}){return Wo({definition(e,r){var o;e.addProxy({name:(o=t.name)!==null&&o!==void 0?o:r,required:t.required})},transformer(e,r,o){return o.positionals.map(({value:a})=>a)}})}var CL=It(()=>{yf()});var bw,yz=It(()=>{Xp();CL();bw=class extends st{constructor(){super(...arguments),this.args=HP()}async execute(){this.context.stdout.write(`${JSON.stringify(this.cli.process(this.args).tokens,null,2)} `)}};bw.paths=[["--clipanion=tokens"]]});var kw,Ez=It(()=>{Xp();kw=class extends st{async execute(){var e;this.context.stdout.write(`${(e=this.cli.binaryVersion)!==null&&e!==void 0?e:""} `)}};kw.paths=[["-v"],["--version"]]});var IL={};Kt(IL,{DefinitionsCommand:()=>Sw,HelpCommand:()=>xw,TokensCommand:()=>bw,VersionCommand:()=>kw});var Cz=It(()=>{dz();mz();yz();Ez()});function Iz(t,e,r){let[o,a]=Yu(e,r??{}),{arity:n=1}=a,u=t.split(","),A=new Set(u);return Wo({definition(p){p.addOption({names:u,arity:n,hidden:a?.hidden,description:a?.description,required:a.required})},transformer(p,h,E){let w,D=typeof o<"u"?[...o]:void 0;for(let{name:b,value:C}of E.options)A.has(b)&&(w=b,D=D??[],D.push(C));return typeof D<"u"?ag(w??h,D,a.validator):D}})}var wz=It(()=>{yf()});function Bz(t,e,r){let[o,a]=Yu(e,r??{}),n=t.split(","),u=new Set(n);return Wo({definition(A){A.addOption({names:n,allowBinding:!1,arity:0,hidden:a.hidden,description:a.description,required:a.required})},transformer(A,p,h){let E=o;for(let{name:w,value:D}of h.options)u.has(w)&&(E=D);return E}})}var vz=It(()=>{yf()});function Dz(t,e,r){let[o,a]=Yu(e,r??{}),n=t.split(","),u=new Set(n);return Wo({definition(A){A.addOption({names:n,allowBinding:!1,arity:0,hidden:a.hidden,description:a.description,required:a.required})},transformer(A,p,h){let E=o;for(let{name:w,value:D}of h.options)u.has(w)&&(E??(E=0),D?E+=1:E=0);return E}})}var Pz=It(()=>{yf()});function Sz(t={}){return Wo({definition(e,r){var o;e.addRest({name:(o=t.name)!==null&&o!==void 0?o:r,required:t.required})},transformer(e,r,o){let a=u=>{let A=o.positionals[u];return A.extra===ol||A.extra===!1&&uu)}})}var xz=It(()=>{MP();yf()});function Mqe(t,e,r){let[o,a]=Yu(e,r??{}),{arity:n=1}=a,u=t.split(","),A=new Set(u);return Wo({definition(p){p.addOption({names:u,arity:a.tolerateBoolean?0:n,hidden:a.hidden,description:a.description,required:a.required})},transformer(p,h,E,w){let D,b=o;typeof a.env<"u"&&w.env[a.env]&&(D=a.env,b=w.env[a.env]);for(let{name:C,value:T}of E.options)A.has(C)&&(D=C,b=T);return typeof b=="string"?ag(D??h,b,a.validator):b}})}function Uqe(t={}){let{required:e=!0}=t;return Wo({definition(r,o){var a;r.addPositional({name:(a=t.name)!==null&&a!==void 0?a:o,required:t.required})},transformer(r,o,a){var n;for(let u=0;u{MP();yf()});var de={};Kt(de,{Array:()=>Iz,Boolean:()=>Bz,Counter:()=>Dz,Proxy:()=>HP,Rest:()=>Sz,String:()=>bz,applyValidator:()=>ag,cleanValidationError:()=>QP,formatError:()=>Iw,isOptionSymbol:()=>Cw,makeCommandOption:()=>Wo,rerouteArguments:()=>Yu});var Qz=It(()=>{yf();CL();wz();vz();Pz();xz();kz()});var Qw={};Kt(Qw,{Builtins:()=>IL,Cli:()=>Vo,Command:()=>st,Option:()=>de,UsageError:()=>ot,formatMarkdownish:()=>yo,run:()=>pz,runExit:()=>fz});var Gt=It(()=>{kP();cL();Xp();gz();Cz();Qz()});var Fz=_((ckt,_qe)=>{_qe.exports={name:"dotenv",version:"16.3.1",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard","lint-readme":"standard-markdown",pretest:"npm run lint && npm run dts-check",test:"tap tests/*.js --100 -Rspec",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},funding:"https://github.com/motdotla/dotenv?sponsor=1",keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@definitelytyped/dtslint":"^0.0.133","@types/node":"^18.11.3",decache:"^4.6.1",sinon:"^14.0.1",standard:"^17.0.0","standard-markdown":"^7.1.0","standard-version":"^9.5.0",tap:"^16.3.0",tar:"^6.1.11",typescript:"^4.8.4"},engines:{node:">=12"},browser:{fs:!1}}});var Nz=_((ukt,Ef)=>{var Rz=ve("fs"),BL=ve("path"),Hqe=ve("os"),qqe=ve("crypto"),jqe=Fz(),vL=jqe.version,Gqe=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function Wqe(t){let e={},r=t.toString();r=r.replace(/\r\n?/mg,` `);let o;for(;(o=Gqe.exec(r))!=null;){let a=o[1],n=o[2]||"";n=n.trim();let u=n[0];n=n.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),u==='"'&&(n=n.replace(/\\n/g,` `),n=n.replace(/\\r/g,"\r")),e[a]=n}return e}function Yqe(t){let e=Lz(t),r=vs.configDotenv({path:e});if(!r.parsed)throw new Error(`MISSING_DATA: Cannot parse ${e} for an unknown reason`);let o=Tz(t).split(","),a=o.length,n;for(let u=0;u=a)throw A}return vs.parse(n)}function Kqe(t){console.log(`[dotenv@${vL}][INFO] ${t}`)}function Vqe(t){console.log(`[dotenv@${vL}][WARN] ${t}`)}function wL(t){console.log(`[dotenv@${vL}][DEBUG] ${t}`)}function Tz(t){return t&&t.DOTENV_KEY&&t.DOTENV_KEY.length>0?t.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function zqe(t,e){let r;try{r=new URL(e)}catch(A){throw A.code==="ERR_INVALID_URL"?new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenv.org/vault/.env.vault?environment=development"):A}let o=r.password;if(!o)throw new Error("INVALID_DOTENV_KEY: Missing key part");let a=r.searchParams.get("environment");if(!a)throw new Error("INVALID_DOTENV_KEY: Missing environment part");let n=`DOTENV_VAULT_${a.toUpperCase()}`,u=t.parsed[n];if(!u)throw new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${n} in your .env.vault file.`);return{ciphertext:u,key:o}}function Lz(t){let e=BL.resolve(process.cwd(),".env");return t&&t.path&&t.path.length>0&&(e=t.path),e.endsWith(".vault")?e:`${e}.vault`}function Jqe(t){return t[0]==="~"?BL.join(Hqe.homedir(),t.slice(1)):t}function Xqe(t){Kqe("Loading env from encrypted .env.vault");let e=vs._parseVault(t),r=process.env;return t&&t.processEnv!=null&&(r=t.processEnv),vs.populate(r,e,t),{parsed:e}}function Zqe(t){let e=BL.resolve(process.cwd(),".env"),r="utf8",o=!!(t&&t.debug);t&&(t.path!=null&&(e=Jqe(t.path)),t.encoding!=null&&(r=t.encoding));try{let a=vs.parse(Rz.readFileSync(e,{encoding:r})),n=process.env;return t&&t.processEnv!=null&&(n=t.processEnv),vs.populate(n,a,t),{parsed:a}}catch(a){return o&&wL(`Failed to load ${e} ${a.message}`),{error:a}}}function $qe(t){let e=Lz(t);return Tz(t).length===0?vs.configDotenv(t):Rz.existsSync(e)?vs._configVault(t):(Vqe(`You set DOTENV_KEY but you are missing a .env.vault file at ${e}. Did you forget to build it?`),vs.configDotenv(t))}function eje(t,e){let r=Buffer.from(e.slice(-64),"hex"),o=Buffer.from(t,"base64"),a=o.slice(0,12),n=o.slice(-16);o=o.slice(12,-16);try{let u=qqe.createDecipheriv("aes-256-gcm",r,a);return u.setAuthTag(n),`${u.update(o)}${u.final()}`}catch(u){let A=u instanceof RangeError,p=u.message==="Invalid key length",h=u.message==="Unsupported state or unable to authenticate data";if(A||p){let E="INVALID_DOTENV_KEY: It must be 64 characters long (or more)";throw new Error(E)}else if(h){let E="DECRYPTION_FAILED: Please check your DOTENV_KEY";throw new Error(E)}else throw console.error("Error: ",u.code),console.error("Error: ",u.message),u}}function tje(t,e,r={}){let o=!!(r&&r.debug),a=!!(r&&r.override);if(typeof e!="object")throw new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");for(let n of Object.keys(e))Object.prototype.hasOwnProperty.call(t,n)?(a===!0&&(t[n]=e[n]),o&&wL(a===!0?`"${n}" is already defined and WAS overwritten`:`"${n}" is already defined and was NOT overwritten`)):t[n]=e[n]}var vs={configDotenv:Zqe,_configVault:Xqe,_parseVault:Yqe,config:$qe,decrypt:eje,parse:Wqe,populate:tje};Ef.exports.configDotenv=vs.configDotenv;Ef.exports._configVault=vs._configVault;Ef.exports._parseVault=vs._parseVault;Ef.exports.config=vs.config;Ef.exports.decrypt=vs.decrypt;Ef.exports.parse=vs.parse;Ef.exports.populate=vs.populate;Ef.exports=vs});var Mz=_((Akt,Oz)=>{"use strict";Oz.exports=(t,...e)=>new Promise(r=>{r(t(...e))})});var lg=_((fkt,DL)=>{"use strict";var rje=Mz(),Uz=t=>{if(t<1)throw new TypeError("Expected `concurrency` to be a number from 1 and up");let e=[],r=0,o=()=>{r--,e.length>0&&e.shift()()},a=(A,p,...h)=>{r++;let E=rje(A,...h);p(E),E.then(o,o)},n=(A,p,...h)=>{rnew Promise(h=>n(A,h,...p));return Object.defineProperties(u,{activeCount:{get:()=>r},pendingCount:{get:()=>e.length}}),u};DL.exports=Uz;DL.exports.default=Uz});function zu(t){return`YN${t.toString(10).padStart(4,"0")}`}function qP(t){let e=Number(t.slice(2));if(typeof vr[e]>"u")throw new Error(`Unknown message name: "${t}"`);return e}var vr,jP=It(()=>{vr=(Me=>(Me[Me.UNNAMED=0]="UNNAMED",Me[Me.EXCEPTION=1]="EXCEPTION",Me[Me.MISSING_PEER_DEPENDENCY=2]="MISSING_PEER_DEPENDENCY",Me[Me.CYCLIC_DEPENDENCIES=3]="CYCLIC_DEPENDENCIES",Me[Me.DISABLED_BUILD_SCRIPTS=4]="DISABLED_BUILD_SCRIPTS",Me[Me.BUILD_DISABLED=5]="BUILD_DISABLED",Me[Me.SOFT_LINK_BUILD=6]="SOFT_LINK_BUILD",Me[Me.MUST_BUILD=7]="MUST_BUILD",Me[Me.MUST_REBUILD=8]="MUST_REBUILD",Me[Me.BUILD_FAILED=9]="BUILD_FAILED",Me[Me.RESOLVER_NOT_FOUND=10]="RESOLVER_NOT_FOUND",Me[Me.FETCHER_NOT_FOUND=11]="FETCHER_NOT_FOUND",Me[Me.LINKER_NOT_FOUND=12]="LINKER_NOT_FOUND",Me[Me.FETCH_NOT_CACHED=13]="FETCH_NOT_CACHED",Me[Me.YARN_IMPORT_FAILED=14]="YARN_IMPORT_FAILED",Me[Me.REMOTE_INVALID=15]="REMOTE_INVALID",Me[Me.REMOTE_NOT_FOUND=16]="REMOTE_NOT_FOUND",Me[Me.RESOLUTION_PACK=17]="RESOLUTION_PACK",Me[Me.CACHE_CHECKSUM_MISMATCH=18]="CACHE_CHECKSUM_MISMATCH",Me[Me.UNUSED_CACHE_ENTRY=19]="UNUSED_CACHE_ENTRY",Me[Me.MISSING_LOCKFILE_ENTRY=20]="MISSING_LOCKFILE_ENTRY",Me[Me.WORKSPACE_NOT_FOUND=21]="WORKSPACE_NOT_FOUND",Me[Me.TOO_MANY_MATCHING_WORKSPACES=22]="TOO_MANY_MATCHING_WORKSPACES",Me[Me.CONSTRAINTS_MISSING_DEPENDENCY=23]="CONSTRAINTS_MISSING_DEPENDENCY",Me[Me.CONSTRAINTS_INCOMPATIBLE_DEPENDENCY=24]="CONSTRAINTS_INCOMPATIBLE_DEPENDENCY",Me[Me.CONSTRAINTS_EXTRANEOUS_DEPENDENCY=25]="CONSTRAINTS_EXTRANEOUS_DEPENDENCY",Me[Me.CONSTRAINTS_INVALID_DEPENDENCY=26]="CONSTRAINTS_INVALID_DEPENDENCY",Me[Me.CANT_SUGGEST_RESOLUTIONS=27]="CANT_SUGGEST_RESOLUTIONS",Me[Me.FROZEN_LOCKFILE_EXCEPTION=28]="FROZEN_LOCKFILE_EXCEPTION",Me[Me.CROSS_DRIVE_VIRTUAL_LOCAL=29]="CROSS_DRIVE_VIRTUAL_LOCAL",Me[Me.FETCH_FAILED=30]="FETCH_FAILED",Me[Me.DANGEROUS_NODE_MODULES=31]="DANGEROUS_NODE_MODULES",Me[Me.NODE_GYP_INJECTED=32]="NODE_GYP_INJECTED",Me[Me.AUTHENTICATION_NOT_FOUND=33]="AUTHENTICATION_NOT_FOUND",Me[Me.INVALID_CONFIGURATION_KEY=34]="INVALID_CONFIGURATION_KEY",Me[Me.NETWORK_ERROR=35]="NETWORK_ERROR",Me[Me.LIFECYCLE_SCRIPT=36]="LIFECYCLE_SCRIPT",Me[Me.CONSTRAINTS_MISSING_FIELD=37]="CONSTRAINTS_MISSING_FIELD",Me[Me.CONSTRAINTS_INCOMPATIBLE_FIELD=38]="CONSTRAINTS_INCOMPATIBLE_FIELD",Me[Me.CONSTRAINTS_EXTRANEOUS_FIELD=39]="CONSTRAINTS_EXTRANEOUS_FIELD",Me[Me.CONSTRAINTS_INVALID_FIELD=40]="CONSTRAINTS_INVALID_FIELD",Me[Me.AUTHENTICATION_INVALID=41]="AUTHENTICATION_INVALID",Me[Me.PROLOG_UNKNOWN_ERROR=42]="PROLOG_UNKNOWN_ERROR",Me[Me.PROLOG_SYNTAX_ERROR=43]="PROLOG_SYNTAX_ERROR",Me[Me.PROLOG_EXISTENCE_ERROR=44]="PROLOG_EXISTENCE_ERROR",Me[Me.STACK_OVERFLOW_RESOLUTION=45]="STACK_OVERFLOW_RESOLUTION",Me[Me.AUTOMERGE_FAILED_TO_PARSE=46]="AUTOMERGE_FAILED_TO_PARSE",Me[Me.AUTOMERGE_IMMUTABLE=47]="AUTOMERGE_IMMUTABLE",Me[Me.AUTOMERGE_SUCCESS=48]="AUTOMERGE_SUCCESS",Me[Me.AUTOMERGE_REQUIRED=49]="AUTOMERGE_REQUIRED",Me[Me.DEPRECATED_CLI_SETTINGS=50]="DEPRECATED_CLI_SETTINGS",Me[Me.PLUGIN_NAME_NOT_FOUND=51]="PLUGIN_NAME_NOT_FOUND",Me[Me.INVALID_PLUGIN_REFERENCE=52]="INVALID_PLUGIN_REFERENCE",Me[Me.CONSTRAINTS_AMBIGUITY=53]="CONSTRAINTS_AMBIGUITY",Me[Me.CACHE_OUTSIDE_PROJECT=54]="CACHE_OUTSIDE_PROJECT",Me[Me.IMMUTABLE_INSTALL=55]="IMMUTABLE_INSTALL",Me[Me.IMMUTABLE_CACHE=56]="IMMUTABLE_CACHE",Me[Me.INVALID_MANIFEST=57]="INVALID_MANIFEST",Me[Me.PACKAGE_PREPARATION_FAILED=58]="PACKAGE_PREPARATION_FAILED",Me[Me.INVALID_RANGE_PEER_DEPENDENCY=59]="INVALID_RANGE_PEER_DEPENDENCY",Me[Me.INCOMPATIBLE_PEER_DEPENDENCY=60]="INCOMPATIBLE_PEER_DEPENDENCY",Me[Me.DEPRECATED_PACKAGE=61]="DEPRECATED_PACKAGE",Me[Me.INCOMPATIBLE_OS=62]="INCOMPATIBLE_OS",Me[Me.INCOMPATIBLE_CPU=63]="INCOMPATIBLE_CPU",Me[Me.FROZEN_ARTIFACT_EXCEPTION=64]="FROZEN_ARTIFACT_EXCEPTION",Me[Me.TELEMETRY_NOTICE=65]="TELEMETRY_NOTICE",Me[Me.PATCH_HUNK_FAILED=66]="PATCH_HUNK_FAILED",Me[Me.INVALID_CONFIGURATION_VALUE=67]="INVALID_CONFIGURATION_VALUE",Me[Me.UNUSED_PACKAGE_EXTENSION=68]="UNUSED_PACKAGE_EXTENSION",Me[Me.REDUNDANT_PACKAGE_EXTENSION=69]="REDUNDANT_PACKAGE_EXTENSION",Me[Me.AUTO_NM_SUCCESS=70]="AUTO_NM_SUCCESS",Me[Me.NM_CANT_INSTALL_EXTERNAL_SOFT_LINK=71]="NM_CANT_INSTALL_EXTERNAL_SOFT_LINK",Me[Me.NM_PRESERVE_SYMLINKS_REQUIRED=72]="NM_PRESERVE_SYMLINKS_REQUIRED",Me[Me.UPDATE_LOCKFILE_ONLY_SKIP_LINK=73]="UPDATE_LOCKFILE_ONLY_SKIP_LINK",Me[Me.NM_HARDLINKS_MODE_DOWNGRADED=74]="NM_HARDLINKS_MODE_DOWNGRADED",Me[Me.PROLOG_INSTANTIATION_ERROR=75]="PROLOG_INSTANTIATION_ERROR",Me[Me.INCOMPATIBLE_ARCHITECTURE=76]="INCOMPATIBLE_ARCHITECTURE",Me[Me.GHOST_ARCHITECTURE=77]="GHOST_ARCHITECTURE",Me[Me.RESOLUTION_MISMATCH=78]="RESOLUTION_MISMATCH",Me[Me.PROLOG_LIMIT_EXCEEDED=79]="PROLOG_LIMIT_EXCEEDED",Me[Me.NETWORK_DISABLED=80]="NETWORK_DISABLED",Me[Me.NETWORK_UNSAFE_HTTP=81]="NETWORK_UNSAFE_HTTP",Me[Me.RESOLUTION_FAILED=82]="RESOLUTION_FAILED",Me[Me.AUTOMERGE_GIT_ERROR=83]="AUTOMERGE_GIT_ERROR",Me[Me.CONSTRAINTS_CHECK_FAILED=84]="CONSTRAINTS_CHECK_FAILED",Me[Me.UPDATED_RESOLUTION_RECORD=85]="UPDATED_RESOLUTION_RECORD",Me[Me.EXPLAIN_PEER_DEPENDENCIES_CTA=86]="EXPLAIN_PEER_DEPENDENCIES_CTA",Me[Me.MIGRATION_SUCCESS=87]="MIGRATION_SUCCESS",Me[Me.VERSION_NOTICE=88]="VERSION_NOTICE",Me[Me.TIPS_NOTICE=89]="TIPS_NOTICE",Me[Me.OFFLINE_MODE_ENABLED=90]="OFFLINE_MODE_ENABLED",Me))(vr||{})});var Fw=_((hkt,_z)=>{var nje="2.0.0",ije=Number.MAX_SAFE_INTEGER||9007199254740991,sje=16,oje=250,aje=["major","premajor","minor","preminor","patch","prepatch","prerelease"];_z.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:sje,MAX_SAFE_BUILD_LENGTH:oje,MAX_SAFE_INTEGER:ije,RELEASE_TYPES:aje,SEMVER_SPEC_VERSION:nje,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Rw=_((gkt,Hz)=>{var lje=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};Hz.exports=lje});var bm=_((Cf,qz)=>{var{MAX_SAFE_COMPONENT_LENGTH:PL,MAX_SAFE_BUILD_LENGTH:cje,MAX_LENGTH:uje}=Fw(),Aje=Rw();Cf=qz.exports={};var fje=Cf.re=[],pje=Cf.safeRe=[],tr=Cf.src=[],rr=Cf.t={},hje=0,SL="[a-zA-Z0-9-]",gje=[["\\s",1],["\\d",uje],[SL,cje]],dje=t=>{for(let[e,r]of gje)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},Gr=(t,e,r)=>{let o=dje(e),a=hje++;Aje(t,a,e),rr[t]=a,tr[a]=e,fje[a]=new RegExp(e,r?"g":void 0),pje[a]=new RegExp(o,r?"g":void 0)};Gr("NUMERICIDENTIFIER","0|[1-9]\\d*");Gr("NUMERICIDENTIFIERLOOSE","\\d+");Gr("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${SL}*`);Gr("MAINVERSION",`(${tr[rr.NUMERICIDENTIFIER]})\\.(${tr[rr.NUMERICIDENTIFIER]})\\.(${tr[rr.NUMERICIDENTIFIER]})`);Gr("MAINVERSIONLOOSE",`(${tr[rr.NUMERICIDENTIFIERLOOSE]})\\.(${tr[rr.NUMERICIDENTIFIERLOOSE]})\\.(${tr[rr.NUMERICIDENTIFIERLOOSE]})`);Gr("PRERELEASEIDENTIFIER",`(?:${tr[rr.NUMERICIDENTIFIER]}|${tr[rr.NONNUMERICIDENTIFIER]})`);Gr("PRERELEASEIDENTIFIERLOOSE",`(?:${tr[rr.NUMERICIDENTIFIERLOOSE]}|${tr[rr.NONNUMERICIDENTIFIER]})`);Gr("PRERELEASE",`(?:-(${tr[rr.PRERELEASEIDENTIFIER]}(?:\\.${tr[rr.PRERELEASEIDENTIFIER]})*))`);Gr("PRERELEASELOOSE",`(?:-?(${tr[rr.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${tr[rr.PRERELEASEIDENTIFIERLOOSE]})*))`);Gr("BUILDIDENTIFIER",`${SL}+`);Gr("BUILD",`(?:\\+(${tr[rr.BUILDIDENTIFIER]}(?:\\.${tr[rr.BUILDIDENTIFIER]})*))`);Gr("FULLPLAIN",`v?${tr[rr.MAINVERSION]}${tr[rr.PRERELEASE]}?${tr[rr.BUILD]}?`);Gr("FULL",`^${tr[rr.FULLPLAIN]}$`);Gr("LOOSEPLAIN",`[v=\\s]*${tr[rr.MAINVERSIONLOOSE]}${tr[rr.PRERELEASELOOSE]}?${tr[rr.BUILD]}?`);Gr("LOOSE",`^${tr[rr.LOOSEPLAIN]}$`);Gr("GTLT","((?:<|>)?=?)");Gr("XRANGEIDENTIFIERLOOSE",`${tr[rr.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);Gr("XRANGEIDENTIFIER",`${tr[rr.NUMERICIDENTIFIER]}|x|X|\\*`);Gr("XRANGEPLAIN",`[v=\\s]*(${tr[rr.XRANGEIDENTIFIER]})(?:\\.(${tr[rr.XRANGEIDENTIFIER]})(?:\\.(${tr[rr.XRANGEIDENTIFIER]})(?:${tr[rr.PRERELEASE]})?${tr[rr.BUILD]}?)?)?`);Gr("XRANGEPLAINLOOSE",`[v=\\s]*(${tr[rr.XRANGEIDENTIFIERLOOSE]})(?:\\.(${tr[rr.XRANGEIDENTIFIERLOOSE]})(?:\\.(${tr[rr.XRANGEIDENTIFIERLOOSE]})(?:${tr[rr.PRERELEASELOOSE]})?${tr[rr.BUILD]}?)?)?`);Gr("XRANGE",`^${tr[rr.GTLT]}\\s*${tr[rr.XRANGEPLAIN]}$`);Gr("XRANGELOOSE",`^${tr[rr.GTLT]}\\s*${tr[rr.XRANGEPLAINLOOSE]}$`);Gr("COERCEPLAIN",`(^|[^\\d])(\\d{1,${PL}})(?:\\.(\\d{1,${PL}}))?(?:\\.(\\d{1,${PL}}))?`);Gr("COERCE",`${tr[rr.COERCEPLAIN]}(?:$|[^\\d])`);Gr("COERCEFULL",tr[rr.COERCEPLAIN]+`(?:${tr[rr.PRERELEASE]})?(?:${tr[rr.BUILD]})?(?:$|[^\\d])`);Gr("COERCERTL",tr[rr.COERCE],!0);Gr("COERCERTLFULL",tr[rr.COERCEFULL],!0);Gr("LONETILDE","(?:~>?)");Gr("TILDETRIM",`(\\s*)${tr[rr.LONETILDE]}\\s+`,!0);Cf.tildeTrimReplace="$1~";Gr("TILDE",`^${tr[rr.LONETILDE]}${tr[rr.XRANGEPLAIN]}$`);Gr("TILDELOOSE",`^${tr[rr.LONETILDE]}${tr[rr.XRANGEPLAINLOOSE]}$`);Gr("LONECARET","(?:\\^)");Gr("CARETTRIM",`(\\s*)${tr[rr.LONECARET]}\\s+`,!0);Cf.caretTrimReplace="$1^";Gr("CARET",`^${tr[rr.LONECARET]}${tr[rr.XRANGEPLAIN]}$`);Gr("CARETLOOSE",`^${tr[rr.LONECARET]}${tr[rr.XRANGEPLAINLOOSE]}$`);Gr("COMPARATORLOOSE",`^${tr[rr.GTLT]}\\s*(${tr[rr.LOOSEPLAIN]})$|^$`);Gr("COMPARATOR",`^${tr[rr.GTLT]}\\s*(${tr[rr.FULLPLAIN]})$|^$`);Gr("COMPARATORTRIM",`(\\s*)${tr[rr.GTLT]}\\s*(${tr[rr.LOOSEPLAIN]}|${tr[rr.XRANGEPLAIN]})`,!0);Cf.comparatorTrimReplace="$1$2$3";Gr("HYPHENRANGE",`^\\s*(${tr[rr.XRANGEPLAIN]})\\s+-\\s+(${tr[rr.XRANGEPLAIN]})\\s*$`);Gr("HYPHENRANGELOOSE",`^\\s*(${tr[rr.XRANGEPLAINLOOSE]})\\s+-\\s+(${tr[rr.XRANGEPLAINLOOSE]})\\s*$`);Gr("STAR","(<|>)?=?\\s*\\*");Gr("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");Gr("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var GP=_((dkt,jz)=>{var mje=Object.freeze({loose:!0}),yje=Object.freeze({}),Eje=t=>t?typeof t!="object"?mje:t:yje;jz.exports=Eje});var xL=_((mkt,Yz)=>{var Gz=/^[0-9]+$/,Wz=(t,e)=>{let r=Gz.test(t),o=Gz.test(e);return r&&o&&(t=+t,e=+e),t===e?0:r&&!o?-1:o&&!r?1:tWz(e,t);Yz.exports={compareIdentifiers:Wz,rcompareIdentifiers:Cje}});var Eo=_((ykt,Jz)=>{var WP=Rw(),{MAX_LENGTH:Kz,MAX_SAFE_INTEGER:YP}=Fw(),{safeRe:Vz,t:zz}=bm(),Ije=GP(),{compareIdentifiers:km}=xL(),bL=class t{constructor(e,r){if(r=Ije(r),e instanceof t){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>Kz)throw new TypeError(`version is longer than ${Kz} characters`);WP("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let o=e.trim().match(r.loose?Vz[zz.LOOSE]:Vz[zz.FULL]);if(!o)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+o[1],this.minor=+o[2],this.patch=+o[3],this.major>YP||this.major<0)throw new TypeError("Invalid major version");if(this.minor>YP||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>YP||this.patch<0)throw new TypeError("Invalid patch version");o[4]?this.prerelease=o[4].split(".").map(a=>{if(/^[0-9]+$/.test(a)){let n=+a;if(n>=0&&n=0;)typeof this.prerelease[n]=="number"&&(this.prerelease[n]++,n=-2);if(n===-1){if(r===this.prerelease.join(".")&&o===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(a)}}if(r){let n=[r,a];o===!1&&(n=[r]),km(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};Jz.exports=bL});var cg=_((Ekt,Zz)=>{var Xz=Eo(),wje=(t,e,r=!1)=>{if(t instanceof Xz)return t;try{return new Xz(t,e)}catch(o){if(!r)return null;throw o}};Zz.exports=wje});var eJ=_((Ckt,$z)=>{var Bje=cg(),vje=(t,e)=>{let r=Bje(t,e);return r?r.version:null};$z.exports=vje});var rJ=_((Ikt,tJ)=>{var Dje=cg(),Pje=(t,e)=>{let r=Dje(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};tJ.exports=Pje});var sJ=_((wkt,iJ)=>{var nJ=Eo(),Sje=(t,e,r,o,a)=>{typeof r=="string"&&(a=o,o=r,r=void 0);try{return new nJ(t instanceof nJ?t.version:t,r).inc(e,o,a).version}catch{return null}};iJ.exports=Sje});var lJ=_((Bkt,aJ)=>{var oJ=cg(),xje=(t,e)=>{let r=oJ(t,null,!0),o=oJ(e,null,!0),a=r.compare(o);if(a===0)return null;let n=a>0,u=n?r:o,A=n?o:r,p=!!u.prerelease.length;if(!!A.prerelease.length&&!p)return!A.patch&&!A.minor?"major":u.patch?"patch":u.minor?"minor":"major";let E=p?"pre":"";return r.major!==o.major?E+"major":r.minor!==o.minor?E+"minor":r.patch!==o.patch?E+"patch":"prerelease"};aJ.exports=xje});var uJ=_((vkt,cJ)=>{var bje=Eo(),kje=(t,e)=>new bje(t,e).major;cJ.exports=kje});var fJ=_((Dkt,AJ)=>{var Qje=Eo(),Fje=(t,e)=>new Qje(t,e).minor;AJ.exports=Fje});var hJ=_((Pkt,pJ)=>{var Rje=Eo(),Tje=(t,e)=>new Rje(t,e).patch;pJ.exports=Tje});var dJ=_((Skt,gJ)=>{var Lje=cg(),Nje=(t,e)=>{let r=Lje(t,e);return r&&r.prerelease.length?r.prerelease:null};gJ.exports=Nje});var Ml=_((xkt,yJ)=>{var mJ=Eo(),Oje=(t,e,r)=>new mJ(t,r).compare(new mJ(e,r));yJ.exports=Oje});var CJ=_((bkt,EJ)=>{var Mje=Ml(),Uje=(t,e,r)=>Mje(e,t,r);EJ.exports=Uje});var wJ=_((kkt,IJ)=>{var _je=Ml(),Hje=(t,e)=>_je(t,e,!0);IJ.exports=Hje});var KP=_((Qkt,vJ)=>{var BJ=Eo(),qje=(t,e,r)=>{let o=new BJ(t,r),a=new BJ(e,r);return o.compare(a)||o.compareBuild(a)};vJ.exports=qje});var PJ=_((Fkt,DJ)=>{var jje=KP(),Gje=(t,e)=>t.sort((r,o)=>jje(r,o,e));DJ.exports=Gje});var xJ=_((Rkt,SJ)=>{var Wje=KP(),Yje=(t,e)=>t.sort((r,o)=>Wje(o,r,e));SJ.exports=Yje});var Tw=_((Tkt,bJ)=>{var Kje=Ml(),Vje=(t,e,r)=>Kje(t,e,r)>0;bJ.exports=Vje});var VP=_((Lkt,kJ)=>{var zje=Ml(),Jje=(t,e,r)=>zje(t,e,r)<0;kJ.exports=Jje});var kL=_((Nkt,QJ)=>{var Xje=Ml(),Zje=(t,e,r)=>Xje(t,e,r)===0;QJ.exports=Zje});var QL=_((Okt,FJ)=>{var $je=Ml(),e9e=(t,e,r)=>$je(t,e,r)!==0;FJ.exports=e9e});var zP=_((Mkt,RJ)=>{var t9e=Ml(),r9e=(t,e,r)=>t9e(t,e,r)>=0;RJ.exports=r9e});var JP=_((Ukt,TJ)=>{var n9e=Ml(),i9e=(t,e,r)=>n9e(t,e,r)<=0;TJ.exports=i9e});var FL=_((_kt,LJ)=>{var s9e=kL(),o9e=QL(),a9e=Tw(),l9e=zP(),c9e=VP(),u9e=JP(),A9e=(t,e,r,o)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return s9e(t,r,o);case"!=":return o9e(t,r,o);case">":return a9e(t,r,o);case">=":return l9e(t,r,o);case"<":return c9e(t,r,o);case"<=":return u9e(t,r,o);default:throw new TypeError(`Invalid operator: ${e}`)}};LJ.exports=A9e});var OJ=_((Hkt,NJ)=>{var f9e=Eo(),p9e=cg(),{safeRe:XP,t:ZP}=bm(),h9e=(t,e)=>{if(t instanceof f9e)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(e.includePrerelease?XP[ZP.COERCEFULL]:XP[ZP.COERCE]);else{let p=e.includePrerelease?XP[ZP.COERCERTLFULL]:XP[ZP.COERCERTL],h;for(;(h=p.exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||h.index+h[0].length!==r.index+r[0].length)&&(r=h),p.lastIndex=h.index+h[1].length+h[2].length;p.lastIndex=-1}if(r===null)return null;let o=r[2],a=r[3]||"0",n=r[4]||"0",u=e.includePrerelease&&r[5]?`-${r[5]}`:"",A=e.includePrerelease&&r[6]?`+${r[6]}`:"";return p9e(`${o}.${a}.${n}${u}${A}`,e)};NJ.exports=h9e});var UJ=_((qkt,MJ)=>{"use strict";MJ.exports=function(t){t.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}});var $P=_((jkt,_J)=>{"use strict";_J.exports=xn;xn.Node=ug;xn.create=xn;function xn(t){var e=this;if(e instanceof xn||(e=new xn),e.tail=null,e.head=null,e.length=0,t&&typeof t.forEach=="function")t.forEach(function(a){e.push(a)});else if(arguments.length>0)for(var r=0,o=arguments.length;r1)r=e;else if(this.head)o=this.head.next,r=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var a=0;o!==null;a++)r=t(r,o.value,a),o=o.next;return r};xn.prototype.reduceReverse=function(t,e){var r,o=this.tail;if(arguments.length>1)r=e;else if(this.tail)o=this.tail.prev,r=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var a=this.length-1;o!==null;a--)r=t(r,o.value,a),o=o.prev;return r};xn.prototype.toArray=function(){for(var t=new Array(this.length),e=0,r=this.head;r!==null;e++)t[e]=r.value,r=r.next;return t};xn.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,r=this.tail;r!==null;e++)t[e]=r.value,r=r.prev;return t};xn.prototype.slice=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var r=new xn;if(ethis.length&&(e=this.length);for(var o=0,a=this.head;a!==null&&othis.length&&(e=this.length);for(var o=this.length,a=this.tail;a!==null&&o>e;o--)a=a.prev;for(;a!==null&&o>t;o--,a=a.prev)r.push(a.value);return r};xn.prototype.splice=function(t,e,...r){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var o=0,a=this.head;a!==null&&o{"use strict";var y9e=$P(),Ag=Symbol("max"),wf=Symbol("length"),Qm=Symbol("lengthCalculator"),Nw=Symbol("allowStale"),fg=Symbol("maxAge"),If=Symbol("dispose"),HJ=Symbol("noDisposeOnSet"),Ds=Symbol("lruList"),Gc=Symbol("cache"),jJ=Symbol("updateAgeOnGet"),RL=()=>1,LL=class{constructor(e){if(typeof e=="number"&&(e={max:e}),e||(e={}),e.max&&(typeof e.max!="number"||e.max<0))throw new TypeError("max must be a non-negative number");let r=this[Ag]=e.max||1/0,o=e.length||RL;if(this[Qm]=typeof o!="function"?RL:o,this[Nw]=e.stale||!1,e.maxAge&&typeof e.maxAge!="number")throw new TypeError("maxAge must be a number");this[fg]=e.maxAge||0,this[If]=e.dispose,this[HJ]=e.noDisposeOnSet||!1,this[jJ]=e.updateAgeOnGet||!1,this.reset()}set max(e){if(typeof e!="number"||e<0)throw new TypeError("max must be a non-negative number");this[Ag]=e||1/0,Lw(this)}get max(){return this[Ag]}set allowStale(e){this[Nw]=!!e}get allowStale(){return this[Nw]}set maxAge(e){if(typeof e!="number")throw new TypeError("maxAge must be a non-negative number");this[fg]=e,Lw(this)}get maxAge(){return this[fg]}set lengthCalculator(e){typeof e!="function"&&(e=RL),e!==this[Qm]&&(this[Qm]=e,this[wf]=0,this[Ds].forEach(r=>{r.length=this[Qm](r.value,r.key),this[wf]+=r.length})),Lw(this)}get lengthCalculator(){return this[Qm]}get length(){return this[wf]}get itemCount(){return this[Ds].length}rforEach(e,r){r=r||this;for(let o=this[Ds].tail;o!==null;){let a=o.prev;qJ(this,e,o,r),o=a}}forEach(e,r){r=r||this;for(let o=this[Ds].head;o!==null;){let a=o.next;qJ(this,e,o,r),o=a}}keys(){return this[Ds].toArray().map(e=>e.key)}values(){return this[Ds].toArray().map(e=>e.value)}reset(){this[If]&&this[Ds]&&this[Ds].length&&this[Ds].forEach(e=>this[If](e.key,e.value)),this[Gc]=new Map,this[Ds]=new y9e,this[wf]=0}dump(){return this[Ds].map(e=>eS(this,e)?!1:{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[Ds]}set(e,r,o){if(o=o||this[fg],o&&typeof o!="number")throw new TypeError("maxAge must be a number");let a=o?Date.now():0,n=this[Qm](r,e);if(this[Gc].has(e)){if(n>this[Ag])return Fm(this,this[Gc].get(e)),!1;let p=this[Gc].get(e).value;return this[If]&&(this[HJ]||this[If](e,p.value)),p.now=a,p.maxAge=o,p.value=r,this[wf]+=n-p.length,p.length=n,this.get(e),Lw(this),!0}let u=new NL(e,r,n,a,o);return u.length>this[Ag]?(this[If]&&this[If](e,r),!1):(this[wf]+=u.length,this[Ds].unshift(u),this[Gc].set(e,this[Ds].head),Lw(this),!0)}has(e){if(!this[Gc].has(e))return!1;let r=this[Gc].get(e).value;return!eS(this,r)}get(e){return TL(this,e,!0)}peek(e){return TL(this,e,!1)}pop(){let e=this[Ds].tail;return e?(Fm(this,e),e.value):null}del(e){Fm(this,this[Gc].get(e))}load(e){this.reset();let r=Date.now();for(let o=e.length-1;o>=0;o--){let a=e[o],n=a.e||0;if(n===0)this.set(a.k,a.v);else{let u=n-r;u>0&&this.set(a.k,a.v,u)}}}prune(){this[Gc].forEach((e,r)=>TL(this,r,!1))}},TL=(t,e,r)=>{let o=t[Gc].get(e);if(o){let a=o.value;if(eS(t,a)){if(Fm(t,o),!t[Nw])return}else r&&(t[jJ]&&(o.value.now=Date.now()),t[Ds].unshiftNode(o));return a.value}},eS=(t,e)=>{if(!e||!e.maxAge&&!t[fg])return!1;let r=Date.now()-e.now;return e.maxAge?r>e.maxAge:t[fg]&&r>t[fg]},Lw=t=>{if(t[wf]>t[Ag])for(let e=t[Ds].tail;t[wf]>t[Ag]&&e!==null;){let r=e.prev;Fm(t,e),e=r}},Fm=(t,e)=>{if(e){let r=e.value;t[If]&&t[If](r.key,r.value),t[wf]-=r.length,t[Gc].delete(r.key),t[Ds].removeNode(e)}},NL=class{constructor(e,r,o,a,n){this.key=e,this.value=r,this.length=o,this.now=a,this.maxAge=n||0}},qJ=(t,e,r,o)=>{let a=r.value;eS(t,a)&&(Fm(t,r),t[Nw]||(a=void 0)),a&&e.call(o,a.value,a.key,t)};GJ.exports=LL});var Ul=_((Wkt,zJ)=>{var OL=class t{constructor(e,r){if(r=C9e(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof ML)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(o=>this.parseRange(o.trim())).filter(o=>o.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let o=this.set[0];if(this.set=this.set.filter(a=>!KJ(a[0])),this.set.length===0)this.set=[o];else if(this.set.length>1){for(let a of this.set)if(a.length===1&&S9e(a[0])){this.set=[a];break}}}this.format()}format(){return this.range=this.set.map(e=>e.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(e){let o=((this.options.includePrerelease&&D9e)|(this.options.loose&&P9e))+":"+e,a=YJ.get(o);if(a)return a;let n=this.options.loose,u=n?xa[zo.HYPHENRANGELOOSE]:xa[zo.HYPHENRANGE];e=e.replace(u,O9e(this.options.includePrerelease)),gi("hyphen replace",e),e=e.replace(xa[zo.COMPARATORTRIM],w9e),gi("comparator trim",e),e=e.replace(xa[zo.TILDETRIM],B9e),gi("tilde trim",e),e=e.replace(xa[zo.CARETTRIM],v9e),gi("caret trim",e);let A=e.split(" ").map(w=>x9e(w,this.options)).join(" ").split(/\s+/).map(w=>N9e(w,this.options));n&&(A=A.filter(w=>(gi("loose invalid filter",w,this.options),!!w.match(xa[zo.COMPARATORLOOSE])))),gi("range list",A);let p=new Map,h=A.map(w=>new ML(w,this.options));for(let w of h){if(KJ(w))return[w];p.set(w.value,w)}p.size>1&&p.has("")&&p.delete("");let E=[...p.values()];return YJ.set(o,E),E}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(o=>VJ(o,r)&&e.set.some(a=>VJ(a,r)&&o.every(n=>a.every(u=>n.intersects(u,r)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new I9e(e,this.options)}catch{return!1}for(let r=0;rt.value==="<0.0.0-0",S9e=t=>t.value==="",VJ=(t,e)=>{let r=!0,o=t.slice(),a=o.pop();for(;r&&o.length;)r=o.every(n=>a.intersects(n,e)),a=o.pop();return r},x9e=(t,e)=>(gi("comp",t,e),t=Q9e(t,e),gi("caret",t),t=b9e(t,e),gi("tildes",t),t=R9e(t,e),gi("xrange",t),t=L9e(t,e),gi("stars",t),t),Jo=t=>!t||t.toLowerCase()==="x"||t==="*",b9e=(t,e)=>t.trim().split(/\s+/).map(r=>k9e(r,e)).join(" "),k9e=(t,e)=>{let r=e.loose?xa[zo.TILDELOOSE]:xa[zo.TILDE];return t.replace(r,(o,a,n,u,A)=>{gi("tilde",t,o,a,n,u,A);let p;return Jo(a)?p="":Jo(n)?p=`>=${a}.0.0 <${+a+1}.0.0-0`:Jo(u)?p=`>=${a}.${n}.0 <${a}.${+n+1}.0-0`:A?(gi("replaceTilde pr",A),p=`>=${a}.${n}.${u}-${A} <${a}.${+n+1}.0-0`):p=`>=${a}.${n}.${u} <${a}.${+n+1}.0-0`,gi("tilde return",p),p})},Q9e=(t,e)=>t.trim().split(/\s+/).map(r=>F9e(r,e)).join(" "),F9e=(t,e)=>{gi("caret",t,e);let r=e.loose?xa[zo.CARETLOOSE]:xa[zo.CARET],o=e.includePrerelease?"-0":"";return t.replace(r,(a,n,u,A,p)=>{gi("caret",t,a,n,u,A,p);let h;return Jo(n)?h="":Jo(u)?h=`>=${n}.0.0${o} <${+n+1}.0.0-0`:Jo(A)?n==="0"?h=`>=${n}.${u}.0${o} <${n}.${+u+1}.0-0`:h=`>=${n}.${u}.0${o} <${+n+1}.0.0-0`:p?(gi("replaceCaret pr",p),n==="0"?u==="0"?h=`>=${n}.${u}.${A}-${p} <${n}.${u}.${+A+1}-0`:h=`>=${n}.${u}.${A}-${p} <${n}.${+u+1}.0-0`:h=`>=${n}.${u}.${A}-${p} <${+n+1}.0.0-0`):(gi("no pr"),n==="0"?u==="0"?h=`>=${n}.${u}.${A}${o} <${n}.${u}.${+A+1}-0`:h=`>=${n}.${u}.${A}${o} <${n}.${+u+1}.0-0`:h=`>=${n}.${u}.${A} <${+n+1}.0.0-0`),gi("caret return",h),h})},R9e=(t,e)=>(gi("replaceXRanges",t,e),t.split(/\s+/).map(r=>T9e(r,e)).join(" ")),T9e=(t,e)=>{t=t.trim();let r=e.loose?xa[zo.XRANGELOOSE]:xa[zo.XRANGE];return t.replace(r,(o,a,n,u,A,p)=>{gi("xRange",t,o,a,n,u,A,p);let h=Jo(n),E=h||Jo(u),w=E||Jo(A),D=w;return a==="="&&D&&(a=""),p=e.includePrerelease?"-0":"",h?a===">"||a==="<"?o="<0.0.0-0":o="*":a&&D?(E&&(u=0),A=0,a===">"?(a=">=",E?(n=+n+1,u=0,A=0):(u=+u+1,A=0)):a==="<="&&(a="<",E?n=+n+1:u=+u+1),a==="<"&&(p="-0"),o=`${a+n}.${u}.${A}${p}`):E?o=`>=${n}.0.0${p} <${+n+1}.0.0-0`:w&&(o=`>=${n}.${u}.0${p} <${n}.${+u+1}.0-0`),gi("xRange return",o),o})},L9e=(t,e)=>(gi("replaceStars",t,e),t.trim().replace(xa[zo.STAR],"")),N9e=(t,e)=>(gi("replaceGTE0",t,e),t.trim().replace(xa[e.includePrerelease?zo.GTE0PRE:zo.GTE0],"")),O9e=t=>(e,r,o,a,n,u,A,p,h,E,w,D,b)=>(Jo(o)?r="":Jo(a)?r=`>=${o}.0.0${t?"-0":""}`:Jo(n)?r=`>=${o}.${a}.0${t?"-0":""}`:u?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,Jo(h)?p="":Jo(E)?p=`<${+h+1}.0.0-0`:Jo(w)?p=`<${h}.${+E+1}.0-0`:D?p=`<=${h}.${E}.${w}-${D}`:t?p=`<${h}.${E}.${+w+1}-0`:p=`<=${p}`,`${r} ${p}`.trim()),M9e=(t,e,r)=>{for(let o=0;o0){let a=t[o].semver;if(a.major===e.major&&a.minor===e.minor&&a.patch===e.patch)return!0}return!1}return!0}});var Ow=_((Ykt,tX)=>{var Mw=Symbol("SemVer ANY"),HL=class t{static get ANY(){return Mw}constructor(e,r){if(r=JJ(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),_L("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===Mw?this.value="":this.value=this.operator+this.semver.version,_L("comp",this)}parse(e){let r=this.options.loose?XJ[ZJ.COMPARATORLOOSE]:XJ[ZJ.COMPARATOR],o=e.match(r);if(!o)throw new TypeError(`Invalid comparator: ${e}`);this.operator=o[1]!==void 0?o[1]:"",this.operator==="="&&(this.operator=""),o[2]?this.semver=new $J(o[2],this.options.loose):this.semver=Mw}toString(){return this.value}test(e){if(_L("Comparator.test",e,this.options.loose),this.semver===Mw||e===Mw)return!0;if(typeof e=="string")try{e=new $J(e,this.options)}catch{return!1}return UL(e,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new eX(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new eX(this.value,r).test(e.semver):(r=JJ(r),r.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||UL(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||UL(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};tX.exports=HL;var JJ=GP(),{safeRe:XJ,t:ZJ}=bm(),UL=FL(),_L=Rw(),$J=Eo(),eX=Ul()});var Uw=_((Kkt,rX)=>{var U9e=Ul(),_9e=(t,e,r)=>{try{e=new U9e(e,r)}catch{return!1}return e.test(t)};rX.exports=_9e});var iX=_((Vkt,nX)=>{var H9e=Ul(),q9e=(t,e)=>new H9e(t,e).set.map(r=>r.map(o=>o.value).join(" ").trim().split(" "));nX.exports=q9e});var oX=_((zkt,sX)=>{var j9e=Eo(),G9e=Ul(),W9e=(t,e,r)=>{let o=null,a=null,n=null;try{n=new G9e(e,r)}catch{return null}return t.forEach(u=>{n.test(u)&&(!o||a.compare(u)===-1)&&(o=u,a=new j9e(o,r))}),o};sX.exports=W9e});var lX=_((Jkt,aX)=>{var Y9e=Eo(),K9e=Ul(),V9e=(t,e,r)=>{let o=null,a=null,n=null;try{n=new K9e(e,r)}catch{return null}return t.forEach(u=>{n.test(u)&&(!o||a.compare(u)===1)&&(o=u,a=new Y9e(o,r))}),o};aX.exports=V9e});var AX=_((Xkt,uX)=>{var qL=Eo(),z9e=Ul(),cX=Tw(),J9e=(t,e)=>{t=new z9e(t,e);let r=new qL("0.0.0");if(t.test(r)||(r=new qL("0.0.0-0"),t.test(r)))return r;r=null;for(let o=0;o{let A=new qL(u.semver.version);switch(u.operator){case">":A.prerelease.length===0?A.patch++:A.prerelease.push(0),A.raw=A.format();case"":case">=":(!n||cX(A,n))&&(n=A);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${u.operator}`)}}),n&&(!r||cX(r,n))&&(r=n)}return r&&t.test(r)?r:null};uX.exports=J9e});var pX=_((Zkt,fX)=>{var X9e=Ul(),Z9e=(t,e)=>{try{return new X9e(t,e).range||"*"}catch{return null}};fX.exports=Z9e});var tS=_(($kt,mX)=>{var $9e=Eo(),dX=Ow(),{ANY:eGe}=dX,tGe=Ul(),rGe=Uw(),hX=Tw(),gX=VP(),nGe=JP(),iGe=zP(),sGe=(t,e,r,o)=>{t=new $9e(t,o),e=new tGe(e,o);let a,n,u,A,p;switch(r){case">":a=hX,n=nGe,u=gX,A=">",p=">=";break;case"<":a=gX,n=iGe,u=hX,A="<",p="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(rGe(t,e,o))return!1;for(let h=0;h{b.semver===eGe&&(b=new dX(">=0.0.0")),w=w||b,D=D||b,a(b.semver,w.semver,o)?w=b:u(b.semver,D.semver,o)&&(D=b)}),w.operator===A||w.operator===p||(!D.operator||D.operator===A)&&n(t,D.semver))return!1;if(D.operator===p&&u(t,D.semver))return!1}return!0};mX.exports=sGe});var EX=_((eQt,yX)=>{var oGe=tS(),aGe=(t,e,r)=>oGe(t,e,">",r);yX.exports=aGe});var IX=_((tQt,CX)=>{var lGe=tS(),cGe=(t,e,r)=>lGe(t,e,"<",r);CX.exports=cGe});var vX=_((rQt,BX)=>{var wX=Ul(),uGe=(t,e,r)=>(t=new wX(t,r),e=new wX(e,r),t.intersects(e,r));BX.exports=uGe});var PX=_((nQt,DX)=>{var AGe=Uw(),fGe=Ml();DX.exports=(t,e,r)=>{let o=[],a=null,n=null,u=t.sort((E,w)=>fGe(E,w,r));for(let E of u)AGe(E,e,r)?(n=E,a||(a=E)):(n&&o.push([a,n]),n=null,a=null);a&&o.push([a,null]);let A=[];for(let[E,w]of o)E===w?A.push(E):!w&&E===u[0]?A.push("*"):w?E===u[0]?A.push(`<=${w}`):A.push(`${E} - ${w}`):A.push(`>=${E}`);let p=A.join(" || "),h=typeof e.raw=="string"?e.raw:String(e);return p.length{var SX=Ul(),WL=Ow(),{ANY:jL}=WL,_w=Uw(),YL=Ml(),pGe=(t,e,r={})=>{if(t===e)return!0;t=new SX(t,r),e=new SX(e,r);let o=!1;e:for(let a of t.set){for(let n of e.set){let u=gGe(a,n,r);if(o=o||u!==null,u)continue e}if(o)return!1}return!0},hGe=[new WL(">=0.0.0-0")],xX=[new WL(">=0.0.0")],gGe=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===jL){if(e.length===1&&e[0].semver===jL)return!0;r.includePrerelease?t=hGe:t=xX}if(e.length===1&&e[0].semver===jL){if(r.includePrerelease)return!0;e=xX}let o=new Set,a,n;for(let b of t)b.operator===">"||b.operator===">="?a=bX(a,b,r):b.operator==="<"||b.operator==="<="?n=kX(n,b,r):o.add(b.semver);if(o.size>1)return null;let u;if(a&&n){if(u=YL(a.semver,n.semver,r),u>0)return null;if(u===0&&(a.operator!==">="||n.operator!=="<="))return null}for(let b of o){if(a&&!_w(b,String(a),r)||n&&!_w(b,String(n),r))return null;for(let C of e)if(!_w(b,String(C),r))return!1;return!0}let A,p,h,E,w=n&&!r.includePrerelease&&n.semver.prerelease.length?n.semver:!1,D=a&&!r.includePrerelease&&a.semver.prerelease.length?a.semver:!1;w&&w.prerelease.length===1&&n.operator==="<"&&w.prerelease[0]===0&&(w=!1);for(let b of e){if(E=E||b.operator===">"||b.operator===">=",h=h||b.operator==="<"||b.operator==="<=",a){if(D&&b.semver.prerelease&&b.semver.prerelease.length&&b.semver.major===D.major&&b.semver.minor===D.minor&&b.semver.patch===D.patch&&(D=!1),b.operator===">"||b.operator===">="){if(A=bX(a,b,r),A===b&&A!==a)return!1}else if(a.operator===">="&&!_w(a.semver,String(b),r))return!1}if(n){if(w&&b.semver.prerelease&&b.semver.prerelease.length&&b.semver.major===w.major&&b.semver.minor===w.minor&&b.semver.patch===w.patch&&(w=!1),b.operator==="<"||b.operator==="<="){if(p=kX(n,b,r),p===b&&p!==n)return!1}else if(n.operator==="<="&&!_w(n.semver,String(b),r))return!1}if(!b.operator&&(n||a)&&u!==0)return!1}return!(a&&h&&!n&&u!==0||n&&E&&!a&&u!==0||D||w)},bX=(t,e,r)=>{if(!t)return e;let o=YL(t.semver,e.semver,r);return o>0?t:o<0||e.operator===">"&&t.operator===">="?e:t},kX=(t,e,r)=>{if(!t)return e;let o=YL(t.semver,e.semver,r);return o<0?t:o>0||e.operator==="<"&&t.operator==="<="?e:t};QX.exports=pGe});var ni=_((sQt,LX)=>{var KL=bm(),RX=Fw(),dGe=Eo(),TX=xL(),mGe=cg(),yGe=eJ(),EGe=rJ(),CGe=sJ(),IGe=lJ(),wGe=uJ(),BGe=fJ(),vGe=hJ(),DGe=dJ(),PGe=Ml(),SGe=CJ(),xGe=wJ(),bGe=KP(),kGe=PJ(),QGe=xJ(),FGe=Tw(),RGe=VP(),TGe=kL(),LGe=QL(),NGe=zP(),OGe=JP(),MGe=FL(),UGe=OJ(),_Ge=Ow(),HGe=Ul(),qGe=Uw(),jGe=iX(),GGe=oX(),WGe=lX(),YGe=AX(),KGe=pX(),VGe=tS(),zGe=EX(),JGe=IX(),XGe=vX(),ZGe=PX(),$Ge=FX();LX.exports={parse:mGe,valid:yGe,clean:EGe,inc:CGe,diff:IGe,major:wGe,minor:BGe,patch:vGe,prerelease:DGe,compare:PGe,rcompare:SGe,compareLoose:xGe,compareBuild:bGe,sort:kGe,rsort:QGe,gt:FGe,lt:RGe,eq:TGe,neq:LGe,gte:NGe,lte:OGe,cmp:MGe,coerce:UGe,Comparator:_Ge,Range:HGe,satisfies:qGe,toComparators:jGe,maxSatisfying:GGe,minSatisfying:WGe,minVersion:YGe,validRange:KGe,outside:VGe,gtr:zGe,ltr:JGe,intersects:XGe,simplifyRange:ZGe,subset:$Ge,SemVer:dGe,re:KL.re,src:KL.src,tokens:KL.t,SEMVER_SPEC_VERSION:RX.SEMVER_SPEC_VERSION,RELEASE_TYPES:RX.RELEASE_TYPES,compareIdentifiers:TX.compareIdentifiers,rcompareIdentifiers:TX.rcompareIdentifiers}});var OX=_((oQt,NX)=>{"use strict";function e5e(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}function pg(t,e,r,o){this.message=t,this.expected=e,this.found=r,this.location=o,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,pg)}e5e(pg,Error);pg.buildMessage=function(t,e){var r={literal:function(h){return'"'+a(h.text)+'"'},class:function(h){var E="",w;for(w=0;w0){for(w=1,D=1;w{switch(Fe[1]){case"|":return be|Fe[3];case"&":return be&Fe[3];case"^":return be^Fe[3]}},$)},D="!",b=Le("!",!1),C=function($){return!$},T="(",N=Le("(",!1),U=")",z=Le(")",!1),te=function($){return $},le=/^[^ \t\n\r()!|&\^]/,ce=Te([" "," ",` `,"\r","(",")","!","|","&","^"],!0,!1),ue=function($){return e.queryPattern.test($)},Ie=function($){return e.checkFn($)},he=xe("whitespace"),De=/^[ \t\n\r]/,Ee=Te([" "," ",` `,"\r"],!1,!1),g=0,me=0,Ce=[{line:1,column:1}],fe=0,ie=[],Z=0,Pe;if("startRule"in e){if(!(e.startRule in o))throw new Error(`Can't start parsing from rule "`+e.startRule+'".');a=o[e.startRule]}function Re(){return t.substring(me,g)}function ht(){return He(me,g)}function q($,se){throw se=se!==void 0?se:He(me,g),S([xe($)],t.substring(me,g),se)}function nt($,se){throw se=se!==void 0?se:He(me,g),I($,se)}function Le($,se){return{type:"literal",text:$,ignoreCase:se}}function Te($,se,be){return{type:"class",parts:$,inverted:se,ignoreCase:be}}function ke(){return{type:"any"}}function Ve(){return{type:"end"}}function xe($){return{type:"other",description:$}}function tt($){var se=Ce[$],be;if(se)return se;for(be=$-1;!Ce[be];)be--;for(se=Ce[be],se={line:se.line,column:se.column};be<$;)t.charCodeAt(be)===10?(se.line++,se.column=1):se.column++,be++;return Ce[$]=se,se}function He($,se){var be=tt($),Fe=tt(se);return{start:{offset:$,line:be.line,column:be.column},end:{offset:se,line:Fe.line,column:Fe.column}}}function x($){gfe&&(fe=g,ie=[]),ie.push($))}function I($,se){return new pg($,null,null,se)}function S($,se,be){return new pg(pg.buildMessage($,se),$,se,be)}function y(){var $,se,be,Fe,lt,Et,qt,nr;if($=g,se=R(),se!==r){for(be=[],Fe=g,lt=X(),lt!==r?(t.charCodeAt(g)===124?(Et=n,g++):(Et=r,Z===0&&x(u)),Et===r&&(t.charCodeAt(g)===38?(Et=A,g++):(Et=r,Z===0&&x(p)),Et===r&&(t.charCodeAt(g)===94?(Et=h,g++):(Et=r,Z===0&&x(E)))),Et!==r?(qt=X(),qt!==r?(nr=R(),nr!==r?(lt=[lt,Et,qt,nr],Fe=lt):(g=Fe,Fe=r)):(g=Fe,Fe=r)):(g=Fe,Fe=r)):(g=Fe,Fe=r);Fe!==r;)be.push(Fe),Fe=g,lt=X(),lt!==r?(t.charCodeAt(g)===124?(Et=n,g++):(Et=r,Z===0&&x(u)),Et===r&&(t.charCodeAt(g)===38?(Et=A,g++):(Et=r,Z===0&&x(p)),Et===r&&(t.charCodeAt(g)===94?(Et=h,g++):(Et=r,Z===0&&x(E)))),Et!==r?(qt=X(),qt!==r?(nr=R(),nr!==r?(lt=[lt,Et,qt,nr],Fe=lt):(g=Fe,Fe=r)):(g=Fe,Fe=r)):(g=Fe,Fe=r)):(g=Fe,Fe=r);be!==r?(me=$,se=w(se,be),$=se):(g=$,$=r)}else g=$,$=r;return $}function R(){var $,se,be,Fe,lt,Et;return $=g,t.charCodeAt(g)===33?(se=D,g++):(se=r,Z===0&&x(b)),se!==r?(be=R(),be!==r?(me=$,se=C(be),$=se):(g=$,$=r)):(g=$,$=r),$===r&&($=g,t.charCodeAt(g)===40?(se=T,g++):(se=r,Z===0&&x(N)),se!==r?(be=X(),be!==r?(Fe=y(),Fe!==r?(lt=X(),lt!==r?(t.charCodeAt(g)===41?(Et=U,g++):(Et=r,Z===0&&x(z)),Et!==r?(me=$,se=te(Fe),$=se):(g=$,$=r)):(g=$,$=r)):(g=$,$=r)):(g=$,$=r)):(g=$,$=r),$===r&&($=J())),$}function J(){var $,se,be,Fe,lt;if($=g,se=X(),se!==r){if(be=g,Fe=[],le.test(t.charAt(g))?(lt=t.charAt(g),g++):(lt=r,Z===0&&x(ce)),lt!==r)for(;lt!==r;)Fe.push(lt),le.test(t.charAt(g))?(lt=t.charAt(g),g++):(lt=r,Z===0&&x(ce));else Fe=r;Fe!==r?be=t.substring(be,g):be=Fe,be!==r?(me=g,Fe=ue(be),Fe?Fe=void 0:Fe=r,Fe!==r?(me=$,se=Ie(be),$=se):(g=$,$=r)):(g=$,$=r)}else g=$,$=r;return $}function X(){var $,se;for(Z++,$=[],De.test(t.charAt(g))?(se=t.charAt(g),g++):(se=r,Z===0&&x(Ee));se!==r;)$.push(se),De.test(t.charAt(g))?(se=t.charAt(g),g++):(se=r,Z===0&&x(Ee));return Z--,$===r&&(se=r,Z===0&&x(he)),$}if(Pe=a(),Pe!==r&&g===t.length)return Pe;throw Pe!==r&&g{var{parse:r5e}=OX();rS.makeParser=(t=/[a-z]+/)=>(e,r)=>r5e(e,{queryPattern:t,checkFn:r});rS.parse=rS.makeParser()});var _X=_((lQt,UX)=>{"use strict";UX.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var VL=_((cQt,qX)=>{var Hw=_X(),HX={};for(let t of Object.keys(Hw))HX[Hw[t]]=t;var fr={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};qX.exports=fr;for(let t of Object.keys(fr)){if(!("channels"in fr[t]))throw new Error("missing channels property: "+t);if(!("labels"in fr[t]))throw new Error("missing channel labels property: "+t);if(fr[t].labels.length!==fr[t].channels)throw new Error("channel and label counts mismatch: "+t);let{channels:e,labels:r}=fr[t];delete fr[t].channels,delete fr[t].labels,Object.defineProperty(fr[t],"channels",{value:e}),Object.defineProperty(fr[t],"labels",{value:r})}fr.rgb.hsl=function(t){let e=t[0]/255,r=t[1]/255,o=t[2]/255,a=Math.min(e,r,o),n=Math.max(e,r,o),u=n-a,A,p;n===a?A=0:e===n?A=(r-o)/u:r===n?A=2+(o-e)/u:o===n&&(A=4+(e-r)/u),A=Math.min(A*60,360),A<0&&(A+=360);let h=(a+n)/2;return n===a?p=0:h<=.5?p=u/(n+a):p=u/(2-n-a),[A,p*100,h*100]};fr.rgb.hsv=function(t){let e,r,o,a,n,u=t[0]/255,A=t[1]/255,p=t[2]/255,h=Math.max(u,A,p),E=h-Math.min(u,A,p),w=function(D){return(h-D)/6/E+1/2};return E===0?(a=0,n=0):(n=E/h,e=w(u),r=w(A),o=w(p),u===h?a=o-r:A===h?a=1/3+e-o:p===h&&(a=2/3+r-e),a<0?a+=1:a>1&&(a-=1)),[a*360,n*100,h*100]};fr.rgb.hwb=function(t){let e=t[0],r=t[1],o=t[2],a=fr.rgb.hsl(t)[0],n=1/255*Math.min(e,Math.min(r,o));return o=1-1/255*Math.max(e,Math.max(r,o)),[a,n*100,o*100]};fr.rgb.cmyk=function(t){let e=t[0]/255,r=t[1]/255,o=t[2]/255,a=Math.min(1-e,1-r,1-o),n=(1-e-a)/(1-a)||0,u=(1-r-a)/(1-a)||0,A=(1-o-a)/(1-a)||0;return[n*100,u*100,A*100,a*100]};function n5e(t,e){return(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2}fr.rgb.keyword=function(t){let e=HX[t];if(e)return e;let r=1/0,o;for(let a of Object.keys(Hw)){let n=Hw[a],u=n5e(t,n);u.04045?((e+.055)/1.055)**2.4:e/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92,o=o>.04045?((o+.055)/1.055)**2.4:o/12.92;let a=e*.4124+r*.3576+o*.1805,n=e*.2126+r*.7152+o*.0722,u=e*.0193+r*.1192+o*.9505;return[a*100,n*100,u*100]};fr.rgb.lab=function(t){let e=fr.rgb.xyz(t),r=e[0],o=e[1],a=e[2];r/=95.047,o/=100,a/=108.883,r=r>.008856?r**(1/3):7.787*r+16/116,o=o>.008856?o**(1/3):7.787*o+16/116,a=a>.008856?a**(1/3):7.787*a+16/116;let n=116*o-16,u=500*(r-o),A=200*(o-a);return[n,u,A]};fr.hsl.rgb=function(t){let e=t[0]/360,r=t[1]/100,o=t[2]/100,a,n,u;if(r===0)return u=o*255,[u,u,u];o<.5?a=o*(1+r):a=o+r-o*r;let A=2*o-a,p=[0,0,0];for(let h=0;h<3;h++)n=e+1/3*-(h-1),n<0&&n++,n>1&&n--,6*n<1?u=A+(a-A)*6*n:2*n<1?u=a:3*n<2?u=A+(a-A)*(2/3-n)*6:u=A,p[h]=u*255;return p};fr.hsl.hsv=function(t){let e=t[0],r=t[1]/100,o=t[2]/100,a=r,n=Math.max(o,.01);o*=2,r*=o<=1?o:2-o,a*=n<=1?n:2-n;let u=(o+r)/2,A=o===0?2*a/(n+a):2*r/(o+r);return[e,A*100,u*100]};fr.hsv.rgb=function(t){let e=t[0]/60,r=t[1]/100,o=t[2]/100,a=Math.floor(e)%6,n=e-Math.floor(e),u=255*o*(1-r),A=255*o*(1-r*n),p=255*o*(1-r*(1-n));switch(o*=255,a){case 0:return[o,p,u];case 1:return[A,o,u];case 2:return[u,o,p];case 3:return[u,A,o];case 4:return[p,u,o];case 5:return[o,u,A]}};fr.hsv.hsl=function(t){let e=t[0],r=t[1]/100,o=t[2]/100,a=Math.max(o,.01),n,u;u=(2-r)*o;let A=(2-r)*a;return n=r*a,n/=A<=1?A:2-A,n=n||0,u/=2,[e,n*100,u*100]};fr.hwb.rgb=function(t){let e=t[0]/360,r=t[1]/100,o=t[2]/100,a=r+o,n;a>1&&(r/=a,o/=a);let u=Math.floor(6*e),A=1-o;n=6*e-u,u&1&&(n=1-n);let p=r+n*(A-r),h,E,w;switch(u){default:case 6:case 0:h=A,E=p,w=r;break;case 1:h=p,E=A,w=r;break;case 2:h=r,E=A,w=p;break;case 3:h=r,E=p,w=A;break;case 4:h=p,E=r,w=A;break;case 5:h=A,E=r,w=p;break}return[h*255,E*255,w*255]};fr.cmyk.rgb=function(t){let e=t[0]/100,r=t[1]/100,o=t[2]/100,a=t[3]/100,n=1-Math.min(1,e*(1-a)+a),u=1-Math.min(1,r*(1-a)+a),A=1-Math.min(1,o*(1-a)+a);return[n*255,u*255,A*255]};fr.xyz.rgb=function(t){let e=t[0]/100,r=t[1]/100,o=t[2]/100,a,n,u;return a=e*3.2406+r*-1.5372+o*-.4986,n=e*-.9689+r*1.8758+o*.0415,u=e*.0557+r*-.204+o*1.057,a=a>.0031308?1.055*a**(1/2.4)-.055:a*12.92,n=n>.0031308?1.055*n**(1/2.4)-.055:n*12.92,u=u>.0031308?1.055*u**(1/2.4)-.055:u*12.92,a=Math.min(Math.max(0,a),1),n=Math.min(Math.max(0,n),1),u=Math.min(Math.max(0,u),1),[a*255,n*255,u*255]};fr.xyz.lab=function(t){let e=t[0],r=t[1],o=t[2];e/=95.047,r/=100,o/=108.883,e=e>.008856?e**(1/3):7.787*e+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,o=o>.008856?o**(1/3):7.787*o+16/116;let a=116*r-16,n=500*(e-r),u=200*(r-o);return[a,n,u]};fr.lab.xyz=function(t){let e=t[0],r=t[1],o=t[2],a,n,u;n=(e+16)/116,a=r/500+n,u=n-o/200;let A=n**3,p=a**3,h=u**3;return n=A>.008856?A:(n-16/116)/7.787,a=p>.008856?p:(a-16/116)/7.787,u=h>.008856?h:(u-16/116)/7.787,a*=95.047,n*=100,u*=108.883,[a,n,u]};fr.lab.lch=function(t){let e=t[0],r=t[1],o=t[2],a;a=Math.atan2(o,r)*360/2/Math.PI,a<0&&(a+=360);let u=Math.sqrt(r*r+o*o);return[e,u,a]};fr.lch.lab=function(t){let e=t[0],r=t[1],a=t[2]/360*2*Math.PI,n=r*Math.cos(a),u=r*Math.sin(a);return[e,n,u]};fr.rgb.ansi16=function(t,e=null){let[r,o,a]=t,n=e===null?fr.rgb.hsv(t)[2]:e;if(n=Math.round(n/50),n===0)return 30;let u=30+(Math.round(a/255)<<2|Math.round(o/255)<<1|Math.round(r/255));return n===2&&(u+=60),u};fr.hsv.ansi16=function(t){return fr.rgb.ansi16(fr.hsv.rgb(t),t[2])};fr.rgb.ansi256=function(t){let e=t[0],r=t[1],o=t[2];return e===r&&r===o?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(o/255*5)};fr.ansi16.rgb=function(t){let e=t%10;if(e===0||e===7)return t>50&&(e+=3.5),e=e/10.5*255,[e,e,e];let r=(~~(t>50)+1)*.5,o=(e&1)*r*255,a=(e>>1&1)*r*255,n=(e>>2&1)*r*255;return[o,a,n]};fr.ansi256.rgb=function(t){if(t>=232){let n=(t-232)*10+8;return[n,n,n]}t-=16;let e,r=Math.floor(t/36)/5*255,o=Math.floor((e=t%36)/6)/5*255,a=e%6/5*255;return[r,o,a]};fr.rgb.hex=function(t){let r=(((Math.round(t[0])&255)<<16)+((Math.round(t[1])&255)<<8)+(Math.round(t[2])&255)).toString(16).toUpperCase();return"000000".substring(r.length)+r};fr.hex.rgb=function(t){let e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];let r=e[0];e[0].length===3&&(r=r.split("").map(A=>A+A).join(""));let o=parseInt(r,16),a=o>>16&255,n=o>>8&255,u=o&255;return[a,n,u]};fr.rgb.hcg=function(t){let e=t[0]/255,r=t[1]/255,o=t[2]/255,a=Math.max(Math.max(e,r),o),n=Math.min(Math.min(e,r),o),u=a-n,A,p;return u<1?A=n/(1-u):A=0,u<=0?p=0:a===e?p=(r-o)/u%6:a===r?p=2+(o-e)/u:p=4+(e-r)/u,p/=6,p%=1,[p*360,u*100,A*100]};fr.hsl.hcg=function(t){let e=t[1]/100,r=t[2]/100,o=r<.5?2*e*r:2*e*(1-r),a=0;return o<1&&(a=(r-.5*o)/(1-o)),[t[0],o*100,a*100]};fr.hsv.hcg=function(t){let e=t[1]/100,r=t[2]/100,o=e*r,a=0;return o<1&&(a=(r-o)/(1-o)),[t[0],o*100,a*100]};fr.hcg.rgb=function(t){let e=t[0]/360,r=t[1]/100,o=t[2]/100;if(r===0)return[o*255,o*255,o*255];let a=[0,0,0],n=e%1*6,u=n%1,A=1-u,p=0;switch(Math.floor(n)){case 0:a[0]=1,a[1]=u,a[2]=0;break;case 1:a[0]=A,a[1]=1,a[2]=0;break;case 2:a[0]=0,a[1]=1,a[2]=u;break;case 3:a[0]=0,a[1]=A,a[2]=1;break;case 4:a[0]=u,a[1]=0,a[2]=1;break;default:a[0]=1,a[1]=0,a[2]=A}return p=(1-r)*o,[(r*a[0]+p)*255,(r*a[1]+p)*255,(r*a[2]+p)*255]};fr.hcg.hsv=function(t){let e=t[1]/100,r=t[2]/100,o=e+r*(1-e),a=0;return o>0&&(a=e/o),[t[0],a*100,o*100]};fr.hcg.hsl=function(t){let e=t[1]/100,o=t[2]/100*(1-e)+.5*e,a=0;return o>0&&o<.5?a=e/(2*o):o>=.5&&o<1&&(a=e/(2*(1-o))),[t[0],a*100,o*100]};fr.hcg.hwb=function(t){let e=t[1]/100,r=t[2]/100,o=e+r*(1-e);return[t[0],(o-e)*100,(1-o)*100]};fr.hwb.hcg=function(t){let e=t[1]/100,o=1-t[2]/100,a=o-e,n=0;return a<1&&(n=(o-a)/(1-a)),[t[0],a*100,n*100]};fr.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};fr.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};fr.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};fr.gray.hsl=function(t){return[0,0,t[0]]};fr.gray.hsv=fr.gray.hsl;fr.gray.hwb=function(t){return[0,100,t[0]]};fr.gray.cmyk=function(t){return[0,0,0,t[0]]};fr.gray.lab=function(t){return[t[0],0,0]};fr.gray.hex=function(t){let e=Math.round(t[0]/100*255)&255,o=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(o.length)+o};fr.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}});var GX=_((uQt,jX)=>{var nS=VL();function i5e(){let t={},e=Object.keys(nS);for(let r=e.length,o=0;o{var zL=VL(),l5e=GX(),Rm={},c5e=Object.keys(zL);function u5e(t){let e=function(...r){let o=r[0];return o==null?o:(o.length>1&&(r=o),t(r))};return"conversion"in t&&(e.conversion=t.conversion),e}function A5e(t){let e=function(...r){let o=r[0];if(o==null)return o;o.length>1&&(r=o);let a=t(r);if(typeof a=="object")for(let n=a.length,u=0;u{Rm[t]={},Object.defineProperty(Rm[t],"channels",{value:zL[t].channels}),Object.defineProperty(Rm[t],"labels",{value:zL[t].labels});let e=l5e(t);Object.keys(e).forEach(o=>{let a=e[o];Rm[t][o]=A5e(a),Rm[t][o].raw=u5e(a)})});WX.exports=Rm});var qw=_((fQt,XX)=>{"use strict";var KX=(t,e)=>(...r)=>`\x1B[${t(...r)+e}m`,VX=(t,e)=>(...r)=>{let o=t(...r);return`\x1B[${38+e};5;${o}m`},zX=(t,e)=>(...r)=>{let o=t(...r);return`\x1B[${38+e};2;${o[0]};${o[1]};${o[2]}m`},iS=t=>t,JX=(t,e,r)=>[t,e,r],Tm=(t,e,r)=>{Object.defineProperty(t,e,{get:()=>{let o=r();return Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0}),o},enumerable:!0,configurable:!0})},JL,Lm=(t,e,r,o)=>{JL===void 0&&(JL=YX());let a=o?10:0,n={};for(let[u,A]of Object.entries(JL)){let p=u==="ansi16"?"ansi":u;u===e?n[p]=t(r,a):typeof A=="object"&&(n[p]=t(A[e],a))}return n};function f5e(){let t=new Map,e={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};e.color.gray=e.color.blackBright,e.bgColor.bgGray=e.bgColor.bgBlackBright,e.color.grey=e.color.blackBright,e.bgColor.bgGrey=e.bgColor.bgBlackBright;for(let[r,o]of Object.entries(e)){for(let[a,n]of Object.entries(o))e[a]={open:`\x1B[${n[0]}m`,close:`\x1B[${n[1]}m`},o[a]=e[a],t.set(n[0],n[1]);Object.defineProperty(e,r,{value:o,enumerable:!1})}return Object.defineProperty(e,"codes",{value:t,enumerable:!1}),e.color.close="\x1B[39m",e.bgColor.close="\x1B[49m",Tm(e.color,"ansi",()=>Lm(KX,"ansi16",iS,!1)),Tm(e.color,"ansi256",()=>Lm(VX,"ansi256",iS,!1)),Tm(e.color,"ansi16m",()=>Lm(zX,"rgb",JX,!1)),Tm(e.bgColor,"ansi",()=>Lm(KX,"ansi16",iS,!0)),Tm(e.bgColor,"ansi256",()=>Lm(VX,"ansi256",iS,!0)),Tm(e.bgColor,"ansi16m",()=>Lm(zX,"rgb",JX,!0)),e}Object.defineProperty(XX,"exports",{enumerable:!0,get:f5e})});var $X=_((pQt,ZX)=>{"use strict";ZX.exports=(t,e=process.argv)=>{let r=t.startsWith("-")?"":t.length===1?"-":"--",o=e.indexOf(r+t),a=e.indexOf("--");return o!==-1&&(a===-1||o{"use strict";var p5e=ve("os"),eZ=ve("tty"),_l=$X(),{env:cs}=process,Zp;_l("no-color")||_l("no-colors")||_l("color=false")||_l("color=never")?Zp=0:(_l("color")||_l("colors")||_l("color=true")||_l("color=always"))&&(Zp=1);"FORCE_COLOR"in cs&&(cs.FORCE_COLOR==="true"?Zp=1:cs.FORCE_COLOR==="false"?Zp=0:Zp=cs.FORCE_COLOR.length===0?1:Math.min(parseInt(cs.FORCE_COLOR,10),3));function XL(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function ZL(t,e){if(Zp===0)return 0;if(_l("color=16m")||_l("color=full")||_l("color=truecolor"))return 3;if(_l("color=256"))return 2;if(t&&!e&&Zp===void 0)return 0;let r=Zp||0;if(cs.TERM==="dumb")return r;if(process.platform==="win32"){let o=p5e.release().split(".");return Number(o[0])>=10&&Number(o[2])>=10586?Number(o[2])>=14931?3:2:1}if("CI"in cs)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(o=>o in cs)||cs.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in cs)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(cs.TEAMCITY_VERSION)?1:0;if("GITHUB_ACTIONS"in cs)return 1;if(cs.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in cs){let o=parseInt((cs.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(cs.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(cs.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(cs.TERM)||"COLORTERM"in cs?1:r}function h5e(t){let e=ZL(t,t&&t.isTTY);return XL(e)}tZ.exports={supportsColor:h5e,stdout:XL(ZL(!0,eZ.isatty(1))),stderr:XL(ZL(!0,eZ.isatty(2)))}});var nZ=_((gQt,rZ)=>{"use strict";var g5e=(t,e,r)=>{let o=t.indexOf(e);if(o===-1)return t;let a=e.length,n=0,u="";do u+=t.substr(n,o-n)+e+r,n=o+a,o=t.indexOf(e,n);while(o!==-1);return u+=t.substr(n),u},d5e=(t,e,r,o)=>{let a=0,n="";do{let u=t[o-1]==="\r";n+=t.substr(a,(u?o-1:o)-a)+e+(u?`\r `:` `)+r,a=o+1,o=t.indexOf(` `,a)}while(o!==-1);return n+=t.substr(a),n};rZ.exports={stringReplaceAll:g5e,stringEncaseCRLFWithFirstIndex:d5e}});var lZ=_((dQt,aZ)=>{"use strict";var m5e=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,iZ=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,y5e=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,E5e=/\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.)|([^\\])/gi,C5e=new Map([["n",` `],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function oZ(t){let e=t[0]==="u",r=t[1]==="{";return e&&!r&&t.length===5||t[0]==="x"&&t.length===3?String.fromCharCode(parseInt(t.slice(1),16)):e&&r?String.fromCodePoint(parseInt(t.slice(2,-1),16)):C5e.get(t)||t}function I5e(t,e){let r=[],o=e.trim().split(/\s*,\s*/g),a;for(let n of o){let u=Number(n);if(!Number.isNaN(u))r.push(u);else if(a=n.match(y5e))r.push(a[2].replace(E5e,(A,p,h)=>p?oZ(p):h));else throw new Error(`Invalid Chalk template style argument: ${n} (in style '${t}')`)}return r}function w5e(t){iZ.lastIndex=0;let e=[],r;for(;(r=iZ.exec(t))!==null;){let o=r[1];if(r[2]){let a=I5e(o,r[2]);e.push([o].concat(a))}else e.push([o])}return e}function sZ(t,e){let r={};for(let a of e)for(let n of a.styles)r[n[0]]=a.inverse?null:n.slice(1);let o=t;for(let[a,n]of Object.entries(r))if(Array.isArray(n)){if(!(a in o))throw new Error(`Unknown Chalk style: ${a}`);o=n.length>0?o[a](...n):o[a]}return o}aZ.exports=(t,e)=>{let r=[],o=[],a=[];if(e.replace(m5e,(n,u,A,p,h,E)=>{if(u)a.push(oZ(u));else if(p){let w=a.join("");a=[],o.push(r.length===0?w:sZ(t,r)(w)),r.push({inverse:A,styles:w5e(p)})}else if(h){if(r.length===0)throw new Error("Found extraneous } in Chalk template literal");o.push(sZ(t,r)(a.join(""))),a=[],r.pop()}else a.push(E)}),o.push(a.join("")),r.length>0){let n=`Chalk template literal is missing ${r.length} closing bracket${r.length===1?"":"s"} (\`}\`)`;throw new Error(n)}return o.join("")}});var sN=_((mQt,fZ)=>{"use strict";var jw=qw(),{stdout:tN,stderr:rN}=$L(),{stringReplaceAll:B5e,stringEncaseCRLFWithFirstIndex:v5e}=nZ(),cZ=["ansi","ansi","ansi256","ansi16m"],Nm=Object.create(null),D5e=(t,e={})=>{if(e.level>3||e.level<0)throw new Error("The `level` option should be an integer from 0 to 3");let r=tN?tN.level:0;t.level=e.level===void 0?r:e.level},nN=class{constructor(e){return uZ(e)}},uZ=t=>{let e={};return D5e(e,t),e.template=(...r)=>x5e(e.template,...r),Object.setPrototypeOf(e,sS.prototype),Object.setPrototypeOf(e.template,e),e.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},e.template.Instance=nN,e.template};function sS(t){return uZ(t)}for(let[t,e]of Object.entries(jw))Nm[t]={get(){let r=oS(this,iN(e.open,e.close,this._styler),this._isEmpty);return Object.defineProperty(this,t,{value:r}),r}};Nm.visible={get(){let t=oS(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:t}),t}};var AZ=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let t of AZ)Nm[t]={get(){let{level:e}=this;return function(...r){let o=iN(jw.color[cZ[e]][t](...r),jw.color.close,this._styler);return oS(this,o,this._isEmpty)}}};for(let t of AZ){let e="bg"+t[0].toUpperCase()+t.slice(1);Nm[e]={get(){let{level:r}=this;return function(...o){let a=iN(jw.bgColor[cZ[r]][t](...o),jw.bgColor.close,this._styler);return oS(this,a,this._isEmpty)}}}}var P5e=Object.defineProperties(()=>{},{...Nm,level:{enumerable:!0,get(){return this._generator.level},set(t){this._generator.level=t}}}),iN=(t,e,r)=>{let o,a;return r===void 0?(o=t,a=e):(o=r.openAll+t,a=e+r.closeAll),{open:t,close:e,openAll:o,closeAll:a,parent:r}},oS=(t,e,r)=>{let o=(...a)=>S5e(o,a.length===1?""+a[0]:a.join(" "));return o.__proto__=P5e,o._generator=t,o._styler=e,o._isEmpty=r,o},S5e=(t,e)=>{if(t.level<=0||!e)return t._isEmpty?"":e;let r=t._styler;if(r===void 0)return e;let{openAll:o,closeAll:a}=r;if(e.indexOf("\x1B")!==-1)for(;r!==void 0;)e=B5e(e,r.close,r.open),r=r.parent;let n=e.indexOf(` `);return n!==-1&&(e=v5e(e,a,o,n)),o+e+a},eN,x5e=(t,...e)=>{let[r]=e;if(!Array.isArray(r))return e.join(" ");let o=e.slice(1),a=[r.raw[0]];for(let n=1;n{"use strict";Hl.isInteger=t=>typeof t=="number"?Number.isInteger(t):typeof t=="string"&&t.trim()!==""?Number.isInteger(Number(t)):!1;Hl.find=(t,e)=>t.nodes.find(r=>r.type===e);Hl.exceedsLimit=(t,e,r=1,o)=>o===!1||!Hl.isInteger(t)||!Hl.isInteger(e)?!1:(Number(e)-Number(t))/Number(r)>=o;Hl.escapeNode=(t,e=0,r)=>{let o=t.nodes[e];o&&(r&&o.type===r||o.type==="open"||o.type==="close")&&o.escaped!==!0&&(o.value="\\"+o.value,o.escaped=!0)};Hl.encloseBrace=t=>t.type!=="brace"||t.commas>>0+t.ranges>>0?!1:(t.invalid=!0,!0);Hl.isInvalidBrace=t=>t.type!=="brace"?!1:t.invalid===!0||t.dollar?!0:!(t.commas>>0+t.ranges>>0)||t.open!==!0||t.close!==!0?(t.invalid=!0,!0):!1;Hl.isOpenOrClose=t=>t.type==="open"||t.type==="close"?!0:t.open===!0||t.close===!0;Hl.reduce=t=>t.reduce((e,r)=>(r.type==="text"&&e.push(r.value),r.type==="range"&&(r.type="text"),e),[]);Hl.flatten=(...t)=>{let e=[],r=o=>{for(let a=0;a{"use strict";var pZ=aS();hZ.exports=(t,e={})=>{let r=(o,a={})=>{let n=e.escapeInvalid&&pZ.isInvalidBrace(a),u=o.invalid===!0&&e.escapeInvalid===!0,A="";if(o.value)return(n||u)&&pZ.isOpenOrClose(o)?"\\"+o.value:o.value;if(o.value)return o.value;if(o.nodes)for(let p of o.nodes)A+=r(p);return A};return r(t)}});var dZ=_((CQt,gZ)=>{"use strict";gZ.exports=function(t){return typeof t=="number"?t-t===0:typeof t=="string"&&t.trim()!==""?Number.isFinite?Number.isFinite(+t):isFinite(+t):!1}});var DZ=_((IQt,vZ)=>{"use strict";var mZ=dZ(),hg=(t,e,r)=>{if(mZ(t)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||t===e)return String(t);if(mZ(e)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let o={relaxZeros:!0,...r};typeof o.strictZeros=="boolean"&&(o.relaxZeros=o.strictZeros===!1);let a=String(o.relaxZeros),n=String(o.shorthand),u=String(o.capture),A=String(o.wrap),p=t+":"+e+"="+a+n+u+A;if(hg.cache.hasOwnProperty(p))return hg.cache[p].result;let h=Math.min(t,e),E=Math.max(t,e);if(Math.abs(h-E)===1){let T=t+"|"+e;return o.capture?`(${T})`:o.wrap===!1?T:`(?:${T})`}let w=BZ(t)||BZ(e),D={min:t,max:e,a:h,b:E},b=[],C=[];if(w&&(D.isPadded=w,D.maxLen=String(D.max).length),h<0){let T=E<0?Math.abs(E):1;C=yZ(T,Math.abs(h),D,o),h=D.a=0}return E>=0&&(b=yZ(h,E,D,o)),D.negatives=C,D.positives=b,D.result=b5e(C,b,o),o.capture===!0?D.result=`(${D.result})`:o.wrap!==!1&&b.length+C.length>1&&(D.result=`(?:${D.result})`),hg.cache[p]=D,D.result};function b5e(t,e,r){let o=oN(t,e,"-",!1,r)||[],a=oN(e,t,"",!1,r)||[],n=oN(t,e,"-?",!0,r)||[];return o.concat(n).concat(a).join("|")}function k5e(t,e){let r=1,o=1,a=CZ(t,r),n=new Set([e]);for(;t<=a&&a<=e;)n.add(a),r+=1,a=CZ(t,r);for(a=IZ(e+1,o)-1;t1&&A.count.pop(),A.count.push(E.count[0]),A.string=A.pattern+wZ(A.count),u=h+1;continue}r.isPadded&&(w=L5e(h,r,o)),E.string=w+E.pattern+wZ(E.count),n.push(E),u=h+1,A=E}return n}function oN(t,e,r,o,a){let n=[];for(let u of t){let{string:A}=u;!o&&!EZ(e,"string",A)&&n.push(r+A),o&&EZ(e,"string",A)&&n.push(r+A)}return n}function F5e(t,e){let r=[];for(let o=0;oe?1:e>t?-1:0}function EZ(t,e,r){return t.some(o=>o[e]===r)}function CZ(t,e){return Number(String(t).slice(0,-e)+"9".repeat(e))}function IZ(t,e){return t-t%Math.pow(10,e)}function wZ(t){let[e=0,r=""]=t;return r||e>1?`{${e+(r?","+r:"")}}`:""}function T5e(t,e,r){return`[${t}${e-t===1?"":"-"}${e}]`}function BZ(t){return/^-?(0+)\d/.test(t)}function L5e(t,e,r){if(!e.isPadded)return t;let o=Math.abs(e.maxLen-String(t).length),a=r.relaxZeros!==!1;switch(o){case 0:return"";case 1:return a?"0?":"0";case 2:return a?"0{0,2}":"00";default:return a?`0{0,${o}}`:`0{${o}}`}}hg.cache={};hg.clearCache=()=>hg.cache={};vZ.exports=hg});var cN=_((wQt,RZ)=>{"use strict";var N5e=ve("util"),xZ=DZ(),PZ=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),O5e=t=>e=>t===!0?Number(e):String(e),aN=t=>typeof t=="number"||typeof t=="string"&&t!=="",Ww=t=>Number.isInteger(+t),lN=t=>{let e=`${t}`,r=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return!1;for(;e[++r]==="0";);return r>0},M5e=(t,e,r)=>typeof t=="string"||typeof e=="string"?!0:r.stringify===!0,U5e=(t,e,r)=>{if(e>0){let o=t[0]==="-"?"-":"";o&&(t=t.slice(1)),t=o+t.padStart(o?e-1:e,"0")}return r===!1?String(t):t},SZ=(t,e)=>{let r=t[0]==="-"?"-":"";for(r&&(t=t.slice(1),e--);t.length{t.negatives.sort((u,A)=>uA?1:0),t.positives.sort((u,A)=>uA?1:0);let r=e.capture?"":"?:",o="",a="",n;return t.positives.length&&(o=t.positives.join("|")),t.negatives.length&&(a=`-(${r}${t.negatives.join("|")})`),o&&a?n=`${o}|${a}`:n=o||a,e.wrap?`(${r}${n})`:n},bZ=(t,e,r,o)=>{if(r)return xZ(t,e,{wrap:!1,...o});let a=String.fromCharCode(t);if(t===e)return a;let n=String.fromCharCode(e);return`[${a}-${n}]`},kZ=(t,e,r)=>{if(Array.isArray(t)){let o=r.wrap===!0,a=r.capture?"":"?:";return o?`(${a}${t.join("|")})`:t.join("|")}return xZ(t,e,r)},QZ=(...t)=>new RangeError("Invalid range arguments: "+N5e.inspect(...t)),FZ=(t,e,r)=>{if(r.strictRanges===!0)throw QZ([t,e]);return[]},H5e=(t,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step "${t}" to be a number`);return[]},q5e=(t,e,r=1,o={})=>{let a=Number(t),n=Number(e);if(!Number.isInteger(a)||!Number.isInteger(n)){if(o.strictRanges===!0)throw QZ([t,e]);return[]}a===0&&(a=0),n===0&&(n=0);let u=a>n,A=String(t),p=String(e),h=String(r);r=Math.max(Math.abs(r),1);let E=lN(A)||lN(p)||lN(h),w=E?Math.max(A.length,p.length,h.length):0,D=E===!1&&M5e(t,e,o)===!1,b=o.transform||O5e(D);if(o.toRegex&&r===1)return bZ(SZ(t,w),SZ(e,w),!0,o);let C={negatives:[],positives:[]},T=z=>C[z<0?"negatives":"positives"].push(Math.abs(z)),N=[],U=0;for(;u?a>=n:a<=n;)o.toRegex===!0&&r>1?T(a):N.push(U5e(b(a,U),w,D)),a=u?a-r:a+r,U++;return o.toRegex===!0?r>1?_5e(C,o):kZ(N,null,{wrap:!1,...o}):N},j5e=(t,e,r=1,o={})=>{if(!Ww(t)&&t.length>1||!Ww(e)&&e.length>1)return FZ(t,e,o);let a=o.transform||(D=>String.fromCharCode(D)),n=`${t}`.charCodeAt(0),u=`${e}`.charCodeAt(0),A=n>u,p=Math.min(n,u),h=Math.max(n,u);if(o.toRegex&&r===1)return bZ(p,h,!1,o);let E=[],w=0;for(;A?n>=u:n<=u;)E.push(a(n,w)),n=A?n-r:n+r,w++;return o.toRegex===!0?kZ(E,null,{wrap:!1,options:o}):E},cS=(t,e,r,o={})=>{if(e==null&&aN(t))return[t];if(!aN(t)||!aN(e))return FZ(t,e,o);if(typeof r=="function")return cS(t,e,1,{transform:r});if(PZ(r))return cS(t,e,0,r);let a={...o};return a.capture===!0&&(a.wrap=!0),r=r||a.step||1,Ww(r)?Ww(t)&&Ww(e)?q5e(t,e,r,a):j5e(t,e,Math.max(Math.abs(r),1),a):r!=null&&!PZ(r)?H5e(r,a):cS(t,e,1,r)};RZ.exports=cS});var NZ=_((BQt,LZ)=>{"use strict";var G5e=cN(),TZ=aS(),W5e=(t,e={})=>{let r=(o,a={})=>{let n=TZ.isInvalidBrace(a),u=o.invalid===!0&&e.escapeInvalid===!0,A=n===!0||u===!0,p=e.escapeInvalid===!0?"\\":"",h="";if(o.isOpen===!0||o.isClose===!0)return p+o.value;if(o.type==="open")return A?p+o.value:"(";if(o.type==="close")return A?p+o.value:")";if(o.type==="comma")return o.prev.type==="comma"?"":A?o.value:"|";if(o.value)return o.value;if(o.nodes&&o.ranges>0){let E=TZ.reduce(o.nodes),w=G5e(...E,{...e,wrap:!1,toRegex:!0});if(w.length!==0)return E.length>1&&w.length>1?`(${w})`:w}if(o.nodes)for(let E of o.nodes)h+=r(E,o);return h};return r(t)};LZ.exports=W5e});var UZ=_((vQt,MZ)=>{"use strict";var Y5e=cN(),OZ=lS(),Om=aS(),gg=(t="",e="",r=!1)=>{let o=[];if(t=[].concat(t),e=[].concat(e),!e.length)return t;if(!t.length)return r?Om.flatten(e).map(a=>`{${a}}`):e;for(let a of t)if(Array.isArray(a))for(let n of a)o.push(gg(n,e,r));else for(let n of e)r===!0&&typeof n=="string"&&(n=`{${n}}`),o.push(Array.isArray(n)?gg(a,n,r):a+n);return Om.flatten(o)},K5e=(t,e={})=>{let r=e.rangeLimit===void 0?1e3:e.rangeLimit,o=(a,n={})=>{a.queue=[];let u=n,A=n.queue;for(;u.type!=="brace"&&u.type!=="root"&&u.parent;)u=u.parent,A=u.queue;if(a.invalid||a.dollar){A.push(gg(A.pop(),OZ(a,e)));return}if(a.type==="brace"&&a.invalid!==!0&&a.nodes.length===2){A.push(gg(A.pop(),["{}"]));return}if(a.nodes&&a.ranges>0){let w=Om.reduce(a.nodes);if(Om.exceedsLimit(...w,e.step,r))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let D=Y5e(...w,e);D.length===0&&(D=OZ(a,e)),A.push(gg(A.pop(),D)),a.nodes=[];return}let p=Om.encloseBrace(a),h=a.queue,E=a;for(;E.type!=="brace"&&E.type!=="root"&&E.parent;)E=E.parent,h=E.queue;for(let w=0;w{"use strict";_Z.exports={MAX_LENGTH:1024*64,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:` `,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var YZ=_((PQt,WZ)=>{"use strict";var V5e=lS(),{MAX_LENGTH:qZ,CHAR_BACKSLASH:uN,CHAR_BACKTICK:z5e,CHAR_COMMA:J5e,CHAR_DOT:X5e,CHAR_LEFT_PARENTHESES:Z5e,CHAR_RIGHT_PARENTHESES:$5e,CHAR_LEFT_CURLY_BRACE:e7e,CHAR_RIGHT_CURLY_BRACE:t7e,CHAR_LEFT_SQUARE_BRACKET:jZ,CHAR_RIGHT_SQUARE_BRACKET:GZ,CHAR_DOUBLE_QUOTE:r7e,CHAR_SINGLE_QUOTE:n7e,CHAR_NO_BREAK_SPACE:i7e,CHAR_ZERO_WIDTH_NOBREAK_SPACE:s7e}=HZ(),o7e=(t,e={})=>{if(typeof t!="string")throw new TypeError("Expected a string");let r=e||{},o=typeof r.maxLength=="number"?Math.min(qZ,r.maxLength):qZ;if(t.length>o)throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${o})`);let a={type:"root",input:t,nodes:[]},n=[a],u=a,A=a,p=0,h=t.length,E=0,w=0,D,b={},C=()=>t[E++],T=N=>{if(N.type==="text"&&A.type==="dot"&&(A.type="text"),A&&A.type==="text"&&N.type==="text"){A.value+=N.value;return}return u.nodes.push(N),N.parent=u,N.prev=A,A=N,N};for(T({type:"bos"});E0){if(u.ranges>0){u.ranges=0;let N=u.nodes.shift();u.nodes=[N,{type:"text",value:V5e(u)}]}T({type:"comma",value:D}),u.commas++;continue}if(D===X5e&&w>0&&u.commas===0){let N=u.nodes;if(w===0||N.length===0){T({type:"text",value:D});continue}if(A.type==="dot"){if(u.range=[],A.value+=D,A.type="range",u.nodes.length!==3&&u.nodes.length!==5){u.invalid=!0,u.ranges=0,A.type="text";continue}u.ranges++,u.args=[];continue}if(A.type==="range"){N.pop();let U=N[N.length-1];U.value+=A.value+D,A=U,u.ranges--;continue}T({type:"dot",value:D});continue}T({type:"text",value:D})}do if(u=n.pop(),u.type!=="root"){u.nodes.forEach(z=>{z.nodes||(z.type==="open"&&(z.isOpen=!0),z.type==="close"&&(z.isClose=!0),z.nodes||(z.type="text"),z.invalid=!0)});let N=n[n.length-1],U=N.nodes.indexOf(u);N.nodes.splice(U,1,...u.nodes)}while(n.length>0);return T({type:"eos"}),a};WZ.exports=o7e});var zZ=_((SQt,VZ)=>{"use strict";var KZ=lS(),a7e=NZ(),l7e=UZ(),c7e=YZ(),al=(t,e={})=>{let r=[];if(Array.isArray(t))for(let o of t){let a=al.create(o,e);Array.isArray(a)?r.push(...a):r.push(a)}else r=[].concat(al.create(t,e));return e&&e.expand===!0&&e.nodupes===!0&&(r=[...new Set(r)]),r};al.parse=(t,e={})=>c7e(t,e);al.stringify=(t,e={})=>KZ(typeof t=="string"?al.parse(t,e):t,e);al.compile=(t,e={})=>(typeof t=="string"&&(t=al.parse(t,e)),a7e(t,e));al.expand=(t,e={})=>{typeof t=="string"&&(t=al.parse(t,e));let r=l7e(t,e);return e.noempty===!0&&(r=r.filter(Boolean)),e.nodupes===!0&&(r=[...new Set(r)]),r};al.create=(t,e={})=>t===""||t.length<3?[t]:e.expand!==!0?al.compile(t,e):al.expand(t,e);VZ.exports=al});var Yw=_((xQt,e$)=>{"use strict";var u7e=ve("path"),Ju="\\\\/",JZ=`[^${Ju}]`,Bf="\\.",A7e="\\+",f7e="\\?",uS="\\/",p7e="(?=.)",XZ="[^/]",AN=`(?:${uS}|$)`,ZZ=`(?:^|${uS})`,fN=`${Bf}{1,2}${AN}`,h7e=`(?!${Bf})`,g7e=`(?!${ZZ}${fN})`,d7e=`(?!${Bf}{0,1}${AN})`,m7e=`(?!${fN})`,y7e=`[^.${uS}]`,E7e=`${XZ}*?`,$Z={DOT_LITERAL:Bf,PLUS_LITERAL:A7e,QMARK_LITERAL:f7e,SLASH_LITERAL:uS,ONE_CHAR:p7e,QMARK:XZ,END_ANCHOR:AN,DOTS_SLASH:fN,NO_DOT:h7e,NO_DOTS:g7e,NO_DOT_SLASH:d7e,NO_DOTS_SLASH:m7e,QMARK_NO_DOT:y7e,STAR:E7e,START_ANCHOR:ZZ},C7e={...$Z,SLASH_LITERAL:`[${Ju}]`,QMARK:JZ,STAR:`${JZ}*?`,DOTS_SLASH:`${Bf}{1,2}(?:[${Ju}]|$)`,NO_DOT:`(?!${Bf})`,NO_DOTS:`(?!(?:^|[${Ju}])${Bf}{1,2}(?:[${Ju}]|$))`,NO_DOT_SLASH:`(?!${Bf}{0,1}(?:[${Ju}]|$))`,NO_DOTS_SLASH:`(?!${Bf}{1,2}(?:[${Ju}]|$))`,QMARK_NO_DOT:`[^.${Ju}]`,START_ANCHOR:`(?:^|[${Ju}])`,END_ANCHOR:`(?:[${Ju}]|$)`},I7e={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};e$.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:I7e,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:u7e.sep,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?C7e:$Z}}});var Kw=_(ba=>{"use strict";var w7e=ve("path"),B7e=process.platform==="win32",{REGEX_BACKSLASH:v7e,REGEX_REMOVE_BACKSLASH:D7e,REGEX_SPECIAL_CHARS:P7e,REGEX_SPECIAL_CHARS_GLOBAL:S7e}=Yw();ba.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);ba.hasRegexChars=t=>P7e.test(t);ba.isRegexChar=t=>t.length===1&&ba.hasRegexChars(t);ba.escapeRegex=t=>t.replace(S7e,"\\$1");ba.toPosixSlashes=t=>t.replace(v7e,"/");ba.removeBackslashes=t=>t.replace(D7e,e=>e==="\\"?"":e);ba.supportsLookbehinds=()=>{let t=process.version.slice(1).split(".").map(Number);return t.length===3&&t[0]>=9||t[0]===8&&t[1]>=10};ba.isWindows=t=>t&&typeof t.windows=="boolean"?t.windows:B7e===!0||w7e.sep==="\\";ba.escapeLast=(t,e,r)=>{let o=t.lastIndexOf(e,r);return o===-1?t:t[o-1]==="\\"?ba.escapeLast(t,e,o-1):`${t.slice(0,o)}\\${t.slice(o)}`};ba.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};ba.wrapOutput=(t,e={},r={})=>{let o=r.contains?"":"^",a=r.contains?"":"$",n=`${o}(?:${t})${a}`;return e.negated===!0&&(n=`(?:^(?!${n}).*$)`),n}});var l$=_((kQt,a$)=>{"use strict";var t$=Kw(),{CHAR_ASTERISK:pN,CHAR_AT:x7e,CHAR_BACKWARD_SLASH:Vw,CHAR_COMMA:b7e,CHAR_DOT:hN,CHAR_EXCLAMATION_MARK:gN,CHAR_FORWARD_SLASH:o$,CHAR_LEFT_CURLY_BRACE:dN,CHAR_LEFT_PARENTHESES:mN,CHAR_LEFT_SQUARE_BRACKET:k7e,CHAR_PLUS:Q7e,CHAR_QUESTION_MARK:r$,CHAR_RIGHT_CURLY_BRACE:F7e,CHAR_RIGHT_PARENTHESES:n$,CHAR_RIGHT_SQUARE_BRACKET:R7e}=Yw(),i$=t=>t===o$||t===Vw,s$=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},T7e=(t,e)=>{let r=e||{},o=t.length-1,a=r.parts===!0||r.scanToEnd===!0,n=[],u=[],A=[],p=t,h=-1,E=0,w=0,D=!1,b=!1,C=!1,T=!1,N=!1,U=!1,z=!1,te=!1,le=!1,ce=!1,ue=0,Ie,he,De={value:"",depth:0,isGlob:!1},Ee=()=>h>=o,g=()=>p.charCodeAt(h+1),me=()=>(Ie=he,p.charCodeAt(++h));for(;h0&&(fe=p.slice(0,E),p=p.slice(E),w-=E),Ce&&C===!0&&w>0?(Ce=p.slice(0,w),ie=p.slice(w)):C===!0?(Ce="",ie=p):Ce=p,Ce&&Ce!==""&&Ce!=="/"&&Ce!==p&&i$(Ce.charCodeAt(Ce.length-1))&&(Ce=Ce.slice(0,-1)),r.unescape===!0&&(ie&&(ie=t$.removeBackslashes(ie)),Ce&&z===!0&&(Ce=t$.removeBackslashes(Ce)));let Z={prefix:fe,input:t,start:E,base:Ce,glob:ie,isBrace:D,isBracket:b,isGlob:C,isExtglob:T,isGlobstar:N,negated:te,negatedExtglob:le};if(r.tokens===!0&&(Z.maxDepth=0,i$(he)||u.push(De),Z.tokens=u),r.parts===!0||r.tokens===!0){let Pe;for(let Re=0;Re{"use strict";var AS=Yw(),ll=Kw(),{MAX_LENGTH:fS,POSIX_REGEX_SOURCE:L7e,REGEX_NON_SPECIAL_CHARS:N7e,REGEX_SPECIAL_CHARS_BACKREF:O7e,REPLACEMENTS:c$}=AS,M7e=(t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let r=`[${t.join("-")}]`;try{new RegExp(r)}catch{return t.map(a=>ll.escapeRegex(a)).join("..")}return r},Mm=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,yN=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=c$[t]||t;let r={...e},o=typeof r.maxLength=="number"?Math.min(fS,r.maxLength):fS,a=t.length;if(a>o)throw new SyntaxError(`Input length: ${a}, exceeds maximum allowed length: ${o}`);let n={type:"bos",value:"",output:r.prepend||""},u=[n],A=r.capture?"":"?:",p=ll.isWindows(e),h=AS.globChars(p),E=AS.extglobChars(h),{DOT_LITERAL:w,PLUS_LITERAL:D,SLASH_LITERAL:b,ONE_CHAR:C,DOTS_SLASH:T,NO_DOT:N,NO_DOT_SLASH:U,NO_DOTS_SLASH:z,QMARK:te,QMARK_NO_DOT:le,STAR:ce,START_ANCHOR:ue}=h,Ie=x=>`(${A}(?:(?!${ue}${x.dot?T:w}).)*?)`,he=r.dot?"":N,De=r.dot?te:le,Ee=r.bash===!0?Ie(r):ce;r.capture&&(Ee=`(${Ee})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let g={input:t,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:u};t=ll.removePrefix(t,g),a=t.length;let me=[],Ce=[],fe=[],ie=n,Z,Pe=()=>g.index===a-1,Re=g.peek=(x=1)=>t[g.index+x],ht=g.advance=()=>t[++g.index]||"",q=()=>t.slice(g.index+1),nt=(x="",I=0)=>{g.consumed+=x,g.index+=I},Le=x=>{g.output+=x.output!=null?x.output:x.value,nt(x.value)},Te=()=>{let x=1;for(;Re()==="!"&&(Re(2)!=="("||Re(3)==="?");)ht(),g.start++,x++;return x%2===0?!1:(g.negated=!0,g.start++,!0)},ke=x=>{g[x]++,fe.push(x)},Ve=x=>{g[x]--,fe.pop()},xe=x=>{if(ie.type==="globstar"){let I=g.braces>0&&(x.type==="comma"||x.type==="brace"),S=x.extglob===!0||me.length&&(x.type==="pipe"||x.type==="paren");x.type!=="slash"&&x.type!=="paren"&&!I&&!S&&(g.output=g.output.slice(0,-ie.output.length),ie.type="star",ie.value="*",ie.output=Ee,g.output+=ie.output)}if(me.length&&x.type!=="paren"&&(me[me.length-1].inner+=x.value),(x.value||x.output)&&Le(x),ie&&ie.type==="text"&&x.type==="text"){ie.value+=x.value,ie.output=(ie.output||"")+x.value;return}x.prev=ie,u.push(x),ie=x},tt=(x,I)=>{let S={...E[I],conditions:1,inner:""};S.prev=ie,S.parens=g.parens,S.output=g.output;let y=(r.capture?"(":"")+S.open;ke("parens"),xe({type:x,value:I,output:g.output?"":C}),xe({type:"paren",extglob:!0,value:ht(),output:y}),me.push(S)},He=x=>{let I=x.close+(r.capture?")":""),S;if(x.type==="negate"){let y=Ee;if(x.inner&&x.inner.length>1&&x.inner.includes("/")&&(y=Ie(r)),(y!==Ee||Pe()||/^\)+$/.test(q()))&&(I=x.close=`)$))${y}`),x.inner.includes("*")&&(S=q())&&/^\.[^\\/.]+$/.test(S)){let R=yN(S,{...e,fastpaths:!1}).output;I=x.close=`)${R})${y})`}x.prev.type==="bos"&&(g.negatedExtglob=!0)}xe({type:"paren",extglob:!0,value:Z,output:I}),Ve("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let x=!1,I=t.replace(O7e,(S,y,R,J,X,$)=>J==="\\"?(x=!0,S):J==="?"?y?y+J+(X?te.repeat(X.length):""):$===0?De+(X?te.repeat(X.length):""):te.repeat(R.length):J==="."?w.repeat(R.length):J==="*"?y?y+J+(X?Ee:""):Ee:y?S:`\\${S}`);return x===!0&&(r.unescape===!0?I=I.replace(/\\/g,""):I=I.replace(/\\+/g,S=>S.length%2===0?"\\\\":S?"\\":"")),I===t&&r.contains===!0?(g.output=t,g):(g.output=ll.wrapOutput(I,g,e),g)}for(;!Pe();){if(Z=ht(),Z==="\0")continue;if(Z==="\\"){let S=Re();if(S==="/"&&r.bash!==!0||S==="."||S===";")continue;if(!S){Z+="\\",xe({type:"text",value:Z});continue}let y=/^\\+/.exec(q()),R=0;if(y&&y[0].length>2&&(R=y[0].length,g.index+=R,R%2!==0&&(Z+="\\")),r.unescape===!0?Z=ht():Z+=ht(),g.brackets===0){xe({type:"text",value:Z});continue}}if(g.brackets>0&&(Z!=="]"||ie.value==="["||ie.value==="[^")){if(r.posix!==!1&&Z===":"){let S=ie.value.slice(1);if(S.includes("[")&&(ie.posix=!0,S.includes(":"))){let y=ie.value.lastIndexOf("["),R=ie.value.slice(0,y),J=ie.value.slice(y+2),X=L7e[J];if(X){ie.value=R+X,g.backtrack=!0,ht(),!n.output&&u.indexOf(ie)===1&&(n.output=C);continue}}}(Z==="["&&Re()!==":"||Z==="-"&&Re()==="]")&&(Z=`\\${Z}`),Z==="]"&&(ie.value==="["||ie.value==="[^")&&(Z=`\\${Z}`),r.posix===!0&&Z==="!"&&ie.value==="["&&(Z="^"),ie.value+=Z,Le({value:Z});continue}if(g.quotes===1&&Z!=='"'){Z=ll.escapeRegex(Z),ie.value+=Z,Le({value:Z});continue}if(Z==='"'){g.quotes=g.quotes===1?0:1,r.keepQuotes===!0&&xe({type:"text",value:Z});continue}if(Z==="("){ke("parens"),xe({type:"paren",value:Z});continue}if(Z===")"){if(g.parens===0&&r.strictBrackets===!0)throw new SyntaxError(Mm("opening","("));let S=me[me.length-1];if(S&&g.parens===S.parens+1){He(me.pop());continue}xe({type:"paren",value:Z,output:g.parens?")":"\\)"}),Ve("parens");continue}if(Z==="["){if(r.nobracket===!0||!q().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(Mm("closing","]"));Z=`\\${Z}`}else ke("brackets");xe({type:"bracket",value:Z});continue}if(Z==="]"){if(r.nobracket===!0||ie&&ie.type==="bracket"&&ie.value.length===1){xe({type:"text",value:Z,output:`\\${Z}`});continue}if(g.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(Mm("opening","["));xe({type:"text",value:Z,output:`\\${Z}`});continue}Ve("brackets");let S=ie.value.slice(1);if(ie.posix!==!0&&S[0]==="^"&&!S.includes("/")&&(Z=`/${Z}`),ie.value+=Z,Le({value:Z}),r.literalBrackets===!1||ll.hasRegexChars(S))continue;let y=ll.escapeRegex(ie.value);if(g.output=g.output.slice(0,-ie.value.length),r.literalBrackets===!0){g.output+=y,ie.value=y;continue}ie.value=`(${A}${y}|${ie.value})`,g.output+=ie.value;continue}if(Z==="{"&&r.nobrace!==!0){ke("braces");let S={type:"brace",value:Z,output:"(",outputIndex:g.output.length,tokensIndex:g.tokens.length};Ce.push(S),xe(S);continue}if(Z==="}"){let S=Ce[Ce.length-1];if(r.nobrace===!0||!S){xe({type:"text",value:Z,output:Z});continue}let y=")";if(S.dots===!0){let R=u.slice(),J=[];for(let X=R.length-1;X>=0&&(u.pop(),R[X].type!=="brace");X--)R[X].type!=="dots"&&J.unshift(R[X].value);y=M7e(J,r),g.backtrack=!0}if(S.comma!==!0&&S.dots!==!0){let R=g.output.slice(0,S.outputIndex),J=g.tokens.slice(S.tokensIndex);S.value=S.output="\\{",Z=y="\\}",g.output=R;for(let X of J)g.output+=X.output||X.value}xe({type:"brace",value:Z,output:y}),Ve("braces"),Ce.pop();continue}if(Z==="|"){me.length>0&&me[me.length-1].conditions++,xe({type:"text",value:Z});continue}if(Z===","){let S=Z,y=Ce[Ce.length-1];y&&fe[fe.length-1]==="braces"&&(y.comma=!0,S="|"),xe({type:"comma",value:Z,output:S});continue}if(Z==="/"){if(ie.type==="dot"&&g.index===g.start+1){g.start=g.index+1,g.consumed="",g.output="",u.pop(),ie=n;continue}xe({type:"slash",value:Z,output:b});continue}if(Z==="."){if(g.braces>0&&ie.type==="dot"){ie.value==="."&&(ie.output=w);let S=Ce[Ce.length-1];ie.type="dots",ie.output+=Z,ie.value+=Z,S.dots=!0;continue}if(g.braces+g.parens===0&&ie.type!=="bos"&&ie.type!=="slash"){xe({type:"text",value:Z,output:w});continue}xe({type:"dot",value:Z,output:w});continue}if(Z==="?"){if(!(ie&&ie.value==="(")&&r.noextglob!==!0&&Re()==="("&&Re(2)!=="?"){tt("qmark",Z);continue}if(ie&&ie.type==="paren"){let y=Re(),R=Z;if(y==="<"&&!ll.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(ie.value==="("&&!/[!=<:]/.test(y)||y==="<"&&!/<([!=]|\w+>)/.test(q()))&&(R=`\\${Z}`),xe({type:"text",value:Z,output:R});continue}if(r.dot!==!0&&(ie.type==="slash"||ie.type==="bos")){xe({type:"qmark",value:Z,output:le});continue}xe({type:"qmark",value:Z,output:te});continue}if(Z==="!"){if(r.noextglob!==!0&&Re()==="("&&(Re(2)!=="?"||!/[!=<:]/.test(Re(3)))){tt("negate",Z);continue}if(r.nonegate!==!0&&g.index===0){Te();continue}}if(Z==="+"){if(r.noextglob!==!0&&Re()==="("&&Re(2)!=="?"){tt("plus",Z);continue}if(ie&&ie.value==="("||r.regex===!1){xe({type:"plus",value:Z,output:D});continue}if(ie&&(ie.type==="bracket"||ie.type==="paren"||ie.type==="brace")||g.parens>0){xe({type:"plus",value:Z});continue}xe({type:"plus",value:D});continue}if(Z==="@"){if(r.noextglob!==!0&&Re()==="("&&Re(2)!=="?"){xe({type:"at",extglob:!0,value:Z,output:""});continue}xe({type:"text",value:Z});continue}if(Z!=="*"){(Z==="$"||Z==="^")&&(Z=`\\${Z}`);let S=N7e.exec(q());S&&(Z+=S[0],g.index+=S[0].length),xe({type:"text",value:Z});continue}if(ie&&(ie.type==="globstar"||ie.star===!0)){ie.type="star",ie.star=!0,ie.value+=Z,ie.output=Ee,g.backtrack=!0,g.globstar=!0,nt(Z);continue}let x=q();if(r.noextglob!==!0&&/^\([^?]/.test(x)){tt("star",Z);continue}if(ie.type==="star"){if(r.noglobstar===!0){nt(Z);continue}let S=ie.prev,y=S.prev,R=S.type==="slash"||S.type==="bos",J=y&&(y.type==="star"||y.type==="globstar");if(r.bash===!0&&(!R||x[0]&&x[0]!=="/")){xe({type:"star",value:Z,output:""});continue}let X=g.braces>0&&(S.type==="comma"||S.type==="brace"),$=me.length&&(S.type==="pipe"||S.type==="paren");if(!R&&S.type!=="paren"&&!X&&!$){xe({type:"star",value:Z,output:""});continue}for(;x.slice(0,3)==="/**";){let se=t[g.index+4];if(se&&se!=="/")break;x=x.slice(3),nt("/**",3)}if(S.type==="bos"&&Pe()){ie.type="globstar",ie.value+=Z,ie.output=Ie(r),g.output=ie.output,g.globstar=!0,nt(Z);continue}if(S.type==="slash"&&S.prev.type!=="bos"&&!J&&Pe()){g.output=g.output.slice(0,-(S.output+ie.output).length),S.output=`(?:${S.output}`,ie.type="globstar",ie.output=Ie(r)+(r.strictSlashes?")":"|$)"),ie.value+=Z,g.globstar=!0,g.output+=S.output+ie.output,nt(Z);continue}if(S.type==="slash"&&S.prev.type!=="bos"&&x[0]==="/"){let se=x[1]!==void 0?"|$":"";g.output=g.output.slice(0,-(S.output+ie.output).length),S.output=`(?:${S.output}`,ie.type="globstar",ie.output=`${Ie(r)}${b}|${b}${se})`,ie.value+=Z,g.output+=S.output+ie.output,g.globstar=!0,nt(Z+ht()),xe({type:"slash",value:"/",output:""});continue}if(S.type==="bos"&&x[0]==="/"){ie.type="globstar",ie.value+=Z,ie.output=`(?:^|${b}|${Ie(r)}${b})`,g.output=ie.output,g.globstar=!0,nt(Z+ht()),xe({type:"slash",value:"/",output:""});continue}g.output=g.output.slice(0,-ie.output.length),ie.type="globstar",ie.output=Ie(r),ie.value+=Z,g.output+=ie.output,g.globstar=!0,nt(Z);continue}let I={type:"star",value:Z,output:Ee};if(r.bash===!0){I.output=".*?",(ie.type==="bos"||ie.type==="slash")&&(I.output=he+I.output),xe(I);continue}if(ie&&(ie.type==="bracket"||ie.type==="paren")&&r.regex===!0){I.output=Z,xe(I);continue}(g.index===g.start||ie.type==="slash"||ie.type==="dot")&&(ie.type==="dot"?(g.output+=U,ie.output+=U):r.dot===!0?(g.output+=z,ie.output+=z):(g.output+=he,ie.output+=he),Re()!=="*"&&(g.output+=C,ie.output+=C)),xe(I)}for(;g.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(Mm("closing","]"));g.output=ll.escapeLast(g.output,"["),Ve("brackets")}for(;g.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(Mm("closing",")"));g.output=ll.escapeLast(g.output,"("),Ve("parens")}for(;g.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(Mm("closing","}"));g.output=ll.escapeLast(g.output,"{"),Ve("braces")}if(r.strictSlashes!==!0&&(ie.type==="star"||ie.type==="bracket")&&xe({type:"maybe_slash",value:"",output:`${b}?`}),g.backtrack===!0){g.output="";for(let x of g.tokens)g.output+=x.output!=null?x.output:x.value,x.suffix&&(g.output+=x.suffix)}return g};yN.fastpaths=(t,e)=>{let r={...e},o=typeof r.maxLength=="number"?Math.min(fS,r.maxLength):fS,a=t.length;if(a>o)throw new SyntaxError(`Input length: ${a}, exceeds maximum allowed length: ${o}`);t=c$[t]||t;let n=ll.isWindows(e),{DOT_LITERAL:u,SLASH_LITERAL:A,ONE_CHAR:p,DOTS_SLASH:h,NO_DOT:E,NO_DOTS:w,NO_DOTS_SLASH:D,STAR:b,START_ANCHOR:C}=AS.globChars(n),T=r.dot?w:E,N=r.dot?D:E,U=r.capture?"":"?:",z={negated:!1,prefix:""},te=r.bash===!0?".*?":b;r.capture&&(te=`(${te})`);let le=he=>he.noglobstar===!0?te:`(${U}(?:(?!${C}${he.dot?h:u}).)*?)`,ce=he=>{switch(he){case"*":return`${T}${p}${te}`;case".*":return`${u}${p}${te}`;case"*.*":return`${T}${te}${u}${p}${te}`;case"*/*":return`${T}${te}${A}${p}${N}${te}`;case"**":return T+le(r);case"**/*":return`(?:${T}${le(r)}${A})?${N}${p}${te}`;case"**/*.*":return`(?:${T}${le(r)}${A})?${N}${te}${u}${p}${te}`;case"**/.*":return`(?:${T}${le(r)}${A})?${u}${p}${te}`;default:{let De=/^(.*?)\.(\w+)$/.exec(he);if(!De)return;let Ee=ce(De[1]);return Ee?Ee+u+De[2]:void 0}}},ue=ll.removePrefix(t,z),Ie=ce(ue);return Ie&&r.strictSlashes!==!0&&(Ie+=`${A}?`),Ie};u$.exports=yN});var p$=_((FQt,f$)=>{"use strict";var U7e=ve("path"),_7e=l$(),EN=A$(),CN=Kw(),H7e=Yw(),q7e=t=>t&&typeof t=="object"&&!Array.isArray(t),Mi=(t,e,r=!1)=>{if(Array.isArray(t)){let E=t.map(D=>Mi(D,e,r));return D=>{for(let b of E){let C=b(D);if(C)return C}return!1}}let o=q7e(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!o)throw new TypeError("Expected pattern to be a non-empty string");let a=e||{},n=CN.isWindows(e),u=o?Mi.compileRe(t,e):Mi.makeRe(t,e,!1,!0),A=u.state;delete u.state;let p=()=>!1;if(a.ignore){let E={...e,ignore:null,onMatch:null,onResult:null};p=Mi(a.ignore,E,r)}let h=(E,w=!1)=>{let{isMatch:D,match:b,output:C}=Mi.test(E,u,e,{glob:t,posix:n}),T={glob:t,state:A,regex:u,posix:n,input:E,output:C,match:b,isMatch:D};return typeof a.onResult=="function"&&a.onResult(T),D===!1?(T.isMatch=!1,w?T:!1):p(E)?(typeof a.onIgnore=="function"&&a.onIgnore(T),T.isMatch=!1,w?T:!1):(typeof a.onMatch=="function"&&a.onMatch(T),w?T:!0)};return r&&(h.state=A),h};Mi.test=(t,e,r,{glob:o,posix:a}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};let n=r||{},u=n.format||(a?CN.toPosixSlashes:null),A=t===o,p=A&&u?u(t):t;return A===!1&&(p=u?u(t):t,A=p===o),(A===!1||n.capture===!0)&&(n.matchBase===!0||n.basename===!0?A=Mi.matchBase(t,e,r,a):A=e.exec(p)),{isMatch:!!A,match:A,output:p}};Mi.matchBase=(t,e,r,o=CN.isWindows(r))=>(e instanceof RegExp?e:Mi.makeRe(e,r)).test(U7e.basename(t));Mi.isMatch=(t,e,r)=>Mi(e,r)(t);Mi.parse=(t,e)=>Array.isArray(t)?t.map(r=>Mi.parse(r,e)):EN(t,{...e,fastpaths:!1});Mi.scan=(t,e)=>_7e(t,e);Mi.compileRe=(t,e,r=!1,o=!1)=>{if(r===!0)return t.output;let a=e||{},n=a.contains?"":"^",u=a.contains?"":"$",A=`${n}(?:${t.output})${u}`;t&&t.negated===!0&&(A=`^(?!${A}).*$`);let p=Mi.toRegex(A,e);return o===!0&&(p.state=t),p};Mi.makeRe=(t,e={},r=!1,o=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let a={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(a.output=EN.fastpaths(t,e)),a.output||(a=EN(t,e)),Mi.compileRe(a,e,r,o)};Mi.toRegex=(t,e)=>{try{let r=e||{};return new RegExp(t,r.flags||(r.nocase?"i":""))}catch(r){if(e&&e.debug===!0)throw r;return/$^/}};Mi.constants=H7e;f$.exports=Mi});var g$=_((RQt,h$)=>{"use strict";h$.exports=p$()});var Xo=_((TQt,E$)=>{"use strict";var m$=ve("util"),y$=zZ(),Xu=g$(),IN=Kw(),d$=t=>t===""||t==="./",Ii=(t,e,r)=>{e=[].concat(e),t=[].concat(t);let o=new Set,a=new Set,n=new Set,u=0,A=E=>{n.add(E.output),r&&r.onResult&&r.onResult(E)};for(let E=0;E!o.has(E));if(r&&h.length===0){if(r.failglob===!0)throw new Error(`No matches found for "${e.join(", ")}"`);if(r.nonull===!0||r.nullglob===!0)return r.unescape?e.map(E=>E.replace(/\\/g,"")):e}return h};Ii.match=Ii;Ii.matcher=(t,e)=>Xu(t,e);Ii.isMatch=(t,e,r)=>Xu(e,r)(t);Ii.any=Ii.isMatch;Ii.not=(t,e,r={})=>{e=[].concat(e).map(String);let o=new Set,a=[],n=A=>{r.onResult&&r.onResult(A),a.push(A.output)},u=new Set(Ii(t,e,{...r,onResult:n}));for(let A of a)u.has(A)||o.add(A);return[...o]};Ii.contains=(t,e,r)=>{if(typeof t!="string")throw new TypeError(`Expected a string: "${m$.inspect(t)}"`);if(Array.isArray(e))return e.some(o=>Ii.contains(t,o,r));if(typeof e=="string"){if(d$(t)||d$(e))return!1;if(t.includes(e)||t.startsWith("./")&&t.slice(2).includes(e))return!0}return Ii.isMatch(t,e,{...r,contains:!0})};Ii.matchKeys=(t,e,r)=>{if(!IN.isObject(t))throw new TypeError("Expected the first argument to be an object");let o=Ii(Object.keys(t),e,r),a={};for(let n of o)a[n]=t[n];return a};Ii.some=(t,e,r)=>{let o=[].concat(t);for(let a of[].concat(e)){let n=Xu(String(a),r);if(o.some(u=>n(u)))return!0}return!1};Ii.every=(t,e,r)=>{let o=[].concat(t);for(let a of[].concat(e)){let n=Xu(String(a),r);if(!o.every(u=>n(u)))return!1}return!0};Ii.all=(t,e,r)=>{if(typeof t!="string")throw new TypeError(`Expected a string: "${m$.inspect(t)}"`);return[].concat(e).every(o=>Xu(o,r)(t))};Ii.capture=(t,e,r)=>{let o=IN.isWindows(r),n=Xu.makeRe(String(t),{...r,capture:!0}).exec(o?IN.toPosixSlashes(e):e);if(n)return n.slice(1).map(u=>u===void 0?"":u)};Ii.makeRe=(...t)=>Xu.makeRe(...t);Ii.scan=(...t)=>Xu.scan(...t);Ii.parse=(t,e)=>{let r=[];for(let o of[].concat(t||[]))for(let a of y$(String(o),e))r.push(Xu.parse(a,e));return r};Ii.braces=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");return e&&e.nobrace===!0||!/\{.*\}/.test(t)?[t]:y$(t,e)};Ii.braceExpand=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");return Ii.braces(t,{...e,expand:!0})};E$.exports=Ii});var I$=_((LQt,C$)=>{"use strict";C$.exports=({onlyFirst:t=!1}={})=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}});var pS=_((NQt,w$)=>{"use strict";var j7e=I$();w$.exports=t=>typeof t=="string"?t.replace(j7e(),""):t});var v$=_((OQt,B$)=>{function G7e(){this.__data__=[],this.size=0}B$.exports=G7e});var Um=_((MQt,D$)=>{function W7e(t,e){return t===e||t!==t&&e!==e}D$.exports=W7e});var zw=_((UQt,P$)=>{var Y7e=Um();function K7e(t,e){for(var r=t.length;r--;)if(Y7e(t[r][0],e))return r;return-1}P$.exports=K7e});var x$=_((_Qt,S$)=>{var V7e=zw(),z7e=Array.prototype,J7e=z7e.splice;function X7e(t){var e=this.__data__,r=V7e(e,t);if(r<0)return!1;var o=e.length-1;return r==o?e.pop():J7e.call(e,r,1),--this.size,!0}S$.exports=X7e});var k$=_((HQt,b$)=>{var Z7e=zw();function $7e(t){var e=this.__data__,r=Z7e(e,t);return r<0?void 0:e[r][1]}b$.exports=$7e});var F$=_((qQt,Q$)=>{var eWe=zw();function tWe(t){return eWe(this.__data__,t)>-1}Q$.exports=tWe});var T$=_((jQt,R$)=>{var rWe=zw();function nWe(t,e){var r=this.__data__,o=rWe(r,t);return o<0?(++this.size,r.push([t,e])):r[o][1]=e,this}R$.exports=nWe});var Jw=_((GQt,L$)=>{var iWe=v$(),sWe=x$(),oWe=k$(),aWe=F$(),lWe=T$();function _m(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e{var cWe=Jw();function uWe(){this.__data__=new cWe,this.size=0}N$.exports=uWe});var U$=_((YQt,M$)=>{function AWe(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}M$.exports=AWe});var H$=_((KQt,_$)=>{function fWe(t){return this.__data__.get(t)}_$.exports=fWe});var j$=_((VQt,q$)=>{function pWe(t){return this.__data__.has(t)}q$.exports=pWe});var wN=_((zQt,G$)=>{var hWe=typeof global=="object"&&global&&global.Object===Object&&global;G$.exports=hWe});var ql=_((JQt,W$)=>{var gWe=wN(),dWe=typeof self=="object"&&self&&self.Object===Object&&self,mWe=gWe||dWe||Function("return this")();W$.exports=mWe});var dg=_((XQt,Y$)=>{var yWe=ql(),EWe=yWe.Symbol;Y$.exports=EWe});var J$=_((ZQt,z$)=>{var K$=dg(),V$=Object.prototype,CWe=V$.hasOwnProperty,IWe=V$.toString,Xw=K$?K$.toStringTag:void 0;function wWe(t){var e=CWe.call(t,Xw),r=t[Xw];try{t[Xw]=void 0;var o=!0}catch{}var a=IWe.call(t);return o&&(e?t[Xw]=r:delete t[Xw]),a}z$.exports=wWe});var Z$=_(($Qt,X$)=>{var BWe=Object.prototype,vWe=BWe.toString;function DWe(t){return vWe.call(t)}X$.exports=DWe});var mg=_((eFt,tee)=>{var $$=dg(),PWe=J$(),SWe=Z$(),xWe="[object Null]",bWe="[object Undefined]",eee=$$?$$.toStringTag:void 0;function kWe(t){return t==null?t===void 0?bWe:xWe:eee&&eee in Object(t)?PWe(t):SWe(t)}tee.exports=kWe});var cl=_((tFt,ree)=>{function QWe(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}ree.exports=QWe});var hS=_((rFt,nee)=>{var FWe=mg(),RWe=cl(),TWe="[object AsyncFunction]",LWe="[object Function]",NWe="[object GeneratorFunction]",OWe="[object Proxy]";function MWe(t){if(!RWe(t))return!1;var e=FWe(t);return e==LWe||e==NWe||e==TWe||e==OWe}nee.exports=MWe});var see=_((nFt,iee)=>{var UWe=ql(),_We=UWe["__core-js_shared__"];iee.exports=_We});var lee=_((iFt,aee)=>{var BN=see(),oee=function(){var t=/[^.]+$/.exec(BN&&BN.keys&&BN.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function HWe(t){return!!oee&&oee in t}aee.exports=HWe});var vN=_((sFt,cee)=>{var qWe=Function.prototype,jWe=qWe.toString;function GWe(t){if(t!=null){try{return jWe.call(t)}catch{}try{return t+""}catch{}}return""}cee.exports=GWe});var Aee=_((oFt,uee)=>{var WWe=hS(),YWe=lee(),KWe=cl(),VWe=vN(),zWe=/[\\^$.*+?()[\]{}|]/g,JWe=/^\[object .+?Constructor\]$/,XWe=Function.prototype,ZWe=Object.prototype,$We=XWe.toString,eYe=ZWe.hasOwnProperty,tYe=RegExp("^"+$We.call(eYe).replace(zWe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function rYe(t){if(!KWe(t)||YWe(t))return!1;var e=WWe(t)?tYe:JWe;return e.test(VWe(t))}uee.exports=rYe});var pee=_((aFt,fee)=>{function nYe(t,e){return t?.[e]}fee.exports=nYe});var $p=_((lFt,hee)=>{var iYe=Aee(),sYe=pee();function oYe(t,e){var r=sYe(t,e);return iYe(r)?r:void 0}hee.exports=oYe});var gS=_((cFt,gee)=>{var aYe=$p(),lYe=ql(),cYe=aYe(lYe,"Map");gee.exports=cYe});var Zw=_((uFt,dee)=>{var uYe=$p(),AYe=uYe(Object,"create");dee.exports=AYe});var Eee=_((AFt,yee)=>{var mee=Zw();function fYe(){this.__data__=mee?mee(null):{},this.size=0}yee.exports=fYe});var Iee=_((fFt,Cee)=>{function pYe(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}Cee.exports=pYe});var Bee=_((pFt,wee)=>{var hYe=Zw(),gYe="__lodash_hash_undefined__",dYe=Object.prototype,mYe=dYe.hasOwnProperty;function yYe(t){var e=this.__data__;if(hYe){var r=e[t];return r===gYe?void 0:r}return mYe.call(e,t)?e[t]:void 0}wee.exports=yYe});var Dee=_((hFt,vee)=>{var EYe=Zw(),CYe=Object.prototype,IYe=CYe.hasOwnProperty;function wYe(t){var e=this.__data__;return EYe?e[t]!==void 0:IYe.call(e,t)}vee.exports=wYe});var See=_((gFt,Pee)=>{var BYe=Zw(),vYe="__lodash_hash_undefined__";function DYe(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=BYe&&e===void 0?vYe:e,this}Pee.exports=DYe});var bee=_((dFt,xee)=>{var PYe=Eee(),SYe=Iee(),xYe=Bee(),bYe=Dee(),kYe=See();function Hm(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e{var kee=bee(),QYe=Jw(),FYe=gS();function RYe(){this.size=0,this.__data__={hash:new kee,map:new(FYe||QYe),string:new kee}}Qee.exports=RYe});var Tee=_((yFt,Ree)=>{function TYe(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}Ree.exports=TYe});var $w=_((EFt,Lee)=>{var LYe=Tee();function NYe(t,e){var r=t.__data__;return LYe(e)?r[typeof e=="string"?"string":"hash"]:r.map}Lee.exports=NYe});var Oee=_((CFt,Nee)=>{var OYe=$w();function MYe(t){var e=OYe(this,t).delete(t);return this.size-=e?1:0,e}Nee.exports=MYe});var Uee=_((IFt,Mee)=>{var UYe=$w();function _Ye(t){return UYe(this,t).get(t)}Mee.exports=_Ye});var Hee=_((wFt,_ee)=>{var HYe=$w();function qYe(t){return HYe(this,t).has(t)}_ee.exports=qYe});var jee=_((BFt,qee)=>{var jYe=$w();function GYe(t,e){var r=jYe(this,t),o=r.size;return r.set(t,e),this.size+=r.size==o?0:1,this}qee.exports=GYe});var dS=_((vFt,Gee)=>{var WYe=Fee(),YYe=Oee(),KYe=Uee(),VYe=Hee(),zYe=jee();function qm(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e{var JYe=Jw(),XYe=gS(),ZYe=dS(),$Ye=200;function eKe(t,e){var r=this.__data__;if(r instanceof JYe){var o=r.__data__;if(!XYe||o.length<$Ye-1)return o.push([t,e]),this.size=++r.size,this;r=this.__data__=new ZYe(o)}return r.set(t,e),this.size=r.size,this}Wee.exports=eKe});var mS=_((PFt,Kee)=>{var tKe=Jw(),rKe=O$(),nKe=U$(),iKe=H$(),sKe=j$(),oKe=Yee();function jm(t){var e=this.__data__=new tKe(t);this.size=e.size}jm.prototype.clear=rKe;jm.prototype.delete=nKe;jm.prototype.get=iKe;jm.prototype.has=sKe;jm.prototype.set=oKe;Kee.exports=jm});var zee=_((SFt,Vee)=>{var aKe="__lodash_hash_undefined__";function lKe(t){return this.__data__.set(t,aKe),this}Vee.exports=lKe});var Xee=_((xFt,Jee)=>{function cKe(t){return this.__data__.has(t)}Jee.exports=cKe});var $ee=_((bFt,Zee)=>{var uKe=dS(),AKe=zee(),fKe=Xee();function yS(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new uKe;++e{function pKe(t,e){for(var r=-1,o=t==null?0:t.length;++r{function hKe(t,e){return t.has(e)}rte.exports=hKe});var DN=_((FFt,ite)=>{var gKe=$ee(),dKe=tte(),mKe=nte(),yKe=1,EKe=2;function CKe(t,e,r,o,a,n){var u=r&yKe,A=t.length,p=e.length;if(A!=p&&!(u&&p>A))return!1;var h=n.get(t),E=n.get(e);if(h&&E)return h==e&&E==t;var w=-1,D=!0,b=r&EKe?new gKe:void 0;for(n.set(t,e),n.set(e,t);++w{var IKe=ql(),wKe=IKe.Uint8Array;ste.exports=wKe});var ate=_((TFt,ote)=>{function BKe(t){var e=-1,r=Array(t.size);return t.forEach(function(o,a){r[++e]=[a,o]}),r}ote.exports=BKe});var cte=_((LFt,lte)=>{function vKe(t){var e=-1,r=Array(t.size);return t.forEach(function(o){r[++e]=o}),r}lte.exports=vKe});var hte=_((NFt,pte)=>{var ute=dg(),Ate=PN(),DKe=Um(),PKe=DN(),SKe=ate(),xKe=cte(),bKe=1,kKe=2,QKe="[object Boolean]",FKe="[object Date]",RKe="[object Error]",TKe="[object Map]",LKe="[object Number]",NKe="[object RegExp]",OKe="[object Set]",MKe="[object String]",UKe="[object Symbol]",_Ke="[object ArrayBuffer]",HKe="[object DataView]",fte=ute?ute.prototype:void 0,SN=fte?fte.valueOf:void 0;function qKe(t,e,r,o,a,n,u){switch(r){case HKe:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case _Ke:return!(t.byteLength!=e.byteLength||!n(new Ate(t),new Ate(e)));case QKe:case FKe:case LKe:return DKe(+t,+e);case RKe:return t.name==e.name&&t.message==e.message;case NKe:case MKe:return t==e+"";case TKe:var A=SKe;case OKe:var p=o&bKe;if(A||(A=xKe),t.size!=e.size&&!p)return!1;var h=u.get(t);if(h)return h==e;o|=kKe,u.set(t,e);var E=PKe(A(t),A(e),o,a,n,u);return u.delete(t),E;case UKe:if(SN)return SN.call(t)==SN.call(e)}return!1}pte.exports=qKe});var ES=_((OFt,gte)=>{function jKe(t,e){for(var r=-1,o=e.length,a=t.length;++r{var GKe=Array.isArray;dte.exports=GKe});var xN=_((UFt,mte)=>{var WKe=ES(),YKe=jl();function KKe(t,e,r){var o=e(t);return YKe(t)?o:WKe(o,r(t))}mte.exports=KKe});var Ete=_((_Ft,yte)=>{function VKe(t,e){for(var r=-1,o=t==null?0:t.length,a=0,n=[];++r{function zKe(){return[]}Cte.exports=zKe});var CS=_((qFt,wte)=>{var JKe=Ete(),XKe=bN(),ZKe=Object.prototype,$Ke=ZKe.propertyIsEnumerable,Ite=Object.getOwnPropertySymbols,eVe=Ite?function(t){return t==null?[]:(t=Object(t),JKe(Ite(t),function(e){return $Ke.call(t,e)}))}:XKe;wte.exports=eVe});var vte=_((jFt,Bte)=>{function tVe(t,e){for(var r=-1,o=Array(t);++r{function rVe(t){return t!=null&&typeof t=="object"}Dte.exports=rVe});var Ste=_((WFt,Pte)=>{var nVe=mg(),iVe=Zu(),sVe="[object Arguments]";function oVe(t){return iVe(t)&&nVe(t)==sVe}Pte.exports=oVe});var e1=_((YFt,kte)=>{var xte=Ste(),aVe=Zu(),bte=Object.prototype,lVe=bte.hasOwnProperty,cVe=bte.propertyIsEnumerable,uVe=xte(function(){return arguments}())?xte:function(t){return aVe(t)&&lVe.call(t,"callee")&&!cVe.call(t,"callee")};kte.exports=uVe});var Fte=_((KFt,Qte)=>{function AVe(){return!1}Qte.exports=AVe});var r1=_((t1,Gm)=>{var fVe=ql(),pVe=Fte(),Lte=typeof t1=="object"&&t1&&!t1.nodeType&&t1,Rte=Lte&&typeof Gm=="object"&&Gm&&!Gm.nodeType&&Gm,hVe=Rte&&Rte.exports===Lte,Tte=hVe?fVe.Buffer:void 0,gVe=Tte?Tte.isBuffer:void 0,dVe=gVe||pVe;Gm.exports=dVe});var n1=_((VFt,Nte)=>{var mVe=9007199254740991,yVe=/^(?:0|[1-9]\d*)$/;function EVe(t,e){var r=typeof t;return e=e??mVe,!!e&&(r=="number"||r!="symbol"&&yVe.test(t))&&t>-1&&t%1==0&&t{var CVe=9007199254740991;function IVe(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=CVe}Ote.exports=IVe});var Ute=_((JFt,Mte)=>{var wVe=mg(),BVe=IS(),vVe=Zu(),DVe="[object Arguments]",PVe="[object Array]",SVe="[object Boolean]",xVe="[object Date]",bVe="[object Error]",kVe="[object Function]",QVe="[object Map]",FVe="[object Number]",RVe="[object Object]",TVe="[object RegExp]",LVe="[object Set]",NVe="[object String]",OVe="[object WeakMap]",MVe="[object ArrayBuffer]",UVe="[object DataView]",_Ve="[object Float32Array]",HVe="[object Float64Array]",qVe="[object Int8Array]",jVe="[object Int16Array]",GVe="[object Int32Array]",WVe="[object Uint8Array]",YVe="[object Uint8ClampedArray]",KVe="[object Uint16Array]",VVe="[object Uint32Array]",di={};di[_Ve]=di[HVe]=di[qVe]=di[jVe]=di[GVe]=di[WVe]=di[YVe]=di[KVe]=di[VVe]=!0;di[DVe]=di[PVe]=di[MVe]=di[SVe]=di[UVe]=di[xVe]=di[bVe]=di[kVe]=di[QVe]=di[FVe]=di[RVe]=di[TVe]=di[LVe]=di[NVe]=di[OVe]=!1;function zVe(t){return vVe(t)&&BVe(t.length)&&!!di[wVe(t)]}Mte.exports=zVe});var wS=_((XFt,_te)=>{function JVe(t){return function(e){return t(e)}}_te.exports=JVe});var BS=_((i1,Wm)=>{var XVe=wN(),Hte=typeof i1=="object"&&i1&&!i1.nodeType&&i1,s1=Hte&&typeof Wm=="object"&&Wm&&!Wm.nodeType&&Wm,ZVe=s1&&s1.exports===Hte,kN=ZVe&&XVe.process,$Ve=function(){try{var t=s1&&s1.require&&s1.require("util").types;return t||kN&&kN.binding&&kN.binding("util")}catch{}}();Wm.exports=$Ve});var vS=_((ZFt,Gte)=>{var eze=Ute(),tze=wS(),qte=BS(),jte=qte&&qte.isTypedArray,rze=jte?tze(jte):eze;Gte.exports=rze});var QN=_(($Ft,Wte)=>{var nze=vte(),ize=e1(),sze=jl(),oze=r1(),aze=n1(),lze=vS(),cze=Object.prototype,uze=cze.hasOwnProperty;function Aze(t,e){var r=sze(t),o=!r&&ize(t),a=!r&&!o&&oze(t),n=!r&&!o&&!a&&lze(t),u=r||o||a||n,A=u?nze(t.length,String):[],p=A.length;for(var h in t)(e||uze.call(t,h))&&!(u&&(h=="length"||a&&(h=="offset"||h=="parent")||n&&(h=="buffer"||h=="byteLength"||h=="byteOffset")||aze(h,p)))&&A.push(h);return A}Wte.exports=Aze});var DS=_((eRt,Yte)=>{var fze=Object.prototype;function pze(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||fze;return t===r}Yte.exports=pze});var FN=_((tRt,Kte)=>{function hze(t,e){return function(r){return t(e(r))}}Kte.exports=hze});var zte=_((rRt,Vte)=>{var gze=FN(),dze=gze(Object.keys,Object);Vte.exports=dze});var Xte=_((nRt,Jte)=>{var mze=DS(),yze=zte(),Eze=Object.prototype,Cze=Eze.hasOwnProperty;function Ize(t){if(!mze(t))return yze(t);var e=[];for(var r in Object(t))Cze.call(t,r)&&r!="constructor"&&e.push(r);return e}Jte.exports=Ize});var o1=_((iRt,Zte)=>{var wze=hS(),Bze=IS();function vze(t){return t!=null&&Bze(t.length)&&!wze(t)}Zte.exports=vze});var PS=_((sRt,$te)=>{var Dze=QN(),Pze=Xte(),Sze=o1();function xze(t){return Sze(t)?Dze(t):Pze(t)}$te.exports=xze});var RN=_((oRt,ere)=>{var bze=xN(),kze=CS(),Qze=PS();function Fze(t){return bze(t,Qze,kze)}ere.exports=Fze});var nre=_((aRt,rre)=>{var tre=RN(),Rze=1,Tze=Object.prototype,Lze=Tze.hasOwnProperty;function Nze(t,e,r,o,a,n){var u=r&Rze,A=tre(t),p=A.length,h=tre(e),E=h.length;if(p!=E&&!u)return!1;for(var w=p;w--;){var D=A[w];if(!(u?D in e:Lze.call(e,D)))return!1}var b=n.get(t),C=n.get(e);if(b&&C)return b==e&&C==t;var T=!0;n.set(t,e),n.set(e,t);for(var N=u;++w{var Oze=$p(),Mze=ql(),Uze=Oze(Mze,"DataView");ire.exports=Uze});var are=_((cRt,ore)=>{var _ze=$p(),Hze=ql(),qze=_ze(Hze,"Promise");ore.exports=qze});var cre=_((uRt,lre)=>{var jze=$p(),Gze=ql(),Wze=jze(Gze,"Set");lre.exports=Wze});var Are=_((ARt,ure)=>{var Yze=$p(),Kze=ql(),Vze=Yze(Kze,"WeakMap");ure.exports=Vze});var a1=_((fRt,yre)=>{var TN=sre(),LN=gS(),NN=are(),ON=cre(),MN=Are(),mre=mg(),Ym=vN(),fre="[object Map]",zze="[object Object]",pre="[object Promise]",hre="[object Set]",gre="[object WeakMap]",dre="[object DataView]",Jze=Ym(TN),Xze=Ym(LN),Zze=Ym(NN),$ze=Ym(ON),eJe=Ym(MN),yg=mre;(TN&&yg(new TN(new ArrayBuffer(1)))!=dre||LN&&yg(new LN)!=fre||NN&&yg(NN.resolve())!=pre||ON&&yg(new ON)!=hre||MN&&yg(new MN)!=gre)&&(yg=function(t){var e=mre(t),r=e==zze?t.constructor:void 0,o=r?Ym(r):"";if(o)switch(o){case Jze:return dre;case Xze:return fre;case Zze:return pre;case $ze:return hre;case eJe:return gre}return e});yre.exports=yg});var Pre=_((pRt,Dre)=>{var UN=mS(),tJe=DN(),rJe=hte(),nJe=nre(),Ere=a1(),Cre=jl(),Ire=r1(),iJe=vS(),sJe=1,wre="[object Arguments]",Bre="[object Array]",SS="[object Object]",oJe=Object.prototype,vre=oJe.hasOwnProperty;function aJe(t,e,r,o,a,n){var u=Cre(t),A=Cre(e),p=u?Bre:Ere(t),h=A?Bre:Ere(e);p=p==wre?SS:p,h=h==wre?SS:h;var E=p==SS,w=h==SS,D=p==h;if(D&&Ire(t)){if(!Ire(e))return!1;u=!0,E=!1}if(D&&!E)return n||(n=new UN),u||iJe(t)?tJe(t,e,r,o,a,n):rJe(t,e,p,r,o,a,n);if(!(r&sJe)){var b=E&&vre.call(t,"__wrapped__"),C=w&&vre.call(e,"__wrapped__");if(b||C){var T=b?t.value():t,N=C?e.value():e;return n||(n=new UN),a(T,N,r,o,n)}}return D?(n||(n=new UN),nJe(t,e,r,o,a,n)):!1}Dre.exports=aJe});var kre=_((hRt,bre)=>{var lJe=Pre(),Sre=Zu();function xre(t,e,r,o,a){return t===e?!0:t==null||e==null||!Sre(t)&&!Sre(e)?t!==t&&e!==e:lJe(t,e,r,o,xre,a)}bre.exports=xre});var Fre=_((gRt,Qre)=>{var cJe=kre();function uJe(t,e){return cJe(t,e)}Qre.exports=uJe});var _N=_((dRt,Rre)=>{var AJe=$p(),fJe=function(){try{var t=AJe(Object,"defineProperty");return t({},"",{}),t}catch{}}();Rre.exports=fJe});var xS=_((mRt,Lre)=>{var Tre=_N();function pJe(t,e,r){e=="__proto__"&&Tre?Tre(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}Lre.exports=pJe});var HN=_((yRt,Nre)=>{var hJe=xS(),gJe=Um();function dJe(t,e,r){(r!==void 0&&!gJe(t[e],r)||r===void 0&&!(e in t))&&hJe(t,e,r)}Nre.exports=dJe});var Mre=_((ERt,Ore)=>{function mJe(t){return function(e,r,o){for(var a=-1,n=Object(e),u=o(e),A=u.length;A--;){var p=u[t?A:++a];if(r(n[p],p,n)===!1)break}return e}}Ore.exports=mJe});var _re=_((CRt,Ure)=>{var yJe=Mre(),EJe=yJe();Ure.exports=EJe});var qN=_((l1,Km)=>{var CJe=ql(),Gre=typeof l1=="object"&&l1&&!l1.nodeType&&l1,Hre=Gre&&typeof Km=="object"&&Km&&!Km.nodeType&&Km,IJe=Hre&&Hre.exports===Gre,qre=IJe?CJe.Buffer:void 0,jre=qre?qre.allocUnsafe:void 0;function wJe(t,e){if(e)return t.slice();var r=t.length,o=jre?jre(r):new t.constructor(r);return t.copy(o),o}Km.exports=wJe});var bS=_((IRt,Yre)=>{var Wre=PN();function BJe(t){var e=new t.constructor(t.byteLength);return new Wre(e).set(new Wre(t)),e}Yre.exports=BJe});var jN=_((wRt,Kre)=>{var vJe=bS();function DJe(t,e){var r=e?vJe(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}Kre.exports=DJe});var kS=_((BRt,Vre)=>{function PJe(t,e){var r=-1,o=t.length;for(e||(e=Array(o));++r{var SJe=cl(),zre=Object.create,xJe=function(){function t(){}return function(e){if(!SJe(e))return{};if(zre)return zre(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();Jre.exports=xJe});var QS=_((DRt,Zre)=>{var bJe=FN(),kJe=bJe(Object.getPrototypeOf,Object);Zre.exports=kJe});var GN=_((PRt,$re)=>{var QJe=Xre(),FJe=QS(),RJe=DS();function TJe(t){return typeof t.constructor=="function"&&!RJe(t)?QJe(FJe(t)):{}}$re.exports=TJe});var tne=_((SRt,ene)=>{var LJe=o1(),NJe=Zu();function OJe(t){return NJe(t)&&LJe(t)}ene.exports=OJe});var WN=_((xRt,nne)=>{var MJe=mg(),UJe=QS(),_Je=Zu(),HJe="[object Object]",qJe=Function.prototype,jJe=Object.prototype,rne=qJe.toString,GJe=jJe.hasOwnProperty,WJe=rne.call(Object);function YJe(t){if(!_Je(t)||MJe(t)!=HJe)return!1;var e=UJe(t);if(e===null)return!0;var r=GJe.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&rne.call(r)==WJe}nne.exports=YJe});var YN=_((bRt,ine)=>{function KJe(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}ine.exports=KJe});var RS=_((kRt,sne)=>{var VJe=xS(),zJe=Um(),JJe=Object.prototype,XJe=JJe.hasOwnProperty;function ZJe(t,e,r){var o=t[e];(!(XJe.call(t,e)&&zJe(o,r))||r===void 0&&!(e in t))&&VJe(t,e,r)}sne.exports=ZJe});var Eg=_((QRt,one)=>{var $Je=RS(),eXe=xS();function tXe(t,e,r,o){var a=!r;r||(r={});for(var n=-1,u=e.length;++n{function rXe(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}ane.exports=rXe});var une=_((RRt,cne)=>{var nXe=cl(),iXe=DS(),sXe=lne(),oXe=Object.prototype,aXe=oXe.hasOwnProperty;function lXe(t){if(!nXe(t))return sXe(t);var e=iXe(t),r=[];for(var o in t)o=="constructor"&&(e||!aXe.call(t,o))||r.push(o);return r}cne.exports=lXe});var Vm=_((TRt,Ane)=>{var cXe=QN(),uXe=une(),AXe=o1();function fXe(t){return AXe(t)?cXe(t,!0):uXe(t)}Ane.exports=fXe});var pne=_((LRt,fne)=>{var pXe=Eg(),hXe=Vm();function gXe(t){return pXe(t,hXe(t))}fne.exports=gXe});var Ene=_((NRt,yne)=>{var hne=HN(),dXe=qN(),mXe=jN(),yXe=kS(),EXe=GN(),gne=e1(),dne=jl(),CXe=tne(),IXe=r1(),wXe=hS(),BXe=cl(),vXe=WN(),DXe=vS(),mne=YN(),PXe=pne();function SXe(t,e,r,o,a,n,u){var A=mne(t,r),p=mne(e,r),h=u.get(p);if(h){hne(t,r,h);return}var E=n?n(A,p,r+"",t,e,u):void 0,w=E===void 0;if(w){var D=dne(p),b=!D&&IXe(p),C=!D&&!b&&DXe(p);E=p,D||b||C?dne(A)?E=A:CXe(A)?E=yXe(A):b?(w=!1,E=dXe(p,!0)):C?(w=!1,E=mXe(p,!0)):E=[]:vXe(p)||gne(p)?(E=A,gne(A)?E=PXe(A):(!BXe(A)||wXe(A))&&(E=EXe(p))):w=!1}w&&(u.set(p,E),a(E,p,o,n,u),u.delete(p)),hne(t,r,E)}yne.exports=SXe});var wne=_((ORt,Ine)=>{var xXe=mS(),bXe=HN(),kXe=_re(),QXe=Ene(),FXe=cl(),RXe=Vm(),TXe=YN();function Cne(t,e,r,o,a){t!==e&&kXe(e,function(n,u){if(a||(a=new xXe),FXe(n))QXe(t,e,u,r,Cne,o,a);else{var A=o?o(TXe(t,u),n,u+"",t,e,a):void 0;A===void 0&&(A=n),bXe(t,u,A)}},RXe)}Ine.exports=Cne});var KN=_((MRt,Bne)=>{function LXe(t){return t}Bne.exports=LXe});var Dne=_((URt,vne)=>{function NXe(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}vne.exports=NXe});var VN=_((_Rt,Sne)=>{var OXe=Dne(),Pne=Math.max;function MXe(t,e,r){return e=Pne(e===void 0?t.length-1:e,0),function(){for(var o=arguments,a=-1,n=Pne(o.length-e,0),u=Array(n);++a{function UXe(t){return function(){return t}}xne.exports=UXe});var Fne=_((qRt,Qne)=>{var _Xe=bne(),kne=_N(),HXe=KN(),qXe=kne?function(t,e){return kne(t,"toString",{configurable:!0,enumerable:!1,value:_Xe(e),writable:!0})}:HXe;Qne.exports=qXe});var Tne=_((jRt,Rne)=>{var jXe=800,GXe=16,WXe=Date.now;function YXe(t){var e=0,r=0;return function(){var o=WXe(),a=GXe-(o-r);if(r=o,a>0){if(++e>=jXe)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}Rne.exports=YXe});var zN=_((GRt,Lne)=>{var KXe=Fne(),VXe=Tne(),zXe=VXe(KXe);Lne.exports=zXe});var One=_((WRt,Nne)=>{var JXe=KN(),XXe=VN(),ZXe=zN();function $Xe(t,e){return ZXe(XXe(t,e,JXe),t+"")}Nne.exports=$Xe});var Une=_((YRt,Mne)=>{var eZe=Um(),tZe=o1(),rZe=n1(),nZe=cl();function iZe(t,e,r){if(!nZe(r))return!1;var o=typeof e;return(o=="number"?tZe(r)&&rZe(e,r.length):o=="string"&&e in r)?eZe(r[e],t):!1}Mne.exports=iZe});var Hne=_((KRt,_ne)=>{var sZe=One(),oZe=Une();function aZe(t){return sZe(function(e,r){var o=-1,a=r.length,n=a>1?r[a-1]:void 0,u=a>2?r[2]:void 0;for(n=t.length>3&&typeof n=="function"?(a--,n):void 0,u&&oZe(r[0],r[1],u)&&(n=a<3?void 0:n,a=1),e=Object(e);++o{var lZe=wne(),cZe=Hne(),uZe=cZe(function(t,e,r,o){lZe(t,e,r,o)});qne.exports=uZe});var qe={};Kt(qe,{AsyncActions:()=>ZN,BufferStream:()=>XN,CachingStrategy:()=>tie,DefaultStream:()=>$N,allSettledSafe:()=>Wc,assertNever:()=>tO,bufferStream:()=>Xm,buildIgnorePattern:()=>mZe,convertMapsToIndexableObjects:()=>LS,dynamicRequire:()=>vf,escapeRegExp:()=>fZe,getArrayWithDefault:()=>u1,getFactoryWithDefault:()=>Al,getMapWithDefault:()=>A1,getSetWithDefault:()=>zm,groupBy:()=>CZe,isIndexableObject:()=>JN,isPathLike:()=>yZe,isTaggedYarnVersion:()=>AZe,makeDeferred:()=>Zne,mapAndFilter:()=>ul,mapAndFind:()=>eh,mergeIntoTarget:()=>nie,overrideType:()=>pZe,parseBoolean:()=>f1,parseInt:()=>Zm,parseOptionalBoolean:()=>rie,plural:()=>TS,prettifyAsyncErrors:()=>Jm,prettifySyncErrors:()=>rO,releaseAfterUseAsync:()=>gZe,replaceEnvVariables:()=>NS,sortMap:()=>Ps,toMerged:()=>EZe,tryParseOptionalBoolean:()=>nO,validateEnum:()=>hZe});function AZe(t){return!!(zne.default.valid(t)&&t.match(/^[^-]+(-rc\.[0-9]+)?$/))}function TS(t,{one:e,more:r,zero:o=r}){return t===0?o:t===1?e:r}function fZe(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function pZe(t){}function tO(t){throw new Error(`Assertion failed: Unexpected object '${t}'`)}function hZe(t,e){let r=Object.values(t);if(!r.includes(e))throw new ot(`Invalid value for enumeration: ${JSON.stringify(e)} (expected one of ${r.map(o=>JSON.stringify(o)).join(", ")})`);return e}function ul(t,e){let r=[];for(let o of t){let a=e(o);a!==Jne&&r.push(a)}return r}function eh(t,e){for(let r of t){let o=e(r);if(o!==Xne)return o}}function JN(t){return typeof t=="object"&&t!==null}async function Wc(t){let e=await Promise.allSettled(t),r=[];for(let o of e){if(o.status==="rejected")throw o.reason;r.push(o.value)}return r}function LS(t){if(t instanceof Map&&(t=Object.fromEntries(t)),JN(t))for(let e of Object.keys(t)){let r=t[e];JN(r)&&(t[e]=LS(r))}return t}function Al(t,e,r){let o=t.get(e);return typeof o>"u"&&t.set(e,o=r()),o}function u1(t,e){let r=t.get(e);return typeof r>"u"&&t.set(e,r=[]),r}function zm(t,e){let r=t.get(e);return typeof r>"u"&&t.set(e,r=new Set),r}function A1(t,e){let r=t.get(e);return typeof r>"u"&&t.set(e,r=new Map),r}async function gZe(t,e){if(e==null)return await t();try{return await t()}finally{await e()}}async function Jm(t,e){try{return await t()}catch(r){throw r.message=e(r.message),r}}function rO(t,e){try{return t()}catch(r){throw r.message=e(r.message),r}}async function Xm(t){return await new Promise((e,r)=>{let o=[];t.on("error",a=>{r(a)}),t.on("data",a=>{o.push(a)}),t.on("end",()=>{e(Buffer.concat(o))})})}function Zne(){let t,e;return{promise:new Promise((o,a)=>{t=o,e=a}),resolve:t,reject:e}}function $ne(t){return c1(Ae.fromPortablePath(t))}function eie(path){let physicalPath=Ae.fromPortablePath(path),currentCacheEntry=c1.cache[physicalPath];delete c1.cache[physicalPath];let result;try{result=$ne(physicalPath);let freshCacheEntry=c1.cache[physicalPath],dynamicModule=eval("module"),freshCacheIndex=dynamicModule.children.indexOf(freshCacheEntry);freshCacheIndex!==-1&&dynamicModule.children.splice(freshCacheIndex,1)}finally{c1.cache[physicalPath]=currentCacheEntry}return result}function dZe(t){let e=Gne.get(t),r=ae.statSync(t);if(e?.mtime===r.mtimeMs)return e.instance;let o=eie(t);return Gne.set(t,{mtime:r.mtimeMs,instance:o}),o}function vf(t,{cachingStrategy:e=2}={}){switch(e){case 0:return eie(t);case 1:return dZe(t);case 2:return $ne(t);default:throw new Error("Unsupported caching strategy")}}function Ps(t,e){let r=Array.from(t);Array.isArray(e)||(e=[e]);let o=[];for(let n of e)o.push(r.map(u=>n(u)));let a=r.map((n,u)=>u);return a.sort((n,u)=>{for(let A of o){let p=A[n]A[u]?1:0;if(p!==0)return p}return 0}),a.map(n=>r[n])}function mZe(t){return t.length===0?null:t.map(e=>`(${Kne.default.makeRe(e,{windows:!1,dot:!0}).source})`).join("|")}function NS(t,{env:e}){let r=/\${(?[\d\w_]+)(?:)?(?:-(?[^}]*))?}/g;return t.replace(r,(...o)=>{let{variableName:a,colon:n,fallback:u}=o[o.length-1],A=Object.hasOwn(e,a),p=e[a];if(p||A&&!n)return p;if(u!=null)return u;throw new ot(`Environment variable not found (${a})`)})}function f1(t){switch(t){case"true":case"1":case 1:case!0:return!0;case"false":case"0":case 0:case!1:return!1;default:throw new Error(`Couldn't parse "${t}" as a boolean`)}}function rie(t){return typeof t>"u"?t:f1(t)}function nO(t){try{return rie(t)}catch{return null}}function yZe(t){return!!(Ae.isAbsolute(t)||t.match(/^(\.{1,2}|~)\//))}function nie(t,...e){let r=u=>({value:u}),o=r(t),a=e.map(u=>r(u)),{value:n}=(0,Yne.default)(o,...a,(u,A)=>{if(Array.isArray(u)&&Array.isArray(A)){for(let p of A)u.find(h=>(0,Wne.default)(h,p))||u.push(p);return u}});return n}function EZe(...t){return nie({},...t)}function CZe(t,e){let r=Object.create(null);for(let o of t){let a=o[e];r[a]??=[],r[a].push(o)}return r}function Zm(t){return typeof t=="string"?Number.parseInt(t,10):t}var Wne,Yne,Kne,Vne,zne,eO,Jne,Xne,XN,ZN,$N,c1,Gne,tie,Gl=It(()=>{Pt();Gt();Wne=et(Fre()),Yne=et(jne()),Kne=et(Xo()),Vne=et(lg()),zne=et(ni()),eO=ve("stream");Jne=Symbol();ul.skip=Jne;Xne=Symbol();eh.skip=Xne;XN=class extends eO.Transform{constructor(){super(...arguments);this.chunks=[]}_transform(r,o,a){if(o!=="buffer"||!Buffer.isBuffer(r))throw new Error("Assertion failed: BufferStream only accept buffers");this.chunks.push(r),a(null,null)}_flush(r){r(null,Buffer.concat(this.chunks))}};ZN=class{constructor(e){this.deferred=new Map;this.promises=new Map;this.limit=(0,Vne.default)(e)}set(e,r){let o=this.deferred.get(e);typeof o>"u"&&this.deferred.set(e,o=Zne());let a=this.limit(()=>r());return this.promises.set(e,a),a.then(()=>{this.promises.get(e)===a&&o.resolve()},n=>{this.promises.get(e)===a&&o.reject(n)}),o.promise}reduce(e,r){let o=this.promises.get(e)??Promise.resolve();this.set(e,()=>r(o))}async wait(){await Promise.all(this.promises.values())}},$N=class extends eO.Transform{constructor(r=Buffer.alloc(0)){super();this.active=!0;this.ifEmpty=r}_transform(r,o,a){if(o!=="buffer"||!Buffer.isBuffer(r))throw new Error("Assertion failed: DefaultStream only accept buffers");this.active=!1,a(null,r)}_flush(r){this.active&&this.ifEmpty.length>0?r(null,this.ifEmpty):r(null)}},c1=eval("require");Gne=new Map;tie=(o=>(o[o.NoCache=0]="NoCache",o[o.FsTime=1]="FsTime",o[o.Node=2]="Node",o))(tie||{})});var $m,iO,sO,iie=It(()=>{$m=(r=>(r.HARD="HARD",r.SOFT="SOFT",r))($m||{}),iO=(o=>(o.Dependency="Dependency",o.PeerDependency="PeerDependency",o.PeerDependencyMeta="PeerDependencyMeta",o))(iO||{}),sO=(o=>(o.Inactive="inactive",o.Redundant="redundant",o.Active="active",o))(sO||{})});var pe={};Kt(pe,{LogLevel:()=>HS,Style:()=>MS,Type:()=>Ct,addLogFilterSupport:()=>g1,applyColor:()=>Gs,applyHyperlink:()=>ty,applyStyle:()=>Cg,json:()=>Ig,jsonOrPretty:()=>BZe,mark:()=>uO,pretty:()=>Ut,prettyField:()=>$u,prettyList:()=>cO,prettyTruncatedLocatorList:()=>_S,stripAnsi:()=>ey.default,supportsColor:()=>US,supportsHyperlinks:()=>lO,tuple:()=>Yc});function sie(t){let e=["KiB","MiB","GiB","TiB"],r=e.length;for(;r>1&&t<1024**r;)r-=1;let o=1024**r;return`${Math.floor(t*100/o)/100} ${e[r-1]}`}function Yc(t,e){return[e,t]}function Cg(t,e,r){return t.get("enableColors")&&r&2&&(e=h1.default.bold(e)),e}function Gs(t,e,r){if(!t.get("enableColors"))return e;let o=IZe.get(r);if(o===null)return e;let a=typeof o>"u"?r:aO.level>=3?o[0]:o[1],n=typeof a=="number"?oO.ansi256(a):a.startsWith("#")?oO.hex(a):oO[a];if(typeof n!="function")throw new Error(`Invalid format type ${a}`);return n(e)}function ty(t,e,r){return t.get("enableHyperlinks")?wZe?`\x1B]8;;${r}\x1B\\${e}\x1B]8;;\x1B\\`:`\x1B]8;;${r}\x07${e}\x1B]8;;\x07`:e}function Ut(t,e,r){if(e===null)return Gs(t,"null",Ct.NULL);if(Object.hasOwn(OS,r))return OS[r].pretty(t,e);if(typeof e!="string")throw new Error(`Assertion failed: Expected the value to be a string, got ${typeof e}`);return Gs(t,e,r)}function cO(t,e,r,{separator:o=", "}={}){return[...e].map(a=>Ut(t,a,r)).join(o)}function Ig(t,e){if(t===null)return null;if(Object.hasOwn(OS,e))return OS[e].json(t);if(typeof t!="string")throw new Error(`Assertion failed: Expected the value to be a string, got ${typeof t}`);return t}function BZe(t,e,[r,o]){return t?Ig(r,o):Ut(e,r,o)}function uO(t){return{Check:Gs(t,"\u2713","green"),Cross:Gs(t,"\u2718","red"),Question:Gs(t,"?","cyan")}}function $u(t,{label:e,value:[r,o]}){return`${Ut(t,e,Ct.CODE)}: ${Ut(t,r,o)}`}function _S(t,e,r){let o=[],a=[...e],n=r;for(;a.length>0;){let h=a[0],E=`${jr(t,h)}, `,w=AO(h).length+2;if(o.length>0&&nh).join("").slice(0,-2);let u="X".repeat(a.length.toString().length),A=`and ${u} more.`,p=a.length;for(;o.length>1&&nh).join(""),A.replace(u,Ut(t,p,Ct.NUMBER))].join("")}function g1(t,{configuration:e}){let r=e.get("logFilters"),o=new Map,a=new Map,n=[];for(let w of r){let D=w.get("level");if(typeof D>"u")continue;let b=w.get("code");typeof b<"u"&&o.set(b,D);let C=w.get("text");typeof C<"u"&&a.set(C,D);let T=w.get("pattern");typeof T<"u"&&n.push([oie.default.matcher(T,{contains:!0}),D])}n.reverse();let u=(w,D,b)=>{if(w===null||w===0)return b;let C=a.size>0||n.length>0?(0,ey.default)(D):D;if(a.size>0){let T=a.get(C);if(typeof T<"u")return T??b}if(n.length>0){for(let[T,N]of n)if(T(C))return N??b}if(o.size>0){let T=o.get(zu(w));if(typeof T<"u")return T??b}return b},A=t.reportInfo,p=t.reportWarning,h=t.reportError,E=function(w,D,b,C){switch(u(D,b,C)){case"info":A.call(w,D,b);break;case"warning":p.call(w,D??0,b);break;case"error":h.call(w,D??0,b);break}};t.reportInfo=function(...w){return E(this,...w,"info")},t.reportWarning=function(...w){return E(this,...w,"warning")},t.reportError=function(...w){return E(this,...w,"error")}}var h1,p1,oie,ey,aie,Ct,MS,aO,US,lO,oO,IZe,Co,OS,wZe,HS,Wl=It(()=>{Pt();h1=et(sN()),p1=et(sg());Gt();oie=et(Xo()),ey=et(pS()),aie=ve("util");jP();Io();Ct={NO_HINT:"NO_HINT",ID:"ID",NULL:"NULL",SCOPE:"SCOPE",NAME:"NAME",RANGE:"RANGE",REFERENCE:"REFERENCE",NUMBER:"NUMBER",PATH:"PATH",URL:"URL",ADDED:"ADDED",REMOVED:"REMOVED",CODE:"CODE",INSPECT:"INSPECT",DURATION:"DURATION",SIZE:"SIZE",SIZE_DIFF:"SIZE_DIFF",IDENT:"IDENT",DESCRIPTOR:"DESCRIPTOR",LOCATOR:"LOCATOR",RESOLUTION:"RESOLUTION",DEPENDENT:"DEPENDENT",PACKAGE_EXTENSION:"PACKAGE_EXTENSION",SETTING:"SETTING",MARKDOWN:"MARKDOWN",MARKDOWN_INLINE:"MARKDOWN_INLINE"},MS=(e=>(e[e.BOLD=2]="BOLD",e))(MS||{}),aO=p1.default.GITHUB_ACTIONS?{level:2}:h1.default.supportsColor?{level:h1.default.supportsColor.level}:{level:0},US=aO.level!==0,lO=US&&!p1.default.GITHUB_ACTIONS&&!p1.default.CIRCLE&&!p1.default.GITLAB,oO=new h1.default.Instance(aO),IZe=new Map([[Ct.NO_HINT,null],[Ct.NULL,["#a853b5",129]],[Ct.SCOPE,["#d75f00",166]],[Ct.NAME,["#d7875f",173]],[Ct.RANGE,["#00afaf",37]],[Ct.REFERENCE,["#87afff",111]],[Ct.NUMBER,["#ffd700",220]],[Ct.PATH,["#d75fd7",170]],[Ct.URL,["#d75fd7",170]],[Ct.ADDED,["#5faf00",70]],[Ct.REMOVED,["#ff3131",160]],[Ct.CODE,["#87afff",111]],[Ct.SIZE,["#ffd700",220]]]),Co=t=>t;OS={[Ct.ID]:Co({pretty:(t,e)=>typeof e=="number"?Gs(t,`${e}`,Ct.NUMBER):Gs(t,e,Ct.CODE),json:t=>t}),[Ct.INSPECT]:Co({pretty:(t,e)=>(0,aie.inspect)(e,{depth:1/0,colors:t.get("enableColors"),compact:!0,breakLength:1/0}),json:t=>t}),[Ct.NUMBER]:Co({pretty:(t,e)=>Gs(t,`${e}`,Ct.NUMBER),json:t=>t}),[Ct.IDENT]:Co({pretty:(t,e)=>Ui(t,e),json:t=>rn(t)}),[Ct.LOCATOR]:Co({pretty:(t,e)=>jr(t,e),json:t=>Qa(t)}),[Ct.DESCRIPTOR]:Co({pretty:(t,e)=>zn(t,e),json:t=>ka(t)}),[Ct.RESOLUTION]:Co({pretty:(t,{descriptor:e,locator:r})=>d1(t,e,r),json:({descriptor:t,locator:e})=>({descriptor:ka(t),locator:e!==null?Qa(e):null})}),[Ct.DEPENDENT]:Co({pretty:(t,{locator:e,descriptor:r})=>fO(t,e,r),json:({locator:t,descriptor:e})=>({locator:Qa(t),descriptor:ka(e)})}),[Ct.PACKAGE_EXTENSION]:Co({pretty:(t,e)=>{switch(e.type){case"Dependency":return`${Ui(t,e.parentDescriptor)} \u27A4 ${Gs(t,"dependencies",Ct.CODE)} \u27A4 ${Ui(t,e.descriptor)}`;case"PeerDependency":return`${Ui(t,e.parentDescriptor)} \u27A4 ${Gs(t,"peerDependencies",Ct.CODE)} \u27A4 ${Ui(t,e.descriptor)}`;case"PeerDependencyMeta":return`${Ui(t,e.parentDescriptor)} \u27A4 ${Gs(t,"peerDependenciesMeta",Ct.CODE)} \u27A4 ${Ui(t,Zo(e.selector))} \u27A4 ${Gs(t,e.key,Ct.CODE)}`;default:throw new Error(`Assertion failed: Unsupported package extension type: ${e.type}`)}},json:t=>{switch(t.type){case"Dependency":return`${rn(t.parentDescriptor)} > ${rn(t.descriptor)}`;case"PeerDependency":return`${rn(t.parentDescriptor)} >> ${rn(t.descriptor)}`;case"PeerDependencyMeta":return`${rn(t.parentDescriptor)} >> ${t.selector} / ${t.key}`;default:throw new Error(`Assertion failed: Unsupported package extension type: ${t.type}`)}}}),[Ct.SETTING]:Co({pretty:(t,e)=>(t.get(e),ty(t,Gs(t,e,Ct.CODE),`https://yarnpkg.com/configuration/yarnrc#${e}`)),json:t=>t}),[Ct.DURATION]:Co({pretty:(t,e)=>{if(e>1e3*60){let r=Math.floor(e/1e3/60),o=Math.ceil((e-r*60*1e3)/1e3);return o===0?`${r}m`:`${r}m ${o}s`}else{let r=Math.floor(e/1e3),o=e-r*1e3;return o===0?`${r}s`:`${r}s ${o}ms`}},json:t=>t}),[Ct.SIZE]:Co({pretty:(t,e)=>Gs(t,sie(e),Ct.NUMBER),json:t=>t}),[Ct.SIZE_DIFF]:Co({pretty:(t,e)=>{let r=e>=0?"+":"-",o=r==="+"?Ct.REMOVED:Ct.ADDED;return Gs(t,`${r} ${sie(Math.max(Math.abs(e),1))}`,o)},json:t=>t}),[Ct.PATH]:Co({pretty:(t,e)=>Gs(t,Ae.fromPortablePath(e),Ct.PATH),json:t=>Ae.fromPortablePath(t)}),[Ct.MARKDOWN]:Co({pretty:(t,{text:e,format:r,paragraphs:o})=>yo(e,{format:r,paragraphs:o}),json:({text:t})=>t}),[Ct.MARKDOWN_INLINE]:Co({pretty:(t,e)=>(e=e.replace(/(`+)((?:.|[\n])*?)\1/g,(r,o,a)=>Ut(t,o+a+o,Ct.CODE)),e=e.replace(/(\*\*)((?:.|[\n])*?)\1/g,(r,o,a)=>Cg(t,a,2)),e),json:t=>t})};wZe=!!process.env.KONSOLE_VERSION;HS=(a=>(a.Error="error",a.Warning="warning",a.Info="info",a.Discard="discard",a))(HS||{})});var lie=_(ry=>{"use strict";Object.defineProperty(ry,"__esModule",{value:!0});ry.splitWhen=ry.flatten=void 0;function vZe(t){return t.reduce((e,r)=>[].concat(e,r),[])}ry.flatten=vZe;function DZe(t,e){let r=[[]],o=0;for(let a of t)e(a)?(o++,r[o]=[]):r[o].push(a);return r}ry.splitWhen=DZe});var cie=_(qS=>{"use strict";Object.defineProperty(qS,"__esModule",{value:!0});qS.isEnoentCodeError=void 0;function PZe(t){return t.code==="ENOENT"}qS.isEnoentCodeError=PZe});var uie=_(jS=>{"use strict";Object.defineProperty(jS,"__esModule",{value:!0});jS.createDirentFromStats=void 0;var pO=class{constructor(e,r){this.name=e,this.isBlockDevice=r.isBlockDevice.bind(r),this.isCharacterDevice=r.isCharacterDevice.bind(r),this.isDirectory=r.isDirectory.bind(r),this.isFIFO=r.isFIFO.bind(r),this.isFile=r.isFile.bind(r),this.isSocket=r.isSocket.bind(r),this.isSymbolicLink=r.isSymbolicLink.bind(r)}};function SZe(t,e){return new pO(t,e)}jS.createDirentFromStats=SZe});var hie=_(Vi=>{"use strict";Object.defineProperty(Vi,"__esModule",{value:!0});Vi.convertPosixPathToPattern=Vi.convertWindowsPathToPattern=Vi.convertPathToPattern=Vi.escapePosixPath=Vi.escapeWindowsPath=Vi.escape=Vi.removeLeadingDotSegment=Vi.makeAbsolute=Vi.unixify=void 0;var xZe=ve("os"),bZe=ve("path"),Aie=xZe.platform()==="win32",kZe=2,QZe=/(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g,FZe=/(\\?)([()[\]{}]|^!|[!+@](?=\())/g,RZe=/^\\\\([.?])/,TZe=/\\(?![!()+@[\]{}])/g;function LZe(t){return t.replace(/\\/g,"/")}Vi.unixify=LZe;function NZe(t,e){return bZe.resolve(t,e)}Vi.makeAbsolute=NZe;function OZe(t){if(t.charAt(0)==="."){let e=t.charAt(1);if(e==="/"||e==="\\")return t.slice(kZe)}return t}Vi.removeLeadingDotSegment=OZe;Vi.escape=Aie?hO:gO;function hO(t){return t.replace(FZe,"\\$2")}Vi.escapeWindowsPath=hO;function gO(t){return t.replace(QZe,"\\$2")}Vi.escapePosixPath=gO;Vi.convertPathToPattern=Aie?fie:pie;function fie(t){return hO(t).replace(RZe,"//$1").replace(TZe,"/")}Vi.convertWindowsPathToPattern=fie;function pie(t){return gO(t)}Vi.convertPosixPathToPattern=pie});var die=_((cTt,gie)=>{gie.exports=function(e){if(typeof e!="string"||e==="")return!1;for(var r;r=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(r[2])return!0;e=e.slice(r.index+r[0].length)}return!1}});var Eie=_((uTt,yie)=>{var MZe=die(),mie={"{":"}","(":")","[":"]"},UZe=function(t){if(t[0]==="!")return!0;for(var e=0,r=-2,o=-2,a=-2,n=-2,u=-2;ee&&(u===-1||u>o||(u=t.indexOf("\\",e),u===-1||u>o)))||a!==-1&&t[e]==="{"&&t[e+1]!=="}"&&(a=t.indexOf("}",e),a>e&&(u=t.indexOf("\\",e),u===-1||u>a))||n!==-1&&t[e]==="("&&t[e+1]==="?"&&/[:!=]/.test(t[e+2])&&t[e+3]!==")"&&(n=t.indexOf(")",e),n>e&&(u=t.indexOf("\\",e),u===-1||u>n))||r!==-1&&t[e]==="("&&t[e+1]!=="|"&&(rr&&(u=t.indexOf("\\",r),u===-1||u>n))))return!0;if(t[e]==="\\"){var A=t[e+1];e+=2;var p=mie[A];if(p){var h=t.indexOf(p,e);h!==-1&&(e=h+1)}if(t[e]==="!")return!0}else e++}return!1},_Ze=function(t){if(t[0]==="!")return!0;for(var e=0;e{"use strict";var HZe=Eie(),qZe=ve("path").posix.dirname,jZe=ve("os").platform()==="win32",dO="/",GZe=/\\/g,WZe=/[\{\[].*[\}\]]$/,YZe=/(^|[^\\])([\{\[]|\([^\)]+$)/,KZe=/\\([\!\*\?\|\[\]\(\)\{\}])/g;Cie.exports=function(e,r){var o=Object.assign({flipBackslashes:!0},r);o.flipBackslashes&&jZe&&e.indexOf(dO)<0&&(e=e.replace(GZe,dO)),WZe.test(e)&&(e+=dO),e+="a";do e=qZe(e);while(HZe(e)||YZe.test(e));return e.replace(KZe,"$1")}});var bie=_(Mr=>{"use strict";Object.defineProperty(Mr,"__esModule",{value:!0});Mr.removeDuplicateSlashes=Mr.matchAny=Mr.convertPatternsToRe=Mr.makeRe=Mr.getPatternParts=Mr.expandBraceExpansion=Mr.expandPatternsWithBraceExpansion=Mr.isAffectDepthOfReadingPattern=Mr.endsWithSlashGlobStar=Mr.hasGlobStar=Mr.getBaseDirectory=Mr.isPatternRelatedToParentDirectory=Mr.getPatternsOutsideCurrentDirectory=Mr.getPatternsInsideCurrentDirectory=Mr.getPositivePatterns=Mr.getNegativePatterns=Mr.isPositivePattern=Mr.isNegativePattern=Mr.convertToNegativePattern=Mr.convertToPositivePattern=Mr.isDynamicPattern=Mr.isStaticPattern=void 0;var VZe=ve("path"),zZe=Iie(),mO=Xo(),wie="**",JZe="\\",XZe=/[*?]|^!/,ZZe=/\[[^[]*]/,$Ze=/(?:^|[^!*+?@])\([^(]*\|[^|]*\)/,e$e=/[!*+?@]\([^(]*\)/,t$e=/,|\.\./,r$e=/(?!^)\/{2,}/g;function Bie(t,e={}){return!vie(t,e)}Mr.isStaticPattern=Bie;function vie(t,e={}){return t===""?!1:!!(e.caseSensitiveMatch===!1||t.includes(JZe)||XZe.test(t)||ZZe.test(t)||$Ze.test(t)||e.extglob!==!1&&e$e.test(t)||e.braceExpansion!==!1&&n$e(t))}Mr.isDynamicPattern=vie;function n$e(t){let e=t.indexOf("{");if(e===-1)return!1;let r=t.indexOf("}",e+1);if(r===-1)return!1;let o=t.slice(e,r);return t$e.test(o)}function i$e(t){return GS(t)?t.slice(1):t}Mr.convertToPositivePattern=i$e;function s$e(t){return"!"+t}Mr.convertToNegativePattern=s$e;function GS(t){return t.startsWith("!")&&t[1]!=="("}Mr.isNegativePattern=GS;function Die(t){return!GS(t)}Mr.isPositivePattern=Die;function o$e(t){return t.filter(GS)}Mr.getNegativePatterns=o$e;function a$e(t){return t.filter(Die)}Mr.getPositivePatterns=a$e;function l$e(t){return t.filter(e=>!yO(e))}Mr.getPatternsInsideCurrentDirectory=l$e;function c$e(t){return t.filter(yO)}Mr.getPatternsOutsideCurrentDirectory=c$e;function yO(t){return t.startsWith("..")||t.startsWith("./..")}Mr.isPatternRelatedToParentDirectory=yO;function u$e(t){return zZe(t,{flipBackslashes:!1})}Mr.getBaseDirectory=u$e;function A$e(t){return t.includes(wie)}Mr.hasGlobStar=A$e;function Pie(t){return t.endsWith("/"+wie)}Mr.endsWithSlashGlobStar=Pie;function f$e(t){let e=VZe.basename(t);return Pie(t)||Bie(e)}Mr.isAffectDepthOfReadingPattern=f$e;function p$e(t){return t.reduce((e,r)=>e.concat(Sie(r)),[])}Mr.expandPatternsWithBraceExpansion=p$e;function Sie(t){let e=mO.braces(t,{expand:!0,nodupes:!0,keepEscaping:!0});return e.sort((r,o)=>r.length-o.length),e.filter(r=>r!=="")}Mr.expandBraceExpansion=Sie;function h$e(t,e){let{parts:r}=mO.scan(t,Object.assign(Object.assign({},e),{parts:!0}));return r.length===0&&(r=[t]),r[0].startsWith("/")&&(r[0]=r[0].slice(1),r.unshift("")),r}Mr.getPatternParts=h$e;function xie(t,e){return mO.makeRe(t,e)}Mr.makeRe=xie;function g$e(t,e){return t.map(r=>xie(r,e))}Mr.convertPatternsToRe=g$e;function d$e(t,e){return e.some(r=>r.test(t))}Mr.matchAny=d$e;function m$e(t){return t.replace(r$e,"/")}Mr.removeDuplicateSlashes=m$e});var Rie=_((pTt,Fie)=>{"use strict";var y$e=ve("stream"),kie=y$e.PassThrough,E$e=Array.prototype.slice;Fie.exports=C$e;function C$e(){let t=[],e=E$e.call(arguments),r=!1,o=e[e.length-1];o&&!Array.isArray(o)&&o.pipe==null?e.pop():o={};let a=o.end!==!1,n=o.pipeError===!0;o.objectMode==null&&(o.objectMode=!0),o.highWaterMark==null&&(o.highWaterMark=64*1024);let u=kie(o);function A(){for(let E=0,w=arguments.length;E0||(r=!1,p())}function b(C){function T(){C.removeListener("merge2UnpipeEnd",T),C.removeListener("end",T),n&&C.removeListener("error",N),D()}function N(U){u.emit("error",U)}if(C._readableState.endEmitted)return D();C.on("merge2UnpipeEnd",T),C.on("end",T),n&&C.on("error",N),C.pipe(u,{end:!1}),C.resume()}for(let C=0;C{"use strict";Object.defineProperty(WS,"__esModule",{value:!0});WS.merge=void 0;var I$e=Rie();function w$e(t){let e=I$e(t);return t.forEach(r=>{r.once("error",o=>e.emit("error",o))}),e.once("close",()=>Tie(t)),e.once("end",()=>Tie(t)),e}WS.merge=w$e;function Tie(t){t.forEach(e=>e.emit("close"))}});var Nie=_(ny=>{"use strict";Object.defineProperty(ny,"__esModule",{value:!0});ny.isEmpty=ny.isString=void 0;function B$e(t){return typeof t=="string"}ny.isString=B$e;function v$e(t){return t===""}ny.isEmpty=v$e});var Df=_(wo=>{"use strict";Object.defineProperty(wo,"__esModule",{value:!0});wo.string=wo.stream=wo.pattern=wo.path=wo.fs=wo.errno=wo.array=void 0;var D$e=lie();wo.array=D$e;var P$e=cie();wo.errno=P$e;var S$e=uie();wo.fs=S$e;var x$e=hie();wo.path=x$e;var b$e=bie();wo.pattern=b$e;var k$e=Lie();wo.stream=k$e;var Q$e=Nie();wo.string=Q$e});var _ie=_(Bo=>{"use strict";Object.defineProperty(Bo,"__esModule",{value:!0});Bo.convertPatternGroupToTask=Bo.convertPatternGroupsToTasks=Bo.groupPatternsByBaseDirectory=Bo.getNegativePatternsAsPositive=Bo.getPositivePatterns=Bo.convertPatternsToTasks=Bo.generate=void 0;var Kc=Df();function F$e(t,e){let r=Oie(t,e),o=Oie(e.ignore,e),a=Mie(r),n=Uie(r,o),u=a.filter(E=>Kc.pattern.isStaticPattern(E,e)),A=a.filter(E=>Kc.pattern.isDynamicPattern(E,e)),p=EO(u,n,!1),h=EO(A,n,!0);return p.concat(h)}Bo.generate=F$e;function Oie(t,e){let r=t;return e.braceExpansion&&(r=Kc.pattern.expandPatternsWithBraceExpansion(r)),e.baseNameMatch&&(r=r.map(o=>o.includes("/")?o:`**/${o}`)),r.map(o=>Kc.pattern.removeDuplicateSlashes(o))}function EO(t,e,r){let o=[],a=Kc.pattern.getPatternsOutsideCurrentDirectory(t),n=Kc.pattern.getPatternsInsideCurrentDirectory(t),u=CO(a),A=CO(n);return o.push(...IO(u,e,r)),"."in A?o.push(wO(".",n,e,r)):o.push(...IO(A,e,r)),o}Bo.convertPatternsToTasks=EO;function Mie(t){return Kc.pattern.getPositivePatterns(t)}Bo.getPositivePatterns=Mie;function Uie(t,e){return Kc.pattern.getNegativePatterns(t).concat(e).map(Kc.pattern.convertToPositivePattern)}Bo.getNegativePatternsAsPositive=Uie;function CO(t){let e={};return t.reduce((r,o)=>{let a=Kc.pattern.getBaseDirectory(o);return a in r?r[a].push(o):r[a]=[o],r},e)}Bo.groupPatternsByBaseDirectory=CO;function IO(t,e,r){return Object.keys(t).map(o=>wO(o,t[o],e,r))}Bo.convertPatternGroupsToTasks=IO;function wO(t,e,r,o){return{dynamic:o,positive:e,negative:r,base:t,patterns:[].concat(e,r.map(Kc.pattern.convertToNegativePattern))}}Bo.convertPatternGroupToTask=wO});var qie=_(YS=>{"use strict";Object.defineProperty(YS,"__esModule",{value:!0});YS.read=void 0;function R$e(t,e,r){e.fs.lstat(t,(o,a)=>{if(o!==null){Hie(r,o);return}if(!a.isSymbolicLink()||!e.followSymbolicLink){BO(r,a);return}e.fs.stat(t,(n,u)=>{if(n!==null){if(e.throwErrorOnBrokenSymbolicLink){Hie(r,n);return}BO(r,a);return}e.markSymbolicLink&&(u.isSymbolicLink=()=>!0),BO(r,u)})})}YS.read=R$e;function Hie(t,e){t(e)}function BO(t,e){t(null,e)}});var jie=_(KS=>{"use strict";Object.defineProperty(KS,"__esModule",{value:!0});KS.read=void 0;function T$e(t,e){let r=e.fs.lstatSync(t);if(!r.isSymbolicLink()||!e.followSymbolicLink)return r;try{let o=e.fs.statSync(t);return e.markSymbolicLink&&(o.isSymbolicLink=()=>!0),o}catch(o){if(!e.throwErrorOnBrokenSymbolicLink)return r;throw o}}KS.read=T$e});var Gie=_(th=>{"use strict";Object.defineProperty(th,"__esModule",{value:!0});th.createFileSystemAdapter=th.FILE_SYSTEM_ADAPTER=void 0;var VS=ve("fs");th.FILE_SYSTEM_ADAPTER={lstat:VS.lstat,stat:VS.stat,lstatSync:VS.lstatSync,statSync:VS.statSync};function L$e(t){return t===void 0?th.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},th.FILE_SYSTEM_ADAPTER),t)}th.createFileSystemAdapter=L$e});var Wie=_(DO=>{"use strict";Object.defineProperty(DO,"__esModule",{value:!0});var N$e=Gie(),vO=class{constructor(e={}){this._options=e,this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,!0),this.fs=N$e.createFileSystemAdapter(this._options.fs),this.markSymbolicLink=this._getValue(this._options.markSymbolicLink,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0)}_getValue(e,r){return e??r}};DO.default=vO});var wg=_(rh=>{"use strict";Object.defineProperty(rh,"__esModule",{value:!0});rh.statSync=rh.stat=rh.Settings=void 0;var Yie=qie(),O$e=jie(),PO=Wie();rh.Settings=PO.default;function M$e(t,e,r){if(typeof e=="function"){Yie.read(t,SO(),e);return}Yie.read(t,SO(e),r)}rh.stat=M$e;function U$e(t,e){let r=SO(e);return O$e.read(t,r)}rh.statSync=U$e;function SO(t={}){return t instanceof PO.default?t:new PO.default(t)}});var zie=_((BTt,Vie)=>{var Kie;Vie.exports=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:global):t=>(Kie||(Kie=Promise.resolve())).then(t).catch(e=>setTimeout(()=>{throw e},0))});var Xie=_((vTt,Jie)=>{Jie.exports=H$e;var _$e=zie();function H$e(t,e){let r,o,a,n=!0;Array.isArray(t)?(r=[],o=t.length):(a=Object.keys(t),r={},o=a.length);function u(p){function h(){e&&e(p,r),e=null}n?_$e(h):h()}function A(p,h,E){r[p]=E,(--o===0||h)&&u(h)}o?a?a.forEach(function(p){t[p](function(h,E){A(p,h,E)})}):t.forEach(function(p,h){p(function(E,w){A(h,E,w)})}):u(null),n=!1}});var xO=_(JS=>{"use strict";Object.defineProperty(JS,"__esModule",{value:!0});JS.IS_SUPPORT_READDIR_WITH_FILE_TYPES=void 0;var zS=process.versions.node.split(".");if(zS[0]===void 0||zS[1]===void 0)throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);var Zie=Number.parseInt(zS[0],10),q$e=Number.parseInt(zS[1],10),$ie=10,j$e=10,G$e=Zie>$ie,W$e=Zie===$ie&&q$e>=j$e;JS.IS_SUPPORT_READDIR_WITH_FILE_TYPES=G$e||W$e});var ese=_(XS=>{"use strict";Object.defineProperty(XS,"__esModule",{value:!0});XS.createDirentFromStats=void 0;var bO=class{constructor(e,r){this.name=e,this.isBlockDevice=r.isBlockDevice.bind(r),this.isCharacterDevice=r.isCharacterDevice.bind(r),this.isDirectory=r.isDirectory.bind(r),this.isFIFO=r.isFIFO.bind(r),this.isFile=r.isFile.bind(r),this.isSocket=r.isSocket.bind(r),this.isSymbolicLink=r.isSymbolicLink.bind(r)}};function Y$e(t,e){return new bO(t,e)}XS.createDirentFromStats=Y$e});var kO=_(ZS=>{"use strict";Object.defineProperty(ZS,"__esModule",{value:!0});ZS.fs=void 0;var K$e=ese();ZS.fs=K$e});var QO=_($S=>{"use strict";Object.defineProperty($S,"__esModule",{value:!0});$S.joinPathSegments=void 0;function V$e(t,e,r){return t.endsWith(r)?t+e:t+r+e}$S.joinPathSegments=V$e});var ose=_(nh=>{"use strict";Object.defineProperty(nh,"__esModule",{value:!0});nh.readdir=nh.readdirWithFileTypes=nh.read=void 0;var z$e=wg(),tse=Xie(),J$e=xO(),rse=kO(),nse=QO();function X$e(t,e,r){if(!e.stats&&J$e.IS_SUPPORT_READDIR_WITH_FILE_TYPES){ise(t,e,r);return}sse(t,e,r)}nh.read=X$e;function ise(t,e,r){e.fs.readdir(t,{withFileTypes:!0},(o,a)=>{if(o!==null){ex(r,o);return}let n=a.map(A=>({dirent:A,name:A.name,path:nse.joinPathSegments(t,A.name,e.pathSegmentSeparator)}));if(!e.followSymbolicLinks){FO(r,n);return}let u=n.map(A=>Z$e(A,e));tse(u,(A,p)=>{if(A!==null){ex(r,A);return}FO(r,p)})})}nh.readdirWithFileTypes=ise;function Z$e(t,e){return r=>{if(!t.dirent.isSymbolicLink()){r(null,t);return}e.fs.stat(t.path,(o,a)=>{if(o!==null){if(e.throwErrorOnBrokenSymbolicLink){r(o);return}r(null,t);return}t.dirent=rse.fs.createDirentFromStats(t.name,a),r(null,t)})}}function sse(t,e,r){e.fs.readdir(t,(o,a)=>{if(o!==null){ex(r,o);return}let n=a.map(u=>{let A=nse.joinPathSegments(t,u,e.pathSegmentSeparator);return p=>{z$e.stat(A,e.fsStatSettings,(h,E)=>{if(h!==null){p(h);return}let w={name:u,path:A,dirent:rse.fs.createDirentFromStats(u,E)};e.stats&&(w.stats=E),p(null,w)})}});tse(n,(u,A)=>{if(u!==null){ex(r,u);return}FO(r,A)})})}nh.readdir=sse;function ex(t,e){t(e)}function FO(t,e){t(null,e)}});var Ase=_(ih=>{"use strict";Object.defineProperty(ih,"__esModule",{value:!0});ih.readdir=ih.readdirWithFileTypes=ih.read=void 0;var $$e=wg(),eet=xO(),ase=kO(),lse=QO();function tet(t,e){return!e.stats&&eet.IS_SUPPORT_READDIR_WITH_FILE_TYPES?cse(t,e):use(t,e)}ih.read=tet;function cse(t,e){return e.fs.readdirSync(t,{withFileTypes:!0}).map(o=>{let a={dirent:o,name:o.name,path:lse.joinPathSegments(t,o.name,e.pathSegmentSeparator)};if(a.dirent.isSymbolicLink()&&e.followSymbolicLinks)try{let n=e.fs.statSync(a.path);a.dirent=ase.fs.createDirentFromStats(a.name,n)}catch(n){if(e.throwErrorOnBrokenSymbolicLink)throw n}return a})}ih.readdirWithFileTypes=cse;function use(t,e){return e.fs.readdirSync(t).map(o=>{let a=lse.joinPathSegments(t,o,e.pathSegmentSeparator),n=$$e.statSync(a,e.fsStatSettings),u={name:o,path:a,dirent:ase.fs.createDirentFromStats(o,n)};return e.stats&&(u.stats=n),u})}ih.readdir=use});var fse=_(sh=>{"use strict";Object.defineProperty(sh,"__esModule",{value:!0});sh.createFileSystemAdapter=sh.FILE_SYSTEM_ADAPTER=void 0;var iy=ve("fs");sh.FILE_SYSTEM_ADAPTER={lstat:iy.lstat,stat:iy.stat,lstatSync:iy.lstatSync,statSync:iy.statSync,readdir:iy.readdir,readdirSync:iy.readdirSync};function ret(t){return t===void 0?sh.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},sh.FILE_SYSTEM_ADAPTER),t)}sh.createFileSystemAdapter=ret});var pse=_(TO=>{"use strict";Object.defineProperty(TO,"__esModule",{value:!0});var net=ve("path"),iet=wg(),set=fse(),RO=class{constructor(e={}){this._options=e,this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!1),this.fs=set.createFileSystemAdapter(this._options.fs),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,net.sep),this.stats=this._getValue(this._options.stats,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0),this.fsStatSettings=new iet.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(e,r){return e??r}};TO.default=RO});var tx=_(oh=>{"use strict";Object.defineProperty(oh,"__esModule",{value:!0});oh.Settings=oh.scandirSync=oh.scandir=void 0;var hse=ose(),oet=Ase(),LO=pse();oh.Settings=LO.default;function aet(t,e,r){if(typeof e=="function"){hse.read(t,NO(),e);return}hse.read(t,NO(e),r)}oh.scandir=aet;function cet(t,e){let r=NO(e);return oet.read(t,r)}oh.scandirSync=cet;function NO(t={}){return t instanceof LO.default?t:new LO.default(t)}});var dse=_((TTt,gse)=>{"use strict";function uet(t){var e=new t,r=e;function o(){var n=e;return n.next?e=n.next:(e=new t,r=e),n.next=null,n}function a(n){r.next=n,r=n}return{get:o,release:a}}gse.exports=uet});var yse=_((LTt,OO)=>{"use strict";var Aet=dse();function mse(t,e,r){if(typeof t=="function"&&(r=e,e=t,t=null),!(r>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");var o=Aet(fet),a=null,n=null,u=0,A=null,p={push:T,drain:Yl,saturated:Yl,pause:E,paused:!1,get concurrency(){return r},set concurrency(ce){if(!(ce>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");if(r=ce,!p.paused)for(;a&&u=r||p.paused?n?(n.next=Ie,n=Ie):(a=Ie,n=Ie,p.saturated()):(u++,e.call(t,Ie.value,Ie.worked))}function N(ce,ue){var Ie=o.get();Ie.context=t,Ie.release=U,Ie.value=ce,Ie.callback=ue||Yl,Ie.errorHandler=A,u>=r||p.paused?a?(Ie.next=a,a=Ie):(a=Ie,n=Ie,p.saturated()):(u++,e.call(t,Ie.value,Ie.worked))}function U(ce){ce&&o.release(ce);var ue=a;ue&&u<=r?p.paused?u--:(n===a&&(n=null),a=ue.next,ue.next=null,e.call(t,ue.value,ue.worked),n===null&&p.empty()):--u===0&&p.drain()}function z(){a=null,n=null,p.drain=Yl}function te(){a=null,n=null,p.drain(),p.drain=Yl}function le(ce){A=ce}}function Yl(){}function fet(){this.value=null,this.callback=Yl,this.next=null,this.release=Yl,this.context=null,this.errorHandler=null;var t=this;this.worked=function(r,o){var a=t.callback,n=t.errorHandler,u=t.value;t.value=null,t.callback=Yl,t.errorHandler&&n(r,u),a.call(t.context,r,o),t.release(t)}}function pet(t,e,r){typeof t=="function"&&(r=e,e=t,t=null);function o(E,w){e.call(this,E).then(function(D){w(null,D)},w)}var a=mse(t,o,r),n=a.push,u=a.unshift;return a.push=A,a.unshift=p,a.drained=h,a;function A(E){var w=new Promise(function(D,b){n(E,function(C,T){if(C){b(C);return}D(T)})});return w.catch(Yl),w}function p(E){var w=new Promise(function(D,b){u(E,function(C,T){if(C){b(C);return}D(T)})});return w.catch(Yl),w}function h(){if(a.idle())return new Promise(function(D){D()});var E=a.drain,w=new Promise(function(D){a.drain=function(){E(),D()}});return w}}OO.exports=mse;OO.exports.promise=pet});var rx=_(eA=>{"use strict";Object.defineProperty(eA,"__esModule",{value:!0});eA.joinPathSegments=eA.replacePathSegmentSeparator=eA.isAppliedFilter=eA.isFatalError=void 0;function het(t,e){return t.errorFilter===null?!0:!t.errorFilter(e)}eA.isFatalError=het;function get(t,e){return t===null||t(e)}eA.isAppliedFilter=get;function det(t,e){return t.split(/[/\\]/).join(e)}eA.replacePathSegmentSeparator=det;function met(t,e,r){return t===""?e:t.endsWith(r)?t+e:t+r+e}eA.joinPathSegments=met});var _O=_(UO=>{"use strict";Object.defineProperty(UO,"__esModule",{value:!0});var yet=rx(),MO=class{constructor(e,r){this._root=e,this._settings=r,this._root=yet.replacePathSegmentSeparator(e,r.pathSegmentSeparator)}};UO.default=MO});var jO=_(qO=>{"use strict";Object.defineProperty(qO,"__esModule",{value:!0});var Eet=ve("events"),Cet=tx(),Iet=yse(),nx=rx(),wet=_O(),HO=class extends wet.default{constructor(e,r){super(e,r),this._settings=r,this._scandir=Cet.scandir,this._emitter=new Eet.EventEmitter,this._queue=Iet(this._worker.bind(this),this._settings.concurrency),this._isFatalError=!1,this._isDestroyed=!1,this._queue.drain=()=>{this._isFatalError||this._emitter.emit("end")}}read(){return this._isFatalError=!1,this._isDestroyed=!1,setImmediate(()=>{this._pushToQueue(this._root,this._settings.basePath)}),this._emitter}get isDestroyed(){return this._isDestroyed}destroy(){if(this._isDestroyed)throw new Error("The reader is already destroyed");this._isDestroyed=!0,this._queue.killAndDrain()}onEntry(e){this._emitter.on("entry",e)}onError(e){this._emitter.once("error",e)}onEnd(e){this._emitter.once("end",e)}_pushToQueue(e,r){let o={directory:e,base:r};this._queue.push(o,a=>{a!==null&&this._handleError(a)})}_worker(e,r){this._scandir(e.directory,this._settings.fsScandirSettings,(o,a)=>{if(o!==null){r(o,void 0);return}for(let n of a)this._handleEntry(n,e.base);r(null,void 0)})}_handleError(e){this._isDestroyed||!nx.isFatalError(this._settings,e)||(this._isFatalError=!0,this._isDestroyed=!0,this._emitter.emit("error",e))}_handleEntry(e,r){if(this._isDestroyed||this._isFatalError)return;let o=e.path;r!==void 0&&(e.path=nx.joinPathSegments(r,e.name,this._settings.pathSegmentSeparator)),nx.isAppliedFilter(this._settings.entryFilter,e)&&this._emitEntry(e),e.dirent.isDirectory()&&nx.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(o,r===void 0?void 0:e.path)}_emitEntry(e){this._emitter.emit("entry",e)}};qO.default=HO});var Ese=_(WO=>{"use strict";Object.defineProperty(WO,"__esModule",{value:!0});var Bet=jO(),GO=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new Bet.default(this._root,this._settings),this._storage=[]}read(e){this._reader.onError(r=>{vet(e,r)}),this._reader.onEntry(r=>{this._storage.push(r)}),this._reader.onEnd(()=>{Det(e,this._storage)}),this._reader.read()}};WO.default=GO;function vet(t,e){t(e)}function Det(t,e){t(null,e)}});var Cse=_(KO=>{"use strict";Object.defineProperty(KO,"__esModule",{value:!0});var Pet=ve("stream"),xet=jO(),YO=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new xet.default(this._root,this._settings),this._stream=new Pet.Readable({objectMode:!0,read:()=>{},destroy:()=>{this._reader.isDestroyed||this._reader.destroy()}})}read(){return this._reader.onError(e=>{this._stream.emit("error",e)}),this._reader.onEntry(e=>{this._stream.push(e)}),this._reader.onEnd(()=>{this._stream.push(null)}),this._reader.read(),this._stream}};KO.default=YO});var Ise=_(zO=>{"use strict";Object.defineProperty(zO,"__esModule",{value:!0});var bet=tx(),ix=rx(),ket=_O(),VO=class extends ket.default{constructor(){super(...arguments),this._scandir=bet.scandirSync,this._storage=[],this._queue=new Set}read(){return this._pushToQueue(this._root,this._settings.basePath),this._handleQueue(),this._storage}_pushToQueue(e,r){this._queue.add({directory:e,base:r})}_handleQueue(){for(let e of this._queue.values())this._handleDirectory(e.directory,e.base)}_handleDirectory(e,r){try{let o=this._scandir(e,this._settings.fsScandirSettings);for(let a of o)this._handleEntry(a,r)}catch(o){this._handleError(o)}}_handleError(e){if(ix.isFatalError(this._settings,e))throw e}_handleEntry(e,r){let o=e.path;r!==void 0&&(e.path=ix.joinPathSegments(r,e.name,this._settings.pathSegmentSeparator)),ix.isAppliedFilter(this._settings.entryFilter,e)&&this._pushToStorage(e),e.dirent.isDirectory()&&ix.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(o,r===void 0?void 0:e.path)}_pushToStorage(e){this._storage.push(e)}};zO.default=VO});var wse=_(XO=>{"use strict";Object.defineProperty(XO,"__esModule",{value:!0});var Qet=Ise(),JO=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new Qet.default(this._root,this._settings)}read(){return this._reader.read()}};XO.default=JO});var Bse=_($O=>{"use strict";Object.defineProperty($O,"__esModule",{value:!0});var Fet=ve("path"),Ret=tx(),ZO=class{constructor(e={}){this._options=e,this.basePath=this._getValue(this._options.basePath,void 0),this.concurrency=this._getValue(this._options.concurrency,Number.POSITIVE_INFINITY),this.deepFilter=this._getValue(this._options.deepFilter,null),this.entryFilter=this._getValue(this._options.entryFilter,null),this.errorFilter=this._getValue(this._options.errorFilter,null),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,Fet.sep),this.fsScandirSettings=new Ret.Settings({followSymbolicLinks:this._options.followSymbolicLinks,fs:this._options.fs,pathSegmentSeparator:this._options.pathSegmentSeparator,stats:this._options.stats,throwErrorOnBrokenSymbolicLink:this._options.throwErrorOnBrokenSymbolicLink})}_getValue(e,r){return e??r}};$O.default=ZO});var ox=_(tA=>{"use strict";Object.defineProperty(tA,"__esModule",{value:!0});tA.Settings=tA.walkStream=tA.walkSync=tA.walk=void 0;var vse=Ese(),Tet=Cse(),Let=wse(),eM=Bse();tA.Settings=eM.default;function Net(t,e,r){if(typeof e=="function"){new vse.default(t,sx()).read(e);return}new vse.default(t,sx(e)).read(r)}tA.walk=Net;function Oet(t,e){let r=sx(e);return new Let.default(t,r).read()}tA.walkSync=Oet;function Met(t,e){let r=sx(e);return new Tet.default(t,r).read()}tA.walkStream=Met;function sx(t={}){return t instanceof eM.default?t:new eM.default(t)}});var ax=_(rM=>{"use strict";Object.defineProperty(rM,"__esModule",{value:!0});var Uet=ve("path"),_et=wg(),Dse=Df(),tM=class{constructor(e){this._settings=e,this._fsStatSettings=new _et.Settings({followSymbolicLink:this._settings.followSymbolicLinks,fs:this._settings.fs,throwErrorOnBrokenSymbolicLink:this._settings.followSymbolicLinks})}_getFullEntryPath(e){return Uet.resolve(this._settings.cwd,e)}_makeEntry(e,r){let o={name:r,path:r,dirent:Dse.fs.createDirentFromStats(r,e)};return this._settings.stats&&(o.stats=e),o}_isFatalError(e){return!Dse.errno.isEnoentCodeError(e)&&!this._settings.suppressErrors}};rM.default=tM});var sM=_(iM=>{"use strict";Object.defineProperty(iM,"__esModule",{value:!0});var Het=ve("stream"),qet=wg(),jet=ox(),Get=ax(),nM=class extends Get.default{constructor(){super(...arguments),this._walkStream=jet.walkStream,this._stat=qet.stat}dynamic(e,r){return this._walkStream(e,r)}static(e,r){let o=e.map(this._getFullEntryPath,this),a=new Het.PassThrough({objectMode:!0});a._write=(n,u,A)=>this._getEntry(o[n],e[n],r).then(p=>{p!==null&&r.entryFilter(p)&&a.push(p),n===o.length-1&&a.end(),A()}).catch(A);for(let n=0;nthis._makeEntry(a,r)).catch(a=>{if(o.errorFilter(a))return null;throw a})}_getStat(e){return new Promise((r,o)=>{this._stat(e,this._fsStatSettings,(a,n)=>a===null?r(n):o(a))})}};iM.default=nM});var Pse=_(aM=>{"use strict";Object.defineProperty(aM,"__esModule",{value:!0});var Wet=ox(),Yet=ax(),Ket=sM(),oM=class extends Yet.default{constructor(){super(...arguments),this._walkAsync=Wet.walk,this._readerStream=new Ket.default(this._settings)}dynamic(e,r){return new Promise((o,a)=>{this._walkAsync(e,r,(n,u)=>{n===null?o(u):a(n)})})}async static(e,r){let o=[],a=this._readerStream.static(e,r);return new Promise((n,u)=>{a.once("error",u),a.on("data",A=>o.push(A)),a.once("end",()=>n(o))})}};aM.default=oM});var Sse=_(cM=>{"use strict";Object.defineProperty(cM,"__esModule",{value:!0});var m1=Df(),lM=class{constructor(e,r,o){this._patterns=e,this._settings=r,this._micromatchOptions=o,this._storage=[],this._fillStorage()}_fillStorage(){for(let e of this._patterns){let r=this._getPatternSegments(e),o=this._splitSegmentsIntoSections(r);this._storage.push({complete:o.length<=1,pattern:e,segments:r,sections:o})}}_getPatternSegments(e){return m1.pattern.getPatternParts(e,this._micromatchOptions).map(o=>m1.pattern.isDynamicPattern(o,this._settings)?{dynamic:!0,pattern:o,patternRe:m1.pattern.makeRe(o,this._micromatchOptions)}:{dynamic:!1,pattern:o})}_splitSegmentsIntoSections(e){return m1.array.splitWhen(e,r=>r.dynamic&&m1.pattern.hasGlobStar(r.pattern))}};cM.default=lM});var xse=_(AM=>{"use strict";Object.defineProperty(AM,"__esModule",{value:!0});var Vet=Sse(),uM=class extends Vet.default{match(e){let r=e.split("/"),o=r.length,a=this._storage.filter(n=>!n.complete||n.segments.length>o);for(let n of a){let u=n.sections[0];if(!n.complete&&o>u.length||r.every((p,h)=>{let E=n.segments[h];return!!(E.dynamic&&E.patternRe.test(p)||!E.dynamic&&E.pattern===p)}))return!0}return!1}};AM.default=uM});var bse=_(pM=>{"use strict";Object.defineProperty(pM,"__esModule",{value:!0});var lx=Df(),zet=xse(),fM=class{constructor(e,r){this._settings=e,this._micromatchOptions=r}getFilter(e,r,o){let a=this._getMatcher(r),n=this._getNegativePatternsRe(o);return u=>this._filter(e,u,a,n)}_getMatcher(e){return new zet.default(e,this._settings,this._micromatchOptions)}_getNegativePatternsRe(e){let r=e.filter(lx.pattern.isAffectDepthOfReadingPattern);return lx.pattern.convertPatternsToRe(r,this._micromatchOptions)}_filter(e,r,o,a){if(this._isSkippedByDeep(e,r.path)||this._isSkippedSymbolicLink(r))return!1;let n=lx.path.removeLeadingDotSegment(r.path);return this._isSkippedByPositivePatterns(n,o)?!1:this._isSkippedByNegativePatterns(n,a)}_isSkippedByDeep(e,r){return this._settings.deep===1/0?!1:this._getEntryLevel(e,r)>=this._settings.deep}_getEntryLevel(e,r){let o=r.split("/").length;if(e==="")return o;let a=e.split("/").length;return o-a}_isSkippedSymbolicLink(e){return!this._settings.followSymbolicLinks&&e.dirent.isSymbolicLink()}_isSkippedByPositivePatterns(e,r){return!this._settings.baseNameMatch&&!r.match(e)}_isSkippedByNegativePatterns(e,r){return!lx.pattern.matchAny(e,r)}};pM.default=fM});var kse=_(gM=>{"use strict";Object.defineProperty(gM,"__esModule",{value:!0});var Bg=Df(),hM=class{constructor(e,r){this._settings=e,this._micromatchOptions=r,this.index=new Map}getFilter(e,r){let o=Bg.pattern.convertPatternsToRe(e,this._micromatchOptions),a=Bg.pattern.convertPatternsToRe(r,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0}));return n=>this._filter(n,o,a)}_filter(e,r,o){let a=Bg.path.removeLeadingDotSegment(e.path);if(this._settings.unique&&this._isDuplicateEntry(a)||this._onlyFileFilter(e)||this._onlyDirectoryFilter(e)||this._isSkippedByAbsoluteNegativePatterns(a,o))return!1;let n=e.dirent.isDirectory(),u=this._isMatchToPatterns(a,r,n)&&!this._isMatchToPatterns(a,o,n);return this._settings.unique&&u&&this._createIndexRecord(a),u}_isDuplicateEntry(e){return this.index.has(e)}_createIndexRecord(e){this.index.set(e,void 0)}_onlyFileFilter(e){return this._settings.onlyFiles&&!e.dirent.isFile()}_onlyDirectoryFilter(e){return this._settings.onlyDirectories&&!e.dirent.isDirectory()}_isSkippedByAbsoluteNegativePatterns(e,r){if(!this._settings.absolute)return!1;let o=Bg.path.makeAbsolute(this._settings.cwd,e);return Bg.pattern.matchAny(o,r)}_isMatchToPatterns(e,r,o){let a=Bg.pattern.matchAny(e,r);return!a&&o?Bg.pattern.matchAny(e+"/",r):a}};gM.default=hM});var Qse=_(mM=>{"use strict";Object.defineProperty(mM,"__esModule",{value:!0});var Jet=Df(),dM=class{constructor(e){this._settings=e}getFilter(){return e=>this._isNonFatalError(e)}_isNonFatalError(e){return Jet.errno.isEnoentCodeError(e)||this._settings.suppressErrors}};mM.default=dM});var Rse=_(EM=>{"use strict";Object.defineProperty(EM,"__esModule",{value:!0});var Fse=Df(),yM=class{constructor(e){this._settings=e}getTransformer(){return e=>this._transform(e)}_transform(e){let r=e.path;return this._settings.absolute&&(r=Fse.path.makeAbsolute(this._settings.cwd,r),r=Fse.path.unixify(r)),this._settings.markDirectories&&e.dirent.isDirectory()&&(r+="/"),this._settings.objectMode?Object.assign(Object.assign({},e),{path:r}):r}};EM.default=yM});var cx=_(IM=>{"use strict";Object.defineProperty(IM,"__esModule",{value:!0});var Xet=ve("path"),Zet=bse(),$et=kse(),ett=Qse(),ttt=Rse(),CM=class{constructor(e){this._settings=e,this.errorFilter=new ett.default(this._settings),this.entryFilter=new $et.default(this._settings,this._getMicromatchOptions()),this.deepFilter=new Zet.default(this._settings,this._getMicromatchOptions()),this.entryTransformer=new ttt.default(this._settings)}_getRootDirectory(e){return Xet.resolve(this._settings.cwd,e.base)}_getReaderOptions(e){let r=e.base==="."?"":e.base;return{basePath:r,pathSegmentSeparator:"/",concurrency:this._settings.concurrency,deepFilter:this.deepFilter.getFilter(r,e.positive,e.negative),entryFilter:this.entryFilter.getFilter(e.positive,e.negative),errorFilter:this.errorFilter.getFilter(),followSymbolicLinks:this._settings.followSymbolicLinks,fs:this._settings.fs,stats:this._settings.stats,throwErrorOnBrokenSymbolicLink:this._settings.throwErrorOnBrokenSymbolicLink,transform:this.entryTransformer.getTransformer()}}_getMicromatchOptions(){return{dot:this._settings.dot,matchBase:this._settings.baseNameMatch,nobrace:!this._settings.braceExpansion,nocase:!this._settings.caseSensitiveMatch,noext:!this._settings.extglob,noglobstar:!this._settings.globstar,posix:!0,strictSlashes:!1}}};IM.default=CM});var Tse=_(BM=>{"use strict";Object.defineProperty(BM,"__esModule",{value:!0});var rtt=Pse(),ntt=cx(),wM=class extends ntt.default{constructor(){super(...arguments),this._reader=new rtt.default(this._settings)}async read(e){let r=this._getRootDirectory(e),o=this._getReaderOptions(e);return(await this.api(r,e,o)).map(n=>o.transform(n))}api(e,r,o){return r.dynamic?this._reader.dynamic(e,o):this._reader.static(r.patterns,o)}};BM.default=wM});var Lse=_(DM=>{"use strict";Object.defineProperty(DM,"__esModule",{value:!0});var itt=ve("stream"),stt=sM(),ott=cx(),vM=class extends ott.default{constructor(){super(...arguments),this._reader=new stt.default(this._settings)}read(e){let r=this._getRootDirectory(e),o=this._getReaderOptions(e),a=this.api(r,e,o),n=new itt.Readable({objectMode:!0,read:()=>{}});return a.once("error",u=>n.emit("error",u)).on("data",u=>n.emit("data",o.transform(u))).once("end",()=>n.emit("end")),n.once("close",()=>a.destroy()),n}api(e,r,o){return r.dynamic?this._reader.dynamic(e,o):this._reader.static(r.patterns,o)}};DM.default=vM});var Nse=_(SM=>{"use strict";Object.defineProperty(SM,"__esModule",{value:!0});var att=wg(),ltt=ox(),ctt=ax(),PM=class extends ctt.default{constructor(){super(...arguments),this._walkSync=ltt.walkSync,this._statSync=att.statSync}dynamic(e,r){return this._walkSync(e,r)}static(e,r){let o=[];for(let a of e){let n=this._getFullEntryPath(a),u=this._getEntry(n,a,r);u===null||!r.entryFilter(u)||o.push(u)}return o}_getEntry(e,r,o){try{let a=this._getStat(e);return this._makeEntry(a,r)}catch(a){if(o.errorFilter(a))return null;throw a}}_getStat(e){return this._statSync(e,this._fsStatSettings)}};SM.default=PM});var Ose=_(bM=>{"use strict";Object.defineProperty(bM,"__esModule",{value:!0});var utt=Nse(),Att=cx(),xM=class extends Att.default{constructor(){super(...arguments),this._reader=new utt.default(this._settings)}read(e){let r=this._getRootDirectory(e),o=this._getReaderOptions(e);return this.api(r,e,o).map(o.transform)}api(e,r,o){return r.dynamic?this._reader.dynamic(e,o):this._reader.static(r.patterns,o)}};bM.default=xM});var Mse=_(oy=>{"use strict";Object.defineProperty(oy,"__esModule",{value:!0});oy.DEFAULT_FILE_SYSTEM_ADAPTER=void 0;var sy=ve("fs"),ftt=ve("os"),ptt=Math.max(ftt.cpus().length,1);oy.DEFAULT_FILE_SYSTEM_ADAPTER={lstat:sy.lstat,lstatSync:sy.lstatSync,stat:sy.stat,statSync:sy.statSync,readdir:sy.readdir,readdirSync:sy.readdirSync};var kM=class{constructor(e={}){this._options=e,this.absolute=this._getValue(this._options.absolute,!1),this.baseNameMatch=this._getValue(this._options.baseNameMatch,!1),this.braceExpansion=this._getValue(this._options.braceExpansion,!0),this.caseSensitiveMatch=this._getValue(this._options.caseSensitiveMatch,!0),this.concurrency=this._getValue(this._options.concurrency,ptt),this.cwd=this._getValue(this._options.cwd,process.cwd()),this.deep=this._getValue(this._options.deep,1/0),this.dot=this._getValue(this._options.dot,!1),this.extglob=this._getValue(this._options.extglob,!0),this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!0),this.fs=this._getFileSystemMethods(this._options.fs),this.globstar=this._getValue(this._options.globstar,!0),this.ignore=this._getValue(this._options.ignore,[]),this.markDirectories=this._getValue(this._options.markDirectories,!1),this.objectMode=this._getValue(this._options.objectMode,!1),this.onlyDirectories=this._getValue(this._options.onlyDirectories,!1),this.onlyFiles=this._getValue(this._options.onlyFiles,!0),this.stats=this._getValue(this._options.stats,!1),this.suppressErrors=this._getValue(this._options.suppressErrors,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!1),this.unique=this._getValue(this._options.unique,!0),this.onlyDirectories&&(this.onlyFiles=!1),this.stats&&(this.objectMode=!0),this.ignore=[].concat(this.ignore)}_getValue(e,r){return e===void 0?r:e}_getFileSystemMethods(e={}){return Object.assign(Object.assign({},oy.DEFAULT_FILE_SYSTEM_ADAPTER),e)}};oy.default=kM});var ux=_((oLt,_se)=>{"use strict";var Use=_ie(),htt=Tse(),gtt=Lse(),dtt=Ose(),QM=Mse(),Kl=Df();async function FM(t,e){Vc(t);let r=RM(t,htt.default,e),o=await Promise.all(r);return Kl.array.flatten(o)}(function(t){t.glob=t,t.globSync=e,t.globStream=r,t.async=t;function e(h,E){Vc(h);let w=RM(h,dtt.default,E);return Kl.array.flatten(w)}t.sync=e;function r(h,E){Vc(h);let w=RM(h,gtt.default,E);return Kl.stream.merge(w)}t.stream=r;function o(h,E){Vc(h);let w=[].concat(h),D=new QM.default(E);return Use.generate(w,D)}t.generateTasks=o;function a(h,E){Vc(h);let w=new QM.default(E);return Kl.pattern.isDynamicPattern(h,w)}t.isDynamicPattern=a;function n(h){return Vc(h),Kl.path.escape(h)}t.escapePath=n;function u(h){return Vc(h),Kl.path.convertPathToPattern(h)}t.convertPathToPattern=u;let A;(function(h){function E(D){return Vc(D),Kl.path.escapePosixPath(D)}h.escapePath=E;function w(D){return Vc(D),Kl.path.convertPosixPathToPattern(D)}h.convertPathToPattern=w})(A=t.posix||(t.posix={}));let p;(function(h){function E(D){return Vc(D),Kl.path.escapeWindowsPath(D)}h.escapePath=E;function w(D){return Vc(D),Kl.path.convertWindowsPathToPattern(D)}h.convertPathToPattern=w})(p=t.win32||(t.win32={}))})(FM||(FM={}));function RM(t,e,r){let o=[].concat(t),a=new QM.default(r),n=Use.generate(o,a),u=new e(a);return n.map(u.read,u)}function Vc(t){if(![].concat(t).every(o=>Kl.string.isString(o)&&!Kl.string.isEmpty(o)))throw new TypeError("Patterns must be a string (non empty) or an array of strings")}_se.exports=FM});var bn={};Kt(bn,{checksumFile:()=>fx,checksumPattern:()=>px,makeHash:()=>zi});function zi(...t){let e=(0,Ax.createHash)("sha512"),r="";for(let o of t)typeof o=="string"?r+=o:o&&(r&&(e.update(r),r=""),e.update(o));return r&&e.update(r),e.digest("hex")}async function fx(t,{baseFs:e,algorithm:r}={baseFs:ae,algorithm:"sha512"}){let o=await e.openPromise(t,"r");try{let n=Buffer.allocUnsafeSlow(65536),u=(0,Ax.createHash)(r),A=0;for(;(A=await e.readPromise(o,n,0,65536))!==0;)u.update(A===65536?n:n.slice(0,A));return u.digest("hex")}finally{await e.closePromise(o)}}async function px(t,{cwd:e}){let o=(await(0,TM.default)(t,{cwd:Ae.fromPortablePath(e),onlyDirectories:!0})).map(A=>`${A}/**/*`),a=await(0,TM.default)([t,...o],{cwd:Ae.fromPortablePath(e),onlyFiles:!1});a.sort();let n=await Promise.all(a.map(async A=>{let p=[Buffer.from(A)],h=K.join(e,Ae.toPortablePath(A)),E=await ae.lstatPromise(h);return E.isSymbolicLink()?p.push(Buffer.from(await ae.readlinkPromise(h))):E.isFile()&&p.push(await ae.readFilePromise(h)),p.join("\0")})),u=(0,Ax.createHash)("sha512");for(let A of n)u.update(A);return u.digest("hex")}var Ax,TM,ah=It(()=>{Pt();Ax=ve("crypto"),TM=et(ux())});var G={};Kt(G,{allPeerRequests:()=>S1,areDescriptorsEqual:()=>Wse,areIdentsEqual:()=>w1,areLocatorsEqual:()=>B1,areVirtualPackagesEquivalent:()=>Dtt,bindDescriptor:()=>Btt,bindLocator:()=>vtt,convertDescriptorToLocator:()=>hx,convertLocatorToDescriptor:()=>NM,convertPackageToLocator:()=>Ctt,convertToIdent:()=>Ett,convertToManifestRange:()=>Ltt,copyPackage:()=>E1,devirtualizeDescriptor:()=>C1,devirtualizeLocator:()=>I1,ensureDevirtualizedDescriptor:()=>Itt,ensureDevirtualizedLocator:()=>wtt,getIdentVendorPath:()=>_M,isPackageCompatible:()=>Ex,isVirtualDescriptor:()=>Pf,isVirtualLocator:()=>zc,makeDescriptor:()=>kn,makeIdent:()=>rA,makeLocator:()=>Ss,makeRange:()=>mx,parseDescriptor:()=>lh,parseFileStyleRange:()=>Rtt,parseIdent:()=>Zo,parseLocator:()=>Sf,parseRange:()=>vg,prettyDependent:()=>fO,prettyDescriptor:()=>zn,prettyIdent:()=>Ui,prettyLocator:()=>jr,prettyLocatorNoColors:()=>AO,prettyRange:()=>cy,prettyReference:()=>D1,prettyResolution:()=>d1,prettyWorkspace:()=>P1,renamePackage:()=>OM,slugifyIdent:()=>LM,slugifyLocator:()=>ly,sortDescriptors:()=>uy,stringifyDescriptor:()=>ka,stringifyIdent:()=>rn,stringifyLocator:()=>Qa,tryParseDescriptor:()=>v1,tryParseIdent:()=>Yse,tryParseLocator:()=>dx,tryParseRange:()=>Ftt,virtualizeDescriptor:()=>MM,virtualizePackage:()=>UM});function rA(t,e){if(t?.startsWith("@"))throw new Error("Invalid scope: don't prefix it with '@'");return{identHash:zi(t,e),scope:t,name:e}}function kn(t,e){return{identHash:t.identHash,scope:t.scope,name:t.name,descriptorHash:zi(t.identHash,e),range:e}}function Ss(t,e){return{identHash:t.identHash,scope:t.scope,name:t.name,locatorHash:zi(t.identHash,e),reference:e}}function Ett(t){return{identHash:t.identHash,scope:t.scope,name:t.name}}function hx(t){return{identHash:t.identHash,scope:t.scope,name:t.name,locatorHash:t.descriptorHash,reference:t.range}}function NM(t){return{identHash:t.identHash,scope:t.scope,name:t.name,descriptorHash:t.locatorHash,range:t.reference}}function Ctt(t){return{identHash:t.identHash,scope:t.scope,name:t.name,locatorHash:t.locatorHash,reference:t.reference}}function OM(t,e){return{identHash:e.identHash,scope:e.scope,name:e.name,locatorHash:e.locatorHash,reference:e.reference,version:t.version,languageName:t.languageName,linkType:t.linkType,conditions:t.conditions,dependencies:new Map(t.dependencies),peerDependencies:new Map(t.peerDependencies),dependenciesMeta:new Map(t.dependenciesMeta),peerDependenciesMeta:new Map(t.peerDependenciesMeta),bin:new Map(t.bin)}}function E1(t){return OM(t,t)}function MM(t,e){if(e.includes("#"))throw new Error("Invalid entropy");return kn(t,`virtual:${e}#${t.range}`)}function UM(t,e){if(e.includes("#"))throw new Error("Invalid entropy");return OM(t,Ss(t,`virtual:${e}#${t.reference}`))}function Pf(t){return t.range.startsWith(y1)}function zc(t){return t.reference.startsWith(y1)}function C1(t){if(!Pf(t))throw new Error("Not a virtual descriptor");return kn(t,t.range.replace(gx,""))}function I1(t){if(!zc(t))throw new Error("Not a virtual descriptor");return Ss(t,t.reference.replace(gx,""))}function Itt(t){return Pf(t)?kn(t,t.range.replace(gx,"")):t}function wtt(t){return zc(t)?Ss(t,t.reference.replace(gx,"")):t}function Btt(t,e){return t.range.includes("::")?t:kn(t,`${t.range}::${ay.default.stringify(e)}`)}function vtt(t,e){return t.reference.includes("::")?t:Ss(t,`${t.reference}::${ay.default.stringify(e)}`)}function w1(t,e){return t.identHash===e.identHash}function Wse(t,e){return t.descriptorHash===e.descriptorHash}function B1(t,e){return t.locatorHash===e.locatorHash}function Dtt(t,e){if(!zc(t))throw new Error("Invalid package type");if(!zc(e))throw new Error("Invalid package type");if(!w1(t,e)||t.dependencies.size!==e.dependencies.size)return!1;for(let r of t.dependencies.values()){let o=e.dependencies.get(r.identHash);if(!o||!Wse(r,o))return!1}return!0}function Zo(t){let e=Yse(t);if(!e)throw new Error(`Invalid ident (${t})`);return e}function Yse(t){let e=t.match(Ptt);if(!e)return null;let[,r,o]=e;return rA(typeof r<"u"?r:null,o)}function lh(t,e=!1){let r=v1(t,e);if(!r)throw new Error(`Invalid descriptor (${t})`);return r}function v1(t,e=!1){let r=e?t.match(Stt):t.match(xtt);if(!r)return null;let[,o,a,n]=r;if(n==="unknown")throw new Error(`Invalid range (${t})`);let u=typeof o<"u"?o:null,A=typeof n<"u"?n:"unknown";return kn(rA(u,a),A)}function Sf(t,e=!1){let r=dx(t,e);if(!r)throw new Error(`Invalid locator (${t})`);return r}function dx(t,e=!1){let r=e?t.match(btt):t.match(ktt);if(!r)return null;let[,o,a,n]=r;if(n==="unknown")throw new Error(`Invalid reference (${t})`);let u=typeof o<"u"?o:null,A=typeof n<"u"?n:"unknown";return Ss(rA(u,a),A)}function vg(t,e){let r=t.match(Qtt);if(r===null)throw new Error(`Invalid range (${t})`);let o=typeof r[1]<"u"?r[1]:null;if(typeof e?.requireProtocol=="string"&&o!==e.requireProtocol)throw new Error(`Invalid protocol (${o})`);if(e?.requireProtocol&&o===null)throw new Error(`Missing protocol (${o})`);let a=typeof r[3]<"u"?decodeURIComponent(r[2]):null;if(e?.requireSource&&a===null)throw new Error(`Missing source (${t})`);let n=typeof r[3]<"u"?decodeURIComponent(r[3]):decodeURIComponent(r[2]),u=e?.parseSelector?ay.default.parse(n):n,A=typeof r[4]<"u"?ay.default.parse(r[4]):null;return{protocol:o,source:a,selector:u,params:A}}function Ftt(t,e){try{return vg(t,e)}catch{return null}}function Rtt(t,{protocol:e}){let{selector:r,params:o}=vg(t,{requireProtocol:e,requireBindings:!0});if(typeof o.locator!="string")throw new Error(`Assertion failed: Invalid bindings for ${t}`);return{parentLocator:Sf(o.locator,!0),path:r}}function Hse(t){return t=t.replaceAll("%","%25"),t=t.replaceAll(":","%3A"),t=t.replaceAll("#","%23"),t}function Ttt(t){return t===null?!1:Object.entries(t).length>0}function mx({protocol:t,source:e,selector:r,params:o}){let a="";return t!==null&&(a+=`${t}`),e!==null&&(a+=`${Hse(e)}#`),a+=Hse(r),Ttt(o)&&(a+=`::${ay.default.stringify(o)}`),a}function Ltt(t){let{params:e,protocol:r,source:o,selector:a}=vg(t);for(let n in e)n.startsWith("__")&&delete e[n];return mx({protocol:r,source:o,params:e,selector:a})}function rn(t){return t.scope?`@${t.scope}/${t.name}`:`${t.name}`}function ka(t){return t.scope?`@${t.scope}/${t.name}@${t.range}`:`${t.name}@${t.range}`}function Qa(t){return t.scope?`@${t.scope}/${t.name}@${t.reference}`:`${t.name}@${t.reference}`}function LM(t){return t.scope!==null?`@${t.scope}-${t.name}`:t.name}function ly(t){let{protocol:e,selector:r}=vg(t.reference),o=e!==null?e.replace(Ntt,""):"exotic",a=qse.default.valid(r),n=a!==null?`${o}-${a}`:`${o}`,u=10;return t.scope?`${LM(t)}-${n}-${t.locatorHash.slice(0,u)}`:`${LM(t)}-${n}-${t.locatorHash.slice(0,u)}`}function Ui(t,e){return e.scope?`${Ut(t,`@${e.scope}/`,Ct.SCOPE)}${Ut(t,e.name,Ct.NAME)}`:`${Ut(t,e.name,Ct.NAME)}`}function yx(t){if(t.startsWith(y1)){let e=yx(t.substring(t.indexOf("#")+1)),r=t.substring(y1.length,y1.length+mtt);return`${e} [${r}]`}else return t.replace(Ott,"?[...]")}function cy(t,e){return`${Ut(t,yx(e),Ct.RANGE)}`}function zn(t,e){return`${Ui(t,e)}${Ut(t,"@",Ct.RANGE)}${cy(t,e.range)}`}function D1(t,e){return`${Ut(t,yx(e),Ct.REFERENCE)}`}function jr(t,e){return`${Ui(t,e)}${Ut(t,"@",Ct.REFERENCE)}${D1(t,e.reference)}`}function AO(t){return`${rn(t)}@${yx(t.reference)}`}function uy(t){return Ps(t,[e=>rn(e),e=>e.range])}function P1(t,e){return Ui(t,e.anchoredLocator)}function d1(t,e,r){let o=Pf(e)?C1(e):e;return r===null?`${zn(t,o)} \u2192 ${uO(t).Cross}`:o.identHash===r.identHash?`${zn(t,o)} \u2192 ${D1(t,r.reference)}`:`${zn(t,o)} \u2192 ${jr(t,r)}`}function fO(t,e,r){return r===null?`${jr(t,e)}`:`${jr(t,e)} (via ${cy(t,r.range)})`}function _M(t){return`node_modules/${rn(t)}`}function Ex(t,e){return t.conditions?ytt(t.conditions,r=>{let[,o,a]=r.match(Gse),n=e[o];return n?n.includes(a):!0}):!0}function S1(t){let e=new Set;if("children"in t)e.add(t);else for(let r of t.requests.values())e.add(r);for(let r of e)for(let o of r.children.values())e.add(o);return e}var ay,qse,jse,y1,mtt,Gse,ytt,gx,Ptt,Stt,xtt,btt,ktt,Qtt,Ntt,Ott,Io=It(()=>{ay=et(ve("querystring")),qse=et(ni()),jse=et(MX());Wl();ah();Gl();Io();y1="virtual:",mtt=5,Gse=/(os|cpu|libc)=([a-z0-9_-]+)/,ytt=(0,jse.makeParser)(Gse);gx=/^[^#]*#/;Ptt=/^(?:@([^/]+?)\/)?([^@/]+)$/;Stt=/^(?:@([^/]+?)\/)?([^@/]+?)(?:@(.+))$/,xtt=/^(?:@([^/]+?)\/)?([^@/]+?)(?:@(.+))?$/;btt=/^(?:@([^/]+?)\/)?([^@/]+?)(?:@(.+))$/,ktt=/^(?:@([^/]+?)\/)?([^@/]+?)(?:@(.+))?$/;Qtt=/^([^#:]*:)?((?:(?!::)[^#])*)(?:#((?:(?!::).)*))?(?:::(.*))?$/;Ntt=/:$/;Ott=/\?.*/});var Kse,Vse=It(()=>{Io();Kse={hooks:{reduceDependency:(t,e,r,o,{resolver:a,resolveOptions:n})=>{for(let{pattern:u,reference:A}of e.topLevelWorkspace.manifest.resolutions){if(u.from&&(u.from.fullName!==rn(r)||e.configuration.normalizeLocator(Ss(Zo(u.from.fullName),u.from.description??r.reference)).locatorHash!==r.locatorHash)||u.descriptor.fullName!==rn(t)||e.configuration.normalizeDependency(kn(Sf(u.descriptor.fullName),u.descriptor.description??t.range)).descriptorHash!==t.descriptorHash)continue;return a.bindDescriptor(e.configuration.normalizeDependency(kn(t,A)),e.topLevelWorkspace.anchoredLocator,n)}return t},validateProject:async(t,e)=>{for(let r of t.workspaces){let o=P1(t.configuration,r);await t.configuration.triggerHook(a=>a.validateWorkspace,r,{reportWarning:(a,n)=>e.reportWarning(a,`${o}: ${n}`),reportError:(a,n)=>e.reportError(a,`${o}: ${n}`)})}},validateWorkspace:async(t,e)=>{let{manifest:r}=t;r.resolutions.length&&t.cwd!==t.project.cwd&&r.errors.push(new Error("Resolutions field will be ignored"));for(let o of r.errors)e.reportWarning(57,o.message)}}}});var ci,Dg=It(()=>{ci=class t{static{this.protocol="workspace:"}supportsDescriptor(e,r){return!!(e.range.startsWith(t.protocol)||r.project.tryWorkspaceByDescriptor(e)!==null)}supportsLocator(e,r){return!!e.reference.startsWith(t.protocol)}shouldPersistResolution(e,r){return!1}bindDescriptor(e,r,o){return e}getResolutionDependencies(e,r){return{}}async getCandidates(e,r,o){return[o.project.getWorkspaceByDescriptor(e).anchoredLocator]}async getSatisfying(e,r,o,a){let[n]=await this.getCandidates(e,r,a);return{locators:o.filter(u=>u.locatorHash===n.locatorHash),sorted:!1}}async resolve(e,r){let o=r.project.getWorkspaceByCwd(e.reference.slice(t.protocol.length));return{...e,version:o.manifest.version||"0.0.0",languageName:"unknown",linkType:"SOFT",conditions:null,dependencies:r.project.configuration.normalizeDependencyMap(new Map([...o.manifest.dependencies,...o.manifest.devDependencies])),peerDependencies:new Map([...o.manifest.peerDependencies]),dependenciesMeta:o.manifest.dependenciesMeta,peerDependenciesMeta:o.manifest.peerDependenciesMeta,bin:o.manifest.bin}}}});var Ur={};Kt(Ur,{SemVer:()=>$se.SemVer,clean:()=>Utt,getComparator:()=>Xse,mergeComparators:()=>HM,satisfiesWithPrereleases:()=>nA,simplifyRanges:()=>qM,stringifyComparator:()=>Zse,validRange:()=>Fa});function nA(t,e,r=!1){if(!t)return!1;let o=`${e}${r}`,a=zse.get(o);if(typeof a>"u")try{a=new xf.default.Range(e,{includePrerelease:!0,loose:r})}catch{return!1}finally{zse.set(o,a||null)}else if(a===null)return!1;let n;try{n=new xf.default.SemVer(t,a)}catch{return!1}return a.test(n)?!0:(n.prerelease&&(n.prerelease=[]),a.set.some(u=>{for(let A of u)A.semver.prerelease&&(A.semver.prerelease=[]);return u.every(A=>A.test(n))}))}function Fa(t){if(t.indexOf(":")!==-1)return null;let e=Jse.get(t);if(typeof e<"u")return e;try{e=new xf.default.Range(t)}catch{e=null}return Jse.set(t,e),e}function Utt(t){let e=Mtt.exec(t);return e?e[1]:null}function Xse(t){if(t.semver===xf.default.Comparator.ANY)return{gt:null,lt:null};switch(t.operator){case"":return{gt:[">=",t.semver],lt:["<=",t.semver]};case">":case">=":return{gt:[t.operator,t.semver],lt:null};case"<":case"<=":return{gt:null,lt:[t.operator,t.semver]};default:throw new Error(`Assertion failed: Unexpected comparator operator (${t.operator})`)}}function HM(t){if(t.length===0)return null;let e=null,r=null;for(let o of t){if(o.gt){let a=e!==null?xf.default.compare(o.gt[1],e[1]):null;(a===null||a>0||a===0&&o.gt[0]===">")&&(e=o.gt)}if(o.lt){let a=r!==null?xf.default.compare(o.lt[1],r[1]):null;(a===null||a<0||a===0&&o.lt[0]==="<")&&(r=o.lt)}}if(e&&r){let o=xf.default.compare(e[1],r[1]);if(o===0&&(e[0]===">"||r[0]==="<")||o>0)return null}return{gt:e,lt:r}}function Zse(t){if(t.gt&&t.lt){if(t.gt[0]===">="&&t.lt[0]==="<="&&t.gt[1].version===t.lt[1].version)return t.gt[1].version;if(t.gt[0]===">="&&t.lt[0]==="<"){if(t.lt[1].version===`${t.gt[1].major+1}.0.0-0`)return`^${t.gt[1].version}`;if(t.lt[1].version===`${t.gt[1].major}.${t.gt[1].minor+1}.0-0`)return`~${t.gt[1].version}`}}let e=[];return t.gt&&e.push(t.gt[0]+t.gt[1].version),t.lt&&e.push(t.lt[0]+t.lt[1].version),e.length?e.join(" "):"*"}function qM(t){let e=t.map(_tt).map(o=>Fa(o).set.map(a=>a.map(n=>Xse(n)))),r=e.shift().map(o=>HM(o)).filter(o=>o!==null);for(let o of e){let a=[];for(let n of r)for(let u of o){let A=HM([n,...u]);A!==null&&a.push(A)}r=a}return r.length===0?null:r.map(o=>Zse(o)).join(" || ")}function _tt(t){let e=t.split("||");if(e.length>1){let r=new Set;for(let o of e)e.some(a=>a!==o&&xf.default.subset(o,a))||r.add(o);if(r.size{xf=et(ni()),$se=et(ni()),zse=new Map;Jse=new Map;Mtt=/^(?:[\sv=]*?)((0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)(?:\s*)$/});function eoe(t){let e=t.match(/^[ \t]+/m);return e?e[0]:" "}function toe(t){return t.charCodeAt(0)===65279?t.slice(1):t}function $o(t){return t.replace(/\\/g,"/")}function Cx(t,{yamlCompatibilityMode:e}){return e?nO(t):typeof t>"u"||typeof t=="boolean"?t:null}function roe(t,e){let r=e.search(/[^!]/);if(r===-1)return"invalid";let o=r%2===0?"":"!",a=e.slice(r);return`${o}${t}=${a}`}function jM(t,e){return e.length===1?roe(t,e[0]):`(${e.map(r=>roe(t,r)).join(" | ")})`}var noe,_t,Ay=It(()=>{Pt();Ol();noe=et(ni());Dg();Gl();bf();Io();_t=class t{constructor(){this.indent=" ";this.name=null;this.version=null;this.os=null;this.cpu=null;this.libc=null;this.type=null;this.packageManager=null;this.private=!1;this.license=null;this.main=null;this.module=null;this.browser=null;this.languageName=null;this.bin=new Map;this.scripts=new Map;this.dependencies=new Map;this.devDependencies=new Map;this.peerDependencies=new Map;this.workspaceDefinitions=[];this.dependenciesMeta=new Map;this.peerDependenciesMeta=new Map;this.resolutions=[];this.files=null;this.publishConfig=null;this.installConfig=null;this.preferUnplugged=null;this.raw={};this.errors=[]}static{this.fileName="package.json"}static{this.allDependencies=["dependencies","devDependencies","peerDependencies"]}static{this.hardDependencies=["dependencies","devDependencies"]}static async tryFind(e,{baseFs:r=new _n}={}){let o=K.join(e,"package.json");try{return await t.fromFile(o,{baseFs:r})}catch(a){if(a.code==="ENOENT")return null;throw a}}static async find(e,{baseFs:r}={}){let o=await t.tryFind(e,{baseFs:r});if(o===null)throw new Error("Manifest not found");return o}static async fromFile(e,{baseFs:r=new _n}={}){let o=new t;return await o.loadFile(e,{baseFs:r}),o}static fromText(e){let r=new t;return r.loadFromText(e),r}loadFromText(e){let r;try{r=JSON.parse(toe(e)||"{}")}catch(o){throw o.message+=` (when parsing ${e})`,o}this.load(r),this.indent=eoe(e)}async loadFile(e,{baseFs:r=new _n}){let o=await r.readFilePromise(e,"utf8"),a;try{a=JSON.parse(toe(o)||"{}")}catch(n){throw n.message+=` (when parsing ${e})`,n}this.load(a),this.indent=eoe(o)}load(e,{yamlCompatibilityMode:r=!1}={}){if(typeof e!="object"||e===null)throw new Error(`Utterly invalid manifest data (${e})`);this.raw=e;let o=[];if(this.name=null,typeof e.name=="string")try{this.name=Zo(e.name)}catch{o.push(new Error("Parsing failed for the 'name' field"))}if(typeof e.version=="string"?this.version=e.version:this.version=null,Array.isArray(e.os)){let n=[];this.os=n;for(let u of e.os)typeof u!="string"?o.push(new Error("Parsing failed for the 'os' field")):n.push(u)}else this.os=null;if(Array.isArray(e.cpu)){let n=[];this.cpu=n;for(let u of e.cpu)typeof u!="string"?o.push(new Error("Parsing failed for the 'cpu' field")):n.push(u)}else this.cpu=null;if(Array.isArray(e.libc)){let n=[];this.libc=n;for(let u of e.libc)typeof u!="string"?o.push(new Error("Parsing failed for the 'libc' field")):n.push(u)}else this.libc=null;if(typeof e.type=="string"?this.type=e.type:this.type=null,typeof e.packageManager=="string"?this.packageManager=e.packageManager:this.packageManager=null,typeof e.private=="boolean"?this.private=e.private:this.private=!1,typeof e.license=="string"?this.license=e.license:this.license=null,typeof e.languageName=="string"?this.languageName=e.languageName:this.languageName=null,typeof e.main=="string"?this.main=$o(e.main):this.main=null,typeof e.module=="string"?this.module=$o(e.module):this.module=null,e.browser!=null)if(typeof e.browser=="string")this.browser=$o(e.browser);else{this.browser=new Map;for(let[n,u]of Object.entries(e.browser))this.browser.set($o(n),typeof u=="string"?$o(u):u)}else this.browser=null;if(this.bin=new Map,typeof e.bin=="string")e.bin.trim()===""?o.push(new Error("Invalid bin field")):this.name!==null?this.bin.set(this.name.name,$o(e.bin)):o.push(new Error("String bin field, but no attached package name"));else if(typeof e.bin=="object"&&e.bin!==null)for(let[n,u]of Object.entries(e.bin)){if(typeof u!="string"||u.trim()===""){o.push(new Error(`Invalid bin definition for '${n}'`));continue}let A=Zo(n);this.bin.set(A.name,$o(u))}if(this.scripts=new Map,typeof e.scripts=="object"&&e.scripts!==null)for(let[n,u]of Object.entries(e.scripts)){if(typeof u!="string"){o.push(new Error(`Invalid script definition for '${n}'`));continue}this.scripts.set(n,u)}if(this.dependencies=new Map,typeof e.dependencies=="object"&&e.dependencies!==null)for(let[n,u]of Object.entries(e.dependencies)){if(typeof u!="string"){o.push(new Error(`Invalid dependency range for '${n}'`));continue}let A;try{A=Zo(n)}catch{o.push(new Error(`Parsing failed for the dependency name '${n}'`));continue}let p=kn(A,u);this.dependencies.set(p.identHash,p)}if(this.devDependencies=new Map,typeof e.devDependencies=="object"&&e.devDependencies!==null)for(let[n,u]of Object.entries(e.devDependencies)){if(typeof u!="string"){o.push(new Error(`Invalid dependency range for '${n}'`));continue}let A;try{A=Zo(n)}catch{o.push(new Error(`Parsing failed for the dependency name '${n}'`));continue}let p=kn(A,u);this.devDependencies.set(p.identHash,p)}if(this.peerDependencies=new Map,typeof e.peerDependencies=="object"&&e.peerDependencies!==null)for(let[n,u]of Object.entries(e.peerDependencies)){let A;try{A=Zo(n)}catch{o.push(new Error(`Parsing failed for the dependency name '${n}'`));continue}(typeof u!="string"||!u.startsWith(ci.protocol)&&!Fa(u))&&(o.push(new Error(`Invalid dependency range for '${n}'`)),u="*");let p=kn(A,u);this.peerDependencies.set(p.identHash,p)}typeof e.workspaces=="object"&&e.workspaces!==null&&e.workspaces.nohoist&&o.push(new Error("'nohoist' is deprecated, please use 'installConfig.hoistingLimits' instead"));let a=Array.isArray(e.workspaces)?e.workspaces:typeof e.workspaces=="object"&&e.workspaces!==null&&Array.isArray(e.workspaces.packages)?e.workspaces.packages:[];this.workspaceDefinitions=[];for(let n of a){if(typeof n!="string"){o.push(new Error(`Invalid workspace definition for '${n}'`));continue}this.workspaceDefinitions.push({pattern:n})}if(this.dependenciesMeta=new Map,typeof e.dependenciesMeta=="object"&&e.dependenciesMeta!==null)for(let[n,u]of Object.entries(e.dependenciesMeta)){if(typeof u!="object"||u===null){o.push(new Error(`Invalid meta field for '${n}`));continue}let A=lh(n),p=this.ensureDependencyMeta(A),h=Cx(u.built,{yamlCompatibilityMode:r});if(h===null){o.push(new Error(`Invalid built meta field for '${n}'`));continue}let E=Cx(u.optional,{yamlCompatibilityMode:r});if(E===null){o.push(new Error(`Invalid optional meta field for '${n}'`));continue}let w=Cx(u.unplugged,{yamlCompatibilityMode:r});if(w===null){o.push(new Error(`Invalid unplugged meta field for '${n}'`));continue}Object.assign(p,{built:h,optional:E,unplugged:w})}if(this.peerDependenciesMeta=new Map,typeof e.peerDependenciesMeta=="object"&&e.peerDependenciesMeta!==null)for(let[n,u]of Object.entries(e.peerDependenciesMeta)){if(typeof u!="object"||u===null){o.push(new Error(`Invalid meta field for '${n}'`));continue}let A=lh(n),p=this.ensurePeerDependencyMeta(A),h=Cx(u.optional,{yamlCompatibilityMode:r});if(h===null){o.push(new Error(`Invalid optional meta field for '${n}'`));continue}Object.assign(p,{optional:h})}if(this.resolutions=[],typeof e.resolutions=="object"&&e.resolutions!==null)for(let[n,u]of Object.entries(e.resolutions)){if(typeof u!="string"){o.push(new Error(`Invalid resolution entry for '${n}'`));continue}try{this.resolutions.push({pattern:pP(n),reference:u})}catch(A){o.push(A);continue}}if(Array.isArray(e.files)){this.files=new Set;for(let n of e.files){if(typeof n!="string"){o.push(new Error(`Invalid files entry for '${n}'`));continue}this.files.add(n)}}else this.files=null;if(typeof e.publishConfig=="object"&&e.publishConfig!==null){if(this.publishConfig={},typeof e.publishConfig.access=="string"&&(this.publishConfig.access=e.publishConfig.access),typeof e.publishConfig.main=="string"&&(this.publishConfig.main=$o(e.publishConfig.main)),typeof e.publishConfig.module=="string"&&(this.publishConfig.module=$o(e.publishConfig.module)),e.publishConfig.browser!=null)if(typeof e.publishConfig.browser=="string")this.publishConfig.browser=$o(e.publishConfig.browser);else{this.publishConfig.browser=new Map;for(let[n,u]of Object.entries(e.publishConfig.browser))this.publishConfig.browser.set($o(n),typeof u=="string"?$o(u):u)}if(typeof e.publishConfig.registry=="string"&&(this.publishConfig.registry=e.publishConfig.registry),typeof e.publishConfig.bin=="string")this.name!==null?this.publishConfig.bin=new Map([[this.name.name,$o(e.publishConfig.bin)]]):o.push(new Error("String bin field, but no attached package name"));else if(typeof e.publishConfig.bin=="object"&&e.publishConfig.bin!==null){this.publishConfig.bin=new Map;for(let[n,u]of Object.entries(e.publishConfig.bin)){if(typeof u!="string"){o.push(new Error(`Invalid bin definition for '${n}'`));continue}this.publishConfig.bin.set(n,$o(u))}}if(Array.isArray(e.publishConfig.executableFiles)){this.publishConfig.executableFiles=new Set;for(let n of e.publishConfig.executableFiles){if(typeof n!="string"){o.push(new Error("Invalid executable file definition"));continue}this.publishConfig.executableFiles.add($o(n))}}}else this.publishConfig=null;if(typeof e.installConfig=="object"&&e.installConfig!==null){this.installConfig={};for(let n of Object.keys(e.installConfig))n==="hoistingLimits"?typeof e.installConfig.hoistingLimits=="string"?this.installConfig.hoistingLimits=e.installConfig.hoistingLimits:o.push(new Error("Invalid hoisting limits definition")):n=="selfReferences"?typeof e.installConfig.selfReferences=="boolean"?this.installConfig.selfReferences=e.installConfig.selfReferences:o.push(new Error("Invalid selfReferences definition, must be a boolean value")):o.push(new Error(`Unrecognized installConfig key: ${n}`))}else this.installConfig=null;if(typeof e.optionalDependencies=="object"&&e.optionalDependencies!==null)for(let[n,u]of Object.entries(e.optionalDependencies)){if(typeof u!="string"){o.push(new Error(`Invalid dependency range for '${n}'`));continue}let A;try{A=Zo(n)}catch{o.push(new Error(`Parsing failed for the dependency name '${n}'`));continue}let p=kn(A,u);this.dependencies.set(p.identHash,p);let h=kn(A,"unknown"),E=this.ensureDependencyMeta(h);Object.assign(E,{optional:!0})}typeof e.preferUnplugged=="boolean"?this.preferUnplugged=e.preferUnplugged:this.preferUnplugged=null,this.errors=o}getForScope(e){switch(e){case"dependencies":return this.dependencies;case"devDependencies":return this.devDependencies;case"peerDependencies":return this.peerDependencies;default:throw new Error(`Unsupported value ("${e}")`)}}hasConsumerDependency(e){return!!(this.dependencies.has(e.identHash)||this.peerDependencies.has(e.identHash))}hasHardDependency(e){return!!(this.dependencies.has(e.identHash)||this.devDependencies.has(e.identHash))}hasSoftDependency(e){return!!this.peerDependencies.has(e.identHash)}hasDependency(e){return!!(this.hasHardDependency(e)||this.hasSoftDependency(e))}getConditions(){let e=[];return this.os&&this.os.length>0&&e.push(jM("os",this.os)),this.cpu&&this.cpu.length>0&&e.push(jM("cpu",this.cpu)),this.libc&&this.libc.length>0&&e.push(jM("libc",this.libc)),e.length>0?e.join(" & "):null}ensureDependencyMeta(e){if(e.range!=="unknown"&&!noe.default.valid(e.range))throw new Error(`Invalid meta field range for '${ka(e)}'`);let r=rn(e),o=e.range!=="unknown"?e.range:null,a=this.dependenciesMeta.get(r);a||this.dependenciesMeta.set(r,a=new Map);let n=a.get(o);return n||a.set(o,n={}),n}ensurePeerDependencyMeta(e){if(e.range!=="unknown")throw new Error(`Invalid meta field range for '${ka(e)}'`);let r=rn(e),o=this.peerDependenciesMeta.get(r);return o||this.peerDependenciesMeta.set(r,o={}),o}setRawField(e,r,{after:o=[]}={}){let a=new Set(o.filter(n=>Object.hasOwn(this.raw,n)));if(a.size===0||Object.hasOwn(this.raw,e))this.raw[e]=r;else{let n=this.raw,u=this.raw={},A=!1;for(let p of Object.keys(n))u[p]=n[p],A||(a.delete(p),a.size===0&&(u[e]=r,A=!0))}}exportTo(e,{compatibilityMode:r=!0}={}){if(Object.assign(e,this.raw),this.name!==null?e.name=rn(this.name):delete e.name,this.version!==null?e.version=this.version:delete e.version,this.os!==null?e.os=this.os:delete e.os,this.cpu!==null?e.cpu=this.cpu:delete e.cpu,this.type!==null?e.type=this.type:delete e.type,this.packageManager!==null?e.packageManager=this.packageManager:delete e.packageManager,this.private?e.private=!0:delete e.private,this.license!==null?e.license=this.license:delete e.license,this.languageName!==null?e.languageName=this.languageName:delete e.languageName,this.main!==null?e.main=this.main:delete e.main,this.module!==null?e.module=this.module:delete e.module,this.browser!==null){let n=this.browser;typeof n=="string"?e.browser=n:n instanceof Map&&(e.browser=Object.assign({},...Array.from(n.keys()).sort().map(u=>({[u]:n.get(u)}))))}else delete e.browser;this.bin.size===1&&this.name!==null&&this.bin.has(this.name.name)?e.bin=this.bin.get(this.name.name):this.bin.size>0?e.bin=Object.assign({},...Array.from(this.bin.keys()).sort().map(n=>({[n]:this.bin.get(n)}))):delete e.bin,this.workspaceDefinitions.length>0?this.raw.workspaces&&!Array.isArray(this.raw.workspaces)?e.workspaces={...this.raw.workspaces,packages:this.workspaceDefinitions.map(({pattern:n})=>n)}:e.workspaces=this.workspaceDefinitions.map(({pattern:n})=>n):this.raw.workspaces&&!Array.isArray(this.raw.workspaces)&&Object.keys(this.raw.workspaces).length>0?e.workspaces=this.raw.workspaces:delete e.workspaces;let o=[],a=[];for(let n of this.dependencies.values()){let u=this.dependenciesMeta.get(rn(n)),A=!1;if(r&&u){let p=u.get(null);p&&p.optional&&(A=!0)}A?a.push(n):o.push(n)}o.length>0?e.dependencies=Object.assign({},...uy(o).map(n=>({[rn(n)]:n.range}))):delete e.dependencies,a.length>0?e.optionalDependencies=Object.assign({},...uy(a).map(n=>({[rn(n)]:n.range}))):delete e.optionalDependencies,this.devDependencies.size>0?e.devDependencies=Object.assign({},...uy(this.devDependencies.values()).map(n=>({[rn(n)]:n.range}))):delete e.devDependencies,this.peerDependencies.size>0?e.peerDependencies=Object.assign({},...uy(this.peerDependencies.values()).map(n=>({[rn(n)]:n.range}))):delete e.peerDependencies,e.dependenciesMeta={};for(let[n,u]of Ps(this.dependenciesMeta.entries(),([A,p])=>A))for(let[A,p]of Ps(u.entries(),([h,E])=>h!==null?`0${h}`:"1")){let h=A!==null?ka(kn(Zo(n),A)):n,E={...p};r&&A===null&&delete E.optional,Object.keys(E).length!==0&&(e.dependenciesMeta[h]=E)}if(Object.keys(e.dependenciesMeta).length===0&&delete e.dependenciesMeta,this.peerDependenciesMeta.size>0?e.peerDependenciesMeta=Object.assign({},...Ps(this.peerDependenciesMeta.entries(),([n,u])=>n).map(([n,u])=>({[n]:u}))):delete e.peerDependenciesMeta,this.resolutions.length>0?e.resolutions=Object.assign({},...this.resolutions.map(({pattern:n,reference:u})=>({[hP(n)]:u}))):delete e.resolutions,this.files!==null?e.files=Array.from(this.files):delete e.files,this.preferUnplugged!==null?e.preferUnplugged=this.preferUnplugged:delete e.preferUnplugged,this.scripts!==null&&this.scripts.size>0){e.scripts??={};for(let n of Object.keys(e.scripts))this.scripts.has(n)||delete e.scripts[n];for(let[n,u]of this.scripts.entries())e.scripts[n]=u}else delete e.scripts;return e}}});var soe=_((ILt,ioe)=>{var Htt=ql(),qtt=function(){return Htt.Date.now()};ioe.exports=qtt});var aoe=_((wLt,ooe)=>{var jtt=/\s/;function Gtt(t){for(var e=t.length;e--&&jtt.test(t.charAt(e)););return e}ooe.exports=Gtt});var coe=_((BLt,loe)=>{var Wtt=aoe(),Ytt=/^\s+/;function Ktt(t){return t&&t.slice(0,Wtt(t)+1).replace(Ytt,"")}loe.exports=Ktt});var fy=_((vLt,uoe)=>{var Vtt=mg(),ztt=Zu(),Jtt="[object Symbol]";function Xtt(t){return typeof t=="symbol"||ztt(t)&&Vtt(t)==Jtt}uoe.exports=Xtt});var hoe=_((DLt,poe)=>{var Ztt=coe(),Aoe=cl(),$tt=fy(),foe=NaN,ert=/^[-+]0x[0-9a-f]+$/i,trt=/^0b[01]+$/i,rrt=/^0o[0-7]+$/i,nrt=parseInt;function irt(t){if(typeof t=="number")return t;if($tt(t))return foe;if(Aoe(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Aoe(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=Ztt(t);var r=trt.test(t);return r||rrt.test(t)?nrt(t.slice(2),r?2:8):ert.test(t)?foe:+t}poe.exports=irt});var moe=_((PLt,doe)=>{var srt=cl(),GM=soe(),goe=hoe(),ort="Expected a function",art=Math.max,lrt=Math.min;function crt(t,e,r){var o,a,n,u,A,p,h=0,E=!1,w=!1,D=!0;if(typeof t!="function")throw new TypeError(ort);e=goe(e)||0,srt(r)&&(E=!!r.leading,w="maxWait"in r,n=w?art(goe(r.maxWait)||0,e):n,D="trailing"in r?!!r.trailing:D);function b(ue){var Ie=o,he=a;return o=a=void 0,h=ue,u=t.apply(he,Ie),u}function C(ue){return h=ue,A=setTimeout(U,e),E?b(ue):u}function T(ue){var Ie=ue-p,he=ue-h,De=e-Ie;return w?lrt(De,n-he):De}function N(ue){var Ie=ue-p,he=ue-h;return p===void 0||Ie>=e||Ie<0||w&&he>=n}function U(){var ue=GM();if(N(ue))return z(ue);A=setTimeout(U,T(ue))}function z(ue){return A=void 0,D&&o?b(ue):(o=a=void 0,u)}function te(){A!==void 0&&clearTimeout(A),h=0,o=p=a=A=void 0}function le(){return A===void 0?u:z(GM())}function ce(){var ue=GM(),Ie=N(ue);if(o=arguments,a=this,p=ue,Ie){if(A===void 0)return C(p);if(w)return clearTimeout(A),A=setTimeout(U,e),b(p)}return A===void 0&&(A=setTimeout(U,e)),u}return ce.cancel=te,ce.flush=le,ce}doe.exports=crt});var WM=_((SLt,yoe)=>{var urt=moe(),Art=cl(),frt="Expected a function";function prt(t,e,r){var o=!0,a=!0;if(typeof t!="function")throw new TypeError(frt);return Art(r)&&(o="leading"in r?!!r.leading:o,a="trailing"in r?!!r.trailing:a),urt(t,e,{leading:o,maxWait:e,trailing:a})}yoe.exports=prt});function grt(t){return typeof t.reportCode<"u"}var Eoe,Coe,Ioe,hrt,zt,Ws,Vl=It(()=>{Eoe=et(WM()),Coe=ve("stream"),Ioe=ve("string_decoder"),hrt=15,zt=class extends Error{constructor(r,o,a){super(o);this.reportExtra=a;this.reportCode=r}};Ws=class{constructor(){this.cacheHits=new Set;this.cacheMisses=new Set;this.reportedInfos=new Set;this.reportedWarnings=new Set;this.reportedErrors=new Set}getRecommendedLength(){return 180}reportCacheHit(e){this.cacheHits.add(e.locatorHash)}reportCacheMiss(e,r){this.cacheMisses.add(e.locatorHash)}static progressViaCounter(e){let r=0,o,a=new Promise(p=>{o=p}),n=p=>{let h=o;a=new Promise(E=>{o=E}),r=p,h()},u=(p=0)=>{n(r+1)},A=async function*(){for(;r{r=u}),a=(0,Eoe.default)(u=>{let A=r;o=new Promise(p=>{r=p}),e=u,A()},1e3/hrt),n=async function*(){for(;;)await o,yield{title:e}}();return{[Symbol.asyncIterator](){return n},hasProgress:!1,hasTitle:!0,setTitle:a}}async startProgressPromise(e,r){let o=this.reportProgress(e);try{return await r(e)}finally{o.stop()}}startProgressSync(e,r){let o=this.reportProgress(e);try{return r(e)}finally{o.stop()}}reportInfoOnce(e,r,o){let a=o&&o.key?o.key:r;this.reportedInfos.has(a)||(this.reportedInfos.add(a),this.reportInfo(e,r),o?.reportExtra?.(this))}reportWarningOnce(e,r,o){let a=o&&o.key?o.key:r;this.reportedWarnings.has(a)||(this.reportedWarnings.add(a),this.reportWarning(e,r),o?.reportExtra?.(this))}reportErrorOnce(e,r,o){let a=o&&o.key?o.key:r;this.reportedErrors.has(a)||(this.reportedErrors.add(a),this.reportError(e,r),o?.reportExtra?.(this))}reportExceptionOnce(e){grt(e)?this.reportErrorOnce(e.reportCode,e.message,{key:e,reportExtra:e.reportExtra}):this.reportErrorOnce(1,e.stack||e.message,{key:e})}createStreamReporter(e=null){let r=new Coe.PassThrough,o=new Ioe.StringDecoder,a="";return r.on("data",n=>{let u=o.write(n),A;do if(A=u.indexOf(` `),A!==-1){let p=a+u.substring(0,A);u=u.substring(A+1),a="",e!==null?this.reportInfo(null,`${e} ${p}`):this.reportInfo(null,p)}while(A!==-1);a+=u}),r.on("end",()=>{let n=o.end();n!==""&&(e!==null?this.reportInfo(null,`${e} ${n}`):this.reportInfo(null,n))}),r}}});var py,YM=It(()=>{Vl();Io();py=class{constructor(e){this.fetchers=e}supports(e,r){return!!this.tryFetcher(e,r)}getLocalPath(e,r){return this.getFetcher(e,r).getLocalPath(e,r)}async fetch(e,r){return await this.getFetcher(e,r).fetch(e,r)}tryFetcher(e,r){let o=this.fetchers.find(a=>a.supports(e,r));return o||null}getFetcher(e,r){let o=this.fetchers.find(a=>a.supports(e,r));if(!o)throw new zt(11,`${jr(r.project.configuration,e)} isn't supported by any available fetcher`);return o}}});var Pg,KM=It(()=>{Io();Pg=class{constructor(e){this.resolvers=e.filter(r=>r)}supportsDescriptor(e,r){return!!this.tryResolverByDescriptor(e,r)}supportsLocator(e,r){return!!this.tryResolverByLocator(e,r)}shouldPersistResolution(e,r){return this.getResolverByLocator(e,r).shouldPersistResolution(e,r)}bindDescriptor(e,r,o){return this.getResolverByDescriptor(e,o).bindDescriptor(e,r,o)}getResolutionDependencies(e,r){return this.getResolverByDescriptor(e,r).getResolutionDependencies(e,r)}async getCandidates(e,r,o){return await this.getResolverByDescriptor(e,o).getCandidates(e,r,o)}async getSatisfying(e,r,o,a){return this.getResolverByDescriptor(e,a).getSatisfying(e,r,o,a)}async resolve(e,r){return await this.getResolverByLocator(e,r).resolve(e,r)}tryResolverByDescriptor(e,r){let o=this.resolvers.find(a=>a.supportsDescriptor(e,r));return o||null}getResolverByDescriptor(e,r){let o=this.resolvers.find(a=>a.supportsDescriptor(e,r));if(!o)throw new Error(`${zn(r.project.configuration,e)} isn't supported by any available resolver`);return o}tryResolverByLocator(e,r){let o=this.resolvers.find(a=>a.supportsLocator(e,r));return o||null}getResolverByLocator(e,r){let o=this.resolvers.find(a=>a.supportsLocator(e,r));if(!o)throw new Error(`${jr(r.project.configuration,e)} isn't supported by any available resolver`);return o}}});var hy,VM=It(()=>{Pt();Io();hy=class{supports(e){return!!e.reference.startsWith("virtual:")}getLocalPath(e,r){let o=e.reference.indexOf("#");if(o===-1)throw new Error("Invalid virtual package reference");let a=e.reference.slice(o+1),n=Ss(e,a);return r.fetcher.getLocalPath(n,r)}async fetch(e,r){let o=e.reference.indexOf("#");if(o===-1)throw new Error("Invalid virtual package reference");let a=e.reference.slice(o+1),n=Ss(e,a),u=await r.fetcher.fetch(n,r);return await this.ensureVirtualLink(e,u,r)}getLocatorFilename(e){return ly(e)}async ensureVirtualLink(e,r,o){let a=r.packageFs.getRealPath(),n=o.project.configuration.get("virtualFolder"),u=this.getLocatorFilename(e),A=qs.makeVirtualPath(n,u,a),p=new ju(A,{baseFs:r.packageFs,pathUtils:K});return{...r,packageFs:p}}}});var Ix,woe=It(()=>{Ix=class t{static{this.protocol="virtual:"}static isVirtualDescriptor(e){return!!e.range.startsWith(t.protocol)}static isVirtualLocator(e){return!!e.reference.startsWith(t.protocol)}supportsDescriptor(e,r){return t.isVirtualDescriptor(e)}supportsLocator(e,r){return t.isVirtualLocator(e)}shouldPersistResolution(e,r){return!1}bindDescriptor(e,r,o){throw new Error('Assertion failed: calling "bindDescriptor" on a virtual descriptor is unsupported')}getResolutionDependencies(e,r){throw new Error('Assertion failed: calling "getResolutionDependencies" on a virtual descriptor is unsupported')}async getCandidates(e,r,o){throw new Error('Assertion failed: calling "getCandidates" on a virtual descriptor is unsupported')}async getSatisfying(e,r,o,a){throw new Error('Assertion failed: calling "getSatisfying" on a virtual descriptor is unsupported')}async resolve(e,r){throw new Error('Assertion failed: calling "resolve" on a virtual locator is unsupported')}}});var gy,zM=It(()=>{Pt();Dg();gy=class{supports(e){return!!e.reference.startsWith(ci.protocol)}getLocalPath(e,r){return this.getWorkspace(e,r).cwd}async fetch(e,r){let o=this.getWorkspace(e,r).cwd;return{packageFs:new En(o),prefixPath:Bt.dot,localPath:o}}getWorkspace(e,r){return r.project.getWorkspaceByCwd(e.reference.slice(ci.protocol.length))}}});function x1(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Boe(t){return typeof t>"u"?3:x1(t)?0:Array.isArray(t)?1:2}function ZM(t,e){return Object.hasOwn(t,e)}function mrt(t){return x1(t)&&ZM(t,"onConflict")&&typeof t.onConflict=="string"}function yrt(t){if(typeof t>"u")return{onConflict:"default",value:t};if(!mrt(t))return{onConflict:"default",value:t};if(ZM(t,"value"))return t;let{onConflict:e,...r}=t;return{onConflict:e,value:r}}function voe(t,e){let r=x1(t)&&ZM(t,e)?t[e]:void 0;return yrt(r)}function dy(t,e){return[t,e,Doe]}function $M(t){return Array.isArray(t)?t[2]===Doe:!1}function JM(t,e){if(x1(t)){let r={};for(let o of Object.keys(t))r[o]=JM(t[o],e);return dy(e,r)}return Array.isArray(t)?dy(e,t.map(r=>JM(r,e))):dy(e,t)}function XM(t,e,r,o,a){let n,u=[],A=a,p=0;for(let E=a-1;E>=o;--E){let[w,D]=t[E],{onConflict:b,value:C}=voe(D,r),T=Boe(C);if(T!==3){if(n??=T,T!==n||b==="hardReset"){p=A;break}if(T===2)return dy(w,C);if(u.unshift([w,C]),b==="reset"){p=E;break}b==="extend"&&E===o&&(o=0),A=E}}if(typeof n>"u")return null;let h=u.map(([E])=>E).join(", ");switch(n){case 1:return dy(h,new Array().concat(...u.map(([E,w])=>w.map(D=>JM(D,E)))));case 0:{let E=Object.assign({},...u.map(([,T])=>T)),w=Object.keys(E),D={},b=t.map(([T,N])=>[T,voe(N,r).value]),C=drt(b,([T,N])=>{let U=Boe(N);return U!==0&&U!==3});if(C!==-1){let T=b.slice(C+1);for(let N of w)D[N]=XM(T,e,N,0,T.length)}else for(let T of w)D[T]=XM(b,e,T,p,b.length);return dy(h,D)}default:throw new Error("Assertion failed: Non-extendable value type")}}function Poe(t){return XM(t.map(([e,r])=>[e,{".":r}]),[],".",0,t.length)}function b1(t){return $M(t)?t[1]:t}function wx(t){let e=$M(t)?t[1]:t;if(Array.isArray(e))return e.map(r=>wx(r));if(x1(e)){let r={};for(let[o,a]of Object.entries(e))r[o]=wx(a);return r}return e}function e4(t){return $M(t)?t[0]:null}var drt,Doe,Soe=It(()=>{drt=(t,e,r)=>{let o=[...t];return o.reverse(),o.findIndex(e,r)};Doe=Symbol()});var Bx={};Kt(Bx,{getDefaultGlobalFolder:()=>r4,getHomeFolder:()=>my,isFolderInside:()=>n4});function r4(){if(process.platform==="win32"){let t=Ae.toPortablePath(process.env.LOCALAPPDATA||Ae.join((0,t4.homedir)(),"AppData","Local"));return K.resolve(t,"Yarn/Berry")}if(process.env.XDG_DATA_HOME){let t=Ae.toPortablePath(process.env.XDG_DATA_HOME);return K.resolve(t,"yarn/berry")}return K.resolve(my(),".yarn/berry")}function my(){return Ae.toPortablePath((0,t4.homedir)()||"/usr/local/share")}function n4(t,e){let r=K.relative(e,t);return r&&!r.startsWith("..")&&!K.isAbsolute(r)}var t4,vx=It(()=>{Pt();t4=ve("os")});var Qoe=_(yy=>{"use strict";var _Lt=ve("net"),Crt=ve("tls"),i4=ve("http"),xoe=ve("https"),Irt=ve("events"),HLt=ve("assert"),wrt=ve("util");yy.httpOverHttp=Brt;yy.httpsOverHttp=vrt;yy.httpOverHttps=Drt;yy.httpsOverHttps=Prt;function Brt(t){var e=new kf(t);return e.request=i4.request,e}function vrt(t){var e=new kf(t);return e.request=i4.request,e.createSocket=boe,e.defaultPort=443,e}function Drt(t){var e=new kf(t);return e.request=xoe.request,e}function Prt(t){var e=new kf(t);return e.request=xoe.request,e.createSocket=boe,e.defaultPort=443,e}function kf(t){var e=this;e.options=t||{},e.proxyOptions=e.options.proxy||{},e.maxSockets=e.options.maxSockets||i4.Agent.defaultMaxSockets,e.requests=[],e.sockets=[],e.on("free",function(o,a,n,u){for(var A=koe(a,n,u),p=0,h=e.requests.length;p=this.maxSockets){n.requests.push(u);return}n.createSocket(u,function(A){A.on("free",p),A.on("close",h),A.on("agentRemove",h),e.onSocket(A);function p(){n.emit("free",A,u)}function h(E){n.removeSocket(A),A.removeListener("free",p),A.removeListener("close",h),A.removeListener("agentRemove",h)}})};kf.prototype.createSocket=function(e,r){var o=this,a={};o.sockets.push(a);var n=s4({},o.proxyOptions,{method:"CONNECT",path:e.host+":"+e.port,agent:!1,headers:{host:e.host+":"+e.port}});e.localAddress&&(n.localAddress=e.localAddress),n.proxyAuth&&(n.headers=n.headers||{},n.headers["Proxy-Authorization"]="Basic "+new Buffer(n.proxyAuth).toString("base64")),ch("making CONNECT request");var u=o.request(n);u.useChunkedEncodingByDefault=!1,u.once("response",A),u.once("upgrade",p),u.once("connect",h),u.once("error",E),u.end();function A(w){w.upgrade=!0}function p(w,D,b){process.nextTick(function(){h(w,D,b)})}function h(w,D,b){if(u.removeAllListeners(),D.removeAllListeners(),w.statusCode!==200){ch("tunneling socket could not be established, statusCode=%d",w.statusCode),D.destroy();var C=new Error("tunneling socket could not be established, statusCode="+w.statusCode);C.code="ECONNRESET",e.request.emit("error",C),o.removeSocket(a);return}if(b.length>0){ch("got illegal response body from proxy"),D.destroy();var C=new Error("got illegal response body from proxy");C.code="ECONNRESET",e.request.emit("error",C),o.removeSocket(a);return}return ch("tunneling connection has established"),o.sockets[o.sockets.indexOf(a)]=D,r(D)}function E(w){u.removeAllListeners(),ch(`tunneling socket could not be established, cause=%s `,w.message,w.stack);var D=new Error("tunneling socket could not be established, cause="+w.message);D.code="ECONNRESET",e.request.emit("error",D),o.removeSocket(a)}};kf.prototype.removeSocket=function(e){var r=this.sockets.indexOf(e);if(r!==-1){this.sockets.splice(r,1);var o=this.requests.shift();o&&this.createSocket(o,function(a){o.request.onSocket(a)})}};function boe(t,e){var r=this;kf.prototype.createSocket.call(r,t,function(o){var a=t.request.getHeader("host"),n=s4({},r.options,{socket:o,servername:a?a.replace(/:.*$/,""):t.host}),u=Crt.connect(0,n);r.sockets[r.sockets.indexOf(o)]=u,e(u)})}function koe(t,e,r){return typeof t=="string"?{host:t,port:e,localAddress:r}:t}function s4(t){for(var e=1,r=arguments.length;e{Foe.exports=Qoe()});var Ff=_((Qf,Dx)=>{"use strict";Object.defineProperty(Qf,"__esModule",{value:!0});var Toe=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function Srt(t){return Toe.includes(t)}var xrt=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Blob","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","FormData","URLSearchParams","HTMLElement",...Toe];function brt(t){return xrt.includes(t)}var krt=["null","undefined","string","number","bigint","boolean","symbol"];function Qrt(t){return krt.includes(t)}function Ey(t){return e=>typeof e===t}var{toString:Loe}=Object.prototype,k1=t=>{let e=Loe.call(t).slice(8,-1);if(/HTML\w+Element/.test(e)&&Se.domElement(t))return"HTMLElement";if(brt(e))return e},ii=t=>e=>k1(e)===t;function Se(t){if(t===null)return"null";switch(typeof t){case"undefined":return"undefined";case"string":return"string";case"number":return"number";case"boolean":return"boolean";case"function":return"Function";case"bigint":return"bigint";case"symbol":return"symbol";default:}if(Se.observable(t))return"Observable";if(Se.array(t))return"Array";if(Se.buffer(t))return"Buffer";let e=k1(t);if(e)return e;if(t instanceof String||t instanceof Boolean||t instanceof Number)throw new TypeError("Please don't use object wrappers for primitive types");return"Object"}Se.undefined=Ey("undefined");Se.string=Ey("string");var Frt=Ey("number");Se.number=t=>Frt(t)&&!Se.nan(t);Se.bigint=Ey("bigint");Se.function_=Ey("function");Se.null_=t=>t===null;Se.class_=t=>Se.function_(t)&&t.toString().startsWith("class ");Se.boolean=t=>t===!0||t===!1;Se.symbol=Ey("symbol");Se.numericString=t=>Se.string(t)&&!Se.emptyStringOrWhitespace(t)&&!Number.isNaN(Number(t));Se.array=(t,e)=>Array.isArray(t)?Se.function_(e)?t.every(e):!0:!1;Se.buffer=t=>{var e,r,o,a;return(a=(o=(r=(e=t)===null||e===void 0?void 0:e.constructor)===null||r===void 0?void 0:r.isBuffer)===null||o===void 0?void 0:o.call(r,t))!==null&&a!==void 0?a:!1};Se.blob=t=>ii("Blob")(t);Se.nullOrUndefined=t=>Se.null_(t)||Se.undefined(t);Se.object=t=>!Se.null_(t)&&(typeof t=="object"||Se.function_(t));Se.iterable=t=>{var e;return Se.function_((e=t)===null||e===void 0?void 0:e[Symbol.iterator])};Se.asyncIterable=t=>{var e;return Se.function_((e=t)===null||e===void 0?void 0:e[Symbol.asyncIterator])};Se.generator=t=>{var e,r;return Se.iterable(t)&&Se.function_((e=t)===null||e===void 0?void 0:e.next)&&Se.function_((r=t)===null||r===void 0?void 0:r.throw)};Se.asyncGenerator=t=>Se.asyncIterable(t)&&Se.function_(t.next)&&Se.function_(t.throw);Se.nativePromise=t=>ii("Promise")(t);var Rrt=t=>{var e,r;return Se.function_((e=t)===null||e===void 0?void 0:e.then)&&Se.function_((r=t)===null||r===void 0?void 0:r.catch)};Se.promise=t=>Se.nativePromise(t)||Rrt(t);Se.generatorFunction=ii("GeneratorFunction");Se.asyncGeneratorFunction=t=>k1(t)==="AsyncGeneratorFunction";Se.asyncFunction=t=>k1(t)==="AsyncFunction";Se.boundFunction=t=>Se.function_(t)&&!t.hasOwnProperty("prototype");Se.regExp=ii("RegExp");Se.date=ii("Date");Se.error=ii("Error");Se.map=t=>ii("Map")(t);Se.set=t=>ii("Set")(t);Se.weakMap=t=>ii("WeakMap")(t);Se.weakSet=t=>ii("WeakSet")(t);Se.int8Array=ii("Int8Array");Se.uint8Array=ii("Uint8Array");Se.uint8ClampedArray=ii("Uint8ClampedArray");Se.int16Array=ii("Int16Array");Se.uint16Array=ii("Uint16Array");Se.int32Array=ii("Int32Array");Se.uint32Array=ii("Uint32Array");Se.float32Array=ii("Float32Array");Se.float64Array=ii("Float64Array");Se.bigInt64Array=ii("BigInt64Array");Se.bigUint64Array=ii("BigUint64Array");Se.arrayBuffer=ii("ArrayBuffer");Se.sharedArrayBuffer=ii("SharedArrayBuffer");Se.dataView=ii("DataView");Se.enumCase=(t,e)=>Object.values(e).includes(t);Se.directInstanceOf=(t,e)=>Object.getPrototypeOf(t)===e.prototype;Se.urlInstance=t=>ii("URL")(t);Se.urlString=t=>{if(!Se.string(t))return!1;try{return new URL(t),!0}catch{return!1}};Se.truthy=t=>!!t;Se.falsy=t=>!t;Se.nan=t=>Number.isNaN(t);Se.primitive=t=>Se.null_(t)||Qrt(typeof t);Se.integer=t=>Number.isInteger(t);Se.safeInteger=t=>Number.isSafeInteger(t);Se.plainObject=t=>{if(Loe.call(t)!=="[object Object]")return!1;let e=Object.getPrototypeOf(t);return e===null||e===Object.getPrototypeOf({})};Se.typedArray=t=>Srt(k1(t));var Trt=t=>Se.safeInteger(t)&&t>=0;Se.arrayLike=t=>!Se.nullOrUndefined(t)&&!Se.function_(t)&&Trt(t.length);Se.inRange=(t,e)=>{if(Se.number(e))return t>=Math.min(0,e)&&t<=Math.max(e,0);if(Se.array(e)&&e.length===2)return t>=Math.min(...e)&&t<=Math.max(...e);throw new TypeError(`Invalid range: ${JSON.stringify(e)}`)};var Lrt=1,Nrt=["innerHTML","ownerDocument","style","attributes","nodeValue"];Se.domElement=t=>Se.object(t)&&t.nodeType===Lrt&&Se.string(t.nodeName)&&!Se.plainObject(t)&&Nrt.every(e=>e in t);Se.observable=t=>{var e,r,o,a;return t?t===((r=(e=t)[Symbol.observable])===null||r===void 0?void 0:r.call(e))||t===((a=(o=t)["@@observable"])===null||a===void 0?void 0:a.call(o)):!1};Se.nodeStream=t=>Se.object(t)&&Se.function_(t.pipe)&&!Se.observable(t);Se.infinite=t=>t===1/0||t===-1/0;var Noe=t=>e=>Se.integer(e)&&Math.abs(e%2)===t;Se.evenInteger=Noe(0);Se.oddInteger=Noe(1);Se.emptyArray=t=>Se.array(t)&&t.length===0;Se.nonEmptyArray=t=>Se.array(t)&&t.length>0;Se.emptyString=t=>Se.string(t)&&t.length===0;var Ort=t=>Se.string(t)&&!/\S/.test(t);Se.emptyStringOrWhitespace=t=>Se.emptyString(t)||Ort(t);Se.nonEmptyString=t=>Se.string(t)&&t.length>0;Se.nonEmptyStringAndNotWhitespace=t=>Se.string(t)&&!Se.emptyStringOrWhitespace(t);Se.emptyObject=t=>Se.object(t)&&!Se.map(t)&&!Se.set(t)&&Object.keys(t).length===0;Se.nonEmptyObject=t=>Se.object(t)&&!Se.map(t)&&!Se.set(t)&&Object.keys(t).length>0;Se.emptySet=t=>Se.set(t)&&t.size===0;Se.nonEmptySet=t=>Se.set(t)&&t.size>0;Se.emptyMap=t=>Se.map(t)&&t.size===0;Se.nonEmptyMap=t=>Se.map(t)&&t.size>0;Se.propertyKey=t=>Se.any([Se.string,Se.number,Se.symbol],t);Se.formData=t=>ii("FormData")(t);Se.urlSearchParams=t=>ii("URLSearchParams")(t);var Ooe=(t,e,r)=>{if(!Se.function_(e))throw new TypeError(`Invalid predicate: ${JSON.stringify(e)}`);if(r.length===0)throw new TypeError("Invalid number of values");return t.call(r,e)};Se.any=(t,...e)=>(Se.array(t)?t:[t]).some(o=>Ooe(Array.prototype.some,o,e));Se.all=(t,...e)=>Ooe(Array.prototype.every,t,e);var Mt=(t,e,r,o={})=>{if(!t){let{multipleValues:a}=o,n=a?`received values of types ${[...new Set(r.map(u=>`\`${Se(u)}\``))].join(", ")}`:`received value of type \`${Se(r)}\``;throw new TypeError(`Expected value which is \`${e}\`, ${n}.`)}};Qf.assert={undefined:t=>Mt(Se.undefined(t),"undefined",t),string:t=>Mt(Se.string(t),"string",t),number:t=>Mt(Se.number(t),"number",t),bigint:t=>Mt(Se.bigint(t),"bigint",t),function_:t=>Mt(Se.function_(t),"Function",t),null_:t=>Mt(Se.null_(t),"null",t),class_:t=>Mt(Se.class_(t),"Class",t),boolean:t=>Mt(Se.boolean(t),"boolean",t),symbol:t=>Mt(Se.symbol(t),"symbol",t),numericString:t=>Mt(Se.numericString(t),"string with a number",t),array:(t,e)=>{Mt(Se.array(t),"Array",t),e&&t.forEach(e)},buffer:t=>Mt(Se.buffer(t),"Buffer",t),blob:t=>Mt(Se.blob(t),"Blob",t),nullOrUndefined:t=>Mt(Se.nullOrUndefined(t),"null or undefined",t),object:t=>Mt(Se.object(t),"Object",t),iterable:t=>Mt(Se.iterable(t),"Iterable",t),asyncIterable:t=>Mt(Se.asyncIterable(t),"AsyncIterable",t),generator:t=>Mt(Se.generator(t),"Generator",t),asyncGenerator:t=>Mt(Se.asyncGenerator(t),"AsyncGenerator",t),nativePromise:t=>Mt(Se.nativePromise(t),"native Promise",t),promise:t=>Mt(Se.promise(t),"Promise",t),generatorFunction:t=>Mt(Se.generatorFunction(t),"GeneratorFunction",t),asyncGeneratorFunction:t=>Mt(Se.asyncGeneratorFunction(t),"AsyncGeneratorFunction",t),asyncFunction:t=>Mt(Se.asyncFunction(t),"AsyncFunction",t),boundFunction:t=>Mt(Se.boundFunction(t),"Function",t),regExp:t=>Mt(Se.regExp(t),"RegExp",t),date:t=>Mt(Se.date(t),"Date",t),error:t=>Mt(Se.error(t),"Error",t),map:t=>Mt(Se.map(t),"Map",t),set:t=>Mt(Se.set(t),"Set",t),weakMap:t=>Mt(Se.weakMap(t),"WeakMap",t),weakSet:t=>Mt(Se.weakSet(t),"WeakSet",t),int8Array:t=>Mt(Se.int8Array(t),"Int8Array",t),uint8Array:t=>Mt(Se.uint8Array(t),"Uint8Array",t),uint8ClampedArray:t=>Mt(Se.uint8ClampedArray(t),"Uint8ClampedArray",t),int16Array:t=>Mt(Se.int16Array(t),"Int16Array",t),uint16Array:t=>Mt(Se.uint16Array(t),"Uint16Array",t),int32Array:t=>Mt(Se.int32Array(t),"Int32Array",t),uint32Array:t=>Mt(Se.uint32Array(t),"Uint32Array",t),float32Array:t=>Mt(Se.float32Array(t),"Float32Array",t),float64Array:t=>Mt(Se.float64Array(t),"Float64Array",t),bigInt64Array:t=>Mt(Se.bigInt64Array(t),"BigInt64Array",t),bigUint64Array:t=>Mt(Se.bigUint64Array(t),"BigUint64Array",t),arrayBuffer:t=>Mt(Se.arrayBuffer(t),"ArrayBuffer",t),sharedArrayBuffer:t=>Mt(Se.sharedArrayBuffer(t),"SharedArrayBuffer",t),dataView:t=>Mt(Se.dataView(t),"DataView",t),enumCase:(t,e)=>Mt(Se.enumCase(t,e),"EnumCase",t),urlInstance:t=>Mt(Se.urlInstance(t),"URL",t),urlString:t=>Mt(Se.urlString(t),"string with a URL",t),truthy:t=>Mt(Se.truthy(t),"truthy",t),falsy:t=>Mt(Se.falsy(t),"falsy",t),nan:t=>Mt(Se.nan(t),"NaN",t),primitive:t=>Mt(Se.primitive(t),"primitive",t),integer:t=>Mt(Se.integer(t),"integer",t),safeInteger:t=>Mt(Se.safeInteger(t),"integer",t),plainObject:t=>Mt(Se.plainObject(t),"plain object",t),typedArray:t=>Mt(Se.typedArray(t),"TypedArray",t),arrayLike:t=>Mt(Se.arrayLike(t),"array-like",t),domElement:t=>Mt(Se.domElement(t),"HTMLElement",t),observable:t=>Mt(Se.observable(t),"Observable",t),nodeStream:t=>Mt(Se.nodeStream(t),"Node.js Stream",t),infinite:t=>Mt(Se.infinite(t),"infinite number",t),emptyArray:t=>Mt(Se.emptyArray(t),"empty array",t),nonEmptyArray:t=>Mt(Se.nonEmptyArray(t),"non-empty array",t),emptyString:t=>Mt(Se.emptyString(t),"empty string",t),emptyStringOrWhitespace:t=>Mt(Se.emptyStringOrWhitespace(t),"empty string or whitespace",t),nonEmptyString:t=>Mt(Se.nonEmptyString(t),"non-empty string",t),nonEmptyStringAndNotWhitespace:t=>Mt(Se.nonEmptyStringAndNotWhitespace(t),"non-empty string and not whitespace",t),emptyObject:t=>Mt(Se.emptyObject(t),"empty object",t),nonEmptyObject:t=>Mt(Se.nonEmptyObject(t),"non-empty object",t),emptySet:t=>Mt(Se.emptySet(t),"empty set",t),nonEmptySet:t=>Mt(Se.nonEmptySet(t),"non-empty set",t),emptyMap:t=>Mt(Se.emptyMap(t),"empty map",t),nonEmptyMap:t=>Mt(Se.nonEmptyMap(t),"non-empty map",t),propertyKey:t=>Mt(Se.propertyKey(t),"PropertyKey",t),formData:t=>Mt(Se.formData(t),"FormData",t),urlSearchParams:t=>Mt(Se.urlSearchParams(t),"URLSearchParams",t),evenInteger:t=>Mt(Se.evenInteger(t),"even integer",t),oddInteger:t=>Mt(Se.oddInteger(t),"odd integer",t),directInstanceOf:(t,e)=>Mt(Se.directInstanceOf(t,e),"T",t),inRange:(t,e)=>Mt(Se.inRange(t,e),"in range",t),any:(t,...e)=>Mt(Se.any(t,...e),"predicate returns truthy for any value",e,{multipleValues:!0}),all:(t,...e)=>Mt(Se.all(t,...e),"predicate returns truthy for all values",e,{multipleValues:!0})};Object.defineProperties(Se,{class:{value:Se.class_},function:{value:Se.function_},null:{value:Se.null_}});Object.defineProperties(Qf.assert,{class:{value:Qf.assert.class_},function:{value:Qf.assert.function_},null:{value:Qf.assert.null_}});Qf.default=Se;Dx.exports=Se;Dx.exports.default=Se;Dx.exports.assert=Qf.assert});var Moe=_((GLt,o4)=>{"use strict";var Px=class extends Error{constructor(e){super(e||"Promise was canceled"),this.name="CancelError"}get isCanceled(){return!0}},Sx=class t{static fn(e){return(...r)=>new t((o,a,n)=>{r.push(n),e(...r).then(o,a)})}constructor(e){this._cancelHandlers=[],this._isPending=!0,this._isCanceled=!1,this._rejectOnCancel=!0,this._promise=new Promise((r,o)=>{this._reject=o;let a=A=>{this._isPending=!1,r(A)},n=A=>{this._isPending=!1,o(A)},u=A=>{if(!this._isPending)throw new Error("The `onCancel` handler was attached after the promise settled.");this._cancelHandlers.push(A)};return Object.defineProperties(u,{shouldReject:{get:()=>this._rejectOnCancel,set:A=>{this._rejectOnCancel=A}}}),e(a,n,u)})}then(e,r){return this._promise.then(e,r)}catch(e){return this._promise.catch(e)}finally(e){return this._promise.finally(e)}cancel(e){if(!(!this._isPending||this._isCanceled)){if(this._cancelHandlers.length>0)try{for(let r of this._cancelHandlers)r()}catch(r){this._reject(r)}this._isCanceled=!0,this._rejectOnCancel&&this._reject(new Px(e))}}get isCanceled(){return this._isCanceled}};Object.setPrototypeOf(Sx.prototype,Promise.prototype);o4.exports=Sx;o4.exports.CancelError=Px});var Uoe=_((l4,c4)=>{"use strict";Object.defineProperty(l4,"__esModule",{value:!0});function Mrt(t){return t.encrypted}var a4=(t,e)=>{let r;typeof e=="function"?r={connect:e}:r=e;let o=typeof r.connect=="function",a=typeof r.secureConnect=="function",n=typeof r.close=="function",u=()=>{o&&r.connect(),Mrt(t)&&a&&(t.authorized?r.secureConnect():t.authorizationError||t.once("secureConnect",r.secureConnect)),n&&t.once("close",r.close)};t.writable&&!t.connecting?u():t.connecting?t.once("connect",u):t.destroyed&&n&&r.close(t._hadError)};l4.default=a4;c4.exports=a4;c4.exports.default=a4});var _oe=_((A4,f4)=>{"use strict";Object.defineProperty(A4,"__esModule",{value:!0});var Urt=Uoe(),_rt=Number(process.versions.node.split(".")[0]),u4=t=>{let e={start:Date.now(),socket:void 0,lookup:void 0,connect:void 0,secureConnect:void 0,upload:void 0,response:void 0,end:void 0,error:void 0,abort:void 0,phases:{wait:void 0,dns:void 0,tcp:void 0,tls:void 0,request:void 0,firstByte:void 0,download:void 0,total:void 0}};t.timings=e;let r=u=>{let A=u.emit.bind(u);u.emit=(p,...h)=>(p==="error"&&(e.error=Date.now(),e.phases.total=e.error-e.start,u.emit=A),A(p,...h))};r(t),t.prependOnceListener("abort",()=>{e.abort=Date.now(),(!e.response||_rt>=13)&&(e.phases.total=Date.now()-e.start)});let o=u=>{e.socket=Date.now(),e.phases.wait=e.socket-e.start;let A=()=>{e.lookup=Date.now(),e.phases.dns=e.lookup-e.socket};u.prependOnceListener("lookup",A),Urt.default(u,{connect:()=>{e.connect=Date.now(),e.lookup===void 0&&(u.removeListener("lookup",A),e.lookup=e.connect,e.phases.dns=e.lookup-e.socket),e.phases.tcp=e.connect-e.lookup},secureConnect:()=>{e.secureConnect=Date.now(),e.phases.tls=e.secureConnect-e.connect}})};t.socket?o(t.socket):t.prependOnceListener("socket",o);let a=()=>{var u;e.upload=Date.now(),e.phases.request=e.upload-(u=e.secureConnect,u??e.connect)};return(typeof t.writableFinished=="boolean"?t.writableFinished:t.finished&&t.outputSize===0&&(!t.socket||t.socket.writableLength===0))?a():t.prependOnceListener("finish",a),t.prependOnceListener("response",u=>{e.response=Date.now(),e.phases.firstByte=e.response-e.upload,u.timings=e,r(u),u.prependOnceListener("end",()=>{e.end=Date.now(),e.phases.download=e.end-e.response,e.phases.total=e.end-e.start})}),e};A4.default=u4;f4.exports=u4;f4.exports.default=u4});var Koe=_((WLt,g4)=>{"use strict";var{V4MAPPED:Hrt,ADDRCONFIG:qrt,ALL:Yoe,promises:{Resolver:Hoe},lookup:jrt}=ve("dns"),{promisify:p4}=ve("util"),Grt=ve("os"),Cy=Symbol("cacheableLookupCreateConnection"),h4=Symbol("cacheableLookupInstance"),qoe=Symbol("expires"),Wrt=typeof Yoe=="number",joe=t=>{if(!(t&&typeof t.createConnection=="function"))throw new Error("Expected an Agent instance as the first argument")},Yrt=t=>{for(let e of t)e.family!==6&&(e.address=`::ffff:${e.address}`,e.family=6)},Goe=()=>{let t=!1,e=!1;for(let r of Object.values(Grt.networkInterfaces()))for(let o of r)if(!o.internal&&(o.family==="IPv6"?e=!0:t=!0,t&&e))return{has4:t,has6:e};return{has4:t,has6:e}},Krt=t=>Symbol.iterator in t,Woe={ttl:!0},Vrt={all:!0},xx=class{constructor({cache:e=new Map,maxTtl:r=1/0,fallbackDuration:o=3600,errorTtl:a=.15,resolver:n=new Hoe,lookup:u=jrt}={}){if(this.maxTtl=r,this.errorTtl=a,this._cache=e,this._resolver=n,this._dnsLookup=p4(u),this._resolver instanceof Hoe?(this._resolve4=this._resolver.resolve4.bind(this._resolver),this._resolve6=this._resolver.resolve6.bind(this._resolver)):(this._resolve4=p4(this._resolver.resolve4.bind(this._resolver)),this._resolve6=p4(this._resolver.resolve6.bind(this._resolver))),this._iface=Goe(),this._pending={},this._nextRemovalTime=!1,this._hostnamesToFallback=new Set,o<1)this._fallback=!1;else{this._fallback=!0;let A=setInterval(()=>{this._hostnamesToFallback.clear()},o*1e3);A.unref&&A.unref()}this.lookup=this.lookup.bind(this),this.lookupAsync=this.lookupAsync.bind(this)}set servers(e){this.clear(),this._resolver.setServers(e)}get servers(){return this._resolver.getServers()}lookup(e,r,o){if(typeof r=="function"?(o=r,r={}):typeof r=="number"&&(r={family:r}),!o)throw new Error("Callback must be a function.");this.lookupAsync(e,r).then(a=>{r.all?o(null,a):o(null,a.address,a.family,a.expires,a.ttl)},o)}async lookupAsync(e,r={}){typeof r=="number"&&(r={family:r});let o=await this.query(e);if(r.family===6){let a=o.filter(n=>n.family===6);r.hints&Hrt&&(Wrt&&r.hints&Yoe||a.length===0)?Yrt(o):o=a}else r.family===4&&(o=o.filter(a=>a.family===4));if(r.hints&qrt){let{_iface:a}=this;o=o.filter(n=>n.family===6?a.has6:a.has4)}if(o.length===0){let a=new Error(`cacheableLookup ENOTFOUND ${e}`);throw a.code="ENOTFOUND",a.hostname=e,a}return r.all?o:o[0]}async query(e){let r=await this._cache.get(e);if(!r){let o=this._pending[e];if(o)r=await o;else{let a=this.queryAndCache(e);this._pending[e]=a,r=await a}}return r=r.map(o=>({...o})),r}async _resolve(e){let r=async h=>{try{return await h}catch(E){if(E.code==="ENODATA"||E.code==="ENOTFOUND")return[];throw E}},[o,a]=await Promise.all([this._resolve4(e,Woe),this._resolve6(e,Woe)].map(h=>r(h))),n=0,u=0,A=0,p=Date.now();for(let h of o)h.family=4,h.expires=p+h.ttl*1e3,n=Math.max(n,h.ttl);for(let h of a)h.family=6,h.expires=p+h.ttl*1e3,u=Math.max(u,h.ttl);return o.length>0?a.length>0?A=Math.min(n,u):A=n:A=u,{entries:[...o,...a],cacheTtl:A}}async _lookup(e){try{return{entries:await this._dnsLookup(e,{all:!0}),cacheTtl:0}}catch{return{entries:[],cacheTtl:0}}}async _set(e,r,o){if(this.maxTtl>0&&o>0){o=Math.min(o,this.maxTtl)*1e3,r[qoe]=Date.now()+o;try{await this._cache.set(e,r,o)}catch(a){this.lookupAsync=async()=>{let n=new Error("Cache Error. Please recreate the CacheableLookup instance.");throw n.cause=a,n}}Krt(this._cache)&&this._tick(o)}}async queryAndCache(e){if(this._hostnamesToFallback.has(e))return this._dnsLookup(e,Vrt);try{let r=await this._resolve(e);r.entries.length===0&&this._fallback&&(r=await this._lookup(e),r.entries.length!==0&&this._hostnamesToFallback.add(e));let o=r.entries.length===0?this.errorTtl:r.cacheTtl;return await this._set(e,r.entries,o),delete this._pending[e],r.entries}catch(r){throw delete this._pending[e],r}}_tick(e){let r=this._nextRemovalTime;(!r||e{this._nextRemovalTime=!1;let o=1/0,a=Date.now();for(let[n,u]of this._cache){let A=u[qoe];a>=A?this._cache.delete(n):A("lookup"in r||(r.lookup=this.lookup),e[Cy](r,o))}uninstall(e){if(joe(e),e[Cy]){if(e[h4]!==this)throw new Error("The agent is not owned by this CacheableLookup instance");e.createConnection=e[Cy],delete e[Cy],delete e[h4]}}updateInterfaceInfo(){let{_iface:e}=this;this._iface=Goe(),(e.has4&&!this._iface.has4||e.has6&&!this._iface.has6)&&this._cache.clear()}clear(e){if(e){this._cache.delete(e);return}this._cache.clear()}};g4.exports=xx;g4.exports.default=xx});var Joe=_((YLt,d4)=>{"use strict";var zrt=typeof URL>"u"?ve("url").URL:URL,Jrt="text/plain",Xrt="us-ascii",Voe=(t,e)=>e.some(r=>r instanceof RegExp?r.test(t):r===t),Zrt=(t,{stripHash:e})=>{let r=t.match(/^data:([^,]*?),([^#]*?)(?:#(.*))?$/);if(!r)throw new Error(`Invalid URL: ${t}`);let o=r[1].split(";"),a=r[2],n=e?"":r[3],u=!1;o[o.length-1]==="base64"&&(o.pop(),u=!0);let A=(o.shift()||"").toLowerCase(),h=[...o.map(E=>{let[w,D=""]=E.split("=").map(b=>b.trim());return w==="charset"&&(D=D.toLowerCase(),D===Xrt)?"":`${w}${D?`=${D}`:""}`}).filter(Boolean)];return u&&h.push("base64"),(h.length!==0||A&&A!==Jrt)&&h.unshift(A),`data:${h.join(";")},${u?a.trim():a}${n?`#${n}`:""}`},zoe=(t,e)=>{if(e={defaultProtocol:"http:",normalizeProtocol:!0,forceHttp:!1,forceHttps:!1,stripAuthentication:!0,stripHash:!1,stripWWW:!0,removeQueryParameters:[/^utm_\w+/i],removeTrailingSlash:!0,removeDirectoryIndex:!1,sortQueryParameters:!0,...e},Reflect.has(e,"normalizeHttps"))throw new Error("options.normalizeHttps is renamed to options.forceHttp");if(Reflect.has(e,"normalizeHttp"))throw new Error("options.normalizeHttp is renamed to options.forceHttps");if(Reflect.has(e,"stripFragment"))throw new Error("options.stripFragment is renamed to options.stripHash");if(t=t.trim(),/^data:/i.test(t))return Zrt(t,e);let r=t.startsWith("//");!r&&/^\.*\//.test(t)||(t=t.replace(/^(?!(?:\w+:)?\/\/)|^\/\//,e.defaultProtocol));let a=new zrt(t);if(e.forceHttp&&e.forceHttps)throw new Error("The `forceHttp` and `forceHttps` options cannot be used together");if(e.forceHttp&&a.protocol==="https:"&&(a.protocol="http:"),e.forceHttps&&a.protocol==="http:"&&(a.protocol="https:"),e.stripAuthentication&&(a.username="",a.password=""),e.stripHash&&(a.hash=""),a.pathname&&(a.pathname=a.pathname.replace(/((?!:).|^)\/{2,}/g,(n,u)=>/^(?!\/)/g.test(u)?`${u}/`:"/")),a.pathname&&(a.pathname=decodeURI(a.pathname)),e.removeDirectoryIndex===!0&&(e.removeDirectoryIndex=[/^index\.[a-z]+$/]),Array.isArray(e.removeDirectoryIndex)&&e.removeDirectoryIndex.length>0){let n=a.pathname.split("/"),u=n[n.length-1];Voe(u,e.removeDirectoryIndex)&&(n=n.slice(0,n.length-1),a.pathname=n.slice(1).join("/")+"/")}if(a.hostname&&(a.hostname=a.hostname.replace(/\.$/,""),e.stripWWW&&/^www\.([a-z\-\d]{2,63})\.([a-z.]{2,5})$/.test(a.hostname)&&(a.hostname=a.hostname.replace(/^www\./,""))),Array.isArray(e.removeQueryParameters))for(let n of[...a.searchParams.keys()])Voe(n,e.removeQueryParameters)&&a.searchParams.delete(n);return e.sortQueryParameters&&a.searchParams.sort(),e.removeTrailingSlash&&(a.pathname=a.pathname.replace(/\/$/,"")),t=a.toString(),(e.removeTrailingSlash||a.pathname==="/")&&a.hash===""&&(t=t.replace(/\/$/,"")),r&&!e.normalizeProtocol&&(t=t.replace(/^http:\/\//,"//")),e.stripProtocol&&(t=t.replace(/^(?:https?:)?\/\//,"")),t};d4.exports=zoe;d4.exports.default=zoe});var $oe=_((KLt,Zoe)=>{Zoe.exports=Xoe;function Xoe(t,e){if(t&&e)return Xoe(t)(e);if(typeof t!="function")throw new TypeError("need wrapper function");return Object.keys(t).forEach(function(o){r[o]=t[o]}),r;function r(){for(var o=new Array(arguments.length),a=0;a{var eae=$oe();m4.exports=eae(bx);m4.exports.strict=eae(tae);bx.proto=bx(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return bx(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return tae(this)},configurable:!0})});function bx(t){var e=function(){return e.called?e.value:(e.called=!0,e.value=t.apply(this,arguments))};return e.called=!1,e}function tae(t){var e=function(){if(e.called)throw new Error(e.onceError);return e.called=!0,e.value=t.apply(this,arguments)},r=t.name||"Function wrapped with `once`";return e.onceError=r+" shouldn't be called more than once",e.called=!1,e}});var E4=_((zLt,nae)=>{var $rt=y4(),ent=function(){},tnt=function(t){return t.setHeader&&typeof t.abort=="function"},rnt=function(t){return t.stdio&&Array.isArray(t.stdio)&&t.stdio.length===3},rae=function(t,e,r){if(typeof e=="function")return rae(t,null,e);e||(e={}),r=$rt(r||ent);var o=t._writableState,a=t._readableState,n=e.readable||e.readable!==!1&&t.readable,u=e.writable||e.writable!==!1&&t.writable,A=function(){t.writable||p()},p=function(){u=!1,n||r.call(t)},h=function(){n=!1,u||r.call(t)},E=function(C){r.call(t,C?new Error("exited with error code: "+C):null)},w=function(C){r.call(t,C)},D=function(){if(n&&!(a&&a.ended))return r.call(t,new Error("premature close"));if(u&&!(o&&o.ended))return r.call(t,new Error("premature close"))},b=function(){t.req.on("finish",p)};return tnt(t)?(t.on("complete",p),t.on("abort",D),t.req?b():t.on("request",b)):u&&!o&&(t.on("end",A),t.on("close",A)),rnt(t)&&t.on("exit",E),t.on("end",h),t.on("finish",p),e.error!==!1&&t.on("error",w),t.on("close",D),function(){t.removeListener("complete",p),t.removeListener("abort",D),t.removeListener("request",b),t.req&&t.req.removeListener("finish",p),t.removeListener("end",A),t.removeListener("close",A),t.removeListener("finish",p),t.removeListener("exit",E),t.removeListener("end",h),t.removeListener("error",w),t.removeListener("close",D)}};nae.exports=rae});var oae=_((JLt,sae)=>{var nnt=y4(),int=E4(),C4=ve("fs"),Q1=function(){},snt=/^v?\.0/.test(process.version),kx=function(t){return typeof t=="function"},ont=function(t){return!snt||!C4?!1:(t instanceof(C4.ReadStream||Q1)||t instanceof(C4.WriteStream||Q1))&&kx(t.close)},ant=function(t){return t.setHeader&&kx(t.abort)},lnt=function(t,e,r,o){o=nnt(o);var a=!1;t.on("close",function(){a=!0}),int(t,{readable:e,writable:r},function(u){if(u)return o(u);a=!0,o()});var n=!1;return function(u){if(!a&&!n){if(n=!0,ont(t))return t.close(Q1);if(ant(t))return t.abort();if(kx(t.destroy))return t.destroy();o(u||new Error("stream was destroyed"))}}},iae=function(t){t()},cnt=function(t,e){return t.pipe(e)},unt=function(){var t=Array.prototype.slice.call(arguments),e=kx(t[t.length-1]||Q1)&&t.pop()||Q1;if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new Error("pump requires two streams per minimum");var r,o=t.map(function(a,n){var u=n0;return lnt(a,u,A,function(p){r||(r=p),p&&o.forEach(iae),!u&&(o.forEach(iae),e(r))})});return t.reduce(cnt)};sae.exports=unt});var lae=_((XLt,aae)=>{"use strict";var{PassThrough:Ant}=ve("stream");aae.exports=t=>{t={...t};let{array:e}=t,{encoding:r}=t,o=r==="buffer",a=!1;e?a=!(r||o):r=r||"utf8",o&&(r=null);let n=new Ant({objectMode:a});r&&n.setEncoding(r);let u=0,A=[];return n.on("data",p=>{A.push(p),a?u=A.length:u+=p.length}),n.getBufferedValue=()=>e?A:o?Buffer.concat(A,u):A.join(""),n.getBufferedLength=()=>u,n}});var cae=_((ZLt,Iy)=>{"use strict";var fnt=oae(),pnt=lae(),Qx=class extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}};async function Fx(t,e){if(!t)return Promise.reject(new Error("Expected a stream"));e={maxBuffer:1/0,...e};let{maxBuffer:r}=e,o;return await new Promise((a,n)=>{let u=A=>{A&&(A.bufferedData=o.getBufferedValue()),n(A)};o=fnt(t,pnt(e),A=>{if(A){u(A);return}a()}),o.on("data",()=>{o.getBufferedLength()>r&&u(new Qx)})}),o.getBufferedValue()}Iy.exports=Fx;Iy.exports.default=Fx;Iy.exports.buffer=(t,e)=>Fx(t,{...e,encoding:"buffer"});Iy.exports.array=(t,e)=>Fx(t,{...e,array:!0});Iy.exports.MaxBufferError=Qx});var Aae=_((eNt,uae)=>{"use strict";var hnt=new Set([200,203,204,206,300,301,308,404,405,410,414,501]),gnt=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]),dnt=new Set([500,502,503,504]),mnt={date:!0,connection:!0,"keep-alive":!0,"proxy-authenticate":!0,"proxy-authorization":!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0},ynt={"content-length":!0,"content-encoding":!0,"transfer-encoding":!0,"content-range":!0};function Sg(t){let e=parseInt(t,10);return isFinite(e)?e:0}function Ent(t){return t?dnt.has(t.status):!0}function I4(t){let e={};if(!t)return e;let r=t.trim().split(/,/);for(let o of r){let[a,n]=o.split(/=/,2);e[a.trim()]=n===void 0?!0:n.trim().replace(/^"|"$/g,"")}return e}function Cnt(t){let e=[];for(let r in t){let o=t[r];e.push(o===!0?r:r+"="+o)}if(e.length)return e.join(", ")}uae.exports=class{constructor(e,r,{shared:o,cacheHeuristic:a,immutableMinTimeToLive:n,ignoreCargoCult:u,_fromObject:A}={}){if(A){this._fromObject(A);return}if(!r||!r.headers)throw Error("Response headers missing");this._assertRequestHasHeaders(e),this._responseTime=this.now(),this._isShared=o!==!1,this._cacheHeuristic=a!==void 0?a:.1,this._immutableMinTtl=n!==void 0?n:24*3600*1e3,this._status="status"in r?r.status:200,this._resHeaders=r.headers,this._rescc=I4(r.headers["cache-control"]),this._method="method"in e?e.method:"GET",this._url=e.url,this._host=e.headers.host,this._noAuthorization=!e.headers.authorization,this._reqHeaders=r.headers.vary?e.headers:null,this._reqcc=I4(e.headers["cache-control"]),u&&"pre-check"in this._rescc&&"post-check"in this._rescc&&(delete this._rescc["pre-check"],delete this._rescc["post-check"],delete this._rescc["no-cache"],delete this._rescc["no-store"],delete this._rescc["must-revalidate"],this._resHeaders=Object.assign({},this._resHeaders,{"cache-control":Cnt(this._rescc)}),delete this._resHeaders.expires,delete this._resHeaders.pragma),r.headers["cache-control"]==null&&/no-cache/.test(r.headers.pragma)&&(this._rescc["no-cache"]=!0)}now(){return Date.now()}storable(){return!!(!this._reqcc["no-store"]&&(this._method==="GET"||this._method==="HEAD"||this._method==="POST"&&this._hasExplicitExpiration())&&gnt.has(this._status)&&!this._rescc["no-store"]&&(!this._isShared||!this._rescc.private)&&(!this._isShared||this._noAuthorization||this._allowsStoringAuthenticated())&&(this._resHeaders.expires||this._rescc["max-age"]||this._isShared&&this._rescc["s-maxage"]||this._rescc.public||hnt.has(this._status)))}_hasExplicitExpiration(){return this._isShared&&this._rescc["s-maxage"]||this._rescc["max-age"]||this._resHeaders.expires}_assertRequestHasHeaders(e){if(!e||!e.headers)throw Error("Request headers missing")}satisfiesWithoutRevalidation(e){this._assertRequestHasHeaders(e);let r=I4(e.headers["cache-control"]);return r["no-cache"]||/no-cache/.test(e.headers.pragma)||r["max-age"]&&this.age()>r["max-age"]||r["min-fresh"]&&this.timeToLive()<1e3*r["min-fresh"]||this.stale()&&!(r["max-stale"]&&!this._rescc["must-revalidate"]&&(r["max-stale"]===!0||r["max-stale"]>this.age()-this.maxAge()))?!1:this._requestMatches(e,!1)}_requestMatches(e,r){return(!this._url||this._url===e.url)&&this._host===e.headers.host&&(!e.method||this._method===e.method||r&&e.method==="HEAD")&&this._varyMatches(e)}_allowsStoringAuthenticated(){return this._rescc["must-revalidate"]||this._rescc.public||this._rescc["s-maxage"]}_varyMatches(e){if(!this._resHeaders.vary)return!0;if(this._resHeaders.vary==="*")return!1;let r=this._resHeaders.vary.trim().toLowerCase().split(/\s*,\s*/);for(let o of r)if(e.headers[o]!==this._reqHeaders[o])return!1;return!0}_copyWithoutHopByHopHeaders(e){let r={};for(let o in e)mnt[o]||(r[o]=e[o]);if(e.connection){let o=e.connection.trim().split(/\s*,\s*/);for(let a of o)delete r[a]}if(r.warning){let o=r.warning.split(/,/).filter(a=>!/^\s*1[0-9][0-9]/.test(a));o.length?r.warning=o.join(",").trim():delete r.warning}return r}responseHeaders(){let e=this._copyWithoutHopByHopHeaders(this._resHeaders),r=this.age();return r>3600*24&&!this._hasExplicitExpiration()&&this.maxAge()>3600*24&&(e.warning=(e.warning?`${e.warning}, `:"")+'113 - "rfc7234 5.5.4"'),e.age=`${Math.round(r)}`,e.date=new Date(this.now()).toUTCString(),e}date(){let e=Date.parse(this._resHeaders.date);return isFinite(e)?e:this._responseTime}age(){let e=this._ageValue(),r=(this.now()-this._responseTime)/1e3;return e+r}_ageValue(){return Sg(this._resHeaders.age)}maxAge(){if(!this.storable()||this._rescc["no-cache"]||this._isShared&&this._resHeaders["set-cookie"]&&!this._rescc.public&&!this._rescc.immutable||this._resHeaders.vary==="*")return 0;if(this._isShared){if(this._rescc["proxy-revalidate"])return 0;if(this._rescc["s-maxage"])return Sg(this._rescc["s-maxage"])}if(this._rescc["max-age"])return Sg(this._rescc["max-age"]);let e=this._rescc.immutable?this._immutableMinTtl:0,r=this.date();if(this._resHeaders.expires){let o=Date.parse(this._resHeaders.expires);return Number.isNaN(o)||oo)return Math.max(e,(r-o)/1e3*this._cacheHeuristic)}return e}timeToLive(){let e=this.maxAge()-this.age(),r=e+Sg(this._rescc["stale-if-error"]),o=e+Sg(this._rescc["stale-while-revalidate"]);return Math.max(0,e,r,o)*1e3}stale(){return this.maxAge()<=this.age()}_useStaleIfError(){return this.maxAge()+Sg(this._rescc["stale-if-error"])>this.age()}useStaleWhileRevalidate(){return this.maxAge()+Sg(this._rescc["stale-while-revalidate"])>this.age()}static fromObject(e){return new this(void 0,void 0,{_fromObject:e})}_fromObject(e){if(this._responseTime)throw Error("Reinitialized");if(!e||e.v!==1)throw Error("Invalid serialization");this._responseTime=e.t,this._isShared=e.sh,this._cacheHeuristic=e.ch,this._immutableMinTtl=e.imm!==void 0?e.imm:24*3600*1e3,this._status=e.st,this._resHeaders=e.resh,this._rescc=e.rescc,this._method=e.m,this._url=e.u,this._host=e.h,this._noAuthorization=e.a,this._reqHeaders=e.reqh,this._reqcc=e.reqcc}toObject(){return{v:1,t:this._responseTime,sh:this._isShared,ch:this._cacheHeuristic,imm:this._immutableMinTtl,st:this._status,resh:this._resHeaders,rescc:this._rescc,m:this._method,u:this._url,h:this._host,a:this._noAuthorization,reqh:this._reqHeaders,reqcc:this._reqcc}}revalidationHeaders(e){this._assertRequestHasHeaders(e);let r=this._copyWithoutHopByHopHeaders(e.headers);if(delete r["if-range"],!this._requestMatches(e,!0)||!this.storable())return delete r["if-none-match"],delete r["if-modified-since"],r;if(this._resHeaders.etag&&(r["if-none-match"]=r["if-none-match"]?`${r["if-none-match"]}, ${this._resHeaders.etag}`:this._resHeaders.etag),r["accept-ranges"]||r["if-match"]||r["if-unmodified-since"]||this._method&&this._method!="GET"){if(delete r["if-modified-since"],r["if-none-match"]){let a=r["if-none-match"].split(/,/).filter(n=>!/^\s*W\//.test(n));a.length?r["if-none-match"]=a.join(",").trim():delete r["if-none-match"]}}else this._resHeaders["last-modified"]&&!r["if-modified-since"]&&(r["if-modified-since"]=this._resHeaders["last-modified"]);return r}revalidatedPolicy(e,r){if(this._assertRequestHasHeaders(e),this._useStaleIfError()&&Ent(r))return{modified:!1,matches:!1,policy:this};if(!r||!r.headers)throw Error("Response headers missing");let o=!1;if(r.status!==void 0&&r.status!=304?o=!1:r.headers.etag&&!/^\s*W\//.test(r.headers.etag)?o=this._resHeaders.etag&&this._resHeaders.etag.replace(/^\s*W\//,"")===r.headers.etag:this._resHeaders.etag&&r.headers.etag?o=this._resHeaders.etag.replace(/^\s*W\//,"")===r.headers.etag.replace(/^\s*W\//,""):this._resHeaders["last-modified"]?o=this._resHeaders["last-modified"]===r.headers["last-modified"]:!this._resHeaders.etag&&!this._resHeaders["last-modified"]&&!r.headers.etag&&!r.headers["last-modified"]&&(o=!0),!o)return{policy:new this.constructor(e,r),modified:r.status!=304,matches:!1};let a={};for(let u in this._resHeaders)a[u]=u in r.headers&&!ynt[u]?r.headers[u]:this._resHeaders[u];let n=Object.assign({},r,{status:this._status,method:this._method,headers:a});return{policy:new this.constructor(e,n,{shared:this._isShared,cacheHeuristic:this._cacheHeuristic,immutableMinTimeToLive:this._immutableMinTtl}),modified:!1,matches:!0}}}});var Rx=_((tNt,fae)=>{"use strict";fae.exports=t=>{let e={};for(let[r,o]of Object.entries(t))e[r.toLowerCase()]=o;return e}});var hae=_((rNt,pae)=>{"use strict";var Int=ve("stream").Readable,wnt=Rx(),w4=class extends Int{constructor(e,r,o,a){if(typeof e!="number")throw new TypeError("Argument `statusCode` should be a number");if(typeof r!="object")throw new TypeError("Argument `headers` should be an object");if(!(o instanceof Buffer))throw new TypeError("Argument `body` should be a buffer");if(typeof a!="string")throw new TypeError("Argument `url` should be a string");super(),this.statusCode=e,this.headers=wnt(r),this.body=o,this.url=a}_read(){this.push(this.body),this.push(null)}};pae.exports=w4});var dae=_((nNt,gae)=>{"use strict";var Bnt=["destroy","setTimeout","socket","headers","trailers","rawHeaders","statusCode","httpVersion","httpVersionMinor","httpVersionMajor","rawTrailers","statusMessage"];gae.exports=(t,e)=>{let r=new Set(Object.keys(t).concat(Bnt));for(let o of r)o in e||(e[o]=typeof t[o]=="function"?t[o].bind(t):t[o])}});var yae=_((iNt,mae)=>{"use strict";var vnt=ve("stream").PassThrough,Dnt=dae(),Pnt=t=>{if(!(t&&t.pipe))throw new TypeError("Parameter `response` must be a response stream.");let e=new vnt;return Dnt(t,e),t.pipe(e)};mae.exports=Pnt});var Eae=_(B4=>{B4.stringify=function t(e){if(typeof e>"u")return e;if(e&&Buffer.isBuffer(e))return JSON.stringify(":base64:"+e.toString("base64"));if(e&&e.toJSON&&(e=e.toJSON()),e&&typeof e=="object"){var r="",o=Array.isArray(e);r=o?"[":"{";var a=!0;for(var n in e){var u=typeof e[n]=="function"||!o&&typeof e[n]>"u";Object.hasOwnProperty.call(e,n)&&!u&&(a||(r+=","),a=!1,o?e[n]==null?r+="null":r+=t(e[n]):e[n]!==void 0&&(r+=t(n)+":"+t(e[n])))}return r+=o?"]":"}",r}else return typeof e=="string"?JSON.stringify(/^:/.test(e)?":"+e:e):typeof e>"u"?"null":JSON.stringify(e)};B4.parse=function(t){return JSON.parse(t,function(e,r){return typeof r=="string"?/^:base64:/.test(r)?Buffer.from(r.substring(8),"base64"):/^:/.test(r)?r.substring(1):r:r})}});var Bae=_((oNt,wae)=>{"use strict";var Snt=ve("events"),Cae=Eae(),xnt=t=>{let e={redis:"@keyv/redis",rediss:"@keyv/redis",mongodb:"@keyv/mongo",mongo:"@keyv/mongo",sqlite:"@keyv/sqlite",postgresql:"@keyv/postgres",postgres:"@keyv/postgres",mysql:"@keyv/mysql",etcd:"@keyv/etcd",offline:"@keyv/offline",tiered:"@keyv/tiered"};if(t.adapter||t.uri){let r=t.adapter||/^[^:+]*/.exec(t.uri)[0];return new(ve(e[r]))(t)}return new Map},Iae=["sqlite","postgres","mysql","mongo","redis","tiered"],v4=class extends Snt{constructor(e,{emitErrors:r=!0,...o}={}){if(super(),this.opts={namespace:"keyv",serialize:Cae.stringify,deserialize:Cae.parse,...typeof e=="string"?{uri:e}:e,...o},!this.opts.store){let n={...this.opts};this.opts.store=xnt(n)}if(this.opts.compression){let n=this.opts.compression;this.opts.serialize=n.serialize.bind(n),this.opts.deserialize=n.deserialize.bind(n)}typeof this.opts.store.on=="function"&&r&&this.opts.store.on("error",n=>this.emit("error",n)),this.opts.store.namespace=this.opts.namespace;let a=n=>async function*(){for await(let[u,A]of typeof n=="function"?n(this.opts.store.namespace):n){let p=await this.opts.deserialize(A);if(!(this.opts.store.namespace&&!u.includes(this.opts.store.namespace))){if(typeof p.expires=="number"&&Date.now()>p.expires){this.delete(u);continue}yield[this._getKeyUnprefix(u),p.value]}}};typeof this.opts.store[Symbol.iterator]=="function"&&this.opts.store instanceof Map?this.iterator=a(this.opts.store):typeof this.opts.store.iterator=="function"&&this.opts.store.opts&&this._checkIterableAdaptar()&&(this.iterator=a(this.opts.store.iterator.bind(this.opts.store)))}_checkIterableAdaptar(){return Iae.includes(this.opts.store.opts.dialect)||Iae.findIndex(e=>this.opts.store.opts.url.includes(e))>=0}_getKeyPrefix(e){return`${this.opts.namespace}:${e}`}_getKeyPrefixArray(e){return e.map(r=>`${this.opts.namespace}:${r}`)}_getKeyUnprefix(e){return e.split(":").splice(1).join(":")}get(e,r){let{store:o}=this.opts,a=Array.isArray(e),n=a?this._getKeyPrefixArray(e):this._getKeyPrefix(e);if(a&&o.getMany===void 0){let u=[];for(let A of n)u.push(Promise.resolve().then(()=>o.get(A)).then(p=>typeof p=="string"?this.opts.deserialize(p):this.opts.compression?this.opts.deserialize(p):p).then(p=>{if(p!=null)return typeof p.expires=="number"&&Date.now()>p.expires?this.delete(A).then(()=>{}):r&&r.raw?p:p.value}));return Promise.allSettled(u).then(A=>{let p=[];for(let h of A)p.push(h.value);return p})}return Promise.resolve().then(()=>a?o.getMany(n):o.get(n)).then(u=>typeof u=="string"?this.opts.deserialize(u):this.opts.compression?this.opts.deserialize(u):u).then(u=>{if(u!=null)return a?u.map((A,p)=>{if(typeof A=="string"&&(A=this.opts.deserialize(A)),A!=null){if(typeof A.expires=="number"&&Date.now()>A.expires){this.delete(e[p]).then(()=>{});return}return r&&r.raw?A:A.value}}):typeof u.expires=="number"&&Date.now()>u.expires?this.delete(e).then(()=>{}):r&&r.raw?u:u.value})}set(e,r,o){let a=this._getKeyPrefix(e);typeof o>"u"&&(o=this.opts.ttl),o===0&&(o=void 0);let{store:n}=this.opts;return Promise.resolve().then(()=>{let u=typeof o=="number"?Date.now()+o:null;return typeof r=="symbol"&&this.emit("error","symbol cannot be serialized"),r={value:r,expires:u},this.opts.serialize(r)}).then(u=>n.set(a,u,o)).then(()=>!0)}delete(e){let{store:r}=this.opts;if(Array.isArray(e)){let a=this._getKeyPrefixArray(e);if(r.deleteMany===void 0){let n=[];for(let u of a)n.push(r.delete(u));return Promise.allSettled(n).then(u=>u.every(A=>A.value===!0))}return Promise.resolve().then(()=>r.deleteMany(a))}let o=this._getKeyPrefix(e);return Promise.resolve().then(()=>r.delete(o))}clear(){let{store:e}=this.opts;return Promise.resolve().then(()=>e.clear())}has(e){let r=this._getKeyPrefix(e),{store:o}=this.opts;return Promise.resolve().then(async()=>typeof o.has=="function"?o.has(r):await o.get(r)!==void 0)}disconnect(){let{store:e}=this.opts;if(typeof e.disconnect=="function")return e.disconnect()}};wae.exports=v4});var Pae=_((lNt,Dae)=>{"use strict";var bnt=ve("events"),Tx=ve("url"),knt=Joe(),Qnt=cae(),D4=Aae(),vae=hae(),Fnt=Rx(),Rnt=yae(),Tnt=Bae(),F1=class t{constructor(e,r){if(typeof e!="function")throw new TypeError("Parameter `request` must be a function");return this.cache=new Tnt({uri:typeof r=="string"&&r,store:typeof r!="string"&&r,namespace:"cacheable-request"}),this.createCacheableRequest(e)}createCacheableRequest(e){return(r,o)=>{let a;if(typeof r=="string")a=P4(Tx.parse(r)),r={};else if(r instanceof Tx.URL)a=P4(Tx.parse(r.toString())),r={};else{let[w,...D]=(r.path||"").split("?"),b=D.length>0?`?${D.join("?")}`:"";a=P4({...r,pathname:w,search:b})}r={headers:{},method:"GET",cache:!0,strictTtl:!1,automaticFailover:!1,...r,...Lnt(a)},r.headers=Fnt(r.headers);let n=new bnt,u=knt(Tx.format(a),{stripWWW:!1,removeTrailingSlash:!1,stripAuthentication:!1}),A=`${r.method}:${u}`,p=!1,h=!1,E=w=>{h=!0;let D=!1,b,C=new Promise(N=>{b=()=>{D||(D=!0,N())}}),T=N=>{if(p&&!w.forceRefresh){N.status=N.statusCode;let z=D4.fromObject(p.cachePolicy).revalidatedPolicy(w,N);if(!z.modified){let te=z.policy.responseHeaders();N=new vae(p.statusCode,te,p.body,p.url),N.cachePolicy=z.policy,N.fromCache=!0}}N.fromCache||(N.cachePolicy=new D4(w,N,w),N.fromCache=!1);let U;w.cache&&N.cachePolicy.storable()?(U=Rnt(N),(async()=>{try{let z=Qnt.buffer(N);if(await Promise.race([C,new Promise(ue=>N.once("end",ue))]),D)return;let te=await z,le={cachePolicy:N.cachePolicy.toObject(),url:N.url,statusCode:N.fromCache?p.statusCode:N.statusCode,body:te},ce=w.strictTtl?N.cachePolicy.timeToLive():void 0;w.maxTtl&&(ce=ce?Math.min(ce,w.maxTtl):w.maxTtl),await this.cache.set(A,le,ce)}catch(z){n.emit("error",new t.CacheError(z))}})()):w.cache&&p&&(async()=>{try{await this.cache.delete(A)}catch(z){n.emit("error",new t.CacheError(z))}})(),n.emit("response",U||N),typeof o=="function"&&o(U||N)};try{let N=e(w,T);N.once("error",b),N.once("abort",b),n.emit("request",N)}catch(N){n.emit("error",new t.RequestError(N))}};return(async()=>{let w=async b=>{await Promise.resolve();let C=b.cache?await this.cache.get(A):void 0;if(typeof C>"u")return E(b);let T=D4.fromObject(C.cachePolicy);if(T.satisfiesWithoutRevalidation(b)&&!b.forceRefresh){let N=T.responseHeaders(),U=new vae(C.statusCode,N,C.body,C.url);U.cachePolicy=T,U.fromCache=!0,n.emit("response",U),typeof o=="function"&&o(U)}else p=C,b.headers=T.revalidationHeaders(b),E(b)},D=b=>n.emit("error",new t.CacheError(b));this.cache.once("error",D),n.on("response",()=>this.cache.removeListener("error",D));try{await w(r)}catch(b){r.automaticFailover&&!h&&E(r),n.emit("error",new t.CacheError(b))}})(),n}}};function Lnt(t){let e={...t};return e.path=`${t.pathname||"/"}${t.search||""}`,delete e.pathname,delete e.search,e}function P4(t){return{protocol:t.protocol,auth:t.auth,hostname:t.hostname||t.host||"localhost",port:t.port,pathname:t.pathname,search:t.search}}F1.RequestError=class extends Error{constructor(t){super(t.message),this.name="RequestError",Object.assign(this,t)}};F1.CacheError=class extends Error{constructor(t){super(t.message),this.name="CacheError",Object.assign(this,t)}};Dae.exports=F1});var xae=_((ANt,Sae)=>{"use strict";var Nnt=["aborted","complete","headers","httpVersion","httpVersionMinor","httpVersionMajor","method","rawHeaders","rawTrailers","setTimeout","socket","statusCode","statusMessage","trailers","url"];Sae.exports=(t,e)=>{if(e._readableState.autoDestroy)throw new Error("The second stream must have the `autoDestroy` option set to `false`");let r=new Set(Object.keys(t).concat(Nnt)),o={};for(let a of r)a in e||(o[a]={get(){let n=t[a];return typeof n=="function"?n.bind(t):n},set(n){t[a]=n},enumerable:!0,configurable:!1});return Object.defineProperties(e,o),t.once("aborted",()=>{e.destroy(),e.emit("aborted")}),t.once("close",()=>{t.complete&&e.readable?e.once("end",()=>{e.emit("close")}):e.emit("close")}),e}});var kae=_((fNt,bae)=>{"use strict";var{Transform:Ont,PassThrough:Mnt}=ve("stream"),S4=ve("zlib"),Unt=xae();bae.exports=t=>{let e=(t.headers["content-encoding"]||"").toLowerCase();if(!["gzip","deflate","br"].includes(e))return t;let r=e==="br";if(r&&typeof S4.createBrotliDecompress!="function")return t.destroy(new Error("Brotli is not supported on Node.js < 12")),t;let o=!0,a=new Ont({transform(A,p,h){o=!1,h(null,A)},flush(A){A()}}),n=new Mnt({autoDestroy:!1,destroy(A,p){t.destroy(),p(A)}}),u=r?S4.createBrotliDecompress():S4.createUnzip();return u.once("error",A=>{if(o&&!t.readable){n.end();return}n.destroy(A)}),Unt(t,n),t.pipe(a).pipe(u).pipe(n),n}});var b4=_((pNt,Qae)=>{"use strict";var x4=class{constructor(e={}){if(!(e.maxSize&&e.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");this.maxSize=e.maxSize,this.onEviction=e.onEviction,this.cache=new Map,this.oldCache=new Map,this._size=0}_set(e,r){if(this.cache.set(e,r),this._size++,this._size>=this.maxSize){if(this._size=0,typeof this.onEviction=="function")for(let[o,a]of this.oldCache.entries())this.onEviction(o,a);this.oldCache=this.cache,this.cache=new Map}}get(e){if(this.cache.has(e))return this.cache.get(e);if(this.oldCache.has(e)){let r=this.oldCache.get(e);return this.oldCache.delete(e),this._set(e,r),r}}set(e,r){return this.cache.has(e)?this.cache.set(e,r):this._set(e,r),this}has(e){return this.cache.has(e)||this.oldCache.has(e)}peek(e){if(this.cache.has(e))return this.cache.get(e);if(this.oldCache.has(e))return this.oldCache.get(e)}delete(e){let r=this.cache.delete(e);return r&&this._size--,this.oldCache.delete(e)||r}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}*keys(){for(let[e]of this)yield e}*values(){for(let[,e]of this)yield e}*[Symbol.iterator](){for(let e of this.cache)yield e;for(let e of this.oldCache){let[r]=e;this.cache.has(r)||(yield e)}}get size(){let e=0;for(let r of this.oldCache.keys())this.cache.has(r)||e++;return Math.min(this._size+e,this.maxSize)}};Qae.exports=x4});var Q4=_((hNt,Lae)=>{"use strict";var _nt=ve("events"),Hnt=ve("tls"),qnt=ve("http2"),jnt=b4(),ea=Symbol("currentStreamsCount"),Fae=Symbol("request"),zl=Symbol("cachedOriginSet"),wy=Symbol("gracefullyClosing"),Gnt=["maxDeflateDynamicTableSize","maxSessionMemory","maxHeaderListPairs","maxOutstandingPings","maxReservedRemoteStreams","maxSendHeaderBlockLength","paddingStrategy","localAddress","path","rejectUnauthorized","minDHSize","ca","cert","clientCertEngine","ciphers","key","pfx","servername","minVersion","maxVersion","secureProtocol","crl","honorCipherOrder","ecdhCurve","dhparam","secureOptions","sessionIdContext"],Wnt=(t,e,r)=>{let o=0,a=t.length;for(;o>>1;r(t[n],e)?o=n+1:a=n}return o},Ynt=(t,e)=>t.remoteSettings.maxConcurrentStreams>e.remoteSettings.maxConcurrentStreams,k4=(t,e)=>{for(let r of t)r[zl].lengthe[zl].includes(o))&&r[ea]+e[ea]<=e.remoteSettings.maxConcurrentStreams&&Tae(r)},Knt=(t,e)=>{for(let r of t)e[zl].lengthr[zl].includes(o))&&e[ea]+r[ea]<=r.remoteSettings.maxConcurrentStreams&&Tae(e)},Rae=({agent:t,isFree:e})=>{let r={};for(let o in t.sessions){let n=t.sessions[o].filter(u=>{let A=u[xg.kCurrentStreamsCount]{t[wy]=!0,t[ea]===0&&t.close()},xg=class t extends _nt{constructor({timeout:e=6e4,maxSessions:r=1/0,maxFreeSessions:o=10,maxCachedTlsSessions:a=100}={}){super(),this.sessions={},this.queue={},this.timeout=e,this.maxSessions=r,this.maxFreeSessions=o,this._freeSessionsCount=0,this._sessionsCount=0,this.settings={enablePush:!1},this.tlsSessionCache=new jnt({maxSize:a})}static normalizeOrigin(e,r){return typeof e=="string"&&(e=new URL(e)),r&&e.hostname!==r&&(e.hostname=r),e.origin}normalizeOptions(e){let r="";if(e)for(let o of Gnt)e[o]&&(r+=`:${e[o]}`);return r}_tryToCreateNewSession(e,r){if(!(e in this.queue)||!(r in this.queue[e]))return;let o=this.queue[e][r];this._sessionsCount{Array.isArray(o)?(o=[...o],a()):o=[{resolve:a,reject:n}];let u=this.normalizeOptions(r),A=t.normalizeOrigin(e,r&&r.servername);if(A===void 0){for(let{reject:E}of o)E(new TypeError("The `origin` argument needs to be a string or an URL object"));return}if(u in this.sessions){let E=this.sessions[u],w=-1,D=-1,b;for(let C of E){let T=C.remoteSettings.maxConcurrentStreams;if(T=T||C[wy]||C.destroyed)continue;b||(w=T),N>D&&(b=C,D=N)}}if(b){if(o.length!==1){for(let{reject:C}of o){let T=new Error(`Expected the length of listeners to be 1, got ${o.length}. Please report this to https://github.com/szmarczak/http2-wrapper/`);C(T)}return}o[0].resolve(b);return}}if(u in this.queue){if(A in this.queue[u]){this.queue[u][A].listeners.push(...o),this._tryToCreateNewSession(u,A);return}}else this.queue[u]={};let p=()=>{u in this.queue&&this.queue[u][A]===h&&(delete this.queue[u][A],Object.keys(this.queue[u]).length===0&&delete this.queue[u])},h=()=>{let E=`${A}:${u}`,w=!1;try{let D=qnt.connect(e,{createConnection:this.createConnection,settings:this.settings,session:this.tlsSessionCache.get(E),...r});D[ea]=0,D[wy]=!1;let b=()=>D[ea]{this.tlsSessionCache.set(E,N)}),D.once("error",N=>{for(let{reject:U}of o)U(N);this.tlsSessionCache.delete(E)}),D.setTimeout(this.timeout,()=>{D.destroy()}),D.once("close",()=>{if(w){C&&this._freeSessionsCount--,this._sessionsCount--;let N=this.sessions[u];N.splice(N.indexOf(D),1),N.length===0&&delete this.sessions[u]}else{let N=new Error("Session closed without receiving a SETTINGS frame");N.code="HTTP2WRAPPER_NOSETTINGS";for(let{reject:U}of o)U(N);p()}this._tryToCreateNewSession(u,A)});let T=()=>{if(!(!(u in this.queue)||!b())){for(let N of D[zl])if(N in this.queue[u]){let{listeners:U}=this.queue[u][N];for(;U.length!==0&&b();)U.shift().resolve(D);let z=this.queue[u];if(z[N].listeners.length===0&&(delete z[N],Object.keys(z).length===0)){delete this.queue[u];break}if(!b())break}}};D.on("origin",()=>{D[zl]=D.originSet,b()&&(T(),k4(this.sessions[u],D))}),D.once("remoteSettings",()=>{if(D.ref(),D.unref(),this._sessionsCount++,h.destroyed){let N=new Error("Agent has been destroyed");for(let U of o)U.reject(N);D.destroy();return}D[zl]=D.originSet;{let N=this.sessions;if(u in N){let U=N[u];U.splice(Wnt(U,D,Ynt),0,D)}else N[u]=[D]}this._freeSessionsCount+=1,w=!0,this.emit("session",D),T(),p(),D[ea]===0&&this._freeSessionsCount>this.maxFreeSessions&&D.close(),o.length!==0&&(this.getSession(A,r,o),o.length=0),D.on("remoteSettings",()=>{T(),k4(this.sessions[u],D)})}),D[Fae]=D.request,D.request=(N,U)=>{if(D[wy])throw new Error("The session is gracefully closing. No new streams are allowed.");let z=D[Fae](N,U);return D.ref(),++D[ea],D[ea]===D.remoteSettings.maxConcurrentStreams&&this._freeSessionsCount--,z.once("close",()=>{if(C=b(),--D[ea],!D.destroyed&&!D.closed&&(Knt(this.sessions[u],D),b()&&!D.closed)){C||(this._freeSessionsCount++,C=!0);let te=D[ea]===0;te&&D.unref(),te&&(this._freeSessionsCount>this.maxFreeSessions||D[wy])?D.close():(k4(this.sessions[u],D),T())}}),z}}catch(D){for(let b of o)b.reject(D);p()}};h.listeners=o,h.completed=!1,h.destroyed=!1,this.queue[u][A]=h,this._tryToCreateNewSession(u,A)})}request(e,r,o,a){return new Promise((n,u)=>{this.getSession(e,r,[{reject:u,resolve:A=>{try{n(A.request(o,a))}catch(p){u(p)}}}])})}createConnection(e,r){return t.connect(e,r)}static connect(e,r){r.ALPNProtocols=["h2"];let o=e.port||443,a=e.hostname||e.host;return typeof r.servername>"u"&&(r.servername=a),Hnt.connect(o,a,r)}closeFreeSessions(){for(let e of Object.values(this.sessions))for(let r of e)r[ea]===0&&r.close()}destroy(e){for(let r of Object.values(this.sessions))for(let o of r)o.destroy(e);for(let r of Object.values(this.queue))for(let o of Object.values(r))o.destroyed=!0;this.queue={}}get freeSessions(){return Rae({agent:this,isFree:!0})}get busySessions(){return Rae({agent:this,isFree:!1})}};xg.kCurrentStreamsCount=ea;xg.kGracefullyClosing=wy;Lae.exports={Agent:xg,globalAgent:new xg}});var R4=_((gNt,Nae)=>{"use strict";var{Readable:Vnt}=ve("stream"),F4=class extends Vnt{constructor(e,r){super({highWaterMark:r,autoDestroy:!1}),this.statusCode=null,this.statusMessage="",this.httpVersion="2.0",this.httpVersionMajor=2,this.httpVersionMinor=0,this.headers={},this.trailers={},this.req=null,this.aborted=!1,this.complete=!1,this.upgrade=null,this.rawHeaders=[],this.rawTrailers=[],this.socket=e,this.connection=e,this._dumped=!1}_destroy(e){this.req._request.destroy(e)}setTimeout(e,r){return this.req.setTimeout(e,r),this}_dump(){this._dumped||(this._dumped=!0,this.removeAllListeners("data"),this.resume())}_read(){this.req&&this.req._request.resume()}};Nae.exports=F4});var T4=_((dNt,Oae)=>{"use strict";Oae.exports=t=>{let e={protocol:t.protocol,hostname:typeof t.hostname=="string"&&t.hostname.startsWith("[")?t.hostname.slice(1,-1):t.hostname,host:t.host,hash:t.hash,search:t.search,pathname:t.pathname,href:t.href,path:`${t.pathname||""}${t.search||""}`};return typeof t.port=="string"&&t.port.length!==0&&(e.port=Number(t.port)),(t.username||t.password)&&(e.auth=`${t.username||""}:${t.password||""}`),e}});var Uae=_((mNt,Mae)=>{"use strict";Mae.exports=(t,e,r)=>{for(let o of r)t.on(o,(...a)=>e.emit(o,...a))}});var Hae=_((yNt,_ae)=>{"use strict";_ae.exports=t=>{switch(t){case":method":case":scheme":case":authority":case":path":return!0;default:return!1}}});var jae=_((CNt,qae)=>{"use strict";var By=(t,e,r)=>{qae.exports[e]=class extends t{constructor(...a){super(typeof r=="string"?r:r(a)),this.name=`${super.name} [${e}]`,this.code=e}}};By(TypeError,"ERR_INVALID_ARG_TYPE",t=>{let e=t[0].includes(".")?"property":"argument",r=t[1],o=Array.isArray(r);return o&&(r=`${r.slice(0,-1).join(", ")} or ${r.slice(-1)}`),`The "${t[0]}" ${e} must be ${o?"one of":"of"} type ${r}. Received ${typeof t[2]}`});By(TypeError,"ERR_INVALID_PROTOCOL",t=>`Protocol "${t[0]}" not supported. Expected "${t[1]}"`);By(Error,"ERR_HTTP_HEADERS_SENT",t=>`Cannot ${t[0]} headers after they are sent to the client`);By(TypeError,"ERR_INVALID_HTTP_TOKEN",t=>`${t[0]} must be a valid HTTP token [${t[1]}]`);By(TypeError,"ERR_HTTP_INVALID_HEADER_VALUE",t=>`Invalid value "${t[0]} for header "${t[1]}"`);By(TypeError,"ERR_INVALID_CHAR",t=>`Invalid character in ${t[0]} [${t[1]}]`)});var U4=_((INt,Jae)=>{"use strict";var znt=ve("http2"),{Writable:Jnt}=ve("stream"),{Agent:Gae,globalAgent:Xnt}=Q4(),Znt=R4(),$nt=T4(),eit=Uae(),tit=Hae(),{ERR_INVALID_ARG_TYPE:L4,ERR_INVALID_PROTOCOL:rit,ERR_HTTP_HEADERS_SENT:Wae,ERR_INVALID_HTTP_TOKEN:nit,ERR_HTTP_INVALID_HEADER_VALUE:iit,ERR_INVALID_CHAR:sit}=jae(),{HTTP2_HEADER_STATUS:Yae,HTTP2_HEADER_METHOD:Kae,HTTP2_HEADER_PATH:Vae,HTTP2_METHOD_CONNECT:oit}=znt.constants,vo=Symbol("headers"),N4=Symbol("origin"),O4=Symbol("session"),zae=Symbol("options"),Lx=Symbol("flushedHeaders"),R1=Symbol("jobs"),ait=/^[\^`\-\w!#$%&*+.|~]+$/,lit=/[^\t\u0020-\u007E\u0080-\u00FF]/,M4=class extends Jnt{constructor(e,r,o){super({autoDestroy:!1});let a=typeof e=="string"||e instanceof URL;if(a&&(e=$nt(e instanceof URL?e:new URL(e))),typeof r=="function"||r===void 0?(o=r,r=a?e:{...e}):r={...e,...r},r.h2session)this[O4]=r.h2session;else if(r.agent===!1)this.agent=new Gae({maxFreeSessions:0});else if(typeof r.agent>"u"||r.agent===null)typeof r.createConnection=="function"?(this.agent=new Gae({maxFreeSessions:0}),this.agent.createConnection=r.createConnection):this.agent=Xnt;else if(typeof r.agent.request=="function")this.agent=r.agent;else throw new L4("options.agent",["Agent-like Object","undefined","false"],r.agent);if(r.protocol&&r.protocol!=="https:")throw new rit(r.protocol,"https:");let n=r.port||r.defaultPort||this.agent&&this.agent.defaultPort||443,u=r.hostname||r.host||"localhost";delete r.hostname,delete r.host,delete r.port;let{timeout:A}=r;if(r.timeout=void 0,this[vo]=Object.create(null),this[R1]=[],this.socket=null,this.connection=null,this.method=r.method||"GET",this.path=r.path,this.res=null,this.aborted=!1,this.reusedSocket=!1,r.headers)for(let[p,h]of Object.entries(r.headers))this.setHeader(p,h);r.auth&&!("authorization"in this[vo])&&(this[vo].authorization="Basic "+Buffer.from(r.auth).toString("base64")),r.session=r.tlsSession,r.path=r.socketPath,this[zae]=r,n===443?(this[N4]=`https://${u}`,":authority"in this[vo]||(this[vo][":authority"]=u)):(this[N4]=`https://${u}:${n}`,":authority"in this[vo]||(this[vo][":authority"]=`${u}:${n}`)),A&&this.setTimeout(A),o&&this.once("response",o),this[Lx]=!1}get method(){return this[vo][Kae]}set method(e){e&&(this[vo][Kae]=e.toUpperCase())}get path(){return this[vo][Vae]}set path(e){e&&(this[vo][Vae]=e)}get _mustNotHaveABody(){return this.method==="GET"||this.method==="HEAD"||this.method==="DELETE"}_write(e,r,o){if(this._mustNotHaveABody){o(new Error("The GET, HEAD and DELETE methods must NOT have a body"));return}this.flushHeaders();let a=()=>this._request.write(e,r,o);this._request?a():this[R1].push(a)}_final(e){if(this.destroyed)return;this.flushHeaders();let r=()=>{if(this._mustNotHaveABody){e();return}this._request.end(e)};this._request?r():this[R1].push(r)}abort(){this.res&&this.res.complete||(this.aborted||process.nextTick(()=>this.emit("abort")),this.aborted=!0,this.destroy())}_destroy(e,r){this.res&&this.res._dump(),this._request&&this._request.destroy(),r(e)}async flushHeaders(){if(this[Lx]||this.destroyed)return;this[Lx]=!0;let e=this.method===oit,r=o=>{if(this._request=o,this.destroyed){o.destroy();return}e||eit(o,this,["timeout","continue","close","error"]);let a=u=>(...A)=>{!this.writable&&!this.destroyed?u(...A):this.once("finish",()=>{u(...A)})};o.once("response",a((u,A,p)=>{let h=new Znt(this.socket,o.readableHighWaterMark);this.res=h,h.req=this,h.statusCode=u[Yae],h.headers=u,h.rawHeaders=p,h.once("end",()=>{this.aborted?(h.aborted=!0,h.emit("aborted")):(h.complete=!0,h.socket=null,h.connection=null)}),e?(h.upgrade=!0,this.emit("connect",h,o,Buffer.alloc(0))?this.emit("close"):o.destroy()):(o.on("data",E=>{!h._dumped&&!h.push(E)&&o.pause()}),o.once("end",()=>{h.push(null)}),this.emit("response",h)||h._dump())})),o.once("headers",a(u=>this.emit("information",{statusCode:u[Yae]}))),o.once("trailers",a((u,A,p)=>{let{res:h}=this;h.trailers=u,h.rawTrailers=p}));let{socket:n}=o.session;this.socket=n,this.connection=n;for(let u of this[R1])u();this.emit("socket",this.socket)};if(this[O4])try{r(this[O4].request(this[vo]))}catch(o){this.emit("error",o)}else{this.reusedSocket=!0;try{r(await this.agent.request(this[N4],this[zae],this[vo]))}catch(o){this.emit("error",o)}}}getHeader(e){if(typeof e!="string")throw new L4("name","string",e);return this[vo][e.toLowerCase()]}get headersSent(){return this[Lx]}removeHeader(e){if(typeof e!="string")throw new L4("name","string",e);if(this.headersSent)throw new Wae("remove");delete this[vo][e.toLowerCase()]}setHeader(e,r){if(this.headersSent)throw new Wae("set");if(typeof e!="string"||!ait.test(e)&&!tit(e))throw new nit("Header name",e);if(typeof r>"u")throw new iit(r,e);if(lit.test(r))throw new sit("header content",e);this[vo][e.toLowerCase()]=r}setNoDelay(){}setSocketKeepAlive(){}setTimeout(e,r){let o=()=>this._request.setTimeout(e,r);return this._request?o():this[R1].push(o),this}get maxHeadersCount(){if(!this.destroyed&&this._request)return this._request.session.localSettings.maxHeaderListSize}set maxHeadersCount(e){}};Jae.exports=M4});var Zae=_((wNt,Xae)=>{"use strict";var cit=ve("tls");Xae.exports=(t={},e=cit.connect)=>new Promise((r,o)=>{let a=!1,n,u=async()=>{await p,n.off("timeout",A),n.off("error",o),t.resolveSocket?(r({alpnProtocol:n.alpnProtocol,socket:n,timeout:a}),a&&(await Promise.resolve(),n.emit("timeout"))):(n.destroy(),r({alpnProtocol:n.alpnProtocol,timeout:a}))},A=async()=>{a=!0,u()},p=(async()=>{try{n=await e(t,u),n.on("error",o),n.once("timeout",A)}catch(h){o(h)}})()})});var ele=_((BNt,$ae)=>{"use strict";var uit=ve("net");$ae.exports=t=>{let e=t.host,r=t.headers&&t.headers.host;return r&&(r.startsWith("[")?r.indexOf("]")===-1?e=r:e=r.slice(1,-1):e=r.split(":",1)[0]),uit.isIP(e)?"":e}});var nle=_((vNt,H4)=>{"use strict";var tle=ve("http"),_4=ve("https"),Ait=Zae(),fit=b4(),pit=U4(),hit=ele(),git=T4(),Nx=new fit({maxSize:100}),T1=new Map,rle=(t,e,r)=>{e._httpMessage={shouldKeepAlive:!0};let o=()=>{t.emit("free",e,r)};e.on("free",o);let a=()=>{t.removeSocket(e,r)};e.on("close",a);let n=()=>{t.removeSocket(e,r),e.off("close",a),e.off("free",o),e.off("agentRemove",n)};e.on("agentRemove",n),t.emit("free",e,r)},dit=async t=>{let e=`${t.host}:${t.port}:${t.ALPNProtocols.sort()}`;if(!Nx.has(e)){if(T1.has(e))return(await T1.get(e)).alpnProtocol;let{path:r,agent:o}=t;t.path=t.socketPath;let a=Ait(t);T1.set(e,a);try{let{socket:n,alpnProtocol:u}=await a;if(Nx.set(e,u),t.path=r,u==="h2")n.destroy();else{let{globalAgent:A}=_4,p=_4.Agent.prototype.createConnection;o?o.createConnection===p?rle(o,n,t):n.destroy():A.createConnection===p?rle(A,n,t):n.destroy()}return T1.delete(e),u}catch(n){throw T1.delete(e),n}}return Nx.get(e)};H4.exports=async(t,e,r)=>{if((typeof t=="string"||t instanceof URL)&&(t=git(new URL(t))),typeof e=="function"&&(r=e,e=void 0),e={ALPNProtocols:["h2","http/1.1"],...t,...e,resolveSocket:!0},!Array.isArray(e.ALPNProtocols)||e.ALPNProtocols.length===0)throw new Error("The `ALPNProtocols` option must be an Array with at least one entry");e.protocol=e.protocol||"https:";let o=e.protocol==="https:";e.host=e.hostname||e.host||"localhost",e.session=e.tlsSession,e.servername=e.servername||hit(e),e.port=e.port||(o?443:80),e._defaultAgent=o?_4.globalAgent:tle.globalAgent;let a=e.agent;if(a){if(a.addRequest)throw new Error("The `options.agent` object can contain only `http`, `https` or `http2` properties");e.agent=a[o?"https":"http"]}return o&&await dit(e)==="h2"?(a&&(e.agent=a.http2),new pit(e,r)):tle.request(e,r)};H4.exports.protocolCache=Nx});var sle=_((DNt,ile)=>{"use strict";var mit=ve("http2"),yit=Q4(),q4=U4(),Eit=R4(),Cit=nle(),Iit=(t,e,r)=>new q4(t,e,r),wit=(t,e,r)=>{let o=new q4(t,e,r);return o.end(),o};ile.exports={...mit,ClientRequest:q4,IncomingMessage:Eit,...yit,request:Iit,get:wit,auto:Cit}});var G4=_(j4=>{"use strict";Object.defineProperty(j4,"__esModule",{value:!0});var ole=Ff();j4.default=t=>ole.default.nodeStream(t)&&ole.default.function_(t.getBoundary)});var ule=_(W4=>{"use strict";Object.defineProperty(W4,"__esModule",{value:!0});var lle=ve("fs"),cle=ve("util"),ale=Ff(),Bit=G4(),vit=cle.promisify(lle.stat);W4.default=async(t,e)=>{if(e&&"content-length"in e)return Number(e["content-length"]);if(!t)return 0;if(ale.default.string(t))return Buffer.byteLength(t);if(ale.default.buffer(t))return t.length;if(Bit.default(t))return cle.promisify(t.getLength.bind(t))();if(t instanceof lle.ReadStream){let{size:r}=await vit(t.path);return r===0?void 0:r}}});var K4=_(Y4=>{"use strict";Object.defineProperty(Y4,"__esModule",{value:!0});function Dit(t,e,r){let o={};for(let a of r)o[a]=(...n)=>{e.emit(a,...n)},t.on(a,o[a]);return()=>{for(let a of r)t.off(a,o[a])}}Y4.default=Dit});var Ale=_(V4=>{"use strict";Object.defineProperty(V4,"__esModule",{value:!0});V4.default=()=>{let t=[];return{once(e,r,o){e.once(r,o),t.push({origin:e,event:r,fn:o})},unhandleAll(){for(let e of t){let{origin:r,event:o,fn:a}=e;r.removeListener(o,a)}t.length=0}}}});var ple=_(L1=>{"use strict";Object.defineProperty(L1,"__esModule",{value:!0});L1.TimeoutError=void 0;var Pit=ve("net"),Sit=Ale(),fle=Symbol("reentry"),xit=()=>{},Ox=class extends Error{constructor(e,r){super(`Timeout awaiting '${r}' for ${e}ms`),this.event=r,this.name="TimeoutError",this.code="ETIMEDOUT"}};L1.TimeoutError=Ox;L1.default=(t,e,r)=>{if(fle in t)return xit;t[fle]=!0;let o=[],{once:a,unhandleAll:n}=Sit.default(),u=(w,D,b)=>{var C;let T=setTimeout(D,w,w,b);(C=T.unref)===null||C===void 0||C.call(T);let N=()=>{clearTimeout(T)};return o.push(N),N},{host:A,hostname:p}=r,h=(w,D)=>{t.destroy(new Ox(w,D))},E=()=>{for(let w of o)w();n()};if(t.once("error",w=>{if(E(),t.listenerCount("error")===0)throw w}),t.once("close",E),a(t,"response",w=>{a(w,"end",E)}),typeof e.request<"u"&&u(e.request,h,"request"),typeof e.socket<"u"){let w=()=>{h(e.socket,"socket")};t.setTimeout(e.socket,w),o.push(()=>{t.removeListener("timeout",w)})}return a(t,"socket",w=>{var D;let{socketPath:b}=t;if(w.connecting){let C=!!(b??Pit.isIP((D=p??A)!==null&&D!==void 0?D:"")!==0);if(typeof e.lookup<"u"&&!C&&typeof w.address().address>"u"){let T=u(e.lookup,h,"lookup");a(w,"lookup",T)}if(typeof e.connect<"u"){let T=()=>u(e.connect,h,"connect");C?a(w,"connect",T()):a(w,"lookup",N=>{N===null&&a(w,"connect",T())})}typeof e.secureConnect<"u"&&r.protocol==="https:"&&a(w,"connect",()=>{let T=u(e.secureConnect,h,"secureConnect");a(w,"secureConnect",T)})}if(typeof e.send<"u"){let C=()=>u(e.send,h,"send");w.connecting?a(w,"connect",()=>{a(t,"upload-complete",C())}):a(t,"upload-complete",C())}}),typeof e.response<"u"&&a(t,"upload-complete",()=>{let w=u(e.response,h,"response");a(t,"response",w)}),E}});var gle=_(z4=>{"use strict";Object.defineProperty(z4,"__esModule",{value:!0});var hle=Ff();z4.default=t=>{t=t;let e={protocol:t.protocol,hostname:hle.default.string(t.hostname)&&t.hostname.startsWith("[")?t.hostname.slice(1,-1):t.hostname,host:t.host,hash:t.hash,search:t.search,pathname:t.pathname,href:t.href,path:`${t.pathname||""}${t.search||""}`};return hle.default.string(t.port)&&t.port.length>0&&(e.port=Number(t.port)),(t.username||t.password)&&(e.auth=`${t.username||""}:${t.password||""}`),e}});var dle=_(J4=>{"use strict";Object.defineProperty(J4,"__esModule",{value:!0});var bit=ve("url"),kit=["protocol","host","hostname","port","pathname","search"];J4.default=(t,e)=>{var r,o;if(e.path){if(e.pathname)throw new TypeError("Parameters `path` and `pathname` are mutually exclusive.");if(e.search)throw new TypeError("Parameters `path` and `search` are mutually exclusive.");if(e.searchParams)throw new TypeError("Parameters `path` and `searchParams` are mutually exclusive.")}if(e.search&&e.searchParams)throw new TypeError("Parameters `search` and `searchParams` are mutually exclusive.");if(!t){if(!e.protocol)throw new TypeError("No URL protocol specified");t=`${e.protocol}//${(o=(r=e.hostname)!==null&&r!==void 0?r:e.host)!==null&&o!==void 0?o:""}`}let a=new bit.URL(t);if(e.path){let n=e.path.indexOf("?");n===-1?e.pathname=e.path:(e.pathname=e.path.slice(0,n),e.search=e.path.slice(n+1)),delete e.path}for(let n of kit)e[n]&&(a[n]=e[n].toString());return a}});var mle=_(Z4=>{"use strict";Object.defineProperty(Z4,"__esModule",{value:!0});var X4=class{constructor(){this.weakMap=new WeakMap,this.map=new Map}set(e,r){typeof e=="object"?this.weakMap.set(e,r):this.map.set(e,r)}get(e){return typeof e=="object"?this.weakMap.get(e):this.map.get(e)}has(e){return typeof e=="object"?this.weakMap.has(e):this.map.has(e)}};Z4.default=X4});var eU=_($4=>{"use strict";Object.defineProperty($4,"__esModule",{value:!0});var Qit=async t=>{let e=[],r=0;for await(let o of t)e.push(o),r+=Buffer.byteLength(o);return Buffer.isBuffer(e[0])?Buffer.concat(e,r):Buffer.from(e.join(""))};$4.default=Qit});var Ele=_(bg=>{"use strict";Object.defineProperty(bg,"__esModule",{value:!0});bg.dnsLookupIpVersionToFamily=bg.isDnsLookupIpVersion=void 0;var yle={auto:0,ipv4:4,ipv6:6};bg.isDnsLookupIpVersion=t=>t in yle;bg.dnsLookupIpVersionToFamily=t=>{if(bg.isDnsLookupIpVersion(t))return yle[t];throw new Error("Invalid DNS lookup IP version")}});var tU=_(Mx=>{"use strict";Object.defineProperty(Mx,"__esModule",{value:!0});Mx.isResponseOk=void 0;Mx.isResponseOk=t=>{let{statusCode:e}=t,r=t.request.options.followRedirect?299:399;return e>=200&&e<=r||e===304}});var Ile=_(rU=>{"use strict";Object.defineProperty(rU,"__esModule",{value:!0});var Cle=new Set;rU.default=t=>{Cle.has(t)||(Cle.add(t),process.emitWarning(`Got: ${t}`,{type:"DeprecationWarning"}))}});var wle=_(nU=>{"use strict";Object.defineProperty(nU,"__esModule",{value:!0});var mi=Ff(),Fit=(t,e)=>{if(mi.default.null_(t.encoding))throw new TypeError("To get a Buffer, set `options.responseType` to `buffer` instead");mi.assert.any([mi.default.string,mi.default.undefined],t.encoding),mi.assert.any([mi.default.boolean,mi.default.undefined],t.resolveBodyOnly),mi.assert.any([mi.default.boolean,mi.default.undefined],t.methodRewriting),mi.assert.any([mi.default.boolean,mi.default.undefined],t.isStream),mi.assert.any([mi.default.string,mi.default.undefined],t.responseType),t.responseType===void 0&&(t.responseType="text");let{retry:r}=t;if(e?t.retry={...e.retry}:t.retry={calculateDelay:o=>o.computedValue,limit:0,methods:[],statusCodes:[],errorCodes:[],maxRetryAfter:void 0},mi.default.object(r)?(t.retry={...t.retry,...r},t.retry.methods=[...new Set(t.retry.methods.map(o=>o.toUpperCase()))],t.retry.statusCodes=[...new Set(t.retry.statusCodes)],t.retry.errorCodes=[...new Set(t.retry.errorCodes)]):mi.default.number(r)&&(t.retry.limit=r),mi.default.undefined(t.retry.maxRetryAfter)&&(t.retry.maxRetryAfter=Math.min(...[t.timeout.request,t.timeout.connect].filter(mi.default.number))),mi.default.object(t.pagination)){e&&(t.pagination={...e.pagination,...t.pagination});let{pagination:o}=t;if(!mi.default.function_(o.transform))throw new Error("`options.pagination.transform` must be implemented");if(!mi.default.function_(o.shouldContinue))throw new Error("`options.pagination.shouldContinue` must be implemented");if(!mi.default.function_(o.filter))throw new TypeError("`options.pagination.filter` must be implemented");if(!mi.default.function_(o.paginate))throw new Error("`options.pagination.paginate` must be implemented")}return t.responseType==="json"&&t.headers.accept===void 0&&(t.headers.accept="application/json"),t};nU.default=Fit});var Ble=_(N1=>{"use strict";Object.defineProperty(N1,"__esModule",{value:!0});N1.retryAfterStatusCodes=void 0;N1.retryAfterStatusCodes=new Set([413,429,503]);var Rit=({attemptCount:t,retryOptions:e,error:r,retryAfter:o})=>{if(t>e.limit)return 0;let a=e.methods.includes(r.options.method),n=e.errorCodes.includes(r.code),u=r.response&&e.statusCodes.includes(r.response.statusCode);if(!a||!n&&!u)return 0;if(r.response){if(o)return e.maxRetryAfter===void 0||o>e.maxRetryAfter?0:o;if(r.response.statusCode===413)return 0}let A=Math.random()*100;return 2**(t-1)*1e3+A};N1.default=Rit});var U1=_(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.UnsupportedProtocolError=Qn.ReadError=Qn.TimeoutError=Qn.UploadError=Qn.CacheError=Qn.HTTPError=Qn.MaxRedirectsError=Qn.RequestError=Qn.setNonEnumerableProperties=Qn.knownHookEvents=Qn.withoutBody=Qn.kIsNormalizedAlready=void 0;var vle=ve("util"),Dle=ve("stream"),Tit=ve("fs"),uh=ve("url"),Ple=ve("http"),iU=ve("http"),Lit=ve("https"),Nit=_oe(),Oit=Koe(),Sle=Pae(),Mit=kae(),Uit=sle(),_it=Rx(),at=Ff(),Hit=ule(),xle=G4(),qit=K4(),ble=ple(),jit=gle(),kle=dle(),Git=mle(),Wit=eU(),Qle=Ele(),Yit=tU(),Ah=Ile(),Kit=wle(),Vit=Ble(),sU,Ys=Symbol("request"),Hx=Symbol("response"),vy=Symbol("responseSize"),Dy=Symbol("downloadedSize"),Py=Symbol("bodySize"),Sy=Symbol("uploadedSize"),Ux=Symbol("serverResponsesPiped"),Fle=Symbol("unproxyEvents"),Rle=Symbol("isFromCache"),oU=Symbol("cancelTimeouts"),Tle=Symbol("startedReading"),xy=Symbol("stopReading"),_x=Symbol("triggerRead"),fh=Symbol("body"),O1=Symbol("jobs"),Lle=Symbol("originalResponse"),Nle=Symbol("retryTimeout");Qn.kIsNormalizedAlready=Symbol("isNormalizedAlready");var zit=at.default.string(process.versions.brotli);Qn.withoutBody=new Set(["GET","HEAD"]);Qn.knownHookEvents=["init","beforeRequest","beforeRedirect","beforeError","beforeRetry","afterResponse"];function Jit(t){for(let e in t){let r=t[e];if(!at.default.string(r)&&!at.default.number(r)&&!at.default.boolean(r)&&!at.default.null_(r)&&!at.default.undefined(r))throw new TypeError(`The \`searchParams\` value '${String(r)}' must be a string, number, boolean or null`)}}function Xit(t){return at.default.object(t)&&!("statusCode"in t)}var aU=new Git.default,Zit=async t=>new Promise((e,r)=>{let o=a=>{r(a)};t.pending||e(),t.once("error",o),t.once("ready",()=>{t.off("error",o),e()})}),$it=new Set([300,301,302,303,304,307,308]),est=["context","body","json","form"];Qn.setNonEnumerableProperties=(t,e)=>{let r={};for(let o of t)if(o)for(let a of est)a in o&&(r[a]={writable:!0,configurable:!0,enumerable:!1,value:o[a]});Object.defineProperties(e,r)};var Ji=class extends Error{constructor(e,r,o){var a;if(super(e),Error.captureStackTrace(this,this.constructor),this.name="RequestError",this.code=r.code,o instanceof Vx?(Object.defineProperty(this,"request",{enumerable:!1,value:o}),Object.defineProperty(this,"response",{enumerable:!1,value:o[Hx]}),Object.defineProperty(this,"options",{enumerable:!1,value:o.options})):Object.defineProperty(this,"options",{enumerable:!1,value:o}),this.timings=(a=this.request)===null||a===void 0?void 0:a.timings,at.default.string(r.stack)&&at.default.string(this.stack)){let n=this.stack.indexOf(this.message)+this.message.length,u=this.stack.slice(n).split(` `).reverse(),A=r.stack.slice(r.stack.indexOf(r.message)+r.message.length).split(` `).reverse();for(;A.length!==0&&A[0]===u[0];)u.shift();this.stack=`${this.stack.slice(0,n)}${u.reverse().join(` `)}${A.reverse().join(` `)}`}}};Qn.RequestError=Ji;var qx=class extends Ji{constructor(e){super(`Redirected ${e.options.maxRedirects} times. Aborting.`,{},e),this.name="MaxRedirectsError"}};Qn.MaxRedirectsError=qx;var jx=class extends Ji{constructor(e){super(`Response code ${e.statusCode} (${e.statusMessage})`,{},e.request),this.name="HTTPError"}};Qn.HTTPError=jx;var Gx=class extends Ji{constructor(e,r){super(e.message,e,r),this.name="CacheError"}};Qn.CacheError=Gx;var Wx=class extends Ji{constructor(e,r){super(e.message,e,r),this.name="UploadError"}};Qn.UploadError=Wx;var Yx=class extends Ji{constructor(e,r,o){super(e.message,e,o),this.name="TimeoutError",this.event=e.event,this.timings=r}};Qn.TimeoutError=Yx;var M1=class extends Ji{constructor(e,r){super(e.message,e,r),this.name="ReadError"}};Qn.ReadError=M1;var Kx=class extends Ji{constructor(e){super(`Unsupported protocol "${e.url.protocol}"`,{},e),this.name="UnsupportedProtocolError"}};Qn.UnsupportedProtocolError=Kx;var tst=["socket","connect","continue","information","upgrade","timeout"],Vx=class extends Dle.Duplex{constructor(e,r={},o){super({autoDestroy:!1,highWaterMark:0}),this[Dy]=0,this[Sy]=0,this.requestInitialized=!1,this[Ux]=new Set,this.redirects=[],this[xy]=!1,this[_x]=!1,this[O1]=[],this.retryCount=0,this._progressCallbacks=[];let a=()=>this._unlockWrite(),n=()=>this._lockWrite();this.on("pipe",h=>{h.prependListener("data",a),h.on("data",n),h.prependListener("end",a),h.on("end",n)}),this.on("unpipe",h=>{h.off("data",a),h.off("data",n),h.off("end",a),h.off("end",n)}),this.on("pipe",h=>{h instanceof iU.IncomingMessage&&(this.options.headers={...h.headers,...this.options.headers})});let{json:u,body:A,form:p}=r;if((u||A||p)&&this._lockWrite(),Qn.kIsNormalizedAlready in r)this.options=r;else try{this.options=this.constructor.normalizeArguments(e,r,o)}catch(h){at.default.nodeStream(r.body)&&r.body.destroy(),this.destroy(h);return}(async()=>{var h;try{this.options.body instanceof Tit.ReadStream&&await Zit(this.options.body);let{url:E}=this.options;if(!E)throw new TypeError("Missing `url` property");if(this.requestUrl=E.toString(),decodeURI(this.requestUrl),await this._finalizeBody(),await this._makeRequest(),this.destroyed){(h=this[Ys])===null||h===void 0||h.destroy();return}for(let w of this[O1])w();this[O1].length=0,this.requestInitialized=!0}catch(E){if(E instanceof Ji){this._beforeError(E);return}this.destroyed||this.destroy(E)}})()}static normalizeArguments(e,r,o){var a,n,u,A,p;let h=r;if(at.default.object(e)&&!at.default.urlInstance(e))r={...o,...e,...r};else{if(e&&r&&r.url!==void 0)throw new TypeError("The `url` option is mutually exclusive with the `input` argument");r={...o,...r},e!==void 0&&(r.url=e),at.default.urlInstance(r.url)&&(r.url=new uh.URL(r.url.toString()))}if(r.cache===!1&&(r.cache=void 0),r.dnsCache===!1&&(r.dnsCache=void 0),at.assert.any([at.default.string,at.default.undefined],r.method),at.assert.any([at.default.object,at.default.undefined],r.headers),at.assert.any([at.default.string,at.default.urlInstance,at.default.undefined],r.prefixUrl),at.assert.any([at.default.object,at.default.undefined],r.cookieJar),at.assert.any([at.default.object,at.default.string,at.default.undefined],r.searchParams),at.assert.any([at.default.object,at.default.string,at.default.undefined],r.cache),at.assert.any([at.default.object,at.default.number,at.default.undefined],r.timeout),at.assert.any([at.default.object,at.default.undefined],r.context),at.assert.any([at.default.object,at.default.undefined],r.hooks),at.assert.any([at.default.boolean,at.default.undefined],r.decompress),at.assert.any([at.default.boolean,at.default.undefined],r.ignoreInvalidCookies),at.assert.any([at.default.boolean,at.default.undefined],r.followRedirect),at.assert.any([at.default.number,at.default.undefined],r.maxRedirects),at.assert.any([at.default.boolean,at.default.undefined],r.throwHttpErrors),at.assert.any([at.default.boolean,at.default.undefined],r.http2),at.assert.any([at.default.boolean,at.default.undefined],r.allowGetBody),at.assert.any([at.default.string,at.default.undefined],r.localAddress),at.assert.any([Qle.isDnsLookupIpVersion,at.default.undefined],r.dnsLookupIpVersion),at.assert.any([at.default.object,at.default.undefined],r.https),at.assert.any([at.default.boolean,at.default.undefined],r.rejectUnauthorized),r.https&&(at.assert.any([at.default.boolean,at.default.undefined],r.https.rejectUnauthorized),at.assert.any([at.default.function_,at.default.undefined],r.https.checkServerIdentity),at.assert.any([at.default.string,at.default.object,at.default.array,at.default.undefined],r.https.certificateAuthority),at.assert.any([at.default.string,at.default.object,at.default.array,at.default.undefined],r.https.key),at.assert.any([at.default.string,at.default.object,at.default.array,at.default.undefined],r.https.certificate),at.assert.any([at.default.string,at.default.undefined],r.https.passphrase),at.assert.any([at.default.string,at.default.buffer,at.default.array,at.default.undefined],r.https.pfx)),at.assert.any([at.default.object,at.default.undefined],r.cacheOptions),at.default.string(r.method)?r.method=r.method.toUpperCase():r.method="GET",r.headers===o?.headers?r.headers={...r.headers}:r.headers=_it({...o?.headers,...r.headers}),"slashes"in r)throw new TypeError("The legacy `url.Url` has been deprecated. Use `URL` instead.");if("auth"in r)throw new TypeError("Parameter `auth` is deprecated. Use `username` / `password` instead.");if("searchParams"in r&&r.searchParams&&r.searchParams!==o?.searchParams){let b;if(at.default.string(r.searchParams)||r.searchParams instanceof uh.URLSearchParams)b=new uh.URLSearchParams(r.searchParams);else{Jit(r.searchParams),b=new uh.URLSearchParams;for(let C in r.searchParams){let T=r.searchParams[C];T===null?b.append(C,""):T!==void 0&&b.append(C,T)}}(a=o?.searchParams)===null||a===void 0||a.forEach((C,T)=>{b.has(T)||b.append(T,C)}),r.searchParams=b}if(r.username=(n=r.username)!==null&&n!==void 0?n:"",r.password=(u=r.password)!==null&&u!==void 0?u:"",at.default.undefined(r.prefixUrl)?r.prefixUrl=(A=o?.prefixUrl)!==null&&A!==void 0?A:"":(r.prefixUrl=r.prefixUrl.toString(),r.prefixUrl!==""&&!r.prefixUrl.endsWith("/")&&(r.prefixUrl+="/")),at.default.string(r.url)){if(r.url.startsWith("/"))throw new Error("`input` must not start with a slash when using `prefixUrl`");r.url=kle.default(r.prefixUrl+r.url,r)}else(at.default.undefined(r.url)&&r.prefixUrl!==""||r.protocol)&&(r.url=kle.default(r.prefixUrl,r));if(r.url){"port"in r&&delete r.port;let{prefixUrl:b}=r;Object.defineProperty(r,"prefixUrl",{set:T=>{let N=r.url;if(!N.href.startsWith(T))throw new Error(`Cannot change \`prefixUrl\` from ${b} to ${T}: ${N.href}`);r.url=new uh.URL(T+N.href.slice(b.length)),b=T},get:()=>b});let{protocol:C}=r.url;if(C==="unix:"&&(C="http:",r.url=new uh.URL(`http://unix${r.url.pathname}${r.url.search}`)),r.searchParams&&(r.url.search=r.searchParams.toString()),C!=="http:"&&C!=="https:")throw new Kx(r);r.username===""?r.username=r.url.username:r.url.username=r.username,r.password===""?r.password=r.url.password:r.url.password=r.password}let{cookieJar:E}=r;if(E){let{setCookie:b,getCookieString:C}=E;at.assert.function_(b),at.assert.function_(C),b.length===4&&C.length===0&&(b=vle.promisify(b.bind(r.cookieJar)),C=vle.promisify(C.bind(r.cookieJar)),r.cookieJar={setCookie:b,getCookieString:C})}let{cache:w}=r;if(w&&(aU.has(w)||aU.set(w,new Sle((b,C)=>{let T=b[Ys](b,C);return at.default.promise(T)&&(T.once=(N,U)=>{if(N==="error")T.catch(U);else if(N==="abort")(async()=>{try{(await T).once("abort",U)}catch{}})();else throw new Error(`Unknown HTTP2 promise event: ${N}`);return T}),T},w))),r.cacheOptions={...r.cacheOptions},r.dnsCache===!0)sU||(sU=new Oit.default),r.dnsCache=sU;else if(!at.default.undefined(r.dnsCache)&&!r.dnsCache.lookup)throw new TypeError(`Parameter \`dnsCache\` must be a CacheableLookup instance or a boolean, got ${at.default(r.dnsCache)}`);at.default.number(r.timeout)?r.timeout={request:r.timeout}:o&&r.timeout!==o.timeout?r.timeout={...o.timeout,...r.timeout}:r.timeout={...r.timeout},r.context||(r.context={});let D=r.hooks===o?.hooks;r.hooks={...r.hooks};for(let b of Qn.knownHookEvents)if(b in r.hooks)if(at.default.array(r.hooks[b]))r.hooks[b]=[...r.hooks[b]];else throw new TypeError(`Parameter \`${b}\` must be an Array, got ${at.default(r.hooks[b])}`);else r.hooks[b]=[];if(o&&!D)for(let b of Qn.knownHookEvents)o.hooks[b].length>0&&(r.hooks[b]=[...o.hooks[b],...r.hooks[b]]);if("family"in r&&Ah.default('"options.family" was never documented, please use "options.dnsLookupIpVersion"'),o?.https&&(r.https={...o.https,...r.https}),"rejectUnauthorized"in r&&Ah.default('"options.rejectUnauthorized" is now deprecated, please use "options.https.rejectUnauthorized"'),"checkServerIdentity"in r&&Ah.default('"options.checkServerIdentity" was never documented, please use "options.https.checkServerIdentity"'),"ca"in r&&Ah.default('"options.ca" was never documented, please use "options.https.certificateAuthority"'),"key"in r&&Ah.default('"options.key" was never documented, please use "options.https.key"'),"cert"in r&&Ah.default('"options.cert" was never documented, please use "options.https.certificate"'),"passphrase"in r&&Ah.default('"options.passphrase" was never documented, please use "options.https.passphrase"'),"pfx"in r&&Ah.default('"options.pfx" was never documented, please use "options.https.pfx"'),"followRedirects"in r)throw new TypeError("The `followRedirects` option does not exist. Use `followRedirect` instead.");if(r.agent){for(let b in r.agent)if(b!=="http"&&b!=="https"&&b!=="http2")throw new TypeError(`Expected the \`options.agent\` properties to be \`http\`, \`https\` or \`http2\`, got \`${b}\``)}return r.maxRedirects=(p=r.maxRedirects)!==null&&p!==void 0?p:0,Qn.setNonEnumerableProperties([o,h],r),Kit.default(r,o)}_lockWrite(){let e=()=>{throw new TypeError("The payload has been already provided")};this.write=e,this.end=e}_unlockWrite(){this.write=super.write,this.end=super.end}async _finalizeBody(){let{options:e}=this,{headers:r}=e,o=!at.default.undefined(e.form),a=!at.default.undefined(e.json),n=!at.default.undefined(e.body),u=o||a||n,A=Qn.withoutBody.has(e.method)&&!(e.method==="GET"&&e.allowGetBody);if(this._cannotHaveBody=A,u){if(A)throw new TypeError(`The \`${e.method}\` method cannot be used with a body`);if([n,o,a].filter(p=>p).length>1)throw new TypeError("The `body`, `json` and `form` options are mutually exclusive");if(n&&!(e.body instanceof Dle.Readable)&&!at.default.string(e.body)&&!at.default.buffer(e.body)&&!xle.default(e.body))throw new TypeError("The `body` option must be a stream.Readable, string or Buffer");if(o&&!at.default.object(e.form))throw new TypeError("The `form` option must be an Object");{let p=!at.default.string(r["content-type"]);n?(xle.default(e.body)&&p&&(r["content-type"]=`multipart/form-data; boundary=${e.body.getBoundary()}`),this[fh]=e.body):o?(p&&(r["content-type"]="application/x-www-form-urlencoded"),this[fh]=new uh.URLSearchParams(e.form).toString()):(p&&(r["content-type"]="application/json"),this[fh]=e.stringifyJson(e.json));let h=await Hit.default(this[fh],e.headers);at.default.undefined(r["content-length"])&&at.default.undefined(r["transfer-encoding"])&&!A&&!at.default.undefined(h)&&(r["content-length"]=String(h))}}else A?this._lockWrite():this._unlockWrite();this[Py]=Number(r["content-length"])||void 0}async _onResponseBase(e){let{options:r}=this,{url:o}=r;this[Lle]=e,r.decompress&&(e=Mit(e));let a=e.statusCode,n=e;n.statusMessage=n.statusMessage?n.statusMessage:Ple.STATUS_CODES[a],n.url=r.url.toString(),n.requestUrl=this.requestUrl,n.redirectUrls=this.redirects,n.request=this,n.isFromCache=e.fromCache||!1,n.ip=this.ip,n.retryCount=this.retryCount,this[Rle]=n.isFromCache,this[vy]=Number(e.headers["content-length"])||void 0,this[Hx]=e,e.once("end",()=>{this[vy]=this[Dy],this.emit("downloadProgress",this.downloadProgress)}),e.once("error",A=>{e.destroy(),this._beforeError(new M1(A,this))}),e.once("aborted",()=>{this._beforeError(new M1({name:"Error",message:"The server aborted pending request",code:"ECONNRESET"},this))}),this.emit("downloadProgress",this.downloadProgress);let u=e.headers["set-cookie"];if(at.default.object(r.cookieJar)&&u){let A=u.map(async p=>r.cookieJar.setCookie(p,o.toString()));r.ignoreInvalidCookies&&(A=A.map(async p=>p.catch(()=>{})));try{await Promise.all(A)}catch(p){this._beforeError(p);return}}if(r.followRedirect&&e.headers.location&&$it.has(a)){if(e.resume(),this[Ys]&&(this[oU](),delete this[Ys],this[Fle]()),(a===303&&r.method!=="GET"&&r.method!=="HEAD"||!r.methodRewriting)&&(r.method="GET","body"in r&&delete r.body,"json"in r&&delete r.json,"form"in r&&delete r.form,this[fh]=void 0,delete r.headers["content-length"]),this.redirects.length>=r.maxRedirects){this._beforeError(new qx(this));return}try{let p=Buffer.from(e.headers.location,"binary").toString(),h=new uh.URL(p,o),E=h.toString();decodeURI(E),h.hostname!==o.hostname||h.port!==o.port?("host"in r.headers&&delete r.headers.host,"cookie"in r.headers&&delete r.headers.cookie,"authorization"in r.headers&&delete r.headers.authorization,(r.username||r.password)&&(r.username="",r.password="")):(h.username=r.username,h.password=r.password),this.redirects.push(E),r.url=h;for(let w of r.hooks.beforeRedirect)await w(r,n);this.emit("redirect",n,r),await this._makeRequest()}catch(p){this._beforeError(p);return}return}if(r.isStream&&r.throwHttpErrors&&!Yit.isResponseOk(n)){this._beforeError(new jx(n));return}e.on("readable",()=>{this[_x]&&this._read()}),this.on("resume",()=>{e.resume()}),this.on("pause",()=>{e.pause()}),e.once("end",()=>{this.push(null)}),this.emit("response",e);for(let A of this[Ux])if(!A.headersSent){for(let p in e.headers){let h=r.decompress?p!=="content-encoding":!0,E=e.headers[p];h&&A.setHeader(p,E)}A.statusCode=a}}async _onResponse(e){try{await this._onResponseBase(e)}catch(r){this._beforeError(r)}}_onRequest(e){let{options:r}=this,{timeout:o,url:a}=r;Nit.default(e),this[oU]=ble.default(e,o,a);let n=r.cache?"cacheableResponse":"response";e.once(n,p=>{this._onResponse(p)}),e.once("error",p=>{var h;e.destroy(),(h=e.res)===null||h===void 0||h.removeAllListeners("end"),p=p instanceof ble.TimeoutError?new Yx(p,this.timings,this):new Ji(p.message,p,this),this._beforeError(p)}),this[Fle]=qit.default(e,this,tst),this[Ys]=e,this.emit("uploadProgress",this.uploadProgress);let u=this[fh],A=this.redirects.length===0?this:e;at.default.nodeStream(u)?(u.pipe(A),u.once("error",p=>{this._beforeError(new Wx(p,this))})):(this._unlockWrite(),at.default.undefined(u)?(this._cannotHaveBody||this._noPipe)&&(A.end(),this._lockWrite()):(this._writeRequest(u,void 0,()=>{}),A.end(),this._lockWrite())),this.emit("request",e)}async _createCacheableRequest(e,r){return new Promise((o,a)=>{Object.assign(r,jit.default(e)),delete r.url;let n,u=aU.get(r.cache)(r,async A=>{A._readableState.autoDestroy=!1,n&&(await n).emit("cacheableResponse",A),o(A)});r.url=e,u.once("error",a),u.once("request",async A=>{n=A,o(n)})})}async _makeRequest(){var e,r,o,a,n;let{options:u}=this,{headers:A}=u;for(let U in A)if(at.default.undefined(A[U]))delete A[U];else if(at.default.null_(A[U]))throw new TypeError(`Use \`undefined\` instead of \`null\` to delete the \`${U}\` header`);if(u.decompress&&at.default.undefined(A["accept-encoding"])&&(A["accept-encoding"]=zit?"gzip, deflate, br":"gzip, deflate"),u.cookieJar){let U=await u.cookieJar.getCookieString(u.url.toString());at.default.nonEmptyString(U)&&(u.headers.cookie=U)}for(let U of u.hooks.beforeRequest){let z=await U(u);if(!at.default.undefined(z)){u.request=()=>z;break}}u.body&&this[fh]!==u.body&&(this[fh]=u.body);let{agent:p,request:h,timeout:E,url:w}=u;if(u.dnsCache&&!("lookup"in u)&&(u.lookup=u.dnsCache.lookup),w.hostname==="unix"){let U=/(?.+?):(?.+)/.exec(`${w.pathname}${w.search}`);if(U?.groups){let{socketPath:z,path:te}=U.groups;Object.assign(u,{socketPath:z,path:te,host:""})}}let D=w.protocol==="https:",b;u.http2?b=Uit.auto:b=D?Lit.request:Ple.request;let C=(e=u.request)!==null&&e!==void 0?e:b,T=u.cache?this._createCacheableRequest:C;p&&!u.http2&&(u.agent=p[D?"https":"http"]),u[Ys]=C,delete u.request,delete u.timeout;let N=u;if(N.shared=(r=u.cacheOptions)===null||r===void 0?void 0:r.shared,N.cacheHeuristic=(o=u.cacheOptions)===null||o===void 0?void 0:o.cacheHeuristic,N.immutableMinTimeToLive=(a=u.cacheOptions)===null||a===void 0?void 0:a.immutableMinTimeToLive,N.ignoreCargoCult=(n=u.cacheOptions)===null||n===void 0?void 0:n.ignoreCargoCult,u.dnsLookupIpVersion!==void 0)try{N.family=Qle.dnsLookupIpVersionToFamily(u.dnsLookupIpVersion)}catch{throw new Error("Invalid `dnsLookupIpVersion` option value")}u.https&&("rejectUnauthorized"in u.https&&(N.rejectUnauthorized=u.https.rejectUnauthorized),u.https.checkServerIdentity&&(N.checkServerIdentity=u.https.checkServerIdentity),u.https.certificateAuthority&&(N.ca=u.https.certificateAuthority),u.https.certificate&&(N.cert=u.https.certificate),u.https.key&&(N.key=u.https.key),u.https.passphrase&&(N.passphrase=u.https.passphrase),u.https.pfx&&(N.pfx=u.https.pfx));try{let U=await T(w,N);at.default.undefined(U)&&(U=b(w,N)),u.request=h,u.timeout=E,u.agent=p,u.https&&("rejectUnauthorized"in u.https&&delete N.rejectUnauthorized,u.https.checkServerIdentity&&delete N.checkServerIdentity,u.https.certificateAuthority&&delete N.ca,u.https.certificate&&delete N.cert,u.https.key&&delete N.key,u.https.passphrase&&delete N.passphrase,u.https.pfx&&delete N.pfx),Xit(U)?this._onRequest(U):this.writable?(this.once("finish",()=>{this._onResponse(U)}),this._unlockWrite(),this.end(),this._lockWrite()):this._onResponse(U)}catch(U){throw U instanceof Sle.CacheError?new Gx(U,this):new Ji(U.message,U,this)}}async _error(e){try{for(let r of this.options.hooks.beforeError)e=await r(e)}catch(r){e=new Ji(r.message,r,this)}this.destroy(e)}_beforeError(e){if(this[xy])return;let{options:r}=this,o=this.retryCount+1;this[xy]=!0,e instanceof Ji||(e=new Ji(e.message,e,this));let a=e,{response:n}=a;(async()=>{if(n&&!n.body){n.setEncoding(this._readableState.encoding);try{n.rawBody=await Wit.default(n),n.body=n.rawBody.toString()}catch{}}if(this.listenerCount("retry")!==0){let u;try{let A;n&&"retry-after"in n.headers&&(A=Number(n.headers["retry-after"]),Number.isNaN(A)?(A=Date.parse(n.headers["retry-after"])-Date.now(),A<=0&&(A=1)):A*=1e3),u=await r.retry.calculateDelay({attemptCount:o,retryOptions:r.retry,error:a,retryAfter:A,computedValue:Vit.default({attemptCount:o,retryOptions:r.retry,error:a,retryAfter:A,computedValue:0})})}catch(A){this._error(new Ji(A.message,A,this));return}if(u){let A=async()=>{try{for(let p of this.options.hooks.beforeRetry)await p(this.options,a,o)}catch(p){this._error(new Ji(p.message,e,this));return}this.destroyed||(this.destroy(),this.emit("retry",o,e))};this[Nle]=setTimeout(A,u);return}}this._error(a)})()}_read(){this[_x]=!0;let e=this[Hx];if(e&&!this[xy]){e.readableLength&&(this[_x]=!1);let r;for(;(r=e.read())!==null;){this[Dy]+=r.length,this[Tle]=!0;let o=this.downloadProgress;o.percent<1&&this.emit("downloadProgress",o),this.push(r)}}}_write(e,r,o){let a=()=>{this._writeRequest(e,r,o)};this.requestInitialized?a():this[O1].push(a)}_writeRequest(e,r,o){this[Ys].destroyed||(this._progressCallbacks.push(()=>{this[Sy]+=Buffer.byteLength(e,r);let a=this.uploadProgress;a.percent<1&&this.emit("uploadProgress",a)}),this[Ys].write(e,r,a=>{!a&&this._progressCallbacks.length>0&&this._progressCallbacks.shift()(),o(a)}))}_final(e){let r=()=>{for(;this._progressCallbacks.length!==0;)this._progressCallbacks.shift()();if(!(Ys in this)){e();return}if(this[Ys].destroyed){e();return}this[Ys].end(o=>{o||(this[Py]=this[Sy],this.emit("uploadProgress",this.uploadProgress),this[Ys].emit("upload-complete")),e(o)})};this.requestInitialized?r():this[O1].push(r)}_destroy(e,r){var o;this[xy]=!0,clearTimeout(this[Nle]),Ys in this&&(this[oU](),!((o=this[Hx])===null||o===void 0)&&o.complete||this[Ys].destroy()),e!==null&&!at.default.undefined(e)&&!(e instanceof Ji)&&(e=new Ji(e.message,e,this)),r(e)}get _isAboutToError(){return this[xy]}get ip(){var e;return(e=this.socket)===null||e===void 0?void 0:e.remoteAddress}get aborted(){var e,r,o;return((r=(e=this[Ys])===null||e===void 0?void 0:e.destroyed)!==null&&r!==void 0?r:this.destroyed)&&!(!((o=this[Lle])===null||o===void 0)&&o.complete)}get socket(){var e,r;return(r=(e=this[Ys])===null||e===void 0?void 0:e.socket)!==null&&r!==void 0?r:void 0}get downloadProgress(){let e;return this[vy]?e=this[Dy]/this[vy]:this[vy]===this[Dy]?e=1:e=0,{percent:e,transferred:this[Dy],total:this[vy]}}get uploadProgress(){let e;return this[Py]?e=this[Sy]/this[Py]:this[Py]===this[Sy]?e=1:e=0,{percent:e,transferred:this[Sy],total:this[Py]}}get timings(){var e;return(e=this[Ys])===null||e===void 0?void 0:e.timings}get isFromCache(){return this[Rle]}pipe(e,r){if(this[Tle])throw new Error("Failed to pipe. The response has been emitted already.");return e instanceof iU.ServerResponse&&this[Ux].add(e),super.pipe(e,r)}unpipe(e){return e instanceof iU.ServerResponse&&this[Ux].delete(e),super.unpipe(e),this}};Qn.default=Vx});var _1=_(Jc=>{"use strict";var rst=Jc&&Jc.__createBinding||(Object.create?function(t,e,r,o){o===void 0&&(o=r),Object.defineProperty(t,o,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,o){o===void 0&&(o=r),t[o]=e[r]}),nst=Jc&&Jc.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&rst(e,t,r)};Object.defineProperty(Jc,"__esModule",{value:!0});Jc.CancelError=Jc.ParseError=void 0;var Ole=U1(),lU=class extends Ole.RequestError{constructor(e,r){let{options:o}=r.request;super(`${e.message} in "${o.url.toString()}"`,e,r.request),this.name="ParseError"}};Jc.ParseError=lU;var cU=class extends Ole.RequestError{constructor(e){super("Promise was canceled",{},e),this.name="CancelError"}get isCanceled(){return!0}};Jc.CancelError=cU;nst(U1(),Jc)});var Ule=_(uU=>{"use strict";Object.defineProperty(uU,"__esModule",{value:!0});var Mle=_1(),ist=(t,e,r,o)=>{let{rawBody:a}=t;try{if(e==="text")return a.toString(o);if(e==="json")return a.length===0?"":r(a.toString());if(e==="buffer")return a;throw new Mle.ParseError({message:`Unknown body type '${e}'`,name:"Error"},t)}catch(n){throw new Mle.ParseError(n,t)}};uU.default=ist});var AU=_(ph=>{"use strict";var sst=ph&&ph.__createBinding||(Object.create?function(t,e,r,o){o===void 0&&(o=r),Object.defineProperty(t,o,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,o){o===void 0&&(o=r),t[o]=e[r]}),ost=ph&&ph.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&sst(e,t,r)};Object.defineProperty(ph,"__esModule",{value:!0});var ast=ve("events"),lst=Ff(),cst=Moe(),zx=_1(),_le=Ule(),Hle=U1(),ust=K4(),Ast=eU(),qle=tU(),fst=["request","response","redirect","uploadProgress","downloadProgress"];function jle(t){let e,r,o=new ast.EventEmitter,a=new cst((u,A,p)=>{let h=E=>{let w=new Hle.default(void 0,t);w.retryCount=E,w._noPipe=!0,p(()=>w.destroy()),p.shouldReject=!1,p(()=>A(new zx.CancelError(w))),e=w,w.once("response",async C=>{var T;if(C.retryCount=E,C.request.aborted)return;let N;try{N=await Ast.default(w),C.rawBody=N}catch{return}if(w._isAboutToError)return;let U=((T=C.headers["content-encoding"])!==null&&T!==void 0?T:"").toLowerCase(),z=["gzip","deflate","br"].includes(U),{options:te}=w;if(z&&!te.decompress)C.body=N;else try{C.body=_le.default(C,te.responseType,te.parseJson,te.encoding)}catch(le){if(C.body=N.toString(),qle.isResponseOk(C)){w._beforeError(le);return}}try{for(let[le,ce]of te.hooks.afterResponse.entries())C=await ce(C,async ue=>{let Ie=Hle.default.normalizeArguments(void 0,{...ue,retry:{calculateDelay:()=>0},throwHttpErrors:!1,resolveBodyOnly:!1},te);Ie.hooks.afterResponse=Ie.hooks.afterResponse.slice(0,le);for(let De of Ie.hooks.beforeRetry)await De(Ie);let he=jle(Ie);return p(()=>{he.catch(()=>{}),he.cancel()}),he})}catch(le){w._beforeError(new zx.RequestError(le.message,le,w));return}if(!qle.isResponseOk(C)){w._beforeError(new zx.HTTPError(C));return}r=C,u(w.options.resolveBodyOnly?C.body:C)});let D=C=>{if(a.isCanceled)return;let{options:T}=w;if(C instanceof zx.HTTPError&&!T.throwHttpErrors){let{response:N}=C;u(w.options.resolveBodyOnly?N.body:N);return}A(C)};w.once("error",D);let b=w.options.body;w.once("retry",(C,T)=>{var N,U;if(b===((N=T.request)===null||N===void 0?void 0:N.options.body)&&lst.default.nodeStream((U=T.request)===null||U===void 0?void 0:U.options.body)){D(T);return}h(C)}),ust.default(w,o,fst)};h(0)});a.on=(u,A)=>(o.on(u,A),a);let n=u=>{let A=(async()=>{await a;let{options:p}=r.request;return _le.default(r,u,p.parseJson,p.encoding)})();return Object.defineProperties(A,Object.getOwnPropertyDescriptors(a)),A};return a.json=()=>{let{headers:u}=e.options;return!e.writableFinished&&u.accept===void 0&&(u.accept="application/json"),n("json")},a.buffer=()=>n("buffer"),a.text=()=>n("text"),a}ph.default=jle;ost(_1(),ph)});var Gle=_(fU=>{"use strict";Object.defineProperty(fU,"__esModule",{value:!0});var pst=_1();function hst(t,...e){let r=(async()=>{if(t instanceof pst.RequestError)try{for(let a of e)if(a)for(let n of a)t=await n(t)}catch(a){t=a}throw t})(),o=()=>r;return r.json=o,r.text=o,r.buffer=o,r.on=o,r}fU.default=hst});var Kle=_(pU=>{"use strict";Object.defineProperty(pU,"__esModule",{value:!0});var Wle=Ff();function Yle(t){for(let e of Object.values(t))(Wle.default.plainObject(e)||Wle.default.array(e))&&Yle(e);return Object.freeze(t)}pU.default=Yle});var zle=_(Vle=>{"use strict";Object.defineProperty(Vle,"__esModule",{value:!0})});var hU=_(Xl=>{"use strict";var gst=Xl&&Xl.__createBinding||(Object.create?function(t,e,r,o){o===void 0&&(o=r),Object.defineProperty(t,o,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,o){o===void 0&&(o=r),t[o]=e[r]}),dst=Xl&&Xl.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&gst(e,t,r)};Object.defineProperty(Xl,"__esModule",{value:!0});Xl.defaultHandler=void 0;var Jle=Ff(),Jl=AU(),mst=Gle(),Xx=U1(),yst=Kle(),Est={RequestError:Jl.RequestError,CacheError:Jl.CacheError,ReadError:Jl.ReadError,HTTPError:Jl.HTTPError,MaxRedirectsError:Jl.MaxRedirectsError,TimeoutError:Jl.TimeoutError,ParseError:Jl.ParseError,CancelError:Jl.CancelError,UnsupportedProtocolError:Jl.UnsupportedProtocolError,UploadError:Jl.UploadError},Cst=async t=>new Promise(e=>{setTimeout(e,t)}),{normalizeArguments:Jx}=Xx.default,Xle=(...t)=>{let e;for(let r of t)e=Jx(void 0,r,e);return e},Ist=t=>t.isStream?new Xx.default(void 0,t):Jl.default(t),wst=t=>"defaults"in t&&"options"in t.defaults,Bst=["get","post","put","patch","head","delete"];Xl.defaultHandler=(t,e)=>e(t);var Zle=(t,e)=>{if(t)for(let r of t)r(e)},$le=t=>{t._rawHandlers=t.handlers,t.handlers=t.handlers.map(o=>(a,n)=>{let u,A=o(a,p=>(u=n(p),u));if(A!==u&&!a.isStream&&u){let p=A,{then:h,catch:E,finally:w}=p;Object.setPrototypeOf(p,Object.getPrototypeOf(u)),Object.defineProperties(p,Object.getOwnPropertyDescriptors(u)),p.then=h,p.catch=E,p.finally=w}return A});let e=(o,a={},n)=>{var u,A;let p=0,h=E=>t.handlers[p++](E,p===t.handlers.length?Ist:h);if(Jle.default.plainObject(o)){let E={...o,...a};Xx.setNonEnumerableProperties([o,a],E),a=E,o=void 0}try{let E;try{Zle(t.options.hooks.init,a),Zle((u=a.hooks)===null||u===void 0?void 0:u.init,a)}catch(D){E=D}let w=Jx(o,a,n??t.options);if(w[Xx.kIsNormalizedAlready]=!0,E)throw new Jl.RequestError(E.message,E,w);return h(w)}catch(E){if(a.isStream)throw E;return mst.default(E,t.options.hooks.beforeError,(A=a.hooks)===null||A===void 0?void 0:A.beforeError)}};e.extend=(...o)=>{let a=[t.options],n=[...t._rawHandlers],u;for(let A of o)wst(A)?(a.push(A.defaults.options),n.push(...A.defaults._rawHandlers),u=A.defaults.mutableDefaults):(a.push(A),"handlers"in A&&n.push(...A.handlers),u=A.mutableDefaults);return n=n.filter(A=>A!==Xl.defaultHandler),n.length===0&&n.push(Xl.defaultHandler),$le({options:Xle(...a),handlers:n,mutableDefaults:!!u})};let r=async function*(o,a){let n=Jx(o,a,t.options);n.resolveBodyOnly=!1;let u=n.pagination;if(!Jle.default.object(u))throw new TypeError("`options.pagination` must be implemented");let A=[],{countLimit:p}=u,h=0;for(;h{let n=[];for await(let u of r(o,a))n.push(u);return n},e.paginate.each=r,e.stream=(o,a)=>e(o,{...a,isStream:!0});for(let o of Bst)e[o]=(a,n)=>e(a,{...n,method:o}),e.stream[o]=(a,n)=>e(a,{...n,method:o,isStream:!0});return Object.assign(e,Est),Object.defineProperty(e,"defaults",{value:t.mutableDefaults?t:yst.default(t),writable:t.mutableDefaults,configurable:t.mutableDefaults,enumerable:!0}),e.mergeOptions=Xle,e};Xl.default=$le;dst(zle(),Xl)});var rce=_((Rf,Zx)=>{"use strict";var vst=Rf&&Rf.__createBinding||(Object.create?function(t,e,r,o){o===void 0&&(o=r),Object.defineProperty(t,o,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,o){o===void 0&&(o=r),t[o]=e[r]}),ece=Rf&&Rf.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&vst(e,t,r)};Object.defineProperty(Rf,"__esModule",{value:!0});var Dst=ve("url"),tce=hU(),Pst={options:{method:"GET",retry:{limit:2,methods:["GET","PUT","HEAD","DELETE","OPTIONS","TRACE"],statusCodes:[408,413,429,500,502,503,504,521,522,524],errorCodes:["ETIMEDOUT","ECONNRESET","EADDRINUSE","ECONNREFUSED","EPIPE","ENOTFOUND","ENETUNREACH","EAI_AGAIN"],maxRetryAfter:void 0,calculateDelay:({computedValue:t})=>t},timeout:{},headers:{"user-agent":"got (https://github.com/sindresorhus/got)"},hooks:{init:[],beforeRequest:[],beforeRedirect:[],beforeRetry:[],beforeError:[],afterResponse:[]},cache:void 0,dnsCache:void 0,decompress:!0,throwHttpErrors:!0,followRedirect:!0,isStream:!1,responseType:"text",resolveBodyOnly:!1,maxRedirects:10,prefixUrl:"",methodRewriting:!0,ignoreInvalidCookies:!1,context:{},http2:!1,allowGetBody:!1,https:void 0,pagination:{transform:t=>t.request.options.responseType==="json"?t.body:JSON.parse(t.body),paginate:t=>{if(!Reflect.has(t.headers,"link"))return!1;let e=t.headers.link.split(","),r;for(let o of e){let a=o.split(";");if(a[1].includes("next")){r=a[0].trimStart().trim(),r=r.slice(1,-1);break}}return r?{url:new Dst.URL(r)}:!1},filter:()=>!0,shouldContinue:()=>!0,countLimit:1/0,backoff:0,requestLimit:1e4,stackAllItems:!0},parseJson:t=>JSON.parse(t),stringifyJson:t=>JSON.stringify(t),cacheOptions:{}},handlers:[tce.defaultHandler],mutableDefaults:!1},gU=tce.default(Pst);Rf.default=gU;Zx.exports=gU;Zx.exports.default=gU;Zx.exports.__esModule=!0;ece(hU(),Rf);ece(AU(),Rf)});var on={};Kt(on,{Method:()=>cce,del:()=>Qst,get:()=>EU,getNetworkSettings:()=>lce,post:()=>CU,put:()=>kst,request:()=>H1});function sce(t){let e=new URL(t),r={host:e.hostname,headers:{}};return e.port&&(r.port=Number(e.port)),e.username&&e.password&&(r.proxyAuth=`${e.username}:${e.password}`),{proxy:r}}async function dU(t){return Al(ice,t,()=>ae.readFilePromise(t).then(e=>(ice.set(t,e),e)))}function bst({statusCode:t,statusMessage:e},r){let o=Ut(r,t,Ct.NUMBER),a=`https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/${t}`;return ty(r,`${o}${e?` (${e})`:""}`,a)}async function $x(t,{configuration:e,customErrorMessage:r}){try{return await t}catch(o){if(o.name!=="HTTPError")throw o;let a=r?.(o,e)??o.response.body?.error;a==null&&(o.message.startsWith("Response code")?a="The remote server failed to provide the requested resource":a=o.message),o.code==="ETIMEDOUT"&&o.event==="socket"&&(a+=`(can be increased via ${Ut(e,"httpTimeout",Ct.SETTING)})`);let n=new zt(35,a,u=>{o.response&&u.reportError(35,` ${$u(e,{label:"Response Code",value:Yc(Ct.NO_HINT,bst(o.response,e))})}`),o.request&&(u.reportError(35,` ${$u(e,{label:"Request Method",value:Yc(Ct.NO_HINT,o.request.options.method)})}`),u.reportError(35,` ${$u(e,{label:"Request URL",value:Yc(Ct.URL,o.request.requestUrl)})}`)),o.request.redirects.length>0&&u.reportError(35,` ${$u(e,{label:"Request Redirects",value:Yc(Ct.NO_HINT,cO(e,o.request.redirects,Ct.URL))})}`),o.request.retryCount===o.request.options.retry.limit&&u.reportError(35,` ${$u(e,{label:"Request Retry Count",value:Yc(Ct.NO_HINT,`${Ut(e,o.request.retryCount,Ct.NUMBER)} (can be increased via ${Ut(e,"httpRetry",Ct.SETTING)})`)})}`)});throw n.originalError=o,n}}function lce(t,e){let r=[...e.configuration.get("networkSettings")].sort(([u],[A])=>A.length-u.length),o={enableNetwork:void 0,httpsCaFilePath:void 0,httpProxy:void 0,httpsProxy:void 0,httpsKeyFilePath:void 0,httpsCertFilePath:void 0},a=Object.keys(o),n=typeof t=="string"?new URL(t):t;for(let[u,A]of r)if(yU.default.isMatch(n.hostname,u))for(let p of a){let h=A.get(p);h!==null&&typeof o[p]>"u"&&(o[p]=h)}for(let u of a)typeof o[u]>"u"&&(o[u]=e.configuration.get(u));return o}async function H1(t,e,{configuration:r,headers:o,jsonRequest:a,jsonResponse:n,method:u="GET",wrapNetworkRequest:A}){let p={target:t,body:e,configuration:r,headers:o,jsonRequest:a,jsonResponse:n,method:u},h=async()=>await Fst(t,e,p),E=typeof A<"u"?await A(h,p):h;return await(await r.reduceHook(D=>D.wrapNetworkRequest,E,p))()}async function EU(t,{configuration:e,jsonResponse:r,customErrorMessage:o,wrapNetworkRequest:a,...n}){let u=()=>$x(H1(t,null,{configuration:e,wrapNetworkRequest:a,...n}),{configuration:e,customErrorMessage:o}).then(p=>p.body),A=await(typeof a<"u"?u():Al(nce,t,()=>u().then(p=>(nce.set(t,p),p))));return r?JSON.parse(A.toString()):A}async function kst(t,e,{customErrorMessage:r,...o}){return(await $x(H1(t,e,{...o,method:"PUT"}),{customErrorMessage:r,configuration:o.configuration})).body}async function CU(t,e,{customErrorMessage:r,...o}){return(await $x(H1(t,e,{...o,method:"POST"}),{customErrorMessage:r,configuration:o.configuration})).body}async function Qst(t,{customErrorMessage:e,...r}){return(await $x(H1(t,null,{...r,method:"DELETE"}),{customErrorMessage:e,configuration:r.configuration})).body}async function Fst(t,e,{configuration:r,headers:o,jsonRequest:a,jsonResponse:n,method:u="GET"}){let A=typeof t=="string"?new URL(t):t,p=lce(A,{configuration:r});if(p.enableNetwork===!1)throw new zt(80,`Request to '${A.href}' has been blocked because of your configuration settings`);if(A.protocol==="http:"&&!yU.default.isMatch(A.hostname,r.get("unsafeHttpWhitelist")))throw new zt(81,`Unsafe http requests must be explicitly whitelisted in your configuration (${A.hostname})`);let E={agent:{http:p.httpProxy?mU.default.httpOverHttp(sce(p.httpProxy)):Sst,https:p.httpsProxy?mU.default.httpsOverHttp(sce(p.httpsProxy)):xst},headers:o,method:u};E.responseType=n?"json":"buffer",e!==null&&(Buffer.isBuffer(e)||!a&&typeof e=="string"?E.body=e:E.json=e);let w=r.get("httpTimeout"),D=r.get("httpRetry"),b=r.get("enableStrictSsl"),C=p.httpsCaFilePath,T=p.httpsCertFilePath,N=p.httpsKeyFilePath,{default:U}=await Promise.resolve().then(()=>et(rce())),z=C?await dU(C):void 0,te=T?await dU(T):void 0,le=N?await dU(N):void 0,ce=U.extend({timeout:{socket:w},retry:D,https:{rejectUnauthorized:b,certificateAuthority:z,certificate:te,key:le},...E});return r.getLimit("networkConcurrency")(()=>ce(A))}var oce,ace,yU,mU,nce,ice,Sst,xst,cce,eb=It(()=>{Pt();oce=ve("https"),ace=ve("http"),yU=et(Xo()),mU=et(Roe());Vl();Wl();Gl();nce=new Map,ice=new Map,Sst=new ace.Agent({keepAlive:!0}),xst=new oce.Agent({keepAlive:!0});cce=(a=>(a.GET="GET",a.PUT="PUT",a.POST="POST",a.DELETE="DELETE",a))(cce||{})});var Xi={};Kt(Xi,{availableParallelism:()=>wU,getArchitecture:()=>q1,getArchitectureName:()=>Ost,getArchitectureSet:()=>IU,getCaller:()=>Hst,major:()=>Rst,openUrl:()=>Tst});function Nst(){if(process.platform==="darwin"||process.platform==="win32")return null;let t;try{t=ae.readFileSync(Lst)}catch{}if(typeof t<"u"){if(t&&(t.includes("GLIBC")||t.includes("libc")))return"glibc";if(t&&t.includes("musl"))return"musl"}let r=(process.report?.getReport()??{}).sharedObjects??[],o=/\/(?:(ld-linux-|[^/]+-linux-gnu\/)|(libc.musl-|ld-musl-))/;return eh(r,a=>{let n=a.match(o);if(!n)return eh.skip;if(n[1])return"glibc";if(n[2])return"musl";throw new Error("Assertion failed: Expected the libc variant to have been detected")})??null}function q1(){return Ace=Ace??{os:process.platform,cpu:process.arch,libc:Nst()}}function Ost(t=q1()){return t.libc?`${t.os}-${t.cpu}-${t.libc}`:`${t.os}-${t.cpu}`}function IU(){let t=q1();return fce=fce??{os:[t.os],cpu:[t.cpu],libc:t.libc?[t.libc]:[]}}function _st(t){let e=Mst.exec(t);if(!e)return null;let r=e[2]&&e[2].indexOf("native")===0,o=e[2]&&e[2].indexOf("eval")===0,a=Ust.exec(e[2]);return o&&a!=null&&(e[2]=a[1],e[3]=a[2],e[4]=a[3]),{file:r?null:e[2],methodName:e[1]||"",arguments:r?[e[2]]:[],line:e[3]?+e[3]:null,column:e[4]?+e[4]:null}}function Hst(){let e=new Error().stack.split(` `)[3];return _st(e)}function wU(){return typeof tb.default.availableParallelism<"u"?tb.default.availableParallelism():Math.max(1,tb.default.cpus().length)}var tb,Rst,uce,Tst,Lst,Ace,fce,Mst,Ust,rb=It(()=>{Pt();tb=et(ve("os"));nb();Gl();Rst=Number(process.versions.node.split(".")[0]),uce=new Map([["darwin","open"],["linux","xdg-open"],["win32","explorer.exe"]]).get(process.platform),Tst=typeof uce<"u"?async t=>{try{return await BU(uce,[t],{cwd:K.cwd()}),!0}catch{return!1}}:void 0,Lst="/usr/bin/ldd";Mst=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack||\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Ust=/\((\S*)(?::(\d+))(?::(\d+))\)/});function xU(t,e,r,o,a){let n=b1(r);if(o.isArray||o.type==="ANY"&&Array.isArray(n))return Array.isArray(n)?n.map((u,A)=>vU(t,`${e}[${A}]`,u,o,a)):String(n).split(/,/).map(u=>vU(t,e,u,o,a));if(Array.isArray(n))throw new Error(`Non-array configuration settings "${e}" cannot be an array`);return vU(t,e,r,o,a)}function vU(t,e,r,o,a){let n=b1(r);switch(o.type){case"ANY":return wx(n);case"SHAPE":return Wst(t,e,r,o,a);case"MAP":return Yst(t,e,r,o,a)}if(n===null&&!o.isNullable&&o.default!==null)throw new Error(`Non-nullable configuration settings "${e}" cannot be set to null`);if(o.values?.includes(n))return n;let A=(()=>{if(o.type==="BOOLEAN"&&typeof n!="string")return f1(n);if(typeof n!="string")throw new Error(`Expected configuration setting "${e}" to be a string, got ${typeof n}`);let p=NS(n,{env:t.env});switch(o.type){case"ABSOLUTE_PATH":{let h=a,E=e4(r);return E&&E[0]!=="<"&&(h=K.dirname(E)),K.resolve(h,Ae.toPortablePath(p))}case"LOCATOR_LOOSE":return Sf(p,!1);case"NUMBER":return parseInt(p);case"LOCATOR":return Sf(p);case"BOOLEAN":return f1(p);default:return p}})();if(o.values&&!o.values.includes(A))throw new Error(`Invalid value, expected one of ${o.values.join(", ")}`);return A}function Wst(t,e,r,o,a){let n=b1(r);if(typeof n!="object"||Array.isArray(n))throw new ot(`Object configuration settings "${e}" must be an object`);let u=bU(t,o,{ignoreArrays:!0});if(n===null)return u;for(let[A,p]of Object.entries(n)){let h=`${e}.${A}`;if(!o.properties[A])throw new ot(`Unrecognized configuration settings found: ${e}.${A} - run "yarn config -v" to see the list of settings supported in Yarn`);u.set(A,xU(t,h,p,o.properties[A],a))}return u}function Yst(t,e,r,o,a){let n=b1(r),u=new Map;if(typeof n!="object"||Array.isArray(n))throw new ot(`Map configuration settings "${e}" must be an object`);if(n===null)return u;for(let[A,p]of Object.entries(n)){let h=o.normalizeKeys?o.normalizeKeys(A):A,E=`${e}['${h}']`,w=o.valueDefinition;u.set(h,xU(t,E,p,w,a))}return u}function bU(t,e,{ignoreArrays:r=!1}={}){switch(e.type){case"SHAPE":{if(e.isArray&&!r)return[];let o=new Map;for(let[a,n]of Object.entries(e.properties))o.set(a,bU(t,n));return o}case"MAP":return e.isArray&&!r?[]:new Map;case"ABSOLUTE_PATH":return e.default===null?null:t.projectCwd===null?Array.isArray(e.default)?e.default.map(o=>K.normalize(o)):K.isAbsolute(e.default)?K.normalize(e.default):e.isNullable?null:void 0:Array.isArray(e.default)?e.default.map(o=>K.resolve(t.projectCwd,o)):K.resolve(t.projectCwd,e.default);default:return e.default}}function sb(t,e,r){if(e.type==="SECRET"&&typeof t=="string"&&r.hideSecrets)return Gst;if(e.type==="ABSOLUTE_PATH"&&typeof t=="string"&&r.getNativePaths)return Ae.fromPortablePath(t);if(e.isArray&&Array.isArray(t)){let o=[];for(let a of t)o.push(sb(a,e,r));return o}if(e.type==="MAP"&&t instanceof Map){if(t.size===0)return;let o=new Map;for(let[a,n]of t.entries()){let u=sb(n,e.valueDefinition,r);typeof u<"u"&&o.set(a,u)}return o}if(e.type==="SHAPE"&&t instanceof Map){if(t.size===0)return;let o=new Map;for(let[a,n]of t.entries()){let u=e.properties[a],A=sb(n,u,r);typeof A<"u"&&o.set(a,A)}return o}return t}function Kst(){let t={};for(let[e,r]of Object.entries(process.env))e=e.toLowerCase(),e.startsWith(ob)&&(e=(0,hce.default)(e.slice(ob.length)),t[e]=r);return t}function PU(){let t=`${ob}rc_filename`;for(let[e,r]of Object.entries(process.env))if(e.toLowerCase()===t&&typeof r=="string")return r;return SU}async function pce(t){try{return await ae.readFilePromise(t)}catch{return Buffer.of()}}async function Vst(t,e){return Buffer.compare(...await Promise.all([pce(t),pce(e)]))===0}async function zst(t,e){let[r,o]=await Promise.all([ae.statPromise(t),ae.statPromise(e)]);return r.dev===o.dev&&r.ino===o.ino}async function Xst({configuration:t,selfPath:e}){let r=t.get("yarnPath");return t.get("ignorePath")||r===null||r===e||await Jst(r,e)?null:r}var hce,Tf,gce,dce,mce,DU,qst,j1,jst,by,ob,SU,Gst,G1,yce,ab,ib,Jst,Je,W1=It(()=>{Pt();Ol();hce=et(jV()),Tf=et(sg());Gt();gce=et(Nz()),dce=ve("module"),mce=et(lg()),DU=ve("stream");Vse();Ay();YM();KM();VM();woe();zM();Dg();Soe();vx();Wl();ah();eb();Gl();rb();bf();Io();qst=function(){if(!Tf.GITHUB_ACTIONS||!process.env.GITHUB_EVENT_PATH)return!1;let t=Ae.toPortablePath(process.env.GITHUB_EVENT_PATH),e;try{e=ae.readJsonSync(t)}catch{return!1}return!(!("repository"in e)||!e.repository||(e.repository.private??!0))}(),j1=new Set(["@yarnpkg/plugin-constraints","@yarnpkg/plugin-exec","@yarnpkg/plugin-interactive-tools","@yarnpkg/plugin-stage","@yarnpkg/plugin-typescript","@yarnpkg/plugin-version","@yarnpkg/plugin-workspace-tools"]),jst=new Set(["isTestEnv","injectNpmUser","injectNpmPassword","injectNpm2FaToken","zipDataEpilogue","cacheCheckpointOverride","cacheVersionOverride","lockfileVersionOverride","binFolder","version","flags","profile","gpg","ignoreNode","wrapOutput","home","confDir","registry","ignoreCwd"]),by=/^(?!v)[a-z0-9._-]+$/i,ob="yarn_",SU=".yarnrc.yml",Gst="********",G1=(E=>(E.ANY="ANY",E.BOOLEAN="BOOLEAN",E.ABSOLUTE_PATH="ABSOLUTE_PATH",E.LOCATOR="LOCATOR",E.LOCATOR_LOOSE="LOCATOR_LOOSE",E.NUMBER="NUMBER",E.STRING="STRING",E.SECRET="SECRET",E.SHAPE="SHAPE",E.MAP="MAP",E))(G1||{}),yce=Ct,ab=(r=>(r.JUNCTIONS="junctions",r.SYMLINKS="symlinks",r))(ab||{}),ib={lastUpdateCheck:{description:"Last timestamp we checked whether new Yarn versions were available",type:"STRING",default:null},yarnPath:{description:"Path to the local executable that must be used over the global one",type:"ABSOLUTE_PATH",default:null},ignorePath:{description:"If true, the local executable will be ignored when using the global one",type:"BOOLEAN",default:!1},globalFolder:{description:"Folder where all system-global files are stored",type:"ABSOLUTE_PATH",default:r4()},cacheFolder:{description:"Folder where the cache files must be written",type:"ABSOLUTE_PATH",default:"./.yarn/cache"},compressionLevel:{description:"Zip files compression level, from 0 to 9 or mixed (a variant of 9, which stores some files uncompressed, when compression doesn't yield good results)",type:"NUMBER",values:["mixed",0,1,2,3,4,5,6,7,8,9],default:0},virtualFolder:{description:"Folder where the virtual packages (cf doc) will be mapped on the disk (must be named __virtual__)",type:"ABSOLUTE_PATH",default:"./.yarn/__virtual__"},installStatePath:{description:"Path of the file where the install state will be persisted",type:"ABSOLUTE_PATH",default:"./.yarn/install-state.gz"},immutablePatterns:{description:"Array of glob patterns; files matching them won't be allowed to change during immutable installs",type:"STRING",default:[],isArray:!0},rcFilename:{description:"Name of the files where the configuration can be found",type:"STRING",default:PU()},enableGlobalCache:{description:"If true, the system-wide cache folder will be used regardless of `cache-folder`",type:"BOOLEAN",default:!0},cacheMigrationMode:{description:"Defines the conditions under which Yarn upgrades should cause the cache archives to be regenerated.",type:"STRING",values:["always","match-spec","required-only"],default:"always"},enableColors:{description:"If true, the CLI is allowed to use colors in its output",type:"BOOLEAN",default:US,defaultText:""},enableHyperlinks:{description:"If true, the CLI is allowed to use hyperlinks in its output",type:"BOOLEAN",default:lO,defaultText:""},enableInlineBuilds:{description:"If true, the CLI will print the build output on the command line",type:"BOOLEAN",default:Tf.isCI,defaultText:""},enableMessageNames:{description:"If true, the CLI will prefix most messages with codes suitable for search engines",type:"BOOLEAN",default:!0},enableProgressBars:{description:"If true, the CLI is allowed to show a progress bar for long-running events",type:"BOOLEAN",default:!Tf.isCI,defaultText:""},enableTimers:{description:"If true, the CLI is allowed to print the time spent executing commands",type:"BOOLEAN",default:!0},enableTips:{description:"If true, installs will print a helpful message every day of the week",type:"BOOLEAN",default:!Tf.isCI,defaultText:""},preferInteractive:{description:"If true, the CLI will automatically use the interactive mode when called from a TTY",type:"BOOLEAN",default:!1},preferTruncatedLines:{description:"If true, the CLI will truncate lines that would go beyond the size of the terminal",type:"BOOLEAN",default:!1},progressBarStyle:{description:"Which style of progress bar should be used (only when progress bars are enabled)",type:"STRING",default:void 0,defaultText:""},defaultLanguageName:{description:"Default language mode that should be used when a package doesn't offer any insight",type:"STRING",default:"node"},defaultProtocol:{description:"Default resolution protocol used when resolving pure semver and tag ranges",type:"STRING",default:"npm:"},enableTransparentWorkspaces:{description:"If false, Yarn won't automatically resolve workspace dependencies unless they use the `workspace:` protocol",type:"BOOLEAN",default:!0},supportedArchitectures:{description:"Architectures that Yarn will fetch and inject into the resolver",type:"SHAPE",properties:{os:{description:"Array of supported process.platform strings, or null to target them all",type:"STRING",isArray:!0,isNullable:!0,default:["current"]},cpu:{description:"Array of supported process.arch strings, or null to target them all",type:"STRING",isArray:!0,isNullable:!0,default:["current"]},libc:{description:"Array of supported libc libraries, or null to target them all",type:"STRING",isArray:!0,isNullable:!0,default:["current"]}}},enableMirror:{description:"If true, the downloaded packages will be retrieved and stored in both the local and global folders",type:"BOOLEAN",default:!0},enableNetwork:{description:"If false, Yarn will refuse to use the network if required to",type:"BOOLEAN",default:!0},enableOfflineMode:{description:"If true, Yarn will attempt to retrieve files and metadata from the global cache rather than the network",type:"BOOLEAN",default:!1},httpProxy:{description:"URL of the http proxy that must be used for outgoing http requests",type:"STRING",default:null},httpsProxy:{description:"URL of the http proxy that must be used for outgoing https requests",type:"STRING",default:null},unsafeHttpWhitelist:{description:"List of the hostnames for which http queries are allowed (glob patterns are supported)",type:"STRING",default:[],isArray:!0},httpTimeout:{description:"Timeout of each http request in milliseconds",type:"NUMBER",default:6e4},httpRetry:{description:"Retry times on http failure",type:"NUMBER",default:3},networkConcurrency:{description:"Maximal number of concurrent requests",type:"NUMBER",default:50},taskPoolConcurrency:{description:"Maximal amount of concurrent heavy task processing",type:"NUMBER",default:wU()},taskPoolMode:{description:"Execution strategy for heavy tasks",type:"STRING",values:["async","workers"],default:"workers"},networkSettings:{description:"Network settings per hostname (glob patterns are supported)",type:"MAP",valueDefinition:{description:"",type:"SHAPE",properties:{httpsCaFilePath:{description:"Path to file containing one or multiple Certificate Authority signing certificates",type:"ABSOLUTE_PATH",default:null},enableNetwork:{description:"If false, the package manager will refuse to use the network if required to",type:"BOOLEAN",default:null},httpProxy:{description:"URL of the http proxy that must be used for outgoing http requests",type:"STRING",default:null},httpsProxy:{description:"URL of the http proxy that must be used for outgoing https requests",type:"STRING",default:null},httpsKeyFilePath:{description:"Path to file containing private key in PEM format",type:"ABSOLUTE_PATH",default:null},httpsCertFilePath:{description:"Path to file containing certificate chain in PEM format",type:"ABSOLUTE_PATH",default:null}}}},httpsCaFilePath:{description:"A path to a file containing one or multiple Certificate Authority signing certificates",type:"ABSOLUTE_PATH",default:null},httpsKeyFilePath:{description:"Path to file containing private key in PEM format",type:"ABSOLUTE_PATH",default:null},httpsCertFilePath:{description:"Path to file containing certificate chain in PEM format",type:"ABSOLUTE_PATH",default:null},enableStrictSsl:{description:"If false, SSL certificate errors will be ignored",type:"BOOLEAN",default:!0},logFilters:{description:"Overrides for log levels",type:"SHAPE",isArray:!0,concatenateValues:!0,properties:{code:{description:"Code of the messages covered by this override",type:"STRING",default:void 0},text:{description:"Code of the texts covered by this override",type:"STRING",default:void 0},pattern:{description:"Code of the patterns covered by this override",type:"STRING",default:void 0},level:{description:"Log level override, set to null to remove override",type:"STRING",values:Object.values(HS),isNullable:!0,default:void 0}}},enableTelemetry:{description:"If true, telemetry will be periodically sent, following the rules in https://yarnpkg.com/advanced/telemetry",type:"BOOLEAN",default:!0},telemetryInterval:{description:"Minimal amount of time between two telemetry uploads, in days",type:"NUMBER",default:7},telemetryUserId:{description:"If you desire to tell us which project you are, you can set this field. Completely optional and opt-in.",type:"STRING",default:null},enableHardenedMode:{description:"If true, automatically enable --check-resolutions --refresh-lockfile on installs",type:"BOOLEAN",default:Tf.isPR&&qst,defaultText:""},enableScripts:{description:"If true, packages are allowed to have install scripts by default",type:"BOOLEAN",default:!0},enableStrictSettings:{description:"If true, unknown settings will cause Yarn to abort",type:"BOOLEAN",default:!0},enableImmutableCache:{description:"If true, the cache is reputed immutable and actions that would modify it will throw",type:"BOOLEAN",default:!1},checksumBehavior:{description:"Enumeration defining what to do when a checksum doesn't match expectations",type:"STRING",default:"throw"},injectEnvironmentFiles:{description:"List of all the environment files that Yarn should inject inside the process when it starts",type:"ABSOLUTE_PATH",default:[".env.yarn?"],isArray:!0},packageExtensions:{description:"Map of package corrections to apply on the dependency tree",type:"MAP",valueDefinition:{description:"The extension that will be applied to any package whose version matches the specified range",type:"SHAPE",properties:{dependencies:{description:"The set of dependencies that must be made available to the current package in order for it to work properly",type:"MAP",valueDefinition:{description:"A range",type:"STRING"}},peerDependencies:{description:"Inherited dependencies - the consumer of the package will be tasked to provide them",type:"MAP",valueDefinition:{description:"A semver range",type:"STRING"}},peerDependenciesMeta:{description:"Extra information related to the dependencies listed in the peerDependencies field",type:"MAP",valueDefinition:{description:"The peerDependency meta",type:"SHAPE",properties:{optional:{description:"If true, the selected peer dependency will be marked as optional by the package manager and the consumer omitting it won't be reported as an error",type:"BOOLEAN",default:!1}}}}}}}};Jst=process.platform==="win32"?Vst:zst;Je=class t{constructor(e){this.isCI=Tf.isCI;this.projectCwd=null;this.plugins=new Map;this.settings=new Map;this.values=new Map;this.sources=new Map;this.invalid=new Map;this.env={};this.limits=new Map;this.packageExtensions=null;this.startingCwd=e}static{this.deleteProperty=Symbol()}static{this.telemetry=null}static create(e,r,o){let a=new t(e);typeof r<"u"&&!(r instanceof Map)&&(a.projectCwd=r),a.importSettings(ib);let n=typeof o<"u"?o:r instanceof Map?r:new Map;for(let[u,A]of n)a.activatePlugin(u,A);return a}static async find(e,r,{strict:o=!0,usePathCheck:a=null,useRc:n=!0}={}){let u=Kst();delete u.rcFilename;let A=new t(e),p=await t.findRcFiles(e),h=await t.findFolderRcFile(my());h&&(p.find(Ie=>Ie.path===h.path)||p.unshift(h));let E=Poe(p.map(ue=>[ue.path,ue.data])),w=Bt.dot,D=new Set(Object.keys(ib)),b=({yarnPath:ue,ignorePath:Ie,injectEnvironmentFiles:he})=>({yarnPath:ue,ignorePath:Ie,injectEnvironmentFiles:he}),C=({yarnPath:ue,ignorePath:Ie,injectEnvironmentFiles:he,...De})=>{let Ee={};for(let[g,me]of Object.entries(De))D.has(g)&&(Ee[g]=me);return Ee},T=({yarnPath:ue,ignorePath:Ie,...he})=>{let De={};for(let[Ee,g]of Object.entries(he))D.has(Ee)||(De[Ee]=g);return De};if(A.importSettings(b(ib)),A.useWithSource("",b(u),e,{strict:!1}),E){let[ue,Ie]=E;A.useWithSource(ue,b(Ie),w,{strict:!1})}if(a){if(await Xst({configuration:A,selfPath:a})!==null)return A;A.useWithSource("",{ignorePath:!0},e,{strict:!1,overwrite:!0})}let N=await t.findProjectCwd(e);A.startingCwd=e,A.projectCwd=N;let U=Object.assign(Object.create(null),process.env);A.env=U;let z=await Promise.all(A.get("injectEnvironmentFiles").map(async ue=>{let Ie=ue.endsWith("?")?await ae.readFilePromise(ue.slice(0,-1),"utf8").catch(()=>""):await ae.readFilePromise(ue,"utf8");return(0,gce.parse)(Ie)}));for(let ue of z)for(let[Ie,he]of Object.entries(ue))A.env[Ie]=NS(he,{env:U});if(A.importSettings(C(ib)),A.useWithSource("",C(u),e,{strict:o}),E){let[ue,Ie]=E;A.useWithSource(ue,C(Ie),w,{strict:o})}let te=ue=>"default"in ue?ue.default:ue,le=new Map([["@@core",Kse]]);if(r!==null)for(let ue of r.plugins.keys())le.set(ue,te(r.modules.get(ue)));for(let[ue,Ie]of le)A.activatePlugin(ue,Ie);let ce=new Map([]);if(r!==null){let ue=new Map;for(let[De,Ee]of r.modules)ue.set(De,()=>Ee);let Ie=new Set,he=async(De,Ee)=>{let{factory:g,name:me}=vf(De);if(!g||Ie.has(me))return;let Ce=new Map(ue),fe=Z=>{if((0,dce.isBuiltin)(Z))return vf(Z);if(Ce.has(Z))return Ce.get(Z)();throw new ot(`This plugin cannot access the package referenced via ${Z} which is neither a builtin, nor an exposed entry`)},ie=await Jm(async()=>te(await g(fe)),Z=>`${Z} (when initializing ${me}, defined in ${Ee})`);ue.set(me,()=>ie),Ie.add(me),ce.set(me,ie)};if(u.plugins)for(let De of u.plugins.split(";")){let Ee=K.resolve(e,Ae.toPortablePath(De));await he(Ee,"")}for(let{path:De,cwd:Ee,data:g}of p)if(n&&Array.isArray(g.plugins))for(let me of g.plugins){let Ce=typeof me!="string"?me.path:me,fe=me?.spec??"",ie=me?.checksum??"";if(j1.has(fe))continue;let Z=K.resolve(Ee,Ae.toPortablePath(Ce));if(!await ae.existsPromise(Z)){if(!fe){let ht=Ut(A,K.basename(Z,".cjs"),Ct.NAME),q=Ut(A,".gitignore",Ct.NAME),nt=Ut(A,A.values.get("rcFilename"),Ct.NAME),Le=Ut(A,"https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored",Ct.URL);throw new ot(`Missing source for the ${ht} plugin - please try to remove the plugin from ${nt} then reinstall it manually. This error usually occurs because ${q} is incorrect, check ${Le} to make sure your plugin folder isn't gitignored.`)}if(!fe.match(/^https?:/)){let ht=Ut(A,K.basename(Z,".cjs"),Ct.NAME),q=Ut(A,A.values.get("rcFilename"),Ct.NAME);throw new ot(`Failed to recognize the source for the ${ht} plugin - please try to delete the plugin from ${q} then reinstall it manually.`)}let Pe=await EU(fe,{configuration:A}),Re=zi(Pe);if(ie&&ie!==Re){let ht=Ut(A,K.basename(Z,".cjs"),Ct.NAME),q=Ut(A,A.values.get("rcFilename"),Ct.NAME),nt=Ut(A,`yarn plugin import ${fe}`,Ct.CODE);throw new ot(`Failed to fetch the ${ht} plugin from its remote location: its checksum seems to have changed. If this is expected, please remove the plugin from ${q} then run ${nt} to reimport it.`)}await ae.mkdirPromise(K.dirname(Z),{recursive:!0}),await ae.writeFilePromise(Z,Pe)}await he(Z,De)}}for(let[ue,Ie]of ce)A.activatePlugin(ue,Ie);if(A.useWithSource("",T(u),e,{strict:o}),E){let[ue,Ie]=E;A.useWithSource(ue,T(Ie),w,{strict:o})}return A.get("enableGlobalCache")&&(A.values.set("cacheFolder",`${A.get("globalFolder")}/cache`),A.sources.set("cacheFolder","")),A}static async findRcFiles(e){let r=PU(),o=[],a=e,n=null;for(;a!==n;){n=a;let u=K.join(n,r);if(ae.existsSync(u)){let A=await ae.readFilePromise(u,"utf8"),p;try{p=Ki(A)}catch{let E="";throw A.match(/^\s+(?!-)[^:]+\s+\S+/m)&&(E=" (in particular, make sure you list the colons after each key name)"),new ot(`Parse error when loading ${u}; please check it's proper Yaml${E}`)}o.unshift({path:u,cwd:n,data:p})}a=K.dirname(n)}return o}static async findFolderRcFile(e){let r=K.join(e,mr.rc),o;try{o=await ae.readFilePromise(r,"utf8")}catch(n){if(n.code==="ENOENT")return null;throw n}let a=Ki(o);return{path:r,cwd:e,data:a}}static async findProjectCwd(e){let r=null,o=e,a=null;for(;o!==a;){if(a=o,ae.existsSync(K.join(a,mr.lockfile)))return a;ae.existsSync(K.join(a,mr.manifest))&&(r=a),o=K.dirname(a)}return r}static async updateConfiguration(e,r,o={}){let a=PU(),n=K.join(e,a),u=ae.existsSync(n)?Ki(await ae.readFilePromise(n,"utf8")):{},A=!1,p;if(typeof r=="function"){try{p=r(u)}catch{p=r({})}if(p===u)return!1}else{p=u;for(let h of Object.keys(r)){let E=u[h],w=r[h],D;if(typeof w=="function")try{D=w(E)}catch{D=w(void 0)}else D=w;E!==D&&(D===t.deleteProperty?delete p[h]:p[h]=D,A=!0)}if(!A)return!1}return await ae.changeFilePromise(n,Pa(p),{automaticNewlines:!0}),!0}static async addPlugin(e,r){r.length!==0&&await t.updateConfiguration(e,o=>{let a=o.plugins??[];if(a.length===0)return{...o,plugins:r};let n=[],u=[...r];for(let A of a){let p=typeof A!="string"?A.path:A,h=u.find(E=>E.path===p);h?(n.push(h),u=u.filter(E=>E!==h)):n.push(A)}return n.push(...u),{...o,plugins:n}})}static async updateHomeConfiguration(e){let r=my();return await t.updateConfiguration(r,e)}activatePlugin(e,r){this.plugins.set(e,r),typeof r.configuration<"u"&&this.importSettings(r.configuration)}importSettings(e){for(let[r,o]of Object.entries(e))if(o!=null){if(this.settings.has(r))throw new Error(`Cannot redefine settings "${r}"`);this.settings.set(r,o),this.values.set(r,bU(this,o))}}useWithSource(e,r,o,a){try{this.use(e,r,o,a)}catch(n){throw n.message+=` (in ${Ut(this,e,Ct.PATH)})`,n}}use(e,r,o,{strict:a=!0,overwrite:n=!1}={}){a=a&&this.get("enableStrictSettings");for(let u of["enableStrictSettings",...Object.keys(r)]){let A=r[u],p=e4(A);if(p&&(e=p),typeof A>"u"||u==="plugins"||e===""&&jst.has(u))continue;if(u==="rcFilename")throw new ot(`The rcFilename settings can only be set via ${`${ob}RC_FILENAME`.toUpperCase()}, not via a rc file`);let h=this.settings.get(u);if(!h){let w=my(),D=e[0]!=="<"?K.dirname(e):null;if(a&&!(D!==null?w===D:!1))throw new ot(`Unrecognized or legacy configuration settings found: ${u} - run "yarn config -v" to see the list of settings supported in Yarn`);this.invalid.set(u,e);continue}if(this.sources.has(u)&&!(n||h.type==="MAP"||h.isArray&&h.concatenateValues))continue;let E;try{E=xU(this,u,A,h,o)}catch(w){throw w.message+=` in ${Ut(this,e,Ct.PATH)}`,w}if(u==="enableStrictSettings"&&e!==""){a=E;continue}if(h.type==="MAP"){let w=this.values.get(u);this.values.set(u,new Map(n?[...w,...E]:[...E,...w])),this.sources.set(u,`${this.sources.get(u)}, ${e}`)}else if(h.isArray&&h.concatenateValues){let w=this.values.get(u);this.values.set(u,n?[...w,...E]:[...E,...w]),this.sources.set(u,`${this.sources.get(u)}, ${e}`)}else this.values.set(u,E),this.sources.set(u,e)}}get(e){if(!this.values.has(e))throw new Error(`Invalid configuration key "${e}"`);return this.values.get(e)}getSpecial(e,{hideSecrets:r=!1,getNativePaths:o=!1}){let a=this.get(e),n=this.settings.get(e);if(typeof n>"u")throw new ot(`Couldn't find a configuration settings named "${e}"`);return sb(a,n,{hideSecrets:r,getNativePaths:o})}getSubprocessStreams(e,{header:r,prefix:o,report:a}){let n,u,A=ae.createWriteStream(e);if(this.get("enableInlineBuilds")){let p=a.createStreamReporter(`${o} ${Ut(this,"STDOUT","green")}`),h=a.createStreamReporter(`${o} ${Ut(this,"STDERR","red")}`);n=new DU.PassThrough,n.pipe(p),n.pipe(A),u=new DU.PassThrough,u.pipe(h),u.pipe(A)}else n=A,u=A,typeof r<"u"&&n.write(`${r} `);return{stdout:n,stderr:u}}makeResolver(){let e=[];for(let r of this.plugins.values())for(let o of r.resolvers||[])e.push(new o);return new Pg([new Ix,new ci,...e])}makeFetcher(){let e=[];for(let r of this.plugins.values())for(let o of r.fetchers||[])e.push(new o);return new py([new hy,new gy,...e])}getLinkers(){let e=[];for(let r of this.plugins.values())for(let o of r.linkers||[])e.push(new o);return e}getSupportedArchitectures(){let e=q1(),r=this.get("supportedArchitectures"),o=r.get("os");o!==null&&(o=o.map(u=>u==="current"?e.os:u));let a=r.get("cpu");a!==null&&(a=a.map(u=>u==="current"?e.cpu:u));let n=r.get("libc");return n!==null&&(n=ul(n,u=>u==="current"?e.libc??ul.skip:u)),{os:o,cpu:a,libc:n}}isInteractive({interactive:e,stdout:r}){return r.isTTY?e??this.get("preferInteractive"):!1}async getPackageExtensions(){if(this.packageExtensions!==null)return this.packageExtensions;this.packageExtensions=new Map;let e=this.packageExtensions,r=(o,a,{userProvided:n=!1}={})=>{if(!Fa(o.range))throw new Error("Only semver ranges are allowed as keys for the packageExtensions setting");let u=new _t;u.load(a,{yamlCompatibilityMode:!0});let A=u1(e,o.identHash),p=[];A.push([o.range,p]);let h={status:"inactive",userProvided:n,parentDescriptor:o};for(let E of u.dependencies.values())p.push({...h,type:"Dependency",descriptor:E});for(let E of u.peerDependencies.values())p.push({...h,type:"PeerDependency",descriptor:E});for(let[E,w]of u.peerDependenciesMeta)for(let[D,b]of Object.entries(w))p.push({...h,type:"PeerDependencyMeta",selector:E,key:D,value:b})};await this.triggerHook(o=>o.registerPackageExtensions,this,r);for(let[o,a]of this.get("packageExtensions"))r(lh(o,!0),LS(a),{userProvided:!0});return e}normalizeLocator(e){return Fa(e.reference)?Ss(e,`${this.get("defaultProtocol")}${e.reference}`):by.test(e.reference)?Ss(e,`${this.get("defaultProtocol")}${e.reference}`):e}normalizeDependency(e){return Fa(e.range)?kn(e,`${this.get("defaultProtocol")}${e.range}`):by.test(e.range)?kn(e,`${this.get("defaultProtocol")}${e.range}`):e}normalizeDependencyMap(e){return new Map([...e].map(([r,o])=>[r,this.normalizeDependency(o)]))}normalizePackage(e,{packageExtensions:r}){let o=E1(e),a=r.get(e.identHash);if(typeof a<"u"){let u=e.version;if(u!==null){for(let[A,p]of a)if(nA(u,A))for(let h of p)switch(h.status==="inactive"&&(h.status="redundant"),h.type){case"Dependency":typeof o.dependencies.get(h.descriptor.identHash)>"u"&&(h.status="active",o.dependencies.set(h.descriptor.identHash,this.normalizeDependency(h.descriptor)));break;case"PeerDependency":typeof o.peerDependencies.get(h.descriptor.identHash)>"u"&&(h.status="active",o.peerDependencies.set(h.descriptor.identHash,h.descriptor));break;case"PeerDependencyMeta":{let E=o.peerDependenciesMeta.get(h.selector);(typeof E>"u"||!Object.hasOwn(E,h.key)||E[h.key]!==h.value)&&(h.status="active",Al(o.peerDependenciesMeta,h.selector,()=>({}))[h.key]=h.value)}break;default:tO(h)}}}let n=u=>u.scope?`${u.scope}__${u.name}`:`${u.name}`;for(let u of o.peerDependenciesMeta.keys()){let A=Zo(u);o.peerDependencies.has(A.identHash)||o.peerDependencies.set(A.identHash,kn(A,"*"))}for(let u of o.peerDependencies.values()){if(u.scope==="types")continue;let A=n(u),p=rA("types",A),h=rn(p);o.peerDependencies.has(p.identHash)||o.peerDependenciesMeta.has(h)||(o.peerDependencies.set(p.identHash,kn(p,"*")),o.peerDependenciesMeta.set(h,{optional:!0}))}return o.dependencies=new Map(Ps(o.dependencies,([,u])=>ka(u))),o.peerDependencies=new Map(Ps(o.peerDependencies,([,u])=>ka(u))),o}getLimit(e){return Al(this.limits,e,()=>(0,mce.default)(this.get(e)))}async triggerHook(e,...r){for(let o of this.plugins.values()){let a=o.hooks;if(!a)continue;let n=e(a);n&&await n(...r)}}async triggerMultipleHooks(e,r){for(let o of r)await this.triggerHook(e,...o)}async reduceHook(e,r,...o){let a=r;for(let n of this.plugins.values()){let u=n.hooks;if(!u)continue;let A=e(u);A&&(a=await A(a,...o))}return a}async firstHook(e,...r){for(let o of this.plugins.values()){let a=o.hooks;if(!a)continue;let n=e(a);if(!n)continue;let u=await n(...r);if(typeof u<"u")return u}return null}}});var Hr={};Kt(Hr,{EndStrategy:()=>RU,ExecError:()=>lb,PipeError:()=>Y1,execvp:()=>BU,pipevp:()=>Xc});function kg(t){return t!==null&&typeof t.fd=="number"}function kU(){}function QU(){for(let t of Qg)t.kill()}async function Xc(t,e,{cwd:r,env:o=process.env,strict:a=!1,stdin:n=null,stdout:u,stderr:A,end:p=2}){let h=["pipe","pipe","pipe"];n===null?h[0]="ignore":kg(n)&&(h[0]=n),kg(u)&&(h[1]=u),kg(A)&&(h[2]=A);let E=(0,FU.default)(t,e,{cwd:Ae.fromPortablePath(r),env:{...o,PWD:Ae.fromPortablePath(r)},stdio:h});Qg.add(E),Qg.size===1&&(process.on("SIGINT",kU),process.on("SIGTERM",QU)),!kg(n)&&n!==null&&n.pipe(E.stdin),kg(u)||E.stdout.pipe(u,{end:!1}),kg(A)||E.stderr.pipe(A,{end:!1});let w=()=>{for(let D of new Set([u,A]))kg(D)||D.end()};return new Promise((D,b)=>{E.on("error",C=>{Qg.delete(E),Qg.size===0&&(process.off("SIGINT",kU),process.off("SIGTERM",QU)),(p===2||p===1)&&w(),b(C)}),E.on("close",(C,T)=>{Qg.delete(E),Qg.size===0&&(process.off("SIGINT",kU),process.off("SIGTERM",QU)),(p===2||p===1&&C!==0)&&w(),C===0||!a?D({code:TU(C,T)}):b(new Y1({fileName:t,code:C,signal:T}))})})}async function BU(t,e,{cwd:r,env:o=process.env,encoding:a="utf8",strict:n=!1}){let u=["ignore","pipe","pipe"],A=[],p=[],h=Ae.fromPortablePath(r);typeof o.PWD<"u"&&(o={...o,PWD:h});let E=(0,FU.default)(t,e,{cwd:h,env:o,stdio:u});return E.stdout.on("data",w=>{A.push(w)}),E.stderr.on("data",w=>{p.push(w)}),await new Promise((w,D)=>{E.on("error",b=>{let C=Je.create(r),T=Ut(C,t,Ct.PATH);D(new zt(1,`Process ${T} failed to spawn`,N=>{N.reportError(1,` ${$u(C,{label:"Thrown Error",value:Yc(Ct.NO_HINT,b.message)})}`)}))}),E.on("close",(b,C)=>{let T=a==="buffer"?Buffer.concat(A):Buffer.concat(A).toString(a),N=a==="buffer"?Buffer.concat(p):Buffer.concat(p).toString(a);b===0||!n?w({code:TU(b,C),stdout:T,stderr:N}):D(new lb({fileName:t,code:b,signal:C,stdout:T,stderr:N}))})})}function TU(t,e){let r=Zst.get(e);return typeof r<"u"?128+r:t??1}function $st(t,e,{configuration:r,report:o}){o.reportError(1,` ${$u(r,t!==null?{label:"Exit Code",value:Yc(Ct.NUMBER,t)}:{label:"Exit Signal",value:Yc(Ct.CODE,e)})}`)}var FU,RU,Y1,lb,Qg,Zst,nb=It(()=>{Pt();FU=et(MT());W1();Vl();Wl();RU=(o=>(o[o.Never=0]="Never",o[o.ErrorCode=1]="ErrorCode",o[o.Always=2]="Always",o))(RU||{}),Y1=class extends zt{constructor({fileName:e,code:r,signal:o}){let a=Je.create(K.cwd()),n=Ut(a,e,Ct.PATH);super(1,`Child ${n} reported an error`,u=>{$st(r,o,{configuration:a,report:u})}),this.code=TU(r,o)}},lb=class extends Y1{constructor({fileName:e,code:r,signal:o,stdout:a,stderr:n}){super({fileName:e,code:r,signal:o}),this.stdout=a,this.stderr=n}};Qg=new Set;Zst=new Map([["SIGINT",2],["SIGQUIT",3],["SIGKILL",9],["SIGTERM",15]])});function Cce(t){Ece=t}function K1(){return typeof LU>"u"&&(LU=Ece()),LU}var LU,Ece,NU=It(()=>{Ece=()=>{throw new Error("Assertion failed: No libzip instance is available, and no factory was configured")}});var Ice=_((ub,MU)=>{var eot=Object.assign({},ve("fs")),OU=function(){var t=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename<"u"&&(t=t||__filename),function(e){e=e||{};var r=typeof e<"u"?e:{},o,a;r.ready=new Promise(function(ze,it){o=ze,a=it});var n={},u;for(u in r)r.hasOwnProperty(u)&&(n[u]=r[u]);var A=[],p="./this.program",h=function(ze,it){throw it},E=!1,w=!0,D="";function b(ze){return r.locateFile?r.locateFile(ze,D):D+ze}var C,T,N,U;w&&(E?D=ve("path").dirname(D)+"/":D=__dirname+"/",C=function(it,vt){var ar=ia(it);return ar?vt?ar:ar.toString():(N||(N=eot),U||(U=ve("path")),it=U.normalize(it),N.readFileSync(it,vt?null:"utf8"))},T=function(it){var vt=C(it,!0);return vt.buffer||(vt=new Uint8Array(vt)),me(vt.buffer),vt},process.argv.length>1&&(p=process.argv[1].replace(/\\/g,"/")),A=process.argv.slice(2),h=function(ze){process.exit(ze)},r.inspect=function(){return"[Emscripten Module object]"});var z=r.print||console.log.bind(console),te=r.printErr||console.warn.bind(console);for(u in n)n.hasOwnProperty(u)&&(r[u]=n[u]);n=null,r.arguments&&(A=r.arguments),r.thisProgram&&(p=r.thisProgram),r.quit&&(h=r.quit);var le=0,ce=function(ze){le=ze},ue;r.wasmBinary&&(ue=r.wasmBinary);var Ie=r.noExitRuntime||!0;typeof WebAssembly!="object"&&Hi("no native wasm support detected");function he(ze,it,vt){switch(it=it||"i8",it.charAt(it.length-1)==="*"&&(it="i32"),it){case"i1":return Ve[ze>>0];case"i8":return Ve[ze>>0];case"i16":return ap((ze>>1)*2);case"i32":return Rs((ze>>2)*4);case"i64":return Rs((ze>>2)*4);case"float":return gu((ze>>2)*4);case"double":return op((ze>>3)*8);default:Hi("invalid type for getValue: "+it)}return null}var De,Ee=!1,g;function me(ze,it){ze||Hi("Assertion failed: "+it)}function Ce(ze){var it=r["_"+ze];return me(it,"Cannot call unknown function "+ze+", make sure it is exported"),it}function fe(ze,it,vt,ar,ee){var ye={string:function(Qi){var Pn=0;if(Qi!=null&&Qi!==0){var fa=(Qi.length<<2)+1;Pn=pi(fa),ht(Qi,Pn,fa)}return Pn},array:function(Qi){var Pn=pi(Qi.length);return Le(Qi,Pn),Pn}};function Ne(Qi){return it==="string"?Pe(Qi):it==="boolean"?!!Qi:Qi}var gt=Ce(ze),mt=[],Dt=0;if(ar)for(var er=0;er=vt)&&xe[ar];)++ar;return Z.decode(xe.subarray(ze,ar))}function Re(ze,it,vt,ar){if(!(ar>0))return 0;for(var ee=vt,ye=vt+ar-1,Ne=0;Ne=55296&><=57343){var mt=ze.charCodeAt(++Ne);gt=65536+((gt&1023)<<10)|mt&1023}if(gt<=127){if(vt>=ye)break;it[vt++]=gt}else if(gt<=2047){if(vt+1>=ye)break;it[vt++]=192|gt>>6,it[vt++]=128|gt&63}else if(gt<=65535){if(vt+2>=ye)break;it[vt++]=224|gt>>12,it[vt++]=128|gt>>6&63,it[vt++]=128|gt&63}else{if(vt+3>=ye)break;it[vt++]=240|gt>>18,it[vt++]=128|gt>>12&63,it[vt++]=128|gt>>6&63,it[vt++]=128|gt&63}}return it[vt]=0,vt-ee}function ht(ze,it,vt){return Re(ze,xe,it,vt)}function q(ze){for(var it=0,vt=0;vt=55296&&ar<=57343&&(ar=65536+((ar&1023)<<10)|ze.charCodeAt(++vt)&1023),ar<=127?++it:ar<=2047?it+=2:ar<=65535?it+=3:it+=4}return it}function nt(ze){var it=q(ze)+1,vt=aa(it);return vt&&Re(ze,Ve,vt,it),vt}function Le(ze,it){Ve.set(ze,it)}function Te(ze,it){return ze%it>0&&(ze+=it-ze%it),ze}var ke,Ve,xe,tt,He,x,I,S,y,R;function J(ze){ke=ze,r.HEAP_DATA_VIEW=R=new DataView(ze),r.HEAP8=Ve=new Int8Array(ze),r.HEAP16=tt=new Int16Array(ze),r.HEAP32=x=new Int32Array(ze),r.HEAPU8=xe=new Uint8Array(ze),r.HEAPU16=He=new Uint16Array(ze),r.HEAPU32=I=new Uint32Array(ze),r.HEAPF32=S=new Float32Array(ze),r.HEAPF64=y=new Float64Array(ze)}var X=r.INITIAL_MEMORY||16777216,$,se=[],be=[],Fe=[],lt=!1;function Et(){if(r.preRun)for(typeof r.preRun=="function"&&(r.preRun=[r.preRun]);r.preRun.length;)St(r.preRun.shift());hs(se)}function qt(){lt=!0,hs(be)}function nr(){if(r.postRun)for(typeof r.postRun=="function"&&(r.postRun=[r.postRun]);r.postRun.length;)Pr(r.postRun.shift());hs(Fe)}function St(ze){se.unshift(ze)}function cn(ze){be.unshift(ze)}function Pr(ze){Fe.unshift(ze)}var yr=0,Rr=null,Xr=null;function $n(ze){yr++,r.monitorRunDependencies&&r.monitorRunDependencies(yr)}function Xs(ze){if(yr--,r.monitorRunDependencies&&r.monitorRunDependencies(yr),yr==0&&(Rr!==null&&(clearInterval(Rr),Rr=null),Xr)){var it=Xr;Xr=null,it()}}r.preloadedImages={},r.preloadedAudios={};function Hi(ze){r.onAbort&&r.onAbort(ze),ze+="",te(ze),Ee=!0,g=1,ze="abort("+ze+"). Build with -s ASSERTIONS=1 for more info.";var it=new WebAssembly.RuntimeError(ze);throw a(it),it}var Qs="data:application/octet-stream;base64,";function Zs(ze){return ze.startsWith(Qs)}var bi="data:application/octet-stream;base64,AGFzbQEAAAAB/wEkYAN/f38Bf2ABfwF/YAJ/fwF/YAF/AGAEf39/fwF/YAN/f38AYAV/f39/fwF/YAJ/fwBgBH9/f38AYAABf2AFf39/fn8BfmAEf35/fw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BQRgQCSIEDQIgBRAGDAELIAIhBUEYEAkiBA0BCyADBEAgA0EANgIEIANBDjYCAAtBAA8LIARCADcDECAEIAE3AwggBCAFNgIEIARBAToAACAEIAJFOgABIAAgBSABIAMQZUEASAR/IAQtAAEEQCAEKAIEEAYLIAQQBkEABSAECwubAgEDfyAALQAAQSBxRQRAAkAgASEDAkAgAiAAIgEoAhAiAAR/IAAFAn8gASABLQBKIgBBAWsgAHI6AEogASgCACIAQQhxBEAgASAAQSByNgIAQX8MAQsgAUIANwIEIAEgASgCLCIANgIcIAEgADYCFCABIAAgASgCMGo2AhBBAAsNASABKAIQCyABKAIUIgVrSwRAIAEgAyACIAEoAiQRAAAaDAILAn8gASwAS0F/SgRAIAIhAANAIAIgACIERQ0CGiADIARBAWsiAGotAABBCkcNAAsgASADIAQgASgCJBEAACAESQ0CIAMgBGohAyABKAIUIQUgAiAEawwBCyACCyEAIAUgAyAAEAcaIAEgASgCFCAAajYCFAsLCwvNBQEGfyAAKAIwIgNBhgJrIQYgACgCPCECIAMhAQNAIAAoAkQgAiAAKAJoIgRqayECIAEgBmogBE0EQCAAKAJIIgEgASADaiADEAcaAkAgAyAAKAJsIgFNBEAgACABIANrNgJsDAELIABCADcCbAsgACAAKAJoIANrIgE2AmggACAAKAJYIANrNgJYIAEgACgChC5JBEAgACABNgKELgsgAEH8gAEoAgARAwAgAiADaiECCwJAIAAoAgAiASgCBCIERQ0AIAAoAjwhBSAAIAIgBCACIARJGyICBH8gACgCSCAAKAJoaiAFaiEFIAEgBCACazYCBAJAAkACQAJAIAEoAhwiBCgCFEEBaw4CAQACCyAEQaABaiAFIAEoAgAgAkHcgAEoAgARCAAMAgsgASABKAIwIAUgASgCACACQcSAASgCABEEADYCMAwBCyAFIAEoAgAgAhAHGgsgASABKAIAIAJqNgIAIAEgASgCCCACajYCCCAAKAI8BSAFCyACaiICNgI8AkAgACgChC4iASACakEDSQ0AIAAoAmggAWshAQJAIAAoAnRBgQhPBEAgACAAIAAoAkggAW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BB9eABIAEoAjAgAEEIahBpIgVFDQILIAJBgAJxBEAgBSEDDAELIARBAkcEQCAFIQMMAQtB9cYBIAEoAjggAEEIahBpIgNFBEAgBRAcDAILIAMgBTYCAAsgASABLwEMQf7/A3EgAS8BUiIFQQBHcjsBDAJAAkACQAJAAn8CQAJAIAEpAyhC/v///w9WDQAgASkDIEL+////D1YNACACQYAEcUUNASABKQNIQv////8PVA0BCyAFQYECa0H//wNxQQNJIQdBAQwBCyAFQYECa0H//wNxIQQgAkGACnFBgApHDQEgBEEDSSEHQQALIQkgBkIcEBciBEUEQCAAQQhqIgAEQCAAQQA2AgQgAEEONgIACyADEBwMBQsgAkGACHEhBQJAAkAgAkGAAnEEQAJAIAUNACABKQMgQv////8PVg0AIAEpAyhCgICAgBBUDQMLIAQgASkDKBAYIAEpAyAhDAwBCwJAAkACQCAFDQAgASkDIEL/////D1YNACABKQMoIgxC/////w9WDQEgASkDSEKAgICAEFQNBAsgASkDKCIMQv////8PVA0BCyAEIAwQGAsgASkDICIMQv////8PWgRAIAQgDBAYCyABKQNIIgxC/////w9UDQELIAQgDBAYCyAELQAARQRAIABBCGoiAARAIABBADYCBCAAQRQ2AgALIAQQCCADEBwMBQtBASEKQQEgBC0AAAR+IAQpAxAFQgALp0H//wNxIAYQRyEFIAQQCCAFIAM2AgAgBw0BDAILIAMhBSAEQQJLDQELIAZCBxAXIgRFBEAgAEEIaiIABEAgAEEANgIEIABBDjYCAAsgBRAcDAMLIARBAhANIARBhxJBAhAsIAQgAS0AUhBwIAQgAS8BEBANIAQtAABFBEAgAEEIaiIABEAgAEEANgIEIABBFDYCAAsgBBAIDAILQYGyAkEHIAYQRyEDIAQQCCADIAU2AgBBASELIAMhBQsgBkIuEBciA0UEQCAAQQhqIgAEQCAAQQA2AgQgAEEONgIACyAFEBwMAgsgA0GjEkGoEiACQYACcSIHG0EEECwgB0UEQCADIAkEf0EtBSABLwEIC0H//wNxEA0LIAMgCQR/QS0FIAEvAQoLQf//A3EQDSADI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0AGiAArUIChiICpyIBIABBBHJBgIAESQ0AGkF/IAEgAkIgiKcbCyIBEAkiAEUNACAAQQRrLQAAQQNxRQ0AIABBACABEBkLIAALQwEDfwJAIAJFDQADQCAALQAAIgQgAS0AACIFRgRAIAFBAWohASAAQQFqIQAgAkEBayICDQEMAgsLIAQgBWshAwsgAwsUACAAEEAgACgCABAgIAAoAgQQIAutBAIBfgV/IwBBEGsiBCQAIAAgAWshBgJAAkAgAUEBRgRAIAAgBi0AACACEBkMAQsgAUEJTwRAIAAgBikAADcAACAAIAJBAWtBB3FBAWoiBWohACACIAVrIgFFDQIgBSAGaiECA0AgACACKQAANwAAIAJBCGohAiAAQQhqIQAgAUEIayIBDQALDAILAkACQAJAAkAgAUEEaw4FAAICAgECCyAEIAYoAAAiATYCBCAEIAE2AgAMAgsgBCAGKQAANwMADAELQQghByAEQQhqIQgDQCAIIAYgByABIAEgB0sbIgUQByAFaiEIIAcgBWsiBw0ACyAEIAQpAwg3AwALAkAgBQ0AIAJBEEkNACAEKQMAIQMgAkEQayIGQQR2QQFqQQdxIgEEQANAIAAgAzcACCAAIAM3AAAgAkEQayECIABBEGohACABQQFrIgENAAsLIAZB8ABJDQADQCAAIAM3AHggACADNwBwIAAgAzcAaCAAIAM3AGAgACADNwBYIAAgAzcAUCAAIAM3AEggACADNwBAIAAgAzcAOCAAIAM3ADAgACADNwAoIAAgAzcAICAAIAM3ABggACADNwAQIAAgAzcACCAAIAM3AAAgAEGAAWohACACQYABayICQQ9LDQALCyACQQhPBEBBCCAFayEBA0AgACAEKQMANwAAIAAgAWohACACIAFrIgJBB0sNAAsLIAJFDQEgACAEIAIQBxoLIAAgAmohAAsgBEEQaiQAIAALXwECfyAAKAIIIgEEQCABEAsgAEEANgIICwJAIAAoAgQiAUUNACABKAIAIgJBAXFFDQAgASgCEEF+Rw0AIAEgAkF+cSICNgIAIAINACABECAgAEEANgIECyAAQQA6AAwL1wICBH8BfgJAAkAgACgCQCABp0EEdGooAgAiA0UEQCAC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BUBEAgGyEaDAELIBsiGkIgfSIgQgWIQgF8QgODIh9QRQRAA0AgASACKQAANwAAIAEgAikAGDcAGCABIAIpABA3ABAgASACKQAINwAIIBpCIH0hGiACQSBqIQIgAUEgaiEBIB9CAX0iH0IAUg0ACwsgIELgAFQNAANAIAEgAikAADcAACABIAIpABg3ABggASACKQAQNwAQIAEgAikACDcACCABIAIpADg3ADggASACKQAwNwAwIAEgAikAKDcAKCABIAIpACA3ACAgASACKQBYNwBYIAEgAikAUDcAUCABIAIpAEg3AEggASACKQBANwBAIAEgAikAYDcAYCABIAIpAGg3AGggASACKQBwNwBwIAEgAikAeDcAeCACQYABaiECIAFBgAFqIQEgGkKAAX0iGkIfVg0ACwsgGkIQWgRAIAEgAikAADcAACABIAIpAAg3AAggGkIQfSEaIAJBEGohAiABQRBqIQELIBpCCFoEQCABIAIpAAA3AAAgGkIIfSEaIAJBCGohAiABQQhqIQELIBpCBFoEQCABIAIoAAA2AAAgGkIEfSEaIAJBBGohAiABQQRqIQELIBpCAloEQCABIAIvAAA7AAAgGkICfSEaIAJBAmohAiABQQJqIQELIBwgG30hHCAaUEUEQCABIAItAAA6AAAgAkEBaiECIAFBAWohAQsgHEIAUg0ACwsgDiEGIAwhAwsgBSAGSwRAAkACQCABIANNIAEgDyABa6wiGiAGrSIbIBogG1QbIhqnIglqIgIgA0txDQAgAyAJaiABSyABIANPcQ0AIAEgAyAJEAcaDAELIAEgAyADIAFrIgEgAUEfdSIBaiABcyIBEAcgAWohAiAaIAGtIh59IhxQDQAgASADaiEBA0ACQCAcIB4gHCAeVBsiG0IgVARAIBshGgwBCyAbIhpCIH0iIEIFiEIBfEIDgyIfUEUEQANAIAIgASkAADcAACACIAEpABg3ABggAiABKQAQNwAQIAIgASkACDcACCAaQiB9IRogAUEgaiEBIAJBIGohAiAfQgF9Ih9CAFINAAsLICBC4ABUDQADQCACIAEpAAA3AAAgAiABKQAYNwAYIAIgASkAEDcAECACIAEpAAg3AAggAiABKQA4NwA4IAIgASkAMDcAMCACIAEpACg3ACggAiABKQAgNwAgIAIgASkAWDcAWCACIAEpAFA3AFAgAiABKQBINwBIIAIgASkAQDcAQCACIAEpAGA3AGAgAiABKQBoNwBoIAIgASkAcDcAcCACIAEpAHg3AHggAUGAAWohASACQYABaiECIBpCgAF9IhpCH1YNAAsLIBpCEFoEQCACIAEpAAA3AAAgAiABKQAINwAIIBpCEH0hGiACQRBqIQIgAUEQaiEBCyAaQghaBEAgAiABKQAANwAAIBpCCH0hGiACQQhqIQIgAUEIaiEBCyAaQgRaBEAgAiABKAAANgAAIBpCBH0hGiACQQRqIQIgAUEEaiEBCyAaQgJaBEAgAiABLwAAOwAAIBpCAn0hGiACQQJqIQIgAUECaiEBCyAcIBt9IRwgGlBFBEAgAiABLQAAOgAAIAJBAWohAiABQQFqIQELIBxCAFINAAsLIAUgBmshAUEAIARrIQUCQCAEQQdLBEAgBCEDDAELIAEgBE0EQCAEIQMMAQsgAiAEayEFA0ACQCACIAUpAAA3AAAgBEEBdCEDIAEgBGshASACIARqIQIgBEEDSw0AIAMhBCABIANLDQELC0EAIANrIQULIAIgBWohBAJAIAUgDyACa6wiGiABrSIbIBogG1QbIhqnIgFIIAVBf0pxDQAgBUEBSCABIARqIAJLcQ0AIAIgBCABEAcgAWohAgwDCyACIAQgAyADQR91IgFqIAFzIgEQByABaiECIBogAa0iHn0iHFANAiABIARqIQEDQAJAIBwgHiAcIB5UGyIbQiBUBEAgGyEaDAELIBsiGkIgfSIgQgWIQgF8QgODIh9QRQRAA0AgAiABKQAANwAAIAIgASkAGDcAGCACIAEpABA3ABAgAiABKQAINwAIIBpCIH0hGiABQSBqIQEgAkEgaiECIB9CAX0iH0IAUg0ACwsgIELgAFQNAANAIAIgASkAADcAACACIAEpABg3ABggAiABKQAQNwAQIAIgASkACDcACCACIAEpADg3ADggAiABKQAwNwAwIAIgASkAKDcAKCACIAEpACA3ACAgAiABKQBYNwBYIAIgASkAUDcAUCACIAEpAEg3AEggAiABKQBANwBAIAIgASkAYDcAYCACIAEpAGg3AGggAiABKQBwNwBwIAIgASkAeDcAeCABQYABaiEBIAJBgAFqIQIgGkKAAX0iGkIfVg0ACwsgGkIQWgRAIAIgASkAADcAACACIAEpAAg3AAggGkIQfSEaIAJBEGohAiABQRBqIQELIBpCCFoEQCACIAEpAAA3AAAgGkIIfSEaIAJBCGohAiABQQhqIQELIBpCBFoEQCACIAEoAAA2AAAgGkIEfSEaIAJBBGohAiABQQRqIQELIBpCAloEQCACIAEvAAA7AAAgGkICfSEaIAJBAmohAiABQQJqIQELIBwgG30hHCAaUEUEQCACIAEtAAA6AAAgAkEBaiECIAFBAWohAQsgHFBFDQALDAILAkAgASADTSABIA8gAWusIhogBa0iGyAaIBtUGyIapyIEaiICIANLcQ0AIAMgBGogAUsgASADT3ENACABIAMgBBAHGgwCCyABIAMgAyABayIBIAFBH3UiAWogAXMiARAHIAFqIQIgGiABrSIefSIcUA0BIAEgA2ohAQNAAkAgHCAeIBwgHlQbIhtCIFQEQCAbIRoMAQsgGyIaQiB9IiBCBYhCAXxCA4MiH1BFBEADQCACIAEpAAA3AAAgAiABKQAYNwAYIAIgASkAEDcAECACIAEpAAg3AAggGkIgfSEaIAFBIGohASACQSBqIQIgH0IBfSIfQgBSDQALCyAgQuAAVA0AA0AgAiABKQAANwAAIAIgASkAGDcAGCACIAEpABA3ABAgAiABKQAINwAIIAIgASkAODcAOCACIAEpADA3ADAgAiABKQAoNwAoIAIgASkAIDcAICACIAEpAFg3AFggAiABKQBQNwBQIAIgASkASDcASCACIAEpAEA3AEAgAiABKQBgNwBgIAIgASkAaDcAaCACIAEpAHA3AHAgAiABKQB4NwB4IAFBgAFqIQEgAkGAAWohAiAaQoABfSIaQh9WDQALCyAaQhBaBEAgAiABKQAANwAAIAIgASkACDcACCAaQhB9IRogAkEQaiECIAFBEGohAQsgGkIIWgRAIAIgASkAADcAACAaQgh9IRogAkEIaiECIAFBCGohAQsgGkIEWgRAIAIgASgAADYAACAaQgR9IRogAkEEaiECIAFBBGohAQsgGkICWgRAIAIgAS8AADsAACAaQgJ9IRogAkECaiECIAFBAmohAQsgHCAbfSEcIBpQRQRAIAIgAS0AADoAACACQQFqIQIgAUEBaiEBCyAcUEUNAAsMAQsCQAJAIBYEQAJAIAQgBUkEQCAHKAKYRyAESw0BCyABIARrIQMCQEEAIARrIgVBf0ogDyABa6wiGiAbIBogG1QbIhqnIgIgBUpxDQAgBUEBSCACIANqIAFLcQ0AIAEgAyACEAcgAmohAgwFCyABIAMgBCAEQR91IgFqIAFzIgEQByABaiECIBogAa0iHn0iHFANBCABIANqIQEDQAJAIBwgHiAcIB5UGyIbQiBUBEAgGyEaDAELIBsiGkIgfSIgQgWIQgF8QgODIh9QRQRAA0AgAiABKQAANwAAIAIgASkAGDcAGCACIAEpABA3ABAgAiABKQAINwAIIBpCIH0hGiABQSBqIQEgAkEgaiECIB9CAX0iH0IAUg0ACwsgIELgAFQNAANAIAIgASkAADcAACACIAEpABg3ABggAiABKQAQNwAQIAIgASkACDcACCACIAEpADg3ADggAiABKQAwNwAwIAIgASkAKDcAKCACIAEpACA3ACAgAiABKQBYNwBYIAIgASkAUDcAUCACIAEpAEg3AEggAiABKQBANwBAIAIgASkAYDcAYCACIAEpAGg3AGggAiABKQBwNwBwIAIgASkAeDcAeCABQYABaiEBIAJBgAFqIQIgGkKAAX0iGkIfVg0ACwsgGkIQWgRAIAIgASkAADcAACACIAEpAAg3AAggGkIQfSEaIAJBEGohAiABQRBqIQELIBpCCFoEQCACIAEpAAA3AAAgGkIIfSEaIAJBCGohAiABQQhqIQELIBpCBFoEQCACIAEoAAA2AAAgGkIEfSEaIAJBBGohAiABQQRqIQELIBpCAloEQCACIAEvAAA7AAAgGkICfSEaIAJBAmohAiABQQJqIQELIBwgG30hHCAaUEUEQCACIAEtAAA6AAAgAkEBaiECIAFBAWohAQsgHFBFDQALDAQLIBAgAWsiCUEBaiIGIAUgBSAGSxshAyABIARrIQIgAUEHcUUNAiADRQ0CIAEgAi0AADo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QYDLAGotAAAiBUECdCIIaiIKLwECaiEGIAozAQAgA62GIAuEIQsgBCAFQQRJBH8gBgUgByAIQYDSAGooAgBrrSAGrYYgC4QhCyAIQcDUAGooAgAgBmoLIgVqIgNBP00EQCALIASthiAMhCELDAELIARBwABGBEAgACgCBCAAKAIQaiAMNwAAIAAgACgCEEEIajYCECAFIQMMAQsgACgCBCAAKAIQaiALIASthiAMhDcAACAAIAAoAhBBCGo2AhAgA0FAaiEDIAtBwAAgBGutiCELCyAAIAs3A5guIAAgAzYCoC4gCSAAKALwLUkNAAsLIAFBgAhqMwEAIQwCQCADIAFBgghqLwEAIgJqIgFBP00EQCAMIAOthiALhCEMDAELIANBwABGBEAgACgCBCAAKAIQaiALNwAAIAAgACgCEEEIajYCECACIQEMAQsgACgCBCAAKAIQaiAMIAOthiALhDcAACAAIAAoAhBBCGo2AhAgAUFAaiEBIAxBwAAgA2utiCEMCyAAIAw3A5guIAAgATYCoC4L8AQBA38gAEHkAWohAgNAIAIgAUECdCIDakEAOwEAIAIgA0EEcmpBADsBACABQQJqIgFBngJHDQALIABBADsBzBUgAEEAOwHYEyAAQZQWakEAOwEAIABBkBZqQQA7AQAgAEGMFmpBADsBACAAQYgWakEAOwEAIABBhBZqQQA7AQAgAEGAFmpBADsBACAAQfwVakEAOwEAIABB+BVqQQA7AQAgAEH0FWpBADsBACAAQfAVakEAOwEAIABB7BVqQQA7AQAgAEHoFWpBADsBACAAQeQVakEAOwEAIABB4BVqQQA7AQAgAEHcFWpBADsBACAAQdgVakEAOwEAIABB1BVqQQA7AQAgAEHQFWpBADsBACAAQcwUakEAOwEAIABByBRqQQA7AQAgAEHEFGpBADsBACAAQcAUakEAOwEAIABBvBRqQQA7AQAgAEG4FGpBADsBACAAQbQUakEAOwEAIABBsBRqQQA7AQAgAEGsFGpBADsBACAAQagUakEAOwEAIABBpBRqQQA7AQAgAEGgFGpBADsBACAAQZwUakEAOwEAIABBmBRqQQA7AQAgAEGUFGpBADsBACAAQZAUakEA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QCADKAIcKAIsBEAgAygCDCADKAIQIgFBAmpJBH8gBRAKIAMoAhANAkEABSABCyADKAIEaiAFKAIwOwAAIAMgAygCEEECajYCECADQaABakHkgAEoAgARAQAaCyADQfEANgIgIAUQCiADKAIQRQ0BDAcLDAYLIAUoAgQNAQsgAygCPA0AIApFDQEgAygCIEGaBUYNAQsCfyADKAKIASIBRQRAIAMgChCFAQwBCwJAAkACQCADKAKMAUECaw4CAAECCwJ/AkADQAJAAkAgAygCPA0AIAMQLyADKAI8DQAgCg0BQQAMBAsgAygCSCADKAJoai0AACEEIAMgAygC8C0iAUEBajYC8C0gASADKALsLWpBADoAACADIAMoAvAtIgFBAWo2AvAtIAEgAygC7C1qQQA6AAAgAyADKALwLSIBQQFqNgLwLSABIAMoAuwtaiAEOgAAIAMgBEECdGoiASABLwHkAUEBajsB5AEgAyADKAI8QQFrNgI8IAMgAygCaEEBaiIBNgJoIAMoAvAtIAMoAvQtRw0BQQAhBCADIAMoAlgiBkEATgR/IAMoAkggBmoFQQALIAEgBmtBABAPIAMgAygCaDYCWCADKAIAEAogAygCACgCEA0BDAILCyADQQA2AoQuIApBBEYEQCADIAMoAlgiAUEATgR/IAMoAkggAWoFQQALIAMoAmggAWtBARAPIAMgAygCaDYCWCADKAIAEApBA0ECIAMoAgAoAhAbDAILIAMoAvAtBEBBACEEIAMgAygCWCIBQQBOBH8gAygCSCABagVBAAsgAygCaCABa0EAEA8gAyADKAJoNgJYIAMoAgAQCiADKAIAKAIQRQ0BC0EBIQQLIAQLDAILAn8CQANAAkACQAJAAkACQCADKAI8Ig1BggJLDQAgAxAvAkAgAygCPCINQYICSw0AIAoNAEEADAgLIA1FDQQgDUECSw0AIAMoAmghCAwBCyADKAJoIghFBEBBACEIDAELIAMoAkggCGoiAUEBayIELQAAIgYgAS0AAEcNACAGIAQtAAJHDQAgBEEDaiEEQQAhCQJAA0AgBiAELQAARw0BIAQtAAEgBkcEQCAJQQFyIQkMAgsgBC0AAiAGRwRAIAlBAnI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ayABIAVBAEHYgAEoAgARCAAMAQsgBiAGKAIcIAEgBUHAgAEoAgARAAAiATYCHCAMIAE2AjALIAMoAiwiDUUNASAQIA1rIQUgAygCOCEBIAwoAhwiBigCFARAIAZBQGsgASAFIA1B3IABKAIAEQgADAILIAYgBigCHCABIAUgDUHEgAEoAgARBAAiATYCHCAMIAE2AjAMAQsgDSAQIAZrIAYQBxoLIANBADYCNCADIAMoAiw2AjBBAAwECyAKIAYgAygCNCIFayIBIAEgCksbIQsgECAKayEGIAUgDWohBQJAIAkEQAJAIAtFDQAgDCgCHCIBKAIUBEAgAUFAayAFIAYgC0HcgAEoAgARCAAMAQsgASABKAIcIAUgBiALQcSAASgCABEEACIBNgIcIAwgATYCMAsgCiALayIFRQ0BIBAgBWshBiADKAI4IQEgDCgCHCINKAIUBEAgDUFAayABIAYgBUHcgAEoAgARCAAMBQsgDSANKAIcIAEgBiAFQcSAASgCABEEACIBNgIcIAwgATYCMAwECyAFIAYgCxAHGiAKIAtrIgUNAgtBACEIIANBACADKAI0IAtqIgUgBSADKAIsIgFGGzYCNCABIAMoAjAiAU0NACADIAEgC2o2AjALIAgMAgsgAygCOCAQIAVrIAUQBxoLIAMgBTYCNCADIAMoAiw2AjBBAAtFBEAgDCgCECEPIAwoAgQhFyAHKAKIAQwDCyAHQdL+ADYCBAtBfCEXDAILIAYhFyAFCyEFIAwgICAXayIBIAwoAghqNgIIIAwgFiAPayIGIAwoAhRqNgIUIAcgBygCICAGajYCICAMIAcoAghBAEdBBnQgBWogBygCBCIFQb/+AEZBB3RqQYACIAVBwv4ARkEIdCAFQcf+AEYbajYCLCAEIARBeyAEGyABIAZyGyEXCyAUQRBqJAAgFwshASACIAIpAwAgADUCIH03AwACQAJAAkACQCABQQVqDgcBAgICAgMAAgtBAQ8LIAAoAhQNAEEDDwsgACgCACIABEAgACABNgIEIABBDTYCAAtBAiEBCyABCwkAIABBAToADAtEAAJAIAJC/////w9YBEAgACgCFEUNAQsgACgCACIABEAgAEEANgIE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+IAIgASgCADYCACACIAEoAgQ2AgRCCAVCfwshBQwCCyABEAYMAQsgAQRAIAFBADYCBCABQRI2AgALQn8hBQsgBkHwAGokACAFC60DAgJ/An4jAEEQayIGJAACQAJAAkAgBEUNACABRQ0AIAJBAUYNAQtBACEDIABBCGoiAARAIABBADYCBCAAQRI2AgALDAELIANBAXEEQEEAIQMgAEEIaiIABEAgAEEANgIEIABBGDYCAAsMAQtBGBAJIgVFBEBBACEDIABBCGoiAARAIABBADYCBCAAQQ42AgALDAELIAVBADYCCCAFQgA3AgAgBUGQ8dmiAzYCFCAFQvis0ZGR8dmiIzcCDAJAIAQQIiICRQ0AIAKtIQhBACEDQYfTru5+IQJCASEHA0AgBiADIARqLQAAOgAPIAUgBkEPaiIDBH8gAiADQQFB1IABKAIAEQAABUEAC0F/cyICNgIMIAUgBSgCECACQf8BcWpBhYiiwABsQQFqIgI2AhAgBiACQRh2OgAPIAUCfyAFKAIUQX9zIQJBACAGQQ9qIgNFDQAaIAIgA0EBQdSAASgCABEAAAtBf3M2AhQgByAIUQ0BIAUoAgxBf3MhAiAHpyEDIAdCAXwhBwwACwALIAAgAUElIAUQQiIDDQAgBRAGQQAhAwsgBkEQaiQAIAMLnRoCBn4FfyMAQdAAayILJAACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADDhQFBhULAwQJDgACCBAKDw0HEQERDBELAkBByAAQCSIBBEAgAUIANwMAIAFCADcDMCABQQA2AiggAUIANwMgIAFCADcDGCABQgA3AxAgAUIANwMIIAFCADcDOCABQQgQCSIDNgIEIAMNASABEAYgAARAIABBADYCBCAAQQ42AgALCyAAQQA2AhQMFAsgA0IANwMAIAAgATYCFCABQUBrQgA3AwAgAUIANwM4DBQLAkACQCACUARAQcgAEAkiA0UNFCADQgA3AwAgA0IANwMwIANBADYCKCADQgA3AyAgA0IANwMYIANCADcDECADQgA3AwggA0IANwM4IANBCBAJIgE2AgQgAQ0BIAMQBiAABEAgAEEANg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85opu2G6anDHPe4rXW6t4PvpeNN5LzsY36i/Q0X7/IjjfLf0cVz0P9fbcGRNiDOv6w+bBTje2M6eWVyVBAofXqKNVCIwrRfpliqTsgx50Hmq/gVKKDhGgY6/wtoU7IERsmvKbSBLiaaGzA39HJ9ONroYFAQAAJ0HAAAsCQAAhgUAAEgFAACnBQAAAAQAADIFAAC8BQAALAkAQYDBAAv3CQwACACMAAgATAAIAMwACAAsAAgArAAIAGwACADsAAgAHAAIAJwACABcAAgA3AAIADwACAC8AAgAfAAIAPwACAACAAgAggAIAEIACADCAAgAIgAIAKIACABiAAgA4gAIABIACACSAAgAUgAIANIACAAyAAgAsgAIAHIACADyAAgACgAIAIoACABKAAgAygAIACoACACqAAgAagAIAOoACAAaAAgAmgAIAFoACADaAAgAOgAIALoACAB6AAgA+gAIAAYACACGAAgARgAIAMYACAAmAAgApgAIAGYACADmAAgAFgAIAJYACABWAAgA1gAIADYACAC2AAgAdgAIAPYACAAOAAgAjgAIAE4ACADOAAgALgAIAK4ACABuAAgA7gAIAB4ACACeAAgAXgAIAN4ACAA+AAgAvgAIAH4ACAD+AAgAAQAIAIEACABBAAgAwQAIACEACAChAAgAYQAIAOEACAARAAgAkQAIAFEACADRAAgAMQAIALEACABxAAgA8QAIAAkACACJAAgASQAIAMkACAApAAgAqQAIAGkACADpAAgAGQAIAJkACABZAAgA2QAIADkACAC5AAgAeQAIAPkACAAFAAgAhQAIAEUACADFAAgAJQAIAKUACABlAAgA5QAIABUACACVAAgAVQAIANUACAA1AAgAtQAIAHUACAD1AAgADQAIAI0ACABNAAgAzQAIAC0ACACtAAgAbQAIAO0ACAAdAAgAnQAIAF0ACADdAAgAPQAIAL0ACAB9AAgA/QAIABMACQATAQkAkwAJAJMBCQBTAAkAUwEJANMACQDTAQkAMwAJADMBCQCzAAkAswEJAHMACQBzAQkA8wAJAPMBCQALAAkACwEJAIsACQCLAQkASwAJAEsBCQDLAAkAywEJACsACQArAQkAqwAJAKsBCQBrAAkAawEJAOs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dG9jb2wAQWRkcmVzcyBub3QgYXZhaWxhYmxlAE5ldHdvcmsgaXMgZG93bgBOZXR3b3JrIHVucmVhY2hhYmxlAENvbm5lY3Rpb24gcmVzZXQgYnkgbmV0d29yawBDb25uZWN0aW9uIGFib3J0ZWQATm8gYnVmZmVyIHNwYWNlIGF2YWlsYWJsZQBTb2NrZXQgaXMgY29ubmVjdGVkAFNvY2tldCBub3QgY29ubmVjdGVkAENhbm5vdCBzZW5kIGFmdGVyIHNvY2tldCBzaHV0ZG93bgBPcGVyYXRpb24gYWxyZWFkeSBpbiBwcm9ncmVzcwBPcGVyYXRpb24gaW4gcHJvZ3Jlc3MAU3RhbGUgZmlsZSBoYW5kbGUAUmVtb3RlIEkvTyBlcnJvcgBRdW90YSBleGNlZWRlZABObyBtZWRpdW0gZm91bmQAV3JvbmcgbWVkaXVtIHR5cGUATm8gZXJyb3IgaW5mb3JtYXRpb24AQcCAAQuFARMAAAAUAAAAFQAAABYAAAAXAAAAGAAAABkAAAAaAAAAGwAAABwAAAAdAAAAHgAAAB8AAAAgAAAAIQAAACIAAAAjAAAAgERQADEAAAAyAAAAMwAAADQAAAA1AAAANgAAADcAAAA4AAAAOQAAADIAAAAzAAAANAAAADUAAAA2AAAANwAAADgAQfSCAQsCXEQAQbCDAQsQ/////////////////////w==";Zs(bi)||(bi=b(bi));function Fs(ze){try{if(ze==bi&&ue)return new Uint8Array(ue);var it=ia(ze);if(it)return it;if(T)return T(ze);throw"sync fetching of the wasm failed: you can preload it to Module['wasmBinary'] manually, or emcc.py will do that for you when generating HTML (but not JS)"}catch(vt){Hi(vt)}}function $s(ze,it){var vt,ar,ee;try{ee=Fs(ze),ar=new WebAssembly.Module(ee),vt=new WebAssembly.Instance(ar,it)}catch(Ne){var ye=Ne.toString();throw te("failed to compile wasm module: "+ye),(ye.includes("imported Memory")||ye.includes("memory import"))&&te("Memory size incompatibility issues may be due to changing INITIAL_MEMORY at runtime to something too large. Use ALLOW_MEMORY_GROWTH to allow any size memory (and also make sure not to set INITIAL_MEMORY at runtime to something smaller than it was at compile time)."),Ne}return[vt,ar]}function SA(){var ze={a:dc};function it(ee,ye){var Ne=ee.exports;r.asm=Ne,De=r.asm.g,J(De.buffer),$=r.asm.W,cn(r.asm.h),Xs("wasm-instantiate")}if($n("wasm-instantiate"),r.instantiateWasm)try{var vt=r.instantiateWasm(ze,it);return vt}catch(ee){return te("Module.instantiateWasm callback failed with error: "+ee),!1}var ar=$s(bi,ze);return it(ar[0]),r.asm}function gu(ze){return R.getFloat32(ze,!0)}function op(ze){return R.getFloat64(ze,!0)}function ap(ze){return R.getInt16(ze,!0)}function Rs(ze){return R.getInt32(ze,!0)}function Nn(ze,it){R.setInt32(ze,it,!0)}function hs(ze){for(;ze.length>0;){var it=ze.shift();if(typeof it=="function"){it(r);continue}var vt=it.func;typeof vt=="number"?it.arg===void 0?$.get(vt)():$.get(vt)(it.arg):vt(it.arg===void 0?null:it.arg)}}function Ts(ze,it){var vt=new Date(Rs((ze>>2)*4)*1e3);Nn((it>>2)*4,vt.getUTCSeconds()),Nn((it+4>>2)*4,vt.getUTCMinutes()),Nn((it+8>>2)*4,vt.getUTCHours()),Nn((it+12>>2)*4,vt.getUTCDate()),Nn((it+16>>2)*4,vt.getUTCMonth()),Nn((it+20>>2)*4,vt.getUTCFullYear()-1900),Nn((it+24>>2)*4,vt.getUTCDay()),Nn((it+36>>2)*4,0),Nn((it+32>>2)*4,0);var ar=Date.UTC(vt.getUTCFullYear(),0,1,0,0,0,0),ee=(vt.getTime()-ar)/(1e3*60*60*24)|0;return Nn((it+28>>2)*4,ee),Ts.GMTString||(Ts.GMTString=nt("GMT")),Nn((it+40>>2)*4,Ts.GMTString),it}function pc(ze,it){return Ts(ze,it)}function hc(ze,it,vt){xe.copyWithin(ze,it,it+vt)}function gc(ze){try{return De.grow(ze-ke.byteLength+65535>>>16),J(De.buffer),1}catch{}}function xA(ze){var it=xe.length;ze=ze>>>0;var vt=2147483648;if(ze>vt)return!1;for(var ar=1;ar<=4;ar*=2){var ee=it*(1+.2/ar);ee=Math.min(ee,ze+100663296);var ye=Math.min(vt,Te(Math.max(ze,ee),65536)),Ne=gc(ye);if(Ne)return!0}return!1}function bA(ze){ce(ze)}function Ro(ze){var it=Date.now()/1e3|0;return ze&&Nn((ze>>2)*4,it),it}function To(){if(To.called)return;To.called=!0;var ze=new Date().getFullYear(),it=new Date(ze,0,1),vt=new Date(ze,6,1),ar=it.getTimezoneOffset(),ee=vt.getTimezoneOffset(),ye=Math.max(ar,ee);Nn((ja()>>2)*4,ye*60),Nn((rs()>>2)*4,+(ar!=ee));function Ne(sn){var ei=sn.toTimeString().match(/\(([A-Za-z ]+)\)$/);return ei?ei[1]:"GMT"}var gt=Ne(it),mt=Ne(vt),Dt=nt(gt),er=nt(mt);ee>2)*4,Dt),Nn((Di()+4>>2)*4,er)):(Nn((Di()>>2)*4,er),Nn((Di()+4>>2)*4,Dt))}function kA(ze){To();var it=Date.UTC(Rs((ze+20>>2)*4)+1900,Rs((ze+16>>2)*4),Rs((ze+12>>2)*4),Rs((ze+8>>2)*4),Rs((ze+4>>2)*4),Rs((ze>>2)*4),0),vt=new Date(it);Nn((ze+24>>2)*4,vt.getUTCDay());var ar=Date.UTC(vt.getUTCFullYear(),0,1,0,0,0,0),ee=(vt.getTime()-ar)/(1e3*60*60*24)|0;return Nn((ze+28>>2)*4,ee),vt.getTime()/1e3|0}var pr=typeof atob=="function"?atob:function(ze){var it="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",vt="",ar,ee,ye,Ne,gt,mt,Dt,er=0;ze=ze.replace(/[^A-Za-z0-9\+\/\=]/g,"");do Ne=it.indexOf(ze.charAt(er++)),gt=it.indexOf(ze.charAt(er++)),mt=it.indexOf(ze.charAt(er++)),Dt=it.indexOf(ze.charAt(er++)),ar=Ne<<2|gt>>4,ee=(gt&15)<<4|mt>>2,ye=(mt&3)<<6|Dt,vt=vt+String.fromCharCode(ar),mt!==64&&(vt=vt+String.fromCharCode(ee)),Dt!==64&&(vt=vt+String.fromCharCode(ye));while(er0||(Et(),yr>0))return;function it(){Dn||(Dn=!0,r.calledRun=!0,!Ee&&(qt(),o(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),nr()))}r.setStatus?(r.setStatus("Running..."),setTimeout(function(){setTimeout(function(){r.setStatus("")},1),it()},1)):it()}if(r.run=Sl,r.preInit)for(typeof r.preInit=="function"&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();return Sl(),e}}();typeof ub=="object"&&typeof MU=="object"?MU.exports=OU:typeof define=="function"&&define.amd?define([],function(){return OU}):typeof ub=="object"&&(ub.createModule=OU)});var Lf,wce,Bce,vce=It(()=>{Lf=["number","number"],wce=(Z=>(Z[Z.ZIP_ER_OK=0]="ZIP_ER_OK",Z[Z.ZIP_ER_MULTIDISK=1]="ZIP_ER_MULTIDISK",Z[Z.ZIP_ER_RENAME=2]="ZIP_ER_RENAME",Z[Z.ZIP_ER_CLOSE=3]="ZIP_ER_CLOSE",Z[Z.ZIP_ER_SEEK=4]="ZIP_ER_SEEK",Z[Z.ZIP_ER_READ=5]="ZIP_ER_READ",Z[Z.ZIP_ER_WRITE=6]="ZIP_ER_WRITE",Z[Z.ZIP_ER_CRC=7]="ZIP_ER_CRC",Z[Z.ZIP_ER_ZIPCLOSED=8]="ZIP_ER_ZIPCLOSED",Z[Z.ZIP_ER_NOENT=9]="ZIP_ER_NOENT",Z[Z.ZIP_ER_EXISTS=10]="ZIP_ER_EXISTS",Z[Z.ZIP_ER_OPEN=11]="ZIP_ER_OPEN",Z[Z.ZIP_ER_TMPOPEN=12]="ZIP_ER_TMPOPEN",Z[Z.ZIP_ER_ZLIB=13]="ZIP_ER_ZLIB",Z[Z.ZIP_ER_MEMORY=14]="ZIP_ER_MEMORY",Z[Z.ZIP_ER_CHANGED=15]="ZIP_ER_CHANGED",Z[Z.ZIP_ER_COMPNOTSUPP=16]="ZIP_ER_COMPNOTSUP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FAT:14,ZIP_OPSYS_ALTERNATE_MVS:15,ZIP_OPSYS_BEOS:16,ZIP_OPSYS_TANDEM:17,ZIP_OPSYS_OS_400:18,ZIP_OPSYS_OS_X:19,ZIP_CM_DEFAULT:-1,ZIP_CM_STORE:0,ZIP_CM_DEFLATE:8,uint08S:t._malloc(1),uint32S:t._malloc(4),malloc:t._malloc,free:t._free,getValue:t.getValue,openFromSource:t.cwrap("zip_open_from_source","number",["number","number","number"]),close:t.cwrap("zip_close","number",["number"]),discard:t.cwrap("zip_discard",null,["number"]),getError:t.cwrap("zip_get_error","number",["number"]),getName:t.cwrap("zip_get_name","string",["number","number","number"]),getNumEntries:t.cwrap("zip_get_num_entries","number",["number","number"]),delete:t.cwrap("zip_delete","number",["number","number"]),statIndex:t.cwrap("zip_stat_index","number",["number",...Lf,"number","number"]),fopenIndex:t.cwrap("zip_fopen_index","number",["number",...Lf,"number"]),fread:t.cwrap("zip_fread","number",["number","number","number","number"]),fclose:t.cwrap("zip_fclose","number",["number"]),dir:{add:t.cwrap("zip_dir_add","number",["number","string"])},file:{add:t.cwrap("zip_file_add","number",["number","string","number","number"]),getError:t.cwrap("zip_file_get_error","number",["number"]),getExternalAttributes:t.cwrap("zip_file_get_external_attributes","number",["number",...Lf,"number","number","number"]),setExternalAttributes:t.cwrap("zip_file_set_external_attributes","number",["number",...Lf,"number","number","number"]),setMtime:t.cwrap("zip_file_set_mtime","number",["number",...Lf,"number","number"]),setCompression:t.cwrap("zip_set_file_compression","number",["number",...Lf,"number","number"])},ext:{countSymlinks:t.cwrap("zip_ext_count_symlinks","number",["number"])},error:{initWithCode:t.cwrap("zip_error_init_with_code",null,["number","number"]),strerror:t.cwrap("zip_error_strerror","string",["number"])},name:{locate:t.cwrap("zip_name_locate","number",["number","string","number"])},source:{fromUnattachedBuffer:t.cwrap("zip_source_buffer_create","number",["number",...Lf,"number","number"]),fromBuffer:t.cwrap("zip_source_buffer","number",["number","number",...Lf,"number"]),free:t.cwrap("zip_source_free",null,["number"]),keep:t.cwrap("zip_source_keep",null,["number"]),open:t.cwrap("zip_source_open","number",["number"]),close:t.cwrap("zip_source_close","number",["number"]),seek:t.cwrap("zip_source_seek","number",["number",...Lf,"number"]),tell:t.cwrap("zip_source_tell","number",["number"]),read:t.cwrap("zip_source_read","number",["number","number","number"]),error:t.cwrap("zip_source_error","number",["number"])},struct:{statS:t.cwrap("zipstruct_statS","number",[]),statSize:t.cwrap("zipstruct_stat_size","number",["number"]),statCompSize:t.cwrap("zipstruct_stat_comp_size","number",["number"]),statCompMethod:t.cwrap("zipstruct_stat_comp_method","number",["number"]),statMtime:t.cwrap("zipstruct_stat_mtime","number",["number"]),statCrc:t.cwrap("zipstruct_stat_crc","number",["number"]),errorS:t.cwrap("zipstruct_errorS","number",[]),errorCodeZip:t.cwrap("zipstruct_error_code_zip","number",["number"])}})});function UU(t,e){let r=t.indexOf(e);if(r<=0)return null;let o=r;for(;r>=0&&(o=r+e.length,t[o]!==K.sep);){if(t[r-1]===K.sep)return null;r=t.indexOf(e,o)}return t.length>o&&t[o]!==K.sep?null:t.slice(0,o)}var iA,Dce=It(()=>{Pt();Pt();sA();iA=class t extends Gp{static async openPromise(e,r){let o=new t(r);try{return await e(o)}finally{o.saveAndClose()}}constructor(e={}){let r=e.fileExtensions,o=e.readOnlyArchives,a=typeof r>"u"?A=>UU(A,".zip"):A=>{for(let p of r){let h=UU(A,p);if(h)return h}return null},n=(A,p)=>new Zi(p,{baseFs:A,readOnly:o,stats:A.statSync(p)}),u=async(A,p)=>{let h={baseFs:A,readOnly:o,stats:await A.statPromise(p)};return()=>new Zi(p,h)};super({...e,factorySync:n,factoryPromise:u,getMountPoint:a})}}});function tot(t){if(typeof t=="string"&&String(+t)===t)return+t;if(typeof t=="number"&&Number.isFinite(t))return t<0?Date.now()/1e3:t;if(Pce.types.isDate(t))return t.getTime()/1e3;throw new Error("Invalid time")}function Ab(){return Buffer.from([80,75,5,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])}var ta,_U,Pce,HU,Sce,fb,Zi,qU=It(()=>{Pt();Pt();Pt();Pt();Pt();Pt();ta=ve("fs"),_U=ve("stream"),Pce=ve("util"),HU=et(ve("zlib"));NU();Sce="mixed";fb=class extends Error{constructor(e,r){super(e),this.name="Libzip Error",this.code=r}},Zi=class extends qu{constructor(r,o={}){super();this.listings=new Map;this.entries=new Map;this.fileSources=new Map;this.fds=new Map;this.nextFd=0;this.ready=!1;this.readOnly=!1;let a=o;if(this.level=typeof a.level<"u"?a.level:Sce,r??=Ab(),typeof r=="string"){let{baseFs:A=new _n}=a;this.baseFs=A,this.path=r}else this.path=null,this.baseFs=null;if(o.stats)this.stats=o.stats;else if(typeof r=="string")try{this.stats=this.baseFs.statSync(r)}catch(A){if(A.code==="ENOENT"&&a.create)this.stats=wa.makeDefaultStats();else throw A}else this.stats=wa.makeDefaultStats();this.libzip=K1();let n=this.libzip.malloc(4);try{let A=0;o.readOnly&&(A|=this.libzip.ZIP_RDONLY,this.readOnly=!0),typeof r=="string"&&(r=a.create?Ab():this.baseFs.readFileSync(r));let p=this.allocateUnattachedSource(r);try{this.zip=this.libzip.openFromSource(p,A,n),this.lzSource=p}catch(h){throw this.libzip.source.free(p),h}if(this.zip===0){let h=this.libzip.struct.errorS();throw this.libzip.error.initWithCode(h,this.libzip.getValue(n,"i32")),this.makeLibzipError(h)}}finally{this.libzip.free(n)}this.listings.set(Bt.root,new Set);let u=this.libzip.getNumEntries(this.zip,0);for(let A=0;Ar)throw new Error("Overread");let n=Buffer.from(this.libzip.HEAPU8.subarray(o,o+r));return process.env.YARN_IS_TEST_ENV&&process.env.YARN_ZIP_DATA_EPILOGUE&&(n=Buffer.concat([n,Buffer.from(process.env.YARN_ZIP_DATA_EPILOGUE)])),n}finally{this.libzip.free(o)}}finally{this.libzip.source.close(this.lzSource),this.libzip.source.free(this.lzSource),this.ready=!1}}discardAndClose(){this.prepareClose(),this.libzip.discard(this.zip),this.ready=!1}saveAndClose(){if(!this.path||!this.baseFs)throw new Error("ZipFS cannot be saved and must be discarded when loaded from a buffer");if(this.readOnly){this.discardAndClose();return}let r=this.baseFs.existsSync(this.path)||this.stats.mode===wa.DEFAULT_MODE?void 0:this.stats.mode;this.baseFs.writeFileSync(this.path,this.getBufferAndClose(),{mode:r}),this.ready=!1}resolve(r){return K.resolve(Bt.root,r)}async openPromise(r,o,a){return this.openSync(r,o,a)}openSync(r,o,a){let n=this.nextFd++;return this.fds.set(n,{cursor:0,p:r}),n}hasOpenFileHandles(){return!!this.fds.size}async opendirPromise(r,o){return this.opendirSync(r,o)}opendirSync(r,o={}){let a=this.resolveFilename(`opendir '${r}'`,r);if(!this.entries.has(a)&&!this.listings.has(a))throw sr.ENOENT(`opendir '${r}'`);let n=this.listings.get(a);if(!n)throw sr.ENOTDIR(`opendir '${r}'`);let u=[...n],A=this.openSync(a,"r");return eP(this,a,u,{onClose:()=>{this.closeSync(A)}})}async readPromise(r,o,a,n,u){return this.readSync(r,o,a,n,u)}readSync(r,o,a=0,n=o.byteLength,u=-1){let A=this.fds.get(r);if(typeof A>"u")throw sr.EBADF("read");let p=u===-1||u===null?A.cursor:u,h=this.readFileSync(A.p);h.copy(o,a,p,p+n);let E=Math.max(0,Math.min(h.length-p,n));return(u===-1||u===null)&&(A.cursor+=E),E}async writePromise(r,o,a,n,u){return typeof o=="string"?this.writeSync(r,o,u):this.writeSync(r,o,a,n,u)}writeSync(r,o,a,n,u){throw typeof this.fds.get(r)>"u"?sr.EBADF("read"):new Error("Unimplemented")}async closePromise(r){return this.closeSync(r)}closeSync(r){if(typeof this.fds.get(r)>"u")throw sr.EBADF("read");this.fds.delete(r)}createReadStream(r,{encoding:o}={}){if(r===null)throw new Error("Unimplemented");let a=this.openSync(r,"r"),n=Object.assign(new _U.PassThrough({emitClose:!0,autoDestroy:!0,destroy:(A,p)=>{clearImmediate(u),this.closeSync(a),p(A)}}),{close(){n.destroy()},bytesRead:0,path:r,pending:!1}),u=setImmediate(async()=>{try{let A=await this.readFilePromise(r,o);n.bytesRead=A.length,n.end(A)}catch(A){n.destroy(A)}});return n}createWriteStream(r,{encoding:o}={}){if(this.readOnly)throw sr.EROFS(`open '${r}'`);if(r===null)throw new Error("Unimplemented");let a=[],n=this.openSync(r,"w"),u=Object.assign(new _U.PassThrough({autoDestroy:!0,emitClose:!0,destroy:(A,p)=>{try{A?p(A):(this.writeFileSync(r,Buffer.concat(a),o),p(null))}catch(h){p(h)}finally{this.closeSync(n)}}}),{close(){u.destroy()},bytesWritten:0,path:r,pending:!1});return u.on("data",A=>{let p=Buffer.from(A);u.bytesWritten+=p.length,a.push(p)}),u}async realpathPromise(r){return this.realpathSync(r)}realpathSync(r){let o=this.resolveFilename(`lstat '${r}'`,r);if(!this.entries.has(o)&&!this.listings.has(o))throw sr.ENOENT(`lstat '${r}'`);return o}async existsPromise(r){return this.existsSync(r)}existsSync(r){if(!this.ready)throw sr.EBUSY(`archive closed, existsSync '${r}'`);if(this.symlinkCount===0){let a=K.resolve(Bt.root,r);return this.entries.has(a)||this.listings.has(a)}let o;try{o=this.resolveFilename(`stat '${r}'`,r,void 0,!1)}catch{return!1}return o===void 0?!1:this.entries.has(o)||this.listings.has(o)}async accessPromise(r,o){return this.accessSync(r,o)}accessSync(r,o=ta.constants.F_OK){let a=this.resolveFilename(`access '${r}'`,r);if(!this.entries.has(a)&&!this.listings.has(a))throw sr.ENOENT(`access '${r}'`);if(this.readOnly&&o&ta.constants.W_OK)throw sr.EROFS(`access '${r}'`)}async statPromise(r,o={bigint:!1}){return o.bigint?this.statSync(r,{bigint:!0}):this.statSync(r)}statSync(r,o={bigint:!1,throwIfNoEntry:!0}){let a=this.resolveFilename(`stat '${r}'`,r,void 0,o.throwIfNoEntry);if(a!==void 0){if(!this.entries.has(a)&&!this.listings.has(a)){if(o.throwIfNoEntry===!1)return;throw sr.ENOENT(`stat '${r}'`)}if(r[r.length-1]==="/"&&!this.listings.has(a))throw sr.ENOTDIR(`stat '${r}'`);return this.statImpl(`stat '${r}'`,a,o)}}async fstatPromise(r,o){return this.fstatSync(r,o)}fstatSync(r,o){let a=this.fds.get(r);if(typeof a>"u")throw sr.EBADF("fstatSync");let{p:n}=a,u=this.resolveFilename(`stat '${n}'`,n);if(!this.entries.has(u)&&!this.listings.has(u))throw sr.ENOENT(`stat '${n}'`);if(n[n.length-1]==="/"&&!this.listings.has(u))throw sr.ENOTDIR(`stat '${n}'`);return this.statImpl(`fstat '${n}'`,u,o)}async lstatPromise(r,o={bigint:!1}){return o.bigint?this.lstatSync(r,{bigint:!0}):this.lstatSync(r)}lstatSync(r,o={bigint:!1,throwIfNoEntry:!0}){let a=this.resolveFilename(`lstat '${r}'`,r,!1,o.throwIfNoEntry);if(a!==void 0){if(!this.entries.has(a)&&!this.listings.has(a)){if(o.throwIfNoEntry===!1)return;throw sr.ENOENT(`lstat '${r}'`)}if(r[r.length-1]==="/"&&!this.listings.has(a))throw sr.ENOTDIR(`lstat '${r}'`);return this.statImpl(`lstat '${r}'`,a,o)}}statImpl(r,o,a={}){let n=this.entries.get(o);if(typeof n<"u"){let u=this.libzip.struct.statS();if(this.libzip.statIndex(this.zip,n,0,0,u)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip));let p=this.stats.uid,h=this.stats.gid,E=this.libzip.struct.statSize(u)>>>0,w=512,D=Math.ceil(E/w),b=(this.libzip.struct.statMtime(u)>>>0)*1e3,C=b,T=b,N=b,U=new Date(C),z=new Date(T),te=new Date(N),le=new Date(b),ce=this.listings.has(o)?ta.constants.S_IFDIR:this.isSymbolicLink(n)?ta.constants.S_IFLNK:ta.constants.S_IFREG,ue=ce===ta.constants.S_IFDIR?493:420,Ie=ce|this.getUnixMode(n,ue)&511,he=this.libzip.struct.statCrc(u),De=Object.assign(new wa.StatEntry,{uid:p,gid:h,size:E,blksize:w,blocks:D,atime:U,birthtime:z,ctime:te,mtime:le,atimeMs:C,birthtimeMs:T,ctimeMs:N,mtimeMs:b,mode:Ie,crc:he});return a.bigint===!0?wa.convertToBigIntStats(De):De}if(this.listings.has(o)){let u=this.stats.uid,A=this.stats.gid,p=0,h=512,E=0,w=this.stats.mtimeMs,D=this.stats.mtimeMs,b=this.stats.mtimeMs,C=this.stats.mtimeMs,T=new Date(w),N=new Date(D),U=new Date(b),z=new Date(C),te=ta.constants.S_IFDIR|493,ce=Object.assign(new wa.StatEntry,{uid:u,gid:A,size:p,blksize:h,blocks:E,atime:T,birthtime:N,ctime:U,mtime:z,atimeMs:w,birthtimeMs:D,ctimeMs:b,mtimeMs:C,mode:te,crc:0});return a.bigint===!0?wa.convertToBigIntStats(ce):ce}throw new Error("Unreachable")}getUnixMode(r,o){if(this.libzip.file.getExternalAttributes(this.zip,r,0,0,this.libzip.uint08S,this.libzip.uint32S)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip));return this.libzip.getValue(this.libzip.uint08S,"i8")>>>0!==this.libzip.ZIP_OPSYS_UNIX?o:this.libzip.getValue(this.libzip.uint32S,"i32")>>>16}registerListing(r){let o=this.listings.get(r);if(o)return o;this.registerListing(K.dirname(r)).add(K.basename(r));let n=new Set;return this.listings.set(r,n),n}registerEntry(r,o){this.registerListing(K.dirname(r)).add(K.basename(r)),this.entries.set(r,o)}unregisterListing(r){this.listings.delete(r),this.listings.get(K.dirname(r))?.delete(K.basename(r))}unregisterEntry(r){this.unregisterListing(r);let o=this.entries.get(r);this.entries.delete(r),!(typeof o>"u")&&(this.fileSources.delete(o),this.isSymbolicLink(o)&&this.symlinkCount--)}deleteEntry(r,o){if(this.unregisterEntry(r),this.libzip.delete(this.zip,o)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip))}resolveFilename(r,o,a=!0,n=!0){if(!this.ready)throw sr.EBUSY(`archive closed, ${r}`);let u=K.resolve(Bt.root,o);if(u==="/")return Bt.root;let A=this.entries.get(u);if(a&&A!==void 0)if(this.symlinkCount!==0&&this.isSymbolicLink(A)){let p=this.getFileSource(A).toString();return this.resolveFilename(r,K.resolve(K.dirname(u),p),!0,n)}else return u;for(;;){let p=this.resolveFilename(r,K.dirname(u),!0,n);if(p===void 0)return p;let h=this.listings.has(p),E=this.entries.has(p);if(!h&&!E){if(n===!1)return;throw sr.ENOENT(r)}if(!h)throw sr.ENOTDIR(r);if(u=K.resolve(p,K.basename(u)),!a||this.symlinkCount===0)break;let w=this.libzip.name.locate(this.zip,u.slice(1),0);if(w===-1)break;if(this.isSymbolicLink(w)){let D=this.getFileSource(w).toString();u=K.resolve(K.dirname(u),D)}else break}return u}allocateBuffer(r){Buffer.isBuffer(r)||(r=Buffer.from(r));let o=this.libzip.malloc(r.byteLength);if(!o)throw new Error("Couldn't allocate enough memory");return new Uint8Array(this.libzip.HEAPU8.buffer,o,r.byteLength).set(r),{buffer:o,byteLength:r.byteLength}}allocateUnattachedSource(r){let o=this.libzip.struct.errorS(),{buffer:a,byteLength:n}=this.allocateBuffer(r),u=this.libzip.source.fromUnattachedBuffer(a,n,0,1,o);if(u===0)throw this.libzip.free(o),this.makeLibzipError(o);return u}allocateSource(r){let{buffer:o,byteLength:a}=this.allocateBuffer(r),n=this.libzip.source.fromBuffer(this.zip,o,a,0,1);if(n===0)throw this.libzip.free(o),this.makeLibzipError(this.libzip.getError(this.zip));return n}setFileSource(r,o){let a=Buffer.isBuffer(o)?o:Buffer.from(o),n=K.relative(Bt.root,r),u=this.allocateSource(o);try{let A=this.libzip.file.add(this.zip,n,u,this.libzip.ZIP_FL_OVERWRITE);if(A===-1)throw this.makeLibzipError(this.libzip.getError(this.zip));if(this.level!=="mixed"){let p=this.level===0?this.libzip.ZIP_CM_STORE:this.libzip.ZIP_CM_DEFLATE;if(this.libzip.file.setCompression(this.zip,A,0,p,this.level)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip))}return this.fileSources.set(A,a),A}catch(A){throw this.libzip.source.free(u),A}}isSymbolicLink(r){if(this.symlinkCount===0)return!1;if(this.libzip.file.getExternalAttributes(this.zip,r,0,0,this.libzip.uint08S,this.libzip.uint32S)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip));return this.libzip.getValue(this.libzip.uint08S,"i8")>>>0!==this.libzip.ZIP_OPSYS_UNIX?!1:(this.libzip.getValue(this.libzip.uint32S,"i32")>>>16&ta.constants.S_IFMT)===ta.constants.S_IFLNK}getFileSource(r,o={asyncDecompress:!1}){let a=this.fileSources.get(r);if(typeof a<"u")return a;let n=this.libzip.struct.statS();if(this.libzip.statIndex(this.zip,r,0,0,n)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip));let A=this.libzip.struct.statCompSize(n),p=this.libzip.struct.statCompMethod(n),h=this.libzip.malloc(A);try{let E=this.libzip.fopenIndex(this.zip,r,0,this.libzip.ZIP_FL_COMPRESSED);if(E===0)throw this.makeLibzipError(this.libzip.getError(this.zip));try{let w=this.libzip.fread(E,h,A,0);if(w===-1)throw this.makeLibzipError(this.libzip.file.getError(E));if(wA)throw new Error("Overread");let D=this.libzip.HEAPU8.subarray(h,h+A),b=Buffer.from(D);if(p===0)return this.fileSources.set(r,b),b;if(o.asyncDecompress)return new Promise((C,T)=>{HU.default.inflateRaw(b,(N,U)=>{N?T(N):(this.fileSources.set(r,U),C(U))})});{let C=HU.default.inflateRawSync(b);return this.fileSources.set(r,C),C}}finally{this.libzip.fclose(E)}}finally{this.libzip.free(h)}}async fchmodPromise(r,o){return this.chmodPromise(this.fdToPath(r,"fchmod"),o)}fchmodSync(r,o){return this.chmodSync(this.fdToPath(r,"fchmodSync"),o)}async chmodPromise(r,o){return this.chmodSync(r,o)}chmodSync(r,o){if(this.readOnly)throw sr.EROFS(`chmod '${r}'`);o&=493;let a=this.resolveFilename(`chmod '${r}'`,r,!1),n=this.entries.get(a);if(typeof n>"u")throw new Error(`Assertion failed: The entry should have been registered (${a})`);let A=this.getUnixMode(n,ta.constants.S_IFREG|0)&-512|o;if(this.libzip.file.setExternalAttributes(this.zip,n,0,0,this.libzip.ZIP_OPSYS_UNIX,A<<16)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip))}async fchownPromise(r,o,a){return this.chownPromise(this.fdToPath(r,"fchown"),o,a)}fchownSync(r,o,a){return this.chownSync(this.fdToPath(r,"fchownSync"),o,a)}async chownPromise(r,o,a){return this.chownSync(r,o,a)}chownSync(r,o,a){throw new Error("Unimplemented")}async renamePromise(r,o){return this.renameSync(r,o)}renameSync(r,o){throw new Error("Unimplemented")}async copyFilePromise(r,o,a){let{indexSource:n,indexDest:u,resolvedDestP:A}=this.prepareCopyFile(r,o,a),p=await this.getFileSource(n,{asyncDecompress:!0}),h=this.setFileSource(A,p);h!==u&&this.registerEntry(A,h)}copyFileSync(r,o,a=0){let{indexSource:n,indexDest:u,resolvedDestP:A}=this.prepareCopyFile(r,o,a),p=this.getFileSource(n),h=this.setFileSource(A,p);h!==u&&this.registerEntry(A,h)}prepareCopyFile(r,o,a=0){if(this.readOnly)throw sr.EROFS(`copyfile '${r} -> '${o}'`);if(a&ta.constants.COPYFILE_FICLONE_FORCE)throw sr.ENOSYS("unsupported clone operation",`copyfile '${r}' -> ${o}'`);let n=this.resolveFilename(`copyfile '${r} -> ${o}'`,r),u=this.entries.get(n);if(typeof u>"u")throw sr.EINVAL(`copyfile '${r}' -> '${o}'`);let A=this.resolveFilename(`copyfile '${r}' -> ${o}'`,o),p=this.entries.get(A);if(a&(ta.constants.COPYFILE_EXCL|ta.constants.COPYFILE_FICLONE_FORCE)&&typeof p<"u")throw sr.EEXIST(`copyfile '${r}' -> '${o}'`);return{indexSource:u,resolvedDestP:A,indexDest:p}}async appendFilePromise(r,o,a){if(this.readOnly)throw sr.EROFS(`open '${r}'`);return typeof a>"u"?a={flag:"a"}:typeof a=="string"?a={flag:"a",encoding:a}:typeof a.flag>"u"&&(a={flag:"a",...a}),this.writeFilePromise(r,o,a)}appendFileSync(r,o,a={}){if(this.readOnly)throw sr.EROFS(`open '${r}'`);return typeof a>"u"?a={flag:"a"}:typeof a=="string"?a={flag:"a",encoding:a}:typeof a.flag>"u"&&(a={flag:"a",...a}),this.writeFileSync(r,o,a)}fdToPath(r,o){let a=this.fds.get(r)?.p;if(typeof a>"u")throw sr.EBADF(o);return a}async writeFilePromise(r,o,a){let{encoding:n,mode:u,index:A,resolvedP:p}=this.prepareWriteFile(r,a);A!==void 0&&typeof a=="object"&&a.flag&&a.flag.includes("a")&&(o=Buffer.concat([await this.getFileSource(A,{asyncDecompress:!0}),Buffer.from(o)])),n!==null&&(o=o.toString(n));let h=this.setFileSource(p,o);h!==A&&this.registerEntry(p,h),u!==null&&await this.chmodPromise(p,u)}writeFileSync(r,o,a){let{encoding:n,mode:u,index:A,resolvedP:p}=this.prepareWriteFile(r,a);A!==void 0&&typeof a=="object"&&a.flag&&a.flag.includes("a")&&(o=Buffer.concat([this.getFileSource(A),Buffer.from(o)])),n!==null&&(o=o.toString(n));let h=this.setFileSource(p,o);h!==A&&this.registerEntry(p,h),u!==null&&this.chmodSync(p,u)}prepareWriteFile(r,o){if(typeof r=="number"&&(r=this.fdToPath(r,"read")),this.readOnly)throw sr.EROFS(`open '${r}'`);let a=this.resolveFilename(`open '${r}'`,r);if(this.listings.has(a))throw sr.EISDIR(`open '${r}'`);let n=null,u=null;typeof o=="string"?n=o:typeof o=="object"&&({encoding:n=null,mode:u=null}=o);let A=this.entries.get(a);return{encoding:n,mode:u,resolvedP:a,index:A}}async unlinkPromise(r){return this.unlinkSync(r)}unlinkSync(r){if(this.readOnly)throw sr.EROFS(`unlink '${r}'`);let o=this.resolveFilename(`unlink '${r}'`,r);if(this.listings.has(o))throw sr.EISDIR(`unlink '${r}'`);let a=this.entries.get(o);if(typeof a>"u")throw sr.EINVAL(`unlink '${r}'`);this.deleteEntry(o,a)}async utimesPromise(r,o,a){return this.utimesSync(r,o,a)}utimesSync(r,o,a){if(this.readOnly)throw sr.EROFS(`utimes '${r}'`);let n=this.resolveFilename(`utimes '${r}'`,r);this.utimesImpl(n,a)}async lutimesPromise(r,o,a){return this.lutimesSync(r,o,a)}lutimesSync(r,o,a){if(this.readOnly)throw sr.EROFS(`lutimes '${r}'`);let n=this.resolveFilename(`utimes '${r}'`,r,!1);this.utimesImpl(n,a)}utimesImpl(r,o){this.listings.has(r)&&(this.entries.has(r)||this.hydrateDirectory(r));let a=this.entries.get(r);if(a===void 0)throw new Error("Unreachable");if(this.libzip.file.setMtime(this.zip,a,0,tot(o),0)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip))}async mkdirPromise(r,o){return this.mkdirSync(r,o)}mkdirSync(r,{mode:o=493,recursive:a=!1}={}){if(a)return this.mkdirpSync(r,{chmod:o});if(this.readOnly)throw sr.EROFS(`mkdir '${r}'`);let n=this.resolveFilename(`mkdir '${r}'`,r);if(this.entries.has(n)||this.listings.has(n))throw sr.EEXIST(`mkdir '${r}'`);this.hydrateDirectory(n),this.chmodSync(n,o)}async rmdirPromise(r,o){return this.rmdirSync(r,o)}rmdirSync(r,{recursive:o=!1}={}){if(this.readOnly)throw sr.EROFS(`rmdir '${r}'`);if(o){this.removeSync(r);return}let a=this.resolveFilename(`rmdir '${r}'`,r),n=this.listings.get(a);if(!n)throw sr.ENOTDIR(`rmdir '${r}'`);if(n.size>0)throw sr.ENOTEMPTY(`rmdir '${r}'`);let u=this.entries.get(a);if(typeof u>"u")throw sr.EINVAL(`rmdir '${r}'`);this.deleteEntry(r,u)}async rmPromise(r,o){return this.rmSync(r,o)}rmSync(r,{recursive:o=!1}={}){if(this.readOnly)throw sr.EROFS(`rm '${r}'`);if(o){this.removeSync(r);return}let a=this.resolveFilename(`rm '${r}'`,r),n=this.listings.get(a);if(!n)throw sr.ENOTDIR(`rm '${r}'`);if(n.size>0)throw sr.ENOTEMPTY(`rm '${r}'`);let u=this.entries.get(a);if(typeof u>"u")throw sr.EINVAL(`rm '${r}'`);this.deleteEntry(r,u)}hydrateDirectory(r){let o=this.libzip.dir.add(this.zip,K.relative(Bt.root,r));if(o===-1)throw this.makeLibzipError(this.libzip.getError(this.zip));return this.registerListing(r),this.registerEntry(r,o),o}async linkPromise(r,o){return this.linkSync(r,o)}linkSync(r,o){throw sr.EOPNOTSUPP(`link '${r}' -> '${o}'`)}async symlinkPromise(r,o){return this.symlinkSync(r,o)}symlinkSync(r,o){if(this.readOnly)throw sr.EROFS(`symlink '${r}' -> '${o}'`);let a=this.resolveFilename(`symlink '${r}' -> '${o}'`,o);if(this.listings.has(a))throw sr.EISDIR(`symlink '${r}' -> '${o}'`);if(this.entries.has(a))throw sr.EEXIST(`symlink '${r}' -> '${o}'`);let n=this.setFileSource(a,r);if(this.registerEntry(a,n),this.libzip.file.setExternalAttributes(this.zip,n,0,0,this.libzip.ZIP_OPSYS_UNIX,(ta.constants.S_IFLNK|511)<<16)===-1)throw this.makeLibzipError(this.libzip.getError(this.zip));this.symlinkCount+=1}async readFilePromise(r,o){typeof o=="object"&&(o=o?o.encoding:void 0);let a=await this.readFileBuffer(r,{asyncDecompress:!0});return o?a.toString(o):a}readFileSync(r,o){typeof o=="object"&&(o=o?o.encoding:void 0);let a=this.readFileBuffer(r);return o?a.toString(o):a}readFileBuffer(r,o={asyncDecompress:!1}){typeof r=="number"&&(r=this.fdToPath(r,"read"));let a=this.resolveFilename(`open '${r}'`,r);if(!this.entries.has(a)&&!this.listings.has(a))throw sr.ENOENT(`open '${r}'`);if(r[r.length-1]==="/"&&!this.listings.has(a))throw sr.ENOTDIR(`open '${r}'`);if(this.listings.has(a))throw sr.EISDIR("read");let n=this.entries.get(a);if(n===void 0)throw new Error("Unreachable");return this.getFileSource(n,o)}async readdirPromise(r,o){return this.readdirSync(r,o)}readdirSync(r,o){let a=this.resolveFilename(`scandir '${r}'`,r);if(!this.entries.has(a)&&!this.listings.has(a))throw sr.ENOENT(`scandir '${r}'`);let n=this.listings.get(a);if(!n)throw sr.ENOTDIR(`scandir '${r}'`);if(o?.recursive)if(o?.withFileTypes){let u=Array.from(n,A=>Object.assign(this.statImpl("lstat",K.join(r,A)),{name:A,path:Bt.dot}));for(let A of u){if(!A.isDirectory())continue;let p=K.join(A.path,A.name),h=this.listings.get(K.join(a,p));for(let E of h)u.push(Object.assign(this.statImpl("lstat",K.join(r,p,E)),{name:E,path:p}))}return u}else{let u=[...n];for(let A of u){let p=this.listings.get(K.join(a,A));if(!(typeof p>"u"))for(let h of p)u.push(K.join(A,h))}return u}else return o?.withFileTypes?Array.from(n,u=>Object.assign(this.statImpl("lstat",K.join(r,u)),{name:u,path:void 0})):[...n]}async readlinkPromise(r){let o=this.prepareReadlink(r);return(await this.getFileSource(o,{asyncDecompress:!0})).toString()}readlinkSync(r){let o=this.prepareReadlink(r);return this.getFileSource(o).toString()}prepareReadlink(r){let o=this.resolveFilename(`readlink '${r}'`,r,!1);if(!this.entries.has(o)&&!this.listings.has(o))throw sr.ENOENT(`readlink '${r}'`);if(r[r.length-1]==="/"&&!this.listings.has(o))throw sr.ENOTDIR(`open '${r}'`);if(this.listings.has(o))throw sr.EINVAL(`readlink '${r}'`);let a=this.entries.get(o);if(a===void 0)throw new Error("Unreachable");if(!this.isSymbolicLink(a))throw sr.EINVAL(`readlink '${r}'`);return a}async truncatePromise(r,o=0){let a=this.resolveFilename(`open '${r}'`,r),n=this.entries.get(a);if(typeof n>"u")throw sr.EINVAL(`open '${r}'`);let u=await this.getFileSource(n,{asyncDecompress:!0}),A=Buffer.alloc(o,0);return u.copy(A),await this.writeFilePromise(r,A)}truncateSync(r,o=0){let a=this.resolveFilename(`open '${r}'`,r),n=this.entries.get(a);if(typeof n>"u")throw sr.EINVAL(`open '${r}'`);let u=this.getFileSource(n),A=Buffer.alloc(o,0);return u.copy(A),this.writeFileSync(r,A)}async ftruncatePromise(r,o){return this.truncatePromise(this.fdToPath(r,"ftruncate"),o)}ftruncateSync(r,o){return this.truncateSync(this.fdToPath(r,"ftruncateSync"),o)}watch(r,o,a){let n;switch(typeof o){case"function":case"string":case"undefined":n=!0;break;default:({persistent:n=!0}=o);break}if(!n)return{on:()=>{},close:()=>{}};let u=setInterval(()=>{},24*60*60*1e3);return{on:()=>{},close:()=>{clearInterval(u)}}}watchFile(r,o,a){let n=K.resolve(Bt.root,r);return um(this,n,o,a)}unwatchFile(r,o){let a=K.resolve(Bt.root,r);return q0(this,a,o)}}});function bce(t,e,r=Buffer.alloc(0),o){let a=new Zi(r),n=w=>w===e||w.startsWith(`${e}/`)?w.slice(0,e.length):null,u=async(w,D)=>()=>a,A=(w,D)=>a,p={...t},h=new _n(p),E=new Gp({baseFs:h,getMountPoint:n,factoryPromise:u,factorySync:A,magicByte:21,maxAge:1/0,typeCheck:o?.typeCheck});return uw(xce.default,new Wp(E)),a}var xce,kce=It(()=>{Pt();xce=et(ve("fs"));qU()});var Qce=It(()=>{Dce();qU();kce()});var V1={};Kt(V1,{DEFAULT_COMPRESSION_LEVEL:()=>Sce,LibzipError:()=>fb,ZipFS:()=>Zi,ZipOpenFS:()=>iA,getArchivePart:()=>UU,getLibzipPromise:()=>not,getLibzipSync:()=>rot,makeEmptyArchive:()=>Ab,mountMemoryDrive:()=>bce});function rot(){return K1()}async function not(){return K1()}var Fce,sA=It(()=>{NU();Fce=et(Ice());vce();Qce();Cce(()=>{let t=(0,Fce.default)();return Bce(t)})});var z1,Rce=It(()=>{Pt();Gt();J1();z1=class extends st{constructor(){super(...arguments);this.cwd=de.String("--cwd",process.cwd(),{description:"The directory to run the command in"});this.commandName=de.String();this.args=de.Proxy()}static{this.usage={description:"run a command using yarn's portable shell",details:` This command will run a command using Yarn's portable shell. Make sure to escape glob patterns, redirections, and other features that might be expanded by your own shell. Note: To escape something from Yarn's shell, you might have to escape it twice, the first time from your own shell. Note: Don't use this command in Yarn scripts, as Yarn's shell is automatically used. For a list of features, visit: https://github.com/yarnpkg/berry/blob/master/packages/yarnpkg-shell/README.md. `,examples:[["Run a simple command","$0 echo Hello"],["Run a command with a glob pattern","$0 echo '*.js'"],["Run a command with a redirection","$0 echo Hello World '>' hello.txt"],["Run a command with an escaped glob pattern (The double escape is needed in Unix shells)",`$0 echo '"*.js"'`],["Run a command with a variable (Double quotes are needed in Unix shells, to prevent them from expanding the variable)",'$0 "GREETING=Hello echo $GREETING World"']]}}async execute(){let r=this.args.length>0?`${this.commandName} ${this.args.join(" ")}`:this.commandName;return await ky(r,[],{cwd:Ae.toPortablePath(this.cwd),stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr})}}});var fl,Tce=It(()=>{fl=class extends Error{constructor(e){super(e),this.name="ShellError"}}});var gb={};Kt(gb,{fastGlobOptions:()=>Oce,isBraceExpansion:()=>jU,isGlobPattern:()=>iot,match:()=>sot,micromatchOptions:()=>hb});function iot(t){if(!pb.default.scan(t,hb).isGlob)return!1;try{pb.default.parse(t,hb)}catch{return!1}return!0}function sot(t,{cwd:e,baseFs:r}){return(0,Lce.default)(t,{...Oce,cwd:Ae.fromPortablePath(e),fs:aP(Nce.default,new Wp(r))})}function jU(t){return pb.default.scan(t,hb).isBrace}var Lce,Nce,pb,hb,Oce,Mce=It(()=>{Pt();Lce=et(ux()),Nce=et(ve("fs")),pb=et(Xo()),hb={strictBrackets:!0},Oce={onlyDirectories:!1,onlyFiles:!1}});function GU(){}function WU(){for(let t of Fg)t.kill()}function qce(t,e,r,o){return a=>{let n=a[0]instanceof oA.Transform?"pipe":a[0],u=a[1]instanceof oA.Transform?"pipe":a[1],A=a[2]instanceof oA.Transform?"pipe":a[2],p=(0,_ce.default)(t,e,{...o,stdio:[n,u,A]});return Fg.add(p),Fg.size===1&&(process.on("SIGINT",GU),process.on("SIGTERM",WU)),a[0]instanceof oA.Transform&&a[0].pipe(p.stdin),a[1]instanceof oA.Transform&&p.stdout.pipe(a[1],{end:!1}),a[2]instanceof oA.Transform&&p.stderr.pipe(a[2],{end:!1}),{stdin:p.stdin,promise:new Promise(h=>{p.on("error",E=>{switch(Fg.delete(p),Fg.size===0&&(process.off("SIGINT",GU),process.off("SIGTERM",WU)),E.code){case"ENOENT":a[2].write(`command not found: ${t} `),h(127);break;case"EACCES":a[2].write(`permission denied: ${t} `),h(128);break;default:a[2].write(`uncaught error: ${E.message} `),h(1);break}}),p.on("close",E=>{Fg.delete(p),Fg.size===0&&(process.off("SIGINT",GU),process.off("SIGTERM",WU)),h(E!==null?E:129)})})}}}function jce(t){return e=>{let r=e[0]==="pipe"?new oA.PassThrough:e[0];return{stdin:r,promise:Promise.resolve().then(()=>t({stdin:r,stdout:e[1],stderr:e[2]}))}}}function db(t,e){return KU.start(t,e)}function Uce(t,e=null){let r=new oA.PassThrough,o=new Hce.StringDecoder,a="";return r.on("data",n=>{let u=o.write(n),A;do if(A=u.indexOf(` `),A!==-1){let p=a+u.substring(0,A);u=u.substring(A+1),a="",t(e!==null?`${e} ${p}`:p)}while(A!==-1);a+=u}),r.on("end",()=>{let n=o.end();n!==""&&t(e!==null?`${e} ${n}`:n)}),r}function Gce(t,{prefix:e}){return{stdout:Uce(r=>t.stdout.write(`${r} `),t.stdout.isTTY?e:null),stderr:Uce(r=>t.stderr.write(`${r} `),t.stderr.isTTY?e:null)}}var _ce,oA,Hce,Fg,Zl,YU,KU,VU=It(()=>{_ce=et(MT()),oA=ve("stream"),Hce=ve("string_decoder"),Fg=new Set;Zl=class{constructor(e){this.stream=e}close(){}get(){return this.stream}},YU=class{constructor(){this.stream=null}close(){if(this.stream===null)throw new Error("Assertion failed: No stream attached");this.stream.end()}attach(e){this.stream=e}get(){if(this.stream===null)throw new Error("Assertion failed: No stream attached");return this.stream}},KU=class t{constructor(e,r){this.stdin=null;this.stdout=null;this.stderr=null;this.pipe=null;this.ancestor=e,this.implementation=r}static start(e,{stdin:r,stdout:o,stderr:a}){let n=new t(null,e);return n.stdin=r,n.stdout=o,n.stderr=a,n}pipeTo(e,r=1){let o=new t(this,e),a=new YU;return o.pipe=a,o.stdout=this.stdout,o.stderr=this.stderr,(r&1)===1?this.stdout=a:this.ancestor!==null&&(this.stderr=this.ancestor.stdout),(r&2)===2?this.stderr=a:this.ancestor!==null&&(this.stderr=this.ancestor.stderr),o}async exec(){let e=["ignore","ignore","ignore"];if(this.pipe)e[0]="pipe";else{if(this.stdin===null)throw new Error("Assertion failed: No input stream registered");e[0]=this.stdin.get()}let r;if(this.stdout===null)throw new Error("Assertion failed: No output stream registered");r=this.stdout,e[1]=r.get();let o;if(this.stderr===null)throw new Error("Assertion failed: No error stream registered");o=this.stderr,e[2]=o.get();let a=this.implementation(e);return this.pipe&&this.pipe.attach(a.stdin),await a.promise.then(n=>(r.close(),o.close(),n))}async run(){let e=[];for(let o=this;o;o=o.ancestor)e.push(o.exec());return(await Promise.all(e))[0]}}});var e2={};Kt(e2,{EntryCommand:()=>z1,ShellError:()=>fl,execute:()=>ky,globUtils:()=>gb});function Wce(t,e,r){let o=new pl.PassThrough({autoDestroy:!0});switch(t){case 0:(e&1)===1&&r.stdin.pipe(o,{end:!1}),(e&2)===2&&r.stdin instanceof pl.Writable&&o.pipe(r.stdin,{end:!1});break;case 1:(e&1)===1&&r.stdout.pipe(o,{end:!1}),(e&2)===2&&o.pipe(r.stdout,{end:!1});break;case 2:(e&1)===1&&r.stderr.pipe(o,{end:!1}),(e&2)===2&&o.pipe(r.stderr,{end:!1});break;default:throw new fl(`Bad file descriptor: "${t}"`)}return o}function yb(t,e={}){let r={...t,...e};return r.environment={...t.environment,...e.environment},r.variables={...t.variables,...e.variables},r}async function aot(t,e,r){let o=[],a=new pl.PassThrough;return a.on("data",n=>o.push(n)),await Eb(t,e,yb(r,{stdout:a})),Buffer.concat(o).toString().replace(/[\r\n]+$/,"")}async function Yce(t,e,r){let o=t.map(async n=>{let u=await Rg(n.args,e,r);return{name:n.name,value:u.join(" ")}});return(await Promise.all(o)).reduce((n,u)=>(n[u.name]=u.value,n),{})}function mb(t){return t.match(/[^ \r\n\t]+/g)||[]}async function Zce(t,e,r,o,a=o){switch(t.name){case"$":o(String(process.pid));break;case"#":o(String(e.args.length));break;case"@":if(t.quoted)for(let n of e.args)a(n);else for(let n of e.args){let u=mb(n);for(let A=0;A=0&&n"u"&&(t.defaultValue?u=(await Rg(t.defaultValue,e,r)).join(" "):t.alternativeValue&&(u="")),typeof u>"u")throw A?new fl(`Unbound argument #${n}`):new fl(`Unbound variable "${t.name}"`);if(t.quoted)o(u);else{let p=mb(u);for(let E=0;Eo.push(n));let a=Number(o.join(" "));return Number.isNaN(a)?X1({type:"variable",name:o.join(" ")},e,r):X1({type:"number",value:a},e,r)}else return lot[t.type](await X1(t.left,e,r),await X1(t.right,e,r))}async function Rg(t,e,r){let o=new Map,a=[],n=[],u=E=>{n.push(E)},A=()=>{n.length>0&&a.push(n.join("")),n=[]},p=E=>{u(E),A()},h=(E,w,D)=>{let b=JSON.stringify({type:E,fd:w}),C=o.get(b);typeof C>"u"&&o.set(b,C=[]),C.push(D)};for(let E of t){let w=!1;switch(E.type){case"redirection":{let D=await Rg(E.args,e,r);for(let b of D)h(E.subtype,E.fd,b)}break;case"argument":for(let D of E.segments)switch(D.type){case"text":u(D.text);break;case"glob":u(D.pattern),w=!0;break;case"shell":{let b=await aot(D.shell,e,r);if(D.quoted)u(b);else{let C=mb(b);for(let T=0;T"u")throw new Error("Assertion failed: Expected a glob pattern to have been set");let b=await e.glob.match(D,{cwd:r.cwd,baseFs:e.baseFs});if(b.length===0){let C=jU(D)?". Note: Brace expansion of arbitrary strings isn't currently supported. For more details, please read this issue: https://github.com/yarnpkg/berry/issues/22":"";throw new fl(`No matches found: "${D}"${C}`)}for(let C of b.sort())p(C)}}if(o.size>0){let E=[];for(let[w,D]of o.entries())E.splice(E.length,0,w,String(D.length),...D);a.splice(0,0,"__ysh_set_redirects",...E,"--")}return a}function Z1(t,e,r){e.builtins.has(t[0])||(t=["command",...t]);let o=Ae.fromPortablePath(r.cwd),a=r.environment;typeof a.PWD<"u"&&(a={...a,PWD:o});let[n,...u]=t;if(n==="command")return qce(u[0],u.slice(1),e,{cwd:o,env:a});let A=e.builtins.get(n);if(typeof A>"u")throw new Error(`Assertion failed: A builtin should exist for "${n}"`);return jce(async({stdin:p,stdout:h,stderr:E})=>{let{stdin:w,stdout:D,stderr:b}=r;r.stdin=p,r.stdout=h,r.stderr=E;try{return await A(u,e,r)}finally{r.stdin=w,r.stdout=D,r.stderr=b}})}function cot(t,e,r){return o=>{let a=new pl.PassThrough,n=Eb(t,e,yb(r,{stdin:a}));return{stdin:a,promise:n}}}function uot(t,e,r){return o=>{let a=new pl.PassThrough,n=Eb(t,e,r);return{stdin:a,promise:n}}}function Kce(t,e,r,o){if(e.length===0)return t;{let a;do a=String(Math.random());while(Object.hasOwn(o.procedures,a));return o.procedures={...o.procedures},o.procedures[a]=t,Z1([...e,"__ysh_run_procedure",a],r,o)}}async function Vce(t,e,r){let o=t,a=null,n=null;for(;o;){let u=o.then?{...r}:r,A;switch(o.type){case"command":{let p=await Rg(o.args,e,r),h=await Yce(o.envs,e,r);A=o.envs.length?Z1(p,e,yb(u,{environment:h})):Z1(p,e,u)}break;case"subshell":{let p=await Rg(o.args,e,r),h=cot(o.subshell,e,u);A=Kce(h,p,e,u)}break;case"group":{let p=await Rg(o.args,e,r),h=uot(o.group,e,u);A=Kce(h,p,e,u)}break;case"envs":{let p=await Yce(o.envs,e,r);u.environment={...u.environment,...p},A=Z1(["true"],e,u)}break}if(typeof A>"u")throw new Error("Assertion failed: An action should have been generated");if(a===null)n=db(A,{stdin:new Zl(u.stdin),stdout:new Zl(u.stdout),stderr:new Zl(u.stderr)});else{if(n===null)throw new Error("Assertion failed: The execution pipeline should have been setup");switch(a){case"|":n=n.pipeTo(A,1);break;case"|&":n=n.pipeTo(A,3);break}}o.then?(a=o.then.type,o=o.then.chain):o=null}if(n===null)throw new Error("Assertion failed: The execution pipeline should have been setup");return await n.run()}async function Aot(t,e,r,{background:o=!1}={}){function a(n){let u=["#2E86AB","#A23B72","#F18F01","#C73E1D","#CCE2A3"],A=u[n%u.length];return zce.default.hex(A)}if(o){let n=r.nextBackgroundJobIndex++,u=a(n),A=`[${n}]`,p=u(A),{stdout:h,stderr:E}=Gce(r,{prefix:p});return r.backgroundJobs.push(Vce(t,e,yb(r,{stdout:h,stderr:E})).catch(w=>E.write(`${w.message} `)).finally(()=>{r.stdout.isTTY&&r.stdout.write(`Job ${p}, '${u(mm(t))}' has ended `)})),0}return await Vce(t,e,r)}async function fot(t,e,r,{background:o=!1}={}){let a,n=A=>{a=A,r.variables["?"]=String(A)},u=async A=>{try{return await Aot(A.chain,e,r,{background:o&&typeof A.then>"u"})}catch(p){if(!(p instanceof fl))throw p;return r.stderr.write(`${p.message} `),1}};for(n(await u(t));t.then;){if(r.exitCode!==null)return r.exitCode;switch(t.then.type){case"&&":a===0&&n(await u(t.then.line));break;case"||":a!==0&&n(await u(t.then.line));break;default:throw new Error(`Assertion failed: Unsupported command type: "${t.then.type}"`)}t=t.then.line}return a}async function Eb(t,e,r){let o=r.backgroundJobs;r.backgroundJobs=[];let a=0;for(let{command:n,type:u}of t){if(a=await fot(n,e,r,{background:u==="&"}),r.exitCode!==null)return r.exitCode;r.variables["?"]=String(a)}return await Promise.all(r.backgroundJobs),r.backgroundJobs=o,a}function $ce(t){switch(t.type){case"variable":return t.name==="@"||t.name==="#"||t.name==="*"||Number.isFinite(parseInt(t.name,10))||"defaultValue"in t&&!!t.defaultValue&&t.defaultValue.some(e=>$1(e))||"alternativeValue"in t&&!!t.alternativeValue&&t.alternativeValue.some(e=>$1(e));case"arithmetic":return zU(t.arithmetic);case"shell":return JU(t.shell);default:return!1}}function $1(t){switch(t.type){case"redirection":return t.args.some(e=>$1(e));case"argument":return t.segments.some(e=>$ce(e));default:throw new Error(`Assertion failed: Unsupported argument type: "${t.type}"`)}}function zU(t){switch(t.type){case"variable":return $ce(t);case"number":return!1;default:return zU(t.left)||zU(t.right)}}function JU(t){return t.some(({command:e})=>{for(;e;){let r=e.chain;for(;r;){let o;switch(r.type){case"subshell":o=JU(r.subshell);break;case"command":o=r.envs.some(a=>a.args.some(n=>$1(n)))||r.args.some(a=>$1(a));break}if(o)return!0;if(!r.then)break;r=r.then.chain}if(!e.then)break;e=e.then.line}return!1})}async function ky(t,e=[],{baseFs:r=new _n,builtins:o={},cwd:a=Ae.toPortablePath(process.cwd()),env:n=process.env,stdin:u=process.stdin,stdout:A=process.stdout,stderr:p=process.stderr,variables:h={},glob:E=gb}={}){let w={};for(let[C,T]of Object.entries(n))typeof T<"u"&&(w[C]=T);let D=new Map(oot);for(let[C,T]of Object.entries(o))D.set(C,T);u===null&&(u=new pl.PassThrough,u.end());let b=uP(t,E);if(!JU(b)&&b.length>0&&e.length>0){let{command:C}=b[b.length-1];for(;C.then;)C=C.then.line;let T=C.chain;for(;T.then;)T=T.then.chain;T.type==="command"&&(T.args=T.args.concat(e.map(N=>({type:"argument",segments:[{type:"text",text:N}]}))))}return await Eb(b,{args:e,baseFs:r,builtins:D,initialStdin:u,initialStdout:A,initialStderr:p,glob:E},{cwd:a,environment:w,exitCode:null,procedures:{},stdin:u,stdout:A,stderr:p,variables:Object.assign({},h,{"?":0}),nextBackgroundJobIndex:1,backgroundJobs:[]})}var zce,Jce,pl,Xce,oot,lot,J1=It(()=>{Pt();Ol();zce=et(sN()),Jce=ve("os"),pl=ve("stream"),Xce=ve("timers/promises");Rce();Tce();Mce();VU();VU();oot=new Map([["cd",async([t=(0,Jce.homedir)(),...e],r,o)=>{let a=K.resolve(o.cwd,Ae.toPortablePath(t));if(!(await r.baseFs.statPromise(a).catch(u=>{throw u.code==="ENOENT"?new fl(`cd: no such file or directory: ${t}`):u})).isDirectory())throw new fl(`cd: not a directory: ${t}`);return o.cwd=a,0}],["pwd",async(t,e,r)=>(r.stdout.write(`${Ae.fromPortablePath(r.cwd)} `),0)],[":",async(t,e,r)=>0],["true",async(t,e,r)=>0],["false",async(t,e,r)=>1],["exit",async([t,...e],r,o)=>o.exitCode=parseInt(t??o.variables["?"],10)],["echo",async(t,e,r)=>(r.stdout.write(`${t.join(" ")} `),0)],["sleep",async([t],e,r)=>{if(typeof t>"u")throw new fl("sleep: missing operand");let o=Number(t);if(Number.isNaN(o))throw new fl(`sleep: invalid time interval '${t}'`);return await(0,Xce.setTimeout)(1e3*o,0)}],["unset",async(t,e,r)=>{for(let o of t)delete r.environment[o],delete r.variables[o];return 0}],["__ysh_run_procedure",async(t,e,r)=>{let o=r.procedures[t[0]];return await db(o,{stdin:new Zl(r.stdin),stdout:new Zl(r.stdout),stderr:new Zl(r.stderr)}).run()}],["__ysh_set_redirects",async(t,e,r)=>{let o=r.stdin,a=r.stdout,n=r.stderr,u=[],A=[],p=[],h=0;for(;t[h]!=="--";){let w=t[h++],{type:D,fd:b}=JSON.parse(w),C=z=>{switch(b){case null:case 0:u.push(z);break;default:throw new Error(`Unsupported file descriptor: "${b}"`)}},T=z=>{switch(b){case null:case 1:A.push(z);break;case 2:p.push(z);break;default:throw new Error(`Unsupported file descriptor: "${b}"`)}},N=Number(t[h++]),U=h+N;for(let z=h;ze.baseFs.createReadStream(K.resolve(r.cwd,Ae.toPortablePath(t[z]))));break;case"<<<":C(()=>{let te=new pl.PassThrough;return process.nextTick(()=>{te.write(`${t[z]} `),te.end()}),te});break;case"<&":C(()=>Wce(Number(t[z]),1,r));break;case">":case">>":{let te=K.resolve(r.cwd,Ae.toPortablePath(t[z]));T(te==="/dev/null"?new pl.Writable({autoDestroy:!0,emitClose:!0,write(le,ce,ue){setImmediate(ue)}}):e.baseFs.createWriteStream(te,D===">>"?{flags:"a"}:void 0))}break;case">&":T(Wce(Number(t[z]),2,r));break;default:throw new Error(`Assertion failed: Unsupported redirection type: "${D}"`)}}if(u.length>0){let w=new pl.PassThrough;o=w;let D=b=>{if(b===u.length)w.end();else{let C=u[b]();C.pipe(w,{end:!1}),C.on("end",()=>{D(b+1)})}};D(0)}if(A.length>0){let w=new pl.PassThrough;a=w;for(let D of A)w.pipe(D)}if(p.length>0){let w=new pl.PassThrough;n=w;for(let D of p)w.pipe(D)}let E=await db(Z1(t.slice(h+1),e,r),{stdin:new Zl(o),stdout:new Zl(a),stderr:new Zl(n)}).run();return await Promise.all(A.map(w=>new Promise((D,b)=>{w.on("error",C=>{b(C)}),w.on("close",()=>{D()}),w.end()}))),await Promise.all(p.map(w=>new Promise((D,b)=>{w.on("error",C=>{b(C)}),w.on("close",()=>{D()}),w.end()}))),E}]]);lot={addition:(t,e)=>t+e,subtraction:(t,e)=>t-e,multiplication:(t,e)=>t*e,division:(t,e)=>Math.trunc(t/e)}});var Cb=_((MMt,eue)=>{function pot(t,e){for(var r=-1,o=t==null?0:t.length,a=Array(o);++r{var tue=dg(),hot=Cb(),got=jl(),dot=fy(),mot=1/0,rue=tue?tue.prototype:void 0,nue=rue?rue.toString:void 0;function iue(t){if(typeof t=="string")return t;if(got(t))return hot(t,iue)+"";if(dot(t))return nue?nue.call(t):"";var e=t+"";return e=="0"&&1/t==-mot?"-0":e}sue.exports=iue});var t2=_((_Mt,aue)=>{var yot=oue();function Eot(t){return t==null?"":yot(t)}aue.exports=Eot});var XU=_((HMt,lue)=>{function Cot(t,e,r){var o=-1,a=t.length;e<0&&(e=-e>a?0:a+e),r=r>a?a:r,r<0&&(r+=a),a=e>r?0:r-e>>>0,e>>>=0;for(var n=Array(a);++o{var Iot=XU();function wot(t,e,r){var o=t.length;return r=r===void 0?o:r,!e&&r>=o?t:Iot(t,e,r)}cue.exports=wot});var ZU=_((jMt,Aue)=>{var Bot="\\ud800-\\udfff",vot="\\u0300-\\u036f",Dot="\\ufe20-\\ufe2f",Pot="\\u20d0-\\u20ff",Sot=vot+Dot+Pot,xot="\\ufe0e\\ufe0f",bot="\\u200d",kot=RegExp("["+bot+Bot+Sot+xot+"]");function Qot(t){return kot.test(t)}Aue.exports=Qot});var pue=_((GMt,fue)=>{function Fot(t){return t.split("")}fue.exports=Fot});var Iue=_((WMt,Cue)=>{var hue="\\ud800-\\udfff",Rot="\\u0300-\\u036f",Tot="\\ufe20-\\ufe2f",Lot="\\u20d0-\\u20ff",Not=Rot+Tot+Lot,Oot="\\ufe0e\\ufe0f",Mot="["+hue+"]",$U="["+Not+"]",e3="\\ud83c[\\udffb-\\udfff]",Uot="(?:"+$U+"|"+e3+")",gue="[^"+hue+"]",due="(?:\\ud83c[\\udde6-\\uddff]){2}",mue="[\\ud800-\\udbff][\\udc00-\\udfff]",_ot="\\u200d",yue=Uot+"?",Eue="["+Oot+"]?",Hot="(?:"+_ot+"(?:"+[gue,due,mue].join("|")+")"+Eue+yue+")*",qot=Eue+yue+Hot,jot="(?:"+[gue+$U+"?",$U,due,mue,Mot].join("|")+")",Got=RegExp(e3+"(?="+e3+")|"+jot+qot,"g");function Wot(t){return t.match(Got)||[]}Cue.exports=Wot});var Bue=_((YMt,wue)=>{var Yot=pue(),Kot=ZU(),Vot=Iue();function zot(t){return Kot(t)?Vot(t):Yot(t)}wue.exports=zot});var Due=_((KMt,vue)=>{var Jot=uue(),Xot=ZU(),Zot=Bue(),$ot=t2();function eat(t){return function(e){e=$ot(e);var r=Xot(e)?Zot(e):void 0,o=r?r[0]:e.charAt(0),a=r?Jot(r,1).join(""):e.slice(1);return o[t]()+a}}vue.exports=eat});var Sue=_((VMt,Pue)=>{var tat=Due(),rat=tat("toUpperCase");Pue.exports=rat});var t3=_((zMt,xue)=>{var nat=t2(),iat=Sue();function sat(t){return iat(nat(t).toLowerCase())}xue.exports=sat});var bue=_((JMt,Ib)=>{function oat(){var t=0,e=1,r=2,o=3,a=4,n=5,u=6,A=7,p=8,h=9,E=10,w=11,D=12,b=13,C=14,T=15,N=16,U=17,z=0,te=1,le=2,ce=3,ue=4;function Ie(g,me){return 55296<=g.charCodeAt(me)&&g.charCodeAt(me)<=56319&&56320<=g.charCodeAt(me+1)&&g.charCodeAt(me+1)<=57343}function he(g,me){me===void 0&&(me=0);var Ce=g.charCodeAt(me);if(55296<=Ce&&Ce<=56319&&me=1){var fe=g.charCodeAt(me-1),ie=Ce;return 55296<=fe&&fe<=56319?(fe-55296)*1024+(ie-56320)+65536:ie}return Ce}function De(g,me,Ce){var fe=[g].concat(me).concat([Ce]),ie=fe[fe.length-2],Z=Ce,Pe=fe.lastIndexOf(C);if(Pe>1&&fe.slice(1,Pe).every(function(q){return q==o})&&[o,b,U].indexOf(g)==-1)return le;var Re=fe.lastIndexOf(a);if(Re>0&&fe.slice(1,Re).every(function(q){return q==a})&&[D,a].indexOf(ie)==-1)return fe.filter(function(q){return q==a}).length%2==1?ce:ue;if(ie==t&&Z==e)return z;if(ie==r||ie==t||ie==e)return Z==C&&me.every(function(q){return q==o})?le:te;if(Z==r||Z==t||Z==e)return te;if(ie==u&&(Z==u||Z==A||Z==h||Z==E))return z;if((ie==h||ie==A)&&(Z==A||Z==p))return z;if((ie==E||ie==p)&&Z==p)return z;if(Z==o||Z==T)return z;if(Z==n)return z;if(ie==D)return z;var ht=fe.indexOf(o)!=-1?fe.lastIndexOf(o)-1:fe.length-2;return[b,U].indexOf(fe[ht])!=-1&&fe.slice(ht+1,-1).every(function(q){return q==o})&&Z==C||ie==T&&[N,U].indexOf(Z)!=-1?z:me.indexOf(a)!=-1?le:ie==a&&Z==a?z:te}this.nextBreak=function(g,me){if(me===void 0&&(me=0),me<0)return 0;if(me>=g.length-1)return g.length;for(var Ce=Ee(he(g,me)),fe=[],ie=me+1;ie{var aat=/^(.*?)(\x1b\[[^m]+m|\x1b\]8;;.*?(\x1b\\|\u0007))/,wb;function lat(){if(wb)return wb;if(typeof Intl.Segmenter<"u"){let t=new Intl.Segmenter("en",{granularity:"grapheme"});return wb=e=>Array.from(t.segment(e),({segment:r})=>r)}else{let t=bue(),e=new t;return wb=r=>e.splitGraphemes(r)}}kue.exports=(t,e=0,r=t.length)=>{if(e<0||r<0)throw new RangeError("Negative indices aren't supported by this implementation");let o=r-e,a="",n=0,u=0;for(;t.length>0;){let A=t.match(aat)||[t,t,void 0],p=lat()(A[1]),h=Math.min(e-n,p.length);p=p.slice(h);let E=Math.min(o-u,p.length);a+=p.slice(0,E).join(""),n+=h,u+=E,typeof A[2]<"u"&&(a+=A[2]),t=t.slice(A[0].length)}return a}});var nn,r2=It(()=>{nn=process.env.YARN_IS_TEST_ENV?"0.0.0":"4.5.3"});function Oue(t,{configuration:e,json:r}){if(!e.get("enableMessageNames"))return"";let a=zu(t===null?0:t);return!r&&t===null?Ut(e,a,"grey"):a}function r3(t,{configuration:e,json:r}){let o=Oue(t,{configuration:e,json:r});if(!o||t===null||t===0)return o;let a=vr[t],n=`https://yarnpkg.com/advanced/error-codes#${o}---${a}`.toLowerCase();return ty(e,o,n)}async function Qy({configuration:t,stdout:e,forceError:r},o){let a=await Lt.start({configuration:t,stdout:e,includeFooter:!1},async n=>{let u=!1,A=!1;for(let p of o)typeof p.option<"u"&&(p.error||r?(A=!0,n.reportError(50,p.message)):(u=!0,n.reportWarning(50,p.message)),p.callback?.());u&&!A&&n.reportSeparator()});return a.hasErrors()?a.exitCode():null}var Lue,Bb,cat,Fue,Rue,hh,Nue,Tue,uat,Aat,vb,fat,Lt,n2=It(()=>{Lue=et(Que()),Bb=et(sg());jP();Vl();r2();Wl();cat="\xB7",Fue=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],Rue=80,hh=Bb.default.GITHUB_ACTIONS?{start:t=>`::group::${t} `,end:t=>`::endgroup:: `}:Bb.default.TRAVIS?{start:t=>`travis_fold:start:${t} `,end:t=>`travis_fold:end:${t} `}:Bb.default.GITLAB?{start:t=>`section_start:${Math.floor(Date.now()/1e3)}:${t.toLowerCase().replace(/\W+/g,"_")}[collapsed=true]\r\x1B[0K${t} `,end:t=>`section_end:${Math.floor(Date.now()/1e3)}:${t.toLowerCase().replace(/\W+/g,"_")}\r\x1B[0K`}:null,Nue=hh!==null,Tue=new Date,uat=["iTerm.app","Apple_Terminal","WarpTerminal","vscode"].includes(process.env.TERM_PROGRAM)||!!process.env.WT_SESSION,Aat=t=>t,vb=Aat({patrick:{date:[17,3],chars:["\u{1F340}","\u{1F331}"],size:40},simba:{date:[19,7],chars:["\u{1F981}","\u{1F334}"],size:40},jack:{date:[31,10],chars:["\u{1F383}","\u{1F987}"],size:40},hogsfather:{date:[31,12],chars:["\u{1F389}","\u{1F384}"],size:40},default:{chars:["=","-"],size:80}}),fat=uat&&Object.keys(vb).find(t=>{let e=vb[t];return!(e.date&&(e.date[0]!==Tue.getDate()||e.date[1]!==Tue.getMonth()+1))})||"default";Lt=class extends Ws{constructor({configuration:r,stdout:o,json:a=!1,forceSectionAlignment:n=!1,includeNames:u=!0,includePrefix:A=!0,includeFooter:p=!0,includeLogs:h=!a,includeInfos:E=h,includeWarnings:w=h}){super();this.uncommitted=new Set;this.warningCount=0;this.errorCount=0;this.timerFooter=[];this.startTime=Date.now();this.indent=0;this.level=0;this.progress=new Map;this.progressTime=0;this.progressFrame=0;this.progressTimeout=null;this.progressStyle=null;this.progressMaxScaledSize=null;if(g1(this,{configuration:r}),this.configuration=r,this.forceSectionAlignment=n,this.includeNames=u,this.includePrefix=A,this.includeFooter=p,this.includeInfos=E,this.includeWarnings=w,this.json=a,this.stdout=o,r.get("enableProgressBars")&&!a&&o.isTTY&&o.columns>22){let D=r.get("progressBarStyle")||fat;if(!Object.hasOwn(vb,D))throw new Error("Assertion failed: Invalid progress bar style");this.progressStyle=vb[D];let b=Math.min(this.getRecommendedLength(),80);this.progressMaxScaledSize=Math.floor(this.progressStyle.size*b/80)}}static async start(r,o){let a=new this(r),n=process.emitWarning;process.emitWarning=(u,A)=>{if(typeof u!="string"){let h=u;u=h.message,A=A??h.name}let p=typeof A<"u"?`${A}: ${u}`:u;a.reportWarning(0,p)},r.includeVersion&&a.reportInfo(0,Cg(r.configuration,`Yarn ${nn}`,2));try{await o(a)}catch(u){a.reportExceptionOnce(u)}finally{await a.finalize(),process.emitWarning=n}return a}hasErrors(){return this.errorCount>0}exitCode(){return this.hasErrors()?1:0}getRecommendedLength(){let o=this.progressStyle!==null?this.stdout.columns-1:super.getRecommendedLength();return Math.max(40,o-12-this.indent*2)}startSectionSync({reportHeader:r,reportFooter:o,skipIfEmpty:a},n){let u={committed:!1,action:()=>{r?.()}};a?this.uncommitted.add(u):(u.action(),u.committed=!0);let A=Date.now();try{return n()}catch(p){throw this.reportExceptionOnce(p),p}finally{let p=Date.now();this.uncommitted.delete(u),u.committed&&o?.(p-A)}}async startSectionPromise({reportHeader:r,reportFooter:o,skipIfEmpty:a},n){let u={committed:!1,action:()=>{r?.()}};a?this.uncommitted.add(u):(u.action(),u.committed=!0);let A=Date.now();try{return await n()}catch(p){throw this.reportExceptionOnce(p),p}finally{let p=Date.now();this.uncommitted.delete(u),u.committed&&o?.(p-A)}}startTimerImpl(r,o,a){return{cb:typeof o=="function"?o:a,reportHeader:()=>{this.level+=1,this.reportInfo(null,`\u250C ${r}`),this.indent+=1,hh!==null&&!this.json&&this.includeInfos&&this.stdout.write(hh.start(r))},reportFooter:A=>{if(this.indent-=1,hh!==null&&!this.json&&this.includeInfos){this.stdout.write(hh.end(r));for(let p of this.timerFooter)p()}this.configuration.get("enableTimers")&&A>200?this.reportInfo(null,`\u2514 Completed in ${Ut(this.configuration,A,Ct.DURATION)}`):this.reportInfo(null,"\u2514 Completed"),this.level-=1},skipIfEmpty:(typeof o=="function"?{}:o).skipIfEmpty}}startTimerSync(r,o,a){let{cb:n,...u}=this.startTimerImpl(r,o,a);return this.startSectionSync(u,n)}async startTimerPromise(r,o,a){let{cb:n,...u}=this.startTimerImpl(r,o,a);return this.startSectionPromise(u,n)}reportSeparator(){this.indent===0?this.writeLine(""):this.reportInfo(null,"")}reportInfo(r,o){if(!this.includeInfos)return;this.commit();let a=this.formatNameWithHyperlink(r),n=a?`${a}: `:"",u=`${this.formatPrefix(n,"blueBright")}${o}`;this.json?this.reportJson({type:"info",name:r,displayName:this.formatName(r),indent:this.formatIndent(),data:o}):this.writeLine(u)}reportWarning(r,o){if(this.warningCount+=1,!this.includeWarnings)return;this.commit();let a=this.formatNameWithHyperlink(r),n=a?`${a}: `:"";this.json?this.reportJson({type:"warning",name:r,displayName:this.formatName(r),indent:this.formatIndent(),data:o}):this.writeLine(`${this.formatPrefix(n,"yellowBright")}${o}`)}reportError(r,o){this.errorCount+=1,this.timerFooter.push(()=>this.reportErrorImpl(r,o)),this.reportErrorImpl(r,o)}reportErrorImpl(r,o){this.commit();let a=this.formatNameWithHyperlink(r),n=a?`${a}: `:"";this.json?this.reportJson({type:"error",name:r,displayName:this.formatName(r),indent:this.formatIndent(),data:o}):this.writeLine(`${this.formatPrefix(n,"redBright")}${o}`,{truncate:!1})}reportFold(r,o){if(!hh)return;let a=`${hh.start(r)}${o}${hh.end(r)}`;this.timerFooter.push(()=>this.stdout.write(a))}reportProgress(r){if(this.progressStyle===null)return{...Promise.resolve(),stop:()=>{}};if(r.hasProgress&&r.hasTitle)throw new Error("Unimplemented: Progress bars can't have both progress and titles.");let o=!1,a=Promise.resolve().then(async()=>{let u={progress:r.hasProgress?0:void 0,title:r.hasTitle?"":void 0};this.progress.set(r,{definition:u,lastScaledSize:r.hasProgress?-1:void 0,lastTitle:void 0}),this.refreshProgress({delta:-1});for await(let{progress:A,title:p}of r)o||u.progress===A&&u.title===p||(u.progress=A,u.title=p,this.refreshProgress());n()}),n=()=>{o||(o=!0,this.progress.delete(r),this.refreshProgress({delta:1}))};return{...a,stop:n}}reportJson(r){this.json&&this.writeLine(`${JSON.stringify(r)}`)}async finalize(){if(!this.includeFooter)return;let r="";this.errorCount>0?r="Failed with errors":this.warningCount>0?r="Done with warnings":r="Done";let o=Ut(this.configuration,Date.now()-this.startTime,Ct.DURATION),a=this.configuration.get("enableTimers")?`${r} in ${o}`:r;this.errorCount>0?this.reportError(0,a):this.warningCount>0?this.reportWarning(0,a):this.reportInfo(0,a)}writeLine(r,{truncate:o}={}){this.clearProgress({clear:!0}),this.stdout.write(`${this.truncate(r,{truncate:o})} `),this.writeProgress()}writeLines(r,{truncate:o}={}){this.clearProgress({delta:r.length});for(let a of r)this.stdout.write(`${this.truncate(a,{truncate:o})} `);this.writeProgress()}commit(){let r=this.uncommitted;this.uncommitted=new Set;for(let o of r)o.committed=!0,o.action()}clearProgress({delta:r=0,clear:o=!1}){this.progressStyle!==null&&this.progress.size+r>0&&(this.stdout.write(`\x1B[${this.progress.size+r}A`),(r>0||o)&&this.stdout.write("\x1B[0J"))}writeProgress(){if(this.progressStyle===null||(this.progressTimeout!==null&&clearTimeout(this.progressTimeout),this.progressTimeout=null,this.progress.size===0))return;let r=Date.now();r-this.progressTime>Rue&&(this.progressFrame=(this.progressFrame+1)%Fue.length,this.progressTime=r);let o=Fue[this.progressFrame];for(let a of this.progress.values()){let n="";if(typeof a.lastScaledSize<"u"){let h=this.progressStyle.chars[0].repeat(a.lastScaledSize),E=this.progressStyle.chars[1].repeat(this.progressMaxScaledSize-a.lastScaledSize);n=` ${h}${E}`}let u=this.formatName(null),A=u?`${u}: `:"",p=a.definition.title?` ${a.definition.title}`:"";this.stdout.write(`${Ut(this.configuration,"\u27A4","blueBright")} ${A}${o}${n}${p} `)}this.progressTimeout=setTimeout(()=>{this.refreshProgress({force:!0})},Rue)}refreshProgress({delta:r=0,force:o=!1}={}){let a=!1,n=!1;if(o||this.progress.size===0)a=!0;else for(let u of this.progress.values()){let A=typeof u.definition.progress<"u"?Math.trunc(this.progressMaxScaledSize*u.definition.progress):void 0,p=u.lastScaledSize;u.lastScaledSize=A;let h=u.lastTitle;if(u.lastTitle=u.definition.title,A!==p||(n=h!==u.definition.title)){a=!0;break}}a&&(this.clearProgress({delta:r,clear:n}),this.writeProgress())}truncate(r,{truncate:o}={}){return this.progressStyle===null&&(o=!1),typeof o>"u"&&(o=this.configuration.get("preferTruncatedLines")),o&&(r=(0,Lue.default)(r,0,this.stdout.columns-1)),r}formatName(r){return this.includeNames?Oue(r,{configuration:this.configuration,json:this.json}):""}formatPrefix(r,o){return this.includePrefix?`${Ut(this.configuration,"\u27A4",o)} ${r}${this.formatIndent()}`:""}formatNameWithHyperlink(r){return this.includeNames?r3(r,{configuration:this.configuration,json:this.json}):""}formatIndent(){return this.level>0||!this.forceSectionAlignment?"\u2502 ".repeat(this.indent):`${cat} `}}});var hn={};Kt(hn,{PackageManager:()=>_ue,detectPackageManager:()=>Hue,executePackageAccessibleBinary:()=>Yue,executePackageScript:()=>Db,executePackageShellcode:()=>n3,executeWorkspaceAccessibleBinary:()=>Eat,executeWorkspaceLifecycleScript:()=>Gue,executeWorkspaceScript:()=>jue,getPackageAccessibleBinaries:()=>Pb,getWorkspaceAccessibleBinaries:()=>Wue,hasPackageScript:()=>dat,hasWorkspaceScript:()=>i3,isNodeScript:()=>s3,makeScriptEnv:()=>i2,maybeExecuteWorkspaceLifecycleScript:()=>yat,prepareExternalProject:()=>gat});async function gh(t,e,r,o=[]){if(process.platform==="win32"){let a=`@goto #_undefined_# 2>NUL || @title %COMSPEC% & @setlocal & @"${r}" ${o.map(n=>`"${n.replace('"','""')}"`).join(" ")} %*`;await ae.writeFilePromise(K.format({dir:t,name:e,ext:".cmd"}),a)}await ae.writeFilePromise(K.join(t,e),`#!/bin/sh exec "${r}" ${o.map(a=>`'${a.replace(/'/g,`'"'"'`)}'`).join(" ")} "$@" `,{mode:493})}async function Hue(t){let e=await _t.tryFind(t);if(e?.packageManager){let o=dx(e.packageManager);if(o?.name){let a=`found ${JSON.stringify({packageManager:e.packageManager})} in manifest`,[n]=o.reference.split(".");switch(o.name){case"yarn":return{packageManagerField:!0,packageManager:Number(n)===1?"Yarn Classic":"Yarn",reason:a};case"npm":return{packageManagerField:!0,packageManager:"npm",reason:a};case"pnpm":return{packageManagerField:!0,packageManager:"pnpm",reason:a}}}}let r;try{r=await ae.readFilePromise(K.join(t,mr.lockfile),"utf8")}catch{}return r!==void 0?r.match(/^__metadata:$/m)?{packageManager:"Yarn",reason:'"__metadata" key found in yarn.lock'}:{packageManager:"Yarn Classic",reason:'"__metadata" key not found in yarn.lock, must be a Yarn classic lockfile'}:ae.existsSync(K.join(t,"package-lock.json"))?{packageManager:"npm",reason:`found npm's "package-lock.json" lockfile`}:ae.existsSync(K.join(t,"pnpm-lock.yaml"))?{packageManager:"pnpm",reason:`found pnpm's "pnpm-lock.yaml" lockfile`}:null}async function i2({project:t,locator:e,binFolder:r,ignoreCorepack:o,lifecycleScript:a,baseEnv:n=t?.configuration.env??process.env}){let u={};for(let[E,w]of Object.entries(n))typeof w<"u"&&(u[E.toLowerCase()!=="path"?E:"PATH"]=w);let A=Ae.fromPortablePath(r);u.BERRY_BIN_FOLDER=Ae.fromPortablePath(A);let p=process.env.COREPACK_ROOT&&!o?Ae.join(process.env.COREPACK_ROOT,"dist/yarn.js"):process.argv[1];if(await Promise.all([gh(r,"node",process.execPath),...nn!==null?[gh(r,"run",process.execPath,[p,"run"]),gh(r,"yarn",process.execPath,[p]),gh(r,"yarnpkg",process.execPath,[p]),gh(r,"node-gyp",process.execPath,[p,"run","--top-level","node-gyp"])]:[]]),t&&(u.INIT_CWD=Ae.fromPortablePath(t.configuration.startingCwd),u.PROJECT_CWD=Ae.fromPortablePath(t.cwd)),u.PATH=u.PATH?`${A}${Ae.delimiter}${u.PATH}`:`${A}`,u.npm_execpath=`${A}${Ae.sep}yarn`,u.npm_node_execpath=`${A}${Ae.sep}node`,e){if(!t)throw new Error("Assertion failed: Missing project");let E=t.tryWorkspaceByLocator(e),w=E?E.manifest.version??"":t.storedPackages.get(e.locatorHash).version??"";u.npm_package_name=rn(e),u.npm_package_version=w;let D;if(E)D=E.cwd;else{let b=t.storedPackages.get(e.locatorHash);if(!b)throw new Error(`Package for ${jr(t.configuration,e)} not found in the project`);let C=t.configuration.getLinkers(),T={project:t,report:new Lt({stdout:new dh.PassThrough,configuration:t.configuration})},N=C.find(U=>U.supportsPackage(b,T));if(!N)throw new Error(`The package ${jr(t.configuration,b)} isn't supported by any of the available linkers`);D=await N.findPackageLocation(b,T)}u.npm_package_json=Ae.fromPortablePath(K.join(D,mr.manifest))}let h=nn!==null?`yarn/${nn}`:`yarn/${vf("@yarnpkg/core").version}-core`;return u.npm_config_user_agent=`${h} npm/? node/${process.version} ${process.platform} ${process.arch}`,a&&(u.npm_lifecycle_event=a),t&&await t.configuration.triggerHook(E=>E.setupScriptEnvironment,t,u,async(E,w,D)=>await gh(r,E,w,D)),u}async function gat(t,e,{configuration:r,report:o,workspace:a=null,locator:n=null}){await hat(async()=>{await ae.mktempPromise(async u=>{let A=K.join(u,"pack.log"),p=null,{stdout:h,stderr:E}=r.getSubprocessStreams(A,{prefix:Ae.fromPortablePath(t),report:o}),w=n&&zc(n)?I1(n):n,D=w?Qa(w):"an external project";h.write(`Packing ${D} from sources `);let b=await Hue(t),C;b!==null?(h.write(`Using ${b.packageManager} for bootstrap. Reason: ${b.reason} `),C=b.packageManager):(h.write(`No package manager configuration detected; defaulting to Yarn `),C="Yarn");let T=C==="Yarn"&&!b?.packageManagerField;await ae.mktempPromise(async N=>{let U=await i2({binFolder:N,ignoreCorepack:T,baseEnv:{...process.env,COREPACK_ENABLE_AUTO_PIN:"0"}}),te=new Map([["Yarn Classic",async()=>{let ce=a!==null?["workspace",a]:[],ue=K.join(t,mr.manifest),Ie=await ae.readFilePromise(ue),he=await Xc(process.execPath,[process.argv[1],"set","version","classic","--only-if-needed","--yarn-path"],{cwd:t,env:U,stdin:p,stdout:h,stderr:E,end:1});if(he.code!==0)return he.code;await ae.writeFilePromise(ue,Ie),await ae.appendFilePromise(K.join(t,".npmignore"),`/.yarn `),h.write(` `),delete U.NODE_ENV;let De=await Xc("yarn",["install"],{cwd:t,env:U,stdin:p,stdout:h,stderr:E,end:1});if(De.code!==0)return De.code;h.write(` `);let Ee=await Xc("yarn",[...ce,"pack","--filename",Ae.fromPortablePath(e)],{cwd:t,env:U,stdin:p,stdout:h,stderr:E});return Ee.code!==0?Ee.code:0}],["Yarn",async()=>{let ce=a!==null?["workspace",a]:[];U.YARN_ENABLE_INLINE_BUILDS="1";let ue=K.join(t,mr.lockfile);await ae.existsPromise(ue)||await ae.writeFilePromise(ue,"");let Ie=await Xc("yarn",[...ce,"pack","--install-if-needed","--filename",Ae.fromPortablePath(e)],{cwd:t,env:U,stdin:p,stdout:h,stderr:E});return Ie.code!==0?Ie.code:0}],["npm",async()=>{if(a!==null){let me=new dh.PassThrough,Ce=Xm(me);me.pipe(h,{end:!1});let fe=await Xc("npm",["--version"],{cwd:t,env:U,stdin:p,stdout:me,stderr:E,end:0});if(me.end(),fe.code!==0)return h.end(),E.end(),fe.code;let ie=(await Ce).toString().trim();if(!nA(ie,">=7.x")){let Z=rA(null,"npm"),Pe=kn(Z,ie),Re=kn(Z,">=7.x");throw new Error(`Workspaces aren't supported by ${zn(r,Pe)}; please upgrade to ${zn(r,Re)} (npm has been detected as the primary package manager for ${Ut(r,t,Ct.PATH)})`)}}let ce=a!==null?["--workspace",a]:[];delete U.npm_config_user_agent,delete U.npm_config_production,delete U.NPM_CONFIG_PRODUCTION,delete U.NODE_ENV;let ue=await Xc("npm",["install","--legacy-peer-deps"],{cwd:t,env:U,stdin:p,stdout:h,stderr:E,end:1});if(ue.code!==0)return ue.code;let Ie=new dh.PassThrough,he=Xm(Ie);Ie.pipe(h);let De=await Xc("npm",["pack","--silent",...ce],{cwd:t,env:U,stdin:p,stdout:Ie,stderr:E});if(De.code!==0)return De.code;let Ee=(await he).toString().trim().replace(/^.*\n/s,""),g=K.resolve(t,Ae.toPortablePath(Ee));return await ae.renamePromise(g,e),0}]]).get(C);if(typeof te>"u")throw new Error("Assertion failed: Unsupported workflow");let le=await te();if(!(le===0||typeof le>"u"))throw ae.detachTemp(u),new zt(58,`Packing the package failed (exit code ${le}, logs can be found here: ${Ut(r,A,Ct.PATH)})`)})})})}async function dat(t,e,{project:r}){let o=r.tryWorkspaceByLocator(t);if(o!==null)return i3(o,e);let a=r.storedPackages.get(t.locatorHash);if(!a)throw new Error(`Package for ${jr(r.configuration,t)} not found in the project`);return await iA.openPromise(async n=>{let u=r.configuration,A=r.configuration.getLinkers(),p={project:r,report:new Lt({stdout:new dh.PassThrough,configuration:u})},h=A.find(b=>b.supportsPackage(a,p));if(!h)throw new Error(`The package ${jr(r.configuration,a)} isn't supported by any of the available linkers`);let E=await h.findPackageLocation(a,p),w=new En(E,{baseFs:n});return(await _t.find(Bt.dot,{baseFs:w})).scripts.has(e)})}async function Db(t,e,r,{cwd:o,project:a,stdin:n,stdout:u,stderr:A}){return await ae.mktempPromise(async p=>{let{manifest:h,env:E,cwd:w}=await que(t,{project:a,binFolder:p,cwd:o,lifecycleScript:e}),D=h.scripts.get(e);if(typeof D>"u")return 1;let b=async()=>await ky(D,r,{cwd:w,env:E,stdin:n,stdout:u,stderr:A});return await(await a.configuration.reduceHook(T=>T.wrapScriptExecution,b,a,t,e,{script:D,args:r,cwd:w,env:E,stdin:n,stdout:u,stderr:A}))()})}async function n3(t,e,r,{cwd:o,project:a,stdin:n,stdout:u,stderr:A}){return await ae.mktempPromise(async p=>{let{env:h,cwd:E}=await que(t,{project:a,binFolder:p,cwd:o});return await ky(e,r,{cwd:E,env:h,stdin:n,stdout:u,stderr:A})})}async function mat(t,{binFolder:e,cwd:r,lifecycleScript:o}){let a=await i2({project:t.project,locator:t.anchoredLocator,binFolder:e,lifecycleScript:o});return await o3(e,await Wue(t)),typeof r>"u"&&(r=K.dirname(await ae.realpathPromise(K.join(t.cwd,"package.json")))),{manifest:t.manifest,binFolder:e,env:a,cwd:r}}async function que(t,{project:e,binFolder:r,cwd:o,lifecycleScript:a}){let n=e.tryWorkspaceByLocator(t);if(n!==null)return mat(n,{binFolder:r,cwd:o,lifecycleScript:a});let u=e.storedPackages.get(t.locatorHash);if(!u)throw new Error(`Package for ${jr(e.configuration,t)} not found in the project`);return await iA.openPromise(async A=>{let p=e.configuration,h=e.configuration.getLinkers(),E={project:e,report:new Lt({stdout:new dh.PassThrough,configuration:p})},w=h.find(N=>N.supportsPackage(u,E));if(!w)throw new Error(`The package ${jr(e.configuration,u)} isn't supported by any of the available linkers`);let D=await i2({project:e,locator:t,binFolder:r,lifecycleScript:a});await o3(r,await Pb(t,{project:e}));let b=await w.findPackageLocation(u,E),C=new En(b,{baseFs:A}),T=await _t.find(Bt.dot,{baseFs:C});return typeof o>"u"&&(o=b),{manifest:T,binFolder:r,env:D,cwd:o}})}async function jue(t,e,r,{cwd:o,stdin:a,stdout:n,stderr:u}){return await Db(t.anchoredLocator,e,r,{cwd:o,project:t.project,stdin:a,stdout:n,stderr:u})}function i3(t,e){return t.manifest.scripts.has(e)}async function Gue(t,e,{cwd:r,report:o}){let{configuration:a}=t.project,n=null;await ae.mktempPromise(async u=>{let A=K.join(u,`${e}.log`),p=`# This file contains the result of Yarn calling the "${e}" lifecycle script inside a workspace ("${Ae.fromPortablePath(t.cwd)}") `,{stdout:h,stderr:E}=a.getSubprocessStreams(A,{report:o,prefix:jr(a,t.anchoredLocator),header:p});o.reportInfo(36,`Calling the "${e}" lifecycle script`);let w=await jue(t,e,[],{cwd:r,stdin:n,stdout:h,stderr:E});if(h.end(),E.end(),w!==0)throw ae.detachTemp(u),new zt(36,`${(0,Mue.default)(e)} script failed (exit code ${Ut(a,w,Ct.NUMBER)}, logs can be found here: ${Ut(a,A,Ct.PATH)}); run ${Ut(a,`yarn ${e}`,Ct.CODE)} to investigate`)})}async function yat(t,e,r){i3(t,e)&&await Gue(t,e,r)}function s3(t){let e=K.extname(t);if(e.match(/\.[cm]?[jt]sx?$/))return!0;if(e===".exe"||e===".bin")return!1;let r=Buffer.alloc(4),o;try{o=ae.openSync(t,"r")}catch{return!0}try{ae.readSync(o,r,0,r.length,0)}finally{ae.closeSync(o)}let a=r.readUint32BE();return!(a===3405691582||a===3489328638||a===2135247942||(a&4294901760)===1297743872)}async function Pb(t,{project:e}){let r=e.configuration,o=new Map,a=e.storedPackages.get(t.locatorHash);if(!a)throw new Error(`Package for ${jr(r,t)} not found in the project`);let n=new dh.Writable,u=r.getLinkers(),A={project:e,report:new Lt({configuration:r,stdout:n})},p=new Set([t.locatorHash]);for(let E of a.dependencies.values()){let w=e.storedResolutions.get(E.descriptorHash);if(!w)throw new Error(`Assertion failed: The resolution (${zn(r,E)}) should have been registered`);p.add(w)}let h=await Promise.all(Array.from(p,async E=>{let w=e.storedPackages.get(E);if(!w)throw new Error(`Assertion failed: The package (${E}) should have been registered`);if(w.bin.size===0)return ul.skip;let D=u.find(C=>C.supportsPackage(w,A));if(!D)return ul.skip;let b=null;try{b=await D.findPackageLocation(w,A)}catch(C){if(C.code==="LOCATOR_NOT_INSTALLED")return ul.skip;throw C}return{dependency:w,packageLocation:b}}));for(let E of h){if(E===ul.skip)continue;let{dependency:w,packageLocation:D}=E;for(let[b,C]of w.bin){let T=K.resolve(D,C);o.set(b,[w,Ae.fromPortablePath(T),s3(T)])}}return o}async function Wue(t){return await Pb(t.anchoredLocator,{project:t.project})}async function o3(t,e){await Promise.all(Array.from(e,([r,[,o,a]])=>a?gh(t,r,process.execPath,[o]):gh(t,r,o,[])))}async function Yue(t,e,r,{cwd:o,project:a,stdin:n,stdout:u,stderr:A,nodeArgs:p=[],packageAccessibleBinaries:h}){h??=await Pb(t,{project:a});let E=h.get(e);if(!E)throw new Error(`Binary not found (${e}) for ${jr(a.configuration,t)}`);return await ae.mktempPromise(async w=>{let[,D]=E,b=await i2({project:a,locator:t,binFolder:w});await o3(b.BERRY_BIN_FOLDER,h);let C=s3(Ae.toPortablePath(D))?Xc(process.execPath,[...p,D,...r],{cwd:o,env:b,stdin:n,stdout:u,stderr:A}):Xc(D,r,{cwd:o,env:b,stdin:n,stdout:u,stderr:A}),T;try{T=await C}finally{await ae.removePromise(b.BERRY_BIN_FOLDER)}return T.code})}async function Eat(t,e,r,{cwd:o,stdin:a,stdout:n,stderr:u,packageAccessibleBinaries:A}){return await Yue(t.anchoredLocator,e,r,{project:t.project,cwd:o,stdin:a,stdout:n,stderr:u,packageAccessibleBinaries:A})}var Mue,Uue,dh,_ue,pat,hat,a3=It(()=>{Pt();Pt();sA();J1();Mue=et(t3()),Uue=et(lg()),dh=ve("stream");Ay();Vl();n2();r2();nb();Wl();Gl();bf();Io();_ue=(a=>(a.Yarn1="Yarn Classic",a.Yarn2="Yarn",a.Npm="npm",a.Pnpm="pnpm",a))(_ue||{});pat=2,hat=(0,Uue.default)(pat)});var Fy=_((y4t,Vue)=>{"use strict";var Kue=new Map([["C","cwd"],["f","file"],["z","gzip"],["P","preservePaths"],["U","unlink"],["strip-components","strip"],["stripComponents","strip"],["keep-newer","newer"],["keepNewer","newer"],["keep-newer-files","newer"],["keepNewerFiles","newer"],["k","keep"],["keep-existing","keep"],["keepExisting","keep"],["m","noMtime"],["no-mtime","noMtime"],["p","preserveOwner"],["L","follow"],["h","follow"]]);Vue.exports=t=>t?Object.keys(t).map(e=>[Kue.has(e)?Kue.get(e):e,t[e]]).reduce((e,r)=>(e[r[0]]=r[1],e),Object.create(null)):{}});var Ty=_((E4t,nAe)=>{"use strict";var zue=typeof process=="object"&&process?process:{stdout:null,stderr:null},Cat=ve("events"),Jue=ve("stream"),Xue=ve("string_decoder").StringDecoder,Nf=Symbol("EOF"),Of=Symbol("maybeEmitEnd"),mh=Symbol("emittedEnd"),Sb=Symbol("emittingEnd"),s2=Symbol("emittedError"),xb=Symbol("closed"),Zue=Symbol("read"),bb=Symbol("flush"),$ue=Symbol("flushChunk"),Ra=Symbol("encoding"),Mf=Symbol("decoder"),kb=Symbol("flowing"),o2=Symbol("paused"),Ry=Symbol("resume"),xs=Symbol("bufferLength"),l3=Symbol("bufferPush"),c3=Symbol("bufferShift"),Do=Symbol("objectMode"),Po=Symbol("destroyed"),u3=Symbol("emitData"),eAe=Symbol("emitEnd"),A3=Symbol("emitEnd2"),Uf=Symbol("async"),a2=t=>Promise.resolve().then(t),tAe=global._MP_NO_ITERATOR_SYMBOLS_!=="1",Iat=tAe&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),wat=tAe&&Symbol.iterator||Symbol("iterator not implemented"),Bat=t=>t==="end"||t==="finish"||t==="prefinish",vat=t=>t instanceof ArrayBuffer||typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,Dat=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),Qb=class{constructor(e,r,o){this.src=e,this.dest=r,this.opts=o,this.ondrain=()=>e[Ry](),r.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},f3=class extends Qb{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,r,o){super(e,r,o),this.proxyErrors=a=>r.emit("error",a),e.on("error",this.proxyErrors)}};nAe.exports=class rAe extends Jue{constructor(e){super(),this[kb]=!1,this[o2]=!1,this.pipes=[],this.buffer=[],this[Do]=e&&e.objectMode||!1,this[Do]?this[Ra]=null:this[Ra]=e&&e.encoding||null,this[Ra]==="buffer"&&(this[Ra]=null),this[Uf]=e&&!!e.async||!1,this[Mf]=this[Ra]?new Xue(this[Ra]):null,this[Nf]=!1,this[mh]=!1,this[Sb]=!1,this[xb]=!1,this[s2]=null,this.writable=!0,this.readable=!0,this[xs]=0,this[Po]=!1}get bufferLength(){return this[xs]}get encoding(){return this[Ra]}set encoding(e){if(this[Do])throw new Error("cannot set encoding in objectMode");if(this[Ra]&&e!==this[Ra]&&(this[Mf]&&this[Mf].lastNeed||this[xs]))throw new Error("cannot change encoding");this[Ra]!==e&&(this[Mf]=e?new Xue(e):null,this.buffer.length&&(this.buffer=this.buffer.map(r=>this[Mf].write(r)))),this[Ra]=e}setEncoding(e){this.encoding=e}get objectMode(){return this[Do]}set objectMode(e){this[Do]=this[Do]||!!e}get async(){return this[Uf]}set async(e){this[Uf]=this[Uf]||!!e}write(e,r,o){if(this[Nf])throw new Error("write after end");if(this[Po])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof r=="function"&&(o=r,r="utf8"),r||(r="utf8");let a=this[Uf]?a2:n=>n();return!this[Do]&&!Buffer.isBuffer(e)&&(Dat(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):vat(e)?e=Buffer.from(e):typeof e!="string"&&(this.objectMode=!0)),this[Do]?(this.flowing&&this[xs]!==0&&this[bb](!0),this.flowing?this.emit("data",e):this[l3](e),this[xs]!==0&&this.emit("readable"),o&&a(o),this.flowing):e.length?(typeof e=="string"&&!(r===this[Ra]&&!this[Mf].lastNeed)&&(e=Buffer.from(e,r)),Buffer.isBuffer(e)&&this[Ra]&&(e=this[Mf].write(e)),this.flowing&&this[xs]!==0&&this[bb](!0),this.flowing?this.emit("data",e):this[l3](e),this[xs]!==0&&this.emit("readable"),o&&a(o),this.flowing):(this[xs]!==0&&this.emit("readable"),o&&a(o),this.flowing)}read(e){if(this[Po])return null;if(this[xs]===0||e===0||e>this[xs])return this[Of](),null;this[Do]&&(e=null),this.buffer.length>1&&!this[Do]&&(this.encoding?this.buffer=[this.buffer.join("")]:this.buffer=[Buffer.concat(this.buffer,this[xs])]);let r=this[Zue](e||null,this.buffer[0]);return this[Of](),r}[Zue](e,r){return e===r.length||e===null?this[c3]():(this.buffer[0]=r.slice(e),r=r.slice(0,e),this[xs]-=e),this.emit("data",r),!this.buffer.length&&!this[Nf]&&this.emit("drain"),r}end(e,r,o){return typeof e=="function"&&(o=e,e=null),typeof r=="function"&&(o=r,r="utf8"),e&&this.write(e,r),o&&this.once("end",o),this[Nf]=!0,this.writable=!1,(this.flowing||!this[o2])&&this[Of](),this}[Ry](){this[Po]||(this[o2]=!1,this[kb]=!0,this.emit("resume"),this.buffer.length?this[bb]():this[Nf]?this[Of]():this.emit("drain"))}resume(){return this[Ry]()}pause(){this[kb]=!1,this[o2]=!0}get destroyed(){return this[Po]}get flowing(){return this[kb]}get paused(){return this[o2]}[l3](e){this[Do]?this[xs]+=1:this[xs]+=e.length,this.buffer.push(e)}[c3](){return this.buffer.length&&(this[Do]?this[xs]-=1:this[xs]-=this.buffer[0].length),this.buffer.shift()}[bb](e){do;while(this[$ue](this[c3]()));!e&&!this.buffer.length&&!this[Nf]&&this.emit("drain")}[$ue](e){return e?(this.emit("data",e),this.flowing):!1}pipe(e,r){if(this[Po])return;let o=this[mh];return r=r||{},e===zue.stdout||e===zue.stderr?r.end=!1:r.end=r.end!==!1,r.proxyErrors=!!r.proxyErrors,o?r.end&&e.end():(this.pipes.push(r.proxyErrors?new f3(this,e,r):new Qb(this,e,r)),this[Uf]?a2(()=>this[Ry]()):this[Ry]()),e}unpipe(e){let r=this.pipes.find(o=>o.dest===e);r&&(this.pipes.splice(this.pipes.indexOf(r),1),r.unpipe())}addListener(e,r){return this.on(e,r)}on(e,r){let o=super.on(e,r);return e==="data"&&!this.pipes.length&&!this.flowing?this[Ry]():e==="readable"&&this[xs]!==0?super.emit("readable"):Bat(e)&&this[mh]?(super.emit(e),this.removeAllListeners(e)):e==="error"&&this[s2]&&(this[Uf]?a2(()=>r.call(this,this[s2])):r.call(this,this[s2])),o}get emittedEnd(){return this[mh]}[Of](){!this[Sb]&&!this[mh]&&!this[Po]&&this.buffer.length===0&&this[Nf]&&(this[Sb]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[xb]&&this.emit("close"),this[Sb]=!1)}emit(e,r,...o){if(e!=="error"&&e!=="close"&&e!==Po&&this[Po])return;if(e==="data")return r?this[Uf]?a2(()=>this[u3](r)):this[u3](r):!1;if(e==="end")return this[eAe]();if(e==="close"){if(this[xb]=!0,!this[mh]&&!this[Po])return;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[s2]=r;let n=super.emit("error",r);return this[Of](),n}else if(e==="resume"){let n=super.emit("resume");return this[Of](),n}else if(e==="finish"||e==="prefinish"){let n=super.emit(e);return this.removeAllListeners(e),n}let a=super.emit(e,r,...o);return this[Of](),a}[u3](e){for(let o of this.pipes)o.dest.write(e)===!1&&this.pause();let r=super.emit("data",e);return this[Of](),r}[eAe](){this[mh]||(this[mh]=!0,this.readable=!1,this[Uf]?a2(()=>this[A3]()):this[A3]())}[A3](){if(this[Mf]){let r=this[Mf].end();if(r){for(let o of this.pipes)o.dest.write(r);super.emit("data",r)}}for(let r of this.pipes)r.end();let e=super.emit("end");return this.removeAllListeners("end"),e}collect(){let e=[];this[Do]||(e.dataLength=0);let r=this.promise();return this.on("data",o=>{e.push(o),this[Do]||(e.dataLength+=o.length)}),r.then(()=>e)}concat(){return this[Do]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(e=>this[Do]?Promise.reject(new Error("cannot concat in objectMode")):this[Ra]?e.join(""):Buffer.concat(e,e.dataLength))}promise(){return new Promise((e,r)=>{this.on(Po,()=>r(new Error("stream destroyed"))),this.on("error",o=>r(o)),this.on("end",()=>e())})}[Iat](){return{next:()=>{let r=this.read();if(r!==null)return Promise.resolve({done:!1,value:r});if(this[Nf])return Promise.resolve({done:!0});let o=null,a=null,n=h=>{this.removeListener("data",u),this.removeListener("end",A),a(h)},u=h=>{this.removeListener("error",n),this.removeListener("end",A),this.pause(),o({value:h,done:!!this[Nf]})},A=()=>{this.removeListener("error",n),this.removeListener("data",u),o({done:!0})},p=()=>n(new Error("stream destroyed"));return new Promise((h,E)=>{a=E,o=h,this.once(Po,p),this.once("error",n),this.once("end",A),this.once("data",u)})}}}[wat](){return{next:()=>{let r=this.read();return{value:r,done:r===null}}}}destroy(e){return this[Po]?(e?this.emit("error",e):this.emit(Po),this):(this[Po]=!0,this.buffer.length=0,this[xs]=0,typeof this.close=="function"&&!this[xb]&&this.close(),e?this.emit("error",e):this.emit(Po),this)}static isStream(e){return!!e&&(e instanceof rAe||e instanceof Jue||e instanceof Cat&&(typeof e.pipe=="function"||typeof e.write=="function"&&typeof e.end=="function"))}}});var sAe=_((C4t,iAe)=>{var Pat=ve("zlib").constants||{ZLIB_VERNUM:4736};iAe.exports=Object.freeze(Object.assign(Object.create(null),{Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,BROTLI_DECODE:8,BROTLI_ENCODE:9,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:1/0,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1,BROTLI_OPERATION_PROCESS:0,BROTLI_OPERATION_FLUSH:1,BROTLI_OPERATION_FINISH:2,BROTLI_OPERATION_EMIT_METADATA:3,BROTLI_MODE_GENERIC:0,BROTLI_MODE_TEXT:1,BROTLI_MODE_FONT:2,BROTLI_DEFAULT_MODE:0,BROTLI_MIN_QUALITY:0,BROTLI_MAX_QUALITY:11,BROTLI_DEFAULT_QUALITY:11,BROTLI_MIN_WINDOW_BITS:10,BROTLI_MAX_WINDOW_BITS:24,BROTLI_LARGE_MAX_WINDOW_BITS:30,BROTLI_DEFAULT_WINDOW:22,BROTLI_MIN_INPUT_BLOCK_BITS:16,BROTLI_MAX_INPUT_BLOCK_BITS:24,BROTLI_PARAM_MODE:0,BROTLI_PARAM_QUALITY:1,BROTLI_PARAM_LGWIN:2,BROTLI_PARAM_LGBLOCK:3,BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING:4,BROTLI_PARAM_SIZE_HINT:5,BROTLI_PARAM_LARGE_WINDOW:6,BROTLI_PARAM_NPOSTFIX:7,BROTLI_PARAM_NDIRECT:8,BROTLI_DECODER_RESULT_ERROR:0,BROTLI_DECODER_RESULT_SUCCESS:1,BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT:2,BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:0,BROTLI_DECODER_PARAM_LARGE_WINDOW:1,BROTLI_DECODER_NO_ERROR:0,BROTLI_DECODER_SUCCESS:1,BROTLI_DECODER_NEEDS_MORE_INPUT:2,BROTLI_DECODER_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE:-1,BROTLI_DECODER_ERROR_FORMAT_RESERVED:-2,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE:-3,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET:-4,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME:-5,BROTLI_DECODER_ERROR_FORMAT_CL_SPACE:-6,BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE:-7,BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT:-8,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1:-9,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2:-10,BROTLI_DECODER_ERROR_FORMAT_TRANSFORM:-11,BROTLI_DECODER_ERROR_FORMAT_DICTIONARY:-12,BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS:-13,BROTLI_DECODER_ERROR_FORMAT_PADDING_1:-14,BROTLI_DECODER_ERROR_FORMAT_PADDING_2:-15,BROTLI_DECODER_ERROR_FORMAT_DISTANCE:-16,BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET:-19,BROTLI_DECODER_ERROR_INVALID_ARGUMENTS:-20,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES:-21,BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS:-22,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP:-25,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1:-26,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2:-27,BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES:-30,BROTLI_DECODER_ERROR_UNREACHABLE:-31},Pat))});var x3=_(hl=>{"use strict";var m3=ve("assert"),yh=ve("buffer").Buffer,lAe=ve("zlib"),Tg=hl.constants=sAe(),Sat=Ty(),oAe=yh.concat,Lg=Symbol("_superWrite"),Ny=class extends Error{constructor(e){super("zlib: "+e.message),this.code=e.code,this.errno=e.errno,this.code||(this.code="ZLIB_ERROR"),this.message="zlib: "+e.message,Error.captureStackTrace(this,this.constructor)}get name(){return"ZlibError"}},xat=Symbol("opts"),l2=Symbol("flushFlag"),aAe=Symbol("finishFlushFlag"),S3=Symbol("fullFlushFlag"),ui=Symbol("handle"),Fb=Symbol("onError"),Ly=Symbol("sawError"),p3=Symbol("level"),h3=Symbol("strategy"),g3=Symbol("ended"),I4t=Symbol("_defaultFullFlush"),Rb=class extends Sat{constructor(e,r){if(!e||typeof e!="object")throw new TypeError("invalid options for ZlibBase constructor");super(e),this[Ly]=!1,this[g3]=!1,this[xat]=e,this[l2]=e.flush,this[aAe]=e.finishFlush;try{this[ui]=new lAe[r](e)}catch(o){throw new Ny(o)}this[Fb]=o=>{this[Ly]||(this[Ly]=!0,this.close(),this.emit("error",o))},this[ui].on("error",o=>this[Fb](new Ny(o))),this.once("end",()=>this.close)}close(){this[ui]&&(this[ui].close(),this[ui]=null,this.emit("close"))}reset(){if(!this[Ly])return m3(this[ui],"zlib binding closed"),this[ui].reset()}flush(e){this.ended||(typeof e!="number"&&(e=this[S3]),this.write(Object.assign(yh.alloc(0),{[l2]:e})))}end(e,r,o){return e&&this.write(e,r),this.flush(this[aAe]),this[g3]=!0,super.end(null,null,o)}get ended(){return this[g3]}write(e,r,o){if(typeof r=="function"&&(o=r,r="utf8"),typeof e=="string"&&(e=yh.from(e,r)),this[Ly])return;m3(this[ui],"zlib binding closed");let a=this[ui]._handle,n=a.close;a.close=()=>{};let u=this[ui].close;this[ui].close=()=>{},yh.concat=h=>h;let A;try{let h=typeof e[l2]=="number"?e[l2]:this[l2];A=this[ui]._processChunk(e,h),yh.concat=oAe}catch(h){yh.concat=oAe,this[Fb](new Ny(h))}finally{this[ui]&&(this[ui]._handle=a,a.close=n,this[ui].close=u,this[ui].removeAllListeners("error"))}this[ui]&&this[ui].on("error",h=>this[Fb](new Ny(h)));let p;if(A)if(Array.isArray(A)&&A.length>0){p=this[Lg](yh.from(A[0]));for(let h=1;h{this.flush(a),n()};try{this[ui].params(e,r)}finally{this[ui].flush=o}this[ui]&&(this[p3]=e,this[h3]=r)}}}},y3=class extends _f{constructor(e){super(e,"Deflate")}},E3=class extends _f{constructor(e){super(e,"Inflate")}},d3=Symbol("_portable"),C3=class extends _f{constructor(e){super(e,"Gzip"),this[d3]=e&&!!e.portable}[Lg](e){return this[d3]?(this[d3]=!1,e[9]=255,super[Lg](e)):super[Lg](e)}},I3=class extends _f{constructor(e){super(e,"Gunzip")}},w3=class extends _f{constructor(e){super(e,"DeflateRaw")}},B3=class extends _f{constructor(e){super(e,"InflateRaw")}},v3=class extends _f{constructor(e){super(e,"Unzip")}},Tb=class extends Rb{constructor(e,r){e=e||{},e.flush=e.flush||Tg.BROTLI_OPERATION_PROCESS,e.finishFlush=e.finishFlush||Tg.BROTLI_OPERATION_FINISH,super(e,r),this[S3]=Tg.BROTLI_OPERATION_FLUSH}},D3=class extends Tb{constructor(e){super(e,"BrotliCompress")}},P3=class extends Tb{constructor(e){super(e,"BrotliDecompress")}};hl.Deflate=y3;hl.Inflate=E3;hl.Gzip=C3;hl.Gunzip=I3;hl.DeflateRaw=w3;hl.InflateRaw=B3;hl.Unzip=v3;typeof lAe.BrotliCompress=="function"?(hl.BrotliCompress=D3,hl.BrotliDecompress=P3):hl.BrotliCompress=hl.BrotliDecompress=class{constructor(){throw new Error("Brotli is not supported in this version of Node.js")}}});var Oy=_((v4t,cAe)=>{var bat=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform;cAe.exports=bat!=="win32"?t=>t:t=>t&&t.replace(/\\/g,"/")});var Lb=_((P4t,uAe)=>{"use strict";var kat=Ty(),b3=Oy(),k3=Symbol("slurp");uAe.exports=class extends kat{constructor(e,r,o){switch(super(),this.pause(),this.extended=r,this.globalExtended=o,this.header=e,this.startBlockSize=512*Math.ceil(e.size/512),this.blockRemain=this.startBlockSize,this.remain=e.size,this.type=e.type,this.meta=!1,this.ignore=!1,this.type){case"File":case"OldFile":case"Link":case"SymbolicLink":case"CharacterDevice":case"BlockDevice":case"Directory":case"FIFO":case"ContiguousFile":case"GNUDumpDir":break;case"NextFileHasLongLinkpath":case"NextFileHasLongPath":case"OldGnuLongPath":case"GlobalExtendedHeader":case"ExtendedHeader":case"OldExtendedHeader":this.meta=!0;break;default:this.ignore=!0}this.path=b3(e.path),this.mode=e.mode,this.mode&&(this.mode=this.mode&4095),this.uid=e.uid,this.gid=e.gid,this.uname=e.uname,this.gname=e.gname,this.size=e.size,this.mtime=e.mtime,this.atime=e.atime,this.ctime=e.ctime,this.linkpath=b3(e.linkpath),this.uname=e.uname,this.gname=e.gname,r&&this[k3](r),o&&this[k3](o,!0)}write(e){let r=e.length;if(r>this.blockRemain)throw new Error("writing more to entry than is appropriate");let o=this.remain,a=this.blockRemain;return this.remain=Math.max(0,o-r),this.blockRemain=Math.max(0,a-r),this.ignore?!0:o>=r?super.write(e):super.write(e.slice(0,o))}[k3](e,r){for(let o in e)e[o]!==null&&e[o]!==void 0&&!(r&&o==="path")&&(this[o]=o==="path"||o==="linkpath"?b3(e[o]):e[o])}}});var Q3=_(Nb=>{"use strict";Nb.name=new Map([["0","File"],["","OldFile"],["1","Link"],["2","SymbolicLink"],["3","CharacterDevice"],["4","BlockDevice"],["5","Directory"],["6","FIFO"],["7","ContiguousFile"],["g","GlobalExtendedHeader"],["x","ExtendedHeader"],["A","SolarisACL"],["D","GNUDumpDir"],["I","Inode"],["K","NextFileHasLongLinkpath"],["L","NextFileHasLongPath"],["M","ContinuationFile"],["N","OldGnuLongPath"],["S","SparseFile"],["V","TapeVolumeHeader"],["X","OldExtendedHeader"]]);Nb.code=new Map(Array.from(Nb.name).map(t=>[t[1],t[0]]))});var hAe=_((x4t,pAe)=>{"use strict";var Qat=(t,e)=>{if(Number.isSafeInteger(t))t<0?Rat(t,e):Fat(t,e);else throw Error("cannot encode number outside of javascript safe integer range");return e},Fat=(t,e)=>{e[0]=128;for(var r=e.length;r>1;r--)e[r-1]=t&255,t=Math.floor(t/256)},Rat=(t,e)=>{e[0]=255;var r=!1;t=t*-1;for(var o=e.length;o>1;o--){var a=t&255;t=Math.floor(t/256),r?e[o-1]=AAe(a):a===0?e[o-1]=0:(r=!0,e[o-1]=fAe(a))}},Tat=t=>{let e=t[0],r=e===128?Nat(t.slice(1,t.length)):e===255?Lat(t):null;if(r===null)throw Error("invalid base256 encoding");if(!Number.isSafeInteger(r))throw Error("parsed number outside of javascript safe integer range");return r},Lat=t=>{for(var e=t.length,r=0,o=!1,a=e-1;a>-1;a--){var n=t[a],u;o?u=AAe(n):n===0?u=n:(o=!0,u=fAe(n)),u!==0&&(r-=u*Math.pow(256,e-a-1))}return r},Nat=t=>{for(var e=t.length,r=0,o=e-1;o>-1;o--){var a=t[o];a!==0&&(r+=a*Math.pow(256,e-o-1))}return r},AAe=t=>(255^t)&255,fAe=t=>(255^t)+1&255;pAe.exports={encode:Qat,parse:Tat}});var Uy=_((b4t,dAe)=>{"use strict";var F3=Q3(),My=ve("path").posix,gAe=hAe(),R3=Symbol("slurp"),gl=Symbol("type"),N3=class{constructor(e,r,o,a){this.cksumValid=!1,this.needPax=!1,this.nullBlock=!1,this.block=null,this.path=null,this.mode=null,this.uid=null,this.gid=null,this.size=null,this.mtime=null,this.cksum=null,this[gl]="0",this.linkpath=null,this.uname=null,this.gname=null,this.devmaj=0,this.devmin=0,this.atime=null,this.ctime=null,Buffer.isBuffer(e)?this.decode(e,r||0,o,a):e&&this.set(e)}decode(e,r,o,a){if(r||(r=0),!e||!(e.length>=r+512))throw new Error("need 512 bytes for header");if(this.path=Ng(e,r,100),this.mode=Eh(e,r+100,8),this.uid=Eh(e,r+108,8),this.gid=Eh(e,r+116,8),this.size=Eh(e,r+124,12),this.mtime=T3(e,r+136,12),this.cksum=Eh(e,r+148,12),this[R3](o),this[R3](a,!0),this[gl]=Ng(e,r+156,1),this[gl]===""&&(this[gl]="0"),this[gl]==="0"&&this.path.substr(-1)==="/"&&(this[gl]="5"),this[gl]==="5"&&(this.size=0),this.linkpath=Ng(e,r+157,100),e.slice(r+257,r+265).toString()==="ustar\x0000")if(this.uname=Ng(e,r+265,32),this.gname=Ng(e,r+297,32),this.devmaj=Eh(e,r+329,8),this.devmin=Eh(e,r+337,8),e[r+475]!==0){let u=Ng(e,r+345,155);this.path=u+"/"+this.path}else{let u=Ng(e,r+345,130);u&&(this.path=u+"/"+this.path),this.atime=T3(e,r+476,12),this.ctime=T3(e,r+488,12)}let n=8*32;for(let u=r;u=r+512))throw new Error("need 512 bytes for header");let o=this.ctime||this.atime?130:155,a=Oat(this.path||"",o),n=a[0],u=a[1];this.needPax=a[2],this.needPax=Og(e,r,100,n)||this.needPax,this.needPax=Ch(e,r+100,8,this.mode)||this.needPax,this.needPax=Ch(e,r+108,8,this.uid)||this.needPax,this.needPax=Ch(e,r+116,8,this.gid)||this.needPax,this.needPax=Ch(e,r+124,12,this.size)||this.needPax,this.needPax=L3(e,r+136,12,this.mtime)||this.needPax,e[r+156]=this[gl].charCodeAt(0),this.needPax=Og(e,r+157,100,this.linkpath)||this.needPax,e.write("ustar\x0000",r+257,8),this.needPax=Og(e,r+265,32,this.uname)||this.needPax,this.needPax=Og(e,r+297,32,this.gname)||this.needPax,this.needPax=Ch(e,r+329,8,this.devmaj)||this.needPax,this.needPax=Ch(e,r+337,8,this.devmin)||this.needPax,this.needPax=Og(e,r+345,o,u)||this.needPax,e[r+475]!==0?this.needPax=Og(e,r+345,155,u)||this.needPax:(this.needPax=Og(e,r+345,130,u)||this.needPax,this.needPax=L3(e,r+476,12,this.atime)||this.needPax,this.needPax=L3(e,r+488,12,this.ctime)||this.needPax);let A=8*32;for(let p=r;p{let o=t,a="",n,u=My.parse(t).root||".";if(Buffer.byteLength(o)<100)n=[o,a,!1];else{a=My.dirname(o),o=My.basename(o);do Buffer.byteLength(o)<=100&&Buffer.byteLength(a)<=e?n=[o,a,!1]:Buffer.byteLength(o)>100&&Buffer.byteLength(a)<=e?n=[o.substr(0,99),a,!0]:(o=My.join(My.basename(a),o),a=My.dirname(a));while(a!==u&&!n);n||(n=[t.substr(0,99),"",!0])}return n},Ng=(t,e,r)=>t.slice(e,e+r).toString("utf8").replace(/\0.*/,""),T3=(t,e,r)=>Mat(Eh(t,e,r)),Mat=t=>t===null?null:new Date(t*1e3),Eh=(t,e,r)=>t[e]&128?gAe.parse(t.slice(e,e+r)):_at(t,e,r),Uat=t=>isNaN(t)?null:t,_at=(t,e,r)=>Uat(parseInt(t.slice(e,e+r).toString("utf8").replace(/\0.*$/,"").trim(),8)),Hat={12:8589934591,8:2097151},Ch=(t,e,r,o)=>o===null?!1:o>Hat[r]||o<0?(gAe.encode(o,t.slice(e,e+r)),!0):(qat(t,e,r,o),!1),qat=(t,e,r,o)=>t.write(jat(o,r),e,r,"ascii"),jat=(t,e)=>Gat(Math.floor(t).toString(8),e),Gat=(t,e)=>(t.length===e-1?t:new Array(e-t.length-1).join("0")+t+" ")+"\0",L3=(t,e,r,o)=>o===null?!1:Ch(t,e,r,o.getTime()/1e3),Wat=new Array(156).join("\0"),Og=(t,e,r,o)=>o===null?!1:(t.write(o+Wat,e,r,"utf8"),o.length!==Buffer.byteLength(o)||o.length>r);dAe.exports=N3});var Ob=_((k4t,mAe)=>{"use strict";var Yat=Uy(),Kat=ve("path"),c2=class{constructor(e,r){this.atime=e.atime||null,this.charset=e.charset||null,this.comment=e.comment||null,this.ctime=e.ctime||null,this.gid=e.gid||null,this.gname=e.gname||null,this.linkpath=e.linkpath||null,this.mtime=e.mtime||null,this.path=e.path||null,this.size=e.size||null,this.uid=e.uid||null,this.uname=e.uname||null,this.dev=e.dev||null,this.ino=e.ino||null,this.nlink=e.nlink||null,this.global=r||!1}encode(){let e=this.encodeBody();if(e==="")return null;let r=Buffer.byteLength(e),o=512*Math.ceil(1+r/512),a=Buffer.allocUnsafe(o);for(let n=0;n<512;n++)a[n]=0;new Yat({path:("PaxHeader/"+Kat.basename(this.path)).slice(0,99),mode:this.mode||420,uid:this.uid||null,gid:this.gid||null,size:r,mtime:this.mtime||null,type:this.global?"GlobalExtendedHeader":"ExtendedHeader",linkpath:"",uname:this.uname||"",gname:this.gname||"",devmaj:0,devmin:0,atime:this.atime||null,ctime:this.ctime||null}).encode(a),a.write(e,512,r,"utf8");for(let n=r+512;n=Math.pow(10,n)&&(n+=1),n+a+o}};c2.parse=(t,e,r)=>new c2(Vat(zat(t),e),r);var Vat=(t,e)=>e?Object.keys(t).reduce((r,o)=>(r[o]=t[o],r),e):t,zat=t=>t.replace(/\n$/,"").split(` `).reduce(Jat,Object.create(null)),Jat=(t,e)=>{let r=parseInt(e,10);if(r!==Buffer.byteLength(e)+1)return t;e=e.substr((r+" ").length);let o=e.split("="),a=o.shift().replace(/^SCHILY\.(dev|ino|nlink)/,"$1");if(!a)return t;let n=o.join("=");return t[a]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(a)?new Date(n*1e3):/^[0-9]+$/.test(n)?+n:n,t};mAe.exports=c2});var _y=_((Q4t,yAe)=>{yAe.exports=t=>{let e=t.length-1,r=-1;for(;e>-1&&t.charAt(e)==="/";)r=e,e--;return r===-1?t:t.slice(0,r)}});var Mb=_((F4t,EAe)=>{"use strict";EAe.exports=t=>class extends t{warn(e,r,o={}){this.file&&(o.file=this.file),this.cwd&&(o.cwd=this.cwd),o.code=r instanceof Error&&r.code||e,o.tarCode=e,!this.strict&&o.recoverable!==!1?(r instanceof Error&&(o=Object.assign(r,o),r=r.message),this.emit("warn",o.tarCode,r,o)):r instanceof Error?this.emit("error",Object.assign(r,o)):this.emit("error",Object.assign(new Error(`${e}: ${r}`),o))}}});var M3=_((T4t,CAe)=>{"use strict";var Ub=["|","<",">","?",":"],O3=Ub.map(t=>String.fromCharCode(61440+t.charCodeAt(0))),Xat=new Map(Ub.map((t,e)=>[t,O3[e]])),Zat=new Map(O3.map((t,e)=>[t,Ub[e]]));CAe.exports={encode:t=>Ub.reduce((e,r)=>e.split(r).join(Xat.get(r)),t),decode:t=>O3.reduce((e,r)=>e.split(r).join(Zat.get(r)),t)}});var U3=_((L4t,wAe)=>{var{isAbsolute:$at,parse:IAe}=ve("path").win32;wAe.exports=t=>{let e="",r=IAe(t);for(;$at(t)||r.root;){let o=t.charAt(0)==="/"&&t.slice(0,4)!=="//?/"?"/":r.root;t=t.substr(o.length),e+=o,r=IAe(t)}return[e,t]}});var vAe=_((N4t,BAe)=>{"use strict";BAe.exports=(t,e,r)=>(t&=4095,r&&(t=(t|384)&-19),e&&(t&256&&(t|=64),t&32&&(t|=8),t&4&&(t|=1)),t)});var z3=_((U4t,MAe)=>{"use strict";var QAe=Ty(),FAe=Ob(),RAe=Uy(),lA=ve("fs"),DAe=ve("path"),aA=Oy(),elt=_y(),TAe=(t,e)=>e?(t=aA(t).replace(/^\.(\/|$)/,""),elt(e)+"/"+t):aA(t),tlt=16*1024*1024,PAe=Symbol("process"),SAe=Symbol("file"),xAe=Symbol("directory"),H3=Symbol("symlink"),bAe=Symbol("hardlink"),u2=Symbol("header"),_b=Symbol("read"),q3=Symbol("lstat"),Hb=Symbol("onlstat"),j3=Symbol("onread"),G3=Symbol("onreadlink"),W3=Symbol("openfile"),Y3=Symbol("onopenfile"),Ih=Symbol("close"),qb=Symbol("mode"),K3=Symbol("awaitDrain"),_3=Symbol("ondrain"),cA=Symbol("prefix"),kAe=Symbol("hadError"),LAe=Mb(),rlt=M3(),NAe=U3(),OAe=vAe(),jb=LAe(class extends QAe{constructor(e,r){if(r=r||{},super(r),typeof e!="string")throw new TypeError("path is required");this.path=aA(e),this.portable=!!r.portable,this.myuid=process.getuid&&process.getuid()||0,this.myuser=process.env.USER||"",this.maxReadSize=r.maxReadSize||tlt,this.linkCache=r.linkCache||new Map,this.statCache=r.statCache||new Map,this.preservePaths=!!r.preservePaths,this.cwd=aA(r.cwd||process.cwd()),this.strict=!!r.strict,this.noPax=!!r.noPax,this.noMtime=!!r.noMtime,this.mtime=r.mtime||null,this.prefix=r.prefix?aA(r.prefix):null,this.fd=null,this.blockLen=null,this.blockRemain=null,this.buf=null,this.offset=null,this.length=null,this.pos=null,this.remain=null,typeof r.onwarn=="function"&&this.on("warn",r.onwarn);let o=!1;if(!this.preservePaths){let[a,n]=NAe(this.path);a&&(this.path=n,o=a)}this.win32=!!r.win32||process.platform==="win32",this.win32&&(this.path=rlt.decode(this.path.replace(/\\/g,"/")),e=e.replace(/\\/g,"/")),this.absolute=aA(r.absolute||DAe.resolve(this.cwd,e)),this.path===""&&(this.path="./"),o&&this.warn("TAR_ENTRY_INFO",`stripping ${o} from absolute path`,{entry:this,path:o+this.path}),this.statCache.has(this.absolute)?this[Hb](this.statCache.get(this.absolute)):this[q3]()}emit(e,...r){return e==="error"&&(this[kAe]=!0),super.emit(e,...r)}[q3](){lA.lstat(this.absolute,(e,r)=>{if(e)return this.emit("error",e);this[Hb](r)})}[Hb](e){this.statCache.set(this.absolute,e),this.stat=e,e.isFile()||(e.size=0),this.type=ilt(e),this.emit("stat",e),this[PAe]()}[PAe](){switch(this.type){case"File":return this[SAe]();case"Directory":return this[xAe]();case"SymbolicLink":return this[H3]();default:return this.end()}}[qb](e){return OAe(e,this.type==="Directory",this.portable)}[cA](e){return TAe(e,this.prefix)}[u2](){this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.header=new RAe({path:this[cA](this.path),linkpath:this.type==="Link"?this[cA](this.linkpath):this.linkpath,mode:this[qb](this.stat.mode),uid:this.portable?null:this.stat.uid,gid:this.portable?null:this.stat.gid,size:this.stat.size,mtime:this.noMtime?null:this.mtime||this.stat.mtime,type:this.type,uname:this.portable?null:this.stat.uid===this.myuid?this.myuser:"",atime:this.portable?null:this.stat.atime,ctime:this.portable?null:this.stat.ctime}),this.header.encode()&&!this.noPax&&super.write(new FAe({atime:this.portable?null:this.header.atime,ctime:this.portable?null:this.header.ctime,gid:this.portable?null:this.header.gid,mtime:this.noMtime?null:this.mtime||this.header.mtime,path:this[cA](this.path),linkpath:this.type==="Link"?this[cA](this.linkpath):this.linkpath,size:this.header.size,uid:this.portable?null:this.header.uid,uname:this.portable?null:this.header.uname,dev:this.portable?null:this.stat.dev,ino:this.portable?null:this.stat.ino,nlink:this.portable?null:this.stat.nlink}).encode()),super.write(this.header.block)}[xAe](){this.path.substr(-1)!=="/"&&(this.path+="/"),this.stat.size=0,this[u2](),this.end()}[H3](){lA.readlink(this.absolute,(e,r)=>{if(e)return this.emit("error",e);this[G3](r)})}[G3](e){this.linkpath=aA(e),this[u2](),this.end()}[bAe](e){this.type="Link",this.linkpath=aA(DAe.relative(this.cwd,e)),this.stat.size=0,this[u2](),this.end()}[SAe](){if(this.stat.nlink>1){let e=this.stat.dev+":"+this.stat.ino;if(this.linkCache.has(e)){let r=this.linkCache.get(e);if(r.indexOf(this.cwd)===0)return this[bAe](r)}this.linkCache.set(e,this.absolute)}if(this[u2](),this.stat.size===0)return this.end();this[W3]()}[W3](){lA.open(this.absolute,"r",(e,r)=>{if(e)return this.emit("error",e);this[Y3](r)})}[Y3](e){if(this.fd=e,this[kAe])return this[Ih]();this.blockLen=512*Math.ceil(this.stat.size/512),this.blockRemain=this.blockLen;let r=Math.min(this.blockLen,this.maxReadSize);this.buf=Buffer.allocUnsafe(r),this.offset=0,this.pos=0,this.remain=this.stat.size,this.length=this.buf.length,this[_b]()}[_b](){let{fd:e,buf:r,offset:o,length:a,pos:n}=this;lA.read(e,r,o,a,n,(u,A)=>{if(u)return this[Ih](()=>this.emit("error",u));this[j3](A)})}[Ih](e){lA.close(this.fd,e)}[j3](e){if(e<=0&&this.remain>0){let a=new Error("encountered unexpected EOF");return a.path=this.absolute,a.syscall="read",a.code="EOF",this[Ih](()=>this.emit("error",a))}if(e>this.remain){let a=new Error("did not encounter expected EOF");return a.path=this.absolute,a.syscall="read",a.code="EOF",this[Ih](()=>this.emit("error",a))}if(e===this.remain)for(let a=e;athis[_3]())}[K3](e){this.once("drain",e)}write(e){if(this.blockRemaine?this.emit("error",e):this.end());this.offset>=this.length&&(this.buf=Buffer.allocUnsafe(Math.min(this.blockRemain,this.buf.length)),this.offset=0),this.length=this.buf.length-this.offset,this[_b]()}}),V3=class extends jb{[q3](){this[Hb](lA.lstatSync(this.absolute))}[H3](){this[G3](lA.readlinkSync(this.absolute))}[W3](){this[Y3](lA.openSync(this.absolute,"r"))}[_b](){let e=!0;try{let{fd:r,buf:o,offset:a,length:n,pos:u}=this,A=lA.readSync(r,o,a,n,u);this[j3](A),e=!1}finally{if(e)try{this[Ih](()=>{})}catch{}}}[K3](e){e()}[Ih](e){lA.closeSync(this.fd),e()}},nlt=LAe(class extends QAe{constructor(e,r){r=r||{},super(r),this.preservePaths=!!r.preservePaths,this.portable=!!r.portable,this.strict=!!r.strict,this.noPax=!!r.noPax,this.noMtime=!!r.noMtime,this.readEntry=e,this.type=e.type,this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.prefix=r.prefix||null,this.path=aA(e.path),this.mode=this[qb](e.mode),this.uid=this.portable?null:e.uid,this.gid=this.portable?null:e.gid,this.uname=this.portable?null:e.uname,this.gname=this.portable?null:e.gname,this.size=e.size,this.mtime=this.noMtime?null:r.mtime||e.mtime,this.atime=this.portable?null:e.atime,this.ctime=this.portable?null:e.ctime,this.linkpath=aA(e.linkpath),typeof r.onwarn=="function"&&this.on("warn",r.onwarn);let o=!1;if(!this.preservePaths){let[a,n]=NAe(this.path);a&&(this.path=n,o=a)}this.remain=e.size,this.blockRemain=e.startBlockSize,this.header=new RAe({path:this[cA](this.path),linkpath:this.type==="Link"?this[cA](this.linkpath):this.linkpath,mode:this.mode,uid:this.portable?null:this.uid,gid:this.portable?null:this.gid,size:this.size,mtime:this.noMtime?null:this.mtime,type:this.type,uname:this.portable?null:this.uname,atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime}),o&&this.warn("TAR_ENTRY_INFO",`stripping ${o} from absolute path`,{entry:this,path:o+this.path}),this.header.encode()&&!this.noPax&&super.write(new FAe({atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime,gid:this.portable?null:this.gid,mtime:this.noMtime?null:this.mtime,path:this[cA](this.path),linkpath:this.type==="Link"?this[cA](this.linkpath):this.linkpath,size:this.size,uid:this.portable?null:this.uid,uname:this.portable?null:this.uname,dev:this.portable?null:this.readEntry.dev,ino:this.portable?null:this.readEntry.ino,nlink:this.portable?null:this.readEntry.nlink}).encode()),super.write(this.header.block),e.pipe(this)}[cA](e){return TAe(e,this.prefix)}[qb](e){return OAe(e,this.type==="Directory",this.portable)}write(e){let r=e.length;if(r>this.blockRemain)throw new Error("writing more to entry than is appropriate");return this.blockRemain-=r,super.write(e)}end(){return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),super.end()}});jb.Sync=V3;jb.Tar=nlt;var ilt=t=>t.isFile()?"File":t.isDirectory()?"Directory":t.isSymbolicLink()?"SymbolicLink":"Unsupported";MAe.exports=jb});var Zb=_((H4t,WAe)=>{"use strict";var Jb=class{constructor(e,r){this.path=e||"./",this.absolute=r,this.entry=null,this.stat=null,this.readdir=null,this.pending=!1,this.ignore=!1,this.piped=!1}},slt=Ty(),olt=x3(),alt=Lb(),i_=z3(),llt=i_.Sync,clt=i_.Tar,ult=$P(),UAe=Buffer.alloc(1024),Yb=Symbol("onStat"),Gb=Symbol("ended"),uA=Symbol("queue"),Hy=Symbol("current"),Mg=Symbol("process"),Wb=Symbol("processing"),_Ae=Symbol("processJob"),AA=Symbol("jobs"),J3=Symbol("jobDone"),Kb=Symbol("addFSEntry"),HAe=Symbol("addTarEntry"),e_=Symbol("stat"),t_=Symbol("readdir"),Vb=Symbol("onreaddir"),zb=Symbol("pipe"),qAe=Symbol("entry"),X3=Symbol("entryOpt"),r_=Symbol("writeEntryClass"),GAe=Symbol("write"),Z3=Symbol("ondrain"),Xb=ve("fs"),jAe=ve("path"),Alt=Mb(),$3=Oy(),s_=Alt(class extends slt{constructor(e){super(e),e=e||Object.create(null),this.opt=e,this.file=e.file||"",this.cwd=e.cwd||process.cwd(),this.maxReadSize=e.maxReadSize,this.preservePaths=!!e.preservePaths,this.strict=!!e.strict,this.noPax=!!e.noPax,this.prefix=$3(e.prefix||""),this.linkCache=e.linkCache||new Map,this.statCache=e.statCache||new Map,this.readdirCache=e.readdirCache||new Map,this[r_]=i_,typeof e.onwarn=="function"&&this.on("warn",e.onwarn),this.portable=!!e.portable,this.zip=null,e.gzip?(typeof e.gzip!="object"&&(e.gzip={}),this.portable&&(e.gzip.portable=!0),this.zip=new olt.Gzip(e.gzip),this.zip.on("data",r=>super.write(r)),this.zip.on("end",r=>super.end()),this.zip.on("drain",r=>this[Z3]()),this.on("resume",r=>this.zip.resume())):this.on("drain",this[Z3]),this.noDirRecurse=!!e.noDirRecurse,this.follow=!!e.follow,this.noMtime=!!e.noMtime,this.mtime=e.mtime||null,this.filter=typeof e.filter=="function"?e.filter:r=>!0,this[uA]=new ult,this[AA]=0,this.jobs=+e.jobs||4,this[Wb]=!1,this[Gb]=!1}[GAe](e){return super.write(e)}add(e){return this.write(e),this}end(e){return e&&this.write(e),this[Gb]=!0,this[Mg](),this}write(e){if(this[Gb])throw new Error("write after end");return e instanceof alt?this[HAe](e):this[Kb](e),this.flowing}[HAe](e){let r=$3(jAe.resolve(this.cwd,e.path));if(!this.filter(e.path,e))e.resume();else{let o=new Jb(e.path,r,!1);o.entry=new clt(e,this[X3](o)),o.entry.on("end",a=>this[J3](o)),this[AA]+=1,this[uA].push(o)}this[Mg]()}[Kb](e){let r=$3(jAe.resolve(this.cwd,e));this[uA].push(new Jb(e,r)),this[Mg]()}[e_](e){e.pending=!0,this[AA]+=1;let r=this.follow?"stat":"lstat";Xb[r](e.absolute,(o,a)=>{e.pending=!1,this[AA]-=1,o?this.emit("error",o):this[Yb](e,a)})}[Yb](e,r){this.statCache.set(e.absolute,r),e.stat=r,this.filter(e.path,r)||(e.ignore=!0),this[Mg]()}[t_](e){e.pending=!0,this[AA]+=1,Xb.readdir(e.absolute,(r,o)=>{if(e.pending=!1,this[AA]-=1,r)return this.emit("error",r);this[Vb](e,o)})}[Vb](e,r){this.readdirCache.set(e.absolute,r),e.readdir=r,this[Mg]()}[Mg](){if(!this[Wb]){this[Wb]=!0;for(let e=this[uA].head;e!==null&&this[AA]this.warn(r,o,a),noPax:this.noPax,cwd:this.cwd,absolute:e.absolute,preservePaths:this.preservePaths,maxReadSize:this.maxReadSize,strict:this.strict,portable:this.portable,linkCache:this.linkCache,statCache:this.statCache,noMtime:this.noMtime,mtime:this.mtime,prefix:this.prefix}}[qAe](e){this[AA]+=1;try{return new this[r_](e.path,this[X3](e)).on("end",()=>this[J3](e)).on("error",r=>this.emit("error",r))}catch(r){this.emit("error",r)}}[Z3](){this[Hy]&&this[Hy].entry&&this[Hy].entry.resume()}[zb](e){e.piped=!0,e.readdir&&e.readdir.forEach(a=>{let n=e.path,u=n==="./"?"":n.replace(/\/*$/,"/");this[Kb](u+a)});let r=e.entry,o=this.zip;o?r.on("data",a=>{o.write(a)||r.pause()}):r.on("data",a=>{super.write(a)||r.pause()})}pause(){return this.zip&&this.zip.pause(),super.pause()}}),n_=class extends s_{constructor(e){super(e),this[r_]=llt}pause(){}resume(){}[e_](e){let r=this.follow?"statSync":"lstatSync";this[Yb](e,Xb[r](e.absolute))}[t_](e,r){this[Vb](e,Xb.readdirSync(e.absolute))}[zb](e){let r=e.entry,o=this.zip;e.readdir&&e.readdir.forEach(a=>{let n=e.path,u=n==="./"?"":n.replace(/\/*$/,"/");this[Kb](u+a)}),o?r.on("data",a=>{o.write(a)}):r.on("data",a=>{super[GAe](a)})}};s_.Sync=n_;WAe.exports=s_});var zy=_(f2=>{"use strict";var flt=Ty(),plt=ve("events").EventEmitter,Ta=ve("fs"),l_=Ta.writev;if(!l_){let t=process.binding("fs"),e=t.FSReqWrap||t.FSReqCallback;l_=(r,o,a,n)=>{let u=(p,h)=>n(p,h,o),A=new e;A.oncomplete=u,t.writeBuffers(r,o,a,A)}}var Ky=Symbol("_autoClose"),Zc=Symbol("_close"),A2=Symbol("_ended"),Jn=Symbol("_fd"),YAe=Symbol("_finished"),Bh=Symbol("_flags"),o_=Symbol("_flush"),c_=Symbol("_handleChunk"),u_=Symbol("_makeBuf"),nk=Symbol("_mode"),$b=Symbol("_needDrain"),Wy=Symbol("_onerror"),Vy=Symbol("_onopen"),a_=Symbol("_onread"),jy=Symbol("_onwrite"),vh=Symbol("_open"),Hf=Symbol("_path"),Ug=Symbol("_pos"),fA=Symbol("_queue"),Gy=Symbol("_read"),KAe=Symbol("_readSize"),wh=Symbol("_reading"),ek=Symbol("_remain"),VAe=Symbol("_size"),tk=Symbol("_write"),qy=Symbol("_writing"),rk=Symbol("_defaultFlag"),Yy=Symbol("_errored"),ik=class extends flt{constructor(e,r){if(r=r||{},super(r),this.readable=!0,this.writable=!1,typeof e!="string")throw new TypeError("path must be a string");this[Yy]=!1,this[Jn]=typeof r.fd=="number"?r.fd:null,this[Hf]=e,this[KAe]=r.readSize||16*1024*1024,this[wh]=!1,this[VAe]=typeof r.size=="number"?r.size:1/0,this[ek]=this[VAe],this[Ky]=typeof r.autoClose=="boolean"?r.autoClose:!0,typeof this[Jn]=="number"?this[Gy]():this[vh]()}get fd(){return this[Jn]}get path(){return this[Hf]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[vh](){Ta.open(this[Hf],"r",(e,r)=>this[Vy](e,r))}[Vy](e,r){e?this[Wy](e):(this[Jn]=r,this.emit("open",r),this[Gy]())}[u_](){return Buffer.allocUnsafe(Math.min(this[KAe],this[ek]))}[Gy](){if(!this[wh]){this[wh]=!0;let e=this[u_]();if(e.length===0)return process.nextTick(()=>this[a_](null,0,e));Ta.read(this[Jn],e,0,e.length,null,(r,o,a)=>this[a_](r,o,a))}}[a_](e,r,o){this[wh]=!1,e?this[Wy](e):this[c_](r,o)&&this[Gy]()}[Zc](){if(this[Ky]&&typeof this[Jn]=="number"){let e=this[Jn];this[Jn]=null,Ta.close(e,r=>r?this.emit("error",r):this.emit("close"))}}[Wy](e){this[wh]=!0,this[Zc](),this.emit("error",e)}[c_](e,r){let o=!1;return this[ek]-=e,e>0&&(o=super.write(ethis[Vy](e,r))}[Vy](e,r){this[rk]&&this[Bh]==="r+"&&e&&e.code==="ENOENT"?(this[Bh]="w",this[vh]()):e?this[Wy](e):(this[Jn]=r,this.emit("open",r),this[o_]())}end(e,r){return e&&this.write(e,r),this[A2]=!0,!this[qy]&&!this[fA].length&&typeof this[Jn]=="number"&&this[jy](null,0),this}write(e,r){return typeof e=="string"&&(e=Buffer.from(e,r)),this[A2]?(this.emit("error",new Error("write() after end()")),!1):this[Jn]===null||this[qy]||this[fA].length?(this[fA].push(e),this[$b]=!0,!1):(this[qy]=!0,this[tk](e),!0)}[tk](e){Ta.write(this[Jn],e,0,e.length,this[Ug],(r,o)=>this[jy](r,o))}[jy](e,r){e?this[Wy](e):(this[Ug]!==null&&(this[Ug]+=r),this[fA].length?this[o_]():(this[qy]=!1,this[A2]&&!this[YAe]?(this[YAe]=!0,this[Zc](),this.emit("finish")):this[$b]&&(this[$b]=!1,this.emit("drain"))))}[o_](){if(this[fA].length===0)this[A2]&&this[jy](null,0);else if(this[fA].length===1)this[tk](this[fA].pop());else{let e=this[fA];this[fA]=[],l_(this[Jn],e,this[Ug],(r,o)=>this[jy](r,o))}}[Zc](){if(this[Ky]&&typeof this[Jn]=="number"){let e=this[Jn];this[Jn]=null,Ta.close(e,r=>r?this.emit("error",r):this.emit("close"))}}},f_=class extends sk{[vh](){let e;if(this[rk]&&this[Bh]==="r+")try{e=Ta.openSync(this[Hf],this[Bh],this[nk])}catch(r){if(r.code==="ENOENT")return this[Bh]="w",this[vh]();throw r}else e=Ta.openSync(this[Hf],this[Bh],this[nk]);this[Vy](null,e)}[Zc](){if(this[Ky]&&typeof this[Jn]=="number"){let e=this[Jn];this[Jn]=null,Ta.closeSync(e),this.emit("close")}}[tk](e){let r=!0;try{this[jy](null,Ta.writeSync(this[Jn],e,0,e.length,this[Ug])),r=!1}finally{if(r)try{this[Zc]()}catch{}}}};f2.ReadStream=ik;f2.ReadStreamSync=A_;f2.WriteStream=sk;f2.WriteStreamSync=f_});var fk=_((G4t,tfe)=>{"use strict";var hlt=Mb(),glt=Uy(),dlt=ve("events"),mlt=$P(),ylt=1024*1024,Elt=Lb(),zAe=Ob(),Clt=x3(),p_=Buffer.from([31,139]),$l=Symbol("state"),_g=Symbol("writeEntry"),qf=Symbol("readEntry"),h_=Symbol("nextEntry"),JAe=Symbol("processEntry"),ec=Symbol("extendedHeader"),p2=Symbol("globalExtendedHeader"),Dh=Symbol("meta"),XAe=Symbol("emitMeta"),yi=Symbol("buffer"),jf=Symbol("queue"),Hg=Symbol("ended"),ZAe=Symbol("emittedEnd"),qg=Symbol("emit"),La=Symbol("unzip"),ok=Symbol("consumeChunk"),ak=Symbol("consumeChunkSub"),g_=Symbol("consumeBody"),$Ae=Symbol("consumeMeta"),efe=Symbol("consumeHeader"),lk=Symbol("consuming"),d_=Symbol("bufferConcat"),m_=Symbol("maybeEnd"),h2=Symbol("writing"),Ph=Symbol("aborted"),ck=Symbol("onDone"),jg=Symbol("sawValidEntry"),uk=Symbol("sawNullBlock"),Ak=Symbol("sawEOF"),Ilt=t=>!0;tfe.exports=hlt(class extends dlt{constructor(e){e=e||{},super(e),this.file=e.file||"",this[jg]=null,this.on(ck,r=>{(this[$l]==="begin"||this[jg]===!1)&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),e.ondone?this.on(ck,e.ondone):this.on(ck,r=>{this.emit("prefinish"),this.emit("finish"),this.emit("end"),this.emit("close")}),this.strict=!!e.strict,this.maxMetaEntrySize=e.maxMetaEntrySize||ylt,this.filter=typeof e.filter=="function"?e.filter:Ilt,this.writable=!0,this.readable=!1,this[jf]=new mlt,this[yi]=null,this[qf]=null,this[_g]=null,this[$l]="begin",this[Dh]="",this[ec]=null,this[p2]=null,this[Hg]=!1,this[La]=null,this[Ph]=!1,this[uk]=!1,this[Ak]=!1,typeof e.onwarn=="function"&&this.on("warn",e.onwarn),typeof e.onentry=="function"&&this.on("entry",e.onentry)}[efe](e,r){this[jg]===null&&(this[jg]=!1);let o;try{o=new glt(e,r,this[ec],this[p2])}catch(a){return this.warn("TAR_ENTRY_INVALID",a)}if(o.nullBlock)this[uk]?(this[Ak]=!0,this[$l]==="begin"&&(this[$l]="header"),this[qg]("eof")):(this[uk]=!0,this[qg]("nullBlock"));else if(this[uk]=!1,!o.cksumValid)this.warn("TAR_ENTRY_INVALID","checksum failure",{header:o});else if(!o.path)this.warn("TAR_ENTRY_INVALID","path is required",{header:o});else{let a=o.type;if(/^(Symbolic)?Link$/.test(a)&&!o.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:o});else if(!/^(Symbolic)?Link$/.test(a)&&o.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:o});else{let n=this[_g]=new Elt(o,this[ec],this[p2]);if(!this[jg])if(n.remain){let u=()=>{n.invalid||(this[jg]=!0)};n.on("end",u)}else this[jg]=!0;n.meta?n.size>this.maxMetaEntrySize?(n.ignore=!0,this[qg]("ignoredEntry",n),this[$l]="ignore",n.resume()):n.size>0&&(this[Dh]="",n.on("data",u=>this[Dh]+=u),this[$l]="meta"):(this[ec]=null,n.ignore=n.ignore||!this.filter(n.path,n),n.ignore?(this[qg]("ignoredEntry",n),this[$l]=n.remain?"ignore":"header",n.resume()):(n.remain?this[$l]="body":(this[$l]="header",n.end()),this[qf]?this[jf].push(n):(this[jf].push(n),this[h_]())))}}}[JAe](e){let r=!0;return e?Array.isArray(e)?this.emit.apply(this,e):(this[qf]=e,this.emit("entry",e),e.emittedEnd||(e.on("end",o=>this[h_]()),r=!1)):(this[qf]=null,r=!1),r}[h_](){do;while(this[JAe](this[jf].shift()));if(!this[jf].length){let e=this[qf];!e||e.flowing||e.size===e.remain?this[h2]||this.emit("drain"):e.once("drain",o=>this.emit("drain"))}}[g_](e,r){let o=this[_g],a=o.blockRemain,n=a>=e.length&&r===0?e:e.slice(r,r+a);return o.write(n),o.blockRemain||(this[$l]="header",this[_g]=null,o.end()),n.length}[$Ae](e,r){let o=this[_g],a=this[g_](e,r);return this[_g]||this[XAe](o),a}[qg](e,r,o){!this[jf].length&&!this[qf]?this.emit(e,r,o):this[jf].push([e,r,o])}[XAe](e){switch(this[qg]("meta",this[Dh]),e.type){case"ExtendedHeader":case"OldExtendedHeader":this[ec]=zAe.parse(this[Dh],this[ec],!1);break;case"GlobalExtendedHeader":this[p2]=zAe.parse(this[Dh],this[p2],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":this[ec]=this[ec]||Object.create(null),this[ec].path=this[Dh].replace(/\0.*/,"");break;case"NextFileHasLongLinkpath":this[ec]=this[ec]||Object.create(null),this[ec].linkpath=this[Dh].replace(/\0.*/,"");break;default:throw new Error("unknown meta: "+e.type)}}abort(e){this[Ph]=!0,this.emit("abort",e),this.warn("TAR_ABORT",e,{recoverable:!1})}write(e){if(this[Ph])return;if(this[La]===null&&e){if(this[yi]&&(e=Buffer.concat([this[yi],e]),this[yi]=null),e.lengththis[ok](n)),this[La].on("error",n=>this.abort(n)),this[La].on("end",n=>{this[Hg]=!0,this[ok]()}),this[h2]=!0;let a=this[La][o?"end":"write"](e);return this[h2]=!1,a}}this[h2]=!0,this[La]?this[La].write(e):this[ok](e),this[h2]=!1;let r=this[jf].length?!1:this[qf]?this[qf].flowing:!0;return!r&&!this[jf].length&&this[qf].once("drain",o=>this.emit("drain")),r}[d_](e){e&&!this[Ph]&&(this[yi]=this[yi]?Buffer.concat([this[yi],e]):e)}[m_](){if(this[Hg]&&!this[ZAe]&&!this[Ph]&&!this[lk]){this[ZAe]=!0;let e=this[_g];if(e&&e.blockRemain){let r=this[yi]?this[yi].length:0;this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${e.blockRemain} more bytes, only ${r} available)`,{entry:e}),this[yi]&&e.write(this[yi]),e.end()}this[qg](ck)}}[ok](e){if(this[lk])this[d_](e);else if(!e&&!this[yi])this[m_]();else{if(this[lk]=!0,this[yi]){this[d_](e);let r=this[yi];this[yi]=null,this[ak](r)}else this[ak](e);for(;this[yi]&&this[yi].length>=512&&!this[Ph]&&!this[Ak];){let r=this[yi];this[yi]=null,this[ak](r)}this[lk]=!1}(!this[yi]||this[Hg])&&this[m_]()}[ak](e){let r=0,o=e.length;for(;r+512<=o&&!this[Ph]&&!this[Ak];)switch(this[$l]){case"begin":case"header":this[efe](e,r),r+=512;break;case"ignore":case"body":r+=this[g_](e,r);break;case"meta":r+=this[$Ae](e,r);break;default:throw new Error("invalid state: "+this[$l])}r{"use strict";var wlt=Fy(),nfe=fk(),Jy=ve("fs"),Blt=zy(),rfe=ve("path"),y_=_y();sfe.exports=(t,e,r)=>{typeof t=="function"?(r=t,e=null,t={}):Array.isArray(t)&&(e=t,t={}),typeof e=="function"&&(r=e,e=null),e?e=Array.from(e):e=[];let o=wlt(t);if(o.sync&&typeof r=="function")throw new TypeError("callback not supported for sync tar functions");if(!o.file&&typeof r=="function")throw new TypeError("callback only supported with file option");return e.length&&Dlt(o,e),o.noResume||vlt(o),o.file&&o.sync?Plt(o):o.file?Slt(o,r):ife(o)};var vlt=t=>{let e=t.onentry;t.onentry=e?r=>{e(r),r.resume()}:r=>r.resume()},Dlt=(t,e)=>{let r=new Map(e.map(n=>[y_(n),!0])),o=t.filter,a=(n,u)=>{let A=u||rfe.parse(n).root||".",p=n===A?!1:r.has(n)?r.get(n):a(rfe.dirname(n),A);return r.set(n,p),p};t.filter=o?(n,u)=>o(n,u)&&a(y_(n)):n=>a(y_(n))},Plt=t=>{let e=ife(t),r=t.file,o=!0,a;try{let n=Jy.statSync(r),u=t.maxReadSize||16*1024*1024;if(n.size{let r=new nfe(t),o=t.maxReadSize||16*1024*1024,a=t.file,n=new Promise((u,A)=>{r.on("error",A),r.on("end",u),Jy.stat(a,(p,h)=>{if(p)A(p);else{let E=new Blt.ReadStream(a,{readSize:o,size:h.size});E.on("error",A),E.pipe(r)}})});return e?n.then(e,e):n},ife=t=>new nfe(t)});var Afe=_((Y4t,ufe)=>{"use strict";var xlt=Fy(),hk=Zb(),ofe=zy(),afe=pk(),lfe=ve("path");ufe.exports=(t,e,r)=>{if(typeof e=="function"&&(r=e),Array.isArray(t)&&(e=t,t={}),!e||!Array.isArray(e)||!e.length)throw new TypeError("no files or directories specified");e=Array.from(e);let o=xlt(t);if(o.sync&&typeof r=="function")throw new TypeError("callback not supported for sync tar functions");if(!o.file&&typeof r=="function")throw new TypeError("callback only supported with file option");return o.file&&o.sync?blt(o,e):o.file?klt(o,e,r):o.sync?Qlt(o,e):Flt(o,e)};var blt=(t,e)=>{let r=new hk.Sync(t),o=new ofe.WriteStreamSync(t.file,{mode:t.mode||438});r.pipe(o),cfe(r,e)},klt=(t,e,r)=>{let o=new hk(t),a=new ofe.WriteStream(t.file,{mode:t.mode||438});o.pipe(a);let n=new Promise((u,A)=>{a.on("error",A),a.on("close",u),o.on("error",A)});return E_(o,e),r?n.then(r,r):n},cfe=(t,e)=>{e.forEach(r=>{r.charAt(0)==="@"?afe({file:lfe.resolve(t.cwd,r.substr(1)),sync:!0,noResume:!0,onentry:o=>t.add(o)}):t.add(r)}),t.end()},E_=(t,e)=>{for(;e.length;){let r=e.shift();if(r.charAt(0)==="@")return afe({file:lfe.resolve(t.cwd,r.substr(1)),noResume:!0,onentry:o=>t.add(o)}).then(o=>E_(t,e));t.add(r)}t.end()},Qlt=(t,e)=>{let r=new hk.Sync(t);return cfe(r,e),r},Flt=(t,e)=>{let r=new hk(t);return E_(r,e),r}});var C_=_((K4t,yfe)=>{"use strict";var Rlt=Fy(),ffe=Zb(),dl=ve("fs"),pfe=zy(),hfe=pk(),gfe=ve("path"),dfe=Uy();yfe.exports=(t,e,r)=>{let o=Rlt(t);if(!o.file)throw new TypeError("file is required");if(o.gzip)throw new TypeError("cannot append to compressed archives");if(!e||!Array.isArray(e)||!e.length)throw new TypeError("no files or directories specified");return e=Array.from(e),o.sync?Tlt(o,e):Nlt(o,e,r)};var Tlt=(t,e)=>{let r=new ffe.Sync(t),o=!0,a,n;try{try{a=dl.openSync(t.file,"r+")}catch(p){if(p.code==="ENOENT")a=dl.openSync(t.file,"w+");else throw p}let u=dl.fstatSync(a),A=Buffer.alloc(512);e:for(n=0;nu.size)break;n+=h,t.mtimeCache&&t.mtimeCache.set(p.path,p.mtime)}o=!1,Llt(t,r,n,a,e)}finally{if(o)try{dl.closeSync(a)}catch{}}},Llt=(t,e,r,o,a)=>{let n=new pfe.WriteStreamSync(t.file,{fd:o,start:r});e.pipe(n),Olt(e,a)},Nlt=(t,e,r)=>{e=Array.from(e);let o=new ffe(t),a=(u,A,p)=>{let h=(C,T)=>{C?dl.close(u,N=>p(C)):p(null,T)},E=0;if(A===0)return h(null,0);let w=0,D=Buffer.alloc(512),b=(C,T)=>{if(C)return h(C);if(w+=T,w<512&&T)return dl.read(u,D,w,D.length-w,E+w,b);if(E===0&&D[0]===31&&D[1]===139)return h(new Error("cannot append to compressed archives"));if(w<512)return h(null,E);let N=new dfe(D);if(!N.cksumValid)return h(null,E);let U=512*Math.ceil(N.size/512);if(E+U+512>A||(E+=U+512,E>=A))return h(null,E);t.mtimeCache&&t.mtimeCache.set(N.path,N.mtime),w=0,dl.read(u,D,0,512,E,b)};dl.read(u,D,0,512,E,b)},n=new Promise((u,A)=>{o.on("error",A);let p="r+",h=(E,w)=>{if(E&&E.code==="ENOENT"&&p==="r+")return p="w+",dl.open(t.file,p,h);if(E)return A(E);dl.fstat(w,(D,b)=>{if(D)return dl.close(w,()=>A(D));a(w,b.size,(C,T)=>{if(C)return A(C);let N=new pfe.WriteStream(t.file,{fd:w,start:T});o.pipe(N),N.on("error",A),N.on("close",u),mfe(o,e)})})};dl.open(t.file,p,h)});return r?n.then(r,r):n},Olt=(t,e)=>{e.forEach(r=>{r.charAt(0)==="@"?hfe({file:gfe.resolve(t.cwd,r.substr(1)),sync:!0,noResume:!0,onentry:o=>t.add(o)}):t.add(r)}),t.end()},mfe=(t,e)=>{for(;e.length;){let r=e.shift();if(r.charAt(0)==="@")return hfe({file:gfe.resolve(t.cwd,r.substr(1)),noResume:!0,onentry:o=>t.add(o)}).then(o=>mfe(t,e));t.add(r)}t.end()}});var Cfe=_((V4t,Efe)=>{"use strict";var Mlt=Fy(),Ult=C_();Efe.exports=(t,e,r)=>{let o=Mlt(t);if(!o.file)throw new TypeError("file is required");if(o.gzip)throw new TypeError("cannot append to compressed archives");if(!e||!Array.isArray(e)||!e.length)throw new TypeError("no files or directories specified");return e=Array.from(e),_lt(o),Ult(o,e,r)};var _lt=t=>{let e=t.filter;t.mtimeCache||(t.mtimeCache=new Map),t.filter=e?(r,o)=>e(r,o)&&!(t.mtimeCache.get(r)>o.mtime):(r,o)=>!(t.mtimeCache.get(r)>o.mtime)}});var Bfe=_((z4t,wfe)=>{var{promisify:Ife}=ve("util"),Sh=ve("fs"),Hlt=t=>{if(!t)t={mode:511,fs:Sh};else if(typeof t=="object")t={mode:511,fs:Sh,...t};else if(typeof t=="number")t={mode:t,fs:Sh};else if(typeof t=="string")t={mode:parseInt(t,8),fs:Sh};else throw new TypeError("invalid options argument");return t.mkdir=t.mkdir||t.fs.mkdir||Sh.mkdir,t.mkdirAsync=Ife(t.mkdir),t.stat=t.stat||t.fs.stat||Sh.stat,t.statAsync=Ife(t.stat),t.statSync=t.statSync||t.fs.statSync||Sh.statSync,t.mkdirSync=t.mkdirSync||t.fs.mkdirSync||Sh.mkdirSync,t};wfe.exports=Hlt});var Dfe=_((J4t,vfe)=>{var qlt=process.platform,{resolve:jlt,parse:Glt}=ve("path"),Wlt=t=>{if(/\0/.test(t))throw Object.assign(new TypeError("path must be a string without null bytes"),{path:t,code:"ERR_INVALID_ARG_VALUE"});if(t=jlt(t),qlt==="win32"){let e=/[*|"<>?:]/,{root:r}=Glt(t);if(e.test(t.substr(r.length)))throw Object.assign(new Error("Illegal characters in path."),{path:t,code:"EINVAL"})}return t};vfe.exports=Wlt});var kfe=_((X4t,bfe)=>{var{dirname:Pfe}=ve("path"),Sfe=(t,e,r=void 0)=>r===e?Promise.resolve():t.statAsync(e).then(o=>o.isDirectory()?r:void 0,o=>o.code==="ENOENT"?Sfe(t,Pfe(e),e):void 0),xfe=(t,e,r=void 0)=>{if(r!==e)try{return t.statSync(e).isDirectory()?r:void 0}catch(o){return o.code==="ENOENT"?xfe(t,Pfe(e),e):void 0}};bfe.exports={findMade:Sfe,findMadeSync:xfe}});var B_=_((Z4t,Ffe)=>{var{dirname:Qfe}=ve("path"),I_=(t,e,r)=>{e.recursive=!1;let o=Qfe(t);return o===t?e.mkdirAsync(t,e).catch(a=>{if(a.code!=="EISDIR")throw a}):e.mkdirAsync(t,e).then(()=>r||t,a=>{if(a.code==="ENOENT")return I_(o,e).then(n=>I_(t,e,n));if(a.code!=="EEXIST"&&a.code!=="EROFS")throw a;return e.statAsync(t).then(n=>{if(n.isDirectory())return r;throw a},()=>{throw a})})},w_=(t,e,r)=>{let o=Qfe(t);if(e.recursive=!1,o===t)try{return e.mkdirSync(t,e)}catch(a){if(a.code!=="EISDIR")throw a;return}try{return e.mkdirSync(t,e),r||t}catch(a){if(a.code==="ENOENT")return w_(t,e,w_(o,e,r));if(a.code!=="EEXIST"&&a.code!=="EROFS")throw a;try{if(!e.statSync(t).isDirectory())throw a}catch{throw a}}};Ffe.exports={mkdirpManual:I_,mkdirpManualSync:w_}});var Lfe=_(($4t,Tfe)=>{var{dirname:Rfe}=ve("path"),{findMade:Ylt,findMadeSync:Klt}=kfe(),{mkdirpManual:Vlt,mkdirpManualSync:zlt}=B_(),Jlt=(t,e)=>(e.recursive=!0,Rfe(t)===t?e.mkdirAsync(t,e):Ylt(e,t).then(o=>e.mkdirAsync(t,e).then(()=>o).catch(a=>{if(a.code==="ENOENT")return Vlt(t,e);throw a}))),Xlt=(t,e)=>{if(e.recursive=!0,Rfe(t)===t)return e.mkdirSync(t,e);let o=Klt(e,t);try{return e.mkdirSync(t,e),o}catch(a){if(a.code==="ENOENT")return zlt(t,e);throw a}};Tfe.exports={mkdirpNative:Jlt,mkdirpNativeSync:Xlt}});var Ufe=_((eUt,Mfe)=>{var Nfe=ve("fs"),Zlt=process.version,v_=Zlt.replace(/^v/,"").split("."),Ofe=+v_[0]>10||+v_[0]==10&&+v_[1]>=12,$lt=Ofe?t=>t.mkdir===Nfe.mkdir:()=>!1,ect=Ofe?t=>t.mkdirSync===Nfe.mkdirSync:()=>!1;Mfe.exports={useNative:$lt,useNativeSync:ect}});var Wfe=_((tUt,Gfe)=>{var Xy=Bfe(),Zy=Dfe(),{mkdirpNative:_fe,mkdirpNativeSync:Hfe}=Lfe(),{mkdirpManual:qfe,mkdirpManualSync:jfe}=B_(),{useNative:tct,useNativeSync:rct}=Ufe(),$y=(t,e)=>(t=Zy(t),e=Xy(e),tct(e)?_fe(t,e):qfe(t,e)),nct=(t,e)=>(t=Zy(t),e=Xy(e),rct(e)?Hfe(t,e):jfe(t,e));$y.sync=nct;$y.native=(t,e)=>_fe(Zy(t),Xy(e));$y.manual=(t,e)=>qfe(Zy(t),Xy(e));$y.nativeSync=(t,e)=>Hfe(Zy(t),Xy(e));$y.manualSync=(t,e)=>jfe(Zy(t),Xy(e));Gfe.exports=$y});var Zfe=_((rUt,Xfe)=>{"use strict";var tc=ve("fs"),Gg=ve("path"),ict=tc.lchown?"lchown":"chown",sct=tc.lchownSync?"lchownSync":"chownSync",Kfe=tc.lchown&&!process.version.match(/v1[1-9]+\./)&&!process.version.match(/v10\.[6-9]/),Yfe=(t,e,r)=>{try{return tc[sct](t,e,r)}catch(o){if(o.code!=="ENOENT")throw o}},oct=(t,e,r)=>{try{return tc.chownSync(t,e,r)}catch(o){if(o.code!=="ENOENT")throw o}},act=Kfe?(t,e,r,o)=>a=>{!a||a.code!=="EISDIR"?o(a):tc.chown(t,e,r,o)}:(t,e,r,o)=>o,D_=Kfe?(t,e,r)=>{try{return Yfe(t,e,r)}catch(o){if(o.code!=="EISDIR")throw o;oct(t,e,r)}}:(t,e,r)=>Yfe(t,e,r),lct=process.version,Vfe=(t,e,r)=>tc.readdir(t,e,r),cct=(t,e)=>tc.readdirSync(t,e);/^v4\./.test(lct)&&(Vfe=(t,e,r)=>tc.readdir(t,r));var gk=(t,e,r,o)=>{tc[ict](t,e,r,act(t,e,r,a=>{o(a&&a.code!=="ENOENT"?a:null)}))},zfe=(t,e,r,o,a)=>{if(typeof e=="string")return tc.lstat(Gg.resolve(t,e),(n,u)=>{if(n)return a(n.code!=="ENOENT"?n:null);u.name=e,zfe(t,u,r,o,a)});if(e.isDirectory())P_(Gg.resolve(t,e.name),r,o,n=>{if(n)return a(n);let u=Gg.resolve(t,e.name);gk(u,r,o,a)});else{let n=Gg.resolve(t,e.name);gk(n,r,o,a)}},P_=(t,e,r,o)=>{Vfe(t,{withFileTypes:!0},(a,n)=>{if(a){if(a.code==="ENOENT")return o();if(a.code!=="ENOTDIR"&&a.code!=="ENOTSUP")return o(a)}if(a||!n.length)return gk(t,e,r,o);let u=n.length,A=null,p=h=>{if(!A){if(h)return o(A=h);if(--u===0)return gk(t,e,r,o)}};n.forEach(h=>zfe(t,h,e,r,p))})},uct=(t,e,r,o)=>{if(typeof e=="string")try{let a=tc.lstatSync(Gg.resolve(t,e));a.name=e,e=a}catch(a){if(a.code==="ENOENT")return;throw a}e.isDirectory()&&Jfe(Gg.resolve(t,e.name),r,o),D_(Gg.resolve(t,e.name),r,o)},Jfe=(t,e,r)=>{let o;try{o=cct(t,{withFileTypes:!0})}catch(a){if(a.code==="ENOENT")return;if(a.code==="ENOTDIR"||a.code==="ENOTSUP")return D_(t,e,r);throw a}return o&&o.length&&o.forEach(a=>uct(t,a,e,r)),D_(t,e,r)};Xfe.exports=P_;P_.sync=Jfe});var rpe=_((nUt,S_)=>{"use strict";var $fe=Wfe(),rc=ve("fs"),dk=ve("path"),epe=Zfe(),$c=Oy(),mk=class extends Error{constructor(e,r){super("Cannot extract through symbolic link"),this.path=r,this.symlink=e}get name(){return"SylinkError"}},yk=class extends Error{constructor(e,r){super(r+": Cannot cd into '"+e+"'"),this.path=e,this.code=r}get name(){return"CwdError"}},Ek=(t,e)=>t.get($c(e)),g2=(t,e,r)=>t.set($c(e),r),Act=(t,e)=>{rc.stat(t,(r,o)=>{(r||!o.isDirectory())&&(r=new yk(t,r&&r.code||"ENOTDIR")),e(r)})};S_.exports=(t,e,r)=>{t=$c(t);let o=e.umask,a=e.mode|448,n=(a&o)!==0,u=e.uid,A=e.gid,p=typeof u=="number"&&typeof A=="number"&&(u!==e.processUid||A!==e.processGid),h=e.preserve,E=e.unlink,w=e.cache,D=$c(e.cwd),b=(N,U)=>{N?r(N):(g2(w,t,!0),U&&p?epe(U,u,A,z=>b(z)):n?rc.chmod(t,a,r):r())};if(w&&Ek(w,t)===!0)return b();if(t===D)return Act(t,b);if(h)return $fe(t,{mode:a}).then(N=>b(null,N),b);let T=$c(dk.relative(D,t)).split("/");Ck(D,T,a,w,E,D,null,b)};var Ck=(t,e,r,o,a,n,u,A)=>{if(!e.length)return A(null,u);let p=e.shift(),h=$c(dk.resolve(t+"/"+p));if(Ek(o,h))return Ck(h,e,r,o,a,n,u,A);rc.mkdir(h,r,tpe(h,e,r,o,a,n,u,A))},tpe=(t,e,r,o,a,n,u,A)=>p=>{p?rc.lstat(t,(h,E)=>{if(h)h.path=h.path&&$c(h.path),A(h);else if(E.isDirectory())Ck(t,e,r,o,a,n,u,A);else if(a)rc.unlink(t,w=>{if(w)return A(w);rc.mkdir(t,r,tpe(t,e,r,o,a,n,u,A))});else{if(E.isSymbolicLink())return A(new mk(t,t+"/"+e.join("/")));A(p)}}):(u=u||t,Ck(t,e,r,o,a,n,u,A))},fct=t=>{let e=!1,r="ENOTDIR";try{e=rc.statSync(t).isDirectory()}catch(o){r=o.code}finally{if(!e)throw new yk(t,r)}};S_.exports.sync=(t,e)=>{t=$c(t);let r=e.umask,o=e.mode|448,a=(o&r)!==0,n=e.uid,u=e.gid,A=typeof n=="number"&&typeof u=="number"&&(n!==e.processUid||u!==e.processGid),p=e.preserve,h=e.unlink,E=e.cache,w=$c(e.cwd),D=N=>{g2(E,t,!0),N&&A&&epe.sync(N,n,u),a&&rc.chmodSync(t,o)};if(E&&Ek(E,t)===!0)return D();if(t===w)return fct(w),D();if(p)return D($fe.sync(t,o));let C=$c(dk.relative(w,t)).split("/"),T=null;for(let N=C.shift(),U=w;N&&(U+="/"+N);N=C.shift())if(U=$c(dk.resolve(U)),!Ek(E,U))try{rc.mkdirSync(U,o),T=T||U,g2(E,U,!0)}catch{let te=rc.lstatSync(U);if(te.isDirectory()){g2(E,U,!0);continue}else if(h){rc.unlinkSync(U),rc.mkdirSync(U,o),T=T||U,g2(E,U,!0);continue}else if(te.isSymbolicLink())return new mk(U,U+"/"+C.join("/"))}return D(T)}});var b_=_((iUt,npe)=>{var x_=Object.create(null),{hasOwnProperty:pct}=Object.prototype;npe.exports=t=>(pct.call(x_,t)||(x_[t]=t.normalize("NFKD")),x_[t])});var ape=_((sUt,ope)=>{var ipe=ve("assert"),hct=b_(),gct=_y(),{join:spe}=ve("path"),dct=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,mct=dct==="win32";ope.exports=()=>{let t=new Map,e=new Map,r=h=>h.split("/").slice(0,-1).reduce((w,D)=>(w.length&&(D=spe(w[w.length-1],D)),w.push(D||"/"),w),[]),o=new Set,a=h=>{let E=e.get(h);if(!E)throw new Error("function does not have any path reservations");return{paths:E.paths.map(w=>t.get(w)),dirs:[...E.dirs].map(w=>t.get(w))}},n=h=>{let{paths:E,dirs:w}=a(h);return E.every(D=>D[0]===h)&&w.every(D=>D[0]instanceof Set&&D[0].has(h))},u=h=>o.has(h)||!n(h)?!1:(o.add(h),h(()=>A(h)),!0),A=h=>{if(!o.has(h))return!1;let{paths:E,dirs:w}=e.get(h),D=new Set;return E.forEach(b=>{let C=t.get(b);ipe.equal(C[0],h),C.length===1?t.delete(b):(C.shift(),typeof C[0]=="function"?D.add(C[0]):C[0].forEach(T=>D.add(T)))}),w.forEach(b=>{let C=t.get(b);ipe(C[0]instanceof Set),C[0].size===1&&C.length===1?t.delete(b):C[0].size===1?(C.shift(),D.add(C[0])):C[0].delete(h)}),o.delete(h),D.forEach(b=>u(b)),!0};return{check:n,reserve:(h,E)=>{h=mct?["win32 parallelization disabled"]:h.map(D=>hct(gct(spe(D))).toLowerCase());let w=new Set(h.map(D=>r(D)).reduce((D,b)=>D.concat(b)));return e.set(E,{dirs:w,paths:h}),h.forEach(D=>{let b=t.get(D);b?b.push(E):t.set(D,[E])}),w.forEach(D=>{let b=t.get(D);b?b[b.length-1]instanceof Set?b[b.length-1].add(E):b.push(new Set([E])):t.set(D,[new Set([E])])}),u(E)}}}});var upe=_((oUt,cpe)=>{var yct=process.platform,Ect=yct==="win32",Cct=global.__FAKE_TESTING_FS__||ve("fs"),{O_CREAT:Ict,O_TRUNC:wct,O_WRONLY:Bct,UV_FS_O_FILEMAP:lpe=0}=Cct.constants,vct=Ect&&!!lpe,Dct=512*1024,Pct=lpe|wct|Ict|Bct;cpe.exports=vct?t=>t"w"});var M_=_((aUt,vpe)=>{"use strict";var Sct=ve("assert"),xct=fk(),Fn=ve("fs"),bct=zy(),Gf=ve("path"),Ipe=rpe(),Ape=M3(),kct=ape(),Qct=U3(),ml=Oy(),Fct=_y(),Rct=b_(),fpe=Symbol("onEntry"),F_=Symbol("checkFs"),ppe=Symbol("checkFs2"),Bk=Symbol("pruneCache"),R_=Symbol("isReusable"),nc=Symbol("makeFs"),T_=Symbol("file"),L_=Symbol("directory"),vk=Symbol("link"),hpe=Symbol("symlink"),gpe=Symbol("hardlink"),dpe=Symbol("unsupported"),mpe=Symbol("checkPath"),xh=Symbol("mkdir"),So=Symbol("onError"),Ik=Symbol("pending"),ype=Symbol("pend"),eE=Symbol("unpend"),k_=Symbol("ended"),Q_=Symbol("maybeClose"),N_=Symbol("skip"),d2=Symbol("doChown"),m2=Symbol("uid"),y2=Symbol("gid"),E2=Symbol("checkedCwd"),wpe=ve("crypto"),Bpe=upe(),Tct=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,C2=Tct==="win32",Lct=(t,e)=>{if(!C2)return Fn.unlink(t,e);let r=t+".DELETE."+wpe.randomBytes(16).toString("hex");Fn.rename(t,r,o=>{if(o)return e(o);Fn.unlink(r,e)})},Nct=t=>{if(!C2)return Fn.unlinkSync(t);let e=t+".DELETE."+wpe.randomBytes(16).toString("hex");Fn.renameSync(t,e),Fn.unlinkSync(e)},Epe=(t,e,r)=>t===t>>>0?t:e===e>>>0?e:r,Cpe=t=>Rct(Fct(ml(t))).toLowerCase(),Oct=(t,e)=>{e=Cpe(e);for(let r of t.keys()){let o=Cpe(r);(o===e||o.indexOf(e+"/")===0)&&t.delete(r)}},Mct=t=>{for(let e of t.keys())t.delete(e)},I2=class extends xct{constructor(e){if(e||(e={}),e.ondone=r=>{this[k_]=!0,this[Q_]()},super(e),this[E2]=!1,this.reservations=kct(),this.transform=typeof e.transform=="function"?e.transform:null,this.writable=!0,this.readable=!1,this[Ik]=0,this[k_]=!1,this.dirCache=e.dirCache||new Map,typeof e.uid=="number"||typeof e.gid=="number"){if(typeof e.uid!="number"||typeof e.gid!="number")throw new TypeError("cannot set owner without number uid and gid");if(e.preserveOwner)throw new TypeError("cannot preserve owner in archive and also set owner explicitly");this.uid=e.uid,this.gid=e.gid,this.setOwner=!0}else this.uid=null,this.gid=null,this.setOwner=!1;e.preserveOwner===void 0&&typeof e.uid!="number"?this.preserveOwner=process.getuid&&process.getuid()===0:this.preserveOwner=!!e.preserveOwner,this.processUid=(this.preserveOwner||this.setOwner)&&process.getuid?process.getuid():null,this.processGid=(this.preserveOwner||this.setOwner)&&process.getgid?process.getgid():null,this.forceChown=e.forceChown===!0,this.win32=!!e.win32||C2,this.newer=!!e.newer,this.keep=!!e.keep,this.noMtime=!!e.noMtime,this.preservePaths=!!e.preservePaths,this.unlink=!!e.unlink,this.cwd=ml(Gf.resolve(e.cwd||process.cwd())),this.strip=+e.strip||0,this.processUmask=e.noChmod?0:process.umask(),this.umask=typeof e.umask=="number"?e.umask:this.processUmask,this.dmode=e.dmode||511&~this.umask,this.fmode=e.fmode||438&~this.umask,this.on("entry",r=>this[fpe](r))}warn(e,r,o={}){return(e==="TAR_BAD_ARCHIVE"||e==="TAR_ABORT")&&(o.recoverable=!1),super.warn(e,r,o)}[Q_](){this[k_]&&this[Ik]===0&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"),this.emit("close"))}[mpe](e){if(this.strip){let r=ml(e.path).split("/");if(r.length=this.strip)e.linkpath=o.slice(this.strip).join("/");else return!1}}if(!this.preservePaths){let r=ml(e.path),o=r.split("/");if(o.includes("..")||C2&&/^[a-z]:\.\.$/i.test(o[0]))return this.warn("TAR_ENTRY_ERROR","path contains '..'",{entry:e,path:r}),!1;let[a,n]=Qct(r);a&&(e.path=n,this.warn("TAR_ENTRY_INFO",`stripping ${a} from absolute path`,{entry:e,path:r}))}if(Gf.isAbsolute(e.path)?e.absolute=ml(Gf.resolve(e.path)):e.absolute=ml(Gf.resolve(this.cwd,e.path)),!this.preservePaths&&e.absolute.indexOf(this.cwd+"/")!==0&&e.absolute!==this.cwd)return this.warn("TAR_ENTRY_ERROR","path escaped extraction target",{entry:e,path:ml(e.path),resolvedPath:e.absolute,cwd:this.cwd}),!1;if(e.absolute===this.cwd&&e.type!=="Directory"&&e.type!=="GNUDumpDir")return!1;if(this.win32){let{root:r}=Gf.win32.parse(e.absolute);e.absolute=r+Ape.encode(e.absolute.substr(r.length));let{root:o}=Gf.win32.parse(e.path);e.path=o+Ape.encode(e.path.substr(o.length))}return!0}[fpe](e){if(!this[mpe](e))return e.resume();switch(Sct.equal(typeof e.absolute,"string"),e.type){case"Directory":case"GNUDumpDir":e.mode&&(e.mode=e.mode|448);case"File":case"OldFile":case"ContiguousFile":case"Link":case"SymbolicLink":return this[F_](e);case"CharacterDevice":case"BlockDevice":case"FIFO":default:return this[dpe](e)}}[So](e,r){e.name==="CwdError"?this.emit("error",e):(this.warn("TAR_ENTRY_ERROR",e,{entry:r}),this[eE](),r.resume())}[xh](e,r,o){Ipe(ml(e),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:r,noChmod:this.noChmod},o)}[d2](e){return this.forceChown||this.preserveOwner&&(typeof e.uid=="number"&&e.uid!==this.processUid||typeof e.gid=="number"&&e.gid!==this.processGid)||typeof this.uid=="number"&&this.uid!==this.processUid||typeof this.gid=="number"&&this.gid!==this.processGid}[m2](e){return Epe(this.uid,e.uid,this.processUid)}[y2](e){return Epe(this.gid,e.gid,this.processGid)}[T_](e,r){let o=e.mode&4095||this.fmode,a=new bct.WriteStream(e.absolute,{flags:Bpe(e.size),mode:o,autoClose:!1});a.on("error",p=>{a.fd&&Fn.close(a.fd,()=>{}),a.write=()=>!0,this[So](p,e),r()});let n=1,u=p=>{if(p){a.fd&&Fn.close(a.fd,()=>{}),this[So](p,e),r();return}--n===0&&Fn.close(a.fd,h=>{h?this[So](h,e):this[eE](),r()})};a.on("finish",p=>{let h=e.absolute,E=a.fd;if(e.mtime&&!this.noMtime){n++;let w=e.atime||new Date,D=e.mtime;Fn.futimes(E,w,D,b=>b?Fn.utimes(h,w,D,C=>u(C&&b)):u())}if(this[d2](e)){n++;let w=this[m2](e),D=this[y2](e);Fn.fchown(E,w,D,b=>b?Fn.chown(h,w,D,C=>u(C&&b)):u())}u()});let A=this.transform&&this.transform(e)||e;A!==e&&(A.on("error",p=>{this[So](p,e),r()}),e.pipe(A)),A.pipe(a)}[L_](e,r){let o=e.mode&4095||this.dmode;this[xh](e.absolute,o,a=>{if(a){this[So](a,e),r();return}let n=1,u=A=>{--n===0&&(r(),this[eE](),e.resume())};e.mtime&&!this.noMtime&&(n++,Fn.utimes(e.absolute,e.atime||new Date,e.mtime,u)),this[d2](e)&&(n++,Fn.chown(e.absolute,this[m2](e),this[y2](e),u)),u()})}[dpe](e){e.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${e.type}`,{entry:e}),e.resume()}[hpe](e,r){this[vk](e,e.linkpath,"symlink",r)}[gpe](e,r){let o=ml(Gf.resolve(this.cwd,e.linkpath));this[vk](e,o,"link",r)}[ype](){this[Ik]++}[eE](){this[Ik]--,this[Q_]()}[N_](e){this[eE](),e.resume()}[R_](e,r){return e.type==="File"&&!this.unlink&&r.isFile()&&r.nlink<=1&&!C2}[F_](e){this[ype]();let r=[e.path];e.linkpath&&r.push(e.linkpath),this.reservations.reserve(r,o=>this[ppe](e,o))}[Bk](e){e.type==="SymbolicLink"?Mct(this.dirCache):e.type!=="Directory"&&Oct(this.dirCache,e.absolute)}[ppe](e,r){this[Bk](e);let o=A=>{this[Bk](e),r(A)},a=()=>{this[xh](this.cwd,this.dmode,A=>{if(A){this[So](A,e),o();return}this[E2]=!0,n()})},n=()=>{if(e.absolute!==this.cwd){let A=ml(Gf.dirname(e.absolute));if(A!==this.cwd)return this[xh](A,this.dmode,p=>{if(p){this[So](p,e),o();return}u()})}u()},u=()=>{Fn.lstat(e.absolute,(A,p)=>{if(p&&(this.keep||this.newer&&p.mtime>e.mtime)){this[N_](e),o();return}if(A||this[R_](e,p))return this[nc](null,e,o);if(p.isDirectory()){if(e.type==="Directory"){let h=!this.noChmod&&e.mode&&(p.mode&4095)!==e.mode,E=w=>this[nc](w,e,o);return h?Fn.chmod(e.absolute,e.mode,E):E()}if(e.absolute!==this.cwd)return Fn.rmdir(e.absolute,h=>this[nc](h,e,o))}if(e.absolute===this.cwd)return this[nc](null,e,o);Lct(e.absolute,h=>this[nc](h,e,o))})};this[E2]?n():a()}[nc](e,r,o){if(e){this[So](e,r),o();return}switch(r.type){case"File":case"OldFile":case"ContiguousFile":return this[T_](r,o);case"Link":return this[gpe](r,o);case"SymbolicLink":return this[hpe](r,o);case"Directory":case"GNUDumpDir":return this[L_](r,o)}}[vk](e,r,o,a){Fn[o](r,e.absolute,n=>{n?this[So](n,e):(this[eE](),e.resume()),a()})}},wk=t=>{try{return[null,t()]}catch(e){return[e,null]}},O_=class extends I2{[nc](e,r){return super[nc](e,r,()=>{})}[F_](e){if(this[Bk](e),!this[E2]){let n=this[xh](this.cwd,this.dmode);if(n)return this[So](n,e);this[E2]=!0}if(e.absolute!==this.cwd){let n=ml(Gf.dirname(e.absolute));if(n!==this.cwd){let u=this[xh](n,this.dmode);if(u)return this[So](u,e)}}let[r,o]=wk(()=>Fn.lstatSync(e.absolute));if(o&&(this.keep||this.newer&&o.mtime>e.mtime))return this[N_](e);if(r||this[R_](e,o))return this[nc](null,e);if(o.isDirectory()){if(e.type==="Directory"){let u=!this.noChmod&&e.mode&&(o.mode&4095)!==e.mode,[A]=u?wk(()=>{Fn.chmodSync(e.absolute,e.mode)}):[];return this[nc](A,e)}let[n]=wk(()=>Fn.rmdirSync(e.absolute));this[nc](n,e)}let[a]=e.absolute===this.cwd?[]:wk(()=>Nct(e.absolute));this[nc](a,e)}[T_](e,r){let o=e.mode&4095||this.fmode,a=A=>{let p;try{Fn.closeSync(n)}catch(h){p=h}(A||p)&&this[So](A||p,e),r()},n;try{n=Fn.openSync(e.absolute,Bpe(e.size),o)}catch(A){return a(A)}let u=this.transform&&this.transform(e)||e;u!==e&&(u.on("error",A=>this[So](A,e)),e.pipe(u)),u.on("data",A=>{try{Fn.writeSync(n,A,0,A.length)}catch(p){a(p)}}),u.on("end",A=>{let p=null;if(e.mtime&&!this.noMtime){let h=e.atime||new Date,E=e.mtime;try{Fn.futimesSync(n,h,E)}catch(w){try{Fn.utimesSync(e.absolute,h,E)}catch{p=w}}}if(this[d2](e)){let h=this[m2](e),E=this[y2](e);try{Fn.fchownSync(n,h,E)}catch(w){try{Fn.chownSync(e.absolute,h,E)}catch{p=p||w}}}a(p)})}[L_](e,r){let o=e.mode&4095||this.dmode,a=this[xh](e.absolute,o);if(a){this[So](a,e),r();return}if(e.mtime&&!this.noMtime)try{Fn.utimesSync(e.absolute,e.atime||new Date,e.mtime)}catch{}if(this[d2](e))try{Fn.chownSync(e.absolute,this[m2](e),this[y2](e))}catch{}r(),e.resume()}[xh](e,r){try{return Ipe.sync(ml(e),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:r})}catch(o){return o}}[vk](e,r,o,a){try{Fn[o+"Sync"](r,e.absolute),a(),e.resume()}catch(n){return this[So](n,e)}}};I2.Sync=O_;vpe.exports=I2});var bpe=_((lUt,xpe)=>{"use strict";var Uct=Fy(),Dk=M_(),Ppe=ve("fs"),Spe=zy(),Dpe=ve("path"),U_=_y();xpe.exports=(t,e,r)=>{typeof t=="function"?(r=t,e=null,t={}):Array.isArray(t)&&(e=t,t={}),typeof e=="function"&&(r=e,e=null),e?e=Array.from(e):e=[];let o=Uct(t);if(o.sync&&typeof r=="function")throw new TypeError("callback not supported for sync tar functions");if(!o.file&&typeof r=="function")throw new TypeError("callback only supported with file option");return e.length&&_ct(o,e),o.file&&o.sync?Hct(o):o.file?qct(o,r):o.sync?jct(o):Gct(o)};var _ct=(t,e)=>{let r=new Map(e.map(n=>[U_(n),!0])),o=t.filter,a=(n,u)=>{let A=u||Dpe.parse(n).root||".",p=n===A?!1:r.has(n)?r.get(n):a(Dpe.dirname(n),A);return r.set(n,p),p};t.filter=o?(n,u)=>o(n,u)&&a(U_(n)):n=>a(U_(n))},Hct=t=>{let e=new Dk.Sync(t),r=t.file,o=Ppe.statSync(r),a=t.maxReadSize||16*1024*1024;new Spe.ReadStreamSync(r,{readSize:a,size:o.size}).pipe(e)},qct=(t,e)=>{let r=new Dk(t),o=t.maxReadSize||16*1024*1024,a=t.file,n=new Promise((u,A)=>{r.on("error",A),r.on("close",u),Ppe.stat(a,(p,h)=>{if(p)A(p);else{let E=new Spe.ReadStream(a,{readSize:o,size:h.size});E.on("error",A),E.pipe(r)}})});return e?n.then(e,e):n},jct=t=>new Dk.Sync(t),Gct=t=>new Dk(t)});var kpe=_(us=>{"use strict";us.c=us.create=Afe();us.r=us.replace=C_();us.t=us.list=pk();us.u=us.update=Cfe();us.x=us.extract=bpe();us.Pack=Zb();us.Unpack=M_();us.Parse=fk();us.ReadEntry=Lb();us.WriteEntry=z3();us.Header=Uy();us.Pax=Ob();us.types=Q3()});var __,Qpe,bh,w2,B2,Fpe=It(()=>{__=et(lg()),Qpe=ve("worker_threads"),bh=Symbol("kTaskInfo"),w2=class{constructor(e,r){this.fn=e;this.limit=(0,__.default)(r.poolSize)}run(e){return this.limit(()=>this.fn(e))}},B2=class{constructor(e,r){this.source=e;this.workers=[];this.limit=(0,__.default)(r.poolSize),this.cleanupInterval=setInterval(()=>{if(this.limit.pendingCount===0&&this.limit.activeCount===0){let o=this.workers.pop();o?o.terminate():clearInterval(this.cleanupInterval)}},5e3).unref()}createWorker(){this.cleanupInterval.refresh();let e=new Qpe.Worker(this.source,{eval:!0,execArgv:[...process.execArgv,"--unhandled-rejections=strict"]});return e.on("message",r=>{if(!e[bh])throw new Error("Assertion failed: Worker sent a result without having a task assigned");e[bh].resolve(r),e[bh]=null,e.unref(),this.workers.push(e)}),e.on("error",r=>{e[bh]?.reject(r),e[bh]=null}),e.on("exit",r=>{r!==0&&e[bh]?.reject(new Error(`Worker exited with code ${r}`)),e[bh]=null}),e}run(e){return this.limit(()=>{let r=this.workers.pop()??this.createWorker();return r.ref(),new Promise((o,a)=>{r[bh]={resolve:o,reject:a},r.postMessage(e)})})}}});var Tpe=_((fUt,Rpe)=>{var H_;Rpe.exports.getContent=()=>(typeof H_>"u"&&(H_=ve("zlib").brotliDecompressSync(Buffer.from("W2xFdgBPZrjSneDvVbLecg9fIhuy4cX6GuF9CJQpmu4RdNt2tSIi3YZAPJzO1Ju/O0dV1bTkYsgCLThVdbatry9HdhTU1geV2ROjsMltUFBZJKzSZoSLXaDMA7MJtfXUZJlq3aQXKbUKncLmJdo5ByJUTvhIXveNwEBNvBd2oxvnpn4bPkVdGHlvHI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VcB5Q77kcHip+GhH7XI7OkccRp+pmPGLEO+rClBNSOQPKAmqk3EnybUKU6B1VM1LLAiRDVdCYIuyWo/PLZObqTL99ogi6f8w/Zt+JAFgZSFW387WeqEM8p9GYlrcIyd82D0RMLeqwesdS7U98qUCoouJPlQdsbny6XsU5z7U7JayX135INNTzZCpTbjWP0QNh0G/3skJvN+cYv34bpM58zg/SZQzI5gnoxf2C4WovXcFlo4byite4FpF0/bz7zESslMfq4NsJ1gEGbwG3/8ay+/Wc4yOtz9x9xwHyQSqsGZY4GPWJ6XBfz/sNdaZR1lcxpjc3Ll2oC3/WJ+Xz6rmHxcdxZHpClKgqiWbmZEYBPnjRhytlL4kos67A6SfIUz6COPvWOS4hrSF8Wl/u19O54W+AkK56NnWmW5pmqY5TbHTgdClLDAg92AslKZcu4X3qsiluFx62lA5XZqgqDRo5YYWsqdyk9Vn0Y+5BFggcC5MZ4D5FEs0V4sEK8EA/wPcpDFlWMyvg8WKeNgWb7EbHbqR1d92dlSn0E8nRsdOo+z3J7tbSAC3f9e3SzDJB5xVXbt+Zq3ayiGJzf4KV4Mfkf","base64")).toString()),H_)});var $i={};Kt($i,{convertToZip:()=>Vct,convertToZipWorker:()=>G_,extractArchiveTo:()=>Upe,getDefaultTaskPool:()=>Ope,getTaskPoolForConfiguration:()=>Mpe,makeArchiveFromDirectory:()=>Kct});function Wct(t,e){switch(t){case"async":return new w2(G_,{poolSize:e});case"workers":return new B2((0,j_.getContent)(),{poolSize:e});default:throw new Error(`Assertion failed: Unknown value ${t} for taskPoolMode`)}}function Ope(){return typeof q_>"u"&&(q_=Wct("workers",Xi.availableParallelism())),q_}function Mpe(t){return typeof t>"u"?Ope():Al(Yct,t,()=>{let e=t.get("taskPoolMode"),r=t.get("taskPoolConcurrency");switch(e){case"async":return new w2(G_,{poolSize:r});case"workers":return new B2((0,j_.getContent)(),{poolSize:r});default:throw new Error(`Assertion failed: Unknown value ${e} for taskPoolMode`)}})}async function G_(t){let{tmpFile:e,tgz:r,compressionLevel:o,extractBufferOpts:a}=t,n=new Zi(e,{create:!0,level:o,stats:wa.makeDefaultStats()}),u=Buffer.from(r.buffer,r.byteOffset,r.byteLength);return await Upe(u,n,a),n.saveAndClose(),e}async function Kct(t,{baseFs:e=new _n,prefixPath:r=Bt.root,compressionLevel:o,inMemory:a=!1}={}){let n;if(a)n=new Zi(null,{level:o});else{let A=await ae.mktempPromise(),p=K.join(A,"archive.zip");n=new Zi(p,{create:!0,level:o})}let u=K.resolve(Bt.root,r);return await n.copyPromise(u,t,{baseFs:e,stableTime:!0,stableSort:!0}),n}async function Vct(t,e={}){let r=await ae.mktempPromise(),o=K.join(r,"archive.zip"),a=e.compressionLevel??e.configuration?.get("compressionLevel")??"mixed",n={prefixPath:e.prefixPath,stripComponents:e.stripComponents};return await(e.taskPool??Mpe(e.configuration)).run({tmpFile:o,tgz:t,compressionLevel:a,extractBufferOpts:n}),new Zi(o,{level:e.compressionLevel})}async function*zct(t){let e=new Npe.default.Parse,r=new Lpe.PassThrough({objectMode:!0,autoDestroy:!0,emitClose:!0});e.on("entry",o=>{r.write(o)}),e.on("error",o=>{r.destroy(o)}),e.on("close",()=>{r.destroyed||r.end()}),e.end(t);for await(let o of r){let a=o;yield a,a.resume()}}async function Upe(t,e,{stripComponents:r=0,prefixPath:o=Bt.dot}={}){function a(n){if(n.path[0]==="/")return!0;let u=n.path.split(/\//g);return!!(u.some(A=>A==="..")||u.length<=r)}for await(let n of zct(t)){if(a(n))continue;let u=K.normalize(Ae.toPortablePath(n.path)).replace(/\/$/,"").split(/\//g);if(u.length<=r)continue;let A=u.slice(r).join("/"),p=K.join(o,A),h=420;switch((n.type==="Directory"||(n.mode??0)&73)&&(h|=73),n.type){case"Directory":e.mkdirpSync(K.dirname(p),{chmod:493,utimes:[Pi.SAFE_TIME,Pi.SAFE_TIME]}),e.mkdirSync(p,{mode:h}),e.utimesSync(p,Pi.SAFE_TIME,Pi.SAFE_TIME);break;case"OldFile":case"File":e.mkdirpSync(K.dirname(p),{chmod:493,utimes:[Pi.SAFE_TIME,Pi.SAFE_TIME]}),e.writeFileSync(p,await Xm(n),{mode:h}),e.utimesSync(p,Pi.SAFE_TIME,Pi.SAFE_TIME);break;case"SymbolicLink":e.mkdirpSync(K.dirname(p),{chmod:493,utimes:[Pi.SAFE_TIME,Pi.SAFE_TIME]}),e.symlinkSync(n.linkpath,p),e.lutimesSync(p,Pi.SAFE_TIME,Pi.SAFE_TIME);break}}return e}var Lpe,Npe,j_,q_,Yct,_pe=It(()=>{Ke();Pt();sA();Lpe=ve("stream"),Npe=et(kpe());Fpe();Gl();j_=et(Tpe());Yct=new WeakMap});var qpe=_((W_,Hpe)=>{(function(t,e){typeof W_=="object"?Hpe.exports=e():typeof define=="function"&&define.amd?define(e):t.treeify=e()})(W_,function(){function t(a,n){var u=n?"\u2514":"\u251C";return a?u+="\u2500 ":u+="\u2500\u2500\u2510",u}function e(a,n){var u=[];for(var A in a)a.hasOwnProperty(A)&&(n&&typeof a[A]=="function"||u.push(A));return u}function r(a,n,u,A,p,h,E){var w="",D=0,b,C,T=A.slice(0);if(T.push([n,u])&&A.length>0&&(A.forEach(function(U,z){z>0&&(w+=(U[1]?" ":"\u2502")+" "),!C&&U[0]===n&&(C=!0)}),w+=t(a,u)+a,p&&(typeof n!="object"||n instanceof Date)&&(w+=": "+n),C&&(w+=" (circular ref.)"),E(w)),!C&&typeof n=="object"){var N=e(n,h);N.forEach(function(U){b=++D===N.length,r(U,n[U],b,T,p,h,E)})}}var o={};return o.asLines=function(a,n,u,A){var p=typeof u!="function"?u:!1;r(".",a,!1,[],n,p,A||u)},o.asTree=function(a,n,u){var A="";return r(".",a,!1,[],n,u,function(p){A+=p+` `}),A},o})});var As={};Kt(As,{emitList:()=>Jct,emitTree:()=>Ype,treeNodeToJson:()=>Wpe,treeNodeToTreeify:()=>Gpe});function Gpe(t,{configuration:e}){let r={},o=0,a=(n,u)=>{let A=Array.isArray(n)?n.entries():Object.entries(n);for(let[p,h]of A){if(!h)continue;let{label:E,value:w,children:D}=h,b=[];typeof E<"u"&&b.push(Cg(e,E,2)),typeof w<"u"&&b.push(Ut(e,w[0],w[1])),b.length===0&&b.push(Cg(e,`${p}`,2));let C=b.join(": ").trim(),T=`\0${o++}\0`,N=u[`${T}${C}`]={};typeof D<"u"&&a(D,N)}};if(typeof t.children>"u")throw new Error("The root node must only contain children");return a(t.children,r),r}function Wpe(t){let e=r=>{if(typeof r.children>"u"){if(typeof r.value>"u")throw new Error("Assertion failed: Expected a value to be set if the children are missing");return Ig(r.value[0],r.value[1])}let o=Array.isArray(r.children)?r.children.entries():Object.entries(r.children??{}),a=Array.isArray(r.children)?[]:{};for(let[n,u]of o)u&&(a[Xct(n)]=e(u));return typeof r.value>"u"?a:{value:Ig(r.value[0],r.value[1]),children:a}};return e(t)}function Jct(t,{configuration:e,stdout:r,json:o}){let a=t.map(n=>({value:n}));Ype({children:a},{configuration:e,stdout:r,json:o})}function Ype(t,{configuration:e,stdout:r,json:o,separators:a=0}){if(o){let u=Array.isArray(t.children)?t.children.values():Object.values(t.children??{});for(let A of u)A&&r.write(`${JSON.stringify(Wpe(A))} `);return}let n=(0,jpe.asTree)(Gpe(t,{configuration:e}),!1,!1);if(n=n.replace(/\0[0-9]+\0/g,""),a>=1&&(n=n.replace(/^([├└]─)/gm,`\u2502 $1`).replace(/^│\n/,"")),a>=2)for(let u=0;u<2;++u)n=n.replace(/^([│ ].{2}[├│ ].{2}[^\n]+\n)(([│ ]).{2}[├└].{2}[^\n]*\n[│ ].{2}[│ ].{2}[├└]─)/gm,`$1$3 \u2502 $2`).replace(/^│\n/,"");if(a>=3)throw new Error("Only the first two levels are accepted by treeUtils.emitTree");r.write(n)}function Xct(t){return typeof t=="string"?t.replace(/^\0[0-9]+\0/,""):t}var jpe,Kpe=It(()=>{jpe=et(qpe());Wl()});function v2(t){let e=t.match(Zct);if(!e?.groups)throw new Error("Assertion failed: Expected the checksum to match the requested pattern");let r=e.groups.cacheVersion?parseInt(e.groups.cacheVersion):null;return{cacheKey:e.groups.cacheKey??null,cacheVersion:r,cacheSpec:e.groups.cacheSpec??null,hash:e.groups.hash}}var Vpe,Y_,K_,Pk,Wr,Zct,V_=It(()=>{Ke();Pt();Pt();sA();Vpe=ve("crypto"),Y_=et(ve("fs"));Vl();ah();Gl();Io();K_=Zm(process.env.YARN_CACHE_CHECKPOINT_OVERRIDE??process.env.YARN_CACHE_VERSION_OVERRIDE??9),Pk=Zm(process.env.YARN_CACHE_VERSION_OVERRIDE??10),Wr=class t{constructor(e,{configuration:r,immutable:o=r.get("enableImmutableCache"),check:a=!1}){this.markedFiles=new Set;this.mutexes=new Map;this.cacheId=`-${(0,Vpe.randomBytes)(8).toString("hex")}.tmp`;this.configuration=r,this.cwd=e,this.immutable=o,this.check=a;let{cacheSpec:n,cacheKey:u}=t.getCacheKey(r);this.cacheSpec=n,this.cacheKey=u}static async find(e,{immutable:r,check:o}={}){let a=new t(e.get("cacheFolder"),{configuration:e,immutable:r,check:o});return await a.setup(),a}static getCacheKey(e){let r=e.get("compressionLevel"),o=r!=="mixed"?`c${r}`:"";return{cacheKey:[Pk,o].join(""),cacheSpec:o}}get mirrorCwd(){if(!this.configuration.get("enableMirror"))return null;let e=`${this.configuration.get("globalFolder")}/cache`;return e!==this.cwd?e:null}getVersionFilename(e){return`${ly(e)}-${this.cacheKey}.zip`}getChecksumFilename(e,r){let a=v2(r).hash.slice(0,10);return`${ly(e)}-${a}.zip`}isChecksumCompatible(e){if(e===null)return!1;let{cacheVersion:r,cacheSpec:o}=v2(e);if(r===null||r{let he=new Zi,De=K.join(Bt.root,_M(e));return he.mkdirSync(De,{recursive:!0}),he.writeJsonSync(K.join(De,mr.manifest),{name:rn(e),mocked:!0}),he},E=async(he,{isColdHit:De,controlPath:Ee=null})=>{if(Ee===null&&u.unstablePackages?.has(e.locatorHash))return{isValid:!0,hash:null};let g=r&&!De?v2(r).cacheKey:this.cacheKey,me=!u.skipIntegrityCheck||!r?`${g}/${await fx(he)}`:r;if(Ee!==null){let fe=!u.skipIntegrityCheck||!r?`${this.cacheKey}/${await fx(Ee)}`:r;if(me!==fe)throw new zt(18,"The remote archive doesn't match the local checksum - has the local cache been corrupted?")}let Ce=null;switch(r!==null&&me!==r&&(this.check?Ce="throw":v2(r).cacheKey!==v2(me).cacheKey?Ce="update":Ce=this.configuration.get("checksumBehavior")),Ce){case null:case"update":return{isValid:!0,hash:me};case"ignore":return{isValid:!0,hash:r};case"reset":return{isValid:!1,hash:r};default:case"throw":throw new zt(18,"The remote archive doesn't match the expected checksum")}},w=async he=>{if(!n)throw new Error(`Cache check required but no loader configured for ${jr(this.configuration,e)}`);let De=await n(),Ee=De.getRealPath();De.saveAndClose(),await ae.chmodPromise(Ee,420);let g=await E(he,{controlPath:Ee,isColdHit:!1});if(!g.isValid)throw new Error("Assertion failed: Expected a valid checksum");return g.hash},D=async()=>{if(A===null||!await ae.existsPromise(A)){let he=await n(),De=he.getRealPath();return he.saveAndClose(),{source:"loader",path:De}}return{source:"mirror",path:A}},b=async()=>{if(!n)throw new Error(`Cache entry required but missing for ${jr(this.configuration,e)}`);if(this.immutable)throw new zt(56,`Cache entry required but missing for ${jr(this.configuration,e)}`);let{path:he,source:De}=await D(),{hash:Ee}=await E(he,{isColdHit:!0}),g=this.getLocatorPath(e,Ee),me=[];De!=="mirror"&&A!==null&&me.push(async()=>{let fe=`${A}${this.cacheId}`;await ae.copyFilePromise(he,fe,Y_.default.constants.COPYFILE_FICLONE),await ae.chmodPromise(fe,420),await ae.renamePromise(fe,A)}),(!u.mirrorWriteOnly||A===null)&&me.push(async()=>{let fe=`${g}${this.cacheId}`;await ae.copyFilePromise(he,fe,Y_.default.constants.COPYFILE_FICLONE),await ae.chmodPromise(fe,420),await ae.renamePromise(fe,g)});let Ce=u.mirrorWriteOnly?A??g:g;return await Promise.all(me.map(fe=>fe())),[!1,Ce,Ee]},C=async()=>{let De=(async()=>{let Ee=u.unstablePackages?.has(e.locatorHash),g=Ee||!r||this.isChecksumCompatible(r)?this.getLocatorPath(e,r):null,me=g!==null?this.markedFiles.has(g)||await p.existsPromise(g):!1,Ce=!!u.mockedPackages?.has(e.locatorHash)&&(!this.check||!me),fe=Ce||me,ie=fe?o:a;if(ie&&ie(),fe){let Z=null,Pe=g;if(!Ce)if(this.check)Z=await w(Pe);else{let Re=await E(Pe,{isColdHit:!1});if(Re.isValid)Z=Re.hash;else return b()}return[Ce,Pe,Z]}else{if(this.immutable&&Ee)throw new zt(56,`Cache entry required but missing for ${jr(this.configuration,e)}; consider defining ${pe.pretty(this.configuration,"supportedArchitectures",pe.Type.CODE)} to cache packages for multiple systems`);return b()}})();this.mutexes.set(e.locatorHash,De);try{return await De}finally{this.mutexes.delete(e.locatorHash)}};for(let he;he=this.mutexes.get(e.locatorHash);)await he;let[T,N,U]=await C();T||this.markedFiles.add(N);let z,te=T?()=>h():()=>new Zi(N,{baseFs:p,readOnly:!0}),le=new Am(()=>rO(()=>z=te(),he=>`Failed to open the cache entry for ${jr(this.configuration,e)}: ${he}`),K),ce=new ju(N,{baseFs:le,pathUtils:K}),ue=()=>{z?.discardAndClose()},Ie=u.unstablePackages?.has(e.locatorHash)?null:U;return[ce,ue,Ie]}},Zct=/^(?:(?(?[0-9]+)(?.*))\/)?(?.*)$/});var Sk,zpe=It(()=>{Sk=(r=>(r[r.SCRIPT=0]="SCRIPT",r[r.SHELLCODE=1]="SHELLCODE",r))(Sk||{})});var $ct,tE,z_=It(()=>{Pt();Ol();bf();Io();$ct=[[/^(git(?:\+(?:https|ssh))?:\/\/.*(?:\.git)?)#(.*)$/,(t,e,r,o)=>`${r}#commit=${o}`],[/^https:\/\/((?:[^/]+?)@)?codeload\.github\.com\/([^/]+\/[^/]+)\/tar\.gz\/([0-9a-f]+)$/,(t,e,r="",o,a)=>`https://${r}github.com/${o}.git#commit=${a}`],[/^https:\/\/((?:[^/]+?)@)?github\.com\/([^/]+\/[^/]+?)(?:\.git)?#([0-9a-f]+)$/,(t,e,r="",o,a)=>`https://${r}github.com/${o}.git#commit=${a}`],[/^https?:\/\/[^/]+\/(?:[^/]+\/)*(?:@.+(?:\/|(?:%2f)))?([^/]+)\/(?:-|download)\/\1-[^/]+\.tgz(?:#|$)/,t=>`npm:${t}`],[/^https:\/\/npm\.pkg\.github\.com\/download\/(?:@[^/]+)\/(?:[^/]+)\/(?:[^/]+)\/(?:[0-9a-f]+)(?:#|$)/,t=>`npm:${t}`],[/^https:\/\/npm\.fontawesome\.com\/(?:@[^/]+)\/([^/]+)\/-\/([^/]+)\/\1-\2.tgz(?:#|$)/,t=>`npm:${t}`],[/^https?:\/\/[^/]+\/.*\/(@[^/]+)\/([^/]+)\/-\/\1\/\2-(?:[.\d\w-]+)\.tgz(?:#|$)/,(t,e)=>mx({protocol:"npm:",source:null,selector:t,params:{__archiveUrl:e}})],[/^[^/]+\.tgz#[0-9a-f]+$/,t=>`npm:${t}`]],tE=class{constructor(e){this.resolver=e;this.resolutions=null}async setup(e,{report:r}){let o=K.join(e.cwd,mr.lockfile);if(!ae.existsSync(o))return;let a=await ae.readFilePromise(o,"utf8"),n=Ki(a);if(Object.hasOwn(n,"__metadata"))return;let u=this.resolutions=new Map;for(let A of Object.keys(n)){let p=v1(A);if(!p){r.reportWarning(14,`Failed to parse the string "${A}" into a proper descriptor`);continue}let h=Fa(p.range)?kn(p,`npm:${p.range}`):p,{version:E,resolved:w}=n[A];if(!w)continue;let D;for(let[C,T]of $ct){let N=w.match(C);if(N){D=T(E,...N);break}}if(!D){r.reportWarning(14,`${zn(e.configuration,h)}: Only some patterns can be imported from legacy lockfiles (not "${w}")`);continue}let b=h;try{let C=vg(h.range),T=v1(C.selector,!0);T&&(b=T)}catch{}u.set(h.descriptorHash,Ss(b,D))}}supportsDescriptor(e,r){return this.resolutions?this.resolutions.has(e.descriptorHash):!1}supportsLocator(e,r){return!1}shouldPersistResolution(e,r){throw new Error("Assertion failed: This resolver doesn't support resolving locators to packages")}bindDescriptor(e,r,o){return e}getResolutionDependencies(e,r){return{}}async getCandidates(e,r,o){if(!this.resolutions)throw new Error("Assertion failed: The resolution store should have been setup");let a=this.resolutions.get(e.descriptorHash);if(!a)throw new Error("Assertion failed: The resolution should have been registered");let n=NM(a),u=o.project.configuration.normalizeDependency(n);return await this.resolver.getCandidates(u,r,o)}async getSatisfying(e,r,o,a){let[n]=await this.getCandidates(e,r,a);return{locators:o.filter(u=>u.locatorHash===n.locatorHash),sorted:!1}}async resolve(e,r){throw new Error("Assertion failed: This resolver doesn't support resolving locators to packages")}}});var pA,Jpe=It(()=>{Vl();n2();Wl();pA=class extends Ws{constructor({configuration:r,stdout:o,suggestInstall:a=!0}){super();this.errorCount=0;g1(this,{configuration:r}),this.configuration=r,this.stdout=o,this.suggestInstall=a}static async start(r,o){let a=new this(r);try{await o(a)}catch(n){a.reportExceptionOnce(n)}finally{await a.finalize()}return a}hasErrors(){return this.errorCount>0}exitCode(){return this.hasErrors()?1:0}reportCacheHit(r){}reportCacheMiss(r){}startSectionSync(r,o){return o()}async startSectionPromise(r,o){return await o()}startTimerSync(r,o,a){return(typeof o=="function"?o:a)()}async startTimerPromise(r,o,a){return await(typeof o=="function"?o:a)()}reportSeparator(){}reportInfo(r,o){}reportWarning(r,o){}reportError(r,o){this.errorCount+=1,this.stdout.write(`${Ut(this.configuration,"\u27A4","redBright")} ${this.formatNameWithHyperlink(r)}: ${o} `)}reportProgress(r){return{...Promise.resolve().then(async()=>{for await(let{}of r);}),stop:()=>{}}}reportJson(r){}reportFold(r,o){}async finalize(){this.errorCount>0&&(this.stdout.write(` `),this.stdout.write(`${Ut(this.configuration,"\u27A4","redBright")} Errors happened when preparing the environment required to run this command. `),this.suggestInstall&&this.stdout.write(`${Ut(this.configuration,"\u27A4","redBright")} This might be caused by packages being missing from the lockfile, in which case running "yarn install" might help. `))}formatNameWithHyperlink(r){return r3(r,{configuration:this.configuration,json:!1})}}});var rE,J_=It(()=>{Io();rE=class{constructor(e){this.resolver=e}supportsDescriptor(e,r){return!!(r.project.storedResolutions.get(e.descriptorHash)||r.project.originalPackages.has(hx(e).locatorHash))}supportsLocator(e,r){return!!(r.project.originalPackages.has(e.locatorHash)&&!r.project.lockfileNeedsRefresh)}shouldPersistResolution(e,r){throw new Error("The shouldPersistResolution method shouldn't be called on the lockfile resolver, which would always answer yes")}bindDescriptor(e,r,o){return e}getResolutionDependencies(e,r){return this.resolver.getResolutionDependencies(e,r)}async getCandidates(e,r,o){let a=o.project.storedResolutions.get(e.descriptorHash);if(a){let u=o.project.originalPackages.get(a);if(u)return[u]}let n=o.project.originalPackages.get(hx(e).locatorHash);if(n)return[n];throw new Error("Resolution expected from the lockfile data")}async getSatisfying(e,r,o,a){let[n]=await this.getCandidates(e,r,a);return{locators:o.filter(u=>u.locatorHash===n.locatorHash),sorted:!1}}async resolve(e,r){let o=r.project.originalPackages.get(e.locatorHash);if(!o)throw new Error("The lockfile resolver isn't meant to resolve packages - they should already have been stored into a cache");return o}}});function Wf(){}function eut(t,e,r,o,a){for(var n=0,u=e.length,A=0,p=0;nb.length?T:b}),h.value=t.join(E)}else h.value=t.join(r.slice(A,A+h.count));A+=h.count,h.added||(p+=h.count)}}var D=e[u-1];return u>1&&typeof D.value=="string"&&(D.added||D.removed)&&t.equals("",D.value)&&(e[u-2].value+=D.value,e.pop()),e}function tut(t){return{newPos:t.newPos,components:t.components.slice(0)}}function rut(t,e){if(typeof t=="function")e.callback=t;else if(t)for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e}function $pe(t,e,r){return r=rut(r,{ignoreWhitespace:!0}),t8.diff(t,e,r)}function nut(t,e,r){return r8.diff(t,e,r)}function xk(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?xk=function(e){return typeof e}:xk=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xk(t)}function X_(t){return out(t)||aut(t)||lut(t)||cut()}function out(t){if(Array.isArray(t))return Z_(t)}function aut(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function lut(t,e){if(t){if(typeof t=="string")return Z_(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Z_(t,e)}}function Z_(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,o=new Array(e);r"u"&&(u.context=4);var A=nut(r,o,u);if(!A)return;A.push({value:"",lines:[]});function p(U){return U.map(function(z){return" "+z})}for(var h=[],E=0,w=0,D=[],b=1,C=1,T=function(z){var te=A[z],le=te.lines||te.value.replace(/\n$/,"").split(` `);if(te.lines=le,te.added||te.removed){var ce;if(!E){var ue=A[z-1];E=b,w=C,ue&&(D=u.context>0?p(ue.lines.slice(-u.context)):[],E-=D.length,w-=D.length)}(ce=D).push.apply(ce,X_(le.map(function(fe){return(te.added?"+":"-")+fe}))),te.added?C+=le.length:b+=le.length}else{if(E)if(le.length<=u.context*2&&z=A.length-2&&le.length<=u.context){var g=/\n$/.test(r),me=/\n$/.test(o),Ce=le.length==0&&D.length>Ee.oldLines;!g&&Ce&&r.length>0&&D.splice(Ee.oldLines,0,"\\ No newline at end of file"),(!g&&!Ce||!me)&&D.push("\\ No newline at end of file")}h.push(Ee),E=0,w=0,D=[]}b+=le.length,C+=le.length}},N=0;N{Wf.prototype={diff:function(e,r){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=o.callback;typeof o=="function"&&(a=o,o={}),this.options=o;var n=this;function u(T){return a?(setTimeout(function(){a(void 0,T)},0),!0):T}e=this.castInput(e),r=this.castInput(r),e=this.removeEmpty(this.tokenize(e)),r=this.removeEmpty(this.tokenize(r));var A=r.length,p=e.length,h=1,E=A+p;o.maxEditLength&&(E=Math.min(E,o.maxEditLength));var w=[{newPos:-1,components:[]}],D=this.extractCommon(w[0],r,e,0);if(w[0].newPos+1>=A&&D+1>=p)return u([{value:this.join(r),count:r.length}]);function b(){for(var T=-1*h;T<=h;T+=2){var N=void 0,U=w[T-1],z=w[T+1],te=(z?z.newPos:0)-T;U&&(w[T-1]=void 0);var le=U&&U.newPos+1=A&&te+1>=p)return u(eut(n,N.components,r,e,n.useLongestToken));w[T]=N}h++}if(a)(function T(){setTimeout(function(){if(h>E)return a();b()||T()},0)})();else for(;h<=E;){var C=b();if(C)return C}},pushComponent:function(e,r,o){var a=e[e.length-1];a&&a.added===r&&a.removed===o?e[e.length-1]={count:a.count+1,added:r,removed:o}:e.push({count:1,added:r,removed:o})},extractCommon:function(e,r,o,a){for(var n=r.length,u=o.length,A=e.newPos,p=A-a,h=0;A+1"u"?r:u}:o;return typeof t=="string"?t:JSON.stringify($_(t,null,null,a),a," ")};D2.equals=function(t,e){return Wf.prototype.equals.call(D2,t.replace(/,([\r\n])/g,"$1"),e.replace(/,([\r\n])/g,"$1"))};e8=new Wf;e8.tokenize=function(t){return t.slice()};e8.join=e8.removeEmpty=function(t){return t}});var rhe=_((HUt,the)=>{var Aut=jl(),fut=fy(),put=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,hut=/^\w*$/;function gut(t,e){if(Aut(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||fut(t)?!0:hut.test(t)||!put.test(t)||e!=null&&t in Object(e)}the.exports=gut});var she=_((qUt,ihe)=>{var nhe=dS(),dut="Expected a function";function i8(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(dut);var r=function(){var o=arguments,a=e?e.apply(this,o):o[0],n=r.cache;if(n.has(a))return n.get(a);var u=t.apply(this,o);return r.cache=n.set(a,u)||n,u};return r.cache=new(i8.Cache||nhe),r}i8.Cache=nhe;ihe.exports=i8});var ahe=_((jUt,ohe)=>{var mut=she(),yut=500;function Eut(t){var e=mut(t,function(o){return r.size===yut&&r.clear(),o}),r=e.cache;return e}ohe.exports=Eut});var s8=_((GUt,lhe)=>{var Cut=ahe(),Iut=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,wut=/\\(\\)?/g,But=Cut(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(Iut,function(r,o,a,n){e.push(a?n.replace(wut,"$1"):o||r)}),e});lhe.exports=But});var Wg=_((WUt,che)=>{var vut=jl(),Dut=rhe(),Put=s8(),Sut=t2();function xut(t,e){return vut(t)?t:Dut(t,e)?[t]:Put(Sut(t))}che.exports=xut});var nE=_((YUt,uhe)=>{var but=fy(),kut=1/0;function Qut(t){if(typeof t=="string"||but(t))return t;var e=t+"";return e=="0"&&1/t==-kut?"-0":e}uhe.exports=Qut});var bk=_((KUt,Ahe)=>{var Fut=Wg(),Rut=nE();function Tut(t,e){e=Fut(e,t);for(var r=0,o=e.length;t!=null&&r{var Lut=RS(),Nut=Wg(),Out=n1(),fhe=cl(),Mut=nE();function Uut(t,e,r,o){if(!fhe(t))return t;e=Nut(e,t);for(var a=-1,n=e.length,u=n-1,A=t;A!=null&&++a{var _ut=bk(),Hut=o8(),qut=Wg();function jut(t,e,r){for(var o=-1,a=e.length,n={};++o{function Gut(t,e){return t!=null&&e in Object(t)}dhe.exports=Gut});var a8=_((XUt,yhe)=>{var Wut=Wg(),Yut=e1(),Kut=jl(),Vut=n1(),zut=IS(),Jut=nE();function Xut(t,e,r){e=Wut(e,t);for(var o=-1,a=e.length,n=!1;++o{var Zut=mhe(),$ut=a8();function eAt(t,e){return t!=null&&$ut(t,e,Zut)}Ehe.exports=eAt});var whe=_(($Ut,Ihe)=>{var tAt=ghe(),rAt=Che();function nAt(t,e){return tAt(t,e,function(r,o){return rAt(t,o)})}Ihe.exports=nAt});var Phe=_((e3t,Dhe)=>{var Bhe=dg(),iAt=e1(),sAt=jl(),vhe=Bhe?Bhe.isConcatSpreadable:void 0;function oAt(t){return sAt(t)||iAt(t)||!!(vhe&&t&&t[vhe])}Dhe.exports=oAt});var bhe=_((t3t,xhe)=>{var aAt=ES(),lAt=Phe();function She(t,e,r,o,a){var n=-1,u=t.length;for(r||(r=lAt),a||(a=[]);++n0&&r(A)?e>1?She(A,e-1,r,o,a):aAt(a,A):o||(a[a.length]=A)}return a}xhe.exports=She});var Qhe=_((r3t,khe)=>{var cAt=bhe();function uAt(t){var e=t==null?0:t.length;return e?cAt(t,1):[]}khe.exports=uAt});var l8=_((n3t,Fhe)=>{var AAt=Qhe(),fAt=VN(),pAt=zN();function hAt(t){return pAt(fAt(t,void 0,AAt),t+"")}Fhe.exports=hAt});var c8=_((i3t,Rhe)=>{var gAt=whe(),dAt=l8(),mAt=dAt(function(t,e){return t==null?{}:gAt(t,e)});Rhe.exports=mAt});var kk,The=It(()=>{Vl();kk=class{constructor(e){this.resolver=e}supportsDescriptor(e,r){return this.resolver.supportsDescriptor(e,r)}supportsLocator(e,r){return this.resolver.supportsLocator(e,r)}shouldPersistResolution(e,r){return this.resolver.shouldPersistResolution(e,r)}bindDescriptor(e,r,o){return this.resolver.bindDescriptor(e,r,o)}getResolutionDependencies(e,r){return this.resolver.getResolutionDependencies(e,r)}async getCandidates(e,r,o){throw new zt(20,`This package doesn't seem to be present in your lockfile; run "yarn install" to update the lockfile`)}async getSatisfying(e,r,o,a){throw new zt(20,`This package doesn't seem to be present in your lockfile; run "yarn install" to update the lockfile`)}async resolve(e,r){throw new zt(20,`This package doesn't seem to be present in your lockfile; run "yarn install" to update the lockfile`)}}});var Ri,u8=It(()=>{Vl();Ri=class extends Ws{reportCacheHit(e){}reportCacheMiss(e){}startSectionSync(e,r){return r()}async startSectionPromise(e,r){return await r()}startTimerSync(e,r,o){return(typeof r=="function"?r:o)()}async startTimerPromise(e,r,o){return await(typeof r=="function"?r:o)()}reportSeparator(){}reportInfo(e,r){}reportWarning(e,r){}reportError(e,r){}reportProgress(e){return{...Promise.resolve().then(async()=>{for await(let{}of e);}),stop:()=>{}}}reportJson(e){}reportFold(e,r){}async finalize(){}}});var Lhe,iE,A8=It(()=>{Pt();Lhe=et(ux());Ay();Dg();Wl();ah();bf();Io();iE=class{constructor(e,{project:r}){this.workspacesCwds=new Set;this.project=r,this.cwd=e}async setup(){this.manifest=await _t.tryFind(this.cwd)??new _t,this.relativeCwd=K.relative(this.project.cwd,this.cwd)||Bt.dot;let e=this.manifest.name?this.manifest.name:rA(null,`${this.computeCandidateName()}-${zi(this.relativeCwd).substring(0,6)}`);this.anchoredDescriptor=kn(e,`${ci.protocol}${this.relativeCwd}`),this.anchoredLocator=Ss(e,`${ci.protocol}${this.relativeCwd}`);let r=this.manifest.workspaceDefinitions.map(({pattern:a})=>a);if(r.length===0)return;let o=await(0,Lhe.default)(r,{cwd:Ae.fromPortablePath(this.cwd),onlyDirectories:!0,ignore:["**/node_modules","**/.git","**/.yarn"]});o.sort(),await o.reduce(async(a,n)=>{let u=K.resolve(this.cwd,Ae.toPortablePath(n)),A=await ae.existsPromise(K.join(u,"package.json"));await a,A&&this.workspacesCwds.add(u)},Promise.resolve())}get anchoredPackage(){let e=this.project.storedPackages.get(this.anchoredLocator.locatorHash);if(!e)throw new Error(`Assertion failed: Expected workspace ${P1(this.project.configuration,this)} (${Ut(this.project.configuration,K.join(this.cwd,mr.manifest),Ct.PATH)}) to have been resolved. Run "yarn install" to update the lockfile`);return e}accepts(e){let r=e.indexOf(":"),o=r!==-1?e.slice(0,r+1):null,a=r!==-1?e.slice(r+1):e;if(o===ci.protocol&&K.normalize(a)===this.relativeCwd||o===ci.protocol&&(a==="*"||a==="^"||a==="~"))return!0;let n=Fa(a);return n?o===ci.protocol?n.test(this.manifest.version??"0.0.0"):this.project.configuration.get("enableTransparentWorkspaces")&&this.manifest.version!==null?n.test(this.manifest.version):!1:!1}computeCandidateName(){return this.cwd===this.project.cwd?"root-workspace":`${K.basename(this.cwd)}`||"unnamed-workspace"}getRecursiveWorkspaceDependencies({dependencies:e=_t.hardDependencies}={}){let r=new Set,o=a=>{for(let n of e)for(let u of a.manifest[n].values()){let A=this.project.tryWorkspaceByDescriptor(u);A===null||r.has(A)||(r.add(A),o(A))}};return o(this),r}getRecursiveWorkspaceDependents({dependencies:e=_t.hardDependencies}={}){let r=new Set,o=a=>{for(let n of this.project.workspaces)e.some(A=>[...n.manifest[A].values()].some(p=>{let h=this.project.tryWorkspaceByDescriptor(p);return h!==null&&B1(h.anchoredLocator,a.anchoredLocator)}))&&!r.has(n)&&(r.add(n),o(n))};return o(this),r}getRecursiveWorkspaceChildren(){let e=new Set([this]);for(let r of e)for(let o of r.workspacesCwds){let a=this.project.workspacesByCwd.get(o);a&&e.add(a)}return e.delete(this),Array.from(e)}async persistManifest(){let e={};this.manifest.exportTo(e);let r=K.join(this.cwd,_t.fileName),o=`${JSON.stringify(e,null,this.manifest.indent)} `;await ae.changeFilePromise(r,o,{automaticNewlines:!0}),this.manifest.raw=e}}});function BAt({project:t,allDescriptors:e,allResolutions:r,allPackages:o,accessibleLocators:a=new Set,optionalBuilds:n=new Set,peerRequirements:u=new Map,peerWarnings:A=[],peerRequirementNodes:p=new Map,volatileDescriptors:h=new Set}){let E=new Map,w=[],D=new Map,b=new Map,C=new Map,T=new Map,N=new Map(t.workspaces.map(ce=>{let ue=ce.anchoredLocator.locatorHash,Ie=o.get(ue);if(typeof Ie>"u")throw new Error("Assertion failed: The workspace should have an associated package");return[ue,E1(Ie)]})),U=()=>{let ce=ae.mktempSync(),ue=K.join(ce,"stacktrace.log"),Ie=String(w.length+1).length,he=w.map((De,Ee)=>`${`${Ee+1}.`.padStart(Ie," ")} ${Qa(De)} `).join("");throw ae.writeFileSync(ue,he),ae.detachTemp(ce),new zt(45,`Encountered a stack overflow when resolving peer dependencies; cf ${Ae.fromPortablePath(ue)}`)},z=ce=>{let ue=r.get(ce.descriptorHash);if(typeof ue>"u")throw new Error("Assertion failed: The resolution should have been registered");let Ie=o.get(ue);if(!Ie)throw new Error("Assertion failed: The package could not be found");return Ie},te=(ce,ue,Ie,{top:he,optional:De})=>{w.length>1e3&&U(),w.push(ue);let Ee=le(ce,ue,Ie,{top:he,optional:De});return w.pop(),Ee},le=(ce,ue,Ie,{top:he,optional:De})=>{if(De||n.delete(ue.locatorHash),a.has(ue.locatorHash))return;a.add(ue.locatorHash);let Ee=o.get(ue.locatorHash);if(!Ee)throw new Error(`Assertion failed: The package (${jr(t.configuration,ue)}) should have been registered`);let g=[],me=new Map,Ce=[],fe=[],ie=[],Z=[];for(let Re of Array.from(Ee.dependencies.values())){if(Ee.peerDependencies.has(Re.identHash)&&Ee.locatorHash!==he)continue;if(Pf(Re))throw new Error("Assertion failed: Virtual packages shouldn't be encountered when virtualizing a branch");h.delete(Re.descriptorHash);let ht=De;if(!ht){let xe=Ee.dependenciesMeta.get(rn(Re));if(typeof xe<"u"){let tt=xe.get(null);typeof tt<"u"&&tt.optional&&(ht=!0)}}let q=r.get(Re.descriptorHash);if(!q)throw new Error(`Assertion failed: The resolution (${zn(t.configuration,Re)}) should have been registered`);let nt=N.get(q)||o.get(q);if(!nt)throw new Error(`Assertion failed: The package (${q}, resolved from ${zn(t.configuration,Re)}) should have been registered`);if(nt.peerDependencies.size===0){te(Re,nt,new Map,{top:he,optional:ht});continue}let Le,Te,ke=new Set,Ve=new Map;Ce.push(()=>{Le=MM(Re,ue.locatorHash),Te=UM(nt,ue.locatorHash),Ee.dependencies.delete(Re.identHash),Ee.dependencies.set(Le.identHash,Le),r.set(Le.descriptorHash,Te.locatorHash),e.set(Le.descriptorHash,Le),o.set(Te.locatorHash,Te),g.push([nt,Le,Te])}),fe.push(()=>{T.set(Te.locatorHash,Ve);for(let xe of Te.peerDependencies.values()){let He=Al(me,xe.identHash,()=>{let x=Ie.get(xe.identHash)??null,I=Ee.dependencies.get(xe.identHash);return!I&&w1(ue,xe)&&(ce.identHash===ue.identHash?I=ce:(I=kn(ue,ce.range),e.set(I.descriptorHash,I),r.set(I.descriptorHash,ue.locatorHash),h.delete(I.descriptorHash),x=null)),I||(I=kn(xe,"missing:")),{subject:ue,ident:xe,provided:I,root:!x,requests:new Map,hash:`p${zi(ue.locatorHash,xe.identHash).slice(0,5)}`}}).provided;if(He.range==="missing:"&&Te.dependencies.has(xe.identHash)){Te.peerDependencies.delete(xe.identHash);continue}Ve.set(xe.identHash,{requester:Te,descriptor:xe,meta:Te.peerDependenciesMeta.get(rn(xe)),children:new Map}),Te.dependencies.set(xe.identHash,He),Pf(He)&&zm(C,He.descriptorHash).add(Te.locatorHash),D.set(He.identHash,He),He.range==="missing:"&&ke.add(He.identHash)}Te.dependencies=new Map(Ps(Te.dependencies,([xe,tt])=>rn(tt)))}),ie.push(()=>{if(!o.has(Te.locatorHash))return;let xe=E.get(nt.locatorHash);typeof xe=="number"&&xe>=2&&U();let tt=E.get(nt.locatorHash),He=typeof tt<"u"?tt+1:1;E.set(nt.locatorHash,He),te(Le,Te,Ve,{top:he,optional:ht}),E.set(nt.locatorHash,He-1)}),Z.push(()=>{let xe=Ee.dependencies.get(Re.identHash);if(typeof xe>"u")throw new Error("Assertion failed: Expected the peer dependency to have been turned into a dependency");let tt=r.get(xe.descriptorHash);if(typeof tt>"u")throw new Error("Assertion failed: Expected the descriptor to be registered");let He=T.get(tt);if(typeof He>"u")throw new Error("Assertion failed: Expected the peer requests to be registered");for(let x of me.values()){let I=He.get(x.ident.identHash);I&&(x.requests.set(xe.descriptorHash,I),p.set(x.hash,x),x.root||Ie.get(x.ident.identHash)?.children.set(xe.descriptorHash,I))}if(o.has(Te.locatorHash))for(let x of ke)Te.dependencies.delete(x)})}for(let Re of[...Ce,...fe])Re();let Pe;do{Pe=!0;for(let[Re,ht,q]of g){let nt=A1(b,Re.locatorHash),Le=zi(...[...q.dependencies.values()].map(xe=>{let tt=xe.range!=="missing:"?r.get(xe.descriptorHash):"missing:";if(typeof tt>"u")throw new Error(`Assertion failed: Expected the resolution for ${zn(t.configuration,xe)} to have been registered`);return tt===he?`${tt} (top)`:tt}),ht.identHash),Te=nt.get(Le);if(typeof Te>"u"){nt.set(Le,ht);continue}if(Te===ht)continue;o.delete(q.locatorHash),e.delete(ht.descriptorHash),r.delete(ht.descriptorHash),a.delete(q.locatorHash);let ke=C.get(ht.descriptorHash)||[],Ve=[Ee.locatorHash,...ke];C.delete(ht.descriptorHash);for(let xe of Ve){let tt=o.get(xe);typeof tt>"u"||(tt.dependencies.get(ht.identHash).descriptorHash!==Te.descriptorHash&&(Pe=!1),tt.dependencies.set(ht.identHash,Te))}for(let xe of me.values())xe.provided.descriptorHash===ht.descriptorHash&&(xe.provided=Te)}}while(!Pe);for(let Re of[...ie,...Z])Re()};for(let ce of t.workspaces){let ue=ce.anchoredLocator;h.delete(ce.anchoredDescriptor.descriptorHash),te(ce.anchoredDescriptor,ue,new Map,{top:ue.locatorHash,optional:!1})}for(let ce of p.values()){if(!ce.root)continue;let ue=o.get(ce.subject.locatorHash);if(typeof ue>"u")continue;for(let he of ce.requests.values()){let De=`p${zi(ce.subject.locatorHash,rn(ce.ident),he.requester.locatorHash).slice(0,5)}`;u.set(De,{subject:ce.subject.locatorHash,requested:ce.ident,rootRequester:he.requester.locatorHash,allRequesters:Array.from(S1(he),Ee=>Ee.requester.locatorHash)})}let Ie=[...S1(ce)];if(ce.provided.range!=="missing:"){let he=z(ce.provided),De=he.version??"0.0.0",Ee=me=>{if(me.startsWith(ci.protocol)){if(!t.tryWorkspaceByLocator(he))return null;me=me.slice(ci.protocol.length),(me==="^"||me==="~")&&(me="*")}return me},g=!0;for(let me of Ie){let Ce=Ee(me.descriptor.range);if(Ce===null){g=!1;continue}if(!nA(De,Ce)){g=!1;let fe=`p${zi(ce.subject.locatorHash,rn(ce.ident),me.requester.locatorHash).slice(0,5)}`;A.push({type:1,subject:ue,requested:ce.ident,requester:me.requester,version:De,hash:fe,requirementCount:Ie.length})}}if(!g){let me=Ie.map(Ce=>Ee(Ce.descriptor.range));A.push({type:3,node:ce,range:me.includes(null)?null:qM(me),hash:ce.hash})}}else{let he=!0;for(let De of Ie)if(!De.meta?.optional){he=!1;let Ee=`p${zi(ce.subject.locatorHash,rn(ce.ident),De.requester.locatorHash).slice(0,5)}`;A.push({type:0,subject:ue,requested:ce.ident,requester:De.requester,hash:Ee})}he||A.push({type:2,node:ce,hash:ce.hash})}}}function*vAt(t){let e=new Map;if("children"in t)e.set(t,t);else for(let r of t.requests.values())e.set(r,r);for(let[r,o]of e){yield{request:r,root:o};for(let a of r.children.values())e.has(a)||e.set(a,o)}}function DAt(t,e){let r=[],o=[],a=!1;for(let n of t.peerWarnings)if(!(n.type===1||n.type===0)){if(!t.tryWorkspaceByLocator(n.node.subject)){a=!0;continue}if(n.type===3){let u=t.storedResolutions.get(n.node.provided.descriptorHash);if(typeof u>"u")throw new Error("Assertion failed: Expected the descriptor to be registered");let A=t.storedPackages.get(u);if(typeof A>"u")throw new Error("Assertion failed: Expected the package to be registered");let p=eh(vAt(n.node),({request:w,root:D})=>nA(A.version??"0.0.0",w.descriptor.range)?eh.skip:w===D?Ui(t.configuration,w.requester):`${Ui(t.configuration,w.requester)} (via ${Ui(t.configuration,D.requester)})`),h=[...S1(n.node)].length>1?"and other dependencies request":"requests",E=n.range?cy(t.configuration,n.range):Ut(t.configuration,"but they have non-overlapping ranges!","redBright");r.push(`${Ui(t.configuration,n.node.ident)} is listed by your project with version ${D1(t.configuration,A.version??"0.0.0")} (${Ut(t.configuration,n.hash,Ct.CODE)}), which doesn't satisfy what ${p} ${h} (${E}).`)}if(n.type===2){let u=n.node.requests.size>1?" and other dependencies":"";o.push(`${jr(t.configuration,n.node.subject)} doesn't provide ${Ui(t.configuration,n.node.ident)} (${Ut(t.configuration,n.hash,Ct.CODE)}), requested by ${Ui(t.configuration,n.node.requests.values().next().value.requester)}${u}.`)}}e.startSectionSync({reportFooter:()=>{e.reportWarning(86,`Some peer dependencies are incorrectly met by your project; run ${Ut(t.configuration,"yarn explain peer-requirements ",Ct.CODE)} for details, where ${Ut(t.configuration,"",Ct.CODE)} is the six-letter p-prefixed code.`)},skipIfEmpty:!0},()=>{for(let n of Ps(r,u=>ey.default(u)))e.reportWarning(60,n);for(let n of Ps(o,u=>ey.default(u)))e.reportWarning(2,n)}),a&&e.reportWarning(86,`Some peer dependencies are incorrectly met by dependencies; run ${Ut(t.configuration,"yarn explain peer-requirements",Ct.CODE)} for details.`)}var Qk,Fk,Rk,Mhe,h8,p8,g8,Tk,yAt,EAt,Nhe,CAt,IAt,wAt,yl,f8,Lk,Ohe,Qt,Uhe=It(()=>{Pt();Pt();Ol();Gt();Qk=ve("crypto");n8();Fk=et(c8()),Rk=et(lg()),Mhe=et(ni()),h8=ve("util"),p8=et(ve("v8")),g8=et(ve("zlib"));V_();W1();z_();J_();Ay();KM();Vl();The();n2();u8();Dg();A8();vx();Wl();ah();Gl();rb();a3();bf();Io();Tk=Zm(process.env.YARN_LOCKFILE_VERSION_OVERRIDE??8),yAt=3,EAt=/ *, */g,Nhe=/\/$/,CAt=32,IAt=(0,h8.promisify)(g8.default.gzip),wAt=(0,h8.promisify)(g8.default.gunzip),yl=(r=>(r.UpdateLockfile="update-lockfile",r.SkipBuild="skip-build",r))(yl||{}),f8={restoreLinkersCustomData:["linkersCustomData"],restoreResolutions:["accessibleLocators","conditionalLocators","disabledLocators","optionalBuilds","storedDescriptors","storedResolutions","storedPackages","lockFileChecksum"],restoreBuildState:["skippedBuilds","storedBuildState"]},Lk=(a=>(a[a.NotProvided=0]="NotProvided",a[a.NotCompatible=1]="NotCompatible",a[a.NodeNotProvided=2]="NodeNotProvided",a[a.NodeNotCompatible=3]="NodeNotCompatible",a))(Lk||{}),Ohe=t=>zi(`${yAt}`,t),Qt=class t{constructor(e,{configuration:r}){this.resolutionAliases=new Map;this.workspaces=[];this.workspacesByCwd=new Map;this.workspacesByIdent=new Map;this.storedResolutions=new Map;this.storedDescriptors=new Map;this.storedPackages=new Map;this.storedChecksums=new Map;this.storedBuildState=new Map;this.accessibleLocators=new Set;this.conditionalLocators=new Set;this.disabledLocators=new Set;this.originalPackages=new Map;this.optionalBuilds=new Set;this.skippedBuilds=new Set;this.lockfileLastVersion=null;this.lockfileNeedsRefresh=!1;this.peerRequirements=new Map;this.peerWarnings=[];this.peerRequirementNodes=new Map;this.linkersCustomData=new Map;this.lockFileChecksum=null;this.installStateChecksum=null;this.configuration=r,this.cwd=e}static async find(e,r){if(!e.projectCwd)throw new ot(`No project found in ${r}`);let o=e.projectCwd,a=r,n=null;for(;n!==e.projectCwd;){if(n=a,ae.existsSync(K.join(n,mr.manifest))){o=n;break}a=K.dirname(n)}let u=new t(e.projectCwd,{configuration:e});Je.telemetry?.reportProject(u.cwd),await u.setupResolutions(),await u.setupWorkspaces(),Je.telemetry?.reportWorkspaceCount(u.workspaces.length),Je.telemetry?.reportDependencyCount(u.workspaces.reduce((C,T)=>C+T.manifest.dependencies.size+T.manifest.devDependencies.size,0));let A=u.tryWorkspaceByCwd(o);if(A)return{project:u,workspace:A,locator:A.anchoredLocator};let p=await u.findLocatorForLocation(`${o}/`,{strict:!0});if(p)return{project:u,locator:p,workspace:null};let h=Ut(e,u.cwd,Ct.PATH),E=Ut(e,K.relative(u.cwd,o),Ct.PATH),w=`- If ${h} isn't intended to be a project, remove any yarn.lock and/or package.json file there.`,D=`- If ${h} is intended to be a project, it might be that you forgot to list ${E} in its workspace configuration.`,b=`- Finally, if ${h} is fine and you intend ${E} to be treated as a completely separate project (not even a workspace), create an empty yarn.lock file in it.`;throw new ot(`The nearest package directory (${Ut(e,o,Ct.PATH)}) doesn't seem to be part of the project declared in ${Ut(e,u.cwd,Ct.PATH)}. ${[w,D,b].join(` `)}`)}async setupResolutions(){this.storedResolutions=new Map,this.storedDescriptors=new Map,this.storedPackages=new Map,this.lockFileChecksum=null;let e=K.join(this.cwd,mr.lockfile),r=this.configuration.get("defaultLanguageName");if(ae.existsSync(e)){let o=await ae.readFilePromise(e,"utf8");this.lockFileChecksum=Ohe(o);let a=Ki(o);if(a.__metadata){let n=a.__metadata.version,u=a.__metadata.cacheKey;this.lockfileLastVersion=n,this.lockfileNeedsRefresh=n"u")throw new Error(`Assertion failed: Expected the lockfile entry to have a resolution field (${A})`);let h=Sf(p.resolution,!0),E=new _t;E.load(p,{yamlCompatibilityMode:!0});let w=E.version,D=E.languageName||r,b=p.linkType.toUpperCase(),C=p.conditions??null,T=E.dependencies,N=E.peerDependencies,U=E.dependenciesMeta,z=E.peerDependenciesMeta,te=E.bin;if(p.checksum!=null){let ce=typeof u<"u"&&!p.checksum.includes("/")?`${u}/${p.checksum}`:p.checksum;this.storedChecksums.set(h.locatorHash,ce)}let le={...h,version:w,languageName:D,linkType:b,conditions:C,dependencies:T,peerDependencies:N,dependenciesMeta:U,peerDependenciesMeta:z,bin:te};this.originalPackages.set(le.locatorHash,le);for(let ce of A.split(EAt)){let ue=lh(ce);n<=6&&(ue=this.configuration.normalizeDependency(ue),ue=kn(ue,ue.range.replace(/^patch:[^@]+@(?!npm(:|%3A))/,"$1npm%3A"))),this.storedDescriptors.set(ue.descriptorHash,ue),this.storedResolutions.set(ue.descriptorHash,h.locatorHash)}}}else o.includes("yarn lockfile v1")&&(this.lockfileLastVersion=-1)}}async setupWorkspaces(){this.workspaces=[],this.workspacesByCwd=new Map,this.workspacesByIdent=new Map;let e=new Set,r=(0,Rk.default)(4),o=async(a,n)=>{if(e.has(n))return a;e.add(n);let u=new iE(n,{project:this});await r(()=>u.setup());let A=a.then(()=>{this.addWorkspace(u)});return Array.from(u.workspacesCwds).reduce(o,A)};await o(Promise.resolve(),this.cwd)}addWorkspace(e){let r=this.workspacesByIdent.get(e.anchoredLocator.identHash);if(typeof r<"u")throw new Error(`Duplicate workspace name ${Ui(this.configuration,e.anchoredLocator)}: ${Ae.fromPortablePath(e.cwd)} conflicts with ${Ae.fromPortablePath(r.cwd)}`);this.workspaces.push(e),this.workspacesByCwd.set(e.cwd,e),this.workspacesByIdent.set(e.anchoredLocator.identHash,e)}get topLevelWorkspace(){return this.getWorkspaceByCwd(this.cwd)}tryWorkspaceByCwd(e){K.isAbsolute(e)||(e=K.resolve(this.cwd,e)),e=K.normalize(e).replace(/\/+$/,"");let r=this.workspacesByCwd.get(e);return r||null}getWorkspaceByCwd(e){let r=this.tryWorkspaceByCwd(e);if(!r)throw new Error(`Workspace not found (${e})`);return r}tryWorkspaceByFilePath(e){let r=null;for(let o of this.workspaces)K.relative(o.cwd,e).startsWith("../")||r&&r.cwd.length>=o.cwd.length||(r=o);return r||null}getWorkspaceByFilePath(e){let r=this.tryWorkspaceByFilePath(e);if(!r)throw new Error(`Workspace not found (${e})`);return r}tryWorkspaceByIdent(e){let r=this.workspacesByIdent.get(e.identHash);return typeof r>"u"?null:r}getWorkspaceByIdent(e){let r=this.tryWorkspaceByIdent(e);if(!r)throw new Error(`Workspace not found (${Ui(this.configuration,e)})`);return r}tryWorkspaceByDescriptor(e){if(e.range.startsWith(ci.protocol)){let o=e.range.slice(ci.protocol.length);if(o!=="^"&&o!=="~"&&o!=="*"&&!Fa(o))return this.tryWorkspaceByCwd(o)}let r=this.tryWorkspaceByIdent(e);return r===null||(Pf(e)&&(e=C1(e)),!r.accepts(e.range))?null:r}getWorkspaceByDescriptor(e){let r=this.tryWorkspaceByDescriptor(e);if(r===null)throw new Error(`Workspace not found (${zn(this.configuration,e)})`);return r}tryWorkspaceByLocator(e){let r=this.tryWorkspaceByIdent(e);return r===null||(zc(e)&&(e=I1(e)),r.anchoredLocator.locatorHash!==e.locatorHash)?null:r}getWorkspaceByLocator(e){let r=this.tryWorkspaceByLocator(e);if(!r)throw new Error(`Workspace not found (${jr(this.configuration,e)})`);return r}deleteDescriptor(e){this.storedResolutions.delete(e),this.storedDescriptors.delete(e)}deleteLocator(e){this.originalPackages.delete(e),this.storedPackages.delete(e),this.accessibleLocators.delete(e)}forgetResolution(e){if("descriptorHash"in e){let r=this.storedResolutions.get(e.descriptorHash);this.deleteDescriptor(e.descriptorHash);let o=new Set(this.storedResolutions.values());typeof r<"u"&&!o.has(r)&&this.deleteLocator(r)}if("locatorHash"in e){this.deleteLocator(e.locatorHash);for(let[r,o]of this.storedResolutions)o===e.locatorHash&&this.deleteDescriptor(r)}}forgetTransientResolutions(){let e=this.configuration.makeResolver(),r=new Map;for(let[o,a]of this.storedResolutions.entries()){let n=r.get(a);n||r.set(a,n=new Set),n.add(o)}for(let o of this.originalPackages.values()){let a;try{a=e.shouldPersistResolution(o,{project:this,resolver:e})}catch{a=!1}if(!a){this.deleteLocator(o.locatorHash);let n=r.get(o.locatorHash);if(n){r.delete(o.locatorHash);for(let u of n)this.deleteDescriptor(u)}}}}forgetVirtualResolutions(){for(let e of this.storedPackages.values())for(let[r,o]of e.dependencies)Pf(o)&&e.dependencies.set(r,C1(o))}getDependencyMeta(e,r){let o={},n=this.topLevelWorkspace.manifest.dependenciesMeta.get(rn(e));if(!n)return o;let u=n.get(null);if(u&&Object.assign(o,u),r===null||!Mhe.default.valid(r))return o;for(let[A,p]of n)A!==null&&A===r&&Object.assign(o,p);return o}async findLocatorForLocation(e,{strict:r=!1}={}){let o=new Ri,a=this.configuration.getLinkers(),n={project:this,report:o};for(let u of a){let A=await u.findPackageLocator(e,n);if(A){if(r&&(await u.findPackageLocation(A,n)).replace(Nhe,"")!==e.replace(Nhe,""))continue;return A}}return null}async loadUserConfig(){let e=K.join(this.cwd,".pnp.cjs");await ae.existsPromise(e)&&vf(e).setup();let r=K.join(this.cwd,"yarn.config.cjs");return await ae.existsPromise(r)?vf(r):null}async preparePackage(e,{resolver:r,resolveOptions:o}){let a=await this.configuration.getPackageExtensions(),n=this.configuration.normalizePackage(e,{packageExtensions:a});for(let[u,A]of n.dependencies){let p=await this.configuration.reduceHook(E=>E.reduceDependency,A,this,n,A,{resolver:r,resolveOptions:o});if(!w1(A,p))throw new Error("Assertion failed: The descriptor ident cannot be changed through aliases");let h=r.bindDescriptor(p,n,o);n.dependencies.set(u,h)}return n}async resolveEverything(e){if(!this.workspacesByCwd||!this.workspacesByIdent)throw new Error("Workspaces must have been setup before calling this function");this.forgetVirtualResolutions();let r=new Map(this.originalPackages),o=[];e.lockfileOnly||this.forgetTransientResolutions();let a=e.resolver||this.configuration.makeResolver(),n=new tE(a);await n.setup(this,{report:e.report});let u=e.lockfileOnly?[new kk(a)]:[n,a],A=new Pg([new rE(a),...u]),p=new Pg([...u]),h=this.configuration.makeFetcher(),E=e.lockfileOnly?{project:this,report:e.report,resolver:A}:{project:this,report:e.report,resolver:A,fetchOptions:{project:this,cache:e.cache,checksums:this.storedChecksums,report:e.report,fetcher:h,cacheOptions:{mirrorWriteOnly:!0}}},w=new Map,D=new Map,b=new Map,C=new Map,T=new Map,N=new Map,U=this.topLevelWorkspace.anchoredLocator,z=new Set,te=[],le=IU(),ce=this.configuration.getSupportedArchitectures();await e.report.startProgressPromise(Ws.progressViaTitle(),async ie=>{let Z=async nt=>{let Le=await Jm(async()=>await A.resolve(nt,E),xe=>`${jr(this.configuration,nt)}: ${xe}`);if(!B1(nt,Le))throw new Error(`Assertion failed: The locator cannot be changed by the resolver (went from ${jr(this.configuration,nt)} to ${jr(this.configuration,Le)})`);C.set(Le.locatorHash,Le),!r.delete(Le.locatorHash)&&!this.tryWorkspaceByLocator(Le)&&o.push(Le);let ke=await this.preparePackage(Le,{resolver:A,resolveOptions:E}),Ve=Wc([...ke.dependencies.values()].map(xe=>q(xe)));return te.push(Ve),Ve.catch(()=>{}),D.set(ke.locatorHash,ke),ke},Pe=async nt=>{let Le=T.get(nt.locatorHash);if(typeof Le<"u")return Le;let Te=Promise.resolve().then(()=>Z(nt));return T.set(nt.locatorHash,Te),Te},Re=async(nt,Le)=>{let Te=await q(Le);return w.set(nt.descriptorHash,nt),b.set(nt.descriptorHash,Te.locatorHash),Te},ht=async nt=>{ie.setTitle(zn(this.configuration,nt));let Le=this.resolutionAliases.get(nt.descriptorHash);if(typeof Le<"u")return Re(nt,this.storedDescriptors.get(Le));let Te=A.getResolutionDependencies(nt,E),ke=Object.fromEntries(await Wc(Object.entries(Te).map(async([tt,He])=>{let x=A.bindDescriptor(He,U,E),I=await q(x);return z.add(I.locatorHash),[tt,I]}))),xe=(await Jm(async()=>await A.getCandidates(nt,ke,E),tt=>`${zn(this.configuration,nt)}: ${tt}`))[0];if(typeof xe>"u")throw new zt(82,`${zn(this.configuration,nt)}: No candidates found`);if(e.checkResolutions){let{locators:tt}=await p.getSatisfying(nt,ke,[xe],{...E,resolver:p});if(!tt.find(He=>He.locatorHash===xe.locatorHash))throw new zt(78,`Invalid resolution ${d1(this.configuration,nt,xe)}`)}return w.set(nt.descriptorHash,nt),b.set(nt.descriptorHash,xe.locatorHash),Pe(xe)},q=nt=>{let Le=N.get(nt.descriptorHash);if(typeof Le<"u")return Le;w.set(nt.descriptorHash,nt);let Te=Promise.resolve().then(()=>ht(nt));return N.set(nt.descriptorHash,Te),Te};for(let nt of this.workspaces){let Le=nt.anchoredDescriptor;te.push(q(Le))}for(;te.length>0;){let nt=[...te];te.length=0,await Wc(nt)}});let ue=ul(r.values(),ie=>this.tryWorkspaceByLocator(ie)?ul.skip:ie);if(o.length>0||ue.length>0){let ie=new Set(this.workspaces.flatMap(nt=>{let Le=D.get(nt.anchoredLocator.locatorHash);if(!Le)throw new Error("Assertion failed: The workspace should have been resolved");return Array.from(Le.dependencies.values(),Te=>{let ke=b.get(Te.descriptorHash);if(!ke)throw new Error("Assertion failed: The resolution should have been registered");return ke})})),Z=nt=>ie.has(nt.locatorHash)?"0":"1",Pe=nt=>Qa(nt),Re=Ps(o,[Z,Pe]),ht=Ps(ue,[Z,Pe]),q=e.report.getRecommendedLength();Re.length>0&&e.report.reportInfo(85,`${Ut(this.configuration,"+",Ct.ADDED)} ${_S(this.configuration,Re,q)}`),ht.length>0&&e.report.reportInfo(85,`${Ut(this.configuration,"-",Ct.REMOVED)} ${_S(this.configuration,ht,q)}`)}let Ie=new Set(this.resolutionAliases.values()),he=new Set(D.keys()),De=new Set,Ee=new Map,g=[],me=new Map;BAt({project:this,accessibleLocators:De,volatileDescriptors:Ie,optionalBuilds:he,peerRequirements:Ee,peerWarnings:g,peerRequirementNodes:me,allDescriptors:w,allResolutions:b,allPackages:D});for(let ie of z)he.delete(ie);for(let ie of Ie)w.delete(ie),b.delete(ie);let Ce=new Set,fe=new Set;for(let ie of D.values())ie.conditions!=null&&he.has(ie.locatorHash)&&(Ex(ie,ce)||(Ex(ie,le)&&e.report.reportWarningOnce(77,`${jr(this.configuration,ie)}: Your current architecture (${process.platform}-${process.arch}) is supported by this package, but is missing from the ${Ut(this.configuration,"supportedArchitectures",Ct.SETTING)} setting`),fe.add(ie.locatorHash)),Ce.add(ie.locatorHash));this.storedResolutions=b,this.storedDescriptors=w,this.storedPackages=D,this.accessibleLocators=De,this.conditionalLocators=Ce,this.disabledLocators=fe,this.originalPackages=C,this.optionalBuilds=he,this.peerRequirements=Ee,this.peerWarnings=g,this.peerRequirementNodes=me}async fetchEverything({cache:e,report:r,fetcher:o,mode:a,persistProject:n=!0}){let u={mockedPackages:this.disabledLocators,unstablePackages:this.conditionalLocators},A=o||this.configuration.makeFetcher(),p={checksums:this.storedChecksums,project:this,cache:e,fetcher:A,report:r,cacheOptions:u},h=Array.from(new Set(Ps(this.storedResolutions.values(),[C=>{let T=this.storedPackages.get(C);if(!T)throw new Error("Assertion failed: The locator should have been registered");return Qa(T)}])));a==="update-lockfile"&&(h=h.filter(C=>!this.storedChecksums.has(C)));let E=!1,w=Ws.progressViaCounter(h.length);await r.reportProgress(w);let D=(0,Rk.default)(CAt);if(await Wc(h.map(C=>D(async()=>{let T=this.storedPackages.get(C);if(!T)throw new Error("Assertion failed: The locator should have been registered");if(zc(T))return;let N;try{N=await A.fetch(T,p)}catch(U){U.message=`${jr(this.configuration,T)}: ${U.message}`,r.reportExceptionOnce(U),E=U;return}N.checksum!=null?this.storedChecksums.set(T.locatorHash,N.checksum):this.storedChecksums.delete(T.locatorHash),N.releaseFs&&N.releaseFs()}).finally(()=>{w.tick()}))),E)throw E;let b=n&&a!=="update-lockfile"?await this.cacheCleanup({cache:e,report:r}):null;if(r.cacheMisses.size>0||b){let T=(await Promise.all([...r.cacheMisses].map(async ue=>{let Ie=this.storedPackages.get(ue),he=this.storedChecksums.get(ue)??null,De=e.getLocatorPath(Ie,he);return(await ae.statPromise(De)).size}))).reduce((ue,Ie)=>ue+Ie,0)-(b?.size??0),N=r.cacheMisses.size,U=b?.count??0,z=`${TS(N,{zero:"No new packages",one:"A package was",more:`${Ut(this.configuration,N,Ct.NUMBER)} packages were`})} added to the project`,te=`${TS(U,{zero:"none were",one:"one was",more:`${Ut(this.configuration,U,Ct.NUMBER)} were`})} removed`,le=T!==0?` (${Ut(this.configuration,T,Ct.SIZE_DIFF)})`:"",ce=U>0?N>0?`${z}, and ${te}${le}.`:`${z}, but ${te}${le}.`:`${z}${le}.`;r.reportInfo(13,ce)}}async linkEverything({cache:e,report:r,fetcher:o,mode:a}){let n={mockedPackages:this.disabledLocators,unstablePackages:this.conditionalLocators,skipIntegrityCheck:!0},u=o||this.configuration.makeFetcher(),A={checksums:this.storedChecksums,project:this,cache:e,fetcher:u,report:r,cacheOptions:n},p=this.configuration.getLinkers(),h={project:this,report:r},E=new Map(p.map(Ce=>{let fe=Ce.makeInstaller(h),ie=Ce.getCustomDataKey(),Z=this.linkersCustomData.get(ie);return typeof Z<"u"&&fe.attachCustomData(Z),[Ce,fe]})),w=new Map,D=new Map,b=new Map,C=new Map(await Wc([...this.accessibleLocators].map(async Ce=>{let fe=this.storedPackages.get(Ce);if(!fe)throw new Error("Assertion failed: The locator should have been registered");return[Ce,await u.fetch(fe,A)]}))),T=[],N=new Set,U=[];for(let Ce of this.accessibleLocators){let fe=this.storedPackages.get(Ce);if(typeof fe>"u")throw new Error("Assertion failed: The locator should have been registered");let ie=C.get(fe.locatorHash);if(typeof ie>"u")throw new Error("Assertion failed: The fetch result should have been registered");let Z=[],Pe=ht=>{Z.push(ht)},Re=this.tryWorkspaceByLocator(fe);if(Re!==null){let ht=[],{scripts:q}=Re.manifest;for(let Le of["preinstall","install","postinstall"])q.has(Le)&&ht.push({type:0,script:Le});try{for(let[Le,Te]of E)if(Le.supportsPackage(fe,h)&&(await Te.installPackage(fe,ie,{holdFetchResult:Pe})).buildRequest!==null)throw new Error("Assertion failed: Linkers can't return build directives for workspaces; this responsibility befalls to the Yarn core")}finally{Z.length===0?ie.releaseFs?.():T.push(Wc(Z).catch(()=>{}).then(()=>{ie.releaseFs?.()}))}let nt=K.join(ie.packageFs.getRealPath(),ie.prefixPath);D.set(fe.locatorHash,nt),!zc(fe)&&ht.length>0&&b.set(fe.locatorHash,{buildDirectives:ht,buildLocations:[nt]})}else{let ht=p.find(Le=>Le.supportsPackage(fe,h));if(!ht)throw new zt(12,`${jr(this.configuration,fe)} isn't supported by any available linker`);let q=E.get(ht);if(!q)throw new Error("Assertion failed: The installer should have been registered");let nt;try{nt=await q.installPackage(fe,ie,{holdFetchResult:Pe})}finally{Z.length===0?ie.releaseFs?.():T.push(Wc(Z).then(()=>{}).then(()=>{ie.releaseFs?.()}))}w.set(fe.locatorHash,ht),D.set(fe.locatorHash,nt.packageLocation),nt.buildRequest&&nt.packageLocation&&(nt.buildRequest.skipped?(N.add(fe.locatorHash),this.skippedBuilds.has(fe.locatorHash)||U.push([fe,nt.buildRequest.explain])):b.set(fe.locatorHash,{buildDirectives:nt.buildRequest.directives,buildLocations:[nt.packageLocation]}))}}let z=new Map;for(let Ce of this.accessibleLocators){let fe=this.storedPackages.get(Ce);if(!fe)throw new Error("Assertion failed: The locator should have been registered");let ie=this.tryWorkspaceByLocator(fe)!==null,Z=async(Pe,Re)=>{let ht=D.get(fe.locatorHash);if(typeof ht>"u")throw new Error(`Assertion failed: The package (${jr(this.configuration,fe)}) should have been registered`);let q=[];for(let nt of fe.dependencies.values()){let Le=this.storedResolutions.get(nt.descriptorHash);if(typeof Le>"u")throw new Error(`Assertion failed: The resolution (${zn(this.configuration,nt)}, from ${jr(this.configuration,fe)})should have been registered`);let Te=this.storedPackages.get(Le);if(typeof Te>"u")throw new Error(`Assertion failed: The package (${Le}, resolved from ${zn(this.configuration,nt)}) should have been registered`);let ke=this.tryWorkspaceByLocator(Te)===null?w.get(Le):null;if(typeof ke>"u")throw new Error(`Assertion failed: The package (${Le}, resolved from ${zn(this.configuration,nt)}) should have been registered`);ke===Pe||ke===null?D.get(Te.locatorHash)!==null&&q.push([nt,Te]):!ie&&ht!==null&&u1(z,Le).push(ht)}ht!==null&&await Re.attachInternalDependencies(fe,q)};if(ie)for(let[Pe,Re]of E)Pe.supportsPackage(fe,h)&&await Z(Pe,Re);else{let Pe=w.get(fe.locatorHash);if(!Pe)throw new Error("Assertion failed: The linker should have been found");let Re=E.get(Pe);if(!Re)throw new Error("Assertion failed: The installer should have been registered");await Z(Pe,Re)}}for(let[Ce,fe]of z){let ie=this.storedPackages.get(Ce);if(!ie)throw new Error("Assertion failed: The package should have been registered");let Z=w.get(ie.locatorHash);if(!Z)throw new Error("Assertion failed: The linker should have been found");let Pe=E.get(Z);if(!Pe)throw new Error("Assertion failed: The installer should have been registered");await Pe.attachExternalDependents(ie,fe)}let te=new Map;for(let[Ce,fe]of E){let ie=await fe.finalizeInstall();for(let Z of ie?.records??[])Z.buildRequest.skipped?(N.add(Z.locator.locatorHash),this.skippedBuilds.has(Z.locator.locatorHash)||U.push([Z.locator,Z.buildRequest.explain])):b.set(Z.locator.locatorHash,{buildDirectives:Z.buildRequest.directives,buildLocations:Z.buildLocations});typeof ie?.customData<"u"&&te.set(Ce.getCustomDataKey(),ie.customData)}if(this.linkersCustomData=te,await Wc(T),a==="skip-build")return;for(let[,Ce]of Ps(U,([fe])=>Qa(fe)))Ce(r);let le=new Set(b.keys()),ce=(0,Qk.createHash)("sha512");ce.update(process.versions.node),await this.configuration.triggerHook(Ce=>Ce.globalHashGeneration,this,Ce=>{ce.update("\0"),ce.update(Ce)});let ue=ce.digest("hex"),Ie=new Map,he=Ce=>{let fe=Ie.get(Ce.locatorHash);if(typeof fe<"u")return fe;let ie=this.storedPackages.get(Ce.locatorHash);if(typeof ie>"u")throw new Error("Assertion failed: The package should have been registered");let Z=(0,Qk.createHash)("sha512");Z.update(Ce.locatorHash),Ie.set(Ce.locatorHash,"");for(let Pe of ie.dependencies.values()){let Re=this.storedResolutions.get(Pe.descriptorHash);if(typeof Re>"u")throw new Error(`Assertion failed: The resolution (${zn(this.configuration,Pe)}) should have been registered`);let ht=this.storedPackages.get(Re);if(typeof ht>"u")throw new Error("Assertion failed: The package should have been registered");Z.update(he(ht))}return fe=Z.digest("hex"),Ie.set(Ce.locatorHash,fe),fe},De=(Ce,fe)=>{let ie=(0,Qk.createHash)("sha512");ie.update(ue),ie.update(he(Ce));for(let Z of fe)ie.update(Z);return ie.digest("hex")},Ee=new Map,g=!1,me=Ce=>{let fe=new Set([Ce.locatorHash]);for(let ie of fe){let Z=this.storedPackages.get(ie);if(!Z)throw new Error("Assertion failed: The package should have been registered");for(let Pe of Z.dependencies.values()){let Re=this.storedResolutions.get(Pe.descriptorHash);if(!Re)throw new Error(`Assertion failed: The resolution (${zn(this.configuration,Pe)}) should have been registered`);if(Re!==Ce.locatorHash&&le.has(Re))return!1;let ht=this.storedPackages.get(Re);if(!ht)throw new Error("Assertion failed: The package should have been registered");let q=this.tryWorkspaceByLocator(ht);if(q){if(q.anchoredLocator.locatorHash!==Ce.locatorHash&&le.has(q.anchoredLocator.locatorHash))return!1;fe.add(q.anchoredLocator.locatorHash)}fe.add(Re)}}return!0};for(;le.size>0;){let Ce=le.size,fe=[];for(let ie of le){let Z=this.storedPackages.get(ie);if(!Z)throw new Error("Assertion failed: The package should have been registered");if(!me(Z))continue;let Pe=b.get(Z.locatorHash);if(!Pe)throw new Error("Assertion failed: The build directive should have been registered");let Re=De(Z,Pe.buildLocations);if(this.storedBuildState.get(Z.locatorHash)===Re){Ee.set(Z.locatorHash,Re),le.delete(ie);continue}g||(await this.persistInstallStateFile(),g=!0),this.storedBuildState.has(Z.locatorHash)?r.reportInfo(8,`${jr(this.configuration,Z)} must be rebuilt because its dependency tree changed`):r.reportInfo(7,`${jr(this.configuration,Z)} must be built because it never has been before or the last one failed`);let ht=Pe.buildLocations.map(async q=>{if(!K.isAbsolute(q))throw new Error(`Assertion failed: Expected the build location to be absolute (not ${q})`);for(let nt of Pe.buildDirectives){let Le=`# This file contains the result of Yarn building a package (${Qa(Z)}) `;switch(nt.type){case 0:Le+=`# Script name: ${nt.script} `;break;case 1:Le+=`# Script code: ${nt.script} `;break}let Te=null;if(!await ae.mktempPromise(async Ve=>{let xe=K.join(Ve,"build.log"),{stdout:tt,stderr:He}=this.configuration.getSubprocessStreams(xe,{header:Le,prefix:jr(this.configuration,Z),report:r}),x;try{switch(nt.type){case 0:x=await Db(Z,nt.script,[],{cwd:q,project:this,stdin:Te,stdout:tt,stderr:He});break;case 1:x=await n3(Z,nt.script,[],{cwd:q,project:this,stdin:Te,stdout:tt,stderr:He});break}}catch(y){He.write(y.stack),x=1}if(tt.end(),He.end(),x===0)return!0;ae.detachTemp(Ve);let I=`${jr(this.configuration,Z)} couldn't be built successfully (exit code ${Ut(this.configuration,x,Ct.NUMBER)}, logs can be found here: ${Ut(this.configuration,xe,Ct.PATH)})`,S=this.optionalBuilds.has(Z.locatorHash);return S?r.reportInfo(9,I):r.reportError(9,I),Nue&&r.reportFold(Ae.fromPortablePath(xe),ae.readFileSync(xe,"utf8")),S}))return!1}return!0});fe.push(...ht,Promise.allSettled(ht).then(q=>{le.delete(ie),q.every(nt=>nt.status==="fulfilled"&&nt.value===!0)&&Ee.set(Z.locatorHash,Re)}))}if(await Wc(fe),Ce===le.size){let ie=Array.from(le).map(Z=>{let Pe=this.storedPackages.get(Z);if(!Pe)throw new Error("Assertion failed: The package should have been registered");return jr(this.configuration,Pe)}).join(", ");r.reportError(3,`Some packages have circular dependencies that make their build order unsatisfiable - as a result they won't be built (affected packages are: ${ie})`);break}}this.storedBuildState=Ee,this.skippedBuilds=N}async installWithNewReport(e,r){return(await Lt.start({configuration:this.configuration,json:e.json,stdout:e.stdout,forceSectionAlignment:!0,includeLogs:!e.json&&!e.quiet,includeVersion:!0},async a=>{await this.install({...r,report:a})})).exitCode()}async install(e){let r=this.configuration.get("nodeLinker");Je.telemetry?.reportInstall(r);let o=!1;if(await e.report.startTimerPromise("Project validation",{skipIfEmpty:!0},async()=>{this.configuration.get("enableOfflineMode")&&e.report.reportWarning(90,"Offline work is enabled; Yarn won't fetch packages from the remote registry if it can avoid it"),await this.configuration.triggerHook(E=>E.validateProject,this,{reportWarning:(E,w)=>{e.report.reportWarning(E,w)},reportError:(E,w)=>{e.report.reportError(E,w),o=!0}})}),o)return;let a=await this.configuration.getPackageExtensions();for(let E of a.values())for(let[,w]of E)for(let D of w)D.status="inactive";let n=K.join(this.cwd,mr.lockfile),u=null;if(e.immutable)try{u=await ae.readFilePromise(n,"utf8")}catch(E){throw E.code==="ENOENT"?new zt(28,"The lockfile would have been created by this install, which is explicitly forbidden."):E}await e.report.startTimerPromise("Resolution step",async()=>{await this.resolveEverything(e)}),await e.report.startTimerPromise("Post-resolution validation",{skipIfEmpty:!0},async()=>{DAt(this,e.report);for(let[,E]of a)for(let[,w]of E)for(let D of w)if(D.userProvided){let b=Ut(this.configuration,D,Ct.PACKAGE_EXTENSION);switch(D.status){case"inactive":e.report.reportWarning(68,`${b}: No matching package in the dependency tree; you may not need this rule anymore.`);break;case"redundant":e.report.reportWarning(69,`${b}: This rule seems redundant when applied on the original package; the extension may have been applied upstream.`);break}}if(u!==null){let E=G0(u,this.generateLockfile());if(E!==u){let w=ehe(n,n,u,E,void 0,void 0,{maxEditLength:100});if(w){e.report.reportSeparator();for(let D of w.hunks){e.report.reportInfo(null,`@@ -${D.oldStart},${D.oldLines} +${D.newStart},${D.newLines} @@`);for(let b of D.lines)b.startsWith("+")?e.report.reportError(28,Ut(this.configuration,b,Ct.ADDED)):b.startsWith("-")?e.report.reportError(28,Ut(this.configuration,b,Ct.REMOVED)):e.report.reportInfo(null,Ut(this.configuration,b,"grey"))}e.report.reportSeparator()}throw new zt(28,"The lockfile would have been modified by this install, which is explicitly forbidden.")}}});for(let E of a.values())for(let[,w]of E)for(let D of w)D.userProvided&&D.status==="active"&&Je.telemetry?.reportPackageExtension(Ig(D,Ct.PACKAGE_EXTENSION));await e.report.startTimerPromise("Fetch step",async()=>{await this.fetchEverything(e)});let A=e.immutable?[...new Set(this.configuration.get("immutablePatterns"))].sort():[],p=await Promise.all(A.map(async E=>px(E,{cwd:this.cwd})));(typeof e.persistProject>"u"||e.persistProject)&&await this.persist(),await e.report.startTimerPromise("Link step",async()=>{if(e.mode==="update-lockfile"){e.report.reportWarning(73,`Skipped due to ${Ut(this.configuration,"mode=update-lockfile",Ct.CODE)}`);return}await this.linkEverything(e);let E=await Promise.all(A.map(async w=>px(w,{cwd:this.cwd})));for(let w=0;w{await this.configuration.triggerHook(E=>E.validateProjectAfterInstall,this,{reportWarning:(E,w)=>{e.report.reportWarning(E,w)},reportError:(E,w)=>{e.report.reportError(E,w),h=!0}})}),!h&&await this.configuration.triggerHook(E=>E.afterAllInstalled,this,e)}generateLockfile(){let e=new Map;for(let[n,u]of this.storedResolutions.entries()){let A=e.get(u);A||e.set(u,A=new Set),A.add(n)}let r={},{cacheKey:o}=Wr.getCacheKey(this.configuration);r.__metadata={version:Tk,cacheKey:o};for(let[n,u]of e.entries()){let A=this.originalPackages.get(n);if(!A)continue;let p=[];for(let w of u){let D=this.storedDescriptors.get(w);if(!D)throw new Error("Assertion failed: The descriptor should have been registered");p.push(D)}let h=p.map(w=>ka(w)).sort().join(", "),E=new _t;E.version=A.linkType==="HARD"?A.version:"0.0.0-use.local",E.languageName=A.languageName,E.dependencies=new Map(A.dependencies),E.peerDependencies=new Map(A.peerDependencies),E.dependenciesMeta=new Map(A.dependenciesMeta),E.peerDependenciesMeta=new Map(A.peerDependenciesMeta),E.bin=new Map(A.bin),r[h]={...E.exportTo({},{compatibilityMode:!1}),linkType:A.linkType.toLowerCase(),resolution:Qa(A),checksum:this.storedChecksums.get(A.locatorHash),conditions:A.conditions||void 0}}return`${[`# This file is generated by running "yarn install" inside your project. `,`# Manual changes might be lost - proceed with caution! `].join("")} `+Pa(r)}async persistLockfile(){let e=K.join(this.cwd,mr.lockfile),r="";try{r=await ae.readFilePromise(e,"utf8")}catch{}let o=this.generateLockfile(),a=G0(r,o);a!==r&&(await ae.writeFilePromise(e,a),this.lockFileChecksum=Ohe(a),this.lockfileNeedsRefresh=!1)}async persistInstallStateFile(){let e=[];for(let u of Object.values(f8))e.push(...u);let r=(0,Fk.default)(this,e),o=p8.default.serialize(r),a=zi(o);if(this.installStateChecksum===a)return;let n=this.configuration.get("installStatePath");await ae.mkdirPromise(K.dirname(n),{recursive:!0}),await ae.writeFilePromise(n,await IAt(o)),this.installStateChecksum=a}async restoreInstallState({restoreLinkersCustomData:e=!0,restoreResolutions:r=!0,restoreBuildState:o=!0}={}){let a=this.configuration.get("installStatePath"),n;try{let u=await wAt(await ae.readFilePromise(a));n=p8.default.deserialize(u),this.installStateChecksum=zi(u)}catch{r&&await this.applyLightResolution();return}e&&typeof n.linkersCustomData<"u"&&(this.linkersCustomData=n.linkersCustomData),o&&Object.assign(this,(0,Fk.default)(n,f8.restoreBuildState)),r&&(n.lockFileChecksum===this.lockFileChecksum?Object.assign(this,(0,Fk.default)(n,f8.restoreResolutions)):await this.applyLightResolution())}async applyLightResolution(){await this.resolveEverything({lockfileOnly:!0,report:new Ri}),await this.persistInstallStateFile()}async persist(){let e=(0,Rk.default)(4);await Promise.all([this.persistLockfile(),...this.workspaces.map(r=>e(()=>r.persistManifest()))])}async cacheCleanup({cache:e,report:r}){if(this.configuration.get("enableGlobalCache"))return null;let o=new Set([".gitignore"]);if(!n4(e.cwd,this.cwd)||!await ae.existsPromise(e.cwd))return null;let a=[];for(let u of await ae.readdirPromise(e.cwd)){if(o.has(u))continue;let A=K.resolve(e.cwd,u);e.markedFiles.has(A)||(e.immutable?r.reportError(56,`${Ut(this.configuration,K.basename(A),"magenta")} appears to be unused and would be marked for deletion, but the cache is immutable`):a.push(ae.lstatPromise(A).then(async p=>(await ae.removePromise(A),p.size))))}if(a.length===0)return null;let n=await Promise.all(a);return{count:a.length,size:n.reduce((u,A)=>u+A,0)}}}});function PAt(t){let o=Math.floor(t.timeNow/864e5),a=t.updateInterval*864e5,n=t.state.lastUpdate??t.timeNow+a+Math.floor(a*t.randomInitialInterval),u=n+a,A=t.state.lastTips??o*864e5,p=A+864e5+8*36e5-t.timeZone,h=u<=t.timeNow,E=p<=t.timeNow,w=null;return(h||E||!t.state.lastUpdate||!t.state.lastTips)&&(w={},w.lastUpdate=h?t.timeNow:n,w.lastTips=A,w.blocks=h?{}:t.state.blocks,w.displayedTips=t.state.displayedTips),{nextState:w,triggerUpdate:h,triggerTips:E,nextTips:E?o*864e5:A}}var sE,_he=It(()=>{Pt();r2();ah();eb();Gl();bf();sE=class{constructor(e,r){this.values=new Map;this.hits=new Map;this.enumerators=new Map;this.nextTips=0;this.displayedTips=[];this.shouldCommitTips=!1;this.configuration=e;let o=this.getRegistryPath();this.isNew=!ae.existsSync(o),this.shouldShowTips=!1,this.sendReport(r),this.startBuffer()}commitTips(){this.shouldShowTips&&(this.shouldCommitTips=!0)}selectTip(e){let r=new Set(this.displayedTips),o=A=>A&&nn?nA(nn,A):!1,a=e.map((A,p)=>p).filter(A=>e[A]&&o(e[A]?.selector));if(a.length===0)return null;let n=a.filter(A=>!r.has(A));if(n.length===0){let A=Math.floor(a.length*.2);this.displayedTips=A>0?this.displayedTips.slice(-A):[],n=a.filter(p=>!r.has(p))}let u=n[Math.floor(Math.random()*n.length)];return this.displayedTips.push(u),this.commitTips(),e[u]}reportVersion(e){this.reportValue("version",e.replace(/-git\..*/,"-git"))}reportCommandName(e){this.reportValue("commandName",e||"")}reportPluginName(e){this.reportValue("pluginName",e)}reportProject(e){this.reportEnumerator("projectCount",e)}reportInstall(e){this.reportHit("installCount",e)}reportPackageExtension(e){this.reportValue("packageExtension",e)}reportWorkspaceCount(e){this.reportValue("workspaceCount",String(e))}reportDependencyCount(e){this.reportValue("dependencyCount",String(e))}reportValue(e,r){zm(this.values,e).add(r)}reportEnumerator(e,r){zm(this.enumerators,e).add(zi(r))}reportHit(e,r="*"){let o=A1(this.hits,e),a=Al(o,r,()=>0);o.set(r,a+1)}getRegistryPath(){let e=this.configuration.get("globalFolder");return K.join(e,"telemetry.json")}sendReport(e){let r=this.getRegistryPath(),o;try{o=ae.readJsonSync(r)}catch{o={}}let{nextState:a,triggerUpdate:n,triggerTips:u,nextTips:A}=PAt({state:o,timeNow:Date.now(),timeZone:new Date().getTimezoneOffset()*60*1e3,randomInitialInterval:Math.random(),updateInterval:this.configuration.get("telemetryInterval")});if(this.nextTips=A,this.displayedTips=o.displayedTips??[],a!==null)try{ae.mkdirSync(K.dirname(r),{recursive:!0}),ae.writeJsonSync(r,a)}catch{return!1}if(u&&this.configuration.get("enableTips")&&(this.shouldShowTips=!0),n){let p=o.blocks??{};if(Object.keys(p).length===0){let h=`https://browser-http-intake.logs.datadoghq.eu/v1/input/${e}?ddsource=yarn`,E=w=>CU(h,w,{configuration:this.configuration}).catch(()=>{});for(let[w,D]of Object.entries(o.blocks??{})){if(Object.keys(D).length===0)continue;let b=D;b.userId=w,b.reportType="primary";for(let N of Object.keys(b.enumerators??{}))b.enumerators[N]=b.enumerators[N].length;E(b);let C=new Map,T=20;for(let[N,U]of Object.entries(b.values))U.length>0&&C.set(N,U.slice(0,T));for(;C.size>0;){let N={};N.userId=w,N.reportType="secondary",N.metrics={};for(let[U,z]of C)N.metrics[U]=z.shift(),z.length===0&&C.delete(U);E(N)}}}}return!0}applyChanges(){let e=this.getRegistryPath(),r;try{r=ae.readJsonSync(e)}catch{r={}}let o=this.configuration.get("telemetryUserId")??"*",a=r.blocks=r.blocks??{},n=a[o]=a[o]??{};for(let u of this.hits.keys()){let A=n.hits=n.hits??{},p=A[u]=A[u]??{};for(let[h,E]of this.hits.get(u))p[h]=(p[h]??0)+E}for(let u of["values","enumerators"])for(let A of this[u].keys()){let p=n[u]=n[u]??{};p[A]=[...new Set([...p[A]??[],...this[u].get(A)??[]])]}this.shouldCommitTips&&(r.lastTips=this.nextTips,r.displayedTips=this.displayedTips),ae.mkdirSync(K.dirname(e),{recursive:!0}),ae.writeJsonSync(e,r)}startBuffer(){process.on("exit",()=>{try{this.applyChanges()}catch{}})}}});var P2={};Kt(P2,{BuildDirectiveType:()=>Sk,CACHE_CHECKPOINT:()=>K_,CACHE_VERSION:()=>Pk,Cache:()=>Wr,Configuration:()=>Je,DEFAULT_RC_FILENAME:()=>SU,FormatType:()=>yce,InstallMode:()=>yl,LEGACY_PLUGINS:()=>j1,LOCKFILE_VERSION:()=>Tk,LegacyMigrationResolver:()=>tE,LightReport:()=>pA,LinkType:()=>$m,LockfileResolver:()=>rE,Manifest:()=>_t,MessageName:()=>vr,MultiFetcher:()=>py,PackageExtensionStatus:()=>sO,PackageExtensionType:()=>iO,PeerWarningType:()=>Lk,Project:()=>Qt,Report:()=>Ws,ReportError:()=>zt,SettingsType:()=>G1,StreamReport:()=>Lt,TAG_REGEXP:()=>by,TelemetryManager:()=>sE,ThrowReport:()=>Ri,VirtualFetcher:()=>hy,WindowsLinkType:()=>ab,Workspace:()=>iE,WorkspaceFetcher:()=>gy,WorkspaceResolver:()=>ci,YarnVersion:()=>nn,execUtils:()=>Hr,folderUtils:()=>Bx,formatUtils:()=>pe,hashUtils:()=>bn,httpUtils:()=>on,miscUtils:()=>qe,nodeUtils:()=>Xi,parseMessageName:()=>qP,reportOptionDeprecations:()=>Qy,scriptUtils:()=>hn,semverUtils:()=>Ur,stringifyMessageName:()=>zu,structUtils:()=>G,tgzUtils:()=>$i,treeUtils:()=>As});var Ke=It(()=>{nb();vx();Wl();ah();eb();Gl();rb();a3();bf();Io();_pe();Kpe();V_();W1();W1();zpe();z_();Jpe();J_();Ay();jP();YM();Uhe();Vl();n2();_he();u8();VM();zM();Dg();A8();r2();iie()});var Yhe=_((b_t,x2)=>{"use strict";var xAt=process.env.TERM_PROGRAM==="Hyper",bAt=process.platform==="win32",jhe=process.platform==="linux",d8={ballotDisabled:"\u2612",ballotOff:"\u2610",ballotOn:"\u2611",bullet:"\u2022",bulletWhite:"\u25E6",fullBlock:"\u2588",heart:"\u2764",identicalTo:"\u2261",line:"\u2500",mark:"\u203B",middot:"\xB7",minus:"\uFF0D",multiplication:"\xD7",obelus:"\xF7",pencilDownRight:"\u270E",pencilRight:"\u270F",pencilUpRight:"\u2710",percent:"%",pilcrow2:"\u2761",pilcrow:"\xB6",plusMinus:"\xB1",section:"\xA7",starsOff:"\u2606",starsOn:"\u2605",upDownArrow:"\u2195"},Ghe=Object.assign({},d8,{check:"\u221A",cross:"\xD7",ellipsisLarge:"...",ellipsis:"...",info:"i",question:"?",questionSmall:"?",pointer:">",pointerSmall:"\xBB",radioOff:"( )",radioOn:"(*)",warning:"\u203C"}),Whe=Object.assign({},d8,{ballotCross:"\u2718",check:"\u2714",cross:"\u2716",ellipsisLarge:"\u22EF",ellipsis:"\u2026",info:"\u2139",question:"?",questionFull:"\uFF1F",questionSmall:"\uFE56",pointer:jhe?"\u25B8":"\u276F",pointerSmall:jhe?"\u2023":"\u203A",radioOff:"\u25EF",radioOn:"\u25C9",warning:"\u26A0"});x2.exports=bAt&&!xAt?Ghe:Whe;Reflect.defineProperty(x2.exports,"common",{enumerable:!1,value:d8});Reflect.defineProperty(x2.exports,"windows",{enumerable:!1,value:Ghe});Reflect.defineProperty(x2.exports,"other",{enumerable:!1,value:Whe})});var eu=_((k_t,m8)=>{"use strict";var kAt=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),QAt=/[\u001b\u009b][[\]#;?()]*(?:(?:(?:[^\W_]*;?[^\W_]*)\u0007)|(?:(?:[0-9]{1,4}(;[0-9]{0,4})*)?[~0-9=<>cf-nqrtyA-PRZ]))/g,Khe=()=>{let t={enabled:!0,visible:!0,styles:{},keys:{}};"FORCE_COLOR"in process.env&&(t.enabled=process.env.FORCE_COLOR!=="0");let e=n=>{let u=n.open=`\x1B[${n.codes[0]}m`,A=n.close=`\x1B[${n.codes[1]}m`,p=n.regex=new RegExp(`\\u001b\\[${n.codes[1]}m`,"g");return n.wrap=(h,E)=>{h.includes(A)&&(h=h.replace(p,A+u));let w=u+h+A;return E?w.replace(/\r*\n/g,`${A}$&${u}`):w},n},r=(n,u,A)=>typeof n=="function"?n(u):n.wrap(u,A),o=(n,u)=>{if(n===""||n==null)return"";if(t.enabled===!1)return n;if(t.visible===!1)return"";let A=""+n,p=A.includes(` `),h=u.length;for(h>0&&u.includes("unstyle")&&(u=[...new Set(["unstyle",...u])].reverse());h-- >0;)A=r(t.styles[u[h]],A,p);return A},a=(n,u,A)=>{t.styles[n]=e({name:n,codes:u}),(t.keys[A]||(t.keys[A]=[])).push(n),Reflect.defineProperty(t,n,{configurable:!0,enumerable:!0,set(h){t.alias(n,h)},get(){let h=E=>o(E,h.stack);return Reflect.setPrototypeOf(h,t),h.stack=this.stack?this.stack.concat(n):[n],h}})};return a("reset",[0,0],"modifier"),a("bold",[1,22],"modifier"),a("dim",[2,22],"modifier"),a("italic",[3,23],"modifier"),a("underline",[4,24],"modifier"),a("inverse",[7,27],"modifier"),a("hidden",[8,28],"modifier"),a("strikethrough",[9,29],"modifier"),a("black",[30,39],"color"),a("red",[31,39],"color"),a("green",[32,39],"color"),a("yellow",[33,39],"color"),a("blue",[34,39],"color"),a("magenta",[35,39],"color"),a("cyan",[36,39],"color"),a("white",[37,39],"color"),a("gray",[90,39],"color"),a("grey",[90,39],"color"),a("bgBlack",[40,49],"bg"),a("bgRed",[41,49],"bg"),a("bgGreen",[42,49],"bg"),a("bgYellow",[43,49],"bg"),a("bgBlue",[44,49],"bg"),a("bgMagenta",[45,49],"bg"),a("bgCyan",[46,49],"bg"),a("bgWhite",[47,49],"bg"),a("blackBright",[90,39],"bright"),a("redBright",[91,39],"bright"),a("greenBright",[92,39],"bright"),a("yellowBright",[93,39],"bright"),a("blueBright",[94,39],"bright"),a("magentaBright",[95,39],"bright"),a("cyanBright",[96,39],"bright"),a("whiteBright",[97,39],"bright"),a("bgBlackBright",[100,49],"bgBright"),a("bgRedBright",[101,49],"bgBright"),a("bgGreenBright",[102,49],"bgBright"),a("bgYellowBright",[103,49],"bgBright"),a("bgBlueBright",[104,49],"bgBright"),a("bgMagentaBright",[105,49],"bgBright"),a("bgCyanBright",[106,49],"bgBright"),a("bgWhiteBright",[107,49],"bgBright"),t.ansiRegex=QAt,t.hasColor=t.hasAnsi=n=>(t.ansiRegex.lastIndex=0,typeof n=="string"&&n!==""&&t.ansiRegex.test(n)),t.alias=(n,u)=>{let A=typeof u=="string"?t[u]:u;if(typeof A!="function")throw new TypeError("Expected alias to be the name of an existing color (string) or a function");A.stack||(Reflect.defineProperty(A,"name",{value:n}),t.styles[n]=A,A.stack=[n]),Reflect.defineProperty(t,n,{configurable:!0,enumerable:!0,set(p){t.alias(n,p)},get(){let p=h=>o(h,p.stack);return Reflect.setPrototypeOf(p,t),p.stack=this.stack?this.stack.concat(A.stack):A.stack,p}})},t.theme=n=>{if(!kAt(n))throw new TypeError("Expected theme to be an object");for(let u of Object.keys(n))t.alias(u,n[u]);return t},t.alias("unstyle",n=>typeof n=="string"&&n!==""?(t.ansiRegex.lastIndex=0,n.replace(t.ansiRegex,"")):""),t.alias("noop",n=>n),t.none=t.clear=t.noop,t.stripColor=t.unstyle,t.symbols=Yhe(),t.define=a,t};m8.exports=Khe();m8.exports.create=Khe});var xo=_(an=>{"use strict";var FAt=Object.prototype.toString,ic=eu(),Vhe=!1,y8=[],zhe={yellow:"blue",cyan:"red",green:"magenta",black:"white",blue:"yellow",red:"cyan",magenta:"green",white:"black"};an.longest=(t,e)=>t.reduce((r,o)=>Math.max(r,e?o[e].length:o.length),0);an.hasColor=t=>!!t&&ic.hasColor(t);var Ok=an.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);an.nativeType=t=>FAt.call(t).slice(8,-1).toLowerCase().replace(/\s/g,"");an.isAsyncFn=t=>an.nativeType(t)==="asyncfunction";an.isPrimitive=t=>t!=null&&typeof t!="object"&&typeof t!="function";an.resolve=(t,e,...r)=>typeof e=="function"?e.call(t,...r):e;an.scrollDown=(t=[])=>[...t.slice(1),t[0]];an.scrollUp=(t=[])=>[t.pop(),...t];an.reorder=(t=[])=>{let e=t.slice();return e.sort((r,o)=>r.index>o.index?1:r.index{let o=t.length,a=r===o?0:r<0?o-1:r,n=t[e];t[e]=t[a],t[a]=n};an.width=(t,e=80)=>{let r=t&&t.columns?t.columns:e;return t&&typeof t.getWindowSize=="function"&&(r=t.getWindowSize()[0]),process.platform==="win32"?r-1:r};an.height=(t,e=20)=>{let r=t&&t.rows?t.rows:e;return t&&typeof t.getWindowSize=="function"&&(r=t.getWindowSize()[1]),r};an.wordWrap=(t,e={})=>{if(!t)return t;typeof e=="number"&&(e={width:e});let{indent:r="",newline:o=` `+r,width:a=80}=e,n=(o+r).match(/[^\S\n]/g)||[];a-=n.length;let u=`.{1,${a}}([\\s\\u200B]+|$)|[^\\s\\u200B]+?([\\s\\u200B]+|$)`,A=t.trim(),p=new RegExp(u,"g"),h=A.match(p)||[];return h=h.map(E=>E.replace(/\n$/,"")),e.padEnd&&(h=h.map(E=>E.padEnd(a," "))),e.padStart&&(h=h.map(E=>E.padStart(a," "))),r+h.join(o)};an.unmute=t=>{let e=t.stack.find(o=>ic.keys.color.includes(o));return e?ic[e]:t.stack.find(o=>o.slice(2)==="bg")?ic[e.slice(2)]:o=>o};an.pascal=t=>t?t[0].toUpperCase()+t.slice(1):"";an.inverse=t=>{if(!t||!t.stack)return t;let e=t.stack.find(o=>ic.keys.color.includes(o));if(e){let o=ic["bg"+an.pascal(e)];return o?o.black:t}let r=t.stack.find(o=>o.slice(0,2)==="bg");return r?ic[r.slice(2).toLowerCase()]||t:ic.none};an.complement=t=>{if(!t||!t.stack)return t;let e=t.stack.find(o=>ic.keys.color.includes(o)),r=t.stack.find(o=>o.slice(0,2)==="bg");if(e&&!r)return ic[zhe[e]||e];if(r){let o=r.slice(2).toLowerCase(),a=zhe[o];return a&&ic["bg"+an.pascal(a)]||t}return ic.none};an.meridiem=t=>{let e=t.getHours(),r=t.getMinutes(),o=e>=12?"pm":"am";e=e%12;let a=e===0?12:e,n=r<10?"0"+r:r;return a+":"+n+" "+o};an.set=(t={},e="",r)=>e.split(".").reduce((o,a,n,u)=>{let A=u.length-1>n?o[a]||{}:r;return!an.isObject(A)&&n{let o=t[e]==null?e.split(".").reduce((a,n)=>a&&a[n],t):t[e];return o??r};an.mixin=(t,e)=>{if(!Ok(t))return e;if(!Ok(e))return t;for(let r of Object.keys(e)){let o=Object.getOwnPropertyDescriptor(e,r);if(o.hasOwnProperty("value"))if(t.hasOwnProperty(r)&&Ok(o.value)){let a=Object.getOwnPropertyDescriptor(t,r);Ok(a.value)?t[r]=an.merge({},t[r],e[r]):Reflect.defineProperty(t,r,o)}else Reflect.defineProperty(t,r,o);else Reflect.defineProperty(t,r,o)}return t};an.merge=(...t)=>{let e={};for(let r of t)an.mixin(e,r);return e};an.mixinEmitter=(t,e)=>{let r=e.constructor.prototype;for(let o of Object.keys(r)){let a=r[o];typeof a=="function"?an.define(t,o,a.bind(e)):an.define(t,o,a)}};an.onExit=t=>{let e=(r,o)=>{Vhe||(Vhe=!0,y8.forEach(a=>a()),r===!0&&process.exit(128+o))};y8.length===0&&(process.once("SIGTERM",e.bind(null,!0,15)),process.once("SIGINT",e.bind(null,!0,2)),process.once("exit",e)),y8.push(t)};an.define=(t,e,r)=>{Reflect.defineProperty(t,e,{value:r})};an.defineExport=(t,e,r)=>{let o;Reflect.defineProperty(t,e,{enumerable:!0,configurable:!0,set(a){o=a},get(){return o?o():r()}})}});var Jhe=_(cE=>{"use strict";cE.ctrl={a:"first",b:"backward",c:"cancel",d:"deleteForward",e:"last",f:"forward",g:"reset",i:"tab",k:"cutForward",l:"reset",n:"newItem",m:"cancel",j:"submit",p:"search",r:"remove",s:"save",u:"undo",w:"cutLeft",x:"toggleCursor",v:"paste"};cE.shift={up:"shiftUp",down:"shiftDown",left:"shiftLeft",right:"shiftRight",tab:"prev"};cE.fn={up:"pageUp",down:"pageDown",left:"pageLeft",right:"pageRight",delete:"deleteForward"};cE.option={b:"backward",f:"forward",d:"cutRight",left:"cutLeft",up:"altUp",down:"altDown"};cE.keys={pageup:"pageUp",pagedown:"pageDown",home:"home",end:"end",cancel:"cancel",delete:"deleteForward",backspace:"delete",down:"down",enter:"submit",escape:"cancel",left:"left",space:"space",number:"number",return:"submit",right:"right",tab:"next",up:"up"}});var $he=_((R_t,Zhe)=>{"use strict";var Xhe=ve("readline"),RAt=Jhe(),TAt=/^(?:\x1b)([a-zA-Z0-9])$/,LAt=/^(?:\x1b+)(O|N|\[|\[\[)(?:(\d+)(?:;(\d+))?([~^$])|(?:1;)?(\d+)?([a-zA-Z]))/,NAt={OP:"f1",OQ:"f2",OR:"f3",OS:"f4","[11~":"f1","[12~":"f2","[13~":"f3","[14~":"f4","[[A":"f1","[[B":"f2","[[C":"f3","[[D":"f4","[[E":"f5","[15~":"f5","[17~":"f6","[18~":"f7","[19~":"f8","[20~":"f9","[21~":"f10","[23~":"f11","[24~":"f12","[A":"up","[B":"down","[C":"right","[D":"left","[E":"clear","[F":"end","[H":"home",OA:"up",OB:"down",OC:"right",OD:"left",OE:"clear",OF:"end",OH:"home","[1~":"home","[2~":"insert","[3~":"delete","[4~":"end","[5~":"pageup","[6~":"pagedown","[[5~":"pageup","[[6~":"pagedown","[7~":"home","[8~":"end","[a":"up","[b":"down","[c":"right","[d":"left","[e":"clear","[2$":"insert","[3$":"delete","[5$":"pageup","[6$":"pagedown","[7$":"home","[8$":"end",Oa:"up",Ob:"down",Oc:"right",Od:"left",Oe:"clear","[2^":"insert","[3^":"delete","[5^":"pageup","[6^":"pagedown","[7^":"home","[8^":"end","[Z":"tab"};function OAt(t){return["[a","[b","[c","[d","[e","[2$","[3$","[5$","[6$","[7$","[8$","[Z"].includes(t)}function MAt(t){return["Oa","Ob","Oc","Od","Oe","[2^","[3^","[5^","[6^","[7^","[8^"].includes(t)}var Mk=(t="",e={})=>{let r,o={name:e.name,ctrl:!1,meta:!1,shift:!1,option:!1,sequence:t,raw:t,...e};if(Buffer.isBuffer(t)?t[0]>127&&t[1]===void 0?(t[0]-=128,t="\x1B"+String(t)):t=String(t):t!==void 0&&typeof t!="string"?t=String(t):t||(t=o.sequence||""),o.sequence=o.sequence||t||o.name,t==="\r")o.raw=void 0,o.name="return";else if(t===` `)o.name="enter";else if(t===" ")o.name="tab";else if(t==="\b"||t==="\x7F"||t==="\x1B\x7F"||t==="\x1B\b")o.name="backspace",o.meta=t.charAt(0)==="\x1B";else if(t==="\x1B"||t==="\x1B\x1B")o.name="escape",o.meta=t.length===2;else if(t===" "||t==="\x1B ")o.name="space",o.meta=t.length===2;else if(t<="")o.name=String.fromCharCode(t.charCodeAt(0)+97-1),o.ctrl=!0;else if(t.length===1&&t>="0"&&t<="9")o.name="number";else if(t.length===1&&t>="a"&&t<="z")o.name=t;else if(t.length===1&&t>="A"&&t<="Z")o.name=t.toLowerCase(),o.shift=!0;else if(r=TAt.exec(t))o.meta=!0,o.shift=/^[A-Z]$/.test(r[1]);else if(r=LAt.exec(t)){let a=[...t];a[0]==="\x1B"&&a[1]==="\x1B"&&(o.option=!0);let n=[r[1],r[2],r[4],r[6]].filter(Boolean).join(""),u=(r[3]||r[5]||1)-1;o.ctrl=!!(u&4),o.meta=!!(u&10),o.shift=!!(u&1),o.code=n,o.name=NAt[n],o.shift=OAt(n)||o.shift,o.ctrl=MAt(n)||o.ctrl}return o};Mk.listen=(t={},e)=>{let{stdin:r}=t;if(!r||r!==process.stdin&&!r.isTTY)throw new Error("Invalid stream passed");let o=Xhe.createInterface({terminal:!0,input:r});Xhe.emitKeypressEvents(r,o);let a=(A,p)=>e(A,Mk(A,p),o),n=r.isRaw;return r.isTTY&&r.setRawMode(!0),r.on("keypress",a),o.resume(),()=>{r.isTTY&&r.setRawMode(n),r.removeListener("keypress",a),o.pause(),o.close()}};Mk.action=(t,e,r)=>{let o={...RAt,...r};return e.ctrl?(e.action=o.ctrl[e.name],e):e.option&&o.option?(e.action=o.option[e.name],e):e.shift?(e.action=o.shift[e.name],e):(e.action=o.keys[e.name],e)};Zhe.exports=Mk});var t0e=_((T_t,e0e)=>{"use strict";e0e.exports=t=>{t.timers=t.timers||{};let e=t.options.timers;if(e)for(let r of Object.keys(e)){let o=e[r];typeof o=="number"&&(o={interval:o}),UAt(t,r,o)}};function UAt(t,e,r={}){let o=t.timers[e]={name:e,start:Date.now(),ms:0,tick:0},a=r.interval||120;o.frames=r.frames||[],o.loading=!0;let n=setInterval(()=>{o.ms=Date.now()-o.start,o.tick++,t.render()},a);return o.stop=()=>{o.loading=!1,clearInterval(n)},Reflect.defineProperty(o,"interval",{value:n}),t.once("close",()=>o.stop()),o.stop}});var n0e=_((L_t,r0e)=>{"use strict";var{define:_At,width:HAt}=xo(),E8=class{constructor(e){let r=e.options;_At(this,"_prompt",e),this.type=e.type,this.name=e.name,this.message="",this.header="",this.footer="",this.error="",this.hint="",this.input="",this.cursor=0,this.index=0,this.lines=0,this.tick=0,this.prompt="",this.buffer="",this.width=HAt(r.stdout||process.stdout),Object.assign(this,r),this.name=this.name||this.message,this.message=this.message||this.name,this.symbols=e.symbols,this.styles=e.styles,this.required=new Set,this.cancelled=!1,this.submitted=!1}clone(){let e={...this};return e.status=this.status,e.buffer=Buffer.from(e.buffer),delete e.clone,e}set color(e){this._color=e}get color(){let e=this.prompt.styles;if(this.cancelled)return e.cancelled;if(this.submitted)return e.submitted;let r=this._color||e[this.status];return typeof r=="function"?r:e.pending}set loading(e){this._loading=e}get loading(){return typeof this._loading=="boolean"?this._loading:this.loadingChoices?"choices":!1}get status(){return this.cancelled?"cancelled":this.submitted?"submitted":"pending"}};r0e.exports=E8});var s0e=_((N_t,i0e)=>{"use strict";var C8=xo(),Ks=eu(),I8={default:Ks.noop,noop:Ks.noop,set inverse(t){this._inverse=t},get inverse(){return this._inverse||C8.inverse(this.primary)},set complement(t){this._complement=t},get complement(){return this._complement||C8.complement(this.primary)},primary:Ks.cyan,success:Ks.green,danger:Ks.magenta,strong:Ks.bold,warning:Ks.yellow,muted:Ks.dim,disabled:Ks.gray,dark:Ks.dim.gray,underline:Ks.underline,set info(t){this._info=t},get info(){return this._info||this.primary},set em(t){this._em=t},get em(){return this._em||this.primary.underline},set heading(t){this._heading=t},get heading(){return this._heading||this.muted.underline},set pending(t){this._pending=t},get pending(){return this._pending||this.primary},set submitted(t){this._submitted=t},get submitted(){return this._submitted||this.success},set cancelled(t){this._cancelled=t},get cancelled(){return this._cancelled||this.danger},set typing(t){this._typing=t},get typing(){return this._typing||this.dim},set placeholder(t){this._placeholder=t},get placeholder(){return this._placeholder||this.primary.dim},set highlight(t){this._highlight=t},get highlight(){return this._highlight||this.inverse}};I8.merge=(t={})=>{t.styles&&typeof t.styles.enabled=="boolean"&&(Ks.enabled=t.styles.enabled),t.styles&&typeof t.styles.visible=="boolean"&&(Ks.visible=t.styles.visible);let e=C8.merge({},I8,t.styles);delete e.merge;for(let r of Object.keys(Ks))e.hasOwnProperty(r)||Reflect.defineProperty(e,r,{get:()=>Ks[r]});for(let r of Object.keys(Ks.styles))e.hasOwnProperty(r)||Reflect.defineProperty(e,r,{get:()=>Ks[r]});return e};i0e.exports=I8});var a0e=_((O_t,o0e)=>{"use strict";var w8=process.platform==="win32",Yf=eu(),qAt=xo(),B8={...Yf.symbols,upDownDoubleArrow:"\u21D5",upDownDoubleArrow2:"\u2B0D",upDownArrow:"\u2195",asterisk:"*",asterism:"\u2042",bulletWhite:"\u25E6",electricArrow:"\u2301",ellipsisLarge:"\u22EF",ellipsisSmall:"\u2026",fullBlock:"\u2588",identicalTo:"\u2261",indicator:Yf.symbols.check,leftAngle:"\u2039",mark:"\u203B",minus:"\u2212",multiplication:"\xD7",obelus:"\xF7",percent:"%",pilcrow:"\xB6",pilcrow2:"\u2761",pencilUpRight:"\u2710",pencilDownRight:"\u270E",pencilRight:"\u270F",plus:"+",plusMinus:"\xB1",pointRight:"\u261E",rightAngle:"\u203A",section:"\xA7",hexagon:{off:"\u2B21",on:"\u2B22",disabled:"\u2B22"},ballot:{on:"\u2611",off:"\u2610",disabled:"\u2612"},stars:{on:"\u2605",off:"\u2606",disabled:"\u2606"},folder:{on:"\u25BC",off:"\u25B6",disabled:"\u25B6"},prefix:{pending:Yf.symbols.question,submitted:Yf.symbols.check,cancelled:Yf.symbols.cross},separator:{pending:Yf.symbols.pointerSmall,submitted:Yf.symbols.middot,cancelled:Yf.symbols.middot},radio:{off:w8?"( )":"\u25EF",on:w8?"(*)":"\u25C9",disabled:w8?"(|)":"\u24BE"},numbers:["\u24EA","\u2460","\u2461","\u2462","\u2463","\u2464","\u2465","\u2466","\u2467","\u2468","\u2469","\u246A","\u246B","\u246C","\u246D","\u246E","\u246F","\u2470","\u2471","\u2472","\u2473","\u3251","\u3252","\u3253","\u3254","\u3255","\u3256","\u3257","\u3258","\u3259","\u325A","\u325B","\u325C","\u325D","\u325E","\u325F","\u32B1","\u32B2","\u32B3","\u32B4","\u32B5","\u32B6","\u32B7","\u32B8","\u32B9","\u32BA","\u32BB","\u32BC","\u32BD","\u32BE","\u32BF"]};B8.merge=t=>{let e=qAt.merge({},Yf.symbols,B8,t.symbols);return delete e.merge,e};o0e.exports=B8});var c0e=_((M_t,l0e)=>{"use strict";var jAt=s0e(),GAt=a0e(),WAt=xo();l0e.exports=t=>{t.options=WAt.merge({},t.options.theme,t.options),t.symbols=GAt.merge(t.options),t.styles=jAt.merge(t.options)}});var h0e=_((f0e,p0e)=>{"use strict";var u0e=process.env.TERM_PROGRAM==="Apple_Terminal",YAt=eu(),v8=xo(),tu=p0e.exports=f0e,Si="\x1B[",A0e="\x07",D8=!1,kh=tu.code={bell:A0e,beep:A0e,beginning:`${Si}G`,down:`${Si}J`,esc:Si,getPosition:`${Si}6n`,hide:`${Si}?25l`,line:`${Si}2K`,lineEnd:`${Si}K`,lineStart:`${Si}1K`,restorePosition:Si+(u0e?"8":"u"),savePosition:Si+(u0e?"7":"s"),screen:`${Si}2J`,show:`${Si}?25h`,up:`${Si}1J`},Yg=tu.cursor={get hidden(){return D8},hide(){return D8=!0,kh.hide},show(){return D8=!1,kh.show},forward:(t=1)=>`${Si}${t}C`,backward:(t=1)=>`${Si}${t}D`,nextLine:(t=1)=>`${Si}E`.repeat(t),prevLine:(t=1)=>`${Si}F`.repeat(t),up:(t=1)=>t?`${Si}${t}A`:"",down:(t=1)=>t?`${Si}${t}B`:"",right:(t=1)=>t?`${Si}${t}C`:"",left:(t=1)=>t?`${Si}${t}D`:"",to(t,e){return e?`${Si}${e+1};${t+1}H`:`${Si}${t+1}G`},move(t=0,e=0){let r="";return r+=t<0?Yg.left(-t):t>0?Yg.right(t):"",r+=e<0?Yg.up(-e):e>0?Yg.down(e):"",r},restore(t={}){let{after:e,cursor:r,initial:o,input:a,prompt:n,size:u,value:A}=t;if(o=v8.isPrimitive(o)?String(o):"",a=v8.isPrimitive(a)?String(a):"",A=v8.isPrimitive(A)?String(A):"",u){let p=tu.cursor.up(u)+tu.cursor.to(n.length),h=a.length-r;return h>0&&(p+=tu.cursor.left(h)),p}if(A||e){let p=!a&&o?-o.length:-a.length+r;return e&&(p-=e.length),a===""&&o&&!n.includes(o)&&(p+=o.length),tu.cursor.move(p)}}},P8=tu.erase={screen:kh.screen,up:kh.up,down:kh.down,line:kh.line,lineEnd:kh.lineEnd,lineStart:kh.lineStart,lines(t){let e="";for(let r=0;r{if(!e)return P8.line+Yg.to(0);let r=n=>[...YAt.unstyle(n)].length,o=t.split(/\r?\n/),a=0;for(let n of o)a+=1+Math.floor(Math.max(r(n)-1,0)/e);return(P8.line+Yg.prevLine()).repeat(a-1)+P8.line+Yg.to(0)}});var uE=_((U_t,d0e)=>{"use strict";var KAt=ve("events"),g0e=eu(),S8=$he(),VAt=t0e(),zAt=n0e(),JAt=c0e(),Na=xo(),Kg=h0e(),x8=class t extends KAt{constructor(e={}){super(),this.name=e.name,this.type=e.type,this.options=e,JAt(this),VAt(this),this.state=new zAt(this),this.initial=[e.initial,e.default].find(r=>r!=null),this.stdout=e.stdout||process.stdout,this.stdin=e.stdin||process.stdin,this.scale=e.scale||1,this.term=this.options.term||process.env.TERM_PROGRAM,this.margin=ZAt(this.options.margin),this.setMaxListeners(0),XAt(this)}async keypress(e,r={}){this.keypressed=!0;let o=S8.action(e,S8(e,r),this.options.actions);this.state.keypress=o,this.emit("keypress",e,o),this.emit("state",this.state.clone());let a=this.options[o.action]||this[o.action]||this.dispatch;if(typeof a=="function")return await a.call(this,e,o);this.alert()}alert(){delete this.state.alert,this.options.show===!1?this.emit("alert"):this.stdout.write(Kg.code.beep)}cursorHide(){this.stdout.write(Kg.cursor.hide()),Na.onExit(()=>this.cursorShow())}cursorShow(){this.stdout.write(Kg.cursor.show())}write(e){e&&(this.stdout&&this.state.show!==!1&&this.stdout.write(e),this.state.buffer+=e)}clear(e=0){let r=this.state.buffer;this.state.buffer="",!(!r&&!e||this.options.show===!1)&&this.stdout.write(Kg.cursor.down(e)+Kg.clear(r,this.width))}restore(){if(this.state.closed||this.options.show===!1)return;let{prompt:e,after:r,rest:o}=this.sections(),{cursor:a,initial:n="",input:u="",value:A=""}=this,p=this.state.size=o.length,h={after:r,cursor:a,initial:n,input:u,prompt:e,size:p,value:A},E=Kg.cursor.restore(h);E&&this.stdout.write(E)}sections(){let{buffer:e,input:r,prompt:o}=this.state;o=g0e.unstyle(o);let a=g0e.unstyle(e),n=a.indexOf(o),u=a.slice(0,n),p=a.slice(n).split(` `),h=p[0],E=p[p.length-1],D=(o+(r?" "+r:"")).length,b=De.call(this,this.value),this.result=()=>o.call(this,this.value),typeof r.initial=="function"&&(this.initial=await r.initial.call(this,this)),typeof r.onRun=="function"&&await r.onRun.call(this,this),typeof r.onSubmit=="function"){let a=r.onSubmit.bind(this),n=this.submit.bind(this);delete this.options.onSubmit,this.submit=async()=>(await a(this.name,this.value,this),n())}await this.start(),await this.render()}render(){throw new Error("expected prompt to have a custom render method")}run(){return new Promise(async(e,r)=>{if(this.once("submit",e),this.once("cancel",r),await this.skip())return this.render=()=>{},this.submit();await this.initialize(),this.emit("run")})}async element(e,r,o){let{options:a,state:n,symbols:u,timers:A}=this,p=A&&A[e];n.timer=p;let h=a[e]||n[e]||u[e],E=r&&r[e]!=null?r[e]:await h;if(E==="")return E;let w=await this.resolve(E,n,r,o);return!w&&r&&r[e]?this.resolve(h,n,r,o):w}async prefix(){let e=await this.element("prefix")||this.symbols,r=this.timers&&this.timers.prefix,o=this.state;return o.timer=r,Na.isObject(e)&&(e=e[o.status]||e.pending),Na.hasColor(e)?e:(this.styles[o.status]||this.styles.pending)(e)}async message(){let e=await this.element("message");return Na.hasColor(e)?e:this.styles.strong(e)}async separator(){let e=await this.element("separator")||this.symbols,r=this.timers&&this.timers.separator,o=this.state;o.timer=r;let a=e[o.status]||e.pending||o.separator,n=await this.resolve(a,o);return Na.isObject(n)&&(n=n[o.status]||n.pending),Na.hasColor(n)?n:this.styles.muted(n)}async pointer(e,r){let o=await this.element("pointer",e,r);if(typeof o=="string"&&Na.hasColor(o))return o;if(o){let a=this.styles,n=this.index===r,u=n?a.primary:h=>h,A=await this.resolve(o[n?"on":"off"]||o,this.state),p=Na.hasColor(A)?A:u(A);return n?p:" ".repeat(A.length)}}async indicator(e,r){let o=await this.element("indicator",e,r);if(typeof o=="string"&&Na.hasColor(o))return o;if(o){let a=this.styles,n=e.enabled===!0,u=n?a.success:a.dark,A=o[n?"on":"off"]||o;return Na.hasColor(A)?A:u(A)}return""}body(){return null}footer(){if(this.state.status==="pending")return this.element("footer")}header(){if(this.state.status==="pending")return this.element("header")}async hint(){if(this.state.status==="pending"&&!this.isValue(this.state.input)){let e=await this.element("hint");return Na.hasColor(e)?e:this.styles.muted(e)}}error(e){return this.state.submitted?"":e||this.state.error}format(e){return e}result(e){return e}validate(e){return this.options.required===!0?this.isValue(e):!0}isValue(e){return e!=null&&e!==""}resolve(e,...r){return Na.resolve(this,e,...r)}get base(){return t.prototype}get style(){return this.styles[this.state.status]}get height(){return this.options.rows||Na.height(this.stdout,25)}get width(){return this.options.columns||Na.width(this.stdout,80)}get size(){return{width:this.width,height:this.height}}set cursor(e){this.state.cursor=e}get cursor(){return this.state.cursor}set input(e){this.state.input=e}get input(){return this.state.input}set value(e){this.state.value=e}get value(){let{input:e,value:r}=this.state,o=[r,e].find(this.isValue.bind(this));return this.isValue(o)?o:this.initial}static get prompt(){return e=>new this(e).run()}};function XAt(t){let e=a=>t[a]===void 0||typeof t[a]=="function",r=["actions","choices","initial","margin","roles","styles","symbols","theme","timers","value"],o=["body","footer","error","header","hint","indicator","message","prefix","separator","skip"];for(let a of Object.keys(t.options)){if(r.includes(a)||/^on[A-Z]/.test(a))continue;let n=t.options[a];typeof n=="function"&&e(a)?o.includes(a)||(t[a]=n.bind(t)):typeof t[a]!="function"&&(t[a]=n)}}function ZAt(t){typeof t=="number"&&(t=[t,t,t,t]);let e=[].concat(t||[]),r=a=>a%2===0?` `:" ",o=[];for(let a=0;a<4;a++){let n=r(a);e[a]?o.push(n.repeat(e[a])):o.push("")}return o}d0e.exports=x8});var E0e=_((__t,y0e)=>{"use strict";var $At=xo(),m0e={default(t,e){return e},checkbox(t,e){throw new Error("checkbox role is not implemented yet")},editable(t,e){throw new Error("editable role is not implemented yet")},expandable(t,e){throw new Error("expandable role is not implemented yet")},heading(t,e){return e.disabled="",e.indicator=[e.indicator," "].find(r=>r!=null),e.message=e.message||"",e},input(t,e){throw new Error("input role is not implemented yet")},option(t,e){return m0e.default(t,e)},radio(t,e){throw new Error("radio role is not implemented yet")},separator(t,e){return e.disabled="",e.indicator=[e.indicator," "].find(r=>r!=null),e.message=e.message||t.symbols.line.repeat(5),e},spacer(t,e){return e}};y0e.exports=(t,e={})=>{let r=$At.merge({},m0e,e.roles);return r[t]||r.default}});var b2=_((H_t,w0e)=>{"use strict";var eft=eu(),tft=uE(),rft=E0e(),Uk=xo(),{reorder:b8,scrollUp:nft,scrollDown:ift,isObject:C0e,swap:sft}=Uk,k8=class extends tft{constructor(e){super(e),this.cursorHide(),this.maxSelected=e.maxSelected||1/0,this.multiple=e.multiple||!1,this.initial=e.initial||0,this.delay=e.delay||0,this.longest=0,this.num=""}async initialize(){typeof this.options.initial=="function"&&(this.initial=await this.options.initial.call(this)),await this.reset(!0),await super.initialize()}async reset(){let{choices:e,initial:r,autofocus:o,suggest:a}=this.options;if(this.state._choices=[],this.state.choices=[],this.choices=await Promise.all(await this.toChoices(e)),this.choices.forEach(n=>n.enabled=!1),typeof a!="function"&&this.selectable.length===0)throw new Error("At least one choice must be selectable");C0e(r)&&(r=Object.keys(r)),Array.isArray(r)?(o!=null&&(this.index=this.findIndex(o)),r.forEach(n=>this.enable(this.find(n))),await this.render()):(o!=null&&(r=o),typeof r=="string"&&(r=this.findIndex(r)),typeof r=="number"&&r>-1&&(this.index=Math.max(0,Math.min(r,this.choices.length)),this.enable(this.find(this.index)))),this.isDisabled(this.focused)&&await this.down()}async toChoices(e,r){this.state.loadingChoices=!0;let o=[],a=0,n=async(u,A)=>{typeof u=="function"&&(u=await u.call(this)),u instanceof Promise&&(u=await u);for(let p=0;p(this.state.loadingChoices=!1,u))}async toChoice(e,r,o){if(typeof e=="function"&&(e=await e.call(this,this)),e instanceof Promise&&(e=await e),typeof e=="string"&&(e={name:e}),e.normalized)return e;e.normalized=!0;let a=e.value;if(e=rft(e.role,this.options)(this,e),typeof e.disabled=="string"&&!e.hint&&(e.hint=e.disabled,e.disabled=!0),e.disabled===!0&&e.hint==null&&(e.hint="(disabled)"),e.index!=null)return e;e.name=e.name||e.key||e.title||e.value||e.message,e.message=e.message||e.name||"",e.value=[e.value,e.name].find(this.isValue.bind(this)),e.input="",e.index=r,e.cursor=0,Uk.define(e,"parent",o),e.level=o?o.level+1:1,e.indent==null&&(e.indent=o?o.indent+" ":e.indent||""),e.path=o?o.path+"."+e.name:e.name,e.enabled=!!(this.multiple&&!this.isDisabled(e)&&(e.enabled||this.isSelected(e))),this.isDisabled(e)||(this.longest=Math.max(this.longest,eft.unstyle(e.message).length));let u={...e};return e.reset=(A=u.input,p=u.value)=>{for(let h of Object.keys(u))e[h]=u[h];e.input=A,e.value=p},a==null&&typeof e.initial=="function"&&(e.input=await e.initial.call(this,this.state,e,r)),e}async onChoice(e,r){this.emit("choice",e,r,this),typeof e.onChoice=="function"&&await e.onChoice.call(this,this.state,e,r)}async addChoice(e,r,o){let a=await this.toChoice(e,r,o);return this.choices.push(a),this.index=this.choices.length-1,this.limit=this.choices.length,a}async newItem(e,r,o){let a={name:"New choice name?",editable:!0,newChoice:!0,...e},n=await this.addChoice(a,r,o);return n.updateChoice=()=>{delete n.newChoice,n.name=n.message=n.input,n.input="",n.cursor=0},this.render()}indent(e){return e.indent==null?e.level>1?" ".repeat(e.level-1):"":e.indent}dispatch(e,r){if(this.multiple&&this[r.name])return this[r.name]();this.alert()}focus(e,r){return typeof r!="boolean"&&(r=e.enabled),r&&!e.enabled&&this.selected.length>=this.maxSelected?this.alert():(this.index=e.index,e.enabled=r&&!this.isDisabled(e),e)}space(){return this.multiple?(this.toggle(this.focused),this.render()):this.alert()}a(){if(this.maxSelectedr.enabled);return this.choices.forEach(r=>r.enabled=!e),this.render()}i(){return this.choices.length-this.selected.length>this.maxSelected?this.alert():(this.choices.forEach(e=>e.enabled=!e.enabled),this.render())}g(e=this.focused){return this.choices.some(r=>!!r.parent)?(this.toggle(e.parent&&!e.choices?e.parent:e),this.render()):this.a()}toggle(e,r){if(!e.enabled&&this.selected.length>=this.maxSelected)return this.alert();typeof r!="boolean"&&(r=!e.enabled),e.enabled=r,e.choices&&e.choices.forEach(a=>this.toggle(a,r));let o=e.parent;for(;o;){let a=o.choices.filter(n=>this.isDisabled(n));o.enabled=a.every(n=>n.enabled===!0),o=o.parent}return I0e(this,this.choices),this.emit("toggle",e,this),e}enable(e){return this.selected.length>=this.maxSelected?this.alert():(e.enabled=!this.isDisabled(e),e.choices&&e.choices.forEach(this.enable.bind(this)),e)}disable(e){return e.enabled=!1,e.choices&&e.choices.forEach(this.disable.bind(this)),e}number(e){this.num+=e;let r=o=>{let a=Number(o);if(a>this.choices.length-1)return this.alert();let n=this.focused,u=this.choices.find(A=>a===A.index);if(!u.enabled&&this.selected.length>=this.maxSelected)return this.alert();if(this.visible.indexOf(u)===-1){let A=b8(this.choices),p=A.indexOf(u);if(n.index>p){let h=A.slice(p,p+this.limit),E=A.filter(w=>!h.includes(w));this.choices=h.concat(E)}else{let h=p-this.limit+1;this.choices=A.slice(h).concat(A.slice(0,h))}}return this.index=this.choices.indexOf(u),this.toggle(this.focused),this.render()};return clearTimeout(this.numberTimeout),new Promise(o=>{let a=this.choices.length,n=this.num,u=(A=!1,p)=>{clearTimeout(this.numberTimeout),A&&(p=r(n)),this.num="",o(p)};if(n==="0"||n.length===1&&+(n+"0")>a)return u(!0);if(Number(n)>a)return u(!1,this.alert());this.numberTimeout=setTimeout(()=>u(!0),this.delay)})}home(){return this.choices=b8(this.choices),this.index=0,this.render()}end(){let e=this.choices.length-this.limit,r=b8(this.choices);return this.choices=r.slice(e).concat(r.slice(0,e)),this.index=this.limit-1,this.render()}first(){return this.index=0,this.render()}last(){return this.index=this.visible.length-1,this.render()}prev(){return this.visible.length<=1?this.alert():this.up()}next(){return this.visible.length<=1?this.alert():this.down()}right(){return this.cursor>=this.input.length?this.alert():(this.cursor++,this.render())}left(){return this.cursor<=0?this.alert():(this.cursor--,this.render())}up(){let e=this.choices.length,r=this.visible.length,o=this.index;return this.options.scroll===!1&&o===0?this.alert():e>r&&o===0?this.scrollUp():(this.index=(o-1%e+e)%e,this.isDisabled()?this.up():this.render())}down(){let e=this.choices.length,r=this.visible.length,o=this.index;return this.options.scroll===!1&&o===r-1?this.alert():e>r&&o===r-1?this.scrollDown():(this.index=(o+1)%e,this.isDisabled()?this.down():this.render())}scrollUp(e=0){return this.choices=nft(this.choices),this.index=e,this.isDisabled()?this.up():this.render()}scrollDown(e=this.visible.length-1){return this.choices=ift(this.choices),this.index=e,this.isDisabled()?this.down():this.render()}async shiftUp(){if(this.options.sort===!0){this.sorting=!0,this.swap(this.index-1),await this.up(),this.sorting=!1;return}return this.scrollUp(this.index)}async shiftDown(){if(this.options.sort===!0){this.sorting=!0,this.swap(this.index+1),await this.down(),this.sorting=!1;return}return this.scrollDown(this.index)}pageUp(){return this.visible.length<=1?this.alert():(this.limit=Math.max(this.limit-1,0),this.index=Math.min(this.limit-1,this.index),this._limit=this.limit,this.isDisabled()?this.up():this.render())}pageDown(){return this.visible.length>=this.choices.length?this.alert():(this.index=Math.max(0,this.index),this.limit=Math.min(this.limit+1,this.choices.length),this._limit=this.limit,this.isDisabled()?this.down():this.render())}swap(e){sft(this.choices,this.index,e)}isDisabled(e=this.focused){return e&&["disabled","collapsed","hidden","completing","readonly"].some(o=>e[o]===!0)?!0:e&&e.role==="heading"}isEnabled(e=this.focused){if(Array.isArray(e))return e.every(r=>this.isEnabled(r));if(e.choices){let r=e.choices.filter(o=>!this.isDisabled(o));return e.enabled&&r.every(o=>this.isEnabled(o))}return e.enabled&&!this.isDisabled(e)}isChoice(e,r){return e.name===r||e.index===Number(r)}isSelected(e){return Array.isArray(this.initial)?this.initial.some(r=>this.isChoice(e,r)):this.isChoice(e,this.initial)}map(e=[],r="value"){return[].concat(e||[]).reduce((o,a)=>(o[a]=this.find(a,r),o),{})}filter(e,r){let a=typeof e=="function"?e:(A,p)=>[A.name,p].includes(e),u=(this.options.multiple?this.state._choices:this.choices).filter(a);return r?u.map(A=>A[r]):u}find(e,r){if(C0e(e))return r?e[r]:e;let a=typeof e=="function"?e:(u,A)=>[u.name,A].includes(e),n=this.choices.find(a);if(n)return r?n[r]:n}findIndex(e){return this.choices.indexOf(this.find(e))}async submit(){let e=this.focused;if(!e)return this.alert();if(e.newChoice)return e.input?(e.updateChoice(),this.render()):this.alert();if(this.choices.some(u=>u.newChoice))return this.alert();let{reorder:r,sort:o}=this.options,a=this.multiple===!0,n=this.selected;return n===void 0?this.alert():(Array.isArray(n)&&r!==!1&&o!==!0&&(n=Uk.reorder(n)),this.value=a?n.map(u=>u.name):n.name,super.submit())}set choices(e=[]){this.state._choices=this.state._choices||[],this.state.choices=e;for(let r of e)this.state._choices.some(o=>o.name===r.name)||this.state._choices.push(r);if(!this._initial&&this.options.initial){this._initial=!0;let r=this.initial;if(typeof r=="string"||typeof r=="number"){let o=this.find(r);o&&(this.initial=o.index,this.focus(o,!0))}}}get choices(){return I0e(this,this.state.choices||[])}set visible(e){this.state.visible=e}get visible(){return(this.state.visible||this.choices).slice(0,this.limit)}set limit(e){this.state.limit=e}get limit(){let{state:e,options:r,choices:o}=this,a=e.limit||this._limit||r.limit||o.length;return Math.min(a,this.height)}set value(e){super.value=e}get value(){return typeof super.value!="string"&&super.value===this.initial?this.input:super.value}set index(e){this.state.index=e}get index(){return Math.max(0,this.state?this.state.index:0)}get enabled(){return this.filter(this.isEnabled.bind(this))}get focused(){let e=this.choices[this.index];return e&&this.state.submitted&&this.multiple!==!0&&(e.enabled=!0),e}get selectable(){return this.choices.filter(e=>!this.isDisabled(e))}get selected(){return this.multiple?this.enabled:this.focused}};function I0e(t,e){if(e instanceof Promise)return e;if(typeof e=="function"){if(Uk.isAsyncFn(e))return e;e=e.call(t,t)}for(let r of e){if(Array.isArray(r.choices)){let o=r.choices.filter(a=>!t.isDisabled(a));r.enabled=o.every(a=>a.enabled===!0)}t.isDisabled(r)===!0&&delete r.enabled}return e}w0e.exports=k8});var Qh=_((q_t,B0e)=>{"use strict";var oft=b2(),Q8=xo(),F8=class extends oft{constructor(e){super(e),this.emptyError=this.options.emptyError||"No items were selected"}async dispatch(e,r){if(this.multiple)return this[r.name]?await this[r.name](e,r):await super.dispatch(e,r);this.alert()}separator(){if(this.options.separator)return super.separator();let e=this.styles.muted(this.symbols.ellipsis);return this.state.submitted?super.separator():e}pointer(e,r){return!this.multiple||this.options.pointer?super.pointer(e,r):""}indicator(e,r){return this.multiple?super.indicator(e,r):""}choiceMessage(e,r){let o=this.resolve(e.message,this.state,e,r);return e.role==="heading"&&!Q8.hasColor(o)&&(o=this.styles.strong(o)),this.resolve(o,this.state,e,r)}choiceSeparator(){return":"}async renderChoice(e,r){await this.onChoice(e,r);let o=this.index===r,a=await this.pointer(e,r),n=await this.indicator(e,r)+(e.pad||""),u=await this.resolve(e.hint,this.state,e,r);u&&!Q8.hasColor(u)&&(u=this.styles.muted(u));let A=this.indent(e),p=await this.choiceMessage(e,r),h=()=>[this.margin[3],A+a+n,p,this.margin[1],u].filter(Boolean).join(" ");return e.role==="heading"?h():e.disabled?(Q8.hasColor(p)||(p=this.styles.disabled(p)),h()):(o&&(p=this.styles.em(p)),h())}async renderChoices(){if(this.state.loading==="choices")return this.styles.warning("Loading choices");if(this.state.submitted)return"";let e=this.visible.map(async(n,u)=>await this.renderChoice(n,u)),r=await Promise.all(e);r.length||r.push(this.styles.danger("No matching choices"));let o=this.margin[0]+r.join(` `),a;return this.options.choicesHeader&&(a=await this.resolve(this.options.choicesHeader,this.state)),[a,o].filter(Boolean).join(` `)}format(){return!this.state.submitted||this.state.cancelled?"":Array.isArray(this.selected)?this.selected.map(e=>this.styles.primary(e.name)).join(", "):this.styles.primary(this.selected.name)}async render(){let{submitted:e,size:r}=this.state,o="",a=await this.header(),n=await this.prefix(),u=await this.separator(),A=await this.message();this.options.promptLine!==!1&&(o=[n,A,u,""].join(" "),this.state.prompt=o);let p=await this.format(),h=await this.error()||await this.hint(),E=await this.renderChoices(),w=await this.footer();p&&(o+=p),h&&!o.includes(h)&&(o+=" "+h),e&&!p&&!E.trim()&&this.multiple&&this.emptyError!=null&&(o+=this.styles.danger(this.emptyError)),this.clear(r),this.write([a,o,E,w].filter(Boolean).join(` `)),this.write(this.margin[2]),this.restore()}};B0e.exports=F8});var D0e=_((j_t,v0e)=>{"use strict";var aft=Qh(),lft=(t,e)=>{let r=t.toLowerCase();return o=>{let n=o.toLowerCase().indexOf(r),u=e(o.slice(n,n+r.length));return n>=0?o.slice(0,n)+u+o.slice(n+r.length):o}},R8=class extends aft{constructor(e){super(e),this.cursorShow()}moveCursor(e){this.state.cursor+=e}dispatch(e){return this.append(e)}space(e){return this.options.multiple?super.space(e):this.append(e)}append(e){let{cursor:r,input:o}=this.state;return this.input=o.slice(0,r)+e+o.slice(r),this.moveCursor(1),this.complete()}delete(){let{cursor:e,input:r}=this.state;return r?(this.input=r.slice(0,e-1)+r.slice(e),this.moveCursor(-1),this.complete()):this.alert()}deleteForward(){let{cursor:e,input:r}=this.state;return r[e]===void 0?this.alert():(this.input=`${r}`.slice(0,e)+`${r}`.slice(e+1),this.complete())}number(e){return this.append(e)}async complete(){this.completing=!0,this.choices=await this.suggest(this.input,this.state._choices),this.state.limit=void 0,this.index=Math.min(Math.max(this.visible.length-1,0),this.index),await this.render(),this.completing=!1}suggest(e=this.input,r=this.state._choices){if(typeof this.options.suggest=="function")return this.options.suggest.call(this,e,r);let o=e.toLowerCase();return r.filter(a=>a.message.toLowerCase().includes(o))}pointer(){return""}format(){if(!this.focused)return this.input;if(this.options.multiple&&this.state.submitted)return this.selected.map(e=>this.styles.primary(e.message)).join(", ");if(this.state.submitted){let e=this.value=this.input=this.focused.value;return this.styles.primary(e)}return this.input}async render(){if(this.state.status!=="pending")return super.render();let e=this.options.highlight?this.options.highlight.bind(this):this.styles.placeholder,r=lft(this.input,e),o=this.choices;this.choices=o.map(a=>({...a,message:r(a.message)})),await super.render(),this.choices=o}submit(){return this.options.multiple&&(this.value=this.selected.map(e=>e.name)),super.submit()}};v0e.exports=R8});var L8=_((G_t,P0e)=>{"use strict";var T8=xo();P0e.exports=(t,e={})=>{t.cursorHide();let{input:r="",initial:o="",pos:a,showCursor:n=!0,color:u}=e,A=u||t.styles.placeholder,p=T8.inverse(t.styles.primary),h=T=>p(t.styles.black(T)),E=r,w=" ",D=h(w);if(t.blink&&t.blink.off===!0&&(h=T=>T,D=""),n&&a===0&&o===""&&r==="")return h(w);if(n&&a===0&&(r===o||r===""))return h(o[0])+A(o.slice(1));o=T8.isPrimitive(o)?`${o}`:"",r=T8.isPrimitive(r)?`${r}`:"";let b=o&&o.startsWith(r)&&o!==r,C=b?h(o[r.length]):D;if(a!==r.length&&n===!0&&(E=r.slice(0,a)+h(r[a])+r.slice(a+1),C=""),n===!1&&(C=""),b){let T=t.styles.unstyle(E+C);return E+C+A(o.slice(T.length))}return E+C}});var _k=_((W_t,S0e)=>{"use strict";var cft=eu(),uft=Qh(),Aft=L8(),N8=class extends uft{constructor(e){super({...e,multiple:!0}),this.type="form",this.initial=this.options.initial,this.align=[this.options.align,"right"].find(r=>r!=null),this.emptyError="",this.values={}}async reset(e){return await super.reset(),e===!0&&(this._index=this.index),this.index=this._index,this.values={},this.choices.forEach(r=>r.reset&&r.reset()),this.render()}dispatch(e){return!!e&&this.append(e)}append(e){let r=this.focused;if(!r)return this.alert();let{cursor:o,input:a}=r;return r.value=r.input=a.slice(0,o)+e+a.slice(o),r.cursor++,this.render()}delete(){let e=this.focused;if(!e||e.cursor<=0)return this.alert();let{cursor:r,input:o}=e;return e.value=e.input=o.slice(0,r-1)+o.slice(r),e.cursor--,this.render()}deleteForward(){let e=this.focused;if(!e)return this.alert();let{cursor:r,input:o}=e;if(o[r]===void 0)return this.alert();let a=`${o}`.slice(0,r)+`${o}`.slice(r+1);return e.value=e.input=a,this.render()}right(){let e=this.focused;return e?e.cursor>=e.input.length?this.alert():(e.cursor++,this.render()):this.alert()}left(){let e=this.focused;return e?e.cursor<=0?this.alert():(e.cursor--,this.render()):this.alert()}space(e,r){return this.dispatch(e,r)}number(e,r){return this.dispatch(e,r)}next(){let e=this.focused;if(!e)return this.alert();let{initial:r,input:o}=e;return r&&r.startsWith(o)&&o!==r?(e.value=e.input=r,e.cursor=e.value.length,this.render()):super.next()}prev(){let e=this.focused;return e?e.cursor===0?super.prev():(e.value=e.input="",e.cursor=0,this.render()):this.alert()}separator(){return""}format(e){return this.state.submitted?"":super.format(e)}pointer(){return""}indicator(e){return e.input?"\u29BF":"\u2299"}async choiceSeparator(e,r){let o=await this.resolve(e.separator,this.state,e,r)||":";return o?" "+this.styles.disabled(o):""}async renderChoice(e,r){await this.onChoice(e,r);let{state:o,styles:a}=this,{cursor:n,initial:u="",name:A,hint:p,input:h=""}=e,{muted:E,submitted:w,primary:D,danger:b}=a,C=p,T=this.index===r,N=e.validate||(()=>!0),U=await this.choiceSeparator(e,r),z=e.message;this.align==="right"&&(z=z.padStart(this.longest+1," ")),this.align==="left"&&(z=z.padEnd(this.longest+1," "));let te=this.values[A]=h||u,le=h?"success":"dark";await N.call(e,te,this.state)!==!0&&(le="danger");let ce=a[le],ue=ce(await this.indicator(e,r))+(e.pad||""),Ie=this.indent(e),he=()=>[Ie,ue,z+U,h,C].filter(Boolean).join(" ");if(o.submitted)return z=cft.unstyle(z),h=w(h),C="",he();if(e.format)h=await e.format.call(this,h,e,r);else{let De=this.styles.muted;h=Aft(this,{input:h,initial:u,pos:n,showCursor:T,color:De})}return this.isValue(h)||(h=this.styles.muted(this.symbols.ellipsis)),e.result&&(this.values[A]=await e.result.call(this,te,e,r)),T&&(z=D(z)),e.error?h+=(h?" ":"")+b(e.error.trim()):e.hint&&(h+=(h?" ":"")+E(e.hint.trim())),he()}async submit(){return this.value=this.values,super.base.submit.call(this)}};S0e.exports=N8});var O8=_((Y_t,b0e)=>{"use strict";var fft=_k(),pft=()=>{throw new Error("expected prompt to have a custom authenticate method")},x0e=(t=pft)=>{class e extends fft{constructor(o){super(o)}async submit(){this.value=await t.call(this,this.values,this.state),super.base.submit.call(this)}static create(o){return x0e(o)}}return e};b0e.exports=x0e()});var F0e=_((K_t,Q0e)=>{"use strict";var hft=O8();function gft(t,e){return t.username===this.options.username&&t.password===this.options.password}var k0e=(t=gft)=>{let e=[{name:"username",message:"username"},{name:"password",message:"password",format(o){return this.options.showPassword?o:(this.state.submitted?this.styles.primary:this.styles.muted)(this.symbols.asterisk.repeat(o.length))}}];class r extends hft.create(t){constructor(a){super({...a,choices:e})}static create(a){return k0e(a)}}return r};Q0e.exports=k0e()});var Hk=_((V_t,R0e)=>{"use strict";var dft=uE(),{isPrimitive:mft,hasColor:yft}=xo(),M8=class extends dft{constructor(e){super(e),this.cursorHide()}async initialize(){let e=await this.resolve(this.initial,this.state);this.input=await this.cast(e),await super.initialize()}dispatch(e){return this.isValue(e)?(this.input=e,this.submit()):this.alert()}format(e){let{styles:r,state:o}=this;return o.submitted?r.success(e):r.primary(e)}cast(e){return this.isTrue(e)}isTrue(e){return/^[ty1]/i.test(e)}isFalse(e){return/^[fn0]/i.test(e)}isValue(e){return mft(e)&&(this.isTrue(e)||this.isFalse(e))}async hint(){if(this.state.status==="pending"){let e=await this.element("hint");return yft(e)?e:this.styles.muted(e)}}async render(){let{input:e,size:r}=this.state,o=await this.prefix(),a=await this.separator(),n=await this.message(),u=this.styles.muted(this.default),A=[o,n,u,a].filter(Boolean).join(" ");this.state.prompt=A;let p=await this.header(),h=this.value=this.cast(e),E=await this.format(h),w=await this.error()||await this.hint(),D=await this.footer();w&&!A.includes(w)&&(E+=" "+w),A+=" "+E,this.clear(r),this.write([p,A,D].filter(Boolean).join(` `)),this.restore()}set value(e){super.value=e}get value(){return this.cast(super.value)}};R0e.exports=M8});var L0e=_((z_t,T0e)=>{"use strict";var Eft=Hk(),U8=class extends Eft{constructor(e){super(e),this.default=this.options.default||(this.initial?"(Y/n)":"(y/N)")}};T0e.exports=U8});var O0e=_((J_t,N0e)=>{"use strict";var Cft=Qh(),Ift=_k(),AE=Ift.prototype,_8=class extends Cft{constructor(e){super({...e,multiple:!0}),this.align=[this.options.align,"left"].find(r=>r!=null),this.emptyError="",this.values={}}dispatch(e,r){let o=this.focused,a=o.parent||{};return!o.editable&&!a.editable&&(e==="a"||e==="i")?super[e]():AE.dispatch.call(this,e,r)}append(e,r){return AE.append.call(this,e,r)}delete(e,r){return AE.delete.call(this,e,r)}space(e){return this.focused.editable?this.append(e):super.space()}number(e){return this.focused.editable?this.append(e):super.number(e)}next(){return this.focused.editable?AE.next.call(this):super.next()}prev(){return this.focused.editable?AE.prev.call(this):super.prev()}async indicator(e,r){let o=e.indicator||"",a=e.editable?o:super.indicator(e,r);return await this.resolve(a,this.state,e,r)||""}indent(e){return e.role==="heading"?"":e.editable?" ":" "}async renderChoice(e,r){return e.indent="",e.editable?AE.renderChoice.call(this,e,r):super.renderChoice(e,r)}error(){return""}footer(){return this.state.error}async validate(){let e=!0;for(let r of this.choices){if(typeof r.validate!="function"||r.role==="heading")continue;let o=r.parent?this.value[r.parent.name]:this.value;if(r.editable?o=r.value===r.name?r.initial||"":r.value:this.isDisabled(r)||(o=r.enabled===!0),e=await r.validate(o,this.state),e!==!0)break}return e!==!0&&(this.state.error=typeof e=="string"?e:"Invalid Input"),e}submit(){if(this.focused.newChoice===!0)return super.submit();if(this.choices.some(e=>e.newChoice))return this.alert();this.value={};for(let e of this.choices){let r=e.parent?this.value[e.parent.name]:this.value;if(e.role==="heading"){this.value[e.name]={};continue}e.editable?r[e.name]=e.value===e.name?e.initial||"":e.value:this.isDisabled(e)||(r[e.name]=e.enabled===!0)}return this.base.submit.call(this)}};N0e.exports=_8});var Vg=_((X_t,M0e)=>{"use strict";var wft=uE(),Bft=L8(),{isPrimitive:vft}=xo(),H8=class extends wft{constructor(e){super(e),this.initial=vft(this.initial)?String(this.initial):"",this.initial&&this.cursorHide(),this.state.prevCursor=0,this.state.clipboard=[]}async keypress(e,r={}){let o=this.state.prevKeypress;return this.state.prevKeypress=r,this.options.multiline===!0&&r.name==="return"&&(!o||o.name!=="return")?this.append(` `,r):super.keypress(e,r)}moveCursor(e){this.cursor+=e}reset(){return this.input=this.value="",this.cursor=0,this.render()}dispatch(e,r){if(!e||r.ctrl||r.code)return this.alert();this.append(e)}append(e){let{cursor:r,input:o}=this.state;this.input=`${o}`.slice(0,r)+e+`${o}`.slice(r),this.moveCursor(String(e).length),this.render()}insert(e){this.append(e)}delete(){let{cursor:e,input:r}=this.state;if(e<=0)return this.alert();this.input=`${r}`.slice(0,e-1)+`${r}`.slice(e),this.moveCursor(-1),this.render()}deleteForward(){let{cursor:e,input:r}=this.state;if(r[e]===void 0)return this.alert();this.input=`${r}`.slice(0,e)+`${r}`.slice(e+1),this.render()}cutForward(){let e=this.cursor;if(this.input.length<=e)return this.alert();this.state.clipboard.push(this.input.slice(e)),this.input=this.input.slice(0,e),this.render()}cutLeft(){let e=this.cursor;if(e===0)return this.alert();let r=this.input.slice(0,e),o=this.input.slice(e),a=r.split(" ");this.state.clipboard.push(a.pop()),this.input=a.join(" "),this.cursor=this.input.length,this.input+=o,this.render()}paste(){if(!this.state.clipboard.length)return this.alert();this.insert(this.state.clipboard.pop()),this.render()}toggleCursor(){this.state.prevCursor?(this.cursor=this.state.prevCursor,this.state.prevCursor=0):(this.state.prevCursor=this.cursor,this.cursor=0),this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.input.length-1,this.render()}next(){let e=this.initial!=null?String(this.initial):"";if(!e||!e.startsWith(this.input))return this.alert();this.input=this.initial,this.cursor=this.initial.length,this.render()}prev(){if(!this.input)return this.alert();this.reset()}backward(){return this.left()}forward(){return this.right()}right(){return this.cursor>=this.input.length?this.alert():(this.moveCursor(1),this.render())}left(){return this.cursor<=0?this.alert():(this.moveCursor(-1),this.render())}isValue(e){return!!e}async format(e=this.value){let r=await this.resolve(this.initial,this.state);return this.state.submitted?this.styles.submitted(e||r):Bft(this,{input:e,initial:r,pos:this.cursor})}async render(){let e=this.state.size,r=await this.prefix(),o=await this.separator(),a=await this.message(),n=[r,a,o].filter(Boolean).join(" ");this.state.prompt=n;let u=await this.header(),A=await this.format(),p=await this.error()||await this.hint(),h=await this.footer();p&&!A.includes(p)&&(A+=" "+p),n+=" "+A,this.clear(e),this.write([u,n,h].filter(Boolean).join(` `)),this.restore()}};M0e.exports=H8});var _0e=_((Z_t,U0e)=>{"use strict";var Dft=t=>t.filter((e,r)=>t.lastIndexOf(e)===r),qk=t=>Dft(t).filter(Boolean);U0e.exports=(t,e={},r="")=>{let{past:o=[],present:a=""}=e,n,u;switch(t){case"prev":case"undo":return n=o.slice(0,o.length-1),u=o[o.length-1]||"",{past:qk([r,...n]),present:u};case"next":case"redo":return n=o.slice(1),u=o[0]||"",{past:qk([...n,r]),present:u};case"save":return{past:qk([...o,r]),present:""};case"remove":return u=qk(o.filter(A=>A!==r)),a="",u.length&&(a=u.pop()),{past:u,present:a};default:throw new Error(`Invalid action: "${t}"`)}}});var j8=_(($_t,q0e)=>{"use strict";var Pft=Vg(),H0e=_0e(),q8=class extends Pft{constructor(e){super(e);let r=this.options.history;if(r&&r.store){let o=r.values||this.initial;this.autosave=!!r.autosave,this.store=r.store,this.data=this.store.get("values")||{past:[],present:o},this.initial=this.data.present||this.data.past[this.data.past.length-1]}}completion(e){return this.store?(this.data=H0e(e,this.data,this.input),this.data.present?(this.input=this.data.present,this.cursor=this.input.length,this.render()):this.alert()):this.alert()}altUp(){return this.completion("prev")}altDown(){return this.completion("next")}prev(){return this.save(),super.prev()}save(){this.store&&(this.data=H0e("save",this.data,this.input),this.store.set("values",this.data))}submit(){return this.store&&this.autosave===!0&&this.save(),super.submit()}};q0e.exports=q8});var G0e=_((e8t,j0e)=>{"use strict";var Sft=Vg(),G8=class extends Sft{format(){return""}};j0e.exports=G8});var Y0e=_((t8t,W0e)=>{"use strict";var xft=Vg(),W8=class extends xft{constructor(e={}){super(e),this.sep=this.options.separator||/, */,this.initial=e.initial||""}split(e=this.value){return e?String(e).split(this.sep):[]}format(){let e=this.state.submitted?this.styles.primary:r=>r;return this.list.map(e).join(", ")}async submit(e){let r=this.state.error||await this.validate(this.list,this.state);return r!==!0?(this.state.error=r,super.submit()):(this.value=this.list,super.submit())}get list(){return this.split()}};W0e.exports=W8});var V0e=_((r8t,K0e)=>{"use strict";var bft=Qh(),Y8=class extends bft{constructor(e){super({...e,multiple:!0})}};K0e.exports=Y8});var V8=_((n8t,z0e)=>{"use strict";var kft=Vg(),K8=class extends kft{constructor(e={}){super({style:"number",...e}),this.min=this.isValue(e.min)?this.toNumber(e.min):-1/0,this.max=this.isValue(e.max)?this.toNumber(e.max):1/0,this.delay=e.delay!=null?e.delay:1e3,this.float=e.float!==!1,this.round=e.round===!0||e.float===!1,this.major=e.major||10,this.minor=e.minor||1,this.initial=e.initial!=null?e.initial:"",this.input=String(this.initial),this.cursor=this.input.length,this.cursorShow()}append(e){return!/[-+.]/.test(e)||e==="."&&this.input.includes(".")?this.alert("invalid number"):super.append(e)}number(e){return super.append(e)}next(){return this.input&&this.input!==this.initial?this.alert():this.isValue(this.initial)?(this.input=this.initial,this.cursor=String(this.initial).length,this.render()):this.alert()}up(e){let r=e||this.minor,o=this.toNumber(this.input);return o>this.max+r?this.alert():(this.input=`${o+r}`,this.render())}down(e){let r=e||this.minor,o=this.toNumber(this.input);return othis.isValue(r));return this.value=this.toNumber(e||0),super.submit()}};z0e.exports=K8});var X0e=_((i8t,J0e)=>{J0e.exports=V8()});var $0e=_((s8t,Z0e)=>{"use strict";var Qft=Vg(),z8=class extends Qft{constructor(e){super(e),this.cursorShow()}format(e=this.input){return this.keypressed?(this.state.submitted?this.styles.primary:this.styles.muted)(this.symbols.asterisk.repeat(e.length)):""}};Z0e.exports=z8});var rge=_((o8t,tge)=>{"use strict";var Fft=eu(),Rft=b2(),ege=xo(),J8=class extends Rft{constructor(e={}){super(e),this.widths=[].concat(e.messageWidth||50),this.align=[].concat(e.align||"left"),this.linebreak=e.linebreak||!1,this.edgeLength=e.edgeLength||3,this.newline=e.newline||` `;let r=e.startNumber||1;typeof this.scale=="number"&&(this.scaleKey=!1,this.scale=Array(this.scale).fill(0).map((o,a)=>({name:a+r})))}async reset(){return this.tableized=!1,await super.reset(),this.render()}tableize(){if(this.tableized===!0)return;this.tableized=!0;let e=0;for(let r of this.choices){e=Math.max(e,r.message.length),r.scaleIndex=r.initial||2,r.scale=[];for(let o=0;o=this.scale.length-1?this.alert():(e.scaleIndex++,this.render())}left(){let e=this.focused;return e.scaleIndex<=0?this.alert():(e.scaleIndex--,this.render())}indent(){return""}format(){return this.state.submitted?this.choices.map(r=>this.styles.info(r.index)).join(", "):""}pointer(){return""}renderScaleKey(){return this.scaleKey===!1||this.state.submitted?"":["",...this.scale.map(o=>` ${o.name} - ${o.message}`)].map(o=>this.styles.muted(o)).join(` `)}renderScaleHeading(e){let r=this.scale.map(p=>p.name);typeof this.options.renderScaleHeading=="function"&&(r=this.options.renderScaleHeading.call(this,e));let o=this.scaleLength-r.join("").length,a=Math.round(o/(r.length-1)),u=r.map(p=>this.styles.strong(p)).join(" ".repeat(a)),A=" ".repeat(this.widths[0]);return this.margin[3]+A+this.margin[1]+u}scaleIndicator(e,r,o){if(typeof this.options.scaleIndicator=="function")return this.options.scaleIndicator.call(this,e,r,o);let a=e.scaleIndex===r.index;return r.disabled?this.styles.hint(this.symbols.radio.disabled):a?this.styles.success(this.symbols.radio.on):this.symbols.radio.off}renderScale(e,r){let o=e.scale.map(n=>this.scaleIndicator(e,n,r)),a=this.term==="Hyper"?"":" ";return o.join(a+this.symbols.line.repeat(this.edgeLength))}async renderChoice(e,r){await this.onChoice(e,r);let o=this.index===r,a=await this.pointer(e,r),n=await e.hint;n&&!ege.hasColor(n)&&(n=this.styles.muted(n));let u=C=>this.margin[3]+C.replace(/\s+$/,"").padEnd(this.widths[0]," "),A=this.newline,p=this.indent(e),h=await this.resolve(e.message,this.state,e,r),E=await this.renderScale(e,r),w=this.margin[1]+this.margin[3];this.scaleLength=Fft.unstyle(E).length,this.widths[0]=Math.min(this.widths[0],this.width-this.scaleLength-w.length);let b=ege.wordWrap(h,{width:this.widths[0],newline:A}).split(` `).map(C=>u(C)+this.margin[1]);return o&&(E=this.styles.info(E),b=b.map(C=>this.styles.info(C))),b[0]+=E,this.linebreak&&b.push(""),[p+a,b.join(` `)].filter(Boolean)}async renderChoices(){if(this.state.submitted)return"";this.tableize();let e=this.visible.map(async(a,n)=>await this.renderChoice(a,n)),r=await Promise.all(e),o=await this.renderScaleHeading();return this.margin[0]+[o,...r.map(a=>a.join(" "))].join(` `)}async render(){let{submitted:e,size:r}=this.state,o=await this.prefix(),a=await this.separator(),n=await this.message(),u="";this.options.promptLine!==!1&&(u=[o,n,a,""].join(" "),this.state.prompt=u);let A=await this.header(),p=await this.format(),h=await this.renderScaleKey(),E=await this.error()||await this.hint(),w=await this.renderChoices(),D=await this.footer(),b=this.emptyError;p&&(u+=p),E&&!u.includes(E)&&(u+=" "+E),e&&!p&&!w.trim()&&this.multiple&&b!=null&&(u+=this.styles.danger(b)),this.clear(r),this.write([A,u,h,w,D].filter(Boolean).join(` `)),this.state.submitted||this.write(this.margin[2]),this.restore()}submit(){this.value={};for(let e of this.choices)this.value[e.name]=e.scaleIndex;return this.base.submit.call(this)}};tge.exports=J8});var sge=_((a8t,ige)=>{"use strict";var nge=eu(),Tft=(t="")=>typeof t=="string"?t.replace(/^['"]|['"]$/g,""):"",Z8=class{constructor(e){this.name=e.key,this.field=e.field||{},this.value=Tft(e.initial||this.field.initial||""),this.message=e.message||this.name,this.cursor=0,this.input="",this.lines=[]}},Lft=async(t={},e={},r=o=>o)=>{let o=new Set,a=t.fields||[],n=t.template,u=[],A=[],p=[],h=1;typeof n=="function"&&(n=await n());let E=-1,w=()=>n[++E],D=()=>n[E+1],b=C=>{C.line=h,u.push(C)};for(b({type:"bos",value:""});Ele.name===U.key);U.field=a.find(le=>le.name===U.key),te||(te=new Z8(U),A.push(te)),te.lines.push(U.line-1);continue}let T=u[u.length-1];T.type==="text"&&T.line===h?T.value+=C:b({type:"text",value:C})}return b({type:"eos",value:""}),{input:n,tabstops:u,unique:o,keys:p,items:A}};ige.exports=async t=>{let e=t.options,r=new Set(e.required===!0?[]:e.required||[]),o={...e.values,...e.initial},{tabstops:a,items:n,keys:u}=await Lft(e,o),A=X8("result",t,e),p=X8("format",t,e),h=X8("validate",t,e,!0),E=t.isValue.bind(t);return async(w={},D=!1)=>{let b=0;w.required=r,w.items=n,w.keys=u,w.output="";let C=async(z,te,le,ce)=>{let ue=await h(z,te,le,ce);return ue===!1?"Invalid field "+le.name:ue};for(let z of a){let te=z.value,le=z.key;if(z.type!=="template"){te&&(w.output+=te);continue}if(z.type==="template"){let ce=n.find(Ee=>Ee.name===le);e.required===!0&&w.required.add(ce.name);let ue=[ce.input,w.values[ce.value],ce.value,te].find(E),he=(ce.field||{}).message||z.inner;if(D){let Ee=await C(w.values[le],w,ce,b);if(Ee&&typeof Ee=="string"||Ee===!1){w.invalid.set(le,Ee);continue}w.invalid.delete(le);let g=await A(w.values[le],w,ce,b);w.output+=nge.unstyle(g);continue}ce.placeholder=!1;let De=te;te=await p(te,w,ce,b),ue!==te?(w.values[le]=ue,te=t.styles.typing(ue),w.missing.delete(he)):(w.values[le]=void 0,ue=`<${he}>`,te=t.styles.primary(ue),ce.placeholder=!0,w.required.has(le)&&w.missing.add(he)),w.missing.has(he)&&w.validating&&(te=t.styles.warning(ue)),w.invalid.has(le)&&w.validating&&(te=t.styles.danger(ue)),b===w.index&&(De!==te?te=t.styles.underline(te):te=t.styles.heading(nge.unstyle(te))),b++}te&&(w.output+=te)}let T=w.output.split(` `).map(z=>" "+z),N=n.length,U=0;for(let z of n)w.invalid.has(z.name)&&z.lines.forEach(te=>{T[te][0]===" "&&(T[te]=w.styles.danger(w.symbols.bullet)+T[te].slice(1))}),t.isValue(w.values[z.name])&&U++;return w.completed=(U/N*100).toFixed(0),w.output=T.join(` `),w.output}};function X8(t,e,r,o){return(a,n,u,A)=>typeof u.field[t]=="function"?u.field[t].call(e,a,n,u,A):[o,a].find(p=>e.isValue(p))}});var age=_((l8t,oge)=>{"use strict";var Nft=eu(),Oft=sge(),Mft=uE(),$8=class extends Mft{constructor(e){super(e),this.cursorHide(),this.reset(!0)}async initialize(){this.interpolate=await Oft(this),await super.initialize()}async reset(e){this.state.keys=[],this.state.invalid=new Map,this.state.missing=new Set,this.state.completed=0,this.state.values={},e!==!0&&(await this.initialize(),await this.render())}moveCursor(e){let r=this.getItem();this.cursor+=e,r.cursor+=e}dispatch(e,r){if(!r.code&&!r.ctrl&&e!=null&&this.getItem()){this.append(e,r);return}this.alert()}append(e,r){let o=this.getItem(),a=o.input.slice(0,this.cursor),n=o.input.slice(this.cursor);this.input=o.input=`${a}${e}${n}`,this.moveCursor(1),this.render()}delete(){let e=this.getItem();if(this.cursor<=0||!e.input)return this.alert();let r=e.input.slice(this.cursor),o=e.input.slice(0,this.cursor-1);this.input=e.input=`${o}${r}`,this.moveCursor(-1),this.render()}increment(e){return e>=this.state.keys.length-1?0:e+1}decrement(e){return e<=0?this.state.keys.length-1:e-1}first(){this.state.index=0,this.render()}last(){this.state.index=this.state.keys.length-1,this.render()}right(){if(this.cursor>=this.input.length)return this.alert();this.moveCursor(1),this.render()}left(){if(this.cursor<=0)return this.alert();this.moveCursor(-1),this.render()}prev(){this.state.index=this.decrement(this.state.index),this.getItem(),this.render()}next(){this.state.index=this.increment(this.state.index),this.getItem(),this.render()}up(){this.prev()}down(){this.next()}format(e){let r=this.state.completed<100?this.styles.warning:this.styles.success;return this.state.submitted===!0&&this.state.completed!==100&&(r=this.styles.danger),r(`${this.state.completed}% completed`)}async render(){let{index:e,keys:r=[],submitted:o,size:a}=this.state,n=[this.options.newline,` `].find(z=>z!=null),u=await this.prefix(),A=await this.separator(),p=await this.message(),h=[u,p,A].filter(Boolean).join(" ");this.state.prompt=h;let E=await this.header(),w=await this.error()||"",D=await this.hint()||"",b=o?"":await this.interpolate(this.state),C=this.state.key=r[e]||"",T=await this.format(C),N=await this.footer();T&&(h+=" "+T),D&&!T&&this.state.completed===0&&(h+=" "+D),this.clear(a);let U=[E,h,b,N,w.trim()];this.write(U.filter(Boolean).join(n)),this.restore()}getItem(e){let{items:r,keys:o,index:a}=this.state,n=r.find(u=>u.name===o[a]);return n&&n.input!=null&&(this.input=n.input,this.cursor=n.cursor),n}async submit(){typeof this.interpolate!="function"&&await this.initialize(),await this.interpolate(this.state,!0);let{invalid:e,missing:r,output:o,values:a}=this.state;if(e.size){let A="";for(let[p,h]of e)A+=`Invalid ${p}: ${h} `;return this.state.error=A,super.submit()}if(r.size)return this.state.error="Required: "+[...r.keys()].join(", "),super.submit();let u=Nft.unstyle(o).split(` `).map(A=>A.slice(1)).join(` `);return this.value={values:a,result:u},super.submit()}};oge.exports=$8});var cge=_((c8t,lge)=>{"use strict";var Uft="(Use + to sort)",_ft=Qh(),eH=class extends _ft{constructor(e){super({...e,reorder:!1,sort:!0,multiple:!0}),this.state.hint=[this.options.hint,Uft].find(this.isValue.bind(this))}indicator(){return""}async renderChoice(e,r){let o=await super.renderChoice(e,r),a=this.symbols.identicalTo+" ",n=this.index===r&&this.sorting?this.styles.muted(a):" ";return this.options.drag===!1&&(n=""),this.options.numbered===!0?n+`${r+1} - `+o:n+o}get selected(){return this.choices}submit(){return this.value=this.choices.map(e=>e.value),super.submit()}};lge.exports=eH});var Age=_((u8t,uge)=>{"use strict";var Hft=b2(),tH=class extends Hft{constructor(e={}){if(super(e),this.emptyError=e.emptyError||"No items were selected",this.term=process.env.TERM_PROGRAM,!this.options.header){let r=["","4 - Strongly Agree","3 - Agree","2 - Neutral","1 - Disagree","0 - Strongly Disagree",""];r=r.map(o=>this.styles.muted(o)),this.state.header=r.join(` `)}}async toChoices(...e){if(this.createdScales)return!1;this.createdScales=!0;let r=await super.toChoices(...e);for(let o of r)o.scale=qft(5,this.options),o.scaleIdx=2;return r}dispatch(){this.alert()}space(){let e=this.focused,r=e.scale[e.scaleIdx],o=r.selected;return e.scale.forEach(a=>a.selected=!1),r.selected=!o,this.render()}indicator(){return""}pointer(){return""}separator(){return this.styles.muted(this.symbols.ellipsis)}right(){let e=this.focused;return e.scaleIdx>=e.scale.length-1?this.alert():(e.scaleIdx++,this.render())}left(){let e=this.focused;return e.scaleIdx<=0?this.alert():(e.scaleIdx--,this.render())}indent(){return" "}async renderChoice(e,r){await this.onChoice(e,r);let o=this.index===r,a=this.term==="Hyper",n=a?9:8,u=a?"":" ",A=this.symbols.line.repeat(n),p=" ".repeat(n+(a?0:1)),h=te=>(te?this.styles.success("\u25C9"):"\u25EF")+u,E=r+1+".",w=o?this.styles.heading:this.styles.noop,D=await this.resolve(e.message,this.state,e,r),b=this.indent(e),C=b+e.scale.map((te,le)=>h(le===e.scaleIdx)).join(A),T=te=>te===e.scaleIdx?w(te):te,N=b+e.scale.map((te,le)=>T(le)).join(p),U=()=>[E,D].filter(Boolean).join(" "),z=()=>[U(),C,N," "].filter(Boolean).join(` `);return o&&(C=this.styles.cyan(C),N=this.styles.cyan(N)),z()}async renderChoices(){if(this.state.submitted)return"";let e=this.visible.map(async(o,a)=>await this.renderChoice(o,a)),r=await Promise.all(e);return r.length||r.push(this.styles.danger("No matching choices")),r.join(` `)}format(){return this.state.submitted?this.choices.map(r=>this.styles.info(r.scaleIdx)).join(", "):""}async render(){let{submitted:e,size:r}=this.state,o=await this.prefix(),a=await this.separator(),n=await this.message(),u=[o,n,a].filter(Boolean).join(" ");this.state.prompt=u;let A=await this.header(),p=await this.format(),h=await this.error()||await this.hint(),E=await this.renderChoices(),w=await this.footer();(p||!h)&&(u+=" "+p),h&&!u.includes(h)&&(u+=" "+h),e&&!p&&!E&&this.multiple&&this.type!=="form"&&(u+=this.styles.danger(this.emptyError)),this.clear(r),this.write([u,A,E,w].filter(Boolean).join(` `)),this.restore()}submit(){this.value={};for(let e of this.choices)this.value[e.name]=e.scaleIdx;return this.base.submit.call(this)}};function qft(t,e={}){if(Array.isArray(e.scale))return e.scale.map(o=>({...o}));let r=[];for(let o=1;o{fge.exports=j8()});var gge=_((f8t,hge)=>{"use strict";var jft=Hk(),rH=class extends jft{async initialize(){await super.initialize(),this.value=this.initial=!!this.options.initial,this.disabled=this.options.disabled||"no",this.enabled=this.options.enabled||"yes",await this.render()}reset(){this.value=this.initial,this.render()}delete(){this.alert()}toggle(){this.value=!this.value,this.render()}enable(){if(this.value===!0)return this.alert();this.value=!0,this.render()}disable(){if(this.value===!1)return this.alert();this.value=!1,this.render()}up(){this.toggle()}down(){this.toggle()}right(){this.toggle()}left(){this.toggle()}next(){this.toggle()}prev(){this.toggle()}dispatch(e="",r){switch(e.toLowerCase()){case" ":return this.toggle();case"1":case"y":case"t":return this.enable();case"0":case"n":case"f":return this.disable();default:return this.alert()}}format(){let e=o=>this.styles.primary.underline(o);return[this.value?this.disabled:e(this.disabled),this.value?e(this.enabled):this.enabled].join(this.styles.muted(" / "))}async render(){let{size:e}=this.state,r=await this.header(),o=await this.prefix(),a=await this.separator(),n=await this.message(),u=await this.format(),A=await this.error()||await this.hint(),p=await this.footer(),h=[o,n,a,u].join(" ");this.state.prompt=h,A&&!h.includes(A)&&(h+=" "+A),this.clear(e),this.write([r,h,p].filter(Boolean).join(` `)),this.write(this.margin[2]),this.restore()}};hge.exports=rH});var mge=_((p8t,dge)=>{"use strict";var Gft=Qh(),nH=class extends Gft{constructor(e){if(super(e),typeof this.options.correctChoice!="number"||this.options.correctChoice<0)throw new Error("Please specify the index of the correct answer from the list of choices")}async toChoices(e,r){let o=await super.toChoices(e,r);if(o.length<2)throw new Error("Please give at least two choices to the user");if(this.options.correctChoice>o.length)throw new Error("Please specify the index of the correct answer from the list of choices");return o}check(e){return e.index===this.options.correctChoice}async result(e){return{selectedAnswer:e,correctAnswer:this.options.choices[this.options.correctChoice].value,correct:await this.check(this.state)}}};dge.exports=nH});var Ege=_(iH=>{"use strict";var yge=xo(),fs=(t,e)=>{yge.defineExport(iH,t,e),yge.defineExport(iH,t.toLowerCase(),e)};fs("AutoComplete",()=>D0e());fs("BasicAuth",()=>F0e());fs("Confirm",()=>L0e());fs("Editable",()=>O0e());fs("Form",()=>_k());fs("Input",()=>j8());fs("Invisible",()=>G0e());fs("List",()=>Y0e());fs("MultiSelect",()=>V0e());fs("Numeral",()=>X0e());fs("Password",()=>$0e());fs("Scale",()=>rge());fs("Select",()=>Qh());fs("Snippet",()=>age());fs("Sort",()=>cge());fs("Survey",()=>Age());fs("Text",()=>pge());fs("Toggle",()=>gge());fs("Quiz",()=>mge())});var Ige=_((g8t,Cge)=>{Cge.exports={ArrayPrompt:b2(),AuthPrompt:O8(),BooleanPrompt:Hk(),NumberPrompt:V8(),StringPrompt:Vg()}});var Q2=_((d8t,Bge)=>{"use strict";var wge=ve("assert"),oH=ve("events"),Fh=xo(),ru=class extends oH{constructor(e,r){super(),this.options=Fh.merge({},e),this.answers={...r}}register(e,r){if(Fh.isObject(e)){for(let a of Object.keys(e))this.register(a,e[a]);return this}wge.equal(typeof r,"function","expected a function");let o=e.toLowerCase();return r.prototype instanceof this.Prompt?this.prompts[o]=r:this.prompts[o]=r(this.Prompt,this),this}async prompt(e=[]){for(let r of[].concat(e))try{typeof r=="function"&&(r=await r.call(this)),await this.ask(Fh.merge({},this.options,r))}catch(o){return Promise.reject(o)}return this.answers}async ask(e){typeof e=="function"&&(e=await e.call(this));let r=Fh.merge({},this.options,e),{type:o,name:a}=e,{set:n,get:u}=Fh;if(typeof o=="function"&&(o=await o.call(this,e,this.answers)),!o)return this.answers[a];wge(this.prompts[o],`Prompt "${o}" is not registered`);let A=new this.prompts[o](r),p=u(this.answers,a);A.state.answers=this.answers,A.enquirer=this,a&&A.on("submit",E=>{this.emit("answer",a,E,A),n(this.answers,a,E)});let h=A.emit.bind(A);return A.emit=(...E)=>(this.emit.call(this,...E),h(...E)),this.emit("prompt",A,this),r.autofill&&p!=null?(A.value=A.input=p,r.autofill==="show"&&await A.submit()):p=A.value=await A.run(),p}use(e){return e.call(this,this),this}set Prompt(e){this._Prompt=e}get Prompt(){return this._Prompt||this.constructor.Prompt}get prompts(){return this.constructor.prompts}static set Prompt(e){this._Prompt=e}static get Prompt(){return this._Prompt||uE()}static get prompts(){return Ege()}static get types(){return Ige()}static get prompt(){let e=(r,...o)=>{let a=new this(...o),n=a.emit.bind(a);return a.emit=(...u)=>(e.emit(...u),n(...u)),a.prompt(r)};return Fh.mixinEmitter(e,new oH),e}};Fh.mixinEmitter(ru,new oH);var sH=ru.prompts;for(let t of Object.keys(sH)){let e=t.toLowerCase(),r=o=>new sH[t](o).run();ru.prompt[e]=r,ru[e]=r,ru[t]||Reflect.defineProperty(ru,t,{get:()=>sH[t]})}var k2=t=>{Fh.defineExport(ru,t,()=>ru.types[t])};k2("ArrayPrompt");k2("AuthPrompt");k2("BooleanPrompt");k2("NumberPrompt");k2("StringPrompt");Bge.exports=ru});var L2=_((Z8t,kge)=>{var Jft=bk();function Xft(t,e,r){var o=t==null?void 0:Jft(t,e);return o===void 0?r:o}kge.exports=Xft});var Rge=_((iHt,Fge)=>{function Zft(t,e){for(var r=-1,o=t==null?0:t.length;++r{var $ft=Eg(),ept=PS();function tpt(t,e){return t&&$ft(e,ept(e),t)}Tge.exports=tpt});var Oge=_((oHt,Nge)=>{var rpt=Eg(),npt=Vm();function ipt(t,e){return t&&rpt(e,npt(e),t)}Nge.exports=ipt});var Uge=_((aHt,Mge)=>{var spt=Eg(),opt=CS();function apt(t,e){return spt(t,opt(t),e)}Mge.exports=apt});var fH=_((lHt,_ge)=>{var lpt=ES(),cpt=QS(),upt=CS(),Apt=bN(),fpt=Object.getOwnPropertySymbols,ppt=fpt?function(t){for(var e=[];t;)lpt(e,upt(t)),t=cpt(t);return e}:Apt;_ge.exports=ppt});var qge=_((cHt,Hge)=>{var hpt=Eg(),gpt=fH();function dpt(t,e){return hpt(t,gpt(t),e)}Hge.exports=dpt});var pH=_((uHt,jge)=>{var mpt=xN(),ypt=fH(),Ept=Vm();function Cpt(t){return mpt(t,Ept,ypt)}jge.exports=Cpt});var Wge=_((AHt,Gge)=>{var Ipt=Object.prototype,wpt=Ipt.hasOwnProperty;function Bpt(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&wpt.call(t,"index")&&(r.index=t.index,r.input=t.input),r}Gge.exports=Bpt});var Kge=_((fHt,Yge)=>{var vpt=bS();function Dpt(t,e){var r=e?vpt(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}Yge.exports=Dpt});var zge=_((pHt,Vge)=>{var Ppt=/\w*$/;function Spt(t){var e=new t.constructor(t.source,Ppt.exec(t));return e.lastIndex=t.lastIndex,e}Vge.exports=Spt});var ede=_((hHt,$ge)=>{var Jge=dg(),Xge=Jge?Jge.prototype:void 0,Zge=Xge?Xge.valueOf:void 0;function xpt(t){return Zge?Object(Zge.call(t)):{}}$ge.exports=xpt});var rde=_((gHt,tde)=>{var bpt=bS(),kpt=Kge(),Qpt=zge(),Fpt=ede(),Rpt=jN(),Tpt="[object Boolean]",Lpt="[object Date]",Npt="[object Map]",Opt="[object Number]",Mpt="[object RegExp]",Upt="[object Set]",_pt="[object String]",Hpt="[object Symbol]",qpt="[object ArrayBuffer]",jpt="[object DataView]",Gpt="[object Float32Array]",Wpt="[object Float64Array]",Ypt="[object Int8Array]",Kpt="[object Int16Array]",Vpt="[object Int32Array]",zpt="[object Uint8Array]",Jpt="[object Uint8ClampedArray]",Xpt="[object Uint16Array]",Zpt="[object Uint32Array]";function $pt(t,e,r){var o=t.constructor;switch(e){case qpt:return bpt(t);case Tpt:case Lpt:return new o(+t);case jpt:return kpt(t,r);case Gpt:case Wpt:case Ypt:case Kpt:case Vpt:case zpt:case Jpt:case Xpt:case Zpt:return Rpt(t,r);case Npt:return new o;case Opt:case _pt:return new o(t);case Mpt:return Qpt(t);case Upt:return new o;case Hpt:return Fpt(t)}}tde.exports=$pt});var ide=_((dHt,nde)=>{var eht=a1(),tht=Zu(),rht="[object Map]";function nht(t){return tht(t)&&eht(t)==rht}nde.exports=nht});var lde=_((mHt,ade)=>{var iht=ide(),sht=wS(),sde=BS(),ode=sde&&sde.isMap,oht=ode?sht(ode):iht;ade.exports=oht});var ude=_((yHt,cde)=>{var aht=a1(),lht=Zu(),cht="[object Set]";function uht(t){return lht(t)&&aht(t)==cht}cde.exports=uht});var hde=_((EHt,pde)=>{var Aht=ude(),fht=wS(),Ade=BS(),fde=Ade&&Ade.isSet,pht=fde?fht(fde):Aht;pde.exports=pht});var hH=_((CHt,yde)=>{var hht=mS(),ght=Rge(),dht=RS(),mht=Lge(),yht=Oge(),Eht=qN(),Cht=kS(),Iht=Uge(),wht=qge(),Bht=RN(),vht=pH(),Dht=a1(),Pht=Wge(),Sht=rde(),xht=GN(),bht=jl(),kht=r1(),Qht=lde(),Fht=cl(),Rht=hde(),Tht=PS(),Lht=Vm(),Nht=1,Oht=2,Mht=4,gde="[object Arguments]",Uht="[object Array]",_ht="[object Boolean]",Hht="[object Date]",qht="[object Error]",dde="[object Function]",jht="[object GeneratorFunction]",Ght="[object Map]",Wht="[object Number]",mde="[object Object]",Yht="[object RegExp]",Kht="[object Set]",Vht="[object String]",zht="[object Symbol]",Jht="[object WeakMap]",Xht="[object ArrayBuffer]",Zht="[object DataView]",$ht="[object Float32Array]",e0t="[object Float64Array]",t0t="[object Int8Array]",r0t="[object Int16Array]",n0t="[object Int32Array]",i0t="[object Uint8Array]",s0t="[object Uint8ClampedArray]",o0t="[object Uint16Array]",a0t="[object Uint32Array]",Ai={};Ai[gde]=Ai[Uht]=Ai[Xht]=Ai[Zht]=Ai[_ht]=Ai[Hht]=Ai[$ht]=Ai[e0t]=Ai[t0t]=Ai[r0t]=Ai[n0t]=Ai[Ght]=Ai[Wht]=Ai[mde]=Ai[Yht]=Ai[Kht]=Ai[Vht]=Ai[zht]=Ai[i0t]=Ai[s0t]=Ai[o0t]=Ai[a0t]=!0;Ai[qht]=Ai[dde]=Ai[Jht]=!1;function Gk(t,e,r,o,a,n){var u,A=e&Nht,p=e&Oht,h=e&Mht;if(r&&(u=a?r(t,o,a,n):r(t)),u!==void 0)return u;if(!Fht(t))return t;var E=bht(t);if(E){if(u=Pht(t),!A)return Cht(t,u)}else{var w=Dht(t),D=w==dde||w==jht;if(kht(t))return Eht(t,A);if(w==mde||w==gde||D&&!a){if(u=p||D?{}:xht(t),!A)return p?wht(t,yht(u,t)):Iht(t,mht(u,t))}else{if(!Ai[w])return a?t:{};u=Sht(t,w,A)}}n||(n=new hht);var b=n.get(t);if(b)return b;n.set(t,u),Rht(t)?t.forEach(function(N){u.add(Gk(N,e,r,N,t,n))}):Qht(t)&&t.forEach(function(N,U){u.set(U,Gk(N,e,r,U,t,n))});var C=h?p?vht:Bht:p?Lht:Tht,T=E?void 0:C(t);return ght(T||t,function(N,U){T&&(U=N,N=t[U]),dht(u,U,Gk(N,e,r,U,t,n))}),u}yde.exports=Gk});var gH=_((IHt,Ede)=>{var l0t=hH(),c0t=1,u0t=4;function A0t(t){return l0t(t,c0t|u0t)}Ede.exports=A0t});var dH=_((wHt,Cde)=>{var f0t=o8();function p0t(t,e,r){return t==null?t:f0t(t,e,r)}Cde.exports=p0t});var Dde=_((xHt,vde)=>{var h0t=Object.prototype,g0t=h0t.hasOwnProperty;function d0t(t,e){return t!=null&&g0t.call(t,e)}vde.exports=d0t});var Sde=_((bHt,Pde)=>{var m0t=Dde(),y0t=a8();function E0t(t,e){return t!=null&&y0t(t,e,m0t)}Pde.exports=E0t});var bde=_((kHt,xde)=>{function C0t(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}xde.exports=C0t});var Qde=_((QHt,kde)=>{var I0t=bk(),w0t=XU();function B0t(t,e){return e.length<2?t:I0t(t,w0t(e,0,-1))}kde.exports=B0t});var yH=_((FHt,Fde)=>{var v0t=Wg(),D0t=bde(),P0t=Qde(),S0t=nE();function x0t(t,e){return e=v0t(e,t),t=P0t(t,e),t==null||delete t[S0t(D0t(e))]}Fde.exports=x0t});var EH=_((RHt,Rde)=>{var b0t=yH();function k0t(t,e){return t==null?!0:b0t(t,e)}Rde.exports=k0t});var Mde=_((l6t,R0t)=>{R0t.exports={name:"@yarnpkg/cli",version:"4.5.3",license:"BSD-2-Clause",main:"./sources/index.ts",exports:{".":"./sources/index.ts","./polyfills":"./sources/polyfills.ts","./package.json":"./package.json"},dependencies:{"@yarnpkg/core":"workspace:^","@yarnpkg/fslib":"workspace:^","@yarnpkg/libzip":"workspace:^","@yarnpkg/parsers":"workspace:^","@yarnpkg/plugin-compat":"workspace:^","@yarnpkg/plugin-constraints":"workspace:^","@yarnpkg/plugin-dlx":"workspace:^","@yarnpkg/plugin-essentials":"workspace:^","@yarnpkg/plugin-exec":"workspace:^","@yarnpkg/plugin-file":"workspace:^","@yarnpkg/plugin-git":"workspace:^","@yarnpkg/plugin-github":"workspace:^","@yarnpkg/plugin-http":"workspace:^","@yarnpkg/plugin-init":"workspace:^","@yarnpkg/plugin-interactive-tools":"workspace:^","@yarnpkg/plugin-link":"workspace:^","@yarnpkg/plugin-nm":"workspace:^","@yarnpkg/plugin-npm":"workspace:^","@yarnpkg/plugin-npm-cli":"workspace:^","@yarnpkg/plugin-pack":"workspace:^","@yarnpkg/plugin-patch":"workspace:^","@yarnpkg/plugin-pnp":"workspace:^","@yarnpkg/plugin-pnpm":"workspace:^","@yarnpkg/plugin-stage":"workspace:^","@yarnpkg/plugin-typescript":"workspace:^","@yarnpkg/plugin-version":"workspace:^","@yarnpkg/plugin-workspace-tools":"workspace:^","@yarnpkg/shell":"workspace:^","ci-info":"^4.0.0",clipanion:"^4.0.0-rc.2",semver:"^7.1.2",tslib:"^2.4.0",typanion:"^3.14.0"},devDependencies:{"@types/semver":"^7.1.0","@yarnpkg/builder":"workspace:^","@yarnpkg/monorepo":"workspace:^","@yarnpkg/pnpify":"workspace:^"},peerDependencies:{"@yarnpkg/core":"workspace:^"},scripts:{postpack:"rm -rf lib",prepack:'run build:compile "$(pwd)"',"build:cli+hook":"run build:pnp:hook && builder build bundle","build:cli":"builder build bundle","run:cli":"builder run","update-local":"run build:cli --no-git-hash && rsync -a --delete bundles/ bin/"},publishConfig:{main:"./lib/index.js",bin:null,exports:{".":"./lib/index.js","./package.json":"./package.json"}},files:["/lib/**/*","!/lib/pluginConfiguration.*","!/lib/cli.*"],"@yarnpkg/builder":{bundles:{standard:["@yarnpkg/plugin-essentials","@yarnpkg/plugin-compat","@yarnpkg/plugin-constraints","@yarnpkg/plugin-dlx","@yarnpkg/plugin-exec","@yarnpkg/plugin-file","@yarnpkg/plugin-git","@yarnpkg/plugin-github","@yarnpkg/plugin-http","@yarnpkg/plugin-init","@yarnpkg/plugin-interactive-tools","@yarnpkg/plugin-link","@yarnpkg/plugin-nm","@yarnpkg/plugin-npm","@yarnpkg/plugin-npm-cli","@yarnpkg/plugin-pack","@yarnpkg/plugin-patch","@yarnpkg/plugin-pnp","@yarnpkg/plugin-pnpm","@yarnpkg/plugin-stage","@yarnpkg/plugin-typescript","@yarnpkg/plugin-version","@yarnpkg/plugin-workspace-tools"]}},repository:{type:"git",url:"ssh://git@github.com/yarnpkg/berry.git",directory:"packages/yarnpkg-cli"},engines:{node:">=18.12.0"}}});var xH=_((U9t,Jde)=>{"use strict";Jde.exports=function(e,r){r===!0&&(r=0);var o="";if(typeof e=="string")try{o=new URL(e).protocol}catch{}else e&&e.constructor===URL&&(o=e.protocol);var a=o.split(/\:|\+/).filter(Boolean);return typeof r=="number"?a[r]:a}});var Zde=_((_9t,Xde)=>{"use strict";var $0t=xH();function egt(t){var e={protocols:[],protocol:null,port:null,resource:"",host:"",user:"",password:"",pathname:"",hash:"",search:"",href:t,query:{},parse_failed:!1};try{var r=new URL(t);e.protocols=$0t(r),e.protocol=e.protocols[0],e.port=r.port,e.resource=r.hostname,e.host=r.host,e.user=r.username||"",e.password=r.password||"",e.pathname=r.pathname,e.hash=r.hash.slice(1),e.search=r.search.slice(1),e.href=r.href,e.query=Object.fromEntries(r.searchParams)}catch{e.protocols=["file"],e.protocol=e.protocols[0],e.port="",e.resource="",e.user="",e.pathname="",e.hash="",e.search="",e.href=t,e.query={},e.parse_failed=!0}return e}Xde.exports=egt});var tme=_((H9t,eme)=>{"use strict";var tgt=Zde();function rgt(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var ngt=rgt(tgt),igt="text/plain",sgt="us-ascii",$de=(t,e)=>e.some(r=>r instanceof RegExp?r.test(t):r===t),ogt=(t,{stripHash:e})=>{let r=/^data:(?[^,]*?),(?[^#]*?)(?:#(?.*))?$/.exec(t);if(!r)throw new Error(`Invalid URL: ${t}`);let{type:o,data:a,hash:n}=r.groups,u=o.split(";");n=e?"":n;let A=!1;u[u.length-1]==="base64"&&(u.pop(),A=!0);let p=(u.shift()||"").toLowerCase(),E=[...u.map(w=>{let[D,b=""]=w.split("=").map(C=>C.trim());return D==="charset"&&(b=b.toLowerCase(),b===sgt)?"":`${D}${b?`=${b}`:""}`}).filter(Boolean)];return A&&E.push("base64"),(E.length>0||p&&p!==igt)&&E.unshift(p),`data:${E.join(";")},${A?a.trim():a}${n?`#${n}`:""}`};function agt(t,e){if(e={defaultProtocol:"http:",normalizeProtocol:!0,forceHttp:!1,forceHttps:!1,stripAuthentication:!0,stripHash:!1,stripTextFragment:!0,stripWWW:!0,removeQueryParameters:[/^utm_\w+/i],removeTrailingSlash:!0,removeSingleSlash:!0,removeDirectoryIndex:!1,sortQueryParameters:!0,...e},t=t.trim(),/^data:/i.test(t))return ogt(t,e);if(/^view-source:/i.test(t))throw new Error("`view-source:` is not supported as it is a non-standard protocol");let r=t.startsWith("//");!r&&/^\.*\//.test(t)||(t=t.replace(/^(?!(?:\w+:)?\/\/)|^\/\//,e.defaultProtocol));let a=new URL(t);if(e.forceHttp&&e.forceHttps)throw new Error("The `forceHttp` and `forceHttps` options cannot be used together");if(e.forceHttp&&a.protocol==="https:"&&(a.protocol="http:"),e.forceHttps&&a.protocol==="http:"&&(a.protocol="https:"),e.stripAuthentication&&(a.username="",a.password=""),e.stripHash?a.hash="":e.stripTextFragment&&(a.hash=a.hash.replace(/#?:~:text.*?$/i,"")),a.pathname){let u=/\b[a-z][a-z\d+\-.]{1,50}:\/\//g,A=0,p="";for(;;){let E=u.exec(a.pathname);if(!E)break;let w=E[0],D=E.index,b=a.pathname.slice(A,D);p+=b.replace(/\/{2,}/g,"/"),p+=w,A=D+w.length}let h=a.pathname.slice(A,a.pathname.length);p+=h.replace(/\/{2,}/g,"/"),a.pathname=p}if(a.pathname)try{a.pathname=decodeURI(a.pathname)}catch{}if(e.removeDirectoryIndex===!0&&(e.removeDirectoryIndex=[/^index\.[a-z]+$/]),Array.isArray(e.removeDirectoryIndex)&&e.removeDirectoryIndex.length>0){let u=a.pathname.split("/"),A=u[u.length-1];$de(A,e.removeDirectoryIndex)&&(u=u.slice(0,-1),a.pathname=u.slice(1).join("/")+"/")}if(a.hostname&&(a.hostname=a.hostname.replace(/\.$/,""),e.stripWWW&&/^www\.(?!www\.)[a-z\-\d]{1,63}\.[a-z.\-\d]{2,63}$/.test(a.hostname)&&(a.hostname=a.hostname.replace(/^www\./,""))),Array.isArray(e.removeQueryParameters))for(let u of[...a.searchParams.keys()])$de(u,e.removeQueryParameters)&&a.searchParams.delete(u);if(e.removeQueryParameters===!0&&(a.search=""),e.sortQueryParameters){a.searchParams.sort();try{a.search=decodeURIComponent(a.search)}catch{}}e.removeTrailingSlash&&(a.pathname=a.pathname.replace(/\/$/,""));let n=t;return t=a.toString(),!e.removeSingleSlash&&a.pathname==="/"&&!n.endsWith("/")&&a.hash===""&&(t=t.replace(/\/$/,"")),(e.removeTrailingSlash||a.pathname==="/")&&a.hash===""&&e.removeSingleSlash&&(t=t.replace(/\/$/,"")),r&&!e.normalizeProtocol&&(t=t.replace(/^http:\/\//,"//")),e.stripProtocol&&(t=t.replace(/^(?:https?:)?\/\//,"")),t}var bH=(t,e=!1)=>{let r=/^(?:([a-z_][a-z0-9_-]{0,31})@|https?:\/\/)([\w\.\-@]+)[\/:]([\~,\.\w,\-,\_,\/]+?(?:\.git|\/)?)$/,o=n=>{let u=new Error(n);throw u.subject_url=t,u};(typeof t!="string"||!t.trim())&&o("Invalid url."),t.length>bH.MAX_INPUT_LENGTH&&o("Input exceeds maximum length. If needed, change the value of parseUrl.MAX_INPUT_LENGTH."),e&&(typeof e!="object"&&(e={stripHash:!1}),t=agt(t,e));let a=ngt.default(t);if(a.parse_failed){let n=a.href.match(r);n?(a.protocols=["ssh"],a.protocol="ssh",a.resource=n[2],a.host=n[2],a.user=n[1],a.pathname=`/${n[3]}`,a.parse_failed=!1):o("URL parsing failed.")}return a};bH.MAX_INPUT_LENGTH=2048;eme.exports=bH});var ime=_((q9t,nme)=>{"use strict";var lgt=xH();function rme(t){if(Array.isArray(t))return t.indexOf("ssh")!==-1||t.indexOf("rsync")!==-1;if(typeof t!="string")return!1;var e=lgt(t);if(t=t.substring(t.indexOf("://")+3),rme(e))return!0;var r=new RegExp(".([a-zA-Z\\d]+):(\\d+)/");return!t.match(r)&&t.indexOf("@"){"use strict";var cgt=tme(),sme=ime();function ugt(t){var e=cgt(t);return e.token="",e.password==="x-oauth-basic"?e.token=e.user:e.user==="x-token-auth"&&(e.token=e.password),sme(e.protocols)||e.protocols.length===0&&sme(t)?e.protocol="ssh":e.protocols.length?e.protocol=e.protocols[0]:(e.protocol="file",e.protocols=["file"]),e.href=e.href.replace(/\/$/,""),e}ome.exports=ugt});var cme=_((G9t,lme)=>{"use strict";var Agt=ame();function kH(t){if(typeof t!="string")throw new Error("The url must be a string.");var e=/^([a-z\d-]{1,39})\/([-\.\w]{1,100})$/i;e.test(t)&&(t="https://github.com/"+t);var r=Agt(t),o=r.resource.split("."),a=null;switch(r.toString=function(N){return kH.stringify(this,N)},r.source=o.length>2?o.slice(1-o.length).join("."):r.source=r.resource,r.git_suffix=/\.git$/.test(r.pathname),r.name=decodeURIComponent((r.pathname||r.href).replace(/(^\/)|(\/$)/g,"").replace(/\.git$/,"")),r.owner=decodeURIComponent(r.user),r.source){case"git.cloudforge.com":r.owner=r.user,r.organization=o[0],r.source="cloudforge.com";break;case"visualstudio.com":if(r.resource==="vs-ssh.visualstudio.com"){a=r.name.split("/"),a.length===4&&(r.organization=a[1],r.owner=a[2],r.name=a[3],r.full_name=a[2]+"/"+a[3]);break}else{a=r.name.split("/"),a.length===2?(r.owner=a[1],r.name=a[1],r.full_name="_git/"+r.name):a.length===3?(r.name=a[2],a[0]==="DefaultCollection"?(r.owner=a[2],r.organization=a[0],r.full_name=r.organization+"/_git/"+r.name):(r.owner=a[0],r.full_name=r.owner+"/_git/"+r.name)):a.length===4&&(r.organization=a[0],r.owner=a[1],r.name=a[3],r.full_name=r.organization+"/"+r.owner+"/_git/"+r.name);break}case"dev.azure.com":case"azure.com":if(r.resource==="ssh.dev.azure.com"){a=r.name.split("/"),a.length===4&&(r.organization=a[1],r.owner=a[2],r.name=a[3]);break}else{a=r.name.split("/"),a.length===5?(r.organization=a[0],r.owner=a[1],r.name=a[4],r.full_name="_git/"+r.name):a.length===3?(r.name=a[2],a[0]==="DefaultCollection"?(r.owner=a[2],r.organization=a[0],r.full_name=r.organization+"/_git/"+r.name):(r.owner=a[0],r.full_name=r.owner+"/_git/"+r.name)):a.length===4&&(r.organization=a[0],r.owner=a[1],r.name=a[3],r.full_name=r.organization+"/"+r.owner+"/_git/"+r.name),r.query&&r.query.path&&(r.filepath=r.query.path.replace(/^\/+/g,"")),r.query&&r.query.version&&(r.ref=r.query.version.replace(/^GB/,""));break}default:a=r.name.split("/");var n=a.length-1;if(a.length>=2){var u=a.indexOf("-",2),A=a.indexOf("blob",2),p=a.indexOf("tree",2),h=a.indexOf("commit",2),E=a.indexOf("src",2),w=a.indexOf("raw",2),D=a.indexOf("edit",2);n=u>0?u-1:A>0?A-1:p>0?p-1:h>0?h-1:E>0?E-1:w>0?w-1:D>0?D-1:n,r.owner=a.slice(0,n).join("/"),r.name=a[n],h&&(r.commit=a[n+2])}r.ref="",r.filepathtype="",r.filepath="";var b=a.length>n&&a[n+1]==="-"?n+1:n;a.length>b+2&&["raw","src","blob","tree","edit"].indexOf(a[b+1])>=0&&(r.filepathtype=a[b+1],r.ref=a[b+2],a.length>b+3&&(r.filepath=a.slice(b+3).join("/"))),r.organization=r.owner;break}r.full_name||(r.full_name=r.owner,r.name&&(r.full_name&&(r.full_name+="/"),r.full_name+=r.name)),r.owner.startsWith("scm/")&&(r.source="bitbucket-server",r.owner=r.owner.replace("scm/",""),r.organization=r.owner,r.full_name=r.owner+"/"+r.name);var C=/(projects|users)\/(.*?)\/repos\/(.*?)((\/.*$)|$)/,T=C.exec(r.pathname);return T!=null&&(r.source="bitbucket-server",T[1]==="users"?r.owner="~"+T[2]:r.owner=T[2],r.organization=r.owner,r.name=T[3],a=T[4].split("/"),a.length>1&&(["raw","browse"].indexOf(a[1])>=0?(r.filepathtype=a[1],a.length>2&&(r.filepath=a.slice(2).join("/"))):a[1]==="commits"&&a.length>2&&(r.commit=a[2])),r.full_name=r.owner+"/"+r.name,r.query.at?r.ref=r.query.at:r.ref=""),r}kH.stringify=function(t,e){e=e||(t.protocols&&t.protocols.length?t.protocols.join("+"):t.protocol);var r=t.port?":"+t.port:"",o=t.user||"git",a=t.git_suffix?".git":"";switch(e){case"ssh":return r?"ssh://"+o+"@"+t.resource+r+"/"+t.full_name+a:o+"@"+t.resource+":"+t.full_name+a;case"git+ssh":case"ssh+git":case"ftp":case"ftps":return e+"://"+o+"@"+t.resource+r+"/"+t.full_name+a;case"http":case"https":var n=t.token?fgt(t):t.user&&(t.protocols.includes("http")||t.protocols.includes("https"))?t.user+"@":"";return e+"://"+n+t.resource+r+"/"+pgt(t)+a;default:return t.href}};function fgt(t){switch(t.source){case"bitbucket.org":return"x-token-auth:"+t.token+"@";default:return t.token+"@"}}function pgt(t){switch(t.source){case"bitbucket-server":return"scm/"+t.full_name;default:return""+t.full_name}}lme.exports=kH});var Dme=_((B5t,vme)=>{var vgt=Cb(),Dgt=kS(),Pgt=jl(),Sgt=fy(),xgt=s8(),bgt=nE(),kgt=t2();function Qgt(t){return Pgt(t)?vgt(t,bgt):Sgt(t)?[t]:Dgt(xgt(kgt(t)))}vme.exports=Qgt});function Lgt(t,e){return e===1&&Tgt.has(t[0])}function q2(t){let e=Array.isArray(t)?t:(0,xme.default)(t);return e.map((o,a)=>Fgt.test(o)?`[${o}]`:Rgt.test(o)&&!Lgt(e,a)?`.${o}`:`[${JSON.stringify(o)}]`).join("").replace(/^\./,"")}function Ngt(t,e){let r=[];if(e.methodName!==null&&r.push(pe.pretty(t,e.methodName,pe.Type.CODE)),e.file!==null){let o=[];o.push(pe.pretty(t,e.file,pe.Type.PATH)),e.line!==null&&(o.push(pe.pretty(t,e.line,pe.Type.NUMBER)),e.column!==null&&o.push(pe.pretty(t,e.column,pe.Type.NUMBER))),r.push(`(${o.join(pe.pretty(t,":","grey"))})`)}return r.join(" ")}function Vk(t,{manifestUpdates:e,reportedErrors:r},{fix:o}={}){let a=new Map,n=new Map,u=[...r.keys()].map(A=>[A,new Map]);for(let[A,p]of[...u,...e]){let h=r.get(A)?.map(b=>({text:b,fixable:!1}))??[],E=!1,w=t.getWorkspaceByCwd(A),D=w.manifest.exportTo({});for(let[b,C]of p){if(C.size>1){let T=[...C].map(([N,U])=>{let z=pe.pretty(t.configuration,N,pe.Type.INSPECT),te=U.size>0?Ngt(t.configuration,U.values().next().value):null;return te!==null?` ${z} at ${te}`:` ${z}`}).join("");h.push({text:`Conflict detected in constraint targeting ${pe.pretty(t.configuration,b,pe.Type.CODE)}; conflicting values are:${T}`,fixable:!1})}else{let[[T]]=C,N=(0,Pme.default)(D,b);if(JSON.stringify(N)===JSON.stringify(T))continue;if(!o){let U=typeof N>"u"?`Missing field ${pe.pretty(t.configuration,b,pe.Type.CODE)}; expected ${pe.pretty(t.configuration,T,pe.Type.INSPECT)}`:typeof T>"u"?`Extraneous field ${pe.pretty(t.configuration,b,pe.Type.CODE)} currently set to ${pe.pretty(t.configuration,N,pe.Type.INSPECT)}`:`Invalid field ${pe.pretty(t.configuration,b,pe.Type.CODE)}; expected ${pe.pretty(t.configuration,T,pe.Type.INSPECT)}, found ${pe.pretty(t.configuration,N,pe.Type.INSPECT)}`;h.push({text:U,fixable:!0});continue}typeof T>"u"?(0,bme.default)(D,b):(0,Sme.default)(D,b,T),E=!0}E&&a.set(w,D)}h.length>0&&n.set(w,h)}return{changedWorkspaces:a,remainingErrors:n}}function kme(t,{configuration:e}){let r={children:[]};for(let[o,a]of t){let n=[];for(let A of a){let p=A.text.split(/\n/);A.fixable&&(p[0]=`${pe.pretty(e,"\u2699","gray")} ${p[0]}`),n.push({value:pe.tuple(pe.Type.NO_HINT,p[0]),children:p.slice(1).map(h=>({value:pe.tuple(pe.Type.NO_HINT,h)}))})}let u={value:pe.tuple(pe.Type.LOCATOR,o.anchoredLocator),children:qe.sortMap(n,A=>A.value[1])};r.children.push(u)}return r.children=qe.sortMap(r.children,o=>o.value[1]),r}var Pme,Sme,xme,bme,ZE,Fgt,Rgt,Tgt,j2=It(()=>{Ke();Pme=et(L2()),Sme=et(dH()),xme=et(Dme()),bme=et(EH()),ZE=class{constructor(e){this.indexedFields=e;this.items=[];this.indexes={};this.clear()}clear(){this.items=[];for(let e of this.indexedFields)this.indexes[e]=new Map}insert(e){this.items.push(e);for(let r of this.indexedFields){let o=Object.hasOwn(e,r)?e[r]:void 0;if(typeof o>"u")continue;qe.getArrayWithDefault(this.indexes[r],o).push(e)}return e}find(e){if(typeof e>"u")return this.items;let r=Object.entries(e);if(r.length===0)return this.items;let o=[],a;for(let[u,A]of r){let p=u,h=Object.hasOwn(this.indexes,p)?this.indexes[p]:void 0;if(typeof h>"u"){o.push([p,A]);continue}let E=new Set(h.get(A)??[]);if(E.size===0)return[];if(typeof a>"u")a=E;else for(let w of a)E.has(w)||a.delete(w);if(a.size===0)break}let n=[...a??[]];return o.length>0&&(n=n.filter(u=>{for(let[A,p]of o)if(!(typeof p<"u"?Object.hasOwn(u,A)&&u[A]===p:Object.hasOwn(u,A)===!1))return!1;return!0})),n}},Fgt=/^[0-9]+$/,Rgt=/^[a-zA-Z0-9_]+$/,Tgt=new Set(["scripts",..._t.allDependencies])});var Qme=_((L5t,GH)=>{var Ogt;(function(t){var e=function(){return{"append/2":[new t.type.Rule(new t.type.Term("append",[new t.type.Var("X"),new t.type.Var("L")]),new t.type.Term("foldl",[new t.type.Term("append",[]),new t.type.Var("X"),new t.type.Term("[]",[]),new t.type.Var("L")]))],"append/3":[new t.type.Rule(new t.type.Term("append",[new t.type.Term("[]",[]),new t.type.Var("X"),new t.type.Var("X")]),null),new t.type.Rule(new t.type.Term("append",[new t.type.Term(".",[new t.type.Var("H"),new t.type.Var("T")]),new t.type.Var("X"),new t.type.Term(".",[new t.type.Var("H"),new t.type.Var("S")])]),new t.type.Term("append",[new t.type.Var("T"),new t.type.Var("X"),new t.type.Var("S")]))],"member/2":[new t.type.Rule(new t.type.Term("member",[new t.type.Var("X"),new t.type.Term(".",[new t.type.Var("X"),new t.type.Var("_")])]),null),new t.type.Rule(new t.type.Term("member",[new t.type.Var("X"),new t.type.Term(".",[new t.type.Var("_"),new t.type.Var("Xs")])]),new t.type.Term("member",[new t.type.Var("X"),new t.type.Var("Xs")]))],"permutation/2":[new t.type.Rule(new t.type.Term("permutation",[new t.type.Term("[]",[]),new t.type.Term("[]",[])]),null),new t.type.Rule(new t.type.Term("permutation",[new t.type.Term(".",[new t.type.Var("H"),new t.type.Var("T")]),new t.type.Var("S")]),new t.type.Term(",",[new t.type.Term("permutation",[new t.type.Var("T"),new t.type.Var("P")]),new t.type.Term(",",[new t.type.Term("append",[new t.type.Var("X"),new t.type.Var("Y"),new t.type.Var("P")]),new t.type.Term("append",[new t.type.Var("X"),new t.type.Term(".",[new t.type.Var("H"),new t.type.Var("Y")]),new t.type.Var("S")])])]))],"maplist/2":[new t.type.Rule(new t.type.Term("maplist",[new t.type.Var("_"),new t.type.Term("[]",[])]),null),new t.type.Rule(new t.type.Term("maplist",[new t.type.Var("P"),new t.type.Term(".",[new t.type.Var("X"),new t.type.Var("Xs")])]),new t.type.Term(",",[new t.type.Term("call",[new t.type.Var("P"),new t.type.Var("X")]),new t.type.Term("maplist",[new t.type.Var("P"),new t.type.Var("Xs")])]))],"maplist/3":[new t.type.Rule(new t.type.Term("maplist",[new t.type.Var("_"),new t.type.Term("[]",[]),new t.type.Term("[]",[])]),null),new t.type.Rule(new t.type.Term("maplist",[new t.type.Var("P"),new t.type.Term(".",[new t.type.Var("A"),new t.type.Var("As")]),new t.type.Term(".",[new t.type.Var("B"),new t.type.Var("Bs")])]),new t.type.Term(",",[new t.type.Term("call",[new t.type.Var("P"),new t.type.Var("A"),new t.type.Var("B")]),new t.type.Term("maplist",[new t.type.Var("P"),new t.type.Var("As"),new t.type.Var("Bs")])]))],"maplist/4":[new t.type.Rule(new t.type.Term("maplist",[new t.type.Var("_"),new t.type.Term("[]",[]),new t.type.Term("[]",[]),new t.type.Term("[]",[])]),null),new t.type.Rule(new t.type.Term("maplist",[new t.type.Var("P"),new t.type.Term(".",[new t.type.Var("A"),new t.type.Var("As")]),new t.type.Term(".",[new t.type.Var("B"),new t.type.Var("Bs")]),new t.type.Term(".",[new t.type.Var("C"),new t.type.Var("Cs")])]),new t.type.Term(",",[new t.type.Term("call",[new t.type.Var("P"),new t.type.Var("A"),new t.type.Var("B"),new t.type.Var("C")]),new t.type.Term("maplist",[new t.type.Var("P"),new t.type.Var("As"),new t.type.Var("Bs"),new t.type.Var("Cs")])]))],"maplist/5":[new t.type.Rule(new t.type.Term("maplist",[new t.type.Var("_"),new t.type.Term("[]",[]),new t.type.Term("[]",[]),new t.type.Term("[]",[]),new t.type.Term("[]",[])]),null),new t.type.Rule(new t.type.Term("maplist",[new t.type.Var("P"),new t.type.Term(".",[new t.type.Var("A"),new t.type.Var("As")]),new t.type.Term(".",[new t.type.Var("B"),new t.type.Var("Bs")]),new t.type.Term(".",[new t.type.Var("C"),new t.type.Var("Cs")]),new t.type.Term(".",[new t.type.Var("D"),new t.type.Var("Ds")])]),new t.type.Term(",",[new t.type.Term("call",[new t.type.Var("P"),new t.type.Var("A"),new t.type.Var("B"),new t.type.Var("C"),new t.type.Var("D")]),new t.type.Term("maplist",[new t.type.Var("P"),new t.type.Var("As"),new t.type.Var("Bs"),new t.type.Var("Cs"),new t.type.Var("Ds")])]))],"maplist/6":[new t.type.Rule(new t.type.Term("maplist",[new t.type.Var("_"),new t.type.Term("[]",[]),new t.type.Term("[]",[]),new t.type.Term("[]",[]),new t.type.Term("[]",[]),new t.type.Term("[]",[])]),null),new t.type.Rule(new t.type.Term("maplist",[new t.type.Var("P"),new t.type.Term(".",[new t.type.Var("A"),new t.type.Var("As")]),new t.type.Term(".",[new t.type.Var("B"),new t.type.Var("Bs")]),new t.type.Term(".",[new t.type.Var("C"),new t.type.Var("Cs")]),new t.type.Term(".",[new t.type.Var("D"),new t.type.Var("Ds")]),new t.type.Term(".",[new t.type.Var("E"),new t.type.Var("Es")])]),new t.type.Term(",",[new t.type.Term("call",[new t.type.Var("P"),new t.type.Var("A"),new t.type.Var("B"),new t.type.Var("C"),new t.type.Var("D"),new t.type.Var("E")]),new t.type.Term("maplist",[new t.type.Var("P"),new t.type.Var("As"),new t.type.Var("Bs"),new t.type.Var("Cs"),new t.type.Var("Ds"),new t.type.Var("Es")])]))],"maplist/7":[new t.type.Rule(new t.type.Term("maplist",[new t.type.Var("_"),new t.type.Term("[]",[]),new t.type.Term("[]",[]),new t.type.Term("[]",[]),new t.type.Term("[]",[]),new t.type.Term("[]",[]),new t.type.Term("[]",[])]),null),new t.type.Rule(new t.type.Term("maplist",[new t.type.Var("P"),new t.type.Term(".",[new t.type.Var("A"),new t.type.Var("As")]),new t.type.Term(".",[new t.type.Var("B"),new t.type.Var("Bs")]),new t.type.Term(".",[new t.type.Var("C"),new t.type.Var("Cs")]),new t.type.Term(".",[new t.type.Var("D"),new t.type.Var("Ds")]),new t.type.Term(".",[new t.type.Var("E"),new t.type.Var("Es")]),new t.type.Term(".",[new t.type.Var("F"),new t.type.Var("Fs")])]),new t.type.Term(",",[new t.type.Term("call",[new t.type.Var("P"),new t.type.Var("A"),new t.type.Var("B"),new t.type.Var("C"),new t.type.Var("D"),new t.type.Var("E"),new t.type.Var("F")]),new t.type.Term("maplist",[new t.type.Var("P"),new t.type.Var("As"),new t.type.Var("Bs"),new t.type.Var("Cs"),new t.type.Var("Ds"),new t.type.Var("Es"),new t.type.Var("Fs")])]))],"maplist/8":[new t.type.Rule(new t.type.Term("maplist",[new t.type.Var("_"),new t.type.Term("[]",[]),new t.type.Term("[]",[]),new t.type.Term("[]",[]),new t.type.Term("[]",[]),new t.type.Term("[]",[]),new t.type.Term("[]",[]),new t.type.Term("[]",[])]),null),new t.type.Rule(new t.type.Term("maplist",[new t.type.Var("P"),new t.type.Term(".",[new t.type.Var("A"),new t.type.Var("As")]),new t.type.Term(".",[new t.type.Var("B"),new t.type.Var("Bs")]),new t.type.Term(".",[new t.type.Var("C"),new t.type.Var("Cs")]),new t.type.Term(".",[new t.type.Var("D"),new t.type.Var("Ds")]),new t.type.Term(".",[new t.type.Var("E"),new t.type.Var("Es")]),new t.type.Term(".",[new t.type.Var("F"),new t.type.Var("Fs")]),new t.type.Term(".",[new t.type.Var("G"),new t.type.Var("Gs")])]),new t.type.Term(",",[new t.type.Term("call",[new t.type.Var("P"),new t.type.Var("A"),new t.type.Var("B"),new t.type.Var("C"),new t.type.Var("D"),new t.type.Var("E"),new t.type.Var("F"),new t.type.Var("G")]),new t.type.Term("maplist",[new t.type.Var("P"),new t.type.Var("As"),new t.type.Var("Bs"),new t.type.Var("Cs"),new t.type.Var("Ds"),new t.type.Var("Es"),new t.type.Var("Fs"),new t.type.Var("Gs")])]))],"include/3":[new t.type.Rule(new t.type.Term("include",[new t.type.Var("_"),new t.type.Term("[]",[]),new t.type.Term("[]",[])]),null),new t.type.Rule(new t.type.Term("include",[new t.type.Var("P"),new t.type.Term(".",[new t.type.Var("H"),new t.type.Var("T")]),new t.type.Var("L")]),new t.type.Term(",",[new t.type.Term("=..",[new t.type.Var("P"),new t.type.Var("A")]),new t.type.Term(",",[new t.type.Term("append",[new t.type.Var("A"),new t.type.Term(".",[new t.type.Var("H"),new t.type.Term("[]",[])]),new t.type.Var("B")]),new t.type.Term(",",[new t.type.Term("=..",[new t.type.Var("F"),new t.type.Var("B")]),new t.type.Term(",",[new t.type.Term(";",[new t.type.Term(",",[new t.type.Term("call",[new t.type.Var("F")]),new t.type.Term(",",[new t.type.Term("=",[new t.type.Var("L"),new t.type.Term(".",[new t.type.Var("H"),new t.type.Var("S")])]),new t.type.Term("!",[])])]),new t.type.Term("=",[new t.type.Var("L"),new t.type.Var("S")])]),new t.type.Term("include",[new t.type.Var("P"),new t.type.Var("T"),new t.type.Var("S")])])])])]))],"exclude/3":[new t.type.Rule(new t.type.Term("exclude",[new t.type.Var("_"),new t.type.Term("[]",[]),new t.type.Term("[]",[])]),null),new t.type.Rule(new t.type.Term("exclude",[new t.type.Var("P"),new t.type.Term(".",[new t.type.Var("H"),new t.type.Var("T")]),new t.type.Var("S")]),new t.type.Term(",",[new t.type.Term("exclude",[new t.type.Var("P"),new t.type.Var("T"),new t.type.Var("E")]),new t.type.Term(",",[new t.type.Term("=..",[new t.type.Var("P"),new t.type.Var("L")]),new t.type.Term(",",[new t.type.Term("append",[new t.type.Var("L"),new t.type.Term(".",[new t.type.Var("H"),new t.type.Term("[]",[])]),new t.type.Var("Q")]),new t.type.Term(",",[new t.type.Term("=..",[new t.type.Var("R"),new t.type.Var("Q")]),new t.type.Term(";",[new t.type.Term(",",[new t.type.Term("call",[new t.type.Var("R")]),new t.type.Term(",",[new t.type.Term("!",[]),new t.type.Term("=",[new t.type.Var("S"),new t.type.Var("E")])])]),new t.type.Term("=",[new t.type.Var("S"),new t.type.Term(".",[new t.type.Var("H"),new t.type.Var("E")])])])])])])]))],"foldl/4":[new t.type.Rule(new t.type.Term("foldl",[new t.type.Var("_"),new t.type.Term("[]",[]),new t.type.Var("I"),new t.type.Var("I")]),null),new t.type.Rule(new t.type.Term("foldl",[new t.type.Var("P"),new t.type.Term(".",[new t.type.Var("H"),new t.type.Var("T")]),new t.type.Var("I"),new t.type.Var("R")]),new t.type.Term(",",[new t.type.Term("=..",[new t.type.Var("P"),new t.type.Var("L")]),new t.type.Term(",",[new t.type.Term("append",[new t.type.Var("L"),new t.type.Term(".",[new t.type.Var("I"),new t.type.Term(".",[new t.type.Var("H"),new t.type.Term(".",[new t.type.Var("X"),new t.type.Term("[]",[])])])]),new t.type.Var("L2")]),new t.type.Term(",",[new t.type.Term("=..",[new t.type.Var("P2"),new t.type.Var("L2")]),new t.type.Term(",",[new t.type.Term("call",[new t.type.Var("P2")]),new t.type.Term("foldl",[new t.type.Var("P"),new t.type.Var("T"),new t.type.Var("X"),new t.type.Var("R")])])])])]))],"select/3":[new t.type.Rule(new t.type.Term("select",[new t.type.Var("E"),new t.type.Term(".",[new t.type.Var("E"),new t.type.Var("Xs")]),new t.type.Var("Xs")]),null),new t.type.Rule(new t.type.Term("select",[new t.type.Var("E"),new t.type.Term(".",[new t.type.Var("X"),new t.type.Var("Xs")]),new t.type.Term(".",[new t.type.Var("X"),new t.type.Var("Ys")])]),new t.type.Term("select",[new t.type.Var("E"),new t.type.Var("Xs"),new t.type.Var("Ys")]))],"sum_list/2":[new t.type.Rule(new t.type.Term("sum_list",[new t.type.Term("[]",[]),new t.type.Num(0,!1)]),null),new t.type.Rule(new t.type.Term("sum_list",[new t.type.Term(".",[new t.type.Var("X"),new t.type.Var("Xs")]),new t.type.Var("S")]),new t.type.Term(",",[new t.type.Term("sum_list",[new t.type.Var("Xs"),new t.type.Var("Y")]),new t.type.Term("is",[new t.type.Var("S"),new t.type.Term("+",[new t.type.Var("X"),new t.type.Var("Y")])])]))],"max_list/2":[new t.type.Rule(new t.type.Term("max_list",[new t.type.Term(".",[new t.type.Var("X"),new t.type.Term("[]",[])]),new t.type.Var("X")]),null),new t.type.Rule(new t.type.Term("max_list",[new t.type.Term(".",[new t.type.Var("X"),new t.type.Var("Xs")]),new t.type.Var("S")]),new t.type.Term(",",[new t.type.Term("max_list",[new t.type.Var("Xs"),new t.type.Var("Y")]),new t.type.Term(";",[new t.type.Term(",",[new t.type.Term(">=",[new t.type.Var("X"),new t.type.Var("Y")]),new t.type.Term(",",[new t.type.Term("=",[new t.type.Var("S"),new t.type.Var("X")]),new t.type.Term("!",[])])]),new t.type.Term("=",[new t.type.Var("S"),new t.type.Var("Y")])])]))],"min_list/2":[new t.type.Rule(new t.type.Term("min_list",[new t.type.Term(".",[new t.type.Var("X"),new t.type.Term("[]",[])]),new t.type.Var("X")]),null),new t.type.Rule(new t.type.Term("min_list",[new t.type.Term(".",[new t.type.Var("X"),new t.type.Var("Xs")]),new t.type.Var("S")]),new t.type.Term(",",[new t.type.Term("min_list",[new t.type.Var("Xs"),new t.type.Var("Y")]),new t.type.Term(";",[new t.type.Term(",",[new t.type.Term("=<",[new t.type.Var("X"),new t.type.Var("Y")]),new t.type.Term(",",[new t.type.Term("=",[new t.type.Var("S"),new t.type.Var("X")]),new t.type.Term("!",[])])]),new t.type.Term("=",[new t.type.Var("S"),new t.type.Var("Y")])])]))],"prod_list/2":[new t.type.Rule(new t.type.Term("prod_list",[new t.type.Term("[]",[]),new t.type.Num(1,!1)]),null),new t.type.Rule(new t.type.Term("prod_list",[new t.type.Term(".",[new t.type.Var("X"),new t.type.Var("Xs")]),new t.type.Var("S")]),new t.type.Term(",",[new t.type.Term("prod_list",[new t.type.Var("Xs"),new t.type.Var("Y")]),new t.type.Term("is",[new t.type.Var("S"),new t.type.Term("*",[new t.type.Var("X"),new t.type.Var("Y")])])]))],"last/2":[new t.type.Rule(new t.type.Term("last",[new t.type.Term(".",[new t.type.Var("X"),new t.type.Term("[]",[])]),new t.type.Var("X")]),null),new t.type.Rule(new t.type.Term("last",[new t.type.Term(".",[new t.type.Var("_"),new t.type.Var("Xs")]),new t.type.Var("X")]),new t.type.Term("last",[new t.type.Var("Xs"),new t.type.Var("X")]))],"prefix/2":[new t.type.Rule(new t.type.Term("prefix",[new t.type.Var("Part"),new t.type.Var("Whole")]),new t.type.Term("append",[new t.type.Var("Part"),new t.type.Var("_"),new t.type.Var("Whole")]))],"nth0/3":[new t.type.Rule(new t.type.Term("nth0",[new t.type.Var("X"),new t.type.Var("Y"),new t.type.Var("Z")]),new t.type.Term(";",[new t.type.Term("->",[new t.type.Term("var",[new t.type.Var("X")]),new t.type.Term("nth",[new t.type.Num(0,!1),new t.type.Var("X"),new t.type.Var("Y"),new t.type.Var("Z"),new t.type.Var("_")])]),new t.type.Term(",",[new t.type.Term(">=",[new t.type.Var("X"),new t.type.Num(0,!1)]),new t.type.Term(",",[new t.type.Term("nth",[new t.type.Num(0,!1),new t.type.Var("X"),new t.type.Var("Y"),new t.type.Var("Z"),new t.type.Var("_")]),new t.type.Term("!",[])])])]))],"nth1/3":[new t.type.Rule(new t.type.Term("nth1",[new t.type.Var("X"),new t.type.Var("Y"),new t.type.Var("Z")]),new t.type.Term(";",[new t.type.Term("->",[new t.type.Term("var",[new t.type.Var("X")]),new t.type.Term("nth",[new t.type.Num(1,!1),new t.type.Var("X"),new t.type.Var("Y"),new t.type.Var("Z"),new t.type.Var("_")])]),new t.type.Term(",",[new t.type.Term(">",[new t.type.Var("X"),new t.type.Num(0,!1)]),new t.type.Term(",",[new t.type.Term("nth",[new t.type.Num(1,!1),new t.type.Var("X"),new t.type.Var("Y"),new t.type.Var("Z"),new t.type.Var("_")]),new t.type.Term("!",[])])])]))],"nth0/4":[new t.type.Rule(new t.type.Term("nth0",[new t.type.Var("X"),new t.type.Var("Y"),new t.type.Var("Z"),new t.type.Var("W")]),new t.type.Term(";",[new t.type.Term("->",[new t.type.Term("var",[new t.type.Var("X")]),new t.type.Term("nth",[new t.type.Num(0,!1),new t.type.Var("X"),new t.type.Var("Y"),new t.type.Var("Z"),new t.type.Var("W")])]),new t.type.Term(",",[new t.type.Term(">=",[new t.type.Var("X"),new t.type.Num(0,!1)]),new t.type.Term(",",[new t.type.Term("nth",[new t.type.Num(0,!1),new t.type.Var("X"),new t.type.Var("Y"),new t.type.Var("Z"),new t.type.Var("W")]),new t.type.Term("!",[])])])]))],"nth1/4":[new t.type.Rule(new t.type.Term("nth1",[new t.type.Var("X"),new t.type.Var("Y"),new t.type.Var("Z"),new t.type.Var("W")]),new t.type.Term(";",[new t.type.Term("->",[new t.type.Term("var",[new t.type.Var("X")]),new t.type.Term("nth",[new t.type.Num(1,!1),new t.type.Var("X"),new t.type.Var("Y"),new t.type.Var("Z"),new t.type.Var("W")])]),new t.type.Term(",",[new t.type.Term(">",[new t.type.Var("X"),new t.type.Num(0,!1)]),new t.type.Term(",",[new t.type.Term("nth",[new t.type.Num(1,!1),new t.type.Var("X"),new t.type.Var("Y"),new t.type.Var("Z"),new t.type.Var("W")]),new t.type.Term("!",[])])])]))],"nth/5":[new t.type.Rule(new t.type.Term("nth",[new t.type.Var("N"),new t.type.Var("N"),new t.type.Term(".",[new t.type.Var("X"),new t.type.Var("Xs")]),new t.type.Var("X"),new t.type.Var("Xs")]),null),new t.type.Rule(new t.type.Term("nth",[new t.type.Var("N"),new t.type.Var("O"),new t.type.Term(".",[new t.type.Var("X"),new t.type.Var("Xs")]),new t.type.Var("Y"),new t.type.Term(".",[new t.type.Var("X"),new t.type.Var("Ys")])]),new t.type.Term(",",[new t.type.Term("is",[new t.type.Var("M"),new t.type.Term("+",[new t.type.Var("N"),new t.type.Num(1,!1)])]),new t.type.Term("nth",[new t.type.Var("M"),new t.type.Var("O"),new t.type.Var("Xs"),new t.type.Var("Y"),new t.type.Var("Ys")])]))],"length/2":function(o,a,n){var u=n.args[0],A=n.args[1];if(!t.type.is_variable(A)&&!t.type.is_integer(A))o.throw_error(t.error.type("integer",A,n.indicator));else if(t.type.is_integer(A)&&A.value<0)o.throw_error(t.error.domain("not_less_than_zero",A,n.indicator));else{var p=new t.type.Term("length",[u,new t.type.Num(0,!1),A]);t.type.is_integer(A)&&(p=new t.type.Term(",",[p,new t.type.Term("!",[])])),o.prepend([new t.type.State(a.goal.replace(p),a.substitution,a)])}},"length/3":[new t.type.Rule(new t.type.Term("length",[new t.type.Term("[]",[]),new t.type.Var("N"),new t.type.Var("N")]),null),new t.type.Rule(new t.type.Term("length",[new t.type.Term(".",[new t.type.Var("_"),new t.type.Var("X")]),new t.type.Var("A"),new t.type.Var("N")]),new t.type.Term(",",[new t.type.Term("succ",[new t.type.Var("A"),new t.type.Var("B")]),new t.type.Term("length",[new t.type.Var("X"),new t.type.Var("B"),new t.type.Var("N")])]))],"replicate/3":function(o,a,n){var u=n.args[0],A=n.args[1],p=n.args[2];if(t.type.is_variable(A))o.throw_error(t.error.instantiation(n.indicator));else if(!t.type.is_integer(A))o.throw_error(t.error.type("integer",A,n.indicator));else if(A.value<0)o.throw_error(t.error.domain("not_less_than_zero",A,n.indicator));else if(!t.type.is_variable(p)&&!t.type.is_list(p))o.throw_error(t.error.type("list",p,n.indicator));else{for(var h=new t.type.Term("[]"),E=0;E0;w--)E[w].equals(E[w-1])&&E.splice(w,1);for(var D=new t.type.Term("[]"),w=E.length-1;w>=0;w--)D=new t.type.Term(".",[E[w],D]);o.prepend([new t.type.State(a.goal.replace(new t.type.Term("=",[D,A])),a.substitution,a)])}}},"msort/2":function(o,a,n){var u=n.args[0],A=n.args[1];if(t.type.is_variable(u))o.throw_error(t.error.instantiation(n.indicator));else if(!t.type.is_variable(A)&&!t.type.is_fully_list(A))o.throw_error(t.error.type("list",A,n.indicator));else{for(var p=[],h=u;h.indicator==="./2";)p.push(h.args[0]),h=h.args[1];if(t.type.is_variable(h))o.throw_error(t.error.instantiation(n.indicator));else if(!t.type.is_empty_list(h))o.throw_error(t.error.type("list",u,n.indicator));else{for(var E=p.sort(t.compare),w=new t.type.Term("[]"),D=E.length-1;D>=0;D--)w=new t.type.Term(".",[E[D],w]);o.prepend([new t.type.State(a.goal.replace(new t.type.Term("=",[w,A])),a.substitution,a)])}}},"keysort/2":function(o,a,n){var u=n.args[0],A=n.args[1];if(t.type.is_variable(u))o.throw_error(t.error.instantiation(n.indicator));else if(!t.type.is_variable(A)&&!t.type.is_fully_list(A))o.throw_error(t.error.type("list",A,n.indicator));else{for(var p=[],h,E=u;E.indicator==="./2";){if(h=E.args[0],t.type.is_variable(h)){o.throw_error(t.error.instantiation(n.indicator));return}else if(!t.type.is_term(h)||h.indicator!=="-/2"){o.throw_error(t.error.type("pair",h,n.indicator));return}h.args[0].pair=h.args[1],p.push(h.args[0]),E=E.args[1]}if(t.type.is_variable(E))o.throw_error(t.error.instantiation(n.indicator));else if(!t.type.is_empty_list(E))o.throw_error(t.error.type("list",u,n.indicator));else{for(var w=p.sort(t.compare),D=new t.type.Term("[]"),b=w.length-1;b>=0;b--)D=new t.type.Term(".",[new t.type.Term("-",[w[b],w[b].pair]),D]),delete w[b].pair;o.prepend([new t.type.State(a.goal.replace(new t.type.Term("=",[D,A])),a.substitution,a)])}}},"take/3":function(o,a,n){var u=n.args[0],A=n.args[1],p=n.args[2];if(t.type.is_variable(A)||t.type.is_variable(u))o.throw_error(t.error.instantiation(n.indicator));else if(!t.type.is_list(A))o.throw_error(t.error.type("list",A,n.indicator));else if(!t.type.is_integer(u))o.throw_error(t.error.type("integer",u,n.indicator));else if(!t.type.is_variable(p)&&!t.type.is_list(p))o.throw_error(t.error.type("list",p,n.indicator));else{for(var h=u.value,E=[],w=A;h>0&&w.indicator==="./2";)E.push(w.args[0]),w=w.args[1],h--;if(h===0){for(var D=new t.type.Term("[]"),h=E.length-1;h>=0;h--)D=new t.type.Term(".",[E[h],D]);o.prepend([new t.type.State(a.goal.replace(new t.type.Term("=",[D,p])),a.substitution,a)])}}},"drop/3":function(o,a,n){var u=n.args[0],A=n.args[1],p=n.args[2];if(t.type.is_variable(A)||t.type.is_variable(u))o.throw_error(t.error.instantiation(n.indicator));else if(!t.type.is_list(A))o.throw_error(t.error.type("list",A,n.indicator));else if(!t.type.is_integer(u))o.throw_error(t.error.type("integer",u,n.indicator));else if(!t.type.is_variable(p)&&!t.type.is_list(p))o.throw_error(t.error.type("list",p,n.indicator));else{for(var h=u.value,E=[],w=A;h>0&&w.indicator==="./2";)E.push(w.args[0]),w=w.args[1],h--;h===0&&o.prepend([new t.type.State(a.goal.replace(new t.type.Term("=",[w,p])),a.substitution,a)])}},"reverse/2":function(o,a,n){var u=n.args[0],A=n.args[1],p=t.type.is_instantiated_list(u),h=t.type.is_instantiated_list(A);if(t.type.is_variable(u)&&t.type.is_variable(A))o.throw_error(t.error.instantiation(n.indicator));else if(!t.type.is_variable(u)&&!t.type.is_fully_list(u))o.throw_error(t.error.type("list",u,n.indicator));else if(!t.type.is_variable(A)&&!t.type.is_fully_list(A))o.throw_error(t.error.type("list",A,n.indicator));else if(!p&&!h)o.throw_error(t.error.instantiation(n.indicator));else{for(var E=p?u:A,w=new t.type.Term("[]",[]);E.indicator==="./2";)w=new t.type.Term(".",[E.args[0],w]),E=E.args[1];o.prepend([new t.type.State(a.goal.replace(new t.type.Term("=",[w,p?A:u])),a.substitution,a)])}},"list_to_set/2":function(o,a,n){var u=n.args[0],A=n.args[1];if(t.type.is_variable(u))o.throw_error(t.error.instantiation(n.indicator));else{for(var p=u,h=[];p.indicator==="./2";)h.push(p.args[0]),p=p.args[1];if(t.type.is_variable(p))o.throw_error(t.error.instantiation(n.indicator));else if(!t.type.is_term(p)||p.indicator!=="[]/0")o.throw_error(t.error.type("list",u,n.indicator));else{for(var E=[],w=new t.type.Term("[]",[]),D,b=0;b=0;b--)w=new t.type.Term(".",[E[b],w]);o.prepend([new t.type.State(a.goal.replace(new t.type.Term("=",[A,w])),a.substitution,a)])}}}}},r=["append/2","append/3","member/2","permutation/2","maplist/2","maplist/3","maplist/4","maplist/5","maplist/6","maplist/7","maplist/8","include/3","exclude/3","foldl/4","sum_list/2","max_list/2","min_list/2","prod_list/2","last/2","prefix/2","nth0/3","nth1/3","nth0/4","nth1/4","length/2","replicate/3","select/3","sort/2","msort/2","keysort/2","take/3","drop/3","reverse/2","list_to_set/2"];typeof GH<"u"?GH.exports=function(o){t=o,new t.type.Module("lists",e(),r)}:new t.type.Module("lists",e(),r)})(Ogt)});var Yme=_(Vr=>{"use strict";var Xg=process.platform==="win32",WH="aes-256-cbc",Mgt="sha256",Tme="The current environment doesn't support interactive reading from TTY.",Xn=ve("fs"),Fme=process.binding("tty_wrap").TTY,KH=ve("child_process"),Lh=ve("path"),VH={prompt:"> ",hideEchoBack:!1,mask:"*",limit:[],limitMessage:"Input another, please.$<( [)limit(])>",defaultInput:"",trueValue:[],falseValue:[],caseSensitive:!1,keepWhitespace:!1,encoding:"utf8",bufferSize:1024,print:void 0,history:!0,cd:!1,phContent:void 0,preCheck:void 0},Kf="none",iu,eC,Rme=!1,Th,Jk,YH,Ugt=0,$H="",Jg=[],Xk,Lme=!1,zH=!1,G2=!1;function Nme(t){function e(r){return r.replace(/[^\w\u0080-\uFFFF]/g,function(o){return"#"+o.charCodeAt(0)+";"})}return Jk.concat(function(r){var o=[];return Object.keys(r).forEach(function(a){r[a]==="boolean"?t[a]&&o.push("--"+a):r[a]==="string"&&t[a]&&o.push("--"+a,e(t[a]))}),o}({display:"string",displayOnly:"boolean",keyIn:"boolean",hideEchoBack:"boolean",mask:"string",limit:"string",caseSensitive:"boolean"}))}function _gt(t,e){function r(U){var z,te="",le;for(YH=YH||ve("os").tmpdir();;){z=Lh.join(YH,U+te);try{le=Xn.openSync(z,"wx")}catch(ce){if(ce.code==="EEXIST"){te++;continue}else throw ce}Xn.closeSync(le);break}return z}var o,a,n,u={},A,p,h=r("readline-sync.stdout"),E=r("readline-sync.stderr"),w=r("readline-sync.exit"),D=r("readline-sync.done"),b=ve("crypto"),C,T,N;C=b.createHash(Mgt),C.update(""+process.pid+Ugt+++Math.random()),N=C.digest("hex"),T=b.createDecipher(WH,N),o=Nme(t),Xg?(a=process.env.ComSpec||"cmd.exe",process.env.Q='"',n=["/V:ON","/S","/C","(%Q%"+a+"%Q% /V:ON /S /C %Q%%Q%"+Th+"%Q%"+o.map(function(U){return" %Q%"+U+"%Q%"}).join("")+" & (echo !ERRORLEVEL!)>%Q%"+w+"%Q%%Q%) 2>%Q%"+E+"%Q% |%Q%"+process.execPath+"%Q% %Q%"+__dirname+"\\encrypt.js%Q% %Q%"+WH+"%Q% %Q%"+N+"%Q% >%Q%"+h+"%Q% & (echo 1)>%Q%"+D+"%Q%"]):(a="/bin/sh",n=["-c",'("'+Th+'"'+o.map(function(U){return" '"+U.replace(/'/g,"'\\''")+"'"}).join("")+'; echo $?>"'+w+'") 2>"'+E+'" |"'+process.execPath+'" "'+__dirname+'/encrypt.js" "'+WH+'" "'+N+'" >"'+h+'"; echo 1 >"'+D+'"']),G2&&G2("_execFileSync",o);try{KH.spawn(a,n,e)}catch(U){u.error=new Error(U.message),u.error.method="_execFileSync - spawn",u.error.program=a,u.error.args=n}for(;Xn.readFileSync(D,{encoding:t.encoding}).trim()!=="1";);return(A=Xn.readFileSync(w,{encoding:t.encoding}).trim())==="0"?u.input=T.update(Xn.readFileSync(h,{encoding:"binary"}),"hex",t.encoding)+T.final(t.encoding):(p=Xn.readFileSync(E,{encoding:t.encoding}).trim(),u.error=new Error(Tme+(p?` `+p:"")),u.error.method="_execFileSync",u.error.program=a,u.error.args=n,u.error.extMessage=p,u.error.exitCode=+A),Xn.unlinkSync(h),Xn.unlinkSync(E),Xn.unlinkSync(w),Xn.unlinkSync(D),u}function Hgt(t){var e,r={},o,a={env:process.env,encoding:t.encoding};if(Th||(Xg?process.env.PSModulePath?(Th="powershell.exe",Jk=["-ExecutionPolicy","Bypass","-File",__dirname+"\\read.ps1"]):(Th="cscript.exe",Jk=["//nologo",__dirname+"\\read.cs.js"]):(Th="/bin/sh",Jk=[__dirname+"/read.sh"])),Xg&&!process.env.PSModulePath&&(a.stdio=[process.stdin]),KH.execFileSync){e=Nme(t),G2&&G2("execFileSync",e);try{r.input=KH.execFileSync(Th,e,a)}catch(n){o=n.stderr?(n.stderr+"").trim():"",r.error=new Error(Tme+(o?` `+o:"")),r.error.method="execFileSync",r.error.program=Th,r.error.args=e,r.error.extMessage=o,r.error.exitCode=n.status,r.error.code=n.code,r.error.signal=n.signal}}else r=_gt(t,a);return r.error||(r.input=r.input.replace(/^\s*'|'\s*$/g,""),t.display=""),r}function JH(t){var e="",r=t.display,o=!t.display&&t.keyIn&&t.hideEchoBack&&!t.mask;function a(){var n=Hgt(t);if(n.error)throw n.error;return n.input}return zH&&zH(t),function(){var n,u,A;function p(){return n||(n=process.binding("fs"),u=process.binding("constants")),n}if(typeof Kf=="string")if(Kf=null,Xg){if(A=function(h){var E=h.replace(/^\D+/,"").split("."),w=0;return(E[0]=+E[0])&&(w+=E[0]*1e4),(E[1]=+E[1])&&(w+=E[1]*100),(E[2]=+E[2])&&(w+=E[2]),w}(process.version),!(A>=20302&&A<40204||A>=5e4&&A<50100||A>=50600&&A<60200)&&process.stdin.isTTY)process.stdin.pause(),Kf=process.stdin.fd,eC=process.stdin._handle;else try{Kf=p().open("CONIN$",u.O_RDWR,parseInt("0666",8)),eC=new Fme(Kf,!0)}catch{}if(process.stdout.isTTY)iu=process.stdout.fd;else{try{iu=Xn.openSync("\\\\.\\CON","w")}catch{}if(typeof iu!="number")try{iu=p().open("CONOUT$",u.O_RDWR,parseInt("0666",8))}catch{}}}else{if(process.stdin.isTTY){process.stdin.pause();try{Kf=Xn.openSync("/dev/tty","r"),eC=process.stdin._handle}catch{}}else try{Kf=Xn.openSync("/dev/tty","r"),eC=new Fme(Kf,!1)}catch{}if(process.stdout.isTTY)iu=process.stdout.fd;else try{iu=Xn.openSync("/dev/tty","w")}catch{}}}(),function(){var n,u,A=!t.hideEchoBack&&!t.keyIn,p,h,E,w,D;Xk="";function b(C){return C===Rme?!0:eC.setRawMode(C)!==0?!1:(Rme=C,!0)}if(Lme||!eC||typeof iu!="number"&&(t.display||!A)){e=a();return}if(t.display&&(Xn.writeSync(iu,t.display),t.display=""),!t.displayOnly){if(!b(!A)){e=a();return}for(h=t.keyIn?1:t.bufferSize,p=Buffer.allocUnsafe&&Buffer.alloc?Buffer.alloc(h):new Buffer(h),t.keyIn&&t.limit&&(u=new RegExp("[^"+t.limit+"]","g"+(t.caseSensitive?"":"i")));;){E=0;try{E=Xn.readSync(Kf,p,0,h)}catch(C){if(C.code!=="EOF"){b(!1),e+=a();return}}if(E>0?(w=p.toString(t.encoding,0,E),Xk+=w):(w=` `,Xk+="\0"),w&&typeof(D=(w.match(/^(.*?)[\r\n]/)||[])[1])=="string"&&(w=D,n=!0),w&&(w=w.replace(/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/g,"")),w&&u&&(w=w.replace(u,"")),w&&(A||(t.hideEchoBack?t.mask&&Xn.writeSync(iu,new Array(w.length+1).join(t.mask)):Xn.writeSync(iu,w)),e+=w),!t.keyIn&&n||t.keyIn&&e.length>=h)break}!A&&!o&&Xn.writeSync(iu,` `),b(!1)}}(),t.print&&!o&&t.print(r+(t.displayOnly?"":(t.hideEchoBack?new Array(e.length+1).join(t.mask):e)+` `),t.encoding),t.displayOnly?"":$H=t.keepWhitespace||t.keyIn?e:e.trim()}function qgt(t,e){var r=[];function o(a){a!=null&&(Array.isArray(a)?a.forEach(o):(!e||e(a))&&r.push(a))}return o(t),r}function e6(t){return t.replace(/[\x00-\x7f]/g,function(e){return"\\x"+("00"+e.charCodeAt().toString(16)).substr(-2)})}function bs(){var t=Array.prototype.slice.call(arguments),e,r;return t.length&&typeof t[0]=="boolean"&&(r=t.shift(),r&&(e=Object.keys(VH),t.unshift(VH))),t.reduce(function(o,a){return a==null||(a.hasOwnProperty("noEchoBack")&&!a.hasOwnProperty("hideEchoBack")&&(a.hideEchoBack=a.noEchoBack,delete a.noEchoBack),a.hasOwnProperty("noTrim")&&!a.hasOwnProperty("keepWhitespace")&&(a.keepWhitespace=a.noTrim,delete a.noTrim),r||(e=Object.keys(a)),e.forEach(function(n){var u;if(a.hasOwnProperty(n))switch(u=a[n],n){case"mask":case"limitMessage":case"defaultInput":case"encoding":u=u!=null?u+"":"",u&&n!=="limitMessage"&&(u=u.replace(/[\r\n]/g,"")),o[n]=u;break;case"bufferSize":!isNaN(u=parseInt(u,10))&&typeof u=="number"&&(o[n]=u);break;case"displayOnly":case"keyIn":case"hideEchoBack":case"caseSensitive":case"keepWhitespace":case"history":case"cd":o[n]=!!u;break;case"limit":case"trueValue":case"falseValue":o[n]=qgt(u,function(A){var p=typeof A;return p==="string"||p==="number"||p==="function"||A instanceof RegExp}).map(function(A){return typeof A=="string"?A.replace(/[\r\n]/g,""):A});break;case"print":case"phContent":case"preCheck":o[n]=typeof u=="function"?u:void 0;break;case"prompt":case"display":o[n]=u??"";break}})),o},{})}function XH(t,e,r){return e.some(function(o){var a=typeof o;return a==="string"?r?t===o:t.toLowerCase()===o.toLowerCase():a==="number"?parseFloat(t)===o:a==="function"?o(t):o instanceof RegExp?o.test(t):!1})}function t6(t,e){var r=Lh.normalize(Xg?(process.env.HOMEDRIVE||"")+(process.env.HOMEPATH||""):process.env.HOME||"").replace(/[\/\\]+$/,"");return t=Lh.normalize(t),e?t.replace(/^~(?=\/|\\|$)/,r):t.replace(new RegExp("^"+e6(r)+"(?=\\/|\\\\|$)",Xg?"i":""),"~")}function tC(t,e){var r="(?:\\(([\\s\\S]*?)\\))?(\\w+|.-.)(?:\\(([\\s\\S]*?)\\))?",o=new RegExp("(\\$)?(\\$<"+r+">)","g"),a=new RegExp("(\\$)?(\\$\\{"+r+"\\})","g");function n(u,A,p,h,E,w){var D;return A||typeof(D=e(E))!="string"?p:D?(h||"")+D+(w||""):""}return t.replace(o,n).replace(a,n)}function Ome(t,e,r){var o,a=[],n=-1,u=0,A="",p;function h(E,w){return w.length>3?(E.push(w[0]+"..."+w[w.length-1]),p=!0):w.length&&(E=E.concat(w)),E}return o=t.reduce(function(E,w){return E.concat((w+"").split(""))},[]).reduce(function(E,w){var D,b;return e||(w=w.toLowerCase()),D=/^\d$/.test(w)?1:/^[A-Z]$/.test(w)?2:/^[a-z]$/.test(w)?3:0,r&&D===0?A+=w:(b=w.charCodeAt(0),D&&D===n&&b===u+1?a.push(w):(E=h(E,a),a=[w],n=D),u=b),E},[]),o=h(o,a),A&&(o.push(A),p=!0),{values:o,suppressed:p}}function Mme(t,e){return t.join(t.length>2?", ":e?" / ":"/")}function Ume(t,e){var r,o,a={},n;if(e.phContent&&(r=e.phContent(t,e)),typeof r!="string")switch(t){case"hideEchoBack":case"mask":case"defaultInput":case"caseSensitive":case"keepWhitespace":case"encoding":case"bufferSize":case"history":case"cd":r=e.hasOwnProperty(t)?typeof e[t]=="boolean"?e[t]?"on":"off":e[t]+"":"";break;case"limit":case"trueValue":case"falseValue":o=e[e.hasOwnProperty(t+"Src")?t+"Src":t],e.keyIn?(a=Ome(o,e.caseSensitive),o=a.values):o=o.filter(function(u){var A=typeof u;return A==="string"||A==="number"}),r=Mme(o,a.suppressed);break;case"limitCount":case"limitCountNotZero":r=e[e.hasOwnProperty("limitSrc")?"limitSrc":"limit"].length,r=r||t!=="limitCountNotZero"?r+"":"";break;case"lastInput":r=$H;break;case"cwd":case"CWD":case"cwdHome":r=process.cwd(),t==="CWD"?r=Lh.basename(r):t==="cwdHome"&&(r=t6(r));break;case"date":case"time":case"localeDate":case"localeTime":r=new Date()["to"+t.replace(/^./,function(u){return u.toUpperCase()})+"String"]();break;default:typeof(n=(t.match(/^history_m(\d+)$/)||[])[1])=="string"&&(r=Jg[Jg.length-n]||"")}return r}function _me(t){var e=/^(.)-(.)$/.exec(t),r="",o,a,n,u;if(!e)return null;for(o=e[1].charCodeAt(0),a=e[2].charCodeAt(0),u=o And the length must be: $`,trueValue:null,falseValue:null,caseSensitive:!0},e,{history:!1,cd:!1,phContent:function(b){return b==="charlist"?r.text:b==="length"?o+"..."+a:null}}),u,A,p,h,E,w,D;for(e=e||{},u=tC(e.charlist?e.charlist+"":"$",_me),(isNaN(o=parseInt(e.min,10))||typeof o!="number")&&(o=12),(isNaN(a=parseInt(e.max,10))||typeof a!="number")&&(a=24),h=new RegExp("^["+e6(u)+"]{"+o+","+a+"}$"),r=Ome([u],n.caseSensitive,!0),r.text=Mme(r.values,r.suppressed),A=e.confirmMessage!=null?e.confirmMessage:"Reinput a same one to confirm it: ",p=e.unmatchMessage!=null?e.unmatchMessage:"It differs from first one. Hit only the Enter key if you want to retry from first one.",t==null&&(t="Input new password: "),E=n.limitMessage;!D;)n.limit=h,n.limitMessage=E,w=Vr.question(t,n),n.limit=[w,""],n.limitMessage=p,D=Vr.question(A,n);return w};function jme(t,e,r){var o;function a(n){return o=r(n),!isNaN(o)&&typeof o=="number"}return Vr.question(t,bs({limitMessage:"Input valid number, please."},e,{limit:a,cd:!1})),o}Vr.questionInt=function(t,e){return jme(t,e,function(r){return parseInt(r,10)})};Vr.questionFloat=function(t,e){return jme(t,e,parseFloat)};Vr.questionPath=function(t,e){var r,o="",a=bs({hideEchoBack:!1,limitMessage:`$Input valid path, please.$<( Min:)min>$<( Max:)max>`,history:!0,cd:!0},e,{keepWhitespace:!1,limit:function(n){var u,A,p;n=t6(n,!0),o="";function h(E){E.split(/\/|\\/).reduce(function(w,D){var b=Lh.resolve(w+=D+Lh.sep);if(!Xn.existsSync(b))Xn.mkdirSync(b);else if(!Xn.statSync(b).isDirectory())throw new Error("Non directory already exists: "+b);return w},"")}try{if(u=Xn.existsSync(n),r=u?Xn.realpathSync(n):Lh.resolve(n),!e.hasOwnProperty("exists")&&!u||typeof e.exists=="boolean"&&e.exists!==u)return o=(u?"Already exists":"No such file or directory")+": "+r,!1;if(!u&&e.create&&(e.isDirectory?h(r):(h(Lh.dirname(r)),Xn.closeSync(Xn.openSync(r,"w"))),r=Xn.realpathSync(r)),u&&(e.min||e.max||e.isFile||e.isDirectory)){if(A=Xn.statSync(r),e.isFile&&!A.isFile())return o="Not file: "+r,!1;if(e.isDirectory&&!A.isDirectory())return o="Not directory: "+r,!1;if(e.min&&A.size<+e.min||e.max&&A.size>+e.max)return o="Size "+A.size+" is out of range: "+r,!1}if(typeof e.validate=="function"&&(p=e.validate(r))!==!0)return typeof p=="string"&&(o=p),!1}catch(E){return o=E+"",!1}return!0},phContent:function(n){return n==="error"?o:n!=="min"&&n!=="max"?null:e.hasOwnProperty(n)?e[n]+"":""}});return e=e||{},t==null&&(t='Input path (you can "cd" and "pwd"): '),Vr.question(t,a),r};function Gme(t,e){var r={},o={};return typeof t=="object"?(Object.keys(t).forEach(function(a){typeof t[a]=="function"&&(o[e.caseSensitive?a:a.toLowerCase()]=t[a])}),r.preCheck=function(a){var n;return r.args=ZH(a),n=r.args[0]||"",e.caseSensitive||(n=n.toLowerCase()),r.hRes=n!=="_"&&o.hasOwnProperty(n)?o[n].apply(a,r.args.slice(1)):o.hasOwnProperty("_")?o._.apply(a,r.args):null,{res:a,forceNext:!1}},o.hasOwnProperty("_")||(r.limit=function(){var a=r.args[0]||"";return e.caseSensitive||(a=a.toLowerCase()),o.hasOwnProperty(a)})):r.preCheck=function(a){return r.args=ZH(a),r.hRes=typeof t=="function"?t.apply(a,r.args):!0,{res:a,forceNext:!1}},r}Vr.promptCL=function(t,e){var r=bs({hideEchoBack:!1,limitMessage:"Requested command is not available.",caseSensitive:!1,history:!0},e),o=Gme(t,r);return r.limit=o.limit,r.preCheck=o.preCheck,Vr.prompt(r),o.args};Vr.promptLoop=function(t,e){for(var r=bs({hideEchoBack:!1,trueValue:null,falseValue:null,caseSensitive:!1,history:!0},e);!t(Vr.prompt(r)););};Vr.promptCLLoop=function(t,e){var r=bs({hideEchoBack:!1,limitMessage:"Requested command is not available.",caseSensitive:!1,history:!0},e),o=Gme(t,r);for(r.limit=o.limit,r.preCheck=o.preCheck;Vr.prompt(r),!o.hRes;);};Vr.promptSimShell=function(t){return Vr.prompt(bs({hideEchoBack:!1,history:!0},t,{prompt:function(){return Xg?"$>":(process.env.USER||"")+(process.env.HOSTNAME?"@"+process.env.HOSTNAME.replace(/\..*$/,""):"")+":$$ "}()}))};function Wme(t,e,r){var o;return t==null&&(t="Are you sure? "),(!e||e.guide!==!1)&&(t+="")&&(t=t.replace(/\s*:?\s*$/,"")+" [y/n]: "),o=Vr.keyIn(t,bs(e,{hideEchoBack:!1,limit:r,trueValue:"y",falseValue:"n",caseSensitive:!1})),typeof o=="boolean"?o:""}Vr.keyInYN=function(t,e){return Wme(t,e)};Vr.keyInYNStrict=function(t,e){return Wme(t,e,"yn")};Vr.keyInPause=function(t,e){t==null&&(t="Continue..."),(!e||e.guide!==!1)&&(t+="")&&(t=t.replace(/\s+$/,"")+" (Hit any key)"),Vr.keyIn(t,bs({limit:null},e,{hideEchoBack:!0,mask:""}))};Vr.keyInSelect=function(t,e,r){var o=bs({hideEchoBack:!1},r,{trueValue:null,falseValue:null,caseSensitive:!1,phContent:function(p){return p==="itemsCount"?t.length+"":p==="firstItem"?(t[0]+"").trim():p==="lastItem"?(t[t.length-1]+"").trim():null}}),a="",n={},u=49,A=` `;if(!Array.isArray(t)||!t.length||t.length>35)throw"`items` must be Array (max length: 35).";return t.forEach(function(p,h){var E=String.fromCharCode(u);a+=E,n[E]=h,A+="["+E+"] "+(p+"").trim()+` `,u=u===57?97:u+1}),(!r||r.cancel!==!1)&&(a+="0",n[0]=-1,A+="[0] "+(r&&r.cancel!=null&&typeof r.cancel!="boolean"?(r.cancel+"").trim():"CANCEL")+` `),o.limit=a,A+=` `,e==null&&(e="Choose one from list: "),(e+="")&&((!r||r.guide!==!1)&&(e=e.replace(/\s*:?\s*$/,"")+" [$]: "),A+=e),n[Vr.keyIn(A,o).toLowerCase()]};Vr.getRawInput=function(){return Xk};function W2(t,e){var r;return e.length&&(r={},r[t]=e[0]),Vr.setDefaultOptions(r)[t]}Vr.setPrint=function(){return W2("print",arguments)};Vr.setPrompt=function(){return W2("prompt",arguments)};Vr.setEncoding=function(){return W2("encoding",arguments)};Vr.setMask=function(){return W2("mask",arguments)};Vr.setBufferSize=function(){return W2("bufferSize",arguments)}});var r6=_((O5t,El)=>{(function(){var t={major:0,minor:2,patch:66,status:"beta"};tau_file_system={files:{},open:function(I,S,y){var R=tau_file_system.files[I];if(!R){if(y==="read")return null;R={path:I,text:"",type:S,get:function(J,X){return X===this.text.length||X>this.text.length?"end_of_file":this.text.substring(X,X+J)},put:function(J,X){return X==="end_of_file"?(this.text+=J,!0):X==="past_end_of_file"?null:(this.text=this.text.substring(0,X)+J+this.text.substring(X+J.length),!0)},get_byte:function(J){if(J==="end_of_stream")return-1;var X=Math.floor(J/2);if(this.text.length<=X)return-1;var $=n(this.text[Math.floor(J/2)],0);return J%2===0?$&255:$/256>>>0},put_byte:function(J,X){var $=X==="end_of_stream"?this.text.length:Math.floor(X/2);if(this.text.length<$)return null;var se=this.text.length===$?-1:n(this.text[Math.floor(X/2)],0);return X%2===0?(se=se/256>>>0,se=(se&255)<<8|J&255):(se=se&255,se=(J&255)<<8|se&255),this.text.length===$?this.text+=u(se):this.text=this.text.substring(0,$)+u(se)+this.text.substring($+1),!0},flush:function(){return!0},close:function(){var J=tau_file_system.files[this.path];return J?!0:null}},tau_file_system.files[I]=R}return y==="write"&&(R.text=""),R}},tau_user_input={buffer:"",get:function(I,S){for(var y;tau_user_input.buffer.length\?\@\^\~\\]+|'(?:[^']*?(?:\\(?:x?\d+)?\\)*(?:'')*(?:\\')*)*')/,number:/^(?:0o[0-7]+|0x[0-9a-fA-F]+|0b[01]+|0'(?:''|\\[abfnrtv\\'"`]|\\x?\d+\\|[^\\])|\d+(?:\.\d+(?:[eE][+-]?\d+)?)?)/,string:/^(?:"([^"]|""|\\")*"|`([^`]|``|\\`)*`)/,l_brace:/^(?:\[)/,r_brace:/^(?:\])/,l_bracket:/^(?:\{)/,r_bracket:/^(?:\})/,bar:/^(?:\|)/,l_paren:/^(?:\()/,r_paren:/^(?:\))/};function N(I,S){return I.get_flag("char_conversion").id==="on"?S.replace(/./g,function(y){return I.get_char_conversion(y)}):S}function U(I){this.thread=I,this.text="",this.tokens=[]}U.prototype.set_last_tokens=function(I){return this.tokens=I},U.prototype.new_text=function(I){this.text=I,this.tokens=[]},U.prototype.get_tokens=function(I){var S,y=0,R=0,J=0,X=[],$=!1;if(I){var se=this.tokens[I-1];y=se.len,S=N(this.thread,this.text.substr(se.len)),R=se.line,J=se.start}else S=this.text;if(/^\s*$/.test(S))return null;for(;S!=="";){var be=[],Fe=!1;if(/^\n/.exec(S)!==null){R++,J=0,y++,S=S.replace(/\n/,""),$=!0;continue}for(var lt in T)if(T.hasOwnProperty(lt)){var Et=T[lt].exec(S);Et&&be.push({value:Et[0],name:lt,matches:Et})}if(!be.length)return this.set_last_tokens([{value:S,matches:[],name:"lexical",line:R,start:J}]);var se=r(be,function(Pr,yr){return Pr.value.length>=yr.value.length?Pr:yr});switch(se.start=J,se.line=R,S=S.replace(se.value,""),J+=se.value.length,y+=se.value.length,se.name){case"atom":se.raw=se.value,se.value.charAt(0)==="'"&&(se.value=D(se.value.substr(1,se.value.length-2),"'"),se.value===null&&(se.name="lexical",se.value="unknown escape sequence"));break;case"number":se.float=se.value.substring(0,2)!=="0x"&&se.value.match(/[.eE]/)!==null&&se.value!=="0'.",se.value=C(se.value),se.blank=Fe;break;case"string":var qt=se.value.charAt(0);se.value=D(se.value.substr(1,se.value.length-2),qt),se.value===null&&(se.name="lexical",se.value="unknown escape sequence");break;case"whitespace":var nr=X[X.length-1];nr&&(nr.space=!0),Fe=!0;continue;case"r_bracket":X.length>0&&X[X.length-1].name==="l_bracket"&&(se=X.pop(),se.name="atom",se.value="{}",se.raw="{}",se.space=!1);break;case"r_brace":X.length>0&&X[X.length-1].name==="l_brace"&&(se=X.pop(),se.name="atom",se.value="[]",se.raw="[]",se.space=!1);break}se.len=y,X.push(se),Fe=!1}var St=this.set_last_tokens(X);return St.length===0?null:St};function z(I,S,y,R,J){if(!S[y])return{type:A,value:x.error.syntax(S[y-1],"expression expected",!0)};var X;if(R==="0"){var $=S[y];switch($.name){case"number":return{type:p,len:y+1,value:new x.type.Num($.value,$.float)};case"variable":return{type:p,len:y+1,value:new x.type.Var($.value)};case"string":var se;switch(I.get_flag("double_quotes").id){case"atom":se=new q($.value,[]);break;case"codes":se=new q("[]",[]);for(var be=$.value.length-1;be>=0;be--)se=new q(".",[new x.type.Num(n($.value,be),!1),se]);break;case"chars":se=new q("[]",[]);for(var be=$.value.length-1;be>=0;be--)se=new q(".",[new x.type.Term($.value.charAt(be),[]),se]);break}return{type:p,len:y+1,value:se};case"l_paren":var St=z(I,S,y+1,I.__get_max_priority(),!0);return St.type!==p?St:S[St.len]&&S[St.len].name==="r_paren"?(St.len++,St):{type:A,derived:!0,value:x.error.syntax(S[St.len]?S[St.len]:S[St.len-1],") or operator expected",!S[St.len])};case"l_bracket":var St=z(I,S,y+1,I.__get_max_priority(),!0);return St.type!==p?St:S[St.len]&&S[St.len].name==="r_bracket"?(St.len++,St.value=new q("{}",[St.value]),St):{type:A,derived:!0,value:x.error.syntax(S[St.len]?S[St.len]:S[St.len-1],"} or operator expected",!S[St.len])}}var Fe=te(I,S,y,J);return Fe.type===p||Fe.derived||(Fe=le(I,S,y),Fe.type===p||Fe.derived)?Fe:{type:A,derived:!1,value:x.error.syntax(S[y],"unexpected token")}}var lt=I.__get_max_priority(),Et=I.__get_next_priority(R),qt=y;if(S[y].name==="atom"&&S[y+1]&&(S[y].space||S[y+1].name!=="l_paren")){var $=S[y++],nr=I.__lookup_operator_classes(R,$.value);if(nr&&nr.indexOf("fy")>-1){var St=z(I,S,y,R,J);if(St.type!==A)return $.value==="-"&&!$.space&&x.type.is_number(St.value)?{value:new x.type.Num(-St.value.value,St.value.is_float),len:St.len,type:p}:{value:new x.type.Term($.value,[St.value]),len:St.len,type:p};X=St}else if(nr&&nr.indexOf("fx")>-1){var St=z(I,S,y,Et,J);if(St.type!==A)return{value:new x.type.Term($.value,[St.value]),len:St.len,type:p};X=St}}y=qt;var St=z(I,S,y,Et,J);if(St.type===p){y=St.len;var $=S[y];if(S[y]&&(S[y].name==="atom"&&I.__lookup_operator_classes(R,$.value)||S[y].name==="bar"&&I.__lookup_operator_classes(R,"|"))){var cn=Et,Pr=R,nr=I.__lookup_operator_classes(R,$.value);if(nr.indexOf("xf")>-1)return{value:new x.type.Term($.value,[St.value]),len:++St.len,type:p};if(nr.indexOf("xfx")>-1){var yr=z(I,S,y+1,cn,J);return yr.type===p?{value:new x.type.Term($.value,[St.value,yr.value]),len:yr.len,type:p}:(yr.derived=!0,yr)}else if(nr.indexOf("xfy")>-1){var yr=z(I,S,y+1,Pr,J);return yr.type===p?{value:new x.type.Term($.value,[St.value,yr.value]),len:yr.len,type:p}:(yr.derived=!0,yr)}else if(St.type!==A)for(;;){y=St.len;var $=S[y];if($&&$.name==="atom"&&I.__lookup_operator_classes(R,$.value)){var nr=I.__lookup_operator_classes(R,$.value);if(nr.indexOf("yf")>-1)St={value:new x.type.Term($.value,[St.value]),len:++y,type:p};else if(nr.indexOf("yfx")>-1){var yr=z(I,S,++y,cn,J);if(yr.type===A)return yr.derived=!0,yr;y=yr.len,St={value:new x.type.Term($.value,[St.value,yr.value]),len:y,type:p}}else break}else break}}else X={type:A,value:x.error.syntax(S[St.len-1],"operator expected")};return St}return St}function te(I,S,y,R){if(!S[y]||S[y].name==="atom"&&S[y].raw==="."&&!R&&(S[y].space||!S[y+1]||S[y+1].name!=="l_paren"))return{type:A,derived:!1,value:x.error.syntax(S[y-1],"unfounded token")};var J=S[y],X=[];if(S[y].name==="atom"&&S[y].raw!==","){if(y++,S[y-1].space)return{type:p,len:y,value:new x.type.Term(J.value,X)};if(S[y]&&S[y].name==="l_paren"){if(S[y+1]&&S[y+1].name==="r_paren")return{type:A,derived:!0,value:x.error.syntax(S[y+1],"argument expected")};var $=z(I,S,++y,"999",!0);if($.type===A)return $.derived?$:{type:A,derived:!0,value:x.error.syntax(S[y]?S[y]:S[y-1],"argument expected",!S[y])};for(X.push($.value),y=$.len;S[y]&&S[y].name==="atom"&&S[y].value===",";){if($=z(I,S,y+1,"999",!0),$.type===A)return $.derived?$:{type:A,derived:!0,value:x.error.syntax(S[y+1]?S[y+1]:S[y],"argument expected",!S[y+1])};X.push($.value),y=$.len}if(S[y]&&S[y].name==="r_paren")y++;else return{type:A,derived:!0,value:x.error.syntax(S[y]?S[y]:S[y-1],", or ) expected",!S[y])}}return{type:p,len:y,value:new x.type.Term(J.value,X)}}return{type:A,derived:!1,value:x.error.syntax(S[y],"term expected")}}function le(I,S,y){if(!S[y])return{type:A,derived:!1,value:x.error.syntax(S[y-1],"[ expected")};if(S[y]&&S[y].name==="l_brace"){var R=z(I,S,++y,"999",!0),J=[R.value],X=void 0;if(R.type===A)return S[y]&&S[y].name==="r_brace"?{type:p,len:y+1,value:new x.type.Term("[]",[])}:{type:A,derived:!0,value:x.error.syntax(S[y],"] expected")};for(y=R.len;S[y]&&S[y].name==="atom"&&S[y].value===",";){if(R=z(I,S,y+1,"999",!0),R.type===A)return R.derived?R:{type:A,derived:!0,value:x.error.syntax(S[y+1]?S[y+1]:S[y],"argument expected",!S[y+1])};J.push(R.value),y=R.len}var $=!1;if(S[y]&&S[y].name==="bar"){if($=!0,R=z(I,S,y+1,"999",!0),R.type===A)return R.derived?R:{type:A,derived:!0,value:x.error.syntax(S[y+1]?S[y+1]:S[y],"argument expected",!S[y+1])};X=R.value,y=R.len}return S[y]&&S[y].name==="r_brace"?{type:p,len:y+1,value:g(J,X)}:{type:A,derived:!0,value:x.error.syntax(S[y]?S[y]:S[y-1],$?"] expected":", or | or ] expected",!S[y])}}return{type:A,derived:!1,value:x.error.syntax(S[y],"list expected")}}function ce(I,S,y){var R=S[y].line,J=z(I,S,y,I.__get_max_priority(),!1),X=null,$;if(J.type!==A)if(y=J.len,S[y]&&S[y].name==="atom"&&S[y].raw===".")if(y++,x.type.is_term(J.value)){if(J.value.indicator===":-/2"?(X=new x.type.Rule(J.value.args[0],Ee(J.value.args[1])),$={value:X,len:y,type:p}):J.value.indicator==="-->/2"?(X=he(new x.type.Rule(J.value.args[0],J.value.args[1]),I),X.body=Ee(X.body),$={value:X,len:y,type:x.type.is_rule(X)?p:A}):(X=new x.type.Rule(J.value,null),$={value:X,len:y,type:p}),X){var se=X.singleton_variables();se.length>0&&I.throw_warning(x.warning.singleton(se,X.head.indicator,R))}return $}else return{type:A,value:x.error.syntax(S[y],"callable expected")};else return{type:A,value:x.error.syntax(S[y]?S[y]:S[y-1],". or operator expected")};return J}function ue(I,S,y){y=y||{},y.from=y.from?y.from:"$tau-js",y.reconsult=y.reconsult!==void 0?y.reconsult:!0;var R=new U(I),J={},X;R.new_text(S);var $=0,se=R.get_tokens($);do{if(se===null||!se[$])break;var be=ce(I,se,$);if(be.type===A)return new q("throw",[be.value]);if(be.value.body===null&&be.value.head.indicator==="?-/1"){var Fe=new tt(I.session);Fe.add_goal(be.value.head.args[0]),Fe.answer(function(Et){x.type.is_error(Et)?I.throw_warning(Et.args[0]):(Et===!1||Et===null)&&I.throw_warning(x.warning.failed_goal(be.value.head.args[0],be.len))}),$=be.len;var lt=!0}else if(be.value.body===null&&be.value.head.indicator===":-/1"){var lt=I.run_directive(be.value.head.args[0]);$=be.len,be.value.head.args[0].indicator==="char_conversion/2"&&(se=R.get_tokens($),$=0)}else{X=be.value.head.indicator,y.reconsult!==!1&&J[X]!==!0&&!I.is_multifile_predicate(X)&&(I.session.rules[X]=a(I.session.rules[X]||[],function(qt){return qt.dynamic}),J[X]=!0);var lt=I.add_rule(be.value,y);$=be.len}if(!lt)return lt}while(!0);return!0}function Ie(I,S){var y=new U(I);y.new_text(S);var R=0;do{var J=y.get_tokens(R);if(J===null)break;var X=z(I,J,0,I.__get_max_priority(),!1);if(X.type!==A){var $=X.len,se=$;if(J[$]&&J[$].name==="atom"&&J[$].raw===".")I.add_goal(Ee(X.value));else{var be=J[$];return new q("throw",[x.error.syntax(be||J[$-1],". or operator expected",!be)])}R=X.len+1}else return new q("throw",[X.value])}while(!0);return!0}function he(I,S){I=I.rename(S);var y=S.next_free_variable(),R=De(I.body,y,S);return R.error?R.value:(I.body=R.value,I.head.args=I.head.args.concat([y,R.variable]),I.head=new q(I.head.id,I.head.args),I)}function De(I,S,y){var R;if(x.type.is_term(I)&&I.indicator==="!/0")return{value:I,variable:S,error:!1};if(x.type.is_term(I)&&I.indicator===",/2"){var J=De(I.args[0],S,y);if(J.error)return J;var X=De(I.args[1],J.variable,y);return X.error?X:{value:new q(",",[J.value,X.value]),variable:X.variable,error:!1}}else{if(x.type.is_term(I)&&I.indicator==="{}/1")return{value:I.args[0],variable:S,error:!1};if(x.type.is_empty_list(I))return{value:new q("true",[]),variable:S,error:!1};if(x.type.is_list(I)){R=y.next_free_variable();for(var $=I,se;$.indicator==="./2";)se=$,$=$.args[1];return x.type.is_variable($)?{value:x.error.instantiation("DCG"),variable:S,error:!0}:x.type.is_empty_list($)?(se.args[1]=R,{value:new q("=",[S,I]),variable:R,error:!1}):{value:x.error.type("list",I,"DCG"),variable:S,error:!0}}else return x.type.is_callable(I)?(R=y.next_free_variable(),I.args=I.args.concat([S,R]),I=new q(I.id,I.args),{value:I,variable:R,error:!1}):{value:x.error.type("callable",I,"DCG"),variable:S,error:!0}}}function Ee(I){return x.type.is_variable(I)?new q("call",[I]):x.type.is_term(I)&&[",/2",";/2","->/2"].indexOf(I.indicator)!==-1?new q(I.id,[Ee(I.args[0]),Ee(I.args[1])]):I}function g(I,S){for(var y=S||new x.type.Term("[]",[]),R=I.length-1;R>=0;R--)y=new x.type.Term(".",[I[R],y]);return y}function me(I,S){for(var y=I.length-1;y>=0;y--)I[y]===S&&I.splice(y,1)}function Ce(I){for(var S={},y=[],R=0;R=0;S--)if(I.charAt(S)==="/")return new q("/",[new q(I.substring(0,S)),new Re(parseInt(I.substring(S+1)),!1)])}function Pe(I){this.id=I}function Re(I,S){this.is_float=S!==void 0?S:parseInt(I)!==I,this.value=this.is_float?I:parseInt(I)}var ht=0;function q(I,S,y){this.ref=y||++ht,this.id=I,this.args=S||[],this.indicator=I+"/"+this.args.length}var nt=0;function Le(I,S,y,R,J,X){this.id=nt++,this.stream=I,this.mode=S,this.alias=y,this.type=R!==void 0?R:"text",this.reposition=J!==void 0?J:!0,this.eof_action=X!==void 0?X:"eof_code",this.position=this.mode==="append"?"end_of_stream":0,this.output=this.mode==="write"||this.mode==="append",this.input=this.mode==="read"}function Te(I){I=I||{},this.links=I}function ke(I,S,y){S=S||new Te,y=y||null,this.goal=I,this.substitution=S,this.parent=y}function Ve(I,S,y){this.head=I,this.body=S,this.dynamic=y||!1}function xe(I){I=I===void 0||I<=0?1e3:I,this.rules={},this.src_predicates={},this.rename=0,this.modules=[],this.thread=new tt(this),this.total_threads=1,this.renamed_variables={},this.public_predicates={},this.multifile_predicates={},this.limit=I,this.streams={user_input:new Le(typeof El<"u"&&El.exports?nodejs_user_input:tau_user_input,"read","user_input","text",!1,"reset"),user_output:new Le(typeof El<"u"&&El.exports?nodejs_user_output:tau_user_output,"write","user_output","text",!1,"eof_code")},this.file_system=typeof El<"u"&&El.exports?nodejs_file_system:tau_file_system,this.standard_input=this.streams.user_input,this.standard_output=this.streams.user_output,this.current_input=this.streams.user_input,this.current_output=this.streams.user_output,this.format_success=function(S){return S.substitution},this.format_error=function(S){return S.goal},this.flag={bounded:x.flag.bounded.value,max_integer:x.flag.max_integer.value,min_integer:x.flag.min_integer.value,integer_rounding_function:x.flag.integer_rounding_function.value,char_conversion:x.flag.char_conversion.value,debug:x.flag.debug.value,max_arity:x.flag.max_arity.value,unknown:x.flag.unknown.value,double_quotes:x.flag.double_quotes.value,occurs_check:x.flag.occurs_check.value,dialect:x.flag.dialect.value,version_data:x.flag.version_data.value,nodejs:x.flag.nodejs.value},this.__loaded_modules=[],this.__char_conversion={},this.__operators={1200:{":-":["fx","xfx"],"-->":["xfx"],"?-":["fx"]},1100:{";":["xfy"]},1050:{"->":["xfy"]},1e3:{",":["xfy"]},900:{"\\+":["fy"]},700:{"=":["xfx"],"\\=":["xfx"],"==":["xfx"],"\\==":["xfx"],"@<":["xfx"],"@=<":["xfx"],"@>":["xfx"],"@>=":["xfx"],"=..":["xfx"],is:["xfx"],"=:=":["xfx"],"=\\=":["xfx"],"<":["xfx"],"=<":["xfx"],">":["xfx"],">=":["xfx"]},600:{":":["xfy"]},500:{"+":["yfx"],"-":["yfx"],"/\\":["yfx"],"\\/":["yfx"]},400:{"*":["yfx"],"/":["yfx"],"//":["yfx"],rem:["yfx"],mod:["yfx"],"<<":["yfx"],">>":["yfx"]},200:{"**":["xfx"],"^":["xfy"],"-":["fy"],"+":["fy"],"\\":["fy"]}}}function tt(I){this.epoch=Date.now(),this.session=I,this.session.total_threads++,this.total_steps=0,this.cpu_time=0,this.cpu_time_last=0,this.points=[],this.debugger=!1,this.debugger_states=[],this.level="top_level/0",this.__calls=[],this.current_limit=this.session.limit,this.warnings=[]}function He(I,S,y){this.id=I,this.rules=S,this.exports=y,x.module[I]=this}He.prototype.exports_predicate=function(I){return this.exports.indexOf(I)!==-1},Pe.prototype.unify=function(I,S){if(S&&e(I.variables(),this.id)!==-1&&!x.type.is_variable(I))return null;var y={};return y[this.id]=I,new Te(y)},Re.prototype.unify=function(I,S){return x.type.is_number(I)&&this.value===I.value&&this.is_float===I.is_float?new Te:null},q.prototype.unify=function(I,S){if(x.type.is_term(I)&&this.indicator===I.indicator){for(var y=new Te,R=0;R=0){var R=this.args[0].value,J=Math.floor(R/26),X=R%26;return"ABCDEFGHIJKLMNOPQRSTUVWXYZ"[X]+(J!==0?J:"")}switch(this.indicator){case"[]/0":case"{}/0":case"!/0":return this.id;case"{}/1":return"{"+this.args[0].toString(I)+"}";case"./2":for(var $="["+this.args[0].toString(I),se=this.args[1];se.indicator==="./2";)$+=", "+se.args[0].toString(I),se=se.args[1];return se.indicator!=="[]/0"&&($+="|"+se.toString(I)),$+="]",$;case",/2":return"("+this.args[0].toString(I)+", "+this.args[1].toString(I)+")";default:var be=this.id,Fe=I.session?I.session.lookup_operator(this.id,this.args.length):null;if(I.session===void 0||I.ignore_ops||Fe===null)return I.quoted&&!/^(!|,|;|[a-z][0-9a-zA-Z_]*)$/.test(be)&&be!=="{}"&&be!=="[]"&&(be="'"+b(be)+"'"),be+(this.args.length?"("+o(this.args,function(nr){return nr.toString(I)}).join(", ")+")":"");var lt=Fe.priority>S.priority||Fe.priority===S.priority&&(Fe.class==="xfy"&&this.indicator!==S.indicator||Fe.class==="yfx"&&this.indicator!==S.indicator||this.indicator===S.indicator&&Fe.class==="yfx"&&y==="right"||this.indicator===S.indicator&&Fe.class==="xfy"&&y==="left");Fe.indicator=this.indicator;var Et=lt?"(":"",qt=lt?")":"";return this.args.length===0?"("+this.id+")":["fy","fx"].indexOf(Fe.class)!==-1?Et+be+" "+this.args[0].toString(I,Fe)+qt:["yf","xf"].indexOf(Fe.class)!==-1?Et+this.args[0].toString(I,Fe)+" "+be+qt:Et+this.args[0].toString(I,Fe,"left")+" "+this.id+" "+this.args[1].toString(I,Fe,"right")+qt}},Le.prototype.toString=function(I){return"("+this.id+")"},Te.prototype.toString=function(I){var S="{";for(var y in this.links)this.links.hasOwnProperty(y)&&(S!=="{"&&(S+=", "),S+=y+"/"+this.links[y].toString(I));return S+="}",S},ke.prototype.toString=function(I){return this.goal===null?"<"+this.substitution.toString(I)+">":"<"+this.goal.toString(I)+", "+this.substitution.toString(I)+">"},Ve.prototype.toString=function(I){return this.body?this.head.toString(I)+" :- "+this.body.toString(I)+".":this.head.toString(I)+"."},xe.prototype.toString=function(I){for(var S="",y=0;y=0;J--)R=new q(".",[S[J],R]);return R}return new q(this.id,o(this.args,function(X){return X.apply(I)}),this.ref)},Le.prototype.apply=function(I){return this},Ve.prototype.apply=function(I){return new Ve(this.head.apply(I),this.body!==null?this.body.apply(I):null)},Te.prototype.apply=function(I){var S,y={};for(S in this.links)this.links.hasOwnProperty(S)&&(y[S]=this.links[S].apply(I));return new Te(y)},q.prototype.select=function(){for(var I=this;I.indicator===",/2";)I=I.args[0];return I},q.prototype.replace=function(I){return this.indicator===",/2"?this.args[0].indicator===",/2"?new q(",",[this.args[0].replace(I),this.args[1]]):I===null?this.args[1]:new q(",",[I,this.args[1]]):I},q.prototype.search=function(I){if(x.type.is_term(I)&&I.ref!==void 0&&this.ref===I.ref)return!0;for(var S=0;SS&&R0&&(S=this.head_point().substitution.domain());e(S,x.format_variable(this.session.rename))!==-1;)this.session.rename++;if(I.id==="_")return new Pe(x.format_variable(this.session.rename));this.session.renamed_variables[I.id]=x.format_variable(this.session.rename)}return new Pe(this.session.renamed_variables[I.id])},xe.prototype.next_free_variable=function(){return this.thread.next_free_variable()},tt.prototype.next_free_variable=function(){this.session.rename++;var I=[];for(this.points.length>0&&(I=this.head_point().substitution.domain());e(I,x.format_variable(this.session.rename))!==-1;)this.session.rename++;return new Pe(x.format_variable(this.session.rename))},xe.prototype.is_public_predicate=function(I){return!this.public_predicates.hasOwnProperty(I)||this.public_predicates[I]===!0},tt.prototype.is_public_predicate=function(I){return this.session.is_public_predicate(I)},xe.prototype.is_multifile_predicate=function(I){return this.multifile_predicates.hasOwnProperty(I)&&this.multifile_predicates[I]===!0},tt.prototype.is_multifile_predicate=function(I){return this.session.is_multifile_predicate(I)},xe.prototype.prepend=function(I){return this.thread.prepend(I)},tt.prototype.prepend=function(I){for(var S=I.length-1;S>=0;S--)this.points.push(I[S])},xe.prototype.success=function(I,S){return this.thread.success(I,S)},tt.prototype.success=function(I,y){var y=typeof y>"u"?I:y;this.prepend([new ke(I.goal.replace(null),I.substitution,y)])},xe.prototype.throw_error=function(I){return this.thread.throw_error(I)},tt.prototype.throw_error=function(I){this.prepend([new ke(new q("throw",[I]),new Te,null,null)])},xe.prototype.step_rule=function(I,S){return this.thread.step_rule(I,S)},tt.prototype.step_rule=function(I,S){var y=S.indicator;if(I==="user"&&(I=null),I===null&&this.session.rules.hasOwnProperty(y))return this.session.rules[y];for(var R=I===null?this.session.modules:e(this.session.modules,I)===-1?[]:[I],J=0;J1)&&this.again()},xe.prototype.answers=function(I,S,y){return this.thread.answers(I,S,y)},tt.prototype.answers=function(I,S,y){var R=S||1e3,J=this;if(S<=0){y&&y();return}this.answer(function(X){I(X),X!==!1?setTimeout(function(){J.answers(I,S-1,y)},1):y&&y()})},xe.prototype.again=function(I){return this.thread.again(I)},tt.prototype.again=function(I){for(var S,y=Date.now();this.__calls.length>0;){for(this.warnings=[],I!==!1&&(this.current_limit=this.session.limit);this.current_limit>0&&this.points.length>0&&this.head_point().goal!==null&&!x.type.is_error(this.head_point().goal);)if(this.current_limit--,this.step()===!0)return;var R=Date.now();this.cpu_time_last=R-y,this.cpu_time+=this.cpu_time_last;var J=this.__calls.shift();this.current_limit<=0?J(null):this.points.length===0?J(!1):x.type.is_error(this.head_point().goal)?(S=this.session.format_error(this.points.pop()),this.points=[],J(S)):(this.debugger&&this.debugger_states.push(this.head_point()),S=this.session.format_success(this.points.pop()),J(S))}},xe.prototype.unfold=function(I){if(I.body===null)return!1;var S=I.head,y=I.body,R=y.select(),J=new tt(this),X=[];J.add_goal(R),J.step();for(var $=J.points.length-1;$>=0;$--){var se=J.points[$],be=S.apply(se.substitution),Fe=y.replace(se.goal);Fe!==null&&(Fe=Fe.apply(se.substitution)),X.push(new Ve(be,Fe))}var lt=this.rules[S.indicator],Et=e(lt,I);return X.length>0&&Et!==-1?(lt.splice.apply(lt,[Et,1].concat(X)),!0):!1},tt.prototype.unfold=function(I){return this.session.unfold(I)},Pe.prototype.interpret=function(I){return x.error.instantiation(I.level)},Re.prototype.interpret=function(I){return this},q.prototype.interpret=function(I){return x.type.is_unitary_list(this)?this.args[0].interpret(I):x.operate(I,this)},Pe.prototype.compare=function(I){return this.idI.id?1:0},Re.prototype.compare=function(I){if(this.value===I.value&&this.is_float===I.is_float)return 0;if(this.valueI.value)return 1},q.prototype.compare=function(I){if(this.args.lengthI.args.length||this.args.length===I.args.length&&this.id>I.id)return 1;for(var S=0;SR)return 1;if(I.constructor===Re){if(I.is_float&&S.is_float)return 0;if(I.is_float)return-1;if(S.is_float)return 1}return 0},is_substitution:function(I){return I instanceof Te},is_state:function(I){return I instanceof ke},is_rule:function(I){return I instanceof Ve},is_variable:function(I){return I instanceof Pe},is_stream:function(I){return I instanceof Le},is_anonymous_var:function(I){return I instanceof Pe&&I.id==="_"},is_callable:function(I){return I instanceof q},is_number:function(I){return I instanceof Re},is_integer:function(I){return I instanceof Re&&!I.is_float},is_float:function(I){return I instanceof Re&&I.is_float},is_term:function(I){return I instanceof q},is_atom:function(I){return I instanceof q&&I.args.length===0},is_ground:function(I){if(I instanceof Pe)return!1;if(I instanceof q){for(var S=0;S0},is_list:function(I){return I instanceof q&&(I.indicator==="[]/0"||I.indicator==="./2")},is_empty_list:function(I){return I instanceof q&&I.indicator==="[]/0"},is_non_empty_list:function(I){return I instanceof q&&I.indicator==="./2"},is_fully_list:function(I){for(;I instanceof q&&I.indicator==="./2";)I=I.args[1];return I instanceof Pe||I instanceof q&&I.indicator==="[]/0"},is_instantiated_list:function(I){for(;I instanceof q&&I.indicator==="./2";)I=I.args[1];return I instanceof q&&I.indicator==="[]/0"},is_unitary_list:function(I){return I instanceof q&&I.indicator==="./2"&&I.args[1]instanceof q&&I.args[1].indicator==="[]/0"},is_character:function(I){return I instanceof q&&(I.id.length===1||I.id.length>0&&I.id.length<=2&&n(I.id,0)>=65536)},is_character_code:function(I){return I instanceof Re&&!I.is_float&&I.value>=0&&I.value<=1114111},is_byte:function(I){return I instanceof Re&&!I.is_float&&I.value>=0&&I.value<=255},is_operator:function(I){return I instanceof q&&x.arithmetic.evaluation[I.indicator]},is_directive:function(I){return I instanceof q&&x.directive[I.indicator]!==void 0},is_builtin:function(I){return I instanceof q&&x.predicate[I.indicator]!==void 0},is_error:function(I){return I instanceof q&&I.indicator==="throw/1"},is_predicate_indicator:function(I){return I instanceof q&&I.indicator==="//2"&&I.args[0]instanceof q&&I.args[0].args.length===0&&I.args[1]instanceof Re&&I.args[1].is_float===!1},is_flag:function(I){return I instanceof q&&I.args.length===0&&x.flag[I.id]!==void 0},is_value_flag:function(I,S){if(!x.type.is_flag(I))return!1;for(var y in x.flag[I.id].allowed)if(x.flag[I.id].allowed.hasOwnProperty(y)&&x.flag[I.id].allowed[y].equals(S))return!0;return!1},is_io_mode:function(I){return x.type.is_atom(I)&&["read","write","append"].indexOf(I.id)!==-1},is_stream_option:function(I){return x.type.is_term(I)&&(I.indicator==="alias/1"&&x.type.is_atom(I.args[0])||I.indicator==="reposition/1"&&x.type.is_atom(I.args[0])&&(I.args[0].id==="true"||I.args[0].id==="false")||I.indicator==="type/1"&&x.type.is_atom(I.args[0])&&(I.args[0].id==="text"||I.args[0].id==="binary")||I.indicator==="eof_action/1"&&x.type.is_atom(I.args[0])&&(I.args[0].id==="error"||I.args[0].id==="eof_code"||I.args[0].id==="reset"))},is_stream_position:function(I){return x.type.is_integer(I)&&I.value>=0||x.type.is_atom(I)&&(I.id==="end_of_stream"||I.id==="past_end_of_stream")},is_stream_property:function(I){return x.type.is_term(I)&&(I.indicator==="input/0"||I.indicator==="output/0"||I.indicator==="alias/1"&&(x.type.is_variable(I.args[0])||x.type.is_atom(I.args[0]))||I.indicator==="file_name/1"&&(x.type.is_variable(I.args[0])||x.type.is_atom(I.args[0]))||I.indicator==="position/1"&&(x.type.is_variable(I.args[0])||x.type.is_stream_position(I.args[0]))||I.indicator==="reposition/1"&&(x.type.is_variable(I.args[0])||x.type.is_atom(I.args[0])&&(I.args[0].id==="true"||I.args[0].id==="false"))||I.indicator==="type/1"&&(x.type.is_variable(I.args[0])||x.type.is_atom(I.args[0])&&(I.args[0].id==="text"||I.args[0].id==="binary"))||I.indicator==="mode/1"&&(x.type.is_variable(I.args[0])||x.type.is_atom(I.args[0])&&(I.args[0].id==="read"||I.args[0].id==="write"||I.args[0].id==="append"))||I.indicator==="eof_action/1"&&(x.type.is_variable(I.args[0])||x.type.is_atom(I.args[0])&&(I.args[0].id==="error"||I.args[0].id==="eof_code"||I.args[0].id==="reset"))||I.indicator==="end_of_stream/1"&&(x.type.is_variable(I.args[0])||x.type.is_atom(I.args[0])&&(I.args[0].id==="at"||I.args[0].id==="past"||I.args[0].id==="not")))},is_streamable:function(I){return I.__proto__.stream!==void 0},is_read_option:function(I){return x.type.is_term(I)&&["variables/1","variable_names/1","singletons/1"].indexOf(I.indicator)!==-1},is_write_option:function(I){return x.type.is_term(I)&&(I.indicator==="quoted/1"&&x.type.is_atom(I.args[0])&&(I.args[0].id==="true"||I.args[0].id==="false")||I.indicator==="ignore_ops/1"&&x.type.is_atom(I.args[0])&&(I.args[0].id==="true"||I.args[0].id==="false")||I.indicator==="numbervars/1"&&x.type.is_atom(I.args[0])&&(I.args[0].id==="true"||I.args[0].id==="false"))},is_close_option:function(I){return x.type.is_term(I)&&I.indicator==="force/1"&&x.type.is_atom(I.args[0])&&(I.args[0].id==="true"||I.args[0].id==="false")},is_modifiable_flag:function(I){return x.type.is_flag(I)&&x.flag[I.id].changeable},is_module:function(I){return I instanceof q&&I.indicator==="library/1"&&I.args[0]instanceof q&&I.args[0].args.length===0&&x.module[I.args[0].id]!==void 0}},arithmetic:{evaluation:{"e/0":{type_args:null,type_result:!0,fn:function(I){return Math.E}},"pi/0":{type_args:null,type_result:!0,fn:function(I){return Math.PI}},"tau/0":{type_args:null,type_result:!0,fn:function(I){return 2*Math.PI}},"epsilon/0":{type_args:null,type_result:!0,fn:function(I){return Number.EPSILON}},"+/1":{type_args:null,type_result:null,fn:function(I,S){return I}},"-/1":{type_args:null,type_result:null,fn:function(I,S){return-I}},"\\/1":{type_args:!1,type_result:!1,fn:function(I,S){return~I}},"abs/1":{type_args:null,type_result:null,fn:function(I,S){return Math.abs(I)}},"sign/1":{type_args:null,type_result:null,fn:function(I,S){return Math.sign(I)}},"float_integer_part/1":{type_args:!0,type_result:!1,fn:function(I,S){return parseInt(I)}},"float_fractional_part/1":{type_args:!0,type_result:!0,fn:function(I,S){return I-parseInt(I)}},"float/1":{type_args:null,type_result:!0,fn:function(I,S){return parseFloat(I)}},"floor/1":{type_args:!0,type_result:!1,fn:function(I,S){return Math.floor(I)}},"truncate/1":{type_args:!0,type_result:!1,fn:function(I,S){return parseInt(I)}},"round/1":{type_args:!0,type_result:!1,fn:function(I,S){return Math.round(I)}},"ceiling/1":{type_args:!0,type_result:!1,fn:function(I,S){return Math.ceil(I)}},"sin/1":{type_args:null,type_result:!0,fn:function(I,S){return Math.sin(I)}},"cos/1":{type_args:null,type_result:!0,fn:function(I,S){return Math.cos(I)}},"tan/1":{type_args:null,type_result:!0,fn:function(I,S){return Math.tan(I)}},"asin/1":{type_args:null,type_result:!0,fn:function(I,S){return Math.asin(I)}},"acos/1":{type_args:null,type_result:!0,fn:function(I,S){return Math.acos(I)}},"atan/1":{type_args:null,type_result:!0,fn:function(I,S){return Math.atan(I)}},"atan2/2":{type_args:null,type_result:!0,fn:function(I,S,y){return Math.atan2(I,S)}},"exp/1":{type_args:null,type_result:!0,fn:function(I,S){return Math.exp(I)}},"sqrt/1":{type_args:null,type_result:!0,fn:function(I,S){return Math.sqrt(I)}},"log/1":{type_args:null,type_result:!0,fn:function(I,S){return I>0?Math.log(I):x.error.evaluation("undefined",S.__call_indicator)}},"+/2":{type_args:null,type_result:null,fn:function(I,S,y){return I+S}},"-/2":{type_args:null,type_result:null,fn:function(I,S,y){return I-S}},"*/2":{type_args:null,type_result:null,fn:function(I,S,y){return I*S}},"//2":{type_args:null,type_result:!0,fn:function(I,S,y){return S?I/S:x.error.evaluation("zero_division",y.__call_indicator)}},"///2":{type_args:!1,type_result:!1,fn:function(I,S,y){return S?parseInt(I/S):x.error.evaluation("zero_division",y.__call_indicator)}},"**/2":{type_args:null,type_result:!0,fn:function(I,S,y){return Math.pow(I,S)}},"^/2":{type_args:null,type_result:null,fn:function(I,S,y){return Math.pow(I,S)}},"<>/2":{type_args:!1,type_result:!1,fn:function(I,S,y){return I>>S}},"/\\/2":{type_args:!1,type_result:!1,fn:function(I,S,y){return I&S}},"\\//2":{type_args:!1,type_result:!1,fn:function(I,S,y){return I|S}},"xor/2":{type_args:!1,type_result:!1,fn:function(I,S,y){return I^S}},"rem/2":{type_args:!1,type_result:!1,fn:function(I,S,y){return S?I%S:x.error.evaluation("zero_division",y.__call_indicator)}},"mod/2":{type_args:!1,type_result:!1,fn:function(I,S,y){return S?I-parseInt(I/S)*S:x.error.evaluation("zero_division",y.__call_indicator)}},"max/2":{type_args:null,type_result:null,fn:function(I,S,y){return Math.max(I,S)}},"min/2":{type_args:null,type_result:null,fn:function(I,S,y){return Math.min(I,S)}}}},directive:{"dynamic/1":function(I,S){var y=S.args[0];if(x.type.is_variable(y))I.throw_error(x.error.instantiation(S.indicator));else if(!x.type.is_compound(y)||y.indicator!=="//2")I.throw_error(x.error.type("predicate_indicator",y,S.indicator));else if(x.type.is_variable(y.args[0])||x.type.is_variable(y.args[1]))I.throw_error(x.error.instantiation(S.indicator));else if(!x.type.is_atom(y.args[0]))I.throw_error(x.error.type("atom",y.args[0],S.indicator));else if(!x.type.is_integer(y.args[1]))I.throw_error(x.error.type("integer",y.args[1],S.indicator));else{var R=S.args[0].args[0].id+"/"+S.args[0].args[1].value;I.session.public_predicates[R]=!0,I.session.rules[R]||(I.session.rules[R]=[])}},"multifile/1":function(I,S){var y=S.args[0];x.type.is_variable(y)?I.throw_error(x.error.instantiation(S.indicator)):!x.type.is_compound(y)||y.indicator!=="//2"?I.throw_error(x.error.type("predicate_indicator",y,S.indicator)):x.type.is_variable(y.args[0])||x.type.is_variable(y.args[1])?I.throw_error(x.error.instantiation(S.indicator)):x.type.is_atom(y.args[0])?x.type.is_integer(y.args[1])?I.session.multifile_predicates[S.args[0].args[0].id+"/"+S.args[0].args[1].value]=!0:I.throw_error(x.error.type("integer",y.args[1],S.indicator)):I.throw_error(x.error.type("atom",y.args[0],S.indicator))},"set_prolog_flag/2":function(I,S){var y=S.args[0],R=S.args[1];x.type.is_variable(y)||x.type.is_variable(R)?I.throw_error(x.error.instantiation(S.indicator)):x.type.is_atom(y)?x.type.is_flag(y)?x.type.is_value_flag(y,R)?x.type.is_modifiable_flag(y)?I.session.flag[y.id]=R:I.throw_error(x.error.permission("modify","flag",y)):I.throw_error(x.error.domain("flag_value",new q("+",[y,R]),S.indicator)):I.throw_error(x.error.domain("prolog_flag",y,S.indicator)):I.throw_error(x.error.type("atom",y,S.indicator))},"use_module/1":function(I,S){var y=S.args[0];if(x.type.is_variable(y))I.throw_error(x.error.instantiation(S.indicator));else if(!x.type.is_term(y))I.throw_error(x.error.type("term",y,S.indicator));else if(x.type.is_module(y)){var R=y.args[0].id;e(I.session.modules,R)===-1&&I.session.modules.push(R)}},"char_conversion/2":function(I,S){var y=S.args[0],R=S.args[1];x.type.is_variable(y)||x.type.is_variable(R)?I.throw_error(x.error.instantiation(S.indicator)):x.type.is_character(y)?x.type.is_character(R)?y.id===R.id?delete I.session.__char_conversion[y.id]:I.session.__char_conversion[y.id]=R.id:I.throw_error(x.error.type("character",R,S.indicator)):I.throw_error(x.error.type("character",y,S.indicator))},"op/3":function(I,S){var y=S.args[0],R=S.args[1],J=S.args[2];if(x.type.is_variable(y)||x.type.is_variable(R)||x.type.is_variable(J))I.throw_error(x.error.instantiation(S.indicator));else if(!x.type.is_integer(y))I.throw_error(x.error.type("integer",y,S.indicator));else if(!x.type.is_atom(R))I.throw_error(x.error.type("atom",R,S.indicator));else if(!x.type.is_atom(J))I.throw_error(x.error.type("atom",J,S.indicator));else if(y.value<0||y.value>1200)I.throw_error(x.error.domain("operator_priority",y,S.indicator));else if(J.id===",")I.throw_error(x.error.permission("modify","operator",J,S.indicator));else if(J.id==="|"&&(y.value<1001||R.id.length!==3))I.throw_error(x.error.permission("modify","operator",J,S.indicator));else if(["fy","fx","yf","xf","xfx","yfx","xfy"].indexOf(R.id)===-1)I.throw_error(x.error.domain("operator_specifier",R,S.indicator));else{var X={prefix:null,infix:null,postfix:null};for(var $ in I.session.__operators)if(I.session.__operators.hasOwnProperty($)){var se=I.session.__operators[$][J.id];se&&(e(se,"fx")!==-1&&(X.prefix={priority:$,type:"fx"}),e(se,"fy")!==-1&&(X.prefix={priority:$,type:"fy"}),e(se,"xf")!==-1&&(X.postfix={priority:$,type:"xf"}),e(se,"yf")!==-1&&(X.postfix={priority:$,type:"yf"}),e(se,"xfx")!==-1&&(X.infix={priority:$,type:"xfx"}),e(se,"xfy")!==-1&&(X.infix={priority:$,type:"xfy"}),e(se,"yfx")!==-1&&(X.infix={priority:$,type:"yfx"}))}var be;switch(R.id){case"fy":case"fx":be="prefix";break;case"yf":case"xf":be="postfix";break;default:be="infix";break}if(((X.prefix&&be==="prefix"||X.postfix&&be==="postfix"||X.infix&&be==="infix")&&X[be].type!==R.id||X.infix&&be==="postfix"||X.postfix&&be==="infix")&&y.value!==0)I.throw_error(x.error.permission("create","operator",J,S.indicator));else return X[be]&&(me(I.session.__operators[X[be].priority][J.id],R.id),I.session.__operators[X[be].priority][J.id].length===0&&delete I.session.__operators[X[be].priority][J.id]),y.value>0&&(I.session.__operators[y.value]||(I.session.__operators[y.value.toString()]={}),I.session.__operators[y.value][J.id]||(I.session.__operators[y.value][J.id]=[]),I.session.__operators[y.value][J.id].push(R.id)),!0}}},predicate:{"op/3":function(I,S,y){x.directive["op/3"](I,y)&&I.success(S)},"current_op/3":function(I,S,y){var R=y.args[0],J=y.args[1],X=y.args[2],$=[];for(var se in I.session.__operators)for(var be in I.session.__operators[se])for(var Fe=0;Fe/2"){var R=I.points,J=I.session.format_success,X=I.session.format_error;I.session.format_success=function(Fe){return Fe.substitution},I.session.format_error=function(Fe){return Fe.goal},I.points=[new ke(y.args[0].args[0],S.substitution,S)];var $=function(Fe){I.points=R,I.session.format_success=J,I.session.format_error=X,Fe===!1?I.prepend([new ke(S.goal.replace(y.args[1]),S.substitution,S)]):x.type.is_error(Fe)?I.throw_error(Fe.args[0]):Fe===null?(I.prepend([S]),I.__calls.shift()(null)):I.prepend([new ke(S.goal.replace(y.args[0].args[1]).apply(Fe),S.substitution.apply(Fe),S)])};I.__calls.unshift($)}else{var se=new ke(S.goal.replace(y.args[0]),S.substitution,S),be=new ke(S.goal.replace(y.args[1]),S.substitution,S);I.prepend([se,be])}},"!/0":function(I,S,y){var R,J,X=[];for(R=S,J=null;R.parent!==null&&R.parent.goal.search(y);)if(J=R,R=R.parent,R.goal!==null){var $=R.goal.select();if($&&$.id==="call"&&$.search(y)){R=J;break}}for(var se=I.points.length-1;se>=0;se--){for(var be=I.points[se],Fe=be.parent;Fe!==null&&Fe!==R.parent;)Fe=Fe.parent;Fe===null&&Fe!==R.parent&&X.push(be)}I.points=X.reverse(),I.success(S)},"\\+/1":function(I,S,y){var R=y.args[0];x.type.is_variable(R)?I.throw_error(x.error.instantiation(I.level)):x.type.is_callable(R)?I.prepend([new ke(S.goal.replace(new q(",",[new q(",",[new q("call",[R]),new q("!",[])]),new q("fail",[])])),S.substitution,S),new ke(S.goal.replace(null),S.substitution,S)]):I.throw_error(x.error.type("callable",R,I.level))},"->/2":function(I,S,y){var R=S.goal.replace(new q(",",[y.args[0],new q(",",[new q("!"),y.args[1]])]));I.prepend([new ke(R,S.substitution,S)])},"fail/0":function(I,S,y){},"false/0":function(I,S,y){},"true/0":function(I,S,y){I.success(S)},"call/1":ie(1),"call/2":ie(2),"call/3":ie(3),"call/4":ie(4),"call/5":ie(5),"call/6":ie(6),"call/7":ie(7),"call/8":ie(8),"once/1":function(I,S,y){var R=y.args[0];I.prepend([new ke(S.goal.replace(new q(",",[new q("call",[R]),new q("!",[])])),S.substitution,S)])},"forall/2":function(I,S,y){var R=y.args[0],J=y.args[1];I.prepend([new ke(S.goal.replace(new q("\\+",[new q(",",[new q("call",[R]),new q("\\+",[new q("call",[J])])])])),S.substitution,S)])},"repeat/0":function(I,S,y){I.prepend([new ke(S.goal.replace(null),S.substitution,S),S])},"throw/1":function(I,S,y){x.type.is_variable(y.args[0])?I.throw_error(x.error.instantiation(I.level)):I.throw_error(y.args[0])},"catch/3":function(I,S,y){var R=I.points;I.points=[],I.prepend([new ke(y.args[0],S.substitution,S)]);var J=I.session.format_success,X=I.session.format_error;I.session.format_success=function(se){return se.substitution},I.session.format_error=function(se){return se.goal};var $=function(se){var be=I.points;if(I.points=R,I.session.format_success=J,I.session.format_error=X,x.type.is_error(se)){for(var Fe=[],lt=I.points.length-1;lt>=0;lt--){for(var nr=I.points[lt],Et=nr.parent;Et!==null&&Et!==S.parent;)Et=Et.parent;Et===null&&Et!==S.parent&&Fe.push(nr)}I.points=Fe;var qt=I.get_flag("occurs_check").indicator==="true/0",nr=new ke,St=x.unify(se.args[0],y.args[1],qt);St!==null?(nr.substitution=S.substitution.apply(St),nr.goal=S.goal.replace(y.args[2]).apply(St),nr.parent=S,I.prepend([nr])):I.throw_error(se.args[0])}else if(se!==!1){for(var cn=se===null?[]:[new ke(S.goal.apply(se).replace(null),S.substitution.apply(se),S)],Pr=[],lt=be.length-1;lt>=0;lt--){Pr.push(be[lt]);var yr=be[lt].goal!==null?be[lt].goal.select():null;if(x.type.is_term(yr)&&yr.indicator==="!/0")break}var Rr=o(Pr,function(Xr){return Xr.goal===null&&(Xr.goal=new q("true",[])),Xr=new ke(S.goal.replace(new q("catch",[Xr.goal,y.args[1],y.args[2]])),S.substitution.apply(Xr.substitution),Xr.parent),Xr.exclude=y.args[0].variables(),Xr}).reverse();I.prepend(Rr),I.prepend(cn),se===null&&(this.current_limit=0,I.__calls.shift()(null))}};I.__calls.unshift($)},"=/2":function(I,S,y){var R=I.get_flag("occurs_check").indicator==="true/0",J=new ke,X=x.unify(y.args[0],y.args[1],R);X!==null&&(J.goal=S.goal.apply(X).replace(null),J.substitution=S.substitution.apply(X),J.parent=S,I.prepend([J]))},"unify_with_occurs_check/2":function(I,S,y){var R=new ke,J=x.unify(y.args[0],y.args[1],!0);J!==null&&(R.goal=S.goal.apply(J).replace(null),R.substitution=S.substitution.apply(J),R.parent=S,I.prepend([R]))},"\\=/2":function(I,S,y){var R=I.get_flag("occurs_check").indicator==="true/0",J=x.unify(y.args[0],y.args[1],R);J===null&&I.success(S)},"subsumes_term/2":function(I,S,y){var R=I.get_flag("occurs_check").indicator==="true/0",J=x.unify(y.args[1],y.args[0],R);J!==null&&y.args[1].apply(J).equals(y.args[1])&&I.success(S)},"findall/3":function(I,S,y){var R=y.args[0],J=y.args[1],X=y.args[2];if(x.type.is_variable(J))I.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_callable(J))I.throw_error(x.error.type("callable",J,y.indicator));else if(!x.type.is_variable(X)&&!x.type.is_list(X))I.throw_error(x.error.type("list",X,y.indicator));else{var $=I.next_free_variable(),se=new q(",",[J,new q("=",[$,R])]),be=I.points,Fe=I.session.limit,lt=I.session.format_success;I.session.format_success=function(nr){return nr.substitution},I.add_goal(se,!0,S);var Et=[],qt=function(nr){if(nr!==!1&&nr!==null&&!x.type.is_error(nr))I.__calls.unshift(qt),Et.push(nr.links[$.id]),I.session.limit=I.current_limit;else if(I.points=be,I.session.limit=Fe,I.session.format_success=lt,x.type.is_error(nr))I.throw_error(nr.args[0]);else if(I.current_limit>0){for(var St=new q("[]"),cn=Et.length-1;cn>=0;cn--)St=new q(".",[Et[cn],St]);I.prepend([new ke(S.goal.replace(new q("=",[X,St])),S.substitution,S)])}};I.__calls.unshift(qt)}},"bagof/3":function(I,S,y){var R,J=y.args[0],X=y.args[1],$=y.args[2];if(x.type.is_variable(X))I.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_callable(X))I.throw_error(x.error.type("callable",X,y.indicator));else if(!x.type.is_variable($)&&!x.type.is_list($))I.throw_error(x.error.type("list",$,y.indicator));else{var se=I.next_free_variable(),be;X.indicator==="^/2"?(be=X.args[0].variables(),X=X.args[1]):be=[],be=be.concat(J.variables());for(var Fe=X.variables().filter(function(Rr){return e(be,Rr)===-1}),lt=new q("[]"),Et=Fe.length-1;Et>=0;Et--)lt=new q(".",[new Pe(Fe[Et]),lt]);var qt=new q(",",[X,new q("=",[se,new q(",",[lt,J])])]),nr=I.points,St=I.session.limit,cn=I.session.format_success;I.session.format_success=function(Rr){return Rr.substitution},I.add_goal(qt,!0,S);var Pr=[],yr=function(Rr){if(Rr!==!1&&Rr!==null&&!x.type.is_error(Rr)){I.__calls.unshift(yr);var Xr=!1,$n=Rr.links[se.id].args[0],Xs=Rr.links[se.id].args[1];for(var Hi in Pr)if(Pr.hasOwnProperty(Hi)){var Qs=Pr[Hi];if(Qs.variables.equals($n)){Qs.answers.push(Xs),Xr=!0;break}}Xr||Pr.push({variables:$n,answers:[Xs]}),I.session.limit=I.current_limit}else if(I.points=nr,I.session.limit=St,I.session.format_success=cn,x.type.is_error(Rr))I.throw_error(Rr.args[0]);else if(I.current_limit>0){for(var Zs=[],bi=0;bi=0;$s--)Fs=new q(".",[Rr[$s],Fs]);Zs.push(new ke(S.goal.replace(new q(",",[new q("=",[lt,Pr[bi].variables]),new q("=",[$,Fs])])),S.substitution,S))}I.prepend(Zs)}};I.__calls.unshift(yr)}},"setof/3":function(I,S,y){var R,J=y.args[0],X=y.args[1],$=y.args[2];if(x.type.is_variable(X))I.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_callable(X))I.throw_error(x.error.type("callable",X,y.indicator));else if(!x.type.is_variable($)&&!x.type.is_list($))I.throw_error(x.error.type("list",$,y.indicator));else{var se=I.next_free_variable(),be;X.indicator==="^/2"?(be=X.args[0].variables(),X=X.args[1]):be=[],be=be.concat(J.variables());for(var Fe=X.variables().filter(function(Rr){return e(be,Rr)===-1}),lt=new q("[]"),Et=Fe.length-1;Et>=0;Et--)lt=new q(".",[new Pe(Fe[Et]),lt]);var qt=new q(",",[X,new q("=",[se,new q(",",[lt,J])])]),nr=I.points,St=I.session.limit,cn=I.session.format_success;I.session.format_success=function(Rr){return Rr.substitution},I.add_goal(qt,!0,S);var Pr=[],yr=function(Rr){if(Rr!==!1&&Rr!==null&&!x.type.is_error(Rr)){I.__calls.unshift(yr);var Xr=!1,$n=Rr.links[se.id].args[0],Xs=Rr.links[se.id].args[1];for(var Hi in Pr)if(Pr.hasOwnProperty(Hi)){var Qs=Pr[Hi];if(Qs.variables.equals($n)){Qs.answers.push(Xs),Xr=!0;break}}Xr||Pr.push({variables:$n,answers:[Xs]}),I.session.limit=I.current_limit}else if(I.points=nr,I.session.limit=St,I.session.format_success=cn,x.type.is_error(Rr))I.throw_error(Rr.args[0]);else if(I.current_limit>0){for(var Zs=[],bi=0;bi=0;$s--)Fs=new q(".",[Rr[$s],Fs]);Zs.push(new ke(S.goal.replace(new q(",",[new q("=",[lt,Pr[bi].variables]),new q("=",[$,Fs])])),S.substitution,S))}I.prepend(Zs)}};I.__calls.unshift(yr)}},"functor/3":function(I,S,y){var R,J=y.args[0],X=y.args[1],$=y.args[2];if(x.type.is_variable(J)&&(x.type.is_variable(X)||x.type.is_variable($)))I.throw_error(x.error.instantiation("functor/3"));else if(!x.type.is_variable($)&&!x.type.is_integer($))I.throw_error(x.error.type("integer",y.args[2],"functor/3"));else if(!x.type.is_variable(X)&&!x.type.is_atomic(X))I.throw_error(x.error.type("atomic",y.args[1],"functor/3"));else if(x.type.is_integer(X)&&x.type.is_integer($)&&$.value!==0)I.throw_error(x.error.type("atom",y.args[1],"functor/3"));else if(x.type.is_variable(J)){if(y.args[2].value>=0){for(var se=[],be=0;be<$.value;be++)se.push(I.next_free_variable());var Fe=x.type.is_integer(X)?X:new q(X.id,se);I.prepend([new ke(S.goal.replace(new q("=",[J,Fe])),S.substitution,S)])}}else{var lt=x.type.is_integer(J)?J:new q(J.id,[]),Et=x.type.is_integer(J)?new Re(0,!1):new Re(J.args.length,!1),qt=new q(",",[new q("=",[lt,X]),new q("=",[Et,$])]);I.prepend([new ke(S.goal.replace(qt),S.substitution,S)])}},"arg/3":function(I,S,y){if(x.type.is_variable(y.args[0])||x.type.is_variable(y.args[1]))I.throw_error(x.error.instantiation(y.indicator));else if(y.args[0].value<0)I.throw_error(x.error.domain("not_less_than_zero",y.args[0],y.indicator));else if(!x.type.is_compound(y.args[1]))I.throw_error(x.error.type("compound",y.args[1],y.indicator));else{var R=y.args[0].value;if(R>0&&R<=y.args[1].args.length){var J=new q("=",[y.args[1].args[R-1],y.args[2]]);I.prepend([new ke(S.goal.replace(J),S.substitution,S)])}}},"=../2":function(I,S,y){var R;if(x.type.is_variable(y.args[0])&&(x.type.is_variable(y.args[1])||x.type.is_non_empty_list(y.args[1])&&x.type.is_variable(y.args[1].args[0])))I.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_fully_list(y.args[1]))I.throw_error(x.error.type("list",y.args[1],y.indicator));else if(x.type.is_variable(y.args[0])){if(!x.type.is_variable(y.args[1])){var X=[];for(R=y.args[1].args[1];R.indicator==="./2";)X.push(R.args[0]),R=R.args[1];x.type.is_variable(y.args[0])&&x.type.is_variable(R)?I.throw_error(x.error.instantiation(y.indicator)):X.length===0&&x.type.is_compound(y.args[1].args[0])?I.throw_error(x.error.type("atomic",y.args[1].args[0],y.indicator)):X.length>0&&(x.type.is_compound(y.args[1].args[0])||x.type.is_number(y.args[1].args[0]))?I.throw_error(x.error.type("atom",y.args[1].args[0],y.indicator)):X.length===0?I.prepend([new ke(S.goal.replace(new q("=",[y.args[1].args[0],y.args[0]],S)),S.substitution,S)]):I.prepend([new ke(S.goal.replace(new q("=",[new q(y.args[1].args[0].id,X),y.args[0]])),S.substitution,S)])}}else{if(x.type.is_atomic(y.args[0]))R=new q(".",[y.args[0],new q("[]")]);else{R=new q("[]");for(var J=y.args[0].args.length-1;J>=0;J--)R=new q(".",[y.args[0].args[J],R]);R=new q(".",[new q(y.args[0].id),R])}I.prepend([new ke(S.goal.replace(new q("=",[R,y.args[1]])),S.substitution,S)])}},"copy_term/2":function(I,S,y){var R=y.args[0].rename(I);I.prepend([new ke(S.goal.replace(new q("=",[R,y.args[1]])),S.substitution,S.parent)])},"term_variables/2":function(I,S,y){var R=y.args[0],J=y.args[1];if(!x.type.is_fully_list(J))I.throw_error(x.error.type("list",J,y.indicator));else{var X=g(o(Ce(R.variables()),function($){return new Pe($)}));I.prepend([new ke(S.goal.replace(new q("=",[J,X])),S.substitution,S)])}},"clause/2":function(I,S,y){if(x.type.is_variable(y.args[0]))I.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_callable(y.args[0]))I.throw_error(x.error.type("callable",y.args[0],y.indicator));else if(!x.type.is_variable(y.args[1])&&!x.type.is_callable(y.args[1]))I.throw_error(x.error.type("callable",y.args[1],y.indicator));else if(I.session.rules[y.args[0].indicator]!==void 0)if(I.is_public_predicate(y.args[0].indicator)){var R=[];for(var J in I.session.rules[y.args[0].indicator])if(I.session.rules[y.args[0].indicator].hasOwnProperty(J)){var X=I.session.rules[y.args[0].indicator][J];I.session.renamed_variables={},X=X.rename(I),X.body===null&&(X.body=new q("true"));var $=new q(",",[new q("=",[X.head,y.args[0]]),new q("=",[X.body,y.args[1]])]);R.push(new ke(S.goal.replace($),S.substitution,S))}I.prepend(R)}else I.throw_error(x.error.permission("access","private_procedure",y.args[0].indicator,y.indicator))},"current_predicate/1":function(I,S,y){var R=y.args[0];if(!x.type.is_variable(R)&&(!x.type.is_compound(R)||R.indicator!=="//2"))I.throw_error(x.error.type("predicate_indicator",R,y.indicator));else if(!x.type.is_variable(R)&&!x.type.is_variable(R.args[0])&&!x.type.is_atom(R.args[0]))I.throw_error(x.error.type("atom",R.args[0],y.indicator));else if(!x.type.is_variable(R)&&!x.type.is_variable(R.args[1])&&!x.type.is_integer(R.args[1]))I.throw_error(x.error.type("integer",R.args[1],y.indicator));else{var J=[];for(var X in I.session.rules)if(I.session.rules.hasOwnProperty(X)){var $=X.lastIndexOf("/"),se=X.substr(0,$),be=parseInt(X.substr($+1,X.length-($+1))),Fe=new q("/",[new q(se),new Re(be,!1)]),lt=new q("=",[Fe,R]);J.push(new ke(S.goal.replace(lt),S.substitution,S))}I.prepend(J)}},"asserta/1":function(I,S,y){if(x.type.is_variable(y.args[0]))I.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_callable(y.args[0]))I.throw_error(x.error.type("callable",y.args[0],y.indicator));else{var R,J;y.args[0].indicator===":-/2"?(R=y.args[0].args[0],J=Ee(y.args[0].args[1])):(R=y.args[0],J=null),x.type.is_callable(R)?J!==null&&!x.type.is_callable(J)?I.throw_error(x.error.type("callable",J,y.indicator)):I.is_public_predicate(R.indicator)?(I.session.rules[R.indicator]===void 0&&(I.session.rules[R.indicator]=[]),I.session.public_predicates[R.indicator]=!0,I.session.rules[R.indicator]=[new Ve(R,J,!0)].concat(I.session.rules[R.indicator]),I.success(S)):I.throw_error(x.error.permission("modify","static_procedure",R.indicator,y.indicator)):I.throw_error(x.error.type("callable",R,y.indicator))}},"assertz/1":function(I,S,y){if(x.type.is_variable(y.args[0]))I.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_callable(y.args[0]))I.throw_error(x.error.type("callable",y.args[0],y.indicator));else{var R,J;y.args[0].indicator===":-/2"?(R=y.args[0].args[0],J=Ee(y.args[0].args[1])):(R=y.args[0],J=null),x.type.is_callable(R)?J!==null&&!x.type.is_callable(J)?I.throw_error(x.error.type("callable",J,y.indicator)):I.is_public_predicate(R.indicator)?(I.session.rules[R.indicator]===void 0&&(I.session.rules[R.indicator]=[]),I.session.public_predicates[R.indicator]=!0,I.session.rules[R.indicator].push(new Ve(R,J,!0)),I.success(S)):I.throw_error(x.error.permission("modify","static_procedure",R.indicator,y.indicator)):I.throw_error(x.error.type("callable",R,y.indicator))}},"retract/1":function(I,S,y){if(x.type.is_variable(y.args[0]))I.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_callable(y.args[0]))I.throw_error(x.error.type("callable",y.args[0],y.indicator));else{var R,J;if(y.args[0].indicator===":-/2"?(R=y.args[0].args[0],J=y.args[0].args[1]):(R=y.args[0],J=new q("true")),typeof S.retract>"u")if(I.is_public_predicate(R.indicator)){if(I.session.rules[R.indicator]!==void 0){for(var X=[],$=0;$I.get_flag("max_arity").value)I.throw_error(x.error.representation("max_arity",y.indicator));else{var R=y.args[0].args[0].id+"/"+y.args[0].args[1].value;I.is_public_predicate(R)?(delete I.session.rules[R],I.success(S)):I.throw_error(x.error.permission("modify","static_procedure",R,y.indicator))}},"atom_length/2":function(I,S,y){if(x.type.is_variable(y.args[0]))I.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_atom(y.args[0]))I.throw_error(x.error.type("atom",y.args[0],y.indicator));else if(!x.type.is_variable(y.args[1])&&!x.type.is_integer(y.args[1]))I.throw_error(x.error.type("integer",y.args[1],y.indicator));else if(x.type.is_integer(y.args[1])&&y.args[1].value<0)I.throw_error(x.error.domain("not_less_than_zero",y.args[1],y.indicator));else{var R=new Re(y.args[0].id.length,!1);I.prepend([new ke(S.goal.replace(new q("=",[R,y.args[1]])),S.substitution,S)])}},"atom_concat/3":function(I,S,y){var R,J,X=y.args[0],$=y.args[1],se=y.args[2];if(x.type.is_variable(se)&&(x.type.is_variable(X)||x.type.is_variable($)))I.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_variable(X)&&!x.type.is_atom(X))I.throw_error(x.error.type("atom",X,y.indicator));else if(!x.type.is_variable($)&&!x.type.is_atom($))I.throw_error(x.error.type("atom",$,y.indicator));else if(!x.type.is_variable(se)&&!x.type.is_atom(se))I.throw_error(x.error.type("atom",se,y.indicator));else{var be=x.type.is_variable(X),Fe=x.type.is_variable($);if(!be&&!Fe)J=new q("=",[se,new q(X.id+$.id)]),I.prepend([new ke(S.goal.replace(J),S.substitution,S)]);else if(be&&!Fe)R=se.id.substr(0,se.id.length-$.id.length),R+$.id===se.id&&(J=new q("=",[X,new q(R)]),I.prepend([new ke(S.goal.replace(J),S.substitution,S)]));else if(Fe&&!be)R=se.id.substr(X.id.length),X.id+R===se.id&&(J=new q("=",[$,new q(R)]),I.prepend([new ke(S.goal.replace(J),S.substitution,S)]));else{for(var lt=[],Et=0;Et<=se.id.length;Et++){var qt=new q(se.id.substr(0,Et)),nr=new q(se.id.substr(Et));J=new q(",",[new q("=",[qt,X]),new q("=",[nr,$])]),lt.push(new ke(S.goal.replace(J),S.substitution,S))}I.prepend(lt)}}},"sub_atom/5":function(I,S,y){var R,J=y.args[0],X=y.args[1],$=y.args[2],se=y.args[3],be=y.args[4];if(x.type.is_variable(J))I.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_variable(X)&&!x.type.is_integer(X))I.throw_error(x.error.type("integer",X,y.indicator));else if(!x.type.is_variable($)&&!x.type.is_integer($))I.throw_error(x.error.type("integer",$,y.indicator));else if(!x.type.is_variable(se)&&!x.type.is_integer(se))I.throw_error(x.error.type("integer",se,y.indicator));else if(x.type.is_integer(X)&&X.value<0)I.throw_error(x.error.domain("not_less_than_zero",X,y.indicator));else if(x.type.is_integer($)&&$.value<0)I.throw_error(x.error.domain("not_less_than_zero",$,y.indicator));else if(x.type.is_integer(se)&&se.value<0)I.throw_error(x.error.domain("not_less_than_zero",se,y.indicator));else{var Fe=[],lt=[],Et=[];if(x.type.is_variable(X))for(R=0;R<=J.id.length;R++)Fe.push(R);else Fe.push(X.value);if(x.type.is_variable($))for(R=0;R<=J.id.length;R++)lt.push(R);else lt.push($.value);if(x.type.is_variable(se))for(R=0;R<=J.id.length;R++)Et.push(R);else Et.push(se.value);var qt=[];for(var nr in Fe)if(Fe.hasOwnProperty(nr)){R=Fe[nr];for(var St in lt)if(lt.hasOwnProperty(St)){var cn=lt[St],Pr=J.id.length-R-cn;if(e(Et,Pr)!==-1&&R+cn+Pr===J.id.length){var yr=J.id.substr(R,cn);if(J.id===J.id.substr(0,R)+yr+J.id.substr(R+cn,Pr)){var Rr=new q("=",[new q(yr),be]),Xr=new q("=",[X,new Re(R)]),$n=new q("=",[$,new Re(cn)]),Xs=new q("=",[se,new Re(Pr)]),Hi=new q(",",[new q(",",[new q(",",[Xr,$n]),Xs]),Rr]);qt.push(new ke(S.goal.replace(Hi),S.substitution,S))}}}}I.prepend(qt)}},"atom_chars/2":function(I,S,y){var R=y.args[0],J=y.args[1];if(x.type.is_variable(R)&&x.type.is_variable(J))I.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_variable(R)&&!x.type.is_atom(R))I.throw_error(x.error.type("atom",R,y.indicator));else if(x.type.is_variable(R)){for(var se=J,be=x.type.is_variable(R),Fe="";se.indicator==="./2";){if(x.type.is_character(se.args[0]))Fe+=se.args[0].id;else if(x.type.is_variable(se.args[0])&&be){I.throw_error(x.error.instantiation(y.indicator));return}else if(!x.type.is_variable(se.args[0])){I.throw_error(x.error.type("character",se.args[0],y.indicator));return}se=se.args[1]}x.type.is_variable(se)&&be?I.throw_error(x.error.instantiation(y.indicator)):!x.type.is_empty_list(se)&&!x.type.is_variable(se)?I.throw_error(x.error.type("list",J,y.indicator)):I.prepend([new ke(S.goal.replace(new q("=",[new q(Fe),R])),S.substitution,S)])}else{for(var X=new q("[]"),$=R.id.length-1;$>=0;$--)X=new q(".",[new q(R.id.charAt($)),X]);I.prepend([new ke(S.goal.replace(new q("=",[J,X])),S.substitution,S)])}},"atom_codes/2":function(I,S,y){var R=y.args[0],J=y.args[1];if(x.type.is_variable(R)&&x.type.is_variable(J))I.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_variable(R)&&!x.type.is_atom(R))I.throw_error(x.error.type("atom",R,y.indicator));else if(x.type.is_variable(R)){for(var se=J,be=x.type.is_variable(R),Fe="";se.indicator==="./2";){if(x.type.is_character_code(se.args[0]))Fe+=u(se.args[0].value);else if(x.type.is_variable(se.args[0])&&be){I.throw_error(x.error.instantiation(y.indicator));return}else if(!x.type.is_variable(se.args[0])){I.throw_error(x.error.representation("character_code",y.indicator));return}se=se.args[1]}x.type.is_variable(se)&&be?I.throw_error(x.error.instantiation(y.indicator)):!x.type.is_empty_list(se)&&!x.type.is_variable(se)?I.throw_error(x.error.type("list",J,y.indicator)):I.prepend([new ke(S.goal.replace(new q("=",[new q(Fe),R])),S.substitution,S)])}else{for(var X=new q("[]"),$=R.id.length-1;$>=0;$--)X=new q(".",[new Re(n(R.id,$),!1),X]);I.prepend([new ke(S.goal.replace(new q("=",[J,X])),S.substitution,S)])}},"char_code/2":function(I,S,y){var R=y.args[0],J=y.args[1];if(x.type.is_variable(R)&&x.type.is_variable(J))I.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_variable(R)&&!x.type.is_character(R))I.throw_error(x.error.type("character",R,y.indicator));else if(!x.type.is_variable(J)&&!x.type.is_integer(J))I.throw_error(x.error.type("integer",J,y.indicator));else if(!x.type.is_variable(J)&&!x.type.is_character_code(J))I.throw_error(x.error.representation("character_code",y.indicator));else if(x.type.is_variable(J)){var X=new Re(n(R.id,0),!1);I.prepend([new ke(S.goal.replace(new q("=",[X,J])),S.substitution,S)])}else{var $=new q(u(J.value));I.prepend([new ke(S.goal.replace(new q("=",[$,R])),S.substitution,S)])}},"number_chars/2":function(I,S,y){var R,J=y.args[0],X=y.args[1];if(x.type.is_variable(J)&&x.type.is_variable(X))I.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_variable(J)&&!x.type.is_number(J))I.throw_error(x.error.type("number",J,y.indicator));else if(!x.type.is_variable(X)&&!x.type.is_list(X))I.throw_error(x.error.type("list",X,y.indicator));else{var $=x.type.is_variable(J);if(!x.type.is_variable(X)){var se=X,be=!0;for(R="";se.indicator==="./2";){if(x.type.is_character(se.args[0]))R+=se.args[0].id;else if(x.type.is_variable(se.args[0]))be=!1;else if(!x.type.is_variable(se.args[0])){I.throw_error(x.error.type("character",se.args[0],y.indicator));return}se=se.args[1]}if(be=be&&x.type.is_empty_list(se),!x.type.is_empty_list(se)&&!x.type.is_variable(se)){I.throw_error(x.error.type("list",X,y.indicator));return}if(!be&&$){I.throw_error(x.error.instantiation(y.indicator));return}else if(be)if(x.type.is_variable(se)&&$){I.throw_error(x.error.instantiation(y.indicator));return}else{var Fe=I.parse(R),lt=Fe.value;!x.type.is_number(lt)||Fe.tokens[Fe.tokens.length-1].space?I.throw_error(x.error.syntax_by_predicate("parseable_number",y.indicator)):I.prepend([new ke(S.goal.replace(new q("=",[J,lt])),S.substitution,S)]);return}}if(!$){R=J.toString();for(var Et=new q("[]"),qt=R.length-1;qt>=0;qt--)Et=new q(".",[new q(R.charAt(qt)),Et]);I.prepend([new ke(S.goal.replace(new q("=",[X,Et])),S.substitution,S)])}}},"number_codes/2":function(I,S,y){var R,J=y.args[0],X=y.args[1];if(x.type.is_variable(J)&&x.type.is_variable(X))I.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_variable(J)&&!x.type.is_number(J))I.throw_error(x.error.type("number",J,y.indicator));else if(!x.type.is_variable(X)&&!x.type.is_list(X))I.throw_error(x.error.type("list",X,y.indicator));else{var $=x.type.is_variable(J);if(!x.type.is_variable(X)){var se=X,be=!0;for(R="";se.indicator==="./2";){if(x.type.is_character_code(se.args[0]))R+=u(se.args[0].value);else if(x.type.is_variable(se.args[0]))be=!1;else if(!x.type.is_variable(se.args[0])){I.throw_error(x.error.type("character_code",se.args[0],y.indicator));return}se=se.args[1]}if(be=be&&x.type.is_empty_list(se),!x.type.is_empty_list(se)&&!x.type.is_variable(se)){I.throw_error(x.error.type("list",X,y.indicator));return}if(!be&&$){I.throw_error(x.error.instantiation(y.indicator));return}else if(be)if(x.type.is_variable(se)&&$){I.throw_error(x.error.instantiation(y.indicator));return}else{var Fe=I.parse(R),lt=Fe.value;!x.type.is_number(lt)||Fe.tokens[Fe.tokens.length-1].space?I.throw_error(x.error.syntax_by_predicate("parseable_number",y.indicator)):I.prepend([new ke(S.goal.replace(new q("=",[J,lt])),S.substitution,S)]);return}}if(!$){R=J.toString();for(var Et=new q("[]"),qt=R.length-1;qt>=0;qt--)Et=new q(".",[new Re(n(R,qt),!1),Et]);I.prepend([new ke(S.goal.replace(new q("=",[X,Et])),S.substitution,S)])}}},"upcase_atom/2":function(I,S,y){var R=y.args[0],J=y.args[1];x.type.is_variable(R)?I.throw_error(x.error.instantiation(y.indicator)):x.type.is_atom(R)?!x.type.is_variable(J)&&!x.type.is_atom(J)?I.throw_error(x.error.type("atom",J,y.indicator)):I.prepend([new ke(S.goal.replace(new q("=",[J,new q(R.id.toUpperCase(),[])])),S.substitution,S)]):I.throw_error(x.error.type("atom",R,y.indicator))},"downcase_atom/2":function(I,S,y){var R=y.args[0],J=y.args[1];x.type.is_variable(R)?I.throw_error(x.error.instantiation(y.indicator)):x.type.is_atom(R)?!x.type.is_variable(J)&&!x.type.is_atom(J)?I.throw_error(x.error.type("atom",J,y.indicator)):I.prepend([new ke(S.goal.replace(new q("=",[J,new q(R.id.toLowerCase(),[])])),S.substitution,S)]):I.throw_error(x.error.type("atom",R,y.indicator))},"atomic_list_concat/2":function(I,S,y){var R=y.args[0],J=y.args[1];I.prepend([new ke(S.goal.replace(new q("atomic_list_concat",[R,new q("",[]),J])),S.substitution,S)])},"atomic_list_concat/3":function(I,S,y){var R=y.args[0],J=y.args[1],X=y.args[2];if(x.type.is_variable(J)||x.type.is_variable(R)&&x.type.is_variable(X))I.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_variable(R)&&!x.type.is_list(R))I.throw_error(x.error.type("list",R,y.indicator));else if(!x.type.is_variable(X)&&!x.type.is_atom(X))I.throw_error(x.error.type("atom",X,y.indicator));else if(x.type.is_variable(X)){for(var se="",be=R;x.type.is_term(be)&&be.indicator==="./2";){if(!x.type.is_atom(be.args[0])&&!x.type.is_number(be.args[0])){I.throw_error(x.error.type("atomic",be.args[0],y.indicator));return}se!==""&&(se+=J.id),x.type.is_atom(be.args[0])?se+=be.args[0].id:se+=""+be.args[0].value,be=be.args[1]}se=new q(se,[]),x.type.is_variable(be)?I.throw_error(x.error.instantiation(y.indicator)):!x.type.is_term(be)||be.indicator!=="[]/0"?I.throw_error(x.error.type("list",R,y.indicator)):I.prepend([new ke(S.goal.replace(new q("=",[se,X])),S.substitution,S)])}else{var $=g(o(X.id.split(J.id),function(Fe){return new q(Fe,[])}));I.prepend([new ke(S.goal.replace(new q("=",[$,R])),S.substitution,S)])}},"@=/2":function(I,S,y){x.compare(y.args[0],y.args[1])>0&&I.success(S)},"@>=/2":function(I,S,y){x.compare(y.args[0],y.args[1])>=0&&I.success(S)},"compare/3":function(I,S,y){var R=y.args[0],J=y.args[1],X=y.args[2];if(!x.type.is_variable(R)&&!x.type.is_atom(R))I.throw_error(x.error.type("atom",R,y.indicator));else if(x.type.is_atom(R)&&["<",">","="].indexOf(R.id)===-1)I.throw_error(x.type.domain("order",R,y.indicator));else{var $=x.compare(J,X);$=$===0?"=":$===-1?"<":">",I.prepend([new ke(S.goal.replace(new q("=",[R,new q($,[])])),S.substitution,S)])}},"is/2":function(I,S,y){var R=y.args[1].interpret(I);x.type.is_number(R)?I.prepend([new ke(S.goal.replace(new q("=",[y.args[0],R],I.level)),S.substitution,S)]):I.throw_error(R)},"between/3":function(I,S,y){var R=y.args[0],J=y.args[1],X=y.args[2];if(x.type.is_variable(R)||x.type.is_variable(J))I.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_integer(R))I.throw_error(x.error.type("integer",R,y.indicator));else if(!x.type.is_integer(J))I.throw_error(x.error.type("integer",J,y.indicator));else if(!x.type.is_variable(X)&&!x.type.is_integer(X))I.throw_error(x.error.type("integer",X,y.indicator));else if(x.type.is_variable(X)){var $=[new ke(S.goal.replace(new q("=",[X,R])),S.substitution,S)];R.value=X.value&&I.success(S)},"succ/2":function(I,S,y){var R=y.args[0],J=y.args[1];x.type.is_variable(R)&&x.type.is_variable(J)?I.throw_error(x.error.instantiation(y.indicator)):!x.type.is_variable(R)&&!x.type.is_integer(R)?I.throw_error(x.error.type("integer",R,y.indicator)):!x.type.is_variable(J)&&!x.type.is_integer(J)?I.throw_error(x.error.type("integer",J,y.indicator)):!x.type.is_variable(R)&&R.value<0?I.throw_error(x.error.domain("not_less_than_zero",R,y.indicator)):!x.type.is_variable(J)&&J.value<0?I.throw_error(x.error.domain("not_less_than_zero",J,y.indicator)):(x.type.is_variable(J)||J.value>0)&&(x.type.is_variable(R)?I.prepend([new ke(S.goal.replace(new q("=",[R,new Re(J.value-1,!1)])),S.substitution,S)]):I.prepend([new ke(S.goal.replace(new q("=",[J,new Re(R.value+1,!1)])),S.substitution,S)]))},"=:=/2":function(I,S,y){var R=x.arithmetic_compare(I,y.args[0],y.args[1]);x.type.is_term(R)?I.throw_error(R):R===0&&I.success(S)},"=\\=/2":function(I,S,y){var R=x.arithmetic_compare(I,y.args[0],y.args[1]);x.type.is_term(R)?I.throw_error(R):R!==0&&I.success(S)},"/2":function(I,S,y){var R=x.arithmetic_compare(I,y.args[0],y.args[1]);x.type.is_term(R)?I.throw_error(R):R>0&&I.success(S)},">=/2":function(I,S,y){var R=x.arithmetic_compare(I,y.args[0],y.args[1]);x.type.is_term(R)?I.throw_error(R):R>=0&&I.success(S)},"var/1":function(I,S,y){x.type.is_variable(y.args[0])&&I.success(S)},"atom/1":function(I,S,y){x.type.is_atom(y.args[0])&&I.success(S)},"atomic/1":function(I,S,y){x.type.is_atomic(y.args[0])&&I.success(S)},"compound/1":function(I,S,y){x.type.is_compound(y.args[0])&&I.success(S)},"integer/1":function(I,S,y){x.type.is_integer(y.args[0])&&I.success(S)},"float/1":function(I,S,y){x.type.is_float(y.args[0])&&I.success(S)},"number/1":function(I,S,y){x.type.is_number(y.args[0])&&I.success(S)},"nonvar/1":function(I,S,y){x.type.is_variable(y.args[0])||I.success(S)},"ground/1":function(I,S,y){y.variables().length===0&&I.success(S)},"acyclic_term/1":function(I,S,y){for(var R=S.substitution.apply(S.substitution),J=y.args[0].variables(),X=0;X0?St[St.length-1]:null,St!==null&&(qt=z(I,St,0,I.__get_max_priority(),!1))}if(qt.type===p&&qt.len===St.length-1&&cn.value==="."){qt=qt.value.rename(I);var Pr=new q("=",[J,qt]);if(se.variables){var yr=g(o(Ce(qt.variables()),function(Rr){return new Pe(Rr)}));Pr=new q(",",[Pr,new q("=",[se.variables,yr])])}if(se.variable_names){var yr=g(o(Ce(qt.variables()),function(Xr){var $n;for($n in I.session.renamed_variables)if(I.session.renamed_variables.hasOwnProperty($n)&&I.session.renamed_variables[$n]===Xr)break;return new q("=",[new q($n,[]),new Pe(Xr)])}));Pr=new q(",",[Pr,new q("=",[se.variable_names,yr])])}if(se.singletons){var yr=g(o(new Ve(qt,null).singleton_variables(),function(Xr){var $n;for($n in I.session.renamed_variables)if(I.session.renamed_variables.hasOwnProperty($n)&&I.session.renamed_variables[$n]===Xr)break;return new q("=",[new q($n,[]),new Pe(Xr)])}));Pr=new q(",",[Pr,new q("=",[se.singletons,yr])])}I.prepend([new ke(S.goal.replace(Pr),S.substitution,S)])}else qt.type===p?I.throw_error(x.error.syntax(St[qt.len],"unexpected token",!1)):I.throw_error(qt.value)}}},"write/1":function(I,S,y){var R=y.args[0];I.prepend([new ke(S.goal.replace(new q(",",[new q("current_output",[new Pe("S")]),new q("write",[new Pe("S"),R])])),S.substitution,S)])},"write/2":function(I,S,y){var R=y.args[0],J=y.args[1];I.prepend([new ke(S.goal.replace(new q("write_term",[R,J,new q(".",[new q("quoted",[new q("false",[])]),new q(".",[new q("ignore_ops",[new q("false")]),new q(".",[new q("numbervars",[new q("true")]),new q("[]",[])])])])])),S.substitution,S)])},"writeq/1":function(I,S,y){var R=y.args[0];I.prepend([new ke(S.goal.replace(new q(",",[new q("current_output",[new Pe("S")]),new q("writeq",[new Pe("S"),R])])),S.substitution,S)])},"writeq/2":function(I,S,y){var R=y.args[0],J=y.args[1];I.prepend([new ke(S.goal.replace(new q("write_term",[R,J,new q(".",[new q("quoted",[new q("true",[])]),new q(".",[new q("ignore_ops",[new q("false")]),new q(".",[new q("numbervars",[new q("true")]),new q("[]",[])])])])])),S.substitution,S)])},"write_canonical/1":function(I,S,y){var R=y.args[0];I.prepend([new ke(S.goal.replace(new q(",",[new q("current_output",[new Pe("S")]),new q("write_canonical",[new Pe("S"),R])])),S.substitution,S)])},"write_canonical/2":function(I,S,y){var R=y.args[0],J=y.args[1];I.prepend([new ke(S.goal.replace(new q("write_term",[R,J,new q(".",[new q("quoted",[new q("true",[])]),new q(".",[new q("ignore_ops",[new q("true")]),new q(".",[new q("numbervars",[new q("false")]),new q("[]",[])])])])])),S.substitution,S)])},"write_term/2":function(I,S,y){var R=y.args[0],J=y.args[1];I.prepend([new ke(S.goal.replace(new q(",",[new q("current_output",[new Pe("S")]),new q("write_term",[new Pe("S"),R,J])])),S.substitution,S)])},"write_term/3":function(I,S,y){var R=y.args[0],J=y.args[1],X=y.args[2],$=x.type.is_stream(R)?R:I.get_stream_by_alias(R.id);if(x.type.is_variable(R)||x.type.is_variable(X))I.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_list(X))I.throw_error(x.error.type("list",X,y.indicator));else if(!x.type.is_stream(R)&&!x.type.is_atom(R))I.throw_error(x.error.domain("stream_or_alias",R,y.indicator));else if(!x.type.is_stream($)||$.stream===null)I.throw_error(x.error.existence("stream",R,y.indicator));else if($.input)I.throw_error(x.error.permission("output","stream",R,y.indicator));else if($.type==="binary")I.throw_error(x.error.permission("output","binary_stream",R,y.indicator));else if($.position==="past_end_of_stream"&&$.eof_action==="error")I.throw_error(x.error.permission("output","past_end_of_stream",R,y.indicator));else{for(var se={},be=X,Fe;x.type.is_term(be)&&be.indicator==="./2";){if(Fe=be.args[0],x.type.is_variable(Fe)){I.throw_error(x.error.instantiation(y.indicator));return}else if(!x.type.is_write_option(Fe)){I.throw_error(x.error.domain("write_option",Fe,y.indicator));return}se[Fe.id]=Fe.args[0].id==="true",be=be.args[1]}if(be.indicator!=="[]/0"){x.type.is_variable(be)?I.throw_error(x.error.instantiation(y.indicator)):I.throw_error(x.error.type("list",X,y.indicator));return}else{se.session=I.session;var lt=J.toString(se);$.stream.put(lt,$.position),typeof $.position=="number"&&($.position+=lt.length),I.success(S)}}},"halt/0":function(I,S,y){I.points=[]},"halt/1":function(I,S,y){var R=y.args[0];x.type.is_variable(R)?I.throw_error(x.error.instantiation(y.indicator)):x.type.is_integer(R)?I.points=[]:I.throw_error(x.error.type("integer",R,y.indicator))},"current_prolog_flag/2":function(I,S,y){var R=y.args[0],J=y.args[1];if(!x.type.is_variable(R)&&!x.type.is_atom(R))I.throw_error(x.error.type("atom",R,y.indicator));else if(!x.type.is_variable(R)&&!x.type.is_flag(R))I.throw_error(x.error.domain("prolog_flag",R,y.indicator));else{var X=[];for(var $ in x.flag)if(x.flag.hasOwnProperty($)){var se=new q(",",[new q("=",[new q($),R]),new q("=",[I.get_flag($),J])]);X.push(new ke(S.goal.replace(se),S.substitution,S))}I.prepend(X)}},"set_prolog_flag/2":function(I,S,y){var R=y.args[0],J=y.args[1];x.type.is_variable(R)||x.type.is_variable(J)?I.throw_error(x.error.instantiation(y.indicator)):x.type.is_atom(R)?x.type.is_flag(R)?x.type.is_value_flag(R,J)?x.type.is_modifiable_flag(R)?(I.session.flag[R.id]=J,I.success(S)):I.throw_error(x.error.permission("modify","flag",R)):I.throw_error(x.error.domain("flag_value",new q("+",[R,J]),y.indicator)):I.throw_error(x.error.domain("prolog_flag",R,y.indicator)):I.throw_error(x.error.type("atom",R,y.indicator))}},flag:{bounded:{allowed:[new q("true"),new q("false")],value:new q("true"),changeable:!1},max_integer:{allowed:[new Re(Number.MAX_SAFE_INTEGER)],value:new Re(Number.MAX_SAFE_INTEGER),changeable:!1},min_integer:{allowed:[new Re(Number.MIN_SAFE_INTEGER)],value:new Re(Number.MIN_SAFE_INTEGER),changeable:!1},integer_rounding_function:{allowed:[new q("down"),new q("toward_zero")],value:new q("toward_zero"),changeable:!1},char_conversion:{allowed:[new q("on"),new q("off")],value:new q("on"),changeable:!0},debug:{allowed:[new q("on"),new q("off")],value:new q("off"),changeable:!0},max_arity:{allowed:[new q("unbounded")],value:new q("unbounded"),changeable:!1},unknown:{allowed:[new q("error"),new q("fail"),new q("warning")],value:new q("error"),changeable:!0},double_quotes:{allowed:[new q("chars"),new q("codes"),new q("atom")],value:new q("codes"),changeable:!0},occurs_check:{allowed:[new q("false"),new q("true")],value:new q("false"),changeable:!0},dialect:{allowed:[new q("tau")],value:new q("tau"),changeable:!1},version_data:{allowed:[new q("tau",[new Re(t.major,!1),new Re(t.minor,!1),new Re(t.patch,!1),new q(t.status)])],value:new q("tau",[new Re(t.major,!1),new Re(t.minor,!1),new Re(t.patch,!1),new q(t.status)]),changeable:!1},nodejs:{allowed:[new q("yes"),new q("no")],value:new q(typeof El<"u"&&El.exports?"yes":"no"),changeable:!1}},unify:function(I,S,y){y=y===void 0?!1:y;for(var R=[{left:I,right:S}],J={};R.length!==0;){var X=R.pop();if(I=X.left,S=X.right,x.type.is_term(I)&&x.type.is_term(S)){if(I.indicator!==S.indicator)return null;for(var $=0;$J.value?1:0:J}else return R},operate:function(I,S){if(x.type.is_operator(S)){for(var y=x.type.is_operator(S),R=[],J,X=!1,$=0;$I.get_flag("max_integer").value||J0?I.start+I.matches[0].length:I.start,J=y?new q("token_not_found"):new q("found",[new q(I.value.toString())]),X=new q(".",[new q("line",[new Re(I.line+1)]),new q(".",[new q("column",[new Re(R+1)]),new q(".",[J,new q("[]",[])])])]);return new q("error",[new q("syntax_error",[new q(S)]),X])},syntax_by_predicate:function(I,S){return new q("error",[new q("syntax_error",[new q(I)]),Z(S)])}},warning:{singleton:function(I,S,y){for(var R=new q("[]"),J=I.length-1;J>=0;J--)R=new q(".",[new Pe(I[J]),R]);return new q("warning",[new q("singleton_variables",[R,Z(S)]),new q(".",[new q("line",[new Re(y,!1)]),new q("[]")])])},failed_goal:function(I,S){return new q("warning",[new q("failed_goal",[I]),new q(".",[new q("line",[new Re(S,!1)]),new q("[]")])])}},format_variable:function(I){return"_"+I},format_answer:function(I,S,R){S instanceof xe&&(S=S.thread);var R=R||{};if(R.session=S?S.session:void 0,x.type.is_error(I))return"uncaught exception: "+I.args[0].toString();if(I===!1)return"false.";if(I===null)return"limit exceeded ;";var J=0,X="";if(x.type.is_substitution(I)){var $=I.domain(!0);I=I.filter(function(Fe,lt){return!x.type.is_variable(lt)||$.indexOf(lt.id)!==-1&&Fe!==lt.id})}for(var se in I.links)I.links.hasOwnProperty(se)&&(J++,X!==""&&(X+=", "),X+=se.toString(R)+" = "+I.links[se].toString(R));var be=typeof S>"u"||S.points.length>0?" ;":".";return J===0?"true"+be:X+be},flatten_error:function(I){if(!x.type.is_error(I))return null;I=I.args[0];var S={};return S.type=I.args[0].id,S.thrown=S.type==="syntax_error"?null:I.args[1].id,S.expected=null,S.found=null,S.representation=null,S.existence=null,S.existence_type=null,S.line=null,S.column=null,S.permission_operation=null,S.permission_type=null,S.evaluation_type=null,S.type==="type_error"||S.type==="domain_error"?(S.expected=I.args[0].args[0].id,S.found=I.args[0].args[1].toString()):S.type==="syntax_error"?I.args[1].indicator==="./2"?(S.expected=I.args[0].args[0].id,S.found=I.args[1].args[1].args[1].args[0],S.found=S.found.id==="token_not_found"?S.found.id:S.found.args[0].id,S.line=I.args[1].args[0].args[0].value,S.column=I.args[1].args[1].args[0].args[0].value):S.thrown=I.args[1].id:S.type==="permission_error"?(S.found=I.args[0].args[2].toString(),S.permission_operation=I.args[0].args[0].id,S.permission_type=I.args[0].args[1].id):S.type==="evaluation_error"?S.evaluation_type=I.args[0].args[0].id:S.type==="representation_error"?S.representation=I.args[0].args[0].id:S.type==="existence_error"&&(S.existence=I.args[0].args[1].toString(),S.existence_type=I.args[0].args[0].id),S},create:function(I){return new x.type.Session(I)}};typeof El<"u"?El.exports=x:window.pl=x})()});function Kme(t,e,r){t.prepend(r.map(o=>new Oa.default.type.State(e.goal.replace(o),e.substitution,e)))}function n6(t){let e=zme.get(t.session);if(e==null)throw new Error("Assertion failed: A project should have been registered for the active session");return e}function Jme(t,e){zme.set(t,e),t.consult(`:- use_module(library(${Wgt.id})).`)}var i6,Oa,Vme,Nh,jgt,Ggt,zme,Wgt,Xme=It(()=>{Ke();i6=et(L2()),Oa=et(r6()),Vme=et(ve("vm")),{is_atom:Nh,is_variable:jgt,is_instantiated_list:Ggt}=Oa.default.type;zme=new WeakMap;Wgt=new Oa.default.type.Module("constraints",{"project_workspaces_by_descriptor/3":(t,e,r)=>{let[o,a,n]=r.args;if(!Nh(o)||!Nh(a)){t.throw_error(Oa.default.error.instantiation(r.indicator));return}let u=G.parseIdent(o.id),A=G.makeDescriptor(u,a.id),h=n6(t).tryWorkspaceByDescriptor(A);jgt(n)&&h!==null&&Kme(t,e,[new Oa.default.type.Term("=",[n,new Oa.default.type.Term(String(h.relativeCwd))])]),Nh(n)&&h!==null&&h.relativeCwd===n.id&&t.success(e)},"workspace_field/3":(t,e,r)=>{let[o,a,n]=r.args;if(!Nh(o)||!Nh(a)){t.throw_error(Oa.default.error.instantiation(r.indicator));return}let A=n6(t).tryWorkspaceByCwd(o.id);if(A==null)return;let p=(0,i6.default)(A.manifest.raw,a.id);typeof p>"u"||Kme(t,e,[new Oa.default.type.Term("=",[n,new Oa.default.type.Term(typeof p=="object"?JSON.stringify(p):p)])])},"workspace_field_test/3":(t,e,r)=>{let[o,a,n]=r.args;t.prepend([new Oa.default.type.State(e.goal.replace(new Oa.default.type.Term("workspace_field_test",[o,a,n,new Oa.default.type.Term("[]",[])])),e.substitution,e)])},"workspace_field_test/4":(t,e,r)=>{let[o,a,n,u]=r.args;if(!Nh(o)||!Nh(a)||!Nh(n)||!Ggt(u)){t.throw_error(Oa.default.error.instantiation(r.indicator));return}let p=n6(t).tryWorkspaceByCwd(o.id);if(p==null)return;let h=(0,i6.default)(p.manifest.raw,a.id);if(typeof h>"u")return;let E={$$:h};for(let[D,b]of u.toJavaScript().entries())E[`$${D}`]=b;Vme.default.runInNewContext(n.id,E)&&t.success(e)}},["project_workspaces_by_descriptor/3","workspace_field/3","workspace_field_test/3","workspace_field_test/4"])});var Y2={};Kt(Y2,{Constraints:()=>o6,DependencyType:()=>tye});function Vs(t){if(t instanceof rC.default.type.Num)return t.value;if(t instanceof rC.default.type.Term)switch(t.indicator){case"throw/1":return Vs(t.args[0]);case"error/1":return Vs(t.args[0]);case"error/2":if(t.args[0]instanceof rC.default.type.Term&&t.args[0].indicator==="syntax_error/1")return Object.assign(Vs(t.args[0]),...Vs(t.args[1]));{let e=Vs(t.args[0]);return e.message+=` (in ${Vs(t.args[1])})`,e}case"syntax_error/1":return new zt(43,`Syntax error: ${Vs(t.args[0])}`);case"existence_error/2":return new zt(44,`Existence error: ${Vs(t.args[0])} ${Vs(t.args[1])} not found`);case"instantiation_error/0":return new zt(75,"Instantiation error: an argument is variable when an instantiated argument was expected");case"line/1":return{line:Vs(t.args[0])};case"column/1":return{column:Vs(t.args[0])};case"found/1":return{found:Vs(t.args[0])};case"./2":return[Vs(t.args[0])].concat(Vs(t.args[1]));case"//2":return`${Vs(t.args[0])}/${Vs(t.args[1])}`;default:return t.id}throw`couldn't pretty print because of unsupported node ${t}`}function $me(t){let e;try{e=Vs(t)}catch(r){throw typeof r=="string"?new zt(42,`Unknown error: ${t} (note: ${r})`):r}return typeof e.line<"u"&&typeof e.column<"u"&&(e.message+=` at line ${e.line}, column ${e.column}`),e}function Zg(t){return t.id==="null"?null:`${t.toJavaScript()}`}function Ygt(t){if(t.id==="null")return null;{let e=t.toJavaScript();if(typeof e!="string")return JSON.stringify(e);try{return JSON.stringify(JSON.parse(e))}catch{return JSON.stringify(e)}}}function Oh(t){return typeof t=="string"?`'${t}'`:"[]"}var eye,rC,tye,Zme,s6,o6,K2=It(()=>{Ke();Ke();Pt();eye=et(Qme()),rC=et(r6());j2();Xme();(0,eye.default)(rC.default);tye=(o=>(o.Dependencies="dependencies",o.DevDependencies="devDependencies",o.PeerDependencies="peerDependencies",o))(tye||{}),Zme=["dependencies","devDependencies","peerDependencies"];s6=class{constructor(e,r){let o=1e3*e.workspaces.length;this.session=rC.default.create(o),Jme(this.session,e),this.session.consult(":- use_module(library(lists))."),this.session.consult(r)}fetchNextAnswer(){return new Promise(e=>{this.session.answer(r=>{e(r)})})}async*makeQuery(e){let r=this.session.query(e);if(r!==!0)throw $me(r);for(;;){let o=await this.fetchNextAnswer();if(o===null)throw new zt(79,"Resolution limit exceeded");if(!o)break;if(o.id==="throw")throw $me(o);yield o}}};o6=class t{constructor(e){this.source="";this.project=e;let r=e.configuration.get("constraintsPath");ae.existsSync(r)&&(this.source=ae.readFileSync(r,"utf8"))}static async find(e){return new t(e)}getProjectDatabase(){let e="";for(let r of Zme)e+=`dependency_type(${r}). `;for(let r of this.project.workspacesByCwd.values()){let o=r.relativeCwd;e+=`workspace(${Oh(o)}). `,e+=`workspace_ident(${Oh(o)}, ${Oh(G.stringifyIdent(r.anchoredLocator))}). `,e+=`workspace_version(${Oh(o)}, ${Oh(r.manifest.version)}). `;for(let a of Zme)for(let n of r.manifest[a].values())e+=`workspace_has_dependency(${Oh(o)}, ${Oh(G.stringifyIdent(n))}, ${Oh(n.range)}, ${a}). `}return e+=`workspace(_) :- false. `,e+=`workspace_ident(_, _) :- false. `,e+=`workspace_version(_, _) :- false. `,e+=`workspace_has_dependency(_, _, _, _) :- false. `,e}getDeclarations(){let e="";return e+=`gen_enforced_dependency(_, _, _, _) :- false. `,e+=`gen_enforced_field(_, _, _) :- false. `,e}get fullSource(){return`${this.getProjectDatabase()} ${this.source} ${this.getDeclarations()}`}createSession(){return new s6(this.project,this.fullSource)}async processClassic(){let e=this.createSession();return{enforcedDependencies:await this.genEnforcedDependencies(e),enforcedFields:await this.genEnforcedFields(e)}}async process(){let{enforcedDependencies:e,enforcedFields:r}=await this.processClassic(),o=new Map;for(let{workspace:a,dependencyIdent:n,dependencyRange:u,dependencyType:A}of e){let p=q2([A,G.stringifyIdent(n)]),h=qe.getMapWithDefault(o,a.cwd);qe.getMapWithDefault(h,p).set(u??void 0,new Set)}for(let{workspace:a,fieldPath:n,fieldValue:u}of r){let A=q2(n),p=qe.getMapWithDefault(o,a.cwd);qe.getMapWithDefault(p,A).set(JSON.parse(u)??void 0,new Set)}return{manifestUpdates:o,reportedErrors:new Map}}async genEnforcedDependencies(e){let r=[];for await(let o of e.makeQuery("workspace(WorkspaceCwd), dependency_type(DependencyType), gen_enforced_dependency(WorkspaceCwd, DependencyIdent, DependencyRange, DependencyType).")){let a=K.resolve(this.project.cwd,Zg(o.links.WorkspaceCwd)),n=Zg(o.links.DependencyIdent),u=Zg(o.links.DependencyRange),A=Zg(o.links.DependencyType);if(a===null||n===null)throw new Error("Invalid rule");let p=this.project.getWorkspaceByCwd(a),h=G.parseIdent(n);r.push({workspace:p,dependencyIdent:h,dependencyRange:u,dependencyType:A})}return qe.sortMap(r,[({dependencyRange:o})=>o!==null?"0":"1",({workspace:o})=>G.stringifyIdent(o.anchoredLocator),({dependencyIdent:o})=>G.stringifyIdent(o)])}async genEnforcedFields(e){let r=[];for await(let o of e.makeQuery("workspace(WorkspaceCwd), gen_enforced_field(WorkspaceCwd, FieldPath, FieldValue).")){let a=K.resolve(this.project.cwd,Zg(o.links.WorkspaceCwd)),n=Zg(o.links.FieldPath),u=Ygt(o.links.FieldValue);if(a===null||n===null)throw new Error("Invalid rule");let A=this.project.getWorkspaceByCwd(a);r.push({workspace:A,fieldPath:n,fieldValue:u})}return qe.sortMap(r,[({workspace:o})=>G.stringifyIdent(o.anchoredLocator),({fieldPath:o})=>o])}async*query(e){let r=this.createSession();for await(let o of r.makeQuery(e)){let a={};for(let[n,u]of Object.entries(o.links))n!=="_"&&(a[n]=Zg(u));yield a}}}});var uye=_(tQ=>{"use strict";Object.defineProperty(tQ,"__esModule",{value:!0});function lB(t){let e=[...t.caches],r=e.shift();return r===void 0?cye():{get(o,a,n={miss:()=>Promise.resolve()}){return r.get(o,a,n).catch(()=>lB({caches:e}).get(o,a,n))},set(o,a){return r.set(o,a).catch(()=>lB({caches:e}).set(o,a))},delete(o){return r.delete(o).catch(()=>lB({caches:e}).delete(o))},clear(){return r.clear().catch(()=>lB({caches:e}).clear())}}}function cye(){return{get(t,e,r={miss:()=>Promise.resolve()}){return e().then(a=>Promise.all([a,r.miss(a)])).then(([a])=>a)},set(t,e){return Promise.resolve(e)},delete(t){return Promise.resolve()},clear(){return Promise.resolve()}}}tQ.createFallbackableCache=lB;tQ.createNullCache=cye});var fye=_((pYt,Aye)=>{Aye.exports=uye()});var pye=_(C6=>{"use strict";Object.defineProperty(C6,"__esModule",{value:!0});function Adt(t={serializable:!0}){let e={};return{get(r,o,a={miss:()=>Promise.resolve()}){let n=JSON.stringify(r);if(n in e)return Promise.resolve(t.serializable?JSON.parse(e[n]):e[n]);let u=o(),A=a&&a.miss||(()=>Promise.resolve());return u.then(p=>A(p)).then(()=>u)},set(r,o){return e[JSON.stringify(r)]=t.serializable?JSON.stringify(o):o,Promise.resolve(o)},delete(r){return delete e[JSON.stringify(r)],Promise.resolve()},clear(){return e={},Promise.resolve()}}}C6.createInMemoryCache=Adt});var gye=_((gYt,hye)=>{hye.exports=pye()});var mye=_(su=>{"use strict";Object.defineProperty(su,"__esModule",{value:!0});function fdt(t,e,r){let o={"x-algolia-api-key":r,"x-algolia-application-id":e};return{headers(){return t===I6.WithinHeaders?o:{}},queryParameters(){return t===I6.WithinQueryParameters?o:{}}}}function pdt(t){let e=0,r=()=>(e++,new Promise(o=>{setTimeout(()=>{o(t(r))},Math.min(100*e,1e3))}));return t(r)}function dye(t,e=(r,o)=>Promise.resolve()){return Object.assign(t,{wait(r){return dye(t.then(o=>Promise.all([e(o,r),o])).then(o=>o[1]))}})}function hdt(t){let e=t.length-1;for(e;e>0;e--){let r=Math.floor(Math.random()*(e+1)),o=t[e];t[e]=t[r],t[r]=o}return t}function gdt(t,e){return e&&Object.keys(e).forEach(r=>{t[r]=e[r](t)}),t}function ddt(t,...e){let r=0;return t.replace(/%s/g,()=>encodeURIComponent(e[r++]))}var mdt="4.22.1",ydt=t=>()=>t.transporter.requester.destroy(),I6={WithinQueryParameters:0,WithinHeaders:1};su.AuthMode=I6;su.addMethods=gdt;su.createAuth=fdt;su.createRetryablePromise=pdt;su.createWaitablePromise=dye;su.destroy=ydt;su.encode=ddt;su.shuffle=hdt;su.version=mdt});var cB=_((mYt,yye)=>{yye.exports=mye()});var Eye=_(w6=>{"use strict";Object.defineProperty(w6,"__esModule",{value:!0});var Edt={Delete:"DELETE",Get:"GET",Post:"POST",Put:"PUT"};w6.MethodEnum=Edt});var uB=_((EYt,Cye)=>{Cye.exports=Eye()});var Lye=_(Ti=>{"use strict";Object.defineProperty(Ti,"__esModule",{value:!0});var wye=uB();function B6(t,e){let r=t||{},o=r.data||{};return Object.keys(r).forEach(a=>{["timeout","headers","queryParameters","data","cacheable"].indexOf(a)===-1&&(o[a]=r[a])}),{data:Object.entries(o).length>0?o:void 0,timeout:r.timeout||e,headers:r.headers||{},queryParameters:r.queryParameters||{},cacheable:r.cacheable}}var AB={Read:1,Write:2,Any:3},fC={Up:1,Down:2,Timeouted:3},Bye=2*60*1e3;function D6(t,e=fC.Up){return{...t,status:e,lastUpdate:Date.now()}}function vye(t){return t.status===fC.Up||Date.now()-t.lastUpdate>Bye}function Dye(t){return t.status===fC.Timeouted&&Date.now()-t.lastUpdate<=Bye}function P6(t){return typeof t=="string"?{protocol:"https",url:t,accept:AB.Any}:{protocol:t.protocol||"https",url:t.url,accept:t.accept||AB.Any}}function Cdt(t,e){return Promise.all(e.map(r=>t.get(r,()=>Promise.resolve(D6(r))))).then(r=>{let o=r.filter(A=>vye(A)),a=r.filter(A=>Dye(A)),n=[...o,...a],u=n.length>0?n.map(A=>P6(A)):e;return{getTimeout(A,p){return(a.length===0&&A===0?1:a.length+3+A)*p},statelessHosts:u}})}var Idt=({isTimedOut:t,status:e})=>!t&&~~e===0,wdt=t=>{let e=t.status;return t.isTimedOut||Idt(t)||~~(e/100)!==2&&~~(e/100)!==4},Bdt=({status:t})=>~~(t/100)===2,vdt=(t,e)=>wdt(t)?e.onRetry(t):Bdt(t)?e.onSuccess(t):e.onFail(t);function Iye(t,e,r,o){let a=[],n=kye(r,o),u=Qye(t,o),A=r.method,p=r.method!==wye.MethodEnum.Get?{}:{...r.data,...o.data},h={"x-algolia-agent":t.userAgent.value,...t.queryParameters,...p,...o.queryParameters},E=0,w=(D,b)=>{let C=D.pop();if(C===void 0)throw Tye(v6(a));let T={data:n,headers:u,method:A,url:xye(C,r.path,h),connectTimeout:b(E,t.timeouts.connect),responseTimeout:b(E,o.timeout)},N=z=>{let te={request:T,response:z,host:C,triesLeft:D.length};return a.push(te),te},U={onSuccess:z=>Pye(z),onRetry(z){let te=N(z);return z.isTimedOut&&E++,Promise.all([t.logger.info("Retryable failure",S6(te)),t.hostsCache.set(C,D6(C,z.isTimedOut?fC.Timeouted:fC.Down))]).then(()=>w(D,b))},onFail(z){throw N(z),Sye(z,v6(a))}};return t.requester.send(T).then(z=>vdt(z,U))};return Cdt(t.hostsCache,e).then(D=>w([...D.statelessHosts].reverse(),D.getTimeout))}function Ddt(t){let{hostsCache:e,logger:r,requester:o,requestsCache:a,responsesCache:n,timeouts:u,userAgent:A,hosts:p,queryParameters:h,headers:E}=t,w={hostsCache:e,logger:r,requester:o,requestsCache:a,responsesCache:n,timeouts:u,userAgent:A,headers:E,queryParameters:h,hosts:p.map(D=>P6(D)),read(D,b){let C=B6(b,w.timeouts.read),T=()=>Iye(w,w.hosts.filter(z=>(z.accept&AB.Read)!==0),D,C);if((C.cacheable!==void 0?C.cacheable:D.cacheable)!==!0)return T();let U={request:D,mappedRequestOptions:C,transporter:{queryParameters:w.queryParameters,headers:w.headers}};return w.responsesCache.get(U,()=>w.requestsCache.get(U,()=>w.requestsCache.set(U,T()).then(z=>Promise.all([w.requestsCache.delete(U),z]),z=>Promise.all([w.requestsCache.delete(U),Promise.reject(z)])).then(([z,te])=>te)),{miss:z=>w.responsesCache.set(U,z)})},write(D,b){return Iye(w,w.hosts.filter(C=>(C.accept&AB.Write)!==0),D,B6(b,w.timeouts.write))}};return w}function Pdt(t){let e={value:`Algolia for JavaScript (${t})`,add(r){let o=`; ${r.segment}${r.version!==void 0?` (${r.version})`:""}`;return e.value.indexOf(o)===-1&&(e.value=`${e.value}${o}`),e}};return e}function Pye(t){try{return JSON.parse(t.content)}catch(e){throw Rye(e.message,t)}}function Sye({content:t,status:e},r){let o=t;try{o=JSON.parse(t).message}catch{}return Fye(o,e,r)}function Sdt(t,...e){let r=0;return t.replace(/%s/g,()=>encodeURIComponent(e[r++]))}function xye(t,e,r){let o=bye(r),a=`${t.protocol}://${t.url}/${e.charAt(0)==="/"?e.substr(1):e}`;return o.length&&(a+=`?${o}`),a}function bye(t){let e=r=>Object.prototype.toString.call(r)==="[object Object]"||Object.prototype.toString.call(r)==="[object Array]";return Object.keys(t).map(r=>Sdt("%s=%s",r,e(t[r])?JSON.stringify(t[r]):t[r])).join("&")}function kye(t,e){if(t.method===wye.MethodEnum.Get||t.data===void 0&&e.data===void 0)return;let r=Array.isArray(t.data)?t.data:{...t.data,...e.data};return JSON.stringify(r)}function Qye(t,e){let r={...t.headers,...e.headers},o={};return Object.keys(r).forEach(a=>{let n=r[a];o[a.toLowerCase()]=n}),o}function v6(t){return t.map(e=>S6(e))}function S6(t){let e=t.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...t,request:{...t.request,headers:{...t.request.headers,...e}}}}function Fye(t,e,r){return{name:"ApiError",message:t,status:e,transporterStackTrace:r}}function Rye(t,e){return{name:"DeserializationError",message:t,response:e}}function Tye(t){return{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:t}}Ti.CallEnum=AB;Ti.HostStatusEnum=fC;Ti.createApiError=Fye;Ti.createDeserializationError=Rye;Ti.createMappedRequestOptions=B6;Ti.createRetryError=Tye;Ti.createStatefulHost=D6;Ti.createStatelessHost=P6;Ti.createTransporter=Ddt;Ti.createUserAgent=Pdt;Ti.deserializeFailure=Sye;Ti.deserializeSuccess=Pye;Ti.isStatefulHostTimeouted=Dye;Ti.isStatefulHostUp=vye;Ti.serializeData=kye;Ti.serializeHeaders=Qye;Ti.serializeQueryParameters=bye;Ti.serializeUrl=xye;Ti.stackFrameWithoutCredentials=S6;Ti.stackTraceWithoutCredentials=v6});var fB=_((IYt,Nye)=>{Nye.exports=Lye()});var Oye=_(Mh=>{"use strict";Object.defineProperty(Mh,"__esModule",{value:!0});var pC=cB(),xdt=fB(),pB=uB(),bdt=t=>{let e=t.region||"us",r=pC.createAuth(pC.AuthMode.WithinHeaders,t.appId,t.apiKey),o=xdt.createTransporter({hosts:[{url:`analytics.${e}.algolia.com`}],...t,headers:{...r.headers(),"content-type":"application/json",...t.headers},queryParameters:{...r.queryParameters(),...t.queryParameters}}),a=t.appId;return pC.addMethods({appId:a,transporter:o},t.methods)},kdt=t=>(e,r)=>t.transporter.write({method:pB.MethodEnum.Post,path:"2/abtests",data:e},r),Qdt=t=>(e,r)=>t.transporter.write({method:pB.MethodEnum.Delete,path:pC.encode("2/abtests/%s",e)},r),Fdt=t=>(e,r)=>t.transporter.read({method:pB.MethodEnum.Get,path:pC.encode("2/abtests/%s",e)},r),Rdt=t=>e=>t.transporter.read({method:pB.MethodEnum.Get,path:"2/abtests"},e),Tdt=t=>(e,r)=>t.transporter.write({method:pB.MethodEnum.Post,path:pC.encode("2/abtests/%s/stop",e)},r);Mh.addABTest=kdt;Mh.createAnalyticsClient=bdt;Mh.deleteABTest=Qdt;Mh.getABTest=Fdt;Mh.getABTests=Rdt;Mh.stopABTest=Tdt});var Uye=_((BYt,Mye)=>{Mye.exports=Oye()});var Hye=_(hB=>{"use strict";Object.defineProperty(hB,"__esModule",{value:!0});var x6=cB(),Ldt=fB(),_ye=uB(),Ndt=t=>{let e=t.region||"us",r=x6.createAuth(x6.AuthMode.WithinHeaders,t.appId,t.apiKey),o=Ldt.createTransporter({hosts:[{url:`personalization.${e}.algolia.com`}],...t,headers:{...r.headers(),"content-type":"application/json",...t.headers},queryParameters:{...r.queryParameters(),...t.queryParameters}});return x6.addMethods({appId:t.appId,transporter:o},t.methods)},Odt=t=>e=>t.transporter.read({method:_ye.MethodEnum.Get,path:"1/strategies/personalization"},e),Mdt=t=>(e,r)=>t.transporter.write({method:_ye.MethodEnum.Post,path:"1/strategies/personalization",data:e},r);hB.createPersonalizationClient=Ndt;hB.getPersonalizationStrategy=Odt;hB.setPersonalizationStrategy=Mdt});var jye=_((DYt,qye)=>{qye.exports=Hye()});var nEe=_(Rt=>{"use strict";Object.defineProperty(Rt,"__esModule",{value:!0});var Wt=cB(),Ma=fB(),Dr=uB(),Udt=ve("crypto");function rQ(t){let e=r=>t.request(r).then(o=>{if(t.batch!==void 0&&t.batch(o.hits),!t.shouldStop(o))return o.cursor?e({cursor:o.cursor}):e({page:(r.page||0)+1})});return e({})}var _dt=t=>{let e=t.appId,r=Wt.createAuth(t.authMode!==void 0?t.authMode:Wt.AuthMode.WithinHeaders,e,t.apiKey),o=Ma.createTransporter({hosts:[{url:`${e}-dsn.algolia.net`,accept:Ma.CallEnum.Read},{url:`${e}.algolia.net`,accept:Ma.CallEnum.Write}].concat(Wt.shuffle([{url:`${e}-1.algolianet.com`},{url:`${e}-2.algolianet.com`},{url:`${e}-3.algolianet.com`}])),...t,headers:{...r.headers(),"content-type":"application/x-www-form-urlencoded",...t.headers},queryParameters:{...r.queryParameters(),...t.queryParameters}}),a={transporter:o,appId:e,addAlgoliaAgent(n,u){o.userAgent.add({segment:n,version:u})},clearCache(){return Promise.all([o.requestsCache.clear(),o.responsesCache.clear()]).then(()=>{})}};return Wt.addMethods(a,t.methods)};function Gye(){return{name:"MissingObjectIDError",message:"All objects must have an unique objectID (like a primary key) to be valid. Algolia is also able to generate objectIDs automatically but *it's not recommended*. To do it, use the `{'autoGenerateObjectIDIfNotExist': true}` option."}}function Wye(){return{name:"ObjectNotFoundError",message:"Object not found."}}function Yye(){return{name:"ValidUntilNotFoundError",message:"ValidUntil not found in given secured api key."}}var Hdt=t=>(e,r)=>{let{queryParameters:o,...a}=r||{},n={acl:e,...o!==void 0?{queryParameters:o}:{}},u=(A,p)=>Wt.createRetryablePromise(h=>gB(t)(A.key,p).catch(E=>{if(E.status!==404)throw E;return h()}));return Wt.createWaitablePromise(t.transporter.write({method:Dr.MethodEnum.Post,path:"1/keys",data:n},a),u)},qdt=t=>(e,r,o)=>{let a=Ma.createMappedRequestOptions(o);return a.queryParameters["X-Algolia-User-ID"]=e,t.transporter.write({method:Dr.MethodEnum.Post,path:"1/clusters/mapping",data:{cluster:r}},a)},jdt=t=>(e,r,o)=>t.transporter.write({method:Dr.MethodEnum.Post,path:"1/clusters/mapping/batch",data:{users:e,cluster:r}},o),Gdt=t=>(e,r)=>Wt.createWaitablePromise(t.transporter.write({method:Dr.MethodEnum.Post,path:Wt.encode("/1/dictionaries/%s/batch",e),data:{clearExistingDictionaryEntries:!0,requests:{action:"addEntry",body:[]}}},r),(o,a)=>hC(t)(o.taskID,a)),nQ=t=>(e,r,o)=>{let a=(n,u)=>dB(t)(e,{methods:{waitTask:es}}).waitTask(n.taskID,u);return Wt.createWaitablePromise(t.transporter.write({method:Dr.MethodEnum.Post,path:Wt.encode("1/indexes/%s/operation",e),data:{operation:"copy",destination:r}},o),a)},Wdt=t=>(e,r,o)=>nQ(t)(e,r,{...o,scope:[sQ.Rules]}),Ydt=t=>(e,r,o)=>nQ(t)(e,r,{...o,scope:[sQ.Settings]}),Kdt=t=>(e,r,o)=>nQ(t)(e,r,{...o,scope:[sQ.Synonyms]}),Vdt=t=>(e,r)=>e.method===Dr.MethodEnum.Get?t.transporter.read(e,r):t.transporter.write(e,r),zdt=t=>(e,r)=>{let o=(a,n)=>Wt.createRetryablePromise(u=>gB(t)(e,n).then(u).catch(A=>{if(A.status!==404)throw A}));return Wt.createWaitablePromise(t.transporter.write({method:Dr.MethodEnum.Delete,path:Wt.encode("1/keys/%s",e)},r),o)},Jdt=t=>(e,r,o)=>{let a=r.map(n=>({action:"deleteEntry",body:{objectID:n}}));return Wt.createWaitablePromise(t.transporter.write({method:Dr.MethodEnum.Post,path:Wt.encode("/1/dictionaries/%s/batch",e),data:{clearExistingDictionaryEntries:!1,requests:a}},o),(n,u)=>hC(t)(n.taskID,u))},Xdt=()=>(t,e)=>{let r=Ma.serializeQueryParameters(e),o=Udt.createHmac("sha256",t).update(r).digest("hex");return Buffer.from(o+r).toString("base64")},gB=t=>(e,r)=>t.transporter.read({method:Dr.MethodEnum.Get,path:Wt.encode("1/keys/%s",e)},r),Kye=t=>(e,r)=>t.transporter.read({method:Dr.MethodEnum.Get,path:Wt.encode("1/task/%s",e.toString())},r),Zdt=t=>e=>t.transporter.read({method:Dr.MethodEnum.Get,path:"/1/dictionaries/*/settings"},e),$dt=t=>e=>t.transporter.read({method:Dr.MethodEnum.Get,path:"1/logs"},e),emt=()=>t=>{let e=Buffer.from(t,"base64").toString("ascii"),r=/validUntil=(\d+)/,o=e.match(r);if(o===null)throw Yye();return parseInt(o[1],10)-Math.round(new Date().getTime()/1e3)},tmt=t=>e=>t.transporter.read({method:Dr.MethodEnum.Get,path:"1/clusters/mapping/top"},e),rmt=t=>(e,r)=>t.transporter.read({method:Dr.MethodEnum.Get,path:Wt.encode("1/clusters/mapping/%s",e)},r),nmt=t=>e=>{let{retrieveMappings:r,...o}=e||{};return r===!0&&(o.getClusters=!0),t.transporter.read({method:Dr.MethodEnum.Get,path:"1/clusters/mapping/pending"},o)},dB=t=>(e,r={})=>{let o={transporter:t.transporter,appId:t.appId,indexName:e};return Wt.addMethods(o,r.methods)},imt=t=>e=>t.transporter.read({method:Dr.MethodEnum.Get,path:"1/keys"},e),smt=t=>e=>t.transporter.read({method:Dr.MethodEnum.Get,path:"1/clusters"},e),omt=t=>e=>t.transporter.read({method:Dr.MethodEnum.Get,path:"1/indexes"},e),amt=t=>e=>t.transporter.read({method:Dr.MethodEnum.Get,path:"1/clusters/mapping"},e),lmt=t=>(e,r,o)=>{let a=(n,u)=>dB(t)(e,{methods:{waitTask:es}}).waitTask(n.taskID,u);return Wt.createWaitablePromise(t.transporter.write({method:Dr.MethodEnum.Post,path:Wt.encode("1/indexes/%s/operation",e),data:{operation:"move",destination:r}},o),a)},cmt=t=>(e,r)=>{let o=(a,n)=>Promise.all(Object.keys(a.taskID).map(u=>dB(t)(u,{methods:{waitTask:es}}).waitTask(a.taskID[u],n)));return Wt.createWaitablePromise(t.transporter.write({method:Dr.MethodEnum.Post,path:"1/indexes/*/batch",data:{requests:e}},r),o)},umt=t=>(e,r)=>t.transporter.read({method:Dr.MethodEnum.Post,path:"1/indexes/*/objects",data:{requests:e}},r),Amt=t=>(e,r)=>{let o=e.map(a=>({...a,params:Ma.serializeQueryParameters(a.params||{})}));return t.transporter.read({method:Dr.MethodEnum.Post,path:"1/indexes/*/queries",data:{requests:o},cacheable:!0},r)},fmt=t=>(e,r)=>Promise.all(e.map(o=>{let{facetName:a,facetQuery:n,...u}=o.params;return dB(t)(o.indexName,{methods:{searchForFacetValues:eEe}}).searchForFacetValues(a,n,{...r,...u})})),pmt=t=>(e,r)=>{let o=Ma.createMappedRequestOptions(r);return o.queryParameters["X-Algolia-User-ID"]=e,t.transporter.write({method:Dr.MethodEnum.Delete,path:"1/clusters/mapping"},o)},hmt=t=>(e,r,o)=>{let a=r.map(n=>({action:"addEntry",body:n}));return Wt.createWaitablePromise(t.transporter.write({method:Dr.MethodEnum.Post,path:Wt.encode("/1/dictionaries/%s/batch",e),data:{clearExistingDictionaryEntries:!0,requests:a}},o),(n,u)=>hC(t)(n.taskID,u))},gmt=t=>(e,r)=>{let o=(a,n)=>Wt.createRetryablePromise(u=>gB(t)(e,n).catch(A=>{if(A.status!==404)throw A;return u()}));return Wt.createWaitablePromise(t.transporter.write({method:Dr.MethodEnum.Post,path:Wt.encode("1/keys/%s/restore",e)},r),o)},dmt=t=>(e,r,o)=>{let a=r.map(n=>({action:"addEntry",body:n}));return Wt.createWaitablePromise(t.transporter.write({method:Dr.MethodEnum.Post,path:Wt.encode("/1/dictionaries/%s/batch",e),data:{clearExistingDictionaryEntries:!1,requests:a}},o),(n,u)=>hC(t)(n.taskID,u))},mmt=t=>(e,r,o)=>t.transporter.read({method:Dr.MethodEnum.Post,path:Wt.encode("/1/dictionaries/%s/search",e),data:{query:r},cacheable:!0},o),ymt=t=>(e,r)=>t.transporter.read({method:Dr.MethodEnum.Post,path:"1/clusters/mapping/search",data:{query:e}},r),Emt=t=>(e,r)=>Wt.createWaitablePromise(t.transporter.write({method:Dr.MethodEnum.Put,path:"/1/dictionaries/*/settings",data:e},r),(o,a)=>hC(t)(o.taskID,a)),Cmt=t=>(e,r)=>{let o=Object.assign({},r),{queryParameters:a,...n}=r||{},u=a?{queryParameters:a}:{},A=["acl","indexes","referers","restrictSources","queryParameters","description","maxQueriesPerIPPerHour","maxHitsPerQuery"],p=E=>Object.keys(o).filter(w=>A.indexOf(w)!==-1).every(w=>{if(Array.isArray(E[w])&&Array.isArray(o[w])){let D=E[w];return D.length===o[w].length&&D.every((b,C)=>b===o[w][C])}else return E[w]===o[w]}),h=(E,w)=>Wt.createRetryablePromise(D=>gB(t)(e,w).then(b=>p(b)?Promise.resolve():D()));return Wt.createWaitablePromise(t.transporter.write({method:Dr.MethodEnum.Put,path:Wt.encode("1/keys/%s",e),data:u},n),h)},hC=t=>(e,r)=>Wt.createRetryablePromise(o=>Kye(t)(e,r).then(a=>a.status!=="published"?o():void 0)),Vye=t=>(e,r)=>{let o=(a,n)=>es(t)(a.taskID,n);return Wt.createWaitablePromise(t.transporter.write({method:Dr.MethodEnum.Post,path:Wt.encode("1/indexes/%s/batch",t.indexName),data:{requests:e}},r),o)},Imt=t=>e=>rQ({shouldStop:r=>r.cursor===void 0,...e,request:r=>t.transporter.read({method:Dr.MethodEnum.Post,path:Wt.encode("1/indexes/%s/browse",t.indexName),data:r},e)}),wmt=t=>e=>{let r={hitsPerPage:1e3,...e};return rQ({shouldStop:o=>o.hits.length({...a,hits:a.hits.map(n=>(delete n._highlightResult,n))}))}})},Bmt=t=>e=>{let r={hitsPerPage:1e3,...e};return rQ({shouldStop:o=>o.hits.length({...a,hits:a.hits.map(n=>(delete n._highlightResult,n))}))}})},iQ=t=>(e,r,o)=>{let{batchSize:a,...n}=o||{},u={taskIDs:[],objectIDs:[]},A=(p=0)=>{let h=[],E;for(E=p;E({action:r,body:w})),n).then(w=>(u.objectIDs=u.objectIDs.concat(w.objectIDs),u.taskIDs.push(w.taskID),E++,A(E)))};return Wt.createWaitablePromise(A(),(p,h)=>Promise.all(p.taskIDs.map(E=>es(t)(E,h))))},vmt=t=>e=>Wt.createWaitablePromise(t.transporter.write({method:Dr.MethodEnum.Post,path:Wt.encode("1/indexes/%s/clear",t.indexName)},e),(r,o)=>es(t)(r.taskID,o)),Dmt=t=>e=>{let{forwardToReplicas:r,...o}=e||{},a=Ma.createMappedRequestOptions(o);return r&&(a.queryParameters.forwardToReplicas=1),Wt.createWaitablePromise(t.transporter.write({method:Dr.MethodEnum.Post,path:Wt.encode("1/indexes/%s/rules/clear",t.indexName)},a),(n,u)=>es(t)(n.taskID,u))},Pmt=t=>e=>{let{forwardToReplicas:r,...o}=e||{},a=Ma.createMappedRequestOptions(o);return r&&(a.queryParameters.forwardToReplicas=1),Wt.createWaitablePromise(t.transporter.write({method:Dr.MethodEnum.Post,path:Wt.encode("1/indexes/%s/synonyms/clear",t.indexName)},a),(n,u)=>es(t)(n.taskID,u))},Smt=t=>(e,r)=>Wt.createWaitablePromise(t.transporter.write({method:Dr.MethodEnum.Post,path:Wt.encode("1/indexes/%s/deleteByQuery",t.indexName),data:e},r),(o,a)=>es(t)(o.taskID,a)),xmt=t=>e=>Wt.createWaitablePromise(t.transporter.write({method:Dr.MethodEnum.Delete,path:Wt.encode("1/indexes/%s",t.indexName)},e),(r,o)=>es(t)(r.taskID,o)),bmt=t=>(e,r)=>Wt.createWaitablePromise(zye(t)([e],r).then(o=>({taskID:o.taskIDs[0]})),(o,a)=>es(t)(o.taskID,a)),zye=t=>(e,r)=>{let o=e.map(a=>({objectID:a}));return iQ(t)(o,ed.DeleteObject,r)},kmt=t=>(e,r)=>{let{forwardToReplicas:o,...a}=r||{},n=Ma.createMappedRequestOptions(a);return o&&(n.queryParameters.forwardToReplicas=1),Wt.createWaitablePromise(t.transporter.write({method:Dr.MethodEnum.Delete,path:Wt.encode("1/indexes/%s/rules/%s",t.indexName,e)},n),(u,A)=>es(t)(u.taskID,A))},Qmt=t=>(e,r)=>{let{forwardToReplicas:o,...a}=r||{},n=Ma.createMappedRequestOptions(a);return o&&(n.queryParameters.forwardToReplicas=1),Wt.createWaitablePromise(t.transporter.write({method:Dr.MethodEnum.Delete,path:Wt.encode("1/indexes/%s/synonyms/%s",t.indexName,e)},n),(u,A)=>es(t)(u.taskID,A))},Fmt=t=>e=>Jye(t)(e).then(()=>!0).catch(r=>{if(r.status!==404)throw r;return!1}),Rmt=t=>(e,r,o)=>t.transporter.read({method:Dr.MethodEnum.Post,path:Wt.encode("1/answers/%s/prediction",t.indexName),data:{query:e,queryLanguages:r},cacheable:!0},o),Tmt=t=>(e,r)=>{let{query:o,paginate:a,...n}=r||{},u=0,A=()=>$ye(t)(o||"",{...n,page:u}).then(p=>{for(let[h,E]of Object.entries(p.hits))if(e(E))return{object:E,position:parseInt(h,10),page:u};if(u++,a===!1||u>=p.nbPages)throw Wye();return A()});return A()},Lmt=t=>(e,r)=>t.transporter.read({method:Dr.MethodEnum.Get,path:Wt.encode("1/indexes/%s/%s",t.indexName,e)},r),Nmt=()=>(t,e)=>{for(let[r,o]of Object.entries(t.hits))if(o.objectID===e)return parseInt(r,10);return-1},Omt=t=>(e,r)=>{let{attributesToRetrieve:o,...a}=r||{},n=e.map(u=>({indexName:t.indexName,objectID:u,...o?{attributesToRetrieve:o}:{}}));return t.transporter.read({method:Dr.MethodEnum.Post,path:"1/indexes/*/objects",data:{requests:n}},a)},Mmt=t=>(e,r)=>t.transporter.read({method:Dr.MethodEnum.Get,path:Wt.encode("1/indexes/%s/rules/%s",t.indexName,e)},r),Jye=t=>e=>t.transporter.read({method:Dr.MethodEnum.Get,path:Wt.encode("1/indexes/%s/settings",t.indexName),data:{getVersion:2}},e),Umt=t=>(e,r)=>t.transporter.read({method:Dr.MethodEnum.Get,path:Wt.encode("1/indexes/%s/synonyms/%s",t.indexName,e)},r),Xye=t=>(e,r)=>t.transporter.read({method:Dr.MethodEnum.Get,path:Wt.encode("1/indexes/%s/task/%s",t.indexName,e.toString())},r),_mt=t=>(e,r)=>Wt.createWaitablePromise(Zye(t)([e],r).then(o=>({objectID:o.objectIDs[0],taskID:o.taskIDs[0]})),(o,a)=>es(t)(o.taskID,a)),Zye=t=>(e,r)=>{let{createIfNotExists:o,...a}=r||{},n=o?ed.PartialUpdateObject:ed.PartialUpdateObjectNoCreate;return iQ(t)(e,n,a)},Hmt=t=>(e,r)=>{let{safe:o,autoGenerateObjectIDIfNotExist:a,batchSize:n,...u}=r||{},A=(C,T,N,U)=>Wt.createWaitablePromise(t.transporter.write({method:Dr.MethodEnum.Post,path:Wt.encode("1/indexes/%s/operation",C),data:{operation:N,destination:T}},U),(z,te)=>es(t)(z.taskID,te)),p=Math.random().toString(36).substring(7),h=`${t.indexName}_tmp_${p}`,E=b6({appId:t.appId,transporter:t.transporter,indexName:h}),w=[],D=A(t.indexName,h,"copy",{...u,scope:["settings","synonyms","rules"]});w.push(D);let b=(o?D.wait(u):D).then(()=>{let C=E(e,{...u,autoGenerateObjectIDIfNotExist:a,batchSize:n});return w.push(C),o?C.wait(u):C}).then(()=>{let C=A(h,t.indexName,"move",u);return w.push(C),o?C.wait(u):C}).then(()=>Promise.all(w)).then(([C,T,N])=>({objectIDs:T.objectIDs,taskIDs:[C.taskID,...T.taskIDs,N.taskID]}));return Wt.createWaitablePromise(b,(C,T)=>Promise.all(w.map(N=>N.wait(T))))},qmt=t=>(e,r)=>k6(t)(e,{...r,clearExistingRules:!0}),jmt=t=>(e,r)=>Q6(t)(e,{...r,clearExistingSynonyms:!0}),Gmt=t=>(e,r)=>Wt.createWaitablePromise(b6(t)([e],r).then(o=>({objectID:o.objectIDs[0],taskID:o.taskIDs[0]})),(o,a)=>es(t)(o.taskID,a)),b6=t=>(e,r)=>{let{autoGenerateObjectIDIfNotExist:o,...a}=r||{},n=o?ed.AddObject:ed.UpdateObject;if(n===ed.UpdateObject){for(let u of e)if(u.objectID===void 0)return Wt.createWaitablePromise(Promise.reject(Gye()))}return iQ(t)(e,n,a)},Wmt=t=>(e,r)=>k6(t)([e],r),k6=t=>(e,r)=>{let{forwardToReplicas:o,clearExistingRules:a,...n}=r||{},u=Ma.createMappedRequestOptions(n);return o&&(u.queryParameters.forwardToReplicas=1),a&&(u.queryParameters.clearExistingRules=1),Wt.createWaitablePromise(t.transporter.write({method:Dr.MethodEnum.Post,path:Wt.encode("1/indexes/%s/rules/batch",t.indexName),data:e},u),(A,p)=>es(t)(A.taskID,p))},Ymt=t=>(e,r)=>Q6(t)([e],r),Q6=t=>(e,r)=>{let{forwardToReplicas:o,clearExistingSynonyms:a,replaceExistingSynonyms:n,...u}=r||{},A=Ma.createMappedRequestOptions(u);return o&&(A.queryParameters.forwardToReplicas=1),(n||a)&&(A.queryParameters.replaceExistingSynonyms=1),Wt.createWaitablePromise(t.transporter.write({method:Dr.MethodEnum.Post,path:Wt.encode("1/indexes/%s/synonyms/batch",t.indexName),data:e},A),(p,h)=>es(t)(p.taskID,h))},$ye=t=>(e,r)=>t.transporter.read({method:Dr.MethodEnum.Post,path:Wt.encode("1/indexes/%s/query",t.indexName),data:{query:e},cacheable:!0},r),eEe=t=>(e,r,o)=>t.transporter.read({method:Dr.MethodEnum.Post,path:Wt.encode("1/indexes/%s/facets/%s/query",t.indexName,e),data:{facetQuery:r},cacheable:!0},o),tEe=t=>(e,r)=>t.transporter.read({method:Dr.MethodEnum.Post,path:Wt.encode("1/indexes/%s/rules/search",t.indexName),data:{query:e}},r),rEe=t=>(e,r)=>t.transporter.read({method:Dr.MethodEnum.Post,path:Wt.encode("1/indexes/%s/synonyms/search",t.indexName),data:{query:e}},r),Kmt=t=>(e,r)=>{let{forwardToReplicas:o,...a}=r||{},n=Ma.createMappedRequestOptions(a);return o&&(n.queryParameters.forwardToReplicas=1),Wt.createWaitablePromise(t.transporter.write({method:Dr.MethodEnum.Put,path:Wt.encode("1/indexes/%s/settings",t.indexName),data:e},n),(u,A)=>es(t)(u.taskID,A))},es=t=>(e,r)=>Wt.createRetryablePromise(o=>Xye(t)(e,r).then(a=>a.status!=="published"?o():void 0)),Vmt={AddObject:"addObject",Analytics:"analytics",Browser:"browse",DeleteIndex:"deleteIndex",DeleteObject:"deleteObject",EditSettings:"editSettings",Inference:"inference",ListIndexes:"listIndexes",Logs:"logs",Personalization:"personalization",Recommendation:"recommendation",Search:"search",SeeUnretrievableAttributes:"seeUnretrievableAttributes",Settings:"settings",Usage:"usage"},ed={AddObject:"addObject",UpdateObject:"updateObject",PartialUpdateObject:"partialUpdateObject",PartialUpdateObjectNoCreate:"partialUpdateObjectNoCreate",DeleteObject:"deleteObject",DeleteIndex:"delete",ClearIndex:"clear"},sQ={Settings:"settings",Synonyms:"synonyms",Rules:"rules"},zmt={None:"none",StopIfEnoughMatches:"stopIfEnoughMatches"},Jmt={Synonym:"synonym",OneWaySynonym:"oneWaySynonym",AltCorrection1:"altCorrection1",AltCorrection2:"altCorrection2",Placeholder:"placeholder"};Rt.ApiKeyACLEnum=Vmt;Rt.BatchActionEnum=ed;Rt.ScopeEnum=sQ;Rt.StrategyEnum=zmt;Rt.SynonymEnum=Jmt;Rt.addApiKey=Hdt;Rt.assignUserID=qdt;Rt.assignUserIDs=jdt;Rt.batch=Vye;Rt.browseObjects=Imt;Rt.browseRules=wmt;Rt.browseSynonyms=Bmt;Rt.chunkedBatch=iQ;Rt.clearDictionaryEntries=Gdt;Rt.clearObjects=vmt;Rt.clearRules=Dmt;Rt.clearSynonyms=Pmt;Rt.copyIndex=nQ;Rt.copyRules=Wdt;Rt.copySettings=Ydt;Rt.copySynonyms=Kdt;Rt.createBrowsablePromise=rQ;Rt.createMissingObjectIDError=Gye;Rt.createObjectNotFoundError=Wye;Rt.createSearchClient=_dt;Rt.createValidUntilNotFoundError=Yye;Rt.customRequest=Vdt;Rt.deleteApiKey=zdt;Rt.deleteBy=Smt;Rt.deleteDictionaryEntries=Jdt;Rt.deleteIndex=xmt;Rt.deleteObject=bmt;Rt.deleteObjects=zye;Rt.deleteRule=kmt;Rt.deleteSynonym=Qmt;Rt.exists=Fmt;Rt.findAnswers=Rmt;Rt.findObject=Tmt;Rt.generateSecuredApiKey=Xdt;Rt.getApiKey=gB;Rt.getAppTask=Kye;Rt.getDictionarySettings=Zdt;Rt.getLogs=$dt;Rt.getObject=Lmt;Rt.getObjectPosition=Nmt;Rt.getObjects=Omt;Rt.getRule=Mmt;Rt.getSecuredApiKeyRemainingValidity=emt;Rt.getSettings=Jye;Rt.getSynonym=Umt;Rt.getTask=Xye;Rt.getTopUserIDs=tmt;Rt.getUserID=rmt;Rt.hasPendingMappings=nmt;Rt.initIndex=dB;Rt.listApiKeys=imt;Rt.listClusters=smt;Rt.listIndices=omt;Rt.listUserIDs=amt;Rt.moveIndex=lmt;Rt.multipleBatch=cmt;Rt.multipleGetObjects=umt;Rt.multipleQueries=Amt;Rt.multipleSearchForFacetValues=fmt;Rt.partialUpdateObject=_mt;Rt.partialUpdateObjects=Zye;Rt.removeUserID=pmt;Rt.replaceAllObjects=Hmt;Rt.replaceAllRules=qmt;Rt.replaceAllSynonyms=jmt;Rt.replaceDictionaryEntries=hmt;Rt.restoreApiKey=gmt;Rt.saveDictionaryEntries=dmt;Rt.saveObject=Gmt;Rt.saveObjects=b6;Rt.saveRule=Wmt;Rt.saveRules=k6;Rt.saveSynonym=Ymt;Rt.saveSynonyms=Q6;Rt.search=$ye;Rt.searchDictionaryEntries=mmt;Rt.searchForFacetValues=eEe;Rt.searchRules=tEe;Rt.searchSynonyms=rEe;Rt.searchUserIDs=ymt;Rt.setDictionarySettings=Emt;Rt.setSettings=Kmt;Rt.updateApiKey=Cmt;Rt.waitAppTask=hC;Rt.waitTask=es});var sEe=_((SYt,iEe)=>{iEe.exports=nEe()});var oEe=_(oQ=>{"use strict";Object.defineProperty(oQ,"__esModule",{value:!0});function Xmt(){return{debug(t,e){return Promise.resolve()},info(t,e){return Promise.resolve()},error(t,e){return Promise.resolve()}}}var Zmt={Debug:1,Info:2,Error:3};oQ.LogLevelEnum=Zmt;oQ.createNullLogger=Xmt});var lEe=_((bYt,aEe)=>{aEe.exports=oEe()});var fEe=_(F6=>{"use strict";Object.defineProperty(F6,"__esModule",{value:!0});var cEe=ve("http"),uEe=ve("https"),$mt=ve("url"),AEe={keepAlive:!0},eyt=new cEe.Agent(AEe),tyt=new uEe.Agent(AEe);function ryt({agent:t,httpAgent:e,httpsAgent:r,requesterOptions:o={}}={}){let a=e||t||eyt,n=r||t||tyt;return{send(u){return new Promise(A=>{let p=$mt.parse(u.url),h=p.query===null?p.pathname:`${p.pathname}?${p.query}`,E={...o,agent:p.protocol==="https:"?n:a,hostname:p.hostname,path:h,method:u.method,headers:{...o&&o.headers?o.headers:{},...u.headers},...p.port!==void 0?{port:p.port||""}:{}},w=(p.protocol==="https:"?uEe:cEe).request(E,T=>{let N=[];T.on("data",U=>{N=N.concat(U)}),T.on("end",()=>{clearTimeout(b),clearTimeout(C),A({status:T.statusCode||0,content:Buffer.concat(N).toString(),isTimedOut:!1})})}),D=(T,N)=>setTimeout(()=>{w.abort(),A({status:0,content:N,isTimedOut:!0})},T*1e3),b=D(u.connectTimeout,"Connection timeout"),C;w.on("error",T=>{clearTimeout(b),clearTimeout(C),A({status:0,content:T.message,isTimedOut:!1})}),w.once("response",()=>{clearTimeout(b),C=D(u.responseTimeout,"Socket timeout")}),u.data!==void 0&&w.write(u.data),w.end()})},destroy(){return a.destroy(),n.destroy(),Promise.resolve()}}}F6.createNodeHttpRequester=ryt});var hEe=_((QYt,pEe)=>{pEe.exports=fEe()});var yEe=_((FYt,mEe)=>{"use strict";var gEe=fye(),nyt=gye(),gC=Uye(),T6=cB(),R6=jye(),Ht=sEe(),iyt=lEe(),syt=hEe(),oyt=fB();function dEe(t,e,r){let o={appId:t,apiKey:e,timeouts:{connect:2,read:5,write:30},requester:syt.createNodeHttpRequester(),logger:iyt.createNullLogger(),responsesCache:gEe.createNullCache(),requestsCache:gEe.createNullCache(),hostsCache:nyt.createInMemoryCache(),userAgent:oyt.createUserAgent(T6.version).add({segment:"Node.js",version:process.versions.node})},a={...o,...r},n=()=>u=>R6.createPersonalizationClient({...o,...u,methods:{getPersonalizationStrategy:R6.getPersonalizationStrategy,setPersonalizationStrategy:R6.setPersonalizationStrategy}});return Ht.createSearchClient({...a,methods:{search:Ht.multipleQueries,searchForFacetValues:Ht.multipleSearchForFacetValues,multipleBatch:Ht.multipleBatch,multipleGetObjects:Ht.multipleGetObjects,multipleQueries:Ht.multipleQueries,copyIndex:Ht.copyIndex,copySettings:Ht.copySettings,copyRules:Ht.copyRules,copySynonyms:Ht.copySynonyms,moveIndex:Ht.moveIndex,listIndices:Ht.listIndices,getLogs:Ht.getLogs,listClusters:Ht.listClusters,multipleSearchForFacetValues:Ht.multipleSearchForFacetValues,getApiKey:Ht.getApiKey,addApiKey:Ht.addApiKey,listApiKeys:Ht.listApiKeys,updateApiKey:Ht.updateApiKey,deleteApiKey:Ht.deleteApiKey,restoreApiKey:Ht.restoreApiKey,assignUserID:Ht.assignUserID,assignUserIDs:Ht.assignUserIDs,getUserID:Ht.getUserID,searchUserIDs:Ht.searchUserIDs,listUserIDs:Ht.listUserIDs,getTopUserIDs:Ht.getTopUserIDs,removeUserID:Ht.removeUserID,hasPendingMappings:Ht.hasPendingMappings,generateSecuredApiKey:Ht.generateSecuredApiKey,getSecuredApiKeyRemainingValidity:Ht.getSecuredApiKeyRemainingValidity,destroy:T6.destroy,clearDictionaryEntries:Ht.clearDictionaryEntries,deleteDictionaryEntries:Ht.deleteDictionaryEntries,getDictionarySettings:Ht.getDictionarySettings,getAppTask:Ht.getAppTask,replaceDictionaryEntries:Ht.replaceDictionaryEntries,saveDictionaryEntries:Ht.saveDictionaryEntries,searchDictionaryEntries:Ht.searchDictionaryEntries,setDictionarySettings:Ht.setDictionarySettings,waitAppTask:Ht.waitAppTask,customRequest:Ht.customRequest,initIndex:u=>A=>Ht.initIndex(u)(A,{methods:{batch:Ht.batch,delete:Ht.deleteIndex,findAnswers:Ht.findAnswers,getObject:Ht.getObject,getObjects:Ht.getObjects,saveObject:Ht.saveObject,saveObjects:Ht.saveObjects,search:Ht.search,searchForFacetValues:Ht.searchForFacetValues,waitTask:Ht.waitTask,setSettings:Ht.setSettings,getSettings:Ht.getSettings,partialUpdateObject:Ht.partialUpdateObject,partialUpdateObjects:Ht.partialUpdateObjects,deleteObject:Ht.deleteObject,deleteObjects:Ht.deleteObjects,deleteBy:Ht.deleteBy,clearObjects:Ht.clearObjects,browseObjects:Ht.browseObjects,getObjectPosition:Ht.getObjectPosition,findObject:Ht.findObject,exists:Ht.exists,saveSynonym:Ht.saveSynonym,saveSynonyms:Ht.saveSynonyms,getSynonym:Ht.getSynonym,searchSynonyms:Ht.searchSynonyms,browseSynonyms:Ht.browseSynonyms,deleteSynonym:Ht.deleteSynonym,clearSynonyms:Ht.clearSynonyms,replaceAllObjects:Ht.replaceAllObjects,replaceAllSynonyms:Ht.replaceAllSynonyms,searchRules:Ht.searchRules,getRule:Ht.getRule,deleteRule:Ht.deleteRule,saveRule:Ht.saveRule,saveRules:Ht.saveRules,replaceAllRules:Ht.replaceAllRules,browseRules:Ht.browseRules,clearRules:Ht.clearRules}}),initAnalytics:()=>u=>gC.createAnalyticsClient({...o,...u,methods:{addABTest:gC.addABTest,getABTest:gC.getABTest,getABTests:gC.getABTests,stopABTest:gC.stopABTest,deleteABTest:gC.deleteABTest}}),initPersonalization:n,initRecommendation:()=>u=>(a.logger.info("The `initRecommendation` method is deprecated. Use `initPersonalization` instead."),n()(u))}})}dEe.version=T6.version;mEe.exports=dEe});var N6=_((RYt,L6)=>{var EEe=yEe();L6.exports=EEe;L6.exports.default=EEe});var U6=_((LYt,wEe)=>{"use strict";var IEe=Object.getOwnPropertySymbols,lyt=Object.prototype.hasOwnProperty,cyt=Object.prototype.propertyIsEnumerable;function uyt(t){if(t==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function Ayt(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de",Object.getOwnPropertyNames(t)[0]==="5")return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;var o=Object.getOwnPropertyNames(e).map(function(n){return e[n]});if(o.join("")!=="0123456789")return!1;var a={};return"abcdefghijklmnopqrst".split("").forEach(function(n){a[n]=n}),Object.keys(Object.assign({},a)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}wEe.exports=Ayt()?Object.assign:function(t,e){for(var r,o=uyt(t),a,n=1;n{"use strict";var H6=U6(),dC=60103,DEe=60106;Cn.Fragment=60107;Cn.StrictMode=60108;Cn.Profiler=60114;var PEe=60109,SEe=60110,xEe=60112;Cn.Suspense=60113;var bEe=60115,kEe=60116;typeof Symbol=="function"&&Symbol.for&&(sc=Symbol.for,dC=sc("react.element"),DEe=sc("react.portal"),Cn.Fragment=sc("react.fragment"),Cn.StrictMode=sc("react.strict_mode"),Cn.Profiler=sc("react.profiler"),PEe=sc("react.provider"),SEe=sc("react.context"),xEe=sc("react.forward_ref"),Cn.Suspense=sc("react.suspense"),bEe=sc("react.memo"),kEe=sc("react.lazy"));var sc,BEe=typeof Symbol=="function"&&Symbol.iterator;function fyt(t){return t===null||typeof t!="object"?null:(t=BEe&&t[BEe]||t["@@iterator"],typeof t=="function"?t:null)}function mB(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,r=1;r{"use strict";UEe.exports=MEe()});var K6=_((MYt,Y6)=>{"use strict";var gn=Y6.exports;Y6.exports.default=gn;var Gn="\x1B[",yB="\x1B]",yC="\x07",cQ=";",_Ee=process.env.TERM_PROGRAM==="Apple_Terminal";gn.cursorTo=(t,e)=>{if(typeof t!="number")throw new TypeError("The `x` argument is required");return typeof e!="number"?Gn+(t+1)+"G":Gn+(e+1)+";"+(t+1)+"H"};gn.cursorMove=(t,e)=>{if(typeof t!="number")throw new TypeError("The `x` argument is required");let r="";return t<0?r+=Gn+-t+"D":t>0&&(r+=Gn+t+"C"),e<0?r+=Gn+-e+"A":e>0&&(r+=Gn+e+"B"),r};gn.cursorUp=(t=1)=>Gn+t+"A";gn.cursorDown=(t=1)=>Gn+t+"B";gn.cursorForward=(t=1)=>Gn+t+"C";gn.cursorBackward=(t=1)=>Gn+t+"D";gn.cursorLeft=Gn+"G";gn.cursorSavePosition=_Ee?"\x1B7":Gn+"s";gn.cursorRestorePosition=_Ee?"\x1B8":Gn+"u";gn.cursorGetPosition=Gn+"6n";gn.cursorNextLine=Gn+"E";gn.cursorPrevLine=Gn+"F";gn.cursorHide=Gn+"?25l";gn.cursorShow=Gn+"?25h";gn.eraseLines=t=>{let e="";for(let r=0;r[yB,"8",cQ,cQ,e,yC,t,yB,"8",cQ,cQ,yC].join("");gn.image=(t,e={})=>{let r=`${yB}1337;File=inline=1`;return e.width&&(r+=`;width=${e.width}`),e.height&&(r+=`;height=${e.height}`),e.preserveAspectRatio===!1&&(r+=";preserveAspectRatio=0"),r+":"+t.toString("base64")+yC};gn.iTerm={setCwd:(t=process.cwd())=>`${yB}50;CurrentDir=${t}${yC}`,annotation:(t,e={})=>{let r=`${yB}1337;`,o=typeof e.x<"u",a=typeof e.y<"u";if((o||a)&&!(o&&a&&typeof e.length<"u"))throw new Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");return t=t.replace(/\|/g,""),r+=e.isHidden?"AddHiddenAnnotation=":"AddAnnotation=",e.length>0?r+=(o?[t,e.length,e.x,e.y]:[e.length,t]).join("|"):r+=t,r+yC}}});var qEe=_((UYt,V6)=>{"use strict";var HEe=(t,e)=>{for(let r of Reflect.ownKeys(e))Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(e,r));return t};V6.exports=HEe;V6.exports.default=HEe});var GEe=_((_Yt,AQ)=>{"use strict";var myt=qEe(),uQ=new WeakMap,jEe=(t,e={})=>{if(typeof t!="function")throw new TypeError("Expected a function");let r,o=0,a=t.displayName||t.name||"",n=function(...u){if(uQ.set(n,++o),o===1)r=t.apply(this,u),t=null;else if(e.throw===!0)throw new Error(`Function \`${a}\` can only be called once`);return r};return myt(n,t),uQ.set(n,o),n};AQ.exports=jEe;AQ.exports.default=jEe;AQ.exports.callCount=t=>{if(!uQ.has(t))throw new Error(`The given function \`${t.name}\` is not wrapped by the \`onetime\` package`);return uQ.get(t)}});var WEe=_((HYt,fQ)=>{fQ.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&fQ.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&fQ.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var X6=_((qYt,IC)=>{var wi=global.process,td=function(t){return t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function"};td(wi)?(YEe=ve("assert"),EC=WEe(),KEe=/^win/i.test(wi.platform),EB=ve("events"),typeof EB!="function"&&(EB=EB.EventEmitter),wi.__signal_exit_emitter__?ks=wi.__signal_exit_emitter__:(ks=wi.__signal_exit_emitter__=new EB,ks.count=0,ks.emitted={}),ks.infinite||(ks.setMaxListeners(1/0),ks.infinite=!0),IC.exports=function(t,e){if(!td(global.process))return function(){};YEe.equal(typeof t,"function","a callback must be provided for exit handler"),CC===!1&&z6();var r="exit";e&&e.alwaysLast&&(r="afterexit");var o=function(){ks.removeListener(r,t),ks.listeners("exit").length===0&&ks.listeners("afterexit").length===0&&pQ()};return ks.on(r,t),o},pQ=function(){!CC||!td(global.process)||(CC=!1,EC.forEach(function(e){try{wi.removeListener(e,hQ[e])}catch{}}),wi.emit=gQ,wi.reallyExit=J6,ks.count-=1)},IC.exports.unload=pQ,rd=function(e,r,o){ks.emitted[e]||(ks.emitted[e]=!0,ks.emit(e,r,o))},hQ={},EC.forEach(function(t){hQ[t]=function(){if(td(global.process)){var r=wi.listeners(t);r.length===ks.count&&(pQ(),rd("exit",null,t),rd("afterexit",null,t),KEe&&t==="SIGHUP"&&(t="SIGINT"),wi.kill(wi.pid,t))}}}),IC.exports.signals=function(){return EC},CC=!1,z6=function(){CC||!td(global.process)||(CC=!0,ks.count+=1,EC=EC.filter(function(e){try{return wi.on(e,hQ[e]),!0}catch{return!1}}),wi.emit=zEe,wi.reallyExit=VEe)},IC.exports.load=z6,J6=wi.reallyExit,VEe=function(e){td(global.process)&&(wi.exitCode=e||0,rd("exit",wi.exitCode,null),rd("afterexit",wi.exitCode,null),J6.call(wi,wi.exitCode))},gQ=wi.emit,zEe=function(e,r){if(e==="exit"&&td(global.process)){r!==void 0&&(wi.exitCode=r);var o=gQ.apply(this,arguments);return rd("exit",wi.exitCode,null),rd("afterexit",wi.exitCode,null),o}else return gQ.apply(this,arguments)}):IC.exports=function(){return function(){}};var YEe,EC,KEe,EB,ks,pQ,rd,hQ,CC,z6,J6,VEe,gQ,zEe});var XEe=_((jYt,JEe)=>{"use strict";var yyt=GEe(),Eyt=X6();JEe.exports=yyt(()=>{Eyt(()=>{process.stderr.write("\x1B[?25h")},{alwaysLast:!0})})});var Z6=_(wC=>{"use strict";var Cyt=XEe(),dQ=!1;wC.show=(t=process.stderr)=>{t.isTTY&&(dQ=!1,t.write("\x1B[?25h"))};wC.hide=(t=process.stderr)=>{t.isTTY&&(Cyt(),dQ=!0,t.write("\x1B[?25l"))};wC.toggle=(t,e)=>{t!==void 0&&(dQ=t),dQ?wC.show(e):wC.hide(e)}});var tCe=_(CB=>{"use strict";var eCe=CB&&CB.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(CB,"__esModule",{value:!0});var ZEe=eCe(K6()),$Ee=eCe(Z6()),Iyt=(t,{showCursor:e=!1}={})=>{let r=0,o="",a=!1,n=u=>{!e&&!a&&($Ee.default.hide(),a=!0);let A=u+` `;A!==o&&(o=A,t.write(ZEe.default.eraseLines(r)+A),r=A.split(` `).length)};return n.clear=()=>{t.write(ZEe.default.eraseLines(r)),o="",r=0},n.done=()=>{o="",r=0,e||($Ee.default.show(),a=!1)},n};CB.default={create:Iyt}});var rCe=_((YYt,wyt)=>{wyt.exports=[{name:"AppVeyor",constant:"APPVEYOR",env:"APPVEYOR",pr:"APPVEYOR_PULL_REQUEST_NUMBER"},{name:"Azure Pipelines",constant:"AZURE_PIPELINES",env:"SYSTEM_TEAMFOUNDATIONCOLLECTIONURI",pr:"SYSTEM_PULLREQUEST_PULLREQUESTID"},{name:"Bamboo",constant:"BAMBOO",env:"bamboo_planKey"},{name:"Bitbucket Pipelines",constant:"BITBUCKET",env:"BITBUCKET_COMMIT",pr:"BITBUCKET_PR_ID"},{name:"Bitrise",constant:"BITRISE",env:"BITRISE_IO",pr:"BITRISE_PULL_REQUEST"},{name:"Buddy",constant:"BUDDY",env:"BUDDY_WORKSPACE_ID",pr:"BUDDY_EXECUTION_PULL_REQUEST_ID"},{name:"Buildkite",constant:"BUILDKITE",env:"BUILDKITE",pr:{env:"BUILDKITE_PULL_REQUEST",ne:"false"}},{name:"CircleCI",constant:"CIRCLE",env:"CIRCLECI",pr:"CIRCLE_PULL_REQUEST"},{name:"Cirrus CI",constant:"CIRRUS",env:"CIRRUS_CI",pr:"CIRRUS_PR"},{name:"AWS CodeBuild",constant:"CODEBUILD",env:"CODEBUILD_BUILD_ARN"},{name:"Codeship",constant:"CODESHIP",env:{CI_NAME:"codeship"}},{name:"Drone",constant:"DRONE",env:"DRONE",pr:{DRONE_BUILD_EVENT:"pull_request"}},{name:"dsari",constant:"DSARI",env:"DSARI"},{name:"GitLab CI",constant:"GITLAB",env:"GITLAB_CI"},{name:"GoCD",constant:"GOCD",env:"GO_PIPELINE_LABEL"},{name:"Hudson",constant:"HUDSON",env:"HUDSON_URL"},{name:"Jenkins",constant:"JENKINS",env:["JENKINS_URL","BUILD_ID"],pr:{any:["ghprbPullId","CHANGE_ID"]}},{name:"Magnum CI",constant:"MAGNUM",env:"MAGNUM"},{name:"Netlify CI",constant:"NETLIFY",env:"NETLIFY_BUILD_BASE",pr:{env:"PULL_REQUEST",ne:"false"}},{name:"Sail CI",constant:"SAIL",env:"SAILCI",pr:"SAIL_PULL_REQUEST_NUMBER"},{name:"Semaphore",constant:"SEMAPHORE",env:"SEMAPHORE",pr:"PULL_REQUEST_NUMBER"},{name:"Shippable",constant:"SHIPPABLE",env:"SHIPPABLE",pr:{IS_PULL_REQUEST:"true"}},{name:"Solano CI",constant:"SOLANO",env:"TDDIUM",pr:"TDDIUM_PR_ID"},{name:"Strider CD",constant:"STRIDER",env:"STRIDER"},{name:"TaskCluster",constant:"TASKCLUSTER",env:["TASK_ID","RUN_ID"]},{name:"TeamCity",constant:"TEAMCITY",env:"TEAMCITY_VERSION"},{name:"Travis CI",constant:"TRAVIS",env:"TRAVIS",pr:{env:"TRAVIS_PULL_REQUEST",ne:"false"}}]});var sCe=_(Cl=>{"use strict";var iCe=rCe(),gA=process.env;Object.defineProperty(Cl,"_vendors",{value:iCe.map(function(t){return t.constant})});Cl.name=null;Cl.isPR=null;iCe.forEach(function(t){var e=Array.isArray(t.env)?t.env:[t.env],r=e.every(function(o){return nCe(o)});if(Cl[t.constant]=r,r)switch(Cl.name=t.name,typeof t.pr){case"string":Cl.isPR=!!gA[t.pr];break;case"object":"env"in t.pr?Cl.isPR=t.pr.env in gA&&gA[t.pr.env]!==t.pr.ne:"any"in t.pr?Cl.isPR=t.pr.any.some(function(o){return!!gA[o]}):Cl.isPR=nCe(t.pr);break;default:Cl.isPR=null}});Cl.isCI=!!(gA.CI||gA.CONTINUOUS_INTEGRATION||gA.BUILD_NUMBER||gA.RUN_ID||Cl.name);function nCe(t){return typeof t=="string"?!!gA[t]:Object.keys(t).every(function(e){return gA[e]===t[e]})}});var aCe=_((VYt,oCe)=>{"use strict";oCe.exports=sCe().isCI});var cCe=_((zYt,lCe)=>{"use strict";var Byt=t=>{let e=new Set;do for(let r of Reflect.ownKeys(t))e.add([t,r]);while((t=Reflect.getPrototypeOf(t))&&t!==Object.prototype);return e};lCe.exports=(t,{include:e,exclude:r}={})=>{let o=a=>{let n=u=>typeof u=="string"?a===u:u.test(a);return e?e.some(n):r?!r.some(n):!0};for(let[a,n]of Byt(t.constructor.prototype)){if(n==="constructor"||!o(n))continue;let u=Reflect.getOwnPropertyDescriptor(a,n);u&&typeof u.value=="function"&&(t[n]=t[n].bind(t))}return t}});var gCe=_(Hn=>{"use strict";var vC,BB,CQ,sq;typeof performance=="object"&&typeof performance.now=="function"?(uCe=performance,Hn.unstable_now=function(){return uCe.now()}):($6=Date,ACe=$6.now(),Hn.unstable_now=function(){return $6.now()-ACe});var uCe,$6,ACe;typeof window>"u"||typeof MessageChannel!="function"?(BC=null,eq=null,tq=function(){if(BC!==null)try{var t=Hn.unstable_now();BC(!0,t),BC=null}catch(e){throw setTimeout(tq,0),e}},vC=function(t){BC!==null?setTimeout(vC,0,t):(BC=t,setTimeout(tq,0))},BB=function(t,e){eq=setTimeout(t,e)},CQ=function(){clearTimeout(eq)},Hn.unstable_shouldYield=function(){return!1},sq=Hn.unstable_forceFrameRate=function(){}):(fCe=window.setTimeout,pCe=window.clearTimeout,typeof console<"u"&&(hCe=window.cancelAnimationFrame,typeof window.requestAnimationFrame!="function"&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),typeof hCe!="function"&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")),IB=!1,wB=null,mQ=-1,rq=5,nq=0,Hn.unstable_shouldYield=function(){return Hn.unstable_now()>=nq},sq=function(){},Hn.unstable_forceFrameRate=function(t){0>t||125>>1,a=t[o];if(a!==void 0&&0EQ(u,r))p!==void 0&&0>EQ(p,u)?(t[o]=p,t[A]=r,o=A):(t[o]=u,t[n]=r,o=n);else if(p!==void 0&&0>EQ(p,r))t[o]=p,t[A]=r,o=A;else break e}}return e}return null}function EQ(t,e){var r=t.sortIndex-e.sortIndex;return r!==0?r:t.id-e.id}var dA=[],Uh=[],vyt=1,oc=null,bo=3,wQ=!1,nd=!1,vB=!1;function aq(t){for(var e=ou(Uh);e!==null;){if(e.callback===null)IQ(Uh);else if(e.startTime<=t)IQ(Uh),e.sortIndex=e.expirationTime,oq(dA,e);else break;e=ou(Uh)}}function lq(t){if(vB=!1,aq(t),!nd)if(ou(dA)!==null)nd=!0,vC(cq);else{var e=ou(Uh);e!==null&&BB(lq,e.startTime-t)}}function cq(t,e){nd=!1,vB&&(vB=!1,CQ()),wQ=!0;var r=bo;try{for(aq(e),oc=ou(dA);oc!==null&&(!(oc.expirationTime>e)||t&&!Hn.unstable_shouldYield());){var o=oc.callback;if(typeof o=="function"){oc.callback=null,bo=oc.priorityLevel;var a=o(oc.expirationTime<=e);e=Hn.unstable_now(),typeof a=="function"?oc.callback=a:oc===ou(dA)&&IQ(dA),aq(e)}else IQ(dA);oc=ou(dA)}if(oc!==null)var n=!0;else{var u=ou(Uh);u!==null&&BB(lq,u.startTime-e),n=!1}return n}finally{oc=null,bo=r,wQ=!1}}var Dyt=sq;Hn.unstable_IdlePriority=5;Hn.unstable_ImmediatePriority=1;Hn.unstable_LowPriority=4;Hn.unstable_NormalPriority=3;Hn.unstable_Profiling=null;Hn.unstable_UserBlockingPriority=2;Hn.unstable_cancelCallback=function(t){t.callback=null};Hn.unstable_continueExecution=function(){nd||wQ||(nd=!0,vC(cq))};Hn.unstable_getCurrentPriorityLevel=function(){return bo};Hn.unstable_getFirstCallbackNode=function(){return ou(dA)};Hn.unstable_next=function(t){switch(bo){case 1:case 2:case 3:var e=3;break;default:e=bo}var r=bo;bo=e;try{return t()}finally{bo=r}};Hn.unstable_pauseExecution=function(){};Hn.unstable_requestPaint=Dyt;Hn.unstable_runWithPriority=function(t,e){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3}var r=bo;bo=t;try{return e()}finally{bo=r}};Hn.unstable_scheduleCallback=function(t,e,r){var o=Hn.unstable_now();switch(typeof r=="object"&&r!==null?(r=r.delay,r=typeof r=="number"&&0o?(t.sortIndex=r,oq(Uh,t),ou(dA)===null&&t===ou(Uh)&&(vB?CQ():vB=!0,BB(lq,r-o))):(t.sortIndex=a,oq(dA,t),nd||wQ||(nd=!0,vC(cq))),t};Hn.unstable_wrapCallback=function(t){var e=bo;return function(){var r=bo;bo=e;try{return t.apply(this,arguments)}finally{bo=r}}}});var uq=_((XYt,dCe)=>{"use strict";dCe.exports=gCe()});var mCe=_((ZYt,DB)=>{DB.exports=function(e){var r={},o=U6(),a=ln(),n=uq();function u(v){for(var P="https://reactjs.org/docs/error-decoder.html?invariant="+v,Q=1;QUe||Y[Be]!==ne[Ue])return` `+Y[Be].replace(" at new "," at ");while(1<=Be&&0<=Ue);break}}}finally{we=!1,Error.prepareStackTrace=Q}return(v=v?v.displayName||v.name:"")?Il(v):""}var wl=[],Bi=-1;function Ls(v){return{current:v}}function Ft(v){0>Bi||(v.current=wl[Bi],wl[Bi]=null,Bi--)}function Bn(v,P){Bi++,wl[Bi]=v.current,v.current=P}var Lo={},ki=Ls(Lo),vi=Ls(!1),sa=Lo;function un(v,P){var Q=v.type.contextTypes;if(!Q)return Lo;var H=v.stateNode;if(H&&H.__reactInternalMemoizedUnmaskedChildContext===P)return H.__reactInternalMemoizedMaskedChildContext;var Y={},ne;for(ne in Q)Y[ne]=P[ne];return H&&(v=v.stateNode,v.__reactInternalMemoizedUnmaskedChildContext=P,v.__reactInternalMemoizedMaskedChildContext=Y),Y}function qn(v){return v=v.childContextTypes,v!=null}function Ec(){Ft(vi),Ft(ki)}function lp(v,P,Q){if(ki.current!==Lo)throw Error(u(168));Bn(ki,P),Bn(vi,Q)}function oa(v,P,Q){var H=v.stateNode;if(v=P.childContextTypes,typeof H.getChildContext!="function")return Q;H=H.getChildContext();for(var Y in H)if(!(Y in v))throw Error(u(108,g(P)||"Unknown",Y));return o({},Q,H)}function aa(v){return v=(v=v.stateNode)&&v.__reactInternalMemoizedMergedChildContext||Lo,sa=ki.current,Bn(ki,v),Bn(vi,vi.current),!0}function la(v,P,Q){var H=v.stateNode;if(!H)throw Error(u(169));Q?(v=oa(v,P,sa),H.__reactInternalMemoizedMergedChildContext=v,Ft(vi),Ft(ki),Bn(ki,v)):Ft(vi),Bn(vi,Q)}var Ze=null,ca=null,mu=n.unstable_now;mu();var Bl=0,dn=8;function No(v){if(1&v)return dn=15,1;if(2&v)return dn=14,2;if(4&v)return dn=13,4;var P=24&v;return P!==0?(dn=12,P):v&32?(dn=11,32):(P=192&v,P!==0?(dn=10,P):v&256?(dn=9,256):(P=3584&v,P!==0?(dn=8,P):v&4096?(dn=7,4096):(P=4186112&v,P!==0?(dn=6,P):(P=62914560&v,P!==0?(dn=5,P):v&67108864?(dn=4,67108864):v&134217728?(dn=3,134217728):(P=805306368&v,P!==0?(dn=2,P):1073741824&v?(dn=1,1073741824):(dn=8,v))))))}function RA(v){switch(v){case 99:return 15;case 98:return 10;case 97:case 96:return 8;case 95:return 2;default:return 0}}function TA(v){switch(v){case 15:case 14:return 99;case 13:case 12:case 11:case 10:return 98;case 9:case 8:case 7:case 6:case 4:case 5:return 97;case 3:case 2:case 1:return 95;case 0:return 90;default:throw Error(u(358,v))}}function Oo(v,P){var Q=v.pendingLanes;if(Q===0)return dn=0;var H=0,Y=0,ne=v.expiredLanes,Be=v.suspendedLanes,Ue=v.pingedLanes;if(ne!==0)H=ne,Y=dn=15;else if(ne=Q&134217727,ne!==0){var ft=ne&~Be;ft!==0?(H=No(ft),Y=dn):(Ue&=ne,Ue!==0&&(H=No(Ue),Y=dn))}else ne=Q&~Be,ne!==0?(H=No(ne),Y=dn):Ue!==0&&(H=No(Ue),Y=dn);if(H===0)return 0;if(H=31-qi(H),H=Q&((0>H?0:1<Q;Q++)P.push(v);return P}function ua(v,P,Q){v.pendingLanes|=P;var H=P-1;v.suspendedLanes&=H,v.pingedLanes&=H,v=v.eventTimes,P=31-qi(P),v[P]=Q}var qi=Math.clz32?Math.clz32:Dl,vl=Math.log,Cc=Math.LN2;function Dl(v){return v===0?32:31-(vl(v)/Cc|0)|0}var Aa=n.unstable_runWithPriority,Di=n.unstable_scheduleCallback,rs=n.unstable_cancelCallback,ja=n.unstable_shouldYield,yu=n.unstable_requestPaint,Pl=n.unstable_now,pi=n.unstable_getCurrentPriorityLevel,Dn=n.unstable_ImmediatePriority,Sl=n.unstable_UserBlockingPriority,ze=n.unstable_NormalPriority,it=n.unstable_LowPriority,vt=n.unstable_IdlePriority,ar={},ee=yu!==void 0?yu:function(){},ye=null,Ne=null,gt=!1,mt=Pl(),Dt=1e4>mt?Pl:function(){return Pl()-mt};function er(){switch(pi()){case Dn:return 99;case Sl:return 98;case ze:return 97;case it:return 96;case vt:return 95;default:throw Error(u(332))}}function sn(v){switch(v){case 99:return Dn;case 98:return Sl;case 97:return ze;case 96:return it;case 95:return vt;default:throw Error(u(332))}}function ei(v,P){return v=sn(v),Aa(v,P)}function Qi(v,P,Q){return v=sn(v),Di(v,P,Q)}function Pn(){if(Ne!==null){var v=Ne;Ne=null,rs(v)}fa()}function fa(){if(!gt&&ye!==null){gt=!0;var v=0;try{var P=ye;ei(99,function(){for(;vSn?(Tn=xr,xr=null):Tn=xr.sibling;var Yr=Xt($e,xr,pt[Sn],Jt);if(Yr===null){xr===null&&(xr=Tn);break}v&&xr&&Yr.alternate===null&&P($e,xr),je=ne(Yr,je,Sn),Wn===null?Br=Yr:Wn.sibling=Yr,Wn=Yr,xr=Tn}if(Sn===pt.length)return Q($e,xr),Br;if(xr===null){for(;SnSn?(Tn=xr,xr=null):Tn=xr.sibling;var ti=Xt($e,xr,Yr.value,Jt);if(ti===null){xr===null&&(xr=Tn);break}v&&xr&&ti.alternate===null&&P($e,xr),je=ne(ti,je,Sn),Wn===null?Br=ti:Wn.sibling=ti,Wn=ti,xr=Tn}if(Yr.done)return Q($e,xr),Br;if(xr===null){for(;!Yr.done;Sn++,Yr=pt.next())Yr=Tr($e,Yr.value,Jt),Yr!==null&&(je=ne(Yr,je,Sn),Wn===null?Br=Yr:Wn.sibling=Yr,Wn=Yr);return Br}for(xr=H($e,xr);!Yr.done;Sn++,Yr=pt.next())Yr=jn(xr,$e,Sn,Yr.value,Jt),Yr!==null&&(v&&Yr.alternate!==null&&xr.delete(Yr.key===null?Sn:Yr.key),je=ne(Yr,je,Sn),Wn===null?Br=Yr:Wn.sibling=Yr,Wn=Yr);return v&&xr.forEach(function(Rc){return P($e,Rc)}),Br}return function($e,je,pt,Jt){var Br=typeof pt=="object"&&pt!==null&&pt.type===E&&pt.key===null;Br&&(pt=pt.props.children);var Wn=typeof pt=="object"&&pt!==null;if(Wn)switch(pt.$$typeof){case p:e:{for(Wn=pt.key,Br=je;Br!==null;){if(Br.key===Wn){switch(Br.tag){case 7:if(pt.type===E){Q($e,Br.sibling),je=Y(Br,pt.props.children),je.return=$e,$e=je;break e}break;default:if(Br.elementType===pt.type){Q($e,Br.sibling),je=Y(Br,pt.props),je.ref=dt($e,Br,pt),je.return=$e,$e=je;break e}}Q($e,Br);break}else P($e,Br);Br=Br.sibling}pt.type===E?(je=Ru(pt.props.children,$e.mode,Jt,pt.key),je.return=$e,$e=je):(Jt=k0(pt.type,pt.key,pt.props,null,$e.mode,Jt),Jt.ref=dt($e,je,pt),Jt.return=$e,$e=Jt)}return Be($e);case h:e:{for(Br=pt.key;je!==null;){if(je.key===Br)if(je.tag===4&&je.stateNode.containerInfo===pt.containerInfo&&je.stateNode.implementation===pt.implementation){Q($e,je.sibling),je=Y(je,pt.children||[]),je.return=$e,$e=je;break e}else{Q($e,je);break}else P($e,je);je=je.sibling}je=ao(pt,$e.mode,Jt),je.return=$e,$e=je}return Be($e)}if(typeof pt=="string"||typeof pt=="number")return pt=""+pt,je!==null&&je.tag===6?(Q($e,je.sibling),je=Y(je,pt),je.return=$e,$e=je):(Q($e,je),je=ZI(pt,$e.mode,Jt),je.return=$e,$e=je),Be($e);if(Cu(pt))return li($e,je,pt,Jt);if(Ee(pt))return Ea($e,je,pt,Jt);if(Wn&&wc($e,pt),typeof pt>"u"&&!Br)switch($e.tag){case 1:case 22:case 0:case 11:case 15:throw Error(u(152,g($e.type)||"Component"))}return Q($e,je)}}var c0=xd(!0),DI=xd(!1),hp={},cr=Ls(hp),Ni=Ls(hp),Iu=Ls(hp);function pa(v){if(v===hp)throw Error(u(174));return v}function u0(v,P){Bn(Iu,P),Bn(Ni,v),Bn(cr,hp),v=ht(P),Ft(cr),Bn(cr,v)}function Bc(){Ft(cr),Ft(Ni),Ft(Iu)}function wu(v){var P=pa(Iu.current),Q=pa(cr.current);P=q(Q,v.type,P),Q!==P&&(Bn(Ni,v),Bn(cr,P))}function wt(v){Ni.current===v&&(Ft(cr),Ft(Ni))}var oi=Ls(0);function UA(v){for(var P=v;P!==null;){if(P.tag===13){var Q=P.memoizedState;if(Q!==null&&(Q=Q.dehydrated,Q===null||pr(Q)||Me(Q)))return P}else if(P.tag===19&&P.memoizedProps.revealOrder!==void 0){if(P.flags&64)return P}else if(P.child!==null){P.child.return=P,P=P.child;continue}if(P===v)break;for(;P.sibling===null;){if(P.return===null||P.return===v)return null;P=P.return}P.sibling.return=P.return,P=P.sibling}return null}var ha=null,Uo=null,ga=!1;function A0(v,P){var Q=ya(5,null,null,0);Q.elementType="DELETED",Q.type="DELETED",Q.stateNode=P,Q.return=v,Q.flags=8,v.lastEffect!==null?(v.lastEffect.nextEffect=Q,v.lastEffect=Q):v.firstEffect=v.lastEffect=Q}function gp(v,P){switch(v.tag){case 5:return P=To(P,v.type,v.pendingProps),P!==null?(v.stateNode=P,!0):!1;case 6:return P=kA(P,v.pendingProps),P!==null?(v.stateNode=P,!0):!1;case 13:return!1;default:return!1}}function f0(v){if(ga){var P=Uo;if(P){var Q=P;if(!gp(v,P)){if(P=ia(Q),!P||!gp(v,P)){v.flags=v.flags&-1025|2,ga=!1,ha=v;return}A0(ha,Q)}ha=v,Uo=dc(P)}else v.flags=v.flags&-1025|2,ga=!1,ha=v}}function bd(v){for(v=v.return;v!==null&&v.tag!==5&&v.tag!==3&&v.tag!==13;)v=v.return;ha=v}function _A(v){if(!X||v!==ha)return!1;if(!ga)return bd(v),ga=!0,!1;var P=v.type;if(v.tag!==5||P!=="head"&&P!=="body"&&!tt(P,v.memoizedProps))for(P=Uo;P;)A0(v,P),P=ia(P);if(bd(v),v.tag===13){if(!X)throw Error(u(316));if(v=v.memoizedState,v=v!==null?v.dehydrated:null,!v)throw Error(u(317));Uo=QA(v)}else Uo=ha?ia(v.stateNode):null;return!0}function p0(){X&&(Uo=ha=null,ga=!1)}var vc=[];function Dc(){for(var v=0;vne))throw Error(u(301));ne+=1,Ci=ji=null,P.updateQueue=null,Bu.current=re,v=Q(H,Y)}while(vu)}if(Bu.current=bt,P=ji!==null&&ji.next!==null,Pc=0,Ci=ji=On=null,HA=!1,P)throw Error(u(300));return v}function Gi(){var v={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ci===null?On.memoizedState=Ci=v:Ci=Ci.next=v,Ci}function Ka(){if(ji===null){var v=On.alternate;v=v!==null?v.memoizedState:null}else v=ji.next;var P=Ci===null?On.memoizedState:Ci.next;if(P!==null)Ci=P,ji=v;else{if(v===null)throw Error(u(310));ji=v,v={memoizedState:ji.memoizedState,baseState:ji.baseState,baseQueue:ji.baseQueue,queue:ji.queue,next:null},Ci===null?On.memoizedState=Ci=v:Ci=Ci.next=v}return Ci}function io(v,P){return typeof P=="function"?P(v):P}function Du(v){var P=Ka(),Q=P.queue;if(Q===null)throw Error(u(311));Q.lastRenderedReducer=v;var H=ji,Y=H.baseQueue,ne=Q.pending;if(ne!==null){if(Y!==null){var Be=Y.next;Y.next=ne.next,ne.next=Be}H.baseQueue=Y=ne,Q.pending=null}if(Y!==null){Y=Y.next,H=H.baseState;var Ue=Be=ne=null,ft=Y;do{var jt=ft.lane;if((Pc&jt)===jt)Ue!==null&&(Ue=Ue.next={lane:0,action:ft.action,eagerReducer:ft.eagerReducer,eagerState:ft.eagerState,next:null}),H=ft.eagerReducer===v?ft.eagerState:v(H,ft.action);else{var wr={lane:jt,action:ft.action,eagerReducer:ft.eagerReducer,eagerState:ft.eagerState,next:null};Ue===null?(Be=Ue=wr,ne=H):Ue=Ue.next=wr,On.lanes|=jt,B0|=jt}ft=ft.next}while(ft!==null&&ft!==Y);Ue===null?ne=H:Ue.next=Be,eo(H,P.memoizedState)||(Ye=!0),P.memoizedState=H,P.baseState=ne,P.baseQueue=Ue,Q.lastRenderedState=H}return[P.memoizedState,Q.dispatch]}function Pu(v){var P=Ka(),Q=P.queue;if(Q===null)throw Error(u(311));Q.lastRenderedReducer=v;var H=Q.dispatch,Y=Q.pending,ne=P.memoizedState;if(Y!==null){Q.pending=null;var Be=Y=Y.next;do ne=v(ne,Be.action),Be=Be.next;while(Be!==Y);eo(ne,P.memoizedState)||(Ye=!0),P.memoizedState=ne,P.baseQueue===null&&(P.baseState=ne),Q.lastRenderedState=ne}return[ne,H]}function Va(v,P,Q){var H=P._getVersion;H=H(P._source);var Y=y?P._workInProgressVersionPrimary:P._workInProgressVersionSecondary;if(Y!==null?v=Y===H:(v=v.mutableReadLanes,(v=(Pc&v)===v)&&(y?P._workInProgressVersionPrimary=H:P._workInProgressVersionSecondary=H,vc.push(P))),v)return Q(P._source);throw vc.push(P),Error(u(350))}function fn(v,P,Q,H){var Y=Os;if(Y===null)throw Error(u(349));var ne=P._getVersion,Be=ne(P._source),Ue=Bu.current,ft=Ue.useState(function(){return Va(Y,P,Q)}),jt=ft[1],wr=ft[0];ft=Ci;var Tr=v.memoizedState,Xt=Tr.refs,jn=Xt.getSnapshot,li=Tr.source;Tr=Tr.subscribe;var Ea=On;return v.memoizedState={refs:Xt,source:P,subscribe:H},Ue.useEffect(function(){Xt.getSnapshot=Q,Xt.setSnapshot=jt;var $e=ne(P._source);if(!eo(Be,$e)){$e=Q(P._source),eo(wr,$e)||(jt($e),$e=ss(Ea),Y.mutableReadLanes|=$e&Y.pendingLanes),$e=Y.mutableReadLanes,Y.entangledLanes|=$e;for(var je=Y.entanglements,pt=$e;0Q?98:Q,function(){v(!0)}),ei(97qI&&(P.flags|=64,Y=!0,KA(H,!1),P.lanes=33554432)}else{if(!Y)if(v=UA(ne),v!==null){if(P.flags|=64,Y=!0,v=v.updateQueue,v!==null&&(P.updateQueue=v,P.flags|=4),KA(H,!0),H.tail===null&&H.tailMode==="hidden"&&!ne.alternate&&!ga)return P=P.lastEffect=H.lastEffect,P!==null&&(P.nextEffect=null),null}else 2*Dt()-H.renderingStartTime>qI&&Q!==1073741824&&(P.flags|=64,Y=!0,KA(H,!1),P.lanes=33554432);H.isBackwards?(ne.sibling=P.child,P.child=ne):(v=H.last,v!==null?v.sibling=ne:P.child=ne,H.last=ne)}return H.tail!==null?(v=H.tail,H.rendering=v,H.tail=v.sibling,H.lastEffect=P.lastEffect,H.renderingStartTime=Dt(),v.sibling=null,P=oi.current,Bn(oi,Y?P&1|2:P&1),v):null;case 23:case 24:return VI(),v!==null&&v.memoizedState!==null!=(P.memoizedState!==null)&&H.mode!=="unstable-defer-without-hiding"&&(P.flags|=4),null}throw Error(u(156,P.tag))}function qF(v){switch(v.tag){case 1:qn(v.type)&&Ec();var P=v.flags;return P&4096?(v.flags=P&-4097|64,v):null;case 3:if(Bc(),Ft(vi),Ft(ki),Dc(),P=v.flags,P&64)throw Error(u(285));return v.flags=P&-4097|64,v;case 5:return wt(v),null;case 13:return Ft(oi),P=v.flags,P&4096?(v.flags=P&-4097|64,v):null;case 19:return Ft(oi),null;case 4:return Bc(),null;case 10:return a0(v),null;case 23:case 24:return VI(),null;default:return null}}function m0(v,P){try{var Q="",H=P;do Q+=vI(H),H=H.return;while(H);var Y=Q}catch(ne){Y=` Error generating stack: `+ne.message+` `+ne.stack}return{value:v,source:P,stack:Y}}function y0(v,P){try{console.error(P.value)}catch(Q){setTimeout(function(){throw Q})}}var jF=typeof WeakMap=="function"?WeakMap:Map;function bI(v,P,Q){Q=Wa(-1,Q),Q.tag=3,Q.payload={element:null};var H=P.value;return Q.callback=function(){Wd||(Wd=!0,jI=H),y0(v,P)},Q}function E0(v,P,Q){Q=Wa(-1,Q),Q.tag=3;var H=v.type.getDerivedStateFromError;if(typeof H=="function"){var Y=P.value;Q.payload=function(){return y0(v,P),H(Y)}}var ne=v.stateNode;return ne!==null&&typeof ne.componentDidCatch=="function"&&(Q.callback=function(){typeof H!="function"&&(bl===null?bl=new Set([this]):bl.add(this),y0(v,P));var Be=P.stack;this.componentDidCatch(P.value,{componentStack:Be!==null?Be:""})}),Q}var GF=typeof WeakSet=="function"?WeakSet:Set;function kI(v){var P=v.ref;if(P!==null)if(typeof P=="function")try{P(null)}catch(Q){Fu(v,Q)}else P.current=null}function Td(v,P){switch(P.tag){case 0:case 11:case 15:case 22:return;case 1:if(P.flags&256&&v!==null){var Q=v.memoizedProps,H=v.memoizedState;v=P.stateNode,P=v.getSnapshotBeforeUpdate(P.elementType===P.type?Q:to(P.type,Q),H),v.__reactInternalSnapshotBeforeUpdate=P}return;case 3:R&&P.flags&256&&hs(P.stateNode.containerInfo);return;case 5:case 6:case 4:case 17:return}throw Error(u(163))}function wp(v,P){if(P=P.updateQueue,P=P!==null?P.lastEffect:null,P!==null){var Q=P=P.next;do{if((Q.tag&v)===v){var H=Q.destroy;Q.destroy=void 0,H!==void 0&&H()}Q=Q.next}while(Q!==P)}}function uD(v,P,Q){switch(Q.tag){case 0:case 11:case 15:case 22:if(P=Q.updateQueue,P=P!==null?P.lastEffect:null,P!==null){v=P=P.next;do{if((v.tag&3)===3){var H=v.create;v.destroy=H()}v=v.next}while(v!==P)}if(P=Q.updateQueue,P=P!==null?P.lastEffect:null,P!==null){v=P=P.next;do{var Y=v;H=Y.next,Y=Y.tag,Y&4&&Y&1&&(vD(Q,v),$F(Q,v)),v=H}while(v!==P)}return;case 1:v=Q.stateNode,Q.flags&4&&(P===null?v.componentDidMount():(H=Q.elementType===Q.type?P.memoizedProps:to(Q.type,P.memoizedProps),v.componentDidUpdate(H,P.memoizedState,v.__reactInternalSnapshotBeforeUpdate))),P=Q.updateQueue,P!==null&&Pd(Q,P,v);return;case 3:if(P=Q.updateQueue,P!==null){if(v=null,Q.child!==null)switch(Q.child.tag){case 5:v=Re(Q.child.stateNode);break;case 1:v=Q.child.stateNode}Pd(Q,P,v)}return;case 5:v=Q.stateNode,P===null&&Q.flags&4&&Qs(v,Q.type,Q.memoizedProps,Q);return;case 6:return;case 4:return;case 12:return;case 13:X&&Q.memoizedState===null&&(Q=Q.alternate,Q!==null&&(Q=Q.memoizedState,Q!==null&&(Q=Q.dehydrated,Q!==null&&mc(Q))));return;case 19:case 17:case 20:case 21:case 23:case 24:return}throw Error(u(163))}function AD(v,P){if(R)for(var Q=v;;){if(Q.tag===5){var H=Q.stateNode;P?op(H):Rs(Q.stateNode,Q.memoizedProps)}else if(Q.tag===6)H=Q.stateNode,P?ap(H):Nn(H,Q.memoizedProps);else if((Q.tag!==23&&Q.tag!==24||Q.memoizedState===null||Q===v)&&Q.child!==null){Q.child.return=Q,Q=Q.child;continue}if(Q===v)break;for(;Q.sibling===null;){if(Q.return===null||Q.return===v)return;Q=Q.return}Q.sibling.return=Q.return,Q=Q.sibling}}function Ld(v,P){if(ca&&typeof ca.onCommitFiberUnmount=="function")try{ca.onCommitFiberUnmount(Ze,P)}catch{}switch(P.tag){case 0:case 11:case 14:case 15:case 22:if(v=P.updateQueue,v!==null&&(v=v.lastEffect,v!==null)){var Q=v=v.next;do{var H=Q,Y=H.destroy;if(H=H.tag,Y!==void 0)if(H&4)vD(P,Q);else{H=P;try{Y()}catch(ne){Fu(H,ne)}}Q=Q.next}while(Q!==v)}break;case 1:if(kI(P),v=P.stateNode,typeof v.componentWillUnmount=="function")try{v.props=P.memoizedProps,v.state=P.memoizedState,v.componentWillUnmount()}catch(ne){Fu(P,ne)}break;case 5:kI(P);break;case 4:R?gD(v,P):J&&J&&(P=P.stateNode.containerInfo,v=pc(P),xA(P,v))}}function fD(v,P){for(var Q=P;;)if(Ld(v,Q),Q.child===null||R&&Q.tag===4){if(Q===P)break;for(;Q.sibling===null;){if(Q.return===null||Q.return===P)return;Q=Q.return}Q.sibling.return=Q.return,Q=Q.sibling}else Q.child.return=Q,Q=Q.child}function Nd(v){v.alternate=null,v.child=null,v.dependencies=null,v.firstEffect=null,v.lastEffect=null,v.memoizedProps=null,v.memoizedState=null,v.pendingProps=null,v.return=null,v.updateQueue=null}function pD(v){return v.tag===5||v.tag===3||v.tag===4}function hD(v){if(R){e:{for(var P=v.return;P!==null;){if(pD(P))break e;P=P.return}throw Error(u(160))}var Q=P;switch(P=Q.stateNode,Q.tag){case 5:var H=!1;break;case 3:P=P.containerInfo,H=!0;break;case 4:P=P.containerInfo,H=!0;break;default:throw Error(u(161))}Q.flags&16&&(gu(P),Q.flags&=-17);e:t:for(Q=v;;){for(;Q.sibling===null;){if(Q.return===null||pD(Q.return)){Q=null;break e}Q=Q.return}for(Q.sibling.return=Q.return,Q=Q.sibling;Q.tag!==5&&Q.tag!==6&&Q.tag!==18;){if(Q.flags&2||Q.child===null||Q.tag===4)continue t;Q.child.return=Q,Q=Q.child}if(!(Q.flags&2)){Q=Q.stateNode;break e}}H?QI(v,Q,P):FI(v,Q,P)}}function QI(v,P,Q){var H=v.tag,Y=H===5||H===6;if(Y)v=Y?v.stateNode:v.stateNode.instance,P?Fs(Q,v,P):Xs(Q,v);else if(H!==4&&(v=v.child,v!==null))for(QI(v,P,Q),v=v.sibling;v!==null;)QI(v,P,Q),v=v.sibling}function FI(v,P,Q){var H=v.tag,Y=H===5||H===6;if(Y)v=Y?v.stateNode:v.stateNode.instance,P?bi(Q,v,P):$n(Q,v);else if(H!==4&&(v=v.child,v!==null))for(FI(v,P,Q),v=v.sibling;v!==null;)FI(v,P,Q),v=v.sibling}function gD(v,P){for(var Q=P,H=!1,Y,ne;;){if(!H){H=Q.return;e:for(;;){if(H===null)throw Error(u(160));switch(Y=H.stateNode,H.tag){case 5:ne=!1;break e;case 3:Y=Y.containerInfo,ne=!0;break e;case 4:Y=Y.containerInfo,ne=!0;break e}H=H.return}H=!0}if(Q.tag===5||Q.tag===6)fD(v,Q),ne?SA(Y,Q.stateNode):$s(Y,Q.stateNode);else if(Q.tag===4){if(Q.child!==null){Y=Q.stateNode.containerInfo,ne=!0,Q.child.return=Q,Q=Q.child;continue}}else if(Ld(v,Q),Q.child!==null){Q.child.return=Q,Q=Q.child;continue}if(Q===P)break;for(;Q.sibling===null;){if(Q.return===null||Q.return===P)return;Q=Q.return,Q.tag===4&&(H=!1)}Q.sibling.return=Q.return,Q=Q.sibling}}function RI(v,P){if(R){switch(P.tag){case 0:case 11:case 14:case 15:case 22:wp(3,P);return;case 1:return;case 5:var Q=P.stateNode;if(Q!=null){var H=P.memoizedProps;v=v!==null?v.memoizedProps:H;var Y=P.type,ne=P.updateQueue;P.updateQueue=null,ne!==null&&Zs(Q,ne,Y,v,H,P)}return;case 6:if(P.stateNode===null)throw Error(u(162));Q=P.memoizedProps,Hi(P.stateNode,v!==null?v.memoizedProps:Q,Q);return;case 3:X&&(P=P.stateNode,P.hydrate&&(P.hydrate=!1,FA(P.containerInfo)));return;case 12:return;case 13:dD(P),C0(P);return;case 19:C0(P);return;case 17:return;case 23:case 24:AD(P,P.memoizedState!==null);return}throw Error(u(163))}switch(P.tag){case 0:case 11:case 14:case 15:case 22:wp(3,P);return;case 12:return;case 13:dD(P),C0(P);return;case 19:C0(P);return;case 3:X&&(Q=P.stateNode,Q.hydrate&&(Q.hydrate=!1,FA(Q.containerInfo)));break;case 23:case 24:return}e:if(J){switch(P.tag){case 1:case 5:case 6:case 20:break e;case 3:case 4:P=P.stateNode,xA(P.containerInfo,P.pendingChildren);break e}throw Error(u(163))}}function dD(v){v.memoizedState!==null&&(HI=Dt(),R&&AD(v.child,!0))}function C0(v){var P=v.updateQueue;if(P!==null){v.updateQueue=null;var Q=v.stateNode;Q===null&&(Q=v.stateNode=new GF),P.forEach(function(H){var Y=tR.bind(null,v,H);Q.has(H)||(Q.add(H),H.then(Y,Y))})}}function WF(v,P){return v!==null&&(v=v.memoizedState,v===null||v.dehydrated!==null)?(P=P.memoizedState,P!==null&&P.dehydrated===null):!1}var Od=0,Md=1,Ud=2,I0=3,_d=4;if(typeof Symbol=="function"&&Symbol.for){var w0=Symbol.for;Od=w0("selector.component"),Md=w0("selector.has_pseudo_class"),Ud=w0("selector.role"),I0=w0("selector.test_id"),_d=w0("selector.text")}function Hd(v){var P=$(v);if(P!=null){if(typeof P.memoizedProps["data-testname"]!="string")throw Error(u(364));return P}if(v=nr(v),v===null)throw Error(u(362));return v.stateNode.current}function xu(v,P){switch(P.$$typeof){case Od:if(v.type===P.value)return!0;break;case Md:e:{P=P.value,v=[v,0];for(var Q=0;Q";case Md:return":has("+(bu(v)||"")+")";case Ud:return'[role="'+v.value+'"]';case _d:return'"'+v.value+'"';case I0:return'[data-testname="'+v.value+'"]';default:throw Error(u(365,v))}}function TI(v,P){var Q=[];v=[v,0];for(var H=0;HY&&(Y=Be),Q&=~ne}if(Q=Y,Q=Dt()-Q,Q=(120>Q?120:480>Q?480:1080>Q?1080:1920>Q?1920:3e3>Q?3e3:4320>Q?4320:1960*KF(Q/1960))-Q,10 component higher in the tree to provide a loading indicator or placeholder to display.`)}is!==5&&(is=2),ft=m0(ft,Ue),Xt=Be;do{switch(Xt.tag){case 3:ne=ft,Xt.flags|=4096,P&=-P,Xt.lanes|=P;var Wn=bI(Xt,ne,P);Dd(Xt,Wn);break e;case 1:ne=ft;var xr=Xt.type,Sn=Xt.stateNode;if(!(Xt.flags&64)&&(typeof xr.getDerivedStateFromError=="function"||Sn!==null&&typeof Sn.componentDidCatch=="function"&&(bl===null||!bl.has(Sn)))){Xt.flags|=4096,P&=-P,Xt.lanes|=P;var Tn=E0(Xt,ne,P);Dd(Xt,Tn);break e}}Xt=Xt.return}while(Xt!==null)}BD(Q)}catch(Yr){P=Yr,Oi===Q&&Q!==null&&(Oi=Q=Q.return);continue}break}while(!0)}function ID(){var v=jd.current;return jd.current=bt,v===null?bt:v}function b0(v,P){var Q=Sr;Sr|=16;var H=ID();Os===v&&ms===P||Pp(v,P);do try{zF();break}catch(Y){CD(v,Y)}while(!0);if(s0(),Sr=Q,jd.current=H,Oi!==null)throw Error(u(261));return Os=null,ms=0,is}function zF(){for(;Oi!==null;)wD(Oi)}function JF(){for(;Oi!==null&&!ja();)wD(Oi)}function wD(v){var P=SD(v.alternate,v,VA);v.memoizedProps=v.pendingProps,P===null?BD(v):Oi=P,NI.current=null}function BD(v){var P=v;do{var Q=P.alternate;if(v=P.return,P.flags&2048){if(Q=qF(P),Q!==null){Q.flags&=2047,Oi=Q;return}v!==null&&(v.firstEffect=v.lastEffect=null,v.flags|=2048)}else{if(Q=HF(Q,P,VA),Q!==null){Oi=Q;return}if(Q=P,Q.tag!==24&&Q.tag!==23||Q.memoizedState===null||VA&1073741824||!(Q.mode&4)){for(var H=0,Y=Q.child;Y!==null;)H|=Y.lanes|Y.childLanes,Y=Y.sibling;Q.childLanes=H}v!==null&&!(v.flags&2048)&&(v.firstEffect===null&&(v.firstEffect=P.firstEffect),P.lastEffect!==null&&(v.lastEffect!==null&&(v.lastEffect.nextEffect=P.firstEffect),v.lastEffect=P.lastEffect),1Dt()-HI?Pp(v,0):UI|=Q),qo(v,P)}function tR(v,P){var Q=v.stateNode;Q!==null&&Q.delete(P),P=0,P===0&&(P=v.mode,P&2?P&4?(kc===0&&(kc=Bp),P=vn(62914560&~kc),P===0&&(P=4194304)):P=er()===99?1:2:P=1),Q=oo(),v=Vd(v,P),v!==null&&(ua(v,P,Q),qo(v,Q))}var SD;SD=function(v,P,Q){var H=P.lanes;if(v!==null)if(v.memoizedProps!==P.pendingProps||vi.current)Ye=!0;else if(Q&H)Ye=!!(v.flags&16384);else{switch(Ye=!1,P.tag){case 3:Fd(P),p0();break;case 5:wu(P);break;case 1:qn(P.type)&&aa(P);break;case 4:u0(P,P.stateNode.containerInfo);break;case 10:o0(P,P.memoizedProps.value);break;case 13:if(P.memoizedState!==null)return Q&P.child.childLanes?SI(v,P,Q):(Bn(oi,oi.current&1),P=Mn(v,P,Q),P!==null?P.sibling:null);Bn(oi,oi.current&1);break;case 19:if(H=(Q&P.childLanes)!==0,v.flags&64){if(H)return cD(v,P,Q);P.flags|=64}var Y=P.memoizedState;if(Y!==null&&(Y.rendering=null,Y.tail=null,Y.lastEffect=null),Bn(oi,oi.current),H)break;return null;case 23:case 24:return P.lanes=0,ai(v,P,Q)}return Mn(v,P,Q)}else Ye=!1;switch(P.lanes=0,P.tag){case 2:if(H=P.type,v!==null&&(v.alternate=null,P.alternate=null,P.flags|=2),v=P.pendingProps,Y=un(P,ki.current),Eu(P,Q),Y=g0(null,P,H,v,Y,Q),P.flags|=1,typeof Y=="object"&&Y!==null&&typeof Y.render=="function"&&Y.$$typeof===void 0){if(P.tag=1,P.memoizedState=null,P.updateQueue=null,qn(H)){var ne=!0;aa(P)}else ne=!1;P.memoizedState=Y.state!==null&&Y.state!==void 0?Y.state:null,pp(P);var Be=H.getDerivedStateFromProps;typeof Be=="function"&&NA(P,H,Be,v),Y.updater=OA,P.stateNode=Y,Y._reactInternals=P,no(P,H,v,Q),P=PI(null,P,H,!0,ne,Q)}else P.tag=0,At(null,P,Y,Q),P=P.child;return P;case 16:Y=P.elementType;e:{switch(v!==null&&(v.alternate=null,P.alternate=null,P.flags|=2),v=P.pendingProps,ne=Y._init,Y=ne(Y._payload),P.type=Y,ne=P.tag=nR(Y),v=to(Y,v),ne){case 0:P=GA(null,P,Y,v,Q);break e;case 1:P=lD(null,P,Y,v,Q);break e;case 11:P=hr(null,P,Y,v,Q);break e;case 14:P=Ir(null,P,Y,to(Y.type,v),H,Q);break e}throw Error(u(306,Y,""))}return P;case 0:return H=P.type,Y=P.pendingProps,Y=P.elementType===H?Y:to(H,Y),GA(v,P,H,Y,Q);case 1:return H=P.type,Y=P.pendingProps,Y=P.elementType===H?Y:to(H,Y),lD(v,P,H,Y,Q);case 3:if(Fd(P),H=P.updateQueue,v===null||H===null)throw Error(u(282));if(H=P.pendingProps,Y=P.memoizedState,Y=Y!==null?Y.element:null,l0(v,P),LA(P,H,null,Q),H=P.memoizedState.element,H===Y)p0(),P=Mn(v,P,Q);else{if(Y=P.stateNode,(ne=Y.hydrate)&&(X?(Uo=dc(P.stateNode.containerInfo),ha=P,ne=ga=!0):ne=!1),ne){if(X&&(v=Y.mutableSourceEagerHydrationData,v!=null))for(Y=0;Y=jt&&ne>=Tr&&Y<=wr&&Be<=Xt){v.splice(P,1);break}else if(H!==jt||Q.width!==ft.width||XtBe){if(!(ne!==Tr||Q.height!==ft.height||wrY)){jt>H&&(ft.width+=jt-H,ft.x=H),wrne&&(ft.height+=Tr-ne,ft.y=ne),XtQ&&(Q=Be)),Be ")+` No matching component was found for: `)+v.join(" > ")}return null},r.getPublicRootInstance=function(v){if(v=v.current,!v.child)return null;switch(v.child.tag){case 5:return Re(v.child.stateNode);default:return v.child.stateNode}},r.injectIntoDevTools=function(v){if(v={bundleType:v.bundleType,version:v.version,rendererPackageName:v.rendererPackageName,rendererConfig:v.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:A.ReactCurrentDispatcher,findHostInstanceByFiber:sR,findFiberByHostInstance:v.findFiberByHostInstance||oR,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")v=!1;else{var P=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!P.isDisabled&&P.supportsFiber)try{Ze=P.inject(v),ca=P}catch{}v=!0}return v},r.observeVisibleRects=function(v,P,Q,H){if(!qt)throw Error(u(363));v=LI(v,P);var Y=Xr(v,Q,H).disconnect;return{disconnect:function(){Y()}}},r.registerMutableSourceForHydration=function(v,P){var Q=P._getVersion;Q=Q(P._source),v.mutableSourceEagerHydrationData==null?v.mutableSourceEagerHydrationData=[P,Q]:v.mutableSourceEagerHydrationData.push(P,Q)},r.runWithPriority=function(v,P){var Q=Bl;try{return Bl=v,P()}finally{Bl=Q}},r.shouldSuspend=function(){return!1},r.unbatchedUpdates=function(v,P){var Q=Sr;Sr&=-2,Sr|=8;try{return v(P)}finally{Sr=Q,Sr===0&&(ku(),Pn())}},r.updateContainer=function(v,P,Q,H){var Y=P.current,ne=oo(),Be=ss(Y);e:if(Q){Q=Q._reactInternals;t:{if(me(Q)!==Q||Q.tag!==1)throw Error(u(170));var Ue=Q;do{switch(Ue.tag){case 3:Ue=Ue.stateNode.context;break t;case 1:if(qn(Ue.type)){Ue=Ue.stateNode.__reactInternalMemoizedMergedChildContext;break t}}Ue=Ue.return}while(Ue!==null);throw Error(u(171))}if(Q.tag===1){var ft=Q.type;if(qn(ft)){Q=oa(Q,ft,Ue);break e}}Q=Ue}else Q=Lo;return P.context===null?P.context=Q:P.pendingContext=Q,P=Wa(ne,Be),P.payload={element:v},H=H===void 0?null:H,H!==null&&(P.callback=H),Ya(Y,P),Xa(Y,Be,ne),Be},r}});var ECe=_(($Yt,yCe)=>{"use strict";yCe.exports=mCe()});var ICe=_((eKt,CCe)=>{"use strict";var Pyt={ALIGN_COUNT:8,ALIGN_AUTO:0,ALIGN_FLEX_START:1,ALIGN_CENTER:2,ALIGN_FLEX_END:3,ALIGN_STRETCH:4,ALIGN_BASELINE:5,ALIGN_SPACE_BETWEEN:6,ALIGN_SPACE_AROUND:7,DIMENSION_COUNT:2,DIMENSION_WIDTH:0,DIMENSION_HEIGHT:1,DIRECTION_COUNT:3,DIRECTION_INHERIT:0,DIRECTION_LTR:1,DIRECTION_RTL:2,DISPLAY_COUNT:2,DISPLAY_FLEX:0,DISPLAY_NONE:1,EDGE_COUNT:9,EDGE_LEFT:0,EDGE_TOP:1,EDGE_RIGHT:2,EDGE_BOTTOM:3,EDGE_START:4,EDGE_END:5,EDGE_HORIZONTAL:6,EDGE_VERTICAL:7,EDGE_ALL:8,EXPERIMENTAL_FEATURE_COUNT:1,EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS:0,FLEX_DIRECTION_COUNT:4,FLEX_DIRECTION_COLUMN:0,FLEX_DIRECTION_COLUMN_REVERSE:1,FLEX_DIRECTION_ROW:2,FLEX_DIRECTION_ROW_REVERSE:3,JUSTIFY_COUNT:6,JUSTIFY_FLEX_START:0,JUSTIFY_CENTER:1,JUSTIFY_FLEX_END:2,JUSTIFY_SPACE_BETWEEN:3,JUSTIFY_SPACE_AROUND:4,JUSTIFY_SPACE_EVENLY:5,LOG_LEVEL_COUNT:6,LOG_LEVEL_ERROR:0,LOG_LEVEL_WARN:1,LOG_LEVEL_INFO:2,LOG_LEVEL_DEBUG:3,LOG_LEVEL_VERBOSE:4,LOG_LEVEL_FATAL:5,MEASURE_MODE_COUNT:3,MEASURE_MODE_UNDEFINED:0,MEASURE_MODE_EXACTLY:1,MEASURE_MODE_AT_MOST:2,NODE_TYPE_COUNT:2,NODE_TYPE_DEFAULT:0,NODE_TYPE_TEXT:1,OVERFLOW_COUNT:3,OVERFLOW_VISIBLE:0,OVERFLOW_HIDDEN:1,OVERFLOW_SCROLL:2,POSITION_TYPE_COUNT:2,POSITION_TYPE_RELATIVE:0,POSITION_TYPE_ABSOLUTE:1,PRINT_OPTIONS_COUNT:3,PRINT_OPTIONS_LAYOUT:1,PRINT_OPTIONS_STYLE:2,PRINT_OPTIONS_CHILDREN:4,UNIT_COUNT:4,UNIT_UNDEFINED:0,UNIT_POINT:1,UNIT_PERCENT:2,UNIT_AUTO:3,WRAP_COUNT:3,WRAP_NO_WRAP:0,WRAP_WRAP:1,WRAP_WRAP_REVERSE:2};CCe.exports=Pyt});var DCe=_((tKt,vCe)=>{"use strict";var Syt=Object.assign||function(t){for(var e=1;e"}}]),t}(),wCe=function(){BQ(t,null,[{key:"fromJS",value:function(r){var o=r.width,a=r.height;return new t(o,a)}}]);function t(e,r){fq(this,t),this.width=e,this.height=r}return BQ(t,[{key:"fromJS",value:function(r){r(this.width,this.height)}},{key:"toString",value:function(){return""}}]),t}(),BCe=function(){function t(e,r){fq(this,t),this.unit=e,this.value=r}return BQ(t,[{key:"fromJS",value:function(r){r(this.unit,this.value)}},{key:"toString",value:function(){switch(this.unit){case au.UNIT_POINT:return String(this.value);case au.UNIT_PERCENT:return this.value+"%";case au.UNIT_AUTO:return"auto";default:return this.value+"?"}}},{key:"valueOf",value:function(){return this.value}}]),t}();vCe.exports=function(t,e){function r(u,A,p){var h=u[A];u[A]=function(){for(var E=arguments.length,w=Array(E),D=0;D1?w-1:0),b=1;b1&&arguments[1]!==void 0?arguments[1]:NaN,p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:NaN,h=arguments.length>3&&arguments[3]!==void 0?arguments[3]:au.DIRECTION_LTR;return u.call(this,A,p,h)}),Syt({Config:e.Config,Node:e.Node,Layout:t("Layout",xyt),Size:t("Size",wCe),Value:t("Value",BCe),getInstanceCount:function(){return e.getInstanceCount.apply(e,arguments)}},au)}});var PCe=_((exports,module)=>{(function(t,e){typeof define=="function"&&define.amd?define([],function(){return e}):typeof module=="object"&&module.exports?module.exports=e:(t.nbind=t.nbind||{}).init=e})(exports,function(Module,cb){typeof Module=="function"&&(cb=Module,Module={}),Module.onRuntimeInitialized=function(t,e){return function(){t&&t.apply(this,arguments);try{Module.ccall("nbind_init")}catch(r){e(r);return}e(null,{bind:Module._nbind_value,reflect:Module.NBind.reflect,queryType:Module.NBind.queryType,toggleLightGC:Module.toggleLightGC,lib:Module})}}(Module.onRuntimeInitialized,cb);var Module;Module||(Module=(typeof Module<"u"?Module:null)||{});var moduleOverrides={};for(var key in Module)Module.hasOwnProperty(key)&&(moduleOverrides[key]=Module[key]);var ENVIRONMENT_IS_WEB=!1,ENVIRONMENT_IS_WORKER=!1,ENVIRONMENT_IS_NODE=!1,ENVIRONMENT_IS_SHELL=!1;if(Module.ENVIRONMENT)if(Module.ENVIRONMENT==="WEB")ENVIRONMENT_IS_WEB=!0;else if(Module.ENVIRONMENT==="WORKER")ENVIRONMENT_IS_WORKER=!0;else if(Module.ENVIRONMENT==="NODE")ENVIRONMENT_IS_NODE=!0;else if(Module.ENVIRONMENT==="SHELL")ENVIRONMENT_IS_SHELL=!0;else throw new Error("The provided Module['ENVIRONMENT'] value is not valid. It must be one of: WEB|WORKER|NODE|SHELL.");else ENVIRONMENT_IS_WEB=typeof window=="object",ENVIRONMENT_IS_WORKER=typeof importScripts=="function",ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof ve=="function"&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER,ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(ENVIRONMENT_IS_NODE){Module.print||(Module.print=console.log),Module.printErr||(Module.printErr=console.warn);var nodeFS,nodePath;Module.read=function(e,r){nodeFS||(nodeFS={}("")),nodePath||(nodePath={}("")),e=nodePath.normalize(e);var o=nodeFS.readFileSync(e);return r?o:o.toString()},Module.readBinary=function(e){var r=Module.read(e,!0);return r.buffer||(r=new Uint8Array(r)),assert(r.buffer),r},Module.load=function(e){globalEval(read(e))},Module.thisProgram||(process.argv.length>1?Module.thisProgram=process.argv[1].replace(/\\/g,"/"):Module.thisProgram="unknown-program"),Module.arguments=process.argv.slice(2),typeof module<"u"&&(module.exports=Module),Module.inspect=function(){return"[Emscripten Module object]"}}else if(ENVIRONMENT_IS_SHELL)Module.print||(Module.print=print),typeof printErr<"u"&&(Module.printErr=printErr),typeof read<"u"?Module.read=read:Module.read=function(){throw"no read() available"},Module.readBinary=function(e){if(typeof readbuffer=="function")return new Uint8Array(readbuffer(e));var r=read(e,"binary");return assert(typeof r=="object"),r},typeof scriptArgs<"u"?Module.arguments=scriptArgs:typeof arguments<"u"&&(Module.arguments=arguments),typeof quit=="function"&&(Module.quit=function(t,e){quit(t)});else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(Module.read=function(e){var r=new XMLHttpRequest;return r.open("GET",e,!1),r.send(null),r.responseText},ENVIRONMENT_IS_WORKER&&(Module.readBinary=function(e){var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}),Module.readAsync=function(e,r,o){var a=new XMLHttpRequest;a.open("GET",e,!0),a.responseType="arraybuffer",a.onload=function(){a.status==200||a.status==0&&a.response?r(a.response):o()},a.onerror=o,a.send(null)},typeof arguments<"u"&&(Module.arguments=arguments),typeof console<"u")Module.print||(Module.print=function(e){console.log(e)}),Module.printErr||(Module.printErr=function(e){console.warn(e)});else{var TRY_USE_DUMP=!1;Module.print||(Module.print=TRY_USE_DUMP&&typeof dump<"u"?function(t){dump(t)}:function(t){})}ENVIRONMENT_IS_WORKER&&(Module.load=importScripts),typeof Module.setWindowTitle>"u"&&(Module.setWindowTitle=function(t){document.title=t})}else throw"Unknown runtime environment. Where are we?";function globalEval(t){eval.call(null,t)}!Module.load&&Module.read&&(Module.load=function(e){globalEval(Module.read(e))}),Module.print||(Module.print=function(){}),Module.printErr||(Module.printErr=Module.print),Module.arguments||(Module.arguments=[]),Module.thisProgram||(Module.thisProgram="./this.program"),Module.quit||(Module.quit=function(t,e){throw e}),Module.print=Module.print,Module.printErr=Module.printErr,Module.preRun=[],Module.postRun=[];for(var key in moduleOverrides)moduleOverrides.hasOwnProperty(key)&&(Module[key]=moduleOverrides[key]);moduleOverrides=void 0;var Runtime={setTempRet0:function(t){return tempRet0=t,t},getTempRet0:function(){return tempRet0},stackSave:function(){return STACKTOP},stackRestore:function(t){STACKTOP=t},getNativeTypeSize:function(t){switch(t){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:{if(t[t.length-1]==="*")return Runtime.QUANTUM_SIZE;if(t[0]==="i"){var e=parseInt(t.substr(1));return assert(e%8===0),e/8}else return 0}}},getNativeFieldSize:function(t){return Math.max(Runtime.getNativeTypeSize(t),Runtime.QUANTUM_SIZE)},STACK_ALIGN:16,prepVararg:function(t,e){return e==="double"||e==="i64"?t&7&&(assert((t&7)===4),t+=4):assert((t&3)===0),t},getAlignSize:function(t,e,r){return!r&&(t=="i64"||t=="double")?8:t?Math.min(e||(t?Runtime.getNativeFieldSize(t):0),Runtime.QUANTUM_SIZE):Math.min(e,8)},dynCall:function(t,e,r){return r&&r.length?Module["dynCall_"+t].apply(null,[e].concat(r)):Module["dynCall_"+t].call(null,e)},functionPointers:[],addFunction:function(t){for(var e=0;e>2],r=(e+t+15|0)&-16;if(HEAP32[DYNAMICTOP_PTR>>2]=r,r>=TOTAL_MEMORY){var o=enlargeMemory();if(!o)return HEAP32[DYNAMICTOP_PTR>>2]=e,0}return e},alignMemory:function(t,e){var r=t=Math.ceil(t/(e||16))*(e||16);return r},makeBigInt:function(t,e,r){var o=r?+(t>>>0)+ +(e>>>0)*4294967296:+(t>>>0)+ +(e|0)*4294967296;return o},GLOBAL_BASE:8,QUANTUM_SIZE:4,__dummy__:0};Module.Runtime=Runtime;var ABORT=0,EXITSTATUS=0;function assert(t,e){t||abort("Assertion failed: "+e)}function getCFunc(ident){var func=Module["_"+ident];if(!func)try{func=eval("_"+ident)}catch(t){}return assert(func,"Cannot call unknown function "+ident+" (perhaps LLVM optimizations or closure removed it?)"),func}var cwrap,ccall;(function(){var JSfuncs={stackSave:function(){Runtime.stackSave()},stackRestore:function(){Runtime.stackRestore()},arrayToC:function(t){var e=Runtime.stackAlloc(t.length);return writeArrayToMemory(t,e),e},stringToC:function(t){var e=0;if(t!=null&&t!==0){var r=(t.length<<2)+1;e=Runtime.stackAlloc(r),stringToUTF8(t,e,r)}return e}},toC={string:JSfuncs.stringToC,array:JSfuncs.arrayToC};ccall=function(e,r,o,a,n){var u=getCFunc(e),A=[],p=0;if(a)for(var h=0;h>0]=e;break;case"i8":HEAP8[t>>0]=e;break;case"i16":HEAP16[t>>1]=e;break;case"i32":HEAP32[t>>2]=e;break;case"i64":tempI64=[e>>>0,(tempDouble=e,+Math_abs(tempDouble)>=1?tempDouble>0?(Math_min(+Math_floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[t>>2]=tempI64[0],HEAP32[t+4>>2]=tempI64[1];break;case"float":HEAPF32[t>>2]=e;break;case"double":HEAPF64[t>>3]=e;break;default:abort("invalid type for setValue: "+r)}}Module.setValue=setValue;function getValue(t,e,r){switch(e=e||"i8",e.charAt(e.length-1)==="*"&&(e="i32"),e){case"i1":return HEAP8[t>>0];case"i8":return HEAP8[t>>0];case"i16":return HEAP16[t>>1];case"i32":return HEAP32[t>>2];case"i64":return HEAP32[t>>2];case"float":return HEAPF32[t>>2];case"double":return HEAPF64[t>>3];default:abort("invalid type for setValue: "+e)}return null}Module.getValue=getValue;var ALLOC_NORMAL=0,ALLOC_STACK=1,ALLOC_STATIC=2,ALLOC_DYNAMIC=3,ALLOC_NONE=4;Module.ALLOC_NORMAL=ALLOC_NORMAL,Module.ALLOC_STACK=ALLOC_STACK,Module.ALLOC_STATIC=ALLOC_STATIC,Module.ALLOC_DYNAMIC=ALLOC_DYNAMIC,Module.ALLOC_NONE=ALLOC_NONE;function allocate(t,e,r,o){var a,n;typeof t=="number"?(a=!0,n=t):(a=!1,n=t.length);var u=typeof e=="string"?e:null,A;if(r==ALLOC_NONE?A=o:A=[typeof _malloc=="function"?_malloc:Runtime.staticAlloc,Runtime.stackAlloc,Runtime.staticAlloc,Runtime.dynamicAlloc][r===void 0?ALLOC_STATIC:r](Math.max(n,u?1:e.length)),a){var o=A,p;for(assert((A&3)==0),p=A+(n&-4);o>2]=0;for(p=A+n;o>0]=0;return A}if(u==="i8")return t.subarray||t.slice?HEAPU8.set(t,A):HEAPU8.set(new Uint8Array(t),A),A;for(var h=0,E,w,D;h>0],r|=o,!(o==0&&!e||(a++,e&&a==e)););e||(e=a);var n="";if(r<128){for(var u=1024,A;e>0;)A=String.fromCharCode.apply(String,HEAPU8.subarray(t,t+Math.min(e,u))),n=n?n+A:A,t+=u,e-=u;return n}return Module.UTF8ToString(t)}Module.Pointer_stringify=Pointer_stringify;function AsciiToString(t){for(var e="";;){var r=HEAP8[t++>>0];if(!r)return e;e+=String.fromCharCode(r)}}Module.AsciiToString=AsciiToString;function stringToAscii(t,e){return writeAsciiToMemory(t,e,!1)}Module.stringToAscii=stringToAscii;var UTF8Decoder=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function UTF8ArrayToString(t,e){for(var r=e;t[r];)++r;if(r-e>16&&t.subarray&&UTF8Decoder)return UTF8Decoder.decode(t.subarray(e,r));for(var o,a,n,u,A,p,h="";;){if(o=t[e++],!o)return h;if(!(o&128)){h+=String.fromCharCode(o);continue}if(a=t[e++]&63,(o&224)==192){h+=String.fromCharCode((o&31)<<6|a);continue}if(n=t[e++]&63,(o&240)==224?o=(o&15)<<12|a<<6|n:(u=t[e++]&63,(o&248)==240?o=(o&7)<<18|a<<12|n<<6|u:(A=t[e++]&63,(o&252)==248?o=(o&3)<<24|a<<18|n<<12|u<<6|A:(p=t[e++]&63,o=(o&1)<<30|a<<24|n<<18|u<<12|A<<6|p))),o<65536)h+=String.fromCharCode(o);else{var E=o-65536;h+=String.fromCharCode(55296|E>>10,56320|E&1023)}}}Module.UTF8ArrayToString=UTF8ArrayToString;function UTF8ToString(t){return UTF8ArrayToString(HEAPU8,t)}Module.UTF8ToString=UTF8ToString;function stringToUTF8Array(t,e,r,o){if(!(o>0))return 0;for(var a=r,n=r+o-1,u=0;u=55296&&A<=57343&&(A=65536+((A&1023)<<10)|t.charCodeAt(++u)&1023),A<=127){if(r>=n)break;e[r++]=A}else if(A<=2047){if(r+1>=n)break;e[r++]=192|A>>6,e[r++]=128|A&63}else if(A<=65535){if(r+2>=n)break;e[r++]=224|A>>12,e[r++]=128|A>>6&63,e[r++]=128|A&63}else if(A<=2097151){if(r+3>=n)break;e[r++]=240|A>>18,e[r++]=128|A>>12&63,e[r++]=128|A>>6&63,e[r++]=128|A&63}else if(A<=67108863){if(r+4>=n)break;e[r++]=248|A>>24,e[r++]=128|A>>18&63,e[r++]=128|A>>12&63,e[r++]=128|A>>6&63,e[r++]=128|A&63}else{if(r+5>=n)break;e[r++]=252|A>>30,e[r++]=128|A>>24&63,e[r++]=128|A>>18&63,e[r++]=128|A>>12&63,e[r++]=128|A>>6&63,e[r++]=128|A&63}}return e[r]=0,r-a}Module.stringToUTF8Array=stringToUTF8Array;function stringToUTF8(t,e,r){return stringToUTF8Array(t,HEAPU8,e,r)}Module.stringToUTF8=stringToUTF8;function lengthBytesUTF8(t){for(var e=0,r=0;r=55296&&o<=57343&&(o=65536+((o&1023)<<10)|t.charCodeAt(++r)&1023),o<=127?++e:o<=2047?e+=2:o<=65535?e+=3:o<=2097151?e+=4:o<=67108863?e+=5:e+=6}return e}Module.lengthBytesUTF8=lengthBytesUTF8;var UTF16Decoder=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0;function demangle(t){var e=Module.___cxa_demangle||Module.__cxa_demangle;if(e){try{var r=t.substr(1),o=lengthBytesUTF8(r)+1,a=_malloc(o);stringToUTF8(r,a,o);var n=_malloc(4),u=e(a,0,0,n);if(getValue(n,"i32")===0&&u)return Pointer_stringify(u)}catch{}finally{a&&_free(a),n&&_free(n),u&&_free(u)}return t}return Runtime.warnOnce("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling"),t}function demangleAll(t){var e=/__Z[\w\d_]+/g;return t.replace(e,function(r){var o=demangle(r);return r===o?r:r+" ["+o+"]"})}function jsStackTrace(){var t=new Error;if(!t.stack){try{throw new Error(0)}catch(e){t=e}if(!t.stack)return"(no stack trace available)"}return t.stack.toString()}function stackTrace(){var t=jsStackTrace();return Module.extraStackTrace&&(t+=` `+Module.extraStackTrace()),demangleAll(t)}Module.stackTrace=stackTrace;var HEAP,buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferViews(){Module.HEAP8=HEAP8=new Int8Array(buffer),Module.HEAP16=HEAP16=new Int16Array(buffer),Module.HEAP32=HEAP32=new Int32Array(buffer),Module.HEAPU8=HEAPU8=new Uint8Array(buffer),Module.HEAPU16=HEAPU16=new Uint16Array(buffer),Module.HEAPU32=HEAPU32=new Uint32Array(buffer),Module.HEAPF32=HEAPF32=new Float32Array(buffer),Module.HEAPF64=HEAPF64=new Float64Array(buffer)}var STATIC_BASE,STATICTOP,staticSealed,STACK_BASE,STACKTOP,STACK_MAX,DYNAMIC_BASE,DYNAMICTOP_PTR;STATIC_BASE=STATICTOP=STACK_BASE=STACKTOP=STACK_MAX=DYNAMIC_BASE=DYNAMICTOP_PTR=0,staticSealed=!1;function abortOnCannotGrowMemory(){abort("Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value "+TOTAL_MEMORY+", (2) compile with -s ALLOW_MEMORY_GROWTH=1 which allows increasing the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or (4) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 ")}function enlargeMemory(){abortOnCannotGrowMemory()}var TOTAL_STACK=Module.TOTAL_STACK||5242880,TOTAL_MEMORY=Module.TOTAL_MEMORY||134217728;TOTAL_MEMORY0;){var e=t.shift();if(typeof e=="function"){e();continue}var r=e.func;typeof r=="number"?e.arg===void 0?Module.dynCall_v(r):Module.dynCall_vi(r,e.arg):r(e.arg===void 0?null:e.arg)}}var __ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATEXIT__=[],__ATPOSTRUN__=[],runtimeInitialized=!1,runtimeExited=!1;function preRun(){if(Module.preRun)for(typeof Module.preRun=="function"&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}function ensureInitRuntime(){runtimeInitialized||(runtimeInitialized=!0,callRuntimeCallbacks(__ATINIT__))}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){callRuntimeCallbacks(__ATEXIT__),runtimeExited=!0}function postRun(){if(Module.postRun)for(typeof Module.postRun=="function"&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(t){__ATPRERUN__.unshift(t)}Module.addOnPreRun=addOnPreRun;function addOnInit(t){__ATINIT__.unshift(t)}Module.addOnInit=addOnInit;function addOnPreMain(t){__ATMAIN__.unshift(t)}Module.addOnPreMain=addOnPreMain;function addOnExit(t){__ATEXIT__.unshift(t)}Module.addOnExit=addOnExit;function addOnPostRun(t){__ATPOSTRUN__.unshift(t)}Module.addOnPostRun=addOnPostRun;function intArrayFromString(t,e,r){var o=r>0?r:lengthBytesUTF8(t)+1,a=new Array(o),n=stringToUTF8Array(t,a,0,a.length);return e&&(a.length=n),a}Module.intArrayFromString=intArrayFromString;function intArrayToString(t){for(var e=[],r=0;r255&&(o&=255),e.push(String.fromCharCode(o))}return e.join("")}Module.intArrayToString=intArrayToString;function writeStringToMemory(t,e,r){Runtime.warnOnce("writeStringToMemory is deprecated and should not be called! Use stringToUTF8() instead!");var o,a;r&&(a=e+lengthBytesUTF8(t),o=HEAP8[a]),stringToUTF8(t,e,1/0),r&&(HEAP8[a]=o)}Module.writeStringToMemory=writeStringToMemory;function writeArrayToMemory(t,e){HEAP8.set(t,e)}Module.writeArrayToMemory=writeArrayToMemory;function writeAsciiToMemory(t,e,r){for(var o=0;o>0]=t.charCodeAt(o);r||(HEAP8[e>>0]=0)}if(Module.writeAsciiToMemory=writeAsciiToMemory,(!Math.imul||Math.imul(4294967295,5)!==-5)&&(Math.imul=function t(e,r){var o=e>>>16,a=e&65535,n=r>>>16,u=r&65535;return a*u+(o*u+a*n<<16)|0}),Math.imul=Math.imul,!Math.fround){var froundBuffer=new Float32Array(1);Math.fround=function(t){return froundBuffer[0]=t,froundBuffer[0]}}Math.fround=Math.fround,Math.clz32||(Math.clz32=function(t){t=t>>>0;for(var e=0;e<32;e++)if(t&1<<31-e)return e;return 32}),Math.clz32=Math.clz32,Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)}),Math.trunc=Math.trunc;var Math_abs=Math.abs,Math_cos=Math.cos,Math_sin=Math.sin,Math_tan=Math.tan,Math_acos=Math.acos,Math_asin=Math.asin,Math_atan=Math.atan,Math_atan2=Math.atan2,Math_exp=Math.exp,Math_log=Math.log,Math_sqrt=Math.sqrt,Math_ceil=Math.ceil,Math_floor=Math.floor,Math_pow=Math.pow,Math_imul=Math.imul,Math_fround=Math.fround,Math_round=Math.round,Math_min=Math.min,Math_clz32=Math.clz32,Math_trunc=Math.trunc,runDependencies=0,runDependencyWatcher=null,dependenciesFulfilled=null;function getUniqueRunDependency(t){return t}function addRunDependency(t){runDependencies++,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies)}Module.addRunDependency=addRunDependency;function removeRunDependency(t){if(runDependencies--,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies),runDependencies==0&&(runDependencyWatcher!==null&&(clearInterval(runDependencyWatcher),runDependencyWatcher=null),dependenciesFulfilled)){var e=dependenciesFulfilled;dependenciesFulfilled=null,e()}}Module.removeRunDependency=removeRunDependency,Module.preloadedImages={},Module.preloadedAudios={};var ASM_CONSTS=[function(t,e,r,o,a,n,u,A){return _nbind.callbackSignatureList[t].apply(this,arguments)}];function _emscripten_asm_const_iiiiiiii(t,e,r,o,a,n,u,A){return ASM_CONSTS[t](e,r,o,a,n,u,A)}function _emscripten_asm_const_iiiii(t,e,r,o,a){return ASM_CONSTS[t](e,r,o,a)}function _emscripten_asm_const_iiidddddd(t,e,r,o,a,n,u,A,p){return ASM_CONSTS[t](e,r,o,a,n,u,A,p)}function _emscripten_asm_const_iiididi(t,e,r,o,a,n,u){return ASM_CONSTS[t](e,r,o,a,n,u)}function _emscripten_asm_const_iiii(t,e,r,o){return ASM_CONSTS[t](e,r,o)}function _emscripten_asm_const_iiiid(t,e,r,o,a){return ASM_CONSTS[t](e,r,o,a)}function _emscripten_asm_const_iiiiii(t,e,r,o,a,n){return ASM_CONSTS[t](e,r,o,a,n)}STATIC_BASE=Runtime.GLOBAL_BASE,STATICTOP=STATIC_BASE+12800,__ATINIT__.push({func:function(){__GLOBAL__sub_I_Yoga_cpp()}},{func:function(){__GLOBAL__sub_I_nbind_cc()}},{func:function(){__GLOBAL__sub_I_common_cc()}},{func:function(){__GLOBAL__sub_I_Binding_cc()}}),allocate([0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,127,0,0,192,127,0,0,192,127,0,0,192,127,3,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,3,0,0,0,0,0,192,127,3,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,192,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,127,0,0,192,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,127,0,0,0,0,0,0,0,0,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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,0,0,0,1,0,0,0,4,0,0,0,183,45,0,0,181,45,0,0,181,45,0,0,181,45,0,0,181,45,0,0,181,45,0,0,181,45,0,0,184,45,0,0,185,45,0,0,181,45,0,0,181,45,0,0,182,45,0,0,186,45,0,0,185,45,0,0,148,4,0,0,3,0,0,0,187,45,0,0,164,4,0,0,188,45,0,0,2,0,0,0,189,45,0,0,164,4,0,0,188,45,0,0,185,45,0,0,164,4,0,0,185,45,0,0,164,4,0,0,188,45,0,0,181,45,0,0,182,45,0,0,181,45,0,0,0,0,0,0,0,0,0,0,1,0,0,0,5,0,0,0,6,0,0,0,1,0,0,0,7,0,0,0,183,45,0,0,182,45,0,0,181,45,0,0,190,45,0,0,190,45,0,0,182,45,0,0,182,45,0,0,185,45,0,0,181,45,0,0,185,45,0,0,182,45,0,0,181,45,0,0,185,45,0,0,182,45,0,0,185,45,0,0,48,5,0,0,3,0,0,0,56,5,0,0,1,0,0,0,189,45,0,0,185,45,0,0,164,4,0,0,76,5,0,0,2,0,0,0,191,45,0,0,186,45,0,0,182,45,0,0,185,45,0,0,192,45,0,0,185,45,0,0,182,45,0,0,186,45,0,0,185,45,0,0,76,5,0,0,76,5,0,0,136,5,0,0,182,45,0,0,181,45,0,0,2,0,0,0,190,45,0,0,136,5,0,0,56,19,0,0,156,5,0,0,2,0,0,0,184,45,0,0,0,0,0,0,0,0,0,0,1,0,0,0,8,0,0,0,9,0,0,0,1,0,0,0,10,0,0,0,204,5,0,0,181,45,0,0,181,45,0,0,2,0,0,0,180,45,0,0,204,5,0,0,2,0,0,0,195,45,0,0,236,5,0,0,97,19,0,0,198,45,0,0,211,45,0,0,212,45,0,0,213,45,0,0,214,45,0,0,215,45,0,0,188,45,0,0,182,45,0,0,216,45,0,0,217,45,0,0,218,45,0,0,219,45,0,0,192,45,0,0,181,45,0,0,0,0,0,0,185,45,0,0,110,19,0,0,186,45,0,0,115,19,0,0,221,45,0,0,120,19,0,0,148,4,0,0,132,19,0,0,96,6,0,0,145,19,0,0,222,45,0,0,164,19,0,0,223,45,0,0,173,19,0,0,0,0,0,0,3,0,0,0,104,6,0,0,1,0,0,0,187,45,0,0,0,0,0,0,0,0,0,0,1,0,0,0,11,0,0,0,12,0,0,0,1,0,0,0,13,0,0,0,185,45,0,0,224,45,0,0,164,6,0,0,188,45,0,0,172,6,0,0,180,6,0,0,2,0,0,0,188,6,0,0,7,0,0,0,224,45,0,0,7,0,0,0,164,6,0,0,1,0,0,0,213,45,0,0,185,45,0,0,224,45,0,0,172,6,0,0,185,45,0,0,224,45,0,0,164,6,0,0,185,45,0,0,224,45,0,0,211,45,0,0,211,45,0,0,222,45,0,0,211,45,0,0,224,45,0,0,222,45,0,0,211,45,0,0,224,45,0,0,172,6,0,0,222,45,0,0,211,45,0,0,224,45,0,0,188,45,0,0,222,45,0,0,211,45,0,0,40,7,0,0,188,45,0,0,2,0,0,0,224,45,0,0,185,45,0,0,188,45,0,0,188,45,0,0,188,45,0,0,188,45,0,0,222,45,0,0,224,45,0,0,148,4,0,0,185,45,0,0,148,4,0,0,148,4,0,0,148,4,0,0,148,4,0,0,148,4,0,0,185,45,0,0,164,6,0,0,148,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,14,0,0,0,15,0,0,0,1,0,0,0,16,0,0,0,148,7,0,0,2,0,0,0,225,45,0,0,183,45,0,0,188,45,0,0,168,7,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,2,0,0,0,234,45,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,148,45,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,9,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,2,0,0,0,242,45,0,0,0,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,67,111,117,108,100,32,110,111,116,32,97,108,108,111,99,97,116,101,32,109,101,109,111,114,121,32,102,111,114,32,110,111,100,101,0,67,97,110,110,111,116,32,114,101,115,101,116,32,97,32,110,111,100,101,32,119,104,105,99,104,32,115,116,105,108,108,32,104,97,115,32,99,104,105,108,100,114,101,110,32,97,116,116,97,99,104,101,100,0,67,97,110,110,111,116,32,114,101,115,101,116,32,97,32,110,111,100,101,32,115,116,105,108,108,32,97,116,116,97,99,104,101,100,32,116,111,32,97,32,112,97,114,101,110,116,0,67,111,117,108,100,32,110,111,116,32,97,108,108,111,99,97,116,101,32,109,101,109,111,114,121,32,102,111,114,32,99,111,110,102,105,103,0,67,97,110,110,111,116,32,115,101,116,32,109,101,97,115,117,114,101,32,102,117,110,99,116,105,111,110,58,32,78,111,100,101,115,32,119,105,116,104,32,109,101,97,115,117,114,101,32,102,117,110,99,116,105,111,110,115,32,99,97,110,110,111,116,32,104,97,118,101,32,99,104,105,108,100,114,101,110,46,0,67,104,105,108,100,32,97,108,114,101,97,100,121,32,104,97,115,32,97,32,112,97,114,101,110,116,44,32,105,116,32,109,117,115,116,32,98,101,32,114,101,109,111,118,101,100,32,102,105,114,115,116,46,0,67,97,110,110,111,116,32,97,100,100,32,99,104,105,108,100,58,32,78,111,100,101,115,32,119,105,116,104,32,109,101,97,115,117,114,101,32,102,117,110,99,116,105,111,110,115,32,99,97,110,110,111,116,32,104,97,118,101,32,99,104,105,108,100,114,101,110,46,0,79,110,108,121,32,108,101,97,102,32,110,111,100,101,115,32,119,105,116,104,32,99,117,115,116,111,109,32,109,101,97,115,117,114,101,32,102,117,110,99,116,105,111,110,115,115,104,111,117,108,100,32,109,97,110,117,97,108,108,121,32,109,97,114,107,32,116,104,101,109,115,101,108,118,101,115,32,97,115,32,100,105,114,116,121,0,67,97,110,110,111,116,32,103,101,116,32,108,97,121,111,117,116,32,112,114,111,112,101,114,116,105,101,115,32,111,102,32,109,117,108,116,105,45,101,100,103,101,32,115,104,111,114,116,104,97,110,100,115,0,37,115,37,100,46,123,91,115,107,105,112,112,101,100,93,32,0,119,109,58,32,37,115,44,32,104,109,58,32,37,115,44,32,97,119,58,32,37,102,32,97,104,58,32,37,102,32,61,62,32,100,58,32,40,37,102,44,32,37,102,41,32,37,115,10,0,37,115,37,100,46,123,37,115,0,42,0,119,109,58,32,37,115,44,32,104,109,58,32,37,115,44,32,97,119,58,32,37,102,32,97,104,58,32,37,102,32,37,115,10,0,37,115,37,100,46,125,37,115,0,119,109,58,32,37,115,44,32,104,109,58,32,37,115,44,32,100,58,32,40,37,102,44,32,37,102,41,32,37,115,10,0,79,117,116,32,111,102,32,99,97,99,104,101,32,101,110,116,114,105,101,115,33,10,0,83,99,97,108,101,32,102,97,99,116,111,114,32,115,104,111,117,108,100,32,110,111,116,32,98,101,32,108,101,115,115,32,116,104,97,110,32,122,101,114,111,0,105,110,105,116,105,97,108,0,37,115,10,0,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,0,85,78,68,69,70,73,78,69,68,0,69,88,65,67,84,76,89,0,65,84,95,77,79,83,84,0,76,65,89,95,85,78,68,69,70,73,78,69,68,0,76,65,89,95,69,88,65,67,84,76,89,0,76,65,89,95,65,84,95,77,79,83,84,0,97,118,97,105,108,97,98,108,101,87,105,100,116,104,32,105,115,32,105,110,100,101,102,105,110,105,116,101,32,115,111,32,119,105,100,116,104,77,101,97,115,117,114,101,77,111,100,101,32,109,117,115,116,32,98,101,32,89,71,77,101,97,115,117,114,101,77,111,100,101,85,110,100,101,102,105,110,101,100,0,97,118,97,105,108,97,98,108,101,72,101,105,103,104,116,32,105,115,32,105,110,100,101,102,105,110,105,116,101,32,115,111,32,104,101,105,103,104,116,77,101,97,115,117,114,101,77,111,100,101,32,109,117,115,116,32,98,101,32,89,71,77,101,97,115,117,114,101,77,111,100,101,85,110,100,101,102,105,110,101,100,0,102,108,101,120,0,115,116,114,101,116,99,104,0,109,117,108,116,105,108,105,110,101,45,115,116,114,101,116,99,104,0,69,120,112,101,99,116,101,100,32,110,111,100,101,32,116,111,32,104,97,118,101,32,99,117,115,116,111,109,32,109,101,97,115,117,114,101,32,102,117,110,99,116,105,111,110,0,109,101,97,115,117,114,101,0,69,120,112,101,99,116,32,99,117,115,116,111,109,32,98,97,115,101,108,105,110,101,32,102,117,110,99,116,105,111,110,32,116,111,32,110,111,116,32,114,101,116,117,114,110,32,78,97,78,0,97,98,115,45,109,101,97,115,117,114,101,0,97,98,115,45,108,97,121,111,117,116,0,78,111,100,101,0,99,114,101,97,116,101,68,101,102,97,117,108,116,0,99,114,101,97,116,101,87,105,116,104,67,111,110,102,105,103,0,100,101,115,116,114,111,121,0,114,101,115,101,116,0,99,111,112,121,83,116,121,108,101,0,115,101,116,80,111,115,105,116,105,111,110,84,121,112,101,0,115,101,116,80,111,115,105,116,105,111,110,0,115,101,116,80,111,115,105,116,105,111,110,80,101,114,99,101,110,116,0,115,101,116,65,108,105,103,110,67,111,110,116,101,110,116,0,115,101,116,65,108,105,103,110,73,116,101,109,115,0,115,101,116,65,108,105,103,110,83,101,108,102,0,115,101,116,70,108,101,120,68,105,114,101,99,116,105,111,110,0,115,101,116,70,108,101,120,87,114,97,112,0,115,101,116,74,117,115,116,105,102,121,67,111,110,116,101,110,116,0,115,101,116,77,97,114,103,105,110,0,115,101,116,77,97,114,103,105,110,80,101,114,99,101,110,116,0,115,101,116,77,97,114,103,105,110,65,117,116,111,0,115,101,116,79,118,101,114,102,108,111,119,0,115,101,116,68,105,115,112,108,97,121,0,115,101,116,70,108,101,120,0,115,101,116,70,108,101,120,66,97,115,105,115,0,115,101,116,70,108,101,120,66,97,115,105,115,80,101,114,99,101,110,116,0,115,101,116,70,108,101,120,71,114,111,119,0,115,101,116,70,108,101,120,83,104,114,105,110,107,0,115,101,116,87,105,100,116,104,0,115,101,116,87,105,100,116,104,80,101,114,99,101,110,116,0,115,101,116,87,105,100,116,104,65,117,116,111,0,115,101,116,72,101,105,103,104,116,0,115,101,116,72,101,105,103,104,116,80,101,114,99,101,110,116,0,115,101,116,72,101,105,103,104,116,65,117,116,111,0,115,101,116,77,105,110,87,105,100,116,104,0,115,101,116,77,105,110,87,105,100,116,104,80,101,114,99,101,110,116,0,115,101,116,77,105,110,72,101,105,103,104,116,0,115,101,116,77,105,110,72,101,105,103,104,116,80,101,114,99,101,110,116,0,115,101,116,77,97,120,87,105,100,116,104,0,115,101,116,77,97,120,87,105,100,116,104,80,101,114,99,101,110,116,0,115,101,116,77,97,120,72,101,105,103,104,116,0,115,101,116,77,97,120,72,101,105,103,104,116,80,101,114,99,101,110,116,0,115,101,116,65,115,112,101,99,116,82,97,116,105,111,0,115,101,116,66,111,114,100,101,114,0,115,101,116,80,97,100,100,105,110,103,0,115,101,116,80,97,100,100,105,110,103,80,101,114,99,101,110,116,0,103,101,116,80,111,115,105,116,105,111,110,84,121,112,101,0,103,101,116,80,111,115,105,116,105,111,110,0,103,101,116,65,108,105,103,110,67,111,110,116,101,110,116,0,103,101,116,65,108,105,103,110,73,116,101,109,115,0,103,101,116,65,108,105,103,110,83,101,108,102,0,103,101,116,70,108,101,120,68,105,114,101,99,116,105,111,110,0,103,101,116,70,108,101,120,87,114,97,112,0,103,101,116,74,117,115,116,105,102,121,67,111,110,116,101,110,116,0,103,101,116,77,97,114,103,105,110,0,103,101,116,70,108,101,120,66,97,115,105,115,0,103,101,116,70,108,101,120,71,114,111,119,0,103,101,116,70,108,101,120,83,104,114,105,110,107,0,103,101,116,87,105,100,116,104,0,103,101,116,72,101,105,103,104,116,0,103,101,116,77,105,110,87,105,100,116,104,0,103,101,116,77,105,110,72,101,105,103,104,116,0,103,101,116,77,97,120,87,105,100,116,104,0,103,101,116,77,97,120,72,101,105,103,104,116,0,103,101,116,65,115,112,101,99,116,82,97,116,105,111,0,103,101,116,66,111,114,100,101,114,0,103,101,116,79,118,101,114,102,108,111,119,0,103,101,116,68,105,115,112,108,97,121,0,103,101,116,80,97,100,100,105,110,103,0,105,110,115,101,114,116,67,104,105,108,100,0,114,101,109,111,118,101,67,104,105,108,100,0,103,101,116,67,104,105,108,100,67,111,117,110,116,0,103,101,116,80,97,114,101,110,116,0,103,101,116,67,104,105,108,100,0,115,101,116,77,101,97,115,117,114,101,70,117,110,99,0,117,110,115,101,116,77,101,97,115,117,114,101,70,117,110,99,0,109,97,114,107,68,105,114,116,121,0,105,115,68,105,114,116,121,0,99,97,108,99,117,108,97,116,101,76,97,121,111,117,116,0,103,101,116,67,111,109,112,117,116,101,100,76,101,102,116,0,103,101,116,67,111,109,112,117,116,101,100,82,105,103,104,116,0,103,101,116,67,111,109,112,117,116,101,100,84,111,112,0,103,101,116,67,111,109,112,117,116,101,100,66,111,116,116,111,109,0,103,101,116,67,111,109,112,117,116,101,100,87,105,100,116,104,0,103,101,116,67,111,109,112,117,116,101,100,72,101,105,103,104,116,0,103,101,116,67,111,109,112,117,116,101,100,76,97,121,111,117,116,0,103,101,116,67,111,109,112,117,116,101,100,77,97,114,103,105,110,0,103,101,116,67,111,109,112,117,116,101,100,66,111,114,100,101,114,0,103,101,116,67,111,109,112,117,116,101,100,80,97,100,100,105,110,103,0,67,111,110,102,105,103,0,99,114,101,97,116,101,0,115,101,116,69,120,112,101,114,105,109,101,110,116,97,108,70,101,97,116,117,114,101,69,110,97,98,108,101,100,0,115,101,116,80,111,105,110,116,83,99,97,108,101,70,97,99,116,111,114,0,105,115,69,120,112,101,114,105,109,101,110,116,97,108,70,101,97,116,117,114,101,69,110,97,98,108,101,100,0,86,97,108,117,101,0,76,97,121,111,117,116,0,83,105,122,101,0,103,101,116,73,110,115,116,97,110,99,101,67,111,117,110,116,0,73,110,116,54,52,0,1,1,1,2,2,4,4,4,4,8,8,4,8,118,111,105,100,0,98,111,111,108,0,115,116,100,58,58,115,116,114,105,110,103,0,99,98,70,117,110,99,116,105,111,110,32,38,0,99,111,110,115,116,32,99,98,70,117,110,99,116,105,111,110,32,38,0,69,120,116,101,114,110,97,108,0,66,117,102,102,101,114,0,78,66,105,110,100,73,68,0,78,66,105,110,100,0,98,105,110,100,95,118,97,108,117,101,0,114,101,102,108,101,99,116,0,113,117,101,114,121,84,121,112,101,0,108,97,108,108,111,99,0,108,114,101,115,101,116,0,123,114,101,116,117,114,110,40,95,110,98,105,110,100,46,99,97,108,108,98,97,99,107,83,105,103,110,97,116,117,114,101,76,105,115,116,91,36,48,93,46,97,112,112,108,121,40,116,104,105,115,44,97,114,103,117,109,101,110,116,115,41,41,59,125,0,95,110,98,105,110,100,95,110,101,119,0,17,0,10,0,17,17,17,0,0,0,0,5,0,0,0,0,0,0,9,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,15,10,17,17,17,3,10,7,0,1,19,9,11,11,0,0,9,6,11,0,0,11,0,6,17,0,0,0,17,17,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,10,10,17,17,17,0,10,0,0,2,0,9,11,0,0,0,9,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,4,13,0,0,0,0,9,14,0,0,0,0,0,14,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,15,0,0,0,0,9,16,0,0,0,0,0,16,0,0,16,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,10,0,0,0,0,9,11,0,0,0,0,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,45,43,32,32,32,48,88,48,120,0,40,110,117,108,108,41,0,45,48,88,43,48,88,32,48,88,45,48,120,43,48,120,32,48,120,0,105,110,102,0,73,78,70,0,110,97,110,0,78,65,78,0,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,46,0,84,33,34,25,13,1,2,3,17,75,28,12,16,4,11,29,18,30,39,104,110,111,112,113,98,32,5,6,15,19,20,21,26,8,22,7,40,36,23,24,9,10,14,27,31,37,35,131,130,125,38,42,43,60,61,62,63,67,71,74,77,88,89,90,91,92,93,94,95,96,97,99,100,101,102,103,105,106,107,108,114,115,116,121,122,123,124,0,73,108,108,101,103,97,108,32,98,121,116,101,32,115,101,113,117,101,110,99,101,0,68,111,109,97,105,110,32,101,114,114,111,114,0,82,101,115,117,108,116,32,110,111,116,32,114,101,112,114,101,115,101,110,116,97,98,108,101,0,78,111,116,32,97,32,116,116,121,0,80,101,114,109,105,115,115,105,111,110,32,100,101,110,105,101,100,0,79,112,101,114,97,116,105,111,110,32,110,111,116,32,112,101,114,109,105,116,116,101,100,0,78,111,32,115,117,99,104,32,102,105,108,101,32,111,114,32,100,105,114,101,99,116,111,114,121,0,78,111,32,115,117,99,104,32,112,114,111,99,101,115,115,0,70,105,108,101,32,101,120,105,115,116,115,0,86,97,108,117,101,32,116,111,111,32,108,97,114,103,101,32,102,111,114,32,100,97,116,97,32,116,121,112,101,0,78,111,32,115,112,97,99,101,32,108,101,102,116,32,111,110,32,100,101,118,105,99,101,0,79,117,116,32,111,102,32,109,101,109,111,114,121,0,82,101,115,111,117,114,99,101,32,98,117,115,121,0,73,110,116,101,114,114,117,112,116,101,100,32,115,121,115,116,101,109,32,99,97,108,108,0,82,101,115,111,117,114,99,101,32,116,101,109,112,111,114,97,114,105,108,121,32,117,110,97,118,97,105,108,97,98,108,101,0,73,110,118,97,108,105,100,32,115,101,101,107,0,67,114,111,115,115,45,100,101,118,105,99,101,32,108,105,110,107,0,82,101,97,100,45,111,110,108,121,32,102,105,108,101,32,115,121,115,116,101,109,0,68,105,114,101,99,116,111,114,121,32,110,111,116,32,101,109,112,116,121,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,112,101,101,114,0,79,112,101,114,97,116,105,111,110,32,116,105,109,101,100,32,111,117,116,0,67,111,110,110,101,99,116,105,111,110,32,114,101,102,117,115,101,100,0,72,111,115,116,32,105,115,32,100,111,119,110,0,72,111,115,116,32,105,115,32,117,110,114,101,97,99,104,97,98,108,101,0,65,100,100,114,101,115,115,32,105,110,32,117,115,101,0,66,114,111,107,101,110,32,112,105,112,101,0,73,47,79,32,101,114,114,111,114,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,32,111,114,32,97,100,100,114,101,115,115,0,66,108,111,99,107,32,100,101,118,105,99,101,32,114,101,113,117,105,114,101,100,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,0,78,111,116,32,97,32,100,105,114,101,99,116,111,114,121,0,73,115,32,97,32,100,105,114,101,99,116,111,114,121,0,84,101,120,116,32,102,105,108,101,32,98,117,115,121,0,69,120,101,99,32,102,111,114,109,97,116,32,101,114,114,111,114,0,73,110,118,97,108,105,100,32,97,114,103,117,109,101,110,116,0,65,114,103,117,109,101,110,116,32,108,105,115,116,32,116,111,111,32,108,111,110,103,0,83,121,109,98,111,108,105,99,32,108,105,110,107,32,108,111,111,112,0,70,105,108,101,110,97,109,101,32,116,111,111,32,108,111,110,103,0,84,111,111,32,109,97,110,121,32,111,112,101,110,32,102,105,108,101,115,32,105,110,32,115,121,115,116,101,109,0,78,111,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,115,32,97,118,97,105,108,97,98,108,101,0,66,97,100,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,0,78,111,32,99,104,105,108,100,32,112,114,111,99,101,115,115,0,66,97,100,32,97,100,100,114,101,115,115,0,70,105,108,101,32,116,111,111,32,108,97,114,103,101,0,84,111,111,32,109,97,110,121,32,108,105,110,107,115,0,78,111,32,108,111,99,107,115,32,97,118,97,105,108,97,98,108,101,0,82,101,115,111,117,114,99,101,32,100,101,97,100,108,111,99,107,32,119,111,117,108,100,32,111,99,99,117,114,0,83,116,97,116,101,32,110,111,116,32,114,101,99,111,118,101,114,97,98,108,101,0,80,114,101,118,105,111,117,115,32,111,119,110,101,114,32,100,105,101,100,0,79,112,101,114,97,116,105,111,110,32,99,97,110,99,101,108,101,100,0,70,117,110,99,116,105,111,110,32,110,111,116,32,105,109,112,108,101,109,101,110,116,101,100,0,78,111,32,109,101,115,115,97,103,101,32,111,102,32,100,101,115,105,114,101,100,32,116,121,112,101,0,73,100,101,110,116,105,102,105,101,114,32,114,101,109,111,118,101,100,0,68,101,118,105,99,101,32,110,111,116,32,97,32,115,116,114,101,97,109,0,78,111,32,100,97,116,97,32,97,118,97,105,108,97,98,108,101,0,68,101,118,105,99,101,32,116,105,109,101,111,117,116,0,79,117,116,32,111,102,32,115,116,114,101,97,109,115,32,114,101,115,111,117,114,99,101,115,0,76,105,110,107,32,104,97,115,32,98,101,101,110,32,115,101,118,101,114,101,100,0,80,114,111,116,111,99,111,108,32,101,114,114,111,114,0,66,97,100,32,109,101,115,115,97,103,101,0,70,105,108,101,32,100,101,115,99,114,105,112,116,111,114,32,105,110,32,98,97,100,32,115,116,97,116,101,0,78,111,116,32,97,32,115,111,99,107,101,116,0,68,101,115,116,105,110,97,116,105,111,110,32,97,100,100,114,101,115,115,32,114,101,113,117,105,114,101,100,0,77,101,115,115,97,103,101,32,116,111,111,32,108,97,114,103,101,0,80,114,111,116,111,99,111,108,32,119,114,111,110,103,32,116,121,112,101,32,102,111,114,32,115,111,99,107,101,116,0,80,114,111,116,111,99,111,108,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,80,114,111,116,111,99,111,108,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,83,111,99,107,101,116,32,116,121,112,101,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,78,111,116,32,115,117,112,112,111,114,116,101,100,0,80,114,111,116,111,99,111,108,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,65,100,100,114,101,115,115,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,32,98,121,32,112,114,111,116,111,99,111,108,0,65,100,100,114,101,115,115,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,78,101,116,119,111,114,107,32,105,115,32,100,111,119,110,0,78,101,116,119,111,114,107,32,117,110,114,101,97,99,104,97,98,108,101,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,110,101,116,119,111,114,107,0,67,111,110,110,101,99,116,105,111,110,32,97,98,111,114,116,101,100,0,78,111,32,98,117,102,102,101,114,32,115,112,97,99,101,32,97,118,97,105,108,97,98,108,101,0,83,111,99,107,101,116,32,105,115,32,99,111,110,110,101,99,116,101,100,0,83,111,99,107,101,116,32,110,111,116,32,99,111,110,110,101,99,116,101,100,0,67,97,110,110,111,116,32,115,101,110,100,32,97,102,116,101,114,32,115,111,99,107,101,116,32,115,104,117,116,100,111,119,110,0,79,112,101,114,97,116,105,111,110,32,97,108,114,101,97,100,121,32,105,110,32,112,114,111,103,114,101,115,115,0,79,112,101,114,97,116,105,111,110,32,105,110,32,112,114,111,103,114,101,115,115,0,83,116,97,108,101,32,102,105,108,101,32,104,97,110,100,108,101,0,82,101,109,111,116,101,32,73,47,79,32,101,114,114,111,114,0,81,117,111,116,97,32,101,120,99,101,101,100,101,100,0,78,111,32,109,101,100,105,117,109,32,102,111,117,110,100,0,87,114,111,110,103,32,109,101,100,105,117,109,32,116,121,112,101,0,78,111,32,101,114,114,111,114,32,105,110,102,111,114,109,97,116,105,111,110,0,0],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE);var tempDoublePtr=STATICTOP;STATICTOP+=16;function _atexit(t,e){__ATEXIT__.unshift({func:t,arg:e})}function ___cxa_atexit(){return _atexit.apply(null,arguments)}function _abort(){Module.abort()}function __ZN8facebook4yoga14YGNodeToStringEPNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEP6YGNode14YGPrintOptionsj(){Module.printErr("missing function: _ZN8facebook4yoga14YGNodeToStringEPNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEP6YGNode14YGPrintOptionsj"),abort(-1)}function __decorate(t,e,r,o){var a=arguments.length,n=a<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,r):o,u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,r,o);else for(var A=t.length-1;A>=0;A--)(u=t[A])&&(n=(a<3?u(n):a>3?u(e,r,n):u(e,r))||n);return a>3&&n&&Object.defineProperty(e,r,n),n}function _defineHidden(t){return function(e,r){Object.defineProperty(e,r,{configurable:!1,enumerable:!1,value:t,writable:!0})}}var _nbind={};function __nbind_free_external(t){_nbind.externalList[t].dereference(t)}function __nbind_reference_external(t){_nbind.externalList[t].reference()}function _llvm_stackrestore(t){var e=_llvm_stacksave,r=e.LLVM_SAVEDSTACKS[t];e.LLVM_SAVEDSTACKS.splice(t,1),Runtime.stackRestore(r)}function __nbind_register_pool(t,e,r,o){_nbind.Pool.pageSize=t,_nbind.Pool.usedPtr=e/4,_nbind.Pool.rootPtr=r,_nbind.Pool.pagePtr=o/4,HEAP32[e/4]=16909060,HEAP8[e]==1&&(_nbind.bigEndian=!0),HEAP32[e/4]=0,_nbind.makeTypeKindTbl=(n={},n[1024]=_nbind.PrimitiveType,n[64]=_nbind.Int64Type,n[2048]=_nbind.BindClass,n[3072]=_nbind.BindClassPtr,n[4096]=_nbind.SharedClassPtr,n[5120]=_nbind.ArrayType,n[6144]=_nbind.ArrayType,n[7168]=_nbind.CStringType,n[9216]=_nbind.CallbackType,n[10240]=_nbind.BindType,n),_nbind.makeTypeNameTbl={Buffer:_nbind.BufferType,External:_nbind.ExternalType,Int64:_nbind.Int64Type,_nbind_new:_nbind.CreateValueType,bool:_nbind.BooleanType,"cbFunction &":_nbind.CallbackType,"const cbFunction &":_nbind.CallbackType,"const std::string &":_nbind.StringType,"std::string":_nbind.StringType},Module.toggleLightGC=_nbind.toggleLightGC,_nbind.callUpcast=Module.dynCall_ii;var a=_nbind.makeType(_nbind.constructType,{flags:2048,id:0,name:""});a.proto=Module,_nbind.BindClass.list.push(a);var n}function _emscripten_set_main_loop_timing(t,e){if(Browser.mainLoop.timingMode=t,Browser.mainLoop.timingValue=e,!Browser.mainLoop.func)return 1;if(t==0)Browser.mainLoop.scheduler=function(){var u=Math.max(0,Browser.mainLoop.tickStartTime+e-_emscripten_get_now())|0;setTimeout(Browser.mainLoop.runner,u)},Browser.mainLoop.method="timeout";else if(t==1)Browser.mainLoop.scheduler=function(){Browser.requestAnimationFrame(Browser.mainLoop.runner)},Browser.mainLoop.method="rAF";else if(t==2){if(!window.setImmediate){let n=function(u){u.source===window&&u.data===o&&(u.stopPropagation(),r.shift()())};var a=n,r=[],o="setimmediate";window.addEventListener("message",n,!0),window.setImmediate=function(A){r.push(A),ENVIRONMENT_IS_WORKER?(Module.setImmediates===void 0&&(Module.setImmediates=[]),Module.setImmediates.push(A),window.postMessage({target:o})):window.postMessage(o,"*")}}Browser.mainLoop.scheduler=function(){window.setImmediate(Browser.mainLoop.runner)},Browser.mainLoop.method="immediate"}return 0}function _emscripten_get_now(){abort()}function _emscripten_set_main_loop(t,e,r,o,a){Module.noExitRuntime=!0,assert(!Browser.mainLoop.func,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters."),Browser.mainLoop.func=t,Browser.mainLoop.arg=o;var n;typeof o<"u"?n=function(){Module.dynCall_vi(t,o)}:n=function(){Module.dynCall_v(t)};var u=Browser.mainLoop.currentlyRunningMainloop;if(Browser.mainLoop.runner=function(){if(!ABORT){if(Browser.mainLoop.queue.length>0){var p=Date.now(),h=Browser.mainLoop.queue.shift();if(h.func(h.arg),Browser.mainLoop.remainingBlockers){var E=Browser.mainLoop.remainingBlockers,w=E%1==0?E-1:Math.floor(E);h.counted?Browser.mainLoop.remainingBlockers=w:(w=w+.5,Browser.mainLoop.remainingBlockers=(8*E+w)/9)}if(console.log('main loop blocker "'+h.name+'" took '+(Date.now()-p)+" ms"),Browser.mainLoop.updateStatus(),u1&&Browser.mainLoop.currentFrameNumber%Browser.mainLoop.timingValue!=0){Browser.mainLoop.scheduler();return}else Browser.mainLoop.timingMode==0&&(Browser.mainLoop.tickStartTime=_emscripten_get_now());Browser.mainLoop.method==="timeout"&&Module.ctx&&(Module.printErr("Looks like you are rendering without using requestAnimationFrame for the main loop. You should use 0 for the frame rate in emscripten_set_main_loop in order to use requestAnimationFrame, as that can greatly improve your frame rates!"),Browser.mainLoop.method=""),Browser.mainLoop.runIter(n),!(u0?_emscripten_set_main_loop_timing(0,1e3/e):_emscripten_set_main_loop_timing(1,1),Browser.mainLoop.scheduler()),r)throw"SimulateInfiniteLoop"}var Browser={mainLoop:{scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause:function(){Browser.mainLoop.scheduler=null,Browser.mainLoop.currentlyRunningMainloop++},resume:function(){Browser.mainLoop.currentlyRunningMainloop++;var t=Browser.mainLoop.timingMode,e=Browser.mainLoop.timingValue,r=Browser.mainLoop.func;Browser.mainLoop.func=null,_emscripten_set_main_loop(r,0,!1,Browser.mainLoop.arg,!0),_emscripten_set_main_loop_timing(t,e),Browser.mainLoop.scheduler()},updateStatus:function(){if(Module.setStatus){var t=Module.statusMessage||"Please wait...",e=Browser.mainLoop.remainingBlockers,r=Browser.mainLoop.expectedBlockers;e?e"u"&&(console.log("warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available."),Module.noImageDecoding=!0);var t={};t.canHandle=function(n){return!Module.noImageDecoding&&/\.(jpg|jpeg|png|bmp)$/i.test(n)},t.handle=function(n,u,A,p){var h=null;if(Browser.hasBlobConstructor)try{h=new Blob([n],{type:Browser.getMimetype(u)}),h.size!==n.length&&(h=new Blob([new Uint8Array(n).buffer],{type:Browser.getMimetype(u)}))}catch(b){Runtime.warnOnce("Blob constructor present but fails: "+b+"; falling back to blob builder")}if(!h){var E=new Browser.BlobBuilder;E.append(new Uint8Array(n).buffer),h=E.getBlob()}var w=Browser.URLObject.createObjectURL(h),D=new Image;D.onload=function(){assert(D.complete,"Image "+u+" could not be decoded");var C=document.createElement("canvas");C.width=D.width,C.height=D.height;var T=C.getContext("2d");T.drawImage(D,0,0),Module.preloadedImages[u]=C,Browser.URLObject.revokeObjectURL(w),A&&A(n)},D.onerror=function(C){console.log("Image "+w+" could not be decoded"),p&&p()},D.src=w},Module.preloadPlugins.push(t);var e={};e.canHandle=function(n){return!Module.noAudioDecoding&&n.substr(-4)in{".ogg":1,".wav":1,".mp3":1}},e.handle=function(n,u,A,p){var h=!1;function E(T){h||(h=!0,Module.preloadedAudios[u]=T,A&&A(n))}function w(){h||(h=!0,Module.preloadedAudios[u]=new Audio,p&&p())}if(Browser.hasBlobConstructor){try{var D=new Blob([n],{type:Browser.getMimetype(u)})}catch{return w()}var b=Browser.URLObject.createObjectURL(D),C=new Audio;C.addEventListener("canplaythrough",function(){E(C)},!1),C.onerror=function(N){if(h)return;console.log("warning: browser could not fully decode audio "+u+", trying slower base64 approach");function U(z){for(var te="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",le="=",ce="",ue=0,Ie=0,he=0;he=6;){var De=ue>>Ie-6&63;Ie-=6,ce+=te[De]}return Ie==2?(ce+=te[(ue&3)<<4],ce+=le+le):Ie==4&&(ce+=te[(ue&15)<<2],ce+=le),ce}C.src="data:audio/x-"+u.substr(-3)+";base64,"+U(n),E(C)},C.src=b,Browser.safeSetTimeout(function(){E(C)},1e4)}else return w()},Module.preloadPlugins.push(e);function r(){Browser.pointerLock=document.pointerLockElement===Module.canvas||document.mozPointerLockElement===Module.canvas||document.webkitPointerLockElement===Module.canvas||document.msPointerLockElement===Module.canvas}var o=Module.canvas;o&&(o.requestPointerLock=o.requestPointerLock||o.mozRequestPointerLock||o.webkitRequestPointerLock||o.msRequestPointerLock||function(){},o.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||function(){},o.exitPointerLock=o.exitPointerLock.bind(document),document.addEventListener("pointerlockchange",r,!1),document.addEventListener("mozpointerlockchange",r,!1),document.addEventListener("webkitpointerlockchange",r,!1),document.addEventListener("mspointerlockchange",r,!1),Module.elementPointerLock&&o.addEventListener("click",function(a){!Browser.pointerLock&&Module.canvas.requestPointerLock&&(Module.canvas.requestPointerLock(),a.preventDefault())},!1))},createContext:function(t,e,r,o){if(e&&Module.ctx&&t==Module.canvas)return Module.ctx;var a,n;if(e){var u={antialias:!1,alpha:!1};if(o)for(var A in o)u[A]=o[A];n=GL.createContext(t,u),n&&(a=GL.getContext(n).GLctx)}else a=t.getContext("2d");return a?(r&&(e||assert(typeof GLctx>"u","cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),Module.ctx=a,e&&GL.makeContextCurrent(n),Module.useWebGL=e,Browser.moduleContextCreatedCallbacks.forEach(function(p){p()}),Browser.init()),a):null},destroyContext:function(t,e,r){},fullscreenHandlersInstalled:!1,lockPointer:void 0,resizeCanvas:void 0,requestFullscreen:function(t,e,r){Browser.lockPointer=t,Browser.resizeCanvas=e,Browser.vrDevice=r,typeof Browser.lockPointer>"u"&&(Browser.lockPointer=!0),typeof Browser.resizeCanvas>"u"&&(Browser.resizeCanvas=!1),typeof Browser.vrDevice>"u"&&(Browser.vrDevice=null);var o=Module.canvas;function a(){Browser.isFullscreen=!1;var u=o.parentNode;(document.fullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.webkitFullscreenElement||document.webkitCurrentFullScreenElement)===u?(o.exitFullscreen=document.exitFullscreen||document.cancelFullScreen||document.mozCancelFullScreen||document.msExitFullscreen||document.webkitCancelFullScreen||function(){},o.exitFullscreen=o.exitFullscreen.bind(document),Browser.lockPointer&&o.requestPointerLock(),Browser.isFullscreen=!0,Browser.resizeCanvas&&Browser.setFullscreenCanvasSize()):(u.parentNode.insertBefore(o,u),u.parentNode.removeChild(u),Browser.resizeCanvas&&Browser.setWindowedCanvasSize()),Module.onFullScreen&&Module.onFullScreen(Browser.isFullscreen),Module.onFullscreen&&Module.onFullscreen(Browser.isFullscreen),Browser.updateCanvasDimensions(o)}Browser.fullscreenHandlersInstalled||(Browser.fullscreenHandlersInstalled=!0,document.addEventListener("fullscreenchange",a,!1),document.addEventListener("mozfullscreenchange",a,!1),document.addEventListener("webkitfullscreenchange",a,!1),document.addEventListener("MSFullscreenChange",a,!1));var n=document.createElement("div");o.parentNode.insertBefore(n,o),n.appendChild(o),n.requestFullscreen=n.requestFullscreen||n.mozRequestFullScreen||n.msRequestFullscreen||(n.webkitRequestFullscreen?function(){n.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)}:null)||(n.webkitRequestFullScreen?function(){n.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:null),r?n.requestFullscreen({vrDisplay:r}):n.requestFullscreen()},requestFullScreen:function(t,e,r){return Module.printErr("Browser.requestFullScreen() is deprecated. Please call Browser.requestFullscreen instead."),Browser.requestFullScreen=function(o,a,n){return Browser.requestFullscreen(o,a,n)},Browser.requestFullscreen(t,e,r)},nextRAF:0,fakeRequestAnimationFrame:function(t){var e=Date.now();if(Browser.nextRAF===0)Browser.nextRAF=e+1e3/60;else for(;e+2>=Browser.nextRAF;)Browser.nextRAF+=1e3/60;var r=Math.max(Browser.nextRAF-e,0);setTimeout(t,r)},requestAnimationFrame:function t(e){typeof window>"u"?Browser.fakeRequestAnimationFrame(e):(window.requestAnimationFrame||(window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||Browser.fakeRequestAnimationFrame),window.requestAnimationFrame(e))},safeCallback:function(t){return function(){if(!ABORT)return t.apply(null,arguments)}},allowAsyncCallbacks:!0,queuedAsyncCallbacks:[],pauseAsyncCallbacks:function(){Browser.allowAsyncCallbacks=!1},resumeAsyncCallbacks:function(){if(Browser.allowAsyncCallbacks=!0,Browser.queuedAsyncCallbacks.length>0){var t=Browser.queuedAsyncCallbacks;Browser.queuedAsyncCallbacks=[],t.forEach(function(e){e()})}},safeRequestAnimationFrame:function(t){return Browser.requestAnimationFrame(function(){ABORT||(Browser.allowAsyncCallbacks?t():Browser.queuedAsyncCallbacks.push(t))})},safeSetTimeout:function(t,e){return Module.noExitRuntime=!0,setTimeout(function(){ABORT||(Browser.allowAsyncCallbacks?t():Browser.queuedAsyncCallbacks.push(t))},e)},safeSetInterval:function(t,e){return Module.noExitRuntime=!0,setInterval(function(){ABORT||Browser.allowAsyncCallbacks&&t()},e)},getMimetype:function(t){return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[t.substr(t.lastIndexOf(".")+1)]},getUserMedia:function(t){window.getUserMedia||(window.getUserMedia=navigator.getUserMedia||navigator.mozGetUserMedia),window.getUserMedia(t)},getMovementX:function(t){return t.movementX||t.mozMovementX||t.webkitMovementX||0},getMovementY:function(t){return t.movementY||t.mozMovementY||t.webkitMovementY||0},getMouseWheelDelta:function(t){var e=0;switch(t.type){case"DOMMouseScroll":e=t.detail;break;case"mousewheel":e=t.wheelDelta;break;case"wheel":e=t.deltaY;break;default:throw"unrecognized mouse wheel event: "+t.type}return e},mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,touches:{},lastTouches:{},calculateMouseEvent:function(t){if(Browser.pointerLock)t.type!="mousemove"&&"mozMovementX"in t?Browser.mouseMovementX=Browser.mouseMovementY=0:(Browser.mouseMovementX=Browser.getMovementX(t),Browser.mouseMovementY=Browser.getMovementY(t)),typeof SDL<"u"?(Browser.mouseX=SDL.mouseX+Browser.mouseMovementX,Browser.mouseY=SDL.mouseY+Browser.mouseMovementY):(Browser.mouseX+=Browser.mouseMovementX,Browser.mouseY+=Browser.mouseMovementY);else{var e=Module.canvas.getBoundingClientRect(),r=Module.canvas.width,o=Module.canvas.height,a=typeof window.scrollX<"u"?window.scrollX:window.pageXOffset,n=typeof window.scrollY<"u"?window.scrollY:window.pageYOffset;if(t.type==="touchstart"||t.type==="touchend"||t.type==="touchmove"){var u=t.touch;if(u===void 0)return;var A=u.pageX-(a+e.left),p=u.pageY-(n+e.top);A=A*(r/e.width),p=p*(o/e.height);var h={x:A,y:p};if(t.type==="touchstart")Browser.lastTouches[u.identifier]=h,Browser.touches[u.identifier]=h;else if(t.type==="touchend"||t.type==="touchmove"){var E=Browser.touches[u.identifier];E||(E=h),Browser.lastTouches[u.identifier]=E,Browser.touches[u.identifier]=h}return}var w=t.pageX-(a+e.left),D=t.pageY-(n+e.top);w=w*(r/e.width),D=D*(o/e.height),Browser.mouseMovementX=w-Browser.mouseX,Browser.mouseMovementY=D-Browser.mouseY,Browser.mouseX=w,Browser.mouseY=D}},asyncLoad:function(t,e,r,o){var a=o?"":"al "+t;Module.readAsync(t,function(n){assert(n,'Loading data file "'+t+'" failed (no arrayBuffer).'),e(new Uint8Array(n)),a&&removeRunDependency(a)},function(n){if(r)r();else throw'Loading data file "'+t+'" failed.'}),a&&addRunDependency(a)},resizeListeners:[],updateResizeListeners:function(){var t=Module.canvas;Browser.resizeListeners.forEach(function(e){e(t.width,t.height)})},setCanvasSize:function(t,e,r){var o=Module.canvas;Browser.updateCanvasDimensions(o,t,e),r||Browser.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullscreenCanvasSize:function(){if(typeof SDL<"u"){var t=HEAPU32[SDL.screen+Runtime.QUANTUM_SIZE*0>>2];t=t|8388608,HEAP32[SDL.screen+Runtime.QUANTUM_SIZE*0>>2]=t}Browser.updateResizeListeners()},setWindowedCanvasSize:function(){if(typeof SDL<"u"){var t=HEAPU32[SDL.screen+Runtime.QUANTUM_SIZE*0>>2];t=t&-8388609,HEAP32[SDL.screen+Runtime.QUANTUM_SIZE*0>>2]=t}Browser.updateResizeListeners()},updateCanvasDimensions:function(t,e,r){e&&r?(t.widthNative=e,t.heightNative=r):(e=t.widthNative,r=t.heightNative);var o=e,a=r;if(Module.forcedAspectRatio&&Module.forcedAspectRatio>0&&(o/a>2];return e},getStr:function(){var t=Pointer_stringify(SYSCALLS.get());return t},get64:function(){var t=SYSCALLS.get(),e=SYSCALLS.get();return t>=0?assert(e===0):assert(e===-1),t},getZero:function(){assert(SYSCALLS.get()===0)}};function ___syscall6(t,e){SYSCALLS.varargs=e;try{var r=SYSCALLS.getStreamFromFD();return FS.close(r),0}catch(o){return(typeof FS>"u"||!(o instanceof FS.ErrnoError))&&abort(o),-o.errno}}function ___syscall54(t,e){SYSCALLS.varargs=e;try{return 0}catch(r){return(typeof FS>"u"||!(r instanceof FS.ErrnoError))&&abort(r),-r.errno}}function _typeModule(t){var e=[[0,1,"X"],[1,1,"const X"],[128,1,"X *"],[256,1,"X &"],[384,1,"X &&"],[512,1,"std::shared_ptr"],[640,1,"std::unique_ptr"],[5120,1,"std::vector"],[6144,2,"std::array"],[9216,-1,"std::function"]];function r(p,h,E,w,D,b){if(h==1){var C=w&896;(C==128||C==256||C==384)&&(p="X const")}var T;return b?T=E.replace("X",p).replace("Y",D):T=p.replace("X",E).replace("Y",D),T.replace(/([*&]) (?=[*&])/g,"$1")}function o(p,h,E,w,D){throw new Error(p+" type "+E.replace("X",h+"?")+(w?" with flag "+w:"")+" in "+D)}function a(p,h,E,w,D,b,C,T){b===void 0&&(b="X"),T===void 0&&(T=1);var N=E(p);if(N)return N;var U=w(p),z=U.placeholderFlag,te=e[z];C&&te&&(b=r(C[2],C[0],b,te[0],"?",!0));var le;z==0&&(le="Unbound"),z>=10&&(le="Corrupt"),T>20&&(le="Deeply nested"),le&&o(le,p,b,z,D||"?");var ce=U.paramList[0],ue=a(ce,h,E,w,D,b,te,T+1),Ie,he={flags:te[0],id:p,name:"",paramList:[ue]},De=[],Ee="?";switch(U.placeholderFlag){case 1:Ie=ue.spec;break;case 2:if((ue.flags&15360)==1024&&ue.spec.ptrSize==1){he.flags=7168;break}case 3:case 6:case 5:Ie=ue.spec,ue.flags&15360;break;case 8:Ee=""+U.paramList[1],he.paramList.push(U.paramList[1]);break;case 9:for(var g=0,me=U.paramList[1];g>2]=t),t}function _llvm_stacksave(){var t=_llvm_stacksave;return t.LLVM_SAVEDSTACKS||(t.LLVM_SAVEDSTACKS=[]),t.LLVM_SAVEDSTACKS.push(Runtime.stackSave()),t.LLVM_SAVEDSTACKS.length-1}function ___syscall140(t,e){SYSCALLS.varargs=e;try{var r=SYSCALLS.getStreamFromFD(),o=SYSCALLS.get(),a=SYSCALLS.get(),n=SYSCALLS.get(),u=SYSCALLS.get(),A=a;return FS.llseek(r,A,u),HEAP32[n>>2]=r.position,r.getdents&&A===0&&u===0&&(r.getdents=null),0}catch(p){return(typeof FS>"u"||!(p instanceof FS.ErrnoError))&&abort(p),-p.errno}}function ___syscall146(t,e){SYSCALLS.varargs=e;try{var r=SYSCALLS.get(),o=SYSCALLS.get(),a=SYSCALLS.get(),n=0;___syscall146.buffer||(___syscall146.buffers=[null,[],[]],___syscall146.printChar=function(E,w){var D=___syscall146.buffers[E];assert(D),w===0||w===10?((E===1?Module.print:Module.printErr)(UTF8ArrayToString(D,0)),D.length=0):D.push(w)});for(var u=0;u>2],p=HEAP32[o+(u*8+4)>>2],h=0;h"u"||!(E instanceof FS.ErrnoError))&&abort(E),-E.errno}}function __nbind_finish(){for(var t=0,e=_nbind.BindClass.list;tt.pageSize/2||e>t.pageSize-r){var o=_nbind.typeNameTbl.NBind.proto;return o.lalloc(e)}else return HEAPU32[t.usedPtr]=r+e,t.rootPtr+r},t.lreset=function(e,r){var o=HEAPU32[t.pagePtr];if(o){var a=_nbind.typeNameTbl.NBind.proto;a.lreset(e,r)}else HEAPU32[t.usedPtr]=e},t}();_nbind.Pool=Pool;function constructType(t,e){var r=t==10240?_nbind.makeTypeNameTbl[e.name]||_nbind.BindType:_nbind.makeTypeKindTbl[t],o=new r(e);return typeIdTbl[e.id]=o,_nbind.typeNameTbl[e.name]=o,o}_nbind.constructType=constructType;function getType(t){return typeIdTbl[t]}_nbind.getType=getType;function queryType(t){var e=HEAPU8[t],r=_nbind.structureList[e][1];t/=4,r<0&&(++t,r=HEAPU32[t]+1);var o=Array.prototype.slice.call(HEAPU32.subarray(t+1,t+1+r));return e==9&&(o=[o[0],o.slice(1)]),{paramList:o,placeholderFlag:e}}_nbind.queryType=queryType;function getTypes(t,e){return t.map(function(r){return typeof r=="number"?_nbind.getComplexType(r,constructType,getType,queryType,e):_nbind.typeNameTbl[r]})}_nbind.getTypes=getTypes;function readTypeIdList(t,e){return Array.prototype.slice.call(HEAPU32,t/4,t/4+e)}_nbind.readTypeIdList=readTypeIdList;function readAsciiString(t){for(var e=t;HEAPU8[e++];);return String.fromCharCode.apply("",HEAPU8.subarray(t,e-1))}_nbind.readAsciiString=readAsciiString;function readPolicyList(t){var e={};if(t)for(;;){var r=HEAPU32[t/4];if(!r)break;e[readAsciiString(r)]=!0,t+=4}return e}_nbind.readPolicyList=readPolicyList;function getDynCall(t,e){var r={float32_t:"d",float64_t:"d",int64_t:"d",uint64_t:"d",void:"v"},o=t.map(function(n){return r[n.name]||"i"}).join(""),a=Module["dynCall_"+o];if(!a)throw new Error("dynCall_"+o+" not found for "+e+"("+t.map(function(n){return n.name}).join(", ")+")");return a}_nbind.getDynCall=getDynCall;function addMethod(t,e,r,o){var a=t[e];t.hasOwnProperty(e)&&a?((a.arity||a.arity===0)&&(a=_nbind.makeOverloader(a,a.arity),t[e]=a),a.addMethod(r,o)):(r.arity=o,t[e]=r)}_nbind.addMethod=addMethod;function throwError(t){throw new Error(t)}_nbind.throwError=throwError,_nbind.bigEndian=!1,_a=_typeModule(_typeModule),_nbind.Type=_a.Type,_nbind.makeType=_a.makeType,_nbind.getComplexType=_a.getComplexType,_nbind.structureList=_a.structureList;var BindType=function(t){__extends(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.heap=HEAPU32,r.ptrSize=4,r}return e.prototype.needsWireRead=function(r){return!!this.wireRead||!!this.makeWireRead},e.prototype.needsWireWrite=function(r){return!!this.wireWrite||!!this.makeWireWrite},e}(_nbind.Type);_nbind.BindType=BindType;var PrimitiveType=function(t){__extends(e,t);function e(r){var o=t.call(this,r)||this,a=r.flags&32?{32:HEAPF32,64:HEAPF64}:r.flags&8?{8:HEAPU8,16:HEAPU16,32:HEAPU32}:{8:HEAP8,16:HEAP16,32:HEAP32};return o.heap=a[r.ptrSize*8],o.ptrSize=r.ptrSize,o}return e.prototype.needsWireWrite=function(r){return!!r&&!!r.Strict},e.prototype.makeWireWrite=function(r,o){return o&&o.Strict&&function(a){if(typeof a=="number")return a;throw new Error("Type mismatch")}},e}(BindType);_nbind.PrimitiveType=PrimitiveType;function pushCString(t,e){if(t==null){if(e&&e.Nullable)return 0;throw new Error("Type mismatch")}if(e&&e.Strict){if(typeof t!="string")throw new Error("Type mismatch")}else t=t.toString();var r=Module.lengthBytesUTF8(t)+1,o=_nbind.Pool.lalloc(r);return Module.stringToUTF8Array(t,HEAPU8,o,r),o}_nbind.pushCString=pushCString;function popCString(t){return t===0?null:Module.Pointer_stringify(t)}_nbind.popCString=popCString;var CStringType=function(t){__extends(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.wireRead=popCString,r.wireWrite=pushCString,r.readResources=[_nbind.resources.pool],r.writeResources=[_nbind.resources.pool],r}return e.prototype.makeWireWrite=function(r,o){return function(a){return pushCString(a,o)}},e}(BindType);_nbind.CStringType=CStringType;var BooleanType=function(t){__extends(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.wireRead=function(o){return!!o},r}return e.prototype.needsWireWrite=function(r){return!!r&&!!r.Strict},e.prototype.makeWireRead=function(r){return"!!("+r+")"},e.prototype.makeWireWrite=function(r,o){return o&&o.Strict&&function(a){if(typeof a=="boolean")return a;throw new Error("Type mismatch")}||r},e}(BindType);_nbind.BooleanType=BooleanType;var Wrapper=function(){function t(){}return t.prototype.persist=function(){this.__nbindState|=1},t}();_nbind.Wrapper=Wrapper;function makeBound(t,e){var r=function(o){__extends(a,o);function a(n,u,A,p){var h=o.call(this)||this;if(!(h instanceof a))return new(Function.prototype.bind.apply(a,Array.prototype.concat.apply([null],arguments)));var E=u,w=A,D=p;if(n!==_nbind.ptrMarker){var b=h.__nbindConstructor.apply(h,arguments);E=4608,D=HEAPU32[b/4],w=HEAPU32[b/4+1]}var C={configurable:!0,enumerable:!1,value:null,writable:!1},T={__nbindFlags:E,__nbindPtr:w};D&&(T.__nbindShared=D,_nbind.mark(h));for(var N=0,U=Object.keys(T);N>=1;var r=_nbind.valueList[t];return _nbind.valueList[t]=firstFreeValue,firstFreeValue=t,r}else{if(e)return _nbind.popShared(t,e);throw new Error("Invalid value slot "+t)}}_nbind.popValue=popValue;var valueBase=18446744073709552e3;function push64(t){return typeof t=="number"?t:pushValue(t)*4096+valueBase}function pop64(t){return t=3?u=Buffer.from(n):u=new Buffer(n),u.copy(o)}else getBuffer(o).set(n)}}_nbind.commitBuffer=commitBuffer;var dirtyList=[],gcTimer=0;function sweep(){for(var t=0,e=dirtyList;t>2]=DYNAMIC_BASE,staticSealed=!0;function invoke_viiiii(t,e,r,o,a,n){try{Module.dynCall_viiiii(t,e,r,o,a,n)}catch(u){if(typeof u!="number"&&u!=="longjmp")throw u;Module.setThrew(1,0)}}function invoke_vif(t,e,r){try{Module.dynCall_vif(t,e,r)}catch(o){if(typeof o!="number"&&o!=="longjmp")throw o;Module.setThrew(1,0)}}function invoke_vid(t,e,r){try{Module.dynCall_vid(t,e,r)}catch(o){if(typeof o!="number"&&o!=="longjmp")throw o;Module.setThrew(1,0)}}function invoke_fiff(t,e,r,o){try{return Module.dynCall_fiff(t,e,r,o)}catch(a){if(typeof a!="number"&&a!=="longjmp")throw a;Module.setThrew(1,0)}}function invoke_vi(t,e){try{Module.dynCall_vi(t,e)}catch(r){if(typeof r!="number"&&r!=="longjmp")throw r;Module.setThrew(1,0)}}function invoke_vii(t,e,r){try{Module.dynCall_vii(t,e,r)}catch(o){if(typeof o!="number"&&o!=="longjmp")throw o;Module.setThrew(1,0)}}function invoke_ii(t,e){try{return Module.dynCall_ii(t,e)}catch(r){if(typeof r!="number"&&r!=="longjmp")throw r;Module.setThrew(1,0)}}function invoke_viddi(t,e,r,o,a){try{Module.dynCall_viddi(t,e,r,o,a)}catch(n){if(typeof n!="number"&&n!=="longjmp")throw n;Module.setThrew(1,0)}}function invoke_vidd(t,e,r,o){try{Module.dynCall_vidd(t,e,r,o)}catch(a){if(typeof a!="number"&&a!=="longjmp")throw a;Module.setThrew(1,0)}}function invoke_iiii(t,e,r,o){try{return Module.dynCall_iiii(t,e,r,o)}catch(a){if(typeof a!="number"&&a!=="longjmp")throw a;Module.setThrew(1,0)}}function invoke_diii(t,e,r,o){try{return Module.dynCall_diii(t,e,r,o)}catch(a){if(typeof a!="number"&&a!=="longjmp")throw a;Module.setThrew(1,0)}}function invoke_di(t,e){try{return Module.dynCall_di(t,e)}catch(r){if(typeof r!="number"&&r!=="longjmp")throw r;Module.setThrew(1,0)}}function invoke_iid(t,e,r){try{return Module.dynCall_iid(t,e,r)}catch(o){if(typeof o!="number"&&o!=="longjmp")throw o;Module.setThrew(1,0)}}function invoke_iii(t,e,r){try{return Module.dynCall_iii(t,e,r)}catch(o){if(typeof o!="number"&&o!=="longjmp")throw o;Module.setThrew(1,0)}}function invoke_viiddi(t,e,r,o,a,n){try{Module.dynCall_viiddi(t,e,r,o,a,n)}catch(u){if(typeof u!="number"&&u!=="longjmp")throw u;Module.setThrew(1,0)}}function invoke_viiiiii(t,e,r,o,a,n,u){try{Module.dynCall_viiiiii(t,e,r,o,a,n,u)}catch(A){if(typeof A!="number"&&A!=="longjmp")throw A;Module.setThrew(1,0)}}function invoke_dii(t,e,r){try{return Module.dynCall_dii(t,e,r)}catch(o){if(typeof o!="number"&&o!=="longjmp")throw o;Module.setThrew(1,0)}}function invoke_i(t){try{return Module.dynCall_i(t)}catch(e){if(typeof e!="number"&&e!=="longjmp")throw e;Module.setThrew(1,0)}}function invoke_iiiiii(t,e,r,o,a,n){try{return Module.dynCall_iiiiii(t,e,r,o,a,n)}catch(u){if(typeof u!="number"&&u!=="longjmp")throw u;Module.setThrew(1,0)}}function invoke_viiid(t,e,r,o,a){try{Module.dynCall_viiid(t,e,r,o,a)}catch(n){if(typeof n!="number"&&n!=="longjmp")throw n;Module.setThrew(1,0)}}function invoke_viififi(t,e,r,o,a,n,u){try{Module.dynCall_viififi(t,e,r,o,a,n,u)}catch(A){if(typeof A!="number"&&A!=="longjmp")throw A;Module.setThrew(1,0)}}function invoke_viii(t,e,r,o){try{Module.dynCall_viii(t,e,r,o)}catch(a){if(typeof a!="number"&&a!=="longjmp")throw a;Module.setThrew(1,0)}}function invoke_v(t){try{Module.dynCall_v(t)}catch(e){if(typeof e!="number"&&e!=="longjmp")throw e;Module.setThrew(1,0)}}function invoke_viid(t,e,r,o){try{Module.dynCall_viid(t,e,r,o)}catch(a){if(typeof a!="number"&&a!=="longjmp")throw a;Module.setThrew(1,0)}}function invoke_idd(t,e,r){try{return Module.dynCall_idd(t,e,r)}catch(o){if(typeof o!="number"&&o!=="longjmp")throw o;Module.setThrew(1,0)}}function invoke_viiii(t,e,r,o,a){try{Module.dynCall_viiii(t,e,r,o,a)}catch(n){if(typeof n!="number"&&n!=="longjmp")throw n;Module.setThrew(1,0)}}Module.asmGlobalArg={Math,Int8Array,Int16Array,Int32Array,Uint8Array,Uint16Array,Uint32Array,Float32Array,Float64Array,NaN:NaN,Infinity:1/0},Module.asmLibraryArg={abort,assert,enlargeMemory,getTotalMemory,abortOnCannotGrowMemory,invoke_viiiii,invoke_vif,invoke_vid,invoke_fiff,invoke_vi,invoke_vii,invoke_ii,invoke_viddi,invoke_vidd,invoke_iiii,invoke_diii,invoke_di,invoke_iid,invoke_iii,invoke_viiddi,invoke_viiiiii,invoke_dii,invoke_i,invoke_iiiiii,invoke_viiid,invoke_viififi,invoke_viii,invoke_v,invoke_viid,invoke_idd,invoke_viiii,_emscripten_asm_const_iiiii,_emscripten_asm_const_iiidddddd,_emscripten_asm_const_iiiid,__nbind_reference_external,_emscripten_asm_const_iiiiiiii,_removeAccessorPrefix,_typeModule,__nbind_register_pool,__decorate,_llvm_stackrestore,___cxa_atexit,__extends,__nbind_get_value_object,__ZN8facebook4yoga14YGNodeToStringEPNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEP6YGNode14YGPrintOptionsj,_emscripten_set_main_loop_timing,__nbind_register_primitive,__nbind_register_type,_emscripten_memcpy_big,__nbind_register_function,___setErrNo,__nbind_register_class,__nbind_finish,_abort,_nbind_value,_llvm_stacksave,___syscall54,_defineHidden,_emscripten_set_main_loop,_emscripten_get_now,__nbind_register_callback_signature,_emscripten_asm_const_iiiiii,__nbind_free_external,_emscripten_asm_const_iiii,_emscripten_asm_const_iiididi,___syscall6,_atexit,___syscall140,___syscall146,DYNAMICTOP_PTR,tempDoublePtr,ABORT,STACKTOP,STACK_MAX,cttz_i8,___dso_handle};var asm=function(t,e,r){var o=new t.Int8Array(r),a=new t.Int16Array(r),n=new t.Int32Array(r),u=new t.Uint8Array(r),A=new t.Uint16Array(r),p=new t.Uint32Array(r),h=new t.Float32Array(r),E=new t.Float64Array(r),w=e.DYNAMICTOP_PTR|0,D=e.tempDoublePtr|0,b=e.ABORT|0,C=e.STACKTOP|0,T=e.STACK_MAX|0,N=e.cttz_i8|0,U=e.___dso_handle|0,z=0,te=0,le=0,ce=0,ue=t.NaN,Ie=t.Infinity,he=0,De=0,Ee=0,g=0,me=0,Ce=0,fe=t.Math.floor,ie=t.Math.abs,Z=t.Math.sqrt,Pe=t.Math.pow,Re=t.Math.cos,ht=t.Math.sin,q=t.Math.tan,nt=t.Math.acos,Le=t.Math.asin,Te=t.Math.atan,ke=t.Math.atan2,Ve=t.Math.exp,xe=t.Math.log,tt=t.Math.ceil,He=t.Math.imul,x=t.Math.min,I=t.Math.max,S=t.Math.clz32,y=t.Math.fround,R=e.abort,J=e.assert,X=e.enlargeMemory,$=e.getTotalMemory,se=e.abortOnCannotGrowMemory,be=e.invoke_viiiii,Fe=e.invoke_vif,lt=e.invoke_vid,Et=e.invoke_fiff,qt=e.invoke_vi,nr=e.invoke_vii,St=e.invoke_ii,cn=e.invoke_viddi,Pr=e.invoke_vidd,yr=e.invoke_iiii,Rr=e.invoke_diii,Xr=e.invoke_di,$n=e.invoke_iid,Xs=e.invoke_iii,Hi=e.invoke_viiddi,Qs=e.invoke_viiiiii,Zs=e.invoke_dii,bi=e.invoke_i,Fs=e.invoke_iiiiii,$s=e.invoke_viiid,SA=e.invoke_viififi,gu=e.invoke_viii,op=e.invoke_v,ap=e.invoke_viid,Rs=e.invoke_idd,Nn=e.invoke_viiii,hs=e._emscripten_asm_const_iiiii,Ts=e._emscripten_asm_const_iiidddddd,pc=e._emscripten_asm_const_iiiid,hc=e.__nbind_reference_external,gc=e._emscripten_asm_const_iiiiiiii,xA=e._removeAccessorPrefix,bA=e._typeModule,Ro=e.__nbind_register_pool,To=e.__decorate,kA=e._llvm_stackrestore,pr=e.___cxa_atexit,Me=e.__extends,ia=e.__nbind_get_value_object,dc=e.__ZN8facebook4yoga14YGNodeToStringEPNSt3__212basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEP6YGNode14YGPrintOptionsj,Er=e._emscripten_set_main_loop_timing,du=e.__nbind_register_primitive,QA=e.__nbind_register_type,FA=e._emscripten_memcpy_big,mc=e.__nbind_register_function,yc=e.___setErrNo,Il=e.__nbind_register_class,we=e.__nbind_finish,Tt=e._abort,wl=e._nbind_value,Bi=e._llvm_stacksave,Ls=e.___syscall54,Ft=e._defineHidden,Bn=e._emscripten_set_main_loop,Lo=e._emscripten_get_now,ki=e.__nbind_register_callback_signature,vi=e._emscripten_asm_const_iiiiii,sa=e.__nbind_free_external,un=e._emscripten_asm_const_iiii,qn=e._emscripten_asm_const_iiididi,Ec=e.___syscall6,lp=e._atexit,oa=e.___syscall140,aa=e.___syscall146,la=y(0);let Ze=y(0);function ca(s){s=s|0;var l=0;return l=C,C=C+s|0,C=C+15&-16,l|0}function mu(){return C|0}function Bl(s){s=s|0,C=s}function dn(s,l){s=s|0,l=l|0,C=s,T=l}function No(s,l){s=s|0,l=l|0,z||(z=s,te=l)}function RA(s){s=s|0,Ce=s}function TA(){return Ce|0}function Oo(){var s=0,l=0;br(8104,8,400)|0,br(8504,408,540)|0,s=9044,l=s+44|0;do n[s>>2]=0,s=s+4|0;while((s|0)<(l|0));o[9088]=0,o[9089]=1,n[2273]=0,n[2274]=948,n[2275]=948,pr(17,8104,U|0)|0}function qa(s){s=s|0,gt(s+948|0)}function Ot(s){return s=y(s),((AD(s)|0)&2147483647)>>>0>2139095040|0}function vn(s,l,c){s=s|0,l=l|0,c=c|0;e:do if(n[s+(l<<3)+4>>2]|0)s=s+(l<<3)|0;else{if((l|2|0)==3&&n[s+60>>2]|0){s=s+56|0;break}switch(l|0){case 0:case 2:case 4:case 5:{if(n[s+52>>2]|0){s=s+48|0;break e}break}default:}if(n[s+68>>2]|0){s=s+64|0;break}else{s=(l|1|0)==5?948:c;break}}while(!1);return s|0}function Mo(s){s=s|0;var l=0;return l=_D(1e3)|0,ua(s,(l|0)!=0,2456),n[2276]=(n[2276]|0)+1,br(l|0,8104,1e3)|0,o[s+2>>0]|0&&(n[l+4>>2]=2,n[l+12>>2]=4),n[l+976>>2]=s,l|0}function ua(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0;d=C,C=C+16|0,f=d,l||(n[f>>2]=c,d0(s,5,3197,f)),C=d}function qi(){return Mo(956)|0}function vl(s){s=s|0;var l=0;return l=Yt(1e3)|0,Cc(l,s),ua(n[s+976>>2]|0,1,2456),n[2276]=(n[2276]|0)+1,n[l+944>>2]=0,l|0}function Cc(s,l){s=s|0,l=l|0;var c=0;br(s|0,l|0,948)|0,Qd(s+948|0,l+948|0),c=s+960|0,s=l+960|0,l=c+40|0;do n[c>>2]=n[s>>2],c=c+4|0,s=s+4|0;while((c|0)<(l|0))}function Dl(s){s=s|0;var l=0,c=0,f=0,d=0;if(l=s+944|0,c=n[l>>2]|0,c|0&&(Aa(c+948|0,s)|0,n[l>>2]=0),c=Di(s)|0,c|0){l=0;do n[(rs(s,l)|0)+944>>2]=0,l=l+1|0;while((l|0)!=(c|0))}c=s+948|0,f=n[c>>2]|0,d=s+952|0,l=n[d>>2]|0,(l|0)!=(f|0)&&(n[d>>2]=l+(~((l+-4-f|0)>>>2)<<2)),ja(c),HD(s),n[2276]=(n[2276]|0)+-1}function Aa(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0,k=0;f=n[s>>2]|0,k=s+4|0,c=n[k>>2]|0,m=c;e:do if((f|0)==(c|0))d=f,B=4;else for(s=f;;){if((n[s>>2]|0)==(l|0)){d=s,B=4;break e}if(s=s+4|0,(s|0)==(c|0)){s=0;break}}while(!1);return(B|0)==4&&((d|0)!=(c|0)?(f=d+4|0,s=m-f|0,l=s>>2,l&&(rw(d|0,f|0,s|0)|0,c=n[k>>2]|0),s=d+(l<<2)|0,(c|0)==(s|0)||(n[k>>2]=c+(~((c+-4-s|0)>>>2)<<2)),s=1):s=0),s|0}function Di(s){return s=s|0,(n[s+952>>2]|0)-(n[s+948>>2]|0)>>2|0}function rs(s,l){s=s|0,l=l|0;var c=0;return c=n[s+948>>2]|0,(n[s+952>>2]|0)-c>>2>>>0>l>>>0?s=n[c+(l<<2)>>2]|0:s=0,s|0}function ja(s){s=s|0;var l=0,c=0,f=0,d=0;f=C,C=C+32|0,l=f,d=n[s>>2]|0,c=(n[s+4>>2]|0)-d|0,((n[s+8>>2]|0)-d|0)>>>0>c>>>0&&(d=c>>2,Ld(l,d,d,s+8|0),fD(s,l),Nd(l)),C=f}function yu(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0,k=0,F=0,M=0;M=Di(s)|0;do if(M|0){if((n[(rs(s,0)|0)+944>>2]|0)==(s|0)){if(!(Aa(s+948|0,l)|0))break;br(l+400|0,8504,540)|0,n[l+944>>2]=0,Ne(s);break}B=n[(n[s+976>>2]|0)+12>>2]|0,k=s+948|0,F=(B|0)==0,c=0,m=0;do f=n[(n[k>>2]|0)+(m<<2)>>2]|0,(f|0)==(l|0)?Ne(s):(d=vl(f)|0,n[(n[k>>2]|0)+(c<<2)>>2]=d,n[d+944>>2]=s,F||hT[B&15](f,d,s,c),c=c+1|0),m=m+1|0;while((m|0)!=(M|0));if(c>>>0>>0){F=s+948|0,k=s+952|0,B=c,c=n[k>>2]|0;do m=(n[F>>2]|0)+(B<<2)|0,f=m+4|0,d=c-f|0,l=d>>2,l&&(rw(m|0,f|0,d|0)|0,c=n[k>>2]|0),d=c,f=m+(l<<2)|0,(d|0)!=(f|0)&&(c=d+(~((d+-4-f|0)>>>2)<<2)|0,n[k>>2]=c),B=B+1|0;while((B|0)!=(M|0))}}while(!1)}function Pl(s){s=s|0;var l=0,c=0,f=0,d=0;pi(s,(Di(s)|0)==0,2491),pi(s,(n[s+944>>2]|0)==0,2545),l=s+948|0,c=n[l>>2]|0,f=s+952|0,d=n[f>>2]|0,(d|0)!=(c|0)&&(n[f>>2]=d+(~((d+-4-c|0)>>>2)<<2)),ja(l),l=s+976|0,c=n[l>>2]|0,br(s|0,8104,1e3)|0,o[c+2>>0]|0&&(n[s+4>>2]=2,n[s+12>>2]=4),n[l>>2]=c}function pi(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0;d=C,C=C+16|0,f=d,l||(n[f>>2]=c,so(s,5,3197,f)),C=d}function Dn(){return n[2276]|0}function Sl(){var s=0;return s=_D(20)|0,ze((s|0)!=0,2592),n[2277]=(n[2277]|0)+1,n[s>>2]=n[239],n[s+4>>2]=n[240],n[s+8>>2]=n[241],n[s+12>>2]=n[242],n[s+16>>2]=n[243],s|0}function ze(s,l){s=s|0,l=l|0;var c=0,f=0;f=C,C=C+16|0,c=f,s||(n[c>>2]=l,so(0,5,3197,c)),C=f}function it(s){s=s|0,HD(s),n[2277]=(n[2277]|0)+-1}function vt(s,l){s=s|0,l=l|0;var c=0;l?(pi(s,(Di(s)|0)==0,2629),c=1):(c=0,l=0),n[s+964>>2]=l,n[s+988>>2]=c}function ar(s,l,c){s=s|0,l=l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M=n[m>>2]|0,B=M,F=f;do if((f|0)==(M|0)){if(M=Qe+4|0,f=n[M>>2]|0,Xe=n[Qe>>2]|0,d=Xe,f>>>0<=Xe>>>0){f=B-d>>1,f=f|0?f:1,Ld(oe,f,f>>>2,n[Qe+16>>2]|0),n[We>>2]=n[M>>2],n[Oe>>2]=n[O>>2],n[k>>2]=n[We>>2],n[j>>2]=n[Oe>>2],QI(oe,k,j),f=n[Qe>>2]|0,n[Qe>>2]=n[oe>>2],n[oe>>2]=f,f=oe+4|0,Xe=n[M>>2]|0,n[M>>2]=n[f>>2],n[f>>2]=Xe,f=oe+8|0,Xe=n[O>>2]|0,n[O>>2]=n[f>>2],n[f>>2]=Xe,f=oe+12|0,Xe=n[m>>2]|0,n[m>>2]=n[f>>2],n[f>>2]=Xe,Nd(oe),f=n[O>>2]|0;break}m=f,B=((m-d>>2)+1|0)/-2|0,k=f+(B<<2)|0,d=F-m|0,m=d>>2,m&&(rw(k|0,f|0,d|0)|0,f=n[M>>2]|0),Xe=k+(m<<2)|0,n[O>>2]=Xe,n[M>>2]=f+(B<<2),f=Xe}while(!1);n[f>>2]=n[c>>2],n[O>>2]=(n[O>>2]|0)+4,l=hD(s,Qe,l)|0,Nd(Qe)}while(!1);return C=rt,l|0}function Ne(s){s=s|0;var l=0;do{if(l=s+984|0,o[l>>0]|0)break;o[l>>0]=1,h[s+504>>2]=y(ue),s=n[s+944>>2]|0}while(s|0)}function gt(s){s=s|0;var l=0,c=0,f=0;c=n[s>>2]|0,f=c,c|0&&(s=s+4|0,l=n[s>>2]|0,(l|0)!=(c|0)&&(n[s>>2]=l+(~((l+-4-f|0)>>>2)<<2)),yt(c))}function mt(s){return s=s|0,n[s+944>>2]|0}function Dt(s){s=s|0,pi(s,(n[s+964>>2]|0)!=0,2832),Ne(s)}function er(s){return s=s|0,(o[s+984>>0]|0)!=0|0}function sn(s,l){s=s|0,l=l|0,wUe(s,l,400)|0&&(br(s|0,l|0,400)|0,Ne(s))}function ei(s){s=s|0;var l=Ze;return l=y(h[s+44>>2]),s=Ot(l)|0,y(s?y(0):l)}function Qi(s){s=s|0;var l=Ze;return l=y(h[s+48>>2]),Ot(l)|0&&(l=o[(n[s+976>>2]|0)+2>>0]|0?y(1):y(0)),y(l)}function Pn(s,l){s=s|0,l=l|0,n[s+980>>2]=l}function fa(s){return s=s|0,n[s+980>>2]|0}function wd(s,l){s=s|0,l=l|0;var c=0;c=s+4|0,(n[c>>2]|0)!=(l|0)&&(n[c>>2]=l,Ne(s))}function BI(s){return s=s|0,n[s+4>>2]|0}function eo(s,l){s=s|0,l=l|0;var c=0;c=s+8|0,(n[c>>2]|0)!=(l|0)&&(n[c>>2]=l,Ne(s))}function Bd(s){return s=s|0,n[s+8>>2]|0}function cp(s,l){s=s|0,l=l|0;var c=0;c=s+12|0,(n[c>>2]|0)!=(l|0)&&(n[c>>2]=l,Ne(s))}function vI(s){return s=s|0,n[s+12>>2]|0}function to(s,l){s=s|0,l=l|0;var c=0;c=s+16|0,(n[c>>2]|0)!=(l|0)&&(n[c>>2]=l,Ne(s))}function up(s){return s=s|0,n[s+16>>2]|0}function Ap(s,l){s=s|0,l=l|0;var c=0;c=s+20|0,(n[c>>2]|0)!=(l|0)&&(n[c>>2]=l,Ne(s))}function Ic(s){return s=s|0,n[s+20>>2]|0}function fp(s,l){s=s|0,l=l|0;var c=0;c=s+24|0,(n[c>>2]|0)!=(l|0)&&(n[c>>2]=l,Ne(s))}function s0(s){return s=s|0,n[s+24>>2]|0}function o0(s,l){s=s|0,l=l|0;var c=0;c=s+28|0,(n[c>>2]|0)!=(l|0)&&(n[c>>2]=l,Ne(s))}function a0(s){return s=s|0,n[s+28>>2]|0}function vd(s,l){s=s|0,l=l|0;var c=0;c=s+32|0,(n[c>>2]|0)!=(l|0)&&(n[c>>2]=l,Ne(s))}function Eu(s){return s=s|0,n[s+32>>2]|0}function ro(s,l){s=s|0,l=l|0;var c=0;c=s+36|0,(n[c>>2]|0)!=(l|0)&&(n[c>>2]=l,Ne(s))}function Ga(s){return s=s|0,n[s+36>>2]|0}function pp(s,l){s=s|0,l=y(l);var c=0;c=s+40|0,y(h[c>>2])!=l&&(h[c>>2]=l,Ne(s))}function l0(s,l){s=s|0,l=y(l);var c=0;c=s+44|0,y(h[c>>2])!=l&&(h[c>>2]=l,Ne(s))}function Wa(s,l){s=s|0,l=y(l);var c=0;c=s+48|0,y(h[c>>2])!=l&&(h[c>>2]=l,Ne(s))}function Ya(s,l){s=s|0,l=y(l);var c=0,f=0,d=0,m=0;m=Ot(l)|0,c=(m^1)&1,f=s+52|0,d=s+56|0,m|y(h[f>>2])==l&&(n[d>>2]|0)==(c|0)||(h[f>>2]=l,n[d>>2]=c,Ne(s))}function Dd(s,l){s=s|0,l=y(l);var c=0,f=0;f=s+52|0,c=s+56|0,y(h[f>>2])==l&&(n[c>>2]|0)==2||(h[f>>2]=l,f=Ot(l)|0,n[c>>2]=f?3:2,Ne(s))}function LA(s,l){s=s|0,l=l|0;var c=0,f=0;f=l+52|0,c=n[f+4>>2]|0,l=s,n[l>>2]=n[f>>2],n[l+4>>2]=c}function Pd(s,l,c){s=s|0,l=l|0,c=y(c);var f=0,d=0,m=0;m=Ot(c)|0,f=(m^1)&1,d=s+132+(l<<3)|0,l=s+132+(l<<3)+4|0,m|y(h[d>>2])==c&&(n[l>>2]|0)==(f|0)||(h[d>>2]=c,n[l>>2]=f,Ne(s))}function Sd(s,l,c){s=s|0,l=l|0,c=y(c);var f=0,d=0,m=0;m=Ot(c)|0,f=m?0:2,d=s+132+(l<<3)|0,l=s+132+(l<<3)+4|0,m|y(h[d>>2])==c&&(n[l>>2]|0)==(f|0)||(h[d>>2]=c,n[l>>2]=f,Ne(s))}function NA(s,l,c){s=s|0,l=l|0,c=c|0;var f=0;f=l+132+(c<<3)|0,l=n[f+4>>2]|0,c=s,n[c>>2]=n[f>>2],n[c+4>>2]=l}function OA(s,l,c){s=s|0,l=l|0,c=y(c);var f=0,d=0,m=0;m=Ot(c)|0,f=(m^1)&1,d=s+60+(l<<3)|0,l=s+60+(l<<3)+4|0,m|y(h[d>>2])==c&&(n[l>>2]|0)==(f|0)||(h[d>>2]=c,n[l>>2]=f,Ne(s))}function W(s,l,c){s=s|0,l=l|0,c=y(c);var f=0,d=0,m=0;m=Ot(c)|0,f=m?0:2,d=s+60+(l<<3)|0,l=s+60+(l<<3)+4|0,m|y(h[d>>2])==c&&(n[l>>2]|0)==(f|0)||(h[d>>2]=c,n[l>>2]=f,Ne(s))}function xt(s,l,c){s=s|0,l=l|0,c=c|0;var f=0;f=l+60+(c<<3)|0,l=n[f+4>>2]|0,c=s,n[c>>2]=n[f>>2],n[c+4>>2]=l}function MA(s,l){s=s|0,l=l|0;var c=0;c=s+60+(l<<3)+4|0,(n[c>>2]|0)!=3&&(h[s+60+(l<<3)>>2]=y(ue),n[c>>2]=3,Ne(s))}function no(s,l,c){s=s|0,l=l|0,c=y(c);var f=0,d=0,m=0;m=Ot(c)|0,f=(m^1)&1,d=s+204+(l<<3)|0,l=s+204+(l<<3)+4|0,m|y(h[d>>2])==c&&(n[l>>2]|0)==(f|0)||(h[d>>2]=c,n[l>>2]=f,Ne(s))}function Cu(s,l,c){s=s|0,l=l|0,c=y(c);var f=0,d=0,m=0;m=Ot(c)|0,f=m?0:2,d=s+204+(l<<3)|0,l=s+204+(l<<3)+4|0,m|y(h[d>>2])==c&&(n[l>>2]|0)==(f|0)||(h[d>>2]=c,n[l>>2]=f,Ne(s))}function dt(s,l,c){s=s|0,l=l|0,c=c|0;var f=0;f=l+204+(c<<3)|0,l=n[f+4>>2]|0,c=s,n[c>>2]=n[f>>2],n[c+4>>2]=l}function wc(s,l,c){s=s|0,l=l|0,c=y(c);var f=0,d=0,m=0;m=Ot(c)|0,f=(m^1)&1,d=s+276+(l<<3)|0,l=s+276+(l<<3)+4|0,m|y(h[d>>2])==c&&(n[l>>2]|0)==(f|0)||(h[d>>2]=c,n[l>>2]=f,Ne(s))}function xd(s,l){return s=s|0,l=l|0,y(h[s+276+(l<<3)>>2])}function c0(s,l){s=s|0,l=y(l);var c=0,f=0,d=0,m=0;m=Ot(l)|0,c=(m^1)&1,f=s+348|0,d=s+352|0,m|y(h[f>>2])==l&&(n[d>>2]|0)==(c|0)||(h[f>>2]=l,n[d>>2]=c,Ne(s))}function DI(s,l){s=s|0,l=y(l);var c=0,f=0;f=s+348|0,c=s+352|0,y(h[f>>2])==l&&(n[c>>2]|0)==2||(h[f>>2]=l,f=Ot(l)|0,n[c>>2]=f?3:2,Ne(s))}function hp(s){s=s|0;var l=0;l=s+352|0,(n[l>>2]|0)!=3&&(h[s+348>>2]=y(ue),n[l>>2]=3,Ne(s))}function cr(s,l){s=s|0,l=l|0;var c=0,f=0;f=l+348|0,c=n[f+4>>2]|0,l=s,n[l>>2]=n[f>>2],n[l+4>>2]=c}function Ni(s,l){s=s|0,l=y(l);var c=0,f=0,d=0,m=0;m=Ot(l)|0,c=(m^1)&1,f=s+356|0,d=s+360|0,m|y(h[f>>2])==l&&(n[d>>2]|0)==(c|0)||(h[f>>2]=l,n[d>>2]=c,Ne(s))}function Iu(s,l){s=s|0,l=y(l);var c=0,f=0;f=s+356|0,c=s+360|0,y(h[f>>2])==l&&(n[c>>2]|0)==2||(h[f>>2]=l,f=Ot(l)|0,n[c>>2]=f?3:2,Ne(s))}function pa(s){s=s|0;var l=0;l=s+360|0,(n[l>>2]|0)!=3&&(h[s+356>>2]=y(ue),n[l>>2]=3,Ne(s))}function u0(s,l){s=s|0,l=l|0;var c=0,f=0;f=l+356|0,c=n[f+4>>2]|0,l=s,n[l>>2]=n[f>>2],n[l+4>>2]=c}function Bc(s,l){s=s|0,l=y(l);var c=0,f=0,d=0,m=0;m=Ot(l)|0,c=(m^1)&1,f=s+364|0,d=s+368|0,m|y(h[f>>2])==l&&(n[d>>2]|0)==(c|0)||(h[f>>2]=l,n[d>>2]=c,Ne(s))}function wu(s,l){s=s|0,l=y(l);var c=0,f=0,d=0,m=0;m=Ot(l)|0,c=m?0:2,f=s+364|0,d=s+368|0,m|y(h[f>>2])==l&&(n[d>>2]|0)==(c|0)||(h[f>>2]=l,n[d>>2]=c,Ne(s))}function wt(s,l){s=s|0,l=l|0;var c=0,f=0;f=l+364|0,c=n[f+4>>2]|0,l=s,n[l>>2]=n[f>>2],n[l+4>>2]=c}function oi(s,l){s=s|0,l=y(l);var c=0,f=0,d=0,m=0;m=Ot(l)|0,c=(m^1)&1,f=s+372|0,d=s+376|0,m|y(h[f>>2])==l&&(n[d>>2]|0)==(c|0)||(h[f>>2]=l,n[d>>2]=c,Ne(s))}function UA(s,l){s=s|0,l=y(l);var c=0,f=0,d=0,m=0;m=Ot(l)|0,c=m?0:2,f=s+372|0,d=s+376|0,m|y(h[f>>2])==l&&(n[d>>2]|0)==(c|0)||(h[f>>2]=l,n[d>>2]=c,Ne(s))}function ha(s,l){s=s|0,l=l|0;var c=0,f=0;f=l+372|0,c=n[f+4>>2]|0,l=s,n[l>>2]=n[f>>2],n[l+4>>2]=c}function Uo(s,l){s=s|0,l=y(l);var c=0,f=0,d=0,m=0;m=Ot(l)|0,c=(m^1)&1,f=s+380|0,d=s+384|0,m|y(h[f>>2])==l&&(n[d>>2]|0)==(c|0)||(h[f>>2]=l,n[d>>2]=c,Ne(s))}function ga(s,l){s=s|0,l=y(l);var c=0,f=0,d=0,m=0;m=Ot(l)|0,c=m?0:2,f=s+380|0,d=s+384|0,m|y(h[f>>2])==l&&(n[d>>2]|0)==(c|0)||(h[f>>2]=l,n[d>>2]=c,Ne(s))}function A0(s,l){s=s|0,l=l|0;var c=0,f=0;f=l+380|0,c=n[f+4>>2]|0,l=s,n[l>>2]=n[f>>2],n[l+4>>2]=c}function gp(s,l){s=s|0,l=y(l);var c=0,f=0,d=0,m=0;m=Ot(l)|0,c=(m^1)&1,f=s+388|0,d=s+392|0,m|y(h[f>>2])==l&&(n[d>>2]|0)==(c|0)||(h[f>>2]=l,n[d>>2]=c,Ne(s))}function f0(s,l){s=s|0,l=y(l);var c=0,f=0,d=0,m=0;m=Ot(l)|0,c=m?0:2,f=s+388|0,d=s+392|0,m|y(h[f>>2])==l&&(n[d>>2]|0)==(c|0)||(h[f>>2]=l,n[d>>2]=c,Ne(s))}function bd(s,l){s=s|0,l=l|0;var c=0,f=0;f=l+388|0,c=n[f+4>>2]|0,l=s,n[l>>2]=n[f>>2],n[l+4>>2]=c}function _A(s,l){s=s|0,l=y(l);var c=0;c=s+396|0,y(h[c>>2])!=l&&(h[c>>2]=l,Ne(s))}function p0(s){return s=s|0,y(h[s+396>>2])}function vc(s){return s=s|0,y(h[s+400>>2])}function Dc(s){return s=s|0,y(h[s+404>>2])}function Bu(s){return s=s|0,y(h[s+408>>2])}function gs(s){return s=s|0,y(h[s+412>>2])}function Pc(s){return s=s|0,y(h[s+416>>2])}function On(s){return s=s|0,y(h[s+420>>2])}function ji(s,l){switch(s=s|0,l=l|0,pi(s,(l|0)<6,2918),l|0){case 0:{l=(n[s+496>>2]|0)==2?5:4;break}case 2:{l=(n[s+496>>2]|0)==2?4:5;break}default:}return y(h[s+424+(l<<2)>>2])}function Ci(s,l){switch(s=s|0,l=l|0,pi(s,(l|0)<6,2918),l|0){case 0:{l=(n[s+496>>2]|0)==2?5:4;break}case 2:{l=(n[s+496>>2]|0)==2?4:5;break}default:}return y(h[s+448+(l<<2)>>2])}function HA(s,l){switch(s=s|0,l=l|0,pi(s,(l|0)<6,2918),l|0){case 0:{l=(n[s+496>>2]|0)==2?5:4;break}case 2:{l=(n[s+496>>2]|0)==2?4:5;break}default:}return y(h[s+472+(l<<2)>>2])}function vu(s,l){s=s|0,l=l|0;var c=0,f=Ze;return c=n[s+4>>2]|0,(c|0)==(n[l+4>>2]|0)?c?(f=y(h[s>>2]),s=y(ie(y(f-y(h[l>>2]))))>2]=0,n[f+4>>2]=0,n[f+8>>2]=0,dc(f|0,s|0,l|0,0),so(s,3,(o[f+11>>0]|0)<0?n[f>>2]|0:f,c),WUe(f),C=c}function Gi(s,l,c,f){s=y(s),l=y(l),c=c|0,f=f|0;var d=Ze;s=y(s*l),d=y(lT(s,y(1)));do if(An(d,y(0))|0)s=y(s-d);else{if(s=y(s-d),An(d,y(1))|0){s=y(s+y(1));break}if(c){s=y(s+y(1));break}f||(d>y(.5)?d=y(1):(f=An(d,y(.5))|0,d=y(f?1:0)),s=y(s+d))}while(!1);return y(s/l)}function Ka(s,l,c,f,d,m,B,k,F,M,O,j,oe){s=s|0,l=y(l),c=c|0,f=y(f),d=d|0,m=y(m),B=B|0,k=y(k),F=y(F),M=y(M),O=y(O),j=y(j),oe=oe|0;var We=0,Oe=Ze,Qe=Ze,rt=Ze,Xe=Ze,ct=Ze,_e=Ze;return F>2]),Oe!=y(0))?(rt=y(Gi(l,Oe,0,0)),Xe=y(Gi(f,Oe,0,0)),Qe=y(Gi(m,Oe,0,0)),Oe=y(Gi(k,Oe,0,0))):(Qe=m,rt=l,Oe=k,Xe=f),(d|0)==(s|0)?We=An(Qe,rt)|0:We=0,(B|0)==(c|0)?oe=An(Oe,Xe)|0:oe=0,!We&&(ct=y(l-O),!(io(s,ct,F)|0))&&!(Du(s,ct,d,F)|0)?We=Pu(s,ct,d,m,F)|0:We=1,!oe&&(_e=y(f-j),!(io(c,_e,M)|0))&&!(Du(c,_e,B,M)|0)?oe=Pu(c,_e,B,k,M)|0:oe=1,oe=We&oe),oe|0}function io(s,l,c){return s=s|0,l=y(l),c=y(c),(s|0)==1?s=An(l,c)|0:s=0,s|0}function Du(s,l,c,f){return s=s|0,l=y(l),c=c|0,f=y(f),(s|0)==2&(c|0)==0?l>=f?s=1:s=An(l,f)|0:s=0,s|0}function Pu(s,l,c,f,d){return s=s|0,l=y(l),c=c|0,f=y(f),d=y(d),(s|0)==2&(c|0)==2&f>l?d<=l?s=1:s=An(l,d)|0:s=0,s|0}function Va(s,l,c,f,d,m,B,k,F,M,O){s=s|0,l=y(l),c=y(c),f=f|0,d=d|0,m=m|0,B=y(B),k=y(k),F=F|0,M=M|0,O=O|0;var j=0,oe=0,We=0,Oe=0,Qe=Ze,rt=Ze,Xe=0,ct=0,_e=0,Ge=0,Nt=0,_r=0,ur=0,Zt=0,kr=0,Or=0,lr=0,Ln=Ze,lo=Ze,co=Ze,uo=0,Ia=0;lr=C,C=C+160|0,Zt=lr+152|0,ur=lr+120|0,_r=lr+104|0,_e=lr+72|0,Oe=lr+56|0,Nt=lr+8|0,ct=lr,Ge=(n[2279]|0)+1|0,n[2279]=Ge,kr=s+984|0,o[kr>>0]|0&&(n[s+512>>2]|0)!=(n[2278]|0)?Xe=4:(n[s+516>>2]|0)==(f|0)?Or=0:Xe=4,(Xe|0)==4&&(n[s+520>>2]=0,n[s+924>>2]=-1,n[s+928>>2]=-1,h[s+932>>2]=y(-1),h[s+936>>2]=y(-1),Or=1);e:do if(n[s+964>>2]|0)if(Qe=y(fn(s,2,B)),rt=y(fn(s,0,B)),j=s+916|0,co=y(h[j>>2]),lo=y(h[s+920>>2]),Ln=y(h[s+932>>2]),Ka(d,l,m,c,n[s+924>>2]|0,co,n[s+928>>2]|0,lo,Ln,y(h[s+936>>2]),Qe,rt,O)|0)Xe=22;else if(We=n[s+520>>2]|0,!We)Xe=21;else for(oe=0;;){if(j=s+524+(oe*24|0)|0,Ln=y(h[j>>2]),lo=y(h[s+524+(oe*24|0)+4>>2]),co=y(h[s+524+(oe*24|0)+16>>2]),Ka(d,l,m,c,n[s+524+(oe*24|0)+8>>2]|0,Ln,n[s+524+(oe*24|0)+12>>2]|0,lo,co,y(h[s+524+(oe*24|0)+20>>2]),Qe,rt,O)|0){Xe=22;break e}if(oe=oe+1|0,oe>>>0>=We>>>0){Xe=21;break}}else{if(F){if(j=s+916|0,!(An(y(h[j>>2]),l)|0)){Xe=21;break}if(!(An(y(h[s+920>>2]),c)|0)){Xe=21;break}if((n[s+924>>2]|0)!=(d|0)){Xe=21;break}j=(n[s+928>>2]|0)==(m|0)?j:0,Xe=22;break}if(We=n[s+520>>2]|0,!We)Xe=21;else for(oe=0;;){if(j=s+524+(oe*24|0)|0,An(y(h[j>>2]),l)|0&&An(y(h[s+524+(oe*24|0)+4>>2]),c)|0&&(n[s+524+(oe*24|0)+8>>2]|0)==(d|0)&&(n[s+524+(oe*24|0)+12>>2]|0)==(m|0)){Xe=22;break e}if(oe=oe+1|0,oe>>>0>=We>>>0){Xe=21;break}}}while(!1);do if((Xe|0)==21)o[11697]|0?(j=0,Xe=28):(j=0,Xe=31);else if((Xe|0)==22){if(oe=(o[11697]|0)!=0,!((j|0)!=0&(Or^1)))if(oe){Xe=28;break}else{Xe=31;break}Oe=j+16|0,n[s+908>>2]=n[Oe>>2],We=j+20|0,n[s+912>>2]=n[We>>2],(o[11698]|0)==0|oe^1||(n[ct>>2]=Sc(Ge)|0,n[ct+4>>2]=Ge,so(s,4,2972,ct),oe=n[s+972>>2]|0,oe|0&&ef[oe&127](s),d=_o(d,F)|0,m=_o(m,F)|0,Ia=+y(h[Oe>>2]),uo=+y(h[We>>2]),n[Nt>>2]=d,n[Nt+4>>2]=m,E[Nt+8>>3]=+l,E[Nt+16>>3]=+c,E[Nt+24>>3]=Ia,E[Nt+32>>3]=uo,n[Nt+40>>2]=M,so(s,4,2989,Nt))}while(!1);return(Xe|0)==28&&(oe=Sc(Ge)|0,n[Oe>>2]=oe,n[Oe+4>>2]=Ge,n[Oe+8>>2]=Or?3047:11699,so(s,4,3038,Oe),oe=n[s+972>>2]|0,oe|0&&ef[oe&127](s),Nt=_o(d,F)|0,Xe=_o(m,F)|0,n[_e>>2]=Nt,n[_e+4>>2]=Xe,E[_e+8>>3]=+l,E[_e+16>>3]=+c,n[_e+24>>2]=M,so(s,4,3049,_e),Xe=31),(Xe|0)==31&&(ds(s,l,c,f,d,m,B,k,F,O),o[11697]|0&&(oe=n[2279]|0,Nt=Sc(oe)|0,n[_r>>2]=Nt,n[_r+4>>2]=oe,n[_r+8>>2]=Or?3047:11699,so(s,4,3083,_r),oe=n[s+972>>2]|0,oe|0&&ef[oe&127](s),Nt=_o(d,F)|0,_r=_o(m,F)|0,uo=+y(h[s+908>>2]),Ia=+y(h[s+912>>2]),n[ur>>2]=Nt,n[ur+4>>2]=_r,E[ur+8>>3]=uo,E[ur+16>>3]=Ia,n[ur+24>>2]=M,so(s,4,3092,ur)),n[s+516>>2]=f,j||(oe=s+520|0,j=n[oe>>2]|0,(j|0)==16&&(o[11697]|0&&so(s,4,3124,Zt),n[oe>>2]=0,j=0),F?j=s+916|0:(n[oe>>2]=j+1,j=s+524+(j*24|0)|0),h[j>>2]=l,h[j+4>>2]=c,n[j+8>>2]=d,n[j+12>>2]=m,n[j+16>>2]=n[s+908>>2],n[j+20>>2]=n[s+912>>2],j=0)),F&&(n[s+416>>2]=n[s+908>>2],n[s+420>>2]=n[s+912>>2],o[s+985>>0]=1,o[kr>>0]=0),n[2279]=(n[2279]|0)+-1,n[s+512>>2]=n[2278],C=lr,Or|(j|0)==0|0}function fn(s,l,c){s=s|0,l=l|0,c=y(c);var f=Ze;return f=y(V(s,l,c)),y(f+y(re(s,l,c)))}function so(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0,m=0;m=C,C=C+16|0,d=m,n[d>>2]=f,s?f=n[s+976>>2]|0:f=0,yp(f,s,l,c,d),C=m}function Sc(s){return s=s|0,(s>>>0>60?3201:3201+(60-s)|0)|0}function _o(s,l){s=s|0,l=l|0;var c=0,f=0,d=0;return d=C,C=C+32|0,c=d+12|0,f=d,n[c>>2]=n[254],n[c+4>>2]=n[255],n[c+8>>2]=n[256],n[f>>2]=n[257],n[f+4>>2]=n[258],n[f+8>>2]=n[259],(s|0)>2?s=11699:s=n[(l?f:c)+(s<<2)>>2]|0,C=d,s|0}function ds(s,l,c,f,d,m,B,k,F,M){s=s|0,l=y(l),c=y(c),f=f|0,d=d|0,m=m|0,B=y(B),k=y(k),F=F|0,M=M|0;var O=0,j=0,oe=0,We=0,Oe=Ze,Qe=Ze,rt=Ze,Xe=Ze,ct=Ze,_e=Ze,Ge=Ze,Nt=0,_r=0,ur=0,Zt=Ze,kr=Ze,Or=0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hp|0){case 1:{O=0,Xe=y(Qe*y(.5)),c=y(0);break e}case 2:{O=0,Xe=Qe,c=y(0);break e}case 3:{if(m>>>0<=1){O=0,Xe=y(0),c=y(0);break e}c=y((m+-1|0)>>>0),O=0,Xe=y(0),c=y(y(Yn(Qe,y(0)))/c);break e}case 5:{c=y(Qe/y((m+1|0)>>>0)),O=0,Xe=c;break e}case 4:{c=y(Qe/y(m>>>0)),O=0,Xe=y(c*y(.5));break e}default:{O=0,Xe=y(0),c=y(0);break e}}while(!1);if(l=y(qp+Xe),Nt){rt=y(Qe/y(O|0)),oe=n[po>>2]|0,j=Or,Qe=y(0);do{O=n[oe+(j<<2)>>2]|0;e:do if((n[O+36>>2]|0)!=1){switch(n[O+24>>2]|0){case 1:{if(Ho(O,Lr)|0){if(!F)break e;Vt=y(YA(O,Lr,lr)),Vt=y(Vt+y(Ir(s,Lr))),Vt=y(Vt+y(V(O,Lr,Fr))),h[O+400+(n[Ou>>2]<<2)>>2]=Vt;break e}break}case 0:if(hi=(n[(za(O,Lr)|0)+4>>2]|0)==3,Vt=y(rt+l),l=hi?Vt:l,F&&(hi=O+400+(n[Ou>>2]<<2)|0,h[hi>>2]=y(l+y(h[hi>>2]))),hi=(n[(Ja(O,Lr)|0)+4>>2]|0)==3,Vt=y(rt+l),l=hi?Vt:l,Ia){Vt=y(c+y(fn(O,Lr,Fr))),Qe=Un,l=y(l+y(Vt+y(h[O+504>>2])));break e}else{l=y(l+y(c+y(KA(O,Lr,Fr)))),Qe=y(Yn(Qe,y(KA(O,Ar,Fr))));break e}default:}F&&(Vt=y(Xe+y(Ir(s,Lr))),hi=O+400+(n[Ou>>2]<<2)|0,h[hi>>2]=y(Vt+y(h[hi>>2])))}while(!1);j=j+1|0}while((j|0)!=(ur|0))}else Qe=y(0);if(c=y(jp+l),Op?Xe=y(y(Mn(s,Ar,y(_s+Qe),Uc,B))-_s):Xe=Un,rt=y(y(Mn(s,Ar,y(_s+(_p?Un:Qe)),Uc,B))-_s),N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za(oe,Ar)|0)+4>>2]|0)==3){l=y(Oe+y(Yn(y(0),l)));break}switch(O|0){case 1:{l=Oe;break e}case 2:{l=y(Oe+y(l*y(.5)));break e}default:{l=y(Oe+l);break e}}}while(!1);Vt=y(Cs+l),hi=oe+400+(n[Nu>>2]<<2)|0,h[hi>>2]=y(Vt+y(h[hi>>2]))}while(!1);j=j+1|0}while((j|0)!=(ur|0))}if(Cs=y(Cs+rt),Nc=y(Yn(Nc,c)),m=uo+1|0,ur>>>0>=Hs>>>0)break;l=lr,Or=ur,uo=m}do if(F){if(O=m>>>0>1,!O&&!(HF(s)|0))break;if(!(Ot(Un)|0)){l=y(Un-Cs);e:do switch(n[s+12>>2]|0){case 3:{Oe=y(Oe+l),_e=y(0);break}case 2:{Oe=y(Oe+y(l*y(.5))),_e=y(0);break}case 4:{Un>Cs?_e=y(l/y(m>>>0)):_e=y(0);break}case 7:if(Un>Cs){Oe=y(Oe+y(l/y(m<<1>>>0))),_e=y(l/y(m>>>0)),_e=O?_e:y(0);break e}else{Oe=y(Oe+y(l*y(.5))),_e=y(0);break e}case 6:{_e=y(l/y(uo>>>0)),_e=Un>Cs&O?_e:y(0);break}default:_e=y(0)}while(!1);if(m|0)for(Nt=1040+(Ar<<2)|0,_r=976+(Ar<<2)|0,We=0,j=0;;){e:do if(j>>>0>>0)for(Qe=y(0),rt=y(0),l=y(0),oe=j;;){O=n[(n[po>>2]|0)+(oe<<2)>>2]|0;do if((n[O+36>>2]|0)!=1&&!(n[O+24>>2]|0)){if((n[O+940>>2]|0)!=(We|0))break e;if(qF(O,Ar)|0&&(Vt=y(h[O+908+(n[_r>>2]<<2)>>2]),l=y(Yn(l,y(Vt+y(fn(O,Ar,Fr)))))),(Wi(s,O)|0)!=5)break;Us=y(m0(O)),Us=y(Us+y(V(O,0,Fr))),Vt=y(h[O+912>>2]),Vt=y(y(Vt+y(fn(O,0,Fr)))-Us),Us=y(Yn(rt,Us)),Vt=y(Yn(Qe,Vt)),Qe=Vt,rt=Us,l=y(Yn(l,y(Us+Vt)))}while(!1);if(O=oe+1|0,O>>>0>>0)oe=O;else{oe=O;break}}else rt=y(0),l=y(0),oe=j;while(!1);if(ct=y(_e+l),c=Oe,Oe=y(Oe+ct),j>>>0>>0){Xe=y(c+rt),O=j;do{j=n[(n[po>>2]|0)+(O<<2)>>2]|0;e:do if((n[j+36>>2]|0)!=1&&!(n[j+24>>2]|0))switch(Wi(s,j)|0){case 1:{Vt=y(c+y(V(j,Ar,Fr))),h[j+400+(n[Nt>>2]<<2)>>2]=Vt;break e}case 3:{Vt=y(y(Oe-y(re(j,Ar,Fr)))-y(h[j+908+(n[_r>>2]<<2)>>2])),h[j+400+(n[Nt>>2]<<2)>>2]=Vt;break e}case 2:{Vt=y(c+y(y(ct-y(h[j+908+(n[_r>>2]<<2)>>2]))*y(.5))),h[j+400+(n[Nt>>2]<<2)>>2]=Vt;break e}case 4:{if(Vt=y(c+y(V(j,Ar,Fr))),h[j+400+(n[Nt>>2]<<2)>>2]=Vt,Ns(j,Ar,Un)|0||(ri?(Qe=y(h[j+908>>2]),l=y(Qe+y(fn(j,Lr,Fr))),rt=ct):(rt=y(h[j+912>>2]),rt=y(rt+y(fn(j,Ar,Fr))),l=ct,Qe=y(h[j+908>>2])),An(l,Qe)|0&&An(rt,y(h[j+912>>2]))|0))break e;Va(j,l,rt,Is,1,1,Fr,Ao,1,3501,M)|0;break e}case 5:{h[j+404>>2]=y(y(Xe-y(m0(j)))+y(YA(j,0,Un)));break e}default:break e}while(!1);O=O+1|0}while((O|0)!=(oe|0))}if(We=We+1|0,(We|0)==(m|0))break;j=oe}}}while(!1);if(h[s+908>>2]=y(Mn(s,2,Oc,B,B)),h[s+912>>2]=y(Mn(s,0,af,k,B)),Rl|0&&(lf=n[s+32>>2]|0,cf=(Rl|0)==2,!(cf&(lf|0)!=2))?cf&(lf|0)==2&&(l=y(Mc+lr),l=y(Yn(y(M0(l,y(y0(s,Lr,Nc,fo)))),Mc)),$r=198):(l=y(Mn(s,Lr,Nc,fo,B)),$r=198),($r|0)==198&&(h[s+908+(n[976+(Lr<<2)>>2]<<2)>>2]=l),Tl|0&&(Af=n[s+32>>2]|0,ff=(Tl|0)==2,!(ff&(Af|0)!=2))?ff&(Af|0)==2&&(l=y(_s+Un),l=y(Yn(y(M0(l,y(y0(s,Ar,y(_s+Cs),Uc)))),_s)),$r=204):(l=y(Mn(s,Ar,y(_s+Cs),Uc,B)),$r=204),($r|0)==204&&(h[s+908+(n[976+(Ar<<2)>>2]<<2)>>2]=l),F){if((n[uf>>2]|0)==2){j=976+(Ar<<2)|0,oe=1040+(Ar<<2)|0,O=0;do We=rs(s,O)|0,n[We+24>>2]|0||(pf=n[j>>2]|0,Vt=y(h[s+908+(pf<<2)>>2]),hi=We+400+(n[oe>>2]<<2)|0,Vt=y(Vt-y(h[hi>>2])),h[hi>>2]=y(Vt-y(h[We+908+(pf<<2)>>2]))),O=O+1|0;while((O|0)!=(Hs|0))}if(f|0){O=ri?Rl:d;do jF(s,f,Fr,O,Ao,Is,M),f=n[f+960>>2]|0;while(f|0)}if(O=(Lr|2|0)==3,j=(Ar|2|0)==3,O|j){f=0;do oe=n[(n[po>>2]|0)+(f<<2)>>2]|0,(n[oe+36>>2]|0)!=1&&(O&&bI(s,oe,Lr),j&&bI(s,oe,Ar)),f=f+1|0;while((f|0)!=(Hs|0))}}}while(!1);C=Ll}function dp(s,l){s=s|0,l=y(l);var c=0;ua(s,l>=y(0),3147),c=l==y(0),h[s+4>>2]=c?y(0):l}function qA(s,l,c,f){s=s|0,l=y(l),c=y(c),f=f|0;var d=Ze,m=Ze,B=0,k=0,F=0;n[2278]=(n[2278]|0)+1,Su(s),Ns(s,2,l)|0?(d=y(Kr(n[s+992>>2]|0,l)),F=1,d=y(d+y(fn(s,2,l)))):(d=y(Kr(s+380|0,l)),d>=y(0)?F=2:(F=((Ot(l)|0)^1)&1,d=l)),Ns(s,0,c)|0?(m=y(Kr(n[s+996>>2]|0,c)),k=1,m=y(m+y(fn(s,0,l)))):(m=y(Kr(s+388|0,c)),m>=y(0)?k=2:(k=((Ot(c)|0)^1)&1,m=c)),B=s+976|0,Va(s,d,m,f,F,k,l,c,1,3189,n[B>>2]|0)|0&&(mp(s,n[s+496>>2]|0,l,c,l),jA(s,y(h[(n[B>>2]|0)+4>>2]),y(0),y(0)),o[11696]|0)&&h0(s,7)}function Su(s){s=s|0;var l=0,c=0,f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0;k=C,C=C+32|0,B=k+24|0,m=k+16|0,f=k+8|0,d=k,c=0;do l=s+380+(c<<3)|0,n[s+380+(c<<3)+4>>2]|0&&(F=l,M=n[F+4>>2]|0,O=f,n[O>>2]=n[F>>2],n[O+4>>2]=M,O=s+364+(c<<3)|0,M=n[O+4>>2]|0,F=d,n[F>>2]=n[O>>2],n[F+4>>2]=M,n[m>>2]=n[f>>2],n[m+4>>2]=n[f+4>>2],n[B>>2]=n[d>>2],n[B+4>>2]=n[d+4>>2],vu(m,B)|0)||(l=s+348+(c<<3)|0),n[s+992+(c<<2)>>2]=l,c=c+1|0;while((c|0)!=2);C=k}function Ns(s,l,c){s=s|0,l=l|0,c=y(c);var f=0;switch(s=n[s+992+(n[976+(l<<2)>>2]<<2)>>2]|0,n[s+4>>2]|0){case 0:case 3:{s=0;break}case 1:{y(h[s>>2])>2])>2]|0){case 2:{l=y(y(y(h[s>>2])*l)/y(100));break}case 1:{l=y(h[s>>2]);break}default:l=y(ue)}return y(l)}function mp(s,l,c,f,d){s=s|0,l=l|0,c=y(c),f=y(f),d=y(d);var m=0,B=Ze;l=n[s+944>>2]|0?l:1,m=hr(n[s+4>>2]|0,l)|0,l=Fd(m,l)|0,c=y(uD(s,m,c)),f=y(uD(s,l,f)),B=y(c+y(V(s,m,d))),h[s+400+(n[1040+(m<<2)>>2]<<2)>>2]=B,c=y(c+y(re(s,m,d))),h[s+400+(n[1e3+(m<<2)>>2]<<2)>>2]=c,c=y(f+y(V(s,l,d))),h[s+400+(n[1040+(l<<2)>>2]<<2)>>2]=c,d=y(f+y(re(s,l,d))),h[s+400+(n[1e3+(l<<2)>>2]<<2)>>2]=d}function jA(s,l,c,f){s=s|0,l=y(l),c=y(c),f=y(f);var d=0,m=0,B=Ze,k=Ze,F=0,M=0,O=Ze,j=0,oe=Ze,We=Ze,Oe=Ze,Qe=Ze;if(l!=y(0)&&(d=s+400|0,Qe=y(h[d>>2]),m=s+404|0,Oe=y(h[m>>2]),j=s+416|0,We=y(h[j>>2]),M=s+420|0,B=y(h[M>>2]),oe=y(Qe+c),O=y(Oe+f),f=y(oe+We),k=y(O+B),F=(n[s+988>>2]|0)==1,h[d>>2]=y(Gi(Qe,l,0,F)),h[m>>2]=y(Gi(Oe,l,0,F)),c=y(lT(y(We*l),y(1))),An(c,y(0))|0?m=0:m=(An(c,y(1))|0)^1,c=y(lT(y(B*l),y(1))),An(c,y(0))|0?d=0:d=(An(c,y(1))|0)^1,Qe=y(Gi(f,l,F&m,F&(m^1))),h[j>>2]=y(Qe-y(Gi(oe,l,0,F))),Qe=y(Gi(k,l,F&d,F&(d^1))),h[M>>2]=y(Qe-y(Gi(O,l,0,F))),m=(n[s+952>>2]|0)-(n[s+948>>2]|0)>>2,m|0)){d=0;do jA(rs(s,d)|0,l,oe,O),d=d+1|0;while((d|0)!=(m|0))}}function kd(s,l,c,f,d){switch(s=s|0,l=l|0,c=c|0,f=f|0,d=d|0,c|0){case 5:case 0:{s=M7(n[489]|0,f,d)|0;break}default:s=HUe(f,d)|0}return s|0}function d0(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0,m=0;d=C,C=C+16|0,m=d,n[m>>2]=f,yp(s,0,l,c,m),C=d}function yp(s,l,c,f,d){if(s=s|0,l=l|0,c=c|0,f=f|0,d=d|0,s=s|0?s:956,sW[n[s+8>>2]&1](s,l,c,f,d)|0,(c|0)==5)Tt();else return}function xl(s,l,c){s=s|0,l=l|0,c=c|0,o[s+l>>0]=c&1}function Qd(s,l){s=s|0,l=l|0;var c=0,f=0;n[s>>2]=0,n[s+4>>2]=0,n[s+8>>2]=0,c=l+4|0,f=(n[c>>2]|0)-(n[l>>2]|0)>>2,f|0&&(Ep(s,f),bt(s,n[l>>2]|0,n[c>>2]|0,f))}function Ep(s,l){s=s|0,l=l|0;var c=0;if((L(s)|0)>>>0>>0&&Zr(s),l>>>0>1073741823)Tt();else{c=Yt(l<<2)|0,n[s+4>>2]=c,n[s>>2]=c,n[s+8>>2]=c+(l<<2);return}}function bt(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0,f=s+4|0,s=c-l|0,(s|0)>0&&(br(n[f>>2]|0,l|0,s|0)|0,n[f>>2]=(n[f>>2]|0)+(s>>>2<<2))}function L(s){return s=s|0,1073741823}function V(s,l,c){return s=s|0,l=l|0,c=y(c),ge(l)|0&&n[s+96>>2]|0?s=s+92|0:s=vn(s+60|0,n[1040+(l<<2)>>2]|0,992)|0,y(Ye(s,c))}function re(s,l,c){return s=s|0,l=l|0,c=y(c),ge(l)|0&&n[s+104>>2]|0?s=s+100|0:s=vn(s+60|0,n[1e3+(l<<2)>>2]|0,992)|0,y(Ye(s,c))}function ge(s){return s=s|0,(s|1|0)==3|0}function Ye(s,l){return s=s|0,l=y(l),(n[s+4>>2]|0)==3?l=y(0):l=y(Kr(s,l)),y(l)}function At(s,l){return s=s|0,l=l|0,s=n[s>>2]|0,(s|0?s:(l|0)>1?l:1)|0}function hr(s,l){s=s|0,l=l|0;var c=0;e:do if((l|0)==2){switch(s|0){case 2:{s=3;break e}case 3:break;default:{c=4;break e}}s=2}else c=4;while(!1);return s|0}function Ir(s,l){s=s|0,l=l|0;var c=Ze;return ge(l)|0&&n[s+312>>2]|0&&(c=y(h[s+308>>2]),c>=y(0))||(c=y(Yn(y(h[(vn(s+276|0,n[1040+(l<<2)>>2]|0,992)|0)>>2]),y(0)))),y(c)}function Rn(s,l){s=s|0,l=l|0;var c=Ze;return ge(l)|0&&n[s+320>>2]|0&&(c=y(h[s+316>>2]),c>=y(0))||(c=y(Yn(y(h[(vn(s+276|0,n[1e3+(l<<2)>>2]|0,992)|0)>>2]),y(0)))),y(c)}function ai(s,l,c){s=s|0,l=l|0,c=y(c);var f=Ze;return ge(l)|0&&n[s+240>>2]|0&&(f=y(Kr(s+236|0,c)),f>=y(0))||(f=y(Yn(y(Kr(vn(s+204|0,n[1040+(l<<2)>>2]|0,992)|0,c)),y(0)))),y(f)}function ns(s,l,c){s=s|0,l=l|0,c=y(c);var f=Ze;return ge(l)|0&&n[s+248>>2]|0&&(f=y(Kr(s+244|0,c)),f>=y(0))||(f=y(Yn(y(Kr(vn(s+204|0,n[1e3+(l<<2)>>2]|0,992)|0,c)),y(0)))),y(f)}function GA(s,l,c,f,d,m,B){s=s|0,l=y(l),c=y(c),f=f|0,d=d|0,m=y(m),B=y(B);var k=Ze,F=Ze,M=Ze,O=Ze,j=Ze,oe=Ze,We=0,Oe=0,Qe=0;Qe=C,C=C+16|0,We=Qe,Oe=s+964|0,pi(s,(n[Oe>>2]|0)!=0,3519),k=y(da(s,2,l)),F=y(da(s,0,l)),M=y(fn(s,2,l)),O=y(fn(s,0,l)),Ot(l)|0?j=l:j=y(Yn(y(0),y(y(l-M)-k))),Ot(c)|0?oe=c:oe=y(Yn(y(0),y(y(c-O)-F))),(f|0)==1&(d|0)==1?(h[s+908>>2]=y(Mn(s,2,y(l-M),m,m)),l=y(Mn(s,0,y(c-O),B,m))):(oW[n[Oe>>2]&1](We,s,j,f,oe,d),j=y(k+y(h[We>>2])),oe=y(l-M),h[s+908>>2]=y(Mn(s,2,(f|2|0)==2?j:oe,m,m)),oe=y(F+y(h[We+4>>2])),l=y(c-O),l=y(Mn(s,0,(d|2|0)==2?oe:l,B,m))),h[s+912>>2]=l,C=Qe}function lD(s,l,c,f,d,m,B){s=s|0,l=y(l),c=y(c),f=f|0,d=d|0,m=y(m),B=y(B);var k=Ze,F=Ze,M=Ze,O=Ze;M=y(da(s,2,m)),k=y(da(s,0,m)),O=y(fn(s,2,m)),F=y(fn(s,0,m)),l=y(l-O),h[s+908>>2]=y(Mn(s,2,(f|2|0)==2?M:l,m,m)),c=y(c-F),h[s+912>>2]=y(Mn(s,0,(d|2|0)==2?k:c,B,m))}function PI(s,l,c,f,d,m,B){s=s|0,l=y(l),c=y(c),f=f|0,d=d|0,m=y(m),B=y(B);var k=0,F=Ze,M=Ze;return k=(f|0)==2,!(l<=y(0)&k)&&!(c<=y(0)&(d|0)==2)&&!((f|0)==1&(d|0)==1)?s=0:(F=y(fn(s,0,m)),M=y(fn(s,2,m)),k=l>2]=y(Mn(s,2,k?y(0):l,m,m)),l=y(c-F),k=c>2]=y(Mn(s,0,k?y(0):l,B,m)),s=1),s|0}function Fd(s,l){return s=s|0,l=l|0,E0(s)|0?s=hr(2,l)|0:s=0,s|0}function Cp(s,l,c){return s=s|0,l=l|0,c=y(c),c=y(ai(s,l,c)),y(c+y(Ir(s,l)))}function SI(s,l,c){return s=s|0,l=l|0,c=y(c),c=y(ns(s,l,c)),y(c+y(Rn(s,l)))}function da(s,l,c){s=s|0,l=l|0,c=y(c);var f=Ze;return f=y(Cp(s,l,c)),y(f+y(SI(s,l,c)))}function xI(s){return s=s|0,n[s+24>>2]|0?s=0:y(WA(s))!=y(0)?s=1:s=y(Ip(s))!=y(0),s|0}function WA(s){s=s|0;var l=Ze;if(n[s+944>>2]|0){if(l=y(h[s+44>>2]),Ot(l)|0)return l=y(h[s+40>>2]),s=l>y(0)&((Ot(l)|0)^1),y(s?l:y(0))}else l=y(0);return y(l)}function Ip(s){s=s|0;var l=Ze,c=0,f=Ze;do if(n[s+944>>2]|0){if(l=y(h[s+48>>2]),Ot(l)|0){if(c=o[(n[s+976>>2]|0)+2>>0]|0,!(c<<24>>24)&&(f=y(h[s+40>>2]),f>24?y(1):y(0)}}else l=y(0);while(!1);return y(l)}function Rd(s){s=s|0;var l=0,c=0;if(sm(s+400|0,0,540)|0,o[s+985>>0]=1,ee(s),c=Di(s)|0,c|0){l=s+948|0,s=0;do Rd(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We=2,Oe=c),!((oe|0)==2&ct)&&Ot(j)|0&&!(Ot(d)|0)&&(h[ur>>2]=d,n[kr>>2]=2,O=2,j=d),Qe=y(h[l+396>>2]),rt=Ot(Qe)|0;do if(rt)oe=We;else{if((We|0)==1&ct){h[ur>>2]=y(y(Oe-Xe)/Qe),n[kr>>2]=1,O=1,oe=1;break}Ge&(O|0)==1?(h[_r>>2]=y(Qe*y(j-_e)),n[Zt>>2]=1,O=1,oe=1):oe=We}while(!1);lo=Ot(c)|0,We=(Wi(s,l)|0)!=4,!(Ge|Nt|((f|0)!=1|lo)|(We|(oe|0)==1))&&(h[_r>>2]=c,n[Zt>>2]=1,!rt)&&(h[ur>>2]=y(y(c-Xe)/Qe),n[kr>>2]=1,O=1),!(Or|ct|((k|0)!=1|(Ot(d)|0))|(We|(O|0)==1))&&(h[ur>>2]=d,n[kr>>2]=1,!rt)&&(h[_r>>2]=y(Qe*y(d-_e)),n[Zt>>2]=1),xc(l,2,m,m,Zt,_r),xc(l,0,B,m,kr,ur),c=y(h[_r>>2]),d=y(h[ur>>2]),Va(l,c,d,F,n[Zt>>2]|0,n[kr>>2]|0,m,B,0,3565,M)|0,B=y(h[l+908+(n[976+(lr<<2)>>2]<<2)>>2]),h[l+504>>2]=y(Yn(B,y(da(l,lr,m))))}while(!1);n[l+500>>2]=n[2278],C=Ln}function Mn(s,l,c,f,d){return s=s|0,l=l|0,c=y(c),f=y(f),d=y(d),f=y(y0(s,l,c,f)),y(Yn(f,y(da(s,l,d))))}function Wi(s,l){return s=s|0,l=l|0,l=l+20|0,l=n[(n[l>>2]|0?l:s+16|0)>>2]|0,(l|0)==5&&E0(n[s+4>>2]|0)|0&&(l=1),l|0}function za(s,l){return s=s|0,l=l|0,ge(l)|0&&n[s+96>>2]|0?l=4:l=n[1040+(l<<2)>>2]|0,s+60+(l<<3)|0}function Ja(s,l){return s=s|0,l=l|0,ge(l)|0&&n[s+104>>2]|0?l=5:l=n[1e3+(l<<2)>>2]|0,s+60+(l<<3)|0}function xc(s,l,c,f,d,m){switch(s=s|0,l=l|0,c=y(c),f=y(f),d=d|0,m=m|0,c=y(Kr(s+380+(n[976+(l<<2)>>2]<<3)|0,c)),c=y(c+y(fn(s,l,f))),n[d>>2]|0){case 2:case 1:{d=Ot(c)|0,f=y(h[m>>2]),h[m>>2]=d|f>2]=2,h[m>>2]=c);break}default:}}function Ho(s,l){return s=s|0,l=l|0,s=s+132|0,ge(l)|0&&n[(vn(s,4,948)|0)+4>>2]|0?s=1:s=(n[(vn(s,n[1040+(l<<2)>>2]|0,948)|0)+4>>2]|0)!=0,s|0}function YA(s,l,c){s=s|0,l=l|0,c=y(c);var f=0,d=0;return s=s+132|0,ge(l)|0&&(f=vn(s,4,948)|0,(n[f+4>>2]|0)!=0)?d=4:(f=vn(s,n[1040+(l<<2)>>2]|0,948)|0,n[f+4>>2]|0?d=4:c=y(0)),(d|0)==4&&(c=y(Kr(f,c))),y(c)}function KA(s,l,c){s=s|0,l=l|0,c=y(c);var f=Ze;return f=y(h[s+908+(n[976+(l<<2)>>2]<<2)>>2]),f=y(f+y(V(s,l,c))),y(f+y(re(s,l,c)))}function HF(s){s=s|0;var l=0,c=0,f=0;e:do if(E0(n[s+4>>2]|0)|0)l=0;else if((n[s+16>>2]|0)!=5)if(c=Di(s)|0,!c)l=0;else for(l=0;;){if(f=rs(s,l)|0,!(n[f+24>>2]|0)&&(n[f+20>>2]|0)==5){l=1;break e}if(l=l+1|0,l>>>0>=c>>>0){l=0;break}}else l=1;while(!1);return l|0}function qF(s,l){s=s|0,l=l|0;var c=Ze;return c=y(h[s+908+(n[976+(l<<2)>>2]<<2)>>2]),c>=y(0)&((Ot(c)|0)^1)|0}function m0(s){s=s|0;var l=Ze,c=0,f=0,d=0,m=0,B=0,k=0,F=Ze;if(c=n[s+968>>2]|0,c)F=y(h[s+908>>2]),l=y(h[s+912>>2]),l=y(tW[c&0](s,F,l)),pi(s,(Ot(l)|0)^1,3573);else{m=Di(s)|0;do if(m|0){for(c=0,d=0;;){if(f=rs(s,d)|0,n[f+940>>2]|0){B=8;break}if((n[f+24>>2]|0)!=1)if(k=(Wi(s,f)|0)==5,k){c=f;break}else c=c|0?c:f;if(d=d+1|0,d>>>0>=m>>>0){B=8;break}}if((B|0)==8&&!c)break;return l=y(m0(c)),y(l+y(h[c+404>>2]))}while(!1);l=y(h[s+912>>2])}return y(l)}function y0(s,l,c,f){s=s|0,l=l|0,c=y(c),f=y(f);var d=Ze,m=0;return E0(l)|0?(l=1,m=3):ge(l)|0?(l=0,m=3):(f=y(ue),d=y(ue)),(m|0)==3&&(d=y(Kr(s+364+(l<<3)|0,f)),f=y(Kr(s+380+(l<<3)|0,f))),m=f=y(0)&((Ot(f)|0)^1)),c=m?f:c,m=d>=y(0)&((Ot(d)|0)^1)&c>2]|0,m)|0,Oe=Fd(rt,m)|0,Qe=ge(rt)|0,j=y(fn(l,2,c)),oe=y(fn(l,0,c)),Ns(l,2,c)|0?k=y(j+y(Kr(n[l+992>>2]|0,c))):Ho(l,2)|0&&Td(l,2)|0?(k=y(h[s+908>>2]),F=y(Ir(s,2)),F=y(k-y(F+y(Rn(s,2)))),k=y(YA(l,2,c)),k=y(Mn(l,2,y(F-y(k+y(wp(l,2,c)))),c,c))):k=y(ue),Ns(l,0,d)|0?F=y(oe+y(Kr(n[l+996>>2]|0,d))):Ho(l,0)|0&&Td(l,0)|0?(F=y(h[s+912>>2]),ct=y(Ir(s,0)),ct=y(F-y(ct+y(Rn(s,0)))),F=y(YA(l,0,d)),F=y(Mn(l,0,y(ct-y(F+y(wp(l,0,d)))),d,c))):F=y(ue),M=Ot(k)|0,O=Ot(F)|0;do if(M^O&&(We=y(h[l+396>>2]),!(Ot(We)|0)))if(M){k=y(j+y(y(F-oe)*We));break}else{ct=y(oe+y(y(k-j)/We)),F=O?ct:F;break}while(!1);O=Ot(k)|0,M=Ot(F)|0,O|M&&(_e=(O^1)&1,f=c>y(0)&((f|0)!=0&O),k=Qe?k:f?c:k,Va(l,k,F,m,Qe?_e:f?2:_e,O&(M^1)&1,k,F,0,3623,B)|0,k=y(h[l+908>>2]),k=y(k+y(fn(l,2,c))),F=y(h[l+912>>2]),F=y(F+y(fn(l,0,c)))),Va(l,k,F,m,1,1,k,F,1,3635,B)|0,Td(l,rt)|0&&!(Ho(l,rt)|0)?(_e=n[976+(rt<<2)>>2]|0,ct=y(h[s+908+(_e<<2)>>2]),ct=y(ct-y(h[l+908+(_e<<2)>>2])),ct=y(ct-y(Rn(s,rt))),ct=y(ct-y(re(l,rt,c))),ct=y(ct-y(wp(l,rt,Qe?c:d))),h[l+400+(n[1040+(rt<<2)>>2]<<2)>>2]=ct):Xe=21;do if((Xe|0)==21){if(!(Ho(l,rt)|0)&&(n[s+8>>2]|0)==1){_e=n[976+(rt<<2)>>2]|0,ct=y(h[s+908+(_e<<2)>>2]),ct=y(y(ct-y(h[l+908+(_e<<2)>>2]))*y(.5)),h[l+400+(n[1040+(rt<<2)>>2]<<2)>>2]=ct;break}!(Ho(l,rt)|0)&&(n[s+8>>2]|0)==2&&(_e=n[976+(rt<<2)>>2]|0,ct=y(h[s+908+(_e<<2)>>2]),ct=y(ct-y(h[l+908+(_e<<2)>>2])),h[l+400+(n[1040+(rt<<2)>>2]<<2)>>2]=ct)}while(!1);Td(l,Oe)|0&&!(Ho(l,Oe)|0)?(_e=n[976+(Oe<<2)>>2]|0,ct=y(h[s+908+(_e<<2)>>2]),ct=y(ct-y(h[l+908+(_e<<2)>>2])),ct=y(ct-y(Rn(s,Oe))),ct=y(ct-y(re(l,Oe,c))),ct=y(ct-y(wp(l,Oe,Qe?d:c))),h[l+400+(n[1040+(Oe<<2)>>2]<<2)>>2]=ct):Xe=30;do if((Xe|0)==30&&!(Ho(l,Oe)|0)){if((Wi(s,l)|0)==2){_e=n[976+(Oe<<2)>>2]|0,ct=y(h[s+908+(_e<<2)>>2]),ct=y(y(ct-y(h[l+908+(_e<<2)>>2]))*y(.5)),h[l+400+(n[1040+(Oe<<2)>>2]<<2)>>2]=ct;break}_e=(Wi(s,l)|0)==3,_e^(n[s+28>>2]|0)==2&&(_e=n[976+(Oe<<2)>>2]|0,ct=y(h[s+908+(_e<<2)>>2]),ct=y(ct-y(h[l+908+(_e<<2)>>2])),h[l+400+(n[1040+(Oe<<2)>>2]<<2)>>2]=ct)}while(!1)}function bI(s,l,c){s=s|0,l=l|0,c=c|0;var f=Ze,d=0;d=n[976+(c<<2)>>2]|0,f=y(h[l+908+(d<<2)>>2]),f=y(y(h[s+908+(d<<2)>>2])-f),f=y(f-y(h[l+400+(n[1040+(c<<2)>>2]<<2)>>2])),h[l+400+(n[1e3+(c<<2)>>2]<<2)>>2]=f}function E0(s){return s=s|0,(s|1|0)==1|0}function GF(s){s=s|0;var l=Ze;switch(n[s+56>>2]|0){case 0:case 3:{l=y(h[s+40>>2]),l>y(0)&((Ot(l)|0)^1)?s=o[(n[s+976>>2]|0)+2>>0]|0?1056:992:s=1056;break}default:s=s+52|0}return s|0}function kI(s,l){return s=s|0,l=l|0,(o[s+l>>0]|0)!=0|0}function Td(s,l){return s=s|0,l=l|0,s=s+132|0,ge(l)|0&&n[(vn(s,5,948)|0)+4>>2]|0?s=1:s=(n[(vn(s,n[1e3+(l<<2)>>2]|0,948)|0)+4>>2]|0)!=0,s|0}function wp(s,l,c){s=s|0,l=l|0,c=y(c);var f=0,d=0;return s=s+132|0,ge(l)|0&&(f=vn(s,5,948)|0,(n[f+4>>2]|0)!=0)?d=4:(f=vn(s,n[1e3+(l<<2)>>2]|0,948)|0,n[f+4>>2]|0?d=4:c=y(0)),(d|0)==4&&(c=y(Kr(f,c))),y(c)}function uD(s,l,c){return s=s|0,l=l|0,c=y(c),Ho(s,l)|0?c=y(YA(s,l,c)):c=y(-y(wp(s,l,c))),y(c)}function AD(s){return s=y(s),h[D>>2]=s,n[D>>2]|0|0}function Ld(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0;n[s+12>>2]=0,n[s+16>>2]=f;do if(l)if(l>>>0>1073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0,n[s>>2]=n[k>>2],n[k>>2]=B,B=n[d>>2]|0,n[d>>2]=n[m>>2],n[m>>2]=B,B=s+8|0,c=l+12|0,s=n[B>>2]|0,n[B>>2]=n[c>>2],n[c>>2]=s,n[l>>2]=n[k>>2],F|0}function QI(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0;if(B=n[l>>2]|0,m=n[c>>2]|0,(B|0)!=(m|0)){d=s+8|0,c=((m+-4-B|0)>>>2)+1|0,s=B,f=n[d>>2]|0;do n[f>>2]=n[s>>2],f=(n[d>>2]|0)+4|0,n[d>>2]=f,s=s+4|0;while((s|0)!=(m|0));n[l>>2]=B+(c<<2)}}function FI(){Oo()}function gD(){var s=0;return s=Yt(4)|0,RI(s),s|0}function RI(s){s=s|0,n[s>>2]=Sl()|0}function dD(s){s=s|0,s|0&&(C0(s),yt(s))}function C0(s){s=s|0,it(n[s>>2]|0)}function WF(s,l,c){s=s|0,l=l|0,c=c|0,xl(n[s>>2]|0,l,c)}function Od(s,l){s=s|0,l=y(l),dp(n[s>>2]|0,l)}function Md(s,l){return s=s|0,l=l|0,kI(n[s>>2]|0,l)|0}function Ud(){var s=0;return s=Yt(8)|0,I0(s,0),s|0}function I0(s,l){s=s|0,l=l|0,l?l=Mo(n[l>>2]|0)|0:l=qi()|0,n[s>>2]=l,n[s+4>>2]=0,Pn(l,s)}function _d(s){s=s|0;var l=0;return l=Yt(8)|0,I0(l,s),l|0}function w0(s){s=s|0,s|0&&(Hd(s),yt(s))}function Hd(s){s=s|0;var l=0;Dl(n[s>>2]|0),l=s+4|0,s=n[l>>2]|0,n[l>>2]=0,s|0&&(xu(s),yt(s))}function xu(s){s=s|0,bu(s)}function bu(s){s=s|0,s=n[s>>2]|0,s|0&&sa(s|0)}function TI(s){return s=s|0,fa(s)|0}function LI(s){s=s|0;var l=0,c=0;c=s+4|0,l=n[c>>2]|0,n[c>>2]=0,l|0&&(xu(l),yt(l)),Pl(n[s>>2]|0)}function qd(s,l){s=s|0,l=l|0,sn(n[s>>2]|0,n[l>>2]|0)}function YF(s,l){s=s|0,l=l|0,fp(n[s>>2]|0,l)}function KF(s,l,c){s=s|0,l=l|0,c=+c,Pd(n[s>>2]|0,l,y(c))}function jd(s,l,c){s=s|0,l=l|0,c=+c,Sd(n[s>>2]|0,l,y(c))}function NI(s,l){s=s|0,l=l|0,cp(n[s>>2]|0,l)}function OI(s,l){s=s|0,l=l|0,to(n[s>>2]|0,l)}function Sr(s,l){s=s|0,l=l|0,Ap(n[s>>2]|0,l)}function Os(s,l){s=s|0,l=l|0,wd(n[s>>2]|0,l)}function Oi(s,l){s=s|0,l=l|0,o0(n[s>>2]|0,l)}function ms(s,l){s=s|0,l=l|0,eo(n[s>>2]|0,l)}function VA(s,l,c){s=s|0,l=l|0,c=+c,OA(n[s>>2]|0,l,y(c))}function MI(s,l,c){s=s|0,l=l|0,c=+c,W(n[s>>2]|0,l,y(c))}function is(s,l){s=s|0,l=l|0,MA(n[s>>2]|0,l)}function Gd(s,l){s=s|0,l=l|0,vd(n[s>>2]|0,l)}function Bp(s,l){s=s|0,l=l|0,ro(n[s>>2]|0,l)}function B0(s,l){s=s|0,l=+l,pp(n[s>>2]|0,y(l))}function vp(s,l){s=s|0,l=+l,Ya(n[s>>2]|0,y(l))}function UI(s,l){s=s|0,l=+l,Dd(n[s>>2]|0,y(l))}function _I(s,l){s=s|0,l=+l,l0(n[s>>2]|0,y(l))}function HI(s,l){s=s|0,l=+l,Wa(n[s>>2]|0,y(l))}function qI(s,l){s=s|0,l=+l,c0(n[s>>2]|0,y(l))}function ku(s,l){s=s|0,l=+l,DI(n[s>>2]|0,y(l))}function ir(s){s=s|0,hp(n[s>>2]|0)}function Wd(s,l){s=s|0,l=+l,Ni(n[s>>2]|0,y(l))}function jI(s,l){s=s|0,l=+l,Iu(n[s>>2]|0,y(l))}function bl(s){s=s|0,pa(n[s>>2]|0)}function Qu(s,l){s=s|0,l=+l,Bc(n[s>>2]|0,y(l))}function v0(s,l){s=s|0,l=+l,wu(n[s>>2]|0,y(l))}function D0(s,l){s=s|0,l=+l,oi(n[s>>2]|0,y(l))}function GI(s,l){s=s|0,l=+l,UA(n[s>>2]|0,y(l))}function WI(s,l){s=s|0,l=+l,Uo(n[s>>2]|0,y(l))}function bc(s,l){s=s|0,l=+l,ga(n[s>>2]|0,y(l))}function P0(s,l){s=s|0,l=+l,gp(n[s>>2]|0,y(l))}function YI(s,l){s=s|0,l=+l,f0(n[s>>2]|0,y(l))}function Yd(s,l){s=s|0,l=+l,_A(n[s>>2]|0,y(l))}function kc(s,l,c){s=s|0,l=l|0,c=+c,wc(n[s>>2]|0,l,y(c))}function Kd(s,l,c){s=s|0,l=l|0,c=+c,no(n[s>>2]|0,l,y(c))}function S0(s,l,c){s=s|0,l=l|0,c=+c,Cu(n[s>>2]|0,l,y(c))}function x0(s){return s=s|0,s0(n[s>>2]|0)|0}function oo(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0;f=C,C=C+16|0,d=f,NA(d,n[l>>2]|0,c),ss(s,d),C=f}function ss(s,l){s=s|0,l=l|0,Xa(s,n[l+4>>2]|0,+y(h[l>>2]))}function Xa(s,l,c){s=s|0,l=l|0,c=+c,n[s>>2]=l,E[s+8>>3]=c}function Vd(s){return s=s|0,vI(n[s>>2]|0)|0}function qo(s){return s=s|0,up(n[s>>2]|0)|0}function mD(s){return s=s|0,Ic(n[s>>2]|0)|0}function Dp(s){return s=s|0,BI(n[s>>2]|0)|0}function KI(s){return s=s|0,a0(n[s>>2]|0)|0}function VF(s){return s=s|0,Bd(n[s>>2]|0)|0}function yD(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0;f=C,C=C+16|0,d=f,xt(d,n[l>>2]|0,c),ss(s,d),C=f}function ED(s){return s=s|0,Eu(n[s>>2]|0)|0}function zd(s){return s=s|0,Ga(n[s>>2]|0)|0}function VI(s,l){s=s|0,l=l|0;var c=0,f=0;c=C,C=C+16|0,f=c,LA(f,n[l>>2]|0),ss(s,f),C=c}function Pp(s){return s=s|0,+ +y(ei(n[s>>2]|0))}function CD(s){return s=s|0,+ +y(Qi(n[s>>2]|0))}function ID(s,l){s=s|0,l=l|0;var c=0,f=0;c=C,C=C+16|0,f=c,cr(f,n[l>>2]|0),ss(s,f),C=c}function b0(s,l){s=s|0,l=l|0;var c=0,f=0;c=C,C=C+16|0,f=c,u0(f,n[l>>2]|0),ss(s,f),C=c}function zF(s,l){s=s|0,l=l|0;var c=0,f=0;c=C,C=C+16|0,f=c,wt(f,n[l>>2]|0),ss(s,f),C=c}function JF(s,l){s=s|0,l=l|0;var c=0,f=0;c=C,C=C+16|0,f=c,ha(f,n[l>>2]|0),ss(s,f),C=c}function wD(s,l){s=s|0,l=l|0;var c=0,f=0;c=C,C=C+16|0,f=c,A0(f,n[l>>2]|0),ss(s,f),C=c}function BD(s,l){s=s|0,l=l|0;var c=0,f=0;c=C,C=C+16|0,f=c,bd(f,n[l>>2]|0),ss(s,f),C=c}function zA(s){return s=s|0,+ +y(p0(n[s>>2]|0))}function XF(s,l){return s=s|0,l=l|0,+ +y(xd(n[s>>2]|0,l))}function ZF(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0;f=C,C=C+16|0,d=f,dt(d,n[l>>2]|0,c),ss(s,d),C=f}function Qc(s,l,c){s=s|0,l=l|0,c=c|0,ar(n[s>>2]|0,n[l>>2]|0,c)}function $F(s,l){s=s|0,l=l|0,yu(n[s>>2]|0,n[l>>2]|0)}function vD(s){return s=s|0,Di(n[s>>2]|0)|0}function eR(s){return s=s|0,s=mt(n[s>>2]|0)|0,s?s=TI(s)|0:s=0,s|0}function DD(s,l){return s=s|0,l=l|0,s=rs(n[s>>2]|0,l)|0,s?s=TI(s)|0:s=0,s|0}function Fu(s,l){s=s|0,l=l|0;var c=0,f=0;f=Yt(4)|0,PD(f,l),c=s+4|0,l=n[c>>2]|0,n[c>>2]=f,l|0&&(xu(l),yt(l)),vt(n[s>>2]|0,1)}function PD(s,l){s=s|0,l=l|0,iR(s,l)}function tR(s,l,c,f,d,m){s=s|0,l=l|0,c=y(c),f=f|0,d=y(d),m=m|0;var B=0,k=0;B=C,C=C+16|0,k=B,SD(k,fa(l)|0,+c,f,+d,m),h[s>>2]=y(+E[k>>3]),h[s+4>>2]=y(+E[k+8>>3]),C=B}function SD(s,l,c,f,d,m){s=s|0,l=l|0,c=+c,f=f|0,d=+d,m=m|0;var B=0,k=0,F=0,M=0,O=0;B=C,C=C+32|0,O=B+8|0,M=B+20|0,F=B,k=B+16|0,E[O>>3]=c,n[M>>2]=f,E[F>>3]=d,n[k>>2]=m,Jd(s,n[l+4>>2]|0,O,M,F,k),C=B}function Jd(s,l,c,f,d,m){s=s|0,l=l|0,c=c|0,f=f|0,d=d|0,m=m|0;var B=0,k=0;B=C,C=C+16|0,k=B,$a(k),l=ys(l)|0,xD(s,l,+E[c>>3],n[f>>2]|0,+E[d>>3],n[m>>2]|0),el(k),C=B}function ys(s){return s=s|0,n[s>>2]|0}function xD(s,l,c,f,d,m){s=s|0,l=l|0,c=+c,f=f|0,d=+d,m=m|0;var B=0;B=jo(zI()|0)|0,c=+ma(c),f=Xd(f)|0,d=+ma(d),rR(s,qn(0,B|0,l|0,+c,f|0,+d,Xd(m)|0)|0)}function zI(){var s=0;return o[7608]|0||(XI(9120),s=7608,n[s>>2]=1,n[s+4>>2]=0),9120}function jo(s){return s=s|0,n[s+8>>2]|0}function ma(s){return s=+s,+ +Ru(s)}function Xd(s){return s=s|0,k0(s)|0}function rR(s,l){s=s|0,l=l|0;var c=0,f=0,d=0;d=C,C=C+32|0,c=d,f=l,f&1?(ya(c,0),ia(f|0,c|0)|0,JI(s,c),nR(c)):(n[s>>2]=n[l>>2],n[s+4>>2]=n[l+4>>2],n[s+8>>2]=n[l+8>>2],n[s+12>>2]=n[l+12>>2]),C=d}function ya(s,l){s=s|0,l=l|0,Fc(s,l),n[s+8>>2]=0,o[s+24>>0]=0}function JI(s,l){s=s|0,l=l|0,l=l+8|0,n[s>>2]=n[l>>2],n[s+4>>2]=n[l+4>>2],n[s+8>>2]=n[l+8>>2],n[s+12>>2]=n[l+12>>2]}function nR(s){s=s|0,o[s+24>>0]=0}function Fc(s,l){s=s|0,l=l|0,n[s>>2]=l}function k0(s){return s=s|0,s|0}function Ru(s){return s=+s,+s}function XI(s){s=s|0,ao(s,ZI()|0,4)}function ZI(){return 1064}function ao(s,l,c){s=s|0,l=l|0,c=c|0,n[s>>2]=l,n[s+4>>2]=c,n[s+8>>2]=ki(l|0,c+1|0)|0}function iR(s,l){s=s|0,l=l|0,l=n[l>>2]|0,n[s>>2]=l,hc(l|0)}function bD(s){s=s|0;var l=0,c=0;c=s+4|0,l=n[c>>2]|0,n[c>>2]=0,l|0&&(xu(l),yt(l)),vt(n[s>>2]|0,0)}function kD(s){s=s|0,Dt(n[s>>2]|0)}function Zd(s){return s=s|0,er(n[s>>2]|0)|0}function sR(s,l,c,f){s=s|0,l=+l,c=+c,f=f|0,qA(n[s>>2]|0,y(l),y(c),f)}function oR(s){return s=s|0,+ +y(vc(n[s>>2]|0))}function v(s){return s=s|0,+ +y(Bu(n[s>>2]|0))}function P(s){return s=s|0,+ +y(Dc(n[s>>2]|0))}function Q(s){return s=s|0,+ +y(gs(n[s>>2]|0))}function H(s){return s=s|0,+ +y(Pc(n[s>>2]|0))}function Y(s){return s=s|0,+ +y(On(n[s>>2]|0))}function ne(s,l){s=s|0,l=l|0,E[s>>3]=+y(vc(n[l>>2]|0)),E[s+8>>3]=+y(Bu(n[l>>2]|0)),E[s+16>>3]=+y(Dc(n[l>>2]|0)),E[s+24>>3]=+y(gs(n[l>>2]|0)),E[s+32>>3]=+y(Pc(n[l>>2]|0)),E[s+40>>3]=+y(On(n[l>>2]|0))}function Be(s,l){return s=s|0,l=l|0,+ +y(ji(n[s>>2]|0,l))}function Ue(s,l){return s=s|0,l=l|0,+ +y(Ci(n[s>>2]|0,l))}function ft(s,l){return s=s|0,l=l|0,+ +y(HA(n[s>>2]|0,l))}function jt(){return Dn()|0}function wr(){Tr(),Xt(),jn(),li(),Ea(),$e()}function Tr(){SLe(11713,4938,1)}function Xt(){YTe(10448)}function jn(){STe(10408)}function li(){JRe(10324)}function Ea(){iFe(10096)}function $e(){je(9132)}function je(s){s=s|0;var l=0,c=0,f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0,j=0,oe=0,We=0,Oe=0,Qe=0,rt=0,Xe=0,ct=0,_e=0,Ge=0,Nt=0,_r=0,ur=0,Zt=0,kr=0,Or=0,lr=0,Ln=0,lo=0,co=0,uo=0,Ia=0,Lp=0,Np=0,kl=0,Op=0,Nu=0,Ou=0,Mp=0,Up=0,_p=0,$r=0,Ql=0,Hp=0,Lc=0,qp=0,jp=0,Mu=0,Uu=0,Nc=0,Ms=0,rl=0,Go=0,Fl=0,rf=0,nf=0,_u=0,sf=0,of=0,Us=0,Cs=0,Rl=0,Un=0,af=0,Ao=0,Oc=0,fo=0,Mc=0,lf=0,cf=0,Uc=0,_s=0,Tl=0,uf=0,Af=0,ff=0,Fr=0,ri=0,Is=0,po=0,Hs=0,Lr=0,Ar=0,Ll=0;l=C,C=C+672|0,c=l+656|0,Ll=l+648|0,Ar=l+640|0,Lr=l+632|0,Hs=l+624|0,po=l+616|0,Is=l+608|0,ri=l+600|0,Fr=l+592|0,ff=l+584|0,Af=l+576|0,uf=l+568|0,Tl=l+560|0,_s=l+552|0,Uc=l+544|0,cf=l+536|0,lf=l+528|0,Mc=l+520|0,fo=l+512|0,Oc=l+504|0,Ao=l+496|0,af=l+488|0,Un=l+480|0,Rl=l+472|0,Cs=l+464|0,Us=l+456|0,of=l+448|0,sf=l+440|0,_u=l+432|0,nf=l+424|0,rf=l+416|0,Fl=l+408|0,Go=l+400|0,rl=l+392|0,Ms=l+384|0,Nc=l+376|0,Uu=l+368|0,Mu=l+360|0,jp=l+352|0,qp=l+344|0,Lc=l+336|0,Hp=l+328|0,Ql=l+320|0,$r=l+312|0,_p=l+304|0,Up=l+296|0,Mp=l+288|0,Ou=l+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2]=n[k>>2],n[c+4>>2]=n[k+4>>2],JA(s,4736,c)|0,n[B>>2]=21,n[B+4>>2]=0,n[c>>2]=n[B>>2],n[c+4>>2]=n[B+4>>2],jve(s,4754,c)|0,n[m>>2]=2,n[m+4>>2]=0,n[c>>2]=n[m>>2],n[c+4>>2]=n[m+4>>2],QD(s,4772,c)|0,n[d>>2]=3,n[d+4>>2]=0,n[c>>2]=n[d>>2],n[c+4>>2]=n[d+4>>2],QD(s,4790,c)|0,n[f>>2]=4,n[f+4>>2]=0,n[c>>2]=n[f>>2],n[c+4>>2]=n[f+4>>2],QD(s,4808,c)|0,C=l}function pt(s,l){s=s|0,l=l|0;var c=0;c=zQe()|0,n[s>>2]=c,JQe(c,l),Fp(n[s>>2]|0)}function Jt(s,l,c){return s=s|0,l=l|0,c=c|0,LQe(s,mn(l)|0,c,0),s|0}function Br(s,l,c){return s=s|0,l=l|0,c=c|0,EQe(s,mn(l)|0,c,0),s|0}function Wn(s,l,c){return s=s|0,l=l|0,c=c|0,sQe(s,mn(l)|0,c,0),s|0}function xr(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0;return f=C,C=C+16|0,d=f+8|0,m=f,B=n[c+4>>2]|0,n[m>>2]=n[c>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],jke(s,l,d),C=f,s|0}function Sn(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0;return f=C,C=C+16|0,d=f+8|0,m=f,B=n[c+4>>2]|0,n[m>>2]=n[c>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],vke(s,l,d),C=f,s|0}function Tn(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0;return f=C,C=C+16|0,d=f+8|0,m=f,B=n[c+4>>2]|0,n[m>>2]=n[c>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],lke(s,l,d),C=f,s|0}function Yr(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0;return f=C,C=C+16|0,d=f+8|0,m=f,B=n[c+4>>2]|0,n[m>>2]=n[c>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],Ybe(s,l,d),C=f,s|0}function ti(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0;return f=C,C=C+16|0,d=f+8|0,m=f,B=n[c+4>>2]|0,n[m>>2]=n[c>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],kbe(s,l,d),C=f,s|0}function Rc(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0;return f=C,C=C+16|0,d=f+8|0,m=f,B=n[c+4>>2]|0,n[m>>2]=n[c>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],hbe(s,l,d),C=f,s|0}function aR(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0;return f=C,C=C+16|0,d=f+8|0,m=f,B=n[c+4>>2]|0,n[m>>2]=n[c>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],Zxe(s,l,d),C=f,s|0}function Q0(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0;return f=C,C=C+16|0,d=f+8|0,m=f,B=n[c+4>>2]|0,n[m>>2]=n[c>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],vxe(s,l,d),C=f,s|0}function JA(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0;return f=C,C=C+16|0,d=f+8|0,m=f,B=n[c+4>>2]|0,n[m>>2]=n[c>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],lxe(s,l,d),C=f,s|0}function QD(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0;return f=C,C=C+16|0,d=f+8|0,m=f,B=n[c+4>>2]|0,n[m>>2]=n[c>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],YSe(s,l,d),C=f,s|0}function Lve(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0;return f=C,C=C+16|0,d=f+8|0,m=f,B=n[c+4>>2]|0,n[m>>2]=n[c>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],kSe(s,l,d),C=f,s|0}function Nve(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0;return f=C,C=C+16|0,d=f+8|0,m=f,B=n[c+4>>2]|0,n[m>>2]=n[c>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],hSe(s,l,d),C=f,s|0}function Ove(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0;return f=C,C=C+16|0,d=f+8|0,m=f,B=n[c+4>>2]|0,n[m>>2]=n[c>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],$Pe(s,l,d),C=f,s|0}function Mve(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0;return f=C,C=C+16|0,d=f+8|0,m=f,B=n[c+4>>2]|0,n[m>>2]=n[c>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],MPe(s,l,d),C=f,s|0}function Uve(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0;return f=C,C=C+16|0,d=f+8|0,m=f,B=n[c+4>>2]|0,n[m>>2]=n[c>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],IPe(s,l,d),C=f,s|0}function _ve(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0;return f=C,C=C+16|0,d=f+8|0,m=f,B=n[c+4>>2]|0,n[m>>2]=n[c>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],iPe(s,l,d),C=f,s|0}function Hve(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0;return f=C,C=C+16|0,d=f+8|0,m=f,B=n[c+4>>2]|0,n[m>>2]=n[c>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],qDe(s,l,d),C=f,s|0}function qve(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0;return f=C,C=C+16|0,d=f+8|0,m=f,B=n[c+4>>2]|0,n[m>>2]=n[c>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],vDe(s,l,d),C=f,s|0}function jve(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0;return f=C,C=C+16|0,d=f+8|0,m=f,B=n[c+4>>2]|0,n[m>>2]=n[c>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],Gve(s,l,d),C=f,s|0}function Gve(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0;f=C,C=C+16|0,d=f+8|0,m=f,k=n[c>>2]|0,B=n[c+4>>2]|0,c=mn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],Wve(s,c,d,1),C=f}function mn(s){return s=s|0,s|0}function Wve(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0,m=0,B=0,k=0,F=0,M=0,O=0;d=C,C=C+32|0,m=d+16|0,O=d+8|0,k=d,M=n[c>>2]|0,F=n[c+4>>2]|0,B=n[s>>2]|0,s=lR()|0,n[O>>2]=M,n[O+4>>2]=F,n[m>>2]=n[O>>2],n[m+4>>2]=n[O+4>>2],c=Yve(m)|0,n[k>>2]=M,n[k+4>>2]=F,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],yn(B,l,s,c,Kve(m,f)|0,f),C=d}function lR(){var s=0,l=0;if(o[7616]|0||(LG(9136),pr(24,9136,U|0)|0,l=7616,n[l>>2]=1,n[l+4>>2]=0),!(Nr(9136)|0)){s=9136,l=s+36|0;do n[s>>2]=0,s=s+4|0;while((s|0)<(l|0));LG(9136)}return 9136}function Yve(s){return s=s|0,0}function Kve(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0,j=0;return O=C,C=C+32|0,d=O+24|0,B=O+16|0,k=O,F=O+8|0,m=n[s>>2]|0,f=n[s+4>>2]|0,n[k>>2]=m,n[k+4>>2]=f,j=lR()|0,M=j+24|0,s=dr(l,4)|0,n[F>>2]=s,l=j+28|0,c=n[l>>2]|0,c>>>0<(n[j+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=f,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],TG(c,d,s),s=(n[l>>2]|0)+12|0,n[l>>2]=s):(Jve(M,k,F),s=n[l>>2]|0),C=O,((s-(n[M>>2]|0)|0)/12|0)+-1|0}function yn(s,l,c,f,d,m){s=s|0,l=l|0,c=c|0,f=f|0,d=d|0,m=m|0;var B=0,k=0,F=0,M=0,O=0,j=0,oe=0,We=0;B=C,C=C+32|0,oe=B+24|0,j=B+20|0,F=B+16|0,O=B+12|0,M=B+8|0,k=B+4|0,We=B,n[j>>2]=l,n[F>>2]=c,n[O>>2]=f,n[M>>2]=d,n[k>>2]=m,m=s+28|0,n[We>>2]=n[m>>2],n[oe>>2]=n[We>>2],Vve(s+24|0,oe,j,O,M,F,k)|0,n[m>>2]=n[n[m>>2]>>2],C=B}function Vve(s,l,c,f,d,m,B){return s=s|0,l=l|0,c=c|0,f=f|0,d=d|0,m=m|0,B=B|0,s=zve(l)|0,l=Yt(24)|0,RG(l+4|0,n[c>>2]|0,n[f>>2]|0,n[d>>2]|0,n[m>>2]|0,n[B>>2]|0),n[l>>2]=n[s>>2],n[s>>2]=l,l|0}function zve(s){return s=s|0,n[s>>2]|0}function RG(s,l,c,f,d,m){s=s|0,l=l|0,c=c|0,f=f|0,d=d|0,m=m|0,n[s>>2]=l,n[s+4>>2]=c,n[s+8>>2]=f,n[s+12>>2]=d,n[s+16>>2]=m}function dr(s,l){return s=s|0,l=l|0,l|s|0}function TG(s,l,c){s=s|0,l=l|0,c=c|0;var f=0;f=n[l+4>>2]|0,n[s>>2]=n[l>>2],n[s+4>>2]=f,n[s+8>>2]=c}function Jve(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0,j=0,oe=0;if(M=C,C=C+48|0,f=M+32|0,B=M+24|0,k=M,F=s+4|0,d=(((n[F>>2]|0)-(n[s>>2]|0)|0)/12|0)+1|0,m=Xve(s)|0,m>>>0>>0)Zr(s);else{O=n[s>>2]|0,oe=((n[s+8>>2]|0)-O|0)/12|0,j=oe<<1,Zve(k,oe>>>0>>1>>>0?j>>>0>>0?d:j:m,((n[F>>2]|0)-O|0)/12|0,s+8|0),F=k+8|0,m=n[F>>2]|0,d=n[l+4>>2]|0,c=n[c>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[f>>2]=n[B>>2],n[f+4>>2]=n[B+4>>2],TG(m,f,c),n[F>>2]=(n[F>>2]|0)+12,$ve(s,k),eDe(k),C=M;return}}function Xve(s){return s=s|0,357913941}function Zve(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0;n[s+12>>2]=0,n[s+16>>2]=f;do if(l)if(l>>>0>357913941)Tt();else{d=Yt(l*12|0)|0;break}else d=0;while(!1);n[s>>2]=d,f=d+(c*12|0)|0,n[s+8>>2]=f,n[s+4>>2]=f,n[s+12>>2]=d+(l*12|0)}function $ve(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0;f=n[s>>2]|0,B=s+4|0,m=l+4|0,d=(n[B>>2]|0)-f|0,c=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=c,(d|0)>0?(br(c|0,f|0,d|0)|0,f=m,c=n[m>>2]|0):f=m,m=n[s>>2]|0,n[s>>2]=c,n[f>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=s+8|0,B=l+12|0,s=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=s,n[l>>2]=n[f>>2]}function eDe(s){s=s|0;var l=0,c=0,f=0;l=n[s+4>>2]|0,c=s+8|0,f=n[c>>2]|0,(f|0)!=(l|0)&&(n[c>>2]=f+(~(((f+-12-l|0)>>>0)/12|0)*12|0)),s=n[s>>2]|0,s|0&&yt(s)}function LG(s){s=s|0,nDe(s)}function tDe(s){s=s|0,rDe(s+24|0)}function Nr(s){return s=s|0,n[s>>2]|0}function rDe(s){s=s|0;var l=0,c=0,f=0;c=n[s>>2]|0,f=c,c|0&&(s=s+4|0,l=n[s>>2]|0,(l|0)!=(c|0)&&(n[s>>2]=l+(~(((l+-12-f|0)>>>0)/12|0)*12|0)),yt(c))}function nDe(s){s=s|0;var l=0;l=zr()|0,Jr(s,2,3,l,iDe()|0,0),n[s+24>>2]=0,n[s+28>>2]=0,n[s+32>>2]=0}function zr(){return 9228}function iDe(){return 1140}function sDe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0;return c=C,C=C+16|0,f=c+8|0,d=c,m=oDe(s)|0,s=n[m+4>>2]|0,n[d>>2]=n[m>>2],n[d+4>>2]=s,n[f>>2]=n[d>>2],n[f+4>>2]=n[d+4>>2],l=aDe(l,f)|0,C=c,l|0}function Jr(s,l,c,f,d,m){s=s|0,l=l|0,c=c|0,f=f|0,d=d|0,m=m|0,n[s>>2]=l,n[s+4>>2]=c,n[s+8>>2]=f,n[s+12>>2]=d,n[s+16>>2]=m}function oDe(s){return s=s|0,(n[(lR()|0)+24>>2]|0)+(s*12|0)|0}function aDe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0;return d=C,C=C+48|0,f=d,c=n[l>>2]|0,l=n[l+4>>2]|0,s=s+(l>>1)|0,l&1&&(c=n[(n[s>>2]|0)+c>>2]|0),tf[c&31](f,s),f=lDe(f)|0,C=d,f|0}function lDe(s){s=s|0;var l=0,c=0,f=0,d=0;return d=C,C=C+32|0,l=d+12|0,c=d,f=cR(NG()|0)|0,f?(uR(l,f),AR(c,l),cDe(s,c),s=fR(l)|0):s=uDe(s)|0,C=d,s|0}function NG(){var s=0;return o[7632]|0||(CDe(9184),pr(25,9184,U|0)|0,s=7632,n[s>>2]=1,n[s+4>>2]=0),9184}function cR(s){return s=s|0,n[s+36>>2]|0}function uR(s,l){s=s|0,l=l|0,n[s>>2]=l,n[s+4>>2]=s,n[s+8>>2]=0}function AR(s,l){s=s|0,l=l|0,n[s>>2]=n[l>>2],n[s+4>>2]=n[l+4>>2],n[s+8>>2]=0}function cDe(s,l){s=s|0,l=l|0,hDe(l,s,s+8|0,s+16|0,s+24|0,s+32|0,s+40|0)|0}function fR(s){return s=s|0,n[(n[s+4>>2]|0)+8>>2]|0}function uDe(s){s=s|0;var l=0,c=0,f=0,d=0,m=0,B=0,k=0,F=0;F=C,C=C+16|0,c=F+4|0,f=F,d=Za(8)|0,m=d,B=Yt(48)|0,k=B,l=k+48|0;do n[k>>2]=n[s>>2],k=k+4|0,s=s+4|0;while((k|0)<(l|0));return l=m+4|0,n[l>>2]=B,k=Yt(8)|0,B=n[l>>2]|0,n[f>>2]=0,n[c>>2]=n[f>>2],OG(k,B,c),n[d>>2]=k,C=F,m|0}function OG(s,l,c){s=s|0,l=l|0,c=c|0,n[s>>2]=l,c=Yt(16)|0,n[c+4>>2]=0,n[c+8>>2]=0,n[c>>2]=1092,n[c+12>>2]=l,n[s+4>>2]=c}function ADe(s){s=s|0,im(s),yt(s)}function fDe(s){s=s|0,s=n[s+12>>2]|0,s|0&&yt(s)}function pDe(s){s=s|0,yt(s)}function hDe(s,l,c,f,d,m,B){return s=s|0,l=l|0,c=c|0,f=f|0,d=d|0,m=m|0,B=B|0,m=gDe(n[s>>2]|0,l,c,f,d,m,B)|0,B=s+4|0,n[(n[B>>2]|0)+8>>2]=m,n[(n[B>>2]|0)+8>>2]|0}function gDe(s,l,c,f,d,m,B){s=s|0,l=l|0,c=c|0,f=f|0,d=d|0,m=m|0,B=B|0;var k=0,F=0;return k=C,C=C+16|0,F=k,$a(F),s=ys(s)|0,B=dDe(s,+E[l>>3],+E[c>>3],+E[f>>3],+E[d>>3],+E[m>>3],+E[B>>3])|0,el(F),C=k,B|0}function dDe(s,l,c,f,d,m,B){s=s|0,l=+l,c=+c,f=+f,d=+d,m=+m,B=+B;var k=0;return k=jo(mDe()|0)|0,l=+ma(l),c=+ma(c),f=+ma(f),d=+ma(d),m=+ma(m),Ts(0,k|0,s|0,+l,+c,+f,+d,+m,+ +ma(B))|0}function mDe(){var s=0;return o[7624]|0||(yDe(9172),s=7624,n[s>>2]=1,n[s+4>>2]=0),9172}function yDe(s){s=s|0,ao(s,EDe()|0,6)}function EDe(){return 1112}function CDe(s){s=s|0,Sp(s)}function IDe(s){s=s|0,MG(s+24|0),UG(s+16|0)}function MG(s){s=s|0,BDe(s)}function UG(s){s=s|0,wDe(s)}function wDe(s){s=s|0;var l=0,c=0;if(l=n[s>>2]|0,l|0)do c=l,l=n[l>>2]|0,yt(c);while(l|0);n[s>>2]=0}function BDe(s){s=s|0;var l=0,c=0;if(l=n[s>>2]|0,l|0)do c=l,l=n[l>>2]|0,yt(c);while(l|0);n[s>>2]=0}function Sp(s){s=s|0;var l=0;n[s+16>>2]=0,n[s+20>>2]=0,l=s+24|0,n[l>>2]=0,n[s+28>>2]=l,n[s+36>>2]=0,o[s+40>>0]=0,o[s+41>>0]=0}function vDe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0;f=C,C=C+16|0,d=f+8|0,m=f,k=n[c>>2]|0,B=n[c+4>>2]|0,c=mn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],DDe(s,c,d,0),C=f}function DDe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0,m=0,B=0,k=0,F=0,M=0,O=0;d=C,C=C+32|0,m=d+16|0,O=d+8|0,k=d,M=n[c>>2]|0,F=n[c+4>>2]|0,B=n[s>>2]|0,s=pR()|0,n[O>>2]=M,n[O+4>>2]=F,n[m>>2]=n[O>>2],n[m+4>>2]=n[O+4>>2],c=PDe(m)|0,n[k>>2]=M,n[k+4>>2]=F,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],yn(B,l,s,c,SDe(m,f)|0,f),C=d}function pR(){var s=0,l=0;if(o[7640]|0||(HG(9232),pr(26,9232,U|0)|0,l=7640,n[l>>2]=1,n[l+4>>2]=0),!(Nr(9232)|0)){s=9232,l=s+36|0;do n[s>>2]=0,s=s+4|0;while((s|0)<(l|0));HG(9232)}return 9232}function PDe(s){return s=s|0,0}function SDe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0,j=0;return O=C,C=C+32|0,d=O+24|0,B=O+16|0,k=O,F=O+8|0,m=n[s>>2]|0,f=n[s+4>>2]|0,n[k>>2]=m,n[k+4>>2]=f,j=pR()|0,M=j+24|0,s=dr(l,4)|0,n[F>>2]=s,l=j+28|0,c=n[l>>2]|0,c>>>0<(n[j+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=f,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],_G(c,d,s),s=(n[l>>2]|0)+12|0,n[l>>2]=s):(xDe(M,k,F),s=n[l>>2]|0),C=O,((s-(n[M>>2]|0)|0)/12|0)+-1|0}function _G(s,l,c){s=s|0,l=l|0,c=c|0;var f=0;f=n[l+4>>2]|0,n[s>>2]=n[l>>2],n[s+4>>2]=f,n[s+8>>2]=c}function xDe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0,j=0,oe=0;if(M=C,C=C+48|0,f=M+32|0,B=M+24|0,k=M,F=s+4|0,d=(((n[F>>2]|0)-(n[s>>2]|0)|0)/12|0)+1|0,m=bDe(s)|0,m>>>0>>0)Zr(s);else{O=n[s>>2]|0,oe=((n[s+8>>2]|0)-O|0)/12|0,j=oe<<1,kDe(k,oe>>>0>>1>>>0?j>>>0>>0?d:j:m,((n[F>>2]|0)-O|0)/12|0,s+8|0),F=k+8|0,m=n[F>>2]|0,d=n[l+4>>2]|0,c=n[c>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[f>>2]=n[B>>2],n[f+4>>2]=n[B+4>>2],_G(m,f,c),n[F>>2]=(n[F>>2]|0)+12,QDe(s,k),FDe(k),C=M;return}}function bDe(s){return s=s|0,357913941}function kDe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0;n[s+12>>2]=0,n[s+16>>2]=f;do if(l)if(l>>>0>357913941)Tt();else{d=Yt(l*12|0)|0;break}else d=0;while(!1);n[s>>2]=d,f=d+(c*12|0)|0,n[s+8>>2]=f,n[s+4>>2]=f,n[s+12>>2]=d+(l*12|0)}function QDe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0;f=n[s>>2]|0,B=s+4|0,m=l+4|0,d=(n[B>>2]|0)-f|0,c=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=c,(d|0)>0?(br(c|0,f|0,d|0)|0,f=m,c=n[m>>2]|0):f=m,m=n[s>>2]|0,n[s>>2]=c,n[f>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=s+8|0,B=l+12|0,s=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=s,n[l>>2]=n[f>>2]}function FDe(s){s=s|0;var l=0,c=0,f=0;l=n[s+4>>2]|0,c=s+8|0,f=n[c>>2]|0,(f|0)!=(l|0)&&(n[c>>2]=f+(~(((f+-12-l|0)>>>0)/12|0)*12|0)),s=n[s>>2]|0,s|0&&yt(s)}function HG(s){s=s|0,LDe(s)}function RDe(s){s=s|0,TDe(s+24|0)}function TDe(s){s=s|0;var l=0,c=0,f=0;c=n[s>>2]|0,f=c,c|0&&(s=s+4|0,l=n[s>>2]|0,(l|0)!=(c|0)&&(n[s>>2]=l+(~(((l+-12-f|0)>>>0)/12|0)*12|0)),yt(c))}function LDe(s){s=s|0;var l=0;l=zr()|0,Jr(s,2,1,l,NDe()|0,3),n[s+24>>2]=0,n[s+28>>2]=0,n[s+32>>2]=0}function NDe(){return 1144}function ODe(s,l,c,f,d){s=s|0,l=l|0,c=+c,f=+f,d=d|0;var m=0,B=0,k=0,F=0;m=C,C=C+16|0,B=m+8|0,k=m,F=MDe(s)|0,s=n[F+4>>2]|0,n[k>>2]=n[F>>2],n[k+4>>2]=s,n[B>>2]=n[k>>2],n[B+4>>2]=n[k+4>>2],UDe(l,B,c,f,d),C=m}function MDe(s){return s=s|0,(n[(pR()|0)+24>>2]|0)+(s*12|0)|0}function UDe(s,l,c,f,d){s=s|0,l=l|0,c=+c,f=+f,d=d|0;var m=0,B=0,k=0,F=0,M=0;M=C,C=C+16|0,B=M+2|0,k=M+1|0,F=M,m=n[l>>2]|0,l=n[l+4>>2]|0,s=s+(l>>1)|0,l&1&&(m=n[(n[s>>2]|0)+m>>2]|0),Tu(B,c),c=+Lu(B,c),Tu(k,f),f=+Lu(k,f),XA(F,d),F=ZA(F,d)|0,rW[m&1](s,c,f,F),C=M}function Tu(s,l){s=s|0,l=+l}function Lu(s,l){return s=s|0,l=+l,+ +HDe(l)}function XA(s,l){s=s|0,l=l|0}function ZA(s,l){return s=s|0,l=l|0,_De(l)|0}function _De(s){return s=s|0,s|0}function HDe(s){return s=+s,+s}function qDe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0;f=C,C=C+16|0,d=f+8|0,m=f,k=n[c>>2]|0,B=n[c+4>>2]|0,c=mn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],jDe(s,c,d,1),C=f}function jDe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0,m=0,B=0,k=0,F=0,M=0,O=0;d=C,C=C+32|0,m=d+16|0,O=d+8|0,k=d,M=n[c>>2]|0,F=n[c+4>>2]|0,B=n[s>>2]|0,s=hR()|0,n[O>>2]=M,n[O+4>>2]=F,n[m>>2]=n[O>>2],n[m+4>>2]=n[O+4>>2],c=GDe(m)|0,n[k>>2]=M,n[k+4>>2]=F,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],yn(B,l,s,c,WDe(m,f)|0,f),C=d}function hR(){var s=0,l=0;if(o[7648]|0||(jG(9268),pr(27,9268,U|0)|0,l=7648,n[l>>2]=1,n[l+4>>2]=0),!(Nr(9268)|0)){s=9268,l=s+36|0;do n[s>>2]=0,s=s+4|0;while((s|0)<(l|0));jG(9268)}return 9268}function GDe(s){return s=s|0,0}function WDe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0,j=0;return O=C,C=C+32|0,d=O+24|0,B=O+16|0,k=O,F=O+8|0,m=n[s>>2]|0,f=n[s+4>>2]|0,n[k>>2]=m,n[k+4>>2]=f,j=hR()|0,M=j+24|0,s=dr(l,4)|0,n[F>>2]=s,l=j+28|0,c=n[l>>2]|0,c>>>0<(n[j+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=f,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],qG(c,d,s),s=(n[l>>2]|0)+12|0,n[l>>2]=s):(YDe(M,k,F),s=n[l>>2]|0),C=O,((s-(n[M>>2]|0)|0)/12|0)+-1|0}function qG(s,l,c){s=s|0,l=l|0,c=c|0;var f=0;f=n[l+4>>2]|0,n[s>>2]=n[l>>2],n[s+4>>2]=f,n[s+8>>2]=c}function YDe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0,j=0,oe=0;if(M=C,C=C+48|0,f=M+32|0,B=M+24|0,k=M,F=s+4|0,d=(((n[F>>2]|0)-(n[s>>2]|0)|0)/12|0)+1|0,m=KDe(s)|0,m>>>0>>0)Zr(s);else{O=n[s>>2]|0,oe=((n[s+8>>2]|0)-O|0)/12|0,j=oe<<1,VDe(k,oe>>>0>>1>>>0?j>>>0>>0?d:j:m,((n[F>>2]|0)-O|0)/12|0,s+8|0),F=k+8|0,m=n[F>>2]|0,d=n[l+4>>2]|0,c=n[c>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[f>>2]=n[B>>2],n[f+4>>2]=n[B+4>>2],qG(m,f,c),n[F>>2]=(n[F>>2]|0)+12,zDe(s,k),JDe(k),C=M;return}}function KDe(s){return s=s|0,357913941}function VDe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0;n[s+12>>2]=0,n[s+16>>2]=f;do if(l)if(l>>>0>357913941)Tt();else{d=Yt(l*12|0)|0;break}else d=0;while(!1);n[s>>2]=d,f=d+(c*12|0)|0,n[s+8>>2]=f,n[s+4>>2]=f,n[s+12>>2]=d+(l*12|0)}function zDe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0;f=n[s>>2]|0,B=s+4|0,m=l+4|0,d=(n[B>>2]|0)-f|0,c=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=c,(d|0)>0?(br(c|0,f|0,d|0)|0,f=m,c=n[m>>2]|0):f=m,m=n[s>>2]|0,n[s>>2]=c,n[f>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=s+8|0,B=l+12|0,s=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=s,n[l>>2]=n[f>>2]}function JDe(s){s=s|0;var l=0,c=0,f=0;l=n[s+4>>2]|0,c=s+8|0,f=n[c>>2]|0,(f|0)!=(l|0)&&(n[c>>2]=f+(~(((f+-12-l|0)>>>0)/12|0)*12|0)),s=n[s>>2]|0,s|0&&yt(s)}function jG(s){s=s|0,$De(s)}function XDe(s){s=s|0,ZDe(s+24|0)}function ZDe(s){s=s|0;var l=0,c=0,f=0;c=n[s>>2]|0,f=c,c|0&&(s=s+4|0,l=n[s>>2]|0,(l|0)!=(c|0)&&(n[s>>2]=l+(~(((l+-12-f|0)>>>0)/12|0)*12|0)),yt(c))}function $De(s){s=s|0;var l=0;l=zr()|0,Jr(s,2,4,l,ePe()|0,0),n[s+24>>2]=0,n[s+28>>2]=0,n[s+32>>2]=0}function ePe(){return 1160}function tPe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0;return c=C,C=C+16|0,f=c+8|0,d=c,m=rPe(s)|0,s=n[m+4>>2]|0,n[d>>2]=n[m>>2],n[d+4>>2]=s,n[f>>2]=n[d>>2],n[f+4>>2]=n[d+4>>2],l=nPe(l,f)|0,C=c,l|0}function rPe(s){return s=s|0,(n[(hR()|0)+24>>2]|0)+(s*12|0)|0}function nPe(s,l){s=s|0,l=l|0;var c=0;return c=n[l>>2]|0,l=n[l+4>>2]|0,s=s+(l>>1)|0,l&1&&(c=n[(n[s>>2]|0)+c>>2]|0),GG(_0[c&31](s)|0)|0}function GG(s){return s=s|0,s&1|0}function iPe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0;f=C,C=C+16|0,d=f+8|0,m=f,k=n[c>>2]|0,B=n[c+4>>2]|0,c=mn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],sPe(s,c,d,0),C=f}function sPe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0,m=0,B=0,k=0,F=0,M=0,O=0;d=C,C=C+32|0,m=d+16|0,O=d+8|0,k=d,M=n[c>>2]|0,F=n[c+4>>2]|0,B=n[s>>2]|0,s=gR()|0,n[O>>2]=M,n[O+4>>2]=F,n[m>>2]=n[O>>2],n[m+4>>2]=n[O+4>>2],c=oPe(m)|0,n[k>>2]=M,n[k+4>>2]=F,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],yn(B,l,s,c,aPe(m,f)|0,f),C=d}function gR(){var s=0,l=0;if(o[7656]|0||(YG(9304),pr(28,9304,U|0)|0,l=7656,n[l>>2]=1,n[l+4>>2]=0),!(Nr(9304)|0)){s=9304,l=s+36|0;do n[s>>2]=0,s=s+4|0;while((s|0)<(l|0));YG(9304)}return 9304}function oPe(s){return s=s|0,0}function aPe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0,j=0;return O=C,C=C+32|0,d=O+24|0,B=O+16|0,k=O,F=O+8|0,m=n[s>>2]|0,f=n[s+4>>2]|0,n[k>>2]=m,n[k+4>>2]=f,j=gR()|0,M=j+24|0,s=dr(l,4)|0,n[F>>2]=s,l=j+28|0,c=n[l>>2]|0,c>>>0<(n[j+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=f,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],WG(c,d,s),s=(n[l>>2]|0)+12|0,n[l>>2]=s):(lPe(M,k,F),s=n[l>>2]|0),C=O,((s-(n[M>>2]|0)|0)/12|0)+-1|0}function WG(s,l,c){s=s|0,l=l|0,c=c|0;var f=0;f=n[l+4>>2]|0,n[s>>2]=n[l>>2],n[s+4>>2]=f,n[s+8>>2]=c}function lPe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0,j=0,oe=0;if(M=C,C=C+48|0,f=M+32|0,B=M+24|0,k=M,F=s+4|0,d=(((n[F>>2]|0)-(n[s>>2]|0)|0)/12|0)+1|0,m=cPe(s)|0,m>>>0>>0)Zr(s);else{O=n[s>>2]|0,oe=((n[s+8>>2]|0)-O|0)/12|0,j=oe<<1,uPe(k,oe>>>0>>1>>>0?j>>>0>>0?d:j:m,((n[F>>2]|0)-O|0)/12|0,s+8|0),F=k+8|0,m=n[F>>2]|0,d=n[l+4>>2]|0,c=n[c>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[f>>2]=n[B>>2],n[f+4>>2]=n[B+4>>2],WG(m,f,c),n[F>>2]=(n[F>>2]|0)+12,APe(s,k),fPe(k),C=M;return}}function cPe(s){return s=s|0,357913941}function uPe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0;n[s+12>>2]=0,n[s+16>>2]=f;do if(l)if(l>>>0>357913941)Tt();else{d=Yt(l*12|0)|0;break}else d=0;while(!1);n[s>>2]=d,f=d+(c*12|0)|0,n[s+8>>2]=f,n[s+4>>2]=f,n[s+12>>2]=d+(l*12|0)}function APe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0;f=n[s>>2]|0,B=s+4|0,m=l+4|0,d=(n[B>>2]|0)-f|0,c=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=c,(d|0)>0?(br(c|0,f|0,d|0)|0,f=m,c=n[m>>2]|0):f=m,m=n[s>>2]|0,n[s>>2]=c,n[f>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=s+8|0,B=l+12|0,s=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=s,n[l>>2]=n[f>>2]}function fPe(s){s=s|0;var l=0,c=0,f=0;l=n[s+4>>2]|0,c=s+8|0,f=n[c>>2]|0,(f|0)!=(l|0)&&(n[c>>2]=f+(~(((f+-12-l|0)>>>0)/12|0)*12|0)),s=n[s>>2]|0,s|0&&yt(s)}function YG(s){s=s|0,gPe(s)}function pPe(s){s=s|0,hPe(s+24|0)}function hPe(s){s=s|0;var l=0,c=0,f=0;c=n[s>>2]|0,f=c,c|0&&(s=s+4|0,l=n[s>>2]|0,(l|0)!=(c|0)&&(n[s>>2]=l+(~(((l+-12-f|0)>>>0)/12|0)*12|0)),yt(c))}function gPe(s){s=s|0;var l=0;l=zr()|0,Jr(s,2,5,l,dPe()|0,1),n[s+24>>2]=0,n[s+28>>2]=0,n[s+32>>2]=0}function dPe(){return 1164}function mPe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0;f=C,C=C+16|0,d=f+8|0,m=f,B=yPe(s)|0,s=n[B+4>>2]|0,n[m>>2]=n[B>>2],n[m+4>>2]=s,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],EPe(l,d,c),C=f}function yPe(s){return s=s|0,(n[(gR()|0)+24>>2]|0)+(s*12|0)|0}function EPe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0;m=C,C=C+16|0,d=m,f=n[l>>2]|0,l=n[l+4>>2]|0,s=s+(l>>1)|0,l&1&&(f=n[(n[s>>2]|0)+f>>2]|0),xp(d,c),c=bp(d,c)|0,tf[f&31](s,c),kp(d),C=m}function xp(s,l){s=s|0,l=l|0,CPe(s,l)}function bp(s,l){return s=s|0,l=l|0,s|0}function kp(s){s=s|0,xu(s)}function CPe(s,l){s=s|0,l=l|0,dR(s,l)}function dR(s,l){s=s|0,l=l|0,n[s>>2]=l}function IPe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0;f=C,C=C+16|0,d=f+8|0,m=f,k=n[c>>2]|0,B=n[c+4>>2]|0,c=mn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],wPe(s,c,d,0),C=f}function wPe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0,m=0,B=0,k=0,F=0,M=0,O=0;d=C,C=C+32|0,m=d+16|0,O=d+8|0,k=d,M=n[c>>2]|0,F=n[c+4>>2]|0,B=n[s>>2]|0,s=mR()|0,n[O>>2]=M,n[O+4>>2]=F,n[m>>2]=n[O>>2],n[m+4>>2]=n[O+4>>2],c=BPe(m)|0,n[k>>2]=M,n[k+4>>2]=F,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],yn(B,l,s,c,vPe(m,f)|0,f),C=d}function mR(){var s=0,l=0;if(o[7664]|0||(VG(9340),pr(29,9340,U|0)|0,l=7664,n[l>>2]=1,n[l+4>>2]=0),!(Nr(9340)|0)){s=9340,l=s+36|0;do n[s>>2]=0,s=s+4|0;while((s|0)<(l|0));VG(9340)}return 9340}function BPe(s){return s=s|0,0}function vPe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0,j=0;return O=C,C=C+32|0,d=O+24|0,B=O+16|0,k=O,F=O+8|0,m=n[s>>2]|0,f=n[s+4>>2]|0,n[k>>2]=m,n[k+4>>2]=f,j=mR()|0,M=j+24|0,s=dr(l,4)|0,n[F>>2]=s,l=j+28|0,c=n[l>>2]|0,c>>>0<(n[j+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=f,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],KG(c,d,s),s=(n[l>>2]|0)+12|0,n[l>>2]=s):(DPe(M,k,F),s=n[l>>2]|0),C=O,((s-(n[M>>2]|0)|0)/12|0)+-1|0}function KG(s,l,c){s=s|0,l=l|0,c=c|0;var f=0;f=n[l+4>>2]|0,n[s>>2]=n[l>>2],n[s+4>>2]=f,n[s+8>>2]=c}function DPe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0,j=0,oe=0;if(M=C,C=C+48|0,f=M+32|0,B=M+24|0,k=M,F=s+4|0,d=(((n[F>>2]|0)-(n[s>>2]|0)|0)/12|0)+1|0,m=PPe(s)|0,m>>>0>>0)Zr(s);else{O=n[s>>2]|0,oe=((n[s+8>>2]|0)-O|0)/12|0,j=oe<<1,SPe(k,oe>>>0>>1>>>0?j>>>0>>0?d:j:m,((n[F>>2]|0)-O|0)/12|0,s+8|0),F=k+8|0,m=n[F>>2]|0,d=n[l+4>>2]|0,c=n[c>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[f>>2]=n[B>>2],n[f+4>>2]=n[B+4>>2],KG(m,f,c),n[F>>2]=(n[F>>2]|0)+12,xPe(s,k),bPe(k),C=M;return}}function PPe(s){return s=s|0,357913941}function SPe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0;n[s+12>>2]=0,n[s+16>>2]=f;do if(l)if(l>>>0>357913941)Tt();else{d=Yt(l*12|0)|0;break}else d=0;while(!1);n[s>>2]=d,f=d+(c*12|0)|0,n[s+8>>2]=f,n[s+4>>2]=f,n[s+12>>2]=d+(l*12|0)}function xPe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0;f=n[s>>2]|0,B=s+4|0,m=l+4|0,d=(n[B>>2]|0)-f|0,c=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=c,(d|0)>0?(br(c|0,f|0,d|0)|0,f=m,c=n[m>>2]|0):f=m,m=n[s>>2]|0,n[s>>2]=c,n[f>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=s+8|0,B=l+12|0,s=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=s,n[l>>2]=n[f>>2]}function bPe(s){s=s|0;var l=0,c=0,f=0;l=n[s+4>>2]|0,c=s+8|0,f=n[c>>2]|0,(f|0)!=(l|0)&&(n[c>>2]=f+(~(((f+-12-l|0)>>>0)/12|0)*12|0)),s=n[s>>2]|0,s|0&&yt(s)}function VG(s){s=s|0,FPe(s)}function kPe(s){s=s|0,QPe(s+24|0)}function QPe(s){s=s|0;var l=0,c=0,f=0;c=n[s>>2]|0,f=c,c|0&&(s=s+4|0,l=n[s>>2]|0,(l|0)!=(c|0)&&(n[s>>2]=l+(~(((l+-12-f|0)>>>0)/12|0)*12|0)),yt(c))}function FPe(s){s=s|0;var l=0;l=zr()|0,Jr(s,2,4,l,RPe()|0,1),n[s+24>>2]=0,n[s+28>>2]=0,n[s+32>>2]=0}function RPe(){return 1180}function TPe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0;return f=C,C=C+16|0,d=f+8|0,m=f,B=LPe(s)|0,s=n[B+4>>2]|0,n[m>>2]=n[B>>2],n[m+4>>2]=s,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],c=NPe(l,d,c)|0,C=f,c|0}function LPe(s){return s=s|0,(n[(mR()|0)+24>>2]|0)+(s*12|0)|0}function NPe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0;return m=C,C=C+16|0,d=m,f=n[l>>2]|0,l=n[l+4>>2]|0,s=s+(l>>1)|0,l&1&&(f=n[(n[s>>2]|0)+f>>2]|0),F0(d,c),d=R0(d,c)|0,d=FD(pT[f&15](s,d)|0)|0,C=m,d|0}function F0(s,l){s=s|0,l=l|0}function R0(s,l){return s=s|0,l=l|0,OPe(l)|0}function FD(s){return s=s|0,s|0}function OPe(s){return s=s|0,s|0}function MPe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0;f=C,C=C+16|0,d=f+8|0,m=f,k=n[c>>2]|0,B=n[c+4>>2]|0,c=mn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],UPe(s,c,d,0),C=f}function UPe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0,m=0,B=0,k=0,F=0,M=0,O=0;d=C,C=C+32|0,m=d+16|0,O=d+8|0,k=d,M=n[c>>2]|0,F=n[c+4>>2]|0,B=n[s>>2]|0,s=yR()|0,n[O>>2]=M,n[O+4>>2]=F,n[m>>2]=n[O>>2],n[m+4>>2]=n[O+4>>2],c=_Pe(m)|0,n[k>>2]=M,n[k+4>>2]=F,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],yn(B,l,s,c,HPe(m,f)|0,f),C=d}function yR(){var s=0,l=0;if(o[7672]|0||(JG(9376),pr(30,9376,U|0)|0,l=7672,n[l>>2]=1,n[l+4>>2]=0),!(Nr(9376)|0)){s=9376,l=s+36|0;do n[s>>2]=0,s=s+4|0;while((s|0)<(l|0));JG(9376)}return 9376}function _Pe(s){return s=s|0,0}function HPe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0,j=0;return O=C,C=C+32|0,d=O+24|0,B=O+16|0,k=O,F=O+8|0,m=n[s>>2]|0,f=n[s+4>>2]|0,n[k>>2]=m,n[k+4>>2]=f,j=yR()|0,M=j+24|0,s=dr(l,4)|0,n[F>>2]=s,l=j+28|0,c=n[l>>2]|0,c>>>0<(n[j+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=f,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],zG(c,d,s),s=(n[l>>2]|0)+12|0,n[l>>2]=s):(qPe(M,k,F),s=n[l>>2]|0),C=O,((s-(n[M>>2]|0)|0)/12|0)+-1|0}function zG(s,l,c){s=s|0,l=l|0,c=c|0;var f=0;f=n[l+4>>2]|0,n[s>>2]=n[l>>2],n[s+4>>2]=f,n[s+8>>2]=c}function qPe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0,j=0,oe=0;if(M=C,C=C+48|0,f=M+32|0,B=M+24|0,k=M,F=s+4|0,d=(((n[F>>2]|0)-(n[s>>2]|0)|0)/12|0)+1|0,m=jPe(s)|0,m>>>0>>0)Zr(s);else{O=n[s>>2]|0,oe=((n[s+8>>2]|0)-O|0)/12|0,j=oe<<1,GPe(k,oe>>>0>>1>>>0?j>>>0>>0?d:j:m,((n[F>>2]|0)-O|0)/12|0,s+8|0),F=k+8|0,m=n[F>>2]|0,d=n[l+4>>2]|0,c=n[c>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[f>>2]=n[B>>2],n[f+4>>2]=n[B+4>>2],zG(m,f,c),n[F>>2]=(n[F>>2]|0)+12,WPe(s,k),YPe(k),C=M;return}}function jPe(s){return s=s|0,357913941}function GPe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0;n[s+12>>2]=0,n[s+16>>2]=f;do if(l)if(l>>>0>357913941)Tt();else{d=Yt(l*12|0)|0;break}else d=0;while(!1);n[s>>2]=d,f=d+(c*12|0)|0,n[s+8>>2]=f,n[s+4>>2]=f,n[s+12>>2]=d+(l*12|0)}function WPe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0;f=n[s>>2]|0,B=s+4|0,m=l+4|0,d=(n[B>>2]|0)-f|0,c=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=c,(d|0)>0?(br(c|0,f|0,d|0)|0,f=m,c=n[m>>2]|0):f=m,m=n[s>>2]|0,n[s>>2]=c,n[f>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=s+8|0,B=l+12|0,s=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=s,n[l>>2]=n[f>>2]}function YPe(s){s=s|0;var l=0,c=0,f=0;l=n[s+4>>2]|0,c=s+8|0,f=n[c>>2]|0,(f|0)!=(l|0)&&(n[c>>2]=f+(~(((f+-12-l|0)>>>0)/12|0)*12|0)),s=n[s>>2]|0,s|0&&yt(s)}function JG(s){s=s|0,zPe(s)}function KPe(s){s=s|0,VPe(s+24|0)}function VPe(s){s=s|0;var l=0,c=0,f=0;c=n[s>>2]|0,f=c,c|0&&(s=s+4|0,l=n[s>>2]|0,(l|0)!=(c|0)&&(n[s>>2]=l+(~(((l+-12-f|0)>>>0)/12|0)*12|0)),yt(c))}function zPe(s){s=s|0;var l=0;l=zr()|0,Jr(s,2,5,l,XG()|0,0),n[s+24>>2]=0,n[s+28>>2]=0,n[s+32>>2]=0}function XG(){return 1196}function JPe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0;return c=C,C=C+16|0,f=c+8|0,d=c,m=XPe(s)|0,s=n[m+4>>2]|0,n[d>>2]=n[m>>2],n[d+4>>2]=s,n[f>>2]=n[d>>2],n[f+4>>2]=n[d+4>>2],l=ZPe(l,f)|0,C=c,l|0}function XPe(s){return s=s|0,(n[(yR()|0)+24>>2]|0)+(s*12|0)|0}function ZPe(s,l){s=s|0,l=l|0;var c=0;return c=n[l>>2]|0,l=n[l+4>>2]|0,s=s+(l>>1)|0,l&1&&(c=n[(n[s>>2]|0)+c>>2]|0),FD(_0[c&31](s)|0)|0}function $Pe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0;f=C,C=C+16|0,d=f+8|0,m=f,k=n[c>>2]|0,B=n[c+4>>2]|0,c=mn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],eSe(s,c,d,1),C=f}function eSe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0,m=0,B=0,k=0,F=0,M=0,O=0;d=C,C=C+32|0,m=d+16|0,O=d+8|0,k=d,M=n[c>>2]|0,F=n[c+4>>2]|0,B=n[s>>2]|0,s=ER()|0,n[O>>2]=M,n[O+4>>2]=F,n[m>>2]=n[O>>2],n[m+4>>2]=n[O+4>>2],c=tSe(m)|0,n[k>>2]=M,n[k+4>>2]=F,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],yn(B,l,s,c,rSe(m,f)|0,f),C=d}function ER(){var s=0,l=0;if(o[7680]|0||($G(9412),pr(31,9412,U|0)|0,l=7680,n[l>>2]=1,n[l+4>>2]=0),!(Nr(9412)|0)){s=9412,l=s+36|0;do n[s>>2]=0,s=s+4|0;while((s|0)<(l|0));$G(9412)}return 9412}function tSe(s){return s=s|0,0}function rSe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0,j=0;return O=C,C=C+32|0,d=O+24|0,B=O+16|0,k=O,F=O+8|0,m=n[s>>2]|0,f=n[s+4>>2]|0,n[k>>2]=m,n[k+4>>2]=f,j=ER()|0,M=j+24|0,s=dr(l,4)|0,n[F>>2]=s,l=j+28|0,c=n[l>>2]|0,c>>>0<(n[j+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=f,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],ZG(c,d,s),s=(n[l>>2]|0)+12|0,n[l>>2]=s):(nSe(M,k,F),s=n[l>>2]|0),C=O,((s-(n[M>>2]|0)|0)/12|0)+-1|0}function ZG(s,l,c){s=s|0,l=l|0,c=c|0;var f=0;f=n[l+4>>2]|0,n[s>>2]=n[l>>2],n[s+4>>2]=f,n[s+8>>2]=c}function nSe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0,j=0,oe=0;if(M=C,C=C+48|0,f=M+32|0,B=M+24|0,k=M,F=s+4|0,d=(((n[F>>2]|0)-(n[s>>2]|0)|0)/12|0)+1|0,m=iSe(s)|0,m>>>0>>0)Zr(s);else{O=n[s>>2]|0,oe=((n[s+8>>2]|0)-O|0)/12|0,j=oe<<1,sSe(k,oe>>>0>>1>>>0?j>>>0>>0?d:j:m,((n[F>>2]|0)-O|0)/12|0,s+8|0),F=k+8|0,m=n[F>>2]|0,d=n[l+4>>2]|0,c=n[c>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[f>>2]=n[B>>2],n[f+4>>2]=n[B+4>>2],ZG(m,f,c),n[F>>2]=(n[F>>2]|0)+12,oSe(s,k),aSe(k),C=M;return}}function iSe(s){return s=s|0,357913941}function sSe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0;n[s+12>>2]=0,n[s+16>>2]=f;do if(l)if(l>>>0>357913941)Tt();else{d=Yt(l*12|0)|0;break}else d=0;while(!1);n[s>>2]=d,f=d+(c*12|0)|0,n[s+8>>2]=f,n[s+4>>2]=f,n[s+12>>2]=d+(l*12|0)}function oSe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0;f=n[s>>2]|0,B=s+4|0,m=l+4|0,d=(n[B>>2]|0)-f|0,c=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=c,(d|0)>0?(br(c|0,f|0,d|0)|0,f=m,c=n[m>>2]|0):f=m,m=n[s>>2]|0,n[s>>2]=c,n[f>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=s+8|0,B=l+12|0,s=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=s,n[l>>2]=n[f>>2]}function aSe(s){s=s|0;var l=0,c=0,f=0;l=n[s+4>>2]|0,c=s+8|0,f=n[c>>2]|0,(f|0)!=(l|0)&&(n[c>>2]=f+(~(((f+-12-l|0)>>>0)/12|0)*12|0)),s=n[s>>2]|0,s|0&&yt(s)}function $G(s){s=s|0,uSe(s)}function lSe(s){s=s|0,cSe(s+24|0)}function cSe(s){s=s|0;var l=0,c=0,f=0;c=n[s>>2]|0,f=c,c|0&&(s=s+4|0,l=n[s>>2]|0,(l|0)!=(c|0)&&(n[s>>2]=l+(~(((l+-12-f|0)>>>0)/12|0)*12|0)),yt(c))}function uSe(s){s=s|0;var l=0;l=zr()|0,Jr(s,2,6,l,e5()|0,0),n[s+24>>2]=0,n[s+28>>2]=0,n[s+32>>2]=0}function e5(){return 1200}function ASe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0;return c=C,C=C+16|0,f=c+8|0,d=c,m=fSe(s)|0,s=n[m+4>>2]|0,n[d>>2]=n[m>>2],n[d+4>>2]=s,n[f>>2]=n[d>>2],n[f+4>>2]=n[d+4>>2],l=pSe(l,f)|0,C=c,l|0}function fSe(s){return s=s|0,(n[(ER()|0)+24>>2]|0)+(s*12|0)|0}function pSe(s,l){s=s|0,l=l|0;var c=0;return c=n[l>>2]|0,l=n[l+4>>2]|0,s=s+(l>>1)|0,l&1&&(c=n[(n[s>>2]|0)+c>>2]|0),RD(_0[c&31](s)|0)|0}function RD(s){return s=s|0,s|0}function hSe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0;f=C,C=C+16|0,d=f+8|0,m=f,k=n[c>>2]|0,B=n[c+4>>2]|0,c=mn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],gSe(s,c,d,0),C=f}function gSe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0,m=0,B=0,k=0,F=0,M=0,O=0;d=C,C=C+32|0,m=d+16|0,O=d+8|0,k=d,M=n[c>>2]|0,F=n[c+4>>2]|0,B=n[s>>2]|0,s=CR()|0,n[O>>2]=M,n[O+4>>2]=F,n[m>>2]=n[O>>2],n[m+4>>2]=n[O+4>>2],c=dSe(m)|0,n[k>>2]=M,n[k+4>>2]=F,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],yn(B,l,s,c,mSe(m,f)|0,f),C=d}function CR(){var s=0,l=0;if(o[7688]|0||(r5(9448),pr(32,9448,U|0)|0,l=7688,n[l>>2]=1,n[l+4>>2]=0),!(Nr(9448)|0)){s=9448,l=s+36|0;do n[s>>2]=0,s=s+4|0;while((s|0)<(l|0));r5(9448)}return 9448}function dSe(s){return s=s|0,0}function mSe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0,j=0;return O=C,C=C+32|0,d=O+24|0,B=O+16|0,k=O,F=O+8|0,m=n[s>>2]|0,f=n[s+4>>2]|0,n[k>>2]=m,n[k+4>>2]=f,j=CR()|0,M=j+24|0,s=dr(l,4)|0,n[F>>2]=s,l=j+28|0,c=n[l>>2]|0,c>>>0<(n[j+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=f,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],t5(c,d,s),s=(n[l>>2]|0)+12|0,n[l>>2]=s):(ySe(M,k,F),s=n[l>>2]|0),C=O,((s-(n[M>>2]|0)|0)/12|0)+-1|0}function t5(s,l,c){s=s|0,l=l|0,c=c|0;var f=0;f=n[l+4>>2]|0,n[s>>2]=n[l>>2],n[s+4>>2]=f,n[s+8>>2]=c}function ySe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0,j=0,oe=0;if(M=C,C=C+48|0,f=M+32|0,B=M+24|0,k=M,F=s+4|0,d=(((n[F>>2]|0)-(n[s>>2]|0)|0)/12|0)+1|0,m=ESe(s)|0,m>>>0>>0)Zr(s);else{O=n[s>>2]|0,oe=((n[s+8>>2]|0)-O|0)/12|0,j=oe<<1,CSe(k,oe>>>0>>1>>>0?j>>>0>>0?d:j:m,((n[F>>2]|0)-O|0)/12|0,s+8|0),F=k+8|0,m=n[F>>2]|0,d=n[l+4>>2]|0,c=n[c>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[f>>2]=n[B>>2],n[f+4>>2]=n[B+4>>2],t5(m,f,c),n[F>>2]=(n[F>>2]|0)+12,ISe(s,k),wSe(k),C=M;return}}function ESe(s){return s=s|0,357913941}function CSe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0;n[s+12>>2]=0,n[s+16>>2]=f;do if(l)if(l>>>0>357913941)Tt();else{d=Yt(l*12|0)|0;break}else d=0;while(!1);n[s>>2]=d,f=d+(c*12|0)|0,n[s+8>>2]=f,n[s+4>>2]=f,n[s+12>>2]=d+(l*12|0)}function ISe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0;f=n[s>>2]|0,B=s+4|0,m=l+4|0,d=(n[B>>2]|0)-f|0,c=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=c,(d|0)>0?(br(c|0,f|0,d|0)|0,f=m,c=n[m>>2]|0):f=m,m=n[s>>2]|0,n[s>>2]=c,n[f>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=s+8|0,B=l+12|0,s=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=s,n[l>>2]=n[f>>2]}function wSe(s){s=s|0;var l=0,c=0,f=0;l=n[s+4>>2]|0,c=s+8|0,f=n[c>>2]|0,(f|0)!=(l|0)&&(n[c>>2]=f+(~(((f+-12-l|0)>>>0)/12|0)*12|0)),s=n[s>>2]|0,s|0&&yt(s)}function r5(s){s=s|0,DSe(s)}function BSe(s){s=s|0,vSe(s+24|0)}function vSe(s){s=s|0;var l=0,c=0,f=0;c=n[s>>2]|0,f=c,c|0&&(s=s+4|0,l=n[s>>2]|0,(l|0)!=(c|0)&&(n[s>>2]=l+(~(((l+-12-f|0)>>>0)/12|0)*12|0)),yt(c))}function DSe(s){s=s|0;var l=0;l=zr()|0,Jr(s,2,6,l,n5()|0,1),n[s+24>>2]=0,n[s+28>>2]=0,n[s+32>>2]=0}function n5(){return 1204}function PSe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0;f=C,C=C+16|0,d=f+8|0,m=f,B=SSe(s)|0,s=n[B+4>>2]|0,n[m>>2]=n[B>>2],n[m+4>>2]=s,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],xSe(l,d,c),C=f}function SSe(s){return s=s|0,(n[(CR()|0)+24>>2]|0)+(s*12|0)|0}function xSe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0;m=C,C=C+16|0,d=m,f=n[l>>2]|0,l=n[l+4>>2]|0,s=s+(l>>1)|0,l&1&&(f=n[(n[s>>2]|0)+f>>2]|0),IR(d,c),d=wR(d,c)|0,tf[f&31](s,d),C=m}function IR(s,l){s=s|0,l=l|0}function wR(s,l){return s=s|0,l=l|0,bSe(l)|0}function bSe(s){return s=s|0,s|0}function kSe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0;f=C,C=C+16|0,d=f+8|0,m=f,k=n[c>>2]|0,B=n[c+4>>2]|0,c=mn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],QSe(s,c,d,0),C=f}function QSe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0,m=0,B=0,k=0,F=0,M=0,O=0;d=C,C=C+32|0,m=d+16|0,O=d+8|0,k=d,M=n[c>>2]|0,F=n[c+4>>2]|0,B=n[s>>2]|0,s=BR()|0,n[O>>2]=M,n[O+4>>2]=F,n[m>>2]=n[O>>2],n[m+4>>2]=n[O+4>>2],c=FSe(m)|0,n[k>>2]=M,n[k+4>>2]=F,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],yn(B,l,s,c,RSe(m,f)|0,f),C=d}function BR(){var s=0,l=0;if(o[7696]|0||(s5(9484),pr(33,9484,U|0)|0,l=7696,n[l>>2]=1,n[l+4>>2]=0),!(Nr(9484)|0)){s=9484,l=s+36|0;do n[s>>2]=0,s=s+4|0;while((s|0)<(l|0));s5(9484)}return 9484}function FSe(s){return s=s|0,0}function RSe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0,j=0;return O=C,C=C+32|0,d=O+24|0,B=O+16|0,k=O,F=O+8|0,m=n[s>>2]|0,f=n[s+4>>2]|0,n[k>>2]=m,n[k+4>>2]=f,j=BR()|0,M=j+24|0,s=dr(l,4)|0,n[F>>2]=s,l=j+28|0,c=n[l>>2]|0,c>>>0<(n[j+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=f,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],i5(c,d,s),s=(n[l>>2]|0)+12|0,n[l>>2]=s):(TSe(M,k,F),s=n[l>>2]|0),C=O,((s-(n[M>>2]|0)|0)/12|0)+-1|0}function i5(s,l,c){s=s|0,l=l|0,c=c|0;var f=0;f=n[l+4>>2]|0,n[s>>2]=n[l>>2],n[s+4>>2]=f,n[s+8>>2]=c}function TSe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0,j=0,oe=0;if(M=C,C=C+48|0,f=M+32|0,B=M+24|0,k=M,F=s+4|0,d=(((n[F>>2]|0)-(n[s>>2]|0)|0)/12|0)+1|0,m=LSe(s)|0,m>>>0>>0)Zr(s);else{O=n[s>>2]|0,oe=((n[s+8>>2]|0)-O|0)/12|0,j=oe<<1,NSe(k,oe>>>0>>1>>>0?j>>>0>>0?d:j:m,((n[F>>2]|0)-O|0)/12|0,s+8|0),F=k+8|0,m=n[F>>2]|0,d=n[l+4>>2]|0,c=n[c>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[f>>2]=n[B>>2],n[f+4>>2]=n[B+4>>2],i5(m,f,c),n[F>>2]=(n[F>>2]|0)+12,OSe(s,k),MSe(k),C=M;return}}function LSe(s){return s=s|0,357913941}function NSe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0;n[s+12>>2]=0,n[s+16>>2]=f;do if(l)if(l>>>0>357913941)Tt();else{d=Yt(l*12|0)|0;break}else d=0;while(!1);n[s>>2]=d,f=d+(c*12|0)|0,n[s+8>>2]=f,n[s+4>>2]=f,n[s+12>>2]=d+(l*12|0)}function OSe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0;f=n[s>>2]|0,B=s+4|0,m=l+4|0,d=(n[B>>2]|0)-f|0,c=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=c,(d|0)>0?(br(c|0,f|0,d|0)|0,f=m,c=n[m>>2]|0):f=m,m=n[s>>2]|0,n[s>>2]=c,n[f>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=s+8|0,B=l+12|0,s=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=s,n[l>>2]=n[f>>2]}function MSe(s){s=s|0;var l=0,c=0,f=0;l=n[s+4>>2]|0,c=s+8|0,f=n[c>>2]|0,(f|0)!=(l|0)&&(n[c>>2]=f+(~(((f+-12-l|0)>>>0)/12|0)*12|0)),s=n[s>>2]|0,s|0&&yt(s)}function s5(s){s=s|0,HSe(s)}function USe(s){s=s|0,_Se(s+24|0)}function _Se(s){s=s|0;var l=0,c=0,f=0;c=n[s>>2]|0,f=c,c|0&&(s=s+4|0,l=n[s>>2]|0,(l|0)!=(c|0)&&(n[s>>2]=l+(~(((l+-12-f|0)>>>0)/12|0)*12|0)),yt(c))}function HSe(s){s=s|0;var l=0;l=zr()|0,Jr(s,2,1,l,qSe()|0,2),n[s+24>>2]=0,n[s+28>>2]=0,n[s+32>>2]=0}function qSe(){return 1212}function jSe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0,m=0,B=0,k=0;d=C,C=C+16|0,m=d+8|0,B=d,k=GSe(s)|0,s=n[k+4>>2]|0,n[B>>2]=n[k>>2],n[B+4>>2]=s,n[m>>2]=n[B>>2],n[m+4>>2]=n[B+4>>2],WSe(l,m,c,f),C=d}function GSe(s){return s=s|0,(n[(BR()|0)+24>>2]|0)+(s*12|0)|0}function WSe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0,m=0,B=0,k=0;k=C,C=C+16|0,m=k+1|0,B=k,d=n[l>>2]|0,l=n[l+4>>2]|0,s=s+(l>>1)|0,l&1&&(d=n[(n[s>>2]|0)+d>>2]|0),IR(m,c),m=wR(m,c)|0,F0(B,f),B=R0(B,f)|0,sw[d&15](s,m,B),C=k}function YSe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0;f=C,C=C+16|0,d=f+8|0,m=f,k=n[c>>2]|0,B=n[c+4>>2]|0,c=mn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],KSe(s,c,d,1),C=f}function KSe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0,m=0,B=0,k=0,F=0,M=0,O=0;d=C,C=C+32|0,m=d+16|0,O=d+8|0,k=d,M=n[c>>2]|0,F=n[c+4>>2]|0,B=n[s>>2]|0,s=vR()|0,n[O>>2]=M,n[O+4>>2]=F,n[m>>2]=n[O>>2],n[m+4>>2]=n[O+4>>2],c=VSe(m)|0,n[k>>2]=M,n[k+4>>2]=F,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],yn(B,l,s,c,zSe(m,f)|0,f),C=d}function vR(){var s=0,l=0;if(o[7704]|0||(a5(9520),pr(34,9520,U|0)|0,l=7704,n[l>>2]=1,n[l+4>>2]=0),!(Nr(9520)|0)){s=9520,l=s+36|0;do n[s>>2]=0,s=s+4|0;while((s|0)<(l|0));a5(9520)}return 9520}function VSe(s){return s=s|0,0}function zSe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0,j=0;return O=C,C=C+32|0,d=O+24|0,B=O+16|0,k=O,F=O+8|0,m=n[s>>2]|0,f=n[s+4>>2]|0,n[k>>2]=m,n[k+4>>2]=f,j=vR()|0,M=j+24|0,s=dr(l,4)|0,n[F>>2]=s,l=j+28|0,c=n[l>>2]|0,c>>>0<(n[j+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=f,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],o5(c,d,s),s=(n[l>>2]|0)+12|0,n[l>>2]=s):(JSe(M,k,F),s=n[l>>2]|0),C=O,((s-(n[M>>2]|0)|0)/12|0)+-1|0}function o5(s,l,c){s=s|0,l=l|0,c=c|0;var f=0;f=n[l+4>>2]|0,n[s>>2]=n[l>>2],n[s+4>>2]=f,n[s+8>>2]=c}function JSe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0,j=0,oe=0;if(M=C,C=C+48|0,f=M+32|0,B=M+24|0,k=M,F=s+4|0,d=(((n[F>>2]|0)-(n[s>>2]|0)|0)/12|0)+1|0,m=XSe(s)|0,m>>>0>>0)Zr(s);else{O=n[s>>2]|0,oe=((n[s+8>>2]|0)-O|0)/12|0,j=oe<<1,ZSe(k,oe>>>0>>1>>>0?j>>>0>>0?d:j:m,((n[F>>2]|0)-O|0)/12|0,s+8|0),F=k+8|0,m=n[F>>2]|0,d=n[l+4>>2]|0,c=n[c>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[f>>2]=n[B>>2],n[f+4>>2]=n[B+4>>2],o5(m,f,c),n[F>>2]=(n[F>>2]|0)+12,$Se(s,k),exe(k),C=M;return}}function XSe(s){return s=s|0,357913941}function ZSe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0;n[s+12>>2]=0,n[s+16>>2]=f;do if(l)if(l>>>0>357913941)Tt();else{d=Yt(l*12|0)|0;break}else d=0;while(!1);n[s>>2]=d,f=d+(c*12|0)|0,n[s+8>>2]=f,n[s+4>>2]=f,n[s+12>>2]=d+(l*12|0)}function $Se(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0;f=n[s>>2]|0,B=s+4|0,m=l+4|0,d=(n[B>>2]|0)-f|0,c=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=c,(d|0)>0?(br(c|0,f|0,d|0)|0,f=m,c=n[m>>2]|0):f=m,m=n[s>>2]|0,n[s>>2]=c,n[f>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=s+8|0,B=l+12|0,s=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=s,n[l>>2]=n[f>>2]}function exe(s){s=s|0;var l=0,c=0,f=0;l=n[s+4>>2]|0,c=s+8|0,f=n[c>>2]|0,(f|0)!=(l|0)&&(n[c>>2]=f+(~(((f+-12-l|0)>>>0)/12|0)*12|0)),s=n[s>>2]|0,s|0&&yt(s)}function a5(s){s=s|0,nxe(s)}function txe(s){s=s|0,rxe(s+24|0)}function rxe(s){s=s|0;var l=0,c=0,f=0;c=n[s>>2]|0,f=c,c|0&&(s=s+4|0,l=n[s>>2]|0,(l|0)!=(c|0)&&(n[s>>2]=l+(~(((l+-12-f|0)>>>0)/12|0)*12|0)),yt(c))}function nxe(s){s=s|0;var l=0;l=zr()|0,Jr(s,2,1,l,ixe()|0,1),n[s+24>>2]=0,n[s+28>>2]=0,n[s+32>>2]=0}function ixe(){return 1224}function sxe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0;return d=C,C=C+16|0,m=d+8|0,B=d,k=oxe(s)|0,s=n[k+4>>2]|0,n[B>>2]=n[k>>2],n[B+4>>2]=s,n[m>>2]=n[B>>2],n[m+4>>2]=n[B+4>>2],f=+axe(l,m,c),C=d,+f}function oxe(s){return s=s|0,(n[(vR()|0)+24>>2]|0)+(s*12|0)|0}function axe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0;return m=C,C=C+16|0,d=m,f=n[l>>2]|0,l=n[l+4>>2]|0,s=s+(l>>1)|0,l&1&&(f=n[(n[s>>2]|0)+f>>2]|0),XA(d,c),d=ZA(d,c)|0,B=+Ru(+iW[f&7](s,d)),C=m,+B}function lxe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0;f=C,C=C+16|0,d=f+8|0,m=f,k=n[c>>2]|0,B=n[c+4>>2]|0,c=mn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],cxe(s,c,d,1),C=f}function cxe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0,m=0,B=0,k=0,F=0,M=0,O=0;d=C,C=C+32|0,m=d+16|0,O=d+8|0,k=d,M=n[c>>2]|0,F=n[c+4>>2]|0,B=n[s>>2]|0,s=DR()|0,n[O>>2]=M,n[O+4>>2]=F,n[m>>2]=n[O>>2],n[m+4>>2]=n[O+4>>2],c=uxe(m)|0,n[k>>2]=M,n[k+4>>2]=F,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],yn(B,l,s,c,Axe(m,f)|0,f),C=d}function DR(){var s=0,l=0;if(o[7712]|0||(c5(9556),pr(35,9556,U|0)|0,l=7712,n[l>>2]=1,n[l+4>>2]=0),!(Nr(9556)|0)){s=9556,l=s+36|0;do n[s>>2]=0,s=s+4|0;while((s|0)<(l|0));c5(9556)}return 9556}function uxe(s){return s=s|0,0}function Axe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0,j=0;return O=C,C=C+32|0,d=O+24|0,B=O+16|0,k=O,F=O+8|0,m=n[s>>2]|0,f=n[s+4>>2]|0,n[k>>2]=m,n[k+4>>2]=f,j=DR()|0,M=j+24|0,s=dr(l,4)|0,n[F>>2]=s,l=j+28|0,c=n[l>>2]|0,c>>>0<(n[j+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=f,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],l5(c,d,s),s=(n[l>>2]|0)+12|0,n[l>>2]=s):(fxe(M,k,F),s=n[l>>2]|0),C=O,((s-(n[M>>2]|0)|0)/12|0)+-1|0}function l5(s,l,c){s=s|0,l=l|0,c=c|0;var f=0;f=n[l+4>>2]|0,n[s>>2]=n[l>>2],n[s+4>>2]=f,n[s+8>>2]=c}function fxe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0,j=0,oe=0;if(M=C,C=C+48|0,f=M+32|0,B=M+24|0,k=M,F=s+4|0,d=(((n[F>>2]|0)-(n[s>>2]|0)|0)/12|0)+1|0,m=pxe(s)|0,m>>>0>>0)Zr(s);else{O=n[s>>2]|0,oe=((n[s+8>>2]|0)-O|0)/12|0,j=oe<<1,hxe(k,oe>>>0>>1>>>0?j>>>0>>0?d:j:m,((n[F>>2]|0)-O|0)/12|0,s+8|0),F=k+8|0,m=n[F>>2]|0,d=n[l+4>>2]|0,c=n[c>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[f>>2]=n[B>>2],n[f+4>>2]=n[B+4>>2],l5(m,f,c),n[F>>2]=(n[F>>2]|0)+12,gxe(s,k),dxe(k),C=M;return}}function pxe(s){return s=s|0,357913941}function hxe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0;n[s+12>>2]=0,n[s+16>>2]=f;do if(l)if(l>>>0>357913941)Tt();else{d=Yt(l*12|0)|0;break}else d=0;while(!1);n[s>>2]=d,f=d+(c*12|0)|0,n[s+8>>2]=f,n[s+4>>2]=f,n[s+12>>2]=d+(l*12|0)}function gxe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0;f=n[s>>2]|0,B=s+4|0,m=l+4|0,d=(n[B>>2]|0)-f|0,c=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=c,(d|0)>0?(br(c|0,f|0,d|0)|0,f=m,c=n[m>>2]|0):f=m,m=n[s>>2]|0,n[s>>2]=c,n[f>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=s+8|0,B=l+12|0,s=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=s,n[l>>2]=n[f>>2]}function dxe(s){s=s|0;var l=0,c=0,f=0;l=n[s+4>>2]|0,c=s+8|0,f=n[c>>2]|0,(f|0)!=(l|0)&&(n[c>>2]=f+(~(((f+-12-l|0)>>>0)/12|0)*12|0)),s=n[s>>2]|0,s|0&&yt(s)}function c5(s){s=s|0,Exe(s)}function mxe(s){s=s|0,yxe(s+24|0)}function yxe(s){s=s|0;var l=0,c=0,f=0;c=n[s>>2]|0,f=c,c|0&&(s=s+4|0,l=n[s>>2]|0,(l|0)!=(c|0)&&(n[s>>2]=l+(~(((l+-12-f|0)>>>0)/12|0)*12|0)),yt(c))}function Exe(s){s=s|0;var l=0;l=zr()|0,Jr(s,2,5,l,Cxe()|0,0),n[s+24>>2]=0,n[s+28>>2]=0,n[s+32>>2]=0}function Cxe(){return 1232}function Ixe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0;return f=C,C=C+16|0,d=f+8|0,m=f,B=wxe(s)|0,s=n[B+4>>2]|0,n[m>>2]=n[B>>2],n[m+4>>2]=s,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],c=+Bxe(l,d),C=f,+c}function wxe(s){return s=s|0,(n[(DR()|0)+24>>2]|0)+(s*12|0)|0}function Bxe(s,l){s=s|0,l=l|0;var c=0;return c=n[l>>2]|0,l=n[l+4>>2]|0,s=s+(l>>1)|0,l&1&&(c=n[(n[s>>2]|0)+c>>2]|0),+ +Ru(+nW[c&15](s))}function vxe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0;f=C,C=C+16|0,d=f+8|0,m=f,k=n[c>>2]|0,B=n[c+4>>2]|0,c=mn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],Dxe(s,c,d,1),C=f}function Dxe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0,m=0,B=0,k=0,F=0,M=0,O=0;d=C,C=C+32|0,m=d+16|0,O=d+8|0,k=d,M=n[c>>2]|0,F=n[c+4>>2]|0,B=n[s>>2]|0,s=PR()|0,n[O>>2]=M,n[O+4>>2]=F,n[m>>2]=n[O>>2],n[m+4>>2]=n[O+4>>2],c=Pxe(m)|0,n[k>>2]=M,n[k+4>>2]=F,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],yn(B,l,s,c,Sxe(m,f)|0,f),C=d}function PR(){var s=0,l=0;if(o[7720]|0||(A5(9592),pr(36,9592,U|0)|0,l=7720,n[l>>2]=1,n[l+4>>2]=0),!(Nr(9592)|0)){s=9592,l=s+36|0;do n[s>>2]=0,s=s+4|0;while((s|0)<(l|0));A5(9592)}return 9592}function Pxe(s){return s=s|0,0}function Sxe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0,j=0;return O=C,C=C+32|0,d=O+24|0,B=O+16|0,k=O,F=O+8|0,m=n[s>>2]|0,f=n[s+4>>2]|0,n[k>>2]=m,n[k+4>>2]=f,j=PR()|0,M=j+24|0,s=dr(l,4)|0,n[F>>2]=s,l=j+28|0,c=n[l>>2]|0,c>>>0<(n[j+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=f,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],u5(c,d,s),s=(n[l>>2]|0)+12|0,n[l>>2]=s):(xxe(M,k,F),s=n[l>>2]|0),C=O,((s-(n[M>>2]|0)|0)/12|0)+-1|0}function u5(s,l,c){s=s|0,l=l|0,c=c|0;var f=0;f=n[l+4>>2]|0,n[s>>2]=n[l>>2],n[s+4>>2]=f,n[s+8>>2]=c}function xxe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0,j=0,oe=0;if(M=C,C=C+48|0,f=M+32|0,B=M+24|0,k=M,F=s+4|0,d=(((n[F>>2]|0)-(n[s>>2]|0)|0)/12|0)+1|0,m=bxe(s)|0,m>>>0>>0)Zr(s);else{O=n[s>>2]|0,oe=((n[s+8>>2]|0)-O|0)/12|0,j=oe<<1,kxe(k,oe>>>0>>1>>>0?j>>>0>>0?d:j:m,((n[F>>2]|0)-O|0)/12|0,s+8|0),F=k+8|0,m=n[F>>2]|0,d=n[l+4>>2]|0,c=n[c>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[f>>2]=n[B>>2],n[f+4>>2]=n[B+4>>2],u5(m,f,c),n[F>>2]=(n[F>>2]|0)+12,Qxe(s,k),Fxe(k),C=M;return}}function bxe(s){return s=s|0,357913941}function kxe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0;n[s+12>>2]=0,n[s+16>>2]=f;do if(l)if(l>>>0>357913941)Tt();else{d=Yt(l*12|0)|0;break}else d=0;while(!1);n[s>>2]=d,f=d+(c*12|0)|0,n[s+8>>2]=f,n[s+4>>2]=f,n[s+12>>2]=d+(l*12|0)}function Qxe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0;f=n[s>>2]|0,B=s+4|0,m=l+4|0,d=(n[B>>2]|0)-f|0,c=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=c,(d|0)>0?(br(c|0,f|0,d|0)|0,f=m,c=n[m>>2]|0):f=m,m=n[s>>2]|0,n[s>>2]=c,n[f>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=s+8|0,B=l+12|0,s=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=s,n[l>>2]=n[f>>2]}function Fxe(s){s=s|0;var l=0,c=0,f=0;l=n[s+4>>2]|0,c=s+8|0,f=n[c>>2]|0,(f|0)!=(l|0)&&(n[c>>2]=f+(~(((f+-12-l|0)>>>0)/12|0)*12|0)),s=n[s>>2]|0,s|0&&yt(s)}function A5(s){s=s|0,Lxe(s)}function Rxe(s){s=s|0,Txe(s+24|0)}function Txe(s){s=s|0;var l=0,c=0,f=0;c=n[s>>2]|0,f=c,c|0&&(s=s+4|0,l=n[s>>2]|0,(l|0)!=(c|0)&&(n[s>>2]=l+(~(((l+-12-f|0)>>>0)/12|0)*12|0)),yt(c))}function Lxe(s){s=s|0;var l=0;l=zr()|0,Jr(s,2,7,l,Nxe()|0,0),n[s+24>>2]=0,n[s+28>>2]=0,n[s+32>>2]=0}function Nxe(){return 1276}function Oxe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0;return c=C,C=C+16|0,f=c+8|0,d=c,m=Mxe(s)|0,s=n[m+4>>2]|0,n[d>>2]=n[m>>2],n[d+4>>2]=s,n[f>>2]=n[d>>2],n[f+4>>2]=n[d+4>>2],l=Uxe(l,f)|0,C=c,l|0}function Mxe(s){return s=s|0,(n[(PR()|0)+24>>2]|0)+(s*12|0)|0}function Uxe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0;return d=C,C=C+16|0,f=d,c=n[l>>2]|0,l=n[l+4>>2]|0,s=s+(l>>1)|0,l&1&&(c=n[(n[s>>2]|0)+c>>2]|0),tf[c&31](f,s),f=f5(f)|0,C=d,f|0}function f5(s){s=s|0;var l=0,c=0,f=0,d=0;return d=C,C=C+32|0,l=d+12|0,c=d,f=cR(p5()|0)|0,f?(uR(l,f),AR(c,l),_xe(s,c),s=fR(l)|0):s=Hxe(s)|0,C=d,s|0}function p5(){var s=0;return o[7736]|0||(Xxe(9640),pr(25,9640,U|0)|0,s=7736,n[s>>2]=1,n[s+4>>2]=0),9640}function _xe(s,l){s=s|0,l=l|0,Wxe(l,s,s+8|0)|0}function Hxe(s){s=s|0;var l=0,c=0,f=0,d=0,m=0,B=0,k=0;return c=C,C=C+16|0,d=c+4|0,B=c,f=Za(8)|0,l=f,k=Yt(16)|0,n[k>>2]=n[s>>2],n[k+4>>2]=n[s+4>>2],n[k+8>>2]=n[s+8>>2],n[k+12>>2]=n[s+12>>2],m=l+4|0,n[m>>2]=k,s=Yt(8)|0,m=n[m>>2]|0,n[B>>2]=0,n[d>>2]=n[B>>2],SR(s,m,d),n[f>>2]=s,C=c,l|0}function SR(s,l,c){s=s|0,l=l|0,c=c|0,n[s>>2]=l,c=Yt(16)|0,n[c+4>>2]=0,n[c+8>>2]=0,n[c>>2]=1244,n[c+12>>2]=l,n[s+4>>2]=c}function qxe(s){s=s|0,im(s),yt(s)}function jxe(s){s=s|0,s=n[s+12>>2]|0,s|0&&yt(s)}function Gxe(s){s=s|0,yt(s)}function Wxe(s,l,c){return s=s|0,l=l|0,c=c|0,l=Yxe(n[s>>2]|0,l,c)|0,c=s+4|0,n[(n[c>>2]|0)+8>>2]=l,n[(n[c>>2]|0)+8>>2]|0}function Yxe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0;return f=C,C=C+16|0,d=f,$a(d),s=ys(s)|0,c=Kxe(s,n[l>>2]|0,+E[c>>3])|0,el(d),C=f,c|0}function Kxe(s,l,c){s=s|0,l=l|0,c=+c;var f=0;return f=jo(Vxe()|0)|0,l=Xd(l)|0,pc(0,f|0,s|0,l|0,+ +ma(c))|0}function Vxe(){var s=0;return o[7728]|0||(zxe(9628),s=7728,n[s>>2]=1,n[s+4>>2]=0),9628}function zxe(s){s=s|0,ao(s,Jxe()|0,2)}function Jxe(){return 1264}function Xxe(s){s=s|0,Sp(s)}function Zxe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0;f=C,C=C+16|0,d=f+8|0,m=f,k=n[c>>2]|0,B=n[c+4>>2]|0,c=mn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],$xe(s,c,d,1),C=f}function $xe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0,m=0,B=0,k=0,F=0,M=0,O=0;d=C,C=C+32|0,m=d+16|0,O=d+8|0,k=d,M=n[c>>2]|0,F=n[c+4>>2]|0,B=n[s>>2]|0,s=xR()|0,n[O>>2]=M,n[O+4>>2]=F,n[m>>2]=n[O>>2],n[m+4>>2]=n[O+4>>2],c=ebe(m)|0,n[k>>2]=M,n[k+4>>2]=F,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],yn(B,l,s,c,tbe(m,f)|0,f),C=d}function xR(){var s=0,l=0;if(o[7744]|0||(g5(9684),pr(37,9684,U|0)|0,l=7744,n[l>>2]=1,n[l+4>>2]=0),!(Nr(9684)|0)){s=9684,l=s+36|0;do n[s>>2]=0,s=s+4|0;while((s|0)<(l|0));g5(9684)}return 9684}function ebe(s){return s=s|0,0}function tbe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0,j=0;return O=C,C=C+32|0,d=O+24|0,B=O+16|0,k=O,F=O+8|0,m=n[s>>2]|0,f=n[s+4>>2]|0,n[k>>2]=m,n[k+4>>2]=f,j=xR()|0,M=j+24|0,s=dr(l,4)|0,n[F>>2]=s,l=j+28|0,c=n[l>>2]|0,c>>>0<(n[j+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=f,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],h5(c,d,s),s=(n[l>>2]|0)+12|0,n[l>>2]=s):(rbe(M,k,F),s=n[l>>2]|0),C=O,((s-(n[M>>2]|0)|0)/12|0)+-1|0}function h5(s,l,c){s=s|0,l=l|0,c=c|0;var f=0;f=n[l+4>>2]|0,n[s>>2]=n[l>>2],n[s+4>>2]=f,n[s+8>>2]=c}function rbe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0,j=0,oe=0;if(M=C,C=C+48|0,f=M+32|0,B=M+24|0,k=M,F=s+4|0,d=(((n[F>>2]|0)-(n[s>>2]|0)|0)/12|0)+1|0,m=nbe(s)|0,m>>>0>>0)Zr(s);else{O=n[s>>2]|0,oe=((n[s+8>>2]|0)-O|0)/12|0,j=oe<<1,ibe(k,oe>>>0>>1>>>0?j>>>0>>0?d:j:m,((n[F>>2]|0)-O|0)/12|0,s+8|0),F=k+8|0,m=n[F>>2]|0,d=n[l+4>>2]|0,c=n[c>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[f>>2]=n[B>>2],n[f+4>>2]=n[B+4>>2],h5(m,f,c),n[F>>2]=(n[F>>2]|0)+12,sbe(s,k),obe(k),C=M;return}}function nbe(s){return s=s|0,357913941}function ibe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0;n[s+12>>2]=0,n[s+16>>2]=f;do if(l)if(l>>>0>357913941)Tt();else{d=Yt(l*12|0)|0;break}else d=0;while(!1);n[s>>2]=d,f=d+(c*12|0)|0,n[s+8>>2]=f,n[s+4>>2]=f,n[s+12>>2]=d+(l*12|0)}function sbe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0;f=n[s>>2]|0,B=s+4|0,m=l+4|0,d=(n[B>>2]|0)-f|0,c=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=c,(d|0)>0?(br(c|0,f|0,d|0)|0,f=m,c=n[m>>2]|0):f=m,m=n[s>>2]|0,n[s>>2]=c,n[f>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=s+8|0,B=l+12|0,s=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=s,n[l>>2]=n[f>>2]}function obe(s){s=s|0;var l=0,c=0,f=0;l=n[s+4>>2]|0,c=s+8|0,f=n[c>>2]|0,(f|0)!=(l|0)&&(n[c>>2]=f+(~(((f+-12-l|0)>>>0)/12|0)*12|0)),s=n[s>>2]|0,s|0&&yt(s)}function g5(s){s=s|0,cbe(s)}function abe(s){s=s|0,lbe(s+24|0)}function lbe(s){s=s|0;var l=0,c=0,f=0;c=n[s>>2]|0,f=c,c|0&&(s=s+4|0,l=n[s>>2]|0,(l|0)!=(c|0)&&(n[s>>2]=l+(~(((l+-12-f|0)>>>0)/12|0)*12|0)),yt(c))}function cbe(s){s=s|0;var l=0;l=zr()|0,Jr(s,2,5,l,ube()|0,1),n[s+24>>2]=0,n[s+28>>2]=0,n[s+32>>2]=0}function ube(){return 1280}function Abe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0;return f=C,C=C+16|0,d=f+8|0,m=f,B=fbe(s)|0,s=n[B+4>>2]|0,n[m>>2]=n[B>>2],n[m+4>>2]=s,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],c=pbe(l,d,c)|0,C=f,c|0}function fbe(s){return s=s|0,(n[(xR()|0)+24>>2]|0)+(s*12|0)|0}function pbe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0;return B=C,C=C+32|0,d=B,m=B+16|0,f=n[l>>2]|0,l=n[l+4>>2]|0,s=s+(l>>1)|0,l&1&&(f=n[(n[s>>2]|0)+f>>2]|0),XA(m,c),m=ZA(m,c)|0,sw[f&15](d,s,m),m=f5(d)|0,C=B,m|0}function hbe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0;f=C,C=C+16|0,d=f+8|0,m=f,k=n[c>>2]|0,B=n[c+4>>2]|0,c=mn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],gbe(s,c,d,1),C=f}function gbe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0,m=0,B=0,k=0,F=0,M=0,O=0;d=C,C=C+32|0,m=d+16|0,O=d+8|0,k=d,M=n[c>>2]|0,F=n[c+4>>2]|0,B=n[s>>2]|0,s=bR()|0,n[O>>2]=M,n[O+4>>2]=F,n[m>>2]=n[O>>2],n[m+4>>2]=n[O+4>>2],c=dbe(m)|0,n[k>>2]=M,n[k+4>>2]=F,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],yn(B,l,s,c,mbe(m,f)|0,f),C=d}function bR(){var s=0,l=0;if(o[7752]|0||(m5(9720),pr(38,9720,U|0)|0,l=7752,n[l>>2]=1,n[l+4>>2]=0),!(Nr(9720)|0)){s=9720,l=s+36|0;do n[s>>2]=0,s=s+4|0;while((s|0)<(l|0));m5(9720)}return 9720}function dbe(s){return s=s|0,0}function mbe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0,j=0;return O=C,C=C+32|0,d=O+24|0,B=O+16|0,k=O,F=O+8|0,m=n[s>>2]|0,f=n[s+4>>2]|0,n[k>>2]=m,n[k+4>>2]=f,j=bR()|0,M=j+24|0,s=dr(l,4)|0,n[F>>2]=s,l=j+28|0,c=n[l>>2]|0,c>>>0<(n[j+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=f,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],d5(c,d,s),s=(n[l>>2]|0)+12|0,n[l>>2]=s):(ybe(M,k,F),s=n[l>>2]|0),C=O,((s-(n[M>>2]|0)|0)/12|0)+-1|0}function d5(s,l,c){s=s|0,l=l|0,c=c|0;var f=0;f=n[l+4>>2]|0,n[s>>2]=n[l>>2],n[s+4>>2]=f,n[s+8>>2]=c}function ybe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0,j=0,oe=0;if(M=C,C=C+48|0,f=M+32|0,B=M+24|0,k=M,F=s+4|0,d=(((n[F>>2]|0)-(n[s>>2]|0)|0)/12|0)+1|0,m=Ebe(s)|0,m>>>0>>0)Zr(s);else{O=n[s>>2]|0,oe=((n[s+8>>2]|0)-O|0)/12|0,j=oe<<1,Cbe(k,oe>>>0>>1>>>0?j>>>0>>0?d:j:m,((n[F>>2]|0)-O|0)/12|0,s+8|0),F=k+8|0,m=n[F>>2]|0,d=n[l+4>>2]|0,c=n[c>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[f>>2]=n[B>>2],n[f+4>>2]=n[B+4>>2],d5(m,f,c),n[F>>2]=(n[F>>2]|0)+12,Ibe(s,k),wbe(k),C=M;return}}function Ebe(s){return s=s|0,357913941}function Cbe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0;n[s+12>>2]=0,n[s+16>>2]=f;do if(l)if(l>>>0>357913941)Tt();else{d=Yt(l*12|0)|0;break}else d=0;while(!1);n[s>>2]=d,f=d+(c*12|0)|0,n[s+8>>2]=f,n[s+4>>2]=f,n[s+12>>2]=d+(l*12|0)}function Ibe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0;f=n[s>>2]|0,B=s+4|0,m=l+4|0,d=(n[B>>2]|0)-f|0,c=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=c,(d|0)>0?(br(c|0,f|0,d|0)|0,f=m,c=n[m>>2]|0):f=m,m=n[s>>2]|0,n[s>>2]=c,n[f>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=s+8|0,B=l+12|0,s=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=s,n[l>>2]=n[f>>2]}function wbe(s){s=s|0;var l=0,c=0,f=0;l=n[s+4>>2]|0,c=s+8|0,f=n[c>>2]|0,(f|0)!=(l|0)&&(n[c>>2]=f+(~(((f+-12-l|0)>>>0)/12|0)*12|0)),s=n[s>>2]|0,s|0&&yt(s)}function m5(s){s=s|0,Dbe(s)}function Bbe(s){s=s|0,vbe(s+24|0)}function vbe(s){s=s|0;var l=0,c=0,f=0;c=n[s>>2]|0,f=c,c|0&&(s=s+4|0,l=n[s>>2]|0,(l|0)!=(c|0)&&(n[s>>2]=l+(~(((l+-12-f|0)>>>0)/12|0)*12|0)),yt(c))}function Dbe(s){s=s|0;var l=0;l=zr()|0,Jr(s,2,8,l,Pbe()|0,0),n[s+24>>2]=0,n[s+28>>2]=0,n[s+32>>2]=0}function Pbe(){return 1288}function Sbe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0;return c=C,C=C+16|0,f=c+8|0,d=c,m=xbe(s)|0,s=n[m+4>>2]|0,n[d>>2]=n[m>>2],n[d+4>>2]=s,n[f>>2]=n[d>>2],n[f+4>>2]=n[d+4>>2],l=bbe(l,f)|0,C=c,l|0}function xbe(s){return s=s|0,(n[(bR()|0)+24>>2]|0)+(s*12|0)|0}function bbe(s,l){s=s|0,l=l|0;var c=0;return c=n[l>>2]|0,l=n[l+4>>2]|0,s=s+(l>>1)|0,l&1&&(c=n[(n[s>>2]|0)+c>>2]|0),k0(_0[c&31](s)|0)|0}function kbe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0;f=C,C=C+16|0,d=f+8|0,m=f,k=n[c>>2]|0,B=n[c+4>>2]|0,c=mn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],Qbe(s,c,d,0),C=f}function Qbe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0,m=0,B=0,k=0,F=0,M=0,O=0;d=C,C=C+32|0,m=d+16|0,O=d+8|0,k=d,M=n[c>>2]|0,F=n[c+4>>2]|0,B=n[s>>2]|0,s=kR()|0,n[O>>2]=M,n[O+4>>2]=F,n[m>>2]=n[O>>2],n[m+4>>2]=n[O+4>>2],c=Fbe(m)|0,n[k>>2]=M,n[k+4>>2]=F,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],yn(B,l,s,c,Rbe(m,f)|0,f),C=d}function kR(){var s=0,l=0;if(o[7760]|0||(E5(9756),pr(39,9756,U|0)|0,l=7760,n[l>>2]=1,n[l+4>>2]=0),!(Nr(9756)|0)){s=9756,l=s+36|0;do n[s>>2]=0,s=s+4|0;while((s|0)<(l|0));E5(9756)}return 9756}function Fbe(s){return s=s|0,0}function Rbe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0,j=0;return O=C,C=C+32|0,d=O+24|0,B=O+16|0,k=O,F=O+8|0,m=n[s>>2]|0,f=n[s+4>>2]|0,n[k>>2]=m,n[k+4>>2]=f,j=kR()|0,M=j+24|0,s=dr(l,4)|0,n[F>>2]=s,l=j+28|0,c=n[l>>2]|0,c>>>0<(n[j+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=f,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],y5(c,d,s),s=(n[l>>2]|0)+12|0,n[l>>2]=s):(Tbe(M,k,F),s=n[l>>2]|0),C=O,((s-(n[M>>2]|0)|0)/12|0)+-1|0}function y5(s,l,c){s=s|0,l=l|0,c=c|0;var f=0;f=n[l+4>>2]|0,n[s>>2]=n[l>>2],n[s+4>>2]=f,n[s+8>>2]=c}function Tbe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0,j=0,oe=0;if(M=C,C=C+48|0,f=M+32|0,B=M+24|0,k=M,F=s+4|0,d=(((n[F>>2]|0)-(n[s>>2]|0)|0)/12|0)+1|0,m=Lbe(s)|0,m>>>0>>0)Zr(s);else{O=n[s>>2]|0,oe=((n[s+8>>2]|0)-O|0)/12|0,j=oe<<1,Nbe(k,oe>>>0>>1>>>0?j>>>0>>0?d:j:m,((n[F>>2]|0)-O|0)/12|0,s+8|0),F=k+8|0,m=n[F>>2]|0,d=n[l+4>>2]|0,c=n[c>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[f>>2]=n[B>>2],n[f+4>>2]=n[B+4>>2],y5(m,f,c),n[F>>2]=(n[F>>2]|0)+12,Obe(s,k),Mbe(k),C=M;return}}function Lbe(s){return s=s|0,357913941}function Nbe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0;n[s+12>>2]=0,n[s+16>>2]=f;do if(l)if(l>>>0>357913941)Tt();else{d=Yt(l*12|0)|0;break}else d=0;while(!1);n[s>>2]=d,f=d+(c*12|0)|0,n[s+8>>2]=f,n[s+4>>2]=f,n[s+12>>2]=d+(l*12|0)}function Obe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0;f=n[s>>2]|0,B=s+4|0,m=l+4|0,d=(n[B>>2]|0)-f|0,c=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=c,(d|0)>0?(br(c|0,f|0,d|0)|0,f=m,c=n[m>>2]|0):f=m,m=n[s>>2]|0,n[s>>2]=c,n[f>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=s+8|0,B=l+12|0,s=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=s,n[l>>2]=n[f>>2]}function Mbe(s){s=s|0;var l=0,c=0,f=0;l=n[s+4>>2]|0,c=s+8|0,f=n[c>>2]|0,(f|0)!=(l|0)&&(n[c>>2]=f+(~(((f+-12-l|0)>>>0)/12|0)*12|0)),s=n[s>>2]|0,s|0&&yt(s)}function E5(s){s=s|0,Hbe(s)}function Ube(s){s=s|0,_be(s+24|0)}function _be(s){s=s|0;var l=0,c=0,f=0;c=n[s>>2]|0,f=c,c|0&&(s=s+4|0,l=n[s>>2]|0,(l|0)!=(c|0)&&(n[s>>2]=l+(~(((l+-12-f|0)>>>0)/12|0)*12|0)),yt(c))}function Hbe(s){s=s|0;var l=0;l=zr()|0,Jr(s,2,8,l,qbe()|0,1),n[s+24>>2]=0,n[s+28>>2]=0,n[s+32>>2]=0}function qbe(){return 1292}function jbe(s,l,c){s=s|0,l=l|0,c=+c;var f=0,d=0,m=0,B=0;f=C,C=C+16|0,d=f+8|0,m=f,B=Gbe(s)|0,s=n[B+4>>2]|0,n[m>>2]=n[B>>2],n[m+4>>2]=s,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],Wbe(l,d,c),C=f}function Gbe(s){return s=s|0,(n[(kR()|0)+24>>2]|0)+(s*12|0)|0}function Wbe(s,l,c){s=s|0,l=l|0,c=+c;var f=0,d=0,m=0;m=C,C=C+16|0,d=m,f=n[l>>2]|0,l=n[l+4>>2]|0,s=s+(l>>1)|0,l&1&&(f=n[(n[s>>2]|0)+f>>2]|0),Tu(d,c),c=+Lu(d,c),eW[f&31](s,c),C=m}function Ybe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0;f=C,C=C+16|0,d=f+8|0,m=f,k=n[c>>2]|0,B=n[c+4>>2]|0,c=mn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],Kbe(s,c,d,0),C=f}function Kbe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0,m=0,B=0,k=0,F=0,M=0,O=0;d=C,C=C+32|0,m=d+16|0,O=d+8|0,k=d,M=n[c>>2]|0,F=n[c+4>>2]|0,B=n[s>>2]|0,s=QR()|0,n[O>>2]=M,n[O+4>>2]=F,n[m>>2]=n[O>>2],n[m+4>>2]=n[O+4>>2],c=Vbe(m)|0,n[k>>2]=M,n[k+4>>2]=F,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],yn(B,l,s,c,zbe(m,f)|0,f),C=d}function QR(){var s=0,l=0;if(o[7768]|0||(I5(9792),pr(40,9792,U|0)|0,l=7768,n[l>>2]=1,n[l+4>>2]=0),!(Nr(9792)|0)){s=9792,l=s+36|0;do n[s>>2]=0,s=s+4|0;while((s|0)<(l|0));I5(9792)}return 9792}function Vbe(s){return s=s|0,0}function zbe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0,j=0;return O=C,C=C+32|0,d=O+24|0,B=O+16|0,k=O,F=O+8|0,m=n[s>>2]|0,f=n[s+4>>2]|0,n[k>>2]=m,n[k+4>>2]=f,j=QR()|0,M=j+24|0,s=dr(l,4)|0,n[F>>2]=s,l=j+28|0,c=n[l>>2]|0,c>>>0<(n[j+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=f,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],C5(c,d,s),s=(n[l>>2]|0)+12|0,n[l>>2]=s):(Jbe(M,k,F),s=n[l>>2]|0),C=O,((s-(n[M>>2]|0)|0)/12|0)+-1|0}function C5(s,l,c){s=s|0,l=l|0,c=c|0;var f=0;f=n[l+4>>2]|0,n[s>>2]=n[l>>2],n[s+4>>2]=f,n[s+8>>2]=c}function Jbe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0,j=0,oe=0;if(M=C,C=C+48|0,f=M+32|0,B=M+24|0,k=M,F=s+4|0,d=(((n[F>>2]|0)-(n[s>>2]|0)|0)/12|0)+1|0,m=Xbe(s)|0,m>>>0>>0)Zr(s);else{O=n[s>>2]|0,oe=((n[s+8>>2]|0)-O|0)/12|0,j=oe<<1,Zbe(k,oe>>>0>>1>>>0?j>>>0>>0?d:j:m,((n[F>>2]|0)-O|0)/12|0,s+8|0),F=k+8|0,m=n[F>>2]|0,d=n[l+4>>2]|0,c=n[c>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[f>>2]=n[B>>2],n[f+4>>2]=n[B+4>>2],C5(m,f,c),n[F>>2]=(n[F>>2]|0)+12,$be(s,k),eke(k),C=M;return}}function Xbe(s){return s=s|0,357913941}function Zbe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0;n[s+12>>2]=0,n[s+16>>2]=f;do if(l)if(l>>>0>357913941)Tt();else{d=Yt(l*12|0)|0;break}else d=0;while(!1);n[s>>2]=d,f=d+(c*12|0)|0,n[s+8>>2]=f,n[s+4>>2]=f,n[s+12>>2]=d+(l*12|0)}function $be(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0;f=n[s>>2]|0,B=s+4|0,m=l+4|0,d=(n[B>>2]|0)-f|0,c=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=c,(d|0)>0?(br(c|0,f|0,d|0)|0,f=m,c=n[m>>2]|0):f=m,m=n[s>>2]|0,n[s>>2]=c,n[f>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=s+8|0,B=l+12|0,s=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=s,n[l>>2]=n[f>>2]}function eke(s){s=s|0;var l=0,c=0,f=0;l=n[s+4>>2]|0,c=s+8|0,f=n[c>>2]|0,(f|0)!=(l|0)&&(n[c>>2]=f+(~(((f+-12-l|0)>>>0)/12|0)*12|0)),s=n[s>>2]|0,s|0&&yt(s)}function I5(s){s=s|0,nke(s)}function tke(s){s=s|0,rke(s+24|0)}function rke(s){s=s|0;var l=0,c=0,f=0;c=n[s>>2]|0,f=c,c|0&&(s=s+4|0,l=n[s>>2]|0,(l|0)!=(c|0)&&(n[s>>2]=l+(~(((l+-12-f|0)>>>0)/12|0)*12|0)),yt(c))}function nke(s){s=s|0;var l=0;l=zr()|0,Jr(s,2,1,l,ike()|0,2),n[s+24>>2]=0,n[s+28>>2]=0,n[s+32>>2]=0}function ike(){return 1300}function ske(s,l,c,f){s=s|0,l=l|0,c=c|0,f=+f;var d=0,m=0,B=0,k=0;d=C,C=C+16|0,m=d+8|0,B=d,k=oke(s)|0,s=n[k+4>>2]|0,n[B>>2]=n[k>>2],n[B+4>>2]=s,n[m>>2]=n[B>>2],n[m+4>>2]=n[B+4>>2],ake(l,m,c,f),C=d}function oke(s){return s=s|0,(n[(QR()|0)+24>>2]|0)+(s*12|0)|0}function ake(s,l,c,f){s=s|0,l=l|0,c=c|0,f=+f;var d=0,m=0,B=0,k=0;k=C,C=C+16|0,m=k+1|0,B=k,d=n[l>>2]|0,l=n[l+4>>2]|0,s=s+(l>>1)|0,l&1&&(d=n[(n[s>>2]|0)+d>>2]|0),XA(m,c),m=ZA(m,c)|0,Tu(B,f),f=+Lu(B,f),lW[d&15](s,m,f),C=k}function lke(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0;f=C,C=C+16|0,d=f+8|0,m=f,k=n[c>>2]|0,B=n[c+4>>2]|0,c=mn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],cke(s,c,d,0),C=f}function cke(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0,m=0,B=0,k=0,F=0,M=0,O=0;d=C,C=C+32|0,m=d+16|0,O=d+8|0,k=d,M=n[c>>2]|0,F=n[c+4>>2]|0,B=n[s>>2]|0,s=FR()|0,n[O>>2]=M,n[O+4>>2]=F,n[m>>2]=n[O>>2],n[m+4>>2]=n[O+4>>2],c=uke(m)|0,n[k>>2]=M,n[k+4>>2]=F,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],yn(B,l,s,c,Ake(m,f)|0,f),C=d}function FR(){var s=0,l=0;if(o[7776]|0||(B5(9828),pr(41,9828,U|0)|0,l=7776,n[l>>2]=1,n[l+4>>2]=0),!(Nr(9828)|0)){s=9828,l=s+36|0;do n[s>>2]=0,s=s+4|0;while((s|0)<(l|0));B5(9828)}return 9828}function uke(s){return s=s|0,0}function Ake(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0,j=0;return O=C,C=C+32|0,d=O+24|0,B=O+16|0,k=O,F=O+8|0,m=n[s>>2]|0,f=n[s+4>>2]|0,n[k>>2]=m,n[k+4>>2]=f,j=FR()|0,M=j+24|0,s=dr(l,4)|0,n[F>>2]=s,l=j+28|0,c=n[l>>2]|0,c>>>0<(n[j+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=f,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],w5(c,d,s),s=(n[l>>2]|0)+12|0,n[l>>2]=s):(fke(M,k,F),s=n[l>>2]|0),C=O,((s-(n[M>>2]|0)|0)/12|0)+-1|0}function w5(s,l,c){s=s|0,l=l|0,c=c|0;var f=0;f=n[l+4>>2]|0,n[s>>2]=n[l>>2],n[s+4>>2]=f,n[s+8>>2]=c}function fke(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0,j=0,oe=0;if(M=C,C=C+48|0,f=M+32|0,B=M+24|0,k=M,F=s+4|0,d=(((n[F>>2]|0)-(n[s>>2]|0)|0)/12|0)+1|0,m=pke(s)|0,m>>>0>>0)Zr(s);else{O=n[s>>2]|0,oe=((n[s+8>>2]|0)-O|0)/12|0,j=oe<<1,hke(k,oe>>>0>>1>>>0?j>>>0>>0?d:j:m,((n[F>>2]|0)-O|0)/12|0,s+8|0),F=k+8|0,m=n[F>>2]|0,d=n[l+4>>2]|0,c=n[c>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[f>>2]=n[B>>2],n[f+4>>2]=n[B+4>>2],w5(m,f,c),n[F>>2]=(n[F>>2]|0)+12,gke(s,k),dke(k),C=M;return}}function pke(s){return s=s|0,357913941}function hke(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0;n[s+12>>2]=0,n[s+16>>2]=f;do if(l)if(l>>>0>357913941)Tt();else{d=Yt(l*12|0)|0;break}else d=0;while(!1);n[s>>2]=d,f=d+(c*12|0)|0,n[s+8>>2]=f,n[s+4>>2]=f,n[s+12>>2]=d+(l*12|0)}function gke(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0;f=n[s>>2]|0,B=s+4|0,m=l+4|0,d=(n[B>>2]|0)-f|0,c=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=c,(d|0)>0?(br(c|0,f|0,d|0)|0,f=m,c=n[m>>2]|0):f=m,m=n[s>>2]|0,n[s>>2]=c,n[f>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=s+8|0,B=l+12|0,s=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=s,n[l>>2]=n[f>>2]}function dke(s){s=s|0;var l=0,c=0,f=0;l=n[s+4>>2]|0,c=s+8|0,f=n[c>>2]|0,(f|0)!=(l|0)&&(n[c>>2]=f+(~(((f+-12-l|0)>>>0)/12|0)*12|0)),s=n[s>>2]|0,s|0&&yt(s)}function B5(s){s=s|0,Eke(s)}function mke(s){s=s|0,yke(s+24|0)}function yke(s){s=s|0;var l=0,c=0,f=0;c=n[s>>2]|0,f=c,c|0&&(s=s+4|0,l=n[s>>2]|0,(l|0)!=(c|0)&&(n[s>>2]=l+(~(((l+-12-f|0)>>>0)/12|0)*12|0)),yt(c))}function Eke(s){s=s|0;var l=0;l=zr()|0,Jr(s,2,7,l,Cke()|0,1),n[s+24>>2]=0,n[s+28>>2]=0,n[s+32>>2]=0}function Cke(){return 1312}function Ike(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0;f=C,C=C+16|0,d=f+8|0,m=f,B=wke(s)|0,s=n[B+4>>2]|0,n[m>>2]=n[B>>2],n[m+4>>2]=s,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],Bke(l,d,c),C=f}function wke(s){return s=s|0,(n[(FR()|0)+24>>2]|0)+(s*12|0)|0}function Bke(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0;m=C,C=C+16|0,d=m,f=n[l>>2]|0,l=n[l+4>>2]|0,s=s+(l>>1)|0,l&1&&(f=n[(n[s>>2]|0)+f>>2]|0),XA(d,c),d=ZA(d,c)|0,tf[f&31](s,d),C=m}function vke(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0;f=C,C=C+16|0,d=f+8|0,m=f,k=n[c>>2]|0,B=n[c+4>>2]|0,c=mn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],Dke(s,c,d,0),C=f}function Dke(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0,m=0,B=0,k=0,F=0,M=0,O=0;d=C,C=C+32|0,m=d+16|0,O=d+8|0,k=d,M=n[c>>2]|0,F=n[c+4>>2]|0,B=n[s>>2]|0,s=RR()|0,n[O>>2]=M,n[O+4>>2]=F,n[m>>2]=n[O>>2],n[m+4>>2]=n[O+4>>2],c=Pke(m)|0,n[k>>2]=M,n[k+4>>2]=F,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],yn(B,l,s,c,Ske(m,f)|0,f),C=d}function RR(){var s=0,l=0;if(o[7784]|0||(D5(9864),pr(42,9864,U|0)|0,l=7784,n[l>>2]=1,n[l+4>>2]=0),!(Nr(9864)|0)){s=9864,l=s+36|0;do n[s>>2]=0,s=s+4|0;while((s|0)<(l|0));D5(9864)}return 9864}function Pke(s){return s=s|0,0}function Ske(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0,j=0;return O=C,C=C+32|0,d=O+24|0,B=O+16|0,k=O,F=O+8|0,m=n[s>>2]|0,f=n[s+4>>2]|0,n[k>>2]=m,n[k+4>>2]=f,j=RR()|0,M=j+24|0,s=dr(l,4)|0,n[F>>2]=s,l=j+28|0,c=n[l>>2]|0,c>>>0<(n[j+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=f,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],v5(c,d,s),s=(n[l>>2]|0)+12|0,n[l>>2]=s):(xke(M,k,F),s=n[l>>2]|0),C=O,((s-(n[M>>2]|0)|0)/12|0)+-1|0}function v5(s,l,c){s=s|0,l=l|0,c=c|0;var f=0;f=n[l+4>>2]|0,n[s>>2]=n[l>>2],n[s+4>>2]=f,n[s+8>>2]=c}function xke(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0,j=0,oe=0;if(M=C,C=C+48|0,f=M+32|0,B=M+24|0,k=M,F=s+4|0,d=(((n[F>>2]|0)-(n[s>>2]|0)|0)/12|0)+1|0,m=bke(s)|0,m>>>0>>0)Zr(s);else{O=n[s>>2]|0,oe=((n[s+8>>2]|0)-O|0)/12|0,j=oe<<1,kke(k,oe>>>0>>1>>>0?j>>>0>>0?d:j:m,((n[F>>2]|0)-O|0)/12|0,s+8|0),F=k+8|0,m=n[F>>2]|0,d=n[l+4>>2]|0,c=n[c>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[f>>2]=n[B>>2],n[f+4>>2]=n[B+4>>2],v5(m,f,c),n[F>>2]=(n[F>>2]|0)+12,Qke(s,k),Fke(k),C=M;return}}function bke(s){return s=s|0,357913941}function kke(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0;n[s+12>>2]=0,n[s+16>>2]=f;do if(l)if(l>>>0>357913941)Tt();else{d=Yt(l*12|0)|0;break}else d=0;while(!1);n[s>>2]=d,f=d+(c*12|0)|0,n[s+8>>2]=f,n[s+4>>2]=f,n[s+12>>2]=d+(l*12|0)}function Qke(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0;f=n[s>>2]|0,B=s+4|0,m=l+4|0,d=(n[B>>2]|0)-f|0,c=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=c,(d|0)>0?(br(c|0,f|0,d|0)|0,f=m,c=n[m>>2]|0):f=m,m=n[s>>2]|0,n[s>>2]=c,n[f>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=s+8|0,B=l+12|0,s=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=s,n[l>>2]=n[f>>2]}function Fke(s){s=s|0;var l=0,c=0,f=0;l=n[s+4>>2]|0,c=s+8|0,f=n[c>>2]|0,(f|0)!=(l|0)&&(n[c>>2]=f+(~(((f+-12-l|0)>>>0)/12|0)*12|0)),s=n[s>>2]|0,s|0&&yt(s)}function D5(s){s=s|0,Lke(s)}function Rke(s){s=s|0,Tke(s+24|0)}function Tke(s){s=s|0;var l=0,c=0,f=0;c=n[s>>2]|0,f=c,c|0&&(s=s+4|0,l=n[s>>2]|0,(l|0)!=(c|0)&&(n[s>>2]=l+(~(((l+-12-f|0)>>>0)/12|0)*12|0)),yt(c))}function Lke(s){s=s|0;var l=0;l=zr()|0,Jr(s,2,8,l,Nke()|0,1),n[s+24>>2]=0,n[s+28>>2]=0,n[s+32>>2]=0}function Nke(){return 1320}function Oke(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0;f=C,C=C+16|0,d=f+8|0,m=f,B=Mke(s)|0,s=n[B+4>>2]|0,n[m>>2]=n[B>>2],n[m+4>>2]=s,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],Uke(l,d,c),C=f}function Mke(s){return s=s|0,(n[(RR()|0)+24>>2]|0)+(s*12|0)|0}function Uke(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0;m=C,C=C+16|0,d=m,f=n[l>>2]|0,l=n[l+4>>2]|0,s=s+(l>>1)|0,l&1&&(f=n[(n[s>>2]|0)+f>>2]|0),_ke(d,c),d=Hke(d,c)|0,tf[f&31](s,d),C=m}function _ke(s,l){s=s|0,l=l|0}function Hke(s,l){return s=s|0,l=l|0,qke(l)|0}function qke(s){return s=s|0,s|0}function jke(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0;f=C,C=C+16|0,d=f+8|0,m=f,k=n[c>>2]|0,B=n[c+4>>2]|0,c=mn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],Gke(s,c,d,0),C=f}function Gke(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0,m=0,B=0,k=0,F=0,M=0,O=0;d=C,C=C+32|0,m=d+16|0,O=d+8|0,k=d,M=n[c>>2]|0,F=n[c+4>>2]|0,B=n[s>>2]|0,s=TR()|0,n[O>>2]=M,n[O+4>>2]=F,n[m>>2]=n[O>>2],n[m+4>>2]=n[O+4>>2],c=Wke(m)|0,n[k>>2]=M,n[k+4>>2]=F,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],yn(B,l,s,c,Yke(m,f)|0,f),C=d}function TR(){var s=0,l=0;if(o[7792]|0||(S5(9900),pr(43,9900,U|0)|0,l=7792,n[l>>2]=1,n[l+4>>2]=0),!(Nr(9900)|0)){s=9900,l=s+36|0;do n[s>>2]=0,s=s+4|0;while((s|0)<(l|0));S5(9900)}return 9900}function Wke(s){return s=s|0,0}function Yke(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0,j=0;return O=C,C=C+32|0,d=O+24|0,B=O+16|0,k=O,F=O+8|0,m=n[s>>2]|0,f=n[s+4>>2]|0,n[k>>2]=m,n[k+4>>2]=f,j=TR()|0,M=j+24|0,s=dr(l,4)|0,n[F>>2]=s,l=j+28|0,c=n[l>>2]|0,c>>>0<(n[j+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=f,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],P5(c,d,s),s=(n[l>>2]|0)+12|0,n[l>>2]=s):(Kke(M,k,F),s=n[l>>2]|0),C=O,((s-(n[M>>2]|0)|0)/12|0)+-1|0}function P5(s,l,c){s=s|0,l=l|0,c=c|0;var f=0;f=n[l+4>>2]|0,n[s>>2]=n[l>>2],n[s+4>>2]=f,n[s+8>>2]=c}function Kke(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0,j=0,oe=0;if(M=C,C=C+48|0,f=M+32|0,B=M+24|0,k=M,F=s+4|0,d=(((n[F>>2]|0)-(n[s>>2]|0)|0)/12|0)+1|0,m=Vke(s)|0,m>>>0>>0)Zr(s);else{O=n[s>>2]|0,oe=((n[s+8>>2]|0)-O|0)/12|0,j=oe<<1,zke(k,oe>>>0>>1>>>0?j>>>0>>0?d:j:m,((n[F>>2]|0)-O|0)/12|0,s+8|0),F=k+8|0,m=n[F>>2]|0,d=n[l+4>>2]|0,c=n[c>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[f>>2]=n[B>>2],n[f+4>>2]=n[B+4>>2],P5(m,f,c),n[F>>2]=(n[F>>2]|0)+12,Jke(s,k),Xke(k),C=M;return}}function Vke(s){return s=s|0,357913941}function zke(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0;n[s+12>>2]=0,n[s+16>>2]=f;do if(l)if(l>>>0>357913941)Tt();else{d=Yt(l*12|0)|0;break}else d=0;while(!1);n[s>>2]=d,f=d+(c*12|0)|0,n[s+8>>2]=f,n[s+4>>2]=f,n[s+12>>2]=d+(l*12|0)}function Jke(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0;f=n[s>>2]|0,B=s+4|0,m=l+4|0,d=(n[B>>2]|0)-f|0,c=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=c,(d|0)>0?(br(c|0,f|0,d|0)|0,f=m,c=n[m>>2]|0):f=m,m=n[s>>2]|0,n[s>>2]=c,n[f>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=s+8|0,B=l+12|0,s=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=s,n[l>>2]=n[f>>2]}function Xke(s){s=s|0;var l=0,c=0,f=0;l=n[s+4>>2]|0,c=s+8|0,f=n[c>>2]|0,(f|0)!=(l|0)&&(n[c>>2]=f+(~(((f+-12-l|0)>>>0)/12|0)*12|0)),s=n[s>>2]|0,s|0&&yt(s)}function S5(s){s=s|0,eQe(s)}function Zke(s){s=s|0,$ke(s+24|0)}function $ke(s){s=s|0;var l=0,c=0,f=0;c=n[s>>2]|0,f=c,c|0&&(s=s+4|0,l=n[s>>2]|0,(l|0)!=(c|0)&&(n[s>>2]=l+(~(((l+-12-f|0)>>>0)/12|0)*12|0)),yt(c))}function eQe(s){s=s|0;var l=0;l=zr()|0,Jr(s,2,22,l,tQe()|0,0),n[s+24>>2]=0,n[s+28>>2]=0,n[s+32>>2]=0}function tQe(){return 1344}function rQe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0;c=C,C=C+16|0,f=c+8|0,d=c,m=nQe(s)|0,s=n[m+4>>2]|0,n[d>>2]=n[m>>2],n[d+4>>2]=s,n[f>>2]=n[d>>2],n[f+4>>2]=n[d+4>>2],iQe(l,f),C=c}function nQe(s){return s=s|0,(n[(TR()|0)+24>>2]|0)+(s*12|0)|0}function iQe(s,l){s=s|0,l=l|0;var c=0;c=n[l>>2]|0,l=n[l+4>>2]|0,s=s+(l>>1)|0,l&1&&(c=n[(n[s>>2]|0)+c>>2]|0),ef[c&127](s)}function sQe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0,m=0;m=n[s>>2]|0,d=LR()|0,s=oQe(c)|0,yn(m,l,d,s,aQe(c,f)|0,f)}function LR(){var s=0,l=0;if(o[7800]|0||(b5(9936),pr(44,9936,U|0)|0,l=7800,n[l>>2]=1,n[l+4>>2]=0),!(Nr(9936)|0)){s=9936,l=s+36|0;do n[s>>2]=0,s=s+4|0;while((s|0)<(l|0));b5(9936)}return 9936}function oQe(s){return s=s|0,s|0}function aQe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0,k=0,F=0;return k=C,C=C+16|0,d=k,m=k+4|0,n[d>>2]=s,F=LR()|0,B=F+24|0,l=dr(l,4)|0,n[m>>2]=l,c=F+28|0,f=n[c>>2]|0,f>>>0<(n[F+32>>2]|0)>>>0?(x5(f,s,l),l=(n[c>>2]|0)+8|0,n[c>>2]=l):(lQe(B,d,m),l=n[c>>2]|0),C=k,(l-(n[B>>2]|0)>>3)+-1|0}function x5(s,l,c){s=s|0,l=l|0,c=c|0,n[s>>2]=l,n[s+4>>2]=c}function lQe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0;if(k=C,C=C+32|0,d=k,m=s+4|0,B=((n[m>>2]|0)-(n[s>>2]|0)>>3)+1|0,f=cQe(s)|0,f>>>0>>0)Zr(s);else{F=n[s>>2]|0,O=(n[s+8>>2]|0)-F|0,M=O>>2,uQe(d,O>>3>>>0>>1>>>0?M>>>0>>0?B:M:f,(n[m>>2]|0)-F>>3,s+8|0),B=d+8|0,x5(n[B>>2]|0,n[l>>2]|0,n[c>>2]|0),n[B>>2]=(n[B>>2]|0)+8,AQe(s,d),fQe(d),C=k;return}}function cQe(s){return s=s|0,536870911}function uQe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0;n[s+12>>2]=0,n[s+16>>2]=f;do if(l)if(l>>>0>536870911)Tt();else{d=Yt(l<<3)|0;break}else d=0;while(!1);n[s>>2]=d,f=d+(c<<3)|0,n[s+8>>2]=f,n[s+4>>2]=f,n[s+12>>2]=d+(l<<3)}function AQe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0;f=n[s>>2]|0,B=s+4|0,m=l+4|0,d=(n[B>>2]|0)-f|0,c=(n[m>>2]|0)+(0-(d>>3)<<3)|0,n[m>>2]=c,(d|0)>0?(br(c|0,f|0,d|0)|0,f=m,c=n[m>>2]|0):f=m,m=n[s>>2]|0,n[s>>2]=c,n[f>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=s+8|0,B=l+12|0,s=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=s,n[l>>2]=n[f>>2]}function fQe(s){s=s|0;var l=0,c=0,f=0;l=n[s+4>>2]|0,c=s+8|0,f=n[c>>2]|0,(f|0)!=(l|0)&&(n[c>>2]=f+(~((f+-8-l|0)>>>3)<<3)),s=n[s>>2]|0,s|0&&yt(s)}function b5(s){s=s|0,gQe(s)}function pQe(s){s=s|0,hQe(s+24|0)}function hQe(s){s=s|0;var l=0,c=0,f=0;c=n[s>>2]|0,f=c,c|0&&(s=s+4|0,l=n[s>>2]|0,(l|0)!=(c|0)&&(n[s>>2]=l+(~((l+-8-f|0)>>>3)<<3)),yt(c))}function gQe(s){s=s|0;var l=0;l=zr()|0,Jr(s,1,23,l,n5()|0,1),n[s+24>>2]=0,n[s+28>>2]=0,n[s+32>>2]=0}function dQe(s,l){s=s|0,l=l|0,yQe(n[(mQe(s)|0)>>2]|0,l)}function mQe(s){return s=s|0,(n[(LR()|0)+24>>2]|0)+(s<<3)|0}function yQe(s,l){s=s|0,l=l|0;var c=0,f=0;c=C,C=C+16|0,f=c,IR(f,l),l=wR(f,l)|0,ef[s&127](l),C=c}function EQe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0,m=0;m=n[s>>2]|0,d=NR()|0,s=CQe(c)|0,yn(m,l,d,s,IQe(c,f)|0,f)}function NR(){var s=0,l=0;if(o[7808]|0||(Q5(9972),pr(45,9972,U|0)|0,l=7808,n[l>>2]=1,n[l+4>>2]=0),!(Nr(9972)|0)){s=9972,l=s+36|0;do n[s>>2]=0,s=s+4|0;while((s|0)<(l|0));Q5(9972)}return 9972}function CQe(s){return s=s|0,s|0}function IQe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0,k=0,F=0;return k=C,C=C+16|0,d=k,m=k+4|0,n[d>>2]=s,F=NR()|0,B=F+24|0,l=dr(l,4)|0,n[m>>2]=l,c=F+28|0,f=n[c>>2]|0,f>>>0<(n[F+32>>2]|0)>>>0?(k5(f,s,l),l=(n[c>>2]|0)+8|0,n[c>>2]=l):(wQe(B,d,m),l=n[c>>2]|0),C=k,(l-(n[B>>2]|0)>>3)+-1|0}function k5(s,l,c){s=s|0,l=l|0,c=c|0,n[s>>2]=l,n[s+4>>2]=c}function wQe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0;if(k=C,C=C+32|0,d=k,m=s+4|0,B=((n[m>>2]|0)-(n[s>>2]|0)>>3)+1|0,f=BQe(s)|0,f>>>0>>0)Zr(s);else{F=n[s>>2]|0,O=(n[s+8>>2]|0)-F|0,M=O>>2,vQe(d,O>>3>>>0>>1>>>0?M>>>0>>0?B:M:f,(n[m>>2]|0)-F>>3,s+8|0),B=d+8|0,k5(n[B>>2]|0,n[l>>2]|0,n[c>>2]|0),n[B>>2]=(n[B>>2]|0)+8,DQe(s,d),PQe(d),C=k;return}}function BQe(s){return s=s|0,536870911}function vQe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0;n[s+12>>2]=0,n[s+16>>2]=f;do if(l)if(l>>>0>536870911)Tt();else{d=Yt(l<<3)|0;break}else d=0;while(!1);n[s>>2]=d,f=d+(c<<3)|0,n[s+8>>2]=f,n[s+4>>2]=f,n[s+12>>2]=d+(l<<3)}function DQe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0;f=n[s>>2]|0,B=s+4|0,m=l+4|0,d=(n[B>>2]|0)-f|0,c=(n[m>>2]|0)+(0-(d>>3)<<3)|0,n[m>>2]=c,(d|0)>0?(br(c|0,f|0,d|0)|0,f=m,c=n[m>>2]|0):f=m,m=n[s>>2]|0,n[s>>2]=c,n[f>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=s+8|0,B=l+12|0,s=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=s,n[l>>2]=n[f>>2]}function PQe(s){s=s|0;var l=0,c=0,f=0;l=n[s+4>>2]|0,c=s+8|0,f=n[c>>2]|0,(f|0)!=(l|0)&&(n[c>>2]=f+(~((f+-8-l|0)>>>3)<<3)),s=n[s>>2]|0,s|0&&yt(s)}function Q5(s){s=s|0,bQe(s)}function SQe(s){s=s|0,xQe(s+24|0)}function xQe(s){s=s|0;var l=0,c=0,f=0;c=n[s>>2]|0,f=c,c|0&&(s=s+4|0,l=n[s>>2]|0,(l|0)!=(c|0)&&(n[s>>2]=l+(~((l+-8-f|0)>>>3)<<3)),yt(c))}function bQe(s){s=s|0;var l=0;l=zr()|0,Jr(s,1,9,l,kQe()|0,1),n[s+24>>2]=0,n[s+28>>2]=0,n[s+32>>2]=0}function kQe(){return 1348}function QQe(s,l){return s=s|0,l=l|0,RQe(n[(FQe(s)|0)>>2]|0,l)|0}function FQe(s){return s=s|0,(n[(NR()|0)+24>>2]|0)+(s<<3)|0}function RQe(s,l){s=s|0,l=l|0;var c=0,f=0;return c=C,C=C+16|0,f=c,F5(f,l),l=R5(f,l)|0,l=FD(_0[s&31](l)|0)|0,C=c,l|0}function F5(s,l){s=s|0,l=l|0}function R5(s,l){return s=s|0,l=l|0,TQe(l)|0}function TQe(s){return s=s|0,s|0}function LQe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0,m=0;m=n[s>>2]|0,d=OR()|0,s=NQe(c)|0,yn(m,l,d,s,OQe(c,f)|0,f)}function OR(){var s=0,l=0;if(o[7816]|0||(L5(10008),pr(46,10008,U|0)|0,l=7816,n[l>>2]=1,n[l+4>>2]=0),!(Nr(10008)|0)){s=10008,l=s+36|0;do n[s>>2]=0,s=s+4|0;while((s|0)<(l|0));L5(10008)}return 10008}function NQe(s){return s=s|0,s|0}function OQe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0,k=0,F=0;return k=C,C=C+16|0,d=k,m=k+4|0,n[d>>2]=s,F=OR()|0,B=F+24|0,l=dr(l,4)|0,n[m>>2]=l,c=F+28|0,f=n[c>>2]|0,f>>>0<(n[F+32>>2]|0)>>>0?(T5(f,s,l),l=(n[c>>2]|0)+8|0,n[c>>2]=l):(MQe(B,d,m),l=n[c>>2]|0),C=k,(l-(n[B>>2]|0)>>3)+-1|0}function T5(s,l,c){s=s|0,l=l|0,c=c|0,n[s>>2]=l,n[s+4>>2]=c}function MQe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0;if(k=C,C=C+32|0,d=k,m=s+4|0,B=((n[m>>2]|0)-(n[s>>2]|0)>>3)+1|0,f=UQe(s)|0,f>>>0>>0)Zr(s);else{F=n[s>>2]|0,O=(n[s+8>>2]|0)-F|0,M=O>>2,_Qe(d,O>>3>>>0>>1>>>0?M>>>0>>0?B:M:f,(n[m>>2]|0)-F>>3,s+8|0),B=d+8|0,T5(n[B>>2]|0,n[l>>2]|0,n[c>>2]|0),n[B>>2]=(n[B>>2]|0)+8,HQe(s,d),qQe(d),C=k;return}}function UQe(s){return s=s|0,536870911}function _Qe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0;n[s+12>>2]=0,n[s+16>>2]=f;do if(l)if(l>>>0>536870911)Tt();else{d=Yt(l<<3)|0;break}else d=0;while(!1);n[s>>2]=d,f=d+(c<<3)|0,n[s+8>>2]=f,n[s+4>>2]=f,n[s+12>>2]=d+(l<<3)}function HQe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0;f=n[s>>2]|0,B=s+4|0,m=l+4|0,d=(n[B>>2]|0)-f|0,c=(n[m>>2]|0)+(0-(d>>3)<<3)|0,n[m>>2]=c,(d|0)>0?(br(c|0,f|0,d|0)|0,f=m,c=n[m>>2]|0):f=m,m=n[s>>2]|0,n[s>>2]=c,n[f>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=s+8|0,B=l+12|0,s=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=s,n[l>>2]=n[f>>2]}function qQe(s){s=s|0;var l=0,c=0,f=0;l=n[s+4>>2]|0,c=s+8|0,f=n[c>>2]|0,(f|0)!=(l|0)&&(n[c>>2]=f+(~((f+-8-l|0)>>>3)<<3)),s=n[s>>2]|0,s|0&&yt(s)}function L5(s){s=s|0,WQe(s)}function jQe(s){s=s|0,GQe(s+24|0)}function GQe(s){s=s|0;var l=0,c=0,f=0;c=n[s>>2]|0,f=c,c|0&&(s=s+4|0,l=n[s>>2]|0,(l|0)!=(c|0)&&(n[s>>2]=l+(~((l+-8-f|0)>>>3)<<3)),yt(c))}function WQe(s){s=s|0;var l=0;l=zr()|0,Jr(s,1,15,l,XG()|0,0),n[s+24>>2]=0,n[s+28>>2]=0,n[s+32>>2]=0}function YQe(s){return s=s|0,VQe(n[(KQe(s)|0)>>2]|0)|0}function KQe(s){return s=s|0,(n[(OR()|0)+24>>2]|0)+(s<<3)|0}function VQe(s){return s=s|0,FD(KD[s&7]()|0)|0}function zQe(){var s=0;return o[7832]|0||(nFe(10052),pr(25,10052,U|0)|0,s=7832,n[s>>2]=1,n[s+4>>2]=0),10052}function JQe(s,l){s=s|0,l=l|0,n[s>>2]=XQe()|0,n[s+4>>2]=ZQe()|0,n[s+12>>2]=l,n[s+8>>2]=$Qe()|0,n[s+32>>2]=2}function XQe(){return 11709}function ZQe(){return 1188}function $Qe(){return TD()|0}function eFe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0,(Qp(f,896)|0)==512?c|0&&(tFe(c),yt(c)):l|0&&(Hd(l),yt(l))}function Qp(s,l){return s=s|0,l=l|0,l&s|0}function tFe(s){s=s|0,s=n[s+4>>2]|0,s|0&&Rp(s)}function TD(){var s=0;return o[7824]|0||(n[2511]=rFe()|0,n[2512]=0,s=7824,n[s>>2]=1,n[s+4>>2]=0),10044}function rFe(){return 0}function nFe(s){s=s|0,Sp(s)}function iFe(s){s=s|0;var l=0,c=0,f=0,d=0,m=0;l=C,C=C+32|0,c=l+24|0,m=l+16|0,d=l+8|0,f=l,sFe(s,4827),oFe(s,4834,3)|0,aFe(s,3682,47)|0,n[m>>2]=9,n[m+4>>2]=0,n[c>>2]=n[m>>2],n[c+4>>2]=n[m+4>>2],lFe(s,4841,c)|0,n[d>>2]=1,n[d+4>>2]=0,n[c>>2]=n[d>>2],n[c+4>>2]=n[d+4>>2],cFe(s,4871,c)|0,n[f>>2]=10,n[f+4>>2]=0,n[c>>2]=n[f>>2],n[c+4>>2]=n[f+4>>2],uFe(s,4891,c)|0,C=l}function sFe(s,l){s=s|0,l=l|0;var c=0;c=qRe()|0,n[s>>2]=c,jRe(c,l),Fp(n[s>>2]|0)}function oFe(s,l,c){return s=s|0,l=l|0,c=c|0,PRe(s,mn(l)|0,c,0),s|0}function aFe(s,l,c){return s=s|0,l=l|0,c=c|0,ARe(s,mn(l)|0,c,0),s|0}function lFe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0;return f=C,C=C+16|0,d=f+8|0,m=f,B=n[c+4>>2]|0,n[m>>2]=n[c>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],YFe(s,l,d),C=f,s|0}function cFe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0;return f=C,C=C+16|0,d=f+8|0,m=f,B=n[c+4>>2]|0,n[m>>2]=n[c>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],SFe(s,l,d),C=f,s|0}function uFe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0;return f=C,C=C+16|0,d=f+8|0,m=f,B=n[c+4>>2]|0,n[m>>2]=n[c>>2],n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],AFe(s,l,d),C=f,s|0}function AFe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0;f=C,C=C+16|0,d=f+8|0,m=f,k=n[c>>2]|0,B=n[c+4>>2]|0,c=mn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],fFe(s,c,d,1),C=f}function fFe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0,m=0,B=0,k=0,F=0,M=0,O=0;d=C,C=C+32|0,m=d+16|0,O=d+8|0,k=d,M=n[c>>2]|0,F=n[c+4>>2]|0,B=n[s>>2]|0,s=MR()|0,n[O>>2]=M,n[O+4>>2]=F,n[m>>2]=n[O>>2],n[m+4>>2]=n[O+4>>2],c=pFe(m)|0,n[k>>2]=M,n[k+4>>2]=F,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],yn(B,l,s,c,hFe(m,f)|0,f),C=d}function MR(){var s=0,l=0;if(o[7840]|0||(O5(10100),pr(48,10100,U|0)|0,l=7840,n[l>>2]=1,n[l+4>>2]=0),!(Nr(10100)|0)){s=10100,l=s+36|0;do n[s>>2]=0,s=s+4|0;while((s|0)<(l|0));O5(10100)}return 10100}function pFe(s){return s=s|0,0}function hFe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0,j=0;return O=C,C=C+32|0,d=O+24|0,B=O+16|0,k=O,F=O+8|0,m=n[s>>2]|0,f=n[s+4>>2]|0,n[k>>2]=m,n[k+4>>2]=f,j=MR()|0,M=j+24|0,s=dr(l,4)|0,n[F>>2]=s,l=j+28|0,c=n[l>>2]|0,c>>>0<(n[j+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=f,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],N5(c,d,s),s=(n[l>>2]|0)+12|0,n[l>>2]=s):(gFe(M,k,F),s=n[l>>2]|0),C=O,((s-(n[M>>2]|0)|0)/12|0)+-1|0}function N5(s,l,c){s=s|0,l=l|0,c=c|0;var f=0;f=n[l+4>>2]|0,n[s>>2]=n[l>>2],n[s+4>>2]=f,n[s+8>>2]=c}function gFe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0,j=0,oe=0;if(M=C,C=C+48|0,f=M+32|0,B=M+24|0,k=M,F=s+4|0,d=(((n[F>>2]|0)-(n[s>>2]|0)|0)/12|0)+1|0,m=dFe(s)|0,m>>>0>>0)Zr(s);else{O=n[s>>2]|0,oe=((n[s+8>>2]|0)-O|0)/12|0,j=oe<<1,mFe(k,oe>>>0>>1>>>0?j>>>0>>0?d:j:m,((n[F>>2]|0)-O|0)/12|0,s+8|0),F=k+8|0,m=n[F>>2]|0,d=n[l+4>>2]|0,c=n[c>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[f>>2]=n[B>>2],n[f+4>>2]=n[B+4>>2],N5(m,f,c),n[F>>2]=(n[F>>2]|0)+12,yFe(s,k),EFe(k),C=M;return}}function dFe(s){return s=s|0,357913941}function mFe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0;n[s+12>>2]=0,n[s+16>>2]=f;do if(l)if(l>>>0>357913941)Tt();else{d=Yt(l*12|0)|0;break}else d=0;while(!1);n[s>>2]=d,f=d+(c*12|0)|0,n[s+8>>2]=f,n[s+4>>2]=f,n[s+12>>2]=d+(l*12|0)}function yFe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0;f=n[s>>2]|0,B=s+4|0,m=l+4|0,d=(n[B>>2]|0)-f|0,c=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=c,(d|0)>0?(br(c|0,f|0,d|0)|0,f=m,c=n[m>>2]|0):f=m,m=n[s>>2]|0,n[s>>2]=c,n[f>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=s+8|0,B=l+12|0,s=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=s,n[l>>2]=n[f>>2]}function EFe(s){s=s|0;var l=0,c=0,f=0;l=n[s+4>>2]|0,c=s+8|0,f=n[c>>2]|0,(f|0)!=(l|0)&&(n[c>>2]=f+(~(((f+-12-l|0)>>>0)/12|0)*12|0)),s=n[s>>2]|0,s|0&&yt(s)}function O5(s){s=s|0,wFe(s)}function CFe(s){s=s|0,IFe(s+24|0)}function IFe(s){s=s|0;var l=0,c=0,f=0;c=n[s>>2]|0,f=c,c|0&&(s=s+4|0,l=n[s>>2]|0,(l|0)!=(c|0)&&(n[s>>2]=l+(~(((l+-12-f|0)>>>0)/12|0)*12|0)),yt(c))}function wFe(s){s=s|0;var l=0;l=zr()|0,Jr(s,2,6,l,BFe()|0,1),n[s+24>>2]=0,n[s+28>>2]=0,n[s+32>>2]=0}function BFe(){return 1364}function vFe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0;return f=C,C=C+16|0,d=f+8|0,m=f,B=DFe(s)|0,s=n[B+4>>2]|0,n[m>>2]=n[B>>2],n[m+4>>2]=s,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],c=PFe(l,d,c)|0,C=f,c|0}function DFe(s){return s=s|0,(n[(MR()|0)+24>>2]|0)+(s*12|0)|0}function PFe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0;return m=C,C=C+16|0,d=m,f=n[l>>2]|0,l=n[l+4>>2]|0,s=s+(l>>1)|0,l&1&&(f=n[(n[s>>2]|0)+f>>2]|0),XA(d,c),d=ZA(d,c)|0,d=GG(pT[f&15](s,d)|0)|0,C=m,d|0}function SFe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0;f=C,C=C+16|0,d=f+8|0,m=f,k=n[c>>2]|0,B=n[c+4>>2]|0,c=mn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],xFe(s,c,d,0),C=f}function xFe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0,m=0,B=0,k=0,F=0,M=0,O=0;d=C,C=C+32|0,m=d+16|0,O=d+8|0,k=d,M=n[c>>2]|0,F=n[c+4>>2]|0,B=n[s>>2]|0,s=UR()|0,n[O>>2]=M,n[O+4>>2]=F,n[m>>2]=n[O>>2],n[m+4>>2]=n[O+4>>2],c=bFe(m)|0,n[k>>2]=M,n[k+4>>2]=F,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],yn(B,l,s,c,kFe(m,f)|0,f),C=d}function UR(){var s=0,l=0;if(o[7848]|0||(U5(10136),pr(49,10136,U|0)|0,l=7848,n[l>>2]=1,n[l+4>>2]=0),!(Nr(10136)|0)){s=10136,l=s+36|0;do n[s>>2]=0,s=s+4|0;while((s|0)<(l|0));U5(10136)}return 10136}function bFe(s){return s=s|0,0}function kFe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0,j=0;return O=C,C=C+32|0,d=O+24|0,B=O+16|0,k=O,F=O+8|0,m=n[s>>2]|0,f=n[s+4>>2]|0,n[k>>2]=m,n[k+4>>2]=f,j=UR()|0,M=j+24|0,s=dr(l,4)|0,n[F>>2]=s,l=j+28|0,c=n[l>>2]|0,c>>>0<(n[j+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=f,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],M5(c,d,s),s=(n[l>>2]|0)+12|0,n[l>>2]=s):(QFe(M,k,F),s=n[l>>2]|0),C=O,((s-(n[M>>2]|0)|0)/12|0)+-1|0}function M5(s,l,c){s=s|0,l=l|0,c=c|0;var f=0;f=n[l+4>>2]|0,n[s>>2]=n[l>>2],n[s+4>>2]=f,n[s+8>>2]=c}function QFe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0,j=0,oe=0;if(M=C,C=C+48|0,f=M+32|0,B=M+24|0,k=M,F=s+4|0,d=(((n[F>>2]|0)-(n[s>>2]|0)|0)/12|0)+1|0,m=FFe(s)|0,m>>>0>>0)Zr(s);else{O=n[s>>2]|0,oe=((n[s+8>>2]|0)-O|0)/12|0,j=oe<<1,RFe(k,oe>>>0>>1>>>0?j>>>0>>0?d:j:m,((n[F>>2]|0)-O|0)/12|0,s+8|0),F=k+8|0,m=n[F>>2]|0,d=n[l+4>>2]|0,c=n[c>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[f>>2]=n[B>>2],n[f+4>>2]=n[B+4>>2],M5(m,f,c),n[F>>2]=(n[F>>2]|0)+12,TFe(s,k),LFe(k),C=M;return}}function FFe(s){return s=s|0,357913941}function RFe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0;n[s+12>>2]=0,n[s+16>>2]=f;do if(l)if(l>>>0>357913941)Tt();else{d=Yt(l*12|0)|0;break}else d=0;while(!1);n[s>>2]=d,f=d+(c*12|0)|0,n[s+8>>2]=f,n[s+4>>2]=f,n[s+12>>2]=d+(l*12|0)}function TFe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0;f=n[s>>2]|0,B=s+4|0,m=l+4|0,d=(n[B>>2]|0)-f|0,c=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=c,(d|0)>0?(br(c|0,f|0,d|0)|0,f=m,c=n[m>>2]|0):f=m,m=n[s>>2]|0,n[s>>2]=c,n[f>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=s+8|0,B=l+12|0,s=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=s,n[l>>2]=n[f>>2]}function LFe(s){s=s|0;var l=0,c=0,f=0;l=n[s+4>>2]|0,c=s+8|0,f=n[c>>2]|0,(f|0)!=(l|0)&&(n[c>>2]=f+(~(((f+-12-l|0)>>>0)/12|0)*12|0)),s=n[s>>2]|0,s|0&&yt(s)}function U5(s){s=s|0,MFe(s)}function NFe(s){s=s|0,OFe(s+24|0)}function OFe(s){s=s|0;var l=0,c=0,f=0;c=n[s>>2]|0,f=c,c|0&&(s=s+4|0,l=n[s>>2]|0,(l|0)!=(c|0)&&(n[s>>2]=l+(~(((l+-12-f|0)>>>0)/12|0)*12|0)),yt(c))}function MFe(s){s=s|0;var l=0;l=zr()|0,Jr(s,2,9,l,UFe()|0,1),n[s+24>>2]=0,n[s+28>>2]=0,n[s+32>>2]=0}function UFe(){return 1372}function _Fe(s,l,c){s=s|0,l=l|0,c=+c;var f=0,d=0,m=0,B=0;f=C,C=C+16|0,d=f+8|0,m=f,B=HFe(s)|0,s=n[B+4>>2]|0,n[m>>2]=n[B>>2],n[m+4>>2]=s,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],qFe(l,d,c),C=f}function HFe(s){return s=s|0,(n[(UR()|0)+24>>2]|0)+(s*12|0)|0}function qFe(s,l,c){s=s|0,l=l|0,c=+c;var f=0,d=0,m=0,B=Ze;m=C,C=C+16|0,d=m,f=n[l>>2]|0,l=n[l+4>>2]|0,s=s+(l>>1)|0,l&1&&(f=n[(n[s>>2]|0)+f>>2]|0),jFe(d,c),B=y(GFe(d,c)),$7[f&1](s,B),C=m}function jFe(s,l){s=s|0,l=+l}function GFe(s,l){return s=s|0,l=+l,y(WFe(l))}function WFe(s){return s=+s,y(s)}function YFe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0;f=C,C=C+16|0,d=f+8|0,m=f,k=n[c>>2]|0,B=n[c+4>>2]|0,c=mn(l)|0,n[m>>2]=k,n[m+4>>2]=B,n[d>>2]=n[m>>2],n[d+4>>2]=n[m+4>>2],KFe(s,c,d,0),C=f}function KFe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0,m=0,B=0,k=0,F=0,M=0,O=0;d=C,C=C+32|0,m=d+16|0,O=d+8|0,k=d,M=n[c>>2]|0,F=n[c+4>>2]|0,B=n[s>>2]|0,s=_R()|0,n[O>>2]=M,n[O+4>>2]=F,n[m>>2]=n[O>>2],n[m+4>>2]=n[O+4>>2],c=VFe(m)|0,n[k>>2]=M,n[k+4>>2]=F,n[m>>2]=n[k>>2],n[m+4>>2]=n[k+4>>2],yn(B,l,s,c,zFe(m,f)|0,f),C=d}function _R(){var s=0,l=0;if(o[7856]|0||(H5(10172),pr(50,10172,U|0)|0,l=7856,n[l>>2]=1,n[l+4>>2]=0),!(Nr(10172)|0)){s=10172,l=s+36|0;do n[s>>2]=0,s=s+4|0;while((s|0)<(l|0));H5(10172)}return 10172}function VFe(s){return s=s|0,0}function zFe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0,j=0;return O=C,C=C+32|0,d=O+24|0,B=O+16|0,k=O,F=O+8|0,m=n[s>>2]|0,f=n[s+4>>2]|0,n[k>>2]=m,n[k+4>>2]=f,j=_R()|0,M=j+24|0,s=dr(l,4)|0,n[F>>2]=s,l=j+28|0,c=n[l>>2]|0,c>>>0<(n[j+32>>2]|0)>>>0?(n[B>>2]=m,n[B+4>>2]=f,n[d>>2]=n[B>>2],n[d+4>>2]=n[B+4>>2],_5(c,d,s),s=(n[l>>2]|0)+12|0,n[l>>2]=s):(JFe(M,k,F),s=n[l>>2]|0),C=O,((s-(n[M>>2]|0)|0)/12|0)+-1|0}function _5(s,l,c){s=s|0,l=l|0,c=c|0;var f=0;f=n[l+4>>2]|0,n[s>>2]=n[l>>2],n[s+4>>2]=f,n[s+8>>2]=c}function JFe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0,j=0,oe=0;if(M=C,C=C+48|0,f=M+32|0,B=M+24|0,k=M,F=s+4|0,d=(((n[F>>2]|0)-(n[s>>2]|0)|0)/12|0)+1|0,m=XFe(s)|0,m>>>0>>0)Zr(s);else{O=n[s>>2]|0,oe=((n[s+8>>2]|0)-O|0)/12|0,j=oe<<1,ZFe(k,oe>>>0>>1>>>0?j>>>0>>0?d:j:m,((n[F>>2]|0)-O|0)/12|0,s+8|0),F=k+8|0,m=n[F>>2]|0,d=n[l+4>>2]|0,c=n[c>>2]|0,n[B>>2]=n[l>>2],n[B+4>>2]=d,n[f>>2]=n[B>>2],n[f+4>>2]=n[B+4>>2],_5(m,f,c),n[F>>2]=(n[F>>2]|0)+12,$Fe(s,k),eRe(k),C=M;return}}function XFe(s){return s=s|0,357913941}function ZFe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0;n[s+12>>2]=0,n[s+16>>2]=f;do if(l)if(l>>>0>357913941)Tt();else{d=Yt(l*12|0)|0;break}else d=0;while(!1);n[s>>2]=d,f=d+(c*12|0)|0,n[s+8>>2]=f,n[s+4>>2]=f,n[s+12>>2]=d+(l*12|0)}function $Fe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0;f=n[s>>2]|0,B=s+4|0,m=l+4|0,d=(n[B>>2]|0)-f|0,c=(n[m>>2]|0)+(((d|0)/-12|0)*12|0)|0,n[m>>2]=c,(d|0)>0?(br(c|0,f|0,d|0)|0,f=m,c=n[m>>2]|0):f=m,m=n[s>>2]|0,n[s>>2]=c,n[f>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=s+8|0,B=l+12|0,s=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=s,n[l>>2]=n[f>>2]}function eRe(s){s=s|0;var l=0,c=0,f=0;l=n[s+4>>2]|0,c=s+8|0,f=n[c>>2]|0,(f|0)!=(l|0)&&(n[c>>2]=f+(~(((f+-12-l|0)>>>0)/12|0)*12|0)),s=n[s>>2]|0,s|0&&yt(s)}function H5(s){s=s|0,nRe(s)}function tRe(s){s=s|0,rRe(s+24|0)}function rRe(s){s=s|0;var l=0,c=0,f=0;c=n[s>>2]|0,f=c,c|0&&(s=s+4|0,l=n[s>>2]|0,(l|0)!=(c|0)&&(n[s>>2]=l+(~(((l+-12-f|0)>>>0)/12|0)*12|0)),yt(c))}function nRe(s){s=s|0;var l=0;l=zr()|0,Jr(s,2,3,l,iRe()|0,2),n[s+24>>2]=0,n[s+28>>2]=0,n[s+32>>2]=0}function iRe(){return 1380}function sRe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0,m=0,B=0,k=0;d=C,C=C+16|0,m=d+8|0,B=d,k=oRe(s)|0,s=n[k+4>>2]|0,n[B>>2]=n[k>>2],n[B+4>>2]=s,n[m>>2]=n[B>>2],n[m+4>>2]=n[B+4>>2],aRe(l,m,c,f),C=d}function oRe(s){return s=s|0,(n[(_R()|0)+24>>2]|0)+(s*12|0)|0}function aRe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0,m=0,B=0,k=0;k=C,C=C+16|0,m=k+1|0,B=k,d=n[l>>2]|0,l=n[l+4>>2]|0,s=s+(l>>1)|0,l&1&&(d=n[(n[s>>2]|0)+d>>2]|0),XA(m,c),m=ZA(m,c)|0,lRe(B,f),B=cRe(B,f)|0,sw[d&15](s,m,B),C=k}function lRe(s,l){s=s|0,l=l|0}function cRe(s,l){return s=s|0,l=l|0,uRe(l)|0}function uRe(s){return s=s|0,(s|0)!=0|0}function ARe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0,m=0;m=n[s>>2]|0,d=HR()|0,s=fRe(c)|0,yn(m,l,d,s,pRe(c,f)|0,f)}function HR(){var s=0,l=0;if(o[7864]|0||(j5(10208),pr(51,10208,U|0)|0,l=7864,n[l>>2]=1,n[l+4>>2]=0),!(Nr(10208)|0)){s=10208,l=s+36|0;do n[s>>2]=0,s=s+4|0;while((s|0)<(l|0));j5(10208)}return 10208}function fRe(s){return s=s|0,s|0}function pRe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0,k=0,F=0;return k=C,C=C+16|0,d=k,m=k+4|0,n[d>>2]=s,F=HR()|0,B=F+24|0,l=dr(l,4)|0,n[m>>2]=l,c=F+28|0,f=n[c>>2]|0,f>>>0<(n[F+32>>2]|0)>>>0?(q5(f,s,l),l=(n[c>>2]|0)+8|0,n[c>>2]=l):(hRe(B,d,m),l=n[c>>2]|0),C=k,(l-(n[B>>2]|0)>>3)+-1|0}function q5(s,l,c){s=s|0,l=l|0,c=c|0,n[s>>2]=l,n[s+4>>2]=c}function hRe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0;if(k=C,C=C+32|0,d=k,m=s+4|0,B=((n[m>>2]|0)-(n[s>>2]|0)>>3)+1|0,f=gRe(s)|0,f>>>0>>0)Zr(s);else{F=n[s>>2]|0,O=(n[s+8>>2]|0)-F|0,M=O>>2,dRe(d,O>>3>>>0>>1>>>0?M>>>0>>0?B:M:f,(n[m>>2]|0)-F>>3,s+8|0),B=d+8|0,q5(n[B>>2]|0,n[l>>2]|0,n[c>>2]|0),n[B>>2]=(n[B>>2]|0)+8,mRe(s,d),yRe(d),C=k;return}}function gRe(s){return s=s|0,536870911}function dRe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0;n[s+12>>2]=0,n[s+16>>2]=f;do if(l)if(l>>>0>536870911)Tt();else{d=Yt(l<<3)|0;break}else d=0;while(!1);n[s>>2]=d,f=d+(c<<3)|0,n[s+8>>2]=f,n[s+4>>2]=f,n[s+12>>2]=d+(l<<3)}function mRe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0;f=n[s>>2]|0,B=s+4|0,m=l+4|0,d=(n[B>>2]|0)-f|0,c=(n[m>>2]|0)+(0-(d>>3)<<3)|0,n[m>>2]=c,(d|0)>0?(br(c|0,f|0,d|0)|0,f=m,c=n[m>>2]|0):f=m,m=n[s>>2]|0,n[s>>2]=c,n[f>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=s+8|0,B=l+12|0,s=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=s,n[l>>2]=n[f>>2]}function yRe(s){s=s|0;var l=0,c=0,f=0;l=n[s+4>>2]|0,c=s+8|0,f=n[c>>2]|0,(f|0)!=(l|0)&&(n[c>>2]=f+(~((f+-8-l|0)>>>3)<<3)),s=n[s>>2]|0,s|0&&yt(s)}function j5(s){s=s|0,IRe(s)}function ERe(s){s=s|0,CRe(s+24|0)}function CRe(s){s=s|0;var l=0,c=0,f=0;c=n[s>>2]|0,f=c,c|0&&(s=s+4|0,l=n[s>>2]|0,(l|0)!=(c|0)&&(n[s>>2]=l+(~((l+-8-f|0)>>>3)<<3)),yt(c))}function IRe(s){s=s|0;var l=0;l=zr()|0,Jr(s,1,24,l,wRe()|0,1),n[s+24>>2]=0,n[s+28>>2]=0,n[s+32>>2]=0}function wRe(){return 1392}function BRe(s,l){s=s|0,l=l|0,DRe(n[(vRe(s)|0)>>2]|0,l)}function vRe(s){return s=s|0,(n[(HR()|0)+24>>2]|0)+(s<<3)|0}function DRe(s,l){s=s|0,l=l|0;var c=0,f=0;c=C,C=C+16|0,f=c,F5(f,l),l=R5(f,l)|0,ef[s&127](l),C=c}function PRe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0,m=0;m=n[s>>2]|0,d=qR()|0,s=SRe(c)|0,yn(m,l,d,s,xRe(c,f)|0,f)}function qR(){var s=0,l=0;if(o[7872]|0||(W5(10244),pr(52,10244,U|0)|0,l=7872,n[l>>2]=1,n[l+4>>2]=0),!(Nr(10244)|0)){s=10244,l=s+36|0;do n[s>>2]=0,s=s+4|0;while((s|0)<(l|0));W5(10244)}return 10244}function SRe(s){return s=s|0,s|0}function xRe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0,k=0,F=0;return k=C,C=C+16|0,d=k,m=k+4|0,n[d>>2]=s,F=qR()|0,B=F+24|0,l=dr(l,4)|0,n[m>>2]=l,c=F+28|0,f=n[c>>2]|0,f>>>0<(n[F+32>>2]|0)>>>0?(G5(f,s,l),l=(n[c>>2]|0)+8|0,n[c>>2]=l):(bRe(B,d,m),l=n[c>>2]|0),C=k,(l-(n[B>>2]|0)>>3)+-1|0}function G5(s,l,c){s=s|0,l=l|0,c=c|0,n[s>>2]=l,n[s+4>>2]=c}function bRe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0;if(k=C,C=C+32|0,d=k,m=s+4|0,B=((n[m>>2]|0)-(n[s>>2]|0)>>3)+1|0,f=kRe(s)|0,f>>>0>>0)Zr(s);else{F=n[s>>2]|0,O=(n[s+8>>2]|0)-F|0,M=O>>2,QRe(d,O>>3>>>0>>1>>>0?M>>>0>>0?B:M:f,(n[m>>2]|0)-F>>3,s+8|0),B=d+8|0,G5(n[B>>2]|0,n[l>>2]|0,n[c>>2]|0),n[B>>2]=(n[B>>2]|0)+8,FRe(s,d),RRe(d),C=k;return}}function kRe(s){return s=s|0,536870911}function QRe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0;n[s+12>>2]=0,n[s+16>>2]=f;do if(l)if(l>>>0>536870911)Tt();else{d=Yt(l<<3)|0;break}else d=0;while(!1);n[s>>2]=d,f=d+(c<<3)|0,n[s+8>>2]=f,n[s+4>>2]=f,n[s+12>>2]=d+(l<<3)}function FRe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0;f=n[s>>2]|0,B=s+4|0,m=l+4|0,d=(n[B>>2]|0)-f|0,c=(n[m>>2]|0)+(0-(d>>3)<<3)|0,n[m>>2]=c,(d|0)>0?(br(c|0,f|0,d|0)|0,f=m,c=n[m>>2]|0):f=m,m=n[s>>2]|0,n[s>>2]=c,n[f>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=s+8|0,B=l+12|0,s=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=s,n[l>>2]=n[f>>2]}function RRe(s){s=s|0;var l=0,c=0,f=0;l=n[s+4>>2]|0,c=s+8|0,f=n[c>>2]|0,(f|0)!=(l|0)&&(n[c>>2]=f+(~((f+-8-l|0)>>>3)<<3)),s=n[s>>2]|0,s|0&&yt(s)}function W5(s){s=s|0,NRe(s)}function TRe(s){s=s|0,LRe(s+24|0)}function LRe(s){s=s|0;var l=0,c=0,f=0;c=n[s>>2]|0,f=c,c|0&&(s=s+4|0,l=n[s>>2]|0,(l|0)!=(c|0)&&(n[s>>2]=l+(~((l+-8-f|0)>>>3)<<3)),yt(c))}function NRe(s){s=s|0;var l=0;l=zr()|0,Jr(s,1,16,l,ORe()|0,0),n[s+24>>2]=0,n[s+28>>2]=0,n[s+32>>2]=0}function ORe(){return 1400}function MRe(s){return s=s|0,_Re(n[(URe(s)|0)>>2]|0)|0}function URe(s){return s=s|0,(n[(qR()|0)+24>>2]|0)+(s<<3)|0}function _Re(s){return s=s|0,HRe(KD[s&7]()|0)|0}function HRe(s){return s=s|0,s|0}function qRe(){var s=0;return o[7880]|0||(zRe(10280),pr(25,10280,U|0)|0,s=7880,n[s>>2]=1,n[s+4>>2]=0),10280}function jRe(s,l){s=s|0,l=l|0,n[s>>2]=GRe()|0,n[s+4>>2]=WRe()|0,n[s+12>>2]=l,n[s+8>>2]=YRe()|0,n[s+32>>2]=4}function GRe(){return 11711}function WRe(){return 1356}function YRe(){return TD()|0}function KRe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0,(Qp(f,896)|0)==512?c|0&&(VRe(c),yt(c)):l|0&&(C0(l),yt(l))}function VRe(s){s=s|0,s=n[s+4>>2]|0,s|0&&Rp(s)}function zRe(s){s=s|0,Sp(s)}function JRe(s){s=s|0,XRe(s,4920),ZRe(s)|0,$Re(s)|0}function XRe(s,l){s=s|0,l=l|0;var c=0;c=p5()|0,n[s>>2]=c,CTe(c,l),Fp(n[s>>2]|0)}function ZRe(s){s=s|0;var l=0;return l=n[s>>2]|0,T0(l,uTe()|0),s|0}function $Re(s){s=s|0;var l=0;return l=n[s>>2]|0,T0(l,eTe()|0),s|0}function eTe(){var s=0;return o[7888]|0||(Y5(10328),pr(53,10328,U|0)|0,s=7888,n[s>>2]=1,n[s+4>>2]=0),Nr(10328)|0||Y5(10328),10328}function T0(s,l){s=s|0,l=l|0,yn(s,0,l,0,0,0)}function Y5(s){s=s|0,nTe(s),L0(s,10)}function tTe(s){s=s|0,rTe(s+24|0)}function rTe(s){s=s|0;var l=0,c=0,f=0;c=n[s>>2]|0,f=c,c|0&&(s=s+4|0,l=n[s>>2]|0,(l|0)!=(c|0)&&(n[s>>2]=l+(~((l+-8-f|0)>>>3)<<3)),yt(c))}function nTe(s){s=s|0;var l=0;l=zr()|0,Jr(s,5,1,l,aTe()|0,2),n[s+24>>2]=0,n[s+28>>2]=0,n[s+32>>2]=0}function iTe(s,l,c){s=s|0,l=l|0,c=+c,sTe(s,l,c)}function L0(s,l){s=s|0,l=l|0,n[s+20>>2]=l}function sTe(s,l,c){s=s|0,l=l|0,c=+c;var f=0,d=0,m=0,B=0,k=0;f=C,C=C+16|0,m=f+8|0,k=f+13|0,d=f,B=f+12|0,XA(k,l),n[m>>2]=ZA(k,l)|0,Tu(B,c),E[d>>3]=+Lu(B,c),oTe(s,m,d),C=f}function oTe(s,l,c){s=s|0,l=l|0,c=c|0,Xa(s+8|0,n[l>>2]|0,+E[c>>3]),o[s+24>>0]=1}function aTe(){return 1404}function lTe(s,l){return s=s|0,l=+l,cTe(s,l)|0}function cTe(s,l){s=s|0,l=+l;var c=0,f=0,d=0,m=0,B=0,k=0,F=0;return f=C,C=C+16|0,m=f+4|0,B=f+8|0,k=f,d=Za(8)|0,c=d,F=Yt(16)|0,XA(m,s),s=ZA(m,s)|0,Tu(B,l),Xa(F,s,+Lu(B,l)),B=c+4|0,n[B>>2]=F,s=Yt(8)|0,B=n[B>>2]|0,n[k>>2]=0,n[m>>2]=n[k>>2],SR(s,B,m),n[d>>2]=s,C=f,c|0}function uTe(){var s=0;return o[7896]|0||(K5(10364),pr(54,10364,U|0)|0,s=7896,n[s>>2]=1,n[s+4>>2]=0),Nr(10364)|0||K5(10364),10364}function K5(s){s=s|0,pTe(s),L0(s,55)}function ATe(s){s=s|0,fTe(s+24|0)}function fTe(s){s=s|0;var l=0,c=0,f=0;c=n[s>>2]|0,f=c,c|0&&(s=s+4|0,l=n[s>>2]|0,(l|0)!=(c|0)&&(n[s>>2]=l+(~((l+-8-f|0)>>>3)<<3)),yt(c))}function pTe(s){s=s|0;var l=0;l=zr()|0,Jr(s,5,4,l,mTe()|0,0),n[s+24>>2]=0,n[s+28>>2]=0,n[s+32>>2]=0}function hTe(s){s=s|0,gTe(s)}function gTe(s){s=s|0,dTe(s)}function dTe(s){s=s|0,V5(s+8|0),o[s+24>>0]=1}function V5(s){s=s|0,n[s>>2]=0,E[s+8>>3]=0}function mTe(){return 1424}function yTe(){return ETe()|0}function ETe(){var s=0,l=0,c=0,f=0,d=0,m=0,B=0;return l=C,C=C+16|0,d=l+4|0,B=l,c=Za(8)|0,s=c,f=Yt(16)|0,V5(f),m=s+4|0,n[m>>2]=f,f=Yt(8)|0,m=n[m>>2]|0,n[B>>2]=0,n[d>>2]=n[B>>2],SR(f,m,d),n[c>>2]=f,C=l,s|0}function CTe(s,l){s=s|0,l=l|0,n[s>>2]=ITe()|0,n[s+4>>2]=wTe()|0,n[s+12>>2]=l,n[s+8>>2]=BTe()|0,n[s+32>>2]=5}function ITe(){return 11710}function wTe(){return 1416}function BTe(){return LD()|0}function vTe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0,(Qp(f,896)|0)==512?c|0&&(DTe(c),yt(c)):l|0&&yt(l)}function DTe(s){s=s|0,s=n[s+4>>2]|0,s|0&&Rp(s)}function LD(){var s=0;return o[7904]|0||(n[2600]=PTe()|0,n[2601]=0,s=7904,n[s>>2]=1,n[s+4>>2]=0),10400}function PTe(){return n[357]|0}function STe(s){s=s|0,xTe(s,4926),bTe(s)|0}function xTe(s,l){s=s|0,l=l|0;var c=0;c=NG()|0,n[s>>2]=c,_Te(c,l),Fp(n[s>>2]|0)}function bTe(s){s=s|0;var l=0;return l=n[s>>2]|0,T0(l,kTe()|0),s|0}function kTe(){var s=0;return o[7912]|0||(z5(10412),pr(56,10412,U|0)|0,s=7912,n[s>>2]=1,n[s+4>>2]=0),Nr(10412)|0||z5(10412),10412}function z5(s){s=s|0,RTe(s),L0(s,57)}function QTe(s){s=s|0,FTe(s+24|0)}function FTe(s){s=s|0;var l=0,c=0,f=0;c=n[s>>2]|0,f=c,c|0&&(s=s+4|0,l=n[s>>2]|0,(l|0)!=(c|0)&&(n[s>>2]=l+(~((l+-8-f|0)>>>3)<<3)),yt(c))}function RTe(s){s=s|0;var l=0;l=zr()|0,Jr(s,5,5,l,OTe()|0,0),n[s+24>>2]=0,n[s+28>>2]=0,n[s+32>>2]=0}function TTe(s){s=s|0,LTe(s)}function LTe(s){s=s|0,NTe(s)}function NTe(s){s=s|0;var l=0,c=0;l=s+8|0,c=l+48|0;do n[l>>2]=0,l=l+4|0;while((l|0)<(c|0));o[s+56>>0]=1}function OTe(){return 1432}function MTe(){return UTe()|0}function UTe(){var s=0,l=0,c=0,f=0,d=0,m=0,B=0,k=0;B=C,C=C+16|0,s=B+4|0,l=B,c=Za(8)|0,f=c,d=Yt(48)|0,m=d,k=m+48|0;do n[m>>2]=0,m=m+4|0;while((m|0)<(k|0));return m=f+4|0,n[m>>2]=d,k=Yt(8)|0,m=n[m>>2]|0,n[l>>2]=0,n[s>>2]=n[l>>2],OG(k,m,s),n[c>>2]=k,C=B,f|0}function _Te(s,l){s=s|0,l=l|0,n[s>>2]=HTe()|0,n[s+4>>2]=qTe()|0,n[s+12>>2]=l,n[s+8>>2]=jTe()|0,n[s+32>>2]=6}function HTe(){return 11704}function qTe(){return 1436}function jTe(){return LD()|0}function GTe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0,(Qp(f,896)|0)==512?c|0&&(WTe(c),yt(c)):l|0&&yt(l)}function WTe(s){s=s|0,s=n[s+4>>2]|0,s|0&&Rp(s)}function YTe(s){s=s|0,KTe(s,4933),VTe(s)|0,zTe(s)|0}function KTe(s,l){s=s|0,l=l|0;var c=0;c=ELe()|0,n[s>>2]=c,CLe(c,l),Fp(n[s>>2]|0)}function VTe(s){s=s|0;var l=0;return l=n[s>>2]|0,T0(l,cLe()|0),s|0}function zTe(s){s=s|0;var l=0;return l=n[s>>2]|0,T0(l,JTe()|0),s|0}function JTe(){var s=0;return o[7920]|0||(J5(10452),pr(58,10452,U|0)|0,s=7920,n[s>>2]=1,n[s+4>>2]=0),Nr(10452)|0||J5(10452),10452}function J5(s){s=s|0,$Te(s),L0(s,1)}function XTe(s){s=s|0,ZTe(s+24|0)}function ZTe(s){s=s|0;var l=0,c=0,f=0;c=n[s>>2]|0,f=c,c|0&&(s=s+4|0,l=n[s>>2]|0,(l|0)!=(c|0)&&(n[s>>2]=l+(~((l+-8-f|0)>>>3)<<3)),yt(c))}function $Te(s){s=s|0;var l=0;l=zr()|0,Jr(s,5,1,l,nLe()|0,2),n[s+24>>2]=0,n[s+28>>2]=0,n[s+32>>2]=0}function eLe(s,l,c){s=s|0,l=+l,c=+c,tLe(s,l,c)}function tLe(s,l,c){s=s|0,l=+l,c=+c;var f=0,d=0,m=0,B=0,k=0;f=C,C=C+32|0,m=f+8|0,k=f+17|0,d=f,B=f+16|0,Tu(k,l),E[m>>3]=+Lu(k,l),Tu(B,c),E[d>>3]=+Lu(B,c),rLe(s,m,d),C=f}function rLe(s,l,c){s=s|0,l=l|0,c=c|0,X5(s+8|0,+E[l>>3],+E[c>>3]),o[s+24>>0]=1}function X5(s,l,c){s=s|0,l=+l,c=+c,E[s>>3]=l,E[s+8>>3]=c}function nLe(){return 1472}function iLe(s,l){return s=+s,l=+l,sLe(s,l)|0}function sLe(s,l){s=+s,l=+l;var c=0,f=0,d=0,m=0,B=0,k=0,F=0;return f=C,C=C+16|0,B=f+4|0,k=f+8|0,F=f,d=Za(8)|0,c=d,m=Yt(16)|0,Tu(B,s),s=+Lu(B,s),Tu(k,l),X5(m,s,+Lu(k,l)),k=c+4|0,n[k>>2]=m,m=Yt(8)|0,k=n[k>>2]|0,n[F>>2]=0,n[B>>2]=n[F>>2],Z5(m,k,B),n[d>>2]=m,C=f,c|0}function Z5(s,l,c){s=s|0,l=l|0,c=c|0,n[s>>2]=l,c=Yt(16)|0,n[c+4>>2]=0,n[c+8>>2]=0,n[c>>2]=1452,n[c+12>>2]=l,n[s+4>>2]=c}function oLe(s){s=s|0,im(s),yt(s)}function aLe(s){s=s|0,s=n[s+12>>2]|0,s|0&&yt(s)}function lLe(s){s=s|0,yt(s)}function cLe(){var s=0;return o[7928]|0||($5(10488),pr(59,10488,U|0)|0,s=7928,n[s>>2]=1,n[s+4>>2]=0),Nr(10488)|0||$5(10488),10488}function $5(s){s=s|0,fLe(s),L0(s,60)}function uLe(s){s=s|0,ALe(s+24|0)}function ALe(s){s=s|0;var l=0,c=0,f=0;c=n[s>>2]|0,f=c,c|0&&(s=s+4|0,l=n[s>>2]|0,(l|0)!=(c|0)&&(n[s>>2]=l+(~((l+-8-f|0)>>>3)<<3)),yt(c))}function fLe(s){s=s|0;var l=0;l=zr()|0,Jr(s,5,6,l,dLe()|0,0),n[s+24>>2]=0,n[s+28>>2]=0,n[s+32>>2]=0}function pLe(s){s=s|0,hLe(s)}function hLe(s){s=s|0,gLe(s)}function gLe(s){s=s|0,e7(s+8|0),o[s+24>>0]=1}function e7(s){s=s|0,n[s>>2]=0,n[s+4>>2]=0,n[s+8>>2]=0,n[s+12>>2]=0}function dLe(){return 1492}function mLe(){return yLe()|0}function yLe(){var s=0,l=0,c=0,f=0,d=0,m=0,B=0;return l=C,C=C+16|0,d=l+4|0,B=l,c=Za(8)|0,s=c,f=Yt(16)|0,e7(f),m=s+4|0,n[m>>2]=f,f=Yt(8)|0,m=n[m>>2]|0,n[B>>2]=0,n[d>>2]=n[B>>2],Z5(f,m,d),n[c>>2]=f,C=l,s|0}function ELe(){var s=0;return o[7936]|0||(PLe(10524),pr(25,10524,U|0)|0,s=7936,n[s>>2]=1,n[s+4>>2]=0),10524}function CLe(s,l){s=s|0,l=l|0,n[s>>2]=ILe()|0,n[s+4>>2]=wLe()|0,n[s+12>>2]=l,n[s+8>>2]=BLe()|0,n[s+32>>2]=7}function ILe(){return 11700}function wLe(){return 1484}function BLe(){return LD()|0}function vLe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0,(Qp(f,896)|0)==512?c|0&&(DLe(c),yt(c)):l|0&&yt(l)}function DLe(s){s=s|0,s=n[s+4>>2]|0,s|0&&Rp(s)}function PLe(s){s=s|0,Sp(s)}function SLe(s,l,c){s=s|0,l=l|0,c=c|0,s=mn(l)|0,l=xLe(c)|0,c=bLe(c,0)|0,sNe(s,l,c,jR()|0,0)}function xLe(s){return s=s|0,s|0}function bLe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0,k=0,F=0;return k=C,C=C+16|0,d=k,m=k+4|0,n[d>>2]=s,F=jR()|0,B=F+24|0,l=dr(l,4)|0,n[m>>2]=l,c=F+28|0,f=n[c>>2]|0,f>>>0<(n[F+32>>2]|0)>>>0?(r7(f,s,l),l=(n[c>>2]|0)+8|0,n[c>>2]=l):(NLe(B,d,m),l=n[c>>2]|0),C=k,(l-(n[B>>2]|0)>>3)+-1|0}function jR(){var s=0,l=0;if(o[7944]|0||(t7(10568),pr(61,10568,U|0)|0,l=7944,n[l>>2]=1,n[l+4>>2]=0),!(Nr(10568)|0)){s=10568,l=s+36|0;do n[s>>2]=0,s=s+4|0;while((s|0)<(l|0));t7(10568)}return 10568}function t7(s){s=s|0,FLe(s)}function kLe(s){s=s|0,QLe(s+24|0)}function QLe(s){s=s|0;var l=0,c=0,f=0;c=n[s>>2]|0,f=c,c|0&&(s=s+4|0,l=n[s>>2]|0,(l|0)!=(c|0)&&(n[s>>2]=l+(~((l+-8-f|0)>>>3)<<3)),yt(c))}function FLe(s){s=s|0;var l=0;l=zr()|0,Jr(s,1,17,l,e5()|0,0),n[s+24>>2]=0,n[s+28>>2]=0,n[s+32>>2]=0}function RLe(s){return s=s|0,LLe(n[(TLe(s)|0)>>2]|0)|0}function TLe(s){return s=s|0,(n[(jR()|0)+24>>2]|0)+(s<<3)|0}function LLe(s){return s=s|0,RD(KD[s&7]()|0)|0}function r7(s,l,c){s=s|0,l=l|0,c=c|0,n[s>>2]=l,n[s+4>>2]=c}function NLe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0;if(k=C,C=C+32|0,d=k,m=s+4|0,B=((n[m>>2]|0)-(n[s>>2]|0)>>3)+1|0,f=OLe(s)|0,f>>>0>>0)Zr(s);else{F=n[s>>2]|0,O=(n[s+8>>2]|0)-F|0,M=O>>2,MLe(d,O>>3>>>0>>1>>>0?M>>>0>>0?B:M:f,(n[m>>2]|0)-F>>3,s+8|0),B=d+8|0,r7(n[B>>2]|0,n[l>>2]|0,n[c>>2]|0),n[B>>2]=(n[B>>2]|0)+8,ULe(s,d),_Le(d),C=k;return}}function OLe(s){return s=s|0,536870911}function MLe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0;n[s+12>>2]=0,n[s+16>>2]=f;do if(l)if(l>>>0>536870911)Tt();else{d=Yt(l<<3)|0;break}else d=0;while(!1);n[s>>2]=d,f=d+(c<<3)|0,n[s+8>>2]=f,n[s+4>>2]=f,n[s+12>>2]=d+(l<<3)}function ULe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0;f=n[s>>2]|0,B=s+4|0,m=l+4|0,d=(n[B>>2]|0)-f|0,c=(n[m>>2]|0)+(0-(d>>3)<<3)|0,n[m>>2]=c,(d|0)>0?(br(c|0,f|0,d|0)|0,f=m,c=n[m>>2]|0):f=m,m=n[s>>2]|0,n[s>>2]=c,n[f>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=s+8|0,B=l+12|0,s=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=s,n[l>>2]=n[f>>2]}function _Le(s){s=s|0;var l=0,c=0,f=0;l=n[s+4>>2]|0,c=s+8|0,f=n[c>>2]|0,(f|0)!=(l|0)&&(n[c>>2]=f+(~((f+-8-l|0)>>>3)<<3)),s=n[s>>2]|0,s|0&&yt(s)}function HLe(){qLe()}function qLe(){jLe(10604)}function jLe(s){s=s|0,GLe(s,4955)}function GLe(s,l){s=s|0,l=l|0;var c=0;c=WLe()|0,n[s>>2]=c,YLe(c,l),Fp(n[s>>2]|0)}function WLe(){var s=0;return o[7952]|0||(tNe(10612),pr(25,10612,U|0)|0,s=7952,n[s>>2]=1,n[s+4>>2]=0),10612}function YLe(s,l){s=s|0,l=l|0,n[s>>2]=JLe()|0,n[s+4>>2]=XLe()|0,n[s+12>>2]=l,n[s+8>>2]=ZLe()|0,n[s+32>>2]=8}function Fp(s){s=s|0;var l=0,c=0;l=C,C=C+16|0,c=l,$d()|0,n[c>>2]=s,KLe(10608,c),C=l}function $d(){return o[11714]|0||(n[2652]=0,pr(62,10608,U|0)|0,o[11714]=1),10608}function KLe(s,l){s=s|0,l=l|0;var c=0;c=Yt(8)|0,n[c+4>>2]=n[l>>2],n[c>>2]=n[s>>2],n[s>>2]=c}function VLe(s){s=s|0,zLe(s)}function zLe(s){s=s|0;var l=0,c=0;if(l=n[s>>2]|0,l|0)do c=l,l=n[l>>2]|0,yt(c);while(l|0);n[s>>2]=0}function JLe(){return 11715}function XLe(){return 1496}function ZLe(){return TD()|0}function $Le(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0,(Qp(f,896)|0)==512?c|0&&(eNe(c),yt(c)):l|0&&yt(l)}function eNe(s){s=s|0,s=n[s+4>>2]|0,s|0&&Rp(s)}function tNe(s){s=s|0,Sp(s)}function rNe(s,l){s=s|0,l=l|0;var c=0,f=0;$d()|0,c=n[2652]|0;e:do if(c|0){for(;f=n[c+4>>2]|0,!(f|0&&!(O7(GR(f)|0,s)|0));)if(c=n[c>>2]|0,!c)break e;nNe(f,l)}while(!1)}function GR(s){return s=s|0,n[s+12>>2]|0}function nNe(s,l){s=s|0,l=l|0;var c=0;s=s+36|0,c=n[s>>2]|0,c|0&&(xu(c),yt(c)),c=Yt(4)|0,PD(c,l),n[s>>2]=c}function WR(){return o[11716]|0||(n[2664]=0,pr(63,10656,U|0)|0,o[11716]=1),10656}function n7(){var s=0;return o[11717]|0?s=n[2665]|0:(iNe(),n[2665]=1504,o[11717]=1,s=1504),s|0}function iNe(){o[11740]|0||(o[11718]=dr(dr(8,0)|0,0)|0,o[11719]=dr(dr(0,0)|0,0)|0,o[11720]=dr(dr(0,16)|0,0)|0,o[11721]=dr(dr(8,0)|0,0)|0,o[11722]=dr(dr(0,0)|0,0)|0,o[11723]=dr(dr(8,0)|0,0)|0,o[11724]=dr(dr(0,0)|0,0)|0,o[11725]=dr(dr(8,0)|0,0)|0,o[11726]=dr(dr(0,0)|0,0)|0,o[11727]=dr(dr(8,0)|0,0)|0,o[11728]=dr(dr(0,0)|0,0)|0,o[11729]=dr(dr(0,0)|0,32)|0,o[11730]=dr(dr(0,0)|0,32)|0,o[11740]=1)}function i7(){return 1572}function sNe(s,l,c,f,d){s=s|0,l=l|0,c=c|0,f=f|0,d=d|0;var m=0,B=0,k=0,F=0,M=0,O=0;m=C,C=C+32|0,O=m+16|0,M=m+12|0,F=m+8|0,k=m+4|0,B=m,n[O>>2]=s,n[M>>2]=l,n[F>>2]=c,n[k>>2]=f,n[B>>2]=d,WR()|0,oNe(10656,O,M,F,k,B),C=m}function oNe(s,l,c,f,d,m){s=s|0,l=l|0,c=c|0,f=f|0,d=d|0,m=m|0;var B=0;B=Yt(24)|0,RG(B+4|0,n[l>>2]|0,n[c>>2]|0,n[f>>2]|0,n[d>>2]|0,n[m>>2]|0),n[B>>2]=n[s>>2],n[s>>2]=B}function s7(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0,j=0,oe=0,We=0,Oe=0,Qe=0,rt=0,Xe=0,ct=0;if(ct=C,C=C+32|0,Oe=ct+20|0,Qe=ct+8|0,rt=ct+4|0,Xe=ct,l=n[l>>2]|0,l|0){We=Oe+4|0,F=Oe+8|0,M=Qe+4|0,O=Qe+8|0,j=Qe+8|0,oe=Oe+8|0;do{if(B=l+4|0,k=YR(B)|0,k|0){if(d=$I(k)|0,n[Oe>>2]=0,n[We>>2]=0,n[F>>2]=0,f=(ew(k)|0)+1|0,aNe(Oe,f),f|0)for(;f=f+-1|0,Tc(Qe,n[d>>2]|0),m=n[We>>2]|0,m>>>0<(n[oe>>2]|0)>>>0?(n[m>>2]=n[Qe>>2],n[We>>2]=(n[We>>2]|0)+4):KR(Oe,Qe),f;)d=d+4|0;f=tw(k)|0,n[Qe>>2]=0,n[M>>2]=0,n[O>>2]=0;e:do if(n[f>>2]|0)for(d=0,m=0;;){if((d|0)==(m|0)?lNe(Qe,f):(n[d>>2]=n[f>>2],n[M>>2]=(n[M>>2]|0)+4),f=f+4|0,!(n[f>>2]|0))break e;d=n[M>>2]|0,m=n[j>>2]|0}while(!1);n[rt>>2]=ND(B)|0,n[Xe>>2]=Nr(k)|0,cNe(c,s,rt,Xe,Oe,Qe),VR(Qe),$A(Oe)}l=n[l>>2]|0}while(l|0)}C=ct}function YR(s){return s=s|0,n[s+12>>2]|0}function $I(s){return s=s|0,n[s+12>>2]|0}function ew(s){return s=s|0,n[s+16>>2]|0}function aNe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0;d=C,C=C+32|0,c=d,f=n[s>>2]|0,(n[s+8>>2]|0)-f>>2>>>0>>0&&(p7(c,l,(n[s+4>>2]|0)-f>>2,s+8|0),h7(s,c),g7(c)),C=d}function KR(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0,k=0,F=0,M=0;if(B=C,C=C+32|0,c=B,f=s+4|0,d=((n[f>>2]|0)-(n[s>>2]|0)>>2)+1|0,m=f7(s)|0,m>>>0>>0)Zr(s);else{k=n[s>>2]|0,M=(n[s+8>>2]|0)-k|0,F=M>>1,p7(c,M>>2>>>0>>1>>>0?F>>>0>>0?d:F:m,(n[f>>2]|0)-k>>2,s+8|0),m=c+8|0,n[n[m>>2]>>2]=n[l>>2],n[m>>2]=(n[m>>2]|0)+4,h7(s,c),g7(c),C=B;return}}function tw(s){return s=s|0,n[s+8>>2]|0}function lNe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0,k=0,F=0,M=0;if(B=C,C=C+32|0,c=B,f=s+4|0,d=((n[f>>2]|0)-(n[s>>2]|0)>>2)+1|0,m=A7(s)|0,m>>>0>>0)Zr(s);else{k=n[s>>2]|0,M=(n[s+8>>2]|0)-k|0,F=M>>1,xNe(c,M>>2>>>0>>1>>>0?F>>>0>>0?d:F:m,(n[f>>2]|0)-k>>2,s+8|0),m=c+8|0,n[n[m>>2]>>2]=n[l>>2],n[m>>2]=(n[m>>2]|0)+4,bNe(s,c),kNe(c),C=B;return}}function ND(s){return s=s|0,n[s>>2]|0}function cNe(s,l,c,f,d,m){s=s|0,l=l|0,c=c|0,f=f|0,d=d|0,m=m|0,uNe(s,l,c,f,d,m)}function VR(s){s=s|0;var l=0,c=0,f=0;c=n[s>>2]|0,f=c,c|0&&(s=s+4|0,l=n[s>>2]|0,(l|0)!=(c|0)&&(n[s>>2]=l+(~((l+-4-f|0)>>>2)<<2)),yt(c))}function $A(s){s=s|0;var l=0,c=0,f=0;c=n[s>>2]|0,f=c,c|0&&(s=s+4|0,l=n[s>>2]|0,(l|0)!=(c|0)&&(n[s>>2]=l+(~((l+-4-f|0)>>>2)<<2)),yt(c))}function uNe(s,l,c,f,d,m){s=s|0,l=l|0,c=c|0,f=f|0,d=d|0,m=m|0;var B=0,k=0,F=0,M=0,O=0,j=0;B=C,C=C+48|0,O=B+40|0,k=B+32|0,j=B+24|0,F=B+12|0,M=B,$a(k),s=ys(s)|0,n[j>>2]=n[l>>2],c=n[c>>2]|0,f=n[f>>2]|0,zR(F,d),ANe(M,m),n[O>>2]=n[j>>2],fNe(s,O,c,f,F,M),VR(M),$A(F),el(k),C=B}function zR(s,l){s=s|0,l=l|0;var c=0,f=0;n[s>>2]=0,n[s+4>>2]=0,n[s+8>>2]=0,c=l+4|0,f=(n[c>>2]|0)-(n[l>>2]|0)>>2,f|0&&(PNe(s,f),SNe(s,n[l>>2]|0,n[c>>2]|0,f))}function ANe(s,l){s=s|0,l=l|0;var c=0,f=0;n[s>>2]=0,n[s+4>>2]=0,n[s+8>>2]=0,c=l+4|0,f=(n[c>>2]|0)-(n[l>>2]|0)>>2,f|0&&(vNe(s,f),DNe(s,n[l>>2]|0,n[c>>2]|0,f))}function fNe(s,l,c,f,d,m){s=s|0,l=l|0,c=c|0,f=f|0,d=d|0,m=m|0;var B=0,k=0,F=0,M=0,O=0,j=0;B=C,C=C+32|0,O=B+28|0,j=B+24|0,k=B+12|0,F=B,M=jo(pNe()|0)|0,n[j>>2]=n[l>>2],n[O>>2]=n[j>>2],l=N0(O)|0,c=o7(c)|0,f=JR(f)|0,n[k>>2]=n[d>>2],O=d+4|0,n[k+4>>2]=n[O>>2],j=d+8|0,n[k+8>>2]=n[j>>2],n[j>>2]=0,n[O>>2]=0,n[d>>2]=0,d=XR(k)|0,n[F>>2]=n[m>>2],O=m+4|0,n[F+4>>2]=n[O>>2],j=m+8|0,n[F+8>>2]=n[j>>2],n[j>>2]=0,n[O>>2]=0,n[m>>2]=0,gc(0,M|0,s|0,l|0,c|0,f|0,d|0,hNe(F)|0)|0,VR(F),$A(k),C=B}function pNe(){var s=0;return o[7968]|0||(wNe(10708),s=7968,n[s>>2]=1,n[s+4>>2]=0),10708}function N0(s){return s=s|0,l7(s)|0}function o7(s){return s=s|0,a7(s)|0}function JR(s){return s=s|0,RD(s)|0}function XR(s){return s=s|0,dNe(s)|0}function hNe(s){return s=s|0,gNe(s)|0}function gNe(s){s=s|0;var l=0,c=0,f=0;if(f=(n[s+4>>2]|0)-(n[s>>2]|0)|0,c=f>>2,f=Za(f+4|0)|0,n[f>>2]=c,c|0){l=0;do n[f+4+(l<<2)>>2]=a7(n[(n[s>>2]|0)+(l<<2)>>2]|0)|0,l=l+1|0;while((l|0)!=(c|0))}return f|0}function a7(s){return s=s|0,s|0}function dNe(s){s=s|0;var l=0,c=0,f=0;if(f=(n[s+4>>2]|0)-(n[s>>2]|0)|0,c=f>>2,f=Za(f+4|0)|0,n[f>>2]=c,c|0){l=0;do n[f+4+(l<<2)>>2]=l7((n[s>>2]|0)+(l<<2)|0)|0,l=l+1|0;while((l|0)!=(c|0))}return f|0}function l7(s){s=s|0;var l=0,c=0,f=0,d=0;return d=C,C=C+32|0,l=d+12|0,c=d,f=cR(c7()|0)|0,f?(uR(l,f),AR(c,l),Z4e(s,c),s=fR(l)|0):s=mNe(s)|0,C=d,s|0}function c7(){var s=0;return o[7960]|0||(INe(10664),pr(25,10664,U|0)|0,s=7960,n[s>>2]=1,n[s+4>>2]=0),10664}function mNe(s){s=s|0;var l=0,c=0,f=0,d=0,m=0,B=0,k=0;return c=C,C=C+16|0,d=c+4|0,B=c,f=Za(8)|0,l=f,k=Yt(4)|0,n[k>>2]=n[s>>2],m=l+4|0,n[m>>2]=k,s=Yt(8)|0,m=n[m>>2]|0,n[B>>2]=0,n[d>>2]=n[B>>2],u7(s,m,d),n[f>>2]=s,C=c,l|0}function u7(s,l,c){s=s|0,l=l|0,c=c|0,n[s>>2]=l,c=Yt(16)|0,n[c+4>>2]=0,n[c+8>>2]=0,n[c>>2]=1656,n[c+12>>2]=l,n[s+4>>2]=c}function yNe(s){s=s|0,im(s),yt(s)}function ENe(s){s=s|0,s=n[s+12>>2]|0,s|0&&yt(s)}function CNe(s){s=s|0,yt(s)}function INe(s){s=s|0,Sp(s)}function wNe(s){s=s|0,ao(s,BNe()|0,5)}function BNe(){return 1676}function vNe(s,l){s=s|0,l=l|0;var c=0;if((A7(s)|0)>>>0>>0&&Zr(s),l>>>0>1073741823)Tt();else{c=Yt(l<<2)|0,n[s+4>>2]=c,n[s>>2]=c,n[s+8>>2]=c+(l<<2);return}}function DNe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0,f=s+4|0,s=c-l|0,(s|0)>0&&(br(n[f>>2]|0,l|0,s|0)|0,n[f>>2]=(n[f>>2]|0)+(s>>>2<<2))}function A7(s){return s=s|0,1073741823}function PNe(s,l){s=s|0,l=l|0;var c=0;if((f7(s)|0)>>>0>>0&&Zr(s),l>>>0>1073741823)Tt();else{c=Yt(l<<2)|0,n[s+4>>2]=c,n[s>>2]=c,n[s+8>>2]=c+(l<<2);return}}function SNe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0,f=s+4|0,s=c-l|0,(s|0)>0&&(br(n[f>>2]|0,l|0,s|0)|0,n[f>>2]=(n[f>>2]|0)+(s>>>2<<2))}function f7(s){return s=s|0,1073741823}function xNe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0;n[s+12>>2]=0,n[s+16>>2]=f;do if(l)if(l>>>0>1073741823)Tt();else{d=Yt(l<<2)|0;break}else d=0;while(!1);n[s>>2]=d,f=d+(c<<2)|0,n[s+8>>2]=f,n[s+4>>2]=f,n[s+12>>2]=d+(l<<2)}function bNe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0;f=n[s>>2]|0,B=s+4|0,m=l+4|0,d=(n[B>>2]|0)-f|0,c=(n[m>>2]|0)+(0-(d>>2)<<2)|0,n[m>>2]=c,(d|0)>0?(br(c|0,f|0,d|0)|0,f=m,c=n[m>>2]|0):f=m,m=n[s>>2]|0,n[s>>2]=c,n[f>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=s+8|0,B=l+12|0,s=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=s,n[l>>2]=n[f>>2]}function kNe(s){s=s|0;var l=0,c=0,f=0;l=n[s+4>>2]|0,c=s+8|0,f=n[c>>2]|0,(f|0)!=(l|0)&&(n[c>>2]=f+(~((f+-4-l|0)>>>2)<<2)),s=n[s>>2]|0,s|0&&yt(s)}function p7(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0;n[s+12>>2]=0,n[s+16>>2]=f;do if(l)if(l>>>0>1073741823)Tt();else{d=Yt(l<<2)|0;break}else d=0;while(!1);n[s>>2]=d,f=d+(c<<2)|0,n[s+8>>2]=f,n[s+4>>2]=f,n[s+12>>2]=d+(l<<2)}function h7(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0;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Ne(oe,d7(F)|0),B=n[oe>>2]|0,B|0){n[O>>2]=0,n[s>>2]=0,n[l>>2]=0;do Tc(We,n[(em(n[B+4>>2]|0)|0)>>2]|0),k=n[s>>2]|0,k>>>0<(n[c>>2]|0)>>>0?(n[k>>2]=n[We>>2],n[s>>2]=(n[s>>2]|0)+4):KR(O,We),B=n[B>>2]|0;while(B|0);NNe(f,j,O),$A(O)}n[Oe>>2]=n[j>>2],M=m7(F)|0,n[O>>2]=n[Oe>>2],s7(O,M,d),UG(oe),m=n[m>>2]|0}while(m|0)}C=Qe}function FNe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0,VNe(s,l,c,f)}function RNe(s,l,c){s=s|0,l=l|0,c=c|0,KNe(s,l,c)}function em(s){return s=s|0,s|0}function TNe(s,l,c){s=s|0,l=l|0,c=c|0,jNe(s,l,c)}function d7(s){return s=s|0,s+16|0}function LNe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0,k=0,F=0;if(m=C,C=C+16|0,d=m+8|0,c=m,n[s>>2]=0,f=n[l>>2]|0,n[d>>2]=f,n[c>>2]=s,c=qNe(c)|0,f|0){if(f=Yt(12)|0,B=(y7(d)|0)+4|0,s=n[B+4>>2]|0,l=f+4|0,n[l>>2]=n[B>>2],n[l+4>>2]=s,l=n[n[d>>2]>>2]|0,n[d>>2]=l,!l)s=f;else for(l=f;s=Yt(12)|0,F=(y7(d)|0)+4|0,k=n[F+4>>2]|0,B=s+4|0,n[B>>2]=n[F>>2],n[B+4>>2]=k,n[l>>2]=s,B=n[n[d>>2]>>2]|0,n[d>>2]=B,B;)l=s;n[s>>2]=n[c>>2],n[c>>2]=f}C=m}function NNe(s,l,c){s=s|0,l=l|0,c=c|0,ONe(s,l,c)}function m7(s){return s=s|0,s+24|0}function ONe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0;f=C,C=C+32|0,B=f+24|0,d=f+16|0,k=f+12|0,m=f,$a(d),s=ys(s)|0,n[k>>2]=n[l>>2],zR(m,c),n[B>>2]=n[k>>2],MNe(s,B,m),$A(m),el(d),C=f}function MNe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0;f=C,C=C+32|0,B=f+16|0,k=f+12|0,d=f,m=jo(UNe()|0)|0,n[k>>2]=n[l>>2],n[B>>2]=n[k>>2],l=N0(B)|0,n[d>>2]=n[c>>2],B=c+4|0,n[d+4>>2]=n[B>>2],k=c+8|0,n[d+8>>2]=n[k>>2],n[k>>2]=0,n[B>>2]=0,n[c>>2]=0,hs(0,m|0,s|0,l|0,XR(d)|0)|0,$A(d),C=f}function UNe(){var s=0;return o[7976]|0||(_Ne(10720),s=7976,n[s>>2]=1,n[s+4>>2]=0),10720}function _Ne(s){s=s|0,ao(s,HNe()|0,2)}function HNe(){return 1732}function qNe(s){return s=s|0,n[s>>2]|0}function y7(s){return s=s|0,n[s>>2]|0}function jNe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0;f=C,C=C+32|0,m=f+16|0,d=f+8|0,B=f,$a(d),s=ys(s)|0,n[B>>2]=n[l>>2],c=n[c>>2]|0,n[m>>2]=n[B>>2],E7(s,m,c),el(d),C=f}function E7(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0;f=C,C=C+16|0,m=f+4|0,B=f,d=jo(GNe()|0)|0,n[B>>2]=n[l>>2],n[m>>2]=n[B>>2],l=N0(m)|0,hs(0,d|0,s|0,l|0,o7(c)|0)|0,C=f}function GNe(){var s=0;return o[7984]|0||(WNe(10732),s=7984,n[s>>2]=1,n[s+4>>2]=0),10732}function WNe(s){s=s|0,ao(s,YNe()|0,2)}function YNe(){return 1744}function KNe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0;f=C,C=C+32|0,m=f+16|0,d=f+8|0,B=f,$a(d),s=ys(s)|0,n[B>>2]=n[l>>2],c=n[c>>2]|0,n[m>>2]=n[B>>2],E7(s,m,c),el(d),C=f}function VNe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0,m=0,B=0,k=0;d=C,C=C+32|0,B=d+16|0,m=d+8|0,k=d,$a(m),s=ys(s)|0,n[k>>2]=n[l>>2],c=o[c>>0]|0,f=o[f>>0]|0,n[B>>2]=n[k>>2],zNe(s,B,c,f),el(m),C=d}function zNe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0,m=0,B=0,k=0;d=C,C=C+16|0,B=d+4|0,k=d,m=jo(JNe()|0)|0,n[k>>2]=n[l>>2],n[B>>2]=n[k>>2],l=N0(B)|0,c=tm(c)|0,vi(0,m|0,s|0,l|0,c|0,tm(f)|0)|0,C=d}function JNe(){var s=0;return o[7992]|0||(ZNe(10744),s=7992,n[s>>2]=1,n[s+4>>2]=0),10744}function tm(s){return s=s|0,XNe(s)|0}function XNe(s){return s=s|0,s&255|0}function ZNe(s){s=s|0,ao(s,$Ne()|0,3)}function $Ne(){return 1756}function eOe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0,j=0,oe=0;switch(oe=C,C=C+32|0,k=oe+8|0,F=oe+4|0,M=oe+20|0,O=oe,dR(s,0),f=X4e(l)|0,n[k>>2]=0,j=k+4|0,n[j>>2]=0,n[k+8>>2]=0,f<<24>>24){case 0:{o[M>>0]=0,tOe(F,c,M),OD(s,F)|0,bu(F);break}case 8:{j=nT(l)|0,o[M>>0]=8,Tc(O,n[j+4>>2]|0),rOe(F,c,M,O,j+8|0),OD(s,F)|0,bu(F);break}case 9:{if(m=nT(l)|0,l=n[m+4>>2]|0,l|0)for(B=k+8|0,d=m+12|0;l=l+-1|0,Tc(F,n[d>>2]|0),f=n[j>>2]|0,f>>>0<(n[B>>2]|0)>>>0?(n[f>>2]=n[F>>2],n[j>>2]=(n[j>>2]|0)+4):KR(k,F),l;)d=d+4|0;o[M>>0]=9,Tc(O,n[m+8>>2]|0),nOe(F,c,M,O,k),OD(s,F)|0,bu(F);break}default:j=nT(l)|0,o[M>>0]=f,Tc(O,n[j+4>>2]|0),iOe(F,c,M,O),OD(s,F)|0,bu(F)}$A(k),C=oe}function tOe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0;f=C,C=C+16|0,d=f,$a(d),l=ys(l)|0,mOe(s,l,o[c>>0]|0),el(d),C=f}function OD(s,l){s=s|0,l=l|0;var c=0;return c=n[s>>2]|0,c|0&&sa(c|0),n[s>>2]=n[l>>2],n[l>>2]=0,s|0}function rOe(s,l,c,f,d){s=s|0,l=l|0,c=c|0,f=f|0,d=d|0;var m=0,B=0,k=0,F=0;m=C,C=C+32|0,k=m+16|0,B=m+8|0,F=m,$a(B),l=ys(l)|0,c=o[c>>0]|0,n[F>>2]=n[f>>2],d=n[d>>2]|0,n[k>>2]=n[F>>2],pOe(s,l,c,k,d),el(B),C=m}function nOe(s,l,c,f,d){s=s|0,l=l|0,c=c|0,f=f|0,d=d|0;var m=0,B=0,k=0,F=0,M=0;m=C,C=C+32|0,F=m+24|0,B=m+16|0,M=m+12|0,k=m,$a(B),l=ys(l)|0,c=o[c>>0]|0,n[M>>2]=n[f>>2],zR(k,d),n[F>>2]=n[M>>2],cOe(s,l,c,F,k),$A(k),el(B),C=m}function iOe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0,m=0,B=0,k=0;d=C,C=C+32|0,B=d+16|0,m=d+8|0,k=d,$a(m),l=ys(l)|0,c=o[c>>0]|0,n[k>>2]=n[f>>2],n[B>>2]=n[k>>2],sOe(s,l,c,B),el(m),C=d}function sOe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0,m=0,B=0,k=0;d=C,C=C+16|0,m=d+4|0,k=d,B=jo(oOe()|0)|0,c=tm(c)|0,n[k>>2]=n[f>>2],n[m>>2]=n[k>>2],MD(s,hs(0,B|0,l|0,c|0,N0(m)|0)|0),C=d}function oOe(){var s=0;return o[8e3]|0||(aOe(10756),s=8e3,n[s>>2]=1,n[s+4>>2]=0),10756}function MD(s,l){s=s|0,l=l|0,dR(s,l)}function aOe(s){s=s|0,ao(s,lOe()|0,2)}function lOe(){return 1772}function cOe(s,l,c,f,d){s=s|0,l=l|0,c=c|0,f=f|0,d=d|0;var m=0,B=0,k=0,F=0,M=0;m=C,C=C+32|0,F=m+16|0,M=m+12|0,B=m,k=jo(uOe()|0)|0,c=tm(c)|0,n[M>>2]=n[f>>2],n[F>>2]=n[M>>2],f=N0(F)|0,n[B>>2]=n[d>>2],F=d+4|0,n[B+4>>2]=n[F>>2],M=d+8|0,n[B+8>>2]=n[M>>2],n[M>>2]=0,n[F>>2]=0,n[d>>2]=0,MD(s,vi(0,k|0,l|0,c|0,f|0,XR(B)|0)|0),$A(B),C=m}function uOe(){var s=0;return o[8008]|0||(AOe(10768),s=8008,n[s>>2]=1,n[s+4>>2]=0),10768}function AOe(s){s=s|0,ao(s,fOe()|0,3)}function fOe(){return 1784}function pOe(s,l,c,f,d){s=s|0,l=l|0,c=c|0,f=f|0,d=d|0;var m=0,B=0,k=0,F=0;m=C,C=C+16|0,k=m+4|0,F=m,B=jo(hOe()|0)|0,c=tm(c)|0,n[F>>2]=n[f>>2],n[k>>2]=n[F>>2],f=N0(k)|0,MD(s,vi(0,B|0,l|0,c|0,f|0,JR(d)|0)|0),C=m}function hOe(){var s=0;return o[8016]|0||(gOe(10780),s=8016,n[s>>2]=1,n[s+4>>2]=0),10780}function gOe(s){s=s|0,ao(s,dOe()|0,3)}function dOe(){return 1800}function mOe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0;f=jo(yOe()|0)|0,MD(s,un(0,f|0,l|0,tm(c)|0)|0)}function yOe(){var s=0;return o[8024]|0||(EOe(10792),s=8024,n[s>>2]=1,n[s+4>>2]=0),10792}function EOe(s){s=s|0,ao(s,COe()|0,1)}function COe(){return 1816}function IOe(){wOe(),BOe(),vOe()}function wOe(){n[2702]=K7(65536)|0}function BOe(){GOe(10856)}function vOe(){DOe(10816)}function DOe(s){s=s|0,POe(s,5044),SOe(s)|0}function POe(s,l){s=s|0,l=l|0;var c=0;c=c7()|0,n[s>>2]=c,MOe(c,l),Fp(n[s>>2]|0)}function SOe(s){s=s|0;var l=0;return l=n[s>>2]|0,T0(l,xOe()|0),s|0}function xOe(){var s=0;return o[8032]|0||(C7(10820),pr(64,10820,U|0)|0,s=8032,n[s>>2]=1,n[s+4>>2]=0),Nr(10820)|0||C7(10820),10820}function C7(s){s=s|0,QOe(s),L0(s,25)}function bOe(s){s=s|0,kOe(s+24|0)}function kOe(s){s=s|0;var l=0,c=0,f=0;c=n[s>>2]|0,f=c,c|0&&(s=s+4|0,l=n[s>>2]|0,(l|0)!=(c|0)&&(n[s>>2]=l+(~((l+-8-f|0)>>>3)<<3)),yt(c))}function QOe(s){s=s|0;var l=0;l=zr()|0,Jr(s,5,18,l,LOe()|0,1),n[s+24>>2]=0,n[s+28>>2]=0,n[s+32>>2]=0}function FOe(s,l){s=s|0,l=l|0,ROe(s,l)}function ROe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0;c=C,C=C+16|0,f=c,d=c+4|0,F0(d,l),n[f>>2]=R0(d,l)|0,TOe(s,f),C=c}function TOe(s,l){s=s|0,l=l|0,I7(s+4|0,n[l>>2]|0),o[s+8>>0]=1}function I7(s,l){s=s|0,l=l|0,n[s>>2]=l}function LOe(){return 1824}function NOe(s){return s=s|0,OOe(s)|0}function OOe(s){s=s|0;var l=0,c=0,f=0,d=0,m=0,B=0,k=0;return c=C,C=C+16|0,d=c+4|0,B=c,f=Za(8)|0,l=f,k=Yt(4)|0,F0(d,s),I7(k,R0(d,s)|0),m=l+4|0,n[m>>2]=k,s=Yt(8)|0,m=n[m>>2]|0,n[B>>2]=0,n[d>>2]=n[B>>2],u7(s,m,d),n[f>>2]=s,C=c,l|0}function Za(s){s=s|0;var l=0,c=0;return s=s+7&-8,s>>>0<=32768&&(l=n[2701]|0,s>>>0<=(65536-l|0)>>>0)?(c=(n[2702]|0)+l|0,n[2701]=l+s,s=c):(s=K7(s+8|0)|0,n[s>>2]=n[2703],n[2703]=s,s=s+8|0),s|0}function MOe(s,l){s=s|0,l=l|0,n[s>>2]=UOe()|0,n[s+4>>2]=_Oe()|0,n[s+12>>2]=l,n[s+8>>2]=HOe()|0,n[s+32>>2]=9}function UOe(){return 11744}function _Oe(){return 1832}function HOe(){return LD()|0}function qOe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0,(Qp(f,896)|0)==512?c|0&&(jOe(c),yt(c)):l|0&&yt(l)}function jOe(s){s=s|0,s=n[s+4>>2]|0,s|0&&Rp(s)}function GOe(s){s=s|0,WOe(s,5052),YOe(s)|0,KOe(s,5058,26)|0,VOe(s,5069,1)|0,zOe(s,5077,10)|0,JOe(s,5087,19)|0,XOe(s,5094,27)|0}function WOe(s,l){s=s|0,l=l|0;var c=0;c=j4e()|0,n[s>>2]=c,G4e(c,l),Fp(n[s>>2]|0)}function YOe(s){s=s|0;var l=0;return l=n[s>>2]|0,T0(l,b4e()|0),s|0}function KOe(s,l,c){return s=s|0,l=l|0,c=c|0,A4e(s,mn(l)|0,c,0),s|0}function VOe(s,l,c){return s=s|0,l=l|0,c=c|0,JMe(s,mn(l)|0,c,0),s|0}function zOe(s,l,c){return s=s|0,l=l|0,c=c|0,xMe(s,mn(l)|0,c,0),s|0}function JOe(s,l,c){return s=s|0,l=l|0,c=c|0,pMe(s,mn(l)|0,c,0),s|0}function w7(s,l){s=s|0,l=l|0;var c=0,f=0;e:for(;;){for(c=n[2703]|0;;){if((c|0)==(l|0))break e;if(f=n[c>>2]|0,n[2703]=f,!c)c=f;else break}yt(c)}n[2701]=s}function XOe(s,l,c){return s=s|0,l=l|0,c=c|0,ZOe(s,mn(l)|0,c,0),s|0}function ZOe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0,m=0;m=n[s>>2]|0,d=ZR()|0,s=$Oe(c)|0,yn(m,l,d,s,eMe(c,f)|0,f)}function ZR(){var s=0,l=0;if(o[8040]|0||(v7(10860),pr(65,10860,U|0)|0,l=8040,n[l>>2]=1,n[l+4>>2]=0),!(Nr(10860)|0)){s=10860,l=s+36|0;do n[s>>2]=0,s=s+4|0;while((s|0)<(l|0));v7(10860)}return 10860}function $Oe(s){return s=s|0,s|0}function eMe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0,k=0,F=0;return k=C,C=C+16|0,d=k,m=k+4|0,n[d>>2]=s,F=ZR()|0,B=F+24|0,l=dr(l,4)|0,n[m>>2]=l,c=F+28|0,f=n[c>>2]|0,f>>>0<(n[F+32>>2]|0)>>>0?(B7(f,s,l),l=(n[c>>2]|0)+8|0,n[c>>2]=l):(tMe(B,d,m),l=n[c>>2]|0),C=k,(l-(n[B>>2]|0)>>3)+-1|0}function B7(s,l,c){s=s|0,l=l|0,c=c|0,n[s>>2]=l,n[s+4>>2]=c}function tMe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0;if(k=C,C=C+32|0,d=k,m=s+4|0,B=((n[m>>2]|0)-(n[s>>2]|0)>>3)+1|0,f=rMe(s)|0,f>>>0>>0)Zr(s);else{F=n[s>>2]|0,O=(n[s+8>>2]|0)-F|0,M=O>>2,nMe(d,O>>3>>>0>>1>>>0?M>>>0>>0?B:M:f,(n[m>>2]|0)-F>>3,s+8|0),B=d+8|0,B7(n[B>>2]|0,n[l>>2]|0,n[c>>2]|0),n[B>>2]=(n[B>>2]|0)+8,iMe(s,d),sMe(d),C=k;return}}function rMe(s){return s=s|0,536870911}function nMe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0;n[s+12>>2]=0,n[s+16>>2]=f;do if(l)if(l>>>0>536870911)Tt();else{d=Yt(l<<3)|0;break}else d=0;while(!1);n[s>>2]=d,f=d+(c<<3)|0,n[s+8>>2]=f,n[s+4>>2]=f,n[s+12>>2]=d+(l<<3)}function iMe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0;f=n[s>>2]|0,B=s+4|0,m=l+4|0,d=(n[B>>2]|0)-f|0,c=(n[m>>2]|0)+(0-(d>>3)<<3)|0,n[m>>2]=c,(d|0)>0?(br(c|0,f|0,d|0)|0,f=m,c=n[m>>2]|0):f=m,m=n[s>>2]|0,n[s>>2]=c,n[f>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=s+8|0,B=l+12|0,s=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=s,n[l>>2]=n[f>>2]}function sMe(s){s=s|0;var l=0,c=0,f=0;l=n[s+4>>2]|0,c=s+8|0,f=n[c>>2]|0,(f|0)!=(l|0)&&(n[c>>2]=f+(~((f+-8-l|0)>>>3)<<3)),s=n[s>>2]|0,s|0&&yt(s)}function v7(s){s=s|0,lMe(s)}function oMe(s){s=s|0,aMe(s+24|0)}function aMe(s){s=s|0;var l=0,c=0,f=0;c=n[s>>2]|0,f=c,c|0&&(s=s+4|0,l=n[s>>2]|0,(l|0)!=(c|0)&&(n[s>>2]=l+(~((l+-8-f|0)>>>3)<<3)),yt(c))}function lMe(s){s=s|0;var l=0;l=zr()|0,Jr(s,1,11,l,cMe()|0,2),n[s+24>>2]=0,n[s+28>>2]=0,n[s+32>>2]=0}function cMe(){return 1840}function uMe(s,l,c){s=s|0,l=l|0,c=c|0,fMe(n[(AMe(s)|0)>>2]|0,l,c)}function AMe(s){return s=s|0,(n[(ZR()|0)+24>>2]|0)+(s<<3)|0}function fMe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0;f=C,C=C+16|0,m=f+1|0,d=f,F0(m,l),l=R0(m,l)|0,F0(d,c),c=R0(d,c)|0,tf[s&31](l,c),C=f}function pMe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0,m=0;m=n[s>>2]|0,d=$R()|0,s=hMe(c)|0,yn(m,l,d,s,gMe(c,f)|0,f)}function $R(){var s=0,l=0;if(o[8048]|0||(P7(10896),pr(66,10896,U|0)|0,l=8048,n[l>>2]=1,n[l+4>>2]=0),!(Nr(10896)|0)){s=10896,l=s+36|0;do n[s>>2]=0,s=s+4|0;while((s|0)<(l|0));P7(10896)}return 10896}function hMe(s){return s=s|0,s|0}function gMe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0,k=0,F=0;return k=C,C=C+16|0,d=k,m=k+4|0,n[d>>2]=s,F=$R()|0,B=F+24|0,l=dr(l,4)|0,n[m>>2]=l,c=F+28|0,f=n[c>>2]|0,f>>>0<(n[F+32>>2]|0)>>>0?(D7(f,s,l),l=(n[c>>2]|0)+8|0,n[c>>2]=l):(dMe(B,d,m),l=n[c>>2]|0),C=k,(l-(n[B>>2]|0)>>3)+-1|0}function D7(s,l,c){s=s|0,l=l|0,c=c|0,n[s>>2]=l,n[s+4>>2]=c}function dMe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0;if(k=C,C=C+32|0,d=k,m=s+4|0,B=((n[m>>2]|0)-(n[s>>2]|0)>>3)+1|0,f=mMe(s)|0,f>>>0>>0)Zr(s);else{F=n[s>>2]|0,O=(n[s+8>>2]|0)-F|0,M=O>>2,yMe(d,O>>3>>>0>>1>>>0?M>>>0>>0?B:M:f,(n[m>>2]|0)-F>>3,s+8|0),B=d+8|0,D7(n[B>>2]|0,n[l>>2]|0,n[c>>2]|0),n[B>>2]=(n[B>>2]|0)+8,EMe(s,d),CMe(d),C=k;return}}function mMe(s){return s=s|0,536870911}function yMe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0;n[s+12>>2]=0,n[s+16>>2]=f;do if(l)if(l>>>0>536870911)Tt();else{d=Yt(l<<3)|0;break}else d=0;while(!1);n[s>>2]=d,f=d+(c<<3)|0,n[s+8>>2]=f,n[s+4>>2]=f,n[s+12>>2]=d+(l<<3)}function EMe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0;f=n[s>>2]|0,B=s+4|0,m=l+4|0,d=(n[B>>2]|0)-f|0,c=(n[m>>2]|0)+(0-(d>>3)<<3)|0,n[m>>2]=c,(d|0)>0?(br(c|0,f|0,d|0)|0,f=m,c=n[m>>2]|0):f=m,m=n[s>>2]|0,n[s>>2]=c,n[f>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=s+8|0,B=l+12|0,s=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=s,n[l>>2]=n[f>>2]}function CMe(s){s=s|0;var l=0,c=0,f=0;l=n[s+4>>2]|0,c=s+8|0,f=n[c>>2]|0,(f|0)!=(l|0)&&(n[c>>2]=f+(~((f+-8-l|0)>>>3)<<3)),s=n[s>>2]|0,s|0&&yt(s)}function P7(s){s=s|0,BMe(s)}function IMe(s){s=s|0,wMe(s+24|0)}function wMe(s){s=s|0;var l=0,c=0,f=0;c=n[s>>2]|0,f=c,c|0&&(s=s+4|0,l=n[s>>2]|0,(l|0)!=(c|0)&&(n[s>>2]=l+(~((l+-8-f|0)>>>3)<<3)),yt(c))}function BMe(s){s=s|0;var l=0;l=zr()|0,Jr(s,1,11,l,vMe()|0,1),n[s+24>>2]=0,n[s+28>>2]=0,n[s+32>>2]=0}function vMe(){return 1852}function DMe(s,l){return s=s|0,l=l|0,SMe(n[(PMe(s)|0)>>2]|0,l)|0}function PMe(s){return s=s|0,(n[($R()|0)+24>>2]|0)+(s<<3)|0}function SMe(s,l){s=s|0,l=l|0;var c=0,f=0;return c=C,C=C+16|0,f=c,F0(f,l),l=R0(f,l)|0,l=RD(_0[s&31](l)|0)|0,C=c,l|0}function xMe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0,m=0;m=n[s>>2]|0,d=eT()|0,s=bMe(c)|0,yn(m,l,d,s,kMe(c,f)|0,f)}function eT(){var s=0,l=0;if(o[8056]|0||(x7(10932),pr(67,10932,U|0)|0,l=8056,n[l>>2]=1,n[l+4>>2]=0),!(Nr(10932)|0)){s=10932,l=s+36|0;do n[s>>2]=0,s=s+4|0;while((s|0)<(l|0));x7(10932)}return 10932}function bMe(s){return s=s|0,s|0}function kMe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0,k=0,F=0;return k=C,C=C+16|0,d=k,m=k+4|0,n[d>>2]=s,F=eT()|0,B=F+24|0,l=dr(l,4)|0,n[m>>2]=l,c=F+28|0,f=n[c>>2]|0,f>>>0<(n[F+32>>2]|0)>>>0?(S7(f,s,l),l=(n[c>>2]|0)+8|0,n[c>>2]=l):(QMe(B,d,m),l=n[c>>2]|0),C=k,(l-(n[B>>2]|0)>>3)+-1|0}function S7(s,l,c){s=s|0,l=l|0,c=c|0,n[s>>2]=l,n[s+4>>2]=c}function QMe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0;if(k=C,C=C+32|0,d=k,m=s+4|0,B=((n[m>>2]|0)-(n[s>>2]|0)>>3)+1|0,f=FMe(s)|0,f>>>0>>0)Zr(s);else{F=n[s>>2]|0,O=(n[s+8>>2]|0)-F|0,M=O>>2,RMe(d,O>>3>>>0>>1>>>0?M>>>0>>0?B:M:f,(n[m>>2]|0)-F>>3,s+8|0),B=d+8|0,S7(n[B>>2]|0,n[l>>2]|0,n[c>>2]|0),n[B>>2]=(n[B>>2]|0)+8,TMe(s,d),LMe(d),C=k;return}}function FMe(s){return s=s|0,536870911}function RMe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0;n[s+12>>2]=0,n[s+16>>2]=f;do if(l)if(l>>>0>536870911)Tt();else{d=Yt(l<<3)|0;break}else d=0;while(!1);n[s>>2]=d,f=d+(c<<3)|0,n[s+8>>2]=f,n[s+4>>2]=f,n[s+12>>2]=d+(l<<3)}function TMe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0;f=n[s>>2]|0,B=s+4|0,m=l+4|0,d=(n[B>>2]|0)-f|0,c=(n[m>>2]|0)+(0-(d>>3)<<3)|0,n[m>>2]=c,(d|0)>0?(br(c|0,f|0,d|0)|0,f=m,c=n[m>>2]|0):f=m,m=n[s>>2]|0,n[s>>2]=c,n[f>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=s+8|0,B=l+12|0,s=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=s,n[l>>2]=n[f>>2]}function LMe(s){s=s|0;var l=0,c=0,f=0;l=n[s+4>>2]|0,c=s+8|0,f=n[c>>2]|0,(f|0)!=(l|0)&&(n[c>>2]=f+(~((f+-8-l|0)>>>3)<<3)),s=n[s>>2]|0,s|0&&yt(s)}function x7(s){s=s|0,MMe(s)}function NMe(s){s=s|0,OMe(s+24|0)}function OMe(s){s=s|0;var l=0,c=0,f=0;c=n[s>>2]|0,f=c,c|0&&(s=s+4|0,l=n[s>>2]|0,(l|0)!=(c|0)&&(n[s>>2]=l+(~((l+-8-f|0)>>>3)<<3)),yt(c))}function MMe(s){s=s|0;var l=0;l=zr()|0,Jr(s,1,7,l,UMe()|0,2),n[s+24>>2]=0,n[s+28>>2]=0,n[s+32>>2]=0}function UMe(){return 1860}function _Me(s,l,c){return s=s|0,l=l|0,c=c|0,qMe(n[(HMe(s)|0)>>2]|0,l,c)|0}function HMe(s){return s=s|0,(n[(eT()|0)+24>>2]|0)+(s<<3)|0}function qMe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0,F=0;return f=C,C=C+32|0,B=f+12|0,m=f+8|0,k=f,F=f+16|0,d=f+4|0,jMe(F,l),GMe(k,F,l),xp(d,c),c=bp(d,c)|0,n[B>>2]=n[k>>2],sw[s&15](m,B,c),c=WMe(m)|0,bu(m),kp(d),C=f,c|0}function jMe(s,l){s=s|0,l=l|0}function GMe(s,l,c){s=s|0,l=l|0,c=c|0,YMe(s,c)}function WMe(s){return s=s|0,ys(s)|0}function YMe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0;d=C,C=C+16|0,c=d,f=l,f&1?(KMe(c,0),ia(f|0,c|0)|0,VMe(s,c),zMe(c)):n[s>>2]=n[l>>2],C=d}function KMe(s,l){s=s|0,l=l|0,Fc(s,l),n[s+4>>2]=0,o[s+8>>0]=0}function VMe(s,l){s=s|0,l=l|0,n[s>>2]=n[l+4>>2]}function zMe(s){s=s|0,o[s+8>>0]=0}function JMe(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0,m=0;m=n[s>>2]|0,d=tT()|0,s=XMe(c)|0,yn(m,l,d,s,ZMe(c,f)|0,f)}function tT(){var s=0,l=0;if(o[8064]|0||(k7(10968),pr(68,10968,U|0)|0,l=8064,n[l>>2]=1,n[l+4>>2]=0),!(Nr(10968)|0)){s=10968,l=s+36|0;do n[s>>2]=0,s=s+4|0;while((s|0)<(l|0));k7(10968)}return 10968}function XMe(s){return s=s|0,s|0}function ZMe(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0,k=0,F=0;return k=C,C=C+16|0,d=k,m=k+4|0,n[d>>2]=s,F=tT()|0,B=F+24|0,l=dr(l,4)|0,n[m>>2]=l,c=F+28|0,f=n[c>>2]|0,f>>>0<(n[F+32>>2]|0)>>>0?(b7(f,s,l),l=(n[c>>2]|0)+8|0,n[c>>2]=l):($Me(B,d,m),l=n[c>>2]|0),C=k,(l-(n[B>>2]|0)>>3)+-1|0}function b7(s,l,c){s=s|0,l=l|0,c=c|0,n[s>>2]=l,n[s+4>>2]=c}function $Me(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0;if(k=C,C=C+32|0,d=k,m=s+4|0,B=((n[m>>2]|0)-(n[s>>2]|0)>>3)+1|0,f=e4e(s)|0,f>>>0>>0)Zr(s);else{F=n[s>>2]|0,O=(n[s+8>>2]|0)-F|0,M=O>>2,t4e(d,O>>3>>>0>>1>>>0?M>>>0>>0?B:M:f,(n[m>>2]|0)-F>>3,s+8|0),B=d+8|0,b7(n[B>>2]|0,n[l>>2]|0,n[c>>2]|0),n[B>>2]=(n[B>>2]|0)+8,r4e(s,d),n4e(d),C=k;return}}function e4e(s){return s=s|0,536870911}function t4e(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0;n[s+12>>2]=0,n[s+16>>2]=f;do if(l)if(l>>>0>536870911)Tt();else{d=Yt(l<<3)|0;break}else d=0;while(!1);n[s>>2]=d,f=d+(c<<3)|0,n[s+8>>2]=f,n[s+4>>2]=f,n[s+12>>2]=d+(l<<3)}function r4e(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0;f=n[s>>2]|0,B=s+4|0,m=l+4|0,d=(n[B>>2]|0)-f|0,c=(n[m>>2]|0)+(0-(d>>3)<<3)|0,n[m>>2]=c,(d|0)>0?(br(c|0,f|0,d|0)|0,f=m,c=n[m>>2]|0):f=m,m=n[s>>2]|0,n[s>>2]=c,n[f>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=s+8|0,B=l+12|0,s=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=s,n[l>>2]=n[f>>2]}function n4e(s){s=s|0;var l=0,c=0,f=0;l=n[s+4>>2]|0,c=s+8|0,f=n[c>>2]|0,(f|0)!=(l|0)&&(n[c>>2]=f+(~((f+-8-l|0)>>>3)<<3)),s=n[s>>2]|0,s|0&&yt(s)}function k7(s){s=s|0,o4e(s)}function i4e(s){s=s|0,s4e(s+24|0)}function s4e(s){s=s|0;var l=0,c=0,f=0;c=n[s>>2]|0,f=c,c|0&&(s=s+4|0,l=n[s>>2]|0,(l|0)!=(c|0)&&(n[s>>2]=l+(~((l+-8-f|0)>>>3)<<3)),yt(c))}function o4e(s){s=s|0;var l=0;l=zr()|0,Jr(s,1,1,l,a4e()|0,5),n[s+24>>2]=0,n[s+28>>2]=0,n[s+32>>2]=0}function a4e(){return 1872}function l4e(s,l,c,f,d,m){s=s|0,l=l|0,c=c|0,f=f|0,d=d|0,m=m|0,u4e(n[(c4e(s)|0)>>2]|0,l,c,f,d,m)}function c4e(s){return s=s|0,(n[(tT()|0)+24>>2]|0)+(s<<3)|0}function u4e(s,l,c,f,d,m){s=s|0,l=l|0,c=c|0,f=f|0,d=d|0,m=m|0;var B=0,k=0,F=0,M=0,O=0,j=0;B=C,C=C+32|0,k=B+16|0,F=B+12|0,M=B+8|0,O=B+4|0,j=B,xp(k,l),l=bp(k,l)|0,xp(F,c),c=bp(F,c)|0,xp(M,f),f=bp(M,f)|0,xp(O,d),d=bp(O,d)|0,xp(j,m),m=bp(j,m)|0,Z7[s&1](l,c,f,d,m),kp(j),kp(O),kp(M),kp(F),kp(k),C=B}function A4e(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0,m=0;m=n[s>>2]|0,d=rT()|0,s=f4e(c)|0,yn(m,l,d,s,p4e(c,f)|0,f)}function rT(){var s=0,l=0;if(o[8072]|0||(F7(11004),pr(69,11004,U|0)|0,l=8072,n[l>>2]=1,n[l+4>>2]=0),!(Nr(11004)|0)){s=11004,l=s+36|0;do n[s>>2]=0,s=s+4|0;while((s|0)<(l|0));F7(11004)}return 11004}function f4e(s){return s=s|0,s|0}function p4e(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0,k=0,F=0;return k=C,C=C+16|0,d=k,m=k+4|0,n[d>>2]=s,F=rT()|0,B=F+24|0,l=dr(l,4)|0,n[m>>2]=l,c=F+28|0,f=n[c>>2]|0,f>>>0<(n[F+32>>2]|0)>>>0?(Q7(f,s,l),l=(n[c>>2]|0)+8|0,n[c>>2]=l):(h4e(B,d,m),l=n[c>>2]|0),C=k,(l-(n[B>>2]|0)>>3)+-1|0}function Q7(s,l,c){s=s|0,l=l|0,c=c|0,n[s>>2]=l,n[s+4>>2]=c}function h4e(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0;if(k=C,C=C+32|0,d=k,m=s+4|0,B=((n[m>>2]|0)-(n[s>>2]|0)>>3)+1|0,f=g4e(s)|0,f>>>0>>0)Zr(s);else{F=n[s>>2]|0,O=(n[s+8>>2]|0)-F|0,M=O>>2,d4e(d,O>>3>>>0>>1>>>0?M>>>0>>0?B:M:f,(n[m>>2]|0)-F>>3,s+8|0),B=d+8|0,Q7(n[B>>2]|0,n[l>>2]|0,n[c>>2]|0),n[B>>2]=(n[B>>2]|0)+8,m4e(s,d),y4e(d),C=k;return}}function g4e(s){return s=s|0,536870911}function d4e(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0;n[s+12>>2]=0,n[s+16>>2]=f;do if(l)if(l>>>0>536870911)Tt();else{d=Yt(l<<3)|0;break}else d=0;while(!1);n[s>>2]=d,f=d+(c<<3)|0,n[s+8>>2]=f,n[s+4>>2]=f,n[s+12>>2]=d+(l<<3)}function m4e(s,l){s=s|0,l=l|0;var c=0,f=0,d=0,m=0,B=0;f=n[s>>2]|0,B=s+4|0,m=l+4|0,d=(n[B>>2]|0)-f|0,c=(n[m>>2]|0)+(0-(d>>3)<<3)|0,n[m>>2]=c,(d|0)>0?(br(c|0,f|0,d|0)|0,f=m,c=n[m>>2]|0):f=m,m=n[s>>2]|0,n[s>>2]=c,n[f>>2]=m,m=l+8|0,d=n[B>>2]|0,n[B>>2]=n[m>>2],n[m>>2]=d,m=s+8|0,B=l+12|0,s=n[m>>2]|0,n[m>>2]=n[B>>2],n[B>>2]=s,n[l>>2]=n[f>>2]}function y4e(s){s=s|0;var l=0,c=0,f=0;l=n[s+4>>2]|0,c=s+8|0,f=n[c>>2]|0,(f|0)!=(l|0)&&(n[c>>2]=f+(~((f+-8-l|0)>>>3)<<3)),s=n[s>>2]|0,s|0&&yt(s)}function F7(s){s=s|0,I4e(s)}function E4e(s){s=s|0,C4e(s+24|0)}function C4e(s){s=s|0;var l=0,c=0,f=0;c=n[s>>2]|0,f=c,c|0&&(s=s+4|0,l=n[s>>2]|0,(l|0)!=(c|0)&&(n[s>>2]=l+(~((l+-8-f|0)>>>3)<<3)),yt(c))}function I4e(s){s=s|0;var l=0;l=zr()|0,Jr(s,1,12,l,w4e()|0,2),n[s+24>>2]=0,n[s+28>>2]=0,n[s+32>>2]=0}function w4e(){return 1896}function B4e(s,l,c){s=s|0,l=l|0,c=c|0,D4e(n[(v4e(s)|0)>>2]|0,l,c)}function v4e(s){return s=s|0,(n[(rT()|0)+24>>2]|0)+(s<<3)|0}function D4e(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0;f=C,C=C+16|0,m=f+4|0,d=f,P4e(m,l),l=S4e(m,l)|0,xp(d,c),c=bp(d,c)|0,tf[s&31](l,c),kp(d),C=f}function P4e(s,l){s=s|0,l=l|0}function S4e(s,l){return s=s|0,l=l|0,x4e(l)|0}function x4e(s){return s=s|0,s|0}function b4e(){var s=0;return o[8080]|0||(R7(11040),pr(70,11040,U|0)|0,s=8080,n[s>>2]=1,n[s+4>>2]=0),Nr(11040)|0||R7(11040),11040}function R7(s){s=s|0,F4e(s),L0(s,71)}function k4e(s){s=s|0,Q4e(s+24|0)}function Q4e(s){s=s|0;var l=0,c=0,f=0;c=n[s>>2]|0,f=c,c|0&&(s=s+4|0,l=n[s>>2]|0,(l|0)!=(c|0)&&(n[s>>2]=l+(~((l+-8-f|0)>>>3)<<3)),yt(c))}function F4e(s){s=s|0;var l=0;l=zr()|0,Jr(s,5,7,l,N4e()|0,0),n[s+24>>2]=0,n[s+28>>2]=0,n[s+32>>2]=0}function R4e(s){s=s|0,T4e(s)}function T4e(s){s=s|0,L4e(s)}function L4e(s){s=s|0,o[s+8>>0]=1}function N4e(){return 1936}function O4e(){return M4e()|0}function M4e(){var s=0,l=0,c=0,f=0,d=0,m=0,B=0;return l=C,C=C+16|0,d=l+4|0,B=l,c=Za(8)|0,s=c,m=s+4|0,n[m>>2]=Yt(1)|0,f=Yt(8)|0,m=n[m>>2]|0,n[B>>2]=0,n[d>>2]=n[B>>2],U4e(f,m,d),n[c>>2]=f,C=l,s|0}function U4e(s,l,c){s=s|0,l=l|0,c=c|0,n[s>>2]=l,c=Yt(16)|0,n[c+4>>2]=0,n[c+8>>2]=0,n[c>>2]=1916,n[c+12>>2]=l,n[s+4>>2]=c}function _4e(s){s=s|0,im(s),yt(s)}function H4e(s){s=s|0,s=n[s+12>>2]|0,s|0&&yt(s)}function q4e(s){s=s|0,yt(s)}function j4e(){var s=0;return o[8088]|0||(J4e(11076),pr(25,11076,U|0)|0,s=8088,n[s>>2]=1,n[s+4>>2]=0),11076}function G4e(s,l){s=s|0,l=l|0,n[s>>2]=W4e()|0,n[s+4>>2]=Y4e()|0,n[s+12>>2]=l,n[s+8>>2]=K4e()|0,n[s+32>>2]=10}function W4e(){return 11745}function Y4e(){return 1940}function K4e(){return TD()|0}function V4e(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0,(Qp(f,896)|0)==512?c|0&&(z4e(c),yt(c)):l|0&&yt(l)}function z4e(s){s=s|0,s=n[s+4>>2]|0,s|0&&Rp(s)}function J4e(s){s=s|0,Sp(s)}function Tc(s,l){s=s|0,l=l|0,n[s>>2]=l}function nT(s){return s=s|0,n[s>>2]|0}function X4e(s){return s=s|0,o[n[s>>2]>>0]|0}function Z4e(s,l){s=s|0,l=l|0;var c=0,f=0;c=C,C=C+16|0,f=c,n[f>>2]=n[s>>2],$4e(l,f)|0,C=c}function $4e(s,l){s=s|0,l=l|0;var c=0;return c=eUe(n[s>>2]|0,l)|0,l=s+4|0,n[(n[l>>2]|0)+8>>2]=c,n[(n[l>>2]|0)+8>>2]|0}function eUe(s,l){s=s|0,l=l|0;var c=0,f=0;return c=C,C=C+16|0,f=c,$a(f),s=ys(s)|0,l=tUe(s,n[l>>2]|0)|0,el(f),C=c,l|0}function $a(s){s=s|0,n[s>>2]=n[2701],n[s+4>>2]=n[2703]}function tUe(s,l){s=s|0,l=l|0;var c=0;return c=jo(rUe()|0)|0,un(0,c|0,s|0,JR(l)|0)|0}function el(s){s=s|0,w7(n[s>>2]|0,n[s+4>>2]|0)}function rUe(){var s=0;return o[8096]|0||(nUe(11120),s=8096,n[s>>2]=1,n[s+4>>2]=0),11120}function nUe(s){s=s|0,ao(s,iUe()|0,1)}function iUe(){return 1948}function sUe(){oUe()}function oUe(){var s=0,l=0,c=0,f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0,j=0,oe=0,We=0,Oe=0,Qe=0;if(Oe=C,C=C+16|0,O=Oe+4|0,j=Oe,Ro(65536,10804,n[2702]|0,10812),c=n7()|0,l=n[c>>2]|0,s=n[l>>2]|0,s|0)for(f=n[c+8>>2]|0,c=n[c+4>>2]|0;du(s|0,u[c>>0]|0|0,o[f>>0]|0),l=l+4|0,s=n[l>>2]|0,s;)f=f+1|0,c=c+1|0;if(s=i7()|0,l=n[s>>2]|0,l|0)do QA(l|0,n[s+4>>2]|0),s=s+8|0,l=n[s>>2]|0;while(l|0);QA(aUe()|0,5167),M=$d()|0,s=n[M>>2]|0;e:do if(s|0){do lUe(n[s+4>>2]|0),s=n[s>>2]|0;while(s|0);if(s=n[M>>2]|0,s|0){F=M;do{for(;d=s,s=n[s>>2]|0,d=n[d+4>>2]|0,!!(cUe(d)|0);)if(n[j>>2]=F,n[O>>2]=n[j>>2],uUe(M,O)|0,!s)break e;if(AUe(d),F=n[F>>2]|0,l=T7(d)|0,m=Bi()|0,B=C,C=C+((1*(l<<2)|0)+15&-16)|0,k=C,C=C+((1*(l<<2)|0)+15&-16)|0,l=n[(d7(d)|0)>>2]|0,l|0)for(c=B,f=k;n[c>>2]=n[(em(n[l+4>>2]|0)|0)>>2],n[f>>2]=n[l+8>>2],l=n[l>>2]|0,l;)c=c+4|0,f=f+4|0;Qe=em(d)|0,l=fUe(d)|0,c=T7(d)|0,f=pUe(d)|0,Il(Qe|0,l|0,B|0,k|0,c|0,f|0,GR(d)|0),kA(m|0)}while(s|0)}}while(!1);if(s=n[(WR()|0)>>2]|0,s|0)do Qe=s+4|0,M=YR(Qe)|0,d=tw(M)|0,m=$I(M)|0,B=(ew(M)|0)+1|0,k=UD(M)|0,F=L7(Qe)|0,M=Nr(M)|0,O=ND(Qe)|0,j=iT(Qe)|0,mc(0,d|0,m|0,B|0,k|0,F|0,M|0,O|0,j|0,sT(Qe)|0),s=n[s>>2]|0;while(s|0);s=n[($d()|0)>>2]|0;e:do if(s|0){t:for(;;){if(l=n[s+4>>2]|0,l|0&&(oe=n[(em(l)|0)>>2]|0,We=n[(m7(l)|0)>>2]|0,We|0)){c=We;do{l=c+4|0,f=YR(l)|0;r:do if(f|0)switch(Nr(f)|0){case 0:break t;case 4:case 3:case 2:{k=tw(f)|0,F=$I(f)|0,M=(ew(f)|0)+1|0,O=UD(f)|0,j=Nr(f)|0,Qe=ND(l)|0,mc(oe|0,k|0,F|0,M|0,O|0,0,j|0,Qe|0,iT(l)|0,sT(l)|0);break r}case 1:{B=tw(f)|0,k=$I(f)|0,F=(ew(f)|0)+1|0,M=UD(f)|0,O=L7(l)|0,j=Nr(f)|0,Qe=ND(l)|0,mc(oe|0,B|0,k|0,F|0,M|0,O|0,j|0,Qe|0,iT(l)|0,sT(l)|0);break r}case 5:{M=tw(f)|0,O=$I(f)|0,j=(ew(f)|0)+1|0,Qe=UD(f)|0,mc(oe|0,M|0,O|0,j|0,Qe|0,hUe(f)|0,Nr(f)|0,0,0,0);break r}default:break r}while(!1);c=n[c>>2]|0}while(c|0)}if(s=n[s>>2]|0,!s)break e}Tt()}while(!1);we(),C=Oe}function aUe(){return 11703}function lUe(s){s=s|0,o[s+40>>0]=0}function cUe(s){return s=s|0,(o[s+40>>0]|0)!=0|0}function uUe(s,l){return s=s|0,l=l|0,l=gUe(l)|0,s=n[l>>2]|0,n[l>>2]=n[s>>2],yt(s),n[l>>2]|0}function AUe(s){s=s|0,o[s+40>>0]=1}function T7(s){return s=s|0,n[s+20>>2]|0}function fUe(s){return s=s|0,n[s+8>>2]|0}function pUe(s){return s=s|0,n[s+32>>2]|0}function UD(s){return s=s|0,n[s+4>>2]|0}function L7(s){return s=s|0,n[s+4>>2]|0}function iT(s){return s=s|0,n[s+8>>2]|0}function sT(s){return s=s|0,n[s+16>>2]|0}function hUe(s){return s=s|0,n[s+20>>2]|0}function gUe(s){return s=s|0,n[s>>2]|0}function _D(s){s=s|0;var l=0,c=0,f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0,j=0,oe=0,We=0,Oe=0,Qe=0,rt=0,Xe=0,ct=0,_e=0,Ge=0,Nt=0;Nt=C,C=C+16|0,oe=Nt;do if(s>>>0<245){if(M=s>>>0<11?16:s+11&-8,s=M>>>3,j=n[2783]|0,c=j>>>s,c&3|0)return l=(c&1^1)+s|0,s=11172+(l<<1<<2)|0,c=s+8|0,f=n[c>>2]|0,d=f+8|0,m=n[d>>2]|0,(s|0)==(m|0)?n[2783]=j&~(1<>2]=s,n[c>>2]=m),Ge=l<<3,n[f+4>>2]=Ge|3,Ge=f+Ge+4|0,n[Ge>>2]=n[Ge>>2]|1,Ge=d,C=Nt,Ge|0;if(O=n[2785]|0,M>>>0>O>>>0){if(c|0)return l=2<>>12&16,l=l>>>B,c=l>>>5&8,l=l>>>c,d=l>>>2&4,l=l>>>d,s=l>>>1&2,l=l>>>s,f=l>>>1&1,f=(c|B|d|s|f)+(l>>>f)|0,l=11172+(f<<1<<2)|0,s=l+8|0,d=n[s>>2]|0,B=d+8|0,c=n[B>>2]|0,(l|0)==(c|0)?(s=j&~(1<>2]=l,n[s>>2]=c,s=j),m=(f<<3)-M|0,n[d+4>>2]=M|3,f=d+M|0,n[f+4>>2]=m|1,n[f+m>>2]=m,O|0&&(d=n[2788]|0,l=O>>>3,c=11172+(l<<1<<2)|0,l=1<>2]|0):(n[2783]=s|l,l=c,s=c+8|0),n[s>>2]=d,n[l+12>>2]=d,n[d+8>>2]=l,n[d+12>>2]=c),n[2785]=m,n[2788]=f,Ge=B,C=Nt,Ge|0;if(k=n[2784]|0,k){if(c=(k&0-k)+-1|0,B=c>>>12&16,c=c>>>B,m=c>>>5&8,c=c>>>m,F=c>>>2&4,c=c>>>F,f=c>>>1&2,c=c>>>f,s=c>>>1&1,s=n[11436+((m|B|F|f|s)+(c>>>s)<<2)>>2]|0,c=(n[s+4>>2]&-8)-M|0,f=n[s+16+(((n[s+16>>2]|0)==0&1)<<2)>>2]|0,!f)F=s,m=c;else{do B=(n[f+4>>2]&-8)-M|0,F=B>>>0>>0,c=F?B:c,s=F?f:s,f=n[f+16+(((n[f+16>>2]|0)==0&1)<<2)>>2]|0;while(f|0);F=s,m=c}if(B=F+M|0,F>>>0>>0){d=n[F+24>>2]|0,l=n[F+12>>2]|0;do if((l|0)==(F|0)){if(s=F+20|0,l=n[s>>2]|0,!l&&(s=F+16|0,l=n[s>>2]|0,!l)){c=0;break}for(;;){if(c=l+20|0,f=n[c>>2]|0,f|0){l=f,s=c;continue}if(c=l+16|0,f=n[c>>2]|0,f)l=f,s=c;else break}n[s>>2]=0,c=l}else c=n[F+8>>2]|0,n[c+12>>2]=l,n[l+8>>2]=c,c=l;while(!1);do if(d|0){if(l=n[F+28>>2]|0,s=11436+(l<<2)|0,(F|0)==(n[s>>2]|0)){if(n[s>>2]=c,!c){n[2784]=k&~(1<>2]|0)!=(F|0)&1)<<2)>>2]=c,!c)break;n[c+24>>2]=d,l=n[F+16>>2]|0,l|0&&(n[c+16>>2]=l,n[l+24>>2]=c),l=n[F+20>>2]|0,l|0&&(n[c+20>>2]=l,n[l+24>>2]=c)}while(!1);return m>>>0<16?(Ge=m+M|0,n[F+4>>2]=Ge|3,Ge=F+Ge+4|0,n[Ge>>2]=n[Ge>>2]|1):(n[F+4>>2]=M|3,n[B+4>>2]=m|1,n[B+m>>2]=m,O|0&&(f=n[2788]|0,l=O>>>3,c=11172+(l<<1<<2)|0,l=1<>2]|0):(n[2783]=j|l,l=c,s=c+8|0),n[s>>2]=f,n[l+12>>2]=f,n[f+8>>2]=l,n[f+12>>2]=c),n[2785]=m,n[2788]=B),Ge=F+8|0,C=Nt,Ge|0}else j=M}else j=M}else j=M}else if(s>>>0<=4294967231)if(s=s+11|0,M=s&-8,F=n[2784]|0,F){f=0-M|0,s=s>>>8,s?M>>>0>16777215?k=31:(j=(s+1048320|0)>>>16&8,_e=s<>>16&4,_e=_e<>>16&2,k=14-(O|j|k)+(_e<>>15)|0,k=M>>>(k+7|0)&1|k<<1):k=0,c=n[11436+(k<<2)>>2]|0;e:do if(!c)c=0,s=0,_e=57;else for(s=0,B=M<<((k|0)==31?0:25-(k>>>1)|0),m=0;;){if(d=(n[c+4>>2]&-8)-M|0,d>>>0>>0)if(d)s=c,f=d;else{s=c,f=0,d=c,_e=61;break e}if(d=n[c+20>>2]|0,c=n[c+16+(B>>>31<<2)>>2]|0,m=(d|0)==0|(d|0)==(c|0)?m:d,d=(c|0)==0,d){c=m,_e=57;break}else B=B<<((d^1)&1)}while(!1);if((_e|0)==57){if((c|0)==0&(s|0)==0){if(s=2<>>12&16,j=j>>>B,m=j>>>5&8,j=j>>>m,k=j>>>2&4,j=j>>>k,O=j>>>1&2,j=j>>>O,c=j>>>1&1,s=0,c=n[11436+((m|B|k|O|c)+(j>>>c)<<2)>>2]|0}c?(d=c,_e=61):(k=s,B=f)}if((_e|0)==61)for(;;)if(_e=0,c=(n[d+4>>2]&-8)-M|0,j=c>>>0>>0,c=j?c:f,s=j?d:s,d=n[d+16+(((n[d+16>>2]|0)==0&1)<<2)>>2]|0,d)f=c,_e=61;else{k=s,B=c;break}if(k|0&&B>>>0<((n[2785]|0)-M|0)>>>0){if(m=k+M|0,k>>>0>=m>>>0)return Ge=0,C=Nt,Ge|0;d=n[k+24>>2]|0,l=n[k+12>>2]|0;do if((l|0)==(k|0)){if(s=k+20|0,l=n[s>>2]|0,!l&&(s=k+16|0,l=n[s>>2]|0,!l)){l=0;break}for(;;){if(c=l+20|0,f=n[c>>2]|0,f|0){l=f,s=c;continue}if(c=l+16|0,f=n[c>>2]|0,f)l=f,s=c;else break}n[s>>2]=0}else Ge=n[k+8>>2]|0,n[Ge+12>>2]=l,n[l+8>>2]=Ge;while(!1);do if(d){if(s=n[k+28>>2]|0,c=11436+(s<<2)|0,(k|0)==(n[c>>2]|0)){if(n[c>>2]=l,!l){f=F&~(1<>2]|0)!=(k|0)&1)<<2)>>2]=l,!l){f=F;break}n[l+24>>2]=d,s=n[k+16>>2]|0,s|0&&(n[l+16>>2]=s,n[s+24>>2]=l),s=n[k+20>>2]|0,s&&(n[l+20>>2]=s,n[s+24>>2]=l),f=F}else f=F;while(!1);do if(B>>>0>=16){if(n[k+4>>2]=M|3,n[m+4>>2]=B|1,n[m+B>>2]=B,l=B>>>3,B>>>0<256){c=11172+(l<<1<<2)|0,s=n[2783]|0,l=1<>2]|0):(n[2783]=s|l,l=c,s=c+8|0),n[s>>2]=m,n[l+12>>2]=m,n[m+8>>2]=l,n[m+12>>2]=c;break}if(l=B>>>8,l?B>>>0>16777215?l=31:(_e=(l+1048320|0)>>>16&8,Ge=l<<_e,ct=(Ge+520192|0)>>>16&4,Ge=Ge<>>16&2,l=14-(ct|_e|l)+(Ge<>>15)|0,l=B>>>(l+7|0)&1|l<<1):l=0,c=11436+(l<<2)|0,n[m+28>>2]=l,s=m+16|0,n[s+4>>2]=0,n[s>>2]=0,s=1<>2]=m,n[m+24>>2]=c,n[m+12>>2]=m,n[m+8>>2]=m;break}for(s=B<<((l|0)==31?0:25-(l>>>1)|0),c=n[c>>2]|0;;){if((n[c+4>>2]&-8|0)==(B|0)){_e=97;break}if(f=c+16+(s>>>31<<2)|0,l=n[f>>2]|0,l)s=s<<1,c=l;else{_e=96;break}}if((_e|0)==96){n[f>>2]=m,n[m+24>>2]=c,n[m+12>>2]=m,n[m+8>>2]=m;break}else if((_e|0)==97){_e=c+8|0,Ge=n[_e>>2]|0,n[Ge+12>>2]=m,n[_e>>2]=m,n[m+8>>2]=Ge,n[m+12>>2]=c,n[m+24>>2]=0;break}}else Ge=B+M|0,n[k+4>>2]=Ge|3,Ge=k+Ge+4|0,n[Ge>>2]=n[Ge>>2]|1;while(!1);return Ge=k+8|0,C=Nt,Ge|0}else j=M}else j=M;else j=-1;while(!1);if(c=n[2785]|0,c>>>0>=j>>>0)return l=c-j|0,s=n[2788]|0,l>>>0>15?(Ge=s+j|0,n[2788]=Ge,n[2785]=l,n[Ge+4>>2]=l|1,n[Ge+l>>2]=l,n[s+4>>2]=j|3):(n[2785]=0,n[2788]=0,n[s+4>>2]=c|3,Ge=s+c+4|0,n[Ge>>2]=n[Ge>>2]|1),Ge=s+8|0,C=Nt,Ge|0;if(B=n[2786]|0,B>>>0>j>>>0)return ct=B-j|0,n[2786]=ct,Ge=n[2789]|0,_e=Ge+j|0,n[2789]=_e,n[_e+4>>2]=ct|1,n[Ge+4>>2]=j|3,Ge=Ge+8|0,C=Nt,Ge|0;if(n[2901]|0?s=n[2903]|0:(n[2903]=4096,n[2902]=4096,n[2904]=-1,n[2905]=-1,n[2906]=0,n[2894]=0,s=oe&-16^1431655768,n[oe>>2]=s,n[2901]=s,s=4096),k=j+48|0,F=j+47|0,m=s+F|0,d=0-s|0,M=m&d,M>>>0<=j>>>0||(s=n[2893]|0,s|0&&(O=n[2891]|0,oe=O+M|0,oe>>>0<=O>>>0|oe>>>0>s>>>0)))return Ge=0,C=Nt,Ge|0;e:do if(n[2894]&4)l=0,_e=133;else{c=n[2789]|0;t:do if(c){for(f=11580;s=n[f>>2]|0,!(s>>>0<=c>>>0&&(Qe=f+4|0,(s+(n[Qe>>2]|0)|0)>>>0>c>>>0));)if(s=n[f+8>>2]|0,s)f=s;else{_e=118;break t}if(l=m-B&d,l>>>0<2147483647)if(s=Tp(l|0)|0,(s|0)==((n[f>>2]|0)+(n[Qe>>2]|0)|0)){if((s|0)!=-1){B=l,m=s,_e=135;break e}}else f=s,_e=126;else l=0}else _e=118;while(!1);do if((_e|0)==118)if(c=Tp(0)|0,(c|0)!=-1&&(l=c,We=n[2902]|0,Oe=We+-1|0,l=(Oe&l|0?(Oe+l&0-We)-l|0:0)+M|0,We=n[2891]|0,Oe=l+We|0,l>>>0>j>>>0&l>>>0<2147483647)){if(Qe=n[2893]|0,Qe|0&&Oe>>>0<=We>>>0|Oe>>>0>Qe>>>0){l=0;break}if(s=Tp(l|0)|0,(s|0)==(c|0)){B=l,m=c,_e=135;break e}else f=s,_e=126}else l=0;while(!1);do if((_e|0)==126){if(c=0-l|0,!(k>>>0>l>>>0&(l>>>0<2147483647&(f|0)!=-1)))if((f|0)==-1){l=0;break}else{B=l,m=f,_e=135;break e}if(s=n[2903]|0,s=F-l+s&0-s,s>>>0>=2147483647){B=l,m=f,_e=135;break e}if((Tp(s|0)|0)==-1){Tp(c|0)|0,l=0;break}else{B=s+l|0,m=f,_e=135;break e}}while(!1);n[2894]=n[2894]|4,_e=133}while(!1);if((_e|0)==133&&M>>>0<2147483647&&(ct=Tp(M|0)|0,Qe=Tp(0)|0,rt=Qe-ct|0,Xe=rt>>>0>(j+40|0)>>>0,!((ct|0)==-1|Xe^1|ct>>>0>>0&((ct|0)!=-1&(Qe|0)!=-1)^1))&&(B=Xe?rt:l,m=ct,_e=135),(_e|0)==135){l=(n[2891]|0)+B|0,n[2891]=l,l>>>0>(n[2892]|0)>>>0&&(n[2892]=l),F=n[2789]|0;do if(F){for(l=11580;;){if(s=n[l>>2]|0,c=l+4|0,f=n[c>>2]|0,(m|0)==(s+f|0)){_e=145;break}if(d=n[l+8>>2]|0,d)l=d;else break}if((_e|0)==145&&!(n[l+12>>2]&8|0)&&F>>>0>>0&F>>>0>=s>>>0){n[c>>2]=f+B,Ge=F+8|0,Ge=Ge&7|0?0-Ge&7:0,_e=F+Ge|0,Ge=(n[2786]|0)+(B-Ge)|0,n[2789]=_e,n[2786]=Ge,n[_e+4>>2]=Ge|1,n[_e+Ge+4>>2]=40,n[2790]=n[2905];break}for(m>>>0<(n[2787]|0)>>>0&&(n[2787]=m),c=m+B|0,l=11580;;){if((n[l>>2]|0)==(c|0)){_e=153;break}if(s=n[l+8>>2]|0,s)l=s;else break}if((_e|0)==153&&!(n[l+12>>2]&8|0)){n[l>>2]=m,O=l+4|0,n[O>>2]=(n[O>>2]|0)+B,O=m+8|0,O=m+(O&7|0?0-O&7:0)|0,l=c+8|0,l=c+(l&7|0?0-l&7:0)|0,M=O+j|0,k=l-O-j|0,n[O+4>>2]=j|3;do if((l|0)!=(F|0)){if((l|0)==(n[2788]|0)){Ge=(n[2785]|0)+k|0,n[2785]=Ge,n[2788]=M,n[M+4>>2]=Ge|1,n[M+Ge>>2]=Ge;break}if(s=n[l+4>>2]|0,(s&3|0)==1){B=s&-8,f=s>>>3;e:do if(s>>>0<256)if(s=n[l+8>>2]|0,c=n[l+12>>2]|0,(c|0)==(s|0)){n[2783]=n[2783]&~(1<>2]=c,n[c+8>>2]=s;break}else{m=n[l+24>>2]|0,s=n[l+12>>2]|0;do if((s|0)==(l|0)){if(f=l+16|0,c=f+4|0,s=n[c>>2]|0,!s)if(s=n[f>>2]|0,s)c=f;else{s=0;break}for(;;){if(f=s+20|0,d=n[f>>2]|0,d|0){s=d,c=f;continue}if(f=s+16|0,d=n[f>>2]|0,d)s=d,c=f;else break}n[c>>2]=0}else Ge=n[l+8>>2]|0,n[Ge+12>>2]=s,n[s+8>>2]=Ge;while(!1);if(!m)break;c=n[l+28>>2]|0,f=11436+(c<<2)|0;do if((l|0)!=(n[f>>2]|0)){if(n[m+16+(((n[m+16>>2]|0)!=(l|0)&1)<<2)>>2]=s,!s)break e}else{if(n[f>>2]=s,s|0)break;n[2784]=n[2784]&~(1<>2]=m,c=l+16|0,f=n[c>>2]|0,f|0&&(n[s+16>>2]=f,n[f+24>>2]=s),c=n[c+4>>2]|0,!c)break;n[s+20>>2]=c,n[c+24>>2]=s}while(!1);l=l+B|0,d=B+k|0}else d=k;if(l=l+4|0,n[l>>2]=n[l>>2]&-2,n[M+4>>2]=d|1,n[M+d>>2]=d,l=d>>>3,d>>>0<256){c=11172+(l<<1<<2)|0,s=n[2783]|0,l=1<>2]|0):(n[2783]=s|l,l=c,s=c+8|0),n[s>>2]=M,n[l+12>>2]=M,n[M+8>>2]=l,n[M+12>>2]=c;break}l=d>>>8;do if(!l)l=0;else{if(d>>>0>16777215){l=31;break}_e=(l+1048320|0)>>>16&8,Ge=l<<_e,ct=(Ge+520192|0)>>>16&4,Ge=Ge<>>16&2,l=14-(ct|_e|l)+(Ge<>>15)|0,l=d>>>(l+7|0)&1|l<<1}while(!1);if(f=11436+(l<<2)|0,n[M+28>>2]=l,s=M+16|0,n[s+4>>2]=0,n[s>>2]=0,s=n[2784]|0,c=1<>2]=M,n[M+24>>2]=f,n[M+12>>2]=M,n[M+8>>2]=M;break}for(s=d<<((l|0)==31?0:25-(l>>>1)|0),c=n[f>>2]|0;;){if((n[c+4>>2]&-8|0)==(d|0)){_e=194;break}if(f=c+16+(s>>>31<<2)|0,l=n[f>>2]|0,l)s=s<<1,c=l;else{_e=193;break}}if((_e|0)==193){n[f>>2]=M,n[M+24>>2]=c,n[M+12>>2]=M,n[M+8>>2]=M;break}else if((_e|0)==194){_e=c+8|0,Ge=n[_e>>2]|0,n[Ge+12>>2]=M,n[_e>>2]=M,n[M+8>>2]=Ge,n[M+12>>2]=c,n[M+24>>2]=0;break}}else Ge=(n[2786]|0)+k|0,n[2786]=Ge,n[2789]=M,n[M+4>>2]=Ge|1;while(!1);return Ge=O+8|0,C=Nt,Ge|0}for(l=11580;s=n[l>>2]|0,!(s>>>0<=F>>>0&&(Ge=s+(n[l+4>>2]|0)|0,Ge>>>0>F>>>0));)l=n[l+8>>2]|0;d=Ge+-47|0,s=d+8|0,s=d+(s&7|0?0-s&7:0)|0,d=F+16|0,s=s>>>0>>0?F:s,l=s+8|0,c=m+8|0,c=c&7|0?0-c&7:0,_e=m+c|0,c=B+-40-c|0,n[2789]=_e,n[2786]=c,n[_e+4>>2]=c|1,n[_e+c+4>>2]=40,n[2790]=n[2905],c=s+4|0,n[c>>2]=27,n[l>>2]=n[2895],n[l+4>>2]=n[2896],n[l+8>>2]=n[2897],n[l+12>>2]=n[2898],n[2895]=m,n[2896]=B,n[2898]=0,n[2897]=l,l=s+24|0;do _e=l,l=l+4|0,n[l>>2]=7;while((_e+8|0)>>>0>>0);if((s|0)!=(F|0)){if(m=s-F|0,n[c>>2]=n[c>>2]&-2,n[F+4>>2]=m|1,n[s>>2]=m,l=m>>>3,m>>>0<256){c=11172+(l<<1<<2)|0,s=n[2783]|0,l=1<>2]|0):(n[2783]=s|l,l=c,s=c+8|0),n[s>>2]=F,n[l+12>>2]=F,n[F+8>>2]=l,n[F+12>>2]=c;break}if(l=m>>>8,l?m>>>0>16777215?c=31:(_e=(l+1048320|0)>>>16&8,Ge=l<<_e,ct=(Ge+520192|0)>>>16&4,Ge=Ge<>>16&2,c=14-(ct|_e|c)+(Ge<>>15)|0,c=m>>>(c+7|0)&1|c<<1):c=0,f=11436+(c<<2)|0,n[F+28>>2]=c,n[F+20>>2]=0,n[d>>2]=0,l=n[2784]|0,s=1<>2]=F,n[F+24>>2]=f,n[F+12>>2]=F,n[F+8>>2]=F;break}for(s=m<<((c|0)==31?0:25-(c>>>1)|0),c=n[f>>2]|0;;){if((n[c+4>>2]&-8|0)==(m|0)){_e=216;break}if(f=c+16+(s>>>31<<2)|0,l=n[f>>2]|0,l)s=s<<1,c=l;else{_e=215;break}}if((_e|0)==215){n[f>>2]=F,n[F+24>>2]=c,n[F+12>>2]=F,n[F+8>>2]=F;break}else if((_e|0)==216){_e=c+8|0,Ge=n[_e>>2]|0,n[Ge+12>>2]=F,n[_e>>2]=F,n[F+8>>2]=Ge,n[F+12>>2]=c,n[F+24>>2]=0;break}}}else{Ge=n[2787]|0,(Ge|0)==0|m>>>0>>0&&(n[2787]=m),n[2895]=m,n[2896]=B,n[2898]=0,n[2792]=n[2901],n[2791]=-1,l=0;do Ge=11172+(l<<1<<2)|0,n[Ge+12>>2]=Ge,n[Ge+8>>2]=Ge,l=l+1|0;while((l|0)!=32);Ge=m+8|0,Ge=Ge&7|0?0-Ge&7:0,_e=m+Ge|0,Ge=B+-40-Ge|0,n[2789]=_e,n[2786]=Ge,n[_e+4>>2]=Ge|1,n[_e+Ge+4>>2]=40,n[2790]=n[2905]}while(!1);if(l=n[2786]|0,l>>>0>j>>>0)return ct=l-j|0,n[2786]=ct,Ge=n[2789]|0,_e=Ge+j|0,n[2789]=_e,n[_e+4>>2]=ct|1,n[Ge+4>>2]=j|3,Ge=Ge+8|0,C=Nt,Ge|0}return n[(rm()|0)>>2]=12,Ge=0,C=Nt,Ge|0}function HD(s){s=s|0;var l=0,c=0,f=0,d=0,m=0,B=0,k=0,F=0;if(s){c=s+-8|0,d=n[2787]|0,s=n[s+-4>>2]|0,l=s&-8,F=c+l|0;do if(s&1)k=c,B=c;else{if(f=n[c>>2]|0,!(s&3)||(B=c+(0-f)|0,m=f+l|0,B>>>0>>0))return;if((B|0)==(n[2788]|0)){if(s=F+4|0,l=n[s>>2]|0,(l&3|0)!=3){k=B,l=m;break}n[2785]=m,n[s>>2]=l&-2,n[B+4>>2]=m|1,n[B+m>>2]=m;return}if(c=f>>>3,f>>>0<256)if(s=n[B+8>>2]|0,l=n[B+12>>2]|0,(l|0)==(s|0)){n[2783]=n[2783]&~(1<>2]=l,n[l+8>>2]=s,k=B,l=m;break}d=n[B+24>>2]|0,s=n[B+12>>2]|0;do if((s|0)==(B|0)){if(c=B+16|0,l=c+4|0,s=n[l>>2]|0,!s)if(s=n[c>>2]|0,s)l=c;else{s=0;break}for(;;){if(c=s+20|0,f=n[c>>2]|0,f|0){s=f,l=c;continue}if(c=s+16|0,f=n[c>>2]|0,f)s=f,l=c;else break}n[l>>2]=0}else k=n[B+8>>2]|0,n[k+12>>2]=s,n[s+8>>2]=k;while(!1);if(d){if(l=n[B+28>>2]|0,c=11436+(l<<2)|0,(B|0)==(n[c>>2]|0)){if(n[c>>2]=s,!s){n[2784]=n[2784]&~(1<>2]|0)!=(B|0)&1)<<2)>>2]=s,!s){k=B,l=m;break}n[s+24>>2]=d,l=B+16|0,c=n[l>>2]|0,c|0&&(n[s+16>>2]=c,n[c+24>>2]=s),l=n[l+4>>2]|0,l?(n[s+20>>2]=l,n[l+24>>2]=s,k=B,l=m):(k=B,l=m)}else k=B,l=m}while(!1);if(!(B>>>0>=F>>>0)&&(s=F+4|0,f=n[s>>2]|0,!!(f&1))){if(f&2)n[s>>2]=f&-2,n[k+4>>2]=l|1,n[B+l>>2]=l,d=l;else{if(s=n[2788]|0,(F|0)==(n[2789]|0)){if(F=(n[2786]|0)+l|0,n[2786]=F,n[2789]=k,n[k+4>>2]=F|1,(k|0)!=(s|0))return;n[2788]=0,n[2785]=0;return}if((F|0)==(s|0)){F=(n[2785]|0)+l|0,n[2785]=F,n[2788]=B,n[k+4>>2]=F|1,n[B+F>>2]=F;return}d=(f&-8)+l|0,c=f>>>3;do if(f>>>0<256)if(l=n[F+8>>2]|0,s=n[F+12>>2]|0,(s|0)==(l|0)){n[2783]=n[2783]&~(1<>2]=s,n[s+8>>2]=l;break}else{m=n[F+24>>2]|0,s=n[F+12>>2]|0;do if((s|0)==(F|0)){if(c=F+16|0,l=c+4|0,s=n[l>>2]|0,!s)if(s=n[c>>2]|0,s)l=c;else{c=0;break}for(;;){if(c=s+20|0,f=n[c>>2]|0,f|0){s=f,l=c;continue}if(c=s+16|0,f=n[c>>2]|0,f)s=f,l=c;else break}n[l>>2]=0,c=s}else c=n[F+8>>2]|0,n[c+12>>2]=s,n[s+8>>2]=c,c=s;while(!1);if(m|0){if(s=n[F+28>>2]|0,l=11436+(s<<2)|0,(F|0)==(n[l>>2]|0)){if(n[l>>2]=c,!c){n[2784]=n[2784]&~(1<>2]|0)!=(F|0)&1)<<2)>>2]=c,!c)break;n[c+24>>2]=m,s=F+16|0,l=n[s>>2]|0,l|0&&(n[c+16>>2]=l,n[l+24>>2]=c),s=n[s+4>>2]|0,s|0&&(n[c+20>>2]=s,n[s+24>>2]=c)}}while(!1);if(n[k+4>>2]=d|1,n[B+d>>2]=d,(k|0)==(n[2788]|0)){n[2785]=d;return}}if(s=d>>>3,d>>>0<256){c=11172+(s<<1<<2)|0,l=n[2783]|0,s=1<>2]|0):(n[2783]=l|s,s=c,l=c+8|0),n[l>>2]=k,n[s+12>>2]=k,n[k+8>>2]=s,n[k+12>>2]=c;return}s=d>>>8,s?d>>>0>16777215?s=31:(B=(s+1048320|0)>>>16&8,F=s<>>16&4,F=F<>>16&2,s=14-(m|B|s)+(F<>>15)|0,s=d>>>(s+7|0)&1|s<<1):s=0,f=11436+(s<<2)|0,n[k+28>>2]=s,n[k+20>>2]=0,n[k+16>>2]=0,l=n[2784]|0,c=1<>>1)|0),c=n[f>>2]|0;;){if((n[c+4>>2]&-8|0)==(d|0)){s=73;break}if(f=c+16+(l>>>31<<2)|0,s=n[f>>2]|0,s)l=l<<1,c=s;else{s=72;break}}if((s|0)==72){n[f>>2]=k,n[k+24>>2]=c,n[k+12>>2]=k,n[k+8>>2]=k;break}else if((s|0)==73){B=c+8|0,F=n[B>>2]|0,n[F+12>>2]=k,n[B>>2]=k,n[k+8>>2]=F,n[k+12>>2]=c,n[k+24>>2]=0;break}}else n[2784]=l|c,n[f>>2]=k,n[k+24>>2]=f,n[k+12>>2]=k,n[k+8>>2]=k;while(!1);if(F=(n[2791]|0)+-1|0,n[2791]=F,!F)s=11588;else return;for(;s=n[s>>2]|0,s;)s=s+8|0;n[2791]=-1}}}function dUe(){return 11628}function mUe(s){s=s|0;var l=0,c=0;return l=C,C=C+16|0,c=l,n[c>>2]=CUe(n[s+60>>2]|0)|0,s=qD(Ec(6,c|0)|0)|0,C=l,s|0}function N7(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0,j=0,oe=0,We=0;j=C,C=C+48|0,M=j+16|0,m=j,d=j+32|0,k=s+28|0,f=n[k>>2]|0,n[d>>2]=f,F=s+20|0,f=(n[F>>2]|0)-f|0,n[d+4>>2]=f,n[d+8>>2]=l,n[d+12>>2]=c,f=f+c|0,B=s+60|0,n[m>>2]=n[B>>2],n[m+4>>2]=d,n[m+8>>2]=2,m=qD(aa(146,m|0)|0)|0;e:do if((f|0)!=(m|0)){for(l=2;!((m|0)<0);)if(f=f-m|0,We=n[d+4>>2]|0,oe=m>>>0>We>>>0,d=oe?d+8|0:d,l=(oe<<31>>31)+l|0,We=m-(oe?We:0)|0,n[d>>2]=(n[d>>2]|0)+We,oe=d+4|0,n[oe>>2]=(n[oe>>2]|0)-We,n[M>>2]=n[B>>2],n[M+4>>2]=d,n[M+8>>2]=l,m=qD(aa(146,M|0)|0)|0,(f|0)==(m|0)){O=3;break e}n[s+16>>2]=0,n[k>>2]=0,n[F>>2]=0,n[s>>2]=n[s>>2]|32,(l|0)==2?c=0:c=c-(n[d+4>>2]|0)|0}else O=3;while(!1);return(O|0)==3&&(We=n[s+44>>2]|0,n[s+16>>2]=We+(n[s+48>>2]|0),n[k>>2]=We,n[F>>2]=We),C=j,c|0}function yUe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0;return d=C,C=C+32|0,m=d,f=d+20|0,n[m>>2]=n[s+60>>2],n[m+4>>2]=0,n[m+8>>2]=l,n[m+12>>2]=f,n[m+16>>2]=c,(qD(oa(140,m|0)|0)|0)<0?(n[f>>2]=-1,s=-1):s=n[f>>2]|0,C=d,s|0}function qD(s){return s=s|0,s>>>0>4294963200&&(n[(rm()|0)>>2]=0-s,s=-1),s|0}function rm(){return(EUe()|0)+64|0}function EUe(){return oT()|0}function oT(){return 2084}function CUe(s){return s=s|0,s|0}function IUe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0;return d=C,C=C+32|0,f=d,n[s+36>>2]=1,!(n[s>>2]&64|0)&&(n[f>>2]=n[s+60>>2],n[f+4>>2]=21523,n[f+8>>2]=d+16,Ls(54,f|0)|0)&&(o[s+75>>0]=-1),f=N7(s,l,c)|0,C=d,f|0}function O7(s,l){s=s|0,l=l|0;var c=0,f=0;if(c=o[s>>0]|0,f=o[l>>0]|0,!(c<<24>>24)||c<<24>>24!=f<<24>>24)s=f;else{do s=s+1|0,l=l+1|0,c=o[s>>0]|0,f=o[l>>0]|0;while(!(!(c<<24>>24)||c<<24>>24!=f<<24>>24));s=f}return(c&255)-(s&255)|0}function wUe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0;e:do if(!c)s=0;else{for(;f=o[s>>0]|0,d=o[l>>0]|0,f<<24>>24==d<<24>>24;)if(c=c+-1|0,c)s=s+1|0,l=l+1|0;else{s=0;break e}s=(f&255)-(d&255)|0}while(!1);return s|0}function M7(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0,j=0,oe=0,We=0,Oe=0,Qe=0;Qe=C,C=C+224|0,O=Qe+120|0,j=Qe+80|0,We=Qe,Oe=Qe+136|0,f=j,d=f+40|0;do n[f>>2]=0,f=f+4|0;while((f|0)<(d|0));return n[O>>2]=n[c>>2],(aT(0,l,O,We,j)|0)<0?c=-1:((n[s+76>>2]|0)>-1?oe=BUe(s)|0:oe=0,c=n[s>>2]|0,M=c&32,(o[s+74>>0]|0)<1&&(n[s>>2]=c&-33),f=s+48|0,n[f>>2]|0?c=aT(s,l,O,We,j)|0:(d=s+44|0,m=n[d>>2]|0,n[d>>2]=Oe,B=s+28|0,n[B>>2]=Oe,k=s+20|0,n[k>>2]=Oe,n[f>>2]=80,F=s+16|0,n[F>>2]=Oe+80,c=aT(s,l,O,We,j)|0,m&&(YD[n[s+36>>2]&7](s,0,0)|0,c=n[k>>2]|0?c:-1,n[d>>2]=m,n[f>>2]=0,n[F>>2]=0,n[B>>2]=0,n[k>>2]=0)),f=n[s>>2]|0,n[s>>2]=f|M,oe|0&&vUe(s),c=f&32|0?-1:c),C=Qe,c|0}function aT(s,l,c,f,d){s=s|0,l=l|0,c=c|0,f=f|0,d=d|0;var m=0,B=0,k=0,F=0,M=0,O=0,j=0,oe=0,We=0,Oe=0,Qe=0,rt=0,Xe=0,ct=0,_e=0,Ge=0,Nt=0,_r=0,ur=0,Zt=0,kr=0,Or=0,lr=0;lr=C,C=C+64|0,ur=lr+16|0,Zt=lr,Nt=lr+24|0,kr=lr+8|0,Or=lr+20|0,n[ur>>2]=l,ct=(s|0)!=0,_e=Nt+40|0,Ge=_e,Nt=Nt+39|0,_r=kr+4|0,B=0,m=0,O=0;e:for(;;){do if((m|0)>-1)if((B|0)>(2147483647-m|0)){n[(rm()|0)>>2]=75,m=-1;break}else{m=B+m|0;break}while(!1);if(B=o[l>>0]|0,B<<24>>24)k=l;else{Xe=87;break}t:for(;;){switch(B<<24>>24){case 37:{B=k,Xe=9;break t}case 0:{B=k;break t}default:}rt=k+1|0,n[ur>>2]=rt,B=o[rt>>0]|0,k=rt}t:do if((Xe|0)==9)for(;;){if(Xe=0,(o[k+1>>0]|0)!=37)break t;if(B=B+1|0,k=k+2|0,n[ur>>2]=k,(o[k>>0]|0)==37)Xe=9;else break}while(!1);if(B=B-l|0,ct&&os(s,l,B),B|0){l=k;continue}F=k+1|0,B=(o[F>>0]|0)+-48|0,B>>>0<10?(rt=(o[k+2>>0]|0)==36,Qe=rt?B:-1,O=rt?1:O,F=rt?k+3|0:F):Qe=-1,n[ur>>2]=F,B=o[F>>0]|0,k=(B<<24>>24)+-32|0;t:do if(k>>>0<32)for(M=0,j=B;;){if(B=1<>2]=F,B=o[F>>0]|0,k=(B<<24>>24)+-32|0,k>>>0>=32)break;j=B}else M=0;while(!1);if(B<<24>>24==42){if(k=F+1|0,B=(o[k>>0]|0)+-48|0,B>>>0<10&&(o[F+2>>0]|0)==36)n[d+(B<<2)>>2]=10,B=n[f+((o[k>>0]|0)+-48<<3)>>2]|0,O=1,F=F+3|0;else{if(O|0){m=-1;break}ct?(O=(n[c>>2]|0)+3&-4,B=n[O>>2]|0,n[c>>2]=O+4,O=0,F=k):(B=0,O=0,F=k)}n[ur>>2]=F,rt=(B|0)<0,B=rt?0-B|0:B,M=rt?M|8192:M}else{if(B=U7(ur)|0,(B|0)<0){m=-1;break}F=n[ur>>2]|0}do if((o[F>>0]|0)==46){if((o[F+1>>0]|0)!=42){n[ur>>2]=F+1,k=U7(ur)|0,F=n[ur>>2]|0;break}if(j=F+2|0,k=(o[j>>0]|0)+-48|0,k>>>0<10&&(o[F+3>>0]|0)==36){n[d+(k<<2)>>2]=10,k=n[f+((o[j>>0]|0)+-48<<3)>>2]|0,F=F+4|0,n[ur>>2]=F;break}if(O|0){m=-1;break e}ct?(rt=(n[c>>2]|0)+3&-4,k=n[rt>>2]|0,n[c>>2]=rt+4):k=0,n[ur>>2]=j,F=j}else k=-1;while(!1);for(Oe=0;;){if(((o[F>>0]|0)+-65|0)>>>0>57){m=-1;break e}if(rt=F+1|0,n[ur>>2]=rt,j=o[(o[F>>0]|0)+-65+(5178+(Oe*58|0))>>0]|0,oe=j&255,(oe+-1|0)>>>0<8)Oe=oe,F=rt;else break}if(!(j<<24>>24)){m=-1;break}We=(Qe|0)>-1;do if(j<<24>>24==19)if(We){m=-1;break e}else Xe=49;else{if(We){n[d+(Qe<<2)>>2]=oe,We=f+(Qe<<3)|0,Qe=n[We+4>>2]|0,Xe=Zt,n[Xe>>2]=n[We>>2],n[Xe+4>>2]=Qe,Xe=49;break}if(!ct){m=0;break e}_7(Zt,oe,c)}while(!1);if((Xe|0)==49&&(Xe=0,!ct)){B=0,l=rt;continue}F=o[F>>0]|0,F=(Oe|0)!=0&(F&15|0)==3?F&-33:F,We=M&-65537,Qe=M&8192|0?We:M;t:do switch(F|0){case 110:switch((Oe&255)<<24>>24){case 0:{n[n[Zt>>2]>>2]=m,B=0,l=rt;continue e}case 1:{n[n[Zt>>2]>>2]=m,B=0,l=rt;continue e}case 2:{B=n[Zt>>2]|0,n[B>>2]=m,n[B+4>>2]=((m|0)<0)<<31>>31,B=0,l=rt;continue e}case 3:{a[n[Zt>>2]>>1]=m,B=0,l=rt;continue e}case 4:{o[n[Zt>>2]>>0]=m,B=0,l=rt;continue e}case 6:{n[n[Zt>>2]>>2]=m,B=0,l=rt;continue e}case 7:{B=n[Zt>>2]|0,n[B>>2]=m,n[B+4>>2]=((m|0)<0)<<31>>31,B=0,l=rt;continue e}default:{B=0,l=rt;continue e}}case 112:{F=120,k=k>>>0>8?k:8,l=Qe|8,Xe=61;break}case 88:case 120:{l=Qe,Xe=61;break}case 111:{F=Zt,l=n[F>>2]|0,F=n[F+4>>2]|0,oe=PUe(l,F,_e)|0,We=Ge-oe|0,M=0,j=5642,k=(Qe&8|0)==0|(k|0)>(We|0)?k:We+1|0,We=Qe,Xe=67;break}case 105:case 100:if(F=Zt,l=n[F>>2]|0,F=n[F+4>>2]|0,(F|0)<0){l=jD(0,0,l|0,F|0)|0,F=Ce,M=Zt,n[M>>2]=l,n[M+4>>2]=F,M=1,j=5642,Xe=66;break t}else{M=(Qe&2049|0)!=0&1,j=Qe&2048|0?5643:Qe&1|0?5644:5642,Xe=66;break t}case 117:{F=Zt,M=0,j=5642,l=n[F>>2]|0,F=n[F+4>>2]|0,Xe=66;break}case 99:{o[Nt>>0]=n[Zt>>2],l=Nt,M=0,j=5642,oe=_e,F=1,k=We;break}case 109:{F=SUe(n[(rm()|0)>>2]|0)|0,Xe=71;break}case 115:{F=n[Zt>>2]|0,F=F|0?F:5652,Xe=71;break}case 67:{n[kr>>2]=n[Zt>>2],n[_r>>2]=0,n[Zt>>2]=kr,oe=-1,F=kr,Xe=75;break}case 83:{l=n[Zt>>2]|0,k?(oe=k,F=l,Xe=75):(Es(s,32,B,0,Qe),l=0,Xe=84);break}case 65:case 71:case 70:case 69:case 97:case 103:case 102:case 101:{B=bUe(s,+E[Zt>>3],B,k,Qe,F)|0,l=rt;continue e}default:M=0,j=5642,oe=_e,F=k,k=Qe}while(!1);t:do if((Xe|0)==61)Qe=Zt,Oe=n[Qe>>2]|0,Qe=n[Qe+4>>2]|0,oe=DUe(Oe,Qe,_e,F&32)|0,j=(l&8|0)==0|(Oe|0)==0&(Qe|0)==0,M=j?0:2,j=j?5642:5642+(F>>4)|0,We=l,l=Oe,F=Qe,Xe=67;else if((Xe|0)==66)oe=nm(l,F,_e)|0,We=Qe,Xe=67;else if((Xe|0)==71)Xe=0,Qe=xUe(F,0,k)|0,Oe=(Qe|0)==0,l=F,M=0,j=5642,oe=Oe?F+k|0:Qe,F=Oe?k:Qe-F|0,k=We;else if((Xe|0)==75){for(Xe=0,j=F,l=0,k=0;M=n[j>>2]|0,!(!M||(k=H7(Or,M)|0,(k|0)<0|k>>>0>(oe-l|0)>>>0));)if(l=k+l|0,oe>>>0>l>>>0)j=j+4|0;else break;if((k|0)<0){m=-1;break e}if(Es(s,32,B,l,Qe),!l)l=0,Xe=84;else for(M=0;;){if(k=n[F>>2]|0,!k){Xe=84;break t}if(k=H7(Or,k)|0,M=k+M|0,(M|0)>(l|0)){Xe=84;break t}if(os(s,Or,k),M>>>0>=l>>>0){Xe=84;break}else F=F+4|0}}while(!1);if((Xe|0)==67)Xe=0,F=(l|0)!=0|(F|0)!=0,Qe=(k|0)!=0|F,F=((F^1)&1)+(Ge-oe)|0,l=Qe?oe:_e,oe=_e,F=Qe?(k|0)>(F|0)?k:F:k,k=(k|0)>-1?We&-65537:We;else if((Xe|0)==84){Xe=0,Es(s,32,B,l,Qe^8192),B=(B|0)>(l|0)?B:l,l=rt;continue}Oe=oe-l|0,We=(F|0)<(Oe|0)?Oe:F,Qe=We+M|0,B=(B|0)<(Qe|0)?Qe:B,Es(s,32,B,Qe,k),os(s,j,M),Es(s,48,B,Qe,k^65536),Es(s,48,We,Oe,0),os(s,l,Oe),Es(s,32,B,Qe,k^8192),l=rt}e:do if((Xe|0)==87&&!s)if(!O)m=0;else{for(m=1;l=n[d+(m<<2)>>2]|0,!!l;)if(_7(f+(m<<3)|0,l,c),m=m+1|0,(m|0)>=10){m=1;break e}for(;;){if(n[d+(m<<2)>>2]|0){m=-1;break e}if(m=m+1|0,(m|0)>=10){m=1;break}}}while(!1);return C=lr,m|0}function BUe(s){return s=s|0,0}function vUe(s){s=s|0}function os(s,l,c){s=s|0,l=l|0,c=c|0,n[s>>2]&32||MUe(l,c,s)|0}function U7(s){s=s|0;var l=0,c=0,f=0;if(c=n[s>>2]|0,f=(o[c>>0]|0)+-48|0,f>>>0<10){l=0;do l=f+(l*10|0)|0,c=c+1|0,n[s>>2]=c,f=(o[c>>0]|0)+-48|0;while(f>>>0<10)}else l=0;return l|0}function _7(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0;e:do if(l>>>0<=20)do switch(l|0){case 9:{f=(n[c>>2]|0)+3&-4,l=n[f>>2]|0,n[c>>2]=f+4,n[s>>2]=l;break e}case 10:{f=(n[c>>2]|0)+3&-4,l=n[f>>2]|0,n[c>>2]=f+4,f=s,n[f>>2]=l,n[f+4>>2]=((l|0)<0)<<31>>31;break e}case 11:{f=(n[c>>2]|0)+3&-4,l=n[f>>2]|0,n[c>>2]=f+4,f=s,n[f>>2]=l,n[f+4>>2]=0;break e}case 12:{f=(n[c>>2]|0)+7&-8,l=f,d=n[l>>2]|0,l=n[l+4>>2]|0,n[c>>2]=f+8,f=s,n[f>>2]=d,n[f+4>>2]=l;break e}case 13:{d=(n[c>>2]|0)+3&-4,f=n[d>>2]|0,n[c>>2]=d+4,f=(f&65535)<<16>>16,d=s,n[d>>2]=f,n[d+4>>2]=((f|0)<0)<<31>>31;break e}case 14:{d=(n[c>>2]|0)+3&-4,f=n[d>>2]|0,n[c>>2]=d+4,d=s,n[d>>2]=f&65535,n[d+4>>2]=0;break e}case 15:{d=(n[c>>2]|0)+3&-4,f=n[d>>2]|0,n[c>>2]=d+4,f=(f&255)<<24>>24,d=s,n[d>>2]=f,n[d+4>>2]=((f|0)<0)<<31>>31;break e}case 16:{d=(n[c>>2]|0)+3&-4,f=n[d>>2]|0,n[c>>2]=d+4,d=s,n[d>>2]=f&255,n[d+4>>2]=0;break e}case 17:{d=(n[c>>2]|0)+7&-8,m=+E[d>>3],n[c>>2]=d+8,E[s>>3]=m;break e}case 18:{d=(n[c>>2]|0)+7&-8,m=+E[d>>3],n[c>>2]=d+8,E[s>>3]=m;break e}default:break e}while(!1);while(!1)}function DUe(s,l,c,f){if(s=s|0,l=l|0,c=c|0,f=f|0,!((s|0)==0&(l|0)==0))do c=c+-1|0,o[c>>0]=u[5694+(s&15)>>0]|0|f,s=GD(s|0,l|0,4)|0,l=Ce;while(!((s|0)==0&(l|0)==0));return c|0}function PUe(s,l,c){if(s=s|0,l=l|0,c=c|0,!((s|0)==0&(l|0)==0))do c=c+-1|0,o[c>>0]=s&7|48,s=GD(s|0,l|0,3)|0,l=Ce;while(!((s|0)==0&(l|0)==0));return c|0}function nm(s,l,c){s=s|0,l=l|0,c=c|0;var f=0;if(l>>>0>0|(l|0)==0&s>>>0>4294967295){for(;f=AT(s|0,l|0,10,0)|0,c=c+-1|0,o[c>>0]=f&255|48,f=s,s=uT(s|0,l|0,10,0)|0,l>>>0>9|(l|0)==9&f>>>0>4294967295;)l=Ce;l=s}else l=s;if(l)for(;c=c+-1|0,o[c>>0]=(l>>>0)%10|0|48,!(l>>>0<10);)l=(l>>>0)/10|0;return c|0}function SUe(s){return s=s|0,TUe(s,n[(RUe()|0)+188>>2]|0)|0}function xUe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0;m=l&255,f=(c|0)!=0;e:do if(f&(s&3|0)!=0)for(d=l&255;;){if((o[s>>0]|0)==d<<24>>24){B=6;break e}if(s=s+1|0,c=c+-1|0,f=(c|0)!=0,!(f&(s&3|0)!=0)){B=5;break}}else B=5;while(!1);(B|0)==5&&(f?B=6:c=0);e:do if((B|0)==6&&(d=l&255,(o[s>>0]|0)!=d<<24>>24)){f=He(m,16843009)|0;t:do if(c>>>0>3){for(;m=n[s>>2]^f,!((m&-2139062144^-2139062144)&m+-16843009|0);)if(s=s+4|0,c=c+-4|0,c>>>0<=3){B=11;break t}}else B=11;while(!1);if((B|0)==11&&!c){c=0;break}for(;;){if((o[s>>0]|0)==d<<24>>24)break e;if(s=s+1|0,c=c+-1|0,!c){c=0;break}}}while(!1);return(c|0?s:0)|0}function Es(s,l,c,f,d){s=s|0,l=l|0,c=c|0,f=f|0,d=d|0;var m=0,B=0;if(B=C,C=C+256|0,m=B,(c|0)>(f|0)&(d&73728|0)==0){if(d=c-f|0,sm(m|0,l|0,(d>>>0<256?d:256)|0)|0,d>>>0>255){l=c-f|0;do os(s,m,256),d=d+-256|0;while(d>>>0>255);d=l&255}os(s,m,d)}C=B}function H7(s,l){return s=s|0,l=l|0,s?s=QUe(s,l,0)|0:s=0,s|0}function bUe(s,l,c,f,d,m){s=s|0,l=+l,c=c|0,f=f|0,d=d|0,m=m|0;var B=0,k=0,F=0,M=0,O=0,j=0,oe=0,We=0,Oe=0,Qe=0,rt=0,Xe=0,ct=0,_e=0,Ge=0,Nt=0,_r=0,ur=0,Zt=0,kr=0,Or=0,lr=0,Ln=0;Ln=C,C=C+560|0,F=Ln+8|0,rt=Ln,lr=Ln+524|0,Or=lr,M=Ln+512|0,n[rt>>2]=0,kr=M+12|0,q7(l)|0,(Ce|0)<0?(l=-l,ur=1,_r=5659):(ur=(d&2049|0)!=0&1,_r=d&2048|0?5662:d&1|0?5665:5660),q7(l)|0,Zt=Ce&2146435072;do if(Zt>>>0<2146435072|(Zt|0)==2146435072&!1){if(We=+kUe(l,rt)*2,B=We!=0,B&&(n[rt>>2]=(n[rt>>2]|0)+-1),ct=m|32,(ct|0)==97){Oe=m&32,oe=Oe|0?_r+9|0:_r,j=ur|2,B=12-f|0;do if(f>>>0>11|(B|0)==0)l=We;else{l=8;do B=B+-1|0,l=l*16;while(B|0);if((o[oe>>0]|0)==45){l=-(l+(-We-l));break}else{l=We+l-l;break}}while(!1);k=n[rt>>2]|0,B=(k|0)<0?0-k|0:k,B=nm(B,((B|0)<0)<<31>>31,kr)|0,(B|0)==(kr|0)&&(B=M+11|0,o[B>>0]=48),o[B+-1>>0]=(k>>31&2)+43,O=B+-2|0,o[O>>0]=m+15,M=(f|0)<1,F=(d&8|0)==0,B=lr;do Zt=~~l,k=B+1|0,o[B>>0]=u[5694+Zt>>0]|Oe,l=(l-+(Zt|0))*16,(k-Or|0)==1&&!(F&(M&l==0))?(o[k>>0]=46,B=B+2|0):B=k;while(l!=0);Zt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,f=F;if(Ge=Zt,B>>>0>>0){if(F=(Ge-B>>2)*9|0,O=n[B>>2]|0,O>>>0>=10){M=10;do M=M*10|0,F=F+1|0;while(O>>>0>=M>>>0)}}else F=0;if(Qe=(ct|0)==103,Xe=(k|0)!=0,M=k-((ct|0)!=102?F:0)+((Xe&Qe)<<31>>31)|0,(M|0)<(((f-Ge>>2)*9|0)+-9|0)){if(M=M+9216|0,Oe=Zt+4+(((M|0)/9|0)+-1024<<2)|0,M=((M|0)%9|0)+1|0,(M|0)<9){O=10;do O=O*10|0,M=M+1|0;while((M|0)!=9)}else O=10;if(j=n[Oe>>2]|0,oe=(j>>>0)%(O>>>0)|0,M=(Oe+4|0)==(f|0),M&(oe|0)==0)M=Oe;else if(We=((j>>>0)/(O>>>0)|0)&1|0?9007199254740994:9007199254740992,_e=(O|0)/2|0,l=oe>>>0<_e>>>0?.5:M&(oe|0)==(_e|0)?1:1.5,ur&&(_e=(o[_r>>0]|0)==45,l=_e?-l:l,We=_e?-We:We),M=j-oe|0,n[Oe>>2]=M,We+l!=We){if(_e=M+O|0,n[Oe>>2]=_e,_e>>>0>999999999)for(F=Oe;M=F+-4|0,n[F>>2]=0,M>>>0>>0&&(B=B+-4|0,n[B>>2]=0),_e=(n[M>>2]|0)+1|0,n[M>>2]=_e,_e>>>0>999999999;)F=M;else M=Oe;if(F=(Ge-B>>2)*9|0,j=n[B>>2]|0,j>>>0>=10){O=10;do O=O*10|0,F=F+1|0;while(j>>>0>=O>>>0)}}else M=Oe;M=M+4|0,M=f>>>0>M>>>0?M:f,_e=B}else M=f,_e=B;for(ct=M;;){if(ct>>>0<=_e>>>0){rt=0;break}if(B=ct+-4|0,!(n[B>>2]|0))ct=B;else{rt=1;break}}f=0-F|0;do if(Qe)if(B=((Xe^1)&1)+k|0,(B|0)>(F|0)&(F|0)>-5?(O=m+-1|0,k=B+-1-F|0):(O=m+-2|0,k=B+-1|0),B=d&8,B)Oe=B;else{if(rt&&(Nt=n[ct+-4>>2]|0,(Nt|0)!=0))if((Nt>>>0)%10|0)M=0;else{M=0,B=10;do B=B*10|0,M=M+1|0;while(!((Nt>>>0)%(B>>>0)|0|0))}else M=9;if(B=((ct-Ge>>2)*9|0)+-9|0,(O|32|0)==102){Oe=B-M|0,Oe=(Oe|0)>0?Oe:0,k=(k|0)<(Oe|0)?k:Oe,Oe=0;break}else{Oe=B+F-M|0,Oe=(Oe|0)>0?Oe:0,k=(k|0)<(Oe|0)?k:Oe,Oe=0;break}}else O=m,Oe=d&8;while(!1);if(Qe=k|Oe,j=(Qe|0)!=0&1,oe=(O|32|0)==102,oe)Xe=0,B=(F|0)>0?F:0;else{if(B=(F|0)<0?f:F,B=nm(B,((B|0)<0)<<31>>31,kr)|0,M=kr,(M-B|0)<2)do B=B+-1|0,o[B>>0]=48;while((M-B|0)<2);o[B+-1>>0]=(F>>31&2)+43,B=B+-2|0,o[B>>0]=O,Xe=B,B=M-B|0}if(B=ur+1+k+j+B|0,Es(s,32,c,B,d),os(s,_r,ur),Es(s,48,c,B,d^65536),oe){O=_e>>>0>Zt>>>0?Zt:_e,Oe=lr+9|0,j=Oe,oe=lr+8|0,M=O;do{if(F=nm(n[M>>2]|0,0,Oe)|0,(M|0)==(O|0))(F|0)==(Oe|0)&&(o[oe>>0]=48,F=oe);else if(F>>>0>lr>>>0){sm(lr|0,48,F-Or|0)|0;do F=F+-1|0;while(F>>>0>lr>>>0)}os(s,F,j-F|0),M=M+4|0}while(M>>>0<=Zt>>>0);if(Qe|0&&os(s,5710,1),M>>>0>>0&(k|0)>0)for(;;){if(F=nm(n[M>>2]|0,0,Oe)|0,F>>>0>lr>>>0){sm(lr|0,48,F-Or|0)|0;do F=F+-1|0;while(F>>>0>lr>>>0)}if(os(s,F,(k|0)<9?k:9),M=M+4|0,F=k+-9|0,M>>>0>>0&(k|0)>9)k=F;else{k=F;break}}Es(s,48,k+9|0,9,0)}else{if(Qe=rt?ct:_e+4|0,(k|0)>-1){rt=lr+9|0,Oe=(Oe|0)==0,f=rt,j=0-Or|0,oe=lr+8|0,O=_e;do{F=nm(n[O>>2]|0,0,rt)|0,(F|0)==(rt|0)&&(o[oe>>0]=48,F=oe);do if((O|0)==(_e|0)){if(M=F+1|0,os(s,F,1),Oe&(k|0)<1){F=M;break}os(s,5710,1),F=M}else{if(F>>>0<=lr>>>0)break;sm(lr|0,48,F+j|0)|0;do F=F+-1|0;while(F>>>0>lr>>>0)}while(!1);Or=f-F|0,os(s,F,(k|0)>(Or|0)?Or:k),k=k-Or|0,O=O+4|0}while(O>>>0>>0&(k|0)>-1)}Es(s,48,k+18|0,18,0),os(s,Xe,kr-Xe|0)}Es(s,32,c,B,d^8192)}else lr=(m&32|0)!=0,B=ur+3|0,Es(s,32,c,B,d&-65537),os(s,_r,ur),os(s,l!=l|!1?lr?5686:5690:lr?5678:5682,3),Es(s,32,c,B,d^8192);while(!1);return C=Ln,((B|0)<(c|0)?c:B)|0}function q7(s){s=+s;var l=0;return E[D>>3]=s,l=n[D>>2]|0,Ce=n[D+4>>2]|0,l|0}function kUe(s,l){return s=+s,l=l|0,+ +j7(s,l)}function j7(s,l){s=+s,l=l|0;var c=0,f=0,d=0;switch(E[D>>3]=s,c=n[D>>2]|0,f=n[D+4>>2]|0,d=GD(c|0,f|0,52)|0,d&2047){case 0:{s!=0?(s=+j7(s*18446744073709552e3,l),c=(n[l>>2]|0)+-64|0):c=0,n[l>>2]=c;break}case 2047:break;default:n[l>>2]=(d&2047)+-1022,n[D>>2]=c,n[D+4>>2]=f&-2146435073|1071644672,s=+E[D>>3]}return+s}function QUe(s,l,c){s=s|0,l=l|0,c=c|0;do if(s){if(l>>>0<128){o[s>>0]=l,s=1;break}if(!(n[n[(FUe()|0)+188>>2]>>2]|0))if((l&-128|0)==57216){o[s>>0]=l,s=1;break}else{n[(rm()|0)>>2]=84,s=-1;break}if(l>>>0<2048){o[s>>0]=l>>>6|192,o[s+1>>0]=l&63|128,s=2;break}if(l>>>0<55296|(l&-8192|0)==57344){o[s>>0]=l>>>12|224,o[s+1>>0]=l>>>6&63|128,o[s+2>>0]=l&63|128,s=3;break}if((l+-65536|0)>>>0<1048576){o[s>>0]=l>>>18|240,o[s+1>>0]=l>>>12&63|128,o[s+2>>0]=l>>>6&63|128,o[s+3>>0]=l&63|128,s=4;break}else{n[(rm()|0)>>2]=84,s=-1;break}}else s=1;while(!1);return s|0}function FUe(){return oT()|0}function RUe(){return oT()|0}function TUe(s,l){s=s|0,l=l|0;var c=0,f=0;for(f=0;;){if((u[5712+f>>0]|0)==(s|0)){s=2;break}if(c=f+1|0,(c|0)==87){c=5800,f=87,s=5;break}else f=c}if((s|0)==2&&(f?(c=5800,s=5):c=5800),(s|0)==5)for(;;){do s=c,c=c+1|0;while(o[s>>0]|0);if(f=f+-1|0,f)s=5;else break}return LUe(c,n[l+20>>2]|0)|0}function LUe(s,l){return s=s|0,l=l|0,NUe(s,l)|0}function NUe(s,l){return s=s|0,l=l|0,l?l=OUe(n[l>>2]|0,n[l+4>>2]|0,s)|0:l=0,(l|0?l:s)|0}function OUe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0,F=0,M=0,O=0,j=0,oe=0;oe=(n[s>>2]|0)+1794895138|0,m=O0(n[s+8>>2]|0,oe)|0,f=O0(n[s+12>>2]|0,oe)|0,d=O0(n[s+16>>2]|0,oe)|0;e:do if(m>>>0>>2>>>0&&(j=l-(m<<2)|0,f>>>0>>0&d>>>0>>0)&&!((d|f)&3|0)){for(j=f>>>2,O=d>>>2,M=0;;){if(k=m>>>1,F=M+k|0,B=F<<1,d=B+j|0,f=O0(n[s+(d<<2)>>2]|0,oe)|0,d=O0(n[s+(d+1<<2)>>2]|0,oe)|0,!(d>>>0>>0&f>>>0<(l-d|0)>>>0)){f=0;break e}if(o[s+(d+f)>>0]|0){f=0;break e}if(f=O7(c,s+d|0)|0,!f)break;if(f=(f|0)<0,(m|0)==1){f=0;break e}else M=f?M:F,m=f?k:m-k|0}f=B+O|0,d=O0(n[s+(f<<2)>>2]|0,oe)|0,f=O0(n[s+(f+1<<2)>>2]|0,oe)|0,f>>>0>>0&d>>>0<(l-f|0)>>>0?f=o[s+(f+d)>>0]|0?0:s+f|0:f=0}else f=0;while(!1);return f|0}function O0(s,l){s=s|0,l=l|0;var c=0;return c=X7(s|0)|0,(l|0?c:s)|0}function MUe(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0,k=0;f=c+16|0,d=n[f>>2]|0,d?m=5:UUe(c)|0?f=0:(d=n[f>>2]|0,m=5);e:do if((m|0)==5){if(k=c+20|0,B=n[k>>2]|0,f=B,(d-B|0)>>>0>>0){f=YD[n[c+36>>2]&7](c,s,l)|0;break}t:do if((o[c+75>>0]|0)>-1){for(B=l;;){if(!B){m=0,d=s;break t}if(d=B+-1|0,(o[s+d>>0]|0)==10)break;B=d}if(f=YD[n[c+36>>2]&7](c,s,B)|0,f>>>0>>0)break e;m=B,d=s+B|0,l=l-B|0,f=n[k>>2]|0}else m=0,d=s;while(!1);br(f|0,d|0,l|0)|0,n[k>>2]=(n[k>>2]|0)+l,f=m+l|0}while(!1);return f|0}function UUe(s){s=s|0;var l=0,c=0;return l=s+74|0,c=o[l>>0]|0,o[l>>0]=c+255|c,l=n[s>>2]|0,l&8?(n[s>>2]=l|32,s=-1):(n[s+8>>2]=0,n[s+4>>2]=0,c=n[s+44>>2]|0,n[s+28>>2]=c,n[s+20>>2]=c,n[s+16>>2]=c+(n[s+48>>2]|0),s=0),s|0}function Yn(s,l){s=y(s),l=y(l);var c=0,f=0;c=G7(s)|0;do if((c&2147483647)>>>0<=2139095040){if(f=G7(l)|0,(f&2147483647)>>>0<=2139095040)if((f^c|0)<0){s=(c|0)<0?l:s;break}else{s=s>2]=s,n[D>>2]|0|0}function M0(s,l){s=y(s),l=y(l);var c=0,f=0;c=W7(s)|0;do if((c&2147483647)>>>0<=2139095040){if(f=W7(l)|0,(f&2147483647)>>>0<=2139095040)if((f^c|0)<0){s=(c|0)<0?s:l;break}else{s=s>2]=s,n[D>>2]|0|0}function lT(s,l){s=y(s),l=y(l);var c=0,f=0,d=0,m=0,B=0,k=0,F=0,M=0;m=(h[D>>2]=s,n[D>>2]|0),k=(h[D>>2]=l,n[D>>2]|0),c=m>>>23&255,B=k>>>23&255,F=m&-2147483648,d=k<<1;e:do if(d|0&&!((c|0)==255|((_Ue(l)|0)&2147483647)>>>0>2139095040)){if(f=m<<1,f>>>0<=d>>>0)return l=y(s*y(0)),y((f|0)==(d|0)?l:s);if(c)f=m&8388607|8388608;else{if(c=m<<9,(c|0)>-1){f=c,c=0;do c=c+-1|0,f=f<<1;while((f|0)>-1)}else c=0;f=m<<1-c}if(B)k=k&8388607|8388608;else{if(m=k<<9,(m|0)>-1){d=0;do d=d+-1|0,m=m<<1;while((m|0)>-1)}else d=0;B=d,k=k<<1-d}d=f-k|0,m=(d|0)>-1;t:do if((c|0)>(B|0)){for(;;){if(m)if(d)f=d;else break;if(f=f<<1,c=c+-1|0,d=f-k|0,m=(d|0)>-1,(c|0)<=(B|0))break t}l=y(s*y(0));break e}while(!1);if(m)if(d)f=d;else{l=y(s*y(0));break}if(f>>>0<8388608)do f=f<<1,c=c+-1|0;while(f>>>0<8388608);(c|0)>0?c=f+-8388608|c<<23:c=f>>>(1-c|0),l=(n[D>>2]=c|F,y(h[D>>2]))}else M=3;while(!1);return(M|0)==3&&(l=y(s*l),l=y(l/l)),y(l)}function _Ue(s){return s=y(s),h[D>>2]=s,n[D>>2]|0|0}function HUe(s,l){return s=s|0,l=l|0,M7(n[582]|0,s,l)|0}function Zr(s){s=s|0,Tt()}function im(s){s=s|0}function qUe(s,l){return s=s|0,l=l|0,0}function jUe(s){return s=s|0,(Y7(s+4|0)|0)==-1?(ef[n[(n[s>>2]|0)+8>>2]&127](s),s=1):s=0,s|0}function Y7(s){s=s|0;var l=0;return l=n[s>>2]|0,n[s>>2]=l+-1,l+-1|0}function Rp(s){s=s|0,jUe(s)|0&&GUe(s)}function GUe(s){s=s|0;var l=0;l=s+8|0,n[l>>2]|0&&(Y7(l)|0)!=-1||ef[n[(n[s>>2]|0)+16>>2]&127](s)}function Yt(s){s=s|0;var l=0;for(l=s|0?s:1;s=_D(l)|0,!(s|0);){if(s=YUe()|0,!s){s=0;break}aW[s&0]()}return s|0}function K7(s){return s=s|0,Yt(s)|0}function yt(s){s=s|0,HD(s)}function WUe(s){s=s|0,(o[s+11>>0]|0)<0&&yt(n[s>>2]|0)}function YUe(){var s=0;return s=n[2923]|0,n[2923]=s+0,s|0}function KUe(){}function jD(s,l,c,f){return s=s|0,l=l|0,c=c|0,f=f|0,f=l-f-(c>>>0>s>>>0|0)>>>0,Ce=f,s-c>>>0|0|0}function cT(s,l,c,f){return s=s|0,l=l|0,c=c|0,f=f|0,c=s+c>>>0,Ce=l+f+(c>>>0>>0|0)>>>0,c|0|0}function sm(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0,B=0;if(m=s+c|0,l=l&255,(c|0)>=67){for(;s&3;)o[s>>0]=l,s=s+1|0;for(f=m&-4|0,d=f-64|0,B=l|l<<8|l<<16|l<<24;(s|0)<=(d|0);)n[s>>2]=B,n[s+4>>2]=B,n[s+8>>2]=B,n[s+12>>2]=B,n[s+16>>2]=B,n[s+20>>2]=B,n[s+24>>2]=B,n[s+28>>2]=B,n[s+32>>2]=B,n[s+36>>2]=B,n[s+40>>2]=B,n[s+44>>2]=B,n[s+48>>2]=B,n[s+52>>2]=B,n[s+56>>2]=B,n[s+60>>2]=B,s=s+64|0;for(;(s|0)<(f|0);)n[s>>2]=B,s=s+4|0}for(;(s|0)<(m|0);)o[s>>0]=l,s=s+1|0;return m-c|0}function V7(s,l,c){return s=s|0,l=l|0,c=c|0,(c|0)<32?(Ce=l<>>32-c,s<>>c,s>>>c|(l&(1<>>c-32|0)}function br(s,l,c){s=s|0,l=l|0,c=c|0;var f=0,d=0,m=0;if((c|0)>=8192)return FA(s|0,l|0,c|0)|0;if(m=s|0,d=s+c|0,(s&3)==(l&3)){for(;s&3;){if(!c)return m|0;o[s>>0]=o[l>>0]|0,s=s+1|0,l=l+1|0,c=c-1|0}for(c=d&-4|0,f=c-64|0;(s|0)<=(f|0);)n[s>>2]=n[l>>2],n[s+4>>2]=n[l+4>>2],n[s+8>>2]=n[l+8>>2],n[s+12>>2]=n[l+12>>2],n[s+16>>2]=n[l+16>>2],n[s+20>>2]=n[l+20>>2],n[s+24>>2]=n[l+24>>2],n[s+28>>2]=n[l+28>>2],n[s+32>>2]=n[l+32>>2],n[s+36>>2]=n[l+36>>2],n[s+40>>2]=n[l+40>>2],n[s+44>>2]=n[l+44>>2],n[s+48>>2]=n[l+48>>2],n[s+52>>2]=n[l+52>>2],n[s+56>>2]=n[l+56>>2],n[s+60>>2]=n[l+60>>2],s=s+64|0,l=l+64|0;for(;(s|0)<(c|0);)n[s>>2]=n[l>>2],s=s+4|0,l=l+4|0}else for(c=d-4|0;(s|0)<(c|0);)o[s>>0]=o[l>>0]|0,o[s+1>>0]=o[l+1>>0]|0,o[s+2>>0]=o[l+2>>0]|0,o[s+3>>0]=o[l+3>>0]|0,s=s+4|0,l=l+4|0;for(;(s|0)<(d|0);)o[s>>0]=o[l>>0]|0,s=s+1|0,l=l+1|0;return m|0}function z7(s){s=s|0;var l=0;return l=o[N+(s&255)>>0]|0,(l|0)<8?l|0:(l=o[N+(s>>8&255)>>0]|0,(l|0)<8?l+8|0:(l=o[N+(s>>16&255)>>0]|0,(l|0)<8?l+16|0:(o[N+(s>>>24)>>0]|0)+24|0))}function J7(s,l,c,f,d){s=s|0,l=l|0,c=c|0,f=f|0,d=d|0;var m=0,B=0,k=0,F=0,M=0,O=0,j=0,oe=0,We=0,Oe=0;if(O=s,F=l,M=F,B=c,oe=f,k=oe,!M)return m=(d|0)!=0,k?m?(n[d>>2]=s|0,n[d+4>>2]=l&0,oe=0,d=0,Ce=oe,d|0):(oe=0,d=0,Ce=oe,d|0):(m&&(n[d>>2]=(O>>>0)%(B>>>0),n[d+4>>2]=0),oe=0,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=Ce,F=k,k=0;do f=F,F=m>>>31|F<<1,m=k|m<<1,f=s<<1|f>>>31|0,oe=s>>>31|l<<1|0,jD(M|0,c|0,f|0,oe|0)|0,Oe=Ce,We=Oe>>31|((Oe|0)<0?-1:0)<<1,k=We&1,s=jD(f|0,oe|0,We&j|0,(((Oe|0)<0?-1:0)>>31|((Oe|0)<0?-1:0)<<1)&O|0)|0,l=Ce,B=B-1|0;while(B|0);M=F,F=0}return B=0,d|0&&(n[d>>2]=s,n[d+4>>2]=l),We=(m|0)>>>31|(M|B)<<1|(B<<1|m>>>31)&0|F,Oe=(m<<1|0)&-2|k,Ce=We,Oe|0}function uT(s,l,c,f){return s=s|0,l=l|0,c=c|0,f=f|0,J7(s,l,c,f,0)|0}function Tp(s){s=s|0;var l=0,c=0;return c=s+15&-16|0,l=n[w>>2]|0,s=l+c|0,(c|0)>0&(s|0)<(l|0)|(s|0)<0?(se()|0,yc(12),-1):(n[w>>2]=s,(s|0)>($()|0)&&!(X()|0)?(n[w>>2]=l,yc(12),-1):l|0)}function rw(s,l,c){s=s|0,l=l|0,c=c|0;var f=0;if((l|0)<(s|0)&(s|0)<(l+c|0)){for(f=s,l=l+c|0,s=s+c|0;(c|0)>0;)s=s-1|0,l=l-1|0,c=c-1|0,o[s>>0]=o[l>>0]|0;s=f}else br(s,l,c)|0;return s|0}function AT(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0;var d=0,m=0;return m=C,C=C+16|0,d=m|0,J7(s,l,c,f,d)|0,C=m,Ce=n[d+4>>2]|0,n[d>>2]|0|0}function X7(s){return s=s|0,(s&255)<<24|(s>>8&255)<<16|(s>>16&255)<<8|s>>>24|0}function VUe(s,l,c,f,d,m){s=s|0,l=l|0,c=c|0,f=f|0,d=d|0,m=m|0,Z7[s&1](l|0,c|0,f|0,d|0,m|0)}function zUe(s,l,c){s=s|0,l=l|0,c=y(c),$7[s&1](l|0,y(c))}function JUe(s,l,c){s=s|0,l=l|0,c=+c,eW[s&31](l|0,+c)}function XUe(s,l,c,f){return s=s|0,l=l|0,c=y(c),f=y(f),y(tW[s&0](l|0,y(c),y(f)))}function ZUe(s,l){s=s|0,l=l|0,ef[s&127](l|0)}function $Ue(s,l,c){s=s|0,l=l|0,c=c|0,tf[s&31](l|0,c|0)}function e3e(s,l){return s=s|0,l=l|0,_0[s&31](l|0)|0}function t3e(s,l,c,f,d){s=s|0,l=l|0,c=+c,f=+f,d=d|0,rW[s&1](l|0,+c,+f,d|0)}function r3e(s,l,c,f){s=s|0,l=l|0,c=+c,f=+f,N3e[s&1](l|0,+c,+f)}function n3e(s,l,c,f){return s=s|0,l=l|0,c=c|0,f=f|0,YD[s&7](l|0,c|0,f|0)|0}function i3e(s,l,c,f){return s=s|0,l=l|0,c=c|0,f=f|0,+O3e[s&1](l|0,c|0,f|0)}function s3e(s,l){return s=s|0,l=l|0,+nW[s&15](l|0)}function o3e(s,l,c){return s=s|0,l=l|0,c=+c,M3e[s&1](l|0,+c)|0}function a3e(s,l,c){return s=s|0,l=l|0,c=c|0,pT[s&15](l|0,c|0)|0}function l3e(s,l,c,f,d,m){s=s|0,l=l|0,c=c|0,f=+f,d=+d,m=m|0,U3e[s&1](l|0,c|0,+f,+d,m|0)}function c3e(s,l,c,f,d,m,B){s=s|0,l=l|0,c=c|0,f=f|0,d=d|0,m=m|0,B=B|0,_3e[s&1](l|0,c|0,f|0,d|0,m|0,B|0)}function u3e(s,l,c){return s=s|0,l=l|0,c=c|0,+iW[s&7](l|0,c|0)}function A3e(s){return s=s|0,KD[s&7]()|0}function f3e(s,l,c,f,d,m){return s=s|0,l=l|0,c=c|0,f=f|0,d=d|0,m=m|0,sW[s&1](l|0,c|0,f|0,d|0,m|0)|0}function p3e(s,l,c,f,d){s=s|0,l=l|0,c=c|0,f=f|0,d=+d,H3e[s&1](l|0,c|0,f|0,+d)}function h3e(s,l,c,f,d,m,B){s=s|0,l=l|0,c=c|0,f=y(f),d=d|0,m=y(m),B=B|0,oW[s&1](l|0,c|0,y(f),d|0,y(m),B|0)}function g3e(s,l,c,f){s=s|0,l=l|0,c=c|0,f=f|0,sw[s&15](l|0,c|0,f|0)}function d3e(s){s=s|0,aW[s&0]()}function m3e(s,l,c,f){s=s|0,l=l|0,c=c|0,f=+f,lW[s&15](l|0,c|0,+f)}function y3e(s,l,c){return s=s|0,l=+l,c=+c,q3e[s&1](+l,+c)|0}function E3e(s,l,c,f,d){s=s|0,l=l|0,c=c|0,f=f|0,d=d|0,hT[s&15](l|0,c|0,f|0,d|0)}function C3e(s,l,c,f,d){s=s|0,l=l|0,c=c|0,f=f|0,d=d|0,R(0)}function I3e(s,l){s=s|0,l=y(l),R(1)}function Ca(s,l){s=s|0,l=+l,R(2)}function w3e(s,l,c){return s=s|0,l=y(l),c=y(c),R(3),Ze}function Cr(s){s=s|0,R(4)}function nw(s,l){s=s|0,l=l|0,R(5)}function tl(s){return s=s|0,R(6),0}function B3e(s,l,c,f){s=s|0,l=+l,c=+c,f=f|0,R(7)}function v3e(s,l,c){s=s|0,l=+l,c=+c,R(8)}function D3e(s,l,c){return s=s|0,l=l|0,c=c|0,R(9),0}function P3e(s,l,c){return s=s|0,l=l|0,c=c|0,R(10),0}function U0(s){return s=s|0,R(11),0}function S3e(s,l){return s=s|0,l=+l,R(12),0}function iw(s,l){return s=s|0,l=l|0,R(13),0}function x3e(s,l,c,f,d){s=s|0,l=l|0,c=+c,f=+f,d=d|0,R(14)}function b3e(s,l,c,f,d,m){s=s|0,l=l|0,c=c|0,f=f|0,d=d|0,m=m|0,R(15)}function fT(s,l){return s=s|0,l=l|0,R(16),0}function k3e(){return R(17),0}function Q3e(s,l,c,f,d){return s=s|0,l=l|0,c=c|0,f=f|0,d=d|0,R(18),0}function F3e(s,l,c,f){s=s|0,l=l|0,c=c|0,f=+f,R(19)}function R3e(s,l,c,f,d,m){s=s|0,l=l|0,c=y(c),f=f|0,d=y(d),m=m|0,R(20)}function WD(s,l,c){s=s|0,l=l|0,c=c|0,R(21)}function T3e(){R(22)}function om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O3e=[P3e,sxe],nW=[U0,Pp,CD,zA,oR,v,P,Q,H,Y,U0,U0,U0,U0,U0,U0],M3e=[S3e,lTe],pT=[iw,qUe,DD,sDe,tPe,JPe,ASe,Oxe,Sbe,QQe,Md,DMe,iw,iw,iw,iw],U3e=[x3e,ODe],_3e=[b3e,l4e],iW=[fT,XF,Be,Ue,ft,Ixe,fT,fT],KD=[k3e,jt,Ud,gD,yTe,MTe,mLe,O4e],sW=[Q3e,kd],H3e=[F3e,ske],oW=[R3e,tR],sw=[WD,oo,yD,ZF,Qc,mPe,PSe,Ike,Oke,WF,eOe,uMe,B4e,WD,WD,WD],aW=[T3e],lW=[om,KF,jd,VA,MI,kc,Kd,S0,jbe,_Fe,iTe,om,om,om,om,om],q3e=[L3e,iLe],hT=[am,jSe,eFe,sRe,KRe,vTe,GTe,vLe,$Le,qOe,V4e,am,am,am,am,am];return{_llvm_bswap_i32:X7,dynCall_idd:y3e,dynCall_i:A3e,_i64Subtract:jD,___udivdi3:uT,dynCall_vif:zUe,setThrew:No,dynCall_viii:g3e,_bitshift64Lshr:GD,_bitshift64Shl:V7,dynCall_vi:ZUe,dynCall_viiddi:l3e,dynCall_diii:i3e,dynCall_iii:a3e,_memset:sm,_sbrk:Tp,_memcpy:br,__GLOBAL__sub_I_Yoga_cpp:FI,dynCall_vii:$Ue,___uremdi3:AT,dynCall_vid:JUe,stackAlloc:ca,_nbind_init:sUe,getTempRet0:TA,dynCall_di:s3e,dynCall_iid:o3e,setTempRet0:RA,_i64Add:cT,dynCall_fiff:XUe,dynCall_iiii:n3e,_emscripten_get_global_libc:dUe,dynCall_viid:m3e,dynCall_viiid:p3e,dynCall_viififi:h3e,dynCall_ii:e3e,__GLOBAL__sub_I_Binding_cc:IOe,dynCall_viiii:E3e,dynCall_iiiiii:f3e,stackSave:mu,dynCall_viiiii:VUe,__GLOBAL__sub_I_nbind_cc:wr,dynCall_vidd:r3e,_free:HD,runPostSets:KUe,dynCall_viiiiii:c3e,establishStackSpace:dn,_memmove:rw,stackRestore:Bl,_malloc:_D,__GLOBAL__sub_I_common_cc:HLe,dynCall_viddi:t3e,dynCall_dii:u3e,dynCall_v:d3e}}(Module.asmGlobalArg,Module.asmLibraryArg,buffer),_llvm_bswap_i32=Module._llvm_bswap_i32=asm._llvm_bswap_i32,getTempRet0=Module.getTempRet0=asm.getTempRet0,___udivdi3=Module.___udivdi3=asm.___udivdi3,setThrew=Module.setThrew=asm.setThrew,_bitshift64Lshr=Module._bitshift64Lshr=asm._bitshift64Lshr,_bitshift64Shl=Module._bitshift64Shl=asm._bitshift64Shl,_memset=Module._memset=asm._memset,_sbrk=Module._sbrk=asm._sbrk,_memcpy=Module._memcpy=asm._memcpy,stackAlloc=Module.stackAlloc=asm.stackAlloc,___uremdi3=Module.___uremdi3=asm.___uremdi3,_nbind_init=Module._nbind_init=asm._nbind_init,_i64Subtract=Module._i64Subtract=asm._i64Subtract,setTempRet0=Module.setTempRet0=asm.setTempRet0,_i64Add=Module._i64Add=asm._i64Add,_emscripten_get_global_libc=Module._emscripten_get_global_libc=asm._emscripten_get_global_libc,__GLOBAL__sub_I_Yoga_cpp=Module.__GLOBAL__sub_I_Yoga_cpp=asm.__GLOBAL__sub_I_Yoga_cpp,__GLOBAL__sub_I_Binding_cc=Module.__GLOBAL__sub_I_Binding_cc=asm.__GLOBAL__sub_I_Binding_cc,stackSave=Module.stackSave=asm.stackSave,__GLOBAL__sub_I_nbind_cc=Module.__GLOBAL__sub_I_nbind_cc=asm.__GLOBAL__sub_I_nbind_cc,_free=Module._free=asm._free,runPostSets=Module.runPostSets=asm.runPostSets,establishStackSpace=Module.establishStackSpace=asm.establishStackSpace,_memmove=Module._memmove=asm._memmove,stackRestore=Module.stackRestore=asm.stackRestore,_malloc=Module._malloc=asm._malloc,__GLOBAL__sub_I_common_cc=Module.__GLOBAL__sub_I_common_cc=asm.__GLOBAL__sub_I_common_cc,dynCall_viiiii=Module.dynCall_viiiii=asm.dynCall_viiiii,dynCall_vif=Module.dynCall_vif=asm.dynCall_vif,dynCall_vid=Module.dynCall_vid=asm.dynCall_vid,dynCall_fiff=Module.dynCall_fiff=asm.dynCall_fiff,dynCall_vi=Module.dynCall_vi=asm.dynCall_vi,dynCall_vii=Module.dynCall_vii=asm.dynCall_vii,dynCall_ii=Module.dynCall_ii=asm.dynCall_ii,dynCall_viddi=Module.dynCall_viddi=asm.dynCall_viddi,dynCall_vidd=Module.dynCall_vidd=asm.dynCall_vidd,dynCall_iiii=Module.dynCall_iiii=asm.dynCall_iiii,dynCall_diii=Module.dynCall_diii=asm.dynCall_diii,dynCall_di=Module.dynCall_di=asm.dynCall_di,dynCall_iid=Module.dynCall_iid=asm.dynCall_iid,dynCall_iii=Module.dynCall_iii=asm.dynCall_iii,dynCall_viiddi=Module.dynCall_viiddi=asm.dynCall_viiddi,dynCall_viiiiii=Module.dynCall_viiiiii=asm.dynCall_viiiiii,dynCall_dii=Module.dynCall_dii=asm.dynCall_dii,dynCall_i=Module.dynCall_i=asm.dynCall_i,dynCall_iiiiii=Module.dynCall_iiiiii=asm.dynCall_iiiiii,dynCall_viiid=Module.dynCall_viiid=asm.dynCall_viiid,dynCall_viififi=Module.dynCall_viififi=asm.dynCall_viififi,dynCall_viii=Module.dynCall_viii=asm.dynCall_viii,dynCall_v=Module.dynCall_v=asm.dynCall_v,dynCall_viid=Module.dynCall_viid=asm.dynCall_viid,dynCall_idd=Module.dynCall_idd=asm.dynCall_idd,dynCall_viiii=Module.dynCall_viiii=asm.dynCall_viiii;Runtime.stackAlloc=Module.stackAlloc,Runtime.stackSave=Module.stackSave,Runtime.stackRestore=Module.stackRestore,Runtime.establishStackSpace=Module.establishStackSpace,Runtime.setTempRet0=Module.setTempRet0,Runtime.getTempRet0=Module.getTempRet0,Module.asm=asm;function ExitStatus(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}ExitStatus.prototype=new Error,ExitStatus.prototype.constructor=ExitStatus;var initialStackTop,preloadStartTime=null,calledMain=!1;dependenciesFulfilled=function t(){Module.calledRun||run(),Module.calledRun||(dependenciesFulfilled=t)},Module.callMain=Module.callMain=function t(e){e=e||[],ensureInitRuntime();var r=e.length+1;function o(){for(var p=0;p<3;p++)a.push(0)}var a=[allocate(intArrayFromString(Module.thisProgram),"i8",ALLOC_NORMAL)];o();for(var n=0;n0||(preRun(),runDependencies>0)||Module.calledRun)return;function e(){Module.calledRun||(Module.calledRun=!0,!ABORT&&(ensureInitRuntime(),preMain(),Module.onRuntimeInitialized&&Module.onRuntimeInitialized(),Module._main&&shouldRunNow&&Module.callMain(t),postRun()))}Module.setStatus?(Module.setStatus("Running..."),setTimeout(function(){setTimeout(function(){Module.setStatus("")},1),e()},1)):e()}Module.run=Module.run=run;function exit(t,e){e&&Module.noExitRuntime||(Module.noExitRuntime||(ABORT=!0,EXITSTATUS=t,STACKTOP=initialStackTop,exitRuntime(),Module.onExit&&Module.onExit(t)),ENVIRONMENT_IS_NODE&&process.exit(t),Module.quit(t,new ExitStatus(t)))}Module.exit=Module.exit=exit;var abortDecorators=[];function abort(t){Module.onAbort&&Module.onAbort(t),t!==void 0?(Module.print(t),Module.printErr(t),t=JSON.stringify(t)):t="",ABORT=!0,EXITSTATUS=1;var e=` If this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.`,r="abort("+t+") at "+stackTrace()+e;throw abortDecorators&&abortDecorators.forEach(function(o){r=o(r,t)}),r}if(Module.abort=Module.abort=abort,Module.preInit)for(typeof Module.preInit=="function"&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.pop()();var shouldRunNow=!0;Module.noInitialRun&&(shouldRunNow=!1),run()})});var id=_((nKt,SCe)=>{"use strict";var byt=DCe(),kyt=PCe(),pq=!1,hq=null;kyt({},function(t,e){if(!pq){if(pq=!0,t)throw t;hq=e}});if(!pq)throw new Error("Failed to load the yoga module - it needed to be loaded synchronously, but didn't");SCe.exports=byt(hq.bind,hq.lib)});var dq=_((iKt,gq)=>{"use strict";var xCe=t=>Number.isNaN(t)?!1:t>=4352&&(t<=4447||t===9001||t===9002||11904<=t&&t<=12871&&t!==12351||12880<=t&&t<=19903||19968<=t&&t<=42182||43360<=t&&t<=43388||44032<=t&&t<=55203||63744<=t&&t<=64255||65040<=t&&t<=65049||65072<=t&&t<=65131||65281<=t&&t<=65376||65504<=t&&t<=65510||110592<=t&&t<=110593||127488<=t&&t<=127569||131072<=t&&t<=262141);gq.exports=xCe;gq.exports.default=xCe});var kCe=_((sKt,bCe)=>{"use strict";bCe.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF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uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27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-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var PB=_((oKt,mq)=>{"use strict";var Qyt=pS(),Fyt=dq(),Ryt=kCe(),QCe=t=>{if(typeof t!="string"||t.length===0||(t=Qyt(t),t.length===0))return 0;t=t.replace(Ryt()," ");let e=0;for(let r=0;r=127&&o<=159||o>=768&&o<=879||(o>65535&&r++,e+=Fyt(o)?2:1)}return e};mq.exports=QCe;mq.exports.default=QCe});var Eq=_((aKt,yq)=>{"use strict";var Tyt=PB(),FCe=t=>{let e=0;for(let r of t.split(` `))e=Math.max(e,Tyt(r));return e};yq.exports=FCe;yq.exports.default=FCe});var RCe=_(SB=>{"use strict";var Lyt=SB&&SB.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(SB,"__esModule",{value:!0});var Nyt=Lyt(Eq()),Cq={};SB.default=t=>{if(t.length===0)return{width:0,height:0};if(Cq[t])return Cq[t];let e=Nyt.default(t),r=t.split(` `).length;return Cq[t]={width:e,height:r},{width:e,height:r}}});var TCe=_(xB=>{"use strict";var Oyt=xB&&xB.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(xB,"__esModule",{value:!0});var In=Oyt(id()),Myt=(t,e)=>{"position"in e&&t.setPositionType(e.position==="absolute"?In.default.POSITION_TYPE_ABSOLUTE:In.default.POSITION_TYPE_RELATIVE)},Uyt=(t,e)=>{"marginLeft"in e&&t.setMargin(In.default.EDGE_START,e.marginLeft||0),"marginRight"in e&&t.setMargin(In.default.EDGE_END,e.marginRight||0),"marginTop"in e&&t.setMargin(In.default.EDGE_TOP,e.marginTop||0),"marginBottom"in e&&t.setMargin(In.default.EDGE_BOTTOM,e.marginBottom||0)},_yt=(t,e)=>{"paddingLeft"in e&&t.setPadding(In.default.EDGE_LEFT,e.paddingLeft||0),"paddingRight"in e&&t.setPadding(In.default.EDGE_RIGHT,e.paddingRight||0),"paddingTop"in e&&t.setPadding(In.default.EDGE_TOP,e.paddingTop||0),"paddingBottom"in e&&t.setPadding(In.default.EDGE_BOTTOM,e.paddingBottom||0)},Hyt=(t,e)=>{var r;"flexGrow"in e&&t.setFlexGrow((r=e.flexGrow)!==null&&r!==void 0?r:0),"flexShrink"in e&&t.setFlexShrink(typeof e.flexShrink=="number"?e.flexShrink:1),"flexDirection"in e&&(e.flexDirection==="row"&&t.setFlexDirection(In.default.FLEX_DIRECTION_ROW),e.flexDirection==="row-reverse"&&t.setFlexDirection(In.default.FLEX_DIRECTION_ROW_REVERSE),e.flexDirection==="column"&&t.setFlexDirection(In.default.FLEX_DIRECTION_COLUMN),e.flexDirection==="column-reverse"&&t.setFlexDirection(In.default.FLEX_DIRECTION_COLUMN_REVERSE)),"flexBasis"in e&&(typeof e.flexBasis=="number"?t.setFlexBasis(e.flexBasis):typeof e.flexBasis=="string"?t.setFlexBasisPercent(Number.parseInt(e.flexBasis,10)):t.setFlexBasis(NaN)),"alignItems"in e&&((e.alignItems==="stretch"||!e.alignItems)&&t.setAlignItems(In.default.ALIGN_STRETCH),e.alignItems==="flex-start"&&t.setAlignItems(In.default.ALIGN_FLEX_START),e.alignItems==="center"&&t.setAlignItems(In.default.ALIGN_CENTER),e.alignItems==="flex-end"&&t.setAlignItems(In.default.ALIGN_FLEX_END)),"alignSelf"in e&&((e.alignSelf==="auto"||!e.alignSelf)&&t.setAlignSelf(In.default.ALIGN_AUTO),e.alignSelf==="flex-start"&&t.setAlignSelf(In.default.ALIGN_FLEX_START),e.alignSelf==="center"&&t.setAlignSelf(In.default.ALIGN_CENTER),e.alignSelf==="flex-end"&&t.setAlignSelf(In.default.ALIGN_FLEX_END)),"justifyContent"in e&&((e.justifyContent==="flex-start"||!e.justifyContent)&&t.setJustifyContent(In.default.JUSTIFY_FLEX_START),e.justifyContent==="center"&&t.setJustifyContent(In.default.JUSTIFY_CENTER),e.justifyContent==="flex-end"&&t.setJustifyContent(In.default.JUSTIFY_FLEX_END),e.justifyContent==="space-between"&&t.setJustifyContent(In.default.JUSTIFY_SPACE_BETWEEN),e.justifyContent==="space-around"&&t.setJustifyContent(In.default.JUSTIFY_SPACE_AROUND))},qyt=(t,e)=>{var r,o;"width"in e&&(typeof e.width=="number"?t.setWidth(e.width):typeof e.width=="string"?t.setWidthPercent(Number.parseInt(e.width,10)):t.setWidthAuto()),"height"in e&&(typeof e.height=="number"?t.setHeight(e.height):typeof e.height=="string"?t.setHeightPercent(Number.parseInt(e.height,10)):t.setHeightAuto()),"minWidth"in e&&(typeof e.minWidth=="string"?t.setMinWidthPercent(Number.parseInt(e.minWidth,10)):t.setMinWidth((r=e.minWidth)!==null&&r!==void 0?r:0)),"minHeight"in e&&(typeof e.minHeight=="string"?t.setMinHeightPercent(Number.parseInt(e.minHeight,10)):t.setMinHeight((o=e.minHeight)!==null&&o!==void 0?o:0))},jyt=(t,e)=>{"display"in e&&t.setDisplay(e.display==="flex"?In.default.DISPLAY_FLEX:In.default.DISPLAY_NONE)},Gyt=(t,e)=>{if("borderStyle"in e){let r=typeof e.borderStyle=="string"?1:0;t.setBorder(In.default.EDGE_TOP,r),t.setBorder(In.default.EDGE_BOTTOM,r),t.setBorder(In.default.EDGE_LEFT,r),t.setBorder(In.default.EDGE_RIGHT,r)}};xB.default=(t,e={})=>{Myt(t,e),Uyt(t,e),_yt(t,e),Hyt(t,e),qyt(t,e),jyt(t,e),Gyt(t,e)}});var OCe=_((uKt,NCe)=>{"use strict";var bB=PB(),Wyt=pS(),Yyt=qw(),wq=new Set(["\x1B","\x9B"]),Kyt=39,LCe=t=>`${wq.values().next().value}[${t}m`,Vyt=t=>t.split(" ").map(e=>bB(e)),Iq=(t,e,r)=>{let o=[...e],a=!1,n=bB(Wyt(t[t.length-1]));for(let[u,A]of o.entries()){let p=bB(A);if(n+p<=r?t[t.length-1]+=A:(t.push(A),n=0),wq.has(A))a=!0;else if(a&&A==="m"){a=!1;continue}a||(n+=p,n===r&&u0&&t.length>1&&(t[t.length-2]+=t.pop())},zyt=t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(bB(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},Jyt=(t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let o="",a="",n,u=Vyt(t),A=[""];for(let[p,h]of t.split(" ").entries()){r.trim!==!1&&(A[A.length-1]=A[A.length-1].trimLeft());let E=bB(A[A.length-1]);if(p!==0&&(E>=e&&(r.wordWrap===!1||r.trim===!1)&&(A.push(""),E=0),(E>0||r.trim===!1)&&(A[A.length-1]+=" ",E++)),r.hard&&u[p]>e){let w=e-E,D=1+Math.floor((u[p]-w-1)/e);Math.floor((u[p]-1)/e)e&&E>0&&u[p]>0){if(r.wordWrap===!1&&Ee&&r.wordWrap===!1){Iq(A,h,e);continue}A[A.length-1]+=h}r.trim!==!1&&(A=A.map(zyt)),o=A.join(` `);for(let[p,h]of[...o].entries()){if(a+=h,wq.has(h)){let w=parseFloat(/\d[^m]*/.exec(o.slice(p,p+4)));n=w===Kyt?null:w}let E=Yyt.codes.get(Number(n));n&&E&&(o[p+1]===` `?a+=LCe(E):h===` `&&(a+=LCe(n)))}return a};NCe.exports=(t,e,r)=>String(t).normalize().replace(/\r\n/g,` `).split(` `).map(o=>Jyt(o,e,r)).join(` `)});var _Ce=_((AKt,UCe)=>{"use strict";var MCe="[\uD800-\uDBFF][\uDC00-\uDFFF]",Xyt=t=>t&&t.exact?new RegExp(`^${MCe}$`):new RegExp(MCe,"g");UCe.exports=Xyt});var Bq=_((fKt,GCe)=>{"use strict";var Zyt=dq(),$yt=_Ce(),HCe=qw(),jCe=["\x1B","\x9B"],vQ=t=>`${jCe[0]}[${t}m`,qCe=(t,e,r)=>{let o=[];t=[...t];for(let a of t){let n=a;a.match(";")&&(a=a.split(";")[0][0]+"0");let u=HCe.codes.get(parseInt(a,10));if(u){let A=t.indexOf(u.toString());A>=0?t.splice(A,1):o.push(vQ(e?u:n))}else if(e){o.push(vQ(0));break}else o.push(vQ(n))}if(e&&(o=o.filter((a,n)=>o.indexOf(a)===n),r!==void 0)){let a=vQ(HCe.codes.get(parseInt(r,10)));o=o.reduce((n,u)=>u===a?[u,...n]:[...n,u],[])}return o.join("")};GCe.exports=(t,e,r)=>{let o=[...t.normalize()],a=[];r=typeof r=="number"?r:o.length;let n=!1,u,A=0,p="";for(let[h,E]of o.entries()){let w=!1;if(jCe.includes(E)){let D=/\d[^m]*/.exec(t.slice(h,h+18));u=D&&D.length>0?D[0]:void 0,Ae&&A<=r)p+=E;else if(A===e&&!n&&u!==void 0)p=qCe(a);else if(A>=r){p+=qCe(a,!0,u);break}}return p}});var YCe=_((pKt,WCe)=>{"use strict";var _h=Bq(),eEt=PB();function DQ(t,e,r){if(t.charAt(e)===" ")return e;for(let o=1;o<=3;o++)if(r){if(t.charAt(e+o)===" ")return e+o}else if(t.charAt(e-o)===" ")return e-o;return e}WCe.exports=(t,e,r)=>{r={position:"end",preferTruncationOnSpace:!1,...r};let{position:o,space:a,preferTruncationOnSpace:n}=r,u="\u2026",A=1;if(typeof t!="string")throw new TypeError(`Expected \`input\` to be a string, got ${typeof t}`);if(typeof e!="number")throw new TypeError(`Expected \`columns\` to be a number, got ${typeof e}`);if(e<1)return"";if(e===1)return u;let p=eEt(t);if(p<=e)return t;if(o==="start"){if(n){let h=DQ(t,p-e+1,!0);return u+_h(t,h,p).trim()}return a===!0&&(u+=" ",A=2),u+_h(t,p-e+A,p)}if(o==="middle"){a===!0&&(u=" "+u+" ",A=3);let h=Math.floor(e/2);if(n){let E=DQ(t,h),w=DQ(t,p-(e-h)+1,!0);return _h(t,0,E)+u+_h(t,w,p).trim()}return _h(t,0,h)+u+_h(t,p-(e-h)+A,p)}if(o==="end"){if(n){let h=DQ(t,e-1);return _h(t,0,h)+u}return a===!0&&(u=" "+u,A=2),_h(t,0,e-A)+u}throw new Error(`Expected \`options.position\` to be either \`start\`, \`middle\` or \`end\`, got ${o}`)}});var Dq=_(kB=>{"use strict";var KCe=kB&&kB.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(kB,"__esModule",{value:!0});var tEt=KCe(OCe()),rEt=KCe(YCe()),vq={};kB.default=(t,e,r)=>{let o=t+String(e)+String(r);if(vq[o])return vq[o];let a=t;if(r==="wrap"&&(a=tEt.default(t,e,{trim:!1,hard:!0})),r.startsWith("truncate")){let n="end";r==="truncate-middle"&&(n="middle"),r==="truncate-start"&&(n="start"),a=rEt.default(t,e,{position:n})}return vq[o]=a,a}});var Sq=_(Pq=>{"use strict";Object.defineProperty(Pq,"__esModule",{value:!0});var VCe=t=>{let e="";if(t.childNodes.length>0)for(let r of t.childNodes){let o="";r.nodeName==="#text"?o=r.nodeValue:((r.nodeName==="ink-text"||r.nodeName==="ink-virtual-text")&&(o=VCe(r)),o.length>0&&typeof r.internal_transform=="function"&&(o=r.internal_transform(o))),e+=o}return e};Pq.default=VCe});var xq=_(Ei=>{"use strict";var QB=Ei&&Ei.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ei,"__esModule",{value:!0});Ei.setTextNodeValue=Ei.createTextNode=Ei.setStyle=Ei.setAttribute=Ei.removeChildNode=Ei.insertBeforeNode=Ei.appendChildNode=Ei.createNode=Ei.TEXT_NAME=void 0;var nEt=QB(id()),zCe=QB(RCe()),iEt=QB(TCe()),sEt=QB(Dq()),oEt=QB(Sq());Ei.TEXT_NAME="#text";Ei.createNode=t=>{var e;let r={nodeName:t,style:{},attributes:{},childNodes:[],parentNode:null,yogaNode:t==="ink-virtual-text"?void 0:nEt.default.Node.create()};return t==="ink-text"&&((e=r.yogaNode)===null||e===void 0||e.setMeasureFunc(aEt.bind(null,r))),r};Ei.appendChildNode=(t,e)=>{var r;e.parentNode&&Ei.removeChildNode(e.parentNode,e),e.parentNode=t,t.childNodes.push(e),e.yogaNode&&((r=t.yogaNode)===null||r===void 0||r.insertChild(e.yogaNode,t.yogaNode.getChildCount())),(t.nodeName==="ink-text"||t.nodeName==="ink-virtual-text")&&PQ(t)};Ei.insertBeforeNode=(t,e,r)=>{var o,a;e.parentNode&&Ei.removeChildNode(e.parentNode,e),e.parentNode=t;let n=t.childNodes.indexOf(r);if(n>=0){t.childNodes.splice(n,0,e),e.yogaNode&&((o=t.yogaNode)===null||o===void 0||o.insertChild(e.yogaNode,n));return}t.childNodes.push(e),e.yogaNode&&((a=t.yogaNode)===null||a===void 0||a.insertChild(e.yogaNode,t.yogaNode.getChildCount())),(t.nodeName==="ink-text"||t.nodeName==="ink-virtual-text")&&PQ(t)};Ei.removeChildNode=(t,e)=>{var r,o;e.yogaNode&&((o=(r=e.parentNode)===null||r===void 0?void 0:r.yogaNode)===null||o===void 0||o.removeChild(e.yogaNode)),e.parentNode=null;let a=t.childNodes.indexOf(e);a>=0&&t.childNodes.splice(a,1),(t.nodeName==="ink-text"||t.nodeName==="ink-virtual-text")&&PQ(t)};Ei.setAttribute=(t,e,r)=>{t.attributes[e]=r};Ei.setStyle=(t,e)=>{t.style=e,t.yogaNode&&iEt.default(t.yogaNode,e)};Ei.createTextNode=t=>{let e={nodeName:"#text",nodeValue:t,yogaNode:void 0,parentNode:null,style:{}};return Ei.setTextNodeValue(e,t),e};var aEt=function(t,e){var r,o;let a=t.nodeName==="#text"?t.nodeValue:oEt.default(t),n=zCe.default(a);if(n.width<=e||n.width>=1&&e>0&&e<1)return n;let u=(o=(r=t.style)===null||r===void 0?void 0:r.textWrap)!==null&&o!==void 0?o:"wrap",A=sEt.default(a,e,u);return zCe.default(A)},JCe=t=>{var e;if(!(!t||!t.parentNode))return(e=t.yogaNode)!==null&&e!==void 0?e:JCe(t.parentNode)},PQ=t=>{let e=JCe(t);e?.markDirty()};Ei.setTextNodeValue=(t,e)=>{typeof e!="string"&&(e=String(e)),t.nodeValue=e,PQ(t)}});var tIe=_(FB=>{"use strict";var eIe=FB&&FB.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(FB,"__esModule",{value:!0});var XCe=uq(),lEt=eIe(ECe()),ZCe=eIe(id()),ko=xq(),$Ce=t=>{t?.unsetMeasureFunc(),t?.freeRecursive()};FB.default=lEt.default({schedulePassiveEffects:XCe.unstable_scheduleCallback,cancelPassiveEffects:XCe.unstable_cancelCallback,now:Date.now,getRootHostContext:()=>({isInsideText:!1}),prepareForCommit:()=>null,preparePortalMount:()=>null,clearContainer:()=>!1,shouldDeprioritizeSubtree:()=>!1,resetAfterCommit:t=>{if(t.isStaticDirty){t.isStaticDirty=!1,typeof t.onImmediateRender=="function"&&t.onImmediateRender();return}typeof t.onRender=="function"&&t.onRender()},getChildHostContext:(t,e)=>{let r=t.isInsideText,o=e==="ink-text"||e==="ink-virtual-text";return r===o?t:{isInsideText:o}},shouldSetTextContent:()=>!1,createInstance:(t,e,r,o)=>{if(o.isInsideText&&t==="ink-box")throw new Error(" can\u2019t be nested inside component");let a=t==="ink-text"&&o.isInsideText?"ink-virtual-text":t,n=ko.createNode(a);for(let[u,A]of Object.entries(e))u!=="children"&&(u==="style"?ko.setStyle(n,A):u==="internal_transform"?n.internal_transform=A:u==="internal_static"?n.internal_static=!0:ko.setAttribute(n,u,A));return n},createTextInstance:(t,e,r)=>{if(!r.isInsideText)throw new Error(`Text string "${t}" must be rendered inside component`);return ko.createTextNode(t)},resetTextContent:()=>{},hideTextInstance:t=>{ko.setTextNodeValue(t,"")},unhideTextInstance:(t,e)=>{ko.setTextNodeValue(t,e)},getPublicInstance:t=>t,hideInstance:t=>{var e;(e=t.yogaNode)===null||e===void 0||e.setDisplay(ZCe.default.DISPLAY_NONE)},unhideInstance:t=>{var e;(e=t.yogaNode)===null||e===void 0||e.setDisplay(ZCe.default.DISPLAY_FLEX)},appendInitialChild:ko.appendChildNode,appendChild:ko.appendChildNode,insertBefore:ko.insertBeforeNode,finalizeInitialChildren:(t,e,r,o)=>(t.internal_static&&(o.isStaticDirty=!0,o.staticNode=t),!1),supportsMutation:!0,appendChildToContainer:ko.appendChildNode,insertInContainerBefore:ko.insertBeforeNode,removeChildFromContainer:(t,e)=>{ko.removeChildNode(t,e),$Ce(e.yogaNode)},prepareUpdate:(t,e,r,o,a)=>{t.internal_static&&(a.isStaticDirty=!0);let n={},u=Object.keys(o);for(let A of u)if(o[A]!==r[A]){if(A==="style"&&typeof o.style=="object"&&typeof r.style=="object"){let h=o.style,E=r.style,w=Object.keys(h);for(let D of w){if(D==="borderStyle"||D==="borderColor"){if(typeof n.style!="object"){let b={};n.style=b}n.style.borderStyle=h.borderStyle,n.style.borderColor=h.borderColor}if(h[D]!==E[D]){if(typeof n.style!="object"){let b={};n.style=b}n.style[D]=h[D]}}continue}n[A]=o[A]}return n},commitUpdate:(t,e)=>{for(let[r,o]of Object.entries(e))r!=="children"&&(r==="style"?ko.setStyle(t,o):r==="internal_transform"?t.internal_transform=o:r==="internal_static"?t.internal_static=!0:ko.setAttribute(t,r,o))},commitTextUpdate:(t,e,r)=>{ko.setTextNodeValue(t,r)},removeChild:(t,e)=>{ko.removeChildNode(t,e),$Ce(e.yogaNode)}})});var nIe=_((yKt,rIe)=>{"use strict";rIe.exports=(t,e=1,r)=>{if(r={indent:" ",includeEmptyLines:!1,...r},typeof t!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof t}\``);if(typeof e!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof e}\``);if(typeof r.indent!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof r.indent}\``);if(e===0)return t;let o=r.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return t.replace(o,r.indent.repeat(e))}});var iIe=_(RB=>{"use strict";var cEt=RB&&RB.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(RB,"__esModule",{value:!0});var SQ=cEt(id());RB.default=t=>t.getComputedWidth()-t.getComputedPadding(SQ.default.EDGE_LEFT)-t.getComputedPadding(SQ.default.EDGE_RIGHT)-t.getComputedBorder(SQ.default.EDGE_LEFT)-t.getComputedBorder(SQ.default.EDGE_RIGHT)});var sIe=_((CKt,uEt)=>{uEt.exports={single:{topLeft:"\u250C",topRight:"\u2510",bottomRight:"\u2518",bottomLeft:"\u2514",vertical:"\u2502",horizontal:"\u2500"},double:{topLeft:"\u2554",topRight:"\u2557",bottomRight:"\u255D",bottomLeft:"\u255A",vertical:"\u2551",horizontal:"\u2550"},round:{topLeft:"\u256D",topRight:"\u256E",bottomRight:"\u256F",bottomLeft:"\u2570",vertical:"\u2502",horizontal:"\u2500"},bold:{topLeft:"\u250F",topRight:"\u2513",bottomRight:"\u251B",bottomLeft:"\u2517",vertical:"\u2503",horizontal:"\u2501"},singleDouble:{topLeft:"\u2553",topRight:"\u2556",bottomRight:"\u255C",bottomLeft:"\u2559",vertical:"\u2551",horizontal:"\u2500"},doubleSingle:{topLeft:"\u2552",topRight:"\u2555",bottomRight:"\u255B",bottomLeft:"\u2558",vertical:"\u2502",horizontal:"\u2550"},classic:{topLeft:"+",topRight:"+",bottomRight:"+",bottomLeft:"+",vertical:"|",horizontal:"-"}}});var aIe=_((IKt,bq)=>{"use strict";var oIe=sIe();bq.exports=oIe;bq.exports.default=oIe});var cIe=_((wKt,lIe)=>{"use strict";var AEt=(t,e,r)=>{let o=t.indexOf(e);if(o===-1)return t;let a=e.length,n=0,u="";do u+=t.substr(n,o-n)+e+r,n=o+a,o=t.indexOf(e,n);while(o!==-1);return u+=t.substr(n),u},fEt=(t,e,r,o)=>{let a=0,n="";do{let u=t[o-1]==="\r";n+=t.substr(a,(u?o-1:o)-a)+e+(u?`\r `:` `)+r,a=o+1,o=t.indexOf(` `,a)}while(o!==-1);return n+=t.substr(a),n};lIe.exports={stringReplaceAll:AEt,stringEncaseCRLFWithFirstIndex:fEt}});var hIe=_((BKt,pIe)=>{"use strict";var pEt=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,uIe=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,hEt=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,gEt=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,dEt=new Map([["n",` `],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function fIe(t){let e=t[0]==="u",r=t[1]==="{";return e&&!r&&t.length===5||t[0]==="x"&&t.length===3?String.fromCharCode(parseInt(t.slice(1),16)):e&&r?String.fromCodePoint(parseInt(t.slice(2,-1),16)):dEt.get(t)||t}function mEt(t,e){let r=[],o=e.trim().split(/\s*,\s*/g),a;for(let n of o){let u=Number(n);if(!Number.isNaN(u))r.push(u);else if(a=n.match(hEt))r.push(a[2].replace(gEt,(A,p,h)=>p?fIe(p):h));else throw new Error(`Invalid Chalk template style argument: ${n} (in style '${t}')`)}return r}function yEt(t){uIe.lastIndex=0;let e=[],r;for(;(r=uIe.exec(t))!==null;){let o=r[1];if(r[2]){let a=mEt(o,r[2]);e.push([o].concat(a))}else e.push([o])}return e}function AIe(t,e){let r={};for(let a of e)for(let n of a.styles)r[n[0]]=a.inverse?null:n.slice(1);let o=t;for(let[a,n]of Object.entries(r))if(Array.isArray(n)){if(!(a in o))throw new Error(`Unknown Chalk style: ${a}`);o=n.length>0?o[a](...n):o[a]}return o}pIe.exports=(t,e)=>{let r=[],o=[],a=[];if(e.replace(pEt,(n,u,A,p,h,E)=>{if(u)a.push(fIe(u));else if(p){let w=a.join("");a=[],o.push(r.length===0?w:AIe(t,r)(w)),r.push({inverse:A,styles:yEt(p)})}else if(h){if(r.length===0)throw new Error("Found extraneous } in Chalk template literal");o.push(AIe(t,r)(a.join(""))),a=[],r.pop()}else a.push(E)}),o.push(a.join("")),r.length>0){let n=`Chalk template literal is missing ${r.length} closing bracket${r.length===1?"":"s"} (\`}\`)`;throw new Error(n)}return o.join("")}});var FQ=_((vKt,CIe)=>{"use strict";var TB=qw(),{stdout:Qq,stderr:Fq}=$L(),{stringReplaceAll:EEt,stringEncaseCRLFWithFirstIndex:CEt}=cIe(),{isArray:xQ}=Array,dIe=["ansi","ansi","ansi256","ansi16m"],DC=Object.create(null),IEt=(t,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let r=Qq?Qq.level:0;t.level=e.level===void 0?r:e.level},Rq=class{constructor(e){return mIe(e)}},mIe=t=>{let e={};return IEt(e,t),e.template=(...r)=>EIe(e.template,...r),Object.setPrototypeOf(e,bQ.prototype),Object.setPrototypeOf(e.template,e),e.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},e.template.Instance=Rq,e.template};function bQ(t){return mIe(t)}for(let[t,e]of Object.entries(TB))DC[t]={get(){let r=kQ(this,Tq(e.open,e.close,this._styler),this._isEmpty);return Object.defineProperty(this,t,{value:r}),r}};DC.visible={get(){let t=kQ(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:t}),t}};var yIe=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let t of yIe)DC[t]={get(){let{level:e}=this;return function(...r){let o=Tq(TB.color[dIe[e]][t](...r),TB.color.close,this._styler);return kQ(this,o,this._isEmpty)}}};for(let t of yIe){let e="bg"+t[0].toUpperCase()+t.slice(1);DC[e]={get(){let{level:r}=this;return function(...o){let a=Tq(TB.bgColor[dIe[r]][t](...o),TB.bgColor.close,this._styler);return kQ(this,a,this._isEmpty)}}}}var wEt=Object.defineProperties(()=>{},{...DC,level:{enumerable:!0,get(){return this._generator.level},set(t){this._generator.level=t}}}),Tq=(t,e,r)=>{let o,a;return r===void 0?(o=t,a=e):(o=r.openAll+t,a=e+r.closeAll),{open:t,close:e,openAll:o,closeAll:a,parent:r}},kQ=(t,e,r)=>{let o=(...a)=>xQ(a[0])&&xQ(a[0].raw)?gIe(o,EIe(o,...a)):gIe(o,a.length===1?""+a[0]:a.join(" "));return Object.setPrototypeOf(o,wEt),o._generator=t,o._styler=e,o._isEmpty=r,o},gIe=(t,e)=>{if(t.level<=0||!e)return t._isEmpty?"":e;let r=t._styler;if(r===void 0)return e;let{openAll:o,closeAll:a}=r;if(e.indexOf("\x1B")!==-1)for(;r!==void 0;)e=EEt(e,r.close,r.open),r=r.parent;let n=e.indexOf(` `);return n!==-1&&(e=CEt(e,a,o,n)),o+e+a},kq,EIe=(t,...e)=>{let[r]=e;if(!xQ(r)||!xQ(r.raw))return e.join(" ");let o=e.slice(1),a=[r.raw[0]];for(let n=1;n{"use strict";var BEt=NB&&NB.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(NB,"__esModule",{value:!0});var LB=BEt(FQ()),vEt=/^(rgb|hsl|hsv|hwb)\(\s?(\d+),\s?(\d+),\s?(\d+)\s?\)$/,DEt=/^(ansi|ansi256)\(\s?(\d+)\s?\)$/,RQ=(t,e)=>e==="foreground"?t:"bg"+t[0].toUpperCase()+t.slice(1);NB.default=(t,e,r)=>{if(!e)return t;if(e in LB.default){let a=RQ(e,r);return LB.default[a](t)}if(e.startsWith("#")){let a=RQ("hex",r);return LB.default[a](e)(t)}if(e.startsWith("ansi")){let a=DEt.exec(e);if(!a)return t;let n=RQ(a[1],r),u=Number(a[2]);return LB.default[n](u)(t)}if(e.startsWith("rgb")||e.startsWith("hsl")||e.startsWith("hsv")||e.startsWith("hwb")){let a=vEt.exec(e);if(!a)return t;let n=RQ(a[1],r),u=Number(a[2]),A=Number(a[3]),p=Number(a[4]);return LB.default[n](u,A,p)(t)}return t}});var wIe=_(OB=>{"use strict";var IIe=OB&&OB.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(OB,"__esModule",{value:!0});var PEt=IIe(aIe()),Nq=IIe(Lq());OB.default=(t,e,r,o)=>{if(typeof r.style.borderStyle=="string"){let a=r.yogaNode.getComputedWidth(),n=r.yogaNode.getComputedHeight(),u=r.style.borderColor,A=PEt.default[r.style.borderStyle],p=Nq.default(A.topLeft+A.horizontal.repeat(a-2)+A.topRight,u,"foreground"),h=(Nq.default(A.vertical,u,"foreground")+` `).repeat(n-2),E=Nq.default(A.bottomLeft+A.horizontal.repeat(a-2)+A.bottomRight,u,"foreground");o.write(t,e,p,{transformers:[]}),o.write(t,e+1,h,{transformers:[]}),o.write(t+a-1,e+1,h,{transformers:[]}),o.write(t,e+n-1,E,{transformers:[]})}}});var vIe=_(MB=>{"use strict";var sd=MB&&MB.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(MB,"__esModule",{value:!0});var SEt=sd(id()),xEt=sd(Eq()),bEt=sd(nIe()),kEt=sd(Dq()),QEt=sd(iIe()),FEt=sd(Sq()),REt=sd(wIe()),TEt=(t,e)=>{var r;let o=(r=t.childNodes[0])===null||r===void 0?void 0:r.yogaNode;if(o){let a=o.getComputedLeft(),n=o.getComputedTop();e=` `.repeat(n)+bEt.default(e,a)}return e},BIe=(t,e,r)=>{var o;let{offsetX:a=0,offsetY:n=0,transformers:u=[],skipStaticElements:A}=r;if(A&&t.internal_static)return;let{yogaNode:p}=t;if(p){if(p.getDisplay()===SEt.default.DISPLAY_NONE)return;let h=a+p.getComputedLeft(),E=n+p.getComputedTop(),w=u;if(typeof t.internal_transform=="function"&&(w=[t.internal_transform,...u]),t.nodeName==="ink-text"){let D=FEt.default(t);if(D.length>0){let b=xEt.default(D),C=QEt.default(p);if(b>C){let T=(o=t.style.textWrap)!==null&&o!==void 0?o:"wrap";D=kEt.default(D,C,T)}D=TEt(t,D),e.write(h,E,D,{transformers:w})}return}if(t.nodeName==="ink-box"&&REt.default(h,E,t,e),t.nodeName==="ink-root"||t.nodeName==="ink-box")for(let D of t.childNodes)BIe(D,e,{offsetX:h,offsetY:E,transformers:w,skipStaticElements:A})}};MB.default=BIe});var SIe=_(UB=>{"use strict";var PIe=UB&&UB.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(UB,"__esModule",{value:!0});var DIe=PIe(Bq()),LEt=PIe(PB()),Oq=class{constructor(e){this.writes=[];let{width:r,height:o}=e;this.width=r,this.height=o}write(e,r,o,a){let{transformers:n}=a;o&&this.writes.push({x:e,y:r,text:o,transformers:n})}get(){let e=[];for(let o=0;oo.trimRight()).join(` `),height:e.length}}};UB.default=Oq});var kIe=_(_B=>{"use strict";var Mq=_B&&_B.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(_B,"__esModule",{value:!0});var NEt=Mq(id()),xIe=Mq(vIe()),bIe=Mq(SIe());_B.default=(t,e)=>{var r;if(t.yogaNode.setWidth(e),t.yogaNode){t.yogaNode.calculateLayout(void 0,void 0,NEt.default.DIRECTION_LTR);let o=new bIe.default({width:t.yogaNode.getComputedWidth(),height:t.yogaNode.getComputedHeight()});xIe.default(t,o,{skipStaticElements:!0});let a;!((r=t.staticNode)===null||r===void 0)&&r.yogaNode&&(a=new bIe.default({width:t.staticNode.yogaNode.getComputedWidth(),height:t.staticNode.yogaNode.getComputedHeight()}),xIe.default(t.staticNode,a,{skipStaticElements:!1}));let{output:n,height:u}=o.get();return{output:n,outputHeight:u,staticOutput:a?`${a.get().output} `:""}}return{output:"",outputHeight:0,staticOutput:""}}});var TIe=_((kKt,RIe)=>{"use strict";var QIe=ve("stream"),FIe=["assert","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],Uq={},OEt=t=>{let e=new QIe.PassThrough,r=new QIe.PassThrough;e.write=a=>t("stdout",a),r.write=a=>t("stderr",a);let o=new console.Console(e,r);for(let a of FIe)Uq[a]=console[a],console[a]=o[a];return()=>{for(let a of FIe)console[a]=Uq[a];Uq={}}};RIe.exports=OEt});var Hq=_(_q=>{"use strict";Object.defineProperty(_q,"__esModule",{value:!0});_q.default=new WeakMap});var jq=_(qq=>{"use strict";Object.defineProperty(qq,"__esModule",{value:!0});var MEt=ln(),LIe=MEt.createContext({exit:()=>{}});LIe.displayName="InternalAppContext";qq.default=LIe});var Wq=_(Gq=>{"use strict";Object.defineProperty(Gq,"__esModule",{value:!0});var UEt=ln(),NIe=UEt.createContext({stdin:void 0,setRawMode:()=>{},isRawModeSupported:!1,internal_exitOnCtrlC:!0});NIe.displayName="InternalStdinContext";Gq.default=NIe});var Kq=_(Yq=>{"use strict";Object.defineProperty(Yq,"__esModule",{value:!0});var _Et=ln(),OIe=_Et.createContext({stdout:void 0,write:()=>{}});OIe.displayName="InternalStdoutContext";Yq.default=OIe});var zq=_(Vq=>{"use strict";Object.defineProperty(Vq,"__esModule",{value:!0});var HEt=ln(),MIe=HEt.createContext({stderr:void 0,write:()=>{}});MIe.displayName="InternalStderrContext";Vq.default=MIe});var TQ=_(Jq=>{"use strict";Object.defineProperty(Jq,"__esModule",{value:!0});var qEt=ln(),UIe=qEt.createContext({activeId:void 0,add:()=>{},remove:()=>{},activate:()=>{},deactivate:()=>{},enableFocus:()=>{},disableFocus:()=>{},focusNext:()=>{},focusPrevious:()=>{},focus:()=>{}});UIe.displayName="InternalFocusContext";Jq.default=UIe});var HIe=_((OKt,_Ie)=>{"use strict";var jEt=/[|\\{}()[\]^$+*?.-]/g;_Ie.exports=t=>{if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(jEt,"\\$&")}});var WIe=_((MKt,GIe)=>{"use strict";var GEt=HIe(),WEt=typeof process=="object"&&process&&typeof process.cwd=="function"?process.cwd():".",jIe=[].concat(ve("module").builtinModules,"bootstrap_node","node").map(t=>new RegExp(`(?:\\((?:node:)?${t}(?:\\.js)?:\\d+:\\d+\\)$|^\\s*at (?:node:)?${t}(?:\\.js)?:\\d+:\\d+$)`));jIe.push(/\((?:node:)?internal\/[^:]+:\d+:\d+\)$/,/\s*at (?:node:)?internal\/[^:]+:\d+:\d+$/,/\/\.node-spawn-wrap-\w+-\w+\/node:\d+:\d+\)?$/);var Xq=class t{constructor(e){e={ignoredPackages:[],...e},"internals"in e||(e.internals=t.nodeInternals()),"cwd"in e||(e.cwd=WEt),this._cwd=e.cwd.replace(/\\/g,"/"),this._internals=[].concat(e.internals,YEt(e.ignoredPackages)),this._wrapCallSite=e.wrapCallSite||!1}static nodeInternals(){return[...jIe]}clean(e,r=0){r=" ".repeat(r),Array.isArray(e)||(e=e.split(` `)),!/^\s*at /.test(e[0])&&/^\s*at /.test(e[1])&&(e=e.slice(1));let o=!1,a=null,n=[];return e.forEach(u=>{if(u=u.replace(/\\/g,"/"),this._internals.some(p=>p.test(u)))return;let A=/^\s*at /.test(u);o?u=u.trimEnd().replace(/^(\s+)at /,"$1"):(u=u.trim(),A&&(u=u.slice(3))),u=u.replace(`${this._cwd}/`,""),u&&(A?(a&&(n.push(a),a=null),n.push(u)):(o=!0,a=u))}),n.map(u=>`${r}${u} `).join("")}captureString(e,r=this.captureString){typeof e=="function"&&(r=e,e=1/0);let{stackTraceLimit:o}=Error;e&&(Error.stackTraceLimit=e);let a={};Error.captureStackTrace(a,r);let{stack:n}=a;return Error.stackTraceLimit=o,this.clean(n)}capture(e,r=this.capture){typeof e=="function"&&(r=e,e=1/0);let{prepareStackTrace:o,stackTraceLimit:a}=Error;Error.prepareStackTrace=(A,p)=>this._wrapCallSite?p.map(this._wrapCallSite):p,e&&(Error.stackTraceLimit=e);let n={};Error.captureStackTrace(n,r);let{stack:u}=n;return Object.assign(Error,{prepareStackTrace:o,stackTraceLimit:a}),u}at(e=this.at){let[r]=this.capture(1,e);if(!r)return{};let o={line:r.getLineNumber(),column:r.getColumnNumber()};qIe(o,r.getFileName(),this._cwd),r.isConstructor()&&(o.constructor=!0),r.isEval()&&(o.evalOrigin=r.getEvalOrigin()),r.isNative()&&(o.native=!0);let a;try{a=r.getTypeName()}catch{}a&&a!=="Object"&&a!=="[object Object]"&&(o.type=a);let n=r.getFunctionName();n&&(o.function=n);let u=r.getMethodName();return u&&n!==u&&(o.method=u),o}parseLine(e){let r=e&&e.match(KEt);if(!r)return null;let o=r[1]==="new",a=r[2],n=r[3],u=r[4],A=Number(r[5]),p=Number(r[6]),h=r[7],E=r[8],w=r[9],D=r[10]==="native",b=r[11]===")",C,T={};if(E&&(T.line=Number(E)),w&&(T.column=Number(w)),b&&h){let N=0;for(let U=h.length-1;U>0;U--)if(h.charAt(U)===")")N++;else if(h.charAt(U)==="("&&h.charAt(U-1)===" "&&(N--,N===-1&&h.charAt(U-1)===" ")){let z=h.slice(0,U-1);h=h.slice(U+1),a+=` (${z}`;break}}if(a){let N=a.match(VEt);N&&(a=N[1],C=N[2])}return qIe(T,h,this._cwd),o&&(T.constructor=!0),n&&(T.evalOrigin=n,T.evalLine=A,T.evalColumn=p,T.evalFile=u&&u.replace(/\\/g,"/")),D&&(T.native=!0),a&&(T.function=a),C&&a!==C&&(T.method=C),T}};function qIe(t,e,r){e&&(e=e.replace(/\\/g,"/"),e.startsWith(`${r}/`)&&(e=e.slice(r.length+1)),t.file=e)}function YEt(t){if(t.length===0)return[];let e=t.map(r=>GEt(r));return new RegExp(`[/\\\\]node_modules[/\\\\](?:${e.join("|")})[/\\\\][^:]+:\\d+:\\d+`)}var KEt=new RegExp("^(?:\\s*at )?(?:(new) )?(?:(.*?) \\()?(?:eval at ([^ ]+) \\((.+?):(\\d+):(\\d+)\\), )?(?:(.+?):(\\d+):(\\d+)|(native))(\\)?)$"),VEt=/^(.*?) \[as (.*?)\]$/;GIe.exports=Xq});var KIe=_((UKt,YIe)=>{"use strict";YIe.exports=(t,e)=>t.replace(/^\t+/gm,r=>" ".repeat(r.length*(e||2)))});var zIe=_((_Kt,VIe)=>{"use strict";var zEt=KIe(),JEt=(t,e)=>{let r=[],o=t-e,a=t+e;for(let n=o;n<=a;n++)r.push(n);return r};VIe.exports=(t,e,r)=>{if(typeof t!="string")throw new TypeError("Source code is missing.");if(!e||e<1)throw new TypeError("Line number must start from `1`.");if(t=zEt(t).split(/\r?\n/),!(e>t.length))return r={around:3,...r},JEt(e,r.around).filter(o=>t[o-1]!==void 0).map(o=>({line:o,value:t[o-1]}))}});var LQ=_(lu=>{"use strict";var XEt=lu&&lu.__createBinding||(Object.create?function(t,e,r,o){o===void 0&&(o=r),Object.defineProperty(t,o,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,o){o===void 0&&(o=r),t[o]=e[r]}),ZEt=lu&&lu.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),$Et=lu&&lu.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.hasOwnProperty.call(t,r)&&XEt(e,t,r);return ZEt(e,t),e},eCt=lu&&lu.__rest||function(t,e){var r={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(r[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,o=Object.getOwnPropertySymbols(t);a{var{children:r}=t,o=eCt(t,["children"]);let a=Object.assign(Object.assign({},o),{marginLeft:o.marginLeft||o.marginX||o.margin||0,marginRight:o.marginRight||o.marginX||o.margin||0,marginTop:o.marginTop||o.marginY||o.margin||0,marginBottom:o.marginBottom||o.marginY||o.margin||0,paddingLeft:o.paddingLeft||o.paddingX||o.padding||0,paddingRight:o.paddingRight||o.paddingX||o.padding||0,paddingTop:o.paddingTop||o.paddingY||o.padding||0,paddingBottom:o.paddingBottom||o.paddingY||o.padding||0});return JIe.default.createElement("ink-box",{ref:e,style:a},r)});Zq.displayName="Box";Zq.defaultProps={flexDirection:"row",flexGrow:0,flexShrink:1};lu.default=Zq});var tj=_(HB=>{"use strict";var $q=HB&&HB.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(HB,"__esModule",{value:!0});var tCt=$q(ln()),PC=$q(FQ()),XIe=$q(Lq()),ej=({color:t,backgroundColor:e,dimColor:r,bold:o,italic:a,underline:n,strikethrough:u,inverse:A,wrap:p,children:h})=>{if(h==null)return null;let E=w=>(r&&(w=PC.default.dim(w)),t&&(w=XIe.default(w,t,"foreground")),e&&(w=XIe.default(w,e,"background")),o&&(w=PC.default.bold(w)),a&&(w=PC.default.italic(w)),n&&(w=PC.default.underline(w)),u&&(w=PC.default.strikethrough(w)),A&&(w=PC.default.inverse(w)),w);return tCt.default.createElement("ink-text",{style:{flexGrow:0,flexShrink:1,flexDirection:"row",textWrap:p},internal_transform:E},h)};ej.displayName="Text";ej.defaultProps={dimColor:!1,bold:!1,italic:!1,underline:!1,strikethrough:!1,wrap:"wrap"};HB.default=ej});var twe=_(cu=>{"use strict";var rCt=cu&&cu.__createBinding||(Object.create?function(t,e,r,o){o===void 0&&(o=r),Object.defineProperty(t,o,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,o){o===void 0&&(o=r),t[o]=e[r]}),nCt=cu&&cu.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),iCt=cu&&cu.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.hasOwnProperty.call(t,r)&&rCt(e,t,r);return nCt(e,t),e},qB=cu&&cu.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(cu,"__esModule",{value:!0});var ZIe=iCt(ve("fs")),ps=qB(ln()),$Ie=qB(WIe()),sCt=qB(zIe()),zf=qB(LQ()),mA=qB(tj()),ewe=new $Ie.default({cwd:process.cwd(),internals:$Ie.default.nodeInternals()}),oCt=({error:t})=>{let e=t.stack?t.stack.split(` `).slice(1):void 0,r=e?ewe.parseLine(e[0]):void 0,o,a=0;if(r?.file&&r?.line&&ZIe.existsSync(r.file)){let n=ZIe.readFileSync(r.file,"utf8");if(o=sCt.default(n,r.line),o)for(let{line:u}of o)a=Math.max(a,String(u).length)}return ps.default.createElement(zf.default,{flexDirection:"column",padding:1},ps.default.createElement(zf.default,null,ps.default.createElement(mA.default,{backgroundColor:"red",color:"white"}," ","ERROR"," "),ps.default.createElement(mA.default,null," ",t.message)),r&&ps.default.createElement(zf.default,{marginTop:1},ps.default.createElement(mA.default,{dimColor:!0},r.file,":",r.line,":",r.column)),r&&o&&ps.default.createElement(zf.default,{marginTop:1,flexDirection:"column"},o.map(({line:n,value:u})=>ps.default.createElement(zf.default,{key:n},ps.default.createElement(zf.default,{width:a+1},ps.default.createElement(mA.default,{dimColor:n!==r.line,backgroundColor:n===r.line?"red":void 0,color:n===r.line?"white":void 0},String(n).padStart(a," "),":")),ps.default.createElement(mA.default,{key:n,backgroundColor:n===r.line?"red":void 0,color:n===r.line?"white":void 0}," "+u)))),t.stack&&ps.default.createElement(zf.default,{marginTop:1,flexDirection:"column"},t.stack.split(` `).slice(1).map(n=>{let u=ewe.parseLine(n);return u?ps.default.createElement(zf.default,{key:n},ps.default.createElement(mA.default,{dimColor:!0},"- "),ps.default.createElement(mA.default,{dimColor:!0,bold:!0},u.function),ps.default.createElement(mA.default,{dimColor:!0,color:"gray"}," ","(",u.file,":",u.line,":",u.column,")")):ps.default.createElement(zf.default,{key:n},ps.default.createElement(mA.default,{dimColor:!0},"- "),ps.default.createElement(mA.default,{dimColor:!0,bold:!0},n))})))};cu.default=oCt});var nwe=_(uu=>{"use strict";var aCt=uu&&uu.__createBinding||(Object.create?function(t,e,r,o){o===void 0&&(o=r),Object.defineProperty(t,o,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,o){o===void 0&&(o=r),t[o]=e[r]}),lCt=uu&&uu.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),cCt=uu&&uu.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.hasOwnProperty.call(t,r)&&aCt(e,t,r);return lCt(e,t),e},ad=uu&&uu.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(uu,"__esModule",{value:!0});var od=cCt(ln()),rwe=ad(Z6()),uCt=ad(jq()),ACt=ad(Wq()),fCt=ad(Kq()),pCt=ad(zq()),hCt=ad(TQ()),gCt=ad(twe()),dCt=" ",mCt="\x1B[Z",yCt="\x1B",NQ=class extends od.PureComponent{constructor(){super(...arguments),this.state={isFocusEnabled:!0,activeFocusId:void 0,focusables:[],error:void 0},this.rawModeEnabledCount=0,this.handleSetRawMode=e=>{let{stdin:r}=this.props;if(!this.isRawModeSupported())throw r===process.stdin?new Error(`Raw mode is not supported on the current process.stdin, which Ink uses as input stream by default. Read about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported`):new Error(`Raw mode is not supported on the stdin provided to Ink. Read about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported`);if(r.setEncoding("utf8"),e){this.rawModeEnabledCount===0&&(r.addListener("data",this.handleInput),r.resume(),r.setRawMode(!0)),this.rawModeEnabledCount++;return}--this.rawModeEnabledCount===0&&(r.setRawMode(!1),r.removeListener("data",this.handleInput),r.pause())},this.handleInput=e=>{e===""&&this.props.exitOnCtrlC&&this.handleExit(),e===yCt&&this.state.activeFocusId&&this.setState({activeFocusId:void 0}),this.state.isFocusEnabled&&this.state.focusables.length>0&&(e===dCt&&this.focusNext(),e===mCt&&this.focusPrevious())},this.handleExit=e=>{this.isRawModeSupported()&&this.handleSetRawMode(!1),this.props.onExit(e)},this.enableFocus=()=>{this.setState({isFocusEnabled:!0})},this.disableFocus=()=>{this.setState({isFocusEnabled:!1})},this.focus=e=>{this.setState(r=>r.focusables.some(a=>a?.id===e)?{activeFocusId:e}:r)},this.focusNext=()=>{this.setState(e=>{var r;let o=(r=e.focusables[0])===null||r===void 0?void 0:r.id;return{activeFocusId:this.findNextFocusable(e)||o}})},this.focusPrevious=()=>{this.setState(e=>{var r;let o=(r=e.focusables[e.focusables.length-1])===null||r===void 0?void 0:r.id;return{activeFocusId:this.findPreviousFocusable(e)||o}})},this.addFocusable=(e,{autoFocus:r})=>{this.setState(o=>{let a=o.activeFocusId;return!a&&r&&(a=e),{activeFocusId:a,focusables:[...o.focusables,{id:e,isActive:!0}]}})},this.removeFocusable=e=>{this.setState(r=>({activeFocusId:r.activeFocusId===e?void 0:r.activeFocusId,focusables:r.focusables.filter(o=>o.id!==e)}))},this.activateFocusable=e=>{this.setState(r=>({focusables:r.focusables.map(o=>o.id!==e?o:{id:e,isActive:!0})}))},this.deactivateFocusable=e=>{this.setState(r=>({activeFocusId:r.activeFocusId===e?void 0:r.activeFocusId,focusables:r.focusables.map(o=>o.id!==e?o:{id:e,isActive:!1})}))},this.findNextFocusable=e=>{var r;let o=e.focusables.findIndex(a=>a.id===e.activeFocusId);for(let a=o+1;a{var r;let o=e.focusables.findIndex(a=>a.id===e.activeFocusId);for(let a=o-1;a>=0;a--)if(!((r=e.focusables[a])===null||r===void 0)&&r.isActive)return e.focusables[a].id}}static getDerivedStateFromError(e){return{error:e}}isRawModeSupported(){return this.props.stdin.isTTY}render(){return od.default.createElement(uCt.default.Provider,{value:{exit:this.handleExit}},od.default.createElement(ACt.default.Provider,{value:{stdin:this.props.stdin,setRawMode:this.handleSetRawMode,isRawModeSupported:this.isRawModeSupported(),internal_exitOnCtrlC:this.props.exitOnCtrlC}},od.default.createElement(fCt.default.Provider,{value:{stdout:this.props.stdout,write:this.props.writeToStdout}},od.default.createElement(pCt.default.Provider,{value:{stderr:this.props.stderr,write:this.props.writeToStderr}},od.default.createElement(hCt.default.Provider,{value:{activeId:this.state.activeFocusId,add:this.addFocusable,remove:this.removeFocusable,activate:this.activateFocusable,deactivate:this.deactivateFocusable,enableFocus:this.enableFocus,disableFocus:this.disableFocus,focusNext:this.focusNext,focusPrevious:this.focusPrevious,focus:this.focus}},this.state.error?od.default.createElement(gCt.default,{error:this.state.error}):this.props.children)))))}componentDidMount(){rwe.default.hide(this.props.stdout)}componentWillUnmount(){rwe.default.show(this.props.stdout),this.isRawModeSupported()&&this.handleSetRawMode(!1)}componentDidCatch(e){this.handleExit(e)}};uu.default=NQ;NQ.displayName="InternalApp"});var owe=_(Au=>{"use strict";var ECt=Au&&Au.__createBinding||(Object.create?function(t,e,r,o){o===void 0&&(o=r),Object.defineProperty(t,o,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,o){o===void 0&&(o=r),t[o]=e[r]}),CCt=Au&&Au.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),ICt=Au&&Au.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.hasOwnProperty.call(t,r)&&ECt(e,t,r);return CCt(e,t),e},fu=Au&&Au.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Au,"__esModule",{value:!0});var wCt=fu(ln()),iwe=WM(),BCt=fu(tCe()),vCt=fu(K6()),DCt=fu(aCe()),PCt=fu(cCe()),rj=fu(tIe()),SCt=fu(kIe()),xCt=fu(X6()),bCt=fu(TIe()),kCt=ICt(xq()),QCt=fu(Hq()),FCt=fu(nwe()),SC=process.env.CI==="false"?!1:DCt.default,swe=()=>{},nj=class{constructor(e){this.resolveExitPromise=()=>{},this.rejectExitPromise=()=>{},this.unsubscribeExit=()=>{},this.onRender=()=>{if(this.isUnmounted)return;let{output:r,outputHeight:o,staticOutput:a}=SCt.default(this.rootNode,this.options.stdout.columns||80),n=a&&a!==` `;if(this.options.debug){n&&(this.fullStaticOutput+=a),this.options.stdout.write(this.fullStaticOutput+r);return}if(SC){n&&this.options.stdout.write(a),this.lastOutput=r;return}if(n&&(this.fullStaticOutput+=a),o>=this.options.stdout.rows){this.options.stdout.write(vCt.default.clearTerminal+this.fullStaticOutput+r),this.lastOutput=r;return}n&&(this.log.clear(),this.options.stdout.write(a),this.log(r)),!n&&r!==this.lastOutput&&this.throttledLog(r),this.lastOutput=r},PCt.default(this),this.options=e,this.rootNode=kCt.createNode("ink-root"),this.rootNode.onRender=e.debug?this.onRender:iwe(this.onRender,32,{leading:!0,trailing:!0}),this.rootNode.onImmediateRender=this.onRender,this.log=BCt.default.create(e.stdout),this.throttledLog=e.debug?this.log:iwe(this.log,void 0,{leading:!0,trailing:!0}),this.isUnmounted=!1,this.lastOutput="",this.fullStaticOutput="",this.container=rj.default.createContainer(this.rootNode,0,!1,null),this.unsubscribeExit=xCt.default(this.unmount,{alwaysLast:!1}),e.patchConsole&&this.patchConsole(),SC||(e.stdout.on("resize",this.onRender),this.unsubscribeResize=()=>{e.stdout.off("resize",this.onRender)})}render(e){let r=wCt.default.createElement(FCt.default,{stdin:this.options.stdin,stdout:this.options.stdout,stderr:this.options.stderr,writeToStdout:this.writeToStdout,writeToStderr:this.writeToStderr,exitOnCtrlC:this.options.exitOnCtrlC,onExit:this.unmount},e);rj.default.updateContainer(r,this.container,null,swe)}writeToStdout(e){if(!this.isUnmounted){if(this.options.debug){this.options.stdout.write(e+this.fullStaticOutput+this.lastOutput);return}if(SC){this.options.stdout.write(e);return}this.log.clear(),this.options.stdout.write(e),this.log(this.lastOutput)}}writeToStderr(e){if(!this.isUnmounted){if(this.options.debug){this.options.stderr.write(e),this.options.stdout.write(this.fullStaticOutput+this.lastOutput);return}if(SC){this.options.stderr.write(e);return}this.log.clear(),this.options.stderr.write(e),this.log(this.lastOutput)}}unmount(e){this.isUnmounted||(this.onRender(),this.unsubscribeExit(),typeof this.restoreConsole=="function"&&this.restoreConsole(),typeof this.unsubscribeResize=="function"&&this.unsubscribeResize(),SC?this.options.stdout.write(this.lastOutput+` `):this.options.debug||this.log.done(),this.isUnmounted=!0,rj.default.updateContainer(null,this.container,null,swe),QCt.default.delete(this.options.stdout),e instanceof Error?this.rejectExitPromise(e):this.resolveExitPromise())}waitUntilExit(){return this.exitPromise||(this.exitPromise=new Promise((e,r)=>{this.resolveExitPromise=e,this.rejectExitPromise=r})),this.exitPromise}clear(){!SC&&!this.options.debug&&this.log.clear()}patchConsole(){this.options.debug||(this.restoreConsole=bCt.default((e,r)=>{e==="stdout"&&this.writeToStdout(r),e==="stderr"&&(r.startsWith("The above error occurred")||this.writeToStderr(r))}))}};Au.default=nj});var lwe=_(jB=>{"use strict";var awe=jB&&jB.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(jB,"__esModule",{value:!0});var RCt=awe(owe()),OQ=awe(Hq()),TCt=ve("stream"),LCt=(t,e)=>{let r=Object.assign({stdout:process.stdout,stdin:process.stdin,stderr:process.stderr,debug:!1,exitOnCtrlC:!0,patchConsole:!0},NCt(e)),o=OCt(r.stdout,()=>new RCt.default(r));return o.render(t),{rerender:o.render,unmount:()=>o.unmount(),waitUntilExit:o.waitUntilExit,cleanup:()=>OQ.default.delete(r.stdout),clear:o.clear}};jB.default=LCt;var NCt=(t={})=>t instanceof TCt.Stream?{stdout:t,stdin:process.stdin}:t,OCt=(t,e)=>{let r;return OQ.default.has(t)?r=OQ.default.get(t):(r=e(),OQ.default.set(t,r)),r}});var uwe=_(Jf=>{"use strict";var MCt=Jf&&Jf.__createBinding||(Object.create?function(t,e,r,o){o===void 0&&(o=r),Object.defineProperty(t,o,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,o){o===void 0&&(o=r),t[o]=e[r]}),UCt=Jf&&Jf.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),_Ct=Jf&&Jf.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.hasOwnProperty.call(t,r)&&MCt(e,t,r);return UCt(e,t),e};Object.defineProperty(Jf,"__esModule",{value:!0});var GB=_Ct(ln()),cwe=t=>{let{items:e,children:r,style:o}=t,[a,n]=GB.useState(0),u=GB.useMemo(()=>e.slice(a),[e,a]);GB.useLayoutEffect(()=>{n(e.length)},[e.length]);let A=u.map((h,E)=>r(h,a+E)),p=GB.useMemo(()=>Object.assign({position:"absolute",flexDirection:"column"},o),[o]);return GB.default.createElement("ink-box",{internal_static:!0,style:p},A)};cwe.displayName="Static";Jf.default=cwe});var fwe=_(WB=>{"use strict";var HCt=WB&&WB.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(WB,"__esModule",{value:!0});var qCt=HCt(ln()),Awe=({children:t,transform:e})=>t==null?null:qCt.default.createElement("ink-text",{style:{flexGrow:0,flexShrink:1,flexDirection:"row"},internal_transform:e},t);Awe.displayName="Transform";WB.default=Awe});var hwe=_(YB=>{"use strict";var jCt=YB&&YB.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(YB,"__esModule",{value:!0});var GCt=jCt(ln()),pwe=({count:t=1})=>GCt.default.createElement("ink-text",null,` `.repeat(t));pwe.displayName="Newline";YB.default=pwe});var mwe=_(KB=>{"use strict";var gwe=KB&&KB.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(KB,"__esModule",{value:!0});var WCt=gwe(ln()),YCt=gwe(LQ()),dwe=()=>WCt.default.createElement(YCt.default,{flexGrow:1});dwe.displayName="Spacer";KB.default=dwe});var MQ=_(VB=>{"use strict";var KCt=VB&&VB.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(VB,"__esModule",{value:!0});var VCt=ln(),zCt=KCt(Wq()),JCt=()=>VCt.useContext(zCt.default);VB.default=JCt});var Ewe=_(zB=>{"use strict";var XCt=zB&&zB.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(zB,"__esModule",{value:!0});var ywe=ln(),ZCt=XCt(MQ()),$Ct=(t,e={})=>{let{stdin:r,setRawMode:o,internal_exitOnCtrlC:a}=ZCt.default();ywe.useEffect(()=>{if(e.isActive!==!1)return o(!0),()=>{o(!1)}},[e.isActive,o]),ywe.useEffect(()=>{if(e.isActive===!1)return;let n=u=>{let A=String(u),p={upArrow:A==="\x1B[A",downArrow:A==="\x1B[B",leftArrow:A==="\x1B[D",rightArrow:A==="\x1B[C",pageDown:A==="\x1B[6~",pageUp:A==="\x1B[5~",return:A==="\r",escape:A==="\x1B",ctrl:!1,shift:!1,tab:A===" "||A==="\x1B[Z",backspace:A==="\b",delete:A==="\x7F"||A==="\x1B[3~",meta:!1};A<=""&&!p.return&&(A=String.fromCharCode(A.charCodeAt(0)+97-1),p.ctrl=!0),A.startsWith("\x1B")&&(A=A.slice(1),p.meta=!0);let h=A>="A"&&A<="Z",E=A>="\u0410"&&A<="\u042F";A.length===1&&(h||E)&&(p.shift=!0),p.tab&&A==="[Z"&&(p.shift=!0),(p.tab||p.backspace||p.delete)&&(A=""),(!(A==="c"&&p.ctrl)||!a)&&t(A,p)};return r?.on("data",n),()=>{r?.off("data",n)}},[e.isActive,r,a,t])};zB.default=$Ct});var Cwe=_(JB=>{"use strict";var eIt=JB&&JB.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(JB,"__esModule",{value:!0});var tIt=ln(),rIt=eIt(jq()),nIt=()=>tIt.useContext(rIt.default);JB.default=nIt});var Iwe=_(XB=>{"use strict";var iIt=XB&&XB.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(XB,"__esModule",{value:!0});var sIt=ln(),oIt=iIt(Kq()),aIt=()=>sIt.useContext(oIt.default);XB.default=aIt});var wwe=_(ZB=>{"use strict";var lIt=ZB&&ZB.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ZB,"__esModule",{value:!0});var cIt=ln(),uIt=lIt(zq()),AIt=()=>cIt.useContext(uIt.default);ZB.default=AIt});var vwe=_(ev=>{"use strict";var Bwe=ev&&ev.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ev,"__esModule",{value:!0});var $B=ln(),fIt=Bwe(TQ()),pIt=Bwe(MQ()),hIt=({isActive:t=!0,autoFocus:e=!1,id:r}={})=>{let{isRawModeSupported:o,setRawMode:a}=pIt.default(),{activeId:n,add:u,remove:A,activate:p,deactivate:h,focus:E}=$B.useContext(fIt.default),w=$B.useMemo(()=>r??Math.random().toString().slice(2,7),[r]);return $B.useEffect(()=>(u(w,{autoFocus:e}),()=>{A(w)}),[w,e]),$B.useEffect(()=>{t?p(w):h(w)},[t,w]),$B.useEffect(()=>{if(!(!o||!t))return a(!0),()=>{a(!1)}},[t]),{isFocused:!!w&&n===w,focus:E}};ev.default=hIt});var Dwe=_(tv=>{"use strict";var gIt=tv&&tv.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(tv,"__esModule",{value:!0});var dIt=ln(),mIt=gIt(TQ()),yIt=()=>{let t=dIt.useContext(mIt.default);return{enableFocus:t.enableFocus,disableFocus:t.disableFocus,focusNext:t.focusNext,focusPrevious:t.focusPrevious,focus:t.focus}};tv.default=yIt});var Pwe=_(ij=>{"use strict";Object.defineProperty(ij,"__esModule",{value:!0});ij.default=t=>{var e,r,o,a;return{width:(r=(e=t.yogaNode)===null||e===void 0?void 0:e.getComputedWidth())!==null&&r!==void 0?r:0,height:(a=(o=t.yogaNode)===null||o===void 0?void 0:o.getComputedHeight())!==null&&a!==void 0?a:0}}});var ac=_(zs=>{"use strict";Object.defineProperty(zs,"__esModule",{value:!0});var EIt=lwe();Object.defineProperty(zs,"render",{enumerable:!0,get:function(){return EIt.default}});var CIt=LQ();Object.defineProperty(zs,"Box",{enumerable:!0,get:function(){return CIt.default}});var IIt=tj();Object.defineProperty(zs,"Text",{enumerable:!0,get:function(){return IIt.default}});var wIt=uwe();Object.defineProperty(zs,"Static",{enumerable:!0,get:function(){return wIt.default}});var BIt=fwe();Object.defineProperty(zs,"Transform",{enumerable:!0,get:function(){return BIt.default}});var vIt=hwe();Object.defineProperty(zs,"Newline",{enumerable:!0,get:function(){return vIt.default}});var DIt=mwe();Object.defineProperty(zs,"Spacer",{enumerable:!0,get:function(){return DIt.default}});var PIt=Ewe();Object.defineProperty(zs,"useInput",{enumerable:!0,get:function(){return PIt.default}});var SIt=Cwe();Object.defineProperty(zs,"useApp",{enumerable:!0,get:function(){return SIt.default}});var xIt=MQ();Object.defineProperty(zs,"useStdin",{enumerable:!0,get:function(){return xIt.default}});var bIt=Iwe();Object.defineProperty(zs,"useStdout",{enumerable:!0,get:function(){return bIt.default}});var kIt=wwe();Object.defineProperty(zs,"useStderr",{enumerable:!0,get:function(){return kIt.default}});var QIt=vwe();Object.defineProperty(zs,"useFocus",{enumerable:!0,get:function(){return QIt.default}});var FIt=Dwe();Object.defineProperty(zs,"useFocusManager",{enumerable:!0,get:function(){return FIt.default}});var RIt=Pwe();Object.defineProperty(zs,"measureElement",{enumerable:!0,get:function(){return RIt.default}})});var oj={};Kt(oj,{Gem:()=>sj});var Swe,ld,sj,UQ=It(()=>{Swe=et(ac()),ld=et(ln()),sj=(0,ld.memo)(({active:t})=>{let e=(0,ld.useMemo)(()=>t?"\u25C9":"\u25EF",[t]),r=(0,ld.useMemo)(()=>t?"green":"yellow",[t]);return ld.default.createElement(Swe.Text,{color:r},e)})});var bwe={};Kt(bwe,{useKeypress:()=>cd});function cd({active:t},e,r){let{stdin:o}=(0,xwe.useStdin)(),a=(0,_Q.useCallback)((n,u)=>e(n,u),r);(0,_Q.useEffect)(()=>{if(!(!t||!o))return o.on("keypress",a),()=>{o.off("keypress",a)}},[t,a,o])}var xwe,_Q,rv=It(()=>{xwe=et(ac()),_Q=et(ln())});var Qwe={};Kt(Qwe,{FocusRequest:()=>kwe,useFocusRequest:()=>aj});var kwe,aj,lj=It(()=>{rv();kwe=(r=>(r.BEFORE="before",r.AFTER="after",r))(kwe||{}),aj=function({active:t},e,r){cd({active:t},(o,a)=>{a.name==="tab"&&(a.shift?e("before"):e("after"))},r)}});var Fwe={};Kt(Fwe,{useListInput:()=>nv});var nv,HQ=It(()=>{rv();nv=function(t,e,{active:r,minus:o,plus:a,set:n,loop:u=!0}){cd({active:r},(A,p)=>{let h=e.indexOf(t);switch(p.name){case o:{let E=h-1;if(u){n(e[(e.length+E)%e.length]);return}if(E<0)return;n(e[E])}break;case a:{let E=h+1;if(u){n(e[E%e.length]);return}if(E>=e.length)return;n(e[E])}break}},[e,t,a,n,u])}});var qQ={};Kt(qQ,{ScrollableItems:()=>TIt});var Hh,Ua,TIt,jQ=It(()=>{Hh=et(ac()),Ua=et(ln());lj();HQ();TIt=({active:t=!0,children:e=[],radius:r=10,size:o=1,loop:a=!0,onFocusRequest:n,willReachEnd:u})=>{let A=N=>{if(N.key===null)throw new Error("Expected all children to have a key");return N.key},p=Ua.default.Children.map(e,N=>A(N)),h=p[0],[E,w]=(0,Ua.useState)(h),D=p.indexOf(E);(0,Ua.useEffect)(()=>{p.includes(E)||w(h)},[e]),(0,Ua.useEffect)(()=>{u&&D>=p.length-2&&u()},[D]),aj({active:t&&!!n},N=>{n?.(N)},[n]),nv(E,p,{active:t,minus:"up",plus:"down",set:w,loop:a});let b=D-r,C=D+r;C>p.length&&(b-=C-p.length,C=p.length),b<0&&(C+=-b,b=0),C>=p.length&&(C=p.length-1);let T=[];for(let N=b;N<=C;++N){let U=p[N],z=t&&U===E;T.push(Ua.default.createElement(Hh.Box,{key:U,height:o},Ua.default.createElement(Hh.Box,{marginLeft:1,marginRight:1},Ua.default.createElement(Hh.Text,null,z?Ua.default.createElement(Hh.Text,{color:"cyan",bold:!0},">"):" ")),Ua.default.createElement(Hh.Box,null,Ua.default.cloneElement(e[N],{active:z}))))}return Ua.default.createElement(Hh.Box,{flexDirection:"column",width:"100%"},T)}});var Rwe,Xf,Twe,cj,Lwe,uj=It(()=>{Rwe=et(ac()),Xf=et(ln()),Twe=ve("readline"),cj=Xf.default.createContext(null),Lwe=({children:t})=>{let{stdin:e,setRawMode:r}=(0,Rwe.useStdin)();(0,Xf.useEffect)(()=>{r&&r(!0),e&&(0,Twe.emitKeypressEvents)(e)},[e,r]);let[o,a]=(0,Xf.useState)(new Map),n=(0,Xf.useMemo)(()=>({getAll:()=>o,get:u=>o.get(u),set:(u,A)=>a(new Map([...o,[u,A]]))}),[o,a]);return Xf.default.createElement(cj.Provider,{value:n,children:t})}});var Aj={};Kt(Aj,{useMinistore:()=>LIt});function LIt(t,e){let r=(0,GQ.useContext)(cj);if(r===null)throw new Error("Expected this hook to run with a ministore context attached");if(typeof t>"u")return r.getAll();let o=(0,GQ.useCallback)(n=>{r.set(t,n)},[t,r.set]),a=r.get(t);return typeof a>"u"&&(a=e),[a,o]}var GQ,fj=It(()=>{GQ=et(ln());uj()});var YQ={};Kt(YQ,{renderForm:()=>NIt});async function NIt(t,e,{stdin:r,stdout:o,stderr:a}){let n,u=p=>{let{exit:h}=(0,WQ.useApp)();cd({active:!0},(E,w)=>{w.name==="return"&&(n=p,h())},[h,p])},{waitUntilExit:A}=(0,WQ.render)(pj.default.createElement(Lwe,null,pj.default.createElement(t,{...e,useSubmit:u})),{stdin:r,stdout:o,stderr:a});return await A(),n}var WQ,pj,KQ=It(()=>{WQ=et(ac()),pj=et(ln());uj();rv()});var Uwe=_(iv=>{"use strict";Object.defineProperty(iv,"__esModule",{value:!0});iv.UncontrolledTextInput=void 0;var Owe=ln(),hj=ln(),Nwe=ac(),ud=FQ(),Mwe=({value:t,placeholder:e="",focus:r=!0,mask:o,highlightPastedText:a=!1,showCursor:n=!0,onChange:u,onSubmit:A})=>{let[{cursorOffset:p,cursorWidth:h},E]=hj.useState({cursorOffset:(t||"").length,cursorWidth:0});hj.useEffect(()=>{E(T=>{if(!r||!n)return T;let N=t||"";return T.cursorOffset>N.length-1?{cursorOffset:N.length,cursorWidth:0}:T})},[t,r,n]);let w=a?h:0,D=o?o.repeat(t.length):t,b=D,C=e?ud.grey(e):void 0;if(n&&r){C=e.length>0?ud.inverse(e[0])+ud.grey(e.slice(1)):ud.inverse(" "),b=D.length>0?"":ud.inverse(" ");let T=0;for(let N of D)T>=p-w&&T<=p?b+=ud.inverse(N):b+=N,T++;D.length>0&&p===D.length&&(b+=ud.inverse(" "))}return Nwe.useInput((T,N)=>{if(N.upArrow||N.downArrow||N.ctrl&&T==="c"||N.tab||N.shift&&N.tab)return;if(N.return){A&&A(t);return}let U=p,z=t,te=0;N.leftArrow?n&&U--:N.rightArrow?n&&U++:N.backspace||N.delete?p>0&&(z=t.slice(0,p-1)+t.slice(p,t.length),U--):(z=t.slice(0,p)+T+t.slice(p,t.length),U+=T.length,T.length>1&&(te=T.length)),p<0&&(U=0),p>t.length&&(U=t.length),E({cursorOffset:U,cursorWidth:te}),z!==t&&u(z)},{isActive:r}),Owe.createElement(Nwe.Text,null,e?D.length>0?b:C:b)};iv.default=Mwe;iv.UncontrolledTextInput=({initialValue:t="",...e})=>{let[r,o]=hj.useState(t);return Owe.createElement(Mwe,Object.assign({},e,{value:r,onChange:o}))}});var qwe={};Kt(qwe,{Pad:()=>gj});var _we,Hwe,gj,dj=It(()=>{_we=et(ac()),Hwe=et(ln()),gj=({length:t,active:e})=>{if(t===0)return null;let r=t>1?` ${"-".repeat(t-1)}`:" ";return Hwe.default.createElement(_we.Text,{dimColor:!e},r)}});var jwe={};Kt(jwe,{ItemOptions:()=>OIt});var ov,qh,OIt,Gwe=It(()=>{ov=et(ac()),qh=et(ln());HQ();UQ();dj();OIt=function({active:t,skewer:e,options:r,value:o,onChange:a,sizes:n=[]}){let u=r.filter(({label:p})=>!!p).map(({value:p})=>p),A=r.findIndex(p=>p.value===o&&p.label!="");return nv(o,u,{active:t,minus:"left",plus:"right",set:a}),qh.default.createElement(qh.default.Fragment,null,r.map(({label:p},h)=>{let E=h===A,w=n[h]-1||0,D=p.replace(/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,""),b=Math.max(0,w-D.length-2);return p?qh.default.createElement(ov.Box,{key:p,width:w,marginLeft:1},qh.default.createElement(ov.Text,{wrap:"truncate"},qh.default.createElement(sj,{active:E})," ",p),e?qh.default.createElement(gj,{active:t,length:b}):null):qh.default.createElement(ov.Box,{key:`spacer-${h}`,width:w,marginLeft:1})}))}});var s1e=_((xzt,i1e)=>{var Dj;i1e.exports=()=>(typeof Dj>"u"&&(Dj=ve("zlib").brotliDecompressSync(Buffer.from("W+h+VsM2hZr2qzcQPX9f27hSlciGbKi87BxtpbjIS3mpE8q2TxCsb6uhbS2D54aqak5yImOwK2z/VKuqApkyqkrxpOLkxZXqzBnV0SthmTTQaLnJmGkpShaXRJqwkW3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l5LLsDN6sf1yd3C7BREihyWFrDcPFKMo5nTIsF1KnOdbY5uBgLvYzP6Pf77ElstvePiVyyPVr9SnlYf3VphDcDec8EPgzNvVlu/Nf4W/9ydyp09olX5PtjKIksUnFRMkWVqg0eiHTXrsZh639dj7Le5BIzOfCAApMZNjlrKOcINaQO0OhtuVjYN/eAH1NMG8l/DU254lFtNB+iG6LpLtPDXUaRbMDZteKwzwNznX8I0+SLmTZxyPA0=","base64")).toString()),Dj)});var P1e=_(($zt,D1e)=>{var Tj=Symbol("arg flag"),lc=class t extends Error{constructor(e,r){super(e),this.name="ArgError",this.code=r,Object.setPrototypeOf(this,t.prototype)}};function wv(t,{argv:e=process.argv.slice(2),permissive:r=!1,stopAtPositional:o=!1}={}){if(!t)throw new lc("argument specification object is required","ARG_CONFIG_NO_SPEC");let a={_:[]},n={},u={};for(let A of Object.keys(t)){if(!A)throw new lc("argument key cannot be an empty string","ARG_CONFIG_EMPTY_KEY");if(A[0]!=="-")throw new lc(`argument key must start with '-' but found: '${A}'`,"ARG_CONFIG_NONOPT_KEY");if(A.length===1)throw new lc(`argument key must have a name; singular '-' keys are not allowed: ${A}`,"ARG_CONFIG_NONAME_KEY");if(typeof t[A]=="string"){n[A]=t[A];continue}let p=t[A],h=!1;if(Array.isArray(p)&&p.length===1&&typeof p[0]=="function"){let[E]=p;p=(w,D,b=[])=>(b.push(E(w,D,b[b.length-1])),b),h=E===Boolean||E[Tj]===!0}else if(typeof p=="function")h=p===Boolean||p[Tj]===!0;else throw new lc(`type missing or not a function or valid array type: ${A}`,"ARG_CONFIG_VAD_TYPE");if(A[1]!=="-"&&A.length>2)throw new lc(`short argument keys (with a single hyphen) must have only one character: ${A}`,"ARG_CONFIG_SHORTOPT_TOOLONG");u[A]=[p,h]}for(let A=0,p=e.length;A0){a._=a._.concat(e.slice(A));break}if(h==="--"){a._=a._.concat(e.slice(A+1));break}if(h.length>1&&h[0]==="-"){let E=h[1]==="-"||h.length===2?[h]:h.slice(1).split("").map(w=>`-${w}`);for(let w=0;w1&&e[A+1][0]==="-"&&!(e[A+1].match(/^-?\d*(\.(?=\d))?\d*$/)&&(N===Number||typeof BigInt<"u"&&N===BigInt))){let z=b===T?"":` (alias for ${T})`;throw new lc(`option requires argument: ${b}${z}`,"ARG_MISSING_REQUIRED_LONGARG")}a[T]=N(e[A+1],T,a[T]),++A}else a[T]=N(C,T,a[T])}}else a._.push(h)}return a}wv.flag=t=>(t[Tj]=!0,t);wv.COUNT=wv.flag((t,e,r)=>(r||0)+1);wv.ArgError=lc;D1e.exports=wv});var T1e=_((bJt,R1e)=>{var Mj;R1e.exports=()=>(typeof Mj>"u"&&(Mj=ve("zlib").brotliDecompressSync(Buffer.from("W7YZIYrAeaAIofn/qpGBmjpZVwDLAvMwf4yXtBPC2k244urd2MomTN2aMogfZ4A7OVKdZytVrWdTrWmYxircma0wGjinrwi97kOIB/rfPvf++/N1nmkwua4pdU0vplRnJ8uTq4/IAsPFlgkUtfMXWn1Nm4s4/1OdO8sUK02YQ8V0UUTasGUTR54r1eZDT0Tg+dfNn2bSIN6Zw+V9selvZoGapDZBTNJtWlu8YiP8VAl4vuaHrmqbStPqWMGWi1ET+Wl8hECbrj9M79f7pp+KJEBcE6TKVEriNY6xXKgoIrpP3yOOwfyPgdESROE7cD251tzuvu9hZjDLwpDcErDkGhpVUc7ZLP5BvGEEUjaLZdHaf3p1wpI/ZW6ndipAYFTca6o+3B9iFWHICDGbsHGBmmPDDNvKKnyOtjGr2X7Xv2gIEIo0IUR9fyzr0RFHe+BekvwQ8A7azu4PX6uXTmr3kyZ3UxuE0AeEwE7s3f0LdIJcvAtlstfAn45Em6li+lMmn6NJtkeT0hrM6hZvhjO5NFsx6OvLtoz8vjLzBCE2tq38M2NRMff1r/HFdUdxSA4v2T8UzNbJfx16WEjKmYryX6bLx1Qi4KkviXx2b7rrUxmOfmjBZgdsdLqS9lR7LqgGoSoMNiKLAWDBhm2OenIXqbIOID+RvwRtjzFzXwcoDeaECP86wI+AHG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jqfvNtKUPKbwWopbNQAnzu0A9E+u/3LeyukNDXcd0ZiF5iMroX9QtXMAMmyI/J1mQaJd9F5pb8xCiTOej5SKiciyILWMB6raNSfAnIMf3GWMSlyIYO7ssONgNaDTyCLTbgk0lHOuOCp8E8fFfscx/+KWTMpWLysdPfl/DdZhq8knTZ8lNX4vJZXDOy4wmgk0ZToY09zqovLVgKh6uBTCnZhAmV8BATno1QtFg2qLXiq6pKre3cSThQwdEnxCYaJZiBrIsJ+A95NLXHuFLGeWobtNr10IH/Z35+TrGxc9OCto6ZktgAkjP75M/Cz1YWMdQoABzq1dkmkA5U7gm/MSEW4Uy9+KDBdxtZm+pwiIwHcraaBSJgImm2oV9IyUo4wYXWUjwkwEYiNEzjkJw8S3FPvnBR1NuWQOiWQc3AjaZuvhJtEo5mck+daTk9PO+W2efl7FeJmv9qz71G3H/3q/4e4xNSlTCMAxa9sLYuk+AEy9XLt4puqzycsrLSi8jVWGL5QoJECvGDpZ5KOYrD88MY60/vp9nyrulyh6XkiKRA8+Qf8qK0SgBN0X/w2aJEj0A","base64")).toString()),Mj)});var U1e=_((Gj,Wj)=>{(function(t){Gj&&typeof Gj=="object"&&typeof Wj<"u"?Wj.exports=t():typeof define=="function"&&define.amd?define([],t):typeof window<"u"?window.isWindows=t():typeof global<"u"?global.isWindows=t():typeof self<"u"?self.isWindows=t():this.isWindows=t()})(function(){"use strict";return function(){return process&&(process.platform==="win32"||/^(msys|cygwin)$/.test(process.env.OSTYPE))}})});var j1e=_((SXt,q1e)=>{"use strict";Yj.ifExists=Twt;var FC=ve("util"),cc=ve("path"),_1e=U1e(),Qwt=/^#!\s*(?:\/usr\/bin\/env)?\s*([^ \t]+)(.*)$/,Fwt={createPwshFile:!0,createCmdFile:_1e(),fs:ve("fs")},Rwt=new Map([[".js","node"],[".cjs","node"],[".mjs","node"],[".cmd","cmd"],[".bat","cmd"],[".ps1","pwsh"],[".sh","sh"]]);function H1e(t){let e={...Fwt,...t},r=e.fs;return e.fs_={chmod:r.chmod?FC.promisify(r.chmod):async()=>{},mkdir:FC.promisify(r.mkdir),readFile:FC.promisify(r.readFile),stat:FC.promisify(r.stat),unlink:FC.promisify(r.unlink),writeFile:FC.promisify(r.writeFile)},e}async function Yj(t,e,r){let o=H1e(r);await o.fs_.stat(t),await Nwt(t,e,o)}function Twt(t,e,r){return Yj(t,e,r).catch(()=>{})}function Lwt(t,e){return e.fs_.unlink(t).catch(()=>{})}async function Nwt(t,e,r){let o=await Hwt(t,r);return await Owt(e,r),Mwt(t,e,o,r)}function Owt(t,e){return e.fs_.mkdir(cc.dirname(t),{recursive:!0})}function Mwt(t,e,r,o){let a=H1e(o),n=[{generator:Gwt,extension:""}];return a.createCmdFile&&n.push({generator:jwt,extension:".cmd"}),a.createPwshFile&&n.push({generator:Wwt,extension:".ps1"}),Promise.all(n.map(u=>qwt(t,e+u.extension,r,u.generator,a)))}function Uwt(t,e){return Lwt(t,e)}function _wt(t,e){return Ywt(t,e)}async function Hwt(t,e){let a=(await e.fs_.readFile(t,"utf8")).trim().split(/\r*\n/)[0].match(Qwt);if(!a){let n=cc.extname(t).toLowerCase();return{program:Rwt.get(n)||null,additionalArgs:""}}return{program:a[1],additionalArgs:a[2]}}async function qwt(t,e,r,o,a){let n=a.preserveSymlinks?"--preserve-symlinks":"",u=[r.additionalArgs,n].filter(A=>A).join(" ");return a=Object.assign({},a,{prog:r.program,args:u}),await Uwt(e,a),await a.fs_.writeFile(e,o(t,e,a),"utf8"),_wt(e,a)}function jwt(t,e,r){let a=cc.relative(cc.dirname(e),t).split("/").join("\\"),n=cc.isAbsolute(a)?`"${a}"`:`"%~dp0\\${a}"`,u,A=r.prog,p=r.args||"",h=Kj(r.nodePath).win32;A?(u=`"%~dp0\\${A}.exe"`,a=n):(A=n,p="",a="");let E=r.progArgs?`${r.progArgs.join(" ")} `:"",w=h?`@SET NODE_PATH=${h}\r `:"";return u?w+=`@IF EXIST ${u} (\r ${u} ${p} ${a} ${E}%*\r ) ELSE (\r @SETLOCAL\r @SET PATHEXT=%PATHEXT:;.JS;=;%\r ${A} ${p} ${a} ${E}%*\r )\r `:w+=`@${A} ${p} ${a} ${E}%*\r `,w}function Gwt(t,e,r){let o=cc.relative(cc.dirname(e),t),a=r.prog&&r.prog.split("\\").join("/"),n;o=o.split("\\").join("/");let u=cc.isAbsolute(o)?`"${o}"`:`"$basedir/${o}"`,A=r.args||"",p=Kj(r.nodePath).posix;a?(n=`"$basedir/${r.prog}"`,o=u):(a=u,A="",o="");let h=r.progArgs?`${r.progArgs.join(" ")} `:"",E=`#!/bin/sh basedir=$(dirname "$(echo "$0" | sed -e 's,\\\\,/,g')") case \`uname\` in *CYGWIN*) basedir=\`cygpath -w "$basedir"\`;; esac `,w=r.nodePath?`export NODE_PATH="${p}" `:"";return n?E+=`${w}if [ -x ${n} ]; then exec ${n} ${A} ${o} ${h}"$@" else exec ${a} ${A} ${o} ${h}"$@" fi `:E+=`${w}${a} ${A} ${o} ${h}"$@" exit $? `,E}function Wwt(t,e,r){let o=cc.relative(cc.dirname(e),t),a=r.prog&&r.prog.split("\\").join("/"),n=a&&`"${a}$exe"`,u;o=o.split("\\").join("/");let A=cc.isAbsolute(o)?`"${o}"`:`"$basedir/${o}"`,p=r.args||"",h=Kj(r.nodePath),E=h.win32,w=h.posix;n?(u=`"$basedir/${r.prog}$exe"`,o=A):(n=A,p="",o="");let D=r.progArgs?`${r.progArgs.join(" ")} `:"",b=`#!/usr/bin/env pwsh $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent $exe="" ${r.nodePath?`$env_node_path=$env:NODE_PATH $env:NODE_PATH="${E}" `:""}if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { # Fix case when both the Windows and Linux builds of Node # are installed in the same directory $exe=".exe" }`;return r.nodePath&&(b+=` else { $env:NODE_PATH="${w}" }`),u?b+=` $ret=0 if (Test-Path ${u}) { # Support pipeline input if ($MyInvocation.ExpectingInput) { $input | & ${u} ${p} ${o} ${D}$args } else { & ${u} ${p} ${o} ${D}$args } $ret=$LASTEXITCODE } else { # Support pipeline input if ($MyInvocation.ExpectingInput) { $input | & ${n} ${p} ${o} ${D}$args } else { & ${n} ${p} ${o} ${D}$args } $ret=$LASTEXITCODE } ${r.nodePath?`$env:NODE_PATH=$env_node_path `:""}exit $ret `:b+=` # Support pipeline input if ($MyInvocation.ExpectingInput) { $input | & ${n} ${p} ${o} ${D}$args } else { & ${n} ${p} ${o} ${D}$args } ${r.nodePath?`$env:NODE_PATH=$env_node_path `:""}exit $LASTEXITCODE `,b}function Ywt(t,e){return e.fs_.chmod(t,493)}function Kj(t){if(!t)return{win32:"",posix:""};let e=typeof t=="string"?t.split(cc.delimiter):Array.from(t),r={};for(let o=0;o`/mnt/${A.toLowerCase()}`):e[o];r.win32=r.win32?`${r.win32};${a}`:a,r.posix=r.posix?`${r.posix}:${n}`:n,r[o]={win32:a,posix:n}}return r}q1e.exports=Yj});var a9=_((VZt,c2e)=>{c2e.exports=ve("stream")});var p2e=_((zZt,f2e)=>{"use strict";function u2e(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,o)}return r}function E1t(t){for(var e=1;e0?this.tail.next=o:this.head=o,this.tail=o,++this.length}},{key:"unshift",value:function(r){var o={data:r,next:this.head};this.length===0&&(this.tail=o),this.head=o,++this.length}},{key:"shift",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var o=this.head,a=""+o.data;o=o.next;)a+=r+o.data;return a}},{key:"concat",value:function(r){if(this.length===0)return sF.alloc(0);for(var o=sF.allocUnsafe(r>>>0),a=this.head,n=0;a;)P1t(a.data,o,n),n+=a.data.length,a=a.next;return o}},{key:"consume",value:function(r,o){var a;return ru.length?u.length:r;if(A===u.length?n+=u:n+=u.slice(0,r),r-=A,r===0){A===u.length?(++a,o.next?this.head=o.next:this.head=this.tail=null):(this.head=o,o.data=u.slice(A));break}++a}return this.length-=a,n}},{key:"_getBuffer",value:function(r){var o=sF.allocUnsafe(r),a=this.head,n=1;for(a.data.copy(o),r-=a.data.length;a=a.next;){var u=a.data,A=r>u.length?u.length:r;if(u.copy(o,o.length-r,0,A),r-=A,r===0){A===u.length?(++n,a.next?this.head=a.next:this.head=this.tail=null):(this.head=a,a.data=u.slice(A));break}++n}return this.length-=n,o}},{key:D1t,value:function(r,o){return l9(this,E1t({},o,{depth:0,customInspect:!1}))}}]),t}()});var u9=_((JZt,g2e)=>{"use strict";function S1t(t,e){var r=this,o=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return o||a?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(c9,this,t)):process.nextTick(c9,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(n){!e&&n?r._writableState?r._writableState.errorEmitted?process.nextTick(oF,r):(r._writableState.errorEmitted=!0,process.nextTick(h2e,r,n)):process.nextTick(h2e,r,n):e?(process.nextTick(oF,r),e(n)):process.nextTick(oF,r)}),this)}function h2e(t,e){c9(t,e),oF(t)}function oF(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function x1t(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function c9(t,e){t.emit("error",e)}function b1t(t,e){var r=t._readableState,o=t._writableState;r&&r.autoDestroy||o&&o.autoDestroy?t.destroy(e):t.emit("error",e)}g2e.exports={destroy:S1t,undestroy:x1t,errorOrDestroy:b1t}});var zh=_((XZt,y2e)=>{"use strict";var m2e={};function Ac(t,e,r){r||(r=Error);function o(n,u,A){return typeof e=="string"?e:e(n,u,A)}class a extends r{constructor(u,A,p){super(o(u,A,p))}}a.prototype.name=r.name,a.prototype.code=t,m2e[t]=a}function d2e(t,e){if(Array.isArray(t)){let r=t.length;return t=t.map(o=>String(o)),r>2?`one of ${e} ${t.slice(0,r-1).join(", ")}, or `+t[r-1]:r===2?`one of ${e} ${t[0]} or ${t[1]}`:`of ${e} ${t[0]}`}else return`of ${e} ${String(t)}`}function k1t(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}function Q1t(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}function F1t(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}Ac("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);Ac("ERR_INVALID_ARG_TYPE",function(t,e,r){let o;typeof e=="string"&&k1t(e,"not ")?(o="must not be",e=e.replace(/^not /,"")):o="must be";let a;if(Q1t(t," argument"))a=`The ${t} ${o} ${d2e(e,"type")}`;else{let n=F1t(t,".")?"property":"argument";a=`The "${t}" ${n} ${o} ${d2e(e,"type")}`}return a+=`. Received type ${typeof r}`,a},TypeError);Ac("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");Ac("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});Ac("ERR_STREAM_PREMATURE_CLOSE","Premature close");Ac("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});Ac("ERR_MULTIPLE_CALLBACK","Callback called multiple times");Ac("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");Ac("ERR_STREAM_WRITE_AFTER_END","write after end");Ac("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Ac("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);Ac("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");y2e.exports.codes=m2e});var A9=_((ZZt,E2e)=>{"use strict";var R1t=zh().codes.ERR_INVALID_OPT_VALUE;function T1t(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function L1t(t,e,r,o){var a=T1t(e,o,r);if(a!=null){if(!(isFinite(a)&&Math.floor(a)===a)||a<0){var n=o?r:"highWaterMark";throw new R1t(n,a)}return Math.floor(a)}return t.objectMode?16:16*1024}E2e.exports={getHighWaterMark:L1t}});var C2e=_(($Zt,f9)=>{typeof Object.create=="function"?f9.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:f9.exports=function(e,r){if(r){e.super_=r;var o=function(){};o.prototype=r.prototype,e.prototype=new o,e.prototype.constructor=e}}});var Jh=_((e$t,h9)=>{try{if(p9=ve("util"),typeof p9.inherits!="function")throw"";h9.exports=p9.inherits}catch{h9.exports=C2e()}var p9});var w2e=_((t$t,I2e)=>{I2e.exports=ve("util").deprecate});var m9=_((r$t,x2e)=>{"use strict";x2e.exports=Li;function v2e(t){var e=this;this.next=null,this.entry=null,this.finish=function(){l2t(e,t)}}var OC;Li.WritableState=Tv;var N1t={deprecate:w2e()},D2e=a9(),lF=ve("buffer").Buffer,O1t=global.Uint8Array||function(){};function M1t(t){return lF.from(t)}function U1t(t){return lF.isBuffer(t)||t instanceof O1t}var d9=u9(),_1t=A9(),H1t=_1t.getHighWaterMark,Xh=zh().codes,q1t=Xh.ERR_INVALID_ARG_TYPE,j1t=Xh.ERR_METHOD_NOT_IMPLEMENTED,G1t=Xh.ERR_MULTIPLE_CALLBACK,W1t=Xh.ERR_STREAM_CANNOT_PIPE,Y1t=Xh.ERR_STREAM_DESTROYED,K1t=Xh.ERR_STREAM_NULL_VALUES,V1t=Xh.ERR_STREAM_WRITE_AFTER_END,z1t=Xh.ERR_UNKNOWN_ENCODING,MC=d9.errorOrDestroy;Jh()(Li,D2e);function J1t(){}function Tv(t,e,r){OC=OC||dd(),t=t||{},typeof r!="boolean"&&(r=e instanceof OC),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=H1t(this,t,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var o=t.decodeStrings===!1;this.decodeStrings=!o,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(a){n2t(e,a)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new v2e(this)}Tv.prototype.getBuffer=function(){for(var e=this.bufferedRequest,r=[];e;)r.push(e),e=e.next;return r};(function(){try{Object.defineProperty(Tv.prototype,"buffer",{get:N1t.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var aF;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(aF=Function.prototype[Symbol.hasInstance],Object.defineProperty(Li,Symbol.hasInstance,{value:function(e){return aF.call(this,e)?!0:this!==Li?!1:e&&e._writableState instanceof Tv}})):aF=function(e){return e instanceof this};function Li(t){OC=OC||dd();var e=this instanceof OC;if(!e&&!aF.call(Li,this))return new Li(t);this._writableState=new Tv(t,this,e),this.writable=!0,t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final)),D2e.call(this)}Li.prototype.pipe=function(){MC(this,new W1t)};function X1t(t,e){var r=new V1t;MC(t,r),process.nextTick(e,r)}function Z1t(t,e,r,o){var a;return r===null?a=new K1t:typeof r!="string"&&!e.objectMode&&(a=new q1t("chunk",["string","Buffer"],r)),a?(MC(t,a),process.nextTick(o,a),!1):!0}Li.prototype.write=function(t,e,r){var o=this._writableState,a=!1,n=!o.objectMode&&U1t(t);return n&&!lF.isBuffer(t)&&(t=M1t(t)),typeof e=="function"&&(r=e,e=null),n?e="buffer":e||(e=o.defaultEncoding),typeof r!="function"&&(r=J1t),o.ending?X1t(this,r):(n||Z1t(this,o,t,r))&&(o.pendingcb++,a=e2t(this,o,n,t,e,r)),a};Li.prototype.cork=function(){this._writableState.corked++};Li.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,!t.writing&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&P2e(this,t))};Li.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new z1t(e);return this._writableState.defaultEncoding=e,this};Object.defineProperty(Li.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function $1t(t,e,r){return!t.objectMode&&t.decodeStrings!==!1&&typeof e=="string"&&(e=lF.from(e,r)),e}Object.defineProperty(Li.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function e2t(t,e,r,o,a,n){if(!r){var u=$1t(e,o,a);o!==u&&(r=!0,a="buffer",o=u)}var A=e.objectMode?1:o.length;e.length+=A;var p=e.length{"use strict";var c2t=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};k2e.exports=IA;var b2e=C9(),E9=m9();Jh()(IA,b2e);for(y9=c2t(E9.prototype),cF=0;cF{var AF=ve("buffer"),np=AF.Buffer;function Q2e(t,e){for(var r in t)e[r]=t[r]}np.from&&np.alloc&&np.allocUnsafe&&np.allocUnsafeSlow?F2e.exports=AF:(Q2e(AF,I9),I9.Buffer=UC);function UC(t,e,r){return np(t,e,r)}Q2e(np,UC);UC.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return np(t,e,r)};UC.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var o=np(t);return e!==void 0?typeof r=="string"?o.fill(e,r):o.fill(e):o.fill(0),o};UC.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return np(t)};UC.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return AF.SlowBuffer(t)}});var v9=_(L2e=>{"use strict";var B9=R2e().Buffer,T2e=B9.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function f2t(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}function p2t(t){var e=f2t(t);if(typeof e!="string"&&(B9.isEncoding===T2e||!T2e(t)))throw new Error("Unknown encoding: "+t);return e||t}L2e.StringDecoder=Lv;function Lv(t){this.encoding=p2t(t);var e;switch(this.encoding){case"utf16le":this.text=E2t,this.end=C2t,e=4;break;case"utf8":this.fillLast=d2t,e=4;break;case"base64":this.text=I2t,this.end=w2t,e=3;break;default:this.write=B2t,this.end=v2t;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=B9.allocUnsafe(e)}Lv.prototype.write=function(t){if(t.length===0)return"";var e,r;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function h2t(t,e,r){var o=e.length-1;if(o=0?(a>0&&(t.lastNeed=a-1),a):--o=0?(a>0&&(t.lastNeed=a-2),a):--o=0?(a>0&&(a===2?a=0:t.lastNeed=a-3),a):0))}function g2t(t,e,r){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}function d2t(t){var e=this.lastTotal-this.lastNeed,r=g2t(this,t,e);if(r!==void 0)return r;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}function m2t(t,e){var r=h2t(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var o=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,o),t.toString("utf8",e,o)}function y2t(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function E2t(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var o=r.charCodeAt(r.length-1);if(o>=55296&&o<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function C2t(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function I2t(t,e){var r=(t.length-e)%3;return r===0?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function w2t(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function B2t(t){return t.toString(this.encoding)}function v2t(t){return t&&t.length?this.write(t):""}});var fF=_((s$t,M2e)=>{"use strict";var N2e=zh().codes.ERR_STREAM_PREMATURE_CLOSE;function D2t(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,o=new Array(r),a=0;a{"use strict";var pF;function Zh(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var x2t=fF(),$h=Symbol("lastResolve"),md=Symbol("lastReject"),Nv=Symbol("error"),hF=Symbol("ended"),yd=Symbol("lastPromise"),D9=Symbol("handlePromise"),Ed=Symbol("stream");function e0(t,e){return{value:t,done:e}}function b2t(t){var e=t[$h];if(e!==null){var r=t[Ed].read();r!==null&&(t[yd]=null,t[$h]=null,t[md]=null,e(e0(r,!1)))}}function k2t(t){process.nextTick(b2t,t)}function Q2t(t,e){return function(r,o){t.then(function(){if(e[hF]){r(e0(void 0,!0));return}e[D9](r,o)},o)}}var F2t=Object.getPrototypeOf(function(){}),R2t=Object.setPrototypeOf((pF={get stream(){return this[Ed]},next:function(){var e=this,r=this[Nv];if(r!==null)return Promise.reject(r);if(this[hF])return Promise.resolve(e0(void 0,!0));if(this[Ed].destroyed)return new Promise(function(u,A){process.nextTick(function(){e[Nv]?A(e[Nv]):u(e0(void 0,!0))})});var o=this[yd],a;if(o)a=new Promise(Q2t(o,this));else{var n=this[Ed].read();if(n!==null)return Promise.resolve(e0(n,!1));a=new Promise(this[D9])}return this[yd]=a,a}},Zh(pF,Symbol.asyncIterator,function(){return this}),Zh(pF,"return",function(){var e=this;return new Promise(function(r,o){e[Ed].destroy(null,function(a){if(a){o(a);return}r(e0(void 0,!0))})})}),pF),F2t),T2t=function(e){var r,o=Object.create(R2t,(r={},Zh(r,Ed,{value:e,writable:!0}),Zh(r,$h,{value:null,writable:!0}),Zh(r,md,{value:null,writable:!0}),Zh(r,Nv,{value:null,writable:!0}),Zh(r,hF,{value:e._readableState.endEmitted,writable:!0}),Zh(r,D9,{value:function(n,u){var A=o[Ed].read();A?(o[yd]=null,o[$h]=null,o[md]=null,n(e0(A,!1))):(o[$h]=n,o[md]=u)},writable:!0}),r));return o[yd]=null,x2t(e,function(a){if(a&&a.code!=="ERR_STREAM_PREMATURE_CLOSE"){var n=o[md];n!==null&&(o[yd]=null,o[$h]=null,o[md]=null,n(a)),o[Nv]=a;return}var u=o[$h];u!==null&&(o[yd]=null,o[$h]=null,o[md]=null,u(e0(void 0,!0))),o[hF]=!0}),e.on("readable",k2t.bind(null,o)),o};U2e.exports=T2t});var G2e=_((a$t,j2e)=>{"use strict";function H2e(t,e,r,o,a,n,u){try{var A=t[n](u),p=A.value}catch(h){r(h);return}A.done?e(p):Promise.resolve(p).then(o,a)}function L2t(t){return function(){var e=this,r=arguments;return new Promise(function(o,a){var n=t.apply(e,r);function u(p){H2e(n,o,a,u,A,"next",p)}function A(p){H2e(n,o,a,u,A,"throw",p)}u(void 0)})}}function q2e(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,o)}return r}function N2t(t){for(var e=1;e{"use strict";eBe.exports=wn;var _C;wn.ReadableState=V2e;var l$t=ve("events").EventEmitter,K2e=function(e,r){return e.listeners(r).length},Mv=a9(),gF=ve("buffer").Buffer,_2t=global.Uint8Array||function(){};function H2t(t){return gF.from(t)}function q2t(t){return gF.isBuffer(t)||t instanceof _2t}var P9=ve("util"),tn;P9&&P9.debuglog?tn=P9.debuglog("stream"):tn=function(){};var j2t=p2e(),R9=u9(),G2t=A9(),W2t=G2t.getHighWaterMark,dF=zh().codes,Y2t=dF.ERR_INVALID_ARG_TYPE,K2t=dF.ERR_STREAM_PUSH_AFTER_EOF,V2t=dF.ERR_METHOD_NOT_IMPLEMENTED,z2t=dF.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,HC,S9,x9;Jh()(wn,Mv);var Ov=R9.errorOrDestroy,b9=["error","close","destroy","pause","resume"];function J2t(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}function V2e(t,e,r){_C=_C||dd(),t=t||{},typeof r!="boolean"&&(r=e instanceof _C),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=W2t(this,t,"readableHighWaterMark",r),this.buffer=new j2t,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(HC||(HC=v9().StringDecoder),this.decoder=new HC(t.encoding),this.encoding=t.encoding)}function wn(t){if(_C=_C||dd(),!(this instanceof wn))return new wn(t);var e=this instanceof _C;this._readableState=new V2e(t,this,e),this.readable=!0,t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy)),Mv.call(this)}Object.defineProperty(wn.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}});wn.prototype.destroy=R9.destroy;wn.prototype._undestroy=R9.undestroy;wn.prototype._destroy=function(t,e){e(t)};wn.prototype.push=function(t,e){var r=this._readableState,o;return r.objectMode?o=!0:typeof t=="string"&&(e=e||r.defaultEncoding,e!==r.encoding&&(t=gF.from(t,e),e=""),o=!0),z2e(this,t,e,!1,o)};wn.prototype.unshift=function(t){return z2e(this,t,null,!0,!1)};function z2e(t,e,r,o,a){tn("readableAddChunk",e);var n=t._readableState;if(e===null)n.reading=!1,$2t(t,n);else{var u;if(a||(u=X2t(n,e)),u)Ov(t,u);else if(n.objectMode||e&&e.length>0)if(typeof e!="string"&&!n.objectMode&&Object.getPrototypeOf(e)!==gF.prototype&&(e=H2t(e)),o)n.endEmitted?Ov(t,new z2t):k9(t,n,e,!0);else if(n.ended)Ov(t,new K2t);else{if(n.destroyed)return!1;n.reading=!1,n.decoder&&!r?(e=n.decoder.write(e),n.objectMode||e.length!==0?k9(t,n,e,!1):F9(t,n)):k9(t,n,e,!1)}else o||(n.reading=!1,F9(t,n))}return!n.ended&&(n.length=W2e?t=W2e:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function Y2e(t,e){return t<=0||e.length===0&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=Z2t(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}wn.prototype.read=function(t){tn("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(t!==0&&(e.emittedReadable=!1),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return tn("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?Q9(this):mF(this),null;if(t=Y2e(t,e),t===0&&e.ended)return e.length===0&&Q9(this),null;var o=e.needReadable;tn("need readable",o),(e.length===0||e.length-t0?a=Z2e(t,e):a=null,a===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&Q9(this)),a!==null&&this.emit("data",a),a};function $2t(t,e){if(tn("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?mF(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,J2e(t)))}}function mF(t){var e=t._readableState;tn("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(tn("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(J2e,t))}function J2e(t){var e=t._readableState;tn("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,T9(t)}function F9(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(eBt,t,e))}function eBt(t,e){for(;!e.reading&&!e.ended&&(e.length1&&$2e(o.pipes,t)!==-1)&&!h&&(tn("false write response, pause",o.awaitDrain),o.awaitDrain++),r.pause())}function D(N){tn("onerror",N),T(),t.removeListener("error",D),K2e(t,"error")===0&&Ov(t,N)}J2t(t,"error",D);function b(){t.removeListener("finish",C),T()}t.once("close",b);function C(){tn("onfinish"),t.removeListener("close",b),T()}t.once("finish",C);function T(){tn("unpipe"),r.unpipe(t)}return t.emit("pipe",r),o.flowing||(tn("pipe resume"),r.resume()),t};function tBt(t){return function(){var r=t._readableState;tn("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&K2e(t,"data")&&(r.flowing=!0,T9(t))}}wn.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(e.pipesCount===0)return this;if(e.pipesCount===1)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var o=e.pipes,a=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var n=0;n0,o.flowing!==!1&&this.resume()):t==="readable"&&!o.endEmitted&&!o.readableListening&&(o.readableListening=o.needReadable=!0,o.flowing=!1,o.emittedReadable=!1,tn("on readable",o.length,o.reading),o.length?mF(this):o.reading||process.nextTick(rBt,this)),r};wn.prototype.addListener=wn.prototype.on;wn.prototype.removeListener=function(t,e){var r=Mv.prototype.removeListener.call(this,t,e);return t==="readable"&&process.nextTick(X2e,this),r};wn.prototype.removeAllListeners=function(t){var e=Mv.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&process.nextTick(X2e,this),e};function X2e(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function rBt(t){tn("readable nexttick read 0"),t.read(0)}wn.prototype.resume=function(){var t=this._readableState;return t.flowing||(tn("resume"),t.flowing=!t.readableListening,nBt(this,t)),t.paused=!1,this};function nBt(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(iBt,t,e))}function iBt(t,e){tn("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),T9(t),e.flowing&&!e.reading&&t.read(0)}wn.prototype.pause=function(){return tn("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(tn("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function T9(t){var e=t._readableState;for(tn("flow",e.flowing);e.flowing&&t.read()!==null;);}wn.prototype.wrap=function(t){var e=this,r=this._readableState,o=!1;t.on("end",function(){if(tn("wrapped end"),r.decoder&&!r.ended){var u=r.decoder.end();u&&u.length&&e.push(u)}e.push(null)}),t.on("data",function(u){if(tn("wrapped data"),r.decoder&&(u=r.decoder.write(u)),!(r.objectMode&&u==null)&&!(!r.objectMode&&(!u||!u.length))){var A=e.push(u);A||(o=!0,t.pause())}});for(var a in t)this[a]===void 0&&typeof t[a]=="function"&&(this[a]=function(A){return function(){return t[A].apply(t,arguments)}}(a));for(var n=0;n=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.first():r=e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r}function Q9(t){var e=t._readableState;tn("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(sBt,e,t))}function sBt(t,e){if(tn("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&t.length===0&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}typeof Symbol=="function"&&(wn.from=function(t,e){return x9===void 0&&(x9=G2e()),x9(wn,t,e)});function $2e(t,e){for(var r=0,o=t.length;r{"use strict";rBe.exports=ip;var yF=zh().codes,oBt=yF.ERR_METHOD_NOT_IMPLEMENTED,aBt=yF.ERR_MULTIPLE_CALLBACK,lBt=yF.ERR_TRANSFORM_ALREADY_TRANSFORMING,cBt=yF.ERR_TRANSFORM_WITH_LENGTH_0,EF=dd();Jh()(ip,EF);function uBt(t,e){var r=this._transformState;r.transforming=!1;var o=r.writecb;if(o===null)return this.emit("error",new aBt);r.writechunk=null,r.writecb=null,e!=null&&this.push(e),o(t);var a=this._readableState;a.reading=!1,(a.needReadable||a.length{"use strict";iBe.exports=Uv;var nBe=L9();Jh()(Uv,nBe);function Uv(t){if(!(this instanceof Uv))return new Uv(t);nBe.call(this,t)}Uv.prototype._transform=function(t,e,r){r(null,t)}});var uBe=_((f$t,cBe)=>{"use strict";var N9;function fBt(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}var lBe=zh().codes,pBt=lBe.ERR_MISSING_ARGS,hBt=lBe.ERR_STREAM_DESTROYED;function oBe(t){if(t)throw t}function gBt(t){return t.setHeader&&typeof t.abort=="function"}function dBt(t,e,r,o){o=fBt(o);var a=!1;t.on("close",function(){a=!0}),N9===void 0&&(N9=fF()),N9(t,{readable:e,writable:r},function(u){if(u)return o(u);a=!0,o()});var n=!1;return function(u){if(!a&&!n){if(n=!0,gBt(t))return t.abort();if(typeof t.destroy=="function")return t.destroy();o(u||new hBt("pipe"))}}}function aBe(t){t()}function mBt(t,e){return t.pipe(e)}function yBt(t){return!t.length||typeof t[t.length-1]!="function"?oBe:t.pop()}function EBt(){for(var t=arguments.length,e=new Array(t),r=0;r0;return dBt(u,p,h,function(E){a||(a=E),E&&n.forEach(aBe),!p&&(n.forEach(aBe),o(a))})});return e.reduce(mBt)}cBe.exports=EBt});var qC=_((fc,Hv)=>{var _v=ve("stream");process.env.READABLE_STREAM==="disable"&&_v?(Hv.exports=_v.Readable,Object.assign(Hv.exports,_v),Hv.exports.Stream=_v):(fc=Hv.exports=C9(),fc.Stream=_v||fc,fc.Readable=fc,fc.Writable=m9(),fc.Duplex=dd(),fc.Transform=L9(),fc.PassThrough=sBe(),fc.finished=fF(),fc.pipeline=uBe())});var pBe=_((p$t,fBe)=>{"use strict";var{Buffer:hu}=ve("buffer"),ABe=Symbol.for("BufferList");function fi(t){if(!(this instanceof fi))return new fi(t);fi._init.call(this,t)}fi._init=function(e){Object.defineProperty(this,ABe,{value:!0}),this._bufs=[],this.length=0,e&&this.append(e)};fi.prototype._new=function(e){return new fi(e)};fi.prototype._offset=function(e){if(e===0)return[0,0];let r=0;for(let o=0;othis.length||e<0)return;let r=this._offset(e);return this._bufs[r[0]][r[1]]};fi.prototype.slice=function(e,r){return typeof e=="number"&&e<0&&(e+=this.length),typeof r=="number"&&r<0&&(r+=this.length),this.copy(null,0,e,r)};fi.prototype.copy=function(e,r,o,a){if((typeof o!="number"||o<0)&&(o=0),(typeof a!="number"||a>this.length)&&(a=this.length),o>=this.length||a<=0)return e||hu.alloc(0);let n=!!e,u=this._offset(o),A=a-o,p=A,h=n&&r||0,E=u[1];if(o===0&&a===this.length){if(!n)return this._bufs.length===1?this._bufs[0]:hu.concat(this._bufs,this.length);for(let w=0;wD)this._bufs[w].copy(e,h,E),h+=D;else{this._bufs[w].copy(e,h,E,E+p),h+=D;break}p-=D,E&&(E=0)}return e.length>h?e.slice(0,h):e};fi.prototype.shallowSlice=function(e,r){if(e=e||0,r=typeof r!="number"?this.length:r,e<0&&(e+=this.length),r<0&&(r+=this.length),e===r)return this._new();let o=this._offset(e),a=this._offset(r),n=this._bufs.slice(o[0],a[0]+1);return a[1]===0?n.pop():n[n.length-1]=n[n.length-1].slice(0,a[1]),o[1]!==0&&(n[0]=n[0].slice(o[1])),this._new(n)};fi.prototype.toString=function(e,r,o){return this.slice(r,o).toString(e)};fi.prototype.consume=function(e){if(e=Math.trunc(e),Number.isNaN(e)||e<=0)return this;for(;this._bufs.length;)if(e>=this._bufs[0].length)e-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift();else{this._bufs[0]=this._bufs[0].slice(e),this.length-=e;break}return this};fi.prototype.duplicate=function(){let e=this._new();for(let r=0;rthis.length?this.length:e;let o=this._offset(e),a=o[0],n=o[1];for(;a=t.length){let p=u.indexOf(t,n);if(p!==-1)return this._reverseOffset([a,p]);n=u.length-t.length+1}else{let p=this._reverseOffset([a,n]);if(this._match(p,t))return p;n++}n=0}return-1};fi.prototype._match=function(t,e){if(this.length-t{"use strict";var O9=qC().Duplex,CBt=Jh(),qv=pBe();function Fo(t){if(!(this instanceof Fo))return new Fo(t);if(typeof t=="function"){this._callback=t;let e=function(o){this._callback&&(this._callback(o),this._callback=null)}.bind(this);this.on("pipe",function(o){o.on("error",e)}),this.on("unpipe",function(o){o.removeListener("error",e)}),t=null}qv._init.call(this,t),O9.call(this)}CBt(Fo,O9);Object.assign(Fo.prototype,qv.prototype);Fo.prototype._new=function(e){return new Fo(e)};Fo.prototype._write=function(e,r,o){this._appendBuffer(e),typeof o=="function"&&o()};Fo.prototype._read=function(e){if(!this.length)return this.push(null);e=Math.min(e,this.length),this.push(this.slice(0,e)),this.consume(e)};Fo.prototype.end=function(e){O9.prototype.end.call(this,e),this._callback&&(this._callback(null,this.slice()),this._callback=null)};Fo.prototype._destroy=function(e,r){this._bufs.length=0,this.length=0,r(e)};Fo.prototype._isBufferList=function(e){return e instanceof Fo||e instanceof qv||Fo.isBufferList(e)};Fo.isBufferList=qv.isBufferList;CF.exports=Fo;CF.exports.BufferListStream=Fo;CF.exports.BufferList=qv});var _9=_(GC=>{var IBt=Buffer.alloc,wBt="0000000000000000000",BBt="7777777777777777777",gBe=48,dBe=Buffer.from("ustar\0","binary"),vBt=Buffer.from("00","binary"),DBt=Buffer.from("ustar ","binary"),PBt=Buffer.from(" \0","binary"),SBt=parseInt("7777",8),jv=257,U9=263,xBt=function(t,e,r){return typeof t!="number"?r:(t=~~t,t>=e?e:t>=0||(t+=e,t>=0)?t:0)},bBt=function(t){switch(t){case 0:return"file";case 1:return"link";case 2:return"symlink";case 3:return"character-device";case 4:return"block-device";case 5:return"directory";case 6:return"fifo";case 7:return"contiguous-file";case 72:return"pax-header";case 55:return"pax-global-header";case 27:return"gnu-long-link-path";case 28:case 30:return"gnu-long-path"}return null},kBt=function(t){switch(t){case"file":return 0;case"link":return 1;case"symlink":return 2;case"character-device":return 3;case"block-device":return 4;case"directory":return 5;case"fifo":return 6;case"contiguous-file":return 7;case"pax-header":return 72}return 0},mBe=function(t,e,r,o){for(;re?BBt.slice(0,e)+" ":wBt.slice(0,e-t.length)+t+" "};function QBt(t){var e;if(t[0]===128)e=!0;else if(t[0]===255)e=!1;else return null;for(var r=[],o=t.length-1;o>0;o--){var a=t[o];e?r.push(a):r.push(255-a)}var n=0,u=r.length;for(o=0;o=Math.pow(10,r)&&r++,e+r+t};GC.decodeLongPath=function(t,e){return jC(t,0,t.length,e)};GC.encodePax=function(t){var e="";t.name&&(e+=M9(" path="+t.name+` `)),t.linkname&&(e+=M9(" linkpath="+t.linkname+` `));var r=t.pax;if(r)for(var o in r)e+=M9(" "+o+"="+r[o]+` `);return Buffer.from(e)};GC.decodePax=function(t){for(var e={};t.length;){for(var r=0;r100;){var a=r.indexOf("/");if(a===-1)return null;o+=o?"/"+r.slice(0,a):r.slice(0,a),r=r.slice(a+1)}return Buffer.byteLength(r)>100||Buffer.byteLength(o)>155||t.linkname&&Buffer.byteLength(t.linkname)>100?null:(e.write(r),e.write(t0(t.mode&SBt,6),100),e.write(t0(t.uid,6),108),e.write(t0(t.gid,6),116),e.write(t0(t.size,11),124),e.write(t0(t.mtime.getTime()/1e3|0,11),136),e[156]=gBe+kBt(t.type),t.linkname&&e.write(t.linkname,157),dBe.copy(e,jv),vBt.copy(e,U9),t.uname&&e.write(t.uname,265),t.gname&&e.write(t.gname,297),e.write(t0(t.devmajor||0,6),329),e.write(t0(t.devminor||0,6),337),o&&e.write(o,345),e.write(t0(yBe(e),6),148),e)};GC.decode=function(t,e,r){var o=t[156]===0?0:t[156]-gBe,a=jC(t,0,100,e),n=r0(t,100,8),u=r0(t,108,8),A=r0(t,116,8),p=r0(t,124,12),h=r0(t,136,12),E=bBt(o),w=t[157]===0?null:jC(t,157,100,e),D=jC(t,265,32),b=jC(t,297,32),C=r0(t,329,8),T=r0(t,337,8),N=yBe(t);if(N===8*32)return null;if(N!==r0(t,148,8))throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(dBe.compare(t,jv,jv+6)===0)t[345]&&(a=jC(t,345,155,e)+"/"+a);else if(!(DBt.compare(t,jv,jv+6)===0&&PBt.compare(t,U9,U9+2)===0)){if(!r)throw new Error("Invalid tar header: unknown format.")}return o===0&&a&&a[a.length-1]==="/"&&(o=5),{name:a,mode:n,uid:u,gid:A,size:p,mtime:new Date(1e3*h),type:E,linkname:w,uname:D,gname:b,devmajor:C,devminor:T}}});var DBe=_((d$t,vBe)=>{var CBe=ve("util"),FBt=hBe(),Gv=_9(),IBe=qC().Writable,wBe=qC().PassThrough,BBe=function(){},EBe=function(t){return t&=511,t&&512-t},RBt=function(t,e){var r=new IF(t,e);return r.end(),r},TBt=function(t,e){return e.path&&(t.name=e.path),e.linkpath&&(t.linkname=e.linkpath),e.size&&(t.size=parseInt(e.size,10)),t.pax=e,t},IF=function(t,e){this._parent=t,this.offset=e,wBe.call(this,{autoDestroy:!1})};CBe.inherits(IF,wBe);IF.prototype.destroy=function(t){this._parent.destroy(t)};var sp=function(t){if(!(this instanceof sp))return new sp(t);IBe.call(this,t),t=t||{},this._offset=0,this._buffer=FBt(),this._missing=0,this._partial=!1,this._onparse=BBe,this._header=null,this._stream=null,this._overflow=null,this._cb=null,this._locked=!1,this._destroyed=!1,this._pax=null,this._paxGlobal=null,this._gnuLongPath=null,this._gnuLongLinkPath=null;var e=this,r=e._buffer,o=function(){e._continue()},a=function(D){if(e._locked=!1,D)return e.destroy(D);e._stream||o()},n=function(){e._stream=null;var D=EBe(e._header.size);D?e._parse(D,u):e._parse(512,w),e._locked||o()},u=function(){e._buffer.consume(EBe(e._header.size)),e._parse(512,w),o()},A=function(){var D=e._header.size;e._paxGlobal=Gv.decodePax(r.slice(0,D)),r.consume(D),n()},p=function(){var D=e._header.size;e._pax=Gv.decodePax(r.slice(0,D)),e._paxGlobal&&(e._pax=Object.assign({},e._paxGlobal,e._pax)),r.consume(D),n()},h=function(){var D=e._header.size;this._gnuLongPath=Gv.decodeLongPath(r.slice(0,D),t.filenameEncoding),r.consume(D),n()},E=function(){var D=e._header.size;this._gnuLongLinkPath=Gv.decodeLongPath(r.slice(0,D),t.filenameEncoding),r.consume(D),n()},w=function(){var D=e._offset,b;try{b=e._header=Gv.decode(r.slice(0,512),t.filenameEncoding,t.allowUnknownFormat)}catch(C){e.emit("error",C)}if(r.consume(512),!b){e._parse(512,w),o();return}if(b.type==="gnu-long-path"){e._parse(b.size,h),o();return}if(b.type==="gnu-long-link-path"){e._parse(b.size,E),o();return}if(b.type==="pax-global-header"){e._parse(b.size,A),o();return}if(b.type==="pax-header"){e._parse(b.size,p),o();return}if(e._gnuLongPath&&(b.name=e._gnuLongPath,e._gnuLongPath=null),e._gnuLongLinkPath&&(b.linkname=e._gnuLongLinkPath,e._gnuLongLinkPath=null),e._pax&&(e._header=b=TBt(b,e._pax),e._pax=null),e._locked=!0,!b.size||b.type==="directory"){e._parse(512,w),e.emit("entry",b,RBt(e,D),a);return}e._stream=new IF(e,D),e.emit("entry",b,e._stream,a),e._parse(b.size,n),o()};this._onheader=w,this._parse(512,w)};CBe.inherits(sp,IBe);sp.prototype.destroy=function(t){this._destroyed||(this._destroyed=!0,t&&this.emit("error",t),this.emit("close"),this._stream&&this._stream.emit("close"))};sp.prototype._parse=function(t,e){this._destroyed||(this._offset+=t,this._missing=t,e===this._onheader&&(this._partial=!1),this._onparse=e)};sp.prototype._continue=function(){if(!this._destroyed){var t=this._cb;this._cb=BBe,this._overflow?this._write(this._overflow,void 0,t):t()}};sp.prototype._write=function(t,e,r){if(!this._destroyed){var o=this._stream,a=this._buffer,n=this._missing;if(t.length&&(this._partial=!0),t.lengthn&&(u=t.slice(n),t=t.slice(0,n)),o?o.end(t):a.append(t),this._overflow=u,this._onparse()}};sp.prototype._final=function(t){if(this._partial)return this.destroy(new Error("Unexpected end of data"));t()};vBe.exports=sp});var SBe=_((m$t,PBe)=>{PBe.exports=ve("fs").constants||ve("constants")});var FBe=_((y$t,QBe)=>{var WC=SBe(),xBe=E4(),BF=Jh(),LBt=Buffer.alloc,bBe=qC().Readable,YC=qC().Writable,NBt=ve("string_decoder").StringDecoder,wF=_9(),OBt=parseInt("755",8),MBt=parseInt("644",8),kBe=LBt(1024),q9=function(){},H9=function(t,e){e&=511,e&&t.push(kBe.slice(0,512-e))};function UBt(t){switch(t&WC.S_IFMT){case WC.S_IFBLK:return"block-device";case WC.S_IFCHR:return"character-device";case WC.S_IFDIR:return"directory";case WC.S_IFIFO:return"fifo";case WC.S_IFLNK:return"symlink"}return"file"}var vF=function(t){YC.call(this),this.written=0,this._to=t,this._destroyed=!1};BF(vF,YC);vF.prototype._write=function(t,e,r){if(this.written+=t.length,this._to.push(t))return r();this._to._drain=r};vF.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var DF=function(){YC.call(this),this.linkname="",this._decoder=new NBt("utf-8"),this._destroyed=!1};BF(DF,YC);DF.prototype._write=function(t,e,r){this.linkname+=this._decoder.write(t),r()};DF.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var Wv=function(){YC.call(this),this._destroyed=!1};BF(Wv,YC);Wv.prototype._write=function(t,e,r){r(new Error("No body allowed for this entry"))};Wv.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var wA=function(t){if(!(this instanceof wA))return new wA(t);bBe.call(this,t),this._drain=q9,this._finalized=!1,this._finalizing=!1,this._destroyed=!1,this._stream=null};BF(wA,bBe);wA.prototype.entry=function(t,e,r){if(this._stream)throw new Error("already piping an entry");if(!(this._finalized||this._destroyed)){typeof e=="function"&&(r=e,e=null),r||(r=q9);var o=this;if((!t.size||t.type==="symlink")&&(t.size=0),t.type||(t.type=UBt(t.mode)),t.mode||(t.mode=t.type==="directory"?OBt:MBt),t.uid||(t.uid=0),t.gid||(t.gid=0),t.mtime||(t.mtime=new Date),typeof e=="string"&&(e=Buffer.from(e)),Buffer.isBuffer(e)){t.size=e.length,this._encode(t);var a=this.push(e);return H9(o,t.size),a?process.nextTick(r):this._drain=r,new Wv}if(t.type==="symlink"&&!t.linkname){var n=new DF;return xBe(n,function(A){if(A)return o.destroy(),r(A);t.linkname=n.linkname,o._encode(t),r()}),n}if(this._encode(t),t.type!=="file"&&t.type!=="contiguous-file")return process.nextTick(r),new Wv;var u=new vF(this);return this._stream=u,xBe(u,function(A){if(o._stream=null,A)return o.destroy(),r(A);if(u.written!==t.size)return o.destroy(),r(new Error("size mismatch"));H9(o,t.size),o._finalizing&&o.finalize(),r()}),u}};wA.prototype.finalize=function(){if(this._stream){this._finalizing=!0;return}this._finalized||(this._finalized=!0,this.push(kBe),this.push(null))};wA.prototype.destroy=function(t){this._destroyed||(this._destroyed=!0,t&&this.emit("error",t),this.emit("close"),this._stream&&this._stream.destroy&&this._stream.destroy())};wA.prototype._encode=function(t){if(!t.pax){var e=wF.encode(t);if(e){this.push(e);return}}this._encodePax(t)};wA.prototype._encodePax=function(t){var e=wF.encodePax({name:t.name,linkname:t.linkname,pax:t.pax}),r={name:"PaxHeader",mode:t.mode,uid:t.uid,gid:t.gid,size:e.length,mtime:t.mtime,type:"pax-header",linkname:t.linkname&&"PaxHeader",uname:t.uname,gname:t.gname,devmajor:t.devmajor,devminor:t.devminor};this.push(wF.encode(r)),this.push(e),H9(this,e.length),r.size=t.size,r.type=t.type,this.push(wF.encode(r))};wA.prototype._read=function(t){var e=this._drain;this._drain=q9,e()};QBe.exports=wA});var RBe=_(j9=>{j9.extract=DBe();j9.pack=FBe()});var WBe=_((M$t,GBe)=>{"use strict";var Yv=class t{constructor(e,r,o){this.__specs=e||{},Object.keys(this.__specs).forEach(a=>{if(typeof this.__specs[a]=="string"){let n=this.__specs[a],u=this.__specs[n];if(u){let A=u.aliases||[];A.push(a,n),u.aliases=[...new Set(A)],this.__specs[a]=u}else throw new Error(`Alias refers to invalid key: ${n} -> ${a}`)}}),this.__opts=r||{},this.__providers=qBe(o.filter(a=>a!=null&&typeof a=="object")),this.__isFiggyPudding=!0}get(e){return z9(this,e,!0)}get[Symbol.toStringTag](){return"FiggyPudding"}forEach(e,r=this){for(let[o,a]of this.entries())e.call(r,a,o,this)}toJSON(){let e={};return this.forEach((r,o)=>{e[o]=r}),e}*entries(e){for(let o of Object.keys(this.__specs))yield[o,this.get(o)];let r=e||this.__opts.other;if(r){let o=new Set;for(let a of this.__providers){let n=a.entries?a.entries(r):evt(a);for(let[u,A]of n)r(u)&&!o.has(u)&&(o.add(u),yield[u,A])}}}*[Symbol.iterator](){for(let[e,r]of this.entries())yield[e,r]}*keys(){for(let[e]of this.entries())yield e}*values(){for(let[,e]of this.entries())yield e}concat(...e){return new Proxy(new t(this.__specs,this.__opts,qBe(this.__providers).concat(e)),jBe)}};try{let t=ve("util");Yv.prototype[t.inspect.custom]=function(e,r){return this[Symbol.toStringTag]+" "+t.inspect(this.toJSON(),r)}}catch{}function ZBt(t){throw Object.assign(new Error(`invalid config key requested: ${t}`),{code:"EBADKEY"})}function z9(t,e,r){let o=t.__specs[e];if(r&&!o&&(!t.__opts.other||!t.__opts.other(e)))ZBt(e);else{o||(o={});let a;for(let n of t.__providers){if(a=HBe(e,n),a===void 0&&o.aliases&&o.aliases.length){for(let u of o.aliases)if(u!==e&&(a=HBe(u,n),a!==void 0))break}if(a!==void 0)break}return a===void 0&&o.default!==void 0?typeof o.default=="function"?o.default(t):o.default:a}}function HBe(t,e){let r;return e.__isFiggyPudding?r=z9(e,t,!1):typeof e.get=="function"?r=e.get(t):r=e[t],r}var jBe={has(t,e){return e in t.__specs&&z9(t,e,!1)!==void 0},ownKeys(t){return Object.keys(t.__specs)},get(t,e){return typeof e=="symbol"||e.slice(0,2)==="__"||e in Yv.prototype?t[e]:t.get(e)},set(t,e,r){if(typeof e=="symbol"||e.slice(0,2)==="__")return t[e]=r,!0;throw new Error("figgyPudding options cannot be modified. Use .concat() instead.")},deleteProperty(){throw new Error("figgyPudding options cannot be deleted. Use .concat() and shadow them instead.")}};GBe.exports=$Bt;function $Bt(t,e){function r(...o){return new Proxy(new Yv(t,e,o),jBe)}return r}function qBe(t){let e=[];return t.forEach(r=>e.unshift(r)),e}function evt(t){return Object.keys(t).map(e=>[e,t[e]])}});var VBe=_((U$t,DA)=>{"use strict";var Vv=ve("crypto"),tvt=WBe(),rvt=ve("stream").Transform,YBe=["sha256","sha384","sha512"],nvt=/^[a-z0-9+/]+(?:=?=?)$/i,ivt=/^([^-]+)-([^?]+)([?\S*]*)$/,svt=/^([^-]+)-([A-Za-z0-9+/=]{44,88})(\?[\x21-\x7E]*)*$/,ovt=/^[\x21-\x7E]+$/,na=tvt({algorithms:{default:["sha512"]},error:{default:!1},integrity:{},options:{default:[]},pickAlgorithm:{default:()=>hvt},Promise:{default:()=>Promise},sep:{default:" "},single:{default:!1},size:{},strict:{default:!1}}),n0=class{get isHash(){return!0}constructor(e,r){r=na(r);let o=!!r.strict;this.source=e.trim();let a=this.source.match(o?svt:ivt);if(!a||o&&!YBe.some(u=>u===a[1]))return;this.algorithm=a[1],this.digest=a[2];let n=a[3];this.options=n?n.slice(1).split("?"):[]}hexDigest(){return this.digest&&Buffer.from(this.digest,"base64").toString("hex")}toJSON(){return this.toString()}toString(e){if(e=na(e),e.strict&&!(YBe.some(o=>o===this.algorithm)&&this.digest.match(nvt)&&(this.options||[]).every(o=>o.match(ovt))))return"";let r=this.options&&this.options.length?`?${this.options.join("?")}`:"";return`${this.algorithm}-${this.digest}${r}`}},Cd=class{get isIntegrity(){return!0}toJSON(){return this.toString()}toString(e){e=na(e);let r=e.sep||" ";return e.strict&&(r=r.replace(/\S+/g," ")),Object.keys(this).map(o=>this[o].map(a=>n0.prototype.toString.call(a,e)).filter(a=>a.length).join(r)).filter(o=>o.length).join(r)}concat(e,r){r=na(r);let o=typeof e=="string"?e:Kv(e,r);return vA(`${this.toString(r)} ${o}`,r)}hexDigest(){return vA(this,{single:!0}).hexDigest()}match(e,r){r=na(r);let o=vA(e,r),a=o.pickAlgorithm(r);return this[a]&&o[a]&&this[a].find(n=>o[a].find(u=>n.digest===u.digest))||!1}pickAlgorithm(e){e=na(e);let r=e.pickAlgorithm,o=Object.keys(this);if(!o.length)throw new Error(`No algorithms available for ${JSON.stringify(this.toString())}`);return o.reduce((a,n)=>r(a,n)||a)}};DA.exports.parse=vA;function vA(t,e){if(e=na(e),typeof t=="string")return J9(t,e);if(t.algorithm&&t.digest){let r=new Cd;return r[t.algorithm]=[t],J9(Kv(r,e),e)}else return J9(Kv(t,e),e)}function J9(t,e){return e.single?new n0(t,e):t.trim().split(/\s+/).reduce((r,o)=>{let a=new n0(o,e);if(a.algorithm&&a.digest){let n=a.algorithm;r[n]||(r[n]=[]),r[n].push(a)}return r},new Cd)}DA.exports.stringify=Kv;function Kv(t,e){return e=na(e),t.algorithm&&t.digest?n0.prototype.toString.call(t,e):typeof t=="string"?Kv(vA(t,e),e):Cd.prototype.toString.call(t,e)}DA.exports.fromHex=avt;function avt(t,e,r){r=na(r);let o=r.options&&r.options.length?`?${r.options.join("?")}`:"";return vA(`${e}-${Buffer.from(t,"hex").toString("base64")}${o}`,r)}DA.exports.fromData=lvt;function lvt(t,e){e=na(e);let r=e.algorithms,o=e.options&&e.options.length?`?${e.options.join("?")}`:"";return r.reduce((a,n)=>{let u=Vv.createHash(n).update(t).digest("base64"),A=new n0(`${n}-${u}${o}`,e);if(A.algorithm&&A.digest){let p=A.algorithm;a[p]||(a[p]=[]),a[p].push(A)}return a},new Cd)}DA.exports.fromStream=cvt;function cvt(t,e){e=na(e);let r=e.Promise||Promise,o=X9(e);return new r((a,n)=>{t.pipe(o),t.on("error",n),o.on("error",n);let u;o.on("integrity",A=>{u=A}),o.on("end",()=>a(u)),o.on("data",()=>{})})}DA.exports.checkData=uvt;function uvt(t,e,r){if(r=na(r),e=vA(e,r),!Object.keys(e).length){if(r.error)throw Object.assign(new Error("No valid integrity hashes to check against"),{code:"EINTEGRITY"});return!1}let o=e.pickAlgorithm(r),a=Vv.createHash(o).update(t).digest("base64"),n=vA({algorithm:o,digest:a}),u=n.match(e,r);if(u||!r.error)return u;if(typeof r.size=="number"&&t.length!==r.size){let A=new Error(`data size mismatch when checking ${e}. Wanted: ${r.size} Found: ${t.length}`);throw A.code="EBADSIZE",A.found=t.length,A.expected=r.size,A.sri=e,A}else{let A=new Error(`Integrity checksum failed when using ${o}: Wanted ${e}, but got ${n}. (${t.length} bytes)`);throw A.code="EINTEGRITY",A.found=n,A.expected=e,A.algorithm=o,A.sri=e,A}}DA.exports.checkStream=Avt;function Avt(t,e,r){r=na(r);let o=r.Promise||Promise,a=X9(r.concat({integrity:e}));return new o((n,u)=>{t.pipe(a),t.on("error",u),a.on("error",u);let A;a.on("verified",p=>{A=p}),a.on("end",()=>n(A)),a.on("data",()=>{})})}DA.exports.integrityStream=X9;function X9(t){t=na(t);let e=t.integrity&&vA(t.integrity,t),r=e&&Object.keys(e).length,o=r&&e.pickAlgorithm(t),a=r&&e[o],n=Array.from(new Set(t.algorithms.concat(o?[o]:[]))),u=n.map(Vv.createHash),A=0,p=new rvt({transform(h,E,w){A+=h.length,u.forEach(D=>D.update(h,E)),w(null,h,E)}}).on("end",()=>{let h=t.options&&t.options.length?`?${t.options.join("?")}`:"",E=vA(u.map((D,b)=>`${n[b]}-${D.digest("base64")}${h}`).join(" "),t),w=r&&E.match(e,t);if(typeof t.size=="number"&&A!==t.size){let D=new Error(`stream size mismatch when checking ${e}. Wanted: ${t.size} Found: ${A}`);D.code="EBADSIZE",D.found=A,D.expected=t.size,D.sri=e,p.emit("error",D)}else if(t.integrity&&!w){let D=new Error(`${e} integrity checksum failed when using ${o}: wanted ${a} but got ${E}. (${A} bytes)`);D.code="EINTEGRITY",D.found=E,D.expected=a,D.algorithm=o,D.sri=e,p.emit("error",D)}else p.emit("size",A),p.emit("integrity",E),w&&p.emit("verified",w)});return p}DA.exports.create=fvt;function fvt(t){t=na(t);let e=t.algorithms,r=t.options.length?`?${t.options.join("?")}`:"",o=e.map(Vv.createHash);return{update:function(a,n){return o.forEach(u=>u.update(a,n)),this},digest:function(a){return e.reduce((u,A)=>{let p=o.shift().digest("base64"),h=new n0(`${A}-${p}${r}`,t);if(h.algorithm&&h.digest){let E=h.algorithm;u[E]||(u[E]=[]),u[E].push(h)}return u},new Cd)}}}var pvt=new Set(Vv.getHashes()),KBe=["md5","whirlpool","sha1","sha224","sha256","sha384","sha512","sha3","sha3-256","sha3-384","sha3-512","sha3_256","sha3_384","sha3_512"].filter(t=>pvt.has(t));function hvt(t,e){return KBe.indexOf(t.toLowerCase())>=KBe.indexOf(e.toLowerCase())?t:e}});var Bve=_((qnr,wve)=>{var hDt=WN();function gDt(t){return hDt(t)?void 0:t}wve.exports=gDt});var Dve=_((jnr,vve)=>{var dDt=Cb(),mDt=hH(),yDt=yH(),EDt=Wg(),CDt=Eg(),IDt=Bve(),wDt=l8(),BDt=pH(),vDt=1,DDt=2,PDt=4,SDt=wDt(function(t,e){var r={};if(t==null)return r;var o=!1;e=dDt(e,function(n){return n=EDt(n,t),o||(o=n.length>1),n}),CDt(t,BDt(t),r),o&&(r=mDt(r,vDt|DDt|PDt,IDt));for(var a=e.length;a--;)yDt(r,e[a]);return r});vve.exports=SDt});Pt();Ke();Pt();var kve=ve("child_process"),Qve=et(sg());Gt();var oE=new Map([]);var S2={};Kt(S2,{BaseCommand:()=>ut,WorkspaceRequiredError:()=>or,getCli:()=>qhe,getDynamicLibs:()=>Hhe,getPluginConfiguration:()=>lE,openWorkspace:()=>aE,pluginCommands:()=>oE,runExit:()=>Nk});Gt();var ut=class extends st{constructor(){super(...arguments);this.cwd=de.String("--cwd",{hidden:!0})}validateAndExecute(){if(typeof this.cwd<"u")throw new ot("The --cwd option is ambiguous when used anywhere else than the very first parameter provided in the command line, before even the command path");return super.validateAndExecute()}};Ke();Pt();Gt();var or=class extends ot{constructor(e,r){let o=K.relative(e,r),a=K.join(e,_t.fileName);super(`This command can only be run from within a workspace of your project (${o} isn't a workspace of ${a}).`)}};Ke();Pt();sA();Ol();J1();Gt();var SAt=et(ni());il();var Hhe=()=>new Map([["@yarnpkg/cli",S2],["@yarnpkg/core",P2],["@yarnpkg/fslib",Aw],["@yarnpkg/libzip",V1],["@yarnpkg/parsers",Ew],["@yarnpkg/shell",e2],["clipanion",Qw],["semver",SAt],["typanion",Yo]]);Ke();async function aE(t,e){let{project:r,workspace:o}=await Qt.find(t,e);if(!o)throw new or(r.cwd,e);return o}Ke();Pt();sA();Ol();J1();Gt();var NDt=et(ni());il();var MH={};Kt(MH,{AddCommand:()=>fE,BinCommand:()=>pE,CacheCleanCommand:()=>hE,ClipanionCommand:()=>CE,ConfigCommand:()=>yE,ConfigGetCommand:()=>gE,ConfigSetCommand:()=>dE,ConfigUnsetCommand:()=>mE,DedupeCommand:()=>EE,EntryCommand:()=>wE,ExecCommand:()=>vE,ExplainCommand:()=>SE,ExplainPeerRequirementsCommand:()=>DE,HelpCommand:()=>IE,InfoCommand:()=>xE,LinkCommand:()=>kE,NodeCommand:()=>QE,PluginCheckCommand:()=>FE,PluginImportCommand:()=>LE,PluginImportSourcesCommand:()=>NE,PluginListCommand:()=>RE,PluginRemoveCommand:()=>OE,PluginRuntimeCommand:()=>ME,RebuildCommand:()=>UE,RemoveCommand:()=>_E,RunCommand:()=>qE,RunIndexCommand:()=>HE,SetResolutionCommand:()=>jE,SetVersionCommand:()=>PE,SetVersionSourcesCommand:()=>TE,UnlinkCommand:()=>GE,UpCommand:()=>WE,VersionCommand:()=>BE,WhyCommand:()=>YE,WorkspaceCommand:()=>XE,WorkspacesListCommand:()=>JE,YarnCommand:()=>bE,dedupeUtils:()=>Yk,default:()=>Igt,suggestUtils:()=>nu});var Eme=et(sg());Ke();Ke();Ke();Gt();var bge=et(Q2());il();var nu={};Kt(nu,{Modifier:()=>lH,Strategy:()=>jk,Target:()=>F2,WorkspaceModifier:()=>vge,applyModifier:()=>Kft,extractDescriptorFromPath:()=>cH,extractRangeModifier:()=>Dge,fetchDescriptorFrom:()=>uH,findProjectDescriptors:()=>xge,getModifier:()=>R2,getSuggestedDescriptors:()=>T2,makeWorkspaceDescriptor:()=>Sge,toWorkspaceModifier:()=>Pge});Ke();Ke();Pt();var aH=et(ni()),Wft="workspace:",F2=(o=>(o.REGULAR="dependencies",o.DEVELOPMENT="devDependencies",o.PEER="peerDependencies",o))(F2||{}),lH=(o=>(o.CARET="^",o.TILDE="~",o.EXACT="",o))(lH||{}),vge=(o=>(o.CARET="^",o.TILDE="~",o.EXACT="*",o))(vge||{}),jk=(n=>(n.KEEP="keep",n.REUSE="reuse",n.PROJECT="project",n.LATEST="latest",n.CACHE="cache",n))(jk||{});function R2(t,e){return t.exact?"":t.caret?"^":t.tilde?"~":e.configuration.get("defaultSemverRangePrefix")}var Yft=/^([\^~]?)[0-9]+(?:\.[0-9]+){0,2}(?:-\S+)?$/;function Dge(t,{project:e}){let r=t.match(Yft);return r?r[1]:e.configuration.get("defaultSemverRangePrefix")}function Kft(t,e){let{protocol:r,source:o,params:a,selector:n}=G.parseRange(t.range);return aH.default.valid(n)&&(n=`${e}${t.range}`),G.makeDescriptor(t,G.makeRange({protocol:r,source:o,params:a,selector:n}))}function Pge(t){switch(t){case"^":return"^";case"~":return"~";case"":return"*";default:throw new Error(`Assertion failed: Unknown modifier: "${t}"`)}}function Sge(t,e){return G.makeDescriptor(t.anchoredDescriptor,`${Wft}${Pge(e)}`)}async function xge(t,{project:e,target:r}){let o=new Map,a=n=>{let u=o.get(n.descriptorHash);return u||o.set(n.descriptorHash,u={descriptor:n,locators:[]}),u};for(let n of e.workspaces)if(r==="peerDependencies"){let u=n.manifest.peerDependencies.get(t.identHash);u!==void 0&&a(u).locators.push(n.anchoredLocator)}else{let u=n.manifest.dependencies.get(t.identHash),A=n.manifest.devDependencies.get(t.identHash);r==="devDependencies"?A!==void 0?a(A).locators.push(n.anchoredLocator):u!==void 0&&a(u).locators.push(n.anchoredLocator):u!==void 0?a(u).locators.push(n.anchoredLocator):A!==void 0&&a(A).locators.push(n.anchoredLocator)}return o}async function cH(t,{cwd:e,workspace:r}){return await Vft(async o=>{K.isAbsolute(t)||(t=K.relative(r.cwd,K.resolve(e,t)),t.match(/^\.{0,2}\//)||(t=`./${t}`));let{project:a}=r,n=await uH(G.makeIdent(null,"archive"),t,{project:r.project,cache:o,workspace:r});if(!n)throw new Error("Assertion failed: The descriptor should have been found");let u=new Ri,A=a.configuration.makeResolver(),p=a.configuration.makeFetcher(),h={checksums:a.storedChecksums,project:a,cache:o,fetcher:p,report:u,resolver:A},E=A.bindDescriptor(n,r.anchoredLocator,h),w=G.convertDescriptorToLocator(E),D=await p.fetch(w,h),b=await _t.find(D.prefixPath,{baseFs:D.packageFs});if(!b.name)throw new Error("Target path doesn't have a name");return G.makeDescriptor(b.name,t)})}async function T2(t,{project:e,workspace:r,cache:o,target:a,fixed:n,modifier:u,strategies:A,maxResults:p=1/0}){if(!(p>=0))throw new Error(`Invalid maxResults (${p})`);let[h,E]=t.range!=="unknown"?n||Ur.validRange(t.range)||!t.range.match(/^[a-z0-9._-]+$/i)?[t.range,"latest"]:["unknown",t.range]:["unknown","latest"];if(h!=="unknown")return{suggestions:[{descriptor:t,name:`Use ${G.prettyDescriptor(e.configuration,t)}`,reason:"(unambiguous explicit request)"}],rejections:[]};let w=typeof r<"u"&&r!==null&&r.manifest[a].get(t.identHash)||null,D=[],b=[],C=async T=>{try{await T()}catch(N){b.push(N)}};for(let T of A){if(D.length>=p)break;switch(T){case"keep":await C(async()=>{w&&D.push({descriptor:w,name:`Keep ${G.prettyDescriptor(e.configuration,w)}`,reason:"(no changes)"})});break;case"reuse":await C(async()=>{for(let{descriptor:N,locators:U}of(await xge(t,{project:e,target:a})).values()){if(U.length===1&&U[0].locatorHash===r.anchoredLocator.locatorHash&&A.includes("keep"))continue;let z=`(originally used by ${G.prettyLocator(e.configuration,U[0])}`;z+=U.length>1?` and ${U.length-1} other${U.length>2?"s":""})`:")",D.push({descriptor:N,name:`Reuse ${G.prettyDescriptor(e.configuration,N)}`,reason:z})}});break;case"cache":await C(async()=>{for(let N of e.storedDescriptors.values())N.identHash===t.identHash&&D.push({descriptor:N,name:`Reuse ${G.prettyDescriptor(e.configuration,N)}`,reason:"(already used somewhere in the lockfile)"})});break;case"project":await C(async()=>{if(r.manifest.name!==null&&t.identHash===r.manifest.name.identHash)return;let N=e.tryWorkspaceByIdent(t);if(N===null)return;let U=Sge(N,u);D.push({descriptor:U,name:`Attach ${G.prettyDescriptor(e.configuration,U)}`,reason:`(local workspace at ${pe.pretty(e.configuration,N.relativeCwd,pe.Type.PATH)})`})});break;case"latest":{let N=e.configuration.get("enableNetwork"),U=e.configuration.get("enableOfflineMode");await C(async()=>{if(a==="peerDependencies")D.push({descriptor:G.makeDescriptor(t,"*"),name:"Use *",reason:"(catch-all peer dependency pattern)"});else if(!N&&!U)D.push({descriptor:null,name:"Resolve from latest",reason:pe.pretty(e.configuration,"(unavailable because enableNetwork is toggled off)","grey")});else{let z=await uH(t,E,{project:e,cache:o,workspace:r,modifier:u});z&&D.push({descriptor:z,name:`Use ${G.prettyDescriptor(e.configuration,z)}`,reason:`(resolved from ${U?"the cache":"latest"})`})}})}break}}return{suggestions:D.slice(0,p),rejections:b.slice(0,p)}}async function uH(t,e,{project:r,cache:o,workspace:a,preserveModifier:n=!0,modifier:u}){let A=r.configuration.normalizeDependency(G.makeDescriptor(t,e)),p=new Ri,h=r.configuration.makeFetcher(),E=r.configuration.makeResolver(),w={project:r,fetcher:h,cache:o,checksums:r.storedChecksums,report:p,cacheOptions:{skipIntegrityCheck:!0}},D={...w,resolver:E,fetchOptions:w},b=E.bindDescriptor(A,a.anchoredLocator,D),C=await E.getCandidates(b,{},D);if(C.length===0)return null;let T=C[0],{protocol:N,source:U,params:z,selector:te}=G.parseRange(G.convertToManifestRange(T.reference));if(N===r.configuration.get("defaultProtocol")&&(N=null),aH.default.valid(te)){let le=te;if(typeof u<"u")te=u+te;else if(n!==!1){let Ie=typeof n=="string"?n:A.range;te=Dge(Ie,{project:r})+te}let ce=G.makeDescriptor(T,G.makeRange({protocol:N,source:U,params:z,selector:te}));(await E.getCandidates(r.configuration.normalizeDependency(ce),{},D)).length!==1&&(te=le)}return G.makeDescriptor(T,G.makeRange({protocol:N,source:U,params:z,selector:te}))}async function Vft(t){return await ae.mktempPromise(async e=>{let r=Je.create(e);return r.useWithSource(e,{enableMirror:!1,compressionLevel:0},e,{overwrite:!0}),await t(new Wr(e,{configuration:r,check:!1,immutable:!1}))})}var fE=class extends ut{constructor(){super(...arguments);this.json=de.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.fixed=de.Boolean("-F,--fixed",!1,{description:"Store dependency tags as-is instead of resolving them"});this.exact=de.Boolean("-E,--exact",!1,{description:"Don't use any semver modifier on the resolved range"});this.tilde=de.Boolean("-T,--tilde",!1,{description:"Use the `~` semver modifier on the resolved range"});this.caret=de.Boolean("-C,--caret",!1,{description:"Use the `^` semver modifier on the resolved range"});this.dev=de.Boolean("-D,--dev",!1,{description:"Add a package as a dev dependency"});this.peer=de.Boolean("-P,--peer",!1,{description:"Add a package as a peer dependency"});this.optional=de.Boolean("-O,--optional",!1,{description:"Add / upgrade a package to an optional regular / peer dependency"});this.preferDev=de.Boolean("--prefer-dev",!1,{description:"Add / upgrade a package to a dev dependency"});this.interactive=de.Boolean("-i,--interactive",{description:"Reuse the specified package from other workspaces in the project"});this.cached=de.Boolean("--cached",!1,{description:"Reuse the highest version already used somewhere within the project"});this.mode=de.String("--mode",{description:"Change what artifacts installs generate",validator:js(yl)});this.silent=de.Boolean("--silent",{hidden:!0});this.packages=de.Rest()}static{this.paths=[["add"]]}static{this.usage=st.Usage({description:"add dependencies to the project",details:"\n This command adds a package to the package.json for the nearest workspace.\n\n - If it didn't exist before, the package will by default be added to the regular `dependencies` field, but this behavior can be overriden thanks to the `-D,--dev` flag (which will cause the dependency to be added to the `devDependencies` field instead) and the `-P,--peer` flag (which will do the same but for `peerDependencies`).\n\n - If the package was already listed in your dependencies, it will by default be upgraded whether it's part of your `dependencies` or `devDependencies` (it won't ever update `peerDependencies`, though).\n\n - If set, the `--prefer-dev` flag will operate as a more flexible `-D,--dev` in that it will add the package to your `devDependencies` if it isn't already listed in either `dependencies` or `devDependencies`, but it will also happily upgrade your `dependencies` if that's what you already use (whereas `-D,--dev` would throw an exception).\n\n - If set, the `-O,--optional` flag will add the package to the `optionalDependencies` field and, in combination with the `-P,--peer` flag, it will add the package as an optional peer dependency. If the package was already listed in your `dependencies`, it will be upgraded to `optionalDependencies`. If the package was already listed in your `peerDependencies`, in combination with the `-P,--peer` flag, it will be upgraded to an optional peer dependency: `\"peerDependenciesMeta\": { \"\": { \"optional\": true } }`\n\n - If the added package doesn't specify a range at all its `latest` tag will be resolved and the returned version will be used to generate a new semver range (using the `^` modifier by default unless otherwise configured via the `defaultSemverRangePrefix` configuration, or the `~` modifier if `-T,--tilde` is specified, or no modifier at all if `-E,--exact` is specified). Two exceptions to this rule: the first one is that if the package is a workspace then its local version will be used, and the second one is that if you use `-P,--peer` the default range will be `*` and won't be resolved at all.\n\n - If the added package specifies a range (such as `^1.0.0`, `latest`, or `rc`), Yarn will add this range as-is in the resulting package.json entry (in particular, tags such as `rc` will be encoded as-is rather than being converted into a semver range).\n\n If the `--cached` option is used, Yarn will preferably reuse the highest version already used somewhere within the project, even if through a transitive dependency.\n\n If the `-i,--interactive` option is used (or if the `preferInteractive` settings is toggled on) the command will first try to check whether other workspaces in the project use the specified package and, if so, will offer to reuse them.\n\n If the `--mode=` option is set, Yarn will change which artifacts are generated. The modes currently supported are:\n\n - `skip-build` will not run the build scripts at all. Note that this is different from setting `enableScripts` to false because the latter will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run.\n\n - `update-lockfile` will skip the link step altogether, and only fetch packages that are missing from the lockfile (or that have no associated checksums). This mode is typically used by tools like Renovate or Dependabot to keep a lockfile up-to-date without incurring the full install cost.\n\n For a compilation of all the supported protocols, please consult the dedicated page from our website: https://yarnpkg.com/protocols.\n ",examples:[["Add a regular package to the current workspace","$0 add lodash"],["Add a specific version for a package to the current workspace","$0 add lodash@1.2.3"],["Add a package from a GitHub repository (the master branch) to the current workspace using a URL","$0 add lodash@https://github.com/lodash/lodash"],["Add a package from a GitHub repository (the master branch) to the current workspace using the GitHub protocol","$0 add lodash@github:lodash/lodash"],["Add a package from a GitHub repository (the master branch) to the current workspace using the GitHub protocol (shorthand)","$0 add lodash@lodash/lodash"],["Add a package from a specific branch of a GitHub repository to the current workspace using the GitHub protocol (shorthand)","$0 add lodash-es@lodash/lodash#es"],["Add a local package (gzipped tarball format) to the current workspace","$0 add local-package-name@file:../path/to/local-package-name-v0.1.2.tgz"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:o,workspace:a}=await Qt.find(r,this.context.cwd),n=await Wr.find(r);if(!a)throw new or(o.cwd,this.context.cwd);await o.restoreInstallState({restoreResolutions:!1});let u=this.fixed,A=r.isInteractive({interactive:this.interactive,stdout:this.context.stdout}),p=A||r.get("preferReuse"),h=R2(this,o),E=[p?"reuse":void 0,"project",this.cached?"cache":void 0,"latest"].filter(U=>typeof U<"u"),w=A?1/0:1,D=await Promise.all(this.packages.map(async U=>{let z=U.match(/^\.{0,2}\//)?await cH(U,{cwd:this.context.cwd,workspace:a}):G.tryParseDescriptor(U),te=U.match(/^(https?:|git@github)/);if(te)throw new ot(`It seems you are trying to add a package using a ${pe.pretty(r,`${te[0]}...`,pe.Type.RANGE)} url; we now require package names to be explicitly specified. Try running the command again with the package name prefixed: ${pe.pretty(r,"yarn add",pe.Type.CODE)} ${pe.pretty(r,G.makeDescriptor(G.makeIdent(null,"my-package"),`${te[0]}...`),pe.Type.DESCRIPTOR)}`);if(!z)throw new ot(`The ${pe.pretty(r,U,pe.Type.CODE)} string didn't match the required format (package-name@range). Did you perhaps forget to explicitly reference the package name?`);let le=zft(a,z,{dev:this.dev,peer:this.peer,preferDev:this.preferDev,optional:this.optional});return await Promise.all(le.map(async ue=>{let Ie=await T2(z,{project:o,workspace:a,cache:n,fixed:u,target:ue,modifier:h,strategies:E,maxResults:w});return{request:z,suggestedDescriptors:Ie,target:ue}}))})).then(U=>U.flat()),b=await pA.start({configuration:r,stdout:this.context.stdout,suggestInstall:!1},async U=>{for(let{request:z,suggestedDescriptors:{suggestions:te,rejections:le}}of D)if(te.filter(ue=>ue.descriptor!==null).length===0){let[ue]=le;if(typeof ue>"u")throw new Error("Assertion failed: Expected an error to have been set");o.configuration.get("enableNetwork")?U.reportError(27,`${G.prettyDescriptor(r,z)} can't be resolved to a satisfying range`):U.reportError(27,`${G.prettyDescriptor(r,z)} can't be resolved to a satisfying range (note: network resolution has been disabled)`),U.reportSeparator(),U.reportExceptionOnce(ue)}});if(b.hasErrors())return b.exitCode();let C=!1,T=[],N=[];for(let{suggestedDescriptors:{suggestions:U},target:z}of D){let te,le=U.filter(he=>he.descriptor!==null),ce=le[0].descriptor,ue=le.every(he=>G.areDescriptorsEqual(he.descriptor,ce));le.length===1||ue?te=ce:(C=!0,{answer:te}=await(0,bge.prompt)({type:"select",name:"answer",message:"Which range do you want to use?",choices:U.map(({descriptor:he,name:De,reason:Ee})=>he?{name:De,hint:Ee,descriptor:he}:{name:De,hint:Ee,disabled:!0}),onCancel:()=>process.exit(130),result(he){return this.find(he,"descriptor")},stdin:this.context.stdin,stdout:this.context.stdout}));let Ie=a.manifest[z].get(te.identHash);(typeof Ie>"u"||Ie.descriptorHash!==te.descriptorHash)&&(a.manifest[z].set(te.identHash,te),this.optional&&(z==="dependencies"?a.manifest.ensureDependencyMeta({...te,range:"unknown"}).optional=!0:z==="peerDependencies"&&(a.manifest.ensurePeerDependencyMeta({...te,range:"unknown"}).optional=!0)),typeof Ie>"u"?T.push([a,z,te,E]):N.push([a,z,Ie,te]))}return await r.triggerMultipleHooks(U=>U.afterWorkspaceDependencyAddition,T),await r.triggerMultipleHooks(U=>U.afterWorkspaceDependencyReplacement,N),C&&this.context.stdout.write(` `),await o.installWithNewReport({json:this.json,stdout:this.context.stdout,quiet:this.context.quiet},{cache:n,mode:this.mode})}};function zft(t,e,{dev:r,peer:o,preferDev:a,optional:n}){let u=t.manifest.dependencies.has(e.identHash),A=t.manifest.devDependencies.has(e.identHash),p=t.manifest.peerDependencies.has(e.identHash);if((r||o)&&u)throw new ot(`Package "${G.prettyIdent(t.project.configuration,e)}" is already listed as a regular dependency - remove the -D,-P flags or remove it from your dependencies first`);if(!r&&!o&&p)throw new ot(`Package "${G.prettyIdent(t.project.configuration,e)}" is already listed as a peer dependency - use either of -D or -P, or remove it from your peer dependencies first`);if(n&&A)throw new ot(`Package "${G.prettyIdent(t.project.configuration,e)}" is already listed as a dev dependency - remove the -O flag or remove it from your dev dependencies first`);if(n&&!o&&p)throw new ot(`Package "${G.prettyIdent(t.project.configuration,e)}" is already listed as a peer dependency - remove the -O flag or add the -P flag or remove it from your peer dependencies first`);if((r||a)&&n)throw new ot(`Package "${G.prettyIdent(t.project.configuration,e)}" cannot simultaneously be a dev dependency and an optional dependency`);let h=[];return o&&h.push("peerDependencies"),(r||a)&&h.push("devDependencies"),n&&h.push("dependencies"),h.length>0?h:A?["devDependencies"]:p?["peerDependencies"]:["dependencies"]}Ke();Ke();Gt();var pE=class extends ut{constructor(){super(...arguments);this.verbose=de.Boolean("-v,--verbose",!1,{description:"Print both the binary name and the locator of the package that provides the binary"});this.json=de.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.name=de.String({required:!1})}static{this.paths=[["bin"]]}static{this.usage=st.Usage({description:"get the path to a binary script",details:` When used without arguments, this command will print the list of all the binaries available in the current workspace. Adding the \`-v,--verbose\` flag will cause the output to contain both the binary name and the locator of the package that provides the binary. When an argument is specified, this command will just print the path to the binary on the standard output and exit. Note that the reported path may be stored within a zip archive. `,examples:[["List all the available binaries","$0 bin"],["Print the path to a specific binary","$0 bin eslint"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:o,locator:a}=await Qt.find(r,this.context.cwd);if(await o.restoreInstallState(),this.name){let A=(await hn.getPackageAccessibleBinaries(a,{project:o})).get(this.name);if(!A)throw new ot(`Couldn't find a binary named "${this.name}" for package "${G.prettyLocator(r,a)}"`);let[,p]=A;return this.context.stdout.write(`${p} `),0}return(await Lt.start({configuration:r,json:this.json,stdout:this.context.stdout},async u=>{let A=await hn.getPackageAccessibleBinaries(a,{project:o}),h=Array.from(A.keys()).reduce((E,w)=>Math.max(E,w.length),0);for(let[E,[w,D]]of A)u.reportJson({name:E,source:G.stringifyIdent(w),path:D});if(this.verbose)for(let[E,[w]]of A)u.reportInfo(null,`${E.padEnd(h," ")} ${G.prettyLocator(r,w)}`);else for(let E of A.keys())u.reportInfo(null,E)})).exitCode()}};Ke();Pt();Gt();var hE=class extends ut{constructor(){super(...arguments);this.mirror=de.Boolean("--mirror",!1,{description:"Remove the global cache files instead of the local cache files"});this.all=de.Boolean("--all",!1,{description:"Remove both the global cache files and the local cache files of the current project"})}static{this.paths=[["cache","clean"],["cache","clear"]]}static{this.usage=st.Usage({description:"remove the shared cache files",details:` This command will remove all the files from the cache. `,examples:[["Remove all the local archives","$0 cache clean"],["Remove all the archives stored in the ~/.yarn directory","$0 cache clean --mirror"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),o=await Wr.find(r);return(await Lt.start({configuration:r,stdout:this.context.stdout},async()=>{let n=(this.all||this.mirror)&&o.mirrorCwd!==null,u=!this.mirror;n&&(await ae.removePromise(o.mirrorCwd),await r.triggerHook(A=>A.cleanGlobalArtifacts,r)),u&&await ae.removePromise(o.cwd)})).exitCode()}};Ke();Gt();var Qge=et(L2()),AH=ve("util"),gE=class extends ut{constructor(){super(...arguments);this.why=de.Boolean("--why",!1,{description:"Print the explanation for why a setting has its value"});this.json=de.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.unsafe=de.Boolean("--no-redacted",!1,{description:"Don't redact secrets (such as tokens) from the output"});this.name=de.String()}static{this.paths=[["config","get"]]}static{this.usage=st.Usage({description:"read a configuration settings",details:` This command will print a configuration setting. Secrets (such as tokens) will be redacted from the output by default. If this behavior isn't desired, set the \`--no-redacted\` to get the untransformed value. `,examples:[["Print a simple configuration setting","yarn config get yarnPath"],["Print a complex configuration setting","yarn config get packageExtensions"],["Print a nested field from the configuration",`yarn config get 'npmScopes["my-company"].npmRegistryServer'`],["Print a token from the configuration","yarn config get npmAuthToken --no-redacted"],["Print a configuration setting as JSON","yarn config get packageExtensions --json"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),o=this.name.replace(/[.[].*$/,""),a=this.name.replace(/^[^.[]*/,"");if(typeof r.settings.get(o)>"u")throw new ot(`Couldn't find a configuration settings named "${o}"`);let u=r.getSpecial(o,{hideSecrets:!this.unsafe,getNativePaths:!0}),A=qe.convertMapsToIndexableObjects(u),p=a?(0,Qge.default)(A,a):A,h=await Lt.start({configuration:r,includeFooter:!1,json:this.json,stdout:this.context.stdout},async E=>{E.reportJson(p)});if(!this.json){if(typeof p=="string")return this.context.stdout.write(`${p} `),h.exitCode();AH.inspect.styles.name="cyan",this.context.stdout.write(`${(0,AH.inspect)(p,{depth:1/0,colors:r.get("enableColors"),compact:!1})} `)}return h.exitCode()}};Ke();Gt();var Ide=et(gH()),wde=et(L2()),Bde=et(dH()),mH=ve("util"),dE=class extends ut{constructor(){super(...arguments);this.json=de.Boolean("--json",!1,{description:"Set complex configuration settings to JSON values"});this.home=de.Boolean("-H,--home",!1,{description:"Update the home configuration instead of the project configuration"});this.name=de.String();this.value=de.String()}static{this.paths=[["config","set"]]}static{this.usage=st.Usage({description:"change a configuration settings",details:` This command will set a configuration setting. When used without the \`--json\` flag, it can only set a simple configuration setting (a string, a number, or a boolean). When used with the \`--json\` flag, it can set both simple and complex configuration settings, including Arrays and Objects. `,examples:[["Set a simple configuration setting (a string, a number, or a boolean)","yarn config set initScope myScope"],["Set a simple configuration setting (a string, a number, or a boolean) using the `--json` flag",'yarn config set initScope --json \\"myScope\\"'],["Set a complex configuration setting (an Array) using the `--json` flag",`yarn config set unsafeHttpWhitelist --json '["*.example.com", "example.com"]'`],["Set a complex configuration setting (an Object) using the `--json` flag",`yarn config set packageExtensions --json '{ "@babel/parser@*": { "dependencies": { "@babel/types": "*" } } }'`],["Set a nested configuration setting",'yarn config set npmScopes.company.npmRegistryServer "https://npm.example.com"'],["Set a nested configuration setting using indexed access for non-simple keys",`yarn config set 'npmRegistries["//npm.example.com"].npmAuthToken' "ffffffff-ffff-ffff-ffff-ffffffffffff"`]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),o=()=>{if(!r.projectCwd)throw new ot("This command must be run from within a project folder");return r.projectCwd},a=this.name.replace(/[.[].*$/,""),n=this.name.replace(/^[^.[]*\.?/,"");if(typeof r.settings.get(a)>"u")throw new ot(`Couldn't find a configuration settings named "${a}"`);if(a==="enableStrictSettings")throw new ot("This setting only affects the file it's in, and thus cannot be set from the CLI");let A=this.json?JSON.parse(this.value):this.value;await(this.home?C=>Je.updateHomeConfiguration(C):C=>Je.updateConfiguration(o(),C))(C=>{if(n){let T=(0,Ide.default)(C);return(0,Bde.default)(T,this.name,A),T}else return{...C,[a]:A}});let E=(await Je.find(this.context.cwd,this.context.plugins)).getSpecial(a,{hideSecrets:!0,getNativePaths:!0}),w=qe.convertMapsToIndexableObjects(E),D=n?(0,wde.default)(w,n):w;return(await Lt.start({configuration:r,includeFooter:!1,stdout:this.context.stdout},async C=>{mH.inspect.styles.name="cyan",C.reportInfo(0,`Successfully set ${this.name} to ${(0,mH.inspect)(D,{depth:1/0,colors:r.get("enableColors"),compact:!1})}`)})).exitCode()}};Ke();Gt();var Tde=et(gH()),Lde=et(Sde()),Nde=et(EH()),mE=class extends ut{constructor(){super(...arguments);this.home=de.Boolean("-H,--home",!1,{description:"Update the home configuration instead of the project configuration"});this.name=de.String()}static{this.paths=[["config","unset"]]}static{this.usage=st.Usage({description:"unset a configuration setting",details:` This command will unset a configuration setting. `,examples:[["Unset a simple configuration setting","yarn config unset initScope"],["Unset a complex configuration setting","yarn config unset packageExtensions"],["Unset a nested configuration setting","yarn config unset npmScopes.company.npmRegistryServer"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),o=()=>{if(!r.projectCwd)throw new ot("This command must be run from within a project folder");return r.projectCwd},a=this.name.replace(/[.[].*$/,""),n=this.name.replace(/^[^.[]*\.?/,"");if(typeof r.settings.get(a)>"u")throw new ot(`Couldn't find a configuration settings named "${a}"`);let A=this.home?h=>Je.updateHomeConfiguration(h):h=>Je.updateConfiguration(o(),h);return(await Lt.start({configuration:r,includeFooter:!1,stdout:this.context.stdout},async h=>{let E=!1;await A(w=>{if(!(0,Lde.default)(w,this.name))return h.reportWarning(0,`Configuration doesn't contain setting ${this.name}; there is nothing to unset`),E=!0,w;let D=n?(0,Tde.default)(w):{...w};return(0,Nde.default)(D,this.name),D}),E||h.reportInfo(0,`Successfully unset ${this.name}`)})).exitCode()}};Ke();Pt();Gt();var Wk=ve("util"),yE=class extends ut{constructor(){super(...arguments);this.noDefaults=de.Boolean("--no-defaults",!1,{description:"Omit the default values from the display"});this.json=de.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.verbose=de.Boolean("-v,--verbose",{hidden:!0});this.why=de.Boolean("--why",{hidden:!0});this.names=de.Rest()}static{this.paths=[["config"]]}static{this.usage=st.Usage({description:"display the current configuration",details:` This command prints the current active configuration settings. `,examples:[["Print the active configuration settings","$0 config"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins,{strict:!1}),o=await Qy({configuration:r,stdout:this.context.stdout,forceError:this.json},[{option:this.verbose,message:"The --verbose option is deprecated, the settings' descriptions are now always displayed"},{option:this.why,message:"The --why option is deprecated, the settings' sources are now always displayed"}]);if(o!==null)return o;let a=this.names.length>0?[...new Set(this.names)].sort():[...r.settings.keys()].sort(),n,u=await Lt.start({configuration:r,json:this.json,stdout:this.context.stdout,includeFooter:!1},async A=>{if(r.invalid.size>0&&!this.json){for(let[p,h]of r.invalid)A.reportError(34,`Invalid configuration key "${p}" in ${h}`);A.reportSeparator()}if(this.json)for(let p of a){let h=r.settings.get(p);typeof h>"u"&&A.reportError(34,`No configuration key named "${p}"`);let E=r.getSpecial(p,{hideSecrets:!0,getNativePaths:!0}),w=r.sources.get(p)??"",D=w&&w[0]!=="<"?Ae.fromPortablePath(w):w;A.reportJson({key:p,effective:E,source:D,...h})}else{let p={breakLength:1/0,colors:r.get("enableColors"),maxArrayLength:2},h={},E={children:h};for(let w of a){if(this.noDefaults&&!r.sources.has(w))continue;let D=r.settings.get(w),b=r.sources.get(w)??"",C=r.getSpecial(w,{hideSecrets:!0,getNativePaths:!0}),T={Description:{label:"Description",value:pe.tuple(pe.Type.MARKDOWN,{text:D.description,format:this.cli.format(),paragraphs:!1})},Source:{label:"Source",value:pe.tuple(b[0]==="<"?pe.Type.CODE:pe.Type.PATH,b)}};h[w]={value:pe.tuple(pe.Type.CODE,w),children:T};let N=(U,z)=>{for(let[te,le]of z)if(le instanceof Map){let ce={};U[te]={children:ce},N(ce,le)}else U[te]={label:te,value:pe.tuple(pe.Type.NO_HINT,(0,Wk.inspect)(le,p))}};C instanceof Map?N(T,C):T.Value={label:"Value",value:pe.tuple(pe.Type.NO_HINT,(0,Wk.inspect)(C,p))}}a.length!==1&&(n=void 0),As.emitTree(E,{configuration:r,json:this.json,stdout:this.context.stdout,separators:2})}});if(!this.json&&typeof n<"u"){let A=a[0],p=(0,Wk.inspect)(r.getSpecial(A,{hideSecrets:!0,getNativePaths:!0}),{colors:r.get("enableColors")});this.context.stdout.write(` `),this.context.stdout.write(`${p} `)}return u.exitCode()}};Ke();Gt();il();var Yk={};Kt(Yk,{Strategy:()=>N2,acceptedStrategies:()=>Q0t,dedupe:()=>CH});Ke();Ke();var Ode=et(Xo()),N2=(e=>(e.HIGHEST="highest",e))(N2||{}),Q0t=new Set(Object.values(N2)),F0t={highest:async(t,e,{resolver:r,fetcher:o,resolveOptions:a,fetchOptions:n})=>{let u=new Map;for(let[p,h]of t.storedResolutions){let E=t.storedDescriptors.get(p);if(typeof E>"u")throw new Error(`Assertion failed: The descriptor (${p}) should have been registered`);qe.getSetWithDefault(u,E.identHash).add(h)}let A=new Map(qe.mapAndFilter(t.storedDescriptors.values(),p=>G.isVirtualDescriptor(p)?qe.mapAndFilter.skip:[p.descriptorHash,qe.makeDeferred()]));for(let p of t.storedDescriptors.values()){let h=A.get(p.descriptorHash);if(typeof h>"u")throw new Error(`Assertion failed: The descriptor (${p.descriptorHash}) should have been registered`);let E=t.storedResolutions.get(p.descriptorHash);if(typeof E>"u")throw new Error(`Assertion failed: The resolution (${p.descriptorHash}) should have been registered`);let w=t.originalPackages.get(E);if(typeof w>"u")throw new Error(`Assertion failed: The package (${E}) should have been registered`);Promise.resolve().then(async()=>{let D=r.getResolutionDependencies(p,a),b=Object.fromEntries(await qe.allSettledSafe(Object.entries(D).map(async([te,le])=>{let ce=A.get(le.descriptorHash);if(typeof ce>"u")throw new Error(`Assertion failed: The descriptor (${le.descriptorHash}) should have been registered`);let ue=await ce.promise;if(!ue)throw new Error("Assertion failed: Expected the dependency to have been through the dedupe process itself");return[te,ue.updatedPackage]})));if(e.length&&!Ode.default.isMatch(G.stringifyIdent(p),e)||!r.shouldPersistResolution(w,a))return w;let C=u.get(p.identHash);if(typeof C>"u")throw new Error(`Assertion failed: The resolutions (${p.identHash}) should have been registered`);if(C.size===1)return w;let T=[...C].map(te=>{let le=t.originalPackages.get(te);if(typeof le>"u")throw new Error(`Assertion failed: The package (${te}) should have been registered`);return le}),N=await r.getSatisfying(p,b,T,a),U=N.locators?.[0];if(typeof U>"u"||!N.sorted)return w;let z=t.originalPackages.get(U.locatorHash);if(typeof z>"u")throw new Error(`Assertion failed: The package (${U.locatorHash}) should have been registered`);return z}).then(async D=>{let b=await t.preparePackage(D,{resolver:r,resolveOptions:a});h.resolve({descriptor:p,currentPackage:w,updatedPackage:D,resolvedPackage:b})}).catch(D=>{h.reject(D)})}return[...A.values()].map(p=>p.promise)}};async function CH(t,{strategy:e,patterns:r,cache:o,report:a}){let{configuration:n}=t,u=new Ri,A=n.makeResolver(),p=n.makeFetcher(),h={cache:o,checksums:t.storedChecksums,fetcher:p,project:t,report:u,cacheOptions:{skipIntegrityCheck:!0}},E={project:t,resolver:A,report:u,fetchOptions:h};return await a.startTimerPromise("Deduplication step",async()=>{let w=F0t[e],D=await w(t,r,{resolver:A,resolveOptions:E,fetcher:p,fetchOptions:h}),b=Ws.progressViaCounter(D.length);await a.reportProgress(b);let C=0;await Promise.all(D.map(U=>U.then(z=>{if(z===null||z.currentPackage.locatorHash===z.updatedPackage.locatorHash)return;C++;let{descriptor:te,currentPackage:le,updatedPackage:ce}=z;a.reportInfo(0,`${G.prettyDescriptor(n,te)} can be deduped from ${G.prettyLocator(n,le)} to ${G.prettyLocator(n,ce)}`),a.reportJson({descriptor:G.stringifyDescriptor(te),currentResolution:G.stringifyLocator(le),updatedResolution:G.stringifyLocator(ce)}),t.storedResolutions.set(te.descriptorHash,ce.locatorHash)}).finally(()=>b.tick())));let T;switch(C){case 0:T="No packages";break;case 1:T="One package";break;default:T=`${C} packages`}let N=pe.pretty(n,e,pe.Type.CODE);return a.reportInfo(0,`${T} can be deduped using the ${N} strategy`),C})}var EE=class extends ut{constructor(){super(...arguments);this.strategy=de.String("-s,--strategy","highest",{description:"The strategy to use when deduping dependencies",validator:js(N2)});this.check=de.Boolean("-c,--check",!1,{description:"Exit with exit code 1 when duplicates are found, without persisting the dependency tree"});this.json=de.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.mode=de.String("--mode",{description:"Change what artifacts installs generate",validator:js(yl)});this.patterns=de.Rest()}static{this.paths=[["dedupe"]]}static{this.usage=st.Usage({description:"deduplicate dependencies with overlapping ranges",details:"\n Duplicates are defined as descriptors with overlapping ranges being resolved and locked to different locators. They are a natural consequence of Yarn's deterministic installs, but they can sometimes pile up and unnecessarily increase the size of your project.\n\n This command dedupes dependencies in the current project using different strategies (only one is implemented at the moment):\n\n - `highest`: Reuses (where possible) the locators with the highest versions. This means that dependencies can only be upgraded, never downgraded. It's also guaranteed that it never takes more than a single pass to dedupe the entire dependency tree.\n\n **Note:** Even though it never produces a wrong dependency tree, this command should be used with caution, as it modifies the dependency tree, which can sometimes cause problems when packages don't strictly follow semver recommendations. Because of this, it is recommended to also review the changes manually.\n\n If set, the `-c,--check` flag will only report the found duplicates, without persisting the modified dependency tree. If changes are found, the command will exit with a non-zero exit code, making it suitable for CI purposes.\n\n If the `--mode=` option is set, Yarn will change which artifacts are generated. The modes currently supported are:\n\n - `skip-build` will not run the build scripts at all. Note that this is different from setting `enableScripts` to false because the latter will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run.\n\n - `update-lockfile` will skip the link step altogether, and only fetch packages that are missing from the lockfile (or that have no associated checksums). This mode is typically used by tools like Renovate or Dependabot to keep a lockfile up-to-date without incurring the full install cost.\n\n This command accepts glob patterns as arguments (if valid Idents and supported by [micromatch](https://github.com/micromatch/micromatch)). Make sure to escape the patterns, to prevent your own shell from trying to expand them.\n\n ### In-depth explanation:\n\n Yarn doesn't deduplicate dependencies by default, otherwise installs wouldn't be deterministic and the lockfile would be useless. What it actually does is that it tries to not duplicate dependencies in the first place.\n\n **Example:** If `foo@^2.3.4` (a dependency of a dependency) has already been resolved to `foo@2.3.4`, running `yarn add foo@*`will cause Yarn to reuse `foo@2.3.4`, even if the latest `foo` is actually `foo@2.10.14`, thus preventing unnecessary duplication.\n\n Duplication happens when Yarn can't unlock dependencies that have already been locked inside the lockfile.\n\n **Example:** If `foo@^2.3.4` (a dependency of a dependency) has already been resolved to `foo@2.3.4`, running `yarn add foo@2.10.14` will cause Yarn to install `foo@2.10.14` because the existing resolution doesn't satisfy the range `2.10.14`. This behavior can lead to (sometimes) unwanted duplication, since now the lockfile contains 2 separate resolutions for the 2 `foo` descriptors, even though they have overlapping ranges, which means that the lockfile can be simplified so that both descriptors resolve to `foo@2.10.14`.\n ",examples:[["Dedupe all packages","$0 dedupe"],["Dedupe all packages using a specific strategy","$0 dedupe --strategy highest"],["Dedupe a specific package","$0 dedupe lodash"],["Dedupe all packages with the `@babel/*` scope","$0 dedupe '@babel/*'"],["Check for duplicates (can be used as a CI step)","$0 dedupe --check"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:o}=await Qt.find(r,this.context.cwd),a=await Wr.find(r);await o.restoreInstallState({restoreResolutions:!1});let n=0,u=await Lt.start({configuration:r,includeFooter:!1,stdout:this.context.stdout,json:this.json},async A=>{n=await CH(o,{strategy:this.strategy,patterns:this.patterns,cache:a,report:A})});return u.hasErrors()?u.exitCode():this.check?n?1:0:await o.installWithNewReport({json:this.json,stdout:this.context.stdout},{cache:a,mode:this.mode})}};Ke();Gt();var CE=class extends ut{static{this.paths=[["--clipanion=definitions"]]}async execute(){let{plugins:e}=await Je.find(this.context.cwd,this.context.plugins),r=[];for(let u of e){let{commands:A}=u[1];if(A){let h=Vo.from(A).definitions();r.push([u[0],h])}}let o=this.cli.definitions(),a=(u,A)=>u.split(" ").slice(1).join()===A.split(" ").slice(1).join(),n=Mde()["@yarnpkg/builder"].bundles.standard;for(let u of r){let A=u[1];for(let p of A)o.find(h=>a(h.path,p.path)).plugin={name:u[0],isDefault:n.includes(u[0])}}this.context.stdout.write(`${JSON.stringify(o,null,2)} `)}};var IE=class extends ut{static{this.paths=[["help"],["--help"],["-h"]]}async execute(){this.context.stdout.write(this.cli.usage(null))}};Ke();Pt();Gt();var wE=class extends ut{constructor(){super(...arguments);this.leadingArgument=de.String();this.args=de.Proxy()}async execute(){if(this.leadingArgument.match(/[\\/]/)&&!G.tryParseIdent(this.leadingArgument)){let r=K.resolve(this.context.cwd,Ae.toPortablePath(this.leadingArgument));return await this.cli.run(this.args,{cwd:r})}else return await this.cli.run(["run",this.leadingArgument,...this.args])}};Ke();var BE=class extends ut{static{this.paths=[["-v"],["--version"]]}async execute(){this.context.stdout.write(`${nn||""} `)}};Ke();Ke();Gt();var vE=class extends ut{constructor(){super(...arguments);this.commandName=de.String();this.args=de.Proxy()}static{this.paths=[["exec"]]}static{this.usage=st.Usage({description:"execute a shell script",details:` This command simply executes a shell script within the context of the root directory of the active workspace using the portable shell. It also makes sure to call it in a way that's compatible with the current project (for example, on PnP projects the environment will be setup in such a way that PnP will be correctly injected into the environment). `,examples:[["Execute a single shell command","$0 exec echo Hello World"],["Execute a shell script",'$0 exec "tsc & babel src --out-dir lib"']]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:o,locator:a}=await Qt.find(r,this.context.cwd);return await o.restoreInstallState(),await hn.executePackageShellcode(a,this.commandName,this.args,{cwd:this.context.cwd,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr,project:o})}};Ke();Gt();il();var DE=class extends ut{constructor(){super(...arguments);this.hash=de.String({required:!1,validator:LP(Sm(),[Bw(/^p[0-9a-f]{5}$/)])})}static{this.paths=[["explain","peer-requirements"]]}static{this.usage=st.Usage({description:"explain a set of peer requirements",details:` A peer requirement represents all peer requests that a subject must satisfy when providing a requested package to requesters. When the hash argument is specified, this command prints a detailed explanation of the peer requirement corresponding to the hash and whether it is satisfied or not. When used without arguments, this command lists all peer requirements and the corresponding hash that can be used to get detailed information about a given requirement. **Note:** A hash is a six-letter p-prefixed code that can be obtained from peer dependency warnings or from the list of all peer requirements (\`yarn explain peer-requirements\`). `,examples:[["Explain the corresponding peer requirement for a hash","$0 explain peer-requirements p1a4ed"],["List all peer requirements","$0 explain peer-requirements"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:o}=await Qt.find(r,this.context.cwd);return await o.restoreInstallState({restoreResolutions:!1}),await o.applyLightResolution(),typeof this.hash<"u"?await T0t(this.hash,o,{stdout:this.context.stdout}):await L0t(o,{stdout:this.context.stdout})}};async function T0t(t,e,r){let o=e.peerRequirementNodes.get(t);if(typeof o>"u")throw new Error(`No peerDependency requirements found for hash: "${t}"`);let a=new Set,n=p=>a.has(p.requester.locatorHash)?{value:pe.tuple(pe.Type.DEPENDENT,{locator:p.requester,descriptor:p.descriptor}),children:p.children.size>0?[{value:pe.tuple(pe.Type.NO_HINT,"...")}]:[]}:(a.add(p.requester.locatorHash),{value:pe.tuple(pe.Type.DEPENDENT,{locator:p.requester,descriptor:p.descriptor}),children:Object.fromEntries(Array.from(p.children.values(),h=>[G.stringifyLocator(h.requester),n(h)]))}),u=e.peerWarnings.find(p=>p.hash===t);return(await Lt.start({configuration:e.configuration,stdout:r.stdout,includeFooter:!1,includePrefix:!1},async p=>{let h=pe.mark(e.configuration),E=u?h.Cross:h.Check;if(p.reportInfo(0,`Package ${pe.pretty(e.configuration,o.subject,pe.Type.LOCATOR)} is requested to provide ${pe.pretty(e.configuration,o.ident,pe.Type.IDENT)} by its descendants`),p.reportSeparator(),p.reportInfo(0,pe.pretty(e.configuration,o.subject,pe.Type.LOCATOR)),As.emitTree({children:Object.fromEntries(Array.from(o.requests.values(),w=>[G.stringifyLocator(w.requester),n(w)]))},{configuration:e.configuration,stdout:r.stdout,json:!1}),p.reportSeparator(),o.provided.range==="missing:"){let w=u?"":" , but all peer requests are optional";p.reportInfo(0,`${E} Package ${pe.pretty(e.configuration,o.subject,pe.Type.LOCATOR)} does not provide ${pe.pretty(e.configuration,o.ident,pe.Type.IDENT)}${w}.`)}else{let w=e.storedResolutions.get(o.provided.descriptorHash);if(!w)throw new Error("Assertion failed: Expected the descriptor to be registered");let D=e.storedPackages.get(w);if(!D)throw new Error("Assertion failed: Expected the package to be registered");p.reportInfo(0,`${E} Package ${pe.pretty(e.configuration,o.subject,pe.Type.LOCATOR)} provides ${pe.pretty(e.configuration,o.ident,pe.Type.IDENT)} with version ${G.prettyReference(e.configuration,D.version??"0.0.0")}, ${u?"which does not satisfy all requests.":"which satisfies all requests"}`),u?.type===3&&(u.range?p.reportInfo(0,` The combined requested range is ${pe.pretty(e.configuration,u.range,pe.Type.RANGE)}`):p.reportInfo(0," Unfortunately, the requested ranges have no overlap"))}})).exitCode()}async function L0t(t,e){return(await Lt.start({configuration:t.configuration,stdout:e.stdout,includeFooter:!1,includePrefix:!1},async o=>{let a=pe.mark(t.configuration),n=qe.sortMap(t.peerRequirementNodes,[([,u])=>G.stringifyLocator(u.subject),([,u])=>G.stringifyIdent(u.ident)]);for(let[,u]of n.values()){if(!u.root)continue;let A=t.peerWarnings.find(E=>E.hash===u.hash),p=[...G.allPeerRequests(u)],h;if(p.length>2?h=` and ${p.length-1} other dependencies`:p.length===2?h=" and 1 other dependency":h="",u.provided.range!=="missing:"){let E=t.storedResolutions.get(u.provided.descriptorHash);if(!E)throw new Error("Assertion failed: Expected the resolution to have been registered");let w=t.storedPackages.get(E);if(!w)throw new Error("Assertion failed: Expected the provided package to have been registered");let D=`${pe.pretty(t.configuration,u.hash,pe.Type.CODE)} \u2192 ${A?a.Cross:a.Check} ${G.prettyLocator(t.configuration,u.subject)} provides ${G.prettyLocator(t.configuration,w)} to ${G.prettyLocator(t.configuration,p[0].requester)}${h}`;A?o.reportWarning(0,D):o.reportInfo(0,D)}else{let E=`${pe.pretty(t.configuration,u.hash,pe.Type.CODE)} \u2192 ${A?a.Cross:a.Check} ${G.prettyLocator(t.configuration,u.subject)} doesn't provide ${G.prettyIdent(t.configuration,u.ident)} to ${G.prettyLocator(t.configuration,p[0].requester)}${h}`;A?o.reportWarning(0,E):o.reportInfo(0,E)}}})).exitCode()}Ke();Gt();il();Ke();Ke();Pt();Gt();var Ude=et(ni()),PE=class extends ut{constructor(){super(...arguments);this.useYarnPath=de.Boolean("--yarn-path",{description:"Set the yarnPath setting even if the version can be accessed by Corepack"});this.onlyIfNeeded=de.Boolean("--only-if-needed",!1,{description:"Only lock the Yarn version if it isn't already locked"});this.version=de.String()}static{this.paths=[["set","version"]]}static{this.usage=st.Usage({description:"lock the Yarn version used by the project",details:"\n This command will set a specific release of Yarn to be used by Corepack: https://nodejs.org/api/corepack.html.\n\n By default it only will set the `packageManager` field at the root of your project, but if the referenced release cannot be represented this way, if you already have `yarnPath` configured, or if you set the `--yarn-path` command line flag, then the release will also be downloaded from the Yarn GitHub repository, stored inside your project, and referenced via the `yarnPath` settings from your project `.yarnrc.yml` file.\n\n A very good use case for this command is to enforce the version of Yarn used by any single member of your team inside the same project - by doing this you ensure that you have control over Yarn upgrades and downgrades (including on your deployment servers), and get rid of most of the headaches related to someone using a slightly different version and getting different behavior.\n\n The version specifier can be:\n\n - a tag:\n - `latest` / `berry` / `stable` -> the most recent stable berry (`>=2.0.0`) release\n - `canary` -> the most recent canary (release candidate) berry (`>=2.0.0`) release\n - `classic` -> the most recent classic (`^0.x || ^1.x`) release\n\n - a semver range (e.g. `2.x`) -> the most recent version satisfying the range (limited to berry releases)\n\n - a semver version (e.g. `2.4.1`, `1.22.1`)\n\n - a local file referenced through either a relative or absolute path\n\n - `self` -> the version used to invoke the command\n ",examples:[["Download the latest release from the Yarn repository","$0 set version latest"],["Download the latest canary release from the Yarn repository","$0 set version canary"],["Download the latest classic release from the Yarn repository","$0 set version classic"],["Download the most recent Yarn 3 build","$0 set version 3.x"],["Download a specific Yarn 2 build","$0 set version 2.0.0-rc.30"],["Switch back to a specific Yarn 1 release","$0 set version 1.22.1"],["Use a release from the local filesystem","$0 set version ./yarn.cjs"],["Use a release from a URL","$0 set version https://repo.yarnpkg.com/3.1.0/packages/yarnpkg-cli/bin/yarn.js"],["Download the version used to invoke the command","$0 set version self"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins);if(this.onlyIfNeeded&&r.get("yarnPath")){let A=r.sources.get("yarnPath");if(!A)throw new Error("Assertion failed: Expected 'yarnPath' to have a source");let p=r.projectCwd??r.startingCwd;if(K.contains(p,A))return 0}let o=()=>{if(typeof nn>"u")throw new ot("The --install flag can only be used without explicit version specifier from the Yarn CLI");return`file://${process.argv[1]}`},a,n=(A,p)=>({version:p,url:A.replace(/\{\}/g,p)});if(this.version==="self")a={url:o(),version:nn??"self"};else if(this.version==="latest"||this.version==="berry"||this.version==="stable")a=n("https://repo.yarnpkg.com/{}/packages/yarnpkg-cli/bin/yarn.js",await O2(r,"stable"));else if(this.version==="canary")a=n("https://repo.yarnpkg.com/{}/packages/yarnpkg-cli/bin/yarn.js",await O2(r,"canary"));else if(this.version==="classic")a={url:"https://classic.yarnpkg.com/latest.js",version:"classic"};else if(this.version.match(/^https?:/))a={url:this.version,version:"remote"};else if(this.version.match(/^\.{0,2}[\\/]/)||Ae.isAbsolute(this.version))a={url:`file://${K.resolve(Ae.toPortablePath(this.version))}`,version:"file"};else if(Ur.satisfiesWithPrereleases(this.version,">=2.0.0"))a=n("https://repo.yarnpkg.com/{}/packages/yarnpkg-cli/bin/yarn.js",this.version);else if(Ur.satisfiesWithPrereleases(this.version,"^0.x || ^1.x"))a=n("https://github.com/yarnpkg/yarn/releases/download/v{}/yarn-{}.js",this.version);else if(Ur.validRange(this.version))a=n("https://repo.yarnpkg.com/{}/packages/yarnpkg-cli/bin/yarn.js",await N0t(r,this.version));else throw new ot(`Invalid version descriptor "${this.version}"`);return(await Lt.start({configuration:r,stdout:this.context.stdout,includeLogs:!this.context.quiet},async A=>{let p=async()=>{let h="file://";return a.url.startsWith(h)?(A.reportInfo(0,`Retrieving ${pe.pretty(r,a.url,pe.Type.PATH)}`),await ae.readFilePromise(a.url.slice(h.length))):(A.reportInfo(0,`Downloading ${pe.pretty(r,a.url,pe.Type.URL)}`),await on.get(a.url,{configuration:r}))};await IH(r,a.version,p,{report:A,useYarnPath:this.useYarnPath})})).exitCode()}};async function N0t(t,e){let o=(await on.get("https://repo.yarnpkg.com/tags",{configuration:t,jsonResponse:!0})).tags.filter(a=>Ur.satisfiesWithPrereleases(a,e));if(o.length===0)throw new ot(`No matching release found for range ${pe.pretty(t,e,pe.Type.RANGE)}.`);return o[0]}async function O2(t,e){let r=await on.get("https://repo.yarnpkg.com/tags",{configuration:t,jsonResponse:!0});if(!r.latest[e])throw new ot(`Tag ${pe.pretty(t,e,pe.Type.RANGE)} not found`);return r.latest[e]}async function IH(t,e,r,{report:o,useYarnPath:a}){let n,u=async()=>(typeof n>"u"&&(n=await r()),n);if(e===null){let te=await u();await ae.mktempPromise(async le=>{let ce=K.join(le,"yarn.cjs");await ae.writeFilePromise(ce,te);let{stdout:ue}=await Hr.execvp(process.execPath,[Ae.fromPortablePath(ce),"--version"],{cwd:le,env:{...t.env,YARN_IGNORE_PATH:"1"}});if(e=ue.trim(),!Ude.default.valid(e))throw new Error(`Invalid semver version. ${pe.pretty(t,"yarn --version",pe.Type.CODE)} returned: ${e}`)})}let A=t.projectCwd??t.startingCwd,p=K.resolve(A,".yarn/releases"),h=K.resolve(p,`yarn-${e}.cjs`),E=K.relative(t.startingCwd,h),w=qe.isTaggedYarnVersion(e),D=t.get("yarnPath"),b=!w,C=b||!!D||!!a;if(a===!1){if(b)throw new zt(0,"You explicitly opted out of yarnPath usage in your command line, but the version you specified cannot be represented by Corepack");C=!1}else!C&&!process.env.COREPACK_ROOT&&(o.reportWarning(0,`You don't seem to have ${pe.applyHyperlink(t,"Corepack","https://nodejs.org/api/corepack.html")} enabled; we'll have to rely on ${pe.applyHyperlink(t,"yarnPath","https://yarnpkg.com/configuration/yarnrc#yarnPath")} instead`),C=!0);if(C){let te=await u();o.reportInfo(0,`Saving the new release in ${pe.pretty(t,E,"magenta")}`),await ae.removePromise(K.dirname(h)),await ae.mkdirPromise(K.dirname(h),{recursive:!0}),await ae.writeFilePromise(h,te,{mode:493}),await Je.updateConfiguration(A,{yarnPath:K.relative(A,h)})}else await ae.removePromise(K.dirname(h)),await Je.updateConfiguration(A,{yarnPath:Je.deleteProperty});let T=await _t.tryFind(A)||new _t;T.packageManager=`yarn@${w?e:await O2(t,"stable")}`;let N={};T.exportTo(N);let U=K.join(A,_t.fileName),z=`${JSON.stringify(N,null,T.indent)} `;return await ae.changeFilePromise(U,z,{automaticNewlines:!0}),{bundleVersion:e}}function _de(t){return vr[qP(t)]}var O0t=/## (?YN[0-9]{4}) - `(?[A-Z_]+)`\n\n(?
(?:.(?!##))+)/gs;async function M0t(t){let r=`https://repo.yarnpkg.com/${qe.isTaggedYarnVersion(nn)?nn:await O2(t,"canary")}/packages/docusaurus/docs/advanced/01-general-reference/error-codes.mdx`,o=await on.get(r,{configuration:t});return new Map(Array.from(o.toString().matchAll(O0t),({groups:a})=>{if(!a)throw new Error("Assertion failed: Expected the match to have been successful");let n=_de(a.code);if(a.name!==n)throw new Error(`Assertion failed: Invalid error code data: Expected "${a.name}" to be named "${n}"`);return[a.code,a.details]}))}var SE=class extends ut{constructor(){super(...arguments);this.code=de.String({required:!1,validator:vw(Sm(),[Bw(/^YN[0-9]{4}$/)])});this.json=de.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}static{this.paths=[["explain"]]}static{this.usage=st.Usage({description:"explain an error code",details:` When the code argument is specified, this command prints its name and its details. When used without arguments, this command lists all error codes and their names. `,examples:[["Explain an error code","$0 explain YN0006"],["List all error codes","$0 explain"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins);if(typeof this.code<"u"){let o=_de(this.code),a=pe.pretty(r,o,pe.Type.CODE),n=this.cli.format().header(`${this.code} - ${a}`),A=(await M0t(r)).get(this.code),p=typeof A<"u"?pe.jsonOrPretty(this.json,r,pe.tuple(pe.Type.MARKDOWN,{text:A,format:this.cli.format(),paragraphs:!0})):`This error code does not have a description. You can help us by editing this page on GitHub \u{1F642}: ${pe.jsonOrPretty(this.json,r,pe.tuple(pe.Type.URL,"https://github.com/yarnpkg/berry/blob/master/packages/docusaurus/docs/advanced/01-general-reference/error-codes.mdx"))} `;this.json?this.context.stdout.write(`${JSON.stringify({code:this.code,name:o,details:p})} `):this.context.stdout.write(`${n} ${p} `)}else{let o={children:qe.mapAndFilter(Object.entries(vr),([a,n])=>Number.isNaN(Number(a))?qe.mapAndFilter.skip:{label:zu(Number(a)),value:pe.tuple(pe.Type.CODE,n)})};As.emitTree(o,{configuration:r,stdout:this.context.stdout,json:this.json})}}};Ke();Pt();Gt();var Hde=et(Xo()),xE=class extends ut{constructor(){super(...arguments);this.all=de.Boolean("-A,--all",!1,{description:"Print versions of a package from the whole project"});this.recursive=de.Boolean("-R,--recursive",!1,{description:"Print information for all packages, including transitive dependencies"});this.extra=de.Array("-X,--extra",[],{description:"An array of requests of extra data provided by plugins"});this.cache=de.Boolean("--cache",!1,{description:"Print information about the cache entry of a package (path, size, checksum)"});this.dependents=de.Boolean("--dependents",!1,{description:"Print all dependents for each matching package"});this.manifest=de.Boolean("--manifest",!1,{description:"Print data obtained by looking at the package archive (license, homepage, ...)"});this.nameOnly=de.Boolean("--name-only",!1,{description:"Only print the name for the matching packages"});this.virtuals=de.Boolean("--virtuals",!1,{description:"Print each instance of the virtual packages"});this.json=de.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.patterns=de.Rest()}static{this.paths=[["info"]]}static{this.usage=st.Usage({description:"see information related to packages",details:"\n This command prints various information related to the specified packages, accepting glob patterns.\n\n By default, if the locator reference is missing, Yarn will default to print the information about all the matching direct dependencies of the package for the active workspace. To instead print all versions of the package that are direct dependencies of any of your workspaces, use the `-A,--all` flag. Adding the `-R,--recursive` flag will also report transitive dependencies.\n\n Some fields will be hidden by default in order to keep the output readable, but can be selectively displayed by using additional options (`--dependents`, `--manifest`, `--virtuals`, ...) described in the option descriptions.\n\n Note that this command will only print the information directly related to the selected packages - if you wish to know why the package is there in the first place, use `yarn why` which will do just that (it also provides a `-R,--recursive` flag that may be of some help).\n ",examples:[["Show information about Lodash","$0 info lodash"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:o,workspace:a}=await Qt.find(r,this.context.cwd),n=await Wr.find(r);if(!a&&!this.all)throw new or(o.cwd,this.context.cwd);await o.restoreInstallState();let u=new Set(this.extra);this.cache&&u.add("cache"),this.dependents&&u.add("dependents"),this.manifest&&u.add("manifest");let A=(le,{recursive:ce})=>{let ue=le.anchoredLocator.locatorHash,Ie=new Map,he=[ue];for(;he.length>0;){let De=he.shift();if(Ie.has(De))continue;let Ee=o.storedPackages.get(De);if(typeof Ee>"u")throw new Error("Assertion failed: Expected the package to be registered");if(Ie.set(De,Ee),G.isVirtualLocator(Ee)&&he.push(G.devirtualizeLocator(Ee).locatorHash),!(!ce&&De!==ue))for(let g of Ee.dependencies.values()){let me=o.storedResolutions.get(g.descriptorHash);if(typeof me>"u")throw new Error("Assertion failed: Expected the resolution to be registered");he.push(me)}}return Ie.values()},p=({recursive:le})=>{let ce=new Map;for(let ue of o.workspaces)for(let Ie of A(ue,{recursive:le}))ce.set(Ie.locatorHash,Ie);return ce.values()},h=({all:le,recursive:ce})=>le&&ce?o.storedPackages.values():le?p({recursive:ce}):A(a,{recursive:ce}),E=({all:le,recursive:ce})=>{let ue=h({all:le,recursive:ce}),Ie=this.patterns.map(Ee=>{let g=G.parseLocator(Ee),me=Hde.default.makeRe(G.stringifyIdent(g)),Ce=G.isVirtualLocator(g),fe=Ce?G.devirtualizeLocator(g):g;return ie=>{let Z=G.stringifyIdent(ie);if(!me.test(Z))return!1;if(g.reference==="unknown")return!0;let Pe=G.isVirtualLocator(ie),Re=Pe?G.devirtualizeLocator(ie):ie;return!(Ce&&Pe&&g.reference!==ie.reference||fe.reference!==Re.reference)}}),he=qe.sortMap([...ue],Ee=>G.stringifyLocator(Ee));return{selection:he.filter(Ee=>Ie.length===0||Ie.some(g=>g(Ee))),sortedLookup:he}},{selection:w,sortedLookup:D}=E({all:this.all,recursive:this.recursive});if(w.length===0)throw new ot("No package matched your request");let b=new Map;if(this.dependents)for(let le of D)for(let ce of le.dependencies.values()){let ue=o.storedResolutions.get(ce.descriptorHash);if(typeof ue>"u")throw new Error("Assertion failed: Expected the resolution to be registered");qe.getArrayWithDefault(b,ue).push(le)}let C=new Map;for(let le of D){if(!G.isVirtualLocator(le))continue;let ce=G.devirtualizeLocator(le);qe.getArrayWithDefault(C,ce.locatorHash).push(le)}let T={},N={children:T},U=r.makeFetcher(),z={project:o,fetcher:U,cache:n,checksums:o.storedChecksums,report:new Ri,cacheOptions:{skipIntegrityCheck:!0}},te=[async(le,ce,ue)=>{if(!ce.has("manifest"))return;let Ie=await U.fetch(le,z),he;try{he=await _t.find(Ie.prefixPath,{baseFs:Ie.packageFs})}finally{Ie.releaseFs?.()}ue("Manifest",{License:pe.tuple(pe.Type.NO_HINT,he.license),Homepage:pe.tuple(pe.Type.URL,he.raw.homepage??null)})},async(le,ce,ue)=>{if(!ce.has("cache"))return;let Ie=o.storedChecksums.get(le.locatorHash)??null,he=n.getLocatorPath(le,Ie),De;if(he!==null)try{De=await ae.statPromise(he)}catch{}let Ee=typeof De<"u"?[De.size,pe.Type.SIZE]:void 0;ue("Cache",{Checksum:pe.tuple(pe.Type.NO_HINT,Ie),Path:pe.tuple(pe.Type.PATH,he),Size:Ee})}];for(let le of w){let ce=G.isVirtualLocator(le);if(!this.virtuals&&ce)continue;let ue={},Ie={value:[le,pe.Type.LOCATOR],children:ue};if(T[G.stringifyLocator(le)]=Ie,this.nameOnly){delete Ie.children;continue}let he=C.get(le.locatorHash);typeof he<"u"&&(ue.Instances={label:"Instances",value:pe.tuple(pe.Type.NUMBER,he.length)}),ue.Version={label:"Version",value:pe.tuple(pe.Type.NO_HINT,le.version)};let De=(g,me)=>{let Ce={};if(ue[g]=Ce,Array.isArray(me))Ce.children=me.map(fe=>({value:fe}));else{let fe={};Ce.children=fe;for(let[ie,Z]of Object.entries(me))typeof Z>"u"||(fe[ie]={label:ie,value:Z})}};if(!ce){for(let g of te)await g(le,u,De);await r.triggerHook(g=>g.fetchPackageInfo,le,u,De)}le.bin.size>0&&!ce&&De("Exported Binaries",[...le.bin.keys()].map(g=>pe.tuple(pe.Type.PATH,g)));let Ee=b.get(le.locatorHash);typeof Ee<"u"&&Ee.length>0&&De("Dependents",Ee.map(g=>pe.tuple(pe.Type.LOCATOR,g))),le.dependencies.size>0&&!ce&&De("Dependencies",[...le.dependencies.values()].map(g=>{let me=o.storedResolutions.get(g.descriptorHash),Ce=typeof me<"u"?o.storedPackages.get(me)??null:null;return pe.tuple(pe.Type.RESOLUTION,{descriptor:g,locator:Ce})})),le.peerDependencies.size>0&&ce&&De("Peer dependencies",[...le.peerDependencies.values()].map(g=>{let me=le.dependencies.get(g.identHash),Ce=typeof me<"u"?o.storedResolutions.get(me.descriptorHash)??null:null,fe=Ce!==null?o.storedPackages.get(Ce)??null:null;return pe.tuple(pe.Type.RESOLUTION,{descriptor:g,locator:fe})}))}As.emitTree(N,{configuration:r,json:this.json,stdout:this.context.stdout,separators:this.nameOnly?0:2})}};Ke();Pt();Ol();var Kk=et(sg());Gt();var wH=et(ni());il();var U0t=[{selector:t=>t===-1,name:"nodeLinker",value:"node-modules"},{selector:t=>t!==-1&&t<8,name:"enableGlobalCache",value:!1},{selector:t=>t!==-1&&t<8,name:"compressionLevel",value:"mixed"}],bE=class extends ut{constructor(){super(...arguments);this.json=de.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.immutable=de.Boolean("--immutable",{description:"Abort with an error exit code if the lockfile was to be modified"});this.immutableCache=de.Boolean("--immutable-cache",{description:"Abort with an error exit code if the cache folder was to be modified"});this.refreshLockfile=de.Boolean("--refresh-lockfile",{description:"Refresh the package metadata stored in the lockfile"});this.checkCache=de.Boolean("--check-cache",{description:"Always refetch the packages and ensure that their checksums are consistent"});this.checkResolutions=de.Boolean("--check-resolutions",{description:"Validates that the package resolutions are coherent"});this.inlineBuilds=de.Boolean("--inline-builds",{description:"Verbosely print the output of the build steps of dependencies"});this.mode=de.String("--mode",{description:"Change what artifacts installs generate",validator:js(yl)});this.cacheFolder=de.String("--cache-folder",{hidden:!0});this.frozenLockfile=de.Boolean("--frozen-lockfile",{hidden:!0});this.ignoreEngines=de.Boolean("--ignore-engines",{hidden:!0});this.nonInteractive=de.Boolean("--non-interactive",{hidden:!0});this.preferOffline=de.Boolean("--prefer-offline",{hidden:!0});this.production=de.Boolean("--production",{hidden:!0});this.registry=de.String("--registry",{hidden:!0});this.silent=de.Boolean("--silent",{hidden:!0});this.networkTimeout=de.String("--network-timeout",{hidden:!0})}static{this.paths=[["install"],st.Default]}static{this.usage=st.Usage({description:"install the project dependencies",details:"\n This command sets up your project if needed. The installation is split into four different steps that each have their own characteristics:\n\n - **Resolution:** First the package manager will resolve your dependencies. The exact way a dependency version is privileged over another isn't standardized outside of the regular semver guarantees. If a package doesn't resolve to what you would expect, check that all dependencies are correctly declared (also check our website for more information: ).\n\n - **Fetch:** Then we download all the dependencies if needed, and make sure that they're all stored within our cache (check the value of `cacheFolder` in `yarn config` to see where the cache files are stored).\n\n - **Link:** Then we send the dependency tree information to internal plugins tasked with writing them on the disk in some form (for example by generating the `.pnp.cjs` file you might know).\n\n - **Build:** Once the dependency tree has been written on the disk, the package manager will now be free to run the build scripts for all packages that might need it, in a topological order compatible with the way they depend on one another. See https://yarnpkg.com/advanced/lifecycle-scripts for detail.\n\n Note that running this command is not part of the recommended workflow. Yarn supports zero-installs, which means that as long as you store your cache and your `.pnp.cjs` file inside your repository, everything will work without requiring any install right after cloning your repository or switching branches.\n\n If the `--immutable` option is set (defaults to true on CI), Yarn will abort with an error exit code if the lockfile was to be modified (other paths can be added using the `immutablePatterns` configuration setting). For backward compatibility we offer an alias under the name of `--frozen-lockfile`, but it will be removed in a later release.\n\n If the `--immutable-cache` option is set, Yarn will abort with an error exit code if the cache folder was to be modified (either because files would be added, or because they'd be removed).\n\n If the `--refresh-lockfile` option is set, Yarn will keep the same resolution for the packages currently in the lockfile but will refresh their metadata. If used together with `--immutable`, it can validate that the lockfile information are consistent. This flag is enabled by default when Yarn detects it runs within a pull request context.\n\n If the `--check-cache` option is set, Yarn will always refetch the packages and will ensure that their checksum matches what's 1/ described in the lockfile 2/ inside the existing cache files (if present). This is recommended as part of your CI workflow if you're both following the Zero-Installs model and accepting PRs from third-parties, as they'd otherwise have the ability to alter the checked-in packages before submitting them.\n\n If the `--inline-builds` option is set, Yarn will verbosely print the output of the build steps of your dependencies (instead of writing them into individual files). This is likely useful mostly for debug purposes only when using Docker-like environments.\n\n If the `--mode=` option is set, Yarn will change which artifacts are generated. The modes currently supported are:\n\n - `skip-build` will not run the build scripts at all. Note that this is different from setting `enableScripts` to false because the latter will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run.\n\n - `update-lockfile` will skip the link step altogether, and only fetch packages that are missing from the lockfile (or that have no associated checksums). This mode is typically used by tools like Renovate or Dependabot to keep a lockfile up-to-date without incurring the full install cost.\n ",examples:[["Install the project","$0 install"],["Validate a project when using Zero-Installs","$0 install --immutable --immutable-cache"],["Validate a project when using Zero-Installs (slightly safer if you accept external PRs)","$0 install --immutable --immutable-cache --check-cache"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins);typeof this.inlineBuilds<"u"&&r.useWithSource("",{enableInlineBuilds:this.inlineBuilds},r.startingCwd,{overwrite:!0});let o=!!process.env.FUNCTION_TARGET||!!process.env.GOOGLE_RUNTIME,a=await Qy({configuration:r,stdout:this.context.stdout},[{option:this.ignoreEngines,message:"The --ignore-engines option is deprecated; engine checking isn't a core feature anymore",error:!Kk.default.VERCEL},{option:this.registry,message:"The --registry option is deprecated; prefer setting npmRegistryServer in your .yarnrc.yml file"},{option:this.preferOffline,message:"The --prefer-offline flag is deprecated; use the --cached flag with 'yarn add' instead",error:!Kk.default.VERCEL},{option:this.production,message:"The --production option is deprecated on 'install'; use 'yarn workspaces focus' instead",error:!0},{option:this.nonInteractive,message:"The --non-interactive option is deprecated",error:!o},{option:this.frozenLockfile,message:"The --frozen-lockfile option is deprecated; use --immutable and/or --immutable-cache instead",callback:()=>this.immutable=this.frozenLockfile},{option:this.cacheFolder,message:"The cache-folder option has been deprecated; use rc settings instead",error:!Kk.default.NETLIFY}]);if(a!==null)return a;let n=this.mode==="update-lockfile";if(n&&(this.immutable||this.immutableCache))throw new ot(`${pe.pretty(r,"--immutable",pe.Type.CODE)} and ${pe.pretty(r,"--immutable-cache",pe.Type.CODE)} cannot be used with ${pe.pretty(r,"--mode=update-lockfile",pe.Type.CODE)}`);let u=(this.immutable??r.get("enableImmutableInstalls"))&&!n,A=this.immutableCache&&!n;if(r.projectCwd!==null){let T=await Lt.start({configuration:r,json:this.json,stdout:this.context.stdout,includeFooter:!1},async N=>{let U=!1;await q0t(r,u)&&(N.reportInfo(48,"Automatically removed core plugins that are now builtins \u{1F44D}"),U=!0),await H0t(r,u)&&(N.reportInfo(48,"Automatically fixed merge conflicts \u{1F44D}"),U=!0),U&&N.reportSeparator()});if(T.hasErrors())return T.exitCode()}if(r.projectCwd!==null){let T=await Lt.start({configuration:r,json:this.json,stdout:this.context.stdout,includeFooter:!1},async N=>{if(Je.telemetry?.isNew)Je.telemetry.commitTips(),N.reportInfo(65,"Yarn will periodically gather anonymous telemetry: https://yarnpkg.com/advanced/telemetry"),N.reportInfo(65,`Run ${pe.pretty(r,"yarn config set --home enableTelemetry 0",pe.Type.CODE)} to disable`),N.reportSeparator();else if(Je.telemetry?.shouldShowTips){let U=await on.get("https://repo.yarnpkg.com/tags",{configuration:r,jsonResponse:!0}).catch(()=>null);if(U!==null){let z=null;if(nn!==null){let le=wH.default.prerelease(nn)?"canary":"stable",ce=U.latest[le];wH.default.gt(ce,nn)&&(z=[le,ce])}if(z)Je.telemetry.commitTips(),N.reportInfo(88,`${pe.applyStyle(r,`A new ${z[0]} version of Yarn is available:`,pe.Style.BOLD)} ${G.prettyReference(r,z[1])}!`),N.reportInfo(88,`Upgrade now by running ${pe.pretty(r,`yarn set version ${z[1]}`,pe.Type.CODE)}`),N.reportSeparator();else{let te=Je.telemetry.selectTip(U.tips);te&&(N.reportInfo(89,pe.pretty(r,te.message,pe.Type.MARKDOWN_INLINE)),te.url&&N.reportInfo(89,`Learn more at ${te.url}`),N.reportSeparator())}}}});if(T.hasErrors())return T.exitCode()}let{project:p,workspace:h}=await Qt.find(r,this.context.cwd),E=p.lockfileLastVersion;if(E!==null){let T=await Lt.start({configuration:r,json:this.json,stdout:this.context.stdout,includeFooter:!1},async N=>{let U={};for(let z of U0t)z.selector(E)&&typeof r.sources.get(z.name)>"u"&&(r.use("",{[z.name]:z.value},p.cwd,{overwrite:!0}),U[z.name]=z.value);Object.keys(U).length>0&&(await Je.updateConfiguration(p.cwd,U),N.reportInfo(87,"Migrated your project to the latest Yarn version \u{1F680}"),N.reportSeparator())});if(T.hasErrors())return T.exitCode()}let w=await Wr.find(r,{immutable:A,check:this.checkCache});if(!h)throw new or(p.cwd,this.context.cwd);await p.restoreInstallState({restoreResolutions:!1});let D=r.get("enableHardenedMode");D&&typeof r.sources.get("enableHardenedMode")>"u"&&await Lt.start({configuration:r,json:this.json,stdout:this.context.stdout,includeFooter:!1},async T=>{T.reportWarning(0,"Yarn detected that the current workflow is executed from a public pull request. For safety the hardened mode has been enabled."),T.reportWarning(0,`It will prevent malicious lockfile manipulations, in exchange for a slower install time. You can opt-out if necessary; check our ${pe.applyHyperlink(r,"documentation","https://yarnpkg.com/features/security#hardened-mode")} for more details.`),T.reportSeparator()}),(this.refreshLockfile??D)&&(p.lockfileNeedsRefresh=!0);let b=this.checkResolutions??D;return(await Lt.start({configuration:r,json:this.json,stdout:this.context.stdout,forceSectionAlignment:!0,includeLogs:!0,includeVersion:!0},async T=>{await p.install({cache:w,report:T,immutable:u,checkResolutions:b,mode:this.mode})})).exitCode()}},_0t="<<<<<<<";async function H0t(t,e){if(!t.projectCwd)return!1;let r=K.join(t.projectCwd,mr.lockfile);if(!await ae.existsPromise(r)||!(await ae.readFilePromise(r,"utf8")).includes(_0t))return!1;if(e)throw new zt(47,"Cannot autofix a lockfile when running an immutable install");let a=await Hr.execvp("git",["rev-parse","MERGE_HEAD","HEAD"],{cwd:t.projectCwd});if(a.code!==0&&(a=await Hr.execvp("git",["rev-parse","REBASE_HEAD","HEAD"],{cwd:t.projectCwd})),a.code!==0&&(a=await Hr.execvp("git",["rev-parse","CHERRY_PICK_HEAD","HEAD"],{cwd:t.projectCwd})),a.code!==0)throw new zt(83,"Git returned an error when trying to find the commits pertaining to the conflict");let n=await Promise.all(a.stdout.trim().split(/\n/).map(async A=>{let p=await Hr.execvp("git",["show",`${A}:./${mr.lockfile}`],{cwd:t.projectCwd});if(p.code!==0)throw new zt(83,`Git returned an error when trying to access the lockfile content in ${A}`);try{return Ki(p.stdout)}catch{throw new zt(46,"A variant of the conflicting lockfile failed to parse")}}));n=n.filter(A=>!!A.__metadata);for(let A of n){if(A.__metadata.version<7)for(let p of Object.keys(A)){if(p==="__metadata")continue;let h=G.parseDescriptor(p,!0),E=t.normalizeDependency(h),w=G.stringifyDescriptor(E);w!==p&&(A[w]=A[p],delete A[p])}for(let p of Object.keys(A)){if(p==="__metadata")continue;let h=A[p].checksum;typeof h=="string"&&h.includes("/")||(A[p].checksum=`${A.__metadata.cacheKey}/${h}`)}}let u=Object.assign({},...n);u.__metadata.version=`${Math.min(...n.map(A=>parseInt(A.__metadata.version??0)))}`,u.__metadata.cacheKey="merged";for(let[A,p]of Object.entries(u))typeof p=="string"&&delete u[A];return await ae.changeFilePromise(r,Pa(u),{automaticNewlines:!0}),!0}async function q0t(t,e){if(!t.projectCwd)return!1;let r=[],o=K.join(t.projectCwd,".yarn/plugins/@yarnpkg");return await Je.updateConfiguration(t.projectCwd,{plugins:n=>{if(!Array.isArray(n))return n;let u=n.filter(A=>{if(!A.path)return!0;let p=K.resolve(t.projectCwd,A.path),h=j1.has(A.spec)&&K.contains(o,p);return h&&r.push(p),!h});return u.length===0?Je.deleteProperty:u.length===n.length?n:u}},{immutable:e})?(await Promise.all(r.map(async n=>{await ae.removePromise(n)})),!0):!1}Ke();Pt();Gt();var kE=class extends ut{constructor(){super(...arguments);this.all=de.Boolean("-A,--all",!1,{description:"Link all workspaces belonging to the target projects to the current one"});this.private=de.Boolean("-p,--private",!1,{description:"Also link private workspaces belonging to the target projects to the current one"});this.relative=de.Boolean("-r,--relative",!1,{description:"Link workspaces using relative paths instead of absolute paths"});this.destinations=de.Rest()}static{this.paths=[["link"]]}static{this.usage=st.Usage({description:"connect the local project to another one",details:"\n This command will set a new `resolutions` field in the project-level manifest and point it to the workspace at the specified location (even if part of another project).\n ",examples:[["Register one or more remote workspaces for use in the current project","$0 link ~/ts-loader ~/jest"],["Register all workspaces from a remote project for use in the current project","$0 link ~/jest --all"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:o,workspace:a}=await Qt.find(r,this.context.cwd),n=await Wr.find(r);if(!a)throw new or(o.cwd,this.context.cwd);await o.restoreInstallState({restoreResolutions:!1});let u=o.topLevelWorkspace,A=[];for(let p of this.destinations){let h=K.resolve(this.context.cwd,Ae.toPortablePath(p)),E=await Je.find(h,this.context.plugins,{useRc:!1,strict:!1}),{project:w,workspace:D}=await Qt.find(E,h);if(o.cwd===w.cwd)throw new ot(`Invalid destination '${p}'; Can't link the project to itself`);if(!D)throw new or(w.cwd,h);if(this.all){let b=!1;for(let C of w.workspaces)C.manifest.name&&(!C.manifest.private||this.private)&&(A.push(C),b=!0);if(!b)throw new ot(`No workspace found to be linked in the target project: ${p}`)}else{if(!D.manifest.name)throw new ot(`The target workspace at '${p}' doesn't have a name and thus cannot be linked`);if(D.manifest.private&&!this.private)throw new ot(`The target workspace at '${p}' is marked private - use the --private flag to link it anyway`);A.push(D)}}for(let p of A){let h=G.stringifyIdent(p.anchoredLocator),E=this.relative?K.relative(o.cwd,p.cwd):p.cwd;u.manifest.resolutions.push({pattern:{descriptor:{fullName:h}},reference:`portal:${E}`})}return await o.installWithNewReport({stdout:this.context.stdout},{cache:n})}};Gt();var QE=class extends ut{constructor(){super(...arguments);this.args=de.Proxy()}static{this.paths=[["node"]]}static{this.usage=st.Usage({description:"run node with the hook already setup",details:` This command simply runs Node. It also makes sure to call it in a way that's compatible with the current project (for example, on PnP projects the environment will be setup in such a way that PnP will be correctly injected into the environment). The Node process will use the exact same version of Node as the one used to run Yarn itself, which might be a good way to ensure that your commands always use a consistent Node version. `,examples:[["Run a Node script","$0 node ./my-script.js"]]})}async execute(){return this.cli.run(["exec","node",...this.args])}};Ke();Gt();var FE=class extends ut{constructor(){super(...arguments);this.json=de.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}static{this.paths=[["plugin","check"]]}static{this.usage=st.Usage({category:"Plugin-related commands",description:"find all third-party plugins that differ from their own spec",details:` Check only the plugins from https. If this command detects any plugin differences in the CI environment, it will throw an error. `,examples:[["find all third-party plugins that differ from their own spec","$0 plugin check"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),o=await Je.findRcFiles(this.context.cwd);return(await Lt.start({configuration:r,json:this.json,stdout:this.context.stdout},async n=>{for(let u of o)if(u.data?.plugins)for(let A of u.data.plugins){if(!A.checksum||!A.spec.match(/^https?:/))continue;let p=await on.get(A.spec,{configuration:r}),h=bn.makeHash(p);if(A.checksum===h)continue;let E=pe.pretty(r,A.path,pe.Type.PATH),w=pe.pretty(r,A.spec,pe.Type.URL),D=`${E} is different from the file provided by ${w}`;n.reportJson({...A,newChecksum:h}),n.reportError(0,D)}})).exitCode()}};Ke();Ke();Pt();Gt();var Yde=ve("os");Ke();Pt();Gt();var qde=ve("os");Ke();Ol();Gt();var j0t="https://raw.githubusercontent.com/yarnpkg/berry/master/plugins.yml";async function zg(t,e){let r=await on.get(j0t,{configuration:t}),o=Ki(r.toString());return Object.fromEntries(Object.entries(o).filter(([a,n])=>!e||Ur.satisfiesWithPrereleases(e,n.range??"<4.0.0-rc.1")))}var RE=class extends ut{constructor(){super(...arguments);this.json=de.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}static{this.paths=[["plugin","list"]]}static{this.usage=st.Usage({category:"Plugin-related commands",description:"list the available official plugins",details:"\n This command prints the plugins available directly from the Yarn repository. Only those plugins can be referenced by name in `yarn plugin import`.\n ",examples:[["List the official plugins","$0 plugin list"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins);return(await Lt.start({configuration:r,json:this.json,stdout:this.context.stdout},async a=>{let n=await zg(r,nn);for(let[u,{experimental:A,...p}]of Object.entries(n)){let h=u;A&&(h+=" [experimental]"),a.reportJson({name:u,experimental:A,...p}),a.reportInfo(null,h)}})).exitCode()}};var G0t=/^[0-9]+$/,W0t=process.platform==="win32";function jde(t){return G0t.test(t)?`pull/${t}/head`:t}var Y0t=({repository:t,branch:e},r)=>[["git","init",Ae.fromPortablePath(r)],["git","remote","add","origin",t],["git","fetch","origin","--depth=1",jde(e)],["git","reset","--hard","FETCH_HEAD"]],K0t=({branch:t})=>[["git","fetch","origin","--depth=1",jde(t),"--force"],["git","reset","--hard","FETCH_HEAD"],["git","clean","-dfx","-e","packages/yarnpkg-cli/bundles"]],V0t=({plugins:t,noMinify:e},r,o)=>[["yarn","build:cli",...new Array().concat(...t.map(a=>["--plugin",K.resolve(o,a)])),...e?["--no-minify"]:[],"|"],[W0t?"move":"mv","packages/yarnpkg-cli/bundles/yarn.js",Ae.fromPortablePath(r),"|"]],TE=class extends ut{constructor(){super(...arguments);this.installPath=de.String("--path",{description:"The path where the repository should be cloned to"});this.repository=de.String("--repository","https://github.com/yarnpkg/berry.git",{description:"The repository that should be cloned"});this.branch=de.String("--branch","master",{description:"The branch of the repository that should be cloned"});this.plugins=de.Array("--plugin",[],{description:"An array of additional plugins that should be included in the bundle"});this.dryRun=de.Boolean("-n,--dry-run",!1,{description:"If set, the bundle will be built but not added to the project"});this.noMinify=de.Boolean("--no-minify",!1,{description:"Build a bundle for development (debugging) - non-minified and non-mangled"});this.force=de.Boolean("-f,--force",!1,{description:"Always clone the repository instead of trying to fetch the latest commits"});this.skipPlugins=de.Boolean("--skip-plugins",!1,{description:"Skip updating the contrib plugins"})}static{this.paths=[["set","version","from","sources"]]}static{this.usage=st.Usage({description:"build Yarn from master",details:` This command will clone the Yarn repository into a temporary folder, then build it. The resulting bundle will then be copied into the local project. By default, it also updates all contrib plugins to the same commit the bundle is built from. This behavior can be disabled by using the \`--skip-plugins\` flag. `,examples:[["Build Yarn from master","$0 set version from sources"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:o}=await Qt.find(r,this.context.cwd),a=typeof this.installPath<"u"?K.resolve(this.context.cwd,Ae.toPortablePath(this.installPath)):K.resolve(Ae.toPortablePath((0,qde.tmpdir)()),"yarnpkg-sources",bn.makeHash(this.repository).slice(0,6));return(await Lt.start({configuration:r,stdout:this.context.stdout},async u=>{await BH(this,{configuration:r,report:u,target:a}),u.reportSeparator(),u.reportInfo(0,"Building a fresh bundle"),u.reportSeparator();let A=await Hr.execvp("git",["rev-parse","--short","HEAD"],{cwd:a,strict:!0}),p=K.join(a,`packages/yarnpkg-cli/bundles/yarn-${A.stdout.trim()}.js`);ae.existsSync(p)||(await M2(V0t(this,p,a),{configuration:r,context:this.context,target:a}),u.reportSeparator());let h=await ae.readFilePromise(p);if(!this.dryRun){let{bundleVersion:E}=await IH(r,null,async()=>h,{report:u});this.skipPlugins||await z0t(this,E,{project:o,report:u,target:a})}})).exitCode()}};async function M2(t,{configuration:e,context:r,target:o}){for(let[a,...n]of t){let u=n[n.length-1]==="|";if(u&&n.pop(),u)await Hr.pipevp(a,n,{cwd:o,stdin:r.stdin,stdout:r.stdout,stderr:r.stderr,strict:!0});else{r.stdout.write(`${pe.pretty(e,` $ ${[a,...n].join(" ")}`,"grey")} `);try{await Hr.execvp(a,n,{cwd:o,strict:!0})}catch(A){throw r.stdout.write(A.stdout||A.stack),A}}}}async function BH(t,{configuration:e,report:r,target:o}){let a=!1;if(!t.force&&ae.existsSync(K.join(o,".git"))){r.reportInfo(0,"Fetching the latest commits"),r.reportSeparator();try{await M2(K0t(t),{configuration:e,context:t.context,target:o}),a=!0}catch{r.reportSeparator(),r.reportWarning(0,"Repository update failed; we'll try to regenerate it")}}a||(r.reportInfo(0,"Cloning the remote repository"),r.reportSeparator(),await ae.removePromise(o),await ae.mkdirPromise(o,{recursive:!0}),await M2(Y0t(t,o),{configuration:e,context:t.context,target:o}))}async function z0t(t,e,{project:r,report:o,target:a}){let n=await zg(r.configuration,e),u=new Set(Object.keys(n));for(let A of r.configuration.plugins.keys())u.has(A)&&await vH(A,t,{project:r,report:o,target:a})}Ke();Ke();Pt();Gt();var Gde=et(ni()),Wde=ve("vm");var LE=class extends ut{constructor(){super(...arguments);this.name=de.String();this.checksum=de.Boolean("--checksum",!0,{description:"Whether to care if this plugin is modified"})}static{this.paths=[["plugin","import"]]}static{this.usage=st.Usage({category:"Plugin-related commands",description:"download a plugin",details:` This command downloads the specified plugin from its remote location and updates the configuration to reference it in further CLI invocations. Three types of plugin references are accepted: - If the plugin is stored within the Yarn repository, it can be referenced by name. - Third-party plugins can be referenced directly through their public urls. - Local plugins can be referenced by their path on the disk. If the \`--no-checksum\` option is set, Yarn will no longer care if the plugin is modified. Plugins cannot be downloaded from the npm registry, and aren't allowed to have dependencies (they need to be bundled into a single file, possibly thanks to the \`@yarnpkg/builder\` package). `,examples:[['Download and activate the "@yarnpkg/plugin-exec" plugin',"$0 plugin import @yarnpkg/plugin-exec"],['Download and activate the "@yarnpkg/plugin-exec" plugin (shorthand)',"$0 plugin import exec"],["Download and activate a community plugin","$0 plugin import https://example.org/path/to/plugin.js"],["Activate a local plugin","$0 plugin import ./path/to/plugin.js"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins);return(await Lt.start({configuration:r,stdout:this.context.stdout},async a=>{let{project:n}=await Qt.find(r,this.context.cwd),u,A;if(this.name.match(/^\.{0,2}[\\/]/)||Ae.isAbsolute(this.name)){let p=K.resolve(this.context.cwd,Ae.toPortablePath(this.name));a.reportInfo(0,`Reading ${pe.pretty(r,p,pe.Type.PATH)}`),u=K.relative(n.cwd,p),A=await ae.readFilePromise(p)}else{let p;if(this.name.match(/^https?:/)){try{new URL(this.name)}catch{throw new zt(52,`Plugin specifier "${this.name}" is neither a plugin name nor a valid url`)}u=this.name,p=this.name}else{let h=G.parseLocator(this.name.replace(/^((@yarnpkg\/)?plugin-)?/,"@yarnpkg/plugin-"));if(h.reference!=="unknown"&&!Gde.default.valid(h.reference))throw new zt(0,"Official plugins only accept strict version references. Use an explicit URL if you wish to download them from another location.");let E=G.stringifyIdent(h),w=await zg(r,nn);if(!Object.hasOwn(w,E)){let D=`Couldn't find a plugin named ${G.prettyIdent(r,h)} on the remote registry. `;throw r.plugins.has(E)?D+=`A plugin named ${G.prettyIdent(r,h)} is already installed; possibly attempting to import a built-in plugin.`:D+=`Note that only the plugins referenced on our website (${pe.pretty(r,"https://github.com/yarnpkg/berry/blob/master/plugins.yml",pe.Type.URL)}) can be referenced by their name; any other plugin will have to be referenced through its public url (for example ${pe.pretty(r,"https://github.com/yarnpkg/berry/raw/master/packages/plugin-typescript/bin/%40yarnpkg/plugin-typescript.js",pe.Type.URL)}).`,new zt(51,D)}u=E,p=w[E].url,h.reference!=="unknown"?p=p.replace(/\/master\//,`/${E}/${h.reference}/`):nn!==null&&(p=p.replace(/\/master\//,`/@yarnpkg/cli/${nn}/`))}a.reportInfo(0,`Downloading ${pe.pretty(r,p,"green")}`),A=await on.get(p,{configuration:r})}await DH(u,A,{checksum:this.checksum,project:n,report:a})})).exitCode()}};async function DH(t,e,{checksum:r=!0,project:o,report:a}){let{configuration:n}=o,u={},A={exports:u};(0,Wde.runInNewContext)(e.toString(),{module:A,exports:u});let h=`.yarn/plugins/${A.exports.name}.cjs`,E=K.resolve(o.cwd,h);a.reportInfo(0,`Saving the new plugin in ${pe.pretty(n,h,"magenta")}`),await ae.mkdirPromise(K.dirname(E),{recursive:!0}),await ae.writeFilePromise(E,e);let w={path:h,spec:t};r&&(w.checksum=bn.makeHash(e)),await Je.addPlugin(o.cwd,[w])}var J0t=({pluginName:t,noMinify:e},r)=>[["yarn",`build:${t}`,...e?["--no-minify"]:[],"|"]],NE=class extends ut{constructor(){super(...arguments);this.installPath=de.String("--path",{description:"The path where the repository should be cloned to"});this.repository=de.String("--repository","https://github.com/yarnpkg/berry.git",{description:"The repository that should be cloned"});this.branch=de.String("--branch","master",{description:"The branch of the repository that should be cloned"});this.noMinify=de.Boolean("--no-minify",!1,{description:"Build a plugin for development (debugging) - non-minified and non-mangled"});this.force=de.Boolean("-f,--force",!1,{description:"Always clone the repository instead of trying to fetch the latest commits"});this.name=de.String()}static{this.paths=[["plugin","import","from","sources"]]}static{this.usage=st.Usage({category:"Plugin-related commands",description:"build a plugin from sources",details:` This command clones the Yarn repository into a temporary folder, builds the specified contrib plugin and updates the configuration to reference it in further CLI invocations. The plugins can be referenced by their short name if sourced from the official Yarn repository. `,examples:[['Build and activate the "@yarnpkg/plugin-exec" plugin',"$0 plugin import from sources @yarnpkg/plugin-exec"],['Build and activate the "@yarnpkg/plugin-exec" plugin (shorthand)',"$0 plugin import from sources exec"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),o=typeof this.installPath<"u"?K.resolve(this.context.cwd,Ae.toPortablePath(this.installPath)):K.resolve(Ae.toPortablePath((0,Yde.tmpdir)()),"yarnpkg-sources",bn.makeHash(this.repository).slice(0,6));return(await Lt.start({configuration:r,stdout:this.context.stdout},async n=>{let{project:u}=await Qt.find(r,this.context.cwd),A=G.parseIdent(this.name.replace(/^((@yarnpkg\/)?plugin-)?/,"@yarnpkg/plugin-")),p=G.stringifyIdent(A),h=await zg(r,nn);if(!Object.hasOwn(h,p))throw new zt(51,`Couldn't find a plugin named "${p}" on the remote registry. Note that only the plugins referenced on our website (https://github.com/yarnpkg/berry/blob/master/plugins.yml) can be built and imported from sources.`);let E=p;await BH(this,{configuration:r,report:n,target:o}),await vH(E,this,{project:u,report:n,target:o})})).exitCode()}};async function vH(t,{context:e,noMinify:r},{project:o,report:a,target:n}){let u=t.replace(/@yarnpkg\//,""),{configuration:A}=o;a.reportSeparator(),a.reportInfo(0,`Building a fresh ${u}`),a.reportSeparator(),await M2(J0t({pluginName:u,noMinify:r},n),{configuration:A,context:e,target:n}),a.reportSeparator();let p=K.resolve(n,`packages/${u}/bundles/${t}.js`),h=await ae.readFilePromise(p);await DH(t,h,{project:o,report:a})}Ke();Pt();Gt();var OE=class extends ut{constructor(){super(...arguments);this.name=de.String()}static{this.paths=[["plugin","remove"]]}static{this.usage=st.Usage({category:"Plugin-related commands",description:"remove a plugin",details:` This command deletes the specified plugin from the .yarn/plugins folder and removes it from the configuration. **Note:** The plugins have to be referenced by their name property, which can be obtained using the \`yarn plugin runtime\` command. Shorthands are not allowed. `,examples:[["Remove a plugin imported from the Yarn repository","$0 plugin remove @yarnpkg/plugin-typescript"],["Remove a plugin imported from a local file","$0 plugin remove my-local-plugin"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:o}=await Qt.find(r,this.context.cwd);return(await Lt.start({configuration:r,stdout:this.context.stdout},async n=>{let u=this.name,A=G.parseIdent(u);if(!r.plugins.has(u))throw new ot(`${G.prettyIdent(r,A)} isn't referenced by the current configuration`);let p=`.yarn/plugins/${u}.cjs`,h=K.resolve(o.cwd,p);ae.existsSync(h)&&(n.reportInfo(0,`Removing ${pe.pretty(r,p,pe.Type.PATH)}...`),await ae.removePromise(h)),n.reportInfo(0,"Updating the configuration..."),await Je.updateConfiguration(o.cwd,{plugins:E=>{if(!Array.isArray(E))return E;let w=E.filter(D=>D.path!==p);return w.length===0?Je.deleteProperty:w.length===E.length?E:w}})})).exitCode()}};Ke();Gt();var ME=class extends ut{constructor(){super(...arguments);this.json=de.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}static{this.paths=[["plugin","runtime"]]}static{this.usage=st.Usage({category:"Plugin-related commands",description:"list the active plugins",details:` This command prints the currently active plugins. Will be displayed both builtin plugins and external plugins. `,examples:[["List the currently active plugins","$0 plugin runtime"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins);return(await Lt.start({configuration:r,json:this.json,stdout:this.context.stdout},async a=>{for(let n of r.plugins.keys()){let u=this.context.plugins.plugins.has(n),A=n;u&&(A+=" [builtin]"),a.reportJson({name:n,builtin:u}),a.reportInfo(null,`${A}`)}})).exitCode()}};Ke();Ke();Gt();var UE=class extends ut{constructor(){super(...arguments);this.idents=de.Rest()}static{this.paths=[["rebuild"]]}static{this.usage=st.Usage({description:"rebuild the project's native packages",details:` This command will automatically cause Yarn to forget about previous compilations of the given packages and to run them again. Note that while Yarn forgets the compilation, the previous artifacts aren't erased from the filesystem and may affect the next builds (in good or bad). To avoid this, you may remove the .yarn/unplugged folder, or any other relevant location where packages might have been stored (Yarn may offer a way to do that automatically in the future). By default all packages will be rebuilt, but you can filter the list by specifying the names of the packages you want to clear from memory. `,examples:[["Rebuild all packages","$0 rebuild"],["Rebuild fsevents only","$0 rebuild fsevents"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:o,workspace:a}=await Qt.find(r,this.context.cwd),n=await Wr.find(r);if(!a)throw new or(o.cwd,this.context.cwd);let u=new Set;for(let A of this.idents)u.add(G.parseIdent(A).identHash);if(await o.restoreInstallState({restoreResolutions:!1}),await o.resolveEverything({cache:n,report:new Ri}),u.size>0)for(let A of o.storedPackages.values())u.has(A.identHash)&&(o.storedBuildState.delete(A.locatorHash),o.skippedBuilds.delete(A.locatorHash));else o.storedBuildState.clear(),o.skippedBuilds.clear();return await o.installWithNewReport({stdout:this.context.stdout,quiet:this.context.quiet},{cache:n})}};Ke();Ke();Ke();Gt();var PH=et(Xo());il();var _E=class extends ut{constructor(){super(...arguments);this.all=de.Boolean("-A,--all",!1,{description:"Apply the operation to all workspaces from the current project"});this.mode=de.String("--mode",{description:"Change what artifacts installs generate",validator:js(yl)});this.patterns=de.Rest()}static{this.paths=[["remove"]]}static{this.usage=st.Usage({description:"remove dependencies from the project",details:` This command will remove the packages matching the specified patterns from the current workspace. If the \`--mode=\` option is set, Yarn will change which artifacts are generated. The modes currently supported are: - \`skip-build\` will not run the build scripts at all. Note that this is different from setting \`enableScripts\` to false because the latter will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run. - \`update-lockfile\` will skip the link step altogether, and only fetch packages that are missing from the lockfile (or that have no associated checksums). This mode is typically used by tools like Renovate or Dependabot to keep a lockfile up-to-date without incurring the full install cost. This command accepts glob patterns as arguments (if valid Idents and supported by [micromatch](https://github.com/micromatch/micromatch)). Make sure to escape the patterns, to prevent your own shell from trying to expand them. `,examples:[["Remove a dependency from the current project","$0 remove lodash"],["Remove a dependency from all workspaces at once","$0 remove lodash --all"],["Remove all dependencies starting with `eslint-`","$0 remove 'eslint-*'"],["Remove all dependencies with the `@babel` scope","$0 remove '@babel/*'"],["Remove all dependencies matching `react-dom` or `react-helmet`","$0 remove 'react-{dom,helmet}'"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:o,workspace:a}=await Qt.find(r,this.context.cwd),n=await Wr.find(r);if(!a)throw new or(o.cwd,this.context.cwd);await o.restoreInstallState({restoreResolutions:!1});let u=this.all?o.workspaces:[a],A=["dependencies","devDependencies","peerDependencies"],p=[],h=!1,E=[];for(let C of this.patterns){let T=!1,N=G.parseIdent(C);for(let U of u){let z=[...U.manifest.peerDependenciesMeta.keys()];for(let te of(0,PH.default)(z,C))U.manifest.peerDependenciesMeta.delete(te),h=!0,T=!0;for(let te of A){let le=U.manifest.getForScope(te),ce=[...le.values()].map(ue=>G.stringifyIdent(ue));for(let ue of(0,PH.default)(ce,G.stringifyIdent(N))){let{identHash:Ie}=G.parseIdent(ue),he=le.get(Ie);if(typeof he>"u")throw new Error("Assertion failed: Expected the descriptor to be registered");U.manifest[te].delete(Ie),E.push([U,te,he]),h=!0,T=!0}}}T||p.push(C)}let w=p.length>1?"Patterns":"Pattern",D=p.length>1?"don't":"doesn't",b=this.all?"any":"this";if(p.length>0)throw new ot(`${w} ${pe.prettyList(r,p,pe.Type.CODE)} ${D} match any packages referenced by ${b} workspace`);return h?(await r.triggerMultipleHooks(C=>C.afterWorkspaceDependencyRemoval,E),await o.installWithNewReport({stdout:this.context.stdout},{cache:n,mode:this.mode})):0}};Ke();Ke();Gt();var Kde=ve("util"),HE=class extends ut{constructor(){super(...arguments);this.json=de.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}static{this.paths=[["run"]]}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:o,workspace:a}=await Qt.find(r,this.context.cwd);if(!a)throw new or(o.cwd,this.context.cwd);return(await Lt.start({configuration:r,stdout:this.context.stdout,json:this.json},async u=>{let A=a.manifest.scripts,p=qe.sortMap(A.keys(),w=>w),h={breakLength:1/0,colors:r.get("enableColors"),maxArrayLength:2},E=p.reduce((w,D)=>Math.max(w,D.length),0);for(let[w,D]of A.entries())u.reportInfo(null,`${w.padEnd(E," ")} ${(0,Kde.inspect)(D,h)}`),u.reportJson({name:w,script:D})})).exitCode()}};Ke();Ke();Gt();var qE=class extends ut{constructor(){super(...arguments);this.inspect=de.String("--inspect",!1,{tolerateBoolean:!0,description:"Forwarded to the underlying Node process when executing a binary"});this.inspectBrk=de.String("--inspect-brk",!1,{tolerateBoolean:!0,description:"Forwarded to the underlying Node process when executing a binary"});this.topLevel=de.Boolean("-T,--top-level",!1,{description:"Check the root workspace for scripts and/or binaries instead of the current one"});this.binariesOnly=de.Boolean("-B,--binaries-only",!1,{description:"Ignore any user defined scripts and only check for binaries"});this.require=de.String("--require",{description:"Forwarded to the underlying Node process when executing a binary"});this.silent=de.Boolean("--silent",{hidden:!0});this.scriptName=de.String();this.args=de.Proxy()}static{this.paths=[["run"]]}static{this.usage=st.Usage({description:"run a script defined in the package.json",details:` This command will run a tool. The exact tool that will be executed will depend on the current state of your workspace: - If the \`scripts\` field from your local package.json contains a matching script name, its definition will get executed. - Otherwise, if one of the local workspace's dependencies exposes a binary with a matching name, this binary will get executed. - Otherwise, if the specified name contains a colon character and if one of the workspaces in the project contains exactly one script with a matching name, then this script will get executed. Whatever happens, the cwd of the spawned process will be the workspace that declares the script (which makes it possible to call commands cross-workspaces using the third syntax). `,examples:[["Run the tests from the local workspace","$0 run test"],['Same thing, but without the "run" keyword',"$0 test"],["Inspect Webpack while running","$0 run --inspect-brk webpack"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:o,workspace:a,locator:n}=await Qt.find(r,this.context.cwd);await o.restoreInstallState();let u=this.topLevel?o.topLevelWorkspace.anchoredLocator:n;if(!this.binariesOnly&&await hn.hasPackageScript(u,this.scriptName,{project:o}))return await hn.executePackageScript(u,this.scriptName,this.args,{project:o,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr});let A=await hn.getPackageAccessibleBinaries(u,{project:o});if(A.get(this.scriptName)){let h=[];return this.inspect&&(typeof this.inspect=="string"?h.push(`--inspect=${this.inspect}`):h.push("--inspect")),this.inspectBrk&&(typeof this.inspectBrk=="string"?h.push(`--inspect-brk=${this.inspectBrk}`):h.push("--inspect-brk")),this.require&&h.push(`--require=${this.require}`),await hn.executePackageAccessibleBinary(u,this.scriptName,this.args,{cwd:this.context.cwd,project:o,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr,nodeArgs:h,packageAccessibleBinaries:A})}if(!this.topLevel&&!this.binariesOnly&&a&&this.scriptName.includes(":")){let E=(await Promise.all(o.workspaces.map(async w=>w.manifest.scripts.has(this.scriptName)?w:null))).filter(w=>w!==null);if(E.length===1)return await hn.executeWorkspaceScript(E[0],this.scriptName,this.args,{stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr})}if(this.topLevel)throw this.scriptName==="node-gyp"?new ot(`Couldn't find a script name "${this.scriptName}" in the top-level (used by ${G.prettyLocator(r,n)}). This typically happens because some package depends on "node-gyp" to build itself, but didn't list it in their dependencies. To fix that, please run "yarn add node-gyp" into your top-level workspace. You also can open an issue on the repository of the specified package to suggest them to use an optional peer dependency.`):new ot(`Couldn't find a script name "${this.scriptName}" in the top-level (used by ${G.prettyLocator(r,n)}).`);{if(this.scriptName==="global")throw new ot("The 'yarn global' commands have been removed in 2.x - consider using 'yarn dlx' or a third-party plugin instead");let h=[this.scriptName].concat(this.args);for(let[E,w]of oE)for(let D of w)if(h.length>=D.length&&JSON.stringify(h.slice(0,D.length))===JSON.stringify(D))throw new ot(`Couldn't find a script named "${this.scriptName}", but a matching command can be found in the ${E} plugin. You can install it with "yarn plugin import ${E}".`);throw new ot(`Couldn't find a script named "${this.scriptName}".`)}}};Ke();Ke();Gt();var jE=class extends ut{constructor(){super(...arguments);this.descriptor=de.String();this.resolution=de.String()}static{this.paths=[["set","resolution"]]}static{this.usage=st.Usage({description:"enforce a package resolution",details:'\n This command updates the resolution table so that `descriptor` is resolved by `resolution`.\n\n Note that by default this command only affect the current resolution table - meaning that this "manual override" will disappear if you remove the lockfile, or if the package disappear from the table. If you wish to make the enforced resolution persist whatever happens, edit the `resolutions` field in your top-level manifest.\n\n Note that no attempt is made at validating that `resolution` is a valid resolution entry for `descriptor`.\n ',examples:[["Force all instances of lodash@npm:^1.2.3 to resolve to 1.5.0","$0 set resolution lodash@npm:^1.2.3 1.5.0"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:o,workspace:a}=await Qt.find(r,this.context.cwd),n=await Wr.find(r);if(await o.restoreInstallState({restoreResolutions:!1}),!a)throw new or(o.cwd,this.context.cwd);let u=G.parseDescriptor(this.descriptor,!0),A=G.makeDescriptor(u,this.resolution);return o.storedDescriptors.set(u.descriptorHash,u),o.storedDescriptors.set(A.descriptorHash,A),o.resolutionAliases.set(u.descriptorHash,A.descriptorHash),await o.installWithNewReport({stdout:this.context.stdout},{cache:n})}};Ke();Pt();Gt();var Vde=et(Xo()),GE=class extends ut{constructor(){super(...arguments);this.all=de.Boolean("-A,--all",!1,{description:"Unlink all workspaces belonging to the target project from the current one"});this.leadingArguments=de.Rest()}static{this.paths=[["unlink"]]}static{this.usage=st.Usage({description:"disconnect the local project from another one",details:` This command will remove any resolutions in the project-level manifest that would have been added via a yarn link with similar arguments. `,examples:[["Unregister a remote workspace in the current project","$0 unlink ~/ts-loader"],["Unregister all workspaces from a remote project in the current project","$0 unlink ~/jest --all"],["Unregister all previously linked workspaces","$0 unlink --all"],["Unregister all workspaces matching a glob","$0 unlink '@babel/*' 'pkg-{a,b}'"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:o,workspace:a}=await Qt.find(r,this.context.cwd),n=await Wr.find(r);if(!a)throw new or(o.cwd,this.context.cwd);let u=o.topLevelWorkspace,A=new Set;if(this.leadingArguments.length===0&&this.all)for(let{pattern:p,reference:h}of u.manifest.resolutions)h.startsWith("portal:")&&A.add(p.descriptor.fullName);if(this.leadingArguments.length>0)for(let p of this.leadingArguments){let h=K.resolve(this.context.cwd,Ae.toPortablePath(p));if(qe.isPathLike(p)){let E=await Je.find(h,this.context.plugins,{useRc:!1,strict:!1}),{project:w,workspace:D}=await Qt.find(E,h);if(!D)throw new or(w.cwd,h);if(this.all){for(let b of w.workspaces)b.manifest.name&&A.add(G.stringifyIdent(b.anchoredLocator));if(A.size===0)throw new ot("No workspace found to be unlinked in the target project")}else{if(!D.manifest.name)throw new ot("The target workspace doesn't have a name and thus cannot be unlinked");A.add(G.stringifyIdent(D.anchoredLocator))}}else{let E=[...u.manifest.resolutions.map(({pattern:w})=>w.descriptor.fullName)];for(let w of(0,Vde.default)(E,p))A.add(w)}}return u.manifest.resolutions=u.manifest.resolutions.filter(({pattern:p})=>!A.has(p.descriptor.fullName)),await o.installWithNewReport({stdout:this.context.stdout,quiet:this.context.quiet},{cache:n})}};Ke();Ke();Ke();Gt();var zde=et(Q2()),SH=et(Xo());il();var WE=class extends ut{constructor(){super(...arguments);this.interactive=de.Boolean("-i,--interactive",{description:"Offer various choices, depending on the detected upgrade paths"});this.fixed=de.Boolean("-F,--fixed",!1,{description:"Store dependency tags as-is instead of resolving them"});this.exact=de.Boolean("-E,--exact",!1,{description:"Don't use any semver modifier on the resolved range"});this.tilde=de.Boolean("-T,--tilde",!1,{description:"Use the `~` semver modifier on the resolved range"});this.caret=de.Boolean("-C,--caret",!1,{description:"Use the `^` semver modifier on the resolved range"});this.recursive=de.Boolean("-R,--recursive",!1,{description:"Resolve again ALL resolutions for those packages"});this.mode=de.String("--mode",{description:"Change what artifacts installs generate",validator:js(yl)});this.patterns=de.Rest()}static{this.paths=[["up"]]}static{this.usage=st.Usage({description:"upgrade dependencies across the project",details:"\n This command upgrades the packages matching the list of specified patterns to their latest available version across the whole project (regardless of whether they're part of `dependencies` or `devDependencies` - `peerDependencies` won't be affected). This is a project-wide command: all workspaces will be upgraded in the process.\n\n If `-R,--recursive` is set the command will change behavior and no other switch will be allowed. When operating under this mode `yarn up` will force all ranges matching the selected packages to be resolved again (often to the highest available versions) before being stored in the lockfile. It however won't touch your manifests anymore, so depending on your needs you might want to run both `yarn up` and `yarn up -R` to cover all bases.\n\n If `-i,--interactive` is set (or if the `preferInteractive` settings is toggled on) the command will offer various choices, depending on the detected upgrade paths. Some upgrades require this flag in order to resolve ambiguities.\n\n The, `-C,--caret`, `-E,--exact` and `-T,--tilde` options have the same meaning as in the `add` command (they change the modifier used when the range is missing or a tag, and are ignored when the range is explicitly set).\n\n If the `--mode=` option is set, Yarn will change which artifacts are generated. The modes currently supported are:\n\n - `skip-build` will not run the build scripts at all. Note that this is different from setting `enableScripts` to false because the latter will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run.\n\n - `update-lockfile` will skip the link step altogether, and only fetch packages that are missing from the lockfile (or that have no associated checksums). This mode is typically used by tools like Renovate or Dependabot to keep a lockfile up-to-date without incurring the full install cost.\n\n Generally you can see `yarn up` as a counterpart to what was `yarn upgrade --latest` in Yarn 1 (ie it ignores the ranges previously listed in your manifests), but unlike `yarn upgrade` which only upgraded dependencies in the current workspace, `yarn up` will upgrade all workspaces at the same time.\n\n This command accepts glob patterns as arguments (if valid Descriptors and supported by [micromatch](https://github.com/micromatch/micromatch)). Make sure to escape the patterns, to prevent your own shell from trying to expand them.\n\n **Note:** The ranges have to be static, only the package scopes and names can contain glob patterns.\n ",examples:[["Upgrade all instances of lodash to the latest release","$0 up lodash"],["Upgrade all instances of lodash to the latest release, but ask confirmation for each","$0 up lodash -i"],["Upgrade all instances of lodash to 1.2.3","$0 up lodash@1.2.3"],["Upgrade all instances of packages with the `@babel` scope to the latest release","$0 up '@babel/*'"],["Upgrade all instances of packages containing the word `jest` to the latest release","$0 up '*jest*'"],["Upgrade all instances of packages with the `@babel` scope to 7.0.0","$0 up '@babel/*@7.0.0'"]]})}static{this.schema=[Pw("recursive",Ku.Forbids,["interactive","exact","tilde","caret"],{ignore:[void 0,!1]})]}async execute(){return this.recursive?await this.executeUpRecursive():await this.executeUpClassic()}async executeUpRecursive(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:o,workspace:a}=await Qt.find(r,this.context.cwd),n=await Wr.find(r);if(!a)throw new or(o.cwd,this.context.cwd);await o.restoreInstallState({restoreResolutions:!1});let u=[...o.storedDescriptors.values()],A=u.map(E=>G.stringifyIdent(E)),p=new Set;for(let E of this.patterns){if(G.parseDescriptor(E).range!=="unknown")throw new ot("Ranges aren't allowed when using --recursive");for(let w of(0,SH.default)(A,E)){let D=G.parseIdent(w);p.add(D.identHash)}}let h=u.filter(E=>p.has(E.identHash));for(let E of h)o.storedDescriptors.delete(E.descriptorHash),o.storedResolutions.delete(E.descriptorHash);return await o.installWithNewReport({stdout:this.context.stdout},{cache:n,mode:this.mode})}async executeUpClassic(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:o,workspace:a}=await Qt.find(r,this.context.cwd),n=await Wr.find(r);if(!a)throw new or(o.cwd,this.context.cwd);await o.restoreInstallState({restoreResolutions:!1});let u=this.fixed,A=r.isInteractive({interactive:this.interactive,stdout:this.context.stdout}),p=R2(this,o),h=A?["keep","reuse","project","latest"]:["project","latest"],E=[],w=[];for(let N of this.patterns){let U=!1,z=G.parseDescriptor(N),te=G.stringifyIdent(z);for(let le of o.workspaces)for(let ce of["dependencies","devDependencies"]){let Ie=[...le.manifest.getForScope(ce).values()].map(De=>G.stringifyIdent(De)),he=te==="*"?Ie:(0,SH.default)(Ie,te);for(let De of he){let Ee=G.parseIdent(De),g=le.manifest[ce].get(Ee.identHash);if(typeof g>"u")throw new Error("Assertion failed: Expected the descriptor to be registered");let me=G.makeDescriptor(Ee,z.range);E.push(Promise.resolve().then(async()=>[le,ce,g,await T2(me,{project:o,workspace:le,cache:n,target:ce,fixed:u,modifier:p,strategies:h})])),U=!0}}U||w.push(N)}if(w.length>1)throw new ot(`Patterns ${pe.prettyList(r,w,pe.Type.CODE)} don't match any packages referenced by any workspace`);if(w.length>0)throw new ot(`Pattern ${pe.prettyList(r,w,pe.Type.CODE)} doesn't match any packages referenced by any workspace`);let D=await Promise.all(E),b=await pA.start({configuration:r,stdout:this.context.stdout,suggestInstall:!1},async N=>{for(let[,,U,{suggestions:z,rejections:te}]of D){let le=z.filter(ce=>ce.descriptor!==null);if(le.length===0){let[ce]=te;if(typeof ce>"u")throw new Error("Assertion failed: Expected an error to have been set");let ue=this.cli.error(ce);o.configuration.get("enableNetwork")?N.reportError(27,`${G.prettyDescriptor(r,U)} can't be resolved to a satisfying range ${ue}`):N.reportError(27,`${G.prettyDescriptor(r,U)} can't be resolved to a satisfying range (note: network resolution has been disabled) ${ue}`)}else le.length>1&&!A&&N.reportError(27,`${G.prettyDescriptor(r,U)} has multiple possible upgrade strategies; use -i to disambiguate manually`)}});if(b.hasErrors())return b.exitCode();let C=!1,T=[];for(let[N,U,,{suggestions:z}]of D){let te,le=z.filter(he=>he.descriptor!==null),ce=le[0].descriptor,ue=le.every(he=>G.areDescriptorsEqual(he.descriptor,ce));le.length===1||ue?te=ce:(C=!0,{answer:te}=await(0,zde.prompt)({type:"select",name:"answer",message:`Which range do you want to use in ${G.prettyWorkspace(r,N)} \u276F ${U}?`,choices:z.map(({descriptor:he,name:De,reason:Ee})=>he?{name:De,hint:Ee,descriptor:he}:{name:De,hint:Ee,disabled:!0}),onCancel:()=>process.exit(130),result(he){return this.find(he,"descriptor")},stdin:this.context.stdin,stdout:this.context.stdout}));let Ie=N.manifest[U].get(te.identHash);if(typeof Ie>"u")throw new Error("Assertion failed: This descriptor should have a matching entry");if(Ie.descriptorHash!==te.descriptorHash)N.manifest[U].set(te.identHash,te),T.push([N,U,Ie,te]);else{let he=r.makeResolver(),De={project:o,resolver:he},Ee=r.normalizeDependency(Ie),g=he.bindDescriptor(Ee,N.anchoredLocator,De);o.forgetResolution(g)}}return await r.triggerMultipleHooks(N=>N.afterWorkspaceDependencyReplacement,T),C&&this.context.stdout.write(` `),await o.installWithNewReport({stdout:this.context.stdout},{cache:n,mode:this.mode})}};Ke();Ke();Ke();Gt();var YE=class extends ut{constructor(){super(...arguments);this.recursive=de.Boolean("-R,--recursive",!1,{description:"List, for each workspace, what are all the paths that lead to the dependency"});this.json=de.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.peers=de.Boolean("--peers",!1,{description:"Also print the peer dependencies that match the specified name"});this.package=de.String()}static{this.paths=[["why"]]}static{this.usage=st.Usage({description:"display the reason why a package is needed",details:` This command prints the exact reasons why a package appears in the dependency tree. If \`-R,--recursive\` is set, the listing will go in depth and will list, for each workspaces, what are all the paths that lead to the dependency. Note that the display is somewhat optimized in that it will not print the package listing twice for a single package, so if you see a leaf named "Foo" when looking for "Bar", it means that "Foo" already got printed higher in the tree. `,examples:[["Explain why lodash is used in your project","$0 why lodash"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:o,workspace:a}=await Qt.find(r,this.context.cwd);if(!a)throw new or(o.cwd,this.context.cwd);await o.restoreInstallState();let n=G.parseIdent(this.package).identHash,u=this.recursive?Z0t(o,n,{configuration:r,peers:this.peers}):X0t(o,n,{configuration:r,peers:this.peers});As.emitTree(u,{configuration:r,stdout:this.context.stdout,json:this.json,separators:1})}};function X0t(t,e,{configuration:r,peers:o}){let a=qe.sortMap(t.storedPackages.values(),A=>G.stringifyLocator(A)),n={},u={children:n};for(let A of a){let p={};for(let E of A.dependencies.values()){if(!o&&A.peerDependencies.has(E.identHash))continue;let w=t.storedResolutions.get(E.descriptorHash);if(!w)throw new Error("Assertion failed: The resolution should have been registered");let D=t.storedPackages.get(w);if(!D)throw new Error("Assertion failed: The package should have been registered");if(D.identHash!==e)continue;{let C=G.stringifyLocator(A);n[C]={value:[A,pe.Type.LOCATOR],children:p}}let b=G.stringifyLocator(D);p[b]={value:[{descriptor:E,locator:D},pe.Type.DEPENDENT]}}}return u}function Z0t(t,e,{configuration:r,peers:o}){let a=qe.sortMap(t.workspaces,D=>G.stringifyLocator(D.anchoredLocator)),n=new Set,u=new Set,A=D=>{if(n.has(D.locatorHash))return u.has(D.locatorHash);if(n.add(D.locatorHash),D.identHash===e)return u.add(D.locatorHash),!0;let b=!1;D.identHash===e&&(b=!0);for(let C of D.dependencies.values()){if(!o&&D.peerDependencies.has(C.identHash))continue;let T=t.storedResolutions.get(C.descriptorHash);if(!T)throw new Error("Assertion failed: The resolution should have been registered");let N=t.storedPackages.get(T);if(!N)throw new Error("Assertion failed: The package should have been registered");A(N)&&(b=!0)}return b&&u.add(D.locatorHash),b};for(let D of a)A(D.anchoredPackage);let p=new Set,h={},E={children:h},w=(D,b,C)=>{if(!u.has(D.locatorHash))return;let T=C!==null?pe.tuple(pe.Type.DEPENDENT,{locator:D,descriptor:C}):pe.tuple(pe.Type.LOCATOR,D),N={},U={value:T,children:N},z=G.stringifyLocator(D);if(b[z]=U,!(C!==null&&t.tryWorkspaceByLocator(D))&&!p.has(D.locatorHash)){p.add(D.locatorHash);for(let te of D.dependencies.values()){if(!o&&D.peerDependencies.has(te.identHash))continue;let le=t.storedResolutions.get(te.descriptorHash);if(!le)throw new Error("Assertion failed: The resolution should have been registered");let ce=t.storedPackages.get(le);if(!ce)throw new Error("Assertion failed: The package should have been registered");w(ce,N,te)}}};for(let D of a)w(D.anchoredPackage,h,null);return E}Ke();var OH={};Kt(OH,{GitFetcher:()=>_2,GitResolver:()=>H2,default:()=>Egt,gitUtils:()=>ra});Ke();Pt();var ra={};Kt(ra,{TreeishProtocols:()=>U2,clone:()=>NH,fetchBase:()=>mme,fetchChangedFiles:()=>yme,fetchChangedWorkspaces:()=>mgt,fetchRoot:()=>dme,isGitUrl:()=>zE,lsRemote:()=>gme,normalizeLocator:()=>dgt,normalizeRepoUrl:()=>KE,resolveUrl:()=>LH,splitRepoUrl:()=>Rh,validateRepoUrl:()=>TH});Ke();Pt();Gt();var fme=et(cme()),pme=et(t3()),VE=et(ve("querystring")),FH=et(ni());function QH(t,e,r){let o=t.indexOf(r);return t.lastIndexOf(e,o>-1?o:1/0)}function ume(t){try{return new URL(t)}catch{return}}function hgt(t){let e=QH(t,"@","#"),r=QH(t,":","#");return r>e&&(t=`${t.slice(0,r)}/${t.slice(r+1)}`),QH(t,":","#")===-1&&t.indexOf("//")===-1&&(t=`ssh://${t}`),t}function Ame(t){return ume(t)||ume(hgt(t))}function KE(t,{git:e=!1}={}){if(t=t.replace(/^git\+https:/,"https:"),t=t.replace(/^(?:github:|https:\/\/github\.com\/|git:\/\/github\.com\/)?(?!\.{1,2}\/)([a-zA-Z0-9._-]+)\/(?!\.{1,2}(?:#|$))([a-zA-Z0-9._-]+?)(?:\.git)?(#.*)?$/,"https://github.com/$1/$2.git$3"),t=t.replace(/^https:\/\/github\.com\/(?!\.{1,2}\/)([a-zA-Z0-9._-]+)\/(?!\.{1,2}(?:#|$))([a-zA-Z0-9._-]+?)\/tarball\/(.+)?$/,"https://github.com/$1/$2.git#$3"),e){let r=Ame(t);r&&(t=r.href),t=t.replace(/^git\+([^:]+):/,"$1:")}return t}function hme(){return{...process.env,GIT_SSH_COMMAND:process.env.GIT_SSH_COMMAND||`${process.env.GIT_SSH||"ssh"} -o BatchMode=yes`}}var ggt=[/^ssh:/,/^git(?:\+[^:]+)?:/,/^(?:git\+)?https?:[^#]+\/[^#]+(?:\.git)(?:#.*)?$/,/^git@[^#]+\/[^#]+\.git(?:#.*)?$/,/^(?:github:|https:\/\/github\.com\/)?(?!\.{1,2}\/)([a-zA-Z._0-9-]+)\/(?!\.{1,2}(?:#|$))([a-zA-Z._0-9-]+?)(?:\.git)?(?:#.*)?$/,/^https:\/\/github\.com\/(?!\.{1,2}\/)([a-zA-Z0-9._-]+)\/(?!\.{1,2}(?:#|$))([a-zA-Z0-9._-]+?)\/tarball\/(.+)?$/],U2=(a=>(a.Commit="commit",a.Head="head",a.Tag="tag",a.Semver="semver",a))(U2||{});function zE(t){return t?ggt.some(e=>!!t.match(e)):!1}function Rh(t){t=KE(t);let e=t.indexOf("#");if(e===-1)return{repo:t,treeish:{protocol:"head",request:"HEAD"},extra:{}};let r=t.slice(0,e),o=t.slice(e+1);if(o.match(/^[a-z]+=/)){let a=VE.default.parse(o);for(let[p,h]of Object.entries(a))if(typeof h!="string")throw new Error(`Assertion failed: The ${p} parameter must be a literal string`);let n=Object.values(U2).find(p=>Object.hasOwn(a,p)),[u,A]=typeof n<"u"?[n,a[n]]:["head","HEAD"];for(let p of Object.values(U2))delete a[p];return{repo:r,treeish:{protocol:u,request:A},extra:a}}else{let a=o.indexOf(":"),[n,u]=a===-1?[null,o]:[o.slice(0,a),o.slice(a+1)];return{repo:r,treeish:{protocol:n,request:u},extra:{}}}}function dgt(t){return G.makeLocator(t,KE(t.reference))}function TH(t,{configuration:e}){let r=KE(t,{git:!0});if(!on.getNetworkSettings(`https://${(0,fme.default)(r).resource}`,{configuration:e}).enableNetwork)throw new zt(80,`Request to '${r}' has been blocked because of your configuration settings`);return r}async function gme(t,e){let r=TH(t,{configuration:e}),o=await RH("listing refs",["ls-remote",r],{cwd:e.startingCwd,env:hme()},{configuration:e,normalizedRepoUrl:r}),a=new Map,n=/^([a-f0-9]{40})\t([^\n]+)/gm,u;for(;(u=n.exec(o.stdout))!==null;)a.set(u[2],u[1]);return a}async function LH(t,e){let{repo:r,treeish:{protocol:o,request:a},extra:n}=Rh(t),u=await gme(r,e),A=(h,E)=>{switch(h){case"commit":{if(!E.match(/^[a-f0-9]{40}$/))throw new Error("Invalid commit hash");return VE.default.stringify({...n,commit:E})}case"head":{let w=u.get(E==="HEAD"?E:`refs/heads/${E}`);if(typeof w>"u")throw new Error(`Unknown head ("${E}")`);return VE.default.stringify({...n,commit:w})}case"tag":{let w=u.get(`refs/tags/${E}`);if(typeof w>"u")throw new Error(`Unknown tag ("${E}")`);return VE.default.stringify({...n,commit:w})}case"semver":{let w=Ur.validRange(E);if(!w)throw new Error(`Invalid range ("${E}")`);let D=new Map([...u.entries()].filter(([C])=>C.startsWith("refs/tags/")).map(([C,T])=>[FH.default.parse(C.slice(10)),T]).filter(C=>C[0]!==null)),b=FH.default.maxSatisfying([...D.keys()],w);if(b===null)throw new Error(`No matching range ("${E}")`);return VE.default.stringify({...n,commit:D.get(b)})}case null:{let w;if((w=p("commit",E))!==null||(w=p("tag",E))!==null||(w=p("head",E))!==null)return w;throw E.match(/^[a-f0-9]+$/)?new Error(`Couldn't resolve "${E}" as either a commit, a tag, or a head - if a commit, use the 40-characters commit hash`):new Error(`Couldn't resolve "${E}" as either a commit, a tag, or a head`)}default:throw new Error(`Invalid Git resolution protocol ("${h}")`)}},p=(h,E)=>{try{return A(h,E)}catch{return null}};return KE(`${r}#${A(o,a)}`)}async function NH(t,e){return await e.getLimit("cloneConcurrency")(async()=>{let{repo:r,treeish:{protocol:o,request:a}}=Rh(t);if(o!=="commit")throw new Error("Invalid treeish protocol when cloning");let n=TH(r,{configuration:e}),u=await ae.mktempPromise(),A={cwd:u,env:hme()};return await RH("cloning the repository",["clone","-c core.autocrlf=false",n,Ae.fromPortablePath(u)],A,{configuration:e,normalizedRepoUrl:n}),await RH("switching branch",["checkout",`${a}`],A,{configuration:e,normalizedRepoUrl:n}),u})}async function dme(t){let e,r=t;do{if(e=r,await ae.existsPromise(K.join(e,".git")))return e;r=K.dirname(e)}while(r!==e);return null}async function mme(t,{baseRefs:e}){if(e.length===0)throw new ot("Can't run this command with zero base refs specified.");let r=[];for(let A of e){let{code:p}=await Hr.execvp("git",["merge-base",A,"HEAD"],{cwd:t});p===0&&r.push(A)}if(r.length===0)throw new ot(`No ancestor could be found between any of HEAD and ${e.join(", ")}`);let{stdout:o}=await Hr.execvp("git",["merge-base","HEAD",...r],{cwd:t,strict:!0}),a=o.trim(),{stdout:n}=await Hr.execvp("git",["show","--quiet","--pretty=format:%s",a],{cwd:t,strict:!0}),u=n.trim();return{hash:a,title:u}}async function yme(t,{base:e,project:r}){let o=qe.buildIgnorePattern(r.configuration.get("changesetIgnorePatterns")),{stdout:a}=await Hr.execvp("git",["diff","--name-only",`${e}`],{cwd:t,strict:!0}),n=a.split(/\r\n|\r|\n/).filter(h=>h.length>0).map(h=>K.resolve(t,Ae.toPortablePath(h))),{stdout:u}=await Hr.execvp("git",["ls-files","--others","--exclude-standard"],{cwd:t,strict:!0}),A=u.split(/\r\n|\r|\n/).filter(h=>h.length>0).map(h=>K.resolve(t,Ae.toPortablePath(h))),p=[...new Set([...n,...A].sort())];return o?p.filter(h=>!K.relative(r.cwd,h).match(o)):p}async function mgt({ref:t,project:e}){if(e.configuration.projectCwd===null)throw new ot("This command can only be run from within a Yarn project");let r=[K.resolve(e.cwd,mr.lockfile),K.resolve(e.cwd,e.configuration.get("cacheFolder")),K.resolve(e.cwd,e.configuration.get("installStatePath")),K.resolve(e.cwd,e.configuration.get("virtualFolder"))];await e.configuration.triggerHook(u=>u.populateYarnPaths,e,u=>{u!=null&&r.push(u)});let o=await dme(e.configuration.projectCwd);if(o==null)throw new ot("This command can only be run on Git repositories");let a=await mme(o,{baseRefs:typeof t=="string"?[t]:e.configuration.get("changesetBaseRefs")}),n=await yme(o,{base:a.hash,project:e});return new Set(qe.mapAndFilter(n,u=>{let A=e.tryWorkspaceByFilePath(u);return A===null?qe.mapAndFilter.skip:r.some(p=>u.startsWith(p))?qe.mapAndFilter.skip:A}))}async function RH(t,e,r,{configuration:o,normalizedRepoUrl:a}){try{return await Hr.execvp("git",e,{...r,strict:!0})}catch(n){if(!(n instanceof Hr.ExecError))throw n;let u=n.reportExtra,A=n.stderr.toString();throw new zt(1,`Failed ${t}`,p=>{p.reportError(1,` ${pe.prettyField(o,{label:"Repository URL",value:pe.tuple(pe.Type.URL,a)})}`);for(let h of A.matchAll(/^(.+?): (.*)$/gm)){let[,E,w]=h;E=E.toLowerCase();let D=E==="error"?"Error":`${(0,pme.default)(E)} Error`;p.reportError(1,` ${pe.prettyField(o,{label:D,value:pe.tuple(pe.Type.NO_HINT,w)})}`)}u?.(p)})}}var _2=class{supports(e,r){return zE(e.reference)}getLocalPath(e,r){return null}async fetch(e,r){let o=r.checksums.get(e.locatorHash)||null,a=new Map(r.checksums);a.set(e.locatorHash,o);let n={...r,checksums:a},u=await this.downloadHosted(e,n);if(u!==null)return u;let[A,p,h]=await r.cache.fetchPackageFromCache(e,o,{onHit:()=>r.report.reportCacheHit(e),onMiss:()=>r.report.reportCacheMiss(e,`${G.prettyLocator(r.project.configuration,e)} can't be found in the cache and will be fetched from the remote repository`),loader:()=>this.cloneFromRemote(e,n),...r.cacheOptions});return{packageFs:A,releaseFs:p,prefixPath:G.getIdentVendorPath(e),checksum:h}}async downloadHosted(e,r){return r.project.configuration.reduceHook(o=>o.fetchHostedRepository,null,e,r)}async cloneFromRemote(e,r){let o=Rh(e.reference),a=await NH(e.reference,r.project.configuration),n=K.resolve(a,o.extra.cwd??Bt.dot),u=K.join(n,"package.tgz");await hn.prepareExternalProject(n,u,{configuration:r.project.configuration,report:r.report,workspace:o.extra.workspace,locator:e});let A=await ae.readFilePromise(u);return await qe.releaseAfterUseAsync(async()=>await $i.convertToZip(A,{configuration:r.project.configuration,prefixPath:G.getIdentVendorPath(e),stripComponents:1}))}};Ke();Ke();var H2=class{supportsDescriptor(e,r){return zE(e.range)}supportsLocator(e,r){return zE(e.reference)}shouldPersistResolution(e,r){return!0}bindDescriptor(e,r,o){return e}getResolutionDependencies(e,r){return{}}async getCandidates(e,r,o){let a=await LH(e.range,o.project.configuration);return[G.makeLocator(e,a)]}async getSatisfying(e,r,o,a){let n=Rh(e.range);return{locators:o.filter(A=>{if(A.identHash!==e.identHash)return!1;let p=Rh(A.reference);return!(n.repo!==p.repo||n.treeish.protocol==="commit"&&n.treeish.request!==p.treeish.request)}),sorted:!1}}async resolve(e,r){if(!r.fetchOptions)throw new Error("Assertion failed: This resolver cannot be used unless a fetcher is configured");let o=await r.fetchOptions.fetcher.fetch(e,r.fetchOptions),a=await qe.releaseAfterUseAsync(async()=>await _t.find(o.prefixPath,{baseFs:o.packageFs}),o.releaseFs);return{...e,version:a.version||"0.0.0",languageName:a.languageName||r.project.configuration.get("defaultLanguageName"),linkType:"HARD",conditions:a.getConditions(),dependencies:r.project.configuration.normalizeDependencyMap(a.dependencies),peerDependencies:a.peerDependencies,dependenciesMeta:a.dependenciesMeta,peerDependenciesMeta:a.peerDependenciesMeta,bin:a.bin}}};var ygt={configuration:{changesetBaseRefs:{description:"The base git refs that the current HEAD is compared against when detecting changes. Supports git branches, tags, and commits.",type:"STRING",isArray:!0,isNullable:!1,default:["master","origin/master","upstream/master","main","origin/main","upstream/main"]},changesetIgnorePatterns:{description:"Array of glob patterns; files matching them will be ignored when fetching the changed files",type:"STRING",default:[],isArray:!0},cloneConcurrency:{description:"Maximal number of concurrent clones",type:"NUMBER",default:2}},fetchers:[_2],resolvers:[H2]};var Egt=ygt;Gt();var JE=class extends ut{constructor(){super(...arguments);this.since=de.String("--since",{description:"Only include workspaces that have been changed since the specified ref.",tolerateBoolean:!0});this.recursive=de.Boolean("-R,--recursive",!1,{description:"Find packages via dependencies/devDependencies instead of using the workspaces field"});this.noPrivate=de.Boolean("--no-private",{description:"Exclude workspaces that have the private field set to true"});this.verbose=de.Boolean("-v,--verbose",!1,{description:"Also return the cross-dependencies between workspaces"});this.json=de.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}static{this.paths=[["workspaces","list"]]}static{this.usage=st.Usage({category:"Workspace-related commands",description:"list all available workspaces",details:"\n This command will print the list of all workspaces in the project.\n\n - If `--since` is set, Yarn will only list workspaces that have been modified since the specified ref. By default Yarn will use the refs specified by the `changesetBaseRefs` configuration option.\n\n - If `-R,--recursive` is set, Yarn will find workspaces to run the command on by recursively evaluating `dependencies` and `devDependencies` fields, instead of looking at the `workspaces` fields.\n\n - If `--no-private` is set, Yarn will not list any workspaces that have the `private` field set to `true`.\n\n - If both the `-v,--verbose` and `--json` options are set, Yarn will also return the cross-dependencies between each workspaces (useful when you wish to automatically generate Buck / Bazel rules).\n "})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:o}=await Qt.find(r,this.context.cwd);return(await Lt.start({configuration:r,json:this.json,stdout:this.context.stdout},async n=>{let u=this.since?await ra.fetchChangedWorkspaces({ref:this.since,project:o}):o.workspaces,A=new Set(u);if(this.recursive)for(let p of[...u].map(h=>h.getRecursiveWorkspaceDependents()))for(let h of p)A.add(h);for(let p of A){let{manifest:h}=p;if(h.private&&this.noPrivate)continue;let E;if(this.verbose){let w=new Set,D=new Set;for(let b of _t.hardDependencies)for(let[C,T]of h.getForScope(b)){let N=o.tryWorkspaceByDescriptor(T);N===null?o.workspacesByIdent.has(C)&&D.add(T):w.add(N)}E={workspaceDependencies:Array.from(w).map(b=>b.relativeCwd),mismatchedWorkspaceDependencies:Array.from(D).map(b=>G.stringifyDescriptor(b))}}n.reportInfo(null,`${p.relativeCwd}`),n.reportJson({location:p.relativeCwd,name:h.name?G.stringifyIdent(h.name):null,...E})}})).exitCode()}};Ke();Ke();Gt();var XE=class extends ut{constructor(){super(...arguments);this.workspaceName=de.String();this.commandName=de.String();this.args=de.Proxy()}static{this.paths=[["workspace"]]}static{this.usage=st.Usage({category:"Workspace-related commands",description:"run a command within the specified workspace",details:` This command will run a given sub-command on a single workspace. `,examples:[["Add a package to a single workspace","yarn workspace components add -D react"],["Run build script on a single workspace","yarn workspace components run build"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:o,workspace:a}=await Qt.find(r,this.context.cwd);if(!a)throw new or(o.cwd,this.context.cwd);let n=o.workspaces,u=new Map(n.map(p=>[G.stringifyIdent(p.anchoredLocator),p])),A=u.get(this.workspaceName);if(A===void 0){let p=Array.from(u.keys()).sort();throw new ot(`Workspace '${this.workspaceName}' not found. Did you mean any of the following: - ${p.join(` - `)}?`)}return this.cli.run([this.commandName,...this.args],{cwd:A.cwd})}};var Cgt={configuration:{enableImmutableInstalls:{description:"If true (the default on CI), prevents the install command from modifying the lockfile",type:"BOOLEAN",default:Eme.isCI},defaultSemverRangePrefix:{description:"The default save prefix: '^', '~' or ''",type:"STRING",values:["^","~",""],default:"^"},preferReuse:{description:"If true, `yarn add` will attempt to reuse the most common dependency range in other workspaces.",type:"BOOLEAN",default:!1}},commands:[hE,gE,dE,mE,jE,TE,PE,JE,CE,IE,wE,BE,fE,pE,yE,EE,vE,DE,SE,xE,bE,kE,GE,QE,FE,NE,LE,OE,RE,ME,UE,_E,HE,qE,WE,YE,XE]},Igt=Cgt;var jH={};Kt(jH,{default:()=>Bgt});Ke();var kt={optional:!0},UH=[["@tailwindcss/aspect-ratio@<0.2.1",{peerDependencies:{tailwindcss:"^2.0.2"}}],["@tailwindcss/line-clamp@<0.2.1",{peerDependencies:{tailwindcss:"^2.0.2"}}],["@fullhuman/postcss-purgecss@3.1.3 || 3.1.3-alpha.0",{peerDependencies:{postcss:"^8.0.0"}}],["@samverschueren/stream-to-observable@<0.3.1",{peerDependenciesMeta:{rxjs:kt,zenObservable:kt}}],["any-observable@<0.5.1",{peerDependenciesMeta:{rxjs:kt,zenObservable:kt}}],["@pm2/agent@<1.0.4",{dependencies:{debug:"*"}}],["debug@<4.2.0",{peerDependenciesMeta:{"supports-color":kt}}],["got@<11",{dependencies:{"@types/responselike":"^1.0.0","@types/keyv":"^3.1.1"}}],["cacheable-lookup@<4.1.2",{dependencies:{"@types/keyv":"^3.1.1"}}],["http-link-dataloader@*",{peerDependencies:{graphql:"^0.13.1 || ^14.0.0"}}],["typescript-language-server@*",{dependencies:{"vscode-jsonrpc":"^5.0.1","vscode-languageserver-protocol":"^3.15.0"}}],["postcss-syntax@*",{peerDependenciesMeta:{"postcss-html":kt,"postcss-jsx":kt,"postcss-less":kt,"postcss-markdown":kt,"postcss-scss":kt}}],["jss-plugin-rule-value-function@<=10.1.1",{dependencies:{"tiny-warning":"^1.0.2"}}],["ink-select-input@<4.1.0",{peerDependencies:{react:"^16.8.2"}}],["license-webpack-plugin@<2.3.18",{peerDependenciesMeta:{webpack:kt}}],["snowpack@>=3.3.0",{dependencies:{"node-gyp":"^7.1.0"}}],["promise-inflight@*",{peerDependenciesMeta:{bluebird:kt}}],["reactcss@*",{peerDependencies:{react:"*"}}],["react-color@<=2.19.0",{peerDependencies:{react:"*"}}],["gatsby-plugin-i18n@*",{dependencies:{ramda:"^0.24.1"}}],["useragent@^2.0.0",{dependencies:{request:"^2.88.0",yamlparser:"0.0.x",semver:"5.5.x"}}],["@apollographql/apollo-tools@<=0.5.2",{peerDependencies:{graphql:"^14.2.1 || ^15.0.0"}}],["material-table@^2.0.0",{dependencies:{"@babel/runtime":"^7.11.2"}}],["@babel/parser@*",{dependencies:{"@babel/types":"^7.8.3"}}],["fork-ts-checker-webpack-plugin@<=6.3.4",{peerDependencies:{eslint:">= 6",typescript:">= 2.7",webpack:">= 4","vue-template-compiler":"*"},peerDependenciesMeta:{eslint:kt,"vue-template-compiler":kt}}],["rc-animate@<=3.1.1",{peerDependencies:{react:">=16.9.0","react-dom":">=16.9.0"}}],["react-bootstrap-table2-paginator@*",{dependencies:{classnames:"^2.2.6"}}],["react-draggable@<=4.4.3",{peerDependencies:{react:">= 16.3.0","react-dom":">= 16.3.0"}}],["apollo-upload-client@<14",{peerDependencies:{graphql:"14 - 15"}}],["react-instantsearch-core@<=6.7.0",{peerDependencies:{algoliasearch:">= 3.1 < 5"}}],["react-instantsearch-dom@<=6.7.0",{dependencies:{"react-fast-compare":"^3.0.0"}}],["ws@<7.2.1",{peerDependencies:{bufferutil:"^4.0.1","utf-8-validate":"^5.0.2"},peerDependenciesMeta:{bufferutil:kt,"utf-8-validate":kt}}],["react-portal@<4.2.2",{peerDependencies:{"react-dom":"^15.0.0-0 || ^16.0.0-0 || ^17.0.0-0"}}],["react-scripts@<=4.0.1",{peerDependencies:{react:"*"}}],["testcafe@<=1.10.1",{dependencies:{"@babel/plugin-transform-for-of":"^7.12.1","@babel/runtime":"^7.12.5"}}],["testcafe-legacy-api@<=4.2.0",{dependencies:{"testcafe-hammerhead":"^17.0.1","read-file-relative":"^1.2.0"}}],["@google-cloud/firestore@<=4.9.3",{dependencies:{protobufjs:"^6.8.6"}}],["gatsby-source-apiserver@*",{dependencies:{"babel-polyfill":"^6.26.0"}}],["@webpack-cli/package-utils@<=1.0.1-alpha.4",{dependencies:{"cross-spawn":"^7.0.3"}}],["gatsby-remark-prismjs@<3.3.28",{dependencies:{lodash:"^4"}}],["gatsby-plugin-favicon@*",{peerDependencies:{webpack:"*"}}],["gatsby-plugin-sharp@<=4.6.0-next.3",{dependencies:{debug:"^4.3.1"}}],["gatsby-react-router-scroll@<=5.6.0-next.0",{dependencies:{"prop-types":"^15.7.2"}}],["@rebass/forms@*",{dependencies:{"@styled-system/should-forward-prop":"^5.0.0"},peerDependencies:{react:"^16.8.6"}}],["rebass@*",{peerDependencies:{react:"^16.8.6"}}],["@ant-design/react-slick@<=0.28.3",{peerDependencies:{react:">=16.0.0"}}],["mqtt@<4.2.7",{dependencies:{duplexify:"^4.1.1"}}],["vue-cli-plugin-vuetify@<=2.0.3",{dependencies:{semver:"^6.3.0"},peerDependenciesMeta:{"sass-loader":kt,"vuetify-loader":kt}}],["vue-cli-plugin-vuetify@<=2.0.4",{dependencies:{"null-loader":"^3.0.0"}}],["vue-cli-plugin-vuetify@>=2.4.3",{peerDependencies:{vue:"*"}}],["@vuetify/cli-plugin-utils@<=0.0.4",{dependencies:{semver:"^6.3.0"},peerDependenciesMeta:{"sass-loader":kt}}],["@vue/cli-plugin-typescript@<=5.0.0-alpha.0",{dependencies:{"babel-loader":"^8.1.0"}}],["@vue/cli-plugin-typescript@<=5.0.0-beta.0",{dependencies:{"@babel/core":"^7.12.16"},peerDependencies:{"vue-template-compiler":"^2.0.0"},peerDependenciesMeta:{"vue-template-compiler":kt}}],["cordova-ios@<=6.3.0",{dependencies:{underscore:"^1.9.2"}}],["cordova-lib@<=10.0.1",{dependencies:{underscore:"^1.9.2"}}],["git-node-fs@*",{peerDependencies:{"js-git":"^0.7.8"},peerDependenciesMeta:{"js-git":kt}}],["consolidate@<0.16.0",{peerDependencies:{mustache:"^3.0.0"},peerDependenciesMeta:{mustache:kt}}],["consolidate@<=0.16.0",{peerDependencies:{velocityjs:"^2.0.1",tinyliquid:"^0.2.34","liquid-node":"^3.0.1",jade:"^1.11.0","then-jade":"*",dust:"^0.3.0","dustjs-helpers":"^1.7.4","dustjs-linkedin":"^2.7.5",swig:"^1.4.2","swig-templates":"^2.0.3","razor-tmpl":"^1.3.1",atpl:">=0.7.6",liquor:"^0.0.5",twig:"^1.15.2",ejs:"^3.1.5",eco:"^1.1.0-rc-3",jazz:"^0.0.18",jqtpl:"~1.1.0",hamljs:"^0.6.2",hamlet:"^0.3.3",whiskers:"^0.4.0","haml-coffee":"^1.14.1","hogan.js":"^3.0.2",templayed:">=0.2.3",handlebars:"^4.7.6",underscore:"^1.11.0",lodash:"^4.17.20",pug:"^3.0.0","then-pug":"*",qejs:"^3.0.5",walrus:"^0.10.1",mustache:"^4.0.1",just:"^0.1.8",ect:"^0.5.9",mote:"^0.2.0",toffee:"^0.3.6",dot:"^1.1.3","bracket-template":"^1.1.5",ractive:"^1.3.12",nunjucks:"^3.2.2",htmling:"^0.0.8","babel-core":"^6.26.3",plates:"~0.4.11","react-dom":"^16.13.1",react:"^16.13.1","arc-templates":"^0.5.3",vash:"^0.13.0",slm:"^2.0.0",marko:"^3.14.4",teacup:"^2.0.0","coffee-script":"^1.12.7",squirrelly:"^5.1.0",twing:"^5.0.2"},peerDependenciesMeta:{velocityjs:kt,tinyliquid:kt,"liquid-node":kt,jade:kt,"then-jade":kt,dust:kt,"dustjs-helpers":kt,"dustjs-linkedin":kt,swig:kt,"swig-templates":kt,"razor-tmpl":kt,atpl:kt,liquor:kt,twig:kt,ejs:kt,eco:kt,jazz:kt,jqtpl:kt,hamljs:kt,hamlet:kt,whiskers:kt,"haml-coffee":kt,"hogan.js":kt,templayed:kt,handlebars:kt,underscore:kt,lodash:kt,pug:kt,"then-pug":kt,qejs:kt,walrus:kt,mustache:kt,just:kt,ect:kt,mote:kt,toffee:kt,dot:kt,"bracket-template":kt,ractive:kt,nunjucks:kt,htmling:kt,"babel-core":kt,plates:kt,"react-dom":kt,react:kt,"arc-templates":kt,vash:kt,slm:kt,marko:kt,teacup:kt,"coffee-script":kt,squirrelly:kt,twing:kt}}],["vue-loader@<=16.3.3",{peerDependencies:{"@vue/compiler-sfc":"^3.0.8",webpack:"^4.1.0 || ^5.0.0-0"},peerDependenciesMeta:{"@vue/compiler-sfc":kt}}],["vue-loader@^16.7.0",{peerDependencies:{"@vue/compiler-sfc":"^3.0.8",vue:"^3.2.13"},peerDependenciesMeta:{"@vue/compiler-sfc":kt,vue:kt}}],["scss-parser@<=1.0.5",{dependencies:{lodash:"^4.17.21"}}],["query-ast@<1.0.5",{dependencies:{lodash:"^4.17.21"}}],["redux-thunk@<=2.3.0",{peerDependencies:{redux:"^4.0.0"}}],["skypack@<=0.3.2",{dependencies:{tar:"^6.1.0"}}],["@npmcli/metavuln-calculator@<2.0.0",{dependencies:{"json-parse-even-better-errors":"^2.3.1"}}],["bin-links@<2.3.0",{dependencies:{"mkdirp-infer-owner":"^1.0.2"}}],["rollup-plugin-polyfill-node@<=0.8.0",{peerDependencies:{rollup:"^1.20.0 || ^2.0.0"}}],["snowpack@<3.8.6",{dependencies:{"magic-string":"^0.25.7"}}],["elm-webpack-loader@*",{dependencies:{temp:"^0.9.4"}}],["winston-transport@<=4.4.0",{dependencies:{logform:"^2.2.0"}}],["jest-vue-preprocessor@*",{dependencies:{"@babel/core":"7.8.7","@babel/template":"7.8.6"},peerDependencies:{pug:"^2.0.4"},peerDependenciesMeta:{pug:kt}}],["redux-persist@*",{peerDependencies:{react:">=16"},peerDependenciesMeta:{react:kt}}],["sodium@>=3",{dependencies:{"node-gyp":"^3.8.0"}}],["babel-plugin-graphql-tag@<=3.1.0",{peerDependencies:{graphql:"^14.0.0 || ^15.0.0"}}],["@playwright/test@<=1.14.1",{dependencies:{"jest-matcher-utils":"^26.4.2"}}],...["babel-plugin-remove-graphql-queries@<3.14.0-next.1","babel-preset-gatsby-package@<1.14.0-next.1","create-gatsby@<1.14.0-next.1","gatsby-admin@<0.24.0-next.1","gatsby-cli@<3.14.0-next.1","gatsby-core-utils@<2.14.0-next.1","gatsby-design-tokens@<3.14.0-next.1","gatsby-legacy-polyfills@<1.14.0-next.1","gatsby-plugin-benchmark-reporting@<1.14.0-next.1","gatsby-plugin-graphql-config@<0.23.0-next.1","gatsby-plugin-image@<1.14.0-next.1","gatsby-plugin-mdx@<2.14.0-next.1","gatsby-plugin-netlify-cms@<5.14.0-next.1","gatsby-plugin-no-sourcemaps@<3.14.0-next.1","gatsby-plugin-page-creator@<3.14.0-next.1","gatsby-plugin-preact@<5.14.0-next.1","gatsby-plugin-preload-fonts@<2.14.0-next.1","gatsby-plugin-schema-snapshot@<2.14.0-next.1","gatsby-plugin-styletron@<6.14.0-next.1","gatsby-plugin-subfont@<3.14.0-next.1","gatsby-plugin-utils@<1.14.0-next.1","gatsby-recipes@<0.25.0-next.1","gatsby-source-shopify@<5.6.0-next.1","gatsby-source-wikipedia@<3.14.0-next.1","gatsby-transformer-screenshot@<3.14.0-next.1","gatsby-worker@<0.5.0-next.1"].map(t=>[t,{dependencies:{"@babel/runtime":"^7.14.8"}}]),["gatsby-core-utils@<2.14.0-next.1",{dependencies:{got:"8.3.2"}}],["gatsby-plugin-gatsby-cloud@<=3.1.0-next.0",{dependencies:{"gatsby-core-utils":"^2.13.0-next.0"}}],["gatsby-plugin-gatsby-cloud@<=3.2.0-next.1",{peerDependencies:{webpack:"*"}}],["babel-plugin-remove-graphql-queries@<=3.14.0-next.1",{dependencies:{"gatsby-core-utils":"^2.8.0-next.1"}}],["gatsby-plugin-netlify@3.13.0-next.1",{dependencies:{"gatsby-core-utils":"^2.13.0-next.0"}}],["clipanion-v3-codemod@<=0.2.0",{peerDependencies:{jscodeshift:"^0.11.0"}}],["react-live@*",{peerDependencies:{"react-dom":"*",react:"*"}}],["webpack@<4.44.1",{peerDependenciesMeta:{"webpack-cli":kt,"webpack-command":kt}}],["webpack@<5.0.0-beta.23",{peerDependenciesMeta:{"webpack-cli":kt}}],["webpack-dev-server@<3.10.2",{peerDependenciesMeta:{"webpack-cli":kt}}],["@docusaurus/responsive-loader@<1.5.0",{peerDependenciesMeta:{sharp:kt,jimp:kt}}],["eslint-module-utils@*",{peerDependenciesMeta:{"eslint-import-resolver-node":kt,"eslint-import-resolver-typescript":kt,"eslint-import-resolver-webpack":kt,"@typescript-eslint/parser":kt}}],["eslint-plugin-import@*",{peerDependenciesMeta:{"@typescript-eslint/parser":kt}}],["critters-webpack-plugin@<3.0.2",{peerDependenciesMeta:{"html-webpack-plugin":kt}}],["terser@<=5.10.0",{dependencies:{acorn:"^8.5.0"}}],["babel-preset-react-app@10.0.x <10.0.2",{dependencies:{"@babel/plugin-proposal-private-property-in-object":"^7.16.7"}}],["eslint-config-react-app@*",{peerDependenciesMeta:{typescript:kt}}],["@vue/eslint-config-typescript@<11.0.0",{peerDependenciesMeta:{typescript:kt}}],["unplugin-vue2-script-setup@<0.9.1",{peerDependencies:{"@vue/composition-api":"^1.4.3","@vue/runtime-dom":"^3.2.26"}}],["@cypress/snapshot@*",{dependencies:{debug:"^3.2.7"}}],["auto-relay@<=0.14.0",{peerDependencies:{"reflect-metadata":"^0.1.13"}}],["vue-template-babel-compiler@<1.2.0",{peerDependencies:{"vue-template-compiler":"^2.6.0"}}],["@parcel/transformer-image@<2.5.0",{peerDependencies:{"@parcel/core":"*"}}],["@parcel/transformer-js@<2.5.0",{peerDependencies:{"@parcel/core":"*"}}],["parcel@*",{peerDependenciesMeta:{"@parcel/core":kt}}],["react-scripts@*",{peerDependencies:{eslint:"*"}}],["focus-trap-react@^8.0.0",{dependencies:{tabbable:"^5.3.2"}}],["react-rnd@<10.3.7",{peerDependencies:{react:">=16.3.0","react-dom":">=16.3.0"}}],["connect-mongo@<5.0.0",{peerDependencies:{"express-session":"^1.17.1"}}],["vue-i18n@<9",{peerDependencies:{vue:"^2"}}],["vue-router@<4",{peerDependencies:{vue:"^2"}}],["unified@<10",{dependencies:{"@types/unist":"^2.0.0"}}],["react-github-btn@<=1.3.0",{peerDependencies:{react:">=16.3.0"}}],["react-dev-utils@*",{peerDependencies:{typescript:">=2.7",webpack:">=4"},peerDependenciesMeta:{typescript:kt}}],["@asyncapi/react-component@<=1.0.0-next.39",{peerDependencies:{react:">=16.8.0","react-dom":">=16.8.0"}}],["xo@*",{peerDependencies:{webpack:">=1.11.0"},peerDependenciesMeta:{webpack:kt}}],["babel-plugin-remove-graphql-queries@<=4.20.0-next.0",{dependencies:{"@babel/types":"^7.15.4"}}],["gatsby-plugin-page-creator@<=4.20.0-next.1",{dependencies:{"fs-extra":"^10.1.0"}}],["gatsby-plugin-utils@<=3.14.0-next.1",{dependencies:{fastq:"^1.13.0"},peerDependencies:{graphql:"^15.0.0"}}],["gatsby-plugin-mdx@<3.1.0-next.1",{dependencies:{mkdirp:"^1.0.4"}}],["gatsby-plugin-mdx@^2",{peerDependencies:{gatsby:"^3.0.0-next"}}],["fdir@<=5.2.0",{peerDependencies:{picomatch:"2.x"},peerDependenciesMeta:{picomatch:kt}}],["babel-plugin-transform-typescript-metadata@<=0.3.2",{peerDependencies:{"@babel/core":"^7","@babel/traverse":"^7"},peerDependenciesMeta:{"@babel/traverse":kt}}],["graphql-compose@>=9.0.10",{peerDependencies:{graphql:"^14.2.0 || ^15.0.0 || ^16.0.0"}}],["vite-plugin-vuetify@<=1.0.2",{peerDependencies:{vue:"^3.0.0"}}],["webpack-plugin-vuetify@<=2.0.1",{peerDependencies:{vue:"^3.2.6"}}],["eslint-import-resolver-vite@<2.0.1",{dependencies:{debug:"^4.3.4",resolve:"^1.22.8"}}],["notistack@^3.0.0",{dependencies:{csstype:"^3.0.10"}}]];var _H;function Cme(){return typeof _H>"u"&&(_H=ve("zlib").brotliDecompressSync(Buffer.from("G7weAByFTVk3Vs7UfHhq4yykgEM7pbW7TI43SG2S5tvGrwHBAzdz+s/npQ6tgEvobvxisrPIadkXeUAJotBn5bDZ5kAhcRqsIHe3F75Walet5hNalwgFDtxb0BiDUjiUQkjG0yW2hto9HPgiCkm316d6bC0kST72YN7D7rfkhCE9x4J0XwB0yavalxpUu2t9xszHrmtwalOxT7VslsxWcB1qpqZwERUra4psWhTV8BgwWeizurec82Caf1ABL11YMfbf8FJ9JBceZOkgmvrQPbC9DUldX/yMbmX06UQluCEjSwUoyO+EZPIjofr+/oAZUck2enraRD+oWLlnlYnj8xB+gwSo9lmmks4fXv574qSqcWA6z21uYkzMu3EWj+K23RxeQlLqiE35/rC8GcS4CGkKHKKq+zAIQwD9iRDNfiAqueLLpicFFrNsAI4zeTD/eO9MHcnRa5m8UT+M2+V+AkFST4BlKneiAQRSdST8KEAIyFlULt6wa9EBd0Ds28VmpaxquJdVt+nwdEs5xUskI13OVtFyY0UrQIRAlCuvvWivvlSKQfTO+2Q8OyUR1W5RvetaPz4jD27hdtwHFFA1Ptx6Ee/t2cY2rg2G46M1pNDRf2pWhvpy8pqMnuI3++4OF3+7OFIWXGjh+o7Nr2jNvbiYcQdQS1h903/jVFgOpA0yJ78z+x759bFA0rq+6aY5qPB4FzS3oYoLupDUhD9nDz6F6H7hpnlMf18KNKDu4IKjTWwrAnY6MFQw1W6ymOALHlFyCZmQhldg1MQHaMVVQTVgDC60TfaBqG++Y8PEoFhN/PBTZT175KNP/BlHDYGOOBmnBdzqJKplZ/ljiVG0ZBzfqeBRrrUkn6rA54462SgiliKoYVnbeptMdXNfAuaupIEi0bApF10TlgHfmEJAPUVidRVFyDupSem5po5vErPqWKhKbUIp0LozpYsIKK57dM/HKr+nguF+7924IIWMICkQ8JUigs9D+W+c4LnNoRtPPKNRUiCYmP+Jfo2lfKCKw8qpraEeWU3uiNRO6zcyKQoXPR5htmzzLznke7b4YbXW3I1lIRzmgG02Udb58U+7TpwyN7XymCgH+wuPDthZVQvRZuEP+SnLtMicz9m5zASWOBiAcLmkuFlTKuHspSIhCBD0yUPKcxu81A+4YD78rA2vtwsUEday9WNyrShyrl60rWmA+SmbYZkQOwFJWArxRYYc5jGhA5ikxYw1rx3ei4NmeX/lKiwpZ9Ln1tV2Ae7sArvxuVLbJjqJRjW1vFXAyHpvLG+8MJ6T2Ubx5M2KDa2SN6vuIGxJ9WQM9Mk3Q7aCNiZONXllhqq24DmoLbQfW2rYWsOgHWjtOmIQMyMKdiHZDjoyIq5+U700nZ6odJAoYXPQBvFNiQ78d5jaXliBqLTJEqUCwi+LiH2mx92EmNKDsJL74Z613+3lf20pxkV1+erOrjj8pW00vsPaahKUM+05ssd5uwM7K482KWEf3TCwlg/o3e5ngto7qSMz7YteIgCsF1UOcsLk7F7MxWbvrPMY473ew0G+noVL8EPbkmEMftMSeL6HFub/zy+2JQ==","base64")).toString()),_H}var HH;function Ime(){return typeof HH>"u"&&(HH=ve("zlib").brotliDecompressSync(Buffer.from("G8MSIIzURnVBnObTcvb3XE6v2S9Qgc2K801Oa5otNKEtK8BINZNcaQHy+9/vf/WXBimwutXC33P2DPc64pps5rz7NGGWaOKNSPL4Y2KRE8twut2lFOIN+OXPtRmPMRhMTILib2bEQx43az2I5d3YS8Roa5UZpF/ujHb3Djd3GDvYUfvFYSUQ39vb2cmifp/rgB4J/65JK3wRBTvMBoNBmn3mbXC63/gbBkW/2IRPri0O8bcsRBsmarF328pAln04nyJFkwUAvNu934supAqLtyerZZpJ8I8suJHhf/ocMV+scKwa8NOiDKIPXw6Ex/EEZD6TEGaW8N5zvNHYF10l6Lfooj7D5W2k3dgvQSbp2Wv8TGOayS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vsfTSnKFM354GWI8luqZnrswWjiXy3G+Vbyo1KMopFmmvBwNELgaS8z8dNZchx/Cl/xjddxhMcyqtzFyONb2Zdu90NkI8pAeufe7YlXrp53v8Dj/l8vWeVspRKBGXScBBPI/HinSTGmLDOGGOCIyH0JFdOZx0gWsacNlQLJMIrBhqRxXxHF/5pseWwejlAAvZ3klZSDSYY8mkToaWejXhgNomeGtx1DTLEUFMRkgF5yFB22WYdJnaWN14r1YJj81hGi45+jrADS5nYRhCiSlCJJ1nL8pYX+HDSMhdTEWyRcgHVp/IsUIZYMfT+YYncUQPgcxNGCHfZ88vDdrcUuaGIl6zhAsiaq7R5dfqrqXH/JcBhfjT8D0azayIyEz75Nxp6YkcyDxlJq3EXnJUpqDohJJOysL1t1uNiHESlvsxPb5cpbW0+ICZqJmUZus1BMW0F5IVBODLIo2zHHjA0=","base64")).toString()),HH}var qH;function wme(){return typeof qH>"u"&&(qH=ve("zlib").brotliDecompressSync(Buffer.from("m9XmPqMRsZ7bFo1U5CxexdgYepcdMsrcAbbqv7/rCXGM7SZhmJ2jPScITf1tA+qxuDFE8KC9mQaCs84ftss/pB0UrlDfSS52Q7rXyYIcHbrGG2egYMqC8FFfnNfZVLU+4ZieJEVLu1qxY0MYkbD8opX7TYstjKzqxwBObq8HUIQwogljOgs72xyCrxj0q79cf/hN2Ys/0fU6gkRgxFedikACuQLS4lvO/N5NpZ85m+BdO3c5VplDLMcfEDt6umRCbfM16uxnqUKPvPFg/qtuzzId3SjAxZFoZRqK3pdtWt/C+VU6+zuX09NsoBs3MwobpU1yyoXZnzA1EmiMRS5GfJeLxV51/jSXrfgTWr1af9hwKvqCfSVHiQuk+uO/N16Cror2c1QlthM7WkS/86azhK3b47PG6f5TAJVtrK7g+zlR2boyKBV+QkdOXcfBDrI8yCciS3LktLb+d3gopE3R1QYFN1QWdQtrso2qK3+OTVYpTdPAfICTe9//3y/1+6mixIob4kfOI1WT3DxyD2ZuR06a6RPOPlftc/bZeqWqUtoqSetJlgP0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JtjtpcD","base64")).toString()),qH}var Bme=new Map([[G.makeIdent(null,"fsevents").identHash,Cme],[G.makeIdent(null,"resolve").identHash,Ime],[G.makeIdent(null,"typescript").identHash,wme]]),wgt={hooks:{registerPackageExtensions:async(t,e)=>{for(let[r,o]of UH)e(G.parseDescriptor(r,!0),o)},getBuiltinPatch:async(t,e)=>{let r="compat/";if(!e.startsWith(r))return;let o=G.parseIdent(e.slice(r.length)),a=Bme.get(o.identHash)?.();return typeof a<"u"?a:null},reduceDependency:async(t,e,r,o)=>typeof Bme.get(t.identHash)>"u"?t:G.makeDescriptor(t,G.makeRange({protocol:"patch:",source:G.stringifyDescriptor(t),selector:`optional!builtin`,params:null}))}},Bgt=wgt;var a6={};Kt(a6,{ConstraintsCheckCommand:()=>sC,ConstraintsQueryCommand:()=>nC,ConstraintsSourceCommand:()=>iC,default:()=>Jgt});Ke();Ke();j2();var $E=class{constructor(e){this.project=e}createEnvironment(){let e=new ZE(["cwd","ident"]),r=new ZE(["workspace","type","ident"]),o=new ZE(["ident"]),a={manifestUpdates:new Map,reportedErrors:new Map},n=new Map,u=new Map;for(let A of this.project.storedPackages.values()){let p=Array.from(A.peerDependencies.values(),h=>[G.stringifyIdent(h),h.range]);n.set(A.locatorHash,{workspace:null,ident:G.stringifyIdent(A),version:A.version,dependencies:new Map,peerDependencies:new Map(p.filter(([h])=>A.peerDependenciesMeta.get(h)?.optional!==!0)),optionalPeerDependencies:new Map(p.filter(([h])=>A.peerDependenciesMeta.get(h)?.optional===!0))})}for(let A of this.project.storedPackages.values()){let p=n.get(A.locatorHash);p.dependencies=new Map(Array.from(A.dependencies.values(),h=>{let E=this.project.storedResolutions.get(h.descriptorHash);if(typeof E>"u")throw new Error("Assertion failed: The resolution should have been registered");let w=n.get(E);if(typeof w>"u")throw new Error("Assertion failed: The package should have been registered");return[G.stringifyIdent(h),w]})),p.dependencies.delete(p.ident)}for(let A of this.project.workspaces){let p=G.stringifyIdent(A.anchoredLocator),h=A.manifest.exportTo({}),E=n.get(A.anchoredLocator.locatorHash);if(typeof E>"u")throw new Error("Assertion failed: The package should have been registered");let w=(T,N,{caller:U=Xi.getCaller()}={})=>{let z=q2(T),te=qe.getMapWithDefault(a.manifestUpdates,A.cwd),le=qe.getMapWithDefault(te,z),ce=qe.getSetWithDefault(le,N);U!==null&&ce.add(U)},D=T=>w(T,void 0,{caller:Xi.getCaller()}),b=T=>{qe.getArrayWithDefault(a.reportedErrors,A.cwd).push(T)},C=e.insert({cwd:A.relativeCwd,ident:p,manifest:h,pkg:E,set:w,unset:D,error:b});u.set(A,C);for(let T of _t.allDependencies)for(let N of A.manifest[T].values()){let U=G.stringifyIdent(N),z=()=>{w([T,U],void 0,{caller:Xi.getCaller()})},te=ce=>{w([T,U],ce,{caller:Xi.getCaller()})},le=null;if(T!=="peerDependencies"&&(T!=="dependencies"||!A.manifest.devDependencies.has(N.identHash))){let ce=A.anchoredPackage.dependencies.get(N.identHash);if(ce){if(typeof ce>"u")throw new Error("Assertion failed: The dependency should have been registered");let ue=this.project.storedResolutions.get(ce.descriptorHash);if(typeof ue>"u")throw new Error("Assertion failed: The resolution should have been registered");let Ie=n.get(ue);if(typeof Ie>"u")throw new Error("Assertion failed: The package should have been registered");le=Ie}}r.insert({workspace:C,ident:U,range:N.range,type:T,resolution:le,update:te,delete:z,error:b})}}for(let A of this.project.storedPackages.values()){let p=this.project.tryWorkspaceByLocator(A);if(!p)continue;let h=u.get(p);if(typeof h>"u")throw new Error("Assertion failed: The workspace should have been registered");let E=n.get(A.locatorHash);if(typeof E>"u")throw new Error("Assertion failed: The package should have been registered");E.workspace=h}return{workspaces:e,dependencies:r,packages:o,result:a}}async process(){let e=this.createEnvironment(),r={Yarn:{workspace:a=>e.workspaces.find(a)[0]??null,workspaces:a=>e.workspaces.find(a),dependency:a=>e.dependencies.find(a)[0]??null,dependencies:a=>e.dependencies.find(a),package:a=>e.packages.find(a)[0]??null,packages:a=>e.packages.find(a)}},o=await this.project.loadUserConfig();return o?.constraints?(await o.constraints(r),e.result):null}};Ke();Ke();Gt();var nC=class extends ut{constructor(){super(...arguments);this.json=de.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.query=de.String()}static{this.paths=[["constraints","query"]]}static{this.usage=st.Usage({category:"Constraints-related commands",description:"query the constraints fact database",details:` This command will output all matches to the given prolog query. `,examples:[["List all dependencies throughout the workspace","yarn constraints query 'workspace_has_dependency(_, DependencyName, _, _).'"]]})}async execute(){let{Constraints:r}=await Promise.resolve().then(()=>(K2(),Y2)),o=await Je.find(this.context.cwd,this.context.plugins),{project:a}=await Qt.find(o,this.context.cwd),n=await r.find(a),u=this.query;return u.endsWith(".")||(u=`${u}.`),(await Lt.start({configuration:o,json:this.json,stdout:this.context.stdout},async p=>{for await(let h of n.query(u)){let E=Array.from(Object.entries(h)),w=E.length,D=E.reduce((b,[C])=>Math.max(b,C.length),0);for(let b=0;b(K2(),Y2)),o=await Je.find(this.context.cwd,this.context.plugins),{project:a}=await Qt.find(o,this.context.cwd),n=await r.find(a);this.context.stdout.write(this.verbose?n.fullSource:n.source)}};Ke();Ke();Gt();j2();var sC=class extends ut{constructor(){super(...arguments);this.fix=de.Boolean("--fix",!1,{description:"Attempt to automatically fix unambiguous issues, following a multi-pass process"});this.json=de.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}static{this.paths=[["constraints"]]}static{this.usage=st.Usage({category:"Constraints-related commands",description:"check that the project constraints are met",details:` This command will run constraints on your project and emit errors for each one that is found but isn't met. If any error is emitted the process will exit with a non-zero exit code. If the \`--fix\` flag is used, Yarn will attempt to automatically fix the issues the best it can, following a multi-pass process (with a maximum of 10 iterations). Some ambiguous patterns cannot be autofixed, in which case you'll have to manually specify the right resolution. For more information as to how to write constraints, please consult our dedicated page on our website: https://yarnpkg.com/features/constraints. `,examples:[["Check that all constraints are satisfied","yarn constraints"],["Autofix all unmet constraints","yarn constraints --fix"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:o}=await Qt.find(r,this.context.cwd);await o.restoreInstallState();let a=await o.loadUserConfig(),n;if(a?.constraints)n=new $E(o);else{let{Constraints:h}=await Promise.resolve().then(()=>(K2(),Y2));n=await h.find(o)}let u,A=!1,p=!1;for(let h=this.fix?10:1;h>0;--h){let E=await n.process();if(!E)break;let{changedWorkspaces:w,remainingErrors:D}=Vk(o,E,{fix:this.fix}),b=[];for(let[C,T]of w){let N=C.manifest.indent;C.manifest=new _t,C.manifest.indent=N,C.manifest.load(T),b.push(C.persistManifest())}if(await Promise.all(b),!(w.size>0&&h>1)){u=kme(D,{configuration:r}),A=!1,p=!0;for(let[,C]of D)for(let T of C)T.fixable?A=!0:p=!1}}if(u.children.length===0)return 0;if(A){let h=p?`Those errors can all be fixed by running ${pe.pretty(r,"yarn constraints --fix",pe.Type.CODE)}`:`Errors prefixed by '\u2699' can be fixed by running ${pe.pretty(r,"yarn constraints --fix",pe.Type.CODE)}`;await Lt.start({configuration:r,stdout:this.context.stdout,includeNames:!1,includeFooter:!1},async E=>{E.reportInfo(0,h),E.reportSeparator()})}return u.children=qe.sortMap(u.children,h=>h.value[1]),As.emitTree(u,{configuration:r,stdout:this.context.stdout,json:this.json,separators:1}),1}};j2();var zgt={configuration:{enableConstraintsChecks:{description:"If true, constraints will run during installs",type:"BOOLEAN",default:!1},constraintsPath:{description:"The path of the constraints file.",type:"ABSOLUTE_PATH",default:"./constraints.pro"}},commands:[nC,iC,sC],hooks:{async validateProjectAfterInstall(t,{reportError:e}){if(!t.configuration.get("enableConstraintsChecks"))return;let r=await t.loadUserConfig(),o;if(r?.constraints)o=new $E(t);else{let{Constraints:u}=await Promise.resolve().then(()=>(K2(),Y2));o=await u.find(t)}let a=await o.process();if(!a)return;let{remainingErrors:n}=Vk(t,a);if(n.size!==0)if(t.configuration.isCI)for(let[u,A]of n)for(let p of A)e(84,`${pe.pretty(t.configuration,u.anchoredLocator,pe.Type.IDENT)}: ${p.text}`);else e(84,`Constraint check failed; run ${pe.pretty(t.configuration,"yarn constraints",pe.Type.CODE)} for more details`)}}},Jgt=zgt;var l6={};Kt(l6,{CreateCommand:()=>oC,DlxCommand:()=>aC,default:()=>Zgt});Ke();Gt();var oC=class extends ut{constructor(){super(...arguments);this.pkg=de.String("-p,--package",{description:"The package to run the provided command from"});this.quiet=de.Boolean("-q,--quiet",!1,{description:"Only report critical errors instead of printing the full install logs"});this.command=de.String();this.args=de.Proxy()}static{this.paths=[["create"]]}async execute(){let r=[];this.pkg&&r.push("--package",this.pkg),this.quiet&&r.push("--quiet");let o=this.command.replace(/^(@[^@/]+)(@|$)/,"$1/create$2"),a=G.parseDescriptor(o),n=a.name.match(/^create(-|$)/)?a:a.scope?G.makeIdent(a.scope,`create-${a.name}`):G.makeIdent(null,`create-${a.name}`),u=G.stringifyIdent(n);return a.range!=="unknown"&&(u+=`@${a.range}`),this.cli.run(["dlx",...r,u,...this.args])}};Ke();Ke();Pt();Gt();var aC=class extends ut{constructor(){super(...arguments);this.packages=de.Array("-p,--package",{description:"The package(s) to install before running the command"});this.quiet=de.Boolean("-q,--quiet",!1,{description:"Only report critical errors instead of printing the full install logs"});this.command=de.String();this.args=de.Proxy()}static{this.paths=[["dlx"]]}static{this.usage=st.Usage({description:"run a package in a temporary environment",details:"\n This command will install a package within a temporary environment, and run its binary script if it contains any. The binary will run within the current cwd.\n\n By default Yarn will download the package named `command`, but this can be changed through the use of the `-p,--package` flag which will instruct Yarn to still run the same command but from a different package.\n\n Using `yarn dlx` as a replacement of `yarn add` isn't recommended, as it makes your project non-deterministic (Yarn doesn't keep track of the packages installed through `dlx` - neither their name, nor their version).\n ",examples:[["Use create-react-app to create a new React app","yarn dlx create-react-app ./my-app"],["Install multiple packages for a single command",`yarn dlx -p typescript -p ts-node ts-node --transpile-only -e "console.log('hello!')"`]]})}async execute(){return Je.telemetry=null,await ae.mktempPromise(async r=>{let o=K.join(r,`dlx-${process.pid}`);await ae.mkdirPromise(o),await ae.writeFilePromise(K.join(o,"package.json"),`{} `),await ae.writeFilePromise(K.join(o,"yarn.lock"),"");let a=K.join(o,".yarnrc.yml"),n=await Je.findProjectCwd(this.context.cwd),A={enableGlobalCache:!(await Je.find(this.context.cwd,null,{strict:!1})).get("enableGlobalCache"),enableTelemetry:!1,logFilters:[{code:zu(68),level:pe.LogLevel.Discard}]},p=n!==null?K.join(n,".yarnrc.yml"):null;p!==null&&ae.existsSync(p)?(await ae.copyFilePromise(p,a),await Je.updateConfiguration(o,N=>{let U=qe.toMerged(N,A);return Array.isArray(N.plugins)&&(U.plugins=N.plugins.map(z=>{let te=typeof z=="string"?z:z.path,le=Ae.isAbsolute(te)?te:Ae.resolve(Ae.fromPortablePath(n),te);return typeof z=="string"?le:{path:le,spec:z.spec}})),U})):await ae.writeJsonPromise(a,A);let h=this.packages??[this.command],E=G.parseDescriptor(this.command).name,w=await this.cli.run(["add","--fixed","--",...h],{cwd:o,quiet:this.quiet});if(w!==0)return w;this.quiet||this.context.stdout.write(` `);let D=await Je.find(o,this.context.plugins),{project:b,workspace:C}=await Qt.find(D,o);if(C===null)throw new or(b.cwd,o);await b.restoreInstallState();let T=await hn.getWorkspaceAccessibleBinaries(C);return T.has(E)===!1&&T.size===1&&typeof this.packages>"u"&&(E=Array.from(T)[0][0]),await hn.executeWorkspaceAccessibleBinary(C,E,this.args,{packageAccessibleBinaries:T,cwd:this.context.cwd,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr})})}};var Xgt={commands:[oC,aC]},Zgt=Xgt;var A6={};Kt(A6,{ExecFetcher:()=>z2,ExecResolver:()=>J2,default:()=>tdt,execUtils:()=>Zk});Ke();Ke();Pt();var hA="exec:";var Zk={};Kt(Zk,{loadGeneratorFile:()=>V2,makeLocator:()=>u6,makeSpec:()=>rye,parseSpec:()=>c6});Ke();Pt();function c6(t){let{params:e,selector:r}=G.parseRange(t),o=Ae.toPortablePath(r);return{parentLocator:e&&typeof e.locator=="string"?G.parseLocator(e.locator):null,path:o}}function rye({parentLocator:t,path:e,generatorHash:r,protocol:o}){let a=t!==null?{locator:G.stringifyLocator(t)}:{},n=typeof r<"u"?{hash:r}:{};return G.makeRange({protocol:o,source:e,selector:e,params:{...n,...a}})}function u6(t,{parentLocator:e,path:r,generatorHash:o,protocol:a}){return G.makeLocator(t,rye({parentLocator:e,path:r,generatorHash:o,protocol:a}))}async function V2(t,e,r){let{parentLocator:o,path:a}=G.parseFileStyleRange(t,{protocol:e}),n=K.isAbsolute(a)?{packageFs:new En(Bt.root),prefixPath:Bt.dot,localPath:Bt.root}:await r.fetcher.fetch(o,r),u=n.localPath?{packageFs:new En(Bt.root),prefixPath:K.relative(Bt.root,n.localPath)}:n;n!==u&&n.releaseFs&&n.releaseFs();let A=u.packageFs,p=K.join(u.prefixPath,a);return await A.readFilePromise(p,"utf8")}var z2=class{supports(e,r){return!!e.reference.startsWith(hA)}getLocalPath(e,r){let{parentLocator:o,path:a}=G.parseFileStyleRange(e.reference,{protocol:hA});if(K.isAbsolute(a))return a;let n=r.fetcher.getLocalPath(o,r);return n===null?null:K.resolve(n,a)}async fetch(e,r){let o=r.checksums.get(e.locatorHash)||null,[a,n,u]=await r.cache.fetchPackageFromCache(e,o,{onHit:()=>r.report.reportCacheHit(e),onMiss:()=>r.report.reportCacheMiss(e),loader:()=>this.fetchFromDisk(e,r),...r.cacheOptions});return{packageFs:a,releaseFs:n,prefixPath:G.getIdentVendorPath(e),localPath:this.getLocalPath(e,r),checksum:u}}async fetchFromDisk(e,r){let o=await V2(e.reference,hA,r);return ae.mktempPromise(async a=>{let n=K.join(a,"generator.js");return await ae.writeFilePromise(n,o),ae.mktempPromise(async u=>{if(await this.generatePackage(u,e,n,r),!ae.existsSync(K.join(u,"build")))throw new Error("The script should have generated a build directory");return await $i.makeArchiveFromDirectory(K.join(u,"build"),{prefixPath:G.getIdentVendorPath(e),compressionLevel:r.project.configuration.get("compressionLevel")})})})}async generatePackage(e,r,o,a){return await ae.mktempPromise(async n=>{let u=await hn.makeScriptEnv({project:a.project,binFolder:n}),A=K.join(e,"runtime.js");return await ae.mktempPromise(async p=>{let h=K.join(p,"buildfile.log"),E=K.join(e,"generator"),w=K.join(e,"build");await ae.mkdirPromise(E),await ae.mkdirPromise(w);let D={tempDir:Ae.fromPortablePath(E),buildDir:Ae.fromPortablePath(w),locator:G.stringifyLocator(r)};await ae.writeFilePromise(A,` // Expose 'Module' as a global variable Object.defineProperty(global, 'Module', { get: () => require('module'), configurable: true, enumerable: false, }); // Expose non-hidden built-in modules as global variables for (const name of Module.builtinModules.filter((name) => name !== 'module' && !name.startsWith('_'))) { Object.defineProperty(global, name, { get: () => require(name), configurable: true, enumerable: false, }); } // Expose the 'execEnv' global variable Object.defineProperty(global, 'execEnv', { value: { ...${JSON.stringify(D)}, }, enumerable: true, }); `);let b=u.NODE_OPTIONS||"",C=/\s*--require\s+\S*\.pnp\.c?js\s*/g;b=b.replace(C," ").trim(),u.NODE_OPTIONS=b;let{stdout:T,stderr:N}=a.project.configuration.getSubprocessStreams(h,{header:`# This file contains the result of Yarn generating a package (${G.stringifyLocator(r)}) `,prefix:G.prettyLocator(a.project.configuration,r),report:a.report}),{code:U}=await Hr.pipevp(process.execPath,["--require",Ae.fromPortablePath(A),Ae.fromPortablePath(o),G.stringifyIdent(r)],{cwd:e,env:u,stdin:null,stdout:T,stderr:N});if(U!==0)throw ae.detachTemp(p),new Error(`Package generation failed (exit code ${U}, logs can be found here: ${pe.pretty(a.project.configuration,h,pe.Type.PATH)})`)})})}};Ke();Ke();var $gt=2,J2=class{supportsDescriptor(e,r){return!!e.range.startsWith(hA)}supportsLocator(e,r){return!!e.reference.startsWith(hA)}shouldPersistResolution(e,r){return!1}bindDescriptor(e,r,o){return G.bindDescriptor(e,{locator:G.stringifyLocator(r)})}getResolutionDependencies(e,r){return{}}async getCandidates(e,r,o){if(!o.fetchOptions)throw new Error("Assertion failed: This resolver cannot be used unless a fetcher is configured");let{path:a,parentLocator:n}=c6(e.range);if(n===null)throw new Error("Assertion failed: The descriptor should have been bound");let u=await V2(G.makeRange({protocol:hA,source:a,selector:a,params:{locator:G.stringifyLocator(n)}}),hA,o.fetchOptions),A=bn.makeHash(`${$gt}`,u).slice(0,6);return[u6(e,{parentLocator:n,path:a,generatorHash:A,protocol:hA})]}async getSatisfying(e,r,o,a){let[n]=await this.getCandidates(e,r,a);return{locators:o.filter(u=>u.locatorHash===n.locatorHash),sorted:!1}}async resolve(e,r){if(!r.fetchOptions)throw new Error("Assertion failed: This resolver cannot be used unless a fetcher is configured");let o=await r.fetchOptions.fetcher.fetch(e,r.fetchOptions),a=await qe.releaseAfterUseAsync(async()=>await _t.find(o.prefixPath,{baseFs:o.packageFs}),o.releaseFs);return{...e,version:a.version||"0.0.0",languageName:a.languageName||r.project.configuration.get("defaultLanguageName"),linkType:"HARD",conditions:a.getConditions(),dependencies:r.project.configuration.normalizeDependencyMap(a.dependencies),peerDependencies:a.peerDependencies,dependenciesMeta:a.dependenciesMeta,peerDependenciesMeta:a.peerDependenciesMeta,bin:a.bin}}};var edt={fetchers:[z2],resolvers:[J2]},tdt=edt;var p6={};Kt(p6,{FileFetcher:()=>eB,FileResolver:()=>tB,TarballFileFetcher:()=>rB,TarballFileResolver:()=>nB,default:()=>idt,fileUtils:()=>$g});Ke();Pt();var lC=/^(?:[a-zA-Z]:[\\/]|\.{0,2}\/)/,X2=/^[^?]*\.(?:tar\.gz|tgz)(?:::.*)?$/,_i="file:";var $g={};Kt($g,{fetchArchiveFromLocator:()=>$2,makeArchiveFromLocator:()=>$k,makeBufferFromLocator:()=>f6,makeLocator:()=>cC,makeSpec:()=>nye,parseSpec:()=>Z2});Ke();Pt();function Z2(t){let{params:e,selector:r}=G.parseRange(t),o=Ae.toPortablePath(r);return{parentLocator:e&&typeof e.locator=="string"?G.parseLocator(e.locator):null,path:o}}function nye({parentLocator:t,path:e,hash:r,protocol:o}){let a=t!==null?{locator:G.stringifyLocator(t)}:{},n=typeof r<"u"?{hash:r}:{};return G.makeRange({protocol:o,source:e,selector:e,params:{...n,...a}})}function cC(t,{parentLocator:e,path:r,hash:o,protocol:a}){return G.makeLocator(t,nye({parentLocator:e,path:r,hash:o,protocol:a}))}async function $2(t,e){let{parentLocator:r,path:o}=G.parseFileStyleRange(t.reference,{protocol:_i}),a=K.isAbsolute(o)?{packageFs:new En(Bt.root),prefixPath:Bt.dot,localPath:Bt.root}:await e.fetcher.fetch(r,e),n=a.localPath?{packageFs:new En(Bt.root),prefixPath:K.relative(Bt.root,a.localPath)}:a;a!==n&&a.releaseFs&&a.releaseFs();let u=n.packageFs,A=K.join(n.prefixPath,o);return await qe.releaseAfterUseAsync(async()=>await u.readFilePromise(A),n.releaseFs)}async function $k(t,{protocol:e,fetchOptions:r,inMemory:o=!1}){let{parentLocator:a,path:n}=G.parseFileStyleRange(t.reference,{protocol:e}),u=K.isAbsolute(n)?{packageFs:new En(Bt.root),prefixPath:Bt.dot,localPath:Bt.root}:await r.fetcher.fetch(a,r),A=u.localPath?{packageFs:new En(Bt.root),prefixPath:K.relative(Bt.root,u.localPath)}:u;u!==A&&u.releaseFs&&u.releaseFs();let p=A.packageFs,h=K.join(A.prefixPath,n);return await qe.releaseAfterUseAsync(async()=>await $i.makeArchiveFromDirectory(h,{baseFs:p,prefixPath:G.getIdentVendorPath(t),compressionLevel:r.project.configuration.get("compressionLevel"),inMemory:o}),A.releaseFs)}async function f6(t,{protocol:e,fetchOptions:r}){return(await $k(t,{protocol:e,fetchOptions:r,inMemory:!0})).getBufferAndClose()}var eB=class{supports(e,r){return!!e.reference.startsWith(_i)}getLocalPath(e,r){let{parentLocator:o,path:a}=G.parseFileStyleRange(e.reference,{protocol:_i});if(K.isAbsolute(a))return a;let n=r.fetcher.getLocalPath(o,r);return n===null?null:K.resolve(n,a)}async fetch(e,r){let o=r.checksums.get(e.locatorHash)||null,[a,n,u]=await r.cache.fetchPackageFromCache(e,o,{onHit:()=>r.report.reportCacheHit(e),onMiss:()=>r.report.reportCacheMiss(e,`${G.prettyLocator(r.project.configuration,e)} can't be found in the cache and will be fetched from the disk`),loader:()=>this.fetchFromDisk(e,r),...r.cacheOptions});return{packageFs:a,releaseFs:n,prefixPath:G.getIdentVendorPath(e),localPath:this.getLocalPath(e,r),checksum:u}}async fetchFromDisk(e,r){return $k(e,{protocol:_i,fetchOptions:r})}};Ke();Ke();var rdt=2,tB=class{supportsDescriptor(e,r){return e.range.match(lC)?!0:!!e.range.startsWith(_i)}supportsLocator(e,r){return!!e.reference.startsWith(_i)}shouldPersistResolution(e,r){return!1}bindDescriptor(e,r,o){return lC.test(e.range)&&(e=G.makeDescriptor(e,`${_i}${e.range}`)),G.bindDescriptor(e,{locator:G.stringifyLocator(r)})}getResolutionDependencies(e,r){return{}}async getCandidates(e,r,o){if(!o.fetchOptions)throw new Error("Assertion failed: This resolver cannot be used unless a fetcher is configured");let{path:a,parentLocator:n}=Z2(e.range);if(n===null)throw new Error("Assertion failed: The descriptor should have been bound");let u=await f6(G.makeLocator(e,G.makeRange({protocol:_i,source:a,selector:a,params:{locator:G.stringifyLocator(n)}})),{protocol:_i,fetchOptions:o.fetchOptions}),A=bn.makeHash(`${rdt}`,u).slice(0,6);return[cC(e,{parentLocator:n,path:a,hash:A,protocol:_i})]}async getSatisfying(e,r,o,a){let[n]=await this.getCandidates(e,r,a);return{locators:o.filter(u=>u.locatorHash===n.locatorHash),sorted:!1}}async resolve(e,r){if(!r.fetchOptions)throw new Error("Assertion failed: This resolver cannot be used unless a fetcher is configured");let o=await r.fetchOptions.fetcher.fetch(e,r.fetchOptions),a=await qe.releaseAfterUseAsync(async()=>await _t.find(o.prefixPath,{baseFs:o.packageFs}),o.releaseFs);return{...e,version:a.version||"0.0.0",languageName:a.languageName||r.project.configuration.get("defaultLanguageName"),linkType:"HARD",conditions:a.getConditions(),dependencies:r.project.configuration.normalizeDependencyMap(a.dependencies),peerDependencies:a.peerDependencies,dependenciesMeta:a.dependenciesMeta,peerDependenciesMeta:a.peerDependenciesMeta,bin:a.bin}}};Ke();var rB=class{supports(e,r){return X2.test(e.reference)?!!e.reference.startsWith(_i):!1}getLocalPath(e,r){return null}async fetch(e,r){let o=r.checksums.get(e.locatorHash)||null,[a,n,u]=await r.cache.fetchPackageFromCache(e,o,{onHit:()=>r.report.reportCacheHit(e),onMiss:()=>r.report.reportCacheMiss(e,`${G.prettyLocator(r.project.configuration,e)} can't be found in the cache and will be fetched from the disk`),loader:()=>this.fetchFromDisk(e,r),...r.cacheOptions});return{packageFs:a,releaseFs:n,prefixPath:G.getIdentVendorPath(e),checksum:u}}async fetchFromDisk(e,r){let o=await $2(e,r);return await $i.convertToZip(o,{configuration:r.project.configuration,prefixPath:G.getIdentVendorPath(e),stripComponents:1})}};Ke();Ke();Ke();var nB=class{supportsDescriptor(e,r){return X2.test(e.range)?!!(e.range.startsWith(_i)||lC.test(e.range)):!1}supportsLocator(e,r){return X2.test(e.reference)?!!e.reference.startsWith(_i):!1}shouldPersistResolution(e,r){return!1}bindDescriptor(e,r,o){return lC.test(e.range)&&(e=G.makeDescriptor(e,`${_i}${e.range}`)),G.bindDescriptor(e,{locator:G.stringifyLocator(r)})}getResolutionDependencies(e,r){return{}}async getCandidates(e,r,o){if(!o.fetchOptions)throw new Error("Assertion failed: This resolver cannot be used unless a fetcher is configured");let{path:a,parentLocator:n}=Z2(e.range);if(n===null)throw new Error("Assertion failed: The descriptor should have been bound");let u=cC(e,{parentLocator:n,path:a,hash:"",protocol:_i}),A=await $2(u,o.fetchOptions),p=bn.makeHash(A).slice(0,6);return[cC(e,{parentLocator:n,path:a,hash:p,protocol:_i})]}async getSatisfying(e,r,o,a){let[n]=await this.getCandidates(e,r,a);return{locators:o.filter(u=>u.locatorHash===n.locatorHash),sorted:!1}}async resolve(e,r){if(!r.fetchOptions)throw new Error("Assertion failed: This resolver cannot be used unless a fetcher is configured");let o=await r.fetchOptions.fetcher.fetch(e,r.fetchOptions),a=await qe.releaseAfterUseAsync(async()=>await _t.find(o.prefixPath,{baseFs:o.packageFs}),o.releaseFs);return{...e,version:a.version||"0.0.0",languageName:a.languageName||r.project.configuration.get("defaultLanguageName"),linkType:"HARD",conditions:a.getConditions(),dependencies:r.project.configuration.normalizeDependencyMap(a.dependencies),peerDependencies:a.peerDependencies,dependenciesMeta:a.dependenciesMeta,peerDependenciesMeta:a.peerDependenciesMeta,bin:a.bin}}};var ndt={fetchers:[rB,eB],resolvers:[nB,tB]},idt=ndt;var d6={};Kt(d6,{GithubFetcher:()=>iB,default:()=>odt,githubUtils:()=>eQ});Ke();Pt();var eQ={};Kt(eQ,{invalidGithubUrlMessage:()=>oye,isGithubUrl:()=>h6,parseGithubUrl:()=>g6});var iye=et(ve("querystring")),sye=[/^https?:\/\/(?:([^/]+?)@)?github.com\/([^/#]+)\/([^/#]+)\/tarball\/([^/#]+)(?:#(.*))?$/,/^https?:\/\/(?:([^/]+?)@)?github.com\/([^/#]+)\/([^/#]+?)(?:\.git)?(?:#(.*))?$/];function h6(t){return t?sye.some(e=>!!t.match(e)):!1}function g6(t){let e;for(let A of sye)if(e=t.match(A),e)break;if(!e)throw new Error(oye(t));let[,r,o,a,n="master"]=e,{commit:u}=iye.default.parse(n);return n=u||n.replace(/[^:]*:/,""),{auth:r,username:o,reponame:a,treeish:n}}function oye(t){return`Input cannot be parsed as a valid GitHub URL ('${t}').`}var iB=class{supports(e,r){return!!h6(e.reference)}getLocalPath(e,r){return null}async fetch(e,r){let o=r.checksums.get(e.locatorHash)||null,[a,n,u]=await r.cache.fetchPackageFromCache(e,o,{onHit:()=>r.report.reportCacheHit(e),onMiss:()=>r.report.reportCacheMiss(e,`${G.prettyLocator(r.project.configuration,e)} can't be found in the cache and will be fetched from GitHub`),loader:()=>this.fetchFromNetwork(e,r),...r.cacheOptions});return{packageFs:a,releaseFs:n,prefixPath:G.getIdentVendorPath(e),checksum:u}}async fetchFromNetwork(e,r){let o=await on.get(this.getLocatorUrl(e,r),{configuration:r.project.configuration});return await ae.mktempPromise(async a=>{let n=new En(a);await $i.extractArchiveTo(o,n,{stripComponents:1});let u=ra.splitRepoUrl(e.reference),A=K.join(a,"package.tgz");await hn.prepareExternalProject(a,A,{configuration:r.project.configuration,report:r.report,workspace:u.extra.workspace,locator:e});let p=await ae.readFilePromise(A);return await $i.convertToZip(p,{configuration:r.project.configuration,prefixPath:G.getIdentVendorPath(e),stripComponents:1})})}getLocatorUrl(e,r){let{auth:o,username:a,reponame:n,treeish:u}=g6(e.reference);return`https://${o?`${o}@`:""}github.com/${a}/${n}/archive/${u}.tar.gz`}};var sdt={hooks:{async fetchHostedRepository(t,e,r){if(t!==null)return t;let o=new iB;if(!o.supports(e,r))return null;try{return await o.fetch(e,r)}catch{return null}}}},odt=sdt;var m6={};Kt(m6,{TarballHttpFetcher:()=>oB,TarballHttpResolver:()=>aB,default:()=>ldt});Ke();function sB(t){let e;try{e=new URL(t)}catch{return!1}return!(e.protocol!=="http:"&&e.protocol!=="https:"||!e.pathname.match(/(\.tar\.gz|\.tgz|\/[^.]+)$/))}var oB=class{supports(e,r){return sB(e.reference)}getLocalPath(e,r){return null}async fetch(e,r){let o=r.checksums.get(e.locatorHash)||null,[a,n,u]=await r.cache.fetchPackageFromCache(e,o,{onHit:()=>r.report.reportCacheHit(e),onMiss:()=>r.report.reportCacheMiss(e,`${G.prettyLocator(r.project.configuration,e)} can't be found in the cache and will be fetched from the remote server`),loader:()=>this.fetchFromNetwork(e,r),...r.cacheOptions});return{packageFs:a,releaseFs:n,prefixPath:G.getIdentVendorPath(e),checksum:u}}async fetchFromNetwork(e,r){let o=await on.get(e.reference,{configuration:r.project.configuration});return await $i.convertToZip(o,{configuration:r.project.configuration,prefixPath:G.getIdentVendorPath(e),stripComponents:1})}};Ke();Ke();var aB=class{supportsDescriptor(e,r){return sB(e.range)}supportsLocator(e,r){return sB(e.reference)}shouldPersistResolution(e,r){return!0}bindDescriptor(e,r,o){return e}getResolutionDependencies(e,r){return{}}async getCandidates(e,r,o){return[G.convertDescriptorToLocator(e)]}async getSatisfying(e,r,o,a){let[n]=await this.getCandidates(e,r,a);return{locators:o.filter(u=>u.locatorHash===n.locatorHash),sorted:!1}}async resolve(e,r){if(!r.fetchOptions)throw new Error("Assertion failed: This resolver cannot be used unless a fetcher is configured");let o=await r.fetchOptions.fetcher.fetch(e,r.fetchOptions),a=await qe.releaseAfterUseAsync(async()=>await _t.find(o.prefixPath,{baseFs:o.packageFs}),o.releaseFs);return{...e,version:a.version||"0.0.0",languageName:a.languageName||r.project.configuration.get("defaultLanguageName"),linkType:"HARD",conditions:a.getConditions(),dependencies:r.project.configuration.normalizeDependencyMap(a.dependencies),peerDependencies:a.peerDependencies,dependenciesMeta:a.dependenciesMeta,peerDependenciesMeta:a.peerDependenciesMeta,bin:a.bin}}};var adt={fetchers:[oB],resolvers:[aB]},ldt=adt;var y6={};Kt(y6,{InitCommand:()=>uC,default:()=>udt});Ke();Ke();Pt();Gt();var uC=class extends ut{constructor(){super(...arguments);this.private=de.Boolean("-p,--private",!1,{description:"Initialize a private package"});this.workspace=de.Boolean("-w,--workspace",!1,{description:"Initialize a workspace root with a `packages/` directory"});this.install=de.String("-i,--install",!1,{tolerateBoolean:!0,description:"Initialize a package with a specific bundle that will be locked in the project"});this.name=de.String("-n,--name",{description:"Initialize a package with the given name"});this.usev2=de.Boolean("-2",!1,{hidden:!0});this.yes=de.Boolean("-y,--yes",{hidden:!0})}static{this.paths=[["init"]]}static{this.usage=st.Usage({description:"create a new package",details:"\n This command will setup a new package in your local directory.\n\n If the `-p,--private` or `-w,--workspace` options are set, the package will be private by default.\n\n If the `-w,--workspace` option is set, the package will be configured to accept a set of workspaces in the `packages/` directory.\n\n If the `-i,--install` option is given a value, Yarn will first download it using `yarn set version` and only then forward the init call to the newly downloaded bundle. Without arguments, the downloaded bundle will be `latest`.\n\n The initial settings of the manifest can be changed by using the `initScope` and `initFields` configuration values. Additionally, Yarn will generate an EditorConfig file whose rules can be altered via `initEditorConfig`, and will initialize a Git repository in the current directory.\n ",examples:[["Create a new package in the local directory","yarn init"],["Create a new private package in the local directory","yarn init -p"],["Create a new package and store the Yarn release inside","yarn init -i=latest"],["Create a new private package and defines it as a workspace root","yarn init -w"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),o=typeof this.install=="string"?this.install:this.usev2||this.install===!0?"latest":null;return o!==null?await this.executeProxy(r,o):await this.executeRegular(r)}async executeProxy(r,o){if(r.projectCwd!==null&&r.projectCwd!==this.context.cwd)throw new ot("Cannot use the --install flag from within a project subdirectory");ae.existsSync(this.context.cwd)||await ae.mkdirPromise(this.context.cwd,{recursive:!0});let a=K.join(this.context.cwd,mr.lockfile);ae.existsSync(a)||await ae.writeFilePromise(a,"");let n=await this.cli.run(["set","version",o],{quiet:!0});if(n!==0)return n;let u=[];return this.private&&u.push("-p"),this.workspace&&u.push("-w"),this.name&&u.push(`-n=${this.name}`),this.yes&&u.push("-y"),await ae.mktempPromise(async A=>{let{code:p}=await Hr.pipevp("yarn",["init",...u],{cwd:this.context.cwd,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr,env:await hn.makeScriptEnv({binFolder:A})});return p})}async executeRegular(r){let o=null;try{o=(await Qt.find(r,this.context.cwd)).project}catch{o=null}ae.existsSync(this.context.cwd)||await ae.mkdirPromise(this.context.cwd,{recursive:!0});let a=await _t.tryFind(this.context.cwd),n=a??new _t,u=Object.fromEntries(r.get("initFields").entries());n.load(u),n.name=n.name??G.makeIdent(r.get("initScope"),this.name??K.basename(this.context.cwd)),n.packageManager=nn&&qe.isTaggedYarnVersion(nn)?`yarn@${nn}`:null,(!a&&this.workspace||this.private)&&(n.private=!0),this.workspace&&n.workspaceDefinitions.length===0&&(await ae.mkdirPromise(K.join(this.context.cwd,"packages"),{recursive:!0}),n.workspaceDefinitions=[{pattern:"packages/*"}]);let A={};n.exportTo(A);let p=K.join(this.context.cwd,_t.fileName);await ae.changeFilePromise(p,`${JSON.stringify(A,null,2)} `,{automaticNewlines:!0});let h=[p],E=K.join(this.context.cwd,"README.md");if(ae.existsSync(E)||(await ae.writeFilePromise(E,`# ${G.stringifyIdent(n.name)} `),h.push(E)),!o||o.cwd===this.context.cwd){let w=K.join(this.context.cwd,mr.lockfile);ae.existsSync(w)||(await ae.writeFilePromise(w,""),h.push(w));let b=[".yarn/*","!.yarn/patches","!.yarn/plugins","!.yarn/releases","!.yarn/sdks","!.yarn/versions","","# Swap the comments on the following lines if you wish to use zero-installs","# In that case, don't forget to run `yarn config set enableGlobalCache false`!","# Documentation here: https://yarnpkg.com/features/caching#zero-installs","","#!.yarn/cache",".pnp.*"].map(ce=>`${ce} `).join(""),C=K.join(this.context.cwd,".gitignore");ae.existsSync(C)||(await ae.writeFilePromise(C,b),h.push(C));let N=["/.yarn/** linguist-vendored","/.yarn/releases/* binary","/.yarn/plugins/**/* binary","/.pnp.* binary linguist-generated"].map(ce=>`${ce} `).join(""),U=K.join(this.context.cwd,".gitattributes");ae.existsSync(U)||(await ae.writeFilePromise(U,N),h.push(U));let z={"*":{endOfLine:"lf",insertFinalNewline:!0},"*.{js,json,yml}":{charset:"utf-8",indentStyle:"space",indentSize:2}};qe.mergeIntoTarget(z,r.get("initEditorConfig"));let te=`root = true `;for(let[ce,ue]of Object.entries(z)){te+=` [${ce}] `;for(let[Ie,he]of Object.entries(ue)){let De=Ie.replace(/[A-Z]/g,Ee=>`_${Ee.toLowerCase()}`);te+=`${De} = ${he} `}}let le=K.join(this.context.cwd,".editorconfig");ae.existsSync(le)||(await ae.writeFilePromise(le,te),h.push(le)),await this.cli.run(["install"],{quiet:!0}),ae.existsSync(K.join(this.context.cwd,".git"))||(await Hr.execvp("git",["init"],{cwd:this.context.cwd}),await Hr.execvp("git",["add","--",...h],{cwd:this.context.cwd}),await Hr.execvp("git",["commit","--allow-empty","-m","First commit"],{cwd:this.context.cwd}))}}};var cdt={configuration:{initScope:{description:"Scope used when creating packages via the init command",type:"STRING",default:null},initFields:{description:"Additional fields to set when creating packages via the init command",type:"MAP",valueDefinition:{description:"",type:"ANY"}},initEditorConfig:{description:"Extra rules to define in the generator editorconfig",type:"MAP",valueDefinition:{description:"",type:"ANY"}}},commands:[uC]},udt=cdt;var mj={};Kt(mj,{SearchCommand:()=>xC,UpgradeInteractiveCommand:()=>bC,default:()=>UIt});Ke();var lye=et(ve("os"));function AC({stdout:t}){if(lye.default.endianness()==="BE")throw new Error("Interactive commands cannot be used on big-endian systems because ink depends on yoga-layout-prebuilt which only supports little-endian architectures");if(!t.isTTY)throw new Error("Interactive commands can only be used inside a TTY environment")}Gt();var CEe=et(N6()),O6={appId:"OFCNCOG2CU",apiKey:"6fe4476ee5a1832882e326b506d14126",indexName:"npm-search"},ayt=(0,CEe.default)(O6.appId,O6.apiKey).initIndex(O6.indexName),M6=async(t,e=0)=>await ayt.search(t,{analyticsTags:["yarn-plugin-interactive-tools"],attributesToRetrieve:["name","version","owner","repository","humanDownloadsLast30Days"],page:e,hitsPerPage:10});var sv=["regular","dev","peer"],xC=class extends ut{static{this.paths=[["search"]]}static{this.usage=st.Usage({category:"Interactive commands",description:"open the search interface",details:` This command opens a fullscreen terminal interface where you can search for and install packages from the npm registry. `,examples:[["Open the search window","yarn search"]]})}async execute(){AC(this.context);let{Gem:e}=await Promise.resolve().then(()=>(UQ(),oj)),{ScrollableItems:r}=await Promise.resolve().then(()=>(jQ(),qQ)),{useKeypress:o}=await Promise.resolve().then(()=>(rv(),bwe)),{useMinistore:a}=await Promise.resolve().then(()=>(fj(),Aj)),{renderForm:n}=await Promise.resolve().then(()=>(KQ(),YQ)),{default:u}=await Promise.resolve().then(()=>et(Uwe())),{Box:A,Text:p}=await Promise.resolve().then(()=>et(ac())),{default:h,useEffect:E,useState:w}=await Promise.resolve().then(()=>et(ln())),D=await Je.find(this.context.cwd,this.context.plugins),b=()=>h.createElement(A,{flexDirection:"row"},h.createElement(A,{flexDirection:"column",width:48},h.createElement(A,null,h.createElement(p,null,"Press ",h.createElement(p,{bold:!0,color:"cyanBright"},""),"/",h.createElement(p,{bold:!0,color:"cyanBright"},"")," to move between packages.")),h.createElement(A,null,h.createElement(p,null,"Press ",h.createElement(p,{bold:!0,color:"cyanBright"},"")," to select a package.")),h.createElement(A,null,h.createElement(p,null,"Press ",h.createElement(p,{bold:!0,color:"cyanBright"},"")," again to change the target."))),h.createElement(A,{flexDirection:"column"},h.createElement(A,{marginLeft:1},h.createElement(p,null,"Press ",h.createElement(p,{bold:!0,color:"cyanBright"},"")," to install the selected packages.")),h.createElement(A,{marginLeft:1},h.createElement(p,null,"Press ",h.createElement(p,{bold:!0,color:"cyanBright"},"")," to abort.")))),C=()=>h.createElement(h.Fragment,null,h.createElement(A,{width:15},h.createElement(p,{bold:!0,underline:!0,color:"gray"},"Owner")),h.createElement(A,{width:11},h.createElement(p,{bold:!0,underline:!0,color:"gray"},"Version")),h.createElement(A,{width:10},h.createElement(p,{bold:!0,underline:!0,color:"gray"},"Downloads"))),T=()=>h.createElement(A,{width:17},h.createElement(p,{bold:!0,underline:!0,color:"gray"},"Target")),N=({hit:he,active:De})=>{let[Ee,g]=a(he.name,null);o({active:De},(fe,ie)=>{if(ie.name!=="space")return;if(!Ee){g(sv[0]);return}let Z=sv.indexOf(Ee)+1;Z===sv.length?g(null):g(sv[Z])},[Ee,g]);let me=G.parseIdent(he.name),Ce=G.prettyIdent(D,me);return h.createElement(A,null,h.createElement(A,{width:45},h.createElement(p,{bold:!0,wrap:"wrap"},Ce)),h.createElement(A,{width:14,marginLeft:1},h.createElement(p,{bold:!0,wrap:"truncate"},he.owner.name)),h.createElement(A,{width:10,marginLeft:1},h.createElement(p,{italic:!0,wrap:"truncate"},he.version)),h.createElement(A,{width:16,marginLeft:1},h.createElement(p,null,he.humanDownloadsLast30Days)))},U=({name:he,active:De})=>{let[Ee]=a(he,null),g=G.parseIdent(he);return h.createElement(A,null,h.createElement(A,{width:47},h.createElement(p,{bold:!0}," - ",G.prettyIdent(D,g))),sv.map(me=>h.createElement(A,{key:me,width:14,marginLeft:1},h.createElement(p,null," ",h.createElement(e,{active:Ee===me})," ",h.createElement(p,{bold:!0},me)))))},z=()=>h.createElement(A,{marginTop:1},h.createElement(p,null,"Powered by Algolia.")),le=await n(({useSubmit:he})=>{let De=a();he(De);let Ee=Array.from(De.keys()).filter(q=>De.get(q)!==null),[g,me]=w(""),[Ce,fe]=w(0),[ie,Z]=w([]),Pe=q=>{q.match(/\t| /)||me(q)},Re=async()=>{fe(0);let q=await M6(g);q.query===g&&Z(q.hits)},ht=async()=>{let q=await M6(g,Ce+1);q.query===g&&q.page-1===Ce&&(fe(q.page),Z([...ie,...q.hits]))};return E(()=>{g?Re():Z([])},[g]),h.createElement(A,{flexDirection:"column"},h.createElement(b,null),h.createElement(A,{flexDirection:"row",marginTop:1},h.createElement(p,{bold:!0},"Search: "),h.createElement(A,{width:41},h.createElement(u,{value:g,onChange:Pe,placeholder:"i.e. babel, webpack, react...",showCursor:!1})),h.createElement(C,null)),ie.length?h.createElement(r,{radius:2,loop:!1,children:ie.map(q=>h.createElement(N,{key:q.name,hit:q,active:!1})),willReachEnd:ht}):h.createElement(p,{color:"gray"},"Start typing..."),h.createElement(A,{flexDirection:"row",marginTop:1},h.createElement(A,{width:49},h.createElement(p,{bold:!0},"Selected:")),h.createElement(T,null)),Ee.length?Ee.map(q=>h.createElement(U,{key:q,name:q,active:!1})):h.createElement(p,{color:"gray"},"No selected packages..."),h.createElement(z,null))},{},{stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr});if(typeof le>"u")return 1;let ce=Array.from(le.keys()).filter(he=>le.get(he)==="regular"),ue=Array.from(le.keys()).filter(he=>le.get(he)==="dev"),Ie=Array.from(le.keys()).filter(he=>le.get(he)==="peer");return ce.length&&await this.cli.run(["add",...ce]),ue.length&&await this.cli.run(["add","--dev",...ue]),Ie&&await this.cli.run(["add","--peer",...Ie]),0}};Ke();Gt();n8();var Ywe=et(ni()),Wwe=/^((?:[\^~]|>=?)?)([0-9]+)(\.[0-9]+)(\.[0-9]+)((?:-\S+)?)$/,Kwe=(t,e)=>t.length>0?[t.slice(0,e)].concat(Kwe(t.slice(e),e)):[],bC=class extends ut{static{this.paths=[["upgrade-interactive"]]}static{this.usage=st.Usage({category:"Interactive commands",description:"open the upgrade interface",details:` This command opens a fullscreen terminal interface where you can see any out of date packages used by your application, their status compared to the latest versions available on the remote registry, and select packages to upgrade. `,examples:[["Open the upgrade window","yarn upgrade-interactive"]]})}async execute(){AC(this.context);let{ItemOptions:e}=await Promise.resolve().then(()=>(Gwe(),jwe)),{Pad:r}=await Promise.resolve().then(()=>(dj(),qwe)),{ScrollableItems:o}=await Promise.resolve().then(()=>(jQ(),qQ)),{useMinistore:a}=await Promise.resolve().then(()=>(fj(),Aj)),{renderForm:n}=await Promise.resolve().then(()=>(KQ(),YQ)),{Box:u,Text:A}=await Promise.resolve().then(()=>et(ac())),{default:p,useEffect:h,useRef:E,useState:w}=await Promise.resolve().then(()=>et(ln())),D=await Je.find(this.context.cwd,this.context.plugins),{project:b,workspace:C}=await Qt.find(D,this.context.cwd),T=await Wr.find(D);if(!C)throw new or(b.cwd,this.context.cwd);await b.restoreInstallState({restoreResolutions:!1});let N=this.context.stdout.rows-7,U=(me,Ce)=>{let fe=$pe(me,Ce),ie="";for(let Z of fe)Z.added?ie+=pe.pretty(D,Z.value,"green"):Z.removed||(ie+=Z.value);return ie},z=(me,Ce)=>{if(me===Ce)return Ce;let fe=G.parseRange(me),ie=G.parseRange(Ce),Z=fe.selector.match(Wwe),Pe=ie.selector.match(Wwe);if(!Z||!Pe)return U(me,Ce);let Re=["gray","red","yellow","green","magenta"],ht=null,q="";for(let nt=1;nt{let ie=await nu.fetchDescriptorFrom(me,fe,{project:b,cache:T,preserveModifier:Ce,workspace:C});return ie!==null?ie.range:me.range},le=async me=>{let Ce=Ywe.default.valid(me.range)?`^${me.range}`:me.range,[fe,ie]=await Promise.all([te(me,me.range,Ce).catch(()=>null),te(me,me.range,"latest").catch(()=>null)]),Z=[{value:null,label:me.range}];return fe&&fe!==me.range?Z.push({value:fe,label:z(me.range,fe)}):Z.push({value:null,label:""}),ie&&ie!==fe&&ie!==me.range?Z.push({value:ie,label:z(me.range,ie)}):Z.push({value:null,label:""}),Z},ce=()=>p.createElement(u,{flexDirection:"row"},p.createElement(u,{flexDirection:"column",width:49},p.createElement(u,{marginLeft:1},p.createElement(A,null,"Press ",p.createElement(A,{bold:!0,color:"cyanBright"},""),"/",p.createElement(A,{bold:!0,color:"cyanBright"},"")," to select packages.")),p.createElement(u,{marginLeft:1},p.createElement(A,null,"Press ",p.createElement(A,{bold:!0,color:"cyanBright"},""),"/",p.createElement(A,{bold:!0,color:"cyanBright"},"")," to select versions."))),p.createElement(u,{flexDirection:"column"},p.createElement(u,{marginLeft:1},p.createElement(A,null,"Press ",p.createElement(A,{bold:!0,color:"cyanBright"},"")," to install.")),p.createElement(u,{marginLeft:1},p.createElement(A,null,"Press ",p.createElement(A,{bold:!0,color:"cyanBright"},"")," to abort.")))),ue=()=>p.createElement(u,{flexDirection:"row",paddingTop:1,paddingBottom:1},p.createElement(u,{width:50},p.createElement(A,{bold:!0},p.createElement(A,{color:"greenBright"},"?")," Pick the packages you want to upgrade.")),p.createElement(u,{width:17},p.createElement(A,{bold:!0,underline:!0,color:"gray"},"Current")),p.createElement(u,{width:17},p.createElement(A,{bold:!0,underline:!0,color:"gray"},"Range")),p.createElement(u,{width:17},p.createElement(A,{bold:!0,underline:!0,color:"gray"},"Latest"))),Ie=({active:me,descriptor:Ce,suggestions:fe})=>{let[ie,Z]=a(Ce.descriptorHash,null),Pe=G.stringifyIdent(Ce),Re=Math.max(0,45-Pe.length);return p.createElement(p.Fragment,null,p.createElement(u,null,p.createElement(u,{width:45},p.createElement(A,{bold:!0},G.prettyIdent(D,Ce)),p.createElement(r,{active:me,length:Re})),p.createElement(e,{active:me,options:fe,value:ie,skewer:!0,onChange:Z,sizes:[17,17,17]})))},he=({dependencies:me})=>{let[Ce,fe]=w(me.map(()=>null)),ie=E(!0),Z=async Pe=>{let Re=await le(Pe);return Re.filter(ht=>ht.label!=="").length<=1?null:{descriptor:Pe,suggestions:Re}};return h(()=>()=>{ie.current=!1},[]),h(()=>{let Pe=Math.trunc(N*1.75),Re=me.slice(0,Pe),ht=me.slice(Pe),q=Kwe(ht,N),nt=Re.map(Z).reduce(async(Le,Te)=>{await Le;let ke=await Te;ke!==null&&ie.current&&fe(Ve=>{let xe=Ve.findIndex(He=>He===null),tt=[...Ve];return tt[xe]=ke,tt})},Promise.resolve());q.reduce((Le,Te)=>Promise.all(Te.map(ke=>Promise.resolve().then(()=>Z(ke)))).then(async ke=>{ke=ke.filter(Ve=>Ve!==null),await Le,ie.current&&fe(Ve=>{let xe=Ve.findIndex(tt=>tt===null);return Ve.slice(0,xe).concat(ke).concat(Ve.slice(xe+ke.length))})}),nt).then(()=>{ie.current&&fe(Le=>Le.filter(Te=>Te!==null))})},[]),Ce.length?p.createElement(o,{radius:N>>1,children:Ce.map((Pe,Re)=>Pe!==null?p.createElement(Ie,{key:Re,active:!1,descriptor:Pe.descriptor,suggestions:Pe.suggestions}):p.createElement(A,{key:Re},"Loading..."))}):p.createElement(A,null,"No upgrades found")},Ee=await n(({useSubmit:me})=>{me(a());let Ce=new Map;for(let ie of b.workspaces)for(let Z of["dependencies","devDependencies"])for(let Pe of ie.manifest[Z].values())b.tryWorkspaceByDescriptor(Pe)===null&&(Pe.range.startsWith("link:")||Ce.set(Pe.descriptorHash,Pe));let fe=qe.sortMap(Ce.values(),ie=>G.stringifyDescriptor(ie));return p.createElement(u,{flexDirection:"column"},p.createElement(ce,null),p.createElement(ue,null),p.createElement(he,{dependencies:fe}))},{},{stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr});if(typeof Ee>"u")return 1;let g=!1;for(let me of b.workspaces)for(let Ce of["dependencies","devDependencies"]){let fe=me.manifest[Ce];for(let ie of fe.values()){let Z=Ee.get(ie.descriptorHash);typeof Z<"u"&&Z!==null&&(fe.set(ie.identHash,G.makeDescriptor(ie,Z)),g=!0)}}return g?await b.installWithNewReport({quiet:this.context.quiet,stdout:this.context.stdout},{cache:T}):0}};var MIt={commands:[xC,bC]},UIt=MIt;var yj={};Kt(yj,{LinkFetcher:()=>av,LinkResolver:()=>lv,PortalFetcher:()=>cv,PortalResolver:()=>uv,default:()=>HIt});Ke();Pt();var Zf="portal:",$f="link:";var av=class{supports(e,r){return!!e.reference.startsWith($f)}getLocalPath(e,r){let{parentLocator:o,path:a}=G.parseFileStyleRange(e.reference,{protocol:$f});if(K.isAbsolute(a))return a;let n=r.fetcher.getLocalPath(o,r);return n===null?null:K.resolve(n,a)}async fetch(e,r){let{parentLocator:o,path:a}=G.parseFileStyleRange(e.reference,{protocol:$f}),n=K.isAbsolute(a)?{packageFs:new En(Bt.root),prefixPath:Bt.dot,localPath:Bt.root}:await r.fetcher.fetch(o,r),u=n.localPath?{packageFs:new En(Bt.root),prefixPath:K.relative(Bt.root,n.localPath),localPath:Bt.root}:n;n!==u&&n.releaseFs&&n.releaseFs();let A=u.packageFs,p=K.resolve(u.localPath??u.packageFs.getRealPath(),u.prefixPath,a);return n.localPath?{packageFs:new En(p,{baseFs:A}),releaseFs:u.releaseFs,prefixPath:Bt.dot,discardFromLookup:!0,localPath:p}:{packageFs:new Gu(p,{baseFs:A}),releaseFs:u.releaseFs,prefixPath:Bt.dot,discardFromLookup:!0}}};Ke();Pt();var lv=class{supportsDescriptor(e,r){return!!e.range.startsWith($f)}supportsLocator(e,r){return!!e.reference.startsWith($f)}shouldPersistResolution(e,r){return!1}bindDescriptor(e,r,o){return G.bindDescriptor(e,{locator:G.stringifyLocator(r)})}getResolutionDependencies(e,r){return{}}async getCandidates(e,r,o){let a=e.range.slice($f.length);return[G.makeLocator(e,`${$f}${Ae.toPortablePath(a)}`)]}async getSatisfying(e,r,o,a){let[n]=await this.getCandidates(e,r,a);return{locators:o.filter(u=>u.locatorHash===n.locatorHash),sorted:!1}}async resolve(e,r){return{...e,version:"0.0.0",languageName:r.project.configuration.get("defaultLanguageName"),linkType:"SOFT",conditions:null,dependencies:new Map,peerDependencies:new Map,dependenciesMeta:new Map,peerDependenciesMeta:new Map,bin:new Map}}};Ke();Pt();var cv=class{supports(e,r){return!!e.reference.startsWith(Zf)}getLocalPath(e,r){let{parentLocator:o,path:a}=G.parseFileStyleRange(e.reference,{protocol:Zf});if(K.isAbsolute(a))return a;let n=r.fetcher.getLocalPath(o,r);return n===null?null:K.resolve(n,a)}async fetch(e,r){let{parentLocator:o,path:a}=G.parseFileStyleRange(e.reference,{protocol:Zf}),n=K.isAbsolute(a)?{packageFs:new En(Bt.root),prefixPath:Bt.dot,localPath:Bt.root}:await r.fetcher.fetch(o,r),u=n.localPath?{packageFs:new En(Bt.root),prefixPath:K.relative(Bt.root,n.localPath),localPath:Bt.root}:n;n!==u&&n.releaseFs&&n.releaseFs();let A=u.packageFs,p=K.resolve(u.localPath??u.packageFs.getRealPath(),u.prefixPath,a);return n.localPath?{packageFs:new En(p,{baseFs:A}),releaseFs:u.releaseFs,prefixPath:Bt.dot,localPath:p}:{packageFs:new Gu(p,{baseFs:A}),releaseFs:u.releaseFs,prefixPath:Bt.dot}}};Ke();Ke();Pt();var uv=class{supportsDescriptor(e,r){return!!e.range.startsWith(Zf)}supportsLocator(e,r){return!!e.reference.startsWith(Zf)}shouldPersistResolution(e,r){return!1}bindDescriptor(e,r,o){return G.bindDescriptor(e,{locator:G.stringifyLocator(r)})}getResolutionDependencies(e,r){return{}}async getCandidates(e,r,o){let a=e.range.slice(Zf.length);return[G.makeLocator(e,`${Zf}${Ae.toPortablePath(a)}`)]}async getSatisfying(e,r,o,a){let[n]=await this.getCandidates(e,r,a);return{locators:o.filter(u=>u.locatorHash===n.locatorHash),sorted:!1}}async resolve(e,r){if(!r.fetchOptions)throw new Error("Assertion failed: This resolver cannot be used unless a fetcher is configured");let o=await r.fetchOptions.fetcher.fetch(e,r.fetchOptions),a=await qe.releaseAfterUseAsync(async()=>await _t.find(o.prefixPath,{baseFs:o.packageFs}),o.releaseFs);return{...e,version:a.version||"0.0.0",languageName:a.languageName||r.project.configuration.get("defaultLanguageName"),linkType:"SOFT",conditions:a.getConditions(),dependencies:r.project.configuration.normalizeDependencyMap(a.dependencies),peerDependencies:a.peerDependencies,dependenciesMeta:a.dependenciesMeta,peerDependenciesMeta:a.peerDependenciesMeta,bin:a.bin}}};var _It={fetchers:[av,cv],resolvers:[lv,uv]},HIt=_It;var t9={};Kt(t9,{NodeModulesLinker:()=>Dv,NodeModulesMode:()=>Xj,PnpLooseLinker:()=>Pv,default:()=>n1t});Pt();Ke();Pt();Pt();var Cj=(t,e)=>`${t}@${e}`,Vwe=(t,e)=>{let r=e.indexOf("#"),o=r>=0?e.substring(r+1):e;return Cj(t,o)};var Jwe=(t,e={})=>{let r=e.debugLevel||Number(process.env.NM_DEBUG_LEVEL||-1),o=e.check||r>=9,a=e.hoistingLimits||new Map,n={check:o,debugLevel:r,hoistingLimits:a,fastLookupPossible:!0},u;n.debugLevel>=0&&(u=Date.now());let A=VIt(t,n),p=!1,h=0;do{let E=Ij(A,[A],new Set([A.locator]),new Map,n);p=E.anotherRoundNeeded||E.isGraphChanged,n.fastLookupPossible=!1,h++}while(p);if(n.debugLevel>=0&&console.log(`hoist time: ${Date.now()-u}ms, rounds: ${h}`),n.debugLevel>=1){let E=Av(A);if(Ij(A,[A],new Set([A.locator]),new Map,n).isGraphChanged)throw new Error(`The hoisting result is not terminal, prev tree: ${E}, next tree: ${Av(A)}`);let D=Xwe(A);if(D)throw new Error(`${D}, after hoisting finished: ${Av(A)}`)}return n.debugLevel>=2&&console.log(Av(A)),zIt(A)},qIt=t=>{let e=t[t.length-1],r=new Map,o=new Set,a=n=>{if(!o.has(n)){o.add(n);for(let u of n.hoistedDependencies.values())r.set(u.name,u);for(let u of n.dependencies.values())n.peerNames.has(u.name)||a(u)}};return a(e),r},jIt=t=>{let e=t[t.length-1],r=new Map,o=new Set,a=new Set,n=(u,A)=>{if(o.has(u))return;o.add(u);for(let h of u.hoistedDependencies.values())if(!A.has(h.name)){let E;for(let w of t)E=w.dependencies.get(h.name),E&&r.set(E.name,E)}let p=new Set;for(let h of u.dependencies.values())p.add(h.name);for(let h of u.dependencies.values())u.peerNames.has(h.name)||n(h,p)};return n(e,a),r},zwe=(t,e)=>{if(e.decoupled)return e;let{name:r,references:o,ident:a,locator:n,dependencies:u,originalDependencies:A,hoistedDependencies:p,peerNames:h,reasons:E,isHoistBorder:w,hoistPriority:D,dependencyKind:b,hoistedFrom:C,hoistedTo:T}=e,N={name:r,references:new Set(o),ident:a,locator:n,dependencies:new Map(u),originalDependencies:new Map(A),hoistedDependencies:new Map(p),peerNames:new Set(h),reasons:new Map(E),decoupled:!0,isHoistBorder:w,hoistPriority:D,dependencyKind:b,hoistedFrom:new Map(C),hoistedTo:new Map(T)},U=N.dependencies.get(r);return U&&U.ident==N.ident&&N.dependencies.set(r,N),t.dependencies.set(N.name,N),N},GIt=(t,e)=>{let r=new Map([[t.name,[t.ident]]]);for(let a of t.dependencies.values())t.peerNames.has(a.name)||r.set(a.name,[a.ident]);let o=Array.from(e.keys());o.sort((a,n)=>{let u=e.get(a),A=e.get(n);if(A.hoistPriority!==u.hoistPriority)return A.hoistPriority-u.hoistPriority;{let p=u.dependents.size+u.peerDependents.size;return A.dependents.size+A.peerDependents.size-p}});for(let a of o){let n=a.substring(0,a.indexOf("@",1)),u=a.substring(n.length+1);if(!t.peerNames.has(n)){let A=r.get(n);A||(A=[],r.set(n,A)),A.indexOf(u)<0&&A.push(u)}}return r},Ej=t=>{let e=new Set,r=(o,a=new Set)=>{if(!a.has(o)){a.add(o);for(let n of o.peerNames)if(!t.peerNames.has(n)){let u=t.dependencies.get(n);u&&!e.has(u)&&r(u,a)}e.add(o)}};for(let o of t.dependencies.values())t.peerNames.has(o.name)||r(o);return e},Ij=(t,e,r,o,a,n=new Set)=>{let u=e[e.length-1];if(n.has(u))return{anotherRoundNeeded:!1,isGraphChanged:!1};n.add(u);let A=JIt(u),p=GIt(u,A),h=t==u?new Map:a.fastLookupPossible?qIt(e):jIt(e),E,w=!1,D=!1,b=new Map(Array.from(p.entries()).map(([T,N])=>[T,N[0]])),C=new Map;do{let T=KIt(t,e,r,h,b,p,o,C,a);T.isGraphChanged&&(D=!0),T.anotherRoundNeeded&&(w=!0),E=!1;for(let[N,U]of p)U.length>1&&!u.dependencies.has(N)&&(b.delete(N),U.shift(),b.set(N,U[0]),E=!0)}while(E);for(let T of u.dependencies.values())if(!u.peerNames.has(T.name)&&!r.has(T.locator)){r.add(T.locator);let N=Ij(t,[...e,T],r,C,a);N.isGraphChanged&&(D=!0),N.anotherRoundNeeded&&(w=!0),r.delete(T.locator)}return{anotherRoundNeeded:w,isGraphChanged:D}},WIt=t=>{for(let[e,r]of t.dependencies)if(!t.peerNames.has(e)&&r.ident!==t.ident)return!0;return!1},YIt=(t,e,r,o,a,n,u,A,{outputReason:p,fastLookupPossible:h})=>{let E,w=null,D=new Set;p&&(E=`${Array.from(e).map(N=>Js(N)).join("\u2192")}`);let b=r[r.length-1],T=!(o.ident===b.ident);if(p&&!T&&(w="- self-reference"),T&&(T=o.dependencyKind!==1,p&&!T&&(w="- workspace")),T&&o.dependencyKind===2&&(T=!WIt(o),p&&!T&&(w="- external soft link with unhoisted dependencies")),T&&(T=!t.peerNames.has(o.name),p&&!T&&(w=`- cannot shadow peer: ${Js(t.originalDependencies.get(o.name).locator)} at ${E}`)),T){let N=!1,U=a.get(o.name);if(N=!U||U.ident===o.ident,p&&!N&&(w=`- filled by: ${Js(U.locator)} at ${E}`),N)for(let z=r.length-1;z>=1;z--){let le=r[z].dependencies.get(o.name);if(le&&le.ident!==o.ident){N=!1;let ce=A.get(b);ce||(ce=new Set,A.set(b,ce)),ce.add(o.name),p&&(w=`- filled by ${Js(le.locator)} at ${r.slice(0,z).map(ue=>Js(ue.locator)).join("\u2192")}`);break}}T=N}if(T&&(T=n.get(o.name)===o.ident,p&&!T&&(w=`- filled by: ${Js(u.get(o.name)[0])} at ${E}`)),T){let N=!0,U=new Set(o.peerNames);for(let z=r.length-1;z>=1;z--){let te=r[z];for(let le of U){if(te.peerNames.has(le)&&te.originalDependencies.has(le))continue;let ce=te.dependencies.get(le);ce&&t.dependencies.get(le)!==ce&&(z===r.length-1?D.add(ce):(D=null,N=!1,p&&(w=`- peer dependency ${Js(ce.locator)} from parent ${Js(te.locator)} was not hoisted to ${E}`))),U.delete(le)}if(!N)break}T=N}if(T&&!h)for(let N of o.hoistedDependencies.values()){let U=a.get(N.name)||t.dependencies.get(N.name);if(!U||N.ident!==U.ident){T=!1,p&&(w=`- previously hoisted dependency mismatch, needed: ${Js(N.locator)}, available: ${Js(U?.locator)}`);break}}return D!==null&&D.size>0?{isHoistable:2,dependsOn:D,reason:w}:{isHoistable:T?0:1,reason:w}},VQ=t=>`${t.name}@${t.locator}`,KIt=(t,e,r,o,a,n,u,A,p)=>{let h=e[e.length-1],E=new Set,w=!1,D=!1,b=(U,z,te,le,ce)=>{if(E.has(le))return;let ue=[...z,VQ(le)],Ie=[...te,VQ(le)],he=new Map,De=new Map;for(let fe of Ej(le)){let ie=YIt(h,r,[h,...U,le],fe,o,a,n,A,{outputReason:p.debugLevel>=2,fastLookupPossible:p.fastLookupPossible});if(De.set(fe,ie),ie.isHoistable===2)for(let Z of ie.dependsOn){let Pe=he.get(Z.name)||new Set;Pe.add(fe.name),he.set(Z.name,Pe)}}let Ee=new Set,g=(fe,ie,Z)=>{if(!Ee.has(fe)){Ee.add(fe),De.set(fe,{isHoistable:1,reason:Z});for(let Pe of he.get(fe.name)||[])g(le.dependencies.get(Pe),ie,p.debugLevel>=2?`- peer dependency ${Js(fe.locator)} from parent ${Js(le.locator)} was not hoisted`:"")}};for(let[fe,ie]of De)ie.isHoistable===1&&g(fe,ie,ie.reason);let me=!1;for(let fe of De.keys())if(!Ee.has(fe)){D=!0;let ie=u.get(le);ie&&ie.has(fe.name)&&(w=!0),me=!0,le.dependencies.delete(fe.name),le.hoistedDependencies.set(fe.name,fe),le.reasons.delete(fe.name);let Z=h.dependencies.get(fe.name);if(p.debugLevel>=2){let Pe=Array.from(z).concat([le.locator]).map(ht=>Js(ht)).join("\u2192"),Re=h.hoistedFrom.get(fe.name);Re||(Re=[],h.hoistedFrom.set(fe.name,Re)),Re.push(Pe),le.hoistedTo.set(fe.name,Array.from(e).map(ht=>Js(ht.locator)).join("\u2192"))}if(!Z)h.ident!==fe.ident&&(h.dependencies.set(fe.name,fe),ce.add(fe));else for(let Pe of fe.references)Z.references.add(Pe)}if(le.dependencyKind===2&&me&&(w=!0),p.check){let fe=Xwe(t);if(fe)throw new Error(`${fe}, after hoisting dependencies of ${[h,...U,le].map(ie=>Js(ie.locator)).join("\u2192")}: ${Av(t)}`)}let Ce=Ej(le);for(let fe of Ce)if(Ee.has(fe)){let ie=De.get(fe);if((a.get(fe.name)===fe.ident||!le.reasons.has(fe.name))&&ie.isHoistable!==0&&le.reasons.set(fe.name,ie.reason),!fe.isHoistBorder&&Ie.indexOf(VQ(fe))<0){E.add(le);let Pe=zwe(le,fe);b([...U,le],ue,Ie,Pe,T),E.delete(le)}}},C,T=new Set(Ej(h)),N=Array.from(e).map(U=>VQ(U));do{C=T,T=new Set;for(let U of C){if(U.locator===h.locator||U.isHoistBorder)continue;let z=zwe(h,U);b([],Array.from(r),N,z,T)}}while(T.size>0);return{anotherRoundNeeded:w,isGraphChanged:D}},Xwe=t=>{let e=[],r=new Set,o=new Set,a=(n,u,A)=>{if(r.has(n)||(r.add(n),o.has(n)))return;let p=new Map(u);for(let h of n.dependencies.values())n.peerNames.has(h.name)||p.set(h.name,h);for(let h of n.originalDependencies.values()){let E=p.get(h.name),w=()=>`${Array.from(o).concat([n]).map(D=>Js(D.locator)).join("\u2192")}`;if(n.peerNames.has(h.name)){let D=u.get(h.name);(D!==E||!D||D.ident!==h.ident)&&e.push(`${w()} - broken peer promise: expected ${h.ident} but found ${D&&D.ident}`)}else{let D=A.hoistedFrom.get(n.name),b=n.hoistedTo.get(h.name),C=`${D?` hoisted from ${D.join(", ")}`:""}`,T=`${b?` hoisted to ${b}`:""}`,N=`${w()}${C}`;E?E.ident!==h.ident&&e.push(`${N} - broken require promise for ${h.name}${T}: expected ${h.ident}, but found: ${E.ident}`):e.push(`${N} - broken require promise: no required dependency ${h.name}${T} found`)}}o.add(n);for(let h of n.dependencies.values())n.peerNames.has(h.name)||a(h,p,n);o.delete(n)};return a(t,t.dependencies,t),e.join(` `)},VIt=(t,e)=>{let{identName:r,name:o,reference:a,peerNames:n}=t,u={name:o,references:new Set([a]),locator:Cj(r,a),ident:Vwe(r,a),dependencies:new Map,originalDependencies:new Map,hoistedDependencies:new Map,peerNames:new Set(n),reasons:new Map,decoupled:!0,isHoistBorder:!0,hoistPriority:0,dependencyKind:1,hoistedFrom:new Map,hoistedTo:new Map},A=new Map([[t,u]]),p=(h,E)=>{let w=A.get(h),D=!!w;if(!w){let{name:b,identName:C,reference:T,peerNames:N,hoistPriority:U,dependencyKind:z}=h,te=e.hoistingLimits.get(E.locator);w={name:b,references:new Set([T]),locator:Cj(C,T),ident:Vwe(C,T),dependencies:new Map,originalDependencies:new Map,hoistedDependencies:new Map,peerNames:new Set(N),reasons:new Map,decoupled:!0,isHoistBorder:te?te.has(b):!1,hoistPriority:U||0,dependencyKind:z||0,hoistedFrom:new Map,hoistedTo:new Map},A.set(h,w)}if(E.dependencies.set(h.name,w),E.originalDependencies.set(h.name,w),D){let b=new Set,C=T=>{if(!b.has(T)){b.add(T),T.decoupled=!1;for(let N of T.dependencies.values())T.peerNames.has(N.name)||C(N)}};C(w)}else for(let b of h.dependencies)p(b,w)};for(let h of t.dependencies)p(h,u);return u},wj=t=>t.substring(0,t.indexOf("@",1)),zIt=t=>{let e={name:t.name,identName:wj(t.locator),references:new Set(t.references),dependencies:new Set},r=new Set([t]),o=(a,n,u)=>{let A=r.has(a),p;if(n===a)p=u;else{let{name:h,references:E,locator:w}=a;p={name:h,identName:wj(w),references:E,dependencies:new Set}}if(u.dependencies.add(p),!A){r.add(a);for(let h of a.dependencies.values())a.peerNames.has(h.name)||o(h,a,p);r.delete(a)}};for(let a of t.dependencies.values())o(a,t,e);return e},JIt=t=>{let e=new Map,r=new Set([t]),o=u=>`${u.name}@${u.ident}`,a=u=>{let A=o(u),p=e.get(A);return p||(p={dependents:new Set,peerDependents:new Set,hoistPriority:0},e.set(A,p)),p},n=(u,A)=>{let p=!!r.has(A);if(a(A).dependents.add(u.ident),!p){r.add(A);for(let E of A.dependencies.values()){let w=a(E);w.hoistPriority=Math.max(w.hoistPriority,E.hoistPriority),A.peerNames.has(E.name)?w.peerDependents.add(A.ident):n(A,E)}}};for(let u of t.dependencies.values())t.peerNames.has(u.name)||n(t,u);return e},Js=t=>{if(!t)return"none";let e=t.indexOf("@",1),r=t.substring(0,e);r.endsWith("$wsroot$")&&(r=`wh:${r.replace("$wsroot$","")}`);let o=t.substring(e+1);if(o==="workspace:.")return".";if(o){let a=(o.indexOf("#")>0?o.split("#")[1]:o).replace("npm:","");return o.startsWith("virtual")&&(r=`v:${r}`),a.startsWith("workspace")&&(r=`w:${r}`,a=""),`${r}${a?`@${a}`:""}`}else return`${r}`};var Av=t=>{let e=0,r=(a,n,u="")=>{if(e>5e4||n.has(a))return"";e++;let A=Array.from(a.dependencies.values()).sort((h,E)=>h.name===E.name?0:h.name>E.name?1:-1),p="";n.add(a);for(let h=0;h":"")+(D!==E.name?`a:${E.name}:`:"")+Js(E.locator)+(w?` ${w}`:"")} `,p+=r(E,n,`${u}${h5e4?` Tree is too large, part of the tree has been dunped `:"")};var fv=(o=>(o.WORKSPACES="workspaces",o.DEPENDENCIES="dependencies",o.NONE="none",o))(fv||{}),Zwe="node_modules",jh="$wsroot$";var pv=(t,e)=>{let{packageTree:r,hoistingLimits:o,errors:a,preserveSymlinksRequired:n}=ZIt(t,e),u=null;if(a.length===0){let A=Jwe(r,{hoistingLimits:o});u=ewt(t,A,e)}return{tree:u,errors:a,preserveSymlinksRequired:n}},yA=t=>`${t.name}@${t.reference}`,vj=t=>{let e=new Map;for(let[r,o]of t.entries())if(!o.dirList){let a=e.get(o.locator);a||(a={target:o.target,linkType:o.linkType,locations:[],aliases:o.aliases},e.set(o.locator,a)),a.locations.push(r)}for(let r of e.values())r.locations=r.locations.sort((o,a)=>{let n=o.split(K.delimiter).length,u=a.split(K.delimiter).length;return a===o?0:n!==u?u-n:a>o?1:-1});return e},$we=(t,e)=>{let r=G.isVirtualLocator(t)?G.devirtualizeLocator(t):t,o=G.isVirtualLocator(e)?G.devirtualizeLocator(e):e;return G.areLocatorsEqual(r,o)},Bj=(t,e,r,o)=>{if(t.linkType!=="SOFT")return!1;let a=Ae.toPortablePath(r.resolveVirtual&&e.reference&&e.reference.startsWith("virtual:")?r.resolveVirtual(t.packageLocation):t.packageLocation);return K.contains(o,a)===null},XIt=t=>{let e=t.getPackageInformation(t.topLevel);if(e===null)throw new Error("Assertion failed: Expected the top-level package to have been registered");if(t.findPackageLocator(e.packageLocation)===null)throw new Error("Assertion failed: Expected the top-level package to have a physical locator");let o=Ae.toPortablePath(e.packageLocation.slice(0,-1)),a=new Map,n={children:new Map},u=t.getDependencyTreeRoots(),A=new Map,p=new Set,h=(D,b)=>{let C=yA(D);if(p.has(C))return;p.add(C);let T=t.getPackageInformation(D);if(T){let N=b?yA(b):"";if(yA(D)!==N&&T.linkType==="SOFT"&&!D.reference.startsWith("link:")&&!Bj(T,D,t,o)){let U=e1e(T,D,t);(!A.get(U)||D.reference.startsWith("workspace:"))&&A.set(U,D)}for(let[U,z]of T.packageDependencies)z!==null&&(T.packagePeers.has(U)||h(t.getLocator(U,z),D))}};for(let D of u)h(D,null);let E=o.split(K.sep);for(let D of A.values()){let b=t.getPackageInformation(D),T=Ae.toPortablePath(b.packageLocation.slice(0,-1)).split(K.sep).slice(E.length),N=n;for(let U of T){let z=N.children.get(U);z||(z={children:new Map},N.children.set(U,z)),N=z}N.workspaceLocator=D}let w=(D,b)=>{if(D.workspaceLocator){let C=yA(b),T=a.get(C);T||(T=new Set,a.set(C,T)),T.add(D.workspaceLocator)}for(let C of D.children.values())w(C,D.workspaceLocator||b)};for(let D of n.children.values())w(D,n.workspaceLocator);return a},ZIt=(t,e)=>{let r=[],o=!1,a=new Map,n=XIt(t),u=t.getPackageInformation(t.topLevel);if(u===null)throw new Error("Assertion failed: Expected the top-level package to have been registered");let A=t.findPackageLocator(u.packageLocation);if(A===null)throw new Error("Assertion failed: Expected the top-level package to have a physical locator");let p=Ae.toPortablePath(u.packageLocation.slice(0,-1)),h={name:A.name,identName:A.name,reference:A.reference,peerNames:u.packagePeers,dependencies:new Set,dependencyKind:1},E=new Map,w=(b,C)=>`${yA(C)}:${b}`,D=(b,C,T,N,U,z,te,le)=>{let ce=w(b,T),ue=E.get(ce),Ie=!!ue;!Ie&&T.name===A.name&&T.reference===A.reference&&(ue=h,E.set(ce,h));let he=Bj(C,T,t,p);if(!ue){let fe=0;he?fe=2:C.linkType==="SOFT"&&T.name.endsWith(jh)&&(fe=1),ue={name:b,identName:T.name,reference:T.reference,dependencies:new Set,peerNames:fe===1?new Set:C.packagePeers,dependencyKind:fe},E.set(ce,ue)}let De;if(he?De=2:U.linkType==="SOFT"?De=1:De=0,ue.hoistPriority=Math.max(ue.hoistPriority||0,De),le&&!he){let fe=yA({name:N.identName,reference:N.reference}),ie=a.get(fe)||new Set;a.set(fe,ie),ie.add(ue.name)}let Ee=new Map(C.packageDependencies);if(e.project){let fe=e.project.workspacesByCwd.get(Ae.toPortablePath(C.packageLocation.slice(0,-1)));if(fe){let ie=new Set([...Array.from(fe.manifest.peerDependencies.values(),Z=>G.stringifyIdent(Z)),...Array.from(fe.manifest.peerDependenciesMeta.keys())]);for(let Z of ie)Ee.has(Z)||(Ee.set(Z,z.get(Z)||null),ue.peerNames.add(Z))}}let g=yA({name:T.name.replace(jh,""),reference:T.reference}),me=n.get(g);if(me)for(let fe of me)Ee.set(`${fe.name}${jh}`,fe.reference);(C!==U||C.linkType!=="SOFT"||!he&&(!e.selfReferencesByCwd||e.selfReferencesByCwd.get(te)))&&N.dependencies.add(ue);let Ce=T!==A&&C.linkType==="SOFT"&&!T.name.endsWith(jh)&&!he;if(!Ie&&!Ce){let fe=new Map;for(let[ie,Z]of Ee)if(Z!==null){let Pe=t.getLocator(ie,Z),Re=t.getLocator(ie.replace(jh,""),Z),ht=t.getPackageInformation(Re);if(ht===null)throw new Error("Assertion failed: Expected the package to have been registered");let q=Bj(ht,Pe,t,p);if(e.validateExternalSoftLinks&&e.project&&q){ht.packageDependencies.size>0&&(o=!0);for(let[Ve,xe]of ht.packageDependencies)if(xe!==null){let tt=G.parseLocator(Array.isArray(xe)?`${xe[0]}@${xe[1]}`:`${Ve}@${xe}`);if(yA(tt)!==yA(Pe)){let He=Ee.get(Ve);if(He){let x=G.parseLocator(Array.isArray(He)?`${He[0]}@${He[1]}`:`${Ve}@${He}`);$we(x,tt)||r.push({messageName:71,text:`Cannot link ${G.prettyIdent(e.project.configuration,G.parseIdent(Pe.name))} into ${G.prettyLocator(e.project.configuration,G.parseLocator(`${T.name}@${T.reference}`))} dependency ${G.prettyLocator(e.project.configuration,tt)} conflicts with parent dependency ${G.prettyLocator(e.project.configuration,x)}`})}else{let x=fe.get(Ve);if(x){let I=x.target,S=G.parseLocator(Array.isArray(I)?`${I[0]}@${I[1]}`:`${Ve}@${I}`);$we(S,tt)||r.push({messageName:71,text:`Cannot link ${G.prettyIdent(e.project.configuration,G.parseIdent(Pe.name))} into ${G.prettyLocator(e.project.configuration,G.parseLocator(`${T.name}@${T.reference}`))} dependency ${G.prettyLocator(e.project.configuration,tt)} conflicts with dependency ${G.prettyLocator(e.project.configuration,S)} from sibling portal ${G.prettyIdent(e.project.configuration,G.parseIdent(x.portal.name))}`})}else fe.set(Ve,{target:tt.reference,portal:Pe})}}}}let nt=e.hoistingLimitsByCwd?.get(te),Le=q?te:K.relative(p,Ae.toPortablePath(ht.packageLocation))||Bt.dot,Te=e.hoistingLimitsByCwd?.get(Le);D(ie,ht,Pe,ue,C,Ee,Le,nt==="dependencies"||Te==="dependencies"||Te==="workspaces")}}};return D(A.name,u,A,h,u,u.packageDependencies,Bt.dot,!1),{packageTree:h,hoistingLimits:a,errors:r,preserveSymlinksRequired:o}};function e1e(t,e,r){let o=r.resolveVirtual&&e.reference&&e.reference.startsWith("virtual:")?r.resolveVirtual(t.packageLocation):t.packageLocation;return Ae.toPortablePath(o||t.packageLocation)}function $It(t,e,r){let o=e.getLocator(t.name.replace(jh,""),t.reference),a=e.getPackageInformation(o);if(a===null)throw new Error("Assertion failed: Expected the package to be registered");return r.pnpifyFs?{linkType:"SOFT",target:Ae.toPortablePath(a.packageLocation)}:{linkType:a.linkType,target:e1e(a,t,e)}}var ewt=(t,e,r)=>{let o=new Map,a=(E,w,D)=>{let{linkType:b,target:C}=$It(E,t,r);return{locator:yA(E),nodePath:w,target:C,linkType:b,aliases:D}},n=E=>{let[w,D]=E.split("/");return D?{scope:w,name:D}:{scope:null,name:w}},u=new Set,A=(E,w,D)=>{if(u.has(E))return;u.add(E);let b=Array.from(E.references).sort().join("#");for(let C of E.dependencies){let T=Array.from(C.references).sort().join("#");if(C.identName===E.identName.replace(jh,"")&&T===b)continue;let N=Array.from(C.references).sort(),U={name:C.identName,reference:N[0]},{name:z,scope:te}=n(C.name),le=te?[te,z]:[z],ce=K.join(w,Zwe),ue=K.join(ce,...le),Ie=`${D}/${U.name}`,he=a(U,D,N.slice(1)),De=!1;if(he.linkType==="SOFT"&&r.project){let Ee=r.project.workspacesByCwd.get(he.target.slice(0,-1));De=!!(Ee&&!Ee.manifest.name)}if(!C.name.endsWith(jh)&&!De){let Ee=o.get(ue);if(Ee){if(Ee.dirList)throw new Error(`Assertion failed: ${ue} cannot merge dir node with leaf node`);{let Ce=G.parseLocator(Ee.locator),fe=G.parseLocator(he.locator);if(Ee.linkType!==he.linkType)throw new Error(`Assertion failed: ${ue} cannot merge nodes with different link types ${Ee.nodePath}/${G.stringifyLocator(Ce)} and ${D}/${G.stringifyLocator(fe)}`);if(Ce.identHash!==fe.identHash)throw new Error(`Assertion failed: ${ue} cannot merge nodes with different idents ${Ee.nodePath}/${G.stringifyLocator(Ce)} and ${D}/s${G.stringifyLocator(fe)}`);he.aliases=[...he.aliases,...Ee.aliases,G.parseLocator(Ee.locator).reference]}}o.set(ue,he);let g=ue.split("/"),me=g.indexOf(Zwe);for(let Ce=g.length-1;me>=0&&Ce>me;Ce--){let fe=Ae.toPortablePath(g.slice(0,Ce).join(K.sep)),ie=g[Ce],Z=o.get(fe);if(!Z)o.set(fe,{dirList:new Set([ie])});else if(Z.dirList){if(Z.dirList.has(ie))break;Z.dirList.add(ie)}}}A(C,he.linkType==="SOFT"?he.target:ue,Ie)}},p=a({name:e.name,reference:Array.from(e.references)[0]},"",[]),h=p.target;return o.set(h,p),A(e,h,""),o};Ke();Ke();Pt();Pt();sA();Ol();var jj={};Kt(jj,{PnpInstaller:()=>pd,PnpLinker:()=>Yh,UnplugCommand:()=>QC,default:()=>kwt,getPnpPath:()=>Kh,jsInstallUtils:()=>CA,pnpUtils:()=>vv,quotePathIfNeeded:()=>M1e});Pt();var O1e=ve("url");Ke();Ke();Pt();Pt();var t1e={DEFAULT:{collapsed:!1,next:{"*":"DEFAULT"}},TOP_LEVEL:{collapsed:!1,next:{fallbackExclusionList:"FALLBACK_EXCLUSION_LIST",packageRegistryData:"PACKAGE_REGISTRY_DATA","*":"DEFAULT"}},FALLBACK_EXCLUSION_LIST:{collapsed:!1,next:{"*":"FALLBACK_EXCLUSION_ENTRIES"}},FALLBACK_EXCLUSION_ENTRIES:{collapsed:!0,next:{"*":"FALLBACK_EXCLUSION_DATA"}},FALLBACK_EXCLUSION_DATA:{collapsed:!0,next:{"*":"DEFAULT"}},PACKAGE_REGISTRY_DATA:{collapsed:!1,next:{"*":"PACKAGE_REGISTRY_ENTRIES"}},PACKAGE_REGISTRY_ENTRIES:{collapsed:!0,next:{"*":"PACKAGE_STORE_DATA"}},PACKAGE_STORE_DATA:{collapsed:!1,next:{"*":"PACKAGE_STORE_ENTRIES"}},PACKAGE_STORE_ENTRIES:{collapsed:!0,next:{"*":"PACKAGE_INFORMATION_DATA"}},PACKAGE_INFORMATION_DATA:{collapsed:!1,next:{packageDependencies:"PACKAGE_DEPENDENCIES","*":"DEFAULT"}},PACKAGE_DEPENDENCIES:{collapsed:!1,next:{"*":"PACKAGE_DEPENDENCY"}},PACKAGE_DEPENDENCY:{collapsed:!0,next:{"*":"DEFAULT"}}};function twt(t,e,r){let o="";o+="[";for(let a=0,n=t.length;a"u"||(A!==0&&(a+=", "),a+=JSON.stringify(p),a+=": ",a+=zQ(p,h,e,r).replace(/^ +/g,""),A+=1)}return a+="}",a}function iwt(t,e,r){let o=Object.keys(t),a=`${r} `,n="";n+=r,n+=`{ `;let u=0;for(let A=0,p=o.length;A"u"||(u!==0&&(n+=",",n+=` `),n+=a,n+=JSON.stringify(h),n+=": ",n+=zQ(h,E,e,a).replace(/^ +/g,""),u+=1)}return u!==0&&(n+=` `),n+=r,n+="}",n}function zQ(t,e,r,o){let{next:a}=t1e[r],n=a[t]||a["*"];return r1e(e,n,o)}function r1e(t,e,r){let{collapsed:o}=t1e[e];return Array.isArray(t)?o?twt(t,e,r):rwt(t,e,r):typeof t=="object"&&t!==null?o?nwt(t,e,r):iwt(t,e,r):JSON.stringify(t)}function n1e(t){return r1e(t,"TOP_LEVEL","")}function hv(t,e){let r=Array.from(t);Array.isArray(e)||(e=[e]);let o=[];for(let n of e)o.push(r.map(u=>n(u)));let a=r.map((n,u)=>u);return a.sort((n,u)=>{for(let A of o){let p=A[n]A[u]?1:0;if(p!==0)return p}return 0}),a.map(n=>r[n])}function swt(t){let e=new Map,r=hv(t.fallbackExclusionList||[],[({name:o,reference:a})=>o,({name:o,reference:a})=>a]);for(let{name:o,reference:a}of r){let n=e.get(o);typeof n>"u"&&e.set(o,n=new Set),n.add(a)}return Array.from(e).map(([o,a])=>[o,Array.from(a)])}function owt(t){return hv(t.fallbackPool||[],([e])=>e)}function awt(t){let e=[];for(let[r,o]of hv(t.packageRegistry,([a])=>a===null?"0":`1${a}`)){let a=[];e.push([r,a]);for(let[n,{packageLocation:u,packageDependencies:A,packagePeers:p,linkType:h,discardFromLookup:E}]of hv(o,([w])=>w===null?"0":`1${w}`)){let w=[];r!==null&&n!==null&&!A.has(r)&&w.push([r,n]);for(let[C,T]of hv(A.entries(),([N])=>N))w.push([C,T]);let D=p&&p.size>0?Array.from(p):void 0,b=E||void 0;a.push([n,{packageLocation:u,packageDependencies:w,packagePeers:D,linkType:h,discardFromLookup:b}])}}return e}function gv(t){return{__info:["This file is automatically generated. Do not touch it, or risk","your modifications being lost."],dependencyTreeRoots:t.dependencyTreeRoots,enableTopLevelFallback:t.enableTopLevelFallback||!1,ignorePatternData:t.ignorePattern||null,fallbackExclusionList:swt(t),fallbackPool:owt(t),packageRegistryData:awt(t)}}var o1e=et(s1e());function a1e(t,e){return[t?`${t} `:"",`/* eslint-disable */ `,`// @ts-nocheck `,`"use strict"; `,` `,e,` `,(0,o1e.default)()].join("")}function lwt(t){return JSON.stringify(t,null,2)}function cwt(t){return`'${t.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,`\\ `)}'`}function uwt(t){return[`const RAW_RUNTIME_STATE = `,`${cwt(n1e(t))}; `,`function $$SETUP_STATE(hydrateRuntimeState, basePath) { `,` return hydrateRuntimeState(JSON.parse(RAW_RUNTIME_STATE), {basePath: basePath || __dirname}); `,`} `].join("")}function Awt(){return[`function $$SETUP_STATE(hydrateRuntimeState, basePath) { `,` const fs = require('fs'); `,` const path = require('path'); `,` const pnpDataFilepath = path.resolve(__dirname, ${JSON.stringify(mr.pnpData)}); `,` return hydrateRuntimeState(JSON.parse(fs.readFileSync(pnpDataFilepath, 'utf8')), {basePath: basePath || __dirname}); `,`} `].join("")}function l1e(t){let e=gv(t),r=uwt(e);return a1e(t.shebang,r)}function c1e(t){let e=gv(t),r=Awt(),o=a1e(t.shebang,r);return{dataFile:lwt(e),loaderFile:o}}Pt();function Pj(t,{basePath:e}){let r=Ae.toPortablePath(e),o=K.resolve(r),a=t.ignorePatternData!==null?new RegExp(t.ignorePatternData):null,n=new Map,u=new Map(t.packageRegistryData.map(([w,D])=>[w,new Map(D.map(([b,C])=>{if(w===null!=(b===null))throw new Error("Assertion failed: The name and reference should be null, or neither should");let T=C.discardFromLookup??!1,N={name:w,reference:b},U=n.get(C.packageLocation);U?(U.discardFromLookup=U.discardFromLookup&&T,T||(U.locator=N)):n.set(C.packageLocation,{locator:N,discardFromLookup:T});let z=null;return[b,{packageDependencies:new Map(C.packageDependencies),packagePeers:new Set(C.packagePeers),linkType:C.linkType,discardFromLookup:T,get packageLocation(){return z||(z=K.join(o,C.packageLocation))}}]}))])),A=new Map(t.fallbackExclusionList.map(([w,D])=>[w,new Set(D)])),p=new Map(t.fallbackPool),h=t.dependencyTreeRoots,E=t.enableTopLevelFallback;return{basePath:r,dependencyTreeRoots:h,enableTopLevelFallback:E,fallbackExclusionList:A,fallbackPool:p,ignorePattern:a,packageLocatorsByLocations:n,packageRegistry:u}}Pt();Pt();var tp=ve("module"),fd=ve("url"),Nj=ve("util");var Qo=ve("url");var p1e=et(ve("assert"));var Sj=Array.isArray,dv=JSON.stringify,mv=Object.getOwnPropertyNames,Ad=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),xj=(t,e)=>RegExp.prototype.exec.call(t,e),bj=(t,...e)=>RegExp.prototype[Symbol.replace].apply(t,e),Gh=(t,...e)=>String.prototype.endsWith.apply(t,e),kj=(t,...e)=>String.prototype.includes.apply(t,e),Qj=(t,...e)=>String.prototype.lastIndexOf.apply(t,e),yv=(t,...e)=>String.prototype.indexOf.apply(t,e),u1e=(t,...e)=>String.prototype.replace.apply(t,e),Wh=(t,...e)=>String.prototype.slice.apply(t,e),EA=(t,...e)=>String.prototype.startsWith.apply(t,e),A1e=Map,f1e=JSON.parse;function Ev(t,e,r){return class extends r{constructor(...o){super(e(...o)),this.code=t,this.name=`${r.name} [${t}]`}}}var h1e=Ev("ERR_PACKAGE_IMPORT_NOT_DEFINED",(t,e,r)=>`Package import specifier "${t}" is not defined${e?` in package ${e}package.json`:""} imported from ${r}`,TypeError),Fj=Ev("ERR_INVALID_MODULE_SPECIFIER",(t,e,r=void 0)=>`Invalid module "${t}" ${e}${r?` imported from ${r}`:""}`,TypeError),g1e=Ev("ERR_INVALID_PACKAGE_TARGET",(t,e,r,o=!1,a=void 0)=>{let n=typeof r=="string"&&!o&&r.length&&!EA(r,"./");return e==="."?((0,p1e.default)(o===!1),`Invalid "exports" main target ${dv(r)} defined in the package config ${t}package.json${a?` imported from ${a}`:""}${n?'; targets must start with "./"':""}`):`Invalid "${o?"imports":"exports"}" target ${dv(r)} defined for '${e}' in the package config ${t}package.json${a?` imported from ${a}`:""}${n?'; targets must start with "./"':""}`},Error),Cv=Ev("ERR_INVALID_PACKAGE_CONFIG",(t,e,r)=>`Invalid package config ${t}${e?` while importing ${e}`:""}${r?`. ${r}`:""}`,Error),d1e=Ev("ERR_PACKAGE_PATH_NOT_EXPORTED",(t,e,r=void 0)=>e==="."?`No "exports" main defined in ${t}package.json${r?` imported from ${r}`:""}`:`Package subpath '${e}' is not defined by "exports" in ${t}package.json${r?` imported from ${r}`:""}`,Error);var XQ=ve("url");function m1e(t,e){let r=Object.create(null);for(let o=0;oe):t+e}Iv(r,t,o,u,a)}xj(E1e,Wh(t,2))!==null&&Iv(r,t,o,u,a);let p=new URL(t,o),h=p.pathname,E=new URL(".",o).pathname;if(EA(h,E)||Iv(r,t,o,u,a),e==="")return p;if(xj(E1e,e)!==null){let w=n?u1e(r,"*",()=>e):r+e;hwt(w,o,u,a)}return n?new URL(bj(C1e,p.href,()=>e)):new URL(e,p)}function dwt(t){let e=+t;return`${e}`!==t?!1:e>=0&&e<4294967295}function kC(t,e,r,o,a,n,u,A){if(typeof e=="string")return gwt(e,r,o,t,a,n,u,A);if(Sj(e)){if(e.length===0)return null;let p;for(let h=0;hn?-1:n>a||r===-1?1:o===-1||t.length>e.length?-1:e.length>t.length?1:0}function mwt(t,e,r){if(typeof t=="string"||Sj(t))return!0;if(typeof t!="object"||t===null)return!1;let o=mv(t),a=!1,n=0;for(let u=0;u=h.length&&Gh(e,w)&&w1e(n,h)===1&&Qj(h,"*")===E&&(n=h,u=Wh(e,E,e.length-w.length))}}if(n){let p=r[n],h=kC(t,p,u,n,o,!0,!1,a);return h==null&&Rj(e,t,o),h}Rj(e,t,o)}function v1e({name:t,base:e,conditions:r,readFileSyncFn:o}){if(t==="#"||EA(t,"#/")||Gh(t,"/")){let u="is not a valid internal imports specifier name";throw new Fj(t,u,(0,Qo.fileURLToPath)(e))}let a,n=y1e(e,o);if(n.exists){a=(0,Qo.pathToFileURL)(n.pjsonPath);let u=n.imports;if(u)if(Ad(u,t)&&!kj(t,"*")){let A=kC(a,u[t],"",t,e,!1,!0,r);if(A!=null)return A}else{let A="",p,h=mv(u);for(let E=0;E=w.length&&Gh(t,b)&&w1e(A,w)===1&&Qj(w,"*")===D&&(A=w,p=Wh(t,D,t.length-b.length))}}if(A){let E=u[A],w=kC(a,E,p,A,e,!0,!0,r);if(w!=null)return w}}}pwt(t,a,e)}Pt();var Ewt=new Set(["BUILTIN_NODE_RESOLUTION_FAILED","MISSING_DEPENDENCY","MISSING_PEER_DEPENDENCY","QUALIFIED_PATH_RESOLUTION_FAILED","UNDECLARED_DEPENDENCY"]);function ts(t,e,r={},o){o??=Ewt.has(t)?"MODULE_NOT_FOUND":t;let a={configurable:!0,writable:!0,enumerable:!1};return Object.defineProperties(new Error(e),{code:{...a,value:o},pnpCode:{...a,value:t},data:{...a,value:r}})}function pu(t){return Ae.normalize(Ae.fromPortablePath(t))}var x1e=et(P1e());function b1e(t){return Cwt(),Lj[t]}var Lj;function Cwt(){Lj||(Lj={"--conditions":[],...S1e(Iwt()),...S1e(process.execArgv)})}function S1e(t){return(0,x1e.default)({"--conditions":[String],"-C":"--conditions"},{argv:t,permissive:!0})}function Iwt(){let t=[],e=wwt(process.env.NODE_OPTIONS||"",t);return t.length,e}function wwt(t,e){let r=[],o=!1,a=!0;for(let n=0;nparseInt(t,10)),k1e=Ha>19||Ha===19&&ep>=2||Ha===18&&ep>=13,tJt=Ha===20&&ep<6||Ha===19&&ep>=3,rJt=Ha>19||Ha===19&&ep>=6,nJt=Ha>=21||Ha===20&&ep>=10||Ha===18&&ep>=19,iJt=Ha>=21||Ha===20&&ep>=10||Ha===18&&ep>=20,sJt=Ha>=22;function Q1e(t){if(process.env.WATCH_REPORT_DEPENDENCIES&&process.send)if(t=t.map(e=>Ae.fromPortablePath(qs.resolveVirtual(Ae.toPortablePath(e)))),k1e)process.send({"watch:require":t});else for(let e of t)process.send({"watch:require":e})}function Oj(t,e){let r=Number(process.env.PNP_ALWAYS_WARN_ON_FALLBACK)>0,o=Number(process.env.PNP_DEBUG_LEVEL),a=/^(?![a-zA-Z]:[\\/]|\\\\|\.{0,2}(?:\/|$))((?:node:)?(?:@[^/]+\/)?[^/]+)\/*(.*|)$/,n=/^(\/|\.{1,2}(\/|$))/,u=/\/$/,A=/^\.{0,2}\//,p={name:null,reference:null},h=[],E=new Set;if(t.enableTopLevelFallback===!0&&h.push(p),e.compatibilityMode!==!1)for(let Le of["react-scripts","gatsby"]){let Te=t.packageRegistry.get(Le);if(Te)for(let ke of Te.keys()){if(ke===null)throw new Error("Assertion failed: This reference shouldn't be null");h.push({name:Le,reference:ke})}}let{ignorePattern:w,packageRegistry:D,packageLocatorsByLocations:b}=t;function C(Le,Te){return{fn:Le,args:Te,error:null,result:null}}function T(Le){let Te=process.stderr?.hasColors?.()??process.stdout.isTTY,ke=(tt,He)=>`\x1B[${tt}m${He}\x1B[0m`,Ve=Le.error;console.error(Ve?ke("31;1",`\u2716 ${Le.error?.message.replace(/\n.*/s,"")}`):ke("33;1","\u203C Resolution")),Le.args.length>0&&console.error();for(let tt of Le.args)console.error(` ${ke("37;1","In \u2190")} ${(0,Nj.inspect)(tt,{colors:Te,compact:!0})}`);Le.result&&(console.error(),console.error(` ${ke("37;1","Out \u2192")} ${(0,Nj.inspect)(Le.result,{colors:Te,compact:!0})}`));let xe=new Error().stack.match(/(?<=^ +)at.*/gm)?.slice(2)??[];if(xe.length>0){console.error();for(let tt of xe)console.error(` ${ke("38;5;244",tt)}`)}console.error()}function N(Le,Te){if(e.allowDebug===!1)return Te;if(Number.isFinite(o)){if(o>=2)return(...ke)=>{let Ve=C(Le,ke);try{return Ve.result=Te(...ke)}catch(xe){throw Ve.error=xe}finally{T(Ve)}};if(o>=1)return(...ke)=>{try{return Te(...ke)}catch(Ve){let xe=C(Le,ke);throw xe.error=Ve,T(xe),Ve}}}return Te}function U(Le){let Te=g(Le);if(!Te)throw ts("INTERNAL","Couldn't find a matching entry in the dependency tree for the specified parent (this is probably an internal error)");return Te}function z(Le){if(Le.name===null)return!0;for(let Te of t.dependencyTreeRoots)if(Te.name===Le.name&&Te.reference===Le.reference)return!0;return!1}let te=new Set(["node","require",...b1e("--conditions")]);function le(Le,Te=te,ke){let Ve=fe(K.join(Le,"internal.js"),{resolveIgnored:!0,includeDiscardFromLookup:!0});if(Ve===null)throw ts("INTERNAL",`The locator that owns the "${Le}" path can't be found inside the dependency tree (this is probably an internal error)`);let{packageLocation:xe}=U(Ve),tt=K.join(xe,mr.manifest);if(!e.fakeFs.existsSync(tt))return null;let He=JSON.parse(e.fakeFs.readFileSync(tt,"utf8"));if(He.exports==null)return null;let x=K.contains(xe,Le);if(x===null)throw ts("INTERNAL","unqualifiedPath doesn't contain the packageLocation (this is probably an internal error)");x!=="."&&!A.test(x)&&(x=`./${x}`);try{let I=B1e({packageJSONUrl:(0,fd.pathToFileURL)(Ae.fromPortablePath(tt)),packageSubpath:x,exports:He.exports,base:ke?(0,fd.pathToFileURL)(Ae.fromPortablePath(ke)):null,conditions:Te});return Ae.toPortablePath((0,fd.fileURLToPath)(I))}catch(I){throw ts("EXPORTS_RESOLUTION_FAILED",I.message,{unqualifiedPath:pu(Le),locator:Ve,pkgJson:He,subpath:pu(x),conditions:Te},I.code)}}function ce(Le,Te,{extensions:ke}){let Ve;try{Te.push(Le),Ve=e.fakeFs.statSync(Le)}catch{}if(Ve&&!Ve.isDirectory())return e.fakeFs.realpathSync(Le);if(Ve&&Ve.isDirectory()){let xe;try{xe=JSON.parse(e.fakeFs.readFileSync(K.join(Le,mr.manifest),"utf8"))}catch{}let tt;if(xe&&xe.main&&(tt=K.resolve(Le,xe.main)),tt&&tt!==Le){let He=ce(tt,Te,{extensions:ke});if(He!==null)return He}}for(let xe=0,tt=ke.length;xe{let x=JSON.stringify(He.name);if(Ve.has(x))return;Ve.add(x);let I=me(He);for(let S of I)if(U(S).packagePeers.has(Le))xe(S);else{let R=ke.get(S.name);typeof R>"u"&&ke.set(S.name,R=new Set),R.add(S.reference)}};xe(Te);let tt=[];for(let He of[...ke.keys()].sort())for(let x of[...ke.get(He)].sort())tt.push({name:He,reference:x});return tt}function fe(Le,{resolveIgnored:Te=!1,includeDiscardFromLookup:ke=!1}={}){if(he(Le)&&!Te)return null;let Ve=K.relative(t.basePath,Le);Ve.match(n)||(Ve=`./${Ve}`),Ve.endsWith("/")||(Ve=`${Ve}/`);do{let xe=b.get(Ve);if(typeof xe>"u"||xe.discardFromLookup&&!ke){Ve=Ve.substring(0,Ve.lastIndexOf("/",Ve.length-2)+1);continue}return xe.locator}while(Ve!=="");return null}function ie(Le){try{return e.fakeFs.readFileSync(Ae.toPortablePath(Le),"utf8")}catch(Te){if(Te.code==="ENOENT")return;throw Te}}function Z(Le,Te,{considerBuiltins:ke=!0}={}){if(Le.startsWith("#"))throw new Error("resolveToUnqualified can not handle private import mappings");if(Le==="pnpapi")return Ae.toPortablePath(e.pnpapiResolution);if(ke&&(0,tp.isBuiltin)(Le))return null;let Ve=pu(Le),xe=Te&&pu(Te);if(Te&&he(Te)&&(!K.isAbsolute(Le)||fe(Le)===null)){let x=Ie(Le,Te);if(x===!1)throw ts("BUILTIN_NODE_RESOLUTION_FAILED",`The builtin node resolution algorithm was unable to resolve the requested module (it didn't go through the pnp resolver because the issuer was explicitely ignored by the regexp) Require request: "${Ve}" Required by: ${xe} `,{request:Ve,issuer:xe});return Ae.toPortablePath(x)}let tt,He=Le.match(a);if(He){if(!Te)throw ts("API_ERROR","The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute",{request:Ve,issuer:xe});let[,x,I]=He,S=fe(Te);if(!S){let Fe=Ie(Le,Te);if(Fe===!1)throw ts("BUILTIN_NODE_RESOLUTION_FAILED",`The builtin node resolution algorithm was unable to resolve the requested module (it didn't go through the pnp resolver because the issuer doesn't seem to be part of the Yarn-managed dependency tree). Require path: "${Ve}" Required by: ${xe} `,{request:Ve,issuer:xe});return Ae.toPortablePath(Fe)}let R=U(S).packageDependencies.get(x),J=null;if(R==null&&S.name!==null){let Fe=t.fallbackExclusionList.get(S.name);if(!Fe||!Fe.has(S.reference)){for(let Et=0,qt=h.length;Etz(lt))?X=ts("MISSING_PEER_DEPENDENCY",`${S.name} tried to access ${x} (a peer dependency) but it isn't provided by your application; this makes the require call ambiguous and unsound. Required package: ${x}${x!==Ve?` (via "${Ve}")`:""} Required by: ${S.name}@${S.reference} (via ${xe}) ${Fe.map(lt=>`Ancestor breaking the chain: ${lt.name}@${lt.reference} `).join("")} `,{request:Ve,issuer:xe,issuerLocator:Object.assign({},S),dependencyName:x,brokenAncestors:Fe}):X=ts("MISSING_PEER_DEPENDENCY",`${S.name} tried to access ${x} (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound. Required package: ${x}${x!==Ve?` (via "${Ve}")`:""} Required by: ${S.name}@${S.reference} (via ${xe}) ${Fe.map(lt=>`Ancestor breaking the chain: ${lt.name}@${lt.reference} `).join("")} `,{request:Ve,issuer:xe,issuerLocator:Object.assign({},S),dependencyName:x,brokenAncestors:Fe})}else R===void 0&&(!ke&&(0,tp.isBuiltin)(Le)?z(S)?X=ts("UNDECLARED_DEPENDENCY",`Your application tried to access ${x}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since ${x} isn't otherwise declared in your dependencies, this makes the require call ambiguous and unsound. Required package: ${x}${x!==Ve?` (via "${Ve}")`:""} Required by: ${xe} `,{request:Ve,issuer:xe,dependencyName:x}):X=ts("UNDECLARED_DEPENDENCY",`${S.name} tried to access ${x}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since ${x} isn't otherwise declared in ${S.name}'s dependencies, this makes the require call ambiguous and unsound. Required package: ${x}${x!==Ve?` (via "${Ve}")`:""} Required by: ${xe} `,{request:Ve,issuer:xe,issuerLocator:Object.assign({},S),dependencyName:x}):z(S)?X=ts("UNDECLARED_DEPENDENCY",`Your application tried to access ${x}, but it isn't declared in your dependencies; this makes the require call ambiguous and unsound. Required package: ${x}${x!==Ve?` (via "${Ve}")`:""} Required by: ${xe} `,{request:Ve,issuer:xe,dependencyName:x}):X=ts("UNDECLARED_DEPENDENCY",`${S.name} tried to access ${x}, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound. Required package: ${x}${x!==Ve?` (via "${Ve}")`:""} Required by: ${S.name}@${S.reference} (via ${xe}) `,{request:Ve,issuer:xe,issuerLocator:Object.assign({},S),dependencyName:x}));if(R==null){if(J===null||X===null)throw X||new Error("Assertion failed: Expected an error to have been set");R=J;let Fe=X.message.replace(/\n.*/g,"");X.message=Fe,!E.has(Fe)&&o!==0&&(E.add(Fe),process.emitWarning(X))}let $=Array.isArray(R)?{name:R[0],reference:R[1]}:{name:x,reference:R},se=U($);if(!se.packageLocation)throw ts("MISSING_DEPENDENCY",`A dependency seems valid but didn't get installed for some reason. This might be caused by a partial install, such as dev vs prod. Required package: ${$.name}@${$.reference}${$.name!==Ve?` (via "${Ve}")`:""} Required by: ${S.name}@${S.reference} (via ${xe}) `,{request:Ve,issuer:xe,dependencyLocator:Object.assign({},$)});let be=se.packageLocation;I?tt=K.join(be,I):tt=be}else if(K.isAbsolute(Le))tt=K.normalize(Le);else{if(!Te)throw ts("API_ERROR","The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute",{request:Ve,issuer:xe});let x=K.resolve(Te);Te.match(u)?tt=K.normalize(K.join(x,Le)):tt=K.normalize(K.join(K.dirname(x),Le))}return K.normalize(tt)}function Pe(Le,Te,ke=te,Ve){if(n.test(Le))return Te;let xe=le(Te,ke,Ve);return xe?K.normalize(xe):Te}function Re(Le,{extensions:Te=Object.keys(tp.Module._extensions)}={}){let ke=[],Ve=ce(Le,ke,{extensions:Te});if(Ve)return K.normalize(Ve);{Q1e(ke.map(He=>Ae.fromPortablePath(He)));let xe=pu(Le),tt=fe(Le);if(tt){let{packageLocation:He}=U(tt),x=!0;try{e.fakeFs.accessSync(He)}catch(I){if(I?.code==="ENOENT")x=!1;else{let S=(I?.message??I??"empty exception thrown").replace(/^[A-Z]/,y=>y.toLowerCase());throw ts("QUALIFIED_PATH_RESOLUTION_FAILED",`Required package exists but could not be accessed (${S}). Missing package: ${tt.name}@${tt.reference} Expected package location: ${pu(He)} `,{unqualifiedPath:xe,extensions:Te})}}if(!x){let I=He.includes("/unplugged/")?"Required unplugged package missing from disk. This may happen when switching branches without running installs (unplugged packages must be fully materialized on disk to work).":"Required package missing from disk. If you keep your packages inside your repository then restarting the Node process may be enough. Otherwise, try to run an install first.";throw ts("QUALIFIED_PATH_RESOLUTION_FAILED",`${I} Missing package: ${tt.name}@${tt.reference} Expected package location: ${pu(He)} `,{unqualifiedPath:xe,extensions:Te})}}throw ts("QUALIFIED_PATH_RESOLUTION_FAILED",`Qualified path resolution failed: we looked for the following paths, but none could be accessed. Source path: ${xe} ${ke.map(He=>`Not found: ${pu(He)} `).join("")}`,{unqualifiedPath:xe,extensions:Te})}}function ht(Le,Te,ke){if(!Te)throw new Error("Assertion failed: An issuer is required to resolve private import mappings");let Ve=v1e({name:Le,base:(0,fd.pathToFileURL)(Ae.fromPortablePath(Te)),conditions:ke.conditions??te,readFileSyncFn:ie});if(Ve instanceof URL)return Re(Ae.toPortablePath((0,fd.fileURLToPath)(Ve)),{extensions:ke.extensions});if(Ve.startsWith("#"))throw new Error("Mapping from one private import to another isn't allowed");return q(Ve,Te,ke)}function q(Le,Te,ke={}){try{if(Le.startsWith("#"))return ht(Le,Te,ke);let{considerBuiltins:Ve,extensions:xe,conditions:tt}=ke,He=Z(Le,Te,{considerBuiltins:Ve});if(Le==="pnpapi")return He;if(He===null)return null;let x=()=>Te!==null?he(Te):!1,I=(!Ve||!(0,tp.isBuiltin)(Le))&&!x()?Pe(Le,He,tt,Te):He;return Re(I,{extensions:xe})}catch(Ve){throw Object.hasOwn(Ve,"pnpCode")&&Object.assign(Ve.data,{request:pu(Le),issuer:Te&&pu(Te)}),Ve}}function nt(Le){let Te=K.normalize(Le),ke=qs.resolveVirtual(Te);return ke!==Te?ke:null}return{VERSIONS:De,topLevel:Ee,getLocator:(Le,Te)=>Array.isArray(Te)?{name:Te[0],reference:Te[1]}:{name:Le,reference:Te},getDependencyTreeRoots:()=>[...t.dependencyTreeRoots],getAllLocators(){let Le=[];for(let[Te,ke]of D)for(let Ve of ke.keys())Te!==null&&Ve!==null&&Le.push({name:Te,reference:Ve});return Le},getPackageInformation:Le=>{let Te=g(Le);if(Te===null)return null;let ke=Ae.fromPortablePath(Te.packageLocation);return{...Te,packageLocation:ke}},findPackageLocator:Le=>fe(Ae.toPortablePath(Le)),resolveToUnqualified:N("resolveToUnqualified",(Le,Te,ke)=>{let Ve=Te!==null?Ae.toPortablePath(Te):null,xe=Z(Ae.toPortablePath(Le),Ve,ke);return xe===null?null:Ae.fromPortablePath(xe)}),resolveUnqualified:N("resolveUnqualified",(Le,Te)=>Ae.fromPortablePath(Re(Ae.toPortablePath(Le),Te))),resolveRequest:N("resolveRequest",(Le,Te,ke)=>{let Ve=Te!==null?Ae.toPortablePath(Te):null,xe=q(Ae.toPortablePath(Le),Ve,ke);return xe===null?null:Ae.fromPortablePath(xe)}),resolveVirtual:N("resolveVirtual",Le=>{let Te=nt(Ae.toPortablePath(Le));return Te!==null?Ae.fromPortablePath(Te):null})}}Pt();var F1e=(t,e,r)=>{let o=gv(t),a=Pj(o,{basePath:e}),n=Ae.join(e,mr.pnpCjs);return Oj(a,{fakeFs:r,pnpapiResolution:n})};var Uj=et(T1e());Gt();var CA={};Kt(CA,{checkManifestCompatibility:()=>L1e,extractBuildRequest:()=>ZQ,getExtractHint:()=>_j,hasBindingGyp:()=>Hj});Ke();Pt();function L1e(t){return G.isPackageCompatible(t,Xi.getArchitectureSet())}function ZQ(t,e,r,{configuration:o}){let a=[];for(let n of["preinstall","install","postinstall"])e.manifest.scripts.has(n)&&a.push({type:0,script:n});return!e.manifest.scripts.has("install")&&e.misc.hasBindingGyp&&a.push({type:1,script:"node-gyp rebuild"}),a.length===0?null:t.linkType!=="HARD"?{skipped:!0,explain:n=>n.reportWarningOnce(6,`${G.prettyLocator(o,t)} lists build scripts, but is referenced through a soft link. Soft links don't support build scripts, so they'll be ignored.`)}:r&&r.built===!1?{skipped:!0,explain:n=>n.reportInfoOnce(5,`${G.prettyLocator(o,t)} lists build scripts, but its build has been explicitly disabled through configuration.`)}:!o.get("enableScripts")&&!r.built?{skipped:!0,explain:n=>n.reportWarningOnce(4,`${G.prettyLocator(o,t)} lists build scripts, but all build scripts have been disabled.`)}:L1e(t)?{skipped:!1,directives:a}:{skipped:!0,explain:n=>n.reportWarningOnce(76,`${G.prettyLocator(o,t)} The ${Xi.getArchitectureName()} architecture is incompatible with this package, build skipped.`)}}var vwt=new Set([".exe",".bin",".h",".hh",".hpp",".c",".cc",".cpp",".java",".jar",".node"]);function _j(t){return t.packageFs.getExtractHint({relevantExtensions:vwt})}function Hj(t){let e=K.join(t.prefixPath,"binding.gyp");return t.packageFs.existsSync(e)}var vv={};Kt(vv,{getUnpluggedPath:()=>Bv});Ke();Pt();function Bv(t,{configuration:e}){return K.resolve(e.get("pnpUnpluggedFolder"),G.slugifyLocator(t))}var Dwt=new Set([G.makeIdent(null,"open").identHash,G.makeIdent(null,"opn").identHash]),Yh=class{constructor(){this.mode="strict";this.pnpCache=new Map}getCustomDataKey(){return JSON.stringify({name:"PnpLinker",version:2})}supportsPackage(e,r){return this.isEnabled(r)}async findPackageLocation(e,r){if(!this.isEnabled(r))throw new Error("Assertion failed: Expected the PnP linker to be enabled");let o=Kh(r.project).cjs;if(!ae.existsSync(o))throw new ot(`The project in ${pe.pretty(r.project.configuration,`${r.project.cwd}/package.json`,pe.Type.PATH)} doesn't seem to have been installed - running an install there might help`);let a=qe.getFactoryWithDefault(this.pnpCache,o,()=>qe.dynamicRequire(o,{cachingStrategy:qe.CachingStrategy.FsTime})),n={name:G.stringifyIdent(e),reference:e.reference},u=a.getPackageInformation(n);if(!u)throw new ot(`Couldn't find ${G.prettyLocator(r.project.configuration,e)} in the currently installed PnP map - running an install might help`);return Ae.toPortablePath(u.packageLocation)}async findPackageLocator(e,r){if(!this.isEnabled(r))return null;let o=Kh(r.project).cjs;if(!ae.existsSync(o))return null;let n=qe.getFactoryWithDefault(this.pnpCache,o,()=>qe.dynamicRequire(o,{cachingStrategy:qe.CachingStrategy.FsTime})).findPackageLocator(Ae.fromPortablePath(e));return n?G.makeLocator(G.parseIdent(n.name),n.reference):null}makeInstaller(e){return new pd(e)}isEnabled(e){return!(e.project.configuration.get("nodeLinker")!=="pnp"||e.project.configuration.get("pnpMode")!==this.mode)}},pd=class{constructor(e){this.opts=e;this.mode="strict";this.asyncActions=new qe.AsyncActions(10);this.packageRegistry=new Map;this.virtualTemplates=new Map;this.isESMLoaderRequired=!1;this.customData={store:new Map};this.unpluggedPaths=new Set;this.opts=e}attachCustomData(e){this.customData=e}async installPackage(e,r,o){let a=G.stringifyIdent(e),n=e.reference,u=!!this.opts.project.tryWorkspaceByLocator(e),A=G.isVirtualLocator(e),p=e.peerDependencies.size>0&&!A,h=!p&&!u,E=!p&&e.linkType!=="SOFT",w,D;if(h||E){let te=A?G.devirtualizeLocator(e):e;w=this.customData.store.get(te.locatorHash),typeof w>"u"&&(w=await Pwt(r),e.linkType==="HARD"&&this.customData.store.set(te.locatorHash,w)),w.manifest.type==="module"&&(this.isESMLoaderRequired=!0),D=this.opts.project.getDependencyMeta(te,e.version)}let b=h?ZQ(e,w,D,{configuration:this.opts.project.configuration}):null,C=E?await this.unplugPackageIfNeeded(e,w,r,D,o):r.packageFs;if(K.isAbsolute(r.prefixPath))throw new Error(`Assertion failed: Expected the prefix path (${r.prefixPath}) to be relative to the parent`);let T=K.resolve(C.getRealPath(),r.prefixPath),N=qj(this.opts.project.cwd,T),U=new Map,z=new Set;if(A){for(let te of e.peerDependencies.values())U.set(G.stringifyIdent(te),null),z.add(G.stringifyIdent(te));if(!u){let te=G.devirtualizeLocator(e);this.virtualTemplates.set(te.locatorHash,{location:qj(this.opts.project.cwd,qs.resolveVirtual(T)),locator:te})}}return qe.getMapWithDefault(this.packageRegistry,a).set(n,{packageLocation:N,packageDependencies:U,packagePeers:z,linkType:e.linkType,discardFromLookup:r.discardFromLookup||!1}),{packageLocation:T,buildRequest:b}}async attachInternalDependencies(e,r){let o=this.getPackageInformation(e);for(let[a,n]of r){let u=G.areIdentsEqual(a,n)?n.reference:[G.stringifyIdent(n),n.reference];o.packageDependencies.set(G.stringifyIdent(a),u)}}async attachExternalDependents(e,r){for(let o of r)this.getDiskInformation(o).packageDependencies.set(G.stringifyIdent(e),e.reference)}async finalizeInstall(){if(this.opts.project.configuration.get("pnpMode")!==this.mode)return;let e=Kh(this.opts.project);if(this.isEsmEnabled()||await ae.removePromise(e.esmLoader),this.opts.project.configuration.get("nodeLinker")!=="pnp"){await ae.removePromise(e.cjs),await ae.removePromise(e.data),await ae.removePromise(e.esmLoader),await ae.removePromise(this.opts.project.configuration.get("pnpUnpluggedFolder"));return}for(let{locator:E,location:w}of this.virtualTemplates.values())qe.getMapWithDefault(this.packageRegistry,G.stringifyIdent(E)).set(E.reference,{packageLocation:w,packageDependencies:new Map,packagePeers:new Set,linkType:"SOFT",discardFromLookup:!1});this.packageRegistry.set(null,new Map([[null,this.getPackageInformation(this.opts.project.topLevelWorkspace.anchoredLocator)]]));let r=this.opts.project.configuration.get("pnpFallbackMode"),o=this.opts.project.workspaces.map(({anchoredLocator:E})=>({name:G.stringifyIdent(E),reference:E.reference})),a=r!=="none",n=[],u=new Map,A=qe.buildIgnorePattern([".yarn/sdks/**",...this.opts.project.configuration.get("pnpIgnorePatterns")]),p=this.packageRegistry,h=this.opts.project.configuration.get("pnpShebang");if(r==="dependencies-only")for(let E of this.opts.project.storedPackages.values())this.opts.project.tryWorkspaceByLocator(E)&&n.push({name:G.stringifyIdent(E),reference:E.reference});return await this.asyncActions.wait(),await this.finalizeInstallWithPnp({dependencyTreeRoots:o,enableTopLevelFallback:a,fallbackExclusionList:n,fallbackPool:u,ignorePattern:A,packageRegistry:p,shebang:h}),{customData:this.customData}}async transformPnpSettings(e){}isEsmEnabled(){if(this.opts.project.configuration.sources.has("pnpEnableEsmLoader"))return this.opts.project.configuration.get("pnpEnableEsmLoader");if(this.isESMLoaderRequired)return!0;for(let e of this.opts.project.workspaces)if(e.manifest.type==="module")return!0;return!1}async finalizeInstallWithPnp(e){let r=Kh(this.opts.project),o=await this.locateNodeModules(e.ignorePattern);if(o.length>0){this.opts.report.reportWarning(31,"One or more node_modules have been detected and will be removed. This operation may take some time.");for(let n of o)await ae.removePromise(n)}if(await this.transformPnpSettings(e),this.opts.project.configuration.get("pnpEnableInlining")){let n=l1e(e);await ae.changeFilePromise(r.cjs,n,{automaticNewlines:!0,mode:493}),await ae.removePromise(r.data)}else{let{dataFile:n,loaderFile:u}=c1e(e);await ae.changeFilePromise(r.cjs,u,{automaticNewlines:!0,mode:493}),await ae.changeFilePromise(r.data,n,{automaticNewlines:!0,mode:420})}this.isEsmEnabled()&&(this.opts.report.reportWarning(0,"ESM support for PnP uses the experimental loader API and is therefore experimental"),await ae.changeFilePromise(r.esmLoader,(0,Uj.default)(),{automaticNewlines:!0,mode:420}));let a=this.opts.project.configuration.get("pnpUnpluggedFolder");if(this.unpluggedPaths.size===0)await ae.removePromise(a);else for(let n of await ae.readdirPromise(a)){let u=K.resolve(a,n);this.unpluggedPaths.has(u)||await ae.removePromise(u)}}async locateNodeModules(e){let r=[],o=e?new RegExp(e):null;for(let a of this.opts.project.workspaces){let n=K.join(a.cwd,"node_modules");if(o&&o.test(K.relative(this.opts.project.cwd,a.cwd))||!ae.existsSync(n))continue;let u=await ae.readdirPromise(n,{withFileTypes:!0}),A=u.filter(p=>!p.isDirectory()||p.name===".bin"||!p.name.startsWith("."));if(A.length===u.length)r.push(n);else for(let p of A)r.push(K.join(n,p.name))}return r}async unplugPackageIfNeeded(e,r,o,a,n){return this.shouldBeUnplugged(e,r,a)?this.unplugPackage(e,o,n):o.packageFs}shouldBeUnplugged(e,r,o){return typeof o.unplugged<"u"?o.unplugged:Dwt.has(e.identHash)||e.conditions!=null?!0:r.manifest.preferUnplugged!==null?r.manifest.preferUnplugged:!!(ZQ(e,r,o,{configuration:this.opts.project.configuration})?.skipped===!1||r.misc.extractHint)}async unplugPackage(e,r,o){let a=Bv(e,{configuration:this.opts.project.configuration});return this.opts.project.disabledLocators.has(e.locatorHash)?new ju(a,{baseFs:r.packageFs,pathUtils:K}):(this.unpluggedPaths.add(a),o.holdFetchResult(this.asyncActions.set(e.locatorHash,async()=>{let n=K.join(a,r.prefixPath,".ready");await ae.existsPromise(n)||(this.opts.project.storedBuildState.delete(e.locatorHash),await ae.mkdirPromise(a,{recursive:!0}),await ae.copyPromise(a,Bt.dot,{baseFs:r.packageFs,overwrite:!1}),await ae.writeFilePromise(n,""))})),new En(a))}getPackageInformation(e){let r=G.stringifyIdent(e),o=e.reference,a=this.packageRegistry.get(r);if(!a)throw new Error(`Assertion failed: The package information store should have been available (for ${G.prettyIdent(this.opts.project.configuration,e)})`);let n=a.get(o);if(!n)throw new Error(`Assertion failed: The package information should have been available (for ${G.prettyLocator(this.opts.project.configuration,e)})`);return n}getDiskInformation(e){let r=qe.getMapWithDefault(this.packageRegistry,"@@disk"),o=qj(this.opts.project.cwd,e);return qe.getFactoryWithDefault(r,o,()=>({packageLocation:o,packageDependencies:new Map,packagePeers:new Set,linkType:"SOFT",discardFromLookup:!1}))}};function qj(t,e){let r=K.relative(t,e);return r.match(/^\.{0,2}\//)||(r=`./${r}`),r.replace(/\/?$/,"/")}async function Pwt(t){let e=await _t.tryFind(t.prefixPath,{baseFs:t.packageFs})??new _t,r=new Set(["preinstall","install","postinstall"]);for(let o of e.scripts.keys())r.has(o)||e.scripts.delete(o);return{manifest:{scripts:e.scripts,preferUnplugged:e.preferUnplugged,type:e.type},misc:{extractHint:_j(t),hasBindingGyp:Hj(t)}}}Ke();Ke();Gt();var N1e=et(Xo());var QC=class extends ut{constructor(){super(...arguments);this.all=de.Boolean("-A,--all",!1,{description:"Unplug direct dependencies from the entire project"});this.recursive=de.Boolean("-R,--recursive",!1,{description:"Unplug both direct and transitive dependencies"});this.json=de.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.patterns=de.Rest()}static{this.paths=[["unplug"]]}static{this.usage=st.Usage({description:"force the unpacking of a list of packages",details:"\n This command will add the selectors matching the specified patterns to the list of packages that must be unplugged when installed.\n\n A package being unplugged means that instead of being referenced directly through its archive, it will be unpacked at install time in the directory configured via `pnpUnpluggedFolder`. Note that unpacking packages this way is generally not recommended because it'll make it harder to store your packages within the repository. However, it's a good approach to quickly and safely debug some packages, and can even sometimes be required depending on the context (for example when the package contains shellscripts).\n\n Running the command will set a persistent flag inside your top-level `package.json`, in the `dependenciesMeta` field. As such, to undo its effects, you'll need to revert the changes made to the manifest and run `yarn install` to apply the modification.\n\n By default, only direct dependencies from the current workspace are affected. If `-A,--all` is set, direct dependencies from the entire project are affected. Using the `-R,--recursive` flag will affect transitive dependencies as well as direct ones.\n\n This command accepts glob patterns inside the scope and name components (not the range). Make sure to escape the patterns to prevent your own shell from trying to expand them.\n ",examples:[["Unplug the lodash dependency from the active workspace","yarn unplug lodash"],["Unplug all instances of lodash referenced by any workspace","yarn unplug lodash -A"],["Unplug all instances of lodash referenced by the active workspace and its dependencies","yarn unplug lodash -R"],["Unplug all instances of lodash, anywhere","yarn unplug lodash -AR"],["Unplug one specific version of lodash","yarn unplug lodash@1.2.3"],["Unplug all packages with the `@babel` scope","yarn unplug '@babel/*'"],["Unplug all packages (only for testing, not recommended)","yarn unplug -R '*'"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:o,workspace:a}=await Qt.find(r,this.context.cwd),n=await Wr.find(r);if(!a)throw new or(o.cwd,this.context.cwd);if(r.get("nodeLinker")!=="pnp")throw new ot("This command can only be used if the `nodeLinker` option is set to `pnp`");await o.restoreInstallState();let u=new Set(this.patterns),A=this.patterns.map(b=>{let C=G.parseDescriptor(b),T=C.range!=="unknown"?C:G.makeDescriptor(C,"*");if(!Ur.validRange(T.range))throw new ot(`The range of the descriptor patterns must be a valid semver range (${G.prettyDescriptor(r,T)})`);return N=>{let U=G.stringifyIdent(N);return!N1e.default.isMatch(U,G.stringifyIdent(T))||N.version&&!Ur.satisfiesWithPrereleases(N.version,T.range)?!1:(u.delete(b),!0)}}),p=()=>{let b=[];for(let C of o.storedPackages.values())!o.tryWorkspaceByLocator(C)&&!G.isVirtualLocator(C)&&A.some(T=>T(C))&&b.push(C);return b},h=b=>{let C=new Set,T=[],N=(U,z)=>{if(C.has(U.locatorHash))return;let te=!!o.tryWorkspaceByLocator(U);if(!(z>0&&!this.recursive&&te)&&(C.add(U.locatorHash),!o.tryWorkspaceByLocator(U)&&A.some(le=>le(U))&&T.push(U),!(z>0&&!this.recursive)))for(let le of U.dependencies.values()){let ce=o.storedResolutions.get(le.descriptorHash);if(!ce)throw new Error("Assertion failed: The resolution should have been registered");let ue=o.storedPackages.get(ce);if(!ue)throw new Error("Assertion failed: The package should have been registered");N(ue,z+1)}};for(let U of b)N(U.anchoredPackage,0);return T},E,w;if(this.all&&this.recursive?(E=p(),w="the project"):this.all?(E=h(o.workspaces),w="any workspace"):(E=h([a]),w="this workspace"),u.size>1)throw new ot(`Patterns ${pe.prettyList(r,u,pe.Type.CODE)} don't match any packages referenced by ${w}`);if(u.size>0)throw new ot(`Pattern ${pe.prettyList(r,u,pe.Type.CODE)} doesn't match any packages referenced by ${w}`);E=qe.sortMap(E,b=>G.stringifyLocator(b));let D=await Lt.start({configuration:r,stdout:this.context.stdout,json:this.json},async b=>{for(let C of E){let T=C.version??"unknown",N=o.topLevelWorkspace.manifest.ensureDependencyMeta(G.makeDescriptor(C,T));N.unplugged=!0,b.reportInfo(0,`Will unpack ${G.prettyLocator(r,C)} to ${pe.pretty(r,Bv(C,{configuration:r}),pe.Type.PATH)}`),b.reportJson({locator:G.stringifyLocator(C),version:T})}await o.topLevelWorkspace.persistManifest(),this.json||b.reportSeparator()});return D.hasErrors()?D.exitCode():await o.installWithNewReport({json:this.json,stdout:this.context.stdout},{cache:n})}};var Kh=t=>({cjs:K.join(t.cwd,mr.pnpCjs),data:K.join(t.cwd,mr.pnpData),esmLoader:K.join(t.cwd,mr.pnpEsmLoader)}),M1e=t=>/\s/.test(t)?JSON.stringify(t):t;async function Swt(t,e,r){let o=/\s*--require\s+\S*\.pnp\.c?js\s*/g,a=/\s*--experimental-loader\s+\S*\.pnp\.loader\.mjs\s*/,n=(e.NODE_OPTIONS??"").replace(o," ").replace(a," ").trim();if(t.configuration.get("nodeLinker")!=="pnp"){e.NODE_OPTIONS=n||void 0;return}let u=Kh(t),A=`--require ${M1e(Ae.fromPortablePath(u.cjs))}`;ae.existsSync(u.esmLoader)&&(A=`${A} --experimental-loader ${(0,O1e.pathToFileURL)(Ae.fromPortablePath(u.esmLoader)).href}`),ae.existsSync(u.cjs)&&(e.NODE_OPTIONS=n?`${A} ${n}`:A)}async function xwt(t,e){let r=Kh(t);e(r.cjs),e(r.data),e(r.esmLoader),e(t.configuration.get("pnpUnpluggedFolder"))}var bwt={hooks:{populateYarnPaths:xwt,setupScriptEnvironment:Swt},configuration:{nodeLinker:{description:'The linker used for installing Node packages, one of: "pnp", "pnpm", or "node-modules"',type:"STRING",default:"pnp"},winLinkType:{description:"Whether Yarn should use Windows Junctions or symlinks when creating links on Windows.",type:"STRING",values:["junctions","symlinks"],default:"junctions"},pnpMode:{description:"If 'strict', generates standard PnP maps. If 'loose', merges them with the n_m resolution.",type:"STRING",default:"strict"},pnpShebang:{description:"String to prepend to the generated PnP script",type:"STRING",default:"#!/usr/bin/env node"},pnpIgnorePatterns:{description:"Array of glob patterns; files matching them will use the classic resolution",type:"STRING",default:[],isArray:!0},pnpEnableEsmLoader:{description:"If true, Yarn will generate an ESM loader (`.pnp.loader.mjs`). If this is not explicitly set Yarn tries to automatically detect whether ESM support is required.",type:"BOOLEAN",default:!1},pnpEnableInlining:{description:"If true, the PnP data will be inlined along with the generated loader",type:"BOOLEAN",default:!0},pnpFallbackMode:{description:"If true, the generated PnP loader will follow the top-level fallback rule",type:"STRING",default:"dependencies-only"},pnpUnpluggedFolder:{description:"Folder where the unplugged packages must be stored",type:"ABSOLUTE_PATH",default:"./.yarn/unplugged"}},linkers:[Yh],commands:[QC]},kwt=bwt;var Y1e=et(j1e());Gt();var Jj=et(ve("crypto")),K1e=et(ve("fs")),V1e=1,xi="node_modules",$Q=".bin",z1e=".yarn-state.yml",Kwt=1e3,Xj=(o=>(o.CLASSIC="classic",o.HARDLINKS_LOCAL="hardlinks-local",o.HARDLINKS_GLOBAL="hardlinks-global",o))(Xj||{}),Dv=class{constructor(){this.installStateCache=new Map}getCustomDataKey(){return JSON.stringify({name:"NodeModulesLinker",version:3})}supportsPackage(e,r){return this.isEnabled(r)}async findPackageLocation(e,r){if(!this.isEnabled(r))throw new Error("Assertion failed: Expected the node-modules linker to be enabled");let o=r.project.tryWorkspaceByLocator(e);if(o)return o.cwd;let a=await qe.getFactoryWithDefault(this.installStateCache,r.project.cwd,async()=>await zj(r.project,{unrollAliases:!0}));if(a===null)throw new ot("Couldn't find the node_modules state file - running an install might help (findPackageLocation)");let n=a.locatorMap.get(G.stringifyLocator(e));if(!n){let p=new ot(`Couldn't find ${G.prettyLocator(r.project.configuration,e)} in the currently installed node_modules map - running an install might help`);throw p.code="LOCATOR_NOT_INSTALLED",p}let u=n.locations.sort((p,h)=>p.split(K.sep).length-h.split(K.sep).length),A=K.join(r.project.configuration.startingCwd,xi);return u.find(p=>K.contains(A,p))||n.locations[0]}async findPackageLocator(e,r){if(!this.isEnabled(r))return null;let o=await qe.getFactoryWithDefault(this.installStateCache,r.project.cwd,async()=>await zj(r.project,{unrollAliases:!0}));if(o===null)return null;let{locationRoot:a,segments:n}=eF(K.resolve(e),{skipPrefix:r.project.cwd}),u=o.locationTree.get(a);if(!u)return null;let A=u.locator;for(let p of n){if(u=u.children.get(p),!u)break;A=u.locator||A}return G.parseLocator(A)}makeInstaller(e){return new Vj(e)}isEnabled(e){return e.project.configuration.get("nodeLinker")==="node-modules"}},Vj=class{constructor(e){this.opts=e;this.localStore=new Map;this.realLocatorChecksums=new Map;this.customData={store:new Map}}attachCustomData(e){this.customData=e}async installPackage(e,r){let o=K.resolve(r.packageFs.getRealPath(),r.prefixPath),a=this.customData.store.get(e.locatorHash);if(typeof a>"u"&&(a=await Vwt(e,r),e.linkType==="HARD"&&this.customData.store.set(e.locatorHash,a)),!G.isPackageCompatible(e,this.opts.project.configuration.getSupportedArchitectures()))return{packageLocation:null,buildRequest:null};let n=new Map,u=new Set;n.has(G.stringifyIdent(e))||n.set(G.stringifyIdent(e),e.reference);let A=e;if(G.isVirtualLocator(e)){A=G.devirtualizeLocator(e);for(let E of e.peerDependencies.values())n.set(G.stringifyIdent(E),null),u.add(G.stringifyIdent(E))}let p={packageLocation:`${Ae.fromPortablePath(o)}/`,packageDependencies:n,packagePeers:u,linkType:e.linkType,discardFromLookup:r.discardFromLookup??!1};this.localStore.set(e.locatorHash,{pkg:e,customPackageData:a,dependencyMeta:this.opts.project.getDependencyMeta(e,e.version),pnpNode:p});let h=r.checksum?r.checksum.substring(r.checksum.indexOf("/")+1):null;return this.realLocatorChecksums.set(A.locatorHash,h),{packageLocation:o,buildRequest:null}}async attachInternalDependencies(e,r){let o=this.localStore.get(e.locatorHash);if(typeof o>"u")throw new Error("Assertion failed: Expected information object to have been registered");for(let[a,n]of r){let u=G.areIdentsEqual(a,n)?n.reference:[G.stringifyIdent(n),n.reference];o.pnpNode.packageDependencies.set(G.stringifyIdent(a),u)}}async attachExternalDependents(e,r){throw new Error("External dependencies haven't been implemented for the node-modules linker")}async finalizeInstall(){if(this.opts.project.configuration.get("nodeLinker")!=="node-modules")return;let e=new qs({baseFs:new iA({maxOpenFiles:80,readOnlyArchives:!0})}),r=await zj(this.opts.project),o=this.opts.project.configuration.get("nmMode");(r===null||o!==r.nmMode)&&(this.opts.project.storedBuildState.clear(),r={locatorMap:new Map,binSymlinks:new Map,locationTree:new Map,nmMode:o,mtimeMs:0});let a=new Map(this.opts.project.workspaces.map(D=>{let b=this.opts.project.configuration.get("nmHoistingLimits");try{b=qe.validateEnum(fv,D.manifest.installConfig?.hoistingLimits??b)}catch{let T=G.prettyWorkspace(this.opts.project.configuration,D);this.opts.report.reportWarning(57,`${T}: Invalid 'installConfig.hoistingLimits' value. Expected one of ${Object.values(fv).join(", ")}, using default: "${b}"`)}return[D.relativeCwd,b]})),n=new Map(this.opts.project.workspaces.map(D=>{let b=this.opts.project.configuration.get("nmSelfReferences");return b=D.manifest.installConfig?.selfReferences??b,[D.relativeCwd,b]})),u={VERSIONS:{std:1},topLevel:{name:null,reference:null},getLocator:(D,b)=>Array.isArray(b)?{name:b[0],reference:b[1]}:{name:D,reference:b},getDependencyTreeRoots:()=>this.opts.project.workspaces.map(D=>{let b=D.anchoredLocator;return{name:G.stringifyIdent(b),reference:b.reference}}),getPackageInformation:D=>{let b=D.reference===null?this.opts.project.topLevelWorkspace.anchoredLocator:G.makeLocator(G.parseIdent(D.name),D.reference),C=this.localStore.get(b.locatorHash);if(typeof C>"u")throw new Error("Assertion failed: Expected the package reference to have been registered");return C.pnpNode},findPackageLocator:D=>{let b=this.opts.project.tryWorkspaceByCwd(Ae.toPortablePath(D));if(b!==null){let C=b.anchoredLocator;return{name:G.stringifyIdent(C),reference:C.reference}}throw new Error("Assertion failed: Unimplemented")},resolveToUnqualified:()=>{throw new Error("Assertion failed: Unimplemented")},resolveUnqualified:()=>{throw new Error("Assertion failed: Unimplemented")},resolveRequest:()=>{throw new Error("Assertion failed: Unimplemented")},resolveVirtual:D=>Ae.fromPortablePath(qs.resolveVirtual(Ae.toPortablePath(D)))},{tree:A,errors:p,preserveSymlinksRequired:h}=pv(u,{pnpifyFs:!1,validateExternalSoftLinks:!0,hoistingLimitsByCwd:a,project:this.opts.project,selfReferencesByCwd:n});if(!A){for(let{messageName:D,text:b}of p)this.opts.report.reportError(D,b);return}let E=vj(A);await e1t(r,E,{baseFs:e,project:this.opts.project,report:this.opts.report,realLocatorChecksums:this.realLocatorChecksums,loadManifest:async D=>{let b=G.parseLocator(D),C=this.localStore.get(b.locatorHash);if(typeof C>"u")throw new Error("Assertion failed: Expected the slot to exist");return C.customPackageData.manifest}});let w=[];for(let[D,b]of E.entries()){if(Z1e(D))continue;let C=G.parseLocator(D),T=this.localStore.get(C.locatorHash);if(typeof T>"u")throw new Error("Assertion failed: Expected the slot to exist");if(this.opts.project.tryWorkspaceByLocator(T.pkg))continue;let N=CA.extractBuildRequest(T.pkg,T.customPackageData,T.dependencyMeta,{configuration:this.opts.project.configuration});N&&w.push({buildLocations:b.locations,locator:C,buildRequest:N})}return h&&this.opts.report.reportWarning(72,`The application uses portals and that's why ${pe.pretty(this.opts.project.configuration,"--preserve-symlinks",pe.Type.CODE)} Node option is required for launching it`),{customData:this.customData,records:w}}};async function Vwt(t,e){let r=await _t.tryFind(e.prefixPath,{baseFs:e.packageFs})??new _t,o=new Set(["preinstall","install","postinstall"]);for(let a of r.scripts.keys())o.has(a)||r.scripts.delete(a);return{manifest:{bin:r.bin,scripts:r.scripts},misc:{hasBindingGyp:CA.hasBindingGyp(e)}}}async function zwt(t,e,r,o,{installChangedByUser:a}){let n="";n+=`# Warning: This file is automatically generated. Removing it is fine, but will `,n+=`# cause your node_modules installation to become invalidated. `,n+=` `,n+=`__metadata: `,n+=` version: ${V1e} `,n+=` nmMode: ${o.value} `;let u=Array.from(e.keys()).sort(),A=G.stringifyLocator(t.topLevelWorkspace.anchoredLocator);for(let E of u){let w=e.get(E);n+=` `,n+=`${JSON.stringify(E)}: `,n+=` locations: `;for(let D of w.locations){let b=K.contains(t.cwd,D);if(b===null)throw new Error(`Assertion failed: Expected the path to be within the project (${D})`);n+=` - ${JSON.stringify(b)} `}if(w.aliases.length>0){n+=` aliases: `;for(let D of w.aliases)n+=` - ${JSON.stringify(D)} `}if(E===A&&r.size>0){n+=` bin: `;for(let[D,b]of r){let C=K.contains(t.cwd,D);if(C===null)throw new Error(`Assertion failed: Expected the path to be within the project (${D})`);n+=` ${JSON.stringify(C)}: `;for(let[T,N]of b){let U=K.relative(K.join(D,xi),N);n+=` ${JSON.stringify(T)}: ${JSON.stringify(U)} `}}}}let p=t.cwd,h=K.join(p,xi,z1e);a&&await ae.removePromise(h),await ae.changeFilePromise(h,n,{automaticNewlines:!0})}async function zj(t,{unrollAliases:e=!1}={}){let r=t.cwd,o=K.join(r,xi,z1e),a;try{a=await ae.statPromise(o)}catch{}if(!a)return null;let n=Ki(await ae.readFilePromise(o,"utf8"));if(n.__metadata.version>V1e)return null;let u=n.__metadata.nmMode||"classic",A=new Map,p=new Map;delete n.__metadata;for(let[h,E]of Object.entries(n)){let w=E.locations.map(b=>K.join(r,b)),D=E.bin;if(D)for(let[b,C]of Object.entries(D)){let T=K.join(r,Ae.toPortablePath(b)),N=qe.getMapWithDefault(p,T);for(let[U,z]of Object.entries(C))N.set(U,Ae.toPortablePath([T,xi,z].join(K.sep)))}if(A.set(h,{target:Bt.dot,linkType:"HARD",locations:w,aliases:E.aliases||[]}),e&&E.aliases)for(let b of E.aliases){let{scope:C,name:T}=G.parseLocator(h),N=G.makeLocator(G.makeIdent(C,T),b),U=G.stringifyLocator(N);A.set(U,{target:Bt.dot,linkType:"HARD",locations:w,aliases:[]})}}return{locatorMap:A,binSymlinks:p,locationTree:J1e(A,{skipPrefix:t.cwd}),nmMode:u,mtimeMs:a.mtimeMs}}var RC=async(t,e)=>{if(t.split(K.sep).indexOf(xi)<0)throw new Error(`Assertion failed: trying to remove dir that doesn't contain node_modules: ${t}`);try{let r;if(!e.innerLoop&&(r=await ae.lstatPromise(t),!r.isDirectory()&&!r.isSymbolicLink()||r.isSymbolicLink()&&!e.isWorkspaceDir)){await ae.unlinkPromise(t);return}let o=await ae.readdirPromise(t,{withFileTypes:!0});for(let n of o){let u=K.join(t,n.name);n.isDirectory()?(n.name!==xi||e&&e.innerLoop)&&await RC(u,{innerLoop:!0,contentsOnly:!1}):await ae.unlinkPromise(u)}let a=!e.innerLoop&&e.isWorkspaceDir&&r?.isSymbolicLink();!e.contentsOnly&&!a&&await ae.rmdirPromise(t)}catch(r){if(r.code!=="ENOENT"&&r.code!=="ENOTEMPTY")throw r}},G1e=4,eF=(t,{skipPrefix:e})=>{let r=K.contains(e,t);if(r===null)throw new Error(`Assertion failed: Writing attempt prevented to ${t} which is outside project root: ${e}`);let o=r.split(K.sep).filter(p=>p!==""),a=o.indexOf(xi),n=o.slice(0,a).join(K.sep),u=K.join(e,n),A=o.slice(a);return{locationRoot:u,segments:A}},J1e=(t,{skipPrefix:e})=>{let r=new Map;if(t===null)return r;let o=()=>({children:new Map,linkType:"HARD"});for(let[a,n]of t.entries()){if(n.linkType==="SOFT"&&K.contains(e,n.target)!==null){let A=qe.getFactoryWithDefault(r,n.target,o);A.locator=a,A.linkType=n.linkType}for(let u of n.locations){let{locationRoot:A,segments:p}=eF(u,{skipPrefix:e}),h=qe.getFactoryWithDefault(r,A,o);for(let E=0;E{if(process.platform==="win32"&&r==="junctions"){let o;try{o=await ae.lstatPromise(t)}catch{}if(!o||o.isDirectory()){await ae.symlinkPromise(t,e,"junction");return}}await ae.symlinkPromise(K.relative(K.dirname(e),t),e)};async function X1e(t,e,r){let o=K.join(t,`${Jj.default.randomBytes(16).toString("hex")}.tmp`);try{await ae.writeFilePromise(o,r);try{await ae.linkPromise(o,e)}catch{}}finally{await ae.unlinkPromise(o)}}async function Jwt({srcPath:t,dstPath:e,entry:r,globalHardlinksStore:o,baseFs:a,nmMode:n}){if(r.kind==="file"){if(n.value==="hardlinks-global"&&o&&r.digest){let A=K.join(o,r.digest.substring(0,2),`${r.digest.substring(2)}.dat`),p;try{let h=await ae.statPromise(A);if(h&&(!r.mtimeMs||h.mtimeMs>r.mtimeMs||h.mtimeMs{await ae.mkdirPromise(t,{recursive:!0});let A=async(E=Bt.dot)=>{let w=K.join(e,E),D=await r.readdirPromise(w,{withFileTypes:!0}),b=new Map;for(let C of D){let T=K.join(E,C.name),N,U=K.join(w,C.name);if(C.isFile()){if(N={kind:"file",mode:(await r.lstatPromise(U)).mode},a.value==="hardlinks-global"){let z=await bn.checksumFile(U,{baseFs:r,algorithm:"sha1"});N.digest=z}}else if(C.isDirectory())N={kind:"directory"};else if(C.isSymbolicLink())N={kind:"symlink",symlinkTo:await r.readlinkPromise(U)};else throw new Error(`Unsupported file type (file: ${U}, mode: 0o${await r.statSync(U).mode.toString(8).padStart(6,"0")})`);if(b.set(T,N),C.isDirectory()&&T!==xi){let z=await A(T);for(let[te,le]of z)b.set(te,le)}}return b},p;if(a.value==="hardlinks-global"&&o&&u){let E=K.join(o,u.substring(0,2),`${u.substring(2)}.json`);try{p=new Map(Object.entries(JSON.parse(await ae.readFilePromise(E,"utf8"))))}catch{p=await A()}}else p=await A();let h=!1;for(let[E,w]of p){let D=K.join(e,E),b=K.join(t,E);if(w.kind==="directory")await ae.mkdirPromise(b,{recursive:!0});else if(w.kind==="file"){let C=w.mtimeMs;await Jwt({srcPath:D,dstPath:b,entry:w,nmMode:a,baseFs:r,globalHardlinksStore:o}),w.mtimeMs!==C&&(h=!0)}else w.kind==="symlink"&&await Zj(K.resolve(K.dirname(b),w.symlinkTo),b,n)}if(a.value==="hardlinks-global"&&o&&h&&u){let E=K.join(o,u.substring(0,2),`${u.substring(2)}.json`);await ae.removePromise(E),await X1e(o,E,Buffer.from(JSON.stringify(Object.fromEntries(p))))}};function Zwt(t,e,r,o){let a=new Map,n=new Map,u=new Map,A=!1,p=(h,E,w,D,b)=>{let C=!0,T=K.join(h,E),N=new Set;if(E===xi||E.startsWith("@")){let z;try{z=ae.statSync(T)}catch{}C=!!z,z?z.mtimeMs>r?(A=!0,N=new Set(ae.readdirSync(T))):N=new Set(w.children.get(E).children.keys()):A=!0;let te=e.get(h);if(te){let le=K.join(h,xi,$Q),ce;try{ce=ae.statSync(le)}catch{}if(!ce)A=!0;else if(ce.mtimeMs>r){A=!0;let ue=new Set(ae.readdirSync(le)),Ie=new Map;n.set(h,Ie);for(let[he,De]of te)ue.has(he)&&Ie.set(he,De)}else n.set(h,te)}}else C=b.has(E);let U=w.children.get(E);if(C){let{linkType:z,locator:te}=U,le={children:new Map,linkType:z,locator:te};if(D.children.set(E,le),te){let ce=qe.getSetWithDefault(u,te);ce.add(T),u.set(te,ce)}for(let ce of U.children.keys())p(T,ce,U,le,N)}else U.locator&&o.storedBuildState.delete(G.parseLocator(U.locator).locatorHash)};for(let[h,E]of t){let{linkType:w,locator:D}=E,b={children:new Map,linkType:w,locator:D};if(a.set(h,b),D){let C=qe.getSetWithDefault(u,E.locator);C.add(h),u.set(E.locator,C)}E.children.has(xi)&&p(h,xi,E,b,new Set)}return{locationTree:a,binSymlinks:n,locatorLocations:u,installChangedByUser:A}}function Z1e(t){let e=G.parseDescriptor(t);return G.isVirtualDescriptor(e)&&(e=G.devirtualizeDescriptor(e)),e.range.startsWith("link:")}async function $wt(t,e,r,{loadManifest:o}){let a=new Map;for(let[A,{locations:p}]of t){let h=Z1e(A)?null:await o(A,p[0]),E=new Map;if(h)for(let[w,D]of h.bin){let b=K.join(p[0],D);D!==""&&ae.existsSync(b)&&E.set(w,D)}a.set(A,E)}let n=new Map,u=(A,p,h)=>{let E=new Map,w=K.contains(r,A);if(h.locator&&w!==null){let D=a.get(h.locator);for(let[b,C]of D){let T=K.join(A,Ae.toPortablePath(C));E.set(b,T)}for(let[b,C]of h.children){let T=K.join(A,b),N=u(T,T,C);N.size>0&&n.set(A,new Map([...n.get(A)||new Map,...N]))}}else for(let[D,b]of h.children){let C=u(K.join(A,D),p,b);for(let[T,N]of C)E.set(T,N)}return E};for(let[A,p]of e){let h=u(A,A,p);h.size>0&&n.set(A,new Map([...n.get(A)||new Map,...h]))}return n}var W1e=(t,e)=>{if(!t||!e)return t===e;let r=G.parseLocator(t);G.isVirtualLocator(r)&&(r=G.devirtualizeLocator(r));let o=G.parseLocator(e);return G.isVirtualLocator(o)&&(o=G.devirtualizeLocator(o)),G.areLocatorsEqual(r,o)};function $j(t){return K.join(t.get("globalFolder"),"store")}async function e1t(t,e,{baseFs:r,project:o,report:a,loadManifest:n,realLocatorChecksums:u}){let A=K.join(o.cwd,xi),{locationTree:p,binSymlinks:h,locatorLocations:E,installChangedByUser:w}=Zwt(t.locationTree,t.binSymlinks,t.mtimeMs,o),D=J1e(e,{skipPrefix:o.cwd}),b=[],C=async({srcDir:De,dstDir:Ee,linkType:g,globalHardlinksStore:me,nmMode:Ce,windowsLinkType:fe,packageChecksum:ie})=>{let Z=(async()=>{try{g==="SOFT"?(await ae.mkdirPromise(K.dirname(Ee),{recursive:!0}),await Zj(K.resolve(De),Ee,fe)):await Xwt(Ee,De,{baseFs:r,globalHardlinksStore:me,nmMode:Ce,windowsLinkType:fe,packageChecksum:ie})}catch(Pe){throw Pe.message=`While persisting ${De} -> ${Ee} ${Pe.message}`,Pe}finally{le.tick()}})().then(()=>b.splice(b.indexOf(Z),1));b.push(Z),b.length>G1e&&await Promise.race(b)},T=async(De,Ee,g)=>{let me=(async()=>{let Ce=async(fe,ie,Z)=>{try{Z.innerLoop||await ae.mkdirPromise(ie,{recursive:!0});let Pe=await ae.readdirPromise(fe,{withFileTypes:!0});for(let Re of Pe){if(!Z.innerLoop&&Re.name===$Q)continue;let ht=K.join(fe,Re.name),q=K.join(ie,Re.name);Re.isDirectory()?(Re.name!==xi||Z&&Z.innerLoop)&&(await ae.mkdirPromise(q,{recursive:!0}),await Ce(ht,q,{...Z,innerLoop:!0})):Ie.value==="hardlinks-local"||Ie.value==="hardlinks-global"?await ae.linkPromise(ht,q):await ae.copyFilePromise(ht,q,K1e.default.constants.COPYFILE_FICLONE)}}catch(Pe){throw Z.innerLoop||(Pe.message=`While cloning ${fe} -> ${ie} ${Pe.message}`),Pe}finally{Z.innerLoop||le.tick()}};await Ce(De,Ee,g)})().then(()=>b.splice(b.indexOf(me),1));b.push(me),b.length>G1e&&await Promise.race(b)},N=async(De,Ee,g)=>{if(g)for(let[me,Ce]of Ee.children){let fe=g.children.get(me);await N(K.join(De,me),Ce,fe)}else{Ee.children.has(xi)&&await RC(K.join(De,xi),{contentsOnly:!1});let me=K.basename(De)===xi&&p.has(K.join(K.dirname(De)));await RC(De,{contentsOnly:De===A,isWorkspaceDir:me})}};for(let[De,Ee]of p){let g=D.get(De);for(let[me,Ce]of Ee.children){if(me===".")continue;let fe=g&&g.children.get(me),ie=K.join(De,me);await N(ie,Ce,fe)}}let U=async(De,Ee,g)=>{if(g){W1e(Ee.locator,g.locator)||await RC(De,{contentsOnly:Ee.linkType==="HARD"});for(let[me,Ce]of Ee.children){let fe=g.children.get(me);await U(K.join(De,me),Ce,fe)}}else{Ee.children.has(xi)&&await RC(K.join(De,xi),{contentsOnly:!0});let me=K.basename(De)===xi&&D.has(K.join(K.dirname(De)));await RC(De,{contentsOnly:Ee.linkType==="HARD",isWorkspaceDir:me})}};for(let[De,Ee]of D){let g=p.get(De);for(let[me,Ce]of Ee.children){if(me===".")continue;let fe=g&&g.children.get(me);await U(K.join(De,me),Ce,fe)}}let z=new Map,te=[];for(let[De,Ee]of E)for(let g of Ee){let{locationRoot:me,segments:Ce}=eF(g,{skipPrefix:o.cwd}),fe=D.get(me),ie=me;if(fe){for(let Z of Ce)if(ie=K.join(ie,Z),fe=fe.children.get(Z),!fe)break;if(fe){let Z=W1e(fe.locator,De),Pe=e.get(fe.locator),Re=Pe.target,ht=ie,q=Pe.linkType;if(Z)z.has(Re)||z.set(Re,ht);else if(Re!==ht){let nt=G.parseLocator(fe.locator);G.isVirtualLocator(nt)&&(nt=G.devirtualizeLocator(nt)),te.push({srcDir:Re,dstDir:ht,linkType:q,realLocatorHash:nt.locatorHash})}}}}for(let[De,{locations:Ee}]of e.entries())for(let g of Ee){let{locationRoot:me,segments:Ce}=eF(g,{skipPrefix:o.cwd}),fe=p.get(me),ie=D.get(me),Z=me,Pe=e.get(De),Re=G.parseLocator(De);G.isVirtualLocator(Re)&&(Re=G.devirtualizeLocator(Re));let ht=Re.locatorHash,q=Pe.target,nt=g;if(q===nt)continue;let Le=Pe.linkType;for(let Te of Ce)ie=ie.children.get(Te);if(!fe)te.push({srcDir:q,dstDir:nt,linkType:Le,realLocatorHash:ht});else for(let Te of Ce)if(Z=K.join(Z,Te),fe=fe.children.get(Te),!fe){te.push({srcDir:q,dstDir:nt,linkType:Le,realLocatorHash:ht});break}}let le=Ws.progressViaCounter(te.length),ce=a.reportProgress(le),ue=o.configuration.get("nmMode"),Ie={value:ue},he=o.configuration.get("winLinkType");try{let De=Ie.value==="hardlinks-global"?`${$j(o.configuration)}/v1`:null;if(De&&!await ae.existsPromise(De)){await ae.mkdirpPromise(De);for(let g=0;g<256;g++)await ae.mkdirPromise(K.join(De,g.toString(16).padStart(2,"0")))}for(let g of te)(g.linkType==="SOFT"||!z.has(g.srcDir))&&(z.set(g.srcDir,g.dstDir),await C({...g,globalHardlinksStore:De,nmMode:Ie,windowsLinkType:he,packageChecksum:u.get(g.realLocatorHash)||null}));await Promise.all(b),b.length=0;for(let g of te){let me=z.get(g.srcDir);g.linkType!=="SOFT"&&g.dstDir!==me&&await T(me,g.dstDir,{nmMode:Ie})}await Promise.all(b),await ae.mkdirPromise(A,{recursive:!0});let Ee=await $wt(e,D,o.cwd,{loadManifest:n});await t1t(h,Ee,o.cwd,he),await zwt(o,e,Ee,Ie,{installChangedByUser:w}),ue=="hardlinks-global"&&Ie.value=="hardlinks-local"&&a.reportWarningOnce(74,"'nmMode' has been downgraded to 'hardlinks-local' due to global cache and install folder being on different devices")}finally{ce.stop()}}async function t1t(t,e,r,o){for(let a of t.keys()){if(K.contains(r,a)===null)throw new Error(`Assertion failed. Excepted bin symlink location to be inside project dir, instead it was at ${a}`);if(!e.has(a)){let n=K.join(a,xi,$Q);await ae.removePromise(n)}}for(let[a,n]of e){if(K.contains(r,a)===null)throw new Error(`Assertion failed. Excepted bin symlink location to be inside project dir, instead it was at ${a}`);let u=K.join(a,xi,$Q),A=t.get(a)||new Map;await ae.mkdirPromise(u,{recursive:!0});for(let p of A.keys())n.has(p)||(await ae.removePromise(K.join(u,p)),process.platform==="win32"&&await ae.removePromise(K.join(u,`${p}.cmd`)));for(let[p,h]of n){let E=A.get(p),w=K.join(u,p);E!==h&&(process.platform==="win32"?await(0,Y1e.default)(Ae.fromPortablePath(h),Ae.fromPortablePath(w),{createPwshFile:!1}):(await ae.removePromise(w),await Zj(h,w,o),K.contains(r,await ae.realpathPromise(h))!==null&&await ae.chmodPromise(h,493)))}}}Ke();Pt();sA();var Pv=class extends Yh{constructor(){super(...arguments);this.mode="loose"}makeInstaller(r){return new e9(r)}},e9=class extends pd{constructor(){super(...arguments);this.mode="loose"}async transformPnpSettings(r){let o=new qs({baseFs:new iA({maxOpenFiles:80,readOnlyArchives:!0})}),a=F1e(r,this.opts.project.cwd,o),{tree:n,errors:u}=pv(a,{pnpifyFs:!1,project:this.opts.project});if(!n){for(let{messageName:w,text:D}of u)this.opts.report.reportError(w,D);return}let A=new Map;r.fallbackPool=A;let p=(w,D)=>{let b=G.parseLocator(D.locator),C=G.stringifyIdent(b);C===w?A.set(w,b.reference):A.set(w,[C,b.reference])},h=K.join(this.opts.project.cwd,mr.nodeModules),E=n.get(h);if(!(typeof E>"u")){if("target"in E)throw new Error("Assertion failed: Expected the root junction point to be a directory");for(let w of E.dirList){let D=K.join(h,w),b=n.get(D);if(typeof b>"u")throw new Error("Assertion failed: Expected the child to have been registered");if("target"in b)p(w,b);else for(let C of b.dirList){let T=K.join(D,C),N=n.get(T);if(typeof N>"u")throw new Error("Assertion failed: Expected the subchild to have been registered");if("target"in N)p(`${w}/${C}`,N);else throw new Error("Assertion failed: Expected the leaf junction to be a package")}}}}};var r1t={hooks:{cleanGlobalArtifacts:async t=>{let e=$j(t);await ae.removePromise(e)}},configuration:{nmHoistingLimits:{description:"Prevents packages to be hoisted past specific levels",type:"STRING",values:["workspaces","dependencies","none"],default:"none"},nmMode:{description:"Defines in which measure Yarn must use hardlinks and symlinks when generated `node_modules` directories.",type:"STRING",values:["classic","hardlinks-local","hardlinks-global"],default:"classic"},nmSelfReferences:{description:"Defines whether the linker should generate self-referencing symlinks for workspaces.",type:"BOOLEAN",default:!0}},linkers:[Dv,Pv]},n1t=r1t;var $9={};Kt($9,{NpmHttpFetcher:()=>bv,NpmRemapResolver:()=>kv,NpmSemverFetcher:()=>rp,NpmSemverResolver:()=>Qv,NpmTagResolver:()=>Fv,default:()=>yvt,npmConfigUtils:()=>si,npmHttpUtils:()=>en,npmPublishUtils:()=>VC});Ke();var o2e=et(ni());var Zn="npm:";var en={};Kt(en,{AuthType:()=>n2e,customPackageError:()=>hd,del:()=>g1t,get:()=>gd,getIdentUrl:()=>tF,getPackageMetadata:()=>NC,handleInvalidAuthenticationError:()=>Vh,post:()=>p1t,put:()=>h1t});Ke();Ke();Pt();var i9=et(Q2()),t2e=et(c8()),r2e=et(ni());var si={};Kt(si,{RegistryType:()=>$1e,getAuditRegistry:()=>i1t,getAuthConfiguration:()=>n9,getDefaultRegistry:()=>Sv,getPublishRegistry:()=>s1t,getRegistryConfiguration:()=>e2e,getScopeConfiguration:()=>r9,getScopeRegistry:()=>TC,normalizeRegistry:()=>uc});var $1e=(o=>(o.AUDIT_REGISTRY="npmAuditRegistry",o.FETCH_REGISTRY="npmRegistryServer",o.PUBLISH_REGISTRY="npmPublishRegistry",o))($1e||{});function uc(t){return t.replace(/\/$/,"")}function i1t({configuration:t}){return Sv({configuration:t,type:"npmAuditRegistry"})}function s1t(t,{configuration:e}){return t.publishConfig?.registry?uc(t.publishConfig.registry):t.name?TC(t.name.scope,{configuration:e,type:"npmPublishRegistry"}):Sv({configuration:e,type:"npmPublishRegistry"})}function TC(t,{configuration:e,type:r="npmRegistryServer"}){let o=r9(t,{configuration:e});if(o===null)return Sv({configuration:e,type:r});let a=o.get(r);return a===null?Sv({configuration:e,type:r}):uc(a)}function Sv({configuration:t,type:e="npmRegistryServer"}){let r=t.get(e);return uc(r!==null?r:t.get("npmRegistryServer"))}function e2e(t,{configuration:e}){let r=e.get("npmRegistries"),o=uc(t),a=r.get(o);if(typeof a<"u")return a;let n=r.get(o.replace(/^[a-z]+:/,""));return typeof n<"u"?n:null}function r9(t,{configuration:e}){if(t===null)return null;let o=e.get("npmScopes").get(t);return o||null}function n9(t,{configuration:e,ident:r}){let o=r&&r9(r.scope,{configuration:e});return o?.get("npmAuthIdent")||o?.get("npmAuthToken")?o:e2e(t,{configuration:e})||e}var n2e=(a=>(a[a.NO_AUTH=0]="NO_AUTH",a[a.BEST_EFFORT=1]="BEST_EFFORT",a[a.CONFIGURATION=2]="CONFIGURATION",a[a.ALWAYS_AUTH=3]="ALWAYS_AUTH",a))(n2e||{});async function Vh(t,{attemptedAs:e,registry:r,headers:o,configuration:a}){if(nF(t))throw new zt(41,"Invalid OTP token");if(t.originalError?.name==="HTTPError"&&t.originalError?.response.statusCode===401)throw new zt(41,`Invalid authentication (${typeof e!="string"?`as ${await m1t(r,o,{configuration:a})}`:`attempted as ${e}`})`)}function hd(t,e){let r=t.response?.statusCode;return r?r===404?"Package not found":r>=500&&r<600?`The registry appears to be down (using a ${pe.applyHyperlink(e,"local cache","https://yarnpkg.com/advanced/lexicon#local-cache")} might have protected you against such outages)`:null:null}function tF(t){return t.scope?`/@${t.scope}%2f${t.name}`:`/${t.name}`}var i2e=new Map,o1t=new Map;async function a1t(t){return await qe.getFactoryWithDefault(i2e,t,async()=>{let e=null;try{e=await ae.readJsonPromise(t)}catch{}return e})}async function l1t(t,e,{configuration:r,cached:o,registry:a,headers:n,version:u,...A}){return await qe.getFactoryWithDefault(o1t,t,async()=>await gd(tF(e),{...A,customErrorMessage:hd,configuration:r,registry:a,ident:e,headers:{...n,"If-None-Match":o?.etag,"If-Modified-Since":o?.lastModified},wrapNetworkRequest:async p=>async()=>{let h=await p();if(h.statusCode===304){if(o===null)throw new Error("Assertion failed: cachedMetadata should not be null");return{...h,body:o.metadata}}let E=c1t(JSON.parse(h.body.toString())),w={metadata:E,etag:h.headers.etag,lastModified:h.headers["last-modified"]};return i2e.set(t,Promise.resolve(w)),Promise.resolve().then(async()=>{let D=`${t}-${process.pid}.tmp`;await ae.mkdirPromise(K.dirname(D),{recursive:!0}),await ae.writeJsonPromise(D,w,{compact:!0}),await ae.renamePromise(D,t)}).catch(()=>{}),{...h,body:E}}}))}async function NC(t,{cache:e,project:r,registry:o,headers:a,version:n,...u}){let{configuration:A}=r;o=xv(A,{ident:t,registry:o});let p=A1t(A,o),h=K.join(p,`${G.slugifyIdent(t)}.json`),E=null;if(!r.lockfileNeedsRefresh&&(E=await a1t(h),E)){if(typeof n<"u"&&typeof E.metadata.versions[n]<"u")return E.metadata;if(A.get("enableOfflineMode")){let w=structuredClone(E.metadata),D=new Set;if(e){for(let C of Object.keys(w.versions)){let T=G.makeLocator(t,`npm:${C}`),N=e.getLocatorMirrorPath(T);(!N||!ae.existsSync(N))&&(delete w.versions[C],D.add(C))}let b=w["dist-tags"].latest;if(D.has(b)){let C=Object.keys(E.metadata.versions).sort(r2e.default.compare),T=C.indexOf(b);for(;D.has(C[T])&&T>=0;)T-=1;T>=0?w["dist-tags"].latest=C[T]:delete w["dist-tags"].latest}}return w}}return await l1t(h,t,{...u,configuration:A,cached:E,registry:o,headers:a,version:n})}var s2e=["name","dist.tarball","bin","scripts","os","cpu","libc","dependencies","dependenciesMeta","optionalDependencies","peerDependencies","peerDependenciesMeta","deprecated"];function c1t(t){return{"dist-tags":t["dist-tags"],versions:Object.fromEntries(Object.entries(t.versions).map(([e,r])=>[e,(0,t2e.default)(r,s2e)]))}}var u1t=bn.makeHash(...s2e).slice(0,6);function A1t(t,e){let r=f1t(t),o=new URL(e);return K.join(r,u1t,o.hostname)}function f1t(t){return K.join(t.get("globalFolder"),"metadata/npm")}async function gd(t,{configuration:e,headers:r,ident:o,authType:a,registry:n,...u}){n=xv(e,{ident:o,registry:n}),o&&o.scope&&typeof a>"u"&&(a=1);let A=await rF(n,{authType:a,configuration:e,ident:o});A&&(r={...r,authorization:A});try{return await on.get(t.charAt(0)==="/"?`${n}${t}`:t,{configuration:e,headers:r,...u})}catch(p){throw await Vh(p,{registry:n,configuration:e,headers:r}),p}}async function p1t(t,e,{attemptedAs:r,configuration:o,headers:a,ident:n,authType:u=3,registry:A,otp:p,...h}){A=xv(o,{ident:n,registry:A});let E=await rF(A,{authType:u,configuration:o,ident:n});E&&(a={...a,authorization:E}),p&&(a={...a,...LC(p)});try{return await on.post(A+t,e,{configuration:o,headers:a,...h})}catch(w){if(!nF(w)||p)throw await Vh(w,{attemptedAs:r,registry:A,configuration:o,headers:a}),w;p=await s9(w,{configuration:o});let D={...a,...LC(p)};try{return await on.post(`${A}${t}`,e,{configuration:o,headers:D,...h})}catch(b){throw await Vh(b,{attemptedAs:r,registry:A,configuration:o,headers:a}),b}}}async function h1t(t,e,{attemptedAs:r,configuration:o,headers:a,ident:n,authType:u=3,registry:A,otp:p,...h}){A=xv(o,{ident:n,registry:A});let E=await rF(A,{authType:u,configuration:o,ident:n});E&&(a={...a,authorization:E}),p&&(a={...a,...LC(p)});try{return await on.put(A+t,e,{configuration:o,headers:a,...h})}catch(w){if(!nF(w))throw await Vh(w,{attemptedAs:r,registry:A,configuration:o,headers:a}),w;p=await s9(w,{configuration:o});let D={...a,...LC(p)};try{return await on.put(`${A}${t}`,e,{configuration:o,headers:D,...h})}catch(b){throw await Vh(b,{attemptedAs:r,registry:A,configuration:o,headers:a}),b}}}async function g1t(t,{attemptedAs:e,configuration:r,headers:o,ident:a,authType:n=3,registry:u,otp:A,...p}){u=xv(r,{ident:a,registry:u});let h=await rF(u,{authType:n,configuration:r,ident:a});h&&(o={...o,authorization:h}),A&&(o={...o,...LC(A)});try{return await on.del(u+t,{configuration:r,headers:o,...p})}catch(E){if(!nF(E)||A)throw await Vh(E,{attemptedAs:e,registry:u,configuration:r,headers:o}),E;A=await s9(E,{configuration:r});let w={...o,...LC(A)};try{return await on.del(`${u}${t}`,{configuration:r,headers:w,...p})}catch(D){throw await Vh(D,{attemptedAs:e,registry:u,configuration:r,headers:o}),D}}}function xv(t,{ident:e,registry:r}){if(typeof r>"u"&&e)return TC(e.scope,{configuration:t});if(typeof r!="string")throw new Error("Assertion failed: The registry should be a string");return uc(r)}async function rF(t,{authType:e=2,configuration:r,ident:o}){let a=n9(t,{configuration:r,ident:o}),n=d1t(a,e);if(!n)return null;let u=await r.reduceHook(A=>A.getNpmAuthenticationHeader,void 0,t,{configuration:r,ident:o});if(u)return u;if(a.get("npmAuthToken"))return`Bearer ${a.get("npmAuthToken")}`;if(a.get("npmAuthIdent")){let A=a.get("npmAuthIdent");return A.includes(":")?`Basic ${Buffer.from(A).toString("base64")}`:`Basic ${A}`}if(n&&e!==1)throw new zt(33,"No authentication configured for request");return null}function d1t(t,e){switch(e){case 2:return t.get("npmAlwaysAuth");case 1:case 3:return!0;case 0:return!1;default:throw new Error("Unreachable")}}async function m1t(t,e,{configuration:r}){if(typeof e>"u"||typeof e.authorization>"u")return"an anonymous user";try{return(await on.get(new URL(`${t}/-/whoami`).href,{configuration:r,headers:e,jsonResponse:!0})).username??"an unknown user"}catch{return"an unknown user"}}async function s9(t,{configuration:e}){let r=t.originalError?.response.headers["npm-notice"];if(r&&(await Lt.start({configuration:e,stdout:process.stdout,includeFooter:!1},async a=>{if(a.reportInfo(0,r.replace(/(https?:\/\/\S+)/g,pe.pretty(e,"$1",pe.Type.URL))),!process.env.YARN_IS_TEST_ENV){let n=r.match(/open (https?:\/\/\S+)/i);if(n&&Xi.openUrl){let{openNow:u}=await(0,i9.prompt)({type:"confirm",name:"openNow",message:"Do you want to try to open this url now?",required:!0,initial:!0,onCancel:()=>process.exit(130)});u&&(await Xi.openUrl(n[1])||(a.reportSeparator(),a.reportWarning(0,"We failed to automatically open the url; you'll have to open it yourself in your browser of choice.")))}}}),process.stdout.write(` `)),process.env.YARN_IS_TEST_ENV)return process.env.YARN_INJECT_NPM_2FA_TOKEN||"";let{otp:o}=await(0,i9.prompt)({type:"password",name:"otp",message:"One-time password:",required:!0,onCancel:()=>process.exit(130)});return process.stdout.write(` `),o}function nF(t){if(t.originalError?.name!=="HTTPError")return!1;try{return(t.originalError?.response.headers["www-authenticate"].split(/,\s*/).map(r=>r.toLowerCase())).includes("otp")}catch{return!1}}function LC(t){return{"npm-otp":t}}var bv=class{supports(e,r){if(!e.reference.startsWith(Zn))return!1;let{selector:o,params:a}=G.parseRange(e.reference);return!(!o2e.default.valid(o)||a===null||typeof a.__archiveUrl!="string")}getLocalPath(e,r){return null}async fetch(e,r){let o=r.checksums.get(e.locatorHash)||null,[a,n,u]=await r.cache.fetchPackageFromCache(e,o,{onHit:()=>r.report.reportCacheHit(e),onMiss:()=>r.report.reportCacheMiss(e,`${G.prettyLocator(r.project.configuration,e)} can't be found in the cache and will be fetched from the remote server`),loader:()=>this.fetchFromNetwork(e,r),...r.cacheOptions});return{packageFs:a,releaseFs:n,prefixPath:G.getIdentVendorPath(e),checksum:u}}async fetchFromNetwork(e,r){let{params:o}=G.parseRange(e.reference);if(o===null||typeof o.__archiveUrl!="string")throw new Error("Assertion failed: The archiveUrl querystring parameter should have been available");let a=await gd(o.__archiveUrl,{customErrorMessage:hd,configuration:r.project.configuration,ident:e});return await $i.convertToZip(a,{configuration:r.project.configuration,prefixPath:G.getIdentVendorPath(e),stripComponents:1})}};Ke();var kv=class{supportsDescriptor(e,r){return!(!e.range.startsWith(Zn)||!G.tryParseDescriptor(e.range.slice(Zn.length),!0))}supportsLocator(e,r){return!1}shouldPersistResolution(e,r){throw new Error("Unreachable")}bindDescriptor(e,r,o){return e}getResolutionDependencies(e,r){let o=r.project.configuration.normalizeDependency(G.parseDescriptor(e.range.slice(Zn.length),!0));return r.resolver.getResolutionDependencies(o,r)}async getCandidates(e,r,o){let a=o.project.configuration.normalizeDependency(G.parseDescriptor(e.range.slice(Zn.length),!0));return await o.resolver.getCandidates(a,r,o)}async getSatisfying(e,r,o,a){let n=a.project.configuration.normalizeDependency(G.parseDescriptor(e.range.slice(Zn.length),!0));return a.resolver.getSatisfying(n,r,o,a)}resolve(e,r){throw new Error("Unreachable")}};Ke();Ke();var a2e=et(ni());var rp=class t{supports(e,r){if(!e.reference.startsWith(Zn))return!1;let o=new URL(e.reference);return!(!a2e.default.valid(o.pathname)||o.searchParams.has("__archiveUrl"))}getLocalPath(e,r){return null}async fetch(e,r){let o=r.checksums.get(e.locatorHash)||null,[a,n,u]=await r.cache.fetchPackageFromCache(e,o,{onHit:()=>r.report.reportCacheHit(e),onMiss:()=>r.report.reportCacheMiss(e,`${G.prettyLocator(r.project.configuration,e)} can't be found in the cache and will be fetched from the remote registry`),loader:()=>this.fetchFromNetwork(e,r),...r.cacheOptions});return{packageFs:a,releaseFs:n,prefixPath:G.getIdentVendorPath(e),checksum:u}}async fetchFromNetwork(e,r){let o;try{o=await gd(t.getLocatorUrl(e),{customErrorMessage:hd,configuration:r.project.configuration,ident:e})}catch{o=await gd(t.getLocatorUrl(e).replace(/%2f/g,"/"),{customErrorMessage:hd,configuration:r.project.configuration,ident:e})}return await $i.convertToZip(o,{configuration:r.project.configuration,prefixPath:G.getIdentVendorPath(e),stripComponents:1})}static isConventionalTarballUrl(e,r,{configuration:o}){let a=TC(e.scope,{configuration:o}),n=t.getLocatorUrl(e);return r=r.replace(/^https?:(\/\/(?:[^/]+\.)?npmjs.org(?:$|\/))/,"https:$1"),a=a.replace(/^https:\/\/registry\.npmjs\.org($|\/)/,"https://registry.yarnpkg.com$1"),r=r.replace(/^https:\/\/registry\.npmjs\.org($|\/)/,"https://registry.yarnpkg.com$1"),r===a+n||r===a+n.replace(/%2f/g,"/")}static getLocatorUrl(e){let r=Ur.clean(e.reference.slice(Zn.length));if(r===null)throw new zt(10,"The npm semver resolver got selected, but the version isn't semver");return`${tF(e)}/-/${e.name}-${r}.tgz`}};Ke();Ke();Ke();var o9=et(ni());var iF=G.makeIdent(null,"node-gyp"),y1t=/\b(node-gyp|prebuild-install)\b/,Qv=class{supportsDescriptor(e,r){return e.range.startsWith(Zn)?!!Ur.validRange(e.range.slice(Zn.length)):!1}supportsLocator(e,r){if(!e.reference.startsWith(Zn))return!1;let{selector:o}=G.parseRange(e.reference);return!!o9.default.valid(o)}shouldPersistResolution(e,r){return!0}bindDescriptor(e,r,o){return e}getResolutionDependencies(e,r){return{}}async getCandidates(e,r,o){let a=Ur.validRange(e.range.slice(Zn.length));if(a===null)throw new Error(`Expected a valid range, got ${e.range.slice(Zn.length)}`);let n=await NC(e,{cache:o.fetchOptions?.cache,project:o.project,version:o9.default.valid(a.raw)?a.raw:void 0}),u=qe.mapAndFilter(Object.keys(n.versions),h=>{try{let E=new Ur.SemVer(h);if(a.test(E))return E}catch{}return qe.mapAndFilter.skip}),A=u.filter(h=>!n.versions[h.raw].deprecated),p=A.length>0?A:u;return p.sort((h,E)=>-h.compare(E)),p.map(h=>{let E=G.makeLocator(e,`${Zn}${h.raw}`),w=n.versions[h.raw].dist.tarball;return rp.isConventionalTarballUrl(E,w,{configuration:o.project.configuration})?E:G.bindLocator(E,{__archiveUrl:w})})}async getSatisfying(e,r,o,a){let n=Ur.validRange(e.range.slice(Zn.length));if(n===null)throw new Error(`Expected a valid range, got ${e.range.slice(Zn.length)}`);return{locators:qe.mapAndFilter(o,p=>{if(p.identHash!==e.identHash)return qe.mapAndFilter.skip;let h=G.tryParseRange(p.reference,{requireProtocol:Zn});if(!h)return qe.mapAndFilter.skip;let E=new Ur.SemVer(h.selector);return n.test(E)?{locator:p,version:E}:qe.mapAndFilter.skip}).sort((p,h)=>-p.version.compare(h.version)).map(({locator:p})=>p),sorted:!0}}async resolve(e,r){let{selector:o}=G.parseRange(e.reference),a=Ur.clean(o);if(a===null)throw new zt(10,"The npm semver resolver got selected, but the version isn't semver");let n=await NC(e,{cache:r.fetchOptions?.cache,project:r.project,version:a});if(!Object.hasOwn(n,"versions"))throw new zt(15,'Registry returned invalid data for - missing "versions" field');if(!Object.hasOwn(n.versions,a))throw new zt(16,`Registry failed to return reference "${a}"`);let u=new _t;if(u.load(n.versions[a]),!u.dependencies.has(iF.identHash)&&!u.peerDependencies.has(iF.identHash)){for(let A of u.scripts.values())if(A.match(y1t)){u.dependencies.set(iF.identHash,G.makeDescriptor(iF,"latest"));break}}return{...e,version:a,languageName:"node",linkType:"HARD",conditions:u.getConditions(),dependencies:r.project.configuration.normalizeDependencyMap(u.dependencies),peerDependencies:u.peerDependencies,dependenciesMeta:u.dependenciesMeta,peerDependenciesMeta:u.peerDependenciesMeta,bin:u.bin}}};Ke();Ke();var l2e=et(ni());var Fv=class{supportsDescriptor(e,r){return!(!e.range.startsWith(Zn)||!by.test(e.range.slice(Zn.length)))}supportsLocator(e,r){return!1}shouldPersistResolution(e,r){throw new Error("Unreachable")}bindDescriptor(e,r,o){return e}getResolutionDependencies(e,r){return{}}async getCandidates(e,r,o){let a=e.range.slice(Zn.length),n=await NC(e,{cache:o.fetchOptions?.cache,project:o.project});if(!Object.hasOwn(n,"dist-tags"))throw new zt(15,'Registry returned invalid data - missing "dist-tags" field');let u=n["dist-tags"];if(!Object.hasOwn(u,a))throw new zt(16,`Registry failed to return tag "${a}"`);let A=u[a],p=G.makeLocator(e,`${Zn}${A}`),h=n.versions[A].dist.tarball;return rp.isConventionalTarballUrl(p,h,{configuration:o.project.configuration})?[p]:[G.bindLocator(p,{__archiveUrl:h})]}async getSatisfying(e,r,o,a){let n=[];for(let u of o){if(u.identHash!==e.identHash)continue;let A=G.tryParseRange(u.reference,{requireProtocol:Zn});if(!(!A||!l2e.default.valid(A.selector))){if(A.params?.__archiveUrl){let p=G.makeRange({protocol:Zn,selector:A.selector,source:null,params:null}),[h]=await a.resolver.getCandidates(G.makeDescriptor(e,p),r,a);if(u.reference!==h.reference)continue}n.push(u)}}return{locators:n,sorted:!1}}async resolve(e,r){throw new Error("Unreachable")}};var VC={};Kt(VC,{getGitHead:()=>dvt,getPublishAccess:()=>XBe,getReadmeContent:()=>ZBe,makePublishBody:()=>gvt});Ke();Ke();Pt();var V9={};Kt(V9,{PackCommand:()=>KC,default:()=>XBt,packUtils:()=>BA});Ke();Ke();Ke();Pt();Gt();var BA={};Kt(BA,{genPackList:()=>SF,genPackStream:()=>K9,genPackageManifest:()=>UBe,hasPackScripts:()=>W9,prepareForPack:()=>Y9});Ke();Pt();var G9=et(Xo()),OBe=et(RBe()),MBe=ve("zlib"),_Bt=["/package.json","/readme","/readme.*","/license","/license.*","/licence","/licence.*","/changelog","/changelog.*"],HBt=["/package.tgz",".github",".git",".hg","node_modules",".npmignore",".gitignore",".#*",".DS_Store"];async function W9(t){return!!(hn.hasWorkspaceScript(t,"prepack")||hn.hasWorkspaceScript(t,"postpack"))}async function Y9(t,{report:e},r){await hn.maybeExecuteWorkspaceLifecycleScript(t,"prepack",{report:e});try{let o=K.join(t.cwd,_t.fileName);await ae.existsPromise(o)&&await t.manifest.loadFile(o,{baseFs:ae}),await r()}finally{await hn.maybeExecuteWorkspaceLifecycleScript(t,"postpack",{report:e})}}async function K9(t,e){typeof e>"u"&&(e=await SF(t));let r=new Set;for(let n of t.manifest.publishConfig?.executableFiles??new Set)r.add(K.normalize(n));for(let n of t.manifest.bin.values())r.add(K.normalize(n));let o=OBe.default.pack();process.nextTick(async()=>{for(let n of e){let u=K.normalize(n),A=K.resolve(t.cwd,u),p=K.join("package",u),h=await ae.lstatPromise(A),E={name:p,mtime:new Date(Pi.SAFE_TIME*1e3)},w=r.has(u)?493:420,D,b,C=new Promise((N,U)=>{D=N,b=U}),T=N=>{N?b(N):D()};if(h.isFile()){let N;u==="package.json"?N=Buffer.from(JSON.stringify(await UBe(t),null,2)):N=await ae.readFilePromise(A),o.entry({...E,mode:w,type:"file"},N,T)}else h.isSymbolicLink()?o.entry({...E,mode:w,type:"symlink",linkname:await ae.readlinkPromise(A)},T):T(new Error(`Unsupported file type ${h.mode} for ${Ae.fromPortablePath(u)}`));await C}o.finalize()});let a=(0,MBe.createGzip)();return o.pipe(a),a}async function UBe(t){let e=JSON.parse(JSON.stringify(t.manifest.raw));return await t.project.configuration.triggerHook(r=>r.beforeWorkspacePacking,t,e),e}async function SF(t){let e=t.project,r=e.configuration,o={accept:[],reject:[]};for(let w of HBt)o.reject.push(w);for(let w of _Bt)o.accept.push(w);o.reject.push(r.get("rcFilename"));let a=w=>{if(w===null||!w.startsWith(`${t.cwd}/`))return;let D=K.relative(t.cwd,w),b=K.resolve(Bt.root,D);o.reject.push(b)};a(K.resolve(e.cwd,mr.lockfile)),a(r.get("cacheFolder")),a(r.get("globalFolder")),a(r.get("installStatePath")),a(r.get("virtualFolder")),a(r.get("yarnPath")),await r.triggerHook(w=>w.populateYarnPaths,e,w=>{a(w)});for(let w of e.workspaces){let D=K.relative(t.cwd,w.cwd);D!==""&&!D.match(/^(\.\.)?\//)&&o.reject.push(`/${D}`)}let n={accept:[],reject:[]},u=t.manifest.publishConfig?.main??t.manifest.main,A=t.manifest.publishConfig?.module??t.manifest.module,p=t.manifest.publishConfig?.browser??t.manifest.browser,h=t.manifest.publishConfig?.bin??t.manifest.bin;u!=null&&n.accept.push(K.resolve(Bt.root,u)),A!=null&&n.accept.push(K.resolve(Bt.root,A)),typeof p=="string"&&n.accept.push(K.resolve(Bt.root,p));for(let w of h.values())n.accept.push(K.resolve(Bt.root,w));if(p instanceof Map)for(let[w,D]of p.entries())n.accept.push(K.resolve(Bt.root,w)),typeof D=="string"&&n.accept.push(K.resolve(Bt.root,D));let E=t.manifest.files!==null;if(E){n.reject.push("/*");for(let w of t.manifest.files)_Be(n.accept,w,{cwd:Bt.root})}return await qBt(t.cwd,{hasExplicitFileList:E,globalList:o,ignoreList:n})}async function qBt(t,{hasExplicitFileList:e,globalList:r,ignoreList:o}){let a=[],n=new Gu(t),u=[[Bt.root,[o]]];for(;u.length>0;){let[A,p]=u.pop(),h=await n.lstatPromise(A);if(!LBe(A,{globalList:r,ignoreLists:h.isDirectory()?null:p}))if(h.isDirectory()){let E=await n.readdirPromise(A),w=!1,D=!1;if(!e||A!==Bt.root)for(let T of E)w=w||T===".gitignore",D=D||T===".npmignore";let b=D?await TBe(n,A,".npmignore"):w?await TBe(n,A,".gitignore"):null,C=b!==null?[b].concat(p):p;LBe(A,{globalList:r,ignoreLists:p})&&(C=[...p,{accept:[],reject:["**/*"]}]);for(let T of E)u.push([K.resolve(A,T),C])}else(h.isFile()||h.isSymbolicLink())&&a.push(K.relative(Bt.root,A))}return a.sort()}async function TBe(t,e,r){let o={accept:[],reject:[]},a=await t.readFilePromise(K.join(e,r),"utf8");for(let n of a.split(/\n/g))_Be(o.reject,n,{cwd:e});return o}function jBt(t,{cwd:e}){let r=t[0]==="!";return r&&(t=t.slice(1)),t.match(/\.{0,1}\//)&&(t=K.resolve(e,t)),r&&(t=`!${t}`),t}function _Be(t,e,{cwd:r}){let o=e.trim();o===""||o[0]==="#"||t.push(jBt(o,{cwd:r}))}function LBe(t,{globalList:e,ignoreLists:r}){let o=PF(t,e.accept);if(o!==0)return o===2;let a=PF(t,e.reject);if(a!==0)return a===1;if(r!==null)for(let n of r){let u=PF(t,n.accept);if(u!==0)return u===2;let A=PF(t,n.reject);if(A!==0)return A===1}return!1}function PF(t,e){let r=e,o=[];for(let a=0;a{await Y9(a,{report:p},async()=>{p.reportJson({base:Ae.fromPortablePath(a.cwd)});let h=await SF(a);for(let E of h)p.reportInfo(null,Ae.fromPortablePath(E)),p.reportJson({location:Ae.fromPortablePath(E)});if(!this.dryRun){let E=await K9(a,h),w=ae.createWriteStream(u);E.pipe(w),await new Promise(D=>{w.on("finish",D)})}}),this.dryRun||(p.reportInfo(0,`Package archive generated in ${pe.pretty(r,u,pe.Type.PATH)}`),p.reportJson({output:Ae.fromPortablePath(u)}))})).exitCode()}};function GBt(t,{workspace:e}){let r=t.replace("%s",WBt(e)).replace("%v",YBt(e));return Ae.toPortablePath(r)}function WBt(t){return t.manifest.name!==null?G.slugifyIdent(t.manifest.name):"package"}function YBt(t){return t.manifest.version!==null?t.manifest.version:"unknown"}var KBt=["dependencies","devDependencies","peerDependencies"],VBt="workspace:",zBt=(t,e)=>{e.publishConfig&&(e.publishConfig.type&&(e.type=e.publishConfig.type),e.publishConfig.main&&(e.main=e.publishConfig.main),e.publishConfig.browser&&(e.browser=e.publishConfig.browser),e.publishConfig.module&&(e.module=e.publishConfig.module),e.publishConfig.exports&&(e.exports=e.publishConfig.exports),e.publishConfig.imports&&(e.imports=e.publishConfig.imports),e.publishConfig.bin&&(e.bin=e.publishConfig.bin));let r=t.project;for(let o of KBt)for(let a of t.manifest.getForScope(o).values()){let n=r.tryWorkspaceByDescriptor(a),u=G.parseRange(a.range);if(u.protocol===VBt)if(n===null){if(r.tryWorkspaceByIdent(a)===null)throw new zt(21,`${G.prettyDescriptor(r.configuration,a)}: No local workspace found for this range`)}else{let A;G.areDescriptorsEqual(a,n.anchoredDescriptor)||u.selector==="*"?A=n.manifest.version??"0.0.0":u.selector==="~"||u.selector==="^"?A=`${u.selector}${n.manifest.version??"0.0.0"}`:A=u.selector;let p=o==="dependencies"?G.makeDescriptor(a,"unknown"):null,h=p!==null&&t.manifest.ensureDependencyMeta(p).optional?"optionalDependencies":o;e[h][G.stringifyIdent(a)]=A}}},JBt={hooks:{beforeWorkspacePacking:zBt},commands:[KC]},XBt=JBt;var zBe=ve("crypto"),JBe=et(VBe());async function gvt(t,e,{access:r,tag:o,registry:a,gitHead:n}){let u=t.manifest.name,A=t.manifest.version,p=G.stringifyIdent(u),h=(0,zBe.createHash)("sha1").update(e).digest("hex"),E=JBe.default.fromData(e).toString(),w=r??XBe(t,u),D=await ZBe(t),b=await BA.genPackageManifest(t),C=`${p}-${A}.tgz`,T=new URL(`${uc(a)}/${p}/-/${C}`);return{_id:p,_attachments:{[C]:{content_type:"application/octet-stream",data:e.toString("base64"),length:e.length}},name:p,access:w,"dist-tags":{[o]:A},versions:{[A]:{...b,_id:`${p}@${A}`,name:p,version:A,gitHead:n,dist:{shasum:h,integrity:E,tarball:T.toString()}}},readme:D}}async function dvt(t){try{let{stdout:e}=await Hr.execvp("git",["rev-parse","--revs-only","HEAD"],{cwd:t});return e.trim()===""?void 0:e.trim()}catch{return}}function XBe(t,e){let r=t.project.configuration;return t.manifest.publishConfig&&typeof t.manifest.publishConfig.access=="string"?t.manifest.publishConfig.access:r.get("npmPublishAccess")!==null?r.get("npmPublishAccess"):e.scope?"restricted":"public"}async function ZBe(t){let e=Ae.toPortablePath(`${t.cwd}/README.md`),r=t.manifest.name,a=`# ${G.stringifyIdent(r)} `;try{a=await ae.readFilePromise(e,"utf8")}catch(n){if(n.code==="ENOENT")return a;throw n}return a}var Z9={npmAlwaysAuth:{description:"URL of the selected npm registry (note: npm enterprise isn't supported)",type:"BOOLEAN",default:!1},npmAuthIdent:{description:"Authentication identity for the npm registry (_auth in npm and yarn v1)",type:"SECRET",default:null},npmAuthToken:{description:"Authentication token for the npm registry (_authToken in npm and yarn v1)",type:"SECRET",default:null}},$Be={npmAuditRegistry:{description:"Registry to query for audit reports",type:"STRING",default:null},npmPublishRegistry:{description:"Registry to push packages to",type:"STRING",default:null},npmRegistryServer:{description:"URL of the selected npm registry (note: npm enterprise isn't supported)",type:"STRING",default:"https://registry.yarnpkg.com"}},mvt={configuration:{...Z9,...$Be,npmScopes:{description:"Settings per package scope",type:"MAP",valueDefinition:{description:"",type:"SHAPE",properties:{...Z9,...$Be}}},npmRegistries:{description:"Settings per registry",type:"MAP",normalizeKeys:uc,valueDefinition:{description:"",type:"SHAPE",properties:{...Z9}}}},fetchers:[bv,rp],resolvers:[kv,Qv,Fv]},yvt=mvt;var lG={};Kt(lG,{NpmAuditCommand:()=>JC,NpmInfoCommand:()=>XC,NpmLoginCommand:()=>ZC,NpmLogoutCommand:()=>eI,NpmPublishCommand:()=>tI,NpmTagAddCommand:()=>nI,NpmTagListCommand:()=>rI,NpmTagRemoveCommand:()=>iI,NpmWhoamiCommand:()=>sI,default:()=>Dvt,npmAuditTypes:()=>Xv,npmAuditUtils:()=>xF});Ke();Ke();Gt();var iG=et(Xo());il();var Xv={};Kt(Xv,{Environment:()=>zv,Severity:()=>Jv});var zv=(o=>(o.All="all",o.Production="production",o.Development="development",o))(zv||{}),Jv=(n=>(n.Info="info",n.Low="low",n.Moderate="moderate",n.High="high",n.Critical="critical",n))(Jv||{});var xF={};Kt(xF,{allSeverities:()=>zC,getPackages:()=>nG,getReportTree:()=>tG,getSeverityInclusions:()=>eG,getTopLevelDependencies:()=>rG});Ke();var eve=et(ni());var zC=["info","low","moderate","high","critical"];function eG(t){if(typeof t>"u")return new Set(zC);let e=zC.indexOf(t),r=zC.slice(e);return new Set(r)}function tG(t){let e={},r={children:e};for(let[o,a]of qe.sortMap(Object.entries(t),n=>n[0]))for(let n of qe.sortMap(a,u=>`${u.id}`))e[`${o}/${n.id}`]={value:pe.tuple(pe.Type.IDENT,G.parseIdent(o)),children:{ID:typeof n.id<"u"&&{label:"ID",value:pe.tuple(pe.Type.ID,n.id)},Issue:{label:"Issue",value:pe.tuple(pe.Type.NO_HINT,n.title)},URL:typeof n.url<"u"&&{label:"URL",value:pe.tuple(pe.Type.URL,n.url)},Severity:{label:"Severity",value:pe.tuple(pe.Type.NO_HINT,n.severity)},"Vulnerable Versions":{label:"Vulnerable Versions",value:pe.tuple(pe.Type.RANGE,n.vulnerable_versions)},"Tree Versions":{label:"Tree Versions",children:[...n.versions].sort(eve.default.compare).map(u=>({value:pe.tuple(pe.Type.REFERENCE,u)}))},Dependents:{label:"Dependents",children:qe.sortMap(n.dependents,u=>G.stringifyLocator(u)).map(u=>({value:pe.tuple(pe.Type.LOCATOR,u)}))}}};return r}function rG(t,e,{all:r,environment:o}){let a=[],n=r?t.workspaces:[e],u=["all","production"].includes(o),A=["all","development"].includes(o);for(let p of n)for(let h of p.anchoredPackage.dependencies.values())(p.manifest.devDependencies.has(h.identHash)?!A:!u)||a.push({workspace:p,dependency:h});return a}function nG(t,e,{recursive:r}){let o=new Map,a=new Set,n=[],u=(A,p)=>{let h=t.storedResolutions.get(p.descriptorHash);if(typeof h>"u")throw new Error("Assertion failed: The resolution should have been registered");if(!a.has(h))a.add(h);else return;let E=t.storedPackages.get(h);if(typeof E>"u")throw new Error("Assertion failed: The package should have been registered");if(G.ensureDevirtualizedLocator(E).reference.startsWith("npm:")&&E.version!==null){let D=G.stringifyIdent(E),b=qe.getMapWithDefault(o,D);qe.getArrayWithDefault(b,E.version).push(A)}if(r)for(let D of E.dependencies.values())n.push([E,D])};for(let{workspace:A,dependency:p}of e)n.push([A.anchoredLocator,p]);for(;n.length>0;){let[A,p]=n.shift();u(A,p)}return o}var JC=class extends ut{constructor(){super(...arguments);this.all=de.Boolean("-A,--all",!1,{description:"Audit dependencies from all workspaces"});this.recursive=de.Boolean("-R,--recursive",!1,{description:"Audit transitive dependencies as well"});this.environment=de.String("--environment","all",{description:"Which environments to cover",validator:js(zv)});this.json=de.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.noDeprecations=de.Boolean("--no-deprecations",!1,{description:"Don't warn about deprecated packages"});this.severity=de.String("--severity","info",{description:"Minimal severity requested for packages to be displayed",validator:js(Jv)});this.excludes=de.Array("--exclude",[],{description:"Array of glob patterns of packages to exclude from audit"});this.ignores=de.Array("--ignore",[],{description:"Array of glob patterns of advisory ID's to ignore in the audit report"})}static{this.paths=[["npm","audit"]]}static{this.usage=st.Usage({description:"perform a vulnerability audit against the installed packages",details:` This command checks for known security reports on the packages you use. The reports are by default extracted from the npm registry, and may or may not be relevant to your actual program (not all vulnerabilities affect all code paths). For consistency with our other commands the default is to only check the direct dependencies for the active workspace. To extend this search to all workspaces, use \`-A,--all\`. To extend this search to both direct and transitive dependencies, use \`-R,--recursive\`. Applying the \`--severity\` flag will limit the audit table to vulnerabilities of the corresponding severity and above. Valid values are ${zC.map(r=>`\`${r}\``).join(", ")}. If the \`--json\` flag is set, Yarn will print the output exactly as received from the registry. Regardless of this flag, the process will exit with a non-zero exit code if a report is found for the selected packages. If certain packages produce false positives for a particular environment, the \`--exclude\` flag can be used to exclude any number of packages from the audit. This can also be set in the configuration file with the \`npmAuditExcludePackages\` option. If particular advisories are needed to be ignored, the \`--ignore\` flag can be used with Advisory ID's to ignore any number of advisories in the audit report. This can also be set in the configuration file with the \`npmAuditIgnoreAdvisories\` option. To understand the dependency tree requiring vulnerable packages, check the raw report with the \`--json\` flag or use \`yarn why package\` to get more information as to who depends on them. `,examples:[["Checks for known security issues with the installed packages. The output is a list of known issues.","yarn npm audit"],["Audit dependencies in all workspaces","yarn npm audit --all"],["Limit auditing to `dependencies` (excludes `devDependencies`)","yarn npm audit --environment production"],["Show audit report as valid JSON","yarn npm audit --json"],["Audit all direct and transitive dependencies","yarn npm audit --recursive"],["Output moderate (or more severe) vulnerabilities","yarn npm audit --severity moderate"],["Exclude certain packages","yarn npm audit --exclude package1 --exclude package2"],["Ignore specific advisories","yarn npm audit --ignore 1234567 --ignore 7654321"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:o,workspace:a}=await Qt.find(r,this.context.cwd);if(!a)throw new or(o.cwd,this.context.cwd);await o.restoreInstallState();let n=rG(o,a,{all:this.all,environment:this.environment}),u=nG(o,n,{recursive:this.recursive}),A=Array.from(new Set([...r.get("npmAuditExcludePackages"),...this.excludes])),p=Object.create(null);for(let[N,U]of u)A.some(z=>iG.default.isMatch(N,z))||(p[N]=[...U.keys()]);let h=si.getAuditRegistry({configuration:r}),E,w=await pA.start({configuration:r,stdout:this.context.stdout},async()=>{let N=en.post("/-/npm/v1/security/advisories/bulk",p,{authType:en.AuthType.BEST_EFFORT,configuration:r,jsonResponse:!0,registry:h}),U=this.noDeprecations?[]:await Promise.all(Array.from(Object.entries(p),async([te,le])=>{let ce=await en.getPackageMetadata(G.parseIdent(te),{project:o});return qe.mapAndFilter(le,ue=>{let{deprecated:Ie}=ce.versions[ue];return Ie?[te,ue,Ie]:qe.mapAndFilter.skip})})),z=await N;for(let[te,le,ce]of U.flat(1))Object.hasOwn(z,te)&&z[te].some(ue=>Ur.satisfiesWithPrereleases(le,ue.vulnerable_versions))||(z[te]??=[],z[te].push({id:`${te} (deprecation)`,title:ce.trim()||"This package has been deprecated.",severity:"moderate",vulnerable_versions:le}));E=z});if(w.hasErrors())return w.exitCode();let D=eG(this.severity),b=Array.from(new Set([...r.get("npmAuditIgnoreAdvisories"),...this.ignores])),C=Object.create(null);for(let[N,U]of Object.entries(E)){let z=U.filter(te=>!iG.default.isMatch(`${te.id}`,b)&&D.has(te.severity));z.length>0&&(C[N]=z.map(te=>{let le=u.get(N);if(typeof le>"u")throw new Error("Assertion failed: Expected the registry to only return packages that were requested");let ce=[...le.keys()].filter(Ie=>Ur.satisfiesWithPrereleases(Ie,te.vulnerable_versions)),ue=new Map;for(let Ie of ce)for(let he of le.get(Ie))ue.set(he.locatorHash,he);return{...te,versions:ce,dependents:[...ue.values()]}}))}let T=Object.keys(C).length>0;return T?(As.emitTree(tG(C),{configuration:r,json:this.json,stdout:this.context.stdout,separators:2}),1):(await Lt.start({configuration:r,includeFooter:!1,json:this.json,stdout:this.context.stdout},async N=>{N.reportInfo(1,"No audit suggestions")}),T?1:0)}};Ke();Ke();Pt();Gt();var sG=et(ni()),oG=ve("util"),XC=class extends ut{constructor(){super(...arguments);this.fields=de.String("-f,--fields",{description:"A comma-separated list of manifest fields that should be displayed"});this.json=de.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.packages=de.Rest()}static{this.paths=[["npm","info"]]}static{this.usage=st.Usage({category:"Npm-related commands",description:"show information about a package",details:"\n This command fetches information about a package from the npm registry and prints it in a tree format.\n\n The package does not have to be installed locally, but needs to have been published (in particular, local changes will be ignored even for workspaces).\n\n Append `@` to the package argument to provide information specific to the latest version that satisfies the range or to the corresponding tagged version. If the range is invalid or if there is no version satisfying the range, the command will print a warning and fall back to the latest version.\n\n If the `-f,--fields` option is set, it's a comma-separated list of fields which will be used to only display part of the package information.\n\n By default, this command won't return the `dist`, `readme`, and `users` fields, since they are often very long. To explicitly request those fields, explicitly list them with the `--fields` flag or request the output in JSON mode.\n ",examples:[["Show all available information about react (except the `dist`, `readme`, and `users` fields)","yarn npm info react"],["Show all available information about react as valid JSON (including the `dist`, `readme`, and `users` fields)","yarn npm info react --json"],["Show all available information about react@16.12.0","yarn npm info react@16.12.0"],["Show all available information about react@next","yarn npm info react@next"],["Show the description of react","yarn npm info react --fields description"],["Show all available versions of react","yarn npm info react --fields versions"],["Show the readme of react","yarn npm info react --fields readme"],["Show a few fields of react","yarn npm info react --fields homepage,repository"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:o}=await Qt.find(r,this.context.cwd),a=typeof this.fields<"u"?new Set(["name",...this.fields.split(/\s*,\s*/)]):null,n=[],u=!1,A=await Lt.start({configuration:r,includeFooter:!1,json:this.json,stdout:this.context.stdout},async p=>{for(let h of this.packages){let E;if(h==="."){let le=o.topLevelWorkspace;if(!le.manifest.name)throw new ot(`Missing ${pe.pretty(r,"name",pe.Type.CODE)} field in ${Ae.fromPortablePath(K.join(le.cwd,mr.manifest))}`);E=G.makeDescriptor(le.manifest.name,"unknown")}else E=G.parseDescriptor(h);let w=en.getIdentUrl(E),D=aG(await en.get(w,{configuration:r,ident:E,jsonResponse:!0,customErrorMessage:en.customPackageError})),b=Object.keys(D.versions).sort(sG.default.compareLoose),T=D["dist-tags"].latest||b[b.length-1],N=Ur.validRange(E.range);if(N){let le=sG.default.maxSatisfying(b,N);le!==null?T=le:(p.reportWarning(0,`Unmet range ${G.prettyRange(r,E.range)}; falling back to the latest version`),u=!0)}else Object.hasOwn(D["dist-tags"],E.range)?T=D["dist-tags"][E.range]:E.range!=="unknown"&&(p.reportWarning(0,`Unknown tag ${G.prettyRange(r,E.range)}; falling back to the latest version`),u=!0);let U=D.versions[T],z={...D,...U,version:T,versions:b},te;if(a!==null){te={};for(let le of a){let ce=z[le];if(typeof ce<"u")te[le]=ce;else{p.reportWarning(1,`The ${pe.pretty(r,le,pe.Type.CODE)} field doesn't exist inside ${G.prettyIdent(r,E)}'s information`),u=!0;continue}}}else this.json||(delete z.dist,delete z.readme,delete z.users),te=z;p.reportJson(te),this.json||n.push(te)}});oG.inspect.styles.name="cyan";for(let p of n)(p!==n[0]||u)&&this.context.stdout.write(` `),this.context.stdout.write(`${(0,oG.inspect)(p,{depth:1/0,colors:!0,compact:!1})} `);return A.exitCode()}};function aG(t){if(Array.isArray(t)){let e=[];for(let r of t)r=aG(r),r&&e.push(r);return e}else if(typeof t=="object"&&t!==null){let e={};for(let r of Object.keys(t)){if(r.startsWith("_"))continue;let o=aG(t[r]);o&&(e[r]=o)}return e}else return t||null}Ke();Ke();Gt();var tve=et(Q2()),ZC=class extends ut{constructor(){super(...arguments);this.scope=de.String("-s,--scope",{description:"Login to the registry configured for a given scope"});this.publish=de.Boolean("--publish",!1,{description:"Login to the publish registry"});this.alwaysAuth=de.Boolean("--always-auth",{description:"Set the npmAlwaysAuth configuration"})}static{this.paths=[["npm","login"]]}static{this.usage=st.Usage({category:"Npm-related commands",description:"store new login info to access the npm registry",details:"\n This command will ask you for your username, password, and 2FA One-Time-Password (when it applies). It will then modify your local configuration (in your home folder, never in the project itself) to reference the new tokens thus generated.\n\n Adding the `-s,--scope` flag will cause the authentication to be done against whatever registry is configured for the associated scope (see also `npmScopes`).\n\n Adding the `--publish` flag will cause the authentication to be done against the registry used when publishing the package (see also `publishConfig.registry` and `npmPublishRegistry`).\n ",examples:[["Login to the default registry","yarn npm login"],["Login to the registry linked to the @my-scope registry","yarn npm login --scope my-scope"],["Login to the publish registry for the current package","yarn npm login --publish"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),o=await bF({configuration:r,cwd:this.context.cwd,publish:this.publish,scope:this.scope});return(await Lt.start({configuration:r,stdout:this.context.stdout,includeFooter:!1},async n=>{let u=await Ivt({configuration:r,registry:o,report:n,stdin:this.context.stdin,stdout:this.context.stdout}),A=await Evt(o,u,r);return await Cvt(o,A,{alwaysAuth:this.alwaysAuth,scope:this.scope}),n.reportInfo(0,"Successfully logged in")})).exitCode()}};async function bF({scope:t,publish:e,configuration:r,cwd:o}){return t&&e?si.getScopeRegistry(t,{configuration:r,type:si.RegistryType.PUBLISH_REGISTRY}):t?si.getScopeRegistry(t,{configuration:r}):e?si.getPublishRegistry((await aE(r,o)).manifest,{configuration:r}):si.getDefaultRegistry({configuration:r})}async function Evt(t,e,r){let o=`/-/user/org.couchdb.user:${encodeURIComponent(e.name)}`,a={_id:`org.couchdb.user:${e.name}`,name:e.name,password:e.password,type:"user",roles:[],date:new Date().toISOString()},n={attemptedAs:e.name,configuration:r,registry:t,jsonResponse:!0,authType:en.AuthType.NO_AUTH};try{return(await en.put(o,a,n)).token}catch(E){if(!(E.originalError?.name==="HTTPError"&&E.originalError?.response.statusCode===409))throw E}let u={...n,authType:en.AuthType.NO_AUTH,headers:{authorization:`Basic ${Buffer.from(`${e.name}:${e.password}`).toString("base64")}`}},A=await en.get(o,u);for(let[E,w]of Object.entries(A))(!a[E]||E==="roles")&&(a[E]=w);let p=`${o}/-rev/${a._rev}`;return(await en.put(p,a,u)).token}async function Cvt(t,e,{alwaysAuth:r,scope:o}){let a=u=>A=>{let p=qe.isIndexableObject(A)?A:{},h=p[u],E=qe.isIndexableObject(h)?h:{};return{...p,[u]:{...E,...r!==void 0?{npmAlwaysAuth:r}:{},npmAuthToken:e}}},n=o?{npmScopes:a(o)}:{npmRegistries:a(t)};return await Je.updateHomeConfiguration(n)}async function Ivt({configuration:t,registry:e,report:r,stdin:o,stdout:a}){r.reportInfo(0,`Logging in to ${pe.pretty(t,e,pe.Type.URL)}`);let n=!1;if(e.match(/^https:\/\/npm\.pkg\.github\.com(\/|$)/)&&(r.reportInfo(0,"You seem to be using the GitHub Package Registry. Tokens must be generated with the 'repo', 'write:packages', and 'read:packages' permissions."),n=!0),r.reportSeparator(),t.env.YARN_IS_TEST_ENV)return{name:t.env.YARN_INJECT_NPM_USER||"",password:t.env.YARN_INJECT_NPM_PASSWORD||""};let u=await(0,tve.prompt)([{type:"input",name:"name",message:"Username:",required:!0,onCancel:()=>process.exit(130),stdin:o,stdout:a},{type:"password",name:"password",message:n?"Token:":"Password:",required:!0,onCancel:()=>process.exit(130),stdin:o,stdout:a}]);return r.reportSeparator(),u}Ke();Ke();Gt();var $C=new Set(["npmAuthIdent","npmAuthToken"]),eI=class extends ut{constructor(){super(...arguments);this.scope=de.String("-s,--scope",{description:"Logout of the registry configured for a given scope"});this.publish=de.Boolean("--publish",!1,{description:"Logout of the publish registry"});this.all=de.Boolean("-A,--all",!1,{description:"Logout of all registries"})}static{this.paths=[["npm","logout"]]}static{this.usage=st.Usage({category:"Npm-related commands",description:"logout of the npm registry",details:"\n This command will log you out by modifying your local configuration (in your home folder, never in the project itself) to delete all credentials linked to a registry.\n\n Adding the `-s,--scope` flag will cause the deletion to be done against whatever registry is configured for the associated scope (see also `npmScopes`).\n\n Adding the `--publish` flag will cause the deletion to be done against the registry used when publishing the package (see also `publishConfig.registry` and `npmPublishRegistry`).\n\n Adding the `-A,--all` flag will cause the deletion to be done against all registries and scopes.\n ",examples:[["Logout of the default registry","yarn npm logout"],["Logout of the @my-scope scope","yarn npm logout --scope my-scope"],["Logout of the publish registry for the current package","yarn npm logout --publish"],["Logout of all registries","yarn npm logout --all"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),o=async()=>{let n=await bF({configuration:r,cwd:this.context.cwd,publish:this.publish,scope:this.scope}),u=await Je.find(this.context.cwd,this.context.plugins),A=G.makeIdent(this.scope??null,"pkg");return!si.getAuthConfiguration(n,{configuration:u,ident:A}).get("npmAuthToken")};return(await Lt.start({configuration:r,stdout:this.context.stdout},async n=>{if(this.all&&(await Bvt(),n.reportInfo(0,"Successfully logged out from everything")),this.scope){await rve("npmScopes",this.scope),await o()?n.reportInfo(0,`Successfully logged out from ${this.scope}`):n.reportWarning(0,"Scope authentication settings removed, but some other ones settings still apply to it");return}let u=await bF({configuration:r,cwd:this.context.cwd,publish:this.publish});await rve("npmRegistries",u),await o()?n.reportInfo(0,`Successfully logged out from ${u}`):n.reportWarning(0,"Registry authentication settings removed, but some other ones settings still apply to it")})).exitCode()}};function wvt(t,e){let r=t[e];if(!qe.isIndexableObject(r))return!1;let o=new Set(Object.keys(r));if([...$C].every(n=>!o.has(n)))return!1;for(let n of $C)o.delete(n);if(o.size===0)return t[e]=void 0,!0;let a={...r};for(let n of $C)delete a[n];return t[e]=a,!0}async function Bvt(){let t=e=>{let r=!1,o=qe.isIndexableObject(e)?{...e}:{};o.npmAuthToken&&(delete o.npmAuthToken,r=!0);for(let a of Object.keys(o))wvt(o,a)&&(r=!0);if(Object.keys(o).length!==0)return r?o:e};return await Je.updateHomeConfiguration({npmRegistries:t,npmScopes:t})}async function rve(t,e){return await Je.updateHomeConfiguration({[t]:r=>{let o=qe.isIndexableObject(r)?r:{};if(!Object.hasOwn(o,e))return r;let a=o[e],n=qe.isIndexableObject(a)?a:{},u=new Set(Object.keys(n));if([...$C].every(p=>!u.has(p)))return r;for(let p of $C)u.delete(p);if(u.size===0)return Object.keys(o).length===1?void 0:{...o,[e]:void 0};let A={};for(let p of $C)A[p]=void 0;return{...o,[e]:{...n,...A}}}})}Ke();Gt();var tI=class extends ut{constructor(){super(...arguments);this.access=de.String("--access",{description:"The access for the published package (public or restricted)"});this.tag=de.String("--tag","latest",{description:"The tag on the registry that the package should be attached to"});this.tolerateRepublish=de.Boolean("--tolerate-republish",!1,{description:"Warn and exit when republishing an already existing version of a package"});this.otp=de.String("--otp",{description:"The OTP token to use with the command"})}static{this.paths=[["npm","publish"]]}static{this.usage=st.Usage({category:"Npm-related commands",description:"publish the active workspace to the npm registry",details:'\n This command will pack the active workspace into a fresh archive and upload it to the npm registry.\n\n The package will by default be attached to the `latest` tag on the registry, but this behavior can be overridden by using the `--tag` option.\n\n Note that for legacy reasons scoped packages are by default published with an access set to `restricted` (aka "private packages"). This requires you to register for a paid npm plan. In case you simply wish to publish a public scoped package to the registry (for free), just add the `--access public` flag. This behavior can be enabled by default through the `npmPublishAccess` settings.\n ',examples:[["Publish the active workspace","yarn npm publish"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:o,workspace:a}=await Qt.find(r,this.context.cwd);if(!a)throw new or(o.cwd,this.context.cwd);if(a.manifest.private)throw new ot("Private workspaces cannot be published");if(a.manifest.name===null||a.manifest.version===null)throw new ot("Workspaces must have valid names and versions to be published on an external registry");await o.restoreInstallState();let n=a.manifest.name,u=a.manifest.version,A=si.getPublishRegistry(a.manifest,{configuration:r});return(await Lt.start({configuration:r,stdout:this.context.stdout},async h=>{if(this.tolerateRepublish)try{let E=await en.get(en.getIdentUrl(n),{configuration:r,registry:A,ident:n,jsonResponse:!0});if(!Object.hasOwn(E,"versions"))throw new zt(15,'Registry returned invalid data for - missing "versions" field');if(Object.hasOwn(E.versions,u)){h.reportWarning(0,`Registry already knows about version ${u}; skipping.`);return}}catch(E){if(E.originalError?.response?.statusCode!==404)throw E}await hn.maybeExecuteWorkspaceLifecycleScript(a,"prepublish",{report:h}),await BA.prepareForPack(a,{report:h},async()=>{let E=await BA.genPackList(a);for(let T of E)h.reportInfo(null,T);let w=await BA.genPackStream(a,E),D=await qe.bufferStream(w),b=await VC.getGitHead(a.cwd),C=await VC.makePublishBody(a,D,{access:this.access,tag:this.tag,registry:A,gitHead:b});await en.put(en.getIdentUrl(n),C,{configuration:r,registry:A,ident:n,otp:this.otp,jsonResponse:!0})}),h.reportInfo(0,"Package archive published")})).exitCode()}};Ke();Gt();var nve=et(ni());Ke();Pt();Gt();var rI=class extends ut{constructor(){super(...arguments);this.json=de.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.package=de.String({required:!1})}static{this.paths=[["npm","tag","list"]]}static{this.usage=st.Usage({category:"Npm-related commands",description:"list all dist-tags of a package",details:` This command will list all tags of a package from the npm registry. If the package is not specified, Yarn will default to the current workspace. `,examples:[["List all tags of package `my-pkg`","yarn npm tag list my-pkg"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:o,workspace:a}=await Qt.find(r,this.context.cwd),n;if(typeof this.package<"u")n=G.parseIdent(this.package);else{if(!a)throw new or(o.cwd,this.context.cwd);if(!a.manifest.name)throw new ot(`Missing 'name' field in ${Ae.fromPortablePath(K.join(a.cwd,mr.manifest))}`);n=a.manifest.name}let u=await Zv(n,r),p={children:qe.sortMap(Object.entries(u),([h])=>h).map(([h,E])=>({value:pe.tuple(pe.Type.RESOLUTION,{descriptor:G.makeDescriptor(n,h),locator:G.makeLocator(n,E)})}))};return As.emitTree(p,{configuration:r,json:this.json,stdout:this.context.stdout})}};async function Zv(t,e){let r=`/-/package${en.getIdentUrl(t)}/dist-tags`;return en.get(r,{configuration:e,ident:t,jsonResponse:!0,customErrorMessage:en.customPackageError})}var nI=class extends ut{constructor(){super(...arguments);this.package=de.String();this.tag=de.String()}static{this.paths=[["npm","tag","add"]]}static{this.usage=st.Usage({category:"Npm-related commands",description:"add a tag for a specific version of a package",details:` This command will add a tag to the npm registry for a specific version of a package. If the tag already exists, it will be overwritten. `,examples:[["Add a `beta` tag for version `2.3.4-beta.4` of package `my-pkg`","yarn npm tag add my-pkg@2.3.4-beta.4 beta"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:o,workspace:a}=await Qt.find(r,this.context.cwd);if(!a)throw new or(o.cwd,this.context.cwd);let n=G.parseDescriptor(this.package,!0),u=n.range;if(!nve.default.valid(u))throw new ot(`The range ${pe.pretty(r,n.range,pe.Type.RANGE)} must be a valid semver version`);let A=si.getPublishRegistry(a.manifest,{configuration:r}),p=pe.pretty(r,n,pe.Type.IDENT),h=pe.pretty(r,u,pe.Type.RANGE),E=pe.pretty(r,this.tag,pe.Type.CODE);return(await Lt.start({configuration:r,stdout:this.context.stdout},async D=>{let b=await Zv(n,r);Object.hasOwn(b,this.tag)&&b[this.tag]===u&&D.reportWarning(0,`Tag ${E} is already set to version ${h}`);let C=`/-/package${en.getIdentUrl(n)}/dist-tags/${encodeURIComponent(this.tag)}`;await en.put(C,u,{configuration:r,registry:A,ident:n,jsonRequest:!0,jsonResponse:!0}),D.reportInfo(0,`Tag ${E} added to version ${h} of package ${p}`)})).exitCode()}};Ke();Gt();var iI=class extends ut{constructor(){super(...arguments);this.package=de.String();this.tag=de.String()}static{this.paths=[["npm","tag","remove"]]}static{this.usage=st.Usage({category:"Npm-related commands",description:"remove a tag from a package",details:` This command will remove a tag from a package from the npm registry. `,examples:[["Remove the `beta` tag from package `my-pkg`","yarn npm tag remove my-pkg beta"]]})}async execute(){if(this.tag==="latest")throw new ot("The 'latest' tag cannot be removed.");let r=await Je.find(this.context.cwd,this.context.plugins),{project:o,workspace:a}=await Qt.find(r,this.context.cwd);if(!a)throw new or(o.cwd,this.context.cwd);let n=G.parseIdent(this.package),u=si.getPublishRegistry(a.manifest,{configuration:r}),A=pe.pretty(r,this.tag,pe.Type.CODE),p=pe.pretty(r,n,pe.Type.IDENT),h=await Zv(n,r);if(!Object.hasOwn(h,this.tag))throw new ot(`${A} is not a tag of package ${p}`);return(await Lt.start({configuration:r,stdout:this.context.stdout},async w=>{let D=`/-/package${en.getIdentUrl(n)}/dist-tags/${encodeURIComponent(this.tag)}`;await en.del(D,{configuration:r,registry:u,ident:n,jsonResponse:!0}),w.reportInfo(0,`Tag ${A} removed from package ${p}`)})).exitCode()}};Ke();Ke();Gt();var sI=class extends ut{constructor(){super(...arguments);this.scope=de.String("-s,--scope",{description:"Print username for the registry configured for a given scope"});this.publish=de.Boolean("--publish",!1,{description:"Print username for the publish registry"})}static{this.paths=[["npm","whoami"]]}static{this.usage=st.Usage({category:"Npm-related commands",description:"display the name of the authenticated user",details:"\n Print the username associated with the current authentication settings to the standard output.\n\n When using `-s,--scope`, the username printed will be the one that matches the authentication settings of the registry associated with the given scope (those settings can be overriden using the `npmRegistries` map, and the registry associated with the scope is configured via the `npmScopes` map).\n\n When using `--publish`, the registry we'll select will by default be the one used when publishing packages (`publishConfig.registry` or `npmPublishRegistry` if available, otherwise we'll fallback to the regular `npmRegistryServer`).\n ",examples:[["Print username for the default registry","yarn npm whoami"],["Print username for the registry on a given scope","yarn npm whoami --scope company"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),o;return this.scope&&this.publish?o=si.getScopeRegistry(this.scope,{configuration:r,type:si.RegistryType.PUBLISH_REGISTRY}):this.scope?o=si.getScopeRegistry(this.scope,{configuration:r}):this.publish?o=si.getPublishRegistry((await aE(r,this.context.cwd)).manifest,{configuration:r}):o=si.getDefaultRegistry({configuration:r}),(await Lt.start({configuration:r,stdout:this.context.stdout},async n=>{let u;try{u=await en.get("/-/whoami",{configuration:r,registry:o,authType:en.AuthType.ALWAYS_AUTH,jsonResponse:!0,ident:this.scope?G.makeIdent(this.scope,""):void 0})}catch(A){if(A.response?.statusCode===401||A.response?.statusCode===403){n.reportError(41,"Authentication failed - your credentials may have expired");return}else throw A}n.reportInfo(0,u.username)})).exitCode()}};var vvt={configuration:{npmPublishAccess:{description:"Default access of the published packages",type:"STRING",default:null},npmAuditExcludePackages:{description:"Array of glob patterns of packages to exclude from npm audit",type:"STRING",default:[],isArray:!0},npmAuditIgnoreAdvisories:{description:"Array of glob patterns of advisory IDs to exclude from npm audit",type:"STRING",default:[],isArray:!0}},commands:[JC,XC,ZC,eI,tI,nI,rI,iI,sI]},Dvt=vvt;var gG={};Kt(gG,{PatchCommand:()=>AI,PatchCommitCommand:()=>uI,PatchFetcher:()=>nD,PatchResolver:()=>iD,default:()=>jvt,patchUtils:()=>Id});Ke();Ke();Pt();sA();var Id={};Kt(Id,{applyPatchFile:()=>QF,diffFolders:()=>pG,ensureUnpatchedDescriptor:()=>cG,ensureUnpatchedLocator:()=>RF,extractPackageToDisk:()=>fG,extractPatchFlags:()=>uve,isParentRequired:()=>AG,isPatchDescriptor:()=>FF,isPatchLocator:()=>i0,loadPatchFiles:()=>rD,makeDescriptor:()=>TF,makeLocator:()=>uG,makePatchHash:()=>hG,parseDescriptor:()=>eD,parseLocator:()=>tD,parsePatchFile:()=>$v,unpatchDescriptor:()=>_vt,unpatchLocator:()=>Hvt});Ke();Pt();Ke();Pt();var Pvt=/^@@ -(\d+)(,(\d+))? \+(\d+)(,(\d+))? @@.*/;function oI(t){return K.relative(Bt.root,K.resolve(Bt.root,Ae.toPortablePath(t)))}function Svt(t){let e=t.trim().match(Pvt);if(!e)throw new Error(`Bad header line: '${t}'`);return{original:{start:Math.max(Number(e[1]),1),length:Number(e[3]||1)},patched:{start:Math.max(Number(e[4]),1),length:Number(e[6]||1)}}}var xvt=420,bvt=493;var ive=()=>({semverExclusivity:null,diffLineFromPath:null,diffLineToPath:null,oldMode:null,newMode:null,deletedFileMode:null,newFileMode:null,renameFrom:null,renameTo:null,beforeHash:null,afterHash:null,fromPath:null,toPath:null,hunks:null}),kvt=t=>({header:Svt(t),parts:[]}),Qvt={"@":"header","-":"deletion","+":"insertion"," ":"context","\\":"pragma",undefined:"context"};function Fvt(t){let e=[],r=ive(),o="parsing header",a=null,n=null;function u(){a&&(n&&(a.parts.push(n),n=null),r.hunks.push(a),a=null)}function A(){u(),e.push(r),r=ive()}for(let p=0;p0?"patch":"mode change",z=null;switch(U){case"rename":{if(!E||!w)throw new Error("Bad parser state: rename from & to not given");e.push({type:"rename",semverExclusivity:o,fromPath:oI(E),toPath:oI(w)}),z=w}break;case"file deletion":{let te=a||C;if(!te)throw new Error("Bad parse state: no path given for file deletion");e.push({type:"file deletion",semverExclusivity:o,hunk:N&&N[0]||null,path:oI(te),mode:kF(p),hash:D})}break;case"file creation":{let te=n||T;if(!te)throw new Error("Bad parse state: no path given for file creation");e.push({type:"file creation",semverExclusivity:o,hunk:N&&N[0]||null,path:oI(te),mode:kF(h),hash:b})}break;case"patch":case"mode change":z=T||n;break;default:qe.assertNever(U);break}z&&u&&A&&u!==A&&e.push({type:"mode change",semverExclusivity:o,path:oI(z),oldMode:kF(u),newMode:kF(A)}),z&&N&&N.length&&e.push({type:"patch",semverExclusivity:o,path:oI(z),hunks:N,beforeHash:D,afterHash:b})}if(e.length===0)throw new Error("Unable to parse patch file: No changes found. Make sure the patch is a valid UTF8 encoded string");return e}function kF(t){let e=parseInt(t,8)&511;if(e!==xvt&&e!==bvt)throw new Error(`Unexpected file mode string: ${t}`);return e}function $v(t){let e=t.split(/\n/g);return e[e.length-1]===""&&e.pop(),Rvt(Fvt(e))}function Tvt(t){let e=0,r=0;for(let{type:o,lines:a}of t.parts)switch(o){case"context":r+=a.length,e+=a.length;break;case"deletion":e+=a.length;break;case"insertion":r+=a.length;break;default:qe.assertNever(o);break}if(e!==t.header.original.length||r!==t.header.patched.length){let o=a=>a<0?a:`+${a}`;throw new Error(`hunk header integrity check failed (expected @@ ${o(t.header.original.length)} ${o(t.header.patched.length)} @@, got @@ ${o(e)} ${o(r)} @@)`)}}Ke();Pt();var aI=class extends Error{constructor(r,o){super(`Cannot apply hunk #${r+1}`);this.hunk=o}};async function lI(t,e,r){let o=await t.lstatPromise(e),a=await r();typeof a<"u"&&(e=a),await t.lutimesPromise(e,o.atime,o.mtime)}async function QF(t,{baseFs:e=new _n,dryRun:r=!1,version:o=null}={}){for(let a of t)if(!(a.semverExclusivity!==null&&o!==null&&!Ur.satisfiesWithPrereleases(o,a.semverExclusivity)))switch(a.type){case"file deletion":if(r){if(!e.existsSync(a.path))throw new Error(`Trying to delete a file that doesn't exist: ${a.path}`)}else await lI(e,K.dirname(a.path),async()=>{await e.unlinkPromise(a.path)});break;case"rename":if(r){if(!e.existsSync(a.fromPath))throw new Error(`Trying to move a file that doesn't exist: ${a.fromPath}`)}else await lI(e,K.dirname(a.fromPath),async()=>{await lI(e,K.dirname(a.toPath),async()=>{await lI(e,a.fromPath,async()=>(await e.movePromise(a.fromPath,a.toPath),a.toPath))})});break;case"file creation":if(r){if(e.existsSync(a.path))throw new Error(`Trying to create a file that already exists: ${a.path}`)}else{let n=a.hunk?a.hunk.parts[0].lines.join(` `)+(a.hunk.parts[0].noNewlineAtEndOfFile?"":` `):"";await e.mkdirpPromise(K.dirname(a.path),{chmod:493,utimes:[Pi.SAFE_TIME,Pi.SAFE_TIME]}),await e.writeFilePromise(a.path,n,{mode:a.mode}),await e.utimesPromise(a.path,Pi.SAFE_TIME,Pi.SAFE_TIME)}break;case"patch":await lI(e,a.path,async()=>{await Ovt(a,{baseFs:e,dryRun:r})});break;case"mode change":{let u=(await e.statPromise(a.path)).mode;if(sve(a.newMode)!==sve(u))continue;await lI(e,a.path,async()=>{await e.chmodPromise(a.path,a.newMode)})}break;default:qe.assertNever(a);break}}function sve(t){return(t&64)>0}function ove(t){return t.replace(/\s+$/,"")}function Nvt(t,e){return ove(t)===ove(e)}async function Ovt({hunks:t,path:e},{baseFs:r,dryRun:o=!1}){let a=await r.statSync(e).mode,u=(await r.readFileSync(e,"utf8")).split(/\n/),A=[],p=0,h=0;for(let w of t){let D=Math.max(h,w.header.patched.start+p),b=Math.max(0,D-h),C=Math.max(0,u.length-D-w.header.original.length),T=Math.max(b,C),N=0,U=0,z=null;for(;N<=T;){if(N<=b&&(U=D-N,z=ave(w,u,U),z!==null)){N=-N;break}if(N<=C&&(U=D+N,z=ave(w,u,U),z!==null))break;N+=1}if(z===null)throw new aI(t.indexOf(w),w);A.push(z),p+=N,h=U+w.header.original.length}if(o)return;let E=0;for(let w of A)for(let D of w)switch(D.type){case"splice":{let b=D.index+E;u.splice(b,D.numToDelete,...D.linesToInsert),E+=D.linesToInsert.length-D.numToDelete}break;case"pop":u.pop();break;case"push":u.push(D.line);break;default:qe.assertNever(D);break}await r.writeFilePromise(e,u.join(` `),{mode:a})}function ave(t,e,r){let o=[];for(let a of t.parts)switch(a.type){case"context":case"deletion":{for(let n of a.lines){let u=e[r];if(u==null||!Nvt(u,n))return null;r+=1}a.type==="deletion"&&(o.push({type:"splice",index:r-a.lines.length,numToDelete:a.lines.length,linesToInsert:[]}),a.noNewlineAtEndOfFile&&o.push({type:"push",line:""}))}break;case"insertion":o.push({type:"splice",index:r,numToDelete:0,linesToInsert:a.lines}),a.noNewlineAtEndOfFile&&o.push({type:"pop"});break;default:qe.assertNever(a.type);break}return o}var Uvt=/^builtin<([^>]+)>$/;function cI(t,e){let{protocol:r,source:o,selector:a,params:n}=G.parseRange(t);if(r!=="patch:")throw new Error("Invalid patch range");if(o===null)throw new Error("Patch locators must explicitly define their source");let u=a?a.split(/&/).map(E=>Ae.toPortablePath(E)):[],A=n&&typeof n.locator=="string"?G.parseLocator(n.locator):null,p=n&&typeof n.version=="string"?n.version:null,h=e(o);return{parentLocator:A,sourceItem:h,patchPaths:u,sourceVersion:p}}function FF(t){return t.range.startsWith("patch:")}function i0(t){return t.reference.startsWith("patch:")}function eD(t){let{sourceItem:e,...r}=cI(t.range,G.parseDescriptor);return{...r,sourceDescriptor:e}}function tD(t){let{sourceItem:e,...r}=cI(t.reference,G.parseLocator);return{...r,sourceLocator:e}}function _vt(t){let{sourceItem:e}=cI(t.range,G.parseDescriptor);return e}function Hvt(t){let{sourceItem:e}=cI(t.reference,G.parseLocator);return e}function cG(t){if(!FF(t))return t;let{sourceItem:e}=cI(t.range,G.parseDescriptor);return e}function RF(t){if(!i0(t))return t;let{sourceItem:e}=cI(t.reference,G.parseLocator);return e}function lve({parentLocator:t,sourceItem:e,patchPaths:r,sourceVersion:o,patchHash:a},n){let u=t!==null?{locator:G.stringifyLocator(t)}:{},A=typeof o<"u"?{version:o}:{},p=typeof a<"u"?{hash:a}:{};return G.makeRange({protocol:"patch:",source:n(e),selector:r.join("&"),params:{...A,...p,...u}})}function TF(t,{parentLocator:e,sourceDescriptor:r,patchPaths:o}){return G.makeDescriptor(t,lve({parentLocator:e,sourceItem:r,patchPaths:o},G.stringifyDescriptor))}function uG(t,{parentLocator:e,sourcePackage:r,patchPaths:o,patchHash:a}){return G.makeLocator(t,lve({parentLocator:e,sourceItem:r,sourceVersion:r.version,patchPaths:o,patchHash:a},G.stringifyLocator))}function cve({onAbsolute:t,onRelative:e,onProject:r,onBuiltin:o},a){let n=a.lastIndexOf("!");n!==-1&&(a=a.slice(n+1));let u=a.match(Uvt);return u!==null?o(u[1]):a.startsWith("~/")?r(a.slice(2)):K.isAbsolute(a)?t(a):e(a)}function uve(t){let e=t.lastIndexOf("!");return{optional:(e!==-1?new Set(t.slice(0,e).split(/!/)):new Set).has("optional")}}function AG(t){return cve({onAbsolute:()=>!1,onRelative:()=>!0,onProject:()=>!1,onBuiltin:()=>!1},t)}async function rD(t,e,r){let o=t!==null?await r.fetcher.fetch(t,r):null,a=o&&o.localPath?{packageFs:new En(Bt.root),prefixPath:K.relative(Bt.root,o.localPath)}:o;o&&o!==a&&o.releaseFs&&o.releaseFs();let n=await qe.releaseAfterUseAsync(async()=>await Promise.all(e.map(async u=>{let A=uve(u),p=await cve({onAbsolute:async h=>await ae.readFilePromise(h,"utf8"),onRelative:async h=>{if(a===null)throw new Error("Assertion failed: The parent locator should have been fetched");return await a.packageFs.readFilePromise(K.join(a.prefixPath,h),"utf8")},onProject:async h=>await ae.readFilePromise(K.join(r.project.cwd,h),"utf8"),onBuiltin:async h=>await r.project.configuration.firstHook(E=>E.getBuiltinPatch,r.project,h)},u);return{...A,source:p}})));for(let u of n)typeof u.source=="string"&&(u.source=u.source.replace(/\r\n?/g,` `));return n}async function fG(t,{cache:e,project:r}){let o=r.storedPackages.get(t.locatorHash);if(typeof o>"u")throw new Error("Assertion failed: Expected the package to be registered");let a=RF(t),n=r.storedChecksums,u=new Ri,A=await ae.mktempPromise(),p=K.join(A,"source"),h=K.join(A,"user"),E=K.join(A,".yarn-patch.json"),w=r.configuration.makeFetcher(),D=[];try{let b,C;if(t.locatorHash===a.locatorHash){let T=await w.fetch(t,{cache:e,project:r,fetcher:w,checksums:n,report:u});D.push(()=>T.releaseFs?.()),b=T,C=T}else b=await w.fetch(t,{cache:e,project:r,fetcher:w,checksums:n,report:u}),D.push(()=>b.releaseFs?.()),C=await w.fetch(t,{cache:e,project:r,fetcher:w,checksums:n,report:u}),D.push(()=>C.releaseFs?.());await Promise.all([ae.copyPromise(p,b.prefixPath,{baseFs:b.packageFs}),ae.copyPromise(h,C.prefixPath,{baseFs:C.packageFs}),ae.writeJsonPromise(E,{locator:G.stringifyLocator(t),version:o.version})])}finally{for(let b of D)b()}return ae.detachTemp(A),h}async function pG(t,e){let r=Ae.fromPortablePath(t).replace(/\\/g,"/"),o=Ae.fromPortablePath(e).replace(/\\/g,"/"),{stdout:a,stderr:n}=await Hr.execvp("git",["-c","core.safecrlf=false","diff","--src-prefix=a/","--dst-prefix=b/","--ignore-cr-at-eol","--full-index","--no-index","--no-renames","--text",r,o],{cwd:Ae.toPortablePath(process.cwd()),env:{...process.env,GIT_CONFIG_NOSYSTEM:"1",HOME:"",XDG_CONFIG_HOME:"",USERPROFILE:""}});if(n.length>0)throw new Error(`Unable to diff directories. Make sure you have a recent version of 'git' available in PATH. The following error was reported by 'git': ${n}`);let u=r.startsWith("/")?A=>A.slice(1):A=>A;return a.replace(new RegExp(`(a|b)(${qe.escapeRegExp(`/${u(r)}/`)})`,"g"),"$1/").replace(new RegExp(`(a|b)${qe.escapeRegExp(`/${u(o)}/`)}`,"g"),"$1/").replace(new RegExp(qe.escapeRegExp(`${r}/`),"g"),"").replace(new RegExp(qe.escapeRegExp(`${o}/`),"g"),"")}function hG(t,e){let r=[];for(let{source:o}of t){if(o===null)continue;let a=$v(o);for(let n of a){let{semverExclusivity:u,...A}=n;u!==null&&e!==null&&!Ur.satisfiesWithPrereleases(e,u)||r.push(JSON.stringify(A))}}return bn.makeHash(`${3}`,...r).slice(0,6)}Ke();function Ave(t,{configuration:e,report:r}){for(let o of t.parts)for(let a of o.lines)switch(o.type){case"context":r.reportInfo(null,` ${pe.pretty(e,a,"grey")}`);break;case"deletion":r.reportError(28,`- ${pe.pretty(e,a,pe.Type.REMOVED)}`);break;case"insertion":r.reportError(28,`+ ${pe.pretty(e,a,pe.Type.ADDED)}`);break;default:qe.assertNever(o.type)}}var nD=class{supports(e,r){return!!i0(e)}getLocalPath(e,r){return null}async fetch(e,r){let o=r.checksums.get(e.locatorHash)||null,[a,n,u]=await r.cache.fetchPackageFromCache(e,o,{onHit:()=>r.report.reportCacheHit(e),onMiss:()=>r.report.reportCacheMiss(e,`${G.prettyLocator(r.project.configuration,e)} can't be found in the cache and will be fetched from the disk`),loader:()=>this.patchPackage(e,r),...r.cacheOptions});return{packageFs:a,releaseFs:n,prefixPath:G.getIdentVendorPath(e),localPath:this.getLocalPath(e,r),checksum:u}}async patchPackage(e,r){let{parentLocator:o,sourceLocator:a,sourceVersion:n,patchPaths:u}=tD(e),A=await rD(o,u,r),p=await ae.mktempPromise(),h=K.join(p,"current.zip"),E=await r.fetcher.fetch(a,r),w=G.getIdentVendorPath(e),D=new Zi(h,{create:!0,level:r.project.configuration.get("compressionLevel")});await qe.releaseAfterUseAsync(async()=>{await D.copyPromise(w,E.prefixPath,{baseFs:E.packageFs,stableSort:!0})},E.releaseFs),D.saveAndClose();for(let{source:b,optional:C}of A){if(b===null)continue;let T=new Zi(h,{level:r.project.configuration.get("compressionLevel")}),N=new En(K.resolve(Bt.root,w),{baseFs:T});try{await QF($v(b),{baseFs:N,version:n})}catch(U){if(!(U instanceof aI))throw U;let z=r.project.configuration.get("enableInlineHunks"),te=!z&&!C?" (set enableInlineHunks for details)":"",le=`${G.prettyLocator(r.project.configuration,e)}: ${U.message}${te}`,ce=ue=>{z&&Ave(U.hunk,{configuration:r.project.configuration,report:ue})};if(T.discardAndClose(),C){r.report.reportWarningOnce(66,le,{reportExtra:ce});continue}else throw new zt(66,le,ce)}T.saveAndClose()}return new Zi(h,{level:r.project.configuration.get("compressionLevel")})}};Ke();var iD=class{supportsDescriptor(e,r){return!!FF(e)}supportsLocator(e,r){return!!i0(e)}shouldPersistResolution(e,r){return!1}bindDescriptor(e,r,o){let{patchPaths:a}=eD(e);return a.every(n=>!AG(n))?e:G.bindDescriptor(e,{locator:G.stringifyLocator(r)})}getResolutionDependencies(e,r){let{sourceDescriptor:o}=eD(e);return{sourceDescriptor:r.project.configuration.normalizeDependency(o)}}async getCandidates(e,r,o){if(!o.fetchOptions)throw new Error("Assertion failed: This resolver cannot be used unless a fetcher is configured");let{parentLocator:a,patchPaths:n}=eD(e),u=await rD(a,n,o.fetchOptions),A=r.sourceDescriptor;if(typeof A>"u")throw new Error("Assertion failed: The dependency should have been resolved");let p=hG(u,A.version);return[uG(e,{parentLocator:a,sourcePackage:A,patchPaths:n,patchHash:p})]}async getSatisfying(e,r,o,a){let[n]=await this.getCandidates(e,r,a);return{locators:o.filter(u=>u.locatorHash===n.locatorHash),sorted:!1}}async resolve(e,r){let{sourceLocator:o}=tD(e);return{...await r.resolver.resolve(o,r),...e}}};Ke();Pt();Gt();var uI=class extends ut{constructor(){super(...arguments);this.save=de.Boolean("-s,--save",!1,{description:"Add the patch to your resolution entries"});this.patchFolder=de.String()}static{this.paths=[["patch-commit"]]}static{this.usage=st.Usage({description:"generate a patch out of a directory",details:"\n By default, this will print a patchfile on stdout based on the diff between the folder passed in and the original version of the package. Such file is suitable for consumption with the `patch:` protocol.\n\n With the `-s,--save` option set, the patchfile won't be printed on stdout anymore and will instead be stored within a local file (by default kept within `.yarn/patches`, but configurable via the `patchFolder` setting). A `resolutions` entry will also be added to your top-level manifest, referencing the patched package via the `patch:` protocol.\n\n Note that only folders generated by `yarn patch` are accepted as valid input for `yarn patch-commit`.\n "})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:o,workspace:a}=await Qt.find(r,this.context.cwd);if(!a)throw new or(o.cwd,this.context.cwd);await o.restoreInstallState();let n=K.resolve(this.context.cwd,Ae.toPortablePath(this.patchFolder)),u=K.join(n,"../source"),A=K.join(n,"../.yarn-patch.json");if(!ae.existsSync(u))throw new ot("The argument folder didn't get created by 'yarn patch'");let p=await pG(u,n),h=await ae.readJsonPromise(A),E=G.parseLocator(h.locator,!0);if(!o.storedPackages.has(E.locatorHash))throw new ot("No package found in the project for the given locator");if(!this.save){this.context.stdout.write(p);return}let w=r.get("patchFolder"),D=K.join(w,`${G.slugifyLocator(E)}.patch`);await ae.mkdirPromise(w,{recursive:!0}),await ae.writeFilePromise(D,p);let b=[],C=new Map;for(let T of o.storedPackages.values()){if(G.isVirtualLocator(T))continue;let N=T.dependencies.get(E.identHash);if(!N)continue;let U=G.ensureDevirtualizedDescriptor(N),z=cG(U),te=o.storedResolutions.get(z.descriptorHash);if(!te)throw new Error("Assertion failed: Expected the resolution to have been registered");if(!o.storedPackages.get(te))throw new Error("Assertion failed: Expected the package to have been registered");let ce=o.tryWorkspaceByLocator(T);if(ce)b.push(ce);else{let ue=o.originalPackages.get(T.locatorHash);if(!ue)throw new Error("Assertion failed: Expected the original package to have been registered");let Ie=ue.dependencies.get(N.identHash);if(!Ie)throw new Error("Assertion failed: Expected the original dependency to have been registered");C.set(Ie.descriptorHash,Ie)}}for(let T of b)for(let N of _t.hardDependencies){let U=T.manifest[N].get(E.identHash);if(!U)continue;let z=TF(U,{parentLocator:null,sourceDescriptor:G.convertLocatorToDescriptor(E),patchPaths:[K.join(mr.home,K.relative(o.cwd,D))]});T.manifest[N].set(U.identHash,z)}for(let T of C.values()){let N=TF(T,{parentLocator:null,sourceDescriptor:G.convertLocatorToDescriptor(E),patchPaths:[K.join(mr.home,K.relative(o.cwd,D))]});o.topLevelWorkspace.manifest.resolutions.push({pattern:{descriptor:{fullName:G.stringifyIdent(N),description:T.range}},reference:N.range})}await o.persist()}};Ke();Pt();Gt();var AI=class extends ut{constructor(){super(...arguments);this.update=de.Boolean("-u,--update",!1,{description:"Reapply local patches that already apply to this packages"});this.json=de.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.package=de.String()}static{this.paths=[["patch"]]}static{this.usage=st.Usage({description:"prepare a package for patching",details:"\n This command will cause a package to be extracted in a temporary directory intended to be editable at will.\n\n Once you're done with your changes, run `yarn patch-commit -s path` (with `path` being the temporary directory you received) to generate a patchfile and register it into your top-level manifest via the `patch:` protocol. Run `yarn patch-commit -h` for more details.\n\n Calling the command when you already have a patch won't import it by default (in other words, the default behavior is to reset existing patches). However, adding the `-u,--update` flag will import any current patch.\n "})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:o,workspace:a}=await Qt.find(r,this.context.cwd),n=await Wr.find(r);if(!a)throw new or(o.cwd,this.context.cwd);await o.restoreInstallState();let u=G.parseLocator(this.package);if(u.reference==="unknown"){let A=qe.mapAndFilter([...o.storedPackages.values()],p=>p.identHash!==u.identHash?qe.mapAndFilter.skip:G.isVirtualLocator(p)?qe.mapAndFilter.skip:i0(p)!==this.update?qe.mapAndFilter.skip:p);if(A.length===0)throw new ot("No package found in the project for the given locator");if(A.length>1)throw new ot(`Multiple candidate packages found; explicitly choose one of them (use \`yarn why \` to get more information as to who depends on them): ${A.map(p=>` - ${G.prettyLocator(r,p)}`).join("")}`);u=A[0]}if(!o.storedPackages.has(u.locatorHash))throw new ot("No package found in the project for the given locator");await Lt.start({configuration:r,json:this.json,stdout:this.context.stdout},async A=>{let p=RF(u),h=await fG(u,{cache:n,project:o});A.reportJson({locator:G.stringifyLocator(p),path:Ae.fromPortablePath(h)});let E=this.update?" along with its current modifications":"";A.reportInfo(0,`Package ${G.prettyLocator(r,p)} got extracted with success${E}!`),A.reportInfo(0,`You can now edit the following folder: ${pe.pretty(r,Ae.fromPortablePath(h),"magenta")}`),A.reportInfo(0,`Once you are done run ${pe.pretty(r,`yarn patch-commit -s ${process.platform==="win32"?'"':""}${Ae.fromPortablePath(h)}${process.platform==="win32"?'"':""}`,"cyan")} and Yarn will store a patchfile based on your changes.`)})}};var qvt={configuration:{enableInlineHunks:{description:"If true, the installs will print unmatched patch hunks",type:"BOOLEAN",default:!1},patchFolder:{description:"Folder where the patch files must be written",type:"ABSOLUTE_PATH",default:"./.yarn/patches"}},commands:[uI,AI],fetchers:[nD],resolvers:[iD]},jvt=qvt;var yG={};Kt(yG,{PnpmLinker:()=>sD,default:()=>Vvt});Ke();Pt();Gt();var sD=class{getCustomDataKey(){return JSON.stringify({name:"PnpmLinker",version:3})}supportsPackage(e,r){return this.isEnabled(r)}async findPackageLocation(e,r){if(!this.isEnabled(r))throw new Error("Assertion failed: Expected the pnpm linker to be enabled");let o=this.getCustomDataKey(),a=r.project.linkersCustomData.get(o);if(!a)throw new ot(`The project in ${pe.pretty(r.project.configuration,`${r.project.cwd}/package.json`,pe.Type.PATH)} doesn't seem to have been installed - running an install there might help`);let n=a.pathsByLocator.get(e.locatorHash);if(typeof n>"u")throw new ot(`Couldn't find ${G.prettyLocator(r.project.configuration,e)} in the currently installed pnpm map - running an install might help`);return n.packageLocation}async findPackageLocator(e,r){if(!this.isEnabled(r))return null;let o=this.getCustomDataKey(),a=r.project.linkersCustomData.get(o);if(!a)throw new ot(`The project in ${pe.pretty(r.project.configuration,`${r.project.cwd}/package.json`,pe.Type.PATH)} doesn't seem to have been installed - running an install there might help`);let n=e.match(/(^.*\/node_modules\/(@[^/]*\/)?[^/]+)(\/.*$)/);if(n){let p=a.locatorByPath.get(n[1]);if(p)return p}let u=e,A=e;do{A=u,u=K.dirname(A);let p=a.locatorByPath.get(A);if(p)return p}while(u!==A);return null}makeInstaller(e){return new dG(e)}isEnabled(e){return e.project.configuration.get("nodeLinker")==="pnpm"}},dG=class{constructor(e){this.opts=e;this.asyncActions=new qe.AsyncActions(10);this.customData={pathsByLocator:new Map,locatorByPath:new Map};this.indexFolderPromise=$D(ae,{indexPath:K.join(e.project.configuration.get("globalFolder"),"index")})}attachCustomData(e){}async installPackage(e,r,o){switch(e.linkType){case"SOFT":return this.installPackageSoft(e,r,o);case"HARD":return this.installPackageHard(e,r,o)}throw new Error("Assertion failed: Unsupported package link type")}async installPackageSoft(e,r,o){let a=K.resolve(r.packageFs.getRealPath(),r.prefixPath),n=this.opts.project.tryWorkspaceByLocator(e)?K.join(a,mr.nodeModules):null;return this.customData.pathsByLocator.set(e.locatorHash,{packageLocation:a,dependenciesLocation:n}),{packageLocation:a,buildRequest:null}}async installPackageHard(e,r,o){let a=Gvt(e,{project:this.opts.project}),n=a.packageLocation;this.customData.locatorByPath.set(n,G.stringifyLocator(e)),this.customData.pathsByLocator.set(e.locatorHash,a),o.holdFetchResult(this.asyncActions.set(e.locatorHash,async()=>{await ae.mkdirPromise(n,{recursive:!0}),await ae.copyPromise(n,r.prefixPath,{baseFs:r.packageFs,overwrite:!1,linkStrategy:{type:"HardlinkFromIndex",indexPath:await this.indexFolderPromise,autoRepair:!0}})}));let A=G.isVirtualLocator(e)?G.devirtualizeLocator(e):e,p={manifest:await _t.tryFind(r.prefixPath,{baseFs:r.packageFs})??new _t,misc:{hasBindingGyp:CA.hasBindingGyp(r)}},h=this.opts.project.getDependencyMeta(A,e.version),E=CA.extractBuildRequest(e,p,h,{configuration:this.opts.project.configuration});return{packageLocation:n,buildRequest:E}}async attachInternalDependencies(e,r){if(this.opts.project.configuration.get("nodeLinker")!=="pnpm"||!fve(e,{project:this.opts.project}))return;let o=this.customData.pathsByLocator.get(e.locatorHash);if(typeof o>"u")throw new Error(`Assertion failed: Expected the package to have been registered (${G.stringifyLocator(e)})`);let{dependenciesLocation:a}=o;a&&this.asyncActions.reduce(e.locatorHash,async n=>{await ae.mkdirPromise(a,{recursive:!0});let u=await Wvt(a),A=new Map(u),p=[n],h=(w,D)=>{let b=D;fve(D,{project:this.opts.project})||(this.opts.report.reportWarningOnce(0,"The pnpm linker doesn't support providing different versions to workspaces' peer dependencies"),b=G.devirtualizeLocator(D));let C=this.customData.pathsByLocator.get(b.locatorHash);if(typeof C>"u")throw new Error(`Assertion failed: Expected the package to have been registered (${G.stringifyLocator(D)})`);let T=G.stringifyIdent(w),N=K.join(a,T),U=K.relative(K.dirname(N),C.packageLocation),z=A.get(T);A.delete(T),p.push(Promise.resolve().then(async()=>{if(z){if(z.isSymbolicLink()&&await ae.readlinkPromise(N)===U)return;await ae.removePromise(N)}await ae.mkdirpPromise(K.dirname(N)),process.platform=="win32"&&this.opts.project.configuration.get("winLinkType")==="junctions"?await ae.symlinkPromise(C.packageLocation,N,"junction"):await ae.symlinkPromise(U,N)}))},E=!1;for(let[w,D]of r)w.identHash===e.identHash&&(E=!0),h(w,D);!E&&!this.opts.project.tryWorkspaceByLocator(e)&&h(G.convertLocatorToDescriptor(e),e),p.push(Yvt(a,A)),await Promise.all(p)})}async attachExternalDependents(e,r){throw new Error("External dependencies haven't been implemented for the pnpm linker")}async finalizeInstall(){let e=hve(this.opts.project);if(this.opts.project.configuration.get("nodeLinker")!=="pnpm")await ae.removePromise(e);else{let r;try{r=new Set(await ae.readdirPromise(e))}catch{r=new Set}for(let{dependenciesLocation:o}of this.customData.pathsByLocator.values()){if(!o)continue;let a=K.contains(e,o);if(a===null)continue;let[n]=a.split(K.sep);r.delete(n)}await Promise.all([...r].map(async o=>{await ae.removePromise(K.join(e,o))}))}return await this.asyncActions.wait(),await mG(e),this.opts.project.configuration.get("nodeLinker")!=="node-modules"&&await mG(pve(this.opts.project)),{customData:this.customData}}};function pve(t){return K.join(t.cwd,mr.nodeModules)}function hve(t){return K.join(pve(t),".store")}function Gvt(t,{project:e}){let r=G.slugifyLocator(t),o=hve(e),a=K.join(o,r,"package"),n=K.join(o,r,mr.nodeModules);return{packageLocation:a,dependenciesLocation:n}}function fve(t,{project:e}){return!G.isVirtualLocator(t)||!e.tryWorkspaceByLocator(t)}async function Wvt(t){let e=new Map,r=[];try{r=await ae.readdirPromise(t,{withFileTypes:!0})}catch(o){if(o.code!=="ENOENT")throw o}try{for(let o of r)if(!o.name.startsWith("."))if(o.name.startsWith("@")){let a=await ae.readdirPromise(K.join(t,o.name),{withFileTypes:!0});if(a.length===0)e.set(o.name,o);else for(let n of a)e.set(`${o.name}/${n.name}`,n)}else e.set(o.name,o)}catch(o){if(o.code!=="ENOENT")throw o}return e}async function Yvt(t,e){let r=[],o=new Set;for(let a of e.keys()){r.push(ae.removePromise(K.join(t,a)));let n=G.tryParseIdent(a)?.scope;n&&o.add(`@${n}`)}return Promise.all(r).then(()=>Promise.all([...o].map(a=>mG(K.join(t,a)))))}async function mG(t){try{await ae.rmdirPromise(t)}catch(e){if(e.code!=="ENOENT"&&e.code!=="ENOTEMPTY")throw e}}var Kvt={linkers:[sD]},Vvt=Kvt;var DG={};Kt(DG,{StageCommand:()=>fI,default:()=>sDt,stageUtils:()=>NF});Ke();Pt();Gt();Ke();Pt();var NF={};Kt(NF,{ActionType:()=>EG,checkConsensus:()=>LF,expandDirectory:()=>wG,findConsensus:()=>BG,findVcsRoot:()=>CG,genCommitMessage:()=>vG,getCommitPrefix:()=>gve,isYarnFile:()=>IG});Pt();var EG=(n=>(n[n.CREATE=0]="CREATE",n[n.DELETE=1]="DELETE",n[n.ADD=2]="ADD",n[n.REMOVE=3]="REMOVE",n[n.MODIFY=4]="MODIFY",n))(EG||{});async function CG(t,{marker:e}){do if(!ae.existsSync(K.join(t,e)))t=K.dirname(t);else return t;while(t!=="/");return null}function IG(t,{roots:e,names:r}){if(r.has(K.basename(t)))return!0;do if(!e.has(t))t=K.dirname(t);else return!0;while(t!=="/");return!1}function wG(t){let e=[],r=[t];for(;r.length>0;){let o=r.pop(),a=ae.readdirSync(o);for(let n of a){let u=K.resolve(o,n);ae.lstatSync(u).isDirectory()?r.push(u):e.push(u)}}return e}function LF(t,e){let r=0,o=0;for(let a of t)a!=="wip"&&(e.test(a)?r+=1:o+=1);return r>=o}function BG(t){let e=LF(t,/^(\w\(\w+\):\s*)?\w+s/),r=LF(t,/^(\w\(\w+\):\s*)?[A-Z]/),o=LF(t,/^\w\(\w+\):/);return{useThirdPerson:e,useUpperCase:r,useComponent:o}}function gve(t){return t.useComponent?"chore(yarn): ":""}var zvt=new Map([[0,"create"],[1,"delete"],[2,"add"],[3,"remove"],[4,"update"]]);function vG(t,e){let r=gve(t),o=[],a=e.slice().sort((n,u)=>n[0]-u[0]);for(;a.length>0;){let[n,u]=a.shift(),A=zvt.get(n);t.useUpperCase&&o.length===0&&(A=`${A[0].toUpperCase()}${A.slice(1)}`),t.useThirdPerson&&(A+="s");let p=[u];for(;a.length>0&&a[0][0]===n;){let[,E]=a.shift();p.push(E)}p.sort();let h=p.shift();p.length===1?h+=" (and one other)":p.length>1&&(h+=` (and ${p.length} others)`),o.push(`${A} ${h}`)}return`${r}${o.join(", ")}`}var Jvt="Commit generated via `yarn stage`",Xvt=11;async function dve(t){let{code:e,stdout:r}=await Hr.execvp("git",["log","-1","--pretty=format:%H"],{cwd:t});return e===0?r.trim():null}async function Zvt(t,e){let r=[],o=e.filter(h=>K.basename(h.path)==="package.json");for(let{action:h,path:E}of o){let w=K.relative(t,E);if(h===4){let D=await dve(t),{stdout:b}=await Hr.execvp("git",["show",`${D}:${w}`],{cwd:t,strict:!0}),C=await _t.fromText(b),T=await _t.fromFile(E),N=new Map([...T.dependencies,...T.devDependencies]),U=new Map([...C.dependencies,...C.devDependencies]);for(let[z,te]of U){let le=G.stringifyIdent(te),ce=N.get(z);ce?ce.range!==te.range&&r.push([4,`${le} to ${ce.range}`]):r.push([3,le])}for(let[z,te]of N)U.has(z)||r.push([2,G.stringifyIdent(te)])}else if(h===0){let D=await _t.fromFile(E);D.name?r.push([0,G.stringifyIdent(D.name)]):r.push([0,"a package"])}else if(h===1){let D=await dve(t),{stdout:b}=await Hr.execvp("git",["show",`${D}:${w}`],{cwd:t,strict:!0}),C=await _t.fromText(b);C.name?r.push([1,G.stringifyIdent(C.name)]):r.push([1,"a package"])}else throw new Error("Assertion failed: Unsupported action type")}let{code:a,stdout:n}=await Hr.execvp("git",["log",`-${Xvt}`,"--pretty=format:%s"],{cwd:t}),u=a===0?n.split(/\n/g).filter(h=>h!==""):[],A=BG(u);return vG(A,r)}var $vt={0:[" A ","?? "],4:[" M "],1:[" D "]},eDt={0:["A "],4:["M "],1:["D "]},mve={async findRoot(t){return await CG(t,{marker:".git"})},async filterChanges(t,e,r,o){let{stdout:a}=await Hr.execvp("git",["status","-s"],{cwd:t,strict:!0}),n=a.toString().split(/\n/g),u=o?.staged?eDt:$vt;return[].concat(...n.map(p=>{if(p==="")return[];let h=p.slice(0,3),E=K.resolve(t,p.slice(3));if(!o?.staged&&h==="?? "&&p.endsWith("/"))return wG(E).map(w=>({action:0,path:w}));{let D=[0,4,1].find(b=>u[b].includes(h));return D!==void 0?[{action:D,path:E}]:[]}})).filter(p=>IG(p.path,{roots:e,names:r}))},async genCommitMessage(t,e){return await Zvt(t,e)},async makeStage(t,e){let r=e.map(o=>Ae.fromPortablePath(o.path));await Hr.execvp("git",["add","--",...r],{cwd:t,strict:!0})},async makeCommit(t,e,r){let o=e.map(a=>Ae.fromPortablePath(a.path));await Hr.execvp("git",["add","-N","--",...o],{cwd:t,strict:!0}),await Hr.execvp("git",["commit","-m",`${r} ${Jvt} `,"--",...o],{cwd:t,strict:!0})},async makeReset(t,e){let r=e.map(o=>Ae.fromPortablePath(o.path));await Hr.execvp("git",["reset","HEAD","--",...r],{cwd:t,strict:!0})}};var tDt=[mve],fI=class extends ut{constructor(){super(...arguments);this.commit=de.Boolean("-c,--commit",!1,{description:"Commit the staged files"});this.reset=de.Boolean("-r,--reset",!1,{description:"Remove all files from the staging area"});this.dryRun=de.Boolean("-n,--dry-run",!1,{description:"Print the commit message and the list of modified files without staging / committing"});this.update=de.Boolean("-u,--update",!1,{hidden:!0})}static{this.paths=[["stage"]]}static{this.usage=st.Usage({description:"add all yarn files to your vcs",details:"\n This command will add to your staging area the files belonging to Yarn (typically any modified `package.json` and `.yarnrc.yml` files, but also linker-generated files, cache data, etc). It will take your ignore list into account, so the cache files won't be added if the cache is ignored in a `.gitignore` file (assuming you use Git).\n\n Running `--reset` will instead remove them from the staging area (the changes will still be there, but won't be committed until you stage them back).\n\n Since the staging area is a non-existent concept in Mercurial, Yarn will always create a new commit when running this command on Mercurial repositories. You can get this behavior when using Git by using the `--commit` flag which will directly create a commit.\n ",examples:[["Adds all modified project files to the staging area","yarn stage"],["Creates a new commit containing all modified project files","yarn stage --commit"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:o}=await Qt.find(r,this.context.cwd),{driver:a,root:n}=await rDt(o.cwd),u=[r.get("cacheFolder"),r.get("globalFolder"),r.get("virtualFolder"),r.get("yarnPath")];await r.triggerHook(w=>w.populateYarnPaths,o,w=>{u.push(w)});let A=new Set;for(let w of u)for(let D of nDt(n,w))A.add(D);let p=new Set([r.get("rcFilename"),mr.lockfile,mr.manifest]),h=await a.filterChanges(n,A,p),E=await a.genCommitMessage(n,h);if(this.dryRun)if(this.commit)this.context.stdout.write(`${E} `);else for(let w of h)this.context.stdout.write(`${Ae.fromPortablePath(w.path)} `);else if(this.reset){let w=await a.filterChanges(n,A,p,{staged:!0});w.length===0?this.context.stdout.write("No staged changes found!"):await a.makeReset(n,w)}else h.length===0?this.context.stdout.write("No changes found!"):this.commit?await a.makeCommit(n,h,E):(await a.makeStage(n,h),this.context.stdout.write(E))}};async function rDt(t){let e=null,r=null;for(let o of tDt)if((r=await o.findRoot(t))!==null){e=o;break}if(e===null||r===null)throw new ot("No stage driver has been found for your current project");return{driver:e,root:r}}function nDt(t,e){let r=[];if(e===null)return r;for(;;){(e===t||e.startsWith(`${t}/`))&&r.push(e);let o;try{o=ae.statSync(e)}catch{break}if(o.isSymbolicLink())e=K.resolve(K.dirname(e),ae.readlinkSync(e));else break}return r}var iDt={commands:[fI]},sDt=iDt;var PG={};Kt(PG,{default:()=>pDt});Ke();Ke();Pt();var Cve=et(ni());Ke();var yve=et(N6()),oDt="e8e1bd300d860104bb8c58453ffa1eb4",aDt="OFCNCOG2CU",Eve=async(t,e)=>{let r=G.stringifyIdent(t),a=lDt(e).initIndex("npm-search");try{return(await a.getObject(r,{attributesToRetrieve:["types"]})).types?.ts==="definitely-typed"}catch{return!1}},lDt=t=>(0,yve.default)(aDt,oDt,{requester:{async send(r){try{let o=await on.request(r.url,r.data||null,{configuration:t,headers:r.headers});return{content:o.body,isTimedOut:!1,status:o.statusCode}}catch(o){return{content:o.response.body,isTimedOut:!1,status:o.response.statusCode}}}}});var Ive=t=>t.scope?`${t.scope}__${t.name}`:`${t.name}`,cDt=async(t,e,r,o)=>{if(r.scope==="types")return;let{project:a}=t,{configuration:n}=a;if(!(n.get("tsEnableAutoTypes")??(ae.existsSync(K.join(t.cwd,"tsconfig.json"))||ae.existsSync(K.join(a.cwd,"tsconfig.json")))))return;let A=n.makeResolver(),p={project:a,resolver:A,report:new Ri};if(!await Eve(r,n))return;let E=Ive(r),w=G.parseRange(r.range).selector;if(!Ur.validRange(w)){let N=n.normalizeDependency(r),U=await A.getCandidates(N,{},p);w=G.parseRange(U[0].reference).selector}let D=Cve.default.coerce(w);if(D===null)return;let b=`${nu.Modifier.CARET}${D.major}`,C=G.makeDescriptor(G.makeIdent("types",E),b),T=qe.mapAndFind(a.workspaces,N=>{let U=N.manifest.dependencies.get(r.identHash)?.descriptorHash,z=N.manifest.devDependencies.get(r.identHash)?.descriptorHash;if(U!==r.descriptorHash&&z!==r.descriptorHash)return qe.mapAndFind.skip;let te=[];for(let le of _t.allDependencies){let ce=N.manifest[le].get(C.identHash);typeof ce>"u"||te.push([le,ce])}return te.length===0?qe.mapAndFind.skip:te});if(typeof T<"u")for(let[N,U]of T)t.manifest[N].set(U.identHash,U);else{try{let N=n.normalizeDependency(C);if((await A.getCandidates(N,{},p)).length===0)return}catch{return}t.manifest[nu.Target.DEVELOPMENT].set(C.identHash,C)}},uDt=async(t,e,r)=>{if(r.scope==="types")return;let{project:o}=t,{configuration:a}=o;if(!(a.get("tsEnableAutoTypes")??(ae.existsSync(K.join(t.cwd,"tsconfig.json"))||ae.existsSync(K.join(o.cwd,"tsconfig.json")))))return;let u=Ive(r),A=G.makeIdent("types",u);for(let p of _t.allDependencies)typeof t.manifest[p].get(A.identHash)>"u"||t.manifest[p].delete(A.identHash)},ADt=(t,e)=>{e.publishConfig&&e.publishConfig.typings&&(e.typings=e.publishConfig.typings),e.publishConfig&&e.publishConfig.types&&(e.types=e.publishConfig.types)},fDt={configuration:{tsEnableAutoTypes:{description:"Whether Yarn should auto-install @types/ dependencies on 'yarn add'",type:"BOOLEAN",isNullable:!0,default:null}},hooks:{afterWorkspaceDependencyAddition:cDt,afterWorkspaceDependencyRemoval:uDt,beforeWorkspacePacking:ADt}},pDt=fDt;var QG={};Kt(QG,{VersionApplyCommand:()=>mI,VersionCheckCommand:()=>yI,VersionCommand:()=>EI,default:()=>FDt,versionUtils:()=>dI});Ke();Ke();Gt();var dI={};Kt(dI,{Decision:()=>hI,applyPrerelease:()=>Sve,applyReleases:()=>kG,applyStrategy:()=>MF,clearVersionFiles:()=>SG,getUndecidedDependentWorkspaces:()=>aD,getUndecidedWorkspaces:()=>OF,openVersionFile:()=>gI,requireMoreDecisions:()=>bDt,resolveVersionFiles:()=>oD,suggestStrategy:()=>bG,updateVersionFiles:()=>xG,validateReleaseDecision:()=>pI});Ke();Pt();Ol();Gt();var Pve=et(Dve()),PA=et(ni()),xDt=/^(>=|[~^]|)(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(-(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(\+[0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*)?$/,hI=(u=>(u.UNDECIDED="undecided",u.DECLINE="decline",u.MAJOR="major",u.MINOR="minor",u.PATCH="patch",u.PRERELEASE="prerelease",u))(hI||{});function pI(t){let e=PA.default.valid(t);return e||qe.validateEnum((0,Pve.default)(hI,"UNDECIDED"),t)}async function oD(t,{prerelease:e=null}={}){let r=new Map,o=t.configuration.get("deferredVersionFolder");if(!ae.existsSync(o))return r;let a=await ae.readdirPromise(o);for(let n of a){if(!n.endsWith(".yml"))continue;let u=K.join(o,n),A=await ae.readFilePromise(u,"utf8"),p=Ki(A);for(let[h,E]of Object.entries(p.releases||{})){if(E==="decline")continue;let w=G.parseIdent(h),D=t.tryWorkspaceByIdent(w);if(D===null)throw new Error(`Assertion failed: Expected a release definition file to only reference existing workspaces (${K.basename(u)} references ${h})`);if(D.manifest.version===null)throw new Error(`Assertion failed: Expected the workspace to have a version (${G.prettyLocator(t.configuration,D.anchoredLocator)})`);let b=D.manifest.raw.stableVersion??D.manifest.version,C=r.get(D),T=MF(b,pI(E));if(T===null)throw new Error(`Assertion failed: Expected ${b} to support being bumped via strategy ${E}`);let N=typeof C<"u"?PA.default.gt(T,C)?T:C:T;r.set(D,N)}}return e&&(r=new Map([...r].map(([n,u])=>[n,Sve(u,{current:n.manifest.version,prerelease:e})]))),r}async function SG(t){let e=t.configuration.get("deferredVersionFolder");ae.existsSync(e)&&await ae.removePromise(e)}async function xG(t,e){let r=new Set(e),o=t.configuration.get("deferredVersionFolder");if(!ae.existsSync(o))return;let a=await ae.readdirPromise(o);for(let n of a){if(!n.endsWith(".yml"))continue;let u=K.join(o,n),A=await ae.readFilePromise(u,"utf8"),p=Ki(A),h=p?.releases;if(h){for(let E of Object.keys(h)){let w=G.parseIdent(E),D=t.tryWorkspaceByIdent(w);(D===null||r.has(D))&&delete p.releases[E]}Object.keys(p.releases).length>0?await ae.changeFilePromise(u,Pa(new Pa.PreserveOrdering(p))):await ae.unlinkPromise(u)}}}async function gI(t,{allowEmpty:e=!1}={}){let r=t.configuration;if(r.projectCwd===null)throw new ot("This command can only be run from within a Yarn project");let o=await ra.fetchRoot(r.projectCwd),a=o!==null?await ra.fetchBase(o,{baseRefs:r.get("changesetBaseRefs")}):null,n=o!==null?await ra.fetchChangedFiles(o,{base:a.hash,project:t}):[],u=r.get("deferredVersionFolder"),A=n.filter(b=>K.contains(u,b)!==null);if(A.length>1)throw new ot(`Your current branch contains multiple versioning files; this isn't supported: - ${A.map(b=>Ae.fromPortablePath(b)).join(` - `)}`);let p=new Set(qe.mapAndFilter(n,b=>{let C=t.tryWorkspaceByFilePath(b);return C===null?qe.mapAndFilter.skip:C}));if(A.length===0&&p.size===0&&!e)return null;let h=A.length===1?A[0]:K.join(u,`${bn.makeHash(Math.random().toString()).slice(0,8)}.yml`),E=ae.existsSync(h)?await ae.readFilePromise(h,"utf8"):"{}",w=Ki(E),D=new Map;for(let b of w.declined||[]){let C=G.parseIdent(b),T=t.getWorkspaceByIdent(C);D.set(T,"decline")}for(let[b,C]of Object.entries(w.releases||{})){let T=G.parseIdent(b),N=t.getWorkspaceByIdent(T);D.set(N,pI(C))}return{project:t,root:o,baseHash:a!==null?a.hash:null,baseTitle:a!==null?a.title:null,changedFiles:new Set(n),changedWorkspaces:p,releaseRoots:new Set([...p].filter(b=>b.manifest.version!==null)),releases:D,async saveAll(){let b={},C=[],T=[];for(let N of t.workspaces){if(N.manifest.version===null)continue;let U=G.stringifyIdent(N.anchoredLocator),z=D.get(N);z==="decline"?C.push(U):typeof z<"u"?b[U]=pI(z):p.has(N)&&T.push(U)}await ae.mkdirPromise(K.dirname(h),{recursive:!0}),await ae.changeFilePromise(h,Pa(new Pa.PreserveOrdering({releases:Object.keys(b).length>0?b:void 0,declined:C.length>0?C:void 0,undecided:T.length>0?T:void 0})))}}}function bDt(t){return OF(t).size>0||aD(t).length>0}function OF(t){let e=new Set;for(let r of t.changedWorkspaces)r.manifest.version!==null&&(t.releases.has(r)||e.add(r));return e}function aD(t,{include:e=new Set}={}){let r=[],o=new Map(qe.mapAndFilter([...t.releases],([n,u])=>u==="decline"?qe.mapAndFilter.skip:[n.anchoredLocator.locatorHash,n])),a=new Map(qe.mapAndFilter([...t.releases],([n,u])=>u!=="decline"?qe.mapAndFilter.skip:[n.anchoredLocator.locatorHash,n]));for(let n of t.project.workspaces)if(!(!e.has(n)&&(a.has(n.anchoredLocator.locatorHash)||o.has(n.anchoredLocator.locatorHash)))&&n.manifest.version!==null)for(let u of _t.hardDependencies)for(let A of n.manifest.getForScope(u).values()){let p=t.project.tryWorkspaceByDescriptor(A);p!==null&&o.has(p.anchoredLocator.locatorHash)&&r.push([n,p])}return r}function bG(t,e){let r=PA.default.clean(e);for(let o of Object.values(hI))if(o!=="undecided"&&o!=="decline"&&PA.default.inc(t,o)===r)return o;return null}function MF(t,e){if(PA.default.valid(e))return e;if(t===null)throw new ot(`Cannot apply the release strategy "${e}" unless the workspace already has a valid version`);if(!PA.default.valid(t))throw new ot(`Cannot apply the release strategy "${e}" on a non-semver version (${t})`);let r=PA.default.inc(t,e);if(r===null)throw new ot(`Cannot apply the release strategy "${e}" on the specified version (${t})`);return r}function kG(t,e,{report:r}){let o=new Map;for(let a of t.workspaces)for(let n of _t.allDependencies)for(let u of a.manifest[n].values()){let A=t.tryWorkspaceByDescriptor(u);if(A===null||!e.has(A))continue;qe.getArrayWithDefault(o,A).push([a,n,u.identHash])}for(let[a,n]of e){let u=a.manifest.version;a.manifest.version=n,PA.default.prerelease(n)===null?delete a.manifest.raw.stableVersion:a.manifest.raw.stableVersion||(a.manifest.raw.stableVersion=u);let A=a.manifest.name!==null?G.stringifyIdent(a.manifest.name):null;r.reportInfo(0,`${G.prettyLocator(t.configuration,a.anchoredLocator)}: Bumped to ${n}`),r.reportJson({cwd:Ae.fromPortablePath(a.cwd),ident:A,oldVersion:u,newVersion:n});let p=o.get(a);if(!(typeof p>"u"))for(let[h,E,w]of p){let D=h.manifest[E].get(w);if(typeof D>"u")throw new Error("Assertion failed: The dependency should have existed");let b=D.range,C=!1;if(b.startsWith(ci.protocol)&&(b=b.slice(ci.protocol.length),C=!0,b===a.relativeCwd))continue;let T=b.match(xDt);if(!T){r.reportWarning(0,`Couldn't auto-upgrade range ${b} (in ${G.prettyLocator(t.configuration,h.anchoredLocator)})`);continue}let N=`${T[1]}${n}`;C&&(N=`${ci.protocol}${N}`);let U=G.makeDescriptor(D,N);h.manifest[E].set(w,U)}}}var kDt=new Map([["%n",{extract:t=>t.length>=1?[t[0],t.slice(1)]:null,generate:(t=0)=>`${t+1}`}]]);function Sve(t,{current:e,prerelease:r}){let o=new PA.default.SemVer(e),a=o.prerelease.slice(),n=[];o.prerelease=[],o.format()!==t&&(a.length=0);let u=!0,A=r.split(/\./g);for(let p of A){let h=kDt.get(p);if(typeof h>"u")n.push(p),a[0]===p?a.shift():u=!1;else{let E=u?h.extract(a):null;E!==null&&typeof E[0]=="number"?(n.push(h.generate(E[0])),a=E[1]):(n.push(h.generate()),u=!1)}}return o.prerelease&&(o.prerelease=[]),`${t}-${n.join(".")}`}var mI=class extends ut{constructor(){super(...arguments);this.all=de.Boolean("--all",!1,{description:"Apply the deferred version changes on all workspaces"});this.dryRun=de.Boolean("--dry-run",!1,{description:"Print the versions without actually generating the package archive"});this.prerelease=de.String("--prerelease",{description:"Add a prerelease identifier to new versions",tolerateBoolean:!0});this.recursive=de.Boolean("-R,--recursive",{description:"Release the transitive workspaces as well"});this.json=de.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}static{this.paths=[["version","apply"]]}static{this.usage=st.Usage({category:"Release-related commands",description:"apply all the deferred version bumps at once",details:` This command will apply the deferred version changes and remove their definitions from the repository. Note that if \`--prerelease\` is set, the given prerelease identifier (by default \`rc.%n\`) will be used on all new versions and the version definitions will be kept as-is. By default only the current workspace will be bumped, but you can configure this behavior by using one of: - \`--recursive\` to also apply the version bump on its dependencies - \`--all\` to apply the version bump on all packages in the repository Note that this command will also update the \`workspace:\` references across all your local workspaces, thus ensuring that they keep referring to the same workspaces even after the version bump. `,examples:[["Apply the version change to the local workspace","yarn version apply"],["Apply the version change to all the workspaces in the local workspace","yarn version apply --all"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:o,workspace:a}=await Qt.find(r,this.context.cwd),n=await Wr.find(r);if(!a)throw new or(o.cwd,this.context.cwd);await o.restoreInstallState({restoreResolutions:!1});let u=await Lt.start({configuration:r,json:this.json,stdout:this.context.stdout},async A=>{let p=this.prerelease?typeof this.prerelease!="boolean"?this.prerelease:"rc.%n":null,h=await oD(o,{prerelease:p}),E=new Map;if(this.all)E=h;else{let w=this.recursive?a.getRecursiveWorkspaceDependencies():[a];for(let D of w){let b=h.get(D);typeof b<"u"&&E.set(D,b)}}if(E.size===0){let w=h.size>0?" Did you want to add --all?":"";A.reportWarning(0,`The current workspace doesn't seem to require a version bump.${w}`);return}kG(o,E,{report:A}),this.dryRun||(p||(this.all?await SG(o):await xG(o,[...E.keys()])),A.reportSeparator())});return this.dryRun||u.hasErrors()?u.exitCode():await o.installWithNewReport({json:this.json,stdout:this.context.stdout},{cache:n})}};Ke();Pt();Gt();var UF=et(ni());var yI=class extends ut{constructor(){super(...arguments);this.interactive=de.Boolean("-i,--interactive",{description:"Open an interactive interface used to set version bumps"})}static{this.paths=[["version","check"]]}static{this.usage=st.Usage({category:"Release-related commands",description:"check that all the relevant packages have been bumped",details:"\n **Warning:** This command currently requires Git.\n\n This command will check that all the packages covered by the files listed in argument have been properly bumped or declined to bump.\n\n In the case of a bump, the check will also cover transitive packages - meaning that should `Foo` be bumped, a package `Bar` depending on `Foo` will require a decision as to whether `Bar` will need to be bumped. This check doesn't cross packages that have declined to bump.\n\n In case no arguments are passed to the function, the list of modified files will be generated by comparing the HEAD against `master`.\n ",examples:[["Check whether the modified packages need a bump","yarn version check"]]})}async execute(){return this.interactive?await this.executeInteractive():await this.executeStandard()}async executeInteractive(){AC(this.context);let{Gem:r}=await Promise.resolve().then(()=>(UQ(),oj)),{ScrollableItems:o}=await Promise.resolve().then(()=>(jQ(),qQ)),{FocusRequest:a}=await Promise.resolve().then(()=>(lj(),Qwe)),{useListInput:n}=await Promise.resolve().then(()=>(HQ(),Fwe)),{renderForm:u}=await Promise.resolve().then(()=>(KQ(),YQ)),{Box:A,Text:p}=await Promise.resolve().then(()=>et(ac())),{default:h,useCallback:E,useState:w}=await Promise.resolve().then(()=>et(ln())),D=await Je.find(this.context.cwd,this.context.plugins),{project:b,workspace:C}=await Qt.find(D,this.context.cwd);if(!C)throw new or(b.cwd,this.context.cwd);await b.restoreInstallState();let T=await gI(b);if(T===null||T.releaseRoots.size===0)return 0;if(T.root===null)throw new ot("This command can only be run on Git repositories");let N=()=>h.createElement(A,{flexDirection:"row",paddingBottom:1},h.createElement(A,{flexDirection:"column",width:60},h.createElement(A,null,h.createElement(p,null,"Press ",h.createElement(p,{bold:!0,color:"cyanBright"},""),"/",h.createElement(p,{bold:!0,color:"cyanBright"},"")," to select workspaces.")),h.createElement(A,null,h.createElement(p,null,"Press ",h.createElement(p,{bold:!0,color:"cyanBright"},""),"/",h.createElement(p,{bold:!0,color:"cyanBright"},"")," to select release strategies."))),h.createElement(A,{flexDirection:"column"},h.createElement(A,{marginLeft:1},h.createElement(p,null,"Press ",h.createElement(p,{bold:!0,color:"cyanBright"},"")," to save.")),h.createElement(A,{marginLeft:1},h.createElement(p,null,"Press ",h.createElement(p,{bold:!0,color:"cyanBright"},"")," to abort.")))),U=({workspace:Ie,active:he,decision:De,setDecision:Ee})=>{let g=Ie.manifest.raw.stableVersion??Ie.manifest.version;if(g===null)throw new Error(`Assertion failed: The version should have been set (${G.prettyLocator(D,Ie.anchoredLocator)})`);if(UF.default.prerelease(g)!==null)throw new Error(`Assertion failed: Prerelease identifiers shouldn't be found (${g})`);let me=["undecided","decline","patch","minor","major"];n(De,me,{active:he,minus:"left",plus:"right",set:Ee});let Ce=De==="undecided"?h.createElement(p,{color:"yellow"},g):De==="decline"?h.createElement(p,{color:"green"},g):h.createElement(p,null,h.createElement(p,{color:"magenta"},g)," \u2192 ",h.createElement(p,{color:"green"},UF.default.valid(De)?De:UF.default.inc(g,De)));return h.createElement(A,{flexDirection:"column"},h.createElement(A,null,h.createElement(p,null,G.prettyLocator(D,Ie.anchoredLocator)," - ",Ce)),h.createElement(A,null,me.map(fe=>h.createElement(A,{key:fe,paddingLeft:2},h.createElement(p,null,h.createElement(r,{active:fe===De})," ",fe)))))},z=Ie=>{let he=new Set(T.releaseRoots),De=new Map([...Ie].filter(([Ee])=>he.has(Ee)));for(;;){let Ee=aD({project:T.project,releases:De}),g=!1;if(Ee.length>0){for(let[me]of Ee)if(!he.has(me)){he.add(me),g=!0;let Ce=Ie.get(me);typeof Ce<"u"&&De.set(me,Ce)}}if(!g)break}return{relevantWorkspaces:he,relevantReleases:De}},te=()=>{let[Ie,he]=w(()=>new Map(T.releases)),De=E((Ee,g)=>{let me=new Map(Ie);g!=="undecided"?me.set(Ee,g):me.delete(Ee);let{relevantReleases:Ce}=z(me);he(Ce)},[Ie,he]);return[Ie,De]},le=({workspaces:Ie,releases:he})=>{let De=[];De.push(`${Ie.size} total`);let Ee=0,g=0;for(let me of Ie){let Ce=he.get(me);typeof Ce>"u"?g+=1:Ce!=="decline"&&(Ee+=1)}return De.push(`${Ee} release${Ee===1?"":"s"}`),De.push(`${g} remaining`),h.createElement(p,{color:"yellow"},De.join(", "))},ue=await u(({useSubmit:Ie})=>{let[he,De]=te();Ie(he);let{relevantWorkspaces:Ee}=z(he),g=new Set([...Ee].filter(ie=>!T.releaseRoots.has(ie))),[me,Ce]=w(0),fe=E(ie=>{switch(ie){case a.BEFORE:Ce(me-1);break;case a.AFTER:Ce(me+1);break}},[me,Ce]);return h.createElement(A,{flexDirection:"column"},h.createElement(N,null),h.createElement(A,null,h.createElement(p,{wrap:"wrap"},"The following files have been modified in your local checkout.")),h.createElement(A,{flexDirection:"column",marginTop:1,paddingLeft:2},[...T.changedFiles].map(ie=>h.createElement(A,{key:ie},h.createElement(p,null,h.createElement(p,{color:"grey"},Ae.fromPortablePath(T.root)),Ae.sep,Ae.relative(Ae.fromPortablePath(T.root),Ae.fromPortablePath(ie)))))),T.releaseRoots.size>0&&h.createElement(h.Fragment,null,h.createElement(A,{marginTop:1},h.createElement(p,{wrap:"wrap"},"Because of those files having been modified, the following workspaces may need to be released again (note that private workspaces are also shown here, because even though they won't be published, releasing them will allow us to flag their dependents for potential re-release):")),g.size>3?h.createElement(A,{marginTop:1},h.createElement(le,{workspaces:T.releaseRoots,releases:he})):null,h.createElement(A,{marginTop:1,flexDirection:"column"},h.createElement(o,{active:me%2===0,radius:1,size:2,onFocusRequest:fe},[...T.releaseRoots].map(ie=>h.createElement(U,{key:ie.cwd,workspace:ie,decision:he.get(ie)||"undecided",setDecision:Z=>De(ie,Z)}))))),g.size>0?h.createElement(h.Fragment,null,h.createElement(A,{marginTop:1},h.createElement(p,{wrap:"wrap"},"The following workspaces depend on other workspaces that have been marked for release, and thus may need to be released as well:")),h.createElement(A,null,h.createElement(p,null,"(Press ",h.createElement(p,{bold:!0,color:"cyanBright"},"")," to move the focus between the workspace groups.)")),g.size>5?h.createElement(A,{marginTop:1},h.createElement(le,{workspaces:g,releases:he})):null,h.createElement(A,{marginTop:1,flexDirection:"column"},h.createElement(o,{active:me%2===1,radius:2,size:2,onFocusRequest:fe},[...g].map(ie=>h.createElement(U,{key:ie.cwd,workspace:ie,decision:he.get(ie)||"undecided",setDecision:Z=>De(ie,Z)}))))):null)},{versionFile:T},{stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr});if(typeof ue>"u")return 1;T.releases.clear();for(let[Ie,he]of ue)T.releases.set(Ie,he);await T.saveAll()}async executeStandard(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:o,workspace:a}=await Qt.find(r,this.context.cwd);if(!a)throw new or(o.cwd,this.context.cwd);return await o.restoreInstallState(),(await Lt.start({configuration:r,stdout:this.context.stdout},async u=>{let A=await gI(o);if(A===null||A.releaseRoots.size===0)return;if(A.root===null)throw new ot("This command can only be run on Git repositories");if(u.reportInfo(0,`Your PR was started right after ${pe.pretty(r,A.baseHash.slice(0,7),"yellow")} ${pe.pretty(r,A.baseTitle,"magenta")}`),A.changedFiles.size>0){u.reportInfo(0,"You have changed the following files since then:"),u.reportSeparator();for(let D of A.changedFiles)u.reportInfo(null,`${pe.pretty(r,Ae.fromPortablePath(A.root),"gray")}${Ae.sep}${Ae.relative(Ae.fromPortablePath(A.root),Ae.fromPortablePath(D))}`)}let p=!1,h=!1,E=OF(A);if(E.size>0){p||u.reportSeparator();for(let D of E)u.reportError(0,`${G.prettyLocator(r,D.anchoredLocator)} has been modified but doesn't have a release strategy attached`);p=!0}let w=aD(A);for(let[D,b]of w)h||u.reportSeparator(),u.reportError(0,`${G.prettyLocator(r,D.anchoredLocator)} doesn't have a release strategy attached, but depends on ${G.prettyWorkspace(r,b)} which is planned for release.`),h=!0;(p||h)&&(u.reportSeparator(),u.reportInfo(0,"This command detected that at least some workspaces have received modifications without explicit instructions as to how they had to be released (if needed)."),u.reportInfo(0,"To correct these errors, run `yarn version check --interactive` then follow the instructions."))})).exitCode()}};Ke();Gt();var _F=et(ni());var EI=class extends ut{constructor(){super(...arguments);this.deferred=de.Boolean("-d,--deferred",{description:"Prepare the version to be bumped during the next release cycle"});this.immediate=de.Boolean("-i,--immediate",{description:"Bump the version immediately"});this.strategy=de.String()}static{this.paths=[["version"]]}static{this.usage=st.Usage({category:"Release-related commands",description:"apply a new version to the current package",details:"\n This command will bump the version number for the given package, following the specified strategy:\n\n - If `major`, the first number from the semver range will be increased (`X.0.0`).\n - If `minor`, the second number from the semver range will be increased (`0.X.0`).\n - If `patch`, the third number from the semver range will be increased (`0.0.X`).\n - If prefixed by `pre` (`premajor`, ...), a `-0` suffix will be set (`0.0.0-0`).\n - If `prerelease`, the suffix will be increased (`0.0.0-X`); the third number from the semver range will also be increased if there was no suffix in the previous version.\n - If `decline`, the nonce will be increased for `yarn version check` to pass without version bump.\n - If a valid semver range, it will be used as new version.\n - If unspecified, Yarn will ask you for guidance.\n\n For more information about the `--deferred` flag, consult our documentation (https://yarnpkg.com/features/release-workflow#deferred-versioning).\n ",examples:[["Immediately bump the version to the next major","yarn version major"],["Prepare the version to be bumped to the next major","yarn version major --deferred"]]})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:o,workspace:a}=await Qt.find(r,this.context.cwd);if(!a)throw new or(o.cwd,this.context.cwd);let n=r.get("preferDeferredVersions");this.deferred&&(n=!0),this.immediate&&(n=!1);let u=_F.default.valid(this.strategy),A=this.strategy==="decline",p;if(u)if(a.manifest.version!==null){let E=bG(a.manifest.version,this.strategy);E!==null?p=E:p=this.strategy}else p=this.strategy;else{let E=a.manifest.version;if(!A){if(E===null)throw new ot("Can't bump the version if there wasn't a version to begin with - use 0.0.0 as initial version then run the command again.");if(typeof E!="string"||!_F.default.valid(E))throw new ot(`Can't bump the version (${E}) if it's not valid semver`)}p=pI(this.strategy)}if(!n){let w=(await oD(o)).get(a);if(typeof w<"u"&&p!=="decline"){let D=MF(a.manifest.version,p);if(_F.default.lt(D,w))throw new ot(`Can't bump the version to one that would be lower than the current deferred one (${w})`)}}let h=await gI(o,{allowEmpty:!0});return h.releases.set(a,p),await h.saveAll(),n?0:await this.cli.run(["version","apply"])}};var QDt={configuration:{deferredVersionFolder:{description:"Folder where are stored the versioning files",type:"ABSOLUTE_PATH",default:"./.yarn/versions"},preferDeferredVersions:{description:"If true, running `yarn version` will assume the `--deferred` flag unless `--immediate` is set",type:"BOOLEAN",default:!1}},commands:[mI,yI,EI]},FDt=QDt;var FG={};Kt(FG,{WorkspacesFocusCommand:()=>CI,WorkspacesForeachCommand:()=>wI,default:()=>LDt});Ke();Ke();Gt();var CI=class extends ut{constructor(){super(...arguments);this.json=de.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.production=de.Boolean("--production",!1,{description:"Only install regular dependencies by omitting dev dependencies"});this.all=de.Boolean("-A,--all",!1,{description:"Install the entire project"});this.workspaces=de.Rest()}static{this.paths=[["workspaces","focus"]]}static{this.usage=st.Usage({category:"Workspace-related commands",description:"install a single workspace and its dependencies",details:"\n This command will run an install as if the specified workspaces (and all other workspaces they depend on) were the only ones in the project. If no workspaces are explicitly listed, the active one will be assumed.\n\n Note that this command is only very moderately useful when using zero-installs, since the cache will contain all the packages anyway - meaning that the only difference between a full install and a focused install would just be a few extra lines in the `.pnp.cjs` file, at the cost of introducing an extra complexity.\n\n If the `-A,--all` flag is set, the entire project will be installed. Combine with `--production` to replicate the old `yarn install --production`.\n "})}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:o,workspace:a}=await Qt.find(r,this.context.cwd),n=await Wr.find(r);await o.restoreInstallState({restoreResolutions:!1});let u;if(this.all)u=new Set(o.workspaces);else if(this.workspaces.length===0){if(!a)throw new or(o.cwd,this.context.cwd);u=new Set([a])}else u=new Set(this.workspaces.map(A=>o.getWorkspaceByIdent(G.parseIdent(A))));for(let A of u)for(let p of this.production?["dependencies"]:_t.hardDependencies)for(let h of A.manifest.getForScope(p).values()){let E=o.tryWorkspaceByDescriptor(h);E!==null&&u.add(E)}for(let A of o.workspaces)u.has(A)?this.production&&A.manifest.devDependencies.clear():(A.manifest.installConfig=A.manifest.installConfig||{},A.manifest.installConfig.selfReferences=!1,A.manifest.dependencies.clear(),A.manifest.devDependencies.clear(),A.manifest.peerDependencies.clear(),A.manifest.scripts.clear());return await o.installWithNewReport({json:this.json,stdout:this.context.stdout},{cache:n,persistProject:!1})}};Ke();Ke();Ke();Gt();var II=et(Xo()),bve=et(lg());il();var wI=class extends ut{constructor(){super(...arguments);this.from=de.Array("--from",{description:"An array of glob pattern idents or paths from which to base any recursion"});this.all=de.Boolean("-A,--all",{description:"Run the command on all workspaces of a project"});this.recursive=de.Boolean("-R,--recursive",{description:"Run the command on the current workspace and all of its recursive dependencies"});this.worktree=de.Boolean("-W,--worktree",{description:"Run the command on all workspaces of the current worktree"});this.verbose=de.Counter("-v,--verbose",{description:"Increase level of logging verbosity up to 2 times"});this.parallel=de.Boolean("-p,--parallel",!1,{description:"Run the commands in parallel"});this.interlaced=de.Boolean("-i,--interlaced",!1,{description:"Print the output of commands in real-time instead of buffering it"});this.jobs=de.String("-j,--jobs",{description:"The maximum number of parallel tasks that the execution will be limited to; or `unlimited`",validator:pL([js(["unlimited"]),vw(fL(),[gL(),hL(1)])])});this.topological=de.Boolean("-t,--topological",!1,{description:"Run the command after all workspaces it depends on (regular) have finished"});this.topologicalDev=de.Boolean("--topological-dev",!1,{description:"Run the command after all workspaces it depends on (regular + dev) have finished"});this.include=de.Array("--include",[],{description:"An array of glob pattern idents or paths; only matching workspaces will be traversed"});this.exclude=de.Array("--exclude",[],{description:"An array of glob pattern idents or paths; matching workspaces won't be traversed"});this.publicOnly=de.Boolean("--no-private",{description:"Avoid running the command on private workspaces"});this.since=de.String("--since",{description:"Only include workspaces that have been changed since the specified ref.",tolerateBoolean:!0});this.dryRun=de.Boolean("-n,--dry-run",{description:"Print the commands that would be run, without actually running them"});this.commandName=de.String();this.args=de.Proxy()}static{this.paths=[["workspaces","foreach"]]}static{this.usage=st.Usage({category:"Workspace-related commands",description:"run a command on all workspaces",details:"\n This command will run a given sub-command on current and all its descendant workspaces. Various flags can alter the exact behavior of the command:\n\n - If `-p,--parallel` is set, the commands will be ran in parallel; they'll by default be limited to a number of parallel tasks roughly equal to half your core number, but that can be overridden via `-j,--jobs`, or disabled by setting `-j unlimited`.\n\n - If `-p,--parallel` and `-i,--interlaced` are both set, Yarn will print the lines from the output as it receives them. If `-i,--interlaced` wasn't set, it would instead buffer the output from each process and print the resulting buffers only after their source processes have exited.\n\n - If `-t,--topological` is set, Yarn will only run the command after all workspaces that it depends on through the `dependencies` field have successfully finished executing. If `--topological-dev` is set, both the `dependencies` and `devDependencies` fields will be considered when figuring out the wait points.\n\n - If `-A,--all` is set, Yarn will run the command on all the workspaces of a project.\n\n - If `-R,--recursive` is set, Yarn will find workspaces to run the command on by recursively evaluating `dependencies` and `devDependencies` fields, instead of looking at the `workspaces` fields.\n\n - If `-W,--worktree` is set, Yarn will find workspaces to run the command on by looking at the current worktree.\n\n - If `--from` is set, Yarn will use the packages matching the 'from' glob as the starting point for any recursive search.\n\n - If `--since` is set, Yarn will only run the command on workspaces that have been modified since the specified ref. By default Yarn will use the refs specified by the `changesetBaseRefs` configuration option.\n\n - If `--dry-run` is set, Yarn will explain what it would do without actually doing anything.\n\n - The command may apply to only some workspaces through the use of `--include` which acts as a whitelist. The `--exclude` flag will do the opposite and will be a list of packages that mustn't execute the script. Both flags accept glob patterns (if valid Idents and supported by [micromatch](https://github.com/micromatch/micromatch)). Make sure to escape the patterns, to prevent your own shell from trying to expand them.\n\n The `-v,--verbose` flag can be passed up to twice: once to prefix output lines with the originating workspace's name, and again to include start/finish/timing log lines. Maximum verbosity is enabled by default in terminal environments.\n\n If the command is `run` and the script being run does not exist the child workspace will be skipped without error.\n ",examples:[["Publish all packages","yarn workspaces foreach -A npm publish --tolerate-republish"],["Run the build script on all descendant packages","yarn workspaces foreach -A run build"],["Run the build script on current and all descendant packages in parallel, building package dependencies first","yarn workspaces foreach -Apt run build"],["Run the build script on several packages and all their dependencies, building dependencies first","yarn workspaces foreach -Rpt --from '{workspace-a,workspace-b}' run build"]]})}static{this.schema=[Pw("all",Ku.Forbids,["from","recursive","since","worktree"],{missingIf:"undefined"}),dL(["all","recursive","since","worktree"],{missingIf:"undefined"})]}async execute(){let r=await Je.find(this.context.cwd,this.context.plugins),{project:o,workspace:a}=await Qt.find(r,this.context.cwd);if(!this.all&&!a)throw new or(o.cwd,this.context.cwd);await o.restoreInstallState();let n=this.cli.process([this.commandName,...this.args]),u=n.path.length===1&&n.path[0]==="run"&&typeof n.scriptName<"u"?n.scriptName:null;if(n.path.length===0)throw new ot("Invalid subcommand name for iteration - use the 'run' keyword if you wish to execute a script");let A=Ee=>{this.dryRun&&this.context.stdout.write(`${Ee} `)},p=()=>{let Ee=this.from.map(g=>II.default.matcher(g));return o.workspaces.filter(g=>{let me=G.stringifyIdent(g.anchoredLocator),Ce=g.relativeCwd;return Ee.some(fe=>fe(me)||fe(Ce))})},h=[];if(this.since?(A("Option --since is set; selecting the changed workspaces as root for workspace selection"),h=Array.from(await ra.fetchChangedWorkspaces({ref:this.since,project:o}))):this.from?(A("Option --from is set; selecting the specified workspaces"),h=[...p()]):this.worktree?(A("Option --worktree is set; selecting the current workspace"),h=[a]):this.recursive?(A("Option --recursive is set; selecting the current workspace"),h=[a]):this.all&&(A("Option --all is set; selecting all workspaces"),h=[...o.workspaces]),this.dryRun&&!this.all){for(let Ee of h)A(` - ${Ee.relativeCwd} ${G.prettyLocator(r,Ee.anchoredLocator)}`);h.length>0&&A("")}let E;if(this.recursive?this.since?(A("Option --recursive --since is set; recursively selecting all dependent workspaces"),E=new Set(h.map(Ee=>[...Ee.getRecursiveWorkspaceDependents()]).flat())):(A("Option --recursive is set; recursively selecting all transitive dependencies"),E=new Set(h.map(Ee=>[...Ee.getRecursiveWorkspaceDependencies()]).flat())):this.worktree?(A("Option --worktree is set; recursively selecting all nested workspaces"),E=new Set(h.map(Ee=>[...Ee.getRecursiveWorkspaceChildren()]).flat())):E=null,E!==null&&(h=[...new Set([...h,...E])],this.dryRun))for(let Ee of E)A(` - ${Ee.relativeCwd} ${G.prettyLocator(r,Ee.anchoredLocator)}`);let w=[],D=!1;if(u?.includes(":")){for(let Ee of o.workspaces)if(Ee.manifest.scripts.has(u)&&(D=!D,D===!1))break}for(let Ee of h){if(u&&!Ee.manifest.scripts.has(u)&&!D&&!(await hn.getWorkspaceAccessibleBinaries(Ee)).has(u)){A(`Excluding ${Ee.relativeCwd} because it doesn't have a "${u}" script`);continue}if(!(u===r.env.npm_lifecycle_event&&Ee.cwd===a.cwd)){if(this.include.length>0&&!II.default.isMatch(G.stringifyIdent(Ee.anchoredLocator),this.include)&&!II.default.isMatch(Ee.relativeCwd,this.include)){A(`Excluding ${Ee.relativeCwd} because it doesn't match the --include filter`);continue}if(this.exclude.length>0&&(II.default.isMatch(G.stringifyIdent(Ee.anchoredLocator),this.exclude)||II.default.isMatch(Ee.relativeCwd,this.exclude))){A(`Excluding ${Ee.relativeCwd} because it matches the --include filter`);continue}if(this.publicOnly&&Ee.manifest.private===!0){A(`Excluding ${Ee.relativeCwd} because it's a private workspace and --no-private was set`);continue}w.push(Ee)}}if(this.dryRun)return 0;let b=this.verbose??(this.context.stdout.isTTY?1/0:0),C=b>0,T=b>1,N=this.parallel?this.jobs==="unlimited"?1/0:Number(this.jobs)||Math.ceil(Xi.availableParallelism()/2):1,U=N===1?!1:this.parallel,z=U?this.interlaced:!0,te=(0,bve.default)(N),le=new Map,ce=new Set,ue=0,Ie=null,he=!1,De=await Lt.start({configuration:r,stdout:this.context.stdout,includePrefix:!1},async Ee=>{let g=async(me,{commandIndex:Ce})=>{if(he)return-1;!U&&T&&Ce>1&&Ee.reportSeparator();let fe=RDt(me,{configuration:r,label:C,commandIndex:Ce}),[ie,Z]=xve(Ee,{prefix:fe,interlaced:z}),[Pe,Re]=xve(Ee,{prefix:fe,interlaced:z});try{T&&Ee.reportInfo(null,`${fe?`${fe} `:""}Process started`);let ht=Date.now(),q=await this.cli.run([this.commandName,...this.args],{cwd:me.cwd,stdout:ie,stderr:Pe})||0;ie.end(),Pe.end(),await Z,await Re;let nt=Date.now();if(T){let Le=r.get("enableTimers")?`, completed in ${pe.pretty(r,nt-ht,pe.Type.DURATION)}`:"";Ee.reportInfo(null,`${fe?`${fe} `:""}Process exited (exit code ${q})${Le}`)}return q===130&&(he=!0,Ie=q),q}catch(ht){throw ie.end(),Pe.end(),await Z,await Re,ht}};for(let me of w)le.set(me.anchoredLocator.locatorHash,me);for(;le.size>0&&!Ee.hasErrors();){let me=[];for(let[Z,Pe]of le){if(ce.has(Pe.anchoredDescriptor.descriptorHash))continue;let Re=!0;if(this.topological||this.topologicalDev){let ht=this.topologicalDev?new Map([...Pe.manifest.dependencies,...Pe.manifest.devDependencies]):Pe.manifest.dependencies;for(let q of ht.values()){let nt=o.tryWorkspaceByDescriptor(q);if(Re=nt===null||!le.has(nt.anchoredLocator.locatorHash),!Re)break}}if(Re&&(ce.add(Pe.anchoredDescriptor.descriptorHash),me.push(te(async()=>{let ht=await g(Pe,{commandIndex:++ue});return le.delete(Z),ce.delete(Pe.anchoredDescriptor.descriptorHash),{workspace:Pe,exitCode:ht}})),!U))break}if(me.length===0){let Z=Array.from(le.values()).map(Pe=>G.prettyLocator(r,Pe.anchoredLocator)).join(", ");Ee.reportError(3,`Dependency cycle detected (${Z})`);return}let Ce=await Promise.all(me);Ce.forEach(({workspace:Z,exitCode:Pe})=>{Pe!==0&&Ee.reportError(0,`The command failed in workspace ${G.prettyLocator(r,Z.anchoredLocator)} with exit code ${Pe}`)});let ie=Ce.map(Z=>Z.exitCode).find(Z=>Z!==0);(this.topological||this.topologicalDev)&&typeof ie<"u"&&Ee.reportError(0,"The command failed for workspaces that are depended upon by other workspaces; can't satisfy the dependency graph")}});return Ie!==null?Ie:De.exitCode()}};function xve(t,{prefix:e,interlaced:r}){let o=t.createStreamReporter(e),a=new qe.DefaultStream;a.pipe(o,{end:!1}),a.on("finish",()=>{o.end()});let n=new Promise(A=>{o.on("finish",()=>{A(a.active)})});if(r)return[a,n];let u=new qe.BufferStream;return u.pipe(a,{end:!1}),u.on("finish",()=>{a.end()}),[u,n]}function RDt(t,{configuration:e,commandIndex:r,label:o}){if(!o)return null;let n=`[${G.stringifyIdent(t.anchoredLocator)}]:`,u=["#2E86AB","#A23B72","#F18F01","#C73E1D","#CCE2A3"],A=u[r%u.length];return pe.pretty(e,n,A)}var TDt={commands:[CI,wI]},LDt=TDt;var lE=()=>({modules:new Map([["@yarnpkg/cli",S2],["@yarnpkg/core",P2],["@yarnpkg/fslib",Aw],["@yarnpkg/libzip",V1],["@yarnpkg/parsers",Ew],["@yarnpkg/shell",e2],["clipanion",Qw],["semver",NDt],["typanion",Yo],["@yarnpkg/plugin-essentials",MH],["@yarnpkg/plugin-compat",jH],["@yarnpkg/plugin-constraints",a6],["@yarnpkg/plugin-dlx",l6],["@yarnpkg/plugin-exec",A6],["@yarnpkg/plugin-file",p6],["@yarnpkg/plugin-git",OH],["@yarnpkg/plugin-github",d6],["@yarnpkg/plugin-http",m6],["@yarnpkg/plugin-init",y6],["@yarnpkg/plugin-interactive-tools",mj],["@yarnpkg/plugin-link",yj],["@yarnpkg/plugin-nm",t9],["@yarnpkg/plugin-npm",$9],["@yarnpkg/plugin-npm-cli",lG],["@yarnpkg/plugin-pack",V9],["@yarnpkg/plugin-patch",gG],["@yarnpkg/plugin-pnp",jj],["@yarnpkg/plugin-pnpm",yG],["@yarnpkg/plugin-stage",DG],["@yarnpkg/plugin-typescript",PG],["@yarnpkg/plugin-version",QG],["@yarnpkg/plugin-workspace-tools",FG]]),plugins:new Set(["@yarnpkg/plugin-essentials","@yarnpkg/plugin-compat","@yarnpkg/plugin-constraints","@yarnpkg/plugin-dlx","@yarnpkg/plugin-exec","@yarnpkg/plugin-file","@yarnpkg/plugin-git","@yarnpkg/plugin-github","@yarnpkg/plugin-http","@yarnpkg/plugin-init","@yarnpkg/plugin-interactive-tools","@yarnpkg/plugin-link","@yarnpkg/plugin-nm","@yarnpkg/plugin-npm","@yarnpkg/plugin-npm-cli","@yarnpkg/plugin-pack","@yarnpkg/plugin-patch","@yarnpkg/plugin-pnp","@yarnpkg/plugin-pnpm","@yarnpkg/plugin-stage","@yarnpkg/plugin-typescript","@yarnpkg/plugin-version","@yarnpkg/plugin-workspace-tools"])});function Fve({cwd:t,pluginConfiguration:e}){let r=new Vo({binaryLabel:"Yarn Package Manager",binaryName:"yarn",binaryVersion:nn??""});return Object.assign(r,{defaultContext:{...Vo.defaultContext,cwd:t,plugins:e,quiet:!1,stdin:process.stdin,stdout:process.stdout,stderr:process.stderr}})}function ODt(t){if(qe.parseOptionalBoolean(process.env.YARN_IGNORE_NODE))return!0;let r=process.versions.node,o=">=18.12.0";if(Ur.satisfiesWithPrereleases(r,o))return!0;let a=new ot(`This tool requires a Node version compatible with ${o} (got ${r}). Upgrade Node, or set \`YARN_IGNORE_NODE=1\` in your environment.`);return Vo.defaultContext.stdout.write(t.error(a)),!1}async function Rve({selfPath:t,pluginConfiguration:e}){return await Je.find(Ae.toPortablePath(process.cwd()),e,{strict:!1,usePathCheck:t})}function MDt(t,e,{yarnPath:r}){if(!ae.existsSync(r))return t.error(new Error(`The "yarn-path" option has been set, but the specified location doesn't exist (${r}).`)),1;process.on("SIGINT",()=>{});let o={stdio:"inherit",env:{...process.env,YARN_IGNORE_PATH:"1"}};try{(0,kve.execFileSync)(process.execPath,[Ae.fromPortablePath(r),...e],o)}catch(a){return a.status??1}return 0}function UDt(t,e){let r=null,o=e;return e.length>=2&&e[0]==="--cwd"?(r=Ae.toPortablePath(e[1]),o=e.slice(2)):e.length>=1&&e[0].startsWith("--cwd=")?(r=Ae.toPortablePath(e[0].slice(6)),o=e.slice(1)):e[0]==="add"&&e[e.length-2]==="--cwd"&&(r=Ae.toPortablePath(e[e.length-1]),o=e.slice(0,e.length-2)),t.defaultContext.cwd=r!==null?K.resolve(r):K.cwd(),o}function _Dt(t,{configuration:e}){if(!e.get("enableTelemetry")||Qve.isCI||!process.stdout.isTTY)return;Je.telemetry=new sE(e,"puba9cdc10ec5790a2cf4969dd413a47270");let o=/^@yarnpkg\/plugin-(.*)$/;for(let a of e.plugins.keys())oE.has(a.match(o)?.[1]??"")&&Je.telemetry?.reportPluginName(a);t.binaryVersion&&Je.telemetry.reportVersion(t.binaryVersion)}function Tve(t,{configuration:e}){for(let r of e.plugins.values())for(let o of r.commands||[])t.register(o)}async function HDt(t,e,{selfPath:r,pluginConfiguration:o}){if(!ODt(t))return 1;let a=await Rve({selfPath:r,pluginConfiguration:o}),n=a.get("yarnPath"),u=a.get("ignorePath");if(n&&!u)return MDt(t,e,{yarnPath:n});delete process.env.YARN_IGNORE_PATH;let A=UDt(t,e);_Dt(t,{configuration:a}),Tve(t,{configuration:a});let p=t.process(A,t.defaultContext);return p.help||Je.telemetry?.reportCommandName(p.path.join(" ")),await t.run(p,t.defaultContext)}async function qhe({cwd:t=K.cwd(),pluginConfiguration:e=lE()}={}){let r=Fve({cwd:t,pluginConfiguration:e}),o=await Rve({pluginConfiguration:e,selfPath:null});return Tve(r,{configuration:o}),r}async function Nk(t,{cwd:e=K.cwd(),selfPath:r,pluginConfiguration:o}){let a=Fve({cwd:e,pluginConfiguration:o});function n(){Vo.defaultContext.stdout.write(`ERROR: Yarn is terminating due to an unexpected empty event loop. Please report this issue at https://github.com/yarnpkg/berry/issues.`)}process.once("beforeExit",n);try{process.exitCode=42,process.exitCode=await HDt(a,t,{selfPath:r,pluginConfiguration:o})}catch(u){Vo.defaultContext.stdout.write(a.error(u)),process.exitCode=1}finally{process.off("beforeExit",n),await ae.rmtempPromise()}}Nk(process.argv.slice(2),{cwd:K.cwd(),selfPath:Ae.toPortablePath(Ae.resolve(process.argv[1])),pluginConfiguration:lE()});})(); /** @license Copyright (c) 2015, Rebecca Turner Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /** @license Copyright Node.js contributors. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /** @license The MIT License (MIT) Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /** @license Copyright Joyent, Inc. and other Node contributors. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*! Bundled license information: is-number/index.js: (*! * is-number * * Copyright (c) 2014-present, Jon Schlinkert. * Released under the MIT License. *) to-regex-range/index.js: (*! * to-regex-range * * Copyright (c) 2015-present, Jon Schlinkert. * Released under the MIT License. *) fill-range/index.js: (*! * fill-range * * Copyright (c) 2014-present, Jon Schlinkert. * Licensed under the MIT License. *) is-extglob/index.js: (*! * is-extglob * * Copyright (c) 2014-2016, Jon Schlinkert. * Licensed under the MIT License. *) is-glob/index.js: (*! * is-glob * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. *) queue-microtask/index.js: (*! queue-microtask. MIT License. Feross Aboukhadijeh *) run-parallel/index.js: (*! run-parallel. MIT License. Feross Aboukhadijeh *) git-url-parse/lib/index.js: (*! * buildToken * Builds OAuth token prefix (helper function) * * @name buildToken * @function * @param {GitUrl} obj The parsed Git url object. * @return {String} token prefix *) object-assign/index.js: (* object-assign (c) Sindre Sorhus @license MIT *) react/cjs/react.production.min.js: (** @license React v17.0.2 * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. *) scheduler/cjs/scheduler.production.min.js: (** @license React v0.20.2 * scheduler.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. *) react-reconciler/cjs/react-reconciler.production.min.js: (** @license React v0.26.2 * react-reconciler.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. *) is-windows/index.js: (*! * is-windows * * Copyright © 2015-2018, Jon Schlinkert. * Released under the MIT License. *) */ ================================================ FILE: wren-ui/.yarnrc.yml ================================================ nodeLinker: node-modules yarnPath: .yarn/releases/yarn-4.5.3.cjs ================================================ FILE: wren-ui/Dockerfile ================================================ FROM node:18-bookworm-slim AS base # Install required packages RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* # Next.js collects completely anonymous telemetry data about general usage. # Learn more here: https://nextjs.org/telemetry # Uncomment the following line in case you want to disable telemetry during the build. ENV NEXT_TELEMETRY_DISABLED 1 ENV NODE_ENV production WORKDIR /app # Enable corepack to manage yarn versions and set the correct yarn version RUN corepack enable COPY .yarnrc.yml package.json yarn.lock ./ COPY .yarn/releases/yarn-4.5.3.cjs .yarn/releases/yarn-4.5.3.cjs RUN corepack prepare yarn@4.5.3 --activate FROM base AS deps WORKDIR /app # Install dependencies based on the preferred package manager RUN yarn install --immutable RUN yarn add sharp # Rebuild the source code only when needed FROM base AS builder WORKDIR /app COPY --from=deps /app/node_modules ./node_modules COPY public ./public COPY src ./src COPY .eslintrc.json ./ COPY .eslintignore ./ COPY .prettierrc ./ COPY next.config.js ./ COPY tsconfig.json ./ RUN yarn build # Production image, copy all the files and run next FROM base AS runner WORKDIR /app COPY --from=builder /app/public ./public # Set the correct permission for prerender cache RUN mkdir .next # Automatically leverage output traces to reduce image size # https://nextjs.org/docs/advanced-features/output-file-tracing COPY --from=builder /app/.next/standalone ./ COPY --from=builder /app/.next/static ./.next/static COPY migrations ./migrations COPY knexfile.js ./knexfile.js # Copy knex and its dependencies from builder to runner COPY --from=builder /app/node_modules/knex ./node_modules/knex COPY --from=builder /app/node_modules/rechoir ./node_modules/rechoir COPY --from=builder /app/node_modules/resolve ./node_modules/resolve COPY --from=builder /app/node_modules/is-core-module ./node_modules/is-core-module COPY --from=builder /app/node_modules/hasown ./node_modules/hasown COPY --from=builder /app/node_modules/function-bind ./node_modules/function-bind COPY --from=builder /app/node_modules/interpret ./node_modules/interpret COPY --from=builder /app/node_modules/resolve-from ./node_modules/resolve-from COPY --from=builder /app/node_modules/tildify ./node_modules/tildify COPY --from=builder /app/node_modules/getopts ./node_modules/getopts COPY --from=builder /app/node_modules/escalade/sync ./node_modules/escalade/sync COPY --from=builder /app/node_modules/.yarn-state.yml ./node_modules/.yarn-state.yml EXPOSE 3000 ENV PORT 3000 # server.js is created by next build from the standalone output # https://nextjs.org/docs/pages/api-reference/next-config-js/output CMD yarn knex migrate:latest && HOSTNAME="0.0.0.0" node server.js ================================================ FILE: wren-ui/README.md ================================================ This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). ## Start wren-ui from source code Step 1. Make sure your node version is 18 ```bash node -v ``` Step 2. Install dependencies: ```bash yarn ``` Step 3(Optional). Switching database Wren-ui uses SQLite as our default database. To use Postgres as the database of wren-ui, you need to set the two environment variable below. ```bash # windows SET DB_TYPE=pg SET PG_URL=postgres://user:password@localhost:5432/dbname # linux or mac export DB_TYPE=pg export PG_URL=postgres://user:password@localhost:5432/dbname ``` - `PG_URL` is the connection string of your postgres database. To switch back to using SQLite, you can reassign the `DB_TYPE` to `sqlite`. ``` # windows SET DB_TYPE=sqlite SET SQLITE_FILE={your_sqlite_file_path} # default is ./db.sqlite3 # linux or mac export DB_TYPE=sqlite export SQLITE_FILE={your_sqlite_file_path} ``` Step 4. Run migrations: ```bash yarn migrate # or npm run migrate ``` Step 5. Run the development server: ```bash # Execute this if you start wren-engine and ibis-server via docker # Linux or MacOS export OTHER_SERVICE_USING_DOCKER=true export EXPERIMENTAL_ENGINE_RUST_VERSION=false # set to true if you want to use the experimental Rust version of the Wren Engine # Windows SET OTHER_SERVICE_USING_DOCKER=true SET EXPERIMENTAL_ENGINE_RUST_VERSION=false # set to true if you want to use the experimental Rust version of the Wren Engine # Run the development server yarn dev # or npm run dev ``` Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. ## Development wren-ui module on local There are many modules in Wren AI, to develop wren-ui, you can start other modules(services) via docker-compose. In the [Start wren-ui from source code](#Start-wren-ui-from-source-code) section, you've know how to start wren-ui from the source code to develop. To start other modules via docker-compose, you can follow the steps below. Step 1. Prepare you .env file In the WrenAI/docker folder, you can find the .env.example file. You can copy this file to .env.local file. ```bash # assume current directory is wren-ui cd ../docker cp .env.example .env.local ``` Step 2. Modify your .env.local file You need to fill the `OPENAI_API_KEY` with your OPENAI api key before starting. You can also change the `WREN_ENGINE_VERSION`, `WREN_AI_SERVICE_VERSION`, `IBIS_SERVER_VERSION` to the version you want to use. Step 3. Start the services via docker-compose ```bash # current directory is WrenAI/docker docker-compose -f docker-compose-dev.yaml --env-file .env.example up # you can add a -d flag to run the services in the background docker-compose -f docker-compose-dev.yaml --env-file .env.example up -d # then stop the services via docker-compose -f docker-compose-dev.yaml --env-file .env.example down ``` Step 4. Start wren-ui from source code refer to [Start wren-ui from source code](#Start-wren-ui-from-source-code) section to start wren-ui from source code. Step 5. (Optional) Develop other modules along with wren-ui As mentioned above, you can use docker-compose to start other modules. The same applies when developing other modules. From the perspective of wren-ui, if you want to develop other modules at the same time, you can stop the container then spin up the module from the source code. eg: If you want to develop ai-service module, you can stop the ai-service container then start the ai-service from the source code. ```yaml # docker/docker-compose-dev.yaml wren-engine: image: ghcr.io/canner/wren-engine:${WREN_ENGINE_VERSION} pull_policy: always platform: ${PLATFORM} expose: - ${WREN_ENGINE_SQL_PORT} ports: - ${WREN_ENGINE_PORT}:${WREN_ENGINE_PORT} volumes: - data:/usr/src/app/etc networks: - wren depends_on: - bootstrap ... # comment out the ai-service service wren-ai-service: image: ghcr.io/canner/wren-ai-service:${WREN_AI_SERVICE_VERSION} pull_policy: always platform: ${PLATFORM} ports: - ${AI_SERVICE_FORWARD_PORT}:${WREN_AI_SERVICE_PORT} environment: WREN_UI_ENDPOINT: http://host.docker.internal:${WREN_UI_PORT} # sometimes the console won't show print messages, # using PYTHONUNBUFFERED: 1 can fix this PYTHONUNBUFFERED: 1 CONFIG_PATH: /app/data/config.yaml env_file: - ${PROJECT_DIR}/.env volumes: - ${PROJECT_DIR}/config.yaml:/app/data/config.yaml networks: - wren depends_on: - qdrant ibis-server: image: ghcr.io/canner/wren-engine-ibis:${IBIS_SERVER_VERSION} ... ``` Then refer to the README.md or CONTRIBUTION.md file the module for starting the module from the source code. eg: refer to the [ai-service README](https://github.com/Canner/WrenAI/blob/main/wren-ai-service/README.md#start-the-service-for-development) to start the ai-service from the source code. ## FAQ ### Can I have multiple project at the same time in Wren AI? We currently do not support multiple projects in Wren AI. You can only have one project at a time. But there is a workaround for this. Since Wren Engine is stateless and we store your semantic model in the database(Sqlite or Postgres), you can switch between projects by switching the database and make sure you deploying after server started. > Tip: Define the `DB_TYPE` and `SQLITE_FILE` or `PG_URL` variable to specify which database you intend to use. eg: ```bash # start your first project using default database(sqlite by defulat) yarn migrate yarn dev # ... after onboarding and lots of hard work, you want to switch to another project # stop the server # set another sqlite file export SQLITE_FILE=./new_project.sqlite yarn migrate yarn dev # In the Browser, ... after another onboarding process and hard work # you can switch back to the first project by setting the first sqlite file export SQLITE_FILE=./first_project.sqlite yarn dev # no need to do migration again # in the modeling page, click the deploy button to deploy the project to the wren-ai-service. # your Wren AI is ready to answer your question. ``` ## Learn More To learn more about Next.js, take a look at the following resources: - [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. - [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! ================================================ FILE: wren-ui/codegen.yaml ================================================ overwrite: true schema: [ 'http://localhost:3000/api/graphql' ] generates: ./src/apollo/client/graphql/__types__.ts: plugins: - typescript - typescript-operations - typescript-react-apollo config: namingConvention: enumValues: keep ./: preset: near-operation-file presetConfig: extension: .generated.ts baseTypesPath: ./src/apollo/client/graphql/__types__.ts documents: ./src/apollo/client/graphql/!(*.generated).{ts,tsx} plugins: - typescript-operations - typescript-react-apollo ================================================ FILE: wren-ui/e2e/README.md ================================================ ## How to run e2e test locally 1. Make sure you have start all Wren AI services. ([How to start](https://github.com/Canner/WrenAI/blob/main/docker/README.md#how-to-start)) 2. Create a `e2e.config.json` file under `wren-ui/e2e` folder and replace all data sources needed values in `./config.ts`. ```ts // Replace the default test config with your own e2e.config.json const defaultTestConfig = { bigQuery: { projectId: 'wrenai', datasetId: 'wrenai.tpch_sf1', // The credential file should be under "wren-ui" folder // For example: .tmp/credential.json credentialPath: 'bigquery-credential-path', }, duckDb: { sqlCsvPath: 'https://duckdb.org/data/flights.csv', }, postgreSql: { host: 'postgresql-host', port: '5432', username: 'postgresql-username', password: 'postgresql-password', database: 'postgresql-database', ssl: false, }, mysql: { host: 'mysql-host', port: '3306', username: 'mysql-username', password: 'mysql-password', database: 'mysql-database', }, sqlServer: { host: 'sqlServer-host', port: '1433', username: 'sqlServer-username', password: 'sqlServer-password', database: 'sqlServer-database', }, trino: { host: 'trino-host', port: '8081', catalog: 'trino-catalog', schema: 'trino-schema', username: 'trino-username', password: 'trino-password', }, }; ``` 3. Build UI before starting e2e server ```bash yarn build ``` > Ensure port 3000 is available for E2E testing. The AI service needs WREN_UI_ENDPOINT to connect to this port for accurate and reliable test results. 4. Run test ```bash yarn test:e2e ``` Run test with browser open ```bash yarn test:e2e --headed ``` ## How to develop - Write test with interactive UI mode ```bash yarn test:e2e --ui ``` - Write test with debug mode ```bash yarn test:e2e --debug ``` - Generate test scripts ``` npx playwright codegen http://localhost:3000 ``` ================================================ FILE: wren-ui/e2e/commonTests/home.ts ================================================ import { Page, expect } from '@playwright/test'; import * as helper from '../helper'; import { AskingTask, AskingTaskStatus, } from '@/apollo/client/graphql/__types__'; import * as modelingHelper from './modeling'; export const checkAskingProcess = async (page: Page, question: string) => { // check process state await expect(page.getByTestId('prompt__result')).toBeVisible(); await expect(page.getByRole('button', { name: 'Stop' })).toBeVisible(); await expect(page.getByPlaceholder('Ask to explore your data')).toHaveValue( question, ); await expect(page.getByRole('button', { name: 'Ask' })).toBeDisabled(); }; export const waitingForAskingTask = async (page: Page) => { await helper.waitForGraphQLResponse({ page }, 'askingTask', (data) => [AskingTaskStatus.FAILED, AskingTaskStatus.FINISHED].includes(data?.status), ); }; export const checkCandidatesResult = async (page: Page) => { await expect( page.locator('div').filter({ hasText: 'result(s) found' }).last(), ).toBeVisible(); await expect(page.getByText('result(s) found')).toBeVisible(); }; export const getFirstCandidatesResultSummary = async (page: Page) => { const candidatesResultHandle = await page.evaluateHandle( (document) => { const nodes: any = Array.from( document.querySelectorAll('div[role="row"]'), ); const node = nodes[nodes.length - 1]; const firstResult = node.firstElementChild.lastElementChild; return firstResult.childNodes[1].innerText; }, await page.evaluateHandle(() => document), ); const firstResultSummary = await candidatesResultHandle.jsonValue(); await candidatesResultHandle.dispose(); return firstResultSummary; }; export const checkThreadResponseSkeletonLoading = async (page: Page) => { await expect(page.locator('.ant-skeleton-content').last()).toBeVisible({ timeout: 60000, }); await expect(page.locator('.ant-skeleton-content').last()).toBeHidden({ timeout: 60000, }); }; const checkThreadResponseBreakdownContent = async (page: Page) => { // switch to the View SQL tab await page .locator('div') .filter({ hasText: /^View SQL$/ }) .last() .click(); // View SQL tab content await expect( page.getByLabel('View SQL').locator('.ant-skeleton-content').last(), ).toBeVisible(); await expect( page.getByLabel('View SQL').locator('.ant-skeleton-content').last(), ).toBeHidden({ timeout: 60000 }); // check show preview data table as default open await expect( page.getByLabel('View SQL').locator('.ant-table').last(), ).toBeVisible(); await expect(page.getByText('Showing up to 500 rows').last()).toBeVisible(); // check up-circle icon with Collapse button await expect( page.getByLabel('View SQL').getByLabel('up-circle').locator('svg').last(), ).toBeVisible(); await expect( page .getByLabel('View SQL') .getByRole('button', { name: 'Collapse' }) .last(), ).toBeVisible(); // click View Full SQL button await page .getByLabel('View SQL') .getByRole('button', { name: 'View Full SQL' }) .last() .click(); await expect( page.getByLabel('View SQL').locator('.ace_editor'), ).toBeVisible(); // check collapse and copy button await expect( page.getByLabel('View SQL').getByLabel('up-circle').locator('svg').last(), ).toBeVisible(); await expect( page .getByLabel('View SQL') .getByRole('button', { name: 'Collapse' }) .last(), ).toBeVisible(); await expect( page.getByLabel('View SQL').getByLabel('copy').locator('svg'), ).toBeVisible(); await expect( page.getByLabel('View SQL').getByRole('button', { name: 'Copy' }), ).toBeVisible(); }; export const askSuggestionQuestionTest = async ({ page, suggestedQuestion, }) => { await page.goto('/home'); await expect(page).toHaveURL('/home', { timeout: 60000 }); await page.getByText(suggestedQuestion).click(); // check asking process state and wait for asking task to finish await checkAskingProcess(page, suggestedQuestion); await waitingForAskingTask(page); await checkThreadResponseSkeletonLoading(page); // check question block await expect(page.getByLabel('message').locator('svg')).toBeVisible(); await expect( page.getByRole('heading', { name: suggestedQuestion }), ).toBeVisible(); // check answer result basic UI elements await expect( page.locator('#rc-tabs-0-tab-answer').getByText('Answer'), ).toBeVisible(); await expect( page.locator('#rc-tabs-0-tab-view-sql').getByText('View SQL'), ).toBeVisible(); // check save icon button await expect(page.getByLabel('save').locator('svg')).toBeVisible(); await expect( page.getByRole('button', { name: 'Save as View' }), ).toBeVisible(); // Answer tab content await expect(page.getByLabel('Answer').locator('div').first()).toBeVisible(); await checkThreadResponseBreakdownContent(page); }; export const followUpQuestionTest = async ({ page, question }) => { await page.goto('/home'); await expect(page).toHaveURL('/home', { timeout: 60000 }); // click existing thread await page.locator('.adm-treeTitle__title').first().click(); await expect(page).toHaveURL(/.*\/home\/\d+/, { timeout: 60000 }); // ask follow up question await page.getByPlaceholder('Ask to explore your data').fill(question); await page.getByRole('button', { name: 'Ask' }).click(); // check asking process state and wait for asking task to finish await checkAskingProcess(page, question); await waitingForAskingTask(page); await checkThreadResponseSkeletonLoading(page); // check question block await expect(page.getByLabel('message').locator('svg').last()).toBeVisible(); await expect(page.getByRole('heading', { name: question })).toBeVisible(); await checkThreadResponseBreakdownContent(page); }; export const saveAsView = async ( { page, baseURL }: { page: Page; baseURL: string }, { question, viewName }: { question: string; viewName: string }, ) => { await page.goto('/home'); await expect(page).toHaveURL('/home', { timeout: 60000 }); await page.getByPlaceholder('Ask to explore your data').fill(question); await page.getByRole('button', { name: 'Ask' }).click(); // check asking process state and wait for asking task to finish await checkAskingProcess(page, question); await waitingForAskingTask(page); await checkThreadResponseSkeletonLoading(page); // click save as view button await page.getByRole('button', { name: 'Save as View' }).click(); // check save as view modal await expect(page.locator('.ant-modal-mask')).toBeVisible(); await expect(page.locator('div.ant-modal')).toBeVisible(); await expect( page.locator('div.ant-modal-title').filter({ hasText: 'Save as View' }), ).toBeVisible(); await expect( page.getByLabel('Save as View').getByLabel('Close', { exact: true }), ).toBeVisible(); await expect( page.getByText( 'After saving, make sure you go to "Modeling Page" to deploy all saved views.', ), ).toBeVisible(); // save as View process await page.getByLabel('Name').click(); await page.getByLabel('Name').fill(viewName); await page.getByRole('button', { name: 'Save', exact: true }).click(); // check save as view success await expect(page.getByText('Successfully created view.')).toBeVisible(); // go to modeling page await page.getByRole('button', { name: 'Modeling' }).click(); await expect(page).toHaveURL('/modeling', { timeout: 60000 }); // deploy MDL with view await expect(page.getByRole('button', { name: 'Deploy' })).toBeEnabled(); await modelingHelper.executeDeploy({ page, baseURL }); await page.getByRole('button', { name: 'Home', exact: true }).click(); await expect(page).toHaveURL('/home', { timeout: 60000 }); // ask the saved view question await page.getByPlaceholder('Ask to explore your data').fill(question); await page.getByRole('button', { name: 'Ask' }).click(); // check asking process state and wait for asking task to finish await checkAskingProcess(page, question); await waitingForAskingTask(page); await checkThreadResponseSkeletonLoading(page); // check offer view info for thread response UI await expect(page.getByText('Generated from saved view')).toBeVisible(); await expect(page.getByRole('link', { name: viewName })).toBeVisible(); // click the view name link will open a new tab and go to the view metadata of the modeling page const newWebPagePromise = page.waitForEvent('popup'); await page.getByRole('link', { name: viewName }).click(); const modelingPage = await newWebPagePromise; // check view metadata await expect( modelingPage .locator('div.ant-drawer-title') .filter({ hasText: new RegExp(`^${viewName}$`) }), ).toBeVisible(); await expect( modelingPage.getByTestId('metadata__name').getByText(viewName), ).toBeVisible(); await modelingPage .locator('div.ant-drawer') .getByLabel('Close', { exact: true }) .click(); // check view node in diagram await expect( modelingPage.getByRole('complementary').getByText(viewName), ).toBeVisible(); await modelingPage.getByRole('complementary').getByText(viewName).click(); await expect( modelingPage.getByTestId(`diagram__view-node__${viewName}`), ).toBeVisible(); }; ================================================ FILE: wren-ui/e2e/commonTests/modeling.ts ================================================ import { Page, expect } from '@playwright/test'; interface Relationship { fromFieldModelDisplayName: string; fromFieldColumnDisplayName: string; toFieldModelDisplayName: string; toFieldColumnDisplayName: string; relationshipType: string; } export const checkDeploySynced = async ({ page }) => { await page.goto('/modeling'); await expect(page).toHaveURL('/modeling', { timeout: 60000 }); await expect(page.getByLabel('check-circle').locator('svg')).toBeVisible(); await expect(page.getByText('Synced')).toBeVisible(); await expect(page.getByRole('button', { name: 'Deploy' })).toBeDisabled(); }; export const checkDeployUndeployedChanges = async ({ page, baseURL }) => { if (page.url() !== `${baseURL}/modeling`) { await page.goto('/modeling'); await expect(page).toHaveURL('/modeling', { timeout: 60000 }); } await expect(page.getByLabel('warning').locator('svg')).toBeVisible(); await expect(page.getByText('Undeployed changes')).toBeVisible(); await expect(page.getByRole('button', { name: 'Deploy' })).toBeVisible(); await expect(page.getByRole('button', { name: 'Deploy' })).toBeEnabled(); }; export const executeDeploy = async ({ page, baseURL }) => { if (page.url() !== `${baseURL}/modeling`) { await page.goto('/modeling'); await expect(page).toHaveURL('/modeling', { timeout: 60000 }); } await page.getByRole('button', { name: 'Deploy' }).click(); await expect( page.getByRole('img', { name: 'loading' }).locator('svg'), ).toBeVisible(); await expect(page.getByText('Deploying...')).toBeVisible(); await expect(page.getByText('Deploying...')).toBeVisible({ visible: false, timeout: 60000, }); }; export const executeModelCRUD = async ( page: Page, { modelDisplayName, modelReferenceName, primaryKeyColumn, }: { modelDisplayName: string; modelReferenceName: string; primaryKeyColumn: string; }, ) => { await page.goto('/modeling'); await expect(page).toHaveURL('/modeling', { timeout: 60000 }); // click the model of sidebar await page .getByRole('complementary') .getByText(modelDisplayName, { exact: true }) .click(); // delete the model await page .locator('div') .filter({ hasText: new RegExp(`^${modelDisplayName}$`) }) .getByRole('button') .click(); await page.getByText('Delete', { exact: true }).click(); await expect( page .getByRole('dialog') .locator('div') .filter({ hasText: 'Are you sure you want to delete this model?' }) .nth(1), ).toBeVisible(); await page.getByRole('button', { name: 'Delete' }).click(); // check model deleted await expect(page.getByText('Successfully deleted model.')).toBeVisible(); await expect( page .getByRole('complementary') .getByText(modelDisplayName, { exact: true }), ).toBeHidden(); // add the model back await page.getByTestId('add-model').click(); // chkeck Model drawer open await expect(page.locator('.ant-drawer-mask')).toBeVisible(); await expect( page .locator('div') .filter({ hasText: /^Create a data model$/ }) .first(), ).toBeVisible(); // select resource table and some columns await page.getByLabel('Select a table').click(); await page .getByTitle(modelReferenceName, { exact: true }) .locator('div') .click(); await page .getByRole('row', { name: new RegExp(`^${primaryKeyColumn} .*`) }) .getByLabel('') .check(); await page.getByRole('button', { name: 'right' }).click(); // set primary key await page.getByLabel('Select primary key').click(); await page .locator('form') .getByTitle(primaryKeyColumn, { exact: true }) .locator('div') .click(); await page.getByRole('button', { name: 'Submit' }).click(); // check model added await expect(page.getByText('Successfully created model.')).toBeVisible(); await expect( page .getByRole('complementary') .getByText(modelReferenceName, { exact: true }), ).toBeVisible(); await expect( page.getByTestId(`diagram__model-node__${modelReferenceName}`), ).toBeVisible(); // update columns await page .locator('div') .filter({ hasText: new RegExp(`^${modelReferenceName}$`) }) .getByRole('button') .click(); await page.getByText('Update Columns').click(); // select all columns await page.getByLabel('', { exact: true }).first().check(); await page.getByRole('button', { name: 'right' }).click(); await page.getByRole('button', { name: 'Submit' }).click(); await expect(page.getByText('Successfully updated model.')).toBeVisible(); }; export const addRelationship = async ( page: Page, { fromFieldModelDisplayName, fromFieldColumnDisplayName, toFieldModelDisplayName, toFieldColumnDisplayName, relationshipType, }: Relationship, ) => { // add relationship await page .getByTestId(`diagram__model-node__${fromFieldModelDisplayName}`) .locator('div') .filter({ hasText: /^Relationships$/ }) .getByRole('button') .first() .click(); // check relationship modal open await expect( page .locator('div') .filter({ hasText: 'Add relationship', }) .nth(2), ).toBeVisible(); await expect(page.getByText('Add relationship')).toBeVisible(); // set from field await page.getByTestId('common__fields-select').first().click(); await page .getByTestId('common__fields__select-option') .filter({ hasText: fromFieldColumnDisplayName }) .click(); // set to field await page.getByTestId('common__models-select').last().click(); await page .getByTestId('common__models__select-option') .filter({ hasText: toFieldModelDisplayName }) .click(); await page.getByTestId('common__fields-select').last().click(); await page .getByTestId('common__fields__select-option') .filter({ hasText: toFieldColumnDisplayName }) .last() .click(); // set relationship type await page.getByTestId('relationship-form__type-select').click(); await page.getByTitle(relationshipType).locator('div').click(); await page.getByRole('button', { name: 'Submit' }).click(); await expect( page.getByText('Successfully created relationship.'), ).toBeVisible(); await expect( page .getByTestId(`diagram__model-node__${fromFieldModelDisplayName}`) .getByTitle(toFieldModelDisplayName, { exact: true }), ).toBeVisible(); }; export const executeRelationshipCRUD = async ( page: Page, { fromFieldModelDisplayName, fromFieldColumnDisplayName, toFieldModelDisplayName, toFieldColumnDisplayName, relationshipType, }: Relationship, ) => { await page.goto('/modeling'); await expect(page).toHaveURL('/modeling', { timeout: 60000 }); await page .getByRole('complementary') .getByText(fromFieldModelDisplayName, { exact: true }) .click(); // delete relationship await page .getByTestId(`diagram__model-node__${fromFieldModelDisplayName}`) .getByRole('button', { name: 'more' }) .nth(1) .click(); await page.getByText('Delete', { exact: true }).click(); // check delete relationship modal open await expect( page .getByRole('dialog') .locator('div') .filter({ hasText: 'Are you sure you want to delete this relationship?', }) .nth(1), ).toBeVisible(); await expect( page.getByText('Are you sure you want to delete this relationship?'), ).toBeVisible(); await expect(page.getByRole('button', { name: 'Cancel' })).toBeVisible(); await expect(page.getByRole('button', { name: 'Delete' })).toBeVisible(); await page.getByRole('button', { name: 'Delete' }).click(); // check relationship deleted await expect( page.getByText('Successfully deleted relationship.'), ).toBeVisible(); await expect( page .getByTestId(`diagram__model-node__${fromFieldModelDisplayName}`) .getByTitle(toFieldModelDisplayName, { exact: true }), ).toBeHidden(); // add relationship await addRelationship(page, { fromFieldModelDisplayName, fromFieldColumnDisplayName, toFieldModelDisplayName, toFieldColumnDisplayName, relationshipType: 'One-to-one', }); // update relationship await page .getByRole('complementary') .getByText(fromFieldModelDisplayName, { exact: true }) .click(); await page .getByTestId(`diagram__model-node__${fromFieldModelDisplayName}`) .getByRole('button', { name: 'more' }) .nth(1) .click(); await page.getByText('Edit').click(); await expect( page .locator('div') .filter({ hasText: 'Update relationship', }) .nth(2), ).toBeVisible(); await expect(page.getByText('Update relationship')).toBeVisible(); await page.getByTestId('relationship-form__type-select').click(); await page.getByTitle(relationshipType).locator('div').click(); await page.getByRole('button', { name: 'Submit' }).click(); // check relationship updated await expect( page.getByText('Successfully updated relationship.'), ).toBeVisible(); }; export const updateModelMetadata = async ( page: Page, { modelDisplayName, modelDescription, newModelDisplayName, newModelDescription, }: { modelDisplayName: string; modelDescription: string; newModelDisplayName: string; newModelDescription: string; }, ) => { await page.goto('/modeling'); await expect(page).toHaveURL('/modeling', { timeout: 60000 }); await page .getByRole('complementary') .getByText(modelDisplayName, { exact: true }) .click(); // click node to open metadata drawer await page.getByTestId(`diagram__model-node__${modelDisplayName}`).click(); const modelDescriptionString = modelDescription || '-'; const newModelDescriptionString = newModelDescription || '-'; // check metadata drawer info await expect(page.locator('.ant-drawer-mask')).toBeVisible(); await expect(page.getByLabel('Close', { exact: true })).toBeVisible(); await expect( page .locator('div.ant-drawer-title') .filter({ hasText: new RegExp(`^${modelDisplayName}$`) }), ).toBeVisible(); await expect( page.getByRole('cell', { name: 'Name' }).locator('div'), ).toHaveText(modelDisplayName); await expect(page.getByTestId('metadata__alias').locator('div')).toHaveText( modelDisplayName, ); await expect( page.getByTestId('metadata__description').locator('div'), ).toHaveText(modelDescriptionString); // click edit metadata button await page.getByRole('button', { name: 'Edit' }).click(); // check edit metadata modal await expect(page.locator('.ant-modal-mask')).toBeVisible(); await expect(page.locator('div.ant-modal')).toBeVisible(); await expect( page.locator('div.ant-modal-title').filter({ hasText: 'Edit metadata' }), ).toBeVisible(); await expect( page.getByLabel('Edit metadata').getByLabel('Close', { exact: true }), ).toBeVisible(); // update metadata process // update alias await page .getByTestId('edit-metadata__alias') .getByText(modelDisplayName, { exact: true }) .click(); await page.locator('#displayName').press('ControlOrMeta+a'); await page.locator('#displayName').fill(newModelDisplayName); // update description await page .getByTestId('edit-metadata__description') .getByText(modelDescriptionString, { exact: true }) .click(); await page.locator('#description').press('ControlOrMeta+a'); await page.locator('#description').fill(newModelDescription); await expect(page.getByRole('button', { name: 'Cancel' })).toBeVisible(); await expect(page.getByRole('button', { name: 'Submit' })).toBeVisible(); await page.getByRole('button', { name: 'Submit' }).click(); // check metadata for metadata drawer await expect( page.getByText('Successfully updated model metadata.'), ).toBeVisible(); await expect( page .locator('div.ant-drawer-title') .filter({ hasText: new RegExp(`^${newModelDisplayName}$`) }), ).toBeVisible(); await expect( page.getByRole('cell', { name: 'Name' }).locator('div').first(), ).toHaveText(modelDisplayName); await expect( page.getByTestId('metadata__name').locator('div').first(), ).toHaveText(modelDisplayName); await expect(page.getByTestId('metadata__alias').locator('div')).toHaveText( newModelDisplayName, ); await expect( page.getByTestId('metadata__description').locator('div'), ).toHaveText(newModelDescriptionString); // close metadata drawer await page .locator('div.ant-drawer') .getByLabel('Close', { exact: true }) .click(); // check info for modeling page await expect( page.getByRole('complementary').getByText(newModelDisplayName), ).toBeVisible(); await page.getByRole('complementary').getByText(newModelDisplayName).click(); await expect( page.getByTestId(`diagram__model-node__${newModelDisplayName}`), ).toBeVisible(); }; export const updateViewMetadata = async ( { page, baseURL }: { page: Page; baseURL: string }, { viewDisplayName, viewDescription, newViewDisplayName, newViewDescription, }: { viewDisplayName: string; viewDescription: string; newViewDisplayName: string; newViewDescription: string; }, ) => { await page.goto('/modeling'); await expect(page).toHaveURL('/modeling', { timeout: 60000 }); // will show '-' if viewDescription is empty string const viewDescriptionString = viewDescription || '-'; const newViewDescriptionString = newViewDescription || '-'; await page .getByRole('complementary') .getByText(viewDisplayName, { exact: true }) .click(); // click node to open metadata drawer await page.getByTestId(`diagram__view-node__${viewDisplayName}`).click(); // check metadata drawer info await expect(page.locator('.ant-drawer-mask')).toBeVisible(); await expect(page.getByLabel('Close', { exact: true })).toBeVisible(); await expect( page .locator('div.ant-drawer-title') .filter({ hasText: new RegExp(`^${viewDisplayName}$`) }), ).toBeVisible(); await expect(page.getByRole('button', { name: 'Edit' })).toBeVisible(); await expect( page.getByTestId('metadata__name').getByText(viewDisplayName), ).toBeVisible(); await expect( page.getByTestId('metadata__description').getByText(viewDescriptionString), ).toBeVisible(); // click edit metadata button await page.getByRole('button', { name: 'Edit' }).click(); // check edit metadata modal await expect(page.locator('.ant-modal-mask')).toBeVisible(); await expect(page.locator('div.ant-modal')).toBeVisible(); await expect( page.locator('div.ant-modal-title').filter({ hasText: 'Edit metadata' }), ).toBeVisible(); await expect( page.getByLabel('Edit metadata').getByLabel('Close', { exact: true }), ).toBeVisible(); // update metadata process // update name (view alias name) await page .getByTestId('edit-metadata__name') .getByText(viewDisplayName, { exact: true }) .click(); await page.locator('#displayName').fill(newViewDisplayName); // update description await page .getByTestId('edit-metadata__description') .getByText(viewDescriptionString, { exact: true }) .click(); await page.locator('#description').fill(newViewDescription); await expect(page.getByRole('button', { name: 'Cancel' })).toBeVisible(); await expect(page.getByRole('button', { name: 'Submit' })).toBeVisible(); await page.getByRole('button', { name: 'Submit' }).click(); // check metadata for metadata drawer await expect( page.getByText('Successfully updated view metadata.'), ).toBeVisible(); await expect( page .locator('div.ant-drawer-title') .filter({ hasText: new RegExp(`^${newViewDisplayName}$`) }), ).toBeVisible(); await expect(page.getByTestId('metadata__name').locator('div')).toHaveText( newViewDisplayName, ); await expect( page.getByTestId('metadata__description').locator('div'), ).toHaveText(newViewDescriptionString); // close metadata drawer await page .locator('div.ant-drawer') .getByLabel('Close', { exact: true }) .click(); // check info for modeling page await expect( page.getByRole('complementary').getByText(newViewDisplayName), ).toBeVisible(); await page.getByRole('complementary').getByText(newViewDisplayName).click(); await expect( page.getByTestId(`diagram__view-node__${newViewDisplayName}`), ).toBeVisible(); await checkDeployUndeployedChanges({ page, baseURL }); }; export const addCalculatedField = async ( page: Page, { calculatedFieldName, expression, modelDisplayName, toFieldModelDisplayName, toFieldColumnDisplayName, }: { calculatedFieldName: string; expression: string; modelDisplayName: string; toFieldModelDisplayName: string; toFieldColumnDisplayName: string; }, ) => { // click the model of sidebar to zoom in await page .getByRole('complementary') .getByText(modelDisplayName, { exact: true }) .click(); // add calculated field await page .getByTestId(`diagram__model-node__${modelDisplayName}`) .locator('div') .filter({ hasText: /^Calculated Fields$/ }) .getByRole('button') .first() .click(); await expect(page.locator('.ant-modal-mask')).toBeVisible(); await expect(page.locator('div.ant-modal')).toBeVisible(); await expect( page .locator('div.ant-modal-title') .filter({ hasText: 'Add calculated field' }), ).toBeVisible(); await expect( page .getByLabel('Add calculated field') .getByLabel('Close', { exact: true }), ).toBeVisible(); await page.getByLabel('Name').click(); await page.getByLabel('Name').fill(calculatedFieldName); await page.getByTestId('common__descriptive-select').click(); await page.getByTitle(expression).locator('div').click(); await expect(page.getByTestId('common__lineage')).toBeVisible(); await expect( page .getByTestId('common__lineage-field-block') .getByText(modelDisplayName, { exact: true }), ).toBeVisible(); await page.getByTestId('common__lineage-fields-select').click(); // for skip disabled item await page.getByTestId('common__lineage-fields-select').press('ArrowDown'); await page .getByTestId('common__fields__select-option') .filter({ hasText: toFieldModelDisplayName }) .scrollIntoViewIfNeeded(); await page .getByTestId('common__fields__select-option') .filter({ hasText: toFieldModelDisplayName }) .click(); await expect( page .getByTestId('common__lineage-field-block') .getByText(toFieldModelDisplayName, { exact: true }), ).toHaveCount(2); await expect(page.getByText('Please select a field.')).toBeVisible(); await page.getByTestId('common__lineage-fields-select').last().click(); await page .getByTestId('common__fields__select-option') .filter({ hasText: toFieldColumnDisplayName }) .scrollIntoViewIfNeeded(); await page .getByTestId('common__fields__select-option') .filter({ hasText: toFieldColumnDisplayName }) .click(); await page.getByRole('button', { name: 'Save' }).click(); await expect( page.getByText('Successfully created calculated field.'), ).toBeVisible(); }; export const deleteCalculatedField = async ( page: Page, modelDisplayName: string, ) => { // delete calculated field await page .getByRole('complementary') .getByText(modelDisplayName, { exact: true }) .click(); await page .getByTestId(`diagram__model-node__${modelDisplayName}`) .getByRole('button', { name: 'more' }) .nth(1) .click(); await page.getByText('Delete', { exact: true }).click(); await page.getByRole('button', { name: 'Delete' }).click(); await expect( page.getByText('Successfully deleted calculated field.'), ).toBeVisible(); }; ================================================ FILE: wren-ui/e2e/commonTests/onboarding.ts ================================================ import { expect } from '@playwright/test'; export const setupModels = async ({ page }) => { await page.goto('/setup/models'); // select all models await page.locator('th').first().click(); await page.getByRole('button', { name: 'Next' }).click(); await expect(page).toHaveURL('/setup/relationships', { timeout: 60000 }); }; export const saveRecommendedRelationships = async ({ page }) => { await page.goto('/setup/relationships'); await page.getByRole('button', { name: 'Finish' }).click(); await expect(page).toHaveURL('/modeling', { timeout: 60000 }); }; ================================================ FILE: wren-ui/e2e/config.ts ================================================ import fs from 'fs'; import path from 'path'; import { merge } from 'lodash'; export const testDbConfig = { client: 'better-sqlite3', connection: 'testdb.sqlite3', useNullAsDefault: true, }; // Replace the default test config with your own e2e.config.json const defaultTestConfig = { bigQuery: { projectId: 'wrenai', datasetId: 'wrenai.tpch_sf1', // The credential file should be under "wren-ui" folder credentialPath: 'bigquery-credential-path', }, duckDb: { sqlCsvPath: 'https://duckdb.org/data/flights.csv', }, postgreSql: { host: 'postgresql-host', port: '5432', username: 'postgresql-username', password: 'postgresql-password', database: 'postgresql-database', ssl: false, }, mysql: { host: 'mysql-host', port: '3306', username: 'mysql-username', password: 'mysql-password', database: 'mysql-database', }, sqlServer: { host: 'sqlserver-host', port: '1433', username: 'sqlserver-username', password: 'sqlserver-password', database: 'sqlserver-database', }, trino: { host: 'trino-host', port: '8081', catalog: 'trino-catalog', schema: 'trino-schema', username: 'trino-username', password: 'trino-password', }, clickhouse: { host: 'clickhouse-host', port: '8443', username: 'clickhouse-username', password: 'clickhouse-password', database: 'clickhouse-database', ssl: false, }, snowflake: { username: 'snowflake-username', password: 'snowflake-password', account: 'snowflake-account', database: 'snowflake-database', schema: 'snowflake-schema', }, }; let userTestConfig = {}; try { userTestConfig = JSON.parse( fs.readFileSync(path.resolve(__dirname, 'e2e.config.json'), 'utf8'), ) || {}; } catch (_error: any) { console.log('No e2e config file found.'); } export const getTestConfig = () => { return merge(defaultTestConfig, userTestConfig); }; ================================================ FILE: wren-ui/e2e/global.setup.ts ================================================ import { test as setup } from '@playwright/test'; import * as helper from './helper'; setup('create new database', async () => { console.log('creating new database...'); // Initialize the database await helper.migrateDatabase(); console.log('created successfully.'); }); ================================================ FILE: wren-ui/e2e/global.teardown.ts ================================================ import { test as setup } from '@playwright/test'; import * as helper from './helper'; setup('delete database', async () => { console.log('deleting test database...'); // Delete the database await helper.removeDatabase(); console.log('deleted successfully.'); }); ================================================ FILE: wren-ui/e2e/helper.ts ================================================ import fs from 'fs'; import knex from 'knex'; import { testDbConfig } from './config'; import { Page } from '@playwright/test'; export const migrateDatabase = async () => { const db = knex(testDbConfig); await db.migrate.latest(); }; export const removeDatabase = async () => { const db = knex(testDbConfig); await db.migrate.rollback().then(() => db.destroy()); const isDBFileExist = fs.existsSync(testDbConfig.connection); if (isDBFileExist) { fs.unlinkSync(testDbConfig.connection); } }; export const resetDatabase = async () => { const db = knex(testDbConfig); await db.table('project').del(); await db.table('model').del(); await db.table('model_column').del(); await db.table('model_nested_column').del(); await db.table('relation').del(); await db.table('thread').del(); await db.table('thread_response').del(); await db.table('view').del(); // insert learning table data to skip guide await db.table('learning').insert({ paths: JSON.stringify(['DATA_MODELING_GUIDE', 'SWITCH_PROJECT_LANGUAGE']), }); }; export const waitForGraphQLResponse = async ( { page }: { page: Page }, queryKey: string, validateResponseData = (data: any) => data !== undefined, ) => { await page.waitForResponse( async (response) => { try { const responseBody = await response.json(); const responseData = responseBody?.data?.[queryKey]; return ( response.url().includes('/api/graphql') && response.status() === 200 && responseBody && validateResponseData(responseData) ); } catch (error) { console.error('Error fetching response body:', error); } }, { timeout: 100000 }, ); }; ================================================ FILE: wren-ui/e2e/specs/connectBigQuery.spec.ts ================================================ import { test, expect } from '@playwright/test'; import { getTestConfig } from '../config'; import * as helper from '../helper'; import * as onboarding from '../commonTests/onboarding'; const testConfig = getTestConfig(); test.describe('Test BigQuery data source', async () => { test.beforeAll(async () => { await helper.resetDatabase(); }); test('Connect BigQuery data source successfully', async ({ page }) => { await page.goto('/setup/connection'); await page.locator('button').filter({ hasText: 'BigQuery' }).click(); await page.getByLabel('Display name').click(); await page.getByLabel('Display name').fill('test-bigquery'); await page.getByLabel('Project ID').click(); await page.getByLabel('Project ID').fill(testConfig.bigQuery.projectId); await page.getByLabel('Dataset ID').click(); await page.getByLabel('Dataset ID').fill(testConfig.bigQuery.datasetId); const fileChooserPromise = page.waitForEvent('filechooser'); await page .locator('button') .filter({ hasText: 'Click to upload JSON key file' }) .click(); const fileChooser = await fileChooserPromise; await fileChooser.setFiles(testConfig.bigQuery.credentialPath); await page.getByRole('button', { name: 'Next' }).click(); await expect(page).toHaveURL('/setup/models', { timeout: 60000 }); }); test('Setup all models', onboarding.setupModels); test( 'Save recommended relationships', onboarding.saveRecommendedRelationships, ); }); ================================================ FILE: wren-ui/e2e/specs/connectClickHouse.spec.ts ================================================ import { test, expect } from '@playwright/test'; import { getTestConfig } from '../config'; import * as helper from '../helper'; import * as onboarding from '../commonTests/onboarding'; const testConfig = getTestConfig(); test.describe('Test ClickHouse data source', () => { test.beforeAll(async () => { await helper.resetDatabase(); }); test('Connect ClickHouse data source successfully', async ({ page }) => { await page.goto('/setup/connection'); await page.locator('button').filter({ hasText: 'ClickHouse' }).click(); await page.getByLabel('Display name').click(); await page.getByLabel('Display name').fill('test-clickhouse'); await page.getByLabel('Host').click(); await page.getByLabel('Host').fill(testConfig.clickhouse.host); await page.getByLabel('Port').click(); await page.getByLabel('Port').fill(testConfig.clickhouse.port); await page.getByLabel('Username').click(); await page.getByLabel('Username').fill(testConfig.clickhouse.username); await page.getByLabel('Password').click(); await page.getByLabel('Password').fill(testConfig.clickhouse.password); await page.getByLabel('Database name').click(); await page.getByLabel('Database name').fill(testConfig.clickhouse.database); // Check the "Use SSL" checkbox if needed if (testConfig.clickhouse.ssl) { await page.getByLabel('Use SSL').click(); } await page.getByRole('button', { name: 'Next' }).click(); await expect(page).toHaveURL('/setup/models', { timeout: 60000 }); }); test('Setup all models', onboarding.setupModels); test( 'Save recommended relationships', onboarding.saveRecommendedRelationships, ); }); ================================================ FILE: wren-ui/e2e/specs/connectDuckDB.spec.ts ================================================ import { test, expect } from '@playwright/test'; import { getTestConfig } from '../config'; import * as helper from '../helper'; import * as onboarding from '../commonTests/onboarding'; const testConfig = getTestConfig(); test.describe('Test DuckDB data source', () => { test.beforeAll(async () => { await helper.resetDatabase(); }); test('Connect DuckDB data source successfully', async ({ page }) => { await page.goto('/setup/connection'); await page.locator('button').filter({ hasText: 'DuckDB' }).click(); await page.getByLabel('Display name').click(); await page.getByLabel('Display name').fill('test-duckdb'); await page.getByLabel('Initial SQL statements').click(); await page .getByLabel('Initial SQL statements') .fill( `CREATE TABLE ontime AS FROM read_csv('${testConfig.duckDb.sqlCsvPath}');`, ); await page.getByRole('button', { name: 'Next' }).click(); await expect(page).toHaveURL('/setup/models', { timeout: 60000 }); }); test('Setup all models', onboarding.setupModels); test( 'Save recommended relationships', onboarding.saveRecommendedRelationships, ); }); ================================================ FILE: wren-ui/e2e/specs/connectMySQL.spec.ts ================================================ import { test, expect } from '@playwright/test'; import { getTestConfig } from '../config'; import * as helper from '../helper'; import * as onboarding from '../commonTests/onboarding'; const testConfig = getTestConfig(); test.describe('Test MySQL data source', () => { test.beforeAll(async () => { await helper.resetDatabase(); }); test('Connect MySQL data source successfully', async ({ page }) => { await page.goto('/setup/connection'); await page.locator('button').filter({ hasText: 'MySQL' }).click(); await page.getByLabel('Display name').click(); await page.getByLabel('Display name').fill('test-mysql'); await page.getByLabel('Host').click(); await page.getByLabel('Host').fill(testConfig.mysql.host); await page.getByLabel('Port').click(); await page.getByLabel('Port').fill(testConfig.mysql.port); await page.getByLabel('Username').click(); await page.getByLabel('Username').fill(testConfig.mysql.username); await page.getByLabel('Password').click(); await page.getByLabel('Password').fill(testConfig.mysql.password); await page.getByLabel('Database name').click(); await page.getByLabel('Database name').fill(testConfig.mysql.database); await page.getByRole('button', { name: 'Next' }).click(); await expect(page).toHaveURL('/setup/models', { timeout: 60000 }); }); test('Setup all models', onboarding.setupModels); test( 'Save recommended relationships', onboarding.saveRecommendedRelationships, ); }); ================================================ FILE: wren-ui/e2e/specs/connectPostgreSQL.spec.ts ================================================ import { test, expect } from '@playwright/test'; import { getTestConfig } from '../config'; import * as helper from '../helper'; import * as onboarding from '../commonTests/onboarding'; const testConfig = getTestConfig(); test.describe('Test PostgreSQL data source', () => { test.beforeAll(async () => { await helper.resetDatabase(); }); test('Connect PostgreSQL data source successfully', async ({ page }) => { await page.goto('/setup/connection'); await page.locator('button').filter({ hasText: 'PostgreSQL' }).click(); await page.getByLabel('Display name').click(); await page.getByLabel('Display name').fill('test-postgresql'); await page.getByLabel('Host').click(); await page.getByLabel('Host').fill(testConfig.postgreSql.host); await page.getByLabel('Port').click(); await page.getByLabel('Port').fill(testConfig.postgreSql.port); await page.getByLabel('Username').click(); await page.getByLabel('Username').fill(testConfig.postgreSql.username); await page.getByLabel('Password').click(); await page.getByLabel('Password').fill(testConfig.postgreSql.password); await page.getByLabel('Database name').click(); await page.getByLabel('Database name').fill(testConfig.postgreSql.database); // Check the "Use SSL" checkbox if needed if (testConfig.postgreSql.ssl) { await page.getByLabel('Use SSL').click(); } await page.getByRole('button', { name: 'Next' }).click(); await expect(page).toHaveURL('/setup/models', { timeout: 60000 }); }); test('Setup all models', onboarding.setupModels); test( 'Save recommended relationships', onboarding.saveRecommendedRelationships, ); }); ================================================ FILE: wren-ui/e2e/specs/connectSQLServer.spec.ts ================================================ import { test, expect } from '@playwright/test'; import { getTestConfig } from '../config'; import * as helper from '../helper'; import * as onboarding from '../commonTests/onboarding'; const testConfig = getTestConfig(); test.describe('Test SQL Server data source', () => { test.beforeAll(async () => { await helper.resetDatabase(); }); test('Connect SQL Server data source successfully', async ({ page }) => { await page.goto('/setup/connection'); await page.locator('button').filter({ hasText: 'SQL Server' }).click(); await page.getByLabel('Display name').click(); await page.getByLabel('Display name').fill('test-sqlServer'); await page.getByLabel('Host').click(); await page.getByLabel('Host').fill(testConfig.sqlServer.host); await page.getByLabel('Port').click(); await page.getByLabel('Port').fill(testConfig.sqlServer.port); await page.getByLabel('Username').click(); await page.getByLabel('Username').fill(testConfig.sqlServer.username); await page.getByLabel('Password').click(); await page.getByLabel('Password').fill(testConfig.sqlServer.password); await page.getByLabel('Database name').click(); await page.getByLabel('Database name').fill(testConfig.sqlServer.database); await page.getByRole('button', { name: 'Next' }).click(); await expect(page).toHaveURL('/setup/models', { timeout: 60000 }); }); test('Setup all models', onboarding.setupModels); test( 'Save recommended relationships', onboarding.saveRecommendedRelationships, ); }); ================================================ FILE: wren-ui/e2e/specs/connectSampleECommerce.spec.ts ================================================ import { test, expect } from '@playwright/test'; import * as helper from '../helper'; import * as homeHelper from '../commonTests/home'; import * as modelingHelper from '../commonTests/modeling'; import { sampleDatasets } from '@/apollo/server/data'; const suggestedQuestions = sampleDatasets.ecommerce.questions; test.describe('Test E-commerce sample dataset', () => { test.beforeAll(async () => { await helper.resetDatabase(); }); test('Starting E-commerce dataset successfully', async ({ page }) => { await page.goto('/setup/connection'); await page.getByRole('button', { name: 'E-commerce' }).click(); await expect(page).toHaveURL('/modeling', { timeout: 60000 }); }); test('Check suggested questions', async ({ page }) => { await page.goto('/home'); for (const suggestedQuestion of suggestedQuestions) { await expect(page.getByText(suggestedQuestion.question)).toBeVisible(); } }); test( 'Check deploy status should be in Synced status', modelingHelper.checkDeploySynced, ); test('Use suggestion question', async ({ page }) => { // select first suggested question await homeHelper.askSuggestionQuestionTest({ page, suggestedQuestion: suggestedQuestions[1].question, }); }); test('Follow up question', async ({ page }) => { await homeHelper.followUpQuestionTest({ page, question: suggestedQuestions[2].question, }); }); test('Model CRUD successfully', async ({ page }) => { await modelingHelper.executeModelCRUD(page, { modelDisplayName: 'customers', modelReferenceName: 'olist_customers_dataset', primaryKeyColumn: 'customer_id', }); }); test('Update model metadata successfully', async ({ page }) => { await modelingHelper.updateModelMetadata(page, { modelDisplayName: 'olist_customers_dataset', modelDescription: '', newModelDisplayName: 'customers', newModelDescription: '', }); }); test('Add relationship successfully', async ({ page }) => { await page.goto('/modeling'); await expect(page).toHaveURL('/modeling', { timeout: 60000 }); // Following the previous test, we assume the customers model is created, and it's have not any relationships await modelingHelper.addRelationship(page, { fromFieldModelDisplayName: 'customers', fromFieldColumnDisplayName: 'customer_id', toFieldModelDisplayName: 'orders', toFieldColumnDisplayName: 'customer_id', relationshipType: 'One-to-many', }); }); test( 'Check deploy status should be in Undeployed changes status', modelingHelper.checkDeployUndeployedChanges, ); test('Relationship CRUD successfully', async ({ page }) => { await modelingHelper.executeRelationshipCRUD(page, { fromFieldModelDisplayName: 'customers', fromFieldColumnDisplayName: 'customer_id', toFieldModelDisplayName: 'orders', toFieldColumnDisplayName: 'customer_id', relationshipType: 'One-to-many', }); }); test('Trigger and check deploy MDL successfully', async ({ page, baseURL, }) => { await modelingHelper.executeDeploy({ page, baseURL }); await modelingHelper.checkDeploySynced({ page }); }); test('Save as view successfully', async ({ page, baseURL }) => { await homeHelper.saveAsView( { page, baseURL }, { question: 'What are the total sales values for each quarter of each year?', viewName: 'avg review score by city', }, ); }); test('Update view metadata successfully', async ({ page, baseURL }) => { await modelingHelper.updateViewMetadata( { page, baseURL }, { viewDisplayName: 'avg review score by city', viewDescription: '', newViewDisplayName: 'avg review score per city', newViewDescription: 'Average review score for orders placed by customers in each city.', }, ); }); test('Calculated Fields CRUD successfully', async ({ page }) => { await page.goto('/modeling'); await expect(page).toHaveURL('/modeling', { timeout: 60000 }); const modelDisplayName = 'orders'; const calculatedFieldName = 'Sum of review scores'; const expression = 'Sum'; const toFieldModelDisplayName = 'order reviews'; const toFieldColumnDisplayName = 'review_score'; const newCfName = 'total product items'; const newExpression = 'COUNT'; const newToFieldModelDisplayName = 'order items'; const newToFieldColumnDisplayName = 'order_id'; await modelingHelper.addCalculatedField(page, { calculatedFieldName, expression, modelDisplayName, toFieldModelDisplayName, toFieldColumnDisplayName, }); // update calculated field await page .getByTestId(`diagram__model-node__${modelDisplayName}`) .getByRole('button', { name: 'more' }) .nth(1) .click(); await page.getByText('Edit').click(); await page.getByLabel('Name').click(); await page.getByLabel('Name').fill(newCfName); await page.getByTestId('common__descriptive-select').click(); await page.getByTitle(newExpression).locator('div').click(); await page .getByTestId('common__lineage-field-block') .filter({ hasText: modelDisplayName }) .getByText(toFieldModelDisplayName, { exact: true }) .click(); await page .getByTestId('common__fields__select-option') .filter({ hasText: newToFieldModelDisplayName }) .scrollIntoViewIfNeeded(); await page .getByTestId('common__fields__select-option') .filter({ hasText: newToFieldModelDisplayName }) .click(); await expect( page .getByTestId('common__lineage-field-block') .getByText(newToFieldModelDisplayName, { exact: true }), ).toHaveCount(2); await expect(page.getByText('Please select a field.')).toBeVisible(); await page.getByTestId('common__lineage-fields-select').last().click(); await page .getByTestId('common__fields__select-option') .filter({ hasText: newToFieldColumnDisplayName }) .scrollIntoViewIfNeeded(); await page .getByTestId('common__fields__select-option') .filter({ hasText: newToFieldColumnDisplayName }) .click(); await page.getByRole('button', { name: 'Save' }).click(); await expect( page.getByText('Successfully updated calculated field.'), ).toBeVisible(); // delete calculated field await modelingHelper.deleteCalculatedField(page, modelDisplayName); }); }); ================================================ FILE: wren-ui/e2e/specs/connectSampleHR.spec.ts ================================================ import { test, expect } from '@playwright/test'; import * as helper from '../helper'; import * as homeHelper from '../commonTests/home'; import * as modelingHelper from '../commonTests/modeling'; import { sampleDatasets } from '@/apollo/server/data'; const suggestedQuestions = sampleDatasets.hr.questions; test.describe('Test HR sample dataset', () => { test.beforeAll(async () => { await helper.resetDatabase(); }); test('Starting HR dataset successfully', async ({ page }) => { await page.goto('/setup/connection'); await page.getByRole('button', { name: 'Human Resource' }).click(); await expect(page).toHaveURL('/modeling', { timeout: 60000 }); }); test('Check suggested questions', async ({ page }) => { await page.goto('/home'); for (const suggestedQuestion of suggestedQuestions) { await expect(page.getByText(suggestedQuestion.question)).toBeVisible(); } }); test('Use suggestion question', async ({ page, baseURL }) => { // select first suggested question await homeHelper.askSuggestionQuestionTest({ page, suggestedQuestion: suggestedQuestions[1].question, }); }); test( 'Check deploy status should be in Synced status', modelingHelper.checkDeploySynced, ); }); ================================================ FILE: wren-ui/e2e/specs/connectSnowflake.spec.ts ================================================ import { test, expect } from '@playwright/test'; import { getTestConfig } from '../config'; import * as helper from '../helper'; import * as onboarding from '../commonTests/onboarding'; const testConfig = getTestConfig(); test.describe('Test Snowflake data source', () => { test.beforeAll(async () => { await helper.resetDatabase(); }); test('Connect Snowflake data source successfully', async ({ page }) => { await page.goto('/setup/connection'); await page.locator('button').filter({ hasText: 'Snowflake' }).click(); await page.getByLabel('Display name').click(); await page.getByLabel('Display name').fill('test-snowflake'); await page.getByLabel('Username').click(); await page.getByLabel('Username').fill(testConfig.snowflake.username); await page.getByLabel('Password').click(); await page.getByLabel('Password').fill(testConfig.snowflake.password); await page.getByLabel('Account').click(); await page.getByLabel('Account').fill(testConfig.snowflake.account); await page.getByLabel('Database name').click(); await page.getByLabel('Database name').fill(testConfig.snowflake.database); await page.getByLabel('Schema').click(); await page.getByLabel('Schema').fill(testConfig.snowflake.schema); await page.getByRole('button', { name: 'Next' }).click(); await expect(page).toHaveURL('/setup/models', { timeout: 60000 }); }); test('Setup all models', onboarding.setupModels); test( 'Save recommended relationships', onboarding.saveRecommendedRelationships, ); }); ================================================ FILE: wren-ui/e2e/specs/connectTrino.spec.ts ================================================ import { test, expect } from '@playwright/test'; import { getTestConfig } from '../config'; import * as helper from '../helper'; import * as onboarding from '../commonTests/onboarding'; const testConfig = getTestConfig(); test.describe('Test Trino data source', () => { test.beforeAll(async () => { await helper.resetDatabase(); }); test('Connect Trino data source successfully', async ({ page }) => { await page.goto('/setup/connection'); await page.locator('button').filter({ hasText: 'Trino' }).click(); await page.getByLabel('Display name').click(); await page.getByLabel('Display name').fill('test-trino'); await page.getByLabel('Host').click(); await page.getByLabel('Host').fill(testConfig.trino.host); await page.getByLabel('Port').click(); await page.getByLabel('Port').fill(testConfig.trino.port); await page.getByLabel('Catalog').click(); await page.getByLabel('Catalog').fill(testConfig.trino.catalog); await page.getByLabel('Schema').click(); await page.getByLabel('Schema').fill(testConfig.trino.schema); await page.getByLabel('Username').click(); await page.getByLabel('Username').fill(testConfig.trino.username); await page.getByLabel('Password').click(); await page.getByLabel('Password').fill(testConfig.trino.password); await page.getByRole('button', { name: 'Next' }).click(); await expect(page).toHaveURL('/setup/models', { timeout: 60000 }); }); test('Setup all models', onboarding.setupModels); test( 'Save recommended relationships', onboarding.saveRecommendedRelationships, ); }); ================================================ FILE: wren-ui/jest.config.js ================================================ /** @type {import('ts-jest').JestConfigWithTsJest} */ module.exports = { preset: 'ts-jest', testEnvironment: 'node', moduleNameMapper: { '^@server/(.*)$': '/src/apollo/server/$1', }, modulePathIgnorePatterns: ['/e2e/'], }; ================================================ FILE: wren-ui/knexfile.js ================================================ // Update with your config settings. /** * @type { Object. } */ if (process.env.DB_TYPE === 'pg') { console.log('Using Postgres'); module.exports = { client: 'pg', connection: process.env.PG_URL, }; } else { console.log('Using SQLite'); module.exports = { client: 'better-sqlite3', connection: process.env.SQLITE_FILE || './db.sqlite3', useNullAsDefault: true, }; } ================================================ FILE: wren-ui/migrations/20240125070643_create_project_table.js ================================================ /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.up = function (knex) { return knex.schema.createTable('project', (table) => { table.increments('id').comment('ID'); table .string('type') .comment( 'project datasource type. ex: bigquery, mysql, postgresql, mongodb, etc', ); table.string('display_name').comment('project display name'); table .text('credentials') .nullable() .comment('database connection credentials'); // bq table .string('project_id') .nullable() .comment('gcp project id, big query specific'); table.string('dataset_id').nullable().comment('big query datasetId'); // duckdb table .jsonb('init_sql') .nullable() .comment('init sql for establishing duckdb environment'); // knex jsonb ref: https://knexjs.org/guide/schema-builder.html#json table .jsonb('extensions') .nullable() .comment( 'duckdb extensions, will be a array-like string like, eg: ["extension1", "extension2"]', ); table .jsonb('configurations') .nullable() .comment( 'duckdb configurations that can be set in session, eg: { "key1": "value1", "key2": "value2" }', ); // not sure to store or not, the catalog & schema in the manifest table.string('catalog').comment('catalog name'); table.string('schema').comment(''); // sample datset table.string('sample_dataset').nullable().comment('sample dataset name'); table.timestamps(true, true); }); }; /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.down = function (knex) { return knex.schema.dropTable('project'); }; ================================================ FILE: wren-ui/migrations/20240125071855_create_model_table.js ================================================ /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.up = function (knex) { return knex.schema .createTable('model', (table) => { table.increments('id').comment('ID'); table.integer('project_id').comment('Reference to project.id'); // basic info table.string('display_name').comment('the model display name'); table .string('source_table_name') .comment( 'referenced table name in the datasource, can not be duplicated in the same project', ); table .string('reference_name') .comment( 'the name used in MDL structure, should be unique between models in the same project', ); table.text('ref_sql').comment('Reference SQL'); // cache setting table.boolean('cached').comment('model is cached or not'); table .string('refresh_time') .comment( 'contain a number followed by a time unit (ns, us, ms, s, m, h, d). For example, "2h"', ) .nullable(); // model properties table .text('properties') .comment( 'model properties, a json string, the description and displayName should be stored here', ) .nullable(); table.timestamps(true, true); }) .then(() => knex.schema.table('model', (table) => { // Explicitly add unique constraint to avoid using the deprecated signature table.unique(['project_id', 'source_table_name'], { indexName: 'project_id_source_table_name_unique', storageEngineIndexType: 'BTREE', // This line is optional and can be adjusted based on your DB's engine }); table.unique(['project_id', 'reference_name'], { indexName: 'project_id_reference_name_unique', storageEngineIndexType: 'BTREE', // This line is optional and can be adjusted based on your DB's engine }); }), ); }; /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.down = function (knex) { return knex.schema.dropTable('model'); }; ================================================ FILE: wren-ui/migrations/20240125081244_create_model_column_table.js ================================================ /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.up = function (knex) { return knex.schema .createTable('model_column', (table) => { table.increments('id').comment('ID'); table.integer('model_id').comment('Reference to model ID'); // column name table.boolean('is_calculated').comment('Is calculated field'); table.string('display_name').comment('Display name of the column'); table .string('source_column_name') .comment('the column name in the datasource'); table .string('reference_name') .comment('The name used in the MDL structure and query'); // aggregation table .text('aggregation') .comment( 'Expression for the column, could be custom field or calculated field expression, eg: sum, aggregate', ) .nullable(); table .text('lineage') .comment( 'the selected field in calculated field, array of ids, [relationId 1, relationId 2, columnId], last one should be columnId, while others are relationId', ) .nullable(); table .text('diagram') .comment('for FE to store the calculated field diagram') .nullable(); table .string('type') .comment('Data type, refer to the column type in the datasource') .nullable(); table.boolean('not_null').comment('Is not null'); // is primary key table.boolean('is_pk').comment('Is primary key of the table'); table .text('properties') .comment( 'column properties, a json string, the description and displayName should be stored here', ) .nullable(); table.timestamps(true, true); }) .then(() => knex.schema.table('model_column', (table) => { // Explicitly add unique constraint to avoid using the deprecated signature table.unique(['model_id', 'source_column_name'], { indexName: 'model_id_source_column_name_unique', storageEngineIndexType: 'BTREE', // This line is optional and can be adjusted based on your DB's engine }); table.unique(['model_id', 'reference_name'], { indexName: 'model_id_reference_name_unique', storageEngineIndexType: 'BTREE', // This line is optional and can be adjusted based on your DB's engine }); }), ); }; /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.down = function (knex) { return knex.schema.dropTable('model_column'); }; ================================================ FILE: wren-ui/migrations/20240125083821_create_relation_table.js ================================================ /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.up = function (knex) { return knex.schema.createTable('relation', (table) => { table.increments('id').comment('ID'); table.integer('project_id').comment('Reference to project.id'); table.string('name').comment('relation name').unique(); table .string('join_type') .comment('join type, eg:"ONE_TO_ONE", "ONE_TO_MANY", "MANY_TO_ONE"'); table .integer('from_column_id') .comment('from column id, "{fromColumn} {joinType} {toSideColumn}"'); table .integer('to_column_id') .comment('to column id, "{fromColumn} {joinType} {toSideColumn}"'); table.timestamps(true, true); }); }; /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.down = function (knex) { return knex.schema.dropTable('relation'); }; ================================================ FILE: wren-ui/migrations/20240125085655_create_metrics_table.js ================================================ /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.up = function (knex) { return knex.schema.createTable('metric', (table) => { table.increments('id').comment('ID'); table.integer('project_id').comment('Reference to project.id'); table.string('name').comment('metric name'); table.string('type').comment('metric type, ex: "simple" or "cumulative"'); // cache setting table.boolean('cached').comment('model is cached or not'); table .string('refresh_time') .comment( 'contain a number followed by a time unit (ns, us, ms, s, m, h, d). For example, "2h"', ) .nullable(); // metric can based on model or another metric table.integer('model_id').comment('Reference to model.id').nullable(); table.integer('metric_id').comment('Reference to metric.id').nullable(); table .text('properties') .comment( 'metric properties, a json string, the description and displayName should be stored here', ) .nullable(); table.timestamps(true, true); }); }; /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.down = function (knex) { return knex.schema.dropTable('metric'); }; ================================================ FILE: wren-ui/migrations/20240126100753_create_metrics_measure_table.js ================================================ /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.up = function (knex) { // name string // expression string // granularity string, nullable return knex.schema.createTable('metric_measure', (table) => { table.increments('id').comment('ID'); table.integer('metric_id').comment('Reference to metric ID'); table.string('name').comment('Measure name'); table .text('expression') .comment('Expression for the measure') .comment( 'the expression of measure, eg: "Sum", "Everage", or customize expression', ); table .string('granularity') .comment( 'Granularity for the measure, eg: "day", "hour", "minute", "year"', ) .nullable(); table.timestamps(true, true); }); }; /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.down = function (knex) { return knex.schema.dropTable('metric_measure'); }; ================================================ FILE: wren-ui/migrations/20240129021453_create_view_table.js ================================================ /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.up = function (knex) { return knex.schema.createTable('view', (table) => { table.increments('id').comment('ID'); table.integer('project_id').comment('Reference to project.id'); // basic info table.string('name').comment('the view name'); table.text('statement').comment('the sql statement of this view'); // cache setting table.boolean('cached').comment('view is cached or not'); table .string('refresh_time') .comment( 'contain a number followed by a time unit (ns, us, ms, s, m, h, d). For example, "2h"', ) .nullable(); // view properties table .text('properties') .comment( 'view properties, a json string, the description and displayName should be stored here', ) .nullable(); table.timestamps(true, true); }); }; /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.down = function (knex) { return knex.schema.dropTable('view'); }; ================================================ FILE: wren-ui/migrations/20240319083758_create_deploy_table.js ================================================ /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.up = function (knex) { return knex.schema.createTable('deploy_log', (table) => { table.increments('id').comment('ID'); table.integer('project_id').comment('Reference to project.id'); // basic info table.jsonb('manifest').comment('the deployed manifest'); table.string('hash').comment('the hash of the manifest'); // status table.string('status').nullable().comment('deploy status'); table.string('error').nullable().comment('deploy error message'); // timestamps table.timestamps(true, true); }); }; /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.down = function (knex) { return knex.schema.dropTable('deploy_log'); }; ================================================ FILE: wren-ui/migrations/20240327030000_create_ask_table.js ================================================ /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.up = function (knex) { return knex.schema .createTable('thread', (table) => { table.increments('id').comment('ID'); table.integer('project_id').comment('Reference to project.id'); table.string('sql').comment('the sql statement of this thread'); table.text('summary').comment('the summary of the thread'); // timestamps table.timestamps(true, true); }) .createTable('thread_response', (table) => { table.increments('id').comment('ID'); table.integer('thread_id').comment('Reference to thread.id'); table.foreign('thread_id').references('thread.id').onDelete('CASCADE'); // query id from AI service table.string('query_id').comment('the query id generated by AI service'); // response from AI service table.text('question').comment('the question of the response'); table.string('status').comment('the status of the response'); table.jsonb('detail').nullable().comment('the detail of the response'); table.jsonb('error').nullable().comment('the error message if any'); // timestamps table.timestamps(true, true); }); }; /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.down = function (knex) { return knex.schema.dropTable('thread_response').dropTable('thread'); }; ================================================ FILE: wren-ui/migrations/20240418000000_update_project_table_pg.js ================================================ /** * @param { import("knex").Knex } knex * @returns { Promise } */ // add pg related columns to project table exports.up = function (knex) { return knex.schema.alterTable('project', (table) => { // pg table .string('host') .nullable() .comment('postgresql host, postgresql specific'); table .integer('port') .nullable() .comment('postgresql port, postgresql specific'); table .string('database') .nullable() .comment('postgresql database, postgresql specific'); table .string('user') .nullable() .comment('postgresql user, postgresql specific'); }); }; /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.down = function (knex) { return knex.schema.alterTable('project', (table) => { table.dropColumns('host', 'port', 'database', 'user'); }); }; ================================================ FILE: wren-ui/migrations/20240419090558_add_foreign_key_to_model_column_and_metric_measure.js ================================================ /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.up = function (knex) { return knex.schema .alterTable('model_column', (table) => { table.foreign('model_id').references('model.id').onDelete('CASCADE'); }) .alterTable('metric_measure', (table) => { table.foreign('metric_id').references('metric.id').onDelete('CASCADE'); }); }; /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.down = function (knex) { return knex.schema .alterTable('model_column', (table) => { table.dropForeign('model_id'); }) .alterTable('metric_measure', (table) => { table.dropForeign('metric_id'); }); }; ================================================ FILE: wren-ui/migrations/20240425000000_add_thread_response_summary.js ================================================ /** * @param { import("knex").Knex } knex * @returns { Promise } */ // add summary column to thread_response table exports.up = function (knex) { return knex.schema.alterTable('thread_response', (table) => { table .string('summary') .nullable() .comment('the summary of the thread response'); }); }; /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.down = function (knex) { return knex.schema.alterTable('thread_response', (table) => { table.dropColumns('summary'); }); }; ================================================ FILE: wren-ui/migrations/20240430033014_update_model_column_table.js ================================================ /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.up = function (knex) { // Drop this column FE is no longer using it. return knex.schema.table('model_column', function (table) { table.dropColumn('diagram'); }); }; /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.down = function (knex) { return knex.schema.table('model_column', function (table) { table .text('diagram') .comment('for FE to store the calculated field diagram') .nullable(); }); }; ================================================ FILE: wren-ui/migrations/20240446090560_update_relationship_table.js ================================================ /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.up = function (knex) { return knex.schema .alterTable('relation', (table) => { table .foreign('from_column_id') .references('model_column.id') .onDelete('CASCADE'); }) .alterTable('relation', (table) => { table .foreign('to_column_id') .references('model_column.id') .onDelete('CASCADE'); }); }; /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.down = function (knex) { return knex.schema .alterTable('relation', (table) => { table.dropForeign('from_column_id'); }) .alterTable('relation', (table) => { table.dropForeign('to_column_id'); }); }; ================================================ FILE: wren-ui/migrations/20240502000000_add_properties_to_relationship.js ================================================ /** * @param { import("knex").Knex } knex * @returns { Promise } */ // add properties column to relation table exports.up = function (knex) { return knex.schema.alterTable('relation', (table) => { table .text('properties') .comment( 'column properties, a json string, the description of relationships should be stored here', ) .nullable(); }); }; /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.down = function (knex) { return knex.schema.alterTable('relation', (table) => { table.dropColumns('properties'); }); }; ================================================ FILE: wren-ui/migrations/20240524044348_update_project_table.js ================================================ /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.up = async function (knex, Promise) { await knex.schema.alterTable('project', (table) => { table.text('init_sql').alter(); }); }; /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.down = async function (knex, Promise) { // without rollback script, can not revert text to jsonb in postgres // init sql should be string, not jsonb }; ================================================ FILE: wren-ui/migrations/20240524071859_update_thread_table.js ================================================ /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.up = async function (knex, promise) { // drop foreign key constraint before altering column type to prevent data loss await knex.schema.alterTable('thread_response', (table) => { table.dropForeign('thread_id'); }); await knex.schema.alterTable('thread', (table) => { table.text('sql').alter(); }); await knex.schema.alterTable('thread_response', (table) => { table.foreign('thread_id').references('thread.id').onDelete('CASCADE'); }); }; /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.down = async function (knex, promise) { await knex.schema.alterTable('thread_response', (table) => { table.dropForeign('thread_id'); }); await knex.schema.alterTable('thread', (table) => { table.string('sql').alter(); }); await knex.schema.alterTable('thread_response', (table) => { table.foreign('thread_id').references('thread.id').onDelete('CASCADE'); }); }; ================================================ FILE: wren-ui/migrations/20240530062133_update_project_table.js ================================================ /** * @param { import("knex").Knex } knex * @returns { Promise } */ // create connectionInfo column in project table exports.up = function (knex) { return knex.schema.table('project', (table) => { table .jsonb('connection_info') .nullable() .comment('Connection information for the project'); }); }; /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.down = function (knex) { return knex.schema.table('project', (table) => { table.dropColumn('connection_info'); }); }; ================================================ FILE: wren-ui/migrations/20240530062809_transfer_project_table_data.js ================================================ /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.up = async function (knex) { const projects = await knex('project').select('*'); // bigquery data const bigqueryConnectionInfo = projects .filter((project) => project.type === 'BIG_QUERY') .map((project) => { return { id: project.id, connectionInfo: { projectId: project.project_id, datasetId: project.dataset_id, credentials: project.credentials, }, }; }); // duckdb data const duckdbConnectionInfo = projects .filter((project) => project.type === 'DUCKDB') .map((project) => { return { id: project.id, connectionInfo: { initSql: project.init_sql || '', configurations: project.configurations || {}, extensions: project.extensions || [], }, }; }); // postgres data const postgresConnectionInfo = projects .filter((project) => project.type === 'POSTGRES') .map((project) => { const ssl = project.configurations && project.configurations.ssl ? true : false; return { id: project.id, connectionInfo: { host: project.host, port: project.port, database: project.database, user: project.user, password: project.credentials, ssl, }, }; }); // update project table for (const project of [ ...bigqueryConnectionInfo, ...duckdbConnectionInfo, ...postgresConnectionInfo, ]) { const { id, connectionInfo } = project; if (process.env.DB_TYPE === 'pg') { // postgres await knex('project') .where({ id }) .update({ connection_info: connectionInfo }); } else { // sqlite await knex('project') .where({ id }) .update({ connection_info: JSON.stringify(connectionInfo) }); } } }; /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.down = async function (knex) { await knex('project').update({ connection_info: null }); }; ================================================ FILE: wren-ui/migrations/20240530105955_drop_project_table_columns.js ================================================ /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.up = function (knex) { return knex.schema.table('project', (table) => { table.dropColumn('configurations'); table.dropColumn('credentials'); table.dropColumn('project_id'); table.dropColumn('dataset_id'); table.dropColumn('init_sql'); table.dropColumn('extensions'); table.dropColumn('host'); table.dropColumn('port'); table.dropColumn('database'); table.dropColumn('user'); }); }; /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.down = function (knex) { return knex.schema.table('project', (table) => { table .jsonb('configurations') .nullable() .comment( 'duckdb configurations that can be set in session, eg: { "key1": "value1", "key2": "value2" }', ); table .text('credentials') .nullable() .comment('database connection credentials'); table .string('project_id') .nullable() .comment('gcp project id, big query specific'); table.string('dataset_id').nullable().comment('big query datasetId'); table.text('init_sql'); table .jsonb('extensions') .nullable() .comment( 'duckdb extensions, will be a array-like string like, eg: ["extension1", "extension2"]', ); table .string('host') .nullable() .comment('postgresql host, postgresql specific'); table .integer('port') .nullable() .comment('postgresql port, postgresql specific'); table .string('database') .nullable() .comment('postgresql database, postgresql specific'); table .string('user') .nullable() .comment('postgresql user, postgresql specific'); }); }; ================================================ FILE: wren-ui/migrations/20240531085916_transfer_model_properties.js ================================================ /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.up = async function (knex) { const projects = await knex('project').select('*'); const models = await knex('model').select('*'); console.log(`model len:${models.length}`); for (const model of models) { const project = projects.find((p) => p.id === model.project_id); const dataSourceType = project.type; // get schema & catalog if its available let schema = null; let catalog = null; let table = null; switch (dataSourceType) { case 'BIG_QUERY': { const connectionInfo = typeof project.connection_info === 'string' ? JSON.parse(project.connection_info) : project.connection_info; const datasetId = connectionInfo.datasetId; if (!datasetId) continue; const splitDataSetId = datasetId.split('.'); schema = splitDataSetId[1]; catalog = splitDataSetId[0]; table = model.source_table_name; break; } case 'POSTGRES': { const connectionInfo = typeof project.connection_info === 'string' ? JSON.parse(project.connection_info) : project.connection_info; catalog = connectionInfo.database; schema = model.source_table_name.split('.')[0]; table = model.source_table_name.split('.')[1]; break; } case 'DUCKDB': { // already have schema & catalog in properties table = model.source_table_name; break; } } const oldProperties = model.properties ? JSON.parse(model.properties) : {}; const newProperties = { schema, catalog, table, ...oldProperties, }; await knex('model') .where({ id: model.id }) .update({ properties: JSON.stringify(newProperties) }); } }; /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.down = function () { return Promise.resolve(); }; ================================================ FILE: wren-ui/migrations/20240610070534_create_schema_change_table.js ================================================ /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.up = function (knex) { return knex.schema.createTable('schema_change', (table) => { table.increments('id').comment('ID'); table.integer('project_id').comment('Reference to project.id'); // schema change info table.jsonb('change').nullable(); table.jsonb('resolve').nullable(); // timestamps table.timestamps(true, true); }); }; /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.down = function (knex) { return knex.schema.dropTable('schema_change'); }; ================================================ FILE: wren-ui/migrations/20240928165009_create_model_nested_column.js ================================================ /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.up = function (knex) { return knex.schema.createTable('model_nested_column', (table) => { table.increments('id').comment('ID'); table.integer('model_id').comment('Reference to model ID'); table.integer('column_id').comment('Reference to column ID'); table .string('column_path') .comment( 'The path of the nested column, array of strings, [sourceColumnName..sourceColumnName(n)]', ); table.string('display_name').comment('Display name of the nested column'); table .string('source_column_name') .comment('the nested column name in the datasource'); table .string('reference_name') .comment('The name used in the MDL structure and query'); table .string('type') .comment('Data type, refer to the nested column type in the datasource') .nullable(); table .text('properties') .comment( 'nested column properties, a json string, the description should be stored here', ) .nullable(); table .foreign('column_id') .references('model_column.id') .onDelete('CASCADE'); table.timestamps(true, true); }); }; /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.down = function (knex) { return knex.schema.dropTable('model_nested_column'); }; ================================================ FILE: wren-ui/migrations/20241021073019_update_project_language.js ================================================ /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.up = function (knex) { return knex.schema.alterTable('project', (table) => { table .string('language') .comment('The project language applied to AI') .defaultTo('EN'); }); }; /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.down = function (knex) { return knex.schema.alterTable('project', (table) => { table.dropColumn('language'); }); }; ================================================ FILE: wren-ui/migrations/20241029092204_create_learning_table.js ================================================ /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.up = function (knex) { return knex.schema.createTable('learning', (table) => { table.increments('id').comment('ID'); table.string('user_id').comment('The user uuid.'); table .text('paths') .comment( 'The learning paths of user, array of learning stories, [enum1, enum2, ..enum(n)].', ); }); }; /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.down = function (knex) { return knex.schema.dropTable('learning'); }; ================================================ FILE: wren-ui/migrations/20241106232204_update_project_table.js ================================================ /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.up = function (knex) { return knex.schema.alterTable('project', (table) => { table .jsonb('questions') .nullable() .comment('The recommended questions generated by AI'); table .string('query_id') .nullable() .comment('The query id of the recommended question pipeline'); table .string('questions_status') .nullable() .comment('The status of the recommended question pipeline'); table .jsonb('questions_error') .nullable() .comment('The error of the recommended question pipeline'); }); }; /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.down = function (knex) { return knex.schema.alterTable('project', (table) => { table.dropColumn('questions'); table.dropColumn('query_id'); table.dropColumn('questions_status'); table.dropColumn('questions_error'); }); }; ================================================ FILE: wren-ui/migrations/20241107171828_update_thread_table.js ================================================ /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.up = function (knex) { return knex.schema.alterTable('thread', (table) => { table .jsonb('questions') .nullable() .comment('The recommended questions generated by AI'); table .string('query_id') .nullable() .comment('The query id of the recommended question pipeline'); table .string('questions_status') .nullable() .comment('The status of the recommended question pipeline'); table .jsonb('questions_error') .nullable() .comment('The error of the recommended question pipeline'); }); }; /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.down = function (knex) { return knex.schema.alterTable('thread', (table) => { table.dropColumn('questions'); table.dropColumn('query_id'); table.dropColumn('questions_status'); table.dropColumn('questions_error'); }); }; ================================================ FILE: wren-ui/migrations/20241115031024_drop_thread_response_table_column.js ================================================ /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.up = function (knex) { return knex.schema.alterTable('thread_response', function (table) { table.dropColumn('summary'); }); }; /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.down = function (knex) { return knex.schema.alterTable('thread_response', function (table) { table .string('summary') .nullable() .comment('the summary of the thread response'); }); }; ================================================ FILE: wren-ui/migrations/20241207000000_update_thread_response_for_answer.js ================================================ const constructCteSql = (steps) => { // if empty, return empty string if (steps.length === 0) { return ''; } // if there's only one step, return the sql directly if (steps.length === 1) { return steps[0].sql; } let sql = 'WITH '; steps.forEach((step, index) => { if (index === steps.length - 1) { // if it's the last step, remove the trailing comma. // no need to wrap with WITH sql += `${step.sql}`; } else if (index === steps.length - 2) { // if it's the last two steps, remove the trailing comma. // wrap with CTE sql += `${step.cteName} AS`; sql += `(${step.sql})`; } else { // if it's not the last step, wrap with CTE sql += `${step.cteName} AS`; sql += `(${step.sql}),`; } }); return sql; }; /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.up = async function (knex) { await knex.schema.alterTable('thread_response', (table) => { table.renameColumn('detail', 'breakdown_detail'); table .text('sql') .nullable() .comment('the SQL query generated by AI service'); table .jsonb('answer_detail') .defaultTo('{}') .comment('AI generated text-based answer detail'); table .integer('view_id') .nullable() .comment('the view ID associated with the response'); }); const threadResponses = await knex('thread_response').select( 'id', 'query_id', 'status', 'breakdown_detail', 'error', ); for (const response of threadResponses) { let errorDetail; try { errorDetail = JSON.parse(response.error); } catch (_e) { errorDetail = null; } let breakdownDetail; try { breakdownDetail = JSON.parse(response.breakdown_detail); } catch (_e) { breakdownDetail = {}; } const updatedDetail = { queryId: response.query_id, status: response.status, error: errorDetail, ...breakdownDetail, }; await knex('thread_response') .where('id', response.id) .update({ sql: constructCteSql(breakdownDetail?.steps || []), breakdown_detail: JSON.stringify(updatedDetail), answer_detail: null, view_id: breakdownDetail.viewId || null, }); } await knex.schema.alterTable('thread_response', (table) => { table.dropColumn('query_id'); table.dropColumn('status'); table.dropColumn('error'); }); }; /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.down = async function (knex) { await knex.schema.alterTable('thread_response', (table) => { table.string('query_id').comment('the query id generated by AI service'); table.string('status').comment('the status of the response'); table.jsonb('error').nullable().comment('the error message if any'); table.dropColumn('sql'); table.dropColumn('answer_detail'); }); const threadResponses = await knex('thread_response') .select('id', 'breakdown_detail', 'view_id') .whereNotNull('breakdown_detail'); for (const response of threadResponses) { // Parse the breakdown_detail field from the response let detail; try { detail = JSON.parse(response.breakdown_detail); } catch (_e) { detail = {}; } // Convert the error detail to a string let errorString; try { errorString = JSON.stringify(detail.error); } catch (_e) { errorString = null; } // Update the thread_response table with the parsed details await knex('thread_response') .where('id', response.id) .update({ query_id: detail.queryId, status: detail.status, error: errorString, breakdown_detail: JSON.stringify({ ...detail, viewId: response.view_id, queryId: undefined, status: undefined, error: undefined, }), }); } await knex.schema.alterTable('thread_response', (table) => { table.dropColumn('view_id'); table.renameColumn('breakdown_detail', 'detail'); }); }; ================================================ FILE: wren-ui/migrations/20241210072534_update_thread_response_table.js ================================================ /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.up = function (knex) { return knex.schema.alterTable('thread_response', (table) => { table.jsonb('chart_detail').nullable(); }); }; /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.down = function (knex) { return knex.schema.alterTable('thread_response', (table) => { table.dropColumn('chart_detail'); }); }; ================================================ FILE: wren-ui/migrations/20241226135712_remove_thread_sql.js ================================================ /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.up = async function (knex) { // drop foreign key constraint before altering column type to prevent data loss await knex.schema.alterTable('thread_response', (table) => { table.dropForeign('thread_id'); }); await knex.schema.alterTable('thread', (table) => { table.dropColumn('sql'); }); await knex.schema.alterTable('thread_response', (table) => { table.foreign('thread_id').references('thread.id').onDelete('CASCADE'); }); }; /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.down = async function (knex) { await knex.schema.alterTable('thread', (table) => { table.text('sql').nullable(); }); }; ================================================ FILE: wren-ui/migrations/20250102074255_create_dashboard_table.js ================================================ /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.up = async function (knex) { await knex.schema.createTable('dashboard', (table) => { table.increments('id').primary(); table .integer('project_id') .notNullable() .comment('Reference to project.id'); table.string('name').notNullable().comment('The dashboard name'); table.foreign('project_id').references('project.id').onDelete('CASCADE'); table.index(['project_id']); table.timestamps(true, true); }); await knex.transaction(async (trx) => { // select all existing projects, should be only one project though const projects = await knex('project').forUpdate(); if (projects.length > 0) { const dashboards = projects.map((project) => ({ project_id: project.id, name: 'Dashboard', })); await trx('dashboard').insert(dashboards); } }); }; /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.down = function (knex) { return knex.schema.dropTable('dashboard'); }; ================================================ FILE: wren-ui/migrations/20250102074256_create_dashboard_item_table.js ================================================ /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.up = function (knex) { return knex.schema.createTable('dashboard_item', (table) => { table.increments('id').primary(); table .integer('dashboard_id') .notNullable() .comment('Reference to dashboard.id'); table .string('type') .notNullable() .comment( 'The chart type of the dashboard item, such as: bar, table, number, etc', ); table .jsonb('layout') .notNullable() .comment( 'The layout of the dashboard item, according to which library it is, such as: { x: 0, y: 0, w: 6, h: 6 }', ); table .jsonb('detail') .notNullable() .comment( 'The detail of the dashboard item, such as: { chartSchema: {...}, sql: "..." } ', ); table .foreign('dashboard_id') .references('dashboard.id') .onDelete('CASCADE'); table.index(['dashboard_id', 'type']); table.timestamps(true, true); }); }; /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.down = function (knex) { return knex.schema.dropTable('dashboard_item'); }; ================================================ FILE: wren-ui/migrations/20250102074256_create_sql_pair_table.js ================================================ /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.up = function (knex) { return knex.schema.createTable('sql_pair', (table) => { table.increments('id').primary(); table .integer('project_id') .notNullable() .comment('Reference to project.id'); table.text('sql').notNullable(); table.string('question', 1000).notNullable(); table.timestamps(true, true); table.foreign('project_id').references('id').inTable('project'); }); }; /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.down = function (knex) { return knex.schema.dropTable('sql_pair'); }; ================================================ FILE: wren-ui/migrations/20250311046282_create_instruction_table.js ================================================ /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.up = function (knex) { return knex.schema.createTable('instruction', (table) => { table.increments('id').primary(); table .integer('project_id') .notNullable() .comment('Reference to project.id'); table.text('instruction').notNullable().comment('The instruction text'); table.jsonb('questions').notNullable().comment('The questions array'); table .boolean('is_default') .notNullable() .comment('Whether this instruction should be used in each asking'); table.timestamps(true, true); table.foreign('project_id').references('project.id').onDelete('CASCADE'); }); }; /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.down = function (knex) { return knex.schema.dropTable('instruction'); }; ================================================ FILE: wren-ui/migrations/20250320074256_alter_sql_pair_table.js ================================================ /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.up = function (knex) { return knex.schema.alterTable('sql_pair', (table) => { // Drop the existing foreign key constraint table.dropForeign('project_id'); // Add the foreign key constraint with onDelete CASCADE table .foreign('project_id') .references('id') .inTable('project') .onDelete('CASCADE'); }); }; /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.down = function (knex) { return knex.schema.alterTable('sql_pair', (table) => { // Drop the foreign key constraint with CASCADE table.dropForeign('project_id'); // Restore the original foreign key constraint without CASCADE table.foreign('project_id').references('id').inTable('project'); }); }; ================================================ FILE: wren-ui/migrations/20250422000000_alter_dashboard_table.js ================================================ /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.up = function (knex) { return knex.schema.alterTable('dashboard', function (table) { table.boolean('cache_enabled').defaultTo(true); table.string('schedule_frequency').nullable().defaultTo('NEVER'); // Weekly, Daily, Custom, Never table.string('schedule_cron').nullable().defaultTo(null); // cron expression string table.string('schedule_timezone').nullable().defaultTo(null); table.timestamp('next_scheduled_at').nullable().defaultTo(null); // Next scheduled run timestamp }); }; /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.down = function (knex) { return knex.schema.alterTable('dashboard', function (table) { table.dropColumn('cache_enabled'); table.dropColumn('schedule_frequency'); table.dropColumn('schedule_cron'); table.dropColumn('schedule_timezone'); table.dropColumn('next_scheduled_at'); }); }; ================================================ FILE: wren-ui/migrations/20250423000000_create_dashboard_cache_refresh_table.js ================================================ exports.up = function (knex) { return knex.schema.createTable('dashboard_item_refresh_job', (table) => { table.increments('id').primary(); table.string('hash').notNullable().comment('uuid for the refresh job'); table.integer('dashboard_id').notNullable(); table.integer('dashboard_item_id').notNullable(); table.timestamp('started_at').notNullable(); table.timestamp('finished_at'); table.string('status').notNullable(); // 'success', 'failed', 'in_progress' table.text('error_message'); table.timestamps(true, true); // Foreign keys table .foreign('dashboard_id') .references('id') .inTable('dashboard') .onDelete('CASCADE'); table .foreign('dashboard_item_id') .references('id') .inTable('dashboard_item') .onDelete('CASCADE'); // Indexes table.index(['dashboard_id', 'created_at']); table.index(['dashboard_item_id', 'created_at']); table.index('status'); table.index('hash'); }); }; exports.down = function (knex) { return knex.schema.dropTable('dashboard_item_refresh_job'); }; ================================================ FILE: wren-ui/migrations/20250509000000_create_asking_task.js ================================================ /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.up = function (knex) { return knex.schema.createTable('asking_task', (table) => { table.increments('id').primary(); table.string('query_id').notNullable().unique(); table.text('question'); table.jsonb('detail').defaultTo('{}'); table .integer('thread_id') .references('id') .inTable('thread') .onDelete('CASCADE'); table .integer('thread_response_id') .references('id') .inTable('thread_response') .onDelete('CASCADE'); table.timestamps(true, true); }); }; /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.down = function (knex) { return knex.schema.dropTable('asking_task'); }; ================================================ FILE: wren-ui/migrations/20250509000001_add_task_id_to_thread.js ================================================ /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.up = function (knex) { return knex.schema.alterTable('thread_response', (table) => { table .integer('asking_task_id') .nullable() .references('id') .inTable('asking_task') .onDelete('SET NULL'); }); }; /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.down = function (knex) { return knex.schema.alterTable('thread_response', (table) => { table.dropForeign('asking_task_id'); table.dropColumn('asking_task_id'); }); }; ================================================ FILE: wren-ui/migrations/20250510000000_add_adjustment_to_thread_response.js ================================================ /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.up = function (knex) { return knex.schema.alterTable('thread_response', (table) => { table .jsonb('adjustment') .nullable() .comment( 'Adjustment data for thread response, including type and payload', ); }); }; /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.down = function (knex) { return knex.schema.alterTable('thread_response', (table) => { table.dropColumn('adjustment'); }); }; ================================================ FILE: wren-ui/migrations/20250510000001_alter_dashboard_item_table.js ================================================ /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.up = function (knex) { return knex.schema.alterTable('dashboard_item', (table) => { table .string('display_name') .comment('Display name of the dashboard item') .nullable(); }); }; /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.down = function (knex) { return knex.schema.alterTable('dashboard_item', (table) => { table.dropColumn('display_name'); }); }; ================================================ FILE: wren-ui/migrations/20250510000002_add_version_to_project.js ================================================ /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.up = function (knex) { return knex.schema.alterTable('project', (table) => { table .string('version') .nullable() .comment('data source version information'); }); }; /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.down = function (knex) { return knex.schema.alterTable('project', (table) => { table.dropColumn('version'); }); }; ================================================ FILE: wren-ui/migrations/20250511000000-create-api-history.js ================================================ /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.up = function (knex) { return knex.schema.createTable('api_history', (table) => { table.string('id').primary(); // Project table.integer('project_id').notNullable(); table .foreign('project_id') .references('id') .inTable('project') .onDelete('CASCADE'); // Thread table.string('thread_id'); // API Type table.string('api_type').notNullable(); // Request table.jsonb('headers'); table.jsonb('request_payload'); // Response table.jsonb('response_payload'); // Result table.integer('status_code').notNullable(); table.integer('duration_ms').notNullable(); table.timestamps(true, true); }); }; /** * @param { import("knex").Knex } knex * @returns { Promise } */ exports.down = function (knex) { return knex.schema.dropTable('api_history'); }; ================================================ FILE: wren-ui/next.config.js ================================================ /* eslint-disable @typescript-eslint/no-var-requires */ const path = require('path'); const withLess = require('next-with-less'); const withBundleAnalyzer = require('@next/bundle-analyzer')({ enabled: process.env.ANALYZE === 'true', }); const resolveAlias = { antd$: path.resolve(__dirname, 'src/import/antd'), }; /** @type {import('next').NextConfig} */ const nextConfig = withLess({ output: 'standalone', staticPageGenerationTimeout: 1000, compiler: { // Enables the styled-components SWC transform styledComponents: { displayName: true, ssr: true, }, }, lessLoaderOptions: { additionalData: `@import "@/styles/antd-variables.less";`, }, webpack: (config) => { config.resolve.alias = { ...config.resolve.alias, ...resolveAlias, }; return config; }, // routes redirect async redirects() { return [ { source: '/setup', destination: '/setup/connection', permanent: true, }, ]; }, }); module.exports = withBundleAnalyzer(nextConfig); ================================================ FILE: wren-ui/openapi.yaml ================================================ openapi: 3.0.0 info: title: WrenAI API description: Restful API for interacting with Wren AI version: 1.0.0 servers: - url: /api/v1 description: WrenAI API v1 paths: /generate_sql: post: summary: Generate SQL from natural language description: Converts a natural language question into a SQL query requestBody: required: true content: application/json: schema: type: object required: - question properties: question: type: string description: The natural language question to convert to SQL threadId: type: string description: Optional thread ID to maintain conversation context language: type: string description: Optional language override for AI responses. If not provided, will use the project's default language. Affects error messages and explanation responses. The format is not strictly enforced, but it is recommended to follow the language list in RFC 5646 (check https://gist.github.com/msikma/8912e62ed866778ff8cd for reference). returnSqlDialect: type: boolean description: Whether to return the SQL dialect in the response. If true, the SQL returned will be in the dialect of the database. default: false responses: '200': description: Successfully generated SQL content: application/json: schema: type: object properties: id: type: string description: The unique identifier for the response sql: type: string description: The generated SQL statement threadId: type: string description: ID of the thread (existing or newly created) example: id: "1fbc0d64-1c58-45b2-a990-9183bbbcf913" sql: "SELECT * FROM \"olist_customers_dataset\"" threadId: "9c537507-9cec-46ed-b877-07bfa6322bed" '400': description: Bad request or unable to generate SQL content: application/json: schema: allOf: - $ref: '#/components/schemas/ErrorResponse' - type: object properties: explanationQueryId: type: string description: ID that can be used with the /stream_explanation endpoint to get a detailed explanation for non-SQL queries example: id: "75c13d09-6f86-4e79-a00e-a4f85f73f2d7" code: "NON_SQL_QUERY" error: "User asks about Wren AI's features and capabilities, unrelated to database schema." explanationQueryId: "71b016c5-42bb-4897-82d6-46f9b0bf7d94" /run_sql: post: summary: Execute SQL and return results description: Runs a SQL query and returns the results as structured data requestBody: required: true content: application/json: schema: type: object required: - sql properties: sql: type: string description: The SQL query to execute threadId: type: string description: Optional thread ID for conversation context limit: type: integer description: Maximum number of rows to return default: 1000 responses: '200': description: Successfully executed SQL content: application/json: schema: type: object properties: records: type: array description: Array of records, each represented as an object items: type: object columns: type: array description: Metadata about the result columns items: $ref: '#/components/schemas/ColumnMetadata' threadId: type: string description: ID of the thread (existing or newly created) totalRows: type: integer description: The total number of rows returned example: id: "09d46224-0068-4ca3-bce4-f1fc85093eb6" records: [ { "customer_id": "00012a2ce6f8dcda20d059ce98491703", "customer_unique_id": "248ffe10d632bebe4f7267f1f44844c9", "customer_zip_code_prefix": "06273", "customer_city": "osasco", "customer_state": "SP" }, { "customer_id": "000161a058600d5901f007fab4c27140", "customer_unique_id": "b0015e09bb4b6e47c52844fab5fb6638", "customer_zip_code_prefix": "35550", "customer_city": "itapecerica", "customer_state": "MG" }, "... additional records truncated for brevity ..." ] columns: [ { "name": "customer_id", "type": "VARCHAR" }, { "name": "customer_unique_id", "type": "VARCHAR" }, { "name": "customer_zip_code_prefix", "type": "VARCHAR" }, { "name": "customer_city", "type": "VARCHAR" }, { "name": "customer_state", "type": "VARCHAR" } ] threadId: "503a8ca5-8171-43b5-b45b-86de2849467b" totalRows: 10 '400': description: Bad request or SQL execution error content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '405': description: Method not allowed content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /generate_vega_chart: post: summary: Generate Vega visualization chart spec description: Generates a Vega chart spec for data visualization from a question and SQL query requestBody: required: true content: application/json: schema: type: object required: - question - sql properties: question: type: string description: The natural language question sql: type: string description: The SQL query that produces the data to visualize threadId: type: string description: Optional thread ID for conversation context sampleSize: type: integer description: Maximum number of rows to include in the visualization default: 10000 responses: '200': description: Successfully generated Vega specification content: application/json: schema: type: object properties: vegaSpec: type: object description: The Vega specification with embedded data threadId: type: string description: ID of the thread (existing or newly created) example: threadId: "75ab23c8-9124-4560-a125-fbe7e321dcba" vegaSpec: { "$schema": "https://vega.github.io/schema/vega-lite/v5.json", "config": { "mark": { "tooltip": true }, "font": "Roboto, Arial, Noto Sans, sans-serif", "padding": { "top": 30, "bottom": 20, "left": 0, "right": 0 }, "title": { "color": "#262626", "fontSize": 14 }, "axis": { "labelFontSize": 10, "gridColor": "#d9d9d9", "titleColor": "#434343", "labelColor": "#65676c" }, "axisX": { "labelAngle": -45 }, "bar": { "color": "#1570EF" } }, "title": "Total Payments by Customer State", "data": { "values": [ { "customer_state": "PR", "total_payment_value": 811156.38 }, { "customer_state": "BA", "total_payment_value": 616645.82 } ] }, "mark": { "type": "bar" }, "width": "container", "height": "container", "encoding": { "x": { "field": "customer_state", "type": "nominal", "title": "Customer State" }, "y": { "field": "total_payment_value", "type": "quantitative", "title": "Total Payment Value" }, "color": { "field": "customer_state", "type": "nominal", "title": "Customer State" } } } '400': description: Bad request or specification generation error content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' /stream_explanation: get: summary: Stream an explanation description: Streams an explanation for a non-SQL query using server-sent events parameters: - name: queryId in: query description: The query ID to stream results from required: true schema: type: string responses: '200': description: Stream of explanation events content: text/event-stream: schema: type: string description: Server-sent events stream with explanation chunks example: | data: {"message":"Wren AI is "} data: {"message":"designed to "} data: {"message":"help you analyze "} data: {"message":"your data with "} data: {"message":"natural language queries. I can "} data: {"message":"provide insights about "} data: {"message":"your business data and "} data: {"message":"create visualizations."} data: {"done":true} '500': description: Internal server error components: schemas: ErrorResponse: type: object properties: id: type: string description: Unique identifier for the error response error: type: string description: Error message code: type: string description: Error code ColumnMetadata: type: object properties: name: type: string description: Column name type: type: string description: Data type of the column notNull: type: boolean description: Whether the column allows null values properties: type: object description: Additional column properties ================================================ FILE: wren-ui/package.json ================================================ { "name": "wren-ui", "version": "0.32.2", "private": true, "scripts": { "dev": "TZ=UTC next dev", "build": "NODE_OPTIONS=--max-old-space-size=8192 next build", "start": "TZ=UTC next start", "lint": "yarn check-types && next lint", "test": "jest", "test:e2e": "npx playwright install chromium && npx playwright test", "check-types": "tsc --noEmit", "migrate": "yarn knex migrate:latest", "rollback": "yarn knex migrate:rollback", "generate-gql": "yarn graphql-codegen --config codegen.yaml" }, "dependencies": { "@google-cloud/bigquery": "^6.0.3", "@google-cloud/storage": "^6.10.1", "apollo-server-micro": "^3.10.2", "axios": "^1.12.0", "bcryptjs": "^2.4.3", "better-sqlite3": "^9.4.3", "cron-parser": "^5.1.1", "graphql": "^16.6.0", "graphql-type-json": "^0.3.2", "knex": "^3.1.0", "lodash": "^4.17.23", "log4js": "^6.9.1", "micro": "^9.4.1", "micro-cors": "^0.1.1", "next": "14.2.35", "pg": "^8.8.0", "pg-cursor": "^2.7.4", "posthog-node": "^4.3.2", "sql-formatter": "^15.3.0", "uuid": "^11.1.0" }, "devDependencies": { "@apollo/client": "^3.6.9", "@graphql-codegen/cli": "2.12.0", "@graphql-codegen/introspection": "2.2.1", "@graphql-codegen/near-operation-file-preset": "^2.4.1", "@graphql-codegen/typescript": "2.7.3", "@graphql-codegen/typescript-operations": "^2.5.3", "@graphql-codegen/typescript-react-apollo": "3.3.3", "@next/bundle-analyzer": "^15.3.0", "@playwright/test": "^1.55.2", "@testing-library/react": "14.0.0", "@types/jest": "29.4.4", "@types/lodash": "^4.14.202", "@types/micro-cors": "^0.1.5", "@types/node": "18.16.9", "@types/pg": "^8.6.5", "@types/pg-cursor": "^2.7.0", "@types/react": "18.2.0", "@types/react-dom": "18.2.0", "@types/react-grid-layout": "^1.3.5", "@types/styled-components": "5.1.26", "@typescript-eslint/eslint-plugin": "6.18.0", "@typescript-eslint/parser": "6.18.0", "ace-builds": "^1.32.3", "antd": "4.20.4", "clsx": "^2.1.1", "cron-parser": "^5.1.1", "dayjs": "^1.11.11", "driver.js": "^1.3.1", "duckdb": "^0.10.1", "duckdb-async": "^0.10.0", "eslint": "^8", "eslint-config-next": "14.2.21", "eslint-config-prettier": "^9.1.0", "eslint-plugin-prettier": "^5.1.3", "jest": "29.4.3", "less": "^4.2.0", "less-loader": "^12.2.0", "next-with-less": "^3.0.1", "posthog-js": "^1.205.0", "prettier": "^3.2.5", "react": "18.2.0", "react-ace": "^10.1.0", "react-dom": "18.2.0", "react-grid-layout": "^1.5.0", "react-markdown": "^9.0.1", "reactflow": "11.10.3", "remark-gfm": "^4.0.0", "styled-components": "5.3.6", "styled-icons": "^10.47.0", "ts-essentials": "^9.1.2", "ts-jest": "29.1.1", "ts-node": "9.1.1", "typescript": "5.2.2", "vega": "^6.2.0", "vega-embed": "^6.29.0", "vega-lite": "^6.2.0" }, "resolutions": { "ws": "8.17.1", "axios": "1.12.0", "tar-fs": "2.1.4", "tmp": "0.2.4", "glob": "10.5.0", "js-yaml": "4.1.1", "jws": "4.0.1", "tar": "7.5.7", "vega-selections": "6.1.2", "vega-functions": "6.1.1", "fast-xml-parser": "4.5.4", "lodash": "4.17.23" }, "_moduleAliases": { "@server": "src/apollo/server" }, "packageManager": "yarn@4.5.3" } ================================================ FILE: wren-ui/playwright.config.ts ================================================ import { defineConfig, devices } from '@playwright/test'; export default defineConfig({ // Look for test files in the "tests" directory, relative to this configuration file. testDir: 'e2e', // Each test is given 60 seconds. timeout: 1 * 60 * 1000, // Fail the build on CI if you accidentally left test.only in the source code. forbidOnly: false, // Retry on CI only. retries: 0, // Opt out of parallel tests on CI. workers: 1, // Reporter to use reporter: 'html', use: { // Base URL to use in actions like `await page.goto('/')`. baseURL: 'http://127.0.0.1:3000', // Collect trace when retrying the failed test. trace: 'on-first-retry', }, // Configure projects for major browsers. projects: [ { name: 'setup db', testMatch: /global\.setup\.ts/, teardown: 'cleanup db', }, { name: 'cleanup db', testMatch: /global\.teardown\.ts/, }, { name: 'chromium', use: { ...devices['Desktop Chrome'] }, dependencies: ['setup db'], }, ], // Run your local dev server before starting the tests. webServer: { command: 'NODE_ENV=test yarn start -p 3000', url: 'http://127.0.0.1:3000', reuseExistingServer: true, }, }); ================================================ FILE: wren-ui/src/apollo/client/graphql/__types__.ts ================================================ import { gql } from '@apollo/client'; export type Maybe = T | null; export type InputMaybe = Maybe; export type Exact = { [K in keyof T]: T[K] }; export type MakeOptional = Omit & { [SubKey in K]?: Maybe }; export type MakeMaybe = Omit & { [SubKey in K]: Maybe }; /** All built-in and custom scalars, mapped to their actual values */ export type Scalars = { ID: string; String: string; Boolean: boolean; Int: number; Float: number; DialectSQL: any; JSON: any; }; export type AdjustThreadResponseChartInput = { chartType: ChartType; color?: InputMaybe; theta?: InputMaybe; xAxis?: InputMaybe; xOffset?: InputMaybe; yAxis?: InputMaybe; }; export type AdjustThreadResponseInput = { sql?: InputMaybe; sqlGenerationReasoning?: InputMaybe; tables?: InputMaybe>; }; export type AdjustmentTask = { __typename?: 'AdjustmentTask'; error?: Maybe; invalidSql?: Maybe; queryId?: Maybe; sql?: Maybe; status?: Maybe; traceId?: Maybe; }; export type ApiHistoryFilterInput = { apiType?: InputMaybe; endDate?: InputMaybe; projectId?: InputMaybe; startDate?: InputMaybe; statusCode?: InputMaybe; threadId?: InputMaybe; }; export type ApiHistoryPaginatedResponse = { __typename?: 'ApiHistoryPaginatedResponse'; hasMore: Scalars['Boolean']; items: Array; total: Scalars['Int']; }; export type ApiHistoryPaginationInput = { limit: Scalars['Int']; offset: Scalars['Int']; }; export type ApiHistoryResponse = { __typename?: 'ApiHistoryResponse'; apiType: ApiType; createdAt: Scalars['String']; durationMs?: Maybe; headers?: Maybe; id: Scalars['String']; projectId: Scalars['Int']; requestPayload?: Maybe; responsePayload?: Maybe; statusCode?: Maybe; threadId?: Maybe; updatedAt: Scalars['String']; }; export enum ApiType { ASK = 'ASK', CREATE_INSTRUCTION = 'CREATE_INSTRUCTION', CREATE_SQL_PAIR = 'CREATE_SQL_PAIR', DELETE_INSTRUCTION = 'DELETE_INSTRUCTION', DELETE_SQL_PAIR = 'DELETE_SQL_PAIR', GENERATE_SQL = 'GENERATE_SQL', GENERATE_SUMMARY = 'GENERATE_SUMMARY', GENERATE_VEGA_CHART = 'GENERATE_VEGA_CHART', GET_INSTRUCTIONS = 'GET_INSTRUCTIONS', GET_MODELS = 'GET_MODELS', GET_SQL_PAIRS = 'GET_SQL_PAIRS', RUN_SQL = 'RUN_SQL', STREAM_ASK = 'STREAM_ASK', STREAM_GENERATE_SQL = 'STREAM_GENERATE_SQL', UPDATE_INSTRUCTION = 'UPDATE_INSTRUCTION', UPDATE_SQL_PAIR = 'UPDATE_SQL_PAIR' } export type AskingTask = { __typename?: 'AskingTask'; candidates: Array; error?: Maybe; intentReasoning?: Maybe; invalidSql?: Maybe; queryId?: Maybe; rephrasedQuestion?: Maybe; retrievedTables?: Maybe>; sqlGenerationReasoning?: Maybe; status: AskingTaskStatus; traceId?: Maybe; type?: Maybe; }; export type AskingTaskInput = { question: Scalars['String']; threadId?: InputMaybe; }; export enum AskingTaskStatus { CORRECTING = 'CORRECTING', FAILED = 'FAILED', FINISHED = 'FINISHED', GENERATING = 'GENERATING', PLANNING = 'PLANNING', SEARCHING = 'SEARCHING', STOPPED = 'STOPPED', UNDERSTANDING = 'UNDERSTANDING' } export enum AskingTaskType { GENERAL = 'GENERAL', MISLEADING_QUERY = 'MISLEADING_QUERY', TEXT_TO_SQL = 'TEXT_TO_SQL' } export enum CacheScheduleDayEnum { FRI = 'FRI', MON = 'MON', SAT = 'SAT', SUN = 'SUN', THU = 'THU', TUE = 'TUE', WED = 'WED' } export type CalculatedFieldInput = { diagram?: InputMaybe; expression: Scalars['String']; lineage: Array; name: Scalars['String']; }; export type CalculatedFieldValidationResponse = { __typename?: 'CalculatedFieldValidationResponse'; message?: Maybe; valid: Scalars['Boolean']; }; export enum ChartTaskStatus { FAILED = 'FAILED', FETCHING = 'FETCHING', FINISHED = 'FINISHED', GENERATING = 'GENERATING', STOPPED = 'STOPPED' } export enum ChartType { AREA = 'AREA', BAR = 'BAR', GROUPED_BAR = 'GROUPED_BAR', LINE = 'LINE', MULTI_LINE = 'MULTI_LINE', PIE = 'PIE', STACKED_BAR = 'STACKED_BAR' } export type CompactColumn = { __typename?: 'CompactColumn'; name: Scalars['String']; properties?: Maybe; type: Scalars['String']; }; export type CompactTable = { __typename?: 'CompactTable'; columns: Array; name: Scalars['String']; properties?: Maybe; }; export type CreateCalculatedFieldInput = { expression: ExpressionName; lineage: Array; modelId: Scalars['Int']; name: Scalars['String']; }; export type CreateDashboardItemInput = { itemType: DashboardItemType; responseId: Scalars['Int']; }; export type CreateInstructionInput = { instruction: Scalars['String']; isDefault: Scalars['Boolean']; questions: Array; }; export type CreateModelInput = { fields: Array; primaryKey?: InputMaybe; sourceTableName: Scalars['String']; }; export type CreateSimpleMetricInput = { cached: Scalars['Boolean']; description?: InputMaybe; dimension: Array; displayName: Scalars['String']; measure: Array; model: Scalars['String']; name: Scalars['String']; properties: Scalars['JSON']; refreshTime?: InputMaybe; timeGrain: Array; }; export type CreateSqlPairInput = { question: Scalars['String']; sql: Scalars['String']; }; export type CreateThreadInput = { question?: InputMaybe; sql?: InputMaybe; taskId?: InputMaybe; }; export type CreateThreadResponseInput = { question?: InputMaybe; sql?: InputMaybe; taskId?: InputMaybe; }; export type CreateViewInput = { name: Scalars['String']; rephrasedQuestion: Scalars['String']; responseId: Scalars['Int']; }; export type CustomFieldInput = { expression: Scalars['String']; name: Scalars['String']; }; export type Dashboard = { __typename?: 'Dashboard'; cacheEnabled: Scalars['Boolean']; id: Scalars['Int']; name: Scalars['String']; nextScheduledAt?: Maybe; projectId: Scalars['Int']; scheduleCron?: Maybe; scheduleFrequency?: Maybe; scheduleTimezone?: Maybe; }; export type DashboardItem = { __typename?: 'DashboardItem'; dashboardId: Scalars['Int']; detail: DashboardItemDetail; displayName?: Maybe; id: Scalars['Int']; layout: DashboardItemLayout; type: DashboardItemType; }; export type DashboardItemDetail = { __typename?: 'DashboardItemDetail'; chartSchema?: Maybe; sql: Scalars['String']; }; export type DashboardItemLayout = { __typename?: 'DashboardItemLayout'; h: Scalars['Int']; w: Scalars['Int']; x: Scalars['Int']; y: Scalars['Int']; }; export enum DashboardItemType { AREA = 'AREA', BAR = 'BAR', GROUPED_BAR = 'GROUPED_BAR', LINE = 'LINE', MULTI_LINE = 'MULTI_LINE', NUMBER = 'NUMBER', PIE = 'PIE', STACKED_BAR = 'STACKED_BAR', TABLE = 'TABLE' } export type DashboardItemWhereInput = { id: Scalars['Int']; }; export type DashboardSchedule = { __typename?: 'DashboardSchedule'; cron?: Maybe; day?: Maybe; frequency?: Maybe; hour?: Maybe; minute?: Maybe; timezone?: Maybe; }; export type DataSource = { __typename?: 'DataSource'; properties: Scalars['JSON']; sampleDataset?: Maybe; type: DataSourceName; }; export type DataSourceInput = { properties: Scalars['JSON']; type: DataSourceName; }; export enum DataSourceName { ATHENA = 'ATHENA', BIG_QUERY = 'BIG_QUERY', CLICK_HOUSE = 'CLICK_HOUSE', DATABRICKS = 'DATABRICKS', DUCKDB = 'DUCKDB', MSSQL = 'MSSQL', MYSQL = 'MYSQL', ORACLE = 'ORACLE', POSTGRES = 'POSTGRES', REDSHIFT = 'REDSHIFT', SNOWFLAKE = 'SNOWFLAKE', TRINO = 'TRINO' } export enum DatabricksConnectionType { service_principal = 'service_principal', token = 'token' } export type DeleteDashboardItemInput = { itemId: Scalars['Int']; }; export type DetailStep = { __typename?: 'DetailStep'; cteName?: Maybe; sql: Scalars['String']; summary: Scalars['String']; }; export type DetailedAffectedCalculatedFields = { __typename?: 'DetailedAffectedCalculatedFields'; displayName: Scalars['String']; referenceName: Scalars['String']; type: Scalars['String']; }; export type DetailedAffectedRelationships = { __typename?: 'DetailedAffectedRelationships'; displayName: Scalars['String']; referenceName: Scalars['String']; }; export type DetailedChangeColumn = { __typename?: 'DetailedChangeColumn'; displayName: Scalars['String']; sourceColumnName: Scalars['String']; type: Scalars['String']; }; export type DetailedChangeTable = { __typename?: 'DetailedChangeTable'; calculatedFields: Array; columns: Array; displayName: Scalars['String']; relationships: Array; sourceTableName: Scalars['String']; }; export type DetailedColumn = { __typename?: 'DetailedColumn'; displayName: Scalars['String']; isCalculated: Scalars['Boolean']; nestedColumns?: Maybe>; notNull: Scalars['Boolean']; properties: Scalars['JSON']; referenceName: Scalars['String']; sourceColumnName: Scalars['String']; type?: Maybe; }; export type DetailedDashboard = { __typename?: 'DetailedDashboard'; cacheEnabled: Scalars['Boolean']; description?: Maybe; id: Scalars['Int']; items: Array; name: Scalars['String']; nextScheduledAt?: Maybe; schedule?: Maybe; }; export type DetailedModel = { __typename?: 'DetailedModel'; cached: Scalars['Boolean']; calculatedFields?: Maybe>>; description?: Maybe; displayName: Scalars['String']; fields?: Maybe>>; primaryKey?: Maybe; properties: Scalars['JSON']; refSql: Scalars['String']; referenceName: Scalars['String']; refreshTime?: Maybe; relations?: Maybe>>; sourceTableName: Scalars['String']; }; export type DetailedNestedColumn = { __typename?: 'DetailedNestedColumn'; columnPath: Array; displayName: Scalars['String']; id: Scalars['Int']; properties?: Maybe; referenceName: Scalars['String']; sourceColumnName: Scalars['String']; type?: Maybe; }; export type DetailedRelation = { __typename?: 'DetailedRelation'; fromColumnId: Scalars['Int']; fromModelId: Scalars['Int']; name: Scalars['String']; properties: Scalars['JSON']; toColumnId: Scalars['Int']; toModelId: Scalars['Int']; type: RelationType; }; export type DetailedThread = { __typename?: 'DetailedThread'; id: Scalars['Int']; responses: Array; }; export type Diagram = { __typename?: 'Diagram'; models: Array>; views: Array>; }; export type DiagramModel = { __typename?: 'DiagramModel'; cached: Scalars['Boolean']; calculatedFields: Array>; description?: Maybe; displayName: Scalars['String']; fields: Array>; id: Scalars['String']; modelId: Scalars['Int']; nodeType: NodeType; refSql?: Maybe; referenceName: Scalars['String']; refreshTime?: Maybe; relationFields: Array>; sourceTableName: Scalars['String']; }; export type DiagramModelField = { __typename?: 'DiagramModelField'; aggregation?: Maybe; columnId: Scalars['Int']; description?: Maybe; displayName: Scalars['String']; expression?: Maybe; id: Scalars['String']; isPrimaryKey: Scalars['Boolean']; lineage?: Maybe>; nestedFields?: Maybe>; nodeType: NodeType; referenceName: Scalars['String']; type: Scalars['String']; }; export type DiagramModelNestedField = { __typename?: 'DiagramModelNestedField'; columnPath: Array; description?: Maybe; displayName: Scalars['String']; id: Scalars['String']; nestedColumnId: Scalars['Int']; referenceName: Scalars['String']; type: Scalars['String']; }; export type DiagramModelRelationField = { __typename?: 'DiagramModelRelationField'; description?: Maybe; displayName: Scalars['String']; fromColumnDisplayName: Scalars['String']; fromColumnId: Scalars['Int']; fromColumnName: Scalars['String']; fromModelDisplayName: Scalars['String']; fromModelId: Scalars['Int']; fromModelName: Scalars['String']; id: Scalars['String']; nodeType: NodeType; referenceName: Scalars['String']; relationId: Scalars['Int']; toColumnDisplayName: Scalars['String']; toColumnId: Scalars['Int']; toColumnName: Scalars['String']; toModelDisplayName: Scalars['String']; toModelId: Scalars['Int']; toModelName: Scalars['String']; type: RelationType; }; export type DiagramView = { __typename?: 'DiagramView'; description?: Maybe; displayName: Scalars['String']; fields: Array>; id: Scalars['String']; nodeType: NodeType; referenceName: Scalars['String']; statement: Scalars['String']; viewId: Scalars['Int']; }; export type DiagramViewField = { __typename?: 'DiagramViewField'; description?: Maybe; displayName: Scalars['String']; id: Scalars['String']; nodeType: NodeType; referenceName: Scalars['String']; type: Scalars['String']; }; export type DimensionInput = { isCalculated: Scalars['Boolean']; name: Scalars['String']; notNull: Scalars['Boolean']; properties: Scalars['JSON']; type: Scalars['String']; }; export type Error = { __typename?: 'Error'; code?: Maybe; message?: Maybe; shortMessage?: Maybe; stacktrace?: Maybe>>; }; export enum ExpressionName { ABS = 'ABS', AVG = 'AVG', CBRT = 'CBRT', CEIL = 'CEIL', CEILING = 'CEILING', COUNT = 'COUNT', COUNT_IF = 'COUNT_IF', EXP = 'EXP', FLOOR = 'FLOOR', LENGTH = 'LENGTH', LN = 'LN', LOG10 = 'LOG10', MAX = 'MAX', MIN = 'MIN', REVERSE = 'REVERSE', ROUND = 'ROUND', SIGN = 'SIGN', SUM = 'SUM' } export type FieldInfo = { __typename?: 'FieldInfo'; displayName: Scalars['String']; expression?: Maybe; id: Scalars['Int']; isCalculated: Scalars['Boolean']; nestedColumns?: Maybe>; notNull: Scalars['Boolean']; properties?: Maybe; referenceName: Scalars['String']; sourceColumnName: Scalars['String']; type?: Maybe; }; export type GenerateQuestionInput = { sql: Scalars['String']; }; export type GetMdlResult = { __typename?: 'GetMDLResult'; hash: Scalars['String']; mdl?: Maybe; }; export type InstantRecommendedQuestionsInput = { previousQuestions?: InputMaybe>; }; export type Instruction = { __typename?: 'Instruction'; createdAt: Scalars['String']; id: Scalars['Int']; instruction: Scalars['String']; isDefault: Scalars['Boolean']; projectId: Scalars['Int']; questions: Array; updatedAt: Scalars['String']; }; export type InstructionWhereInput = { id: Scalars['Int']; }; export type ItemLayoutInput = { h: Scalars['Int']; itemId: Scalars['Int']; w: Scalars['Int']; x: Scalars['Int']; y: Scalars['Int']; }; export type LearningRecord = { __typename?: 'LearningRecord'; paths: Array; }; export type MdlModelSubmitInput = { columns: Array; name: Scalars['String']; }; export type ModelInfo = { __typename?: 'ModelInfo'; cached: Scalars['Boolean']; calculatedFields: Array>; description?: Maybe; displayName: Scalars['String']; fields: Array>; id: Scalars['Int']; primaryKey?: Maybe; properties?: Maybe; refSql?: Maybe; referenceName: Scalars['String']; refreshTime?: Maybe; sourceTableName: Scalars['String']; }; export type ModelSubstituteInput = { sql: Scalars['DialectSQL']; }; export type ModelSyncResponse = { __typename?: 'ModelSyncResponse'; status: SyncStatus; }; export type ModelWhereInput = { id: Scalars['Int']; }; export type Mutation = { __typename?: 'Mutation'; adjustThreadResponse: ThreadResponse; adjustThreadResponseChart: ThreadResponse; cancelAdjustmentTask: Scalars['Boolean']; cancelAskingTask: Scalars['Boolean']; createAskingTask: Task; createCalculatedField: Scalars['JSON']; createDashboardItem: DashboardItem; createInstantRecommendedQuestions: Task; createInstruction: Instruction; createModel: Scalars['JSON']; createRelation: Scalars['JSON']; createSqlPair: SqlPair; createThread: Thread; createThreadResponse: ThreadResponse; createView: ViewInfo; deleteCalculatedField: Scalars['Boolean']; deleteDashboardItem: Scalars['Boolean']; deleteInstruction: Scalars['Boolean']; deleteModel: Scalars['Boolean']; deleteRelation: Scalars['Boolean']; deleteSqlPair: Scalars['Boolean']; deleteThread: Scalars['Boolean']; deleteView: Scalars['Boolean']; deploy: Scalars['JSON']; generateProjectRecommendationQuestions: Scalars['Boolean']; generateQuestion: Scalars['String']; generateThreadRecommendationQuestions: Scalars['Boolean']; generateThreadResponseAnswer: ThreadResponse; generateThreadResponseBreakdown: ThreadResponse; generateThreadResponseChart: ThreadResponse; modelSubstitute: Scalars['String']; previewBreakdownData: Scalars['JSON']; previewData: Scalars['JSON']; previewItemSQL: PreviewItemResponse; previewModelData: Scalars['JSON']; previewSql: Scalars['JSON']; previewViewData: Scalars['JSON']; rerunAdjustmentTask: Scalars['Boolean']; rerunAskingTask: Task; resetCurrentProject: Scalars['Boolean']; resolveSchemaChange: Scalars['Boolean']; saveDataSource: DataSource; saveLearningRecord: LearningRecord; saveRelations: Scalars['JSON']; saveTables: Scalars['JSON']; setDashboardSchedule: Dashboard; startSampleDataset: Scalars['JSON']; triggerDataSourceDetection: Scalars['Boolean']; updateCalculatedField: Scalars['JSON']; updateCurrentProject: Scalars['Boolean']; updateDashboardItem: DashboardItem; updateDashboardItemLayouts: Array; updateDataSource: DataSource; updateInstruction: Instruction; updateModel: Scalars['JSON']; updateModelMetadata: Scalars['Boolean']; updateRelation: Scalars['JSON']; updateSqlPair: SqlPair; updateThread: Thread; updateThreadResponse: ThreadResponse; updateViewMetadata: Scalars['Boolean']; validateCalculatedField: CalculatedFieldValidationResponse; validateView: ViewValidationResponse; }; export type MutationAdjustThreadResponseArgs = { data: AdjustThreadResponseInput; responseId: Scalars['Int']; }; export type MutationAdjustThreadResponseChartArgs = { data: AdjustThreadResponseChartInput; responseId: Scalars['Int']; }; export type MutationCancelAdjustmentTaskArgs = { taskId: Scalars['String']; }; export type MutationCancelAskingTaskArgs = { taskId: Scalars['String']; }; export type MutationCreateAskingTaskArgs = { data: AskingTaskInput; }; export type MutationCreateCalculatedFieldArgs = { data: CreateCalculatedFieldInput; }; export type MutationCreateDashboardItemArgs = { data: CreateDashboardItemInput; }; export type MutationCreateInstantRecommendedQuestionsArgs = { data: InstantRecommendedQuestionsInput; }; export type MutationCreateInstructionArgs = { data: CreateInstructionInput; }; export type MutationCreateModelArgs = { data: CreateModelInput; }; export type MutationCreateRelationArgs = { data: RelationInput; }; export type MutationCreateSqlPairArgs = { data: CreateSqlPairInput; }; export type MutationCreateThreadArgs = { data: CreateThreadInput; }; export type MutationCreateThreadResponseArgs = { data: CreateThreadResponseInput; threadId: Scalars['Int']; }; export type MutationCreateViewArgs = { data: CreateViewInput; }; export type MutationDeleteCalculatedFieldArgs = { where?: InputMaybe; }; export type MutationDeleteDashboardItemArgs = { where: DashboardItemWhereInput; }; export type MutationDeleteInstructionArgs = { where: InstructionWhereInput; }; export type MutationDeleteModelArgs = { where: ModelWhereInput; }; export type MutationDeleteRelationArgs = { where: WhereIdInput; }; export type MutationDeleteSqlPairArgs = { where: SqlPairWhereUniqueInput; }; export type MutationDeleteThreadArgs = { where: ThreadUniqueWhereInput; }; export type MutationDeleteViewArgs = { where: ViewWhereUniqueInput; }; export type MutationDeployArgs = { force?: InputMaybe; }; export type MutationGenerateQuestionArgs = { data: GenerateQuestionInput; }; export type MutationGenerateThreadRecommendationQuestionsArgs = { threadId: Scalars['Int']; }; export type MutationGenerateThreadResponseAnswerArgs = { responseId: Scalars['Int']; }; export type MutationGenerateThreadResponseBreakdownArgs = { responseId: Scalars['Int']; }; export type MutationGenerateThreadResponseChartArgs = { responseId: Scalars['Int']; }; export type MutationModelSubstituteArgs = { data: ModelSubstituteInput; }; export type MutationPreviewBreakdownDataArgs = { where: PreviewDataInput; }; export type MutationPreviewDataArgs = { where: PreviewDataInput; }; export type MutationPreviewItemSqlArgs = { data: PreviewItemSqlInput; }; export type MutationPreviewModelDataArgs = { where: WhereIdInput; }; export type MutationPreviewSqlArgs = { data?: InputMaybe; }; export type MutationPreviewViewDataArgs = { where: PreviewViewDataInput; }; export type MutationRerunAdjustmentTaskArgs = { responseId: Scalars['Int']; }; export type MutationRerunAskingTaskArgs = { responseId: Scalars['Int']; }; export type MutationResolveSchemaChangeArgs = { where: ResolveSchemaChangeWhereInput; }; export type MutationSaveDataSourceArgs = { data: DataSourceInput; }; export type MutationSaveLearningRecordArgs = { data: SaveLearningRecordInput; }; export type MutationSaveRelationsArgs = { data: SaveRelationInput; }; export type MutationSaveTablesArgs = { data: SaveTablesInput; }; export type MutationSetDashboardScheduleArgs = { data: SetDashboardScheduleInput; }; export type MutationStartSampleDatasetArgs = { data: SampleDatasetInput; }; export type MutationUpdateCalculatedFieldArgs = { data: UpdateCalculatedFieldInput; where: UpdateCalculatedFieldWhere; }; export type MutationUpdateCurrentProjectArgs = { data: UpdateCurrentProjectInput; }; export type MutationUpdateDashboardItemArgs = { data: UpdateDashboardItemInput; where: DashboardItemWhereInput; }; export type MutationUpdateDashboardItemLayoutsArgs = { data: UpdateDashboardItemLayoutsInput; }; export type MutationUpdateDataSourceArgs = { data: UpdateDataSourceInput; }; export type MutationUpdateInstructionArgs = { data: UpdateInstructionInput; where: InstructionWhereInput; }; export type MutationUpdateModelArgs = { data: UpdateModelInput; where: ModelWhereInput; }; export type MutationUpdateModelMetadataArgs = { data: UpdateModelMetadataInput; where: ModelWhereInput; }; export type MutationUpdateRelationArgs = { data: UpdateRelationInput; where: WhereIdInput; }; export type MutationUpdateSqlPairArgs = { data: UpdateSqlPairInput; where: SqlPairWhereUniqueInput; }; export type MutationUpdateThreadArgs = { data: UpdateThreadInput; where: ThreadUniqueWhereInput; }; export type MutationUpdateThreadResponseArgs = { data: UpdateThreadResponseInput; where: ThreadResponseUniqueWhereInput; }; export type MutationUpdateViewMetadataArgs = { data: UpdateViewMetadataInput; where: ViewWhereUniqueInput; }; export type MutationValidateCalculatedFieldArgs = { data: ValidateCalculatedFieldInput; }; export type MutationValidateViewArgs = { data: ValidateViewInput; }; export type NestedFieldInfo = { __typename?: 'NestedFieldInfo'; columnPath: Array; displayName: Scalars['String']; id: Scalars['Int']; properties: Scalars['JSON']; referenceName: Scalars['String']; sourceColumnName: Scalars['String']; type: Scalars['String']; }; export enum NodeType { CALCULATED_FIELD = 'CALCULATED_FIELD', FIELD = 'FIELD', METRIC = 'METRIC', MODEL = 'MODEL', RELATION = 'RELATION', VIEW = 'VIEW' } export enum OnboardingStatus { DATASOURCE_SAVED = 'DATASOURCE_SAVED', NOT_STARTED = 'NOT_STARTED', ONBOARDING_FINISHED = 'ONBOARDING_FINISHED', WITH_SAMPLE_DATASET = 'WITH_SAMPLE_DATASET' } export type OnboardingStatusResponse = { __typename?: 'OnboardingStatusResponse'; status?: Maybe; }; export type PreviewDataInput = { limit?: InputMaybe; responseId: Scalars['Int']; stepIndex?: InputMaybe; }; export type PreviewItemResponse = { __typename?: 'PreviewItemResponse'; cacheCreatedAt?: Maybe; cacheHit: Scalars['Boolean']; cacheOverrodeAt?: Maybe; data: Scalars['JSON']; override: Scalars['Boolean']; }; export type PreviewItemSqlInput = { itemId: Scalars['Int']; limit?: InputMaybe; refresh?: InputMaybe; }; export type PreviewSqlDataInput = { dryRun?: InputMaybe; limit?: InputMaybe; projectId?: InputMaybe; sql: Scalars['String']; }; export type PreviewViewDataInput = { id: Scalars['Int']; limit?: InputMaybe; }; export enum ProjectLanguage { AR = 'AR', AZ_AZ = 'AZ_AZ', DE = 'DE', EN = 'EN', ES = 'ES', FA_IR = 'FA_IR', FR = 'FR', IT = 'IT', JA = 'JA', KO = 'KO', NL = 'NL', PT = 'PT', RU = 'RU', TR = 'TR', ZH_CN = 'ZH_CN', ZH_TW = 'ZH_TW' } export type Query = { __typename?: 'Query'; adjustmentTask?: Maybe; apiHistory: ApiHistoryPaginatedResponse; askingTask?: Maybe; autoGenerateRelation: Array; dashboard: DetailedDashboard; dashboardItems: Array; diagram: Diagram; getMDL: GetMdlResult; getProjectRecommendationQuestions: RecommendedQuestionsTask; getThreadRecommendationQuestions: RecommendedQuestionsTask; instantRecommendedQuestions: RecommendedQuestionsTask; instructions: Array>; learningRecord: LearningRecord; listDataSourceTables: Array; listModels: Array; listViews: Array; model: DetailedModel; modelSync: ModelSyncResponse; nativeSql: Scalars['String']; onboardingStatus: OnboardingStatusResponse; schemaChange: SchemaChange; settings: Settings; sqlPairs: Array>; suggestedQuestions: SuggestedQuestionResponse; thread: DetailedThread; threadResponse: ThreadResponse; threads: Array; view: ViewInfo; }; export type QueryAdjustmentTaskArgs = { taskId: Scalars['String']; }; export type QueryApiHistoryArgs = { filter?: InputMaybe; pagination: ApiHistoryPaginationInput; }; export type QueryAskingTaskArgs = { taskId: Scalars['String']; }; export type QueryGetMdlArgs = { hash: Scalars['String']; }; export type QueryGetThreadRecommendationQuestionsArgs = { threadId: Scalars['Int']; }; export type QueryInstantRecommendedQuestionsArgs = { taskId: Scalars['String']; }; export type QueryModelArgs = { where: ModelWhereInput; }; export type QueryNativeSqlArgs = { responseId: Scalars['Int']; }; export type QueryThreadArgs = { threadId: Scalars['Int']; }; export type QueryThreadResponseArgs = { responseId: Scalars['Int']; }; export type QueryViewArgs = { where: ViewWhereUniqueInput; }; export type RecommendRelations = { __typename?: 'RecommendRelations'; displayName: Scalars['String']; id: Scalars['Int']; referenceName: Scalars['String']; relations: Array>; }; export type RecommendedQuestionsTask = { __typename?: 'RecommendedQuestionsTask'; error?: Maybe; questions: Array; status: RecommendedQuestionsTaskStatus; }; export enum RecommendedQuestionsTaskStatus { FAILED = 'FAILED', FINISHED = 'FINISHED', GENERATING = 'GENERATING', NOT_STARTED = 'NOT_STARTED' } export enum RedshiftConnectionType { redshift = 'redshift', redshift_iam = 'redshift_iam' } export type Relation = { __typename?: 'Relation'; fromColumnId: Scalars['Int']; fromColumnReferenceName: Scalars['String']; fromModelId: Scalars['Int']; fromModelReferenceName: Scalars['String']; name: Scalars['String']; toColumnId: Scalars['Int']; toColumnReferenceName: Scalars['String']; toModelId: Scalars['Int']; toModelReferenceName: Scalars['String']; type: RelationType; }; export type RelationInput = { fromColumnId: Scalars['Int']; fromModelId: Scalars['Int']; toColumnId: Scalars['Int']; toModelId: Scalars['Int']; type: RelationType; }; export enum RelationType { MANY_TO_ONE = 'MANY_TO_ONE', ONE_TO_MANY = 'ONE_TO_MANY', ONE_TO_ONE = 'ONE_TO_ONE' } export type ResolveSchemaChangeWhereInput = { type: SchemaChangeType; }; export type ResultCandidate = { __typename?: 'ResultCandidate'; sql: Scalars['String']; sqlPair?: Maybe; type: ResultCandidateType; view?: Maybe; }; export enum ResultCandidateType { LLM = 'LLM', SQL_PAIR = 'SQL_PAIR', VIEW = 'VIEW' } export type ResultQuestion = { __typename?: 'ResultQuestion'; category: Scalars['String']; question: Scalars['String']; sql: Scalars['String']; }; export type SampleDatasetInput = { name: SampleDatasetName; }; export enum SampleDatasetName { ECOMMERCE = 'ECOMMERCE', HR = 'HR', MUSIC = 'MUSIC', NBA = 'NBA' } export type SaveLearningRecordInput = { path: Scalars['String']; }; export type SaveRelationInput = { relations: Array>; }; export type SaveTablesInput = { tables: Array; }; export enum ScheduleFrequencyEnum { CUSTOM = 'CUSTOM', DAILY = 'DAILY', NEVER = 'NEVER', WEEKLY = 'WEEKLY' } export type SchemaChange = { __typename?: 'SchemaChange'; deletedColumns?: Maybe>; deletedTables?: Maybe>; lastSchemaChangeTime?: Maybe; modifiedColumns?: Maybe>; }; export enum SchemaChangeType { DELETED_COLUMNS = 'DELETED_COLUMNS', DELETED_TABLES = 'DELETED_TABLES', MODIFIED_COLUMNS = 'MODIFIED_COLUMNS' } export type SetDashboardScheduleData = { cron?: InputMaybe; day?: InputMaybe; frequency: ScheduleFrequencyEnum; hour?: InputMaybe; minute?: InputMaybe; timezone?: InputMaybe; }; export type SetDashboardScheduleInput = { cacheEnabled: Scalars['Boolean']; schedule?: InputMaybe; }; export type Settings = { __typename?: 'Settings'; dataSource: DataSource; language: ProjectLanguage; productVersion: Scalars['String']; }; export type SimpleMeasureInput = { isCalculated: Scalars['Boolean']; name: Scalars['String']; notNull: Scalars['Boolean']; properties: Scalars['JSON']; type: Scalars['String']; }; export type SqlPair = { __typename?: 'SqlPair'; createdAt?: Maybe; id: Scalars['Int']; projectId: Scalars['Int']; question: Scalars['String']; sql: Scalars['String']; updatedAt?: Maybe; }; export type SqlPairWhereUniqueInput = { id: Scalars['Int']; }; export type SuggestedQuestion = { __typename?: 'SuggestedQuestion'; label: Scalars['String']; question: Scalars['String']; }; export type SuggestedQuestionResponse = { __typename?: 'SuggestedQuestionResponse'; questions: Array>; }; export enum SyncStatus { IN_PROGRESS = 'IN_PROGRESS', SYNCRONIZED = 'SYNCRONIZED', UNSYNCRONIZED = 'UNSYNCRONIZED' } export type Task = { __typename?: 'Task'; id: Scalars['String']; }; export type Thread = { __typename?: 'Thread'; id: Scalars['Int']; summary: Scalars['String']; }; export type ThreadResponse = { __typename?: 'ThreadResponse'; adjustment?: Maybe; adjustmentTask?: Maybe; answerDetail?: Maybe; askingTask?: Maybe; breakdownDetail?: Maybe; chartDetail?: Maybe; id: Scalars['Int']; question: Scalars['String']; sql?: Maybe; threadId: Scalars['Int']; view?: Maybe; }; export type ThreadResponseAdjustment = { __typename?: 'ThreadResponseAdjustment'; payload?: Maybe; type: ThreadResponseAdjustmentType; }; export enum ThreadResponseAdjustmentType { APPLY_SQL = 'APPLY_SQL', REASONING = 'REASONING' } export type ThreadResponseAnswerDetail = { __typename?: 'ThreadResponseAnswerDetail'; content?: Maybe; error?: Maybe; numRowsUsedInLLM?: Maybe; queryId?: Maybe; status?: Maybe; }; export enum ThreadResponseAnswerStatus { FAILED = 'FAILED', FETCHING_DATA = 'FETCHING_DATA', FINISHED = 'FINISHED', INTERRUPTED = 'INTERRUPTED', NOT_STARTED = 'NOT_STARTED', PREPROCESSING = 'PREPROCESSING', STREAMING = 'STREAMING' } export type ThreadResponseBreakdownDetail = { __typename?: 'ThreadResponseBreakdownDetail'; description?: Maybe; error?: Maybe; queryId?: Maybe; status: AskingTaskStatus; steps?: Maybe>; }; export type ThreadResponseChartDetail = { __typename?: 'ThreadResponseChartDetail'; adjustment?: Maybe; chartSchema?: Maybe; chartType?: Maybe; description?: Maybe; error?: Maybe; queryId?: Maybe; status: ChartTaskStatus; }; export type ThreadResponseUniqueWhereInput = { id: Scalars['Int']; }; export type ThreadUniqueWhereInput = { id: Scalars['Int']; }; export type TimeGrainInput = { dateParts: Array; name: Scalars['String']; refColumn: Scalars['String']; }; export type UpdateCalculatedFieldInput = { expression: ExpressionName; lineage: Array; name: Scalars['String']; }; export type UpdateCalculatedFieldMetadataInput = { description?: InputMaybe; id: Scalars['Int']; }; export type UpdateCalculatedFieldWhere = { id: Scalars['Int']; }; export type UpdateColumnMetadataInput = { description?: InputMaybe; displayName?: InputMaybe; id: Scalars['Int']; }; export type UpdateCurrentProjectInput = { language: ProjectLanguage; }; export type UpdateDashboardItemInput = { displayName: Scalars['String']; }; export type UpdateDashboardItemLayoutsInput = { layouts: Array; }; export type UpdateDataSourceInput = { properties: Scalars['JSON']; }; export type UpdateInstructionInput = { instruction?: InputMaybe; isDefault?: InputMaybe; questions?: InputMaybe>; }; export type UpdateModelInput = { fields: Array; primaryKey?: InputMaybe; }; export type UpdateModelMetadataInput = { calculatedFields?: InputMaybe>; columns?: InputMaybe>; description?: InputMaybe; displayName?: InputMaybe; nestedColumns?: InputMaybe>; relationships?: InputMaybe>; }; export type UpdateNestedColumnMetadataInput = { description?: InputMaybe; displayName?: InputMaybe; id: Scalars['Int']; }; export type UpdateRelationInput = { type: RelationType; }; export type UpdateRelationshipMetadataInput = { description?: InputMaybe; id: Scalars['Int']; }; export type UpdateSqlPairInput = { question?: InputMaybe; sql?: InputMaybe; }; export type UpdateThreadInput = { summary?: InputMaybe; }; export type UpdateThreadResponseInput = { sql?: InputMaybe; }; export type UpdateViewColumnMetadataInput = { description?: InputMaybe; referenceName: Scalars['String']; }; export type UpdateViewMetadataInput = { columns?: InputMaybe>; description?: InputMaybe; displayName?: InputMaybe; }; export type ValidateCalculatedFieldInput = { columnId?: InputMaybe; modelId: Scalars['Int']; name: Scalars['String']; }; export type ValidateViewInput = { name: Scalars['String']; }; export type ViewInfo = { __typename?: 'ViewInfo'; displayName: Scalars['String']; id: Scalars['Int']; name: Scalars['String']; statement: Scalars['String']; }; export type ViewValidationResponse = { __typename?: 'ViewValidationResponse'; message?: Maybe; valid: Scalars['Boolean']; }; export type ViewWhereUniqueInput = { id: Scalars['Int']; }; export type WhereIdInput = { id: Scalars['Int']; }; ================================================ FILE: wren-ui/src/apollo/client/graphql/apiManagement.generated.ts ================================================ import * as Types from './__types__'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; const defaultOptions = {} as const; export type ApiHistoryQueryVariables = Types.Exact<{ filter?: Types.InputMaybe; pagination: Types.ApiHistoryPaginationInput; }>; export type ApiHistoryQuery = { __typename?: 'Query', apiHistory: { __typename?: 'ApiHistoryPaginatedResponse', total: number, hasMore: boolean, items: Array<{ __typename?: 'ApiHistoryResponse', id: string, projectId: number, apiType: Types.ApiType, threadId?: string | null, headers?: any | null, requestPayload?: any | null, responsePayload?: any | null, statusCode?: number | null, durationMs?: number | null, createdAt: string, updatedAt: string }> } }; export const ApiHistoryDocument = gql` query ApiHistory($filter: ApiHistoryFilterInput, $pagination: ApiHistoryPaginationInput!) { apiHistory(filter: $filter, pagination: $pagination) { items { id projectId apiType threadId headers requestPayload responsePayload statusCode durationMs createdAt updatedAt } total hasMore } } `; /** * __useApiHistoryQuery__ * * To run a query within a React component, call `useApiHistoryQuery` and pass it any options that fit your needs. * When your component renders, `useApiHistoryQuery` returns an object from Apollo Client that contains loading, error, and data properties * you can use to render your UI. * * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; * * @example * const { data, loading, error } = useApiHistoryQuery({ * variables: { * filter: // value for 'filter' * pagination: // value for 'pagination' * }, * }); */ export function useApiHistoryQuery(baseOptions: Apollo.QueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useQuery(ApiHistoryDocument, options); } export function useApiHistoryLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(ApiHistoryDocument, options); } export type ApiHistoryQueryHookResult = ReturnType; export type ApiHistoryLazyQueryHookResult = ReturnType; export type ApiHistoryQueryResult = Apollo.QueryResult; ================================================ FILE: wren-ui/src/apollo/client/graphql/apiManagement.ts ================================================ import { gql } from '@apollo/client'; export const API_HISTORY = gql` query ApiHistory( $filter: ApiHistoryFilterInput $pagination: ApiHistoryPaginationInput! ) { apiHistory(filter: $filter, pagination: $pagination) { items { id projectId apiType threadId headers requestPayload responsePayload statusCode durationMs createdAt updatedAt } total hasMore } } `; ================================================ FILE: wren-ui/src/apollo/client/graphql/calculatedField.generated.ts ================================================ import * as Types from './__types__'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; const defaultOptions = {} as const; export type ValidateCalculatedFieldMutationVariables = Types.Exact<{ data: Types.ValidateCalculatedFieldInput; }>; export type ValidateCalculatedFieldMutation = { __typename?: 'Mutation', validateCalculatedField: { __typename?: 'CalculatedFieldValidationResponse', message?: string | null, valid: boolean } }; export type CreateCalculatedFieldMutationVariables = Types.Exact<{ data: Types.CreateCalculatedFieldInput; }>; export type CreateCalculatedFieldMutation = { __typename?: 'Mutation', createCalculatedField: any }; export type UpdateCalculatedFieldMutationVariables = Types.Exact<{ where: Types.UpdateCalculatedFieldWhere; data: Types.UpdateCalculatedFieldInput; }>; export type UpdateCalculatedFieldMutation = { __typename?: 'Mutation', updateCalculatedField: any }; export type DeleteCalculatedFieldMutationVariables = Types.Exact<{ where: Types.UpdateCalculatedFieldWhere; }>; export type DeleteCalculatedFieldMutation = { __typename?: 'Mutation', deleteCalculatedField: boolean }; export const ValidateCalculatedFieldDocument = gql` mutation ValidateCalculatedField($data: ValidateCalculatedFieldInput!) { validateCalculatedField(data: $data) { message valid } } `; export type ValidateCalculatedFieldMutationFn = Apollo.MutationFunction; /** * __useValidateCalculatedFieldMutation__ * * To run a mutation, you first call `useValidateCalculatedFieldMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useValidateCalculatedFieldMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [validateCalculatedFieldMutation, { data, loading, error }] = useValidateCalculatedFieldMutation({ * variables: { * data: // value for 'data' * }, * }); */ export function useValidateCalculatedFieldMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(ValidateCalculatedFieldDocument, options); } export type ValidateCalculatedFieldMutationHookResult = ReturnType; export type ValidateCalculatedFieldMutationResult = Apollo.MutationResult; export type ValidateCalculatedFieldMutationOptions = Apollo.BaseMutationOptions; export const CreateCalculatedFieldDocument = gql` mutation CreateCalculatedField($data: CreateCalculatedFieldInput!) { createCalculatedField(data: $data) } `; export type CreateCalculatedFieldMutationFn = Apollo.MutationFunction; /** * __useCreateCalculatedFieldMutation__ * * To run a mutation, you first call `useCreateCalculatedFieldMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useCreateCalculatedFieldMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [createCalculatedFieldMutation, { data, loading, error }] = useCreateCalculatedFieldMutation({ * variables: { * data: // value for 'data' * }, * }); */ export function useCreateCalculatedFieldMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(CreateCalculatedFieldDocument, options); } export type CreateCalculatedFieldMutationHookResult = ReturnType; export type CreateCalculatedFieldMutationResult = Apollo.MutationResult; export type CreateCalculatedFieldMutationOptions = Apollo.BaseMutationOptions; export const UpdateCalculatedFieldDocument = gql` mutation UpdateCalculatedField($where: UpdateCalculatedFieldWhere!, $data: UpdateCalculatedFieldInput!) { updateCalculatedField(where: $where, data: $data) } `; export type UpdateCalculatedFieldMutationFn = Apollo.MutationFunction; /** * __useUpdateCalculatedFieldMutation__ * * To run a mutation, you first call `useUpdateCalculatedFieldMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useUpdateCalculatedFieldMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [updateCalculatedFieldMutation, { data, loading, error }] = useUpdateCalculatedFieldMutation({ * variables: { * where: // value for 'where' * data: // value for 'data' * }, * }); */ export function useUpdateCalculatedFieldMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(UpdateCalculatedFieldDocument, options); } export type UpdateCalculatedFieldMutationHookResult = ReturnType; export type UpdateCalculatedFieldMutationResult = Apollo.MutationResult; export type UpdateCalculatedFieldMutationOptions = Apollo.BaseMutationOptions; export const DeleteCalculatedFieldDocument = gql` mutation DeleteCalculatedField($where: UpdateCalculatedFieldWhere!) { deleteCalculatedField(where: $where) } `; export type DeleteCalculatedFieldMutationFn = Apollo.MutationFunction; /** * __useDeleteCalculatedFieldMutation__ * * To run a mutation, you first call `useDeleteCalculatedFieldMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useDeleteCalculatedFieldMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [deleteCalculatedFieldMutation, { data, loading, error }] = useDeleteCalculatedFieldMutation({ * variables: { * where: // value for 'where' * }, * }); */ export function useDeleteCalculatedFieldMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(DeleteCalculatedFieldDocument, options); } export type DeleteCalculatedFieldMutationHookResult = ReturnType; export type DeleteCalculatedFieldMutationResult = Apollo.MutationResult; export type DeleteCalculatedFieldMutationOptions = Apollo.BaseMutationOptions; ================================================ FILE: wren-ui/src/apollo/client/graphql/calculatedField.ts ================================================ import { gql } from '@apollo/client'; export const VALIDATE_CALCULATED_FIELD = gql` mutation ValidateCalculatedField($data: ValidateCalculatedFieldInput!) { validateCalculatedField(data: $data) { message valid } } `; export const CREATE_CALCULATED_FIELD = gql` mutation CreateCalculatedField($data: CreateCalculatedFieldInput!) { createCalculatedField(data: $data) } `; export const UPDATE_CALCULATED_FIELD = gql` mutation UpdateCalculatedField( $where: UpdateCalculatedFieldWhere! $data: UpdateCalculatedFieldInput! ) { updateCalculatedField(where: $where, data: $data) } `; export const DELETE_CALCULATED_FIELD = gql` mutation DeleteCalculatedField($where: UpdateCalculatedFieldWhere!) { deleteCalculatedField(where: $where) } `; ================================================ FILE: wren-ui/src/apollo/client/graphql/dashboard.generated.ts ================================================ import * as Types from './__types__'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; const defaultOptions = {} as const; export type CommonDashboardItemFragment = { __typename?: 'DashboardItem', id: number, dashboardId: number, type: Types.DashboardItemType, displayName?: string | null, layout: { __typename?: 'DashboardItemLayout', x: number, y: number, w: number, h: number }, detail: { __typename?: 'DashboardItemDetail', sql: string, chartSchema?: any | null } }; export type DashboardItemsQueryVariables = Types.Exact<{ [key: string]: never; }>; export type DashboardItemsQuery = { __typename?: 'Query', dashboardItems: Array<{ __typename?: 'DashboardItem', id: number, dashboardId: number, type: Types.DashboardItemType, displayName?: string | null, layout: { __typename?: 'DashboardItemLayout', x: number, y: number, w: number, h: number }, detail: { __typename?: 'DashboardItemDetail', sql: string, chartSchema?: any | null } }> }; export type CreateDashboardItemMutationVariables = Types.Exact<{ data: Types.CreateDashboardItemInput; }>; export type CreateDashboardItemMutation = { __typename?: 'Mutation', createDashboardItem: { __typename?: 'DashboardItem', id: number, dashboardId: number, type: Types.DashboardItemType, displayName?: string | null, layout: { __typename?: 'DashboardItemLayout', x: number, y: number, w: number, h: number }, detail: { __typename?: 'DashboardItemDetail', sql: string, chartSchema?: any | null } } }; export type UpdateDashboardItemMutationVariables = Types.Exact<{ where: Types.DashboardItemWhereInput; data: Types.UpdateDashboardItemInput; }>; export type UpdateDashboardItemMutation = { __typename?: 'Mutation', updateDashboardItem: { __typename?: 'DashboardItem', id: number, dashboardId: number, type: Types.DashboardItemType, displayName?: string | null, layout: { __typename?: 'DashboardItemLayout', x: number, y: number, w: number, h: number }, detail: { __typename?: 'DashboardItemDetail', sql: string, chartSchema?: any | null } } }; export type UpdateDashboardItemLayoutsMutationVariables = Types.Exact<{ data: Types.UpdateDashboardItemLayoutsInput; }>; export type UpdateDashboardItemLayoutsMutation = { __typename?: 'Mutation', updateDashboardItemLayouts: Array<{ __typename?: 'DashboardItem', id: number, dashboardId: number, type: Types.DashboardItemType, displayName?: string | null, layout: { __typename?: 'DashboardItemLayout', x: number, y: number, w: number, h: number }, detail: { __typename?: 'DashboardItemDetail', sql: string, chartSchema?: any | null } }> }; export type DeleteDashboardItemMutationVariables = Types.Exact<{ where: Types.DashboardItemWhereInput; }>; export type DeleteDashboardItemMutation = { __typename?: 'Mutation', deleteDashboardItem: boolean }; export type PreviewItemSqlMutationVariables = Types.Exact<{ data: Types.PreviewItemSqlInput; }>; export type PreviewItemSqlMutation = { __typename?: 'Mutation', previewItemSQL: { __typename?: 'PreviewItemResponse', data: any, cacheHit: boolean, cacheCreatedAt?: string | null, cacheOverrodeAt?: string | null, override: boolean } }; export type SetDashboardScheduleMutationVariables = Types.Exact<{ data: Types.SetDashboardScheduleInput; }>; export type SetDashboardScheduleMutation = { __typename?: 'Mutation', setDashboardSchedule: { __typename?: 'Dashboard', id: number, projectId: number, name: string, cacheEnabled: boolean, scheduleFrequency?: Types.ScheduleFrequencyEnum | null, scheduleTimezone?: string | null, scheduleCron?: string | null, nextScheduledAt?: string | null } }; export type DashboardQueryVariables = Types.Exact<{ [key: string]: never; }>; export type DashboardQuery = { __typename?: 'Query', dashboard: { __typename?: 'DetailedDashboard', id: number, name: string, description?: string | null, cacheEnabled: boolean, nextScheduledAt?: string | null, schedule?: { __typename?: 'DashboardSchedule', frequency?: Types.ScheduleFrequencyEnum | null, hour?: number | null, minute?: number | null, day?: Types.CacheScheduleDayEnum | null, timezone?: string | null, cron?: string | null } | null, items: Array<{ __typename?: 'DashboardItem', id: number, dashboardId: number, type: Types.DashboardItemType, displayName?: string | null, layout: { __typename?: 'DashboardItemLayout', x: number, y: number, w: number, h: number }, detail: { __typename?: 'DashboardItemDetail', sql: string, chartSchema?: any | null } }> } }; export const CommonDashboardItemFragmentDoc = gql` fragment CommonDashboardItem on DashboardItem { id dashboardId type layout { x y w h } detail { sql chartSchema } displayName } `; export const DashboardItemsDocument = gql` query DashboardItems { dashboardItems { ...CommonDashboardItem } } ${CommonDashboardItemFragmentDoc}`; /** * __useDashboardItemsQuery__ * * To run a query within a React component, call `useDashboardItemsQuery` and pass it any options that fit your needs. * When your component renders, `useDashboardItemsQuery` returns an object from Apollo Client that contains loading, error, and data properties * you can use to render your UI. * * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; * * @example * const { data, loading, error } = useDashboardItemsQuery({ * variables: { * }, * }); */ export function useDashboardItemsQuery(baseOptions?: Apollo.QueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useQuery(DashboardItemsDocument, options); } export function useDashboardItemsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(DashboardItemsDocument, options); } export type DashboardItemsQueryHookResult = ReturnType; export type DashboardItemsLazyQueryHookResult = ReturnType; export type DashboardItemsQueryResult = Apollo.QueryResult; export const CreateDashboardItemDocument = gql` mutation CreateDashboardItem($data: CreateDashboardItemInput!) { createDashboardItem(data: $data) { ...CommonDashboardItem } } ${CommonDashboardItemFragmentDoc}`; export type CreateDashboardItemMutationFn = Apollo.MutationFunction; /** * __useCreateDashboardItemMutation__ * * To run a mutation, you first call `useCreateDashboardItemMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useCreateDashboardItemMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [createDashboardItemMutation, { data, loading, error }] = useCreateDashboardItemMutation({ * variables: { * data: // value for 'data' * }, * }); */ export function useCreateDashboardItemMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(CreateDashboardItemDocument, options); } export type CreateDashboardItemMutationHookResult = ReturnType; export type CreateDashboardItemMutationResult = Apollo.MutationResult; export type CreateDashboardItemMutationOptions = Apollo.BaseMutationOptions; export const UpdateDashboardItemDocument = gql` mutation UpdateDashboardItem($where: DashboardItemWhereInput!, $data: UpdateDashboardItemInput!) { updateDashboardItem(where: $where, data: $data) { ...CommonDashboardItem } } ${CommonDashboardItemFragmentDoc}`; export type UpdateDashboardItemMutationFn = Apollo.MutationFunction; /** * __useUpdateDashboardItemMutation__ * * To run a mutation, you first call `useUpdateDashboardItemMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useUpdateDashboardItemMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [updateDashboardItemMutation, { data, loading, error }] = useUpdateDashboardItemMutation({ * variables: { * where: // value for 'where' * data: // value for 'data' * }, * }); */ export function useUpdateDashboardItemMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(UpdateDashboardItemDocument, options); } export type UpdateDashboardItemMutationHookResult = ReturnType; export type UpdateDashboardItemMutationResult = Apollo.MutationResult; export type UpdateDashboardItemMutationOptions = Apollo.BaseMutationOptions; export const UpdateDashboardItemLayoutsDocument = gql` mutation UpdateDashboardItemLayouts($data: UpdateDashboardItemLayoutsInput!) { updateDashboardItemLayouts(data: $data) { ...CommonDashboardItem } } ${CommonDashboardItemFragmentDoc}`; export type UpdateDashboardItemLayoutsMutationFn = Apollo.MutationFunction; /** * __useUpdateDashboardItemLayoutsMutation__ * * To run a mutation, you first call `useUpdateDashboardItemLayoutsMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useUpdateDashboardItemLayoutsMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [updateDashboardItemLayoutsMutation, { data, loading, error }] = useUpdateDashboardItemLayoutsMutation({ * variables: { * data: // value for 'data' * }, * }); */ export function useUpdateDashboardItemLayoutsMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(UpdateDashboardItemLayoutsDocument, options); } export type UpdateDashboardItemLayoutsMutationHookResult = ReturnType; export type UpdateDashboardItemLayoutsMutationResult = Apollo.MutationResult; export type UpdateDashboardItemLayoutsMutationOptions = Apollo.BaseMutationOptions; export const DeleteDashboardItemDocument = gql` mutation DeleteDashboardItem($where: DashboardItemWhereInput!) { deleteDashboardItem(where: $where) } `; export type DeleteDashboardItemMutationFn = Apollo.MutationFunction; /** * __useDeleteDashboardItemMutation__ * * To run a mutation, you first call `useDeleteDashboardItemMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useDeleteDashboardItemMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [deleteDashboardItemMutation, { data, loading, error }] = useDeleteDashboardItemMutation({ * variables: { * where: // value for 'where' * }, * }); */ export function useDeleteDashboardItemMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(DeleteDashboardItemDocument, options); } export type DeleteDashboardItemMutationHookResult = ReturnType; export type DeleteDashboardItemMutationResult = Apollo.MutationResult; export type DeleteDashboardItemMutationOptions = Apollo.BaseMutationOptions; export const PreviewItemSqlDocument = gql` mutation PreviewItemSQL($data: PreviewItemSQLInput!) { previewItemSQL(data: $data) { data cacheHit cacheCreatedAt cacheOverrodeAt override } } `; export type PreviewItemSqlMutationFn = Apollo.MutationFunction; /** * __usePreviewItemSqlMutation__ * * To run a mutation, you first call `usePreviewItemSqlMutation` within a React component and pass it any options that fit your needs. * When your component renders, `usePreviewItemSqlMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [previewItemSqlMutation, { data, loading, error }] = usePreviewItemSqlMutation({ * variables: { * data: // value for 'data' * }, * }); */ export function usePreviewItemSqlMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(PreviewItemSqlDocument, options); } export type PreviewItemSqlMutationHookResult = ReturnType; export type PreviewItemSqlMutationResult = Apollo.MutationResult; export type PreviewItemSqlMutationOptions = Apollo.BaseMutationOptions; export const SetDashboardScheduleDocument = gql` mutation SetDashboardSchedule($data: SetDashboardScheduleInput!) { setDashboardSchedule(data: $data) { id projectId name cacheEnabled scheduleFrequency scheduleTimezone scheduleCron nextScheduledAt } } `; export type SetDashboardScheduleMutationFn = Apollo.MutationFunction; /** * __useSetDashboardScheduleMutation__ * * To run a mutation, you first call `useSetDashboardScheduleMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useSetDashboardScheduleMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [setDashboardScheduleMutation, { data, loading, error }] = useSetDashboardScheduleMutation({ * variables: { * data: // value for 'data' * }, * }); */ export function useSetDashboardScheduleMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(SetDashboardScheduleDocument, options); } export type SetDashboardScheduleMutationHookResult = ReturnType; export type SetDashboardScheduleMutationResult = Apollo.MutationResult; export type SetDashboardScheduleMutationOptions = Apollo.BaseMutationOptions; export const DashboardDocument = gql` query Dashboard { dashboard { id name description cacheEnabled nextScheduledAt schedule { frequency hour minute day timezone cron } items { ...CommonDashboardItem } } } ${CommonDashboardItemFragmentDoc}`; /** * __useDashboardQuery__ * * To run a query within a React component, call `useDashboardQuery` and pass it any options that fit your needs. * When your component renders, `useDashboardQuery` returns an object from Apollo Client that contains loading, error, and data properties * you can use to render your UI. * * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; * * @example * const { data, loading, error } = useDashboardQuery({ * variables: { * }, * }); */ export function useDashboardQuery(baseOptions?: Apollo.QueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useQuery(DashboardDocument, options); } export function useDashboardLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(DashboardDocument, options); } export type DashboardQueryHookResult = ReturnType; export type DashboardLazyQueryHookResult = ReturnType; export type DashboardQueryResult = Apollo.QueryResult; ================================================ FILE: wren-ui/src/apollo/client/graphql/dashboard.ts ================================================ import { gql } from '@apollo/client'; export const COMMON_DASHBOARD_ITEM = gql` fragment CommonDashboardItem on DashboardItem { id dashboardId type layout { x y w h } detail { sql chartSchema } displayName } `; export const DASHBOARD_ITEMS = gql` query DashboardItems { dashboardItems { ...CommonDashboardItem } } ${COMMON_DASHBOARD_ITEM} `; export const CREATE_DASHBOARD_ITEM = gql` mutation CreateDashboardItem($data: CreateDashboardItemInput!) { createDashboardItem(data: $data) { ...CommonDashboardItem } } ${COMMON_DASHBOARD_ITEM} `; export const UPDATE_DASHBOARD_ITEM = gql` mutation UpdateDashboardItem( $where: DashboardItemWhereInput! $data: UpdateDashboardItemInput! ) { updateDashboardItem(where: $where, data: $data) { ...CommonDashboardItem } } ${COMMON_DASHBOARD_ITEM} `; export const UPDATE_DASHBOARD_ITEM_LAYOUTS = gql` mutation UpdateDashboardItemLayouts($data: UpdateDashboardItemLayoutsInput!) { updateDashboardItemLayouts(data: $data) { ...CommonDashboardItem } } ${COMMON_DASHBOARD_ITEM} `; export const DELETE_DASHBOARD_ITEM = gql` mutation DeleteDashboardItem($where: DashboardItemWhereInput!) { deleteDashboardItem(where: $where) } `; export const PREVIEW_ITEM_SQL = gql` mutation PreviewItemSQL($data: PreviewItemSQLInput!) { previewItemSQL(data: $data) { data cacheHit cacheCreatedAt cacheOverrodeAt override } } `; export const SET_DASHBOARD_SCHEDULE = gql` mutation SetDashboardSchedule($data: SetDashboardScheduleInput!) { setDashboardSchedule(data: $data) { id projectId name cacheEnabled scheduleFrequency scheduleTimezone scheduleCron nextScheduledAt } } `; export const DASHBOARD = gql` query Dashboard { dashboard { id name description cacheEnabled nextScheduledAt schedule { frequency hour minute day timezone cron } items { ...CommonDashboardItem } } } ${COMMON_DASHBOARD_ITEM} `; ================================================ FILE: wren-ui/src/apollo/client/graphql/dataSource.generated.ts ================================================ import * as Types from './__types__'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; const defaultOptions = {} as const; export type StartSampleDatasetMutationVariables = Types.Exact<{ data: Types.SampleDatasetInput; }>; export type StartSampleDatasetMutation = { __typename?: 'Mutation', startSampleDataset: any }; export type ListDataSourceTablesQueryVariables = Types.Exact<{ [key: string]: never; }>; export type ListDataSourceTablesQuery = { __typename?: 'Query', listDataSourceTables: Array<{ __typename?: 'CompactTable', name: string, columns: Array<{ __typename?: 'CompactColumn', name: string, type: string }> }> }; export type AutoGeneratedRelationsQueryVariables = Types.Exact<{ [key: string]: never; }>; export type AutoGeneratedRelationsQuery = { __typename?: 'Query', autoGenerateRelation: Array<{ __typename?: 'RecommendRelations', id: number, displayName: string, referenceName: string, relations: Array<{ __typename?: 'Relation', fromModelId: number, fromModelReferenceName: string, fromColumnId: number, fromColumnReferenceName: string, toModelId: number, toModelReferenceName: string, toColumnId: number, toColumnReferenceName: string, type: Types.RelationType, name: string } | null> }> }; export type SaveDataSourceMutationVariables = Types.Exact<{ data: Types.DataSourceInput; }>; export type SaveDataSourceMutation = { __typename?: 'Mutation', saveDataSource: { __typename?: 'DataSource', type: Types.DataSourceName, properties: any } }; export type UpdateDataSourceMutationVariables = Types.Exact<{ data: Types.UpdateDataSourceInput; }>; export type UpdateDataSourceMutation = { __typename?: 'Mutation', updateDataSource: { __typename?: 'DataSource', type: Types.DataSourceName, properties: any } }; export type SaveTablesMutationVariables = Types.Exact<{ data: Types.SaveTablesInput; }>; export type SaveTablesMutation = { __typename?: 'Mutation', saveTables: any }; export type SaveRelationsMutationVariables = Types.Exact<{ data: Types.SaveRelationInput; }>; export type SaveRelationsMutation = { __typename?: 'Mutation', saveRelations: any }; export type SchemaChangeQueryVariables = Types.Exact<{ [key: string]: never; }>; export type SchemaChangeQuery = { __typename?: 'Query', schemaChange: { __typename?: 'SchemaChange', lastSchemaChangeTime?: string | null, deletedTables?: Array<{ __typename?: 'DetailedChangeTable', sourceTableName: string, displayName: string, columns: Array<{ __typename?: 'DetailedChangeColumn', sourceColumnName: string, displayName: string, type: string }>, relationships: Array<{ __typename?: 'DetailedAffectedRelationships', displayName: string, referenceName: string }>, calculatedFields: Array<{ __typename?: 'DetailedAffectedCalculatedFields', displayName: string, referenceName: string, type: string }> }> | null, deletedColumns?: Array<{ __typename?: 'DetailedChangeTable', sourceTableName: string, displayName: string, columns: Array<{ __typename?: 'DetailedChangeColumn', sourceColumnName: string, displayName: string, type: string }>, relationships: Array<{ __typename?: 'DetailedAffectedRelationships', displayName: string, referenceName: string }>, calculatedFields: Array<{ __typename?: 'DetailedAffectedCalculatedFields', displayName: string, referenceName: string, type: string }> }> | null, modifiedColumns?: Array<{ __typename?: 'DetailedChangeTable', sourceTableName: string, displayName: string, columns: Array<{ __typename?: 'DetailedChangeColumn', sourceColumnName: string, displayName: string, type: string }>, relationships: Array<{ __typename?: 'DetailedAffectedRelationships', displayName: string, referenceName: string }>, calculatedFields: Array<{ __typename?: 'DetailedAffectedCalculatedFields', displayName: string, referenceName: string, type: string }> }> | null } }; export type TriggerDataSourceDetectionMutationVariables = Types.Exact<{ [key: string]: never; }>; export type TriggerDataSourceDetectionMutation = { __typename?: 'Mutation', triggerDataSourceDetection: boolean }; export type ResolveSchemaChangeMutationVariables = Types.Exact<{ where: Types.ResolveSchemaChangeWhereInput; }>; export type ResolveSchemaChangeMutation = { __typename?: 'Mutation', resolveSchemaChange: boolean }; export const StartSampleDatasetDocument = gql` mutation StartSampleDataset($data: SampleDatasetInput!) { startSampleDataset(data: $data) } `; export type StartSampleDatasetMutationFn = Apollo.MutationFunction; /** * __useStartSampleDatasetMutation__ * * To run a mutation, you first call `useStartSampleDatasetMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useStartSampleDatasetMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [startSampleDatasetMutation, { data, loading, error }] = useStartSampleDatasetMutation({ * variables: { * data: // value for 'data' * }, * }); */ export function useStartSampleDatasetMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(StartSampleDatasetDocument, options); } export type StartSampleDatasetMutationHookResult = ReturnType; export type StartSampleDatasetMutationResult = Apollo.MutationResult; export type StartSampleDatasetMutationOptions = Apollo.BaseMutationOptions; export const ListDataSourceTablesDocument = gql` query ListDataSourceTables { listDataSourceTables { name columns { name type } } } `; /** * __useListDataSourceTablesQuery__ * * To run a query within a React component, call `useListDataSourceTablesQuery` and pass it any options that fit your needs. * When your component renders, `useListDataSourceTablesQuery` returns an object from Apollo Client that contains loading, error, and data properties * you can use to render your UI. * * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; * * @example * const { data, loading, error } = useListDataSourceTablesQuery({ * variables: { * }, * }); */ export function useListDataSourceTablesQuery(baseOptions?: Apollo.QueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useQuery(ListDataSourceTablesDocument, options); } export function useListDataSourceTablesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(ListDataSourceTablesDocument, options); } export type ListDataSourceTablesQueryHookResult = ReturnType; export type ListDataSourceTablesLazyQueryHookResult = ReturnType; export type ListDataSourceTablesQueryResult = Apollo.QueryResult; export const AutoGeneratedRelationsDocument = gql` query AutoGeneratedRelations { autoGenerateRelation { id displayName referenceName relations { fromModelId fromModelReferenceName fromColumnId fromColumnReferenceName toModelId toModelReferenceName toColumnId toColumnReferenceName type name } } } `; /** * __useAutoGeneratedRelationsQuery__ * * To run a query within a React component, call `useAutoGeneratedRelationsQuery` and pass it any options that fit your needs. * When your component renders, `useAutoGeneratedRelationsQuery` returns an object from Apollo Client that contains loading, error, and data properties * you can use to render your UI. * * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; * * @example * const { data, loading, error } = useAutoGeneratedRelationsQuery({ * variables: { * }, * }); */ export function useAutoGeneratedRelationsQuery(baseOptions?: Apollo.QueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useQuery(AutoGeneratedRelationsDocument, options); } export function useAutoGeneratedRelationsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(AutoGeneratedRelationsDocument, options); } export type AutoGeneratedRelationsQueryHookResult = ReturnType; export type AutoGeneratedRelationsLazyQueryHookResult = ReturnType; export type AutoGeneratedRelationsQueryResult = Apollo.QueryResult; export const SaveDataSourceDocument = gql` mutation SaveDataSource($data: DataSourceInput!) { saveDataSource(data: $data) { type properties } } `; export type SaveDataSourceMutationFn = Apollo.MutationFunction; /** * __useSaveDataSourceMutation__ * * To run a mutation, you first call `useSaveDataSourceMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useSaveDataSourceMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [saveDataSourceMutation, { data, loading, error }] = useSaveDataSourceMutation({ * variables: { * data: // value for 'data' * }, * }); */ export function useSaveDataSourceMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(SaveDataSourceDocument, options); } export type SaveDataSourceMutationHookResult = ReturnType; export type SaveDataSourceMutationResult = Apollo.MutationResult; export type SaveDataSourceMutationOptions = Apollo.BaseMutationOptions; export const UpdateDataSourceDocument = gql` mutation UpdateDataSource($data: UpdateDataSourceInput!) { updateDataSource(data: $data) { type properties } } `; export type UpdateDataSourceMutationFn = Apollo.MutationFunction; /** * __useUpdateDataSourceMutation__ * * To run a mutation, you first call `useUpdateDataSourceMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useUpdateDataSourceMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [updateDataSourceMutation, { data, loading, error }] = useUpdateDataSourceMutation({ * variables: { * data: // value for 'data' * }, * }); */ export function useUpdateDataSourceMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(UpdateDataSourceDocument, options); } export type UpdateDataSourceMutationHookResult = ReturnType; export type UpdateDataSourceMutationResult = Apollo.MutationResult; export type UpdateDataSourceMutationOptions = Apollo.BaseMutationOptions; export const SaveTablesDocument = gql` mutation SaveTables($data: SaveTablesInput!) { saveTables(data: $data) } `; export type SaveTablesMutationFn = Apollo.MutationFunction; /** * __useSaveTablesMutation__ * * To run a mutation, you first call `useSaveTablesMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useSaveTablesMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [saveTablesMutation, { data, loading, error }] = useSaveTablesMutation({ * variables: { * data: // value for 'data' * }, * }); */ export function useSaveTablesMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(SaveTablesDocument, options); } export type SaveTablesMutationHookResult = ReturnType; export type SaveTablesMutationResult = Apollo.MutationResult; export type SaveTablesMutationOptions = Apollo.BaseMutationOptions; export const SaveRelationsDocument = gql` mutation SaveRelations($data: SaveRelationInput!) { saveRelations(data: $data) } `; export type SaveRelationsMutationFn = Apollo.MutationFunction; /** * __useSaveRelationsMutation__ * * To run a mutation, you first call `useSaveRelationsMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useSaveRelationsMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [saveRelationsMutation, { data, loading, error }] = useSaveRelationsMutation({ * variables: { * data: // value for 'data' * }, * }); */ export function useSaveRelationsMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(SaveRelationsDocument, options); } export type SaveRelationsMutationHookResult = ReturnType; export type SaveRelationsMutationResult = Apollo.MutationResult; export type SaveRelationsMutationOptions = Apollo.BaseMutationOptions; export const SchemaChangeDocument = gql` query SchemaChange { schemaChange { deletedTables { sourceTableName displayName columns { sourceColumnName displayName type } relationships { displayName referenceName } calculatedFields { displayName referenceName type } } deletedColumns { sourceTableName displayName columns { sourceColumnName displayName type } relationships { displayName referenceName } calculatedFields { displayName referenceName type } } modifiedColumns { sourceTableName displayName columns { sourceColumnName displayName type } relationships { displayName referenceName } calculatedFields { displayName referenceName type } } lastSchemaChangeTime } } `; /** * __useSchemaChangeQuery__ * * To run a query within a React component, call `useSchemaChangeQuery` and pass it any options that fit your needs. * When your component renders, `useSchemaChangeQuery` returns an object from Apollo Client that contains loading, error, and data properties * you can use to render your UI. * * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; * * @example * const { data, loading, error } = useSchemaChangeQuery({ * variables: { * }, * }); */ export function useSchemaChangeQuery(baseOptions?: Apollo.QueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useQuery(SchemaChangeDocument, options); } export function useSchemaChangeLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(SchemaChangeDocument, options); } export type SchemaChangeQueryHookResult = ReturnType; export type SchemaChangeLazyQueryHookResult = ReturnType; export type SchemaChangeQueryResult = Apollo.QueryResult; export const TriggerDataSourceDetectionDocument = gql` mutation TriggerDataSourceDetection { triggerDataSourceDetection } `; export type TriggerDataSourceDetectionMutationFn = Apollo.MutationFunction; /** * __useTriggerDataSourceDetectionMutation__ * * To run a mutation, you first call `useTriggerDataSourceDetectionMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useTriggerDataSourceDetectionMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [triggerDataSourceDetectionMutation, { data, loading, error }] = useTriggerDataSourceDetectionMutation({ * variables: { * }, * }); */ export function useTriggerDataSourceDetectionMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(TriggerDataSourceDetectionDocument, options); } export type TriggerDataSourceDetectionMutationHookResult = ReturnType; export type TriggerDataSourceDetectionMutationResult = Apollo.MutationResult; export type TriggerDataSourceDetectionMutationOptions = Apollo.BaseMutationOptions; export const ResolveSchemaChangeDocument = gql` mutation ResolveSchemaChange($where: ResolveSchemaChangeWhereInput!) { resolveSchemaChange(where: $where) } `; export type ResolveSchemaChangeMutationFn = Apollo.MutationFunction; /** * __useResolveSchemaChangeMutation__ * * To run a mutation, you first call `useResolveSchemaChangeMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useResolveSchemaChangeMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [resolveSchemaChangeMutation, { data, loading, error }] = useResolveSchemaChangeMutation({ * variables: { * where: // value for 'where' * }, * }); */ export function useResolveSchemaChangeMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(ResolveSchemaChangeDocument, options); } export type ResolveSchemaChangeMutationHookResult = ReturnType; export type ResolveSchemaChangeMutationResult = Apollo.MutationResult; export type ResolveSchemaChangeMutationOptions = Apollo.BaseMutationOptions; ================================================ FILE: wren-ui/src/apollo/client/graphql/dataSource.ts ================================================ import { gql } from '@apollo/client'; export const SET_SAMPLE_DATASETS = gql` mutation StartSampleDataset($data: SampleDatasetInput!) { startSampleDataset(data: $data) } `; export const LIST_DATA_SOURCE_TABLES = gql` query ListDataSourceTables { listDataSourceTables { name columns { name type } } } `; export const AUTO_GENERATED_RELATIONS = gql` query AutoGeneratedRelations { autoGenerateRelation { id displayName referenceName relations { fromModelId fromModelReferenceName fromColumnId fromColumnReferenceName toModelId toModelReferenceName toColumnId toColumnReferenceName type name } } } `; export const SAVE_DATA_SOURCE = gql` mutation SaveDataSource($data: DataSourceInput!) { saveDataSource(data: $data) { type properties } } `; export const UPDATE_DATA_SOURCE = gql` mutation UpdateDataSource($data: UpdateDataSourceInput!) { updateDataSource(data: $data) { type properties } } `; export const SAVE_TABLES = gql` mutation SaveTables($data: SaveTablesInput!) { saveTables(data: $data) } `; export const SAVE_RELATIONS = gql` mutation SaveRelations($data: SaveRelationInput!) { saveRelations(data: $data) } `; export const GET_SCHEMA_CHANGE = gql` query SchemaChange { schemaChange { deletedTables { sourceTableName displayName columns { sourceColumnName displayName type } relationships { displayName referenceName } calculatedFields { displayName referenceName type } } deletedColumns { sourceTableName displayName columns { sourceColumnName displayName type } relationships { displayName referenceName } calculatedFields { displayName referenceName type } } modifiedColumns { sourceTableName displayName columns { sourceColumnName displayName type } relationships { displayName referenceName } calculatedFields { displayName referenceName type } } lastSchemaChangeTime } } `; export const TRIGGER_DATA_SOURCE_DETECTION = gql` mutation TriggerDataSourceDetection { triggerDataSourceDetection } `; export const RESOLVE_SCHEMA_CHANGE = gql` mutation ResolveSchemaChange($where: ResolveSchemaChangeWhereInput!) { resolveSchemaChange(where: $where) } `; ================================================ FILE: wren-ui/src/apollo/client/graphql/deploy.generated.ts ================================================ import * as Types from './__types__'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; const defaultOptions = {} as const; export type DeployMutationVariables = Types.Exact<{ [key: string]: never; }>; export type DeployMutation = { __typename?: 'Mutation', deploy: any }; export type DeployStatusQueryVariables = Types.Exact<{ [key: string]: never; }>; export type DeployStatusQuery = { __typename?: 'Query', modelSync: { __typename?: 'ModelSyncResponse', status: Types.SyncStatus } }; export const DeployDocument = gql` mutation Deploy { deploy } `; export type DeployMutationFn = Apollo.MutationFunction; /** * __useDeployMutation__ * * To run a mutation, you first call `useDeployMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useDeployMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [deployMutation, { data, loading, error }] = useDeployMutation({ * variables: { * }, * }); */ export function useDeployMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(DeployDocument, options); } export type DeployMutationHookResult = ReturnType; export type DeployMutationResult = Apollo.MutationResult; export type DeployMutationOptions = Apollo.BaseMutationOptions; export const DeployStatusDocument = gql` query DeployStatus { modelSync { status } } `; /** * __useDeployStatusQuery__ * * To run a query within a React component, call `useDeployStatusQuery` and pass it any options that fit your needs. * When your component renders, `useDeployStatusQuery` returns an object from Apollo Client that contains loading, error, and data properties * you can use to render your UI. * * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; * * @example * const { data, loading, error } = useDeployStatusQuery({ * variables: { * }, * }); */ export function useDeployStatusQuery(baseOptions?: Apollo.QueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useQuery(DeployStatusDocument, options); } export function useDeployStatusLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(DeployStatusDocument, options); } export type DeployStatusQueryHookResult = ReturnType; export type DeployStatusLazyQueryHookResult = ReturnType; export type DeployStatusQueryResult = Apollo.QueryResult; ================================================ FILE: wren-ui/src/apollo/client/graphql/deploy.ts ================================================ import { gql } from '@apollo/client'; export const DEPLOY = gql` mutation Deploy { deploy } `; export const GET_DEPLOY_STATUS = gql` query DeployStatus { modelSync { status } } `; ================================================ FILE: wren-ui/src/apollo/client/graphql/diagram.generated.ts ================================================ import * as Types from './__types__'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; const defaultOptions = {} as const; export type ViewFieldFragment = { __typename?: 'DiagramViewField', id: string, displayName: string, referenceName: string, type: string, nodeType: Types.NodeType, description?: string | null }; export type RelationFieldFragment = { __typename?: 'DiagramModelRelationField', id: string, relationId: number, type: Types.RelationType, nodeType: Types.NodeType, displayName: string, referenceName: string, fromModelId: number, fromModelName: string, fromModelDisplayName: string, fromColumnId: number, fromColumnName: string, fromColumnDisplayName: string, toModelId: number, toModelName: string, toModelDisplayName: string, toColumnId: number, toColumnName: string, toColumnDisplayName: string, description?: string | null }; export type NestedFieldFragment = { __typename?: 'DiagramModelNestedField', id: string, nestedColumnId: number, columnPath: Array, type: string, displayName: string, referenceName: string, description?: string | null }; export type FieldFragment = { __typename?: 'DiagramModelField', id: string, columnId: number, type: string, nodeType: Types.NodeType, displayName: string, referenceName: string, description?: string | null, isPrimaryKey: boolean, expression?: string | null, aggregation?: string | null, lineage?: Array | null, nestedFields?: Array<{ __typename?: 'DiagramModelNestedField', id: string, nestedColumnId: number, columnPath: Array, type: string, displayName: string, referenceName: string, description?: string | null }> | null }; export type DiagramQueryVariables = Types.Exact<{ [key: string]: never; }>; export type DiagramQuery = { __typename?: 'Query', diagram: { __typename?: 'Diagram', models: Array<{ __typename?: 'DiagramModel', id: string, modelId: number, nodeType: Types.NodeType, displayName: string, referenceName: string, sourceTableName: string, refSql?: string | null, cached: boolean, refreshTime?: string | null, description?: string | null, fields: Array<{ __typename?: 'DiagramModelField', id: string, columnId: number, type: string, nodeType: Types.NodeType, displayName: string, referenceName: string, description?: string | null, isPrimaryKey: boolean, expression?: string | null, aggregation?: string | null, lineage?: Array | null, nestedFields?: Array<{ __typename?: 'DiagramModelNestedField', id: string, nestedColumnId: number, columnPath: Array, type: string, displayName: string, referenceName: string, description?: string | null }> | null } | null>, calculatedFields: Array<{ __typename?: 'DiagramModelField', id: string, columnId: number, type: string, nodeType: Types.NodeType, displayName: string, referenceName: string, description?: string | null, isPrimaryKey: boolean, expression?: string | null, aggregation?: string | null, lineage?: Array | null, nestedFields?: Array<{ __typename?: 'DiagramModelNestedField', id: string, nestedColumnId: number, columnPath: Array, type: string, displayName: string, referenceName: string, description?: string | null }> | null } | null>, relationFields: Array<{ __typename?: 'DiagramModelRelationField', id: string, relationId: number, type: Types.RelationType, nodeType: Types.NodeType, displayName: string, referenceName: string, fromModelId: number, fromModelName: string, fromModelDisplayName: string, fromColumnId: number, fromColumnName: string, fromColumnDisplayName: string, toModelId: number, toModelName: string, toModelDisplayName: string, toColumnId: number, toColumnName: string, toColumnDisplayName: string, description?: string | null } | null> } | null>, views: Array<{ __typename?: 'DiagramView', id: string, viewId: number, nodeType: Types.NodeType, displayName: string, description?: string | null, referenceName: string, statement: string, fields: Array<{ __typename?: 'DiagramViewField', id: string, displayName: string, referenceName: string, type: string, nodeType: Types.NodeType, description?: string | null } | null> } | null> } }; export const ViewFieldFragmentDoc = gql` fragment ViewField on DiagramViewField { id displayName referenceName type nodeType description } `; export const RelationFieldFragmentDoc = gql` fragment RelationField on DiagramModelRelationField { id relationId type nodeType displayName referenceName fromModelId fromModelName fromModelDisplayName fromColumnId fromColumnName fromColumnDisplayName toModelId toModelName toModelDisplayName toColumnId toColumnName toColumnDisplayName description } `; export const NestedFieldFragmentDoc = gql` fragment NestedField on DiagramModelNestedField { id nestedColumnId columnPath type displayName referenceName description } `; export const FieldFragmentDoc = gql` fragment Field on DiagramModelField { id columnId type nodeType displayName referenceName description isPrimaryKey expression aggregation lineage nestedFields { ...NestedField } } ${NestedFieldFragmentDoc}`; export const DiagramDocument = gql` query Diagram { diagram { models { id modelId nodeType displayName referenceName sourceTableName refSql cached refreshTime description fields { ...Field } calculatedFields { ...Field } relationFields { ...RelationField } } views { id viewId nodeType displayName description referenceName statement fields { ...ViewField } } } } ${FieldFragmentDoc} ${RelationFieldFragmentDoc} ${ViewFieldFragmentDoc}`; /** * __useDiagramQuery__ * * To run a query within a React component, call `useDiagramQuery` and pass it any options that fit your needs. * When your component renders, `useDiagramQuery` returns an object from Apollo Client that contains loading, error, and data properties * you can use to render your UI. * * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; * * @example * const { data, loading, error } = useDiagramQuery({ * variables: { * }, * }); */ export function useDiagramQuery(baseOptions?: Apollo.QueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useQuery(DiagramDocument, options); } export function useDiagramLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(DiagramDocument, options); } export type DiagramQueryHookResult = ReturnType; export type DiagramLazyQueryHookResult = ReturnType; export type DiagramQueryResult = Apollo.QueryResult; ================================================ FILE: wren-ui/src/apollo/client/graphql/diagram.ts ================================================ import { gql } from '@apollo/client'; const VIEW_FIELD = gql` fragment ViewField on DiagramViewField { id displayName referenceName type nodeType description } `; const RELATION_FIELD = gql` fragment RelationField on DiagramModelRelationField { id relationId type nodeType displayName referenceName fromModelId fromModelName fromModelDisplayName fromColumnId fromColumnName fromColumnDisplayName toModelId toModelName toModelDisplayName toColumnId toColumnName toColumnDisplayName description } `; const NESTED_FIELD = gql` fragment NestedField on DiagramModelNestedField { id nestedColumnId columnPath type displayName referenceName description } `; const FIELD = gql` fragment Field on DiagramModelField { id columnId type nodeType displayName referenceName description isPrimaryKey expression aggregation lineage nestedFields { ...NestedField } } ${NESTED_FIELD} `; export const DIAGRAM = gql` query Diagram { diagram { models { id modelId nodeType displayName referenceName sourceTableName refSql cached refreshTime description fields { ...Field } calculatedFields { ...Field } relationFields { ...RelationField } } views { id viewId nodeType displayName description referenceName statement fields { ...ViewField } } } } ${FIELD} ${RELATION_FIELD} ${VIEW_FIELD} `; ================================================ FILE: wren-ui/src/apollo/client/graphql/home.generated.ts ================================================ import * as Types from './__types__'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; const defaultOptions = {} as const; export type CommonErrorFragment = { __typename?: 'Error', code?: string | null, shortMessage?: string | null, message?: string | null, stacktrace?: Array | null }; export type CommonBreakdownDetailFragment = { __typename?: 'ThreadResponseBreakdownDetail', queryId?: string | null, status: Types.AskingTaskStatus, description?: string | null, steps?: Array<{ __typename?: 'DetailStep', summary: string, sql: string, cteName?: string | null }> | null, error?: { __typename?: 'Error', code?: string | null, shortMessage?: string | null, message?: string | null, stacktrace?: Array | null } | null }; export type CommonAnswerDetailFragment = { __typename?: 'ThreadResponseAnswerDetail', queryId?: string | null, status?: Types.ThreadResponseAnswerStatus | null, content?: string | null, numRowsUsedInLLM?: number | null, error?: { __typename?: 'Error', code?: string | null, shortMessage?: string | null, message?: string | null, stacktrace?: Array | null } | null }; export type CommonChartDetailFragment = { __typename?: 'ThreadResponseChartDetail', queryId?: string | null, status: Types.ChartTaskStatus, description?: string | null, chartType?: Types.ChartType | null, chartSchema?: any | null, adjustment?: boolean | null, error?: { __typename?: 'Error', code?: string | null, shortMessage?: string | null, message?: string | null, stacktrace?: Array | null } | null }; export type CommonAskingTaskFragment = { __typename?: 'AskingTask', status: Types.AskingTaskStatus, type?: Types.AskingTaskType | null, rephrasedQuestion?: string | null, intentReasoning?: string | null, sqlGenerationReasoning?: string | null, retrievedTables?: Array | null, invalidSql?: string | null, traceId?: string | null, queryId?: string | null, candidates: Array<{ __typename?: 'ResultCandidate', sql: string, type: Types.ResultCandidateType, view?: { __typename?: 'ViewInfo', id: number, name: string, statement: string, displayName: string } | null, sqlPair?: { __typename?: 'SqlPair', id: number, question: string, sql: string, projectId: number } | null }>, error?: { __typename?: 'Error', code?: string | null, shortMessage?: string | null, message?: string | null, stacktrace?: Array | null } | null }; export type CommonResponseFragment = { __typename?: 'ThreadResponse', id: number, threadId: number, question: string, sql?: string | null, view?: { __typename?: 'ViewInfo', id: number, name: string, statement: string, displayName: string } | null, breakdownDetail?: { __typename?: 'ThreadResponseBreakdownDetail', queryId?: string | null, status: Types.AskingTaskStatus, description?: string | null, steps?: Array<{ __typename?: 'DetailStep', summary: string, sql: string, cteName?: string | null }> | null, error?: { __typename?: 'Error', code?: string | null, shortMessage?: string | null, message?: string | null, stacktrace?: Array | null } | null } | null, answerDetail?: { __typename?: 'ThreadResponseAnswerDetail', queryId?: string | null, status?: Types.ThreadResponseAnswerStatus | null, content?: string | null, numRowsUsedInLLM?: number | null, error?: { __typename?: 'Error', code?: string | null, shortMessage?: string | null, message?: string | null, stacktrace?: Array | null } | null } | null, chartDetail?: { __typename?: 'ThreadResponseChartDetail', queryId?: string | null, status: Types.ChartTaskStatus, description?: string | null, chartType?: Types.ChartType | null, chartSchema?: any | null, adjustment?: boolean | null, error?: { __typename?: 'Error', code?: string | null, shortMessage?: string | null, message?: string | null, stacktrace?: Array | null } | null } | null, askingTask?: { __typename?: 'AskingTask', status: Types.AskingTaskStatus, type?: Types.AskingTaskType | null, rephrasedQuestion?: string | null, intentReasoning?: string | null, sqlGenerationReasoning?: string | null, retrievedTables?: Array | null, invalidSql?: string | null, traceId?: string | null, queryId?: string | null, candidates: Array<{ __typename?: 'ResultCandidate', sql: string, type: Types.ResultCandidateType, view?: { __typename?: 'ViewInfo', id: number, name: string, statement: string, displayName: string } | null, sqlPair?: { __typename?: 'SqlPair', id: number, question: string, sql: string, projectId: number } | null }>, error?: { __typename?: 'Error', code?: string | null, shortMessage?: string | null, message?: string | null, stacktrace?: Array | null } | null } | null, adjustment?: { __typename?: 'ThreadResponseAdjustment', type: Types.ThreadResponseAdjustmentType, payload?: any | null } | null, adjustmentTask?: { __typename?: 'AdjustmentTask', queryId?: string | null, status?: Types.AskingTaskStatus | null, sql?: string | null, traceId?: string | null, invalidSql?: string | null, error?: { __typename?: 'Error', code?: string | null, shortMessage?: string | null, message?: string | null, stacktrace?: Array | null } | null } | null }; export type CommonRecommendedQuestionsTaskFragment = { __typename?: 'RecommendedQuestionsTask', status: Types.RecommendedQuestionsTaskStatus, questions: Array<{ __typename?: 'ResultQuestion', question: string, category: string, sql: string }>, error?: { __typename?: 'Error', code?: string | null, shortMessage?: string | null, message?: string | null, stacktrace?: Array | null } | null }; export type SuggestedQuestionsQueryVariables = Types.Exact<{ [key: string]: never; }>; export type SuggestedQuestionsQuery = { __typename?: 'Query', suggestedQuestions: { __typename?: 'SuggestedQuestionResponse', questions: Array<{ __typename?: 'SuggestedQuestion', label: string, question: string } | null> } }; export type AskingTaskQueryVariables = Types.Exact<{ taskId: Types.Scalars['String']; }>; export type AskingTaskQuery = { __typename?: 'Query', askingTask?: { __typename?: 'AskingTask', status: Types.AskingTaskStatus, type?: Types.AskingTaskType | null, rephrasedQuestion?: string | null, intentReasoning?: string | null, sqlGenerationReasoning?: string | null, retrievedTables?: Array | null, invalidSql?: string | null, traceId?: string | null, queryId?: string | null, candidates: Array<{ __typename?: 'ResultCandidate', sql: string, type: Types.ResultCandidateType, view?: { __typename?: 'ViewInfo', id: number, name: string, statement: string, displayName: string } | null, sqlPair?: { __typename?: 'SqlPair', id: number, question: string, sql: string, projectId: number } | null }>, error?: { __typename?: 'Error', code?: string | null, shortMessage?: string | null, message?: string | null, stacktrace?: Array | null } | null } | null }; export type ThreadsQueryVariables = Types.Exact<{ [key: string]: never; }>; export type ThreadsQuery = { __typename?: 'Query', threads: Array<{ __typename?: 'Thread', id: number, summary: string }> }; export type ThreadQueryVariables = Types.Exact<{ threadId: Types.Scalars['Int']; }>; export type ThreadQuery = { __typename?: 'Query', thread: { __typename?: 'DetailedThread', id: number, responses: Array<{ __typename?: 'ThreadResponse', id: number, threadId: number, question: string, sql?: string | null, view?: { __typename?: 'ViewInfo', id: number, name: string, statement: string, displayName: string } | null, breakdownDetail?: { __typename?: 'ThreadResponseBreakdownDetail', queryId?: string | null, status: Types.AskingTaskStatus, description?: string | null, steps?: Array<{ __typename?: 'DetailStep', summary: string, sql: string, cteName?: string | null }> | null, error?: { __typename?: 'Error', code?: string | null, shortMessage?: string | null, message?: string | null, stacktrace?: Array | null } | null } | null, answerDetail?: { __typename?: 'ThreadResponseAnswerDetail', queryId?: string | null, status?: Types.ThreadResponseAnswerStatus | null, content?: string | null, numRowsUsedInLLM?: number | null, error?: { __typename?: 'Error', code?: string | null, shortMessage?: string | null, message?: string | null, stacktrace?: Array | null } | null } | null, chartDetail?: { __typename?: 'ThreadResponseChartDetail', queryId?: string | null, status: Types.ChartTaskStatus, description?: string | null, chartType?: Types.ChartType | null, chartSchema?: any | null, adjustment?: boolean | null, error?: { __typename?: 'Error', code?: string | null, shortMessage?: string | null, message?: string | null, stacktrace?: Array | null } | null } | null, askingTask?: { __typename?: 'AskingTask', status: Types.AskingTaskStatus, type?: Types.AskingTaskType | null, rephrasedQuestion?: string | null, intentReasoning?: string | null, sqlGenerationReasoning?: string | null, retrievedTables?: Array | null, invalidSql?: string | null, traceId?: string | null, queryId?: string | null, candidates: Array<{ __typename?: 'ResultCandidate', sql: string, type: Types.ResultCandidateType, view?: { __typename?: 'ViewInfo', id: number, name: string, statement: string, displayName: string } | null, sqlPair?: { __typename?: 'SqlPair', id: number, question: string, sql: string, projectId: number } | null }>, error?: { __typename?: 'Error', code?: string | null, shortMessage?: string | null, message?: string | null, stacktrace?: Array | null } | null } | null, adjustment?: { __typename?: 'ThreadResponseAdjustment', type: Types.ThreadResponseAdjustmentType, payload?: any | null } | null, adjustmentTask?: { __typename?: 'AdjustmentTask', queryId?: string | null, status?: Types.AskingTaskStatus | null, sql?: string | null, traceId?: string | null, invalidSql?: string | null, error?: { __typename?: 'Error', code?: string | null, shortMessage?: string | null, message?: string | null, stacktrace?: Array | null } | null } | null }> } }; export type ThreadResponseQueryVariables = Types.Exact<{ responseId: Types.Scalars['Int']; }>; export type ThreadResponseQuery = { __typename?: 'Query', threadResponse: { __typename?: 'ThreadResponse', id: number, threadId: number, question: string, sql?: string | null, view?: { __typename?: 'ViewInfo', id: number, name: string, statement: string, displayName: string } | null, breakdownDetail?: { __typename?: 'ThreadResponseBreakdownDetail', queryId?: string | null, status: Types.AskingTaskStatus, description?: string | null, steps?: Array<{ __typename?: 'DetailStep', summary: string, sql: string, cteName?: string | null }> | null, error?: { __typename?: 'Error', code?: string | null, shortMessage?: string | null, message?: string | null, stacktrace?: Array | null } | null } | null, answerDetail?: { __typename?: 'ThreadResponseAnswerDetail', queryId?: string | null, status?: Types.ThreadResponseAnswerStatus | null, content?: string | null, numRowsUsedInLLM?: number | null, error?: { __typename?: 'Error', code?: string | null, shortMessage?: string | null, message?: string | null, stacktrace?: Array | null } | null } | null, chartDetail?: { __typename?: 'ThreadResponseChartDetail', queryId?: string | null, status: Types.ChartTaskStatus, description?: string | null, chartType?: Types.ChartType | null, chartSchema?: any | null, adjustment?: boolean | null, error?: { __typename?: 'Error', code?: string | null, shortMessage?: string | null, message?: string | null, stacktrace?: Array | null } | null } | null, askingTask?: { __typename?: 'AskingTask', status: Types.AskingTaskStatus, type?: Types.AskingTaskType | null, rephrasedQuestion?: string | null, intentReasoning?: string | null, sqlGenerationReasoning?: string | null, retrievedTables?: Array | null, invalidSql?: string | null, traceId?: string | null, queryId?: string | null, candidates: Array<{ __typename?: 'ResultCandidate', sql: string, type: Types.ResultCandidateType, view?: { __typename?: 'ViewInfo', id: number, name: string, statement: string, displayName: string } | null, sqlPair?: { __typename?: 'SqlPair', id: number, question: string, sql: string, projectId: number } | null }>, error?: { __typename?: 'Error', code?: string | null, shortMessage?: string | null, message?: string | null, stacktrace?: Array | null } | null } | null, adjustment?: { __typename?: 'ThreadResponseAdjustment', type: Types.ThreadResponseAdjustmentType, payload?: any | null } | null, adjustmentTask?: { __typename?: 'AdjustmentTask', queryId?: string | null, status?: Types.AskingTaskStatus | null, sql?: string | null, traceId?: string | null, invalidSql?: string | null, error?: { __typename?: 'Error', code?: string | null, shortMessage?: string | null, message?: string | null, stacktrace?: Array | null } | null } | null } }; export type CreateAskingTaskMutationVariables = Types.Exact<{ data: Types.AskingTaskInput; }>; export type CreateAskingTaskMutation = { __typename?: 'Mutation', createAskingTask: { __typename?: 'Task', id: string } }; export type CancelAskingTaskMutationVariables = Types.Exact<{ taskId: Types.Scalars['String']; }>; export type CancelAskingTaskMutation = { __typename?: 'Mutation', cancelAskingTask: boolean }; export type RerunAskingTaskMutationVariables = Types.Exact<{ responseId: Types.Scalars['Int']; }>; export type RerunAskingTaskMutation = { __typename?: 'Mutation', rerunAskingTask: { __typename?: 'Task', id: string } }; export type CreateThreadMutationVariables = Types.Exact<{ data: Types.CreateThreadInput; }>; export type CreateThreadMutation = { __typename?: 'Mutation', createThread: { __typename?: 'Thread', id: number } }; export type CreateThreadResponseMutationVariables = Types.Exact<{ threadId: Types.Scalars['Int']; data: Types.CreateThreadResponseInput; }>; export type CreateThreadResponseMutation = { __typename?: 'Mutation', createThreadResponse: { __typename?: 'ThreadResponse', id: number, threadId: number, question: string, sql?: string | null, view?: { __typename?: 'ViewInfo', id: number, name: string, statement: string, displayName: string } | null, breakdownDetail?: { __typename?: 'ThreadResponseBreakdownDetail', queryId?: string | null, status: Types.AskingTaskStatus, description?: string | null, steps?: Array<{ __typename?: 'DetailStep', summary: string, sql: string, cteName?: string | null }> | null, error?: { __typename?: 'Error', code?: string | null, shortMessage?: string | null, message?: string | null, stacktrace?: Array | null } | null } | null, answerDetail?: { __typename?: 'ThreadResponseAnswerDetail', queryId?: string | null, status?: Types.ThreadResponseAnswerStatus | null, content?: string | null, numRowsUsedInLLM?: number | null, error?: { __typename?: 'Error', code?: string | null, shortMessage?: string | null, message?: string | null, stacktrace?: Array | null } | null } | null, chartDetail?: { __typename?: 'ThreadResponseChartDetail', queryId?: string | null, status: Types.ChartTaskStatus, description?: string | null, chartType?: Types.ChartType | null, chartSchema?: any | null, adjustment?: boolean | null, error?: { __typename?: 'Error', code?: string | null, shortMessage?: string | null, message?: string | null, stacktrace?: Array | null } | null } | null, askingTask?: { __typename?: 'AskingTask', status: Types.AskingTaskStatus, type?: Types.AskingTaskType | null, rephrasedQuestion?: string | null, intentReasoning?: string | null, sqlGenerationReasoning?: string | null, retrievedTables?: Array | null, invalidSql?: string | null, traceId?: string | null, queryId?: string | null, candidates: Array<{ __typename?: 'ResultCandidate', sql: string, type: Types.ResultCandidateType, view?: { __typename?: 'ViewInfo', id: number, name: string, statement: string, displayName: string } | null, sqlPair?: { __typename?: 'SqlPair', id: number, question: string, sql: string, projectId: number } | null }>, error?: { __typename?: 'Error', code?: string | null, shortMessage?: string | null, message?: string | null, stacktrace?: Array | null } | null } | null, adjustment?: { __typename?: 'ThreadResponseAdjustment', type: Types.ThreadResponseAdjustmentType, payload?: any | null } | null, adjustmentTask?: { __typename?: 'AdjustmentTask', queryId?: string | null, status?: Types.AskingTaskStatus | null, sql?: string | null, traceId?: string | null, invalidSql?: string | null, error?: { __typename?: 'Error', code?: string | null, shortMessage?: string | null, message?: string | null, stacktrace?: Array | null } | null } | null } }; export type UpdateThreadMutationVariables = Types.Exact<{ where: Types.ThreadUniqueWhereInput; data: Types.UpdateThreadInput; }>; export type UpdateThreadMutation = { __typename?: 'Mutation', updateThread: { __typename?: 'Thread', id: number, summary: string } }; export type UpdateThreadResponseMutationVariables = Types.Exact<{ where: Types.ThreadResponseUniqueWhereInput; data: Types.UpdateThreadResponseInput; }>; export type UpdateThreadResponseMutation = { __typename?: 'Mutation', updateThreadResponse: { __typename?: 'ThreadResponse', id: number, threadId: number, question: string, sql?: string | null, view?: { __typename?: 'ViewInfo', id: number, name: string, statement: string, displayName: string } | null, breakdownDetail?: { __typename?: 'ThreadResponseBreakdownDetail', queryId?: string | null, status: Types.AskingTaskStatus, description?: string | null, steps?: Array<{ __typename?: 'DetailStep', summary: string, sql: string, cteName?: string | null }> | null, error?: { __typename?: 'Error', code?: string | null, shortMessage?: string | null, message?: string | null, stacktrace?: Array | null } | null } | null, answerDetail?: { __typename?: 'ThreadResponseAnswerDetail', queryId?: string | null, status?: Types.ThreadResponseAnswerStatus | null, content?: string | null, numRowsUsedInLLM?: number | null, error?: { __typename?: 'Error', code?: string | null, shortMessage?: string | null, message?: string | null, stacktrace?: Array | null } | null } | null, chartDetail?: { __typename?: 'ThreadResponseChartDetail', queryId?: string | null, status: Types.ChartTaskStatus, description?: string | null, chartType?: Types.ChartType | null, chartSchema?: any | null, adjustment?: boolean | null, error?: { __typename?: 'Error', code?: string | null, shortMessage?: string | null, message?: string | null, stacktrace?: Array | null } | null } | null, askingTask?: { __typename?: 'AskingTask', status: Types.AskingTaskStatus, type?: Types.AskingTaskType | null, rephrasedQuestion?: string | null, intentReasoning?: string | null, sqlGenerationReasoning?: string | null, retrievedTables?: Array | null, invalidSql?: string | null, traceId?: string | null, queryId?: string | null, candidates: Array<{ __typename?: 'ResultCandidate', sql: string, type: Types.ResultCandidateType, view?: { __typename?: 'ViewInfo', id: number, name: string, statement: string, displayName: string } | null, sqlPair?: { __typename?: 'SqlPair', id: number, question: string, sql: string, projectId: number } | null }>, error?: { __typename?: 'Error', code?: string | null, shortMessage?: string | null, message?: string | null, stacktrace?: Array | null } | null } | null, adjustment?: { __typename?: 'ThreadResponseAdjustment', type: Types.ThreadResponseAdjustmentType, payload?: any | null } | null, adjustmentTask?: { __typename?: 'AdjustmentTask', queryId?: string | null, status?: Types.AskingTaskStatus | null, sql?: string | null, traceId?: string | null, invalidSql?: string | null, error?: { __typename?: 'Error', code?: string | null, shortMessage?: string | null, message?: string | null, stacktrace?: Array | null } | null } | null } }; export type AdjustThreadResponseMutationVariables = Types.Exact<{ responseId: Types.Scalars['Int']; data: Types.AdjustThreadResponseInput; }>; export type AdjustThreadResponseMutation = { __typename?: 'Mutation', adjustThreadResponse: { __typename?: 'ThreadResponse', id: number, threadId: number, question: string, sql?: string | null, view?: { __typename?: 'ViewInfo', id: number, name: string, statement: string, displayName: string } | null, breakdownDetail?: { __typename?: 'ThreadResponseBreakdownDetail', queryId?: string | null, status: Types.AskingTaskStatus, description?: string | null, steps?: Array<{ __typename?: 'DetailStep', summary: string, sql: string, cteName?: string | null }> | null, error?: { __typename?: 'Error', code?: string | null, shortMessage?: string | null, message?: string | null, stacktrace?: Array | null } | null } | null, answerDetail?: { __typename?: 'ThreadResponseAnswerDetail', queryId?: string | null, status?: Types.ThreadResponseAnswerStatus | null, content?: string | null, numRowsUsedInLLM?: number | null, error?: { __typename?: 'Error', code?: string | null, shortMessage?: string | null, message?: string | null, stacktrace?: Array | null } | null } | null, chartDetail?: { __typename?: 'ThreadResponseChartDetail', queryId?: string | null, status: Types.ChartTaskStatus, description?: string | null, chartType?: Types.ChartType | null, chartSchema?: any | null, adjustment?: boolean | null, error?: { __typename?: 'Error', code?: string | null, shortMessage?: string | null, message?: string | null, stacktrace?: Array | null } | null } | null, askingTask?: { __typename?: 'AskingTask', status: Types.AskingTaskStatus, type?: Types.AskingTaskType | null, rephrasedQuestion?: string | null, intentReasoning?: string | null, sqlGenerationReasoning?: string | null, retrievedTables?: Array | null, invalidSql?: string | null, traceId?: string | null, queryId?: string | null, candidates: Array<{ __typename?: 'ResultCandidate', sql: string, type: Types.ResultCandidateType, view?: { __typename?: 'ViewInfo', id: number, name: string, statement: string, displayName: string } | null, sqlPair?: { __typename?: 'SqlPair', id: number, question: string, sql: string, projectId: number } | null }>, error?: { __typename?: 'Error', code?: string | null, shortMessage?: string | null, message?: string | null, stacktrace?: Array | null } | null } | null, adjustment?: { __typename?: 'ThreadResponseAdjustment', type: Types.ThreadResponseAdjustmentType, payload?: any | null } | null, adjustmentTask?: { __typename?: 'AdjustmentTask', queryId?: string | null, status?: Types.AskingTaskStatus | null, sql?: string | null, traceId?: string | null, invalidSql?: string | null, error?: { __typename?: 'Error', code?: string | null, shortMessage?: string | null, message?: string | null, stacktrace?: Array | null } | null } | null } }; export type DeleteThreadMutationVariables = Types.Exact<{ where: Types.ThreadUniqueWhereInput; }>; export type DeleteThreadMutation = { __typename?: 'Mutation', deleteThread: boolean }; export type PreviewDataMutationVariables = Types.Exact<{ where: Types.PreviewDataInput; }>; export type PreviewDataMutation = { __typename?: 'Mutation', previewData: any }; export type PreviewBreakdownDataMutationVariables = Types.Exact<{ where: Types.PreviewDataInput; }>; export type PreviewBreakdownDataMutation = { __typename?: 'Mutation', previewBreakdownData: any }; export type GetNativeSqlQueryVariables = Types.Exact<{ responseId: Types.Scalars['Int']; }>; export type GetNativeSqlQuery = { __typename?: 'Query', nativeSql: string }; export type CreateInstantRecommendedQuestionsMutationVariables = Types.Exact<{ data: Types.InstantRecommendedQuestionsInput; }>; export type CreateInstantRecommendedQuestionsMutation = { __typename?: 'Mutation', createInstantRecommendedQuestions: { __typename?: 'Task', id: string } }; export type InstantRecommendedQuestionsQueryVariables = Types.Exact<{ taskId: Types.Scalars['String']; }>; export type InstantRecommendedQuestionsQuery = { __typename?: 'Query', instantRecommendedQuestions: { __typename?: 'RecommendedQuestionsTask', status: Types.RecommendedQuestionsTaskStatus, questions: Array<{ __typename?: 'ResultQuestion', question: string, category: string, sql: string }>, error?: { __typename?: 'Error', code?: string | null, shortMessage?: string | null, message?: string | null, stacktrace?: Array | null } | null } }; export type GetThreadRecommendationQuestionsQueryVariables = Types.Exact<{ threadId: Types.Scalars['Int']; }>; export type GetThreadRecommendationQuestionsQuery = { __typename?: 'Query', getThreadRecommendationQuestions: { __typename?: 'RecommendedQuestionsTask', status: Types.RecommendedQuestionsTaskStatus, questions: Array<{ __typename?: 'ResultQuestion', question: string, category: string, sql: string }>, error?: { __typename?: 'Error', code?: string | null, shortMessage?: string | null, message?: string | null, stacktrace?: Array | null } | null } }; export type GetProjectRecommendationQuestionsQueryVariables = Types.Exact<{ [key: string]: never; }>; export type GetProjectRecommendationQuestionsQuery = { __typename?: 'Query', getProjectRecommendationQuestions: { __typename?: 'RecommendedQuestionsTask', status: Types.RecommendedQuestionsTaskStatus, questions: Array<{ __typename?: 'ResultQuestion', question: string, category: string, sql: string }>, error?: { __typename?: 'Error', code?: string | null, shortMessage?: string | null, message?: string | null, stacktrace?: Array | null } | null } }; export type GenerateProjectRecommendationQuestionsMutationVariables = Types.Exact<{ [key: string]: never; }>; export type GenerateProjectRecommendationQuestionsMutation = { __typename?: 'Mutation', generateProjectRecommendationQuestions: boolean }; export type GenerateThreadRecommendationQuestionsMutationVariables = Types.Exact<{ threadId: Types.Scalars['Int']; }>; export type GenerateThreadRecommendationQuestionsMutation = { __typename?: 'Mutation', generateThreadRecommendationQuestions: boolean }; export type GenerateThreadResponseAnswerMutationVariables = Types.Exact<{ responseId: Types.Scalars['Int']; }>; export type GenerateThreadResponseAnswerMutation = { __typename?: 'Mutation', generateThreadResponseAnswer: { __typename?: 'ThreadResponse', id: number, threadId: number, question: string, sql?: string | null, view?: { __typename?: 'ViewInfo', id: number, name: string, statement: string, displayName: string } | null, breakdownDetail?: { __typename?: 'ThreadResponseBreakdownDetail', queryId?: string | null, status: Types.AskingTaskStatus, description?: string | null, steps?: Array<{ __typename?: 'DetailStep', summary: string, sql: string, cteName?: string | null }> | null, error?: { __typename?: 'Error', code?: string | null, shortMessage?: string | null, message?: string | null, stacktrace?: Array | null } | null } | null, answerDetail?: { __typename?: 'ThreadResponseAnswerDetail', queryId?: string | null, status?: Types.ThreadResponseAnswerStatus | null, content?: string | null, numRowsUsedInLLM?: number | null, error?: { __typename?: 'Error', code?: string | null, shortMessage?: string | null, message?: string | null, stacktrace?: Array | null } | null } | null, chartDetail?: { __typename?: 'ThreadResponseChartDetail', queryId?: string | null, status: Types.ChartTaskStatus, description?: string | null, chartType?: Types.ChartType | null, chartSchema?: any | null, adjustment?: boolean | null, error?: { __typename?: 'Error', code?: string | null, shortMessage?: string | null, message?: string | null, stacktrace?: Array | null } | null } | null, askingTask?: { __typename?: 'AskingTask', status: Types.AskingTaskStatus, type?: Types.AskingTaskType | null, rephrasedQuestion?: string | null, intentReasoning?: string | null, sqlGenerationReasoning?: string | null, retrievedTables?: Array | null, invalidSql?: string | null, traceId?: string | null, queryId?: string | null, candidates: Array<{ __typename?: 'ResultCandidate', sql: string, type: Types.ResultCandidateType, view?: { __typename?: 'ViewInfo', id: number, name: string, statement: string, displayName: string } | null, sqlPair?: { __typename?: 'SqlPair', id: number, question: string, sql: string, projectId: number } | null }>, error?: { __typename?: 'Error', code?: string | null, shortMessage?: string | null, message?: string | null, stacktrace?: Array | null } | null } | null, adjustment?: { __typename?: 'ThreadResponseAdjustment', type: Types.ThreadResponseAdjustmentType, payload?: any | null } | null, adjustmentTask?: { __typename?: 'AdjustmentTask', queryId?: string | null, status?: Types.AskingTaskStatus | null, sql?: string | null, traceId?: string | null, invalidSql?: string | null, error?: { __typename?: 'Error', code?: string | null, shortMessage?: string | null, message?: string | null, stacktrace?: Array | null } | null } | null } }; export type GenerateThreadResponseChartMutationVariables = Types.Exact<{ responseId: Types.Scalars['Int']; }>; export type GenerateThreadResponseChartMutation = { __typename?: 'Mutation', generateThreadResponseChart: { __typename?: 'ThreadResponse', id: number, threadId: number, question: string, sql?: string | null, view?: { __typename?: 'ViewInfo', id: number, name: string, statement: string, displayName: string } | null, breakdownDetail?: { __typename?: 'ThreadResponseBreakdownDetail', queryId?: string | null, status: Types.AskingTaskStatus, description?: string | null, steps?: Array<{ __typename?: 'DetailStep', summary: string, sql: string, cteName?: string | null }> | null, error?: { __typename?: 'Error', code?: string | null, shortMessage?: string | null, message?: string | null, stacktrace?: Array | null } | null } | null, answerDetail?: { __typename?: 'ThreadResponseAnswerDetail', queryId?: string | null, status?: Types.ThreadResponseAnswerStatus | null, content?: string | null, numRowsUsedInLLM?: number | null, error?: { __typename?: 'Error', code?: string | null, shortMessage?: string | null, message?: string | null, stacktrace?: Array | null } | null } | null, chartDetail?: { __typename?: 'ThreadResponseChartDetail', queryId?: string | null, status: Types.ChartTaskStatus, description?: string | null, chartType?: Types.ChartType | null, chartSchema?: any | null, adjustment?: boolean | null, error?: { __typename?: 'Error', code?: string | null, shortMessage?: string | null, message?: string | null, stacktrace?: Array | null } | null } | null, askingTask?: { __typename?: 'AskingTask', status: Types.AskingTaskStatus, type?: Types.AskingTaskType | null, rephrasedQuestion?: string | null, intentReasoning?: string | null, sqlGenerationReasoning?: string | null, retrievedTables?: Array | null, invalidSql?: string | null, traceId?: string | null, queryId?: string | null, candidates: Array<{ __typename?: 'ResultCandidate', sql: string, type: Types.ResultCandidateType, view?: { __typename?: 'ViewInfo', id: number, name: string, statement: string, displayName: string } | null, sqlPair?: { __typename?: 'SqlPair', id: number, question: string, sql: string, projectId: number } | null }>, error?: { __typename?: 'Error', code?: string | null, shortMessage?: string | null, message?: string | null, stacktrace?: Array | null } | null } | null, adjustment?: { __typename?: 'ThreadResponseAdjustment', type: Types.ThreadResponseAdjustmentType, payload?: any | null } | null, adjustmentTask?: { __typename?: 'AdjustmentTask', queryId?: string | null, status?: Types.AskingTaskStatus | null, sql?: string | null, traceId?: string | null, invalidSql?: string | null, error?: { __typename?: 'Error', code?: string | null, shortMessage?: string | null, message?: string | null, stacktrace?: Array | null } | null } | null } }; export type AdjustThreadResponseChartMutationVariables = Types.Exact<{ responseId: Types.Scalars['Int']; data: Types.AdjustThreadResponseChartInput; }>; export type AdjustThreadResponseChartMutation = { __typename?: 'Mutation', adjustThreadResponseChart: { __typename?: 'ThreadResponse', id: number, threadId: number, question: string, sql?: string | null, view?: { __typename?: 'ViewInfo', id: number, name: string, statement: string, displayName: string } | null, breakdownDetail?: { __typename?: 'ThreadResponseBreakdownDetail', queryId?: string | null, status: Types.AskingTaskStatus, description?: string | null, steps?: Array<{ __typename?: 'DetailStep', summary: string, sql: string, cteName?: string | null }> | null, error?: { __typename?: 'Error', code?: string | null, shortMessage?: string | null, message?: string | null, stacktrace?: Array | null } | null } | null, answerDetail?: { __typename?: 'ThreadResponseAnswerDetail', queryId?: string | null, status?: Types.ThreadResponseAnswerStatus | null, content?: string | null, numRowsUsedInLLM?: number | null, error?: { __typename?: 'Error', code?: string | null, shortMessage?: string | null, message?: string | null, stacktrace?: Array | null } | null } | null, chartDetail?: { __typename?: 'ThreadResponseChartDetail', queryId?: string | null, status: Types.ChartTaskStatus, description?: string | null, chartType?: Types.ChartType | null, chartSchema?: any | null, adjustment?: boolean | null, error?: { __typename?: 'Error', code?: string | null, shortMessage?: string | null, message?: string | null, stacktrace?: Array | null } | null } | null, askingTask?: { __typename?: 'AskingTask', status: Types.AskingTaskStatus, type?: Types.AskingTaskType | null, rephrasedQuestion?: string | null, intentReasoning?: string | null, sqlGenerationReasoning?: string | null, retrievedTables?: Array | null, invalidSql?: string | null, traceId?: string | null, queryId?: string | null, candidates: Array<{ __typename?: 'ResultCandidate', sql: string, type: Types.ResultCandidateType, view?: { __typename?: 'ViewInfo', id: number, name: string, statement: string, displayName: string } | null, sqlPair?: { __typename?: 'SqlPair', id: number, question: string, sql: string, projectId: number } | null }>, error?: { __typename?: 'Error', code?: string | null, shortMessage?: string | null, message?: string | null, stacktrace?: Array | null } | null } | null, adjustment?: { __typename?: 'ThreadResponseAdjustment', type: Types.ThreadResponseAdjustmentType, payload?: any | null } | null, adjustmentTask?: { __typename?: 'AdjustmentTask', queryId?: string | null, status?: Types.AskingTaskStatus | null, sql?: string | null, traceId?: string | null, invalidSql?: string | null, error?: { __typename?: 'Error', code?: string | null, shortMessage?: string | null, message?: string | null, stacktrace?: Array | null } | null } | null } }; export type AdjustmentTaskQueryVariables = Types.Exact<{ taskId: Types.Scalars['String']; }>; export type AdjustmentTaskQuery = { __typename?: 'Query', adjustmentTask?: { __typename?: 'AdjustmentTask', queryId?: string | null, status?: Types.AskingTaskStatus | null, sql?: string | null, traceId?: string | null, invalidSql?: string | null, error?: { __typename?: 'Error', code?: string | null, shortMessage?: string | null, message?: string | null, stacktrace?: Array | null } | null } | null }; export type CancelAdjustmentTaskMutationVariables = Types.Exact<{ taskId: Types.Scalars['String']; }>; export type CancelAdjustmentTaskMutation = { __typename?: 'Mutation', cancelAdjustmentTask: boolean }; export type RerunAdjustmentTaskMutationVariables = Types.Exact<{ responseId: Types.Scalars['Int']; }>; export type RerunAdjustmentTaskMutation = { __typename?: 'Mutation', rerunAdjustmentTask: boolean }; export const CommonErrorFragmentDoc = gql` fragment CommonError on Error { code shortMessage message stacktrace } `; export const CommonBreakdownDetailFragmentDoc = gql` fragment CommonBreakdownDetail on ThreadResponseBreakdownDetail { queryId status description steps { summary sql cteName } error { ...CommonError } } ${CommonErrorFragmentDoc}`; export const CommonAnswerDetailFragmentDoc = gql` fragment CommonAnswerDetail on ThreadResponseAnswerDetail { queryId status content numRowsUsedInLLM error { ...CommonError } } ${CommonErrorFragmentDoc}`; export const CommonChartDetailFragmentDoc = gql` fragment CommonChartDetail on ThreadResponseChartDetail { queryId status description chartType chartSchema error { ...CommonError } adjustment } ${CommonErrorFragmentDoc}`; export const CommonAskingTaskFragmentDoc = gql` fragment CommonAskingTask on AskingTask { status type candidates { sql type view { id name statement displayName } sqlPair { id question sql projectId } } error { ...CommonError } rephrasedQuestion intentReasoning sqlGenerationReasoning retrievedTables invalidSql traceId queryId } ${CommonErrorFragmentDoc}`; export const CommonResponseFragmentDoc = gql` fragment CommonResponse on ThreadResponse { id threadId question sql view { id name statement displayName } breakdownDetail { ...CommonBreakdownDetail } answerDetail { ...CommonAnswerDetail } chartDetail { ...CommonChartDetail } askingTask { ...CommonAskingTask } adjustment { type payload } adjustmentTask { queryId status error { ...CommonError } sql traceId invalidSql } } ${CommonBreakdownDetailFragmentDoc} ${CommonAnswerDetailFragmentDoc} ${CommonChartDetailFragmentDoc} ${CommonAskingTaskFragmentDoc} ${CommonErrorFragmentDoc}`; export const CommonRecommendedQuestionsTaskFragmentDoc = gql` fragment CommonRecommendedQuestionsTask on RecommendedQuestionsTask { status questions { question category sql } error { ...CommonError } } ${CommonErrorFragmentDoc}`; export const SuggestedQuestionsDocument = gql` query SuggestedQuestions { suggestedQuestions { questions { label question } } } `; /** * __useSuggestedQuestionsQuery__ * * To run a query within a React component, call `useSuggestedQuestionsQuery` and pass it any options that fit your needs. * When your component renders, `useSuggestedQuestionsQuery` returns an object from Apollo Client that contains loading, error, and data properties * you can use to render your UI. * * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; * * @example * const { data, loading, error } = useSuggestedQuestionsQuery({ * variables: { * }, * }); */ export function useSuggestedQuestionsQuery(baseOptions?: Apollo.QueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useQuery(SuggestedQuestionsDocument, options); } export function useSuggestedQuestionsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(SuggestedQuestionsDocument, options); } export type SuggestedQuestionsQueryHookResult = ReturnType; export type SuggestedQuestionsLazyQueryHookResult = ReturnType; export type SuggestedQuestionsQueryResult = Apollo.QueryResult; export const AskingTaskDocument = gql` query AskingTask($taskId: String!) { askingTask(taskId: $taskId) { ...CommonAskingTask } } ${CommonAskingTaskFragmentDoc}`; /** * __useAskingTaskQuery__ * * To run a query within a React component, call `useAskingTaskQuery` and pass it any options that fit your needs. * When your component renders, `useAskingTaskQuery` returns an object from Apollo Client that contains loading, error, and data properties * you can use to render your UI. * * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; * * @example * const { data, loading, error } = useAskingTaskQuery({ * variables: { * taskId: // value for 'taskId' * }, * }); */ export function useAskingTaskQuery(baseOptions: Apollo.QueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useQuery(AskingTaskDocument, options); } export function useAskingTaskLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(AskingTaskDocument, options); } export type AskingTaskQueryHookResult = ReturnType; export type AskingTaskLazyQueryHookResult = ReturnType; export type AskingTaskQueryResult = Apollo.QueryResult; export const ThreadsDocument = gql` query Threads { threads { id summary } } `; /** * __useThreadsQuery__ * * To run a query within a React component, call `useThreadsQuery` and pass it any options that fit your needs. * When your component renders, `useThreadsQuery` returns an object from Apollo Client that contains loading, error, and data properties * you can use to render your UI. * * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; * * @example * const { data, loading, error } = useThreadsQuery({ * variables: { * }, * }); */ export function useThreadsQuery(baseOptions?: Apollo.QueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useQuery(ThreadsDocument, options); } export function useThreadsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(ThreadsDocument, options); } export type ThreadsQueryHookResult = ReturnType; export type ThreadsLazyQueryHookResult = ReturnType; export type ThreadsQueryResult = Apollo.QueryResult; export const ThreadDocument = gql` query Thread($threadId: Int!) { thread(threadId: $threadId) { id responses { ...CommonResponse } } } ${CommonResponseFragmentDoc}`; /** * __useThreadQuery__ * * To run a query within a React component, call `useThreadQuery` and pass it any options that fit your needs. * When your component renders, `useThreadQuery` returns an object from Apollo Client that contains loading, error, and data properties * you can use to render your UI. * * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; * * @example * const { data, loading, error } = useThreadQuery({ * variables: { * threadId: // value for 'threadId' * }, * }); */ export function useThreadQuery(baseOptions: Apollo.QueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useQuery(ThreadDocument, options); } export function useThreadLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(ThreadDocument, options); } export type ThreadQueryHookResult = ReturnType; export type ThreadLazyQueryHookResult = ReturnType; export type ThreadQueryResult = Apollo.QueryResult; export const ThreadResponseDocument = gql` query ThreadResponse($responseId: Int!) { threadResponse(responseId: $responseId) { ...CommonResponse } } ${CommonResponseFragmentDoc}`; /** * __useThreadResponseQuery__ * * To run a query within a React component, call `useThreadResponseQuery` and pass it any options that fit your needs. * When your component renders, `useThreadResponseQuery` returns an object from Apollo Client that contains loading, error, and data properties * you can use to render your UI. * * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; * * @example * const { data, loading, error } = useThreadResponseQuery({ * variables: { * responseId: // value for 'responseId' * }, * }); */ export function useThreadResponseQuery(baseOptions: Apollo.QueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useQuery(ThreadResponseDocument, options); } export function useThreadResponseLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(ThreadResponseDocument, options); } export type ThreadResponseQueryHookResult = ReturnType; export type ThreadResponseLazyQueryHookResult = ReturnType; export type ThreadResponseQueryResult = Apollo.QueryResult; export const CreateAskingTaskDocument = gql` mutation CreateAskingTask($data: AskingTaskInput!) { createAskingTask(data: $data) { id } } `; export type CreateAskingTaskMutationFn = Apollo.MutationFunction; /** * __useCreateAskingTaskMutation__ * * To run a mutation, you first call `useCreateAskingTaskMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useCreateAskingTaskMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [createAskingTaskMutation, { data, loading, error }] = useCreateAskingTaskMutation({ * variables: { * data: // value for 'data' * }, * }); */ export function useCreateAskingTaskMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(CreateAskingTaskDocument, options); } export type CreateAskingTaskMutationHookResult = ReturnType; export type CreateAskingTaskMutationResult = Apollo.MutationResult; export type CreateAskingTaskMutationOptions = Apollo.BaseMutationOptions; export const CancelAskingTaskDocument = gql` mutation CancelAskingTask($taskId: String!) { cancelAskingTask(taskId: $taskId) } `; export type CancelAskingTaskMutationFn = Apollo.MutationFunction; /** * __useCancelAskingTaskMutation__ * * To run a mutation, you first call `useCancelAskingTaskMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useCancelAskingTaskMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [cancelAskingTaskMutation, { data, loading, error }] = useCancelAskingTaskMutation({ * variables: { * taskId: // value for 'taskId' * }, * }); */ export function useCancelAskingTaskMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(CancelAskingTaskDocument, options); } export type CancelAskingTaskMutationHookResult = ReturnType; export type CancelAskingTaskMutationResult = Apollo.MutationResult; export type CancelAskingTaskMutationOptions = Apollo.BaseMutationOptions; export const RerunAskingTaskDocument = gql` mutation RerunAskingTask($responseId: Int!) { rerunAskingTask(responseId: $responseId) { id } } `; export type RerunAskingTaskMutationFn = Apollo.MutationFunction; /** * __useRerunAskingTaskMutation__ * * To run a mutation, you first call `useRerunAskingTaskMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useRerunAskingTaskMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [rerunAskingTaskMutation, { data, loading, error }] = useRerunAskingTaskMutation({ * variables: { * responseId: // value for 'responseId' * }, * }); */ export function useRerunAskingTaskMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(RerunAskingTaskDocument, options); } export type RerunAskingTaskMutationHookResult = ReturnType; export type RerunAskingTaskMutationResult = Apollo.MutationResult; export type RerunAskingTaskMutationOptions = Apollo.BaseMutationOptions; export const CreateThreadDocument = gql` mutation CreateThread($data: CreateThreadInput!) { createThread(data: $data) { id } } `; export type CreateThreadMutationFn = Apollo.MutationFunction; /** * __useCreateThreadMutation__ * * To run a mutation, you first call `useCreateThreadMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useCreateThreadMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [createThreadMutation, { data, loading, error }] = useCreateThreadMutation({ * variables: { * data: // value for 'data' * }, * }); */ export function useCreateThreadMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(CreateThreadDocument, options); } export type CreateThreadMutationHookResult = ReturnType; export type CreateThreadMutationResult = Apollo.MutationResult; export type CreateThreadMutationOptions = Apollo.BaseMutationOptions; export const CreateThreadResponseDocument = gql` mutation CreateThreadResponse($threadId: Int!, $data: CreateThreadResponseInput!) { createThreadResponse(threadId: $threadId, data: $data) { ...CommonResponse } } ${CommonResponseFragmentDoc}`; export type CreateThreadResponseMutationFn = Apollo.MutationFunction; /** * __useCreateThreadResponseMutation__ * * To run a mutation, you first call `useCreateThreadResponseMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useCreateThreadResponseMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [createThreadResponseMutation, { data, loading, error }] = useCreateThreadResponseMutation({ * variables: { * threadId: // value for 'threadId' * data: // value for 'data' * }, * }); */ export function useCreateThreadResponseMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(CreateThreadResponseDocument, options); } export type CreateThreadResponseMutationHookResult = ReturnType; export type CreateThreadResponseMutationResult = Apollo.MutationResult; export type CreateThreadResponseMutationOptions = Apollo.BaseMutationOptions; export const UpdateThreadDocument = gql` mutation UpdateThread($where: ThreadUniqueWhereInput!, $data: UpdateThreadInput!) { updateThread(where: $where, data: $data) { id summary } } `; export type UpdateThreadMutationFn = Apollo.MutationFunction; /** * __useUpdateThreadMutation__ * * To run a mutation, you first call `useUpdateThreadMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useUpdateThreadMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [updateThreadMutation, { data, loading, error }] = useUpdateThreadMutation({ * variables: { * where: // value for 'where' * data: // value for 'data' * }, * }); */ export function useUpdateThreadMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(UpdateThreadDocument, options); } export type UpdateThreadMutationHookResult = ReturnType; export type UpdateThreadMutationResult = Apollo.MutationResult; export type UpdateThreadMutationOptions = Apollo.BaseMutationOptions; export const UpdateThreadResponseDocument = gql` mutation UpdateThreadResponse($where: ThreadResponseUniqueWhereInput!, $data: UpdateThreadResponseInput!) { updateThreadResponse(where: $where, data: $data) { ...CommonResponse } } ${CommonResponseFragmentDoc}`; export type UpdateThreadResponseMutationFn = Apollo.MutationFunction; /** * __useUpdateThreadResponseMutation__ * * To run a mutation, you first call `useUpdateThreadResponseMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useUpdateThreadResponseMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [updateThreadResponseMutation, { data, loading, error }] = useUpdateThreadResponseMutation({ * variables: { * where: // value for 'where' * data: // value for 'data' * }, * }); */ export function useUpdateThreadResponseMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(UpdateThreadResponseDocument, options); } export type UpdateThreadResponseMutationHookResult = ReturnType; export type UpdateThreadResponseMutationResult = Apollo.MutationResult; export type UpdateThreadResponseMutationOptions = Apollo.BaseMutationOptions; export const AdjustThreadResponseDocument = gql` mutation AdjustThreadResponse($responseId: Int!, $data: AdjustThreadResponseInput!) { adjustThreadResponse(responseId: $responseId, data: $data) { ...CommonResponse } } ${CommonResponseFragmentDoc}`; export type AdjustThreadResponseMutationFn = Apollo.MutationFunction; /** * __useAdjustThreadResponseMutation__ * * To run a mutation, you first call `useAdjustThreadResponseMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useAdjustThreadResponseMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [adjustThreadResponseMutation, { data, loading, error }] = useAdjustThreadResponseMutation({ * variables: { * responseId: // value for 'responseId' * data: // value for 'data' * }, * }); */ export function useAdjustThreadResponseMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(AdjustThreadResponseDocument, options); } export type AdjustThreadResponseMutationHookResult = ReturnType; export type AdjustThreadResponseMutationResult = Apollo.MutationResult; export type AdjustThreadResponseMutationOptions = Apollo.BaseMutationOptions; export const DeleteThreadDocument = gql` mutation DeleteThread($where: ThreadUniqueWhereInput!) { deleteThread(where: $where) } `; export type DeleteThreadMutationFn = Apollo.MutationFunction; /** * __useDeleteThreadMutation__ * * To run a mutation, you first call `useDeleteThreadMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useDeleteThreadMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [deleteThreadMutation, { data, loading, error }] = useDeleteThreadMutation({ * variables: { * where: // value for 'where' * }, * }); */ export function useDeleteThreadMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(DeleteThreadDocument, options); } export type DeleteThreadMutationHookResult = ReturnType; export type DeleteThreadMutationResult = Apollo.MutationResult; export type DeleteThreadMutationOptions = Apollo.BaseMutationOptions; export const PreviewDataDocument = gql` mutation PreviewData($where: PreviewDataInput!) { previewData(where: $where) } `; export type PreviewDataMutationFn = Apollo.MutationFunction; /** * __usePreviewDataMutation__ * * To run a mutation, you first call `usePreviewDataMutation` within a React component and pass it any options that fit your needs. * When your component renders, `usePreviewDataMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [previewDataMutation, { data, loading, error }] = usePreviewDataMutation({ * variables: { * where: // value for 'where' * }, * }); */ export function usePreviewDataMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(PreviewDataDocument, options); } export type PreviewDataMutationHookResult = ReturnType; export type PreviewDataMutationResult = Apollo.MutationResult; export type PreviewDataMutationOptions = Apollo.BaseMutationOptions; export const PreviewBreakdownDataDocument = gql` mutation PreviewBreakdownData($where: PreviewDataInput!) { previewBreakdownData(where: $where) } `; export type PreviewBreakdownDataMutationFn = Apollo.MutationFunction; /** * __usePreviewBreakdownDataMutation__ * * To run a mutation, you first call `usePreviewBreakdownDataMutation` within a React component and pass it any options that fit your needs. * When your component renders, `usePreviewBreakdownDataMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [previewBreakdownDataMutation, { data, loading, error }] = usePreviewBreakdownDataMutation({ * variables: { * where: // value for 'where' * }, * }); */ export function usePreviewBreakdownDataMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(PreviewBreakdownDataDocument, options); } export type PreviewBreakdownDataMutationHookResult = ReturnType; export type PreviewBreakdownDataMutationResult = Apollo.MutationResult; export type PreviewBreakdownDataMutationOptions = Apollo.BaseMutationOptions; export const GetNativeSqlDocument = gql` query GetNativeSQL($responseId: Int!) { nativeSql(responseId: $responseId) } `; /** * __useGetNativeSqlQuery__ * * To run a query within a React component, call `useGetNativeSqlQuery` and pass it any options that fit your needs. * When your component renders, `useGetNativeSqlQuery` returns an object from Apollo Client that contains loading, error, and data properties * you can use to render your UI. * * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; * * @example * const { data, loading, error } = useGetNativeSqlQuery({ * variables: { * responseId: // value for 'responseId' * }, * }); */ export function useGetNativeSqlQuery(baseOptions: Apollo.QueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useQuery(GetNativeSqlDocument, options); } export function useGetNativeSqlLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(GetNativeSqlDocument, options); } export type GetNativeSqlQueryHookResult = ReturnType; export type GetNativeSqlLazyQueryHookResult = ReturnType; export type GetNativeSqlQueryResult = Apollo.QueryResult; export const CreateInstantRecommendedQuestionsDocument = gql` mutation CreateInstantRecommendedQuestions($data: InstantRecommendedQuestionsInput!) { createInstantRecommendedQuestions(data: $data) { id } } `; export type CreateInstantRecommendedQuestionsMutationFn = Apollo.MutationFunction; /** * __useCreateInstantRecommendedQuestionsMutation__ * * To run a mutation, you first call `useCreateInstantRecommendedQuestionsMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useCreateInstantRecommendedQuestionsMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [createInstantRecommendedQuestionsMutation, { data, loading, error }] = useCreateInstantRecommendedQuestionsMutation({ * variables: { * data: // value for 'data' * }, * }); */ export function useCreateInstantRecommendedQuestionsMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(CreateInstantRecommendedQuestionsDocument, options); } export type CreateInstantRecommendedQuestionsMutationHookResult = ReturnType; export type CreateInstantRecommendedQuestionsMutationResult = Apollo.MutationResult; export type CreateInstantRecommendedQuestionsMutationOptions = Apollo.BaseMutationOptions; export const InstantRecommendedQuestionsDocument = gql` query InstantRecommendedQuestions($taskId: String!) { instantRecommendedQuestions(taskId: $taskId) { ...CommonRecommendedQuestionsTask } } ${CommonRecommendedQuestionsTaskFragmentDoc}`; /** * __useInstantRecommendedQuestionsQuery__ * * To run a query within a React component, call `useInstantRecommendedQuestionsQuery` and pass it any options that fit your needs. * When your component renders, `useInstantRecommendedQuestionsQuery` returns an object from Apollo Client that contains loading, error, and data properties * you can use to render your UI. * * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; * * @example * const { data, loading, error } = useInstantRecommendedQuestionsQuery({ * variables: { * taskId: // value for 'taskId' * }, * }); */ export function useInstantRecommendedQuestionsQuery(baseOptions: Apollo.QueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useQuery(InstantRecommendedQuestionsDocument, options); } export function useInstantRecommendedQuestionsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(InstantRecommendedQuestionsDocument, options); } export type InstantRecommendedQuestionsQueryHookResult = ReturnType; export type InstantRecommendedQuestionsLazyQueryHookResult = ReturnType; export type InstantRecommendedQuestionsQueryResult = Apollo.QueryResult; export const GetThreadRecommendationQuestionsDocument = gql` query GetThreadRecommendationQuestions($threadId: Int!) { getThreadRecommendationQuestions(threadId: $threadId) { ...CommonRecommendedQuestionsTask } } ${CommonRecommendedQuestionsTaskFragmentDoc}`; /** * __useGetThreadRecommendationQuestionsQuery__ * * To run a query within a React component, call `useGetThreadRecommendationQuestionsQuery` and pass it any options that fit your needs. * When your component renders, `useGetThreadRecommendationQuestionsQuery` returns an object from Apollo Client that contains loading, error, and data properties * you can use to render your UI. * * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; * * @example * const { data, loading, error } = useGetThreadRecommendationQuestionsQuery({ * variables: { * threadId: // value for 'threadId' * }, * }); */ export function useGetThreadRecommendationQuestionsQuery(baseOptions: Apollo.QueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useQuery(GetThreadRecommendationQuestionsDocument, options); } export function useGetThreadRecommendationQuestionsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(GetThreadRecommendationQuestionsDocument, options); } export type GetThreadRecommendationQuestionsQueryHookResult = ReturnType; export type GetThreadRecommendationQuestionsLazyQueryHookResult = ReturnType; export type GetThreadRecommendationQuestionsQueryResult = Apollo.QueryResult; export const GetProjectRecommendationQuestionsDocument = gql` query GetProjectRecommendationQuestions { getProjectRecommendationQuestions { ...CommonRecommendedQuestionsTask } } ${CommonRecommendedQuestionsTaskFragmentDoc}`; /** * __useGetProjectRecommendationQuestionsQuery__ * * To run a query within a React component, call `useGetProjectRecommendationQuestionsQuery` and pass it any options that fit your needs. * When your component renders, `useGetProjectRecommendationQuestionsQuery` returns an object from Apollo Client that contains loading, error, and data properties * you can use to render your UI. * * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; * * @example * const { data, loading, error } = useGetProjectRecommendationQuestionsQuery({ * variables: { * }, * }); */ export function useGetProjectRecommendationQuestionsQuery(baseOptions?: Apollo.QueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useQuery(GetProjectRecommendationQuestionsDocument, options); } export function useGetProjectRecommendationQuestionsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(GetProjectRecommendationQuestionsDocument, options); } export type GetProjectRecommendationQuestionsQueryHookResult = ReturnType; export type GetProjectRecommendationQuestionsLazyQueryHookResult = ReturnType; export type GetProjectRecommendationQuestionsQueryResult = Apollo.QueryResult; export const GenerateProjectRecommendationQuestionsDocument = gql` mutation GenerateProjectRecommendationQuestions { generateProjectRecommendationQuestions } `; export type GenerateProjectRecommendationQuestionsMutationFn = Apollo.MutationFunction; /** * __useGenerateProjectRecommendationQuestionsMutation__ * * To run a mutation, you first call `useGenerateProjectRecommendationQuestionsMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useGenerateProjectRecommendationQuestionsMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [generateProjectRecommendationQuestionsMutation, { data, loading, error }] = useGenerateProjectRecommendationQuestionsMutation({ * variables: { * }, * }); */ export function useGenerateProjectRecommendationQuestionsMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(GenerateProjectRecommendationQuestionsDocument, options); } export type GenerateProjectRecommendationQuestionsMutationHookResult = ReturnType; export type GenerateProjectRecommendationQuestionsMutationResult = Apollo.MutationResult; export type GenerateProjectRecommendationQuestionsMutationOptions = Apollo.BaseMutationOptions; export const GenerateThreadRecommendationQuestionsDocument = gql` mutation GenerateThreadRecommendationQuestions($threadId: Int!) { generateThreadRecommendationQuestions(threadId: $threadId) } `; export type GenerateThreadRecommendationQuestionsMutationFn = Apollo.MutationFunction; /** * __useGenerateThreadRecommendationQuestionsMutation__ * * To run a mutation, you first call `useGenerateThreadRecommendationQuestionsMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useGenerateThreadRecommendationQuestionsMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [generateThreadRecommendationQuestionsMutation, { data, loading, error }] = useGenerateThreadRecommendationQuestionsMutation({ * variables: { * threadId: // value for 'threadId' * }, * }); */ export function useGenerateThreadRecommendationQuestionsMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(GenerateThreadRecommendationQuestionsDocument, options); } export type GenerateThreadRecommendationQuestionsMutationHookResult = ReturnType; export type GenerateThreadRecommendationQuestionsMutationResult = Apollo.MutationResult; export type GenerateThreadRecommendationQuestionsMutationOptions = Apollo.BaseMutationOptions; export const GenerateThreadResponseAnswerDocument = gql` mutation GenerateThreadResponseAnswer($responseId: Int!) { generateThreadResponseAnswer(responseId: $responseId) { ...CommonResponse } } ${CommonResponseFragmentDoc}`; export type GenerateThreadResponseAnswerMutationFn = Apollo.MutationFunction; /** * __useGenerateThreadResponseAnswerMutation__ * * To run a mutation, you first call `useGenerateThreadResponseAnswerMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useGenerateThreadResponseAnswerMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [generateThreadResponseAnswerMutation, { data, loading, error }] = useGenerateThreadResponseAnswerMutation({ * variables: { * responseId: // value for 'responseId' * }, * }); */ export function useGenerateThreadResponseAnswerMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(GenerateThreadResponseAnswerDocument, options); } export type GenerateThreadResponseAnswerMutationHookResult = ReturnType; export type GenerateThreadResponseAnswerMutationResult = Apollo.MutationResult; export type GenerateThreadResponseAnswerMutationOptions = Apollo.BaseMutationOptions; export const GenerateThreadResponseChartDocument = gql` mutation GenerateThreadResponseChart($responseId: Int!) { generateThreadResponseChart(responseId: $responseId) { ...CommonResponse } } ${CommonResponseFragmentDoc}`; export type GenerateThreadResponseChartMutationFn = Apollo.MutationFunction; /** * __useGenerateThreadResponseChartMutation__ * * To run a mutation, you first call `useGenerateThreadResponseChartMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useGenerateThreadResponseChartMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [generateThreadResponseChartMutation, { data, loading, error }] = useGenerateThreadResponseChartMutation({ * variables: { * responseId: // value for 'responseId' * }, * }); */ export function useGenerateThreadResponseChartMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(GenerateThreadResponseChartDocument, options); } export type GenerateThreadResponseChartMutationHookResult = ReturnType; export type GenerateThreadResponseChartMutationResult = Apollo.MutationResult; export type GenerateThreadResponseChartMutationOptions = Apollo.BaseMutationOptions; export const AdjustThreadResponseChartDocument = gql` mutation AdjustThreadResponseChart($responseId: Int!, $data: AdjustThreadResponseChartInput!) { adjustThreadResponseChart(responseId: $responseId, data: $data) { ...CommonResponse } } ${CommonResponseFragmentDoc}`; export type AdjustThreadResponseChartMutationFn = Apollo.MutationFunction; /** * __useAdjustThreadResponseChartMutation__ * * To run a mutation, you first call `useAdjustThreadResponseChartMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useAdjustThreadResponseChartMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [adjustThreadResponseChartMutation, { data, loading, error }] = useAdjustThreadResponseChartMutation({ * variables: { * responseId: // value for 'responseId' * data: // value for 'data' * }, * }); */ export function useAdjustThreadResponseChartMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(AdjustThreadResponseChartDocument, options); } export type AdjustThreadResponseChartMutationHookResult = ReturnType; export type AdjustThreadResponseChartMutationResult = Apollo.MutationResult; export type AdjustThreadResponseChartMutationOptions = Apollo.BaseMutationOptions; export const AdjustmentTaskDocument = gql` query AdjustmentTask($taskId: String!) { adjustmentTask(taskId: $taskId) { queryId status error { code shortMessage message stacktrace } sql traceId invalidSql } } `; /** * __useAdjustmentTaskQuery__ * * To run a query within a React component, call `useAdjustmentTaskQuery` and pass it any options that fit your needs. * When your component renders, `useAdjustmentTaskQuery` returns an object from Apollo Client that contains loading, error, and data properties * you can use to render your UI. * * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; * * @example * const { data, loading, error } = useAdjustmentTaskQuery({ * variables: { * taskId: // value for 'taskId' * }, * }); */ export function useAdjustmentTaskQuery(baseOptions: Apollo.QueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useQuery(AdjustmentTaskDocument, options); } export function useAdjustmentTaskLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(AdjustmentTaskDocument, options); } export type AdjustmentTaskQueryHookResult = ReturnType; export type AdjustmentTaskLazyQueryHookResult = ReturnType; export type AdjustmentTaskQueryResult = Apollo.QueryResult; export const CancelAdjustmentTaskDocument = gql` mutation CancelAdjustmentTask($taskId: String!) { cancelAdjustmentTask(taskId: $taskId) } `; export type CancelAdjustmentTaskMutationFn = Apollo.MutationFunction; /** * __useCancelAdjustmentTaskMutation__ * * To run a mutation, you first call `useCancelAdjustmentTaskMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useCancelAdjustmentTaskMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [cancelAdjustmentTaskMutation, { data, loading, error }] = useCancelAdjustmentTaskMutation({ * variables: { * taskId: // value for 'taskId' * }, * }); */ export function useCancelAdjustmentTaskMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(CancelAdjustmentTaskDocument, options); } export type CancelAdjustmentTaskMutationHookResult = ReturnType; export type CancelAdjustmentTaskMutationResult = Apollo.MutationResult; export type CancelAdjustmentTaskMutationOptions = Apollo.BaseMutationOptions; export const RerunAdjustmentTaskDocument = gql` mutation RerunAdjustmentTask($responseId: Int!) { rerunAdjustmentTask(responseId: $responseId) } `; export type RerunAdjustmentTaskMutationFn = Apollo.MutationFunction; /** * __useRerunAdjustmentTaskMutation__ * * To run a mutation, you first call `useRerunAdjustmentTaskMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useRerunAdjustmentTaskMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [rerunAdjustmentTaskMutation, { data, loading, error }] = useRerunAdjustmentTaskMutation({ * variables: { * responseId: // value for 'responseId' * }, * }); */ export function useRerunAdjustmentTaskMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(RerunAdjustmentTaskDocument, options); } export type RerunAdjustmentTaskMutationHookResult = ReturnType; export type RerunAdjustmentTaskMutationResult = Apollo.MutationResult; export type RerunAdjustmentTaskMutationOptions = Apollo.BaseMutationOptions; ================================================ FILE: wren-ui/src/apollo/client/graphql/home.ts ================================================ import { gql } from '@apollo/client'; const COMMON_ERROR = gql` fragment CommonError on Error { code shortMessage message stacktrace } `; const COMMON_BREAKDOWN_DETAIL = gql` fragment CommonBreakdownDetail on ThreadResponseBreakdownDetail { queryId status description steps { summary sql cteName } error { ...CommonError } } ${COMMON_ERROR} `; const COMMON_ANSWER_DETAIL = gql` fragment CommonAnswerDetail on ThreadResponseAnswerDetail { queryId status content numRowsUsedInLLM error { ...CommonError } } ${COMMON_ERROR} `; const COMMON_CHART_DETAIL = gql` fragment CommonChartDetail on ThreadResponseChartDetail { queryId status description chartType chartSchema error { ...CommonError } adjustment } `; const COMMON_ASKING_TASK = gql` fragment CommonAskingTask on AskingTask { status type candidates { sql type view { id name statement displayName } sqlPair { id question sql projectId } } error { ...CommonError } rephrasedQuestion intentReasoning sqlGenerationReasoning retrievedTables invalidSql traceId queryId } ${COMMON_ERROR} `; const COMMON_RESPONSE = gql` fragment CommonResponse on ThreadResponse { id threadId question sql view { id name statement displayName } breakdownDetail { ...CommonBreakdownDetail } answerDetail { ...CommonAnswerDetail } chartDetail { ...CommonChartDetail } askingTask { ...CommonAskingTask } adjustment { type payload } adjustmentTask { queryId status error { ...CommonError } sql traceId invalidSql } } ${COMMON_BREAKDOWN_DETAIL} ${COMMON_ANSWER_DETAIL} ${COMMON_CHART_DETAIL} ${COMMON_ASKING_TASK} ${COMMON_ERROR} `; const COMMON_RECOMMENDED_QUESTIONS_TASK = gql` fragment CommonRecommendedQuestionsTask on RecommendedQuestionsTask { status questions { question category sql } error { ...CommonError } } ${COMMON_ERROR} `; export const SUGGESTED_QUESTIONS = gql` query SuggestedQuestions { suggestedQuestions { questions { label question } } } `; export const ASKING_TASK = gql` query AskingTask($taskId: String!) { askingTask(taskId: $taskId) { ...CommonAskingTask } } ${COMMON_ASKING_TASK} `; export const THREADS = gql` query Threads { threads { id summary } } `; export const THREAD = gql` query Thread($threadId: Int!) { thread(threadId: $threadId) { id responses { ...CommonResponse } } } ${COMMON_RESPONSE} `; export const THREAD_RESPONSE = gql` query ThreadResponse($responseId: Int!) { threadResponse(responseId: $responseId) { ...CommonResponse } } ${COMMON_RESPONSE} `; export const CREATE_ASKING_TASK = gql` mutation CreateAskingTask($data: AskingTaskInput!) { createAskingTask(data: $data) { id } } `; export const CANCEL_ASKING_TASK = gql` mutation CancelAskingTask($taskId: String!) { cancelAskingTask(taskId: $taskId) } `; export const RERUN_ASKING_TASK = gql` mutation RerunAskingTask($responseId: Int!) { rerunAskingTask(responseId: $responseId) { id } } `; export const CREATE_THREAD = gql` mutation CreateThread($data: CreateThreadInput!) { createThread(data: $data) { id } } `; export const CREATE_THREAD_RESPONSE = gql` mutation CreateThreadResponse( $threadId: Int! $data: CreateThreadResponseInput! ) { createThreadResponse(threadId: $threadId, data: $data) { ...CommonResponse } } ${COMMON_RESPONSE} `; export const UPDATE_THREAD = gql` mutation UpdateThread( $where: ThreadUniqueWhereInput! $data: UpdateThreadInput! ) { updateThread(where: $where, data: $data) { id summary } } `; export const UPDATE_THREAD_RESPONSE = gql` mutation UpdateThreadResponse( $where: ThreadResponseUniqueWhereInput! $data: UpdateThreadResponseInput! ) { updateThreadResponse(where: $where, data: $data) { ...CommonResponse } } ${COMMON_RESPONSE} `; // For adjust reasoning steps or SQL export const ADJUST_THREAD_RESPONSE = gql` mutation AdjustThreadResponse( $responseId: Int! $data: AdjustThreadResponseInput! ) { adjustThreadResponse(responseId: $responseId, data: $data) { ...CommonResponse } } ${COMMON_RESPONSE} `; export const DELETE_THREAD = gql` mutation DeleteThread($where: ThreadUniqueWhereInput!) { deleteThread(where: $where) } `; // For text-based answer & chart-based answer export const PREVIEW_DATA = gql` mutation PreviewData($where: PreviewDataInput!) { previewData(where: $where) } `; export const PREVIEW_BREAKDOWN_DATA = gql` mutation PreviewBreakdownData($where: PreviewDataInput!) { previewBreakdownData(where: $where) } `; export const GET_NATIVE_SQL = gql` query GetNativeSQL($responseId: Int!) { nativeSql(responseId: $responseId) } `; export const CREATE_INSTANT_RECOMMENDED_QUESTIONS = gql` mutation CreateInstantRecommendedQuestions( $data: InstantRecommendedQuestionsInput! ) { createInstantRecommendedQuestions(data: $data) { id } } `; export const INSTANT_RECOMMENDED_QUESTIONS = gql` query InstantRecommendedQuestions($taskId: String!) { instantRecommendedQuestions(taskId: $taskId) { ...CommonRecommendedQuestionsTask } } ${COMMON_RECOMMENDED_QUESTIONS_TASK} `; export const GET_THREAD_RECOMMENDATION_QUESTIONS = gql` query GetThreadRecommendationQuestions($threadId: Int!) { getThreadRecommendationQuestions(threadId: $threadId) { ...CommonRecommendedQuestionsTask } } ${COMMON_RECOMMENDED_QUESTIONS_TASK} `; export const GET_PROJECT_RECOMMENDATION_QUESTIONS = gql` query GetProjectRecommendationQuestions { getProjectRecommendationQuestions { ...CommonRecommendedQuestionsTask } } ${COMMON_RECOMMENDED_QUESTIONS_TASK} `; export const GENERATE_PROJECT_RECOMMENDATION_QUESTIONS = gql` mutation GenerateProjectRecommendationQuestions { generateProjectRecommendationQuestions } `; export const GENERATE_THREAD_RECOMMENDATION_QUESTIONS = gql` mutation GenerateThreadRecommendationQuestions($threadId: Int!) { generateThreadRecommendationQuestions(threadId: $threadId) } `; export const GENERATE_THREAD_RESPONSE_ANSWER = gql` mutation GenerateThreadResponseAnswer($responseId: Int!) { generateThreadResponseAnswer(responseId: $responseId) { ...CommonResponse } } ${COMMON_RESPONSE} `; export const GENERATE_THREAD_RESPONSE_CHART = gql` mutation GenerateThreadResponseChart($responseId: Int!) { generateThreadResponseChart(responseId: $responseId) { ...CommonResponse } } ${COMMON_RESPONSE} `; export const ADJUST_THREAD_RESPONSE_CHART = gql` mutation AdjustThreadResponseChart( $responseId: Int! $data: AdjustThreadResponseChartInput! ) { adjustThreadResponseChart(responseId: $responseId, data: $data) { ...CommonResponse } } ${COMMON_RESPONSE} `; export const ADJUSTMENT_TASK = gql` query AdjustmentTask($taskId: String!) { adjustmentTask(taskId: $taskId) { queryId status error { code shortMessage message stacktrace } sql traceId invalidSql } } `; export const CANCEL_ADJUSTMENT_TASK = gql` mutation CancelAdjustmentTask($taskId: String!) { cancelAdjustmentTask(taskId: $taskId) } `; export const RERUN_ADJUSTMENT_TASK = gql` mutation RerunAdjustmentTask($responseId: Int!) { rerunAdjustmentTask(responseId: $responseId) } `; ================================================ FILE: wren-ui/src/apollo/client/graphql/instructions.generated.ts ================================================ import * as Types from './__types__'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; const defaultOptions = {} as const; export type InstructionFragment = { __typename?: 'Instruction', id: number, projectId: number, instruction: string, questions: Array, isDefault: boolean, createdAt: string, updatedAt: string }; export type InstructionsQueryVariables = Types.Exact<{ [key: string]: never; }>; export type InstructionsQuery = { __typename?: 'Query', instructions: Array<{ __typename?: 'Instruction', id: number, projectId: number, instruction: string, questions: Array, isDefault: boolean, createdAt: string, updatedAt: string } | null> }; export type CreateInstructionMutationVariables = Types.Exact<{ data: Types.CreateInstructionInput; }>; export type CreateInstructionMutation = { __typename?: 'Mutation', createInstruction: { __typename?: 'Instruction', id: number, projectId: number, instruction: string, questions: Array, isDefault: boolean, createdAt: string, updatedAt: string } }; export type UpdateInstructionMutationVariables = Types.Exact<{ where: Types.InstructionWhereInput; data: Types.UpdateInstructionInput; }>; export type UpdateInstructionMutation = { __typename?: 'Mutation', updateInstruction: { __typename?: 'Instruction', id: number, projectId: number, instruction: string, questions: Array, isDefault: boolean, createdAt: string, updatedAt: string } }; export type DeleteInstructionMutationVariables = Types.Exact<{ where: Types.InstructionWhereInput; }>; export type DeleteInstructionMutation = { __typename?: 'Mutation', deleteInstruction: boolean }; export const InstructionFragmentDoc = gql` fragment Instruction on Instruction { id projectId instruction questions isDefault createdAt updatedAt } `; export const InstructionsDocument = gql` query Instructions { instructions { ...Instruction } } ${InstructionFragmentDoc}`; /** * __useInstructionsQuery__ * * To run a query within a React component, call `useInstructionsQuery` and pass it any options that fit your needs. * When your component renders, `useInstructionsQuery` returns an object from Apollo Client that contains loading, error, and data properties * you can use to render your UI. * * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; * * @example * const { data, loading, error } = useInstructionsQuery({ * variables: { * }, * }); */ export function useInstructionsQuery(baseOptions?: Apollo.QueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useQuery(InstructionsDocument, options); } export function useInstructionsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(InstructionsDocument, options); } export type InstructionsQueryHookResult = ReturnType; export type InstructionsLazyQueryHookResult = ReturnType; export type InstructionsQueryResult = Apollo.QueryResult; export const CreateInstructionDocument = gql` mutation CreateInstruction($data: CreateInstructionInput!) { createInstruction(data: $data) { ...Instruction } } ${InstructionFragmentDoc}`; export type CreateInstructionMutationFn = Apollo.MutationFunction; /** * __useCreateInstructionMutation__ * * To run a mutation, you first call `useCreateInstructionMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useCreateInstructionMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [createInstructionMutation, { data, loading, error }] = useCreateInstructionMutation({ * variables: { * data: // value for 'data' * }, * }); */ export function useCreateInstructionMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(CreateInstructionDocument, options); } export type CreateInstructionMutationHookResult = ReturnType; export type CreateInstructionMutationResult = Apollo.MutationResult; export type CreateInstructionMutationOptions = Apollo.BaseMutationOptions; export const UpdateInstructionDocument = gql` mutation UpdateInstruction($where: InstructionWhereInput!, $data: UpdateInstructionInput!) { updateInstruction(where: $where, data: $data) { ...Instruction } } ${InstructionFragmentDoc}`; export type UpdateInstructionMutationFn = Apollo.MutationFunction; /** * __useUpdateInstructionMutation__ * * To run a mutation, you first call `useUpdateInstructionMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useUpdateInstructionMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [updateInstructionMutation, { data, loading, error }] = useUpdateInstructionMutation({ * variables: { * where: // value for 'where' * data: // value for 'data' * }, * }); */ export function useUpdateInstructionMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(UpdateInstructionDocument, options); } export type UpdateInstructionMutationHookResult = ReturnType; export type UpdateInstructionMutationResult = Apollo.MutationResult; export type UpdateInstructionMutationOptions = Apollo.BaseMutationOptions; export const DeleteInstructionDocument = gql` mutation DeleteInstruction($where: InstructionWhereInput!) { deleteInstruction(where: $where) } `; export type DeleteInstructionMutationFn = Apollo.MutationFunction; /** * __useDeleteInstructionMutation__ * * To run a mutation, you first call `useDeleteInstructionMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useDeleteInstructionMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [deleteInstructionMutation, { data, loading, error }] = useDeleteInstructionMutation({ * variables: { * where: // value for 'where' * }, * }); */ export function useDeleteInstructionMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(DeleteInstructionDocument, options); } export type DeleteInstructionMutationHookResult = ReturnType; export type DeleteInstructionMutationResult = Apollo.MutationResult; export type DeleteInstructionMutationOptions = Apollo.BaseMutationOptions; ================================================ FILE: wren-ui/src/apollo/client/graphql/instructions.ts ================================================ import { gql } from '@apollo/client'; const INSTRUCTION = gql` fragment Instruction on Instruction { id projectId instruction questions isDefault createdAt updatedAt } `; export const LIST_INSTRUCTIONS = gql` query Instructions { instructions { ...Instruction } } ${INSTRUCTION} `; export const CREATE_INSTRUCTION = gql` mutation CreateInstruction($data: CreateInstructionInput!) { createInstruction(data: $data) { ...Instruction } } ${INSTRUCTION} `; export const UPDATE_INSTRUCTION = gql` mutation UpdateInstruction( $where: InstructionWhereInput! $data: UpdateInstructionInput! ) { updateInstruction(where: $where, data: $data) { ...Instruction } } ${INSTRUCTION} `; export const DELETE_INSTRUCTION = gql` mutation DeleteInstruction($where: InstructionWhereInput!) { deleteInstruction(where: $where) } `; ================================================ FILE: wren-ui/src/apollo/client/graphql/learning.generated.ts ================================================ import * as Types from './__types__'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; const defaultOptions = {} as const; export type LearningRecordQueryVariables = Types.Exact<{ [key: string]: never; }>; export type LearningRecordQuery = { __typename?: 'Query', learningRecord: { __typename?: 'LearningRecord', paths: Array } }; export type SaveLearningRecordMutationVariables = Types.Exact<{ data: Types.SaveLearningRecordInput; }>; export type SaveLearningRecordMutation = { __typename?: 'Mutation', saveLearningRecord: { __typename?: 'LearningRecord', paths: Array } }; export const LearningRecordDocument = gql` query LearningRecord { learningRecord { paths } } `; /** * __useLearningRecordQuery__ * * To run a query within a React component, call `useLearningRecordQuery` and pass it any options that fit your needs. * When your component renders, `useLearningRecordQuery` returns an object from Apollo Client that contains loading, error, and data properties * you can use to render your UI. * * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; * * @example * const { data, loading, error } = useLearningRecordQuery({ * variables: { * }, * }); */ export function useLearningRecordQuery(baseOptions?: Apollo.QueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useQuery(LearningRecordDocument, options); } export function useLearningRecordLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(LearningRecordDocument, options); } export type LearningRecordQueryHookResult = ReturnType; export type LearningRecordLazyQueryHookResult = ReturnType; export type LearningRecordQueryResult = Apollo.QueryResult; export const SaveLearningRecordDocument = gql` mutation SaveLearningRecord($data: SaveLearningRecordInput!) { saveLearningRecord(data: $data) { paths } } `; export type SaveLearningRecordMutationFn = Apollo.MutationFunction; /** * __useSaveLearningRecordMutation__ * * To run a mutation, you first call `useSaveLearningRecordMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useSaveLearningRecordMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [saveLearningRecordMutation, { data, loading, error }] = useSaveLearningRecordMutation({ * variables: { * data: // value for 'data' * }, * }); */ export function useSaveLearningRecordMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(SaveLearningRecordDocument, options); } export type SaveLearningRecordMutationHookResult = ReturnType; export type SaveLearningRecordMutationResult = Apollo.MutationResult; export type SaveLearningRecordMutationOptions = Apollo.BaseMutationOptions; ================================================ FILE: wren-ui/src/apollo/client/graphql/learning.ts ================================================ import { gql } from '@apollo/client'; export const LEARNING_RECORD = gql` query LearningRecord { learningRecord { paths } } `; export const SAVE_LEARNING_RECORD = gql` mutation SaveLearningRecord($data: SaveLearningRecordInput!) { saveLearningRecord(data: $data) { paths } } `; ================================================ FILE: wren-ui/src/apollo/client/graphql/metadata.generated.ts ================================================ import * as Types from './__types__'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; const defaultOptions = {} as const; export type UpdateModelMetadataMutationVariables = Types.Exact<{ where: Types.ModelWhereInput; data: Types.UpdateModelMetadataInput; }>; export type UpdateModelMetadataMutation = { __typename?: 'Mutation', updateModelMetadata: boolean }; export type UpdateViewMetadataMutationVariables = Types.Exact<{ where: Types.ViewWhereUniqueInput; data: Types.UpdateViewMetadataInput; }>; export type UpdateViewMetadataMutation = { __typename?: 'Mutation', updateViewMetadata: boolean }; export const UpdateModelMetadataDocument = gql` mutation UpdateModelMetadata($where: ModelWhereInput!, $data: UpdateModelMetadataInput!) { updateModelMetadata(where: $where, data: $data) } `; export type UpdateModelMetadataMutationFn = Apollo.MutationFunction; /** * __useUpdateModelMetadataMutation__ * * To run a mutation, you first call `useUpdateModelMetadataMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useUpdateModelMetadataMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [updateModelMetadataMutation, { data, loading, error }] = useUpdateModelMetadataMutation({ * variables: { * where: // value for 'where' * data: // value for 'data' * }, * }); */ export function useUpdateModelMetadataMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(UpdateModelMetadataDocument, options); } export type UpdateModelMetadataMutationHookResult = ReturnType; export type UpdateModelMetadataMutationResult = Apollo.MutationResult; export type UpdateModelMetadataMutationOptions = Apollo.BaseMutationOptions; export const UpdateViewMetadataDocument = gql` mutation UpdateViewMetadata($where: ViewWhereUniqueInput!, $data: UpdateViewMetadataInput!) { updateViewMetadata(where: $where, data: $data) } `; export type UpdateViewMetadataMutationFn = Apollo.MutationFunction; /** * __useUpdateViewMetadataMutation__ * * To run a mutation, you first call `useUpdateViewMetadataMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useUpdateViewMetadataMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [updateViewMetadataMutation, { data, loading, error }] = useUpdateViewMetadataMutation({ * variables: { * where: // value for 'where' * data: // value for 'data' * }, * }); */ export function useUpdateViewMetadataMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(UpdateViewMetadataDocument, options); } export type UpdateViewMetadataMutationHookResult = ReturnType; export type UpdateViewMetadataMutationResult = Apollo.MutationResult; export type UpdateViewMetadataMutationOptions = Apollo.BaseMutationOptions; ================================================ FILE: wren-ui/src/apollo/client/graphql/metadata.ts ================================================ import { gql } from '@apollo/client'; export const UPDATE_MODEL_METADATA = gql` mutation UpdateModelMetadata( $where: ModelWhereInput! $data: UpdateModelMetadataInput! ) { updateModelMetadata(where: $where, data: $data) } `; export const UPDATE_VIEW_METADATA = gql` mutation UpdateViewMetadata( $where: ViewWhereUniqueInput! $data: UpdateViewMetadataInput! ) { updateViewMetadata(where: $where, data: $data) } `; ================================================ FILE: wren-ui/src/apollo/client/graphql/model.generated.ts ================================================ import * as Types from './__types__'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; const defaultOptions = {} as const; export type CommonColumnFragment = { __typename?: 'DetailedColumn', displayName: string, referenceName: string, sourceColumnName: string, type?: string | null, isCalculated: boolean, notNull: boolean, properties: any }; export type CommonFieldFragment = { __typename?: 'FieldInfo', id: number, displayName: string, referenceName: string, sourceColumnName: string, type?: string | null, isCalculated: boolean, notNull: boolean, expression?: string | null, properties?: any | null }; export type CommonRelationFragment = { __typename?: 'DetailedRelation', fromModelId: number, fromColumnId: number, toModelId: number, toColumnId: number, type: Types.RelationType, name: string }; export type ListModelsQueryVariables = Types.Exact<{ [key: string]: never; }>; export type ListModelsQuery = { __typename?: 'Query', listModels: Array<{ __typename?: 'ModelInfo', id: number, displayName: string, referenceName: string, sourceTableName: string, refSql?: string | null, primaryKey?: string | null, cached: boolean, refreshTime?: string | null, description?: string | null, fields: Array<{ __typename?: 'FieldInfo', id: number, displayName: string, referenceName: string, sourceColumnName: string, type?: string | null, isCalculated: boolean, notNull: boolean, expression?: string | null, properties?: any | null } | null>, calculatedFields: Array<{ __typename?: 'FieldInfo', id: number, displayName: string, referenceName: string, sourceColumnName: string, type?: string | null, isCalculated: boolean, notNull: boolean, expression?: string | null, properties?: any | null } | null> }> }; export type GetModelQueryVariables = Types.Exact<{ where: Types.ModelWhereInput; }>; export type GetModelQuery = { __typename?: 'Query', model: { __typename?: 'DetailedModel', displayName: string, referenceName: string, sourceTableName: string, refSql: string, primaryKey?: string | null, cached: boolean, refreshTime?: string | null, description?: string | null, properties: any, fields?: Array<{ __typename?: 'DetailedColumn', displayName: string, referenceName: string, sourceColumnName: string, type?: string | null, isCalculated: boolean, notNull: boolean, properties: any } | null> | null, calculatedFields?: Array<{ __typename?: 'DetailedColumn', displayName: string, referenceName: string, sourceColumnName: string, type?: string | null, isCalculated: boolean, notNull: boolean, properties: any } | null> | null, relations?: Array<{ __typename?: 'DetailedRelation', fromModelId: number, fromColumnId: number, toModelId: number, toColumnId: number, type: Types.RelationType, name: string } | null> | null } }; export type CreateModelMutationVariables = Types.Exact<{ data: Types.CreateModelInput; }>; export type CreateModelMutation = { __typename?: 'Mutation', createModel: any }; export type UpdateModelMutationVariables = Types.Exact<{ where: Types.ModelWhereInput; data: Types.UpdateModelInput; }>; export type UpdateModelMutation = { __typename?: 'Mutation', updateModel: any }; export type DeleteModelMutationVariables = Types.Exact<{ where: Types.ModelWhereInput; }>; export type DeleteModelMutation = { __typename?: 'Mutation', deleteModel: boolean }; export type PreviewModelDataMutationVariables = Types.Exact<{ where: Types.WhereIdInput; }>; export type PreviewModelDataMutation = { __typename?: 'Mutation', previewModelData: any }; export const CommonColumnFragmentDoc = gql` fragment CommonColumn on DetailedColumn { displayName referenceName sourceColumnName type isCalculated notNull properties } `; export const CommonFieldFragmentDoc = gql` fragment CommonField on FieldInfo { id displayName referenceName sourceColumnName type isCalculated notNull expression properties } `; export const CommonRelationFragmentDoc = gql` fragment CommonRelation on DetailedRelation { fromModelId fromColumnId toModelId toColumnId type name } `; export const ListModelsDocument = gql` query ListModels { listModels { id displayName referenceName sourceTableName refSql primaryKey cached refreshTime description fields { ...CommonField } calculatedFields { ...CommonField } } } ${CommonFieldFragmentDoc}`; /** * __useListModelsQuery__ * * To run a query within a React component, call `useListModelsQuery` and pass it any options that fit your needs. * When your component renders, `useListModelsQuery` returns an object from Apollo Client that contains loading, error, and data properties * you can use to render your UI. * * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; * * @example * const { data, loading, error } = useListModelsQuery({ * variables: { * }, * }); */ export function useListModelsQuery(baseOptions?: Apollo.QueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useQuery(ListModelsDocument, options); } export function useListModelsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(ListModelsDocument, options); } export type ListModelsQueryHookResult = ReturnType; export type ListModelsLazyQueryHookResult = ReturnType; export type ListModelsQueryResult = Apollo.QueryResult; export const GetModelDocument = gql` query GetModel($where: ModelWhereInput!) { model(where: $where) { displayName referenceName sourceTableName refSql primaryKey cached refreshTime description fields { ...CommonColumn } calculatedFields { ...CommonColumn } relations { ...CommonRelation } properties } } ${CommonColumnFragmentDoc} ${CommonRelationFragmentDoc}`; /** * __useGetModelQuery__ * * To run a query within a React component, call `useGetModelQuery` and pass it any options that fit your needs. * When your component renders, `useGetModelQuery` returns an object from Apollo Client that contains loading, error, and data properties * you can use to render your UI. * * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; * * @example * const { data, loading, error } = useGetModelQuery({ * variables: { * where: // value for 'where' * }, * }); */ export function useGetModelQuery(baseOptions: Apollo.QueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useQuery(GetModelDocument, options); } export function useGetModelLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(GetModelDocument, options); } export type GetModelQueryHookResult = ReturnType; export type GetModelLazyQueryHookResult = ReturnType; export type GetModelQueryResult = Apollo.QueryResult; export const CreateModelDocument = gql` mutation CreateModel($data: CreateModelInput!) { createModel(data: $data) } `; export type CreateModelMutationFn = Apollo.MutationFunction; /** * __useCreateModelMutation__ * * To run a mutation, you first call `useCreateModelMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useCreateModelMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [createModelMutation, { data, loading, error }] = useCreateModelMutation({ * variables: { * data: // value for 'data' * }, * }); */ export function useCreateModelMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(CreateModelDocument, options); } export type CreateModelMutationHookResult = ReturnType; export type CreateModelMutationResult = Apollo.MutationResult; export type CreateModelMutationOptions = Apollo.BaseMutationOptions; export const UpdateModelDocument = gql` mutation UpdateModel($where: ModelWhereInput!, $data: UpdateModelInput!) { updateModel(where: $where, data: $data) } `; export type UpdateModelMutationFn = Apollo.MutationFunction; /** * __useUpdateModelMutation__ * * To run a mutation, you first call `useUpdateModelMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useUpdateModelMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [updateModelMutation, { data, loading, error }] = useUpdateModelMutation({ * variables: { * where: // value for 'where' * data: // value for 'data' * }, * }); */ export function useUpdateModelMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(UpdateModelDocument, options); } export type UpdateModelMutationHookResult = ReturnType; export type UpdateModelMutationResult = Apollo.MutationResult; export type UpdateModelMutationOptions = Apollo.BaseMutationOptions; export const DeleteModelDocument = gql` mutation DeleteModel($where: ModelWhereInput!) { deleteModel(where: $where) } `; export type DeleteModelMutationFn = Apollo.MutationFunction; /** * __useDeleteModelMutation__ * * To run a mutation, you first call `useDeleteModelMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useDeleteModelMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [deleteModelMutation, { data, loading, error }] = useDeleteModelMutation({ * variables: { * where: // value for 'where' * }, * }); */ export function useDeleteModelMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(DeleteModelDocument, options); } export type DeleteModelMutationHookResult = ReturnType; export type DeleteModelMutationResult = Apollo.MutationResult; export type DeleteModelMutationOptions = Apollo.BaseMutationOptions; export const PreviewModelDataDocument = gql` mutation PreviewModelData($where: WhereIdInput!) { previewModelData(where: $where) } `; export type PreviewModelDataMutationFn = Apollo.MutationFunction; /** * __usePreviewModelDataMutation__ * * To run a mutation, you first call `usePreviewModelDataMutation` within a React component and pass it any options that fit your needs. * When your component renders, `usePreviewModelDataMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [previewModelDataMutation, { data, loading, error }] = usePreviewModelDataMutation({ * variables: { * where: // value for 'where' * }, * }); */ export function usePreviewModelDataMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(PreviewModelDataDocument, options); } export type PreviewModelDataMutationHookResult = ReturnType; export type PreviewModelDataMutationResult = Apollo.MutationResult; export type PreviewModelDataMutationOptions = Apollo.BaseMutationOptions; ================================================ FILE: wren-ui/src/apollo/client/graphql/model.ts ================================================ import { gql } from '@apollo/client'; const COMMON_COLUMN = gql` fragment CommonColumn on DetailedColumn { displayName referenceName sourceColumnName type isCalculated notNull properties } `; const COMMON_FIELD = gql` fragment CommonField on FieldInfo { id displayName referenceName sourceColumnName type isCalculated notNull expression properties } `; const COMMON_RELATION = gql` fragment CommonRelation on DetailedRelation { fromModelId fromColumnId toModelId toColumnId type name } `; export const LIST_MODELS = gql` query ListModels { listModels { id displayName referenceName sourceTableName refSql primaryKey cached refreshTime description fields { ...CommonField } calculatedFields { ...CommonField } } } ${COMMON_FIELD} `; export const GET_MODEL = gql` query GetModel($where: ModelWhereInput!) { model(where: $where) { displayName referenceName sourceTableName refSql primaryKey cached refreshTime description fields { ...CommonColumn } calculatedFields { ...CommonColumn } relations { ...CommonRelation } properties } } ${COMMON_COLUMN} ${COMMON_RELATION} `; export const CREATE_MODEL = gql` mutation CreateModel($data: CreateModelInput!) { createModel(data: $data) } `; export const UPDATE_MODEL = gql` mutation UpdateModel($where: ModelWhereInput!, $data: UpdateModelInput!) { updateModel(where: $where, data: $data) } `; export const DELETE_MODEL = gql` mutation DeleteModel($where: ModelWhereInput!) { deleteModel(where: $where) } `; export const PREVIEW_MODEL_DATA = gql` mutation PreviewModelData($where: WhereIdInput!) { previewModelData(where: $where) } `; ================================================ FILE: wren-ui/src/apollo/client/graphql/onboarding.generated.ts ================================================ import * as Types from './__types__'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; const defaultOptions = {} as const; export type OnboardingStatusQueryVariables = Types.Exact<{ [key: string]: never; }>; export type OnboardingStatusQuery = { __typename?: 'Query', onboardingStatus: { __typename?: 'OnboardingStatusResponse', status?: Types.OnboardingStatus | null } }; export const OnboardingStatusDocument = gql` query OnboardingStatus { onboardingStatus { status } } `; /** * __useOnboardingStatusQuery__ * * To run a query within a React component, call `useOnboardingStatusQuery` and pass it any options that fit your needs. * When your component renders, `useOnboardingStatusQuery` returns an object from Apollo Client that contains loading, error, and data properties * you can use to render your UI. * * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; * * @example * const { data, loading, error } = useOnboardingStatusQuery({ * variables: { * }, * }); */ export function useOnboardingStatusQuery(baseOptions?: Apollo.QueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useQuery(OnboardingStatusDocument, options); } export function useOnboardingStatusLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(OnboardingStatusDocument, options); } export type OnboardingStatusQueryHookResult = ReturnType; export type OnboardingStatusLazyQueryHookResult = ReturnType; export type OnboardingStatusQueryResult = Apollo.QueryResult; ================================================ FILE: wren-ui/src/apollo/client/graphql/onboarding.ts ================================================ import { gql } from '@apollo/client'; export const ONBOARDING_STATUS = gql` query OnboardingStatus { onboardingStatus { status } } `; ================================================ FILE: wren-ui/src/apollo/client/graphql/relationship.generated.ts ================================================ import * as Types from './__types__'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; const defaultOptions = {} as const; export type CreateRelationshipMutationVariables = Types.Exact<{ data: Types.RelationInput; }>; export type CreateRelationshipMutation = { __typename?: 'Mutation', createRelation: any }; export type UpdateRelationshipMutationVariables = Types.Exact<{ where: Types.WhereIdInput; data: Types.UpdateRelationInput; }>; export type UpdateRelationshipMutation = { __typename?: 'Mutation', updateRelation: any }; export type DeleteRelationshipMutationVariables = Types.Exact<{ where: Types.WhereIdInput; }>; export type DeleteRelationshipMutation = { __typename?: 'Mutation', deleteRelation: boolean }; export const CreateRelationshipDocument = gql` mutation CreateRelationship($data: RelationInput!) { createRelation(data: $data) } `; export type CreateRelationshipMutationFn = Apollo.MutationFunction; /** * __useCreateRelationshipMutation__ * * To run a mutation, you first call `useCreateRelationshipMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useCreateRelationshipMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [createRelationshipMutation, { data, loading, error }] = useCreateRelationshipMutation({ * variables: { * data: // value for 'data' * }, * }); */ export function useCreateRelationshipMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(CreateRelationshipDocument, options); } export type CreateRelationshipMutationHookResult = ReturnType; export type CreateRelationshipMutationResult = Apollo.MutationResult; export type CreateRelationshipMutationOptions = Apollo.BaseMutationOptions; export const UpdateRelationshipDocument = gql` mutation UpdateRelationship($where: WhereIdInput!, $data: UpdateRelationInput!) { updateRelation(where: $where, data: $data) } `; export type UpdateRelationshipMutationFn = Apollo.MutationFunction; /** * __useUpdateRelationshipMutation__ * * To run a mutation, you first call `useUpdateRelationshipMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useUpdateRelationshipMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [updateRelationshipMutation, { data, loading, error }] = useUpdateRelationshipMutation({ * variables: { * where: // value for 'where' * data: // value for 'data' * }, * }); */ export function useUpdateRelationshipMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(UpdateRelationshipDocument, options); } export type UpdateRelationshipMutationHookResult = ReturnType; export type UpdateRelationshipMutationResult = Apollo.MutationResult; export type UpdateRelationshipMutationOptions = Apollo.BaseMutationOptions; export const DeleteRelationshipDocument = gql` mutation DeleteRelationship($where: WhereIdInput!) { deleteRelation(where: $where) } `; export type DeleteRelationshipMutationFn = Apollo.MutationFunction; /** * __useDeleteRelationshipMutation__ * * To run a mutation, you first call `useDeleteRelationshipMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useDeleteRelationshipMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [deleteRelationshipMutation, { data, loading, error }] = useDeleteRelationshipMutation({ * variables: { * where: // value for 'where' * }, * }); */ export function useDeleteRelationshipMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(DeleteRelationshipDocument, options); } export type DeleteRelationshipMutationHookResult = ReturnType; export type DeleteRelationshipMutationResult = Apollo.MutationResult; export type DeleteRelationshipMutationOptions = Apollo.BaseMutationOptions; ================================================ FILE: wren-ui/src/apollo/client/graphql/relationship.ts ================================================ import { gql } from '@apollo/client'; export const CREATE_RELATIONSHIP = gql` mutation CreateRelationship($data: RelationInput!) { createRelation(data: $data) } `; export const UPDATE_RELATIONSHIP = gql` mutation UpdateRelationship( $where: WhereIdInput! $data: UpdateRelationInput! ) { updateRelation(where: $where, data: $data) } `; export const DELETE_RELATIONSHIP = gql` mutation DeleteRelationship($where: WhereIdInput!) { deleteRelation(where: $where) } `; ================================================ FILE: wren-ui/src/apollo/client/graphql/settings.generated.ts ================================================ import * as Types from './__types__'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; const defaultOptions = {} as const; export type GetSettingsQueryVariables = Types.Exact<{ [key: string]: never; }>; export type GetSettingsQuery = { __typename?: 'Query', settings: { __typename?: 'Settings', productVersion: string, language: Types.ProjectLanguage, dataSource: { __typename?: 'DataSource', type: Types.DataSourceName, properties: any, sampleDataset?: Types.SampleDatasetName | null } } }; export type ResetCurrentProjectMutationVariables = Types.Exact<{ [key: string]: never; }>; export type ResetCurrentProjectMutation = { __typename?: 'Mutation', resetCurrentProject: boolean }; export type UpdateCurrentProjectMutationVariables = Types.Exact<{ data: Types.UpdateCurrentProjectInput; }>; export type UpdateCurrentProjectMutation = { __typename?: 'Mutation', updateCurrentProject: boolean }; export const GetSettingsDocument = gql` query GetSettings { settings { productVersion dataSource { type properties sampleDataset } language } } `; /** * __useGetSettingsQuery__ * * To run a query within a React component, call `useGetSettingsQuery` and pass it any options that fit your needs. * When your component renders, `useGetSettingsQuery` returns an object from Apollo Client that contains loading, error, and data properties * you can use to render your UI. * * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; * * @example * const { data, loading, error } = useGetSettingsQuery({ * variables: { * }, * }); */ export function useGetSettingsQuery(baseOptions?: Apollo.QueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useQuery(GetSettingsDocument, options); } export function useGetSettingsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(GetSettingsDocument, options); } export type GetSettingsQueryHookResult = ReturnType; export type GetSettingsLazyQueryHookResult = ReturnType; export type GetSettingsQueryResult = Apollo.QueryResult; export const ResetCurrentProjectDocument = gql` mutation ResetCurrentProject { resetCurrentProject } `; export type ResetCurrentProjectMutationFn = Apollo.MutationFunction; /** * __useResetCurrentProjectMutation__ * * To run a mutation, you first call `useResetCurrentProjectMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useResetCurrentProjectMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [resetCurrentProjectMutation, { data, loading, error }] = useResetCurrentProjectMutation({ * variables: { * }, * }); */ export function useResetCurrentProjectMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(ResetCurrentProjectDocument, options); } export type ResetCurrentProjectMutationHookResult = ReturnType; export type ResetCurrentProjectMutationResult = Apollo.MutationResult; export type ResetCurrentProjectMutationOptions = Apollo.BaseMutationOptions; export const UpdateCurrentProjectDocument = gql` mutation UpdateCurrentProject($data: UpdateCurrentProjectInput!) { updateCurrentProject(data: $data) } `; export type UpdateCurrentProjectMutationFn = Apollo.MutationFunction; /** * __useUpdateCurrentProjectMutation__ * * To run a mutation, you first call `useUpdateCurrentProjectMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useUpdateCurrentProjectMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [updateCurrentProjectMutation, { data, loading, error }] = useUpdateCurrentProjectMutation({ * variables: { * data: // value for 'data' * }, * }); */ export function useUpdateCurrentProjectMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(UpdateCurrentProjectDocument, options); } export type UpdateCurrentProjectMutationHookResult = ReturnType; export type UpdateCurrentProjectMutationResult = Apollo.MutationResult; export type UpdateCurrentProjectMutationOptions = Apollo.BaseMutationOptions; ================================================ FILE: wren-ui/src/apollo/client/graphql/settings.ts ================================================ import { gql } from '@apollo/client'; export const GET_SETTINGS = gql` query GetSettings { settings { productVersion dataSource { type properties sampleDataset } language } } `; export const RESET_CURRENT_PROJECT = gql` mutation ResetCurrentProject { resetCurrentProject } `; export const UPDATE_CURRENT_PROJECT = gql` mutation UpdateCurrentProject($data: UpdateCurrentProjectInput!) { updateCurrentProject(data: $data) } `; ================================================ FILE: wren-ui/src/apollo/client/graphql/sql.generated.ts ================================================ import * as Types from './__types__'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; const defaultOptions = {} as const; export type PreviewSqlMutationVariables = Types.Exact<{ data: Types.PreviewSqlDataInput; }>; export type PreviewSqlMutation = { __typename?: 'Mutation', previewSql: any }; export type GenerateQuestionMutationVariables = Types.Exact<{ data: Types.GenerateQuestionInput; }>; export type GenerateQuestionMutation = { __typename?: 'Mutation', generateQuestion: string }; export type ModelSubstituteMutationVariables = Types.Exact<{ data: Types.ModelSubstituteInput; }>; export type ModelSubstituteMutation = { __typename?: 'Mutation', modelSubstitute: string }; export const PreviewSqlDocument = gql` mutation PreviewSQL($data: PreviewSQLDataInput!) { previewSql(data: $data) } `; export type PreviewSqlMutationFn = Apollo.MutationFunction; /** * __usePreviewSqlMutation__ * * To run a mutation, you first call `usePreviewSqlMutation` within a React component and pass it any options that fit your needs. * When your component renders, `usePreviewSqlMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [previewSqlMutation, { data, loading, error }] = usePreviewSqlMutation({ * variables: { * data: // value for 'data' * }, * }); */ export function usePreviewSqlMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(PreviewSqlDocument, options); } export type PreviewSqlMutationHookResult = ReturnType; export type PreviewSqlMutationResult = Apollo.MutationResult; export type PreviewSqlMutationOptions = Apollo.BaseMutationOptions; export const GenerateQuestionDocument = gql` mutation GenerateQuestion($data: GenerateQuestionInput!) { generateQuestion(data: $data) } `; export type GenerateQuestionMutationFn = Apollo.MutationFunction; /** * __useGenerateQuestionMutation__ * * To run a mutation, you first call `useGenerateQuestionMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useGenerateQuestionMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [generateQuestionMutation, { data, loading, error }] = useGenerateQuestionMutation({ * variables: { * data: // value for 'data' * }, * }); */ export function useGenerateQuestionMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(GenerateQuestionDocument, options); } export type GenerateQuestionMutationHookResult = ReturnType; export type GenerateQuestionMutationResult = Apollo.MutationResult; export type GenerateQuestionMutationOptions = Apollo.BaseMutationOptions; export const ModelSubstituteDocument = gql` mutation ModelSubstitute($data: ModelSubstituteInput!) { modelSubstitute(data: $data) } `; export type ModelSubstituteMutationFn = Apollo.MutationFunction; /** * __useModelSubstituteMutation__ * * To run a mutation, you first call `useModelSubstituteMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useModelSubstituteMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [modelSubstituteMutation, { data, loading, error }] = useModelSubstituteMutation({ * variables: { * data: // value for 'data' * }, * }); */ export function useModelSubstituteMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(ModelSubstituteDocument, options); } export type ModelSubstituteMutationHookResult = ReturnType; export type ModelSubstituteMutationResult = Apollo.MutationResult; export type ModelSubstituteMutationOptions = Apollo.BaseMutationOptions; ================================================ FILE: wren-ui/src/apollo/client/graphql/sql.ts ================================================ import { gql } from '@apollo/client'; export const PREVIEW_SQL_STATEMENT = gql` mutation PreviewSQL($data: PreviewSQLDataInput!) { previewSql(data: $data) } `; export const GENERATE_QUESTION = gql` mutation GenerateQuestion($data: GenerateQuestionInput!) { generateQuestion(data: $data) } `; export const MODEL_SUBSTITUDE = gql` mutation ModelSubstitute($data: ModelSubstituteInput!) { modelSubstitute(data: $data) } `; ================================================ FILE: wren-ui/src/apollo/client/graphql/sqlPairs.generated.ts ================================================ import * as Types from './__types__'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; const defaultOptions = {} as const; export type SqlPairFragment = { __typename?: 'SqlPair', id: number, projectId: number, sql: string, question: string, createdAt?: string | null, updatedAt?: string | null }; export type SqlPairsQueryVariables = Types.Exact<{ [key: string]: never; }>; export type SqlPairsQuery = { __typename?: 'Query', sqlPairs: Array<{ __typename?: 'SqlPair', id: number, projectId: number, sql: string, question: string, createdAt?: string | null, updatedAt?: string | null } | null> }; export type CreateSqlPairMutationVariables = Types.Exact<{ data: Types.CreateSqlPairInput; }>; export type CreateSqlPairMutation = { __typename?: 'Mutation', createSqlPair: { __typename?: 'SqlPair', id: number, projectId: number, sql: string, question: string, createdAt?: string | null, updatedAt?: string | null } }; export type UpdateSqlPairMutationVariables = Types.Exact<{ where: Types.SqlPairWhereUniqueInput; data: Types.UpdateSqlPairInput; }>; export type UpdateSqlPairMutation = { __typename?: 'Mutation', updateSqlPair: { __typename?: 'SqlPair', id: number, projectId: number, sql: string, question: string, createdAt?: string | null, updatedAt?: string | null } }; export type DeleteSqlPairMutationVariables = Types.Exact<{ where: Types.SqlPairWhereUniqueInput; }>; export type DeleteSqlPairMutation = { __typename?: 'Mutation', deleteSqlPair: boolean }; export const SqlPairFragmentDoc = gql` fragment SqlPair on SqlPair { id projectId sql question createdAt updatedAt } `; export const SqlPairsDocument = gql` query SqlPairs { sqlPairs { ...SqlPair } } ${SqlPairFragmentDoc}`; /** * __useSqlPairsQuery__ * * To run a query within a React component, call `useSqlPairsQuery` and pass it any options that fit your needs. * When your component renders, `useSqlPairsQuery` returns an object from Apollo Client that contains loading, error, and data properties * you can use to render your UI. * * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; * * @example * const { data, loading, error } = useSqlPairsQuery({ * variables: { * }, * }); */ export function useSqlPairsQuery(baseOptions?: Apollo.QueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useQuery(SqlPairsDocument, options); } export function useSqlPairsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(SqlPairsDocument, options); } export type SqlPairsQueryHookResult = ReturnType; export type SqlPairsLazyQueryHookResult = ReturnType; export type SqlPairsQueryResult = Apollo.QueryResult; export const CreateSqlPairDocument = gql` mutation CreateSqlPair($data: CreateSqlPairInput!) { createSqlPair(data: $data) { ...SqlPair } } ${SqlPairFragmentDoc}`; export type CreateSqlPairMutationFn = Apollo.MutationFunction; /** * __useCreateSqlPairMutation__ * * To run a mutation, you first call `useCreateSqlPairMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useCreateSqlPairMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [createSqlPairMutation, { data, loading, error }] = useCreateSqlPairMutation({ * variables: { * data: // value for 'data' * }, * }); */ export function useCreateSqlPairMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(CreateSqlPairDocument, options); } export type CreateSqlPairMutationHookResult = ReturnType; export type CreateSqlPairMutationResult = Apollo.MutationResult; export type CreateSqlPairMutationOptions = Apollo.BaseMutationOptions; export const UpdateSqlPairDocument = gql` mutation UpdateSqlPair($where: SqlPairWhereUniqueInput!, $data: UpdateSqlPairInput!) { updateSqlPair(where: $where, data: $data) { ...SqlPair } } ${SqlPairFragmentDoc}`; export type UpdateSqlPairMutationFn = Apollo.MutationFunction; /** * __useUpdateSqlPairMutation__ * * To run a mutation, you first call `useUpdateSqlPairMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useUpdateSqlPairMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [updateSqlPairMutation, { data, loading, error }] = useUpdateSqlPairMutation({ * variables: { * where: // value for 'where' * data: // value for 'data' * }, * }); */ export function useUpdateSqlPairMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(UpdateSqlPairDocument, options); } export type UpdateSqlPairMutationHookResult = ReturnType; export type UpdateSqlPairMutationResult = Apollo.MutationResult; export type UpdateSqlPairMutationOptions = Apollo.BaseMutationOptions; export const DeleteSqlPairDocument = gql` mutation DeleteSqlPair($where: SqlPairWhereUniqueInput!) { deleteSqlPair(where: $where) } `; export type DeleteSqlPairMutationFn = Apollo.MutationFunction; /** * __useDeleteSqlPairMutation__ * * To run a mutation, you first call `useDeleteSqlPairMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useDeleteSqlPairMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [deleteSqlPairMutation, { data, loading, error }] = useDeleteSqlPairMutation({ * variables: { * where: // value for 'where' * }, * }); */ export function useDeleteSqlPairMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(DeleteSqlPairDocument, options); } export type DeleteSqlPairMutationHookResult = ReturnType; export type DeleteSqlPairMutationResult = Apollo.MutationResult; export type DeleteSqlPairMutationOptions = Apollo.BaseMutationOptions; ================================================ FILE: wren-ui/src/apollo/client/graphql/sqlPairs.ts ================================================ import { gql } from '@apollo/client'; const SQL_PAIR = gql` fragment SqlPair on SqlPair { id projectId sql question createdAt updatedAt } `; export const LIST_SQL_PAIRS = gql` query SqlPairs { sqlPairs { ...SqlPair } } ${SQL_PAIR} `; export const CREATE_SQL_PAIR = gql` mutation CreateSqlPair($data: CreateSqlPairInput!) { createSqlPair(data: $data) { ...SqlPair } } ${SQL_PAIR} `; export const UPDATE_SQL_PAIR = gql` mutation UpdateSqlPair( $where: SqlPairWhereUniqueInput! $data: UpdateSqlPairInput! ) { updateSqlPair(where: $where, data: $data) { ...SqlPair } } ${SQL_PAIR} `; export const DELETE_SQL_PAIR = gql` mutation DeleteSqlPair($where: SqlPairWhereUniqueInput!) { deleteSqlPair(where: $where) } `; ================================================ FILE: wren-ui/src/apollo/client/graphql/view.generated.ts ================================================ import * as Types from './__types__'; import { gql } from '@apollo/client'; import * as Apollo from '@apollo/client'; const defaultOptions = {} as const; export type CreateViewMutationVariables = Types.Exact<{ data: Types.CreateViewInput; }>; export type CreateViewMutation = { __typename?: 'Mutation', createView: { __typename?: 'ViewInfo', id: number, name: string, statement: string } }; export type DeleteViewMutationVariables = Types.Exact<{ where: Types.ViewWhereUniqueInput; }>; export type DeleteViewMutation = { __typename?: 'Mutation', deleteView: boolean }; export type GetViewQueryVariables = Types.Exact<{ where: Types.ViewWhereUniqueInput; }>; export type GetViewQuery = { __typename?: 'Query', view: { __typename?: 'ViewInfo', id: number, name: string, statement: string } }; export type ListViewsQueryVariables = Types.Exact<{ [key: string]: never; }>; export type ListViewsQuery = { __typename?: 'Query', listViews: Array<{ __typename?: 'ViewInfo', id: number, name: string, displayName: string, statement: string }> }; export type PreviewViewDataMutationVariables = Types.Exact<{ where: Types.PreviewViewDataInput; }>; export type PreviewViewDataMutation = { __typename?: 'Mutation', previewViewData: any }; export type ValidateViewMutationVariables = Types.Exact<{ data: Types.ValidateViewInput; }>; export type ValidateViewMutation = { __typename?: 'Mutation', validateView: { __typename?: 'ViewValidationResponse', valid: boolean, message?: string | null } }; export const CreateViewDocument = gql` mutation CreateView($data: CreateViewInput!) { createView(data: $data) { id name statement } } `; export type CreateViewMutationFn = Apollo.MutationFunction; /** * __useCreateViewMutation__ * * To run a mutation, you first call `useCreateViewMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useCreateViewMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [createViewMutation, { data, loading, error }] = useCreateViewMutation({ * variables: { * data: // value for 'data' * }, * }); */ export function useCreateViewMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(CreateViewDocument, options); } export type CreateViewMutationHookResult = ReturnType; export type CreateViewMutationResult = Apollo.MutationResult; export type CreateViewMutationOptions = Apollo.BaseMutationOptions; export const DeleteViewDocument = gql` mutation DeleteView($where: ViewWhereUniqueInput!) { deleteView(where: $where) } `; export type DeleteViewMutationFn = Apollo.MutationFunction; /** * __useDeleteViewMutation__ * * To run a mutation, you first call `useDeleteViewMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useDeleteViewMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [deleteViewMutation, { data, loading, error }] = useDeleteViewMutation({ * variables: { * where: // value for 'where' * }, * }); */ export function useDeleteViewMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(DeleteViewDocument, options); } export type DeleteViewMutationHookResult = ReturnType; export type DeleteViewMutationResult = Apollo.MutationResult; export type DeleteViewMutationOptions = Apollo.BaseMutationOptions; export const GetViewDocument = gql` query GetView($where: ViewWhereUniqueInput!) { view(where: $ViewWhereUniqueInput) { id name statement } } `; /** * __useGetViewQuery__ * * To run a query within a React component, call `useGetViewQuery` and pass it any options that fit your needs. * When your component renders, `useGetViewQuery` returns an object from Apollo Client that contains loading, error, and data properties * you can use to render your UI. * * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; * * @example * const { data, loading, error } = useGetViewQuery({ * variables: { * where: // value for 'where' * }, * }); */ export function useGetViewQuery(baseOptions: Apollo.QueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useQuery(GetViewDocument, options); } export function useGetViewLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(GetViewDocument, options); } export type GetViewQueryHookResult = ReturnType; export type GetViewLazyQueryHookResult = ReturnType; export type GetViewQueryResult = Apollo.QueryResult; export const ListViewsDocument = gql` query ListViews { listViews { id name displayName statement } } `; /** * __useListViewsQuery__ * * To run a query within a React component, call `useListViewsQuery` and pass it any options that fit your needs. * When your component renders, `useListViewsQuery` returns an object from Apollo Client that contains loading, error, and data properties * you can use to render your UI. * * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; * * @example * const { data, loading, error } = useListViewsQuery({ * variables: { * }, * }); */ export function useListViewsQuery(baseOptions?: Apollo.QueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useQuery(ListViewsDocument, options); } export function useListViewsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useLazyQuery(ListViewsDocument, options); } export type ListViewsQueryHookResult = ReturnType; export type ListViewsLazyQueryHookResult = ReturnType; export type ListViewsQueryResult = Apollo.QueryResult; export const PreviewViewDataDocument = gql` mutation PreviewViewData($where: PreviewViewDataInput!) { previewViewData(where: $where) } `; export type PreviewViewDataMutationFn = Apollo.MutationFunction; /** * __usePreviewViewDataMutation__ * * To run a mutation, you first call `usePreviewViewDataMutation` within a React component and pass it any options that fit your needs. * When your component renders, `usePreviewViewDataMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [previewViewDataMutation, { data, loading, error }] = usePreviewViewDataMutation({ * variables: { * where: // value for 'where' * }, * }); */ export function usePreviewViewDataMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(PreviewViewDataDocument, options); } export type PreviewViewDataMutationHookResult = ReturnType; export type PreviewViewDataMutationResult = Apollo.MutationResult; export type PreviewViewDataMutationOptions = Apollo.BaseMutationOptions; export const ValidateViewDocument = gql` mutation ValidateView($data: ValidateViewInput!) { validateView(data: $data) { valid message } } `; export type ValidateViewMutationFn = Apollo.MutationFunction; /** * __useValidateViewMutation__ * * To run a mutation, you first call `useValidateViewMutation` within a React component and pass it any options that fit your needs. * When your component renders, `useValidateViewMutation` returns a tuple that includes: * - A mutate function that you can call at any time to execute the mutation * - An object with fields that represent the current status of the mutation's execution * * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; * * @example * const [validateViewMutation, { data, loading, error }] = useValidateViewMutation({ * variables: { * data: // value for 'data' * }, * }); */ export function useValidateViewMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} return Apollo.useMutation(ValidateViewDocument, options); } export type ValidateViewMutationHookResult = ReturnType; export type ValidateViewMutationResult = Apollo.MutationResult; export type ValidateViewMutationOptions = Apollo.BaseMutationOptions; ================================================ FILE: wren-ui/src/apollo/client/graphql/view.ts ================================================ import { gql } from '@apollo/client'; export const CREATE_VIEW = gql` mutation CreateView($data: CreateViewInput!) { createView(data: $data) { id name statement } } `; export const DELETE_VIEW = gql` mutation DeleteView($where: ViewWhereUniqueInput!) { deleteView(where: $where) } `; export const GET_VIEW = gql` query GetView($where: ViewWhereUniqueInput!) { view(where: $ViewWhereUniqueInput) { id name statement } } `; export const LIST_VIEWS = gql` query ListViews { listViews { id name displayName statement } } `; export const PREVIEW_VIEW_DATA = gql` mutation PreviewViewData($where: PreviewViewDataInput!) { previewViewData(where: $where) } `; export const VALIDATE_CREATE_VIEW = gql` mutation ValidateView($data: ValidateViewInput!) { validateView(data: $data) { valid message } } `; ================================================ FILE: wren-ui/src/apollo/client/index.ts ================================================ import { ApolloClient, HttpLink, InMemoryCache, from } from '@apollo/client'; import { onError } from '@apollo/client/link/error'; import errorHandler from '@/utils/errorHandler'; const apolloErrorLink = onError((error) => errorHandler(error)); const httpLink = new HttpLink({ uri: '/api/graphql', }); const client = new ApolloClient({ link: from([apolloErrorLink, httpLink]), cache: new InMemoryCache(), }); export default client; ================================================ FILE: wren-ui/src/apollo/server/adaptors/ibisAdaptor.ts ================================================ import axios, { AxiosResponse } from 'axios'; import { getLogger } from '@server/utils/logger'; import { DataSourceName } from '@server/types'; import { Manifest } from '@server/mdl/type'; import * as Errors from '@server/utils/error'; import { getConfig } from '@server/config'; import { toDockerHost } from '@server/utils'; import { CompactColumn, CompactTable, DEFAULT_PREVIEW_LIMIT, RecommendConstraint, } from '@server/services'; import { snakeCase } from 'lodash'; import { WREN_AI_CONNECTION_INFO } from '../repositories'; import { toIbisConnectionInfo, toMultipleIbisConnectionInfos, } from '../dataSource'; import { DialectSQL, WrenSQL } from '../models/adaptor'; export type { WrenSQL }; const logger = getLogger('IbisAdaptor'); logger.level = 'debug'; const config = getConfig(); export interface HostBasedConnectionInfo { host: string; port: number; database: string; user: string; password: string; } export interface UrlBasedConnectionInfo { connectionUrl: string; } export type IbisPostgresConnectionInfo = | UrlBasedConnectionInfo | HostBasedConnectionInfo; export interface IbisBigQueryConnectionInfo { project_id: string; dataset_id: string; credentials: string; // base64 encoded } export interface IbisTrinoConnectionInfo { host: string; port: number; catalog: string; schema: string; user: string; password: string; } export interface IbisSnowflakeConnectionInfo { user: string; account: string; database: string; schema: string; password?: string; privateKey?: string; warehouse?: string; } export interface IbisAthenaConnectionInfo { // AWS access key auth (optional if using OIDC) aws_access_key_id?: string; aws_secret_access_key?: string; // OIDC auth (optional if using access keys) web_identity_token?: string; role_arn?: string; role_session_name?: string; region_name: string; s3_staging_dir: string; schema_name: string; } export enum IbisRedshiftConnectionType { REDSHIFT = 'redshift', REDSHIFT_IAM = 'redshift_iam', } interface IbisRedshiftPasswordAuth { host: string; port: number; database: string; user: string; password: string; redshift_type: IbisRedshiftConnectionType; } interface IbisRedshiftIAMAuth { cluster_identifier: string; user: string; database: string; region: string; access_key_id: string; access_key_secret: string; redshift_type: IbisRedshiftConnectionType; } export enum IbisDatabricksConnectionType { TOKEN = 'token', SERVICE_PRINCIPAL = 'service_principal', } interface IbisDatabricksPersonalAccessTokenAuth { databricks_type: IbisDatabricksConnectionType; serverHostname: string; httpPath: string; accessToken: string; } interface IbisDatabricksServicePrincipalAuth { databricks_type: IbisDatabricksConnectionType; serverHostname: string; httpPath: string; clientId: string; clientSecret: string; azureTenantId?: string; } export type IbisRedshiftConnectionInfo = | IbisRedshiftPasswordAuth | IbisRedshiftIAMAuth; export type IbisDatabricksConnectionInfo = | IbisDatabricksPersonalAccessTokenAuth | IbisDatabricksServicePrincipalAuth; export enum SupportedDataSource { POSTGRES = 'POSTGRES', BIG_QUERY = 'BIG_QUERY', SNOWFLAKE = 'SNOWFLAKE', MYSQL = 'MYSQL', ORACLE = 'ORACLE', MSSQL = 'MSSQL', CLICK_HOUSE = 'CLICK_HOUSE', TRINO = 'TRINO', ATHENA = 'ATHENA', REDSHIFT = 'REDSHIFT', DATABRICKS = 'DATABRICKS', } const dataSourceUrlMap: Record = { [SupportedDataSource.POSTGRES]: 'postgres', [SupportedDataSource.BIG_QUERY]: 'bigquery', [SupportedDataSource.SNOWFLAKE]: 'snowflake', [SupportedDataSource.MYSQL]: 'mysql', [SupportedDataSource.ORACLE]: 'oracle', [SupportedDataSource.MSSQL]: 'mssql', [SupportedDataSource.CLICK_HOUSE]: 'clickhouse', [SupportedDataSource.TRINO]: 'trino', [SupportedDataSource.ATHENA]: 'athena', [SupportedDataSource.REDSHIFT]: 'redshift', [SupportedDataSource.DATABRICKS]: 'databricks', }; export interface TableResponse { tables: CompactTable[]; } export enum ValidationRules { COLUMN_IS_VALID = 'COLUMN_IS_VALID', } export interface ValidationResponse { valid: boolean; message: string | null; } export interface IbisBaseOptions { dataSource: DataSourceName; connectionInfo: WREN_AI_CONNECTION_INFO; mdl: Manifest; } export interface IbisQueryOptions extends IbisBaseOptions { limit?: number; refresh?: boolean; cacheEnabled?: boolean; } export interface IbisDryPlanOptions { dataSource: DataSourceName; mdl: Manifest; // TODO: replace sql type with WrenSQL sql: string; } export interface IIbisAdaptor { query: ( // TODO: replace query type with WrenSQL query: string, options: IbisQueryOptions, ) => Promise; dryRun: (query: string, options: IbisBaseOptions) => Promise; getTables: ( dataSource: DataSourceName, connectionInfo: WREN_AI_CONNECTION_INFO, ) => Promise; getConstraints: ( dataSource: DataSourceName, connectionInfo: WREN_AI_CONNECTION_INFO, ) => Promise; getNativeSql: (options: IbisDryPlanOptions) => Promise; validate: ( dataSource: DataSourceName, rule: ValidationRules, connectionInfo: WREN_AI_CONNECTION_INFO, mdl: Manifest, parameters: Record, ) => Promise; modelSubstitute: ( sql: DialectSQL, options: { dataSource: DataSourceName; connectionInfo: WREN_AI_CONNECTION_INFO; mdl: Manifest; catalog?: string; schema?: string; }, ) => Promise; getVersion: ( dataSource: DataSourceName, connectionInfo: WREN_AI_CONNECTION_INFO, ) => Promise; } export interface IbisResponse { correlationId?: string; processTime?: string; } export interface IbisQueryResponse extends IbisResponse { columns: string[]; data: any[]; dtypes: Record; cacheHit?: boolean; cacheCreatedAt?: string; cacheOverrodeAt?: string; override?: boolean; } export interface DryRunResponse extends IbisResponse {} enum IBIS_API_TYPE { QUERY = 'QUERY', DRY_RUN = 'DRY_RUN', DRY_PLAN = 'DRY_PLAN', METADATA = 'METADATA', VALIDATION = 'VALIDATION', ANALYSIS = 'ANALYSIS', MODEL_SUBSTITUTE = 'MODEL_SUBSTITUTE', } export class IbisAdaptor implements IIbisAdaptor { private ibisServerEndpoint: string; constructor({ ibisServerEndpoint }: { ibisServerEndpoint: string }) { this.ibisServerEndpoint = ibisServerEndpoint; } public async getNativeSql(options: IbisDryPlanOptions): Promise { const { dataSource, mdl, sql } = options; const body = { sql, manifestStr: Buffer.from(JSON.stringify(mdl)).toString('base64'), }; try { const res = await axios.post( `${this.ibisServerEndpoint}/${this.getIbisApiVersion(IBIS_API_TYPE.DRY_PLAN)}/connector/${dataSourceUrlMap[dataSource]}/dry-plan`, body, ); return res.data; } catch (e) { logger.debug(`Dry plan error: ${e.response?.data || e.message}`); this.throwError(e, 'Error during dry plan execution'); } } public async query( query: string, options: IbisQueryOptions, ): Promise { const { dataSource, mdl } = options; const connectionInfo = this.updateConnectionInfo(options.connectionInfo); const ibisConnectionInfo = toIbisConnectionInfo(dataSource, connectionInfo); const queryString = this.buildQueryString(options); const body = { sql: query, connectionInfo: ibisConnectionInfo, manifestStr: Buffer.from(JSON.stringify(mdl)).toString('base64'), }; try { const res = await axios.post( `${this.ibisServerEndpoint}/${this.getIbisApiVersion(IBIS_API_TYPE.QUERY)}/connector/${dataSourceUrlMap[dataSource]}/query${queryString}`, body, { params: { limit: options.limit || DEFAULT_PREVIEW_LIMIT, }, }, ); return { ...res.data, correlationId: res.headers['x-correlation-id'], processTime: res.headers['x-process-time'], cacheHit: res.headers['x-cache-hit'] === 'true', cacheCreatedAt: res.headers['x-cache-create-at'] && new Date(parseInt(res.headers['x-cache-create-at'])).toISOString(), cacheOverrodeAt: res.headers['x-cache-override-at'] && new Date(parseInt(res.headers['x-cache-override-at'])).toISOString(), override: res.headers['x-cache-override'] === 'true', }; } catch (e) { logger.debug(`Query error: ${e.response?.data || e.message}`); this.throwError(e, 'Error querying ibis server'); } } public async dryRun( query: string, options: IbisQueryOptions, ): Promise { const { dataSource, mdl } = options; const connectionInfo = this.updateConnectionInfo(options.connectionInfo); const ibisConnectionInfo = toIbisConnectionInfo(dataSource, connectionInfo); const body = { sql: query, connectionInfo: ibisConnectionInfo, manifestStr: Buffer.from(JSON.stringify(mdl)).toString('base64'), }; logger.debug(`Dry run sql from ibis with body:`); try { const response = await axios.post( `${this.ibisServerEndpoint}/${this.getIbisApiVersion(IBIS_API_TYPE.DRY_RUN)}/connector/${dataSourceUrlMap[dataSource]}/query?dryRun=true`, body, ); logger.debug(`Ibis server Dry run success`); return { correlationId: response.headers['x-correlation-id'], processTime: response.headers['x-process-time'], }; } catch (err) { logger.debug(`Dry run error: ${err.response?.data || err.message}`); this.throwError(err, 'Error during dry run execution'); } } public async getTables( dataSource: DataSourceName, connectionInfo: WREN_AI_CONNECTION_INFO, ): Promise { try { const getTablesByConnectionInfo = async (ibisConnectionInfo) => { const body = { connectionInfo: ibisConnectionInfo, }; logger.debug(`Getting tables from ibis`); const res: AxiosResponse = await axios.post( `${this.ibisServerEndpoint}/${this.getIbisApiVersion(IBIS_API_TYPE.METADATA)}/connector/${dataSourceUrlMap[dataSource]}/metadata/tables`, body, ); return this.transformDescriptionToProperties(res.data); }; connectionInfo = this.updateConnectionInfo(connectionInfo); // If the dataSource supports multiple connection info, we need to get tables from each connection info const multipleIbisConnectionInfos = toMultipleIbisConnectionInfos( dataSource, connectionInfo, ); if (multipleIbisConnectionInfos) { const results = await Promise.all( multipleIbisConnectionInfos.map(getTablesByConnectionInfo), ); return results.flat(); } // If the dataSource does not support multiple connection info, we only need to get tables from one connection info const ibisConnectionInfo = toIbisConnectionInfo( dataSource, connectionInfo, ); return await getTablesByConnectionInfo(ibisConnectionInfo); } catch (e) { logger.debug(`Get tables error: ${e.response?.data || e.message}`); this.throwError(e, 'Error getting table from ibis server'); } } public async getConstraints( dataSource: DataSourceName, connectionInfo: WREN_AI_CONNECTION_INFO, ): Promise { connectionInfo = this.updateConnectionInfo(connectionInfo); const ibisConnectionInfo = toIbisConnectionInfo(dataSource, connectionInfo); const body = { connectionInfo: ibisConnectionInfo, }; try { logger.debug(`Getting constraint from ibis`); const res: AxiosResponse = await axios.post( `${this.ibisServerEndpoint}/${this.getIbisApiVersion(IBIS_API_TYPE.METADATA)}/connector/${dataSourceUrlMap[dataSource]}/metadata/constraints`, body, ); return res.data; } catch (e) { logger.debug(`Get constraints error: ${e.response?.data || e.message}`); this.throwError(e, 'Error getting constraint from ibis server'); } } public async validate( dataSource: DataSourceName, validationRule: ValidationRules, connectionInfo: WREN_AI_CONNECTION_INFO, mdl: Manifest, parameters: Record, ): Promise { connectionInfo = this.updateConnectionInfo(connectionInfo); const ibisConnectionInfo = toIbisConnectionInfo(dataSource, connectionInfo); const body = { connectionInfo: ibisConnectionInfo, manifestStr: Buffer.from(JSON.stringify(mdl)).toString('base64'), parameters, }; try { logger.debug(`Run validation rule "${validationRule}" with ibis`); await axios.post( `${this.ibisServerEndpoint}/${this.getIbisApiVersion(IBIS_API_TYPE.VALIDATION)}/connector/${dataSourceUrlMap[dataSource]}/validate/${snakeCase(validationRule)}`, body, ); return { valid: true, message: null }; } catch (e) { logger.debug(`Validation error: ${e.response?.data || e.message}`); return { valid: false, message: e.response?.data || e.message }; } } public async modelSubstitute( sql: DialectSQL, options: { dataSource: DataSourceName; connectionInfo: WREN_AI_CONNECTION_INFO; mdl: Manifest; catalog?: string; schema?: string; }, ): Promise { const { dataSource, mdl, catalog, schema } = options; let connectionInfo = options.connectionInfo; connectionInfo = this.updateConnectionInfo(connectionInfo); const headers = { 'X-User-CATALOG': catalog, 'X-User-SCHEMA': schema, }; const ibisConnectionInfo = toIbisConnectionInfo(dataSource, connectionInfo); const body = { sql, connectionInfo: ibisConnectionInfo, manifestStr: Buffer.from(JSON.stringify(mdl)).toString('base64'), }; try { logger.debug(`Running model substitution with ibis`); const res = await axios.post( `${this.ibisServerEndpoint}/${this.getIbisApiVersion(IBIS_API_TYPE.MODEL_SUBSTITUTE)}/connector/${dataSourceUrlMap[dataSource]}/model-substitute`, body, { headers, }, ); return res.data as WrenSQL; } catch (e) { logger.debug( `Model substitution error: ${e.response?.data || e.message}`, ); this.throwError( e, 'Error running model substitution with ibis server', this.modelSubstituteErrorMessageBuilder, ); } } public async getVersion( dataSource: DataSourceName, connectionInfo: WREN_AI_CONNECTION_INFO, ): Promise { connectionInfo = this.updateConnectionInfo(connectionInfo); const ibisConnectionInfo = toIbisConnectionInfo(dataSource, connectionInfo); const body = { connectionInfo: ibisConnectionInfo, }; try { logger.debug(`Getting version from ibis`); const res: AxiosResponse = await axios.post( `${this.ibisServerEndpoint}/${this.getIbisApiVersion(IBIS_API_TYPE.METADATA)}/connector/${dataSourceUrlMap[dataSource]}/metadata/version`, body, ); return res.data; } catch (e) { logger.debug(`Get version error: ${e.response?.data || e.message}`); this.throwError(e, 'Error getting version from ibis server'); } } private updateConnectionInfo(connectionInfo: any) { if ( config.otherServiceUsingDocker && Object.hasOwnProperty.call(connectionInfo, 'host') ) { connectionInfo.host = toDockerHost(connectionInfo.host); logger.debug(`Host replaced with docker host`); } return connectionInfo; } private transformDescriptionToProperties( tables: CompactTable[], ): CompactTable[] { const handleColumnProperties = (column: CompactColumn): CompactColumn => { const properties = column?.properties || {}; if (column.description) { properties.description = column.description; } const nestedColumns = column.nestedColumns?.map((nc) => { return handleColumnProperties(nc); }); return { ...column, properties, nestedColumns }; }; return tables.map((table) => { try { const properties = table?.properties || {}; if (table.description) { properties.description = table.description; } if (table.columns) { const transformedColumns = table.columns.map((column) => handleColumnProperties(column), ); table.columns = transformedColumns; } return { ...table, properties }; } catch (e) { console.log('e', e); } }); } private getIbisApiVersion(apiType: IBIS_API_TYPE) { if (!config.experimentalEngineRustVersion) { return 'v2'; } const useV3 = [ IBIS_API_TYPE.QUERY, IBIS_API_TYPE.DRY_RUN, IBIS_API_TYPE.DRY_PLAN, IBIS_API_TYPE.VALIDATION, IBIS_API_TYPE.MODEL_SUBSTITUTE, ].includes(apiType); if (useV3) logger.debug('Using ibis v3 api'); return useV3 ? 'v3' : 'v2'; } private throwError( e: any, defaultMessage: string, errorMessageBuilder?: CallableFunction, ) { const customMessage = e.response?.data?.message || e.response?.data || e.message || defaultMessage; const errorData = e.response?.data; throw Errors.create(Errors.GeneralErrorCodes.IBIS_SERVER_ERROR, { customMessage: errorMessageBuilder ? errorMessageBuilder(customMessage) : customMessage, originalError: e, other: { correlationId: e.response?.headers['x-correlation-id'], processTime: e.response?.headers['x-process-time'], ...errorData, }, }); } private modelSubstituteErrorMessageBuilder(message: string) { const ModelSubstituteErrorEnum = { MODEL_NOT_FOUND: () => { return message.includes('Model not found'); }, PARSING_EXCEPTION: () => { return message.includes('sql.parser.ParsingException'); }, }; if (ModelSubstituteErrorEnum.MODEL_NOT_FOUND()) { const modelName = message.split(': ')[1]; const dotCount = modelName.split('.').length - 1; switch (dotCount) { case 0: return ( message + `. Try adding both catalog and schema before your table name. e.g. my_database.public.${modelName}` ); case 1: return ( message + `. Try adding the catalog before the schema in your table name. e.g. my_database.${modelName}` ); case 2: return ( message + `. It may be missing from models, misnamed, or have a case mismatch.` ); default: return ( message + `. It may be missing from models, misnamed, or have a case mismatch.` ); } } else if (ModelSubstituteErrorEnum.PARSING_EXCEPTION()) { return ( message + '. Please check your selected column and make sure its quoted for columns with non-alphanumeric characters.' ); } return message; } private buildQueryString(options: IbisQueryOptions) { if (!options.cacheEnabled) { return ''; } const queryString = []; queryString.push('cacheEnable=true'); if (options.refresh) { queryString.push('overrideCache=true'); } return `?${queryString.join('&')}`; } } ================================================ FILE: wren-ui/src/apollo/server/adaptors/index.ts ================================================ export * from './ibisAdaptor'; export * from './wrenAIAdaptor'; export * from './wrenEngineAdaptor'; ================================================ FILE: wren-ui/src/apollo/server/adaptors/tests/ibisAdaptor.test.ts ================================================ import axios from 'axios'; import { DryRunResponse, IbisAdaptor, IbisQueryOptions, IbisQueryResponse, ValidationRules, } from '../ibisAdaptor'; import { DataSourceName } from '../../types'; import { Manifest } from '../../mdl/type'; import { DialectSQL } from '../../models/adaptor'; import { BIG_QUERY_CONNECTION_INFO, CLICK_HOUSE_CONNECTION_INFO, MS_SQL_CONNECTION_INFO, MYSQL_CONNECTION_INFO, POSTGRES_CONNECTION_INFO, TRINO_CONNECTION_INFO, SNOWFLAKE_CONNECTION_INFO, } from '../../repositories'; import { snakeCase } from 'lodash'; import { Encryptor } from '../../utils'; import { DEFAULT_PREVIEW_LIMIT } from '../../services'; jest.mock('axios'); jest.mock('@server/utils/encryptor'); const mockedAxios = axios as jest.Mocked; // mock encryptor const mockedEncryptor = Encryptor as jest.MockedClass; describe('IbisAdaptor', () => { let ibisAdaptor: IbisAdaptor; const ibisServerEndpoint = 'http://localhost:8080'; const mockMSSQLConnectionInfo: MS_SQL_CONNECTION_INFO = { host: 'localhost', port: 1433, database: 'my-database', user: 'my-user', password: 'my-password', trustServerCertificate: false, }; const mockMySQLConnectionInfo: MYSQL_CONNECTION_INFO = { host: 'localhost', port: 3306, database: 'my-database', user: 'my-user', password: 'my-password', ssl: false, }; const mockPostgresConnectionInfo: POSTGRES_CONNECTION_INFO = { host: 'localhost', port: 5432, database: 'my-database', user: 'my-user', password: 'my-password', ssl: true, }; const mockClickHouseConnectionInfo: CLICK_HOUSE_CONNECTION_INFO = { host: 'my-host', port: 8443, database: 'my-database', user: 'my-user', password: 'my-password', ssl: true, }; const { host, port, database, user, password } = mockPostgresConnectionInfo; const postgresConnectionUrl = `postgresql://${user}:${password}@${host}:${port}/${database}?sslmode=require`; const mockBigQueryConnectionInfo: BIG_QUERY_CONNECTION_INFO = { projectId: 'my-bq-project-id', datasetId: 'my-bq-dataset-id', credentials: 'encrypted-credential-string', }; const mockTrinoConnectionInfo: TRINO_CONNECTION_INFO = { schemas: 'my-catalog.my-schema', host: 'localhost', port: 5450, password: 'my-password', ssl: true, username: 'my-username', }; const mockSnowflakeConnectionInfo: SNOWFLAKE_CONNECTION_INFO = { user: 'my-user', password: 'my-password', account: 'my-account', database: 'my-database', schema: 'my-schema', }; const mockManifest: Manifest = { catalog: 'wrenai', // eg: "test-catalog" schema: 'wrenai', // eg: "test-schema" models: [ { name: 'test_table', tableReference: { catalog: 'wrenai', schema: 'wrenai', table: 'test_table', }, properties: { description: 'test table', }, columns: [ { name: 'id', type: 'integer', properties: {}, isCalculated: false, }, { name: 'sumId', type: 'float', properties: {}, isCalculated: true, expression: 'SUM(id)', }, ], cached: false, }, ], relationships: [], views: [], }; beforeEach(() => { ibisAdaptor = new IbisAdaptor({ ibisServerEndpoint: ibisServerEndpoint, }); }); afterEach(() => { jest.resetAllMocks(); }); it('should get mssql constraints', async () => { const mockResponse = { data: [] }; mockedAxios.post.mockResolvedValue(mockResponse); // mock decrypt method in Encryptor to return the same password mockedEncryptor.prototype.decrypt.mockReturnValue( JSON.stringify({ password: mockMSSQLConnectionInfo.password }), ); const result = await ibisAdaptor.getConstraints( DataSourceName.MSSQL, mockMSSQLConnectionInfo, ); const expectConnectionInfo = Object.entries(mockMSSQLConnectionInfo).reduce( (acc, [key, value]) => { if (key === 'trustServerCertificate') { if (value) { acc['kwargs'] = { trustServerCertificate: 'YES' }; return acc; } } else { acc[snakeCase(key)] = value; } return acc; }, {}, ); expect(result).toEqual([]); expect(mockedAxios.post).toHaveBeenCalledWith( `${ibisServerEndpoint}/v2/connector/mssql/metadata/constraints`, { connectionInfo: expectConnectionInfo }, ); }); it('should get mysql constraints', async () => { const mockResponse = { data: [] }; mockedAxios.post.mockResolvedValue(mockResponse); // mock decrypt method in Encryptor to return the same password mockedEncryptor.prototype.decrypt.mockReturnValue( JSON.stringify({ password: mockMySQLConnectionInfo.password }), ); const result = await ibisAdaptor.getConstraints( DataSourceName.MYSQL, mockMySQLConnectionInfo, ); const expectConnectionInfo = Object.entries(mockMySQLConnectionInfo).reduce( (acc, [key, value]) => ((acc[snakeCase(key)] = value), acc), {}, ); expect(result).toEqual([]); expect(mockedAxios.post).toHaveBeenCalledWith( `${ibisServerEndpoint}/v2/connector/mysql/metadata/constraints`, { connectionInfo: expectConnectionInfo }, ); }); // check clickhouse connection info it.each([ [ { host: 'my-host', port: 8443, database: 'my-database', user: 'my-user', password: 'my-password', ssl: true, }, `clickhouse://my-user:my-password@my-host:8443/my-database?secure=1`, ], [ { host: 'my-host', port: 8443, database: 'my-database', user: 'my-user', password: 'my-password', ssl: false, }, `clickhouse://my-user:my-password@my-host:8443/my-database?`, ], ])( 'should get correct clickhouse connection info', async (connectionInfo, expectConnectionUrl) => { const mockResponse = { data: [] }; mockedAxios.post.mockResolvedValue(mockResponse); // mock decrypt method in Encryptor to return the same password mockedEncryptor.prototype.decrypt.mockReturnValue( JSON.stringify({ password: connectionInfo.password }), ); const result = await ibisAdaptor.getConstraints( DataSourceName.CLICK_HOUSE, connectionInfo, ); const expectConnectionInfo = { connectionUrl: expectConnectionUrl, }; expect(result).toEqual([]); expect(mockedAxios.post).toHaveBeenCalledWith( `${ibisServerEndpoint}/v2/connector/clickhouse/metadata/constraints`, { connectionInfo: expectConnectionInfo }, ); }, ); it('should get trino constraints', async () => { const mockResponse = { data: [] }; mockedAxios.post.mockResolvedValue(mockResponse); mockedEncryptor.prototype.decrypt.mockReturnValue( JSON.stringify({ password: mockTrinoConnectionInfo.password }), ); const result = await ibisAdaptor.getConstraints( DataSourceName.TRINO, mockTrinoConnectionInfo, ); const { username, host, password, port, schemas } = mockTrinoConnectionInfo; const schemasArray = schemas.split(','); const [catalog, schema] = schemasArray[0].split('.'); const expectConnectionInfo = { catalog, host: `https://${host}`, password, port, schema, user: username, }; expect(result).toEqual([]); expect(mockedAxios.post).toHaveBeenCalledWith( `${ibisServerEndpoint}/v2/connector/trino/metadata/constraints`, { connectionInfo: expectConnectionInfo }, ); }); it('should get snowflake constraints', async () => { const mockResponse = { data: [] }; mockedAxios.post.mockResolvedValue(mockResponse); // mock decrypt method in Encryptor to return the same password mockedEncryptor.prototype.decrypt.mockReturnValue( JSON.stringify({ password: mockSnowflakeConnectionInfo.password }), ); const result = await ibisAdaptor.getConstraints( DataSourceName.SNOWFLAKE, mockSnowflakeConnectionInfo, ); const expectConnectionInfo = Object.entries( mockSnowflakeConnectionInfo, ).reduce((acc, [key, value]) => ((acc[snakeCase(key)] = value), acc), {}); expect(result).toEqual([]); expect(mockedAxios.post).toHaveBeenCalledWith( `${ibisServerEndpoint}/v2/connector/snowflake/metadata/constraints`, { connectionInfo: expectConnectionInfo }, ); }); it('should get click house constraints', async () => { const mockResponse = { data: [] }; mockedAxios.post.mockResolvedValue(mockResponse); // mock decrypt method in Encryptor to return the same password mockedEncryptor.prototype.decrypt.mockReturnValue( JSON.stringify({ password: mockClickHouseConnectionInfo.password }), ); const result = await ibisAdaptor.getConstraints( DataSourceName.CLICK_HOUSE, mockClickHouseConnectionInfo, ); const { user, password, host, port, database, ssl } = mockClickHouseConnectionInfo; const expectConnectionInfo = { connectionUrl: `clickhouse://${user}:${password}@${host}:${port}/${database}${ssl ? '?secure=1' : ''}`, }; expect(result).toEqual([]); expect(mockedAxios.post).toHaveBeenCalledWith( `${ibisServerEndpoint}/v2/connector/clickhouse/metadata/constraints`, { connectionInfo: expectConnectionInfo }, ); }); it('should get postgres constraints', async () => { const mockResponse = { data: [] }; mockedAxios.post.mockResolvedValue(mockResponse); mockedEncryptor.prototype.decrypt.mockReturnValue( JSON.stringify({ password: mockPostgresConnectionInfo.password }), ); const result = await ibisAdaptor.getConstraints( DataSourceName.POSTGRES, mockPostgresConnectionInfo, ); expect(result).toEqual([]); expect(mockedAxios.post).toHaveBeenCalledWith( `${ibisServerEndpoint}/v2/connector/postgres/metadata/constraints`, { connectionInfo: { connectionUrl: postgresConnectionUrl, }, }, ); }); it('should get bigquery constraints', async () => { const mockResponse = { data: [] }; mockedAxios.post.mockResolvedValue(mockResponse); mockedEncryptor.prototype.decrypt.mockReturnValue( JSON.stringify({ credentials: mockBigQueryConnectionInfo.credentials }), ); const result = await ibisAdaptor.getConstraints( DataSourceName.BIG_QUERY, mockBigQueryConnectionInfo, ); const expectConnectionInfo = Object.entries( mockBigQueryConnectionInfo, ).reduce((acc, [key, value]) => { if (key === 'credentials') { acc['credentials'] = Buffer.from( JSON.stringify(mockBigQueryConnectionInfo.credentials), ).toString('base64'); } else { acc[snakeCase(key)] = value; } return acc; }, {}); expect(result).toEqual([]); expect(mockedAxios.post).toHaveBeenCalledWith( `${ibisServerEndpoint}/v2/connector/bigquery/metadata/constraints`, { connectionInfo: expectConnectionInfo }, ); }); it('should validate with rule COLUMN_IS_VALID', async () => { mockedAxios.post.mockResolvedValue(true); mockedEncryptor.prototype.decrypt.mockReturnValue( JSON.stringify({ password: mockPostgresConnectionInfo.password }), ); const parameters = { modelName: 'test_table', columnName: 'sumId', }; const result = await ibisAdaptor.validate( DataSourceName.POSTGRES, ValidationRules.COLUMN_IS_VALID, mockPostgresConnectionInfo, mockManifest, parameters, ); expect(result).toEqual({ valid: true, message: null }); expect(mockedAxios.post).toHaveBeenCalledWith( `${ibisServerEndpoint}/v3/connector/postgres/validate/column_is_valid`, { connectionInfo: { connectionUrl: postgresConnectionUrl }, manifestStr: Buffer.from(JSON.stringify(mockManifest)).toString( 'base64', ), parameters, }, ); }); it('should handle error when validating', async () => { const mockError = { response: { data: 'Error' } }; const parameters = { modelName: 'test_table', columnName: 'sumId', }; mockedAxios.post.mockRejectedValue(mockError); mockedEncryptor.prototype.decrypt.mockReturnValue( JSON.stringify({ password: mockPostgresConnectionInfo.password }), ); const result = await ibisAdaptor.validate( DataSourceName.POSTGRES, ValidationRules.COLUMN_IS_VALID, mockPostgresConnectionInfo, mockManifest, parameters, ); expect(result).toEqual({ valid: false, message: 'Error' }); expect(mockedAxios.post).toHaveBeenCalledWith( `${ibisServerEndpoint}/v3/connector/postgres/validate/column_is_valid`, { connectionInfo: { connectionUrl: postgresConnectionUrl }, manifestStr: Buffer.from(JSON.stringify(mockManifest)).toString( 'base64', ), parameters, }, ); }); it('should get data, correlationId and processTime', async () => { mockedAxios.post.mockResolvedValue({ data: { columns: [], data: [], dtypes: {}, }, headers: { 'x-correlation-id': '123', 'x-process-time': '1s', }, }); mockedEncryptor.prototype.decrypt.mockReturnValue( JSON.stringify({ password: mockPostgresConnectionInfo.password }), ); const res: IbisQueryResponse = await ibisAdaptor.query( 'SELECT * FROM test_table', { dataSource: DataSourceName.POSTGRES, connectionInfo: mockPostgresConnectionInfo, mdl: mockManifest, limit: 10, } as IbisQueryOptions, ); expect(res.data).toEqual([]); expect(res.correlationId).toEqual('123'); expect(res.processTime).toEqual('1s'); }); it('should handle query with cache-related headers', async () => { mockedAxios.post.mockResolvedValue({ data: { columns: ['id'], data: [[1]], dtypes: { id: 'integer' }, }, headers: { 'x-correlation-id': '123', 'x-process-time': '1s', 'x-cache-hit': 'true', 'x-cache-create-at': '2024-01-01T00:00:00Z', 'x-cache-override': 'false', 'x-cache-override-at': '2024-01-01T00:00:00Z', }, }); mockedEncryptor.prototype.decrypt.mockReturnValue( JSON.stringify({ password: mockPostgresConnectionInfo.password }), ); const res: IbisQueryResponse = await ibisAdaptor.query( 'SELECT * FROM test_table', { dataSource: DataSourceName.POSTGRES, connectionInfo: mockPostgresConnectionInfo, mdl: mockManifest, cacheEnabled: true, } as IbisQueryOptions, ); expect(res.data).toEqual([[1]]); expect(res.columns).toEqual(['id']); expect(res.dtypes).toEqual({ id: 'integer' }); expect(res.cacheHit).toEqual(true); expect(new Date(res.cacheCreatedAt).getTime()).toBeGreaterThan(0); expect(res.override).toEqual(false); expect(new Date(res.cacheOverrodeAt).getTime()).toBeGreaterThan(0); expect(mockedAxios.post).toHaveBeenCalledWith( `${ibisServerEndpoint}/v3/connector/postgres/query?cacheEnable=true`, expect.any(Object), expect.any(Object), ); }); it('should handle query with cache refresh', async () => { mockedAxios.post.mockResolvedValue({ data: { columns: ['id'], data: [[1]], dtypes: { id: 'integer' }, }, headers: { 'x-correlation-id': '123', 'x-process-time': '1s', }, }); mockedEncryptor.prototype.decrypt.mockReturnValue( JSON.stringify({ password: mockPostgresConnectionInfo.password }), ); const res: IbisQueryResponse = await ibisAdaptor.query( 'SELECT * FROM test_table', { dataSource: DataSourceName.POSTGRES, connectionInfo: mockPostgresConnectionInfo, mdl: mockManifest, cacheEnabled: true, refresh: true, } as IbisQueryOptions, ); expect(res.data).toEqual([[1]]); expect(mockedAxios.post).toHaveBeenCalledWith( `${ibisServerEndpoint}/v3/connector/postgres/query?cacheEnable=true&overrideCache=true`, expect.any(Object), expect.any(Object), ); }); it('should use default limit when not specified', async () => { mockedAxios.post.mockResolvedValue({ data: { columns: ['id'], data: [[1]], dtypes: { id: 'integer' }, }, headers: { 'x-correlation-id': '123', 'x-process-time': '1s', }, }); mockedEncryptor.prototype.decrypt.mockReturnValue( JSON.stringify({ password: mockPostgresConnectionInfo.password }), ); await ibisAdaptor.query('SELECT * FROM test_table', { dataSource: DataSourceName.POSTGRES, connectionInfo: mockPostgresConnectionInfo, mdl: mockManifest, } as IbisQueryOptions); expect(mockedAxios.post).toHaveBeenCalledWith( expect.any(String), expect.any(Object), { params: { limit: DEFAULT_PREVIEW_LIMIT, }, }, ); }); it('should use custom limit when specified', async () => { mockedAxios.post.mockResolvedValue({ data: { columns: ['id'], data: [[1]], dtypes: { id: 'integer' }, }, headers: { 'x-correlation-id': '123', 'x-process-time': '1s', }, }); mockedEncryptor.prototype.decrypt.mockReturnValue( JSON.stringify({ password: mockPostgresConnectionInfo.password }), ); const customLimit = 50; await ibisAdaptor.query('SELECT * FROM test_table', { dataSource: DataSourceName.POSTGRES, connectionInfo: mockPostgresConnectionInfo, mdl: mockManifest, limit: customLimit, } as IbisQueryOptions); expect(mockedAxios.post).toHaveBeenCalledWith( expect.any(String), expect.any(Object), { params: { limit: customLimit, }, }, ); }); it('should throw an exception with correlationId and processTime when query fails', async () => { const mockError = { response: { data: 'Error message', headers: { 'x-correlation-id': '123', 'x-process-time': '1s', }, }, }; mockedAxios.post.mockRejectedValue(mockError); mockedEncryptor.prototype.decrypt.mockReturnValue( JSON.stringify({ password: mockPostgresConnectionInfo.password }), ); await expect( ibisAdaptor.query('SELECT * FROM test_table', { dataSource: DataSourceName.POSTGRES, connectionInfo: mockPostgresConnectionInfo, mdl: mockManifest, limit: 10, }), ).rejects.toMatchObject({ message: 'Error message', extensions: { other: { correlationId: '123', processTime: '1s', }, }, }); }); it('should get data, correlationId and processTime when dry run succeeds', async () => { mockedAxios.post.mockResolvedValue({ headers: { 'x-correlation-id': '123', 'x-process-time': '1s', }, }); mockedEncryptor.prototype.decrypt.mockReturnValue( JSON.stringify({ password: mockPostgresConnectionInfo.password }), ); const res: DryRunResponse = await ibisAdaptor.dryRun( 'SELECT * FROM test_table', { dataSource: DataSourceName.POSTGRES, connectionInfo: mockPostgresConnectionInfo, mdl: mockManifest, } as IbisQueryOptions, ); expect(res.correlationId).toEqual('123'); expect(res.processTime).toEqual('1s'); }); it('should throw an exception with correlationId and processTime when dry run fails', async () => { const mockError = { response: { data: 'Error message', headers: { 'x-correlation-id': '123', 'x-process-time': '1s', }, }, }; mockedAxios.post.mockRejectedValue(mockError); mockedEncryptor.prototype.decrypt.mockReturnValue( JSON.stringify({ password: mockPostgresConnectionInfo.password }), ); await expect( ibisAdaptor.dryRun('SELECT * FROM test_table', { dataSource: DataSourceName.POSTGRES, connectionInfo: mockPostgresConnectionInfo, mdl: mockManifest, }), ).rejects.toMatchObject({ message: 'Error message', extensions: { other: { correlationId: '123', processTime: '1s', }, }, }); }); it('should successfully substitute SQL with model', async () => { const mockResponse = { data: 'SELECT * FROM substituted_table' }; mockedAxios.post.mockResolvedValue(mockResponse); mockedEncryptor.prototype.decrypt.mockReturnValue( JSON.stringify({ password: mockPostgresConnectionInfo.password }), ); const result = await ibisAdaptor.modelSubstitute( 'SELECT * FROM test_table' as DialectSQL, { dataSource: DataSourceName.POSTGRES, connectionInfo: mockPostgresConnectionInfo, mdl: mockManifest, }, ); expect(result).toEqual('SELECT * FROM substituted_table'); expect(mockedAxios.post).toHaveBeenCalledWith( `${ibisServerEndpoint}/v3/connector/postgres/model-substitute`, { sql: 'SELECT * FROM test_table', connectionInfo: { connectionUrl: postgresConnectionUrl }, manifestStr: Buffer.from(JSON.stringify(mockManifest)).toString( 'base64', ), }, { headers: { 'X-User-CATALOG': undefined, 'X-User-SCHEMA': undefined, }, }, ); }); it('should handle error when model substitution fails with MODEL_NOT_FOUND', async () => { const mockError = { response: { data: 'Model not found: test_table', headers: { 'x-correlation-id': '123', 'x-process-time': '1s', }, }, }; mockedAxios.post.mockRejectedValue(mockError); mockedEncryptor.prototype.decrypt.mockReturnValue( JSON.stringify({ password: mockPostgresConnectionInfo.password }), ); await expect( ibisAdaptor.modelSubstitute('SELECT * FROM test_table' as DialectSQL, { dataSource: DataSourceName.POSTGRES, connectionInfo: mockPostgresConnectionInfo, mdl: mockManifest, }), ).rejects.toMatchObject({ message: 'Model not found: test_table. Try adding both catalog and schema before your table name. e.g. my_database.public.test_table', extensions: { other: { correlationId: '123', processTime: '1s', }, }, }); }); it('should handle error when model substitution fails with MODEL_NOT_FOUND and one dot in model name', async () => { const mockError = { response: { data: 'Model not found: public.test_table', headers: { 'x-correlation-id': '123', 'x-process-time': '1s', }, }, }; mockedAxios.post.mockRejectedValue(mockError); mockedEncryptor.prototype.decrypt.mockReturnValue( JSON.stringify({ password: mockPostgresConnectionInfo.password }), ); await expect( ibisAdaptor.modelSubstitute( 'SELECT * FROM public.test_table' as DialectSQL, { dataSource: DataSourceName.POSTGRES, connectionInfo: mockPostgresConnectionInfo, mdl: mockManifest, }, ), ).rejects.toMatchObject({ message: 'Model not found: public.test_table. Try adding the catalog before the schema in your table name. e.g. my_database.public.test_table', extensions: { other: { correlationId: '123', processTime: '1s', }, }, }); }); it('should handle error when model substitution fails with MODEL_NOT_FOUND and two dots in model name', async () => { const mockError = { response: { data: 'Model not found: my_database.public.test_table', headers: { 'x-correlation-id': '123', 'x-process-time': '1s', }, }, }; mockedAxios.post.mockRejectedValue(mockError); mockedEncryptor.prototype.decrypt.mockReturnValue( JSON.stringify({ password: mockPostgresConnectionInfo.password }), ); await expect( ibisAdaptor.modelSubstitute( 'SELECT * FROM my_database.public.test_table' as DialectSQL, { dataSource: DataSourceName.POSTGRES, connectionInfo: mockPostgresConnectionInfo, mdl: mockManifest, }, ), ).rejects.toMatchObject({ message: 'Model not found: my_database.public.test_table. It may be missing from models, misnamed, or have a case mismatch.', extensions: { other: { correlationId: '123', processTime: '1s', }, }, }); }); it('should handle error when model substitution fails with MODEL_NOT_FOUND and more than two dots in model name', async () => { const mockError = { response: { data: 'Model not found: my_database.public.schema.test_table', headers: { 'x-correlation-id': '123', 'x-process-time': '1s', }, }, }; mockedAxios.post.mockRejectedValue(mockError); mockedEncryptor.prototype.decrypt.mockReturnValue( JSON.stringify({ password: mockPostgresConnectionInfo.password }), ); await expect( ibisAdaptor.modelSubstitute( 'SELECT * FROM my_database.public.schema.test_table' as DialectSQL, { dataSource: DataSourceName.POSTGRES, connectionInfo: mockPostgresConnectionInfo, mdl: mockManifest, }, ), ).rejects.toMatchObject({ message: 'Model not found: my_database.public.schema.test_table. It may be missing from models, misnamed, or have a case mismatch.', extensions: { other: { correlationId: '123', processTime: '1s', }, }, }); }); it('should handle error when model substitution fails with PARSING_EXCEPTION', async () => { const mockError = { response: { data: 'sql.parser.ParsingException: Invalid SQL syntax', headers: { 'x-correlation-id': '123', 'x-process-time': '1s', }, }, }; mockedAxios.post.mockRejectedValue(mockError); mockedEncryptor.prototype.decrypt.mockReturnValue( JSON.stringify({ password: mockPostgresConnectionInfo.password }), ); await expect( ibisAdaptor.modelSubstitute('SELECT * FROM test_table' as DialectSQL, { dataSource: DataSourceName.POSTGRES, connectionInfo: mockPostgresConnectionInfo, mdl: mockManifest, }), ).rejects.toMatchObject({ message: 'sql.parser.ParsingException: Invalid SQL syntax. Please check your selected column and make sure its quoted for columns with non-alphanumeric characters.', extensions: { other: { correlationId: '123', processTime: '1s', }, }, }); }); it('should handle error when model substitution fails with generic error', async () => { const mockError = { response: { data: 'Generic error occurred', headers: { 'x-correlation-id': '123', 'x-process-time': '1s', }, }, }; mockedAxios.post.mockRejectedValue(mockError); mockedEncryptor.prototype.decrypt.mockReturnValue( JSON.stringify({ password: mockPostgresConnectionInfo.password }), ); await expect( ibisAdaptor.modelSubstitute('SELECT * FROM test_table' as DialectSQL, { dataSource: DataSourceName.POSTGRES, connectionInfo: mockPostgresConnectionInfo, mdl: mockManifest, }), ).rejects.toMatchObject({ message: 'Generic error occurred', extensions: { other: { correlationId: '123', processTime: '1s', }, }, }); }); it('should include catalog and schema in headers when provided', async () => { const mockResponse = { data: 'SELECT * FROM substituted_table' }; mockedAxios.post.mockResolvedValue(mockResponse); mockedEncryptor.prototype.decrypt.mockReturnValue( JSON.stringify({ password: mockPostgresConnectionInfo.password }), ); const catalog = 'my_catalog'; const schema = 'my_schema'; const result = await ibisAdaptor.modelSubstitute( 'SELECT * FROM test_table' as DialectSQL, { dataSource: DataSourceName.POSTGRES, connectionInfo: mockPostgresConnectionInfo, mdl: mockManifest, catalog, schema, }, ); expect(result).toEqual('SELECT * FROM substituted_table'); expect(mockedAxios.post).toHaveBeenCalledWith( `${ibisServerEndpoint}/v3/connector/postgres/model-substitute`, { sql: 'SELECT * FROM test_table', connectionInfo: { connectionUrl: postgresConnectionUrl }, manifestStr: Buffer.from(JSON.stringify(mockManifest)).toString( 'base64', ), }, { headers: { 'X-User-CATALOG': catalog, 'X-User-SCHEMA': schema, }, }, ); }); it('should get version successfully', async () => { const mockVersion = '1.2.3'; mockedAxios.post.mockResolvedValue({ data: mockVersion }); mockedEncryptor.prototype.decrypt.mockReturnValue( JSON.stringify({ password: mockPostgresConnectionInfo.password }), ); const result = await ibisAdaptor.getVersion( DataSourceName.POSTGRES, mockPostgresConnectionInfo, ); expect(result).toEqual(mockVersion); expect(mockedAxios.post).toHaveBeenCalledWith( `${ibisServerEndpoint}/v2/connector/postgres/metadata/version`, { connectionInfo: { connectionUrl: postgresConnectionUrl }, }, ); }); it('should throw an error when getting version fails', async () => { const mockError = { response: { data: 'Failed to get version', headers: { 'x-correlation-id': '123', 'x-process-time': '1s', }, }, }; mockedAxios.post.mockRejectedValue(mockError); mockedEncryptor.prototype.decrypt.mockReturnValue( JSON.stringify({ password: mockPostgresConnectionInfo.password }), ); await expect( ibisAdaptor.getVersion( DataSourceName.POSTGRES, mockPostgresConnectionInfo, ), ).rejects.toMatchObject({ message: 'Failed to get version', extensions: { other: { correlationId: '123', processTime: '1s', }, }, }); }); it('should get version for different data sources', async () => { const mockVersion = '1.2.3'; mockedAxios.post.mockResolvedValue({ data: mockVersion }); // Test BigQuery mockedEncryptor.prototype.decrypt.mockReturnValue( JSON.stringify({ credentials: mockBigQueryConnectionInfo.credentials }), ); const bigQueryResult = await ibisAdaptor.getVersion( DataSourceName.BIG_QUERY, mockBigQueryConnectionInfo, ); expect(bigQueryResult).toEqual(mockVersion); expect(mockedAxios.post).toHaveBeenCalledWith( `${ibisServerEndpoint}/v2/connector/bigquery/metadata/version`, { connectionInfo: { project_id: mockBigQueryConnectionInfo.projectId, dataset_id: mockBigQueryConnectionInfo.datasetId, credentials: Buffer.from( JSON.stringify(mockBigQueryConnectionInfo.credentials), ).toString('base64'), }, }, ); // Test Snowflake mockedEncryptor.prototype.decrypt.mockReturnValue( JSON.stringify({ password: mockSnowflakeConnectionInfo.password }), ); const snowflakeResult = await ibisAdaptor.getVersion( DataSourceName.SNOWFLAKE, mockSnowflakeConnectionInfo, ); expect(snowflakeResult).toEqual(mockVersion); expect(mockedAxios.post).toHaveBeenCalledWith( `${ibisServerEndpoint}/v2/connector/snowflake/metadata/version`, { connectionInfo: { user: mockSnowflakeConnectionInfo.user, password: mockSnowflakeConnectionInfo.password, account: mockSnowflakeConnectionInfo.account, database: mockSnowflakeConnectionInfo.database, schema: mockSnowflakeConnectionInfo.schema, }, }, ); }); }); ================================================ FILE: wren-ui/src/apollo/server/adaptors/tests/wrenAIAdaptor.test.ts ================================================ import axios from 'axios'; import { WrenAIAdaptor } from '../wrenAIAdaptor'; import { RecommendationQuestionsInput, RecommendationQuestionStatus, } from '@server/models/adaptor'; import { Manifest } from '../../mdl/type'; jest.mock('axios'); const mockedAxios = axios as jest.Mocked; const sampleManifest: Manifest = { models: [ { name: 'model1', columns: [ { name: 'column1', type: 'string', isCalculated: false, }, ], }, ], }; describe('WrenAIAdaptor', () => { const baseEndpoint = 'http://test-endpoint'; let adaptor: WrenAIAdaptor; beforeEach(() => { adaptor = new WrenAIAdaptor({ wrenAIBaseEndpoint: baseEndpoint }); jest.clearAllMocks(); }); describe('generateRecommendationQuestions', () => { const mockInput: RecommendationQuestionsInput = { manifest: sampleManifest, previousQuestions: ['What is sales by region?'], projectId: 'project-123', maxQuestions: 5, maxCategories: 3, configuration: { language: 'English', }, }; it('should successfully generate recommendation questions', async () => { const mockQueryId = 'query-123'; mockedAxios.post.mockResolvedValueOnce({ data: { id: mockQueryId } }); const result = await adaptor.generateRecommendationQuestions(mockInput); expect(result).toEqual({ queryId: mockQueryId }); expect(mockedAxios.post).toHaveBeenCalledWith( `${baseEndpoint}/v1/question-recommendations`, { mdl: JSON.stringify(mockInput.manifest), previous_questions: mockInput.previousQuestions, project_id: mockInput.projectId, max_questions: mockInput.maxQuestions, max_categories: mockInput.maxCategories, configuration: mockInput.configuration, }, ); }); it('should handle errors when generating recommendation questions', async () => { const errorMessage = 'Network error'; mockedAxios.post.mockRejectedValueOnce(new Error(errorMessage)); await expect( adaptor.generateRecommendationQuestions(mockInput), ).rejects.toThrow(errorMessage); }); }); describe('getRecommendationQuestionsResult', () => { const queryId = 'query-123'; it('should successfully get recommendation questions result', async () => { const mockResponse = { status: 'FINISHED', response: { questions: [ { question: 'What is the total revenue?', explanation: 'This shows overall business performance', category: 'Revenue', }, ], }, }; mockedAxios.get.mockResolvedValueOnce({ data: mockResponse }); const result = await adaptor.getRecommendationQuestionsResult(queryId); expect(result).toEqual({ status: RecommendationQuestionStatus.FINISHED, error: null, ...mockResponse, }); expect(mockedAxios.get).toHaveBeenCalledWith( `${baseEndpoint}/v1/question-recommendations/${queryId}/result`, ); }); it('should handle errors when getting recommendation questions result', async () => { const errorMessage = 'Network error'; mockedAxios.get.mockRejectedValueOnce(new Error(errorMessage)); await expect( adaptor.getRecommendationQuestionsResult(queryId), ).rejects.toThrow(errorMessage); }); }); }); ================================================ FILE: wren-ui/src/apollo/server/adaptors/wrenAIAdaptor.ts ================================================ import axios from 'axios'; import { Readable } from 'stream'; import { AskCandidateType, AskDetailInput, AskDetailResult, AskHistory, AskResult, AskResultStatus, AsyncQueryResponse, RecommendationQuestionsInput, RecommendationQuestionsResult, WrenAIDeployStatusEnum, WrenAISystemStatus, WrenAIDeployResponse, DeployData, AskInput, TextBasedAnswerInput, TextBasedAnswerResult, ChartInput, ChartAdjustmentInput, ChartResult, ChartStatus, TextBasedAnswerStatus, SqlPairResult, SqlPairStatus, QuestionInput, QuestionsResult, QuestionsStatus, GenerateInstructionInput, InstructionStatus, InstructionResult, AskFeedbackInput, AskFeedbackResult, AskFeedbackStatus, } from '@server/models/adaptor'; import { getLogger } from '@server/utils'; import * as Errors from '@server/utils/error'; import { SqlPair } from '../repositories'; import { ThreadResponse } from '@server/repositories'; const logger = getLogger('WrenAIAdaptor'); logger.level = 'debug'; const getAIServiceError = (error: any) => { const { data } = error.response || {}; return data?.detail ? `${error.message}, detail: ${data.detail}` : error.message; }; export interface IWrenAIAdaptor { deploy(deployData: DeployData): Promise; delete(projectId: number): Promise; /** * Ask AI service a question. * AI service will return anwser candidates containing sql. * 1. use ask() to ask a question, AI service will return a queryId * 2. use getAskResult() to get the result of the queryId * 3. use cancelAsk() to cancel the query **/ ask(input: AskInput): Promise; cancelAsk(queryId: string): Promise; getAskResult(queryId: string): Promise; getAskStreamingResult(queryId: string): Promise; /** * After you choose a candidate, you can request AI service to generate the detail. * 1. use generateAskDetail() to generate the detail. AI service will return a queryId * 2. use getAskDetailResult() to get the result of the queryId */ generateAskDetail(input: AskDetailInput): Promise; getAskDetailResult(queryId: string): Promise; /** * Generate recommendation questions */ generateRecommendationQuestions( input: RecommendationQuestionsInput, ): Promise; getRecommendationQuestionsResult( queryId: string, ): Promise; /** * Get text-based answer from SQL */ createTextBasedAnswer( input: TextBasedAnswerInput, ): Promise; getTextBasedAnswerResult(queryId: string): Promise; streamTextBasedAnswer(queryId: string): Promise; /** * Chart related APIs */ generateChart(input: ChartInput): Promise; getChartResult(queryId: string): Promise; cancelChart(queryId: string): Promise; adjustChart(input: ChartAdjustmentInput): Promise; getChartAdjustmentResult(queryId: string): Promise; cancelChartAdjustment(queryId: string): Promise; /** * Sql Pair APIs */ deploySqlPair( projectId: number, sqlPair: { question: string; sql: string }, ): Promise; getSqlPairResult(queryId: string): Promise; deleteSqlPairs(projectId: number, sqlPairIds: number[]): Promise; generateQuestions(input: QuestionInput): Promise; getQuestionsResult(queryId: string): Promise>; /** * instruction related APIs */ generateInstruction( input: GenerateInstructionInput[], ): Promise; getInstructionResult(queryId: string): Promise; deleteInstructions(ids: number[], projectId: number): Promise; /** * Ask feedback APIs */ createAskFeedback(input: AskFeedbackInput): Promise; getAskFeedbackResult(queryId: string): Promise; cancelAskFeedback(queryId: string): Promise; } export class WrenAIAdaptor implements IWrenAIAdaptor { private readonly wrenAIBaseEndpoint: string; constructor({ wrenAIBaseEndpoint }: { wrenAIBaseEndpoint: string }) { this.wrenAIBaseEndpoint = wrenAIBaseEndpoint; } public async delete(projectId: number): Promise { try { if (!projectId) { throw new Error('Project ID is required'); } const url = `${this.wrenAIBaseEndpoint}/v1/semantics`; const response = await axios.delete(url, { params: { project_id: projectId.toString(), }, }); if (response.status === 200) { logger.info(`Wren AI: Deleted semantics for project ${projectId}`); } else { throw new Error(`Failed to delete semantics. ${response.data?.error}`); } } catch (error: any) { throw new Error( `Wren AI: Failed to delete semantics: ${getAIServiceError(error)}`, ); } } public async deploySqlPair( projectId: number, sqlPair: Partial, ): Promise { try { const body = { sql_pairs: [ { id: `${sqlPair.id}`, sql: sqlPair.sql, question: sqlPair.question, }, ], project_id: projectId.toString(), }; return axios .post(`${this.wrenAIBaseEndpoint}/v1/sql-pairs`, body) .then((res) => { return { queryId: res.data.event_id }; }); } catch (err: any) { logger.debug( `Got error when deploying SQL pair: ${getAIServiceError(err)}`, ); throw err; } } public async getSqlPairResult(queryId: string): Promise { try { const res = await axios.get( `${this.wrenAIBaseEndpoint}/v1/sql-pairs/${queryId}`, ); const { status, error } = this.transformStatusAndError(res.data); return { status: status as SqlPairStatus, error, }; } catch (err: any) { logger.debug( `Got error when getting SQL pair result: ${getAIServiceError(err)}`, ); throw err; } } public async deleteSqlPairs( projectId: number, sqlPairIds: number[], ): Promise { try { await axios.delete(`${this.wrenAIBaseEndpoint}/v1/sql-pairs`, { data: { sql_pair_ids: sqlPairIds.map((id) => id.toString()), project_id: projectId.toString(), }, }); return; } catch (err: any) { logger.debug( `Got error when deleting SQL pair: ${getAIServiceError(err)}`, ); throw err; } } /** * Ask AI service a question. * AI service will return anwser candidates containing sql. */ public async ask(input: AskInput): Promise { try { const res = await axios.post(`${this.wrenAIBaseEndpoint}/v1/asks`, { query: input.query, id: input.deployId, histories: this.transformHistoryInput(input.histories), configurations: input.configurations, }); return { queryId: res.data.query_id }; } catch (err: any) { logger.debug(`Got error when asking wren AI: ${getAIServiceError(err)}`); throw err; } } public async cancelAsk(queryId: string): Promise { // make PATCH request /v1/asks/:query_id to cancel the query try { await axios.patch(`${this.wrenAIBaseEndpoint}/v1/asks/${queryId}`, { status: 'stopped', }); } catch (err: any) { logger.debug(`Got error when canceling ask: ${getAIServiceError(err)}`); throw err; } } public async getAskResult(queryId: string): Promise { // make GET request /v1/asks/:query_id/result to get the result try { const res = await axios.get( `${this.wrenAIBaseEndpoint}/v1/asks/${queryId}/result`, ); return this.transformAskResult(res.data); } catch (err: any) { logger.debug( `Got error when getting ask result: ${getAIServiceError(err)}`, ); // throw err; throw Errors.create(Errors.GeneralErrorCodes.INTERNAL_SERVER_ERROR, { originalError: err, }); } } public async getAskStreamingResult(queryId: string): Promise { // make GET request /v1/asks/:query_id/streaming-result to get the streaming result try { const res = await axios.get( `${this.wrenAIBaseEndpoint}/v1/asks/${queryId}/streaming-result`, { responseType: 'stream' }, ); return res.data; } catch (err: any) { logger.debug( `Got error when getting ask streaming result: ${getAIServiceError(err)}`, ); // throw err; throw Errors.create(Errors.GeneralErrorCodes.INTERNAL_SERVER_ERROR, { originalError: err, }); } } /** * After you choose a candidate, you can request AI service to generate the detail. */ public async generateAskDetail( input: AskDetailInput, ): Promise { try { const res = await axios.post( `${this.wrenAIBaseEndpoint}/v1/ask-details`, input, ); return { queryId: res.data.query_id }; } catch (err: any) { logger.debug( `Got error when generating ask detail: ${getAIServiceError(err)}`, ); throw err; } } public async getAskDetailResult(queryId: string): Promise { // make GET request /v1/ask-details/:query_id/result to get the result try { const res = await axios.get( `${this.wrenAIBaseEndpoint}/v1/ask-details/${queryId}/result`, ); return this.transformAskDetailResult(res.data); } catch (err: any) { logger.debug( `Got error when getting ask detail result: ${getAIServiceError(err)}`, ); throw err; } } public async deploy(deployData: DeployData): Promise { const { manifest, hash } = deployData; try { const res = await axios.post( `${this.wrenAIBaseEndpoint}/v1/semantics-preparations`, { mdl: JSON.stringify(manifest), id: hash, }, ); const deployId = res.data.id; logger.debug( `Wren AI: Deploying wren AI, hash: ${hash}, deployId: ${deployId}`, ); const deploySuccess = await this.waitDeployFinished(deployId); if (deploySuccess) { logger.debug(`Wren AI: Deploy wren AI success, hash: ${hash}`); return { status: WrenAIDeployStatusEnum.SUCCESS }; } else { return { status: WrenAIDeployStatusEnum.FAILED, error: `Wren AI: Deploy wren AI failed or timeout, hash: ${hash}`, }; } } catch (err: any) { logger.debug( `Got error when deploying to wren AI, hash: ${hash}. Error: ${err.message}`, ); return { status: WrenAIDeployStatusEnum.FAILED, error: `Wren AI Error: deployment hash:${hash}, ${err.message}`, }; } } public async generateRecommendationQuestions( input: RecommendationQuestionsInput, ): Promise { const body = { mdl: JSON.stringify(input.manifest), previous_questions: input.previousQuestions, max_questions: input.maxQuestions, max_categories: input.maxCategories, configuration: input.configuration, }; logger.info(`Wren AI: Generating recommendation questions`); try { const res = await axios.post( `${this.wrenAIBaseEndpoint}/v1/question-recommendations`, body, ); logger.info( `Wren AI: Generating recommendation questions, queryId: ${res.data.id}`, ); return { queryId: res.data.id }; } catch (err: any) { logger.debug( `Got error when generating recommendation questions: ${getAIServiceError(err)}`, ); throw err; } } public async getRecommendationQuestionsResult( queryId: string, ): Promise { try { const res = await axios.get( `${this.wrenAIBaseEndpoint}/v1/question-recommendations/${queryId}`, ); return this.transformRecommendationQuestionsResult(res.data); } catch (err: any) { logger.debug( `Got error when getting recommendation questions result: ${getAIServiceError(err)}`, ); throw err; } } public async createTextBasedAnswer( input: TextBasedAnswerInput, ): Promise { const body = { query: input.query, sql: input.sql, sql_data: input.sqlData, thread_id: input.threadId, user_id: input.userId, configurations: input.configurations, }; // make POST request /v1/sql-answers to create text-based answer try { const res = await axios.post( `${this.wrenAIBaseEndpoint}/v1/sql-answers`, body, ); return { queryId: res.data.query_id }; } catch (err: any) { logger.debug( `Got error when creating text-based answer: ${getAIServiceError(err)}`, ); throw err; } } public async getTextBasedAnswerResult( queryId: string, ): Promise { // make GET request /v1/sql-answers/:query_id to get the result try { const res = await axios.get( `${this.wrenAIBaseEndpoint}/v1/sql-answers/${queryId}`, ); return this.transformTextBasedAnswerResult(res.data); } catch (err: any) { logger.debug( `Got error when getting text-based answer result: ${getAIServiceError(err)}`, ); throw err; } } public async streamTextBasedAnswer(queryId: string): Promise { // make GET request /v1/sql-answers/:query_id/streaming to get the streaming result try { const res = await axios.get( `${this.wrenAIBaseEndpoint}/v1/sql-answers/${queryId}/streaming`, { responseType: 'stream' }, ); return res.data; } catch (err: any) { logger.debug( `Got error when getting text-based answer streaming result: ${getAIServiceError(err)}`, ); throw err; } } public async generateChart(input: ChartInput): Promise { try { const res = await axios.post( `${this.wrenAIBaseEndpoint}/v1/charts`, input, ); return { queryId: res.data.query_id }; } catch (err: any) { logger.debug(`Got error when creating chart: ${getAIServiceError(err)}`); throw err; } } public async getChartResult(queryId: string): Promise { try { const res = await axios.get( `${this.wrenAIBaseEndpoint}/v1/charts/${queryId}`, ); return this.transformChartResult(res.data); } catch (err: any) { logger.debug( `Got error when getting chart result: ${getAIServiceError(err)}`, ); throw err; } } public async cancelChart(queryId: string): Promise { try { await axios.patch(`${this.wrenAIBaseEndpoint}/v1/charts/${queryId}`, { status: 'stopped', }); } catch (err: any) { logger.debug(`Got error when canceling chart: ${getAIServiceError(err)}`); throw err; } } public async adjustChart( input: ChartAdjustmentInput, ): Promise { try { const res = await axios.post( `${this.wrenAIBaseEndpoint}/v1/chart-adjustments`, this.transformChartAdjustmentInput(input), ); return { queryId: res.data.query_id }; } catch (err: any) { logger.debug(`Got error when adjusting chart: ${getAIServiceError(err)}`); throw err; } } public async getChartAdjustmentResult(queryId: string): Promise { try { const res = await axios.get( `${this.wrenAIBaseEndpoint}/v1/chart-adjustments/${queryId}`, ); return this.transformChartResult(res.data); } catch (err: any) { logger.debug( `Got error when getting chart adjustment result: ${getAIServiceError(err)}`, ); throw err; } } public async cancelChartAdjustment(queryId: string): Promise { try { await axios.patch( `${this.wrenAIBaseEndpoint}/v1/chart-adjustments/${queryId}`, { status: 'stopped', }, ); } catch (err: any) { logger.debug( `Got error when canceling chart adjustment: ${getAIServiceError(err)}`, ); throw err; } } public async generateQuestions( input: QuestionInput, ): Promise { try { const body = { sqls: input.sqls, project_id: input.projectId.toString(), configurations: input.configurations, }; const res = await axios.post( `${this.wrenAIBaseEndpoint}/v1/sql-questions`, body, ); return { queryId: res.data.query_id }; } catch (err: any) { logger.debug( `Got error when generating questions: ${getAIServiceError(err)}`, ); throw err; } } public async generateInstruction( input: GenerateInstructionInput[], ): Promise { const body = { instructions: input.map((item) => ({ id: item.id.toString(), instruction: item.instruction, questions: item.questions, is_default: item.isDefault, })), project_id: input[0]?.projectId.toString(), }; try { const res = await axios.post( `${this.wrenAIBaseEndpoint}/v1/instructions`, body, ); return { queryId: res.data.event_id }; } catch (err: any) { logger.debug( `Got error when generating instruction: ${getAIServiceError(err)}`, ); throw err; } } public async getQuestionsResult( queryId: string, ): Promise> { try { const res = await axios.get( `${this.wrenAIBaseEndpoint}/v1/sql-questions/${queryId}`, ); const { status, error } = this.transformStatusAndError(res.data); return { status: status as QuestionsStatus, error, questions: res.data.questions || [], }; } catch (err: any) { logger.debug( `Got error when getting questions result: ${getAIServiceError(err)}`, ); throw err; } } public async getInstructionResult( queryId: string, ): Promise { try { const res = await axios.get( `${this.wrenAIBaseEndpoint}/v1/instructions/${queryId}`, ); return this.transformStatusAndError(res.data) as InstructionResult; } catch (err: any) { logger.debug( `Got error when getting instruction result: ${getAIServiceError(err)}`, ); throw err; } } public async deleteInstructions( ids: number[], projectId: number, ): Promise { try { await axios.delete(`${this.wrenAIBaseEndpoint}/v1/instructions`, { data: { instruction_ids: ids.map((id) => id.toString()), project_id: projectId.toString(), }, }); } catch (err: any) { logger.debug( `Got error when deleting instruction: ${getAIServiceError(err)}`, ); throw err; } } public async createAskFeedback( input: AskFeedbackInput, ): Promise { try { const body = { question: input.question, tables: input.tables, sql_generation_reasoning: input.sqlGenerationReasoning, sql: input.sql, project_id: input.projectId.toString(), configurations: input.configurations, }; const res = await axios.post( `${this.wrenAIBaseEndpoint}/v1/ask-feedbacks`, body, ); return { queryId: res.data.query_id }; } catch (err: any) { logger.debug( `Got error when creating ask feedback: ${getAIServiceError(err)}`, ); throw err; } } public async getAskFeedbackResult( queryId: string, ): Promise { try { const res = await axios.get( `${this.wrenAIBaseEndpoint}/v1/ask-feedbacks/${queryId}`, ); return this.transformAskFeedbackResult(res.data); } catch (err: any) { logger.debug( `Got error when getting ask feedback result: ${getAIServiceError(err)}`, ); throw err; } } public async cancelAskFeedback(queryId: string): Promise { try { await axios.patch( `${this.wrenAIBaseEndpoint}/v1/ask-feedbacks/${queryId}`, { status: 'stopped', }, ); } catch (err: any) { logger.debug( `Got error when canceling ask feedback: ${getAIServiceError(err)}`, ); throw err; } } private transformAskFeedbackResult(body: any): AskFeedbackResult { const { status, error } = this.transformStatusAndError(body); return { status: status as AskFeedbackStatus, error, response: body.response?.map((result: any) => ({ sql: result.sql, type: result.type?.toUpperCase() as AskCandidateType, })) || [], traceId: body.trace_id, invalidSql: body.invalid_sql, }; } private transformChartAdjustmentInput(input: ChartAdjustmentInput) { const { query, sql, adjustmentOption, chartSchema, configurations } = input; return { query, sql, adjustment_option: { chart_type: adjustmentOption.chartType.toLowerCase(), x_axis: adjustmentOption.xAxis, y_axis: adjustmentOption.yAxis, x_offset: adjustmentOption.xOffset, color: adjustmentOption.color, theta: adjustmentOption.theta, }, chart_schema: chartSchema, configurations, }; } private transformChartResult(body: any): ChartResult { const { status, error } = this.transformStatusAndError(body); return { status: status as ChartStatus, error, response: { reasoning: body.response?.reasoning, chartType: body.response?.chart_type, chartSchema: body.response?.chart_schema, }, }; } private transformTextBasedAnswerResult(body: any): TextBasedAnswerResult { const { status, error } = this.transformStatusAndError(body); return { status: status as TextBasedAnswerStatus, numRowsUsedInLLM: body.num_rows_used_in_llm, error, }; } private async waitDeployFinished(deployId: string): Promise { let deploySuccess = false; // timeout after 30 seconds for (let waitTime = 1; waitTime <= 7; waitTime++) { try { const status = await this.getDeployStatus(deployId); logger.debug(`Wren AI: Deploy status: ${status}`); if (status === WrenAISystemStatus.FINISHED) { deploySuccess = true; break; } else if (status === WrenAISystemStatus.FAILED) { break; } else if (status === WrenAISystemStatus.INDEXING) { // do nothing } else { logger.debug(`Wren AI: Unknown Wren AI deploy status: ${status}`); return; } } catch (err: any) { throw err; } await new Promise((resolve) => setTimeout(resolve, waitTime * 1000)); } return deploySuccess; } private async getDeployStatus(deployId: string): Promise { try { const res = await axios.get( `${this.wrenAIBaseEndpoint}/v1/semantics-preparations/${deployId}/status`, ); if (res.data.error) { // passing AI response error string to catch block throw new Error(res.data.error); } return res.data?.status.toUpperCase() as WrenAISystemStatus; } catch (err: any) { logger.debug( `Got error in API /v1/semantics-preparations/${deployId}/status: ${err.message}`, ); throw err; } } private transformAskResult(body: any): AskResult { const { status, error } = this.transformStatusAndError(body); const candidates = (body?.response || []).map((candidate: any) => ({ type: candidate?.type?.toUpperCase() as AskCandidateType, sql: candidate.sql, viewId: candidate?.viewId ? Number(candidate.viewId) : null, sqlpairId: candidate?.sqlpairId ? Number(candidate.sqlpairId) : null, })); return { type: body?.type, status: status as AskResultStatus, error, response: candidates, rephrasedQuestion: body?.rephrased_question, intentReasoning: body?.intent_reasoning, sqlGenerationReasoning: body?.sql_generation_reasoning, retrievedTables: body?.retrieved_tables, invalidSql: body?.invalid_sql, traceId: body?.trace_id, }; } private transformRecommendationQuestionsResult( body: any, ): RecommendationQuestionsResult { const { status, error } = this.transformStatusAndError(body); return { ...body, status, error, }; } private transformAskDetailResult(body: any): AskDetailResult { const { type } = body; const { status, error } = this.transformStatusAndError(body); // snake_case to camelCase const steps = (body?.response?.steps || []).map((step: any) => ({ summary: step.summary, sql: step.sql, cteName: step.cte_name, })); return { type, status: status as AskResultStatus, error, response: { description: body?.response?.description, steps, }, }; } private transformStatusAndError(body: any): { status: | AskResultStatus | TextBasedAnswerStatus | ChartStatus | SqlPairStatus | QuestionsStatus | InstructionStatus | AskFeedbackStatus; error?: { code: Errors.GeneralErrorCodes; message: string; shortMessage: string; } | null; } { // transform status to enum const status = body?.status?.toUpperCase(); if (!status) { throw new Error(`Unknown ask status: ${body?.status}`); } // use custom error to transform error const code = body?.error?.code; const isShowAIServiceErrorMessage = code === Errors.GeneralErrorCodes.NO_RELEVANT_SQL || code === Errors.GeneralErrorCodes.AI_SERVICE_UNDEFINED_ERROR; const error = code ? Errors.create( code, isShowAIServiceErrorMessage ? { customMessage: body?.error?.message, } : undefined, ) : null; // format custom error into WrenAIError that is used in graphql const formattedError = error ? { code: error.extensions.code as Errors.GeneralErrorCodes, message: error.message, shortMessage: error.extensions.shortMessage as string, } : null; return { status, error: formattedError, }; } private transformHistoryInput(histories: ThreadResponse[]): AskHistory[] { if (!histories) { return []; } // make it snake_case return histories.map((history) => ({ sql: history.sql, question: history.question, })); } } ================================================ FILE: wren-ui/src/apollo/server/adaptors/wrenEngineAdaptor.ts ================================================ import axios, { AxiosResponse } from 'axios'; import { Manifest } from '../mdl/type'; import { getLogger } from '@server/utils'; import * as Errors from '@server/utils/error'; import { CompactTable, DEFAULT_PREVIEW_LIMIT } from '../services'; const logger = getLogger('WrenEngineAdaptor'); logger.level = 'debug'; export interface WrenEngineDeployStatusResponse { systemStatus: string; version: string; } export interface ColumnMetadata { name: string; type: string; } export interface EngineQueryResponse { columns: ColumnMetadata[]; data: any[][]; } export interface DescribeStatementResponse { columns: ColumnMetadata[]; } export enum WrenEngineValidateStatus { PASS = 'PASS', ERROR = 'ERROR', FAIL = 'FAIL', WARN = 'WARN', SKIP = 'SKIP', } export interface WrenEngineValidateResponse { duration: string; name: string; status: WrenEngineValidateStatus; } export interface WrenEngineValidationResponse { valid: boolean; message?: string; } export interface DryPlanOption { modelingOnly?: boolean; manifest?: Manifest; } export interface WrenEngineDryRunOption { manifest?: Manifest; limit?: number; } export interface DuckDBPrepareOptions { initSql: string; sessionProps: Record; } // The response consists of an array containing columns. Each column contains a name and a type. export interface WrenEngineDryRunResponse { name: string; type: string; } export interface IWrenEngineAdaptor { // duckdb data source related prepareDuckDB(options: DuckDBPrepareOptions): Promise; queryDuckdb(sql: string): Promise; putSessionProps(props: Record): Promise; // metadata related, used to fetch metadata of duckdb listTables(): Promise; // config wren engine patchConfig(config: Record): Promise; // query previewData( sql: string, mdl: Manifest, limit?: number, ): Promise; getNativeSQL(sql: string, options?: DryPlanOption): Promise; validateColumnIsValid( manifest: Manifest, modelName: string, columnName: string, ): Promise; dryRun( sql: string, options: WrenEngineDryRunOption, ): Promise; } export class WrenEngineAdaptor implements IWrenEngineAdaptor { private readonly wrenEngineBaseEndpoint: string; private sessionPropsUrlPath = '/v1/data-source/duckdb/settings/session-sql'; private queryDuckdbUrlPath = '/v1/data-source/duckdb/query'; private initSqlUrlPath = '/v1/data-source/duckdb/settings/init-sql'; private previewUrlPath = '/v1/mdl/preview'; private dryPlanUrlPath = '/v1/mdl/dry-plan'; private dryRunUrlPath = '/v1/mdl/dry-run'; private validateUrlPath = '/v1/mdl/validate'; constructor({ wrenEngineEndpoint }: { wrenEngineEndpoint: string }) { this.wrenEngineBaseEndpoint = wrenEngineEndpoint; } public async validateColumnIsValid( manifest: Manifest, modelName: string, columnName: string, ) { const model = manifest.models.find((m) => m.name === modelName); if (!model) { return { valid: false, message: `Model ${modelName} not found in the manifest`, }; } const column = model.columns.find((c) => c.name === columnName); if (!column) { return { valid: false, message: `Column ${columnName} not found in model ${modelName} in the manifest`, }; } try { const payload = { manifest, parameters: { modelName, columnName }, }; const res = await axios.post( `${this.wrenEngineBaseEndpoint}${this.validateUrlPath}/column_is_valid`, payload, ); const result = res.data[0] as WrenEngineValidateResponse; if (result.status === WrenEngineValidateStatus.PASS) { return { valid: true }; } else { return { valid: false, message: JSON.stringify(result) }; } } catch (err: any) { logger.debug(`Got error when validating column: ${err.message}`); return { valid: false, message: err.message }; } } public async prepareDuckDB(options: DuckDBPrepareOptions): Promise { const { initSql, sessionProps } = options; await this.initDatabase(initSql); await this.putSessionProps(sessionProps); } public async listTables() { const sql = 'SELECT \ table_catalog, table_schema, table_name, column_name, ordinal_position, is_nullable, data_type\ FROM INFORMATION_SCHEMA.COLUMNS;'; const response = await this.queryDuckdb(sql); return this.formatToCompactTable(response); } public async putSessionProps(props: Record) { const setSessionStatements = Object.entries(props) .map(([key, value]) => { return `SET ${key} = '${value}';`; }) .join('\n'); try { const url = new URL( this.sessionPropsUrlPath, this.wrenEngineBaseEndpoint, ); const headers = { 'Content-Type': 'text/plain; charset=utf-8', }; await axios.put(url.href, setSessionStatements, { headers }); } catch (err: any) { logger.debug(`Got error when put session props: ${err.message}`); throw Errors.create(Errors.GeneralErrorCodes.SESSION_PROPS_ERROR, { customMessage: Errors.errorMessages[Errors.GeneralErrorCodes.SESSION_PROPS_ERROR], originalError: err, }); } } public async queryDuckdb(sql: string): Promise { try { const url = new URL(this.queryDuckdbUrlPath, this.wrenEngineBaseEndpoint); const headers = { 'Content-Type': 'text/plain; charset=utf-8', }; const res = await axios.post(url.href, sql, { headers }); return res.data as EngineQueryResponse; } catch (err: any) { logger.debug(`Got error when querying duckdb: ${err.message}`); throw Errors.create(Errors.GeneralErrorCodes.WREN_ENGINE_ERROR, { customMessage: err.response?.data?.message || err.message, originalError: err, }); } } public async patchConfig(config: Record) { try { const configPayload = Object.entries(config).map(([key, value]) => { return { name: key, value, }; }); const url = new URL('/v1/config', this.wrenEngineBaseEndpoint); const headers = { 'Content-Type': 'application/json', }; await axios.patch(url.href, configPayload, { headers }); } catch (err: any) { logger.debug(`Got error when patching config: ${err.message}`); throw Errors.create(Errors.GeneralErrorCodes.WREN_ENGINE_ERROR, { customMessage: err.response?.data?.message || err.message, originalError: err, }); } } public async previewData( sql: string, manifest: Manifest, limit: number = DEFAULT_PREVIEW_LIMIT, ): Promise { try { const url = new URL(this.previewUrlPath, this.wrenEngineBaseEndpoint); const headers = { 'Content-Type': 'application/json', }; const res: AxiosResponse = await axios({ method: 'get', url: url.href, headers, data: { sql, limit, manifest, }, }); return res.data; } catch (err: any) { logger.debug(`Got error when previewing data: ${err.message}`); throw Errors.create(Errors.GeneralErrorCodes.WREN_ENGINE_ERROR, { customMessage: err.response?.data?.message || err.message, originalError: err, }); } } public async getNativeSQL( sql: string, options: DryPlanOption, ): Promise { try { const props = { modelingOnly: options?.modelingOnly ? true : false, manifest: options?.manifest, }; const url = new URL(this.dryPlanUrlPath, this.wrenEngineBaseEndpoint); const headers = { 'Content-Type': 'application/json' }; const res: AxiosResponse = await axios({ method: 'get', url: url.href, headers, data: { sql, ...props, }, }); return res.data; } catch (err: any) { logger.debug(`Got error when getting native SQL: ${err.message}`); Errors.create(Errors.GeneralErrorCodes.DRY_PLAN_ERROR, { customMessage: err.message, originalError: err, }); } } public async dryRun( sql: string, options: WrenEngineDryRunOption, ): Promise { try { const { manifest } = options; const body = { sql, manifest, }; logger.debug( `Dry run wren engine with body: ${JSON.stringify(sql, null, 2)}`, ); const url = new URL(this.dryRunUrlPath, this.wrenEngineBaseEndpoint); const res: AxiosResponse = await axios({ method: 'get', url: url.href, data: body, }); logger.debug(`Wren Engine Dry run success`); return res.data; } catch (err: any) { logger.info(`Got error when dry running`); throw Errors.create(Errors.GeneralErrorCodes.DRY_RUN_ERROR, { customMessage: err.response.data.message, originalError: err, }); } } private async getDeployStatus(): Promise { try { const res = await axios.get( `${this.wrenEngineBaseEndpoint}/v1/mdl/status`, ); return res.data as WrenEngineDeployStatusResponse; } catch (err: any) { logger.debug( `WrenEngine: Got error when getting deploy status: ${err.message}`, ); throw err; } } private async initDatabase(sql) { try { const url = new URL(this.initSqlUrlPath, this.wrenEngineBaseEndpoint); const headers = { 'Content-Type': 'text/plain; charset=utf-8', }; await axios.put(url.href, sql, { headers }); } catch (err: any) { logger.debug(`Got error when init database: ${err}`); throw Errors.create(Errors.GeneralErrorCodes.INIT_SQL_ERROR, { customMessage: Errors.errorMessages[Errors.GeneralErrorCodes.INIT_SQL_ERROR], originalError: err, }); } } private formatToCompactTable(columns: EngineQueryResponse): CompactTable[] { return columns.data.reduce((acc: CompactTable[], row: any) => { const [ table_catalog, table_schema, table_name, column_name, _ordinal_position, is_nullable, data_type, ] = row; let table = acc.find( (t) => t.name === table_name && t.properties.schema === table_schema, ); if (!table) { table = { name: table_name, description: '', columns: [], properties: { schema: table_schema, catalog: table_catalog, table: table_name, }, primaryKey: null, }; acc.push(table); } table.columns.push({ name: column_name, type: data_type, notNull: is_nullable.toLocaleLowerCase() !== 'yes', description: '', properties: {}, }); return acc; }, []); } } ================================================ FILE: wren-ui/src/apollo/server/backgrounds/adjustmentBackgroundTracker.ts ================================================ import { getLogger } from '@server/utils'; import { AskFeedbackInput, AskFeedbackResult, AskFeedbackStatus, } from '@server/models/adaptor'; import { AskingTask, IAskingTaskRepository, IThreadResponseRepository, ThreadResponse, ThreadResponseAdjustmentType, } from '@server/repositories'; import { IWrenAIAdaptor } from '../adaptors'; import { TelemetryEvent, WrenService } from '../telemetry/telemetry'; import { PostHogTelemetry } from '../telemetry/telemetry'; const logger = getLogger('AdjustmentTaskTracker'); logger.level = 'debug'; interface TrackedTask { queryId: string; taskId?: number; lastPolled: number; result?: AskFeedbackResult; isFinalized: boolean; threadResponseId: number; question: string; originalThreadResponseId: number; rerun?: boolean; adjustmentPayload?: { originalThreadResponseId: number; retrievedTables: string[]; sqlGenerationReasoning: string; }; } export type TrackedAdjustmentResult = AskFeedbackResult & { taskId?: number; queryId: string; }; export type CreateAdjustmentTaskInput = AskFeedbackInput & { threadId: number; question: string; originalThreadResponseId: number; configurations: { language: string }; }; export type RerunAdjustmentTaskInput = { threadResponseId: number; threadId: number; projectId: number; configurations: { language: string }; }; export interface IAdjustmentBackgroundTaskTracker { createAdjustmentTask( input: CreateAdjustmentTaskInput, ): Promise<{ queryId: string }>; getAdjustmentResult(queryId: string): Promise; getAdjustmentResultById(id: number): Promise; cancelAdjustmentTask(queryId: string): Promise; rerunAdjustmentTask( input: RerunAdjustmentTaskInput, ): Promise<{ queryId: string }>; } export class AdjustmentBackgroundTaskTracker implements IAdjustmentBackgroundTaskTracker { private wrenAIAdaptor: IWrenAIAdaptor; private askingTaskRepository: IAskingTaskRepository; private trackedTasks: Map = new Map(); private trackedTasksById: Map = new Map(); private pollingInterval: number; private memoryRetentionTime: number; private pollingIntervalId: NodeJS.Timeout; private runningJobs = new Set(); private threadResponseRepository: IThreadResponseRepository; private telemetry: PostHogTelemetry; constructor({ telemetry, wrenAIAdaptor, askingTaskRepository, threadResponseRepository, pollingInterval = 1000, // 1 second memoryRetentionTime = 5 * 60 * 1000, // 5 minutes }: { telemetry: PostHogTelemetry; wrenAIAdaptor: IWrenAIAdaptor; askingTaskRepository: IAskingTaskRepository; threadResponseRepository: IThreadResponseRepository; pollingInterval?: number; memoryRetentionTime?: number; }) { this.telemetry = telemetry; this.wrenAIAdaptor = wrenAIAdaptor; this.askingTaskRepository = askingTaskRepository; this.threadResponseRepository = threadResponseRepository; this.pollingInterval = pollingInterval; this.memoryRetentionTime = memoryRetentionTime; this.startPolling(); } public async createAdjustmentTask( input: CreateAdjustmentTaskInput, ): Promise<{ queryId: string; createdThreadResponse: ThreadResponse }> { try { // Call the AI service to create a task const response = await this.wrenAIAdaptor.createAskFeedback(input); const queryId = response.queryId; // create a new asking task const createdAskingTask = await this.askingTaskRepository.createOne({ queryId, question: input.question, threadId: input.threadId, detail: { adjustment: true, status: AskFeedbackStatus.UNDERSTANDING, response: [], error: null, }, }); // create a new thread response with adjustment payload const createdThreadResponse = await this.threadResponseRepository.createOne({ question: input.question, threadId: input.threadId, askingTaskId: createdAskingTask.id, adjustment: { type: ThreadResponseAdjustmentType.REASONING, payload: { originalThreadResponseId: input.originalThreadResponseId, retrievedTables: input.tables, sqlGenerationReasoning: input.sqlGenerationReasoning, }, }, }); // bind the thread response to the asking task // todo: it's weird that we need to update the asking task again // find a better way to do this await this.askingTaskRepository.updateOne(createdAskingTask.id, { threadResponseId: createdThreadResponse.id, }); // Start tracking this task const task = { queryId, lastPolled: Date.now(), isFinalized: false, originalThreadResponseId: input.originalThreadResponseId, threadResponseId: createdThreadResponse.id, question: input.question, adjustmentPayload: { originalThreadResponseId: input.originalThreadResponseId, retrievedTables: input.tables, sqlGenerationReasoning: input.sqlGenerationReasoning, }, } as TrackedTask; this.trackedTasks.set(queryId, task); this.trackedTasksById.set(createdThreadResponse.id, task); logger.info(`Created adjustment task with queryId: ${queryId}`); return { queryId, createdThreadResponse }; } catch (err) { logger.error(`Failed to create adjustment task: ${err}`); throw err; } } public async rerunAdjustmentTask( input: RerunAdjustmentTaskInput, ): Promise<{ queryId: string }> { const currentThreadResponse = await this.threadResponseRepository.findOneBy( { id: input.threadResponseId, }, ); if (!currentThreadResponse) { throw new Error(`Thread response ${input.threadResponseId} not found`); } const adjustment = currentThreadResponse.adjustment; if (!adjustment) { throw new Error( `Thread response ${input.threadResponseId} has no adjustment`, ); } const originalThreadResponse = await this.threadResponseRepository.findOneBy({ id: adjustment.payload?.originalThreadResponseId, }); if (!originalThreadResponse) { throw new Error( `Original thread response ${adjustment.payload?.originalThreadResponseId} not found`, ); } // call createAskFeedback on AI service const response = await this.wrenAIAdaptor.createAskFeedback({ ...input, tables: adjustment.payload?.retrievedTables, sqlGenerationReasoning: adjustment.payload?.sqlGenerationReasoning, sql: originalThreadResponse.sql, question: originalThreadResponse.question, }); const queryId = response.queryId; // update asking task with new queryId await this.askingTaskRepository.updateOne( currentThreadResponse.askingTaskId, { queryId, // reset detail detail: { adjustment: true, status: AskFeedbackStatus.UNDERSTANDING, response: [], error: null, }, }, ); // schedule task const task = { queryId, lastPolled: Date.now(), isFinalized: false, originalThreadResponseId: originalThreadResponse.id, threadResponseId: currentThreadResponse.id, question: originalThreadResponse.question, rerun: true, adjustmentPayload: { originalThreadResponseId: originalThreadResponse.id, retrievedTables: adjustment.payload?.retrievedTables, sqlGenerationReasoning: adjustment.payload?.sqlGenerationReasoning, }, } as TrackedTask; this.trackedTasks.set(queryId, task); this.trackedTasksById.set(currentThreadResponse.id, task); logger.info(`Rerun adjustment task with queryId: ${queryId}`); return { queryId }; } public async getAdjustmentResult( queryId: string, ): Promise { // Check if we're tracking this task in memory const trackedTask = this.trackedTasks.get(queryId); if (trackedTask && trackedTask.result) { return { ...trackedTask.result, queryId, taskId: trackedTask.taskId, }; } // If not in memory or no result yet, check the database return this.getAdjustmentResultFromDB({ queryId }); } public async getAdjustmentResultById( id: number, ): Promise { const task = this.trackedTasksById.get(id); if (task) { return this.getAdjustmentResult(task.queryId); } return this.getAdjustmentResultFromDB({ taskId: id }); } public async cancelAdjustmentTask(queryId: string): Promise { await this.wrenAIAdaptor.cancelAskFeedback(queryId); // telemetry const eventName = TelemetryEvent.HOME_ADJUST_THREAD_RESPONSE_CANCEL; this.telemetry.sendEvent(eventName, { queryId, }); } public stopPolling(): void { if (this.pollingIntervalId) { clearInterval(this.pollingIntervalId); } } private startPolling(): void { this.pollingIntervalId = setInterval(() => { this.pollTasks(); }, this.pollingInterval); } private async pollTasks(): Promise { const now = Date.now(); const tasksToRemove: string[] = []; // Create an array of job functions const jobs = Array.from(this.trackedTasks.entries()).map( ([queryId, task]) => async () => { try { // Skip if the job is already running if (this.runningJobs.has(queryId)) { return; } // Skip finalized tasks that have been in memory too long if ( task.isFinalized && now - task.lastPolled > this.memoryRetentionTime ) { tasksToRemove.push(queryId); return; } // Skip finalized tasks if (task.isFinalized) { return; } // Mark the job as running this.runningJobs.add(queryId); // Poll for updates logger.info(`Polling for updates for task ${queryId}`); const result = await this.wrenAIAdaptor.getAskFeedbackResult(queryId); task.lastPolled = now; // if result is not changed, we don't need to update the database if (!this.isResultChanged(task.result, result)) { this.runningJobs.delete(queryId); return; } // Check if task is now finalized if (this.isTaskFinalized(result.status)) { task.isFinalized = true; // update thread response if threadResponseId is provided if (task.threadResponseId) { await this.updateThreadResponseWhenTaskFinalized( task.threadResponseId, result, ); } // telemetry const eventName = task.rerun ? TelemetryEvent.HOME_ADJUST_THREAD_RESPONSE_RERUN : TelemetryEvent.HOME_ADJUST_THREAD_RESPONSE; const eventProperties = { taskId: task.taskId, queryId: task.queryId, status: result.status, error: result.error, adjustmentPayload: task.adjustmentPayload, }; if (result.status === AskFeedbackStatus.FINISHED) { this.telemetry.sendEvent(eventName, eventProperties); } else { this.telemetry.sendEvent( eventName, eventProperties, WrenService.AI, false, ); } logger.info( `Task ${queryId} is finalized with status: ${result.status}`, ); } // update task in memory if any change task.result = result; // update the database logger.info(`Updating task ${queryId} in database`); await this.updateTaskInDatabase({ queryId }, result); // Mark the job as finished this.runningJobs.delete(queryId); } catch (err) { this.runningJobs.delete(queryId); logger.error(err.stack); throw err; } }, ); // Run all jobs in parallel Promise.allSettled(jobs.map((job) => job())).then((results) => { // Log any rejected promises results.forEach((result, index) => { if (result.status === 'rejected') { logger.error(`Job ${index} failed: ${result.reason}`); } }); // Clean up tasks that have been in memory too long if (tasksToRemove.length > 0) { logger.info( `Cleaning up tasks that have been in memory too long. Tasks: ${tasksToRemove.join( ', ', )}`, ); } for (const queryId of tasksToRemove) { this.trackedTasks.delete(queryId); } }); } private async updateThreadResponseWhenTaskFinalized( threadResponseId: number, result: AskFeedbackResult, ): Promise { const response = result?.response?.[0]; if (!response) { return; } await this.threadResponseRepository.updateOne(threadResponseId, { sql: response?.sql, }); } private async getAdjustmentResultFromDB({ queryId, taskId, }: { queryId?: string; taskId?: number; }): Promise { let taskRecord: AskingTask | null = null; if (queryId) { taskRecord = await this.askingTaskRepository.findByQueryId(queryId); } else if (taskId) { taskRecord = await this.askingTaskRepository.findOneBy({ id: taskId }); } if (!taskRecord) { return null; } return { ...(taskRecord?.detail as AskFeedbackResult), queryId: queryId || taskRecord?.queryId, taskId: taskRecord?.id, }; } private async updateTaskInDatabase( filter: { queryId?: string; taskId?: number }, result: AskFeedbackResult, ): Promise { const { queryId, taskId } = filter; let taskRecord: AskingTask | null = null; if (queryId) { taskRecord = await this.askingTaskRepository.findByQueryId(queryId); } else if (taskId) { taskRecord = await this.askingTaskRepository.findOneBy({ id: taskId }); } if (!taskRecord) { throw new Error('Asking task not found'); } // update the task await this.askingTaskRepository.updateOne(taskRecord.id, { detail: { adjustment: true, ...result, }, }); } private isTaskFinalized(status: AskFeedbackStatus): boolean { return [ AskFeedbackStatus.FINISHED, AskFeedbackStatus.FAILED, AskFeedbackStatus.STOPPED, ].includes(status); } private isResultChanged( previousResult: AskFeedbackResult, newResult: AskFeedbackResult, ): boolean { // check status change if (previousResult?.status !== newResult.status) { return true; } return false; } } ================================================ FILE: wren-ui/src/apollo/server/backgrounds/chart.ts ================================================ import { ChartStatus } from '@server/models/adaptor'; import { IWrenAIAdaptor } from '@server/adaptors/wrenAIAdaptor'; import { IThreadResponseRepository, ThreadResponse, } from '@server/repositories'; import { getLogger } from '@server/utils/logger'; import { PostHogTelemetry, TelemetryEvent, WrenService, } from '@server/telemetry/telemetry'; const logger = getLogger('ChartBackgroundTracker'); logger.level = 'debug'; const isFinalized = (status: ChartStatus) => { return ( status === ChartStatus.FINISHED || status === ChartStatus.FAILED || status === ChartStatus.STOPPED ); }; export class ChartBackgroundTracker { private tasks: Record = {}; private intervalTime: number; private wrenAIAdaptor: IWrenAIAdaptor; private threadResponseRepository: IThreadResponseRepository; private runningJobs = new Set(); private telemetry: PostHogTelemetry; constructor({ telemetry, wrenAIAdaptor, threadResponseRepository, }: { telemetry: PostHogTelemetry; wrenAIAdaptor: IWrenAIAdaptor; threadResponseRepository: IThreadResponseRepository; }) { this.telemetry = telemetry; this.wrenAIAdaptor = wrenAIAdaptor; this.threadResponseRepository = threadResponseRepository; this.intervalTime = 1000; this.start(); } private start() { logger.info('Chart background tracker started'); setInterval(() => { const jobs = Object.values(this.tasks).map( (threadResponse) => async () => { // check if same job is running if (this.runningJobs.has(threadResponse.id)) { return; } // mark the job as running this.runningJobs.add(threadResponse.id); // get the chart detail const chartDetail = threadResponse.chartDetail; // get the latest result from AI service const result = await this.wrenAIAdaptor.getChartResult( chartDetail.queryId, ); // check if status change if (chartDetail.status === result.status) { // mark the job as finished logger.debug( `Job ${threadResponse.id} chart status not changed, finished`, ); this.runningJobs.delete(threadResponse.id); return; } // update database const updatedChartDetail = { queryId: chartDetail.queryId, status: result?.status, error: result?.error, description: result?.response?.reasoning, chartType: result?.response?.chartType?.toUpperCase() || null, chartSchema: result?.response?.chartSchema, }; logger.debug( `Job ${threadResponse.id} chart status changed, updating`, ); await this.threadResponseRepository.updateOne(threadResponse.id, { chartDetail: updatedChartDetail, }); // remove the task from tracker if it is finalized if (isFinalized(result.status)) { const eventProperties = { question: threadResponse.question, error: result.error, }; if (result.status === ChartStatus.FINISHED) { this.telemetry.sendEvent( TelemetryEvent.HOME_ANSWER_CHART, eventProperties, ); } else { this.telemetry.sendEvent( TelemetryEvent.HOME_ANSWER_CHART, eventProperties, WrenService.AI, false, ); } logger.debug( `Job ${threadResponse.id} chart is finalized, removing`, ); delete this.tasks[threadResponse.id]; } // mark the job as finished this.runningJobs.delete(threadResponse.id); }, ); // run the jobs Promise.allSettled(jobs.map((job) => job())).then((results) => { // show reason of rejection results.forEach((result, index) => { if (result.status === 'rejected') { logger.error(`Job ${index} failed: ${result.reason}`); } }); }); }, this.intervalTime); } public addTask(threadResponse: ThreadResponse) { this.tasks[threadResponse.id] = threadResponse; } public getTasks() { return this.tasks; } } export class ChartAdjustmentBackgroundTracker { private tasks: Record = {}; private intervalTime: number; private wrenAIAdaptor: IWrenAIAdaptor; private threadResponseRepository: IThreadResponseRepository; private runningJobs = new Set(); private telemetry: PostHogTelemetry; constructor({ telemetry, wrenAIAdaptor, threadResponseRepository, }: { telemetry: PostHogTelemetry; wrenAIAdaptor: IWrenAIAdaptor; threadResponseRepository: IThreadResponseRepository; }) { this.telemetry = telemetry; this.wrenAIAdaptor = wrenAIAdaptor; this.threadResponseRepository = threadResponseRepository; this.intervalTime = 1000; this.start(); } private start() { logger.info('Chart adjustment background tracker started'); setInterval(() => { const jobs = Object.values(this.tasks).map( (threadResponse) => async () => { // check if same job is running if (this.runningJobs.has(threadResponse.id)) { return; } // mark the job as running this.runningJobs.add(threadResponse.id); // get the chart detail const chartDetail = threadResponse.chartDetail; // get the latest result from AI service const result = await this.wrenAIAdaptor.getChartAdjustmentResult( chartDetail.queryId, ); // check if status change if (chartDetail.status === result.status) { // mark the job as finished logger.debug( `Job ${threadResponse.id} chart status not changed, finished`, ); this.runningJobs.delete(threadResponse.id); return; } // update database const updatedChartDetail = { queryId: chartDetail.queryId, status: result?.status, error: result?.error, description: result?.response?.reasoning, chartType: result?.response?.chartType?.toUpperCase() || null, chartSchema: result?.response?.chartSchema, adjustment: true, }; logger.debug( `Job ${threadResponse.id} chart status changed, updating`, ); await this.threadResponseRepository.updateOne(threadResponse.id, { chartDetail: updatedChartDetail, }); // remove the task from tracker if it is finalized if (isFinalized(result.status)) { const eventProperties = { question: threadResponse.question, error: result.error, }; if (result.status === ChartStatus.FINISHED) { this.telemetry.sendEvent( TelemetryEvent.HOME_ANSWER_ADJUST_CHART, eventProperties, ); } else { this.telemetry.sendEvent( TelemetryEvent.HOME_ANSWER_ADJUST_CHART, eventProperties, WrenService.AI, false, ); } logger.debug( `Job ${threadResponse.id} chart is finalized, removing`, ); delete this.tasks[threadResponse.id]; } // mark the job as finished this.runningJobs.delete(threadResponse.id); }, ); // run the jobs Promise.allSettled(jobs.map((job) => job())).then((results) => { // show reason of rejection results.forEach((result, index) => { if (result.status === 'rejected') { logger.error(`Job ${index} failed: ${result.reason}`); } }); }); }, this.intervalTime); } public addTask(threadResponse: ThreadResponse) { this.tasks[threadResponse.id] = threadResponse; } public getTasks() { return this.tasks; } } ================================================ FILE: wren-ui/src/apollo/server/backgrounds/dashboardCacheBackgroundTracker.ts ================================================ import { getLogger } from '@server/utils'; import { IDashboardRepository, IDashboardItemRepository, IDashboardItemRefreshJobRepository, DashboardCacheRefreshStatus, } from '@server/repositories'; import { IProjectService, IDeployService, IQueryService, } from '@server/services'; import { CronExpressionParser } from 'cron-parser'; import { v4 as uuidv4 } from 'uuid'; const logger = getLogger('DashboardCacheBackgroundTracker'); logger.level = 'debug'; export class DashboardCacheBackgroundTracker { private intervalTime: number; private dashboardRepository: IDashboardRepository; private dashboardItemRepository: IDashboardItemRepository; private dashboardItemRefreshJobRepository: IDashboardItemRefreshJobRepository; private projectService: IProjectService; private deployService: IDeployService; private queryService: IQueryService; private runningJobs = new Set(); constructor({ dashboardRepository, dashboardItemRepository, dashboardItemRefreshJobRepository, projectService, deployService, queryService, }: { dashboardRepository: IDashboardRepository; dashboardItemRepository: IDashboardItemRepository; dashboardItemRefreshJobRepository: IDashboardItemRefreshJobRepository; projectService: IProjectService; deployService: IDeployService; queryService: IQueryService; }) { this.dashboardRepository = dashboardRepository; this.dashboardItemRepository = dashboardItemRepository; this.dashboardItemRefreshJobRepository = dashboardItemRefreshJobRepository; this.projectService = projectService; this.deployService = deployService; this.queryService = queryService; this.intervalTime = 60000; // 1 minute this.start(); } private start(): void { logger.info('Dashboard cache background tracker started'); setInterval(() => { this.checkAndRefreshCaches(); }, this.intervalTime); } private async checkAndRefreshCaches(): Promise { try { // Get all dashboards with cache enabled const dashboards = await this.dashboardRepository.findAllBy({ cacheEnabled: true, }); for (const dashboard of dashboards) { if (!dashboard.scheduleCron || !dashboard.nextScheduledAt) { continue; } const now = new Date(); const nextScheduledAt = new Date(dashboard.nextScheduledAt); // Check if it's time to refresh if (now >= nextScheduledAt) { logger.info(`Start Refreshing cache for dashboard ${dashboard.id}`); await this.refreshDashboardCache(dashboard); logger.info( `Finished Refreshing cache for dashboard ${dashboard.id}`, ); } } } catch (error) { logger.error(`Error checking dashboard caches: ${error.message}`); } } private async refreshDashboardCache(dashboard: any): Promise { if (this.runningJobs.has(dashboard.id)) { logger.debug(`Dashboard ${dashboard.id} refresh already in progress`); return; } this.runningJobs.add(dashboard.id); try { // Get all items for this dashboard const items = await this.dashboardItemRepository.findAllBy({ dashboardId: dashboard.id, }); // Get project and deployment info const project = await this.projectService.getCurrentProject(); const deployment = await this.deployService.getLastDeployment(project.id); const mdl = deployment.manifest; const hash = uuidv4(); // Refresh cache for each item await Promise.all( items.map(async (item) => { try { // Create a record for this refresh job const refreshJob = await this.dashboardItemRefreshJobRepository.createOne({ hash, dashboardId: dashboard.id, dashboardItemId: item.id, startedAt: new Date(), finishedAt: null, status: DashboardCacheRefreshStatus.IN_PROGRESS, errorMessage: null, }); try { await this.queryService.preview(item.detail.sql, { project, manifest: mdl, cacheEnabled: true, refresh: true, }); // Update the record with success await this.dashboardItemRefreshJobRepository.updateOne( refreshJob.id, { finishedAt: new Date(), status: DashboardCacheRefreshStatus.SUCCESS, }, ); } catch (error) { // Update the record with failure await this.dashboardItemRefreshJobRepository.updateOne( refreshJob.id, { finishedAt: new Date(), status: DashboardCacheRefreshStatus.FAILED, errorMessage: error.message, }, ); logger.debug( `Error refreshing cache for item ${item.id}: ${error.message}`, ); } } catch (error) { logger.debug( `Error creating refresh job record for item ${item.id}: ${error.message}`, ); } }), ); // Calculate next scheduled time const nextScheduledAt = this.calculateNextRunTime(dashboard.scheduleCron); // Update dashboard with new next scheduled time await this.dashboardRepository.updateOne(dashboard.id, { nextScheduledAt, }); logger.info( `Next scheduled time for dashboard ${dashboard.id}: ${nextScheduledAt}`, ); logger.info(`Successfully refreshed cache for dashboard ${dashboard.id}`); } catch (error) { logger.error( `Error refreshing dashboard ${dashboard.id}: ${error.message}`, ); } finally { this.runningJobs.delete(dashboard.id); } } private calculateNextRunTime(cronExpression: string): Date | null { try { const interval = CronExpressionParser.parse(cronExpression, { currentDate: new Date(), }); return interval.next().toDate(); } catch (error) { logger.error(`Failed to parse cron expression: ${error.message}`); return null; } } } ================================================ FILE: wren-ui/src/apollo/server/backgrounds/index.ts ================================================ export * from './adjustmentBackgroundTracker'; export * from './textBasedAnswerBackgroundTracker'; export * from './chart'; export * from './recommend-question'; export * from './dashboardCacheBackgroundTracker'; ================================================ FILE: wren-ui/src/apollo/server/backgrounds/recommend-question.ts ================================================ import { IProjectRepository } from '../repositories/projectRepository'; import { RecommendationQuestionStatus } from '@server/models/adaptor'; import { IWrenAIAdaptor } from '../adaptors/wrenAIAdaptor'; import { IThreadRepository, Project, Thread } from '../repositories'; import { ITelemetry, TelemetryEvent, WrenService, } from '../telemetry/telemetry'; import { getLogger } from '../utils/logger'; import { Logger } from 'log4js'; // PRQ background tracker : project recommend question background tracker const loggerPrefix = 'PRQBT:'; const isFinalized = (status: RecommendationQuestionStatus) => { return [ RecommendationQuestionStatus.FINISHED, RecommendationQuestionStatus.FAILED, ].includes(status); }; export class ProjectRecommendQuestionBackgroundTracker { // tasks is a kv pair of task id and thread response private tasks: Record = {}; private intervalTime: number; private wrenAIAdaptor: IWrenAIAdaptor; private projectRepository: IProjectRepository; private runningJobs = new Set(); private telemetry: ITelemetry; private logger: Logger; constructor({ telemetry, wrenAIAdaptor, projectRepository, }: { telemetry: ITelemetry; wrenAIAdaptor: IWrenAIAdaptor; projectRepository: IProjectRepository; }) { this.logger = getLogger('PRQ Background Tracker'); this.logger.level = 'debug'; this.telemetry = telemetry; this.wrenAIAdaptor = wrenAIAdaptor; this.projectRepository = projectRepository; this.intervalTime = 1000; this.start(); } public start() { this.logger.info('Recommend question background tracker started'); setInterval(() => { const jobs = Object.values(this.tasks).map((project) => async () => { // check if same job is running if (this.runningJobs.has(this.taskKey(project))) { return; } // mark the job as running this.runningJobs.add(this.taskKey(project)); // get the latest result from AI service const result = await this.wrenAIAdaptor.getRecommendationQuestionsResult( project.queryId, ); // check if status change if ( project.questionsStatus === result.status && result.response?.questions.length === (project.questions || []).length ) { // mark the job as finished this.logger.debug( `${loggerPrefix}job ${this.taskKey(project)} status not changed, returning question count: ${result.response?.questions.length || 0}`, ); this.runningJobs.delete(this.taskKey(project)); return; } // update database if ( result.status !== project.questionsStatus || result.response?.questions.length !== (project.questions || []).length ) { this.logger.debug( `${loggerPrefix}job ${this.taskKey(project)} have changes, returning question count: ${result.response?.questions.length || 0}, updating`, ); await this.projectRepository.updateOne(project.id, { questionsStatus: result.status.toUpperCase(), questions: result.response?.questions, questionsError: result.error, }); project.questionsStatus = result.status; project.questions = result.response?.questions; } // remove the task from tracker if it is finalized if (isFinalized(result.status)) { const eventProperties = { projectId: project.id, projectType: project.type, status: result.status, questions: project.questions, error: result.error, }; if (result.status === RecommendationQuestionStatus.FINISHED) { this.telemetry.sendEvent( TelemetryEvent.HOME_GENERATE_PROJECT_RECOMMENDATION_QUESTIONS, eventProperties, ); } else { this.telemetry.sendEvent( TelemetryEvent.HOME_GENERATE_PROJECT_RECOMMENDATION_QUESTIONS, eventProperties, WrenService.AI, false, ); } this.logger.debug( `${loggerPrefix}job ${this.taskKey(project)} is finalized, removing`, ); delete this.tasks[this.taskKey(project)]; } // mark the job as finished this.runningJobs.delete(this.taskKey(project)); }); // run the jobs Promise.allSettled(jobs.map((job) => job())).then((results) => { // show reason of rejection results.forEach((result, index) => { if (result.status === 'rejected') { this.logger.error(`Job ${index} failed: ${result.reason}`); } }); }); }, this.intervalTime); } public addTask(project: Project) { this.tasks[this.taskKey(project)] = project; } public getTasks() { return this.tasks; } public async initialize() { const projects = await this.projectRepository.findAll(); for (const project of projects) { if ( this.taskKey(project) && !isFinalized(project.questionsStatus as RecommendationQuestionStatus) ) { this.addTask(project); } } } public taskKey(project: Project) { return project.id; } public isExist(project: Project) { return this.tasks[this.taskKey(project)]; } } export class ThreadRecommendQuestionBackgroundTracker { // tasks is a kv pair of task id and thread response private tasks: Record = {}; private intervalTime: number; private wrenAIAdaptor: IWrenAIAdaptor; private threadRepository: IThreadRepository; private runningJobs = new Set(); private telemetry: ITelemetry; private logger: Logger; constructor({ telemetry, wrenAIAdaptor, threadRepository, }: { telemetry: ITelemetry; wrenAIAdaptor: IWrenAIAdaptor; threadRepository: IThreadRepository; }) { this.logger = getLogger('TRQ Background Tracker'); this.logger.level = 'debug'; this.telemetry = telemetry; this.wrenAIAdaptor = wrenAIAdaptor; this.threadRepository = threadRepository; this.intervalTime = 1000; this.start(); } public start() { this.logger.info('Recommend question background tracker started'); setInterval(() => { const jobs = Object.values(this.tasks).map((thread) => async () => { // check if same job is running if (this.runningJobs.has(this.taskKey(thread))) { return; } // mark the job as running this.runningJobs.add(this.taskKey(thread)); // get the latest result from AI service const result = await this.wrenAIAdaptor.getRecommendationQuestionsResult( thread.queryId, ); // check if status change if ( thread.questionsStatus === result.status && result.response?.questions.length === (thread.questions || []).length ) { // mark the job as finished this.logger.debug( `${loggerPrefix}job ${this.taskKey(thread)} status not changed, returning question count: ${result.response?.questions.length || 0}`, ); this.runningJobs.delete(this.taskKey(thread)); return; } // update database if ( result.status !== thread.questionsStatus || result.response?.questions.length !== (thread.questions || []).length ) { this.logger.debug( `${loggerPrefix}job ${this.taskKey(thread)} have changes, returning question count: ${result.response?.questions.length || 0}, updating`, ); await this.threadRepository.updateOne(thread.id, { questionsStatus: result.status.toUpperCase(), questions: result.response?.questions, questionsError: result.error, }); thread.questionsStatus = result.status; thread.questions = result.response?.questions; } // remove the task from tracker if it is finalized if (isFinalized(result.status)) { const eventProperties = { thread_id: thread.id, status: result.status, questions: thread.questions, error: result.error, }; if (result.status === RecommendationQuestionStatus.FINISHED) { this.telemetry.sendEvent( TelemetryEvent.HOME_GENERATE_THREAD_RECOMMENDATION_QUESTIONS, eventProperties, ); } else { this.telemetry.sendEvent( TelemetryEvent.HOME_GENERATE_THREAD_RECOMMENDATION_QUESTIONS, eventProperties, WrenService.AI, false, ); } this.logger.debug( `${loggerPrefix}job ${this.taskKey(thread)} is finalized, removing`, ); delete this.tasks[this.taskKey(thread)]; } // mark the job as finished this.runningJobs.delete(this.taskKey(thread)); }); // run the jobs Promise.allSettled(jobs.map((job) => job())).then((results) => { // show reason of rejection results.forEach((result, index) => { if (result.status === 'rejected') { this.logger.error(`Job ${index} failed: ${result.reason}`); } }); }); }, this.intervalTime); } public addTask(thread: Thread) { this.tasks[this.taskKey(thread)] = thread; } public getTasks() { return this.tasks; } public async initialize() { const threads = await this.threadRepository.findAll(); for (const thread of threads) { if ( !this.tasks[this.taskKey(thread)] && thread.queryId && !isFinalized(thread.questionsStatus as RecommendationQuestionStatus) ) { this.addTask(thread); } } } public taskKey(thread: Thread) { return thread.id; } public isExist(thread: Thread) { return this.tasks[this.taskKey(thread)]; } } ================================================ FILE: wren-ui/src/apollo/server/backgrounds/textBasedAnswerBackgroundTracker.ts ================================================ import { IWrenAIAdaptor } from '../adaptors'; import { WrenAILanguage, TextBasedAnswerResult, TextBasedAnswerStatus, } from '../models/adaptor'; import { ThreadResponse, IThreadResponseRepository } from '../repositories'; import { IProjectService, IDeployService, IQueryService, ThreadResponseAnswerStatus, PreviewDataResponse, } from '../services'; import { getLogger } from '@server/utils'; const logger = getLogger('TextBasedAnswerBackgroundTracker'); logger.level = 'debug'; export class TextBasedAnswerBackgroundTracker { // tasks is a kv pair of task id and thread response private tasks: Record = {}; private intervalTime: number; private wrenAIAdaptor: IWrenAIAdaptor; private threadResponseRepository: IThreadResponseRepository; private projectService: IProjectService; private deployService: IDeployService; private queryService: IQueryService; private runningJobs = new Set(); constructor({ wrenAIAdaptor, threadResponseRepository, projectService, deployService, queryService, }: { wrenAIAdaptor: IWrenAIAdaptor; threadResponseRepository: IThreadResponseRepository; projectService: IProjectService; deployService: IDeployService; queryService: IQueryService; }) { this.wrenAIAdaptor = wrenAIAdaptor; this.threadResponseRepository = threadResponseRepository; this.projectService = projectService; this.deployService = deployService; this.queryService = queryService; this.intervalTime = 1000; this.start(); } private start() { setInterval(async () => { const jobs = Object.values(this.tasks).map( (threadResponse) => async () => { if ( this.runningJobs.has(threadResponse.id) || !threadResponse.answerDetail ) { return; } this.runningJobs.add(threadResponse.id); // update the status to fetching data await this.threadResponseRepository.updateOne(threadResponse.id, { answerDetail: { ...threadResponse.answerDetail, status: ThreadResponseAnswerStatus.FETCHING_DATA, }, }); // get sql data const project = await this.projectService.getCurrentProject(); const deployment = await this.deployService.getLastDeployment( project.id, ); const mdl = deployment.manifest; let data: PreviewDataResponse; try { data = (await this.queryService.preview(threadResponse.sql, { project, manifest: mdl, modelingOnly: false, limit: 500, })) as PreviewDataResponse; } catch (error) { logger.error(`Error when query sql data: ${error}`); await this.threadResponseRepository.updateOne(threadResponse.id, { answerDetail: { ...threadResponse.answerDetail, status: ThreadResponseAnswerStatus.FAILED, error: error?.extensions || error, }, }); throw error; } // request AI service const response = await this.wrenAIAdaptor.createTextBasedAnswer({ query: threadResponse.question, sql: threadResponse.sql, sqlData: data, threadId: threadResponse.threadId.toString(), configurations: { language: WrenAILanguage[project.language] || WrenAILanguage.EN, }, }); // update the status to preprocessing await this.threadResponseRepository.updateOne(threadResponse.id, { answerDetail: { ...threadResponse.answerDetail, status: ThreadResponseAnswerStatus.PREPROCESSING, }, }); // polling query id to check the status let result: TextBasedAnswerResult; do { result = await this.wrenAIAdaptor.getTextBasedAnswerResult( response.queryId, ); if (result.status === TextBasedAnswerStatus.PREPROCESSING) { await new Promise((resolve) => setTimeout(resolve, 500)); } } while (result.status === TextBasedAnswerStatus.PREPROCESSING); // update the status to final const updatedAnswerDetail = { queryId: response.queryId, status: result.status === TextBasedAnswerStatus.SUCCEEDED ? ThreadResponseAnswerStatus.STREAMING : ThreadResponseAnswerStatus.FAILED, numRowsUsedInLLM: result.numRowsUsedInLLM, error: result.error, }; await this.threadResponseRepository.updateOne(threadResponse.id, { answerDetail: updatedAnswerDetail, }); delete this.tasks[threadResponse.id]; // Mark the job as finished this.runningJobs.delete(threadResponse.id); }, ); // Run the jobs Promise.allSettled(jobs.map((job) => job())).then((results) => { // Show reason of rejection results.forEach((result, index) => { if (result.status === 'rejected') { logger.error(`Job ${index} failed: ${result.reason}`); } }); }); }, this.intervalTime); } public addTask(threadResponse: ThreadResponse) { this.tasks[threadResponse.id] = threadResponse; } public getTasks() { return this.tasks; } } ================================================ FILE: wren-ui/src/apollo/server/config.ts ================================================ import { pickBy } from 'lodash'; export interface IConfig { // wren ui otherServiceUsingDocker: boolean; // database dbType: string; // pg pgUrl?: string; debug?: boolean; // sqlite sqliteFile?: string; persistCredentialDir?: string; // wren engine wrenEngineEndpoint: string; // wren AI wrenAIEndpoint: string; generationModel?: string; // ibis server experimentalEngineRustVersion?: boolean; ibisServerEndpoint: string; // encryption encryptionPassword: string; encryptionSalt: string; // telemetry telemetryEnabled?: boolean; posthogApiKey?: string; posthogHost?: string; userUUID?: string; // versions wrenUIVersion?: string; wrenEngineVersion?: string; wrenAIVersion?: string; wrenProductVersion?: string; // generate recommendation questions max categories projectRecommendationQuestionMaxCategories?: number; projectRecommendationQuestionsMaxQuestions?: number; threadRecommendationQuestionMaxCategories?: number; threadRecommendationQuestionsMaxQuestions?: number; } const defaultConfig = { // wren ui otherServiceUsingDocker: false, // database dbType: 'sqlite', // pg pgUrl: 'postgres://postgres:postgres@localhost:5432/admin_ui', debug: false, // sqlite sqliteFile: './db.sqlite3', persistCredentialDir: `${process.cwd()}/.tmp`, // wren engine wrenEngineEndpoint: 'http://localhost:8080', // wren AI wrenAIEndpoint: 'http://localhost:5555', // ibis server experimentalEngineRustVersion: true, ibisServerEndpoint: 'http://127.0.0.1:8000', // encryption encryptionPassword: 'sementic', encryptionSalt: 'layer', }; const config = { // node otherServiceUsingDocker: process.env.OTHER_SERVICE_USING_DOCKER === 'true', // database dbType: process.env.DB_TYPE, // pg pgUrl: process.env.PG_URL, debug: process.env.DEBUG === 'true', // sqlite sqliteFile: process.env.SQLITE_FILE, persistCredentialDir: (() => { if ( process.env.PERSIST_CREDENTIAL_DIR && process.env.PERSIST_CREDENTIAL_DIR.length > 0 ) { return process.env.PERSIST_CREDENTIAL_DIR; } return undefined; })(), // wren engine wrenEngineEndpoint: process.env.WREN_ENGINE_ENDPOINT, // wren AI wrenAIEndpoint: process.env.WREN_AI_ENDPOINT, generationModel: process.env.GENERATION_MODEL, // ibis server experimentalEngineRustVersion: process.env.EXPERIMENTAL_ENGINE_RUST_VERSION === 'true', ibisServerEndpoint: process.env.IBIS_SERVER_ENDPOINT, // encryption encryptionPassword: process.env.ENCRYPTION_PASSWORD, encryptionSalt: process.env.ENCRYPTION_SALT, // telemetry telemetryEnabled: process.env.TELEMETRY_ENABLED && process.env.TELEMETRY_ENABLED.toLocaleLowerCase() === 'true', posthogApiKey: process.env.POSTHOG_API_KEY, posthogHost: process.env.POSTHOG_HOST, userUUID: process.env.USER_UUID, // versions wrenUIVersion: process.env.WREN_UI_VERSION, wrenEngineVersion: process.env.WREN_ENGINE_VERSION, wrenAIVersion: process.env.WREN_AI_SERVICE_VERSION, wrenProductVersion: process.env.WREN_PRODUCT_VERSION, // generate recommendation questions max questions projectRecommendationQuestionMaxCategories: process.env .PROJECT_RECOMMENDATION_QUESTION_MAX_CATEGORIES ? parseInt(process.env.PROJECT_RECOMMENDATION_QUESTION_MAX_CATEGORIES) : 3, projectRecommendationQuestionsMaxQuestions: process.env .PROJECT_RECOMMENDATION_QUESTIONS_MAX_QUESTIONS ? parseInt(process.env.PROJECT_RECOMMENDATION_QUESTIONS_MAX_QUESTIONS) : 3, threadRecommendationQuestionMaxCategories: process.env .THREAD_RECOMMENDATION_QUESTION_MAX_CATEGORIES ? parseInt(process.env.THREAD_RECOMMENDATION_QUESTION_MAX_CATEGORIES) : 3, threadRecommendationQuestionsMaxQuestions: process.env .THREAD_RECOMMENDATION_QUESTIONS_MAX_QUESTIONS ? parseInt(process.env.THREAD_RECOMMENDATION_QUESTIONS_MAX_QUESTIONS) : 1, }; export function getConfig(): IConfig { return { ...defaultConfig, ...pickBy(config) }; } ================================================ FILE: wren-ui/src/apollo/server/data/index.ts ================================================ export * from './sample'; export * from './type'; ================================================ FILE: wren-ui/src/apollo/server/data/sample.ts ================================================ import { RelationType } from '../types'; import { SampleDatasetName } from './type'; export interface SampleDatasetColumn { name: string; properties?: Record; } export interface SampleDatasetSchema { columnName: string; dataType: string; } export interface SampleDatasetTable { filePath: string; tableName: string; primaryKey?: string; // the column order in schema definition should be the same as the column in csv file schema?: SampleDatasetSchema[]; columns?: SampleDatasetColumn[]; properties?: Record; } export interface SampleDatasetRelationship { fromModelName: string; fromColumnName: string; toModelName: string; toColumnName: string; type: RelationType; description?: string; } export interface SuggestedQuestion { question: string; label: string; } export interface SampleDataset { name: string; // SampleDatasetName tables: SampleDatasetTable[]; questions?: SuggestedQuestion[]; relations?: SampleDatasetRelationship[]; } export const sampleDatasets: Record = { hr: { name: SampleDatasetName.HR, tables: [ { tableName: 'salaries', filePath: 'https://assets.getwren.ai/sample_data/employees/salaries.parquet', schema: [ { columnName: 'emp_no', dataType: 'INTEGER' }, { columnName: 'salary', dataType: 'INTEGER' }, { columnName: 'from_date', dataType: 'DATE' }, { columnName: 'to_date', dataType: 'DATE' }, ], columns: [ { name: 'emp_no', properties: { description: 'The employee number', displayName: 'emp_no', }, }, { name: 'salary', properties: { description: 'The salary of the employee.', displayName: 'salary', }, }, { name: 'from_date', properties: { description: 'The start date of the salary period.', displayName: 'from_date', }, }, { name: 'to_date', properties: { description: 'The end date of the salary period.', displayName: 'to_date', }, }, ], properties: { description: 'Tracks the salary of employees, including the period during which each salary was valid.', displayName: 'salaries', }, }, { tableName: 'titles', filePath: 'https://assets.getwren.ai/sample_data/employees/titles.parquet', schema: [ { columnName: 'emp_no', dataType: 'INTEGER' }, { columnName: 'title', dataType: 'VARCHAR' }, { columnName: 'from_date', dataType: 'DATE' }, { columnName: 'to_date', dataType: 'DATE' }, ], columns: [ { name: 'emp_no', properties: { description: 'The employee number', displayName: 'emp_no', }, }, { name: 'title', properties: { description: 'The title or position held by the employee. Limited to a maximum of 50 characters.', displayName: 'title', }, }, { name: 'from_date', properties: { description: 'The start date when the employee held this title', displayName: 'from_date', }, }, { name: 'to_date', properties: { description: 'The end date when the employee held this title. This can be NULL if the employee currently holds the title.', displayName: 'to_date', }, }, ], properties: { description: 'Tracks the titles (positions) held by employees, including the period during which they held each title.', displayName: 'titles', }, }, { tableName: 'dept_emp', filePath: 'https://assets.getwren.ai/sample_data/employees/dept_emp.parquet', schema: [ { columnName: 'emp_no', dataType: 'INTEGER' }, { columnName: 'dept_no', dataType: 'VARCHAR' }, { columnName: 'from_date', dataType: 'DATE' }, { columnName: 'to_date', dataType: 'DATE' }, ], columns: [ { name: 'emp_no', properties: { description: 'The employee number.', displayName: 'emp_no', }, }, { name: 'dept_no', properties: { description: 'The department number the employee is associated with, referencing the dept_no in the departments table.', displayName: 'dept_no', }, }, { name: 'from_date', properties: { description: "The start date of the employee's association with the department.", displayName: 'from_date', }, }, { name: 'to_date', properties: { description: "The end date of the employee's association with the department", displayName: 'to_date', }, }, ], properties: { displayName: 'dept_emp', }, }, { tableName: 'departments', filePath: 'https://assets.getwren.ai/sample_data/employees/departments.parquet', schema: [ { columnName: 'dept_name', dataType: 'VARCHAR' }, { columnName: 'dept_no', dataType: 'VARCHAR' }, ], columns: [ { name: 'dept_name', properties: { description: 'The name of the department. Limited to a maximum of 40 characters. This column is also unique across the table, ensuring no two departments share the same name', displayName: 'dept_name', }, }, { name: 'dept_no', properties: { description: 'A unique identifier for each department. It serves as the primary key of the table.', displayName: 'dept_no', }, }, ], properties: { displayName: 'departments', }, }, { tableName: 'employees', filePath: 'https://assets.getwren.ai/sample_data/employees/employees.parquet', schema: [ { columnName: 'birth_date', dataType: 'DATE' }, { columnName: 'first_name', dataType: 'VARCHAR' }, { columnName: 'last_name', dataType: 'VARCHAR' }, { columnName: 'gender', dataType: 'VARCHAR' }, { columnName: 'hire_date', dataType: 'DATE' }, { columnName: 'emp_no', dataType: 'INTEGER' }, ], columns: [ { name: 'birth_date', properties: { description: 'The birth date of the employee.', displayName: 'birth_date', }, }, { name: 'first_name', properties: { description: 'The first name of the employee. Limited to a maximum of 14 characters.', displayName: 'first_name', }, }, { name: 'last_name', properties: { description: 'The last name of the employee. Limited to a maximum of 16 characters.', displayName: 'last_name', }, }, { name: 'gender', properties: { description: "The gender of the employee, with possible values 'M' (Male) or 'F' (Female).", displayName: 'gender', }, }, { name: 'hire_date', properties: { description: 'The date when the employee was hired.', displayName: 'hire_date', }, }, { name: 'emp_no', properties: { description: 'A unique identifier for each employee. It serves as the primary key of the table', displayName: 'emp_no', }, }, ], properties: { description: 'Stores basic information about employees such as their employee number, name, gender, birth date, and hire date', displayName: 'employees', }, }, { tableName: 'dept_manager', filePath: 'https://assets.getwren.ai/sample_data/employees/dept_manager.parquet', schema: [ { columnName: 'from_date', dataType: 'DATE' }, { columnName: 'to_date', dataType: 'DATE' }, { columnName: 'emp_no', dataType: 'INTEGER' }, { columnName: 'dept_no', dataType: 'VARCHAR' }, ], columns: [ { name: 'from_date', properties: { description: 'The start date of the employee’s managerial role in the department.', displayName: 'from_date', }, }, { name: 'to_date', properties: { description: 'The end date of the employee’s managerial role in the department.', displayName: 'to_date', }, }, { name: 'emp_no', properties: { description: 'The employee number of the department manager', displayName: 'emp_no', }, }, { name: 'dept_no', properties: { description: 'The department number that the manager is assigned to, referencing the dept_no in the departments table.', displayName: 'dept_no', }, }, ], properties: { description: 'Tracks the assignment of managers to departments, including the period during which they managed a department', displayName: 'dept_manager', }, }, ], relations: [ { fromModelName: 'employees', fromColumnName: 'emp_no', toModelName: 'titles', toColumnName: 'emp_no', type: RelationType.ONE_TO_MANY, description: 'Each entry represents a title held by an employee during a specific time period.', }, { fromModelName: 'departments', fromColumnName: 'dept_no', toModelName: 'dept_emp', toColumnName: 'dept_no', type: RelationType.ONE_TO_MANY, }, { fromModelName: 'employees', fromColumnName: 'emp_no', toModelName: 'salaries', toColumnName: 'emp_no', type: RelationType.ONE_TO_MANY, }, { fromModelName: 'dept_manager', fromColumnName: 'emp_no', toModelName: 'employees', toColumnName: 'emp_no', type: RelationType.MANY_TO_ONE, }, { fromModelName: 'dept_emp', fromColumnName: 'emp_no', toModelName: 'employees', toColumnName: 'emp_no', type: RelationType.MANY_TO_ONE, description: 'meaning an employee can be associated with multiple departments, titles, and salaries over time.', }, { fromModelName: 'departments', fromColumnName: 'dept_no', toModelName: 'dept_manager', toColumnName: 'dept_no', type: RelationType.ONE_TO_MANY, }, ], questions: [ { question: 'What is the average salary for each position?', label: 'Aggregation', }, { question: 'Compare the average salary of male and female employees in each department.', label: 'Comparison', }, { question: 'What are the names of the managers and the departments they manage?', label: 'Associating', }, ], }, music: { name: SampleDatasetName.MUSIC, tables: [ { tableName: 'album', filePath: 'https://wrenai-public.s3.amazonaws.com/demo/Music/Album.csv', schema: [ { columnName: 'AlbumId', dataType: 'INT' }, { columnName: 'Title', dataType: 'varchar' }, { columnName: 'ArtistId', dataType: 'INT' }, ], }, { tableName: 'artist', filePath: 'https://wrenai-public.s3.amazonaws.com/demo/Music/Artist.csv', schema: [ { columnName: 'ArtistId', dataType: 'INT' }, { columnName: 'Name', dataType: 'varchar' }, ], }, { tableName: 'customer', filePath: 'https://wrenai-public.s3.amazonaws.com/demo/Music/Customer.csv', schema: [ { columnName: 'CustomerId', dataType: 'BIGINT' }, { columnName: 'FirstName', dataType: 'VARCHAR' }, { columnName: 'LastName', dataType: 'VARCHAR' }, { columnName: 'Company', dataType: 'VARCHAR' }, { columnName: 'Address', dataType: 'VARCHAR' }, { columnName: 'City', dataType: 'VARCHAR' }, { columnName: 'State', dataType: 'VARCHAR' }, { columnName: 'Country', dataType: 'VARCHAR' }, { columnName: 'PostalCode', dataType: 'VARCHAR' }, { columnName: 'Phone', dataType: 'VARCHAR' }, { columnName: 'Fax', dataType: 'VARCHAR' }, { columnName: 'Email', dataType: 'VARCHAR' }, { columnName: 'SupportRepId', dataType: 'BIGINT' }, ], }, { tableName: 'genre', filePath: 'https://wrenai-public.s3.amazonaws.com/demo/Music/Genre.csv', schema: [ { columnName: 'GenreId', dataType: 'BIGINT' }, { columnName: 'Name', dataType: 'VARCHAR' }, ], }, { tableName: 'invoice', filePath: 'https://wrenai-public.s3.amazonaws.com/demo/Music/Invoice.csv', schema: [ { columnName: 'InvoiceId', dataType: 'BIGINT' }, { columnName: 'CustomerId', dataType: 'BIGINT' }, { columnName: 'InvoiceDate', dataType: 'Date' }, { columnName: 'BillingAddress', dataType: 'VARCHAR' }, { columnName: 'BillingCity', dataType: 'VARCHAR' }, { columnName: 'BillingState', dataType: 'VARCHAR' }, { columnName: 'BillingCountry', dataType: 'VARCHAR' }, { columnName: 'BillingPostalCode', dataType: 'VARCHAR' }, { columnName: 'Total', dataType: 'DOUBLE' }, ], }, { tableName: 'invoiceLine', filePath: 'https://wrenai-public.s3.amazonaws.com/demo/Music/InvoiceLine.csv', schema: [ { columnName: 'InvoiceLineId', dataType: 'BIGINT' }, { columnName: 'InvoiceId', dataType: 'BIGINT' }, { columnName: 'TrackId', dataType: 'BIGINT' }, { columnName: 'UnitPrice', dataType: 'DOUBLE' }, { columnName: 'Quantity', dataType: 'BIGINT' }, ], }, { tableName: 'track', filePath: 'https://wrenai-public.s3.amazonaws.com/demo/Music/Track.csv', schema: [ { columnName: 'TrackId', dataType: 'BIGINT' }, { columnName: 'Name', dataType: 'VARCHAR' }, { columnName: 'AlbumId', dataType: 'BIGINT' }, { columnName: 'MediaTypeId', dataType: 'BIGINT' }, { columnName: 'GenreId', dataType: 'BIGINT' }, { columnName: 'Composer', dataType: 'VARCHAR' }, { columnName: 'Milliseconds', dataType: 'BIGINT' }, { columnName: 'Bytes', dataType: 'BIGINT' }, { columnName: 'UnitPrice', dataType: 'DOUBLE' }, ], }, ], questions: [ { question: 'What are the top 5 selling albums in the US?', label: 'Ranking', }, { question: 'What is the total revenue generated from each genre?', label: 'Aggregation', }, { question: 'Which customers have made purchases of tracks from albums in each genre?', label: 'General', }, ], relations: [ { fromModelName: 'album', fromColumnName: 'ArtistId', toModelName: 'artist', toColumnName: 'ArtistId', type: RelationType.MANY_TO_ONE, }, { fromModelName: 'customer', fromColumnName: 'CustomerId', toModelName: 'invoice', toColumnName: 'CustomerId', type: RelationType.ONE_TO_MANY, }, { fromModelName: 'genre', fromColumnName: 'GenreId', toModelName: 'track', toColumnName: 'GenreId', type: RelationType.ONE_TO_MANY, }, { fromModelName: 'invoice', fromColumnName: 'InvoiceId', toModelName: 'invoiceLine', toColumnName: 'InvoiceId', type: RelationType.ONE_TO_MANY, }, { fromModelName: 'track', fromColumnName: 'TrackId', toModelName: 'invoiceLine', toColumnName: 'TrackId', type: RelationType.ONE_TO_MANY, }, // album -> track { fromModelName: 'album', fromColumnName: 'AlbumId', toModelName: 'track', toColumnName: 'AlbumId', type: RelationType.ONE_TO_MANY, }, ], }, ecommerce: { name: SampleDatasetName.ECOMMERCE, tables: [ { tableName: 'olist_customers_dataset', primaryKey: 'customer_id', filePath: 'https://assets.getwren.ai/sample_data/brazilian-ecommerce/olist_customers_dataset.parquet', properties: { displayName: 'customers', }, columns: [ { name: 'customer_city', properties: { description: 'Name of the city where the customer is located', displayName: 'customer_city', }, }, { name: 'customer_id', properties: { description: null, displayName: 'customer_id', }, }, { name: 'customer_state', properties: { description: 'Name of the state where the customer is located', displayName: 'customer_state', }, }, { name: 'customer_unique_id', properties: { description: 'Unique id of the customer', displayName: 'customer_unique_id', }, }, { name: 'customer_zip_code_prefix', properties: { description: 'First 5 digits of customer zip code', displayName: 'customer_zip_code_prefix', }, }, ], schema: [ { columnName: 'customer_city', dataType: 'VARCHAR' }, { columnName: 'customer_id', dataType: 'VARCHAR' }, { columnName: 'customer_state', dataType: 'VARCHAR' }, { columnName: 'customer_unique_id', dataType: 'VARCHAR' }, { columnName: 'customer_zip_code_prefix', dataType: 'VARCHAR' }, ], }, { tableName: 'olist_order_items_dataset', primaryKey: 'order_item_id', filePath: 'https://assets.getwren.ai/sample_data/brazilian-ecommerce/olist_order_items_dataset.parquet', properties: { displayName: 'order items', description: 'This table contains the information related to a specific order containing its shipping cost, products, cost, number of order items, and the seller.', }, columns: [ { name: 'freight_value', properties: { description: 'Cost of shipping associated with the specific order item', displayName: 'freight_value', }, }, { name: 'order_id', properties: { description: 'Unique identifier for the order across the platform', displayName: 'order_id', }, }, { name: 'order_item_id', properties: { description: 'Unique identifier for each item within a specific order', displayName: 'order_item_id', }, }, { name: 'price', properties: { description: 'Price of the individual item within the order', displayName: 'price', }, }, { name: 'product_id', properties: { description: 'Unique identifier for the product sold in the order.', displayName: 'product_id', }, }, { name: 'seller_id', properties: { description: 'Unique identifier of the seller who fulfilled the order item.', displayName: 'seller_id', }, }, { name: 'shipping_limit_date', properties: { description: 'Deadline for the order item to be shipped by the seller.', displayName: 'shipping_limit_date', }, }, ], schema: [ { columnName: 'freight_value', dataType: 'DOUBLE' }, { columnName: 'order_id', dataType: 'VARCHAR' }, { columnName: 'order_item_id', dataType: 'BIGINT' }, { columnName: 'price', dataType: 'DOUBLE' }, { columnName: 'product_id', dataType: 'VARCHAR' }, { columnName: 'seller_id', dataType: 'VARCHAR' }, { columnName: 'shipping_limit_date', dataType: 'TIMESTAMP' }, ], }, { tableName: 'olist_orders_dataset', primaryKey: 'order_id', filePath: 'https://assets.getwren.ai/sample_data/brazilian-ecommerce/olist_orders_dataset.parquet', properties: { displayName: 'orders', description: 'This table contains detailed information about customer orders, including timestamps for various stages of the order process (approval, shipping, delivery), as well as the order status and customer identification. It helps track the lifecycle of an order from purchase to delivery.', }, columns: [ { name: 'customer_id', properties: { description: 'Unique identifier for the customer who placed the order.', displayName: 'customer_id', }, }, { name: 'order_approved_at', properties: { description: 'Date and time when the order was approved for processing.', displayName: 'order_approved_at', }, }, { name: 'order_delivered_carrier_date', properties: { description: 'Date when the order was handed over to the carrier or freight forwarder for delivery.', displayName: 'order_delivered_carrier_date', }, }, { name: 'order_delivered_customer_date', properties: { description: 'Date when the order was delivered to the customer.', displayName: 'order_delivered_customer_date', }, }, { name: 'order_estimated_delivery_date', properties: { description: 'Expected delivery date based on the initial estimate.', displayName: 'order_estimated_delivery_date', }, }, { name: 'order_id', properties: { description: 'Unique identifier for the specific order', displayName: 'order_id', }, }, { name: 'order_purchase_timestamp', properties: { description: 'Date and time when the order was placed by the customer.', displayName: 'order_purchase_timestamp', }, }, { name: 'order_status', properties: { description: 'Current status of the order (e.g., delivered, shipped, canceled).', displayName: 'order_status', }, }, ], schema: [ { columnName: 'customer_id', dataType: 'VARCHAR' }, { columnName: 'order_approved_at', dataType: 'TIMESTAMP' }, { columnName: 'order_delivered_carrier_date', dataType: 'TIMESTAMP' }, { columnName: 'order_delivered_customer_date', dataType: 'TIMESTAMP', }, { columnName: 'order_estimated_delivery_date', dataType: 'TIMESTAMP', }, { columnName: 'order_id', dataType: 'VARCHAR' }, { columnName: 'order_purchase_timestamp', dataType: 'TIMESTAMP' }, { columnName: 'order_status', dataType: 'VARCHAR' }, ], }, { tableName: 'olist_order_payments_dataset', primaryKey: 'order_id', filePath: 'https://assets.getwren.ai/sample_data/brazilian-ecommerce/olist_order_payments_dataset.parquet', properties: { displayName: 'order payments', description: 'This table contains information about payment details for each order, including payment methods, amounts, installment plans, and payment sequences, helping to track how orders were paid and processed within the e-commerce platform.', }, columns: [ { name: 'order_id', properties: { description: 'Unique identifier for the order associated with the payment.', displayName: 'order_id', }, }, { name: 'payment_installments', properties: { description: 'Number of installments the payment is divided into for the order.', displayName: 'payment_installments', }, }, { name: 'payment_sequential', properties: { description: 'Sequence number for tracking multiple payments within the same order.', displayName: 'payment_sequential', }, }, { name: 'payment_type', properties: { description: 'Method used for the payment, such as credit card, debit, or voucher.', displayName: 'payment_type', }, }, { name: 'payment_value', properties: { description: 'Total amount paid in the specific transaction.', displayName: 'payment_value', }, }, ], schema: [ { columnName: 'order_id', dataType: 'VARCHAR' }, { columnName: 'payment_installments', dataType: 'BIGINT' }, { columnName: 'payment_sequential', dataType: 'BIGINT' }, { columnName: 'payment_type', dataType: 'VARCHAR' }, { columnName: 'payment_value', dataType: 'DOUBLE' }, ], }, { tableName: 'olist_products_dataset', primaryKey: 'product_id', filePath: 'https://assets.getwren.ai/sample_data/brazilian-ecommerce/olist_products_dataset.parquet', properties: { displayName: 'products', description: 'This table provides detailed information about products, including their category, dimensions, weight, description length, and the number of photos. This helps in managing product details and enhancing the shopping experience on the e-commerce platform.', }, columns: [ { name: 'product_category_name', properties: { description: 'Name of the product category to which the item belongs.', displayName: 'product_category_name', }, }, { name: 'product_description_lenght', properties: { description: 'Length of the product description in characters.', displayName: 'product_description_lenght', }, }, { name: 'product_height_cm', properties: { description: 'Height of the product in centimeters.', displayName: 'product_height_cm', }, }, { name: 'product_id', properties: { description: 'Unique identifier for the product', displayName: 'product_id', }, }, { name: 'product_length_cm', properties: { description: 'Length of the product in centimeters', displayName: 'product_length_cm', }, }, { name: 'product_name_lenght', properties: { description: 'Length of the product name in characters', displayName: 'product_name_lenght', }, }, { name: 'product_photos_qty', properties: { description: 'Number of photos available for the product', displayName: 'product_photos_qty', }, }, { name: 'product_weight_g', properties: { description: 'Weight of the product in grams', displayName: 'product_weight_g', }, }, { name: 'product_width_cm', properties: { description: 'Width of the product in centimeters', displayName: 'product_width_cm', }, }, ], schema: [ { columnName: 'product_category_name', dataType: 'VARCHAR' }, { columnName: 'product_description_lenght', dataType: 'BIGINT' }, { columnName: 'product_height_cm', dataType: 'BIGINT' }, { columnName: 'product_id', dataType: 'VARCHAR' }, { columnName: 'product_length_cm', dataType: 'BIGINT' }, { columnName: 'product_name_lenght', dataType: 'BIGINT' }, { columnName: 'product_photos_qty', dataType: 'BIGINT' }, { columnName: 'product_weight_g', dataType: 'BIGINT' }, { columnName: 'product_width_cm', dataType: 'BIGINT' }, ], }, { tableName: 'olist_order_reviews_dataset', primaryKey: 'review_id', filePath: 'https://assets.getwren.ai/sample_data/brazilian-ecommerce/olist_order_reviews_dataset.parquet', properties: { displayName: 'order reviews', description: 'This table contains customer reviews for each order, including feedback comments, ratings, and timestamps for when the review was submitted and responded to. It helps track customer satisfaction and review management on the e-commerce platform.', }, columns: [ { name: 'order_id', properties: { description: 'Unique identifier linking the review to the corresponding order.', displayName: 'order_id', }, }, { name: 'review_answer_timestamp', properties: { description: 'Date and time when the review was responded to by the seller', displayName: 'review_answer_timestamp', }, }, { name: 'review_comment_message', properties: { description: 'Detailed feedback or comments provided by the customer regarding the order.', displayName: 'review_comment_message', }, }, { name: 'review_comment_title', properties: { description: "Summary or title of the customer's review", displayName: 'review_comment_title', }, }, { name: 'review_creation_date', properties: { description: 'Date and time when the customer initially submitted the review.', displayName: 'review_creation_date', }, }, { name: 'review_id', properties: { description: 'Unique identifier for the specific review entry.', displayName: 'review_id', }, }, { name: 'review_score', properties: { description: 'Numeric rating given by the customer, typically ranging from 1 (worst) to 5 (best).', displayName: 'review_score', }, }, ], schema: [ { columnName: 'order_id', dataType: 'VARCHAR' }, { columnName: 'review_answer_timestamp', dataType: 'TIMESTAMP' }, { columnName: 'review_comment_message', dataType: 'VARCHAR' }, { columnName: 'review_comment_title', dataType: 'VARCHAR' }, { columnName: 'review_creation_date', dataType: 'TIMESTAMP' }, { columnName: 'review_id', dataType: 'VARCHAR' }, { columnName: 'review_score', dataType: 'BIGINT' }, ], }, { tableName: 'olist_geolocation_dataset', primaryKey: '', filePath: 'https://assets.getwren.ai/sample_data/brazilian-ecommerce/olist_geolocation_dataset.parquet', properties: { displayName: 'geolocation', description: 'This table contains detailed information about Brazilian zip codes and their corresponding latitude and longitude coordinates. It can be used to plot maps, calculate distances between sellers and customers, and perform geographic analysis.', }, columns: [ { name: 'geolocation_city', properties: { displayName: 'geolocation_city', description: 'The city name of the geolocation', }, }, { name: 'geolocation_lat', properties: { displayName: 'geolocation_lat', description: 'The coordinations for the locations latitude', }, }, { name: 'geolocation_lng', properties: { displayName: 'geolocation_lng', description: 'The coordinations for the locations longitude', }, }, { name: 'geolocation_state', properties: { displayName: 'geolocation_state', description: 'The state of the geolocation', }, }, { name: 'geolocation_zip_code_prefix', properties: { displayName: 'geolocation_zip_code_prefix', description: 'First 5 digits of zip code', }, }, ], schema: [ { columnName: 'geolocation_city', dataType: 'VARCHAR' }, { columnName: 'geolocation_lat', dataType: 'DOUBLE' }, { columnName: 'geolocation_lng', dataType: 'DOUBLE' }, { columnName: 'geolocation_state', dataType: 'VARCHAR' }, { columnName: 'geolocation_zip_code_prefix', dataType: 'VARCHAR' }, ], }, { tableName: 'olist_sellers_dataset', primaryKey: '', filePath: 'https://assets.getwren.ai/sample_data/brazilian-ecommerce/olist_sellers_dataset.parquet', properties: { displayName: 'sellers', description: 'This table includes data about the sellers that fulfilled orders made. Use it to find the seller location and to identify which seller fulfilled each product.', }, columns: [ { name: 'seller_city', properties: { description: 'The Brazilian city where the seller is located', displayName: 'seller_city', }, }, { name: 'seller_id', properties: { description: 'Unique identifier for the seller on the platform', displayName: 'seller_id', }, }, { name: 'seller_state', properties: { description: 'The Brazilian state where the seller is located', displayName: 'seller_state', }, }, { name: 'seller_zip_code_prefix', properties: { description: 'First 5 digits of seller zip code', displayName: 'seller_zip_code_prefix', }, }, ], schema: [ { columnName: 'seller_city', dataType: 'VARCHAR' }, { columnName: 'seller_id', dataType: 'VARCHAR' }, { columnName: 'seller_state', dataType: 'VARCHAR' }, { columnName: 'seller_zip_code_prefix', dataType: 'VARCHAR' }, ], }, { tableName: 'product_category_name_translation', primaryKey: 'product_category_name', filePath: 'https://assets.getwren.ai/sample_data/brazilian-ecommerce/product_category_name_translation.parquet', properties: { displayName: 'product category name translation', description: 'This table contains translations of product categories from Portuguese to English.', }, columns: [ { name: 'product_category_name', properties: { description: 'Original name of the product category in Portuguese.', displayName: 'product_category_name', }, }, { name: 'product_category_name_english', properties: { description: 'Translated name of the product category in English.', displayName: 'product_category_name_english', }, }, ], schema: [ { columnName: 'product_category_name', dataType: 'VARCHAR' }, { columnName: 'product_category_name_english', dataType: 'VARCHAR' }, ], }, ], questions: [ { question: 'Which are the top 3 cities with the highest number of orders?', label: 'Ranking', }, { question: 'What is the average score of reviews submitted for orders placed by customers in each city?', label: 'Aggregation', }, { question: 'What is the total value of payments made by customers from each state?', label: 'Aggregation', }, ], relations: [ // orders // orders -> customers { fromModelName: 'olist_orders_dataset', fromColumnName: 'customer_id', toModelName: 'olist_customers_dataset', toColumnName: 'customer_id', type: RelationType.MANY_TO_ONE, }, // orders -> items { fromModelName: 'olist_orders_dataset', fromColumnName: 'order_id', toModelName: 'olist_order_items_dataset', toColumnName: 'order_id', type: RelationType.ONE_TO_MANY, }, // orders -> reviews { fromModelName: 'olist_orders_dataset', fromColumnName: 'order_id', toModelName: 'olist_order_reviews_dataset', toColumnName: 'order_id', type: RelationType.ONE_TO_MANY, }, // orders -> payments { fromModelName: 'olist_orders_dataset', fromColumnName: 'order_id', toModelName: 'olist_order_payments_dataset', toColumnName: 'order_id', type: RelationType.ONE_TO_MANY, }, // items -> products { fromModelName: 'olist_order_items_dataset', fromColumnName: 'product_id', toModelName: 'olist_products_dataset', toColumnName: 'product_id', type: RelationType.MANY_TO_ONE, }, // items -> sellers { fromModelName: 'olist_order_items_dataset', fromColumnName: 'seller_id', toModelName: 'olist_sellers_dataset', toColumnName: 'seller_id', type: RelationType.MANY_TO_ONE, }, // geolocation -> customers (zip code prefix) { fromModelName: 'olist_geolocation_dataset', fromColumnName: 'geolocation_zip_code_prefix', toModelName: 'olist_customers_dataset', toColumnName: 'customer_zip_code_prefix', type: RelationType.ONE_TO_MANY, }, // geolocation -> sellers (zip code prefix) { fromModelName: 'olist_geolocation_dataset', fromColumnName: 'geolocation_zip_code_prefix', toModelName: 'olist_sellers_dataset', toColumnName: 'seller_zip_code_prefix', type: RelationType.ONE_TO_MANY, }, // product category name translation -> products { fromModelName: 'product_category_name_translation', fromColumnName: 'product_category_name', toModelName: 'olist_products_dataset', toColumnName: 'product_category_name', type: RelationType.ONE_TO_MANY, }, ], }, nba: { name: SampleDatasetName.NBA, tables: [ { tableName: 'game', primaryKey: 'Id', filePath: 'https://wrenai-public.s3.amazonaws.com/demo/v0.3.0/NBA/game.csv', columns: [ { name: 'Id', }, { name: 'SeasonId', }, { name: 'TeamIdHome', }, { name: 'WlHome', }, { name: 'Min', }, { name: 'FgmHome', properties: { description: 'number of field goals made by the home team.', }, }, { name: 'FgaHome', properties: { description: 'number of field goals attempted by the home team.', }, }, { name: 'threepHome', properties: { description: 'number of three point field goals made by the home team.', }, }, { name: 'threepaHome', properties: { description: 'number of three point field goals attempted by the home team.', }, }, { name: 'FtmHome', properties: { description: 'number of free throws made by the home team.', }, }, { name: 'FtaHome', properties: { description: 'number of free throws attempted by the home team.', }, }, { name: 'OrebHome', properties: { description: 'number of offensive rebounds by the home team.', }, }, { name: 'DrebHome', properties: { description: 'number of defensive rebounds by the home team.', }, }, { name: 'RebHome', properties: { description: 'number of rebounds by the home team.' }, }, { name: 'AstHome', properties: { description: 'number of assists by the home team.' }, }, { name: 'StlHome', properties: { description: 'number of steels by the home team.' }, }, { name: 'BlkHome', properties: { description: 'number of blocks by the home team.' }, }, { name: 'TovHome', properties: { description: 'number of turnovers by the home team.', }, }, { name: 'PfHome', properties: { description: 'number of personal fouls by the home team.', }, }, { name: 'PtsHome', properties: { description: 'Total score of the home team.' }, }, { name: 'PlusMimusHome', }, { name: 'TeamIdAway', }, { name: 'WlAway', }, { name: 'FgmAway', properties: { description: 'number of field goals made by the away team.', }, }, { name: 'FgaAway', properties: { description: 'number of field goals attempted by the away team.', }, }, { name: 'threepAway', properties: { description: 'number of three point field goals made by the away team.', }, }, { name: 'threepaAway', properties: { description: 'number of three point field goals attempted by the away team.', }, }, { name: 'FtmAway', properties: { description: 'number of free throws made by the away team.', }, }, { name: 'FtaAway', properties: { description: 'number of free throws attempted by the away team.', }, }, { name: 'OrebAway', properties: { description: 'number of offensive rebounds by the away team.', }, }, { name: 'DrebAway', properties: { description: 'number of defensive rebounds by the away team.', }, }, { name: 'RebAway', properties: { description: 'number of rebounds by the away team.' }, }, { name: 'AstAway', properties: { description: 'number of assists by the away team.' }, }, { name: 'StlAway', properties: { description: 'number of steels by the away team.' }, }, { name: 'BlkAway', properties: { description: 'number of blocks by the away team.' }, }, { name: 'TovAway', properties: { description: 'number of turnovers by the away team.', }, }, { name: 'PfAway', properties: { description: 'number of personal fouls by the away team.', }, }, { name: 'PtsAway', properties: { description: 'Total score of the away team.' }, }, { name: 'PlusMimusAway', }, { name: 'seasonType', }, ], schema: [ { columnName: 'SeasonId', dataType: 'BIGINT' }, { columnName: 'TeamIdHome', dataType: 'BIGINT' }, { columnName: 'Id', dataType: 'BIGINT' }, { columnName: 'GameDate', dataType: 'DATE' }, { columnName: 'WlHome', dataType: 'VARCHAR' }, { columnName: 'Min', dataType: 'BIGINT' }, { columnName: 'FgmHome', dataType: 'BIGINT' }, { columnName: 'FgaHome', dataType: 'BIGINT' }, { columnName: 'FgPct_home', dataType: 'DOUBLE' }, { columnName: 'threepHome', dataType: 'BIGINT' }, { columnName: 'threepaHome', dataType: 'BIGINT' }, { columnName: 'fg3_pct_home', dataType: 'DOUBLE' }, { columnName: 'FtmHome', dataType: 'BIGINT' }, { columnName: 'FtaHome', dataType: 'BIGINT' }, { columnName: 'ft_pct_home', dataType: 'DOUBLE' }, { columnName: 'OrebHome', dataType: 'BIGINT' }, { columnName: 'DrebHome', dataType: 'BIGINT' }, { columnName: 'RebHome', dataType: 'BIGINT' }, { columnName: 'AstHome', dataType: 'BIGINT' }, { columnName: 'StlHome', dataType: 'BIGINT' }, { columnName: 'BlkHome', dataType: 'BIGINT' }, { columnName: 'TovHome', dataType: 'BIGINT' }, { columnName: 'PfHome', dataType: 'BIGINT' }, { columnName: 'PtsHome', dataType: 'BIGINT' }, { columnName: 'PlusMinusHome', dataType: 'BIGINT' }, { columnName: 'TeamIdAway', dataType: 'BIGINT' }, { columnName: 'WlAway', dataType: 'VARCHAR' }, { columnName: 'FgmAway', dataType: 'BIGINT' }, { columnName: 'FgaAway', dataType: 'BIGINT' }, { columnName: 'fg_pct_away', dataType: 'DOUBLE' }, { columnName: 'threepAway', dataType: 'BIGINT' }, { columnName: 'threepaAway', dataType: 'BIGINT' }, { columnName: 'Fg3_pct_away', dataType: 'DOUBLE' }, { columnName: 'FtmAway', dataType: 'BIGINT' }, { columnName: 'FtaAway', dataType: 'BIGINT' }, { columnName: 'Ft_pct_away', dataType: 'DOUBLE' }, { columnName: 'OrebAway', dataType: 'BIGINT' }, { columnName: 'DrebAway', dataType: 'BIGINT' }, { columnName: 'RebAway', dataType: 'BIGINT' }, { columnName: 'AstAway', dataType: 'BIGINT' }, { columnName: 'StlAway', dataType: 'BIGINT' }, { columnName: 'BlkAway', dataType: 'BIGINT' }, { columnName: 'TovAway', dataType: 'BIGINT' }, { columnName: 'PfAway', dataType: 'BIGINT' }, { columnName: 'PtsAway', dataType: 'BIGINT' }, { columnName: 'PlusMinusAway', dataType: 'BIGINT' }, { columnName: 'SeasonType', dataType: 'VARCHAR' }, ], properties: { description: 'This table describes the game statistics for both the home and away teams in each NBA game. Turnover percentage is the number of possessions that end in a turnover. The formula for turnover percentage (TOV%) is "TOV% = (Tov ÷ (FGA + (0.44 x FTA) + Tov)) x 100%".', }, }, { tableName: 'line_score', primaryKey: 'GameId', filePath: 'https://wrenai-public.s3.amazonaws.com/demo/v0.3.0/NBA/line_score.csv', columns: [ { name: 'GameId', }, { name: 'GameDate', }, { name: 'GameSequence', }, { name: 'TeamIdHome', }, { name: 'TeamWinsLossesHome', }, { name: 'PtsQtr1Home', properties: { description: 'The score of the home team in the first quarter.', }, }, { name: 'PtsQtr2Home', properties: { description: 'The score of the home team in the second quarter.', }, }, { name: 'PtsQtr3Home', properties: { description: 'The score of the home team in the third quarter.', }, }, { name: 'PtsQtr4Home', properties: { description: 'The score of the home team in the fourth quarter.', }, }, { name: 'PtsOt1Home', properties: { description: 'The score of the home team in the overtime. The value of 0 indicates that the game did not go into overtime.', }, }, { name: 'PtsHome', properties: { description: 'Total score of the home team.' }, }, { name: 'TeamIdAway', }, { name: 'TeamWinsLossesAway', }, { name: 'PtsQtr1Away', properties: { description: 'The score of the away team in the first quarter.', }, }, { name: 'PtsQtr2Away', properties: { description: 'The score of the away team in the second quarter.', }, }, { name: 'PtsQtr3Away', properties: { description: 'The score of the away team in the third quarter.', }, }, { name: 'PtsQtr4Away', properties: { description: 'The score of the away team in the fourth quarter.', }, }, { name: 'PtsOt1Away', properties: { description: 'The score of the away team in the overtime. The value of 0 indicates that the game did not go into overtime.', }, }, { name: 'PtsAway', properties: { description: 'Total score of the away team.' }, }, ], schema: [ { columnName: 'GameDate', dataType: 'DATE' }, { columnName: 'GameSequence', dataType: 'BIGINT' }, { columnName: 'GameId', dataType: 'BIGINT' }, { columnName: 'TeamIdHome', dataType: 'BIGINT' }, { columnName: 'TeamWinsLossesHome', dataType: 'VARCHAR' }, { columnName: 'PtsQtr1Home', dataType: 'BIGINT' }, { columnName: 'PtsQtr2Home', dataType: 'BIGINT' }, { columnName: 'PtsQtr3Home', dataType: 'BIGINT' }, { columnName: 'PtsQtr4Home', dataType: 'BIGINT' }, { columnName: 'PtsOt1Home', dataType: 'BIGINT' }, { columnName: 'PtsHome', dataType: 'BIGINT' }, { columnName: 'TeamIdAway', dataType: 'BIGINT' }, { columnName: 'TeamWinsLossesAway', dataType: 'VARCHAR' }, { columnName: 'PtsQtr1Away', dataType: 'BIGINT' }, { columnName: 'PtsQtr2Away', dataType: 'BIGINT' }, { columnName: 'PtsQtr3Away', dataType: 'BIGINT' }, { columnName: 'PtsQtr4Away', dataType: 'BIGINT' }, { columnName: 'PtsOt1Away', dataType: 'BIGINT' }, { columnName: 'PtsAway', dataType: 'BIGINT' }, ], properties: { description: 'This table describes the scores and total score for each quarter or overtime of an NBA game, detailing the scores for both the home team and the away team.', }, }, { tableName: 'player_games', primaryKey: 'Id', filePath: 'https://wrenai-public.s3.amazonaws.com/demo/v0.3.0/NBA/player_game.csv', columns: [ { name: 'Id', }, { name: 'GameId', }, { name: 'PlayerId', }, { name: 'Date', }, { name: 'Age', properties: { description: 'player age. The format is "age-days"' }, }, { name: 'Tm', properties: { description: 'team affiliation.' }, }, { name: 'Opp', properties: { description: 'opposing team.' }, }, { name: 'MP', properties: { description: 'minutes played' }, }, { name: 'FG', properties: { description: 'number of two point field goals made.', }, }, { name: 'FGA', properties: { description: 'number of two point field goals attempted (do not include free throws).', }, }, { name: 'threeP', properties: { description: 'number of three point field goals made.', }, }, { name: 'threePA', properties: { description: 'number of three point field goals attempted.', }, }, { name: 'FT', properties: { description: 'number of free throws made.' }, }, { name: 'FTA', properties: { description: 'number of free throws attempted.' }, }, { name: 'ORB', properties: { description: 'number of offensive rebounds.' }, }, { name: 'DRB', properties: { description: 'number of defensive rebounds.' }, }, { name: 'AST', properties: { description: 'number of assists.' }, }, { name: 'STL', properties: { description: 'number of Steals.' }, }, { name: 'BLK', properties: { description: 'number of blocks.' }, }, { name: 'TOV', properties: { description: 'number of turnovers allowed' }, }, { name: 'PF', properties: { description: 'number of personal fouls' }, }, { name: 'PTS', properties: { description: 'total score' }, }, ], schema: [ { columnName: 'Id', dataType: 'BIGINT' }, { columnName: 'PlayerID', dataType: 'BIGINT' }, { columnName: 'GameID', dataType: 'BIGINT' }, { columnName: 'Date', dataType: 'DATE' }, { columnName: 'Age', dataType: 'VARCHAR' }, // 35-032 { columnName: 'Tm', dataType: 'VARCHAR' }, { columnName: 'Opp', dataType: 'VARCHAR' }, { columnName: 'MP', dataType: 'VARCHAR' }, // 37:25:00 { columnName: 'FG', dataType: 'BIGINT' }, { columnName: 'FGA', dataType: 'BIGINT' }, { columnName: 'threeP', dataType: 'BIGINT' }, { columnName: 'threePA', dataType: 'BIGINT' }, { columnName: 'FT', dataType: 'BIGINT' }, { columnName: 'FTA', dataType: 'BIGINT' }, { columnName: 'ORB', dataType: 'BIGINT' }, { columnName: 'DRB', dataType: 'BIGINT' }, { columnName: 'TRB', dataType: 'BIGINT' }, { columnName: 'AST', dataType: 'BIGINT' }, { columnName: 'STL', dataType: 'BIGINT' }, { columnName: 'BLK', dataType: 'BIGINT' }, { columnName: 'TOV', dataType: 'BIGINT' }, { columnName: 'PF', dataType: 'BIGINT' }, { columnName: 'PTS', dataType: 'BIGINT' }, ], properties: { description: 'This table describes the game statistics for each NBA player in every game. Turnover percentage is the number of possessions that end in a turnover. The formula for turnover percentage (TOV%) is "TOV% = (Tov ÷ (FGA + (0.44 x FTA) + Tov)) x 100%".', }, }, { tableName: 'player', primaryKey: 'Id', filePath: 'https://wrenai-public.s3.amazonaws.com/demo/v0.3.0/NBA/player.csv', columns: [ { name: 'Id', }, { name: 'TeamId', }, { name: 'FullName', }, { name: 'FirstName', }, { name: 'LastName', }, ], schema: [ { columnName: 'Id', dataType: 'BIGINT' }, { columnName: 'TeamId', dataType: 'BIGINT' }, { columnName: 'FullName', dataType: 'VARCHAR' }, { columnName: 'FirstName', dataType: 'VARCHAR' }, { columnName: 'LastName', dataType: 'VARCHAR' }, ], properties: { description: 'This table describes NBA players by their ID, name, and team affiliation.', }, }, { tableName: 'team', primaryKey: 'Id', filePath: 'https://wrenai-public.s3.amazonaws.com/demo/v0.3.0/NBA/team.csv', columns: [ { name: 'Id', }, { name: 'FullName', }, { name: 'Abbreviation', }, { name: 'Nickname', }, { name: 'City', }, { name: 'State', }, { name: 'YearFounded', }, ], schema: [ { columnName: 'Id', dataType: 'BIGINT' }, { columnName: 'FullName', dataType: 'VARCHAR' }, { columnName: 'Abbreviation', dataType: 'VARCHAR' }, { columnName: 'Nickname', dataType: 'VARCHAR' }, { columnName: 'City', dataType: 'VARCHAR' }, { columnName: 'State', dataType: 'VARCHAR' }, { columnName: 'YearFounded', dataType: 'INT' }, ], properties: { description: 'This table describes NBA teams by their ID, team name, team abbreviation, and founding date.', }, }, ], questions: [ { question: 'How many three-pointers were made by each player in each game?', label: 'Aggregation', }, { question: 'What is the differences in turnover rates between teams with high and low average scores?', label: 'Comparison', }, { question: 'Which teams had the highest average points scored per game throughout the season?', label: 'Ranking', }, ], relations: [ { fromModelName: 'game', fromColumnName: 'Id', toModelName: 'line_score', toColumnName: 'GameId', type: RelationType.ONE_TO_MANY, }, { fromModelName: 'line_score', fromColumnName: 'GameId', toModelName: 'player_games', toColumnName: 'GameID', type: RelationType.ONE_TO_MANY, }, { fromModelName: 'player', fromColumnName: 'TeamId', toModelName: 'team', toColumnName: 'Id', type: RelationType.ONE_TO_ONE, }, { fromModelName: 'team', fromColumnName: 'Id', toModelName: 'game', toColumnName: 'TeamIdHome', type: RelationType.ONE_TO_MANY, }, ], }, }; export const buildInitSql = (datasetName: SampleDatasetName) => { const selectedDataset = sampleDatasets[datasetName.toLowerCase()]; return selectedDataset.tables .map((table) => { const schema = table.schema ?.map(({ columnName, dataType }) => `'${columnName}': '${dataType}'`) .join(', '); const fileExtension = table.filePath.split('.').pop(); const createTableStatement = (fileType: string, schema?: string) => { if (fileType !== 'csv' && fileType !== 'parquet') { throw new Error(`Unsupported file type: ${fileType}`); } const baseStatement = `CREATE TABLE ${table.tableName} AS select * FROM read_${fileType}('${table.filePath}'`; const schemaPart = fileType === 'csv' && schema ? `, columns={${schema}}` : ''; const headerPart = fileType === 'csv' ? ',header=true' : ''; return `${baseStatement}${headerPart}${schemaPart});`; }; return createTableStatement(fileExtension, schema); }) .join('\n'); }; export const getRelations = (datasetName: SampleDatasetName) => { const selectedDataset = sampleDatasets[datasetName.toLowerCase()]; return selectedDataset.relations; }; export const getSampleAskQuestions = (datasetName: SampleDatasetName) => { const selectedDataset = sampleDatasets[datasetName.toLowerCase()]; return selectedDataset.questions; }; ================================================ FILE: wren-ui/src/apollo/server/data/type.ts ================================================ export enum SampleDatasetName { MUSIC = 'MUSIC', NBA = 'NBA', ECOMMERCE = 'ECOMMERCE', HR = 'HR', } ================================================ FILE: wren-ui/src/apollo/server/dataSource.ts ================================================ import { IbisBigQueryConnectionInfo, IbisPostgresConnectionInfo, HostBasedConnectionInfo, UrlBasedConnectionInfo, IbisSnowflakeConnectionInfo, IbisTrinoConnectionInfo, IbisAthenaConnectionInfo, IbisRedshiftConnectionType, IbisRedshiftConnectionInfo, IbisDatabricksConnectionType, IbisDatabricksConnectionInfo, } from './adaptors/ibisAdaptor'; import { ATHENA_CONNECTION_INFO, BIG_QUERY_CONNECTION_INFO, DUCKDB_CONNECTION_INFO, MYSQL_CONNECTION_INFO, POSTGRES_CONNECTION_INFO, MS_SQL_CONNECTION_INFO, WREN_AI_CONNECTION_INFO, CLICK_HOUSE_CONNECTION_INFO, TRINO_CONNECTION_INFO, SNOWFLAKE_CONNECTION_INFO, ORACLE_CONNECTION_INFO, REDSHIFT_CONNECTION_INFO, REDSHIFT_IAM_AUTH, REDSHIFT_PASSWORD_AUTH, DATABRICKS_CONNECTION_INFO, DATABRICKS_PERSONAL_ACCESS_TOKEN_AUTH, DATABRICKS_SERVICE_PRINCIPAL_AUTH, } from './repositories'; import { DataSourceName } from './types'; import { getConfig } from './config'; import { Encryptor } from './utils'; const config = getConfig(); const encryptor = new Encryptor(config); export function encryptConnectionInfo( dataSourceType: DataSourceName, connectionInfo: WREN_AI_CONNECTION_INFO, ) { return dataSource[dataSourceType].sensitiveProps.reduce( (acc, prop: string) => { const value = connectionInfo[prop]; if (value) { const encryption = encryptor.encrypt( JSON.parse(JSON.stringify({ [prop]: value })), ); return { ...acc, [prop]: encryption }; } return acc; }, connectionInfo, ); } export function toIbisConnectionInfo(dataSourceType, connectionInfo) { return dataSource[dataSourceType].toIbisConnectionInfo(connectionInfo); } export function toMultipleIbisConnectionInfos(dataSourceType, connectionInfo) { if (!dataSource[dataSourceType].toMultipleIbisConnectionInfos) { return null; } return dataSource[dataSourceType].toMultipleIbisConnectionInfos( connectionInfo, ); } interface IDataSourceConnectionInfo { sensitiveProps: string[]; toIbisConnectionInfo(connectionInfo: C): I; toMultipleIbisConnectionInfos?(connectionInfo: C): I[]; } const dataSource = { // Athena [DataSourceName.ATHENA]: { sensitiveProps: ['awsSecretKey', 'webIdentityToken'], toIbisConnectionInfo(connectionInfo) { const decryptedConnectionInfo = decryptConnectionInfo( DataSourceName.ATHENA, connectionInfo, ); const { awsAccessKey, awsRegion, awsSecretKey, s3StagingDir, schema, webIdentityToken, roleArn, roleSessionName, } = decryptedConnectionInfo as ATHENA_CONNECTION_INFO; // Base fields shared by both authentication methods const base = { region_name: awsRegion, s3_staging_dir: s3StagingDir, schema_name: schema, }; // If OIDC fields are provided → send OIDC config if (webIdentityToken && roleArn) { return { ...base, web_identity_token: webIdentityToken, role_arn: roleArn, ...(roleSessionName && { role_session_name: roleSessionName }), } satisfies IbisAthenaConnectionInfo; } // Otherwise → fallback to AWS access key authentication return { ...base, aws_access_key_id: awsAccessKey, aws_secret_access_key: awsSecretKey, } satisfies IbisAthenaConnectionInfo; }, } as IDataSourceConnectionInfo< ATHENA_CONNECTION_INFO, IbisAthenaConnectionInfo >, // BigQuery [DataSourceName.BIG_QUERY]: { sensitiveProps: ['credentials'], toIbisConnectionInfo(connectionInfo) { const decryptedConnectionInfo = decryptConnectionInfo( DataSourceName.BIG_QUERY, connectionInfo, ); const { projectId, datasetId, credentials } = decryptedConnectionInfo as BIG_QUERY_CONNECTION_INFO; const base64Credentials = Buffer.from( JSON.stringify(credentials), ).toString('base64'); const res: IbisBigQueryConnectionInfo = { project_id: projectId, dataset_id: datasetId, credentials: base64Credentials, }; return res; }, } as IDataSourceConnectionInfo< BIG_QUERY_CONNECTION_INFO, IbisBigQueryConnectionInfo >, // Postgres [DataSourceName.POSTGRES]: { sensitiveProps: ['password'], toIbisConnectionInfo(connectionInfo) { const decryptedConnectionInfo = decryptConnectionInfo( DataSourceName.POSTGRES, connectionInfo, ); const { host, port, database, user, password, ssl } = decryptedConnectionInfo as POSTGRES_CONNECTION_INFO; // url encode password const encodedPassword = encodeURIComponent(password); let connectionUrl = `postgresql://${user}:${encodedPassword}@${host}:${port}/${database}?`; if (ssl) { connectionUrl += 'sslmode=require'; } return { connectionUrl, }; }, } as IDataSourceConnectionInfo< POSTGRES_CONNECTION_INFO, IbisPostgresConnectionInfo >, // mysql [DataSourceName.MYSQL]: { sensitiveProps: ['password'], toIbisConnectionInfo(connectionInfo) { const decryptedConnectionInfo = decryptConnectionInfo( DataSourceName.MYSQL, connectionInfo, ); const { host, port, database, user, password, ssl } = decryptedConnectionInfo as MYSQL_CONNECTION_INFO; return { host, port, database, user, password, sslMode: ssl ? 'ENABLED' : 'DISABLED', }; }, } as IDataSourceConnectionInfo< MYSQL_CONNECTION_INFO, HostBasedConnectionInfo >, // Oracle [DataSourceName.ORACLE]: { sensitiveProps: ['password', 'dsn'], toIbisConnectionInfo(connectionInfo) { const decryptedConnectionInfo = decryptConnectionInfo( DataSourceName.ORACLE, connectionInfo, ); const { host, port, database, user, password, dsn } = decryptedConnectionInfo as ORACLE_CONNECTION_INFO; return Object.entries({ host, port, database, user, password, dsn, }).reduce((acc, [key, value]) => { if (value !== undefined && value !== '') { acc[key] = value; } return acc; }, {}); }, } as IDataSourceConnectionInfo< ORACLE_CONNECTION_INFO, HostBasedConnectionInfo >, // SQL Server [DataSourceName.MSSQL]: { sensitiveProps: ['password'], toIbisConnectionInfo(connectionInfo) { const decryptedConnectionInfo = decryptConnectionInfo( DataSourceName.MSSQL, connectionInfo, ); const { host, port, database, user, password, trustServerCertificate } = decryptedConnectionInfo as MS_SQL_CONNECTION_INFO; return { host, port, database, user, password, ...(trustServerCertificate && { kwargs: { trustServerCertificate: 'YES' }, }), }; }, } as IDataSourceConnectionInfo< MS_SQL_CONNECTION_INFO, HostBasedConnectionInfo >, // Click House [DataSourceName.CLICK_HOUSE]: { sensitiveProps: ['password'], toIbisConnectionInfo(connectionInfo) { const decryptedConnectionInfo = decryptConnectionInfo( DataSourceName.CLICK_HOUSE, connectionInfo, ); const { host, port, database, user, password, ssl } = decryptedConnectionInfo as CLICK_HOUSE_CONNECTION_INFO; const encodedPassword = encodeURIComponent(password); let connectionUrl = `clickhouse://${user}:${encodedPassword}@${host}:${port}/${database}?`; if (ssl) { connectionUrl += 'secure=1'; } return { connectionUrl }; }, } as IDataSourceConnectionInfo< CLICK_HOUSE_CONNECTION_INFO, UrlBasedConnectionInfo >, [DataSourceName.TRINO]: { sensitiveProps: ['password'], toIbisConnectionInfo(connectionInfo) { const { host, password, port, schemas, username, ssl } = decryptConnectionInfo( DataSourceName.TRINO, connectionInfo, ) as TRINO_CONNECTION_INFO; // pick first schema from schemas const [catalog, schema] = schemas.split(',')?.[0]?.split('.') ?? []; if (!catalog || !schema) { throw new Error('Invalid schema format, expected catalog.schema'); } return { host: ssl ? `https://${host}` : `http://${host}`, port, catalog, schema, user: username, password, }; }, toMultipleIbisConnectionInfos(connectionInfo) { const { host, port, schemas, username, password, ssl } = decryptConnectionInfo( DataSourceName.TRINO, connectionInfo, ) as TRINO_CONNECTION_INFO; // Helper function to parse and validate schema const parseSchema = (schemaStr: string) => { const trimmed = schemaStr.trim(); const [catalog, schema] = trimmed.split('.'); if (!catalog || !schema) { throw new Error( `Invalid schema format: "${trimmed}". Expected format: catalog.schema`, ); } return { catalog, schema }; }; // schemas format will be `catalog.schema, catalog.schema, ...` const schemasArray = schemas.split(',').filter(Boolean); if (schemasArray.length === 0) { throw new Error( 'No valid schemas provided. Expected format: catalog.schema[, catalog.schema, ...]', ); } return schemasArray.map((schema) => { const { catalog, schema: schemaName } = parseSchema(schema); return { host: ssl ? `https://${host}` : `http://${host}`, port, catalog, schema: schemaName, user: username, password, }; }); }, } as IDataSourceConnectionInfo< TRINO_CONNECTION_INFO, IbisTrinoConnectionInfo >, // Snowflake [DataSourceName.SNOWFLAKE]: { sensitiveProps: ['password', 'privateKey'], toIbisConnectionInfo(connectionInfo) { const decryptedConnectionInfo = decryptConnectionInfo( DataSourceName.SNOWFLAKE, connectionInfo, ); const { user, password, account, database, schema, warehouse, privateKey, } = decryptedConnectionInfo as SNOWFLAKE_CONNECTION_INFO; return { user, account, database, schema, warehouse: warehouse ?? undefined, password: password ?? undefined, private_key: privateKey ?? undefined, }; }, } as IDataSourceConnectionInfo< SNOWFLAKE_CONNECTION_INFO, IbisSnowflakeConnectionInfo >, // DuckDB [DataSourceName.DUCKDB]: { sensitiveProps: [], toIbisConnectionInfo(_connectionInfo) { throw new Error('Not implemented'); }, } as IDataSourceConnectionInfo, // Redshift [DataSourceName.REDSHIFT]: { sensitiveProps: ['password', 'awsSecretKey'], toIbisConnectionInfo(connectionInfo) { const decryptedConnectionInfo = decryptConnectionInfo( DataSourceName.REDSHIFT, connectionInfo, ); const { redshiftType } = decryptedConnectionInfo as REDSHIFT_CONNECTION_INFO; // using password authentication if (redshiftType === IbisRedshiftConnectionType.REDSHIFT) { const { host, port, database, user, password } = decryptedConnectionInfo as REDSHIFT_PASSWORD_AUTH; return { redshift_type: redshiftType, host, port, database, user, password, }; } // using IAM authentication if (redshiftType === IbisRedshiftConnectionType.REDSHIFT_IAM) { const { clusterIdentifier, user, database, awsRegion, awsAccessKey, awsSecretKey, } = decryptedConnectionInfo as REDSHIFT_IAM_AUTH; return { redshift_type: redshiftType, cluster_identifier: clusterIdentifier, user, database, region: awsRegion, access_key_id: awsAccessKey, access_key_secret: awsSecretKey, }; } throw new Error( 'Invalid Redshift connection info: must use either password or IAM authentication', ); }, } as IDataSourceConnectionInfo< REDSHIFT_CONNECTION_INFO, IbisRedshiftConnectionInfo >, // Databricks [DataSourceName.DATABRICKS]: { sensitiveProps: ['accessToken', 'clientSecret'], toIbisConnectionInfo(connectionInfo) { const decryptedConnectionInfo = decryptConnectionInfo( DataSourceName.DATABRICKS, connectionInfo, ); const { databricksType } = decryptedConnectionInfo as DATABRICKS_CONNECTION_INFO; if (databricksType === IbisDatabricksConnectionType.TOKEN) { const { serverHostname, httpPath, accessToken } = decryptedConnectionInfo as DATABRICKS_PERSONAL_ACCESS_TOKEN_AUTH; return { databricks_type: databricksType, serverHostname, httpPath, accessToken, }; } if (databricksType === IbisDatabricksConnectionType.SERVICE_PRINCIPAL) { const { serverHostname, httpPath, clientId, clientSecret, azureTenantId, } = decryptedConnectionInfo as DATABRICKS_SERVICE_PRINCIPAL_AUTH; return { databricks_type: databricksType, serverHostname, httpPath, clientId, clientSecret, azureTenantId, }; } throw new Error( 'Invalid Databricks connection info: must use either personal access token or service principal authentication', ); }, } as IDataSourceConnectionInfo< DATABRICKS_CONNECTION_INFO, IbisDatabricksConnectionInfo >, }; function decryptConnectionInfo( dataSourceType: DataSourceName, connectionInfo: WREN_AI_CONNECTION_INFO, ): WREN_AI_CONNECTION_INFO { return dataSource[dataSourceType].sensitiveProps.reduce( (acc, prop: string) => { const value = connectionInfo[prop]; if (value) { const decryption = encryptor.decrypt(value); const decryptedValue = JSON.parse(decryption)[prop]; return { ...acc, [prop]: decryptedValue }; } return acc; }, connectionInfo, ); } ================================================ FILE: wren-ui/src/apollo/server/index.ts ================================================ export * from './schema'; export * from './resolvers'; ================================================ FILE: wren-ui/src/apollo/server/managers/dataSourceSchemaDetector.ts ================================================ import { camelCase, differenceWith, isEmpty, isEqual, uniqBy } from 'lodash'; import { IContext } from '@server/types'; import { getLogger } from 'log4js'; import { SchemaChange } from '@server/repositories/schemaChangeRepository'; import { Model, ModelColumn, RelationInfo } from '../repositories'; const logger = getLogger('DataSourceSchemaDetector'); logger.level = 'debug'; export type DataSourceSchema = { name: string; columns: { name: string; type: string; }[]; }; export type DataSourceSchemaChange = { [SchemaChangeType.DELETED_TABLES]?: DataSourceSchema[]; [SchemaChangeType.DELETED_COLUMNS]?: DataSourceSchema[]; [SchemaChangeType.MODIFIED_COLUMNS]?: DataSourceSchema[]; }; export type DataSourceSchemaResolve = { [SchemaChangeType.DELETED_TABLES]?: boolean; [SchemaChangeType.DELETED_COLUMNS]?: boolean; [SchemaChangeType.MODIFIED_COLUMNS]?: boolean; }; export enum SchemaChangeType { // the tables has been deleted DELETED_TABLES = 'deletedTables', // the columns has been deleted DELETED_COLUMNS = 'deletedColumns', // the columns type has been changed MODIFIED_COLUMNS = 'modifiedColumns', } interface AffectedResources { sourceTableName: string; referenceName: string; displayName: string; modelId: number; columns: Array<{ sourceColumnName: string; displayName: string; type: string; }>; relationships: Array<{ id: number; displayName: string; referenceName: string; }>; calculatedFields: ModelColumn[]; } export interface IDataSourceSchemaDetector { detectSchemaChange(): Promise; resolveSchemaChange(type: string): Promise; getAffectedResources( changes: DataSourceSchema[], { models, modelColumns, modelRelationships, }: { models: Model[]; modelColumns: ModelColumn[]; modelRelationships: RelationInfo[]; }, ): AffectedResources[]; } export default class DataSourceSchemaDetector implements IDataSourceSchemaDetector { public ctx: IContext; public projectId: number; constructor({ ctx, projectId }: { ctx: IContext; projectId: number }) { this.ctx = ctx; this.projectId = projectId; } public async detectSchemaChange() { const diffSchema = await this.getDiffSchema(); if (diffSchema) { await this.addSchemaChange(diffSchema); } else { // Mark resolve all in last schema change if it has unresolved flag when no schema change detected. const lastSchemaChange = await this.ctx.schemaChangeRepository.findLastSchemaChange( this.projectId, ); if (lastSchemaChange !== null) { const hasUnresolved = Object.values(lastSchemaChange.resolve).some( (resolve) => !resolve, ); if (hasUnresolved) { await this.updateResolveToSchemaChange( lastSchemaChange, Object.values(SchemaChangeType), ); } } } return !!diffSchema; } public async resolveSchemaChange(type: string) { const schemaChangeType = camelCase(type) as SchemaChangeType; const supportedTypes = [ SchemaChangeType.DELETED_TABLES, SchemaChangeType.DELETED_COLUMNS, ]; if (!supportedTypes.includes(schemaChangeType)) { throw new Error('Resolved scheme change type is not supported.'); } const lastSchemaChange = await this.ctx.schemaChangeRepository.findLastSchemaChange( this.projectId, ); const changes = lastSchemaChange?.change[schemaChangeType]; const isResolved = lastSchemaChange?.resolve[schemaChangeType]; if (isResolved) { throw new Error( `Schema change "${schemaChangeType}" has nothing to resolve.`, ); } const models = await this.ctx.modelRepository.findAllBy({ projectId: this.projectId, }); const modelIds = models.map((model) => model.id); const modelColumns = await this.ctx.modelColumnRepository.findColumnsByModelIds(modelIds); const modelRelationships = await this.ctx.relationRepository.findRelationInfoBy({ modelIds, }); const affectedResources = this.getAffectedResources(changes, { models, modelColumns, modelRelationships, }); /** * Handle resolve scheme change for DELETED_TABLES / DELETED_COLUMNS * 1. Remove all affected calculated fields * 2. Remove all affected columns if DELETED_COLUMNS * 3. Remove all affected tables if DELETED_TABLES * * Considering that we have set up foreign keys, some data will be automatically deleted in cascade, * so there is no need to perform additional deletions. (E.g., relationships, model's column) */ await Promise.all( affectedResources.map(async (resource) => { // both DELETED_TABLES and DELETED_COLUMNS need to remove all affected calculated fields logger.debug( `Start to remove all affected calculated fields "${resource.calculatedFields.map( (column) => `${column.displayName} (${column.referenceName})`, )}".`, ); const columnIds = resource.calculatedFields.map((column) => column.id); await this.ctx.modelColumnRepository.deleteAllByColumnIds(columnIds); // remove columns if SchemaChangeType is DELETED_COLUMNS if (schemaChangeType === SchemaChangeType.DELETED_COLUMNS) { const affectedColumnNames = resource.columns.map( (column) => column.sourceColumnName, ); logger.debug( `Start to remove columns "${affectedColumnNames}" from model "${resource.referenceName}".`, ); await this.ctx.modelColumnRepository.deleteAllBySourceColumnNames( resource.modelId, affectedColumnNames, ); } return; }), ); // remove tables if SchemaChangeType is DELETED_TABLES if (schemaChangeType === SchemaChangeType.DELETED_TABLES) { // delete models const affectedTableNames = changes.map((table) => table.name); logger.debug( `Start to remove tables "${affectedTableNames}" from models.`, ); await this.ctx.modelRepository.deleteAllBySourceTableNames( affectedTableNames, ); } // update resolve flag await this.updateResolveToSchemaChange(lastSchemaChange, [ schemaChangeType, ]); } /** * According to affected models and column data, we also need to find affected resources, including calculated fields and relationships. * * Find all affected resources include: * - columns (called "affected column") * - relationships (called "affected relationship") * - calculated fields: * - calculated fields which were affected by affected columns * - calculated fields which were affected by affected relationships */ public getAffectedResources( changes: DataSourceSchema[], { models, modelColumns, modelRelationships, }: { models: Model[]; modelColumns: ModelColumn[]; modelRelationships: RelationInfo[]; }, ) { const affectedModels = models.filter( (model) => changes.findIndex((table) => table.name === model.sourceTableName) !== -1, ); const affectedResources = affectedModels.map((model) => { const affectedColumns = changes.find( (table) => table.name === model.sourceTableName, ).columns; const allCalculatedFields = modelColumns.filter( (column) => column.isCalculated, ); const affectedMaterials = affectedColumns.reduce( (result, column) => { const affectedColumn = modelColumns.find( (modelColumn) => modelColumn.sourceColumnName === column.name && modelColumn.modelId === model.id, ); result.columns.push({ sourceColumnName: column.name, displayName: affectedColumn.displayName, type: column.type, }); // collect affected calculated fields if it's target column const affectedCalculatedFieldsByColumnId = allCalculatedFields.filter( (calculatedField) => { const lineage = JSON.parse(calculatedField.lineage); return ( lineage && lineage[lineage.length - 1] === affectedColumn.id ); }, ); result.calculatedFields.push(...affectedCalculatedFieldsByColumnId); // collect affected relationships const affectedRelationships = modelRelationships .map((relationship) => [relationship.fromColumnId, relationship.toColumnId].includes( affectedColumn.id, ) ? relationship : null, ) .filter((relationship) => !!relationship); affectedRelationships.forEach((relationship) => { const referenceName = model.referenceName === relationship.fromModelName ? relationship.toModelName : relationship.fromModelName; const displayName = models.find( (model) => model.referenceName === referenceName, )?.displayName; result.relationships.push({ displayName, id: relationship.id, referenceName, }); // collect affected calculated fields if the relationship is in use const affectedCalculatedFieldsByRelationshipId = allCalculatedFields.filter((calculatedField) => { const lineage = JSON.parse(calculatedField.lineage); // pop the column ID from the lineage lineage.pop(); return lineage && lineage.includes(relationship.id); }); result.calculatedFields.push( ...affectedCalculatedFieldsByRelationshipId, ); }); return result; }, { columns: [], relationships: [], calculatedFields: [] }, ); // unique calculated fields by id since it can be duplicated const calculatedFields = uniqBy(affectedMaterials.calculatedFields, 'id'); return { sourceTableName: model.sourceTableName, displayName: model.displayName, referenceName: model.referenceName, modelId: model.id, ...affectedMaterials, calculatedFields, }; }); return affectedResources; } private async getDiffSchema() { logger.info('Start to detect Data Source Schema changes.'); const currentSchema = await this.getCurrentSchema(); const latestSchema = await this.getLatestSchema(); const diffSchema = currentSchema.reduce((result, currentTable) => { const lastestTable = latestSchema.find( (table) => table.name === currentTable.name, ); // If the table is not found in the latest schema, it means the table has been deleted. if (!lastestTable) { result[SchemaChangeType.DELETED_TABLES] = [ ...(result[SchemaChangeType.DELETED_TABLES] || []), currentTable, ]; return result; } // If the table is found in the latest schema, we need to diff the columns. const diffColumns = differenceWith( currentTable.columns, lastestTable.columns, isEqual, ); if (diffColumns.length > 0) { const deletedColumnChange = { name: currentTable.name, columns: [] }; const modifiedColumnChange = { name: currentTable.name, columns: [] }; for (const currentColumn of diffColumns) { const latestColumn = lastestTable.columns.find( (column) => column.name === currentColumn.name, ); // If the column is not found in the latest schema, it means the column has been deleted. if (!latestColumn) { deletedColumnChange.columns.push(currentColumn); continue; } // If the column is found in the latest schema, it means the column has been modified. // save latest column as modified column modifiedColumnChange.columns.push(latestColumn); } // If there are any deleted or modified columns, we need to add them to the result. if (deletedColumnChange.columns.length > 0) { result[SchemaChangeType.DELETED_COLUMNS] = [ ...(result[SchemaChangeType.DELETED_COLUMNS] || []), deletedColumnChange, ]; } if (modifiedColumnChange.columns.length > 0) { result[SchemaChangeType.MODIFIED_COLUMNS] = [ ...(result[SchemaChangeType.MODIFIED_COLUMNS] || []), modifiedColumnChange, ]; } } return result; }, {}); if (!isEmpty(diffSchema)) { logger.debug('Diff Schema:', JSON.stringify(diffSchema)); logger.info('Data Source Schema has changed.'); return diffSchema as DataSourceSchemaChange; } logger.info('No changes in Data Source Schema.'); return null; } private async addSchemaChange(diffSchema: DataSourceSchemaChange) { const getResolveState = (change) => (!!change ? false : undefined); const lastSchemaChange = await this.ctx.schemaChangeRepository.findLastSchemaChange( this.projectId, ); // If the schema change is the same as the last one, we don't need to create a new one. const isNewSchemaChange = JSON.stringify(lastSchemaChange?.change) !== JSON.stringify(diffSchema); if (isNewSchemaChange) { await this.ctx.schemaChangeRepository.createOne({ projectId: this.projectId, change: diffSchema, // Set the resolve to false if there are any changes. It will set resolve to true once the schema has been synced. resolve: { [SchemaChangeType.DELETED_TABLES]: getResolveState( diffSchema[SchemaChangeType.DELETED_TABLES], ), [SchemaChangeType.DELETED_COLUMNS]: getResolveState( diffSchema[SchemaChangeType.DELETED_COLUMNS], ), [SchemaChangeType.MODIFIED_COLUMNS]: getResolveState( diffSchema[SchemaChangeType.MODIFIED_COLUMNS], ), }, }); } } private async getCurrentSchema(): Promise { const models = await this.ctx.modelRepository.findAllBy({ projectId: this.projectId, }); const modelIds = models.map((model) => model.id); const modelColumns = await this.ctx.modelColumnRepository.findColumnsByModelIds(modelIds); const result = models.map((model) => { return { name: model.sourceTableName, columns: modelColumns .filter( (column) => column.modelId === model.id && !column.isCalculated, ) .map((column) => ({ name: column.sourceColumnName, type: column.type, })), }; }); return result; } private async getLatestSchema(): Promise { const project = await this.ctx.projectRepository.findOneBy({ id: this.projectId, }); const latestDataSourceTables = await this.ctx.projectService.getProjectDataSourceTables(project); const result = latestDataSourceTables.map((table) => { return { name: table.name, columns: table.columns.map((column) => { return { name: column.name, type: column.type, }; }), }; }); return result; } private async updateResolveToSchemaChange( lastSchemaChange: SchemaChange, schemaChangeTypes: SchemaChangeType[], ) { await this.ctx.schemaChangeRepository.updateOne(lastSchemaChange.id, { resolve: { ...lastSchemaChange.resolve, ...schemaChangeTypes.reduce( (result, type) => ({ ...result, [type]: true }), {}, ), }, }); logger.info(`Schema change "${schemaChangeTypes}" resolved successfully.`); } } ================================================ FILE: wren-ui/src/apollo/server/mdl/mdlBuilder.ts ================================================ import { isEmpty, isNil, pickBy } from 'lodash'; import { Model, ModelColumn, ModelNestedColumn, Project, RelationInfo, View, } from '../repositories'; import { Manifest, ModelMDL, TableReference, WrenEngineDataSourceType, } from './type'; import { getLogger } from '@server/utils'; import { getConfig } from '@server/config'; import { DataSourceName } from '../types'; const logger = getLogger('MDLBuilder'); logger.level = 'debug'; const config = getConfig(); export interface MDLBuilderBuildFromOptions { project: Project; models: Model[]; columns?: ModelColumn[]; nestedColumns?: ModelNestedColumn[]; relations?: RelationInfo[]; views: View[]; relatedModels?: Model[]; relatedColumns?: ModelColumn[]; relatedRelations?: RelationInfo[]; } export interface IMDLBuilder { build(): Manifest; //facade method to build the manifest json } // responsible to generate a valid manifest json export class MDLBuilder implements IMDLBuilder { private manifest: Manifest; private project: Project; private readonly models: Model[]; private readonly columns: ModelColumn[]; private readonly nestedColumns: ModelNestedColumn[]; private readonly relations: RelationInfo[]; private readonly views: View[]; // related models, columns, and relations are used as the reference to build calculatedField expression or other // eslint-disable-next-line @typescript-eslint/no-unused-vars private readonly relatedModels: Model[]; // eslint-disable-next-line @typescript-eslint/no-unused-vars private readonly relatedColumns: ModelColumn[]; // eslint-disable-next-line @typescript-eslint/no-unused-vars private readonly relatedRelations: RelationInfo[]; constructor(builderOptions: MDLBuilderBuildFromOptions) { const { project, models, columns, nestedColumns, relations, views, relatedModels, relatedColumns, relatedRelations, } = builderOptions; this.project = project; this.models = models.sort((a, b) => a.id - b.id); this.columns = columns.sort((a, b) => a.id - b.id); this.nestedColumns = nestedColumns; this.relations = relations.sort((a, b) => a.id - b.id); this.views = views || []; this.relatedModels = relatedModels; this.relatedColumns = relatedColumns; this.relatedRelations = relatedRelations; // init manifest this.manifest = {}; } public build(): Manifest { this.addProject(); this.addModel(); this.addNormalField(); this.addRelation(); this.addCalculatedField(); this.addView(); this.postProcessManifest(); return this.getManifest(); } public getManifest(): Manifest { return this.manifest; } public addModel(): void { if (!isEmpty(this.manifest.models)) { return; } this.manifest.models = this.models.map((model: Model) => { const properties = model.properties ? JSON.parse(model.properties) : {}; // put displayName in properties if (model.displayName) { properties.displayName = model.displayName; } const tableReference = this.buildTableReference(model); return { name: model.referenceName, columns: [], tableReference, // can only have one of refSql or tableReference refSql: this.useRustWrenEngine() ? null : tableReference ? null : model.refSql, cached: model.cached ? true : false, refreshTime: model.refreshTime, properties: { displayName: model.displayName, description: properties.description, }, primaryKey: '', // will be modified in addColumn } as ModelMDL; }); } public addView(): void { if (!isEmpty(this.manifest.views)) { return; } this.manifest.views = this.views.map((view: View) => { const properties = JSON.parse(view.properties) || {}; // filter out properties that are not null or undefined // and are in the list of properties that are allowed const viewProperties = pickBy(properties, (value, key) => { return ( !isNil(value) && ['displayName', 'description', 'question', 'summary'].includes(key) ); }); return { name: view.name, statement: view.statement, properties: { ...viewProperties, // viewId will be passed back in other APIs // to identify the view viewId: view.id.toString(), }, }; }); } public addNormalField(): void { // should addModel first if (isEmpty(this.manifest.models)) { logger.debug('No model in manifest, should build model first'); return; } this.columns .filter(({ isCalculated }) => !isCalculated) .forEach((column: ModelColumn) => { // validate manifest.model exist const modelRefName = this.models.find( (model: any) => model.id === column.modelId, )?.referenceName; if (!modelRefName) { logger.debug( `Build MDL Column Error: can not find model, modelId ${column.modelId}, columnId: ${column.id}`, ); return; } const model = this.manifest.models.find( (model: any) => model.name === modelRefName, ); // modify model primary key if (column.isPk) { model.primaryKey = column.referenceName; } // add column into model if (!model.columns) { model.columns = []; } const properties = column.properties ? JSON.parse(column.properties) : {}; // put displayName in properties if (column.displayName) { properties.displayName = column.displayName; } // put nested columns in properties if (column.type.includes('STRUCT')) { const nestedColumns = this.nestedColumns.filter( (nestedColumn) => nestedColumn.columnId === column.id, ); nestedColumns.forEach((column) => { if (column.displayName) { properties[`nestedDisplayName.${column.sourceColumnName}`] = column.displayName; } if (column.properties?.description) { properties[`nestedDescription.${column.sourceColumnName}`] = column.properties.description; } }, {}); } const expression = this.getColumnExpression(column, model); model.columns.push({ name: column.referenceName, type: column.type, isCalculated: column.isCalculated ? true : false, notNull: column.notNull ? true : false, expression, properties: properties, }); }); } public addCalculatedField(): void { // should addModel first if (isEmpty(this.manifest.models)) { logger.debug('No model in manifest, should build model first'); return; } this.columns .filter(({ isCalculated }) => isCalculated) .forEach((column: ModelColumn) => { // validate manifest.model exist const relatedModel = this.relatedModels.find( (model: any) => model.id === column.modelId, ); const model = this.manifest.models.find( (model: any) => model.name === relatedModel.referenceName, ); if (!model) { logger.debug( `Build MDL Column Error: can not find model, modelId "${column.modelId}", columnId: "${column.id}"`, ); return; } const expression = this.getColumnExpression(column, model); const columnValue = { name: column.referenceName, type: column.type, isCalculated: true, expression, notNull: column.notNull ? true : false, properties: JSON.parse(column.properties), }; model.columns.push(columnValue); }); } public insertCalculatedField( modelName: string, calculatedField: ModelColumn, ) { const model = this.manifest.models.find( (model: any) => model.name === modelName, ); if (!model) { logger.debug(`Can not find model "${modelName}" to add calculated field`); return; } // if calculated field is already in the model, skip if ( model.columns.find( (column: any) => column.name === calculatedField.referenceName, ) ) { return; } const expression = this.getColumnExpression(calculatedField, model); const columnValue = { name: calculatedField.referenceName, type: calculatedField.type, isCalculated: true, expression, notNull: calculatedField.notNull ? true : false, properties: JSON.parse(calculatedField.properties), }; model.columns.push(columnValue); } public addRelation(): void { this.manifest.relationships = this.relations.map( (relation: RelationInfo) => { const { name, joinType, fromModelName, fromColumnName, toModelName, toColumnName, } = relation; const condition = this.getRelationCondition(relation); this.addRelationColumn(fromModelName, { modelReferenceName: toModelName, columnReferenceName: toColumnName, relation: name, }); this.addRelationColumn(toModelName, { modelReferenceName: fromModelName, columnReferenceName: fromColumnName, relation: name, }); const properties = relation.properties ? JSON.parse(relation.properties) : {}; return { name: name, models: [fromModelName, toModelName], joinType: joinType, condition, properties, }; }, ); } public addProject(): void { this.manifest.schema = this.project.schema; this.manifest.catalog = this.project.catalog; const dataSource = this.buildDataSource(); if (dataSource) { this.manifest.dataSource = dataSource; } } protected addRelationColumn( modelName: string, columnData: { modelReferenceName: string; columnReferenceName: string; relation: string; }, ) { const model = this.manifest.models.find( (model: any) => model.name === modelName, ); if (!model) { logger.debug(`Can not find model "${modelName}" to add relation column`); return; } if (!model.columns) { model.columns = []; } // check if the modelReferenceName is already in the model column const modelNameDuplicated = model.columns.find( (column: any) => column.name === columnData.modelReferenceName, ); const column = { name: modelNameDuplicated ? `${columnData.modelReferenceName}_${columnData.columnReferenceName}` : columnData.modelReferenceName, type: columnData.modelReferenceName, properties: null, relationship: columnData.relation, isCalculated: false, notNull: false, }; model.columns.push(column); } protected getColumnExpression( column: ModelColumn, currentModel?: Partial, ): string { if (!column.isCalculated) { // columns existed in the data source. // Provide original column name in expression to MDL if referenceName has converted. if (column.sourceColumnName !== column.referenceName) { return `"${column.sourceColumnName}"`; } return ''; } // calculated field const lineage = JSON.parse(column.lineage) as number[]; // lineage = [relationId1, relationId2, ..., columnId] const fieldExpression = Object.entries(lineage).reduce( (acc, [index, id]) => { const isLast = parseInt(index) == lineage.length - 1; if (isLast) { // id is columnId const columnReferenceName = this.relatedColumns.find( (relatedColumn) => relatedColumn.id === id, )?.referenceName; acc.push(`\"${columnReferenceName}\"`); return acc; } // id is relationId const usedRelation = this.relatedRelations.find( (relatedRelation) => relatedRelation.id === id, ); const relationColumnName = currentModel!.columns.find( (c) => c.relationship === usedRelation.name, ).name; // move to next model const nextModelName = currentModel.name === usedRelation.fromModelName ? usedRelation.toModelName : usedRelation.fromModelName; const nextModel = this.manifest.models.find( (model) => model.name === nextModelName, ); currentModel = nextModel; acc.push(relationColumnName); return acc; }, [], ); return `${column.aggregation}(${fieldExpression.join('.')})`; } protected getRelationCondition(relation: RelationInfo): string { //TODO phase2: implement the expression for relation condition const { fromColumnName, toColumnName, fromModelName, toModelName } = relation; return `"${fromModelName}".${fromColumnName} = "${toModelName}".${toColumnName}`; } private buildTableReference(model: Model): TableReference | null { const modelProps = model.properties && typeof model.properties === 'string' ? JSON.parse(model.properties) : {}; if (!modelProps.table) { return null; } return { catalog: modelProps.catalog || null, schema: modelProps.schema || null, table: modelProps.table, }; } private postProcessManifest() { if (this.useRustWrenEngine()) { // 1. remove all the key that the value is null this.manifest.models = this.manifest.models?.map((model) => { model.columns.map((column) => { column.properties = pickBy( column.properties, (value) => value !== null, ); return column; }); return pickBy(model, (value) => value !== null); }); this.manifest.views = this.manifest.views?.map((view) => { return pickBy(view, (value) => value !== null); }); this.manifest.relationships = this.manifest.relationships?.map( (relationship) => { return pickBy(relationship, (value) => value !== null); }, ); this.manifest.enumDefinitions = this.manifest.enumDefinitions?.map( (enumDefinition) => { return pickBy(enumDefinition, (value) => value !== null); }, ); // 2. remove expression if it's empty string this.manifest.models?.forEach((model) => { model.columns?.forEach((column) => { if (column.expression === '') { delete column.expression; } }); }); } } private useRustWrenEngine(): boolean { return !!config.experimentalEngineRustVersion; } private buildDataSource(): WrenEngineDataSourceType { const type = this.project.type; if (!type) { return; } switch (type) { case DataSourceName.ATHENA: return WrenEngineDataSourceType.ATHENA; case DataSourceName.BIG_QUERY: return WrenEngineDataSourceType.BIGQUERY; case DataSourceName.DUCKDB: return WrenEngineDataSourceType.DUCKDB; case DataSourceName.POSTGRES: return WrenEngineDataSourceType.POSTGRES; case DataSourceName.MYSQL: return WrenEngineDataSourceType.MYSQL; case DataSourceName.ORACLE: return WrenEngineDataSourceType.ORACLE; case DataSourceName.MSSQL: return WrenEngineDataSourceType.MSSQL; case DataSourceName.CLICK_HOUSE: return WrenEngineDataSourceType.CLICKHOUSE; case DataSourceName.TRINO: return WrenEngineDataSourceType.TRINO; case DataSourceName.SNOWFLAKE: return WrenEngineDataSourceType.SNOWFLAKE; case DataSourceName.REDSHIFT: return WrenEngineDataSourceType.REDSHIFT; case DataSourceName.DATABRICKS: return WrenEngineDataSourceType.DATABRICKS; default: throw new Error( `Unsupported data source type: ${type} found when building manifest`, ); } } } ================================================ FILE: wren-ui/src/apollo/server/mdl/test/mdlBuilder.test.ts ================================================ import { DataSourceName } from '@server/types'; import { Model, Project, ModelColumn, ModelNestedColumn, RelationInfo, View, BIG_QUERY_CONNECTION_INFO, } from '../../repositories'; import { MDLBuilder, MDLBuilderBuildFromOptions } from '../mdlBuilder'; import { ModelMDL, RelationMDL, ViewMDL } from '../type'; describe('MDLBuilder', () => { let mdlBuilder: MDLBuilder; describe('build', () => { it('should return a manifest', () => { const builderOptions = { project: {}, models: [], columns: [], nestedColumns: [], relations: [], relatedModels: [], relatedColumns: [], relatedRelations: [], } as MDLBuilderBuildFromOptions; mdlBuilder = new MDLBuilder(builderOptions); const manifest = mdlBuilder.build(); expect(manifest).toBeDefined(); }); it('should return a manifest with models & columns & relations.', () => { // Arrange const project = { id: 1, type: DataSourceName.BIG_QUERY, displayName: 'my project', connectionInfo: { projectId: 'bq-project-id', datasetId: 'bq-project-id.my-dataset', credentials: 'my-credential', } as BIG_QUERY_CONNECTION_INFO, catalog: 'wrenai', schema: 'public', sampleDataset: null, } as Project; const models = [ { id: 1, projectId: 1, displayName: 'order', sourceTableName: 'order', referenceName: 'order', refSql: 'SELECT * FROM order', cached: false, refreshTime: null, properties: JSON.stringify({ description: 'foo table', schema: 'my-dataset', catalog: 'bq-project-id', table: 'order', }), }, { id: 2, projectId: 1, displayName: 'customer', sourceTableName: 'customer', referenceName: 'customer', refSql: 'SELECT * FROM customer', cached: false, refreshTime: null, properties: JSON.stringify({ schema: null, catalog: null, table: 'customer', }), }, ] as Model[]; const columns = [ { id: 1, modelId: 1, isCalculated: false, displayName: 'orderKey', referenceName: 'orderKey', sourceColumnName: 'orderKey', aggregation: null, lineage: null, customExpression: null, type: 'STRING', notNull: true, isPk: true, properties: JSON.stringify({ description: 'bar' }), }, { id: 2, modelId: 2, isCalculated: false, displayName: 'orderKey', referenceName: 'orderKey', sourceColumnName: 'orderKey', aggregation: null, lineage: null, customExpression: null, type: 'STRING', notNull: true, isPk: false, properties: null, }, { id: 3, modelId: 2, isCalculated: false, displayName: 'event_params', referenceName: 'event_params', sourceColumnName: 'event_params', aggregation: null, lineage: null, customExpression: null, type: 'ARRAY>', notNull: true, isPk: false, properties: null, }, ] as ModelColumn[]; const nestedColumns = [ { id: 1, modelId: 2, columnId: 3, columnPath: ['event_params', 'key'], displayName: 'event_params.key', referenceName: 'event_params.key', sourceColumnName: 'event_params.key', type: 'STRING', properties: { description: 'bar' }, }, ] as ModelNestedColumn[]; const relations = [ { id: 1, projectId: 1, name: 'OrderCustomer', fromColumnId: 1, toColumnId: 2, joinType: 'oneToMany', fromModelId: 1, fromModelName: 'order', fromColumnName: 'orderKey', toModelId: 2, toModelName: 'customer', toColumnName: 'orderKey', properties: JSON.stringify({ description: 'the relationship between orders and customers', }), }, ] as RelationInfo[]; const builderOptions = { project, models, columns, nestedColumns, relations, relatedModels: [], relatedColumns: [], relatedRelations: [], } as MDLBuilderBuildFromOptions; mdlBuilder = new MDLBuilder(builderOptions); // Act const manifest = mdlBuilder.build(); // Assert const expectedModels = [ { name: 'order', tableReference: { schema: 'my-dataset', catalog: 'bq-project-id', table: 'order', }, refSql: null, columns: [ { name: 'orderKey', expression: '', type: 'STRING', isCalculated: false, notNull: true, properties: { description: 'bar', displayName: 'orderKey' }, }, { name: 'customer', type: 'customer', isCalculated: false, relationship: 'OrderCustomer', properties: null, notNull: false, }, ], cached: false, refreshTime: null, primaryKey: 'orderKey', properties: { description: 'foo table', displayName: 'order', }, }, { name: 'customer', tableReference: { schema: null, catalog: null, table: 'customer', }, refSql: null, columns: [ { name: 'orderKey', expression: '', type: 'STRING', isCalculated: false, notNull: true, properties: { displayName: 'orderKey' }, }, { name: 'event_params', expression: '', type: 'ARRAY>', isCalculated: false, notNull: true, properties: { displayName: 'event_params', 'nestedDisplayName.event_params.key': 'event_params.key', 'nestedDescription.event_params.key': 'bar', }, }, { name: 'order', type: 'order', isCalculated: false, relationship: 'OrderCustomer', notNull: false, properties: null, }, ], primaryKey: '', cached: false, refreshTime: null, properties: { description: undefined, displayName: 'customer', }, }, ] as ModelMDL[]; const expectedRelationships = [ { name: 'OrderCustomer', models: ['order', 'customer'], joinType: 'oneToMany', condition: '"order".orderKey = "customer".orderKey', properties: { description: 'the relationship between orders and customers', }, }, ] as RelationMDL[]; expect(manifest.models).toEqual(expectedModels); expect(manifest.relationships).toEqual(expectedRelationships); }); }); it('should return a manifest with models & columns & nestedColumns & relations & views.', () => { // Arrange const project = { id: 1, type: DataSourceName.BIG_QUERY, displayName: 'my project', connectionInfo: { projectId: 'bq-project-id', datasetId: 'my-dataset', credentials: 'my-credential', } as BIG_QUERY_CONNECTION_INFO, catalog: 'wrenai', schema: 'public', sampleDataset: null, } as Project; const models = [ { id: 1, projectId: 1, displayName: 'order', sourceTableName: 'order', referenceName: 'order', refSql: 'SELECT * FROM order', cached: false, refreshTime: null, properties: JSON.stringify({ description: 'foo table', catalog: 'bq-project-id', schema: 'my-dataset', table: 'order', }), }, { id: 2, projectId: 1, displayName: 'customer', sourceTableName: 'customer', referenceName: 'customer', refSql: 'SELECT * FROM customer', cached: false, refreshTime: null, properties: JSON.stringify({ catalog: 'bq-project-id', schema: 'my-dataset', table: 'customer', }), }, ] as Model[]; const columns = [ { id: 1, modelId: 1, isCalculated: false, displayName: 'orderKey', referenceName: 'orderKey', sourceColumnName: 'orderKey', aggregation: null, lineage: null, customExpression: null, type: 'STRING', notNull: true, isPk: true, properties: JSON.stringify({ description: 'bar' }), }, { id: 2, modelId: 2, isCalculated: false, displayName: 'orderKey', referenceName: 'orderKey', sourceColumnName: 'orderKey', aggregation: null, lineage: null, customExpression: null, type: 'STRING', notNull: true, isPk: false, properties: null, }, { id: 3, modelId: 2, isCalculated: false, displayName: 'event_params', referenceName: 'event_params', sourceColumnName: 'event_params', aggregation: null, lineage: null, customExpression: null, type: 'ARRAY>', notNull: true, isPk: false, properties: null, }, ] as ModelColumn[]; const nestedColumns = [ { id: 1, modelId: 2, columnId: 3, columnPath: ['event_params', 'key'], displayName: 'event_params.key', referenceName: 'event_params.key', sourceColumnName: 'event_params.key', type: 'STRING', properties: { description: 'bar' }, }, ] as ModelNestedColumn[]; const relations = [ { id: 1, projectId: 1, name: 'OrderCustomer', fromColumnId: 1, toColumnId: 2, joinType: 'oneToMany', fromModelId: 1, fromModelName: 'order', fromColumnName: 'orderKey', toModelId: 2, toModelName: 'customer', toColumnName: 'orderKey', properties: JSON.stringify({ description: 'the relationship between orders and customers', }), }, ] as RelationInfo[]; const views = [ { id: 1, projectId: 1, name: 'view', statement: 'select * from order', cached: false, properties: JSON.stringify({ description: 'foo view', displayName: 'view', }), }, ] as View[]; const builderOptions = { project, models, views, columns, nestedColumns, relations, relatedModels: [], relatedColumns: [], relatedRelations: [], } as MDLBuilderBuildFromOptions; mdlBuilder = new MDLBuilder(builderOptions); // Act const manifest = mdlBuilder.build(); // Assert const expectedModels = [ { name: 'order', refSql: null, tableReference: { schema: 'my-dataset', catalog: 'bq-project-id', table: 'order', }, columns: [ { name: 'orderKey', expression: '', type: 'STRING', isCalculated: false, notNull: true, properties: { description: 'bar', displayName: 'orderKey' }, }, { name: 'customer', type: 'customer', isCalculated: false, relationship: 'OrderCustomer', notNull: false, properties: null, }, ], cached: false, refreshTime: null, primaryKey: 'orderKey', properties: { description: 'foo table', displayName: 'order' }, }, { name: 'customer', refSql: null, tableReference: { schema: 'my-dataset', catalog: 'bq-project-id', table: 'customer', }, columns: [ { name: 'orderKey', expression: '', type: 'STRING', isCalculated: false, notNull: true, properties: { displayName: 'orderKey' }, }, { name: 'event_params', expression: '', type: 'ARRAY>', isCalculated: false, notNull: true, properties: { displayName: 'event_params', 'nestedDisplayName.event_params.key': 'event_params.key', 'nestedDescription.event_params.key': 'bar', }, }, { name: 'order', type: 'order', isCalculated: false, relationship: 'OrderCustomer', notNull: false, properties: null, }, ], primaryKey: '', cached: false, refreshTime: null, properties: { description: undefined, displayName: 'customer' }, }, ] as ModelMDL[]; const expectedRelationships = [ { name: 'OrderCustomer', models: ['order', 'customer'], joinType: 'oneToMany', condition: '"order".orderKey = "customer".orderKey', properties: { description: 'the relationship between orders and customers', }, }, ] as RelationMDL[]; const expectedViews = [ { name: 'view', statement: 'select * from order', properties: { description: 'foo view', displayName: 'view', viewId: '1', }, }, ] as ViewMDL[]; expect(manifest.models).toEqual(expectedModels); expect(manifest.relationships).toEqual(expectedRelationships); expect(manifest.views).toEqual(expectedViews); }); it('should return correct expression in calculated field.', () => { const models = [ // customer model { id: 1, projectId: 1, displayName: 'customer', sourceTableName: 'customer', referenceName: 'customer', refSql: 'SELECT * FROM customer', cached: false, refreshTime: null, properties: null, }, // order model { id: 2, projectId: 1, displayName: 'order', sourceTableName: 'order', referenceName: 'order', refSql: 'SELECT * FROM order', cached: false, refreshTime: null, properties: null, }, // payment model { id: 3, projectId: 1, displayName: 'payment', sourceTableName: 'payment', referenceName: 'payment', refSql: 'SELECT * FROM payment', cached: false, refreshTime: null, properties: null, }, ] as Model[]; const columns = [ // customer columns: id, name, total_payment { id: 1, modelId: 1, isCalculated: false, displayName: 'id', referenceName: 'id', sourceColumnName: 'id', aggregation: null, lineage: null, customExpression: null, type: 'STRING', notNull: true, isPk: true, properties: null, }, { id: 2, modelId: 1, isCalculated: false, displayName: 'name', referenceName: 'name', sourceColumnName: 'name', aggregation: null, lineage: null, customExpression: null, type: 'STRING', notNull: true, isPk: false, properties: null, }, { id: 3, modelId: 1, isCalculated: true, displayName: 'total_payment', referenceName: 'total_payment', sourceColumnName: 'total_payment', aggregation: 'sum', lineage: JSON.stringify([1, 2, 8]), customExpression: null, type: 'FLOAT', notNull: true, isPk: false, properties: null, }, // order columns: id, customer_id, payment_id { id: 4, modelId: 2, isCalculated: false, displayName: 'id', referenceName: 'id', sourceColumnName: 'id', aggregation: null, lineage: null, customExpression: null, type: 'STRING', notNull: true, isPk: true, properties: null, }, { id: 5, modelId: 2, isCalculated: false, displayName: 'customer_id', referenceName: 'customer_id', sourceColumnName: 'customer_id', aggregation: null, lineage: null, customExpression: null, type: 'STRING', notNull: true, isPk: false, properties: null, }, { id: 6, modelId: 2, isCalculated: false, displayName: 'payment_id', referenceName: 'payment_id', sourceColumnName: 'payment_id', aggregation: null, lineage: null, customExpression: null, type: 'STRING', notNull: true, isPk: false, properties: null, }, // payment columns: id, amount { id: 7, modelId: 3, isCalculated: false, displayName: 'id', referenceName: 'id', sourceColumnName: 'id', aggregation: null, lineage: null, customExpression: null, type: 'STRING', notNull: true, isPk: true, properties: null, }, { id: 8, modelId: 3, isCalculated: false, displayName: 'amount', referenceName: 'amount', sourceColumnName: 'amount', aggregation: null, lineage: null, customExpression: null, type: 'FLOAT', notNull: true, isPk: false, properties: null, }, ] as ModelColumn[]; const relations = [ { id: 1, projectId: 1, name: 'OrderCustomer', joinType: 'ManyToOne', fromModelId: 2, fromModelName: 'order', fromColumnId: 5, fromColumnName: 'customer_id', toModelId: 1, toModelName: 'customer', toColumnId: 1, toColumnName: 'id', }, { id: 2, projectId: 1, name: 'OrderPayment', joinType: 'oneToMany', fromModelId: 2, fromModelName: 'order', fromColumnId: 6, fromColumnName: 'payment_id', toModelId: 3, toModelName: 'payment', toColumnId: 7, toColumnName: 'id', }, ]; const builderOptions = { project: { schema: 'public', catalog: 'wrenai', }, models, columns, relations, relatedModels: models, relatedColumns: columns, relatedRelations: relations, } as MDLBuilderBuildFromOptions; mdlBuilder = new MDLBuilder(builderOptions); const manifest = mdlBuilder.build(); const customerModel = manifest.models.find((m) => m.name === 'customer'); const totalPaymentColumn = customerModel.columns.find( (c) => c.name === 'total_payment', ); expect(totalPaymentColumn.expression).toEqual( 'sum(order.payment."amount")', ); }); it.each(Object.values(DataSourceName))( `should return correct data source type`, (type) => { const project = { id: 1, type, displayName: 'my project', connectionInfo: { projectId: 'bq-project-id', datasetId: 'bq-project-id.my-dataset', credentials: 'my-credential', } as BIG_QUERY_CONNECTION_INFO, catalog: 'wrenai', schema: 'public', sampleDataset: null, } as Project; const models = [] as Model[]; const columns = [] as ModelColumn[]; const nestedColumns = [] as ModelNestedColumn[]; const relations = [] as RelationInfo[]; const views = [] as View[]; const builderOptions = { project, models, columns, nestedColumns, relations, views, } as MDLBuilderBuildFromOptions; mdlBuilder = new MDLBuilder(builderOptions); const manifest = mdlBuilder.build(); expect(manifest.dataSource).toBeDefined(); expect(manifest.dataSource).not.toBeNull(); }, ); }); ================================================ FILE: wren-ui/src/apollo/server/mdl/type.ts ================================================ export interface ColumnMDL { name: string; // eg: "orderkey", "custkey", "orderstatus" type?: string; // eg: "integer", "string", "relationName" isCalculated: boolean; // eg: true, false notNull?: boolean; // eg: true, false relationship?: string; //eg: OrdersCustomer properties?: { description?: string; // eg: "the key of each order" displayName?: string; // eg: "Order Key" }; expression?: string; // eg: "SUM(orders.totalprice)" } export interface ModelMDL { name: string; // eg: "OrdersModel", "LineitemModel" refSql?: string; // eg: "select * from orders", "select * from lineitem" tableReference?: TableReference; columns?: ColumnMDL[]; primaryKey?: string; // eg: "orderkey", "custkey" cached: boolean; // eg true, false refreshTime?: string; // eg: "30.00m" properties?: { description?: string; // eg: "tpch tiny orders table" displayName?: string; // eg: "Orders" }; } export interface RelationMDL { name: string; // eg: "OrdersCustomer" models: string[]; // eg: ["OrdersModel", "CustomerModel"] joinType: string; // eg: "MANY_TO_ONE" condition: string; // eg: "OrdersModel.custkey = CustomerModel.custkey" manySideSortKeys?: { name: string; // eg: "orderkey" descending: boolean; // eg: false }[]; description?: string; // eg: "the relationship between orders and customers" properties?: { description?: string; // eg: "the relationship between orders and customers" }; } export interface EnumDefinition { name: string; // eg: "OrderStatus" values: { name: string; // eg: "PENDING", "PROCESSING" value: string; // eg: "pending", "processing" properties?: { description?: string; // eg: "pending" }; }[]; description?: string; // eg: "the status of an order" properties?: { description?: string; // eg: "the status of an order" }; } export interface ViewMDL { name: string; statement: string; properties?: { displayName?: string; description?: string; viewId?: string; question?: string; summary?: string; }; } export interface Manifest { catalog?: string; // eg: "test-catalog" schema?: string; // eg: "test-schema" dataSource?: WrenEngineDataSourceType; models?: Partial[]; // use partial since Rust version doesn't support null values, we need to remove all the null values relationships?: Partial[]; // use partial since Rust version doesn't support null values, we need to remove all the null values enumDefinitions?: Partial[]; // use partial since Rust version doesn't support null values, we need to remove all the null values views?: Partial[]; // use partial since Rust version doesn't support null values, we need to remove all the null values } export interface TableReference { schema?: string; catalog?: string; table: string; } export enum WrenEngineDataSourceType { ATHENA = 'ATHENA', BIGQUERY = 'BIGQUERY', CANNER = 'CANNER', CLICKHOUSE = 'CLICKHOUSE', MSSQL = 'MSSQL', ORACLE = 'ORACLE', MYSQL = 'MYSQL', POSTGRES = 'POSTGRES', SNOWFLAKE = 'SNOWFLAKE', TRINO = 'TRINO', DUCKDB = 'DUCKDB', REDSHIFT = 'REDSHIFT', DATABRICKS = 'DATABRICKS', // accepted by the wren engine, but not supported by the wren ui DATAFUSION = 'DATAFUSION', } ================================================ FILE: wren-ui/src/apollo/server/models/adaptor.ts ================================================ import * as Errors from '@server/utils/error'; import { Manifest } from '@server/mdl/type'; import { ThreadResponse } from '../repositories'; // Add branded types for SQL strings type Brand = T & { __brand: B }; export type DialectSQL = Brand; export type WrenSQL = Brand; export interface WrenAIError { code: Errors.GeneralErrorCodes; message: string; } export enum WrenAIDeployStatusEnum { SUCCESS = 'SUCCESS', FAILED = 'FAILED', } export interface WrenAIDeployResponse { status: WrenAIDeployStatusEnum; error?: string; } export enum WrenAISystemStatus { INDEXING = 'INDEXING', FINISHED = 'FINISHED', FAILED = 'FAILED', } export enum WrenAILanguage { EN = 'English', ES = 'Spanish', FR = 'French', ZH_TW = 'Traditional Chinese', ZH_CN = 'Simplified Chinese', DE = 'German', PT = 'Portuguese', RU = 'Russian', JA = 'Japanese', KO = 'Korean', IT = 'Italian', FA_IR = 'Persian', AR = 'Arabic', NL = 'Dutch', AZ_AZ = 'Azerbaijani', TR = 'Turkish', } export interface DeployData { manifest: Manifest; hash: string; } // ask export interface AskStep { summary: string; sql: string; cteName: string; } export interface AskHistory { sql: string; question: string; } export interface ProjectConfigurations { language?: string; timezone?: { name: string }; } export interface AskInput { query: string; deployId: string; histories?: ThreadResponse[]; configurations?: ProjectConfigurations; } export interface AsyncQueryResponse { queryId: string; } export enum AskResultStatus { UNDERSTANDING = 'UNDERSTANDING', SEARCHING = 'SEARCHING', PLANNING = 'PLANNING', GENERATING = 'GENERATING', CORRECTING = 'CORRECTING', FINISHED = 'FINISHED', FAILED = 'FAILED', STOPPED = 'STOPPED', } export enum AskResultType { GENERAL = 'GENERAL', TEXT_TO_SQL = 'TEXT_TO_SQL', MISLEADING_QUERY = 'MISLEADING_QUERY', } // if it's view, viewId will be returned as well. It means the candidate is originally saved in mdl as a view. // if it's llm, viewId will not be returned. It means the candidate is generated by AI service. // if it's sql_pair, sqlpairId will be returned as well. It means the candidate is generated by sql_pair. export enum AskCandidateType { VIEW = 'VIEW', LLM = 'LLM', SQL_PAIR = 'SQL_PAIR', } export interface AskResponse { type: AskResultType | null; status: S; response: R | null; error: WrenAIError | null; } export interface AskDetailInput { query: string; sql: string; configurations?: ProjectConfigurations; } export type AskDetailResult = AskResponse< { description: string; steps: AskStep[]; }, AskResultStatus >; export type AskResult = AskResponse< Array<{ type: AskCandidateType; sql: string; viewId?: number | null; sqlpairId?: number | null; }>, AskResultStatus > & { rephrasedQuestion?: string; intentReasoning?: string; sqlGenerationReasoning?: string; retrievedTables?: string[]; invalidSql?: string; traceId?: string; }; export enum RecommendationQuestionStatus { GENERATING = 'GENERATING', FINISHED = 'FINISHED', FAILED = 'FAILED', } export type RecommendationQuestionsInput = { // JSON string of the MDL (Model Definition Language) manifest: Manifest; // Optional list of previous questions previousQuestions?: string[]; // Optional project ID projectId?: string; // Optional max number of questions to generate (default: 5) maxQuestions?: number; // Optional max number of categories (default: 3) maxCategories?: number; regenerate?: boolean; // Optional regenerate questions (default: false) // Optional configuration settings configuration?: ProjectConfigurations; }; export type RecommendationQuestion = { question: string; category: string; // category for the question sql: string; // validated sql for this question, can be used in generateAskDetail }; export type RecommendationQuestionsResult = AskResponse< { questions: RecommendationQuestion[]; }, RecommendationQuestionStatus >; // text-based answer export interface TextBasedAnswerInput { query: string; sql: string; sqlData: any; threadId?: string; userId?: string; configurations?: ProjectConfigurations; } export enum TextBasedAnswerStatus { PREPROCESSING = 'PREPROCESSING', SUCCEEDED = 'SUCCEEDED', FAILED = 'FAILED', } export interface TextBasedAnswerResult { status: TextBasedAnswerStatus; numRowsUsedInLLM?: number; error?: WrenAIError; } export enum ChartStatus { FETCHING = 'FETCHING', GENERATING = 'GENERATING', FINISHED = 'FINISHED', FAILED = 'FAILED', STOPPED = 'STOPPED', } export enum ChartType { BAR = 'bar', GROUPED_BAR = 'grouped_bar', STACKED_BAR = 'stacked_bar', LINE = 'line', MULTI_LINE = 'multi_line', PIE = 'pie', AREA = 'area', } export interface ChartInput { query: string; sql: string; projectId?: string; configurations?: ProjectConfigurations; } export interface ChartAdjustmentOption { chartType: ChartType; xAxis?: string; yAxis?: string; xOffset?: string; color?: string; theta?: string; } export interface ChartAdjustmentInput { query: string; sql: string; adjustmentOption: ChartAdjustmentOption; chartSchema: Record; projectId?: string; configurations?: ProjectConfigurations; } export interface ChartResponse { reasoning: string; chartType: ChartType; chartSchema: Record; } export interface ChartResult { status: ChartStatus; response?: ChartResponse; error?: WrenAIError; } export enum SqlPairStatus { INDEXING = 'INDEXING', FINISHED = 'FINISHED', FAILED = 'FAILED', } export interface SqlPairResult { status: SqlPairStatus; error?: WrenAIError; } export interface QuestionInput { sqls: string[]; projectId: number; configurations?: ProjectConfigurations; } export enum QuestionsStatus { GENERATING = 'GENERATING', SUCCEEDED = 'SUCCEEDED', FAILED = 'FAILED', } export interface QuestionsResult { status: QuestionsStatus; error?: WrenAIError; questions?: string[]; trace_id?: string; } export interface GenerateInstructionInput { id: number; projectId: number; instruction: string; questions: string[]; isDefault: boolean; } export enum InstructionStatus { INDEXING = 'INDEXING', FINISHED = 'FINISHED', FAILED = 'FAILED', } export interface InstructionResult { status: InstructionStatus; error?: WrenAIError; } // ask feedback export interface AskFeedbackInput { question: string; tables: string[]; sqlGenerationReasoning: string; sql: string; projectId: number; configurations?: ProjectConfigurations; } export enum AskFeedbackStatus { UNDERSTANDING = 'UNDERSTANDING', GENERATING = 'GENERATING', CORRECTING = 'CORRECTING', FINISHED = 'FINISHED', FAILED = 'FAILED', STOPPED = 'STOPPED', } export interface AskFeedbackResult { status: AskFeedbackStatus; error?: WrenAIError; response: Array<{ type: AskCandidateType.LLM; sql: string; }>; traceId?: string; invalidSql?: string; } ================================================ FILE: wren-ui/src/apollo/server/models/dashboard.ts ================================================ import { DashboardItem } from '@server/repositories'; export interface PreviewItemResponse { data: Record[]; cacheHit: boolean; cacheCreatedAt: string | null; cacheOverrodeAt: string | null; override: boolean; } export enum ScheduleFrequencyEnum { WEEKLY = 'WEEKLY', DAILY = 'DAILY', CUSTOM = 'CUSTOM', NEVER = 'NEVER', } export enum CacheScheduleDayEnum { SUN = 'SUN', MON = 'MON', TUE = 'TUE', WED = 'WED', THU = 'THU', FRI = 'FRI', SAT = 'SAT', } export interface DashboardSchedule { frequency: ScheduleFrequencyEnum; timezone: string; day: CacheScheduleDayEnum; hour: number; minute: number; cron: string; } export interface SetDashboardCacheData { cacheEnabled: boolean; schedule: DashboardSchedule | null; } export interface DetailedDashboard { id: number; projectId: number; name: string; cacheEnabled: boolean; scheduleFrequency: ScheduleFrequencyEnum | null; timezone: string | null; // e.g. 'America/New_York', 'Asia/Taipei' scheduleCron: string | null; // cron expression string nextScheduledAt: string | null; // Next scheduled run timestamp items: DashboardItem[]; } export const DAYS = [ CacheScheduleDayEnum.SUN, CacheScheduleDayEnum.MON, CacheScheduleDayEnum.TUE, CacheScheduleDayEnum.WED, CacheScheduleDayEnum.THU, CacheScheduleDayEnum.FRI, CacheScheduleDayEnum.SAT, ]; ================================================ FILE: wren-ui/src/apollo/server/models/index.ts ================================================ export * from './model'; export * from './instruction'; export * from './adaptor'; export * from './dashboard'; ================================================ FILE: wren-ui/src/apollo/server/models/instruction.ts ================================================ export interface InstructionInput { projectId: number; instruction: string; questions: string[]; isDefault: boolean; } export interface UpdateInstructionInput { id: number; projectId: number; instruction: string; questions: string[]; isDefault: boolean; } ================================================ FILE: wren-ui/src/apollo/server/models/model.ts ================================================ export interface CreateModelData { sourceTableName: string; fields: [string]; primaryKey: string; } export interface UpdateModelData { fields: [string]; primaryKey: string; } export interface NestedColumnMetadataInput { id: number; displayName: string; description: string; } export interface ColumnMetadataInput { id: number; displayName: string; description: string; } export interface CalculatedFieldMetadataInput { id: number; description: string; } export interface RelationshipMetadataInput { id: number; description: string; } export interface ViewColumnMetadataInput { referenceName: string; description: string; } export interface UpdateModelMetadataInput { displayName: string; description: string; columns: Array; nestedColumns: Array; calculatedFields: Array; relationships: Array; } export interface UpdateViewMetadataInput { displayName: string; description: string; columns: Array; } export enum ExpressionName { ABS = 'ABS', AVG = 'AVG', COUNT = 'COUNT', MAX = 'MAX', MIN = 'MIN', SUM = 'SUM', CBRT = 'CBRT', CEIL = 'CEIL', EXP = 'EXP', FLOOR = 'FLOOR', LN = 'LN', LOG10 = 'LOG10', ROUND = 'ROUND', SIGN = 'SIGN', LENGTH = 'LENGTH', REVERSE = 'REVERSE', } export interface CreateCalculatedFieldData { modelId: number; name: string; //displayName expression: ExpressionName; lineage: number[]; } export interface UpdateCalculatedFieldData { name: string; //displayName expression: ExpressionName; lineage: number[]; } export interface CheckCalculatedFieldCanQueryData { referenceName: string; expression: ExpressionName; lineage: number[]; } export interface PreviewSQLData { sql: string; projectId?: string; limit?: number; dryRun?: boolean; } ================================================ FILE: wren-ui/src/apollo/server/repositories/apiHistoryRepository.ts ================================================ import { camelCase, isPlainObject, mapKeys, mapValues, snakeCase, } from 'lodash'; import { BaseRepository, IBasicRepository } from './baseRepository'; import { Knex } from 'knex'; export enum ApiType { GENERATE_SQL = 'GENERATE_SQL', RUN_SQL = 'RUN_SQL', GENERATE_VEGA_CHART = 'GENERATE_VEGA_CHART', GENERATE_SUMMARY = 'GENERATE_SUMMARY', ASK = 'ASK', GET_INSTRUCTIONS = 'GET_INSTRUCTIONS', CREATE_INSTRUCTION = 'CREATE_INSTRUCTION', UPDATE_INSTRUCTION = 'UPDATE_INSTRUCTION', DELETE_INSTRUCTION = 'DELETE_INSTRUCTION', GET_SQL_PAIRS = 'GET_SQL_PAIRS', CREATE_SQL_PAIR = 'CREATE_SQL_PAIR', UPDATE_SQL_PAIR = 'UPDATE_SQL_PAIR', DELETE_SQL_PAIR = 'DELETE_SQL_PAIR', GET_MODELS = 'GET_MODELS', STREAM_ASK = 'STREAM_ASK', STREAM_GENERATE_SQL = 'STREAM_GENERATE_SQL', } export interface ApiHistory { id?: string; projectId: number; apiType: ApiType; threadId?: string; headers?: Record; requestPayload?: Record; responsePayload?: Record; statusCode?: number; durationMs?: number; createdAt?: string; updatedAt?: string; } export interface PaginationOptions { offset: number; limit: number; orderBy?: Record; } export interface IApiHistoryRepository extends IBasicRepository { count( filter?: Partial, dateFilter?: { startDate?: Date; endDate?: Date }, ): Promise; findAllWithPagination( filter?: Partial, dateFilter?: { startDate?: Date; endDate?: Date }, pagination?: PaginationOptions, ): Promise; } export class ApiHistoryRepository extends BaseRepository implements IApiHistoryRepository { private readonly jsonbColumns = [ 'headers', 'requestPayload', 'responsePayload', ]; constructor(knexPg: Knex) { super({ knexPg, tableName: 'api_history' }); } /** * Count API history records with filtering */ public async count( filter?: Partial, dateFilter?: { startDate?: Date; endDate?: Date }, ): Promise { let query = this.knex(this.tableName).count('id as count'); if (filter) { query = query.where(this.transformToDBData(filter)); } if (dateFilter) { if (dateFilter.startDate) { query = query.where('created_at', '>=', dateFilter.startDate); } if (dateFilter.endDate) { query = query.where('created_at', '<=', dateFilter.endDate); } } const result = await query; return parseInt(result[0].count as string, 10); } /** * Find API history records with pagination */ public async findAllWithPagination( filter?: Partial, dateFilter?: { startDate?: Date; endDate?: Date }, pagination?: PaginationOptions, ): Promise { let query = this.knex(this.tableName).select('*'); if (filter) { query = query.where(this.transformToDBData(filter)); } if (dateFilter) { if (dateFilter.startDate) { query = query.where('created_at', '>=', dateFilter.startDate); } if (dateFilter.endDate) { query = query.where('created_at', '<=', dateFilter.endDate); } } if (pagination) { if (pagination.orderBy) { Object.entries(pagination.orderBy).forEach(([field, direction]) => { query = query.orderBy(this.camelToSnakeCase(field), direction); }); } else { // Default sort by created_at desc query = query.orderBy('created_at', 'desc'); } query = query.offset(pagination.offset).limit(pagination.limit); } const result = await query; return result.map(this.transformFromDBData); } protected override transformFromDBData = (data: any): ApiHistory => { if (!isPlainObject(data)) { throw new Error('Unexpected dbdata'); } const camelCaseData = mapKeys(data, (_value, key) => camelCase(key)); const formattedData = mapValues(camelCaseData, (value, key) => { if (this.jsonbColumns.includes(key)) { // The value from Sqlite will be string type, while the value from PG is JSON object if (typeof value === 'string') { if (!value) return value; try { return JSON.parse(value); } catch (error) { console.error(`Failed to parse JSON for ${key}:`, error); return value; // Return raw value if parsing fails } } else { return value; } } return value; }) as ApiHistory; return formattedData; }; protected override transformToDBData = (data: any) => { if (!isPlainObject(data)) { throw new Error('Unexpected dbdata'); } const transformedData = mapValues(data, (value, key) => { if (this.jsonbColumns.includes(key)) { return JSON.stringify(value); } else { return value; } }); return mapKeys(transformedData, (_value, key) => snakeCase(key)); }; /** * Convert camelCase to snake_case for DB column names */ private camelToSnakeCase(str: string): string { return str.replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`); } } ================================================ FILE: wren-ui/src/apollo/server/repositories/askingTaskRepository.ts ================================================ import { Knex } from 'knex'; import { BaseRepository, IBasicRepository } from './baseRepository'; import { camelCase, isPlainObject, mapKeys, mapValues, snakeCase, } from 'lodash'; import { AskFeedbackResult, AskResult } from '../models/adaptor'; export type AskingTaskDetail = | AskResult | (AskFeedbackResult & { adjustment?: boolean; }); export interface AskingTask { id: number; queryId: string; question?: string; detail?: AskingTaskDetail; threadId?: number; threadResponseId?: number; createdAt: Date; updatedAt: Date; } export interface IAskingTaskRepository extends IBasicRepository { findByQueryId(queryId: string): Promise; } export class AskingTaskRepository extends BaseRepository implements IAskingTaskRepository { private readonly jsonbColumns = ['detail']; constructor(knexPg: Knex) { super({ knexPg, tableName: 'asking_task' }); } public async findByQueryId(queryId: string): Promise { return this.findOneBy({ queryId }); } protected override transformFromDBData = (data: any) => { if (!isPlainObject(data)) { throw new Error('Unexpected dbdata'); } const camelCaseData = mapKeys(data, (_value, key) => camelCase(key)); const transformData = mapValues(camelCaseData, (value, key) => { if (this.jsonbColumns.includes(key)) { if (typeof value === 'string') { return value ? JSON.parse(value) : value; } return value; } return value; }); return transformData as AskingTask; }; protected override transformToDBData = (data: any) => { if (!isPlainObject(data)) { throw new Error('Unexpected dbdata'); } const transformedData = mapValues(data, (value, key) => { if (this.jsonbColumns.includes(key)) { return JSON.stringify(value); } else { return value; } }); return mapKeys(transformedData, (_value, key) => snakeCase(key)); }; } ================================================ FILE: wren-ui/src/apollo/server/repositories/baseRepository.ts ================================================ import { Knex } from 'knex'; import { camelCase, isPlainObject, mapKeys, snakeCase } from 'lodash'; export interface IQueryOptions { tx?: Knex.Transaction; order?: string; limit?: number; } export interface IBasicRepository { transaction: () => Promise; commit: (tx: Knex.Transaction) => Promise; rollback: (tx: Knex.Transaction) => Promise; findOneBy: ( filter: Partial, queryOptions?: IQueryOptions, ) => Promise; findAllBy: (filter: Partial, queryOptions?: IQueryOptions) => Promise; findAll: (queryOptions?: IQueryOptions) => Promise; createOne: (data: Partial, queryOptions?: IQueryOptions) => Promise; createMany: ( data: Partial[], queryOptions?: IQueryOptions, ) => Promise; updateOne: ( id: string | number, data: Partial, queryOptions?: IQueryOptions, ) => Promise; deleteOne: ( id: string | number, queryOptions?: IQueryOptions, ) => Promise; deleteMany: ( ids: (string | number)[], queryOptions?: IQueryOptions, ) => Promise; deleteAllBy: ( where: Partial, queryOptions?: IQueryOptions, ) => Promise; } export class BaseRepository implements IBasicRepository { protected knex: Knex; protected tableName: string; constructor({ knexPg, tableName }: { knexPg: Knex; tableName: string }) { this.knex = knexPg; this.tableName = tableName; } public async transaction() { return await this.knex.transaction(); } public async commit(tx: Knex.Transaction) { await tx.commit(); } public async rollback(tx: Knex.Transaction) { await tx.rollback(); } public async findOneBy(filter: Partial, queryOptions?: IQueryOptions) { const executer = queryOptions?.tx ? queryOptions.tx : this.knex; const query = executer(this.tableName).where( this.transformToDBData(filter), ); if (queryOptions?.limit) { query.limit(queryOptions.limit); } const result = await query; return result && result.length > 0 ? this.transformFromDBData(result[0]) : null; } public async findAllBy(filter: Partial, queryOptions?: IQueryOptions) { const executer = queryOptions?.tx ? queryOptions.tx : this.knex; // format filter keys to snake_case const query = executer(this.tableName).where( this.transformToDBData(filter), ); if (queryOptions?.order) { query.orderBy(queryOptions.order); } const result = await query; return result.map(this.transformFromDBData); } public async findAll(queryOptions?: IQueryOptions) { const executer = queryOptions?.tx ? queryOptions.tx : this.knex; const query = executer(this.tableName); if (queryOptions?.order) { query.orderBy(queryOptions.order); } if (queryOptions?.limit) { query.limit(queryOptions.limit); } const result = await query; return result.map(this.transformFromDBData); } public async createOne(data: Partial, queryOptions?: IQueryOptions) { const executer = queryOptions?.tx ? queryOptions.tx : this.knex; const [result] = await executer(this.tableName) .insert(this.transformToDBData(data)) .returning('*'); return this.transformFromDBData(result); } public async createMany(data: Partial[], queryOptions?: IQueryOptions) { const executer = queryOptions?.tx ? queryOptions.tx : this.knex; const batchSize = 100; const batchCount = Math.ceil(data.length / batchSize); const result = []; for (let i = 0; i < batchCount; i++) { const start = i * batchSize; const end = Math.min((i + 1) * batchSize, data.length); const batchValues = data.slice(start, end); const chunk = await executer(this.tableName) .insert(batchValues.map(this.transformToDBData)) .returning('*'); result.push(...chunk); } return result.map((data) => this.transformFromDBData(data)); } public async updateOne( id: string | number, data: Partial, queryOptions?: IQueryOptions, ) { const executer = queryOptions?.tx ? queryOptions.tx : this.knex; const [result] = await executer(this.tableName) .where({ id }) .update(this.transformToDBData(data)) .returning('*'); return this.transformFromDBData(result); } public async deleteOne(id: string, queryOptions?: IQueryOptions) { const executer = queryOptions?.tx ? queryOptions.tx : this.knex; const builder = executer.from(this.tableName).where({ id }).delete(); return await builder; } public async deleteMany( ids: (string | number)[], queryOptions?: IQueryOptions, ) { const executer = queryOptions?.tx ? queryOptions.tx : this.knex; const builder = executer.from(this.tableName).whereIn('id', ids).delete(); return await builder; } public deleteAllBy = async ( where: Partial, queryOptions?: IQueryOptions, ) => { const executer = queryOptions?.tx ? queryOptions.tx : this.knex; const builder = executer(this.tableName) .where(this.transformToDBData(where)) .delete(); return await builder; }; protected transformToDBData = (data: Partial) => { if (!isPlainObject(data)) { throw new Error('Unexpected dbdata'); } return mapKeys(data, (_value, key) => snakeCase(key)); }; protected transformFromDBData = (data: any): T => { if (!isPlainObject(data)) { throw new Error('Unexpected dbdata'); } const camelCaseData = mapKeys(data, (_value, key) => camelCase(key)); return camelCaseData as T; }; } ================================================ FILE: wren-ui/src/apollo/server/repositories/dashboardItemRefreshJobRepository.ts ================================================ import { Knex } from 'knex'; import { BaseRepository, IBasicRepository } from './baseRepository'; export enum DashboardCacheRefreshStatus { IN_PROGRESS = 'in_progress', SUCCESS = 'success', FAILED = 'failed', } export interface DashboardItemRefreshJob { id: number; hash: string; dashboardId: number; dashboardItemId: number; startedAt: Date; finishedAt: Date | null; status: DashboardCacheRefreshStatus; errorMessage: string | null; createdAt: Date; updatedAt: Date; } export interface IDashboardItemRefreshJobRepository extends IBasicRepository {} export class DashboardItemRefreshJobRepository extends BaseRepository implements IDashboardItemRefreshJobRepository { constructor(knexPg: Knex) { super({ knexPg, tableName: 'dashboard_item_refresh_job' }); } } ================================================ FILE: wren-ui/src/apollo/server/repositories/dashboardItemRepository.ts ================================================ import { Knex } from 'knex'; import { BaseRepository, IBasicRepository } from './baseRepository'; import { camelCase, isPlainObject, mapKeys, mapValues, snakeCase, } from 'lodash'; export enum DashboardItemType { // AI chart types, refer to ChartType in adaptor.ts AREA = 'AREA', BAR = 'BAR', GROUPED_BAR = 'GROUPED_BAR', LINE = 'LINE', PIE = 'PIE', STACKED_BAR = 'STACKED_BAR', // other types TABLE = 'TABLE', NUMBER = 'NUMBER', } export interface DashboardItemLayout { x: number; y: number; w: number; h: number; } export interface DashboardItemDetail { sql: string; chartSchema?: Record; } export interface DashboardItem { id: number; dashboardId: number; type: DashboardItemType; layout: DashboardItemLayout; detail: DashboardItemDetail; displayName?: string; } export interface IDashboardItemRepository extends IBasicRepository {} export class DashboardItemRepository extends BaseRepository implements IDashboardItemRepository { private readonly jsonbColumns = ['layout', 'detail']; constructor(knexPg: Knex) { super({ knexPg, tableName: 'dashboard_item' }); } protected override transformFromDBData = (data: any) => { if (!isPlainObject(data)) { throw new Error('Unexpected dbdata'); } const camelCaseData = mapKeys(data, (_value, key) => camelCase(key)); const transformData = mapValues(camelCaseData, (value, key) => { if (this.jsonbColumns.includes(key)) { if (typeof value === 'string') { return value ? JSON.parse(value) : value; } else { return value; } } return value; }); return transformData as DashboardItem; }; protected override transformToDBData = (data: any) => { if (!isPlainObject(data)) { throw new Error('Unexpected dbdata'); } const transformedData = mapValues(data, (value, key) => { if (this.jsonbColumns.includes(key)) { return JSON.stringify(value); } else { return value; } }); return mapKeys(transformedData, (_value, key) => snakeCase(key)); }; } ================================================ FILE: wren-ui/src/apollo/server/repositories/dashboardRepository.ts ================================================ import { Knex } from 'knex'; import { BaseRepository, IBasicRepository } from './baseRepository'; import { ScheduleFrequencyEnum } from '@server/models/dashboard'; export interface Dashboard { id: number; projectId: number; name: string; cacheEnabled: boolean; scheduleFrequency: ScheduleFrequencyEnum | null; scheduleTimezone: string | null; // e.g. 'America/New_York', 'Asia/Taipei' scheduleCron: string | null; // cron expression string nextScheduledAt: Date | null; // Next scheduled run timestamp } export interface IDashboardRepository extends IBasicRepository {} export class DashboardRepository extends BaseRepository implements IDashboardRepository { constructor(knexPg: Knex) { super({ knexPg, tableName: 'dashboard' }); } } ================================================ FILE: wren-ui/src/apollo/server/repositories/deployLogRepository.ts ================================================ import { Knex } from 'knex'; import { BaseRepository, IBasicRepository } from './baseRepository'; import { camelCase, isPlainObject, mapKeys, mapValues } from 'lodash'; export interface Deploy { id: number; // ID projectId: number; // Reference to project.id manifest: object; // Model manifest hash: string; status: string; // Deploy status error: string; // Error message } export enum DeployStatusEnum { IN_PROGRESS = 'IN_PROGRESS', SUCCESS = 'SUCCESS', FAILED = 'FAILED', } export interface IDeployLogRepository extends IBasicRepository { findLastProjectDeployLog(projectId: number): Promise; findInProgressProjectDeployLog(projectId: number): Promise; } export class DeployLogRepository extends BaseRepository implements IDeployLogRepository { constructor(knexPg: Knex) { super({ knexPg, tableName: 'deploy_log' }); } public async findLastProjectDeployLog(projectId: number) { const res = await this.knex .select('*') .from(this.tableName) .where( this.transformToDBData({ projectId, status: DeployStatusEnum.SUCCESS }), ) .orderBy('created_at', 'desc') .first(); return (res && this.transformFromDBData(res)) || null; } public async findInProgressProjectDeployLog(projectId: number) { const res = await this.knex .select('*') .from(this.tableName) .where( this.transformToDBData({ projectId, status: DeployStatusEnum.IN_PROGRESS, }), ) .orderBy('created_at', 'desc') .first(); return (res && this.transformFromDBData(res)) || null; } public override transformFromDBData: (data: any) => Deploy = (data: any) => { if (!isPlainObject(data)) { throw new Error('Unexpected dbdata'); } const camelCaseData = mapKeys(data, (_value, key) => camelCase(key)); const formattedData = mapValues(camelCaseData, (value, key) => { if (['manifest'].includes(key)) { // sqlite return a string for json field, but postgres return an object return typeof value === 'string' ? JSON.parse(value) : value; } return value; }); return formattedData as Deploy; }; } ================================================ FILE: wren-ui/src/apollo/server/repositories/index.ts ================================================ export * from './baseRepository'; export * from './learningRepository'; export * from './modelRepository'; export * from './projectRepository'; export * from './modelColumnRepository'; export * from './modelNestedColumnRepository'; export * from './relationshipRepository'; export * from './metricsRepository'; export * from './metricsMeasureRepository'; export * from './deployLogRepository'; export * from './viewRepository'; export * from './threadRepository'; export * from './threadResponseRepository'; export * from './schemaChangeRepository'; export * from './dashboardRepository'; export * from './dashboardItemRepository'; export * from './sqlPairRepository'; export * from './askingTaskRepository'; export * from './instructionRepository'; export * from './apiHistoryRepository'; export * from './dashboardItemRefreshJobRepository'; ================================================ FILE: wren-ui/src/apollo/server/repositories/instructionRepository.ts ================================================ import { Knex } from 'knex'; import { BaseRepository, IBasicRepository } from './baseRepository'; import { camelCase, isPlainObject, mapKeys, mapValues, snakeCase, } from 'lodash'; export interface Instruction { id: number; projectId: number; instruction: string; questions: string[]; isDefault: boolean; createdAt: string; updatedAt: string; } export interface IInstructionRepository extends IBasicRepository {} export class InstructionRepository extends BaseRepository implements IInstructionRepository { private readonly jsonbColumns = ['questions']; constructor(knexPg: Knex) { super({ knexPg, tableName: 'instruction' }); } protected override transformFromDBData = (data: any) => { if (!isPlainObject(data)) { throw new Error('Unexpected dbdata'); } const camelCaseData = mapKeys(data, (_value, key) => camelCase(key)); const transformData = mapValues(camelCaseData, (value, key) => { if (this.jsonbColumns.includes(key)) { if (typeof value === 'string') { return value ? JSON.parse(value) : value; } else { return value; } } return value; }); return transformData as Instruction; }; protected override transformToDBData = (data: any) => { if (!isPlainObject(data)) { throw new Error('Unexpected dbdata'); } const transformedData = mapValues(data, (value, key) => { if (this.jsonbColumns.includes(key)) { return JSON.stringify(value); } else { return value; } }); return mapKeys(transformedData, (_value, key) => snakeCase(key)); }; } ================================================ FILE: wren-ui/src/apollo/server/repositories/learningRepository.ts ================================================ import { Knex } from 'knex'; import { BaseRepository, IBasicRepository } from './baseRepository'; import { camelCase, isPlainObject, mapKeys, mapValues, snakeCase, } from 'lodash'; export interface Learning { id: number; // ID userId: string; // Reference to config userUUID paths: string[]; // The learning paths, array of learning stories } export interface ILearningRepository extends IBasicRepository {} export class LearningRepository extends BaseRepository implements ILearningRepository { constructor(knexPg: Knex) { super({ knexPg, tableName: 'learning' }); } protected override transformToDBData = (data: any) => { if (!isPlainObject(data)) { throw new Error('Unexpected dbdata'); } const transformedData = mapValues(data, (value, key) => { if (['paths'].includes(key)) { return value ? JSON.stringify(value) : null; } return value; }); return mapKeys(transformedData, (_value, key) => snakeCase(key)); }; protected override transformFromDBData = (data: any): Learning => { if (!isPlainObject(data)) { throw new Error('Unexpected dbdata'); } const camelCaseData = mapKeys(data, (_value, key) => camelCase(key)); const formattedData = mapValues(camelCaseData, (value, key) => { if (['paths'].includes(key)) { // The value from Sqlite will be string type, while the value from PG is JSON object if (typeof value === 'string') { return value ? JSON.parse(value) : value; } else { return value; } } return value; }) as Learning; return formattedData; }; } ================================================ FILE: wren-ui/src/apollo/server/repositories/metricsMeasureRepository.ts ================================================ import { Knex } from 'knex'; import { BaseRepository, IBasicRepository } from './baseRepository'; export interface MetricMeasure { id: number; // ID metricId: number; // Reference to metric ID name: string; // Measure name expression: string; // Expression for the measure granularity?: string; // Granularity for the measure, eg: "day", "hour", "minute", "year" } export interface IMetricMeasureRepository extends IBasicRepository {} export class MetricMeasureRepository extends BaseRepository implements IMetricMeasureRepository { constructor(knexPg: Knex) { super({ knexPg, tableName: 'metric_measure' }); } } ================================================ FILE: wren-ui/src/apollo/server/repositories/metricsRepository.ts ================================================ import { Knex } from 'knex'; import { BaseRepository, IBasicRepository } from './baseRepository'; export interface Metric { id: number; // ID projectId: number; // Reference to project.id name: string; // Metric name type: string; // Metric type, ex: "simple" or "cumulative" cached: boolean; // Model is cached or not refreshTime?: string; // Contain a number followed by a time unit (ns, us, ms, s, m, h, d). For example, "2h" // metric can based on model or another metric modelId?: number; // Reference to model.id metricId?: number; // Reference to metric.id properties?: string; // Metric properties, a json string, the description and displayName should be stored here } export interface IMetricRepository extends IBasicRepository {} export class MetricRepository extends BaseRepository implements IMetricRepository { constructor(knexPg: Knex) { super({ knexPg, tableName: 'metric' }); } } ================================================ FILE: wren-ui/src/apollo/server/repositories/modelColumnRepository.ts ================================================ import { Knex } from 'knex'; import { BaseRepository, IBasicRepository, IQueryOptions, } from './baseRepository'; export interface ModelColumn { id: number; // ID modelId: number; // Reference to model ID isCalculated: boolean; // Is calculated field displayName: string; // Column name displayed in UI referenceName: string; // The name used in the MDL structure and when querying the data sourceColumnName: string; // The column name in the datasource aggregation?: string; // Expression for the column, could be custom field or calculated field expression lineage?: string; // The selected field in calculated field, array of ids customExpression?: string; // For custom field or custom expression of calculated field type: string; // Data type, refer to the column type in the datasource notNull: boolean; // Is not null isPk: boolean; // Is primary key of the table properties?: string; // Column properties, a json string, the description and displayName should be stored here } export interface IModelColumnRepository extends IBasicRepository { findColumnsByModelIds( modelIds: number[], queryOptions?: IQueryOptions, ): Promise; findColumnsByIds( ids: number[], queryOptions?: IQueryOptions, ): Promise; deleteByModelIds( modelIds: number[], queryOptions?: IQueryOptions, ): Promise; resetModelPrimaryKey(modelId: number): Promise; setModelPrimaryKey(modelId: number, sourceColumnName: string): Promise; deleteAllBySourceColumnNames( modelId: number, sourceColumnNames: string[], queryOptions?: IQueryOptions, ): Promise; deleteAllByColumnIds( columnIds: number[], queryOptions?: IQueryOptions, ): Promise; } export class ModelColumnRepository extends BaseRepository implements IModelColumnRepository { constructor(knexPg: Knex) { super({ knexPg, tableName: 'model_column' }); } public async findColumnsByModelIds(modelIds, queryOptions?: IQueryOptions) { if (queryOptions && queryOptions.tx) { const { tx } = queryOptions; const result = await tx(this.tableName) .whereIn('model_id', modelIds) .select('*'); return result.map((r) => this.transformFromDBData(r)); } const result = await this.knex('model_column') .whereIn('model_id', modelIds) .select('*'); return result.map((r) => this.transformFromDBData(r)); } public async findColumnsByIds(ids: number[], queryOptions?: IQueryOptions) { if (queryOptions && queryOptions.tx) { const { tx } = queryOptions; const result = await tx(this.tableName).whereIn('id', ids).select('*'); return result.map((r) => this.transformFromDBData(r)); } const result = await this.knex('model_column') .whereIn('id', ids) .select('*'); return result.map((r) => this.transformFromDBData(r)); } public async deleteByModelIds( modelIds: number[], queryOptions?: IQueryOptions, ) { if (queryOptions && queryOptions.tx) { const { tx } = queryOptions; await tx(this.tableName).whereIn('model_id', modelIds).delete(); return; } await this.knex('model_column') .whereIn('model_id', modelIds) .delete(); } public async resetModelPrimaryKey(modelId: number) { await this.knex('model_column') .where(this.transformToDBData({ modelId })) .update(this.transformToDBData({ isPk: false })); } public async setModelPrimaryKey(modelId: number, sourceColumnName: string) { await this.knex('model_column') .where(this.transformToDBData({ modelId, sourceColumnName })) .update(this.transformToDBData({ isPk: true })); } public async deleteAllBySourceColumnNames( modelId: number, sourceColumnNames: string[], queryOptions?: IQueryOptions, ): Promise { const executer = queryOptions?.tx ? queryOptions.tx : this.knex; const builder = executer(this.tableName) .where(this.transformToDBData({ modelId })) .whereIn('source_column_name', sourceColumnNames) .delete(); return await builder; } public async deleteAllByColumnIds( columnIds: number[], queryOptions?: IQueryOptions, ): Promise { const executer = queryOptions?.tx ? queryOptions.tx : this.knex; await executer(this.tableName) .whereIn('id', columnIds) .delete(); } } ================================================ FILE: wren-ui/src/apollo/server/repositories/modelNestedColumnRepository.ts ================================================ import { Knex } from 'knex'; import { BaseRepository, IBasicRepository } from './baseRepository'; import { camelCase, isPlainObject, mapKeys, mapValues, snakeCase, } from 'lodash'; export interface ModelNestedColumn { id: number; // ID modelId: number; // Reference to model ID columnId: number; // Reference to column ID columnPath: string[]; displayName: string; // Nested column name displayed in UI referenceName: string; // The name used in the MDL structure and when querying the data sourceColumnName: string; // The nested column name in the datasource type: string; // Data type, refer to the nested column type in the datasource properties?: Record; // Nested column properties, a json string, the description should be stored here } export interface IModelNestedColumnRepository extends IBasicRepository { findNestedColumnsByModelIds(modelIds: number[]): Promise; findNestedColumnsByIds(ids: number[]): Promise; } export class ModelNestedColumnRepository extends BaseRepository implements IModelNestedColumnRepository { constructor(knexPg: Knex) { super({ knexPg, tableName: 'model_nested_column' }); } public findNestedColumnsByModelIds = async (modelIds: number[]) => { const result = await this.knex(this.tableName) .select('*') .whereIn('model_id', modelIds); return result.map((r) => this.transformFromDBData(r)); }; public findNestedColumnsByIds = async (ids: number[]) => { const result = await this.knex(this.tableName) .select('*') .whereIn('id', ids); return result.map((r) => this.transformFromDBData(r)); }; protected override transformToDBData = (data: any) => { if (!isPlainObject(data)) { throw new Error('Unexpected dbdata'); } const transformedData = mapValues(data, (value, key) => { if (['columnPath', 'properties'].includes(key)) { return value ? JSON.stringify(value) : null; } return value; }); return mapKeys(transformedData, (_value, key) => snakeCase(key)); }; protected override transformFromDBData = (data: any): ModelNestedColumn => { if (!isPlainObject(data)) { throw new Error('Unexpected dbdata'); } const camelCaseData = mapKeys(data, (_value, key) => camelCase(key)); const formattedData = mapValues(camelCaseData, (value, key) => { if (['columnPath', 'properties'].includes(key)) { // The value from Sqlite will be string type, while the value from PG is JSON object if (typeof value === 'string') { return value ? JSON.parse(value) : value; } else { return value; } } return value; }) as ModelNestedColumn; return formattedData; }; } ================================================ FILE: wren-ui/src/apollo/server/repositories/modelRepository.ts ================================================ import { Knex } from 'knex'; import { BaseRepository, IBasicRepository, IQueryOptions, } from './baseRepository'; export interface Model { id: number; // ID projectId: number; // Reference to project.id displayName: string; // Model name displayed in UI sourceTableName: string; // the table name in the datasource referenceName: string; // the name used in the MDL structure refSql: string; // Reference SQL cached: boolean; // Model is cached or not refreshTime: string | null; // Contain a number followed by a time unit (ns, us, ms, s, m, h, d). For example, "2h" properties: string | null; // Model properties, a json string, the description and displayName should be stored here } export interface IModelRepository extends IBasicRepository { findAllByIds(ids: number[]): Promise; deleteAllBySourceTableNames( sourceTableNames: string[], queryOptions?: IQueryOptions, ): Promise; } export class ModelRepository extends BaseRepository implements IModelRepository { constructor(knexPg: Knex) { super({ knexPg, tableName: 'model' }); } public async findAllByIds(ids: number[]) { const res = await this.knex(this.tableName).whereIn('id', ids); return res.map((r) => this.transformFromDBData(r)); } public async deleteAllBySourceTableNames( sourceTableNames: string[], queryOptions?: IQueryOptions, ) { const executer = queryOptions?.tx ? queryOptions.tx : this.knex; const builder = executer(this.tableName) .whereIn('source_table_name', sourceTableNames) .delete(); return await builder; } } ================================================ FILE: wren-ui/src/apollo/server/repositories/projectRepository.ts ================================================ import { Knex } from 'knex'; import { BaseRepository, IBasicRepository } from './baseRepository'; import { camelCase, isPlainObject, mapKeys, mapValues, snakeCase, isEmpty, } from 'lodash'; import { DataSourceName } from '@server/types'; import { IbisRedshiftConnectionType, IbisDatabricksConnectionType, } from '@server/adaptors/ibisAdaptor'; export interface BIG_QUERY_CONNECTION_INFO { projectId: string; datasetId: string; credentials: string; } export interface POSTGRES_CONNECTION_INFO { host: string; port: number; user: string; password: string; database: string; ssl: boolean; } export interface MYSQL_CONNECTION_INFO { host: string; port: number; user: string; password: string; database: string; ssl: boolean; } export interface ORACLE_CONNECTION_INFO { user: string; password: string; host?: string; port?: number; database?: string; dsn?: string; } export interface MS_SQL_CONNECTION_INFO { host: string; port: number; user: string; password: string; database: string; trustServerCertificate: boolean; } export interface CLICK_HOUSE_CONNECTION_INFO { host: string; port: number; user: string; password: string; database: string; ssl: boolean; } export interface TRINO_CONNECTION_INFO { host: string; port: number; schemas: string; username: string; password: string; ssl: boolean; } export interface SNOWFLAKE_CONNECTION_INFO { user: string; account: string; database: string; schema: string; password?: string; privateKey?: string; warehouse?: string; } export interface DUCKDB_CONNECTION_INFO { initSql: string; extensions: Array; configurations: Record; } export interface ATHENA_CONNECTION_INFO { database: string; schema: string; s3StagingDir: string; awsRegion: string; awsAccessKey?: string; awsSecretKey?: string; webIdentityToken?: string; roleArn?: string; roleSessionName?: string; } export interface REDSHIFT_PASSWORD_AUTH { host: string; port: number; user: string; password: string; database: string; redshiftType: IbisRedshiftConnectionType; } export interface REDSHIFT_IAM_AUTH { clusterIdentifier: string; user: string; database: string; awsRegion: string; awsAccessKey: string; awsSecretKey: string; redshiftType: IbisRedshiftConnectionType; } export interface DATABRICKS_PERSONAL_ACCESS_TOKEN_AUTH { serverHostname: string; httpPath: string; accessToken: string; databricksType: IbisDatabricksConnectionType; } export interface DATABRICKS_SERVICE_PRINCIPAL_AUTH { serverHostname: string; httpPath: string; clientId: string; clientSecret: string; azureTenantId?: string; databricksType: IbisDatabricksConnectionType; } export type REDSHIFT_CONNECTION_INFO = | REDSHIFT_PASSWORD_AUTH | REDSHIFT_IAM_AUTH; export type DATABRICKS_CONNECTION_INFO = | DATABRICKS_PERSONAL_ACCESS_TOKEN_AUTH | DATABRICKS_SERVICE_PRINCIPAL_AUTH; export type WREN_AI_CONNECTION_INFO = | ATHENA_CONNECTION_INFO | BIG_QUERY_CONNECTION_INFO | POSTGRES_CONNECTION_INFO | MYSQL_CONNECTION_INFO | ORACLE_CONNECTION_INFO | DUCKDB_CONNECTION_INFO | MS_SQL_CONNECTION_INFO | CLICK_HOUSE_CONNECTION_INFO | TRINO_CONNECTION_INFO | SNOWFLAKE_CONNECTION_INFO | REDSHIFT_CONNECTION_INFO | DATABRICKS_CONNECTION_INFO; export interface RecommendationQuestionResult { question: string; category: string; // category for the question sql: string; // validated sql for this question, can be used in generateAskDetail } export interface Project { id: number; // ID type: DataSourceName; // Project datasource type. ex: bigquery, mysql, postgresql, mongodb, etc version: string; // Project datasource version displayName: string; // Project display name catalog: string; // Catalog name schema: string; // Schema name sampleDataset: string; // Sample dataset name connectionInfo: WREN_AI_CONNECTION_INFO; language?: string; // Project language // The recommended questions generated by AI queryId?: string; questions?: RecommendationQuestionResult[]; questionsStatus?: string; questionsError?: object; } export interface IProjectRepository extends IBasicRepository { getCurrentProject: () => Promise; } export class ProjectRepository extends BaseRepository implements IProjectRepository { private jsonTypeColumns = ['questions', 'questions_error', 'connection_info']; constructor(knexPg: Knex) { super({ knexPg, tableName: 'project' }); } public async getCurrentProject() { const projects = await this.findAll({ order: 'id', limit: 1, }); if (!projects.length) { throw new Error('No project found'); } return projects[0]; } public override transformFromDBData: (data: any) => Project = (data: any) => { if (!isPlainObject(data)) { throw new Error('Unexpected db data'); } const formattedData = mapValues(data, (value, key) => { if (this.jsonTypeColumns.includes(key) && typeof value === 'string') { // should return {} if value is null / {}, use value ? {} : JSON.parse(value) will throw error when value is null return isEmpty(value) ? {} : JSON.parse(value); } if (key === 'type') { return DataSourceName[value]; } return value; }); const camelCaseData = mapKeys(formattedData, (_value, key) => camelCase(key), ); return camelCaseData as Project; }; public override transformToDBData: (data: Project) => any = ( data: Project, ) => { if (!isPlainObject(data)) { throw new Error('Unexpected db data'); } const snakeCaseData = mapKeys(data, (_value, key) => snakeCase(key)); const formattedData = mapValues(snakeCaseData, (value, key) => { if (this.jsonTypeColumns.includes(key) && typeof value !== 'string') { return JSON.stringify(value); } return value; }); return formattedData; }; } ================================================ FILE: wren-ui/src/apollo/server/repositories/relationshipRepository.ts ================================================ import { Knex } from 'knex'; import { BaseRepository, IBasicRepository, IQueryOptions, } from './baseRepository'; import { RelationData } from '../types'; export interface Relation { id: number; // ID projectId: number; // Reference to project.id name: string; // Relation name joinType: string; // Join type, eg:"MANY_TO_ONE", "ONE_TO_MANY", "MANY_TO_MANY" condition: string; // Join condition, ex: "OrdersModel.custkey = CustomerModel.custkey" fromColumnId: number; // from column id, "{fromColumn} {joinType} {toColumn}" toColumnId: number; // to column id, "{fromColumn} {joinType} {toColumn}" properties: string | null; // Model properties, a json string, the description should be stored here } export interface ExtraRelationInfo { fromModelId: number; fromModelName: string; fromModelDisplayName: string; fromColumnName: string; fromColumnDisplayName: string; toModelId: number; toModelName: string; toModelDisplayName: string; toColumnName: string; toColumnDisplayName: string; } export type RelationInfo = Relation & ExtraRelationInfo; export interface IRelationRepository extends IBasicRepository { findRelationsBy( filter: { columnIds?: number[]; modelIds?: number[] }, queryOptions?: IQueryOptions, ): Promise; findRelationsByIds( ids: number[], queryOptions?: IQueryOptions, ): Promise; deleteRelationsByColumnIds( columnIds: number[], queryOptions?: IQueryOptions, ): Promise; findRelationInfoBy( filter: { projectId?: number; columnIds?: number[]; modelIds?: number[]; }, queryOptions?: IQueryOptions, ): Promise; findExistedRelationBetweenModels( relation: RelationData, ): Promise; } export class RelationRepository extends BaseRepository implements IRelationRepository { constructor(knexPg: Knex) { super({ knexPg, tableName: 'relation' }); } public async findRelationsBy( { columnIds, modelIds }, queryOptions?: IQueryOptions, ) { let executer = this.knex; if (queryOptions && queryOptions.tx) { const { tx } = queryOptions; executer = tx; } // select the leftModel name and rightModel name along with relation const builder = executer(this.tableName) .join( 'model_column AS fmc', `${this.tableName}.from_column_id`, '=', 'fmc.id', ) .join( 'model_column AS tmc', `${this.tableName}.to_column_id`, '=', 'tmc.id', ); if (columnIds && columnIds.length > 0) { builder .whereIn(`${this.tableName}.from_column_id`, columnIds) .orWhereIn(`${this.tableName}.to_column_id`, columnIds); } if (modelIds && modelIds.length > 0) { builder .whereIn('fmc.model_id', modelIds) .orWhereIn('tmc.model_id', modelIds); } const result = await builder.select( `${this.tableName}.*`, 'fmc.model_id AS fromModelId', 'tmc.model_id AS toModelId', ); return result.map((r) => this.transformFromDBData(r)); } public async findRelationsByIds(ids: number[], queryOptions?: IQueryOptions) { let executer = this.knex; if (queryOptions && queryOptions.tx) { const { tx } = queryOptions; executer = tx; } const result = await executer(this.tableName) .whereIn('id', ids) .select('*'); return result.map((r) => this.transformFromDBData(r)); } public async deleteRelationsByColumnIds( columnIds: number[], queryOptions?: IQueryOptions, ) { if (queryOptions && queryOptions.tx) { const { tx } = queryOptions; await tx(this.tableName) .whereIn('from_column_id', columnIds) .orWhereIn('to_column_id', columnIds) .delete(); return; } await this.knex(this.tableName) .whereIn('from_column_id', columnIds) .orWhereIn('to_column_id', columnIds) .delete(); } public async findRelationInfoBy(filter, queryOptions) { const { projectId, columnIds, modelIds } = filter; let executer = this.knex; if (queryOptions && queryOptions.tx) { const { tx } = queryOptions; executer = tx; } // select the leftModel name and rightModel name along with relation const builder = executer(this.tableName) .join( 'model_column AS fmc', `${this.tableName}.from_column_id`, '=', 'fmc.id', ) .join( 'model_column AS tmc', `${this.tableName}.to_column_id`, '=', 'tmc.id', ) .join('model AS fm', 'fmc.model_id', '=', 'fm.id') .join('model AS tm', 'tmc.model_id', '=', 'tm.id'); if (projectId) { builder.where(`${this.tableName}.project_id`, projectId); } else if (columnIds && columnIds.length > 0) { builder .whereIn(`${this.tableName}.from_column_id`, columnIds) .orWhereIn(`${this.tableName}.to_column_id`, columnIds); } else if (modelIds && modelIds.length > 0) { builder .whereIn('fmc.model_id', modelIds) .orWhereIn('tmc.model_id', modelIds); } const result = await builder.select( `${this.tableName}.*`, 'fm.id AS fromModelId', 'fm.reference_name AS fromModelName', 'fm.display_name AS fromModelDisplayName', 'tm.id AS toModelId', 'tm.reference_name AS toModelName', 'tm.display_name AS toModelDisplayName', 'fmc.reference_name AS fromColumnName', 'fmc.display_name AS fromColumnDisplayName', 'tmc.reference_name AS toColumnName', 'tmc.display_name AS toColumnDisplayName', ); return result.map((r) => this.transformFromDBData(r)) as RelationInfo[]; } public async findExistedRelationBetweenModels(relation: RelationData) { const { fromModelId, fromColumnId, toModelId, toColumnId } = relation; const query = this.knex(this.tableName) .join( 'model_column AS fmc', `${this.tableName}.from_column_id`, '=', 'fmc.id', ) .join( 'model_column AS tmc', `${this.tableName}.to_column_id`, '=', 'tmc.id', ) // duplicate relationship check .whereRaw( `fmc.model_id = ? And ${this.tableName}.from_column_id = ? And tmc.model_id = ? And ${this.tableName}.to_column_id = ?`, [fromModelId, fromColumnId, toModelId, toColumnId], ) // reverse relationship check .orWhereRaw( `fmc.model_id = ? And ${this.tableName}.from_column_id = ? And tmc.model_id = ? And ${this.tableName}.to_column_id = ?`, [toModelId, toColumnId, fromModelId, fromColumnId], ) .select(`${this.tableName}.*`); const result = await query; return result.map((r) => this.transformFromDBData(r)) as RelationInfo[]; } } ================================================ FILE: wren-ui/src/apollo/server/repositories/schemaChangeRepository.ts ================================================ import { Knex } from 'knex'; import { BaseRepository, IBasicRepository } from './baseRepository'; import { camelCase, isPlainObject, mapKeys, mapValues, snakeCase, } from 'lodash'; import { DataSourceSchemaChange, DataSourceSchemaResolve, } from '@server/managers/dataSourceSchemaDetector'; export interface SchemaChange { id: number; // ID projectId: number; // Reference to project.id change: DataSourceSchemaChange; // Schema change resolve: DataSourceSchemaResolve; // Save resolve createdAt: string; // Created at updateAt: string; // Updated at } export interface ISchemaChangeRepository extends IBasicRepository { findLastSchemaChange(projectId: number): Promise; } export class SchemaChangeRepository extends BaseRepository implements ISchemaChangeRepository { constructor(knexPg: Knex) { super({ knexPg, tableName: 'schema_change' }); } public async findLastSchemaChange(projectId: number) { const res = await this.knex .select('*') .from(this.tableName) .where(this.transformToDBData({ projectId })) .orderBy('created_at', 'desc') .first(); return (res && this.transformFromDBData(res)) || null; } protected override transformToDBData = (data: any) => { if (!isPlainObject(data)) { throw new Error('Unexpected dbdata'); } const transformedData = mapValues(data, (value, key) => { if (['change', 'resolve'].includes(key)) { return value ? JSON.stringify(value) : null; } return value; }); return mapKeys(transformedData, (_value, key) => snakeCase(key)); }; protected override transformFromDBData = (data: any): SchemaChange => { if (!isPlainObject(data)) { throw new Error('Unexpected dbdata'); } const camelCaseData = mapKeys(data, (_value, key) => camelCase(key)); const formattedData = mapValues(camelCaseData, (value, key) => { if (['change', 'resolve'].includes(key)) { // The value from Sqlite will be string type, while the value from PG is JSON object if (typeof value === 'string') { return value ? JSON.parse(value) : value; } else { return value; } } return value; }) as SchemaChange; return formattedData; }; } ================================================ FILE: wren-ui/src/apollo/server/repositories/sqlPairRepository.ts ================================================ import { Knex } from 'knex'; import { BaseRepository, IBasicRepository } from './baseRepository'; export interface SqlPair { id: number; // ID projectId: number; // Reference to project.id sql: string; // SQL query question: string; // Natural language question createdAt?: string; // Date and time when the SQL pair was created updatedAt?: string; // Date and time when the SQL pair was last updated } export interface ISqlPairRepository extends IBasicRepository {} export class SqlPairRepository extends BaseRepository implements ISqlPairRepository { constructor(knexPg: Knex) { super({ knexPg, tableName: 'sql_pair' }); } } ================================================ FILE: wren-ui/src/apollo/server/repositories/threadRepository.ts ================================================ import { Knex } from 'knex'; import { BaseRepository, IBasicRepository } from './baseRepository'; import { camelCase, isPlainObject, mapKeys, mapValues, snakeCase, } from 'lodash'; export interface ThreadRecommendationQuestionResult { question: string; category: string; sql: string; } export interface Thread { id: number; // ID projectId: number; // Reference to project.id summary: string; // Thread summary // recommend question queryId?: string; // Query ID questions?: ThreadRecommendationQuestionResult[]; // Recommended questions questionsStatus?: string; // Status of the recommended questions questionsError?: object; // Error of the recommended questions } export interface IThreadRepository extends IBasicRepository { listAllTimeDescOrder(projectId: number): Promise; } export class ThreadRepository extends BaseRepository implements IThreadRepository { private readonly jsonbColumns = ['questions', 'questionsError']; constructor(knexPg: Knex) { super({ knexPg, tableName: 'thread' }); } public async listAllTimeDescOrder(projectId: number): Promise { const threads = await this.knex(this.tableName) .where(this.transformToDBData({ projectId })) .orderBy('created_at', 'desc'); return threads.map((thread) => this.transformFromDBData(thread)); } protected override transformFromDBData = (data: any): Thread => { if (!isPlainObject(data)) { throw new Error('Unexpected dbdata'); } const camelCaseData = mapKeys(data, (_value, key) => camelCase(key)); const transformData = mapValues(camelCaseData, (value, key) => { if (this.jsonbColumns.includes(key)) { if (typeof value === 'string') { return value ? JSON.parse(value) : value; } else { return value; } } return value; }); return transformData as Thread; }; protected override transformToDBData = (data: any) => { if (!isPlainObject(data)) { throw new Error('Unexpected dbdata'); } const transformedData = mapValues(data, (value, key) => { if (this.jsonbColumns.includes(key)) { return JSON.stringify(value); } else { return value; } }); return mapKeys(transformedData, (_value, key) => snakeCase(key)); }; } ================================================ FILE: wren-ui/src/apollo/server/repositories/threadResponseRepository.ts ================================================ import { Knex } from 'knex'; import { BaseRepository, IBasicRepository, IQueryOptions, } from './baseRepository'; import { camelCase, isPlainObject, mapKeys, mapValues } from 'lodash'; import { AskResultStatus } from '@server/models/adaptor'; export interface DetailStep { summary: string; sql: string; cteName: string; } export interface ThreadResponseBreakdownDetail { queryId: string; status: string; error?: object; description?: string; steps?: Array; } export interface ThreadResponseAnswerDetail { queryId?: string; status: string; error?: object; numRowsUsedInLLM?: number; content?: string; } export interface ThreadResponseChartDetail { queryId?: string; status: string; error?: object; description?: string; chartType?: string; chartSchema?: Record; adjustment?: boolean; } export enum ThreadResponseAdjustmentType { REASONING = 'REASONING', APPLY_SQL = 'APPLY_SQL', } export type ThreadResponseAdjustmentReasoningPayload = { originalThreadResponseId?: number; retrievedTables?: string[]; sqlGenerationReasoning?: string; }; export type ThreadResponseAdjustmentApplySqlPayload = { originalThreadResponseId?: number; sql?: string; }; export interface ThreadResponseAdjustment { type: ThreadResponseAdjustmentType; // todo: I think we could use a better way to do this instead of using a union type payload: ThreadResponseAdjustmentReasoningPayload & ThreadResponseAdjustmentApplySqlPayload; } export interface ThreadResponse { id: number; // ID askingTaskId?: number; // Reference to asking_task.id viewId?: number; // View ID, if the response is from a view threadId: number; // Reference to thread.id question: string; // Thread response question sql?: string; // SQL query generated by AI service answerDetail?: ThreadResponseAnswerDetail; // AI generated text-based answer detail breakdownDetail?: ThreadResponseBreakdownDetail; // Thread response breakdown detail chartDetail?: ThreadResponseChartDetail; // Thread response chart detail adjustment?: ThreadResponseAdjustment; // Thread response adjustment } export interface IThreadResponseRepository extends IBasicRepository { getResponsesWithThread( threadId: number, limit?: number, ): Promise; } export class ThreadResponseRepository extends BaseRepository implements IThreadResponseRepository { private readonly jsonbColumns = [ 'answerDetail', 'breakdownDetail', 'chartDetail', 'adjustment', ]; constructor(knexPg: Knex) { super({ knexPg, tableName: 'thread_response' }); } public async getResponsesWithThread(threadId: number, limit?: number) { const query = this.knex(this.tableName) .select('thread_response.*') .where({ thread_id: threadId }) .leftJoin('thread', 'thread.id', 'thread_response.thread_id'); if (limit) { query.orderBy('created_at', 'desc').limit(limit); } return (await query) .map((res) => { // turn object keys into camelCase return mapKeys(res, (_, key) => camelCase(key)); }) .map((res) => { // JSON.parse detail and error const answerDetail = res.answerDetail && typeof res.answerDetail === 'string' ? JSON.parse(res.answerDetail) : res.answerDetail; const breakdownDetail = res.breakdownDetail && typeof res.breakdownDetail === 'string' ? JSON.parse(res.breakdownDetail) : res.breakdownDetail; const chartDetail = res.chartDetail && typeof res.chartDetail === 'string' ? JSON.parse(res.chartDetail) : res.chartDetail; const adjustment = res.adjustment && typeof res.adjustment === 'string' ? JSON.parse(res.adjustment) : res.adjustment; return { ...res, answerDetail: answerDetail || null, breakdownDetail: breakdownDetail || null, chartDetail: chartDetail || null, adjustment: adjustment || null, }; }) as ThreadResponse[]; } public async updateOne( id: string | number, data: Partial<{ status: AskResultStatus; sql: string; viewId: number; answerDetail: ThreadResponseAnswerDetail; breakdownDetail: ThreadResponseBreakdownDetail; chartDetail: ThreadResponseChartDetail; adjustment: ThreadResponseAdjustment; }>, queryOptions?: IQueryOptions, ) { const transformedData = { status: data.status ? data.status : undefined, sql: data.sql ? data.sql : undefined, viewId: data.viewId ? data.viewId : undefined, answerDetail: data.answerDetail ? JSON.stringify(data.answerDetail) : undefined, breakdownDetail: data.breakdownDetail ? JSON.stringify(data.breakdownDetail) : undefined, chartDetail: data.chartDetail ? JSON.stringify(data.chartDetail) : undefined, adjustment: data.adjustment ? JSON.stringify(data.adjustment) : undefined, }; const executer = queryOptions?.tx ? queryOptions.tx : this.knex; const [result] = await executer(this.tableName) .where({ id }) .update(this.transformToDBData(transformedData as any)) .returning('*'); return this.transformFromDBData(result); } protected override transformFromDBData = (data: any): ThreadResponse => { if (!isPlainObject(data)) { throw new Error('Unexpected dbdata'); } const camelCaseData = mapKeys(data, (_value, key) => camelCase(key)); const formattedData = mapValues(camelCaseData, (value, key) => { if (this.jsonbColumns.includes(key)) { // The value from Sqlite will be string type, while the value from PG is JSON object if (typeof value === 'string') { return value ? JSON.parse(value) : value; } else { return value; } } return value; }) as ThreadResponse; return formattedData; }; } ================================================ FILE: wren-ui/src/apollo/server/repositories/viewRepository.ts ================================================ import { Knex } from 'knex'; import { BaseRepository, IBasicRepository } from './baseRepository'; export interface View { id: number; // ID projectId: number; // Reference to project.id name: string; // The view name statement: string; // The SQL statement of this view cached: boolean; // View is cached or not refreshTime?: string; // Contain a number followed by a time unit (ns, us, ms, s, m, h, d). For example, "2h" properties?: string; // View properties, a json string, the description and displayName should be stored here } export interface IViewRepository extends IBasicRepository {} export class ViewRepository extends BaseRepository implements IViewRepository { constructor(knexPg: Knex) { super({ knexPg, tableName: 'view' }); } } ================================================ FILE: wren-ui/src/apollo/server/resolvers/apiHistoryResolver.ts ================================================ import { ApiType, ApiHistory } from '@server/repositories/apiHistoryRepository'; import { IContext } from '@server/types'; export interface ApiHistoryFilter { apiType?: ApiType; statusCode?: number; threadId?: string; projectId?: number; startDate?: string; endDate?: string; } export interface ApiHistoryPagination { offset: number; limit: number; } /** * Sanitize response payload to remove large data fields * This prevents excessive data transfer when displaying API history * @param payload The response payload to sanitize * @param apiType The type of API that generated this response */ const sanitizeResponsePayload = (payload: any, apiType?: ApiType): any => { if (!payload) return payload; const sanitized = { ...payload }; // Handle specifically RUN_SQL responses that contain large record sets if (apiType === ApiType.RUN_SQL) { // Remove records array but keep metadata about how many records were returned if (sanitized.records && Array.isArray(sanitized.records)) { const recordCount = sanitized.records.length; sanitized.records = [`${recordCount} records omitted`]; } } // Handle specifically GENERATE_VEGA_CHART responses that contain large data values if (apiType === ApiType.GENERATE_VEGA_CHART) { // Remove vegaSpec.data.values array but keep the structure if ( sanitized.vegaSpec?.data?.values && Array.isArray(sanitized.vegaSpec.data.values) ) { const dataCount = sanitized.vegaSpec.data.values.length; sanitized.vegaSpec.data.values = [`${dataCount} data points omitted`]; } } return sanitized; }; export class ApiHistoryResolver { constructor() { this.getApiHistory = this.getApiHistory.bind(this); } /** * Get API history with filtering and pagination */ public async getApiHistory( _root: unknown, args: { filter?: ApiHistoryFilter; pagination: ApiHistoryPagination; }, ctx: IContext, ) { const { filter, pagination } = args; const { offset, limit } = pagination; // Build filter criteria const filterCriteria: Partial = {}; if (filter) { if (filter.apiType) { filterCriteria.apiType = filter.apiType; } if (filter.statusCode) { filterCriteria.statusCode = filter.statusCode; } if (filter.threadId) { filterCriteria.threadId = filter.threadId; } if (filter.projectId) { filterCriteria.projectId = filter.projectId; } } // Handle date filtering const dateFilter: { startDate?: Date; endDate?: Date } = {}; if (filter?.startDate) { dateFilter.startDate = new Date(filter.startDate); } if (filter?.endDate) { dateFilter.endDate = new Date(filter.endDate); } // Get total count for pagination info const total = await ctx.apiHistoryRepository.count( filterCriteria, dateFilter, ); if (total === 0 || total <= offset) { return { items: [], total, hasMore: false, }; } // Get paginated items const items = await ctx.apiHistoryRepository.findAllWithPagination( filterCriteria, dateFilter, { offset, limit, orderBy: { createdAt: 'desc' }, }, ); return { items, total, hasMore: offset + limit < total, }; } /** * Resolver for ApiHistoryResponse fields */ public getApiHistoryNestedResolver = () => ({ createdAt: (apiHistory: ApiHistory) => { return apiHistory.createdAt ? new Date(apiHistory.createdAt).toISOString() : null; }, updatedAt: (apiHistory: ApiHistory) => { return apiHistory.updatedAt ? new Date(apiHistory.updatedAt).toISOString() : null; }, responsePayload: (apiHistory: ApiHistory) => { if (!apiHistory.responsePayload) return null; // If the response payload is an array, return it as is if (Array.isArray(apiHistory.responsePayload)) return apiHistory.responsePayload; // Otherwise, sanitize the response payload return sanitizeResponsePayload( apiHistory.responsePayload, apiHistory.apiType, ); }, }); } ================================================ FILE: wren-ui/src/apollo/server/resolvers/askingResolver.ts ================================================ import { WrenAIError, WrenAILanguage, AskResultStatus, AskResultType, RecommendationQuestionStatus, ChartAdjustmentOption, AskFeedbackStatus, } from '@server/models/adaptor'; import { Thread } from '../repositories/threadRepository'; import { DetailStep, ThreadResponse, } from '../repositories/threadResponseRepository'; import { reduce } from 'lodash'; import { IContext } from '../types'; import { getLogger } from '@server/utils'; import { safeFormatSQL } from '@server/utils/sqlFormat'; import { AskingDetailTaskInput, constructCteSql, ThreadRecommendQuestionResult, } from '../services/askingService'; import { SuggestedQuestion, SampleDatasetName, getSampleAskQuestions, } from '../data'; import { TelemetryEvent, WrenService } from '../telemetry/telemetry'; import { TrackedAskingResult } from '../services'; const logger = getLogger('AskingResolver'); logger.level = 'debug'; export interface SuggestedQuestionResponse { questions: SuggestedQuestion[]; } export interface Task { id: string; } export interface AdjustmentTask { queryId: string; status: AskFeedbackStatus; error: WrenAIError | null; sql: string; traceId: string; invalidSql?: string; } export interface AskingTask { type: AskResultType | null; status: AskResultStatus; candidates: Array<{ sql: string; }>; error: WrenAIError | null; rephrasedQuestion?: string; intentReasoning?: string; sqlGenerationReasoning?: string; retrievedTables?: string[]; invalidSql?: string; traceId?: string; queryId?: string; } // DetailedThread is a type that represents a detailed thread, which is a thread with responses. export interface DetailedThread { id: number; // ID sql: string; // SQL responses: ThreadResponse[]; } export interface RecommendedQuestionsTask { questions: { question: string; category: string; sql: string; }[]; status: RecommendationQuestionStatus; error: WrenAIError | null; } export class AskingResolver { constructor() { this.createAskingTask = this.createAskingTask.bind(this); this.cancelAskingTask = this.cancelAskingTask.bind(this); this.rerunAskingTask = this.rerunAskingTask.bind(this); this.getAskingTask = this.getAskingTask.bind(this); this.createThread = this.createThread.bind(this); this.getThread = this.getThread.bind(this); this.updateThread = this.updateThread.bind(this); this.deleteThread = this.deleteThread.bind(this); this.listThreads = this.listThreads.bind(this); this.createThreadResponse = this.createThreadResponse.bind(this); this.updateThreadResponse = this.updateThreadResponse.bind(this); this.getResponse = this.getResponse.bind(this); this.previewData = this.previewData.bind(this); this.previewBreakdownData = this.previewBreakdownData.bind(this); this.getSuggestedQuestions = this.getSuggestedQuestions.bind(this); this.createInstantRecommendedQuestions = this.createInstantRecommendedQuestions.bind(this); this.getInstantRecommendedQuestions = this.getInstantRecommendedQuestions.bind(this); this.generateThreadRecommendationQuestions = this.generateThreadRecommendationQuestions.bind(this); this.generateProjectRecommendationQuestions = this.generateProjectRecommendationQuestions.bind(this); this.getThreadRecommendationQuestions = this.getThreadRecommendationQuestions.bind(this); this.generateThreadResponseBreakdown = this.generateThreadResponseBreakdown.bind(this); this.generateThreadResponseAnswer = this.generateThreadResponseAnswer.bind(this); this.generateThreadResponseChart = this.generateThreadResponseChart.bind(this); this.adjustThreadResponseChart = this.adjustThreadResponseChart.bind(this); this.transformAskingTask = this.transformAskingTask.bind(this); this.adjustThreadResponse = this.adjustThreadResponse.bind(this); this.cancelAdjustThreadResponseAnswer = this.cancelAdjustThreadResponseAnswer.bind(this); this.rerunAdjustThreadResponseAnswer = this.rerunAdjustThreadResponseAnswer.bind(this); this.getAdjustmentTask = this.getAdjustmentTask.bind(this); } public async generateProjectRecommendationQuestions( _root: any, _args: any, ctx: IContext, ): Promise { await ctx.projectService.generateProjectRecommendationQuestions(); return true; } public async generateThreadRecommendationQuestions( _root: any, args: { threadId: number }, ctx: IContext, ): Promise { const { threadId } = args; const askingService = ctx.askingService; await askingService.generateThreadRecommendationQuestions(threadId); return true; } public async getThreadRecommendationQuestions( _root: any, args: { threadId: number }, ctx: IContext, ): Promise { const { threadId } = args; const askingService = ctx.askingService; return askingService.getThreadRecommendationQuestions(threadId); } public async getSuggestedQuestions( _root: any, _args: any, ctx: IContext, ): Promise { const project = await ctx.projectService.getCurrentProject(); const { sampleDataset } = project; if (!sampleDataset) { return { questions: [] }; } const questions = getSampleAskQuestions(sampleDataset as SampleDatasetName); return { questions }; } public async createAskingTask( _root: any, args: { data: { question: string; threadId?: number } }, ctx: IContext, ): Promise { const { question, threadId } = args.data; const project = await ctx.projectService.getCurrentProject(); const askingService = ctx.askingService; const data = { question }; const task = await askingService.createAskingTask(data, { threadId, language: WrenAILanguage[project.language] || WrenAILanguage.EN, }); ctx.telemetry.sendEvent(TelemetryEvent.HOME_ASK_CANDIDATE, { question, taskId: task.id, }); return task; } public async cancelAskingTask( _root: any, args: { taskId: string }, ctx: IContext, ): Promise { const { taskId } = args; const askingService = ctx.askingService; await askingService.cancelAskingTask(taskId); return true; } public async getAskingTask( _root: any, args: { taskId: string }, ctx: IContext, ): Promise { const { taskId } = args; const askingService = ctx.askingService; const askResult = await askingService.getAskingTask(taskId); if (!askResult) { return null; } // telemetry const eventName = TelemetryEvent.HOME_ASK_CANDIDATE; if (askResult.status === AskResultStatus.FINISHED) { ctx.telemetry.sendEvent(eventName, { taskId, status: askResult.status, candidates: askResult.response, }); } if (askResult.status === AskResultStatus.FAILED) { ctx.telemetry.sendEvent( eventName, { taskId, status: askResult.status, error: askResult.error, }, WrenService.AI, false, ); } return this.transformAskingTask(askResult, ctx); } public async createThread( _root: any, args: { data: { question?: string; taskId?: string; // if we use recommendation questions, sql will be provided sql?: string; }; }, ctx: IContext, ): Promise { const { data } = args; const askingService = ctx.askingService; // if taskId is provided, use the result from the asking task // otherwise, use the input data let threadInput: AskingDetailTaskInput; if (data.taskId) { const askingTask = await askingService.getAskingTask(data.taskId); if (!askingTask) { throw new Error(`Asking task ${data.taskId} not found`); } threadInput = { question: askingTask.question, trackedAskingResult: askingTask, }; } else { // when we use recommendation questions, there's no task to track threadInput = data; } const eventName = TelemetryEvent.HOME_CREATE_THREAD; try { const thread = await askingService.createThread(threadInput); ctx.telemetry.sendEvent(eventName, {}); return thread; } catch (err: any) { ctx.telemetry.sendEvent( eventName, { error: err.message }, err.extensions?.service, false, ); throw err; } // telemetry } public async getThread( _root: any, args: { threadId: number }, ctx: IContext, ): Promise { const { threadId } = args; const askingService = ctx.askingService; const responses = await askingService.getResponsesWithThread(threadId); // reduce responses to group by thread id const thread = reduce( responses, (acc, response) => { if (!acc.id) { acc.id = response.threadId; acc.sql = response.sql; acc.responses = []; } acc.responses.push({ id: response.id, viewId: response.viewId, threadId: response.threadId, question: response.question, sql: response.sql, askingTaskId: response.askingTaskId, breakdownDetail: response.breakdownDetail, answerDetail: response.answerDetail, chartDetail: response.chartDetail, adjustment: response.adjustment, }); return acc; }, {} as any, ); return thread; } public async updateThread( _root: any, args: { where: { id: number }; data: { summary: string } }, ctx: IContext, ): Promise { const { where, data } = args; const askingService = ctx.askingService; const eventName = TelemetryEvent.HOME_UPDATE_THREAD_SUMMARY; const newSummary = data.summary; try { const thread = await askingService.updateThread(where.id, data); // telemetry ctx.telemetry.sendEvent(eventName, { new_summary: newSummary, }); return thread; } catch (err: any) { ctx.telemetry.sendEvent( eventName, { new_summary: newSummary, }, err.extensions?.service, false, ); throw err; } } public async deleteThread( _root: any, args: { where: { id: number } }, ctx: IContext, ): Promise { const { where } = args; const askingService = ctx.askingService; await askingService.deleteThread(where.id); return true; } public async listThreads( _root: any, _args: any, ctx: IContext, ): Promise { const threads = await ctx.askingService.listThreads(); return threads; } public async createThreadResponse( _root: any, args: { threadId: number; data: { question?: string; taskId?: string; // if we use recommendation questions, sql will be provided sql?: string; }; }, ctx: IContext, ): Promise { const { threadId, data } = args; const askingService = ctx.askingService; const eventName = TelemetryEvent.HOME_ASK_FOLLOWUP_QUESTION; // if taskId is provided, use the result from the asking task // otherwise, use the input data let threadResponseInput: AskingDetailTaskInput; if (data.taskId) { const askingTask = await askingService.getAskingTask(data.taskId); if (!askingTask) { throw new Error(`Asking task ${data.taskId} not found`); } threadResponseInput = { question: askingTask.question, trackedAskingResult: askingTask, }; } else { // when we use recommendation questions, there's no task to track threadResponseInput = data; } try { const response = await askingService.createThreadResponse( threadResponseInput, threadId, ); ctx.telemetry.sendEvent(eventName, { data }); return response; } catch (err: any) { ctx.telemetry.sendEvent( eventName, { data, error: err.message }, err.extensions?.service, false, ); throw err; } } public async updateThreadResponse( _root: any, args: { where: { id: number }; data: { sql: string } }, ctx: IContext, ): Promise { const { where, data } = args; const askingService = ctx.askingService; const response = await askingService.updateThreadResponse(where.id, data); return response; } public async rerunAskingTask( _root: any, args: { responseId: number }, ctx: IContext, ): Promise { const { responseId } = args; const askingService = ctx.askingService; const project = await ctx.projectService.getCurrentProject(); const task = await askingService.rerunAskingTask(responseId, { language: WrenAILanguage[project.language] || WrenAILanguage.EN, }); ctx.telemetry.sendEvent(TelemetryEvent.HOME_RERUN_ASKING_TASK, { responseId, }); return task; } public async adjustThreadResponse( _root: any, args: { responseId: number; data: { tables?: string[]; sqlGenerationReasoning?: string; sql?: string; }; }, ctx: IContext, ): Promise { const { responseId, data } = args; const askingService = ctx.askingService; const project = await ctx.projectService.getCurrentProject(); if (data.sql) { const response = await askingService.adjustThreadResponseWithSQL( responseId, { sql: data.sql, }, ); ctx.telemetry.sendEvent( TelemetryEvent.HOME_ADJUST_THREAD_RESPONSE_WITH_SQL, { sql: data.sql, responseId, }, ); return response; } return askingService.adjustThreadResponseAnswer( responseId, { projectId: project.id, tables: data.tables, sqlGenerationReasoning: data.sqlGenerationReasoning, }, { language: WrenAILanguage[project.language] || WrenAILanguage.EN, }, ); } public async cancelAdjustThreadResponseAnswer( _root: any, args: { taskId: string }, ctx: IContext, ): Promise { const { taskId } = args; const askingService = ctx.askingService; await askingService.cancelAdjustThreadResponseAnswer(taskId); return true; } public async rerunAdjustThreadResponseAnswer( _root: any, args: { responseId: number }, ctx: IContext, ): Promise { const { responseId } = args; const askingService = ctx.askingService; const project = await ctx.projectService.getCurrentProject(); await askingService.rerunAdjustThreadResponseAnswer( responseId, project.id, { language: WrenAILanguage[project.language] || WrenAILanguage.EN, }, ); return true; } public async getAdjustmentTask( _root: any, args: { taskId: string }, ctx: IContext, ): Promise { const { taskId } = args; const askingService = ctx.askingService; const adjustmentTask = await askingService.getAdjustmentTask(taskId); return { queryId: adjustmentTask?.queryId, status: adjustmentTask?.status, error: adjustmentTask?.error, sql: adjustmentTask?.response?.[0]?.sql, traceId: adjustmentTask?.traceId, invalidSql: adjustmentTask?.invalidSql ? safeFormatSQL(adjustmentTask.invalidSql) : null, }; } public async generateThreadResponseBreakdown( _root: any, args: { responseId: number }, ctx: IContext, ): Promise { const project = await ctx.projectService.getCurrentProject(); const { responseId } = args; const askingService = ctx.askingService; const breakdownDetail = await askingService.generateThreadResponseBreakdown( responseId, { language: WrenAILanguage[project.language] || WrenAILanguage.EN }, ); return breakdownDetail; } public async generateThreadResponseAnswer( _root: any, args: { responseId: number }, ctx: IContext, ): Promise { const project = await ctx.projectService.getCurrentProject(); const { responseId } = args; const askingService = ctx.askingService; return askingService.generateThreadResponseAnswer(responseId, { language: WrenAILanguage[project.language] || WrenAILanguage.EN, }); } public async generateThreadResponseChart( _root: any, args: { responseId: number }, ctx: IContext, ): Promise { const project = await ctx.projectService.getCurrentProject(); const { responseId } = args; const askingService = ctx.askingService; return askingService.generateThreadResponseChart(responseId, { language: WrenAILanguage[project.language] || WrenAILanguage.EN, }); } public async adjustThreadResponseChart( _root: any, args: { responseId: number; data: ChartAdjustmentOption }, ctx: IContext, ): Promise { const project = await ctx.projectService.getCurrentProject(); const { responseId, data } = args; const askingService = ctx.askingService; return askingService.adjustThreadResponseChart(responseId, data, { language: WrenAILanguage[project.language] || WrenAILanguage.EN, }); } public async getResponse( _root: any, args: { responseId: number }, ctx: IContext, ): Promise { const { responseId } = args; const askingService = ctx.askingService; const response = await askingService.getResponse(responseId); return response; } public async previewData( _root: any, args: { where: { responseId: number; stepIndex?: number; limit?: number } }, ctx: IContext, ): Promise { const { responseId, limit } = args.where; const askingService = ctx.askingService; const data = await askingService.previewData(responseId, limit); return data; } public async previewBreakdownData( _root: any, args: { where: { responseId: number; stepIndex?: number; limit?: number } }, ctx: IContext, ): Promise { const { responseId, stepIndex, limit } = args.where; const askingService = ctx.askingService; const data = await askingService.previewBreakdownData( responseId, stepIndex, limit, ); return data; } public async createInstantRecommendedQuestions( _root: any, args: { data: { previousQuestions?: string[] } }, ctx: IContext, ): Promise { const { data } = args; const askingService = ctx.askingService; return askingService.createInstantRecommendedQuestions(data); } public async getInstantRecommendedQuestions( _root: any, args: { taskId: string }, ctx: IContext, ): Promise { const { taskId } = args; const askingService = ctx.askingService; const result = await askingService.getInstantRecommendedQuestions(taskId); return { questions: result.response?.questions || [], status: result.status, error: result.error, }; } /** * Nested resolvers */ public getThreadResponseNestedResolver = () => ({ view: async (parent: ThreadResponse, _args: any, ctx: IContext) => { const viewId = parent.viewId; if (!viewId) return null; const view = await ctx.viewRepository.findOneBy({ id: viewId }); const displayName = view.properties ? JSON.parse(view.properties)?.displayName : view.name; return { ...view, displayName }; }, answerDetail: (parent: ThreadResponse, _args: any, _ctx: IContext) => { if (!parent?.answerDetail) return null; const { content, ...rest } = parent.answerDetail; if (!content) return parent.answerDetail; const formattedContent = content // replace the \\n to \n .replace(/\\n/g, '\n') // replace the \\\" to \", .replace(/\\"/g, '"'); return { ...rest, content: formattedContent, }; }, sql: (parent: ThreadResponse, _args: any, _ctx: IContext) => { if (parent.breakdownDetail && parent.breakdownDetail.steps) { // construct sql from breakdownDetail return safeFormatSQL(constructCteSql(parent.breakdownDetail.steps)); } return parent.sql ? safeFormatSQL(parent.sql) : null; }, askingTask: async (parent: ThreadResponse, _args: any, ctx: IContext) => { if (parent.adjustment) { return null; } const askingService = ctx.askingService; const askingTask = await askingService.getAskingTaskById( parent.askingTaskId, ); if (!askingTask) return null; return this.transformAskingTask(askingTask, ctx); }, adjustmentTask: async ( parent: ThreadResponse, _args: any, ctx: IContext, ): Promise => { if (!parent.adjustment) { return null; } const askingService = ctx.askingService; const adjustmentTask = await askingService.getAdjustmentTaskById( parent.askingTaskId, ); if (!adjustmentTask) return null; return { queryId: adjustmentTask?.queryId, status: adjustmentTask?.status, error: adjustmentTask?.error, sql: adjustmentTask?.response?.[0]?.sql, traceId: adjustmentTask?.traceId, invalidSql: adjustmentTask?.invalidSql ? safeFormatSQL(adjustmentTask.invalidSql) : null, }; }, }); public getDetailStepNestedResolver = () => ({ sql: (parent: DetailStep, _args: any, _ctx: IContext) => { return safeFormatSQL(parent.sql); }, }); public getResultCandidateNestedResolver = () => ({ sql: (parent: any, _args: any, _ctx: IContext) => { return safeFormatSQL(parent.sql); }, view: async (parent: any, _args: any, ctx: IContext) => { const viewId = parent.view?.id; if (!viewId) return parent.view; const view = await ctx.viewRepository.findOneBy({ id: viewId }); const displayName = view.properties ? JSON.parse(view.properties).displayName : view.name; return { ...parent.view, displayName, }; }, }); private async transformAskingTask( askingTask: TrackedAskingResult, ctx: IContext, ): Promise { // construct candidates from response const candidates = await Promise.all( (askingTask.response || []).map(async (response) => { const view = response.viewId ? await ctx.viewRepository.findOneBy({ id: response.viewId }) : null; const sqlPair = response.sqlpairId ? await ctx.sqlPairRepository.findOneBy({ id: response.sqlpairId }) : null; return { type: response.type, sql: response.sql, view, sqlPair, }; }), ); // When the task got cancelled, the type is not set // we set it to TEXT_TO_SQL as default const type = askingTask?.status === AskResultStatus.STOPPED && !askingTask.type ? AskResultType.TEXT_TO_SQL : askingTask.type; return { type, status: askingTask.status, error: askingTask.error, candidates, queryId: askingTask.queryId, rephrasedQuestion: askingTask.rephrasedQuestion, intentReasoning: askingTask.intentReasoning, sqlGenerationReasoning: askingTask.sqlGenerationReasoning, retrievedTables: askingTask.retrievedTables, invalidSql: askingTask.invalidSql ? safeFormatSQL(askingTask.invalidSql) : null, traceId: askingTask.traceId, }; } } ================================================ FILE: wren-ui/src/apollo/server/resolvers/dashboardResolver.ts ================================================ import { IContext } from '@server/types'; import { ChartType } from '@server/models/adaptor'; import { UpdateDashboardItemLayouts, PreviewDataResponse, DEFAULT_PREVIEW_LIMIT, } from '@server/services'; import { Dashboard, DashboardItem, DashboardItemType, } from '@server/repositories'; import { getLogger } from '@server/utils'; import { SetDashboardCacheData, DashboardSchedule, PreviewItemResponse, } from '@server/models/dashboard'; const logger = getLogger('DashboardResolver'); logger.level = 'debug'; export class DashboardResolver { constructor() { this.getDashboard = this.getDashboard.bind(this); this.getDashboardItems = this.getDashboardItems.bind(this); this.createDashboardItem = this.createDashboardItem.bind(this); this.updateDashboardItem = this.updateDashboardItem.bind(this); this.deleteDashboardItem = this.deleteDashboardItem.bind(this); this.updateDashboardItemLayouts = this.updateDashboardItemLayouts.bind(this); this.previewItemSQL = this.previewItemSQL.bind(this); this.setDashboardSchedule = this.setDashboardSchedule.bind(this); } public async getDashboard( _root: any, _args: any, ctx: IContext, ): Promise< Omit & { schedule: DashboardSchedule; items: DashboardItem[]; nextScheduledAt: string | null; } > { const dashboard = await ctx.dashboardService.getCurrentDashboard(); if (!dashboard) { throw new Error('Dashboard not found.'); } const schedule = ctx.dashboardService.parseCronExpression(dashboard); const items = await ctx.dashboardService.getDashboardItems(dashboard.id); return { ...dashboard, nextScheduledAt: dashboard.nextScheduledAt ? new Date(dashboard.nextScheduledAt).toISOString() : null, schedule, items, }; } public async getDashboardItems( _root: any, _args: any, ctx: IContext, ): Promise { const dashboard = await ctx.dashboardService.getCurrentDashboard(); if (!dashboard) { throw new Error('Dashboard not found.'); } return await ctx.dashboardService.getDashboardItems(dashboard.id); } public async createDashboardItem( _root: any, args: { data: { itemType: DashboardItemType; responseId: number } }, ctx: IContext, ): Promise { const { responseId, itemType } = args.data; const dashboard = await ctx.dashboardService.getCurrentDashboard(); const response = await ctx.askingService.getResponse(responseId); if (!response) { throw new Error(`Thread response not found. responseId: ${responseId}`); } if (!Object.keys(ChartType).includes(itemType)) { throw new Error(`Chart type not supported. responseId: ${responseId}`); } if (!response.chartDetail?.chartSchema) { throw new Error( `Chart schema not found in thread response. responseId: ${responseId}`, ); } // query with cache enabled const project = await ctx.projectService.getCurrentProject(); const deployment = await ctx.deployService.getLastDeployment(project.id); const mdl = deployment.manifest; await ctx.queryService.preview(response.sql, { project, manifest: mdl, limit: DEFAULT_PREVIEW_LIMIT, cacheEnabled: true, refresh: true, }); return await ctx.dashboardService.createDashboardItem({ dashboardId: dashboard.id, type: itemType, sql: response.sql, chartSchema: response.chartDetail?.chartSchema, }); } public async updateDashboardItem( _root: any, args: { where: { id: number }; data: { displayName: string } }, ctx: IContext, ): Promise { const { id } = args.where; const { displayName } = args.data; const item = await ctx.dashboardService.getDashboardItem(id); if (!item) { throw new Error(`Dashboard item not found. id: ${id}`); } return await ctx.dashboardService.updateDashboardItem(id, { displayName }); } public async deleteDashboardItem( _root: any, args: { where: { id: number } }, ctx: IContext, ): Promise { const { id } = args.where; const item = await ctx.dashboardService.getDashboardItem(id); if (!item) { throw new Error(`Dashboard item not found. id: ${id}`); } return await ctx.dashboardService.deleteDashboardItem(id); } public async updateDashboardItemLayouts( _root: any, args: { data: { layouts: UpdateDashboardItemLayouts } }, ctx: IContext, ): Promise { const { layouts } = args.data; if (layouts.length === 0) { throw new Error('Layouts are required.'); } return await ctx.dashboardService.updateDashboardItemLayouts(layouts); } public async previewItemSQL( _root: any, args: { data: { itemId: number; limit?: number; refresh?: boolean } }, ctx: IContext, ): Promise { const { itemId, limit, refresh } = args.data; try { const item = await ctx.dashboardService.getDashboardItem(itemId); const { cacheEnabled } = await ctx.dashboardService.getCurrentDashboard(); const project = await ctx.projectService.getCurrentProject(); const deployment = await ctx.deployService.getLastDeployment(project.id); const mdl = deployment.manifest; const data = (await ctx.queryService.preview(item.detail.sql, { project, manifest: mdl, limit: limit || DEFAULT_PREVIEW_LIMIT, cacheEnabled, refresh: refresh || false, })) as PreviewDataResponse; // handle data to [{ column1: value1, column2: value2, ... }] const values = data.data.map((val) => { return data.columns.reduce((acc, col, index) => { acc[col.name] = val[index]; return acc; }, {}); }); return { cacheHit: data.cacheHit || false, cacheCreatedAt: data.cacheCreatedAt || null, cacheOverrodeAt: data.cacheOverrodeAt || null, override: data.override || false, data: values, } as PreviewItemResponse; } catch (error) { logger.error(`Error previewing SQL item ${itemId}: ${error}`); throw error; } } public async setDashboardSchedule( _root: any, args: { data: SetDashboardCacheData }, ctx: IContext, ): Promise { try { const dashboard = await ctx.dashboardService.getCurrentDashboard(); if (!dashboard) { throw new Error('Dashboard not found.'); } return await ctx.dashboardService.setDashboardSchedule( dashboard.id, args.data, ); } catch (error) { logger.error(`Failed to set dashboard schedule: ${error.message}`); throw error; } } } ================================================ FILE: wren-ui/src/apollo/server/resolvers/diagramResolver.ts ================================================ import { v4 as uuidv4 } from 'uuid'; import { Model, ModelColumn, ModelNestedColumn, RelationInfo, View, } from '@server/repositories'; import { Diagram, DiagramModel, DiagramModelField, DiagramModelRelationField, NodeType, IContext, RelationType, DiagramView, } from '@server/types'; import { ColumnMDL, Manifest } from '@server/mdl/type'; import { getLogger } from '@server/utils'; import { MDLBuilder } from '../mdl/mdlBuilder'; const logger = getLogger('DiagramResolver'); logger.level = 'debug'; export class DiagramResolver { constructor() { this.getDiagram = this.getDiagram.bind(this); } public async getDiagram( _root: any, _args: any, ctx: IContext, ): Promise { const project = await ctx.projectRepository.getCurrentProject(); const models = await ctx.modelRepository.findAllBy({ projectId: project.id, }); const modelIds = models.map((model) => model.id); const modelColumns = await ctx.modelColumnRepository.findColumnsByModelIds(modelIds); const modelNestedColumns = await ctx.modelNestedColumnRepository.findNestedColumnsByModelIds( modelIds, ); const modelRelations = await ctx.relationRepository.findRelationInfoBy({ columnIds: modelColumns.map((column) => column.id), }); const views = await ctx.viewRepository.findAllBy({ projectId: project.id, }); const builder = new MDLBuilder({ project, models, columns: modelColumns, nestedColumns: modelNestedColumns, relations: modelRelations, views, relatedModels: models, relatedColumns: modelColumns, relatedRelations: modelRelations, }); const manifest = builder.build(); return this.buildDiagram( models, modelColumns, modelNestedColumns, modelRelations, views, manifest, ); } private buildDiagram( models: Model[], modelColumns: ModelColumn[], modelNestedColumns: ModelNestedColumn[], relations: RelationInfo[], views: View[], manifest: Manifest, ): Diagram { const diagramModels = models.map((model) => { const transformedModel = this.transformModel(model); const allColumns = modelColumns.filter( (column) => column.modelId === model.id, ); const modelMDL = manifest.models.find( (modelMDL) => modelMDL.name === model.referenceName, ); allColumns.forEach((column) => { const columnRelations = relations .map((relation) => [relation.fromColumnId, relation.toColumnId].includes(column.id) ? relation : null, ) .filter((relation) => !!relation); if (columnRelations.length > 0) { columnRelations.forEach((relation) => { const transformedRelationField = this.transformModelRelationField({ relation, currentModel: model, models, }); transformedModel.relationFields.push(transformedRelationField); }); } if (column.isCalculated) { transformedModel.calculatedFields.push( this.transformCalculatedField(column, modelMDL.columns), ); } else { const nestedColumns = modelNestedColumns.filter( (nestedColumn) => nestedColumn.columnId === column.id, ); transformedModel.fields.push( this.transformNormalField(column, nestedColumns), ); } }); return transformedModel; }); const diagramViews = views.map(this.transformView); return { models: diagramModels, views: diagramViews }; } private transformModel(model: Model): DiagramModel { const properties = JSON.parse(model.properties); return { id: uuidv4(), modelId: model.id, nodeType: NodeType.MODEL, displayName: model.displayName, referenceName: model.referenceName, sourceTableName: model.sourceTableName, refSql: model.refSql, refreshTime: model.refreshTime, cached: model.cached, description: properties?.description, fields: [], calculatedFields: [], relationFields: [], }; } private transformNormalField( column: ModelColumn, nestedColumns: ModelNestedColumn[], ): DiagramModelField { const properties = JSON.parse(column.properties); return { id: uuidv4(), columnId: column.id, nodeType: column.isCalculated ? NodeType.CALCULATED_FIELD : NodeType.FIELD, type: column.type, displayName: column.displayName, referenceName: column.referenceName, description: properties?.description, isPrimaryKey: column.isPk, expression: column.aggregation, nestedFields: nestedColumns.length ? nestedColumns.map((nestedColumn) => ({ id: uuidv4(), nestedColumnId: nestedColumn.id, columnPath: nestedColumn.columnPath, type: nestedColumn.type, displayName: nestedColumn.displayName, referenceName: nestedColumn.referenceName, description: nestedColumn.properties?.description, })) : null, }; } private transformCalculatedField( column: ModelColumn, columnsMDL: ColumnMDL[], ): DiagramModelField { const properties = JSON.parse(column.properties); const lineage = JSON.parse(column.lineage); const columnMDL = columnsMDL.find( ({ name }) => name === column.referenceName, ); return { id: uuidv4(), columnId: column.id, nodeType: NodeType.CALCULATED_FIELD, aggregation: column.aggregation, lineage, type: column.type, displayName: column.displayName, referenceName: column.referenceName, description: properties?.description, isPrimaryKey: column.isPk, expression: columnMDL.expression, }; } private transformModelRelationField({ relation, currentModel, models, }: { relation: RelationInfo; currentModel: Model; models: Model[]; }): DiagramModelRelationField { const referenceName = currentModel.referenceName === relation.fromModelName ? relation.toModelName : relation.fromModelName; const displayName = models.find( (model) => model.referenceName === referenceName, )?.displayName; const properties = relation.properties ? JSON.parse(relation.properties) : null; return { id: uuidv4(), relationId: relation.id, nodeType: NodeType.RELATION, displayName, referenceName, type: relation.joinType as RelationType, fromModelId: relation.fromModelId, fromModelName: relation.fromModelName, fromModelDisplayName: relation.fromModelDisplayName, fromColumnId: relation.fromColumnId, fromColumnName: relation.fromColumnName, fromColumnDisplayName: relation.fromColumnDisplayName, toModelId: relation.toModelId, toModelName: relation.toModelName, toModelDisplayName: relation.toModelDisplayName, toColumnId: relation.toColumnId, toColumnName: relation.toColumnName, toColumnDisplayName: relation.toColumnDisplayName, description: properties?.description, }; } private transformView(view: View): DiagramView { const properties = JSON.parse(view.properties); const fields = (properties?.columns || []).map((column: any) => ({ id: uuidv4(), nodeType: NodeType.FIELD, type: column.type, displayName: column.name, referenceName: column.name, description: column?.properties?.description, })); return { id: uuidv4(), viewId: view.id, nodeType: NodeType.VIEW, statement: view.statement, referenceName: view.name, displayName: properties?.displayName || view.name, fields, description: properties?.description, }; } } ================================================ FILE: wren-ui/src/apollo/server/resolvers/instructionResolver.ts ================================================ import { IContext } from '@server/types'; import { UpdateInstructionInput } from '@server/models'; import { Instruction } from '@server/repositories/instructionRepository'; import { getLogger } from '@server/utils'; import { TelemetryEvent, TrackTelemetry } from '@server/telemetry/telemetry'; const logger = getLogger('InstructionResolver'); logger.level = 'debug'; export class InstructionResolver { constructor() { this.getInstructions = this.getInstructions.bind(this); this.createInstruction = this.createInstruction.bind(this); this.updateInstruction = this.updateInstruction.bind(this); this.deleteInstruction = this.deleteInstruction.bind(this); } public async getInstructions( _root: any, _args: any, ctx: IContext, ): Promise { try { const project = await ctx.projectService.getCurrentProject(); return await ctx.instructionService.getInstructions(project.id); } catch (error) { logger.error(`Error getting instructions: ${error}`); throw error; } } @TrackTelemetry(TelemetryEvent.KNOWLEDGE_CREATE_INSTRUCTION) public async createInstruction( _root: any, args: { data: { instruction: string; questions: string[]; isDefault: boolean; }; }, ctx: IContext, ): Promise { const { instruction, questions, isDefault } = args.data; const project = await ctx.projectService.getCurrentProject(); return await ctx.instructionService.createInstruction({ instruction, questions, isDefault, projectId: project.id, }); } @TrackTelemetry(TelemetryEvent.KNOWLEDGE_UPDATE_INSTRUCTION) public async updateInstruction( _root: any, args: { data: Pick< UpdateInstructionInput, 'instruction' | 'questions' | 'isDefault' >; where: { id: number }; }, ctx: IContext, ): Promise { const { id } = args.where; const { instruction, questions, isDefault } = args.data; if (!id) { throw new Error('Instruction ID is required.'); } const project = await ctx.projectService.getCurrentProject(); return await ctx.instructionService.updateInstruction({ id, projectId: project.id, instruction, questions, isDefault, }); } @TrackTelemetry(TelemetryEvent.KNOWLEDGE_DELETE_INSTRUCTION) public async deleteInstruction( _root: any, args: { where: { id: number } }, ctx: IContext, ): Promise { const { id } = args.where; const project = await ctx.projectService.getCurrentProject(); await ctx.instructionService.deleteInstruction(id, project.id); return true; } } ================================================ FILE: wren-ui/src/apollo/server/resolvers/learningResolver.ts ================================================ import { IContext } from '@server/types'; import { getConfig } from '@server/config'; import { getLogger } from '@server/utils'; import { uniq } from 'lodash'; const config = getConfig(); const logger = getLogger('LearingResolver'); logger.level = 'debug'; export class LearningResolver { constructor() { this.getLearningRecord = this.getLearningRecord.bind(this); this.saveLearningRecord = this.saveLearningRecord.bind(this); } public async getLearningRecord( _root: any, _args: any, ctx: IContext, ): Promise { const result = await ctx.learningRepository.findAll(); return { paths: result[0]?.paths || [] }; } public async saveLearningRecord( _root: any, args: any, ctx: IContext, ): Promise { const { path } = args.data; const result = await ctx.learningRepository.findAll(); if (!result.length) { return await ctx.learningRepository.createOne({ userId: config?.userUUID, paths: [path], }); } const [record] = result; return await ctx.learningRepository.updateOne(record.id, { userId: config?.userUUID, paths: uniq([...record.paths, path]), }); } } ================================================ FILE: wren-ui/src/apollo/server/resolvers/modelResolver.ts ================================================ import { CreateModelData, UpdateModelData, UpdateModelMetadataInput, CreateCalculatedFieldData, UpdateCalculatedFieldData, UpdateViewMetadataInput, PreviewSQLData, } from '../models'; import { DataSourceName, IContext, RelationData, UpdateRelationData, } from '../types'; import { getLogger, transformInvalidColumnName } from '@server/utils'; import { DeployResponse } from '../services/deployService'; import { safeFormatSQL } from '@server/utils/sqlFormat'; import { isEmpty, isNil } from 'lodash'; import { replaceAllowableSyntax, validateDisplayName } from '../utils/regex'; import { Model, ModelColumn } from '../repositories'; import { findColumnsToUpdate, getPreviewColumnsStr, handleNestedColumns, replaceInvalidReferenceName, updateModelPrimaryKey, } from '../utils/model'; import { CompactTable, PreviewDataResponse } from '@server/services'; import { TelemetryEvent } from '../telemetry/telemetry'; const logger = getLogger('ModelResolver'); logger.level = 'debug'; export enum SyncStatusEnum { IN_PROGRESS = 'IN_PROGRESS', SYNCRONIZED = 'SYNCRONIZED', UNSYNCRONIZED = 'UNSYNCRONIZED', } export class ModelResolver { constructor() { // model & model column this.listModels = this.listModels.bind(this); this.getModel = this.getModel.bind(this); this.createModel = this.createModel.bind(this); this.updateModel = this.updateModel.bind(this); this.deleteModel = this.deleteModel.bind(this); this.updateModelMetadata = this.updateModelMetadata.bind(this); this.deploy = this.deploy.bind(this); this.getMDL = this.getMDL.bind(this); this.checkModelSync = this.checkModelSync.bind(this); // view this.listViews = this.listViews.bind(this); this.getView = this.getView.bind(this); this.validateView = this.validateView.bind(this); this.createView = this.createView.bind(this); this.deleteView = this.deleteView.bind(this); this.updateViewMetadata = this.updateViewMetadata.bind(this); // preview this.previewModelData = this.previewModelData.bind(this); this.previewViewData = this.previewViewData.bind(this); this.previewSql = this.previewSql.bind(this); this.getNativeSql = this.getNativeSql.bind(this); // calculated field this.createCalculatedField = this.createCalculatedField.bind(this); this.validateCalculatedField = this.validateCalculatedField.bind(this); this.updateCalculatedField = this.updateCalculatedField.bind(this); this.deleteCalculatedField = this.deleteCalculatedField.bind(this); // relation this.createRelation = this.createRelation.bind(this); this.updateRelation = this.updateRelation.bind(this); this.deleteRelation = this.deleteRelation.bind(this); } public async createRelation( _root: any, args: { data: RelationData }, ctx: IContext, ) { const { data } = args; const eventName = TelemetryEvent.MODELING_CREATE_RELATION; try { const relation = await ctx.modelService.createRelation(data); ctx.telemetry.sendEvent(eventName, { data }); return relation; } catch (err: any) { ctx.telemetry.sendEvent( eventName, { data: data, error: err.message }, err.extensions?.service, false, ); throw err; } } public async updateRelation( _root: any, args: { data: UpdateRelationData; where: { id: number } }, ctx: IContext, ) { const { data, where } = args; const eventName = TelemetryEvent.MODELING_UPDATE_RELATION; try { const relation = await ctx.modelService.updateRelation(data, where.id); ctx.telemetry.sendEvent(eventName, { data }); return relation; } catch (err: any) { ctx.telemetry.sendEvent( eventName, { data: data, error: err.message }, err.extensions?.service, false, ); throw err; } } public async deleteRelation( _root: any, args: { where: { id: number } }, ctx: IContext, ) { const relationId = args.where.id; await ctx.modelService.deleteRelation(relationId); return true; } public async createCalculatedField( _root: any, _args: { data: CreateCalculatedFieldData }, ctx: IContext, ) { const eventName = TelemetryEvent.MODELING_CREATE_CF; try { const column = await ctx.modelService.createCalculatedField(_args.data); ctx.telemetry.sendEvent(eventName, { data: _args.data }); return column; } catch (err: any) { ctx.telemetry.sendEvent( eventName, { data: _args.data, error: err.message }, err.extensions?.service, false, ); throw err; } } public async validateCalculatedField(_root: any, args: any, ctx: IContext) { const { name, modelId, columnId } = args.data; return await ctx.modelService.validateCalculatedFieldNaming( name, modelId, columnId, ); } public async updateCalculatedField( _root: any, _args: { data: UpdateCalculatedFieldData; where: { id: number } }, ctx: IContext, ) { const { data, where } = _args; const eventName = TelemetryEvent.MODELING_UPDATE_CF; try { const column = await ctx.modelService.updateCalculatedField( data, where.id, ); ctx.telemetry.sendEvent(eventName, { data }); return column; } catch (err: any) { ctx.telemetry.sendEvent( eventName, { data: data, error: err.message }, err.extensions?.service, false, ); throw err; } } public async deleteCalculatedField(_root: any, args: any, ctx: IContext) { const columnId = args.where.id; // check column exist and is calculated field const column = await ctx.modelColumnRepository.findOneBy({ id: columnId }); if (!column || !column.isCalculated) { throw new Error('Calculated field not found'); } await ctx.modelColumnRepository.deleteOne(columnId); return true; } public async checkModelSync(_root: any, _args: any, ctx: IContext) { const { id } = await ctx.projectService.getCurrentProject(); const { manifest } = await ctx.mdlService.makeCurrentModelMDL(); const currentHash = ctx.deployService.createMDLHash(manifest, id); const lastDeploy = await ctx.deployService.getLastDeployment(id); const lastDeployHash = lastDeploy?.hash; const inProgressDeployment = await ctx.deployService.getInProgressDeployment(id); if (inProgressDeployment) { return { status: SyncStatusEnum.IN_PROGRESS }; } return currentHash == lastDeployHash ? { status: SyncStatusEnum.SYNCRONIZED } : { status: SyncStatusEnum.UNSYNCRONIZED }; } public async deploy( _root: any, args: { force: boolean }, ctx: IContext, ): Promise { const project = await ctx.projectService.getCurrentProject(); if (!project.version && project.type !== DataSourceName.DUCKDB) { const version = await ctx.projectService.getProjectDataSourceVersion(project); await ctx.projectService.updateProject(project.id, { version, }); } const { manifest } = await ctx.mdlService.makeCurrentModelMDL(); const deployRes = await ctx.deployService.deploy( manifest, project.id, args.force, ); // only generating for user's data source if (project.sampleDataset === null) { await ctx.projectService.generateProjectRecommendationQuestions(); } return deployRes; } public async getMDL(_root: any, args: { hash: string }, ctx: IContext) { const mdl = await ctx.deployService.getMDLByHash(args.hash); return { hash: args.hash, mdl, }; } public async listModels(_root: any, _args: any, ctx: IContext) { const { id: projectId } = await ctx.projectService.getCurrentProject(); const models = await ctx.modelRepository.findAllBy({ projectId }); const modelIds = models.map((m) => m.id); const modelColumnList = await ctx.modelColumnRepository.findColumnsByModelIds(modelIds); const modelNestedColumnList = await ctx.modelNestedColumnRepository.findNestedColumnsByModelIds( modelIds, ); const result = []; for (const model of models) { const modelFields = modelColumnList .filter((c) => c.modelId === model.id) .map((c) => ({ ...c, properties: JSON.parse(c.properties), nestedColumns: c.type.includes('STRUCT') ? modelNestedColumnList.filter((nc) => nc.columnId === c.id) : undefined, })); const fields = modelFields.filter((c) => !c.isCalculated); const calculatedFields = modelFields.filter((c) => c.isCalculated); result.push({ ...model, fields, calculatedFields, properties: { ...JSON.parse(model.properties), }, }); } return result; } public async getModel(_root: any, args: any, ctx: IContext) { const modelId = args.where.id; const model = await ctx.modelRepository.findOneBy({ id: modelId }); if (!model) { throw new Error('Model not found'); } const modelColumns = await ctx.modelColumnRepository.findColumnsByModelIds([ model.id, ]); const modelNestedColumns = await ctx.modelNestedColumnRepository.findAllBy({ modelId: model.id, }); const columns = modelColumns.map((c) => ({ ...c, properties: JSON.parse(c.properties), nestedColumns: c.type.includes('STRUCT') ? modelNestedColumns.filter((nc) => nc.columnId === c.id) : undefined, })); const relations = ( await ctx.relationRepository.findRelationsBy({ columnIds: modelColumns.map((c) => c.id), }) ).map((r) => ({ ...r, type: r.joinType, properties: r.properties ? JSON.parse(r.properties) : {}, })); return { ...model, fields: columns.filter((c) => !c.isCalculated), calculatedFields: columns.filter((c) => c.isCalculated), relations, properties: { ...JSON.parse(model.properties), }, }; } public async createModel( _root: any, args: { data: CreateModelData }, ctx: IContext, ) { const { sourceTableName, fields, primaryKey } = args.data; try { const model = await this.handleCreateModel( ctx, sourceTableName, fields, primaryKey, ); ctx.telemetry.sendEvent(TelemetryEvent.MODELING_CREATE_MODEL, { data: args.data, }); return model; } catch (error: any) { ctx.telemetry.sendEvent( TelemetryEvent.MODELING_CREATE_MODEL, { data: args.data, error }, error.extensions?.service, false, ); throw error; } } private async handleCreateModel( ctx: IContext, sourceTableName: string, fields: [string], primaryKey: string, ) { const project = await ctx.projectService.getCurrentProject(); const dataSourceTables = await ctx.projectService.getProjectDataSourceTables(project); this.validateTableExist(sourceTableName, dataSourceTables); this.validateColumnsExist(sourceTableName, fields, dataSourceTables); // create model const dataSourceTable = dataSourceTables.find( (table) => table.name === sourceTableName, ); if (!dataSourceTable) { throw new Error('Table not found in the data source'); } const properties = dataSourceTable?.properties; const modelValue = { projectId: project.id, displayName: sourceTableName, //use table name as displayName, referenceName and tableName referenceName: replaceInvalidReferenceName(sourceTableName), sourceTableName: sourceTableName, cached: false, refreshTime: null, properties: properties ? JSON.stringify(properties) : null, } as Partial; const model = await ctx.modelRepository.createOne(modelValue); // create columns const compactColumns = dataSourceTable.columns.filter((c) => fields.includes(c.name), ); const columnValues = compactColumns.map( (column) => ({ modelId: model.id, isCalculated: false, displayName: column.name, referenceName: transformInvalidColumnName(column.name), sourceColumnName: column.name, type: column.type || 'string', notNull: column.notNull || false, isPk: primaryKey === column.name, properties: column.properties ? JSON.stringify(column.properties) : null, }) as Partial, ); const columns = await ctx.modelColumnRepository.createMany(columnValues); // create nested columns const nestedColumnValues = compactColumns.flatMap((compactColumn) => { const column = columns.find( (c) => c.sourceColumnName === compactColumn.name, ); if (!column) return []; return handleNestedColumns(compactColumn, { modelId: column.modelId, columnId: column.id, sourceColumnName: column.sourceColumnName, }); }); await ctx.modelNestedColumnRepository.createMany(nestedColumnValues); logger.info(`Model created: ${JSON.stringify(model)}`); return model; } public async updateModel( _root: any, args: { data: UpdateModelData; where: { id: number } }, ctx: IContext, ) { const { fields, primaryKey } = args.data; try { const model = await this.handleUpdateModel(ctx, args, fields, primaryKey); ctx.telemetry.sendEvent(TelemetryEvent.MODELING_UPDATE_MODEL, { data: args.data, }); return model; } catch (err: any) { ctx.telemetry.sendEvent( TelemetryEvent.MODELING_UPDATE_MODEL, { data: args.data, error: err.message }, err.extensions?.service, false, ); throw err; } } private async handleUpdateModel( ctx: IContext, args: { data: UpdateModelData; where: { id: number } }, fields: [string], primaryKey: string, ) { const project = await ctx.projectService.getCurrentProject(); const dataSourceTables = await ctx.projectService.getProjectDataSourceTables(project); const model = await ctx.modelRepository.findOneBy({ id: args.where.id }); const existingColumns = await ctx.modelColumnRepository.findAllBy({ modelId: model.id, isCalculated: false, }); const { sourceTableName } = model; this.validateTableExist(sourceTableName, dataSourceTables); this.validateColumnsExist(sourceTableName, fields, dataSourceTables); const sourceTableColumns = dataSourceTables.find( (table) => table.name === sourceTableName, )?.columns; const { toDeleteColumnIds, toCreateColumns, toUpdateColumns } = findColumnsToUpdate(fields, existingColumns, sourceTableColumns); await updateModelPrimaryKey( ctx.modelColumnRepository, model.id, primaryKey, ); // delete columns if (toDeleteColumnIds.length) { await ctx.modelColumnRepository.deleteMany(toDeleteColumnIds); } // create columns if (toCreateColumns.length) { const compactColumns = sourceTableColumns.filter((sourceColumn) => toCreateColumns.includes(sourceColumn.name), ); const columnValues = compactColumns.map((column) => { const columnValue = { modelId: model.id, isCalculated: false, displayName: column.name, sourceColumnName: column.name, referenceName: transformInvalidColumnName(column.name), type: column.type || 'string', notNull: column.notNull, isPk: primaryKey === column.name, properties: column.properties ? JSON.stringify(column.properties) : null, } as Partial; return columnValue; }); const columns = await ctx.modelColumnRepository.createMany(columnValues); // create nested columns const nestedColumnValues = compactColumns.flatMap((compactColumn) => { const column = columns.find( (c) => c.sourceColumnName === compactColumn.name, ); return handleNestedColumns(compactColumn, { modelId: column.modelId, columnId: column.id, sourceColumnName: column.sourceColumnName, }); }); await ctx.modelNestedColumnRepository.createMany(nestedColumnValues); } // update columns if (toUpdateColumns.length) { for (const { id, sourceColumnName, type } of toUpdateColumns) { const column = await ctx.modelColumnRepository.updateOne(id, { type }); // if the struct type is changed, need to re-create nested columns if (type.includes('STRUCT')) { const sourceColumn = sourceTableColumns.find( (sourceColumn) => sourceColumn.name === sourceColumnName, ); await ctx.modelNestedColumnRepository.deleteAllBy({ columnId: column.id, }); await ctx.modelNestedColumnRepository.createMany( handleNestedColumns(sourceColumn, { modelId: column.modelId, columnId: column.id, sourceColumnName: sourceColumnName, }), ); } } } logger.info(`Model updated: ${JSON.stringify(model)}`); return model; } // delete model public async deleteModel(_root: any, args: any, ctx: IContext) { const modelId = args.where.id; const model = await ctx.modelRepository.findOneBy({ id: modelId }); if (!model) { throw new Error('Model not found'); } // related columns and relationships will be deleted in cascade await ctx.modelRepository.deleteOne(modelId); return true; } // update model metadata public async updateModelMetadata( _root: any, args: { where: { id: number }; data: UpdateModelMetadataInput }, ctx: IContext, ): Promise { const modelId = args.where.id; const data = args.data; // check if model exists const model = await ctx.modelRepository.findOneBy({ id: modelId }); if (!model) { throw new Error('Model not found'); } const eventName = TelemetryEvent.MODELING_UPDATE_MODEL_METADATA; try { // update model metadata await this.handleUpdateModelMetadata(data, model, ctx, modelId); // todo: considering using update ... from statement to do a batch update // update column metadata if (!isEmpty(data.columns)) { // find the columns that match the user requested columns await this.handleUpdateColumnMetadata(data, ctx); } // update nested column metadata if (!isEmpty(data.nestedColumns)) { await this.handleUpdateNestedColumnMetadata(data, ctx); } // update calculated field metadata if (!isEmpty(data.calculatedFields)) { await this.handleUpdateCFMetadata(data, ctx); } // update relationship metadata if (!isEmpty(data.relationships)) { await this.handleUpdateRelationshipMetadata(data, ctx); } ctx.telemetry.sendEvent(eventName, { data }); return true; } catch (err: any) { ctx.telemetry.sendEvent( eventName, { data: data, error: err.message }, err.extensions?.service, false, ); throw err; } } private async handleUpdateModelMetadata( data: UpdateModelMetadataInput, model: Model, ctx: IContext, modelId: number, ) { const modelMetadata: any = {}; // if displayName is not null, or undefined, update the displayName if (!isNil(data.displayName)) { modelMetadata.displayName = this.determineMetadataValue(data.displayName); } // if description is not null, or undefined, update the description in properties if (!isNil(data.description)) { const properties = isNil(model.properties) ? {} : JSON.parse(model.properties); properties.description = this.determineMetadataValue(data.description); modelMetadata.properties = JSON.stringify(properties); } if (!isEmpty(modelMetadata)) { await ctx.modelRepository.updateOne(modelId, modelMetadata); } } private async handleUpdateRelationshipMetadata( data: UpdateModelMetadataInput, ctx: IContext, ) { const relationshipIds = data.relationships.map((r) => r.id); const relationships = await ctx.relationRepository.findRelationsByIds(relationshipIds); for (const rel of relationships) { const requestedMetadata = data.relationships.find((r) => r.id === rel.id); const relationMetadata: any = {}; if (!isNil(requestedMetadata.description)) { const properties = rel.properties ? JSON.parse(rel.properties) : {}; properties.description = this.determineMetadataValue( requestedMetadata.description, ); relationMetadata.properties = JSON.stringify(properties); } if (!isEmpty(relationMetadata)) { await ctx.relationRepository.updateOne(rel.id, relationMetadata); } } } private async handleUpdateCFMetadata( data: UpdateModelMetadataInput, ctx: IContext, ) { const calculatedFieldIds = data.calculatedFields.map((c) => c.id); const modelColumns = await ctx.modelColumnRepository.findColumnsByIds(calculatedFieldIds); for (const col of modelColumns) { const requestedMetadata = data.calculatedFields.find( (c) => c.id === col.id, ); const columnMetadata: any = {}; // check if description is empty // if description is empty, skip the update // if description is not empty, update the description in properties if (!isNil(requestedMetadata.description)) { const properties = col.properties ? JSON.parse(col.properties) : {}; properties.description = this.determineMetadataValue( requestedMetadata.description, ); columnMetadata.properties = JSON.stringify(properties); } if (!isEmpty(columnMetadata)) { await ctx.modelColumnRepository.updateOne(col.id, columnMetadata); } } } private async handleUpdateColumnMetadata( data: UpdateModelMetadataInput, ctx: IContext, ) { const columnIds = data.columns.map((c) => c.id); const modelColumns = await ctx.modelColumnRepository.findColumnsByIds(columnIds); for (const col of modelColumns) { const requestedMetadata = data.columns.find((c) => c.id === col.id); // update metadata const columnMetadata: any = {}; if (!isNil(requestedMetadata.displayName)) { columnMetadata.displayName = this.determineMetadataValue( requestedMetadata.displayName, ); } if (!isNil(requestedMetadata.description)) { const properties = col.properties ? JSON.parse(col.properties) : {}; properties.description = this.determineMetadataValue( requestedMetadata.description, ); columnMetadata.properties = JSON.stringify(properties); } if (!isEmpty(columnMetadata)) { await ctx.modelColumnRepository.updateOne(col.id, columnMetadata); } } } private async handleUpdateNestedColumnMetadata( data: UpdateModelMetadataInput, ctx: IContext, ) { const nestedColumnIds = data.nestedColumns.map((nc) => nc.id); const modelNestedColumns = await ctx.modelNestedColumnRepository.findNestedColumnsByIds( nestedColumnIds, ); for (const col of modelNestedColumns) { const requestedMetadata = data.nestedColumns.find((c) => c.id === col.id); const nestedColumnMetadata: any = {}; if (!isNil(requestedMetadata.displayName)) { nestedColumnMetadata.displayName = this.determineMetadataValue( requestedMetadata.displayName, ); } if (!isNil(requestedMetadata.description)) { nestedColumnMetadata.properties = { ...col.properties, description: this.determineMetadataValue( requestedMetadata.description, ), }; } if (!isEmpty(nestedColumnMetadata)) { await ctx.modelNestedColumnRepository.updateOne( col.id, nestedColumnMetadata, ); } } } // list views public async listViews(_root: any, _args: any, ctx: IContext) { const { id } = await ctx.projectService.getCurrentProject(); const views = await ctx.viewRepository.findAllBy({ projectId: id }); return views.map((view) => ({ ...view, displayName: view.properties ? JSON.parse(view.properties)?.displayName : view.name, })); } public async getView(_root: any, args: any, ctx: IContext) { const viewId = args.where.id; const view = await ctx.viewRepository.findOneBy({ id: viewId }); if (!view) { throw new Error('View not found'); } const displayName = view.properties ? JSON.parse(view.properties)?.displayName : view.name; return { ...view, displayName }; } // validate a view name public async validateView(_root: any, args: any, ctx: IContext) { const { name } = args.data; return this.validateViewName(name, ctx); } // create view from sql of a response public async createView(_root: any, args: any, ctx: IContext) { const { name: displayName, responseId, rephrasedQuestion } = args.data; // validate view name const validateResult = await this.validateViewName(displayName, ctx); if (!validateResult.valid) { throw new Error(validateResult.message); } // create view const project = await ctx.projectService.getCurrentProject(); const { manifest } = await ctx.deployService.getLastDeployment(project.id); // get sql statement of a response const response = await ctx.askingService.getResponse(responseId); if (!response) { throw new Error(`Thread response ${responseId} not found`); } // construct cte sql and format it const statement = safeFormatSQL(response.sql); // describe columns const { columns } = await ctx.queryService.describeStatement(statement, { project, limit: 1, modelingOnly: false, manifest, }); if (isEmpty(columns)) { throw new Error('Failed to describe statement'); } // properties const properties = { displayName, columns, // properties from the thread response responseId, // helpful for mapping back to the thread response question: rephrasedQuestion, }; const eventName = TelemetryEvent.HOME_CREATE_VIEW; const eventProperties = { statement, displayName, }; // create view try { const name = replaceAllowableSyntax(displayName); const view = await ctx.viewRepository.createOne({ projectId: project.id, name, statement, properties: JSON.stringify(properties), }); // telemetry ctx.telemetry.sendEvent(eventName, eventProperties); return { ...view, displayName }; } catch (err: any) { ctx.telemetry.sendEvent( eventName, { ...eventProperties, error: err, }, err.extensions?.service, false, ); throw err; } } // delete view public async deleteView(_root: any, args: any, ctx: IContext) { const viewId = args.where.id; const view = await ctx.viewRepository.findOneBy({ id: viewId }); if (!view) { throw new Error('View not found'); } await ctx.viewRepository.deleteOne(viewId); return true; } public async previewModelData(_root: any, args: any, ctx: IContext) { const modelId = args.where.id; const model = await ctx.modelRepository.findOneBy({ id: modelId }); if (!model) { throw new Error('Model not found'); } const project = await ctx.projectService.getCurrentProject(); const { manifest } = await ctx.mdlService.makeCurrentModelMDL(); const modelColumns = await ctx.modelColumnRepository.findColumnsByModelIds([ model.id, ]); const sql = `select ${getPreviewColumnsStr(modelColumns)} from "${model.referenceName}"`; const data = (await ctx.queryService.preview(sql, { project, modelingOnly: false, manifest, })) as PreviewDataResponse; return data; } public async previewViewData(_root: any, args: any, ctx: IContext) { const { id: viewId, limit } = args.where; const view = await ctx.viewRepository.findOneBy({ id: viewId }); if (!view) { throw new Error('View not found'); } const { manifest } = await ctx.mdlService.makeCurrentModelMDL(); const project = await ctx.projectService.getCurrentProject(); const data = (await ctx.queryService.preview(view.statement, { project, limit, manifest, modelingOnly: false, })) as PreviewDataResponse; return data; } // Notice: this is used by AI service. // any change to this resolver should be synced with AI service. public async previewSql( _root: any, args: { data: PreviewSQLData }, ctx: IContext, ) { const { sql, projectId, limit, dryRun } = args.data; const project = projectId ? await ctx.projectService.getProjectById(parseInt(projectId)) : await ctx.projectService.getCurrentProject(); const { manifest } = await ctx.deployService.getLastDeployment(project.id); return await ctx.queryService.preview(sql, { project, limit: limit, modelingOnly: false, manifest, dryRun, }); } public async getNativeSql( _root: any, args: { responseId: number }, ctx: IContext, ): Promise { const { responseId } = args; // If using a sample dataset, native SQL is not supported const project = await ctx.projectService.getCurrentProject(); if (project.sampleDataset) { throw new Error(`Doesn't support Native SQL`); } const { manifest } = await ctx.mdlService.makeCurrentModelMDL(); // get sql statement of a response const response = await ctx.askingService.getResponse(responseId); if (!response) { throw new Error(`Thread response ${responseId} not found`); } // construct cte sql and format it let nativeSql: string; if (project.type === DataSourceName.DUCKDB) { logger.info(`Getting native sql from wren engine`); nativeSql = await ctx.wrenEngineAdaptor.getNativeSQL(response.sql, { manifest, modelingOnly: false, }); } else { logger.info(`Getting native sql from ibis server`); nativeSql = await ctx.ibisServerAdaptor.getNativeSql({ dataSource: project.type, sql: response.sql, mdl: manifest, }); } const language = project.type === DataSourceName.MSSQL ? 'tsql' : undefined; return safeFormatSQL(nativeSql, { language }); } public async updateViewMetadata( _root: any, args: { where: { id: number }; data: UpdateViewMetadataInput }, ctx: IContext, ): Promise { const viewId = args.where.id; const data = args.data; // check if view exists const view = await ctx.viewRepository.findOneBy({ id: viewId }); if (!view) { throw new Error('View not found'); } // update view metadata const properties = JSON.parse(view.properties); let newName = view.name; // if displayName is not null, or undefined, update the displayName if (!isNil(data.displayName)) { await this.validateViewName(data.displayName, ctx, viewId); newName = replaceAllowableSyntax(data.displayName); properties.displayName = this.determineMetadataValue(data.displayName); } // if description is not null, or undefined, update the description in properties if (!isNil(data.description)) { properties.description = this.determineMetadataValue(data.description); } // view column metadata if (!isEmpty(data.columns)) { const viewColumns = properties.columns; for (const col of viewColumns) { const requestedMetadata = data.columns.find( (c) => c.referenceName === col.name, ); if (!isNil(requestedMetadata.description)) { col.properties = col.properties || {}; col.properties.description = this.determineMetadataValue( requestedMetadata.description, ); } } properties.columns = viewColumns; } await ctx.viewRepository.updateOne(viewId, { name: newName, properties: JSON.stringify(properties), }); return true; } private determineMetadataValue(value: string) { // if it's empty string, meaning users want to remove the value // so we return null if (value === '') { return null; } // otherwise, return the value return value; } // validate view name private async validateViewName( viewDisplayName: string, ctx: IContext, selfView?: number, ): Promise<{ valid: boolean; message?: string }> { // check if view name is valid // a-z, A-Z, 0-9, _, - are allowed and cannot start with number const { valid, message } = validateDisplayName(viewDisplayName); if (!valid) { return { valid: false, message, }; } const referenceName = replaceAllowableSyntax(viewDisplayName); // check if view name is duplicated const { id } = await ctx.projectService.getCurrentProject(); const views = await ctx.viewRepository.findAllBy({ projectId: id }); if (views.find((v) => v.name === referenceName && v.id !== selfView)) { return { valid: false, message: `Generated view name "${referenceName}" is duplicated`, }; } return { valid: true, }; } private validateTableExist( tableName: string, dataSourceTables: CompactTable[], ) { if (!dataSourceTables.find((c) => c.name === tableName)) { throw new Error(`Table ${tableName} not found in the data Source`); } } private validateColumnsExist( tableName: string, fields: string[], dataSourceTables: CompactTable[], ) { const tableColumns = dataSourceTables.find( (c) => c.name === tableName, )?.columns; for (const field of fields) { if (!tableColumns.find((c) => c.name === field)) { throw new Error( `Column "${field}" not found in table "${tableName}" in the data Source`, ); } } } } ================================================ FILE: wren-ui/src/apollo/server/resolvers/projectResolver.ts ================================================ import { AnalysisRelationInfo, DataSource, DataSourceName, DataSourceProperties, IContext, RelationData, RelationType, SampleDatasetData, } from '../types'; import { trim, getLogger, replaceInvalidReferenceName, transformInvalidColumnName, handleNestedColumns, } from '@server/utils'; import { DUCKDB_CONNECTION_INFO, Model, ModelColumn, Project, } from '../repositories'; import { SampleDatasetName, SampleDatasetRelationship, buildInitSql, getRelations, sampleDatasets, } from '@server/data'; import { snakeCase } from 'lodash'; import { CompactTable, ProjectData } from '../services'; import { DuckDBPrepareOptions } from '@server/adaptors/wrenEngineAdaptor'; import DataSourceSchemaDetector, { SchemaChangeType, } from '@server/managers/dataSourceSchemaDetector'; import { encryptConnectionInfo } from '../dataSource'; import { TelemetryEvent } from '../telemetry/telemetry'; const logger = getLogger('DataSourceResolver'); logger.level = 'debug'; export enum OnboardingStatusEnum { NOT_STARTED = 'NOT_STARTED', DATASOURCE_SAVED = 'DATASOURCE_SAVED', ONBOARDING_FINISHED = 'ONBOARDING_FINISHED', WITH_SAMPLE_DATASET = 'WITH_SAMPLE_DATASET', } export class ProjectResolver { constructor() { this.getSettings = this.getSettings.bind(this); this.updateCurrentProject = this.updateCurrentProject.bind(this); this.resetCurrentProject = this.resetCurrentProject.bind(this); this.saveDataSource = this.saveDataSource.bind(this); this.updateDataSource = this.updateDataSource.bind(this); this.listDataSourceTables = this.listDataSourceTables.bind(this); this.saveTables = this.saveTables.bind(this); this.autoGenerateRelation = this.autoGenerateRelation.bind(this); this.saveRelations = this.saveRelations.bind(this); this.getOnboardingStatus = this.getOnboardingStatus.bind(this); this.startSampleDataset = this.startSampleDataset.bind(this); this.triggerDataSourceDetection = this.triggerDataSourceDetection.bind(this); this.getSchemaChange = this.getSchemaChange.bind(this); this.getProjectRecommendationQuestions = this.getProjectRecommendationQuestions.bind(this); } public async getSettings(_root: any, _arg: any, ctx: IContext) { const project = await ctx.projectService.getCurrentProject(); const generalConnectionInfo = ctx.projectService.getGeneralConnectionInfo(project); const dataSourceType = project.type; return { productVersion: ctx.config.wrenProductVersion || '', dataSource: { type: dataSourceType, properties: { displayName: project.displayName, ...generalConnectionInfo, } as DataSourceProperties, sampleDataset: project.sampleDataset, }, language: project.language, }; } public async getProjectRecommendationQuestions( _root: any, _arg: any, ctx: IContext, ) { return ctx.projectService.getProjectRecommendationQuestions(); } public async updateCurrentProject( _root: any, arg: { data: { language: string } }, ctx: IContext, ) { const { language } = arg.data; const project = await ctx.projectService.getCurrentProject(); await ctx.projectRepository.updateOne(project.id, { language, }); // only generating for user's data source if (project.sampleDataset === null) { await ctx.projectService.generateProjectRecommendationQuestions(); } return true; } public async resetCurrentProject(_root: any, _arg: any, ctx: IContext) { let project; try { project = await ctx.projectService.getCurrentProject(); } catch { // no project found return true; } const eventName = TelemetryEvent.SETTING_RESET_PROJECT; try { const id = project.id; await ctx.schemaChangeRepository.deleteAllBy({ projectId: id }); await ctx.deployService.deleteAllByProjectId(id); await ctx.askingService.deleteAllByProjectId(id); await ctx.modelService.deleteAllViewsByProjectId(id); await ctx.modelService.deleteAllModelsByProjectId(id); await ctx.projectService.deleteProject(id); await ctx.wrenAIAdaptor.delete(id); // telemetry ctx.telemetry.sendEvent(eventName, { projectId: id, dataSourceType: project.type, }); } catch (err: any) { ctx.telemetry.sendEvent( eventName, { dataSourceType: project.type, error: err.message }, err.extensions?.service, false, ); throw err; } return true; } public async startSampleDataset( _root: any, _arg: { data: SampleDatasetData }, ctx: IContext, ) { const { name } = _arg.data; const dataset = sampleDatasets[snakeCase(name)]; if (!dataset) { throw new Error('Sample dataset not found'); } if (!(name in SampleDatasetName)) { throw new Error('Invalid sample dataset name'); } const eventName = TelemetryEvent.CONNECTION_START_SAMPLE_DATASET; const eventProperties = { datasetName: name, }; try { // create duckdb datasource const initSql = buildInitSql(name as SampleDatasetName); const duckdbDatasourceProperties = { initSql, extensions: [], configurations: {}, }; await this.saveDataSource( _root, { data: { type: DataSourceName.DUCKDB, properties: duckdbDatasourceProperties, } as DataSource, }, ctx, ); const project = await ctx.projectService.getCurrentProject(); // list all the tables in the data source const tables = await this.listDataSourceTables(_root, _arg, ctx); const tableNames = tables.map((table) => table.name); // save tables as model and modelColumns await this.overwriteModelsAndColumns(tableNames, ctx, project); await ctx.modelService.updatePrimaryKeys(dataset.tables); await ctx.modelService.batchUpdateModelProperties(dataset.tables); await ctx.modelService.batchUpdateColumnProperties(dataset.tables); // save relations const relations = getRelations(name as SampleDatasetName); const models = await ctx.modelRepository.findAll(); const columns = await ctx.modelColumnRepository.findAll(); const mappedRelations = this.buildRelationInput( relations, models, columns, ); await ctx.modelService.saveRelations(mappedRelations); // mark current project as using sample dataset await ctx.projectRepository.updateOne(project.id, { sampleDataset: name, }); await this.deploy(ctx); // telemetry ctx.telemetry.sendEvent(eventName, eventProperties); return { name }; } catch (err: any) { ctx.telemetry.sendEvent( eventName, { ...eventProperties, error: err.message }, err.extensions?.service, false, ); throw err; } } public async getOnboardingStatus(_root: any, _arg: any, ctx: IContext) { let project: Project | null; try { project = await ctx.projectRepository.getCurrentProject(); } catch (_err: any) { return { status: OnboardingStatusEnum.NOT_STARTED, }; } const { id, sampleDataset } = project; if (sampleDataset) { return { status: OnboardingStatusEnum.WITH_SAMPLE_DATASET, }; } const models = await ctx.modelRepository.findAllBy({ projectId: id }); if (!models.length) { return { status: OnboardingStatusEnum.DATASOURCE_SAVED, }; } else { return { status: OnboardingStatusEnum.ONBOARDING_FINISHED, }; } } public async saveDataSource( _root: any, args: { data: DataSource; }, ctx: IContext, ) { const { type, properties } = args.data; // Currently only can create one project await this.resetCurrentProject(_root, args, ctx); const { displayName, ...connectionInfo } = properties; const project = await ctx.projectService.createProject({ displayName, type, connectionInfo, } as ProjectData); logger.debug(`Project created.`); // init dashboard logger.debug('Dashboard init...'); await ctx.dashboardService.initDashboard(); logger.debug('Dashboard created.'); const eventName = TelemetryEvent.CONNECTION_SAVE_DATA_SOURCE; const eventProperties = { dataSourceType: type, }; // try to connect to the data source try { // handle duckdb connection if (type === DataSourceName.DUCKDB) { connectionInfo as DUCKDB_CONNECTION_INFO; await this.buildDuckDbEnvironment(ctx, { initSql: connectionInfo.initSql, extensions: connectionInfo.extensions, configurations: connectionInfo.configurations, }); } else { // handle other data source await ctx.projectService.getProjectDataSourceTables(project); const version = await ctx.projectService.getProjectDataSourceVersion(project); await ctx.projectService.updateProject(project.id, { version, }); logger.debug(`Data source tables fetched`); } // telemetry ctx.telemetry.sendEvent(eventName, eventProperties); } catch (err) { logger.error( 'Failed to get project tables', JSON.stringify(err, null, 2), ); await ctx.projectRepository.deleteOne(project.id); ctx.telemetry.sendEvent( eventName, { eventProperties, error: err.message }, err.extensions?.service, false, ); throw err; } return { type: project.type, properties: { displayName: project.displayName, ...ctx.projectService.getGeneralConnectionInfo(project), }, }; } public async updateDataSource( _root: any, args: { data: DataSource }, ctx: IContext, ) { const { properties } = args.data; const { displayName, ...connectionInfo } = properties; const project = await ctx.projectService.getCurrentProject(); const dataSourceType = project.type; // only new connection info needed to encrypt const toUpdateConnectionInfo = encryptConnectionInfo( dataSourceType, connectionInfo as any, ); if (dataSourceType === DataSourceName.DUCKDB) { // prepare duckdb environment in wren-engine const { initSql, extensions, configurations } = toUpdateConnectionInfo as DUCKDB_CONNECTION_INFO; await this.buildDuckDbEnvironment(ctx, { initSql, extensions, configurations, }); } else { const updatedProject = { ...project, displayName, connectionInfo: { ...project.connectionInfo, ...toUpdateConnectionInfo, }, } as Project; await ctx.projectService.getProjectDataSourceTables(updatedProject); logger.debug(`Data source tables fetched`); } const updatedProject = await ctx.projectRepository.updateOne(project.id, { displayName, connectionInfo: { ...project.connectionInfo, ...toUpdateConnectionInfo }, }); return { type: updatedProject.type, properties: { displayName: updatedProject.displayName, ...ctx.projectService.getGeneralConnectionInfo(updatedProject), }, }; } public async listDataSourceTables(_root: any, _arg, ctx: IContext) { return await ctx.projectService.getProjectDataSourceTables(); } public async saveTables( _root: any, arg: { data: { tables: string[] }; }, ctx: IContext, ) { const eventName = TelemetryEvent.CONNECTION_SAVE_TABLES; // get current project const project = await ctx.projectService.getCurrentProject(); try { // delete existing models and columns const { models, columns } = await this.overwriteModelsAndColumns( arg.data.tables, ctx, project, ); // telemetry ctx.telemetry.sendEvent(eventName, { dataSourceType: project.type, tablesCount: models.length, columnsCount: columns.length, }); // async deploy to wren-engine and ai service this.deploy(ctx); return { models: models, columns }; } catch (err: any) { ctx.telemetry.sendEvent( eventName, { dataSourceType: project.type, error: err.message }, err.extensions?.service, false, ); throw err; } } public async autoGenerateRelation(_root: any, _arg: any, ctx: IContext) { const project = await ctx.projectService.getCurrentProject(); // get models and columns const models = await ctx.modelRepository.findAllBy({ projectId: project.id, }); const modelIds = models.map((m) => m.id); const columns = await ctx.modelColumnRepository.findColumnsByModelIds(modelIds); const constraints = await ctx.projectService.getProjectSuggestedConstraint(project); // generate relation const relations = []; for (const constraint of constraints) { const { constraintTable, constraintColumn, constraintedTable, constraintedColumn, } = constraint; // validate tables and columns exists in our models and model columns const fromModel = models.find( (m) => m.sourceTableName === constraintTable, ); const toModel = models.find( (m) => m.sourceTableName === constraintedTable, ); if (!fromModel || !toModel) { continue; } const fromColumn = columns.find( (c) => c.modelId === fromModel.id && c.sourceColumnName === constraintColumn, ); const toColumn = columns.find( (c) => c.modelId === toModel.id && c.sourceColumnName === constraintedColumn, ); if (!fromColumn || !toColumn) { continue; } // create relation const relation: AnalysisRelationInfo = { // upper case the first letter of the sourceTableName name: constraint.constraintName, fromModelId: fromModel.id, fromModelReferenceName: fromModel.referenceName, fromColumnId: fromColumn.id, fromColumnReferenceName: fromColumn.referenceName, toModelId: toModel.id, toModelReferenceName: toModel.referenceName, toColumnId: toColumn.id, toColumnReferenceName: toColumn.referenceName, // TODO: add join type type: RelationType.ONE_TO_MANY, }; relations.push(relation); } // group by model return models.map(({ id, displayName, referenceName }) => ({ id, displayName, referenceName, relations: relations.filter( (relation) => relation.fromModelId === id && // exclude self-referential relationship relation.toModelId !== relation.fromModelId, ), })); } public async saveRelations( _root: any, arg: { data: { relations: RelationData[] } }, ctx: IContext, ) { const eventName = TelemetryEvent.CONNECTION_SAVE_RELATION; try { const savedRelations = await ctx.modelService.saveRelations( arg.data.relations, ); // async deploy this.deploy(ctx); ctx.telemetry.sendEvent(eventName, { relationCount: savedRelations.length, }); return savedRelations; } catch (err: any) { ctx.telemetry.sendEvent( eventName, { error: err.message }, err.extensions?.service, false, ); throw err; } } public async getSchemaChange(_root: any, _arg: any, ctx: IContext) { const project = await ctx.projectService.getCurrentProject(); const lastSchemaChange = await ctx.schemaChangeRepository.findLastSchemaChange(project.id); if (!lastSchemaChange) { return { deletedTables: null, deletedColumns: null, modifiedColumns: null, lastSchemaChangeTime: null, }; } const models = await ctx.modelRepository.findAllBy({ projectId: project.id, }); const modelIds = models.map((model) => model.id); const modelColumns = await ctx.modelColumnRepository.findColumnsByModelIds(modelIds); const modelRelationships = await ctx.relationRepository.findRelationInfoBy({ modelIds, }); const schemaDetector = new DataSourceSchemaDetector({ ctx, projectId: project.id, }); const resolves = lastSchemaChange.resolve; const unresolvedChanges = Object.keys(resolves).reduce((result, key) => { const isResolved = resolves[key]; const changes = lastSchemaChange.change[key]; // return if resolved or no changes if (isResolved || !changes) return result; // Mapping with affected models and columns and affected calculated fields and relationships data into schema change const affecteds = schemaDetector.getAffectedResources(changes, { models, modelColumns, modelRelationships, }); const affectedChanges = affecteds.length ? affecteds : null; return { ...result, [key]: affectedChanges }; }, {}); return { ...unresolvedChanges, lastSchemaChangeTime: lastSchemaChange.createdAt, }; } public async triggerDataSourceDetection( _root: any, _arg: any, ctx: IContext, ) { const project = await ctx.projectService.getCurrentProject(); const schemaDetector = new DataSourceSchemaDetector({ ctx, projectId: project.id, }); const eventName = TelemetryEvent.MODELING_DETECT_SCHEMA_CHANGE; try { const hasSchemaChange = await schemaDetector.detectSchemaChange(); ctx.telemetry.sendEvent(eventName, { hasSchemaChange }); return hasSchemaChange; } catch (error: any) { ctx.telemetry.sendEvent( eventName, { error }, error.extensions?.service, false, ); throw error; } } public async resolveSchemaChange( _root: any, arg: { where: { type: SchemaChangeType } }, ctx: IContext, ) { const { type } = arg.where; const project = await ctx.projectService.getCurrentProject(); const schemaDetector = new DataSourceSchemaDetector({ ctx, projectId: project.id, }); const eventName = TelemetryEvent.MODELING_RESOLVE_SCHEMA_CHANGE; try { await schemaDetector.resolveSchemaChange(type); ctx.telemetry.sendEvent(eventName, { type }); } catch (error) { ctx.telemetry.sendEvent( eventName, { type, error }, error.extensions?.service, false, ); throw error; } return true; } private async deploy(ctx: IContext) { const project = await ctx.projectService.getCurrentProject(); const { manifest } = await ctx.mdlService.makeCurrentModelMDL(); const deployRes = await ctx.deployService.deploy(manifest, project.id); // only generating for user's data source if (project.sampleDataset === null) { await ctx.projectService.generateProjectRecommendationQuestions(); } return deployRes; } private buildRelationInput( relations: SampleDatasetRelationship[], models: Model[], columns: ModelColumn[], ) { const relationInput = relations.map((relation) => { const { fromModelName, fromColumnName, toModelName, toColumnName, type } = relation; const fromModelId = models.find( (model) => model.sourceTableName === fromModelName, )?.id; const toModelId = models.find( (model) => model.sourceTableName === toModelName, )?.id; if (!fromModelId || !toModelId) { throw new Error( `Model not found, fromModelName "${fromModelName}" to toModelName: "${toModelName}"`, ); } const fromColumnId = columns.find( (column) => column.referenceName === fromColumnName && column.modelId === fromModelId, )?.id; const toColumnId = columns.find( (column) => column.referenceName === toColumnName && column.modelId === toModelId, )?.id; if (!fromColumnId || !toColumnId) { throw new Error( `Column not found fromColumnName: ${fromColumnName} toColumnName: ${toColumnName}`, ); } return { fromModelId, fromColumnId, toModelId, toColumnId, type, description: relation.description, } as RelationData; }); return relationInput; } private async overwriteModelsAndColumns( tables: string[], ctx: IContext, project: Project, ) { // delete existing models and columns await ctx.modelService.deleteAllModelsByProjectId(project.id); const compactTables: CompactTable[] = await ctx.projectService.getProjectDataSourceTables(project); const selectedTables = compactTables.filter((table) => tables.includes(table.name), ); // create models const modelValues = selectedTables.map((table) => { const properties = table?.properties; // compactTable contain schema and catalog, these information are for building tableReference in mdl const model = { projectId: project.id, displayName: table.name, // use table name as displayName, referenceName and tableName referenceName: replaceInvalidReferenceName(table.name), sourceTableName: table.name, cached: false, refreshTime: null, properties: properties ? JSON.stringify(properties) : null, } as Partial; return model; }); const models = await ctx.modelRepository.createMany(modelValues); // create columns const columnValues = selectedTables.flatMap((table) => { const compactColumns = table.columns; const primaryKey = table.primaryKey; const model = models.find((m) => m.sourceTableName === table.name); return compactColumns.map( (column) => ({ modelId: model.id, isCalculated: false, displayName: column.name, referenceName: transformInvalidColumnName(column.name), sourceColumnName: column.name, type: column.type || 'string', notNull: column.notNull || false, isPk: primaryKey === column.name, properties: column.properties ? JSON.stringify(column.properties) : null, }) as Partial, ); }); const columns = await ctx.modelColumnRepository.createMany(columnValues); // create nested columns const compactColumns = selectedTables.flatMap((table) => table.columns); const nestedColumnValues = compactColumns.flatMap((compactColumn) => { const column = columns.find( (c) => c.sourceColumnName === compactColumn.name, ); return handleNestedColumns(compactColumn, { modelId: column.modelId, columnId: column.id, sourceColumnName: column.sourceColumnName, }); }); await ctx.modelNestedColumnRepository.createMany(nestedColumnValues); return { models, columns }; } private concatInitSql(initSql: string, extensions: string[]) { const installExtensions = extensions .map((ext) => `INSTALL ${ext};`) .join('\n'); return trim(`${installExtensions}\n${initSql}`); } private async buildDuckDbEnvironment( ctx: IContext, options: { initSql: string; extensions: string[]; configurations: Record; }, ): Promise { const { initSql, extensions, configurations } = options; const initSqlWithExtensions = this.concatInitSql(initSql, extensions); await ctx.wrenEngineAdaptor.prepareDuckDB({ sessionProps: configurations, initSql: initSqlWithExtensions, } as DuckDBPrepareOptions); // check can list dataset table await ctx.wrenEngineAdaptor.listTables(); // patch wren-engine config const config = { 'wren.datasource.type': 'duckdb', }; await ctx.wrenEngineAdaptor.patchConfig(config); } } ================================================ FILE: wren-ui/src/apollo/server/resolvers/sqlPairResolver.ts ================================================ import { IContext } from '@server/types/context'; import { SqlPair } from '@server/repositories'; import * as Errors from '@server/utils/error'; import { TelemetryEvent, TrackTelemetry } from '@server/telemetry/telemetry'; import { DialectSQL, WrenSQL } from '@server/models/adaptor'; import { safeFormatSQL } from '@server/utils/sqlFormat'; export class SqlPairResolver { constructor() { this.getProjectSqlPairs = this.getProjectSqlPairs.bind(this); this.createSqlPair = this.createSqlPair.bind(this); this.updateSqlPair = this.updateSqlPair.bind(this); this.deleteSqlPair = this.deleteSqlPair.bind(this); this.generateQuestion = this.generateQuestion.bind(this); this.modelSubstitute = this.modelSubstitute.bind(this); } public async getProjectSqlPairs( _root: unknown, _arg: any, ctx: IContext, ): Promise { const project = await ctx.projectService.getCurrentProject(); return ctx.sqlPairService.getProjectSqlPairs(project.id); } @TrackTelemetry(TelemetryEvent.KNOWLEDGE_CREATE_SQL_PAIR) public async createSqlPair( _root: unknown, arg: { data: { sql: string; question: string; }; }, ctx: IContext, ): Promise { const project = await ctx.projectService.getCurrentProject(); await this.validateSql(arg.data.sql, ctx); return await ctx.sqlPairService.createSqlPair(project.id, arg.data); } @TrackTelemetry(TelemetryEvent.KNOWLEDGE_UPDATE_SQL_PAIR) public async updateSqlPair( _root: unknown, arg: { data: { sql?: string; question?: string; }; where: { id: number; }; }, ctx: IContext, ): Promise { const project = await ctx.projectService.getCurrentProject(); await this.validateSql(arg.data.sql, ctx); return ctx.sqlPairService.editSqlPair(project.id, arg.where.id, arg.data); } @TrackTelemetry(TelemetryEvent.KNOWLEDGE_DELETE_SQL_PAIR) public async deleteSqlPair( _root: unknown, arg: { where: { id: number; }; }, ctx: IContext, ): Promise { const project = await ctx.projectService.getCurrentProject(); return ctx.sqlPairService.deleteSqlPair(project.id, arg.where.id); } public async generateQuestion( _root: unknown, arg: { data: { sql: string; }; }, ctx: IContext, ) { const project = await ctx.projectService.getCurrentProject(); const questions = await ctx.sqlPairService.generateQuestions(project, [ arg.data.sql, ]); return questions[0]; } public async modelSubstitute( _root: unknown, arg: { data: { sql: DialectSQL; }; }, ctx: IContext, ): Promise { const project = await ctx.projectService.getCurrentProject(); const lastDeployment = await ctx.deployService.getLastDeployment( project.id, ); const manifest = lastDeployment.manifest; const wrenSQL = await ctx.sqlPairService.modelSubstitute( arg.data.sql as DialectSQL, { project, manifest, }, ); return safeFormatSQL(wrenSQL, { language: 'postgresql' }) as WrenSQL; } private async validateSql(sql: string, ctx: IContext) { const project = await ctx.projectService.getCurrentProject(); const lastDeployment = await ctx.deployService.getLastDeployment( project.id, ); const manifest = lastDeployment.manifest; try { await ctx.queryService.preview(sql, { manifest, project, dryRun: true, }); } catch (err) { throw Errors.create(Errors.GeneralErrorCodes.INVALID_SQL_ERROR, { customMessage: err.message, }); } } public getSqlPairNestedResolver = () => ({ createdAt: (sqlPair: SqlPair, _args: any, _ctx: IContext) => { return new Date(sqlPair.createdAt).toISOString(); }, updatedAt: (sqlPair: SqlPair, _args: any, _ctx: IContext) => { return new Date(sqlPair.updatedAt).toISOString(); }, }); } ================================================ FILE: wren-ui/src/apollo/server/resolvers.ts ================================================ import GraphQLJSON from 'graphql-type-json'; import { ProjectResolver } from './resolvers/projectResolver'; import { ModelResolver } from './resolvers/modelResolver'; import { AskingResolver } from './resolvers/askingResolver'; import { DiagramResolver } from './resolvers/diagramResolver'; import { LearningResolver } from './resolvers/learningResolver'; import { DashboardResolver } from './resolvers/dashboardResolver'; import { SqlPairResolver } from './resolvers/sqlPairResolver'; import { InstructionResolver } from './resolvers/instructionResolver'; import { ApiHistoryResolver } from './resolvers/apiHistoryResolver'; import { convertColumnType } from '@server/utils'; import { DialectSQLScalar } from './scalars'; const projectResolver = new ProjectResolver(); const modelResolver = new ModelResolver(); const askingResolver = new AskingResolver(); const diagramResolver = new DiagramResolver(); const learningResolver = new LearningResolver(); const dashboardResolver = new DashboardResolver(); const sqlPairResolver = new SqlPairResolver(); const instructionResolver = new InstructionResolver(); const apiHistoryResolver = new ApiHistoryResolver(); const resolvers = { JSON: GraphQLJSON, DialectSQL: DialectSQLScalar, Query: { listDataSourceTables: projectResolver.listDataSourceTables, autoGenerateRelation: projectResolver.autoGenerateRelation, listModels: modelResolver.listModels, model: modelResolver.getModel, onboardingStatus: projectResolver.getOnboardingStatus, modelSync: modelResolver.checkModelSync, diagram: diagramResolver.getDiagram, schemaChange: projectResolver.getSchemaChange, // Ask askingTask: askingResolver.getAskingTask, suggestedQuestions: askingResolver.getSuggestedQuestions, instantRecommendedQuestions: askingResolver.getInstantRecommendedQuestions, // Adjustment adjustmentTask: askingResolver.getAdjustmentTask, // Thread thread: askingResolver.getThread, threads: askingResolver.listThreads, threadResponse: askingResolver.getResponse, nativeSql: modelResolver.getNativeSql, // Views listViews: modelResolver.listViews, view: modelResolver.getView, // Settings settings: projectResolver.getSettings, getMDL: modelResolver.getMDL, // Learning learningRecord: learningResolver.getLearningRecord, // Recommendation questions getThreadRecommendationQuestions: askingResolver.getThreadRecommendationQuestions, getProjectRecommendationQuestions: projectResolver.getProjectRecommendationQuestions, // Dashboard dashboardItems: dashboardResolver.getDashboardItems, dashboard: dashboardResolver.getDashboard, // SQL Pairs sqlPairs: sqlPairResolver.getProjectSqlPairs, // Instructions instructions: instructionResolver.getInstructions, // API History apiHistory: apiHistoryResolver.getApiHistory, }, Mutation: { deploy: modelResolver.deploy, saveDataSource: projectResolver.saveDataSource, startSampleDataset: projectResolver.startSampleDataset, saveTables: projectResolver.saveTables, saveRelations: projectResolver.saveRelations, createModel: modelResolver.createModel, updateModel: modelResolver.updateModel, deleteModel: modelResolver.deleteModel, previewModelData: modelResolver.previewModelData, updateModelMetadata: modelResolver.updateModelMetadata, triggerDataSourceDetection: projectResolver.triggerDataSourceDetection, resolveSchemaChange: projectResolver.resolveSchemaChange, // calculated field createCalculatedField: modelResolver.createCalculatedField, validateCalculatedField: modelResolver.validateCalculatedField, updateCalculatedField: modelResolver.updateCalculatedField, deleteCalculatedField: modelResolver.deleteCalculatedField, // relation createRelation: modelResolver.createRelation, updateRelation: modelResolver.updateRelation, deleteRelation: modelResolver.deleteRelation, // Ask createAskingTask: askingResolver.createAskingTask, cancelAskingTask: askingResolver.cancelAskingTask, createInstantRecommendedQuestions: askingResolver.createInstantRecommendedQuestions, rerunAskingTask: askingResolver.rerunAskingTask, // Adjustment adjustThreadResponse: askingResolver.adjustThreadResponse, cancelAdjustmentTask: askingResolver.cancelAdjustThreadResponseAnswer, rerunAdjustmentTask: askingResolver.rerunAdjustThreadResponseAnswer, // Thread createThread: askingResolver.createThread, updateThread: askingResolver.updateThread, deleteThread: askingResolver.deleteThread, createThreadResponse: askingResolver.createThreadResponse, updateThreadResponse: askingResolver.updateThreadResponse, previewData: askingResolver.previewData, previewBreakdownData: askingResolver.previewBreakdownData, // Generate Thread Response Breakdown generateThreadResponseBreakdown: askingResolver.generateThreadResponseBreakdown, // Generate Thread Response Answer generateThreadResponseAnswer: askingResolver.generateThreadResponseAnswer, // Generate Thread Response Chart generateThreadResponseChart: askingResolver.generateThreadResponseChart, // Adjust Thread Response Chart adjustThreadResponseChart: askingResolver.adjustThreadResponseChart, // Views createView: modelResolver.createView, deleteView: modelResolver.deleteView, previewViewData: modelResolver.previewViewData, validateView: modelResolver.validateView, updateViewMetadata: modelResolver.updateViewMetadata, // Settings resetCurrentProject: projectResolver.resetCurrentProject, updateCurrentProject: projectResolver.updateCurrentProject, updateDataSource: projectResolver.updateDataSource, // preview previewSql: modelResolver.previewSql, // Learning saveLearningRecord: learningResolver.saveLearningRecord, // Recommendation questions generateThreadRecommendationQuestions: askingResolver.generateThreadRecommendationQuestions, generateProjectRecommendationQuestions: askingResolver.generateProjectRecommendationQuestions, // Dashboard updateDashboardItemLayouts: dashboardResolver.updateDashboardItemLayouts, createDashboardItem: dashboardResolver.createDashboardItem, updateDashboardItem: dashboardResolver.updateDashboardItem, deleteDashboardItem: dashboardResolver.deleteDashboardItem, previewItemSQL: dashboardResolver.previewItemSQL, setDashboardSchedule: dashboardResolver.setDashboardSchedule, // SQL Pairs createSqlPair: sqlPairResolver.createSqlPair, updateSqlPair: sqlPairResolver.updateSqlPair, deleteSqlPair: sqlPairResolver.deleteSqlPair, generateQuestion: sqlPairResolver.generateQuestion, modelSubstitute: sqlPairResolver.modelSubstitute, // Instructions createInstruction: instructionResolver.createInstruction, updateInstruction: instructionResolver.updateInstruction, deleteInstruction: instructionResolver.deleteInstruction, }, ThreadResponse: askingResolver.getThreadResponseNestedResolver(), DetailStep: askingResolver.getDetailStepNestedResolver(), ResultCandidate: askingResolver.getResultCandidateNestedResolver(), // Handle struct type to record for UI DiagramModelField: { type: convertColumnType }, DiagramModelNestedField: { type: convertColumnType }, CompactColumn: { type: convertColumnType }, FieldInfo: { type: convertColumnType }, DetailedColumn: { type: convertColumnType }, DetailedNestedColumn: { type: convertColumnType }, DetailedChangeColumn: { type: convertColumnType }, // Add this line to include the SqlPair nested resolver SqlPair: sqlPairResolver.getSqlPairNestedResolver(), // Add ApiHistoryResponse nested resolvers ApiHistoryResponse: apiHistoryResolver.getApiHistoryNestedResolver(), }; export default resolvers; ================================================ FILE: wren-ui/src/apollo/server/scalars.ts ================================================ import { GraphQLScalarType } from 'graphql'; import { DialectSQL } from '@server/models/adaptor'; export const DialectSQLScalar = new GraphQLScalarType({ name: 'DialectSQL', description: 'A string representing a SQL query in a specific dialect', serialize(value: unknown): string { if (typeof value !== 'string') { throw new Error('DialectSQL must be a string'); } return value; }, parseValue(value: unknown): DialectSQL { if (typeof value !== 'string') { throw new Error('DialectSQL must be a string'); } return value as DialectSQL; }, parseLiteral(ast: any): DialectSQL { if (ast.kind !== 'StringValue') { throw new Error('DialectSQL must be a string'); } return ast.value as DialectSQL; }, }); ================================================ FILE: wren-ui/src/apollo/server/schema.ts ================================================ import { gql } from 'apollo-server-micro'; export const typeDefs = gql` scalar JSON scalar DialectSQL enum ApiType { GENERATE_SQL RUN_SQL GENERATE_VEGA_CHART GENERATE_SUMMARY ASK GET_INSTRUCTIONS CREATE_INSTRUCTION UPDATE_INSTRUCTION DELETE_INSTRUCTION CREATE_SQL_PAIR UPDATE_SQL_PAIR DELETE_SQL_PAIR GET_SQL_PAIRS GET_MODELS STREAM_ASK STREAM_GENERATE_SQL } input ApiHistoryFilterInput { apiType: ApiType statusCode: Int threadId: String projectId: Int startDate: String endDate: String } input ApiHistoryPaginationInput { offset: Int! limit: Int! } type ApiHistoryResponse { id: String! projectId: Int! apiType: ApiType! threadId: String headers: JSON requestPayload: JSON responsePayload: JSON statusCode: Int durationMs: Int createdAt: String! updatedAt: String! } type ApiHistoryPaginatedResponse { items: [ApiHistoryResponse!]! total: Int! hasMore: Boolean! } enum DataSourceName { ATHENA BIG_QUERY DUCKDB POSTGRES MYSQL ORACLE MSSQL CLICK_HOUSE TRINO SNOWFLAKE REDSHIFT DATABRICKS } enum RedshiftConnectionType { redshift redshift_iam } enum DatabricksConnectionType { token service_principal } enum ExpressionName { ABS AVG COUNT COUNT_IF MAX MIN SUM CBRT CEIL CEILING EXP FLOOR LN LOG10 ROUND SIGN LENGTH REVERSE } enum SampleDatasetName { HR ECOMMERCE NBA MUSIC } enum SyncStatus { IN_PROGRESS SYNCRONIZED UNSYNCRONIZED } enum SchemaChangeType { DELETED_TABLES DELETED_COLUMNS MODIFIED_COLUMNS } enum ProjectLanguage { EN ES FR ZH_TW ZH_CN DE PT RU JA KO IT FA_IR AR NL AZ_AZ TR } type DataSource { type: DataSourceName! properties: JSON! # Show the name if the data source setup comes from a sample sampleDataset: SampleDatasetName } input WhereIdInput { id: Int! } input DataSourceInput { type: DataSourceName! properties: JSON! } input SampleDatasetInput { name: SampleDatasetName! } type CompactTable { name: String! columns: [CompactColumn!]! properties: JSON } input MDLModelSubmitInput { name: String! columns: [String!]! } enum RelationType { ONE_TO_ONE ONE_TO_MANY MANY_TO_ONE } enum OnboardingStatus { NOT_STARTED DATASOURCE_SAVED ONBOARDING_FINISHED WITH_SAMPLE_DATASET } enum NodeType { MODEL METRIC VIEW RELATION FIELD CALCULATED_FIELD } type Relation { fromModelId: Int! fromModelReferenceName: String! fromColumnId: Int! fromColumnReferenceName: String! toModelId: Int! toModelReferenceName: String! toColumnId: Int! toColumnReferenceName: String! type: RelationType! name: String! } type RecommendRelations { id: Int! displayName: String! referenceName: String! relations: [Relation]! } input RelationInput { fromModelId: Int! fromColumnId: Int! toModelId: Int! toColumnId: Int! type: RelationType! } input UpdateRelationInput { type: RelationType! } input SaveRelationInput { relations: [RelationInput]! } input SaveTablesInput { tables: [String!]! } type CompactColumn { name: String! type: String! properties: JSON } input CustomFieldInput { name: String! expression: String! } input CalculatedFieldInput { name: String! expression: String! lineage: [Int!]! diagram: JSON } input CreateModelInput { sourceTableName: String! fields: [String!]! primaryKey: String } input CreateCalculatedFieldInput { modelId: Int! name: String! expression: ExpressionName! lineage: [Int!]! } input UpdateCalculatedFieldInput { name: String! expression: ExpressionName! lineage: [Int!]! } input UpdateCalculatedFieldWhere { id: Int! } input ValidateCalculatedFieldInput { name: String! modelId: Int! columnId: Int } type CalculatedFieldValidationResponse { valid: Boolean! message: String } input ModelWhereInput { id: Int! } input UpdateModelInput { fields: [String!]! primaryKey: String } # Metadata related input UpdateNestedColumnMetadataInput { id: Int! displayName: String description: String } input UpdateColumnMetadataInput { id: Int! displayName: String description: String } input UpdateCalculatedFieldMetadataInput { id: Int! description: String } input UpdateRelationshipMetadataInput { id: Int! description: String } input UpdateViewColumnMetadataInput { referenceName: String! description: String } input UpdateModelMetadataInput { displayName: String # Model display name, i,e, the alias of the model description: String # Model description columns: [UpdateColumnMetadataInput!] # Update column metadata nestedColumns: [UpdateNestedColumnMetadataInput!] # Update nested column metadata calculatedFields: [UpdateCalculatedFieldMetadataInput!] # Update calculated field metadata relationships: [UpdateRelationshipMetadataInput!] # Update relationship metadata } input UpdateViewMetadataInput { displayName: String # View display name, i,e, the alias of the view description: String # View description columns: [UpdateViewColumnMetadataInput!] } type NestedFieldInfo { id: Int! displayName: String! referenceName: String! sourceColumnName: String! columnPath: [String!]! type: String! properties: JSON! } type FieldInfo { id: Int! displayName: String! referenceName: String! sourceColumnName: String! type: String isCalculated: Boolean! notNull: Boolean! expression: String properties: JSON nestedColumns: [NestedFieldInfo!] } type ModelInfo { id: Int! displayName: String! referenceName: String! sourceTableName: String! refSql: String primaryKey: String cached: Boolean! refreshTime: String description: String fields: [FieldInfo]! calculatedFields: [FieldInfo]! properties: JSON } type DetailedNestedColumn { id: Int! displayName: String! referenceName: String! sourceColumnName: String! columnPath: [String!]! type: String properties: JSON } type DetailedColumn { displayName: String! referenceName: String! sourceColumnName: String! type: String isCalculated: Boolean! notNull: Boolean! properties: JSON! nestedColumns: [DetailedNestedColumn!] } type DetailedRelation { fromModelId: Int! fromColumnId: Int! toModelId: Int! toColumnId: Int! type: RelationType! name: String! properties: JSON! } type DetailedModel { displayName: String! referenceName: String! sourceTableName: String! refSql: String! primaryKey: String cached: Boolean! refreshTime: String description: String fields: [DetailedColumn] calculatedFields: [DetailedColumn] relations: [DetailedRelation] properties: JSON! } # View type ViewInfo { id: Int! name: String! statement: String! displayName: String! } input ViewWhereUniqueInput { id: Int! } input PreviewViewDataInput { id: Int! # It will return default 500 rows if not specified limit # refer: DEFAULT_PREVIEW_LIMIT limit: Int } input CreateViewInput { name: String! responseId: Int! rephrasedQuestion: String! } input ValidateViewInput { name: String! } type ViewValidationResponse { valid: Boolean! message: String } # onboarding type OnboardingStatusResponse { status: OnboardingStatus } type ModelSyncResponse { status: SyncStatus! } type Diagram { models: [DiagramModel]! views: [DiagramView]! } type DiagramView { id: String! viewId: Int! nodeType: NodeType! statement: String! displayName: String! referenceName: String! fields: [DiagramViewField]! description: String } type DiagramViewField { id: String! displayName: String! referenceName: String! type: String! nodeType: NodeType! description: String } type DiagramModel { id: String! modelId: Int! nodeType: NodeType! displayName: String! referenceName: String! sourceTableName: String! refSql: String cached: Boolean! refreshTime: String description: String fields: [DiagramModelField]! calculatedFields: [DiagramModelField]! relationFields: [DiagramModelRelationField]! } type DiagramModelNestedField { id: String! nestedColumnId: Int! displayName: String! referenceName: String! columnPath: [String!]! type: String! description: String } type DiagramModelField { id: String! columnId: Int! nodeType: NodeType! type: String! displayName: String! referenceName: String! description: String isPrimaryKey: Boolean! expression: String aggregation: String lineage: [Int!] nestedFields: [DiagramModelNestedField!] } type DiagramModelRelationField { id: String! relationId: Int! nodeType: NodeType! type: RelationType! displayName: String! referenceName: String! description: String fromModelId: Int! fromModelName: String! fromModelDisplayName: String! fromColumnId: Int! fromColumnName: String! fromColumnDisplayName: String! toModelId: Int! toModelName: String! toModelDisplayName: String! toColumnId: Int! toColumnName: String! toColumnDisplayName: String! } input SimpleMeasureInput { name: String! type: String! isCalculated: Boolean! notNull: Boolean! properties: JSON! } input DimensionInput { name: String! type: String! isCalculated: Boolean! notNull: Boolean! properties: JSON! } input TimeGrainInput { name: String! refColumn: String! dateParts: [String!]! } input CreateSimpleMetricInput { name: String! displayName: String! description: String cached: Boolean! refreshTime: String model: String! properties: JSON! measure: [SimpleMeasureInput!]! dimension: [DimensionInput!]! timeGrain: [TimeGrainInput!]! } # Task type Task { id: String! } # Error type Error { code: String shortMessage: String message: String stacktrace: [String] } # Asking Task input AskingTaskInput { question: String! # Used for follow-up questions threadId: Int } enum AskingTaskStatus { UNDERSTANDING SEARCHING PLANNING GENERATING CORRECTING FINISHED FAILED STOPPED } enum AskingTaskType { GENERAL TEXT_TO_SQL MISLEADING_QUERY } enum ChartTaskStatus { FETCHING GENERATING FINISHED FAILED STOPPED } enum ChartType { BAR PIE LINE MULTI_LINE AREA GROUPED_BAR STACKED_BAR } enum ResultCandidateType { VIEW # View type candidate is provided basd on a saved view LLM # LLM type candidate is created by LLM SQL_PAIR # SQL pair type candidate is created by SQL pair } type ResultCandidate { type: ResultCandidateType! sql: String! view: ViewInfo sqlPair: SqlPair } type AskingTask { status: AskingTaskStatus! type: AskingTaskType error: Error candidates: [ResultCandidate!]! rephrasedQuestion: String intentReasoning: String sqlGenerationReasoning: String retrievedTables: [String!] invalidSql: String traceId: String queryId: String } input InstantRecommendedQuestionsInput { previousQuestions: [String!] } enum RecommendedQuestionsTaskStatus { NOT_STARTED GENERATING FINISHED FAILED } type ResultQuestion { question: String! category: String! sql: String! } type RecommendedQuestionsTask { status: RecommendedQuestionsTaskStatus! questions: [ResultQuestion!]! error: Error } # Thread input CreateThreadInput { question: String sql: String taskId: String } input CreateThreadResponseInput { question: String sql: String taskId: String } input ThreadUniqueWhereInput { id: Int! } input UpdateThreadInput { summary: String } input ThreadResponseUniqueWhereInput { id: Int! } input UpdateThreadResponseInput { sql: String } input AdjustThreadResponseChartInput { chartType: ChartType! xAxis: String yAxis: String xOffset: String color: String theta: String } input AdjustThreadResponseInput { tables: [String!] sqlGenerationReasoning: String sql: String } input PreviewDataInput { responseId: Int! # Optional, only used for preview data of a single step stepIndex: Int # It will return default 500 rows if not specified limit # refer: DEFAULT_PREVIEW_LIMIT limit: Int } type DetailStep { summary: String! sql: String! cteName: String } enum ThreadResponseAnswerStatus { NOT_STARTED FETCHING_DATA PREPROCESSING STREAMING FINISHED FAILED INTERRUPTED } type ThreadResponseAnswerDetail { queryId: String status: ThreadResponseAnswerStatus error: Error numRowsUsedInLLM: Int content: String } type ThreadResponseBreakdownDetail { queryId: String status: AskingTaskStatus! error: Error description: String steps: [DetailStep!] } type ThreadResponseChartDetail { queryId: String status: ChartTaskStatus! error: Error description: String chartType: ChartType chartSchema: JSON adjustment: Boolean } enum ThreadResponseAdjustmentType { REASONING APPLY_SQL } type ThreadResponseAdjustment { type: ThreadResponseAdjustmentType! payload: JSON } type AdjustmentTask { queryId: String status: AskingTaskStatus error: Error sql: String traceId: String invalidSql: String } type ThreadResponse { id: Int! threadId: Int! question: String! sql: String view: ViewInfo breakdownDetail: ThreadResponseBreakdownDetail answerDetail: ThreadResponseAnswerDetail chartDetail: ThreadResponseChartDetail askingTask: AskingTask adjustment: ThreadResponseAdjustment adjustmentTask: AdjustmentTask } # Thread only consists of basic information of a thread type Thread { id: Int! summary: String! } # Detailed thread consists of thread and thread responses type DetailedThread { id: Int! responses: [ThreadResponse!]! } type SuggestedQuestion { question: String! label: String! } # Ask Questions Responses type SuggestedQuestionResponse { questions: [SuggestedQuestion]! } # Settings input UpdateDataSourceInput { properties: JSON! } input UpdateCurrentProjectInput { language: ProjectLanguage! } type Settings { productVersion: String! dataSource: DataSource! language: ProjectLanguage! } type GetMDLResult { hash: String! mdl: String } input PreviewSQLDataInput { sql: String! projectId: String limit: Int dryRun: Boolean } # Schema Change type SchemaChange { deletedTables: [DetailedChangeTable!] deletedColumns: [DetailedChangeTable!] modifiedColumns: [DetailedChangeTable!] lastSchemaChangeTime: String } type DetailedChangeTable { sourceTableName: String! displayName: String! columns: [DetailedChangeColumn!]! calculatedFields: [DetailedAffectedCalculatedFields!]! relationships: [DetailedAffectedRelationships!]! } type DetailedChangeColumn { sourceColumnName: String! displayName: String! type: String! } type DetailedAffectedCalculatedFields { displayName: String! referenceName: String! type: String! } type DetailedAffectedRelationships { displayName: String! referenceName: String! } input ResolveSchemaChangeWhereInput { type: SchemaChangeType! } # Learning type LearningRecord { paths: [String!]! } input SaveLearningRecordInput { path: String! } # Dashboard enum DashboardItemType { BAR PIE LINE MULTI_LINE AREA GROUPED_BAR STACKED_BAR TABLE NUMBER } input DashboardItemWhereInput { id: Int! } input CreateDashboardItemInput { itemType: DashboardItemType! responseId: Int! } input UpdateDashboardItemInput { displayName: String! } input ItemLayoutInput { itemId: Int! x: Int! y: Int! w: Int! h: Int! } input UpdateDashboardItemLayoutsInput { layouts: [ItemLayoutInput!]! } input DeleteDashboardItemInput { itemId: Int! } input PreviewItemSQLInput { itemId: Int! limit: Int refresh: Boolean = false } type PreviewItemResponse { data: JSON! cacheHit: Boolean! cacheCreatedAt: String cacheOverrodeAt: String override: Boolean! } input SetDashboardScheduleInput { cacheEnabled: Boolean! schedule: SetDashboardScheduleData } type DashboardSchedule { frequency: ScheduleFrequencyEnum hour: Int minute: Int day: CacheScheduleDayEnum timezone: String cron: String } input SetDashboardScheduleData { frequency: ScheduleFrequencyEnum! hour: Int minute: Int day: CacheScheduleDayEnum timezone: String cron: String } enum ScheduleFrequencyEnum { DAILY WEEKLY CUSTOM NEVER } enum CacheScheduleDayEnum { SUN MON TUE WED THU FRI SAT } type DashboardItemLayout { x: Int! y: Int! w: Int! h: Int! } type DashboardItemDetail { sql: String! chartSchema: JSON } type DashboardItem { id: Int! dashboardId: Int! type: DashboardItemType! layout: DashboardItemLayout! detail: DashboardItemDetail! displayName: String } type Dashboard { id: Int! projectId: Int! name: String! cacheEnabled: Boolean! scheduleFrequency: ScheduleFrequencyEnum scheduleTimezone: String scheduleCron: String nextScheduledAt: String } type DetailedDashboard { id: Int! name: String! description: String cacheEnabled: Boolean! nextScheduledAt: String schedule: DashboardSchedule items: [DashboardItem!]! } type SqlPair { id: Int! projectId: Int! sql: String! question: String! createdAt: String updatedAt: String } input CreateSqlPairInput { sql: String! question: String! } input UpdateSqlPairInput { sql: String question: String } input SqlPairWhereUniqueInput { id: Int! } input GenerateQuestionInput { sql: String! } input ModelSubstituteInput { sql: DialectSQL! } type Instruction { id: Int! projectId: Int! instruction: String! questions: [String!]! isDefault: Boolean! createdAt: String! updatedAt: String! } input CreateInstructionInput { instruction: String! questions: [String!]! isDefault: Boolean! } input UpdateInstructionInput { instruction: String questions: [String!] isDefault: Boolean } input InstructionWhereInput { id: Int! } # Query and Mutation type Query { # On Boarding Steps listDataSourceTables: [CompactTable!]! autoGenerateRelation: [RecommendRelations!]! onboardingStatus: OnboardingStatusResponse! # Modeling Page listModels: [ModelInfo!]! model(where: ModelWhereInput!): DetailedModel! modelSync: ModelSyncResponse! diagram: Diagram! schemaChange: SchemaChange! # View listViews: [ViewInfo!]! view(where: ViewWhereUniqueInput!): ViewInfo! # Ask askingTask(taskId: String!): AskingTask suggestedQuestions: SuggestedQuestionResponse! threads: [Thread!]! thread(threadId: Int!): DetailedThread! threadResponse(responseId: Int!): ThreadResponse! nativeSql(responseId: Int!): String! # Adjustment adjustmentTask(taskId: String!): AdjustmentTask # Settings settings: Settings! # System getMDL(hash: String!): GetMDLResult! # Learning learningRecord: LearningRecord! # Recommendation questions getThreadRecommendationQuestions(threadId: Int!): RecommendedQuestionsTask! getProjectRecommendationQuestions: RecommendedQuestionsTask! instantRecommendedQuestions(taskId: String!): RecommendedQuestionsTask! # Dashboard dashboardItems: [DashboardItem!]! dashboard: DetailedDashboard! # SQL Pairs sqlPairs: [SqlPair]! # Instructions instructions: [Instruction]! # Api History apiHistory( filter: ApiHistoryFilterInput pagination: ApiHistoryPaginationInput! ): ApiHistoryPaginatedResponse! } type Mutation { # On Boarding Steps saveDataSource(data: DataSourceInput!): DataSource! startSampleDataset(data: SampleDatasetInput!): JSON! saveTables(data: SaveTablesInput!): JSON! saveRelations(data: SaveRelationInput!): JSON! deploy(force: Boolean): JSON! # Modeling Page createModel(data: CreateModelInput!): JSON! updateModel(where: ModelWhereInput!, data: UpdateModelInput!): JSON! deleteModel(where: ModelWhereInput!): Boolean! previewModelData(where: WhereIdInput!): JSON! triggerDataSourceDetection: Boolean! resolveSchemaChange(where: ResolveSchemaChangeWhereInput!): Boolean! # Metadata updateModelMetadata( where: ModelWhereInput! data: UpdateModelMetadataInput! ): Boolean! updateViewMetadata( where: ViewWhereUniqueInput! data: UpdateViewMetadataInput! ): Boolean! # Relation createRelation(data: RelationInput!): JSON! updateRelation(data: UpdateRelationInput!, where: WhereIdInput!): JSON! deleteRelation(where: WhereIdInput!): Boolean! # Calculated field createCalculatedField(data: CreateCalculatedFieldInput!): JSON! updateCalculatedField( where: UpdateCalculatedFieldWhere! data: UpdateCalculatedFieldInput! ): JSON! deleteCalculatedField(where: UpdateCalculatedFieldWhere): Boolean! validateCalculatedField( data: ValidateCalculatedFieldInput! ): CalculatedFieldValidationResponse! # View createView(data: CreateViewInput!): ViewInfo! deleteView(where: ViewWhereUniqueInput!): Boolean! previewViewData(where: PreviewViewDataInput!): JSON! validateView(data: ValidateViewInput!): ViewValidationResponse! # Ask createAskingTask(data: AskingTaskInput!): Task! cancelAskingTask(taskId: String!): Boolean! rerunAskingTask(responseId: Int!): Task! # Thread createThread(data: CreateThreadInput!): Thread! updateThread( where: ThreadUniqueWhereInput! data: UpdateThreadInput! ): Thread! deleteThread(where: ThreadUniqueWhereInput!): Boolean! # Thread Response createThreadResponse( threadId: Int! data: CreateThreadResponseInput! ): ThreadResponse! updateThreadResponse( where: ThreadResponseUniqueWhereInput! data: UpdateThreadResponseInput! ): ThreadResponse! previewData(where: PreviewDataInput!): JSON! previewBreakdownData(where: PreviewDataInput!): JSON! # Generate Thread Response Breakdown generateThreadResponseBreakdown(responseId: Int!): ThreadResponse! # Generate Thread Response Answer generateThreadResponseAnswer(responseId: Int!): ThreadResponse! # Generate Thread Response Chart generateThreadResponseChart(responseId: Int!): ThreadResponse! # Adjust Thread Response Chart adjustThreadResponseChart( responseId: Int! data: AdjustThreadResponseChartInput! ): ThreadResponse! # Adjustment adjustThreadResponse( responseId: Int! data: AdjustThreadResponseInput! ): ThreadResponse! cancelAdjustmentTask(taskId: String!): Boolean! rerunAdjustmentTask(responseId: Int!): Boolean! # Settings resetCurrentProject: Boolean! updateCurrentProject(data: UpdateCurrentProjectInput!): Boolean! updateDataSource(data: UpdateDataSourceInput!): DataSource! # preview previewSql(data: PreviewSQLDataInput): JSON! # Learning saveLearningRecord(data: SaveLearningRecordInput!): LearningRecord! # Recommendation questions generateThreadRecommendationQuestions(threadId: Int!): Boolean! generateProjectRecommendationQuestions: Boolean! createInstantRecommendedQuestions( data: InstantRecommendedQuestionsInput! ): Task! # Dashboard updateDashboardItemLayouts( data: UpdateDashboardItemLayoutsInput! ): [DashboardItem!]! createDashboardItem(data: CreateDashboardItemInput!): DashboardItem! updateDashboardItem( where: DashboardItemWhereInput! data: UpdateDashboardItemInput! ): DashboardItem! deleteDashboardItem(where: DashboardItemWhereInput!): Boolean! previewItemSQL(data: PreviewItemSQLInput!): PreviewItemResponse! setDashboardSchedule(data: SetDashboardScheduleInput!): Dashboard! # SQL Pairs createSqlPair(data: CreateSqlPairInput!): SqlPair! updateSqlPair( where: SqlPairWhereUniqueInput! data: UpdateSqlPairInput! ): SqlPair! deleteSqlPair(where: SqlPairWhereUniqueInput!): Boolean! generateQuestion(data: GenerateQuestionInput!): String! modelSubstitute(data: ModelSubstituteInput!): String! # Instructions createInstruction(data: CreateInstructionInput!): Instruction! updateInstruction( where: InstructionWhereInput! data: UpdateInstructionInput! ): Instruction! deleteInstruction(where: InstructionWhereInput!): Boolean! } `; ================================================ FILE: wren-ui/src/apollo/server/services/askingService.ts ================================================ import { IWrenAIAdaptor } from '@server/adaptors/wrenAIAdaptor'; import { AskResultStatus, RecommendationQuestionsResult, RecommendationQuestionsInput, RecommendationQuestion, WrenAIError, RecommendationQuestionStatus, ChartStatus, ChartAdjustmentOption, WrenAILanguage, } from '@server/models/adaptor'; import { IDeployService } from './deployService'; import { IProjectService } from './projectService'; import { IThreadRepository, Thread } from '../repositories/threadRepository'; import { IThreadResponseRepository, ThreadResponse, ThreadResponseAdjustmentType, } from '../repositories/threadResponseRepository'; import { getLogger } from '@server/utils'; import { isEmpty, isNil } from 'lodash'; import { safeFormatSQL } from '@server/utils/sqlFormat'; import { PostHogTelemetry, TelemetryEvent, WrenService, } from '../telemetry/telemetry'; import { IAskingTaskRepository, IViewRepository, Project, } from '../repositories'; import { IQueryService, PreviewDataResponse } from './queryService'; import { IMDLService } from './mdlService'; import { ThreadRecommendQuestionBackgroundTracker, ChartBackgroundTracker, ChartAdjustmentBackgroundTracker, AdjustmentBackgroundTaskTracker, TrackedAdjustmentResult, } from '../backgrounds'; import { getConfig } from '@server/config'; import { TextBasedAnswerBackgroundTracker } from '../backgrounds/textBasedAnswerBackgroundTracker'; import { IAskingTaskTracker, TrackedAskingResult } from './askingTaskTracker'; const config = getConfig(); const logger = getLogger('AskingService'); logger.level = 'debug'; // const QUERY_ID_PLACEHOLDER = '0'; export interface Task { id: string; } export interface AskingPayload { threadId?: number; language: string; } export interface AskingTaskInput { question: string; } export interface AskingDetailTaskInput { question?: string; sql?: string; trackedAskingResult?: TrackedAskingResult; } export interface AskingDetailTaskUpdateInput { summary?: string; } export enum RecommendQuestionResultStatus { NOT_STARTED = 'NOT_STARTED', GENERATING = 'GENERATING', FINISHED = 'FINISHED', FAILED = 'FAILED', } export interface ThreadRecommendQuestionResult { status: RecommendQuestionResultStatus; questions: RecommendationQuestion[]; error?: WrenAIError; } export interface InstantRecommendedQuestionsInput { previousQuestions?: string[]; } export enum ThreadResponseAnswerStatus { NOT_STARTED = 'NOT_STARTED', FETCHING_DATA = 'FETCHING_DATA', PREPROCESSING = 'PREPROCESSING', STREAMING = 'STREAMING', FINISHED = 'FINISHED', FAILED = 'FAILED', INTERRUPTED = 'INTERRUPTED', } // adjustment input export interface AdjustmentReasoningInput { tables: string[]; sqlGenerationReasoning: string; projectId: number; } export interface AdjustmentSqlInput { sql: string; } export interface IAskingService { /** * Asking task. */ createAskingTask( input: AskingTaskInput, payload: AskingPayload, // if the asking task is rerun from a cancelled thread response rerunFromCancelled?: boolean, // if the asking task is rerun from a cancelled thread response, // the previous task id is the task id of the cancelled thread response previousTaskId?: number, // if the asking task is rerun from a thread response // the thread response id is the id of the cancelled thread response threadResponseId?: number, ): Promise; rerunAskingTask( threadResponseId: number, payload: AskingPayload, ): Promise; cancelAskingTask(taskId: string): Promise; getAskingTask(taskId: string): Promise; getAskingTaskById(id: number): Promise; /** * Asking detail task. */ createThread(input: AskingDetailTaskInput): Promise; updateThread( threadId: number, input: Partial, ): Promise; deleteThread(threadId: number): Promise; listThreads(): Promise; createThreadResponse( input: AskingDetailTaskInput, threadId: number, ): Promise; updateThreadResponse( responseId: number, data: { sql: string }, ): Promise; getResponsesWithThread(threadId: number): Promise; getResponse(responseId: number): Promise; generateThreadResponseBreakdown( threadResponseId: number, configurations: { language: string }, ): Promise; generateThreadResponseAnswer( threadResponseId: number, configurations: { language: string }, ): Promise; generateThreadResponseChart( threadResponseId: number, configurations: { language: string }, ): Promise; adjustThreadResponseChart( threadResponseId: number, input: ChartAdjustmentOption, configurations: { language: string }, ): Promise; adjustThreadResponseWithSQL( threadResponseId: number, input: AdjustmentSqlInput, ): Promise; adjustThreadResponseAnswer( threadResponseId: number, input: AdjustmentReasoningInput, configurations: { language: string }, ): Promise; cancelAdjustThreadResponseAnswer(taskId: string): Promise; rerunAdjustThreadResponseAnswer( threadResponseId: number, projectId: number, configurations: { language: string }, ): Promise<{ queryId: string }>; getAdjustmentTask(taskId: string): Promise; getAdjustmentTaskById(id: number): Promise; changeThreadResponseAnswerDetailStatus( responseId: number, status: ThreadResponseAnswerStatus, content?: string, ): Promise; previewData(responseId: number, limit?: number): Promise; previewBreakdownData( responseId: number, stepIndex?: number, limit?: number, ): Promise; /** * Recommendation questions */ createInstantRecommendedQuestions( input: InstantRecommendedQuestionsInput, ): Promise; getInstantRecommendedQuestions( queryId: string, ): Promise; generateThreadRecommendationQuestions(threadId: number): Promise; getThreadRecommendationQuestions( threadId: number, ): Promise; deleteAllByProjectId(projectId: number): Promise; } /** * utility function to check if the status is finalized */ const isFinalized = (status: AskResultStatus) => { return ( status === AskResultStatus.FAILED || status === AskResultStatus.FINISHED || status === AskResultStatus.STOPPED ); }; /** * Given a list of steps, construct the SQL statement with CTEs * If stepIndex is provided, only construct the SQL from top to that step * @param steps * @param stepIndex * @returns string */ export const constructCteSql = ( steps: Array<{ cteName: string; summary: string; sql: string }>, stepIndex?: number, ): string => { // validate stepIndex if (!isNil(stepIndex) && (stepIndex < 0 || stepIndex >= steps.length)) { throw new Error(`Invalid stepIndex: ${stepIndex}`); } const slicedSteps = isNil(stepIndex) ? steps : steps.slice(0, stepIndex + 1); // if there's only one step, return the sql directly if (slicedSteps.length === 1) { return `-- ${slicedSteps[0].summary}\n${slicedSteps[0].sql}`; } let sql = 'WITH '; slicedSteps.forEach((step, index) => { if (index === slicedSteps.length - 1) { // if it's the last step, remove the trailing comma. // no need to wrap with WITH sql += `\n-- ${step.summary}\n`; sql += `${step.sql}`; } else if (index === slicedSteps.length - 2) { // if it's the last two steps, remove the trailing comma. // wrap with CTE sql += `${step.cteName} AS`; sql += `\n-- ${step.summary}\n`; sql += `(${step.sql})`; } else { // if it's not the last step, wrap with CTE sql += `${step.cteName} AS`; sql += `\n-- ${step.summary}\n`; sql += `(${step.sql}),`; } }); return sql; }; /** * Background tracker to track the status of the asking breakdown task */ class BreakdownBackgroundTracker { // tasks is a kv pair of task id and thread response private tasks: Record = {}; private intervalTime: number; private wrenAIAdaptor: IWrenAIAdaptor; private threadResponseRepository: IThreadResponseRepository; private runningJobs = new Set(); private telemetry: PostHogTelemetry; constructor({ telemetry, wrenAIAdaptor, threadResponseRepository, }: { telemetry: PostHogTelemetry; wrenAIAdaptor: IWrenAIAdaptor; threadResponseRepository: IThreadResponseRepository; }) { this.telemetry = telemetry; this.wrenAIAdaptor = wrenAIAdaptor; this.threadResponseRepository = threadResponseRepository; this.intervalTime = 1000; this.start(); } public start() { logger.info('Background tracker started'); setInterval(() => { const jobs = Object.values(this.tasks).map( (threadResponse) => async () => { // check if same job is running if (this.runningJobs.has(threadResponse.id)) { return; } // mark the job as running this.runningJobs.add(threadResponse.id); // get the answer detail const breakdownDetail = threadResponse.breakdownDetail; // get the latest result from AI service const result = await this.wrenAIAdaptor.getAskDetailResult( breakdownDetail.queryId, ); // check if status change if (breakdownDetail.status === result.status) { // mark the job as finished logger.debug( `Job ${threadResponse.id} status not changed, finished`, ); this.runningJobs.delete(threadResponse.id); return; } // update database const updatedBreakdownDetail = { queryId: breakdownDetail.queryId, status: result?.status, error: result?.error, description: result?.response?.description, steps: result?.response?.steps, }; logger.debug(`Job ${threadResponse.id} status changed, updating`); await this.threadResponseRepository.updateOne(threadResponse.id, { breakdownDetail: updatedBreakdownDetail, }); // remove the task from tracker if it is finalized if (isFinalized(result.status)) { const eventProperties = { question: threadResponse.question, error: result.error, }; if (result.status === AskResultStatus.FINISHED) { this.telemetry.sendEvent( TelemetryEvent.HOME_ANSWER_BREAKDOWN, eventProperties, ); } else { this.telemetry.sendEvent( TelemetryEvent.HOME_ANSWER_BREAKDOWN, eventProperties, WrenService.AI, false, ); } logger.debug(`Job ${threadResponse.id} is finalized, removing`); delete this.tasks[threadResponse.id]; } // mark the job as finished this.runningJobs.delete(threadResponse.id); }, ); // run the jobs Promise.allSettled(jobs.map((job) => job())).then((results) => { // show reason of rejection results.forEach((result, index) => { if (result.status === 'rejected') { logger.error(`Job ${index} failed: ${result.reason}`); } }); }); }, this.intervalTime); } public addTask(threadResponse: ThreadResponse) { this.tasks[threadResponse.id] = threadResponse; } public getTasks() { return this.tasks; } } export class AskingService implements IAskingService { private wrenAIAdaptor: IWrenAIAdaptor; private deployService: IDeployService; private projectService: IProjectService; private viewRepository: IViewRepository; private threadRepository: IThreadRepository; private threadResponseRepository: IThreadResponseRepository; private breakdownBackgroundTracker: BreakdownBackgroundTracker; private textBasedAnswerBackgroundTracker: TextBasedAnswerBackgroundTracker; private chartBackgroundTracker: ChartBackgroundTracker; private chartAdjustmentBackgroundTracker: ChartAdjustmentBackgroundTracker; private threadRecommendQuestionBackgroundTracker: ThreadRecommendQuestionBackgroundTracker; private queryService: IQueryService; private telemetry: PostHogTelemetry; private mdlService: IMDLService; private askingTaskTracker: IAskingTaskTracker; private askingTaskRepository: IAskingTaskRepository; private adjustmentBackgroundTracker: AdjustmentBackgroundTaskTracker; constructor({ telemetry, wrenAIAdaptor, deployService, projectService, viewRepository, threadRepository, threadResponseRepository, askingTaskRepository, queryService, mdlService, askingTaskTracker, }: { telemetry: PostHogTelemetry; wrenAIAdaptor: IWrenAIAdaptor; deployService: IDeployService; projectService: IProjectService; viewRepository: IViewRepository; threadRepository: IThreadRepository; threadResponseRepository: IThreadResponseRepository; askingTaskRepository: IAskingTaskRepository; queryService: IQueryService; mdlService: IMDLService; askingTaskTracker: IAskingTaskTracker; }) { this.wrenAIAdaptor = wrenAIAdaptor; this.deployService = deployService; this.projectService = projectService; this.viewRepository = viewRepository; this.threadRepository = threadRepository; this.threadResponseRepository = threadResponseRepository; this.telemetry = telemetry; this.queryService = queryService; this.breakdownBackgroundTracker = new BreakdownBackgroundTracker({ telemetry, wrenAIAdaptor, threadResponseRepository, }); this.textBasedAnswerBackgroundTracker = new TextBasedAnswerBackgroundTracker({ wrenAIAdaptor, threadResponseRepository, projectService, deployService, queryService, }); this.chartBackgroundTracker = new ChartBackgroundTracker({ telemetry, wrenAIAdaptor, threadResponseRepository, }); this.chartAdjustmentBackgroundTracker = new ChartAdjustmentBackgroundTracker({ telemetry, wrenAIAdaptor, threadResponseRepository, }); this.threadRecommendQuestionBackgroundTracker = new ThreadRecommendQuestionBackgroundTracker({ telemetry, wrenAIAdaptor, threadRepository, }); this.adjustmentBackgroundTracker = new AdjustmentBackgroundTaskTracker({ telemetry, wrenAIAdaptor, askingTaskRepository, threadResponseRepository, }); this.askingTaskRepository = askingTaskRepository; this.mdlService = mdlService; this.askingTaskTracker = askingTaskTracker; } public async getThreadRecommendationQuestions( threadId: number, ): Promise { const thread = await this.threadRepository.findOneBy({ id: threadId }); if (!thread) { throw new Error(`Thread ${threadId} not found`); } // handle not started const res: ThreadRecommendQuestionResult = { status: RecommendQuestionResultStatus.NOT_STARTED, questions: [], error: null, }; if (thread.queryId && thread.questionsStatus) { res.status = RecommendQuestionResultStatus[thread.questionsStatus] ? RecommendQuestionResultStatus[thread.questionsStatus] : res.status; res.questions = thread.questions || []; res.error = thread.questionsError as WrenAIError; } return res; } public async generateThreadRecommendationQuestions( threadId: number, ): Promise { const thread = await this.threadRepository.findOneBy({ id: threadId }); if (!thread) { throw new Error(`Thread ${threadId} not found`); } if (this.threadRecommendQuestionBackgroundTracker.isExist(thread)) { logger.debug( `thread "${threadId}" recommended questions are generating, skip the current request`, ); return; } const project = await this.projectService.getCurrentProject(); const { manifest } = await this.mdlService.makeCurrentModelMDL(); const threadResponses = await this.threadResponseRepository.findAllBy({ threadId, }); // descending order and get the latest 5 const slicedThreadResponses = threadResponses .sort((a, b) => b.id - a.id) .slice(0, 5); const questions = slicedThreadResponses.map(({ question }) => question); const recommendQuestionData: RecommendationQuestionsInput = { manifest, previousQuestions: questions, ...this.getThreadRecommendationQuestionsConfig(project), }; const result = await this.wrenAIAdaptor.generateRecommendationQuestions( recommendQuestionData, ); // reset thread recommended questions const updatedThread = await this.threadRepository.updateOne(threadId, { queryId: result.queryId, questionsStatus: RecommendationQuestionStatus.GENERATING, questions: [], questionsError: null, }); this.threadRecommendQuestionBackgroundTracker.addTask(updatedThread); return; } public async initialize() { // list thread responses from database // filter status not finalized and put them into background tracker const threadResponses = await this.threadResponseRepository.findAll(); const unfininshedBreakdownThreadResponses = threadResponses.filter( (threadResponse) => threadResponse?.breakdownDetail?.status && !isFinalized( threadResponse?.breakdownDetail?.status as AskResultStatus, ), ); logger.info( `Initialization: adding unfininshed breakdown thread responses (total: ${unfininshedBreakdownThreadResponses.length}) to background tracker`, ); for (const threadResponse of unfininshedBreakdownThreadResponses) { this.breakdownBackgroundTracker.addTask(threadResponse); } } /** * Asking task. */ public async createAskingTask( input: AskingTaskInput, payload: AskingPayload, rerunFromCancelled?: boolean, previousTaskId?: number, threadResponseId?: number, ): Promise { const { threadId, language } = payload; const deployId = await this.getDeployId(); // if it's a follow-up question, then the input will have a threadId // then use the threadId to get the sql and get the steps of last thread response // construct it into AskHistory and pass to ask const histories = threadId ? await this.getAskingHistory(threadId, threadResponseId) : null; const response = await this.askingTaskTracker.createAskingTask({ query: input.question, histories, deployId, configurations: { language }, rerunFromCancelled, previousTaskId, threadResponseId, }); return { id: response.queryId, }; } public async rerunAskingTask( threadResponseId: number, payload: AskingPayload, ): Promise { const threadResponse = await this.threadResponseRepository.findOneBy({ id: threadResponseId, }); if (!threadResponse) { throw new Error(`Thread response ${threadResponseId} not found`); } // get the original question and ask again const question = threadResponse.question; const input = { question, }; const askingPayload = { ...payload, // it's possible that the threadId is not provided in the payload // so we'll just use the threadId from the thread response threadId: threadResponse.threadId, }; const task = await this.createAskingTask( input, askingPayload, true, threadResponse.askingTaskId, threadResponseId, ); return task; } public async cancelAskingTask(taskId: string): Promise { const eventName = TelemetryEvent.HOME_CANCEL_ASK; try { await this.askingTaskTracker.cancelAskingTask(taskId); this.telemetry.sendEvent(eventName, {}); } catch (err: any) { this.telemetry.sendEvent(eventName, {}, err.extensions?.service, false); throw err; } } public async getAskingTask( taskId: string, ): Promise { return this.askingTaskTracker.getAskingResult(taskId); } public async getAskingTaskById( id: number, ): Promise { return this.askingTaskTracker.getAskingResultById(id); } /** * Asking detail task. * The process of creating a thread is as follows: * 1. create a thread and the first thread response * 2. create a task on AI service to generate the detail * 3. update the thread response with the task id */ public async createThread(input: AskingDetailTaskInput): Promise { // 1. create a thread and the first thread response const { id } = await this.projectService.getCurrentProject(); const thread = await this.threadRepository.createOne({ projectId: id, summary: input.question, }); const threadResponse = await this.threadResponseRepository.createOne({ threadId: thread.id, question: input.question, sql: input.sql, askingTaskId: input.trackedAskingResult?.taskId, }); // if queryId is provided, update asking task if (input.trackedAskingResult?.taskId) { await this.askingTaskTracker.bindThreadResponse( input.trackedAskingResult.taskId, input.trackedAskingResult.queryId, thread.id, threadResponse.id, ); } // return the task id return thread; } public async listThreads(): Promise { const { id } = await this.projectService.getCurrentProject(); return await this.threadRepository.listAllTimeDescOrder(id); } public async updateThread( threadId: number, input: Partial, ): Promise { // if input is empty, throw error if (isEmpty(input)) { throw new Error('Update thread input is empty'); } return this.threadRepository.updateOne(threadId, { summary: input.summary, }); } public async deleteThread(threadId: number): Promise { await this.threadRepository.deleteOne(threadId); } public async createThreadResponse( input: AskingDetailTaskInput, threadId: number, ): Promise { const thread = await this.threadRepository.findOneBy({ id: threadId, }); if (!thread) { throw new Error(`Thread ${threadId} not found`); } const threadResponse = await this.threadResponseRepository.createOne({ threadId: thread.id, question: input.question, sql: input.sql, askingTaskId: input.trackedAskingResult?.taskId, }); // if queryId is provided, update asking task if (input.trackedAskingResult?.taskId) { await this.askingTaskTracker.bindThreadResponse( input.trackedAskingResult.taskId, input.trackedAskingResult.queryId, thread.id, threadResponse.id, ); } return threadResponse; } public async updateThreadResponse( responseId: number, data: { sql: string }, ): Promise { const threadResponse = await this.threadResponseRepository.findOneBy({ id: responseId, }); if (!threadResponse) { throw new Error(`Thread response ${responseId} not found`); } return await this.threadResponseRepository.updateOne(responseId, { sql: data.sql, }); } public async generateThreadResponseBreakdown( threadResponseId: number, configurations: { language: string }, ): Promise { const { language } = configurations; const threadResponse = await this.threadResponseRepository.findOneBy({ id: threadResponseId, }); if (!threadResponse) { throw new Error(`Thread response ${threadResponseId} not found`); } // 1. create a task on AI service to generate the detail const response = await this.wrenAIAdaptor.generateAskDetail({ query: threadResponse.question, sql: threadResponse.sql, configurations: { language }, }); // 2. update the thread response with breakdown detail const updatedThreadResponse = await this.threadResponseRepository.updateOne( threadResponse.id, { breakdownDetail: { queryId: response.queryId, status: AskResultStatus.UNDERSTANDING, }, }, ); // 3. put the task into background tracker this.breakdownBackgroundTracker.addTask(updatedThreadResponse); // return the task id return updatedThreadResponse; } public async generateThreadResponseAnswer( threadResponseId: number, ): Promise { const threadResponse = await this.threadResponseRepository.findOneBy({ id: threadResponseId, }); if (!threadResponse) { throw new Error(`Thread response ${threadResponseId} not found`); } // update with initial status const updatedThreadResponse = await this.threadResponseRepository.updateOne( threadResponse.id, { answerDetail: { status: ThreadResponseAnswerStatus.NOT_STARTED, }, }, ); // put the task into background tracker this.textBasedAnswerBackgroundTracker.addTask(updatedThreadResponse); return updatedThreadResponse; } public async generateThreadResponseChart( threadResponseId: number, configurations: { language: string }, ): Promise { const threadResponse = await this.threadResponseRepository.findOneBy({ id: threadResponseId, }); if (!threadResponse) { throw new Error(`Thread response ${threadResponseId} not found`); } // 1. create a task on AI service to generate the chart const response = await this.wrenAIAdaptor.generateChart({ query: threadResponse.question, sql: threadResponse.sql, configurations, }); // 2. update the thread response with chart detail const updatedThreadResponse = await this.threadResponseRepository.updateOne( threadResponse.id, { chartDetail: { queryId: response.queryId, status: ChartStatus.FETCHING, }, }, ); // 3. put the task into background tracker this.chartBackgroundTracker.addTask(updatedThreadResponse); return updatedThreadResponse; } public async adjustThreadResponseChart( threadResponseId: number, input: ChartAdjustmentOption, configurations: { language: string }, ): Promise { const threadResponse = await this.threadResponseRepository.findOneBy({ id: threadResponseId, }); if (!threadResponse) { throw new Error(`Thread response ${threadResponseId} not found`); } // 1. create a task on AI service to adjust the chart const response = await this.wrenAIAdaptor.adjustChart({ query: threadResponse.question, sql: threadResponse.sql, adjustmentOption: input, chartSchema: threadResponse.chartDetail?.chartSchema, configurations, }); // 2. update the thread response with chart detail const updatedThreadResponse = await this.threadResponseRepository.updateOne( threadResponse.id, { chartDetail: { queryId: response.queryId, status: ChartStatus.FETCHING, adjustment: true, }, }, ); // 3. put the task into background tracker this.chartAdjustmentBackgroundTracker.addTask(updatedThreadResponse); return updatedThreadResponse; } public async getResponsesWithThread(threadId: number) { return this.threadResponseRepository.getResponsesWithThread(threadId); } public async getResponse(responseId: number) { return this.threadResponseRepository.findOneBy({ id: responseId }); } public async previewData(responseId: number, limit?: number) { const response = await this.getResponse(responseId); if (!response) { throw new Error(`Thread response ${responseId} not found`); } const project = await this.projectService.getCurrentProject(); const deployment = await this.deployService.getLastDeployment(project.id); const mdl = deployment.manifest; const eventName = TelemetryEvent.HOME_PREVIEW_ANSWER; try { const data = (await this.queryService.preview(response.sql, { project, manifest: mdl, limit, })) as PreviewDataResponse; this.telemetry.sendEvent(eventName, { sql: response.sql }); return data; } catch (err: any) { this.telemetry.sendEvent( eventName, { sql: response.sql, error: err.message }, err.extensions?.service, false, ); throw err; } } /** * this function is used to preview the data of a thread response * get the target thread response and get the steps * construct the CTEs and get the data * @param responseId: the id of the thread response * @param stepIndex: the step in the response detail * @returns Promise */ public async previewBreakdownData( responseId: number, stepIndex?: number, limit?: number, ): Promise { const response = await this.getResponse(responseId); if (!response) { throw new Error(`Thread response ${responseId} not found`); } const project = await this.projectService.getCurrentProject(); const deployment = await this.deployService.getLastDeployment(project.id); const mdl = deployment.manifest; const steps = response?.breakdownDetail?.steps; const sql = safeFormatSQL(constructCteSql(steps, stepIndex)); const eventName = TelemetryEvent.HOME_PREVIEW_ANSWER; try { const data = (await this.queryService.preview(sql, { project, manifest: mdl, limit, })) as PreviewDataResponse; this.telemetry.sendEvent(eventName, { sql }); return data; } catch (err: any) { this.telemetry.sendEvent( eventName, { sql, error: err.message }, err.extensions?.service, false, ); throw err; } } public async createInstantRecommendedQuestions( input: InstantRecommendedQuestionsInput, ): Promise { const project = await this.projectService.getCurrentProject(); const { manifest } = await this.deployService.getLastDeployment(project.id); const response = await this.wrenAIAdaptor.generateRecommendationQuestions({ manifest, previousQuestions: input.previousQuestions, ...this.getThreadRecommendationQuestionsConfig(project), }); return { id: response.queryId }; } public async getInstantRecommendedQuestions( queryId: string, ): Promise { const response = await this.wrenAIAdaptor.getRecommendationQuestionsResult(queryId); return response; } public async deleteAllByProjectId(projectId: number): Promise { // delete all threads await this.threadRepository.deleteAllBy({ projectId }); } public async changeThreadResponseAnswerDetailStatus( responseId: number, status: ThreadResponseAnswerStatus, content?: string, ): Promise { const response = await this.threadResponseRepository.findOneBy({ id: responseId, }); if (!response) { throw new Error(`Thread response ${responseId} not found`); } if (response.answerDetail?.status === status) { return; } const updatedResponse = await this.threadResponseRepository.updateOne( responseId, { answerDetail: { ...response.answerDetail, status, content, }, }, ); return updatedResponse; } private async getDeployId() { const { id } = await this.projectService.getCurrentProject(); const lastDeploy = await this.deployService.getLastDeployment(id); return lastDeploy.hash; } public async adjustThreadResponseWithSQL( threadResponseId: number, input: AdjustmentSqlInput, ): Promise { const response = await this.threadResponseRepository.findOneBy({ id: threadResponseId, }); if (!response) { throw new Error(`Thread response ${threadResponseId} not found`); } return await this.threadResponseRepository.createOne({ sql: input.sql, threadId: response.threadId, question: response.question, adjustment: { type: ThreadResponseAdjustmentType.APPLY_SQL, payload: { originalThreadResponseId: response.id, sql: input.sql, }, }, }); } public async adjustThreadResponseAnswer( threadResponseId: number, input: AdjustmentReasoningInput, configurations: { language: string }, ): Promise { const originalThreadResponse = await this.threadResponseRepository.findOneBy({ id: threadResponseId, }); if (!originalThreadResponse) { throw new Error(`Thread response ${threadResponseId} not found`); } const { createdThreadResponse } = await this.adjustmentBackgroundTracker.createAdjustmentTask({ threadId: originalThreadResponse.threadId, tables: input.tables, sqlGenerationReasoning: input.sqlGenerationReasoning, sql: originalThreadResponse.sql, projectId: input.projectId, configurations, question: originalThreadResponse.question, originalThreadResponseId: originalThreadResponse.id, }); return createdThreadResponse; } public async cancelAdjustThreadResponseAnswer(taskId: string): Promise { // call cancelAskFeedback on AI service await this.adjustmentBackgroundTracker.cancelAdjustmentTask(taskId); } public async rerunAdjustThreadResponseAnswer( threadResponseId: number, projectId: number, configurations: { language: string }, ): Promise<{ queryId: string }> { const threadResponse = await this.threadResponseRepository.findOneBy({ id: threadResponseId, }); if (!threadResponse) { throw new Error(`Thread response ${threadResponseId} not found`); } const { queryId } = await this.adjustmentBackgroundTracker.rerunAdjustmentTask({ threadId: threadResponse.threadId, threadResponseId, projectId, configurations, }); return { queryId }; } public async getAdjustmentTask( taskId: string, ): Promise { return this.adjustmentBackgroundTracker.getAdjustmentResult(taskId); } public async getAdjustmentTaskById( id: number, ): Promise { return this.adjustmentBackgroundTracker.getAdjustmentResultById(id); } /** * Get the thread response of a thread for asking * @param threadId * @returns Promise */ private async getAskingHistory( threadId: number, excludeThreadResponseId?: number, ): Promise { if (!threadId) { return []; } let responses = await this.threadResponseRepository.getResponsesWithThread( threadId, 10, ); // exclude the thread response if the excludeThreadResponseId is provided // it's used when rerun the asking task, we don't want include the cancelled thread response if (excludeThreadResponseId) { responses = responses.filter( (response) => response.id !== excludeThreadResponseId, ); } // filter out the thread response with empty sql return responses.filter((response) => response.sql); } private getThreadRecommendationQuestionsConfig(project: Project) { return { maxCategories: config.threadRecommendationQuestionMaxCategories, maxQuestions: config.threadRecommendationQuestionsMaxQuestions, configuration: { language: WrenAILanguage[project.language] || WrenAILanguage.EN, }, }; } } ================================================ FILE: wren-ui/src/apollo/server/services/askingTaskTracker.ts ================================================ import { getLogger } from '@server/utils'; import { AskResult, AskResultType, AskResultStatus, AskInput, } from '@server/models/adaptor'; import { AskingTask, IAskingTaskRepository, IThreadResponseRepository, IViewRepository, } from '@server/repositories'; import { IWrenAIAdaptor } from '../adaptors'; import * as Errors from '@server/utils/error'; const logger = getLogger('AskingTaskTracker'); logger.level = 'debug'; interface TrackedTask { queryId: string; taskId?: number; lastPolled: number; question?: string; result?: AskResult; isFinalized: boolean; threadResponseId?: number; rerunFromCancelled?: boolean; } export type TrackedAskingResult = AskResult & { taskId?: number; queryId: string; question: string; }; export type CreateAskingTaskInput = AskInput & { rerunFromCancelled?: boolean; previousTaskId?: number; threadResponseId?: number; }; export interface IAskingTaskTracker { createAskingTask(input: CreateAskingTaskInput): Promise<{ queryId: string }>; getAskingResult(queryId: string): Promise; getAskingResultById(id: number): Promise; cancelAskingTask(queryId: string): Promise; bindThreadResponse( id: number, queryId: string, threadId: number, threadResponseId: number, ): Promise; } export class AskingTaskTracker implements IAskingTaskTracker { private wrenAIAdaptor: IWrenAIAdaptor; private askingTaskRepository: IAskingTaskRepository; private trackedTasks: Map = new Map(); private trackedTasksById: Map = new Map(); private pollingInterval: number; private memoryRetentionTime: number; private pollingIntervalId: NodeJS.Timeout; private runningJobs = new Set(); private threadResponseRepository: IThreadResponseRepository; private viewRepository: IViewRepository; constructor({ wrenAIAdaptor, askingTaskRepository, threadResponseRepository, viewRepository, pollingInterval = 1000, // 1 second memoryRetentionTime = 5 * 60 * 1000, // 5 minutes }: { wrenAIAdaptor: IWrenAIAdaptor; askingTaskRepository: IAskingTaskRepository; threadResponseRepository: IThreadResponseRepository; viewRepository: IViewRepository; pollingInterval?: number; memoryRetentionTime?: number; }) { this.wrenAIAdaptor = wrenAIAdaptor; this.askingTaskRepository = askingTaskRepository; this.threadResponseRepository = threadResponseRepository; this.viewRepository = viewRepository; this.pollingInterval = pollingInterval; this.memoryRetentionTime = memoryRetentionTime; this.startPolling(); } public async createAskingTask( input: CreateAskingTaskInput, ): Promise<{ queryId: string }> { try { // Call the AI service to create a task const response = await this.wrenAIAdaptor.ask(input); const queryId = response.queryId; // validate the input if ( input.rerunFromCancelled && (!input.previousTaskId || !input.threadResponseId) ) { throw new Error( 'Previous task id and thread response id are required if rerun from cancelled', ); } // Start tracking this task const task = { queryId, lastPolled: Date.now(), question: input.query, isFinalized: false, rerunFromCancelled: input.rerunFromCancelled, } as TrackedTask; this.trackedTasks.set(queryId, task); // if rerun from cancelled, we update the query id to the previous task if ( input.rerunFromCancelled && input.previousTaskId && input.threadResponseId ) { // set the thread response id in memory to bind the task to the thread response // we don't have to update to database here because the thread response id is already set in database task.threadResponseId = input.threadResponseId; // update the task id in memory this.trackedTasksById.set(input.previousTaskId, task); // get the latest result from the AI service // we get the latest result first to make it more responsive to client-side const result = await this.wrenAIAdaptor.getAskResult(queryId); // update the result in memory task.result = result; // update the query id in database await this.askingTaskRepository.updateOne(input.previousTaskId, { queryId, }); } logger.info(`Created asking task with queryId: ${queryId}`); return { queryId }; } catch (err) { logger.error(`Failed to create asking task: ${err}`); throw err; } } public async getAskingResult( queryId: string, ): Promise { // Check if we're tracking this task in memory const trackedTask = this.trackedTasks.get(queryId); if (trackedTask && trackedTask.result) { return { ...trackedTask.result, queryId, question: trackedTask.question, taskId: trackedTask.taskId, }; } // If not in memory or no result yet, check the database return this.getAskingResultFromDB({ queryId }); } public async getAskingResultById( id: number, ): Promise { const task = this.trackedTasksById.get(id); if (task) { return this.getAskingResult(task.queryId); } return this.getAskingResultFromDB({ taskId: id }); } public async cancelAskingTask(queryId: string): Promise { await this.wrenAIAdaptor.cancelAsk(queryId); } public stopPolling(): void { if (this.pollingIntervalId) { clearInterval(this.pollingIntervalId); } } public async bindThreadResponse( id: number, queryId: string, threadId: number, threadResponseId: number, ): Promise { const task = this.trackedTasks.get(queryId); if (!task) { throw new Error(`Task ${queryId} not found`); } task.threadResponseId = threadResponseId; this.trackedTasksById.set(id, task); await this.askingTaskRepository.updateOne(id, { threadId, threadResponseId, }); // check if the task is finalized and has a sql if (task.isFinalized) { await this.updateThreadResponseWhenTaskFinalized(task); } } private startPolling(): void { this.pollingIntervalId = setInterval(() => { this.pollTasks(); }, this.pollingInterval); } private async pollTasks(): Promise { const now = Date.now(); const tasksToRemove: string[] = []; // Create an array of job functions const jobs = Array.from(this.trackedTasks.entries()).map( ([queryId, task]) => async () => { try { // Skip if the job is already running if (this.runningJobs.has(queryId)) { return; } // Skip finalized tasks that have been in memory too long if ( task.isFinalized && now - task.lastPolled > this.memoryRetentionTime ) { tasksToRemove.push(queryId); return; } // Skip finalized tasks if (task.isFinalized) { return; } // Mark the job as running this.runningJobs.add(queryId); // Poll for updates logger.info(`Polling for updates for task ${queryId}`); const result = await this.wrenAIAdaptor.getAskResult(queryId); task.lastPolled = now; // if result is not changed, we don't need to update the database if (!this.isResultChanged(task.result, result)) { this.runningJobs.delete(queryId); return; } // update task in memory if any change task.result = result; // if result is still understanding, we don't need to update the database if (result.status === AskResultStatus.UNDERSTANDING) { this.runningJobs.delete(queryId); return; } // if it's identified as GENERAL or MISLEADING_QUER // we don't need to update the database and finalize the task if ( result.type === AskResultType.GENERAL || result.type === AskResultType.MISLEADING_QUERY ) { task.isFinalized = true; // if it's rerun from cancelled, we need to update the task result to failed in db if (task.rerunFromCancelled) { const errorCode = result.type === AskResultType.GENERAL ? Errors.GeneralErrorCodes.IDENTIED_AS_GENERAL : Errors.GeneralErrorCodes.IDENTIED_AS_MISLEADING_QUERY; const error = { code: errorCode, message: Errors.errorMessages[errorCode], shortMessage: Errors.shortMessages[errorCode], }; await this.updateTaskInDatabase( { queryId }, { ...task, // update the status to failed // and the error message should be "IDENTIED_AS_GENERAL" or "IDENTIED_AS_MISLEADING_QUERY" result: { ...task.result, status: AskResultStatus.FAILED, error, }, }, ); } this.runningJobs.delete(queryId); return; } // update the database // note: type could be null if it's still being understood or it's stopped // we already filtered out the understanding status above // so we update to database if it's stopped as well here. logger.info(`Updating task ${queryId} in database`); await this.updateTaskInDatabase({ queryId }, task); // Check if task is now finalized if (this.isTaskFinalized(result.status)) { task.isFinalized = true; // update thread response if threadResponseId is provided if (task.threadResponseId) { await this.updateThreadResponseWhenTaskFinalized(task); } logger.info( `Task ${queryId} is finalized with status: ${result.status}`, ); } // Mark the job as finished this.runningJobs.delete(queryId); } catch (err) { this.runningJobs.delete(queryId); logger.error(err.stack); throw err; } }, ); // Run all jobs in parallel Promise.allSettled(jobs.map((job) => job())).then((results) => { // Log any rejected promises results.forEach((result, index) => { if (result.status === 'rejected') { logger.error(`Job ${index} failed: ${result.reason}`); } }); // Clean up tasks that have been in memory too long if (tasksToRemove.length > 0) { logger.info( `Cleaning up tasks that have been in memory too long. Tasks: ${tasksToRemove.join( ', ', )}`, ); } for (const queryId of tasksToRemove) { this.trackedTasks.delete(queryId); } }); } private async updateThreadResponseWhenTaskFinalized( task: TrackedTask, ): Promise { const response = task?.result?.response?.[0]; if (!response) { return; } // if the generated response of asking task is not null, update the thread response if (response.viewId) { // get sql from the view const view = await this.viewRepository.findOneBy({ id: response.viewId, }); await this.threadResponseRepository.updateOne(task.threadResponseId, { sql: view.statement, viewId: response.viewId, }); } else { await this.threadResponseRepository.updateOne(task.threadResponseId, { sql: response?.sql, }); } } private async getAskingResultFromDB({ queryId, taskId, }: { queryId?: string; taskId?: number; }): Promise { let taskRecord: AskingTask | null = null; if (queryId) { taskRecord = await this.askingTaskRepository.findByQueryId(queryId); } else if (taskId) { taskRecord = await this.askingTaskRepository.findOneBy({ id: taskId }); } if (!taskRecord) { return null; } return { ...(taskRecord?.detail as AskResult), queryId: queryId || taskRecord?.queryId, question: taskRecord?.question, taskId: taskRecord?.id, }; } private async updateTaskInDatabase( filter: { queryId?: string; taskId?: number }, trackedTask: TrackedTask, ): Promise { const { queryId, taskId } = filter; let taskRecord: AskingTask | null = null; if (queryId) { taskRecord = await this.askingTaskRepository.findByQueryId(queryId); } else if (taskId) { taskRecord = await this.askingTaskRepository.findOneBy({ id: taskId }); } if (!taskRecord) { // if record not found, create one const task = await this.askingTaskRepository.createOne({ queryId, question: trackedTask.question, detail: trackedTask.result, }); // update the task id in memory let existingTask: TrackedTask; if (queryId) { existingTask = this.trackedTasks.get(queryId); } else if (taskId) { existingTask = this.trackedTasksById.get(taskId); } if (existingTask) { existingTask.taskId = task.id; } return; } // update the task await this.askingTaskRepository.updateOne(taskRecord.id, { detail: trackedTask.result, }); } private isTaskFinalized(status: AskResultStatus): boolean { return [ AskResultStatus.FINISHED, AskResultStatus.FAILED, AskResultStatus.STOPPED, ].includes(status); } private isResultChanged( previousResult: AskResult, newResult: AskResult, ): boolean { // check status change if (previousResult?.status !== newResult.status) { return true; } return false; } } ================================================ FILE: wren-ui/src/apollo/server/services/dashboardService.ts ================================================ import { IDashboardRepository, IDashboardItemRepository, Dashboard, DashboardItem, DashboardItemType, DashboardItemDetail, DashboardItemLayout, } from '@server/repositories'; import { getLogger } from '@server/utils'; import { getUTCOffsetMinutes } from '@server/utils/timezone'; import { IProjectService } from './projectService'; import { SetDashboardCacheData, ScheduleFrequencyEnum, CacheScheduleDayEnum, DashboardSchedule, DAYS, } from '@server/models/dashboard'; import { CronExpressionParser } from 'cron-parser'; const logger = getLogger('DashboardService'); logger.level = 'debug'; export interface CreateDashboardItemInput { dashboardId: number; type: DashboardItemType; sql: string; chartSchema: DashboardItemDetail['chartSchema']; } export interface UpdateDashboardItemInput { displayName: string; } export type UpdateDashboardItemLayouts = (DashboardItemLayout & { itemId: number; })[]; export interface IDashboardService { initDashboard(): Promise; getCurrentDashboard(): Promise; getDashboardItem(dashboardItemId: number): Promise; getDashboardItems(dashboardId: number): Promise; createDashboardItem(input: CreateDashboardItemInput): Promise; updateDashboardItem( dashboardItemId: number, input: UpdateDashboardItemInput, ): Promise; deleteDashboardItem(dashboardItemId: number): Promise; updateDashboardItemLayouts( layouts: UpdateDashboardItemLayouts, ): Promise; setDashboardSchedule( dashboardId: number, data: SetDashboardCacheData, ): Promise; parseCronExpression(dashboard: Dashboard): DashboardSchedule; } export class DashboardService implements IDashboardService { private projectService: IProjectService; private dashboardItemRepository: IDashboardItemRepository; private dashboardRepository: IDashboardRepository; constructor({ projectService, dashboardItemRepository, dashboardRepository, }: { projectService: IProjectService; dashboardItemRepository: IDashboardItemRepository; dashboardRepository: IDashboardRepository; }) { this.projectService = projectService; this.dashboardItemRepository = dashboardItemRepository; this.dashboardRepository = dashboardRepository; } public async setDashboardSchedule( dashboardId: number, data: SetDashboardCacheData, ): Promise { try { const { cacheEnabled, schedule } = data; // Validate input this.validateScheduleInput(data); // Check if dashboard exists const dashboard = await this.dashboardRepository.findOneBy({ id: dashboardId, }); if (!dashboard) { throw new Error(`Dashboard with id ${dashboardId} not found`); } if (!cacheEnabled) { return await this.dashboardRepository.updateOne(dashboardId, { cacheEnabled: false, scheduleFrequency: null, scheduleTimezone: null, scheduleCron: null, nextScheduledAt: null, }); } // Initialize schedule-related variables let cronExpression: string | null = null; let nextScheduledAt: Date | null = null; // Process schedule if caching is enabled if (cacheEnabled && schedule.frequency !== ScheduleFrequencyEnum.NEVER) { cronExpression = this.generateCronExpression(schedule); nextScheduledAt = this.calculateNextRunTime(cronExpression); } // Update dashboard with new schedule return await this.dashboardRepository.updateOne(dashboardId, { cacheEnabled, scheduleFrequency: schedule.frequency, scheduleTimezone: schedule.timezone, scheduleCron: cronExpression, nextScheduledAt, }); } catch (error) { logger.error(`Failed to set dashboard schedule: ${error.message}`); throw error; } } public async initDashboard(): Promise { const project = await this.projectService.getCurrentProject(); const existingDashboard = await this.dashboardRepository.findOneBy({ projectId: project.id, }); if (existingDashboard) return existingDashboard; // only support one dashboard for oss return await this.dashboardRepository.createOne({ name: 'Dashboard', projectId: project.id, }); } public async getCurrentDashboard(): Promise { const project = await this.projectService.getCurrentProject(); const dashboard = await this.dashboardRepository.findOneBy({ projectId: project.id, }); return { ...dashboard }; } public async getDashboardItem( dashboardItemId: number, ): Promise { const item = await this.dashboardItemRepository.findOneBy({ id: dashboardItemId, }); if (!item) { throw new Error('Dashboard item not found.'); } return item; } public async getDashboardItems( dashboardId: number, ): Promise { return await this.dashboardItemRepository.findAllBy({ dashboardId, }); } public async createDashboardItem( input: CreateDashboardItemInput, ): Promise { const layout = await this.calculateNewLayout(input.dashboardId); return await this.dashboardItemRepository.createOne({ dashboardId: input.dashboardId, type: input.type, detail: { sql: input.sql, chartSchema: input.chartSchema, }, layout, }); } public async updateDashboardItem( dashboardItemId: number, input: UpdateDashboardItemInput, ): Promise { return await this.dashboardItemRepository.updateOne(dashboardItemId, { displayName: input.displayName, }); } public async updateDashboardItemLayouts( layouts: UpdateDashboardItemLayouts, ): Promise { const updatedItems: DashboardItem[] = []; const isValidLayouts = layouts.every( (layout) => layout.itemId && layout.x >= 0 && layout.y >= 0 && layout.w > 0 && layout.h > 0, ); if (!isValidLayouts) { throw new Error('Invalid layouts boundaries.'); } await Promise.all( layouts.map(async (layout) => { const updatedItem = await this.dashboardItemRepository.updateOne( layout.itemId, { layout: { x: layout.x, y: layout.y, w: layout.w, h: layout.h, }, }, ); updatedItems.push(updatedItem); }), ); return updatedItems; } public async deleteDashboardItem(dashboardItemId: number): Promise { await this.dashboardItemRepository.deleteOne(dashboardItemId); return true; } private async calculateNewLayout( dashboardId: number, ): Promise { const dashboardItems = await this.dashboardItemRepository.findAllBy({ dashboardId, }); const allLayouts = dashboardItems.map((item) => item.layout); if (allLayouts.length === 0) return { x: 0, y: 0, w: 3, h: 2 }; const columnCount = 6; const halfLayoutX = columnCount / 2; // the current max y is the current row const maxY = Math.max(...allLayouts.map((layout) => layout.y)); const latestLayout = allLayouts.filter((layout) => layout.y === maxY); const isNextRow = latestLayout.reduce((acc, layout) => acc + layout.x + layout.w, 0) > halfLayoutX; const x = isNextRow ? 0 : halfLayoutX; const y = isNextRow ? maxY + 2 : maxY; return { x, y, w: 3, h: 2 }; } protected toUTC(schedule: DashboardSchedule): DashboardSchedule { // If no timezone is specified or it's a custom schedule, return as is if ( !schedule.timezone || schedule.frequency === ScheduleFrequencyEnum.CUSTOM ) { return schedule; } // Get timezone offset in minutes const offsetMinutes = getUTCOffsetMinutes(schedule.timezone); // Convert to UTC by subtracting the offset (if timezone is ahead of UTC) // or adding the offset (if timezone is behind UTC) let utcMinute = schedule.minute - offsetMinutes; let carryOver = 0; // Handle minute carry-over if (utcMinute < 0) { carryOver = Math.ceil(Math.abs(utcMinute) / 60); utcMinute = (utcMinute + carryOver * 60) % 60; carryOver = -carryOver; } else if (utcMinute >= 60) { carryOver = Math.floor(utcMinute / 60); utcMinute = utcMinute % 60; } let utcHour = schedule.hour + carryOver; let dayAdjustment = 0; // Handle hour carry-over if (utcHour < 0) { dayAdjustment = Math.ceil(Math.abs(utcHour) / 24); utcHour = (utcHour + dayAdjustment * 24) % 24; dayAdjustment = -dayAdjustment; } else if (utcHour >= 24) { dayAdjustment = Math.floor(utcHour / 24); utcHour = utcHour % 24; } // For weekly schedules, adjust the day if needed if ( schedule.frequency === ScheduleFrequencyEnum.WEEKLY && dayAdjustment !== 0 ) { const currentDayIndex = DAYS.indexOf(schedule.day); const adjustedDayIndex = (currentDayIndex + dayAdjustment + 7) % 7; return { ...schedule, hour: utcHour, minute: utcMinute, day: DAYS[adjustedDayIndex], }; } // Return a new schedule object with UTC hours and minutes return { ...schedule, hour: utcHour, minute: utcMinute, }; } protected toTimezone(schedule: DashboardSchedule): DashboardSchedule { const { timezone } = schedule; // If it's a custom schedule or no timezone is specified, return as is if ( [ScheduleFrequencyEnum.CUSTOM, ScheduleFrequencyEnum.NEVER].includes( schedule.frequency, ) || !timezone ) { return schedule; } // Get timezone offset in minutes const offsetMinutes = getUTCOffsetMinutes(timezone); // Convert from UTC to timezone by adding the offset (if timezone is ahead of UTC) // or subtracting the offset (if timezone is behind UTC) let localMinute = schedule.minute + offsetMinutes; let carryOver = 0; // Handle minute carry-over if (localMinute < 0) { carryOver = Math.ceil(Math.abs(localMinute) / 60); localMinute = (localMinute + carryOver * 60) % 60; carryOver = -carryOver; } else if (localMinute >= 60) { carryOver = Math.floor(localMinute / 60); localMinute = localMinute % 60; } let localHour = schedule.hour + carryOver; let dayAdjustment = 0; // Handle hour carry-over if (localHour < 0) { dayAdjustment = Math.ceil(Math.abs(localHour) / 24); localHour = (localHour + dayAdjustment * 24) % 24; dayAdjustment = -dayAdjustment; } else if (localHour >= 24) { dayAdjustment = Math.floor(localHour / 24); localHour = localHour % 24; } // For weekly schedules, adjust the day if needed if ( schedule.frequency === ScheduleFrequencyEnum.WEEKLY && dayAdjustment !== 0 ) { const currentDayIndex = DAYS.indexOf(schedule.day); const adjustedDayIndex = (currentDayIndex + dayAdjustment + 7) % 7; return { ...schedule, hour: localHour, minute: localMinute, day: DAYS[adjustedDayIndex], timezone, }; } // Return a new schedule object with local hours and minutes return { ...schedule, hour: localHour, minute: localMinute, timezone, }; } protected generateCronExpression(schedule: DashboardSchedule): string | null { const { frequency, day, hour, minute } = this.toUTC(schedule); switch (frequency) { case ScheduleFrequencyEnum.DAILY: return `${minute} ${hour} * * *`; case ScheduleFrequencyEnum.WEEKLY: // e.g. 0 10 * * MON return `${minute} ${hour} * * ${day}`; case ScheduleFrequencyEnum.CUSTOM: return schedule.cron; case ScheduleFrequencyEnum.NEVER: return null; default: logger.warn(`Unsupported schedule frequency: ${frequency}`); return null; } } protected calculateNextRunTime(cronExpression: string): Date | null { try { const interval = CronExpressionParser.parse(cronExpression, { currentDate: new Date(), }); return interval.next().toDate(); } catch (error) { logger.error(`Failed to parse cron expression: ${error.message}`); return null; } } protected validateScheduleInput(data: SetDashboardCacheData): void { const { schedule } = data; if (!schedule) { return; } if (schedule.frequency === ScheduleFrequencyEnum.WEEKLY && !schedule.day) { throw new Error('Day of week is required for weekly schedule'); } if (schedule.frequency === ScheduleFrequencyEnum.CUSTOM && !schedule.cron) { throw new Error('Cron expression is required for custom schedule'); } if (schedule.hour < 0 || schedule.hour > 23) { throw new Error('Hour must be between 0 and 23'); } if (schedule.minute < 0 || schedule.minute > 59) { throw new Error('Minute must be between 0 and 59'); } if (schedule.timezone) { try { new Date().toLocaleString('en-US', { timeZone: schedule.timezone }); } catch (_) { throw new Error(`Invalid timezone: ${schedule.timezone}`); } } if (schedule.frequency === ScheduleFrequencyEnum.CUSTOM) { // can not less than 10 minutes, skip if is local if (process.env.NODE_ENV === 'development') return; const baseInterval = CronExpressionParser.parse(schedule.cron, { currentDate: new Date(), }); const baseDate = baseInterval.next().toDate(); const nextInterval = CronExpressionParser.parse(schedule.cron, { currentDate: baseDate, }); const nextDate = nextInterval.next().toDate(); const diff = nextDate.getTime() - baseDate.getTime(); if (diff < 10 * 60 * 1000) { throw new Error( 'Custom cron expression must be at least 10 minutes apart', ); } } } public parseCronExpression(dashboard: Dashboard): DashboardSchedule { if (!dashboard.scheduleCron) { return { frequency: dashboard.scheduleFrequency, hour: 0, minute: 0, day: null, timezone: dashboard.scheduleTimezone || '', cron: '', } as DashboardSchedule; } switch (dashboard.scheduleFrequency) { case ScheduleFrequencyEnum.CUSTOM: return { frequency: ScheduleFrequencyEnum.CUSTOM, hour: 0, minute: 0, day: null, timezone: dashboard.scheduleTimezone || '', cron: dashboard.scheduleCron, }; case ScheduleFrequencyEnum.DAILY: case ScheduleFrequencyEnum.WEEKLY: { const parts = dashboard.scheduleCron.split(' '); if (parts.length !== 5) { throw new Error('Invalid cron expression format'); } const [minute, hour, , , dayOfWeek] = parts; return this.toTimezone({ frequency: dashboard.scheduleFrequency, hour: parseInt(hour, 10), minute: parseInt(minute, 10), day: dashboard.scheduleFrequency === ScheduleFrequencyEnum.WEEKLY ? (dayOfWeek as CacheScheduleDayEnum) : null, timezone: dashboard.scheduleTimezone || '', cron: null, } as DashboardSchedule); } case ScheduleFrequencyEnum.NEVER: { return { frequency: ScheduleFrequencyEnum.NEVER, hour: null, minute: null, day: null, timezone: dashboard.scheduleTimezone || '', cron: null, } as DashboardSchedule; } default: { throw new Error('Invalid schedule frequency'); } } } } ================================================ FILE: wren-ui/src/apollo/server/services/deployService.ts ================================================ import { WrenAIDeployStatusEnum } from '@server/models/adaptor'; import { IWrenAIAdaptor } from '../adaptors/wrenAIAdaptor'; import { Deploy, DeployStatusEnum, IDeployLogRepository, } from '../repositories/deployLogRepository'; import { Manifest } from '../mdl/type'; import { createHash } from 'node:crypto'; import { getLogger } from '@server/utils'; import { PostHogTelemetry, TelemetryEvent, WrenService, } from '../telemetry/telemetry'; const logger = getLogger('DeployService'); logger.level = 'debug'; export interface DeployResponse { status: DeployStatusEnum; error?: string; } export interface MDLSyncResponse { isSyncronized: boolean; } export interface IDeployService { deploy( manifest: Manifest, projectId: number, force?: boolean, ): Promise; getLastDeployment(projectId: number): Promise; getInProgressDeployment(projectId: number): Promise; createMDLHash(manifest: Manifest, projectId: number): string; getMDLByHash(hash: string): Promise; deleteAllByProjectId(projectId: number): Promise; } export class DeployService implements IDeployService { private wrenAIAdaptor: IWrenAIAdaptor; private deployLogRepository: IDeployLogRepository; private telemetry: PostHogTelemetry; constructor({ wrenAIAdaptor, deployLogRepository, telemetry, }: { wrenAIAdaptor: IWrenAIAdaptor; deployLogRepository: IDeployLogRepository; telemetry: PostHogTelemetry; }) { this.wrenAIAdaptor = wrenAIAdaptor; this.deployLogRepository = deployLogRepository; this.telemetry = telemetry; } public async getLastDeployment(projectId) { const lastDeploy = await this.deployLogRepository.findLastProjectDeployLog(projectId); if (!lastDeploy) { return null; } return lastDeploy; } public async getInProgressDeployment(projectId) { return await this.deployLogRepository.findInProgressProjectDeployLog( projectId, ); } public async deploy(manifest, projectId, force = false) { const eventName = TelemetryEvent.MODELING_DEPLOY_MDL; try { // generate hash of manifest const hash = this.createMDLHash(manifest, projectId); logger.debug(`Deploying model, hash: ${hash}`); if (!force) { // check if the model current deployment const lastDeploy = await this.deployLogRepository.findLastProjectDeployLog(projectId); if (lastDeploy && lastDeploy.hash === hash) { logger.log(`Model has been deployed, hash: ${hash}`); return { status: DeployStatusEnum.SUCCESS }; } } const deployData = { manifest, hash, projectId, status: DeployStatusEnum.IN_PROGRESS, } as Deploy; const deploy = await this.deployLogRepository.createOne(deployData); // deploy to AI-service const { status: aiStatus, error: aiError } = await this.wrenAIAdaptor.deploy({ manifest, hash, }); // update deploy status const status = aiStatus === WrenAIDeployStatusEnum.SUCCESS ? DeployStatusEnum.SUCCESS : DeployStatusEnum.FAILED; await this.deployLogRepository.updateOne(deploy.id, { status, error: aiError, }); // telemetry if (status === DeployStatusEnum.SUCCESS) { this.telemetry.sendEvent(eventName); } else { this.telemetry.sendEvent( eventName, { mdl: manifest, error: aiError }, WrenService.AI, false, ); } return { status, error: aiError }; } catch (err: any) { logger.error(`Error deploying model: ${err.message}`); this.telemetry.sendEvent( eventName, { mdl: manifest, error: err.message }, err.extensions?.service, false, ); return { status: DeployStatusEnum.FAILED, error: err.message }; } } public createMDLHash(manifest: Manifest, projectId: number) { const manifestStr = JSON.stringify(manifest); const content = `${projectId} ${manifestStr}`; const hash = createHash('sha1').update(content).digest('hex'); return hash; } public async getMDLByHash(hash: string) { const deploy = await this.deployLogRepository.findOneBy({ hash }); if (!deploy) { return null; } // return base64 encoded manifest return Buffer.from(JSON.stringify(deploy.manifest)).toString('base64'); } public async deleteAllByProjectId(projectId: number): Promise { // delete all deploy logs await this.deployLogRepository.deleteAllBy({ projectId }); } } ================================================ FILE: wren-ui/src/apollo/server/services/index.ts ================================================ export * from './askingService'; export * from './deployService'; export * from './mdlService'; export * from './modelService'; export * from './projectService'; export * from './queryService'; export * from './metadataService'; export * from './dashboardService'; export * from './askingTaskTracker'; export * from './instructionService'; ================================================ FILE: wren-ui/src/apollo/server/services/instructionService.ts ================================================ import { pick } from 'lodash'; import { IWrenAIAdaptor } from '@server/adaptors'; import { InstructionInput, UpdateInstructionInput } from '@server/models'; import { InstructionResult, InstructionStatus, GenerateInstructionInput, } from '@server/models/adaptor'; import { IInstructionRepository, Instruction } from '@server/repositories'; import * as Errors from '@server/utils/error'; import { GeneralErrorCodes } from '@server/utils/error'; export interface IInstructionService { getInstructions(projectId: number): Promise; getInstruction(id: number): Promise; createInstruction(instruction: InstructionInput): Promise; createInstructions(instructions: InstructionInput[]): Promise; updateInstruction(instruction: UpdateInstructionInput): Promise; deleteInstruction(id: number, projectId: number): Promise; } export class InstructionService implements IInstructionService { private readonly instructionRepository: IInstructionRepository; private readonly wrenAIAdaptor: IWrenAIAdaptor; constructor({ instructionRepository, wrenAIAdaptor, }: { instructionRepository: IInstructionRepository; wrenAIAdaptor: IWrenAIAdaptor; }) { this.instructionRepository = instructionRepository; this.wrenAIAdaptor = wrenAIAdaptor; } public async getInstructions(projectId: number): Promise { return this.instructionRepository.findAllBy({ projectId }); } public async getInstruction(id: number): Promise { return this.instructionRepository.findOneBy({ id }); } public async createInstruction( input: InstructionInput, ): Promise { const tx = await this.instructionRepository.transaction(); try { this.validateInstructionInput(input); const newInstruction = await this.instructionRepository.createOne( { ...input, createdAt: new Date().toISOString(), updatedAt: new Date().toISOString(), }, { tx, }, ); const { queryId } = await this.wrenAIAdaptor.generateInstruction([ this.pickGenerateInstructionInput(newInstruction), ]); const res = await this.waitDeployInstruction(queryId); if (res.error) { await tx.rollback(); throw Errors.create(res.error.code, { customMessage: res.error.message, }); } await tx.commit(); return newInstruction; } catch (e: any) { await tx.rollback(); throw new Error(`Failed to create instruction: ${e}`); } } public async createInstructions( inputs: InstructionInput[], ): Promise { const tx = await this.instructionRepository.transaction(); try { inputs.forEach((input) => this.validateInstructionInput(input)); const newInstructions = await this.instructionRepository.createMany( inputs.map((input) => ({ ...input, createdAt: new Date().toISOString(), updatedAt: new Date().toISOString(), })), { tx, }, ); const { queryId } = await this.wrenAIAdaptor.generateInstruction( newInstructions.map(this.pickGenerateInstructionInput), ); const res = await this.waitDeployInstruction(queryId); if (res.error) { await tx.rollback(); throw Errors.create(res.error.code, { customMessage: res.error.message, }); } await tx.commit(); return newInstructions; } catch (e: any) { await tx.rollback(); throw new Error(`Failed to create instruction: ${e}`); } } public async updateInstruction( input: UpdateInstructionInput, ): Promise { const tx = await this.instructionRepository.transaction(); try { this.validateInstructionInput(input); const instruction = await this.instructionRepository.findOneBy( { id: input.id, projectId: input.projectId }, { tx, }, ); if (!instruction) { throw new Error('Instruction not found'); } const instructionData = { ...instruction, ...input, updatedAt: new Date().toISOString(), }; const updatedInstruction = await this.instructionRepository.updateOne( input.id, instructionData, { tx }, ); const { queryId } = await this.wrenAIAdaptor.generateInstruction([ this.pickGenerateInstructionInput(updatedInstruction), ]); const res = await this.waitDeployInstruction(queryId); if (res.error) { await tx.rollback(); throw Errors.create(res.error.code, { customMessage: res.error.message, }); } await tx.commit(); return updatedInstruction; } catch (e: any) { await tx.rollback(); throw new Error(`Failed to update instruction: ${e}`); } } async deleteInstruction(id: number, projectId: number): Promise { const tx = await this.instructionRepository.transaction(); try { const instruction = await this.instructionRepository.findOneBy( { id, projectId }, { tx }, ); if (!instruction) { throw new Error('Instruction not found'); } await this.instructionRepository.deleteOne(id, { tx }); await this.wrenAIAdaptor.deleteInstructions([id], instruction.projectId); await tx.commit(); } catch (e: any) { await tx.rollback(); throw new Error(`Failed to delete instruction: ${e}`); } } private async waitDeployInstruction( queryId: string, maxRetries = 30, // Default 30 retries (30 seconds) ): Promise { const isFinalStatus = (status: InstructionStatus) => status === InstructionStatus.FINISHED || status === InstructionStatus.FAILED; let res = await this.wrenAIAdaptor.getInstructionResult(queryId); let retryCount = 0; while (!isFinalStatus(res.status) && retryCount < maxRetries) { await new Promise((resolve) => setTimeout(resolve, 1000)); res = await this.wrenAIAdaptor.getInstructionResult(queryId); retryCount++; } if (!isFinalStatus(res.status)) { throw Errors.create(GeneralErrorCodes.DEPLOY_TIMEOUT_ERROR, { customMessage: `Instruction deployment timed out after ${maxRetries} seconds`, }); } return res; } private pickGenerateInstructionInput( instruction: Instruction, ): GenerateInstructionInput { return pick(instruction, [ 'id', 'projectId', 'instruction', 'questions', 'isDefault', ]); } private validateInstructionInput(input: InstructionInput): void { if (!input.instruction) { throw new Error('Instruction is required'); } if (input.instruction.length > 1000) { throw new Error('Instruction is too long'); } } } ================================================ FILE: wren-ui/src/apollo/server/services/mdlService.ts ================================================ import { MDLBuilder } from '../mdl/mdlBuilder'; import { IModelNestedColumnRepository, IModelColumnRepository, IModelRepository, IProjectRepository, IRelationRepository, IViewRepository, } from '../repositories'; import { Manifest } from '../mdl/type'; export interface MakeCurrentModelMDLResult { manifest: Manifest; mdlBuilder: MDLBuilder; } export interface IMDLService { makeCurrentModelMDL(): Promise; } export class MDLService implements IMDLService { private projectRepository: IProjectRepository; private modelRepository: IModelRepository; private modelColumnRepository: IModelColumnRepository; private modelNestedColumnRepository: IModelNestedColumnRepository; private relationRepository: IRelationRepository; private viewRepository: IViewRepository; constructor({ projectRepository, modelRepository, modelColumnRepository, modelNestedColumnRepository, relationRepository, viewRepository, }: { projectRepository: IProjectRepository; modelRepository: IModelRepository; modelColumnRepository: IModelColumnRepository; modelNestedColumnRepository: IModelNestedColumnRepository; relationRepository: IRelationRepository; viewRepository: IViewRepository; }) { this.projectRepository = projectRepository; this.modelRepository = modelRepository; this.modelColumnRepository = modelColumnRepository; this.modelNestedColumnRepository = modelNestedColumnRepository; this.relationRepository = relationRepository; this.viewRepository = viewRepository; } public async makeCurrentModelMDL() { const project = await this.projectRepository.getCurrentProject(); const projectId = project.id; const models = await this.modelRepository.findAllBy({ projectId }); const modelIds = models.map((m) => m.id); const columns = await this.modelColumnRepository.findColumnsByModelIds(modelIds); const modelNestedColumns = await this.modelNestedColumnRepository.findNestedColumnsByModelIds( modelIds, ); const relations = await this.relationRepository.findRelationInfoBy({ projectId, }); const views = await this.viewRepository.findAllBy({ projectId }); const relatedModels = models; const relatedColumns = columns; const relatedRelations = relations; const mdlBuilder = new MDLBuilder({ project, models, columns, nestedColumns: modelNestedColumns, relations, views, relatedModels, relatedColumns, relatedRelations, }); return { manifest: mdlBuilder.build(), mdlBuilder }; } } ================================================ FILE: wren-ui/src/apollo/server/services/metadataService.ts ================================================ /** This class is responsible for handling the retrieval of metadata from the data source. For DuckDB, we control the access logic and directly query the WrenEngine. For PostgreSQL and BigQuery, we will use the Ibis server API. */ import { IIbisAdaptor } from '../adaptors/ibisAdaptor'; import { IWrenEngineAdaptor } from '../adaptors/wrenEngineAdaptor'; import { Project } from '../repositories'; import { DataSourceName } from '../types'; import { getLogger } from '@server/utils'; const logger = getLogger('MetadataService'); logger.level = 'debug'; export interface CompactColumn { name: string; type: string; notNull: boolean; description?: string; properties?: Record; nestedColumns?: CompactColumn[]; } export enum ConstraintType { PRIMARY_KEY = 'PRIMARY KEY', FOREIGN_KEY = 'FOREIGN KEY', UNIQUE = 'UNIQUE', } export interface CompactTable { name: string; columns: CompactColumn[]; description?: string; properties?: Record; primaryKey?: string; } export interface RecommendConstraint { constraintName: string; constraintType: ConstraintType; constraintTable: string; constraintColumn: string; constraintedTable: string; constraintedColumn: string; } export interface IDataSourceMetadataService { listTables(project: Project): Promise; listConstraints(project: Project): Promise; getVersion(project: Project): Promise; } export class DataSourceMetadataService implements IDataSourceMetadataService { private readonly ibisAdaptor: IIbisAdaptor; private readonly wrenEngineAdaptor: IWrenEngineAdaptor; constructor({ ibisAdaptor, wrenEngineAdaptor, }: { ibisAdaptor: IIbisAdaptor; wrenEngineAdaptor: IWrenEngineAdaptor; }) { this.ibisAdaptor = ibisAdaptor; this.wrenEngineAdaptor = wrenEngineAdaptor; } public async listTables(project): Promise { const { type: dataSource, connectionInfo } = project; if (dataSource === DataSourceName.DUCKDB) { const tables = await this.wrenEngineAdaptor.listTables(); return tables; } return await this.ibisAdaptor.getTables(dataSource, connectionInfo); } public async listConstraints( project: Project, ): Promise { const { type: dataSource, connectionInfo } = project; if (dataSource === DataSourceName.DUCKDB) { return []; } return await this.ibisAdaptor.getConstraints(dataSource, connectionInfo); } public async getVersion(project: Project): Promise { const { type: dataSource, connectionInfo } = project; return await this.ibisAdaptor.getVersion(dataSource, connectionInfo); } } ================================================ FILE: wren-ui/src/apollo/server/services/modelService.ts ================================================ import { SampleDatasetTable } from '@server/data'; import { IModelColumnRepository, IModelRepository, IRelationRepository, IViewRepository, Model, ModelColumn, Relation, } from '@server/repositories'; import { getLogger, safeParseJson, replaceAllowableSyntax, validateDisplayName, } from '@server/utils'; import { RelationData, UpdateRelationData } from '@server/types'; import { IProjectService } from './projectService'; import { CreateCalculatedFieldData, ExpressionName, UpdateCalculatedFieldData, CheckCalculatedFieldCanQueryData, } from '@server/models'; import { IMDLService } from './mdlService'; import { IWrenEngineAdaptor } from '../adaptors/wrenEngineAdaptor'; import { ValidationRules } from '@server/adaptors/ibisAdaptor'; import { isEmpty, capitalize } from 'lodash'; import {} from '@server/utils/regex'; import * as Errors from '@server/utils/error'; import { DataSourceName } from '@server/types'; import { IQueryService } from './queryService'; const logger = getLogger('ModelService'); logger.level = 'debug'; export interface ValidateCalculatedFieldResponse { valid: boolean; message?: string; } export interface IModelService { updatePrimaryKeys(tables: SampleDatasetTable[]): Promise; batchUpdateModelProperties(tables: SampleDatasetTable[]): Promise; batchUpdateColumnProperties(tables: SampleDatasetTable[]): Promise; // saveRelations was used in the onboarding process, we assume there is not existing relation in the project saveRelations(relations: RelationData[]): Promise; createRelation(relation: RelationData): Promise; updateRelation(relation: UpdateRelationData, id: number): Promise; deleteRelation(id: number): Promise; createCalculatedField(data: CreateCalculatedFieldData): Promise; updateCalculatedField( data: UpdateCalculatedFieldData, id: number, ): Promise; generateReferenceName(data: any): string; validateCalculatedFieldNaming( name: string, modelId: number, columnId?: number, ): Promise; deleteAllViewsByProjectId(projectId: number): Promise; deleteAllModelsByProjectId(projectId: number): Promise; } export interface GenerateReferenceNameData { displayName: string; sourceTableName: string; existedReferenceNames: string[]; } export class ModelService implements IModelService { private projectService: IProjectService; private modelRepository: IModelRepository; private modelColumnRepository: IModelColumnRepository; private relationRepository: IRelationRepository; private viewRepository: IViewRepository; private mdlService: IMDLService; private wrenEngineAdaptor: IWrenEngineAdaptor; private queryService: IQueryService; constructor({ projectService, modelRepository, modelColumnRepository, relationRepository, viewRepository, mdlService, wrenEngineAdaptor, queryService, }: { projectService: IProjectService; modelRepository: IModelRepository; modelColumnRepository: IModelColumnRepository; relationRepository: IRelationRepository; viewRepository: IViewRepository; mdlService: IMDLService; wrenEngineAdaptor: IWrenEngineAdaptor; queryService: IQueryService; }) { this.projectService = projectService; this.modelRepository = modelRepository; this.modelColumnRepository = modelColumnRepository; this.relationRepository = relationRepository; this.viewRepository = viewRepository; this.mdlService = mdlService; this.wrenEngineAdaptor = wrenEngineAdaptor; this.queryService = queryService; } public async createCalculatedField( data: CreateCalculatedFieldData, ): Promise { const { modelId, name: displayName, expression, lineage } = data; const logTitle = `Create Calculated Field ${displayName}`; const model = await this.modelRepository.findOneBy({ id: modelId, }); if (!model) { throw new Error('Model not found'); } const { valid, message } = await this.validateCalculatedFieldNaming( displayName, modelId, ); logger.debug( `${logTitle} : validateCalculatedFieldNaming: ${valid}, ${message}`, ); if (!valid) { throw new Error(message); } // generate referenceName const referenceName = this.generateReferenceNameFromDisplayName(displayName); logger.debug(`${logTitle} : generated referenceName: "${referenceName}"`); // check this calculated field is valid for engine to query const { valid: canQuery, message: errorMessage } = await this.checkCalculatedFieldCanQuery(modelId, model.referenceName, { referenceName, expression, lineage, } as CheckCalculatedFieldCanQueryData); logger.debug(`${logTitle} : checkCalculatedFieldCanQuery: ${canQuery}`); if (!canQuery) { const parsedErrorMessage = safeParseJson(errorMessage); throw Errors.create(Errors.GeneralErrorCodes.INVALID_CALCULATED_FIELD, { customMessage: parsedErrorMessage?.message || errorMessage, originalError: parsedErrorMessage || null, }); } const inputFieldId = lineage[lineage.length - 1]; const dataType = await this.inferCalculatedFieldDataType( expression, inputFieldId, ); logger.debug(`${logTitle} : inferCalculatedFieldDataType: ${dataType}`); // create calculated field const column = await this.modelColumnRepository.createOne({ modelId, displayName: displayName, sourceColumnName: referenceName, referenceName, type: dataType, isCalculated: true, isPk: false, notNull: false, aggregation: expression, lineage: JSON.stringify(lineage), properties: JSON.stringify({ description: '' }), }); return column; } public async updateCalculatedField( data: UpdateCalculatedFieldData, id: number, ): Promise { const { name: displayName, expression, lineage } = data; const logTitle = `Update Calculated Field ${id}`; const column = await this.modelColumnRepository.findOneBy({ id }); if (!column) { throw new Error('Column not found'); } const model = await this.modelRepository.findOneBy({ id: column.modelId, }); const { valid, message } = await this.validateCalculatedFieldNaming( displayName, column.modelId, id, ); logger.debug( `${logTitle}: validateCalculatedFieldNaming: ${valid}, ${message}`, ); if (!valid) { throw new Error(message); } const referenceName = this.generateReferenceNameFromDisplayName(displayName); logger.debug(`${logTitle}: generated referenceName: "${referenceName}"`); // check this calculated field is valid for engine to query const { valid: canQuery, message: errorMessage } = await this.checkCalculatedFieldCanQuery(model.id, model.referenceName, { referenceName, expression, lineage, } as CheckCalculatedFieldCanQueryData); logger.debug(`${logTitle}: checkCalculatedFieldCanQuery: ${canQuery}`); if (!canQuery) { const error = JSON.parse(errorMessage); throw Errors.create(Errors.GeneralErrorCodes.INVALID_CALCULATED_FIELD, { customMessage: error?.message, originalError: error, }); } const inputFieldId = lineage[lineage.length - 1]; const dataType = await this.inferCalculatedFieldDataType( expression, inputFieldId, ); logger.debug(`${logTitle}: inferCalculatedFieldDataType: ${dataType}`); const updatedColumn = await this.modelColumnRepository.updateOne(id, { displayName: displayName, sourceColumnName: referenceName, referenceName, type: dataType, aggregation: expression, lineage: JSON.stringify(lineage), }); return updatedColumn; } public async updatePrimaryKeys(tables: SampleDatasetTable[]) { logger.debug('start update primary keys'); const { id } = await this.projectService.getCurrentProject(); const models = await this.modelRepository.findAllBy({ projectId: id, }); const tableToUpdate = tables.filter((t) => t.primaryKey); for (const table of tableToUpdate) { const model = models.find((m) => m.sourceTableName === table.tableName); if (!model) { logger.debug(`Model not found, table name: ${table.tableName}`); } await this.modelColumnRepository.setModelPrimaryKey( model.id, table.primaryKey, ); } } public async batchUpdateModelProperties(tables: SampleDatasetTable[]) { logger.debug('start batch update model description'); const { id } = await this.projectService.getCurrentProject(); const models = await this.modelRepository.findAllBy({ projectId: id, }); await Promise.all([ tables.map(async (table) => { const model = models.find((m) => m.sourceTableName === table.tableName); if (!model) { logger.debug(`Model not found, table name: ${table.tableName}`); return; } const properties = model.properties ? { ...JSON.parse(model.properties), ...table.properties } : { ...table.properties }; await this.modelRepository.updateOne(model.id, { displayName: table.properties?.displayName || model.displayName, properties: JSON.stringify(properties), }); }), ]); } public async batchUpdateColumnProperties(tables: SampleDatasetTable[]) { logger.debug('start batch update column description'); const { id } = await this.projectService.getCurrentProject(); const models = await this.modelRepository.findAllBy({ projectId: id, }); const sourceColumns = (await this.modelColumnRepository.findColumnsByModelIds( models.map((m) => m.id), )) as ModelColumn[]; const transformedColumns = tables.reduce((acc, table) => { const columns = table.columns?.map((column) => { return { ...column, tableName: table.tableName }; }); if (columns) { acc.push(...columns); } return acc; }, []); await Promise.all([ transformedColumns.map(async (column) => { if (!column.properties) { return; } const model = models.find( (m) => m.sourceTableName === column.tableName, ); const sourceColumn = sourceColumns.find( (sourceColumn) => sourceColumn.modelId === model.id && sourceColumn.sourceColumnName === column.name, ); if (!sourceColumn) { logger.debug( `Column not found, table name: ${column.tableName}, column name: ${column.name}`, ); return; } const properties = sourceColumn.properties ? { ...JSON.parse(sourceColumn.properties), ...column.properties, } : { description: column.description }; await this.modelColumnRepository.updateOne(sourceColumn.id, { properties: JSON.stringify(properties), }); }), ]); } public generateReferenceName(data: GenerateReferenceNameData): string { const { sourceTableName, existedReferenceNames } = data; if (!existedReferenceNames.includes(sourceTableName)) { return sourceTableName; } return `${sourceTableName}_${existedReferenceNames.length + 1}`; } public async saveRelations(relations: RelationData[]) { if (isEmpty(relations)) { return []; } const { id } = await this.projectService.getCurrentProject(); const models = await this.modelRepository.findAllBy({ projectId: id, }); const columnIds = relations .map(({ fromColumnId, toColumnId }) => [fromColumnId, toColumnId]) .flat(); const columns = await this.modelColumnRepository.findColumnsByIds(columnIds); const relationValues = relations.map((relation) => { const fromColumn = columns.find( (column) => column.id === relation.fromColumnId, ); if (!fromColumn) { throw new Error(`Column not found, column Id ${relation.fromColumnId}`); } const toColumn = columns.find( (column) => column.id === relation.toColumnId, ); if (!toColumn) { throw new Error(`Column not found, column Id ${relation.toColumnId}`); } const relationName = this.generateRelationName(relation, models, columns); return { projectId: id, name: relationName, fromColumnId: relation.fromColumnId, toColumnId: relation.toColumnId, joinType: relation.type, properties: relation.description ? JSON.stringify({ description: relation.description }) : null, } as Partial; }); const savedRelations = await this.relationRepository.createMany(relationValues); return savedRelations; } public async createRelation(relation: RelationData): Promise { const { id } = await this.projectService.getCurrentProject(); const modelIds = [relation.fromModelId, relation.toModelId]; const models = await this.modelRepository.findAllByIds(modelIds); const columnIds = [relation.fromColumnId, relation.toColumnId]; const columns = await this.modelColumnRepository.findColumnsByIds(columnIds); const { valid, message } = await this.validateCreateRelation( models, columns, relation, ); if (!valid) { throw new Error(message); } const relationName = this.generateRelationName(relation, models, columns); const savedRelation = await this.relationRepository.createOne({ projectId: id, name: relationName, fromColumnId: relation.fromColumnId, toColumnId: relation.toColumnId, joinType: relation.type, }); return savedRelation; } public async updateRelation( relation: UpdateRelationData, id: number, ): Promise { const updatedRelation = await this.relationRepository.updateOne(id, { joinType: relation.type, }); return updatedRelation; } public async deleteRelation(id: number): Promise { const relation = await this.relationRepository.findOneBy({ id }); if (!relation) { throw new Error('Relation not found'); } const calculatedFields = await this.getCalculatedFieldByRelation(id); if (calculatedFields.length > 0) { // delete related calculated fields await this.modelColumnRepository.deleteMany( calculatedFields.map((f) => f.id), ); } await this.relationRepository.deleteOne(id); } public async getCalculatedFieldByRelation( relationId: number, ): Promise { const calculatedFields = await this.modelColumnRepository.findAllBy({ isCalculated: true, }); const relatedCalculatedFields = calculatedFields.reduce((acc, field) => { const lineage = JSON.parse(field.lineage); const relationIds = lineage.slice(0, lineage.length - 1); if (relationIds.includes(relationId)) { acc.push(field); } return acc; }, []); return relatedCalculatedFields; } public async validateCalculatedFieldNaming( displayName: string, modelId: number, columnId?: number, ): Promise { // only allow uppercase/lowercase english, numbers, syntaxes in the first raw of keyboard, {}, [], ', ", ,, . const validationRes = validateDisplayName(displayName); if (!validationRes.valid) { return { valid: false, message: validationRes.message || 'Invalid Calculated field name', }; } // can not duplicated with existed column const referenceName = this.generateReferenceNameFromDisplayName(displayName); let existedColumns = await this.modelColumnRepository.findColumnsByModelIds( [modelId], ); if (columnId) { existedColumns = existedColumns.filter( (column) => column.id !== columnId, ); } if ( existedColumns.find((column) => column.referenceName === referenceName) ) { return { valid: false, message: `The generated calculated field name "${referenceName}" is duplicated with existed column, please change the name and try again`, }; } return { valid: true }; } public async deleteAllViewsByProjectId(projectId: number): Promise { // delete all views await this.viewRepository.deleteAllBy({ projectId }); } public async deleteAllModelsByProjectId(projectId: number): Promise { // delete all relations await this.relationRepository.deleteAllBy({ projectId }); // delete all models await this.modelRepository.deleteAllBy({ projectId }); } private generateReferenceNameFromDisplayName(displayName: string) { // replace all syntaxes that [in the first raw of keyboard, {}, [], ', ", ,, . ] with _ return replaceAllowableSyntax(displayName); } private generateRelationName( relation: RelationData, models: Model[], columns: ModelColumn[], ) { const fromModel = models.find((m) => m.id === relation.fromModelId); const toModel = models.find((m) => m.id === relation.toModelId); if (!fromModel || !toModel) { throw new Error('Model not found'); } const fromColumn = columns.find( (column) => column.id === relation.fromColumnId, ); const toColumn = columns.find( (column) => column.id === relation.toColumnId, ); return ( capitalize(fromModel.sourceTableName) + capitalize(fromColumn.referenceName) + capitalize(toModel.sourceTableName) + capitalize(toColumn.referenceName) ); } /** We currently support expression below, right side is the return type of the calculated field. Aggregations - **avg(***x***)** → double - **count(***x***)** → bigint - **max(***x***)** → [same as input] - **min(***x***)** → [same as input] - **sum(***x***)** → [same as input] Math functions - **abs(***x***)** → [same as input] - **cbrt(***x***)** → double - **ceil(***x***)** → [same as input] - **exp(***x***)** → double - **floor(***x***)** → [same as input] - **ln(***x***)** → double - **log10(***x***)** → double - **round(***x***)** → [same as input] - **sign(***x***)** → [same as input] String functions - **length(***string***)** → bigint - **reverse(**string**)** → varbinary */ private async inferCalculatedFieldDataType( expression: ExpressionName, inputFieldId: number, ) { let type = null; switch (expression) { case ExpressionName.CEIL: case ExpressionName.FLOOR: case ExpressionName.ROUND: case ExpressionName.SIGN: case ExpressionName.SUM: case ExpressionName.MAX: case ExpressionName.MIN: case ExpressionName.ABS: type = await this.getFieldDataType(inputFieldId); break; case ExpressionName.CBRT: case ExpressionName.EXP: case ExpressionName.AVG: case ExpressionName.LN: case ExpressionName.LOG10: type = 'DOUBLE'; break; case ExpressionName.COUNT: case ExpressionName.LENGTH: type = 'BIGINT'; break; case ExpressionName.REVERSE: type = 'VARBINARY'; break; default: throw new Error('Unsupported expression'); } return type; } private async getFieldDataType(fieldId: number): Promise { const field = await this.modelColumnRepository.findOneBy({ id: fieldId }); if (!field) { throw new Error('Field not found'); } return field.type; } private async checkCalculatedFieldCanQuery( modelId: number, modelName: string, data: CheckCalculatedFieldCanQueryData, ) { const project = await this.projectService.getCurrentProject(); const { mdlBuilder } = await this.mdlService.makeCurrentModelMDL(); const { referenceName, expression, lineage } = data; const inputFieldId = lineage[lineage.length - 1]; const dataType = await this.inferCalculatedFieldDataType( expression, inputFieldId, ); // add temporary calculated field const modelColumn = { id: 99999999, modelId, displayName: referenceName, sourceColumnName: referenceName, referenceName: referenceName, type: dataType, isCalculated: true, isPk: false, notNull: false, aggregation: expression, lineage: JSON.stringify(lineage), properties: JSON.stringify({ description: '' }), } as ModelColumn; mdlBuilder.insertCalculatedField(modelName, modelColumn); const manifest = mdlBuilder.getManifest(); // find the calculated field in manifest const calculatedField = manifest.models .find((m) => m.name === modelName) ?.columns.find((c) => c.name === referenceName); logger.debug(`Calculated field MDL: ${JSON.stringify(calculatedField)}`); // validate calculated field can query const dataSource = project.type; if (dataSource === DataSourceName.DUCKDB) { return await this.wrenEngineAdaptor.validateColumnIsValid( manifest, modelName, referenceName, ); } else { const parameters = { modelName, columnName: referenceName }; return await this.queryService.validate( project, ValidationRules.COLUMN_IS_VALID, manifest, parameters, ); } } private async validateCreateRelation( models: Model[], columns: ModelColumn[], relation: RelationData, ) { const { fromModelId, fromColumnId, toModelId, toColumnId } = relation; const fromModel = models.find((m) => m.id === fromModelId); const toModel = models.find((m) => m.id === toModelId); // model should exist if (!fromModel) { return { valid: false, message: `Model not found: fromModelId ${fromModelId}`, }; } if (!toModel) { return { valid: false, message: `Model not found: toModelId ${toModelId}`, }; } // column should exist const fromColumn = columns.find((column) => column.id === fromColumnId); const toColumn = columns.find((column) => column.id === toColumnId); if (!fromColumn) { return { valid: false, message: `Column not found, column Id ${fromColumnId}`, }; } if (!toColumn) { return { valid: false, message: `Column not found, column Id ${toColumnId}`, }; } // column should belong to the model if (toColumn.modelId != toModelId) { return { valid: false, message: `Column not belong to the model, column Id ${toColumnId}`, }; } if (fromColumn.modelId != fromModelId) { return { valid: false, message: `Column not belong to the model, column Id ${fromColumnId}`, }; } const existedRelations = await this.relationRepository.findExistedRelationBetweenModels(relation); if (existedRelations.length > 0) { return { valid: false, message: 'This relationship already exists.', }; } return { valid: true }; } } ================================================ FILE: wren-ui/src/apollo/server/services/projectService.ts ================================================ import crypto from 'crypto'; import * as fs from 'fs'; import path from 'path'; import { getLogger } from '@server/utils'; import { IProjectRepository, WREN_AI_CONNECTION_INFO } from '../repositories'; import { Project } from '../repositories'; import { CompactTable, IDataSourceMetadataService, RecommendConstraint, } from './metadataService'; import { DataSourceName } from '../types'; import { RecommendationQuestion, RecommendationQuestionStatus, WrenAIError, WrenAILanguage, } from '@server/models/adaptor'; import { encryptConnectionInfo } from '../dataSource'; import { IWrenAIAdaptor } from '../adaptors'; import { RecommendQuestionResultStatus } from './askingService'; import { IMDLService } from './mdlService'; import { ProjectRecommendQuestionBackgroundTracker } from '../backgrounds'; import { ITelemetry } from '../telemetry/telemetry'; import { getConfig } from '../config'; const config = getConfig(); const logger = getLogger('ProjectService'); logger.level = 'debug'; const SENSITIVE_PROPERTY_NAME = new Set([ 'credentials', 'password', 'awsSecretKey', 'privateKey', 'accessToken', 'clientSecret', 'webIdentityToken', ]); export interface ProjectData { displayName: string; type: DataSourceName; connectionInfo: WREN_AI_CONNECTION_INFO; } export interface ProjectRecommendationQuestionsResult { status: RecommendQuestionResultStatus; questions: RecommendationQuestion[]; error: WrenAIError; } export interface IProjectService { createProject: (projectData: ProjectData) => Promise; updateProject: ( projectId: number, projectData: Partial, ) => Promise; getGeneralConnectionInfo: (project: Project) => Record; getProjectDataSourceTables: ( project?: Project, projectId?: number, ) => Promise; getProjectDataSourceVersion: ( project?: Project, projectId?: number, ) => Promise; getProjectSuggestedConstraint: ( project?: Project, projectId?: number, ) => Promise; getCurrentProject: () => Promise; getProjectById: (projectId: number) => Promise; writeCredentialFile: ( credentials: JSON, persistCredentialDir: string, ) => string; deleteProject: (projectId: number) => Promise; getProjectRecommendationQuestions: () => Promise; // recommend questions generateProjectRecommendationQuestions: () => Promise; } export class ProjectService implements IProjectService { private projectRepository: IProjectRepository; private metadataService: IDataSourceMetadataService; private mdlService: IMDLService; private wrenAIAdaptor: IWrenAIAdaptor; private projectRecommendQuestionBackgroundTracker: ProjectRecommendQuestionBackgroundTracker; constructor({ projectRepository, metadataService, mdlService, wrenAIAdaptor, telemetry, }: { projectRepository: IProjectRepository; metadataService: IDataSourceMetadataService; mdlService: IMDLService; wrenAIAdaptor: IWrenAIAdaptor; telemetry: ITelemetry; }) { this.projectRepository = projectRepository; this.metadataService = metadataService; this.mdlService = mdlService; this.wrenAIAdaptor = wrenAIAdaptor; this.projectRecommendQuestionBackgroundTracker = new ProjectRecommendQuestionBackgroundTracker({ projectRepository, telemetry, wrenAIAdaptor, }); } public async updateProject( projectId: number, projectData: Partial, ): Promise { return await this.projectRepository.updateOne(projectId, projectData); } public async getProjectDataSourceVersion( project?: Project, projectId?: number, ): Promise { const usedProject = project ? project : projectId ? await this.getProjectById(projectId) : await this.getCurrentProject(); return await this.metadataService.getVersion(usedProject); } public async generateProjectRecommendationQuestions(): Promise { const project = await this.getCurrentProject(); if (!project) { throw new Error(`Project not found`); } const { manifest } = await this.mdlService.makeCurrentModelMDL(); const recommendQuestionResult = await this.wrenAIAdaptor.generateRecommendationQuestions({ manifest, ...this.getProjectRecommendationQuestionsConfig(project), }); const updatedProject = await this.projectRepository.updateOne(project.id, { queryId: recommendQuestionResult.queryId, questionsStatus: RecommendationQuestionStatus.GENERATING, questions: [], questionsError: null, }); if ( !this.projectRecommendQuestionBackgroundTracker.isExist(updatedProject) ) { this.projectRecommendQuestionBackgroundTracker.addTask(updatedProject); } else { logger.debug( `Generate Project Recommendation Questions Task ${updatedProject.id} already exists, skip adding`, ); } } public async getProjectRecommendationQuestions() { const project = await this.projectRepository.getCurrentProject(); if (!project) { throw new Error(`Project not found`); } const result: ProjectRecommendationQuestionsResult = { status: RecommendQuestionResultStatus.NOT_STARTED, questions: [], error: null, }; if (project.queryId) { result.status = project.questionsStatus ? RecommendQuestionResultStatus[project.questionsStatus] : result.status; result.questions = project.questions || []; result.error = project.questionsError as WrenAIError; } return result; } public async getCurrentProject() { return await this.projectRepository.getCurrentProject(); } public async getProjectById(projectId: number) { return await this.projectRepository.findOneBy({ id: projectId }); } public async getProjectDataSourceTables( project?: Project, projectId?: number, ) { const usedProject = project ? project : projectId ? await this.getProjectById(projectId) : await this.getCurrentProject(); return await this.metadataService.listTables(usedProject); } public async getProjectSuggestedConstraint( project?: Project, projectId?: number, ) { const usedProject = project ? project : projectId ? await this.getProjectById(projectId) : await this.getCurrentProject(); return await this.metadataService.listConstraints(usedProject); } public async createProject(projectData: ProjectData) { const projectValue = { displayName: projectData.displayName, type: projectData.type, catalog: 'wrenai', schema: 'public', connectionInfo: encryptConnectionInfo( projectData.type, projectData.connectionInfo, ), }; logger.debug('Creating project...'); const project = await this.projectRepository.createOne(projectValue); return project; } public writeCredentialFile(credentials: JSON, persistCredentialDir: string) { // create persist_credential_dir if not exists if (!fs.existsSync(persistCredentialDir)) { fs.mkdirSync(persistCredentialDir, { recursive: true }); } // file name will be the hash of the credentials, file path is current working directory // convert credentials from base64 to string and replace all the matched "\n" with "\\n", there are many \n in the "private_key" property const credentialString = JSON.stringify(credentials); const fileName = crypto .createHash('md5') .update(credentialString) .digest('hex'); const filePath = path.join(persistCredentialDir, `${fileName}.json`); // check if file exists if (fs.existsSync(filePath)) { logger.debug(`File ${filePath} already exists`); return filePath; } fs.writeFileSync(filePath, credentialString); logger.debug(`Wrote credentials to file`); return filePath; } public async deleteProject(projectId: number): Promise { await this.projectRepository.deleteOne(projectId); } public getGeneralConnectionInfo(project) { return Object.entries(project.connectionInfo).reduce( (acc, [key, value]) => { if (!SENSITIVE_PROPERTY_NAME.has(key)) { acc[key] = value; } return acc; }, {}, ); } private getProjectRecommendationQuestionsConfig(project: Project) { return { maxCategories: config.projectRecommendationQuestionMaxCategories, maxQuestions: config.projectRecommendationQuestionsMaxQuestions, regenerate: true, configuration: { language: WrenAILanguage[project.language] || WrenAILanguage.EN, }, }; } } ================================================ FILE: wren-ui/src/apollo/server/services/queryService.ts ================================================ import { DataSourceName } from '@server/types'; import { Manifest } from '@server/mdl/type'; import { IWrenEngineAdaptor } from '../adaptors/wrenEngineAdaptor'; import { SupportedDataSource, IIbisAdaptor, IbisQueryResponse, ValidationRules, IbisResponse, } from '../adaptors/ibisAdaptor'; import { getLogger } from '@server/utils'; import { Project } from '../repositories'; import { PostHogTelemetry, TelemetryEvent } from '../telemetry/telemetry'; const logger = getLogger('QueryService'); logger.level = 'debug'; export const DEFAULT_PREVIEW_LIMIT = 500; export interface ColumnMetadata { name: string; type: string; } export interface PreviewDataResponse extends IbisResponse { columns: ColumnMetadata[]; data: any[][]; cacheHit?: boolean; cacheCreatedAt?: string; cacheOverrodeAt?: string; override?: boolean; } export interface DescribeStatementResponse { columns: ColumnMetadata[]; } export interface PreviewOptions { project: Project; modelingOnly?: boolean; // if not given, will use the deployed manifest manifest: Manifest; limit?: number; dryRun?: boolean; refresh?: boolean; cacheEnabled?: boolean; } export interface SqlValidateOptions { project: Project; mdl: Manifest; modelingOnly?: boolean; } export interface ValidateResponse { valid: boolean; message?: string; } export interface IQueryService { preview( sql: string, options: PreviewOptions, ): Promise; describeStatement( sql: string, options: PreviewOptions, ): Promise; validate( project: Project, rule: ValidationRules, manifest: Manifest, parameters: Record, ): Promise; } export class QueryService implements IQueryService { private readonly ibisAdaptor: IIbisAdaptor; private readonly wrenEngineAdaptor: IWrenEngineAdaptor; private readonly telemetry: PostHogTelemetry; constructor({ ibisAdaptor, wrenEngineAdaptor, telemetry, }: { ibisAdaptor: IIbisAdaptor; wrenEngineAdaptor: IWrenEngineAdaptor; telemetry: PostHogTelemetry; }) { this.ibisAdaptor = ibisAdaptor; this.wrenEngineAdaptor = wrenEngineAdaptor; this.telemetry = telemetry; } public async preview( sql: string, options: PreviewOptions, ): Promise { const { project, manifest: mdl, limit, dryRun, refresh, cacheEnabled, } = options; const { type: dataSource, connectionInfo } = project; if (this.useEngine(dataSource)) { if (dryRun) { logger.debug('Using wren engine to dry run'); await this.wrenEngineAdaptor.dryRun(sql, { manifest: mdl, limit, }); return true; } else { logger.debug('Using wren engine to preview'); const data = await this.wrenEngineAdaptor.previewData(sql, mdl, limit); return data as PreviewDataResponse; } } else { this.checkDataSourceIsSupported(dataSource); logger.debug('Use ibis adaptor to preview'); if (dryRun) { return await this.ibisDryRun(sql, dataSource, connectionInfo, mdl); } else { return await this.ibisQuery( sql, dataSource, connectionInfo, mdl, limit, refresh, cacheEnabled, ); } } } public async describeStatement( sql: string, options: PreviewOptions, ): Promise { try { // preview data with limit 1 to get column metadata options.limit = 1; const res = (await this.preview(sql, options)) as PreviewDataResponse; return { columns: res.columns }; } catch (err: any) { logger.debug(`Got error when describing statement: ${err.message}`); throw err; } } public async validate( project, rule: ValidationRules, manifest: Manifest, parameters: Record, ): Promise { const { type: dataSource, connectionInfo } = project; const res = await this.ibisAdaptor.validate( dataSource, rule, connectionInfo, manifest, parameters, ); return res; } private useEngine(dataSource: DataSourceName): boolean { if (dataSource === DataSourceName.DUCKDB) { return true; } else { return false; } } private checkDataSourceIsSupported(dataSource: DataSourceName) { if ( !Object.prototype.hasOwnProperty.call(SupportedDataSource, dataSource) ) { throw new Error(`Unsupported datasource for ibis: "${dataSource}"`); } } private async ibisDryRun( sql: string, dataSource: DataSourceName, connectionInfo: any, mdl: Manifest, ): Promise { const event = TelemetryEvent.IBIS_DRY_RUN; try { const res = await this.ibisAdaptor.dryRun(sql, { dataSource, connectionInfo, mdl, }); this.sendIbisEvent(event, res, { dataSource, sql }); return { correlationId: res.correlationId, }; } catch (err: any) { this.sendIbisFailedEvent(event, err, { dataSource, sql }); throw err; } } private async ibisQuery( sql: string, dataSource: DataSourceName, connectionInfo: any, mdl: Manifest, limit: number, refresh?: boolean, cacheEnabled?: boolean, ): Promise { const event = TelemetryEvent.IBIS_QUERY; try { const res = await this.ibisAdaptor.query(sql, { dataSource, connectionInfo, mdl, limit, refresh, cacheEnabled, }); this.sendIbisEvent(event, res, { dataSource, sql }); const data = this.transformDataType(res); return { correlationId: res.correlationId, cacheHit: res.cacheHit, cacheCreatedAt: res.cacheCreatedAt, cacheOverrodeAt: res.cacheOverrodeAt, override: res.override, ...data, }; } catch (err: any) { this.sendIbisFailedEvent(event, err, { dataSource, sql }); throw err; } } private transformDataType(data: IbisQueryResponse): PreviewDataResponse { const columns = data.columns; const dtypes = data.dtypes; const transformedColumns = columns.map((column) => { let type = 'unknown'; if (dtypes && dtypes[column]) { type = dtypes[column] === 'object' ? 'string' : dtypes[column]; } if (type === 'unknown') { logger.debug(`Did not find type mapping for "${column}"`); logger.debug( `dtypes mapping: ${dtypes ? JSON.stringify(dtypes, null, 2) : 'undefined'} `, ); } return { name: column, type, } as ColumnMetadata; }); return { columns: transformedColumns, data: data.data, } as PreviewDataResponse; } private sendIbisEvent( event: TelemetryEvent, res: IbisResponse, others: Record, ) { this.telemetry.sendEvent(event, { correlationId: res.correlationId, processTime: res.processTime, ...others, }); } private sendIbisFailedEvent( event: TelemetryEvent, err: any, others: Record, ) { this.telemetry.sendEvent( event, { correlationId: err.extensions?.other?.correlationId, processTime: err.extensions?.other?.processTime, error: err.message, ...others, }, err.extensions?.service, false, ); } } ================================================ FILE: wren-ui/src/apollo/server/services/sqlPairService.ts ================================================ import { SqlPair } from '@server/repositories'; import { IWrenAIAdaptor } from '@server/adaptors/wrenAIAdaptor'; import { ISqlPairRepository } from '@server/repositories/sqlPairRepository'; import { getLogger } from '@server/utils'; import { chunk } from 'lodash'; import * as Errors from '@server/utils/error'; import { Project } from '../repositories'; import { IIbisAdaptor } from '../adaptors/ibisAdaptor'; import { DialectSQL, WrenSQL, WrenAILanguage, SqlPairResult, SqlPairStatus, QuestionsResult, QuestionsStatus, } from '../models/adaptor'; import { Manifest } from '@server/mdl/type'; import { DataSourceName } from '@server/types'; const logger = getLogger('SqlPairService'); export interface CreateSqlPair { sql: string; question: string; } export interface EditSqlPair { sql?: string; question?: string; } export interface ModelSubstituteOptions { project: Project; // if not given, will use the deployed manifest manifest: Manifest; } export interface ISqlPairService { getProjectSqlPairs(projectId: number): Promise; createSqlPair(projectId: number, sqlPair: CreateSqlPair): Promise; createSqlPairs( projectId: number, sqlPairs: CreateSqlPair[], ): Promise; editSqlPair( projectId: number, sqlPairId: number, sqlPair: EditSqlPair, ): Promise; deleteSqlPair(projectId: number, sqlPairId: number): Promise; generateQuestions(project: Project, sqls: string[]): Promise; modelSubstitute( sql: DialectSQL, options: ModelSubstituteOptions, ): Promise; } export class SqlPairService implements ISqlPairService { private sqlPairRepository: ISqlPairRepository; private wrenAIAdaptor: IWrenAIAdaptor; private ibisAdaptor: IIbisAdaptor; constructor({ sqlPairRepository, wrenAIAdaptor, ibisAdaptor, }: { sqlPairRepository: ISqlPairRepository; wrenAIAdaptor: IWrenAIAdaptor; ibisAdaptor: IIbisAdaptor; }) { this.sqlPairRepository = sqlPairRepository; this.wrenAIAdaptor = wrenAIAdaptor; this.ibisAdaptor = ibisAdaptor; } public async modelSubstitute( sql: DialectSQL, options: ModelSubstituteOptions, ): Promise { const { manifest: mdl, project } = options; const { type: dataSource, connectionInfo } = project; if (dataSource === DataSourceName.DUCKDB) { // engine does not implement model substitute. throw Errors.create(Errors.GeneralErrorCodes.IBIS_SERVER_ERROR, { customMessage: 'DuckDB data source does not support model substitute.', }); } // use the first model's table reference as default catalog and schema const firstModel = mdl.models?.[0]; const catalog = firstModel?.tableReference?.catalog; const schema = firstModel?.tableReference?.schema; return await this.ibisAdaptor.modelSubstitute(sql, { dataSource, connectionInfo, mdl, catalog, schema, }); } public async generateQuestions( project: Project, sqls: string[], ): Promise { try { const configurations = { language: WrenAILanguage[project.language] || WrenAILanguage.EN, }; const { queryId } = await this.wrenAIAdaptor.generateQuestions({ projectId: project.id, configurations, sqls, }); const result = await this.waitQuestionGenerateResult(queryId); if (result.error) { throw Errors.create(Errors.GeneralErrorCodes.GENERATE_QUESTIONS_ERROR, { customMessage: result.error.message, }); } return result.questions; } catch (err) { throw Errors.create(Errors.GeneralErrorCodes.GENERATE_QUESTIONS_ERROR, { customMessage: err.message, }); } } public async getProjectSqlPairs(projectId: number): Promise { return this.sqlPairRepository.findAllBy({ projectId }); } public async createSqlPair( projectId: number, sqlPair: CreateSqlPair, ): Promise { const tx = await this.sqlPairRepository.transaction(); try { const newPair = await this.sqlPairRepository.createOne( { ...sqlPair, projectId, }, { tx }, ); const { queryId } = await this.wrenAIAdaptor.deploySqlPair( projectId, newPair, ); const deployResult = await this.waitUntilSqlPairResult(queryId); if (deployResult.error) { throw Errors.create(deployResult.error.code, { customMessage: deployResult.error.message, }); } await tx.commit(); return newPair; } catch (error) { await tx.rollback(); throw error; } } public async createSqlPairs( projectId: number, sqlPairs: CreateSqlPair[], ): Promise { const tx = await this.sqlPairRepository.transaction(); const newPairs = await this.sqlPairRepository.createMany( sqlPairs.map((pair) => ({ ...pair, projectId, })), { tx }, ); // batch parall process with size of 10 const successPairs = []; const errorPairs = []; const chunks = chunk(newPairs, 10); for (const pairs of chunks) { await Promise.allSettled( pairs.map(async (pair) => { const { queryId } = await this.wrenAIAdaptor.deploySqlPair( projectId, pair, ); const deployResult = await this.waitUntilSqlPairResult(queryId); if (deployResult.error) { errorPairs.push(deployResult.error); } successPairs.push(deployResult); }), ).then(async (_result) => { if (errorPairs.length > 0) { logger.debug( `deploy sql pair failed. ${errorPairs.map((pair) => pair.question).join(', ')}`, ); await tx.rollback(); await this.wrenAIAdaptor.deleteSqlPairs( projectId, successPairs.map((pair) => pair.id), ); throw Errors.create(Errors.GeneralErrorCodes.DEPLOY_SQL_PAIR_ERROR, { customMessage: errorPairs.map((pair) => pair.message).join(', '), }); } }); } await tx.commit(); return newPairs; } async editSqlPair( projectId: number, sqlPairId: number, sqlPair: EditSqlPair, ): Promise { // First verify the SQL pair exists and belongs to the project const existingPair = await this.sqlPairRepository.findOneBy({ id: sqlPairId, projectId, }); if (!existingPair) { throw new Error( `SQL pair with ID ${sqlPairId} not found in project ${projectId}`, ); } // Update only the provided fields const updatedData: Partial = { sql: existingPair.sql, question: existingPair.question, updatedAt: new Date().toISOString(), }; if (sqlPair.sql !== undefined) { updatedData.sql = sqlPair.sql; } if (sqlPair.question !== undefined) { updatedData.question = sqlPair.question; } const tx = await this.sqlPairRepository.transaction(); try { const updatedSqlPair = await this.sqlPairRepository.updateOne( sqlPairId, updatedData, { tx }, ); const { queryId } = await this.wrenAIAdaptor.deploySqlPair( projectId, updatedSqlPair, ); const deployResult = await this.waitUntilSqlPairResult(queryId); if (deployResult.error) { throw Errors.create(Errors.GeneralErrorCodes.DEPLOY_SQL_PAIR_ERROR, { customMessage: deployResult.error.message, }); } await tx.commit(); return updatedSqlPair; } catch (error) { logger.error(`edit sql pair failed. ${error}`); await tx.rollback(); throw Errors.create(Errors.GeneralErrorCodes.DEPLOY_SQL_PAIR_ERROR, { customMessage: error.message, }); } } async deleteSqlPair(projectId: number, sqlPairId: number): Promise { // First verify the SQL pair exists and belongs to the project const existingPair = await this.sqlPairRepository.findOneBy({ id: sqlPairId, projectId, }); if (!existingPair) { throw new Error( `SQL pair with ID ${sqlPairId} not found in project ${projectId}`, ); } const tx = await this.sqlPairRepository.transaction(); try { await this.sqlPairRepository.deleteOne(sqlPairId, { tx }); await this.wrenAIAdaptor.deleteSqlPairs(projectId, [sqlPairId]); await tx.commit(); return true; } catch (error) { logger.error(`delete sql pair failed. ${error}`); await tx.rollback(); throw Errors.create(Errors.GeneralErrorCodes.DEPLOY_SQL_PAIR_ERROR, { customMessage: error.message, }); } } private async waitUntilSqlPairResult( queryId: string, ): Promise { let result = await this.wrenAIAdaptor.getSqlPairResult(queryId); while (!this.isFinishedState(result.status)) { await new Promise((resolve) => setTimeout(resolve, 500)); result = await this.wrenAIAdaptor.getSqlPairResult(queryId); } return result; } private async waitQuestionGenerateResult( queryId: string, ): Promise> { let result = await this.wrenAIAdaptor.getQuestionsResult(queryId); while ( ![QuestionsStatus.SUCCEEDED, QuestionsStatus.FAILED].includes( result.status, ) ) { await new Promise((resolve) => setTimeout(resolve, 500)); result = await this.wrenAIAdaptor.getQuestionsResult(queryId); } return result; } private isFinishedState(status: SqlPairStatus) { return [SqlPairStatus.FINISHED, SqlPairStatus.FAILED].includes(status); } } ================================================ FILE: wren-ui/src/apollo/server/services/tests/askingService.test.ts ================================================ import { constructCteSql } from '../askingService'; describe('AskingService', () => { describe('utility: constructCteSql', () => { test('oneline sql', () => { const sql = 'SELECT * FROM test'; const steps = [{ sql, summary: 'test', cteName: '' }]; const result = constructCteSql(steps); expect(result).toBe(`-- test\nSELECT * FROM test`); }); test('2 steps of sql', () => { const steps = [ { sql: 'SELECT * FROM test', summary: 'test1 summary', cteName: 'test1', }, { sql: 'SELECT * FROM test2', summary: 'test2', cteName: '' }, ]; const result = constructCteSql(steps); expect(result).toBe( `WITH test1 AS\n-- test1 summary\n(SELECT * FROM test)\n-- test2\nSELECT * FROM test2`, ); }); test('3 steps of sql', () => { const steps = [ { sql: 'SELECT * FROM test', summary: 'test1 summary', cteName: 'test1', }, { sql: 'SELECT * FROM test2', summary: 'test2 summary', cteName: 'test2', }, { sql: 'SELECT * FROM test3', summary: 'test3', cteName: '' }, ]; const result = constructCteSql(steps); expect(result).toBe( `WITH test1 AS\n-- test1 summary\n(SELECT * FROM test),` + `test2 AS\n-- test2 summary\n(SELECT * FROM test2)\n-- test3\nSELECT * FROM test3`, ); }); test('2 steps of sql with stepIndex=0', () => { const steps = [ { sql: 'SELECT * FROM test', summary: 'test1 summary', cteName: 'test1', }, { sql: 'SELECT * FROM test2', summary: 'test2', cteName: '' }, ]; const result = constructCteSql(steps, 0); expect(result).toBe(`-- test1 summary\nSELECT * FROM test`); }); test('2 steps of sql with stepIndex=1', () => { const steps = [ { sql: 'SELECT * FROM test', summary: 'test1 summary', cteName: 'test1', }, { sql: 'SELECT * FROM test2', summary: 'test2', cteName: '' }, ]; const result = constructCteSql(steps, 1); expect(result).toBe( `WITH test1 AS\n-- test1 summary\n(SELECT * FROM test)\n-- test2\nSELECT * FROM test2`, ); }); test('3 steps of sql with stepIndex=1', () => { const steps = [ { sql: 'SELECT * FROM test', summary: 'test1 summary', cteName: 'test1', }, { sql: 'SELECT * FROM test2', summary: 'test2 summary', cteName: 'test2', }, { sql: 'SELECT * FROM test3', summary: 'test3', cteName: '' }, ]; const result = constructCteSql(steps, 1); expect(result).toBe( `WITH test1 AS\n-- test1 summary\n(SELECT * FROM test)` + `\n-- test2 summary\nSELECT * FROM test2`, ); }); }); }); ================================================ FILE: wren-ui/src/apollo/server/services/tests/dashboardService.test.ts ================================================ import { DashboardService } from '../dashboardService'; import { ScheduleFrequencyEnum } from '@server/models/dashboard'; import { CacheScheduleDayEnum } from '@server/models/dashboard'; import { SetDashboardCacheData, DashboardSchedule, } from '@server/models/dashboard'; // Create a test class that extends DashboardService to access protected methods class TestDashboardService extends DashboardService { public testGenerateCronExpression( schedule: DashboardSchedule, ): string | null { return this.generateCronExpression(schedule); } public testCalculateNextRunTime(cronExpression: string): Date | null { return this.calculateNextRunTime(cronExpression); } public testToUTC(schedule: DashboardSchedule): DashboardSchedule { return this.toUTC(schedule); } public testToTimezone(schedule: DashboardSchedule): DashboardSchedule { return this.toTimezone(schedule); } public testValidateScheduleInput(data: SetDashboardCacheData): void { return this.validateScheduleInput(data); } } describe('DashboardService', () => { let dashboardService: TestDashboardService; let mockProjectService; let mockDashboardItemRepository; let mockDashboardRepository; const createScheduleData = ( frequency: ScheduleFrequencyEnum, options: { hour?: number; minute?: number; day?: CacheScheduleDayEnum; timezone?: string; cron?: string; cacheEnabled?: boolean; } = {}, ): SetDashboardCacheData => { return { cacheEnabled: options.cacheEnabled ?? true, schedule: { frequency, hour: options.hour ?? 0, minute: options.minute ?? 0, day: options.day ?? CacheScheduleDayEnum.MON, timezone: options.timezone ?? '', cron: options.cron ?? '', }, }; }; beforeEach(() => { mockProjectService = { getCurrentProject: jest.fn(), }; mockDashboardItemRepository = { findOneBy: jest.fn(), findAllBy: jest.fn(), createOne: jest.fn(), updateOne: jest.fn(), deleteOne: jest.fn(), }; mockDashboardRepository = { findOneBy: jest.fn(), createOne: jest.fn(), updateOne: jest.fn(), }; dashboardService = new TestDashboardService({ projectService: mockProjectService, dashboardItemRepository: mockDashboardItemRepository, dashboardRepository: mockDashboardRepository, }); }); describe('generateCronExpression', () => { it('should generate correct cron expression for daily schedule', () => { const schedule = { frequency: ScheduleFrequencyEnum.DAILY, hour: 14, minute: 30, timezone: '', day: null, cron: null, }; const result = dashboardService.testGenerateCronExpression(schedule); expect(result).toBe('30 14 * * *'); }); it('should generate correct cron expression for weekly schedule', () => { const schedule = { frequency: ScheduleFrequencyEnum.WEEKLY, day: CacheScheduleDayEnum.MON, hour: 9, minute: 0, timezone: '', cron: null, }; const result = dashboardService.testGenerateCronExpression(schedule); expect(result).toBe('0 9 * * MON'); }); it('should return custom cron expression for custom schedule', () => { const schedule = { frequency: ScheduleFrequencyEnum.CUSTOM, cron: '0 0 * * *', timezone: '', day: null, hour: 0, minute: 0, }; const result = dashboardService.testGenerateCronExpression(schedule); expect(result).toBe('0 0 * * *'); }); it('should return null for never schedule', () => { const schedule = { frequency: ScheduleFrequencyEnum.NEVER, timezone: '', day: null, hour: 0, minute: 0, cron: null, }; const result = dashboardService.testGenerateCronExpression(schedule); expect(result).toBeNull(); }); }); describe('calculateNextRunTime', () => { it('should return null for invalid cron expression', () => { const result = dashboardService.testCalculateNextRunTime('invalid-cron'); expect(result).toBeNull(); }); it('should calculate next run time for daily schedule', () => { const cronExpression = '0 12 * * *'; // Every day at 12:00 PM const result = dashboardService.testCalculateNextRunTime(cronExpression); const now = Date.now(); expect(result).toBeInstanceOf(Date); expect(result!.getTime()).toBeGreaterThan(now); // Verify the time is correct (within 1 minute of expected time) const expectedTime = new Date(); expectedTime.setHours(12, 0, 0, 0); if (expectedTime < new Date()) { expectedTime.setDate(expectedTime.getDate() + 1); } expect( Math.abs((result?.getTime() ?? 0) - expectedTime.getTime()), ).toBeLessThan(60000); }); it('should calculate next run time for weekly schedule', () => { const cronExpression = '0 12 * * 1'; // Every Monday at 12:00 PM const result = dashboardService.testCalculateNextRunTime(cronExpression); expect(result).toBeInstanceOf(Date); const now = Date.now(); expect(result!.getTime()).toBeGreaterThan(now); // Verify it's a Monday expect(result?.getDay()).toBe(1); // 1 represents Monday }); it('should calculate next run time for custom schedule', () => { const cronExpression = '0 */2 * * *'; // Every 2 hours const result = dashboardService.testCalculateNextRunTime(cronExpression); expect(result).toBeInstanceOf(Date); const now = Date.now(); expect(result!.getTime()).toBeGreaterThan(now); // Verify the time is in 2-hour intervals const hours = result?.getHours() ?? 0; expect(hours % 2).toBe(0); }); it('should handle timezone conversion correctly', () => { // Test with a schedule that would be affected by timezone conversion const schedule = { frequency: ScheduleFrequencyEnum.DAILY, timezone: 'America/New_York', hour: 12, minute: 0, day: CacheScheduleDayEnum.MON, cron: '', }; const cronExpression = dashboardService.testGenerateCronExpression(schedule); const result = dashboardService.testCalculateNextRunTime( cronExpression ?? '', ); expect(result).toBeInstanceOf(Date); const now = Date.now(); expect(result!.getTime()).toBeGreaterThan(now); }); }); describe('toUTC', () => { beforeEach(() => { // Mock the current date to a fixed value for consistent testing jest.useFakeTimers().setSystemTime(new Date('2024-04-22T10:00:00Z')); }); afterEach(() => { jest.useRealTimers(); }); it('should return original schedule if no timezone is specified', () => { const schedule = { frequency: ScheduleFrequencyEnum.DAILY, hour: 14, minute: 30, timezone: '', day: null, cron: null, }; const result = dashboardService.testToUTC(schedule); expect(result).toEqual(schedule); }); it('should convert daily schedule from local time to UTC', () => { const schedule = { frequency: ScheduleFrequencyEnum.DAILY, hour: 14, minute: 30, timezone: 'America/New_York', // UTC-4 day: null, cron: null, }; const result = dashboardService.testToUTC(schedule); expect(result).toEqual({ ...schedule, hour: 18, // 14 + 4 = 18 UTC minute: 30, }); }); it('should convert weekly schedule from local time to UTC without day change', () => { const schedule = { frequency: ScheduleFrequencyEnum.WEEKLY, day: CacheScheduleDayEnum.MON, hour: 14, minute: 30, timezone: 'America/New_York', // UTC-4 cron: null, }; const result = dashboardService.testToUTC(schedule); expect(result).toEqual({ ...schedule, hour: 18, // 14 + 4 = 18 UTC minute: 30, day: CacheScheduleDayEnum.MON, // Same day because 18:30 UTC is still Monday }); }); it('should adjust day forward for weekly schedule when UTC time crosses midnight', () => { const schedule = { frequency: ScheduleFrequencyEnum.WEEKLY, day: CacheScheduleDayEnum.MON, hour: 23, minute: 30, timezone: 'America/New_York', // UTC-4 cron: null, }; const result = dashboardService.testToUTC(schedule); expect(result).toEqual({ ...schedule, hour: 3, // 23 + 4 = 3 UTC (next day) minute: 30, day: CacheScheduleDayEnum.TUE, // Day changes to Tuesday }); }); it('should adjust day forward from Saturday to Sunday when UTC time crosses midnight', () => { const schedule = { frequency: ScheduleFrequencyEnum.WEEKLY, day: CacheScheduleDayEnum.SAT, hour: 23, minute: 30, timezone: 'America/New_York', // UTC-4 cron: null, }; const result = dashboardService.testToUTC(schedule); expect(result).toEqual({ ...schedule, hour: 3, // 23 + 4 = 3 UTC (next day) minute: 30, day: CacheScheduleDayEnum.SUN, // Day wraps around from Saturday to Sunday }); }); it('should adjust day backward for weekly schedule when UTC time is on previous day', () => { const schedule = { frequency: ScheduleFrequencyEnum.WEEKLY, day: CacheScheduleDayEnum.MON, hour: 1, minute: 30, timezone: 'Asia/Tokyo', // UTC+9 cron: null, }; const result = dashboardService.testToUTC(schedule); expect(result).toEqual({ ...schedule, hour: 16, // 1 - 9 = 16 UTC (previous day) minute: 30, day: CacheScheduleDayEnum.SUN, // Day changes to Sunday }); }); it('should adjust day backward from Sunday to Saturday when UTC time crosses midnight', () => { const schedule = { frequency: ScheduleFrequencyEnum.WEEKLY, day: CacheScheduleDayEnum.SUN, hour: 1, minute: 30, timezone: 'Asia/Tokyo', // UTC+9 cron: null, }; const result = dashboardService.testToUTC(schedule); expect(result).toEqual({ ...schedule, hour: 16, // 1 - 9 = 16 UTC (previous day) minute: 30, day: CacheScheduleDayEnum.SAT, // Day wraps around from Sunday to Saturday }); }); it('should handle custom schedule without timezone conversion', () => { const schedule = { frequency: ScheduleFrequencyEnum.CUSTOM, cron: '0 0 * * *', timezone: 'America/New_York', day: null, hour: 0, minute: 0, }; const result = dashboardService.testToUTC(schedule); expect(result).toEqual(schedule); }); it('should handle timezone with non-hour offset (UTC+2:15)', () => { const schedule = { frequency: ScheduleFrequencyEnum.DAILY, hour: 14, minute: 30, timezone: 'Asia/Kolkata', // UTC+5:30 day: null, cron: null, }; const result = dashboardService.testToUTC(schedule); expect(result).toEqual({ ...schedule, hour: 9, // 14 - 5 = 9 UTC minute: 0, // 30 - 30 = 0 UTC }); }); it('should handle timezone with non-hour offset crossing midnight', () => { const schedule = { frequency: ScheduleFrequencyEnum.WEEKLY, day: CacheScheduleDayEnum.MON, hour: 23, minute: 45, timezone: 'Asia/Kolkata', // UTC+5:30 cron: null, }; const result = dashboardService.testToUTC(schedule); expect(result).toEqual({ ...schedule, hour: 18, // 23 - 5 = 18 UTC minute: 15, // 45 - 30 = 15 UTC day: CacheScheduleDayEnum.MON, // Same day because 18:15 UTC is still Monday }); }); }); describe('toTimezone', () => { beforeEach(() => { // Mock the current date to a fixed value for consistent testing jest.useFakeTimers().setSystemTime(new Date('2024-04-22T10:00:00Z')); }); afterEach(() => { jest.useRealTimers(); }); it('should return original schedule if no timezone is specified', () => { const schedule = { frequency: ScheduleFrequencyEnum.DAILY, hour: 14, minute: 30, day: null, timezone: '', cron: null, }; const result = dashboardService.testToTimezone(schedule); expect(result).toEqual(schedule); }); it('should convert daily schedule from UTC to local time', () => { const schedule = { frequency: ScheduleFrequencyEnum.DAILY, hour: 18, minute: 30, day: null, timezone: 'America/New_York', // UTC-4 cron: null, }; const result = dashboardService.testToTimezone(schedule); expect(result).toEqual({ ...schedule, hour: 14, // 18 - 4 = 14 local time minute: 30, }); }); it('should convert weekly schedule from UTC to local time without day change', () => { const schedule = { frequency: ScheduleFrequencyEnum.WEEKLY, day: CacheScheduleDayEnum.MON, hour: 18, minute: 30, timezone: 'America/New_York', // UTC-4 cron: null, }; const result = dashboardService.testToTimezone(schedule); expect(result).toEqual({ ...schedule, hour: 14, // 18 - 4 = 14 local time minute: 30, day: CacheScheduleDayEnum.MON, // Same day because 14:30 local is still Monday }); }); it('should adjust day forward for weekly schedule when local time crosses midnight', () => { const schedule = { frequency: ScheduleFrequencyEnum.WEEKLY, day: CacheScheduleDayEnum.MON, hour: 3, minute: 30, timezone: 'America/New_York', // UTC-4 cron: null, }; const result = dashboardService.testToTimezone(schedule); expect(result).toEqual({ ...schedule, hour: 23, // 3 + 4 = 23 local time (previous day) minute: 30, day: CacheScheduleDayEnum.SUN, // Day changes to Sunday }); }); it('should adjust day forward from Saturday to Sunday when local time crosses midnight', () => { const schedule = { frequency: ScheduleFrequencyEnum.WEEKLY, day: CacheScheduleDayEnum.SAT, hour: 3, minute: 30, timezone: 'America/New_York', // UTC-4 cron: null, }; const result = dashboardService.testToTimezone(schedule); expect(result).toEqual({ ...schedule, hour: 23, // 3 + 4 = 23 local time (previous day) minute: 30, day: CacheScheduleDayEnum.FRI, // Day wraps around from Saturday to Friday }); }); it('should adjust day backward for weekly schedule when local time is on next day', () => { const schedule = { frequency: ScheduleFrequencyEnum.WEEKLY, day: CacheScheduleDayEnum.MON, hour: 16, minute: 30, timezone: 'Asia/Tokyo', // UTC+9 cron: null, }; const result = dashboardService.testToTimezone(schedule); expect(result).toEqual({ ...schedule, hour: 1, // 16 - 9 = 1 local time (next day) minute: 30, day: CacheScheduleDayEnum.TUE, // Day changes to Tuesday }); }); it('should adjust day backward from Sunday to Monday when local time crosses midnight', () => { const schedule = { frequency: ScheduleFrequencyEnum.WEEKLY, day: CacheScheduleDayEnum.SUN, hour: 16, minute: 30, timezone: 'Asia/Tokyo', // UTC+9 cron: null, }; const result = dashboardService.testToTimezone(schedule); expect(result).toEqual({ ...schedule, hour: 1, // 16 - 9 = 1 local time (next day) minute: 30, day: CacheScheduleDayEnum.MON, // Day wraps around from Sunday to Monday }); }); it('should handle custom schedule without timezone conversion', () => { const schedule = { frequency: ScheduleFrequencyEnum.CUSTOM, minute: null, hour: null, day: null, cron: '0 0 * * *', timezone: 'America/New_York', }; const result = dashboardService.testToTimezone(schedule); expect(result).toEqual(schedule); }); it('should handle timezone with non-hour offset (UTC+2:15)', () => { const schedule = { frequency: ScheduleFrequencyEnum.DAILY, hour: 9, minute: 0, day: null, timezone: 'Asia/Kolkata', // UTC+5:30 cron: null, }; const result = dashboardService.testToTimezone(schedule); expect(result).toEqual({ ...schedule, hour: 14, // 9 + 5 = 14 local time minute: 30, // 0 + 30 = 30 local time }); }); it('should handle timezone with non-hour offset crossing midnight', () => { const schedule = { frequency: ScheduleFrequencyEnum.WEEKLY, day: CacheScheduleDayEnum.MON, hour: 18, minute: 15, timezone: 'Asia/Kolkata', // UTC+5:30 cron: null, }; const result = dashboardService.testToTimezone(schedule); expect(result).toEqual({ ...schedule, hour: 23, // 18 + 5 = 23 local time minute: 45, // 15 + 30 = 45 local time day: CacheScheduleDayEnum.MON, // Same day because 23:45 local is still Monday }); }); }); describe('validateScheduleInput', () => { it('should throw error for weekly schedule without day', () => { const data = { cacheEnabled: true, schedule: { frequency: ScheduleFrequencyEnum.WEEKLY, hour: 12, minute: 0, timezone: '', day: null, cron: null, }, }; expect(() => { dashboardService.testValidateScheduleInput(data); }).toThrow('Day of week is required for weekly schedule'); }); it('should throw error for custom schedule without cron expression', () => { const data = { cacheEnabled: true, schedule: { frequency: ScheduleFrequencyEnum.CUSTOM, hour: 12, minute: 0, timezone: '', day: null, cron: null, }, }; expect(() => { dashboardService.testValidateScheduleInput(data); }).toThrow('Cron expression is required for custom schedule'); }); it('should throw error for invalid hour', () => { const data = { cacheEnabled: true, schedule: { frequency: ScheduleFrequencyEnum.DAILY, hour: 24, minute: 0, timezone: '', day: null, cron: null, }, }; expect(() => { dashboardService.testValidateScheduleInput(data); }).toThrow('Hour must be between 0 and 23'); }); it('should throw error for invalid minute', () => { const data = { cacheEnabled: true, schedule: { frequency: ScheduleFrequencyEnum.DAILY, hour: 12, minute: 60, timezone: '', day: null, cron: null, }, }; expect(() => { dashboardService.testValidateScheduleInput(data); }).toThrow('Minute must be between 0 and 59'); }); it('should throw error for invalid timezone', () => { const data = { cacheEnabled: true, schedule: { frequency: ScheduleFrequencyEnum.DAILY, hour: 12, minute: 0, timezone: 'Invalid/Timezone', day: null, cron: null, }, }; expect(() => { dashboardService.testValidateScheduleInput(data); }).toThrow('Invalid timezone: Invalid/Timezone'); }); it('should throw error for custom schedule with interval less than 10 minutes', () => { const data = { cacheEnabled: true, schedule: { frequency: ScheduleFrequencyEnum.CUSTOM, cron: '*/5 * * * *', // Every 5 minutes timezone: '', day: null, hour: 0, minute: 0, }, }; expect(() => { dashboardService.testValidateScheduleInput(data); }).toThrow('Custom cron expression must be at least 10 minutes apart'); }); it('should not throw error for valid daily schedule', () => { const data = { cacheEnabled: true, schedule: { frequency: ScheduleFrequencyEnum.DAILY, hour: 12, minute: 0, timezone: '', day: CacheScheduleDayEnum.MON, cron: '', }, }; expect(() => { dashboardService.testValidateScheduleInput(data); }).not.toThrow(); }); it('should not throw error for valid weekly schedule', () => { const data = { cacheEnabled: true, schedule: { frequency: ScheduleFrequencyEnum.WEEKLY, day: CacheScheduleDayEnum.MON, hour: 12, minute: 0, timezone: '', cron: null, }, }; expect(() => { dashboardService.testValidateScheduleInput(data); }).not.toThrow(); }); it('should not throw error for valid custom schedule', () => { const data = { cacheEnabled: true, schedule: { frequency: ScheduleFrequencyEnum.CUSTOM, cron: '0 */15 * * *', // Every 15 minutes timezone: '', day: null, hour: 0, minute: 0, }, }; expect(() => { dashboardService.testValidateScheduleInput(data); }).not.toThrow(); }); it('should not throw error for valid schedule with timezone', () => { const data = { cacheEnabled: true, schedule: { frequency: ScheduleFrequencyEnum.DAILY, hour: 12, minute: 0, timezone: 'America/New_York', day: null, cron: null, }, }; expect(() => { dashboardService.testValidateScheduleInput(data); }).not.toThrow(); }); }); describe('setDashboardSchedule', () => { beforeEach(() => { mockDashboardRepository.findOneBy.mockReset(); mockDashboardRepository.updateOne.mockReset(); }); it('should throw error if dashboard not found', async () => { mockDashboardRepository.findOneBy.mockResolvedValue(null); const data = createScheduleData(ScheduleFrequencyEnum.DAILY, { hour: 12, minute: 0, }); await expect( dashboardService.setDashboardSchedule(1, data), ).rejects.toThrow('Dashboard with id 1 not found'); }); it('should update dashboard with daily schedule', async () => { const mockDashboard = { id: 1, projectId: 1, name: 'Test Dashboard', }; mockDashboardRepository.findOneBy.mockResolvedValue(mockDashboard); mockDashboardRepository.updateOne.mockResolvedValue({ ...mockDashboard, cacheEnabled: true, scheduleFrequency: ScheduleFrequencyEnum.DAILY, scheduleCron: '0 12 * * *', nextScheduledAt: expect.any(Date), scheduleTimezone: '', }); const data = createScheduleData(ScheduleFrequencyEnum.DAILY, { hour: 12, minute: 0, }); await dashboardService.setDashboardSchedule(1, data); expect(mockDashboardRepository.updateOne).toHaveBeenCalledWith(1, { cacheEnabled: true, scheduleFrequency: ScheduleFrequencyEnum.DAILY, scheduleCron: '0 12 * * *', nextScheduledAt: expect.any(Date), scheduleTimezone: '', }); }); it('should update dashboard with weekly schedule', async () => { const mockDashboard = { id: 1, projectId: 1, name: 'Test Dashboard', }; mockDashboardRepository.findOneBy.mockResolvedValue(mockDashboard); mockDashboardRepository.updateOne.mockResolvedValue({ ...mockDashboard, cacheEnabled: true, scheduleFrequency: ScheduleFrequencyEnum.WEEKLY, scheduleCron: '0 12 * * MON', nextScheduledAt: expect.any(Date), scheduleTimezone: '', }); const data = createScheduleData(ScheduleFrequencyEnum.WEEKLY, { day: CacheScheduleDayEnum.MON, hour: 12, minute: 0, }); await dashboardService.setDashboardSchedule(1, data); expect(mockDashboardRepository.updateOne).toHaveBeenCalledWith(1, { cacheEnabled: true, scheduleFrequency: ScheduleFrequencyEnum.WEEKLY, scheduleCron: '0 12 * * MON', nextScheduledAt: expect.any(Date), scheduleTimezone: '', }); }); it('should update dashboard with custom schedule', async () => { const mockDashboard = { id: 1, projectId: 1, name: 'Test Dashboard', }; mockDashboardRepository.findOneBy.mockResolvedValue(mockDashboard); mockDashboardRepository.updateOne.mockResolvedValue({ ...mockDashboard, cacheEnabled: true, scheduleFrequency: ScheduleFrequencyEnum.CUSTOM, scheduleCron: '0 */15 * * *', nextScheduledAt: expect.any(Date), scheduleTimezone: '', }); const data = createScheduleData(ScheduleFrequencyEnum.CUSTOM, { cron: '0 */15 * * *', }); await dashboardService.setDashboardSchedule(1, data); expect(mockDashboardRepository.updateOne).toHaveBeenCalledWith(1, { cacheEnabled: true, scheduleFrequency: ScheduleFrequencyEnum.CUSTOM, scheduleCron: '0 */15 * * *', nextScheduledAt: expect.any(Date), scheduleTimezone: '', }); }); it('should update dashboard with disabled cache', async () => { const mockDashboard = { id: 1, projectId: 1, name: 'Test Dashboard', }; mockDashboardRepository.findOneBy.mockResolvedValue(mockDashboard); mockDashboardRepository.updateOne.mockResolvedValue({ ...mockDashboard, cacheEnabled: false, scheduleFrequency: null, scheduleCron: null, nextScheduledAt: null, scheduleTimezone: null, }); const data = createScheduleData(ScheduleFrequencyEnum.NEVER, { cacheEnabled: false, }); await dashboardService.setDashboardSchedule(1, data); expect(mockDashboardRepository.updateOne).toHaveBeenCalledWith(1, { cacheEnabled: false, scheduleFrequency: null, scheduleCron: null, nextScheduledAt: null, scheduleTimezone: null, }); }); it('should handle timezone conversion in schedule', async () => { const mockDashboard = { id: 1, projectId: 1, name: 'Test Dashboard', }; mockDashboardRepository.findOneBy.mockResolvedValue(mockDashboard); mockDashboardRepository.updateOne.mockResolvedValue({ ...mockDashboard, cacheEnabled: true, scheduleFrequency: ScheduleFrequencyEnum.DAILY, scheduleCron: '0 16 * * *', // 12:00 PM EST = 16:00 UTC nextScheduledAt: expect.any(Date), scheduleTimezone: 'America/New_York', }); const data = createScheduleData(ScheduleFrequencyEnum.DAILY, { hour: 12, minute: 0, timezone: 'America/New_York', }); await dashboardService.setDashboardSchedule(1, data); expect(mockDashboardRepository.updateOne).toHaveBeenCalledWith(1, { cacheEnabled: true, scheduleFrequency: ScheduleFrequencyEnum.DAILY, scheduleCron: '0 16 * * *', nextScheduledAt: expect.any(Date), scheduleTimezone: 'America/New_York', }); }); it('should handle error during update', async () => { const mockDashboard = { id: 1, projectId: 1, name: 'Test Dashboard', }; mockDashboardRepository.findOneBy.mockResolvedValue(mockDashboard); mockDashboardRepository.updateOne.mockRejectedValue( new Error('Update failed'), ); const data = createScheduleData(ScheduleFrequencyEnum.DAILY, { hour: 12, minute: 0, }); await expect( dashboardService.setDashboardSchedule(1, data), ).rejects.toThrow('Update failed'); }); }); }); ================================================ FILE: wren-ui/src/apollo/server/services/tests/deployService.test.ts ================================================ import { DeployService } from '../deployService'; import { DeployStatusEnum } from '@server/repositories/deployLogRepository'; describe('DeployService', () => { let mockWrenAIAdaptor; let mockDeployLogRepository; let deployService; let mockTelemetry; beforeEach(() => { mockTelemetry = { sendEvent: jest.fn() }; mockWrenAIAdaptor = { deploy: jest.fn() }; mockDeployLogRepository = { findLastProjectDeployLog: jest.fn(), createOne: jest.fn(), updateOne: jest.fn(), }; deployService = new DeployService({ telemetry: mockTelemetry, wrenAIAdaptor: mockWrenAIAdaptor, deployLogRepository: mockDeployLogRepository, }); }); it('should successfully deploy when there is no existing deployment with the same hash', async () => { const manifest = { key: 'value' }; const projectId = 1; mockDeployLogRepository.findLastProjectDeployLog.mockResolvedValue(null); mockWrenAIAdaptor.deploy.mockResolvedValue({ status: 'SUCCESS' }); mockDeployLogRepository.createOne.mockResolvedValue({ id: 123 }); const response = await deployService.deploy(manifest, projectId); expect(response.status).toEqual(DeployStatusEnum.SUCCESS); expect(mockDeployLogRepository.updateOne).toHaveBeenCalledWith(123, { status: DeployStatusEnum.SUCCESS, error: undefined, }); }); it('should return failed status if ai-service deployment fails', async () => { const manifest = { key: 'value' }; const projectId = 1; mockDeployLogRepository.findLastProjectDeployLog.mockResolvedValue(null); mockWrenAIAdaptor.deploy.mockResolvedValue({ status: 'FAILED', error: 'AI error', }); mockDeployLogRepository.createOne.mockResolvedValue({ id: 123 }); const response = await deployService.deploy(manifest, projectId); expect(response.status).toEqual(DeployStatusEnum.FAILED); expect(response.error).toEqual('AI error'); }); it('should skip deployment if an existing deployment with the same hash exists', async () => { const manifest = { key: 'value' }; const projectId = 1; mockDeployLogRepository.findLastProjectDeployLog.mockResolvedValue({ hash: deployService.createMDLHash(manifest, 1), }); const response = await deployService.deploy(manifest, projectId); expect(response.status).toEqual(DeployStatusEnum.SUCCESS); expect(mockWrenAIAdaptor.deploy).not.toHaveBeenCalled(); }); // Add more tests here to cover other scenarios and error handling }); ================================================ FILE: wren-ui/src/apollo/server/services/tests/queryService.test.ts ================================================ import { TelemetryEvent } from '../../telemetry/telemetry'; import { DataSourceName } from '../../types'; import { QueryService } from '../queryService'; describe('QueryService', () => { let mockIbisAdaptor; let mockWrenEngineAdaptor; let mockTelemetry; let queryService; beforeEach(() => { mockIbisAdaptor = { query: jest.fn(), dryRun: jest.fn(), }; mockWrenEngineAdaptor = {}; mockTelemetry = new MockTelemetry(); queryService = new QueryService({ ibisAdaptor: mockIbisAdaptor, wrenEngineAdaptor: mockWrenEngineAdaptor, telemetry: mockTelemetry, }); }); afterEach(() => { mockTelemetry.records = []; jest.clearAllMocks(); }); it('should return true and send event when previewing via ibis dry run succeeds', async () => { mockIbisAdaptor.dryRun.mockResolvedValue({ correlationId: '123', processTime: '1s', }); const res = await queryService.preview('SELECT * FROM test', { project: { type: DataSourceName.POSTGRES, connectionInfo: {} }, manifest: {}, dryRun: true, }); expect(res).toEqual({ correlationId: '123' }); expect(mockTelemetry.records).toHaveLength(1); expect(mockTelemetry.records[0]).toEqual({ event: TelemetryEvent.IBIS_DRY_RUN, properties: { correlationId: '123', processTime: '1s', sql: 'SELECT * FROM test', dataSource: DataSourceName.POSTGRES, }, actionSuccess: true, }); }); it('should send event when previewing via ibis dry run fails', async () => { mockIbisAdaptor.dryRun.mockRejectedValue({ message: 'Error message', extensions: { other: { correlationId: '123', processTime: '1s', }, }, }); try { await queryService.preview('SELECT * FROM test', { project: { type: DataSourceName.POSTGRES, connectionInfo: {} }, manifest: {}, dryRun: true, }); } catch (e) { expect(e.message).toEqual('Error message'); expect(e.extensions.other.correlationId).toEqual('123'); expect(e.extensions.other.processTime).toEqual('1s'); } expect(mockTelemetry.records).toHaveLength(1); expect(mockTelemetry.records[0]).toEqual({ event: TelemetryEvent.IBIS_DRY_RUN, properties: { correlationId: '123', processTime: '1s', sql: 'SELECT * FROM test', dataSource: DataSourceName.POSTGRES, error: 'Error message', }, actionSuccess: false, service: undefined, }); }); it('should return data and send event when previewing via ibis query succeeds', async () => { mockIbisAdaptor.query.mockResolvedValue({ data: [], columns: [], dtypes: [], correlationId: '123', processTime: '1s', }); const res = await queryService.preview('SELECT * FROM test', { project: { type: DataSourceName.POSTGRES, connectionInfo: {} }, manifest: {}, limit: 10, }); expect(res.data).toEqual([]); expect(mockTelemetry.records).toHaveLength(1); expect(mockTelemetry.records[0]).toEqual({ event: TelemetryEvent.IBIS_QUERY, properties: { correlationId: '123', processTime: '1s', sql: 'SELECT * FROM test', dataSource: DataSourceName.POSTGRES, }, actionSuccess: true, }); }); it('should send event when previewing via ibis query fails', async () => { mockIbisAdaptor.query.mockRejectedValue({ message: 'Error message', extensions: { other: { correlationId: '123', processTime: '1s', }, }, }); await expect( queryService.preview('SELECT * FROM test', { project: { type: DataSourceName.POSTGRES, connectionInfo: {} }, manifest: {}, }), ).rejects.toMatchObject({ message: 'Error message', extensions: { other: { correlationId: '123', processTime: '1s', }, }, }); expect(mockTelemetry.records).toHaveLength(1); expect(mockTelemetry.records[0]).toEqual({ event: TelemetryEvent.IBIS_QUERY, properties: { correlationId: '123', processTime: '1s', sql: 'SELECT * FROM test', dataSource: DataSourceName.POSTGRES, error: 'Error message', }, actionSuccess: false, service: undefined, }); }); }); class MockTelemetry { records: any[] = []; sendEvent( event: TelemetryEvent, properties: Record = {}, service: any, actionSuccess: boolean = true, ) { this.records.push({ event, properties, service, actionSuccess }); } } ================================================ FILE: wren-ui/src/apollo/server/telemetry/telemetry.ts ================================================ import { getConfig } from '../config'; import { PostHog } from 'posthog-node'; import { v4 as uuidv4 } from 'uuid'; import { getLogger } from '@server/utils'; import { IContext } from '../types'; const logger = getLogger('TELEMETRY'); logger.level = 'debug'; const config = getConfig(); const { userUUID, telemetryEnabled, wrenAIVersion, generationModel, wrenEngineVersion, wrenUIVersion, posthogApiKey, posthogHost, } = config; export enum TelemetryEvent { // onboarding CONNECTION_START_SAMPLE_DATASET = 'connection_start_sample_dataset', CONNECTION_SAVE_DATA_SOURCE = 'connection_save_data_source', CONNECTION_SAVE_TABLES = 'connection_save_tables', CONNECTION_SAVE_RELATION = 'connection_save_relation', // modeling page MODELING_DEPLOY_MDL = 'modeling_deploy_mdl', MODELING_CREATE_MODEL = 'modeling_create_model', MODELING_UPDATE_MODEL = 'modeling_update_model', MODELING_CREATE_CF = 'modeling_create_cf', MODELING_UPDATE_CF = 'modeling_update_cf', MODELING_UPDATE_MODEL_METADATA = 'modeling_update_model_metadata', MODELING_UPDATE_VIEW_METADATA = 'modeling_update_view_metadata', MODELING_CREATE_RELATION = 'modeling_create_relation', MODELING_UPDATE_RELATION = 'modeling_update_relation', // schema change MODELING_DETECT_SCHEMA_CHANGE = 'modeling_detect_schema_change', MODELING_RESOLVE_SCHEMA_CHANGE = 'modeling_resolve_schema_change', HOME_UPDATE_THREAD_SUMMARY = 'update_thread_summary', // ask question HOME_ASK_CANDIDATE = 'home_ask_candidate', HOME_CREATE_THREAD = 'home_create_thread', HOME_ANSWER_QUESTION = 'home_answer_question', HOME_ANSWER_QUESTION_INTERRUPTED = 'home_answer_question_interrupted', HOME_ANSWER_BREAKDOWN = 'home_answer_breakdown', HOME_ANSWER_CHART = 'home_answer_chart', HOME_ANSWER_ADJUST_CHART = 'home_answer_adjust_chart', HOME_ASK_FOLLOWUP_QUESTION = 'home_ask_followup_question', HOME_CANCEL_ASK = 'home_cancel_ask', HOME_RERUN_ASKING_TASK = 'home_rerun_asking_task', HOME_GENERATE_PROJECT_RECOMMENDATION_QUESTIONS = 'home_generate_project_recommendation_questions', HOME_GENERATE_THREAD_RECOMMENDATION_QUESTIONS = 'home_generate_thread_recommendation_questions', // adjustment HOME_ADJUST_THREAD_RESPONSE = 'home_adjust_thread_response', HOME_ADJUST_THREAD_RESPONSE_CANCEL = 'home_adjust_thread_response_cancel', HOME_ADJUST_THREAD_RESPONSE_RERUN = 'home_adjust_thread_response_rerun', HOME_ADJUST_THREAD_RESPONSE_WITH_SQL = 'home_adjust_thread_response_with_sql', // event after ask HOME_CREATE_VIEW = 'home_create_view', HOME_PREVIEW_ANSWER = 'home_preview_answer', // settings event SETTING_RESET_PROJECT = 'setting_reset_project', // ibis event IBIS_DRY_RUN = 'ibis_dry_run', IBIS_QUERY = 'ibis_query', // Default error GRAPHQL_ERROR = 'graphql_error', // Knowledge KNOWLEDGE_CREATE_INSTRUCTION = 'knowledge_create_instruction', KNOWLEDGE_UPDATE_INSTRUCTION = 'knowledge_update_instruction', KNOWLEDGE_DELETE_INSTRUCTION = 'knowledge_delete_instruction', KNOWLEDGE_CREATE_SQL_PAIR = 'knowledge_create_sql_pair', KNOWLEDGE_UPDATE_SQL_PAIR = 'knowledge_update_sql_pair', KNOWLEDGE_DELETE_SQL_PAIR = 'knowledge_delete_sql_pair', } export enum WrenService { BE = 'BE', AI = 'AI', ENGINE = 'ENGINE', UNKNOWN = 'UNKNOWN', } export interface ITelemetry { sendEvent: ( event: TelemetryEvent, properties: Record, service?: WrenService | any, actionSuccess?: boolean, ) => void; } export class PostHogTelemetry { private readonly posthog: any; private readonly userId: string; constructor() { if (telemetryEnabled) { if (!posthogApiKey) { logger.debug('Telemetry enabled but posthogApiKey not provided.'); return; } const client = new PostHog(posthogApiKey, { host: posthogHost || 'https://us.posthog.com', }); this.posthog = client; this.userId = userUUID || uuidv4(); logger.info(`Telemetry initialized: ${this.userId}`); return; } logger.info('Telemetry not enabled.'); } public async sendEvent( event: TelemetryEvent, properties: Record = {}, service: WrenService | any = WrenService.UNKNOWN, actionSuccess: boolean = true, ) { if (!this.posthog) { return; } const eventName = actionSuccess ? `${event}_success` : `${event}_failed`; try { console.log('sendEvent', eventName, properties, service, actionSuccess); const systemInfo = this.collectSystemInfo(); this.posthog.capture({ distinctId: this.userId, event: eventName, properties: { ...systemInfo, ...properties, wren_service: service, }, }); } catch (e) { logger.error(e); } } private collectSystemInfo(): Record { return { // collect services version 'wren-ui-version': wrenUIVersion || null, 'wren-engine-version': wrenEngineVersion || null, 'wren-ai-service-version': wrenAIVersion || null, // collect AI model info 'generation-model': generationModel || null, // collect some system info from process module node_version: process.version, node_platform: process.platform, node_arch: process.arch, memory_usage: process.memoryUsage(), cpu_usage: process.cpuUsage(), }; } public stop() { if (this.posthog) { this.posthog.shutdown(); } } } export const withTelemetry = async ( eventName: TelemetryEvent, data: any, operation: () => Promise, ctx: IContext, ): Promise => { try { const result = await operation(); ctx.telemetry.sendEvent(eventName, { data }); return result; } catch (err: any) { ctx.telemetry.sendEvent( eventName, { data, error: err.message }, err.extensions?.service, false, ); throw err; } }; export function TrackTelemetry(eventName: TelemetryEvent) { return function ( _target: any, _propertyKey: string, descriptor: PropertyDescriptor, ) { const originalMethod = descriptor.value; descriptor.value = async function (...args: [any, any, IContext]) { // The last argument is typically the context in GraphQL resolvers const [, , ctx] = args; // Extract data using the provided extractor or use a default approach const data = args[1]?.data || args[1]; try { const result = await originalMethod.apply(this, args); ctx.telemetry.sendEvent(eventName, { data }); return result; } catch (err: any) { ctx.telemetry.sendEvent( eventName, { data, error: err.message }, err.extensions?.service, false, ); throw err; } }; return descriptor; }; } ================================================ FILE: wren-ui/src/apollo/server/types/context.ts ================================================ import { IConfig } from '@server/config'; import { IIbisAdaptor, IWrenAIAdaptor, IWrenEngineAdaptor, } from '@server/adaptors'; import { IModelColumnRepository, IModelNestedColumnRepository, IModelRepository, IProjectRepository, IRelationRepository, IViewRepository, ILearningRepository, ISchemaChangeRepository, IDeployLogRepository, IDashboardRepository, IDashboardItemRepository, ISqlPairRepository, IInstructionRepository, IApiHistoryRepository, IDashboardItemRefreshJobRepository, } from '@server/repositories'; import { IQueryService, IAskingService, IDeployService, IModelService, IMDLService, IProjectService, IDashboardService, IInstructionService, } from '@server/services'; import { ITelemetry } from '@server/telemetry/telemetry'; import { ProjectRecommendQuestionBackgroundTracker, ThreadRecommendQuestionBackgroundTracker, DashboardCacheBackgroundTracker, } from '@server/backgrounds'; import { ISqlPairService } from '../services/sqlPairService'; export interface IContext { config: IConfig; // telemetry telemetry: ITelemetry; // adaptor wrenEngineAdaptor: IWrenEngineAdaptor; ibisServerAdaptor: IIbisAdaptor; wrenAIAdaptor: IWrenAIAdaptor; // services projectService: IProjectService; modelService: IModelService; mdlService: IMDLService; deployService: IDeployService; askingService: IAskingService; queryService: IQueryService; dashboardService: IDashboardService; sqlPairService: ISqlPairService; instructionService: IInstructionService; // repository projectRepository: IProjectRepository; modelRepository: IModelRepository; modelColumnRepository: IModelColumnRepository; modelNestedColumnRepository: IModelNestedColumnRepository; relationRepository: IRelationRepository; viewRepository: IViewRepository; deployRepository: IDeployLogRepository; schemaChangeRepository: ISchemaChangeRepository; learningRepository: ILearningRepository; dashboardRepository: IDashboardRepository; dashboardItemRepository: IDashboardItemRepository; sqlPairRepository: ISqlPairRepository; instructionRepository: IInstructionRepository; apiHistoryRepository: IApiHistoryRepository; dashboardItemRefreshJobRepository: IDashboardItemRefreshJobRepository; // background trackers projectRecommendQuestionBackgroundTracker: ProjectRecommendQuestionBackgroundTracker; threadRecommendQuestionBackgroundTracker: ThreadRecommendQuestionBackgroundTracker; dashboardCacheBackgroundTracker: DashboardCacheBackgroundTracker; } ================================================ FILE: wren-ui/src/apollo/server/types/dataSource.ts ================================================ export enum DataSourceName { BIG_QUERY = 'BIG_QUERY', DUCKDB = 'DUCKDB', POSTGRES = 'POSTGRES', MYSQL = 'MYSQL', ORACLE = 'ORACLE', MSSQL = 'MSSQL', CLICK_HOUSE = 'CLICK_HOUSE', TRINO = 'TRINO', SNOWFLAKE = 'SNOWFLAKE', ATHENA = 'ATHENA', REDSHIFT = 'REDSHIFT', DATABRICKS = 'DATABRICKS', } export interface DataSource { type: DataSourceName; properties: DataSourceProperties; sampleDataset?: string; } export interface SampleDatasetData { name: string; } export type DataSourceProperties = { displayName: string } & Partial< BigQueryDataSourceProperties & DuckDBDataSourceProperties & PGDataSourceProperties >; export interface BigQueryDataSourceProperties { displayName: string; projectId: string; datasetId: string; credentials: JSON; } export interface DuckDBDataSourceProperties { displayName: string; initSql: string; extensions: string[]; configurations: Record; } export interface PGDataSourceProperties { displayName: string; host: string; port: number; database: string; user: string; password: string; ssl?: boolean; } ================================================ FILE: wren-ui/src/apollo/server/types/diagram.ts ================================================ import { RelationType } from '@server/types'; export enum NodeType { MODEL = 'MODEL', VIEW = 'VIEW', RELATION = 'RELATION', FIELD = 'FIELD', CALCULATED_FIELD = 'CALCULATED_FIELD', } export interface Diagram { models: DiagramModel[]; views: DiagramView[]; } export interface DiagramView { id: string; viewId: number; nodeType: NodeType; statement: string; displayName: string; referenceName: string; fields: DiagramViewField[]; description: string; } export interface DiagramViewField { id: string; displayName: string; referenceName: string; type: string; nodeType: NodeType; description: string; } export interface DiagramModel { id: string; modelId: number; nodeType: NodeType; displayName: string; referenceName: string; sourceTableName: string; refSql?: string; cached: boolean; refreshTime: string; description: string; fields: DiagramModelField[]; calculatedFields: DiagramModelField[]; relationFields: DiagramModelRelationField[]; } export interface DiagramModelNestedField { id: string; nestedColumnId: number; type: string; displayName: string; referenceName: string; description: string; } export interface DiagramModelField { id: string; columnId: number; type: string; nodeType: NodeType; displayName: string; referenceName: string; description: string; isPrimaryKey?: boolean; expression?: string; lineage?: string; aggregation?: string; nestedFields?: DiagramModelNestedField[]; } export interface DiagramModelRelationField { id: string; relationId: number; type: RelationType; nodeType: NodeType; displayName: string; referenceName: string; fromModelId: number; fromModelName: string; fromModelDisplayName: string; fromColumnId: number; fromColumnName: string; fromColumnDisplayName: string; toModelId: number; toModelName: string; toModelDisplayName: string; toColumnId: number; toColumnName: string; toColumnDisplayName: string; description: string; } ================================================ FILE: wren-ui/src/apollo/server/types/index.ts ================================================ export * from './dataSource'; export * from './relationship'; export * from './manifest'; export * from './diagram'; export * from './metric'; export * from './context'; ================================================ FILE: wren-ui/src/apollo/server/types/manifest.ts ================================================ export interface Manifest { catalog: string; schema: string; models: Model[]; relationships: Relationship[]; enumDefinitions: EnumDefinition[]; metrics: Metric[]; cumulativeMetrics: CumulativeMetric[]; views: EnumDefinition[]; macros: Macro[]; dateSpine: DateSpine; } export interface CumulativeMetric { name: string; baseObject: string; measure: Measure; window: Window; cached: boolean; description?: string; properties: CumulativeMetricProperties; } export interface Measure { name: string; type: string; operator: string; refColumn: string; properties?: CumulativeMetricProperties; } export interface CumulativeMetricProperties { description?: string; } export interface Window { name: string; refColumn: string; timeUnit: string; start: Date; end: Date; properties: CumulativeMetricProperties; } export interface DateSpine { unit: string; start: Date; end: Date; properties: CumulativeMetricProperties; } export interface EnumDefinition { name: string; values?: Value[]; description: string; properties: CumulativeMetricProperties; statement?: string; } export interface Value { name: string; value: string; properties: CumulativeMetricProperties; } export interface Macro { name: string; definition: string; properties: CumulativeMetricProperties; } export interface Metric { name: string; baseObject: string; dimension: Dimension[]; measure: Dimension[]; timeGrain: TimeGrain[]; cached: boolean; refreshTime: string; description: string; properties: CumulativeMetricProperties; } export interface Dimension { name: string; type: string; isCalculated: boolean; notNull: boolean; properties: DimensionProperties; } export interface DimensionProperties {} export interface TimeGrain { name: string; refColumn: string; dateParts: string[]; } export interface Model { name: string; refSql: string; columns: Column[]; primaryKey?: string; cached: boolean; refreshTime: string; description?: string; properties: CumulativeMetricProperties; } export interface createColumnInput { name: string; } export interface Column { name: string; type: string; isCalculated: boolean; notNull: boolean; description?: string; properties: CumulativeMetricProperties; relationship?: string; expression?: string; } export interface Relationship { name: string; models: string[]; joinType: string; condition: string; manySideSortKeys: ManySideSortKey[]; description: string; properties: CumulativeMetricProperties; } export interface ManySideSortKey { name: string; descending: boolean; } ================================================ FILE: wren-ui/src/apollo/server/types/metric.ts ================================================ enum ModelType { TABLE = 'TABLE', METRIC = 'METRIC', } export type CreateSimpleMetricPayload = BaseMetricPaylod & { measure: SimpleMeasure[]; dimension: Dimension[]; timeGrain: TimeGrain[]; }; export type CreateCumulativeMetricPayload = BaseMetricPaylod & { measure: CumulativeMeasure[]; window: Window; }; interface BaseMetricPaylod { name: string; displayName: string; description: string; cached: boolean; refreshTime?: string; model: string; modelType: ModelType; properties: Properties; } interface SimpleMeasure { name: string; type: string; isCalculated: boolean; notNull: boolean; properties: Properties; } interface CumulativeMeasure { name: string; type: string; operator: string; refColumn: string; properties: Properties; } interface Dimension { name: string; type: string; isCalculated: boolean; notNull: boolean; properties: Properties; } interface TimeGrain { name: string; refColumn: string; dateParts: string[]; } interface Window { name: string; refColumn: string; timeUnit: string; start: string; end: string; properties: Properties; } export interface Properties {} ================================================ FILE: wren-ui/src/apollo/server/types/relationship.ts ================================================ export interface RelationData { fromModelId: number; fromColumnId: number; toModelId: number; toColumnId: number; type: RelationType; description?: string; } export interface UpdateRelationData { type: RelationType; } export interface AnalysisRelationInfo { name: string; fromModelId: number; fromModelReferenceName: string; fromColumnId: number; fromColumnReferenceName: string; toModelId: number; toModelReferenceName: string; toColumnId: number; toColumnReferenceName: string; type: RelationType; } export enum RelationType { ONE_TO_ONE = 'ONE_TO_ONE', ONE_TO_MANY = 'ONE_TO_MANY', MANY_TO_ONE = 'MANY_TO_ONE', } ================================================ FILE: wren-ui/src/apollo/server/utils/apiUtils.ts ================================================ import { NextApiResponse } from 'next'; import { v4 as uuidv4 } from 'uuid'; import { ApiType, ApiHistory } from '@server/repositories/apiHistoryRepository'; import * as Errors from '@server/utils/error'; import { components } from '@/common'; import { AskResult, AskResultStatus, AskResultType, WrenAIError, TextBasedAnswerResult, TextBasedAnswerStatus, } from '@/apollo/server/models/adaptor'; const { apiHistoryRepository } = components; export const MAX_WAIT_TIME = 1000 * 60 * 3; // 3 minutes export const isAskResultFinished = (result: AskResult) => { return ( result.status === AskResultStatus.FINISHED || result.status === AskResultStatus.FAILED || result.status === AskResultStatus.STOPPED || result.error ); }; /** * Validates the AI result and throws appropriate errors for different failure cases * @param result The AI result to validate * @param taskQueryId The query ID of the task (used for explanation queries) * @throws ApiError if result contains errors or is of an invalid type */ export const validateAskResult = ( result: AskResult, taskQueryId: string, ): void => { // Check for error in result if (result.error) { const errorMessage = (result.error as WrenAIError).message || 'Unknown error'; const additionalData: Record = {}; // Include invalid SQL if available if (result.invalidSql) { additionalData.invalidSql = result.invalidSql; } throw new ApiError(errorMessage, 400, result.error.code, additionalData); } // Check for misleading query type if (result.type === AskResultType.MISLEADING_QUERY) { throw new ApiError( result.intentReasoning || Errors.errorMessages[Errors.GeneralErrorCodes.NON_SQL_QUERY], 400, Errors.GeneralErrorCodes.NON_SQL_QUERY, ); } // Check for general type response if (result.type === AskResultType.GENERAL) { throw new ApiError( result.intentReasoning || Errors.errorMessages[Errors.GeneralErrorCodes.NON_SQL_QUERY], 400, Errors.GeneralErrorCodes.NON_SQL_QUERY, { explanationQueryId: taskQueryId }, ); } }; /** * Validates the summary generation result and checks for errors * @param result The summary result to validate * @throws ApiError if the result has errors or is in a failed state */ export const validateSummaryResult = (result: TextBasedAnswerResult): void => { // Check for errors or failed status if (result.status === TextBasedAnswerStatus.FAILED || result.error) { throw new ApiError( result.error?.message || 'Failed to generate summary', 400, Errors.GeneralErrorCodes.INTERNAL_SERVER_ERROR, ); } // Verify that the status is succeeded if (result.status !== TextBasedAnswerStatus.SUCCEEDED) { throw new ApiError('Summary generation is still in progress', 500); } }; export const transformHistoryInput = (histories: ApiHistory[]) => { if (!histories) { return []; } const validApiTypes = [ ApiType.GENERATE_SQL, ApiType.ASK, ApiType.STREAM_GENERATE_SQL, ApiType.STREAM_ASK, ]; return histories .filter( (history) => validApiTypes.includes(history.apiType) && history.responsePayload?.sql && history.requestPayload?.question, ) .map((history) => ({ question: history.requestPayload?.question, sql: history.responsePayload?.sql, })); }; /** * Validates SQL syntax and compatibility with the project's manifest. * Throws an ApiError if the SQL is invalid or cannot be previewed. * @param sql The SQL string to validate * @param project The project object (must have id) * @param deployService The deployment service instance * @param queryService The query service instance */ export const validateSql = async ( sql: string, project: any, deployService: any, queryService: any, ) => { const lastDeployment = await deployService.getLastDeployment(project.id); const manifest = lastDeployment.manifest; try { await queryService.preview(sql, { manifest, project, dryRun: true, }); } catch (err: any) { throw new ApiError( err.message || 'Invalid SQL', 400, Errors.GeneralErrorCodes.INVALID_SQL_ERROR, ); } }; /** * Common error class for API endpoints */ export class ApiError extends Error { statusCode: number; code?: Errors.GeneralErrorCodes; additionalData?: Record; constructor( message: string, statusCode: number, code?: Errors.GeneralErrorCodes, additionalData?: Record, ) { super(message); this.statusCode = statusCode; this.code = code; this.additionalData = additionalData; } } /** * Common response handler for API endpoints that also logs to API history */ export const respondWith = async ({ res, statusCode, responsePayload, projectId, apiType, threadId, headers, requestPayload, startTime, }: { res: NextApiResponse; statusCode: number; responsePayload: any; projectId: number; apiType: ApiType; startTime: number; requestPayload?: Record; threadId?: string; headers?: Record; }) => { const durationMs = startTime ? Date.now() - startTime : undefined; const responseId = uuidv4(); await apiHistoryRepository.createOne({ id: responseId, projectId, apiType, threadId, headers, requestPayload, responsePayload, statusCode, durationMs, }); return res.status(statusCode).json({ id: responseId, ...responsePayload, }); }; /** * Simple response handler for API endpoints that don't need responseId or threadId * Used for simple CRUD operations like instructions */ export const respondWithSimple = async ({ res, statusCode, responsePayload, projectId, apiType, headers, requestPayload, startTime, }: { res: NextApiResponse; statusCode: number; responsePayload: any; projectId: number; apiType: ApiType; startTime: number; requestPayload?: Record; headers?: Record; }) => { const durationMs = startTime ? Date.now() - startTime : undefined; const responseId = uuidv4(); await apiHistoryRepository.createOne({ id: responseId, projectId, apiType, headers, requestPayload, responsePayload, statusCode, durationMs, }); return res.status(statusCode).json(responsePayload); }; /** * Common error handler for API endpoints */ export const handleApiError = async ({ error, res, projectId, apiType, requestPayload, threadId, headers, startTime, logger, }: { error: any; res: NextApiResponse; projectId?: number; apiType: ApiType; requestPayload?: Record; threadId?: string; headers?: Record; startTime: number; logger?: any; }) => { if (logger) { logger.error(`Error in ${apiType} API:`, error); } const statusCode = error instanceof ApiError ? error.statusCode : 500; let responsePayload: Record; if (error instanceof ApiError && error.code) { responsePayload = { code: error.code, error: error.message, }; // Include any additional data associated with the error if (error.additionalData) { Object.assign(responsePayload, error.additionalData); } } else { responsePayload = { error: error.message }; } await respondWith({ res, statusCode, responsePayload, projectId: projectId || 0, apiType, startTime, requestPayload, threadId, headers, }); }; ================================================ FILE: wren-ui/src/apollo/server/utils/dataUtils.ts ================================================ import { ColumnMetadata } from '@server/services/queryService'; /** * Transform raw data (columns + rows) into an array of objects * @param columns Column metadata (name, type) * @param rows Raw data rows * @returns Array of objects with column names as keys */ export const transformToObjects = ( columns: ColumnMetadata[], rows: any[][], ): Record[] => { if (!rows || !columns || rows.length === 0 || columns.length === 0) { return []; } // throw an error if the number of columns in the rows does not match the number of columns in the columns array if (rows[0].length !== columns.length) { throw new Error( 'Number of columns in the rows does not match the number of columns in the columns array', ); } return rows.map((row) => { const obj: Record = {}; columns.forEach((col, index) => { obj[col.name] = row[index]; }); return obj; }); }; ================================================ FILE: wren-ui/src/apollo/server/utils/docker.ts ================================================ export const toDockerHost = (host: string) => { // if host is localhost or 127.0.0.1, rewrite it to docker.for.{platform}.localhost if (host === 'localhost' || host === '127.0.0.1') { const platform = process.platform; switch (platform) { case 'darwin': return 'docker.for.mac.localhost'; case 'linux': return 'docker.for.linux.localhost'; default: // windows and others... return 'host.docker.internal'; } } return host; }; ================================================ FILE: wren-ui/src/apollo/server/utils/encode.ts ================================================ export function toBase64(str: string): string { return Buffer.from(str).toString('base64'); } ================================================ FILE: wren-ui/src/apollo/server/utils/encryptor.ts ================================================ import crypto from 'crypto'; export interface encryptOptions { password: string; salt: string; iteration?: number; keyLength?: number; algorithm?: string; separator?: string; } export class Encryptor { private readonly ENCRYPTION_PASSWORD: string; private readonly ENCRYPTION_SALT: string; private ENCRYPTION_ITERATION = 1000; private ENCRYPTION_KEY_LENGTH = 256 / 8; // in bytes private ENCRYPTION_ALGORITHM = 'aes-256-cbc'; private ENCRYPTION_SEPARATOR = ':'; constructor({ encryptionPassword, encryptionSalt, }: { encryptionPassword: string; encryptionSalt: string; }) { this.ENCRYPTION_PASSWORD = encryptionPassword; this.ENCRYPTION_SALT = encryptionSalt; } public encrypt(credentials: JSON) { const credentialsString = JSON.stringify(credentials); const key = this.createSecretKey(); const iv = crypto.randomBytes(16); // AES block size const cipher = crypto.createCipheriv(this.ENCRYPTION_ALGORITHM, key, iv); const encrypted = Buffer.concat([ cipher.update(credentialsString, 'utf8'), cipher.final(), ]); return ( iv.toString('base64') + this.ENCRYPTION_SEPARATOR + encrypted.toString('base64') ); } public decrypt(encryptedText: string) { const [ivBase64, encryptedBase64] = encryptedText.split( this.ENCRYPTION_SEPARATOR, ); const iv = Buffer.from(ivBase64, 'base64'); const encrypted = Buffer.from(encryptedBase64, 'base64'); const key = this.createSecretKey(); const decipher = crypto.createDecipheriv( this.ENCRYPTION_ALGORITHM, key, iv, ); const decrypted = Buffer.concat([ decipher.update(encrypted), decipher.final(), ]); return decrypted.toString('utf8'); } private createSecretKey() { return crypto.pbkdf2Sync( this.ENCRYPTION_PASSWORD, this.ENCRYPTION_SALT, this.ENCRYPTION_ITERATION, this.ENCRYPTION_KEY_LENGTH, 'sha512', ); } } ================================================ FILE: wren-ui/src/apollo/server/utils/error.ts ================================================ import { GraphQLError } from 'graphql'; import { WrenService } from '../telemetry/telemetry'; export enum GeneralErrorCodes { INTERNAL_SERVER_ERROR = 'INTERNAL_SERVER_ERROR', // AI service errors NO_RELEVANT_DATA = 'NO_RELEVANT_DATA', NO_RELEVANT_SQL = 'NO_RELEVANT_SQL', RESOURCE_NOT_FOUND = 'RESOURCE_NOT_FOUND', MDL_PARSE_ERROR = 'MDL_PARSE_ERROR', NO_CHART = 'NO_CHART', // Exception error for AI service (e.g., network connection error) AI_SERVICE_UNDEFINED_ERROR = 'OTHERS', // IBIS Error IBIS_SERVER_ERROR = 'IBIS_SERVER_ERROR', // Connector errors CONNECTION_ERROR = 'CONNECTION_ERROR', // duckdb INIT_SQL_ERROR = 'INIT_SQL_ERROR', SESSION_PROPS_ERROR = 'SESSION_PROPS_ERROR', // postgres CONNECTION_REFUSED = 'CONNECTION_REFUSED', // calculated field validation DUPLICATED_FIELD_NAME = 'DUPLICATED_FIELD_NAME', INVALID_EXPRESSION = 'INVALID_EXPRESSION', INVALID_CALCULATED_FIELD = 'INVALID_CALCULATED_FIELD', // when createing views INVALID_VIEW_CREATION = 'INVALID_VIEW_CREATION', // dry run error DRY_RUN_ERROR = 'DRY_RUN_ERROR', DRY_PLAN_ERROR = 'DRY_PLAN_ERROR', // deploy sql pair error DEPLOY_SQL_PAIR_ERROR = 'DEPLOY_SQL_PAIR_ERROR', GENERATE_QUESTIONS_ERROR = 'GENERATE_QUESTIONS_ERROR', INVALID_SQL_ERROR = 'INVALID_SQL_ERROR', // wren engine error WREN_ENGINE_ERROR = 'WREN_ENGINE_ERROR', // asking task error // when rerun from cancelled, the task is identified as general or misleading query IDENTIED_AS_GENERAL = 'IDENTIED_AS_GENERAL', IDENTIED_AS_MISLEADING_QUERY = 'IDENTIED_AS_MISLEADING_QUERY', DEPLOY_TIMEOUT_ERROR = 'DEPLOY_TIMEOUT_ERROR', // api error NON_SQL_QUERY = 'NON_SQL_QUERY', NO_DEPLOYMENT_FOUND = 'NO_DEPLOYMENT_FOUND', // vega schema error FAILED_TO_GENERATE_VEGA_SCHEMA = 'FAILED_TO_GENERATE_VEGA_SCHEMA', POLLING_TIMEOUT = 'POLLING_TIMEOUT', // sql execution error SQL_EXECUTION_ERROR = 'SQL_EXECUTION_ERROR', } export const errorMessages = { [GeneralErrorCodes.INTERNAL_SERVER_ERROR]: 'Internal server error', // AI service errors [GeneralErrorCodes.NO_RELEVANT_DATA]: "I can't find the exact data you're looking for, but feel free to ask about other available topics.", [GeneralErrorCodes.NO_RELEVANT_SQL]: "Could you please provide more details or specify the information you're seeking?", [GeneralErrorCodes.NO_CHART]: "The chart couldn't be generated this time. Please try regenerating the chart or rephrasing your question for better results.", // Connector errors [GeneralErrorCodes.CONNECTION_ERROR]: 'Can not connect to data source', // duckdb [GeneralErrorCodes.INIT_SQL_ERROR]: 'The initializing SQL seems to be invalid, Please check your SQL and try again.', [GeneralErrorCodes.SESSION_PROPS_ERROR]: 'The session properties seem to be invalid, Please check your session properties and try again.', // postgres [GeneralErrorCodes.CONNECTION_REFUSED]: 'Connection refused by the server, Please check your connection settings and try again.', // ibis service errors [GeneralErrorCodes.IBIS_SERVER_ERROR]: 'Error occurred while querying ibis server, please try again later.', // calculated field validation [GeneralErrorCodes.DUPLICATED_FIELD_NAME]: 'This field name already exists', [GeneralErrorCodes.INVALID_EXPRESSION]: 'Invalid expression, please check your expression and try again.', [GeneralErrorCodes.INVALID_CALCULATED_FIELD]: 'Can not execute a query when using this calculated field', // when createing views [GeneralErrorCodes.INVALID_VIEW_CREATION]: 'Invalid view creation', // dry run error [GeneralErrorCodes.DRY_RUN_ERROR]: 'Dry run sql statement error', [GeneralErrorCodes.DRY_PLAN_ERROR]: 'Dry plan error', // deploy sql pair error [GeneralErrorCodes.DEPLOY_SQL_PAIR_ERROR]: 'Deploy sql pair error', [GeneralErrorCodes.GENERATE_QUESTIONS_ERROR]: 'Generate questions error', [GeneralErrorCodes.INVALID_SQL_ERROR]: 'Invalid SQL, please check your SQL syntax', // asking task error [GeneralErrorCodes.IDENTIED_AS_GENERAL]: 'The question is identified as a general question, please follow-up ask with more specific questions.', [GeneralErrorCodes.IDENTIED_AS_MISLEADING_QUERY]: 'The question is identified as a misleading query, please follow-up ask with more specific questions.', [GeneralErrorCodes.DEPLOY_TIMEOUT_ERROR]: 'LLM deployment timed out after 30 seconds', // api error [GeneralErrorCodes.NON_SQL_QUERY]: 'Cannot generate SQL from this question.', [GeneralErrorCodes.NO_DEPLOYMENT_FOUND]: 'No deployment found, please deploy your project first', // vega schema error [GeneralErrorCodes.FAILED_TO_GENERATE_VEGA_SCHEMA]: 'Failed to generate Vega spec', [GeneralErrorCodes.POLLING_TIMEOUT]: 'Polling timeout', // sql execution error [GeneralErrorCodes.SQL_EXECUTION_ERROR]: 'SQL execution error', }; export const shortMessages = { [GeneralErrorCodes.INTERNAL_SERVER_ERROR]: 'Internal server error', [GeneralErrorCodes.NO_RELEVANT_DATA]: 'Try a different query', [GeneralErrorCodes.NO_RELEVANT_SQL]: 'Clarification needed', [GeneralErrorCodes.NO_CHART]: 'Chart not available', [GeneralErrorCodes.CONNECTION_ERROR]: 'Failed to connect', [GeneralErrorCodes.IBIS_SERVER_ERROR]: 'Data connection error', [GeneralErrorCodes.INIT_SQL_ERROR]: 'Invalid initializing SQL', [GeneralErrorCodes.SESSION_PROPS_ERROR]: 'Invalid session properties', [GeneralErrorCodes.CONNECTION_REFUSED]: 'Connection refused', [GeneralErrorCodes.DUPLICATED_FIELD_NAME]: 'Duplicated field name', [GeneralErrorCodes.INVALID_EXPRESSION]: 'Invalid expression', [GeneralErrorCodes.INVALID_CALCULATED_FIELD]: 'Invalid calculated field', [GeneralErrorCodes.INVALID_VIEW_CREATION]: 'Invalid view creation', [GeneralErrorCodes.DRY_RUN_ERROR]: 'Dry run sql statement error', [GeneralErrorCodes.DRY_PLAN_ERROR]: 'Dry plan error', [GeneralErrorCodes.DEPLOY_SQL_PAIR_ERROR]: 'Deploy sql pair error', [GeneralErrorCodes.GENERATE_QUESTIONS_ERROR]: 'Generate questions error', [GeneralErrorCodes.INVALID_SQL_ERROR]: 'Invalid SQL, please check your SQL syntax', [GeneralErrorCodes.IDENTIED_AS_GENERAL]: 'Identified as general question', [GeneralErrorCodes.IDENTIED_AS_MISLEADING_QUERY]: 'Identified as misleading query', [GeneralErrorCodes.DEPLOY_TIMEOUT_ERROR]: 'LLM deployment timed out', [GeneralErrorCodes.NON_SQL_QUERY]: 'Cannot generate SQL from this question.', [GeneralErrorCodes.NO_DEPLOYMENT_FOUND]: 'No deployment found, please deploy your project first', [GeneralErrorCodes.FAILED_TO_GENERATE_VEGA_SCHEMA]: 'Failed to generate Vega spec', [GeneralErrorCodes.POLLING_TIMEOUT]: 'Polling timeout', [GeneralErrorCodes.SQL_EXECUTION_ERROR]: 'SQL execution error', }; export const create = ( code?: GeneralErrorCodes, options?: { customMessage?: string; originalError?: Error; service?: WrenService; other?: any; }, ): GraphQLError => { const { customMessage, originalError, service } = options || {}; // Default to INTERNAL_SERVER_ERROR if no code is provided code = code || GeneralErrorCodes.INTERNAL_SERVER_ERROR; // Get the error message based on the code const message = customMessage || originalError?.message || errorMessages[code] || errorMessages[GeneralErrorCodes.INTERNAL_SERVER_ERROR]; // Return the GraphQLError const err = new GraphQLError(message, { extensions: { originalError, code, message, service, shortMessage: shortMessages[code] || shortMessages[GeneralErrorCodes.INTERNAL_SERVER_ERROR], other: options?.other, }, }); return err; }; /** * Default error handler for Apollo Server * For error like this: * [GraphQLError: connect ECONNREFUSED 127.0.0.1:8080] { * locations: [ { line: 2, column: 3 } ], * path: [ 'previewData' ], * extensions: { * code: 'INTERNAL_SERVER_ERROR', * exception: { * port: 8080, * address: '127.0.0.1', * syscall: 'connect', * code: 'ECONNREFUSED', * errno: -61, * message: 'connect ECONNREFUSED 127.0.0.1:8080', * stack: 'Error: connect ECONNREFUSED 127.0.0.1:8080\n' + * ' at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1278:16)', * name: 'Error', * config: [Object], * request: [Writable], * stacktrace: [Array] * } * } * } * it will easily cause `Converting circular structure to JSON` error. * Thus, we only pick required fields to reformat the error. */ export const defaultApolloErrorHandler = (error: GraphQLError) => { if (error instanceof GraphQLError) { const code = (error.extensions?.code || GeneralErrorCodes.INTERNAL_SERVER_ERROR) as GeneralErrorCodes; return { locations: error.locations, path: error.path, message: error.message, extensions: { code, message: error.message, shortMessage: shortMessages[code], stacktrace: error.extensions?.exception?.stacktrace, other: error.extensions?.other, }, }; } // Return the original error if it's not a GraphQLError return error; }; ================================================ FILE: wren-ui/src/apollo/server/utils/helper.ts ================================================ /** * @function * @description Retrieve json without error */ export const safeParseJson = (data) => { try { return JSON.parse(data); } catch (_e) { return false; } }; export const safeStringify = (data) => { if (typeof data === 'string') { return data; } try { return JSON.stringify(data); } catch (_e) { return data; } }; export const convertColumnType = (parent: { type: string }) => { return parent.type.includes('STRUCT') ? 'RECORD' : parent.type; }; ================================================ FILE: wren-ui/src/apollo/server/utils/index.ts ================================================ export * from './logger'; export * from './encryptor'; export * from './encode'; export * from './string'; export * from './docker'; export * from './model'; export * from './helper'; export * from './regex'; export * from './sseTypes'; export * from './sseUtils'; ================================================ FILE: wren-ui/src/apollo/server/utils/knex.ts ================================================ interface KnexOptions { dbType: string; pgUrl?: string; debug?: boolean; sqliteFile?: string; } export const bootstrapKnex = (options: KnexOptions) => { if (options.dbType === 'pg') { const { pgUrl, debug } = options; console.log('using pg'); /* eslint-disable @typescript-eslint/no-var-requires */ return require('knex')({ client: 'pg', connection: pgUrl, debug, pool: { min: 2, max: 10 }, }); } else { console.log('using sqlite'); /* eslint-disable @typescript-eslint/no-var-requires */ return require('knex')({ client: 'better-sqlite3', connection: { filename: options.sqliteFile, }, useNullAsDefault: true, }); } }; ================================================ FILE: wren-ui/src/apollo/server/utils/logger.ts ================================================ export { getLogger } from 'log4js'; ================================================ FILE: wren-ui/src/apollo/server/utils/model.ts ================================================ import { IModelColumnRepository, ModelColumn, ModelNestedColumn, } from '@server/repositories'; import { replaceAllowableSyntax } from './regex'; import { CompactColumn } from '@server/services/metadataService'; export function getPreviewColumnsStr(modelColumns: ModelColumn[]) { if (modelColumns.length === 0) return '*'; const columns = modelColumns.map((column) => `"${column.referenceName}"`); return columns.join(','); } export function transformInvalidColumnName(columnName: string) { let referenceName = replaceAllowableSyntax(columnName); // If the reference name does not start with a letter, add a prefix const startWithLetterRegex = /^[A-Za-z]/; if (!startWithLetterRegex.test(referenceName)) { referenceName = `col_${referenceName}`; } return referenceName; } export function replaceInvalidReferenceName(referenceName: string) { // replace dot with underscore return referenceName.replace(/\./g, '_'); } export function findColumnsToUpdate( columns: string[], existingColumns: ModelColumn[], sourceTableColumns: CompactColumn[], ): { toDeleteColumnIds: number[]; toCreateColumns: string[]; toUpdateColumns: Array<{ id: number; sourceColumnName: string; type: string; }>; } { const toDeleteColumnIds = existingColumns .map(({ id, sourceColumnName }) => { const shouldKeep = columns.includes(sourceColumnName); return shouldKeep ? undefined : id; }) .filter((id) => id); const existColumnNames = existingColumns.map( ({ sourceColumnName }) => sourceColumnName, ); const toCreateColumns = columns.filter( (columnName) => !existColumnNames.includes(columnName), ); const toUpdateColumns = sourceTableColumns.reduce((acc, sourceColumn) => { const existingColumn = existingColumns.find( (col) => col.sourceColumnName === sourceColumn.name, ); if (!existingColumn) return acc; const columnName = columns.find((col) => col === sourceColumn.name); if (!columnName) return acc; if (sourceColumn.type === existingColumn.type) return acc; return [ ...acc, { id: existingColumn.id, sourceColumnName: sourceColumn.name, type: sourceColumn.type || 'string', }, ]; }, []); return { toDeleteColumnIds, toCreateColumns, toUpdateColumns, }; } export async function updateModelPrimaryKey( repository: IModelColumnRepository, modelId: number, primaryKey: string, ) { await repository.resetModelPrimaryKey(modelId); if (primaryKey) { await repository.setModelPrimaryKey(modelId, primaryKey); } } export function handleNestedColumns( column: CompactColumn, parent: { modelId: number; columnId: number; sourceColumnName: string; columnPath?: string[]; }, ): Partial[] { if (!column.nestedColumns) return []; const nestedColumnValues = []; for (const nestedColumn of column.nestedColumns) { const parentColumnPath = (parent as Partial) .columnPath || [parent.sourceColumnName]; const name = nestedColumn.name.split(`${parent.sourceColumnName}.`)[1]; const columnPath = [...parentColumnPath, name]; const nestedColumnValue = { modelId: parent.modelId, columnId: parent.columnId, columnPath, displayName: nestedColumn.name, sourceColumnName: nestedColumn.name, referenceName: columnPath.map(transformInvalidColumnName).join('.'), type: nestedColumn.type || 'string', properties: nestedColumn.properties, } as Partial; nestedColumnValues.push(nestedColumnValue); nestedColumnValues.push( ...handleNestedColumns(nestedColumn, { modelId: parent.modelId, columnId: parent.columnId, sourceColumnName: nestedColumn.name, columnPath, }), ); } return nestedColumnValues; } ================================================ FILE: wren-ui/src/apollo/server/utils/regex.ts ================================================ export interface ValidationResult { valid: boolean; message: string | null; } export function validateDisplayName(displayName: string): ValidationResult { let message = null; let valid = true; const allowableSyntaxRegex = /^[A-Za-z0-9 !@#$%^&*()_+{}[\],.'"-]*$/; const syntaxValid = allowableSyntaxRegex.test(displayName); if (!syntaxValid) { valid = false; message = 'Only space & [ a-z, A-Z, 0-9, _, -, !@#$%^&*()-+{}[]\'"., ] are allowed.'; } const startWithLetterRegex = /^[A-Za-z]/; const startWithLetterValid = startWithLetterRegex.test(displayName); if (!startWithLetterValid) { valid = false; message = 'Must start with a letter.'; } return { valid, message, }; } export function replaceAllowableSyntax(str: string) { const replacedStr = str.replace(/[!@#$%^&*()+{}[\]'",. -]/g, '_'); return replacedStr; } ================================================ FILE: wren-ui/src/apollo/server/utils/sqlFormat.ts ================================================ import { format, FormatOptionsWithLanguage } from 'sql-formatter'; import { getLogger } from './logger'; const logger = getLogger('SQL Format'); export function safeFormatSQL( sql: string, options?: FormatOptionsWithLanguage, ): string { try { return format(sql, options); } catch (err) { try { logger.debug(`Fallback to Trino dialect for SQL formatting...`); // Try using Trino as the fallback dialect return format(sql, { ...options, language: 'trino' }); } catch (_fallbackError) { logger.error(`Failed to format SQL: ${err.message}`); return sql; } } } ================================================ FILE: wren-ui/src/apollo/server/utils/sseTypes.ts ================================================ // Server-Sent Events (SSE) types for real-time streaming APIs export enum EventType { MESSAGE_START = 'message_start', MESSAGE_STOP = 'message_stop', STATE = 'state', CONTENT_BLOCK_START = 'content_block_start', CONTENT_BLOCK_DELTA = 'content_block_delta', CONTENT_BLOCK_STOP = 'content_block_stop', ERROR = 'error', } export enum StateType { SQL_GENERATION_START = 'sql_generation_start', SQL_GENERATION_UNDERSTANDING = 'sql_generation_understanding', SQL_GENERATION_SEARCHING = 'sql_generation_searching', SQL_GENERATION_PLANNING = 'sql_generation_planning', SQL_GENERATION_GENERATING = 'sql_generation_generating', SQL_GENERATION_CORRECTING = 'sql_generation_correcting', SQL_GENERATION_FINISHED = 'sql_generation_finished', SQL_GENERATION_FAILED = 'sql_generation_failed', SQL_GENERATION_STOPPED = 'sql_generation_stopped', SQL_GENERATION_SUCCESS = 'sql_generation_success', SQL_EXECUTION_START = 'sql_execution_start', SQL_EXECUTION_END = 'sql_execution_end', } export enum ContentBlockContentType { SUMMARY_GENERATION = 'summary_generation', EXPLANATION = 'explanation', } // Interfaces for request and events export interface AsyncAskRequest { question: string; sampleSize?: number; language?: string; threadId?: string; } export interface BaseEvent { timestamp: number; } export interface MessageStartEvent extends BaseEvent { type: EventType.MESSAGE_START; } export interface MessageStopEvent extends BaseEvent { type: EventType.MESSAGE_STOP; data: { threadId: string; duration: number; }; } export interface StateEvent extends BaseEvent { type: EventType.STATE; data: { state: StateType; [key: string]: any; }; } export interface ContentBlockStartEvent extends BaseEvent { type: EventType.CONTENT_BLOCK_START; content_block: { type: 'text'; name: ContentBlockContentType; }; } export interface ContentBlockDeltaEvent extends BaseEvent { type: EventType.CONTENT_BLOCK_DELTA; delta: { type: 'text_delta'; text: string; }; } export interface ContentBlockStopEvent extends BaseEvent { type: EventType.CONTENT_BLOCK_STOP; } export interface ErrorEvent extends BaseEvent { type: EventType.ERROR; data: { error: string; code?: string; }; } export type StreamEvent = | MessageStartEvent | MessageStopEvent | StateEvent | ContentBlockStartEvent | ContentBlockDeltaEvent | ContentBlockStopEvent | ErrorEvent; ================================================ FILE: wren-ui/src/apollo/server/utils/sseUtils.ts ================================================ import { NextApiResponse } from 'next'; import { AskResultStatus } from '@/apollo/server/models/adaptor'; import { EventType, StateType, StreamEvent, StateEvent, ErrorEvent, MessageStartEvent, MessageStopEvent, } from './sseTypes'; /** * Send SSE event to client */ export const sendSSEEvent = (res: NextApiResponse, event: StreamEvent) => { const eventData = `data: ${JSON.stringify(event)}\n\n`; res.write(eventData); }; /** * Send message start event to client */ export const sendMessageStart = (res: NextApiResponse) => { const messageStartEvent: MessageStartEvent = { type: EventType.MESSAGE_START, timestamp: Date.now(), }; sendSSEEvent(res, messageStartEvent); }; /** * Send message stop event to client */ export const sendMessageStop = ( res: NextApiResponse, threadId: string, duration: number, ) => { const messageStopEvent: MessageStopEvent = { type: EventType.MESSAGE_STOP, data: { threadId, duration, }, timestamp: Date.now(), }; sendSSEEvent(res, messageStopEvent); }; /** * Send state update to client */ export const sendStateUpdate = ( res: NextApiResponse, state: StateType, data?: any, ) => { const stateEvent: StateEvent = { type: EventType.STATE, data: { state, ...data, }, timestamp: Date.now(), }; sendSSEEvent(res, stateEvent); }; /** * Send error to client */ export const sendError = ( res: NextApiResponse, error: string, code?: string, additionalData?: Record, ) => { const errorEvent: ErrorEvent = { type: EventType.ERROR, data: { error, code, ...additionalData, }, timestamp: Date.now(), }; sendSSEEvent(res, errorEvent); }; /** * Transform AskResultStatus to descriptive SQL generation state */ export const getSqlGenerationState = (status: AskResultStatus): StateType => { switch (status) { case AskResultStatus.UNDERSTANDING: return StateType.SQL_GENERATION_UNDERSTANDING; case AskResultStatus.SEARCHING: return StateType.SQL_GENERATION_SEARCHING; case AskResultStatus.PLANNING: return StateType.SQL_GENERATION_PLANNING; case AskResultStatus.GENERATING: return StateType.SQL_GENERATION_GENERATING; case AskResultStatus.CORRECTING: return StateType.SQL_GENERATION_CORRECTING; case AskResultStatus.FINISHED: return StateType.SQL_GENERATION_FINISHED; case AskResultStatus.FAILED: return StateType.SQL_GENERATION_FAILED; case AskResultStatus.STOPPED: return StateType.SQL_GENERATION_STOPPED; default: return StateType.SQL_GENERATION_UNDERSTANDING; } }; /** * End the SSE stream with message stop event */ export const endStream = ( res: NextApiResponse, threadId: string, startTime: number, ) => { // Send message stop event sendMessageStop(res, threadId, Date.now() - startTime); res.end(); }; ================================================ FILE: wren-ui/src/apollo/server/utils/string.ts ================================================ export const trim = (str: string) => str.replace(/^\s+|\s+$/g, ''); ================================================ FILE: wren-ui/src/apollo/server/utils/tests/dataSource.test.ts ================================================ import { encryptConnectionInfo } from '../../dataSource'; import { DataSourceName } from '../../types'; import { BIG_QUERY_CONNECTION_INFO, DUCKDB_CONNECTION_INFO, MYSQL_CONNECTION_INFO, POSTGRES_CONNECTION_INFO, } from '../../repositories'; import { Encryptor } from '@server/utils/encryptor'; jest.mock('@server/utils/encryptor'); const mockedEncryptor = Encryptor as jest.MockedClass; describe('Encryptor', () => { beforeEach(() => { mockedEncryptor.prototype.decrypt.mockReturnValue('decrypted string'); mockedEncryptor.prototype.encrypt.mockReturnValue('encrypted string'); }); it('should encrypt sensitive connection info for BigQuery connection info', async () => { const connectionInfo = { credentials: 'some-credentials', datasetId: 'my-bq-dataset-id', projectId: 'my-bq-project-id', } as BIG_QUERY_CONNECTION_INFO; const encryptedConnectionInfo = await encryptConnectionInfo( DataSourceName.BIG_QUERY, connectionInfo, ); expect(encryptedConnectionInfo).toEqual({ credentials: 'encrypted string', datasetId: 'my-bq-dataset-id', projectId: 'my-bq-project-id', }); }); it('should encrypt sensitive connection info for Postgres connection info', async () => { const connectionInfo = { host: 'localhost', port: 5432, database: 'my-database', user: 'my-user', password: 'my-password', ssl: false, } as POSTGRES_CONNECTION_INFO; const encryptedConnectionInfo = await encryptConnectionInfo( DataSourceName.POSTGRES, connectionInfo, ); expect(encryptedConnectionInfo).toEqual({ host: 'localhost', port: 5432, database: 'my-database', user: 'my-user', password: 'encrypted string', ssl: false, }); }); it('should encrypt sensitive connection info for MySQL connection info', async () => { const connectionInfo = { host: 'localhost', port: 5432, database: 'my-database', user: 'my-user', password: 'my-password', } as MYSQL_CONNECTION_INFO; const encryptedConnectionInfo = await encryptConnectionInfo( DataSourceName.MYSQL, connectionInfo, ); expect(encryptedConnectionInfo).toEqual({ host: 'localhost', port: 5432, database: 'my-database', user: 'my-user', password: 'encrypted string', }); }); it('should encrypt sensitive connection info for DuckDB connection info', async () => { const connectionInfo = { initSql: 'some-sql', extensions: ['extension1', 'extension2'], configurations: { key: 'value' }, } as DUCKDB_CONNECTION_INFO; const encryptedConnectionInfo = await encryptConnectionInfo( DataSourceName.DUCKDB, connectionInfo, ); expect(encryptedConnectionInfo).toEqual({ initSql: 'some-sql', extensions: ['extension1', 'extension2'], configurations: { key: 'value' }, }); }); }); ================================================ FILE: wren-ui/src/apollo/server/utils/tests/encryptor.test.ts ================================================ import { Encryptor } from '../encryptor'; import crypto from 'crypto'; jest.mock('crypto', () => ({ randomBytes: jest.fn(), createCipheriv: jest.fn(), createDecipheriv: jest.fn(), pbkdf2Sync: jest.fn(), })); const credentials = { username: 'user', password: 'pass' }; describe('Encryptor', () => { const mockConfig = { encryptionPassword: 'testPassword', encryptionSalt: 'testSalt', }; let encryptor: Encryptor; beforeEach(() => { encryptor = new Encryptor(mockConfig); }); it('should encrypt data correctly', async () => { // Arrange const testData = JSON.parse(JSON.stringify(credentials)); const mockIV = Buffer.from('mockIV'); (crypto.randomBytes as jest.Mock).mockReturnValue(mockIV); const mockCipher = { update: jest.fn().mockReturnValue(Buffer.from('ciphered')), final: jest.fn().mockReturnValue(Buffer.from('finalCiphered')), }; (crypto.createCipheriv as jest.Mock).mockReturnValue(mockCipher); // Act const encryptedData = await encryptor.encrypt(testData); // Assert expect(encryptedData).toContain(Buffer.from('mockIV').toString('base64')); // Basic check, more sophisticated assertions can be made expect(encryptedData).toContain(':'); // contain seperator expect(encryptedData).toContain( Buffer.concat([ Buffer.from('ciphered'), Buffer.from('finalCiphered'), ]).toString('base64'), ); // contain ciphered data expect(crypto.createCipheriv).toHaveBeenCalled(); }); it('should decrypt data correctly', async () => { // Setup const encryptedData = 'mockIV:encryptedData'; const mockDecrypted = Buffer.from(JSON.stringify(credentials)); const mockDecipher = { update: jest.fn().mockReturnValue(mockDecrypted), final: jest.fn().mockReturnValue(Buffer.from('')), }; (crypto.createDecipheriv as jest.Mock).mockReturnValue(mockDecipher); // Act const decryptedData = await encryptor.decrypt(encryptedData); // Assert expect(decryptedData).toEqual(JSON.stringify(credentials)); expect(crypto.createDecipheriv).toHaveBeenCalled(); }); it('should return original data after encrypt and decrypt', async () => { // Setup const testData = JSON.parse('{"username":"user","password":"pass"}'); const mockIV = Buffer.from('mockIV'); (crypto.randomBytes as jest.Mock).mockReturnValue(mockIV); const mockCipher = { update: jest.fn().mockReturnValue(Buffer.from('ciphered')), final: jest.fn().mockReturnValue(Buffer.from('finalCiphered')), }; (crypto.createCipheriv as jest.Mock).mockReturnValue(mockCipher); const mockDecipher = { update: jest.fn().mockReturnValue(Buffer.from(JSON.stringify(testData))), final: jest.fn().mockReturnValue(Buffer.from('')), }; (crypto.createDecipheriv as jest.Mock).mockReturnValue(mockDecipher); // Act const encryptedData = await encryptor.encrypt(testData); const decryptedData = await encryptor.decrypt(encryptedData); // Assert expect(JSON.parse(decryptedData)).toEqual(testData); }); }); ================================================ FILE: wren-ui/src/apollo/server/utils/tests/regex.test.ts ================================================ import { validateDisplayName, replaceAllowableSyntax } from '../regex'; describe('validateDisplayName', () => { it('should return valid when displayName contains only allowable syntax and start with a letter', () => { // Arrange const displayName = 'Valid Display Name !@#$%^&*()_+{}[].,"\''; // Act const result = validateDisplayName(displayName); // Assert expect(result.valid).toBe(true); expect(result.message).toBeNull(); }); it.each([['~'], ['<'], ['\\'], ['>'], ['?']])( 'should return invalid when displayName contains invalid syntax: %s', ([invalidSyntax]) => { // Arrange const displayName = `Invalid Display Name ${invalidSyntax}`; // Act const result = validateDisplayName(displayName); // Assert expect(result.valid).toBe(false); expect(result.message).toBe( 'Only space & [ a-z, A-Z, 0-9, _, -, !@#$%^&*()-+{}[]\'"., ] are allowed.', ); }, ); it.each([['@'], ['1'], [' ']])( 'should return invalid when displayName does not start with a letter', ([invalidSyntax]) => { // Arrange const displayName = `${invalidSyntax}Display Name`; // Act const result = validateDisplayName(displayName); // Assert expect(result.valid).toBe(false); expect(result.message).toBe('Must start with a letter.'); }, ); }); describe('replaceAllowableSyntax', () => { it('should replace allowable syntax characters with underscores', () => { // Arrange const str = 'Replace !@#$%^&*() -+{}[],\'".'; // Act const result = replaceAllowableSyntax(str); // Assert expect(result).toBe('Replace________________________'); expect(result.length).toBe(str.length); }); }); ================================================ FILE: wren-ui/src/apollo/server/utils/timezone.ts ================================================ export function getUTCOffsetMinutes(timeZone: string) { const date = new Date(); const utcDate = new Date( date.toLocaleString('en-US', { timeZone: 'UTC' }), ) as any; const tzDate = new Date(date.toLocaleString('en-US', { timeZone })) as any; return (tzDate - utcDate) / 60000; // Convert to minutes } export function formatUTCOffset(offsetMinutes: number) { const sign = offsetMinutes >= 0 ? '+' : '-'; const absOffset = Math.abs(offsetMinutes); const hours = Math.floor(absOffset / 60) .toString() .padStart(2, '0'); const minutes = (absOffset % 60).toString().padStart(2, '0'); return `UTC${sign}${hours}:${minutes}`; } ================================================ FILE: wren-ui/src/common.ts ================================================ import { getConfig } from '@server/config'; import { bootstrapKnex } from './apollo/server/utils/knex'; import { ProjectRepository, ViewRepository, DeployLogRepository, ThreadRepository, ThreadResponseRepository, ModelRepository, ModelColumnRepository, RelationRepository, SchemaChangeRepository, ModelNestedColumnRepository, LearningRepository, DashboardItemRepository, DashboardRepository, SqlPairRepository, AskingTaskRepository, InstructionRepository, ApiHistoryRepository, DashboardItemRefreshJobRepository, } from '@server/repositories'; import { WrenEngineAdaptor, WrenAIAdaptor, IbisAdaptor, } from '@server/adaptors'; import { DataSourceMetadataService, QueryService, ProjectService, DeployService, AskingService, MDLService, DashboardService, AskingTaskTracker, InstructionService, } from '@server/services'; import { PostHogTelemetry } from './apollo/server/telemetry/telemetry'; import { ProjectRecommendQuestionBackgroundTracker, ThreadRecommendQuestionBackgroundTracker, DashboardCacheBackgroundTracker, } from './apollo/server/backgrounds'; import { SqlPairService } from './apollo/server/services/sqlPairService'; export const serverConfig = getConfig(); export const initComponents = () => { const telemetry = new PostHogTelemetry(); const knex = bootstrapKnex({ dbType: serverConfig.dbType, pgUrl: serverConfig.pgUrl, debug: serverConfig.debug, sqliteFile: serverConfig.sqliteFile, }); // repositories const projectRepository = new ProjectRepository(knex); const deployLogRepository = new DeployLogRepository(knex); const threadRepository = new ThreadRepository(knex); const threadResponseRepository = new ThreadResponseRepository(knex); const viewRepository = new ViewRepository(knex); const modelRepository = new ModelRepository(knex); const modelColumnRepository = new ModelColumnRepository(knex); const modelNestedColumnRepository = new ModelNestedColumnRepository(knex); const relationRepository = new RelationRepository(knex); const schemaChangeRepository = new SchemaChangeRepository(knex); const learningRepository = new LearningRepository(knex); const dashboardRepository = new DashboardRepository(knex); const dashboardItemRepository = new DashboardItemRepository(knex); const sqlPairRepository = new SqlPairRepository(knex); const askingTaskRepository = new AskingTaskRepository(knex); const instructionRepository = new InstructionRepository(knex); const apiHistoryRepository = new ApiHistoryRepository(knex); const dashboardItemRefreshJobRepository = new DashboardItemRefreshJobRepository(knex); // adaptors const wrenEngineAdaptor = new WrenEngineAdaptor({ wrenEngineEndpoint: serverConfig.wrenEngineEndpoint, }); const wrenAIAdaptor = new WrenAIAdaptor({ wrenAIBaseEndpoint: serverConfig.wrenAIEndpoint, }); const ibisAdaptor = new IbisAdaptor({ ibisServerEndpoint: serverConfig.ibisServerEndpoint, }); // services const metadataService = new DataSourceMetadataService({ ibisAdaptor, wrenEngineAdaptor, }); const queryService = new QueryService({ ibisAdaptor, wrenEngineAdaptor, telemetry, }); const deployService = new DeployService({ wrenAIAdaptor, deployLogRepository, telemetry, }); const mdlService = new MDLService({ projectRepository, modelRepository, modelColumnRepository, modelNestedColumnRepository, relationRepository, viewRepository, }); const projectService = new ProjectService({ projectRepository, metadataService, mdlService, wrenAIAdaptor, telemetry, }); const askingTaskTracker = new AskingTaskTracker({ wrenAIAdaptor, askingTaskRepository, threadResponseRepository, viewRepository, }); const askingService = new AskingService({ telemetry, wrenAIAdaptor, deployService, projectService, viewRepository, threadRepository, threadResponseRepository, queryService, mdlService, askingTaskTracker, askingTaskRepository, }); const dashboardService = new DashboardService({ projectService, dashboardItemRepository, dashboardRepository, }); const sqlPairService = new SqlPairService({ sqlPairRepository, wrenAIAdaptor, ibisAdaptor, }); const instructionService = new InstructionService({ instructionRepository, wrenAIAdaptor, }); // background trackers const projectRecommendQuestionBackgroundTracker = new ProjectRecommendQuestionBackgroundTracker({ telemetry, wrenAIAdaptor, projectRepository, }); const threadRecommendQuestionBackgroundTracker = new ThreadRecommendQuestionBackgroundTracker({ telemetry, wrenAIAdaptor, threadRepository, }); const dashboardCacheBackgroundTracker = new DashboardCacheBackgroundTracker({ dashboardRepository, dashboardItemRepository, dashboardItemRefreshJobRepository, projectService, deployService, queryService, }); return { knex, telemetry, // repositories projectRepository, deployLogRepository, threadRepository, threadResponseRepository, viewRepository, modelRepository, modelColumnRepository, relationRepository, schemaChangeRepository, learningRepository, modelNestedColumnRepository, dashboardRepository, dashboardItemRepository, sqlPairRepository, askingTaskRepository, apiHistoryRepository, instructionRepository, dashboardItemRefreshJobRepository, // adaptors wrenEngineAdaptor, wrenAIAdaptor, ibisAdaptor, // services metadataService, projectService, queryService, deployService, askingService, mdlService, dashboardService, sqlPairService, instructionService, askingTaskTracker, // background trackers projectRecommendQuestionBackgroundTracker, threadRecommendQuestionBackgroundTracker, dashboardCacheBackgroundTracker, }; }; // singleton components export const components = initComponents(); ================================================ FILE: wren-ui/src/components/ActionButton.tsx ================================================ import { Button } from 'antd'; import PlusSquareOutlined from '@ant-design/icons/PlusSquareOutlined'; import { MoreIcon } from '@/utils/icons'; interface Props { onClick?: (event: React.MouseEvent) => void; onMouseEnter?: (event: React.MouseEvent) => void; onMouseLeave?: (event: React.MouseEvent) => void; className?: string; marginLeft?: number; marginRight?: number; } const makeActionButton = (icon: React.ReactNode) => (props: Props) => { const { onClick, onMouseEnter, onMouseLeave, className, marginLeft, marginRight, ...restProps } = props; const click = (event) => { onClick && onClick(event); event.stopPropagation(); }; const mouseEnter = (event) => { onMouseEnter && onMouseEnter(event); event.stopPropagation(); }; const mouseLeave = (event) => { onMouseLeave && onMouseLeave(event); event.stopPropagation(); }; return ( } type="warning" /> ); } return
; }; const isAdditionalShow = !!onReload || !!onEdit || !!onPin; return (
{isAdditionalShow && (
{!!onReload && ( )} {!!onEdit && ( )} {!!onPin && ( )}
)} {getChartContent()}
); } ================================================ FILE: wren-ui/src/components/chart/properties/BasicProperties.tsx ================================================ import { capitalize } from 'lodash'; import { Form, Row, Col, Select } from 'antd'; import { ChartType } from '@/apollo/client/graphql/__types__'; export const getChartTypeOptions = () => { return Object.entries(ChartType).map(([key, value]) => ({ label: capitalize(value.replace('_', ' ')), value: key, })); }; export const getColumnOptions = ( columns: { name: string; type: string }[], titleMap?: Record, ) => { return (columns || []).map((column) => ({ label: titleMap?.[column.name] || column.name, value: column.name, })); }; export function ChartTypeProperty(props: { options: { label: string; value: string }[]; }) { const { options } = props; return ( ); } ================================================ FILE: wren-ui/src/components/chart/properties/LineProperties.tsx ================================================ import { Form, Row, Col, Select } from 'antd'; import { PropertiesProps, getChartTypeOptions, getColumnOptions, ChartTypeProperty, AxisProperty, } from './BasicProperties'; export default function LineProperties(props: PropertiesProps) { const { columns, titleMap } = props; const chartTypeOptions = getChartTypeOptions(); const columnOptions = getColumnOptions(columns, titleMap); return ( <> ); } ================================================ FILE: wren-ui/src/components/code/BaseCodeBlock.tsx ================================================ import { useEffect, useRef, useState } from 'react'; import styled from 'styled-components'; import { Button, Typography } from 'antd'; import CheckOutlined from '@ant-design/icons/CheckOutlined'; import CopyOutlined from '@ant-design/icons/CopyOutlined'; import { Loading } from '@/components/PageLoading'; import '@/components/editor/AceEditor'; export interface BaseProps { code: string; copyable?: boolean; inline?: boolean; loading?: boolean; maxHeight?: string; showLineNumbers?: boolean; backgroundColor?: string; onCopy?: () => void; } const getBlockStyles = (props: { inline?: boolean; backgroundColor?: string; }) => { if (props.inline) { return ` display: inline; border: none; background: transparent !important; padding: 0; * { display: inline !important; } `; } return ` background: ${props.backgroundColor || 'var(--gray-1)'} !important; padding: 8px; `; }; export const Block = styled.div<{ maxHeight?: string; inline?: boolean; backgroundColor?: string; }>` position: relative; white-space: pre; font-size: 13px; border: 1px var(--gray-4) solid; border-radius: 4px; font-family: 'Source Code Pro', monospace; user-select: text; cursor: text; &:focus { outline: none; } ${getBlockStyles} .adm-code-wrap { ${(props) => (props.inline ? '' : 'overflow: auto;')} ${(props) => (props.maxHeight ? `max-height: ${props.maxHeight}px;` : ``)} user-select: text; } .adm-code-line { display: block; user-select: text; &-number { user-select: none; display: inline-block; min-width: 14px; text-align: right; margin-right: 1em; color: var(--gray-6); font-weight: 700; font-size: 12px; } } `; export const CopyText = styled(Typography.Text)<{ $hasVScrollbar: boolean }>` position: absolute; top: 0; right: ${(props) => (props.$hasVScrollbar ? '20px' : '0')}; font-size: 0; button { background: var(--gray-1) !important; } .ant-typography-copy { font-size: 12px; } .ant-btn:not(:hover) { color: var(--gray-8); } `; export const addThemeStyleManually = (cssText: string) => { const id = 'ace-tomorrow'; const themeElement = document.getElementById(id); if (!themeElement) { const styleElement = document.createElement('style'); styleElement.id = id; document.head.appendChild(styleElement); styleElement.appendChild(document.createTextNode(cssText)); } }; export const createCodeBlock = (HighlightRules: any) => { return function CodeBlock(props: BaseProps) { const { code, copyable, maxHeight, inline, loading, showLineNumbers, backgroundColor, onCopy, } = props; const { ace } = window as any; const { Tokenizer } = ace.require('ace/tokenizer'); const rules = new HighlightRules(); const tokenizer = new Tokenizer(rules.getRules()); const codeWrapRef = useRef(null); const [hasVerticalScrollbar, setHasVerticalScrollbar] = useState(false); useEffect(() => { const { cssText } = ace.require('ace/theme/tomorrow'); addThemeStyleManually(cssText); }, []); useEffect(() => { const el = codeWrapRef.current; if (!el) return; const hasScroll = el.scrollHeight > el.clientHeight; setHasVerticalScrollbar(hasScroll); }, [code]); const lines = (code || '').split('\n').map((line, index) => { const tokens = tokenizer.getLineTokens(line).tokens; const children = tokens.map((token, index) => { const classNames = token.type.split('.').map((name) => `ace_${name}`); return ( {token.value} ); }); return ( {showLineNumbers && ( {index + 1} )} {children} ); }); const handleKeyDown = (e: React.KeyboardEvent) => { if ((e.metaKey || e.ctrlKey) && e.key === 'a') { e.preventDefault(); const selection = window.getSelection(); const range = document.createRange(); range.selectNodeContents( e.currentTarget.querySelector('.adm-code-wrap') || e.currentTarget, ); selection?.removeAllRanges(); selection?.addRange(range); } }; return (
{lines} {copyable && ( } size="small" style={{ backgroundColor: 'transparent' }} />,
); }; }; ================================================ FILE: wren-ui/src/components/code/JsonCodeBlock.tsx ================================================ import { createCodeBlock, BaseProps } from './BaseCodeBlock'; const JsonCodeBlock = (props: BaseProps) => { const { code, ...rest } = props; const { ace } = window as any; let formattedJson; try { formattedJson = typeof code === 'string' ? code : JSON.stringify(code, null, 2); } catch { console.warn('Failed to format JSON', code); formattedJson = code; } const { JsonHighlightRules } = ace.require('ace/mode/json_highlight_rules'); const BaseCodeBlock = createCodeBlock(JsonHighlightRules); return ; }; export default JsonCodeBlock; ================================================ FILE: wren-ui/src/components/code/SQLCodeBlock.tsx ================================================ import { createCodeBlock, BaseProps } from './BaseCodeBlock'; const SQLCodeBlock = (props: BaseProps) => { const { ace } = window as any; const { SqlHighlightRules } = ace.require('ace/mode/sql_highlight_rules'); const BaseCodeBlock = createCodeBlock(SqlHighlightRules); return ; }; export default SQLCodeBlock; ================================================ FILE: wren-ui/src/components/dataPreview/PreviewData.tsx ================================================ import { memo, useMemo } from 'react'; import { Alert, Typography, Button } from 'antd'; import { ApolloError } from '@apollo/client'; import styled from 'styled-components'; import { getColumnTypeIcon } from '@/utils/columnType'; import PreviewDataContent from '@/components/dataPreview/PreviewDataContent'; import { parseGraphQLError } from '@/utils/errorHandler'; const { Text } = Typography; const StyledCell = styled.div` position: relative; .copy-icon { position: absolute; top: 50%; right: 0; transform: translateY(-50%); opacity: 0; transition: opacity 0.3s; } .ant-typography-copy { margin: -4px; } &:hover .copy-icon { opacity: 1; } `; const ColumnTitle = memo((props: { name: string; type: any }) => { const { name, type } = props; const columnTypeIcon = getColumnTypeIcon({ type }, { title: type }); return ( <> {columnTypeIcon} {name} ); }); const ColumnContext = memo((props: { text: string; copyable: boolean }) => { const { text, copyable } = props; return ( {text} {copyable && ( )} ); }); const getPreviewColumns = (cols, { copyable }) => cols.map(({ name, type }: Record) => { return { dataIndex: name, titleText: name, key: name, ellipsis: true, title: , render: (text) => , onCell: () => ({ style: { lineHeight: '24px' } }), }; }); interface Props { previewData?: { data: Array>; columns: Array<{ name: string; type: string; }>; }; loading: boolean; error?: ApolloError; locale?: { emptyText: React.ReactNode }; copyable?: boolean; } export default function PreviewData(props: Props) { const { previewData, loading, error, locale, copyable = true } = props; const columns = useMemo( () => previewData?.columns && getPreviewColumns(previewData.columns, { copyable }), [previewData?.columns, copyable], ); const hasErrorMessage = error && error.message; if (!loading && hasErrorMessage) { const { message, shortMessage } = parseGraphQLError(error); return ( ); } return ( ); } ================================================ FILE: wren-ui/src/components/dataPreview/PreviewDataContent.tsx ================================================ import { useMemo } from 'react'; import { Table, TableColumnProps } from 'antd'; import { isString } from 'lodash'; const FONT_SIZE = 16; const BASIC_COLUMN_WIDTH = 100; type TableColumn = TableColumnProps & { titleText?: string }; interface Props { columns: TableColumn[]; data: Array; loading: boolean; locale?: { emptyText: React.ReactNode }; } const getValueByValueType = (value: any) => ['boolean', 'object'].includes(typeof value) ? JSON.stringify(value) : value; const convertResultData = (data: Array, columns) => { return data.map((datum: Array, index: number) => { const obj = {}; // should have a unique "key" prop. obj['key'] = index; datum.forEach((value, index) => { const columnName = columns[index].dataIndex; obj[columnName] = getValueByValueType(value); }); return obj; }); }; export default function PreviewDataContent(props: Props) { const { columns = [], data = [], loading, locale } = props; const hasColumns = !!columns.length; const dynamicWidth = useMemo(() => { return columns.reduce((result, column) => { const width = isString(column.titleText || column.title) ? (column.titleText || (column.title as string)).length * FONT_SIZE : BASIC_COLUMN_WIDTH; return result + width; }, 0); }, [columns]); const tableColumns = useMemo(() => { return columns.map((column) => ({ ...column, ellipsis: true, })); }, [columns]); const dataSource = useMemo(() => convertResultData(data, columns), [data]); // https://posthog.com/docs/session-replay/privacy#other-elements return ( ); } ================================================ FILE: wren-ui/src/components/deploy/Context.ts ================================================ import { createContext, useContext } from 'react'; import { DeployStatusQueryHookResult } from '@/apollo/client/graphql/deploy.generated'; type ContextProps = DeployStatusQueryHookResult; export const DeployStatusContext = createContext( {} as ContextProps, ); export function useDeployStatusContext() { return useContext(DeployStatusContext); } ================================================ FILE: wren-ui/src/components/deploy/Deploy.tsx ================================================ import { useEffect } from 'react'; import { Button, Space, Typography, message } from 'antd'; import CheckCircleOutlined from '@ant-design/icons/CheckCircleOutlined'; import LoadingOutlined from '@ant-design/icons/LoadingOutlined'; import WarningOutlined from '@ant-design/icons/WarningOutlined'; import { SyncStatus } from '@/apollo/client/graphql/__types__'; import { useDeployMutation } from '@/apollo/client/graphql/deploy.generated'; import { useDeployStatusContext } from '@/components/deploy/Context'; const { Text } = Typography; const getDeployStatus = (deploying: boolean, status: SyncStatus) => { const syncStatus = deploying ? SyncStatus.IN_PROGRESS : status; return ( { [SyncStatus.IN_PROGRESS]: ( Deploying... ), [SyncStatus.SYNCRONIZED]: ( Synced ), [SyncStatus.UNSYNCRONIZED]: ( Undeployed changes ), }[syncStatus] || '' ); }; export default function Deploy() { const deployContext = useDeployStatusContext(); const { data, loading, startPolling, stopPolling } = deployContext; const [deployMutation, { data: deployResult, loading: deploying }] = useDeployMutation({ onError: (error) => console.error(error), onCompleted: (data) => { if (data.deploy?.status === 'FAILED') { console.error('Failed to deploy - ', data.deploy?.error); message.error( 'Failed to deploy. Please check the log for more details.', ); } }, }); useEffect(() => { // Stop polling deploy status if deploy failed if ( deployResult?.deploy?.status === 'FAILED' && data?.modelSync.status === SyncStatus.UNSYNCRONIZED ) { stopPolling(); } }, [deployResult, data]); const syncStatus = data?.modelSync.status; const onDeploy = () => { deployMutation(); startPolling(1000); }; useEffect(() => { if (syncStatus === SyncStatus.SYNCRONIZED) stopPolling(); }, [syncStatus]); const disabled = deploying || loading || [SyncStatus.SYNCRONIZED, SyncStatus.IN_PROGRESS].includes(syncStatus); return ( {getDeployStatus(deploying, syncStatus)} ); } ================================================ FILE: wren-ui/src/components/diagram/Context.ts ================================================ import { createContext } from 'react'; import { ComposeDiagram } from '@/utils/data'; export interface ClickPayload { [key: string]: any; data: ComposeDiagram; } type ContextProps = { onMoreClick: (data: ClickPayload) => void; onNodeClick: (data: ClickPayload) => void; onAddClick: (data: ClickPayload) => void; } | null; export const DiagramContext = createContext({ onMoreClick: () => {}, onNodeClick: () => {}, onAddClick: () => {}, }); ================================================ FILE: wren-ui/src/components/diagram/CustomDropdown.tsx ================================================ import React from 'react'; import styled from 'styled-components'; import { Dropdown, Menu } from 'antd'; import { ItemType } from 'antd/lib/menu/hooks/useItems'; import { MORE_ACTION, NODE_TYPE } from '@/utils/enum'; import EditOutlined from '@ant-design/icons/EditOutlined'; import ReloadOutlined from '@ant-design/icons/ReloadOutlined'; import EyeInvisibleOutlined from '@ant-design/icons/EyeInvisibleOutlined'; import EyeOutlined from '@ant-design/icons/EyeOutlined'; import CodeFilled from '@ant-design/icons/CodeFilled'; import DatabaseOutlined from '@ant-design/icons/DatabaseOutlined'; import { EditSVG } from '@/utils/svgs'; import { DeleteCalculatedFieldModal, DeleteRelationshipModal, DeleteModelModal, DeleteViewModal, DeleteDashboardItemModal, DeleteQuestionSQLPairModal, DeleteInstructionModal, } from '@/components/modals/DeleteModal'; const StyledMenu = styled(Menu)` .ant-dropdown-menu-item:not(.ant-dropdown-menu-item-disabled) { color: var(--gray-8); } `; interface Props { [key: string]: any; onMoreClick: (type: MORE_ACTION | { type: MORE_ACTION; data: any }) => void; onMenuEnter?: (event: React.MouseEvent) => void; children: React.ReactNode; onDropdownVisibleChange?: (visible: boolean) => void; } const makeDropdown = (getItems: (props: Props) => ItemType[]) => (props: Props) => { const { children, onMenuEnter, onDropdownVisibleChange } = props; const items = getItems(props); return ( e.domEvent.stopPropagation()} items={items} onMouseEnter={onMenuEnter} /> } onVisibleChange={onDropdownVisibleChange} > {children} ); }; export const ModelDropdown = makeDropdown((props: Props) => { const { onMoreClick } = props; const items: ItemType[] = [ { label: ( <> Update Columns ), key: MORE_ACTION.UPDATE_COLUMNS, onClick: () => onMoreClick(MORE_ACTION.UPDATE_COLUMNS), }, { label: ( onMoreClick(MORE_ACTION.DELETE)} /> ), className: 'red-5', key: MORE_ACTION.DELETE, onClick: ({ domEvent }) => domEvent.stopPropagation(), }, ]; return items; }); export const ViewDropdown = makeDropdown((props: Props) => { const { onMoreClick } = props; const items: ItemType[] = [ { label: ( onMoreClick(MORE_ACTION.DELETE)} /> ), className: 'red-5', key: MORE_ACTION.DELETE, onClick: ({ domEvent }) => domEvent.stopPropagation(), }, ]; return items; }); export const ColumnDropdown = makeDropdown((props: Props) => { const { onMoreClick, data } = props; const { nodeType } = data; const DeleteColumnModal = { [NODE_TYPE.CALCULATED_FIELD]: DeleteCalculatedFieldModal, [NODE_TYPE.RELATION]: DeleteRelationshipModal, }[nodeType] || DeleteCalculatedFieldModal; const items: ItemType[] = [ { label: ( <> Edit ), key: MORE_ACTION.EDIT, onClick: () => onMoreClick(MORE_ACTION.EDIT), }, { label: ( onMoreClick(MORE_ACTION.DELETE)} /> ), className: 'red-5', key: MORE_ACTION.DELETE, onClick: ({ domEvent }) => domEvent.stopPropagation(), }, ]; return items; }); export const DashboardDropdown = makeDropdown((props: Props) => { const { onMoreClick, isSupportCached } = props; const items: ItemType[] = [ isSupportCached && { label: ( <> Cache settings ), key: MORE_ACTION.CACHE_SETTINGS, onClick: () => onMoreClick(MORE_ACTION.CACHE_SETTINGS), }, { label: ( <> {isSupportCached ? 'Refresh all caches' : 'Refresh all'} ), key: MORE_ACTION.REFRESH, onClick: () => onMoreClick(MORE_ACTION.REFRESH), }, ].filter(Boolean); return items; }); export const DashboardItemDropdown = makeDropdown((props: Props) => { const { onMoreClick, isHideLegend, isSupportCached } = props; const items: ItemType[] = [ { label: isHideLegend ? ( <> Show categories ) : ( <> {} Hide categories ), key: MORE_ACTION.HIDE_CATEGORY, onClick: () => onMoreClick(MORE_ACTION.HIDE_CATEGORY), }, { label: ( <> {isSupportCached ? 'Refresh cache' : 'Refresh'} ), key: MORE_ACTION.REFRESH, onClick: () => onMoreClick(MORE_ACTION.REFRESH), }, { label: ( onMoreClick(MORE_ACTION.DELETE)} /> ), className: 'red-5', key: MORE_ACTION.DELETE, onClick: ({ domEvent }) => domEvent.stopPropagation(), }, ]; return items; }); export const SQLPairDropdown = makeDropdown( ( props: Props & { onMoreClick: (payload: { type: MORE_ACTION; data: any }) => void; }, ) => { const { onMoreClick, data } = props; const items: ItemType[] = [ { label: ( <> View ), key: MORE_ACTION.VIEW_SQL_PAIR, onClick: () => onMoreClick({ type: MORE_ACTION.VIEW_SQL_PAIR, data, }), }, { label: ( <> Edit ), key: MORE_ACTION.EDIT, onClick: () => onMoreClick({ type: MORE_ACTION.EDIT, data, }), }, { label: ( onMoreClick({ type: MORE_ACTION.DELETE, data, }) } modalProps={{ cancelButtonProps: { autoFocus: true }, }} /> ), className: 'red-5', key: MORE_ACTION.DELETE, onClick: ({ domEvent }) => domEvent.stopPropagation(), }, ]; return items; }, ); export const InstructionDropdown = makeDropdown( ( props: Props & { onMoreClick: (payload: { type: MORE_ACTION; data: any }) => void; }, ) => { const { onMoreClick, data } = props; const items: ItemType[] = [ { label: ( <> View ), key: MORE_ACTION.VIEW_INSTRUCTION, onClick: () => onMoreClick({ type: MORE_ACTION.VIEW_INSTRUCTION, data, }), }, { label: ( <> Edit ), key: MORE_ACTION.EDIT, onClick: () => onMoreClick({ type: MORE_ACTION.EDIT, data, }), }, { label: ( onMoreClick({ type: MORE_ACTION.DELETE, data, }) } modalProps={{ cancelButtonProps: { autoFocus: true }, }} /> ), className: 'red-5', key: MORE_ACTION.DELETE, onClick: ({ domEvent }) => domEvent.stopPropagation(), }, ]; return items; }, ); export const AdjustAnswerDropdown = makeDropdown( ( props: Props & { onMoreClick: (payload: { type: MORE_ACTION; data: any }) => void; }, ) => { const { onMoreClick, data } = props; const items: ItemType[] = [ { label: 'Adjust steps', icon: , disabled: !data.sqlGenerationReasoning, key: 'adjust-steps', onClick: () => onMoreClick({ type: MORE_ACTION.ADJUST_STEPS, data, }), }, { label: 'Adjust SQL', icon: , disabled: !data.sql, key: 'adjust-sql', onClick: () => onMoreClick({ type: MORE_ACTION.ADJUST_SQL, data, }), }, ]; return items; }, ); ================================================ FILE: wren-ui/src/components/diagram/CustomPopover.tsx ================================================ import { Popover, PopoverProps, Row, Col, Typography } from 'antd'; type Props = PopoverProps; export default function CustomPopover(props: Props) { const { children } = props; return ( {children} ); } const CustomPopoverCol = (props: { title: string; children: React.ReactNode; code?: boolean; span?: number; marginBottom?: number; }) => { const { title, children, code, span = 24, marginBottom = 8 } = props; return (
{title}
{children}
); }; CustomPopover.Row = Row; CustomPopover.Col = CustomPopoverCol; ================================================ FILE: wren-ui/src/components/diagram/Marker.tsx ================================================ export default function Marker() { // This is only used to embed definitions which can reused inside an svg image. return ( {/* seleceted */} ); } ================================================ FILE: wren-ui/src/components/diagram/customEdge/ModelEdge.tsx ================================================ import { memo, useMemo } from 'react'; import { BaseEdge, EdgeLabelRenderer, EdgeProps, getSmoothStepPath, } from 'reactflow'; import styled from 'styled-components'; import CustomPopover from '../CustomPopover'; import { getJoinTypeText } from '@/utils/data'; const Joint = styled.div` position: absolute; width: 30px; height: 30px; opacity: 0; `; const ModelEdge = ({ sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, markerStart, markerEnd, data, }: EdgeProps) => { const [edgePath, labelX, labelY] = getSmoothStepPath({ sourceX, sourceY, sourcePosition, targetX, targetY, targetPosition, }); const isPopoverShow = data.highlight; const style = isPopoverShow ? { stroke: 'var(--geekblue-6)', strokeWidth: 1.5, } : { stroke: 'var(--gray-5)' }; const relation = useMemo(() => { const fromField = `${data.relation.fromModelName}.${data.relation.fromColumnName}`; const toField = `${data.relation.toModelName}.${data.relation.toColumnName}`; return { name: data.relation.name, joinType: getJoinTypeText(data.relation.type), description: data.relation?.description || '-', fromField, toField, }; }, [data.relation]); return ( <> {relation.fromField} {relation.toField} {relation.joinType} {relation.description} } > ); }; export default memo(ModelEdge); ================================================ FILE: wren-ui/src/components/diagram/customEdge/index.ts ================================================ export { default as ModelEdge } from './ModelEdge'; ================================================ FILE: wren-ui/src/components/diagram/customNode/Column.tsx ================================================ import React from 'react'; import styled from 'styled-components'; import MarkerHandle from '@/components/diagram/customNode/MarkerHandle'; const NodeColumn = styled.div` position: relative; display: flex; align-items: center; justify-content: space-between; padding: 4px 8px; color: var(--gray-9); line-height: 24px; &:hover { background-color: var(--gray-3); } svg { flex-shrink: 0; } .adm-column-title { display: flex; align-items: center; min-width: 1px; svg { margin-right: 6px; } > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } } `; const Title = styled.div` display: flex; justify-content: space-between; align-items: center; color: var(--gray-8); padding: 4px 12px; cursor: default; `; type ColumnProps = { id: number | string; type: string; displayName: string; style?: React.CSSProperties; icon: React.ReactNode; extra?: React.ReactNode; onMouseEnter?: (event: React.MouseEvent) => void; onMouseLeave?: (event: React.MouseEvent) => void; }; type ColumnTitleProps = { show: boolean; extra?: React.ReactNode; children: React.ReactNode; }; export default function Column(props: ColumnProps) { const { id, type, onMouseEnter, onMouseLeave, displayName, style = {}, icon, extra, } = props; const nodeColumn = (
{icon} {displayName}
{extra}
); return nodeColumn; } const MoreColumnTip = (props: { count: number }) => { return
and {props.count} more
; }; const ColumnTitle = (props: ColumnTitleProps) => { const { show, extra, children } = props; if (!show) return null; return ( {children} <span>{extra}</span> ); }; Column.Title = ColumnTitle; Column.MoreTip = MoreColumnTip; ================================================ FILE: wren-ui/src/components/diagram/customNode/MarkerHandle.tsx ================================================ import { Handle, Position } from 'reactflow'; // parent should be position relative export default function MarkerHandle({ id }: { id: string }) { return ( <> {/* all handlers */} ); } ================================================ FILE: wren-ui/src/components/diagram/customNode/ModelNode.tsx ================================================ import { memo, useCallback, useContext } from 'react'; import { Typography } from 'antd'; import { useReactFlow } from 'reactflow'; import { highlightEdges, highlightNodes, trimId, } from '@/components/diagram/utils'; import { CachedIcon, CustomNodeProps, NodeBody, NodeHeader, StyledNode, } from '@/components/diagram/customNode/utils'; import MarkerHandle from '@/components/diagram/customNode/MarkerHandle'; import { DiagramContext } from '@/components/diagram/Context'; import Column from '@/components/diagram/customNode/Column'; import { PrimaryKeyIcon, ModelIcon } from '@/utils/icons'; import { ComposeDiagram, ComposeDiagramField, DiagramModel, } from '@/utils/data'; import { getColumnTypeIcon } from '@/utils/columnType'; import { makeIterable } from '@/utils/iteration'; import { Config } from '@/utils/diagram'; import { MORE_ACTION, NODE_TYPE } from '@/utils/enum'; import { ModelDropdown, ColumnDropdown, } from '@/components/diagram/CustomDropdown'; import { AddButton, MoreButton } from '@/components/ActionButton'; const { Text } = Typography; export const ModelNode = ({ data }: CustomNodeProps) => { const context = useContext(DiagramContext); const onMoreClick = (type: MORE_ACTION) => { context?.onMoreClick({ type, data: data.originalData, }); }; const onNodeClick = () => { context?.onNodeClick({ data: data.originalData, }); }; const onAddClick = (targetNodeType: NODE_TYPE) => { context?.onAddClick({ targetNodeType, data: data.originalData, }); }; const renderColumns = useCallback( (columns: ComposeDiagramField[]) => getColumns(columns, data, { limit: Config.columnsLimit }), [data.highlight], ); return ( {data.originalData.displayName} Columns {renderColumns(data.originalData.fields)} onAddClick(NODE_TYPE.CALCULATED_FIELD)} /> } > Calculated Fields {renderColumns(data.originalData.calculatedFields)} onAddClick(NODE_TYPE.RELATION)} /> } > Relationships {renderColumns(data.originalData.relationFields)} ); }; export default memo(ModelNode); const ColumnTemplate = (props) => { const { nodeType, id, type, isPrimaryKey, highlight } = props; const isRelationship = nodeType === NODE_TYPE.RELATION; const isCalculatedField = nodeType === NODE_TYPE.CALCULATED_FIELD; const isMoreButtonShow = isCalculatedField || isRelationship; const reactflowInstance = useReactFlow(); const context = useContext(DiagramContext); const onMoreClick = (type: MORE_ACTION) => { context?.onMoreClick({ type, data: props, }); }; const onMouseEnter = useCallback( (_event: React.MouseEvent) => { if (!isRelationship) return; const { getEdges, setEdges, setNodes } = reactflowInstance; const edges = getEdges(); const relatedEdge = edges.find( (edge: any) => trimId(edge.sourceHandle) === id || trimId(edge.targetHandle) === id, ); // skip to highlight & open relationship popup if no related edge if (!relatedEdge) return; setEdges(highlightEdges([relatedEdge?.id], true)); setNodes( highlightNodes( [relatedEdge.source, relatedEdge.target], [trimId(relatedEdge.sourceHandle), trimId(relatedEdge.targetHandle)], ), ); }, [reactflowInstance], ); const onMouseLeave = useCallback( (_event: React.MouseEvent) => { if (!isRelationship) return; const { setEdges, setNodes } = reactflowInstance; setEdges(highlightEdges([], false)); setNodes(highlightNodes([], [])); }, [reactflowInstance], ); const onMoreMouseEnter = useCallback( (event: React.MouseEvent) => { onMouseLeave(event); }, [reactflowInstance], ); const onMoreMouseLeave = useCallback( (event: React.MouseEvent) => { onMouseEnter(event); }, [reactflowInstance], ); const onMenuEnter = useCallback( (event: React.MouseEvent) => { onMouseLeave(event); }, [reactflowInstance], ); return ( : getColumnTypeIcon({ type })} extra={ <> {isPrimaryKey && }{' '} {isMoreButtonShow && ( )} } onMouseLeave={onMouseLeave} onMouseEnter={onMouseEnter} /> ); }; const ColumnIterator = makeIterable(ColumnTemplate); const getColumns = ( columns: ComposeDiagramField[], data: CustomNodeProps['data'], pagination?: { limit: number }, ) => { const moreCount = pagination ? columns.length - pagination.limit : 0; const slicedColumns = pagination ? columns.slice(0, pagination.limit) : columns; return ( <> {moreCount > 0 && } ); }; ================================================ FILE: wren-ui/src/components/diagram/customNode/ViewNode.tsx ================================================ import { memo, useCallback, useContext } from 'react'; import { Button, Typography } from 'antd'; import { MoreIcon, ViewIcon } from '@/utils/icons'; import { MORE_ACTION } from '@/utils/enum'; import { ComposeDiagram, ComposeDiagramField, DiagramView } from '@/utils/data'; import { getColumnTypeIcon } from '@/utils/columnType'; import { Config } from '@/utils/diagram'; import { makeIterable } from '@/utils/iteration'; import { DiagramContext } from '@/components/diagram/Context'; import { CustomNodeProps, NodeBody, NodeHeader, StyledNode, } from '@/components/diagram/customNode/utils'; import MarkerHandle from '@/components/diagram/customNode/MarkerHandle'; import Column from '@/components/diagram/customNode/Column'; import { ViewDropdown } from '@/components/diagram/CustomDropdown'; const { Text } = Typography; export const ViewNode = ({ data }: CustomNodeProps) => { const context = useContext(DiagramContext); const onMoreClick = (type: MORE_ACTION) => { context?.onMoreClick({ type, data: data.originalData, }); }; const onNodeClick = () => { context?.onNodeClick({ data: data.originalData, }); }; const renderColumns = useCallback( (columns: ComposeDiagramField[]) => getColumns(columns, data, { limit: Config.columnsLimit }), [data.highlight], ); return ( {data.originalData.displayName} } >
Data preview (50 rows) {showPreview && (
)}
{!!error && ( } /> )} ); } ================================================ FILE: wren-ui/src/components/modals/CalculatedFieldModal.tsx ================================================ import { useCallback, useEffect, useMemo, useState } from 'react'; import { Modal, Form, Input, Typography, Button, Alert } from 'antd'; import LinkOutlined from '@ant-design/icons/LinkOutlined'; import { FORM_MODE } from '@/utils/enum'; import { ERROR_TEXTS } from '@/utils/error'; import { DiagramModel } from '@/utils/data/type'; import { ModalAction } from '@/hooks/useModalAction'; import { createLineageSelectorNameValidator, createLineageSelectorValidator, } from '@/utils/validator'; import { ERROR_CODES, parseGraphQLError } from '@/utils/errorHandler'; import { FieldValue } from '@/components/selectors/lineageSelector/FieldSelect'; import useExpressionFieldOptions from '@/hooks/useExpressionFieldOptions'; import LineageSelector, { getLineageOptions, } from '@/components/selectors/lineageSelector'; import DescriptiveSelector from '@/components/selectors/DescriptiveSelector'; import ErrorCollapse from '@/components/ErrorCollapse'; import { useValidateCalculatedFieldMutation } from '@/apollo/client/graphql/calculatedField.generated'; import { CreateCalculatedFieldInput } from '@/apollo/client/graphql/__types__'; export type CalculatedFieldValue = { name: string; expression: string; lineage: FieldValue[]; columnId?: number; payload: { models: DiagramModel[]; sourceModel: DiagramModel; }; }; type Props = ModalAction< CalculatedFieldValue, { id?: number; data: CreateCalculatedFieldInput } > & { loading?: boolean; }; export default function AddCalculatedFieldModal(props: Props) { const { visible, loading, onSubmit, onClose, defaultValue, payload, formMode, } = props; const isEditMode = formMode === FORM_MODE.EDIT; const [error, setError] = useState>(null); const [form] = Form.useForm(); const expression = Form.useWatch('expression', form); const lineage = Form.useWatch('lineage', form); const expressionOptions = useExpressionFieldOptions(); const models = useMemo(() => payload?.models, [payload]); const sourceModel = useMemo(() => payload?.sourceModel, [payload]); const [validateCalculatedField] = useValidateCalculatedFieldMutation(); const validateCalculatedFieldName = useCallback( async (name: string) => await validateCalculatedField({ variables: { data: { name, modelId: sourceModel.modelId, columnId: defaultValue?.columnId, }, }, }), [sourceModel, defaultValue], ); useEffect(() => { if (!visible) return; form.setFieldsValue(defaultValue || {}); }, [form, defaultValue, visible]); const fetchOptions = useCallback( async (value) => { const selectedModel = models.find( (model) => model.referenceName === value.referenceName, ); // use current model options when initial return getLineageOptions({ model: selectedModel, sourceModel, expression, values: lineage, }); }, [models, lineage, expression], ); const reset = () => { setError(null); form.resetFields(); }; const submit = () => { setError(null); form .validateFields() .then(async (values) => { const id = defaultValue?.columnId; const modelId = !id ? sourceModel.modelId : undefined; await onSubmit({ id, data: { modelId, expression: values.expression, name: values.name, // lineage output example: [relationId1, relationId2, columnId], the last item is always a columnId lineage: values.lineage.map( (field) => field.relationId || field.columnId, ), }, }); onClose(); }) .catch((err) => { const graphQLError = parseGraphQLError(err); if (graphQLError.code === ERROR_CODES.INVALID_CALCULATED_FIELD) { setError(graphQLError); } console.error(err); }); }; return ( reset()} footer={
How to set primary key in a model.
} >
{ return ( <>
{content?.description || '-'}
{content?.expression && ( {content.expression} )} ); }} />
{!!expression && ( )} {!!error && ( } /> )} ); } ================================================ FILE: wren-ui/src/components/modals/DeleteModal.tsx ================================================ import { ReactNode } from 'react'; import { ButtonProps, Modal, ModalProps } from 'antd'; import ExclamationCircleOutlined from '@ant-design/icons/ExclamationCircleOutlined'; import DeleteOutlined from '@ant-design/icons/DeleteOutlined'; type DeleteModalProps = { disabled?: boolean; modalProps?: ModalProps; onConfirm: () => void; style?: any; } & Partial; type Config = { icon?: ReactNode; itemName?: string; content?: string; }; export const makeDeleteModal = (Component, config?: Config) => (props: DeleteModalProps) => { const { title, content, modalProps = {}, onConfirm, ...restProps } = props; return ( Modal.confirm({ autoFocusButton: null, cancelText: 'Cancel', content: config?.content || 'This will be permanently deleted, please confirm you want to delete it.', icon: , okText: 'Delete', onOk: onConfirm, title: `Are you sure you want to delete this ${config?.itemName}?`, width: 464, ...modalProps, okButtonProps: { ...modalProps.okButtonProps, danger: true, }, }) } {...restProps} /> ); }; const DefaultDeleteButton = (props) => { const { icon = null, disabled, ...restProps } = props; return ( {icon}Delete ); }; export default makeDeleteModal(DefaultDeleteButton); // Customize delete modal export const DeleteThreadModal = makeDeleteModal(DefaultDeleteButton, { icon: , itemName: 'thread', content: 'This will permanently delete all results history in this thread, please confirm you want to delete it.', }); export const DeleteViewModal = makeDeleteModal(DefaultDeleteButton, { icon: , itemName: 'view', content: 'This will be permanently deleted, please confirm you want to delete it.', }); export const DeleteModelModal = makeDeleteModal(DefaultDeleteButton, { icon: , itemName: 'model', content: 'This will be permanently deleted, please confirm you want to delete it.', }); export const DeleteCalculatedFieldModal = makeDeleteModal(DefaultDeleteButton, { icon: , itemName: 'calculated field', content: 'This will be permanently deleted, please confirm you want to delete it.', }); export const DeleteRelationshipModal = makeDeleteModal(DefaultDeleteButton, { icon: , itemName: 'relationship', content: 'This will be permanently deleted, please confirm you want to delete it.', }); export const DeleteDashboardItemModal = makeDeleteModal(DefaultDeleteButton, { icon: , itemName: 'dashboard item', content: 'This will be permanently deleted, please confirm you want to delete it.', }); export const DeleteQuestionSQLPairModal = makeDeleteModal(DefaultDeleteButton, { icon: , itemName: 'question-SQL pair', content: 'This action is permanent and cannot be undone. Are you sure you want to proceed?', }); export const DeleteInstructionModal = makeDeleteModal(DefaultDeleteButton, { icon: , itemName: 'instruction', content: 'This action is permanent and cannot be undone. Are you sure you want to proceed?', }); ================================================ FILE: wren-ui/src/components/modals/FixSQLModal.tsx ================================================ import { useEffect, useMemo, useState } from 'react'; import { Button, Form, Modal, Typography, Alert } from 'antd'; import { ERROR_TEXTS } from '@/utils/error'; import { ModalAction } from '@/hooks/useModalAction'; import { attachLoading } from '@/utils/helper'; import { parseGraphQLError } from '@/utils/errorHandler'; import SQLEditor from '@/components/editor/SQLEditor'; import ErrorCollapse from '@/components/ErrorCollapse'; import PreviewData from '@/components/dataPreview/PreviewData'; import { usePreviewSqlMutation } from '@/apollo/client/graphql/sql.generated'; type Props = ModalAction<{ sql: string; responseId: number }> & { loading?: boolean; }; export function FixSQLModal(props: Props) { const { visible, defaultValue, loading, onSubmit, onClose } = props; const [previewLoading, setPreviewLoading] = useState(false); const [form] = Form.useForm(); // Handle errors via try/catch blocks rather than onError callback const [previewSqlMutation, previewSqlResult] = usePreviewSqlMutation(); const error = useMemo(() => { if (!previewSqlResult.error) return null; const graphQLError = parseGraphQLError(previewSqlResult.error); return { ...graphQLError, shortMessage: 'Invalid SQL syntax' }; }, [previewSqlResult.error]); useEffect(() => { if (!visible) return; form.setFieldsValue(defaultValue || {}); }, [form, defaultValue, visible]); const validateSql = async () => { const sql = form.getFieldValue('sql'); await previewSqlMutation({ variables: { data: { sql, limit: 1, dryRun: true } }, }); }; const previewData = async () => { form .validateFields() .then(async (values) => { await attachLoading( previewSqlMutation, setPreviewLoading, )({ variables: { data: { sql: values.sql, limit: 50 } }, }); }) .catch(console.error); }; const reset = () => { form.resetFields(); previewSqlResult.reset(); }; const submit = async () => { form .validateFields() .then(async (values) => { await validateSql(); await onSubmit(values.sql); onClose(); }) .catch(console.error); }; const showPreview = previewSqlResult.data || previewSqlResult.loading; return ( The following SQL statement needs to be fixed:
Data preview (50 rows) {showPreview && (
)}
{!!error && ( } /> )}
); } ================================================ FILE: wren-ui/src/components/modals/ImportDataSourceSQLModal.tsx ================================================ import { useMemo } from 'react'; import { Modal, Form, Alert } from 'antd'; import { ModalAction } from '@/hooks/useModalAction'; import { getDataSourceImage, getDataSourceName } from '@/utils/dataSourceType'; import { DATA_SOURCES } from '@/utils/enum'; import { ERROR_TEXTS } from '@/utils/error'; import { parseGraphQLError } from '@/utils/errorHandler'; import SQLEditor from '@/components/editor/SQLEditor'; import ErrorCollapse from '@/components/ErrorCollapse'; import { useModelSubstituteMutation } from '@/apollo/client/graphql/sql.generated'; import { DataSource, DataSourceName } from '@/apollo/client/graphql/__types__'; type Props = ModalAction<{ dataSource: DATA_SOURCES }>; const Toolbar = (props) => { const { dataSource } = props; if (!dataSource) return null; const logo = getDataSourceImage(dataSource); const name = getDataSourceName(dataSource); return ( <> logo {name} ); }; export const isSupportSubstitute = (dataSource: DataSource) => { // DuckDB not supported, sample dataset as well return ( !dataSource?.sampleDataset && dataSource?.type !== DataSourceName.DUCKDB ); }; export default function ImportDataSourceSQLModal(props: Props) { const { visible, defaultValue, onSubmit, onClose } = props; const name = getDataSourceName(defaultValue?.dataSource) || 'data source'; // Handle errors via try/catch blocks rather than onError callback const [substituteDialectSQL, modelSubstitudeResult] = useModelSubstituteMutation(); const error = useMemo( () => modelSubstitudeResult.error ? { ...parseGraphQLError(modelSubstitudeResult.error), shortMessage: `Invalid ${name} SQL syntax`, } : null, [modelSubstitudeResult.error], ); const [form] = Form.useForm(); const reset = () => { form.resetFields(); modelSubstitudeResult.reset(); }; const submit = async () => { form .validateFields() .then(async (values) => { const response = await substituteDialectSQL({ variables: { data: { sql: values.dialectSql } }, }); await onSubmit(response.data?.modelSubstitute); onClose(); }) .catch(console.error); }; const loading = modelSubstitudeResult.loading; return ( reset()} >
} autoFocus /> {!!error && ( } /> )}
); } ================================================ FILE: wren-ui/src/components/modals/InstructionModal.tsx ================================================ import { useEffect } from 'react'; import { Button, Form, Input, Modal, Row, Col, Radio } from 'antd'; import DeleteOutlined from '@ant-design/icons/DeleteOutlined'; import PlusOutlined from '@ant-design/icons/PlusOutlined'; import { isEmpty } from 'lodash'; import { FORM_MODE } from '@/utils/enum'; import { ERROR_TEXTS } from '@/utils/error'; import { ModalAction } from '@/hooks/useModalAction'; import { Instruction } from '@/apollo/client/graphql/__types__'; const MAX_QUESTIONS = 100; type Props = ModalAction & { loading?: boolean; }; export default function InstructionModal(props: Props) { const { defaultValue, formMode, loading, onClose, onSubmit, visible } = props; const isCreateMode = formMode === FORM_MODE.CREATE; const [form] = Form.useForm(); const isDefault = Form.useWatch('isDefault', form); useEffect(() => { if (visible) { form.setFieldsValue({ isDefault: isEmpty(defaultValue) ? true : defaultValue.isDefault, instruction: defaultValue?.instruction, questions: defaultValue?.questions, }); } }, [visible, defaultValue]); const onSubmitButton = () => { form .validateFields() .then(async (values) => { const data = { isDefault: values.isDefault, instruction: values.instruction, questions: values?.questions || [], }; await onSubmit({ data, id: defaultValue?.id }); onClose(); }) .catch(console.error); }; return ( form.resetFields()} >
Choose whether this instruction applies to{' '} all queries or{' '} only when similar user questions are detected . } > Global (applies to all questions) Matched to specific questions {!isDefault && ( {(fields, { add, remove }) => ( <> {fields.map(({ key, name, ...restField }) => (
)} )} ); } ================================================ FILE: wren-ui/src/components/modals/QuestionSQLPairModal.tsx ================================================ import { useEffect, useMemo, useState } from 'react'; import styled from 'styled-components'; import { Alert, Button, Form, Input, Modal, Typography } from 'antd'; import { Logo } from '@/components/Logo'; import InfoCircleOutlined from '@ant-design/icons/InfoCircleOutlined'; import SelectOutlined from '@ant-design/icons/SelectOutlined'; import { ERROR_TEXTS } from '@/utils/error'; import { FORM_MODE } from '@/utils/enum'; import { getDataSourceName } from '@/utils/dataSourceType'; import useModalAction, { ModalAction } from '@/hooks/useModalAction'; import SQLEditor from '@/components/editor/SQLEditor'; import { parseGraphQLError } from '@/utils/errorHandler'; import { createSQLPairQuestionValidator } from '@/utils/validator'; import ErrorCollapse from '@/components/ErrorCollapse'; import PreviewData from '@/components/dataPreview/PreviewData'; import ImportDataSourceSQLModal, { isSupportSubstitute, } from '@/components/modals/ImportDataSourceSQLModal'; import { usePreviewSqlMutation } from '@/apollo/client/graphql/sql.generated'; import { useGetSettingsQuery } from '@/apollo/client/graphql/settings.generated'; import { useGenerateQuestionMutation } from '@/apollo/client/graphql/sql.generated'; import { SqlPair } from '@/apollo/client/graphql/__types__'; type Props = ModalAction & { loading?: boolean; payload?: { isCreateMode: boolean; }; }; const StyledForm = styled(Form)` .adm-question-form-item > div > label { width: 100%; } `; const Toolbar = (props: { dataSource: string; onClick: () => void }) => { const { dataSource, onClick } = props; const name = getDataSourceName(dataSource); return (
Wren SQL
); }; export default function QuestionSQLPairModal(props: Props) { const { defaultValue, formMode, loading, onClose, onSubmit, visible, payload, } = props; // pass payload?.isCreateMode to prevent formMode from being set to Update when passing defaultValue, for the 'Add a SQL pair from an existing answer' scenario use. const isCreateMode = formMode === FORM_MODE.CREATE || payload?.isCreateMode; const importDataSourceSQLModal = useModalAction(); const { data: settingsResult } = useGetSettingsQuery(); const settings = settingsResult?.settings; const dataSource = useMemo( () => ({ isSupportSubstitute: isSupportSubstitute(settings?.dataSource), type: settings?.dataSource?.type, }), [settings?.dataSource], ); const [form] = Form.useForm(); const [error, setError] = useState>(null); const [previewing, setPreviewing] = useState(false); const [submitting, setSubmitting] = useState(false); const [generatingQuestion, setGeneratingQuestion] = useState(false); const [showPreview, setShowPreview] = useState(false); // Handle errors via try/catch blocks rather than onError callback const [previewSqlMutation, previewSqlResult] = usePreviewSqlMutation(); const [generateQuestionMutation] = useGenerateQuestionMutation({ onError: (error) => console.error(error), }); const sqlValue = Form.useWatch('sql', form); useEffect(() => { if (visible) { form.setFieldsValue({ question: defaultValue?.question, sql: defaultValue?.sql, }); } }, [visible, defaultValue]); const handleReset = () => { previewSqlResult.reset(); setShowPreview(false); setError(null); form.resetFields(); }; const onValidateSQL = async () => { await previewSqlMutation({ variables: { data: { sql: sqlValue, limit: 1, dryRun: true, }, }, }); }; const handleError = (error) => { const graphQLError = parseGraphQLError(error); setError({ ...graphQLError, shortMessage: 'Invalid SQL syntax' }); console.error(graphQLError); }; const onPreviewData = async () => { setError(null); setPreviewing(true); try { await onValidateSQL(); setShowPreview(true); await previewSqlMutation({ variables: { data: { sql: sqlValue, limit: 50, }, }, }); } catch (error) { handleError(error); } finally { setPreviewing(false); } }; const onSubmitButton = () => { setError(null); setSubmitting(true); setShowPreview(false); form .validateFields() .then(async (values) => { try { await onValidateSQL(); await onSubmit({ data: values, id: defaultValue?.id }); onClose(); } catch (error) { handleError(error); } finally { setSubmitting(false); } }) .catch((err) => { setSubmitting(false); console.error(err); }); }; const onGenerateQuestion = async () => { setGeneratingQuestion(true); const { data } = await generateQuestionMutation({ variables: { data: { sql: sqlValue, }, }, }); form.setFieldsValue({ question: data?.generateQuestion || '' }); setGeneratingQuestion(false); }; const confirmLoading = loading || submitting; const disabled = !sqlValue; return ( <> handleReset()} footer={
The SQL statement used here follows Wren SQL, which is based on ANSI SQL and optimized for Wren AI.{` `} Learn more about the syntax.
} > Question
Let AI create a matching question for this SQL statement.
} name="question" required rules={[ { validator: createSQLPairQuestionValidator( ERROR_TEXTS.SQL_PAIR.QUESTION, ), }, ]} >
importDataSourceSQLModal.openModal({ dataSource: dataSource.type, }) } /> ) } autoComplete autoFocus />
Data preview (50 rows) {showPreview && (
)}
{!!error && ( } /> )}
{dataSource.isSupportSubstitute && ( { form.setFieldsValue({ sql: convertedSql }); }} /> )} ); } ================================================ FILE: wren-ui/src/components/modals/RelationModal.tsx ================================================ import { useEffect } from 'react'; import { isEmpty } from 'lodash'; import { Modal, Form, Select } from 'antd'; import { ModalAction } from '@/hooks/useModalAction'; import { ERROR_TEXTS } from '@/utils/error'; import CombineFieldSelector from '@/components/selectors/CombineFieldSelector'; import { JOIN_TYPE, FORM_MODE, convertIdentifierToObject } from '@/utils/enum'; import { getJoinTypeText } from '@/utils/data'; import { createRelationshipFromFieldValidator, createRelationshipToFieldValidator, } from '@/utils/validator'; import useCombineFieldOptions, { convertDefaultValueToIdentifier, } from '@/hooks/useCombineFieldOptions'; import { RelationsDataType } from '@/components/table/ModelRelationSelectionTable'; import { SelectedRecommendRelations } from '@/components/pages/setup/DefineRelations'; export const FormFieldKey = { FROM_FIELD: 'fromField', TO_FIELD: 'toField', TYPE: 'type', }; export interface RelationFormValues { fromField: { model: string; field: string }; toField: { model: string; field: string }; type?: string; } export type RelationFieldValue = Pick< RelationsDataType, 'type' | 'fromField' | 'toField' >; type Props = ModalAction & { model: string; loading?: boolean; relations: SelectedRecommendRelations; isRecommendMode?: boolean; }; export default function RelationModal(props: Props) { const { defaultValue, loading, model, onClose, onSubmit, relations, visible, formMode, isRecommendMode, } = props; const [form] = Form.useForm(); // only suitable use for modeling page const isUpdateMode = formMode === FORM_MODE.EDIT; const fromCombineField = useCombineFieldOptions({ model }); const modelValue = fromCombineField.modelOptions.find((option) => { const value: any = convertIdentifierToObject(option.value); return value.referenceName === model; })?.value; const toFieldModel = defaultValue?.toField.modelName; const toCombineField = useCombineFieldOptions({ model: toFieldModel, excludeModels: [model], }); useEffect(() => { if (!visible || isEmpty(defaultValue)) return; const transformedValue = convertDefaultValueToIdentifier(defaultValue); form.setFieldsValue(transformedValue); toCombineField.onModelChange(transformedValue.toField.model); }, [form, defaultValue, visible]); const relationTypeOptions = Object.keys(JOIN_TYPE).map((key) => ({ label: getJoinTypeText(key), value: JOIN_TYPE[key], })); const submit = () => { form .validateFields() .then(async (values) => { await onSubmit({ ...defaultValue, ...values }); onClose(); }) .catch(console.error); }; return ( form.resetFields()} centered >
({ validator: createRelationshipFromFieldValidator( isUpdateMode || isRecommendMode, relations, getFieldValue, ), }), ]} > ({ validator: createRelationshipToFieldValidator( isUpdateMode || isRecommendMode, relations, getFieldValue, ), }), ]} >
); } ================================================ FILE: wren-ui/src/components/modals/SchemaChangeModal.tsx ================================================ import { useMemo } from 'react'; import { Modal, Button, Table, Typography, Collapse, Alert, Tag, Popconfirm, } from 'antd'; import styled from 'styled-components'; import WarningOutlined from '@ant-design/icons/WarningOutlined'; import PlusSquareOutlined from '@ant-design/icons/PlusSquareOutlined'; import LineOutlined from '@ant-design/icons/LineOutlined'; import FileDoneOutlined from '@ant-design/icons/FileDoneOutlined'; import { ModalAction } from '@/hooks/useModalAction'; import EllipsisWrapper from '@/components/EllipsisWrapper'; import { DetailedChangeTable, DetailedAffectedCalculatedFields, DetailedAffectedRelationships, NodeType, SchemaChange, SchemaChangeType, } from '@/apollo/client/graphql/__types__'; const StyledCollapse = styled(Collapse)` border: none; background-color: white; .ant-collapse-item:last-child, .ant-collapse-item:last-child > .ant-collapse-header { border-radius: 0; } .ant-collapse-item, .ant-collapse-content { border-color: var(--gray-4); } .ant-collapse-content-box { padding: 0; } `; const StyledTable = styled(Table)` padding-left: 36px; .ant-table { border: none; border-radius: 0; .non-expandable { .ant-table-row-expand-icon { display: none; } } .ant-table-expanded-row { .ant-table-cell { background-color: white; } } } `; type Props = ModalAction & { loading?: boolean; payload?: { onResolveSchemaChange?: (type: SchemaChangeType) => void; isResolving?: boolean; }; }; const nestedColumns = [ { title: 'Affected Resource', dataIndex: 'resourceType', width: 200, render: (resourceType: NodeType) => { if (resourceType === NodeType.CALCULATED_FIELD) { return Calculated Field; } if (resourceType === NodeType.RELATION) { return Relationship; } return null; }, }, { title: 'Name', dataIndex: 'displayName', }, ]; const checkIsExpandable = (record: DetailedChangeTable) => record.calculatedFields.length + record.relationships.length > 0 ? '' : 'non-expandable'; const PanelHeader = (props) => { const { title, count, onResolve, isResolving } = props; const resolve = (event) => { event.stopPropagation(); onResolve(); }; return (
{title} {count} table(s) affected
{!!onResolve && ( event.stopPropagation()} > )}
); }; interface ExpandedRowsProps { record: DetailedChangeTable & { resources: Array< DetailedAffectedCalculatedFields | DetailedAffectedRelationships >; }; tipMessage: string; } const ExpandedRows = ({ record, tipMessage }: ExpandedRowsProps) => { if (record.resources.length === 0) return null; return (
} className="gray-6 ml-2 bg-gray-1 pl-0" style={{ border: 'none' }} message={tipMessage} />
); }; export default function SchemaChangeModal(props: Props) { const { visible, onClose, defaultValue: schemaChange, payload } = props; const { onResolveSchemaChange, isResolving } = payload || {}; const { deletedTables, deletedColumns, modifiedColumns } = useMemo(() => { const { deletedTables, deletedColumns, modifiedColumns } = schemaChange || {}; if (!schemaChange) return { deletedTables, deletedColumns, modifiedColumns, }; // transform data to render UI const transformData = (tables: DetailedChangeTable) => ({ ...tables, resources: [ ...tables.calculatedFields.map( ( calculatedField: DetailedAffectedCalculatedFields, index: number, ) => ({ ...calculatedField, resourceType: NodeType.CALCULATED_FIELD, rowKey: `${tables.sourceTableName}-${calculatedField.referenceName}-${index}`, }), ), ...tables.relationships.map( (relationship: DetailedAffectedRelationships, index: number) => ({ ...relationship, resourceType: NodeType.RELATION, rowKey: `${tables.sourceTableName}-${relationship.referenceName}-${index}`, }), ), ], rowKey: tables.sourceTableName, }); return { deletedTables: deletedTables?.map(transformData), deletedColumns: deletedColumns?.map(transformData), modifiedColumns: modifiedColumns?.map(transformData), }; }, [schemaChange]); const columnsOfDeleteTables = [ { title: 'Affected model', width: 200, dataIndex: 'displayName' }, { title: 'Source table name', dataIndex: 'sourceTableName' }, ]; const columnsOfDeletedColumns = [ { title: 'Affected model', width: 200, dataIndex: 'displayName' }, { title: 'Deleted columns', dataIndex: 'columns', render: (columns) => { return ( {columns.map((column) => ( {column.displayName} ))} ); }, }, ]; const columnsOfModifiedColumns = [ { title: 'Affected model', width: 200, dataIndex: 'displayName' }, { title: 'Affected columns', dataIndex: 'columns', render: (columns) => { return ( {columns.map((column) => ( {column.displayName} ))} ); }, }, ]; return ( Schema Changes } width={750} visible={visible} onCancel={onClose} destroyOnClose footer={null} > We have detected schema changes from your connected data source. Please review the impacts of these changes. panelProps.isActive ? : } > {deletedTables && ( onResolveSchemaChange(SchemaChangeType.DELETED_TABLES) } isResolving={isResolving} > } key="deleteTables" > ( ), }} /> )} {deletedColumns && ( onResolveSchemaChange(SchemaChangeType.DELETED_COLUMNS) } isResolving={isResolving} > } key="deleteColumns" > ( ), }} /> )} {modifiedColumns && ( } key="modifiedColumns" > ( ), }} /> )} ); } ================================================ FILE: wren-ui/src/components/pages/apiManagement/DetailsDrawer.tsx ================================================ import { Drawer, Typography, Row, Col, Tag } from 'antd'; import { getAbsoluteTime } from '@/utils/time'; import { DrawerAction } from '@/hooks/useDrawerAction'; import CheckCircleOutlined from '@ant-design/icons/CheckCircleOutlined'; import CloseCircleOutlined from '@ant-design/icons/CloseCircleOutlined'; import JsonCodeBlock from '@/components/code/JsonCodeBlock'; import { ApiHistoryResponse } from '@/apollo/client/graphql/__types__'; type Props = DrawerAction & { loading?: boolean; }; export default function DetailsDrawer(props: Props) { const { visible, onClose, defaultValue } = props; const { threadId, apiType, createdAt, durationMs, statusCode, headers, requestPayload, responsePayload, } = defaultValue || {}; const getStatusTag = (status: number) => { const isSuccess = status >= 200 && status < 300; return ( : } color={isSuccess ? 'success' : 'error'} > {status} ); }; return ( API type
{apiType?.toLowerCase()}
Thread ID
{threadId || '-'}
Created at
{getAbsoluteTime(createdAt)}
Duration
{durationMs} ms
Status code
{getStatusTag(statusCode)}
Headers
Request payload
Response payload
); } ================================================ FILE: wren-ui/src/components/pages/home/RecommendedQuestions.tsx ================================================ import clsx from 'clsx'; import styled from 'styled-components'; import { useMemo } from 'react'; import { Skeleton } from 'antd'; import BulbOutlined from '@ant-design/icons/BulbOutlined'; import { makeIterable } from '@/utils/iteration'; import { RecommendedQuestionsTask, RecommendedQuestionsTaskStatus, } from '@/apollo/client/graphql/__types__'; export interface SelectQuestionProps { question: string; sql: string; } interface Props { items: { question: string; sql: string }[]; loading?: boolean; error?: { shortMessage?: string; code?: string; message?: string; stacktrace?: string[]; }; className?: string; onSelect: ({ question, sql }: SelectQuestionProps) => void; } const StyledSkeleton = styled(Skeleton)` padding: 4px 0; .ant-skeleton-paragraph { margin-bottom: 0; li { height: 14px; + li { margin-top: 12px; } } } `; export const getRecommendedQuestionProps = ( data: RecommendedQuestionsTask, show = true, ) => { if (!data || !show) return { show: false }; const questions = (data?.questions || []).slice(0, 3).map((item) => ({ question: item.question, sql: item.sql, })); const loading = data?.status === RecommendedQuestionsTaskStatus.GENERATING; return { show: loading || questions.length > 0, state: { items: questions, loading, error: data?.error, }, }; }; const QuestionItem = (props: { index: number; question: string; sql: string; onSelect: ({ question, sql }: SelectQuestionProps) => void; }) => { const { index, question, sql, onSelect } = props; return (
0 && 'mt-1')}> onSelect({ question, sql })} > {question}
); }; const QuestionList = makeIterable(QuestionItem); export default function RecommendedQuestions(props: Props) { const { items, loading, className, onSelect } = props; const data = useMemo( () => items.map(({ question, sql }) => ({ question, sql })), [items], ); return (
Recommended questions
); } ================================================ FILE: wren-ui/src/components/pages/home/dashboardGrid/CacheSettingsDrawer.tsx ================================================ import { useEffect } from 'react'; import { capitalize } from 'lodash'; import { CronExpressionParser } from 'cron-parser'; import moment from 'moment'; import { Button, Drawer, Form, Space, Switch, Select, Input, Row, Col, Divider, TimePicker, } from 'antd'; import { browserTimeZone } from '@/utils/time'; import { DrawerAction } from '@/hooks/useDrawerAction'; import { ERROR_TEXTS } from '@/utils/error'; import { isValidCronLength, cronValidator } from '@/utils/validator'; import { CacheScheduleDayEnum } from '@/apollo/client/graphql/__types__'; type Props = DrawerAction & { loading?: boolean; }; export interface Schedule { frequency: string; day?: string; hour?: number; minute?: number; cron?: string; timezone?: string; } const timeFormat = 'HH:mm'; const FREQUENCY = { DAILY: 'DAILY', WEEKLY: 'WEEKLY', CUSTOM: 'CUSTOM', NEVER: 'NEVER', }; // This sequence follows the first day of the week const DAY_OF_WEEK = [ CacheScheduleDayEnum.SUN, CacheScheduleDayEnum.MON, CacheScheduleDayEnum.TUE, CacheScheduleDayEnum.WED, CacheScheduleDayEnum.THU, CacheScheduleDayEnum.FRI, CacheScheduleDayEnum.SAT, ]; const getDayOfWeekText = (day: CacheScheduleDayEnum) => { return ( { [CacheScheduleDayEnum.MON]: 'Monday', [CacheScheduleDayEnum.TUE]: 'Tuesday', [CacheScheduleDayEnum.WED]: 'Wednesday', [CacheScheduleDayEnum.THU]: 'Thursday', [CacheScheduleDayEnum.FRI]: 'Friday', [CacheScheduleDayEnum.SAT]: 'Saturday', [CacheScheduleDayEnum.SUN]: 'Sunday', }[day] || '' ); }; const getFrequencyText = (frequency: string) => { if (frequency === FREQUENCY.NEVER) return 'Manual refresh only'; return capitalize(frequency); }; const getInitialSchedule = (frequency: string) => { let schedule = {}; switch (frequency) { case FREQUENCY.DAILY: schedule = { day: null, time: moment('00:00', timeFormat), cron: null, }; break; case FREQUENCY.WEEKLY: schedule = { day: DAY_OF_WEEK[0], time: moment('00:00', timeFormat), cron: null, }; break; case FREQUENCY.CUSTOM: schedule = { day: null, time: null, cron: '0 0 * * *', }; break; case FREQUENCY.NEVER: schedule = { day: null, time: null, cron: null, }; break; default: break; } return schedule; }; export const getScheduleText = (schedule: Schedule): string => { if (!schedule) return ''; const { frequency } = schedule; const convertTime = (schedule: Schedule) => { const time = moment( `${schedule.hour}:${schedule.minute}`, timeFormat, ).format(timeFormat); return time; }; switch (frequency) { case FREQUENCY.DAILY: { const time = convertTime(schedule); return `Cache refreshes daily at ${time}`; } case FREQUENCY.WEEKLY: { const time = convertTime(schedule); return `Cache refreshes every ${getDayOfWeekText(schedule.day as CacheScheduleDayEnum)} at ${time}`; } case FREQUENCY.CUSTOM: { return `Cache refreshes on custom schedule`; } case FREQUENCY.NEVER: { return 'Cache refresh: manual only'; } default: { return ''; } } }; const getNextSchedule = (data: { frequency: string; day: string; time: moment.Moment; cron: string; }) => { const { frequency, day, time, cron } = data; if (frequency === FREQUENCY.CUSTOM) return getNextScheduleByCron(cron); if (frequency === FREQUENCY.NEVER || !time) return null; // frequency daily or weekly calculation const now = moment(); const targetTime = moment( `${now.format('YYYY-MM-DD')} ${time.format(timeFormat)}`, ); // set the day of the week if it's a weekly schedule if (day) { const dayIndex = DAY_OF_WEEK.findIndex((d) => d === day); targetTime.set({ day: dayIndex }); } // postpond the time if it's already passed if (now.isAfter(targetTime)) { if (frequency === FREQUENCY.DAILY) { targetTime.add(1, 'd'); } else if (frequency === FREQUENCY.WEEKLY) { targetTime.add(7, 'd'); } } return targetTime.isValid() ? targetTime.format('YYYY-MM-DD HH:mm') : null; }; const getNextScheduleByCron = (cron: string) => { if (!cron || !isValidCronLength(cron)) return null; try { const interval = CronExpressionParser.parse(cron, { tz: 'UTC' }); const targetTime = moment.utc(interval.next().toDate()).local(); return targetTime.isValid() ? targetTime.format('YYYY-MM-DD HH:mm') : null; } catch (error) { console.warn(error); return null; } }; export default function CacheSettingsDrawer(props: Props) { const { visible, defaultValue, loading, onClose, onSubmit } = props; const [form] = Form.useForm(); const cacheEnabled = Form.useWatch('cacheEnabled', form); useEffect(() => { if (visible) { const { schedule, ...restValues } = defaultValue || {}; form.setFieldsValue({ ...restValues, schedule: { day: schedule?.day, frequency: schedule?.frequency, time: schedule?.hour.toString() && schedule?.minute.toString() ? moment(`${schedule?.hour}:${schedule?.minute}`, timeFormat) : null, cron: schedule?.cron, }, }); } }, [visible, defaultValue]); const afterVisibleChange = (visible: boolean) => { if (!visible) { form.resetFields(); } }; const submit = () => { form .validateFields() .then(async (values) => { const { schedule } = values; await onSubmit({ ...values, schedule: values.cacheEnabled ? { frequency: schedule?.frequency, day: schedule?.day, hour: schedule?.time?.hour(), minute: schedule?.time?.minute(), cron: schedule?.cron, timezone: browserTimeZone, } : null, }); onClose(); }) .catch(console.error); }; return ( } >
{cacheEnabled && }
); } function Schedule() { const form = Form.useFormInstance(); const frequency = Form.useWatch(['schedule', 'frequency'], form); const day = Form.useWatch(['schedule', 'day'], form); const time = Form.useWatch(['schedule', 'time'], form); const cron = Form.useWatch(['schedule', 'cron'], form); const onFrequencyChange = (value: string) => { form.setFieldsValue({ schedule: { frequency: value, ...getInitialSchedule(value) }, }); }; const nextSchedule = getNextSchedule({ frequency, day, time, cron }); return ( <> Refresh settings )} {nextSchedule && (
Next scheduled refresh:
{nextSchedule} {browserTimeZone && ({browserTimeZone})}
)} ); } function DailyTimeSelection() { return ( <> ); } function WeeklyTimeSelection() { return ( <> trigger.parentElement!} placeholder="Select a table" showSearch loading={dataSourceTablesLoading} disabled={isUpdateMode} > {tableOptions} )} item.name.toLowerCase().indexOf(inputValue.toLowerCase()) !== -1 || item.type.toLowerCase().indexOf(inputValue.toLowerCase()) !== -1 } leftColumns={defaultColumns} rightColumns={defaultColumns} titles={['Available Columns', 'Target Columns']} showSearch /> ); } ================================================ FILE: wren-ui/src/components/pages/modeling/metadata/EditBasicMetadata.tsx ================================================ import { useEffect, useState } from 'react'; import { Typography, Row, Col } from 'antd'; import { cloneDeep, set } from 'lodash'; import { NODE_TYPE } from '@/utils/enum'; import EditableWrapper from '@/components/EditableWrapper'; interface Props { dataSource: any; onChange?: (value: any) => void; nodeType: NODE_TYPE; rules?: Record; } export default function EditBasicMetadata(props: Props) { const { dataSource, onChange, nodeType, rules } = props; const [data, setData] = useState(dataSource); const isModel = nodeType === NODE_TYPE.MODEL; const isView = nodeType === NODE_TYPE.VIEW; useEffect(() => { // bind changeable metadata values onChange && onChange({ displayName: data.displayName, description: data.description, }); }, [data]); const handleSave = (_, value) => { const [dataIndexKey] = Object.keys(value); const newData = cloneDeep(data); set(newData, dataIndexKey, value[dataIndexKey]); setData(newData); }; return ( <> {isModel && (
Name
{data.referenceName}
Alias {data.displayName || '-'}
)} {isView && (
Name {data.displayName || '-'}
)}
Description {data.description || '-'}
); } ================================================ FILE: wren-ui/src/components/pages/modeling/metadata/EditModelMetadata.tsx ================================================ import { useContext } from 'react'; import { Typography } from 'antd'; import { NODE_TYPE } from '@/utils/enum'; import FieldTable from '@/components/table/FieldTable'; import CalculatedFieldTable from '@/components/table/CalculatedFieldTable'; import RelationTable from '@/components/table/RelationTable'; import { makeEditableBaseTable } from '@/components/table/EditableBaseTable'; import { COLUMN } from '@/components/table/BaseTable'; import { EditableContext } from '@/components/EditableWrapper'; import EditBasicMetadata from './EditBasicMetadata'; import NestedFieldTable from '@/components/table/NestedFieldTable'; export interface Props { formNamespace: string; displayName: string; referenceName: string; fields: any[]; calculatedFields?: any[]; relationFields: any[]; description: string; properties: Record; nodeType: NODE_TYPE; modelId: number; } const FIELDS_NAME = { FIELDS: 'columns', NESTED_FIELDS: 'nestedColumns', CALCULATED_FIELDS: 'calculatedFields', RELATIONSHIPS: 'relationships', }; const FieldEditableTable = makeEditableBaseTable(FieldTable); const NestedFieldEditableTable = makeEditableBaseTable(NestedFieldTable as any); const CalculatedFieldEditableTable = makeEditableBaseTable(CalculatedFieldTable); const RelationshipEditableTable = makeEditableBaseTable(RelationTable); export default function EditModelMetadata(props: Props) { const { formNamespace, displayName, referenceName, fields = [], calculatedFields = [], relationFields = [], description, nodeType, modelId, } = props || {}; const form = useContext(EditableContext); const onChange = (value) => { form.setFieldsValue({ [formNamespace]: { ...(form.getFieldValue(formNamespace) || {}), ...value, modelId, }, }); }; const handleMetadataChange = (fieldsName: string) => (value: any[]) => { // bind changeable metadata values onChange({ [fieldsName]: value.map((item) => ({ id: item.relationId || item.columnId || item.nestedColumnId, description: item.description, // Only models & fields, nested fields have alias ...([FIELDS_NAME.FIELDS, FIELDS_NAME.NESTED_FIELDS].includes(fieldsName) ? { displayName: item.displayName } : {}), })), }); }; return ( <>
Columns ({fields.length}) (
), rowExpandable: (record) => !!record.nestedFields, }} />
{!!calculatedFields.length && (
Calculated fields ({calculatedFields.length})
)} {!!relationFields.length && (
Relationships ({relationFields.length})
)} ); } ================================================ FILE: wren-ui/src/components/pages/modeling/metadata/EditViewMetadata.tsx ================================================ import { useContext } from 'react'; import { Typography } from 'antd'; import { NODE_TYPE } from '@/utils/enum'; import FieldTable from '@/components/table/FieldTable'; import { makeEditableBaseTable } from '@/components/table/EditableBaseTable'; import { createViewNameValidator } from '@/utils/validator'; import { COLUMN } from '@/components/table/BaseTable'; import { EditableContext } from '@/components/EditableWrapper'; import EditBasicMetadata from './EditBasicMetadata'; import { useValidateViewMutation } from '@/apollo/client/graphql/view.generated'; export interface Props { formNamespace: string; displayName: string; fields: any[]; description: string; properties: Record; nodeType: NODE_TYPE; viewId: number; } const FIELDS_NAME = { FIELDS: 'columns', }; const FieldEditableTable = makeEditableBaseTable(FieldTable); export default function EditViewMetadata(props: Props) { const { formNamespace, displayName, fields = [], description, nodeType, viewId, } = props || {}; const form = useContext(EditableContext); const [validateViewMutation] = useValidateViewMutation({ fetchPolicy: 'no-cache', }); const onChange = (value) => { form.setFieldsValue({ [formNamespace]: { ...(form.getFieldValue(formNamespace) || {}), ...value, viewId, }, }); }; const handleMetadataChange = (fieldsName: string) => (value: any[]) => { // bind changeable metadata values // The view's columns don't have their own column IDs, so we use the referenceName onChange({ [fieldsName]: value.map((item) => ({ referenceName: item.referenceName, description: item.description, })), }); }; return ( <>
Columns ({fields.length})
); } ================================================ FILE: wren-ui/src/components/pages/modeling/metadata/ModelMetadata.tsx ================================================ import { useMemo } from 'react'; import { keyBy } from 'lodash'; import { Col, Row, Typography, Button } from 'antd'; import FieldTable from '@/components/table/FieldTable'; import CalculatedFieldTable from '@/components/table/CalculatedFieldTable'; import RelationTable from '@/components/table/RelationTable'; import PreviewData from '@/components/dataPreview/PreviewData'; import { DiagramModel } from '@/utils/data'; import { usePreviewModelDataMutation } from '@/apollo/client/graphql/model.generated'; export type Props = DiagramModel; export default function ModelMetadata(props: Props) { const { modelId, displayName, referenceName, fields = [], calculatedFields = [], relationFields = [], description, } = props || {}; const [previewModelData, previewModelDataResult] = usePreviewModelDataMutation({ onError: (error) => console.error(error), }); // Model preview data should show alias as column name. const fieldsMap = useMemo(() => keyBy(fields, 'referenceName'), [fields]); const previewData = useMemo(() => { const previewModelData = previewModelDataResult.data?.previewModelData; const columns = (previewModelData?.columns || []).map((column) => { const alias = fieldsMap[column.name]?.displayName; return { ...column, name: alias || column.name }; }); return { ...previewModelData, columns }; }, [fieldsMap, previewModelDataResult.data]); const onPreviewData = () => { previewModelData({ variables: { where: { id: modelId } } }); }; return ( <>
Name
{referenceName || '-'}
Alias
{displayName || '-'}
Description
{description || '-'}
Columns ({fields.length})
{!!calculatedFields.length && (
Calculated fields ({calculatedFields.length})
)} {!!relationFields.length && (
Relationships ({relationFields.length})
)}
Data preview (100 rows)
); } ================================================ FILE: wren-ui/src/components/pages/modeling/metadata/ViewMetadata.tsx ================================================ import { Button, Typography } from 'antd'; import SQLCodeBlock from '@/components/code/SQLCodeBlock'; import PreviewData from '@/components/dataPreview/PreviewData'; import { COLUMN } from '@/components/table/BaseTable'; import FieldTable from '@/components/table/FieldTable'; import { DiagramView } from '@/utils/data'; import { usePreviewViewDataMutation } from '@/apollo/client/graphql/view.generated'; export type Props = DiagramView; export default function ViewMetadata(props: Props) { const { displayName, description, fields = [], statement, viewId, } = props || {}; const [previewViewData, previewViewDataResult] = usePreviewViewDataMutation({ onError: (error) => console.error(error), }); const onPreviewData = () => { previewViewData({ variables: { where: { id: viewId } } }); }; // View only can input Name (alias), so it should show alias as Name in metadata. return ( <>
Name
{displayName || '-'}
Description
{description || '-'}
Columns ({fields.length})
SQL statement
Data preview (100 rows)
); } ================================================ FILE: wren-ui/src/components/pages/setup/ButtonItem.tsx ================================================ import Image from 'next/image'; import { Button } from 'antd'; import styled from 'styled-components'; import Icon from '@/import/icon'; import { IterableComponent } from '@/utils/iteration'; import { ButtonOption } from './utils'; import { SampleDatasetName } from '@/apollo/client/graphql/__types__'; const StyledButton = styled(Button)` border: 2px var(--gray-4) solid; background-color: var(--gray-2); border-radius: 4px; width: 100%; height: auto; &:focus { border: 2px var(--gray-4) solid; background-color: var(--gray-2); } &:hover { border-color: var(--geekblue-6); background-color: var(--gray-2); } &.is-active { border-color: var(--geekblue-6) !important; background-color: var(--gray-2) !important; } &:disabled { opacity: 0.5; } // loading of button .ant-btn-loading-icon .anticon { font-size: 24px; } `; const StyledIcon = styled(Icon)` width: 40px; height: 40px; font-size: 32px; display: inline-flex; justify-content: center; align-items: center; `; const PlainImage = styled.div` border: 1px var(--gray-4) solid; background-color: white; width: 40px; height: 40px; `; const ComingSoon = styled.div` border: 1px var(--gray-7) solid; color: var(--gray-7); font-size: 8px; padding: 2px 6px; border-radius: 999px; &:before { content: 'COMING SOON'; } `; type Props = ButtonOption & { selectedTemplate: SampleDatasetName; onSelect: (value: string) => void; }; export default function ButtonItem(props: IterableComponent) { const { value, disabled, submitting, logo, IconComponent, label, onSelect, selectedTemplate, } = props; const isSelected = selectedTemplate === value; const loading = isSelected && submitting; return ( onSelect(value)} >
{logo ? ( ) : IconComponent ? ( ) : ( )} {label}
{disabled && }
); } ================================================ FILE: wren-ui/src/components/pages/setup/ConnectDataSource.tsx ================================================ import Image from 'next/image'; import Link from 'next/link'; import { Alert, Typography, Form, Row, Col, Button } from 'antd'; import styled from 'styled-components'; import { DATA_SOURCES } from '@/utils/enum/dataSources'; import { getDataSource, getPostgresErrorMessage } from './utils'; const StyledForm = styled(Form)` border: 1px var(--gray-4) solid; border-radius: 4px; `; const DataSource = styled.div` border: 1px var(--gray-4) solid; border-radius: 4px; `; interface Props { dataSource: DATA_SOURCES; onNext: (data: any) => void; onBack: () => void; submitting: boolean; connectError?: Record; } export default function ConnectDataSource(props: Props) { const { connectError, dataSource, submitting, onNext, onBack } = props; const [form] = Form.useForm(); const current = getDataSource(dataSource); const submit = () => { form .validateFields() .then((values) => { onNext && onNext({ properties: values }); }) .catch((error) => { console.error(error); }); }; return ( <> Connect the data source Vote for your favorite data sources on{' '} GitHub .
{current.label} Learn more information in the {current.label}{' '} setup guide . {connectError && ( )} ); } ================================================ FILE: wren-ui/src/components/pages/setup/ContainerCard.tsx ================================================ import styled from 'styled-components'; import { Card, Steps } from 'antd'; const Container = styled.div<{ maxWidth?: number }>` max-width: ${(props) => props.maxWidth || 1200}px; margin: 68px auto; `; interface Props { step: number; children: React.ReactNode; maxWidth?: number; } export default function ContainerCard(props: Props) { const { step, maxWidth } = props; return (
{props.children}
); } ================================================ FILE: wren-ui/src/components/pages/setup/DefineRelations.tsx ================================================ import { useEffect, useState } from 'react'; import { omit } from 'lodash'; import { Button, Col, Popconfirm, Row, Space, Spin, Typography, Alert, } from 'antd'; import type { ColumnsType } from 'antd/es/table'; import DeleteOutlined from '@ant-design/icons/DeleteOutlined'; import EditOutlined from '@ant-design/icons/EditOutlined'; import PlusOutlined from '@ant-design/icons/PlusOutlined'; import ModelRelationSelectionTable, { RelationsDataType, } from '@/components/table/ModelRelationSelectionTable'; import { getJoinTypeText } from '@/utils/data'; import useModalAction from '@/hooks/useModalAction'; import RelationModal, { RelationFieldValue, RelationFormValues, } from '@/components/modals/RelationModal'; import { convertFormValuesToIdentifier } from '@/hooks/useCombineFieldOptions'; const { Title, Text } = Typography; // for omit keys const relationKeys = ['name', 'isAutoGenerated']; export interface SelectedRecommendRelations { [modelName: string]: RelationsDataType[]; } interface Props { fetching: boolean; recommendRelations: SelectedRecommendRelations; recommendNameMapping: Record; onNext: (data: { relations: SelectedRecommendRelations }) => void; onBack: () => void; onSkip: () => void; submitting: boolean; } interface EditableRelationTableProps { index: number; modelName: string; onSetRelation: (payload: { modelName: string; defaultValue?: RelationsDataType; }) => void; onDeleteRow: (modelName: string, selectedRelation: RelationsDataType) => void; relations: RelationsDataType[]; recommendNameMapping: Record; } function EditableRelationTable(props: EditableRelationTableProps) { const { index, modelName, onSetRelation, onDeleteRow, relations, recommendNameMapping, } = props; const columns: ColumnsType = [ { title: 'From', dataIndex: 'fromField', key: 'fromField', render: (fromField) => `${fromField.modelName}.${fromField.fieldName}`, width: '35%', }, { title: 'To', dataIndex: 'toField', key: 'toField', render: (toField) => `${toField.modelName}.${toField.fieldName}`, width: '35%', }, { title: 'Type', dataIndex: 'type', key: 'type', render: (type, relation) => ( <> {getJoinTypeText(type)} {relation.isAutoGenerated && ( (auto-generated) )} ), width: '30%', }, { title: '', key: 'action', width: 48, align: 'center', render: (_, record) => ( onSetRelation({ modelName, defaultValue: record, }) } /> onDeleteRow(modelName, record)} > ), }, ]; return (
( )} rowKey={(record: RelationsDataType) => `${modelName}-${record.fromField.fieldName}-${record.toField.modelName}-${record.toField.fieldName}-${index}` } />
); } export default function DefineRelations(props: Props) { const { fetching, recommendRelations, recommendNameMapping, onBack, onNext, onSkip, submitting, } = props; const [relations, setRelations] = useState(recommendRelations); const [selectedRelation, setSelectedRelation] = useState<{ modelName: string; defaultValue?: RelationsDataType; }>(null); const [showNoRecommendationAlert, setShowNoRecommendationAlert] = useState(false); useEffect(() => { setRelations(recommendRelations); const recommendRelationsValues = Object.values(recommendRelations); if (recommendRelationsValues.length === 0) return; const allEmpty = recommendRelationsValues.every( (value) => value.length === 0, ); setShowNoRecommendationAlert(allEmpty); }, [recommendRelations]); const relationModal = useModalAction(); // check is the relation is auto-generated or not const isRecommendRelation = ( modelName: string, relation: RelationsDataType, ) => { const isOriginalRelation = (recommendRelations[modelName] || []).find( (originalRelation) => JSON.stringify(omit(originalRelation, relationKeys)) === JSON.stringify(omit(relation, relationKeys)), ); return isOriginalRelation?.isAutoGenerated || false; }; const onAddRelation = (relationFormValues: RelationFormValues) => { const relation = convertFormValuesToIdentifier(relationFormValues); const modelName = relation.fromField.modelName; const isAutoGenerated = isRecommendRelation(modelName, relation); const newRelations = { ...relations, [modelName]: [ ...(relations[modelName] || []), { ...relation, isAutoGenerated }, ], }; setRelations(newRelations); }; const onCloseModal = () => { setSelectedRelation(null); relationModal.closeModal(); }; const onDeleteRow = ( modelName: string, selectedRelation: RelationsDataType, ) => { const newRelations = { ...relations, [modelName]: relations[modelName].filter( (relation) => JSON.stringify(relation) !== JSON.stringify(selectedRelation), ), }; setRelations(newRelations); }; const onSetRelation = (payload: { modelName: string; defaultValue?: RelationsDataType; }) => { setSelectedRelation(payload); relationModal.openModal(); }; const onUpdateRelation = ( modelName: string, originalRelationValue: RelationsDataType, newRelationValue: RelationFormValues, ) => { const newRelation = convertFormValuesToIdentifier(newRelationValue); const isAutoGenerated = isRecommendRelation(modelName, newRelation); const newRelations = { ...relations, [modelName]: relations[modelName].map((relation) => { if ( JSON.stringify(relation) === JSON.stringify(originalRelationValue) ) { return { ...newRelation, isAutoGenerated }; } return relation; }), }; setRelations(newRelations); }; const submit = () => { onNext && onNext({ relations }); }; return (
Define relationships You can create relationships between selected tables. We provide suggested relationships based on primary and foreign keys defined in your data source. The relationships are then added to data models. {showNoRecommendationAlert && ( )}
{Object.entries(relations).map( ([modelReferenceName, relations = []], index) => ( ), )}
{ if (selectedRelation?.defaultValue) { onUpdateRelation( selectedRelation.modelName, selectedRelation.defaultValue, values, ); } else { onAddRelation(values); } setSelectedRelation(null); }} onClose={onCloseModal} defaultValue={ selectedRelation?.defaultValue ? (omit( selectedRelation.defaultValue, relationKeys, ) as RelationFieldValue) : undefined } relations={relations} isRecommendMode={Boolean(selectedRelation?.defaultValue)} /> ); } ================================================ FILE: wren-ui/src/components/pages/setup/SelectModels.tsx ================================================ import Link from 'next/link'; import { Button, Col, Form, Row, Typography } from 'antd'; import type { ColumnsType } from 'antd/es/table'; import { ERROR_TEXTS } from '@/utils/error'; import MultiSelectBox from '@/components/table/MultiSelectBox'; import { CompactTable } from '@/apollo/client/graphql/__types__'; const { Title, Text } = Typography; interface Props { fetching: boolean; tables: CompactTable[]; onNext: (data: { selectedTables: string[] }) => void; onBack: () => void; submitting: boolean; } const columns: ColumnsType = [ { title: 'Table name', dataIndex: 'name', }, ]; export default function SelectModels(props: Props) { const { fetching, tables, onBack, onNext, submitting } = props; const [form] = Form.useForm(); const items = tables.map((item) => ({ ...item, value: item.name, })); const submit = () => { form .validateFields() .then((values) => { onNext && onNext({ selectedTables: values.tables }); }) .catch((error) => { console.error(error); }); }; return (
Select tables to create data models We will create data models based on selected tables to help AI better understand your data.
Learn more {' '} about data models.
); } ================================================ FILE: wren-ui/src/components/pages/setup/Starter.tsx ================================================ import Link from 'next/link'; import { ComponentProps, useState } from 'react'; import { Typography, Row, Col } from 'antd'; import { getDataSources, getTemplates } from './utils'; import { makeIterable } from '@/utils/iteration'; import ButtonItem from './ButtonItem'; import { DataSourceName, SampleDatasetName, } from '@/apollo/client/graphql/__types__'; const ButtonTemplate = (props: ComponentProps) => { return ( ); }; const DataSourceIterator = makeIterable(ButtonTemplate); const TemplatesIterator = makeIterable(ButtonTemplate); export default function Starter(props) { const { onNext, submitting } = props; const [template, setTemplate] = useState(); const dataSources = getDataSources(); const templates = getTemplates(); const onSelectDataSource = (value: DataSourceName) => { onNext && onNext({ dataSource: value }); }; const onSelectTemplate = (value: string) => { setTemplate(value as SampleDatasetName); onNext && onNext({ template: value }); }; return ( <> Connect a data source Vote for your favorite data sources on{' '} GitHub .
Play around with sample data
); } ================================================ FILE: wren-ui/src/components/pages/setup/dataSources/AthenaProperties.tsx ================================================ import { useEffect, useRef } from 'react'; import { Form, Input, Radio } from 'antd'; import { FORM_MODE, ATHENA_AUTH_METHOD } from '@/utils/enum'; import { ERROR_TEXTS } from '@/utils/error'; interface Props { mode?: FORM_MODE; } function AthenaClassicFields() { return ( <> ); } function AthenaOIDCFields(props: { isEditMode: boolean }) { const { isEditMode } = props; return ( <> ); } export default function AthenaProperties(props: Props) { const { mode } = props; const isEditMode = mode === FORM_MODE.EDIT; const form = Form.useFormInstance(); const initialTypeRef = useRef(null); const authType = Form.useWatch('athenaAuthType', form) as ATHENA_AUTH_METHOD; // Set default auth type when creating useEffect(() => { if (!isEditMode) { form.setFieldsValue({ athenaAuthType: ATHENA_AUTH_METHOD.classic, }); } }, [isEditMode, form]); // Preserve initial type on edit mode useEffect(() => { if (isEditMode && authType && initialTypeRef.current === null) { initialTypeRef.current = authType; } }, [isEditMode, authType]); const getIsEditModeForComponent = (component: ATHENA_AUTH_METHOD) => { if (!isEditMode) return false; const initial = initialTypeRef.current || authType; return initial === component; }; return ( <> {/* Common fields */} The S3 path where Athena stores query results and metadata.
Find this in Athena console under{' '} Settings → Query result location. } rules={[ { required: true, message: ERROR_TEXTS.CONNECTION.S3_STAGING_DIR.REQUIRED, }, ]} >
{/* Authentication method switch */} AWS credentials OIDC (web identity token) Instance Profile {/* Conditional auth fields */} {authType === ATHENA_AUTH_METHOD.classic && } {authType === ATHENA_AUTH_METHOD.oidc && ( )} {authType === ATHENA_AUTH_METHOD.instance_profile && (
We will automatically detect AWS credentials from the Instance Profile role assigned to this compute environment (EC2, ECS, EKS).
)} ); } ================================================ FILE: wren-ui/src/components/pages/setup/dataSources/BigQueryProperties.tsx ================================================ import { useEffect, useState } from 'react'; import { Form, Input, Button, Upload, UploadProps, message } from 'antd'; import UploadOutlined from '@ant-design/icons/UploadOutlined'; import { ERROR_TEXTS } from '@/utils/error'; import { FORM_MODE } from '@/utils/enum'; import { readFileContent } from '@/utils/file'; interface Props { mode?: FORM_MODE; } const UploadCredentials = (props: { onChange?: (value: string) => void; value?: string; }) => { const { onChange, value } = props; const [fileList, setFileList] = useState([]); useEffect(() => { if (!value) setFileList([]); }, [value]); const onUploadChange = async (info) => { const { file, fileList } = info; if (fileList.length) { const uploadFile = fileList[0]; try { const result = await readFileContent(file.originFileObj); const parsedJson = JSON.parse(result); onChange && onChange(parsedJson); setFileList([uploadFile]); } catch (error) { console.error('Failed to handle file', error); message.error( 'Failed to handle file. Please upload a valid credentials file.', ); } } }; const onRemove = () => { setFileList([]); onChange && onChange(undefined); }; return ( ); }; export default function BigQueryProperties(props: Props) { const { mode } = props; const isEditMode = mode === FORM_MODE.EDIT; return ( <> ); } ================================================ FILE: wren-ui/src/components/pages/setup/dataSources/ClickHouseProperties.tsx ================================================ import { Form, Input, Switch } from 'antd'; import { ERROR_TEXTS } from '@/utils/error'; import { FORM_MODE } from '@/utils/enum'; import { hostValidator } from '@/utils/validator'; interface Props { mode?: FORM_MODE; } export default function ClickHouseProperties(props: Props) { const { mode } = props; const isEditMode = mode === FORM_MODE.EDIT; return ( <> ); } ================================================ FILE: wren-ui/src/components/pages/setup/dataSources/DatabricksProperties.tsx ================================================ import { useEffect } from 'react'; import { Form, Input, Radio } from 'antd'; import { FORM_MODE, DATABRICKS_AUTH_METHOD } from '@/utils/enum'; import { ERROR_TEXTS } from '@/utils/error'; import { hostValidator } from '@/utils/validator'; interface Props { mode?: FORM_MODE; } export default function DatabricksProperties(props: Props) { const { mode } = props; const isEditMode = mode === FORM_MODE.EDIT; const form = Form.useFormInstance(); const databricksType = Form.useWatch( 'databricksType', form, ) as DATABRICKS_AUTH_METHOD; useEffect(() => { if (!isEditMode) { form.setFieldsValue({ databricksType: DATABRICKS_AUTH_METHOD.token, }); } }, [isEditMode, form]); return ( <> Personal Access Token (PAT) Service Principal {databricksType === DATABRICKS_AUTH_METHOD.token && ( )} {databricksType === DATABRICKS_AUTH_METHOD.service_principal && ( <> )} ); } ================================================ FILE: wren-ui/src/components/pages/setup/dataSources/DuckDBProperties.tsx ================================================ import Link from 'next/link'; import { Col, Form, Input, Button, Row } from 'antd'; import { ERROR_TEXTS } from '@/utils/error'; import DeleteOutlined from '@ant-design/icons/DeleteOutlined'; import PlusOutlined from '@ant-design/icons/PlusOutlined'; const { TextArea } = Input; export default function DuckDBProperties() { return ( <>