mage-ai 0.9.58__py3-none-any.whl → 0.9.59__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of mage-ai might be problematic. Click here for more details.
- mage_ai/api/logging.py +11 -7
- mage_ai/api/policies/BlockPolicy.py +1 -0
- mage_ai/api/policies/CommandCenterItemPolicy.py +56 -0
- mage_ai/api/policies/CustomTemplatePolicy.py +0 -3
- mage_ai/api/policies/GitBranchPolicy.py +8 -1
- mage_ai/api/policies/GitFilePolicy.py +1 -0
- mage_ai/api/policies/PipelinePolicy.py +2 -0
- mage_ai/api/policies/PipelineSchedulePolicy.py +1 -0
- mage_ai/api/policies/VersionControlBranchPolicy.py +98 -0
- mage_ai/api/policies/VersionControlFilePolicy.py +96 -0
- mage_ai/api/policies/VersionControlProjectPolicy.py +92 -0
- mage_ai/api/policies/VersionControlRemotePolicy.py +94 -0
- mage_ai/api/presenters/CommandCenterItemPresenter.py +19 -0
- mage_ai/api/presenters/GitBranchPresenter.py +2 -0
- mage_ai/api/presenters/GitCustomBranchPresenter.py +1 -0
- mage_ai/api/presenters/PipelinePresenter.py +5 -5
- mage_ai/api/presenters/PipelineSchedulePresenter.py +4 -0
- mage_ai/api/presenters/VersionControlBranchPresenter.py +15 -0
- mage_ai/api/presenters/VersionControlFilePresenter.py +15 -0
- mage_ai/api/presenters/VersionControlProjectPresenter.py +14 -0
- mage_ai/api/presenters/VersionControlRemotePresenter.py +15 -0
- mage_ai/api/resources/BlockResource.py +110 -80
- mage_ai/api/resources/CommandCenterItemResource.py +29 -0
- mage_ai/api/resources/FileResource.py +15 -1
- mage_ai/api/resources/FolderResource.py +2 -1
- mage_ai/api/resources/GitBranchResource.py +183 -108
- mage_ai/api/resources/GitCustomBranchResource.py +9 -2
- mage_ai/api/resources/GitFileResource.py +26 -13
- mage_ai/api/resources/KernelResource.py +9 -1
- mage_ai/api/resources/LogResource.py +1 -1
- mage_ai/api/resources/OauthResource.py +4 -5
- mage_ai/api/resources/PipelineResource.py +71 -38
- mage_ai/api/resources/PipelineRunResource.py +7 -2
- mage_ai/api/resources/PullRequestResource.py +12 -3
- mage_ai/api/resources/SearchResultResource.py +4 -4
- mage_ai/api/resources/VersionControlBranchResource.py +85 -0
- mage_ai/api/resources/VersionControlFileResource.py +65 -0
- mage_ai/api/resources/VersionControlProjectResource.py +46 -0
- mage_ai/api/resources/VersionControlRemoteResource.py +64 -0
- mage_ai/authentication/oauth/constants.py +13 -16
- mage_ai/authentication/operation_history/models.py +11 -32
- mage_ai/authentication/operation_history/utils.py +14 -14
- mage_ai/authentication/permissions/constants.py +5 -0
- mage_ai/authentication/providers/active_directory.py +2 -2
- mage_ai/authentication/providers/bitbucket.py +2 -2
- mage_ai/authentication/providers/constants.py +6 -12
- mage_ai/authentication/providers/ghe.py +2 -2
- mage_ai/authentication/providers/google.py +2 -2
- mage_ai/authentication/providers/okta.py +2 -2
- mage_ai/cache/base.py +11 -3
- mage_ai/cache/block.py +116 -32
- mage_ai/cache/block_action_object/__init__.py +52 -43
- mage_ai/cache/constants.py +1 -0
- mage_ai/cache/file.py +114 -0
- mage_ai/cache/pipeline.py +34 -8
- mage_ai/cache/tag.py +51 -10
- mage_ai/cache/utils.py +44 -3
- mage_ai/cluster_manager/kubernetes/workload_manager.py +9 -1
- mage_ai/command_center/__init__.py +0 -0
- mage_ai/command_center/applications/__init__.py +0 -0
- mage_ai/command_center/applications/constants.py +96 -0
- mage_ai/command_center/applications/factory.py +54 -0
- mage_ai/command_center/blocks/__init__.py +0 -0
- mage_ai/command_center/blocks/factory.py +39 -0
- mage_ai/command_center/blocks/utils.py +127 -0
- mage_ai/command_center/constants.py +66 -0
- mage_ai/command_center/factory.py +161 -0
- mage_ai/command_center/files/__init__.py +0 -0
- mage_ai/command_center/files/constants.py +235 -0
- mage_ai/command_center/files/factory.py +86 -0
- mage_ai/command_center/models.py +442 -0
- mage_ai/command_center/pipeline_runs/__init__.py +0 -0
- mage_ai/command_center/pipeline_runs/utils.py +141 -0
- mage_ai/command_center/pipelines/__init__.py +0 -0
- mage_ai/command_center/pipelines/constants.py +118 -0
- mage_ai/command_center/pipelines/factory.py +132 -0
- mage_ai/command_center/pipelines/utils.py +120 -0
- mage_ai/command_center/service.py +45 -0
- mage_ai/command_center/settings.py +37 -0
- mage_ai/command_center/support/__init__.py +0 -0
- mage_ai/command_center/support/constants.py +46 -0
- mage_ai/command_center/triggers/__init__.py +0 -0
- mage_ai/command_center/triggers/factory.py +49 -0
- mage_ai/command_center/triggers/utils.py +463 -0
- mage_ai/command_center/utils.py +30 -0
- mage_ai/data_preparation/executors/azure_container_instance_executor.py +1 -1
- mage_ai/data_preparation/executors/block_executor.py +68 -19
- mage_ai/data_preparation/executors/ecs_block_executor.py +2 -2
- mage_ai/data_preparation/executors/executor_factory.py +2 -0
- mage_ai/data_preparation/executors/gcp_cloud_run_block_executor.py +1 -1
- mage_ai/data_preparation/executors/k8s_block_executor.py +2 -2
- mage_ai/data_preparation/executors/pyspark_block_executor.py +7 -1
- mage_ai/data_preparation/git/__init__.py +29 -11
- mage_ai/data_preparation/git/api.py +14 -13
- mage_ai/data_preparation/git/clients/base.py +4 -8
- mage_ai/data_preparation/git/clients/github.py +1 -0
- mage_ai/data_preparation/git/utils.py +5 -7
- mage_ai/data_preparation/models/block/__init__.py +556 -329
- mage_ai/data_preparation/models/block/content.py +111 -0
- mage_ai/data_preparation/models/block/data_integration/mixins.py +1 -0
- mage_ai/data_preparation/models/block/dbt/block.py +29 -19
- mage_ai/data_preparation/models/block/dbt/block_sql.py +50 -260
- mage_ai/data_preparation/models/block/dbt/block_yaml.py +74 -156
- mage_ai/data_preparation/models/block/dbt/dbt_adapter.py +22 -10
- mage_ai/data_preparation/models/block/dbt/profiles.py +19 -15
- mage_ai/data_preparation/models/block/dbt/project.py +3 -0
- mage_ai/data_preparation/models/block/dynamic/constants.py +0 -0
- mage_ai/data_preparation/models/block/dynamic/dynamic_child.py +507 -47
- mage_ai/data_preparation/models/block/dynamic/utils.py +432 -1
- mage_ai/data_preparation/models/block/platform/mixins.py +68 -44
- mage_ai/data_preparation/models/block/r/__init__.py +19 -9
- mage_ai/data_preparation/models/block/sql/__init__.py +34 -20
- mage_ai/data_preparation/models/block/sql/utils/shared.py +4 -1
- mage_ai/data_preparation/models/block/utils.py +176 -71
- mage_ai/data_preparation/models/constants.py +7 -0
- mage_ai/data_preparation/models/file.py +21 -2
- mage_ai/data_preparation/models/pipeline.py +20 -8
- mage_ai/data_preparation/models/project/__init__.py +12 -7
- mage_ai/data_preparation/models/project/constants.py +1 -0
- mage_ai/data_preparation/models/triggers/__init__.py +7 -0
- mage_ai/data_preparation/models/utils.py +20 -0
- mage_ai/data_preparation/models/variable.py +113 -15
- mage_ai/data_preparation/shared/utils.py +6 -3
- mage_ai/data_preparation/storage/base_storage.py +17 -0
- mage_ai/data_preparation/storage/gcs_storage.py +4 -0
- mage_ai/data_preparation/storage/local_storage.py +15 -0
- mage_ai/data_preparation/storage/s3_storage.py +4 -0
- mage_ai/data_preparation/templates/data_exporters/qdrant.py +0 -1
- mage_ai/data_preparation/templates/data_loaders/qdrant.py +2 -1
- mage_ai/data_preparation/variable_manager.py +1 -0
- mage_ai/io/base.py +4 -1
- mage_ai/io/bigquery.py +25 -16
- mage_ai/io/clickhouse.py +3 -0
- mage_ai/io/druid.py +3 -0
- mage_ai/io/mongodb.py +1 -1
- mage_ai/io/pinot.py +3 -0
- mage_ai/io/postgres.py +13 -0
- mage_ai/io/snowflake.py +4 -0
- mage_ai/io/spark.py +8 -3
- mage_ai/io/sql.py +6 -0
- mage_ai/orchestration/db/__init__.py +26 -19
- mage_ai/orchestration/db/cache.py +4 -3
- mage_ai/orchestration/db/models/schedules.py +72 -16
- mage_ai/orchestration/db/models/schedules_project_platform.py +2 -3
- mage_ai/orchestration/pipeline_scheduler_original.py +19 -11
- mage_ai/orchestration/pipeline_scheduler_project_platform.py +20 -11
- mage_ai/presenters/interactions/constants.py +1 -0
- mage_ai/presenters/interactions/models.py +4 -3
- mage_ai/presenters/pages/models/client_pages/pipeline_schedules.py +1 -1
- mage_ai/server/constants.py +1 -1
- mage_ai/server/frontend_dist/404.html +11 -11
- mage_ai/server/frontend_dist/_next/static/PPQxHOmWVJ0iQFzG2rc8m/_buildManifest.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/1235.c9ed47779baccc05.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/125-029194ff22eb33a5.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/1557-4f7485c2e2228f77.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/2474-8e702cea23ddd16d.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/2479-727fa69ee9be6fab.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/26-38bc9380422f3900.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/2717-3e7ea8543b3825b7.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/3366-420721116ea5a665.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/3449-a9c98239582cd6f0.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/3548-13563a1ff815f922.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/3943-9e0a8ba0db34b35f.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/4371-ef23f95888d6cd11.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/4632.a4171dbf46b31c7c.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/523-be11ad59861d00ca.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/5457-d582b00545b4cb5e.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/5831-2abc4063e887a03e.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/6085-692d2f784c0504f2.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/635-1e8857c2b6dde289.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/7022-0d52dd8868621fb0.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/7264-d05f4b7088533f6f.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/7361-b3d661ec743bfadf.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/737-cc6467310a130dd9.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/{4495-4f0340aa82e0c623.js → 7674-9ec4fe64b5bf64d5.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/8038-85d715c8c8394827.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/8095-bdce03896ef9639a.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/8146-6bed4e7401e067e6.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/8192-0c0b91523a38c4ca.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/8432-f736d101fc6d9215.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/8513-d207733b485c8d03.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/9264-e7e040a54d34360c.js → frontend_dist/_next/static/chunks/9264-7cd9cd0ba86ec5e4.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/9265-d2a1aaec75ec69b8.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/9440-54add041c392517f.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/9624-59b2f803f9c88cd6.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/9832-67896490f6e8a014.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/bd1a647f.fe5d87096be24a62.js → frontend_dist/_next/static/chunks/bd1a647f.04f7913662092327.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/404-7cabe357906f44f2.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/_app-a11bd2ebe11b3fd2.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/block-layout-ffca51945cd154ef.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/compute-3ba957769292db80.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/files-45679fd18b3edd82.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/global-data-products/[...slug]-95735a218106aa99.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/{global-data-products-cf98c2e4d20fd92c.js → global-data-products-81d6c7fd9a9cff38.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/global-hooks/[...slug]-eb4421d51fb7368f.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/global-hooks-a8c712e20512fede.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/files-f1be1d4735ba6919.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/settings-febe676687966276.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/users/[user]-70efe222130490b5.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/users/new-0914c36b3c8fd59f.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/{users-81e6e5319a59cd07.js → users-4f12e989e7809ef9.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage-809d4c99b44991a1.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/oauth-0436d395963cd27a.js → frontend_dist/_next/static/chunks/pages/oauth-aa9079c8dbaea3a5.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/overview-4e30fb5b18383b71.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipeline-runs-5d31c3aace39182d.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-85a80ee66f60a65c.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills-0bd74047e257e6d9.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/dashboard-80619dc504d0103b.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-3cc8d74ff8525bfd.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/logs-cdc379ff24ff8858.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runs-03396d6086003e16.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-d6d920758654f6d9.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors-27727bb87be506c3.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs/[run]-16aab67743651a0b.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs-e3ca1bedb660b252.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/settings-9d58701fe7213727.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/syncs-0041fd76ee15e49f.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-780be9a2da697915.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers-db8bb970b1f2273f.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines-a3422b0ab1dbacd7.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/platform/global-hooks/[...slug]-987a1603f4201943.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/platform/global-hooks-3dc8bf89cab2722b.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/account/profile-43d3f2a5071b9537.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/platform/preferences-c97b1a39b22c112a.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/platform/settings-49efb66da67554ca.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/permissions/{[...slug]-be6aaec07c138656.js → [...slug]-5117d3555972484c.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/permissions-ee1c19d4a192ae4d.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/preferences-4dc5724486ee3396.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/roles/{[...slug]-f380d293cff7592b.js → [...slug]-fa095aac732368c3.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/{roles-ddce04fae28bd7f6.js → roles-db6d71f8692a33e7.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/sync-data-99c6a263d2ab9553.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/users/{[...slug]-213a43564fdfbe17.js → [...slug]-9d881ac0a3db9baa.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/users-bee414d57c4b55d7.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/sign-in-e7030e1a7a9e88e1.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/templates/[...slug]-312afc9a3f8d0a4f.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/templates-e5300c340aa94c6b.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/terminal-fa7ca0c86142d146.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/test-bd51b3918b39329e.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/triggers-5158a9d98d2459e8.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/version-control-5ce099a7abb354ff.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/{webpack-fea697dd168c6d0c.js → webpack-efa55343114c8128.js} +1 -1
- mage_ai/server/{frontend_dist_base_path_template/_next/static/css/d1e8e64d0b07af2f.css → frontend_dist/_next/static/css/b59541b123fd7191.css} +1 -1
- mage_ai/server/frontend_dist/block-layout.html +3 -3
- mage_ai/server/frontend_dist/compute.html +11 -11
- mage_ai/server/frontend_dist/files.html +11 -11
- mage_ai/server/frontend_dist/global-data-products/[...slug].html +11 -11
- mage_ai/server/frontend_dist/global-data-products.html +11 -11
- mage_ai/server/frontend_dist/global-hooks/[...slug].html +11 -11
- mage_ai/server/frontend_dist/global-hooks.html +11 -11
- mage_ai/server/frontend_dist/index.html +3 -3
- mage_ai/server/frontend_dist/manage/files.html +11 -11
- mage_ai/server/frontend_dist/manage/settings.html +11 -11
- mage_ai/server/frontend_dist/manage/users/[user].html +11 -11
- mage_ai/server/frontend_dist/manage/users/new.html +11 -11
- mage_ai/server/frontend_dist/manage/users.html +11 -11
- mage_ai/server/frontend_dist/manage.html +11 -11
- mage_ai/server/frontend_dist/oauth.html +8 -8
- mage_ai/server/frontend_dist/overview.html +11 -11
- mage_ai/server/frontend_dist/pipeline-runs.html +11 -11
- mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills/[...slug].html +11 -11
- mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills.html +11 -11
- mage_ai/server/frontend_dist/pipelines/[pipeline]/dashboard.html +11 -11
- mage_ai/server/frontend_dist/pipelines/[pipeline]/edit.html +3 -3
- mage_ai/server/frontend_dist/pipelines/[pipeline]/logs.html +11 -11
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runs.html +11 -11
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runtime.html +11 -11
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors.html +11 -11
- mage_ai/server/frontend_dist/pipelines/[pipeline]/runs/[run].html +11 -11
- mage_ai/server/frontend_dist/pipelines/[pipeline]/runs.html +11 -11
- mage_ai/server/frontend_dist/pipelines/[pipeline]/settings.html +11 -11
- mage_ai/server/frontend_dist/pipelines/[pipeline]/syncs.html +11 -11
- mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers/[...slug].html +11 -11
- mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers.html +11 -11
- mage_ai/server/frontend_dist/pipelines/[pipeline].html +3 -3
- mage_ai/server/frontend_dist/pipelines.html +11 -11
- mage_ai/server/frontend_dist/platform/global-hooks/[...slug].html +11 -11
- mage_ai/server/frontend_dist/platform/global-hooks.html +11 -11
- mage_ai/server/frontend_dist/settings/account/profile.html +11 -11
- mage_ai/server/frontend_dist/settings/platform/preferences.html +11 -11
- mage_ai/server/frontend_dist/settings/platform/settings.html +11 -11
- mage_ai/server/frontend_dist/settings/workspace/permissions/[...slug].html +11 -11
- mage_ai/server/frontend_dist/settings/workspace/permissions.html +11 -11
- mage_ai/server/frontend_dist/settings/workspace/preferences.html +11 -11
- mage_ai/server/frontend_dist/settings/workspace/roles/[...slug].html +11 -11
- mage_ai/server/frontend_dist/settings/workspace/roles.html +11 -11
- mage_ai/server/frontend_dist/settings/workspace/sync-data.html +11 -11
- mage_ai/server/frontend_dist/settings/workspace/users/[...slug].html +11 -11
- mage_ai/server/frontend_dist/settings/workspace/users.html +11 -11
- mage_ai/server/frontend_dist/settings.html +3 -3
- mage_ai/server/frontend_dist/sign-in.html +41 -41
- mage_ai/server/frontend_dist/templates/[...slug].html +11 -11
- mage_ai/server/frontend_dist/templates.html +11 -11
- mage_ai/server/frontend_dist/terminal.html +11 -11
- mage_ai/server/frontend_dist/test.html +3 -5
- mage_ai/server/frontend_dist/triggers.html +11 -11
- mage_ai/server/frontend_dist/version-control.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/404.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1235.c9ed47779baccc05.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/125-029194ff22eb33a5.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1557-4f7485c2e2228f77.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/2474-8e702cea23ddd16d.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/2479-727fa69ee9be6fab.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/26-38bc9380422f3900.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/2717-3e7ea8543b3825b7.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3366-420721116ea5a665.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3449-a9c98239582cd6f0.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3548-13563a1ff815f922.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3943-9e0a8ba0db34b35f.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/4371-ef23f95888d6cd11.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/4632.a4171dbf46b31c7c.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/523-be11ad59861d00ca.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5457-d582b00545b4cb5e.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5831-2abc4063e887a03e.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/6085-692d2f784c0504f2.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/635-1e8857c2b6dde289.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/7022-0d52dd8868621fb0.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/7264-d05f4b7088533f6f.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/7361-b3d661ec743bfadf.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/737-cc6467310a130dd9.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{4495-4f0340aa82e0c623.js → 7674-9ec4fe64b5bf64d5.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8038-85d715c8c8394827.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8095-bdce03896ef9639a.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8146-6bed4e7401e067e6.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8192-0c0b91523a38c4ca.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8432-f736d101fc6d9215.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8513-d207733b485c8d03.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/9264-e7e040a54d34360c.js → frontend_dist_base_path_template/_next/static/chunks/9264-7cd9cd0ba86ec5e4.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9265-d2a1aaec75ec69b8.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9440-54add041c392517f.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9624-59b2f803f9c88cd6.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9832-67896490f6e8a014.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/bd1a647f.fe5d87096be24a62.js → frontend_dist_base_path_template/_next/static/chunks/bd1a647f.04f7913662092327.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/404-7cabe357906f44f2.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/_app-a11bd2ebe11b3fd2.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/block-layout-ffca51945cd154ef.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/compute-3ba957769292db80.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/files-45679fd18b3edd82.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-data-products/[...slug]-95735a218106aa99.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{global-data-products-cf98c2e4d20fd92c.js → global-data-products-81d6c7fd9a9cff38.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-hooks/[...slug]-eb4421d51fb7368f.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-hooks-a8c712e20512fede.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/files-f1be1d4735ba6919.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/settings-febe676687966276.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/users/[user]-70efe222130490b5.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/users/new-0914c36b3c8fd59f.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/{users-81e6e5319a59cd07.js → users-4f12e989e7809ef9.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage-809d4c99b44991a1.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/oauth-0436d395963cd27a.js → frontend_dist_base_path_template/_next/static/chunks/pages/oauth-aa9079c8dbaea3a5.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/overview-4e30fb5b18383b71.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipeline-runs-5d31c3aace39182d.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-85a80ee66f60a65c.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills-0bd74047e257e6d9.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/dashboard-80619dc504d0103b.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/edit-3cc8d74ff8525bfd.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/logs-cdc379ff24ff8858.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runs-03396d6086003e16.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-d6d920758654f6d9.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors-27727bb87be506c3.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/runs/[run]-16aab67743651a0b.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/runs-e3ca1bedb660b252.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/settings-9d58701fe7213727.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/syncs-0041fd76ee15e49f.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-780be9a2da697915.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers-db8bb970b1f2273f.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines-a3422b0ab1dbacd7.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/platform/global-hooks/[...slug]-987a1603f4201943.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/platform/global-hooks-3dc8bf89cab2722b.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/account/profile-43d3f2a5071b9537.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/platform/preferences-c97b1a39b22c112a.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/platform/settings-49efb66da67554ca.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/permissions/{[...slug]-be6aaec07c138656.js → [...slug]-5117d3555972484c.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/permissions-ee1c19d4a192ae4d.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/preferences-4dc5724486ee3396.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/roles/{[...slug]-f380d293cff7592b.js → [...slug]-fa095aac732368c3.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/{roles-ddce04fae28bd7f6.js → roles-db6d71f8692a33e7.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/sync-data-99c6a263d2ab9553.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/users/{[...slug]-213a43564fdfbe17.js → [...slug]-9d881ac0a3db9baa.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/users-bee414d57c4b55d7.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/sign-in-e7030e1a7a9e88e1.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/templates/[...slug]-312afc9a3f8d0a4f.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/templates-e5300c340aa94c6b.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/terminal-fa7ca0c86142d146.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/test-bd51b3918b39329e.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/triggers-5158a9d98d2459e8.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/version-control-5ce099a7abb354ff.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{webpack-d30cb09c85b4c4f0.js → webpack-bd35e1c7bd7b5a9a.js} +1 -1
- mage_ai/server/{frontend_dist/_next/static/css/d1e8e64d0b07af2f.css → frontend_dist_base_path_template/_next/static/css/b59541b123fd7191.css} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/do4WOsw7lNhouR0mtPTFi/_buildManifest.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/block-layout.html +3 -3
- mage_ai/server/frontend_dist_base_path_template/compute.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/files.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/global-data-products/[...slug].html +11 -11
- mage_ai/server/frontend_dist_base_path_template/global-data-products.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/global-hooks/[...slug].html +11 -11
- mage_ai/server/frontend_dist_base_path_template/global-hooks.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/index.html +3 -3
- mage_ai/server/frontend_dist_base_path_template/manage/files.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/manage/settings.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/manage/users/[user].html +11 -11
- mage_ai/server/frontend_dist_base_path_template/manage/users/new.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/manage/users.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/manage.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/oauth.html +8 -8
- mage_ai/server/frontend_dist_base_path_template/overview.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/pipeline-runs.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills/[...slug].html +11 -11
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/dashboard.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/edit.html +3 -3
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/logs.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runs.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runtime.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs/[run].html +11 -11
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/settings.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/syncs.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers/[...slug].html +11 -11
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline].html +3 -3
- mage_ai/server/frontend_dist_base_path_template/pipelines.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/platform/global-hooks/[...slug].html +11 -11
- mage_ai/server/frontend_dist_base_path_template/platform/global-hooks.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/settings/account/profile.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/settings/platform/preferences.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/settings/platform/settings.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/permissions/[...slug].html +11 -11
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/permissions.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/preferences.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/roles/[...slug].html +11 -11
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/roles.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/sync-data.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/users/[...slug].html +11 -11
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/users.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/settings.html +3 -3
- mage_ai/server/frontend_dist_base_path_template/sign-in.html +39 -39
- mage_ai/server/frontend_dist_base_path_template/templates/[...slug].html +11 -11
- mage_ai/server/frontend_dist_base_path_template/templates.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/terminal.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/test.html +3 -5
- mage_ai/server/frontend_dist_base_path_template/triggers.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/version-control.html +11 -11
- mage_ai/server/logger.py +8 -2
- mage_ai/server/server.py +18 -1
- mage_ai/services/aws/ecs/config.py +3 -3
- mage_ai/services/aws/ecs/ecs.py +2 -2
- mage_ai/services/search/block_action_objects.py +59 -5
- mage_ai/settings/models/configuration_option.py +3 -1
- mage_ai/settings/platform/__init__.py +54 -18
- mage_ai/settings/repo.py +5 -4
- mage_ai/shared/custom_logger.py +213 -0
- mage_ai/shared/environments.py +4 -0
- mage_ai/shared/files.py +52 -1
- mage_ai/shared/models.py +2 -1
- mage_ai/shared/parsers.py +8 -1
- mage_ai/shared/path_fixer.py +62 -5
- mage_ai/shared/retry.py +4 -0
- mage_ai/shared/strings.py +4 -0
- mage_ai/tests/api/endpoints/test_blocks.py +101 -1
- mage_ai/tests/api/operations/base/test_base_with_user_permissions.py +4 -1
- mage_ai/tests/base_test.py +21 -2
- mage_ai/tests/cache/test_pipeline_cache.py +11 -8
- mage_ai/tests/data_preparation/executors/test_block_executor.py +55 -45
- mage_ai/tests/data_preparation/git/test_api.py +4 -4
- mage_ai/tests/data_preparation/models/block/dbt/test_block.py +75 -43
- mage_ai/tests/data_preparation/models/block/dbt/test_block_sql.py +329 -329
- mage_ai/tests/data_preparation/models/block/dbt/test_block_yaml.py +296 -296
- mage_ai/tests/data_preparation/models/block/dbt/test_dbt_adapter.py +2 -2
- mage_ai/tests/data_preparation/models/block/dbt/test_dbt_cli.py +4 -4
- mage_ai/tests/data_preparation/models/block/dbt/test_profiles.py +2 -2
- mage_ai/tests/data_preparation/models/block/dbt/test_project.py +2 -2
- mage_ai/tests/data_preparation/models/block/dbt/test_sources.py +2 -2
- mage_ai/tests/data_preparation/models/block/dynamic/test_dynamic_child_block_factory.py +477 -474
- mage_ai/tests/data_preparation/models/block/dynamic/test_dynamic_helpers.py +25 -24
- mage_ai/tests/data_preparation/models/block/platform/test_mixins.py +16 -25
- mage_ai/tests/data_preparation/models/block/test_utils.py +8 -8
- mage_ai/tests/data_preparation/models/test_block.py +6 -8
- mage_ai/tests/data_preparation/models/test_project.py +10 -5
- mage_ai/tests/data_preparation/models/test_variable.py +51 -4
- mage_ai/tests/orchestration/test_pipeline_scheduler_project_platform.py +1 -0
- mage_ai/version_control/__init__.py +0 -0
- mage_ai/version_control/models.py +288 -0
- {mage_ai-0.9.58.dist-info → mage_ai-0.9.59.dist-info}/METADATA +6 -6
- {mage_ai-0.9.58.dist-info → mage_ai-0.9.59.dist-info}/RECORD +490 -476
- mage_ai/server/frontend_dist/_next/static/0XnQ0C0nTr1w0o9CGC7wQ/_buildManifest.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/1124-d8fc76201b83b376.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/1154-2f262f7eb38ebaa1.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/1235.53172e14801844e5.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/1550-32333b36ac6b061b.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/1557-7cfe722a9b83b935.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/1598-dd776e3a92e9cccd.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/1751-5adf859690505d7b.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/1952-b2197a87dd67d8e0.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/2056-0ea1faa46646a77e.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/2213-52267f1e9ef5751c.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/2474-352ae192b826d896.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/2512-46141494a1b75897.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/2717-accc279ae116b1b9.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/2852872c-15b31a7081e6a868.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/2886-9e73e1f48f248741.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/2920.86a65e5f26ff1795.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/3437-6055fd5aa82880f6.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/3449-214fce1a0e623b47.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/3494-23a9cc2cd649abac.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/3745-3662911c364d917b.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/3763-70c7eb1fc203c903.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/3943-a49377acc514e77f.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/4052-f89c85d2c8f51931.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/4296-14eaf96d6479e673.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/4804-1254a474f238d078.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/5283-9df961e430a79bea.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/5457-b373ebdf4d05d8e2.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/5499-bc2528f8e18f61a6.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/5810-e66141c1271bced6.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/5849-f30d8694e3318a81.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/5896-7b8e36634d7d94eb.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/6043-728790621ca9014c.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/6050-e48b7f97e96bbcb6.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/6285-648f9a732e100b2f.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/6639-74eefed142e14ea6.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/6965-c613d1834c8ed92d.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/7022-ea92cb336bd1aab8.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/7361-06ef4c642a8fe8c4.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/7858-677c641010ac9160.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/8125-b9d53e425b6ddc7e.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/8146-fb8f445644e573b0.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/8432-0ace6fb7bdbc6864.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/844-1e171f361e63b36d.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/9269-40e2101f56399dcc.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/9302-913007e2f801ad65.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/9440-c51bf1e8f271cb25.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/9624-89a4b20eb3b3c754.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/976-0a8c2c4d7acd957b.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/9775-c1142b1312e8f95d.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/404-5ddd12931e0e3e41.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/_app-ec5e62e8e5bb4e4c.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/block-layout-44d7291d8f29eb36.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/compute-a6661a9c3647532a.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/files-26b899d3adb4ed19.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/global-data-products/[...slug]-9bd164317e652311.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/global-hooks/[...slug]-c87d46dc53e35638.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/global-hooks-24785a5ed4eb340d.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/files-2c5fd116ecfacb33.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/settings-8c9285af31efa3fd.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/users/[user]-ec7e0419a64ae3b2.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/users/new-039e083cc068da54.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage-8e4d4f6edc515265.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/overview-b73185fdcb7a131c.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipeline-runs-97b3335bf60f8b07.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-83de126136539668.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills-50f45e96892cfb63.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/dashboard-5fe0f1de6fd365f8.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-306db9e11fa94d21.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/logs-ebea4be0562b08e3.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runs-f09d21d5c2661504.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-61e770f155ae22ef.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors-d347a4614130e2ab.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs/[run]-056c5e5080a3754f.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs-208fa8de91f152bc.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/settings-a32e02f46a816eb3.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/syncs-8012388b15f0e0a5.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-6714c72f90923cfb.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers-afc0525ef27fe1f2.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines-a91e7d86cd0540d9.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/platform/global-hooks/[...slug]-7c8e5a8908fe9c83.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/platform/global-hooks-be0684d1527587d8.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/account/profile-147660a34351147c.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/platform/preferences-ec5f01b683920ced.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/platform/settings-28aa4512c0e23ec5.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/permissions-a2850b2e0a282d16.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/preferences-b1df80674dca4713.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/sync-data-41abcd2241958dc8.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/users-a2c5859f53b5e9e1.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/sign-in-1aea2a0c373bc6ae.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/templates/[...slug]-e7485742708215d2.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/templates-b4086d30a89d6801.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/terminal-3cd171f43f0a0df8.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/test-6a22493285c47ba2.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/triggers-ad20a31dde4fe59b.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/version-control-267952b4c87927c7.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/RC0Yenm06LvZI-RWFoT5C/_buildManifest.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1124-d8fc76201b83b376.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1154-2f262f7eb38ebaa1.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1235.53172e14801844e5.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1550-32333b36ac6b061b.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1557-7cfe722a9b83b935.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1598-dd776e3a92e9cccd.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1751-5adf859690505d7b.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1952-b2197a87dd67d8e0.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/2056-0ea1faa46646a77e.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/2213-52267f1e9ef5751c.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/2474-352ae192b826d896.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/2512-46141494a1b75897.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/2717-accc279ae116b1b9.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/2852872c-15b31a7081e6a868.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/2886-9e73e1f48f248741.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/2920.86a65e5f26ff1795.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3437-6055fd5aa82880f6.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3449-214fce1a0e623b47.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3494-23a9cc2cd649abac.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3745-3662911c364d917b.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3763-70c7eb1fc203c903.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3943-a49377acc514e77f.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/4052-f89c85d2c8f51931.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/4296-14eaf96d6479e673.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/4804-1254a474f238d078.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5283-9df961e430a79bea.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5457-b373ebdf4d05d8e2.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5499-bc2528f8e18f61a6.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5810-e66141c1271bced6.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5849-f30d8694e3318a81.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5896-7b8e36634d7d94eb.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/6043-728790621ca9014c.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/6050-e48b7f97e96bbcb6.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/6285-648f9a732e100b2f.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/6639-74eefed142e14ea6.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/6965-c613d1834c8ed92d.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/7022-ea92cb336bd1aab8.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/7361-06ef4c642a8fe8c4.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/7858-677c641010ac9160.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8125-b9d53e425b6ddc7e.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8146-fb8f445644e573b0.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8432-0ace6fb7bdbc6864.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/844-1e171f361e63b36d.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9269-40e2101f56399dcc.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9302-913007e2f801ad65.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9440-c51bf1e8f271cb25.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9624-89a4b20eb3b3c754.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/976-0a8c2c4d7acd957b.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9775-c1142b1312e8f95d.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/404-5ddd12931e0e3e41.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/_app-ec5e62e8e5bb4e4c.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/block-layout-44d7291d8f29eb36.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/compute-a6661a9c3647532a.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/files-26b899d3adb4ed19.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-data-products/[...slug]-9bd164317e652311.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-hooks/[...slug]-c87d46dc53e35638.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-hooks-24785a5ed4eb340d.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/files-2c5fd116ecfacb33.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/settings-8c9285af31efa3fd.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/users/[user]-ec7e0419a64ae3b2.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/users/new-039e083cc068da54.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage-8e4d4f6edc515265.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/overview-b73185fdcb7a131c.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipeline-runs-97b3335bf60f8b07.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-83de126136539668.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills-50f45e96892cfb63.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/dashboard-5fe0f1de6fd365f8.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/edit-306db9e11fa94d21.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/logs-ebea4be0562b08e3.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runs-f09d21d5c2661504.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-61e770f155ae22ef.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors-d347a4614130e2ab.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/runs/[run]-056c5e5080a3754f.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/runs-208fa8de91f152bc.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/settings-a32e02f46a816eb3.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/syncs-8012388b15f0e0a5.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-6714c72f90923cfb.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers-afc0525ef27fe1f2.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines-a91e7d86cd0540d9.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/platform/global-hooks/[...slug]-7c8e5a8908fe9c83.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/platform/global-hooks-be0684d1527587d8.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/account/profile-147660a34351147c.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/platform/preferences-ec5f01b683920ced.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/platform/settings-28aa4512c0e23ec5.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/permissions-a2850b2e0a282d16.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/preferences-b1df80674dca4713.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/sync-data-41abcd2241958dc8.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/users-a2c5859f53b5e9e1.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/sign-in-1aea2a0c373bc6ae.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/templates/[...slug]-e7485742708215d2.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/templates-b4086d30a89d6801.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/terminal-3cd171f43f0a0df8.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/test-6a22493285c47ba2.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/triggers-ad20a31dde4fe59b.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/version-control-267952b4c87927c7.js +0 -1
- /mage_ai/server/frontend_dist/_next/static/{0XnQ0C0nTr1w0o9CGC7wQ → PPQxHOmWVJ0iQFzG2rc8m}/_ssgManifest.js +0 -0
- /mage_ai/server/frontend_dist_base_path_template/_next/static/{RC0Yenm06LvZI-RWFoT5C → do4WOsw7lNhouR0mtPTFi}/_ssgManifest.js +0 -0
- {mage_ai-0.9.58.dist-info → mage_ai-0.9.59.dist-info}/LICENSE +0 -0
- {mage_ai-0.9.58.dist-info → mage_ai-0.9.59.dist-info}/WHEEL +0 -0
- {mage_ai-0.9.58.dist-info → mage_ai-0.9.59.dist-info}/entry_points.txt +0 -0
- {mage_ai-0.9.58.dist-info → mage_ai-0.9.59.dist-info}/top_level.txt +0 -0
mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-306db9e11fa94d21.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2551,5810,3449],{62072:function(e,n,t){"use strict";function i(e){return null==e?void 0:e[0]}function o(e){return null==e?void 0:e[1]}t.d(n,{l8:function(){return i},xf:function(){return o}})},59309:function(e,n,t){"use strict";t.d(n,{ZP:function(){return s}});var i=t(12759),o=t(27500),r=t(82610),l=t(34812),u=t(77944),c={expand:i.Z,diverging:o.Z,none:r.Z,silhouette:l.Z,wiggle:u.Z};Object.keys(c);function s(e){return e&&c[e]||c.none}},18246:function(e,n,t){"use strict";t.d(n,{ZP:function(){return s}});var i=t(39586),o=t(25516),r=t(54164),l=t(8512),u=t(2010),c={ascending:i.Z,descending:o.Z,insideout:r.Z,none:l.Z,reverse:u.Z};Object.keys(c);function s(e){return e&&c[e]||c.none}},1589:function(e,n,t){"use strict";var i=t(82684);var o="function"===typeof Object.is?Object.is:function(e,n){return e===n&&(0!==e||1/e===1/n)||e!==e&&n!==n},r=i.useState,l=i.useEffect,u=i.useLayoutEffect,c=i.useDebugValue;function s(e){var n=e.getSnapshot;e=e.value;try{var t=n();return!o(e,t)}catch(i){return!0}}var a="undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement?function(e,n){return n()}:function(e,n){var t=n(),i=r({inst:{value:t,getSnapshot:n}}),o=i[0].inst,a=i[1];return u((function(){o.value=t,o.getSnapshot=n,s(o)&&a({inst:o})}),[e,t,n]),l((function(){return s(o)&&a({inst:o}),e((function(){s(o)&&a({inst:o})}))}),[e]),c(t),t};n.useSyncExternalStore=void 0!==i.useSyncExternalStore?i.useSyncExternalStore:a},73847:function(e,n,t){"use strict";var i=t(82684),o=t(48216);var r="function"===typeof Object.is?Object.is:function(e,n){return e===n&&(0!==e||1/e===1/n)||e!==e&&n!==n},l=o.useSyncExternalStore,u=i.useRef,c=i.useEffect,s=i.useMemo,a=i.useDebugValue;n.useSyncExternalStoreWithSelector=function(e,n,t,i,o){var d=u(null);if(null===d.current){var p={hasValue:!1,value:null};d.current=p}else p=d.current;d=s((function(){function e(e){if(!c){if(c=!0,l=e,e=i(e),void 0!==o&&p.hasValue){var n=p.value;if(o(n,e))return u=n}return u=e}if(n=u,r(l,e))return n;var t=i(e);return void 0!==o&&o(n,t)?n:(l=e,u=t)}var l,u,c=!1,s=void 0===t?null:t;return[function(){return e(n())},null===s?void 0:function(){return e(s())}]}),[n,t,i,o]);var f=l(e,d[0],d[1]);return c((function(){p.hasValue=!0,p.value=f}),[f]),a(f),f}},48216:function(e,n,t){"use strict";e.exports=t(1589)},81550:function(e,n,t){"use strict";e.exports=t(73847)},7432:function(e,n,t){var i={"./Active4D.json":[266,266],"./All Hallows Eve.json":[4450,4450],"./Amy.json":[88849,8849],"./Birds of Paradise.json":[78097,8097],"./Blackboard.json":[88018,6115],"./Brilliance Black.json":[73835,3835],"./Brilliance Dull.json":[6507,6507],"./Chrome DevTools.json":[22508,2508],"./Clouds Midnight.json":[49566,9566],"./Clouds.json":[57951,7951],"./Cobalt.json":[80826,826],"./Cobalt2.json":[98256,8256],"./Dawn.json":[76958,6958],"./Dominion Day.json":[89307,9307],"./Dracula.json":[33453,3453],"./Dreamweaver.json":[19363,9363],"./Eiffel.json":[82481,2481],"./Espresso Libre.json":[44776,4776],"./GitHub Dark.json":[792,792],"./GitHub Light.json":[61450,1450],"./GitHub.json":[10739,739],"./IDLE.json":[67947,7947],"./Katzenmilch.json":[81240,1240],"./Kuroir Theme.json":[4388,4388],"./LAZY.json":[25164,5164],"./MagicWB (Amiga).json":[76443,6443],"./Merbivore Soft.json":[99361,9361],"./Merbivore.json":[86042,6042],"./Monokai Bright.json":[14883,4883],"./Monokai.json":[34454,4454],"./Night Owl.json":[60261,261],"./Nord.json":[59785,9785],"./Oceanic Next.json":[58920,8920],"./Pastels on Dark.json":[38901,8901],"./Slush and Poppies.json":[26434,6434],"./Solarized-dark.json":[36116,6116],"./Solarized-light.json":[5008,5008],"./SpaceCadet.json":[20440,440],"./Sunburst.json":[68018,8018],"./Textmate (Mac Classic).json":[15824,5824],"./Tomorrow-Night-Blue.json":[81150,1150],"./Tomorrow-Night-Bright.json":[8762,8762],"./Tomorrow-Night-Eighties.json":[82545,2545],"./Tomorrow-Night.json":[99855,9855],"./Tomorrow.json":[34092,4092],"./Twilight.json":[93898,3898],"./Upstream Sunburst.json":[98807,8807],"./Vibrant Ink.json":[89927,9927],"./Xcode_default.json":[64042,4042],"./Zenburnesque.json":[33467,3467],"./iPlastic.json":[88277,8277],"./idleFingers.json":[5104,5104],"./krTheme.json":[9633,9633],"./monoindustrial.json":[15729,5729],"./themelist.json":[79437,9437]};function o(e){if(!t.o(i,e))return Promise.resolve().then((function(){var n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}));var n=i[e],o=n[0];return t.e(n[1]).then((function(){return t.t(o,19)}))}o.keys=function(){return Object.keys(i)},o.id=7432,e.exports=o},65557:function(e,n,t){"use strict";var i=t(21831),o=t(75582),r=t(82684),l=t(49555);n.Z=function(e){var n=e.children,t=e.uuid,u=e.uuids,c=void 0===u?[]:u,s=(0,l.j)("apiReloads"),a=(0,o.Z)(s,1)[0],d=(0,i.Z)(c);t&&d.push(t);var p=d.map((function(e){return String(a[e])||"-"})).join("_");return r.cloneElement(n,{key:p})}},89209:function(e,n,t){"use strict";t.d(n,{M4:function(){return d},S0:function(){return s},S_:function(){return c},Yn:function(){return p},rW:function(){return a}});var i=t(82394),o=t(21831),r=t(75582);function l(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function u(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?l(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):l(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function c(e,n){return Object.entries(n).map((function(n){var t=(0,r.Z)(n,2),i=t[0],o=t[1];return e.languages.registerCompletionItemProvider(i,{provideCompletionItems:o(e)})}))}function s(e){var n=function(e){var n="[\\w.]+",t=["import ".concat(n," as ").concat(n),"import ".concat(n),"from ".concat(n," import ").concat(n," as ").concat(n),"from ".concat(n," import ").concat(n)],i=new RegExp("(".concat(t.join("|"),")"),"g");return(0,o.Z)(e.matchAll(i)).map((function(e){return e[1]}))}(e),t="[\\w.]+",r=["from ".concat(t," import ").concat(t," as (").concat(t,")"),"from ".concat(t," import (").concat(t,")"),"import ".concat(t," as (").concat(t,")"),"import (".concat(t,")")],l=new RegExp("(".concat(r.join("|"),")"));return n.reduce((function(e,n){var t=n.match(l);if(!t)return e;var r=(0,o.Z)(t),c=r[2],s=r[3],a=r[4],d=r[5],p=c||s||a||d;return u(u({},e),{},(0,i.Z)({},p,n))}),{})}function a(e,n){var t=e;n&&(t=t.split(" as ".concat(n))[0]);var i="[\\w.]+",l=["from ".concat(i," import (").concat(i,")"),"import (".concat(i,")")],u=new RegExp("(".concat(l.join("|"),")"),"g"),c=(0,o.Z)(t.matchAll(u))[0];if(c){var s=(0,r.Z)(c,4),a=s[2],d=s[3];return a||d}}function d(e,n){return function(e,n){return e.split("\n")[n.startLineNumber-1]}(e,n).slice(0,n.startColumn-1)}function p(e){var n=new RegExp("([\\w_]+)[ ]*=[ ]*([\\w_]+)","g");return(0,o.Z)(e.matchAll(n)).map((function(e){return{assignmentValue:e[2],variableName:e[1]}}))}},89678:function(e,n,t){"use strict";t.d(n,{Ep:function(){return l},KT:function(){return s},Nk:function(){return c},aU:function(){return u}});var i=t(38626),o=t(44897),r=t(95363),l=2,u=21,c=i.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-w2hta3-0"})(["font-family:",";"," ",""],r.ry,(function(e){return"number"===typeof e.padding&&e.padding>0&&"\n padding-top: ".concat(e.padding,"px;\n background-color: ").concat((e.theme.background||o.Z.background).codeTextarea,";\n ")}),(function(e){return e.hideDuplicateMenuItems&&'\n /*\n * The (n + 10) assumes a specific number of items in the block editor context\n * menu. This includes "Run selected block", "Change All Occurrences", "Cut",\n * "Copy", "Paste", "Command Palette", and 3 dividers. The 10th item from the\n * bottom and higher are hidden to avoid duplicate shortcut items in the\n * context menu.\n */\n .monaco-menu li.action-item:nth-last-child(n + 10) {\n display: none;\n }\n '})),s=i.default.div.withConfig({displayName:"indexstyle__PlaceholderStyle",componentId:"sc-w2hta3-1"})(["padding-left:67px;position:absolute;z-index:1;"])},75810:function(e,n,t){"use strict";t.d(n,{Z:function(){return j}});var i=t(85202),o=t(66639),r=t(82684),l=t(4383),u=t(44425),c=t(30160),s=t(98464),a=t(95363),d=t(61896),p=t(89678),f=t(89209);function v(e,n,t){t.forEach((function(e){n.addAction(e)}))}var h=t(75582),m={"all-hallows-eve":"All Hallows Eve","birds-of-paradise":"Birds of Paradise","brilliance-black":"Brilliance Black","brilliance-dull":"Brilliance Dull","chrome-devtools":"Chrome DevTools","clouds-midnight":"Clouds Midnight","espresso-libre":"Espresso Libre","kuroir-theme":"Kuroir Theme","magicwb--amiga-":"MagicWB (Amiga)","merbivore-soft":"Merbivore Soft","monokai-bright":"Monokai Bright","night-owl":"Night Owl","oceanic-next":"Oceanic Next","pastels-on-dark":"Pastels on Dark","slush-and-poppies":"Slush and Poppies","solarized-dark":"Solarized-dark","solarized-light":"Solarized-light","textmate--mac-classic-":"Textmate (Mac Classic)","tomorrow-night":"Tomorrow-Night","tomorrow-night-blue":"Tomorrow-Night-Blue","tomorrow-night-bright":"Tomorrow-Night-Bright","tomorrow-night-eighties":"Tomorrow-Night-Eighties","upstream-sunburst":"Upstream Sunburst","vibrant-ink":"Vibrant Ink","xcode-default":"Xcode_default",active4d:"Active4D",amy:"Amy",blackboard:"Blackboard",clouds:"Clouds",cobalt:"Cobalt",dawn:"Dawn",dreamweaver:"Dreamweaver",eiffel:"Eiffel",github:"GitHub",idle:"IDLE",idlefingers:"idleFingers",iplastic:"iPlastic",katzenmilch:"Katzenmilch",krtheme:"krTheme",lazy:"LAZY",merbivore:"Merbivore",monoindustrial:"monoindustrial",monokai:"Monokai",spacecadet:"SpaceCadet",sunburst:"Sunburst",tomorrow:"Tomorrow",twilight:"Twilight",zenburnesque:"Zenburnesque"};var b=t(37529),g=t(28598);function x(e,n){var l=e.autocompleteProviders,x=e.autoHeight,j=e.autoSave,y=e.block,k=e.editorRef,Z=e.fontSize,P=void 0===Z?d.i3:Z,O=e.height,C=e.language,w=e.onChange,_=e.onContentSizeChangeCallback,S=e.onDidChangeCursorPosition,E=e.onMountCallback,I=e.onSave,T=e.padding,M=e.placeholder,D=e.readOnly,R=e.selected,B=(e.setSelected,e.setTextareaFocused),A=e.shortcuts,N=e.showLineNumbers,L=void 0===N||N,F=e.tabSize,U=void 0===F?4:F,H=e.textareaFocused,W=e.theme,G=void 0===W?"twilight":W,z=e.value,K=e.width,V=void 0===K?"100%":K,q=k||(0,r.useRef)(null),Y=(0,r.useRef)(null),X=(0,r.useRef)(null),Q=(0,r.useState)([]),J=Q[0],$=Q[1],ee=(0,r.useState)(null),ne=ee[0],te=ee[1],ie=(0,r.useState)(!1),oe=ie[0],re=ie[1],le=(0,r.useState)(null),ue=le[0],ce=le[1],se=(0,r.useCallback)((function(e){ce((function(n){return n!==G&&function(e){return new Promise((function(n){Promise.all([o._m.init(),t(7432)("./".concat(m[e],".json"))]).then((function(t){var i=(0,h.Z)(t,2),o=i[0],r=i[1];r.colors["editor.background"]="#000000",r.colors["editor.foreground"]="#FFFFFF",o.editor.defineTheme(e,r),n(!0)})).catch((function(){n(!1)}))}))}(G).then((function(n){if(n)return e.editor.setTheme(G),G})),n}))}),[G]),ae=(0,r.useCallback)((function(e){e.languages.typescript.javascriptDefaults.setEagerModelSync(!0),te(e),se(e)}),[se]),de=(0,r.useCallback)((function(e,n){q.current=e,Y.current=n;var t=[];null===A||void 0===A||A.forEach((function(i){t.push(i(n,e))})),I&&t.push((0,b.e)(n,(function(){I(e.getValue())}))),v(0,e,t),e.getModel().updateOptions({tabSize:U}),x&&!O&&(e._domElement.style.height="".concat(((z||"").split("\n").length+p.Ep)*p.aU,"px")),e.onDidFocusEditorWidget((function(){null===B||void 0===B||B(!0)})),e.onDidContentSizeChange((function(n){var t=n.contentHeight,i=n.contentHeightChanged;x&&i&&(e._domElement.style.height="".concat(t+2*p.aU,"px")),_&&(null===_||void 0===_||_())})),R&&H&&setTimeout((function(){e.focus()}),1),S&&e.onDidChangeCursorPosition((function(n){var t=n.position.lineNumber,i=e._domElement.getBoundingClientRect(),o=i.height,r=i.top,l=e.getTopForLineNumber(t);S({editor:e,editorRect:{height:Number(o),top:Number(r)},position:{lineNumber:t,lineNumberTop:l}})})),re(!0),null===E||void 0===E||E(e,n)}),[x,O,_,S,E,I,R,re,B,A,U,H,z]);(0,r.useEffect)((function(){var e;return j&&I&&(e=setInterval((function(){I(q.current.getValue())}),5e3)),function(){j&&e&&clearInterval(e)}}),[j,q,I]);var pe=(0,s.Z)(R),fe=(0,s.Z)(H);return(0,r.useEffect)((function(){null!==q&&void 0!==q&&q.current&&(R&&H?setTimeout((function(){q.current.focus()}),1):i.findDOMNode(q.current._domElement).getElementsByClassName("inputarea")[0].blur())}),[q,R,pe,H,fe]),(0,r.useEffect)((function(){if(null!==Y&&void 0!==Y&&Y.current&&null!==q&&void 0!==q&&q.current){var e=[];null===A||void 0===A||A.forEach((function(n){e.push(n(null===Y||void 0===Y?void 0:Y.current,null===q||void 0===q?void 0:q.current))})),v(null===Y||void 0===Y||Y.current,null===q||void 0===q?void 0:q.current,e)}}),[null===y||void 0===y?void 0:y.downstream_blocks,null===y||void 0===y?void 0:y.upstream_blocks]),(0,r.useEffect)((function(){return function(){J.map((function(e){return e.dispose()}))}}),[J]),(0,r.useEffect)((function(){ne&&l&&(0===J.length&&H||!fe&&H?$((0,f.S_)(ne,l)):fe&&!H&&J.map((function(e){return e.dispose()})))}),[l,J,ne,H,fe]),(0,g.jsxs)(p.Nk,{hideDuplicateMenuItems:!0,padding:T,ref:n,style:{display:oe?null:"none"},children:[M&&!(null!==z&&void 0!==z&&z.length)&&(0,g.jsx)(p.KT,{children:(0,g.jsx)(c.ZP,{monospace:!0,muted:!0,children:M})}),(0,g.jsx)(o.ZP,{beforeMount:ae,height:O,language:C||"python",onChange:function(e){null===w||void 0===w||w(e)},onMount:de,options:{domReadOnly:D,fontFamily:a.Vp,fontLigatures:!0,fontSize:P,hideCursorInOverviewRuler:!0,lineNumbers:L?"on":"off",minimap:{enabled:!1},overviewRulerBorder:!1,readOnly:D,renderLineHighlightOnlyWhenFocus:!0,scrollBeyondLastLine:!1,scrollbar:{alwaysConsumeMouseWheel:!1,vertical:"hidden"},useShadowDOM:!1,wordBasedSuggestions:!1,wordWrap:(null===y||void 0===y?void 0:y.type)===u.tf.MARKDOWN?"on":"off"},theme:ue||"vs-dark",value:z,width:V}),(0,g.jsx)("div",{ref:X})]})}o._m.config({paths:{vs:"".concat((0,l.XF)(),"/monaco-editor/min/vs")}});var j=r.forwardRef(x)},37529:function(e,n,t){"use strict";function i(e,n){return{contextMenuGroupId:"navigation",contextMenuOrder:1.5,id:"saveCode",keybindingContext:null,keybindings:[e.KeyMod.CtrlCmd|e.KeyCode.KeyS],label:"Save",precondition:null,run:function(e){n()}}}function o(e,n){return{contextMenuGroupId:"navigation",contextMenuOrder:1.5,id:"executeCode",keybindingContext:null,keybindings:[e.KeyMod.CtrlCmd|e.KeyCode.Enter],label:"Run selected block",precondition:null,run:function(){return n()}}}t.d(n,{Q:function(){return o},e:function(){return i}})},78688:function(e,n,t){"use strict";var i=t(82394),o=t(82684),r=t(15338),l=t(77456),u=t(97618),c=t(55485),s=t(85854),a=t(65956),d=t(38276),p=t(30160),f=t(72473),v=t(70515),h=t(74778),m=t(74260),b=t(81728),g=t(28598);function x(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function j(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?x(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):x(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n=e.contained,t=void 0===n||n,i=e.onClickStep,x=e.setupSteps,y=e.small,k=(0,o.useCallback)((function(e,n,o,x){var Z=e.name,P=e.description,O=e.group,C=e.error,w=e.required,_=e.status_calculated,S=e.steps,E=e.tab,I=e.uuid,T=(null===S||void 0===S?void 0:S.length)||0,M=x||{completedGroup:!1,level:0,numberEl:null},D=M.completedGroup,R=M.level,B=M.numberEl,A=0===R?2*v.iI:1.5*v.iI;if(O){var N=(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(d.Z,{p:v.cd,children:(0,g.jsx)(c.ZP,{children:(0,g.jsxs)(u.Z,{flex:1,flexDirection:"column",children:[(0,g.jsxs)(c.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,g.jsx)(s.Z,{level:y?5:4,children:Z}),(0,g.jsx)(d.Z,{mr:v.cd}),m.br.COMPLETED===_&&(0,g.jsx)(f.Jr,{size:A,success:!0})]}),P&&(0,g.jsx)(d.Z,{mt:1,children:(0,g.jsx)(p.ZP,{default:!0,small:y,children:P})})]})})}),(0,g.jsx)(r.Z,{light:!0}),null===S||void 0===S?void 0:S.map((function(e,n){return k(e,n,T,{completedGroup:m.br.COMPLETED===_,level:0})}))]});return(0,g.jsxs)(d.Z,{mb:y?0:v.cd,children:[t&&(0,g.jsx)(a.Z,{noPadding:!0,children:N}),!t&&N]},I)}var L=m.br.COMPLETED===_,F=0===R?String(n+1):(0,b.bH)()[n].toLowerCase();var U=!!E&&i,H=(0,g.jsx)(d.Z,{pl:0===R?v.cd:0,children:(0,g.jsxs)(p.ZP,{large:!y,monospace:!0,muted:!0,children:[F,"."]})}),W={muted:L||D,strikethrough:L||D};return(0,g.jsx)(h.aw,{clickable:!!U,onClick:U?function(){return null===i||void 0===i?void 0:i(E)}:null,children:(0,g.jsxs)(d.Z,{py:0!==R||y?1:v.cd,children:[(0,g.jsxs)(c.ZP,{children:[B&&(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("div",{style:{opacity:0},children:B}),(0,g.jsx)(d.Z,{mr:1})]}),H,(0,g.jsx)(d.Z,{mr:1}),(0,g.jsx)(u.Z,{flex:1,flexDirection:"column",children:(0,g.jsxs)(c.ZP,{flexDirection:"column",children:[(0,g.jsxs)(c.ZP,{alignItems:"center",children:[(0,g.jsxs)(u.Z,{flex:1,children:[0===R&&!y&&(0,g.jsx)(s.Z,j(j({level:5},W),{},{children:Z})),0===R&&y&&(0,g.jsx)(p.ZP,j(j({bold:!0,large:!0},W),{},{children:Z})),R>=1&&(0,g.jsx)(p.ZP,j(j({bold:!0,large:!y},W),{},{children:Z})),!w&&(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(d.Z,{mr:1}),(0,g.jsx)(p.ZP,{muted:!0,uppercase:!0,xsmall:!0,children:"optional"})]})]}),(0,g.jsx)(d.Z,{mr:v.cd}),L&&(0,g.jsx)(f.Jr,{size:A,success:!0}),m.br.INCOMPLETE===_&&(0,g.jsx)(f.uy,{muted:!0,size:A}),m.br.ERROR===_&&(0,g.jsx)(f.uy,{danger:!0,size:A}),(0,g.jsx)(d.Z,{pr:v.cd*(_?1:2)})]}),P&&(0,g.jsx)(d.Z,{mt:1,pr:3*v.cd,children:(0,g.jsx)(p.ZP,j(j({default:!0},W),{},{small:y,children:P}))}),C&&(0,g.jsx)(l.Z,{error:C,small:!0,warning:!0})]})})]}),T>=1&&(0,g.jsx)(d.Z,{mt:1,children:null===S||void 0===S?void 0:S.map((function(e,n){return k(e,n,T,{completedGroup:D,level:1,numberEl:H})}))})]})},I)}),[t,i,y]),Z=[],P=(null===x||void 0===x?void 0:x.length)||0;return null===x||void 0===x||x.forEach((function(e,n){e.status;Z.push(k(e,n,P))})),t?(0,g.jsx)(d.Z,{p:v.cd,children:Z}):(0,g.jsx)(g.Fragment,{children:Z})}},89308:function(e,n,t){"use strict";var i=t(82394),o=t(75582),r=t(82684),l=t(69864),u=t(71180),c=t(26032),s=t(74260),a=t(15338),d=t(97618),p=t(55485),f=t(85854),v=t(65956),h=t(78688),m=t(38276),b=t(30160),g=t(35686),x=t(70515),j=t(72473),y=t(81728),k=t(10332),Z=t(72619),P=t(23780),O=t(28598);function C(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function w(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?C(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):C(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n=e.actionsOnly,t=e.computeService,i=e.computeConnections,C=e.contained,_=void 0===C||C,S=e.fetchAll,E=e.hideDetails,I=e.onClickStep,T=e.small,M=(0,P.VI)(null,{},[],{uuid:"ConnectionSettings"}),D=(0,o.Z)(M,1)[0],R=(0,r.useState)(null),B=R[0],A=R[1],N=(0,r.useState)(null),L=N[0],F=N[1],U=(0,l.Db)((function(e){var n=e.action,i=e.uuid;return g.ZP.compute_connections.compute_services.useUpdate(null===t||void 0===t?void 0:t.uuid,i)({compute_connection:{action:n}})}),{onSuccess:function(e){return(0,Z.wD)(e,{callback:function(e){var n=e.compute_connection;null===S||void 0===S||S(),F(w(w({},B),{},{computeConnection:n}))},onErrorCallback:function(e,n){return D({errors:n,response:e})}})}}),H=(0,o.Z)(U,2),W=H[0],G=H[1].isLoading;return(0,r.useEffect)((function(){if(L){var e,n=null===i||void 0===i?void 0:i.find((function(e){var n,t=e.uuid;return(null===L||void 0===L||null===(n=L.computeConnection)||void 0===n?void 0:n.uuid)===t}));(null===n||void 0===n?void 0:n.state)!==(null===L||void 0===L||null===(e=L.computeConnection)||void 0===e?void 0:e.state)&&F(null)}}),[i,L,F]),(0,O.jsx)(m.Z,{py:_?x.cd:0,children:null===i||void 0===i?void 0:i.map((function(e,t){var i,r,l,g,Z=e.actions,P=e.attributes,C=e.connection,w=e.description,S=e.name,M=e.required,D=e.status_calculated,R=e.steps,N=e.uuid;!E&&!n&&P&&(null===(i=Object.keys(P||{}))||void 0===i?void 0:i.length)>=1&&(l=(0,k.s)(Object.entries(P||{}).map((function(e){var n=(0,o.Z)(e,2),t=n[0],i=n[1];return[(0,y.vg)(t),i]})))),!E&&!n&&C&&(null===(r=Object.keys(C||{}))||void 0===r?void 0:r.length)>=1&&(g=(0,k.s)(Object.entries(C||{}).map((function(e){var n=(0,o.Z)(e,2),t=n[0],i=n[1];return[(0,y.vg)(t),i]}))));var U=(0,O.jsxs)(O.Fragment,{children:[!n&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(m.Z,{p:x.cd,children:(0,O.jsx)(p.ZP,{children:(0,O.jsxs)(d.Z,{flex:1,flexDirection:"column",children:[(0,O.jsxs)(p.ZP,{alignItems:"center",children:[(0,O.jsx)(d.Z,{flex:1,children:(0,O.jsx)(f.Z,{level:T?5:4,children:S})}),(0,O.jsx)(m.Z,{mr:x.cd}),(0,O.jsx)(j.Fs,{danger:s.br.ERROR===D,muted:M&&s.br.INCOMPLETE===D,size:2*x.iI,success:!M||s.br.COMPLETED===D})]}),w&&(0,O.jsx)(m.Z,{mt:1,children:(0,O.jsx)(b.ZP,{default:!0,small:T,children:w})})]})})}),(null===R||void 0===R?void 0:R.length)>=1&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(a.Z,{light:!0}),(0,O.jsx)(h.Z,{contained:!1,onClickStep:I,setupSteps:R,small:T})]})]}),(l||g)&&(0,O.jsx)(m.Z,{p:x.cd,children:(0,O.jsxs)(p.ZP,{children:[l&&(0,O.jsx)(v.Z,{noPadding:!0,children:(0,O.jsxs)(p.ZP,{flexDirection:"column",children:[(0,O.jsx)(m.Z,{p:x.cd,children:(0,O.jsx)(b.ZP,{bold:!0,large:!0,children:"Attributes"})}),(0,O.jsx)(a.Z,{light:!0}),l,(0,O.jsx)(m.Z,{mb:x.cd})]})}),l&&g&&(0,O.jsx)(m.Z,{pr:x.cd}),g&&(0,O.jsx)(v.Z,{noPadding:!0,children:(0,O.jsxs)(p.ZP,{flexDirection:"column",children:[(0,O.jsx)(m.Z,{p:x.cd,children:(0,O.jsx)(b.ZP,{bold:!0,large:!0,children:"Connection"})}),(0,O.jsx)(a.Z,{light:!0}),g,(0,O.jsx)(m.Z,{mb:x.cd})]})})]})}),(null===Z||void 0===Z?void 0:Z.length)>=1&&(0,O.jsxs)(O.Fragment,{children:[!n&&(0,O.jsx)(m.Z,{p:x.cd,children:(0,O.jsx)(p.ZP,{children:(0,O.jsx)(d.Z,{flex:1,flexDirection:"column",children:(0,O.jsx)(p.ZP,{alignItems:"center",children:(0,O.jsx)(d.Z,{flex:1,children:(0,O.jsx)(f.Z,{level:T?5:4,children:"Actions"})})})})})}),null===Z||void 0===Z?void 0:Z.map((function(e,t){var i,o=e.description,r=e.name,l=e.uuid,s=G&&(null===B||void 0===B?void 0:B.uuid)===N&&(null===B||void 0===B?void 0:B.actionUUID)===l||c.i.PENDING===(null===L||void 0===L||null===(i=L.computeConnection)||void 0===i?void 0:i.state);return(0,O.jsxs)("div",{children:[(!n||t>=1)&&(0,O.jsx)(a.Z,{light:!0}),(0,O.jsx)(m.Z,{p:x.cd,children:(0,O.jsx)(p.ZP,{alignItems:"center",justifyContent:"space-between",children:(0,O.jsxs)(d.Z,{flex:1,flexDirection:"column",children:[(0,O.jsx)(b.ZP,{default:!0,large:!T,children:o}),(0,O.jsx)(m.Z,{mt:x.cd,children:(0,O.jsx)(u.ZP,{compact:T,danger:[c._.DELETE].includes(l),loading:s,onClick:function(){A({actionUUID:l,uuid:N}),F(null),W({action:l,uuid:N})},primary:[c._.CREATE,c._.UPDATE].includes(l),secondary:[c._.DESELECT].includes(l),small:T,children:r})})]})})})]},l)}))]})]});return(0,O.jsxs)(m.Z,{mt:t>=1?x.cd:0,px:_?x.cd:0,children:[_&&(0,O.jsx)(v.Z,{noPadding:!0,children:U}),!_&&U]},N)}))})}},77456:function(e,n,t){"use strict";var i=t(82394),o=t(75582),r=t(43695),l=t(30160),u=t(28598);function c(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function s(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?c(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):c(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n=e.danger,t=e.error,i=e.large,c=e.small,a=e.warning,d=t.message,p=t.variables,f=d;return p&&Object.entries(p||{}).forEach((function(e){var t=(0,o.Z)(e,2),d=t[0],p=t[1];f=f.replace("{{".concat(d,"}}"),(0,r.Dq)((0,u.jsx)(l.ZP,s(s({danger:n,inline:!0,large:i,muted:!n&&!a,small:c,warning:a},p||{}),{},{children:d}))))})),(0,u.jsx)(l.ZP,{danger:n,dangerouslySetInnerHTML:{__html:f},muted:!n&&!a,large:i,small:c,warning:a})}},74778:function(e,n,t){"use strict";t.d(n,{UE:function(){return c},aw:function(){return s},bC:function(){return a}});var i=t(38626),o=t(44897),r=t(42631),l=t(70515),u=t(91437),c=i.default.div.withConfig({displayName:"indexstyle__CardStyle",componentId:"sc-1b5e7g-0"})([""," border-radius:","px;padding:","px;"," ",""],(0,u.eR)(),r.D7,2.5*l.iI,(function(e){return"\n background-color: ".concat((e.theme.background||o.Z.background).panel,";\n border: 1px solid ").concat((e.theme.borders||o.Z.borders).darkLight,";\n box-shadow: ").concat((e.theme.shadow||o.Z.shadow).frame,";\n ")}),(function(e){return!e.inline&&"\n height: ".concat(28*l.iI,"px;\n width: ").concat(40*l.iI,"px;\n margin: ").concat(l.cd/2*l.iI,"px;\n ")})),s=i.default.div.withConfig({displayName:"indexstyle__SetupStepRowStyle",componentId:"sc-1b5e7g-1"})([""," ",""],(0,u.eR)(),(function(e){return e.clickable&&"\n &:hover {\n background-color: ".concat((e.theme.interactive||o.Z.interactive).hoverOverlay,";\n cursor: pointer;\n }\n ")})),a=i.default.div.withConfig({displayName:"indexstyle__NavigationStyle",componentId:"sc-1b5e7g-2"})([""," height:","px;padding-left:","px;padding-right:","px;"," ",""],(0,u.eR)(),7*l.iI,l.cd*l.iI,l.cd*l.iI,(function(e){return!e.selected&&"\n &:hover {\n background-color: ".concat((e.theme.interactive||o.Z.interactive).rowHoverBackground,";\n }\n ")}),(function(e){return e.selected&&"\n background-color: ".concat((e.theme.background||o.Z.background).codeTextarea,";\n ")}))},60523:function(e,n,t){"use strict";var i=t(21831),o=t(82394),r=t(82684),l=t(38626),u=t(34376),c=t(80029),s=t(54750),a=t(71180),d=t(90299),p=t(44898),f=t(55485),v=t(88328),h=t(38276),m=t(4190),b=t(48381),g=t(5755),x=t(30160),j=t(35686),y=t(72473),k=t(84649),Z=t(32929),P=t(15610),O=t(19183),C=t(28598);function w(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function _(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?w(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):w(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n,t=e.contained,o=e.defaultLinkUUID,w=e.defaultTab,S=e.objectType,E=e.onClickCustomTemplate,I=e.pipelineUUID,T=e.showAddingNewTemplates,M=e.showBreadcrumbs,D=e.tabs,R=(0,u.useRouter)(),B=(0,r.useContext)(l.ThemeContext),A=(0,O.i)(),N=A.height,L=A.width,F=(0,r.useMemo)((function(){return D||Z.dP}),[D]),U=(0,r.useState)(T||!1),H=U[0],W=U[1],G=(0,r.useState)(o?Z.qy.find((function(e){return e.uuid===o})):Z.qy[0]),z=G[0],K=G[1],V=(0,r.useState)(w?F.find((function(e){return e.uuid===(null===w||void 0===w?void 0:w.uuid)})):F[0]),q=V[0],Y=V[1],X=(0,r.useState)(null),Q=X[0],J=X[1],$=j.ZP.custom_templates.list({object_type:p.Z},{},{pauseFetch:Z.n9.uuid!==(null===q||void 0===q?void 0:q.uuid)}),ee=$.data,ne=$.mutate,te=(0,r.useMemo)((function(){var e=(null===ee||void 0===ee?void 0:ee.custom_templates)||[];return null!==z&&void 0!==z&&z.filterTemplates?null===z||void 0===z?void 0:z.filterTemplates(e):e}),[ee,z]),ie=j.ZP.custom_templates.list({object_type:p.R},{},{pauseFetch:Z.A2.uuid!==(null===q||void 0===q?void 0:q.uuid)}),oe=ie.data,re=ie.mutate,le=(0,r.useMemo)((function(){var e=(null===oe||void 0===oe?void 0:oe.custom_templates)||[];return null!==z&&void 0!==z&&z.filterTemplates?null===z||void 0===z?void 0:z.filterTemplates(e):e}),[oe,z]),ue=(0,r.useMemo)((function(){return Z.hS.map((function(e){var n=e.Icon,t=e.label,i=e.selectedBackgroundColor,o=e.selectedIconProps,r=e.uuid,l=(null===z||void 0===z?void 0:z.uuid)===r,u=_({size:k.ZG},l&&o?o:{});return(0,C.jsx)(k.wj,{onClick:function(){return K(e)},selected:l,children:(0,C.jsxs)(f.ZP,{alignItems:"center",children:[(0,C.jsx)(k.ze,{backgroundColor:l&&i?i(B):null,children:n?(0,C.jsx)(n,_({},u)):(0,C.jsx)(y.pd,_({},u))}),(0,C.jsx)(x.ZP,{bold:!0,large:!0,children:t?t():r})]})},r)}))}),[z,B]),ce=(0,r.useMemo)((function(){return null===te||void 0===te?void 0:te.map((function(e){var n=e.description,t=e.name,o=e.tags,r=e.template_uuid,l=e.user,u=[];return null!==o&&void 0!==o&&o.length?u.push.apply(u,(0,i.Z)(o)):null!==l&&void 0!==l&&l.username&&u.push(null===l||void 0===l?void 0:l.username),(0,C.jsxs)(k.UE,{onClick:function(){E?E(e):R.push("/templates/[...slug]","/templates/".concat(encodeURIComponent(r)))},children:[(0,C.jsx)(k.Tj,{children:(0,C.jsx)(x.ZP,{bold:!0,monospace:!0,textOverflow:!0,children:t||r})}),(0,C.jsx)(k.SL,{children:(0,C.jsx)(x.ZP,{default:!!n,italic:!n,muted:!n,textOverflowLines:2,children:n||"No description"})}),(0,C.jsx)(k.EN,{children:(null===u||void 0===u?void 0:u.length)>=1&&(0,C.jsx)(b.Z,{tags:null===u||void 0===u?void 0:u.map((function(e){return{uuid:e}}))})})]},r)}))}),[te,E,R]),se=(0,r.useMemo)((function(){return null===le||void 0===le?void 0:le.map((function(e){var n=e.description,t=e.name,o=e.tags,r=e.template_uuid,l=e.user,u=[];return null!==o&&void 0!==o&&o.length?u.push.apply(u,(0,i.Z)(o)):null!==l&&void 0!==l&&l.username&&u.push(null===l||void 0===l?void 0:l.username),(0,C.jsxs)(k.UE,{onClick:function(){E?E(e):R.push("/templates/[...slug]","/templates/".concat(encodeURIComponent(r),"?object_type=").concat(p.R))},children:[(0,C.jsx)(k.Tj,{children:(0,C.jsx)(x.ZP,{bold:!0,monospace:!0,textOverflow:!0,children:t||r})}),(0,C.jsx)(k.SL,{children:(0,C.jsx)(x.ZP,{default:!!n,italic:!n,muted:!n,textOverflowLines:2,children:n||"No description"})}),(0,C.jsx)(k.EN,{children:(null===u||void 0===u?void 0:u.length)>=1&&(0,C.jsx)(b.Z,{tags:null===u||void 0===u?void 0:u.map((function(e){return{uuid:e}}))})})]},r)}))}),[le,E,R]),ae=(0,r.useMemo)((function(){if(!M)return null;var e=[];return H?e.push.apply(e,[{label:function(){return"Templates"},onClick:function(){W(!1)}},{bold:!0,label:function(){return"New custom template"}}]):e.push({label:function(){return"Templates"}}),(0,C.jsx)(k.FX,{children:(0,C.jsx)(s.Z,{breadcrumbs:e})})}),[H,M]),de=(0,r.useMemo)((function(){return M?36:0}),[M]),pe=(0,r.useMemo)((function(){return N-de}),[N,de]);if(H)return n=p.R===S&&I?(0,C.jsx)(v.Z,{onMutateSuccess:re,pipelineUUID:I,templateAttributes:z&&(null===z||void 0===z?void 0:z.uuid)!==(null===Z.qy||void 0===Z.qy?void 0:Z.qy[0].uuid)?{pipeline_type:null===z||void 0===z?void 0:z.uuid}:null,templateUUID:null===Q||void 0===Q?void 0:Q.template_uuid}):(0,C.jsx)(g.Z,{contained:t,heightOffset:de,onCreateCustomTemplate:t?function(e){J(e)}:null,onMutateSuccess:ne,templateAttributes:z&&(null===z||void 0===z?void 0:z.uuid)!==(null===Z.qy||void 0===Z.qy?void 0:Z.qy[0].uuid)?{block_type:null===z||void 0===z?void 0:z.uuid}:null,templateUUID:null===Q||void 0===Q?void 0:Q.template_uuid}),t?(0,C.jsxs)(C.Fragment,{children:[M&&ae,(0,C.jsx)(k.Rd,{height:pe,width:L,children:n})]}):n;var fe=(0,C.jsxs)(k.Nk,{children:[(0,C.jsxs)(k.bC,{height:t?pe:null,children:[(0,C.jsx)(k.Yf,{children:(0,C.jsx)(d.Z,{noPadding:!0,onClickTab:function(e){t?Y(e):(0,P.u)({object_type:Z.A2.uuid===e.uuid?p.R:p.Z})},selectedTabUUID:null===q||void 0===q?void 0:q.uuid,tabs:F})}),(0,C.jsxs)(k.wl,{contained:t,heightOffset:de,children:[Z.n9.uuid===(null===q||void 0===q?void 0:q.uuid)&&(0,C.jsx)(c.Z,{navLinks:Z.qy,selectedLink:z,setSelectedLink:K}),Z.A2.uuid===(null===q||void 0===q?void 0:q.uuid)&&ue]})]}),(0,C.jsxs)(k.w5,{children:[Z.n9.uuid===(null===q||void 0===q?void 0:q.uuid)&&(0,C.jsx)(k.HS,{children:(0,C.jsx)(a.ZP,{beforeIcon:(0,C.jsx)(y.mm,{size:k.ZG}),onClick:function(){W(!0)},primary:!0,children:"New block template"})}),Z.n9.uuid===(null===q||void 0===q?void 0:q.uuid)&&(0,C.jsxs)(C.Fragment,{children:[!ee&&(0,C.jsx)(h.Z,{p:2,children:(0,C.jsx)(m.Z,{inverted:!0})}),ee&&!(null!==ce&&void 0!==ce&&ce.length)&&(0,C.jsxs)(h.Z,{p:2,children:[(0,C.jsx)(x.ZP,{children:"There are currently no templates matching your search."}),(0,C.jsx)("br",{}),(0,C.jsx)(x.ZP,{children:"Add a new template by clicking the button above."})]}),(null===ce||void 0===ce?void 0:ce.length)>=1&&(0,C.jsx)(k.n8,{children:ce})]}),Z.A2.uuid===(null===q||void 0===q?void 0:q.uuid)&&(0,C.jsxs)(C.Fragment,{children:[!oe&&(0,C.jsx)(h.Z,{p:2,children:(0,C.jsx)(m.Z,{inverted:!0})}),oe&&!(null!==se&&void 0!==se&&se.length)&&(0,C.jsxs)(h.Z,{p:2,children:[(0,C.jsx)(x.ZP,{children:"There are currently no templates matching your search."}),(0,C.jsx)("br",{}),(0,C.jsx)(x.ZP,{children:'Add a new template by right-clicking a pipeline row from the Pipelines page and selecting "Create template".'})]}),(null===se||void 0===se?void 0:se.length)>=1&&(0,C.jsx)(k.n8,{children:se})]})]})]});return t?(0,C.jsxs)(C.Fragment,{children:[M&&ae,(0,C.jsx)(k.Rd,{height:pe,width:L,children:fe})]}):fe}},43449:function(e,n,t){"use strict";var i=t(82394),o=t(75582),r=t(17717),l=t(82684),u=t(49555),c=t(69864),s=t(40761),a=t(44425),d=t(71180),p=t(92677),f=t(75810),v=t(89706),h=t(55485),m=t(93369),b=t(57653),g=t(38276),x=t(35686),j=t(39643),y=t(11498),k=t(85385),Z=t(80330),P=t(86735),O=t(81728),C=t(72619),w=t(42041),_=t(44688),S=t(28598);function E(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function I(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?E(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):E(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n,t=e.active,E=e.addNewBlock,T=e.disableRefreshWarning,M=e.fetchPipeline,D=e.fetchVariables,R=e.filePath,B=e.hideHeaderButtons,A=e.onContentChange,N=e.onUpdateFileSuccess,L=e.openSidekickView,F=e.pipeline,U=e.saveFile,H=e.selectedFilePath,W=e.sendTerminalMessage,G=e.setDisableShortcuts,z=e.setErrors,K=e.setFilesTouched,V=e.setSelectedBlock,q=(0,u.j)("apiReloads"),Y=(0,o.Z)(q,2)[1],X=(0,l.useState)(null),Q=X[0],J=X[1],$=(0,l.useState)(!1),ee=$[0],ne=($[1],(0,l.useRef)(null)),te=(0,l.useMemo)((function(){return new s.Z}),[]),ie=(0,l.useMemo)((function(){return{api_key:y.lG,token:te.decodedToken.token}}),[te]),oe=x.ZP.statuses.list().data,re=(0,l.useMemo)((function(){var e,n;return null===oe||void 0===oe||null===(e=oe.statuses)||void 0===e||null===(n=e[0])||void 0===n?void 0:n.repo_path}),[oe]),le=x.ZP.file_contents.detail(R).data;(0,l.useEffect)((function(){null!==le&&void 0!==le&&le.file_content?J(le.file_content):null!==le&&void 0!==le&&le.error&&(0,C.h$)(le,{onErrorCallback:function(e,n){return z({errors:n,response:e})}})}),[le,z]);var ue=(0,l.useState)(null===Q||void 0===Q?void 0:Q.content),ce=ue[0],se=ue[1],ae=(0,l.useCallback)((function(e){se(e),A&&(null===A||void 0===A||A(e))}),[A]),de=(0,l.useState)(!1),pe=de[0],fe=de[1];(0,l.useEffect)((function(){t&&G&&(null===G||void 0===G||G(!0))}),[t,G]),(0,l.useEffect)((function(){var e;H&&(null===ne||void 0===ne||null===(e=ne.current)||void 0===e||e.scrollIntoView())}),[H]);var ve=(0,c.Db)(x.ZP.file_contents.useUpdate((null===Q||void 0===Q?void 0:Q.path)&&encodeURIComponent(null===Q||void 0===Q?void 0:Q.path)),{onSuccess:function(e){return(0,C.wD)(e,{callback:function(e){var n=e.file_content;Y((function(e){return I(I({},e),{},(0,i.Z)({},"FileVersions/".concat(null===Q||void 0===Q?void 0:Q.path),Number(new Date)))})),N&&(null===N||void 0===N||N(n))},onErrorCallback:function(e,n){return null===z||void 0===z?void 0:z({errors:n,response:e})}})}}),he=(0,o.Z)(ve,1)[0],me=(0,l.useCallback)((function(e,n){if(U)return U(e,n);he({file_content:I(I({},n),{},{content:e})}).then((function(){decodeURIComponent(R).split(r.sep).pop()===v.dT.METADATA_YAML&&D&&(null===D||void 0===D||D())})),null===K||void 0===K||K((function(e){return I(I({},e),{},(0,i.Z)({},null===n||void 0===n?void 0:n.path,!1))})),fe(!1)}),[D,R,U,K,he]),be=(0,l.useMemo)((function(){return(0,Z.lU)()}),[]),ge=(0,l.useMemo)((function(){var e,n,t,i;return null===(null===Q||void 0===Q||null===(e=Q.path)||void 0===e?void 0:e.match(be))?v.Lu.TXT:null===Q||void 0===Q||null===(n=Q.path)||void 0===n||null===(t=n.match(be))||void 0===t||null===(i=t[0])||void 0===i?void 0:i.split(".")[1]}),[be,Q]),xe=(0,l.useMemo)((function(){if(null!==Q&&void 0!==Q&&Q.path)return(0,S.jsx)(f.Z,{autoHeight:!0,language:v.nB[ge],onChange:function(e){ae(e),K&&K((function(e){return null!==e&&void 0!==e&&e[null===Q||void 0===Q?void 0:Q.path]?e:I(I({},e),{},(0,i.Z)({},null===Q||void 0===Q?void 0:Q.path,!0))})),fe(!0)},onSave:function(e){me(e,Q)},padding:10,selected:!0,textareaFocused:!0,value:(0,O.Pb)(null===Q||void 0===Q?void 0:Q.content)?JSON.stringify(JSON.parse(null===Q||void 0===Q?void 0:Q.content),null,2):null===Q||void 0===Q?void 0:Q.content,width:"100%"})}),[Q,ge,me,ae,K]),je=null!==F&&void 0!==F&&F.blocks?(0,P.sE)(null===F||void 0===F?void 0:F.blocks,(function(e){var n=e.type;return a.tf.DATA_EXPORTER===n})):null,ye=(0,c.Db)(x.ZP.blocks.pipelines.useUpdate(encodeURIComponent(null===F||void 0===F?void 0:F.uuid),encodeURIComponent(null===je||void 0===je?void 0:je.uuid)),{onSuccess:function(e){return(0,C.wD)(e,{callback:function(){null===M||void 0===M||M()}})}}),ke=(0,o.Z)(ye,1)[0],Ze=E&&F&&Q&&v.tE.includes(ge)&&(0,Z.ck)(null===Q||void 0===Q||null===(n=Q.path)||void 0===n?void 0:n.split(r.sep))&&(0,S.jsx)(d.ZP,{onClick:function(){var e=(null===F||void 0===F?void 0:F.type)===b.qL.INTEGRATION,n=(0,Z.TU)(Q,re,F);E(n,(function(n){e&&je&&ke({block:I(I({},je),{},{upstream_blocks:[n.uuid]})}),null===V||void 0===V||V(n)}))},primary:!0,children:"Add to current pipeline"}),Pe=W&&(0,S.jsx)(g.Z,{m:2,children:(0,S.jsx)(m.ZP,{disabled:!re,inline:!0,loading:ee,onClick:function(){null===L||void 0===L||L(k.cH.TERMINAL),null===W||void 0===W||W(JSON.stringify(I(I({},ie),{},{command:["stdin","pip install -r ".concat(re,"/requirements.txt\r")]})))},title:re?"Pip install packages from your saved requirements.txt file (\u2318+S to save).":"Please use right panel terminal to install packages.",uuid:"FileEditor/InstallPackages",children:"Install packages"})}),Oe="FileEditor/".concat(null===Q||void 0===Q?void 0:Q.path),Ce=(0,_.y)(),we=Ce.registerOnKeyDown,_e=Ce.unregisterOnKeyDown;return(0,l.useEffect)((function(){return function(){_e(Oe)}}),[_e,Oe]),we(Oe,(function(e,n){if(t&&!T)if((0,w.y)([j.zX,j.Um],n)||(0,w.y)([j.PQ,j.Um],n))e.preventDefault(),me(ce,Q);else if(pe&&(0,w.y)([j.zX,j.hS],n)){e.preventDefault();var i="".concat(Q.path," has changes that are unsaved. ")+"Click cancel and save your changes before reloading page.";"undefined"!==typeof location&&window.confirm(i)&&location.reload()}}),[t,ce,T,Q,me,pe]),(0,S.jsxs)("div",{ref:ne,children:[!B&&(0,S.jsx)(g.Z,{p:2,children:(0,S.jsxs)(h.ZP,{justifyContent:"space-between",children:[(0,S.jsxs)(p.Z,{children:[Ze,(0,S.jsx)(d.ZP,{disabled:!ce,onClick:function(e){e.preventDefault(),me(ce,Q)},title:ce?null:"No changes have been made to this file.",children:"Save file content"})]}),L&&(0,S.jsx)(p.Z,{children:(0,S.jsx)(d.ZP,{compact:!0,onClick:function(){L(k.cH.FILE_VERSIONS)},small:!0,title:"View previous changes to this file.",children:"Show versions"})})]})}),xe,R===v.dT.REQS_TXT&&Pe]})}},53779:function(e,n,t){"use strict";t.d(n,{C:function(){return v},X$:function(){return f},eD:function(){return d}});var i=t(38626),o=t(44897),r=t(42631),l=t(70515),u=t(47041),c=t(91437),s=6.25*l.iI,a=(l.iI,100*l.iI),d=i.default.div.withConfig({displayName:"indexstyle__WindowContainerStyle",componentId:"sc-g0cszf-0"})(["border-radius:","px;width:100%;max-width:","px;z-index:101;position:absolute;overflow:hidden;top:50%;left:50%;transform:translate(-50%,-50%);",""],r.n_,a,(function(e){return"\n box-shadow: ".concat((e.theme||o.Z).shadow.window,";\n background-color: ").concat((e.theme||o.Z).background.panel,";\n ")})),p=(0,i.css)(["display:flex;align-items:center;justify-content:space-between;height:","px;padding:","px ","px;",""],s,l.iI,l.cd*l.iI,(function(e){return"\n background-color: ".concat((e.theme||o.Z).background.output,";\n ")})),f=i.default.div.withConfig({displayName:"indexstyle__WindowHeaderStyle",componentId:"sc-g0cszf-1"})([""," border-top-left-radius:","px;border-top-right-radius:","px;",""],p,r.n_,r.n_,(function(e){return"\n border-bottom: ".concat(r.YF,"px ").concat(r.M8," ").concat((e.theme||o.Z).borders.medium,";\n ")})),v=i.default.div.withConfig({displayName:"indexstyle__WindowContentStyle",componentId:"sc-g0cszf-2"})(["overflow:auto;padding:","px 0;"," "," "," ",""],l.iI,u.w5,(0,c.eR)(),(function(e){return e.minMaxHeight&&"\n max-height: ".concat(7*l.iI,"px;\n ")}),(function(e){return!e.minMaxHeight&&"\n max-height: calc(100vh - ".concat(6.5*s,"px);\n ")}));i.default.div.withConfig({displayName:"indexstyle__WindowFooterStyle",componentId:"sc-g0cszf-3"})([""," justify-content:flex-end;border-bottom-left-radius:","px;border-bottom-right-radius:","px;",""],p,r.n_,r.n_,(function(e){return"\n border-top: ".concat(r.YF,"px ").concat(r.M8," ").concat((e.theme||o.Z).borders.medium,";\n ")})),i.default.div.withConfig({displayName:"indexstyle__InputRowStyle",componentId:"sc-g0cszf-4"})(["padding:","px ","px;",""],.75*l.iI,2*l.iI,(function(e){return"\n border-bottom: ".concat(r.YF,"px ").concat(r.M8," ").concat((e.theme||o.Z).borders.medium,";\n ")}))},69616:function(e,n,t){"use strict";t.d(n,{Z:function(){return c}});var i=t(82684),o=t(38626),r=t(47041),l=o.default.div.withConfig({displayName:"indexstyle__ScrollerStyle",componentId:"sc-16b7ntp-0"})([""," align-items:center;display:flex;flex-direction:row;height:100%;overflow:auto;"],(0,r.y$)()),u=t(28598);var c=function(e){var n=e.children,t=(e.widthOffset,(0,i.useRef)(null)),o=(0,i.useRef)(null),r=(0,i.useState)(null),c=(r[0],r[1]);return(0,i.useEffect)((function(){setTimeout((function(){var e,n,i,r;c({scroll:(null===t||void 0===t||null===(e=t.current)||void 0===e||null===(n=e.getBoundingClientRect())||void 0===n?void 0:n.width)||0,tabs:(null===o||void 0===o||null===(i=o.current)||void 0===i||null===(r=i.getBoundingClientRect())||void 0===r?void 0:r.width)||0})}),1)}),[]),(0,u.jsx)(l,{ref:t,children:(0,u.jsx)("div",{ref:o,style:{height:"100%"},children:n})})}},28385:function(e,n,t){"use strict";var i=t(82394),o=t(75582),r=t(17717),l=t(82684),u=t(49555),c=t(69864),s=t(71180),a=t(75810),d=t(89706),p=t(97618),f=t(55485),v=t(85854),h=t(38276),m=t(4190),b=t(75499),g=t(30160),x=t(35686),j=t(70515),y=t(80330),k=t(3917),Z=t(81728),P=t(72619),O=t(95924),C=t(86735),w=t(42122),_=t(28598);function S(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function E(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?S(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):S(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n=e.onActionCallback,t=e.pipeline,S=e.selectedBlock,I=e.selectedFilePath,T=e.setErrors,M=e.width,D=(0,u.j)("apiReloads"),R=(0,o.Z)(D,2)[1],B=(0,l.useMemo)((function(){return I?encodeURIComponent(I):S?encodeURIComponent("".concat(null===S||void 0===S?void 0:S.type,"/").concat(null===S||void 0===S?void 0:S.uuid)):null}),[S,I]),A=x.ZP.file_versions.files.list(B,(0,w.hB)({block_uuid:null===S||void 0===S?void 0:S.uuid,pipeline_uuid:null===t||void 0===t?void 0:t.uuid})),N=A.data,L=A.mutate,F=(0,l.useMemo)((function(){return(null===N||void 0===N?void 0:N.file_versions)||[]}),[N]),U=(0,l.useState)(null),H=U[0],W=U[1],G=(0,l.useMemo)((function(){return null===F||void 0===F?void 0:F[H]}),[H,F]),z=x.ZP.file_contents.detail(G?encodeURIComponent(G.path):null).data,K=(0,l.useMemo)((function(){return null===z||void 0===z?void 0:z.file_content}),[z]),V=(0,l.useMemo)((function(){return(0,y.lU)()}),[]),q=(0,l.useMemo)((function(){var e,n,t;return null===I||void 0===I||null===(e=I.match(V))||void 0===e||null===(n=e[0])||void 0===n||null===(t=n.split("."))||void 0===t?void 0:t[1]}),[I,V]),Y=(0,c.Db)(x.ZP.file_contents.useUpdate(B),{onSuccess:function(e){return(0,P.wD)(e,{callback:function(e){var t;I&&L();var o=null===e||void 0===e||null===(t=e.file_content)||void 0===t?void 0:t.path,l="FileEditor/".concat(o);if(o){var u=o.split(r.sep);if("pipelines"===u[0]){var c=u.slice(1,u.length-1).join(r.sep);l="PipelineDetail/".concat(c)}}R((function(e){return E(E({},e),{},(0,i.Z)({},l,Number(new Date)))})),W((function(e){return e+1})),null===n||void 0===n||n(null===e||void 0===e?void 0:e.file_content,{blockUUID:null===S||void 0===S?void 0:S.uuid})},onErrorCallback:function(e,n){return T({errors:n,response:e})}})}}),X=(0,o.Z)(Y,2),Q=X[0],J=X[1].isLoading,$=(0,l.useCallback)((function(e){var n=E({},e);return I||(n.block_uuid=null===S||void 0===S?void 0:S.uuid,n.pipeline_uuid=null===t||void 0===t?void 0:t.uuid),Q({file_content:n})}),[t,S,I,Q]),ee=(0,l.useMemo)((function(){var e=F.map((function(e){var n=e.name,t=e.path;return[(0,_.jsxs)(f.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,_.jsxs)(p.Z,{flex:1,children:[(0,_.jsx)(g.ZP,{default:!0,monospace:!0,children:(0,k.JX)(n,{withSeconds:!0})}),(0,_.jsx)(h.Z,{px:2*j.cd,children:(0,_.jsx)(g.ZP,{monospace:!0,children:n})})]}),G&&(null===G||void 0===G?void 0:G.path)===t&&(0,_.jsx)(s.ZP,{compact:!0,loading:J,onClick:function(e){(0,O.j)(e),$({version:n})},small:!0,children:"Replace with this version"})]},n)]}));if(G){var n=(0,_.jsx)(h.Z,{p:j.cd,children:(0,_.jsx)(m.Z,{},"spinner")});if(K&&(null===K||void 0===K?void 0:K.path)===(null===G||void 0===G?void 0:G.path)){var t=K.content,i=void 0===t?"":t;n=(0,_.jsx)(a.Z,{autoHeight:!0,language:d.nB[q],padding:2*j.iI,readOnly:!0,value:(0,Z.Pb)(i)?JSON.stringify(JSON.parse(i),null,2):i,width:M})}e=(0,C.Hk)([n],H+1,e)}return e}),[K,q,F,J,G,H,$,M]);return(0,_.jsxs)("div",{style:{width:M},children:[(0,_.jsxs)(h.Z,{p:j.cd,children:[(0,_.jsx)(v.Z,{level:5,children:"File versions"}),(0,_.jsx)(g.ZP,{inline:!0,monospace:!0,children:I?decodeURIComponent(I):null===S||void 0===S?void 0:S.uuid})]}),(0,_.jsx)(b.Z,{buildRowProps:function(e){if(G&&H+1===e)return{renderCell:function(e){return e},renderRow:function(e){return e}}},columnFlex:[1],columns:[{uuid:"Version"}],isSelectedRow:function(e){var n;return(null===(n=F[e])||void 0===n?void 0:n.name)===(null===G||void 0===G?void 0:G.name)},onClickRow:function(e){G?e===H?W(null):e<H?W(e):e>H+1&&W(e-1):W(e)},rows:ee})]})}},68192:function(e,n,t){"use strict";t.d(n,{Z:function(){return R}});var i=t(82394),o=t(75582),r=t(82684),l=t(49555),u=t(69864),c=t(65557),s=t(43449),a=t(28598);var d=function(e){var n=e.addNewBlock,t=e.disableRefreshWarning,o=e.fetchPipeline,r=e.fetchVariables,l=e.onUpdateFileSuccess,u=e.openFilePaths,d=e.openSidekickView,p=e.pipeline,f=e.saveFile,v=e.selectedFilePath,h=e.sendTerminalMessage,m=e.setContentByFilePath,b=e.setDisableShortcuts,g=e.setErrors,x=e.setFilesTouched,j=e.setSelectedBlock;return(0,a.jsx)(a.Fragment,{children:null===u||void 0===u?void 0:u.map((function(e){return(0,a.jsx)("div",{style:{display:v===e?null:"none"},children:(0,a.jsx)(c.Z,{uuid:"FileEditor/".concat(decodeURIComponent(e)),children:(0,a.jsx)(s.Z,{active:v===e,addNewBlock:n,disableRefreshWarning:t,fetchPipeline:o,fetchVariables:r,filePath:e?encodeURIComponent(e):null,hideHeaderButtons:!0,onContentChange:function(n){return m((0,i.Z)({},e,n))},onUpdateFileSuccess:l,openSidekickView:d,pipeline:p,sendTerminalMessage:h,setDisableShortcuts:b,setSelectedBlock:j,saveFile:f,selectedFilePath:v,setErrors:g,setFilesTouched:x})})},e)}))})},p=t(29269),f=t(87418),v=t(90758),h=t(89706),m=t(28385),b=t(35686),g=t(39643),x=t(53808),j=t(86735),y="show_hidden_files",k="open_files";function Z(){return(0,x.U2)(k,[])}function P(e){(0,x.t8)(k,e)}function O(e){var n=(0,x.U2)(k,[]);return n.includes(e)||n.push(e),P(n),n}function C(e){var n=(0,x.U2)(k,[]),t=(0,j.Od)(n,(function(n){return n===e}));return P(t),t}var w=t(17717);function _(e){var n=e.split(w.sep);return n[n.length-1]}var S=t(72619),E=t(42041),I=t(23780),T=t(44688);function M(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function D(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?M(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):M(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var R=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.addNewBlock,t=e.blocks,s=e.deleteWidget,j=e.disableContextMenu,k=e.fetchAutocompleteItems,w=e.fetchPipeline,M=e.fetchVariables,R=e.onOpenFile,B=e.onSelectBlockFile,A=e.onSelectFile,N=e.onUpdateFileSuccess,L=e.openSidekickView,F=e.pipeline,U=e.query,H=e.selectedFilePath,W=e.sendTerminalMessage,G=e.setDisableShortcuts,z=e.setSelectedBlock,K=e.showHiddenFilesSetting,V=e.uuid,q=e.widgets,Y=(0,l.j)("apiReloads"),X=(0,o.Z)(Y,2),Q=X[1],J=(0,I.VI)(null,{},[],{uuid:"useFileComponents/".concat(V)}),$=(0,o.Z)(J,1),ee=$[0],ne=(0,r.useState)((0,x.U2)(y,!1)),te=ne[0],ie=ne[1],oe=(0,r.useRef)(null),re=(0,r.useRef)(null),le=(0,r.useCallback)((function(e){re.current||(re.current={}),re.current=D(D({},re.current),e)}),[re]),ue=(0,r.useState)([]),ce=ue[0],se=ue[1],ae=(0,r.useState)(null),de=ae[0],pe=ae[1],fe=(0,r.useState)({}),ve=fe[0],he=fe[1],me=(0,r.useState)(!1),be=me[0],ge=me[1],xe=(0,r.useMemo)((function(){return ce.reduce((function(e,n){var t=_(n);return e[t]||(e[t]=[]),e[t].push(n),e}),{})}),[ce]),je=(0,r.useCallback)((function(e){P(e),se(e)}),[]),ye=(0,r.useCallback)((function(e){je(O(e))}),[je]),ke=(0,r.useCallback)((function(e){le((0,i.Z)({},e,null)),he((function(n){return D(D({},n),{},(0,i.Z)({},e,!1))}));var n=C(e);je(n),de===e&&(null===n||void 0===n?void 0:n.length)>=1&&pe(n[n.length-1]),0===(null===n||void 0===n?void 0:n.length)&&pe(null)}),[de,le,je]),Ze=(0,r.useCallback)((function(e,n){n||(ye(e),pe(e)),R&&(null===R||void 0===R||R(e,n))}),[ye,R]);(0,r.useEffect)((function(){var e=Z();je(e),pe(H||function(n){return!n&&(null===e||void 0===e?void 0:e.length)>=1?e[0]:n})}),[H,je]);var Pe=(0,r.useCallback)((function(){var e=!te;ie(e),(0,x.t8)(y,e)}),[te]),Oe=b.ZP.files.list(K&&te?D(D({},h.BB),U):U),Ce=Oe.data,we=Oe.mutate,_e=(0,r.useMemo)((function(){return(null===Ce||void 0===Ce?void 0:Ce.files)||[]}),[Ce]),Se="Files/index",Ee=(0,T.y)(),Ie=(Ee.disableGlobalKeyboardShortcuts,Ee.registerOnKeyDown),Te=Ee.unregisterOnKeyDown;(0,r.useEffect)((function(){return function(){Te(Se)}}),[Te,Se]),Ie(Se,(function(e,n){var t=Object.entries(ve).reduce((function(e,n){var t=(0,o.Z)(n,2),i=t[0];return t[1]?e.concat(i):e}),[]);if((0,E.y)([g.zX,g.hS],n)&&(null===t||void 0===t?void 0:t.length)>=1){e.preventDefault();var i="You have changes that are unsaved: ".concat(t.join(", "),". ")+"Click cancel and save your changes before reloading page.";"undefined"!==typeof location&&window.confirm(i)&&location.reload()}}),[ve]);var Me=(0,u.Db)((function(e){return b.ZP.file_contents.useUpdate((null===e||void 0===e?void 0:e.path)&&encodeURIComponent(null===e||void 0===e?void 0:e.path))({file_content:e})}),{onSuccess:function(e){return(0,S.wD)(e,{callback:function(e){var n=e.file_content;Q((function(e){return D(D({},e),{},(0,i.Z)({},"FileVersions/".concat(null===n||void 0===n?void 0:n.path),Number(new Date)))})),le((0,i.Z)({},null===n||void 0===n?void 0:n.path,null))},onErrorCallback:function(e,n){return ee({errors:n,response:e})}})}}),De=(0,o.Z)(Me,1),Re=De[0],Be=(0,r.useCallback)((function(e,n){Re(D(D({},n),{},{content:e})),he((function(e){return D(D({},e),{},(0,i.Z)({},null===n||void 0===n?void 0:n.path,!1))}))}),[he,Re]),Ae=(0,r.useMemo)((function(){return(0,a.jsx)(p.Z,{addNewBlock:n,blocks:t,deleteWidget:s,disableContextMenu:j,fetchAutocompleteItems:k,fetchFiles:we,fetchPipeline:w,files:_e,showHiddenFilesSetting:K,onClickFile:function(e){return Ze(e)},onClickFolder:function(e){return Ze(e,!0)},onSelectBlockFile:B,openSidekickView:L,pipeline:F,ref:oe,showError:ee,setSelectedBlock:z,setShowHiddenFiles:Pe,showHiddenFiles:te,uuid:V,widgets:q})}),[n,t,s,j,k,we,w,oe,_e,K,B,Ze,L,F,z,ee,te,Pe,V,q]),Ne=(0,r.useMemo)((function(){return(0,a.jsx)(d,{addNewBlock:n,disableRefreshWarning:!0,fetchPipeline:w,fetchVariables:M,onUpdateFileSuccess:N,openFilePaths:ce,openSidekickView:L,pipeline:F,saveFile:Be,selectedFilePath:de,sendTerminalMessage:W,setContentByFilePath:le,setDisableShortcuts:G,setErrors:ee,setFilesTouched:he,setSelectedBlock:z})}),[n,w,M,N,ce,L,F,Be,de,W,le,G,he,z,ee]),Le=(0,r.useMemo)((function(){return(0,a.jsx)(f.Z,{fileVersionsVisible:be,onSave:function(){var e,n;(null===re||void 0===re||null===(e=re.current)||void 0===e||null===(n=e[de])||void 0===n?void 0:n.length)>=1&&Be(re.current[de],{path:de})},setFilesVersionsVisible:ge})}),[re,be,Be,de,ge]),Fe=(0,r.useMemo)((function(){return(0,a.jsx)(v.Z,{filePaths:ce,filesTouched:ve,isSelectedFilePath:function(e,n){return e===n},onClickTab:function(e){pe(e),A&&(null===A||void 0===A||A(e))},onClickTabClose:function(e){return ke(e)},renderTabTitle:function(e){var n=_(e),t=xe[n];return t&&(null===t||void 0===t?void 0:t.length)>=2?e:n},selectedFilePath:de})}),[ve,A,ce,xe,ke,de]),Ue=(0,r.useMemo)((function(){return(0,a.jsx)(c.Z,{uuid:"FileVersions/".concat(de?decodeURIComponent(de):""),children:(0,a.jsx)(m.Z,{selectedFilePath:de,setErrors:ee})})}),[de,ee]);return{browser:Ae,controller:Ne,fetchFiles:we,filePaths:ce,files:_e,filesTouched:ve,menu:Le,openFile:Ze,selectedFilePath:de,tabs:Fe,versions:Ue,versionsVisible:be}}},72226:function(e,n,t){"use strict";var i=t(82394),o=t(38276),r=t(75499),l=t(30160),u=t(17488),c=t(70515),s=t(28598);function a(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function d(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?a(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):a(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n=e.objectAttributes,t=e.originalAttributes,a=e.setObjectAttributes;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(o.Z,{mb:1,px:c.cd,children:[(0,s.jsx)(l.ZP,{bold:!0,children:"Outdated after"}),(0,s.jsx)(l.ZP,{muted:!0,small:!0,children:"After the global data product successfully completes running, how long after that will the global data product be outdated?"})]}),(0,s.jsx)(r.Z,{columnFlex:[null,1],columns:[{uuid:"Unit"},{uuid:"Value"}],rows:[{uuid:"seconds"},{uuid:"weeks"},{uuid:"months"},{uuid:"years"}].map((function(e){var o,r,c=e.uuid,p=null===n||void 0===n||null===(o=n.outdated_after)||void 0===o?void 0:o[c],f=null===t||void 0===t||null===(r=t.outdated_after)||void 0===r?void 0:r[c];return[(0,s.jsxs)(l.ZP,{default:!0,monospace:!0,children:[c," ",f&&(0,s.jsxs)(l.ZP,{inline:!0,monospace:!0,muted:!0,children:["(default: ",f,")"]})]},"label-".concat(c)),(0,s.jsx)(u.Z,{compact:!0,monospace:!0,onChange:function(e){return a((function(n){var t;return d(d({},n),{},{outdated_after:d(d({},null===n||void 0===n?void 0:n.outdated_after),{},(0,i.Z)({},c,0===(null===(t=e.target.value)||void 0===t?void 0:t.length)?null:Number(e.target.value)))})}))},placeholder:"Enter a number",primary:!0,setContentOnMount:!0,small:!0,type:"number",value:"undefined"===typeof p||null===p?"":p},"input-".concat(c))]}))})]})}},29644:function(e,n,t){"use strict";var i=t(82394),o=t(44085),r=t(38276),l=t(75499),u=t(30160),c=t(17488),s=t(70515),a=t(81728),d=t(86735),p=t(28598);function f(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function v(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?f(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):f(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n=e.objectAttributes,t=e.originalAttributes,f=e.setObjectAttributes;return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(r.Z,{mb:1,px:s.cd,children:[(0,p.jsxs)(u.ZP,{bold:!0,children:["Outdated starting at ",(0,p.jsx)(u.ZP,{inline:!0,muted:!0,children:"(optional)"})]}),(0,p.jsx)(u.ZP,{muted:!0,small:!0,children:"If enough time has passed since the last global data product has ran successfully and the global data product is determined to be outdated, then you can configure it to be outdated at a specific date or time."}),(0,p.jsx)("div",{style:{marginTop:4},children:(0,p.jsxs)(u.ZP,{muted:!0,small:!0,children:["For example, let\u2019s say the global data product is outdated after 12 hours. The last successful run was yesterday at 18:00. The global data product will be outdated today at 06:00. However, if the ",(0,p.jsx)(u.ZP,{bold:!0,inline:!0,muted:!0,small:!0,children:"Outdated starting at"})," has a value of 17 for ",(0,p.jsx)(u.ZP,{bold:!0,inline:!0,muted:!0,small:!0,children:"Hour of day"}),", then the global data product won\u2019t run again until today at 17:00."]})})]}),(0,p.jsx)(l.Z,{columnFlex:[null,1],columns:[{uuid:"Unit"},{uuid:"Value"}],rows:[{uuid:"second_of_minute",values:(0,d.w6)(60).map((function(e,n){return{uuid:n,value:n}}))},{uuid:"minute_of_hour",values:(0,d.w6)(60).map((function(e,n){return{uuid:n,value:n}}))},{uuid:"hour_of_day",values:(0,d.w6)(24).map((function(e,n){return{uuid:n,value:n}}))},{uuid:"day_of_week",values:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"].map((function(e,n){return{uuid:e,value:n}}))},{uuid:"day_of_month",values:(0,d.w6)(31).map((function(e,n){return{uuid:n+1,value:n+1}}))},{uuid:"day_of_year",values:(0,d.w6)(365).map((function(e,n){return{uuid:n+1,value:n+1}}))},{uuid:"week_of_month",values:(0,d.w6)(5).map((function(e,n){return{uuid:n+1,value:n+1}}))},{uuid:"week_of_year",values:(0,d.w6)(52).map((function(e,n){return{uuid:n+1,value:n+1}}))},{uuid:"month_of_year",values:["January","February","March","April","May","June","July","August","September","October","November","December"].map((function(e,n){return{uuid:e,value:n+1}}))}].map((function(e){var r,l,s,d=e.uuid,h=e.values,m=null===n||void 0===n||null===(r=n.outdated_starting_at)||void 0===r?void 0:r[d],b=null===t||void 0===t||null===(l=t.outdated_starting_at)||void 0===l?void 0:l[d],g={compact:!0,key:"outdated-starting-at-input-".concat(d),monospace:!0,onChange:function(e){return f((function(n){var t;return v(v({},n),{},{outdated_starting_at:v(v({},null===n||void 0===n?void 0:n.outdated_starting_at),{},(0,i.Z)({},d,0===(null===(t=e.target.value)||void 0===t?void 0:t.length)?null:Number(e.target.value)))})}))},primary:!0,small:!0,value:"undefined"===typeof m||null===m?"":m};return s=h?(0,p.jsx)(o.Z,v(v({},g),{},{placeholder:"Select a value",children:h.map((function(e){var n=e.uuid,t=e.value;return(0,p.jsx)("option",{value:t,children:n},t)}))})):(0,p.jsx)(c.Z,v(v({},g),{},{placeholder:"Enter a number",setContentOnMount:!0,type:"number"})),[(0,p.jsxs)(u.ZP,{default:!0,monospace:!0,children:[(0,a.vg)(d)," ",b&&(0,p.jsxs)(u.ZP,{inline:!0,monospace:!0,muted:!0,children:["(default: ",b,")"]})]},"outdated-starting-at-label-".concat(d)),s]}))})]})}},46209:function(e,n,t){"use strict";var i=t(82394),o=t(12691),r=t.n(o),l=t(70652),u=t(48670),c=t(38276),s=t(75499),a=t(30160),d=t(17488),p=t(70515),f=t(28598);function v(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function h(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?v(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):v(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n=e.blocks,t=e.objectAttributes,o=e.originalAttributes,v=e.setObjectAttributes;return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)(c.Z,{mb:1,px:p.cd,children:[(0,f.jsx)(a.ZP,{bold:!0,children:"Block data to output"}),(0,f.jsx)(a.ZP,{muted:!0,small:!0,children:"The data output from the block(s) you select below will be the data product that is returned when a downstream entity is requesting data from this global data product."}),(0,f.jsx)("div",{style:{marginTop:4},children:(0,f.jsx)(a.ZP,{muted:!0,small:!0,children:"When requesting data from this global data product, the selected block(s) will return data from its most recent partition. You can override this by adding a value in the partitions setting. For example, if you set the partitions value to 5, then the selected block will return data from its 5 most recent partitions. If you set the partitions value to 0, then all the partitions will be returned."})})]}),(0,f.jsx)(s.Z,{columnFlex:[null,1,null],columns:[{label:function(){return""},uuid:"selected"},{uuid:"Block UUID"},{uuid:"Partitions"}],rows:null===n||void 0===n?void 0:n.map((function(e){var n,c=e.uuid,s=null===t||void 0===t?void 0:t.settings,p=null===s||void 0===s?void 0:s[c],m=null===p||void 0===p?void 0:p.partitions,b=null===o||void 0===o||null===(n=o.settings)||void 0===n?void 0:n[c],g=null===b||void 0===b?void 0:b.partitions,x=!!p||!!b;return[(0,f.jsx)(l.Z,{checked:x,onClick:function(){return function(e){v((function(n){var t=(null===n||void 0===n?void 0:n.settings)||{};return e?t[c]={}:null===t||void 0===t||delete t[c],h(h({},n),{},{settings:t})}))}(!x)}},"selected--".concat(c)),(0,f.jsxs)("div",{children:[(0,f.jsx)(r(),{as:"/pipelines/".concat(null===t||void 0===t?void 0:t.object_uuid,"/edit?block_uuid=").concat(c),href:"/pipelines/[pipeline]/edit",passHref:!0,children:(0,f.jsx)(u.Z,{monospace:!0,openNewWindow:!0,sameColorAsText:!0,children:c})})," ",g&&(0,f.jsxs)(a.ZP,{inline:!0,monospace:!0,muted:!0,children:["(default: ",g,")"]})]},"block-uuid-".concat(c)),(0,f.jsx)(d.Z,{compact:!0,monospace:!0,onChange:function(e){return v((function(n){var t,o;return h(h({},n),{},{settings:h(h({},null===n||void 0===n?void 0:n.settings),{},(0,i.Z)({},c,h(h({},null===n||void 0===n||null===(t=n.settings)||void 0===t?void 0:t[c]),{},{partitions:0===(null===(o=e.target.value)||void 0===o?void 0:o.length)?null:Number(e.target.value)})))})}))},placeholder:"1",primary:!0,setContentOnMount:!0,small:!0,type:"number",value:"undefined"===typeof m||null===m?"":m},"input-".concat(c))]}))})]})}},67355:function(e,n,t){"use strict";var i=t(12691),o=t.n(i),r=t(82684),l=t(34376),u=t(8666),c=t(48670),s=t(38276),a=t(4190),d=t(75499),p=t(30160),f=t(35686),v=t(70515),h=t(95924),m=t(28598);n.Z=function(e){var n=e.globalDataProducts,t=e.onClickRow,i=(0,l.useRouter)(),b=f.ZP.global_data_products.list({},{},{pauseFetch:!!n}).data,g=(0,r.useMemo)((function(){return n||(null===b||void 0===b?void 0:b.global_data_products)||[]}),[b,n]);return b||n?b&&0===(null===g||void 0===g?void 0:g.length)?(0,m.jsx)(s.Z,{p:v.cd,children:(0,m.jsx)(p.ZP,{children:"There are currently no global data products registered."})}):(0,m.jsx)(d.Z,{columnFlex:[1,null,null],columns:[{uuid:"UUID"},{uuid:"Object type"},{uuid:"Object UUID"}],onClickRow:function(e){var n=null===g||void 0===g?void 0:g[e];n&&(t?null===t||void 0===t||t(n):i.push("/global-data-products/[...slug]","/global-data-products/".concat(null===n||void 0===n?void 0:n.uuid)))},rows:null===g||void 0===g?void 0:g.map((function(e){var n=e.object_type,t=e.object_uuid,r=e.uuid,l={as:null,href:null};return u.b.PIPELINE===n&&(l.as="/pipelines/".concat(t,"/edit"),l.href="/pipelines/[pipeline]/edit"),[(0,m.jsx)(p.ZP,{monospace:!0,children:r},"uuid"),(0,m.jsx)(p.ZP,{default:!0,monospace:!0,children:n},"objectType"),(0,m.jsx)(o(),{as:null===l||void 0===l?void 0:l.as,href:(null===l||void 0===l?void 0:l.href)||"",passHref:!0,children:(0,m.jsx)(c.Z,{default:!0,monospace:!0,onClick:function(e){(0,h.j)(e),i.push(l.href,l.as)},preventDefault:!0,children:t})},"objectUUID")]})),uuid:"global-data-products"}):(0,m.jsx)(s.Z,{p:v.cd,children:(0,m.jsx)(a.Z,{})})}},29480:function(e,n,t){"use strict";t.d(n,{$W:function(){return a},cl:function(){return d},cv:function(){return p},dE:function(){return c},zG:function(){return s}});var i=t(38626),o=t(44897),r=t(42631),l=t(70515),u=t(47041),c=i.default.div.withConfig({displayName:"indexstyle__SectionStyle",componentId:"sc-7a1uhf-0"})(["border-radius:","px;padding:","px;",""],r.n_,l.cd*l.iI,(function(e){return"\n background-color: ".concat((e.theme.background||o.Z.background).popup,";\n ")})),s=i.default.div.withConfig({displayName:"indexstyle__DocsStyle",componentId:"sc-7a1uhf-1"})(["> div{overflow:initial;}> div img{max-width:80%;background:white;padding:1rem;max-height:20vh;}"]),a=i.default.div.withConfig({displayName:"indexstyle__CodeEditorStyle",componentId:"sc-7a1uhf-2"})(["padding-top:","px;",""],l.cd*l.iI,(function(e){return"\n background-color: ".concat((e.theme.background||o.Z.background).codeTextarea,";\n ")})),d=i.default.div.withConfig({displayName:"indexstyle__TableContainerStyle",componentId:"sc-7a1uhf-3"})(["overflow:auto;max-height:90vh;width:100%;"," "," "," "," ",""],u.w5,(function(e){return e.hideHorizontalScrollbar&&"\n overflow-x: hidden;\n "}),(function(e){return e.width&&"\n width: ".concat(e.width,";\n ")}),(function(e){return e.height&&"\n height: ".concat(e.height,";\n ")}),(function(e){return e.maxHeight&&"\n max-height: ".concat(e.maxHeight,";\n ")})),p=i.default.div.withConfig({displayName:"indexstyle__HeaderRowStyle",componentId:"sc-7a1uhf-4"})(["padding:","px;"," "," ",""],2*l.iI,(function(e){return"\n background-color: ".concat((e.theme||o.Z).interactive.defaultBackground,";\n border-bottom: ").concat(r.YF,"px ").concat(r.M8," ").concat((e.theme||o.Z).borders.medium,";\n ")}),(function(e){return e.padding&&"\n padding: ".concat(e.padding,"px;\n ")}),(function(e){return e.rounded&&"\n border-top-left-radius: ".concat(r.n_,"px;\n border-top-right-radius: ").concat(r.n_,"px;\n ")}))},4015:function(e,n,t){"use strict";t.d(n,{$b:function(){return a},I5:function(){return c},Nk:function(){return u},gI:function(){return s}});var i=t(38626),o=t(44897),r=t(42631),l=t(70515),u=i.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-h093u4-0"})([""," ",""],(function(e){return!e.width&&"\n width: ".concat(40*l.iI,"px;\n ")}),(function(e){return e.width&&"\n width: ".concat(e.width,"px;\n ")})),c=i.default.div.withConfig({displayName:"indexstyle__HeaderStyle",componentId:"sc-h093u4-1"})(["padding:","px;",""],2.5*l.iI,(function(e){return"\n background-color: ".concat((e.theme.background||o.Z.background).dashboard,";\n border-left: 1px solid ").concat((e.theme.interactive||o.Z.interactive).defaultBorder,";\n border-right: 1px solid ").concat((e.theme.interactive||o.Z.interactive).defaultBorder,";\n border-top-left-radius: ").concat(r.n_,"px;\n border-top-right-radius: ").concat(r.n_,"px;\n border-top: 1px solid ").concat((e.theme.interactive||o.Z.interactive).defaultBorder,";\n ")})),s=i.default.div.withConfig({displayName:"indexstyle__RowStyle",componentId:"sc-h093u4-2"})(["align-items:center;justify-content:space-between;",""],(function(e){return"\n background-color: ".concat((e.theme.background||o.Z.background).dashboard,";\n border-left: 1px solid ").concat((e.theme.interactive||o.Z.interactive).defaultBorder,";\n border-right: 1px solid ").concat((e.theme.interactive||o.Z.interactive).defaultBorder,";\n border-top: 1px solid ").concat((e.theme.interactive||o.Z.interactive).defaultBorder,";\n display: ").concat((null===e||void 0===e?void 0:e.display)||"flex",";\n padding-bottom: ").concat(1*l.iI+((null===e||void 0===e?void 0:e.paddingVerticalAddition)||0),"px;\n padding-left: ").concat(l.cd*l.iI,"px;\n padding-top: ").concat(1*l.iI+((null===e||void 0===e?void 0:e.paddingVerticalAddition)||0),"px;\n ")})),a=i.default.div.withConfig({displayName:"indexstyle__FooterStyle",componentId:"sc-h093u4-3"})(["padding:","px ","px;",""],2.5*l.iI,2*l.iI,(function(e){return"\n background-color: ".concat((e.theme.background||o.Z.background).panel,";\n border-bottom-left-radius: ").concat(r.n_,"px;\n border-bottom-right-radius: ").concat(r.n_,"px;\n border-bottom: 1px solid ").concat((e.theme.interactive||o.Z.interactive).defaultBorder,";\n border-left: 1px solid ").concat((e.theme.interactive||o.Z.interactive).defaultBorder,";\n border-right: 1px solid ").concat((e.theme.interactive||o.Z.interactive).defaultBorder,";\n ")}))},90758:function(e,n,t){"use strict";t.d(n,{Z:function(){return w}});var i=t(82394),o=t(26304),r=t(82684),l=t(38626),u=t(39867),c=t(55485),s=t(48670),a=t(38276),d=t(30160),p=t(12468),f=t(44897),v=t(79899),h=t(72473),m=t(97133),b=t(70515),g=t(15610),x=t(95924),j=t(28598),y=1.25*b.iI;var k=function(e){var n=e.filePath,t=e.filesTouched,i=void 0===t?{}:t,o=e.isLast,l=e.onClickTab,k=e.onClickTabClose,Z=e.renderTabTitle,P=e.savePipelineContent,O=e.selected,C=e.themeContext,w=(0,r.useState)(!1),_=w[0],S=w[1],E=(0,v.Z)({filePath:n,name:n,uuid:n}),I=E.BlockIcon,T=E.Icon,M=E.color,D=E.iconColor,R=E.isBlockFile;return(0,j.jsx)(c.ZP,{flexDirection:"column",fullHeight:!0,onClick:function(e){e.preventDefault(),O||(l?l(n):(null===P||void 0===P||P(),(0,g.u)({file_path:encodeURIComponent(n)})))},onMouseEnter:function(){return S(!0)},onMouseLeave:function(){return S(!1)},children:(0,j.jsx)(m.Gb,{last:o,selected:O,children:(0,j.jsxs)(c.ZP,{alignItems:"center",fullHeight:!0,children:[(0,j.jsx)(p.Z,{appearAbove:!0,appearBefore:!0,label:n,size:null,widthFitContent:!0,children:(0,j.jsxs)(c.ZP,{alignItems:"center",fullHeight:!0,children:[!i[n]&&(0,j.jsx)(j.Fragment,{children:R?(0,j.jsx)(I,{color:M,size:1*b.iI,square:!0}):(0,j.jsx)(T,{fill:D,size:1.5*b.iI})}),i[n]&&(0,j.jsx)(p.Z,{label:"Unsaved changes",size:null,widthFitContent:!0,children:(0,j.jsx)("div",{style:{padding:1},children:(0,j.jsx)(u.Z,{borderColor:(C||f.Z).borders.danger,size:y})})}),(0,j.jsx)(a.Z,{mr:1}),(0,j.jsx)(d.ZP,{monospace:!0,muted:!O,noWrapping:!0,small:!0,children:Z?Z(n):n})]})}),k&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(a.Z,{mr:2}),(0,j.jsx)(p.Z,{label:"Close",size:null,widthFitContent:!0,children:(0,j.jsxs)(s.Z,{autoHeight:!0,block:!0,noHoverUnderline:!0,noOutline:!0,onClick:function(e){(0,x.j)(e),null===k||void 0===k||k(n)},preventDefault:!0,children:[(_||O)&&(0,j.jsx)(h.x8,{muted:!O,size:y}),!_&&!O&&(0,j.jsx)("div",{style:{width:y}})]})})]})]})})})},Z=t(86735),P=["filePaths","isSelectedFilePath","onClickTab","onClickTabClose","selectedFilePath","tabsBefore"];function O(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function C(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?O(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):O(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var w=function(e){var n=e.filePaths,t=e.isSelectedFilePath,i=e.onClickTab,u=e.onClickTabClose,s=e.selectedFilePath,a=e.tabsBefore,d=(0,o.Z)(e,P),p=(0,r.useContext)(l.ThemeContext),f=(0,r.useMemo)((function(){return n.map((function(e){return decodeURIComponent(e)}))}),[n]),v=(0,r.useMemo)((function(){return(null===f||void 0===f?void 0:f.length)||0}),[f]);return(0,j.jsxs)(c.ZP,{alignItems:"center",fullHeight:!0,justifyContent:"flex-start",children:[(null===a||void 0===a?void 0:a.length)>=1&&(null===a||void 0===a?void 0:a.map((function(e){var n=e.label,o=e.onClick,r=e.uuid,l=t?t(r,s):s===encodeURIComponent(r);return(0,j.jsx)(k,{onClickTab:function(){return null===o||void 0===o?void 0:o({onClickTab:i})},renderTabTitle:function(){return n?null===n||void 0===n?void 0:n():r},selected:l,themeContext:p},r)}))),null===f||void 0===f?void 0:f.map((function(e,n){var o=t?t(e,s):s===encodeURIComponent(e);return(0,r.createElement)(k,C(C({},d),{},{filePath:e,isLast:n===v-1,key:e,onClickTab:i,onClickTabClose:function(e){if(u)u(e);else{var n=(0,Z.Od)(f,(function(n){return n===e})).map((function(e){return encodeURIComponent(e)}));(0,g.u)({file_path:n[n.length-1]||null,"file_paths[]":n},{pushHistory:!0})}},selected:o,themeContext:p}))}))]})}},97133:function(e,n,t){"use strict";t.d(n,{Gb:function(){return p},fm:function(){return a},lO:function(){return s},rK:function(){return d},zn:function(){return c}});var i=t(38626),o=t(44897),r=t(2842),l=t(70515),u=t(47041),c=300,s=i.default.div.withConfig({displayName:"indexstyle__PipelineContainerStyle",componentId:"sc-1sv9513-0"})([".pipeline-detail-enter-active{opacity:1;transition:opacity ","ms linear;}.pipeline-detail-enter-done{opacity:0;transition:opacity ","ms linear;}"],c,c),a=i.default.div.withConfig({displayName:"indexstyle__OverlayStyle",componentId:"sc-1sv9513-1"})(["height:100vh;opacity:1;position:fixed;width:100vw;z-index:9999;",""],(function(e){return"\n background-color: ".concat((e.theme.background||o.Z.background).codeArea,";\n ")})),d=i.default.div.withConfig({displayName:"indexstyle__PipelineHeaderStyle",componentId:"sc-1sv9513-2"})(["height:","px;position:sticky;top:","px;width:100%;z-index:5;"," "," "," ",""],r.Wi,r.Wi,(function(e){return"\n background-color: ".concat((e.theme.background||o.Z.background).panel,";\n border-bottom: 1px solid ").concat((e.theme.borders||o.Z.borders).medium,";\n ")}),(function(e){return e.relativePosition&&"\n position: relative;\n "}),(function(e){return e.secondary&&"\n height: ".concat(37,"px;\n top: ").concat(r.Wi,"px;\n overflow-x: auto;\n z-index: 3;\n ")}),(0,u.y$)()),p=i.default.div.withConfig({displayName:"indexstyle__FileTabStyle",componentId:"sc-1sv9513-3"})(["border-right:1px solid transparent;height:100%;padding:","px ","px;"," "," ",""],1*l.iI,1.5*l.iI,(function(e){return"\n &:hover {\n cursor: default;\n\n p {\n color: ".concat((e.theme.content||o.Z.content).active," !important;\n cursor: default;\n }\n }\n ")}),(function(e){return e.selected&&"\n background-color: ".concat((e.theme.background||o.Z.background).codeTextarea,";\n ")}),(function(e){return!e.selected&&!e.last&&"\n border-color: ".concat((e.theme.borders||o.Z.borders).light," !important;\n ")}));i.default.div.withConfig({displayName:"indexstyle__HeaderViewOptionsStyle",componentId:"sc-1sv9513-4"})(["left:50%;position:absolute;transform:translateX(-50%);"])},28795:function(e,n,t){"use strict";var i;t.d(n,{B:function(){return o},M:function(){return i}}),function(e){e.BACKFILLS="backfills",e.BLOCK_RUNS="block_runs",e.DASHBOARD="dashboard",e.EDIT="edit",e.MONITOR="monitor",e.PIPELINE_LOGS="pipeline_logs",e.PIPELINE_RUNS="pipeline_runs",e.RUNS="runs",e.SETTINGS="settings",e.SYNCS="syncs",e.TRIGGERS="triggers"}(i||(i={}));var o="cancel_all_running_pipeline_runs"},85010:function(e,n,t){"use strict";t.d(n,{H:function(){return u}});var i=t(57653),o=t(72473),r=t(28795),l=t(50178);function u(e,n,t){var u=(n||{}).uuid||t,c=[{Icon:o.Bf,id:r.M.TRIGGERS,isSelected:function(){return r.M.TRIGGERS===e},label:function(){return"Triggers"},linkProps:{as:"/pipelines/".concat(u,"/triggers"),href:"/pipelines/[pipeline]/triggers"}},{Icon:o.Pf,id:r.M.RUNS,isSelected:function(){return r.M.RUNS===e},label:function(){return"Runs"},linkProps:{as:"/pipelines/".concat(u,"/runs"),href:"/pipelines/[pipeline]/runs"}},{Icon:o.UL,id:r.M.PIPELINE_LOGS,isSelected:function(){return r.M.PIPELINE_LOGS===e},label:function(){return"Logs"},linkProps:{as:"/pipelines/".concat(u,"/logs"),href:"/pipelines/[pipeline]/logs"}},{Icon:o.ug,id:r.M.MONITOR,isSelected:function(){return r.M.MONITOR===e},label:function(){return"Monitor"},linkProps:{as:"/pipelines/".concat(u,"/monitors"),href:"/pipelines/[pipeline]/monitors"}}];return i.qL.PYTHON===(null===n||void 0===n?void 0:n.type)&&c.splice(2,0,{Icon:o.dE,id:r.M.BACKFILLS,isSelected:function(){return r.M.BACKFILLS===e},label:function(){return"Backfills"},linkProps:{as:"/pipelines/".concat(u,"/backfills"),href:"/pipelines/[pipeline]/backfills"}}),i.qL.INTEGRATION===(null===n||void 0===n?void 0:n.type)&&c.unshift({Icon:o.Nt,id:r.M.SYNCS,isSelected:function(){return r.M.SYNCS===e},label:function(){return"Syncs"},linkProps:{as:"/pipelines/".concat(u,"/syncs"),href:"/pipelines/[pipeline]/syncs"}}),(0,l.Ct)()||(c.unshift({Icon:o.EK,disabled:!u,id:r.M.EDIT,isSelected:function(){return r.M.EDIT===e},label:function(){return"Edit pipeline"},linkProps:{as:"/pipelines/".concat(u,"/edit"),href:"/pipelines/[pipeline]/edit"}}),c.push({Icon:o.JG,id:r.M.SETTINGS,isSelected:function(){return r.M.SETTINGS===e},label:function(){return"Pipeline settings"},linkProps:{as:"/pipelines/".concat(u,"/settings"),href:"/pipelines/[pipeline]/settings"}})),c.unshift({Icon:o.G6,id:r.M.DASHBOARD,isSelected:function(){return r.M.DASHBOARD===e},label:function(){return"Dashboard"},linkProps:{as:"/pipelines/".concat(u,"/dashboard"),href:"/pipelines/[pipeline]/dashboard"}}),c}},66909:function(e,n,t){"use strict";t.d(n,{Eh:function(){return s},t0:function(){return a}});var i=t(38626),o=t(2842),r=t(4982),l=t(61896),u=t(47041),c=t(70515),s=(c.iI,r.O$+3*c.iI+l.dN),a=i.default.div.withConfig({displayName:"indexstyle__SidekickContainerStyle",componentId:"sc-15ofupc-0"})([""," overflow:auto;position:absolute;width:100%;"," ",""],u.w5,(function(e){return"\n height: calc(100vh - ".concat(o.uX,"px - ").concat(e.heightOffset,"px);\n ")}),(function(e){return e.overflowHidden&&"\n overflow: hidden;\n "}));i.default.div.withConfig({displayName:"indexstyle__PaddingContainerStyle",componentId:"sc-15ofupc-1"})(["padding:","px;",""],2*c.iI,(function(e){return e.noPadding&&"\n padding: 0;\n "}))},8916:function(e,n,t){"use strict";t.d(n,{FS:function(){return s},JZ:function(){return p},Tt:function(){return d},e7:function(){return f},wx:function(){return a}});var i=t(75582),o=t(82394),r=t(83784),l=t(30229);function u(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function c(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?u(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):u(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function s(e){return"string"===typeof e?e:JSON.stringify(e)}function a(e,n){var t,i;return null===e||void 0===e||null===(t=e.find((function(e){var t=e.block;return n(t)})))||void 0===t||null===(i=t.variables)||void 0===i?void 0:i.map((function(e){var n=e.value;return c(c({},e),{},{value:s(n)})}))}function d(e){var n;return null===(n=a(e,(function(e){return e.uuid===r.C})))||void 0===n?void 0:n.reduce((function(e,n){var t=n.uuid,i=n.value;return c(c({},e),{},(0,o.Z)({},t,i))}),{})}function p(e,n){return n===l.Xm.TIME?e.push({uuid:"execution_date",value:"<run datetime>"}):n===l.Xm.EVENT&&e.push({uuid:"event",value:"<trigger event>"}),e}function f(e){return e?Object.entries(e).reduce((function(e,n){var t=(0,i.Z)(n,2),r=t[0],l=t[1],u=l;try{u=JSON.parse(l)}catch(s){}return c(c({},e),{},(0,o.Z)({},r,u))}),{}):e}},48381:function(e,n,t){"use strict";var i=t(82684),o=t(31882),r=t(55485),l=t(30160),u=t(86735),c=t(28598);n.Z=function(e){var n=e.onClickTag,t=e.tags,s=void 0===t?[]:t,a=(0,i.useMemo)((function(){return(null===s||void 0===s?void 0:s.length)||0}),[s]),d=(0,i.useMemo)((function(){return(0,u.YC)(s||[],"uuid")}),[s]);return(0,c.jsx)(r.ZP,{alignItems:"center",flexWrap:"wrap",children:null===d||void 0===d?void 0:d.reduce((function(e,t){return e.push((0,c.jsx)("div",{style:{marginBottom:2,marginRight:a>=2?4:0,marginTop:2},children:(0,c.jsx)(o.Z,{onClick:n?function(){return n(t)}:null,small:!0,children:(0,c.jsx)(l.ZP,{children:t.uuid})})},"tag-".concat(t.uuid))),e}),[])})}},4982:function(e,n,t){"use strict";t.d(n,{O$:function(){return he},Fk:function(){return me}});var i=t(75582),o=t(12691),r=t.n(o),l=t(26304),u=t(21831),c=t(82394),s=t(82684),a=t(26226),d=t(84969),p=t(90948),f=t(65743),v=t(63588),h=t.n(v),m=t(75823),b=t(29989),g=t(62072),x=t(53989),j=t(49894),y=t(18246),k=t(59309),Z=["data","className","top","left","y","x0","x1","xScale","yScale","color","keys","value","order","offset","children"];function P(){return P=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},P.apply(this,arguments)}function O(e){var n=e.data,t=e.className,i=e.top,o=e.left,r=e.y,l=e.x0,u=void 0===l?g.l8:l,c=e.x1,a=void 0===c?g.xf:c,d=e.xScale,p=e.yScale,v=e.color,O=e.keys,C=e.value,w=e.order,_=e.offset,S=e.children,E=function(e,n){if(null==e)return{};var t,i,o={},r=Object.keys(e);for(i=0;i<r.length;i++)t=r[i],n.indexOf(t)>=0||(o[t]=e[t]);return o}(e,Z),I=(0,m.Z)();O&&I.keys(O),C&&(0,j.Z)(I.value,C),w&&I.order((0,y.ZP)(w)),_&&I.offset((0,k.ZP)(_));var T=I(n),M=(0,x.Z)(p),D=T.map((function(e,n){var t=e.key;return{index:n,key:t,bars:e.map((function(n,i){var o=(d(a(n))||0)-(d(u(n))||0),l=d(u(n)),c="bandwidth"in p?p(r(n.data)):Math.max((p(r(n.data))||0)-o/2);return{bar:n,key:t,index:i,height:M,width:o,x:l||0,y:c||0,color:v(e.key,i)}}))}}));return S?s.createElement(s.Fragment,null,S(D)):s.createElement(b.Z,{className:h()("visx-bar-stack-horizontal",t),top:i,left:o},D.map((function(e){return e.bars.map((function(n){return s.createElement(f.Z,P({key:"bar-stack-"+e.index+"-"+n.index,x:n.x,y:n.y,height:n.height,width:n.width,fill:n.color},E))}))})))}var C=t(79487),w=t(38626),_=t(61655),S=t(16853),E=t(65376),I=t(48072),T=t(24903),M=t(84181),D=t(98677),R=t(30160),B=t(70987),A=t(79633),N=t(61896),L=t(70515),F=t(95363),U=t(28598),H=["height","width"];function W(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function G(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?W(Object(t),!0).forEach((function(n){(0,c.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):W(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var z={bottom:5*L.iI,left:3*L.iI,right:20*L.iI,top:0},K=function(e){return e.x},V=function(e){return e.y},q=(0,_.Z)((function(e){var n=e.data,t=e.height,i=e.hideTooltip,o=e.large,r=e.margin,l=void 0===r?{}:r,c=e.renderTooltipContent,a=e.showTooltip,v=e.tooltipData,h=e.tooltipLeft,m=e.tooltipOpen,g=e.tooltipTop,x=e.width,j=e.xAxisLabel,y=e.xNumTicks,k=e.yLabelFormat,Z=e.ySerialize,P=k;P||(P=function(e){return e.length>20?"".concat(e.substring(0,20),"..."):e});var _=o?N.iD:N.J5,L=(0,s.useContext)(w.ThemeContext),H=G(G({},z),l),W=n.slice(Math.max(0,n.length-50)),q=Object.keys(W[0]||[]).filter((function(e){return"x"===e})),Y=(0,T.Z)({domain:q,range:[A.hM]}),X=(0,M.Z)({domain:[0,Math.max.apply(Math,(0,u.Z)(W.map(K)))],nice:!0}),Q=(0,D.Z)({domain:W.map(V),padding:.35}),J={active:(null===L||void 0===L?void 0:L.content.default)||B.Z.content.default,backgroundPrimary:(null===L||void 0===L?void 0:L.chart.backgroundPrimary)||B.Z.chart.backgroundPrimary,backgroundSecondary:(null===L||void 0===L?void 0:L.chart.backgroundSecondary)||B.Z.chart.backgroundSecondary,muted:(null===L||void 0===L?void 0:L.content.muted)||B.Z.content.muted,primary:(null===L||void 0===L?void 0:L.chart.primary)||B.Z.chart.primary,tooltipBackground:(null===L||void 0===L?void 0:L.background.navigation)||B.Z.background.navigation},$=W.map(Z),ee=Math.min(Math.max.apply(Math,(0,u.Z)($.map((function(e){return String(e).length})))),20);6*ee>2*H.right?H.right+=5.5*ee:6*ee>=H.right&&(H.right+=3.75*ee);var ne=x-H.left-H.right,te=t-H.top-H.bottom;H.left+=7*ee,X.rangeRound([0,ne]),Q.rangeRound([te,0]);var ie=W.map(K).length,oe=Q($[ie-1]),re=(0,s.useCallback)((function(e){var n=(0,I.Z)(e)||{x:0,y:0},t=n.x,i=n.y,o=1-(i-oe/2)/(te-oe),r=Math.floor(o*ie),l=W[r];"undefined"===typeof l&&(l=W[r-1]),i>oe&&i<te-oe&&a({tooltipData:l,tooltipLeft:t,tooltipTop:i+H.top})}),[W,ie,H.top,a,oe,te]);return x<10?null:(0,U.jsxs)("div",{children:[(0,U.jsxs)("svg",{height:t,width:x,children:[(0,U.jsx)(f.Z,{fill:"transparent",height:t-(H.top+H.bottom),onMouseLeave:function(){return i()},onMouseMove:re,onTouchMove:re,onTouchStart:re,rx:14,width:x-H.left,x:H.left,y:0}),(0,U.jsxs)(b.Z,{left:H.left,top:H.top,children:[(0,U.jsx)(O,{color:Y,data:W,height:te,keys:q,pointerEvents:"none",xScale:X,y:Z,yScale:Q,children:function(e){return e.map((function(e){return e.bars.map((function(n){return(0,U.jsx)("g",{children:(0,U.jsx)(U.Fragment,{children:(0,U.jsx)("rect",{fill:J.backgroundPrimary,height:n.height,pointerEvents:"none",rx:4,width:n.width,x:n.x,y:n.y})})},"barstack-horizontal-".concat(e.index,"-").concat(n.index))}))}))}}),(0,U.jsx)(d.Z,{hideTicks:!0,scale:Q,stroke:J.muted,tickFormat:function(e){return P(e)},tickLabelProps:function(){return{fill:J.active,fontFamily:F.ry,fontSize:_,style:{width:"10px"},textAnchor:"end"}},tickStroke:J.muted,tickValues:$,top:2}),(0,U.jsx)(p.Z,{label:j,labelProps:{fill:J.muted,fontFamily:F.ry,fontSize:_,textAnchor:"middle"},numTicks:y,scale:X,stroke:J.muted,tickLabelProps:function(){return{fill:J.active,fontFamily:F.ry,fontSize:_,textAnchor:"middle"}},tickStroke:J.muted,top:te})]}),v&&(0,U.jsx)("g",{children:(0,U.jsx)(C.Z,{from:{x:H.left,y:g},pointerEvents:"none",stroke:A.Ej,strokeDasharray:"5,2",strokeWidth:1,to:{x:ne+H.left,y:g}})})]}),m&&v&&(0,U.jsx)(S.Z,{left:h,style:G(G({},E.j),{},{backgroundColor:J.tooltipBackground}),top:g,children:(0,U.jsxs)(R.ZP,{black:!0,small:!0,children:[null===c||void 0===c?void 0:c(v),!c&&K(v).toFixed(4)]})})]})}));var Y,X,Q,J,$=function(e){var n=e.height,t=e.width,i=(0,l.Z)(e,H);return(0,U.jsx)("div",{style:{height:n,width:"undefined"===typeof t?"100%":t},children:(0,U.jsx)(a.Z,{children:function(e){var n=e.width,t=e.height;return(0,U.jsx)(q,G(G({},i),{},{height:t,width:n}))}})})},ee=t(97618),ne=t(52729),te=t(48670),ie=t(87862),oe=t(89370),re=t(86735),le=(re.Qj,re.tS,re.tS,re.tS,re.tS,re.Qj,re.Qj,re.Qj,re.tS,re.tS,Y={},(0,c.Z)(Y,oe.RL.EMAIL,"domain_distribution"),(0,c.Z)(Y,oe.RL.TEXT,"word_distribution"),(0,c.Z)(Y,oe.RL.LIST,"element_distribution"),(0,c.Z)(Y,"default","value_counts"),Y),ue=[].concat((0,u.Z)(oe.P_),[oe.RL.TEXT,oe.RL.EMAIL,oe.RL.LIST]),ce=(X={},(0,c.Z)(X,oe.RL.EMAIL,"Domain distribution"),(0,c.Z)(X,oe.RL.TEXT,"Word distribution"),(0,c.Z)(X,oe.RL.LIST,"Element distribution"),(0,c.Z)(X,"default","Distribution of values"),t(31353));!function(e){e.RANGE="range"}(Q||(Q={})),function(e){e.BAR_HORIZONTAL="bar_horizontal",e.LINE_CHART="line_chart",e.HISTOGRAM="histogram"}(J||(J={}));var se=t(48888),ae=t(92083),de=t.n(ae),pe=t(81728);function fe(e,n){var t,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=i||{},r=o.calculateAnomaly,l=o.feature,c=o.getYValue,s=e.x,a=e.x_metadata,d=a.label,p=a.label_type,f=e.y,v=(null===f||void 0===f?void 0:f.map((function(e){return null===c||void 0===c?void 0:c(e)})))||[],h=Math.max.apply(Math,(0,u.Z)(v)),m=Math.max.apply(Math,(0,u.Z)(v)),b=(0,re.Sm)(v),g=(0,re.IN)(v),x=b/Math.max(1,v.length),j=n[d]||l,y=null===j||void 0===j?void 0:j.columnType,k=oe.RL.DATETIME===y,Z=[],P=[],O=s.length,C=s.map((function(e,n){var i,o,l,u,c=e.label,s=e.max,a=e.min,d=f[n];if(Q.RANGE===p)if(t||(t=s-a),u=oe.RL.NUMBER===y&&t<=O)i=Number(a);else if(i=t/2+a,k){var j="M/D/YYYY",C="M/D/YYYY",w="M/D/YYYY";t<=1?(j=t<=.1?"H:mm:ss.SSS":"H:mm:ss",C="H:mm:ss.SSS",w="H:mm:ss.SSS"):t<=60?(j="H:mm",C="H:mm:ss",w="H:mm:ss"):t<=3600?(j="H:mm",C="M/D/YYYY H:mm",w="H:mm"):t<=86400&&(C="M/D/YYYY H:mm",w="M/D/YYYY H:mm"),i=de().unix(i).format(j),o=de().unix(a).format(C),l=de().unix(s).format(w)}else i=(0,pe.QV)(i);else i=c;var _=n>=1?f[n-1]:null,S=!1;r&&(S=r({x:e,y:d,yPrevious:_,yValues:v,yValuesAverage:x,yValuesMax:h,yValuesMin:m,yValuesStandardDeviation:g,yValuesSum:b}));var E={hideRange:u,isUnusual:S,x:e,xLabel:i,xLabelMax:l,xLabelMin:o,y:d};return S&&(u?P.push(E):Z.push(E)),E}));return{distribution:{data:C,featureUUID:d},rangedWithUnusualDistribution:(0,re.YC)(Z,(function(e){var n=e.y;return c(n)}),{ascending:!1}),unusualDistribution:(0,re.YC)(P,(function(e){var n=e.y;return c(n)}),{ascending:!1})}}var ve=t(40489);var he=12*L.iI;function me(e){var n=e.columnTypes,t=e.columns,o=e.insightsByFeatureUUID,l=e.insightsOverview,u=e.noColumnLinks,c=void 0!==u&&u,s=e.statistics;return function(e,u,a){var d=a.width,p=t[u],f=n[p],v=ce.T5[f],h=(o[p]||{}).charts,m=l.time_series,b=t.filter((function(e){return n[e]===oe.RL.DATETIME})),g=null===m||void 0===m?void 0:m.map((function(e){return fe(e,{},{feature:{columnType:f,uuid:p}}).distribution})),x={};null===g||void 0===g||g.forEach((function(e,n){var t=e.data;x[b[n]]=(0,U.jsx)(ne.Z,{data:t.map((function(e){var n=e.x,t=e.xLabel,i=e.xLabelMax,o=e.xLabelMin;return[t,e.y.count,o,i,n.min,n.max]})),height:he,large:!0,margin:{bottom:0,left:0,right:0,top:0},renderTooltipContent:function(e){var n=(0,i.Z)(e,4),t=n[1],o=n[2],r=n[3];return(0,U.jsxs)("p",{children:["Rows: ",t,(0,U.jsx)("br",{}),"Start: ",o,(0,U.jsx)("br",{}),"End: ",r]})},sortData:function(e){return(0,re.YC)(e,"[4]")}},p)}));var j,y=null===h||void 0===h?void 0:h.find((function(e){var n=e.type;return J.HISTOGRAM===n})),k=(y?fe(y,{},{feature:{columnType:f,uuid:p},getYValue:function(e){return e.value}}):{}).distribution,Z=void 0===k?null:k,P=le[f]||le.default,O=null===s||void 0===s?void 0:s["".concat(p,"/").concat(P)],C=Object.entries(O||{}).map((function(e){var n=(0,i.Z)(e,2),t=n[0];return{x:n[1],y:t}})),w=oe.RL.TRUE_OR_FALSE===f;if(oe.RL.DATETIME===f)j=x[p];else if(Z&&!w)j=(0,U.jsx)(ne.Z,{data:Z.data.map((function(e){var n=e.hideRange,t=e.isUnusual,i=e.x;return[e.xLabel,e.y.value,i.min,i.max,t,n]})),height:he,margin:{bottom:0,left:0,right:0,top:0},renderTooltipContent:function(e){var n=(0,i.Z)(e,6),t=n[1],o=n[2],r=n[3],l=n[5];return(0,U.jsxs)("p",{children:[l&&(0,U.jsxs)(U.Fragment,{children:["Rows: ",t,(0,U.jsx)("br",{}),"Value: ",o]}),!l&&(0,U.jsxs)(U.Fragment,{children:["Rows: ",t,(0,U.jsx)("br",{}),"Range: ",o," - ",r]})]})},sortData:function(e){return(0,re.YC)(e,"[2]")},width:d-2*L.iI});else if(ue.includes(f)){var _=(0,re.YC)((0,re.YC)(C,"x",{ascending:!1}).slice(0,5),"x");j=(0,U.jsx)($,{data:_,height:he,margin:{bottom:0,left:0,right:20,top:0},renderTooltipContent:function(e){var n=e.x,t=e.y;return"".concat(t," appears ").concat((0,pe.x6)(n)," times")},xNumTicks:2,ySerialize:function(e){return e.y}})}else w&&O&&(j=(0,U.jsx)(ie.Z,{data:Object.entries(O),getX:function(e){var n=(0,i.Z)(e,2),t=n[0],o=n[1];return"".concat(t," (").concat((0,pe.x6)(o),")")},getY:function(e){return(0,i.Z)(e,2)[1]},height:he}));return(0,U.jsxs)("div",{style:{padding:L.iI},children:[(0,U.jsxs)("div",{style:{alignItems:"center",display:"flex",marginBottom:L.iI},children:[v&&(0,U.jsx)(ee.Z,{title:oe.Rp[f],children:(0,U.jsx)(v,{size:2*L.iI})}),(0,U.jsx)("div",{style:{marginLeft:.5*L.iI,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:d-4.5*L.iI},children:c?(0,U.jsx)(R.ZP,{bold:!0,default:!0,title:t[u],children:t[u]}):(0,U.jsx)(r(),{as:(0,ve.o_)(se.oE,u),href:"/datasets/[...slug]",passHref:!0,children:(0,U.jsx)(te.Z,{bold:!0,monospace:!0,secondary:!0,small:!0,title:t[u],children:t[u]})})})]}),j,!j&&(0,U.jsx)("div",{style:{height:he}})]})}}},55729:function(e,n,t){"use strict";t.d(n,{Z:function(){return N}});var i=t(82394),o=t(75582),r=t(82684),l=t(69864),u=t(71180),c=t(15338),s=t(97618),a=t(55485),d=t(85854),p=t(48670),f=t(65956),v=t(82359),h=t(88543),m=t(38276),b=t(30160),g=t(17488),x=t(69650),j=t(12468),y=t(35686),k=t(77417),Z=t(38626),P=t(44897),O=t(42631),C=t(70515),w=Z.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-1b0w59t-0"})(["border-radius:","px;padding:","px;",""],O.n_,C.cd*C.iI,(function(e){return"\n background-color: ".concat((e.theme.background||P.Z.background).codeArea,";\n ")})),_=t(72473),S=t(72191),E=t(70320),I=t(81728),T=t(42122),M=t(72619),D=t(23780),R=t(28598);function B(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function A(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?B(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):B(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var N=function(e){var n,t,Z,P=e.cancelButtonText,O=e.contained,B=e.header,N=e.onCancel,L=e.onSaveSuccess,F=e.rootProject,U=(0,D.VI)(null,{},[],{uuid:"settings/workspace/preferences"}),H=(0,o.Z)(U,1)[0],W=(0,r.useState)(null),G=W[0],z=W[1],K=(0,r.useState)(!1),V=K[0],q=K[1],Y=(0,k.Z)(),X=Y.fetchProjects,Q=Y.project,J=Y.projectPlatformActivated,$=Y.rootProject,ee=(0,r.useMemo)((function(){return F?$:Q}),[Q,$,F]),ne=ee||{},te=ne.name,ie=ne.openai_api_key,oe=ne.project_uuid,re=(0,r.useMemo)((function(){return"demo.mage.ai"===window.location.hostname}),[]);(0,r.useEffect)((function(){G||z(ee)}),[ee,G]);var le=(0,l.Db)(y.ZP.projects.useUpdate(te),{onSuccess:function(e){return(0,M.wD)(e,{callback:function(e){var n,t=e.project;X(),z(t),q(!1),(0,E.hY)(null===t||void 0===t||null===(n=t.features)||void 0===n?void 0:n[v.d.LOCAL_TIMEZONE]),L&&(null===L||void 0===L||L(t))},onErrorCallback:function(e,n){return H({errors:n,response:e})}})}}),ue=(0,o.Z)(le,2),ce=ue[0],se=ue[1].isLoading,ae=(0,r.useCallback)((function(e){return ce({project:A(A({},e),{},{root_project:F})})}),[F,ce]),de=(0,R.jsxs)(R.Fragment,{children:[B,(0,R.jsxs)(f.Z,{noPadding:!0,children:[(0,R.jsxs)(m.Z,{p:C.cd,children:[(0,R.jsx)(m.Z,{mb:1,children:(0,R.jsx)(d.Z,{level:5,children:"Project name"})}),(0,R.jsx)(b.ZP,{default:!0,monospace:!0,children:te})]}),(0,R.jsx)(c.Z,{light:!0}),(0,R.jsxs)(m.Z,{p:C.cd,children:[(0,R.jsx)(m.Z,{mb:1,children:(0,R.jsx)(d.Z,{level:5,children:"Project UUID"})}),(0,R.jsx)(b.ZP,{default:!!oe,monospace:!0,muted:!oe,children:oe||"Not required"})]}),(0,R.jsx)(c.Z,{light:!0}),(0,R.jsx)(m.Z,{p:C.cd,children:(0,R.jsxs)(a.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,R.jsxs)(s.Z,{flexDirection:"column",children:[(0,R.jsx)(m.Z,{mb:1,children:(0,R.jsx)(d.Z,{level:5,children:"Help improve Mage"})}),(0,R.jsxs)(b.ZP,{default:!0,children:["Please contribute usage statistics to help improve the developer experience for you and everyone in the community. Learn more ",(0,R.jsx)(p.Z,{href:"https://docs.mage.ai/contributing/statistics/overview",openNewWindow:!0,children:"here"}),"."]})]}),(0,R.jsx)(m.Z,{mr:C.cd}),(0,R.jsx)(x.Z,{compact:!0,checked:null===G||void 0===G?void 0:G.help_improve_mage,onCheck:function(){return z((function(e){return A(A({},e),{},{help_improve_mage:!(null!==G&&void 0!==G&&G.help_improve_mage)})}))}})]})})]}),(0,R.jsx)(m.Z,{mt:C.HN}),(0,R.jsx)(h.Z,{description:"Global settings that are applied to all pipelines in this project.",title:"Pipeline settings",children:(0,R.jsx)(h.S,{description:"Every time a trigger is created or updated in this pipeline, automatically persist it in code.",title:"Save triggers in code automatically",toggleSwitch:{checked:!(null===G||void 0===G||null===(n=G.pipelines)||void 0===n||null===(t=n.settings)||void 0===t||null===(Z=t.triggers)||void 0===Z||!Z.save_in_code_automatically),onCheck:function(e){return z((function(n){var t,i,o,r,l,u;return A(A({},n),{},{pipelines:A(A({},null===n||void 0===n?void 0:n.pipelines),{},{settings:A(A({},null===n||void 0===n||null===(t=n.pipelines)||void 0===t?void 0:t.settings),{},{triggers:A(A({},null===n||void 0===n||null===(i=n.pipelines)||void 0===i||null===(o=i.settings)||void 0===o?void 0:o.triggers),{},{save_in_code_automatically:e(null===n||void 0===n||null===(r=n.pipelines)||void 0===r||null===(l=r.settings)||void 0===l||null===(u=l.triggers)||void 0===u?void 0:u.save_in_code_automatically)})})})})}))}}})}),(0,R.jsx)(m.Z,{mt:C.HN}),(0,R.jsx)(f.Z,{noPadding:!0,overflowVisible:!0,children:(0,R.jsxs)(m.Z,{p:C.cd,children:[(0,R.jsx)(m.Z,{mb:1,children:(0,R.jsx)(d.Z,{level:5,children:"Features"})}),Object.entries((0,T.gR)(null===G||void 0===G?void 0:G.features,[{}])||{}).map((function(e,n){var t=(0,o.Z)(e,2),r=t[0],l=t[1],u=J&&!F&&(null===ee||void 0===ee?void 0:ee.features_override)&&r in(null===ee||void 0===ee?void 0:ee.features_override);return(0,R.jsx)(m.Z,{mt:0===n?0:1,children:(0,R.jsxs)(a.ZP,{alignItems:"center",children:[(0,R.jsxs)(s.Z,{flex:1,children:[(0,R.jsx)(x.Z,{disabled:u,checked:!!l,compact:!0,onCheck:function(){return z((function(e){return A(A({},e),{},{features:A(A({},null===G||void 0===G?void 0:G.features),{},(0,i.Z)({},r,!l))})}))}}),(0,R.jsx)(m.Z,{mr:C.cd}),(0,R.jsxs)(s.Z,{children:[(0,R.jsx)(b.ZP,{default:!l,monospace:!0,children:(0,I.vg)(r)}),r===v.d.LOCAL_TIMEZONE&&(0,R.jsx)(m.Z,{ml:1,children:(0,R.jsx)(j.Z,A({},E.EB))})]})]}),u&&(0,R.jsx)(b.ZP,{monospace:!0,muted:!0,small:!0,children:"overridden"})]})},r)}))]})}),(0,R.jsx)(m.Z,{mt:C.HN}),(0,R.jsx)(f.Z,{noPadding:!0,children:(0,R.jsxs)(m.Z,{p:C.cd,children:[(0,R.jsx)(m.Z,{mb:1,children:(0,R.jsx)(d.Z,{level:5,children:"OpenAI"})}),ie&&!V?(0,R.jsxs)(a.ZP,A(A({},a.A0),{},{children:[(0,R.jsx)(b.ZP,{default:!0,monospace:!0,children:"API key: ********"}),(0,R.jsx)(u.ZP,{iconOnly:!0,onClick:function(){return q(!0)},secondary:!0,title:"Edit",children:(0,R.jsx)(_.I8,{size:S.bL})})]})):(0,R.jsx)(g.Z,{disabled:re,label:re?"Entering API key is disabled on demo":"API key",monospace:!0,onChange:function(e){return z((function(n){return A(A({},n),{},{openai_api_key:e.target.value})}))},primary:!0,setContentOnMount:!0,value:(null===G||void 0===G?void 0:G.openai_api_key)||""})]})}),(0,R.jsx)(m.Z,{mt:C.HN}),(0,R.jsxs)(a.ZP,{alignItems:"center",children:[(0,R.jsx)(u.ZP,{loading:se,onClick:function(){ae({features:null===G||void 0===G?void 0:G.features,help_improve_mage:null===G||void 0===G?void 0:G.help_improve_mage,openai_api_key:null===G||void 0===G?void 0:G.openai_api_key,pipelines:null===G||void 0===G?void 0:G.pipelines})},primary:!0,children:"Save project settings"}),N&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(m.Z,{mr:C.cd}),(0,R.jsx)(u.ZP,{onClick:N,secondary:!0,children:P||"Cancel"})]})]})]});return O?(0,R.jsx)(w,{children:de}):de}},46568:function(e,n,t){"use strict";var i=t(82394),o=t(26304),r=(t(82684),t(33591)),l=t(28598),u=["children","fullHeight","gutter","style"];function c(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function s(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?c(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):c(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n=e.children,t=e.fullHeight,i=e.gutter,c=e.style,a=void 0===c?{}:c,d=(0,o.Z)(e,u),p=s({},a);return i&&(p.paddingLeft=i,p.paddingRight=p.paddingLeft),t&&(p.height="100%"),(0,l.jsx)(r.Col,s(s({},d),{},{style:p,children:n}))}},82682:function(e,n,t){"use strict";var i=t(82394),o=t(26304),r=t(82684),l=t(33591),u=t(28598),c=["children","fullHeight","gutter","justifyContent","style"];function s(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function a(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?s(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):s(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n=e.children,t=e.fullHeight,i=e.gutter,s=e.justifyContent,d=e.style,p=void 0===d?{}:d,f=(0,o.Z)(e,c),v=a({},p);return i&&(v.marginLeft=-1*i,v.marginRight=v.marginLeft),t&&(v.height="100%"),(0,u.jsx)(l.Row,a(a({},f),{},{justifyContent:s,style:v,children:r.Children.map(n,(function(e,n){return e&&r.cloneElement(e,{gutter:i,key:n})}))}))}},28071:function(e,n,t){"use strict";var i;t.d(n,{X:function(){return i}}),function(e){e.BOOTSTRAPPING="BOOTSTRAPPING",e.RUNNING="RUNNING",e.STARTING="STARTING",e.TERMINATED="TERMINATED",e.TERMINATED_WITH_ERRORS="TERMINATED_WITH_ERRORS",e.TERMINATING="TERMINATING",e.WAITING="WAITING"}(i||(i={}))},26032:function(e,n,t){"use strict";var i,o;t.d(n,{_:function(){return i},i:function(){return o}}),function(e){e.CREATE="CREATE",e.DELETE="DELETE",e.DESELECT="DESELECT",e.UPDATE="UPDATE"}(i||(i={})),function(e){e.ACTIVE="ACTIVE",e.INACTIVE="INACTIVE",e.PENDING="PENDING"}(o||(o={}))},68781:function(e,n,t){"use strict";var i;t.d(n,{R:function(){return o}}),function(e){e.AZURE_CONTAINER_INSTANCE="azure_container_instance",e.ECS="ecs",e.GCP_CLOUD_RUN="gcp_cloud_run",e.K8S="k8s",e.LOCAL_PYTHON="local_python",e.PYSPARK="pyspark"}(i||(i={}));var o=[i.AZURE_CONTAINER_INSTANCE,i.ECS,i.GCP_CLOUD_RUN,i.K8S,i.LOCAL_PYTHON,i.PYSPARK]},8666:function(e,n,t){"use strict";var i;t.d(n,{b:function(){return i}}),function(e){e.BLOCK="block",e.PIPELINE="pipeline"}(i||(i={}))},14466:function(e,n,t){"use strict";t.d(n,{Ij:function(){return r},N_:function(){return h},SQ:function(){return l},TT:function(){return u},W6:function(){return p},XG:function(){return a},YB:function(){return s},i9:function(){return v},sw:function(){return c},t4:function(){return d}});var i,o,r,l,u,c,s,a,d,p,f=t(82394);!function(e){e.CREATE="create",e.DELETE="delete",e.DETAIL="detail",e.EXECUTE="execute",e.LIST="list",e.UPDATE="update",e.UPDATE_ANYWHERE="update_anywhere"}(o||(o={})),function(e){e.BREAK="break",e.CONTINUE="continue",e.RAISE="raise"}(r||(r={})),function(e){e.AFTER="after",e.BEFORE="before"}(l||(l={})),function(e){e.ERROR="error",e.META="meta",e.METADATA="metadata",e.PAYLOAD="payload",e.QUERY="query",e.RESOURCE="resource",e.RESOURCES="resources"}(u||(u={})),function(e){e.FAILURE="failure",e.SUCCESS="success"}(c||(c={})),function(e){e.AND="and",e.OR="or"}(s||(s={})),function(e){e.ERROR="error",e.HOOK="hook",e.META="meta",e.METADATA="metadata",e.OPERATION_RESOURCE="operation_resource",e.PAYLOAD="payload",e.QUERY="query",e.RESOURCE="resource",e.RESOURCES="resources",e.RESOURCE_ID="resource_id",e.RESOURCE_PARENT="resource_parent",e.RESOURCE_PARENT_ID="resource_parent_id",e.RESOURCE_PARENT_TYPE="resource_parent_type",e.USER="user"}(a||(a={})),function(e){e.BOOLEAN="BOOLEAN",e.DICTIONARY="DICTIONARY",e.FLOAT="FLOAT",e.INTEGER="INTEGER",e.LIST="LIST",e.STRING="STRING"}(d||(d={})),function(e){e.EQUALS="EQUALS",e.GREATER_THAN="GREATER_THAN",e.GREATER_THAN_OR_EQUALS="GREATER_THAN_OR_EQUALS",e.INCLUDES="INCLUDES",e.LESS_THAN="LESS_THAN",e.LESS_THAN_OR_EQUALS="LESS_THAN_OR_EQUALS",e.NOT_EQUALS="NOT_EQUALS",e.NOT_INCLUDES="NOT_INCLUDES",e.NOT_PRESENT="NOT_PRESENT",e.PRESENT="PRESENT"}(p||(p={}));var v=[p.NOT_PRESENT,p.PRESENT],h=(i={},(0,f.Z)(i,p.EQUALS,"=="),(0,f.Z)(i,p.GREATER_THAN,">"),(0,f.Z)(i,p.GREATER_THAN_OR_EQUALS,">="),(0,f.Z)(i,p.INCLUDES,"includes"),(0,f.Z)(i,p.LESS_THAN,"<"),(0,f.Z)(i,p.LESS_THAN_OR_EQUALS,"<="),(0,f.Z)(i,p.NOT_EQUALS,"!="),(0,f.Z)(i,p.NOT_INCLUDES,"not includes"),(0,f.Z)(i,p.NOT_PRESENT,"is not present"),(0,f.Z)(i,p.PRESENT,"is present"),i)},30229:function(e,n,t){"use strict";t.d(n,{PN:function(){return u},TR:function(){return v},U5:function(){return s},Wb:function(){return f},Xm:function(){return r},Z4:function(){return a},fq:function(){return c},gm:function(){return d},kJ:function(){return p}});var i,o,r,l=t(82394),u="__bookmark_values__";!function(e){e.API="api",e.EVENT="event",e.TIME="time"}(r||(r={}));var c,s,a=(i={},(0,l.Z)(i,r.API,(function(){return"API"})),(0,l.Z)(i,r.EVENT,(function(){return"event"})),(0,l.Z)(i,r.TIME,(function(){return"schedule"})),i);!function(e){e.ACTIVE="active",e.INACTIVE="inactive"}(c||(c={})),function(e){e.ONCE="@once",e.HOURLY="@hourly",e.DAILY="@daily",e.WEEKLY="@weekly",e.MONTHLY="@monthly",e.ALWAYS_ON="@always_on"}(s||(s={}));var d,p,f=[s.ONCE,s.HOURLY,s.DAILY,s.WEEKLY,s.MONTHLY];!function(e){e.INTERVAL="frequency[]",e.STATUS="status[]",e.TAG="tag[]",e.TYPE="type[]"}(d||(d={})),function(e){e.CREATED_AT="created_at",e.NAME="name",e.PIPELINE="pipeline_uuid",e.STATUS="status",e.TYPE="schedule_type"}(p||(p={}));var v=(o={},(0,l.Z)(o,p.CREATED_AT,"Created at"),(0,l.Z)(o,p.NAME,"Name"),(0,l.Z)(o,p.PIPELINE,"Pipeline"),(0,l.Z)(o,p.STATUS,"Active"),(0,l.Z)(o,p.TYPE,"Type"),o)},83784:function(e,n,t){"use strict";t.d(n,{C:function(){return i}});var i="global"},9134:function(e,n,t){"use strict";var i=t(82684),o=t(21124),r=t(68432),l=t(38626),u=t(65292),c=t(44897),s=t(95363),a=t(70515),d=t(28598);n.Z=function(e){var n=e.language,t=e.maxWidth,p=e.showLineNumbers,f=e.small,v=e.source,h=e.wrapLines,m=(0,i.useContext)(l.ThemeContext);function b(e){var i=e.value;return(0,d.jsx)(r.Z,{customStyle:{backgroundColor:(m.background||c.Z.background).popup,border:"none",borderRadius:"none",boxShadow:"none",fontFamily:s.Vp,fontSize:f?12:14,marginBottom:0,marginTop:0,maxWidth:t,paddingBottom:2*a.iI,paddingTop:2*a.iI},language:n,lineNumberStyle:{color:(m.content||c.Z.content).muted},showLineNumbers:p,style:u._4,useInlineStyles:!0,wrapLines:h,children:i})}return(0,d.jsx)(o.D,{components:{code:function(e){var n=e.children;return(0,d.jsx)(b,{value:n})}},children:v})}},11074:function(e,n,t){"use strict";t.d(n,{Z:function(){return c}});var i=t(38626),o=t(44897),r=t(42631),l=i.default.div.withConfig({displayName:"indexstyle__PanelStyle",componentId:"sc-1rfr5wd-0"})(["border-radius:","px;"," ",""],r.n_,(function(e){return"\n background-color: ".concat((e.theme.background||o.Z.background).panel,";\n ")}),(function(e){return e.fullWidth&&"\n width: 100%;\n "})),u=t(28598);var c=function(e){var n=e.children,t=e.fullWidth,i=void 0===t||t;return(0,u.jsx)(l,{fullWidth:i,children:n})}},96348:function(e,n,t){"use strict";t.d(n,{g:function(){return b},Z:function(){return g}});var i=t(82684),o=t(38626),r=t(44897),l=t(42631),u=t(47041),c=t(70515),s=1.5*c.iI,a=1.5*c.iI,d=o.default.div.withConfig({displayName:"indexstyle__TableStyle",componentId:"sc-13p7y8j-0"})(["border-radius:","px;overflow:hidden;width:100%;"," "," "," ",""],l.n_,(function(e){return e.width&&"\n width: ".concat(e.width,"px;\n ")}),(function(e){return"\n background-color: ".concat((e.theme||r.Z).background.page,";\n border: ").concat(l.YF,"px ").concat(l.M8," ").concat((e.theme||r.Z).interactive.defaultBorder,";\n box-shadow: ").concat((e.theme||r.Z).shadow.frame,";\n ")}),(function(e){return e.noBackground&&"\n background-color: transparent;\n "}),(function(e){return e.noBoxShadow&&"\n box-shadow: none;\n "})),p=o.default.div.withConfig({displayName:"indexstyle__RowContainerStyle",componentId:"sc-13p7y8j-1"})(["overflow:auto;border-bottom-left-radius:","px;border-bottom-right-radius:","px;"," "," "," ",""],l.n_,l.n_,u.w5,(function(e){return e.maxHeight>0&&"\n max-height: ".concat(e.maxHeight,"px;\n ")}),(function(e){return e.minHeight>0&&"\n min-height: ".concat(e.minHeight,"px;\n ")}),(function(e){return e.scrollable&&"\n margin-bottom: ".concat(c.iI,"px;\n overflow-y: auto;\n padding-top: ").concat(3,"px;\n padding-left: ").concat(3,"px;\n padding-right: ").concat(3,"px;\n ")})),f=o.default.div.withConfig({displayName:"indexstyle__HeaderStyle",componentId:"sc-13p7y8j-2"})(["border-top-left-radius:","px;border-top-right-radius:","px;padding:","px ","px;",""],l.n_,l.n_,s,2*c.iI,(function(e){return"\n border-bottom: ".concat(l.YF,"px ").concat(l.M8," ").concat((e.theme.interactive||r.Z.interactive).defaultBorder,";\n ")})),v=o.default.div.withConfig({displayName:"indexstyle__RowStyle",componentId:"sc-13p7y8j-3"})(["padding:","px ","px;"," "," "," "," "," ",""],a,2*c.iI,(function(e){return"\n border-bottom: ".concat(l.YF,"px ").concat(l.M8," ").concat((e.theme||r.Z).borders.medium2,";\n ")}),(function(e){return e.sameColorBorders&&"\n border-bottom-color: ".concat((e.theme||r.Z).interactive.defaultBorder,";\n ")}),(function(e){return e.noHorizontalPadding&&"\n padding-left: 0;\n padding-right: 0;\n "}),(function(e){return e.condensed&&"\n padding-top: ".concat(9,"px;\n padding-bottom: ").concat(9,"px;\n ")}),(function(e){return e.secondary&&"\n background-color: ".concat((e.theme.background||r.Z.background).row2,";\n ")}),(function(e){return e.last&&e.noBorder&&"\n border-bottom-left-radius: ".concat(l.n_,"px;\n border-bottom-right-radius: ").concat(l.n_,"px;\n border-bottom: none;\n ")})),h=o.default.div.withConfig({displayName:"indexstyle__FooterStyle",componentId:"sc-13p7y8j-4"})(["border-bottom-left-radius:","px;border-bottom-right-radius:","px;padding:","px ","px;",""],l.n_,l.n_,s,2*c.iI,(function(e){return"\n border-top: ".concat(l.YF,"px ").concat(l.M8," ").concat((e.theme||r.Z).borders.medium2,";\n ")})),m=t(28598),b=v;var g=function(e){var n=e.alternating,t=e.children,o=e.footer,r=e.header,l=e.maxHeight,u=e.minHeight,c=e.noBackground,s=e.noBoxShadow,a=e.sameColorBorders,v=e.scrollable,b=e.width,g=[].concat(t).filter((function(e){return null!==e}));return(0,m.jsxs)(d,{noBackground:c,noBoxShadow:s,width:b,children:[r&&(0,m.jsx)(f,{children:r}),(0,m.jsx)(p,{maxHeight:l,minHeight:u,scrollable:v,children:i.Children.map(g,(function(e,t){return e&&i.cloneElement(e,{last:t===g.length-1,sameColorBorders:a,secondary:n&&t%2===1})}))}),o&&(0,m.jsx)(h,{children:o})]})}},76850:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return _r}});var i=t(77837),o=t(21831),r=t(75582),l=t(82394),u=t(38860),c=t.n(u),s=t(92083),a=t.n(s),d=t(56085),p=t(38626),f=t(82684),v=t(69864),h=t(34376),m=t(65557),b=t(40761),g=t(44425),x=t(70652),j=t(39867),y=t(15338),k=t(97618),Z=t(55485),P=t(48670),O=t(38276),C=t(30160),w=t(70515),_=t(55283),S=t(28598);function E(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function I(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?E(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):E(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var T=function(e){var n=e.blockRefs,t=e.hiddenBlocks,i=e.pipeline,o=e.setHiddenBlocks,r=(0,f.useContext)(p.ThemeContext),u=(0,f.useMemo)((function(){return(null===i||void 0===i?void 0:i.blocks)||[]}),[i]),c=(0,f.useMemo)((function(){var e=[],n=[];return u.forEach((function(i){var o=i.uuid;null!==t&&void 0!==t&&t[o]?e.push(i):n.push(i)})),{blocksHidden:e,blocksVisible:n}}),[u,t]),s=c.blocksHidden,a=c.blocksVisible,d=(0,f.useMemo)((function(){return(null===u||void 0===u?void 0:u.length)>=1&&0===a.length}),[u,a]),v=(0,f.useMemo)((function(){return(null===u||void 0===u?void 0:u.length)>=1&&0===s.length}),[u,s]),h=(0,f.useCallback)((function(e){var t=e.type,i=e.uuid;if(null!==n&&void 0!==n&&n.current){var o,r=n.current["".concat(t,"s/").concat(i,".py")];null===r||void 0===r||null===(o=r.current)||void 0===o||o.scrollIntoView()}}),[n]);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Z,{p:1,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(x.Z,{checked:v,label:"Show all",onClick:function(){return o((function(){return{}}))}}),(0,S.jsx)(O.Z,{mr:w.cd}),(0,S.jsx)(x.Z,{checked:d,label:"Hide all",onClick:function(){return o((function(){return u.reduce((function(e,n){var t=n.uuid;return I(I({},e),{},(0,l.Z)({},t,!0))}),{})}))}})]})}),(0,S.jsx)(y.Z,{medium:!0}),null===u||void 0===u?void 0:u.map((function(e){var n=e.uuid,i=(0,_.qn)(e.type,{blockColor:e.color,theme:r}).accent,u=!(null!==t&&void 0!==t&&t[n]);return(0,S.jsx)(P.Z,{block:!0,noHoverUnderline:!0,noOutline:!0,onClick:function(){o((function(e){return I(I({},e),{},(0,l.Z)({},n,u))})),u||setTimeout((function(){return h(e)}),1)},preventDefault:!0,children:(0,S.jsx)(O.Z,{mt:1,px:1,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(O.Z,{pr:1,children:(0,S.jsx)(x.Z,{checked:u})}),(0,S.jsxs)(k.Z,{alignItems:"center",children:[(0,S.jsx)(j.Z,{color:i,size:1.5*w.iI,square:!0}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(C.ZP,{default:!0,monospace:!0,noWrapping:!0,small:!0,children:n})]})]})})},n)}))]})},M=t(60523),D=t(28125),R=t(71180),B=t(90299),A=t(65701),N=t(1254);var L=function(e){var n=e.size;return(0,S.jsxs)("svg",{width:n,height:n,viewBox:"0 0 121 121",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,S.jsx)("path",{d:"M67.7193 2.36691C69.8656 1.52184 72.3078 2.0081 73.9667 3.61084L116.977 45.1646C119.018 47.1366 119.362 50.2841 117.794 52.65L92.5787 90.7113C92.1293 91.3897 91.5441 91.9675 90.8601 92.4083L51.1076 118.029C48.6859 119.589 45.4904 119.168 43.5558 117.033L3.02296 72.3013C1.48382 70.6027 1.07052 68.1652 1.96372 66.0542L20.1894 22.9792C20.8058 21.5224 21.9825 20.3749 23.4544 19.7954L67.7193 2.36691Z",fill:"url(#paint0_radial_11972_15232)"}),(0,S.jsx)("path",{d:"M71.2431 0.979492L23.6155 19.9931C22.1646 20.5723 21.0034 21.7045 20.3877 23.1402L0.499023 69.5159L20.1894 22.9792C20.8058 21.5224 21.9825 20.3749 23.4544 19.7954L71.2431 0.979492Z",fill:"url(#paint1_radial_11972_15232)"}),(0,S.jsx)("path",{d:"M66.8804 2.66681C69.0294 1.81866 71.4758 2.30583 73.1359 3.9125L116.693 46.0674C117.169 46.5283 117.061 47.3191 116.478 47.635L75.3823 69.9165C74.5929 70.3446 73.6135 70.1821 73.0046 69.522L27.1285 19.7915C26.661 19.2848 26.8482 18.4667 27.4895 18.2136L66.8804 2.66681Z",fill:"url(#paint3_radial_11972_15232)"}),(0,S.jsx)("path",{d:"M66.8804 2.66681C69.0294 1.81866 71.4758 2.30583 73.1359 3.9125L116.693 46.0674C117.169 46.5283 117.061 47.3191 116.478 47.635L75.3823 69.9165C74.5929 70.3446 73.6135 70.1821 73.0046 69.522L27.1285 19.7915C26.661 19.2848 26.8482 18.4667 27.4895 18.2136L66.8804 2.66681Z",fill:"url(#paint4_linear_11972_15232)"}),(0,S.jsx)("path",{d:"M23.3591 24.6945L58.2913 58.6736L25.3897 22.7247C24.8455 22.13 23.9152 22.1095 23.3452 22.6795C22.7871 23.2375 22.7934 24.1442 23.3591 24.6945Z",fill:"url(#paint5_radial_11972_15232)"}),(0,S.jsx)("path",{d:"M51.6694 46.395L73.0043 69.5215C73.6132 70.1816 74.5925 70.3441 75.382 69.9161L117.654 46.9975L75.6257 67.8209C74.8809 68.1899 73.9844 68.0497 73.3879 67.4708L51.6694 46.395Z",fill:"url(#paint6_radial_11972_15232)"}),(0,S.jsxs)("defs",{children:[(0,S.jsxs)("radialGradient",{id:"paint0_radial_11972_15232",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(16.9412 88.4412) rotate(18.02) scale(82.0367 81.4644)",children:[(0,S.jsx)("stop",{stopColor:"#FFDA19"}),(0,S.jsx)("stop",{offset:"0.473958",stopColor:"#33CDF2"}),(0,S.jsx)("stop",{offset:"0.786458",stopColor:"#3266FF"}),(0,S.jsx)("stop",{offset:"1",stopColor:"#5429FF"})]}),(0,S.jsxs)("radialGradient",{id:"paint1_radial_11972_15232",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(35.8711 10.2518) rotate(87.6364) scale(26.1711 27.0141)",children:[(0,S.jsx)("stop",{stopColor:"white"}),(0,S.jsx)("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]}),(0,S.jsxs)("radialGradient",{id:"paint2_radial_11972_15232",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(150.671 44.2502) rotate(128.639) scale(125.554 128.436)",children:[(0,S.jsx)("stop",{stopColor:"white"}),(0,S.jsx)("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]}),(0,S.jsxs)("radialGradient",{id:"paint3_radial_11972_15232",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(133.353 52.8357) rotate(144.647) scale(86.7385 72.7129)",children:[(0,S.jsx)("stop",{offset:"0.081278",stopColor:"white"}),(0,S.jsx)("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]}),(0,S.jsxs)("linearGradient",{id:"paint4_linear_11972_15232",x1:"76.5876",y1:"66.532",x2:"79.1358",y2:"50.4429",gradientUnits:"userSpaceOnUse",children:[(0,S.jsx)("stop",{stopColor:"white"}),(0,S.jsx)("stop",{offset:"0.416667",stopColor:"white",stopOpacity:"0.1"}),(0,S.jsx)("stop",{offset:"0.682292",stopColor:"white",stopOpacity:"0"})]}),(0,S.jsxs)("radialGradient",{id:"paint5_radial_11972_15232",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(25.2251 23.4978) rotate(48.3599) scale(35.5147 43.1672)",children:[(0,S.jsx)("stop",{stopColor:"white"}),(0,S.jsx)("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]}),(0,S.jsxs)("radialGradient",{id:"paint6_radial_11972_15232",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(76.5908 67.6516) rotate(104.629) scale(14.9575 79.0374)",children:[(0,S.jsx)("stop",{stopColor:"white"}),(0,S.jsx)("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]})]})]})},F=t(70693),U=t(93369),H=t(7267),W=t(57653),G=t(44085),z=t(4190),K=t(17488),V=t(35686),q=t(72473),Y=t(4015),X=t(13803),Q=t(72191),J=t(2548),$=t(81728),ee=t(72619),ne=t(23780);function te(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function ie(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?te(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):te(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var oe=function(e){var n,t,i=e.block,o=e.defaultName,l=e.isReplacingBlock,u=e.isUpdatingBlock,c=e.onClose,s=e.onSave,a=e.pipeline,d=(0,ne.VI)(null,{},[],{uuid:"ConfigureBlock"}),p=(0,r.Z)(d,1)[0],h=Object.keys((null===i||void 0===i?void 0:i.pipelines)||{}).length,m=(0,f.useRef)(null),b=(0,f.useState)({color:(null===i||void 0===i?void 0:i.color)||null,language:(null===i||void 0===i||null===(n=i.defaults)||void 0===n?void 0:n.language)||(null===i||void 0===i?void 0:i.language),name:o,type:null===i||void 0===i?void 0:i.type}),x=b[0],j=b[1],y=(0,f.useCallback)((function(){s(ie(ie({},x),{},{name:(null===x||void 0===x?void 0:x.name)||o})),c()}),[x,o,c,s]);(0,f.useEffect)((function(){var e,n=function(e){e.stopPropagation(),"Escape"===e.key?c():"Enter"===e.key&&y()};return null===(e=document)||void 0===e||e.addEventListener("keydown",n),function(){var e;null===(e=document)||void 0===e||e.removeEventListener("keydown",n)}}),[y,c]),(0,f.useEffect)((function(){var e;null===m||void 0===m||null===(e=m.current)||void 0===e||e.focus()}),[]);var P=(0,f.useMemo)((function(){return W.qL.INTEGRATION===(null===a||void 0===a?void 0:a.type)}),[a]),_=(0,f.useMemo)((function(){return g.tf.CUSTOM===(null===i||void 0===i?void 0:i.type)}),[i]),E=(0,f.useMemo)((function(){return g.tf.MARKDOWN===(null===i||void 0===i?void 0:i.type)}),[i]),I=(0,f.useMemo)((function(){return null===i||void 0===i?void 0:i.block_action_object}),[i]),T=(0,f.useMemo)((function(){return J.L.GENERATE_BLOCK===(null===I||void 0===I?void 0:I.object_type)}),[I]),M=(0,f.useMemo)((function(){return T&&(null===I||void 0===I?void 0:I.description)}),[I,T]),D=(0,f.useMemo)((function(){var e;return X.I.DATA_INTEGRATION===(null===i||void 0===i||null===(e=i.config)||void 0===e?void 0:e.template_type)||!![X.O.DESTINATIONS,X.O.SOURCES].includes(null===I||void 0===I?void 0:I.language)}),[i,I]),B=(0,f.useState)(null),te=B[0],oe=B[1],re=(0,v.Db)(V.ZP.llms.useCreate(),{onSuccess:function(e){return(0,ee.wD)(e,{callback:function(e){var n=e.llm,t=(null===n||void 0===n?void 0:n.response)||{},i=t.block_type,o=t.configuration,r=t.content,l=t.language;j((function(e){return ie(ie({},e),{},{block_action_object:null,configuration:o,content:r,language:l,type:i})})),oe(n)},onErrorCallback:function(e,n){return p({errors:n,response:e})}})}}),le=(0,r.Z)(re,2),ue=le[0],ce=le[1].isLoading;(0,f.useEffect)((function(){T&&M&&!te&&ue({llm:{request:{block_description:M},use_case:H.z.GENERATE_BLOCK_WITH_DESCRIPTION}})}),[ue,M,T,te]);var se=(0,f.useMemo)((function(){var e,n;return null!==i&&void 0!==i&&null!==(e=i.config)&&void 0!==e&&e.custom_template?null===i||void 0===i||null===(n=i.config)||void 0===n?void 0:n.custom_template:[J.L.CUSTOM_BLOCK_TEMPLATE,J.L.MAGE_TEMPLATE].includes(null===I||void 0===I?void 0:I.object_type)?ie(ie({},I),{},{name:null===I||void 0===I?void 0:I.title}):void 0}),[i,I]),ae=(0,f.useMemo)((function(){var e=(null===x||void 0===x?void 0:x.type)||(null===i||void 0===i?void 0:i.type);se&&(e=null===se||void 0===se?void 0:se.block_type);var n=g.V4[e];return P&&(g.tf.DATA_LOADER===e?n="Source":g.tf.DATA_EXPORTER===e&&(n="Destination")),n}),[i,x,se,P]);return(0,S.jsxs)(Y.Nk,{width:T&&(null===x||void 0===x?void 0:x.content)&&80*w.iI,children:[(0,S.jsxs)(Y.I5,{children:[T&&ce&&(0,S.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsx)(C.ZP,{children:"Generating block using AI..."}),(0,S.jsx)(z.Z,{inverted:!0})]}),T&&!ce&&(0,S.jsx)(Z.ZP,{alignItems:"center",justifyContent:"center",children:(0,S.jsx)(q.xq,{size:5*w.iI,warning:!0})}),!T&&(0,S.jsx)(Z.ZP,{alignItems:"center",justifyContent:"center",children:(0,S.jsx)(L,{size:15*w.iI})})]}),T&&!ce&&(0,S.jsx)(Y.gI,{children:(0,S.jsxs)(O.Z,{py:1,children:[(0,S.jsx)(O.Z,{mb:1,children:(0,S.jsx)(C.ZP,{default:!0,children:"Block generated using AI"})}),(0,S.jsx)(C.ZP,{textOverflow:!0,children:M})]})}),se&&(0,S.jsx)(Y.gI,{children:(0,S.jsxs)(O.Z,{py:1,children:[(0,S.jsx)(O.Z,{mb:1,children:(0,S.jsx)(C.ZP,{default:!0,children:"Template"})}),(0,S.jsx)(C.ZP,{textOverflow:!0,children:null===(t=(null===se||void 0===se?void 0:se.name)||(null===se||void 0===se?void 0:se.template_uuid))||void 0===t?void 0:t.slice(0,40)})]})}),g.tf.GLOBAL_DATA_PRODUCT!==(null===i||void 0===i?void 0:i.type)&&h>1&&(0,S.jsxs)(Y.gI,{children:[(0,S.jsx)(k.Z,{flex:"1",children:(0,S.jsx)(q.uy,{size:Q.l2,warning:!0})}),(0,S.jsx)(k.Z,{flex:"6",children:(0,S.jsxs)(C.ZP,{bold:!0,warning:!0,children:[u&&"Renaming this block will affect ".concat(h," pipelines.")+" The renamed block may need to be re-added to the shared pipeline(s).",l&&"This will create a copy of the selected block and replace the existing one so it is no longer shared with any other pipelines."]})})]}),(0,S.jsxs)(Y.gI,{children:[(0,S.jsx)(C.ZP,{default:!0,children:"Name"}),(0,S.jsx)(K.Z,{alignRight:!0,fullWidth:!0,noBackground:!0,noBorder:!0,onChange:function(e){return j((function(n){return ie(ie({},n),{},{name:e.target.value})}))},paddingVertical:w.iI,placeholder:"Block name...",ref:m,value:(null===x||void 0===x?void 0:x.name)||""})]}),(0,S.jsxs)(Y.gI,{children:[(0,S.jsx)(C.ZP,{default:!0,children:"Type"}),(0,S.jsx)(O.Z,{mr:w.cd,py:1,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(C.ZP,{muted:!0,children:ae}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(q.QM,{muted:!0})]})})]}),!E&&(_||se||(null===x||void 0===x?void 0:x.language))&&(0,S.jsxs)(Y.gI,{paddingVerticalAddition:3,children:[(0,S.jsx)(C.ZP,{default:!0,children:"Language"}),(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[[g.t6.PYTHON,g.t6.SQL,g.t6.R,g.t6.YAML].reduce((function(e,n){var t=(se?null===se||void 0===se?void 0:se.language:null===x||void 0===x?void 0:x.language)===n;return!(_&&!u&&!l||t||D&&g.t6.R!==n&&D&&g.t6.SQL!==n)||_&&g.t6.YAML===n||e.push((0,S.jsx)(O.Z,{ml:1,children:(0,S.jsx)(R.ZP,{borderColor:t?null:"transparent",compact:!0,default:!_&&!t&&!D,disabled:!_&&!t&&!D,noBackground:!0,notClickable:(!_||u||!D)&&t,onClick:se&&!D?null:function(){return j((function(e){return ie(ie({},e),{},{language:n})}))},selected:t,children:g.LE[n]})},n)),e}),[]),!_&&!D&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(q.QM,{muted:!0})]}),(0,S.jsx)(O.Z,{mr:_||D?1:2})]})]}),(_||(null===se||void 0===se?void 0:se.color)||(null===x||void 0===x?void 0:x.color))&&(0,S.jsxs)(Y.gI,{children:[(0,S.jsx)(C.ZP,{default:!0,children:"Color"}),_&&(0,S.jsxs)(G.Z,{alignRight:!0,disabled:l,noBackground:!0,noBorder:!0,onChange:function(e){return j((function(n){return ie(ie({},n),{},{color:e.target.value})}))},value:se?(null===se||void 0===se?void 0:se.color)||"":(null===x||void 0===x?void 0:x.color)||"",children:[(0,S.jsx)("option",{value:""}),Object.values(g.Lq).map((function(e){return(0,S.jsx)("option",{value:e,children:(0,$.kC)(e)},e)}))]}),!_&&(0,S.jsx)(O.Z,{mr:w.cd,py:1,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(C.ZP,{muted:!0,children:(0,$.kC)((null===se||void 0===se?void 0:se.color)||(null===x||void 0===x?void 0:x.color)||"")}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(q.QM,{muted:!0})]})})]}),T&&(null===x||void 0===x?void 0:x.content)&&(0,S.jsx)(Y.gI,{display:"block",children:(0,S.jsx)(O.Z,{pr:w.cd,py:1,children:(0,S.jsx)(A.W,{backend:N.PD,children:(0,S.jsx)(F.Z,{block:ie(ie({},x),{},{uuid:M}),defaultValue:null===x||void 0===x?void 0:x.content,disableDrag:!0,hideExtraCommandButtons:!0,hideExtraConfiguration:!0,hideHeaderInteractiveInformation:!0,noDivider:!0,onChange:function(e){return j((function(n){return ie(ie({},n),{},{content:e})}))},selected:!0,textareaFocused:!0},M)})})}),(0,S.jsx)(Y.$b,{children:(0,S.jsxs)(Z.ZP,{fullWidth:!0,children:[(0,S.jsxs)(U.ZP,{bold:!0,centerText:!0,disabled:ce,onClick:y,primary:!0,tabIndex:0,uuid:"ConfigureBlock/SaveAndAddBlock",children:["Save and\xa0",u?"update":l?"replace":"add"," block"]}),(0,S.jsx)(O.Z,{ml:1,children:(0,S.jsx)(R.ZP,{onClick:c,tabIndex:0,children:"Cancel"})})]})})]})},re=t(54750),le=t(4804),ue=t(75810),ce=t(85854),se=t(99236),ae=t(29480),de=t(37443),pe=t(53405);function fe(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function ve(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?fe(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):fe(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var he=function(e){var n=e.block,t=e.blockConfigString,i=e.blockContent,o=e.blockUpstreamBlocks,l=e.dataIntegrationConfiguration,u=e.onChangeCodeBlock,c=e.pipeline,s=e.savePipelineContent,a=e.setBlockConfigString,d=e.setBlockContent,p=e.setContent,h=e.setSelectedSubTab,m=e.showError,b=n||{},x=b.language,k=b.type,_=b.uuid,E=(c||{}).uuid,I=(0,f.useState)(!1),T=I[0],M=I[1],D=(0,f.useMemo)((function(){return g.t6.YAML===x&&i?(0,le.Qc)(i):{}}),[i,x]);(0,f.useEffect)((function(){D&&!t&&a((0,le.Pz)(null===D||void 0===D?void 0:D.config))}),[t,D]);var B=(0,f.useState)(!1),A=B[0],N=B[1],L=(0,v.Db)(V.ZP.integration_sources.useCreate(),{onSuccess:function(e){return(0,ee.wD)(e,{callback:function(e){var n=e.integration_source;null!==n&&void 0!==n&&n.error_message?m({response:{error:{exception:null===n||void 0===n?void 0:n.error_message}}}):null!==n&&void 0!==n&&n.success&&N(!0)},onErrorCallback:function(e,n){return m({errors:n,response:e})}})}}),F=(0,r.Z)(L,2),U=F[0],H=F[1].isLoading,W=(0,f.useCallback)((function(){return s().then((function(){return U({integration_source:{action_type:"test_connection",block_uuid:_,pipeline_uuid:E}})}))}),[_,U,E,s]),G=(0,f.useMemo)((function(){if(g.t6.YAML===x)return(0,S.jsx)(ae.$W,{children:(0,S.jsx)(ue.Z,{autoHeight:!0,language:x,onChange:function(e){a(e);try{var n=(0,le.Qc)(e),t=(0,le.Pz)(ve(ve({},D),{},{config:n}));u(k,_,t),p(t),M(!1)}catch(i){M(!0)}},tabSize:2,value:t||void 0,width:"100%"})});g.t6.PYTHON}),[t,i,D,x,k,_,d,p]),z=(0,f.useMemo)((function(){return(0,pe.Wi)(o,l)}),[o,l]);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Z,{p:w.cd,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(R.ZP,{beforeIcon:(0,S.jsx)(q.Ae,{success:!0}),loading:H,onClick:function(){N(!1),W()},secondary:!0,compact:!0,children:"Test connection"}),A&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Z,{mr:w.cd}),(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(j.Z,{size:1*w.iI,success:!0}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(C.ZP,{success:!0,children:"Connection successful"})]})]})]})}),(0,S.jsx)(y.Z,{light:!0}),(0,S.jsxs)(O.Z,{p:w.cd,children:[(0,S.jsx)(C.ZP,{bold:!0,default:!0,large:!0,children:"Inputs from upstream blocks"}),0===(null===z||void 0===z?void 0:z.length)&&(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsxs)(C.ZP,{muted:!0,children:["No inputs are selected. Toggle the upstream blocks in the ",(0,S.jsx)(P.Z,{bold:!0,onClick:function(){return h(de.tw.UPSTREAM_BLOCK_SETTINGS)},preventDefault:!0,children:"Upstream block settings"})," to enable its output data as an input."]})})]}),(null===z||void 0===z?void 0:z.length)>=1&&(0,S.jsx)(se.Z,{inputsBlocks:z}),T&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(y.Z,{light:!0}),(0,S.jsxs)(O.Z,{p:w.cd,children:[(0,S.jsx)(O.Z,{mb:1,children:(0,S.jsx)(ce.Z,{danger:!0,level:5,children:"ERROR"})}),(0,S.jsxs)(C.ZP,{muted:!0,children:["The credentials configuration is formatted incorrectly for the language ",g.LE[x],". The formatting must be fixed before the credentials configuration can be saved."]})]})]}),G]})},me=t(56747),be=t(96348),ge=t(26304),xe=t(93859),je=t(66909),ye=t(42122);var ke=function(e){var n=e.block,t=e.height,i=e.pipeline,o=e.setSelectedSubTab,l=e.showError,u=e.stream,c=(0,f.useRef)(null),s=(0,f.useState)(null),a=s[0],d=s[1],p=(0,f.useState)(100),h=p[0],m=(p[1],(0,f.useState)(0)),b=m[0],g=m[1];(0,f.useEffect)((function(){var e,n;null!==c&&void 0!==c&&null!==(e=c.current)&&void 0!==e&&e.getBoundingClientRect().height&&g(null===c||void 0===c||null===(n=c.current)||void 0===n?void 0:n.getBoundingClientRect().height)}),[c]);var x=null===i||void 0===i?void 0:i.uuid,j=null===n||void 0===n?void 0:n.uuid,y=(0,f.useMemo)((function(){return{parentStreamID:(0,pe.Qu)(u),streamID:(0,pe.M$)(u)}}),[u]),k=y.parentStreamID,Z=y.streamID,_=(0,f.useMemo)((function(){return(0,ye.Qr)((0,pe.WE)(u||{})||{},{idIsInObject:!0})}),[u]),E=V.ZP.outputs.pipelines.detail(!a&&x,!a&&j,{parent_stream:k,sample_count:h,stream:Z},{revalidateOnFocus:!1}).data,I=(0,v.Db)(V.ZP.outputs.useCreate(),{onSuccess:function(e){return(0,ee.wD)(e,{callback:function(e){var n=e.output;d(n)},onErrorCallback:function(e,n){return l({errors:n,response:e})}})}}),T=(0,r.Z)(I,2),M=T[0],D=T[1].isLoading,B=(0,f.useCallback)((function(){return M({output:{block_uuid:j,persist:1,pipeline_uuid:x,refresh:1,sample_count:h,streams:[{parent_stream:k,stream:Z}]}})}),[j,M,k,x,h,Z]),A=(0,f.useMemo)((function(){return a||(null===E||void 0===E?void 0:E.output)}),[E,a]),N=(0,f.useMemo)((function(){var e,n=(A||{}).outputs,t=void 0===n?[]:n;return null===t||void 0===t||null===(e=t.find((function(e){return e.uuid===Z})))||void 0===e?void 0:e.data}),[A,Z]),L=(0,f.useMemo)((function(){var e=N||{},n=e.sample_data,i=(e.type,n||{}),o=i.columns,r=i.rows;if(null!==o&&void 0!==o&&o.length&&null!==r&&void 0!==r&&r.length)return(0,S.jsx)(xe.Z,{columnHeaderHeight:je.Eh,columns:o,height:t-b,noBorderBottom:!0,noBorderLeft:!0,noBorderRight:!0,rows:r})}),[N,t,b]);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Z,{p:w.cd,ref:c,children:_?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.ZP,{default:!0,children:"Please select at least 1 column in the stream in order to fetch sample data."}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsx)(P.Z,{bold:!0,onClick:function(){return o(de.tw.SETTINGS)},preventDefault:!0,children:"Go to Schema properties to select a column"})})]}):(0,S.jsx)(R.ZP,{compact:!0,loading:D,onClick:function(){return B()},primary:!0,children:N?"Refresh sample data":"Fetch sample data"})}),L]})},Ze=t(31882),Pe=t(75499),Oe=t(69650),Ce=t(12468),we=t(61599),_e=t(14466),Se=t(44897),Ee=t(42631),Ie=p.default.div.withConfig({displayName:"indexstyle__SectionStyle",componentId:"sc-wjbb3f-0"})(["border-radius:","px;"," ",""],Ee.n_,(function(e){return"\n border: 1px solid ".concat((e.theme.borders||Se.Z.borders).light,";\n ")}),(function(e){return!e.noPadding&&"\n padding: ".concat(w.cd*w.iI,"px;\n ")})),Te=t(86735);function Me(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function De(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Me(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Me(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Re=function(e){var n,t=e.block,i=(e.blocksMapping,e.onChangeBlock),u=e.setBlockAttributes,c=e.stream,s=(e.streamMapping,e.updateStreamsInCatalog),a=(0,f.useRef)(null),d=(0,f.useState)({}),p=d[0],v=d[1],h=c||{},m=h.auto_add_new_fields,b=h.bookmark_properties,x=h.bookmark_property_operators,j=h.destination_table,y=h.disable_column_type_check,P=h.key_properties,_=h.partition_keys,E=h.replication_method,I=h.run_in_parallel,T=h.unique_conflict_method,M=h.unique_constraints,D=(0,pe.M$)(c),B=(0,pe.WD)(c),A=(0,pe.Z5)(c),N=null===t||void 0===t||null===(n=t.metadata)||void 0===n?void 0:n.data_integration,L=(null===N||void 0===N?void 0:N.source)||(null===N||void 0===N?void 0:N.destination),F=(0,f.useCallback)((function(e){return s(e,(function(e){return null===i||void 0===i?void 0:i(e)}))}),[i,s]),U=(0,f.useCallback)((function(e,n){F([De(De({},c),{},(0,l.Z)({},e,n))])}),[c,F]),H=(0,f.useMemo)((function(){var e,n=[],t={},i=[],l=(0,pe.RP)(c)||{};return null===(e=Object.entries(l||{}))||void 0===e||e.forEach((function(e){var o,l=(0,r.Z)(e,2),u=l[0],c=l[1],s=c.metadata,a=c.type;n.push(u),(!s||null===s||void 0===s||!s.metadata||null!==s&&void 0!==s&&null!==(o=s.metadata)&&void 0!==o&&o.selected)&&i.push(u);var d=Array.isArray(a)?a:[a];if((null===d||void 0===d?void 0:d.length)>=1){var p=d[(null===d||void 0===d?void 0:d.length)-1];null!==t&&void 0!==t&&t[p]||(t[p]=[]),t[p].push(u)}})),(0,S.jsx)(Pe.Z,{columnFlex:[1,1],rows:[[(0,S.jsx)(C.ZP,{children:"Number of columns selected"},"columns"),(0,S.jsxs)(C.ZP,{monospace:!0,rightAligned:!0,children:[null===i||void 0===i?void 0:i.length," ",(0,S.jsx)(C.ZP,{inline:!0,monospace:!0,muted:!0,children:"/"})," ",null===n||void 0===n?void 0:n.length]},"columns-value")]].concat((0,o.Z)((0,Te.YC)(Object.entries(t),(function(e){return(0,r.Z)(e,1)[0]})).map((function(e){var n=(0,r.Z)(e,2),t=n[0],i=n[1];return[(0,S.jsxs)(C.ZP,{children:[(0,$.vg)(t)," columns"]},"columns-".concat(t)),(0,S.jsx)(C.ZP,{monospace:!0,rightAligned:!0,children:null===i||void 0===i?void 0:i.length},"columns-value-".concat(t))]}))),(0,o.Z)([["Bookmarks",b,"bookmark_properties"],["Unique constraints",M,"unique_constraints"],["Key properties",P,"key_properties"],["Partition keys",_,"partition_keys"]].map((function(e){var n,t=(0,r.Z)(e,3),i=t[0],o=t[1],l=t[2];return[(0,S.jsx)(C.ZP,{children:i},i),(0,S.jsxs)(Z.ZP,{alignItems:"center",flexWrap:"wrap",justifyContent:"flex-end",children:[!(null!==o&&void 0!==o&&o.length)&&(0,S.jsx)(C.ZP,{muted:!0,monospace:!0,children:"-"}),null===(n=(0,Te.YC)(o||[],(function(e){return e})))||void 0===n?void 0:n.map((function(e){return(0,S.jsx)("div",{style:{marginLeft:w.iI/2},children:(0,S.jsx)(Ze.Z,{label:e,onClick:function(){return U(l,(0,Te.Od)(o,(function(n){return n===e})))},xsmall:!0})},"".concat(i,"-value-").concat(e))}))]},"".concat(i,"-value"))]}))))})}),[b,P,_,c,M,U]),W=(0,f.useMemo)((function(){return B in p?null===p||void 0===p?void 0:p[B]:j}),[j,p,B]);return(0,S.jsxs)(O.Z,{p:w.cd,children:[(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsxs)(Ie,{children:[(0,S.jsx)(C.ZP,{default:!0,uppercase:!0,children:"Output"}),(0,S.jsx)(O.Z,{mt:w.cd,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(C.ZP,{large:!0,children:"Destination table"}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(Ce.Z,{label:(0,S.jsxs)(C.ZP,{children:["By default, this stream will be saved to your destination under the table named ",(0,S.jsx)(C.ZP,{bold:!0,inline:!0,monospace:!0,children:D}),". To change the table name, enter in a different value."]}),lightBackground:!0}),(0,S.jsx)(O.Z,{mr:w.cd})]}),(0,S.jsx)(k.Z,{flex:1,children:(0,S.jsx)(K.Z,{fullWidth:!0,monospace:!0,onChange:function(e){var n,t=null===e||void 0===e||null===(n=e.target)||void 0===n?void 0:n.value;v((function(e){return De(De({},e),{},(0,l.Z)({},B,t))})),clearTimeout(a.current),a.current=setTimeout((function(){return U("destination_table",t)}),300)},value:W||""})})]})})]})}),(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsxs)(Ie,{children:[(0,S.jsx)(C.ZP,{default:!0,uppercase:!0,children:"Settings"}),(0,S.jsx)(O.Z,{mt:w.cd,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(C.ZP,{large:!0,children:"Replication method"}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(Ce.Z,{label:(0,S.jsxs)(C.ZP,{children:["Do you want to synchronize the entire stream (",(0,S.jsx)(C.ZP,{bold:!0,inline:!0,monospace:!0,children:we._B.FULL_TABLE}),") on each pipeline run or only new records (",(0,S.jsx)(C.ZP,{bold:!0,inline:!0,monospace:!0,children:we._B.INCREMENTAL}),")?",we.th.POSTGRESQL===L&&(0,S.jsxs)(C.ZP,{children:["Log-based incremental replication (",(0,S.jsx)(C.ZP,{bold:!0,inline:!0,monospace:!0,children:we._B.LOG_BASED}),") is also available for PostgreSQL sources."]})]}),lightBackground:!0}),(0,S.jsx)(O.Z,{mr:w.cd}),(0,S.jsx)(G.Z,{defaultColor:!0,onChange:function(e){return U("replication_method",e.target.value)},placeholder:"Select an option",value:E,children:we.jL.map((function(e){return(0,S.jsx)("option",{value:e,children:(0,$.vg)(e)},e)}))})]})}),(0,S.jsx)(O.Z,{mt:w.cd,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(C.ZP,{large:!0,children:"Unique conflict method"}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(Ce.Z,{label:(0,S.jsxs)(C.ZP,{children:["If a new record has the same value as an existing record in the ",(0,$._6)("unique column",null===M||void 0===M?void 0:M.length),(null===M||void 0===M?void 0:M.length)>0&&(0,S.jsx)(S.Fragment,{children:"\xa0"}),null===M||void 0===M?void 0:M.sort().map((function(e,n){return(0,S.jsxs)(C.ZP,{bold:!0,inline:!0,monospace:!0,children:[1!==(null===M||void 0===M?void 0:M.length)&&n===(null===M||void 0===M?void 0:M.length)-1?(0,S.jsx)(C.ZP,{inline:!0,children:" and "},e):n>=1&&(0,S.jsx)(S.Fragment,{children:",\xa0"}),e]},e)})),", how do you want to resolve the conflict? The conflict method ",(0,S.jsx)(C.ZP,{bold:!0,inline:!0,monospace:!0,children:we.MU.IGNORE})," will skip the new record if it\u2019s a duplicate of an existing record. The conflict method ",(0,S.jsx)(C.ZP,{bold:!0,inline:!0,monospace:!0,children:we.MU.UPDATE})," will not save the new record and instead update the existing record with the new record\u2019s properties."]}),lightBackground:!0}),(0,S.jsx)(O.Z,{mr:w.cd}),(0,S.jsx)(G.Z,{defaultColor:!0,onChange:function(e){return U("unique_conflict_method",e.target.value)},placeholder:"Select an option",value:T,children:Object.values(we.MU).map((function(e){return(0,S.jsx)("option",{value:e,children:(0,$.vg)(e)},e)}))})]})})]})}),(null===N||void 0===N?void 0:N.sql)&&we._B.INCREMENTAL===E&&(null===b||void 0===b?void 0:b.length)>=1&&(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsxs)(Ie,{children:[(0,S.jsx)(C.ZP,{default:!0,uppercase:!0,children:"Bookmark property operators"}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsxs)(C.ZP,{muted:!0,small:!0,children:["By default, new records are compared to the bookmark property value using the operator greater than or equals (",(0,S.jsx)(C.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:">="}),").",(0,S.jsx)("br",{}),"If the bookmark property is also a unique constraint, then the default operator is greater than (",(0,S.jsx)(C.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:">"}),").",(0,S.jsx)("br",{}),"Change the operator that is used when determining which records to sync based on the bookmark value from the most recently completed sync."]})}),null===b||void 0===b?void 0:b.map((function(e){var n;return n=null!==x&&void 0!==x&&x[e]?null===x||void 0===x?void 0:x[e]:M&&null!==M&&void 0!==M&&M.includes(e)?_e.W6.GREATER_THAN:_e.W6.GREATER_THAN_OR_EQUALS,(0,S.jsx)(O.Z,{mt:w.cd,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsxs)(C.ZP,{default:!0,monospace:!0,children:[(0,S.jsxs)(C.ZP,{inline:!0,monospace:!0,muted:!0,children:["{new_record}","."]}),e]}),(0,S.jsx)(O.Z,{mr:w.cd}),(0,S.jsx)(G.Z,{compact:!0,defaultColor:!0,monospace:!0,onChange:function(n){return U("bookmark_property_operators",De(De({},x),{},(0,l.Z)({},e,n.target.value)))},value:n,children:[_e.W6.EQUALS,_e.W6.GREATER_THAN,_e.W6.GREATER_THAN_OR_EQUALS,_e.W6.LESS_THAN,_e.W6.LESS_THAN_OR_EQUALS,_e.W6.NOT_EQUALS].map((function(e){return(0,S.jsx)("option",{value:e,children:_e.N_[e]},e)}))}),(0,S.jsx)(O.Z,{mr:w.cd}),(0,S.jsxs)(C.ZP,{default:!0,monospace:!0,children:[(0,S.jsxs)(C.ZP,{inline:!0,monospace:!0,muted:!0,children:["{bookmark}","."]}),e]})]})},e)}))]})}),(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsxs)(Ie,{children:[(0,S.jsx)(C.ZP,{default:!0,uppercase:!0,children:"Options"}),(0,S.jsx)(O.Z,{mt:w.cd,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(k.Z,{flexDirection:"column",children:[(0,S.jsx)(C.ZP,{bold:!0,large:!0,children:"Run streams in parallel"}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsx)(C.ZP,{default:!0,children:"Parallel streams will be run at the same time, so make sure there are no dependencies between them."})})]}),(0,S.jsx)(O.Z,{mr:w.cd}),(0,S.jsx)(Oe.Z,{checked:!!I,onCheck:function(e){return U("run_in_parallel",e(I))}})]})}),g.tf.DATA_EXPORTER===(null===t||void 0===t?void 0:t.type)&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Z,{mt:w.cd,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(k.Z,{flexDirection:"column",children:[(0,S.jsx)(C.ZP,{bold:!0,large:!0,children:"Automatically add new fields"}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsx)(C.ZP,{default:!0,children:"Turn the toggle on if you want new table columns in each data source stream to be automatically added and synced with the data destination."})})]}),(0,S.jsx)(O.Z,{mr:w.cd}),(0,S.jsx)(Oe.Z,{checked:!!m,onCheck:function(e){return U("auto_add_new_fields",e(m))}})]})}),(0,S.jsx)(O.Z,{mt:w.cd,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(k.Z,{flexDirection:"column",children:[(0,S.jsx)(C.ZP,{bold:!0,large:!0,children:"Disable column type check"}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsx)(C.ZP,{default:!0,children:"By default, the value for each column is validated according to the schema property for that column. If a value in a column doesn\u2019t match its type, an error will be raised and the process will be stopped. Turn this toggle on if you want to disable this strict type checking."})})]}),(0,S.jsx)(O.Z,{mr:w.cd}),(0,S.jsx)(Oe.Z,{checked:!!y,onCheck:function(e){return U("disable_column_type_check",e(y))}})]})})]})]})}),(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsxs)(Ie,{noPadding:!0,children:[(0,S.jsx)(O.Z,{pt:w.cd,px:w.cd,children:(0,S.jsx)(C.ZP,{default:!0,uppercase:!0,children:"Summary"})}),(0,S.jsx)(O.Z,{mt:w.cd,pb:w.cd,children:H})]})}),(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsxs)(Ie,{children:[(0,S.jsx)(C.ZP,{default:!0,uppercase:!0,children:"Other"}),(0,S.jsx)(O.Z,{mt:w.cd,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(C.ZP,{large:!0,children:"Select stream"}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(Oe.Z,{checked:!!A,onCheck:function(e){return F([(0,pe.XE)(c,{selected:e(A)})])}})]})}),(0,S.jsx)(O.Z,{mt:w.HN,children:(0,S.jsx)(Z.ZP,{alignItems:"center",children:(0,S.jsx)(R.ZP,{danger:!0,onClick:function(){window.confirm("Are you sure you want to remove stream ".concat(D," from block ").concat(null===t||void 0===t?void 0:t.uuid,"?"))&&u((function(e){var n,t=De(De({},e),{},{catalog:De(De({},null===e||void 0===e?void 0:e.catalog),{},{streams:(0,Te.Od)(null===e||void 0===e||null===(n=e.catalog)||void 0===n?void 0:n.streams,(function(e){return(0,pe.WD)(e)===B}))})});return null===i||void 0===i||i(t),t}))},children:"Delete stream from block"})})})]})})]})},Be=t(11074),Ae=t(69632),Ne=t(95924);function Le(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Fe(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Le(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Le(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Ue=function(e){var n,t,i=e.block,o=(e.blocksMapping,e.highlightedColumnsMapping),u=e.onChangeBlock,c=e.setBlockAttributes,s=e.setHighlightedColumnsMapping,a=e.setSelectedSubTab,d=e.setStreamsMappingConflicts,p=e.showStreamConflicts,v=e.stream,h=e.streamMapping,m=e.streamsMappingConflicts,b=(0,f.useCallback)((function(e){c((function(n){var t=e(n);return null===u||void 0===u||u(t),t}))}),[u,c]),g=(0,f.useMemo)((function(){return(0,pe.RP)(v)||{}}),[v]),P=(0,f.useState)(null),_=P[0],E=P[1],I=(0,f.useState)(null),T=I[0],M=I[1],D=(0,f.useRef)(null),B=(0,f.useState)(null),A=B[0],N=B[1],L=(0,f.useCallback)((function(){N(null),E(null)}),[N,E]);(0,f.useEffect)((function(){var e;return null===(e=document)||void 0===e||e.addEventListener("click",L),function(){var e;null===(e=document)||void 0===e||e.removeEventListener("click",L)}}),[L]);var F=(0,f.useMemo)((function(){var e=v.bookmark_properties,n=v.key_properties,t=v.partition_keys,i=(v.replication_method,v.unique_constraints);return{bookmarkPropertiesMapping:(0,Te.HK)(e||[],(function(e){return e})),keyPropertiesMapping:(0,Te.HK)(n||[],(function(e){return e})),partitionKeysMapping:(0,Te.HK)(t||[],(function(e){return e})),uniqueConstraintsMapping:(0,Te.HK)(i||[],(function(e){return e}))}}),[v]),U=F.bookmarkPropertiesMapping,H=F.keyPropertiesMapping,W=F.partitionKeysMapping,G=F.uniqueConstraintsMapping,z=(0,f.useMemo)((function(){var e,n;return null===(e=(0,Te.YC)(Object.entries(g||{}),(function(e){return(0,r.Z)(e,1)[0]})))||void 0===e||null===(n=e.map)||void 0===n?void 0:n.call(e,(function(e){var n=(0,r.Z)(e,2);return{column:n[0],property:n[1]}}))}),[g]),K=((0,f.useMemo)((function(){return(0,pe.MB)(v)}),[v]),(0,f.useMemo)((function(){return(0,pe.Nf)(v)}),[v])),V=null===i||void 0===i||null===(n=i.metadata)||void 0===n||null===(t=n.data_integration)||void 0===t?void 0:t.destination,Y=(0,f.useMemo)((function(){return!we.kB.includes(V)}),[V]),X=(0,f.useMemo)((function(){var e=[null,1,1],n=null===z||void 0===z?void 0:z.every((function(e){var n,t,i,o=e.property;return!(null!==o&&void 0!==o&&o.metadata)||!(null!==o&&void 0!==o&&null!==(n=o.metadata)&&void 0!==n&&n.metadata)||(null===o||void 0===o||null===(t=o.metadata)||void 0===t||null===(i=t.metadata)||void 0===i?void 0:i.selected)})),t=[{label:function(){return(0,S.jsx)(Oe.Z,{checked:n,compact:!0,onCheck:function(e){return function(e){var n=null===z||void 0===z?void 0:z.reduce((function(n,t){var i=t.column,o=(null===K||void 0===K?void 0:K[i])||(0,pe.jC)(i);return n[i]=Fe(Fe({},o),{},{metadata:Fe(Fe({},null===o||void 0===o?void 0:o.metadata),e)}),n}),{});b((function(e){return(0,pe.$C)((0,pe.AP)(v,n),e)}))}({selected:e(n)})}})},uuid:"action"},{uuid:"Property"},{uuid:"Types"}];Y&&(e.push.apply(e,[null,null]),t.push.apply(t,[{center:!0,uuid:"Unique"},{center:!0,uuid:"Key"}]));var i=v.replication_method;return we._B.INCREMENTAL===i&&(e.push(null),t.push({center:!0,uuid:"Bookmark"})),e.push(null),t.push({center:!0,uuid:"Partition"}),{columnFlex:e,columns:t}}),[z,b,v,K,Y]),Q=X.columnFlex,J=X.columns,$=(0,f.useCallback)((function(e,n,t){var i,o=t||{},r=o.disableEdit,u=o.key,c=(0,pe.wx)(e,n),s=(null===c||void 0===c?void 0:c.typesDerived)||[];return(0,S.jsxs)(Z.ZP,{alignItems:"center",flexWrap:"wrap",children:[null===(i=s||[])||void 0===i?void 0:i.map((function(n){return(0,S.jsx)("div",{style:{paddingBottom:1,marginRight:2,paddingTop:1},children:(0,S.jsx)(Ze.Z,{label:n,onClick:r?null:function(t){(0,Ne.j)(t);var i=!(null===s||void 0===s||!s.includes(n))?(0,pe.VZ)([n],c):(0,pe.qx)([n],c),o={anyOf:null===i||void 0===i?void 0:i.anyOf,format:null===i||void 0===i?void 0:i.format,type:null===i||void 0===i?void 0:i.type};b((function(n){return(0,pe.$C)((0,pe.KN)(v,(0,l.Z)({},e,o)),n)}))},xsmall:!0})},"".concat(e,"-").concat(u||"types","-").concat(n))})),!r&&(0,S.jsx)(R.ZP,{iconOnly:!0,noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(e){(0,Ne.j)(e),N({x:e.pageX,y:e.pageY}),E(c)},children:(0,S.jsx)(q.I8,{default:!0})})]},"".concat(e,"-").concat(u||"types"))}),[b,N,E,v]),ee=(0,f.useMemo)((function(){return null===z||void 0===z?void 0:z.map((function(e){var n,t=e.column,i=e.property,o=v.bookmark_properties,u=v.key_properties,c=v.partition_keys,s=v.replication_method,a=v.unique_constraints,d=(i.anyOf,i.format,i.metadata),p=(i.type,(0,pe.wx)(t,i)),f=(null===p||void 0===p||p.typesDerived,!d||!(null!==d&&void 0!==d&&d.metadata)||(null===d||void 0===d||null===(n=d.metadata)||void 0===n?void 0:n.selected)),h=null===G||void 0===G?void 0:G[t],m=null===U||void 0===U?void 0:U[t],g=null===H||void 0===H?void 0:H[t],j=null===W||void 0===W?void 0:W[t],y=[(0,S.jsx)("div",{style:{minHeight:22},children:(0,S.jsx)(Oe.Z,{checked:f,compact:!0,onCheck:function(e){b((function(n){return(0,pe.$C)((0,pe.AP)(v,(0,l.Z)({},t,Fe(Fe({},d),{},{metadata:Fe(Fe({},null===d||void 0===d?void 0:d.metadata),{},{selected:e(f)})}))),n)}))}})},"".concat(t,"-selected")),(0,S.jsx)(C.ZP,{monospace:!0,children:t},"".concat(t,"-column")),$(t,p)];Y&&y.push((0,S.jsx)(Z.ZP,{alignItems:"center",justifyContent:"center",children:(0,S.jsx)(x.Z,{checked:h,onClick:function(e){(0,Ne.j)(e),b((function(e){return(0,pe.$C)(Fe(Fe({},v),{},{unique_constraints:h?(0,Te.Od)(a||[],(function(e){return e===t})):(0,Te.Hl)(t,a||[])}),e)}))}})},"".concat(t,"-unique")));var k=[];return Y&&k.push([g,"key_properties",u]),we._B.INCREMENTAL===s&&k.push([m,"bookmark_properties",o]),k.push([j,"partition_keys",c]),k.forEach((function(e){var n=(0,r.Z)(e,3),i=n[0],o=n[1],u=n[2];y.push((0,S.jsx)(Z.ZP,{alignItems:"center",justifyContent:"center",children:(0,S.jsx)(x.Z,{checked:i,onClick:function(e){(0,Ne.j)(e),b((function(e){return(0,pe.$C)(Fe(Fe({},v),{},(0,l.Z)({},o,i?(0,Te.Od)(u||[],(function(e){return e===t})):(0,Te.Hl)(t,u||[]))),e)}))}})},"".concat(t,"-").concat(o)))})),y}))}),[U,H,W,$,z,b,v,Y,G]),ne=(0,f.useCallback)((function(e){var n=null===z||void 0===z?void 0:z[e];return Fe(Fe({},n),{},{highlighted:!(null===o||void 0===o||!o[null===n||void 0===n?void 0:n.column])})}),[o,z]),te=(0,f.useMemo)((function(){var e;if(A&&_){var n=21*w.iI,t=(null===D||void 0===D||null===(e=D.current)||void 0===e?void 0:e.getBoundingClientRect())||{},i=t.x,o=t.width,r=A||{},u=r.x,c=void 0===u?0:u,s=r.y,a=void 0===s?0:s,d=c;c+n>=i+o&&(d=i+o-(n+w.iI)),d<0&&(d=0);var p=(null===g||void 0===g?void 0:g[null===_||void 0===_?void 0:_.uuid])||{},f=(0,pe.wx)(null===_||void 0===_?void 0:_.uuid,p||{}),h=f||{},m=h.typesDerived,y=void 0===m?[]:m,k=h.uuid;return(0,S.jsx)("div",{onClick:Ne.j,style:{left:d,position:"fixed",top:a+w.iI/2,width:n,zIndex:100},children:(0,S.jsxs)(Be.Z,{children:[(0,S.jsx)("div",{style:{position:"relative"},children:(0,S.jsx)(R.ZP,{iconOnly:!0,noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(e){(0,Ne.j)(e),N(null),E(null)},style:{position:"absolute",right:-.5*w.iI,top:-.5*w.iI,zIndex:1},children:(0,S.jsx)(j.Z,{default:!0,size:2.5*w.iI,children:(0,S.jsx)(q.x8,{size:1.5*w.iI})})})}),(0,S.jsx)(O.Z,{p:w.cd,children:we.D5.map((function(e,n){var t=!(null===y||void 0===y||!y.includes(e));return(0,S.jsx)("div",{style:{marginTop:0===n?0:4},children:(0,S.jsx)(Z.ZP,{alignItems:"center",children:(0,S.jsx)(x.Z,{checked:t,label:e,onClick:function(n){(0,Ne.j)(n);var i=t?(0,pe.VZ)([e],f):(0,pe.qx)([e],f),o={anyOf:null===i||void 0===i?void 0:i.anyOf,format:null===i||void 0===i?void 0:i.format,type:null===i||void 0===i?void 0:i.type};b((function(e){return(0,pe.$C)((0,pe.KN)(v,(0,l.Z)({},k,o)),e)}))}})})},e)}))})]})})}}),[A,_,D,g,b,N,E,v]),ie=(0,f.useMemo)((function(){return(0,pe.p$)(v,m,h)}),[v,h,m]),oe=(0,f.useCallback)((function(e,n){var t,i=null===ie||void 0===ie?void 0:ie.stream,o=null===i||void 0===i||null===(t=i.schema)||void 0===t?void 0:t.properties;M((function(t){var i=Fe({},t);return null===e||void 0===e||e.forEach((function(e){n?i[e]=null===o||void 0===o?void 0:o[e]:e in i&&(null===i||void 0===i||delete i[e])})),i}))}),[ie,M]),re=(0,f.useCallback)((function(e){var n=e||{},t=n.column,i=n.property,o=n.currentProperty,r=!(null===T||void 0===T||!T[t]),l=[(0,S.jsx)(x.Z,{checked:r,onClick:function(e){(0,Ne.j)(e),oe([t],!r)}},"".concat(t,"-accept")),(0,S.jsx)(C.ZP,{monospace:!0,children:t},"".concat(t,"-property")),$(t,i,{disableEdit:!0})];return o?l.push($(t,o,{disableEdit:!0,key:"types-current"})):l.push((0,S.jsx)("div",{},"".concat(t,"-empty"))),l}),[$,T,oe]),le=(0,f.useCallback)((function(e,n){var t=n||{},i=t.columnFlex,o=t.columns,r=(null===e||void 0===e?void 0:e.map((function(e){return e.column})))||[],l=null===r||void 0===r?void 0:r.every((function(e){return!(null===T||void 0===T||!T[e])}));return(0,S.jsx)(Pe.Z,{columnFlex:[null,1].concat(i||[]),columns:[{label:function(){return(0,S.jsx)(x.Z,{checked:l,onClick:function(e){(0,Ne.j)(e),oe(r,!l)}})},uuid:"Accept change"},{uuid:"Property"}].concat(o||[]),highlightRowOnHover:!0,onClickRow:function(n){var t=null===e||void 0===e?void 0:e[n],i=null===t||void 0===t?void 0:t.column,o=!(null===T||void 0===T||!T[i]);oe([i],!o)},rows:null===e||void 0===e?void 0:e.map(re)})}),[re,T,oe]),ue=(0,f.useMemo)((function(){var e,n;if(!ie)return null;var t=ie.newColumnSettings,i=ie.newColumns,o=ie.stream,l=null===o||void 0===o||null===(e=o.schema)||void 0===e?void 0:e.properties,u=null===(n=(0,Te.YC)(i,(function(e){return e})))||void 0===n?void 0:n.map((function(e){return{column:e,property:null===l||void 0===l?void 0:l[e]}})),c=(0,Te.YC)(Object.entries(t),(function(e){return(0,r.Z)(e,1)[0]})).map((function(e){var n=(0,r.Z)(e,2),t=n[0];n[1];return{column:t,property:null===l||void 0===l?void 0:l[t],currentProperty:null===g||void 0===g?void 0:g[t]}}));return(0,S.jsxs)(S.Fragment,{children:[(null===u||void 0===u?void 0:u.length)>=1&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Z,{p:w.cd,children:(0,S.jsx)(ce.Z,{level:5,warning:!0,children:"New properties"})}),(0,S.jsx)(y.Z,{light:!0}),le(u,{columnFlex:[1,1],columns:[{uuid:"Types (new)"},{label:function(){return""},uuid:"empty"}]})]}),(null===c||void 0===c?void 0:c.length)>=1&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Z,{p:w.cd,children:(0,S.jsx)(ce.Z,{level:5,warning:!0,children:"Properties with new types"})}),(0,S.jsx)(y.Z,{light:!0}),le(c,{columnFlex:[1,1],columns:[{uuid:"Types (new)"},{uuid:"Types (current)"}]})]})]})}),[ie,le,g]),se=(0,f.useMemo)((function(){return(0,S.jsx)(Pe.Z,{columnFlex:Q,columns:J,highlightRowOnHover:!0,isSelectedRow:function(e){var n;return null===(n=ne(e))||void 0===n?void 0:n.highlighted},menu:te,onClickRow:function(e){var n=ne(e),t=n.column,i=n.highlighted;s((function(e){return i?(0,ye.gR)(e,[t]):Fe(Fe({},e),{},(0,l.Z)({},t,!0))}))},ref:D,rows:ee,stickyHeader:!0})}),[Q,J,ne,D,te,ee,s]);return(0,S.jsxs)(S.Fragment,{children:[p&&ue&&(0,S.jsxs)(O.Z,{my:w.cd,children:[(0,S.jsx)(O.Z,{px:w.cd,children:(0,S.jsx)(Ae.NJ,{children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(k.Z,{children:(0,S.jsx)(q.uy,{size:2*w.iI,warning:!0})}),(0,S.jsx)(O.Z,{mr:w.cd}),(0,S.jsxs)(C.ZP,{muted:!0,children:["The following properties are either new or have different types. Please review and either merge the changes or discard them.",(0,S.jsx)("br",{}),"Click the checkbox to include the updated property when merging changes."]})]})})}),ue,(0,S.jsx)(O.Z,{p:w.cd,children:(0,S.jsxs)(Z.ZP,{children:[(0,S.jsx)(R.ZP,{beforeIcon:(0,S.jsx)(q.Pt,{}),onClick:function(){b((function(e){var n;return(0,pe.$C)(Fe(Fe({},v),{},{schema:Fe(Fe({},null===v||void 0===v?void 0:v.schema),{},{properties:Fe(Fe({},null===v||void 0===v||null===(n=v.schema)||void 0===n?void 0:n.properties),T)})}),e)})),d({noParents:{},parents:{}}),a(de.tw.SETTINGS)},primary:!0,children:"Merge changes"}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(R.ZP,{onClick:function(){d({noParents:{},parents:{}}),a(de.tw.SETTINGS)},secondary:!0,children:"Discard changes"})]})})]}),!p&&se,(0,S.jsx)(O.Z,{pb:w.HN})]})},He=["block","height","pipeline","selectedSubTab","showError","stream"];function We(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Ge(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?We(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):We(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ze=function(e){var n=e.block,t=e.height,i=e.pipeline,o=e.selectedSubTab,r=e.showError,l=e.stream,u=(0,ge.Z)(e,He);return de.tw.OVERVIEW!==o&&o?de.tw.SETTINGS===o||de.tw.STREAM_CONFLICTS===o?(0,S.jsx)(Ue,Ge(Ge({},u),{},{block:n,showStreamConflicts:de.tw.STREAM_CONFLICTS===o,stream:l})):de.tw.SAMPLE_DATA===o?(0,S.jsx)(ke,{block:n,height:t,pipeline:i,showError:r,stream:l}):(0,S.jsx)(S.Fragment,{}):(0,S.jsx)(Re,Ge(Ge({},u),{},{block:n,stream:l}))},Ke=t(33065),Ve={label:function(e){return"".concat((0,$._6)("stream",e,!0)," fetched")},uuid:"Recently fetched"},qe={label:function(e){return"".concat((0,$._6)("stream",e,!0)," from settings")},uuid:"From stream settings"},Ye=[Ve,qe];function Xe(e,n){return null===n||void 0===n?void 0:n.filter((function(n){var t=new RegExp(e||"","i"),i=(0,pe.M$)(n);return!e||(null===i||void 0===i?void 0:i.match(t))||(null===i||void 0===i?void 0:i.replace("-"," ").match(t))||(null===i||void 0===i?void 0:i.replace("-","").match(t))||(null===i||void 0===i?void 0:i.replace("_"," ").match(t))||(null===i||void 0===i?void 0:i.replace("_","").match(t))||(null===i||void 0===i?void 0:i.replaceAll("-"," ").match(t))||(null===i||void 0===i?void 0:i.replaceAll("-","").match(t))||(null===i||void 0===i?void 0:i.replaceAll("_"," ").match(t))||(null===i||void 0===i?void 0:i.replaceAll("_","").match(t))}))}var Qe=function(e){var n=e.block,t=e.blocksMapping,i=e.height,o=e.onChangeBlock,u=e.searchText,c=e.setSelectedMainNavigationTab,s=(e.setSelectedSubTab,e.setStreamsMappingConflicts),a=e.streamsFetched,d=e.updateStreamsInCatalog,p=e.width,v=(0,f.useMemo)((function(){return(0,pe.Uc)(n,{getAll:!0})}),[n]),h=(0,f.useMemo)((function(){return(0,pe.UA)(v)}),[v]),m=(0,f.useMemo)((function(){return(0,pe.UA)(a||[])}),[a]),b=(0,f.useCallback)((function(e){return(0,pe.ig)(e,m,h)}),[m,h]),g=(0,f.useCallback)((function(e){return(0,pe.p$)(e,m,h)}),[m,h]),x=(0,f.useCallback)((function(e){var n;return(n={},(0,l.Z)(n,Ve.uuid,m),(0,l.Z)(n,qe.uuid,h),n)[e]}),[h,m]),j=(0,f.useMemo)((function(){var e=[];return Ye.forEach((function(n,i){var o,l=n.label,c=n.uuid,s=x(c),a=[],d=Object.values((null===s||void 0===s?void 0:s.noParents)||{})||[],p=Xe(u,d);(null===p||void 0===p?void 0:p.length)>=1&&a.push({streams:(0,Te.YC)(p||[],pe.M$)}),null===(o=Object.entries((null===s||void 0===s?void 0:s.parents)||{}))||void 0===o||o.forEach((function(e){var n=(0,r.Z)(e,2),i=n[0],o=n[1],l=Xe(u,Object.values(o||{})||[]);(null===l||void 0===l?void 0:l.length)>=1&&a.push({block:null===t||void 0===t?void 0:t[i],streams:(0,Te.YC)(l||[],pe.M$)})})),(null===a||void 0===a?void 0:a.length)>=1&&e.push({count:(0,Te.Sm)((null===a||void 0===a?void 0:a.map((function(e){var n=e.streams;return(null===n||void 0===n?void 0:n.length)||0})))||[]),label:l,subgroups:a,uuid:c})})),e}),[x,u]),P=(0,f.useMemo)((function(){return(null===j||void 0===j?void 0:j.length)||0}),[j]);return(0,S.jsx)(S.Fragment,{children:null===j||void 0===j?void 0:j.map((function(e,n){var t=e.count,r=e.label,l=e.subgroups,u=e.uuid,a=Ve.uuid===u;return(0,S.jsx)(Ke.cL,{style:{height:i,right:qe.uuid===u?null:0,width:p/P},children:(0,S.jsx)(Ke.N0,{borderRight:P>=2&&!a,style:{height:i,width:p/P},children:(0,S.jsxs)(O.Z,{pt:w.cd,children:[(0,S.jsx)(O.Z,{px:w.Mq,children:(0,S.jsx)(ce.Z,{level:4,children:r(t)})}),null===l||void 0===l?void 0:l.map((function(e,n){var t,i=e.block,r=e.streams;return(0,S.jsxs)(O.Z,{mt:i&&0===n?w.cd:1,children:[(0,S.jsx)(O.Z,{mb:i?w.cd:0,mt:i?0:w.cd,children:(0,S.jsx)(y.Z,{light:!0})}),i&&(0,S.jsx)(O.Z,{px:w.cd,children:(0,S.jsx)(C.ZP,{bold:!0,color:null===(t=(0,_.qn)(null===i||void 0===i?void 0:i.type,{blockColor:null===i||void 0===i?void 0:i.color}))||void 0===t?void 0:t.accent,default:!0,large:!0,monospace:!0,children:null===i||void 0===i?void 0:i.uuid})}),(0,S.jsx)(O.Z,{p:1,children:(0,S.jsx)(Z.ZP,{alignItems:"center",flexWrap:"wrap",children:null===r||void 0===r?void 0:r.map((function(e){var n=b(e),t=!!g(e),i=(0,pe.M$)(e),r=(0,pe.Qu)(e),l=!1;if(a){var u=(0,pe.zB)(e,x(qe.uuid));u&&(l=(0,pe.Z5)(u))}else l=(0,pe.Z5)(e);var p=n&&t;return(0,S.jsx)(Ke.HE,{onClick:a&&p?function(){return!1}:function(n){n.preventDefault(),d([(0,pe.XE)(e,{selected:!l})],(function(e){return null===o||void 0===o?void 0:o(e)}))},selected:l,warning:p&&a,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",fullHeight:!0,justifyContent:"space-between",children:[(0,S.jsx)(k.Z,{flex:1,children:(0,S.jsx)(C.ZP,{monospace:!0,muted:!l,children:i})}),p&&a&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(C.ZP,{monospace:!0,warning:!0,children:"exists"})]}),p&&a&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(k.Z,{alignItems:"center",style:{minHeight:3*w.iI},children:(0,S.jsx)(R.ZP,{compact:!0,onClick:function(){s((function(n){return(0,pe.UA)([e],n)})),c((function(e){return{selectedMainNavigationTab:i,selectedMainNavigationTabSub:r,selectedSubTab:de.tw.STREAM_CONFLICTS}}))},small:!0,warning:!0,children:"View differences"})})]}),(!p||!a)&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Z,{mr:w.HN}),l&&(0,S.jsx)(q.Zr,{size:2*w.iI}),(0,S.jsx)(O.Z,{mr:l?1:3}),(0,S.jsx)(k.Z,{alignItems:"center",style:{height:3*w.iI},children:(0,S.jsx)(Oe.Z,{checked:l,compact:!0,onCheck:function(n){return d([(0,pe.XE)(e,{selected:n(l)})],(function(e){return null===o||void 0===o?void 0:o(e)}))}})})]})]})},i)}))})})]},i?null===i||void 0===i?void 0:i.uuid:"no-subtitle-".concat(n))}))]})})},u)}))})};function Je(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function $e(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Je(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Je(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var en=function(e){var n=e.attributes,t=e.attributesMapping,i=e.columnFlex,o=e.rightAlignColumnForRowIndexes,r=e.rowGroupHeaders,u=e.rowsGroupedByIndex,c=e.setAttributesMapping,s=(0,f.useCallback)((function(e,n){var i,r=e.inputType,u=e.label,s=e.options,a=e.uuid,d=null===t||void 0===t?void 0:t[a],p=!(null===d||void 0===d||!d.selected),f=null===d||void 0===d?void 0:d.value;return de.oI.CHECKBOX===r?i=(0,S.jsx)(x.Z,{checked:!!f,onClick:function(e){p&&(0,Ne.j)(e),c((function(e){return $e($e({},e),{},(0,l.Z)({},a,$e($e({},null===e||void 0===e?void 0:e[a]),{},{value:!f})))}))}}):de.oI.SELECT===r?i=(0,S.jsxs)(G.Z,{compact:!0,fullWidth:!0,onChange:function(e){(0,Ne.j)(e),c((function(n){var t;return $e($e({},n),{},(0,l.Z)({},a,$e($e({},null===n||void 0===n?void 0:n[a]),{},{value:null===e||void 0===e||null===(t=e.target)||void 0===t?void 0:t.value})))}))},onClick:function(e){p&&(0,Ne.j)(e)},value:f,children:[(0,S.jsx)("option",{value:""}),null===s||void 0===s?void 0:s.map((function(e){var n=e.disabled,t=e.label,i=e.value;return(0,S.jsx)("option",{disabled:n,value:i,children:t?t():i},i)}))]}):de.oI.TOGGLE===r&&(i=(0,S.jsx)(Oe.Z,{checked:f,compact:!0,onCheck:function(e){c((function(n){return $e($e({},n),{},(0,l.Z)({},a,$e($e({},null===n||void 0===n?void 0:n[a]),{},{value:e(f)})))}))},pauseEvent:p})),[(0,S.jsx)(x.Z,{checked:p,onClick:function(e){(0,Ne.j)(e),c((function(e){return $e($e({},e),{},(0,l.Z)({},a,$e($e({},null===e||void 0===e?void 0:e[a]),{},{selected:!p})))}))}},"".concat(a,"-checkbox")),(0,S.jsx)(C.ZP,{muted:!p,children:u()},"".concat(a,"-name")),(0,S.jsx)(Z.ZP,{alignItems:"center",justifyContent:null!==o&&void 0!==o&&o.includes(n)?"flex-end":"center",children:i},"".concat(a,"-value"))]}),[t,o,c]);return(0,f.useMemo)((function(){return(0,S.jsx)(Pe.Z,{columnFlex:i||[null,1,null],columns:[{uuid:"Use"},{uuid:"Attribute"},{uuid:"Value"}],groupsInline:!0,onClickRow:function(e){var i=null===n||void 0===n?void 0:n[e],o=null===i||void 0===i?void 0:i.uuid,r=null===t||void 0===t?void 0:t[o],u=!(null===r||void 0===r||!r.selected);c((function(e){return $e($e({},e),{},(0,l.Z)({},o,$e($e({},null===e||void 0===e?void 0:e[o]),{},{selected:!u})))}))},rowGroupHeaders:r,rowsGroupedByIndex:u,rows:n.map((function(e,n){return s(e,n)}))})}),[n,t,i,s])};var nn=function(e){var n=e.selectedStreamMapping,t=e.setSelectedStreamMapping,i=e.streamMapping,o=(0,f.useMemo)((function(){return(0,pe.th)(i)}),[i]),r=(0,f.useMemo)((function(){var e=[],t=[],i=[],r=[],l=0;return null===o||void 0===o||o.forEach((function(o){var u=o.groupHeader,c=o.streams;e.push(u);var s=[];null===c||void 0===c||c.forEach((function(e){r.push(e),s.push(l),l+=1;var i=(0,pe.WD)(e),o=(0,pe.M$)(e),u=!!(0,pe.zB)(e,n),c=[(0,S.jsx)(x.Z,{checked:u},"".concat(i,"-").concat(o,"-use")),(0,S.jsx)(C.ZP,{muted:!u,children:o},"".concat(i,"-").concat(o,"-stream"))];t.push(c)})),i.push(s)})),{rowGroupHeaders:e,rows:t,rowsGroupedByIndex:i,streamsArray:r}}),[n,o]),l=r.rowGroupHeaders,u=r.rows,c=r.rowsGroupedByIndex,s=r.streamsArray,a=(0,f.useMemo)((function(){var e,t;return(null===(e=Object.values((null===n||void 0===n?void 0:n.noParents)||{}))||void 0===e?void 0:e.length)+(0,Te.Sm)(null===(t=Object.values((null===n||void 0===n?void 0:n.parents)||{}))||void 0===t?void 0:t.map((function(e){var n;return null===(n=Object.values(e||{}))||void 0===n?void 0:n.length})))}),[n]);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Z,{p:w.cd,children:(0,S.jsxs)("div",{children:[(0,S.jsxs)(ce.Z,{children:[(0,$._6)("stream",a||0)," chosen"]}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsx)(C.ZP,{default:!0,children:"Clicking the Apply button below will use the values from the selected properties below and change the values of those properties in all the selected columns for all the selected streams."})})]})}),(0,S.jsx)(Pe.Z,{columnFlex:[null,1],columns:[{uuid:"Use"},{uuid:"Stream"}],groupsInline:!0,onClickRow:function(e){var i=null===s||void 0===s?void 0:s[e],o=!!(0,pe.zB)(i,n);t((function(e){return(0,pe.iN)(i,e,{remove:o})}))},rowGroupHeaders:l,rows:u,rowsGroupedByIndex:c,stickyHeader:!0})]})};var tn=function(e){var n=e.attributesMapping,t=e.selectedStreamMapping,i=e.setAttributesMapping,o=e.setSelectedStreamMapping,r=e.streamMapping,l=(0,f.useMemo)((function(){return(0,S.jsx)(en,{attributes:[{label:function(){return"Replication method"},inputType:de.oI.SELECT,options:we.jL.map((function(e){return{label:function(){return(0,$.vg)(e)},value:e}})),uuid:pe.I1.REPLICATION_METHOD},{label:function(){return"Unique conflict method"},inputType:de.oI.SELECT,options:Object.values(we.MU).map((function(e){return{label:function(){return(0,$.vg)(e)},value:e}})),uuid:pe.I1.UNIQUE_CONFLICT_METHOD},{label:function(){return"Run stream in parallel"},inputType:de.oI.TOGGLE,uuid:pe.I1.RUN_IN_PARALLEL},{label:function(){return"Automatically add new columns"},inputType:de.oI.TOGGLE,uuid:pe.I1.AUTO_ADD_NEW_FIELDS},{label:function(){return"Disable strict column type checks"},inputType:de.oI.TOGGLE,uuid:pe.I1.DISABLE_COLUMN_TYPE_CHECK}],attributesMapping:n,columnFlex:[null,1,1],rightAlignColumnForRowIndexes:[2,3,4],setAttributesMapping:i})}),[n,i]),u=(0,f.useMemo)((function(){return(0,S.jsx)(nn,{selectedStreamMapping:t,setSelectedStreamMapping:o,streamMapping:r})}),[t,o,r]);return(0,S.jsxs)(Ke.YI,{children:[(0,S.jsx)(O.Z,{p:w.cd,children:(0,S.jsxs)("div",{children:[(0,S.jsx)(ce.Z,{children:"Make changes to multiple streams"}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsx)(C.ZP,{default:!0,children:"Clicking the Apply button below will use the values from the attributes below and change the values of those attributes for all the selected streams."})})]})}),l,u]})};function on(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function rn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?on(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):on(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ln=function(e){var n,t,i=e.attributesMapping,u=e.block,c=e.highlightedColumnsMapping,s=e.selectedStreamMapping,a=e.setAttributesMapping,d=e.setHighlightedColumnsMapping,p=e.setSelectedStreamMapping,v=e.stream,h=e.streamMapping,m=(e.updateStreamsInCatalog,null===u||void 0===u||null===(n=u.metadata)||void 0===n||null===(t=n.data_integration)||void 0===t?void 0:t.destination),b=(0,f.useMemo)((function(){return!we.kB.includes(m)}),[m]);(0,f.useEffect)((function(){if(v&&!s){var e=(0,pe.M$)(v||{}),n=(0,pe.Qu)(v||{});n?p({noParents:{},parents:(0,l.Z)({},n,(0,l.Z)({},e,v))}):e&&p({noParents:(0,l.Z)({},e,v),parents:{}})}}),[s,p,v]);var g=(0,f.useMemo)((function(){return(null===v||void 0===v?void 0:v.replication_method)===we._B.INCREMENTAL}),[null===v||void 0===v?void 0:v.replication_method]),x=(0,f.useMemo)((function(){var e=[{label:function(){return"Include property when syncing"},inputType:de.oI.CHECKBOX,uuid:pe.I1.PROPERTY_SELECTED},{label:function(){return"Partition key"},inputType:de.oI.CHECKBOX,uuid:pe.I1.PARTITION_KEYS}].concat((0,o.Z)(we.D5.map((function(e){return{label:function(){return(0,$.vg)(e)},inputType:de.oI.CHECKBOX,uuid:e}}))));g&&e.splice(1,0,{label:function(){return"Bookmark property"},inputType:de.oI.CHECKBOX,uuid:pe.I1.BOOKMARK_PROPERTIES}),b&&e.splice(1,0,{label:function(){return"Unique constraint"},inputType:de.oI.CHECKBOX,uuid:pe.I1.UNIQUE_CONSTRAINTS},{label:function(){return"Key property"},inputType:de.oI.CHECKBOX,uuid:pe.I1.KEY_PROPERTIES});var n=2;g&&(n+=1),b&&(n+=2);var t=(0,Te.m5)(n);return(0,S.jsx)(en,{attributes:e,attributesMapping:i,rowGroupHeaders:["Options","Column types"],rowsGroupedByIndex:[t,null===we.D5||void 0===we.D5?void 0:we.D5.map((function(e,t){return t+n}))],setAttributesMapping:a})}),[i,a,b,g]),j=(0,f.useMemo)((function(){return(0,S.jsx)(nn,{selectedStreamMapping:s,setSelectedStreamMapping:p,streamMapping:h})}),[s,p,h]),y=(0,f.useMemo)((function(){var e,n=null===(e=Object.entries(c||{}))||void 0===e?void 0:e.reduce((function(e,n){var t=(0,r.Z)(n,2),i=t[0];return t[1]?e.concat(i):e}),[]);return(0,Te.YC)(n,(function(e){return e}))}),[c]);return(0,S.jsxs)(Ke.YI,{children:[(0,S.jsxs)(O.Z,{p:w.cd,children:[(0,S.jsxs)("div",{children:[(0,S.jsxs)(ce.Z,{children:[!(null!==y&&void 0!==y&&y.length)&&"Choose at least 1 property",(null===y||void 0===y?void 0:y.length)>=1&&"".concat((0,$._6)("property",(null===y||void 0===y?void 0:y.length)||0)," chosen")]}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsxs)(C.ZP,{default:!0,children:[!(null!==y&&void 0!==y&&y.length)&&"Click 1 or more rows in the table to select which schema properties to apply bulk changes to.",(null===y||void 0===y?void 0:y.length)>=1&&(0,S.jsx)(S.Fragment,{children:"Clicking the Apply button below will use the values from the selected properties below and change the values of those properties in all the selected columns for all the selected streams."})]})})]}),(null===y||void 0===y?void 0:y.length)>=1&&(0,S.jsx)(O.Z,{mt:w.cd,children:(0,S.jsx)(Z.ZP,{alignItems:"center",flexWrap:"wrap",children:null===y||void 0===y?void 0:y.map((function(e){return(0,S.jsx)("div",{style:{marginBottom:w.iI/2,marginRight:w.iI/2},children:(0,S.jsx)(Ze.Z,{label:e,onClick:function(){d((function(n){return!(null===n||void 0===n||!n[e])?(0,ye.gR)(n,[e]):rn(rn({},n),{},(0,l.Z)({},e,!0))}))}})},"".concat(e,"-chip"))}))})})]}),x,j]})};function un(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function cn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?un(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):un(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var sn={compact:!0,small:!0};var an=function(e){var n=e.block,t=e.blocksMapping,i=e.onChangeBlock,o=e.selectedStreamMapping,r=e.setSelectedMainNavigationTab,u=e.setSelectedStreamMapping,c=e.streamMapping,s=e.updateStreamsInCatalog,a=(0,f.useRef)(null),d=(0,f.useState)({}),p=d[0],v=d[1],h=(0,f.useCallback)((function(e){return s(e,(function(e){return null===i||void 0===i?void 0:i(e)}))}),[i,s]),m=(n||{}).type,b=c||{},x=b.noParents,j=b.parents,y=(0,f.useMemo)((function(){return(0,ye.Qr)(x||{})&&(0,ye.Qr)(j||{})}),[x,j]),E=(0,f.useMemo)((function(){return(0,pe.th)(c)}),[c]),I=(0,f.useMemo)((function(){var e=[null,1,3,2,2,null],n=[{label:function(e){var n=e.groupIndex,t=((null===E||void 0===E?void 0:E[n])||{}).streams,i=t&&(null===t||void 0===t?void 0:t.every((function(e){return(0,pe.Z5)(e)})));return(0,S.jsx)(Oe.Z,{checked:i,compact:!0,disabled:!(null!==t&&void 0!==t&&t.length),onCheck:function(e){t&&h(null===t||void 0===t?void 0:t.map((function(n){return(0,pe.XE)(n,{selected:e(i)})})))}})},uuid:"action"},{uuid:"Stream"},{uuid:"Table"},{uuid:"Sync"},{uuid:"Unique conflict"},{center:g.tf.DATA_EXPORTER===m,rightAligned:g.tf.DATA_EXPORTER!==m,uuid:"Parallel"}];return g.tf.DATA_EXPORTER===m&&(e.push.apply(e,[null,null]),n.push.apply(n,[{center:!0,uuid:"Add columns"},{center:!0,uuid:"No strict check"}])),{columnFlex:e,columns:n}}),[m,E,h]),T=I.columnFlex,M=I.columns,D=(0,f.useMemo)((function(){var e=[],n=[],i=[],o=[],u=0;return null===E||void 0===E||E.forEach((function(c){var s=c.groupHeader,d=c.streams,b=s?null===t||void 0===t?void 0:t[s]:null;b?n.push((0,S.jsx)(O.Z,{p:w.cd,children:(0,S.jsx)(C.ZP,{bold:!0,color:(0,_.qn)(null===b||void 0===b?void 0:b.type,{blockColor:null===b||void 0===b?void 0:b.color}).accent,monospace:!0,children:s})})):n.push(s);var x=[];null===d||void 0===d||d.forEach((function(n){e.push(n),x.push(u),u+=1;var t=(0,pe.WD)(n),o=(0,pe.Qu)(n),c=(0,pe.M$)(n),s=n.auto_add_new_fields,d=n.bookmark_properties,b=n.destination_table,j=n.disable_column_type_check,y=n.replication_method,w=n.run_in_parallel,_=n.unique_conflict_method,E=(0,pe.Z5)(n),I=t in p?null===p||void 0===p?void 0:p[t]:b,T=[(0,S.jsx)(Oe.Z,{checked:E,compact:!0,onCheck:function(e){h([(0,pe.XE)(n,{selected:e(E)})])}},"".concat(t,"-action")),(0,S.jsx)(P.Z,{bold:!0,monospace:!0,onClick:function(){r(c,o)},preventDefault:!0,sameColorAsText:!0,children:c},"".concat(t,"-name")),(0,S.jsx)(K.Z,{compact:!0,defaultColor:!I,monospace:!0,onChange:function(e){var i,o=null===e||void 0===e||null===(i=e.target)||void 0===i?void 0:i.value;v((function(e){return cn(cn({},e),{},(0,l.Z)({},t,o))})),clearTimeout(a.current),a.current=setTimeout((function(){return h([cn(cn({},n),{},{destination_table:o})])}),300)},onClick:Ne.j,placeholder:c,value:I||""},"".concat(t,"-destinationTable")),(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(k.Z,{flex:1,children:(0,S.jsx)(G.Z,cn(cn({},sn),{},{fullWidth:!0,onChange:function(e){var t;return h([cn(cn({},n),{},{replication_method:null===e||void 0===e||null===(t=e.target)||void 0===t?void 0:t.value})])},onClick:Ne.j,placeholder:"Replication method",value:y,children:we.jL.map((function(e){return(0,S.jsx)("option",{value:e,children:(0,$.vg)(e)},e)}))}))}),we._B.INCREMENTAL===y&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Z,{mr:1}),!(null!==d&&void 0!==d&&d.length)&&(0,S.jsx)(C.ZP,{danger:!0,xsmall:!0,children:"No bookmark properties set"}),(null===d||void 0===d?void 0:d.length)>=1&&(null===d||void 0===d?void 0:d.map((function(e,n){return(0,S.jsxs)(C.ZP,{inline:!0,monospace:!0,muted:!0,xsmall:!0,children:[n>=1&&", ",e]},e)})))]})]},"".concat(t,"-replicationMethod")),(0,f.createElement)(G.Z,cn(cn({},sn),{},{key:"".concat(t,"-uniqueConflictMethod"),onChange:function(e){var t;return h([cn(cn({},n),{},{unique_conflict_method:null===e||void 0===e||null===(t=e.target)||void 0===t?void 0:t.value})])},onClick:Ne.j,placeholder:"Unique conflict method",value:_}),Object.values(we.MU).map((function(e){return(0,S.jsx)("option",{value:e,children:(0,$.vg)(e)},e)}))),(0,S.jsx)(Z.ZP,{alignItems:"center",justifyContent:g.tf.DATA_EXPORTER===m?"center":"flex-end",children:(0,S.jsx)(Oe.Z,{checked:!!w,compact:!0,onCheck:function(e){h([cn(cn({},n),{},{run_in_parallel:e(w)})])}})},"".concat(t,"-runInParallel"))];g.tf.DATA_EXPORTER===m&&T.push.apply(T,[(0,S.jsx)(Z.ZP,{alignItems:"center",justifyContent:"center",children:(0,S.jsx)(Oe.Z,{checked:!!s,compact:!0,onCheck:function(e){h([cn(cn({},n),{},{auto_add_new_fields:e(s)})])}})},"".concat(t,"-autoAddNewFields")),(0,S.jsx)(Z.ZP,{alignItems:"center",justifyContent:"center",children:(0,S.jsx)(Oe.Z,{checked:!!j,compact:!0,onCheck:function(e){h([cn(cn({},n),{},{disable_column_type_check:e(j)})])}})},"".concat(t,"-disableColumnTypeCheck"))]),i.push(T)})),o.push(x)})),{rowGroupHeaders:n,rows:i,rowsGroupedByIndex:o,streamsInRows:e}}),[m,t,p,v,r,E,a,h]),R=D.rowGroupHeaders,B=D.rows,A=D.rowsGroupedByIndex,N=D.streamsInRows;return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(O.Z,{p:w.cd,children:[(0,S.jsx)(ce.Z,{children:"Overview of streams"}),y&&(0,S.jsxs)(O.Z,{mt:1,children:[(0,S.jsx)(C.ZP,{default:!0,children:"Fetch and add at least 1 stream to the catalog in order to see an overview of all the configured stream."}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsx)(P.Z,{bold:!0,onClick:function(){return r(de.uK.STREAMS)},preventDefault:!0,children:"Go and fetch Streams"})})]})]}),!y&&(0,S.jsx)(Pe.Z,{columnFlex:T,columns:M,isSelectedRow:function(e){var n=null===N||void 0===N?void 0:N[e];return!!(0,pe.zB)(n,o)},groupsInline:!0,onClickRow:function(e){var n=null===N||void 0===N?void 0:N[e],t=!!(0,pe.zB)(n,o);u((function(e){return(0,pe.iN)(n,e,{remove:t})}))},rowGroupHeaders:R,rows:B,rowsGroupedByIndex:A,stickyHeader:!0})]})},dn=t(62547),pn=t(53808),fn=t(19183);function vn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function hn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?vn(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):vn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var mn=3*w.iI*2;var bn=function(e){var n=e.block,t=void 0===n?null:n,i=e.defaultMainNavigationTab,u=void 0===i?null:i,c=e.defaultMainNavigationTabSub,s=void 0===c?null:c,a=e.defaultSubTab,d=void 0===a?null:a,p=e.onChangeBlock,h=e.onChangeCodeBlock,m=e.onClose,b=e.onSaveBlock,E=e.pipeline,I=e.savePipelineContent,T=e.setContent,M=(0,f.useRef)(null),D=(0,f.useRef)(null),A=(0,f.useRef)(null),N=(0,f.useRef)(null),L=(0,f.useState)({}),F=L[0],U=L[1],H=(0,f.useState)(null),W=H[0],G=H[1],Y=(0,f.useState)(!1),Q=Y[0],J=Y[1],$=(0,fn.i)(),te=$.height,ie=$.width,oe=E||{},le=oe.blocks,ue=oe.uuid,se=t||{},ae=(se.catalog,se.content),fe=(se.language,se.type),ve=se.uuid,ge=(0,f.useMemo)((function(){return g.tf.DATA_LOADER===fe?X.O.SOURCES:X.O.DESTINATIONS}),[fe]),xe=(0,f.useState)(t||null),je=xe[0],ke=xe[1],Ze=je||{},Pe=(Ze.configuration,Ze.content),Ce=Ze.metadata,we=(0,f.useMemo)((function(){return(null===Ce||void 0===Ce?void 0:Ce.data_integration)||{}}),[Ce]),_e=we.destination,Se=we.name,Ee=we.source,Ie=(0,f.useMemo)((function(){return _e||Ee||null}),[_e,Ee]),Me=(0,f.useMemo)((function(){var e={include_block_catalog:!0,include_block_metadata:!0,include_documentation:!0};return Ie&&(e.data_integration_uuid=Ie),e}),[Ie]),De=V.ZP.blocks.pipelines.detail(ue,ve,Me,{},{key:"pipelines/".concat(ue,"/blocks/").concat(ve,"/documentation")}).data,Re=(0,f.useMemo)((function(){var e;return(null===je||void 0===je||null===(e=je.configuration)||void 0===e?void 0:e.data_integration)||{}}),[je]),Be=(0,f.useCallback)((function(e){return ke((function(n){var t,i=hn(hn({},n),{},{configuration:hn(hn({},null===n||void 0===n?void 0:n.configuration),{},{data_integration:e((null===n||void 0===n||null===(t=n.configuration)||void 0===t?void 0:t.data_integration)||{})})});return null===p||void 0===p||p(i),i}))}),[p,ke]),Ae=(0,f.useCallback)((function(e){return Be((function(n){return hn(hn({},n),{},{inputs:e((null===n||void 0===n?void 0:n.inputs)||{})})}))}),[Be]),Ne=(0,f.useCallback)((function(e,n){return ke((function(t){var i=(null===t||void 0===t?void 0:t.catalog)||{streams:[]},r=(0,o.Z)((null===i||void 0===i?void 0:i.streams)||[]);null===e||void 0===e||e.forEach((function(e){var n=(0,pe.M$)(e),t=null===e||void 0===e?void 0:e.parent_stream,i=null===r||void 0===r?void 0:r.findIndex((function(e){var i=(0,pe.M$)(e),o=null===e||void 0===e?void 0:e.parent_stream;return n===i&&t===o})),o={};i>=0&&(o=null===r||void 0===r?void 0:r[i]);var l=hn(hn({},o),e);i>=0?r[i]=l:r.push(l)}));var l=hn(hn({},t),{},{catalog:hn(hn({},i),{},{streams:r})});return null===n||void 0===n||n(l),l}))}),[ke]),Le=(0,f.useMemo)((function(){return null===De||void 0===De?void 0:De.block}),[De]);(0,f.useEffect)((function(){Le&&(je&&(null===Le||void 0===Le?void 0:Le.uuid)===(null===je||void 0===je?void 0:je.uuid)||ke(Le))}),[je,Le]);var Fe=(0,f.useMemo)((function(){return(0,Te.HK)(le||[],(function(e){return e.uuid}))}),[le]),Ue=(0,f.useMemo)((function(){var e;return null===je||void 0===je||null===(e=je.upstream_blocks)||void 0===e?void 0:e.map((function(e){return null===Fe||void 0===Fe?void 0:Fe[e]}))}),[je,Fe]),He=(0,f.useMemo)((function(){return null===Le||void 0===Le?void 0:Le.documentation}),[Le]),We=(0,f.useMemo)((function(){return(0,pe.Uc)(je,{getAll:!0})}),[je]),Ge=(0,f.useMemo)((function(){return(0,pe.UA)(We)}),[We]),Ve=(0,f.useMemo)((function(){return"DataIntegrationModal/".concat(ve)}),[ve]),qe=(0,f.useMemo)((function(){return"block_layout_after_width_".concat(Ve)}),[Ve]),Ye=(0,f.useMemo)((function(){return"block_layout_before_width_".concat(Ve)}),[Ve]),Xe=(0,ne.VI)(null,{},[],{uuid:Ve}),Je=(0,r.Z)(Xe,1)[0],$e=(0,f.useState)((0,pn.U2)(qe,60*w.iI)),en=$e[0],nn=$e[1],on=(0,f.useState)(!1),rn=on[0],un=on[1],cn=(0,f.useState)(Math.max((0,pn.U2)(Ye),40*w.iI)),sn=cn[0],vn=cn[1],bn=(0,f.useState)(!1),gn=bn[0],xn=bn[1],jn=(0,f.useState)({}),yn=jn[0],kn=jn[1],Zn=(0,f.useState)({selectedMainNavigationTab:null,selectedMainNavigationTabSub:s,selectedSubTab:null}),Pn=Zn[0],On=Pn.selectedMainNavigationTab,Cn=Pn.selectedMainNavigationTabSub,wn=Pn.selectedSubTab,_n=Zn[1],Sn=(0,f.useState)((0,pe.UA)([])),En=Sn[0],In=Sn[1],Tn=(0,f.useMemo)((function(){if(!(0,ye.Qr)(null===En||void 0===En?void 0:En.noParents)||!(0,ye.Qr)(null===En||void 0===En?void 0:En.parents)){var e,n,t,i;if(On)if(Cn)e=null===En||void 0===En||null===(n=En.parents)||void 0===n||null===(t=n[On])||void 0===t?void 0:t[Cn];else e=null===En||void 0===En||null===(i=En.noParents)||void 0===i?void 0:i[On];return(0,de.C0)({addStreamConflicts:!!e})}return(0,de.C0)()}),[On,Cn,En]),Mn=(0,f.useCallback)((function(e){return e in de.Pf?de.Pf[e]:Tn}),[Tn]),Dn=(0,f.useCallback)((function(e){_n((function(n){return function(e,n){var t=e||{},i=t.selectedMainNavigationTab,o=t.selectedMainNavigationTabSub,r=t.selectedSubTab,l=n||{},u=l.selectedMainNavigationTab,c=l.selectedMainNavigationTabSub,s=i in de.Pf?de.Pf[i]:Tn,a=r;if(de.mU[i]||de.mU[u]){var d,p,f;if(a){if(de.mU[u]&&!de.mU[i]){var v;!a||null!==Tn&&void 0!==Tn&&Tn.includes(a)||de.tw.STREAM_CONFLICTS===a||(a=null===Tn||void 0===Tn||null===(v=Tn[0])||void 0===v?void 0:v.uuid)}}else a=null===s||void 0===s||null===(f=s[0])||void 0===f?void 0:f.uuid;i!==u&&kn({});var h=(0,pe.zB)({parent_stream:c,stream:u,tap_stream_id:u},Ge),m=(0,pe.zB)({parent_stream:o,stream:i,tap_stream_id:i},Ge),b=(0,Te.jV)(Object.keys((null===h||void 0===h||null===(d=h.schema)||void 0===d?void 0:d.properties)||{}),Object.keys((null===m||void 0===m||null===(p=m.schema)||void 0===p?void 0:p.properties)||{}));kn((function(e){return hn({},(0,ye.GL)(e,b||[]))}))}return{selectedMainNavigationTab:i,selectedMainNavigationTabSub:o,selectedSubTab:a}}(e(n),n)}))}),[kn,Ge,Tn]);(0,f.useEffect)((function(){On||Dn((function(e){var n,t,i=e.selectedSubTab;return{selectedMainNavigationTab:u||de.uK.CONFIGURATION,selectedMainNavigationTabSub:s,selectedSubTab:u?d||(null===(n=Mn(u))||void 0===n||null===(t=n[0])||void 0===t?void 0:t.uuid):i}}))}),[u,s,d,Mn,On,Dn]);var Rn=(0,f.useMemo)((function(){return Mn(On)}),[Mn,On]),Bn=(0,f.useMemo)((function(){var e=[{Icon:q.JG,uuid:de.uK.CONFIGURATION},{Icon:q.kO,uuid:de.uK.STREAMS},{Icon:q.iA,uuid:de.uK.OVERVIEW}].map((function(e){var n=e.Icon,t=e.uuid;return(0,S.jsx)(Ke.bC,{selected:On===t,children:(0,S.jsx)(P.Z,{block:!0,noHoverUnderline:!0,noOutline:!0,onClick:function(){return Dn((function(){return{selectedMainNavigationTab:t}}))},preventDefault:!0,children:(0,S.jsx)(O.Z,{p:w.cd,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(j.Z,{primaryLight:!0,size:4*w.iI,square:!0,children:(0,S.jsx)(n,{size:2*w.iI})}),(0,S.jsx)(O.Z,{mr:2}),(0,S.jsx)(C.ZP,{bold:!0,large:!0,children:de.TD[t]})]})})})},t)})),n=(null===We||void 0===We?void 0:We.length)||0,t=[],i={};return null===We||void 0===We||We.forEach((function(e){var n=e.parent_stream;n?(null!==i&&void 0!==i&&i[n]||(i[n]=[]),i[n].push(e)):t.push(e)})),[{block:null,streams:t}].concat((0,o.Z)((0,Te.YC)(Object.entries(i),(function(e){var n=(0,r.Z)(e,2),t=n[0];n[1];return t})).map((function(e){var n=(0,r.Z)(e,2),t=n[0],i=n[1];return{block:null===Fe||void 0===Fe?void 0:Fe[t],streams:i}})))).forEach((function(t){var i=t.block,o=t.streams;if(i){var r=null===i||void 0===i?void 0:i.uuid;e.push((0,S.jsx)(y.Z,{light:!0},"block-".concat(r,"-divider-top"))),e.push((0,S.jsx)(O.Z,{px:w.cd,py:1,children:(0,S.jsx)(C.ZP,{bold:!0,color:(0,_.qn)(null===i||void 0===i?void 0:i.type,{blockColor:null===i||void 0===i?void 0:i.color}).accent,monospace:!0,small:!0,children:r})},"block-".concat(r)))}null===o||void 0===o||o.forEach((function(t,i){var o=(0,pe.M$)(t),r=(0,pe.Qu)(t),l=(0,pe.WD)(t),u=(0,pe.Z5)(t),c=On===o&&(!r||Cn===r);e.push((0,S.jsx)(y.Z,{light:!0},"".concat(l,"-divider-top"))),e.push((0,S.jsx)(Ke.bC,{selected:c,children:(0,S.jsx)(P.Z,{block:!0,noHoverUnderline:!0,noOutline:!0,onClick:function(){Dn((function(e){var n=e.selectedSubTab;return{selectedMainNavigationTab:o,selectedMainNavigationTabSub:r,selectedSubTab:n}}))},preventDefault:!0,children:(0,S.jsx)(O.Z,{p:w.cd,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(j.Z,{size:1*w.iI,success:u}),(0,S.jsx)(O.Z,{mr:2}),(0,S.jsx)(k.Z,{flex:1,children:(0,S.jsx)(C.ZP,{default:!u,monospace:!0,children:o})})]})})})},l)),i===n-1&&e.push((0,S.jsx)(y.Z,{light:!0},"".concat(l,"-divider-last")))}))})),e}),[Fe,On,Cn,Dn,We]),An=(0,f.useState)(null),Nn=An[0],Ln=An[1],Fn=(0,f.useMemo)((function(){return(0,pe.qf)(Ge,(0,pe.UA)(Nn||[]))}),[Ge,Nn]),Un=(0,v.Db)(V.ZP.integration_sources.useUpdate(ue),{onSuccess:function(e){return(0,ee.wD)(e,{callback:function(e){var n=e.integration_source.streams;Ln(n)},onErrorCallback:function(e,n){return Je({errors:n,response:e})}})}}),Hn=(0,r.Z)(Un,2),Wn=Hn[0],Gn=Hn[1].isLoading,zn=(0,f.useCallback)((function(){return Wn({integration_source:{block_uuid:ve}})}),[ve,Wn]),Kn=(0,f.useState)(null),Vn=Kn[0],qn=Kn[1],Yn=(0,f.useMemo)((function(){return(0,S.jsxs)("div",{ref:N,children:[(null===Rn||void 0===Rn?void 0:Rn.length)>=1&&(0,S.jsx)(O.Z,{p:w.cd,children:(0,S.jsx)(B.Z,{noPadding:!0,onClickTab:function(e){var n=e.uuid;return Dn((function(e){return hn(hn({},e),{},{selectedSubTab:n})}))},regularSizeText:!0,selectedTabUUID:wn,tabs:Rn})}),!(null!==Rn&&void 0!==Rn&&Rn.length)&&de.uK.STREAMS===On&&(0,S.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsx)(k.Z,{flex:1,children:(0,S.jsx)(K.Z,{beforeIcon:(0,S.jsx)(q.HN,{muted:!(null!==Vn&&void 0!==Vn&&Vn.length),size:2*w.iI}),fullWidth:!0,noBackground:!0,noBorder:!0,noBorderRadiusBottom:!0,noBorderRadiusTop:!0,onChange:function(e){var n;return qn(null===e||void 0===e||null===(n=e.target)||void 0===n?void 0:n.value)},paddingHorizontal:w.iI*w.cd,paddingVertical:w.iI*w.cd,placeholder:"Type the name of the stream to filter...",value:Vn||""})}),(null===Vn||void 0===Vn?void 0:Vn.length)>=1&&(0,S.jsx)(R.ZP,{iconOnly:!0,noPadding:!0,noBackground:!0,noBorder:!0,onClick:function(){return qn(null)},children:(0,S.jsx)(q.x8,{default:!0,size:2*w.iI})}),!Fn&&(0,S.jsx)(O.Z,{px:w.cd,children:(0,S.jsx)(R.ZP,{beforeIcon:(0,S.jsx)(q.rH,{size:2*w.iI}),compact:!0,loading:Gn,onClick:function(){return zn()},primary:!0,children:"Fetch streams"})})]}),(0,S.jsx)(y.Z,{light:!0})]})}),[zn,Gn,Fn,N,Vn,On,wn,qn,Dn,Rn]),Xn=(0,f.useMemo)((function(){return te-2*Ke.UF}),[te]),Qn=(0,f.useMemo)((function(){return ie-2*Ke.UF}),[ie]),Jn=(0,f.useState)(null),$n=Jn[0],et=Jn[1],nt=(0,f.useState)(null),tt=nt[0],it=nt[1],ot=(0,f.useState)(null),rt=(ot[0],ot[1]),lt=(0,f.useState)(!1),ut=lt[0],ct=lt[1];(0,f.useEffect)((function(){var e,n,t,i,o,r;(On||wn)&&(et(null===N||void 0===N||null===(e=N.current)||void 0===e||null===(n=e.getBoundingClientRect())||void 0===n?void 0:n.height),rt(null===D||void 0===D||null===(t=D.current)||void 0===t||null===(i=t.getBoundingClientRect())||void 0===i?void 0:i.height),it(null===A||void 0===A||null===(o=A.current)||void 0===o||null===(r=o.getBoundingClientRect())||void 0===r?void 0:r.height))}),[A,D,N,On,wn]);var st=(0,v.Db)(V.ZP.blocks.pipelines.useUpdate(encodeURIComponent(ue),encodeURIComponent(ve)),{onSuccess:function(e){return(0,ee.wD)(e,{callback:function(e){null===b||void 0===b||b(null===e||void 0===e?void 0:e.block)},onErrorCallback:function(e,n){return Je({errors:n,response:e})}})}}),at=(0,r.Z)(st,2),dt=(at[0],at[1].isLoading,(0,f.useMemo)((function(){return On&&![de.uK.CONFIGURATION,de.uK.OVERVIEW,de.uK.STREAMS,de.uK.SYNC].includes(On)}),[On])),pt=(0,f.useMemo)((function(){return dt&&de.tw.SETTINGS===wn}),[dt,wn]),ft=(0,f.useMemo)((function(){return de.uK.CONFIGURATION===On&&de.tw.CREDENTIALS===wn}),[On,wn]),vt=(0,f.useMemo)((function(){return de.uK.OVERVIEW===On}),[On]),ht=(0,f.useMemo)((function(){return!(ft||pt||vt&&(null===We||void 0===We?void 0:We.length)>=1)||ut}),[ut,ft,pt,vt,We]),mt=(0,f.useMemo)((function(){var e=(0,pe.zB)({parent_stream:Cn,stream:On,tap_stream_id:On},Ge);if(e)return(0,S.jsx)(ze,{block:je,blocksMapping:Fe,height:Xn-$n-2*w.iI,highlightedColumnsMapping:yn,onChangeBlock:p,pipeline:E,selectedSubTab:wn,setBlockAttributes:ke,setHighlightedColumnsMapping:kn,setSelectedSubTab:function(e){return Dn((function(n){return hn(hn({},n),{},{selectedSubTab:e})}))},setStreamsMappingConflicts:In,showError:Je,stream:e,streamMapping:Ge,streamsMappingConflicts:En,updateStreamsInCatalog:Ne})}),[je,Fe,$n,Xn,yn,p,E,On,Cn,wn,ke,kn,Dn,In,Je,Ge,En,Ne]),bt=(0,f.useState)(null),gt=bt[0],xt=bt[1];(0,f.useEffect)((function(){"undefined"!==typeof gt&&null!==gt||xt("undefined"!==typeof ae&&null!==ae?ae:Pe)}),[Pe,ae,gt,xt]);var jt=(0,f.useState)(null),yt=jt[0],kt=jt[1],Zt=(0,f.useMemo)((function(){return(0,S.jsx)(he,{block:je,blockConfigString:yt,blockContent:gt,blockUpstreamBlocks:Ue,dataIntegrationConfiguration:Re,onChangeCodeBlock:h,pipeline:E,savePipelineContent:I,setBlockConfigString:kt,setBlockContent:xt,setContent:T,setSelectedSubTab:function(e){return Dn((function(n){return hn(hn({},n),{},{selectedSubTab:e})}))},showError:Je})}),[je,yt,gt,Ue,Re,h,E,I,kt,xt,T,Dn,Je]),Pt=(0,f.useMemo)((function(){if(de.uK.CONFIGURATION===On){if(de.tw.UPSTREAM_BLOCK_SETTINGS===wn){var e=null===Ue||void 0===Ue?void 0:Ue.map((function(e){var n,t,i=e.uuid,o=null===Re||void 0===Re||null===(n=Re.inputs)||void 0===n?void 0:n[i],r=(null===o||void 0===o?void 0:o.streams)||[],u=!!o,c=null===Fe||void 0===Fe?void 0:Fe[i],s=(null===c||void 0===c?void 0:c.catalog)?null===(t=(0,pe.Uc)(c))||void 0===t?void 0:t.map((function(e){var n=e.stream,t=e.tap_stream_id;return n||t})):[i],a=1===(null===s||void 0===s?void 0:s.length)&&(null===s||void 0===s?void 0:s.includes(i));return(0,S.jsxs)("div",{children:[(0,S.jsxs)(O.Z,{p:w.cd,children:[(0,S.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsx)(k.Z,{children:(0,S.jsx)(C.ZP,{bold:!0,large:!0,monospace:!0,muted:!u,children:i})}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(Oe.Z,{checked:u,compact:!0,onCheck:function(e){Ae((function(n){return e(u)?hn(hn({},n),{},(0,l.Z)({},i,{})):(0,ye.gR)(n,[i])}))}})]}),u&&(0,S.jsx)(O.Z,{mt:w.cd,children:(0,S.jsxs)(be.Z,{noBackground:!0,noBoxShadow:!0,sameColorBorders:!0,children:[(0,S.jsx)(be.g,{noBorder:!0,children:(0,S.jsxs)(Z.ZP,hn(hn({},Z.A0),{},{children:[(0,S.jsxs)(k.Z,{flexDirection:"column",children:[(0,S.jsx)(C.ZP,{bold:!0,default:!0,children:"Use catalog as an input"}),(0,S.jsx)(C.ZP,{muted:!0,small:!0,children:"If checked, then this block\u2019s catalog will be included as part of the input argument(s) for the current block."})]}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(x.Z,{checked:null===o||void 0===o?void 0:o.catalog,onClick:function(){return Ae((function(e){var n;return hn(hn({},e),{},(0,l.Z)({},i,hn(hn({},null===e||void 0===e?void 0:e[i]),{},{catalog:!(null!==e&&void 0!==e&&null!==(n=e[i])&&void 0!==n&&n.catalog)})))}))}})]}))}),a&&(0,S.jsx)(be.g,{noBorder:!0,children:(0,S.jsxs)(Z.ZP,hn(hn({},Z.A0),{},{children:[(0,S.jsxs)(k.Z,{flexDirection:"column",children:[(0,S.jsx)(C.ZP,{bold:!0,default:!0,children:"Use the block\u2019s output data as an input"}),(0,S.jsx)(C.ZP,{muted:!0,small:!0,children:"Include this block\u2019s output data as an input."})]}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(x.Z,{checked:null===r||void 0===r?void 0:r.includes(i),monospace:!0,onClick:function(){return Ae((function(e){return hn(hn({},e),{},(0,l.Z)({},i,hn(hn({},null===e||void 0===e?void 0:e[i]),{},{streams:null!==r&&void 0!==r&&r.includes(i)?(0,Te.Od)(r,(function(e){return e===i})):r.concat(i)})))}))},small:!0})]}))}),!a&&(0,S.jsxs)(be.g,{noBorder:!0,children:[(0,S.jsxs)(Z.ZP,hn(hn({},Z.A0),{},{children:[(0,S.jsxs)(k.Z,{flexDirection:"column",children:[(0,S.jsx)(C.ZP,{bold:!0,default:!0,children:"Select which stream\u2019s data to use as an input"}),(0,S.jsxs)(C.ZP,{muted:!0,small:!0,children:["Only the output data from the selected streams will be used as an input.",(0,S.jsx)("br",{}),"If none are selected, then no output data from any stream from this block will be used as in input.",(0,S.jsx)("br",{}),"If you don\u2019t see a stream here, then the upstream block may have unselected the stream in its stream settings."]})]}),(0,S.jsx)(O.Z,{mr:3})]})),null===s||void 0===s?void 0:s.map((function(e){var n=null===r||void 0===r?void 0:r.includes(e);return(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsxs)(Z.ZP,hn(hn({},Z.A0),{},{children:[(0,S.jsx)(k.Z,{children:(0,S.jsx)(C.ZP,{default:!0,monospace:!0,small:!0,children:e})}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(x.Z,{checked:n,onClick:function(){return Ae((function(t){return hn(hn({},t),{},(0,l.Z)({},i,hn(hn({},null===t||void 0===t?void 0:t[i]),{},{streams:n?(0,Te.Od)(r,(function(n){return n===e})):r.concat(e)})))}))},small:!0})]}))},e)}))]}),(0,S.jsx)(be.g,{noBorder:!0,children:(0,S.jsxs)(Z.ZP,hn(hn({},Z.A0),{},{children:[(0,S.jsxs)(k.Z,{flexDirection:"column",children:[(0,S.jsx)(C.ZP,{bold:!0,default:!0,children:"Only use this block\u2019s output data as an input"}),(0,S.jsxs)(C.ZP,{muted:!0,small:!0,children:["If checked, then this block\u2019s output data is only used as inputs.",g.tf.DATA_EXPORTER===fe&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)("br",{}),"The block\u2019s output data won\u2019t be ingested when running a sync, regardless if it\u2019s enabled in the settings."]})]})]}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(x.Z,{checked:!(null===o||void 0===o||!o.input_only),onClick:function(){return Ae((function(e){var n;return hn(hn({},e),{},(0,l.Z)({},i,hn(hn({},null===e||void 0===e?void 0:e[i]),{},{input_only:!(null!==e&&void 0!==e&&null!==(n=e[i])&&void 0!==n&&n.input_only)})))}))}})]}))})]})})]}),(0,S.jsx)(y.Z,{light:!0})]},i)}));return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(O.Z,{p:w.cd,children:[(0,S.jsx)(ce.Z,{children:"Inputs"}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsxs)(C.ZP,{default:!0,children:["Choose which upstream block to use as inputs when interpolating data into ",(0,S.jsx)(C.ZP,{inline:!0,monospace:!0,children:ve}),"\u2019s (current block) credentials (aka config) and decorated functions."]})}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsxs)(C.ZP,{default:!0,children:["If ",(0,S.jsx)(C.ZP,{inline:!0,monospace:!0,children:ve})," (current block) doesn\u2019t require the data from an upstream block to interpolate or as arguments for decorated functions, don\u2019t toggle them on because it\u2019ll save time and data by not loading unnecessary data as inputs."]})}),X.O.DESTINATIONS===ge&&(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsxs)(C.ZP,{default:!0,children:["Upstream blocks can still be selected to have its data ingested. This is toggled and configured in the ",(0,S.jsx)(P.Z,{bold:!0,onClick:function(){return Dn((function(){return{selectedMainNavigationTab:de.uK.STREAMS}}))},preventDefault:!0,primary:!0,children:"Streams"})," section."]})})]}),(0,S.jsx)(y.Z,{light:!0}),e]})}}else{if(de.uK.STREAMS===On&&Fn)return(0,S.jsxs)(O.Z,{p:w.cd,children:[(0,S.jsxs)(O.Z,{mb:w.cd,children:[(0,S.jsx)(ce.Z,{children:"Fetch streams to start set up"}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsxs)(C.ZP,{default:!0,children:["Add streams and configure them by first fetching the available streams from ",Ie,"."]})})]}),(0,S.jsx)(R.ZP,{beforeIcon:(0,S.jsx)(q.rH,{size:2*w.iI}),large:!0,loading:Gn,onClick:function(){return zn()},primary:!0,children:"Fetch streams"})]});if(de.uK.SYNC===On)return(0,S.jsx)(O.Z,{p:w.cd,children:(0,S.jsx)(C.ZP,{children:"Coming soon"})});if(de.uK.OVERVIEW===On)return(0,S.jsx)(an,{block:je,blocksMapping:Fe,onChangeBlock:p,selectedStreamMapping:W,setSelectedMainNavigationTab:function(e){return Dn((function(n){return{selectedMainNavigationTab:e}}))},setSelectedStreamMapping:G,streamMapping:Ge,updateStreamsInCatalog:Ne})}}),[je,fe,ve,Ue,Fe,Re,ge,Ie,zn,Gn,Fn,p,On,W,wn,Ae,Dn,G,Ge,Ne]),Ot=(0,f.useMemo)((function(){return ft?(0,S.jsx)(C.ZP,{bold:!0,children:"Documentation"}):pt?(0,S.jsx)(C.ZP,{bold:!0,children:"Bulk edit stream properties"}):vt?(0,S.jsx)(C.ZP,{bold:!0,children:"Bulk edit streams"}):void 0}),[ft,pt,vt]),Ct=(0,f.useMemo)((function(){if(pt||vt)return(0,S.jsx)(Ke.Tr,{ref:A,children:(0,S.jsxs)(O.Z,{p:w.cd,children:[(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsx)(x.Z,{checked:Q,label:"Clear selection and values after applying changes",onClick:function(){return J((function(e){return!e}))}})}),(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(R.ZP,{fullWidth:!0,onClick:function(){var e={noParents:{},parents:{}};pt?e=(0,pe.Kq)(W,yn,F):vt&&(e=(0,pe.bX)(W,F)),Ne((0,pe.eH)(e),(function(e){return null===p||void 0===p?void 0:p(e)})),Q&&(U({}),kn({}),G(null))},primary:!0,children:"Apply bulk changes"}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(R.ZP,{fullWidth:!0,onClick:function(){U({}),kn({}),G(null)},secondary:!0,children:"Clear"})]})]})})}),[F,Q,yn,pt,vt,p,A,W,U,kn,G,Ne]),wt=(0,f.useMemo)((function(){if(ft)return(0,S.jsx)(Ke.yh,{children:(0,S.jsxs)(O.Z,{p:w.cd,children:[!De&&(0,S.jsx)(z.Z,{}),He&&(0,S.jsx)(me.Z,{children:He.replace(/\<br \/\>/g,"\n\n")})]})});if(pt){var e=(0,pe.zB)({parent_stream:Cn,stream:On,tap_stream_id:On},Ge);return(0,S.jsx)(ln,{attributesMapping:F,block:je,blocksMapping:Fe,highlightedColumnsMapping:yn,selectedStreamMapping:W,setAttributesMapping:U,setHighlightedColumnsMapping:kn,setSelectedStreamMapping:G,stream:e,streamMapping:Ge,updateStreamsInCatalog:Ne})}return vt?(0,S.jsx)(tn,{attributesMapping:F,selectedStreamMapping:W,setAttributesMapping:U,setSelectedStreamMapping:G,streamMapping:Ge}):void 0}),[F,je,Fe,De,He,yn,ft,pt,vt,On,Cn,W,Ge,Ne]),_t=(0,f.useMemo)((function(){var e=[{label:function(){return ve}}];return Se&&e.push({bold:!On,label:function(){return Se}}),On&&e.push({bold:!0,label:function(){return de.TD[On]||On}}),(0,S.jsx)(re.Z,{breadcrumbs:e,noMarginLeft:!0})}),[ve,Se,On]),St=(0,f.useMemo)((function(){return(te-Xn-mn)/2}),[Xn,te]),Et=(0,f.useMemo)((function(){return(0,S.jsx)(Qe,{block:je,blocksMapping:Fe,height:Xn-$n,onChangeBlock:p,searchText:Vn,setSelectedMainNavigationTab:Dn,setSelectedSubTab:function(e){return Dn((function(n){return hn(hn({},n),{},{selectedSubTab:e})}))},setStreamsMappingConflicts:In,streamsFetched:Nn,updateStreamsInCatalog:Ne,width:Qn-(sn+(ht?0:en))})}),[ht,en,sn,je,Fe,$n,Xn,p,Vn,Dn,In,Nn,Ne,Qn]);return(0,S.jsxs)(Ke.Nk,{maxWidth:Qn,children:[(0,S.jsx)(Ke.I5,{children:(0,S.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsx)(k.Z,{children:_t}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(P.Z,{href:"https://docs.mage.ai",inline:!0,noOutline:!0,openNewWindow:!0,children:(0,S.jsx)(q.$l,{default:!0,size:2*w.iI})}),(0,S.jsx)(O.Z,{mr:2}),m&&(0,S.jsx)(R.ZP,{iconOnly:!0,noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){null===m||void 0===m||m()},children:(0,S.jsx)(q.x8,{default:!0,size:2*w.iI})})]})]})}),(0,S.jsxs)(dn.Z,{after:wt,afterFooter:Ct,afterFooterBottomOffset:St,afterHeader:(0,S.jsx)(O.Z,{px:1,ref:D,children:Ot}),afterHeaderOffset:0,afterHeightOffset:0,afterHidden:ht,afterInnerHeightMinus:48+(Ct&&tt||0),afterMousedownActive:rn,afterWidth:en,before:Bn,beforeHeightOffset:0,beforeMousedownActive:gn,beforeWidth:sn,contained:!0,headerOffset:$n,height:Xn,hideAfterCompletely:!wt||vt&&!(null!==We&&void 0!==We&&We.length),inline:!0,mainContainerHeader:Yn,mainContainerRef:M,setAfterHidden:ct,setAfterMousedownActive:un,setAfterWidth:nn,setBeforeMousedownActive:xn,setBeforeWidth:vn,uuid:Ve,children:[dt&&mt,!dt&&Pt,de.uK.CONFIGURATION===On&&de.tw.CREDENTIALS===wn&&Zt,de.uK.STREAMS===On&&!Fn&&Et]})]})},gn=t(50724),xn=t(70374),jn=t(72098),yn=t(77417),kn=t(39643),Zn=t(26419),Pn=t(58325),On=t(44688);function Cn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function wn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Cn(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Cn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var _n=1.5*w.iI;var Sn=function(e){var n=e.cancelPipeline,t=e.children,i=e.createPipeline,o=e.executePipeline,r=e.interruptKernel,u=e.isPipelineExecuting,c=e.kernel,s=e.pipeline,a=e.restartKernel,d=e.savePipelineContent,p=e.scrollTogether,v=(e.setActiveSidekickView,e.setMessages),h=e.setScrollTogether,m=e.setSideBySideEnabled,b=e.sideBySideEnabled,g=e.updatePipelineMetadata,x=(0,f.useState)(null),j=x[0],y=x[1],k=(0,f.useRef)(null),P=(0,f.useRef)(null),w=(0,f.useRef)(null),_=(0,f.useRef)(null),E=(0,f.useRef)(null),I=(0,yn.Z)(),T=I.featureEnabled,M=I.featureUUIDs,D=[{label:function(){return"New standard pipeline"},onClick:function(){return i({pipeline:{name:(0,$.Y6)()}})},uuid:"new_standard_pipeline"},{label:function(){return"New streaming pipeline"},onClick:function(){return i({pipeline:{name:(0,$.Y6)(),type:W.qL.STREAMING}})},uuid:"new_streaming_pipeline"},{keyTextGroups:[[(0,Pn.V5)()?kn.RJ:kn.hE,kn.SS]],label:function(){return"Save pipeline"},onClick:function(){return d()},uuid:"save_pipeline"}],B=(0,f.useMemo)((function(){var e=[{label:function(){return"Interrupt kernel"},keyTextGroups:[[kn.kA],[kn.kA]],onClick:function(){return r()},uuid:"Interrupt kernel"},{label:function(){return"Restart kernel"},keyTextGroups:[[kn.t_[kn.OC]],[kn.t_[kn.OC]]],onClick:function(){return a()},uuid:"Restart kernel"},{label:function(){return"Clear all outputs"},onClick:function(){return v((function(e){return Object.keys(e).reduce((function(e,n){return wn(wn({},e),{},(0,l.Z)({},n,[]))}),{})}))},uuid:"Clear all outputs"}];return u?e.push({label:function(){return"Cancel pipeline"},onClick:function(){return n()},uuid:"Cancel pipeline"}):(null===s||void 0===s?void 0:s.type)===W.qL.STREAMING&&e.push({label:function(){return"Execute pipeline"},onClick:function(){return o()},uuid:"Execute pipeline"}),e}),[n,o,r,u,null===s||void 0===s?void 0:s.type,a,v]),A=(0,f.useMemo)((function(){return[{label:function(){return"Pipeline settings"},linkProps:{as:"/pipelines/".concat(null===s||void 0===s?void 0:s.uuid,"/settings"),href:"/pipelines/[pipeline]/settings"},uuid:"Pipeline settings"},{label:function(){return"Browse custom templates"},linkProps:{href:"/templates"},uuid:"browse_custom_templates"},{label:function(){return"Create custom templates"},linkProps:{href:"/templates?new=1"},uuid:"create_custom_templates"}]}),[s]),N=(0,f.useMemo)((function(){return[{label:function(){return(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(q.vR,{success:!b}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(C.ZP,{noWrapping:!0,children:"Show output below block"})]})},onClick:function(){m(!1)},uuid:"Show output below block"},{label:function(){return(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(q.lx,{success:b}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(C.ZP,{noWrapping:!0,children:"Show output next to code (beta)"})]})},onClick:function(){m(!0)},uuid:"Show output next to code"},{disabled:!b,label:function(){return(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[p?(0,S.jsx)(q.Jr,{}):(0,S.jsx)("div",{style:{width:_n}}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(C.ZP,{disabled:!b,noWrapping:!0,children:"Scroll output alongside code (beta)"})]})},onClick:function(){return h(!p)},uuid:"Scroll output alongside code"}]}),[p,h,m,b]),L=(0,f.useMemo)((function(){var e=[{label:function(){return"Open compute management"},linkProps:{href:"/compute"},uuid:"Open compute management"}];return jn.U.PYTHON3===(null===c||void 0===c?void 0:c.name)?e.push({label:function(){return"Switch to PySpark kernel"},onClick:function(){return null===g||void 0===g?void 0:g(null===s||void 0===s?void 0:s.name,W.fj[jn.U.PYSPARK])},uuid:"Switch to PySpark kernel"}):jn.U.PYSPARK===(null===c||void 0===c?void 0:c.name)&&e.push({label:function(){return"Switch to Python kernel"},onClick:function(){return null===g||void 0===g?void 0:g(null===s||void 0===s?void 0:s.name,W.fj[jn.U.PYTHON3])},uuid:"Switch to Python kernel"}),e}),[c,s,g]),F="FileHeaderMenu/index",U=(0,On.y)(),H=U.registerOnKeyDown,G=U.unregisterOnKeyDown;return(0,f.useEffect)((function(){return function(){G(F)}}),[G,F]),H(F,(function(e,n,t){null!==j&&(n[kn.QK]?y((function(e){return 0===e?2:e-1})):n[kn.DY]&&y((function(e){return 2===e?0:e+1})))}),[j,y]),(0,S.jsx)(gn.Z,{onClickOutside:function(){return y(null)},open:!0,style:{position:"relative"},children:(0,S.jsxs)(Z.ZP,{children:[(0,S.jsxs)("div",{style:{position:"relative"},children:[(0,S.jsx)(R.ZP,wn(wn({},Zn.a),{},{noBackground:0!==j,onClick:function(){return y((function(e){return 0===e?null:0}))},onMouseEnter:function(){return y((function(e){return null!==e?0:null}))},ref:k,children:(0,S.jsx)(C.ZP,{children:"File"})})),(0,S.jsx)(xn.Z,{items:D,onClickCallback:function(){return y(null)},open:0===j,parentRef:k,uuid:"FileHeaderMenu/file_items"})]}),(0,S.jsxs)("div",{style:{position:"relative"},children:[(0,S.jsx)(R.ZP,wn(wn({},Zn.a),{},{noBackground:2!==j,onClick:function(){return y((function(e){return 2===e?null:2}))},onMouseEnter:function(){return y((function(e){return null!==e?2:null}))},ref:w,children:(0,S.jsx)(C.ZP,{children:"Edit"})})),(0,S.jsx)(xn.Z,{items:A,onClickCallback:function(){return y(null)},open:2===j,parentRef:w,uuid:"FileHeaderMenu/edit_items"})]}),(0,S.jsxs)("div",{style:{position:"relative"},children:[(0,S.jsx)(R.ZP,wn(wn({},Zn.a),{},{noBackground:1!==j,onClick:function(){return y((function(e){return 1===e?null:1}))},onMouseEnter:function(){return y((function(e){return null!==e?1:null}))},ref:P,children:(0,S.jsx)(C.ZP,{children:"Run"})})),(0,S.jsx)(xn.Z,{items:B,onClickCallback:function(){return y(null)},open:1===j,parentRef:P,uuid:"FileHeaderMenu/run_items"})]}),W.qL.INTEGRATION!==(null===s||void 0===s?void 0:s.type)&&(null===T||void 0===T?void 0:T(M.NOTEBOOK_BLOCK_OUTPUT_SPLIT_VIEW))&&(0,S.jsxs)("div",{style:{position:"relative"},children:[(0,S.jsx)(R.ZP,wn(wn({},Zn.a),{},{noBackground:3!==j,onClick:function(){return y((function(e){return 3===e?null:3}))},onMouseEnter:function(){return y((function(e){return null!==e?3:null}))},ref:_,children:(0,S.jsx)(C.ZP,{children:"View"})})),(0,S.jsx)(xn.Z,{items:N,onClickCallback:function(){return y(null)},open:3===j,parentRef:_,uuid:"FileHeaderMenu/viewItems"})]}),(null===T||void 0===T?void 0:T(M.COMPUTE_MANAGEMENT))&&(0,S.jsxs)("div",{style:{position:"relative"},children:[(0,S.jsx)(R.ZP,wn(wn({},Zn.a),{},{noBackground:4!==j,onClick:function(){return y((function(e){return 4===e?null:4}))},onMouseEnter:function(){return y((function(e){return null!==e?4:null}))},ref:E,children:(0,S.jsx)(C.ZP,{children:"Compute"})})),(0,S.jsx)(xn.Z,{items:L,onClickCallback:function(){return y(null)},open:4===j,parentRef:E,uuid:"FileHeaderMenu/viewItems"})]}),t]})})},En=t(69616),In=t(89706),Tn=t(67355),Mn=t(70613),Dn=t(21764),Rn=t(28071),Bn=t(65956),An=t(23657),Nn=t(8970),Ln=t(47041),Fn=p.default.div.withConfig({displayName:"indexstyle__MenuStyle",componentId:"sc-1bixraz-0"})(["",";border-radius:","px;max-height:","px;min-width:","px;overflow:auto;position:absolute;right:0;",""],Ln.w5,Ee.n_,60*w.iI,70*w.iI,(function(e){return"\n background-color: ".concat((e.theme.background||Se.Z.background).panel,";\n border: 1px solid ").concat((e.theme.interactive||Se.Z.interactive).defaultBorder,";\n ")}));function Un(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Hn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Un(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Un(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Wn=2*w.iI,Gn={default:!0,monospace:!0,small:!0};var zn,Kn,Vn=function(){var e=(0,f.useRef)(null),n=(0,ne.VI)(null,{},[],{uuid:"ClusterSelection"}),t=(0,r.Z)(n,1)[0],i=(0,f.useState)(!1),o=i[0],l=i[1],u=(0,An.Z)({clustersRefreshInterval:5e3,includeAllStates:o}),c=(u.activeCluster,u.clusters),s=u.clustersLoading,a=u.computeService,d=u.fetchComputeClusters,p=(0,f.useState)(null),h=p[0],m=p[1],b=(0,v.Db)(V.ZP.compute_clusters.compute_services.useCreate(null===a||void 0===a?void 0:a.uuid),{onSuccess:function(e){return(0,ee.wD)(e,{callback:function(){d()},onErrorCallback:function(e,n){return t({errors:n,response:e})}})}}),g=(0,r.Z)(b,2),x=g[0],j=g[1].isLoading,k=(0,v.Db)((function(e){return V.ZP.compute_clusters.compute_services.useUpdate(null===a||void 0===a?void 0:a.uuid,null===e||void 0===e?void 0:e.id)({compute_cluster:(0,ye.GL)(e,["active"])})}),{onSuccess:function(e){return(0,ee.wD)(e,{callback:function(){d(),m(null)},onErrorCallback:function(e){var n=e.error,t=n.errors,i=n.exception,o=n.message,r=n.type;Dn.Am.error((null===t||void 0===t?void 0:t.error)||i||o,{position:Dn.Am.POSITION.BOTTOM_RIGHT,toastId:r})}})}}),P=(0,r.Z)(k,2),_=P[0],E=P[1].isLoading,I=(0,f.useMemo)((function(){return(null===c||void 0===c?void 0:c.length)||0}),[c]),T=(0,f.useMemo)((function(){return(0,S.jsx)(R.ZP,{beforeIcon:(0,S.jsx)(q.NO,{size:Wn}),compact:I>=1,loading:j,onClick:function(){return x()},primary:!0,small:I>=1,children:"Launch cluster"})}),[I,x,j]),M=(0,f.useMemo)((function(){var n,t,i,o,r=h||{message:null,x:0,y:0},l=r.message,u=r.x,c=r.y,s=(0,S.jsx)(C.ZP,{default:!0,small:!0,children:l});return(0,S.jsx)("div",{ref:e,style:{hidden:!h,left:u-((null===e||void 0===e||null===(n=e.current)||void 0===n||null===(t=n.getBoundingClientRect())||void 0===t?void 0:t.width)||0),maxWidth:30*w.iI,position:"fixed",top:c-((null===e||void 0===e||null===(i=e.current)||void 0===i||null===(o=i.getBoundingClientRect())||void 0===o?void 0:o.height)||0),zIndex:9999},children:(0,S.jsx)(Bn.Z,{dark:!0,noPadding:!0,children:(0,S.jsxs)(O.Z,{p:1,children:[E&&(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(z.Z,{inverted:!0,small:!0}),(0,S.jsx)(O.Z,{mr:1}),s]}),!E&&s]})})})}),[E,h,m]);return(0,S.jsxs)(S.Fragment,{children:[M,(0,S.jsxs)(Fn,{children:[(0,S.jsx)(O.Z,{p:w.cd,children:(0,S.jsxs)(Z.ZP,{alignItems:"flex-start",justifyContent:"space-between",children:[(0,S.jsxs)(Z.ZP,{flexDirection:"column",children:[(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(C.ZP,{bold:!0,large:!0,children:s?"Clusters":(0,$._6)("cluster",I,!0)}),(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(O.Z,{mr:w.cd}),(0,S.jsx)(Oe.Z,{checked:o,compact:!0,onCheck:function(e){return l(e(o))}}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(C.ZP,{default:o,muted:!o,small:!0,children:"Include terminated clusters"})]})]}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsxs)(C.ZP,{default:!0,small:!0,children:[I>=1&&"Click a cluster to activate and use it for compute.",!I&&"Launch a new cluster to use for compute."]})}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsx)(Z.ZP,{alignItems:"center",children:(0,S.jsx)(R.ZP,{beforeIcon:(0,S.jsx)(q.AP,{default:!0}),default:!0,linkProps:{href:"/compute",as:"/compute?tab=".concat(Nn.uK.CLUSTERS)},noBackground:!0,noBold:!0,noBorder:!0,target:"_blank",noPadding:!0,openNewWindow:!0,small:!0,children:"Open compute mangement"})})})]}),(0,S.jsx)(O.Z,{mr:w.cd}),I>=1&&(0,S.jsx)(Z.ZP,{flexDirection:"column",children:T})]})}),(0,S.jsx)(y.Z,{light:!0}),(0,S.jsx)(gn.Z,{onClickOutside:function(){E||m(null)},open:!0,children:(0,S.jsx)(Pe.Z,{columnFlex:[null,null,null],columns:[{uuid:"ID"},{uuid:"State"},{label:function(){return""},rightAligned:!0,uuid:"Active"}],onClickRow:function(e,n){var t;if(!E){var i,o=null===c||void 0===c?void 0:c[e],r=null===o||void 0===o||null===(t=o.status)||void 0===t?void 0:t.state;null!==o&&void 0!==o&&o.active?i="Cluster ".concat(null===o||void 0===o?void 0:o.id," is already active."):[Rn.X.RUNNING,Rn.X.WAITING].includes(r)?(i="Activating cluster ".concat(null===o||void 0===o?void 0:o.id,"."),_(Hn(Hn({},o),{},{active:!0}))):i="\n Cluster ".concat(null===o||void 0===o?void 0:o.id," must be in a\n ").concat((0,$.vg)(Rn.X.WAITING)," or\n ").concat((0,$.vg)(Rn.X.RUNNING),"\n state to be activated and used for compute.\n "),m({message:i,x:n.clientX,y:n.clientY})}},rows:null===c||void 0===c?void 0:c.map((function(e){var n=e.active,t=e.id,i=e.status,o=null===i||void 0===i?void 0:i.state;return[(0,f.createElement)(C.ZP,Hn(Hn({},Gn),{},{key:"id"}),t),(0,S.jsx)(C.ZP,Hn(Hn({},Gn),{},{danger:[Rn.X.TERMINATED_WITH_ERRORS].includes(o),default:[Rn.X.STARTING].includes(o),muted:[Rn.X.TERMINATED].includes(o),success:[Rn.X.RUNNING,Rn.X.WAITING].includes(o),warning:[Rn.X.TERMINATING].includes(o),children:null!==i&&void 0!==i&&i.state?(0,$.vg)(null===i||void 0===i?void 0:i.state):null===i||void 0===i?void 0:i.state})),(0,S.jsx)(Z.ZP,{justifyContent:"flex-end",children:(0,S.jsx)(q.Fs,{muted:!n,size:Wn,success:n})},"active")]})),stickyHeader:!0,uuid:"ClusterSelection"})}),!s&&0===I&&(0,S.jsx)(O.Z,{p:w.cd,children:T}),s&&(0,S.jsx)(O.Z,{p:w.cd,children:(0,S.jsx)(z.Z,{inverted:!0,small:!0})})]})]})};!function(e){e.CREATE_NEW_CLUSTER="create_new_cluster",e.SET_ACTIVE_CLUSTER="set_active_cluster"}(zn||(zn={})),function(e){e.BOOTSTRAPPING="BOOTSTRAPPING",e.STARTING="STARTING",e.WAITING="WAITING"}(Kn||(Kn={}));var qn,Yn=t(89308),Xn=t(89515),Qn=t(78688),Jn=t(98464);!function(e){e.EMR="emr"}(qn||(qn={}));var $n=t(26032),et=t(74260),nt=t(89538);function tt(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function it(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?tt(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):tt(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ot=function(e){var n=e.children,t=e.isBusy,i=e.kernel,l=e.pipeline,u=(e.restartKernel,e.savePipelineContent,e.setErrors),c=e.setRunningBlocks,s=e.updatePipelineMetadata,a=(0,h.useRouter)(),d=(0,yn.Z)(),m=(d.featureEnabled,d.featureUUIDs,d.sparkEnabled),b=(0,An.Z)({clustersRefreshInterval:5e3,computeServiceRefreshInterval:5e3,connectionsRefreshInterval:5e3}),g=b.activeCluster,x=b.clusters,y=(b.clustersLoading,b.computeService),_=b.computeServiceUUIDs,E=b.connections,I=b.connectionsLoading,T=b.fetchAll,M=b.fetchComputeClusters,D=(b.setupComplete,(0,f.useContext)(p.ThemeContext)),R=i||{},B=R.alive,A=R.usage,N=(0,f.useState)(qn.EMR),L=N[0],F=(N[1],(0,f.useState)(!1)),H=F[0],G=F[1],K=(0,f.useState)(!1),Y=K[0],X=K[1],Q=(0,f.useState)(!1),J=Q[0],ne=Q[1],te=(0,f.useState)(!1),ie=te[0],oe=te[1],re=(0,f.useRef)(null),le=V.ZP.clusters.detail(L,{},{revalidateOnFocus:!1}),ue=le.data,ce=le.mutate,se=(0,f.useMemo)((function(){var e;return(null===ue||void 0===ue||null===(e=ue.cluster)||void 0===e?void 0:e.clusters)||[]}),[ue]),ae=(0,f.useMemo)((function(){return(0,Te.sE)(se,(function(e){return e.is_active}))}),[se]),de=(0,v.Db)(V.ZP.clusters.useUpdate(L),{onSuccess:function(e){return(0,ee.wD)(e,{callback:function(){ce()},onErrorCallback:function(e,n){return u({errors:n,response:e})}})}}),pe=(0,r.Z)(de,1)[0],fe=V.ZP.spark_applications.list({},{},{pauseFetch:!m}).data,ve=(0,f.useMemo)((function(){return null===fe||void 0===fe?void 0:fe.spark_applications}),[fe]),he="KernelStatus",me=(0,On.y)(),be=(me.registerOnKeyDown,me.unregisterOnKeyDown);(0,f.useEffect)((function(){return function(){be(he)}}),[be,he]);var ge=(0,f.useMemo)((function(){return null===A||void 0===A?void 0:A.pid}),[null===A||void 0===A?void 0:A.pid]),xe=(0,Jn.Z)(ge),je=(0,nt.dd)((function(){return(0,S.jsx)(Xn.Z,{cancelText:"Close",centerOnScreen:!0,confirmText:"Don't show again",neutral:!0,onCancel:Pe,onClick:function(){(0,pn.t8)(pn.DU,1),Pe()},subtitle:"You may need to refresh your page to continue using the notebook. Unexpected kernel restarts may be caused by your kernel running out of memory.",title:"The kernel has restarted",width:34*w.iI})}),{},[],{background:!0,uuid:"restart_kernel_warning"}),ke=(0,r.Z)(je,2),Ze=ke[0],Pe=ke[1];(0,f.useEffect)((function(){var e=(0,pn.U2)(pn.DU,0);ge!==xe&&t&&!e&&(Ze(),c([]))}),[t,ge,xe,c,Ze]);var Oe=(0,f.useMemo)((function(){return[W.qL.PYTHON,W.qL.PYSPARK].includes(null===l||void 0===l?void 0:l.type)}),[l]),Ce=(0,f.useMemo)((function(){return(0,S.jsx)(j.Z,{color:t?(D||Se.Z).borders.info:B?(D||Se.Z).borders.success:(D||Se.Z).borders.danger,size:w.iI})}),[B,t,D]),we=(0,v.Db)((function(e){return V.ZP.compute_clusters.compute_services.useUpdate(null===y||void 0===y?void 0:y.uuid,null===e||void 0===e?void 0:e.id)({compute_cluster:(0,ye.GL)(e,["active"])})}),{onSuccess:function(e){return(0,ee.wD)(e,{callback:function(){M()},onErrorCallback:function(e){var n=e.error,t=n.errors,i=n.exception,o=n.message,r=n.type;Dn.Am.error((null===t||void 0===t?void 0:t.error)||i||o,{position:Dn.Am.POSITION.BOTTOM_RIGHT,toastId:r})}})}}),_e=(0,r.Z)(we,2),Ee=_e[0],Ie=(_e[1].isLoading,(0,f.useMemo)((function(){if(!m||!Oe||_.AWS_EMR!==(null===y||void 0===y?void 0:y.uuid)||W.qL.PYSPARK!==(null===l||void 0===l?void 0:l.type))return null;var e=null===E||void 0===E?void 0:E.find((function(e){var n=e.uuid;return et.IK.OBSERVABILITY===n}));if(!e)return null;var n=e.name,t=e.state,i=e.status_calculated,o=e.uuid,r=[$n.i.ACTIVE].includes(t),u=([$n.i.INACTIVE].includes(t),[et.br.COMPLETED].includes(i)),c={muted:!0,warning:!1},s=n||o;u&&(r?(s="Observability enabled",c.muted=!1):s="SSH tunnel not connected");var d=(0,S.jsx)(gn.Z,{onClickOutside:function(e){(0,Ne.j)(e),oe(!1)},open:ie,children:(0,S.jsx)(Fn,{children:(0,S.jsx)(Yn.Z,{actionsOnly:u,computeService:y,computeConnections:[e],contained:!1,hideDetails:!0,fetchAll:T,onClickStep:function(e){a.push("/compute?tab=".concat(e))},small:!0})})}),p=(0,S.jsx)(q.Fs,{danger:[et.br.ERROR].includes(i),muted:[et.br.INCOMPLETE].includes(i),success:u&&r});return(0,S.jsxs)("div",{style:{position:"relative"},children:[(0,S.jsx)(U.ZP,it(it({beforeElement:p,blackBorder:!0,compact:!0,inline:!0,noHover:I,onClick:function(e){(0,Ne.j)(e),ie||oe(!0),ne(!1)},uuid:"Pipeline/ComputeConnectionStatus"},c),{},{children:s})),d]})}),[ie,y,E,I,T,l,ne,oe,Oe])),Me=(0,f.useMemo)((function(){if(!m||!Oe)return null;var e,n,t,i;if(_.AWS_EMR===(null===y||void 0===y?void 0:y.uuid)){var o,r=null===y||void 0===y||null===(o=y.setup_steps)||void 0===o?void 0:o.find((function(e){var n=e.uuid;return et.IK.SETUP===n})),u=null===r||void 0===r?void 0:r.status_calculated;if(W.qL.PYSPARK!==(null===l||void 0===l?void 0:l.type))return null;if(g){var c,s=null===g||void 0===g||null===(c=g.status)||void 0===c?void 0:c.state;t=(0,S.jsxs)(C.ZP,{monospace:!0,children:[null===g||void 0===g?void 0:g.id," ",s&&![Rn.X.RUNNING,Rn.X.WAITING].includes(s)&&(0,$.J3)(s)]}),i=(0,S.jsx)(q.Fs,{danger:[Rn.X.TERMINATED_WITH_ERRORS].includes(s),default:[Rn.X.STARTING].includes(s),muted:[Rn.X.TERMINATED].includes(s),success:[Rn.X.RUNNING,Rn.X.WAITING].includes(s),warning:[Rn.X.TERMINATING].includes(s)})}else u?(t=null!==x&&void 0!==x&&x.length?"Select a compute cluster":"Launch a new cluster",i=(0,S.jsx)(q.Fs,{warning:!0})):(e=(0,S.jsx)(gn.Z,{onClickOutside:function(e){(0,Ne.j)(e),ne(!1)},open:J,children:(0,S.jsx)(Fn,{children:(0,S.jsx)(Qn.Z,{contained:!1,onClickStep:function(e){a.push("/compute?tab=".concat(e))},setupSteps:null===y||void 0===y?void 0:y.setup_steps,small:!0})})}),n=function(e){(0,Ne.j)(e),J||ne(!0),oe(!1)},t="Compute setup incomplete",i=(0,S.jsx)(q.uy,{danger:!0}));(g||u)&&(e=(0,S.jsx)(gn.Z,{onClickOutside:function(e){(0,Ne.j)(e),ne(!1)},open:J,children:(0,S.jsx)(Vn,{})}),n=function(e){(0,Ne.j)(e),J||ne(!0),oe(!1),oe(!1)})}else if(_.STANDALONE_CLUSTER===(null===y||void 0===y?void 0:y.uuid))if(fe)if(null!==ve&&void 0!==ve&&ve.length){if((null===ve||void 0===ve?void 0:ve.length)>=1){var d,p,f=null===ve||void 0===ve?void 0:ve[0];t=[null===f||void 0===f?void 0:f.name,null===f||void 0===f||null===(d=f.attempts)||void 0===d||null===(p=d[0])||void 0===p?void 0:p.app_spark_version].filter((function(e){return e})).join(" "),i=(0,S.jsx)(q.Fs,{success:!0})}}else n=function(){return a.push("/compute")},t="Compute unavailable",i=(0,S.jsx)(q.Fs,{danger:!0});else t="Loading compute",i=(0,S.jsx)(z.Z,{inverted:!0,small:!0});return(0,S.jsxs)("div",{style:{position:"relative"},children:[(0,S.jsx)(U.ZP,it(it({beforeElement:i,blackBorder:!0,compact:!0,inline:!0,noHover:!fe||(null===ve||void 0===ve?void 0:ve.length)>=1,onClick:n,uuid:"Pipeline/ComputeStatus"},{muted:!1,warning:!1}),{},{children:t})),e]})}),[g,J,x,y,_,fe,l,a,ne,oe,ve,m,Oe]),De=(0,f.useMemo)((function(){return(0,S.jsx)("div",{ref:re,style:{position:"relative"},children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(null===l||void 0===l?void 0:l.type)===W.qL.PYSPARK&&!m&&(0,S.jsxs)(O.Z,{mr:w.cd,children:[(0,S.jsxs)(P.Z,{muted:!!ae,onClick:function(){return G(!0)},preventDefault:!0,sameColorAsText:!ae,underline:!ae,children:[ae&&ae.id,!ae&&"Select cluster"]}),(0,S.jsx)(gn.Z,{disableEscape:!0,onClickOutside:function(){return G(!1)},open:H,children:(0,S.jsx)(xn.Z,{items:[{isGroupingTitle:!0,label:function(){return"Select cluster"},uuid:"select_cluster"}].concat((0,o.Z)(se.map((function(e){var n=e.id,t=e.is_active,i=e.status;return{label:function(){return(0,S.jsxs)(Z.ZP,{alignItems:"center",fullWidth:!0,justifyContent:"space-between",children:[(0,S.jsx)(k.Z,{flex:1,children:(0,S.jsx)(C.ZP,{muted:!t&&Kn.WAITING!==i,children:n})}),t&&(0,S.jsx)(q.Jr,{size:2*w.iI,success:!0}),!t&&(0,S.jsx)(C.ZP,{monospace:!0,muted:!0,children:i})]})},onClick:t||Kn.WAITING!==i?null:function(){return pe({cluster:{id:n}})},uuid:n}})))),onClickCallback:function(){return G(!1)},open:H,parentRef:re,uuid:"KernelStatus/select_cluster",width:40*w.iI})})]}),(0,S.jsx)(U.ZP,{beforeElement:Ce,blackBorder:!0,compact:!0,inline:!0,onClick:function(){return X(!0)},uuid:"Pipeline/KernelStatus/kernel",children:W.RH[(null===l||void 0===l?void 0:l.type)||W.qL.PYTHON]}),(0,S.jsx)(gn.Z,{disableEscape:!0,onClickOutside:function(){return X(!1)},open:Y,children:(0,S.jsx)(xn.Z,{items:[{isGroupingTitle:!0,label:function(){return"Select kernel"},uuid:"select_kernel"}].concat((0,o.Z)(Object.keys(W.a_).filter((function(e){return(null===l||void 0===l?void 0:l.type)!=e})).map((function(e){return{label:function(){return W.RH[e]||e},onClick:function(){return s(null===l||void 0===l?void 0:l.name,e)},uuid:e}})))),onClickCallback:function(){return X(!1)},open:Y,parentRef:re,rightOffset:0,uuid:"KernelStatus/select_kernel",width:25*w.iI})})]})})}),[B,se,t,l,ae,G,X,H,Y,Ce,D,Ee,pe,s]);return(0,S.jsxs)(Z.ZP,{alignItems:"center",fullHeight:!0,justifyContent:"space-between",children:[(0,S.jsx)(Z.ZP,{alignItems:"center",fullHeight:!0,justifyContent:"flex-start",children:n}),(0,S.jsx)(O.Z,{px:w.cd,children:(0,S.jsx)(k.Z,{alignItems:"center",children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[De,Ie&&(0,S.jsx)(O.Z,{ml:1,children:Ie}),Me&&(0,S.jsx)(O.Z,{ml:1,children:Me})]})})})]})},rt=t(48339),lt=t(12691),ut=t.n(lt),ct=t(65976),st=t(46510),at=t(92709),dt=p.default.div.withConfig({displayName:"indexstyle__ScrollbarContainerStyle",componentId:"sc-174iy66-0"})(["position:fixed;"," "," "," ",""],(function(e){return"\n border-radius: ".concat(Ee.n_,"px;\n background: ").concat((e.theme.background||Se.Z.background).scrollbarTrack,";\n ")}),(function(e){return!e.invisible&&"\n width: ".concat(Ln.nn,"px;\n ")}),(function(e){return"undefined"!==typeof e.height&&"\n height: ".concat(e.height,"px;\n ")}),(function(e){return"undefined"!==typeof e.left&&"\n left: ".concat(e.left,"px;\n ")})),pt=p.default.div.withConfig({displayName:"indexstyle__ScrollCursorStyle",componentId:"sc-174iy66-1"})(["position:fixed;z-index:3;"," "," "," "," ",""],(function(e){return"\n border-radius: ".concat(Ee.TR,"px;\n background: ").concat((e.theme.background||Se.Z.background).scrollbarThumb,";\n\n &:hover {\n background: ").concat((e.theme.background||Se.Z.background).scrollbarThumbHover,";\n }\n ")}),(function(e){return!e.invisible&&"\n width: ".concat(Ln.nn,"px;\n ")}),(function(e){return(null===e||void 0===e?void 0:e.selected)&&"\n background: ".concat((e.theme.background||Se.Z.background).scrollbarThumbHover,";\n ")}),(function(e){return"undefined"!==typeof e.height&&"\n height: ".concat(e.height,"px;\n ")}),(function(e){return"undefined"!==typeof e.top&&"\n top: ".concat(e.top,"px;\n ")})),ft=t(74052),vt=t(61709);function ht(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function mt(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ht(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ht(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var bt=function(e){var n,t,i=e.blocks,r=e.columnIndex,l=e.columns,u=e.disabled,c=e.eventNameRefsMapping,s=e.invisible,a=e.mainContainerRect,d=e.rightAligned,p=e.scrollTogether,v=e.setCursorHeight,h=(0,f.useRef)(null),m=(0,f.useRef)(null),b=((0,f.useMemo)((function(){return null===i||void 0===i?void 0:i.map((function(e){return e.uuid}))}),[i]),(0,f.useState)(null)),g=b[0],x=b[1],j=(0,f.useState)(null),y=j[0],k=j[1],Z=(0,f.useState)(null),P=(Z[0],Z[1]),O=(0,f.useState)(null),C=O[0],w=O[1],_=a||{},E=_.height,I=_.width,T=_.x,M=_.y,D=(0,f.useMemo)((function(){return(0,Te.Sm)(g||[])}),[g]),R=(0,f.useCallback)((function(){return D>E?E*(E/D):0}),[E,D]),B=(0,f.useMemo)((function(){return R()}),[R]);(0,f.useMemo)((function(){v(B)}),[B,v]);var A=(0,f.useCallback)((function(e){if(B){var n,t,i=null===m||void 0===m||null===(n=m.current)||void 0===n||null===(t=n.getBoundingClientRect())||void 0===t?void 0:t.y;e<=i?e=i:e+B>=M+E&&(e=M+E-B),null!==h&&void 0!==h&&h.current&&(h.current.style.top="".concat(e,"px"))}}),[B,E,h,M]),N=(0,f.useCallback)((function(){if(!u){var e=new CustomEvent(at.m$,{detail:{columnScrolling:r,refCursor:h,refCursorContainer:m,refsMappings:Object.values(c||{})}});window.dispatchEvent(e)}}),[r,u,c]);(0,f.useEffect)((function(){P(!0)}),[]);var L=(0,f.useCallback)((function(e){var n,t,i=e.blockIndex,o=e.heights,r=e.y,l=null===m||void 0===m||null===(n=m.current)||void 0===n?void 0:n.getBoundingClientRect(),u=null===h||void 0===h||null===(t=h.current)||void 0===t?void 0:t.getBoundingClientRect(),c=(0,Te.Sm)((null===o||void 0===o?void 0:o.slice(0,i))||[]),s=(0,Te.Sm)(o||[])||0,a=(0,vt.IT)(o,s,E);return(c-(r-(null===l||void 0===l?void 0:l.y)))/s/(1-a)*((null===l||void 0===l?void 0:l.height)-(null===u||void 0===u?void 0:u.height))+(null===l||void 0===l?void 0:l.y)}),[]),F=(0,f.useCallback)((function(){var e=Object.values(c||{}),n=null===i||void 0===i?void 0:i.map((function(n){var t=(0,ft.zv)(n);return Math.max.apply(Math,(0,o.Z)(e.map((function(e){var n,i,o,r=null===e||void 0===e||null===(n=e.current)||void 0===n?void 0:n[t];return(null===r||void 0===r||null===(i=r.current)||void 0===i||null===(o=i.getBoundingClientRect())||void 0===o?void 0:o.height)||0}))))}));if(null!==n&&void 0!==n&&n.every((function(e){return"undefined"!==typeof e&&!isNaN(e)}))){if(x(n),y){var t=L(mt(mt({},y),{},{heights:n}));A(t)}N()}}),[i,L,r,N,c,y,x]);(0,f.useEffect)((function(){var e;return null===(e=Object.keys(c||{}))||void 0===e||e.forEach((function(e){window.addEventListener(e,F)})),function(){var e;null===(e=Object.keys(c||{}))||void 0===e||e.forEach((function(e){window.removeEventListener(e,F)}))}}),[c,F]);var U=(0,f.useCallback)((function(){N(),F()}),[N,F]);(0,f.useEffect)((function(){return window.addEventListener(at.Qj,U),function(){window.removeEventListener(at.Qj,U)}}),[U]),(0,f.useEffect)((function(){var e=function(e){var n,t,o=e.detail.block,r=null===i||void 0===i?void 0:i.findIndex((function(e){return e.uuid===(null===o||void 0===o?void 0:o.uuid)})),l=L({blockIndex:r,heights:g,y:null===m||void 0===m||null===(n=m.current)||void 0===n||null===(t=n.getBoundingClientRect())||void 0===t?void 0:t.y});A(l),N()};return window.addEventListener(at.Em,e),function(){window.removeEventListener(at.Em,e)}}),[i,L,N,g,A]),(0,f.useEffect)((function(){u||F()}),[u,p,F]),(0,f.useEffect)((function(){var e=function(e){var n=e.detail;if(r===(null===n||void 0===n?void 0:n.columnIndex)){var t=L(mt(mt({},n),{},{heights:g}));A(t),N(),null!==n&&void 0!==n&&n.lockScroll&&k(n)}};return window.addEventListener(at.Wf,e),function(){window.removeEventListener(at.Wf,e)}}),[r,E,g,k,A,L,M]);var H=(0,f.useCallback)((function(e){var n=e.pageX,t=e.pageY;if(n>=T&&n<=T+I&&t>=M&&t<=M+E){var i=I/l;if(p||n>=T+i*r&&n<T+i*(r+1)){var o,u=null===h||void 0===h||null===(o=h.current)||void 0===o?void 0:o.getBoundingClientRect(),c=((null===u||void 0===u?void 0:u.y)||0)+((null===e||void 0===e?void 0:e.deltaY)||0);A(c),N(),k(null)}}}),[r,l,N,E,p,A,I,T,M]),W=(0,f.useCallback)((function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(C||null!=n){var t;e&&(null===e||void 0===e||e.preventDefault());if(null===n){var i,o=null===C||void 0===C?void 0:C.scrollTop,r=null===C||void 0===C||null===(i=C.event)||void 0===i?void 0:i.clientY;t=o+((null===e||void 0===e?void 0:e.clientY)-r)}else t=n;A(t),N(),k(null)}}),[N,C,A]);return(0,f.useEffect)((function(){var e,n;A(null===h||void 0===h||null===(e=h.current)||void 0===e||null===(n=e.getBoundingClientRect())||void 0===n?void 0:n.y)}),[E,A]),(0,f.useEffect)((function(){var e=function(){w(null)};return B&&(window.addEventListener("mousemove",W),window.addEventListener("wheel",H),window.addEventListener("mouseup",e)),function(){window.removeEventListener("mousemove",W),window.removeEventListener("wheel",H),window.removeEventListener("mouseup",e)}}),[B,W,H]),(0,S.jsx)(dt,{height:E,invisible:s,left:d?T+I-Ln.nn:void 0,ref:m,children:(0,S.jsx)(pt,{height:B,invisible:s,onMouseDown:function(e){var n,t;return w({event:e,scrollTop:null===h||void 0===h||null===(n=h.current)||void 0===n||null===(t=n.getBoundingClientRect())||void 0===t?void 0:t.y})},ref:h,selected:!!C,top:null===m||void 0===m||null===(n=m.current)||void 0===n||null===(t=n.getBoundingClientRect())||void 0===t?void 0:t.y})})},gt=t(68192),xt=t(53779);var jt=function(e){var n=e.blocks,t=(e.dbtModelName,e.onClose),i=e.onOpenFile,o=e.onSelectBlockFile,r=(e.setDbtModelName,(0,f.useState)(!1)),l=(r[0],r[1],(0,f.useState)(null)),u=(l[0],l[1],(0,f.useMemo)((function(){return(0,Te.HK)(n,(function(e){return e.configuration.file_path}))}),[n]),(0,gt.Z)({disableContextMenu:!0,onOpenFile:function(e,n){n||i(e)},onSelectBlockFile:o,query:{pattern:encodeURIComponent("\\.sql$")},uuid:"FileSelectorPopup/dbt"}).browser);return(0,S.jsxs)(xt.eD,{children:[(0,S.jsxs)(xt.X$,{children:[(0,S.jsx)(k.Z,{alignItems:"center",children:(0,S.jsx)(C.ZP,{disableWordBreak:!0,monospace:!0,children:"Select dbt model or snapshot file"})}),(0,S.jsx)(R.ZP,{iconOnly:!0,onClick:t,children:(0,S.jsx)(q.x8,{muted:!0})})]}),(0,S.jsx)(xt.C,{children:u})]})},yt=t(32013),kt=t(98777),Zt=t(39457);function Pt(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Ot(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Pt(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Pt(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Ct="4px",wt={lightBackground:!0,muted:!0,relativePosition:!0},_t=[we.Zj.BIGQUERY,we.Zj.DELTA_LAKE_S3];var St=function(e){var n=e.bookmarkValues,t=e.destination,i=e.isLoadingLoadSampleData,o=e.isLoadingUpdateDestinationBlockState,u=e.loadSampleData,c=e.source,s=e.stream,a=e.streams,d=e.updateAllStreams,p=e.updateDestinationBlockState,v=e.updateMetadataForColumns,h=e.updateSchemaProperty,m=e.updateStream,b=(0,f.useRef)(null),g=s.bookmark_properties,j=s.destination_table,y=void 0===j?"":j,P=s.key_properties,_=s.metadata,E=s.partition_keys,I=s.replication_method,T=s.run_in_parallel,M=s.schema.properties,D=s.tap_stream_id,B=s.unique_constraints,A=s.unique_conflict_method,N=(0,f.useState)(y),L=N[0],F=N[1],U=(0,f.useState)(!1),H=U[0],W=U[1],z=(0,f.useState)(null),V=z[0],q=z[1],Y=(0,f.useState)(!!t),X=Y[0],Q=Y[1],J=(0,f.useState)((0,l.Z)({},D,n||{})),ee=J[0],ne=J[1],te=(0,Jn.Z)(D);(0,f.useEffect)((function(){te!==D&&(F(y),q(null))}),[y,I,D,te,A]),(0,f.useEffect)((function(){var e=null===ee||void 0===ee?void 0:ee[D];(null===g||void 0===g?void 0:g.length)>0&&((0,ye.Qr)(e)||!(0,ye.Xy)(n,e))&&ne((function(e){return Ot(Ot({},e),{},(0,l.Z)({},D,n))}))}),[null===g||void 0===g?void 0:g.length,n,D]);var ie=(0,f.useMemo)((function(){return(0,Te.HK)(_,(function(e){return e.breadcrumb.join("/")}))}),[_]),oe=(0,f.useMemo)((function(){var e;return null===(e=(0,Te.sE)(_,(function(e){return 0===e.breadcrumb.length})))||void 0===e?void 0:e.metadata}),[_]),re=(0,f.useMemo)((function(){return oe[we.fe.KEY_PROPERTIES]||[]}),[oe]),le=(0,f.useMemo)((function(){return oe[we.fe.REPLICATION_KEYS]||[]}),[oe]),ue=_t.includes(t),se=a.length>1,de=(0,f.useCallback)((function(e){var n=Ot({},null===ee||void 0===ee?void 0:ee[D]);n.hasOwnProperty(e)&&delete n[e],ne((function(e){return Ot(Ot({},e),{},(0,l.Z)({},D,Ot({},n)))})),p({block:{bookmark_values:n,destination_table:L,tap_stream_id:D}})}),[ee,L,D,p]),pe=(0,f.useMemo)((function(){var e=[],n=[],i=(0,Te.mr)(Object.entries(M)).map((function(i,o){var l=(0,r.Z)(i,2),u=l[0],c=l[1],s=c.anyOf,a=void 0===s?[]:s,p=c.format,f=c.type,b=void 0===f?[]:f,j=new Set(Array.isArray(b)?b:[b]),y=new Set(j);a.forEach((function(e){var n=e.format,t=(e.items,e.type);Array.isArray(t)?t.forEach((function(e){j.add(e),y.add(e)})):(j.add(t),y.add(t),n&&y.add(n))}));var _=Array.from(j);p&&y.add(p);var I=(ie["properties/".concat(u)]||{}).metadata,T=(I.inclusion,I.selected);e.push(T),n.push(u);var M=we.D5.reduce((function(e,n){return _.indexOf(n)>=0||we.Xv===String(n)&&we.zS.DATE_TIME===p||we.zS.UUID===String(n)&&we.zS.UUID===p?e:e.concat((0,S.jsx)("option",{value:n,children:n},n))}),[]),A=_.findIndex((function(e){return e===we.RL.STRING})),N=[(0,S.jsx)(x.Z,{checked:T,onClick:function(){v(D,[u],{selected:!T})}},"".concat(D,"/").concat(u,"/selected")),(0,S.jsx)(C.ZP,{children:u},"".concat(D,"/").concat(u,"/name")),(0,S.jsxs)(Z.ZP,{children:[(0,S.jsx)(k.Z,{flex:1,children:(0,S.jsx)(Z.ZP,{alignItems:"center",flexWrap:"wrap",fullWidth:!0,children:_.map((function(e,n){return(0,S.jsx)(O.Z,{mb:1,mr:1,children:(0,S.jsx)(Ze.Z,{border:!0,label:p&&we.RL.STRING===e&&A===n?we.eL[p]:e,onClick:function(){var n={format:p,type:_.filter((function(n){return n!==e}))};we.zS.DATE_TIME!==p&&we.zS.UUID!==p||we.RL.STRING!==e||(n.format=null),h(D,u,n)},small:!0})},"".concat(D,"/").concat(u,"/").concat(e,"/").concat(n,"/chip"))}))})}),M.length>=1&&(0,S.jsxs)(G.Z,{compact:!0,onChange:function(e){var n=e.target.value,t={format:p,type:_};we.Xv===String(n)?(t.format=we.zS.DATE_TIME,t.type.push(we.RL.STRING)):we.zS.UUID===String(n)?(t.format=we.zS.UUID,t.type.push(we.RL.STRING)):t.type.push(n),h(D,u,t)},primary:!0,small:!0,value:"",width:10*w.iI,children:[(0,S.jsx)("option",{value:""}),M]})]},"".concat(D,"/").concat(u,"/type")),(0,S.jsx)(x.Z,{checked:!(null===B||void 0===B||!B.includes(u)),disabled:re.length>=1&&!re.includes(u),onClick:re.length>=1&&!re.includes(u)?null:function(){return m(D,(function(e){var n;return null!==(n=e.unique_constraints)&&void 0!==n&&n.includes(u)?e.unique_constraints=(0,Te.Od)(e.unique_constraints,(function(e){return u===e})):e.unique_constraints=[u].concat(e.unique_constraints||[]),e}))}},"".concat(D,"/").concat(u,"/unique")),(0,S.jsx)(x.Z,{checked:!(null===g||void 0===g||!g.includes(u)),disabled:le.length>=1&&!le.includes(u),onClick:le.length>=1&&!le.includes(u)?null:function(){return m(D,(function(e){var n;return null!==(n=e.bookmark_properties)&&void 0!==n&&n.includes(u)?(de(u),e.bookmark_properties=(0,Te.Od)(e.bookmark_properties,(function(e){return u===e}))):e.bookmark_properties=[u].concat(e.bookmark_properties||[]),e}))}},"".concat(D,"/").concat(u,"/bookmark")),(0,S.jsx)(x.Z,{checked:!(null===P||void 0===P||!P.includes(u)),onClick:function(){return m(D,(function(e){var n;return null!==(n=e.key_properties)&&void 0!==n&&n.includes(u)?e.key_properties=(0,Te.Od)(e.key_properties,(function(e){return u===e})):e.key_properties=[u].concat(e.key_properties||[]),e}))}},"".concat(D,"/").concat(u,"/key_property"))];if(ue){var L=t!==we.Zj.DELTA_LAKE_S3,F=L&&(re.includes(u)||!y.has(we.zS.DATE_TIME));N.push((0,S.jsx)(x.Z,{checked:!(null===E||void 0===E||!E.includes(u)),disabled:F,onClick:F?null:function(){return m(D,(function(e){var n,t;null!==(n=e.partition_keys)&&void 0!==n&&n.includes(u)?e.partition_keys=(0,Te.Od)(e.partition_keys,(function(e){return u===e})):L&&1===(null===(t=e.partition_keys)||void 0===t?void 0:t.length)?e.partition_keys=[u]:e.partition_keys=[u].concat(e.partition_keys||[]);return e}))}},"".concat(D,"/").concat(u,"/partition_key")))}if(se){var U=V===o;N.push((0,S.jsx)(R.ZP,{compact:!0,disabled:U,onClick:function(){q(o),setTimeout((function(){return q(null)}),2e3),d((function(e){var n,t;if((null===e||void 0===e?void 0:e.tap_stream_id)!==D&&null!==e&&void 0!==e&&null!==(n=e.schema)&&void 0!==n&&null!==(t=n.properties)&&void 0!==t&&t[u]){var i,o,r,l,c,s,a,d,f;e.schema.properties[u]={format:p||null,type:_};var v=null===(i=(0,Te.sE)((null===e||void 0===e?void 0:e.metadata)||[],(function(e){return 0===e.breadcrumb.length})))||void 0===i?void 0:i.metadata,h=v[we.fe.REPLICATION_KEYS]||[],m=v[we.fe.KEY_PROPERTIES]||[];null===B||void 0===B||!B.includes(u)||null!==e&&void 0!==e&&null!==(o=e.unique_constraints)&&void 0!==o&&o.includes(u)||!m.includes(u)?null!==B&&void 0!==B&&B.includes(u)||null===e||void 0===e||null===(r=e.unique_constraints)||void 0===r||!r.includes(u)||(e.unique_constraints=(0,Te.Od)(e.unique_constraints,(function(e){return u===e}))):e.unique_constraints=[u].concat(e.unique_constraints||[]),null===g||void 0===g||!g.includes(u)||null!==e&&void 0!==e&&null!==(l=e.bookmark_properties)&&void 0!==l&&l.includes(u)||!h.includes(u)&&0!==h.length?null!==g&&void 0!==g&&g.includes(u)||null===e||void 0===e||null===(c=e.bookmark_properties)||void 0===c||!c.includes(u)||(e.bookmark_properties=(0,Te.Od)(e.bookmark_properties,(function(e){return u===e}))):e.bookmark_properties=[u].concat(e.bookmark_properties||[]),null===P||void 0===P||!P.includes(u)||null!==e&&void 0!==e&&null!==(s=e.key_properties)&&void 0!==s&&s.includes(u)?null!==P&&void 0!==P&&P.includes(u)||null===e||void 0===e||null===(a=e.key_properties)||void 0===a||!a.includes(u)||(e.key_properties=(0,Te.Od)(e.key_properties,(function(e){return u===e}))):e.key_properties=[u].concat(e.key_properties||[]),null===E||void 0===E||!E.includes(u)||null!==e&&void 0!==e&&null!==(d=e.partition_keys)&&void 0!==d&&d.includes(u)?null!==E&&void 0!==E&&E.includes(u)||null===e||void 0===e||null===(f=e.partition_keys)||void 0===f||!f.includes(u)||(e.partition_keys=(0,Te.Od)(e.partition_keys,(function(e){return u===e}))):e.partition_keys=[u].concat(e.partition_keys||[])}return Ot({},e)}))},pill:!0,secondary:!0,children:(0,S.jsx)(C.ZP,{success:U,children:U?"Applied!":"Apply"})}))}return N})),o=e.every((function(e){return e})),l=[null,2,1,null,null,null],u=[{label:function(){return(0,S.jsx)(x.Z,{checked:o,onClick:function(){v(D,n,{selected:!o})}})},uuid:"Selected"},{uuid:"Name"},{uuid:"Type"},{fitTooltipContentWidth:!0,tooltipMessage:"Used to avoid adding duplicate records",uuid:"Unique"},{tooltipMessage:"Used to keep track of sync progress and incrementally sync new records (e.g. a column indicating when a record was last updated)",tooltipWidth:305,uuid:"Bookmark"},{fitTooltipContentWidth:!0,tooltipMessage:"Used to create primary key for destination table",uuid:"Key prop"}];return ue&&(l.push(null),u.push({uuid:"Partition key"})),se&&(l.push(null),u.push({tooltipMessage:"This will apply this individual feature's schema settings to all selected streams that have the same feature. Unique features must be valid key properties in other streams. Bookmark features must be valid replication keys in other streams.",uuid:"All streams"})),(0,S.jsx)(ae.cl,{children:(0,S.jsx)(Pe.Z,{alignTop:!0,columnFlex:l,columns:u,rows:i,stickyHeader:!0})})}),[g,t,se,V,P,ie,E,M,de,ue,D,B,d,v,h,m,re,le]);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(ce.Z,{condensed:!0,level:4,spacingBelow:!0,children:[(0,S.jsx)(ce.Z,{condensed:!0,inline:!0,level:4,monospace:!0,children:D})," schema"]}),(0,S.jsx)(O.Z,{mb:3,children:(0,S.jsx)(Bn.Z,{headerTitle:"Output",overflowVisible:!0,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(C.ZP,{children:"Destination table name"}),(0,S.jsx)(O.Z,{ml:Ct}),(0,S.jsx)(Ce.Z,Ot(Ot({},wt),{},{label:(0,S.jsxs)(C.ZP,{children:["By default, this stream will be saved to your destination under the table named ",(0,S.jsx)(C.ZP,{bold:!0,inline:!0,monospace:!0,children:D}),". To change the table name, enter in a different value."]})})),(0,S.jsx)(O.Z,{ml:1}),(0,S.jsx)(K.Z,{compact:!0,monospace:!0,onChange:function(e){var n=e.target.value;F(n),clearTimeout(b.current),b.current=setTimeout((function(){m(D,(function(e){return Ot(Ot({},e),{},{destination_table:n})}))}),300)},value:L||"",width:45*w.iI})]})})}),(0,S.jsx)(O.Z,{mb:3,children:(0,S.jsx)(Bn.Z,{headerTitle:"Usage",overflowVisible:!0,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(k.Z,{alignItems:"center",children:[(0,S.jsx)(C.ZP,{children:"Replication method"}),(0,S.jsx)(O.Z,{ml:Ct}),(0,S.jsx)(Ce.Z,Ot(Ot({},wt),{},{label:(0,S.jsxs)(C.ZP,{children:["Do you want to synchronize the entire stream (",(0,S.jsx)(C.ZP,{bold:!0,inline:!0,monospace:!0,children:we._B.FULL_TABLE}),") on each integration pipeline run or only new records (",(0,S.jsx)(C.ZP,{bold:!0,inline:!0,monospace:!0,children:we._B.INCREMENTAL}),")?",c===we.th.POSTGRESQL&&(0,S.jsxs)(C.ZP,{children:["Log-based incremental replication (",(0,S.jsx)(C.ZP,{bold:!0,inline:!0,monospace:!0,children:we._B.LOG_BASED}),") is also available for PostgreSQL sources."]})]})})),(0,S.jsx)(O.Z,{ml:1}),(0,S.jsxs)(G.Z,{compact:!0,onChange:function(e){m(D,(function(n){return Ot(Ot({},n),{},{replication_method:e.target.value})}))},primary:!0,value:I,children:[(0,S.jsx)("option",{value:""}),Object.values(we._B).filter((function(e){return c===we.th.POSTGRESQL||e!==we._B.LOG_BASED})).map((function(e){return(0,S.jsx)("option",{value:e,children:e},e)}))]}),(0,S.jsx)(O.Z,{ml:3}),(0,S.jsx)(C.ZP,{children:"Unique conflict method"}),(0,S.jsx)(O.Z,{ml:Ct}),(0,S.jsx)(Ce.Z,Ot(Ot({},wt),{},{label:(0,S.jsxs)(C.ZP,{wordBreak:!0,children:["If a new record has the same value as an existing record in the ",(0,$._6)("unique column",null===B||void 0===B?void 0:B.length),(null===B||void 0===B?void 0:B.length)>0&&(0,S.jsx)(S.Fragment,{children:"\xa0"}),null===B||void 0===B?void 0:B.sort().map((function(e,n){return(0,S.jsxs)(C.ZP,{bold:!0,inline:!0,monospace:!0,children:[1!==(null===B||void 0===B?void 0:B.length)&&n===(null===B||void 0===B?void 0:B.length)-1?(0,S.jsx)(C.ZP,{inline:!0,children:" and "},e):n>=1&&(0,S.jsx)(S.Fragment,{children:",\xa0"}),e]},e)})),", how do you want to resolve the conflict? The conflict method ",(0,S.jsx)(C.ZP,{bold:!0,inline:!0,monospace:!0,children:we.MU.IGNORE})," will skip the new record if it\u2019s a duplicate of an existing record. The conflict method ",(0,S.jsx)(C.ZP,{bold:!0,inline:!0,monospace:!0,children:we.MU.UPDATE})," will not save the new record and instead update the existing record with the new record\u2019s properties."]})})),(0,S.jsx)(O.Z,{ml:1}),(0,S.jsxs)(G.Z,{compact:!0,inputWidth:11*w.iI,onChange:function(e){m(D,(function(n){return Ot(Ot({},n),{},{unique_conflict_method:e.target.value})}))},primary:!0,value:A,children:[(0,S.jsx)("option",{value:""}),(0,S.jsx)("option",{value:we.MU.IGNORE,children:we.MU.IGNORE}),(0,S.jsx)("option",{value:we.MU.UPDATE,children:we.MU.UPDATE})]})]}),se&&(0,S.jsxs)(k.Z,{alignItems:"center",children:[(0,S.jsx)(C.ZP,{default:!0,children:"All streams"}),(0,S.jsx)(O.Z,{ml:Ct}),(0,S.jsx)(Ce.Z,Ot(Ot({},wt),{},{appearBefore:!0,label:(0,S.jsx)(C.ZP,{children:"This will apply this stream's replication method and unique conflict method settings to all selected streams."})})),(0,S.jsx)(O.Z,{ml:1}),(0,S.jsx)(R.ZP,{compact:!0,disabled:H,onClick:function(){W(!0),setTimeout((function(){return W(!1)}),2e3),d((function(e){return Ot(Ot({},e),{},{replication_method:I,unique_conflict_method:A})}))},pill:!0,secondary:!0,children:(0,S.jsx)(C.ZP,{bold:!H,success:H,children:H?"Applied!":"Apply"})})]})]})})}),(0,S.jsx)(Bn.Z,{headerTitle:"Features",noPadding:!0,children:pe}),(0,S.jsx)(O.Z,{mt:2,children:(0,S.jsx)(R.ZP,{loading:i,onClick:function(){return u(D)},primary:!0,small:!0,children:"Load sample data"})}),(0,S.jsxs)(O.Z,{mt:5,children:[(0,S.jsx)(ce.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Settings"}),(0,S.jsx)(O.Z,{mb:5,children:(0,S.jsxs)(O.Z,{mb:1,children:[(0,S.jsx)(C.ZP,{bold:!0,large:!0,children:"Run stream in parallel"}),(0,S.jsx)(C.ZP,{default:!0,children:"Parallel streams will be run at the same time, so make sure there are no dependencies between them."}),(0,S.jsx)(O.Z,{mb:1}),(0,S.jsx)(Oe.Z,{checked:T,onCheck:function(){return m(D,(function(e){return e.run_in_parallel=!T,e}))}},"".concat(D,"/run_in_parallel"))]})}),we._B.INCREMENTAL===I&&(0,S.jsxs)(O.Z,{mb:5,children:[(0,S.jsxs)(O.Z,{mb:1,children:[(0,S.jsx)(C.ZP,{bold:!0,large:!0,children:"Bookmark properties"}),(0,S.jsx)(C.ZP,{default:!0,children:"After each integration pipeline run, the last record that was successfully synchronized will be used as the bookmark. The properties listed below will be extracted from the last record and used as the bookmark. On the next run, the synchronization will start from the bookmarked record."})]}),(0,S.jsxs)(Z.ZP,{alignItems:"center",flexWrap:"wrap",children:[!(null!==g&&void 0!==g&&g.length)&&(0,S.jsxs)(C.ZP,{italic:!0,children:["Click the checkbox under the column ",(0,S.jsx)(C.ZP,{bold:!0,inline:!0,italic:!0,children:"Bookmark"})," to use a specific column as a bookmark property."]}),null===g||void 0===g?void 0:g.sort().map((function(e){return(0,S.jsx)(O.Z,{mb:1,mr:1,children:(0,S.jsx)(Ze.Z,{label:e,onClick:function(){de(e),m(D,(function(n){return Ot(Ot({},n),{},{bookmark_properties:(0,Te.Od)(n.bookmark_properties||[],(function(n){return n===e}))})}))},primary:!0})},"bookmark_properties/".concat(e))}))]}),(null===g||void 0===g?void 0:g.length)>0&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Z,{my:2,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(O.Z,{mr:2,children:[(0,S.jsx)(C.ZP,{bold:!0,large:!0,children:"Manually edit bookmark property values"}),!t&&(0,S.jsx)(C.ZP,{default:!0,children:'In order to overwrite the bookmark values for the next sync, you must first select a destination. Then you will be able to edit the bookmark property values in the table below. Click the "Save" button to save your changes.'}),t&&(0,S.jsx)(C.ZP,{default:!0,children:'This will temporarily overwrite the bookmark value for the next pipeline run. After editing any bookmark values below, you must click the "Save" button in the table header in order to persist and save your changes.'})]}),(0,S.jsx)(Oe.Z,{checked:X,disabled:!t,onCheck:function(){return Q((function(e){return!e}))}})]})}),X&&!!t&&(0,S.jsx)(Bn.Z,{header:(0,S.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsx)(C.ZP,{bold:!0,default:!0,children:"Bookmark property values"}),(0,S.jsx)(R.ZP,{compact:!0,loading:o,onClick:function(){p({block:{bookmark_values:(null===ee||void 0===ee?void 0:ee[D])||{},destination_table:L,tap_stream_id:D}})},pill:!0,primary:!0,children:"Save"})]}),headerPaddingVertical:w.iI,noPadding:!0,overflowVisible:!0,children:(0,S.jsx)(Pe.Z,{columnBorders:!0,columnFlex:[null,1],columns:[{uuid:"Feature"},{uuid:"Current bookmark value"}],rows:g.map((function(e){var n;return[(0,S.jsx)(C.ZP,{default:!0,monospace:!0,children:e},e),(0,S.jsx)(K.Z,{borderless:!0,monospace:!0,onChange:function(n){n.preventDefault(),ne((function(t){return Ot(Ot({},t),{},(0,l.Z)({},D,Ot(Ot({},t[D]),{},(0,l.Z)({},e,n.target.value||null))))}))},paddingHorizontal:0,placeholder:"Enter value (optional)",value:null===ee||void 0===ee||null===(n=ee[D])||void 0===n?void 0:n[e]},"".concat(e,"_value"))]}))})})]})]}),se&&(null===g||void 0===g?void 0:g.length)>0&&(0,S.jsxs)(O.Z,{mb:5,children:[(0,S.jsx)(C.ZP,{bold:!0,large:!0,children:"Valid replication keys"}),(0,S.jsx)(C.ZP,{default:!0,inline:!0,children:"If a stream's schema specifies its valid replication keys and a feature is not a valid replication key, that feature will not be set as a bookmark property when applying the feature (from a different stream) as a bookmark to all streams.\xa0"}),le.length>0&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.ZP,{default:!0,inline:!0,children:"These are the valid replication keys for this stream:"}),"\xa0",(0,S.jsxs)(C.ZP,{inline:!0,monospace:!0,small:!0,children:[le.join(", "),"."]})]}),0===le.length&&(0,S.jsx)(C.ZP,{default:!0,inline:!0,children:"This stream did not specify any valid replication keys, so all features can be used as bookmark properties."})]}),(0,S.jsxs)(O.Z,{mb:5,children:[(0,S.jsxs)(O.Z,{mb:1,children:[(0,S.jsx)(C.ZP,{bold:!0,large:!0,children:"Unique constraints"}),(0,S.jsx)(C.ZP,{default:!0,children:"Multiple records (e.g. 2 or more) with the same values in the columns listed below will be considered duplicates."})]}),(0,S.jsxs)(Z.ZP,{alignItems:"center",flexWrap:"wrap",children:[!(null!==B&&void 0!==B&&B.length)&&(0,S.jsxs)(C.ZP,{italic:!0,children:["Click the checkbox under the column ",(0,S.jsx)(C.ZP,{bold:!0,inline:!0,italic:!0,children:"Unique"})," to use a specific column as a unique constraint."]}),null===B||void 0===B?void 0:B.sort().map((function(e){return(0,S.jsx)(O.Z,{mb:1,mr:1,children:(0,S.jsx)(Ze.Z,{label:e,onClick:function(){m(D,(function(n){return Ot(Ot({},n),{},{unique_constraints:(0,Te.Od)(n.unique_constraints||[],(function(n){return n===e}))})}))},primary:!0})},"unique_constraints/".concat(e))}))]})]}),(0,S.jsxs)(O.Z,{mb:5,children:[(0,S.jsxs)(O.Z,{mb:1,children:[(0,S.jsx)(C.ZP,{bold:!0,large:!0,children:"Key properties"}),(0,S.jsx)(C.ZP,{default:!0,children:"Key properties are used as the primary key for the destination table."})]}),(0,S.jsxs)(Z.ZP,{alignItems:"center",flexWrap:"wrap",children:[!(null!==P&&void 0!==P&&P.length)&&(0,S.jsxs)(C.ZP,{italic:!0,children:["Click the checkbox under the column ",(0,S.jsx)(C.ZP,{bold:!0,inline:!0,italic:!0,children:"Key prop"})," to use a specific column as a key property."]}),null===P||void 0===P?void 0:P.sort().map((function(e){return(0,S.jsx)(O.Z,{mb:1,mr:1,children:(0,S.jsx)(Ze.Z,{label:e,onClick:function(){m(D,(function(n){return Ot(Ot({},n),{},{key_properties:(0,Te.Od)(n.key_properties||[],(function(n){return n===e}))})}))},primary:!0})},"key_properties/".concat(e))}))]})]}),ue&&(0,S.jsxs)(O.Z,{mb:3,children:[(0,S.jsxs)(O.Z,{mb:1,children:[(0,S.jsx)(C.ZP,{bold:!0,large:!0,children:"Partition keys"}),(0,S.jsx)(C.ZP,{default:!0,children:"One datetime column can be used to partition the table. (Note: Partition keys currently only work with BigQuery destinations. Support for other destinations is WIP.)"})]}),(0,S.jsxs)(Z.ZP,{alignItems:"center",flexWrap:"wrap",children:[!(null!==E&&void 0!==E&&E.length)&&(0,S.jsxs)(C.ZP,{italic:!0,children:["Click the checkbox under the column ",(0,S.jsx)(C.ZP,{bold:!0,inline:!0,italic:!0,children:"Partition key"})," to use a specific column as a partition key."]}),null===E||void 0===E?void 0:E.sort().map((function(e){return(0,S.jsx)(O.Z,{mb:1,mr:1,children:(0,S.jsx)(Ze.Z,{label:e,onClick:function(){m(D,(function(n){return Ot(Ot({},n),{},{partition_keys:(0,Te.Od)(n.partition_keys||[],(function(n){return n===e}))})}))},primary:!0})},"key_properties/".concat(e))}))]})]})]})]})},Et=["catalog","pipeline","setErrors","setSelectedStream"];function It(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Tt(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?It(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):It(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Mt,Dt=function(e){var n,t=e.catalog,i=e.pipeline,o=e.setErrors,l=e.setSelectedStream,u=(0,ge.Z)(e,Et),c=(0,f.useState)(null),s=c[0],a=c[1],d=(0,f.useMemo)((function(){return(null===t||void 0===t?void 0:t.streams)||[]}),[t]),p=(0,f.useMemo)((function(){return(0,Te.YC)(d,"stream").map((function(e){return{uuid:e.stream}}))}),[d]),h=(0,f.useMemo)((function(){return(0,Te.HK)(d,(function(e){return e.stream}))}),[d]),m=(0,f.useMemo)((function(){return h[null===s||void 0===s?void 0:s.uuid]}),[s,h]),b=(0,f.useMemo)((function(){return(0,Te.sE)((null===i||void 0===i?void 0:i.blocks)||[],(function(e){var n=e.type;return g.tf.DATA_EXPORTER===n}))}),[null===i||void 0===i?void 0:i.blocks]),x=m||{},j=x.destination_table,y=x.tap_stream_id,k=!(!y||!j),Z=V.ZP.blocks.pipelines.detail(k?null===i||void 0===i?void 0:i.uuid:null,k?null===b||void 0===b?void 0:b.uuid:null,{destination_table:j,state_stream:y}),P=Z.data,w=Z.mutate,_=null===P||void 0===P||null===(n=P.block)||void 0===n?void 0:n.bookmarks,E=(0,v.Db)(V.ZP.blocks.pipelines.useUpdate(encodeURIComponent(null===i||void 0===i?void 0:i.uuid),encodeURIComponent(null===b||void 0===b?void 0:b.uuid),{query:{update_state:!0}}),{onSuccess:function(e){return(0,ee.wD)(e,{callback:function(){null===w||void 0===w||w()},onErrorCallback:function(e,n){return null===o||void 0===o?void 0:o({errors:n,response:e})}})}}),I=(0,r.Z)(E,2),T=I[0],M=I[1].isLoading;(0,f.useEffect)((function(){p.length>0&&(s&&(0,Te.sE)(p,(function(e){var n=e.uuid;return s.uuid===n}))||a(p[0]))}),[s,a,p]);var D=(0,f.useMemo)((function(){var e=[{uuid:"Stream"},{uuid:"Columns Selected"},{uuid:"Replication Method"},{uuid:"Destination Table"},{uuid:"Bookmark Props"},{uuid:"Key Props"},{uuid:"Unique Constraints"},{uuid:"Unique Conflict Method"},{uuid:"Partition Keys"}];return(0,S.jsx)(ae.cl,{children:(0,S.jsx)(Pe.Z,{alignTop:!0,columnBorders:!0,columnFlex:e.map((function(e){return 1})),columns:e,rows:d.map((function(e){var n=e.replication_method,t=e.destination_table,i=e.bookmark_properties,o=e.key_properties,r=e.metadata,l=e.unique_constraints,u=e.unique_conflict_method,c=e.partition_keys,s=e.tap_stream_id,a=r.reduce((function(e,n){var t=n.breadcrumb,i=n.metadata.selected,o=(null===t||void 0===t?void 0:t.length)>0,r=i&&o?1:0,l=o?1:0;return{selectedCount:e.selectedCount+r,totalCount:e.totalCount+l}}),{selectedCount:0,totalCount:0}),d=(0,S.jsx)(C.ZP,{children:"".concat(a.selectedCount," of ").concat(a.totalCount," total")},"".concat(s,"_col_selected")),p=[s,n,t,i,o,l,u,c].map((function(e,n){return(0,S.jsx)(C.ZP,{bold:0===n,children:Array.isArray(e)?e.sort().join(", "):e},"".concat(s,"_cell_").concat(n))}));return p.slice(0,1).concat(d).concat(p.slice(1))})),stickyFirstColumn:!0,stickyHeader:!0,wrapColumns:!0})})}),[d]);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(B.Z,{allowScroll:!0,noPadding:!0,onClickTab:function(e){a(e),l(e.uuid)},selectedTabUUID:null===s||void 0===s?void 0:s.uuid,tabs:p}),m&&(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsx)(ae.dE,{children:(0,S.jsx)(St,Tt(Tt({},u),{},{bookmarkValues:_,isLoadingUpdateDestinationBlockState:M,stream:m,streams:d,updateDestinationBlockState:T}))})}),d.length>=1&&(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsxs)(ae.dE,{children:[(0,S.jsx)(ce.Z,{level:4,children:"Streams Summary"}),(0,S.jsx)(O.Z,{mt:1}),D]})})]})},Rt=t(46732);function Bt(e){return Object.values(e).filter((function(e){return null!==e})).map((function(e){return e.tap_stream_id}))}function At(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Nt(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?At(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):At(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}!function(e){e.ALL="All",e.SELECTED="Selected",e.NOT_SELECTED="Not selected"}(Mt||(Mt={}));var Lt=45*w.iI,Ft=Lt-4*w.iI;var Ut=function(e){var n=e.catalog,t=e.isLoading,i=e.onActionCallback,o=e.streams,r=(0,Te.HK)((null===n||void 0===n?void 0:n.streams)||[],(function(e){return e.stream})),u=(0,f.useMemo)((function(){var e=new Set(o.map((function(e){return e.stream})));return Object.values(r).filter((function(n){var t=n.stream;return!e.has(t)})).map((function(e){return Nt(Nt({},e),{},{isMissingStream:!0})}))}),[r,o]),c=Nt({},r);u.forEach((function(e){var n=e.stream;delete c[n]}));var s=(0,f.useState)(c),a=s[0],d=s[1],p=(0,f.useState)(null),v=p[0],h=p[1],m=(0,f.useState)(!1),b=m[0],g=m[1],j=(0,f.useState)(Mt.ALL),k=j[0],P=j[1],_=(0,f.useRef)(null),E=Bt(a),I=(0,f.useMemo)((function(){var e=o;return e=e.filter((function(e){var n=e.tap_stream_id;return k===Mt.SELECTED?E.includes(n):k!==Mt.NOT_SELECTED||!E.includes(n)})),v?e.filter((function(e){var n=e.tap_stream_id;return null===n||void 0===n?void 0:n.toLowerCase().includes(null===v||void 0===v?void 0:v.toLowerCase())})):e}),[k,v,E,o]),T=(0,f.useMemo)((function(){return o.every((function(e){var n=e.stream;return!!a[n]}))}),[a,o]);return(0,S.jsxs)(Be.Z,{children:[(0,S.jsx)(ae.cv,{rounded:!0,children:(0,S.jsx)(C.ZP,{bold:!0,large:!0,children:"Select streams to sync"})}),(0,S.jsx)(ae.cv,{padding:1.25*w.iI,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsx)(K.Z,{beforeIcon:(0,S.jsx)(q.HN,{}),compact:!0,noBackground:!0,noBorder:!0,onChange:function(e){return h(e.target.value)},placeholder:"Search",value:v}),(0,S.jsx)(O.Z,{pr:1,children:(0,S.jsx)(Rt.Z,{items:[{label:function(){return Mt.ALL},onClick:function(){return P(Mt.ALL)},uuid:"all_streams"},{label:function(){return Mt.SELECTED},onClick:function(){return P(Mt.SELECTED)},uuid:"selected"},{label:function(){return Mt.NOT_SELECTED},onClick:function(){return P(Mt.NOT_SELECTED)},uuid:"unselected"}],onClickCallback:function(){return g(!1)},onClickOutside:function(){return g(!1)},open:b,parentRef:_,uuid:"SelectStreams/filter",children:(0,S.jsx)(R.ZP,{beforeIcon:(0,S.jsx)(q.wn,{}),noBackground:!0,onClick:function(){return g((function(e){return!e}))},ref:_,children:(0,S.jsx)(C.ZP,{children:k})})})})]})}),(0,S.jsx)(ae.cl,{height:"55vh",hideHorizontalScrollbar:!0,width:"".concat(Lt,"px"),children:(0,S.jsx)(Pe.Z,{borderCollapseSeparate:!0,columnFlex:[1,6],columns:[{label:function(){return(0,S.jsx)(x.Z,{checked:T,onClick:function(){var e=(0,Te.HK)(o||[],(function(e){return e.stream}));d(T?{}:e)}})},uuid:"Selected"},{uuid:"Stream name"}],rows:I.concat(u).map((function(e){var n=e.isMissingStream,t=e.stream,i=!!a[t];return[(0,S.jsx)(x.Z,{checked:i,disabled:!i&&n,onClick:function(){d((function(n){return Nt(Nt({},n),{},(0,l.Z)({},t,i?null:e))}))}},"selected-".concat(t)),(0,S.jsxs)(C.ZP,{danger:n,title:t,width:Lt-48-32,children:[t,n?" (no longer available)":""]},"stream-".concat(t))]})),stickyHeader:!0})}),(0,S.jsx)(y.Z,{medium:!0}),(0,S.jsxs)(O.Z,{p:2,children:[(null===E||void 0===E?void 0:E.length)>50&&(0,S.jsx)(O.Z,{pb:2,children:(0,S.jsxs)(C.ZP,{danger:!0,maxWidth:Ft,rightAligned:!0,whiteSpaceNormal:!0,children:["WARNING: Selecting too many streams (e.g. >50)",(0,S.jsx)("br",{}),"may cause app performance issues."]})}),0===(null===o||void 0===o?void 0:o.length)&&(0,S.jsx)(O.Z,{pb:2,children:(0,S.jsx)(C.ZP,{bold:!0,maxWidth:Ft,warning:!0,whiteSpaceNormal:!0,children:"If you can successfully connect to the data source but no streams are displayed, check if the user has proper database/schema permissions."})}),(0,S.jsx)(Z.ZP,{justifyContent:"flex-end",children:(0,S.jsx)(R.ZP,{loading:t,onClick:function(){return i(a)},primary:!0,children:"Confirm ".concat(Bt(a).length," streams")})})]})]})};function Ht(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Wt(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ht(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ht(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Gt=function(e){var n=e.api,t=e.block,i=e.blockContent,o=e.onChangeCodeBlock,u=e.pipeline,c=(0,f.useState)(null),s=c[0],a=c[1];(0,f.useEffect)((function(){i&&!s&&a((0,le.Pz)(null===i||void 0===i?void 0:i.config))}),[s,i]);var d=(0,f.useState)(null),p=d[0],h=d[1],m=(0,f.useState)(),b=m[0],x=m[1],j=(0,v.Db)(V.ZP[n].useCreate(),{onSuccess:function(e){return(0,ee.wD)(e,{callback:function(e){var t,i,o=(0,$.C5)(n);h(null===e||void 0===e||null===(t=e[o])||void 0===t?void 0:t.success),x(null===e||void 0===e||null===(i=e[o])||void 0===i?void 0:i.error_message)},onErrorCallback:function(e){var n=e.error,t=n.errors,i=n.message;console.log(t,i)}})}}),y=(0,r.Z)(j,2),k=y[0],P=y[1].isLoading;return t?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(ae.$W,{children:(0,S.jsx)(ue.Z,{autoHeight:!0,language:g.t6.YAML,onChange:function(e){a(e),o(t.type,t.uuid,(0,le.Pz)(Wt(Wt({},i),{},{config:(0,le.Qc)(e)})))},tabSize:2,value:s||void 0,width:"100%"})}),(0,S.jsxs)(O.Z,{mt:1,children:[(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(R.ZP,{onClick:function(){k((0,l.Z)({},(0,$.C5)(n),{action_type:"test_connection",config:s,pipeline_uuid:u.uuid})),x(null)},small:!0,success:!0,children:"Test connection"}),(0,S.jsx)(O.Z,{ml:1,children:P?(0,S.jsx)(z.Z,{color:"white",small:!0}):(0,S.jsxs)(S.Fragment,{children:[p&&(0,S.jsx)(C.ZP,{small:!0,success:!0,children:"Connected successfully!"}),!1===p&&(0,S.jsx)(C.ZP,{small:!0,warning:!0,children:"Failed to connect, see error below."})]})})]}),b&&(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsx)(C.ZP,{small:!0,warning:!0,children:b})})]})]}):null},zt=t(85385);function Kt(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Vt(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Kt(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Kt(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var qt=function(e){var n,t,i,o=e.addNewBlockAtIndex,l=e.blocks,u=e.codeBlocks,c=e.fetchFileTree,s=e.fetchPipeline,a=e.fetchSampleData,d=e.globalVariables,p=e.onChangeCodeBlock,h=e.openSidekickView,m=e.pipeline,b=e.savePipelineContent,x=e.setErrors,j=e.setIntegrationStreams,y=e.setOutputBlocks,k=e.setSelectedBlock,_=e.setSelectedOutputBlock,E=e.setSelectedStream,I=(0,f.useState)(!0),T=I[0],M=I[1],D=(0,f.useState)(!0),B=D[0],A=D[1],N=(0,f.useState)(!0),L=N[0],F=N[1],U=(0,f.useState)(""),H=U[0],W=U[1],K=V.ZP.integration_sources.list({},{revalidateOnFocus:!1}).data,Y=(0,f.useMemo)((function(){return(null===K||void 0===K?void 0:K.integration_sources)||[]}),[K]),X=(0,f.useMemo)((function(){return(0,Te.HK)(Y,(function(e){return e.uuid}))}),[Y]),Q=V.ZP.integration_destinations.list({},{revalidateOnFocus:!1}).data,J=(0,f.useMemo)((function(){return(null===Q||void 0===Q?void 0:Q.integration_destinations)||[]}),[Q]),$=(0,f.useMemo)((function(){return(0,Te.HK)(J,(function(e){return e.uuid}))}),[J]),ne=(0,f.useMemo)((function(){return(0,Te.sE)(l,(function(e){var n=e.type;return g.tf.DATA_LOADER===n}))}),[l]),te=(0,f.useMemo)((function(){return ne?(0,le.Qc)(ne.content):{}}),[ne]);(0,f.useEffect)((function(){var e;null!==te&&void 0!==te&&te.source&&W(null===(e=X[te.source])||void 0===e?void 0:e.docs)}),[X,te]);var ie=(0,f.useMemo)((function(){return(0,S.jsx)(Gt,{api:"integration_sources",block:ne,blockContent:te,onChangeCodeBlock:p,pipeline:m})}),[ne,te,p,m]),oe=(0,f.useMemo)((function(){return(0,Te.sE)(l,(function(e){var n=e.type;return g.tf.DATA_EXPORTER===n}))}),[l]),re=(0,f.useMemo)((function(){return oe?(0,le.Qc)(oe.content):{}}),[oe]),ue=(0,f.useMemo)((function(){return(0,S.jsx)(Gt,{api:"integration_destinations",block:oe,blockContent:re,onChangeCodeBlock:p,pipeline:m})}),[oe,re,p,m]),se=(0,f.useMemo)((function(){return(0,Te.sE)(l,(function(e){var n=e.type;return g.tf.TRANSFORMER===n}))}),[l]),de=(0,f.useMemo)((function(){var e;return(0,ye.Qr)(null===te||void 0===te?void 0:te.catalog)?null===m||void 0===m||null===(e=m.data_integration)||void 0===e?void 0:e.catalog:null===te||void 0===te?void 0:te.catalog}),[te,null===m||void 0===m||null===(n=m.data_integration)||void 0===n?void 0:n.catalog]),pe=((null===de||void 0===de?void 0:de.streams)||[]).every((function(e){return e.auto_add_new_fields})),fe=((null===de||void 0===de?void 0:de.streams)||[]).every((function(e){return e.disable_column_type_check})),ve=(0,Jn.Z)(de);(0,f.useEffect)((function(){!ve&&de&&(y((function(){return _(ne),[ne]})),j((function(e){var n;return e||(null===de||void 0===de||null===(n=de.streams)||void 0===n?void 0:n.map((function(e){return e.tap_stream_id})))})))}),[de]);var he=(0,f.useState)(),be=he[0],ge=he[1],xe=(0,v.Db)(V.ZP.integration_sources.useCreate(),{onSuccess:function(e){return(0,ee.wD)(e,{callback:function(e){var n=e.integration_source;if(n.success){var t=(null===n||void 0===n?void 0:n.streams)||[];y((function(){return _(ne),[ne]})),t.length>0&&E(t[0]),j((function(e){var n=(e||[]).concat(t);return Array.from(new Set(n)).sort()})),h(zt.cH.DATA),a()}else ge(null===n||void 0===n?void 0:n.error_message)},onErrorCallback:function(e,n){return x({errors:n,response:e})}})}}),je=(0,r.Z)(xe,2),ke=je[0],Ze=je[1].isLoading,Ce=(0,v.Db)(V.ZP.integration_sources.useUpdate(null===m||void 0===m?void 0:m.uuid),{onSuccess:function(e){return(0,ee.wD)(e,{callback:function(e){var n=e.integration_source,t=n.selected_streams,i=n.streams,o=((null===de||void 0===de?void 0:de.streams)||[]).filter((function(e){var n=e.tap_stream_id;return t.includes(n)})),r=o.map((function(e){return e.tap_stream_id})),l=i.filter((function(e){var n=e.tap_stream_id;return t.includes(n)&&!r.includes(n)}));l.forEach((function(e){e.metadata.forEach((function(n,t){var i=n.metadata;if(we.ks.UNSUPPORTED!==i.inclusion){var o;if(e.replication_method||(e.replication_method=we._B.FULL_TABLE),e.unique_conflict_method||(e.unique_conflict_method=we.MU.UPDATE),!e.destination_table)e.destination_table=null===e||void 0===e||null===(o=e.tap_stream_id)||void 0===o?void 0:o.replace(/\W+/g,"_");e.metadata[t]=Vt(Vt({},n),{},{metadata:Vt(Vt({},i),{},{selected:!0})})}}))}));var u={streams:o.concat(l)};j(Ve.map((function(e){return e.tap_stream_id})));var a=null===te||void 0===te?void 0:te.catalog;(0,ye.Qr)(a)||p(ne.type,ne.uuid,(0,le.Pz)(Vt(Vt({},te),{},{catalog:{}})));var d={pipeline:Vt(Vt({},m),{},{data_integration:Vt(Vt({},(null===m||void 0===m?void 0:m.data_integration)||{}),{},{catalog:u})})};b(d).then((function(){s(),c()}))},onErrorCallback:function(e,n){return x({errors:n,response:e})}})}}),_e=(0,r.Z)(Ce,2),Se=_e[0],Ee=_e[1].isLoading,Ie=(0,f.useState)(null),Me=Ie[0],De=Ie[1],Re=(0,v.Db)(V.ZP.integration_source_streams.useUpdate(null===m||void 0===m?void 0:m.uuid),{onSuccess:function(e){return(0,ee.wD)(e,{callback:function(e){De(e.integration_source_stream)},onErrorCallback:function(e,n){return x({errors:n,response:e})}})}}),Be=(0,r.Z)(Re,2),Ae=Be[0],Ne=Be[1].isLoading,Le=(0,f.useCallback)((function(e,n){var t=function(e,n){var t,i=[];return e.streams.forEach((function(e){e.tap_stream_id===n?t=e:i.push(e)})),{stream:t,streams:i}}(de,e),i=t.stream,o=t.streams,r=Vt(Vt({},de),{},{streams:o.concat(n(i))}),l=null===te||void 0===te?void 0:te.catalog;(0,ye.Qr)(l)||p(ne.type,ne.uuid,(0,le.Pz)(Vt(Vt({},te),{},{catalog:{}})));var u={pipeline:Vt(Vt({},m),{},{data_integration:Vt(Vt({},(null===m||void 0===m?void 0:m.data_integration)||{}),{},{catalog:r})})};b(u).then((function(){return s()}))}),[de,ne,te,s,p,m,b]),Fe=(0,f.useCallback)((function(e){if(null!==de&&void 0!==de&&de.streams){var n=Vt(Vt({},de),{},{streams:de.streams.map((function(n){return e(n)}))}),t=null===te||void 0===te?void 0:te.catalog;(0,ye.Qr)(t)||p(ne.type,ne.uuid,(0,le.Pz)(Vt(Vt({},te),{},{catalog:{}})));var i={pipeline:Vt(Vt({},m),{},{data_integration:Vt(Vt({},(null===m||void 0===m?void 0:m.data_integration)||{}),{},{catalog:n})})};b(i).then((function(){return s()}))}}),[de,ne,te,s,p,m,b]),Ue=(0,f.useCallback)((function(e,n,t){Le(e,(function(e){return e.schema.properties[n]=t,e}))}),[Le]),He=(0,f.useCallback)((function(e,n,t){Le(e,(function(e){var i=e.metadata;return n.forEach((function(n){var o=i.findIndex((function(e){var t=e.breadcrumb,i=void 0===t?[]:t;return 2===i.length&&"properties"===i[0]&&i[1]===n}));if(o>=0){var r=i[o].metadata;e.metadata[o].metadata=Vt(Vt({},r),t)}})),e}))}),[Le]),We=(0,v.Db)(V.ZP.blocks.pipelines.useUpdate(encodeURIComponent(null===m||void 0===m?void 0:m.uuid),encodeURIComponent(null===oe||void 0===oe?void 0:oe.uuid)),{onSuccess:function(e){return(0,ee.wD)(e,{callback:function(){null===s||void 0===s||s()},onErrorCallback:function(e,n){return null===x||void 0===x?void 0:x({errors:n,response:e})}})}}),Ge=(0,r.Z)(We,1)[0],ze=(0,f.useMemo)((function(){var e=[];return null===d||void 0===d||d.forEach((function(n){var t=n.variables;return null===t||void 0===t?void 0:t.forEach((function(n){var t=n.uuid,i=n.value,o="\"{{ variables('".concat(t,"') }}\"");if(!t.startsWith("output"))return e.push([(0,S.jsx)(C.ZP,{monospace:!0,children:t},"variable-uuid-".concat(t)),(0,S.jsx)(C.ZP,{monospace:!0,children:i},"variable-uuid-".concat(t,"-{value}")),(0,S.jsx)(C.ZP,{monospace:!0,children:o},"variable-uuid-".concat(t,"-{value}-code")),(0,S.jsx)(Zt.Z,{copiedText:o,monospace:!0,withCopyIcon:!0},"variable-uuid-".concat(t,"-{value}-code-copy"))])}))})),(0,S.jsx)(Pe.Z,{alignTop:!0,columnFlex:[null,null,1],columns:[{uuid:"Key"},{uuid:"Value"},{uuid:"Code"}],rows:e})}),[d]),Ke=(0,f.useCallback)((function(e){return(0,S.jsxs)(O.Z,{mt:2,children:[(0,S.jsxs)(C.ZP,{default:!0,children:["Use the following variables to interpolate sensitive or dynamic information into the configuration.",(0,S.jsx)("br",{}),"You can also access values from your environment variables by using the following syntax: ",(0,S.jsx)(C.ZP,{inline:!0,monospace:!0,children:"\"{{ env_var('MY_ENV_VARIABLE_NAME') }}\""}),(0,S.jsx)("br",{}),"For more information, check out the ",(0,S.jsx)(P.Z,{href:e,openNewWindow:!0,primary:!0,children:"documentation"}),"."]}),(0,S.jsx)(O.Z,{mt:1,children:ze})]})}),[ze]),Ve=(0,f.useMemo)((function(){return(null===Me||void 0===Me?void 0:Me.streams)||[]}),[Me]),qe=(0,nt.dd)((function(){return(0,S.jsx)(Ut,{catalog:de,isLoading:Ee,onActionCallback:function(e){var n=Object.entries(e).reduce((function(e,n){var t=(0,r.Z)(n,2),i=t[0];return t[1]?e.concat(i):e}),[]);if(n.length>0)Se({integration_source:{streams:n}}),Qe();else{var t=null===te||void 0===te?void 0:te.catalog;(0,ye.Qr)(t)||p(ne.type,ne.uuid,(0,le.Pz)(Vt(Vt({},te),{},{catalog:{}}))),b({pipeline:Vt(Vt({},m),{},{data_integration:Vt(Vt({},(null===m||void 0===m?void 0:m.data_integration)||{}),{},{catalog:null})})}).then((function(){return s()})),Qe()}},streams:Ve})}),{},[de,ne,te,s,Ee,p,b,Ve],{background:!0,uuid:"select_streams"}),Ye=(0,r.Z)(qe,2),Xe=Ye[0],Qe=Ye[1];return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Z,{mb:1,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(R.ZP,{iconOnly:!0,onClick:function(){return A((function(e){return!e}))},children:(0,S.jsxs)(S.Fragment,{children:[B&&(0,S.jsx)(q.Kh,{size:1.5*w.iI}),!B&&(0,S.jsx)(q._M,{size:1.5*w.iI})]})}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(ce.Z,{children:"Source"}),!B&&(0,S.jsxs)(ce.Z,{default:!0,inline:!0,children:["\xa0",null===(t=X[null===te||void 0===te?void 0:te.source])||void 0===t?void 0:t.name]})]})]})}),B&&(0,S.jsxs)(O.Z,{mb:5,children:[(0,S.jsxs)(ae.dE,{children:[(0,S.jsxs)(O.Z,{mb:5,children:[(0,S.jsx)(ce.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Select source"}),(null===Y||void 0===Y?void 0:Y.length)>0?(0,S.jsxs)(G.Z,{onChange:function(e){var n,t,i,r=e.target.value;if(r){W(null===(n=X[r])||void 0===n?void 0:n.docs);var l=null===(t=X[r])||void 0===t||null===(i=t.templates)||void 0===i?void 0:i.config;l&&Object.keys(l).forEach((function(e){l[e]=l[e]||null})),ne?p(ne.type,ne.uuid,(0,le.Pz)(Vt(Vt({},te),{},{catalog:{},config:l,source:r}))):o({content:(0,le.Pz)({config:l,source:r}),language:g.t6.YAML,type:g.tf.DATA_LOADER},0,k),De(null),b().then((function(){s()}))}},primary:!0,value:null===te||void 0===te?void 0:te.source,children:[(0,S.jsx)("option",{value:""}),Y.map((function(e){var n=e.name,t=e.uuid;return(0,S.jsx)("option",{value:t,children:n},t)}))]}):(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(z.Z,{inverted:!0}),(0,S.jsx)(O.Z,{ml:1}),(0,S.jsx)(ce.Z,{level:5,primary:!0,children:"Loading sources..."})]})]}),ne&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(O.Z,{mb:5,children:[(0,S.jsx)(ce.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Configuration"}),(null===te||void 0===te?void 0:te.source)&&H&&(0,S.jsxs)(O.Z,{mb:2,children:[(0,S.jsx)(yt.Z,{children:(0,S.jsx)(kt.Z,{title:"Documentation: ".concat(te.source),children:(0,S.jsx)(ae.zG,{children:(0,S.jsx)(me.Z,{children:H.replace(/\<br \/\>/g,"\n\n")})})})}),Ke("https://docs.mage.ai/guides/data-integration-pipeline#configure-source")]}),ie]}),(0,S.jsxs)("div",{children:[(0,S.jsx)(ce.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Select stream"}),(0,S.jsx)(R.ZP,{loading:Ne,onClick:function(){b().then((function(){Ae().then((function(){return Xe()})),s()}))},primary:!0,small:!0,children:"View and select streams"})]}),be&&(0,S.jsx)(C.ZP,{warning:!0,children:be})]})]}),Ee&&(0,S.jsx)(O.Z,{p:2,children:(0,S.jsx)(z.Z,{})}),!Ee&&(0,S.jsx)(O.Z,{mt:3,children:(0,S.jsx)(Dt,{catalog:de,destination:null===re||void 0===re?void 0:re.destination,isLoadingLoadSampleData:Ze,loadSampleData:function(e){return ke({integration_source:{action_type:"sample_data",pipeline_uuid:null===m||void 0===m?void 0:m.uuid,streams:[e]}})},pipeline:m,setErrors:x,setSelectedStream:E,source:null===te||void 0===te?void 0:te.source,updateAllStreams:Fe,updateMetadataForColumns:He,updateSchemaProperty:Ue,updateStream:Le})})]}),(0,S.jsx)(O.Z,{mb:1,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(R.ZP,{disabled:!ne,iconOnly:!0,onClick:function(){return F((function(e){return!e}))},children:(0,S.jsxs)(S.Fragment,{children:[L&&ne&&(0,S.jsx)(q.Kh,{size:1.5*w.iI}),(!L||!ne)&&(0,S.jsx)(q._M,{disabled:!ne,size:1.5*w.iI})]})}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(Z.ZP,{alignItems:"center",children:(0,S.jsx)(ce.Z,{children:"Transformers"})})]})}),L&&ne&&(0,S.jsx)(O.Z,{mb:5,children:(0,S.jsxs)(ae.dE,{children:[u.length>0&&(0,S.jsx)(O.Z,{mb:1,children:u.map((function(e,n){return(0,S.jsx)(O.Z,{mb:1,children:e},n)}))}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsx)(st.Z,{addNewBlock:function(e){var n=e.content,t=e.configuration,i=[];return ne&&i.push(ne.uuid),o(Vt(Vt({},e),{},{configuration:t,content:n,upstream_blocks:i}),l.length-1,(function(e){oe&&(Ge({block:Vt(Vt({},oe),{},{upstream_blocks:[e.uuid]})}),k(e))}))},compact:!0,hideCustom:!0,hideDataExporter:!0,hideDataLoader:!0,hideDbt:!0,hideMarkdown:!0,hideScratchpad:!0,hideSensor:!0,hideTransformer:!!se,hideTransformerDataSources:!0,pipeline:m})})]})}),(0,S.jsx)(O.Z,{mb:1,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(R.ZP,{disabled:!ne,iconOnly:!0,onClick:function(){return M((function(e){return!e}))},children:(0,S.jsxs)(S.Fragment,{children:[T&&ne&&(0,S.jsx)(q.Kh,{size:1.5*w.iI}),(!T||!ne)&&(0,S.jsx)(q._M,{disabled:!ne,size:1.5*w.iI})]})}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(ce.Z,{children:"Destination"}),!T&&(0,S.jsxs)(ce.Z,{default:!0,inline:!0,children:["\xa0",null===(i=$[null===re||void 0===re?void 0:re.destination])||void 0===i?void 0:i.name]})]})]})}),T&&ne&&(0,S.jsxs)(ae.dE,{children:[(0,S.jsxs)(O.Z,{mb:5,children:[(0,S.jsx)(ce.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Select destination"}),(null===J||void 0===J?void 0:J.length)>0?(0,S.jsxs)(G.Z,{onChange:function(e){var n=e.target.value;if(n){if(oe)p(oe.type,oe.uuid,(0,le.Pz)(Vt(Vt({},re),{},{destination:n})));else{var t,i,r=null===(t=$[n])||void 0===t||null===(i=t.templates)||void 0===i?void 0:i.config;r&&(Object.keys(r).forEach((function(e){r[e]=r[e]||null})),r.hasOwnProperty("table")&&delete r.table);var u=[];if((null===l||void 0===l?void 0:l.length)>=2){var c=l.find((function(e){var n=e.uuid;return(null===ne||void 0===ne?void 0:ne.uuid)!==n}));c&&u.push(c.uuid)}else ne&&u.push(ne.uuid);o({content:(0,le.Pz)({config:r,destination:n}),language:g.t6.YAML,type:g.tf.DATA_EXPORTER,upstream_blocks:u},1,k)}b().then((function(){s()}))}},primary:!0,value:null===re||void 0===re?void 0:re.destination,children:[(0,S.jsx)("option",{value:""}),J.map((function(e){var n=e.name,t=e.uuid;return(0,S.jsx)("option",{value:t,children:n},t)}))]}):(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(z.Z,{inverted:!0}),(0,S.jsx)(O.Z,{ml:1}),(0,S.jsx)(ce.Z,{level:5,primary:!0,children:"Loading destinations..."})]})]}),oe&&(0,S.jsxs)(O.Z,{mb:5,children:[(0,S.jsx)(ce.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Configuration"}),(null===re||void 0===re?void 0:re.destination)&&(0,S.jsx)(S.Fragment,{children:(0,S.jsxs)(O.Z,{mb:2,children:[(0,S.jsxs)(C.ZP,{default:!0,children:["For more information on how to configure this destination, read the ",(0,S.jsxs)(P.Z,{href:"https://github.com/mage-ai/mage-ai/blob/master/mage_integrations/mage_integrations/destinations/".concat(re.destination,"/README.md"),openNewWindow:!0,primary:!0,children:[re.destination," documentation"]}),".",(0,S.jsx)("br",{}),(0,S.jsx)("br",{}),"If your configuration contains a key named ",(0,S.jsx)(C.ZP,{inline:!0,monospace:!0,children:"table"}),", it\u2019s optional.",(0,S.jsx)("br",{}),"The table that\u2019s created in this destination will have a name corresponding to the stream\u2019s unique name (by default) or the value you entered under the input field labeled ",(0,S.jsx)(C.ZP,{bold:!0,inline:!0,children:"Table name"})," in a previous section."]}),Ke("https://docs.mage.ai/guides/data-integration-pipeline#configure-destination")]})}),ue,(0,S.jsx)(O.Z,{mt:3,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(O.Z,{mr:2,children:[(0,S.jsx)(C.ZP,{bold:!0,large:!0,children:"Automatically add new fields"}),(0,S.jsx)(C.ZP,{default:!0,children:"Turn the toggle on if you want new table columns in each data source stream to be automatically added and synced with the data destination."})]}),(0,S.jsx)(Oe.Z,{checked:!!pe,disabled:!(null!==de&&void 0!==de&&de.streams),onCheck:function(){return Fe((function(e){return Vt(Vt({},e),{},{auto_add_new_fields:!pe})}))}})]})}),(0,S.jsx)(O.Z,{mt:3,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(O.Z,{mr:2,children:[(0,S.jsx)(C.ZP,{bold:!0,large:!0,children:"Disable column type check"}),(0,S.jsxs)(C.ZP,{default:!0,children:["By default, the value for each column is validated according to the schema property for that column.",(0,S.jsx)("br",{}),"If a value in a column doesn\u2019t match its type, an error will be raised and the process will be stopped.",(0,S.jsx)("br",{}),"Turn this toggle on if you want to disable this strict type checking."]})]}),(0,S.jsx)(Oe.Z,{checked:!!fe,disabled:!(null!==de&&void 0!==de&&de.streams),onCheck:function(){return Fe((function(e){return Vt(Vt({},e),{},{disable_column_type_check:!fe})}))}})]})})]})]})]})},Yt=t(82359),Xt=t(19698),Qt=t(97133),Jt=t(35058),$t=t(38399),ei=t(33834),ni=t(42041);function ti(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function ii(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ti(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ti(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var oi=function(e){var n=e.addNewBlockAtIndex,t=e.addWidget,i=e.afterHidden,u=e.allBlocks,c=e.allowCodeBlockShortcuts,s=e.anyInputFocused,a=e.autocompleteItems,d=e.beforeHidden,p=e.blockInteractionsMapping,h=e.blockRefs,m=e.blocks,b=void 0===m?[]:m,x=e.blocksThatNeedToRefresh,j=e.dataProviders,y=e.deleteBlock,k=e.disableShortcuts,Z=e.fetchFileTree,E=e.fetchPipeline,I=e.fetchSampleData,T=(e.files,e.globalDataProducts),M=e.globalVariables,D=e.hiddenBlocks,R=e.interactionsMapping,B=e.interruptKernel,L=e.mainContainerRef,U=e.mainContainerWidth,H=e.messages,G=e.onChangeCallbackBlock,z=e.onChangeCodeBlock,K=e.openSidekickView,q=e.pipeline,Y=e.pipelineContentTouched,X=e.restartKernel,Q=e.runBlock,J=e.runningBlocks,$=void 0===J?[]:J,ne=e.savePipelineContent,te=e.scrollTogether,ie=e.selectedBlock,oe=e.setAnyInputFocused,re=e.setDisableShortcuts,le=e.setEditingBlock,ue=e.setErrors,ce=e.setHiddenBlocks,se=e.setIntegrationStreams,ae=e.setOutputBlocks,de=e.setPipelineContentTouched,pe=e.setSelectedBlock,fe=e.setSelectedOutputBlock,ve=e.setSelectedStream,he=e.setTextareaFocused,me=e.setScrollTogether,be=e.setSideBySideEnabled,ge=e.showBrowseTemplates,xe=e.showBlockBrowserModal,je=e.showConfigureProjectModal,ke=e.showDataIntegrationModal,Ze=e.showGlobalDataProducts,Pe=e.showUpdateBlockModal,Oe=e.sideBySideEnabled,Ce=e.textareaFocused,we=e.widgets,_e=(0,yn.Z)(),Se=_e.featureEnabled,Ee=_e.featureUUIDs,Ie=_e.project,Me=(0,Xt.Z)().status,De=(0,f.useRef)(null),Re=(0,f.useRef)(null),Be=(0,f.useRef)({}),Ae=(0,f.useState)(!1),Ne=Ae[0],Le=Ae[1],Fe=(0,f.useState)(!1),Ue=Fe[0],He=Fe[1],We=(0,f.useState)(!1),Ge=We[0],ze=We[1],Ke=(0,f.useState)(!0),Ve=Ke[0],qe=Ke[1],Ye=(0,f.useState)(!1),Xe=Ye[0],Qe=Ye[1],Je=(0,f.useState)(null),$e=Je[0],en=Je[1],nn=(0,f.useState)(null),tn=nn[0],on=nn[1],rn=(0,f.useState)(!1),ln=rn[0],un=rn[1],cn=(0,f.useState)(""),sn=cn[0],an=cn[1],dn=(0,f.useState)({height:null,width:null,x:null,y:null}),pn=dn[0],vn=dn[1],hn=(0,f.useMemo)((function(){return W.qL.INTEGRATION===(null===q||void 0===q?void 0:q.type)}),[q]),mn=(0,f.useMemo)((function(){return W.qL.STREAMING===(null===q||void 0===q?void 0:q.type)}),[q]),bn=(0,f.useMemo)((function(){return b.filter((function(e){var n=e.type;return!hn||g.tf.TRANSFORMER===n}))}),[b,hn]),xn=(0,f.useState)({}),jn=(xn[0],xn[1]),Zn=(0,fn.i)(),Pn=Zn.height,Cn=Zn.width;(0,f.useEffect)((function(){var e;null!==L&&void 0!==L&&L.current&&vn(null===L||void 0===L||null===(e=L.current)||void 0===e?void 0:e.getBoundingClientRect())}),[i,d,L,U,vn,Pn,Cn]);var wn=(0,f.useMemo)((function(){return $.reduce((function(e,n,t){return ii(ii({},e),{},(0,l.Z)({},n.uuid,ii(ii({},n),{},{priority:t})))}),{})}),[$]),_n=(0,f.useState)(null),Sn=_n[0],En=_n[1],In=(0,f.useMemo)((function(){return(0,S.jsx)(bt,{blocks:bn,columnIndex:0,columns:2,disabled:te,eventNameRefsMapping:(0,l.Z)({},at.$e,h),invisible:!(null!==b&&void 0!==b&&b.length)||!Sn||te,mainContainerRect:pn,scrollTogether:te,setCursorHeight:En})}),[h,bn,Sn,pn,te,En]),Tn=(0,f.useState)(null),Mn=Tn[0],Dn=Tn[1],Rn=(0,f.useMemo)((function(){return(0,S.jsx)(bt,{blocks:bn,columnIndex:1,columns:2,disabled:te,eventNameRefsMapping:(0,l.Z)({},at.tK,Be),invisible:!(null!==b&&void 0!==b&&b.length)||!Mn||te,mainContainerRect:pn,rightAligned:!0,scrollTogether:te,setCursorHeight:Dn})}),[Be,bn,Mn,pn,te,Dn]),Bn=(0,f.useState)(null),An=Bn[0],Nn=Bn[1],Ln=(0,f.useMemo)((function(){var e;return(0,S.jsx)(bt,{blocks:bn,columnIndex:2,columns:1,disabled:!te,eventNameRefsMapping:(e={},(0,l.Z)(e,at.tK,Be),(0,l.Z)(e,at.$e,h),e),invisible:!(null!==b&&void 0!==b&&b.length)||!An||!te,mainContainerRect:pn,rightAligned:!0,scrollTogether:te,setCursorHeight:Nn})}),[Be,h,bn,An,pn,te,Nn]),Fn=(0,Jn.Z)(ie),Un=(0,f.useMemo)((function(){return b.length}),[b]),Hn=(0,f.useMemo)((function(){return W.qL.PYTHON===(null===q||void 0===q?void 0:q.type)&&(null===Se||void 0===Se?void 0:Se(null===Ee||void 0===Ee?void 0:Ee.ADD_NEW_BLOCK_V2))}),[Se,Ee,q]),Wn=V.ZP.block_templates.list({show_all:!!Hn},{revalidateOnFocus:!1}).data,Gn=(0,f.useMemo)((function(){return(null===Wn||void 0===Wn?void 0:Wn.block_templates)||[]}),[Wn]),zn=(0,f.useCallback)((function(e,t){var i=b[b.length-1],o=null,r=e.configuration||{},l=i?(0,vt.eY)(i,e):[];i&&([g.tf.DATA_LOADER,g.tf.TRANSFORMER].includes(i.type)&&g.tf.SCRATCHPAD===e.type&&(o="from mage_ai.data_preparation.variable_manager import get_variable\n\n\ndf = get_variable('".concat(q.uuid,"', '").concat(i.uuid,"', 'output_0')\n")),g.t6.SQL===i.language&&(r=ii(ii({},(0,ye.GL)(i.configuration,[Jt.cH,Jt.Sv,Jt.sc,Jt.BD,Jt.nq])),r))),g.t6.SQL===e.language&&(o=(0,$t.SF)(o)),o=(0,$t.X7)(e,o);var u=null!==t?t:Un;n(ii(ii({},e),{},{configuration:r,content:o,upstream_blocks:l}),u,pe),he(!0)}),[n,b,Un,q,pe,he]),Kn="PipelineDetail/index",Vn=(0,On.y)(),qn=Vn.disableGlobalKeyboardShortcuts,Yn=Vn.registerOnKeyDown,Xn=Vn.unregisterOnKeyDown;(0,f.useEffect)((function(){return function(){Xn(Kn)}}),[Xn,Kn]),Yn(Kn,(function(e,n,t){if(Y&&(0,ni.y)([kn.zX,kn.hS],n)){e.preventDefault();"undefined"!==typeof location&&window.confirm("You have changes that are unsaved. Click cancel and save your changes before reloading page.")&&location.reload()}if(!k&&!qn)if((0,ni.y)([kn.zX,kn.Um],n)||(0,ni.y)([kn.PQ,kn.Um],n))e.preventDefault(),ne();else if((0,ni.y)([kn.zH],n)||(0,ni.y)([kn.Fv],n)){if(ie&&!e.repeat&&!(0,ei.cK)(e)){var i=b.findIndex((function(e){var n=e.uuid;return ie.uuid===n}));if(-1!==i){var o=(0,ni.y)([kn.zH],n)?i:i+1;zn({type:g.tf.SCRATCHPAD},o)}}}else if(Ce)n[kn.vP]?he(!1):Y||kn.Z1.find((function(e){return n[e]}))||de(!0);else if(!hn){var r;if(Hn&&((0,ni.y)([kn.zX,kn.A1],n)||(0,ni.y)([kn.PQ,kn.A1],n)))e.preventDefault(),He(!0),null===Re||void 0===Re||null===(r=Re.current)||void 0===r||r.focus();else if(Hn&&Ue&&(0,ni.y)([kn.vP],n)){var l;e.preventDefault(),He(!1),null===Re||void 0===Re||null===(l=Re.current)||void 0===l||l.blur()}else if(ie){var u=b.findIndex((function(e){var n=e.uuid;return ie.uuid===n}));if(n[kn.vP])pe(null);else if(t[0]===kn.xD&&t[1]===kn.xD)B();else if(t[0]===kn.l1&&t[1]===kn.l1&&-1!==u)y(ie).then((function(e){null!==e&&void 0!==e&&e.error||setTimeout((function(){u===b.length-1?pe(b[u-1]):b.length>=0?pe(b[u+1]):pe(null)}),100)}));else if(n[kn.Bu]&&u>=1){var c=b[u-1];if(c){var a,d;pe(c);var p="".concat(c.type,"s/").concat(c.uuid,".py");null===(a=h.current[p])||void 0===a||null===(d=a.current)||void 0===d||d.scrollIntoView()}}else if(n[kn.kD]&&u<=Un-2){var f=b[u+1];if(f){var v,m;pe(f);var x="".concat(f.type,"s/").concat(f.uuid,".py");null===(v=h.current[x])||void 0===v||null===(m=v.current)||void 0===m||m.scrollIntoView()}}else(0,ni.y)([kn.Uq],n)&&he(!0)}else Fn&&n[kn.Uq]&&pe(Fn);s||t[0]!==kn.OC||t[1]!==kn.OC||X()}}),[n,s,h.current,b,Ue,B,hn,Un,Y,X,ne,Re,ie,Fn,de,pe,he,Ce,Hn]),(0,f.useEffect)((function(){var e=setInterval((function(){Y&&ne()}),1e4);return function(){clearInterval(e)}}),[Y,ne]),(0,f.useEffect)((function(){setTimeout((function(){return ze(!0)}),2*Qt.zn)}),[q]);var Qn=(0,v.Db)(V.ZP.pipelines.useUpdate(encodeURIComponent(null===q||void 0===q?void 0:q.uuid)),{onSuccess:function(e){return(0,ee.wD)(e,{callback:function(){null===E||void 0===E||E()},onErrorCallback:function(e,n){return null===ue||void 0===ue?void 0:ue({errors:n,response:e})}})}}),$n=(0,r.Z)(Qn,2),et=$n[0],nt=($n[1].isLoading,(0,v.Db)((function(e){var n=e.block,t=e.upstreamBlocks;return V.ZP.blocks.pipelines.useUpdate(encodeURIComponent(null===q||void 0===q?void 0:q.uuid),encodeURIComponent(null===n||void 0===n?void 0:n.uuid))({block:{upstream_blocks:t}})}),{onSuccess:function(e){return(0,ee.wD)(e,{callback:function(){E()},onErrorCallback:function(e,n){return null===ue||void 0===ue?void 0:ue({errors:n,response:e})}})}})),tt=(0,r.Z)(nt,1)[0],it=(0,f.useCallback)((function(e){Le(!0),on(e),re(!0)}),[Le,re,on]),ot=(0,f.useCallback)((function(){Le(!1),un(!1),an(""),re(!1)}),[re]),lt=(0,f.useCallback)((function(e,n){var t,i;b.forEach((function(o,r){var l=o.uuid;t>=0&&i>=0||(l===e.uuid?t=r:l===n.uuid&&(i=r))}));var o=(0,Te.oM)(b,i);return o=(0,Te.Hk)(n,Math.max(t,0),o),ne({pipeline:{blocks:o,uuid:null===q||void 0===q?void 0:q.uuid}})}),[b,q,ne]),dt=(0,f.useMemo)((function(){return q&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(st.Z,{addNewBlock:zn,blockTemplates:Gn,focusedAddNewBlockSearch:Ue,hideCustom:hn||mn,hideDataExporter:hn,hideDataLoader:hn,hideDbt:hn||mn,hideScratchpad:hn,hideSensor:hn,onClickAddSingleDBTModel:it,pipeline:q,project:Ie,searchTextInputRef:Re,setCreatingNewDBTModel:un,setFocusedAddNewBlockSearch:He,showBlockBrowserModal:xe,showBrowseTemplates:ge,showConfigureProjectModal:je,showGlobalDataProducts:Ze}),!Hn&&!hn&&!mn&&(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsxs)(C.ZP,{muted:!0,small:!0,children:["Want to try the new add block UI?",(0,S.jsx)("br",{}),"Turn on the feature named ",(0,S.jsx)(C.ZP,{bold:!0,inline:!0,muted:!0,small:!0,children:Yt.d.ADD_NEW_BLOCK_V2})," in your ",(0,S.jsx)(ut(),{href:"/settings/workspace/preferences",passHref:!0,children:(0,S.jsx)(P.Z,{muted:!0,underline:!0,children:(0,S.jsx)(C.ZP,{bold:!0,inline:!0,muted:!0,small:!0,children:"project settings"})})}),"."]})})]})}),[zn,Gn,Ue,hn,mn,it,q,Ie,Re,He,xe,ge,je,Ze,Hn]);(0,f.useEffect)((function(){var e,n=function(){var e,n,t,i=((null===L||void 0===L||null===(e=L.current)||void 0===e||null===(n=e.getBoundingClientRect)||void 0===n?void 0:n.call(e))||{}).y;null===(t=Object.values((null===h||void 0===h?void 0:h.current)||{}))||void 0===t||t.forEach((function(e){var n,t;if(((null===e||void 0===e||null===(n=e.current)||void 0===n||null===(t=n.getBoundingClientRect)||void 0===t?void 0:t.call(n))||{}).y<=i){var o,r,l,u=null===(o=(null===e||void 0===e||null===(l=e.current)||void 0===l?void 0:l.className)||"")||void 0===o||null===(r=o.split(" "))||void 0===r?void 0:r.filter((function(e){return!["disable-border-radius","enable-border-radius"].includes(e)}));null!==e&&void 0!==e&&e.current&&(e.current.className=["disable-border-radius"].concat(u).join(" "))}else{var c,s,a,d=null===(c=(null===e||void 0===e||null===(a=e.current)||void 0===a?void 0:a.className)||"")||void 0===c||null===(s=c.split(" "))||void 0===s?void 0:s.filter((function(e){return!["disable-border-radius","enable-border-radius"].includes(e)}));null!==e&&void 0!==e&&e.current&&(e.current.className=["enable-border-radius"].concat(d).join(" "))}}))};return null===L||void 0===L||null===(e=L.current)||void 0===e||e.addEventListener("scroll",n),function(){var e;null===L||void 0===L||null===(e=L.current)||void 0===e||e.removeEventListener("scroll",n)}}),[]);var pt=(0,f.useMemo)((function(){var e=[],i=(null===bn||void 0===bn?void 0:bn.length)||0;return bn.forEach((function(r,l){var s,d=l===i-1,v=r.type,m=r.uuid,P=(null===ie||void 0===ie?void 0:ie.uuid)===m,O=wn[m],C=O?0===O.priority?rt.uF.BUSY:rt.uF.QUEUED:rt.uF.IDLE,w=(0,ft.zv)({type:v,uuid:m});Be.current[w]=(0,f.createRef)(),h.current[w]=(0,f.createRef)();var I=v===g.tf.MARKDOWN,M=v===g.tf.TRANSFORMER,A=!(null===D||void 0===D||!D[m]),N=l===Un-1||hn,W=Be.current[w],V=h.current[w],Y=m,X=null===x||void 0===x||null===(s=x[v])||void 0===s?void 0:s[m];X&&(Y="".concat(Y,":").concat(X)),e.push((0,S.jsx)(F.Z,{addNewBlock:function(e,t){he(!0);return n(e,Oe?l:l+1,(function(e){if(1===(null===t||void 0===t?void 0:t.length)){var n,i,r=null===(n=t[0])||void 0===n?void 0:n.uuid,l=(null===(i=t[0])||void 0===i?void 0:i.upstream_blocks)||[];tt({block:{uuid:r},upstreamBlocks:[e.uuid].concat((0,o.Z)(l))})}null===pe||void 0===pe||pe(e)}))},addNewBlockMenuOpenIdx:$e,addWidget:t,allBlocks:u,allowCodeBlockShortcuts:c,autocompleteItems:a,block:r,blockIdx:l,blockInteractions:null===p||void 0===p?void 0:p[m],blockOutputRef:W,blockRefs:h,blockTemplates:Gn,blocks:b,containerRef:De,cursorHeight1:Sn,cursorHeight2:Mn,cursorHeight3:An,dataProviders:j,defaultValue:r.content,deleteBlock:function(e){y(e),oe(!1)},disableShortcuts:k,executionState:C,fetchFileTree:Z,fetchPipeline:E,globalDataProducts:T,hideRunButton:mn||I||hn&&M,interactionsMapping:R,interruptKernel:B,isHidden:A,mainContainerRect:pn,mainContainerRef:L,mainContainerWidth:U,messages:H[m],noDivider:N,onCallbackChange:function(e){return G(v,m,e)},onChange:function(e){return z(v,m,e)},onClickAddSingleDBTModel:it,onDrop:lt,openSidekickView:K,pipeline:q,project:Ie,ref:V,runBlock:Q,runningBlocks:$,savePipelineContent:ne,scrollTogether:te,selected:P,setAddNewBlockMenuOpenIdx:en,setAnyInputFocused:oe,setCreatingNewDBTModel:un,setEditingBlock:le,setErrors:ue,setHiddenBlocks:ce,setMountedBlocks:jn,setOutputBlocks:ae,setSelected:function(e){return pe(!0===e?r:null)},setSelectedBlock:pe,setSelectedOutputBlock:fe,setTextareaFocused:he,setScrollTogether:me,setSideBySideEnabled:be,showBlockBrowserModal:xe,showBrowseTemplates:ge,showConfigureProjectModal:je,showDataIntegrationModal:ke,showGlobalDataProducts:Ze,showUpdateBlockModal:Pe,sideBySideEnabled:Oe,textareaFocused:P&&Ce,updatePipeline:et,widgets:we,windowWidth:Cn,children:Oe&&d&&(0,S.jsx)("div",{style:{paddingBottom:_.WC,paddingTop:_.WC},children:dt})},Y))})),e}),[n,$e,dt,t,u,c,a,p,Be,h,Gn,b,bn,x,De,Sn,Mn,An,j,y,k,Z,E,T,D,R,B,hn,mn,pn,L,U,H,Un,G,z,it,lt,K,q,Ie,Q,$,wn,ne,te,ie,en,oe,le,ue,ce,jn,ae,pe,fe,he,me,be,xe,ge,je,ke,Ze,Pe,Oe,Ce,tt,et,we,Cn]),ht=(0,f.useMemo)((function(){return(0,S.jsx)(qt,{addNewBlockAtIndex:n,blocks:b,codeBlocks:pt,fetchFileTree:Z,fetchPipeline:E,fetchSampleData:I,globalVariables:M,onChangeCodeBlock:z,openSidekickView:K,pipeline:q,savePipelineContent:ne,setErrors:ue,setIntegrationStreams:se,setOutputBlocks:ae,setSelectedBlock:pe,setSelectedOutputBlock:fe,setSelectedStream:ve})}),[n,b,pt,Z,E,I,M,z,K,q,ne,ue,se,ae,pe,fe,ve]),mt=(0,f.useCallback)((function(e){var t="undefined"===typeof tn||null===tn;n((0,ft.J8)({blockIndex:tn,blocks:b,filePath:e,isNewBlock:ln,name:sn,repoPathRelativeRoot:null===Me||void 0===Me?void 0:Me.repo_path_relative_root}),(t?Un:tn+1)-(Oe?1:0),pe),ot(),he(!0)}),[n,b,ot,ln,sn,tn,Un,pe,he,Oe,Me]);return(0,f.useEffect)((function(){Xe&&Ie&&setTimeout((function(){return qe(!1)}),Qt.zn)}),[Xe,Ie]),(0,S.jsxs)(A.W,{backend:N.PD,children:[(0,S.jsx)(Qt.lO,{ref:De,children:Ve&&(0,S.jsx)(ct.Z,{classNames:"pipeline-detail",in:Ge,onEntered:function(){return Qe(!0)},timeout:1,children:(0,S.jsx)(Qt.fm,{})})}),hn&&(0,S.jsx)(O.Z,{mt:1,px:w.cd,children:ht}),!Oe&&(0,S.jsx)(O.Z,{mt:1,px:w.cd,children:!hn&&(0,S.jsxs)(S.Fragment,{children:[pt,(0,S.jsx)(O.Z,{mt:w.cd,children:dt})]})}),Oe&&(0,S.jsxs)("div",{style:{position:"relative"},children:[In,pt,Rn,Ln,!(null!==b&&void 0!==b&&b.length)&&(0,S.jsx)(O.Z,{p:w.cd,children:dt})]}),Ne&&(0,S.jsx)(gn.Z,{onClickOutside:ot,open:!0,children:(0,S.jsx)(jt,{blocks:b,dbtModelName:sn,onClose:ot,onOpenFile:mt,onSelectBlockFile:function(e,n,t,i){var o=i.path;return mt(o)},setDbtModelName:an})})]})},ri=t(82555),li=t(31557),ui=t(2842);function ci(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function si(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ci(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ci(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ai=function(e){var n=e.after,t=e.afterFooter,i=e.afterHeader,o=e.afterHeightOffset,l=e.afterHidden,u=e.afterInnerHeightMinus,c=e.afterNavigationItems,s=e.afterOverflow,a=e.afterSubheader,d=e.before,p=e.beforeHeader,v=e.beforeHeightOffset,h=e.beforeHidden,m=e.beforeNavigationItems,b=e.children,g=e.errors,x=e.footerOffset,j=e.headerOffset,y=e.mainContainerFooter,k=e.mainContainerHeader,Z=e.mainContainerRef,P=e.page,O=e.pipeline,C=e.setAfterHidden,w=e.setAfterWidthForChildren,_=e.setBeforeHidden,E=e.setErrors,I=e.setMainContainerWidth,T=(0,fn.i)().width,M=(0,f.useState)((0,pn.U2)(pn.L8,ui.Zt)),D=M[0],R=M[1],B=(0,f.useState)((0,pn.U2)(pn.J3,ui.ve)),A=B[0],N=B[1],L=(0,f.useState)(!1),F=L[0],U=L[1],H=(0,f.useState)(!1),W=H[0],G=H[1],z=l,K=C;if(!K){var V=(0,f.useState)(!!(0,pn.U2)(pn.zg)),q=(0,r.Z)(V,2);z=q[0],K=q[1]}var Y=h,X=_;if(!X){var Q=(0,f.useState)(!!(0,pn.U2)(pn.Uu)),J=(0,r.Z)(Q,2);Y=J[0],X=J[1]}(0,f.useEffect)((function(){null===Z||void 0===Z||!Z.current||F||W||null===I||void 0===I||I(Z.current.getBoundingClientRect().width)}),[F,W,z,D,Y,A,Z,I,T]),(0,f.useEffect)((function(){F||(null===w||void 0===w||w(D),(0,pn.t8)(pn.L8,D))}),[F,D,w]),(0,f.useEffect)((function(){W||(0,pn.t8)(pn.J3,A)}),[W,A]);var ee=(0,f.useMemo)((function(){var e=[{label:function(){return"Pipelines"},linkProps:{as:"/pipelines",href:"/pipelines"}}];return O&&(e.push.apply(e,[{bold:at.b7!==P,label:function(){return null===O||void 0===O?void 0:O.uuid},linkProps:{as:"/pipelines/".concat(null===O||void 0===O?void 0:O.uuid),href:"/pipelines/[pipeline]"}}]),at.b7===P&&e.push.apply(e,[{bold:!0,label:function(){return(0,$.kC)(P)}}])),(0,S.jsx)(li.Z,{breadcrumbs:e})}),[P,O]);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(Mn.Z,{title:null===O||void 0===O?void 0:O.name}),(0,S.jsx)(dn.Z,{after:n,afterFooter:t,afterHeader:i,afterHeightOffset:o,afterHidden:z,afterInnerHeightMinus:u,afterMousedownActive:F,afterNavigationItems:c,afterOverflow:s,afterSubheader:a,afterWidth:D,before:d,beforeHeader:p,beforeHeightOffset:v,beforeHidden:Y,beforeMousedownActive:W,beforeNavigationItems:m,beforeWidth:A,footerOffset:x,header:ee,headerOffset:j,mainContainerFooter:y,mainContainerHeader:k,mainContainerRef:Z,navigationShowMore:!0,setAfterHidden:K,setAfterMousedownActive:U,setAfterWidth:R,setBeforeHidden:X,setBeforeMousedownActive:G,setBeforeWidth:N,children:b}),g&&(0,S.jsx)(gn.Z,{disableClickOutside:!0,isOpen:!0,onClickOutside:function(){return E(null)},children:(0,S.jsx)(ri.Z,si(si({},g),{},{onClose:function(){return E(null)}}))})]})},di=t(55729),pi=t(93808),fi=t(8666),vi=t(72226),hi=t(29644),mi=t(46209),bi=t(46568),gi=t(82682),xi=t(4982),ji=t(61896),yi=(w.iI,xi.O$,w.iI,ji.dN,p.default.div.withConfig({displayName:"indexstyle__SidekickContainerStyle",componentId:"sc-cr39lf-0"})(["height:calc(100vh - ","px - ","px);width:fit-content;",""],ui.Wi,Ln.nn,(function(e){return e.fullWidth&&"\n width: 100%;\n "})),p.default.div.withConfig({displayName:"indexstyle__PaddingContainerStyle",componentId:"sc-cr39lf-1"})(["padding:","px;",""],2*w.iI,(function(e){return e.noPadding&&"\n padding: 0;\n "})),p.default.table.withConfig({displayName:"indexstyle__TableStyle",componentId:"sc-cr39lf-2"})(["",""],(function(e){return e.width&&"\n width: ".concat(e.width,"px;\n ")}))),ki=p.default.td.withConfig({displayName:"indexstyle__CellStyle",componentId:"sc-cr39lf-3"})(["display:flex;align-items:center;justify-content:space-between;border:1px solid #1C1C1C;height:100%;",""],(function(e){return!e.noPadding&&"\n padding: 0 ".concat(2*w.iI,"px;\n ")})),Zi=t(31748),Pi=t(79633);var Oi=function(e){var n=e.copyText,t=e.deleteVariable,i=e.disableKeyEdit,o=e.editStateInit,u=void 0!==o&&o,c=e.fetchVariables,s=e.focusKey,a=e.hideEdit,d=e.obfuscate,p=e.onEnterCallback,h=e.onEscapeCallback,m=e.pipelineUUID,b=e.updateVariable,g=e.variable||{},x=g.uuid,j=g.value,y=(0,f.useRef)(null),Z=(0,f.useRef)(null),P=(0,f.useState)(!1),O=P[0],_=P[1],E=(0,f.useState)(x),I=E[0],T=E[1],M=(0,f.useState)(j),D=M[0],R=M[1],B=(0,f.useState)(u),A=B[0],N=B[1],L=(0,v.Db)(V.ZP.variables.pipelines.useUpdate(m,x),{onSuccess:function(e){return(0,ee.wD)(e,{callback:function(){N(!1),c()}})}}),F=(0,r.Z)(L,1)[0],H=(0,f.useCallback)((function(e){if("Enter"===e.key){var n=D;try{n=JSON.parse(D)}catch(t){}b?I&&D&&(null===b||void 0===b||b((0,l.Z)({},I,D)),N(!1)):F({variable:{name:I,value:n}}),(0,ei.ez)(),null===p||void 0===p||p()}else"Escape"===e.key&&((0,ei.ez)(),N(!1),null===h||void 0===h||h())}),[p,h,b,F,I,D]),W=(0,f.useCallback)((function(){(0,ei.ez)(),t()}),[t]);(0,f.useEffect)((function(){var e,n;A&&(s?null===y||void 0===y||null===(e=y.current)||void 0===e||e.focus():null===Z||void 0===Z||null===(n=Z.current)||void 0===n||n.focus())}),[A,s]);var G=n||"kwargs['".concat(x,"']");return(0,S.jsx)("div",{onMouseEnter:function(){return _(!0)},onMouseLeave:function(){return _(!1)},children:(0,S.jsxs)(gi.Z,{children:[(0,S.jsx)(bi.Z,{hiddenSmDown:!0,md:1,children:(0,S.jsx)(ki,{noPadding:!0,children:(0,S.jsx)(U.ZP,{backgroundColor:Zi.qJ,borderless:!0,centerText:!0,muted:!0,onClick:function(){navigator.clipboard.writeText(G),Dn.Am.success("Successfully copied to clipboard.",{position:Dn.Am.POSITION.BOTTOM_RIGHT,toastId:x})},small:!0,uuid:"Sidekick/GlobalVariables/".concat(x),withIcon:!0,children:(0,S.jsx)(q.CK,{size:2.5*w.iI})})})}),(0,S.jsx)(bi.Z,{md:4,children:A&&!i?(0,S.jsx)(ki,{children:(0,S.jsx)(K.Z,{borderless:!0,compact:!0,fullWidth:!0,monospace:!0,onChange:function(e){T(e.target.value),e.preventDefault()},onKeyDown:H,paddingHorizontal:0,placeholder:"variable",ref:y,small:!0,value:I})}):(0,S.jsx)(ki,{children:(0,S.jsx)(C.ZP,{color:Pi.Or,monospace:!0,small:!0,textOverflow:!0,children:x})})}),(0,S.jsx)(bi.Z,{md:7,children:A?(0,S.jsx)(ki,{children:(0,S.jsx)(K.Z,{borderless:!0,compact:!0,fullWidth:!0,monospace:!0,onChange:function(e){R(e.target.value),e.preventDefault()},onKeyDown:H,paddingHorizontal:0,placeholder:"enter value",ref:Z,small:!0,value:D})}):(0,S.jsxs)(ki,{children:[d?(0,S.jsx)(C.ZP,{monospace:!0,small:!0,children:"********"}):(0,S.jsx)(C.ZP,{monospace:!0,small:!0,children:j}),(0,S.jsxs)(k.Z,{children:[!a&&O&&(0,S.jsx)(U.ZP,{backgroundColor:Zi.qJ,borderless:!0,inline:!0,muted:!0,onClick:function(){N(!0)},small:!0,uuid:"Sidekick/GlobalVariables/edit_".concat(x),withIcon:!0,children:(0,S.jsx)(q.I8,{size:2.5*w.iI})}),t&&O&&(0,S.jsx)(U.ZP,{backgroundColor:Zi.qJ,borderless:!0,inline:!0,muted:!0,onClick:W,small:!0,uuid:"Sidekick/GlobalVariables/delete_".concat(x),withIcon:!0,children:(0,S.jsx)(q.rF,{size:2.5*w.iI})})]})]})})]})})},Ci=p.default.div.withConfig({displayName:"indexstyle__BannerStyle",componentId:"sc-1cm3orh-0"})(["border-radius:","px;padding:","px ","px;",""],Ee.n_,1.5*w.iI,w.l4,(function(e){return"\n border: ".concat(Ee.YF,"px ").concat(Ee.M8," ").concat((e.theme||Se.Z).interactive.defaultBorder,";\n ")})),wi=t(68781);function _i(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Si(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?_i(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):_i(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Ei={borderLess:!0,iconOnly:!0,noBackground:!0,outline:!0,padding:"4px"},Ii={bold:!0,default:!0,inline:!0,monospace:!0,small:!0},Ti=(0,vt.YW)();var Mi=function(e){e.addNewBlockAtIndex;var n,t,i,o,l=e.block,u=(e.contentByBlockUUID,e.fetchFileTree),c=e.fetchPipeline,s=e.globalDataProducts,a=e.pipeline,d=e.setSelectedBlock,p=(e.showDataIntegrationModal,e.showUpdateBlockModal),h=(0,f.useRef)(null),m=(0,f.useRef)(null),b=(0,f.useMemo)((function(){return null===a||void 0===a?void 0:a.uuid}),[a]),y=(0,f.useMemo)((function(){return(null===a||void 0===a?void 0:a.retry_config)||{}}),[a]),_=(0,f.useMemo)((function(){return!(null!==a&&void 0!==a&&a.run_pipeline_in_one_process)&&[W.qL.PYSPARK,W.qL.PYTHON].includes(null===a||void 0===a?void 0:a.type)}),[a]),E=l.color,I=l.configuration,T=l.language,M=l.name,D=l.type,B=l.uuid,A=(0,f.useMemo)((function(){return g.tf.DBT===D}),[D]),N=null===a||void 0===a||null===(n=a.blocks)||void 0===n?void 0:n.findIndex((function(e){return e.uuid===B})),L=(0,f.useMemo)((function(){var e;return null===a||void 0===a||null===(e=a.blocks)||void 0===e?void 0:e[N]}),[N,null===a||void 0===a?void 0:a.blocks]),F=(0,ne.VI)(null,{},[],{uuid:"BlockSettings/index"}),H=(0,r.Z)(F,1)[0],Y=(0,f.useMemo)((function(){return(0,Te.HK)(s||[],(function(e){return e.uuid}))}),[s]),X=(0,f.useMemo)((function(){var e,n=null===I||void 0===I||null===(e=I.global_data_product)||void 0===e?void 0:e.uuid;if(n&&Y)return null===Y||void 0===Y?void 0:Y[n]}),[I,Y]),J=V.ZP.pipelines.detail(fi.b.PIPELINE===(null===X||void 0===X?void 0:X.object_type)&&(null===X||void 0===X?void 0:X.object_uuid)).data,te=(0,f.useMemo)((function(){return null===J||void 0===J?void 0:J.pipeline}),[J]),ie=(0,f.useState)(null),oe=ie[0],re=ie[1],le=(0,f.useState)(!1),ue=le[0],se=le[1],de=(0,f.useState)(!1),fe=de[0],ve=de[1],he=(0,f.useState)(!1),me=he[0],ge=he[1],xe=(0,Jn.Z)(l);(0,f.useEffect)((function(){(null===xe||void 0===xe?void 0:xe.uuid)!==(null===l||void 0===l?void 0:l.uuid)&&re(l)}),[l,xe]);var je=(0,f.useMemo)((function(){return(null===oe||void 0===oe?void 0:oe.retry_config)||{}}),[oe]),ke=(0,f.useCallback)((function(e){se(!0),re(e)}),[]),Ze=(0,f.useMemo)((function(){return(0,ye.gR)((null===oe||void 0===oe?void 0:oe.configuration)||I,["data_integration","file_path","file_source","global_data_product"])}),[null===oe||void 0===oe?void 0:oe.configuration,I]),Oe=(0,f.useCallback)((function(e){return ke((function(n){return Si(Si({},n),{},{configuration:Si(Si({},null===oe||void 0===oe?void 0:oe.configuration),e)})}))}),[null===oe||void 0===oe?void 0:oe.configuration,ke]),we=(0,f.useMemo)((function(){return null===oe||void 0===oe?void 0:oe.executor_type}),[oe]);(0,f.useEffect)((function(){fe||!we||wi.R.find((function(e){return e===we}))||ve(!0)}),[fe,we]);var _e=V.ZP.blocks.pipelines.detail(b,encodeURIComponent(B),{_format:"with_settings",block_type:D}).data,Se=(0,f.useMemo)((function(){return(null===_e||void 0===_e?void 0:_e.block)||{}}),[_e]),Ee=(0,f.useMemo)((function(){return null!==Se&&void 0!==Se&&Se.pipelines?Object.values(null===Se||void 0===Se?void 0:Se.pipelines):[]}),[Se]),Ie=(null===Ee||void 0===Ee?void 0:Ee.length)||1,Me=(0,v.Db)(V.ZP.blocks.pipelines.useUpdate(b,encodeURIComponent(B)),{onSuccess:function(e){return(0,ee.wD)(e,{callback:function(e){se(!1),u(),c(),null!==e&&void 0!==e&&e.block&&d(null===e||void 0===e?void 0:e.block)},onErrorCallback:function(e,n){return H({errors:n,response:e})}})}}),De=(0,r.Z)(Me,2),Re=De[0],Be=De[1].isLoading,Ae=((0,f.useCallback)((function(e){return Re({block:e})}),[Re]),(0,f.useMemo)((function(){return Ie>=1&&(0,S.jsx)(ae.cl,{children:(0,S.jsx)(Pe.Z,{columnFlex:[null,1],columns:[{uuid:"Name"},{uuid:"Description"}],rows:Ee.map((function(e){var n=e.pipeline,t=n.description,i=n.name,o=n.uuid;return[(null===a||void 0===a?void 0:a.uuid)===o?(0,S.jsxs)(C.ZP,{monospace:!0,muted:!0,children:[i||o," (current)"]},"name"):(0,S.jsx)(P.Z,{href:"/pipelines/".concat(o,"/edit"),monospace:!0,openNewWindow:!0,sameColorAsText:!0,children:i||o},"name"),(0,S.jsx)(C.ZP,{default:!0,monospace:!0,children:t||"-"},"description")]})),uuid:"git-branch-blockPipelines"})})}),[Ee,Ie,a])),Ne=(0,f.useMemo)((function(){return y&&"undefined"!==typeof y&&!(0,ye.Qr)(y)&&("undefined"!==typeof(null===y||void 0===y?void 0:y.delay)&&"undefined"===typeof(null===je||void 0===je?void 0:je.delay)||"undefined"!==typeof(null===y||void 0===y?void 0:y.exponential_backoff)&&"undefined"===typeof(null===je||void 0===je?void 0:je.exponential_backoff)||"undefined"!==typeof(null===y||void 0===y?void 0:y.max_delay)&&"undefined"===typeof(null===je||void 0===je?void 0:je.max_delay)||"undefined"!==typeof(null===y||void 0===y?void 0:y.retries)&&"undefined"===typeof(null===je||void 0===je?void 0:je.retries))}),[je,y]),Le=(0,f.useMemo)((function(){var e;return(null===oe||void 0===oe||null===(e=oe.configuration)||void 0===e?void 0:e.global_data_product)||{}}),[oe]),Fe=(0,f.useCallback)((function(e){return ke((function(n){var t;return Si(Si({},n),{},{configuration:Si(Si({},null===oe||void 0===oe?void 0:oe.configuration),{},{global_data_product:e(null===oe||void 0===oe||null===(t=oe.configuration)||void 0===t?void 0:t.global_data_product)})})}))}),[oe,ke]),Ue=(0,f.useMemo)((function(){return(0,pe.jO)(l,a)}),[l,a]);return(0,f.useMemo)((function(){return Ue&&(0,pe.Uc)(l)}),[l,Ue]),(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(O.Z,{mb:w.HN,pt:w.cd,children:[Ie>1&&(0,S.jsx)(O.Z,{mb:w.Mq,px:w.cd,children:(0,S.jsx)(Ci,{children:(0,S.jsxs)(Z.ZP,Si(Si({},Z.A0),{},{children:[(0,S.jsxs)(k.Z,{children:[(0,S.jsx)(q.BG,{fill:Pi.$R,size:Q.l2}),(0,S.jsx)(O.Z,{pr:2}),(0,S.jsxs)(C.ZP,{bold:!0,large:!0,lineHeight:3*w.iI,warning:!0,children:["Shared by ",Ie," pipelines"]})]}),!A&&(null===a||void 0===a?void 0:a.type)!==W.qL.INTEGRATION&&(0,S.jsx)(Ce.Z,{appearBefore:!0,block:!0,label:"Duplicates block so it is no longer shared with any other pipelines (detaches other pipeline associations)",lightBackground:!0,maxWidth:30*w.iI,size:null,children:(0,S.jsx)(R.ZP,Si(Si({},Ei),{},{afterIcon:(0,S.jsx)(q.L9,{size:Q.bL}),iconOnly:!1,onClick:function(){return p(Si(Si({},(0,ye.gR)(L,["all_upstream_blocks_executed","callback_blocks","conditional_blocks","downstream_blocks","executor_config","executor_type","name","outputs","retry_config","status","tags","timeout"])),{},{detach:!0}),"".concat(M,"_copy"),!0)},padding:null,children:"Detach"}))})]}))})}),(0,S.jsx)(O.Z,{mb:w.HN,px:w.cd,children:(0,S.jsxs)(be.Z,{noBackground:!0,noBoxShadow:!0,sameColorBorders:!0,children:[(0,S.jsx)(be.g,{noBorder:!0,children:(0,S.jsxs)(Z.ZP,Si(Si({},Z.A0),{},{children:[(0,S.jsx)(k.Z,{children:(0,S.jsx)(C.ZP,{bold:!0,default:!0,children:"Name"})}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(R.ZP,Si(Si({},Ei),{},{afterIcon:A?null:(0,S.jsx)(q.I8,{size:Q.bL}),disabled:A,onClick:function(){return p(l,M)},children:(0,S.jsx)(C.ZP,{bold:!0,children:M||""})}))]}))}),g.tf.CUSTOM===(null===l||void 0===l?void 0:l.type)?(0,S.jsx)(be.g,{noBorder:!0,children:(0,S.jsxs)(Z.ZP,Si(Si({},Z.A0),{},{children:[(0,S.jsx)(k.Z,{children:(0,S.jsx)(C.ZP,{bold:!0,default:!0,children:"Color"})}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(R.ZP,Si(Si({},Ei),{},{afterIcon:(0,S.jsx)(j.Z,{color:E?Ti[E]:null,size:Q.bL,square:!0}),onClick:function(){return p(l,M)},outline:!1,children:(0,S.jsx)(C.ZP,{bold:!0,children:(0,$.kC)(E||"")})}))]}))}):null]})}),(0,S.jsxs)(O.Z,{mb:w.HN,px:w.cd,children:[(0,S.jsx)(ce.Z,{level:5,children:"Executor type"}),(0,S.jsxs)(C.ZP,{muted:!0,children:["For more information on this setting, please read the ",(0,S.jsx)(P.Z,{href:"https://docs.mage.ai/production/configuring-production-settings/compute-resource#2-set-executor-type-and-customize-the-compute-resource-of-the-mage-executor",openNewWindow:!0,children:"documentation"}),"."]}),(0,S.jsxs)(O.Z,{mt:1,children:[!fe&&(0,S.jsx)(G.Z,{label:"Executor type",onChange:function(e){return ke((function(n){return Si(Si({},n),{},{executor_type:e.target.value})}))},primary:!0,ref:h,value:(null===oe||void 0===oe?void 0:oe.executor_type)||"",children:wi.R.map((function(e){return(0,S.jsx)("option",{value:e,children:e},e)}))}),fe&&(0,S.jsx)(K.Z,{label:"Executor type",monospace:!0,onChange:function(e){return ke((function(n){return Si(Si({},n),{},{executor_type:e.target.value})}))},primary:!0,ref:m,setContentOnMount:!0,value:(null===oe||void 0===oe?void 0:oe.executor_type)||""}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsx)(P.Z,{muted:!0,onClick:function(){fe?(ke((function(e){return Si(Si({},e),{},{executor_type:null})})),setTimeout((function(){var e;return null===h||void 0===h||null===(e=h.current)||void 0===e?void 0:e.focus()}),1)):setTimeout((function(){var e;return null===m||void 0===m||null===(e=m.current)||void 0===e?void 0:e.focus()}),1),ve(!fe)},preventDefault:!0,small:!0,children:fe?"Select a preset executor type":"Enter a custom executor type"})})]})]}),(0,S.jsxs)(O.Z,{mb:w.HN,px:w.cd,children:[(0,S.jsx)(ce.Z,{level:5,children:"Retry configuration"}),(0,S.jsxs)(C.ZP,{muted:!0,children:[Ne&&(0,S.jsxs)(S.Fragment,{children:["This block is currently using the retry configuration from the pipeline. You can override the pipeline\u2019s retry configuration for this block.",(0,S.jsx)("br",{})]}),"For more information on this setting, please read the ",(0,S.jsx)(P.Z,{href:"https://docs.mage.ai/orchestration/pipeline-runs/retrying-block-runs",openNewWindow:!0,children:"documentation"}),"."]}),(0,S.jsxs)(O.Z,{mt:1,children:[(0,S.jsxs)(Z.ZP,{children:[(0,S.jsx)(K.Z,{label:"Retries",monospace:!0,onChange:function(e){return ke((function(n){var t;return Si(Si({},n),{},{retry_config:Si(Si({},null===n||void 0===n?void 0:n.retry_config),{},{retries:"undefined"!==typeof e.target.value&&null!==e.target.value&&(null===(t=e.target.value)||void 0===t?void 0:t.length)>=1?Number(e.target.value):null})})}))},primary:!0,required:"undefined"===typeof(null===y||void 0===y?void 0:y.retries),setContentOnMount:!0,type:"number",value:"undefined"!==typeof(null===je||void 0===je?void 0:je.retries)?null===je||void 0===je?void 0:je.retries:(null===y||void 0===y?void 0:y.retries)||""}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(K.Z,{label:"Delay",monospace:!0,onChange:function(e){return ke((function(n){var t;return Si(Si({},n),{},{retry_config:Si(Si({},null===n||void 0===n?void 0:n.retry_config),{},{delay:"undefined"!==typeof e.target.value&&null!==e.target.value&&(null===(t=e.target.value)||void 0===t?void 0:t.length)>=1?Number(e.target.value):null})})}))},primary:!0,required:"undefined"===typeof(null===y||void 0===y?void 0:y.delay),setContentOnMount:!0,type:"number",value:"undefined"!==typeof(null===je||void 0===je?void 0:je.delay)?null===je||void 0===je?void 0:je.delay:(null===y||void 0===y?void 0:y.delay)||""}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(K.Z,{label:"Max delay",monospace:!0,onChange:function(e){return ke((function(n){var t;return Si(Si({},n),{},{retry_config:Si(Si({},null===n||void 0===n?void 0:n.retry_config),{},{max_delay:"undefined"!==typeof e.target.value&&null!==e.target.value&&(null===(t=e.target.value)||void 0===t?void 0:t.length)>=1?Number(e.target.value):null})})}))},primary:!0,required:"undefined"===typeof(null===y||void 0===y?void 0:y.max_delay),setContentOnMount:!0,type:"number",value:"undefined"!==typeof(null===je||void 0===je?void 0:je.max_delay)?null===je||void 0===je?void 0:je.max_delay:(null===y||void 0===y?void 0:y.max_delay)||""})]}),(0,S.jsx)(O.Z,{mt:w.cd,children:(0,S.jsx)(x.Z,{checked:"undefined"===typeof(null===je||void 0===je?void 0:je.exponential_backoff)&&"undefined"!==typeof(null===y||void 0===y?void 0:y.exponential_backoff)?!(null===y||void 0===y||!y.exponential_backoff):!(null===je||void 0===je||!je.exponential_backoff),label:"Exponential backoff",onClick:function(){return ke((function(e){var n;return Si(Si({},e),{},{retry_config:Si(Si({},null===e||void 0===e?void 0:e.retry_config),{},{exponential_backoff:"undefined"===typeof(null===je||void 0===je?void 0:je.exponential_backoff)&&"undefined"!==typeof(null===y||void 0===y?void 0:y.exponential_backoff)?!(null!==y&&void 0!==y&&y.exponential_backoff):!(null!==e&&void 0!==e&&null!==(n=e.retry_config)&&void 0!==n&&n.exponential_backoff)})})}))}})})]})]}),_&&(0,S.jsxs)(O.Z,{mb:w.HN,px:w.cd,children:[(0,S.jsx)(ce.Z,{level:5,children:"Block run timeout"}),(0,S.jsx)(O.Z,{mb:1}),(0,S.jsx)(K.Z,{label:"Time in seconds",monospace:!0,onChange:function(e){return ke((function(n){return Si(Si({},n),{},{timeout:e.target.value})}))},primary:!0,setContentOnMount:!0,type:"number",value:(null===oe||void 0===oe?void 0:oe.timeout)||""}),(0,S.jsx)(O.Z,{mb:1}),(0,S.jsx)(C.ZP,{muted:!0,small:!0,children:"The block timeout will only be applied when the block is run through a trigger. If a block times out, the block run will be set to a failed state."})]}),A&&(0,S.jsxs)(O.Z,{mb:w.HN,px:w.cd,children:[(0,S.jsx)(ce.Z,{level:5,children:"dbt settings"}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsx)(x.Z,{checked:!(null===oe||void 0===oe||null===(t=oe.configuration)||void 0===t||null===(i=t.dbt)||void 0===i||!i.disable_tests),label:"Disable automatically running dbt tests",onClick:function(){return ke((function(e){var n,t,i;return Si(Si({},e),{},{configuration:Si(Si({},null===e||void 0===e?void 0:e.configuration),{},{dbt:Si(Si({},null===e||void 0===e||null===(n=e.configuration)||void 0===n?void 0:n.dbt),{},{disable_tests:!(null!==e&&void 0!==e&&null!==(t=e.configuration)&&void 0!==t&&null!==(i=t.dbt)&&void 0!==i&&i.disable_tests)})})})}))}})})]}),g.Lk.includes(D)&&g.t6.PYTHON===T&&(0,S.jsxs)(O.Z,{mb:w.HN,px:w.cd,children:[(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(ce.Z,{level:5,children:"Block variables"}),(0,S.jsx)(O.Z,{ml:2}),(0,S.jsx)(U.ZP,{Icon:q.mm,blackBorder:!0,halfPaddingBottom:!0,halfPaddingTop:!0,inline:!0,onClick:function(){return ge((function(e){return!e}))},smallIcon:!0,uuid:"Sidekick/BlockSettings/addNewBlockVariable",children:"New"})]}),(0,S.jsxs)(O.Z,{mb:w.cd,mt:1,children:[(0,S.jsxs)(C.ZP,{muted:!0,children:["Press",(0,S.jsx)(C.ZP,Si(Si({},Ii),{},{children:" Enter"}))," or",(0,S.jsx)(C.ZP,Si(Si({},Ii),{},{children:" Return"}))," on a row to add or update a variable. These variables are only accessible in this block\xa0",(0,S.jsxs)(C.ZP,Si(Si({},Ii),{},{bold:!1,children:["(",B,")."]})),(0,S.jsxs)(C.ZP,{inline:!0,muted:!0,children:[" Refer to the",(0,S.jsx)(P.Z,{href:"https://docs.mage.ai/development/variables/block-variables",openNewWindow:!0,children:" documentation"})," for more details."]})]}),(0,S.jsxs)(C.ZP,{muted:!0,children:[(0,S.jsx)(C.ZP,{bold:!0,inline:!0,warning:!0,children:"Note: "}),"Click the",(0,S.jsx)(C.ZP,Si(Si({},Ii),{},{children:" Update block settings"}))," button below to save changes. If you do not, any new or updated block variables will not be persisted."]})]}),(0,S.jsxs)(O.Z,{mb:w.cd,children:[me&&(0,S.jsx)(Oi,{editStateInit:!0,focusKey:!0,onEnterCallback:function(){return ge(!1)},onEscapeCallback:function(){return ge(!1)},updateVariable:Oe},"new_block_variable"),null===(o=Object.entries(Ze))||void 0===o?void 0:o.map((function(e){var n=e[0];return(0,S.jsx)(Oi,{copyText:"kwargs['configuration'].get('".concat(n,"')"),deleteVariable:function(){var e=Si({},null===oe||void 0===oe?void 0:oe.configuration);delete e[n],ke((function(n){return Si(Si({},n),{},{configuration:Si({},e)})}))},disableKeyEdit:!0,updateVariable:Oe,variable:{uuid:n,value:e[1]}},n)}))]})]}),g.tf.GLOBAL_DATA_PRODUCT===D&&(0,S.jsxs)(O.Z,{mb:w.HN,children:[(0,S.jsx)(O.Z,{px:w.cd,children:(0,S.jsx)(ce.Z,{level:5,children:"Override global data product settings"})}),(0,S.jsx)(O.Z,{mt:w.Mq,children:(0,S.jsx)(vi.Z,{objectAttributes:Le,originalAttributes:X,setObjectAttributes:Fe})}),(0,S.jsx)(O.Z,{mt:w.Mq,children:(0,S.jsx)(hi.Z,{objectAttributes:Le,originalAttributes:X,setObjectAttributes:Fe})}),(0,S.jsx)(O.Z,{mt:w.Mq,children:(0,S.jsx)(mi.Z,{blocks:null===te||void 0===te?void 0:te.blocks,objectAttributes:Le,originalAttributes:X,setObjectAttributes:Fe})})]}),(0,S.jsx)(O.Z,{px:w.cd,children:(0,S.jsx)(R.ZP,{disabled:!ue,loading:Be,onClick:function(){return Re({block:{configuration:null===oe||void 0===oe?void 0:oe.configuration,executor_type:null===oe||void 0===oe?void 0:oe.executor_type,retry_config:je,timeout:null===oe||void 0===oe?void 0:oe.timeout}})},primary:!0,children:"Update block settings"})})]}),(0,S.jsxs)(O.Z,{mb:w.HN,children:[!_e&&(0,S.jsx)(O.Z,{p:w.cd,children:(0,S.jsx)(z.Z,{inverted:!0})}),_e&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(O.Z,{p:w.cd,children:[(0,S.jsxs)(ce.Z,{level:5,children:["Pipelines using this block (",Ie,")"]}),(0,S.jsx)(C.ZP,{default:!0,children:"A shared block is available to and reused by multiple pipelines. It enables you to write code once and have it easily accessible anywhere in the workspace. As a result, any code changes will affect all pipelines sharing the block."})]}),Ae]})]})]})},Di=t(4006),Ri=t(50450),Bi=["bold","defaultColor","description","disableWordBreak","fullWidth","inputValue","inputWidth","invertedTheme","label","labelColor","menuOpen","monospace","muted","onClick","notRequired","selectedTextProps","small","stacked","suffixValue","tooltipProps","value"];function Ai(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Ni(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ai(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ai(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Li=p.default.div.withConfig({displayName:"LabelWithValueClicker__LabelStyle",componentId:"sc-1hzpn4h-0"})(["margin-bottom:","px;"],.25*w.iI),Fi=p.default.div.withConfig({displayName:"LabelWithValueClicker__DescriptionStyle",componentId:"sc-1hzpn4h-1"})([""]);var Ui=function(e){var n=e.bold,t=void 0===n||n,i=e.defaultColor,o=e.description,r=e.disableWordBreak,l=e.fullWidth,u=e.inputValue,c=e.inputWidth,s=e.invertedTheme,a=e.label,d=e.labelColor,p=e.menuOpen,v=void 0!==p&&p,h=e.monospace,m=e.muted,b=e.onClick,g=e.notRequired,x=e.selectedTextProps,j=e.small,y=e.stacked,w=e.suffixValue,_=e.tooltipProps,E=e.value,I=(0,ge.Z)(e,Bi),T=(0,f.useRef)(null),M=(0,f.useState)(!1),D=M[0],R=M[1],B=(0,f.useState)(!1),A=B[0],N=B[1],L=a&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.ZP,{bold:t,color:d,inverted:s,lineHeight:20,monospace:h,muted:m,small:j,children:a}),_&&(0,S.jsx)(O.Z,{ml:1,children:(0,S.jsx)(Ce.Z,Ni({muted:!0},_))})]}),F=(0,S.jsxs)(k.Z,{flex:l?"1":"none",children:[E&&(0,S.jsx)(P.Z,{block:!0,danger:null===x||void 0===x?void 0:x.danger,fullWidth:!0,muted:m,onClick:function(){b(),T.current&&T.current.focus(),R(!0)},preventDefault:!0,sameColorAsText:m||!(null!==x&&void 0!==x&&x.primary)&&!(null!==x&&void 0!==x&&x.danger)&&!(null!==x&&void 0!==x&&x.warning),underline:null===x||void 0===x?void 0:x.underline,warning:null===x||void 0===x?void 0:x.warning,children:(0,S.jsx)(C.ZP,Ni(Ni({inverted:s,muted:m},x),{},{disableWordBreak:r,monospace:h,small:j,width:c,children:E}))}),(0,S.jsx)(K.Z,Ni(Ni({},I),{},{basic:!0,defaultColor:i,fullWidth:l,invertedTheme:s,monospace:h,onBlur:function(e){R(!1),I.onBlur&&I.onBlur(e),A||N(!0)},onFocus:function(e){R(!0),I.onFocus&&I.onFocus(e)},ref:T,small:j,value:u,visible:!E}))]}),U=o&&(0,S.jsx)(Fi,{children:(0,S.jsx)(C.ZP,{dangerouslySetInnerHTML:{__html:o},monospace:h,muted:!0,small:j})}),H=(0,f.useMemo)((function(){return(0,S.jsx)(C.ZP,{default:!0,small:j,children:w})}),[j,w]);return(0,S.jsxs)(S.Fragment,{children:[y&&(0,S.jsxs)(S.Fragment,{children:[L&&(0,S.jsxs)(Li,{children:[(0,S.jsx)(Z.ZP,{alignItems:"center",fullHeight:!1,fullWidth:!0,children:L}),U]}),(0,S.jsxs)(Z.ZP,{fullWidth:l,children:[F,w&&H]})]}),!y&&(0,S.jsxs)(Z.ZP,{alignItems:"center",fullWidth:!0,children:[L&&(0,S.jsxs)(S.Fragment,{children:[L,(0,S.jsx)(O.Z,{ml:1})]}),F,w&&H]}),A&&!D&&!E&&!v&&!g&&(0,S.jsx)(C.ZP,{danger:!0,small:j,children:"This field is required."})]})},Hi=t(10305),Wi=t(84820),Gi=t(85108),zi=t(97301);function Ki(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Vi(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ki(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ki(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function qi(e,n){var t,i,o,u,c=e.autocompleteItems,s=e.block,a=e.blockRefs,d=e.blocks,h=e.deleteWidget,m=e.executionState,b=e.fetchPipeline,x=e.fetchFileTree,j=e.messages,y=void 0===j?[]:j,E=e.onChangeContent,I=e.pipeline,T=e.runBlock,M=e.runningBlocks,D=e.savePipelineContent,R=e.selected,B=e.setAnyInputFocused,A=e.setErrors,N=e.setSelectedBlock,L=e.setTextareaFocused,F=e.textareaFocused,H=e.updateWidget,W=e.width,Y=(0,f.useRef)(null),X=(0,f.useContext)(p.ThemeContext),Q=V.ZP.blocks.pipelines.detail(null===I||void 0===I?void 0:I.uuid,null===s||void 0===s?void 0:s.upstream_blocks[0]).data,J=(null===Q||void 0===Q||null===(t=Q.block)||void 0===t?void 0:t.outputs)||(null===s||void 0===s?void 0:s.outputs)||[],ne=(0,f.useState)(null),te=ne[0],ie=ne[1],oe=(0,f.useState)(null===(i=s.configuration)||void 0===i?void 0:i.chart_type),re=oe[0],le=oe[1],ce=(0,f.useState)(s.configuration),se=ce[0],ae=ce[1],de=(0,f.useState)(s.content),pe=de[0],fe=de[1],ve=(0,f.useState)(!re||0===J.length),he=ve[0],me=ve[1],be=(0,f.useState)(!1),ge=be[0],xe=be[1],je=(0,f.useState)(null),ke=je[0],Pe=je[1],Oe=(0,f.useState)(null===s||void 0===s?void 0:s.upstream_blocks),we=Oe[0],_e=Oe[1],Ee=(0,f.useState)((null===J||void 0===J?void 0:J.length)||0),Ie=Ee[0],Me=Ee[1],De=(0,f.useState)(s.uuid),Re=De[0],Be=De[1],Ae=Gi.G8[re],Ne=Gi.x8[re],Le=(0,f.useMemo)((function(){return null===d||void 0===d?void 0:d.filter((function(e){var n=e.type;return[g.tf.DATA_LOADER,g.tf.TRANSFORMER].includes(n)}))}),[d]),Fe=(0,f.useMemo)((function(){return(0,Te.HK)(Le,(function(e){return e.uuid}))}),[Le]),Ue=!!M.find((function(e){return e.uuid===s.uuid}))||(null===y||void 0===y?void 0:y.length)>=1&&m!==rt.uF.IDLE,He=(0,f.useMemo)((function(){return null===y||void 0===y?void 0:y.filter((function(e){return null===e||void 0===e?void 0:e.type}))}),[y]),We=!!He.find((function(e){return e.error})),Ge=He.length>=1,ze=(0,f.useMemo)((function(){return{blockType:s.type,hasError:We,selected:R}}),[s.type,We,R]);if(null!==He&&void 0!==He&&He.length){var Ke,Ve,qe=He.length-1;u=null===He||void 0===He||null===(Ke=He[qe])||void 0===Ke||null===(Ve=Ke.data)||void 0===Ve?void 0:Ve[0]}u?(u=(u=u.slice(1,u.length-1)).replaceAll('\\"','"').replaceAll("\\'","'"),(0,$.Pb)(u)&&(o=JSON.parse(u))):(null===J||void 0===J?void 0:J.length)>=1&&(o={},J.forEach((function(e){var n=e||{},t=n.text_data,i=n.type,r=n.variable_uuid;rt.Gi.TEXT===i&&(0,$.Pb)(t)&&(o[r]=JSON.parse(t))})));var Ye=(0,f.useCallback)((function(e){var n=Vi(Vi(Vi({},s),e),{},{configuration:Vi(Vi({},s.configuration),e.configuration)});D().then((function(){T({block:n,code:pe,ignoreAlreadyRunning:!0,runUpstream:!!we.find((function(e){var n;return![g.DA.EXECUTED,g.DA.UPDATED].includes(null===(n=Fe[e])||void 0===n?void 0:n.status)}))})})),Me((function(e){return e+1}))}),[s,Fe,pe,T,D,Me,we]),Xe=(0,f.useCallback)((function(e){fe(e),E(e)}),[E,fe]),Qe=(0,f.useCallback)((function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.autoRun;ae((function(n){return Vi(Vi({},n),e)}));var i=Vi(Vi({},s),{},{configuration:Vi(Vi(Vi({},se),e),{},{chart_type:re})});H(i),Ie&&t&&Ye(i)}),[s,re,se,Ie,Ye,ae,H]);(0,f.useEffect)((function(){ie({python:(0,Wi.Z)({autocompleteItems:c,block:s,blocks:d,pipeline:I})})}),[c,s,d,I]);var Je=(0,f.useMemo)((function(){return(0,S.jsx)(ue.Z,{autoHeight:!0,autocompleteProviders:te,onChange:Xe,selected:R,setSelected:function(e){return N(!0===e?s:null)},setTextareaFocused:L,showLineNumbers:!1,textareaFocused:F||Jt.oV.TABLE===re&&!he,value:pe,width:"100%"})}),[te,s,re,pe,he,R,N,L,F,Xe]),$e=(0,f.useMemo)((function(){return(We||Ge)&&(0,S.jsx)(Ri.Z,Vi(Vi({},ze),{},{block:s,contained:!1,hideExtraInfo:!0,isInProgress:Ue,messages:He,selected:R}))}),[s,ze,We,Ge,Ue,He,R]),en=(0,Jn.Z)(he),nn=(0,Jn.Z)(W);(0,f.useEffect)((function(){var e,n=null===Y||void 0===Y||null===(e=Y.current)||void 0===e?void 0:e.getBoundingClientRect();en!==he||nn!==W?(Pe(0),setTimeout((function(){var e,n,t=null===Y||void 0===Y||null===(e=Y.current)||void 0===e||null===(n=e.getBoundingClientRect())||void 0===n?void 0:n.width;t&&Pe(t)}),100)):n&&Pe(n.width)}),[he,en,Y,Pe,W,nn]);var tn=(0,f.useMemo)((function(){var e=[];return we.forEach((function(n,t){var i=Fe[n],o=(0,_.qn)(null===i||void 0===i?void 0:i.type,{blockColor:null===i||void 0===i?void 0:i.color,theme:X}).accent;e.push((0,S.jsxs)(O.Z,{ml:2,children:[(0,S.jsxs)(C.ZP,{bold:!0,inline:!0,monospace:!0,small:!0,children:["df_",t+1]})," ",(0,S.jsx)(C.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:"->"})," ",(0,S.jsx)(P.Z,{color:o,inline:!0,onClick:function(){var e,n,t=null===a||void 0===a||null===(e=a.current)||void 0===e?void 0:e["".concat(null===i||void 0===i?void 0:i.type,"s/").concat(null===i||void 0===i?void 0:i.uuid,".py")];null===t||void 0===t||null===(n=t.current)||void 0===n||n.scrollIntoView()},preventDefault:!0,small:!0,children:(0,S.jsx)(C.ZP,{color:o,monospace:!0,small:!0,children:n})})]},n))})),e}),[a,Fe,X,we]),on=(0,f.useMemo)((function(){var e,n=[],t=null===Ae||void 0===Ae||null===(e=Ae.code)||void 0===e?void 0:e.reduce((function(e,n){var t=n.uuid;return Jt.Tv.includes(t)?e.concat(t):e}),[]);return null===t||void 0===t||t.forEach((function(e){var t=se[e];if(t){var i,o,r=null===(i=Gi.SR[re])||void 0===i||null===(o=i[e])||void 0===o?void 0:o.call(i);n.push((0,S.jsxs)(O.Z,{ml:2,children:[(0,S.jsx)(C.ZP,{bold:!0,inline:!0,monospace:!0,small:!0,children:t})," ",r&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:"->"})," ",(0,S.jsx)(C.ZP,{default:!0,inline:!0,small:!0,children:r})]})]},t))}})),n}),[re,se,Ae]),rn=(0,Jn.Z)(re),ln=(0,Jn.Z)(we);(0,f.useEffect)((function(){if((!rn&&re&&null!==we&&void 0!==we&&we.length||(null===ln||void 0===ln||!ln.length)&&(null===we||void 0===we?void 0:we.length)>=1&&re)&&!pe&&(0,ye.Qr)(se)&&Ne){var e=Vi(Vi({},s),{},{upstream_blocks:we});Ne.configuration&&Qe(Ne.configuration(e)),Ne.content&&Xe(Ne.content(e))}}),[s,re,rn,se,pe,Ne,Qe,Xe,we,ln]);var un=(0,f.useMemo)((function(){return se[Jt.v8]||1}),[se]),cn=(0,f.useMemo)((function(){return Object.entries(Ae||{}).reduce((function(e,n){var t=(0,r.Z)(n,2),i=t[0],o=t[1];return Vi(Vi({},e),{},(0,l.Z)({},i,o.map((function(e){var n,t=e.autoRun,i=e.label,o=e.monospace,r=e.options,u=e.settings,c=void 0===u?{}:u,a=e.type,d=e.uuid,p={fullWidth:!0,key:d,label:(0,$.kC)(i()),monospace:o,onBlur:function(){return N(s)},onChange:function(e){return Qe((0,l.Z)({},d,e.target.value),{autoRun:t})},onFocus:function(){return N(s)},value:(null===se||void 0===se?void 0:se[d])||""},f=(null!==Q&&void 0!==Q&&Q.block?[Q.block]:[]).reduce((function(e,n){var t=n.outputs;return t?e.concat(t.reduce((function(e,n){var t=n.sample_data;return null!==t&&void 0!==t&&t.columns?e.concat(t.columns):e}),[])):e}),[]);if(Gi.VR.COLUMNS===a){var v=se[d]||[];n=(0,S.jsxs)(S.Fragment,{children:[(!c.maxValues||v.length<c.maxValues)&&(0,S.jsx)(G.Z,Vi(Vi({},p),{},{onChange:function(e){var n=se[d]||[],i=e.target.value;n.includes(i)?n=(0,Te.Od)(n,(function(e){return e===i})):n.push(i),Qe((0,l.Z)({},d,n),{autoRun:t})},value:null,children:(0,Te.YC)(f.filter((function(e){return!v.includes(e)})),(function(e){return e})).map((function(e){return(0,S.jsx)("option",{value:e,children:e},e)}))})),v.map((function(e){return(0,S.jsx)("div",{style:{display:"inline-block",marginRight:2,marginTop:2},children:(0,S.jsx)(Ze.Z,{label:e,onClick:function(){Qe((0,l.Z)({},d,(0,Te.Od)(v,(function(n){return n===e}))),{autoRun:t})}})},e)}))]})}else if(Gi.VR.METRICS===a){var h=se[d]||[];n=(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.ZP,{bold:!0,children:"Metrics"}),(0,S.jsx)(C.ZP,{muted:!0,small:!0,children:"Select a column and an aggregation function."}),(0,S.jsxs)(Hi.Z,{onChange:function(e,n){var i=n.resetValues,o=n.setValues;2===e.filter((function(e){return!!e})).length&&(h.find((function(n){var t=n.aggregation;return n.column===e[1]&&t===e[0]}))||(Qe((0,l.Z)({},d,h.concat({aggregation:e[0],column:e[1]})),{autoRun:t}),o([null,null]),i()))},children:[(0,S.jsx)(G.Z,Vi(Vi({},p),{},{label:"aggregation",children:(0,Te.YC)(Jt.bn,(function(e){return e})).map((function(e){return(0,S.jsx)("option",{value:e,children:e},e)}))})),(0,S.jsx)(G.Z,Vi(Vi({},p),{},{label:"column",children:(0,Te.YC)(f,(function(e){return e})).map((function(e){return(0,S.jsx)("option",{value:e,children:e},e)}))}))]}),h.map((function(e){var n=e.aggregation,i=e.column;return(0,S.jsx)("div",{style:{display:"inline-block",marginRight:2,marginTop:2},children:(0,S.jsx)(Ze.Z,{label:(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(C.ZP,{inline:!0,monospace:!0,children:[n,"("]}),i,(0,S.jsx)(C.ZP,{inline:!0,monospace:!0,children:")"})]}),onClick:function(){Qe((0,l.Z)({},d,(0,Te.Od)(h,(function(e){var t=e.aggregation,o=e.column;return n===t&&i===o}))),{autoRun:t})}})},"".concat(n,"(").concat(i,")"))}))]})}else n=r?(0,S.jsx)(G.Z,Vi(Vi({},p),{},{children:r.map((function(e){return(0,S.jsx)("option",{value:e,children:e},e)}))})):(0,S.jsx)(K.Z,Vi(Vi({},p),{},{type:a}));return(0,S.jsx)(O.Z,{mb:1,children:n},d)}))))}),{noCode:[]})}),[s,se,Ae,Q,N,Qe]),sn=cn.code,an=cn.noCode,dn=(0,v.Db)(V.ZP.widgets.pipelines.useUpdate(null===I||void 0===I?void 0:I.uuid,s.uuid),{onSuccess:function(e){return(0,ee.wD)(e,{callback:function(){xe(!1),b(),x()},onErrorCallback:function(e,n){return null===A||void 0===A?void 0:A({errors:n,response:e})}})}}),pn=(0,r.Z)(dn,1)[0],fn="ChartBlock/".concat(s.uuid),vn=(0,On.y)(),hn=vn.registerOnKeyDown,mn=vn.unregisterOnKeyDown;return(0,f.useEffect)((function(){return function(){mn(fn)}}),[mn,fn]),hn(fn,(function(e,n,t){ge&&String(t[0])===String(kn.Uq)&&String(t[1])!==String(kn.zX)&&pn({widget:Vi(Vi({},s),{},{name:Re})})}),[s,ge,Re,pn]),(0,S.jsx)(bi.Z,{sm:12,md:12*un,children:(0,S.jsxs)(zi.pM,{ref:n,children:[(0,S.jsx)(O.Z,{mt:1,pt:1,px:1,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",fullWidth:!0,justifyContent:"space-between",children:[(0,S.jsxs)(k.Z,{flex:1,style:{position:"relative"},children:[(0,S.jsx)(Ui,{bold:!1,fullWidth:!0,inputValue:Re,notRequired:!0,onBlur:function(){return setTimeout((function(){return xe(!1)}),300)},onChange:function(e){Be(e.target.value),e.preventDefault()},onClick:function(){B(!0),xe(!0)},onFocus:function(){B(!0),xe(!0)},small:!0,stacked:!0,value:!ge&&s.uuid}),ge&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Z,{ml:1}),(0,S.jsx)(P.Z,{noWrapping:!0,onClick:function(){return pn({widget:Vi(Vi({},s),{},{name:Re})})},preventDefault:!0,sameColorAsText:!0,small:!0,children:"Update chart name"})]})]}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(G.Z,{compact:!0,onChange:function(e){var n=[e.target.value],t=Vi(Vi({},s),{},{upstream_blocks:n});H(t),Ye(t),_e(n)},placeholder:"Source block",small:!0,value:(null===we||void 0===we?void 0:we[0])||"",children:null===Le||void 0===Le?void 0:Le.map((function(e){var n=e.uuid;return(0,S.jsx)("option",{value:n,children:n},n)}))}),(0,S.jsx)(O.Z,{mr:1}),!Ue&&(0,S.jsx)(Ce.Z,{appearBefore:!0,default:!0,label:"Run chart block",size:null,widthFitContent:!0,children:(0,S.jsx)(U.ZP,{blackBorder:!0,compact:!0,inline:!0,onClick:function(){return Ye(s)},uuid:"ChartBlock/run/".concat(s.uuid),children:(0,S.jsx)(q.Py,{size:2*w.iI})})}),rt.uF.QUEUED===m&&(0,S.jsx)(z.Z,{color:(X||Se.Z).content.active,small:!0,type:"cylon"}),rt.uF.BUSY===m&&(0,S.jsx)(z.Z,{color:(X||Se.Z).content.active,small:!0}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(Ce.Z,{appearBefore:!0,default:!0,label:"Edit chart",size:null,widthFitContent:!0,children:(0,S.jsx)(U.ZP,{blackBorder:!0,compact:!0,inline:!0,onClick:function(){return me((function(e){return!e}))},selected:he,uuid:"ChartBlock/edit/".concat(s.uuid),children:(0,S.jsx)(q.I8,{size:2*w.iI})})}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(Ce.Z,{appearBefore:!0,default:!0,label:"Delete chart",size:null,widthFitContent:!0,children:(0,S.jsx)(U.ZP,{blackBorder:!0,compact:!0,inline:!0,onClick:function(){return h(s)},uuid:"ChartBlock/delete/".concat(s.uuid),children:(0,S.jsx)(q.rF,{size:2*w.iI})})})]})]})}),(0,S.jsx)(O.Z,{mt:1}),(0,S.jsxs)(Z.ZP,{fullWidth:!0,justifyContent:"space-between",children:[(0,S.jsx)(k.Z,{flex:6,ref:Y,children:o&&!(0,ye.Qr)(o)&&(0,S.jsx)(O.Z,{pb:3,children:(0,S.jsx)(Di.Z,{block:Vi(Vi({},s),{},{configuration:Vi(Vi({},s.configuration),se)}),data:o,width:ke})})}),he&&(0,S.jsx)(zi.Tb,{children:(0,S.jsxs)(Z.ZP,{flexDirection:"column",fullWidth:!0,children:[(0,S.jsx)(O.Z,{mb:1,children:(0,S.jsx)(G.Z,{onChange:function(e){var n=e.target.value,t=Vi(Vi({},s),{},{configuration:Vi(Vi({},se),{},{chart_type:n})});H(t),Ye(t),le(n)},placeholder:"Select chart type",value:re,children:Jt.CK.map((function(e){return(0,S.jsx)("option",{value:e,children:(0,$.kC)(e)},e)}))})}),(0,S.jsx)(O.Z,{mb:1,children:(0,S.jsx)(G.Z,{onChange:function(e){return Qe((0,l.Z)({},Jt.v8,e.target.value))},placeholder:"Chart width",value:(null===se||void 0===se?void 0:se[Jt.v8])||1,children:[["1/2 width",.5],["full width",1]].map((function(e){var n=(0,r.Z)(e,2),t=n[0],i=n[1];return(0,S.jsx)("option",{value:i,children:t},t)}))})}),an]})})]}),he&&!(null===sn||void 0===sn||!sn.length)&&g.t6.SQL!==s.language&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(O.Z,{my:1,px:1,children:[(0,S.jsx)(C.ZP,{bold:!0,children:"Custom chart code"}),(0,S.jsxs)(C.ZP,{muted:!0,children:["Write custom logic mapping data to input values for your chart.",(0,S.jsx)("br",{}),"This code is only executed if you don\u2019t have any columns or metrics selected."]})]}),(0,S.jsxs)(zi.T7,{children:[we.length>=1&&(0,S.jsxs)(zi.y9,{children:[(0,S.jsxs)(C.ZP,{muted:!0,small:!0,children:["Variables you can use in your code: ",tn]}),(0,S.jsxs)(C.ZP,{muted:!0,small:!0,children:["Variables that you must define: ",on]})]}),Je]})]}),$e&&(0,S.jsx)(O.Z,{px:1,children:$e})]})})}var Yi=f.forwardRef(qi),Xi=["blockRefs","blocks","chartRefs","deleteWidget","messages","onChangeChartBlock","runBlock","runningBlocks","savePipelineContent","selectedBlock","setAnyInputFocused","setErrors","setSelectedBlock","setTextareaFocused","textareaFocused","updateWidget","widgets","width"];function Qi(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Ji(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Qi(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Qi(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var $i=function(e){var n=e.blockRefs,t=e.blocks,i=e.chartRefs,o=e.deleteWidget,r=e.messages,u=e.onChangeChartBlock,c=e.runBlock,s=e.runningBlocks,a=e.savePipelineContent,d=e.selectedBlock,p=e.setAnyInputFocused,v=e.setErrors,h=e.setSelectedBlock,m=e.setTextareaFocused,b=e.textareaFocused,g=e.updateWidget,x=e.widgets,j=e.width,y=(0,ge.Z)(e,Xi),k=(0,f.useMemo)((function(){return s.reduce((function(e,n,t){return Ji(Ji({},e),{},(0,l.Z)({},n.uuid,Ji(Ji({},n),{},{priority:t})))}),{})}),[s]);return(0,S.jsxs)(Z.ZP,{flexDirection:"column",fullWidth:!0,children:[(0,S.jsx)(gi.Z,{fullHeight:!0,style:{marginLeft:.5*w.iI,marginRight:.5*w.iI},children:null===x||void 0===x?void 0:x.map((function(e){var l=e.uuid,x=k[l],Z=x?0===x.priority?rt.uF.BUSY:rt.uF.QUEUED:rt.uF.IDLE;return i.current[l]=(0,f.createRef)(),(0,f.createElement)(Yi,Ji(Ji({},y),{},{block:e,blockRefs:n,blocks:t,chartRefs:i,deleteWidget:o,executionState:Z,key:l,messages:r[l],onChangeContent:function(e){return u(l,e)},ref:i.current[l],runBlock:c,runningBlocks:s,savePipelineContent:a,selected:(null===d||void 0===d?void 0:d.uuid)===l,setAnyInputFocused:p,setErrors:v,setSelectedBlock:h,setTextareaFocused:m,textareaFocused:b,updateWidget:g,width:j}))}))}),(0,S.jsx)("div",{style:{height:"80vh"}})]})},eo=t(24138),no=p.default.svg.withConfig({displayName:"EmptyCharts__SVGStyle",componentId:"sc-ttsjrp-0"})([""]),to=function(e){var n=e.size,t=void 0===n?20:n,i=e.viewBox,o=void 0===i?"0 0 358 305":i;return(0,S.jsxs)(no,{height:t*(305/358),viewBox:o,width:t,children:[(0,S.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M290 47H66c-3.866 0-7 3.134-7 7v200c0 3.866 3.134 7 7 7h224c3.866 0 7-3.134 7-7V54c0-3.866-3.134-7-7-7zM66 46c-4.4183 0-8 3.5817-8 8v200c0 4.418 3.5817 8 8 8h224c4.418 0 8-3.582 8-8V54c0-4.4183-3.582-8-8-8H66z",fill:"#000"}),(0,S.jsx)("path",{fill:"#000",d:"M118 46h1v216h-1zM178 46h1v216h-1zM238 46h1v216h-1z"}),(0,S.jsx)("path",{fill:"#000",d:"M59 208.25v-1h239v1zM59 154.5v-1h239v1zM59 100.75v-1h239v1z"}),(0,S.jsx)("rect",{x:"209.651",y:"17.1125",width:"1.0163",height:"14.2284",rx:".5082",transform:"rotate(24.933 209.651 17.1125)",fill:"#2AB2FE"}),(0,S.jsx)("path",{fill:"#2AB2FE",d:"M207.788 23.5313l35.4813 16.4949-.4285.9215-35.4812-16.4948zM247.033 31.9316c.946-2.0359 3.364-2.9191 5.4-1.9726l31.795 14.7811-11.383 24.4836-31.794-14.7811c-2.036-.9465-2.92-3.3642-1.973-5.4002l7.955-17.1108z"}),(0,S.jsx)("path",{d:"M284.228 44.7401l31.795 14.7811c2.036.9465 2.919 3.3642 1.972 5.4001l-7.954 17.1109c-.947 2.0359-3.365 2.9191-5.401 1.9726l-31.795-14.7811 11.383-24.4836z",fill:"#0093E4"}),(0,S.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M352.959 83.7347a.5082.5082 0 00-.675.2466l-2.571 5.5296-35.481-16.4949-.428.9216 35.481 16.4949-2.571 5.5295a.5081.5081 0 00.247.675.5082.5082 0 00.675-.2466l5.57-11.9806a.5083.5083 0 00-.247-.6751z",fill:"#2AB2FE"}),(0,S.jsx)("circle",{cx:"55.2178",cy:"34.6274",r:"5.2954",fill:"#8ADE00"}),(0,S.jsx)("circle",{cx:"113.818",cy:"106.582",r:"5.2954",fill:"#8ADE00"}),(0,S.jsx)("circle",{cx:"84.2832",cy:"80.6953",r:"5.2954",fill:"#8ADE00"}),(0,S.jsx)("circle",{cx:"117.115",cy:"43.6274",r:"5.2954",fill:"#8ADE00"}),(0,S.jsx)("path",{d:"M337.354 256.065a38.3848 38.3848 0 01-10.816 21.271 38.3722 38.3722 0 01-21.293 10.768 38.3787 38.3787 0 01-23.542-3.895 38.3764 38.3764 0 01-16.691-17.054l17.208-8.494a19.1932 19.1932 0 0020.117 10.475 19.189 19.189 0 0010.647-5.385c2.886-2.88 4.78-6.605 5.407-10.635l18.963 2.949z",fill:"#FF3C3C"}),(0,S.jsx)("path",{d:"M294.876 288.277a38.3849 38.3849 0 01-21.64-10.056 38.3818 38.3818 0 01-11.516-20.899 38.3896 38.3896 0 013.06-23.666 38.386 38.386 0 0116.453-17.283l9.098 16.897a19.1904 19.1904 0 00-9.757 20.474 19.1937 19.1937 0 005.758 10.45 19.194 19.194 0 0010.82 5.028l-2.276 19.055z",fill:"#2ECDF7"}),(0,S.jsx)("path",{d:"M275.892 219.85a38.3804 38.3804 0 0145.342-1.268 38.3803 38.3803 0 0114.45 18.989 38.3873 38.3873 0 01.436 23.858l-18.346-5.631a19.1827 19.1827 0 00-.218-11.929 19.1907 19.1907 0 00-7.225-9.495 19.1875 19.1875 0 00-11.439-3.39 19.192 19.192 0 00-11.232 4.024l-11.768-15.158z",fill:"#885EFF"}),(0,S.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M259.206 102.57c.241.135.327.439.193.68l-39.314 70.576c-.613 1.1-1.962 1.565-3.124 1.093-3.766-1.53-13.762-5.285-26.356-7.597-12.6-2.314-27.762-3.177-41.881 1.037-16.112 4.81-27.78 14.07-35.424 22.135-3.822 4.032-6.635 7.763-8.491 10.483-.928 1.36-1.616 2.467-2.072 3.232-.228.383-.397.68-.509.881-.057.1-.098.177-.126.227l-.03.057-.008.014-.001.003a.5008.5008 0 01-.676.21.5005.5005 0 01-.209-.676l.442.233-.442-.233.001-.001.002-.005.009-.016.033-.062c.03-.055.073-.135.132-.239.116-.208.29-.513.523-.904.465-.782 1.165-1.906 2.105-3.285 1.881-2.756 4.727-6.53 8.591-10.607 7.727-8.153 19.539-17.532 35.864-22.405 14.331-4.278 29.668-3.391 42.347-1.063 12.685 2.329 22.748 6.109 26.552 7.654.699.284 1.51.002 1.875-.653l39.313-70.575a.5008.5008 0 01.681-.194z",fill:"#7D55EC"}),(0,S.jsx)("path",{d:"M221.651 176.111c0 2.139-1.734 3.873-3.873 3.873-2.139 0-3.873-1.734-3.873-3.873 0-2.139 1.734-3.873 3.873-3.873 2.139 0 3.873 1.734 3.873 3.873zM157.778 166.428c0 2.139-1.734 3.873-3.873 3.873-2.139 0-3.873-1.734-3.873-3.873 0-2.139 1.734-3.873 3.873-3.873 2.139 0 3.873 1.734 3.873 3.873zM106.428 204.191c0 2.139-1.734 3.873-3.873 3.873-2.139 0-3.8726-1.734-3.8726-3.873 0-2.139 1.7336-3.873 3.8726-3.873s3.873 1.734 3.873 3.873zM262.35 104.459c0 2.139-1.734 3.873-3.873 3.873-2.139 0-3.873-1.734-3.873-3.873 0-2.139 1.734-3.873 3.873-3.873 2.139 0 3.873 1.734 3.873 3.873z",fill:"#7D55EC"}),(0,S.jsx)("path",{d:"M8.5523 214.855c-.3562-1.045.2025-2.181 1.248-2.538l13.7251-4.677c1.0456-.356 2.1819.203 2.5382 1.248l29.6737 87.084-17.5112 5.967-29.6738-87.084z",fill:"#4776FF"}),(0,S.jsx)("path",{d:"M45.0935 264.735c-.3562-1.045.2025-2.182 1.2481-2.538l13.725-4.677c1.0455-.356 2.1819.203 2.5382 1.248l10.6438 31.237-17.5112 5.967-10.6439-31.237z",fill:"#FFCC19"}),(0,S.jsx)("path",{d:"M54.4607 234.868c-.3563-1.046.2025-2.182 1.248-2.538l13.7251-4.677c1.0455-.356 2.1819.202 2.5382 1.248l18.7879 55.137-17.5113 5.967-18.7879-55.137z",fill:"#4776FF"})]})};var io,oo=function(e){var n=e.blocksInNotebook;return e.extensionOption,(0,f.useMemo)((function(){return(null===n||void 0===n?void 0:n.filter((function(e){var n=e.type;return g.tf.DBT===n})))||[]}),[n]),(0,S.jsx)(S.Fragment,{})};function ro(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function lo(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ro(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ro(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}!function(e){e.DBT="dbt",e.GREAT_EXPECTATIONS="great_expectations"}(io||(io={}));var uo=function(e){var n,t,i=e.block,o=e.blockActionDescription,r=e.blocks,l=e.inputPlaceholder,u=e.loading,c=e.onClickTag,s=e.runBlockAndTrack,a=e.supportedUpstreamBlockLanguages,d=e.supportedUpstreamBlockTypes,v=e.updateBlock,h=(0,f.useContext)(p.ThemeContext),m=(0,f.useState)(""),b=m[0],g=m[1],P=(0,f.useState)(!1),E=P[0],I=P[1],T=(0,f.useState)(null),M=T[0],D=T[1],B=(0,f.useMemo)((function(){return(0,Te.HK)(r,(function(e){return e.uuid}))}),[r]);(0,f.useEffect)((function(){M||D((0,Te.HK)((null===i||void 0===i?void 0:i.upstream_blocks)||[],(function(e){return e})))}),[i,M]);var A=(0,f.useMemo)((function(){return(null===r||void 0===r?void 0:r.filter((function(e){var n=e.name,t=e.type,i=e.uuid;return((null===n||void 0===n?void 0:n.toLowerCase().includes(null===b||void 0===b?void 0:b.toLowerCase()))||(null===i||void 0===i?void 0:i.toLowerCase().includes(null===b||void 0===b?void 0:b.toLowerCase())))&&(null===d||void 0===d?void 0:d.includes(t))})))||[]}),[b,r,d]),N=(0,f.useMemo)((function(){var e=[];return null===A||void 0===A||A.forEach((function(n,t){var i=n.color,o=n.language,r=n.type,l=n.uuid,u=(0,_.qn)(r,{blockColor:i,theme:h}).accent;t>=1&&e.push((0,S.jsx)(y.Z,{light:!0},"divider-".concat(l)));var c=!(null===M||void 0===M||!M[l]),s=null!==a&&"undefined"!==typeof a&&!(null!==a&&void 0!==a&&a.includes(o));e.push((0,S.jsx)(O.Z,{px:2,py:1,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(k.Z,{alignItems:"center",children:[(0,S.jsx)(j.Z,{color:u,size:1.5*w.iI,square:!0}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(C.ZP,{monospace:!0,muted:s,small:!0,children:l})]}),s&&(0,S.jsxs)(C.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:[o," support coming soon"]}),!s&&(0,S.jsx)(x.Z,{checked:!s&&c,disabled:s,onClick:function(){D((function(e){var n=lo({},e);return c?delete n[l]:n[l]=l,n}))}})]})},"option-".concat(l)))})),e}),[A,h,M]);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(gn.Z,{onClickOutside:function(){return I(!1)},open:!0,children:[(0,S.jsx)(K.Z,{beforeIcon:(0,S.jsx)(q.HN,{}),borderless:!0,compact:!0,onChange:function(e){return g(e.target.value)},onClick:function(e){(0,Ne.j)(e),I(!0)},onFocus:function(e){(0,Ne.j)(e),I(!0)},placeholder:l,small:!0,value:b}),E&&(0,S.jsxs)(S.Fragment,{children:[N,(0,S.jsx)(O.Z,{p:1,children:(0,S.jsx)(Z.ZP,{justifyContent:"flex-end",children:(0,S.jsx)(R.ZP,{compact:!0,loading:u,onClick:function(){return v({block:i,upstream_blocks:Object.keys(M)}).then((function(){return I(!1)}))},small:!0,children:"Save selected blocks"})})})]})]}),!E&&(null===i||void 0===i||null===(n=i.upstream_blocks)||void 0===n?void 0:n.length)>=1&&(0,S.jsxs)(O.Z,{pb:1,pr:1,children:[o&&(0,S.jsx)(O.Z,{mt:1,pl:1,children:(0,S.jsx)(C.ZP,{muted:!0,small:!0,children:o})}),(0,S.jsx)(Z.ZP,{alignItems:"center",children:null===i||void 0===i||null===(t=i.upstream_blocks)||void 0===t?void 0:t.map((function(e){var n=null===B||void 0===B?void 0:B[e];if(!n)return(0,S.jsx)("div",{},e);var t=n.color,o=n.type,r=(0,_.qn)(o,{blockColor:t,theme:h}).accentLight;return(0,S.jsx)(O.Z,{ml:1,mt:1,children:(0,S.jsx)(R.ZP,{backgroundColor:r,compact:!0,disabled:!s,onClick:function(e){(0,Ne.j)(e),c?c(n):null===s||void 0===s||s({block:lo(lo({},i),{},{upstream_blocks:[null===n||void 0===n?void 0:n.uuid]})})},small:!0,children:(0,S.jsx)(C.ZP,{monospace:!0,small:!0,children:e})})},e)}))})]})]})},co=t(75634);function so(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function ao(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?so(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):so(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var po=function(e){var n=e.addNewBlockAtIndex,t=e.autocompleteItems,i=e.blockRefs,o=e.blocks,u=e.blocksInNotebook,c=e.deleteBlock,s=e.extensionOption,a=e.fetchFileTree,d=e.fetchPipeline,p=e.interruptKernel,h=e.messages,m=e.onChangeCallbackBlock,b=e.onChangeCodeBlock,x=e.pipeline,j=e.runBlock,y=e.runningBlocks,k=e.savePipelineContent,Z=e.selectedBlock,_=e.setAnyInputFocused,E=e.setErrors,I=e.setSelectedBlock,T=e.setTextareaFocused,M=e.showBrowseTemplates,D=e.textareaFocused,R=(0,f.useRef)(null),B=(0,f.useState)(!1),A=B[0],N=B[1],L=(s||{}).uuid,H=(x||{}).extensions,W=(0,f.useMemo)((function(){return(null===s||void 0===s?void 0:s.templates)||[]}),[s]),G=(0,f.useMemo)((function(){return null===H||void 0===H?void 0:H[L]}),[L,H]),z=(0,f.useMemo)((function(){return(null===G||void 0===G?void 0:G.blocks)||[]}),[G]),K=(0,f.useMemo)((function(){return(0,Te.HK)(z,(function(e){return e.uuid}))}),[z]),Y=(0,f.useMemo)((function(){return L===(null===Z||void 0===Z?void 0:Z.extension_uuid)&&K[null===Z||void 0===Z?void 0:Z.uuid]}),[K,L,Z]),X=(0,f.useMemo)((function(){return y.reduce((function(e,n,t){return ao(ao({},e),{},(0,l.Z)({},n.uuid,ao(ao({},n),{},{priority:t})))}),{})}),[y]),Q=(0,v.Db)((function(e){var n=e.block,t=e.upstream_blocks;return V.ZP.blocks.pipelines.useUpdate(encodeURIComponent(null===x||void 0===x?void 0:x.uuid),encodeURIComponent(null===n||void 0===n?void 0:n.uuid),{query:{extension_uuid:null===n||void 0===n?void 0:n.extension_uuid}})({block:{upstream_blocks:t}})}),{onSuccess:function(e){return(0,ee.wD)(e,{callback:function(){d()},onErrorCallback:function(e,n){return null===E||void 0===E?void 0:E({errors:n,response:e})}})}}),J=(0,r.Z)(Q,2),$=J[0],ne=J[1].isLoading,te=(0,f.useMemo)((function(){return z.map((function(e,n){var r=ao(ao({},e),{},{extension_uuid:L}),l=r.type,s=r.uuid,v=(null===Z||void 0===Z?void 0:Z.uuid)===s,P=X[s],C=P?0===P.priority?rt.uF.BUSY:rt.uF.QUEUED:rt.uF.IDLE,M="".concat(l,"s/").concat(s,".py");return i.current[M]=(0,f.createRef)(),(0,S.jsx)(O.Z,{mt:w.cd,children:(0,S.jsx)(F.Z,{allBlocks:o,autocompleteItems:t,block:r,blockIdx:n,blockRefs:i,blocks:o,defaultValue:r.content,deleteBlock:function(e){c(ao(ao({},e),{},{extension_uuid:L})),_(!1)},executionState:C,extraContent:(0,S.jsx)(uo,{block:r,blockActionDescription:"Click a block name to run expectations on it.",blocks:u,inputPlaceholder:"Select blocks to run expectations on",loading:ne,supportedUpstreamBlockLanguages:[g.t6.PYTHON],supportedUpstreamBlockTypes:[g.tf.DATA_EXPORTER,g.tf.DATA_LOADER,g.tf.DBT,g.tf.TRANSFORMER],updateBlock:$}),fetchFileTree:a,fetchPipeline:d,hideRunButton:!0,interruptKernel:p,messages:h[s],noDivider:!0,onCallbackChange:function(e){return m(l,s,e)},onChange:function(e){return b(l,s,e)},pipeline:x,ref:i.current[M],runBlock:j,runningBlocks:y,savePipelineContent:k,selected:v,setAnyInputFocused:_,setErrors:E,setSelected:function(e){return I(!0===e?r:null)},setTextareaFocused:T,textareaFocused:v&&D})},s)}))}),[t,i,o,u,c,z,L,a,d,p,ne,h,m,b,x,j,y,X,k,Z,_,E,I,T,D,$]),ie="Extensions/GreatExpectations/index",oe=(0,On.y)(),re=oe.disableGlobalKeyboardShortcuts,le=oe.registerOnKeyDown,ue=oe.unregisterOnKeyDown;return(0,f.useEffect)((function(){return function(){ue(ie)}}),[ue,ie]),le(ie,(function(e,n){!re&&Y&&((0,ni.y)([kn.zX,kn.Um],n)||(0,ni.y)([kn.PQ,kn.Um],n))&&(e.preventDefault(),k())}),[Y,k]),(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(O.Z,{mb:w.cd,children:[(0,S.jsx)(C.ZP,{default:!0,children:"Add an extension block to start writing expectations for blocks in the current pipeline."}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsxs)(C.ZP,{default:!0,children:["When a block in your pipeline runs, it\u2019ll run any tests you define in its code. All associated extension blocks will also run during that phase. Learn more about the ",(0,S.jsx)(P.Z,{href:"https://docs.mage.ai/development/testing/great-expectations",openNewWindow:!0,children:"Great Expectation power up"}),"."]})}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsxs)(C.ZP,{default:!0,children:["For all available expectations, read Great Expectation\u2019s ",(0,S.jsx)(P.Z,{href:"https://greatexpectations.io/expectations/",openNewWindow:!0,children:"documentation"}),"."]})})]}),te,(0,S.jsx)(O.Z,{mt:w.cd,children:(0,S.jsx)(gn.Z,{onClickOutside:function(){return N(!1)},open:!0,children:(0,S.jsx)(Rt.Z,{disableKeyboardShortcuts:!0,items:null===W||void 0===W?void 0:W.map((function(e){var t=e.description,i=e.name,o=e.path;return{label:function(){return i},onClick:function(){return n({config:{template_path:o},extension_uuid:L,type:g.tf.EXTENSION},(null===z||void 0===z?void 0:z.length)||0)},tooltip:function(){return t},uuid:e.uuid}})).concat((0,$t.hr)((function(e){return n(ao(ao({},e),{},{extension_uuid:L,type:g.tf.EXTENSION}),(null===z||void 0===z?void 0:z.length)||0)}),g.tf.EXTENSION,null,{onlyCustomTemplate:!0,showBrowseTemplates:M})),onClickCallback:function(){return N(!1)},open:A,parentRef:R,uuid:"Extension",children:(0,S.jsx)(U.ZP,{beforeElement:(0,S.jsx)(co.Wx,{teal:!0,children:(0,S.jsx)(q.mm,{size:co.ZG})}),inline:!0,onClick:function(e){e.preventDefault(),N(!0)},uuid:"AddNewBlocks/Extension",children:"Extension block"})})})})]})},fo=t(15610),vo=t(69419),ho=["pipeline"];function mo(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function bo(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?mo(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):mo(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var go=function(e){var n=e.pipeline,t=(0,ge.Z)(e,ho),i=(0,h.useRouter)(),o=V.ZP.extension_options.list().data,r=(0,f.useMemo)((function(){return(null===o||void 0===o?void 0:o.extension_options)||[]}),[o]),l=(0,f.useMemo)((function(){return(0,Te.HK)(r,(function(e){return e.uuid}))}),[r]),u=(0,f.useState)(null),c=u[0],s=u[1],a=(0,f.useMemo)((function(){return l[c]}),[l,c]),d=(0,f.useMemo)((function(){return bo(bo({},t),{},{pipeline:n})}),[n,t]);(0,f.useEffect)((function(){var e;s(null===(e=(0,vo.iV)())||void 0===e?void 0:e.extension)}),[i.asPath]);var p=(0,f.useMemo)((function(){return n?(io.GREAT_EXPECTATIONS===c?e=po:io.DBT===c&&(e=oo),e?(0,S.jsx)(e,bo(bo({},d),{},{extensionOption:a})):void 0):null;var e}),[a,n,c,d]);return(0,S.jsx)(A.W,{backend:N.PD,children:(0,S.jsxs)(O.Z,{p:w.cd,children:[!c&&(0,S.jsxs)(O.Z,{mb:w.cd,children:[(0,S.jsxs)(C.ZP,{default:!0,children:["Power up your pipeline with extensions. Learn more about ",(0,S.jsx)(P.Z,{href:"https://docs.mage.ai/design/blocks/extension",openNewWindow:!0,children:"extension blocks"}),"."]}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsxs)(C.ZP,{default:!0,children:["Click on a power up below to add and configure it for the ",(0,S.jsx)(C.ZP,{inline:!0,monospace:!0,children:null===n||void 0===n?void 0:n.uuid})," pipeline."]})})]}),!o&&!c&&(0,S.jsx)(z.Z,{}),p,!c&&(null===r||void 0===r?void 0:r.map((function(e,n){var t=e.description,o=e.name,r=e.uuid;return(0,S.jsx)(O.Z,{mt:n>=1?w.cd:0,children:(0,S.jsx)(P.Z,{block:!0,noHoverUnderline:!0,onClick:function(){return(0,fo.u)({extension:r},{pushHistory:!0})},preventDefault:!0,children:(0,S.jsx)(Bn.Z,{dark:!0,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(k.Z,{alignItems:"center",children:[(0,S.jsx)(Be.Z,{fullWidth:!1,children:(0,S.jsx)(O.Z,{p:w.cd,children:(0,S.jsx)(Z.ZP,{alignItems:"center",children:(0,S.jsx)("img",{alt:o,height:3*w.iI,src:"".concat(i.basePath,"/images/extensions/").concat(r,"/logo.png"),width:3*w.iI})})})}),(0,S.jsx)(O.Z,{mr:w.cd}),(0,S.jsxs)(k.Z,{flexDirection:"column",children:[(0,S.jsx)(C.ZP,{bold:!0,children:o}),(0,S.jsx)(C.ZP,{default:!0,small:!0,children:t})]})]}),(0,S.jsx)(q._Q,{})]})})})},r)})))]})})},xo=t(28385),jo=t(9134),yo=t(83784),ko=t(30229),Zo=t(8916);var Po=function(e){e.blocks;var n=e.fetchVariables,t=e.pipeline,i=e.selectedBlock,o=e.setErrorMessages,l=e.variables,u=e.width,c=(0,f.useState)(!1),s=c[0],a=c[1],d=(0,f.useState)(),p=d[0],h=d[1],m=(0,f.useState)(),b=m[0],x=m[1],j=null===t||void 0===t?void 0:t.uuid,y=(0,v.Db)(V.ZP.variables.pipelines.useCreate(j),{onSuccess:function(e){return(0,ee.wD)(e,{onErrorCallback:function(e){var n=e.error,t=n.message,i=n.exception;o((function(e){var n=e||[];return i&&(n=n.concat(i)),t&&(n=n.concat(t)),n}))}})}}),k=(0,r.Z)(y,1)[0],_=(0,v.Db)((function(e){return V.ZP.variables.pipelines.useDelete(j,e)()}),{onSuccess:function(e){return(0,ee.wD)(e,{callback:function(){n()},onErrorCallback:function(e){var n=e.error,t=(n.errors,n.message);o((function(e){return e.concat(t)}))}})}}),E=(0,r.Z)(_,1)[0],I=(0,f.useCallback)((function(e){if("Enter"===e.key){var t=b;try{t=JSON.parse(b)}catch(i){}k({variable:{name:p,value:t}}).then((function(){n(),h(null),x(null)})),(0,ei.ez)(),a(!1)}else"Escape"===e.key&&((0,ei.ez)(),a(!1))}),[k,n,p,b]),T=(0,f.useMemo)((function(){return u-4*w.iI}),[u]),M=(0,f.useMemo)((function(){return(0,Zo.wx)(l,(function(e){return e.uuid===yo.C}))}),[l]),D=(0,f.useMemo)((function(){return(0,Zo.wx)(l,(function(e){return e.uuid===(null===i||void 0===i?void 0:i.uuid)}))}),[i,l]),R=(0,f.useMemo)((function(){return(0,S.jsxs)(yi,{width:T,children:[s&&(0,S.jsxs)(gi.Z,{children:[(0,S.jsx)(bi.Z,{md:1,children:(0,S.jsx)(ki,{noPadding:!0,children:(0,S.jsx)(U.ZP,{backgroundColor:Zi.qJ,borderless:!0,centerText:!0,muted:!0,onClick:function(){navigator.clipboard.writeText(p),Dn.Am.success("Successfully copied to clipboard.",{position:Dn.Am.POSITION.BOTTOM_RIGHT,toastId:p})},uuid:"Sidekick/GlobalVariables/".concat(p),withIcon:!0,children:(0,S.jsx)(q.CK,{size:2.5*w.iI})})})}),(0,S.jsx)(bi.Z,{md:4,children:(0,S.jsx)(ki,{children:(0,S.jsx)(K.Z,{borderless:!0,compact:!0,fullWidth:!0,monospace:!0,onChange:function(e){h(e.target.value),e.preventDefault()},onKeyDown:I,paddingHorizontal:0,placeholder:"variable",small:!0,value:p})})}),(0,S.jsx)(bi.Z,{md:7,children:(0,S.jsx)(ki,{children:(0,S.jsx)(K.Z,{borderless:!0,compact:!0,fullWidth:!0,monospace:!0,onChange:function(e){x(e.target.value),e.preventDefault()},onKeyDown:I,paddingHorizontal:0,placeholder:"enter value",small:!0,value:b})})})]}),null===M||void 0===M?void 0:M.map((function(e){return(0,S.jsx)(Oi,{deleteVariable:function(){return E(e.uuid)},fetchVariables:n,pipelineUUID:j,variable:e},e.uuid)}))]})}),[E,M,p,b,j,h,x,a,s,T]),B=(0,f.useMemo)((function(){return(0,S.jsx)(yi,{width:T,children:null===D||void 0===D?void 0:D.map((function(e){return(0,S.jsx)(Oi,{copyText:(n=e.uuid,"from mage_ai.data_preparation.variable_manager import (\n get_variable,\n)\n\n".concat(function(e,n,t){return"\n".concat(t," = get_variable('").concat(e,"', '").concat(n,"', '").concat(t,"')\n")}(j,null===i||void 0===i?void 0:i.uuid,n))),hideEdit:!0,pipelineUUID:j,variable:e},e.uuid);var n}))})}),[D,i,T]);return(0,S.jsxs)(O.Z,{p:w.cd,children:[(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(ce.Z,{level:4,monospace:!0,children:"Global Variables"}),(0,S.jsx)(O.Z,{ml:2}),(0,S.jsx)(U.ZP,{Icon:q.mm,blackBorder:!0,inline:!0,onClick:function(){return a((function(e){return!e}))},uuid:"Sidekick/GlobalVariables/addNewVariable",children:"New"})]})}),(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsxs)(C.ZP,{muted:!0,children:["Press ",(0,S.jsx)(C.ZP,{bold:!0,default:!0,inline:!0,monospace:!0,children:"Enter"})," or ",(0,S.jsx)(C.ZP,{bold:!0,default:!0,inline:!0,monospace:!0,children:"Return"})," to save changes."]})}),(0,S.jsx)(O.Z,{mb:w.cd,children:R}),(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsx)(C.ZP,{children:"Global variables will be passed into all non-scratchpad blocks as keyword arguments (Python), interpolated variables (SQL), or vector elements (R). To load a global variable, use the following syntax:"})}),(0,S.jsxs)(O.Z,{mb:w.cd,children:[(0,S.jsxs)(C.ZP,{bold:!0,large:!0,children:["For Python (",(0,S.jsx)(P.Z,{href:"https://docs.mage.ai/production/configuring-production-settings/runtime-variable",large:!0,openNewWindow:!0,primary:!0,children:"docs"}),"):"]}),(0,S.jsx)(jo.Z,{language:"python",small:!0,source:"\n var = kwargs['variable_name']\n"})]}),(0,S.jsxs)(O.Z,{mb:w.cd,children:[(0,S.jsxs)(C.ZP,{bold:!0,large:!0,children:["For SQL (",(0,S.jsx)(P.Z,{href:"https://docs.mage.ai/guides/sql-blocks#variables",large:!0,openNewWindow:!0,primary:!0,children:"docs"}),"):"]}),(0,S.jsx)(jo.Z,{language:"sql",small:!0,source:"\n {{ variable_name }}\n"})]}),(0,S.jsxs)(O.Z,{mb:w.cd,children:[(0,S.jsxs)(C.ZP,{bold:!0,large:!0,children:["For R (",(0,S.jsx)(P.Z,{href:"https://docs.mage.ai/guides/r-blocks#runtime-variables",large:!0,openNewWindow:!0,primary:!0,children:"docs"}),"):"]}),(0,S.jsx)(jo.Z,{language:"r",small:!0,source:"\n var <- global_vars['variable_name']\n"})]}),(0,S.jsxs)(O.Z,{mb:w.cd,children:[(0,S.jsx)(ce.Z,{level:4,monospace:!0,children:"Trigger Runtime Variables"}),(0,S.jsx)(O.Z,{mb:w.cd}),(0,S.jsx)(C.ZP,{children:"Depending on what kind of trigger you use for this pipeline, some default runtime variables will be provided."})]}),Object.values(ko.Xm).map((function(e,n){var t;return(0,S.jsxs)(O.Z,{mb:w.cd,children:[(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsx)(C.ZP,{large:!0,monospace:!0,children:(0,$.vg)(null===(t=ko.Z4[e])||void 0===t?void 0:t.call(ko.Z4))})}),(0,Zo.JZ)([],e).map((function(n,t){return(0,S.jsx)(Oi,{hideEdit:!0,pipelineUUID:j,variable:n},"var_".concat(e,"_").concat(t))}))]},"".concat(e,"_").concat(n))})),D&&D.length>0&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Z,{my:2,children:(0,S.jsx)(ce.Z,{level:4,monospace:!0,children:"Block Output Variables"})}),(0,S.jsx)(O.Z,{mb:2,children:B}),(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsxs)(C.ZP,{children:["Output variables can be used in any ",(0,S.jsx)(C.ZP,{bold:!0,inline:!0,monospace:!0,warning:!0,children:g.tf.SCRATCHPAD})," block. They are for scratchpad blocks, specifically. To get upstream block outputs inside of other blocks, use the positional arguments."]})}),(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsx)(C.ZP,{children:"To load the variable in a scratchpad block, use the following syntax:"})}),(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsx)(jo.Z,{language:"python",small:!0,source:"\n from mage_ai.data_preparation.variable_manager import (\n get_variable,\n )\n\n\n df = get_variable(\n 'pipeline_uuid',\n 'block_uuid',\n 'variable_name',\n )\n"})})]})]})},Oo=t(89565),Co=t.n(Oo),wo=t(88494),_o=p.default.div.withConfig({displayName:"indexstyle__OutputHeaderStyle",componentId:"sc-wkjnrg-0"})([""," overflow-x:auto;"],(0,Ln.y$)()),So=p.default.div.withConfig({displayName:"indexstyle__OutputContainerStyle",componentId:"sc-wkjnrg-1"})([""," overflow-y:scroll;"," ",""],Ln.w5,(function(e){return e.height&&"\n height: ".concat(e.height,"px;\n ")}),(function(e){return!e.height&&"\n max-height: ".concat(e.maxHeight||300,"px;\n ")}));function Eo(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Io(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Eo(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Eo(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var To=function(e){var n=e.cancelPipeline,t=e.checkIfPipelineRunning,i=e.executePipeline,o=e.isPipelineExecuting,r=e.pipelineExecutionHidden,l=e.pipelineMessages,u=e.setPipelineExecutionHidden,c=(0,f.useMemo)((function(){return(null===l||void 0===l?void 0:l.length)||0}),[l]),s=(0,f.useMemo)((function(){return c>100?l.slice(-100):l}),[c,l]),a=(0,f.useCallback)((function(){(0,ei.ez)(),i()}),[i]),d=(0,f.useCallback)((function(){(0,ei.ez)(),n()}),[n]),p=(0,f.useCallback)((function(){var e=!r;u(e),(0,pn.t8)(pn.Q9,e)}),[r,u]);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(_o,{children:(0,S.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(k.Z,{children:[(0,S.jsx)(R.ZP,{beforeIcon:(0,S.jsx)(q.JM,{inverted:!0,size:2*w.iI}),compact:o,disabled:o,loading:o,onClick:a,success:!0,children:(0,S.jsx)(C.ZP,{bold:!0,inverted:!0,noWrapping:!0,primary:!1,children:"Execute pipeline"})}),(0,S.jsx)(O.Z,{ml:1}),o&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(R.ZP,{beforeIcon:(0,S.jsx)(q.x8,{inverted:!0,size:2*w.iI}),onClick:d,success:!0,children:(0,S.jsx)(C.ZP,{bold:!0,inverted:!0,noWrapping:!0,primary:!1,children:"Cancel pipeline"})}),(0,S.jsx)(O.Z,{ml:1})]}),(0,S.jsx)(R.ZP,{onClick:t,secondary:!0,children:(0,S.jsx)(C.ZP,{bold:!0,noWrapping:!0,children:"Running status"})})]}),(0,S.jsxs)(k.Z,{alignItems:"center",children:[(0,S.jsx)(O.Z,{ml:1}),(0,S.jsx)(C.ZP,{children:"Hide"}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(Oe.Z,{checked:r,onCheck:p})]})]})}),!r&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Z,{mb:1}),(0,S.jsx)(So,{noScrollbarTrackBackground:!0,children:(0,S.jsx)(wo.Nk,{executedAndIdle:!0,hasError:!1,selected:!0,children:s.map((function(e,n){var t=e.data,i=e.type,o=[],r=(o=(o=Array.isArray(t)?t:[t]).filter((function(e){return e}))).length;return o.map((function(e,t){var o,l={first:0===n&&0===t,last:n===c-1&&t===r-1};return rt.jU.includes(i)?o=(0,S.jsx)(wo.T5,Io(Io({},l),{},{children:(0,S.jsx)(C.ZP,{monospace:!0,preWrap:!0,children:(0,S.jsx)(Co(),{children:e})})})):i===rt.Gi.IMAGE_PNG&&(o=(0,S.jsx)("div",{style:{backgroundColor:"white"},children:(0,S.jsx)("img",{alt:"Image ".concat(n," from code output"),src:"data:image/png;base64, ".concat(e)})})),(0,S.jsx)("div",{children:o},"code-output-".concat(n,"-").concat(t))}))}))})})]})]})},Mo=t(81769),Do=t(91437),Ro=(w.iI,p.default.div.withConfig({displayName:"indexstyle__AfterFooterStyle",componentId:"sc-1qjqori-0"})(["",""],(function(e){return"\n background-color: ".concat((e.theme.background||Se.Z.background).panel,";\n ")})),p.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-1qjqori-1"})([""," border-style:solid;border-width:1px;position:relative;"," "," "," "," "," "," ",""],_.Kf,(function(e){return!e.noBorderRadiusTop&&"\n border-top-left-radius: ".concat(Ee.n_,"px;\n border-top-right-radius: ").concat(Ee.n_,"px;\n ")}),(function(e){return e.noBorderRadiusTop&&"\n border-top: none !important;\n "}),(function(e){return!e.noBorderRadiusBottom&&"\n border-bottom-left-radius: ".concat(Ee.n_,"px;\n border-bottom-right-radius: ").concat(Ee.n_,"px;\n ")}),(function(e){return e.noBorderRadiusBottom&&"\n border-bottom: none !important;\n "}),(function(e){return!e.noBackground&&"\n background-color: ".concat((e.theme.background||Se.Z.background).panel,";\n ")}),(function(e){return!e.borderColor&&"\n border-color: ".concat((e.theme.borders||Se.Z.borders).light,";\n ")}),(function(e){return e.borderColor&&"\n border-color: ".concat(e.borderColor,";\n ")}))),Bo=(p.default.div.withConfig({displayName:"indexstyle__HeaderStyle",componentId:"sc-1qjqori-2"})(["padding:","px;",""],w.cd*w.iI,(function(e){return"\n border-bottom: 1px solid ".concat((e.theme.borders||Se.Z.borders).light,";\n ")})),p.default.div.withConfig({displayName:"indexstyle__NavigationStyle",componentId:"sc-1qjqori-3"})([""," "," ",""],(0,Do.eR)(),(function(e){return!e.selected&&"\n &:hover {\n background-color: ".concat((e.theme.interactive||Se.Z.interactive).rowHoverBackground,";\n }\n ")}),(function(e){return e.selected&&"\n background-color: ".concat((e.theme.background||Se.Z.background).codeTextarea,";\n ")})),p.default.div.withConfig({displayName:"indexstyle__StreamGridGroupStyle",componentId:"sc-1qjqori-4"})(["position:absolute;"]),p.default.div.withConfig({displayName:"indexstyle__StreamGridGroupInnerStyle",componentId:"sc-1qjqori-5"})([""," overflow:auto;position:fixed;",""],Ln.w5,(function(e){return e.borderRight&&"\n border-right: 1px solid ".concat((e.theme.borders||Se.Z.borders).light,";\n ")})),p.default.div.withConfig({displayName:"indexstyle__StreamGridStyle",componentId:"sc-1qjqori-6"})(["border-radius:","px;padding:","px;margin:","px;"," "," "," "," ",""],Ee.n_,w.cd*w.iI,1*w.iI,(function(e){return!e.warning&&"\n &:hover {\n cursor: pointer;\n }\n "}),(function(e){return!e.selected&&!e.warning&&"\n border: 1px solid ".concat((e.theme.borders||Se.Z.borders).light,";\n ")}),(function(e){return e.warning&&!e.selected&&"\n border: 1px solid ".concat((e.theme.accent||Se.Z.accent).warningTransparent,";\n ")}),(function(e){return e.warning&&e.selected&&"\n border: 1px solid ".concat((e.theme.accent||Se.Z.accent).warning,";\n ")}),(function(e){return e.selected&&!e.warning&&"\n background-color: ".concat((e.theme.background||Se.Z.background).panel,";\n border: 1px solid ").concat((e.theme.borders||Se.Z.borders).contrast,";\n ")})),p.default.div.withConfig({displayName:"indexstyle__BackgroundStyle",componentId:"sc-1qjqori-7"})(["",""],(function(e){return"\n background-color: ".concat((e.theme.background||Se.Z.background).panel,";\n ")})),p.default.div.withConfig({displayName:"indexstyle__ButtonContainerStyle",componentId:"sc-1qjqori-8"})(["bottom:0;position:fixed;z-index:1;"," ",""],(function(e){return"\n background-color: ".concat((e.theme.background||Se.Z.background).panel,";\n border-left: 1px solid ").concat((e.theme.borders||Se.Z.borders).light,";\n border-right: 1px solid ").concat((e.theme.borders||Se.Z.borders).light,";\n border-top: 1px solid ").concat((e.theme.borders||Se.Z.borders).light,";\n ")}),(function(e){return e.width&&"\n width: ".concat(e.width,"px;\n ")}))),Ao=t(19452);function No(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Lo(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?No(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):No(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Fo=function(e){var n,t,i,o,l=e.index,u=e.permission,c=e.setPermissions,s=e.updatePermission;return(0,S.jsx)(Ro,{children:(0,S.jsx)(O.Z,{p:w.cd,children:(0,S.jsxs)(Z.ZP,{alignItems:"flex-start",flexDirection:"row",children:[(0,S.jsx)(R.ZP,{iconOnly:!0,onClick:function(){return c((function(e){return(0,Te.oM)(e,l)}))},children:(0,S.jsx)(q.x8,{})}),(0,S.jsx)(O.Z,{mr:w.cd}),(0,S.jsxs)(Z.ZP,{flexDirection:"column",children:[(0,S.jsxs)(Z.ZP,{alignItems:"center",flexDirection:"row",children:[(0,S.jsx)(ce.Z,{level:5,children:"Triggers"}),(0,S.jsx)(O.Z,{mr:w.cd}),(0,S.jsx)(Z.ZP,{alignItems:"center",children:(0,S.jsx)(R.ZP,{beforeIcon:(0,S.jsx)(q.mm,{}),compact:!0,onClick:function(e){(0,Ne.j)(e),s(Lo(Lo({},u),{},{triggers:((null===u||void 0===u?void 0:u.triggers)||[]).concat({schedule_interval:"",schedule_type:"",uuid:""})}))},secondary:!0,small:!0,children:"Add trigger"})})]}),(null===u||void 0===u||null===(n=u.triggers)||void 0===n?void 0:n.length)>=1&&(0,S.jsx)(O.Z,{mt:w.cd,children:null===u||void 0===u||null===(t=u.triggers)||void 0===t?void 0:t.map((function(e,n){var t=e.schedule_interval,i=e.schedule_type,o=e.uuid;return(0,S.jsx)(O.Z,{mt:n>=1?1:0,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(R.ZP,{iconOnly:!0,noBackground:!0,noBorder:!0,onClick:function(e){(0,Ne.j)(e);var t=(0,Te.oM)((null===u||void 0===u?void 0:u.triggers)||[],n);s(Lo(Lo({},u),{},{triggers:t}))},children:(0,S.jsx)(q.x8,{})}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(G.Z,{compact:!0,onChange:function(e){var t,i=e.target.value,o=Lo({},u),r=Lo({},null===o||void 0===o||null===(t=o.triggers)||void 0===t?void 0:t[n]);r.schedule_type=i,o.triggers[n]=r,s(o)},placeholder:"Type",small:!0,value:i,children:Object.entries(ko.Z4).map((function(e){var n=(0,r.Z)(e,2),t=n[0],i=n[1];return(0,S.jsx)("option",{value:t,children:(0,$.kC)(i())},t)}))}),(ko.Xm.TIME===i||!i)&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(G.Z,{compact:!0,monospace:!0,onChange:function(e){var t,i=e.target.value,o=Lo({},u),r=Lo({},null===o||void 0===o||null===(t=o.triggers)||void 0===t?void 0:t[n]);r.schedule_interval=i,o.triggers[n]=r,s(o)},placeholder:"Interval",small:!0,value:t,children:ko.Wb.map((function(e){return(0,S.jsx)("option",{value:e,children:e},e)}))})]})]})},"permission-trigger-".concat(l,"-").concat(n,"-").concat(o))}))})]}),(0,S.jsx)(O.Z,{mr:w.Mq}),(0,S.jsxs)(Z.ZP,{flexDirection:"column",children:[(0,S.jsxs)(Z.ZP,{alignItems:"center",flexDirection:"row",children:[(0,S.jsx)(ce.Z,{level:5,children:"Roles"}),(0,S.jsx)(O.Z,{mr:w.cd}),(0,S.jsx)(Z.ZP,{alignItems:"center",children:(0,S.jsx)(R.ZP,{beforeIcon:(0,S.jsx)(q.mm,{}),compact:!0,onClick:function(e){(0,Ne.j)(e),s(Lo(Lo({},u),{},{roles:((null===u||void 0===u?void 0:u.roles)||[]).concat({role:"",uuid:""})}))},secondary:!0,small:!0,children:"Add role"})})]}),(null===u||void 0===u||null===(i=u.roles)||void 0===i?void 0:i.length)>=1&&(0,S.jsx)(O.Z,{mt:w.cd,children:null===u||void 0===u||null===(o=u.roles)||void 0===o?void 0:o.map((function(e,n){var t=e.role,i=e.uuid;return(0,S.jsx)(O.Z,{mt:n>=1?1:0,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(R.ZP,{iconOnly:!0,noBackground:!0,noBorder:!0,onClick:function(e){(0,Ne.j)(e);var t=(0,Te.oM)((null===u||void 0===u?void 0:u.roles)||[],n);s(Lo(Lo({},u),{},{roles:t}))},children:(0,S.jsx)(q.x8,{})}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(G.Z,{compact:!0,monospace:!0,onChange:function(e){var t,i=e.target.value,o=Lo({},u),r=Lo({},null===o||void 0===o||null===(t=o.roles)||void 0===t?void 0:t[n]);r.role=i,o.roles[n]=r,s(o)},placeholder:"Role",small:!0,value:t,children:Ao.Z3.map((function(e){return(0,S.jsx)("option",{value:e,children:e},e)}))})]})},"permission-role-".concat(l,"-").concat(n,"-").concat(i))}))})]})]})})})},Uo=t(35576),Ho=t(3917);function Wo(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Go(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Wo(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Wo(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var zo=function(e){var n,t,i=e.blockInteractionsMapping,r=e.containerWidth,u=e.createInteraction,c=e.interactions,s=e.interactionsMapping,a=e.isLoadingCreateInteraction,d=e.isLoadingUpdatePipelineInteraction,p=e.permissions,v=e.pipeline,h=e.pipelineInteraction,m=e.refAfterFooter,b=e.savePipelineInteraction,x=e.selectedBlock,j=e.setBlockInteractionsMapping,P=e.setInteractionsMapping,_=e.setPermissions,E=e.setSelectedBlock,I=e.updatePipelineInteraction,T=(0,f.useRef)(null),M=(0,f.useRef)(null),D=(0,f.useRef)(null),B=(0,f.useState)(null),A=B[0],N=B[1],L=(0,f.useState)(null),F=L[0],U=L[1],H=(0,f.useState)(!1),W=H[0],G=H[1],z=(0,f.useState)(null),V=z[0],Y=z[1],X=(0,f.useState)(!1),Q=X[0],J=X[1],$=(0,f.useState)(null),ee=($[0],$[1]),ne=(0,f.useState)(null),te=ne[0],ie=ne[1],oe=(0,f.useState)(null),re=oe[0],le=oe[1],ue=(0,f.useMemo)((function(){return"undefined"!==typeof i?i:re}),[i,re]),se=(0,f.useMemo)((function(){return"undefined"!==typeof s?s:te}),[s,te]),ae=(0,f.useCallback)((function(e,n){return null!==n&&void 0!==n&&n.initialBootstrap||G(!0),"undefined"!==typeof j?j(e):le(e)}),[j,le,G]),de=(0,f.useCallback)((function(e,n){return null!==n&&void 0!==n&&n.initialBootstrap||G(!0),"undefined"!==typeof P?P(e):ie(e)}),[P,ie,G]),pe=(0,f.useState)(null),fe=pe[0],ve=pe[1],he=(0,f.useCallback)((function(e,n,t,i){return ae((function(r){var u=(0,o.Z)((null===r||void 0===r?void 0:r[e])||[]);return null!==i&&void 0!==i&&i.remove?u=(0,Te.oM)(u,n):u[n]=Go(Go({},u[n]),t),Go(Go({},r),{},(0,l.Z)({},e,u))}))}),[ae]),me=(0,f.useCallback)((function(e,n){U(Number(new Date)),null!==n&&void 0!==n&&n.initialBootstrap||G(!0),"undefined"!==typeof _?_(e):ve(e)}),[U,_,ve,G]),be=(0,f.useMemo)((function(){var e;return null===(e="undefined"!==typeof p?p:fe)||void 0===e?void 0:e.map((function(e,n){var t=e.roles,i=e.triggers;return{roles:null===t||void 0===t?void 0:t.map((function(e,t){return{role:"string"===typeof e?e:null===e||void 0===e?void 0:e.role,uuid:"".concat(n,"-").concat(F,"-").concat(t)}})),triggers:null===i||void 0===i?void 0:i.map((function(e,t){return Go(Go({},e),{},{uuid:"".concat(n,"-").concat(F,"-").concat(t)})})),uuid:"".concat(n,"-").concat(F)}}))}),[F,p,fe]),ge=(0,f.useCallback)((function(){N(Number(new Date)),G(!1)}),[N,G]),xe=(0,f.useCallback)((function(){b?null===b||void 0===b||b().then((function(){return ge()})):null===I||void 0===I||I(Go(Go({},h),{},{blocks:ue,interactions:se,permissions:null===be||void 0===be?void 0:be.map((function(e){var n=e.roles,t=e.triggers;return{roles:null===n||void 0===n?void 0:n.map((function(e){return"string"===typeof e?e:null===e||void 0===e?void 0:e.role})),triggers:null===t||void 0===t?void 0:t.map((function(e){return{schedule_interval:e.schedule_interval,schedule_type:e.schedule_type}}))}}))})).then((function(){return ge()}))}),[ue,se,be,h,ge,b,I]),je=(0,f.useMemo)((function(){return(null===v||void 0===v?void 0:v.blocks)||[]}),[v]),ye=(0,f.useMemo)((function(){return null===je||void 0===je?void 0:je.reduce((function(e,n,t){return Go(Go({},e),{},(0,l.Z)({},String(t),!0))}),{})}),[je]);(0,f.useEffect)((function(){"undefined"===typeof s&&!se&&(null===c||void 0===c?void 0:c.length)>=1&&de((0,Te.HK)(c||[],(function(e){return e.uuid})),{initialBootstrap:!0})}),[c,se,s,de]),(0,f.useEffect)((function(){"undefined"===typeof i&&!ue&&null!==h&&void 0!==h&&h.blocks&&ae(null===h||void 0===h?void 0:h.blocks,{initialBootstrap:!0})}),[ue,i,h,ae]),(0,f.useEffect)((function(){!be&&null!==h&&void 0!==h&&h.permissions&&me(null===h||void 0===h?void 0:h.permissions,{initialBootstrap:!0})}),[be,h,me]);var ke=(0,f.useMemo)((function(){var e=[],n=(null===je||void 0===je?void 0:je.length)||0;return null===je||void 0===je||je.map((function(t,i){var o=(t||{uuid:null}).uuid,l=(null===ue||void 0===ue?void 0:ue[o])||[],u=(null===l||void 0===l?void 0:l.length)>=1,c=(0,S.jsxs)(R.ZP,{beforeIcon:u?(0,S.jsx)(q.I8,{}):(0,S.jsx)(q.mm,{}),compact:!0,onClick:function(e){(0,Ne.j)(e),E(t)},primary:!u,secondary:u,small:!0,children:[u&&"Edit interactions",!u&&"Add interactions"]});e.push((0,S.jsx)(kt.Z,{first:0==i,noBorderRadius:i>=1,noPaddingContent:!0,titleXPadding:w.cd*w.iI,titleYPadding:1.5*w.iI,title:(0,S.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsx)(O.Z,{mr:w.cd,py:1,children:(0,S.jsx)(C.ZP,{large:!0,monospace:!0,children:o})}),u&&(0,S.jsx)(Z.ZP,{alignItems:"center",children:c})]}),children:(0,S.jsx)(Ro,{noBackground:!0,noBorderRadiusBottom:i<n-1,noBorderRadiusTop:!0,children:(0,S.jsxs)(O.Z,{p:w.cd,children:[!u&&c,null===l||void 0===l?void 0:l.map((function(e,n){return(0,S.jsx)(O.Z,{mt:n>=1?w.HN:0,children:(0,S.jsx)(Mo.Z,{blockInteraction:e,containerWidth:r,containerRef:T,interaction:null===se||void 0===se?void 0:se[null===e||void 0===e?void 0:e.uuid],setInteractionsMapping:de,showVariableUUID:!0})},"".concat(null===e||void 0===e?void 0:e.uuid,"-").concat(n))}))]})})},o))})),e}),[je,T,r,se,ae,de,E]),Ze=(0,f.useMemo)((function(){return(null===je||void 0===je?void 0:je.length)>=1&&(0,S.jsx)(yt.Z,{noBackground:!0,noBorder:!0,noBoxShadow:!0,visibleMapping:ye,children:ke})}),[je,ke,ye]),Pe=(0,f.useMemo)((function(){return(null===ue||void 0===ue?void 0:ue[null===x||void 0===x?void 0:x.uuid])||[]}),[ue,x]),Oe=(0,f.useMemo)((function(){var e=[],n={};return null===Pe||void 0===Pe||Pe.forEach((function(t){var i=t.uuid,o=null===se||void 0===se?void 0:se[i],r=null===o||void 0===o?void 0:o.variables;Object.keys(r||{}).forEach((function(t){null!==n&&void 0!==n&&n[t]||(e.push(t),n[t]=!0)}))})),e}),[se,Pe]),Ce=(0,f.useMemo)((function(){var e=(null===Pe||void 0===Pe?void 0:Pe.length)>=1;return(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[!Q&&(0,S.jsx)(S.Fragment,{children:(0,S.jsx)(R.ZP,{beforeIcon:(0,S.jsx)(q.mm,{}),compact:e,onClick:function(e){(0,Ne.j)(e),J(!0),setTimeout((function(){var e;return null===M||void 0===M||null===(e=M.current)||void 0===e?void 0:e.focus()}),1)},primary:!0,small:e,children:"Create new set of interactions"})}),Q&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(K.Z,{compact:!0,monospace:!0,onChange:function(e){(0,Ne.j)(e),Y(e.target.value)},onClick:function(e){return(0,Ne.j)(e)},ref:M,small:!0,value:V||""}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(R.ZP,{compact:e,loading:a,onClick:function(e){(0,Ne.j)(e),u({block_uuid:null===x||void 0===x?void 0:x.uuid,inputs:{},layout:[],uuid:"".concat(V,".").concat(g.t6.YAML),variables:{}}).then((function(e){var n=e.data.interaction,t=null===n||void 0===n?void 0:n.uuid;he(null===x||void 0===x?void 0:x.uuid,(null===Pe||void 0===Pe?void 0:Pe.length)||0,{uuid:t}),de((function(e){return Go(Go({},e),{},(0,l.Z)({},t,n))})),setTimeout((function(){var e;null===D||void 0===D||null===(e=D.current)||void 0===e||e.scrollIntoView()}),kt.e+100)})),J(!1),ee(V),Y(null)},primary:!0,small:e,children:"Save interaction"}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(R.ZP,{compact:e,onClick:function(e){(0,Ne.j)(e),J(!1),Y(null)},secondary:!0,small:e,children:"Cancel"})]})]})}),[x,Pe,Q,a,V,de,J,ee,Y,he]);return(0,S.jsxs)(O.Z,{p:w.cd,style:{position:"relative"},children:[(0,S.jsxs)(O.Z,{pb:w.cd,ref:T,children:[!x&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsx)(ce.Z,{children:"Blocks with interactions"})}),Ze,(0,S.jsxs)(O.Z,{mb:w.cd,mt:w.HN,children:[(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(ce.Z,{children:"Permissions"}),(0,S.jsx)(O.Z,{mr:w.cd}),(0,S.jsx)(Z.ZP,{alignItems:"center",children:(0,S.jsx)(R.ZP,{beforeIcon:(0,S.jsx)(q.mm,{}),compact:!0,onClick:function(){return me((function(e){return e.concat([{roles:[],triggers:[]}])}))},secondary:!0,small:!0,children:"Add permission"})})]}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsx)(C.ZP,{default:!0,children:"Add permissions to allow specific user roles the ability to trigger this pipeline using the interactions for this pipeline."})})]}),null===be||void 0===be?void 0:be.map((function(e,n){return(0,S.jsx)(O.Z,{mt:n>=1?w.cd:0,children:(0,S.jsx)(Fo,{index:n,permission:e,setPermissions:me,updatePermission:function(e){var t=(0,o.Z)(be);t[n]=e,me(t)}})},"permission-".concat(n))}))]}),x&&(0,S.jsxs)(O.Z,{mb:w.Mq,children:[(0,S.jsxs)(O.Z,{mb:w.Mq,children:[(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(O.Z,{mr:w.cd,py:1,children:(0,S.jsx)(ce.Z,{children:"Block interactions"})}),(null===Pe||void 0===Pe?void 0:Pe.length)>=1&&Ce]}),(0,S.jsx)(C.ZP,{default:!0,children:"A block can have multiple sets of interactions associated with it."})]}),!(null!==Pe&&void 0!==Pe&&Pe.length)&&Ce,(null===Oe||void 0===Oe?void 0:Oe.length)>=1&&(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(C.ZP,{bold:!0,large:!0,children:"Variables"}),(0,S.jsx)(O.Z,{mr:w.cd}),(0,S.jsx)(k.Z,{alignItems:"center",flex:1,children:null===Oe||void 0===Oe?void 0:Oe.map((function(e,n){return(0,S.jsx)(O.Z,{mr:1,children:(0,S.jsxs)(C.ZP,{default:!0,monospace:!0,children:[e,(null===Oe||void 0===Oe?void 0:Oe.length)>=2&&n<(null===Oe||void 0===Oe?void 0:Oe.length)-1&&(0,S.jsx)(C.ZP,{inline:!0,monospace:!0,muted:!0,children:","})]})},e)}))})]})]}),null===Pe||void 0===Pe?void 0:Pe.map((function(e,n){var t,i=e||{description:null,name:null},o=i.description,l=i.name,u=null===x||void 0===x?void 0:x.uuid,c=null===e||void 0===e?void 0:e.uuid,s=null===se||void 0===se?void 0:se[c];return(0,S.jsxs)("div",{children:[n>=1&&(0,S.jsx)(O.Z,{my:w.HN,children:(0,S.jsx)(y.Z,{light:!0})}),(0,S.jsx)(Mo.Z,{blockInteraction:e,containerRef:T,containerWidth:r,interaction:s,isEditing:!0,removeBlockInteraction:function(){return he(u,n,e,{remove:!0})},setInteractionsMapping:de,children:(0,S.jsxs)(O.Z,{p:w.cd,children:[(0,S.jsxs)(Z.ZP,{alignItems:"flex-start",children:[(0,S.jsxs)(O.Z,{mb:1,style:{width:20*w.iI},children:[(0,S.jsx)(C.ZP,{bold:!0,large:!0,children:"Label"}),(0,S.jsxs)(C.ZP,{muted:!0,children:["Add a label for this",(0,S.jsx)("br",{}),"set of interactions."]})]}),(0,S.jsx)(O.Z,{mr:w.cd}),(0,S.jsx)(k.Z,{flex:1,children:(0,S.jsx)(K.Z,{fullWidth:!0,onChange:function(e){return he(u,n,{name:e.target.value})},value:l||""})})]}),(0,S.jsx)(O.Z,{mb:w.cd}),(0,S.jsxs)(Z.ZP,{alignItems:"flex-start",children:[(0,S.jsxs)(O.Z,{mb:1,style:{width:20*w.iI},children:[(0,S.jsx)(C.ZP,{bold:!0,large:!0,children:"Description"}),(0,S.jsxs)(C.ZP,{muted:!0,children:["Describe how these",(0,S.jsx)("br",{}),"interactions are used."]})]}),(0,S.jsx)(O.Z,{mr:w.cd}),(0,S.jsx)(k.Z,{flex:1,children:(0,S.jsx)(Uo.Z,{fullWidth:!0,onChange:function(e){return he(u,n,{description:e.target.value})},rows:Math.max(3,Math.min(12,null===o||void 0===o||null===(t=o.split("\n"))||void 0===t?void 0:t.length)),value:o||""})})]})]})}),(0,S.jsx)("div",{ref:n===(null===Pe||void 0===Pe?void 0:Pe.length)-1?D:null})]},"".concat(null===e||void 0===e?void 0:e.uuid,"-").concat(n))}))]}),(0,S.jsx)(Bo,{ref:m,width:(null===T||void 0===T||null===(n=T.current)||void 0===n||null===(t=n.getBoundingClientRect())||void 0===t?void 0:t.width)||null,children:(0,S.jsx)(O.Z,{p:w.cd,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(R.ZP,{beforeIcon:(0,S.jsx)(q.vc,{}),loading:d,onClick:function(){return xe()},primary:W,secondary:!W,children:"Save changes for all interactions"}),(0,S.jsx)(O.Z,{mr:w.cd}),W&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(q.uy,{warning:!0}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(C.ZP,{warning:!0,children:"You have unsaved interaction changes"})]}),!W&&A&&(0,S.jsxs)(C.ZP,{muted:!0,children:["Interactions last saved at ",(0,Ho.JX)(Number(A)/1e3)]})]})})})]})};var Ko=function(e){var n=e.fetchSecrets,t=e.pipelineUUID,i=e.secrets,o=e.setErrorMessages,l=e.width,u=(0,f.useState)(!1),c=u[0],s=u[1],a=(0,f.useState)(),d=a[0],p=a[1],h=(0,f.useState)(),m=h[0],b=h[1],g=(0,f.useMemo)((function(){return l-w.cd*w.iI*2}),[l]),x=(0,v.Db)(V.ZP.secrets.useCreate(),{onSuccess:function(e){return(0,ee.wD)(e,{onErrorCallback:function(e){var n=e.error,t=n.message,i=n.exception;o((function(e){var n=e||[];return i&&(n=n.concat(i)),t&&(n=n.concat(t)),n}))}})}}),j=(0,r.Z)(x,1)[0],y=(0,v.Db)((function(e){return V.ZP.secrets.useDelete(e)()}),{onSuccess:function(e){return(0,ee.wD)(e,{callback:function(){n()},onErrorCallback:function(e){var n=e.error,t=(n.errors,n.message);o((function(e){return e.concat(t)}))}})}}),k=(0,r.Z)(y,1)[0],P=(0,f.useCallback)((function(e){"Enter"===e.key?(j({secret:{name:d,value:m}}).then((function(){n(),p(null),b(null)})),(0,ei.ez)(),s(!1)):"Escape"===e.key&&((0,ei.ez)(),s(!1))}),[j,n,d,m]),_=(0,f.useCallback)((function(e){(0,ei.ez)(),k(e)}),[k]);return(0,S.jsxs)(O.Z,{p:w.cd,children:[(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(ce.Z,{level:4,monospace:!0,children:"Secrets"}),(0,S.jsx)(O.Z,{ml:2}),(0,S.jsx)(U.ZP,{Icon:q.mm,blackBorder:!0,inline:!0,onClick:function(){return s((function(e){return!e}))},uuid:"Sidekick/Secrets/addNewSecret",children:"New"})]})}),(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsxs)(C.ZP,{children:[(0,S.jsx)(C.ZP,{inline:!0,warning:!0,children:"WARNING:"})," the encryption key is stored in a file on your machine. If you need more secure encryption, we recommend using a secrets manager."]})}),c&&(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsxs)(C.ZP,{muted:!0,children:["Press ",(0,S.jsx)(C.ZP,{bold:!0,default:!0,inline:!0,monospace:!0,children:"Enter"})," or ",(0,S.jsx)(C.ZP,{bold:!0,default:!0,inline:!0,monospace:!0,children:"Return"})," to save changes."]})}),(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsxs)(yi,{width:g,children:[c&&(0,S.jsxs)(gi.Z,{children:[(0,S.jsx)(bi.Z,{md:1,children:(0,S.jsx)(ki,{noPadding:!0,children:(0,S.jsx)(U.ZP,{backgroundColor:Zi.qJ,borderless:!0,centerText:!0,muted:!0,onClick:function(){navigator.clipboard.writeText("{{ mage_secret_var(".concat(d,") }}")),Dn.Am.success("Successfully copied to clipboard.",{position:Dn.Am.POSITION.BOTTOM_RIGHT,toastId:d})},uuid:"Sidekick/Secrets/".concat(d),withIcon:!0,children:(0,S.jsx)(q.CK,{size:2.5*w.iI})})})}),(0,S.jsx)(bi.Z,{md:4,children:(0,S.jsx)(ki,{children:(0,S.jsx)(K.Z,{borderless:!0,compact:!0,fullWidth:!0,monospace:!0,onChange:function(e){p(e.target.value),e.preventDefault()},onKeyDown:P,paddingHorizontal:0,placeholder:"secret name",small:!0,value:d})})}),(0,S.jsx)(bi.Z,{md:7,children:(0,S.jsx)(ki,{children:(0,S.jsx)(K.Z,{borderless:!0,compact:!0,fullWidth:!0,monospace:!0,onChange:function(e){b(e.target.value),e.preventDefault()},onKeyDown:P,paddingHorizontal:0,placeholder:"secret value",small:!0,value:m})})})]}),null===i||void 0===i?void 0:i.map((function(e){return(0,S.jsx)(Oi,{copyText:e.name,deleteVariable:function(){return _(e.name)},fetchVariables:n,hideEdit:!0,obfuscate:!0,pipelineUUID:t,variable:{uuid:e.name,value:e.value}},e.name)}))]})}),(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsx)(C.ZP,{children:"Secrets are not editable, they can only be created and deleted. Secrets are shared across the project, and can be used in configuration fields. To reference a secret, use the following templating syntax:"})}),(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsx)(jo.Z,{language:"yaml",maxWidth:g,small:!0,source:"\n \"{{ mage_secret_var('<secret_name>') }}\"\n "})}),(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsx)(C.ZP,{children:"To reference a secret in code, you can import the `get_secret_value` helper method:"})}),(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsx)(jo.Z,{language:"python",maxWidth:g,small:!0,source:"\n from mage_ai.data_preparation.shared.secrets import get_secret_value\n\n get_secret_value('<secret_name>')\n "})})]})},Vo=t(28026),qo=t(68899),Yo=t(15752),Xo=t(91835);function Qo(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Jo(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Qo(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Qo(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var $o=function(e){var n=e.addNewBlockAtIndex,t=e.addOnBlocks,i=e.addOnBlockType,o=e.autocompleteItems,u=e.blockRefs,c=e.blocks,s=e.blocksInNotebook,a=e.deleteBlock,d=e.displayBlockName,p=e.fetchFileTree,h=e.fetchPipeline,m=e.interruptKernel,b=e.messages,x=(e.onChangeCallbackBlock,e.onChangeCodeBlock),j=e.onSelectBlockFile,y=e.pipeline,k=e.runBlock,Z=e.runningBlocks,_=e.savePipelineContent,E=e.selectedBlock,I=e.setAnyInputFocused,T=e.setErrors,M=e.setHiddenBlocks,D=e.setSelectedBlock,R=e.setTextareaFocused,B=e.showBrowseTemplates,A=e.showUpdateBlockModal,N=e.textareaFocused,L=(0,f.useRef)(null),H=(0,f.useState)(!1),W=H[0],G=H[1],z=(0,vo.iV)().block_uuid;(0,f.useEffect)((function(){var e=c.find((function(e){var n,t=e.uuid;return(null===z||void 0===z||null===(n=z.split(":"))||void 0===n?void 0:n[0])===t}));e&&(E&&(null===e||void 0===e?void 0:e.uuid)===(null===E||void 0===E?void 0:E.uuid)||(M((function(n){return Jo(Jo({},n),{},(0,l.Z)({},e.uuid,!1))})),j(e.uuid,e.type,null)))}),[z,c,j,E,M]);var K=(y||{}).type,Y=(0,f.useMemo)((function(){return(0,Te.HK)(t||[],(function(e){return e.uuid}))}),[t]),X=V.ZP.block_templates.list({},{revalidateOnFocus:!1}).data,Q=(0,f.useMemo)((function(){return(null===X||void 0===X?void 0:X.block_templates)||[]}),[X]),J=(0,f.useCallback)((function(e){return n(e,(null===Y||void 0===Y?void 0:Y.length)||0)}),[n,Y]),ne=(0,f.useMemo)((function(){return(0,$t.oM)(Q,J)}),[J,Q]),te=(0,f.useMemo)((function(){return(0,$t.hr)(J,i,K,{blockTemplatesByBlockType:ne,languages:[g.t6.PYTHON],showBrowseTemplates:B})}),[J,i,ne,K]),ie=(0,f.useMemo)((function(){return null===Y||void 0===Y?void 0:Y[null===E||void 0===E?void 0:E.uuid]}),[Y,E]),oe=(0,f.useMemo)((function(){return Z.reduce((function(e,n,t){return Jo(Jo({},e),{},(0,l.Z)({},n.uuid,Jo(Jo({},n),{},{priority:t})))}),{})}),[Z]),re=(0,v.Db)((function(e){var n=e.block,t=e.upstream_blocks;return V.ZP.blocks.pipelines.useUpdate(encodeURIComponent(null===y||void 0===y?void 0:y.uuid),encodeURIComponent(null===n||void 0===n?void 0:n.uuid),{query:{block_type:null===n||void 0===n?void 0:n.type}})({block:{upstream_blocks:t}})}),{onSuccess:function(e){return(0,ee.wD)(e,{callback:function(){h()},onErrorCallback:function(e,n){return null===T||void 0===T?void 0:T({errors:n,response:e})}})}}),le=(0,r.Z)(re,2),ue=le[0],ce=le[1].isLoading,se=(0,f.useMemo)((function(){return null===t||void 0===t?void 0:t.map((function(e,n){var t=e.type,i=e.uuid,r=(null===E||void 0===E?void 0:E.uuid)===i,v=oe[i],P=v?0===v.priority?rt.uF.BUSY:rt.uF.QUEUED:rt.uF.IDLE,C="".concat(t,"s/").concat(i,".py");return u.current[C]=(0,f.createRef)(),(0,S.jsx)(O.Z,{mt:w.cd,children:(0,S.jsx)(F.Z,{allBlocks:c,autocompleteItems:o,block:e,blockIdx:n,blockRefs:u,blocks:c,defaultValue:e.content,deleteBlock:function(e){a(Jo({},e)),I(!1)},executionState:P,extraContent:(0,S.jsx)(uo,{block:e,blocks:s,inputPlaceholder:"Select blocks to add ".concat((0,$._6)(d,null)," to"),loading:ce,onClickTag:function(e){M((function(n){return Jo(Jo({},n),{},(0,l.Z)({},e.uuid,!1))})),j(e.uuid,e.type,null)},supportedUpstreamBlockTypes:[g.tf.CUSTOM,g.tf.DATA_EXPORTER,g.tf.DATA_LOADER,g.tf.DBT,g.tf.SCRATCHPAD,g.tf.SENSOR,g.tf.TRANSFORMER],updateBlock:ue}),fetchFileTree:p,fetchPipeline:h,hideRunButton:!0,interruptKernel:m,messages:b[i],noDivider:!0,onChange:function(e){return x(t,i,e)},pipeline:y,ref:u.current[C],runBlock:k,runningBlocks:Z,savePipelineContent:_,showUpdateBlockModal:A,selected:r,setAnyInputFocused:I,setErrors:T,setSelected:function(n){return D(!0===n?e:null)},setTextareaFocused:R,textareaFocused:r&&N})},i)}))}),[t,o,u,c,s,a,d,p,h,m,ce,b,x,j,y,k,Z,oe,_,E,I,T,M,D,R,A,N,ue]),ae="".concat(d,"/index"),de=(0,On.y)(),pe=de.disableGlobalKeyboardShortcuts,fe=de.registerOnKeyDown,ve=de.unregisterOnKeyDown;return(0,f.useEffect)((function(){return function(){ve(ae)}}),[ve,ae]),fe(ae,(function(e,n){!pe&&ie&&((0,ni.y)([kn.zX,kn.Um],n)||(0,ni.y)([kn.PQ,kn.Um],n))&&(e.preventDefault(),_())}),[ie,_]),(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(O.Z,{mb:w.cd,children:[(0,S.jsxs)(C.ZP,{default:!0,children:["Run 1 or more ",(0,$.wX)(d)," block functions whenever another block succeeds or fails."]}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsxs)(C.ZP,{default:!0,children:["Learn more about ",(0,S.jsx)(P.Z,{href:"https://docs.mage.ai/development/blocks/".concat((0,$.wX)((0,$._6)(d,null)),"/overview"),openNewWindow:!0,children:(0,$.wX)((0,$._6)(d,null))}),"."]})})]}),se,(0,S.jsx)(O.Z,{mt:w.cd,children:(0,S.jsx)(gn.Z,{onClickOutside:function(){return G(!1)},open:!0,children:(0,S.jsx)(Rt.Z,{disableKeyboardShortcuts:!0,items:te,onClickCallback:function(){return G(!1)},open:W,parentRef:L,uuid:d,children:(0,S.jsxs)(U.ZP,{beforeElement:(0,S.jsx)(co.Wx,{rose:i===g.tf.CALLBACK,children:(0,S.jsx)(q.mm,{size:co.ZG})}),inline:!0,onClick:function(e){e.preventDefault(),G(!0)},uuid:"AddNewBlocks/".concat(d),children:[(0,$.kC)(d)," block"]})})})})]})},er=t(26084);function nr(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function tr(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?nr(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):nr(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ir=[{Icon:q.AQ,name:"Callbacks",uuid:er.Q.CALLBACK},{Icon:q.hW,name:"Conditionals",uuid:er.Q.CONDITIONAL}];var or=function(e){var n=(0,Xo.Z)({},e),t=(0,h.useRouter)(),i=(0,f.useState)(null),o=i[0],r=i[1];(0,f.useEffect)((function(){var e;r(null===(e=(0,vo.iV)())||void 0===e?void 0:e.addon)}),[t.asPath]);var l=(0,f.useMemo)((function(){var e,t;if(er.Q.CALLBACK===o)e={addOnBlockType:g.tf.CALLBACK,addOnBlocks:null===(t=n.pipeline)||void 0===t?void 0:t.callbacks,displayBlockName:"callback"};else if(er.Q.CONDITIONAL===o){var i;e={addOnBlockType:g.tf.CONDITIONAL,addOnBlocks:null===(i=n.pipeline)||void 0===i?void 0:i.conditionals,displayBlockName:"conditional"}}if(e)return(0,S.jsx)($o,tr(tr({},e),n))}),[n,o]);return(0,S.jsx)(A.W,{backend:N.PD,children:(0,S.jsxs)(O.Z,{p:w.cd,children:[l,!o&&(null===ir||void 0===ir?void 0:ir.map((function(e,n){var t=e.name,i=e.uuid,o=e.Icon;return(0,S.jsx)(O.Z,{mt:n>=1?w.cd:0,children:(0,S.jsx)(P.Z,{block:!0,noHoverUnderline:!0,onClick:function(){return(0,fo.u)({addon:i},{pushHistory:!0})},preventDefault:!0,children:(0,S.jsx)(Bn.Z,{dark:!0,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(k.Z,{alignItems:"center",children:[(0,S.jsx)(Be.Z,{fullWidth:!1,children:(0,S.jsx)(O.Z,{p:w.cd,children:(0,S.jsx)(Z.ZP,{alignItems:"center",children:(0,S.jsx)(o,{fill:"#885EFF",size:2*w.iI})})})}),(0,S.jsx)(O.Z,{mr:w.cd}),(0,S.jsx)(k.Z,{flexDirection:"column",children:(0,S.jsx)(C.ZP,{bold:!0,children:t})})]}),(0,S.jsx)(q._Q,{})]})})})},i)})))]})})};function rr(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function lr(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?rr(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):rr(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ur=function(e){var n=e.activeView,t=e.addNewBlockAtIndex,i=e.afterWidth,o=e.autocompleteItems,r=e.blockInteractionsMapping,u=e.blockRefs,c=e.blocks,s=e.blocksInNotebook,a=e.cancelPipeline,d=e.chartRefs,p=e.checkIfPipelineRunning,v=e.containerHeightOffset,h=e.contentByBlockUUID,b=e.createInteraction,g=e.deleteBlock,x=e.deleteWidget,j=e.editingBlock,y=e.executePipeline,k=e.fetchFileTree,P=e.fetchPipeline,_=e.fetchSecrets,E=e.fetchVariables,I=e.globalDataProducts,T=e.globalVariables,M=e.insights,D=e.interactions,B=e.interactionsMapping,A=e.interruptKernel,N=e.isLoadingCreateInteraction,L=e.isLoadingUpdatePipelineInteraction,F=e.isPipelineExecuting,U=e.lastTerminalMessage,H=e.messages,G=e.metadata,z=e.onChangeCallbackBlock,K=e.onChangeChartBlock,V=e.onChangeCodeBlock,Y=e.onSelectBlockFile,X=e.onUpdateFileSuccess,Q=e.permissions,J=e.pipeline,$=e.pipelineInteraction,ee=e.pipelineMessages,ne=e.project,te=e.refAfterFooter,ie=e.runBlock,oe=e.runningBlocks,re=e.sampleData,le=e.savePipelineContent,ue=e.savePipelineInteraction,ce=e.secrets,se=e.selectedBlock,ae=e.selectedFilePath,de=e.sendTerminalMessage,pe=e.setActiveSidekickView,fe=e.setAllowCodeBlockShortcuts,ve=e.setAnyInputFocused,he=e.setBlockInteractionsMapping,me=e.setDisableShortcuts,be=e.setEditingBlock,ge=e.setErrors,ke=e.setHiddenBlocks,Ze=e.setInteractionsMapping,Pe=e.setPermissions,Oe=e.setSelectedBlock,Ce=e.setTextareaFocused,we=e.showBrowseTemplates,_e=e.showDataIntegrationModal,Se=e.showUpdateBlockModal,Ee=e.sideBySideEnabled,Ie=e.statistics,Me=e.textareaFocused,De=e.treeRef,Re=e.updatePipelineInteraction,Be=e.updateWidget,Ae=e.widgets,Ne=(0,fn.i)().height,Le=ui.uX,Fe=(0,f.useState)([]),Ue=Fe[0],He=Fe[1],We=(0,f.useState)(!!(0,pn.U2)(pn.Q9)),Ge=We[0],ze=We[1],Ke=(0,f.useMemo)((function(){return i-(qo.k1+1)}),[i]),Ve=(0,f.useMemo)((function(){var e;return!(null===ne||void 0===ne||null===(e=ne.features)||void 0===e||!e[Yt.d.INTERACTIONS])}),[null===ne||void 0===ne?void 0:ne.features]),qe=((null===j||void 0===j?void 0:j.upstreamBlocks)||{}).block,Ye=((null===re||void 0===re?void 0:re.columns)||[]).slice(0,100),Xe=(0,f.useMemo)((function(){return(null===re||void 0===re?void 0:re.rows)||[]}),[re]),Qe=(0,f.useMemo)((function(){return(null===G||void 0===G?void 0:G.column_types)||{}}),[G]),Je=(0,f.useMemo)((function(){return(null===M||void 0===M?void 0:M[1])||{}}),[M]),$e=(0,f.useMemo)((function(){return(0,Te.HK)((null===M||void 0===M?void 0:M[0])||[],(function(e){return e.feature.uuid}))}),[M]),en=!!re,nn=(0,f.useMemo)((function(){return W.qL.INTEGRATION===(null===J||void 0===J?void 0:J.type)}),[J]),tn=W.qL.STREAMING!==(null===J||void 0===J?void 0:J.type)?-70:Ge?-16:300,on=(0,f.useCallback)((0,xi.Fk)({columnTypes:Qe,columns:Ye,insightsByFeatureUUID:$e,insightsOverview:Je,noColumnLinks:!0,statistics:Ie}),[Qe,Ye,$e,Je,Ie]),rn=(0,f.useMemo)((function(){return(0,S.jsx)(Po,{blocks:c,fetchVariables:E,pipeline:J,selectedBlock:se,setErrorMessages:He,variables:T,width:Ke})}),[Ke,c,E,T,J,se]),ln=(0,f.useMemo)((function(){return(0,S.jsx)(xo.Z,{onActionCallback:X,pipeline:J,selectedBlock:se,selectedFilePath:ae,setErrors:ge,width:Ke>Ln.nn?Ke-Ln.nn:Ke})}),[Ke,X,J,se,ae,ge]),un=(0,f.useMemo)((function(){return(0,S.jsx)(Ko,{fetchSecrets:_,pipelineUUID:null===J||void 0===J?void 0:J.uuid,secrets:ce,setErrorMessages:He,width:Ke})}),[Ke,_,J,ce]),cn=(0,f.useMemo)((function(){return{addNewBlockAtIndex:t,autocompleteItems:o,blockRefs:u,blocks:c,blocksInNotebook:s,deleteBlock:g,fetchFileTree:k,fetchPipeline:P,interruptKernel:A,messages:H,onChangeCallbackBlock:z,onChangeCodeBlock:V,onSelectBlockFile:Y,pipeline:J,runBlock:ie,runningBlocks:oe,savePipelineContent:le,selectedBlock:se,setAnyInputFocused:ve,setErrors:ge,setHiddenBlocks:ke,setSelectedBlock:Oe,setTextareaFocused:Ce,showBrowseTemplates:we,showUpdateBlockModal:Se,textareaFocused:Me}}),[t,o,u,c,s,g,k,P,A,H,z,V,Y,J,ie,oe,le,se,ve,ge,ke,Oe,Ce,we,Se,Me]),sn=(0,f.useMemo)((function(){return Ye.length>0&&(0,S.jsx)(xe.Z,{columnHeaderHeight:(0,ye.Qr)(Qe)&&(0,ye.Qr)($e)&&(0,ye.Qr)(Je)?0:je.Eh,columns:Ye,height:Ne-Le-ui.OM,noBorderBottom:!0,noBorderLeft:!0,noBorderRight:!0,noBorderTop:!0,renderColumnHeader:on,rows:Xe,width:Ke})}),[Ke,Qe,Ye,Le,Ne,$e,Je,on,Xe]),an=(0,f.useMemo)((function(){return Ae.length>0&&(0,S.jsx)($i,{autocompleteItems:o,blockRefs:u,blocks:c,chartRefs:d,deleteWidget:x,fetchFileTree:k,fetchPipeline:P,messages:H,onChangeChartBlock:K,pipeline:J,runBlock:ie,runningBlocks:oe,savePipelineContent:le,selectedBlock:se,setAnyInputFocused:ve,setErrors:ge,setSelectedBlock:Oe,setTextareaFocused:Ce,textareaFocused:Me,updateWidget:Be,widgets:Ae,width:Ke})}),[Ke,o,u,c,d,x,k,P,H,K,J,ie,oe,le,se,ve,ge,Oe,Ce,Me,Be,Ae]),dn=(0,f.useMemo)((function(){return(0,S.jsx)("div",{style:{height:"100%",position:"relative",width:Ke},children:(0,S.jsx)(Vo.Z,{lastMessage:U,onFocus:function(){return Oe(null)},sendMessage:de,width:Ke})})}),[Ke,U,de,Oe]),vn=(0,f.useMemo)((function(){return(0,S.jsx)(go,lr({},cn))}),[cn]),hn=(0,f.useMemo)((function(){return(0,S.jsx)(or,lr({},cn))}),[cn]),mn=(0,f.useMemo)((function(){return J&&se&&(0,S.jsx)(Mi,{addNewBlockAtIndex:t,block:se,contentByBlockUUID:h,fetchFileTree:k,fetchPipeline:P,globalDataProducts:I,pipeline:J,setSelectedBlock:Oe,showDataIntegrationModal:_e,showUpdateBlockModal:Se})}),[t,h,k,P,I,J,se,Oe,_e,Se]);return(0,S.jsxs)(S.Fragment,{children:[(null===Ue||void 0===Ue?void 0:Ue.length)>=1&&(0,S.jsxs)(O.Z,{mb:3,mt:2,mx:2,children:[(0,S.jsxs)(Z.ZP,{justifyContent:"space-between",children:[(0,S.jsx)(C.ZP,{bold:!0,danger:!0,children:"Errors"}),(0,S.jsx)(R.ZP,{basic:!0,iconOnly:!0,noPadding:!0,onClick:function(){return He([])},transparent:!0,children:(0,S.jsx)(q.x8,{muted:!0})})]}),null===Ue||void 0===Ue?void 0:Ue.map((function(e){return(0,S.jsx)(O.Z,{pb:1,children:(0,S.jsx)(C.ZP,{monospace:!0,xsmall:!0,children:e})},e)}))]}),(0,S.jsxs)(je.t0,{fullWidth:!0,heightOffset:zt.cH.TERMINAL===n||n===zt.cH.TREE?0:v||Ln.nn,onBlur:function(){ae||me(!1),null===fe||void 0===fe||fe(!1)},onFocus:function(){me(!0),n===zt.cH.TREE&&(null===fe||void 0===fe||fe(!0))},overflowHidden:n===zt.cH.TREE,tabIndex:0,children:[n===zt.cH.TREE&&(0,S.jsx)(m.Z,{uuid:"PipelineDetail/".concat(null===J||void 0===J?void 0:J.uuid),children:(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(eo.ZP,{addNewBlockAtIndex:t,blockRefs:u,blocks:c,contentByBlockUUID:h,contextMenuEnabled:!0,deleteBlock:g,dragEnabled:!0,editingBlock:j,enablePorts:!nn,fetchPipeline:P,height:Ne-(Le-Ln.nn)-tn,messages:H,onClickNode:function(e){var n=e.block.uuid;return ke((function(e){var t=!(null===e||void 0===e||!e[n]);return t?lr(lr({},e),{},(0,l.Z)({},n,!t)):e}))},pipeline:J,runBlock:ie,runningBlocks:oe,selectedBlock:se,setActiveSidekickView:pe,setEditingBlock:be,setErrors:ge,setSelectedBlock:function(e){Oe(e),Ee&&(0,Yo.F)(e)},showUpdateBlockModal:Se,treeRef:De}),!qe&&W.qL.STREAMING===(null===J||void 0===J?void 0:J.type)&&(0,S.jsx)(O.Z,{p:1,children:(0,S.jsx)(To,{cancelPipeline:a,checkIfPipelineRunning:p,executePipeline:y,isPipelineExecuting:F,pipelineExecutionHidden:Ge,pipelineMessages:ee,setPipelineExecutionHidden:ze})})]})}),n===zt.cH.DATA&&sn,zt.cH.SECRETS===n&&un,zt.cH.VARIABLES===n&&rn,zt.cH.FILE_VERSIONS===n&&(0,S.jsx)(m.Z,{uuid:"FileVersions/".concat(ae?decodeURIComponent(ae):""),children:ln}),nn||se&&en||!se&&en&&n===zt.cH.DATA?null:zt.du.includes(n)&&(0,S.jsx)(Z.ZP,{alignItems:"center",justifyContent:"center",verticalHeight:zt.fp,verticalHeightOffset:Le,width:Ke,children:(0,S.jsx)(C.ZP,{center:!0,default:!0,disableWordBreak:!0,large:!0,monospace:!0,children:se?!en&&"No data or insights available":"Select a block for insights"})}),zt.cH.CHARTS===n&&(Ae.length>0?an:(0,S.jsxs)(Z.ZP,{alignItems:"center",flexDirection:"column",justifyContent:"center",verticalHeight:zt.fp,verticalHeightOffset:Le,width:Ke,children:[(0,S.jsx)(O.Z,{px:1,children:(0,S.jsx)(Z.ZP,{flexDirection:"row",children:(0,S.jsxs)(C.ZP,{center:!0,default:!0,children:["Add a chart by clicking the chart icon \xa0",(0,S.jsx)(q.GQ,{size:1.5*w.iI}),"\xa0in",(0,S.jsx)("br",{}),"the top right corner of a block (if applicable)."]})})}),(0,S.jsx)(O.Z,{mt:w.cd,px:1,children:(0,S.jsx)(to,{size:40*w.iI})})]})),zt.cH.TERMINAL===n&&dn,zt.cH.EXTENSIONS===n&&vn,zt.cH.ADDON_BLOCKS===n&&hn,zt.cH.BLOCK_SETTINGS===n&&(se?mn:(0,S.jsx)(Z.ZP,{alignItems:"center",flexDirection:"column",justifyContent:"center",verticalHeight:zt.fp,verticalHeightOffset:Le,width:Ke,children:(0,S.jsx)(O.Z,{px:1,children:(0,S.jsx)(Z.ZP,{flexDirection:"row",children:(0,S.jsxs)(C.ZP,{center:!0,default:!0,children:["Please select a block and then click the settings icon \xa0",(0,S.jsx)(q.JG,{size:1.5*w.iI}),"\xa0",(0,S.jsx)("br",{}),"in the top right corner of a block (if applicable)."]})})})})),zt.cH.INTERACTIONS===n&&Ve&&(0,S.jsx)(zo,{blockInteractionsMapping:r,containerWidth:Ke,createInteraction:function(e){return b({interaction:e})},interactions:D,interactionsMapping:B,isLoadingCreateInteraction:N,isLoadingUpdatePipelineInteraction:L,permissions:Q,pipeline:J,pipelineInteraction:$,refAfterFooter:te,savePipelineInteraction:ue,selectedBlock:se,setBlockInteractionsMapping:he,setInteractionsMapping:Ze,setPermissions:Pe,setSelectedBlock:Oe,updatePipelineInteraction:function(e){return Re({pipeline_interaction:e})}})]})]})};var cr=function(e){var n,t=e.activeView,i=e.pipeline,o=e.project,r=e.secrets,l=e.selectedBlock,u=e.setSelectedBlock,c=e.variables,s=null===i||void 0===i?void 0:i.uuid,a=(0,vo.iV)(),d=(0,Zo.wx)(c,(function(e){return e.uuid===yo.C})),p=(0,zt.Qq)({project:o})[t],v=(null===p||void 0===p||null===(n=p.buildLabel)||void 0===n?void 0:n.call(p,{pipeline:i,secrets:r,variables:d}))||(null===p||void 0===p?void 0:p.label);zt.cH.BLOCK_SETTINGS===t&&null!==l&&void 0!==l&&l.uuid&&(v=(0,S.jsxs)(S.Fragment,{children:["Block settings for ",(0,S.jsx)(C.ZP,{bold:!0,color:(0,_.qn)(null===l||void 0===l?void 0:l.type).accent,inline:!0,monospace:!0,children:null===l||void 0===l?void 0:l.uuid})]}));var h=(0,S.jsx)(C.ZP,{bold:!0,children:v}),m=zt.cH.EXTENSIONS===t&&(null===a||void 0===a?void 0:a.extension),b=V.ZP.extension_options.list({},{},{pauseFetch:!m}).data,g=(0,f.useMemo)((function(){return(null===b||void 0===b?void 0:b.extension_options)||[]}),[b]),x=(0,f.useMemo)((function(){return(0,Te.HK)(g,(function(e){return e.uuid}))}),[g]),j=zt.cH.ADDON_BLOCKS===t&&(null===a||void 0===a?void 0:a.addon);if(zt.cH.INTERACTIONS===t){var y=[];null!==l&&void 0!==l&&l.uuid?y.push.apply(y,[{label:function(){return"All interactions"},monospace:!1,onClick:function(){return u(null)}},{bold:!0,label:function(){return null===l||void 0===l?void 0:l.uuid},monospace:!0}]):y.push({bold:!0,label:function(){return"Interactions"},monospace:!1}),h=(0,S.jsx)(re.Z,{breadcrumbs:y,noMarginLeft:!0})}else{if(!t)return(0,S.jsx)("div",{});if(m){var k=x[null===a||void 0===a?void 0:a.extension];h=(0,S.jsxs)(Z.ZP,{children:[(0,S.jsx)(ut(),{as:"/pipelines/".concat(s,"/edit?").concat(zt.uM,"=").concat(zt.cH.EXTENSIONS),href:"/pipelines/[pipeline]/edit",passHref:!0,children:(0,S.jsx)(P.Z,{default:!0,children:v})}),(0,S.jsx)(C.ZP,{monospace:!0,muted:!0,children:"\xa0/\xa0"}),(0,S.jsx)(C.ZP,{bold:!0,children:null===k||void 0===k?void 0:k.name})]})}else j&&(h=(0,S.jsxs)(Z.ZP,{children:[(0,S.jsx)(ut(),{as:"/pipelines/".concat(s,"/edit?").concat(zt.uM,"=").concat(zt.cH.ADDON_BLOCKS),href:"/pipelines/[pipeline]/edit",passHref:!0,children:(0,S.jsx)(P.Z,{default:!0,children:v})}),(0,S.jsx)(C.ZP,{monospace:!0,muted:!0,children:"\xa0/\xa0"}),(0,S.jsx)(C.ZP,{bold:!0,children:(0,$.vg)(null===a||void 0===a?void 0:a.addon)})]}))}return(0,S.jsx)(ui.ym,{children:h})},sr=t(16756),ar=p.default.div.withConfig({displayName:"indexstyle__StatusFooterStyle",componentId:"sc-tixdln-0"})(["bottom:0;position:fixed;z-index:2;"," ",""],(function(e){return"\n background-color: ".concat((e.theme.background||Se.Z.background).header,";\n ")}),(function(e){return e.width&&"\n width: ".concat(e.width,"px;\n ")})),dr=1.25*w.iI;function pr(e,n){var t=e.kernel,i=e.pipelineContentTouched,o=(e.pipelineLastSaved,e.saveStatus),r=e.width,l=t||{},u=(l.alive,l.usage),c=(0,f.useMemo)((function(){if(null!==u&&void 0!==u&&u.kernel_memory){var e=u.kernel_memory,n=Math.floor(Math.log(e)/Math.log(1024));return"".concat(parseFloat((e/Math.pow(1024,n)).toFixed(2))).concat(["B","KB","MB","GB","TB","PB","EB","ZB","YB"][n])}return null}),[null===u||void 0===u?void 0:u.kernel_memory]),s=(0,f.useMemo)((function(){return"undefined"!==typeof(null===u||void 0===u?void 0:u.kernel_cpu)?(0,$.QV)(null===u||void 0===u?void 0:u.kernel_cpu,3):null}),[u]);return(0,S.jsxs)(ar,{ref:n,width:r,children:[(0,S.jsx)(y.Z,{light:!0}),(0,S.jsx)(O.Z,{px:w.cd,py:1,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[u&&(0,S.jsx)(S.Fragment,{children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[null!==s&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(q.Bf,{muted:!0,size:dr}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsxs)(C.ZP,{monospace:!0,muted:!0,small:!0,children:["CPU: ",(0,S.jsxs)(C.ZP,{inline:!0,danger:s>=90,muted:s<50,small:!0,warning:s>=50&&s<90,children:[s,"%"]})]})]}),null!==s&&null!==c&&(0,S.jsxs)(O.Z,{mx:w.cd,children:[(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(C.ZP,{monospace:!0,muted:!0,small:!0,children:"/"})]}),null!==c&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(q.ie,{muted:!0,size:dr}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsxs)(C.ZP,{monospace:!0,muted:!0,small:!0,children:["Memory: ",c]})]}),(0,S.jsx)(O.Z,{mx:w.cd})]})}),(0,S.jsx)(Ce.Z,{appearAbove:!0,appearBefore:!0,block:!0,description:(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(C.ZP,{default:!0,inline:!0,children:"Press"}),"\xa0",(0,S.jsx)(sr.Z,{inline:!0,keyText:(0,Pn.V5)()?kn.RJ:kn.hE}),"\xa0",(0,S.jsx)(C.ZP,{default:!0,inline:!0,children:"+"}),"\xa0",(0,S.jsx)(sr.Z,{inline:!0,keyText:kn.SS}),"\xa0",(0,S.jsx)(C.ZP,{default:!0,inline:!0,children:"to save changes."}),(0,S.jsx)("br",{})]}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsxs)(C.ZP,{default:!0,children:["Or, go to ",(0,S.jsx)(C.ZP,{inline:!0,monospace:!0,children:"File"})," \u203a ",(0,S.jsx)(C.ZP,{inline:!0,monospace:!0,children:"Save pipeline"}),"."]})})]}),size:null,widthFitContent:!0,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[i&&(0,S.jsx)(q.uy,{size:dr,warning:!0}),!i&&(0,S.jsx)(q.$B,{size:dr,muted:!0}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(C.ZP,{monospace:!0,muted:!0,small:!0,warning:i,children:o})]})})]})})]})}var fr=f.forwardRef(pr),vr=t(65044),hr=t(78419),mr=t(46684),br=t(32929),gr=t(11498),xr=t(28795),jr=t(85010);function yr(e){var n=e.activeView,t=e.pipeline,i=e.project,o=e.secrets,r=e.setActiveSidekickView,l=e.variables,u=(0,Zo.wx)(l,(function(e){return e.uuid===yo.C}));return(0,zt.j5)({pipeline:t,project:i}).map((function(e){var i=e.buildLabel,l=e.key,c=e.label;return{Icon:zt.Z7[l],id:l,isSelected:function(){return n===l},label:function(){return(null===i||void 0===i?void 0:i({pipeline:t,secrets:o,variables:u}))||c},onClick:function(){return r(l,!0)}}}))}var kr=t(53005),Zr=t(4383),Pr=t(70320);function Or(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function Cr(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Or(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Or(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function wr(e){var n,t,i,u,c,s,x,j,y,k,P,C,_,E,I,A,N,L,F,H,G=e.page,z=e.pipeline,K=(0,f.useRef)(null),Y=(0,f.useRef)(null),X=(0,d.ZP)((0,Zr.Ib)("terminal"),{shouldReconnect:function(){return!0}}),Q=X.lastMessage,te=X.sendMessage,ie=(0,yn.Z)(),re=ie.featureEnabled,le=ie.featureUUIDs,ue=ie.fetchProjects,ce=ie.project,se=ie.sparkEnabled,ae=(0,Xt.Z)().status,de=(0,f.useContext)(p.ThemeContext),pe=(0,h.useRouter)(),fe=(0,fn.i)().height,ve=pe.query.pipeline,he=z.uuid||ve,me=(0,f.useState)(!0),be=me[0],ge=me[1],xe=(0,f.useState)(!!(0,pn.U2)(pn.zg)),je=xe[0],ke=xe[1],Ze=(0,f.useState)(!!(0,pn.U2)(pn.Uu)),Pe=Ze[0],Oe=Ze[1],Ce=(0,f.useState)(!1),we=Ce[0],_e=Ce[1],Ee=(0,f.useState)(null),Ie=Ee[0],Me=Ee[1],De=(0,f.useState)(null),Re=De[0],Be=De[1],Ae=(0,f.useState)(null),Ne=Ae[0],Le=Ae[1],Fe=(0,f.useState)(null),Ue=Fe[0],He=Fe[1],We=(0,f.useState)(!1),Ge=We[0],ze=We[1],Ke=(0,f.useState)(!1),Ve=Ke[0],qe=Ke[1],Ye=(0,f.useState)(!1),Xe=Ye[0],Qe=Ye[1],Je=(0,f.useState)(!1),$e=Je[0],en=Je[1],nn=(0,f.useState)(!0),tn=nn[0],on=nn[1],rn=((0,f.useMemo)((function(){var e;return(0,Pr.hY)(null===ce||void 0===ce||null===(e=ce.features)||void 0===e?void 0:e[Yt.d.LOCAL_TIMEZONE])}),[null===ce||void 0===ce?void 0:ce.features]),(0,f.useMemo)((function(){var e;return!(null===ce||void 0===ce||null===(e=ce.features)||void 0===e||!e[Yt.d.INTERACTIONS])}),[null===ce||void 0===ce?void 0:ce.features])),ln="".concat(hr.H8,"_").concat(he),un=(0,pn.U2)(ln),cn=(0,f.useState)((0,Te.sE)(at.NR,(function(e){return e.uuid===un}))||at.NR[0]),sn=cn[0],an=cn[1],dn=(0,f.useCallback)((function(e){an(e),(0,pn.t8)(ln,null===e||void 0===e?void 0:e.uuid)}),[ln,an]),vn="".concat(hr.g6,"_").concat(he),hn=(0,f.useState)({}),mn=hn[0],gn=hn[1],xn=(0,f.useRef)(null),jn=V.ZP.statuses.list({},{revalidateOnFocus:!1}).data,kn=(0,f.useMemo)((function(){var e,n;return null===jn||void 0===jn||null===(e=jn.statuses)||void 0===e||null===(n=e[0])||void 0===n?void 0:n.disable_pipeline_edit_access}),[jn]),Zn=(0,f.useMemo)((function(){var e,n;return null===jn||void 0===jn||null===(e=jn.statuses)||void 0===e||null===(n=e[0])||void 0===n?void 0:n.max_print_output_lines}),[jn]),Pn=(0,f.useState)({}),On=Pn[0],Cn=Pn[1],wn=(0,f.useState)([]),_n=wn[0],Dn=wn[1],Rn=(0,Jn.Z)(he),An=V.ZP.pipelines.detail(he,Cr({include_block_pipelines:!0,includes_outputs:(0,ye.Qr)(On)||"undefined"===typeof H||null===H||"undefined"===typeof(null===(n=H)||void 0===n?void 0:n.blocks)||null===(null===(t=H)||void 0===t?void 0:t.blocks)||!(null===(i=H)||void 0===i||null===(u=i.blocks)||void 0===u||!u.find((function(e){return"undefined"===typeof e.ouputs})))},tn?{includes_outputs_spark:!0}:{}),{refreshInterval:6e4},{key:"/pipelines/".concat(he,"/edit")}),Nn=An.data,Ln=An.mutate,Fn=V.ZP.pipeline_interactions.detail(rn&&he,{},{revalidateOnFocus:!1}),Un=Fn.data,Hn=Fn.mutate,Wn=V.ZP.interactions.pipeline_interactions.list(rn&&he,{},{revalidateOnFocus:!1}),Gn=Wn.data,zn=Wn.mutate,Kn=(0,f.useMemo)((function(){return(null===Un||void 0===Un?void 0:Un.pipeline_interaction)||{}}),[Un]),Vn=(0,f.useMemo)((function(){return(null===Gn||void 0===Gn?void 0:Gn.interactions)||{}}),[Gn]),qn=(0,v.Db)(V.ZP.pipeline_interactions.useUpdate(he),{onSuccess:function(e){return(0,ee.wD)(e,{callback:function(e){Hn()}})}}),Yn=(0,r.Z)(qn,2),Qn=Yn[0],$n=Yn[1].isLoading,et=(0,v.Db)(V.ZP.interactions.pipeline_interactions.useCreate(he),{onSuccess:function(e){return(0,ee.wD)(e,{callback:function(e){zn(),Hn()}})}}),tt=(0,r.Z)(et,2),it=tt[0],lt=tt[1].isLoading;H=(0,f.useMemo)((function(){return null===Nn||void 0===Nn?void 0:Nn.pipeline}),[Nn]);var ut=(0,f.useMemo)((function(){var e;return W.qL.INTEGRATION===(null===(e=H)||void 0===e?void 0:e.type)}),[H]);(0,f.useEffect)((function(){H&&tn&&se&&on(!1)}),[tn,H,on,se]);var ct=(0,f.useState)((0,pn.U2)(hr.iL,!1)),st=ct[0],dt=ct[1],pt=(0,f.useMemo)((function(){return!ut&&(null===re||void 0===re?void 0:re(null===le||void 0===le?void 0:le.NOTEBOOK_BLOCK_OUTPUT_SPLIT_VIEW))&&st}),[re,le,ut,st]),vt=(0,f.useState)((0,pn.U2)(hr.qj,!1)),ht=vt[0],mt=vt[1],bt=(0,f.useMemo)((function(){return(null===re||void 0===re?void 0:re(null===le||void 0===le?void 0:le.NOTEBOOK_BLOCK_OUTPUT_SPLIT_VIEW))&&ht}),[re,le,ht]),xt=(0,f.useCallback)((function(e){mt(e),(0,pn.t8)(hr.qj,"function"===typeof e?e():e)}),[mt]),jt=(0,f.useCallback)((function(e){var n="function"===typeof e?e():e;dt(e),(0,pn.t8)(hr.iL,n),n||xt(e)}),[xt,dt]),yt=(0,f.useCallback)((function(){var e=new CustomEvent(at.$e,{detail:{}});window.dispatchEvent(e)}),[]),Zt=(0,f.useCallback)((function(){var e=new CustomEvent(at.tK,{detail:{}});window.dispatchEvent(e)}),[]),Pt=(0,f.useCallback)((function(e){gn((function(n){var t=e(n);return(0,pn.t8)(vn,JSON.stringify(t)),t})),pt&&(clearTimeout(Y.current),Y.current=setTimeout((function(){Zt(),yt()}),kt.e+1))}),[yt,Zt,vn,gn,pt]);(0,f.useEffect)((function(){var e=(0,pn.U2)(vn);e&&(0,$.Pb)(e)&&gn(JSON.parse(e))}),[vn,gn]);var Ot=V.ZP.kernels.list({},{refreshInterval:5e3,revalidateOnFocus:!0}),Ct=Ot.data,wt=Ot.mutate,_t=(0,f.useMemo)((function(){var e=null===Ct||void 0===Ct?void 0:Ct.kernels;return(null===e||void 0===e?void 0:e.find((function(e){var n;return e.name===W.a_[null===(n=H)||void 0===n?void 0:n.type]})))||(null===e||void 0===e?void 0:e[0])}),[Ct,H]),St=(0,f.useState)(null),Et=St[0],It=St[1],Tt=(0,f.useState)(a()().utc().unix()),Mt=Tt[0],Dt=Tt[1],Rt=(0,f.useState)(!1),Bt=Rt[0],At=Rt[1],Nt=(0,nt.dd)((function(){return(0,S.jsx)(Xn.Z,{centerOnScreen:!0,neutral:!0,onClick:Ut,subtitle:"Please refresh your page to have the most up-to-date data before making any changes.",title:"Your pipeline may be stale.",width:34*w.iI})}),{},[],{background:!0,uuid:"stale_pipeline_message"}),Lt=(0,r.Z)(Nt,2),Ft=Lt[0],Ut=Lt[1];(0,f.useEffect)((function(){var e;null!==Nn&&void 0!==Nn&&null!==(e=Nn.pipeline)&&void 0!==e&&e.updated_at&&Et!==a()().utc().unix()&&It(a()(Nn.pipeline.updated_at).unix()),Et&&Et>Mt&&Ft()}),[null===Nn||void 0===Nn||null===(c=Nn.pipeline)||void 0===c?void 0:c.updated_at,Et,Mt]);var Ht=(0,vo.iV)(),Wt=Ht[zt.uM],Gt=Ht.block_uuid,Kt=(0,f.useMemo)((function(){var e=Ht["file_paths[]"]||[];return Array.isArray(e)||(e=[e]),e}),[Ht]),Vt=(0,f.useCallback)((function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],t=arguments.length>2?arguments[2]:void 0,i=(0,l.Z)({},zt.uM,e);null!==t&&void 0!==t&&t.addon&&(i.addon=null===t||void 0===t?void 0:t.addon),null!==t&&void 0!==t&&t.blockUUID&&(i.block_uuid=null===t||void 0===t?void 0:t.blockUUID),null!==t&&void 0!==t&&t.extension&&(i.extension=null===t||void 0===t?void 0:t.extension),ge(!0),(0,fo.u)(i,{preserveParams:["addon","block_uuid","file_path","file_paths[]"],pushHistory:n,replaceParams:!0})}),[]);(0,f.useEffect)((function(){Wt||Vt(zt.cH.TREE,!1)}),[Wt,Vt]);var qt=(0,f.useCallback)((function(e,n,t){ke(!1),setTimeout((function(){return Vt(e,n,t)}),1)}),[Vt]),Jt=(0,f.useRef)({}),$t=(0,f.useRef)({}),ei=(0,f.useRef)(null),ni=(0,f.useRef)({}),ti=(0,f.useRef)({}),ii=(0,f.useRef)({}),ri=(0,f.useState)({}),li=ri[0],ui=ri[1],ci=(0,f.useCallback)((function(e,n,t){var i=ni.current||{};ni.current=Cr(Cr({},i),{},(0,l.Z)({},e,Cr(Cr({},i[e]||{}),{},(0,l.Z)({},n,t))))}),[ni]),si=(0,f.useCallback)((function(e,n,t){var i=ti.current||{};ti.current=Cr(Cr({},i),{},(0,l.Z)({},e,Cr(Cr({},i[e]||{}),{},(0,l.Z)({},n,t))))}),[ti]),pi=(0,f.useCallback)((function(e,n,t){ci(e,n,t),At(!0)}),[ci,At]),fi=(0,f.useCallback)((function(e,n,t){si(e,n,t),At(!0)}),[si,At]),vi=(0,f.useCallback)((function(e){ii.current=Cr(Cr({},ii.current),e)}),[ii]),hi=(0,f.useCallback)((function(e,n){vi((0,l.Z)({},e,n)),At(!0)}),[vi,At]),mi=(0,f.useState)(null),bi=mi[0],gi=mi[1],xi=V.ZP.data_providers.list({},{revalidateOnFocus:!1}).data,ji=null===xi||void 0===xi?void 0:xi.data_providers,yi=V.ZP.variables.pipelines.list(he,{global_only:!0},{revalidateOnFocus:!1}),ki=yi.data,Zi=yi.mutate,Pi=null===ki||void 0===ki?void 0:ki.variables,Oi=V.ZP.secrets.list({},{revalidateOnFocus:!1}),Ci=Oi.data,wi=Oi.mutate,_i=null===Ci||void 0===Ci?void 0:Ci.secrets,Si=(0,f.useState)([]),Ei=Si[0],Ii=Si[1],Ti=(0,f.useState)([]),Mi=Ti[0],Di=Ti[1],Ri=(0,f.useRef)({}),Bi=(0,f.useCallback)((function(e){var n;At(!0);var t=Ri.current[e.uuid]||{},i=t.upstream_blocks;(null===e||void 0===e||null===(n=e.upstream_blocks)||void 0===n?void 0:n.length)>=1&&(i=e.upstream_blocks),Ri.current[e.uuid]=Cr(Cr(Cr({},t),e),{},{configuration:Cr(Cr({},t.configuration),e.configuration),upstream_blocks:i})}),[At,Ri]),Ai=(0,f.useState)(!1),Ni=Ai[0],Li=Ai[1],Fi=(0,f.useState)({upstreamBlocks:null}),Ui=Fi[0],Hi=Fi[1],Wi=(0,f.useState)([]),Gi=Wi[0],zi=Wi[1],Ki=(0,f.useState)(null),Vi=Ki[0],qi=Ki[1],Yi=(0,f.useState)(null),Xi=Yi[0],Qi=Yi[1],Ji=(0,f.useCallback)((function(e,n,t){Qi({block:{type:n,uuid:e},file:{path:t}})}),[]),$i=(0,ft.Dp)(he),eo=(0,ft.Q9)($i,Ei),no=(0,f.useState)(eo),to=no[0],io=no[1],oo=(0,f.useState)(),ro=oo[0],lo=oo[1],uo=(0,f.useState)(),co=uo[0],so=uo[1],ao=(0,f.useState)(null),po=ao[0],ho=ao[1],mo=(0,Jn.Z)(to);(0,f.useCallback)((function(){Hi({upstreamBlocks:{block:null,values:[]}}),Cn({}),At(!1),zi([]),qi(null)}),[]);(0,f.useEffect)((function(){he!==Rn&&(ni.current={},ti.current={})}),[he,Rn]);var bo=V.ZP.block_outputs.detail(!je&&(null===po||void 0===po?void 0:po.type)!==g.tf.SCRATCHPAD&&(null===po||void 0===po?void 0:po.type)!==g.tf.CHART&&null!==po&&void 0!==po&&po.uuid?encodeURIComponent(null===po||void 0===po?void 0:po.uuid):null,{pipeline_uuid:he}),go=bo.data,xo=bo.mutate,jo=(0,f.useMemo)((function(){return null===go||void 0===go?void 0:go.block_output}),[go]),yo=(0,f.useMemo)((function(){var e,n,t;return ut?null===(e=(0,Te.sE)(null===jo||void 0===jo?void 0:jo.outputs,(function(e){return e.variable_uuid==="output_sample_data_".concat((0,$.kE)(co))})))||void 0===e?void 0:e.sample_data:null===jo||void 0===jo||null===(n=jo.outputs)||void 0===n||null===(t=n[0])||void 0===t?void 0:t.sample_data}),[jo,ut,co]),ko=V.ZP.blocks.pipelines.analyses.detail(je?null:he,(null===po||void 0===po?void 0:po.type)!==g.tf.SCRATCHPAD&&(null===po||void 0===po?void 0:po.type)!==g.tf.CHART&&(null===po||void 0===po?void 0:po.uuid)&&encodeURIComponent(null===po||void 0===po?void 0:po.uuid)),Zo=ko.data,Po=ko.mutate,Oo=(null===Zo||void 0===Zo||null===(s=Zo.analyses)||void 0===s?void 0:s[0])||{},Co=Oo.insights,wo=void 0===Co?{}:Co,_o=Oo.metadata,So=void 0===_o?{}:_o,Eo=Oo.statistics,Io=void 0===Eo?{}:Eo;(0,f.useEffect)((function(){0===Gi.length&&(Po(),xo(),Zi())}),[Po,xo,Zi,Gi]),(0,f.useEffect)((function(){if(0===to.length)ho(null);else if((null===mo||void 0===mo?void 0:mo.length)!==(null===to||void 0===to?void 0:to.length)&&(null===to||void 0===to?void 0:to.length)<(null===mo||void 0===mo?void 0:mo.length)){var e=mo.findIndex((function(e){return e.uuid===(null===po||void 0===po?void 0:po.uuid)})),n=mo.length-1===e?e-1:e+1;ho(mo[Math.max(0,n)])}}),[to,mo,null===po||void 0===po?void 0:po.uuid]),(0,f.useEffect)((function(){var e;null!==(e=Ui.upstreamBlocks)&&void 0!==e&&e.block&&(ke(!1),Vt(zt.cH.TREE))}),[Ui.upstreamBlocks,Vt]);var To=V.ZP.autocomplete_items.list({},{refreshInterval:!1,revalidateOnFocus:!1}),Mo=To.data,Do=To.mutate,Ro=null===Mo||void 0===Mo?void 0:Mo.autocomplete_items,Bo=(0,v.Db)((function(e){var n=e.uuid;return V.ZP.widgets.pipelines.useDelete(he,n)()}),{onSuccess:function(e){return(0,ee.wD)(e,{callback:function(e){var n=e.widget.uuid;Di((function(e){return(0,Te.oM)(e,e.findIndex((function(e){var t=e.uuid;return n===t})))})),Ln(),Wo()},onErrorCallback:function(e,n){var t=e.url_parameters,i=n.messages;Be({errors:n,response:e}),null!==t&&void 0!==t&&t.block_uuid&&Cn((function(e){return Cr(Cr({},e),{},(0,l.Z)({},t.block_uuid,i.map((function(e){return{data:"".concat(e,"\n"),error:"".concat(e,"\n"),type:rt.Gi.TEXT_PLAIN}}))))}))}})}}),Ao=(0,r.Z)(Bo,1)[0],No=(0,f.useCallback)((function(e,n){var t,i=e||{},o=i.content,r=i.path;if(t=null!==n&&void 0!==n&&n.blockUUID?null===Ei||void 0===Ei?void 0:Ei.find((function(e){return e.uuid===(null===n||void 0===n?void 0:n.blockUUID)})):(0,kr.IO)(r,Ei)){var u=t,c=u.type,s=u.uuid;fi(c,s,o),Ii((function(e){var n=null===e||void 0===e?void 0:e.findIndex((function(e){var n=e.type,t=e.uuid;return n===c&&t===s}));return n>=0&&(e[n].content=o),e})),ui((function(e){return Cr(Cr({},e),{},(0,l.Z)({},c,Cr(Cr({},null===e||void 0===e?void 0:e[c]),{},(0,l.Z)({},s,Number(new Date)))))})),Ln()}}),[Ei,Ln,fi]),Lo=(0,gt.Z)({addNewBlock:function(e,n,t){$r(e,Ei.length,n,e.name,t),(null===Kt||void 0===Kt?void 0:Kt.length)>=1&&pe.push("/pipelines/".concat(he,"/edit"))},blocks:Ei,deleteWidget:Ao,fetchAutocompleteItems:Do,fetchPipeline:Ln,fetchVariables:Zi,onOpenFile:function(e,n){n||(Vt(zt.cH.FILES),ke(!1),ge(!1),qi(null))},onSelectFile:function(){qi(null)},onSelectBlockFile:Ji,onUpdateFileSuccess:No,openSidekickView:qt,pipeline:H,selectedFilePath:he,sendTerminalMessage:te,setDisableShortcuts:Qe,setSelectedBlock:qi,showHiddenFilesSetting:!0,uuid:he,widgets:Mi}),Fo=Lo.browser,Uo=Lo.controller,Wo=Lo.fetchFiles,Go=(Lo.filePaths,Lo.files),zo=(Lo.filesTouched,Lo.menu,Lo.openFile),Ko=Lo.selectedFilePath,Vo=Lo.tabs,qo=(Lo.versions,Lo.versionsVisible,(0,v.Db)(V.ZP.pipelines.useCreate(),{onSuccess:function(e){return(0,ee.wD)(e,{callback:function(e){var n=e.pipeline.uuid;pe.push("/pipelines/[pipeline]/edit","/pipelines/".concat(n,"/edit")),Wo()},onErrorCallback:function(e,n){return Be({errors:n,response:e})}})}})),Xo=(0,r.Z)(qo,1)[0],Qo=(0,v.Db)(V.ZP.pipelines.useUpdate(he,{update_content:!0}),{onSuccess:function(e){return(0,ee.wD)(e,{callback:function(){At(!1),Ln().then((function(e){var n,t,i,o=e.pipeline,r=null===(n=H)||void 0===n||null===(t=n.blocks)||void 0===t?void 0:t.map((function(e){return e.uuid})),l=null===o||void 0===o||null===(i=o.blocks)||void 0===i?void 0:i.map((function(e){return e.uuid}));!(0,Te.fS)(r||[],l||[])&&pt&&setTimeout((function(){(0,Yo.h)()}),1)}))},onErrorCallback:function(e,n){return Be({errors:n,response:e})}})}}),Jo=(0,r.Z)(Qo,2),$o=Jo[0],er=Jo[1].isLoading,nr=(0,f.useState)({}),tr=nr[0],ir=nr[1],or=(0,f.useCallback)((function(e,n){var t,i=e||{},o=i.block,l=i.pipeline,u=void 0===l?{extensions:{}}:l,c=(n||{}).contentOnly;if(!(Et&&Et>Mt)){var s=(0,Ho.Tz)();Dt(a()().utc().unix());var d={},p={},f={},v={};((null===u||void 0===u?void 0:u.blocks)||Ei).forEach((function(e){var n,t,i,l=e.extension_uuid,u=e.type,s=e.uuid,a=null===(n=ti.current[u])||void 0===n?void 0:n[s];"undefined"===typeof a&&(a=e.content);var h=null===(t=ni.current[u])||void 0===t?void 0:t[s];"undefined"===typeof h&&(h=e.callback_content);var m=null,b=null===(i=On[s])||void 0===i?void 0:i.filter((function(e){return!!e})),x=null===b||void 0===b?void 0:b.find((function(e){return e.error}));if(b&&(!se||null===Gi||void 0===Gi||!Gi.length)){var j=[],y=0;b.forEach((function(n){var t=n.data,i=n.type;(g.tf.SCRATCHPAD===e.type||x||"table"!==i&&null!==tr&&void 0!==tr&&tr[null===e||void 0===e?void 0:e.uuid])&&(Array.isArray(t)&&(n.data=t.reduce((function(e,n){return n.match(vr.Lz)?e:e.concat(n)}),[]),i===rt.Gi.TEXT_PLAIN&&(y+=(null===t||void 0===t?void 0:t.length)||0)),(!Zn||y<Zn+5)&&j.push(n))})),m=j.map((function(e,n){return{text_data:JSON.stringify(e),variable_uuid:"output_".concat(n)}}))}var k=Cr(Cr({},e),{},{callback_content:h,content:a});null===m?delete k.outputs:k.outputs=m,(null===o||void 0===o?void 0:o.uuid)===s&&Object.entries(o).forEach((function(e){var n=(0,r.Z)(e,2),t=n[0],i=n[1];"object"===typeof i&&!Array.isArray(i)&&i?Object.entries(i).forEach((function(e){var n=(0,r.Z)(e,2),i=n[0],o=n[1];k[t]||(k[t]={}),k[t][i]=o})):k[t]=i})),c?p[k.uuid]={callback_content:k.callback_content,content:k.content,outputs:k.outputs,uuid:k.uuid}:[g.tf.EXTENSION].includes(u)?(d[l]||(d[l]=[]),d[l].push(k)):g.tf.CALLBACK===u?f[k.uuid]=k:g.tf.CONDITIONAL===u?v[k.uuid]=k:p[k.uuid]=k}));var h=Cr(Cr({},null===(t=H)||void 0===t?void 0:t.extensions),null===u||void 0===u?void 0:u.extensions);Object.entries(d).forEach((function(e){var n=(0,r.Z)(e,2),t=n[0],i=n[1];h[t]||(h[t]={}),h[t].blocks=i}));var m=[],b=[],x=[];return((null===u||void 0===u?void 0:u.blocks)||Ei).forEach((function(e){var n=e.uuid,t=p[n],i=f[n],o=v[n];"undefined"!==typeof t?m.push(t):"undefined"!==typeof i?b.push(i):"undefined"!==typeof o&&x.push(o)})),ir({}),$o({pipeline:Cr(Cr(Cr({},H),u),{},{blocks:m,callbacks:b,conditionals:x,extensions:h,updated_at:s,widgets:Mi.map((function(e){var n,t,i=ii.current[e.uuid],o=Ri.current[e.uuid]||{};"undefined"===typeof i&&(i=e.content);var r=null===(n=On[e.uuid])||void 0===n?void 0:n.filter((function(e){return!!e})),l=null===r||void 0===r?void 0:r.find((function(e){return e.error}));if(r){var u=[];r.forEach((function(n){var t=n.data,i=n.type;(g.tf.SCRATCHPAD===e.type||l||"table"!==i)&&(Array.isArray(t)&&(n.data=t.reduce((function(e,n){return n.match(vr.Lz)?e:e.concat(n)}),[])),u.push(n))})),t=u.map((function(n,t){return{text_data:JSON.stringify(n),variable_uuid:"".concat(e.uuid,"_").concat(t)}}))}return Cr(Cr(Cr({},e),o),{},{configuration:Cr(Cr({},e.configuration),o.configuration),content:i,outputs:t})}))})})}Ft()}),[Ei,Zn,On,tr,H,Et,Mt,Gi,se,$o,Mi]),rr=(0,f.useMemo)((function(){return(0,ft.Rz)(H,{displayRelative:!0,isPipelineUpdating:er,pipelineContentTouched:Bt,pipelineLastSaved:Et})}),[er,H,Bt,Et]),lr=(0,nt.dd)((function(e){var n,t,i=e||{block:null,contentByBlockUUID:null},o=i.block,r=i.contentByBlockUUID,l=o||{type:null,uuid:null},u=l.type,c=l.uuid,s=Cr({},o);r&&(s.content=null===r||void 0===r||null===(n=r.current)||void 0===n||null===(t=n[u])||void 0===t?void 0:t[c]);return(0,S.jsx)(ne.BC,{children:(0,S.jsx)(bn,Cr(Cr({},e),{},{block:s,onChangeCodeBlock:fi,onClose:dr,pipeline:H,savePipelineContent:or}))})}),{},[fi,H,or],{background:!0,disableClickOutside:!0,disableCloseButton:!0,disableEscape:!0,uuid:"DataIntegrationModal/".concat(he)}),sr=(0,r.Z)(lr,2),ar=sr[0],dr=sr[1];(0,f.useEffect)((function(){if(Xi){var e,n=(null===Xi||void 0===Xi?void 0:Xi.block)||{type:null,uuid:null},t=n.type,i=n.uuid,o=Ei.find((function(e){var n=e.type,o=e.uuid;return n===t&&o===i}));if(o){if(qi(o),null!==Jt&&void 0!==Jt&&Jt.current){var r,l=Jt.current[(0,ft.zv)(o)];null===l||void 0===l||null===(r=l.current)||void 0===r||r.scrollIntoView()}}else if(t===g.tf.CHART){var u=Mi.find((function(e){return e.uuid===i}));if(u&&(qi(u),null!==$t&&void 0!==$t&&$t.current)){var c,s=$t.current[u.uuid];null===s||void 0===s||null===(c=s.current)||void 0===c||c.scrollIntoView()}}else if(null!==Xi&&void 0!==Xi&&null!==(e=Xi.file)&&void 0!==e&&e.path){var a;zo(null===Xi||void 0===Xi||null===(a=Xi.file)||void 0===a?void 0:a.path)}}}),[Ei,Xi,Mi]),(0,f.useEffect)((function(){var e,n,t=Nn,i=[],o=null===(e=H)||void 0===e?void 0:e.variables_dir,r=null===(n=H)||void 0===n?void 0:n.remote_variables_dir;null!==Nn&&void 0!==Nn&&Nn.hasOwnProperty("error")?"undefined"!==he?i=[{label:"Check pipeline configuration file for any issues",onClick:function(){zo("pipelines/".concat(he,"/").concat(In.dT.METADATA_YAML)),Be(null)}}]:t.error.displayMessage="There may be an issue with your pipeline\u2019s configuration file. Please check to make sure it is valid. It can be found at /pipelines/[pipeline_uuid]/metadata.yaml.":null!==xi&&void 0!==xi&&xi.hasOwnProperty("error")?t=xi:(null!==o&&void 0!==o&&o.includes("None")||null!==r&&void 0!==r&&r.includes("None"))&&(t={error:{displayMessage:"The variables_dir (".concat(o,") or remote_variables_dir (").concat(r,")")+" might be configured incorrectly. Please make sure those properties have values interpolated correctly in your project\u2019s metadata.yaml config file."}},i=[{label:"Check project configuration",onClick:function(){zo("".concat(In.dT.METADATA_YAML)),Le(null)}}]),(0,ee.bB)(t,Le,i)}),[Nn,xi,zo,null===(x=H)||void 0===x?void 0:x.remote_variables_dir,null===(j=H)||void 0===j?void 0:j.variables_dir,he]);var pr=(0,f.useMemo)((function(){var e=[],n=[];return Ei.forEach((function(t){g.M5.includes(t.type)?n.push(t):e.push(t)})),{blocksInNotebook:e,blocksInSidekick:n}}),[Ei]),Or=pr.blocksInNotebook,wr=pr.blocksInSidekick,_r=(0,f.useCallback)((function(e,n){return or({pipeline:{name:e,type:n}}).then((function(e){var t,i;if(null!==e&&void 0!==e&&null!==(t=e.data)&&void 0!==t&&t.pipeline){var o,r=e.data.pipeline.uuid;if(he!==r)window.location.href="".concat(pe.basePath,"/pipelines/").concat(r,"/edit");else Wo(),n!==(null===(o=H)||void 0===o?void 0:o.type)&&Ln(),(0,ft.k1)(Or,he,r),(0,ft.k1)(wr,he,r)}else null!==e&&void 0!==e&&null!==(i=e.data)&&void 0!==i&&i.error&&Be((function(e){return Cr(Cr({},e),{},{links:[{label:"Check pipeline configuration",onClick:function(){zo("pipelines/".concat(he,"/").concat(In.dT.METADATA_YAML)),Be(null)}}]})}))}))}),[Or,wr,Wo,Ln,zo,null===(y=H)||void 0===y?void 0:y.type,he,pe,or]),Sr=(0,f.useState)(null),Er=Sr[0],Ir=Sr[1],Tr=(0,f.useState)(null),Mr=Tr[0],Dr=Tr[1],Rr=(0,f.useState)(null),Br=Rr[0],Ar=Rr[1],Nr=(0,f.useCallback)((function(e){return Qn({pipeline_interaction:Cr(Cr({},Kn),{},{blocks:null!==e&&void 0!==e&&e.blockInteractionsMapping?null===e||void 0===e?void 0:e.blockInteractionsMapping:Mr,interactions:Er,permissions:null===Br||void 0===Br?void 0:Br.map((function(e){var n=e.roles,t=e.triggers;return{roles:null===n||void 0===n?void 0:n.map((function(e){return"string"===typeof e?e:null===e||void 0===e?void 0:e.role})),triggers:null===t||void 0===t?void 0:t.map((function(e){return{schedule_interval:e.schedule_interval,schedule_type:e.schedule_type}}))}}))})})}),[Mr,Er,Br,Kn,Qn]),Lr=(0,v.Db)((function(e){var n=e.extension_uuid,t=e.force,i=e.type,o=e.uuid,r={};return i&&(r.block_type=i),n&&(r.extension_uuid=n),"undefined"!==typeof t&&(r.force=t),V.ZP.blocks.pipelines.useDelete(he,encodeURIComponent(o),r)()}),{onSuccess:function(e){return(0,ee.wD)(e,{callback:function(e){var n=e.block,t=n.type,i=n.uuid;if(Ii((function(e){return(0,Te.oM)(e,e.findIndex((function(e){var n=e.type,o=e.uuid;return t===n&&i===o})))})),Ln(),qi(null),rn){var o=Cr({},Mr);delete o[i],Nr({blockInteractionsMapping:o}).then((function(e){var n=e.pipeline_interaction;return Dr(null===n||void 0===n?void 0:n.blocks)}))}},onErrorCallback:function(e,n){var t=e.url_parameters,i=n.messages;Be({errors:n,response:e}),null!==t&&void 0!==t&&t.block_uuid&&Cn((function(e){return Cr(Cr({},e),{},(0,l.Z)({},t.block_uuid,i.map((function(e){return{data:"".concat(e,"\n"),error:"".concat(e,"\n"),type:rt.Gi.TEXT_PLAIN}}))))}))}})}}),Fr=(0,r.Z)(Lr,1)[0],Ur=(0,nt.dd)((function(e){return(0,S.jsx)(Xn.Z,{centerOnScreen:!0,neutral:!0,onCancel:Gr,onClick:function(){return Kr(e)},subtitle:"Deleting this block is dangerous. Your block may have downstream dependencies that depend on this block. You can delete this block anyway and remove it as a dependency from downstream blocks.",title:"Your block has dependencies",width:34*w.iI})})),Hr=(0,r.Z)(Ur,2),Wr=Hr[0],Gr=Hr[1],zr=(0,v.Db)((function(e){var n=e.language,t=e.type,i=e.uuid,o="".concat(t,"/").concat(i);return n&&In.JD[n]&&(o="".concat(o,".").concat(In.JD[n].toLowerCase())),V.ZP.blocks.useDelete(encodeURIComponent(o))()}),{onSuccess:function(e){return(0,ee.wD)(e,{callback:function(){Do(),Ln()},onErrorCallback:function(e,n){Wr(),Be({displayMessage:e.exception,errors:n,response:e})}})}}),Kr=(0,r.Z)(zr,1)[0],Vr=(0,v.Db)(V.ZP.kernels.useUpdate(null===_t||void 0===_t?void 0:_t.id),{onSuccess:function(e){return(0,ee.wD)(e,{callback:function(){return wt()},onErrorCallback:function(e,n){return Be({errors:n,response:e})}})}}),qr=(0,r.Z)(Vr,1)[0],Yr=(0,f.useCallback)((function(){return qr({kernel:{action_type:"restart"}})}),[qr]),Xr=(0,f.useCallback)((function(){qr({kernel:{action_type:"interrupt"}}),zi([])}),[qr]),Qr=(0,v.Db)(V.ZP.blocks.pipelines.useCreate(he)),Jr=(0,r.Z)(Qr,1)[0],$r=(0,f.useCallback)((function(e,n,t){var i,l,u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:(0,$.Y6)(),c=arguments.length>4?arguments[4]:void 0;e.converted_from_type&&e.converted_from_uuid&&(i=null===(l=ti.current[e.converted_from_type])||void 0===l?void 0:l[e.converted_from_uuid]);var s=e.language,a=e.type;if(ut){var d,p=(0,Te.HK)((null===(d=H)||void 0===d?void 0:d.blocks)||[],(function(e){return e.type})),f=p[g.tf.DATA_EXPORTER],v=p[g.tf.DATA_LOADER],h=p[g.tf.TRANSFORMER];if(g.tf.DATA_LOADER===a){if(g.t6.YAML!==s)return void Be({displayMessage:"The source you\u2019re trying to add must contain the language ".concat(g.t6.YAML," and not ").concat(s,".")});var m;if(v)return void Be({displayMessage:"Pipeline ".concat(null===(m=H)||void 0===m?void 0:m.uuid," already has a source: ").concat(null===v||void 0===v?void 0:v.uuid,".")})}else if(g.tf.TRANSFORMER===a){var b;if(h)return void Be({displayMessage:"Pipeline ".concat(null===(b=H)||void 0===b?void 0:b.uuid," already has a transformer: ").concat(null===h||void 0===h?void 0:h.uuid,".")})}else if(g.tf.DATA_EXPORTER===a){if(g.t6.YAML!==s)return void Be({displayMessage:"The destination you\u2019re trying to add must contain the language ".concat(g.t6.YAML," and not ").concat(s,".")});var x;if(f)return void Be({displayMessage:"Pipeline ".concat(null===(x=H)||void 0===x?void 0:x.uuid," already has a destination: ").concat(null===f||void 0===f?void 0:f.uuid,".")})}}var j=function(){return Jr({block:Cr({content:i,name:u,priority:n,require_unique_name:!0},e)}).then((function(n){(0,ee.wD)(n,{callback:function(){var e,i,l=n.data.block;(null===t||void 0===t||t(l),pt&&null!==re&&void 0!==re&&re(null===le||void 0===le?void 0:le.NOTEBOOK_BLOCK_OUTPUT_SPLIT_VIEW))?null===(e=window)||void 0===e||null===(i=e.location)||void 0===i||i.reload():(null!==c&&void 0!==c&&c.disableFetchingFiles||Wo(),Ln().then((function(e){var n=e.pipeline,t=n.blocks,i=n.extensions;Ii((function(e){var n=(0,o.Z)(t);Object.entries(i||{}).forEach((function(e){var t=(0,r.Z)(e,2),i=t[0],l=t[1].blocks;l&&n.push.apply(n,(0,o.Z)(l.map((function(e){return Cr(Cr({},e),{},{extension_uuid:i})}))))}));var l=(0,Te.HK)(e,(function(e){return e.uuid})),u=[];return n.forEach((function(e){var n=l[e.uuid];n?u.push(n):u.push(e)})),u}))})))},onErrorCallback:function(n,t){var i,o=null===n||void 0===n||null===(i=n.error)||void 0===i?void 0:i.exception,r=(0,kr.u$)(Cr(Cr({},e),{},{name:u}));o&&r&&o.startsWith(at.LR)?Be((function(){return{errors:t,links:[{label:"View existing block file contents and optionally add to pipeline (if applicable).",onClick:function(){zo(r),Be(null)}}],response:n}})):Be({errors:t,response:n})}})}))};return pt&&null!==re&&void 0!==re&&re(null===le||void 0===le?void 0:le.NOTEBOOK_BLOCK_OUTPUT_SPLIT_VIEW)?or().then((function(){return j()})):j()}),[Jr,re,null===le||void 0===le?void 0:le.NOTEBOOK_BLOCK_OUTPUT_SPLIT_VIEW,Wo,Ln,ut,zo,H,or,pt]),el=(0,nt.dd)((function(e){var n=e.block,t=e.idx,i=e.isReplacingBlock,o=void 0!==i&&i,r=e.isUpdatingBlock,l=void 0!==r&&r,u=e.name,c=void 0===u?(0,$.Y6)():u,s=e.onCreateCallback;return(0,S.jsx)(ne.BC,{children:(0,S.jsx)(oe,{block:n,defaultName:c,isReplacingBlock:o,isUpdatingBlock:l,onClose:il,onSave:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(l||o){var i,r=n.detach||!1;or({block:{color:(null===e||void 0===e?void 0:e.color)||null,detach:r,name:null===e||void 0===e?void 0:e.name,uuid:n.uuid},pipeline:{blocks:(null===(i=H)||void 0===i?void 0:i.blocks)||[]}}).then((function(){qi(null),il()}))}else $r(Cr(Cr({},n),(0,ye.gR)(e,["name"])),t,s,null===e||void 0===e?void 0:e.name).then((function(){return il()}))},pipeline:H})})}),{},[$r,H],{background:!0,disableEscape:!0,uuid:"configure_block_name_and_create"}),nl=(0,r.Z)(el,2),tl=nl[0],il=nl[1],ol=(0,nt.dd)((function(e){var n=e.cancelButtonText,t=e.header,i=e.onCancel,o=e.onSaveSuccess;return(0,S.jsx)(ne.BC,{children:(0,S.jsx)(di.Z,{cancelButtonText:n,contained:!0,header:t,onCancel:function(){null===i||void 0===i||i(),ul()},onSaveSuccess:function(e){ue(),ul(),null===o||void 0===o||o(e)}})})}),{},[ue],{background:!0,uuid:"configure_project"}),rl=(0,r.Z)(ol,2),ll=rl[0],ul=rl[1],cl=(0,v.Db)(V.ZP.widgets.pipelines.useCreate(he)),sl=(0,r.Z)(cl,1)[0],al=(0,f.useCallback)((function(e,n,t){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:(0,$.Y6)();return sl({widget:Cr({name:i,priority:n,type:g.tf.CHART},e)}).then((function(e){return(0,ee.wD)(e,{callback:function(){var n=e.data.widget;null===t||void 0===t||t(n),Wo(),Ln(),Vt(zt.cH.CHARTS),He(n)},onErrorCallback:function(e,n){return Be({errors:n,response:e})}})}))}),[Wo,Ln,sl,Vt]);(0,f.useEffect)((function(){if(Ue){var e,n=null===(e=$t.current[Ue.uuid])||void 0===e?void 0:e.current;n&&(n.scrollIntoView(),He(null))}}),[Ue,He]),(0,f.useEffect)((function(){Rn!==he&&(Ii([]),Di([]),io([]),Dn([]))}),[he,Rn]),(0,f.useEffect)((function(){var e,n;if("undefined"!==typeof(null===(e=H)||void 0===e?void 0:e.blocks)||"undefined"!==typeof(null===(n=H)||void 0===n?void 0:n.extensions)){var t,i,l,u,c,s,a,d,p=[];if("undefined"!==typeof(null===(t=H)||void 0===t?void 0:t.blocks))p.push.apply(p,(0,o.Z)(null===(c=H)||void 0===c?void 0:c.blocks));if("undefined"!==typeof(null===(i=H)||void 0===i?void 0:i.callbacks))p.push.apply(p,(0,o.Z)(null===(s=H)||void 0===s?void 0:s.callbacks));if("undefined"!==typeof(null===(l=H)||void 0===l?void 0:l.conditionals))p.push.apply(p,(0,o.Z)(null===(a=H)||void 0===a?void 0:a.conditionals));if("undefined"!==typeof(null===(u=H)||void 0===u?void 0:u.extensions))Object.entries((null===(d=H)||void 0===d?void 0:d.extensions)||{}).forEach((function(e){var n=(0,r.Z)(e,2),t=n[0],i=n[1].blocks;i&&p.push.apply(p,(0,o.Z)(i.map((function(e){return Cr(Cr({},e),{},{extension_uuid:t})}))))}));Ii(p)}}),[null===(k=H)||void 0===k?void 0:k.blocks,null===(P=H)||void 0===P?void 0:P.callbacks,null===(C=H)||void 0===C?void 0:C.conditionals,null===(_=H)||void 0===_?void 0:_.extensions]),(0,f.useEffect)((function(){var e;"undefined"!==typeof(null===(e=H)||void 0===e?void 0:e.widgets)&&Di(H.widgets)}),[null===(E=H)||void 0===E?void 0:E.widgets]),(0,f.useEffect)((function(){(null===eo||void 0===eo?void 0:eo.length)>0&&0===(null===to||void 0===to?void 0:to.length)&&(io(eo),ho(eo[0]))}),[to,eo]);var dl=(0,Jn.Z)(Ei);(0,f.useEffect)((function(){var e;if(!we&&("undefined"!==typeof(null===(e=H)||void 0===e?void 0:e.blocks)&&(!Ei.length||!(0,Te.fS)(null===dl||void 0===dl?void 0:dl.map((function(e){return e.uuid})).sort(),null===Ei||void 0===Ei?void 0:Ei.map((function(e){return e.uuid})).sort())||(0,ye.Qr)(On)))){var n=(0,ft.Rt)(H.blocks),t=n.content,i=n.messages;ti.current=t,(0,ye.Qr)(i)||Cn((function(e){return Cr(Cr({},i),e)})),_e(!0)}}),[Ei,dl,we,On,null===(I=H)||void 0===I?void 0:I.blocks,_e,Cn]),(0,f.useEffect)((function(){var e;if(!Mi.length&&"undefined"!==typeof(null===(e=H)||void 0===e?void 0:e.widgets)){var n=(0,ft.Rt)(H.widgets),t=n.content,i=n.messages;ii.current=t,Cn((function(e){return Cr(Cr({},i),e)}))}}),[null===(A=H)||void 0===A?void 0:A.widgets,Cn,Mi]),(0,f.useEffect)((function(){if(Gt&&!Vi){var e=Ei.find((function(e){var n,t=e.uuid;return(null===Gt||void 0===Gt||null===(n=Gt.split(":"))||void 0===n?void 0:n[0])===t}));e&&(Pt((function(n){return Cr(Cr({},n),{},(0,l.Z)({},e.uuid,!1))})),Ji(e.uuid,e.type,null))}else(null===dl||void 0===dl?void 0:dl.length)!==(null===Ei||void 0===Ei?void 0:Ei.length)&&Vi&&(Pt((function(e){return Cr(Cr({},e),{},(0,l.Z)({},Vi.uuid,!1))})),Ji(Vi.uuid,Vi.type,null))}),[Gt,Ei,null===dl||void 0===dl?void 0:dl.length,Ji,Vi,Pt]);var pl=(0,f.useMemo)((function(){return new b.Z}),[]),fl=(0,f.useMemo)((function(){return{api_key:gr.lG,token:pl.decodedToken.token}}),[pl]),vl=(0,d.ZP)((0,Zr.Ib)(),{onClose:function(){return console.log("socketUrlPublish closed")},onMessage:function(e){if(e){var n=JSON.parse(e.data),t=n.block_type,i=n.execution_state,r=n.msg_type,u=n.pipeline_uuid,c=n.uuid;if(!c&&!u)return;var s=Ei.find((function(e){var n=e.type,i=e.uuid;return t===n&&c===i}));"stream_pipeline"!==r?Cn((function(e){var t=e[c]||[];return Cr(Cr({},e),{},(0,l.Z)({},c,t.concat(n)))})):(Dn((function(e){return[].concat((0,o.Z)(e),[n])})),rt.uF.IDLE===i&&(zi([]),Ln(),c||Li(!1))),rt.uF.BUSY===i?zi((function(e){return e.find((function(e){var n=e.uuid;return c===n}))||!s?e:e.concat(s)})):rt.uF.IDLE===i&&zi((function(e){return e.filter((function(e){var n=e.uuid;return c!==n}))})),kn||At(!0)}},onOpen:function(){return console.log("socketUrlPublish opened")},reconnectAttempts:10,reconnectInterval:3e3,shouldReconnect:function(){return console.log("Attempting to reconnect..."),!0}}).sendMessage,hl=(0,f.useCallback)((function(){or().then((function(){Li(!0),Dn([]),vl(JSON.stringify(Cr(Cr({},fl),{},{execute_pipeline:!0,pipeline_uuid:he})))}))}),[he,or,vl,fl]),ml=(0,f.useCallback)((function(){vl(JSON.stringify(Cr(Cr({},fl),{},{cancel_pipeline:!0,pipeline_uuid:he})))}),[he,vl,fl]),bl=(0,f.useCallback)((function(){vl(JSON.stringify(Cr(Cr({},fl),{},{cancel_pipeline:!0,pipeline_uuid:he,skip_publish_message:!0})))}),[he,vl,fl]),gl=(0,f.useCallback)((function(){vl(JSON.stringify(Cr(Cr({},fl),{},{check_if_pipeline_running:!0,pipeline_uuid:he})))}),[he,vl,fl]);(0,f.useEffect)((function(){var e;return window.addEventListener("pagehide",bl),null===pe||void 0===pe||null===(e=pe.events)||void 0===e||e.on("routeChangeStart",bl),function(){var e;null===pe||void 0===pe||null===(e=pe.events)||void 0===e||e.off("routeChangeStart",bl),window.removeEventListener("pagehide",bl)}}),[bl,null===pe||void 0===pe?void 0:pe.events]);var xl=(0,f.useCallback)((function(e){var n=e.block,t=e.code,i=e.ignoreAlreadyRunning,o=e.runDownstream,r=void 0!==o&&o,u=e.runIncompleteUpstream,c=void 0!==u&&u,s=e.runSettings,a=void 0===s?{}:s,d=e.runTests,p=void 0!==d&&d,f=e.runUpstream,v=e.variables,h=n.extension_uuid,m=n.upstream_blocks,b=n.uuid;if(!Gi.find((function(e){var n=e.uuid;return b===n}))||i){var g,x,j="".concat(hr.vF,"_").concat(null===(g=H)||void 0===g?void 0:g.uuid);vl(JSON.stringify(Cr(Cr({},fl),{},{code:t,extension_uuid:h,output_messages_to_logs:!!(0,pn.U2)(j),pipeline_uuid:null===(x=H)||void 0===x?void 0:x.uuid,run_downstream:r,run_incomplete_upstream:c,run_settings:a,run_tests:p,run_upstream:f,type:n.type,upstream_blocks:m,uuid:b,variables:v}))),Cn((function(e){return delete e[b],e})),ze(!1),zi((function(e){return e.find((function(e){var n=e.uuid;return b===n}))?e:e.concat(n)})),ir((function(e){return Cr(Cr({},e),{},(0,l.Z)({},null===n||void 0===n?void 0:n.uuid,!0))}))}Ln()}),[Ln,H,Gi,vl,Cn,zi,ze,fl]),jl=(0,f.useCallback)((function(e){var n,t=e.block;return kn?xl(e):null===(n=or({block:{outputs:[],uuid:t.uuid}},{contentOnly:!0}))||void 0===n?void 0:n.then((function(){return xl(e)}))}),[kn,xl,or]),yl=(0,nt.dd)((function(e){var n=e.addNew,t=e.addNewBlock,i=e.blockType;return(0,S.jsx)(ne.BC,{children:(0,S.jsx)(M.Z,{contained:!0,defaultLinkUUID:i,onClickCustomTemplate:function(e){t({config:{custom_template:e,custom_template_uuid:null===e||void 0===e?void 0:e.template_uuid}}),Pl()},showAddingNewTemplates:!!n,showBreadcrumbs:!0,tabs:[br.n9]})})}),{},[],{background:!0,uuid:"browse_templates"}),kl=(0,r.Z)(yl,2),Zl=kl[0],Pl=kl[1],Ol=V.ZP.global_data_products.list({},{revalidateOnFocus:!1}).data,Cl=(0,f.useMemo)((function(){return(null===Ol||void 0===Ol?void 0:Ol.global_data_products)||[]}),[Ol]),wl=(0,nt.dd)((function(e){var n=e.addNewBlock;return(0,S.jsx)(ne.BC,{children:(0,S.jsx)(Bn.Z,{children:(0,S.jsx)(Tn.Z,{globalDataProducts:Cl,onClickRow:function(e){n({configuration:{global_data_product:{uuid:null===e||void 0===e?void 0:e.uuid}},type:g.tf.GLOBAL_DATA_PRODUCT}),El()}})})})}),{},[Cl],{background:!0,uuid:"global_data_products"}),_l=(0,r.Z)(wl,2),Sl=_l[0],El=_l[1],Il=(0,f.useRef)(null),Tl=(0,f.useState)(null),Ml=Tl[0],Dl=Tl[1],Rl=(0,f.useMemo)((function(){return zt.cH.INTERACTIONS===Wt}),[Wt]);(0,f.useEffect)((function(){var e,n;Wt&&null!==Il&&void 0!==Il&&Il.current&&Dl(null===Il||void 0===Il||null===(e=Il.current)||void 0===e||null===(n=e.getBoundingClientRect())||void 0===n?void 0:n.height)}),[Wt,je,fe,rn,Il]),(0,f.useEffect)((function(){!Er&&(null===Vn||void 0===Vn?void 0:Vn.length)>=1&&Ir((0,Te.HK)(Vn||[],(function(e){return e.uuid})))}),[Vn,Er,Ir]),(0,f.useEffect)((function(){!Mr&&null!==Kn&&void 0!==Kn&&Kn.blocks&&Dr(null===Kn||void 0===Kn?void 0:Kn.blocks)}),[Mr,Kn,Dr]);var Bl=(0,f.useMemo)((function(){return(0,S.jsx)(ur,{activeView:Wt,addNewBlockAtIndex:function(e,n,t,i){var o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return new Promise((function(){return tl({block:e,idx:n,isReplacingBlock:o,name:i,onCreateCallback:t})}))},afterWidth:Ie,autocompleteItems:Ro,blockInteractionsMapping:Mr,blockRefs:Jt,blocks:Ei,blocksInNotebook:Or,cancelPipeline:ml,chartRefs:$t,checkIfPipelineRunning:gl,containerHeightOffset:Rl?Ml+1:null,contentByBlockUUID:ti,createInteraction:it,deleteBlock:Fr,deleteWidget:Ao,editingBlock:Ui,executePipeline:hl,fetchFiles:Wo,fetchPipeline:Ln,fetchSecrets:wi,fetchVariables:Zi,globalDataProducts:Cl,globalVariables:Pi,insights:wo,interactions:Vn,interactionsMapping:Er,interruptKernel:Xr,isLoadingCreateInteraction:lt,isLoadingUpdatePipelineInteraction:$n,isPipelineExecuting:Ni,isPipelineUpdating:er,lastTerminalMessage:Q,messages:On,metadata:So,onChangeCallbackBlock:pi,onChangeChartBlock:hi,onChangeCodeBlock:fi,onSelectBlockFile:Ji,onUpdateFileSuccess:No,permissions:Br,pipeline:H,pipelineInteraction:Kn,pipelineMessages:_n,project:ce,refAfterFooter:Il,runBlock:jl,runningBlocks:Gi,sampleData:yo,savePipelineContent:or,savePipelineInteraction:Nr,secrets:_i,selectedBlock:Vi,selectedFilePath:Ko,sendTerminalMessage:te,setActiveSidekickView:Vt,setAllowCodeBlockShortcuts:en,setAnyInputFocused:qe,setBlockInteractionsMapping:Dr,setDisableShortcuts:Qe,setEditingBlock:Hi,setErrors:Be,setHiddenBlocks:Pt,setInteractionsMapping:Ir,setPermissions:Ar,setSelectedBlock:qi,setTextareaFocused:ze,showBrowseTemplates:Zl,showDataIntegrationModal:ar,showUpdateBlockModal:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,$.Y6)(),t=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return new Promise((function(){return tl({block:e,isReplacingBlock:t,isUpdatingBlock:!t,name:n})}))},sideBySideEnabled:pt,statistics:Io,textareaFocused:Ge,treeRef:ei,updatePipelineInteraction:Qn,updatePipelineMetadata:_r,updateWidget:Bi,widgets:Mi})}),[Wt,Ml,Ie,Ro,Mr,Jt,Ei,Or,ml,gl,ti,it,Fr,Ao,Ui,hl,Wo,Ln,wi,Zi,Cl,Pi,wo,Vn,Er,Xr,lt,$n,Ni,er,Rl,Q,On,So,pi,hi,fi,Ji,No,Br,H,Kn,_n,ce,Il,jl,Gi,yo,or,Nr,_i,Vi,Ko,te,Vt,qe,Dr,Hi,Be,Pt,Ir,Ar,ze,tl,Zl,ar,pt,Io,Ge,Qn,_r,Bi,Mi]),Al=(0,f.useMemo)((function(){return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)("div",{style:{height:be?null:0,opacity:be?null:0,visibility:be?null:"hidden"},children:Bl}),(0,S.jsx)("div",{style:{height:be?0:null,opacity:be?0:null,visibility:be?"hidden":null},children:Uo})]})}),[Uo,be,Bl]),Nl=(0,f.useMemo)((function(){return be?(0,S.jsx)(cr,{activeView:Wt,pipeline:H,project:ce,secrets:_i,selectedBlock:Vi,setSelectedBlock:qi,variables:Pi}):(0,S.jsx)(En.Z,{children:Vo})}),[Wt,Vo,Pi,H,ce,_i,Vi,qi]),Ll=(0,nt.dd)((function(e){var n=e.blockIndex;return(0,S.jsx)(ne.BC,{children:(0,S.jsx)(D.Z,{contained:!0,defaultBlockType:g.tf.DBT,onClickAction:function(e){var t;$r((0,ft.J8)({blockIndex:n,blocks:Ei,filePath:null===e||void 0===e||null===(t=e.row)||void 0===t?void 0:t.fullPath,repoPathRelativeRoot:null===ae||void 0===ae?void 0:ae.repo_path_relative_root}),("undefined"===typeof n||null===n?null===Ei||void 0===Ei?void 0:Ei.length:n+1)-(pt?1:0),(function(e){qi(e),Hl()}))}})})}),{},[$r,pt,ae],{background:!0,disableClickOutside:!1,disableCloseButton:!1,disableEscape:!0,uuid:"BlockBrowser/".concat(he)}),Fl=(0,r.Z)(Ll,2),Ul=Fl[0],Hl=Fl[1],Wl=(0,f.useMemo)((function(){return(0,S.jsx)(oi,{addNewBlockAtIndex:function(e){function n(n,t,i,o){return e.apply(this,arguments)}return n.toString=function(){return e.toString()},n}((function(e,n,t,i){return new Promise((function(){var o;J.L.BLOCK_FILE!==(null===e||void 0===e||null===(o=e.block_action_object)||void 0===o?void 0:o.object_type)&&(g.tf.DBT!==(null===e||void 0===e?void 0:e.type)||g.t6.SQL!==(null===e||void 0===e?void 0:e.language)||null!==e&&void 0!==e&&e.block_action_object)?tl({block:e,idx:n,name:i,onCreateCallback:t}):$r(e,n,t,i)}))})),addWidget:function(e,n){var t=n.onCreateCallback;return al(e,Mi.length,t)},afterHidden:je,allBlocks:Ei,allowCodeBlockShortcuts:$e,anyInputFocused:Ve,autocompleteItems:Ro,beforeHidden:Pe,blockInteractionsMapping:Mr,blockRefs:Jt,blocks:Or,blocksThatNeedToRefresh:li,dataProviders:ji,deleteBlock:Fr,disableShortcuts:Xe,fetchFiles:Wo,fetchPipeline:Ln,fetchSampleData:xo,files:Go,globalDataProducts:Cl,globalVariables:Pi,hiddenBlocks:mn,interactionsMapping:Er,interruptKernel:Xr,mainContainerRef:xn,mainContainerWidth:bi,messages:On,onChangeCallbackBlock:pi,onChangeCodeBlock:fi,openSidekickView:qt,pipeline:H,pipelineContentTouched:Bt,restartKernel:Yr,runBlock:jl,runningBlocks:Gi,savePipelineContent:or,scrollTogether:bt,selectedBlock:Vi,setAnyInputFocused:qe,setDisableShortcuts:Qe,setEditingBlock:Hi,setErrors:Be,setHiddenBlocks:Pt,setIntegrationStreams:lo,setOutputBlocks:io,setPipelineContentTouched:At,setSelectedBlock:qi,setSelectedOutputBlock:ho,setSelectedStream:so,setSideBySideEnabled:jt,setScrollTogether:xt,setTextareaFocused:ze,showBlockBrowserModal:Ul,showBrowseTemplates:Zl,showConfigureProjectModal:ll,showDataIntegrationModal:ar,showGlobalDataProducts:Sl,showUpdateBlockModal:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,$.Y6)();return new Promise((function(){return tl({block:e,isUpdatingBlock:!0,name:n})}))},sideBySideEnabled:pt,textareaFocused:Ge,widgets:Mi})}),[$r,al,je,$e,Ve,Ro,Pe,Jt,Mr,Ei,Or,li,ji,Fr,Xe,Wo,Ln,xo,Go,Cl,Pi,mn,Er,Xr,xn,bi,On,pi,fi,qt,H,Bt,Yr,jl,Gi,or,bt,Vi,qe,Hi,Be,Pt,At,qi,ze,jt,xt,tl,Ul,Zl,ll,ar,Sl,pt,Ge,Mi]),Gl=(0,f.useMemo)((function(){if(G===at.b7)return(0,S.jsx)(Sn,{cancelPipeline:ml,createPipeline:Xo,executePipeline:hl,interruptKernel:Xr,isPipelineExecuting:Ni,kernel:_t,pipeline:H,restartKernel:Yr,savePipelineContent:or,scrollTogether:bt,setActiveSidekickView:Vt,setMessages:Cn,setScrollTogether:xt,setSideBySideEnabled:jt,sideBySideEnabled:pt,updatePipelineMetadata:_r})}),[ml,Xo,hl,Xr,Ni,_t,G,H,Yr,or,bt,Ko,Vt,Cn,xt,jt,pt,_r]),zl=(0,f.useCallback)((function(e){e.widthOffset;if(G===at.b7)return(0,S.jsx)(Qt.rK,{relativePosition:!0,children:(0,S.jsxs)(ot,{isBusy:Gi.length>=1,kernel:_t,pipeline:H,restartKernel:Yr,savePipelineContent:or,setErrors:Be,setRunningBlocks:zi,updatePipelineMetadata:_r,children:[(0,S.jsx)(O.Z,{pr:1}),Gl]})})}),[Gl,Vo,_t,G,H,Yr,Gi,or,Be,_r]),Kl=(0,f.useMemo)((function(){if(G===at.b7)return(0,S.jsx)(fr,{kernel:_t,pipelineContentTouched:Bt,pipelineLastSaved:Et,ref:K,saveStatus:rr,width:bi})}),[_t,bi,G,Bt,Et,rr]),Vl=(0,f.useMemo)((function(){var e;return null===ro||void 0===ro||null===(e=ro.filter((function(e){return(0,Te.sE)(null===jo||void 0===jo?void 0:jo.outputs,(function(n){return n.variable_uuid==="output_sample_data_".concat((0,$.kE)(e))}))})))||void 0===e?void 0:e.map((function(e){return(0,S.jsx)(O.Z,{pl:1,children:(0,S.jsx)(U.ZP,{blackBorder:!0,compact:!0,muted:!0,onClick:function(){return so(e)},selected:co===e,uuid:e,children:e})},e)}))}),[jo,ro,co]),ql=(0,f.useMemo)((function(){return(0,S.jsx)(T,{blockRefs:Jt,hiddenBlocks:mn,pipeline:H,setHiddenBlocks:Pt})}),[Jt,mn,H,Pt]),Yl=(0,f.useMemo)((function(){return at.Jf.uuid===(null===sn||void 0===sn?void 0:sn.uuid)?Fo:at.IY.uuid===(null===sn||void 0===sn?void 0:sn.uuid)?ql:null}),[ql,Fo,sn]),Xl=(0,f.useMemo)((function(){return(0,S.jsx)(O.Z,{px:1,children:(0,S.jsx)(B.Z,{noPadding:!0,onClickTab:function(e){dn(e)},selectedTabUUID:null===sn||void 0===sn?void 0:sn.uuid,tabs:at.NR,underlineColor:(de||Se.Z).accent.purple,underlineStyle:!0})})}),[dn,sn,de]);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(Mn.Z,{title:null===(N=H)||void 0===N?void 0:N.name}),(0,S.jsxs)(ai,{after:Al,afterHeader:Nl,afterHeightOffset:mr.Mz,afterHidden:je,afterInnerHeightMinus:Ml,afterNavigationItems:yr({activeView:Wt,pipeline:H,project:ce,secrets:_i,setActiveSidekickView:Vt,variables:Pi}),afterOverflow:zt.cH.DATA===Wt?"hidden":null,afterSubheader:(null===to||void 0===to?void 0:to.length)>0&&Wt===zt.cH.DATA&&(0,S.jsxs)(Z.ZP,{alignItems:"center",fullHeight:!0,fullWidth:!0,children:[!ut&&to.map((function(e){var n=e.uuid,t=(null===po||void 0===po?void 0:po.uuid)===n;return(0,S.jsx)(O.Z,{pl:1,children:(0,S.jsx)(U.ZP,{afterElement:t?(0,S.jsx)(R.ZP,{basic:!0,highlightOnHover:!0,onClick:function(){(0,ft.h8)(he,e.uuid),io((function(e){return e.filter((function(e){return e.uuid!==n}))}))},padding:"2px",transparent:!0,children:(0,S.jsx)(q.x8,{muted:!0,size:1.25*w.iI})}):null,blackBorder:!0,compact:!0,muted:!0,onClick:function(){return ho(e)},selected:t,uuid:n,children:n})},n)})),ut&&Vl]}),before:Yl,beforeHeader:Xl,beforeHeightOffset:mr.Mz,beforeHidden:Pe,beforeNavigationItems:(0,jr.H)(xr.M.EDIT,H),errors:Ne||Re,footerOffset:null===K||void 0===K||null===(L=K.current)||void 0===L||null===(F=L.getBoundingClientRect())||void 0===F?void 0:F.height,mainContainerFooter:Kl,mainContainerHeader:zl,mainContainerRef:xn,page:G,pipeline:H,setAfterHidden:ke,setAfterWidthForChildren:Me,setBeforeHidden:Oe,setErrors:Ne?Le:Be,setMainContainerWidth:gi,children:[(0,S.jsx)(m.Z,{uuid:"PipelineDetail/".concat(he),children:Wl}),(0,S.jsx)(O.Z,{pb:pt?0:Math.max(Math.floor(fe*(2/3)/w.iI),0)})]})]})}wr.getInitialProps=function(){var e=(0,i.Z)(c().mark((function e(n){var t,i,o;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.query.pipeline,i=at.b7,o={page:i,pipeline:{uuid:t}},e.abrupt("return",o);case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();var _r=(0,pi.Z)(wr)},49555:function(e,n,t){"use strict";t.d(n,{j:function(){return a}});var i=t(82684);const o=e=>{let n;const t=new Set,i=(e,i)=>{const o="function"===typeof e?e(n):e;if(o!==n){const e=n;n=i?o:Object.assign({},n,o),t.forEach((t=>t(n,e)))}},o=()=>n,r={setState:i,getState:o,subscribe:e=>(t.add(e),()=>t.delete(e)),destroy:()=>t.clear()};return n=e(i,o,r),r};var r=t(81550);const{useSyncExternalStoreWithSelector:l}=r;const u=e=>{const n="function"===typeof e?(e=>e?o(e):o)(e):e,t=(e,t)=>function(e,n=e.getState,t){const o=l(e.subscribe,e.getState,e.getServerState||e.getState,n,t);return(0,i.useDebugValue)(o),o}(n,e,t);return Object.assign(t,n),t};var c=e=>e?u(e):u;var s=(e=>{const n=c((()=>e)),t=(Object.keys(e),(e,t)=>{n.setState((n=>{return{[e]:(i=n[e],o=t,"function"==typeof o?o(i):o)};var i,o}))});return{useGlobalState:e=>{const o=(0,i.useCallback)((n=>n[e]),[e]);return[n(o),(0,i.useCallback)((n=>t(e,n)),[e])]},getGlobalState:e=>n.getState()[e],setGlobalState:t,subscribe:(e,t)=>{n.subscribe(((n,i)=>{n[e]!==i[e]&&t(n[e])}))}}})({apiReloads:{}}),a=s.useGlobalState},23657:function(e,n,t){"use strict";var i=t(82394),o=t(75582),r=t(82684),l=t(74260),u=t(35686),c=t(77417);function s(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function a(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?s(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):s(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.clustersRefreshInterval,t=e.computeServiceRefreshInterval,s=e.connectionsRefreshInterval,d=e.includeAllStates,p=(0,c.Z)(),f=p.sparkEnabled,v=u.ZP.compute_services.detail("compute-service",{},{refreshInterval:t},{pauseFetch:!f}),h=v.data,m=v.mutate,b=(0,r.useMemo)((function(){return null===h||void 0===h?void 0:h.compute_service}),[h]),g={};d&&(g.include_all_states=!0);var x=u.ZP.compute_clusters.compute_services.list(null===b||void 0===b?void 0:b.uuid,g,{refreshInterval:n},{pauseFetch:!f}),j=x.data,y=x.mutate,k=(0,r.useMemo)((function(){return(null===j||void 0===j?void 0:j.compute_clusters)||[]}),[j]),Z=(0,r.useMemo)((function(){return null===k||void 0===k?void 0:k.map((function(e){return e.cluster}))}),[k]),P=(0,r.useMemo)((function(){var e,n;return null!==b&&void 0!==b&&null!==(e=b.setup_steps)&&void 0!==e&&e.length?null===b||void 0===b||null===(n=b.setup_steps)||void 0===n?void 0:n.every((function(e){var n=e.required,t=e.status_calculated;return!n||!t||l.br.COMPLETED===t})):null}),[b]),O=((0,r.useMemo)((function(){return null===Z||void 0===Z?void 0:Z.find((function(e){return e.active}))}),[Z]),u.ZP.compute_connections.compute_services.list(null===b||void 0===b?void 0:b.uuid,{},{refreshInterval:s},{pauseFetch:!f})),C=O.data,w=O.mutate,_=(0,r.useMemo)((function(){return(null===C||void 0===C?void 0:C.compute_connections)||[]}),[C]),S=(0,r.useCallback)((function(){return new Promise((function(){null===y||void 0===y||y(),null===w||void 0===w||w(),null===m||void 0===m||m()}))}),[y,w,m]);return{activeCluster:null===Z||void 0===Z?void 0:Z.find((function(e){return e.active})),clusters:Z,clustersLoading:!j,computeService:b,computeServiceUUIDs:Object.entries(l.GO).reduce((function(e,n){var t=(0,o.Z)(n,2),r=t[0],l=t[1];return a(a({},e),{},(0,i.Z)({},r,l))}),{}),connections:_,connectionsLoading:!C,fetchAll:S,fetchComputeClusters:y,fetchComputeConnections:w,fetchComputeService:m,setupComplete:P}}},76419:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/pipelines/[pipeline]/edit",function(){return t(76850)}])}},function(e){e.O(0,[9774,2678,3662,1154,844,6639,4804,9775,1124,1751,5896,6050,2714,9161,7011,2631,4783,3494,1557,2512,7858,5499,5283,4296,3745,5849,1550,2056,4052,9269,9264,976,8125,2888,179],(function(){return n=76419,e(e.s=n);var n}));var n=e.O();_N_E=n}]);
|