mage-ai 0.9.55__py3-none-any.whl → 0.9.57__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/parsers/ProjectParser.py +29 -0
- mage_ai/api/policies/BlockPolicy.py +1 -0
- mage_ai/api/policies/CustomDesignPolicy.py +3 -0
- mage_ai/api/policies/GitBranchPolicy.py +9 -0
- mage_ai/api/policies/GitCustomBranchPolicy.py +1 -0
- mage_ai/api/policies/GlobalHookPolicy.py +3 -0
- mage_ai/api/policies/ProjectPolicy.py +28 -0
- mage_ai/api/presenters/ProjectPresenter.py +4 -0
- mage_ai/api/resources/BlockResource.py +14 -1
- mage_ai/api/resources/FileResource.py +1 -1
- mage_ai/api/resources/GitFileResource.py +1 -1
- mage_ai/api/resources/GlobalHookResource.py +55 -10
- mage_ai/api/resources/PipelineResource.py +12 -11
- mage_ai/api/resources/ProjectResource.py +95 -7
- mage_ai/authentication/operation_history/models.py +1 -1
- mage_ai/cache/dbt/cache.py +1 -1
- mage_ai/cache/dbt/utils.py +22 -2
- mage_ai/cluster_manager/kubernetes/workload_manager.py +17 -7
- mage_ai/data_preparation/models/block/__init__.py +71 -5
- mage_ai/data_preparation/models/block/dbt/block_sql.py +13 -3
- mage_ai/data_preparation/models/block/dbt/dbt_adapter.py +15 -1
- mage_ai/data_preparation/models/block/dbt/profiles.py +14 -12
- mage_ai/data_preparation/models/block/platform/mixins.py +6 -2
- mage_ai/data_preparation/models/block/platform/utils.py +9 -1
- mage_ai/data_preparation/models/file.py +1 -1
- mage_ai/data_preparation/models/global_hooks/models.py +2 -2
- mage_ai/data_preparation/models/project/__init__.py +74 -4
- mage_ai/data_preparation/models/project/constants.py +1 -0
- mage_ai/data_preparation/repo_manager.py +3 -0
- mage_ai/orchestration/db/models/schedules.py +64 -102
- mage_ai/orchestration/db/models/schedules_project_platform.py +365 -0
- mage_ai/orchestration/pipeline_scheduler.py +5 -1700
- mage_ai/orchestration/pipeline_scheduler_original.py +1635 -0
- mage_ai/orchestration/pipeline_scheduler_project_platform.py +1701 -0
- mage_ai/server/constants.py +1 -1
- mage_ai/server/frontend_dist/404.html +2 -2
- mage_ai/server/frontend_dist/_next/static/A7VXVGKgLQCukXcjdysDz/_buildManifest.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/1557-724bfc3eabd095f7.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/161-33f26e485ddef393.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/2646-78905b899b68f4eb.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/3419-ad674b271b8520ce.js → frontend_dist/_next/static/chunks/3419-b8bd26f5946bec5a.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/3437-ce26fc28e114b44e.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/3540-9bb48b08f439d0a0.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/3745-61b1c63bb56bb670.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/{5729.0f2748e9e6dab951.js → 5189.dca121eccea793be.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/5457-b373ebdf4d05d8e2.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/5533-3455832bc3f8429b.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/5729-9d8204ab91da631d.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/5810-e26a0768db1cfdba.js → frontend_dist/_next/static/chunks/5810-addfa3491ae6b01c.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/8264-68db2a8334ad48f1.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/8432-0ace6fb7bdbc6864.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/8731-82571147875a2d58.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/874-d9e1b3c9c00ebac9.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/9264-5df6e4c7b1e85c02.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/{_app-0d183e2f234d52c6.js → _app-4c0239ca6203e827.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/compute-822e66aa2e90cf4c.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/files-373217c5de51aeef.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/global-data-products/{[...slug]-1e4838e534c8f31e.js → [...slug]-0325e76a2f3e08c1.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/{global-data-products-bb38f73540efeac4.js → global-data-products-927ebbdc29529765.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/global-hooks/[...slug]-a172f5a447bd8925.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/global-hooks-97bec2ac883e0c26.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/files-02d001d99eeaae3f.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/settings-2e577bfd4f0db2b7.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/users/[user]-1827574a4ba95a72.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/users/new-a913c361bcc0d1a9.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/users-4e6fdcbbfc931d67.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage-1c327edcf05df9c9.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/{oauth-eba7027969034415.js → oauth-bd8494f8875c5c97.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/overview-5a98e6a531410afb.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipeline-runs-1442183d13edec2e.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills/{[...slug]-b526282c8ac49986.js → [...slug]-38b2241cdd10320c.js} +1 -1
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills-515eb343210aa1fb.js → frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills-1c646dbef65d6a69.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/{dashboard-fe4d1321da8291cb.js → dashboard-35cb916a18ac4e1f.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-cd1918632dfef29d.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/{logs-c011d465f61138ee.js → logs-67b0572c84db0940.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/{block-runs-46c0dabd155581a0.js → block-runs-40201b626ea3a664.js} +1 -1
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-f2a052cb8a20fe47.js → frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-d1f23308effebe03.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/{monitors-579899cbaedcdefc.js → monitors-9a116d88f00916ff.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs/{[run]-7a2265b7e44bed0b.js → [run]-2d5abcd019d4bea1.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/{runs-9b53da919db959bd.js → runs-5363a7ae9afe8983.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/{settings-1839276725bfd757.js → settings-931a1b3112866a72.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/{syncs-68d779bc62185470.js → syncs-5ec5367cb877db38.js} +1 -1
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-01f4528602f4ba2a.js → frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-8366661f8e2b2959.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/{triggers-358523847fdbf547.js → triggers-378f8dada7d0c1dd.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines-627be24ef4963cfb.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/platform/global-hooks/[...slug]-814bbd11e10c26dc.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/platform/global-hooks-021ec25e05862f8f.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/settings/account/profile-00393e67ab1e6788.js → frontend_dist/_next/static/chunks/pages/settings/account/profile-2b0aa123043519b8.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/platform/preferences-05186e17c94347c1.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/platform/settings-efe8bf1bf3177a7e.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/permissions/{[...slug]-eaeba99f9547a20a.js → [...slug]-aa5d871de1f3f7b0.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/{permissions-c3140516cc28e467.js → permissions-ce45aad47049d993.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/preferences-1bc694b056ff0bcb.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/roles/{[...slug]-f6ff0e219a4b9ffd.js → [...slug]-88d29d1774db67e4.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/{roles-22ff9d862736b2ec.js → roles-d8ca763e405cd9d1.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/{sync-data-614925e838d1974c.js → sync-data-42bd909eb8951040.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/users/{[...slug]-5b88dfb1c6d0d16c.js → [...slug]-250dfdf22bfe67e9.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/{users-eb904db7ac7ea57c.js → users-97c4ce119f7238b5.js} +1 -1
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/sign-in-dcdd0c71f99aebad.js → frontend_dist/_next/static/chunks/pages/sign-in-1af3ba18ff646dd4.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/templates/[...slug]-ff9d49355393daea.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/{templates-5ebfe79c24d8c4b4.js → templates-299a2c8f2dd89cf3.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/terminal-fb3f398009a02879.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/test-59a08e06f4ef6c3a.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/triggers-551b85802515e313.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/version-control-1362aeda4a31dd41.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/{webpack-fea697dd168c6d0c.js → webpack-17c3a8f588f14cfd.js} +1 -1
- mage_ai/server/frontend_dist/block-layout.html +2 -2
- mage_ai/server/frontend_dist/compute.html +2 -2
- mage_ai/server/frontend_dist/files.html +2 -2
- mage_ai/server/frontend_dist/global-data-products/[...slug].html +2 -2
- mage_ai/server/frontend_dist/global-data-products.html +2 -2
- mage_ai/server/frontend_dist/global-hooks/[...slug].html +2 -2
- mage_ai/server/frontend_dist/global-hooks.html +2 -2
- mage_ai/server/frontend_dist/index.html +2 -2
- mage_ai/server/frontend_dist/manage/files.html +2 -2
- mage_ai/server/frontend_dist/manage/settings.html +2 -2
- mage_ai/server/frontend_dist/manage/users/[user].html +2 -2
- mage_ai/server/frontend_dist/manage/users/new.html +2 -2
- mage_ai/server/frontend_dist/manage/users.html +2 -2
- mage_ai/server/frontend_dist/manage.html +2 -2
- mage_ai/server/frontend_dist/oauth.html +3 -3
- mage_ai/server/frontend_dist/overview.html +2 -2
- mage_ai/server/frontend_dist/pipeline-runs.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills/[...slug].html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/dashboard.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/edit.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/logs.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runs.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runtime.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/runs/[run].html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/runs.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/settings.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/syncs.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers/[...slug].html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline].html +2 -2
- mage_ai/server/frontend_dist/pipelines.html +2 -2
- mage_ai/server/frontend_dist/platform/global-hooks/[...slug].html +24 -0
- mage_ai/server/frontend_dist/platform/global-hooks.html +24 -0
- mage_ai/server/frontend_dist/settings/account/profile.html +2 -2
- mage_ai/server/frontend_dist/settings/platform/preferences.html +24 -0
- mage_ai/server/frontend_dist/settings/platform/settings.html +24 -0
- mage_ai/server/frontend_dist/settings/workspace/permissions/[...slug].html +2 -2
- mage_ai/server/frontend_dist/settings/workspace/permissions.html +2 -2
- mage_ai/server/frontend_dist/settings/workspace/preferences.html +2 -2
- mage_ai/server/frontend_dist/settings/workspace/roles/[...slug].html +2 -2
- mage_ai/server/frontend_dist/settings/workspace/roles.html +2 -2
- mage_ai/server/frontend_dist/settings/workspace/sync-data.html +2 -2
- mage_ai/server/frontend_dist/settings/workspace/users/[...slug].html +2 -2
- mage_ai/server/frontend_dist/settings/workspace/users.html +2 -2
- mage_ai/server/frontend_dist/settings.html +2 -2
- mage_ai/server/frontend_dist/sign-in.html +3 -3
- mage_ai/server/frontend_dist/templates/[...slug].html +2 -2
- mage_ai/server/frontend_dist/templates.html +2 -2
- mage_ai/server/frontend_dist/terminal.html +2 -2
- mage_ai/server/frontend_dist/test.html +2 -2
- mage_ai/server/frontend_dist/triggers.html +2 -2
- mage_ai/server/frontend_dist/version-control.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/404.html +4 -4
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1557-724bfc3eabd095f7.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/161-33f26e485ddef393.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/2646-78905b899b68f4eb.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/3419-ad674b271b8520ce.js → frontend_dist_base_path_template/_next/static/chunks/3419-b8bd26f5946bec5a.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3437-ce26fc28e114b44e.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3540-9bb48b08f439d0a0.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3745-61b1c63bb56bb670.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{5729.0f2748e9e6dab951.js → 5189.dca121eccea793be.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5457-b373ebdf4d05d8e2.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5533-3455832bc3f8429b.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5729-9d8204ab91da631d.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/5810-e26a0768db1cfdba.js → frontend_dist_base_path_template/_next/static/chunks/5810-addfa3491ae6b01c.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8264-68db2a8334ad48f1.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8432-0ace6fb7bdbc6864.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8731-82571147875a2d58.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/874-d9e1b3c9c00ebac9.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9264-5df6e4c7b1e85c02.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{_app-0d183e2f234d52c6.js → _app-4c0239ca6203e827.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/compute-822e66aa2e90cf4c.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/files-373217c5de51aeef.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-data-products/{[...slug]-1e4838e534c8f31e.js → [...slug]-0325e76a2f3e08c1.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{global-data-products-bb38f73540efeac4.js → global-data-products-927ebbdc29529765.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-hooks/[...slug]-a172f5a447bd8925.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-hooks-97bec2ac883e0c26.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/files-02d001d99eeaae3f.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/settings-2e577bfd4f0db2b7.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/users/[user]-1827574a4ba95a72.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/users/new-a913c361bcc0d1a9.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/users-4e6fdcbbfc931d67.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage-1c327edcf05df9c9.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{oauth-eba7027969034415.js → oauth-bd8494f8875c5c97.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/overview-5a98e6a531410afb.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipeline-runs-1442183d13edec2e.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills/{[...slug]-b526282c8ac49986.js → [...slug]-38b2241cdd10320c.js} +1 -1
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills-515eb343210aa1fb.js → frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills-1c646dbef65d6a69.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/{dashboard-fe4d1321da8291cb.js → dashboard-35cb916a18ac4e1f.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/edit-cd1918632dfef29d.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/{logs-c011d465f61138ee.js → logs-67b0572c84db0940.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/{block-runs-46c0dabd155581a0.js → block-runs-40201b626ea3a664.js} +1 -1
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-f2a052cb8a20fe47.js → frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-d1f23308effebe03.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/{monitors-579899cbaedcdefc.js → monitors-9a116d88f00916ff.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/runs/{[run]-7a2265b7e44bed0b.js → [run]-2d5abcd019d4bea1.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/{runs-9b53da919db959bd.js → runs-5363a7ae9afe8983.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/{settings-1839276725bfd757.js → settings-931a1b3112866a72.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/{syncs-68d779bc62185470.js → syncs-5ec5367cb877db38.js} +1 -1
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-01f4528602f4ba2a.js → frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-8366661f8e2b2959.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/{triggers-358523847fdbf547.js → triggers-378f8dada7d0c1dd.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines-627be24ef4963cfb.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/platform/global-hooks/[...slug]-814bbd11e10c26dc.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/platform/global-hooks-021ec25e05862f8f.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/settings/account/profile-00393e67ab1e6788.js → frontend_dist_base_path_template/_next/static/chunks/pages/settings/account/profile-2b0aa123043519b8.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/platform/preferences-05186e17c94347c1.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/platform/settings-efe8bf1bf3177a7e.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/permissions/{[...slug]-eaeba99f9547a20a.js → [...slug]-aa5d871de1f3f7b0.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/{permissions-c3140516cc28e467.js → permissions-ce45aad47049d993.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/preferences-1bc694b056ff0bcb.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/roles/{[...slug]-f6ff0e219a4b9ffd.js → [...slug]-88d29d1774db67e4.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/{roles-22ff9d862736b2ec.js → roles-d8ca763e405cd9d1.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/{sync-data-614925e838d1974c.js → sync-data-42bd909eb8951040.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/users/{[...slug]-5b88dfb1c6d0d16c.js → [...slug]-250dfdf22bfe67e9.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/{users-eb904db7ac7ea57c.js → users-97c4ce119f7238b5.js} +1 -1
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/sign-in-dcdd0c71f99aebad.js → frontend_dist_base_path_template/_next/static/chunks/pages/sign-in-1af3ba18ff646dd4.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/templates/[...slug]-ff9d49355393daea.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{templates-5ebfe79c24d8c4b4.js → templates-299a2c8f2dd89cf3.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/terminal-fb3f398009a02879.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/test-59a08e06f4ef6c3a.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/triggers-551b85802515e313.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/version-control-1362aeda4a31dd41.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{webpack-d30cb09c85b4c4f0.js → webpack-b55fe1e575d8ac9d.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/wSRrM15xnvA8lOWcaque7/_buildManifest.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/block-layout.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/compute.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/files.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/global-data-products/[...slug].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/global-data-products.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/global-hooks/[...slug].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/global-hooks.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/index.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/manage/files.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/manage/settings.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/manage/users/[user].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/manage/users/new.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/manage/users.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/manage.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/oauth.html +3 -3
- mage_ai/server/frontend_dist_base_path_template/overview.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipeline-runs.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills/[...slug].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/dashboard.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/edit.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/logs.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runs.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runtime.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs/[run].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/settings.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/syncs.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers/[...slug].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/platform/global-hooks/[...slug].html +24 -0
- mage_ai/server/frontend_dist_base_path_template/platform/global-hooks.html +24 -0
- mage_ai/server/frontend_dist_base_path_template/settings/account/profile.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings/platform/preferences.html +24 -0
- mage_ai/server/frontend_dist_base_path_template/settings/platform/settings.html +24 -0
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/permissions/[...slug].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/permissions.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/preferences.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/roles/[...slug].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/roles.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/sync-data.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/users/[...slug].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/users.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/sign-in.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/templates/[...slug].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/templates.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/terminal.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/test.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/triggers.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/version-control.html +5 -5
- mage_ai/server/websocket_server.py +33 -22
- mage_ai/settings/models/configuration_option.py +15 -1
- mage_ai/settings/platform/__init__.py +44 -20
- mage_ai/shared/io.py +3 -0
- mage_ai/streaming/sinks/rabbitmq.py +3 -1
- mage_ai/streaming/sources/rabbitmq.py +5 -2
- mage_ai/tests/api/endpoints/test_pipeline_runs.py +4 -0
- mage_ai/tests/api/endpoints/test_projects.py +1 -0
- mage_ai/tests/api/resources/test_pipeline_resource.py +2 -2
- mage_ai/tests/data_preparation/models/block/platform/test_mixins.py +4 -3
- mage_ai/tests/data_preparation/models/test_block.py +2 -1
- mage_ai/tests/data_preparation/models/test_project.py +27 -7
- mage_ai/tests/orchestration/db/models/test_schedules.py +25 -7
- mage_ai/tests/orchestration/test_pipeline_scheduler.py +6 -261
- mage_ai/tests/orchestration/test_pipeline_scheduler_project_platform.py +286 -0
- mage_ai/tests/shared/mixins.py +1 -0
- {mage_ai-0.9.55.dist-info → mage_ai-0.9.57.dist-info}/METADATA +1 -1
- {mage_ai-0.9.55.dist-info → mage_ai-0.9.57.dist-info}/RECORD +309 -286
- mage_ai/server/frontend_dist/_next/static/7yQskzl_RfcpoOQn1DPQV/_buildManifest.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/1125-fbdaaef471846c61.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/1952-c4ba37bc172d7051.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/2646-d8612648f7836101.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/3437-91f6098316edaf17.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/3745-0aacee8ac93a042a.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/5332-c5abdf5c8d65a52e.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/5457-6e700aadac17ceec.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/8264-dad1f090c4278137.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/8432-ec2b97cbf32ec5a7.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/8731-9e0ad513b0dfce83.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/874-18d9f33cdd028e9d.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/9264-4428392376aa9dd4.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/9626-2627bc34f11b2906.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/compute-5ead3afa88d14721.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/files-87b31b998e9f1222.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/global-hooks/[...slug]-a7d74042d52c3c38.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/global-hooks-cf7f1ba0b44ec0fb.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/files-899b362caff47d4d.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/settings-b9ddd48737fba474.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/users/[user]-1e8731ba2559fef4.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/users/new-a6307396dfa82c88.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/users-fc5aafe5085739a9.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage-c008f0201864d693.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/overview-321f47b2dba4c780.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipeline-runs-bf4d162b5460acc6.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-62ee3e957688c725.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines-33d9fb90871be84c.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/preferences-f4ff09cfff8bad46.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/templates/[...slug]-04b0a55e8ad6f814.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/terminal-88025dd0ed3051a6.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/test-b936dd972db94c6b.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/triggers-e5e49ac3b9282aaa.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/version-control-a5372e488b5f44a2.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/2_SHgS8M315ekLG0qkZzC/_buildManifest.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1125-fbdaaef471846c61.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1952-c4ba37bc172d7051.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/2646-d8612648f7836101.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3437-91f6098316edaf17.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3745-0aacee8ac93a042a.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5332-c5abdf5c8d65a52e.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5457-6e700aadac17ceec.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8264-dad1f090c4278137.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8432-ec2b97cbf32ec5a7.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8731-9e0ad513b0dfce83.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/874-18d9f33cdd028e9d.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9264-4428392376aa9dd4.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9626-2627bc34f11b2906.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/compute-5ead3afa88d14721.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/files-87b31b998e9f1222.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-hooks/[...slug]-a7d74042d52c3c38.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-hooks-cf7f1ba0b44ec0fb.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/files-899b362caff47d4d.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/settings-b9ddd48737fba474.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/users/[user]-1e8731ba2559fef4.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/users/new-a6307396dfa82c88.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/users-fc5aafe5085739a9.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage-c008f0201864d693.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/overview-321f47b2dba4c780.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipeline-runs-bf4d162b5460acc6.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/edit-62ee3e957688c725.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines-33d9fb90871be84c.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/preferences-f4ff09cfff8bad46.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/templates/[...slug]-04b0a55e8ad6f814.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/terminal-88025dd0ed3051a6.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/test-b936dd972db94c6b.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/triggers-e5e49ac3b9282aaa.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/version-control-a5372e488b5f44a2.js +0 -1
- /mage_ai/server/frontend_dist/_next/static/{7yQskzl_RfcpoOQn1DPQV → A7VXVGKgLQCukXcjdysDz}/_ssgManifest.js +0 -0
- /mage_ai/server/frontend_dist_base_path_template/_next/static/{2_SHgS8M315ekLG0qkZzC → wSRrM15xnvA8lOWcaque7}/_ssgManifest.js +0 -0
- {mage_ai-0.9.55.dist-info → mage_ai-0.9.57.dist-info}/LICENSE +0 -0
- {mage_ai-0.9.55.dist-info → mage_ai-0.9.57.dist-info}/WHEEL +0 -0
- {mage_ai-0.9.55.dist-info → mage_ai-0.9.57.dist-info}/entry_points.txt +0 -0
- {mage_ai-0.9.55.dist-info → mage_ai-0.9.57.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2551,5810,3859,2646],{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,5189],"./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},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 x}});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 g=t(37529),b=t(28598);o._m.config({paths:{vs:"".concat((0,l.XF)(),"/monaco-editor/min/vs")}});var x=function(e){var n=e.autocompleteProviders,l=e.autoHeight,x=e.autoSave,j=e.block,y=e.fontSize,k=void 0===y?d.i3:y,Z=e.height,P=e.language,O=e.onChange,C=e.onContentSizeChangeCallback,w=e.onDidChangeCursorPosition,S=e.onMountCallback,_=e.onSave,E=e.padding,I=e.placeholder,T=e.readOnly,M=e.selected,A=(e.setSelected,e.setTextareaFocused),D=e.shortcuts,R=e.showLineNumbers,B=void 0===R||R,N=e.tabSize,L=void 0===N?4:N,U=e.textareaFocused,F=e.theme,H=void 0===F?"twilight":F,G=e.value,W=e.width,K=void 0===W?"100%":W,z=(0,r.useRef)(null),Y=(0,r.useRef)(null),V=(0,r.useRef)(null),q=(0,r.useState)([]),Q=q[0],X=q[1],J=(0,r.useState)(null),$=J[0],ee=J[1],ne=(0,r.useState)(!1),te=ne[0],ie=ne[1],oe=(0,r.useState)(null),re=oe[0],le=oe[1],ue=(0,r.useCallback)((function(e){le((function(n){return n!==H&&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)}))}))}(H).then((function(n){if(n)return e.editor.setTheme(H),H})),n}))}),[H]),ce=(0,r.useCallback)((function(e){e.languages.typescript.javascriptDefaults.setEagerModelSync(!0),ee(e),ue(e)}),[ue]),se=(0,r.useCallback)((function(e,n){z.current=e,Y.current=n;var t=[];null===D||void 0===D||D.forEach((function(i){t.push(i(n,e))})),_&&t.push((0,g.e)(n,(function(){_(e.getValue())}))),v(0,e,t),e.getModel().updateOptions({tabSize:L}),l&&!Z&&(e._domElement.style.height="".concat(((G||"").split("\n").length+p.Ep)*p.aU,"px")),e.onDidFocusEditorWidget((function(){null===A||void 0===A||A(!0)})),e.onDidContentSizeChange((function(n){var t=n.contentHeight,i=n.contentHeightChanged;l&&i&&(e._domElement.style.height="".concat(t+2*p.aU,"px")),C&&(null===C||void 0===C||C())})),M&&U&&setTimeout((function(){e.focus()}),1),w&&e.onDidChangeCursorPosition((function(n){var t=n.position.lineNumber,i=e._domElement.getBoundingClientRect(),o=i.height,r=i.top,l=e.getTopForLineNumber(t);w({editorRect:{height:Number(o),top:Number(r)},position:{lineNumberTop:l}})})),ie(!0),null===S||void 0===S||S()}),[l,Z,C,w,S,_,M,ie,A,D,L,U,G]);(0,r.useEffect)((function(){var e;return x&&_&&(e=setInterval((function(){_(z.current.getValue())}),5e3)),function(){x&&e&&clearInterval(e)}}),[x,z,_]);var ae=(0,s.Z)(M),de=(0,s.Z)(U);return(0,r.useEffect)((function(){null!==z&&void 0!==z&&z.current&&(M&&U?setTimeout((function(){z.current.focus()}),1):i.findDOMNode(z.current._domElement).getElementsByClassName("inputarea")[0].blur())}),[z,M,ae,U,de]),(0,r.useEffect)((function(){if(null!==Y&&void 0!==Y&&Y.current&&null!==z&&void 0!==z&&z.current){var e=[];null===D||void 0===D||D.forEach((function(n){e.push(n(null===Y||void 0===Y?void 0:Y.current,null===z||void 0===z?void 0:z.current))})),v(null===Y||void 0===Y||Y.current,null===z||void 0===z?void 0:z.current,e)}}),[null===j||void 0===j?void 0:j.downstream_blocks,null===j||void 0===j?void 0:j.upstream_blocks]),(0,r.useEffect)((function(){return function(){Q.map((function(e){return e.dispose()}))}}),[Q]),(0,r.useEffect)((function(){$&&n&&(0===Q.length&&U||!de&&U?X((0,f.S_)($,n)):de&&!U&&Q.map((function(e){return e.dispose()})))}),[n,Q,$,U,de]),(0,b.jsxs)(p.Nk,{hideDuplicateMenuItems:!0,padding:E,style:{display:te?null:"none"},children:[I&&!(null!==G&&void 0!==G&&G.length)&&(0,b.jsx)(p.KT,{children:(0,b.jsx)(c.ZP,{monospace:!0,muted:!0,children:I})}),(0,b.jsx)(o.ZP,{beforeMount:ce,height:Z,language:P||"python",onChange:function(e){null===O||void 0===O||O(e)},onMount:se,options:{domReadOnly:T,fontFamily:a.Vp,fontLigatures:!0,fontSize:k,hideCursorInOverviewRuler:!0,lineNumbers:B?"on":"off",minimap:{enabled:!1},overviewRulerBorder:!1,readOnly:T,renderLineHighlightOnlyWhenFocus:!0,scrollBeyondLastLine:!1,scrollbar:{alwaysConsumeMouseWheel:!1,vertical:"hidden"},useShadowDOM:!1,wordBasedSuggestions:!1,wordWrap:(null===j||void 0===j?void 0:j.type)===u.tf.MARKDOWN?"on":"off"},theme:re||"vs-dark",value:G,width:K}),(0,b.jsx)("div",{ref:V})]})}},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),g=t(81728),b=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,S=e.status_calculated,_=e.steps,E=e.tab,I=e.uuid,T=(null===_||void 0===_?void 0:_.length)||0,M=x||{completedGroup:!1,level:0,numberEl:null},A=M.completedGroup,D=M.level,R=M.numberEl,B=0===D?2*v.iI:1.5*v.iI;if(O){var N=(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(d.Z,{p:v.cd,children:(0,b.jsx)(c.ZP,{children:(0,b.jsxs)(u.Z,{flex:1,flexDirection:"column",children:[(0,b.jsxs)(c.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,b.jsx)(s.Z,{level:y?5:4,children:Z}),(0,b.jsx)(d.Z,{mr:v.cd}),m.br.COMPLETED===S&&(0,b.jsx)(f.Jr,{size:B,success:!0})]}),P&&(0,b.jsx)(d.Z,{mt:1,children:(0,b.jsx)(p.ZP,{default:!0,small:y,children:P})})]})})}),(0,b.jsx)(r.Z,{light:!0}),null===_||void 0===_?void 0:_.map((function(e,n){return k(e,n,T,{completedGroup:m.br.COMPLETED===S,level:0})}))]});return(0,b.jsxs)(d.Z,{mb:y?0:v.cd,children:[t&&(0,b.jsx)(a.Z,{noPadding:!0,children:N}),!t&&N]},I)}var L=m.br.COMPLETED===S,U=0===D?String(n+1):(0,g.bH)()[n].toLowerCase();var F=!!E&&i,H=(0,b.jsx)(d.Z,{pl:0===D?v.cd:0,children:(0,b.jsxs)(p.ZP,{large:!y,monospace:!0,muted:!0,children:[U,"."]})}),G={muted:L||A,strikethrough:L||A};return(0,b.jsx)(h.aw,{clickable:!!F,onClick:F?function(){return null===i||void 0===i?void 0:i(E)}:null,children:(0,b.jsxs)(d.Z,{py:0!==D||y?1:v.cd,children:[(0,b.jsxs)(c.ZP,{children:[R&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{style:{opacity:0},children:R}),(0,b.jsx)(d.Z,{mr:1})]}),H,(0,b.jsx)(d.Z,{mr:1}),(0,b.jsx)(u.Z,{flex:1,flexDirection:"column",children:(0,b.jsxs)(c.ZP,{flexDirection:"column",children:[(0,b.jsxs)(c.ZP,{alignItems:"center",children:[(0,b.jsxs)(u.Z,{flex:1,children:[0===D&&!y&&(0,b.jsx)(s.Z,j(j({level:5},G),{},{children:Z})),0===D&&y&&(0,b.jsx)(p.ZP,j(j({bold:!0,large:!0},G),{},{children:Z})),D>=1&&(0,b.jsx)(p.ZP,j(j({bold:!0,large:!y},G),{},{children:Z})),!w&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(d.Z,{mr:1}),(0,b.jsx)(p.ZP,{muted:!0,uppercase:!0,xsmall:!0,children:"optional"})]})]}),(0,b.jsx)(d.Z,{mr:v.cd}),L&&(0,b.jsx)(f.Jr,{size:B,success:!0}),m.br.INCOMPLETE===S&&(0,b.jsx)(f.uy,{muted:!0,size:B}),m.br.ERROR===S&&(0,b.jsx)(f.uy,{danger:!0,size:B}),(0,b.jsx)(d.Z,{pr:v.cd*(S?1:2)})]}),P&&(0,b.jsx)(d.Z,{mt:1,pr:3*v.cd,children:(0,b.jsx)(p.ZP,j(j({default:!0},G),{},{small:y,children:P}))}),C&&(0,b.jsx)(l.Z,{error:C,small:!0,warning:!0})]})})]}),T>=1&&(0,b.jsx)(d.Z,{mt:1,children:null===_||void 0===_?void 0:_.map((function(e,n){return k(e,n,T,{completedGroup:A,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,b.jsx)(d.Z,{p:v.cd,children:Z}):(0,b.jsx)(b.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),g=t(30160),b=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,S=void 0===C||C,_=e.fetchAll,E=e.hideDetails,I=e.onClickStep,T=e.small,M=(0,P.VI)(null,{},[],{uuid:"ConnectionSettings"}),A=(0,o.Z)(M,1)[0],D=(0,r.useState)(null),R=D[0],B=D[1],N=(0,r.useState)(null),L=N[0],U=N[1],F=(0,l.Db)((function(e){var n=e.action,i=e.uuid;return b.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===_||void 0===_||_(),U(w(w({},R),{},{computeConnection:n}))},onErrorCallback:function(e,n){return A({errors:n,response:e})}})}}),H=(0,o.Z)(F,2),G=H[0],W=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)&&U(null)}}),[i,L,U]),(0,O.jsx)(m.Z,{py:S?x.cd:0,children:null===i||void 0===i?void 0:i.map((function(e,t){var i,r,l,b,Z=e.actions,P=e.attributes,C=e.connection,w=e.description,_=e.name,M=e.required,A=e.status_calculated,D=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&&(b=(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 F=(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:_})}),(0,O.jsx)(m.Z,{mr:x.cd}),(0,O.jsx)(j.Fs,{danger:s.br.ERROR===A,muted:M&&s.br.INCOMPLETE===A,size:2*x.iI,success:!M||s.br.COMPLETED===A})]}),w&&(0,O.jsx)(m.Z,{mt:1,children:(0,O.jsx)(g.ZP,{default:!0,small:T,children:w})})]})})}),(null===D||void 0===D?void 0:D.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:D,small:T})]})]}),(l||b)&&(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)(g.ZP,{bold:!0,large:!0,children:"Attributes"})}),(0,O.jsx)(a.Z,{light:!0}),l,(0,O.jsx)(m.Z,{mb:x.cd})]})}),l&&b&&(0,O.jsx)(m.Z,{pr:x.cd}),b&&(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)(g.ZP,{bold:!0,large:!0,children:"Connection"})}),(0,O.jsx)(a.Z,{light:!0}),b,(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=W&&(null===R||void 0===R?void 0:R.uuid)===N&&(null===R||void 0===R?void 0:R.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)(g.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(){B({actionUUID:l,uuid:N}),U(null),G({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:S?x.cd:0,children:[S&&(0,O.jsx)(v.Z,{noPadding:!0,children:F}),!S&&F]},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 ")}))},32929:function(e,n,t){"use strict";t.d(n,{A2:function(){return m},dP:function(){return g},hS:function(){return j},iK:function(){return b},n9:function(){return h},qy:function(){return x}});var i,o=t(26304),r=t(82394),l=t(13507),u=t(44425),c=t(72473),s=t(57653),a=t(55283),d=["uuid"],p=["uuid"];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,r.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}var h={uuid:"Blocks"},m={uuid:"Pipelines"},g=[h,m],b=(i={},(0,r.Z)(i,u.tf.CALLBACK,c.AQ),(0,r.Z)(i,u.tf.CHART,c.GQ),(0,r.Z)(i,u.tf.CONDITIONAL,c.hW),(0,r.Z)(i,u.tf.CUSTOM,c.VS),(0,r.Z)(i,u.tf.DATA_EXPORTER,c.zS),(0,r.Z)(i,u.tf.DATA_LOADER,c.rH),(0,r.Z)(i,u.tf.DBT,c.xE),(0,r.Z)(i,u.tf.EXTENSION,c.Bf),(0,r.Z)(i,u.tf.MARKDOWN,c.$B),(0,r.Z)(i,u.tf.SENSOR,c.LM),(0,r.Z)(i,u.tf.TRANSFORMER,c.Sv),i),x=[{Icon:c.zQ,uuid:"All templates"}].concat([{uuid:u.tf.DATA_LOADER},{uuid:u.tf.TRANSFORMER},{selectedIconProps:{inverted:!0},uuid:u.tf.DATA_EXPORTER},{uuid:u.tf.SENSOR},{selectedIconProps:{inverted:!0},uuid:u.tf.CUSTOM},{uuid:u.tf.CHART},{selectedIconProps:{inverted:!0},uuid:u.tf.CALLBACK},{selectedIconProps:{inverted:!0},uuid:u.tf.CONDITIONAL},{uuid:u.tf.EXTENSION},{selectedBackgroundColor:null,uuid:u.tf.DBT},{selectedIconProps:{inverted:!0},uuid:u.tf.MARKDOWN}].map((function(e){var n=e.uuid,t=(0,o.Z)(e,d);return v({Icon:b[n],filterTemplates:function(e){return null===e||void 0===e?void 0:e.filter((function(e){return e.block_type===n}))},label:function(){return u.V4[n]},selectedBackgroundColor:function(e){return(0,a.qn)(n,{theme:e}).accent},uuid:n},t)}))),j=[{Icon:c.zQ,uuid:"All templates"}].concat([{Icon:c.X5,uuid:s.qL.PYTHON},{Icon:c.ZG,uuid:s.qL.INTEGRATION},{Icon:l.Z,uuid:s.qL.STREAMING}].map((function(e){var n=e.uuid,t=(0,o.Z)(e,p);return v({filterTemplates:function(e){return null===e||void 0===e?void 0:e.filter((function(e){var t;return(null===e||void 0===e||null===(t=e.pipeline)||void 0===t?void 0:t.type)===n}))},label:function(){return s.G7[n]},uuid:n},t)})))},93859:function(e,n,t){"use strict";t.d(n,{r:function(){return E},Z:function(){return A}});var i=t(82394),o=t(21831),r=t(82684),l=t(48670),u=t(12691),c=t.n(u),s=t(38626),a=t(78141),d=t(44628),p=t(6508),f=t(55485),v=t(30160),h=t(44897),m=t(70987),g=function(){var e=document.createElement("div");e.setAttribute("style","width: 100px; height: 100px; overflow: scroll; position:absolute; top:-9999px;"),document.body.appendChild(e);var n=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),n},b=t(95363),x=t(61896),j=t(47041),y=t(48888),k=t(70515),Z=t(40489),P=t(86735),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}var S=2*k.iI+x.dN,_=20*k.iI,E=8.7,I=s.default.div.withConfig({displayName:"DataTable__Styles",componentId:"sc-1arr863-0"})([""," "," "," .body > div{","}.table{border-spacing:0;display:inline-block;"," "," "," "," .tr{.td.td-index-column{","}}.th{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;","}.th,.td{"," font-family:",";margin:0;","}.td{padding:","px;}&.sticky{overflow:auto;}.header{overflow:hidden;}}"],(function(e){return e.disableScrolling&&"\n overflow: hidden;\n "}),(function(e){return e.height&&"\n height: ".concat(e.height,"px;\n ")}),(function(e){return e.maxHeight&&"\n max-height: ".concat(e.maxHeight,"px;\n ")}),j.w5,(function(e){return!e.noBorderBottom&&"\n border-bottom: 1px solid ".concat((e.theme.borders||m.Z.borders).medium,";\n ")}),(function(e){return!e.noBorderLeft&&"\n border-left: 1px solid ".concat((e.theme.borders||m.Z.borders).medium,";\n ")}),(function(e){return!e.noBorderRight&&"\n border-right: 1px solid ".concat((e.theme.borders||m.Z.borders).medium,";\n ")}),(function(e){return!e.noBorderTop&&"\n border-top: 1px solid ".concat((e.theme.borders||m.Z.borders).medium,";\n ")}),(function(e){return"\n color: ".concat((e.theme.content||m.Z.content).default,";\n ")}),(function(e){return"\n height: ".concat(e.columnHeaderHeight||S,"px;\n ")}),x.iD,b.ry,(function(e){return"\n background-color: ".concat((e.theme.background||m.Z.background).table,";\n border-bottom: 1px solid ").concat((e.theme.borders||m.Z.borders).medium,";\n border-right: 1px solid ").concat((e.theme.borders||m.Z.borders).medium,";\n ")}),1*k.iI);function T(e){var n=e.original,t=8.5*Math.max.apply(Math,(0,o.Z)(n.map((function(e){return(null===e||void 0===e?void 0:e.length)||0})))),i=Math.ceil(t/(_-2*k.iI));return Math.max(i,1)*x.dN+2*k.iI}function M(e){var n=e.columnHeaderHeight,t=e.columns,i=e.data,u=e.disableScrolling,j=e.height,C=e.index,I=e.invalidValues,M=e.maxHeight,A=e.numberOfIndexes,D=e.previewIndexes,R=e.renderColumnHeader,B=e.width,N=(0,r.useContext)(s.ThemeContext),L=(0,r.useRef)(null),U=(0,r.useRef)(null);(0,r.useEffect)((function(){var e=function(e){var n;null===L||void 0===L||null===(n=L.current)||void 0===n||n.scroll(e.target.scrollLeft,0)};return U&&U.current.addEventListener("scroll",e),function(){var n;null===U||void 0===U||null===(n=U.current)||void 0===n||n.removeEventListener("scroll",e)}}),[L,U]);var F=(0,r.useMemo)((function(){return C&&i&&C.length===i.length}),[i,C]),H=(0,r.useMemo)((function(){var e=[];return(0,P.w6)(A).forEach((function(n,t){var r=String(null===i||void 0===i?void 0:i.length).length*E;if(F){var l=C.map((function(e){return A>=2?String(e[t]).length:String(e).length}));r=Math.max.apply(Math,(0,o.Z)(l))*E}e.push(r+2*k.iI)})),e}),[i,C,A,F]),G=t.map((function(e){return null===e||void 0===e?void 0:e.Header})).slice(1),W=(0,r.useMemo)((function(){return g()}),[]),K=(0,r.useMemo)((function(){var e=B-(Math.max.apply(Math,(0,o.Z)(H))+1.5*k.iI+W),n=t.length-1,i=_;return i*n<e&&(i=e/n),{width:i}}),[t,H,W,B]),z=(0,d.useTable)({columns:t,data:i,defaultColumn:K},d.useBlockLayout,p.useSticky),Y=z.getTableBodyProps,V=z.getTableProps,q=z.headerGroups,Q=z.prepareRow,X=z.rows,J=(0,r.useCallback)((function(e){var n=e.index,t=e.style,i=new Set((null===D||void 0===D?void 0:D.removedRows)||[]),o=X[n];Q(o);var u=o.original,s=i.has(n);return(0,O.jsx)("div",w(w({},o.getRowProps({style:w(w({},t),{},{width:"auto"})})),{},{className:"tr",children:o.cells.map((function(e,t){var i,o=t<=A-1,a=e.getCellProps(),d=e.column.id,p=null===I||void 0===I||null===(i=I[d])||void 0===i?void 0:i.includes(n),h=w({},a.style);o&&(h.fontFamily=b.Vp,h.left=0,h.position="sticky",h.textAlign=C?"right":"center",h.width=H[t]);var g,x=u[t-A],j=G.indexOf(d);if(p&&(h.color=m.Z.interactive.dangerBorder),s&&(h.backgroundColor=m.Z.background.danger),Array.isArray(x)||"object"===typeof x)try{x=JSON.stringify(x)}catch(k){x="Error: cannot display value"}return o&&(F?(g=C[n],Array.isArray(g)&&(g=g[t])):g=e.render("Cell")),(0,r.createElement)("div",w(w({},a),{},{className:"td ".concat(o?"td-index-column":""),key:"".concat(t,"-").concat(x),style:h}),g,!o&&(0,O.jsxs)(f.ZP,{justifyContent:"space-between",children:[(0,O.jsxs)(v.ZP,{danger:p,default:!0,wordBreak:!0,children:[!0===x&&"true",!1===x&&"false",(null===x||"null"===x)&&"null",!0!==x&&!1!==x&&null!==x&&"null"!==x&&x]}),p&&(0,O.jsx)(c(),{as:(0,Z.o_)(y.mW,j),href:"/datasets/[...slug]",passHref:!0,children:(0,O.jsx)(l.Z,{danger:!0,children:"View all"})})]}))}))}))}),[G,C,I,H,A,Q,X,F,D]),$=(0,r.useMemo)((function(){var e;return M?(e=(0,P.Sm)(X.map(T)),e+=n||S-x.dN):(e=j,e-=n||S),e}),[n,j,M,X]),ee=(0,r.useMemo)((function(){return(0,O.jsx)(a.S_,{estimatedItemSize:S,height:$,itemCount:null===X||void 0===X?void 0:X.length,itemSize:function(e){return T(X[e])},outerRef:U,style:{maxHeight:M,pointerEvents:u?"none":null},children:J})}),[u,$,M,J,X]);return(0,O.jsx)("div",w(w({},V()),{},{className:"table sticky",style:{width:B},children:(0,O.jsxs)("div",w(w({},Y()),{},{className:"body",children:[(0,O.jsx)("div",{className:"header",ref:L,children:q.map((function(e,n){return(0,r.createElement)("div",w(w({},e.getHeaderGroupProps()),{},{className:"tr",key:"".concat(e.id,"_").concat(n)}),e.headers.map((function(e,n){var t,i=n<=A-1,o=e.getHeaderProps(),l=w({},o.style);return i?(l.fontFamily=b.Vp,l.left=0,l.position="sticky",l.textAlign="center",l.width=H[n],l.minWidth=H[n]):R?t=R(e,n-A,{width:K.width}):(t=e.render("Header"),l.color=(N||h.Z).content.default,l.padding=1*k.iI,l.minWidth=K.width),(0,r.createElement)("div",w(w({},o),{},{className:"th",key:e.id,style:l,title:i?"Row number":void 0}),t)})))}))}),ee]}))}))}var A=function(e){var n=e.columnHeaderHeight,t=e.columns,i=e.disableScrolling,o=e.height,l=e.index,u=e.invalidValues,c=e.maxHeight,s=e.noBorderBottom,a=e.noBorderLeft,d=e.noBorderRight,p=e.noBorderTop,f=e.previewIndexes,v=e.renderColumnHeader,h=e.rows,m=e.width;if(null===t||void 0===t?void 0:t.some((function(e){return""===e})))return null;var g=(0,r.useMemo)((function(){return null!==l&&void 0!==l&&l.length&&Array.isArray(l[0])?l[0].length:1}),[l]),b=(0,r.useMemo)((function(){return(0,P.w6)(g).map((function(e,n){return{Header:(0,P.w6)(n+1).map((function(){return" "})).join(" "),accessor:function(e,n){return n},sticky:"left"}})).concat(null===t||void 0===t?void 0:t.map((function(e){return{Header:String(e),accessor:String(e)}})))}),[t,g]),x=(0,r.useMemo)((function(){return(0,O.jsx)(M,{columnHeaderHeight:n,columns:b,data:h,disableScrolling:i,height:o,index:l,invalidValues:u,maxHeight:c,numberOfIndexes:g,previewIndexes:f,renderColumnHeader:v,width:m})}),[n,b,h,i,o,l,u,c,g,f,v,m]);return(0,O.jsx)(I,{columnHeaderHeight:n,disableScrolling:i,height:o,maxHeight:c?c+37:c,noBorderBottom:s,noBorderLeft:a,noBorderRight:d,noBorderTop:p,children:x})}},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 ")}))},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],g=null===t||void 0===t||null===(l=t.outdated_starting_at)||void 0===l?void 0:l[d],b={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({},b),{},{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({},b),{},{placeholder:"Enter a number",setContentOnMount:!0,type:"number"})),[(0,p.jsxs)(u.ZP,{default:!0,monospace:!0,children:[(0,a.vg)(d)," ",g&&(0,p.jsxs)(u.ZP,{inline:!0,monospace:!0,muted:!0,children:["(default: ",g,")"]})]},"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,g=null===o||void 0===o||null===(n=o.settings)||void 0===n?void 0:n[c],b=null===g||void 0===g?void 0:g.partitions,x=!!p||!!g;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})})," ",b&&(0,f.jsxs)(a.ZP,{inline:!0,monospace:!0,muted:!0,children:["(default: ",b,")"]})]},"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)(),g=f.ZP.global_data_products.list({},{},{pauseFetch:!!n}).data,b=(0,r.useMemo)((function(){return n||(null===g||void 0===g?void 0:g.global_data_products)||[]}),[g,n]);return g||n?g&&0===(null===b||void 0===b?void 0:b.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===b||void 0===b?void 0:b[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===b||void 0===b?void 0:b.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 ")}))},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(17679),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}},48888:function(e,n,t){"use strict";t.d(n,{AE:function(){return o},H3:function(){return r},mW:function(){return l},oE:function(){return u},yg:function(){return i}});var i="tabs[]",o="show_columns",r="column",l="Reports",u="Visualizations"},17679:function(e,n,t){"use strict";t.d(n,{O$:function(){return re},Fk:function(){return le}});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(28108),h=t(79487),m=t(29989),g=t(38626),b=t(61655),x=t(16853),j=t(65376),y=t(48072),k=t(24903),Z=t(84181),P=t(98677),O=t(30160),C=t(70987),w=t(79633),S=t(61896),_=t(70515),E=t(95363),I=t(28598),T=["height","width"];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 A(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,c.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 D={bottom:5*_.iI,left:3*_.iI,right:20*_.iI,top:0},R=function(e){return e.x},B=function(e){return e.y},N=(0,b.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,b=e.tooltipData,_=e.tooltipLeft,T=e.tooltipOpen,M=e.tooltipTop,N=e.width,L=e.xAxisLabel,U=e.xNumTicks,F=e.yLabelFormat,H=e.ySerialize,G=F;G||(G=function(e){return e.length>20?"".concat(e.substring(0,20),"..."):e});var W=o?S.iD:S.J5,K=(0,s.useContext)(g.ThemeContext),z=A(A({},D),l),Y=n.slice(Math.max(0,n.length-50)),V=Object.keys(Y[0]||[]).filter((function(e){return"x"===e})),q=(0,k.Z)({domain:V,range:[w.hM]}),Q=(0,Z.Z)({domain:[0,Math.max.apply(Math,(0,u.Z)(Y.map(R)))],nice:!0}),X=(0,P.Z)({domain:Y.map(B),padding:.35}),J={active:(null===K||void 0===K?void 0:K.content.default)||C.Z.content.default,backgroundPrimary:(null===K||void 0===K?void 0:K.chart.backgroundPrimary)||C.Z.chart.backgroundPrimary,backgroundSecondary:(null===K||void 0===K?void 0:K.chart.backgroundSecondary)||C.Z.chart.backgroundSecondary,muted:(null===K||void 0===K?void 0:K.content.muted)||C.Z.content.muted,primary:(null===K||void 0===K?void 0:K.chart.primary)||C.Z.chart.primary,tooltipBackground:(null===K||void 0===K?void 0:K.background.navigation)||C.Z.background.navigation},$=Y.map(H),ee=Math.min(Math.max.apply(Math,(0,u.Z)($.map((function(e){return String(e).length})))),20);6*ee>2*z.right?z.right+=5.5*ee:6*ee>=z.right&&(z.right+=3.75*ee);var ne=N-z.left-z.right,te=t-z.top-z.bottom;z.left+=7*ee,Q.rangeRound([0,ne]),X.rangeRound([te,0]);var ie=Y.map(R).length,oe=X($[ie-1]),re=(0,s.useCallback)((function(e){var n=(0,y.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=Y[r];"undefined"===typeof l&&(l=Y[r-1]),i>oe&&i<te-oe&&a({tooltipData:l,tooltipLeft:t,tooltipTop:i+z.top})}),[Y,ie,z.top,a,oe,te]);return N<10?null:(0,I.jsxs)("div",{children:[(0,I.jsxs)("svg",{height:t,width:N,children:[(0,I.jsx)(f.Z,{fill:"transparent",height:t-(z.top+z.bottom),onMouseLeave:function(){return i()},onMouseMove:re,onTouchMove:re,onTouchStart:re,rx:14,width:N-z.left,x:z.left,y:0}),(0,I.jsxs)(m.Z,{left:z.left,top:z.top,children:[(0,I.jsx)(v.Z,{color:q,data:Y,height:te,keys:V,pointerEvents:"none",xScale:Q,y:H,yScale:X,children:function(e){return e.map((function(e){return e.bars.map((function(n){return(0,I.jsx)("g",{children:(0,I.jsx)(I.Fragment,{children:(0,I.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,I.jsx)(d.Z,{hideTicks:!0,scale:X,stroke:J.muted,tickFormat:function(e){return G(e)},tickLabelProps:function(){return{fill:J.active,fontFamily:E.ry,fontSize:W,style:{width:"10px"},textAnchor:"end"}},tickStroke:J.muted,tickValues:$,top:2}),(0,I.jsx)(p.Z,{label:L,labelProps:{fill:J.muted,fontFamily:E.ry,fontSize:W,textAnchor:"middle"},numTicks:U,scale:Q,stroke:J.muted,tickLabelProps:function(){return{fill:J.active,fontFamily:E.ry,fontSize:W,textAnchor:"middle"}},tickStroke:J.muted,top:te})]}),b&&(0,I.jsx)("g",{children:(0,I.jsx)(h.Z,{from:{x:z.left,y:M},pointerEvents:"none",stroke:w.Ej,strokeDasharray:"5,2",strokeWidth:1,to:{x:ne+z.left,y:M}})})]}),T&&b&&(0,I.jsx)(x.Z,{left:_,style:A(A({},j.j),{},{backgroundColor:J.tooltipBackground}),top:M,children:(0,I.jsxs)(O.ZP,{black:!0,small:!0,children:[null===c||void 0===c?void 0:c(b),!c&&R(b).toFixed(4)]})})]})}));var L,U,F,H,G=function(e){var n=e.height,t=e.width,i=(0,l.Z)(e,T);return(0,I.jsx)("div",{style:{height:n,width:"undefined"===typeof t?"100%":t},children:(0,I.jsx)(a.Z,{children:function(e){var n=e.width,t=e.height;return(0,I.jsx)(N,A(A({},i),{},{height:t,width:n}))}})})},W=t(97618),K=t(52729),z=t(48670),Y=t(87862),V=t(89370),q=t(86735),Q=(q.Qj,q.tS,q.tS,q.tS,q.tS,q.Qj,q.Qj,q.Qj,q.tS,q.tS,L={},(0,c.Z)(L,V.RL.EMAIL,"domain_distribution"),(0,c.Z)(L,V.RL.TEXT,"word_distribution"),(0,c.Z)(L,V.RL.LIST,"element_distribution"),(0,c.Z)(L,"default","value_counts"),L),X=[].concat((0,u.Z)(V.P_),[V.RL.TEXT,V.RL.EMAIL,V.RL.LIST]),J=(U={},(0,c.Z)(U,V.RL.EMAIL,"Domain distribution"),(0,c.Z)(U,V.RL.TEXT,"Word distribution"),(0,c.Z)(U,V.RL.LIST,"Element distribution"),(0,c.Z)(U,"default","Distribution of values"),t(31353));!function(e){e.RANGE="range"}(F||(F={})),function(e){e.BAR_HORIZONTAL="bar_horizontal",e.LINE_CHART="line_chart",e.HISTOGRAM="histogram"}(H||(H={}));var $=t(48888),ee=t(92083),ne=t.n(ee),te=t(81728);function ie(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)),g=(0,q.Sm)(v),b=(0,q.IN)(v),x=g/Math.max(1,v.length),j=n[d]||l,y=null===j||void 0===j?void 0:j.columnType,k=V.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(F.RANGE===p)if(t||(t=s-a),u=V.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=ne().unix(i).format(j),o=ne().unix(a).format(C),l=ne().unix(s).format(w)}else i=(0,te.QV)(i);else i=c;var S=n>=1?f[n-1]:null,_=!1;r&&(_=r({x:e,y:d,yPrevious:S,yValues:v,yValuesAverage:x,yValuesMax:h,yValuesMin:m,yValuesStandardDeviation:b,yValuesSum:g}));var E={hideRange:u,isUnusual:_,x:e,xLabel:i,xLabelMax:l,xLabelMin:o,y:d};return _&&(u?P.push(E):Z.push(E)),E}));return{distribution:{data:C,featureUUID:d},rangedWithUnusualDistribution:(0,q.YC)(Z,(function(e){var n=e.y;return c(n)}),{ascending:!1}),unusualDistribution:(0,q.YC)(P,(function(e){var n=e.y;return c(n)}),{ascending:!1})}}var oe=t(40489);var re=12*_.iI;function le(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=J.T5[f],h=(o[p]||{}).charts,m=l.time_series,g=t.filter((function(e){return n[e]===V.RL.DATETIME})),b=null===m||void 0===m?void 0:m.map((function(e){return ie(e,{},{feature:{columnType:f,uuid:p}}).distribution})),x={};null===b||void 0===b||b.forEach((function(e,n){var t=e.data;x[g[n]]=(0,I.jsx)(K.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:re,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,I.jsxs)("p",{children:["Rows: ",t,(0,I.jsx)("br",{}),"Start: ",o,(0,I.jsx)("br",{}),"End: ",r]})},sortData:function(e){return(0,q.YC)(e,"[4]")}},p)}));var j,y=null===h||void 0===h?void 0:h.find((function(e){var n=e.type;return H.HISTOGRAM===n})),k=(y?ie(y,{},{feature:{columnType:f,uuid:p},getYValue:function(e){return e.value}}):{}).distribution,Z=void 0===k?null:k,P=Q[f]||Q.default,C=null===s||void 0===s?void 0:s["".concat(p,"/").concat(P)],w=Object.entries(C||{}).map((function(e){var n=(0,i.Z)(e,2),t=n[0];return{x:n[1],y:t}})),S=V.RL.TRUE_OR_FALSE===f;if(V.RL.DATETIME===f)j=x[p];else if(Z&&!S)j=(0,I.jsx)(K.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:re,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,I.jsxs)("p",{children:[l&&(0,I.jsxs)(I.Fragment,{children:["Rows: ",t,(0,I.jsx)("br",{}),"Value: ",o]}),!l&&(0,I.jsxs)(I.Fragment,{children:["Rows: ",t,(0,I.jsx)("br",{}),"Range: ",o," - ",r]})]})},sortData:function(e){return(0,q.YC)(e,"[2]")},width:d-2*_.iI});else if(X.includes(f)){var E=(0,q.YC)((0,q.YC)(w,"x",{ascending:!1}).slice(0,5),"x");j=(0,I.jsx)(G,{data:E,height:re,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,te.x6)(n)," times")},xNumTicks:2,ySerialize:function(e){return e.y}})}else S&&C&&(j=(0,I.jsx)(Y.Z,{data:Object.entries(C),getX:function(e){var n=(0,i.Z)(e,2),t=n[0],o=n[1];return"".concat(t," (").concat((0,te.x6)(o),")")},getY:function(e){return(0,i.Z)(e,2)[1]},height:re}));return(0,I.jsxs)("div",{style:{padding:_.iI},children:[(0,I.jsxs)("div",{style:{alignItems:"center",display:"flex",marginBottom:_.iI},children:[v&&(0,I.jsx)(W.Z,{title:V.Rp[f],children:(0,I.jsx)(v,{size:2*_.iI})}),(0,I.jsx)("div",{style:{marginLeft:.5*_.iI,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:d-4.5*_.iI},children:c?(0,I.jsx)(O.ZP,{bold:!0,default:!0,title:t[u],children:t[u]}):(0,I.jsx)(r(),{as:(0,oe.o_)($.oE,u),href:"/datasets/[...slug]",passHref:!0,children:(0,I.jsx)(z.Z,{bold:!0,monospace:!0,secondary:!0,small:!0,title:t[u],children:t[u]})})})]}),j,!j&&(0,I.jsx)("div",{style:{height:re}})]})}}},40489:function(e,n,t){"use strict";t.d(n,{o_:function(){return c}});var i=t(75582),o=t(34376),r=t(48888);t(82684),t(12691),t(71180),t(58036),t(97618),t(55485),t(48670),t(38276),t(30160),t(72473),t(28598);var l,u=t(69419);!function(e){e.DATASETS="datasets",e.DATASET_DETAIL="dataset_detail",e.COLUMNS="features",e.COLUMN_DETAIL="feature_detail",e.EXPORT="export"}(l||(l={}));var c=function(e,n){var t=(0,o.useRouter)().query.slug,c=void 0===t?[]:t,s=(0,i.Z)(c,1)[0],a=(0,u.iV)(),d=a.show_columns,p=a.column,f="/".concat(l.DATASETS,"/").concat(s),v="".concat(r.H3,"=").concat(p||n),h="".concat(r.yg,"=").concat(e,"&").concat(v,"&").concat(r.AE,"=").concat(d||0);return"".concat(f,"?").concat(h)}},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]},89706:function(e,n,t){"use strict";t.d(n,{JD:function(){return b},Lu:function(){return l},PF:function(){return h},aZ:function(){return r},d2:function(){return v},dT:function(){return u},n6:function(){return a},nB:function(){return g},oy:function(){return m},tE:function(){return d},xF:function(){return f}});var i,o,r,l,u,c=t(82394),s=t(44425);!function(e){e.DBT="dbt"}(r||(r={})),function(e){e.CSV="csv",e.JSON="json",e.MD="md",e.PY="py",e.R="r",e.SH="sh",e.SQL="sql",e.TXT="txt",e.YAML="yaml",e.YML="yml"}(l||(l={})),function(e){e.INIT_PY="__init__.py",e.METADATA_YAML="metadata.yaml",e.REQS_TXT="requirements.txt"}(u||(u={}));var a=[l.PY,l.SQL],d=[l.MD,l.PY,l.R,l.SQL,l.YAML],p=[l.JSON,l.MD,l.PY,l.R,l.SH,l.SQL,l.TXT,l.YAML,l.YML],f=new RegExp(p.map((function(e){return".".concat(e,"$")})).join("|")),v=new RegExp([l.CSV,l.JSON,l.MD,l.PY,l.R,l.SH,l.SQL,l.TXT,l.YAML,l.YML].map((function(e){return".".concat(e,"$")})).join("|")),h="charts",m="pipelines",g=(i={},(0,c.Z)(i,l.MD,s.t6.MARKDOWN),(0,c.Z)(i,l.JSON,l.JSON),(0,c.Z)(i,l.PY,s.t6.PYTHON),(0,c.Z)(i,l.R,s.t6.R),(0,c.Z)(i,l.SQL,s.t6.SQL),(0,c.Z)(i,l.TXT,"text"),(0,c.Z)(i,l.YAML,s.t6.YAML),(0,c.Z)(i,l.YML,s.t6.YAML),i),b=(o={},(0,c.Z)(o,s.t6.MARKDOWN,l.MD),(0,c.Z)(o,s.t6.PYTHON,l.PY),(0,c.Z)(o,s.t6.R,l.R),(0,c.Z)(o,s.t6.SQL,l.SQL),(0,c.Z)(o,s.t6.YAML,l.YAML),(0,c.Z)(o,"text",l.TXT),o)},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)},72098:function(e,n,t){"use strict";var i;t.d(n,{U:function(){return i}}),function(e){e.PYSPARK="pysparkkernel",e.PYTHON3="python3"}(i||(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)},57653:function(e,n,t){"use strict";t.d(n,{$1:function(){return h},G7:function(){return b},LM:function(){return x},Mj:function(){return j},QK:function(){return v},RH:function(){return g},a_:function(){return k},fj:function(){return Z},kA:function(){return y},qL:function(){return u},r0:function(){return m}});var i,o,r,l,u,c=t(75582),s=t(82394),a=t(72473),d=t(72098);function p(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 f(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?p(Object(t),!0).forEach((function(n){(0,s.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):p(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}!function(e){e.INTEGRATION="integration",e.PYTHON="python",e.PYSPARK="pyspark",e.STREAMING="streaming"}(u||(u={}));var v,h,m,g=(i={},(0,s.Z)(i,u.INTEGRATION,"Integration"),(0,s.Z)(i,u.PYTHON,"Python"),(0,s.Z)(i,u.PYSPARK,"PySpark"),(0,s.Z)(i,u.STREAMING,"Streaming"),i),b=(o={},(0,s.Z)(o,u.INTEGRATION,"Integration"),(0,s.Z)(o,u.PYTHON,"Standard"),(0,s.Z)(o,u.PYSPARK,"PySpark"),(0,s.Z)(o,u.STREAMING,"Streaming"),o),x="all",j=(u.PYTHON,u.INTEGRATION,u.STREAMING,r={},(0,s.Z)(r,x,a.ie),(0,s.Z)(r,u.INTEGRATION,a.YC),(0,s.Z)(r,u.PYTHON,a.El),(0,s.Z)(r,u.STREAMING,a.dB),r);!function(e){e.ACTIVE="active",e.INACTIVE="inactive",e.NO_SCHEDULES="no_schedules",e.RETRY="retry",e.RETRY_INCOMPLETE_BLOCK_RUNS="retry_incomplete_block_runs"}(v||(v={})),function(e){e.GROUP="group_by",e.HISTORY_DAYS="from_history_days",e.NO_TAGS="no_tags",e.SEARCH="search",e.STATUS="status[]",e.TAG="tag[]",e.TYPE="type[]"}(h||(h={})),function(e){e.STATUS="status",e.TAG="tag",e.TYPE="type"}(m||(m={}));var y=[v.ACTIVE,v.INACTIVE,v.NO_SCHEDULES],k=(l={},(0,s.Z)(l,u.PYTHON,d.U.PYTHON3),(0,s.Z)(l,u.PYSPARK,d.U.PYSPARK),l),Z=Object.entries(k).reduce((function(e,n){var t=(0,c.Z)(n,2),i=t[0],o=t[1];return f(f({},e),{},(0,s.Z)({},o,i))}),{})},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 g(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)(g,{value:n})}},children:v})}},39457:function(e,n,t){"use strict";var i,o=t(82394),r=(t(82684),t(64866)),l=t(21764),u=t(55485),c=t(48670),s=t(38276),a=t(30160),d=t(12468),p=t(72473),f=t(70515),v=t(28598);function h(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 m(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?h(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):h(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}!function(e){e.LEFT="left",e.RIGHT="right"}(i||(i={})),n.Z=function(e){var n,t=e.children,o=e.copiedText,h=e.iconPosition,g=void 0===h?i.LEFT:h,b=e.inverted,x=e.linkProps,j=e.linkText,y=e.monospace,k=e.muted,Z=e.small,P=e.toastMessage,O=e.withCopyIcon;return t?n=(0,v.jsx)("span",{children:t}):O&&(n=(0,v.jsx)(c.Z,m(m({href:"#",inline:!0,muted:k,preventDefault:!0,sameColorAsText:!0,small:Z},x),{},{children:(0,v.jsxs)(u.ZP,{alignItems:"center",children:[g===i.LEFT&&(0,v.jsx)(s.Z,{mr:j?1:0,children:(0,v.jsx)(u.ZP,{alignItems:"center",children:(0,v.jsx)(p.CK,{inverted:b,muted:k,size:2*f.iI})})}),j&&(0,v.jsx)(a.ZP,{inverted:b,monospace:y,muted:k,small:Z,children:j}),g===i.RIGHT&&(0,v.jsx)(s.Z,{ml:j?1:0,children:(0,v.jsx)(u.ZP,{alignItems:"center",children:(0,v.jsx)(p.CK,{inverted:b,muted:k})})})]})}))),(0,v.jsx)(d.Z,{block:!0,label:"Copy",size:null,widthFitContent:!0,children:(0,v.jsx)(r.CopyToClipboard,{onCopy:function(){return l.Am.success(P||"Successfully copied to clipboard.",{position:l.Am.POSITION.BOTTOM_RIGHT,toastId:o})},text:o,children:n})})}},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})}},35185:function(e,n,t){"use strict";var i=t(82394),o=t(91835),r=(t(82684),t(38626)),l=t(44897),u=t(42631),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}var p=r.default.div.withConfig({displayName:"ProgressBar__ProgressBarContainerStyle",componentId:"sc-10x9ojc-0"})(["border-radius:","px;height:","px;overflow:hidden;position:relative;width:100%;",""],u.BG,.75*c.iI,(function(e){return"\n background-color: ".concat((e.theme.monotone||l.Z.monotone).grey200,";\n ")})),f=r.default.div.withConfig({displayName:"ProgressBar__ProgressBarStyle",componentId:"sc-10x9ojc-1"})(["height:inherit;position:absolute;"," "," "," ",""],(function(e){return!e.danger&&"\n background-color: ".concat((e.theme.progress||l.Z.progress).positive,";\n ")}),(function(e){return e.progress&&"\n width: ".concat(e.progress,"%;\n ")}),(function(e){return e.danger&&"\n background-color: ".concat((e.theme.progress||l.Z.progress).negative,";\n ")}),(function(e){return e.animateProgress&&"\n animation: animate-progress ".concat(e.animateProgress.duration,"ms linear forwards;\n\n @keyframes animate-progress {\n 0% {\n width: ").concat(e.animateProgress.start,"%;\n }\n\n 100% {\n width: ").concat(e.animateProgress.end,"%;\n }\n }\n ")}));n.Z=function(e){var n=(0,o.Z)({},e);return(0,s.jsx)(p,d(d({},n),{},{children:(0,s.jsx)(f,d({},n))}))}},13507:function(e,n,t){"use strict";var i=t(28598);n.Z=function(e){var n=e.fill,t=void 0===n?"white":n,o=e.size;return(0,i.jsxs)("svg",{fill:"none",height:o,viewBox:"0 0 20 20",width:o,xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsxs)("g",{clipPath:"url(#clip0_11802_82850)",children:[(0,i.jsx)("path",{d:"M15.6276 1.73378C15.97 1.96689 16.022 2.44136 15.7638 2.76532C15.5057 3.08929 15.0355 3.13958 14.69 2.91102C13.3636 2.0334 11.8126 1.54269 10.2126 1.50266C8.36175 1.45636 6.54643 2.01561 5.04253 3.09541C3.53863 4.1752 2.4284 5.71649 1.8806 7.48498C1.40702 9.01387 1.37618 10.6403 1.7837 12.1777C1.88982 12.5781 1.69185 13.0076 1.30237 13.1486C0.912892 13.2896 0.479935 13.0887 0.368517 12.6897C-0.147093 10.8435 -0.122519 8.88224 0.447763 7.04116C1.09223 4.96057 2.39838 3.14729 4.16768 1.87695C5.93697 0.606601 8.07265 -0.0513415 10.2501 0.00312922C12.1769 0.0513296 14.0431 0.655033 15.6276 1.73378Z",fill:t}),(0,i.jsx)("path",{d:"M13.2714 5.89383C13.5295 5.56986 13.4781 5.09341 13.1245 4.87771C12.2306 4.33247 11.2055 4.02828 10.15 4.00188C8.84359 3.9692 7.56218 4.36396 6.50061 5.12617C5.43903 5.88838 4.65534 6.97634 4.26866 8.22469C3.95628 9.23316 3.91679 10.3017 4.14767 11.323C4.23901 11.727 4.67403 11.928 5.06351 11.787C5.45299 11.6461 5.64766 11.216 5.57323 10.8086C5.44361 10.0989 5.48588 9.36461 5.70149 8.66852C5.9915 7.73226 6.57927 6.91628 7.37545 6.34463C8.17164 5.77297 9.13269 5.4769 10.1125 5.50141C10.841 5.51963 11.5503 5.71432 12.1813 6.06401C12.5436 6.26478 13.0133 6.2178 13.2714 5.89383Z",fill:t}),(0,i.jsx)("path",{clipRule:"evenodd",d:"M10 7.5C8.61929 7.5 7.5 8.61929 7.5 10C7.5 11.3807 8.61929 12.5 10 12.5C11.3807 12.5 12.5 11.3807 12.5 10C12.5 8.61929 11.3807 7.5 10 7.5ZM9 10C9 10.5523 9.44772 11 10 11C10.5523 11 11 10.5523 11 10C11 9.44772 10.5523 9 10 9C9.44772 9 9 9.44772 9 10Z",fill:t,fillRule:"evenodd"}),(0,i.jsx)("path",{d:"M6.87554 15.1223C6.52192 14.9066 6.47052 14.4301 6.72863 14.1062C6.98673 13.7822 7.45642 13.7352 7.81872 13.936C8.44971 14.2857 9.15897 14.4804 9.88746 14.4986C10.8673 14.5231 11.8284 14.227 12.6245 13.6554C13.4207 13.0837 14.0085 12.2677 14.2985 11.3315C14.5141 10.6354 14.5564 9.90111 14.4268 9.19144C14.3523 8.78397 14.547 8.35395 14.9365 8.21295C15.326 8.07196 15.761 8.27297 15.8523 8.67699C16.0832 9.69826 16.0437 10.7668 15.7313 11.7753C15.3447 13.0237 14.561 14.1116 13.4994 14.8738C12.4378 15.636 11.1564 16.0308 9.84995 15.9981C8.79455 15.9717 7.76942 15.6675 6.87554 15.1223Z",fill:t}),(0,i.jsx)("path",{d:"M4.23615 17.2347C3.97805 17.5586 4.03001 18.0331 4.37241 18.2662C5.95691 19.345 7.82314 19.9487 9.74992 19.9969C11.9274 20.0513 14.063 19.3934 15.8323 18.1231C17.6016 16.8527 18.9078 15.0394 19.5522 12.9588C20.1225 11.1178 20.1471 9.15647 19.6315 7.31026C19.5201 6.91131 19.0871 6.7104 18.6976 6.85139C18.3082 6.99238 18.1102 7.42188 18.2163 7.82227C18.6238 9.35971 18.593 10.9861 18.1194 12.515C17.5716 14.2835 16.4614 15.8248 14.9575 16.9046C13.4536 17.9844 11.6382 18.5436 9.78743 18.4973C8.18738 18.4573 6.63645 17.9666 5.30996 17.089C4.96451 16.8604 4.49426 16.9107 4.23615 17.2347Z",fill:t})]}),(0,i.jsx)("defs",{children:(0,i.jsx)("clipPath",{id:"clip0_11802_82850",children:(0,i.jsx)("rect",{fill:t,height:"20",width:"20"})})})]})}},80265:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return Rr}});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),g=t(40761),b=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),S=t(55283),_=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,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(O.Z,{p:1,children:(0,_.jsxs)(Z.ZP,{alignItems:"center",children:[(0,_.jsx)(x.Z,{checked:v,label:"Show all",onClick:function(){return o((function(){return{}}))}}),(0,_.jsx)(O.Z,{mr:w.cd}),(0,_.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,_.jsx)(y.Z,{medium:!0}),null===u||void 0===u?void 0:u.map((function(e){var n=e.uuid,i=(0,S.qn)(e.type,{blockColor:e.color,theme:r}).accent,u=!(null!==t&&void 0!==t&&t[n]);return(0,_.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,_.jsx)(O.Z,{mt:1,px:1,children:(0,_.jsxs)(Z.ZP,{alignItems:"center",children:[(0,_.jsx)(O.Z,{pr:1,children:(0,_.jsx)(x.Z,{checked:u})}),(0,_.jsxs)(k.Z,{alignItems:"center",children:[(0,_.jsx)(j.Z,{color:i,size:1.5*w.iI,square:!0}),(0,_.jsx)(O.Z,{mr:1}),(0,_.jsx)(C.ZP,{default:!0,monospace:!0,noWrapping:!0,small:!0,children:n})]})]})})},n)}))]})},M=t(60523),A=t(71180),D=t(90299),R=t(65701),B=t(1254);var N=function(e){var n=e.size;return(0,_.jsxs)("svg",{width:n,height:n,viewBox:"0 0 121 121",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,_.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,_.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,_.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,_.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,_.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,_.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,_.jsxs)("defs",{children:[(0,_.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,_.jsx)("stop",{stopColor:"#FFDA19"}),(0,_.jsx)("stop",{offset:"0.473958",stopColor:"#33CDF2"}),(0,_.jsx)("stop",{offset:"0.786458",stopColor:"#3266FF"}),(0,_.jsx)("stop",{offset:"1",stopColor:"#5429FF"})]}),(0,_.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,_.jsx)("stop",{stopColor:"white"}),(0,_.jsx)("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]}),(0,_.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,_.jsx)("stop",{stopColor:"white"}),(0,_.jsx)("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]}),(0,_.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,_.jsx)("stop",{offset:"0.081278",stopColor:"white"}),(0,_.jsx)("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]}),(0,_.jsxs)("linearGradient",{id:"paint4_linear_11972_15232",x1:"76.5876",y1:"66.532",x2:"79.1358",y2:"50.4429",gradientUnits:"userSpaceOnUse",children:[(0,_.jsx)("stop",{stopColor:"white"}),(0,_.jsx)("stop",{offset:"0.416667",stopColor:"white",stopOpacity:"0.1"}),(0,_.jsx)("stop",{offset:"0.682292",stopColor:"white",stopOpacity:"0"})]}),(0,_.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,_.jsx)("stop",{stopColor:"white"}),(0,_.jsx)("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]}),(0,_.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,_.jsx)("stop",{stopColor:"white"}),(0,_.jsx)("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]})]})]})},L=t(68013),U=t(93369),F=t(7267),H=t(57653),G=t(44085),W=t(4190),K=t(17488),z=t(35686),Y=t(72473),V=t(4015),q=t(13803),Q=t(72191),X=t(2548),J=t(81728),$=t(72619),ee=t(23780);function ne(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 te(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ne(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ne(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ie=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,ee.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),g=(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=g[0],j=g[1],y=(0,f.useCallback)((function(){s(te(te({},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 H.qL.INTEGRATION===(null===a||void 0===a?void 0:a.type)}),[a]),S=(0,f.useMemo)((function(){return b.tf.CUSTOM===(null===i||void 0===i?void 0:i.type)}),[i]),E=(0,f.useMemo)((function(){return b.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 X.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 q.I.DATA_INTEGRATION===(null===i||void 0===i||null===(e=i.config)||void 0===e?void 0:e.template_type)||!![q.O.DESTINATIONS,q.O.SOURCES].includes(null===I||void 0===I?void 0:I.language)}),[i,I]),ne=(0,f.useState)(null),ie=ne[0],oe=ne[1],re=(0,v.Db)(z.ZP.llms.useCreate(),{onSuccess:function(e){return(0,$.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 te(te({},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&&!ie&&ue({llm:{request:{block_description:M},use_case:F.z.GENERATE_BLOCK_WITH_DESCRIPTION}})}),[ue,M,T,ie]);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:[X.L.CUSTOM_BLOCK_TEMPLATE,X.L.MAGE_TEMPLATE].includes(null===I||void 0===I?void 0:I.object_type)?te(te({},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=b.V4[e];return P&&(b.tf.DATA_LOADER===e?n="Source":b.tf.DATA_EXPORTER===e&&(n="Destination")),n}),[i,x,se,P]);return(0,_.jsxs)(V.Nk,{width:T&&(null===x||void 0===x?void 0:x.content)&&80*w.iI,children:[(0,_.jsxs)(V.I5,{children:[T&&ce&&(0,_.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,_.jsx)(C.ZP,{children:"Generating block using AI..."}),(0,_.jsx)(W.Z,{inverted:!0})]}),T&&!ce&&(0,_.jsx)(Z.ZP,{alignItems:"center",justifyContent:"center",children:(0,_.jsx)(Y.xq,{size:5*w.iI,warning:!0})}),!T&&(0,_.jsx)(Z.ZP,{alignItems:"center",justifyContent:"center",children:(0,_.jsx)(N,{size:15*w.iI})})]}),T&&!ce&&(0,_.jsx)(V.gI,{children:(0,_.jsxs)(O.Z,{py:1,children:[(0,_.jsx)(O.Z,{mb:1,children:(0,_.jsx)(C.ZP,{default:!0,children:"Block generated using AI"})}),(0,_.jsx)(C.ZP,{textOverflow:!0,children:M})]})}),se&&(0,_.jsx)(V.gI,{children:(0,_.jsxs)(O.Z,{py:1,children:[(0,_.jsx)(O.Z,{mb:1,children:(0,_.jsx)(C.ZP,{default:!0,children:"Template"})}),(0,_.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)})]})}),b.tf.GLOBAL_DATA_PRODUCT!==(null===i||void 0===i?void 0:i.type)&&h>1&&(0,_.jsxs)(V.gI,{children:[(0,_.jsx)(k.Z,{flex:"1",children:(0,_.jsx)(Y.uy,{size:Q.l2,warning:!0})}),(0,_.jsx)(k.Z,{flex:"6",children:(0,_.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,_.jsxs)(V.gI,{children:[(0,_.jsx)(C.ZP,{default:!0,children:"Name"}),(0,_.jsx)(K.Z,{alignRight:!0,fullWidth:!0,noBackground:!0,noBorder:!0,onChange:function(e){return j((function(n){return te(te({},n),{},{name:e.target.value})}))},paddingVertical:w.iI,placeholder:"Block name...",ref:m,value:(null===x||void 0===x?void 0:x.name)||""})]}),(0,_.jsxs)(V.gI,{children:[(0,_.jsx)(C.ZP,{default:!0,children:"Type"}),(0,_.jsx)(O.Z,{mr:w.cd,py:1,children:(0,_.jsxs)(Z.ZP,{alignItems:"center",children:[(0,_.jsx)(C.ZP,{muted:!0,children:ae}),(0,_.jsx)(O.Z,{mr:1}),(0,_.jsx)(Y.QM,{muted:!0})]})})]}),!E&&(S||se||(null===x||void 0===x?void 0:x.language))&&(0,_.jsxs)(V.gI,{paddingVerticalAddition:3,children:[(0,_.jsx)(C.ZP,{default:!0,children:"Language"}),(0,_.jsxs)(Z.ZP,{alignItems:"center",children:[[b.t6.PYTHON,b.t6.SQL,b.t6.R,b.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!(S&&!u&&!l||t||D&&b.t6.R!==n&&D&&b.t6.SQL!==n)||S&&b.t6.YAML===n||e.push((0,_.jsx)(O.Z,{ml:1,children:(0,_.jsx)(A.ZP,{borderColor:t?null:"transparent",compact:!0,default:!S&&!t&&!D,disabled:!S&&!t&&!D,noBackground:!0,notClickable:(!S||u||!D)&&t,onClick:se&&!D?null:function(){return j((function(e){return te(te({},e),{},{language:n})}))},selected:t,children:b.LE[n]})},n)),e}),[]),!S&&!D&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(O.Z,{mr:1}),(0,_.jsx)(Y.QM,{muted:!0})]}),(0,_.jsx)(O.Z,{mr:S||D?1:2})]})]}),(S||(null===se||void 0===se?void 0:se.color)||(null===x||void 0===x?void 0:x.color))&&(0,_.jsxs)(V.gI,{children:[(0,_.jsx)(C.ZP,{default:!0,children:"Color"}),S&&(0,_.jsxs)(G.Z,{alignRight:!0,disabled:l,noBackground:!0,noBorder:!0,onChange:function(e){return j((function(n){return te(te({},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,_.jsx)("option",{value:""}),Object.values(b.Lq).map((function(e){return(0,_.jsx)("option",{value:e,children:(0,J.kC)(e)},e)}))]}),!S&&(0,_.jsx)(O.Z,{mr:w.cd,py:1,children:(0,_.jsxs)(Z.ZP,{alignItems:"center",children:[(0,_.jsx)(C.ZP,{muted:!0,children:(0,J.kC)((null===se||void 0===se?void 0:se.color)||(null===x||void 0===x?void 0:x.color)||"")}),(0,_.jsx)(O.Z,{mr:1}),(0,_.jsx)(Y.QM,{muted:!0})]})})]}),T&&(null===x||void 0===x?void 0:x.content)&&(0,_.jsx)(V.gI,{display:"block",children:(0,_.jsx)(O.Z,{pr:w.cd,py:1,children:(0,_.jsx)(R.W,{backend:B.PD,children:(0,_.jsx)(L.Z,{block:te(te({},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 te(te({},n),{},{content:e})}))},selected:!0,textareaFocused:!0},M)})})}),(0,_.jsx)(V.$b,{children:(0,_.jsxs)(Z.ZP,{fullWidth:!0,children:[(0,_.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,_.jsx)(O.Z,{ml:1,children:(0,_.jsx)(A.ZP,{onClick:c,tabIndex:0,children:"Cancel"})})]})})]})},oe=t(54750),re=t(4804),le=t(75810),ue=t(85854),ce=t(99236),se=t(29480),ae=t(37443),de=t(53405);function pe(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?pe(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):pe(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ve=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,g=n||{},x=g.language,k=g.type,S=g.uuid,E=(c||{}).uuid,I=(0,f.useState)(!1),T=I[0],M=I[1],D=(0,f.useMemo)((function(){return b.t6.YAML===x&&i?(0,re.Qc)(i):{}}),[i,x]);(0,f.useEffect)((function(){D&&!t&&a((0,re.Pz)(null===D||void 0===D?void 0:D.config))}),[t,D]);var R=(0,f.useState)(!1),B=R[0],N=R[1],L=(0,v.Db)(z.ZP.integration_sources.useCreate(),{onSuccess:function(e){return(0,$.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})}})}}),U=(0,r.Z)(L,2),F=U[0],H=U[1].isLoading,G=(0,f.useCallback)((function(){return s().then((function(){return F({integration_source:{action_type:"test_connection",block_uuid:S,pipeline_uuid:E}})}))}),[S,F,E,s]),W=(0,f.useMemo)((function(){if(b.t6.YAML===x)return(0,_.jsx)(se.$W,{children:(0,_.jsx)(le.Z,{autoHeight:!0,language:x,onChange:function(e){a(e);try{var n=(0,re.Qc)(e),t=(0,re.Pz)(fe(fe({},D),{},{config:n}));u(k,S,t),p(t),M(!1)}catch(i){M(!0)}},tabSize:2,value:t||void 0,width:"100%"})});b.t6.PYTHON}),[t,i,D,x,k,S,d,p]),K=(0,f.useMemo)((function(){return(0,de.Wi)(o,l)}),[o,l]);return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(O.Z,{p:w.cd,children:(0,_.jsxs)(Z.ZP,{alignItems:"center",children:[(0,_.jsx)(A.ZP,{beforeIcon:(0,_.jsx)(Y.Ae,{success:!0}),loading:H,onClick:function(){N(!1),G()},secondary:!0,compact:!0,children:"Test connection"}),B&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(O.Z,{mr:w.cd}),(0,_.jsxs)(Z.ZP,{alignItems:"center",children:[(0,_.jsx)(j.Z,{size:1*w.iI,success:!0}),(0,_.jsx)(O.Z,{mr:1}),(0,_.jsx)(C.ZP,{success:!0,children:"Connection successful"})]})]})]})}),(0,_.jsx)(y.Z,{light:!0}),(0,_.jsxs)(O.Z,{p:w.cd,children:[(0,_.jsx)(C.ZP,{bold:!0,default:!0,large:!0,children:"Inputs from upstream blocks"}),0===(null===K||void 0===K?void 0:K.length)&&(0,_.jsx)(O.Z,{mt:1,children:(0,_.jsxs)(C.ZP,{muted:!0,children:["No inputs are selected. Toggle the upstream blocks in the ",(0,_.jsx)(P.Z,{bold:!0,onClick:function(){return h(ae.tw.UPSTREAM_BLOCK_SETTINGS)},preventDefault:!0,children:"Upstream block settings"})," to enable its output data as an input."]})})]}),(null===K||void 0===K?void 0:K.length)>=1&&(0,_.jsx)(ce.Z,{inputsBlocks:K}),T&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(y.Z,{light:!0}),(0,_.jsxs)(O.Z,{p:w.cd,children:[(0,_.jsx)(O.Z,{mb:1,children:(0,_.jsx)(ue.Z,{danger:!0,level:5,children:"ERROR"})}),(0,_.jsxs)(C.ZP,{muted:!0,children:["The credentials configuration is formatted incorrectly for the language ",b.LE[x],". The formatting must be fixed before the credentials configuration can be saved."]})]})]}),W]})},he=t(56747),me=t(96348),ge=t(26304),be=t(93859),xe=t(66909),je=t(42122);var ye=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)),g=m[0],b=m[1];(0,f.useEffect)((function(){var e,n;null!==c&&void 0!==c&&null!==(e=c.current)&&void 0!==e&&e.getBoundingClientRect().height&&b(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,de.Qu)(u),streamID:(0,de.M$)(u)}}),[u]),k=y.parentStreamID,Z=y.streamID,S=(0,f.useMemo)((function(){return(0,je.Qr)((0,de.WE)(u||{})||{},{idIsInObject:!0})}),[u]),E=z.ZP.outputs.pipelines.detail(!a&&x,!a&&j,{parent_stream:k,sample_count:h,stream:Z},{revalidateOnFocus:!1}).data,I=(0,v.Db)(z.ZP.outputs.useCreate(),{onSuccess:function(e){return(0,$.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,R=(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]),B=(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=(B||{}).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}),[B,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,_.jsx)(be.Z,{columnHeaderHeight:xe.Eh,columns:o,height:t-g,noBorderBottom:!0,noBorderLeft:!0,noBorderRight:!0,rows:r})}),[N,t,g]);return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(O.Z,{p:w.cd,ref:c,children:S?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(C.ZP,{default:!0,children:"Please select at least 1 column in the stream in order to fetch sample data."}),(0,_.jsx)(O.Z,{mt:1,children:(0,_.jsx)(P.Z,{bold:!0,onClick:function(){return o(ae.tw.SETTINGS)},preventDefault:!0,children:"Go to Schema properties to select a column"})})]}):(0,_.jsx)(A.ZP,{compact:!0,loading:D,onClick:function(){return R()},primary:!0,children:N?"Refresh sample data":"Fetch sample data"})}),L]})},ke=t(31882),Ze=t(75499),Pe=t(69650),Oe=t(12468),Ce=t(61599),we=t(14466),Se=t(44897),_e=t(42631),Ee=p.default.div.withConfig({displayName:"indexstyle__SectionStyle",componentId:"sc-wjbb3f-0"})(["border-radius:","px;"," ",""],_e.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 ")})),Ie=t(86735);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 Me(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 Ae=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,g=h.bookmark_properties,x=h.bookmark_property_operators,j=h.destination_table,y=h.disable_column_type_check,P=h.key_properties,S=h.partition_keys,E=h.replication_method,I=h.run_in_parallel,T=h.unique_conflict_method,M=h.unique_constraints,D=(0,de.M$)(c),R=(0,de.WD)(c),B=(0,de.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),U=(0,f.useCallback)((function(e){return s(e,(function(e){return null===i||void 0===i?void 0:i(e)}))}),[i,s]),F=(0,f.useCallback)((function(e,n){U([Me(Me({},c),{},(0,l.Z)({},e,n))])}),[c,U]),H=(0,f.useMemo)((function(){var e,n=[],t={},i=[],l=(0,de.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,_.jsx)(Ze.Z,{columnFlex:[1,1],rows:[[(0,_.jsx)(C.ZP,{children:"Number of columns selected"},"columns"),(0,_.jsxs)(C.ZP,{monospace:!0,rightAligned:!0,children:[null===i||void 0===i?void 0:i.length," ",(0,_.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,Ie.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,_.jsxs)(C.ZP,{children:[(0,J.vg)(t)," columns"]},"columns-".concat(t)),(0,_.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",g,"bookmark_properties"],["Unique constraints",M,"unique_constraints"],["Key properties",P,"key_properties"],["Partition keys",S,"partition_keys"]].map((function(e){var n,t=(0,r.Z)(e,3),i=t[0],o=t[1],l=t[2];return[(0,_.jsx)(C.ZP,{children:i},i),(0,_.jsxs)(Z.ZP,{alignItems:"center",flexWrap:"wrap",justifyContent:"flex-end",children:[!(null!==o&&void 0!==o&&o.length)&&(0,_.jsx)(C.ZP,{muted:!0,monospace:!0,children:"-"}),null===(n=(0,Ie.YC)(o||[],(function(e){return e})))||void 0===n?void 0:n.map((function(e){return(0,_.jsx)("div",{style:{marginLeft:w.iI/2},children:(0,_.jsx)(ke.Z,{label:e,onClick:function(){return F(l,(0,Ie.Od)(o,(function(n){return n===e})))},xsmall:!0})},"".concat(i,"-value-").concat(e))}))]},"".concat(i,"-value"))]}))))})}),[g,P,S,c,M,F]),W=(0,f.useMemo)((function(){return R in p?null===p||void 0===p?void 0:p[R]:j}),[j,p,R]);return(0,_.jsxs)(O.Z,{p:w.cd,children:[(0,_.jsx)(O.Z,{mb:w.cd,children:(0,_.jsxs)(Ee,{children:[(0,_.jsx)(C.ZP,{default:!0,uppercase:!0,children:"Output"}),(0,_.jsx)(O.Z,{mt:w.cd,children:(0,_.jsxs)(Z.ZP,{alignItems:"center",children:[(0,_.jsxs)(Z.ZP,{alignItems:"center",children:[(0,_.jsx)(C.ZP,{large:!0,children:"Destination table"}),(0,_.jsx)(O.Z,{mr:1}),(0,_.jsx)(Oe.Z,{label:(0,_.jsxs)(C.ZP,{children:["By default, this stream will be saved to your destination under the table named ",(0,_.jsx)(C.ZP,{bold:!0,inline:!0,monospace:!0,children:D}),". To change the table name, enter in a different value."]}),lightBackground:!0}),(0,_.jsx)(O.Z,{mr:w.cd})]}),(0,_.jsx)(k.Z,{flex:1,children:(0,_.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 Me(Me({},e),{},(0,l.Z)({},R,t))})),clearTimeout(a.current),a.current=setTimeout((function(){return F("destination_table",t)}),300)},value:W||""})})]})})]})}),(0,_.jsx)(O.Z,{mb:w.cd,children:(0,_.jsxs)(Ee,{children:[(0,_.jsx)(C.ZP,{default:!0,uppercase:!0,children:"Settings"}),(0,_.jsx)(O.Z,{mt:w.cd,children:(0,_.jsxs)(Z.ZP,{alignItems:"center",children:[(0,_.jsx)(C.ZP,{large:!0,children:"Replication method"}),(0,_.jsx)(O.Z,{mr:1}),(0,_.jsx)(Oe.Z,{label:(0,_.jsxs)(C.ZP,{children:["Do you want to synchronize the entire stream (",(0,_.jsx)(C.ZP,{bold:!0,inline:!0,monospace:!0,children:Ce._B.FULL_TABLE}),") on each pipeline run or only new records (",(0,_.jsx)(C.ZP,{bold:!0,inline:!0,monospace:!0,children:Ce._B.INCREMENTAL}),")?",Ce.th.POSTGRESQL===L&&(0,_.jsxs)(C.ZP,{children:["Log-based incremental replication (",(0,_.jsx)(C.ZP,{bold:!0,inline:!0,monospace:!0,children:Ce._B.LOG_BASED}),") is also available for PostgreSQL sources."]})]}),lightBackground:!0}),(0,_.jsx)(O.Z,{mr:w.cd}),(0,_.jsx)(G.Z,{defaultColor:!0,onChange:function(e){return F("replication_method",e.target.value)},placeholder:"Select an option",value:E,children:Ce.jL.map((function(e){return(0,_.jsx)("option",{value:e,children:(0,J.vg)(e)},e)}))})]})}),(0,_.jsx)(O.Z,{mt:w.cd,children:(0,_.jsxs)(Z.ZP,{alignItems:"center",children:[(0,_.jsx)(C.ZP,{large:!0,children:"Unique conflict method"}),(0,_.jsx)(O.Z,{mr:1}),(0,_.jsx)(Oe.Z,{label:(0,_.jsxs)(C.ZP,{children:["If a new record has the same value as an existing record in the ",(0,J._6)("unique column",null===M||void 0===M?void 0:M.length),(null===M||void 0===M?void 0:M.length)>0&&(0,_.jsx)(_.Fragment,{children:"\xa0"}),null===M||void 0===M?void 0:M.sort().map((function(e,n){return(0,_.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,_.jsx)(C.ZP,{inline:!0,children:" and "},e):n>=1&&(0,_.jsx)(_.Fragment,{children:",\xa0"}),e]},e)})),", how do you want to resolve the conflict? The conflict method ",(0,_.jsx)(C.ZP,{bold:!0,inline:!0,monospace:!0,children:Ce.MU.IGNORE})," will skip the new record if it\u2019s a duplicate of an existing record. The conflict method ",(0,_.jsx)(C.ZP,{bold:!0,inline:!0,monospace:!0,children:Ce.MU.UPDATE})," will not save the new record and instead update the existing record with the new record\u2019s properties."]}),lightBackground:!0}),(0,_.jsx)(O.Z,{mr:w.cd}),(0,_.jsx)(G.Z,{defaultColor:!0,onChange:function(e){return F("unique_conflict_method",e.target.value)},placeholder:"Select an option",value:T,children:Object.values(Ce.MU).map((function(e){return(0,_.jsx)("option",{value:e,children:(0,J.vg)(e)},e)}))})]})})]})}),(null===N||void 0===N?void 0:N.sql)&&Ce._B.INCREMENTAL===E&&(null===g||void 0===g?void 0:g.length)>=1&&(0,_.jsx)(O.Z,{mb:w.cd,children:(0,_.jsxs)(Ee,{children:[(0,_.jsx)(C.ZP,{default:!0,uppercase:!0,children:"Bookmark property operators"}),(0,_.jsx)(O.Z,{mt:1,children:(0,_.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,_.jsx)(C.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:">="}),").",(0,_.jsx)("br",{}),"If the bookmark property is also a unique constraint, then the default operator is greater than (",(0,_.jsx)(C.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:">"}),").",(0,_.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===g||void 0===g?void 0:g.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)?we.W6.GREATER_THAN:we.W6.GREATER_THAN_OR_EQUALS,(0,_.jsx)(O.Z,{mt:w.cd,children:(0,_.jsxs)(Z.ZP,{alignItems:"center",children:[(0,_.jsxs)(C.ZP,{default:!0,monospace:!0,children:[(0,_.jsxs)(C.ZP,{inline:!0,monospace:!0,muted:!0,children:["{new_record}","."]}),e]}),(0,_.jsx)(O.Z,{mr:w.cd}),(0,_.jsx)(G.Z,{compact:!0,defaultColor:!0,monospace:!0,onChange:function(n){return F("bookmark_property_operators",Me(Me({},x),{},(0,l.Z)({},e,n.target.value)))},value:n,children:[we.W6.EQUALS,we.W6.GREATER_THAN,we.W6.GREATER_THAN_OR_EQUALS,we.W6.LESS_THAN,we.W6.LESS_THAN_OR_EQUALS,we.W6.NOT_EQUALS].map((function(e){return(0,_.jsx)("option",{value:e,children:we.N_[e]},e)}))}),(0,_.jsx)(O.Z,{mr:w.cd}),(0,_.jsxs)(C.ZP,{default:!0,monospace:!0,children:[(0,_.jsxs)(C.ZP,{inline:!0,monospace:!0,muted:!0,children:["{bookmark}","."]}),e]})]})},e)}))]})}),(0,_.jsx)(O.Z,{mb:w.cd,children:(0,_.jsxs)(Ee,{children:[(0,_.jsx)(C.ZP,{default:!0,uppercase:!0,children:"Options"}),(0,_.jsx)(O.Z,{mt:w.cd,children:(0,_.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,_.jsxs)(k.Z,{flexDirection:"column",children:[(0,_.jsx)(C.ZP,{bold:!0,large:!0,children:"Run streams in parallel"}),(0,_.jsx)(O.Z,{mt:1,children:(0,_.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,_.jsx)(O.Z,{mr:w.cd}),(0,_.jsx)(Pe.Z,{checked:!!I,onCheck:function(e){return F("run_in_parallel",e(I))}})]})}),b.tf.DATA_EXPORTER===(null===t||void 0===t?void 0:t.type)&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(O.Z,{mt:w.cd,children:(0,_.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,_.jsxs)(k.Z,{flexDirection:"column",children:[(0,_.jsx)(C.ZP,{bold:!0,large:!0,children:"Automatically add new fields"}),(0,_.jsx)(O.Z,{mt:1,children:(0,_.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,_.jsx)(O.Z,{mr:w.cd}),(0,_.jsx)(Pe.Z,{checked:!!m,onCheck:function(e){return F("auto_add_new_fields",e(m))}})]})}),(0,_.jsx)(O.Z,{mt:w.cd,children:(0,_.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,_.jsxs)(k.Z,{flexDirection:"column",children:[(0,_.jsx)(C.ZP,{bold:!0,large:!0,children:"Disable column type check"}),(0,_.jsx)(O.Z,{mt:1,children:(0,_.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,_.jsx)(O.Z,{mr:w.cd}),(0,_.jsx)(Pe.Z,{checked:!!y,onCheck:function(e){return F("disable_column_type_check",e(y))}})]})})]})]})}),(0,_.jsx)(O.Z,{mb:w.cd,children:(0,_.jsxs)(Ee,{noPadding:!0,children:[(0,_.jsx)(O.Z,{pt:w.cd,px:w.cd,children:(0,_.jsx)(C.ZP,{default:!0,uppercase:!0,children:"Summary"})}),(0,_.jsx)(O.Z,{mt:w.cd,pb:w.cd,children:H})]})}),(0,_.jsx)(O.Z,{mb:w.cd,children:(0,_.jsxs)(Ee,{children:[(0,_.jsx)(C.ZP,{default:!0,uppercase:!0,children:"Other"}),(0,_.jsx)(O.Z,{mt:w.cd,children:(0,_.jsxs)(Z.ZP,{alignItems:"center",children:[(0,_.jsx)(C.ZP,{large:!0,children:"Select stream"}),(0,_.jsx)(O.Z,{mr:1}),(0,_.jsx)(Pe.Z,{checked:!!B,onCheck:function(e){return U([(0,de.XE)(c,{selected:e(B)})])}})]})}),(0,_.jsx)(O.Z,{mt:w.HN,children:(0,_.jsx)(Z.ZP,{alignItems:"center",children:(0,_.jsx)(A.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=Me(Me({},e),{},{catalog:Me(Me({},null===e||void 0===e?void 0:e.catalog),{},{streams:(0,Ie.Od)(null===e||void 0===e||null===(n=e.catalog)||void 0===n?void 0:n.streams,(function(e){return(0,de.WD)(e)===R}))})});return null===i||void 0===i||i(t),t}))},children:"Delete stream from block"})})})]})})]})},De=t(11074),Re=t(69632),Be=t(95924);function Ne(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 Le(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ne(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ne(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,g=(0,f.useCallback)((function(e){c((function(n){var t=e(n);return null===u||void 0===u||u(t),t}))}),[u,c]),b=(0,f.useMemo)((function(){return(0,de.RP)(v)||{}}),[v]),P=(0,f.useState)(null),S=P[0],E=P[1],I=(0,f.useState)(null),T=I[0],M=I[1],D=(0,f.useRef)(null),R=(0,f.useState)(null),B=R[0],N=R[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 U=(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,Ie.HK)(e||[],(function(e){return e})),keyPropertiesMapping:(0,Ie.HK)(n||[],(function(e){return e})),partitionKeysMapping:(0,Ie.HK)(t||[],(function(e){return e})),uniqueConstraintsMapping:(0,Ie.HK)(i||[],(function(e){return e}))}}),[v]),F=U.bookmarkPropertiesMapping,H=U.keyPropertiesMapping,G=U.partitionKeysMapping,W=U.uniqueConstraintsMapping,K=(0,f.useMemo)((function(){var e,n;return null===(e=(0,Ie.YC)(Object.entries(b||{}),(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]}}))}),[b]),z=((0,f.useMemo)((function(){return(0,de.MB)(v)}),[v]),(0,f.useMemo)((function(){return(0,de.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,q=(0,f.useMemo)((function(){return!Ce.kB.includes(V)}),[V]),Q=(0,f.useMemo)((function(){var e=[null,1,1],n=null===K||void 0===K?void 0:K.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,_.jsx)(Pe.Z,{checked:n,compact:!0,onCheck:function(e){return function(e){var n=null===K||void 0===K?void 0:K.reduce((function(n,t){var i=t.column,o=(null===z||void 0===z?void 0:z[i])||(0,de.jC)(i);return n[i]=Le(Le({},o),{},{metadata:Le(Le({},null===o||void 0===o?void 0:o.metadata),e)}),n}),{});g((function(e){return(0,de.$C)((0,de.AP)(v,n),e)}))}({selected:e(n)})}})},uuid:"action"},{uuid:"Property"},{uuid:"Types"}];q&&(e.push.apply(e,[null,null]),t.push.apply(t,[{center:!0,uuid:"Unique"},{center:!0,uuid:"Key"}]));var i=v.replication_method;return Ce._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}}),[K,g,v,z,q]),X=Q.columnFlex,J=Q.columns,$=(0,f.useCallback)((function(e,n,t){var i,o=t||{},r=o.disableEdit,u=o.key,c=(0,de.wx)(e,n),s=(null===c||void 0===c?void 0:c.typesDerived)||[];return(0,_.jsxs)(Z.ZP,{alignItems:"center",flexWrap:"wrap",children:[null===(i=s||[])||void 0===i?void 0:i.map((function(n){return(0,_.jsx)("div",{style:{paddingBottom:1,marginRight:2,paddingTop:1},children:(0,_.jsx)(ke.Z,{label:n,onClick:r?null:function(t){(0,Be.j)(t);var i=!(null===s||void 0===s||!s.includes(n))?(0,de.VZ)([n],c):(0,de.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};g((function(n){return(0,de.$C)((0,de.KN)(v,(0,l.Z)({},e,o)),n)}))},xsmall:!0})},"".concat(e,"-").concat(u||"types","-").concat(n))})),!r&&(0,_.jsx)(A.ZP,{iconOnly:!0,noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(e){(0,Be.j)(e),N({x:e.pageX,y:e.pageY}),E(c)},children:(0,_.jsx)(Y.I8,{default:!0})})]},"".concat(e,"-").concat(u||"types"))}),[g,N,E,v]),ee=(0,f.useMemo)((function(){return null===K||void 0===K?void 0:K.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,de.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===W||void 0===W?void 0:W[t],m=null===F||void 0===F?void 0:F[t],b=null===H||void 0===H?void 0:H[t],j=null===G||void 0===G?void 0:G[t],y=[(0,_.jsx)("div",{style:{minHeight:22},children:(0,_.jsx)(Pe.Z,{checked:f,compact:!0,onCheck:function(e){g((function(n){return(0,de.$C)((0,de.AP)(v,(0,l.Z)({},t,Le(Le({},d),{},{metadata:Le(Le({},null===d||void 0===d?void 0:d.metadata),{},{selected:e(f)})}))),n)}))}})},"".concat(t,"-selected")),(0,_.jsx)(C.ZP,{monospace:!0,children:t},"".concat(t,"-column")),$(t,p)];q&&y.push((0,_.jsx)(Z.ZP,{alignItems:"center",justifyContent:"center",children:(0,_.jsx)(x.Z,{checked:h,onClick:function(e){(0,Be.j)(e),g((function(e){return(0,de.$C)(Le(Le({},v),{},{unique_constraints:h?(0,Ie.Od)(a||[],(function(e){return e===t})):(0,Ie.Hl)(t,a||[])}),e)}))}})},"".concat(t,"-unique")));var k=[];return q&&k.push([b,"key_properties",u]),Ce._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,_.jsx)(Z.ZP,{alignItems:"center",justifyContent:"center",children:(0,_.jsx)(x.Z,{checked:i,onClick:function(e){(0,Be.j)(e),g((function(e){return(0,de.$C)(Le(Le({},v),{},(0,l.Z)({},o,i?(0,Ie.Od)(u||[],(function(e){return e===t})):(0,Ie.Hl)(t,u||[]))),e)}))}})},"".concat(t,"-").concat(o)))})),y}))}),[F,H,G,$,K,g,v,q,W]),ne=(0,f.useCallback)((function(e){var n=null===K||void 0===K?void 0:K[e];return Le(Le({},n),{},{highlighted:!(null===o||void 0===o||!o[null===n||void 0===n?void 0:n.column])})}),[o,K]),te=(0,f.useMemo)((function(){var e;if(B&&S){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=B||{},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===b||void 0===b?void 0:b[null===S||void 0===S?void 0:S.uuid])||{},f=(0,de.wx)(null===S||void 0===S?void 0:S.uuid,p||{}),h=f||{},m=h.typesDerived,y=void 0===m?[]:m,k=h.uuid;return(0,_.jsx)("div",{onClick:Be.j,style:{left:d,position:"fixed",top:a+w.iI/2,width:n,zIndex:100},children:(0,_.jsxs)(De.Z,{children:[(0,_.jsx)("div",{style:{position:"relative"},children:(0,_.jsx)(A.ZP,{iconOnly:!0,noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(e){(0,Be.j)(e),N(null),E(null)},style:{position:"absolute",right:-.5*w.iI,top:-.5*w.iI,zIndex:1},children:(0,_.jsx)(j.Z,{default:!0,size:2.5*w.iI,children:(0,_.jsx)(Y.x8,{size:1.5*w.iI})})})}),(0,_.jsx)(O.Z,{p:w.cd,children:Ce.D5.map((function(e,n){var t=!(null===y||void 0===y||!y.includes(e));return(0,_.jsx)("div",{style:{marginTop:0===n?0:4},children:(0,_.jsx)(Z.ZP,{alignItems:"center",children:(0,_.jsx)(x.Z,{checked:t,label:e,onClick:function(n){(0,Be.j)(n);var i=t?(0,de.VZ)([e],f):(0,de.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};g((function(e){return(0,de.$C)((0,de.KN)(v,(0,l.Z)({},k,o)),e)}))}})})},e)}))})]})})}}),[B,S,D,b,g,N,E,v]),ie=(0,f.useMemo)((function(){return(0,de.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=Le({},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,_.jsx)(x.Z,{checked:r,onClick:function(e){(0,Be.j)(e),oe([t],!r)}},"".concat(t,"-accept")),(0,_.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,_.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,_.jsx)(Ze.Z,{columnFlex:[null,1].concat(i||[]),columns:[{label:function(){return(0,_.jsx)(x.Z,{checked:l,onClick:function(e){(0,Be.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]),ce=(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,Ie.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,Ie.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===b||void 0===b?void 0:b[t]}}));return(0,_.jsxs)(_.Fragment,{children:[(null===u||void 0===u?void 0:u.length)>=1&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(O.Z,{p:w.cd,children:(0,_.jsx)(ue.Z,{level:5,warning:!0,children:"New properties"})}),(0,_.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,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(O.Z,{p:w.cd,children:(0,_.jsx)(ue.Z,{level:5,warning:!0,children:"Properties with new types"})}),(0,_.jsx)(y.Z,{light:!0}),le(c,{columnFlex:[1,1],columns:[{uuid:"Types (new)"},{uuid:"Types (current)"}]})]})]})}),[ie,le,b]),se=(0,f.useMemo)((function(){return(0,_.jsx)(Ze.Z,{columnFlex:X,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,je.gR)(e,[t]):Le(Le({},e),{},(0,l.Z)({},t,!0))}))},ref:D,rows:ee,stickyHeader:!0})}),[X,J,ne,D,te,ee,s]);return(0,_.jsxs)(_.Fragment,{children:[p&&ce&&(0,_.jsxs)(O.Z,{my:w.cd,children:[(0,_.jsx)(O.Z,{px:w.cd,children:(0,_.jsx)(Re.NJ,{children:(0,_.jsxs)(Z.ZP,{alignItems:"center",children:[(0,_.jsx)(k.Z,{children:(0,_.jsx)(Y.uy,{size:2*w.iI,warning:!0})}),(0,_.jsx)(O.Z,{mr:w.cd}),(0,_.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,_.jsx)("br",{}),"Click the checkbox to include the updated property when merging changes."]})]})})}),ce,(0,_.jsx)(O.Z,{p:w.cd,children:(0,_.jsxs)(Z.ZP,{children:[(0,_.jsx)(A.ZP,{beforeIcon:(0,_.jsx)(Y.Pt,{}),onClick:function(){g((function(e){var n;return(0,de.$C)(Le(Le({},v),{},{schema:Le(Le({},null===v||void 0===v?void 0:v.schema),{},{properties:Le(Le({},null===v||void 0===v||null===(n=v.schema)||void 0===n?void 0:n.properties),T)})}),e)})),d({noParents:{},parents:{}}),a(ae.tw.SETTINGS)},primary:!0,children:"Merge changes"}),(0,_.jsx)(O.Z,{mr:1}),(0,_.jsx)(A.ZP,{onClick:function(){d({noParents:{},parents:{}}),a(ae.tw.SETTINGS)},secondary:!0,children:"Discard changes"})]})})]}),!p&&se,(0,_.jsx)(O.Z,{pb:w.HN})]})},Fe=["block","height","pipeline","selectedSubTab","showError","stream"];function He(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?He(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):He(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var We=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,Fe);return ae.tw.OVERVIEW!==o&&o?ae.tw.SETTINGS===o||ae.tw.STREAM_CONFLICTS===o?(0,_.jsx)(Ue,Ge(Ge({},u),{},{block:n,showStreamConflicts:ae.tw.STREAM_CONFLICTS===o,stream:l})):ae.tw.SAMPLE_DATA===o?(0,_.jsx)(ye,{block:n,height:t,pipeline:i,showError:r,stream:l}):(0,_.jsx)(_.Fragment,{}):(0,_.jsx)(Ae,Ge(Ge({},u),{},{block:n,stream:l}))},Ke=t(47041),ze=t(91437),Ye=8*w.iI,Ve=p.default.div.withConfig({displayName:"indexstyle__AfterContentStyle",componentId:"sc-119v89s-0"})(["",""],(function(e){return"\n background-color: ".concat((e.theme.background||Se.Z.background).panel,";\n ")})),qe=p.default.div.withConfig({displayName:"indexstyle__AfterFooterStyle",componentId:"sc-119v89s-1"})(["",""],(function(e){return"\n background-color: ".concat((e.theme.background||Se.Z.background).panel,";\n ")})),Qe=p.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-119v89s-2"})(["border-radius:","px;position:relative;"," ",""],_e.n_,(function(e){return"\n border: 1px solid ".concat((e.theme.borders||Se.Z.borders).light,";\n background-color: ").concat((e.theme.background||Se.Z.background).panel,";\n ")}),(function(e){return e.maxWidth&&"\n width: ".concat(e.maxWidth,"px;\n ")})),Xe=p.default.div.withConfig({displayName:"indexstyle__HeaderStyle",componentId:"sc-119v89s-3"})(["padding:","px;",""],w.cd*w.iI,(function(e){return"\n border-bottom: 1px solid ".concat((e.theme.borders||Se.Z.borders).light,";\n ")})),Je=p.default.div.withConfig({displayName:"indexstyle__NavigationStyle",componentId:"sc-119v89s-4"})([""," "," ",""],(0,ze.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 ")})),$e=p.default.div.withConfig({displayName:"indexstyle__StreamGridGroupStyle",componentId:"sc-119v89s-5"})(["position:absolute;"]),en=p.default.div.withConfig({displayName:"indexstyle__StreamGridGroupInnerStyle",componentId:"sc-119v89s-6"})([""," overflow:auto;position:fixed;",""],Ke.w5,(function(e){return e.borderRight&&"\n border-right: 1px solid ".concat((e.theme.borders||Se.Z.borders).light,";\n ")})),nn=p.default.div.withConfig({displayName:"indexstyle__StreamGridStyle",componentId:"sc-119v89s-7"})(["border-radius:","px;padding:","px;margin:","px;"," "," "," "," ",""],_e.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 ")})),tn=p.default.div.withConfig({displayName:"indexstyle__BackgroundStyle",componentId:"sc-119v89s-8"})(["",""],(function(e){return"\n background-color: ".concat((e.theme.background||Se.Z.background).panel,";\n ")})),on={label:function(e){return"".concat((0,J._6)("stream",e,!0)," fetched")},uuid:"Recently fetched"},rn={label:function(e){return"".concat((0,J._6)("stream",e,!0)," from settings")},uuid:"From stream settings"},ln=[on,rn];function un(e,n){return null===n||void 0===n?void 0:n.filter((function(n){var t=new RegExp(e||"","i"),i=(0,de.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 cn=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,de.Uc)(n,{getAll:!0})}),[n]),h=(0,f.useMemo)((function(){return(0,de.UA)(v)}),[v]),m=(0,f.useMemo)((function(){return(0,de.UA)(a||[])}),[a]),g=(0,f.useCallback)((function(e){return(0,de.ig)(e,m,h)}),[m,h]),b=(0,f.useCallback)((function(e){return(0,de.p$)(e,m,h)}),[m,h]),x=(0,f.useCallback)((function(e){var n;return(n={},(0,l.Z)(n,on.uuid,m),(0,l.Z)(n,rn.uuid,h),n)[e]}),[h,m]),j=(0,f.useMemo)((function(){var e=[];return ln.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=un(u,d);(null===p||void 0===p?void 0:p.length)>=1&&a.push({streams:(0,Ie.YC)(p||[],de.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=un(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,Ie.YC)(l||[],de.M$)})})),(null===a||void 0===a?void 0:a.length)>=1&&e.push({count:(0,Ie.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,_.jsx)(_.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=on.uuid===u;return(0,_.jsx)($e,{style:{height:i,right:rn.uuid===u?null:0,width:p/P},children:(0,_.jsx)(en,{borderRight:P>=2&&!a,style:{height:i,width:p/P},children:(0,_.jsxs)(O.Z,{pt:w.cd,children:[(0,_.jsx)(O.Z,{px:w.Mq,children:(0,_.jsx)(ue.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,_.jsxs)(O.Z,{mt:i&&0===n?w.cd:1,children:[(0,_.jsx)(O.Z,{mb:i?w.cd:0,mt:i?0:w.cd,children:(0,_.jsx)(y.Z,{light:!0})}),i&&(0,_.jsx)(O.Z,{px:w.cd,children:(0,_.jsx)(C.ZP,{bold:!0,color:null===(t=(0,S.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,_.jsx)(O.Z,{p:1,children:(0,_.jsx)(Z.ZP,{alignItems:"center",flexWrap:"wrap",children:null===r||void 0===r?void 0:r.map((function(e){var n=g(e),t=!!b(e),i=(0,de.M$)(e),r=(0,de.Qu)(e),l=!1;if(a){var u=(0,de.zB)(e,x(rn.uuid));u&&(l=(0,de.Z5)(u))}else l=(0,de.Z5)(e);var p=n&&t;return(0,_.jsx)(nn,{onClick:a&&p?function(){return!1}:function(n){n.preventDefault(),d([(0,de.XE)(e,{selected:!l})],(function(e){return null===o||void 0===o?void 0:o(e)}))},selected:l,warning:p&&a,children:(0,_.jsxs)(Z.ZP,{alignItems:"center",fullHeight:!0,justifyContent:"space-between",children:[(0,_.jsx)(k.Z,{flex:1,children:(0,_.jsx)(C.ZP,{monospace:!0,muted:!l,children:i})}),p&&a&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(O.Z,{mr:1}),(0,_.jsx)(C.ZP,{monospace:!0,warning:!0,children:"exists"})]}),p&&a&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(O.Z,{mr:1}),(0,_.jsx)(k.Z,{alignItems:"center",style:{minHeight:3*w.iI},children:(0,_.jsx)(A.ZP,{compact:!0,onClick:function(){s((function(n){return(0,de.UA)([e],n)})),c((function(e){return{selectedMainNavigationTab:i,selectedMainNavigationTabSub:r,selectedSubTab:ae.tw.STREAM_CONFLICTS}}))},small:!0,warning:!0,children:"View differences"})})]}),(!p||!a)&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(O.Z,{mr:w.HN}),l&&(0,_.jsx)(Y.Zr,{size:2*w.iI}),(0,_.jsx)(O.Z,{mr:l?1:3}),(0,_.jsx)(k.Z,{alignItems:"center",style:{height:3*w.iI},children:(0,_.jsx)(Pe.Z,{checked:l,compact:!0,onCheck:function(n){return d([(0,de.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 sn(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 an(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?sn(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):sn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var dn=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 ae.oI.CHECKBOX===r?i=(0,_.jsx)(x.Z,{checked:!!f,onClick:function(e){p&&(0,Be.j)(e),c((function(e){return an(an({},e),{},(0,l.Z)({},a,an(an({},null===e||void 0===e?void 0:e[a]),{},{value:!f})))}))}}):ae.oI.SELECT===r?i=(0,_.jsxs)(G.Z,{compact:!0,fullWidth:!0,onChange:function(e){(0,Be.j)(e),c((function(n){var t;return an(an({},n),{},(0,l.Z)({},a,an(an({},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,Be.j)(e)},value:f,children:[(0,_.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,_.jsx)("option",{disabled:n,value:i,children:t?t():i},i)}))]}):ae.oI.TOGGLE===r&&(i=(0,_.jsx)(Pe.Z,{checked:f,compact:!0,onCheck:function(e){c((function(n){return an(an({},n),{},(0,l.Z)({},a,an(an({},null===n||void 0===n?void 0:n[a]),{},{value:e(f)})))}))},pauseEvent:p})),[(0,_.jsx)(x.Z,{checked:p,onClick:function(e){(0,Be.j)(e),c((function(e){return an(an({},e),{},(0,l.Z)({},a,an(an({},null===e||void 0===e?void 0:e[a]),{},{selected:!p})))}))}},"".concat(a,"-checkbox")),(0,_.jsx)(C.ZP,{muted:!p,children:u()},"".concat(a,"-name")),(0,_.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,_.jsx)(Ze.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 an(an({},e),{},(0,l.Z)({},o,an(an({},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 pn=function(e){var n=e.selectedStreamMapping,t=e.setSelectedStreamMapping,i=e.streamMapping,o=(0,f.useMemo)((function(){return(0,de.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,de.WD)(e),o=(0,de.M$)(e),u=!!(0,de.zB)(e,n),c=[(0,_.jsx)(x.Z,{checked:u},"".concat(i,"-").concat(o,"-use")),(0,_.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,Ie.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,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(O.Z,{p:w.cd,children:(0,_.jsxs)("div",{children:[(0,_.jsxs)(ue.Z,{children:[(0,J._6)("stream",a||0)," chosen"]}),(0,_.jsx)(O.Z,{mt:1,children:(0,_.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,_.jsx)(Ze.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,de.zB)(i,n);t((function(e){return(0,de.iN)(i,e,{remove:o})}))},rowGroupHeaders:l,rows:u,rowsGroupedByIndex:c,stickyHeader:!0})]})};var fn=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,_.jsx)(dn,{attributes:[{label:function(){return"Replication method"},inputType:ae.oI.SELECT,options:Ce.jL.map((function(e){return{label:function(){return(0,J.vg)(e)},value:e}})),uuid:de.I1.REPLICATION_METHOD},{label:function(){return"Unique conflict method"},inputType:ae.oI.SELECT,options:Object.values(Ce.MU).map((function(e){return{label:function(){return(0,J.vg)(e)},value:e}})),uuid:de.I1.UNIQUE_CONFLICT_METHOD},{label:function(){return"Run stream in parallel"},inputType:ae.oI.TOGGLE,uuid:de.I1.RUN_IN_PARALLEL},{label:function(){return"Automatically add new columns"},inputType:ae.oI.TOGGLE,uuid:de.I1.AUTO_ADD_NEW_FIELDS},{label:function(){return"Disable strict column type checks"},inputType:ae.oI.TOGGLE,uuid:de.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,_.jsx)(pn,{selectedStreamMapping:t,setSelectedStreamMapping:o,streamMapping:r})}),[t,o,r]);return(0,_.jsxs)(tn,{children:[(0,_.jsx)(O.Z,{p:w.cd,children:(0,_.jsxs)("div",{children:[(0,_.jsx)(ue.Z,{children:"Make changes to multiple streams"}),(0,_.jsx)(O.Z,{mt:1,children:(0,_.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 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=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),g=(0,f.useMemo)((function(){return!Ce.kB.includes(m)}),[m]);(0,f.useEffect)((function(){if(v&&!s){var e=(0,de.M$)(v||{}),n=(0,de.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 b=(0,f.useMemo)((function(){return(null===v||void 0===v?void 0:v.replication_method)===Ce._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:ae.oI.CHECKBOX,uuid:de.I1.PROPERTY_SELECTED},{label:function(){return"Partition key"},inputType:ae.oI.CHECKBOX,uuid:de.I1.PARTITION_KEYS}].concat((0,o.Z)(Ce.D5.map((function(e){return{label:function(){return(0,J.vg)(e)},inputType:ae.oI.CHECKBOX,uuid:e}}))));b&&e.splice(1,0,{label:function(){return"Bookmark property"},inputType:ae.oI.CHECKBOX,uuid:de.I1.BOOKMARK_PROPERTIES}),g&&e.splice(1,0,{label:function(){return"Unique constraint"},inputType:ae.oI.CHECKBOX,uuid:de.I1.UNIQUE_CONSTRAINTS},{label:function(){return"Key property"},inputType:ae.oI.CHECKBOX,uuid:de.I1.KEY_PROPERTIES});var n=2;b&&(n+=1),g&&(n+=2);var t=(0,Ie.m5)(n);return(0,_.jsx)(dn,{attributes:e,attributesMapping:i,rowGroupHeaders:["Options","Column types"],rowsGroupedByIndex:[t,null===Ce.D5||void 0===Ce.D5?void 0:Ce.D5.map((function(e,t){return t+n}))],setAttributesMapping:a})}),[i,a,g,b]),j=(0,f.useMemo)((function(){return(0,_.jsx)(pn,{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,Ie.YC)(n,(function(e){return e}))}),[c]);return(0,_.jsxs)(tn,{children:[(0,_.jsxs)(O.Z,{p:w.cd,children:[(0,_.jsxs)("div",{children:[(0,_.jsxs)(ue.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,J._6)("property",(null===y||void 0===y?void 0:y.length)||0)," chosen")]}),(0,_.jsx)(O.Z,{mt:1,children:(0,_.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,_.jsx)(_.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,_.jsx)(O.Z,{mt:w.cd,children:(0,_.jsx)(Z.ZP,{alignItems:"center",flexWrap:"wrap",children:null===y||void 0===y?void 0:y.map((function(e){return(0,_.jsx)("div",{style:{marginBottom:w.iI/2,marginRight:w.iI/2},children:(0,_.jsx)(ke.Z,{label:e,onClick:function(){d((function(n){return!(null===n||void 0===n||!n[e])?(0,je.gR)(n,[e]):hn(hn({},n),{},(0,l.Z)({},e,!0))}))}})},"".concat(e,"-chip"))}))})})]}),x,j]})};function gn(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 bn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?gn(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):gn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var xn={compact:!0,small:!0};var jn=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,g=c||{},x=g.noParents,j=g.parents,y=(0,f.useMemo)((function(){return(0,je.Qr)(x||{})&&(0,je.Qr)(j||{})}),[x,j]),E=(0,f.useMemo)((function(){return(0,de.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,de.Z5)(e)})));return(0,_.jsx)(Pe.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,de.XE)(n,{selected:e(i)})})))}})},uuid:"action"},{uuid:"Stream"},{uuid:"Table"},{uuid:"Sync"},{uuid:"Unique conflict"},{center:b.tf.DATA_EXPORTER===m,rightAligned:b.tf.DATA_EXPORTER!==m,uuid:"Parallel"}];return b.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,A=(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,g=s?null===t||void 0===t?void 0:t[s]:null;g?n.push((0,_.jsx)(O.Z,{p:w.cd,children:(0,_.jsx)(C.ZP,{bold:!0,color:(0,S.qn)(null===g||void 0===g?void 0:g.type,{blockColor:null===g||void 0===g?void 0:g.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,de.WD)(n),o=(0,de.Qu)(n),c=(0,de.M$)(n),s=n.auto_add_new_fields,d=n.bookmark_properties,g=n.destination_table,j=n.disable_column_type_check,y=n.replication_method,w=n.run_in_parallel,S=n.unique_conflict_method,E=(0,de.Z5)(n),I=t in p?null===p||void 0===p?void 0:p[t]:g,T=[(0,_.jsx)(Pe.Z,{checked:E,compact:!0,onCheck:function(e){h([(0,de.XE)(n,{selected:e(E)})])}},"".concat(t,"-action")),(0,_.jsx)(P.Z,{bold:!0,monospace:!0,onClick:function(){r(c,o)},preventDefault:!0,sameColorAsText:!0,children:c},"".concat(t,"-name")),(0,_.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 bn(bn({},e),{},(0,l.Z)({},t,o))})),clearTimeout(a.current),a.current=setTimeout((function(){return h([bn(bn({},n),{},{destination_table:o})])}),300)},onClick:Be.j,placeholder:c,value:I||""},"".concat(t,"-destinationTable")),(0,_.jsxs)(Z.ZP,{alignItems:"center",children:[(0,_.jsx)(k.Z,{flex:1,children:(0,_.jsx)(G.Z,bn(bn({},xn),{},{fullWidth:!0,onChange:function(e){var t;return h([bn(bn({},n),{},{replication_method:null===e||void 0===e||null===(t=e.target)||void 0===t?void 0:t.value})])},onClick:Be.j,placeholder:"Replication method",value:y,children:Ce.jL.map((function(e){return(0,_.jsx)("option",{value:e,children:(0,J.vg)(e)},e)}))}))}),Ce._B.INCREMENTAL===y&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(O.Z,{mr:1}),!(null!==d&&void 0!==d&&d.length)&&(0,_.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,_.jsxs)(C.ZP,{inline:!0,monospace:!0,muted:!0,xsmall:!0,children:[n>=1&&", ",e]},e)})))]})]},"".concat(t,"-replicationMethod")),(0,f.createElement)(G.Z,bn(bn({},xn),{},{key:"".concat(t,"-uniqueConflictMethod"),onChange:function(e){var t;return h([bn(bn({},n),{},{unique_conflict_method:null===e||void 0===e||null===(t=e.target)||void 0===t?void 0:t.value})])},onClick:Be.j,placeholder:"Unique conflict method",value:S}),Object.values(Ce.MU).map((function(e){return(0,_.jsx)("option",{value:e,children:(0,J.vg)(e)},e)}))),(0,_.jsx)(Z.ZP,{alignItems:"center",justifyContent:b.tf.DATA_EXPORTER===m?"center":"flex-end",children:(0,_.jsx)(Pe.Z,{checked:!!w,compact:!0,onCheck:function(e){h([bn(bn({},n),{},{run_in_parallel:e(w)})])}})},"".concat(t,"-runInParallel"))];b.tf.DATA_EXPORTER===m&&T.push.apply(T,[(0,_.jsx)(Z.ZP,{alignItems:"center",justifyContent:"center",children:(0,_.jsx)(Pe.Z,{checked:!!s,compact:!0,onCheck:function(e){h([bn(bn({},n),{},{auto_add_new_fields:e(s)})])}})},"".concat(t,"-autoAddNewFields")),(0,_.jsx)(Z.ZP,{alignItems:"center",justifyContent:"center",children:(0,_.jsx)(Pe.Z,{checked:!!j,compact:!0,onCheck:function(e){h([bn(bn({},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]),D=A.rowGroupHeaders,R=A.rows,B=A.rowsGroupedByIndex,N=A.streamsInRows;return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(O.Z,{p:w.cd,children:[(0,_.jsx)(ue.Z,{children:"Overview of streams"}),y&&(0,_.jsxs)(O.Z,{mt:1,children:[(0,_.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,_.jsx)(O.Z,{mt:1,children:(0,_.jsx)(P.Z,{bold:!0,onClick:function(){return r(ae.uK.STREAMS)},preventDefault:!0,children:"Go and fetch Streams"})})]})]}),!y&&(0,_.jsx)(Ze.Z,{columnFlex:T,columns:M,isSelectedRow:function(e){var n=null===N||void 0===N?void 0:N[e];return!!(0,de.zB)(n,o)},groupsInline:!0,onClickRow:function(e){var n=null===N||void 0===N?void 0:N[e],t=!!(0,de.zB)(n,o);u((function(e){return(0,de.iN)(n,e,{remove:t})}))},rowGroupHeaders:D,rows:R,rowsGroupedByIndex:B,stickyHeader:!0})]})},yn=t(62547),kn=t(53808),Zn=t(19183);function Pn(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 On(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Pn(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Pn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Cn=3*w.iI*2;var wn=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,g=e.onSaveBlock,E=e.pipeline,I=e.savePipelineContent,T=e.setContent,M=(0,f.useRef)(null),R=(0,f.useRef)(null),B=(0,f.useRef)(null),N=(0,f.useRef)(null),L=(0,f.useState)({}),U=L[0],F=L[1],H=(0,f.useState)(null),G=H[0],V=H[1],Q=(0,f.useState)(!1),X=Q[0],J=Q[1],ne=(0,Zn.i)(),te=ne.height,ie=ne.width,re=E||{},le=re.blocks,ce=re.uuid,se=t||{},pe=(se.catalog,se.content),fe=(se.language,se.type),ge=se.uuid,be=(0,f.useMemo)((function(){return b.tf.DATA_LOADER===fe?q.O.SOURCES:q.O.DESTINATIONS}),[fe]),xe=(0,f.useState)(t||null),ye=xe[0],ke=xe[1],Ze=ye||{},Oe=(Ze.configuration,Ze.content),Ce=Ze.metadata,we=(0,f.useMemo)((function(){return(null===Ce||void 0===Ce?void 0:Ce.data_integration)||{}}),[Ce]),Se=we.destination,_e=we.name,Ee=we.source,Te=(0,f.useMemo)((function(){return Se||Ee||null}),[Se,Ee]),Me=(0,f.useMemo)((function(){var e={include_block_catalog:!0,include_block_metadata:!0,include_documentation:!0};return Te&&(e.data_integration_uuid=Te),e}),[Te]),Ae=z.ZP.blocks.pipelines.detail(ce,ge,Me,{},{key:"pipelines/".concat(ce,"/blocks/").concat(ge,"/documentation")}).data,De=(0,f.useMemo)((function(){var e;return(null===ye||void 0===ye||null===(e=ye.configuration)||void 0===e?void 0:e.data_integration)||{}}),[ye]),Re=(0,f.useCallback)((function(e){return ke((function(n){var t,i=On(On({},n),{},{configuration:On(On({},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]),Be=(0,f.useCallback)((function(e){return Re((function(n){return On(On({},n),{},{inputs:e((null===n||void 0===n?void 0:n.inputs)||{})})}))}),[Re]),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,de.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,de.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=On(On({},o),e);i>=0?r[i]=l:r.push(l)}));var l=On(On({},t),{},{catalog:On(On({},i),{},{streams:r})});return null===n||void 0===n||n(l),l}))}),[ke]),Le=(0,f.useMemo)((function(){return null===Ae||void 0===Ae?void 0:Ae.block}),[Ae]);(0,f.useEffect)((function(){Le&&(ye&&(null===Le||void 0===Le?void 0:Le.uuid)===(null===ye||void 0===ye?void 0:ye.uuid)||ke(Le))}),[ye,Le]);var Ue=(0,f.useMemo)((function(){return(0,Ie.HK)(le||[],(function(e){return e.uuid}))}),[le]),Fe=(0,f.useMemo)((function(){var e;return null===ye||void 0===ye||null===(e=ye.upstream_blocks)||void 0===e?void 0:e.map((function(e){return null===Ue||void 0===Ue?void 0:Ue[e]}))}),[ye,Ue]),He=(0,f.useMemo)((function(){return null===Le||void 0===Le?void 0:Le.documentation}),[Le]),Ge=(0,f.useMemo)((function(){return(0,de.Uc)(ye,{getAll:!0})}),[ye]),Ke=(0,f.useMemo)((function(){return(0,de.UA)(Ge)}),[Ge]),ze=(0,f.useMemo)((function(){return"DataIntegrationModal/".concat(ge)}),[ge]),$e=(0,f.useMemo)((function(){return"block_layout_after_width_".concat(ze)}),[ze]),en=(0,f.useMemo)((function(){return"block_layout_before_width_".concat(ze)}),[ze]),nn=(0,ee.VI)(null,{},[],{uuid:ze}),tn=(0,r.Z)(nn,1)[0],on=(0,f.useState)((0,kn.U2)($e,60*w.iI)),rn=on[0],ln=on[1],un=(0,f.useState)(!1),sn=un[0],an=un[1],dn=(0,f.useState)(Math.max((0,kn.U2)(en),40*w.iI)),pn=dn[0],vn=dn[1],hn=(0,f.useState)(!1),gn=hn[0],bn=hn[1],xn=(0,f.useState)({}),Pn=xn[0],wn=xn[1],Sn=(0,f.useState)({selectedMainNavigationTab:null,selectedMainNavigationTabSub:s,selectedSubTab:null}),_n=Sn[0],En=_n.selectedMainNavigationTab,In=_n.selectedMainNavigationTabSub,Tn=_n.selectedSubTab,Mn=Sn[1],An=(0,f.useState)((0,de.UA)([])),Dn=An[0],Rn=An[1],Bn=(0,f.useMemo)((function(){if(!(0,je.Qr)(null===Dn||void 0===Dn?void 0:Dn.noParents)||!(0,je.Qr)(null===Dn||void 0===Dn?void 0:Dn.parents)){var e,n,t,i;if(En)if(In)e=null===Dn||void 0===Dn||null===(n=Dn.parents)||void 0===n||null===(t=n[En])||void 0===t?void 0:t[In];else e=null===Dn||void 0===Dn||null===(i=Dn.noParents)||void 0===i?void 0:i[En];return(0,ae.C0)({addStreamConflicts:!!e})}return(0,ae.C0)()}),[En,In,Dn]),Nn=(0,f.useCallback)((function(e){return e in ae.Pf?ae.Pf[e]:Bn}),[Bn]),Ln=(0,f.useCallback)((function(e){Mn((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 ae.Pf?ae.Pf[i]:Bn,a=r;if(ae.mU[i]||ae.mU[u]){var d,p,f;if(a){if(ae.mU[u]&&!ae.mU[i]){var v;!a||null!==Bn&&void 0!==Bn&&Bn.includes(a)||ae.tw.STREAM_CONFLICTS===a||(a=null===Bn||void 0===Bn||null===(v=Bn[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&&wn({});var h=(0,de.zB)({parent_stream:c,stream:u,tap_stream_id:u},Ke),m=(0,de.zB)({parent_stream:o,stream:i,tap_stream_id:i},Ke),g=(0,Ie.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)||{}));wn((function(e){return On({},(0,je.GL)(e,g||[]))}))}return{selectedMainNavigationTab:i,selectedMainNavigationTabSub:o,selectedSubTab:a}}(e(n),n)}))}),[wn,Ke,Bn]);(0,f.useEffect)((function(){En||Ln((function(e){var n,t,i=e.selectedSubTab;return{selectedMainNavigationTab:u||ae.uK.CONFIGURATION,selectedMainNavigationTabSub:s,selectedSubTab:u?d||(null===(n=Nn(u))||void 0===n||null===(t=n[0])||void 0===t?void 0:t.uuid):i}}))}),[u,s,d,Nn,En,Ln]);var Un=(0,f.useMemo)((function(){return Nn(En)}),[Nn,En]),Fn=(0,f.useMemo)((function(){var e=[{Icon:Y.JG,uuid:ae.uK.CONFIGURATION},{Icon:Y.kO,uuid:ae.uK.STREAMS},{Icon:Y.iA,uuid:ae.uK.OVERVIEW}].map((function(e){var n=e.Icon,t=e.uuid;return(0,_.jsx)(Je,{selected:En===t,children:(0,_.jsx)(P.Z,{block:!0,noHoverUnderline:!0,noOutline:!0,onClick:function(){return Ln((function(){return{selectedMainNavigationTab:t}}))},preventDefault:!0,children:(0,_.jsx)(O.Z,{p:w.cd,children:(0,_.jsxs)(Z.ZP,{alignItems:"center",children:[(0,_.jsx)(j.Z,{primaryLight:!0,size:4*w.iI,square:!0,children:(0,_.jsx)(n,{size:2*w.iI})}),(0,_.jsx)(O.Z,{mr:2}),(0,_.jsx)(C.ZP,{bold:!0,large:!0,children:ae.TD[t]})]})})})},t)})),n=(null===Ge||void 0===Ge?void 0:Ge.length)||0,t=[],i={};return null===Ge||void 0===Ge||Ge.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,Ie.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===Ue||void 0===Ue?void 0:Ue[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,_.jsx)(y.Z,{light:!0},"block-".concat(r,"-divider-top"))),e.push((0,_.jsx)(O.Z,{px:w.cd,py:1,children:(0,_.jsx)(C.ZP,{bold:!0,color:(0,S.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,de.M$)(t),r=(0,de.Qu)(t),l=(0,de.WD)(t),u=(0,de.Z5)(t),c=En===o&&(!r||In===r);e.push((0,_.jsx)(y.Z,{light:!0},"".concat(l,"-divider-top"))),e.push((0,_.jsx)(Je,{selected:c,children:(0,_.jsx)(P.Z,{block:!0,noHoverUnderline:!0,noOutline:!0,onClick:function(){Ln((function(e){var n=e.selectedSubTab;return{selectedMainNavigationTab:o,selectedMainNavigationTabSub:r,selectedSubTab:n}}))},preventDefault:!0,children:(0,_.jsx)(O.Z,{p:w.cd,children:(0,_.jsxs)(Z.ZP,{alignItems:"center",children:[(0,_.jsx)(j.Z,{size:1*w.iI,success:u}),(0,_.jsx)(O.Z,{mr:2}),(0,_.jsx)(k.Z,{flex:1,children:(0,_.jsx)(C.ZP,{default:!u,monospace:!0,children:o})})]})})})},l)),i===n-1&&e.push((0,_.jsx)(y.Z,{light:!0},"".concat(l,"-divider-last")))}))})),e}),[Ue,En,In,Ln,Ge]),Hn=(0,f.useState)(null),Gn=Hn[0],Wn=Hn[1],Kn=(0,f.useMemo)((function(){return(0,de.qf)(Ke,(0,de.UA)(Gn||[]))}),[Ke,Gn]),zn=(0,v.Db)(z.ZP.integration_sources.useUpdate(ce),{onSuccess:function(e){return(0,$.wD)(e,{callback:function(e){var n=e.integration_source.streams;Wn(n)},onErrorCallback:function(e,n){return tn({errors:n,response:e})}})}}),Yn=(0,r.Z)(zn,2),Vn=Yn[0],qn=Yn[1].isLoading,Qn=(0,f.useCallback)((function(){return Vn({integration_source:{block_uuid:ge}})}),[ge,Vn]),Xn=(0,f.useState)(null),Jn=Xn[0],$n=Xn[1],et=(0,f.useMemo)((function(){return(0,_.jsxs)("div",{ref:N,children:[(null===Un||void 0===Un?void 0:Un.length)>=1&&(0,_.jsx)(O.Z,{p:w.cd,children:(0,_.jsx)(D.Z,{noPadding:!0,onClickTab:function(e){var n=e.uuid;return Ln((function(e){return On(On({},e),{},{selectedSubTab:n})}))},regularSizeText:!0,selectedTabUUID:Tn,tabs:Un})}),!(null!==Un&&void 0!==Un&&Un.length)&&ae.uK.STREAMS===En&&(0,_.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,_.jsx)(k.Z,{flex:1,children:(0,_.jsx)(K.Z,{beforeIcon:(0,_.jsx)(Y.HN,{muted:!(null!==Jn&&void 0!==Jn&&Jn.length),size:2*w.iI}),fullWidth:!0,noBackground:!0,noBorder:!0,noBorderRadiusBottom:!0,noBorderRadiusTop:!0,onChange:function(e){var n;return $n(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:Jn||""})}),(null===Jn||void 0===Jn?void 0:Jn.length)>=1&&(0,_.jsx)(A.ZP,{iconOnly:!0,noPadding:!0,noBackground:!0,noBorder:!0,onClick:function(){return $n(null)},children:(0,_.jsx)(Y.x8,{default:!0,size:2*w.iI})}),!Kn&&(0,_.jsx)(O.Z,{px:w.cd,children:(0,_.jsx)(A.ZP,{beforeIcon:(0,_.jsx)(Y.rH,{size:2*w.iI}),compact:!0,loading:qn,onClick:function(){return Qn()},primary:!0,children:"Fetch streams"})})]}),(0,_.jsx)(y.Z,{light:!0})]})}),[Qn,qn,Kn,N,Jn,En,Tn,$n,Ln,Un]),nt=(0,f.useMemo)((function(){return te-2*Ye}),[te]),tt=(0,f.useMemo)((function(){return ie-2*Ye}),[ie]),it=(0,f.useState)(null),ot=it[0],rt=it[1],lt=(0,f.useState)(null),ut=lt[0],ct=lt[1],st=(0,f.useState)(null),at=(st[0],st[1]),dt=(0,f.useState)(!1),pt=dt[0],ft=dt[1];(0,f.useEffect)((function(){var e,n,t,i,o,r;(En||Tn)&&(rt(null===N||void 0===N||null===(e=N.current)||void 0===e||null===(n=e.getBoundingClientRect())||void 0===n?void 0:n.height),at(null===R||void 0===R||null===(t=R.current)||void 0===t||null===(i=t.getBoundingClientRect())||void 0===i?void 0:i.height),ct(null===B||void 0===B||null===(o=B.current)||void 0===o||null===(r=o.getBoundingClientRect())||void 0===r?void 0:r.height))}),[B,R,N,En,Tn]);var vt=(0,v.Db)(z.ZP.blocks.pipelines.useUpdate(encodeURIComponent(ce),encodeURIComponent(ge)),{onSuccess:function(e){return(0,$.wD)(e,{callback:function(e){null===g||void 0===g||g(null===e||void 0===e?void 0:e.block)},onErrorCallback:function(e,n){return tn({errors:n,response:e})}})}}),ht=(0,r.Z)(vt,2),mt=(ht[0],ht[1].isLoading,(0,f.useMemo)((function(){return En&&![ae.uK.CONFIGURATION,ae.uK.OVERVIEW,ae.uK.STREAMS,ae.uK.SYNC].includes(En)}),[En])),gt=(0,f.useMemo)((function(){return mt&&ae.tw.SETTINGS===Tn}),[mt,Tn]),bt=(0,f.useMemo)((function(){return ae.uK.CONFIGURATION===En&&ae.tw.CREDENTIALS===Tn}),[En,Tn]),xt=(0,f.useMemo)((function(){return ae.uK.OVERVIEW===En}),[En]),jt=(0,f.useMemo)((function(){return!(bt||gt||xt&&(null===Ge||void 0===Ge?void 0:Ge.length)>=1)||pt}),[pt,bt,gt,xt,Ge]),yt=(0,f.useMemo)((function(){var e=(0,de.zB)({parent_stream:In,stream:En,tap_stream_id:En},Ke);if(e)return(0,_.jsx)(We,{block:ye,blocksMapping:Ue,height:nt-ot-2*w.iI,highlightedColumnsMapping:Pn,onChangeBlock:p,pipeline:E,selectedSubTab:Tn,setBlockAttributes:ke,setHighlightedColumnsMapping:wn,setSelectedSubTab:function(e){return Ln((function(n){return On(On({},n),{},{selectedSubTab:e})}))},setStreamsMappingConflicts:Rn,showError:tn,stream:e,streamMapping:Ke,streamsMappingConflicts:Dn,updateStreamsInCatalog:Ne})}),[ye,Ue,ot,nt,Pn,p,E,En,In,Tn,ke,wn,Ln,Rn,tn,Ke,Dn,Ne]),kt=(0,f.useState)(null),Zt=kt[0],Pt=kt[1];(0,f.useEffect)((function(){"undefined"!==typeof Zt&&null!==Zt||Pt("undefined"!==typeof pe&&null!==pe?pe:Oe)}),[Oe,pe,Zt,Pt]);var Ot=(0,f.useState)(null),Ct=Ot[0],wt=Ot[1],St=(0,f.useMemo)((function(){return(0,_.jsx)(ve,{block:ye,blockConfigString:Ct,blockContent:Zt,blockUpstreamBlocks:Fe,dataIntegrationConfiguration:De,onChangeCodeBlock:h,pipeline:E,savePipelineContent:I,setBlockConfigString:wt,setBlockContent:Pt,setContent:T,setSelectedSubTab:function(e){return Ln((function(n){return On(On({},n),{},{selectedSubTab:e})}))},showError:tn})}),[ye,Ct,Zt,Fe,De,h,E,I,wt,Pt,T,Ln,tn]),_t=(0,f.useMemo)((function(){if(ae.uK.CONFIGURATION===En){if(ae.tw.UPSTREAM_BLOCK_SETTINGS===Tn){var e=null===Fe||void 0===Fe?void 0:Fe.map((function(e){var n,t,i=e.uuid,o=null===De||void 0===De||null===(n=De.inputs)||void 0===n?void 0:n[i],r=(null===o||void 0===o?void 0:o.streams)||[],u=!!o,c=null===Ue||void 0===Ue?void 0:Ue[i],s=(null===c||void 0===c?void 0:c.catalog)?null===(t=(0,de.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,_.jsxs)("div",{children:[(0,_.jsxs)(O.Z,{p:w.cd,children:[(0,_.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,_.jsx)(k.Z,{children:(0,_.jsx)(C.ZP,{bold:!0,large:!0,monospace:!0,muted:!u,children:i})}),(0,_.jsx)(O.Z,{mr:1}),(0,_.jsx)(Pe.Z,{checked:u,compact:!0,onCheck:function(e){Be((function(n){return e(u)?On(On({},n),{},(0,l.Z)({},i,{})):(0,je.gR)(n,[i])}))}})]}),u&&(0,_.jsx)(O.Z,{mt:w.cd,children:(0,_.jsxs)(me.Z,{noBackground:!0,noBoxShadow:!0,sameColorBorders:!0,children:[(0,_.jsx)(me.g,{noBorder:!0,children:(0,_.jsxs)(Z.ZP,On(On({},Z.A0),{},{children:[(0,_.jsxs)(k.Z,{flexDirection:"column",children:[(0,_.jsx)(C.ZP,{bold:!0,default:!0,children:"Use catalog as an input"}),(0,_.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,_.jsx)(O.Z,{mr:1}),(0,_.jsx)(x.Z,{checked:null===o||void 0===o?void 0:o.catalog,onClick:function(){return Be((function(e){var n;return On(On({},e),{},(0,l.Z)({},i,On(On({},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,_.jsx)(me.g,{noBorder:!0,children:(0,_.jsxs)(Z.ZP,On(On({},Z.A0),{},{children:[(0,_.jsxs)(k.Z,{flexDirection:"column",children:[(0,_.jsx)(C.ZP,{bold:!0,default:!0,children:"Use the block\u2019s output data as an input"}),(0,_.jsx)(C.ZP,{muted:!0,small:!0,children:"Include this block\u2019s output data as an input."})]}),(0,_.jsx)(O.Z,{mr:1}),(0,_.jsx)(x.Z,{checked:null===r||void 0===r?void 0:r.includes(i),monospace:!0,onClick:function(){return Be((function(e){return On(On({},e),{},(0,l.Z)({},i,On(On({},null===e||void 0===e?void 0:e[i]),{},{streams:null!==r&&void 0!==r&&r.includes(i)?(0,Ie.Od)(r,(function(e){return e===i})):r.concat(i)})))}))},small:!0})]}))}),!a&&(0,_.jsxs)(me.g,{noBorder:!0,children:[(0,_.jsxs)(Z.ZP,On(On({},Z.A0),{},{children:[(0,_.jsxs)(k.Z,{flexDirection:"column",children:[(0,_.jsx)(C.ZP,{bold:!0,default:!0,children:"Select which stream\u2019s data to use as an input"}),(0,_.jsxs)(C.ZP,{muted:!0,small:!0,children:["Only the output data from the selected streams will be used as an input.",(0,_.jsx)("br",{}),"If none are selected, then no output data from any stream from this block will be used as in input.",(0,_.jsx)("br",{}),"If you don\u2019t see a stream here, then the upstream block may have unselected the stream in its stream settings."]})]}),(0,_.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,_.jsx)(O.Z,{mt:1,children:(0,_.jsxs)(Z.ZP,On(On({},Z.A0),{},{children:[(0,_.jsx)(k.Z,{children:(0,_.jsx)(C.ZP,{default:!0,monospace:!0,small:!0,children:e})}),(0,_.jsx)(O.Z,{mr:1}),(0,_.jsx)(x.Z,{checked:n,onClick:function(){return Be((function(t){return On(On({},t),{},(0,l.Z)({},i,On(On({},null===t||void 0===t?void 0:t[i]),{},{streams:n?(0,Ie.Od)(r,(function(n){return n===e})):r.concat(e)})))}))},small:!0})]}))},e)}))]}),(0,_.jsx)(me.g,{noBorder:!0,children:(0,_.jsxs)(Z.ZP,On(On({},Z.A0),{},{children:[(0,_.jsxs)(k.Z,{flexDirection:"column",children:[(0,_.jsx)(C.ZP,{bold:!0,default:!0,children:"Only use this block\u2019s output data as an input"}),(0,_.jsxs)(C.ZP,{muted:!0,small:!0,children:["If checked, then this block\u2019s output data is only used as inputs.",b.tf.DATA_EXPORTER===fe&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)("br",{}),"The block\u2019s output data won\u2019t be ingested when running a sync, regardless if it\u2019s enabled in the settings."]})]})]}),(0,_.jsx)(O.Z,{mr:1}),(0,_.jsx)(x.Z,{checked:!(null===o||void 0===o||!o.input_only),onClick:function(){return Be((function(e){var n;return On(On({},e),{},(0,l.Z)({},i,On(On({},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,_.jsx)(y.Z,{light:!0})]},i)}));return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(O.Z,{p:w.cd,children:[(0,_.jsx)(ue.Z,{children:"Inputs"}),(0,_.jsx)(O.Z,{mt:1,children:(0,_.jsxs)(C.ZP,{default:!0,children:["Choose which upstream block to use as inputs when interpolating data into ",(0,_.jsx)(C.ZP,{inline:!0,monospace:!0,children:ge}),"\u2019s (current block) credentials (aka config) and decorated functions."]})}),(0,_.jsx)(O.Z,{mt:1,children:(0,_.jsxs)(C.ZP,{default:!0,children:["If ",(0,_.jsx)(C.ZP,{inline:!0,monospace:!0,children:ge})," (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."]})}),q.O.DESTINATIONS===be&&(0,_.jsx)(O.Z,{mt:1,children:(0,_.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,_.jsx)(P.Z,{bold:!0,onClick:function(){return Ln((function(){return{selectedMainNavigationTab:ae.uK.STREAMS}}))},preventDefault:!0,primary:!0,children:"Streams"})," section."]})})]}),(0,_.jsx)(y.Z,{light:!0}),e]})}}else{if(ae.uK.STREAMS===En&&Kn)return(0,_.jsxs)(O.Z,{p:w.cd,children:[(0,_.jsxs)(O.Z,{mb:w.cd,children:[(0,_.jsx)(ue.Z,{children:"Fetch streams to start set up"}),(0,_.jsx)(O.Z,{mt:1,children:(0,_.jsxs)(C.ZP,{default:!0,children:["Add streams and configure them by first fetching the available streams from ",Te,"."]})})]}),(0,_.jsx)(A.ZP,{beforeIcon:(0,_.jsx)(Y.rH,{size:2*w.iI}),large:!0,loading:qn,onClick:function(){return Qn()},primary:!0,children:"Fetch streams"})]});if(ae.uK.SYNC===En)return(0,_.jsx)(O.Z,{p:w.cd,children:(0,_.jsx)(C.ZP,{children:"Coming soon"})});if(ae.uK.OVERVIEW===En)return(0,_.jsx)(jn,{block:ye,blocksMapping:Ue,onChangeBlock:p,selectedStreamMapping:G,setSelectedMainNavigationTab:function(e){return Ln((function(n){return{selectedMainNavigationTab:e}}))},setSelectedStreamMapping:V,streamMapping:Ke,updateStreamsInCatalog:Ne})}}),[ye,fe,ge,Fe,Ue,De,be,Te,Qn,qn,Kn,p,En,G,Tn,Be,Ln,V,Ke,Ne]),Et=(0,f.useMemo)((function(){return bt?(0,_.jsx)(C.ZP,{bold:!0,children:"Documentation"}):gt?(0,_.jsx)(C.ZP,{bold:!0,children:"Bulk edit stream properties"}):xt?(0,_.jsx)(C.ZP,{bold:!0,children:"Bulk edit streams"}):void 0}),[bt,gt,xt]),It=(0,f.useMemo)((function(){if(gt||xt)return(0,_.jsx)(qe,{ref:B,children:(0,_.jsxs)(O.Z,{p:w.cd,children:[(0,_.jsx)(O.Z,{mb:w.cd,children:(0,_.jsx)(x.Z,{checked:X,label:"Clear selection and values after applying changes",onClick:function(){return J((function(e){return!e}))}})}),(0,_.jsxs)(Z.ZP,{alignItems:"center",children:[(0,_.jsx)(A.ZP,{fullWidth:!0,onClick:function(){var e={noParents:{},parents:{}};gt?e=(0,de.Kq)(G,Pn,U):xt&&(e=(0,de.bX)(G,U)),Ne((0,de.eH)(e),(function(e){return null===p||void 0===p?void 0:p(e)})),X&&(F({}),wn({}),V(null))},primary:!0,children:"Apply bulk changes"}),(0,_.jsx)(O.Z,{mr:1}),(0,_.jsx)(A.ZP,{fullWidth:!0,onClick:function(){F({}),wn({}),V(null)},secondary:!0,children:"Clear"})]})]})})}),[U,X,Pn,gt,xt,p,B,G,F,wn,V,Ne]),Tt=(0,f.useMemo)((function(){if(bt)return(0,_.jsx)(Ve,{children:(0,_.jsxs)(O.Z,{p:w.cd,children:[!Ae&&(0,_.jsx)(W.Z,{}),He&&(0,_.jsx)(he.Z,{children:He.replace(/\<br \/\>/g,"\n\n")})]})});if(gt){var e=(0,de.zB)({parent_stream:In,stream:En,tap_stream_id:En},Ke);return(0,_.jsx)(mn,{attributesMapping:U,block:ye,blocksMapping:Ue,highlightedColumnsMapping:Pn,selectedStreamMapping:G,setAttributesMapping:F,setHighlightedColumnsMapping:wn,setSelectedStreamMapping:V,stream:e,streamMapping:Ke,updateStreamsInCatalog:Ne})}return xt?(0,_.jsx)(fn,{attributesMapping:U,selectedStreamMapping:G,setAttributesMapping:F,setSelectedStreamMapping:V,streamMapping:Ke}):void 0}),[U,ye,Ue,Ae,He,Pn,bt,gt,xt,En,In,G,Ke,Ne]),Mt=(0,f.useMemo)((function(){var e=[{label:function(){return ge}}];return _e&&e.push({bold:!En,label:function(){return _e}}),En&&e.push({bold:!0,label:function(){return ae.TD[En]||En}}),(0,_.jsx)(oe.Z,{breadcrumbs:e,noMarginLeft:!0})}),[ge,_e,En]),At=(0,f.useMemo)((function(){return(te-nt-Cn)/2}),[nt,te]),Dt=(0,f.useMemo)((function(){return(0,_.jsx)(cn,{block:ye,blocksMapping:Ue,height:nt-ot,onChangeBlock:p,searchText:Jn,setSelectedMainNavigationTab:Ln,setSelectedSubTab:function(e){return Ln((function(n){return On(On({},n),{},{selectedSubTab:e})}))},setStreamsMappingConflicts:Rn,streamsFetched:Gn,updateStreamsInCatalog:Ne,width:tt-(pn+(jt?0:rn))})}),[jt,rn,pn,ye,Ue,ot,nt,p,Jn,Ln,Rn,Gn,Ne,tt]);return(0,_.jsxs)(Qe,{maxWidth:tt,children:[(0,_.jsx)(Xe,{children:(0,_.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,_.jsx)(k.Z,{children:Mt}),(0,_.jsx)(O.Z,{mr:1}),(0,_.jsxs)(Z.ZP,{alignItems:"center",children:[(0,_.jsx)(P.Z,{href:"https://docs.mage.ai",inline:!0,noOutline:!0,openNewWindow:!0,children:(0,_.jsx)(Y.$l,{default:!0,size:2*w.iI})}),(0,_.jsx)(O.Z,{mr:2}),m&&(0,_.jsx)(A.ZP,{iconOnly:!0,noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){null===m||void 0===m||m()},children:(0,_.jsx)(Y.x8,{default:!0,size:2*w.iI})})]})]})}),(0,_.jsxs)(yn.Z,{after:Tt,afterFooter:It,afterFooterBottomOffset:At,afterHeader:(0,_.jsx)(O.Z,{px:1,ref:R,children:Et}),afterHeaderOffset:0,afterHeightOffset:0,afterHidden:jt,afterInnerHeightMinus:48+(It&&ut||0),afterMousedownActive:sn,afterWidth:rn,before:Fn,beforeHeightOffset:0,beforeMousedownActive:gn,beforeWidth:pn,contained:!0,headerOffset:ot,height:nt,hideAfterCompletely:!Tt||xt&&!(null!==Ge&&void 0!==Ge&&Ge.length),inline:!0,mainContainerHeader:et,mainContainerRef:M,setAfterHidden:ft,setAfterMousedownActive:an,setAfterWidth:ln,setBeforeMousedownActive:bn,setBeforeWidth:vn,uuid:ze,children:[mt&&yt,!mt&&_t,ae.uK.CONFIGURATION===En&&ae.tw.CREDENTIALS===Tn&&St,ae.uK.STREAMS===En&&!Kn&&Dt]})]})},Sn=t(50724),_n=t(70374),En=t(72098),In=t(77417),Tn=t(39643),Mn=t(58325),An=t(44688);function Dn(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?Dn(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Dn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Bn=1.5*w.iI;var Nn=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,g=e.sideBySideEnabled,b=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),S=(0,f.useRef)(null),E=(0,f.useRef)(null),I=(0,In.Z)(),T=I.featureEnabled,M=I.featureUUIDs,D=[{label:function(){return"New standard pipeline"},onClick:function(){return i({pipeline:{name:(0,J.Y6)()}})},uuid:"new_standard_pipeline"},{label:function(){return"New streaming pipeline"},onClick:function(){return i({pipeline:{name:(0,J.Y6)(),type:H.qL.STREAMING}})},uuid:"new_streaming_pipeline"},{keyTextGroups:[[(0,Mn.V5)()?Tn.RJ:Tn.hE,Tn.SS]],label:function(){return"Save pipeline"},onClick:function(){return d()},uuid:"save_pipeline"}],R=(0,f.useMemo)((function(){var e=[{label:function(){return"Interrupt kernel"},keyTextGroups:[[Tn.kA],[Tn.kA]],onClick:function(){return r()},uuid:"Interrupt kernel"},{label:function(){return"Restart kernel"},keyTextGroups:[[Tn.t_[Tn.OC]],[Tn.t_[Tn.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 Rn(Rn({},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)===H.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]),B=(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,_.jsxs)(Z.ZP,{alignItems:"center",children:[(0,_.jsx)(Y.vR,{success:!g}),(0,_.jsx)(O.Z,{mr:1}),(0,_.jsx)(C.ZP,{noWrapping:!0,children:"Show output below block"})]})},onClick:function(){m(!1)},uuid:"Show output below block"},{label:function(){return(0,_.jsxs)(Z.ZP,{alignItems:"center",children:[(0,_.jsx)(Y.lx,{success:g}),(0,_.jsx)(O.Z,{mr:1}),(0,_.jsx)(C.ZP,{noWrapping:!0,children:"Show output next to code (beta)"})]})},onClick:function(){m(!0)},uuid:"Show output next to code"},{disabled:!g,label:function(){return(0,_.jsxs)(Z.ZP,{alignItems:"center",children:[p?(0,_.jsx)(Y.Jr,{}):(0,_.jsx)("div",{style:{width:Bn}}),(0,_.jsx)(O.Z,{mr:1}),(0,_.jsx)(C.ZP,{disabled:!g,noWrapping:!0,children:"Scroll output alongside code (beta)"})]})},onClick:function(){return h(!p)},uuid:"Scroll output alongside code"}]}),[p,h,m,g]),L=(0,f.useMemo)((function(){var e=[{label:function(){return"Open compute management"},linkProps:{href:"/compute"},uuid:"Open compute management"}];return En.U.PYTHON3===(null===c||void 0===c?void 0:c.name)?e.push({label:function(){return"Switch to PySpark kernel"},onClick:function(){return null===b||void 0===b?void 0:b(null===s||void 0===s?void 0:s.name,H.fj[En.U.PYSPARK])},uuid:"Switch to PySpark kernel"}):En.U.PYSPARK===(null===c||void 0===c?void 0:c.name)&&e.push({label:function(){return"Switch to Python kernel"},onClick:function(){return null===b||void 0===b?void 0:b(null===s||void 0===s?void 0:s.name,H.fj[En.U.PYTHON3])},uuid:"Switch to Python kernel"}),e}),[c,s,b]),U="FileHeaderMenu/index",F=(0,An.y)(),G=F.registerOnKeyDown,W=F.unregisterOnKeyDown;return(0,f.useEffect)((function(){return function(){W(U)}}),[W,U]),G(U,(function(e,n,t){null!==j&&(n[Tn.QK]?y((function(e){return 0===e?2:e-1})):n[Tn.DY]&&y((function(e){return 2===e?0:e+1})))}),[j,y]),(0,_.jsx)(Sn.Z,{onClickOutside:function(){return y(null)},open:!0,style:{position:"relative"},children:(0,_.jsxs)(Z.ZP,{children:[(0,_.jsxs)("div",{style:{position:"relative"},children:[(0,_.jsx)(A.ZP,{compact:!0,noBackground:0!==j,noBorder:!0,highlightOnHoverAlt:!0,padding:"4px 12px",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,_.jsx)(C.ZP,{children:"File"})}),(0,_.jsx)(_n.Z,{items:D,onClickCallback:function(){return y(null)},open:0===j,parentRef:k,uuid:"FileHeaderMenu/file_items"})]}),(0,_.jsxs)("div",{style:{position:"relative"},children:[(0,_.jsx)(A.ZP,{compact:!0,noBackground:2!==j,noBorder:!0,highlightOnHoverAlt:!0,padding:"4px 12px",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,_.jsx)(C.ZP,{children:"Edit"})}),(0,_.jsx)(_n.Z,{items:B,onClickCallback:function(){return y(null)},open:2===j,parentRef:w,uuid:"FileHeaderMenu/edit_items"})]}),(0,_.jsxs)("div",{style:{position:"relative"},children:[(0,_.jsx)(A.ZP,{compact:!0,noBackground:1!==j,noBorder:!0,highlightOnHoverAlt:!0,padding:"4px 12px",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,_.jsx)(C.ZP,{children:"Run"})}),(0,_.jsx)(_n.Z,{items:R,onClickCallback:function(){return y(null)},open:1===j,parentRef:P,uuid:"FileHeaderMenu/run_items"})]}),H.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,_.jsxs)("div",{style:{position:"relative"},children:[(0,_.jsx)(A.ZP,{compact:!0,noBackground:3!==j,noBorder:!0,highlightOnHoverAlt:!0,padding:"4px 12px",onClick:function(){return y((function(e){return 3===e?null:3}))},onMouseEnter:function(){return y((function(e){return null!==e?3:null}))},ref:S,children:(0,_.jsx)(C.ZP,{children:"View"})}),(0,_.jsx)(_n.Z,{items:N,onClickCallback:function(){return y(null)},open:3===j,parentRef:S,uuid:"FileHeaderMenu/viewItems"})]}),(null===T||void 0===T?void 0:T(M.COMPUTE_MANAGEMENT))&&(0,_.jsxs)("div",{style:{position:"relative"},children:[(0,_.jsx)(A.ZP,{compact:!0,noBackground:4!==j,noBorder:!0,highlightOnHoverAlt:!0,padding:"4px 12px",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,_.jsx)(C.ZP,{children:"Compute"})}),(0,_.jsx)(_n.Z,{items:L,onClickCallback:function(){return y(null)},open:4===j,parentRef:E,uuid:"FileHeaderMenu/viewItems"})]}),t]})})},Ln=t(69616),Un=t(89706),Fn=t(67355),Hn=t(70613),Gn=t(21764),Wn=t(28071),Kn=t(65956),zn=t(23657),Yn=t(8970),Vn=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;",""],Ke.w5,_e.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 qn(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 Qn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?qn(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):qn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Xn=2*w.iI,Jn={default:!0,monospace:!0,small:!0};var $n,et,nt=function(){var e=(0,f.useRef)(null),n=(0,ee.VI)(null,{},[],{uuid:"ClusterSelection"}),t=(0,r.Z)(n,1)[0],i=(0,f.useState)(!1),o=i[0],l=i[1],u=(0,zn.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],g=(0,v.Db)(z.ZP.compute_clusters.compute_services.useCreate(null===a||void 0===a?void 0:a.uuid),{onSuccess:function(e){return(0,$.wD)(e,{callback:function(){d()},onErrorCallback:function(e,n){return t({errors:n,response:e})}})}}),b=(0,r.Z)(g,2),x=b[0],j=b[1].isLoading,k=(0,v.Db)((function(e){return z.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,je.GL)(e,["active"])})}),{onSuccess:function(e){return(0,$.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;Gn.Am.error((null===t||void 0===t?void 0:t.error)||i||o,{position:Gn.Am.POSITION.BOTTOM_RIGHT,toastId:r})}})}}),P=(0,r.Z)(k,2),S=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,_.jsx)(A.ZP,{beforeIcon:(0,_.jsx)(Y.NO,{size:Xn}),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,_.jsx)(C.ZP,{default:!0,small:!0,children:l});return(0,_.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,_.jsx)(Kn.Z,{dark:!0,noPadding:!0,children:(0,_.jsxs)(O.Z,{p:1,children:[E&&(0,_.jsxs)(Z.ZP,{alignItems:"center",children:[(0,_.jsx)(W.Z,{inverted:!0,small:!0}),(0,_.jsx)(O.Z,{mr:1}),s]}),!E&&s]})})})}),[E,h,m]);return(0,_.jsxs)(_.Fragment,{children:[M,(0,_.jsxs)(Vn,{children:[(0,_.jsx)(O.Z,{p:w.cd,children:(0,_.jsxs)(Z.ZP,{alignItems:"flex-start",justifyContent:"space-between",children:[(0,_.jsxs)(Z.ZP,{flexDirection:"column",children:[(0,_.jsxs)(Z.ZP,{alignItems:"center",children:[(0,_.jsx)(C.ZP,{bold:!0,large:!0,children:s?"Clusters":(0,J._6)("cluster",I,!0)}),(0,_.jsxs)(Z.ZP,{alignItems:"center",children:[(0,_.jsx)(O.Z,{mr:w.cd}),(0,_.jsx)(Pe.Z,{checked:o,compact:!0,onCheck:function(e){return l(e(o))}}),(0,_.jsx)(O.Z,{mr:1}),(0,_.jsx)(C.ZP,{default:o,muted:!o,small:!0,children:"Include terminated clusters"})]})]}),(0,_.jsx)(O.Z,{mt:1,children:(0,_.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,_.jsx)(O.Z,{mt:1,children:(0,_.jsx)(Z.ZP,{alignItems:"center",children:(0,_.jsx)(A.ZP,{beforeIcon:(0,_.jsx)(Y.AP,{default:!0}),default:!0,linkProps:{href:"/compute",as:"/compute?tab=".concat(Yn.uK.CLUSTERS)},noBackground:!0,noBold:!0,noBorder:!0,target:"_blank",noPadding:!0,openNewWindow:!0,small:!0,children:"Open compute mangement"})})})]}),(0,_.jsx)(O.Z,{mr:w.cd}),I>=1&&(0,_.jsx)(Z.ZP,{flexDirection:"column",children:T})]})}),(0,_.jsx)(y.Z,{light:!0}),(0,_.jsx)(Sn.Z,{onClickOutside:function(){E||m(null)},open:!0,children:(0,_.jsx)(Ze.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."):[Wn.X.RUNNING,Wn.X.WAITING].includes(r)?(i="Activating cluster ".concat(null===o||void 0===o?void 0:o.id,"."),S(Qn(Qn({},o),{},{active:!0}))):i="\n Cluster ".concat(null===o||void 0===o?void 0:o.id," must be in a\n ").concat((0,J.vg)(Wn.X.WAITING)," or\n ").concat((0,J.vg)(Wn.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,Qn(Qn({},Jn),{},{key:"id"}),t),(0,_.jsx)(C.ZP,Qn(Qn({},Jn),{},{danger:[Wn.X.TERMINATED_WITH_ERRORS].includes(o),default:[Wn.X.STARTING].includes(o),muted:[Wn.X.TERMINATED].includes(o),success:[Wn.X.RUNNING,Wn.X.WAITING].includes(o),warning:[Wn.X.TERMINATING].includes(o),children:null!==i&&void 0!==i&&i.state?(0,J.vg)(null===i||void 0===i?void 0:i.state):null===i||void 0===i?void 0:i.state})),(0,_.jsx)(Z.ZP,{justifyContent:"flex-end",children:(0,_.jsx)(Y.Fs,{muted:!n,size:Xn,success:n})},"active")]})),stickyHeader:!0,uuid:"ClusterSelection"})}),!s&&0===I&&(0,_.jsx)(O.Z,{p:w.cd,children:T}),s&&(0,_.jsx)(O.Z,{p:w.cd,children:(0,_.jsx)(W.Z,{inverted:!0,small:!0})})]})]})};!function(e){e.CREATE_NEW_CLUSTER="create_new_cluster",e.SET_ACTIVE_CLUSTER="set_active_cluster"}($n||($n={})),function(e){e.BOOTSTRAPPING="BOOTSTRAPPING",e.STARTING="STARTING",e.WAITING="WAITING"}(et||(et={}));var tt,it=t(89308),ot=t(89515),rt=t(78688),lt=t(98464);!function(e){e.EMR="emr"}(tt||(tt={}));var ut=t(26032),ct=t(74260),st=t(89538);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 dt(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}var pt=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,In.Z)(),m=(d.featureEnabled,d.featureUUIDs,d.sparkEnabled),g=(0,zn.Z)({clustersRefreshInterval:5e3,computeServiceRefreshInterval:5e3,connectionsRefreshInterval:5e3}),b=g.activeCluster,x=g.clusters,y=(g.clustersLoading,g.computeService),S=g.computeServiceUUIDs,E=g.connections,I=g.connectionsLoading,T=g.fetchAll,M=g.fetchComputeClusters,A=(g.setupComplete,(0,f.useContext)(p.ThemeContext)),D=i||{},R=D.alive,B=D.usage,N=(0,f.useState)(tt.EMR),L=N[0],F=(N[1],(0,f.useState)(!1)),G=F[0],K=F[1],V=(0,f.useState)(!1),q=V[0],Q=V[1],X=(0,f.useState)(!1),ee=X[0],ne=X[1],te=(0,f.useState)(!1),ie=te[0],oe=te[1],re=(0,f.useRef)(null),le=z.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,Ie.sE)(se,(function(e){return e.is_active}))}),[se]),de=(0,v.Db)(z.ZP.clusters.useUpdate(L),{onSuccess:function(e){return(0,$.wD)(e,{callback:function(){ce()},onErrorCallback:function(e,n){return u({errors:n,response:e})}})}}),pe=(0,r.Z)(de,1)[0],fe=z.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,An.y)(),ge=(me.registerOnKeyDown,me.unregisterOnKeyDown);(0,f.useEffect)((function(){return function(){ge(he)}}),[ge,he]);var be=(0,f.useMemo)((function(){return null===B||void 0===B?void 0:B.pid}),[null===B||void 0===B?void 0:B.pid]),xe=(0,lt.Z)(be),ye=(0,st.dd)((function(){return(0,_.jsx)(ot.Z,{cancelText:"Close",centerOnScreen:!0,confirmText:"Don't show again",neutral:!0,onCancel:Pe,onClick:function(){(0,kn.t8)(kn.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)(ye,2),Ze=ke[0],Pe=ke[1];(0,f.useEffect)((function(){var e=(0,kn.U2)(kn.DU,0);be!==xe&&t&&!e&&(Ze(),c([]))}),[t,be,xe,c,Ze]);var Oe=(0,f.useMemo)((function(){return[H.qL.PYTHON,H.qL.PYSPARK].includes(null===l||void 0===l?void 0:l.type)}),[l]),Ce=(0,f.useMemo)((function(){return(0,_.jsx)(j.Z,{color:t?(A||Se.Z).borders.info:R?(A||Se.Z).borders.success:(A||Se.Z).borders.danger,size:w.iI})}),[R,t,A]),we=(0,v.Db)((function(e){return z.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,je.GL)(e,["active"])})}),{onSuccess:function(e){return(0,$.wD)(e,{callback:function(){M()},onErrorCallback:function(e){var n=e.error,t=n.errors,i=n.exception,o=n.message,r=n.type;Gn.Am.error((null===t||void 0===t?void 0:t.error)||i||o,{position:Gn.Am.POSITION.BOTTOM_RIGHT,toastId:r})}})}}),_e=(0,r.Z)(we,2),Ee=_e[0],Te=(_e[1].isLoading,(0,f.useMemo)((function(){if(!m||!Oe||S.AWS_EMR!==(null===y||void 0===y?void 0:y.uuid)||H.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 ct.IK.OBSERVABILITY===n}));if(!e)return null;var n=e.name,t=e.state,i=e.status_calculated,o=e.uuid,r=[ut.i.ACTIVE].includes(t),u=([ut.i.INACTIVE].includes(t),[ct.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,_.jsx)(Sn.Z,{onClickOutside:function(e){(0,Be.j)(e),oe(!1)},open:ie,children:(0,_.jsx)(Vn,{children:(0,_.jsx)(it.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,_.jsx)(Y.Fs,{danger:[ct.br.ERROR].includes(i),muted:[ct.br.INCOMPLETE].includes(i),success:u&&r});return(0,_.jsxs)("div",{style:{position:"relative"},children:[(0,_.jsx)(U.ZP,dt(dt({beforeElement:p,blackBorder:!0,compact:!0,inline:!0,noHover:I,onClick:function(e){(0,Be.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(S.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 ct.IK.SETUP===n})),u=null===r||void 0===r?void 0:r.status_calculated;if(H.qL.PYSPARK!==(null===l||void 0===l?void 0:l.type))return null;if(b){var c,s=null===b||void 0===b||null===(c=b.status)||void 0===c?void 0:c.state;t=(0,_.jsxs)(C.ZP,{monospace:!0,children:[null===b||void 0===b?void 0:b.id," ",s&&![Wn.X.RUNNING,Wn.X.WAITING].includes(s)&&(0,J.J3)(s)]}),i=(0,_.jsx)(Y.Fs,{danger:[Wn.X.TERMINATED_WITH_ERRORS].includes(s),default:[Wn.X.STARTING].includes(s),muted:[Wn.X.TERMINATED].includes(s),success:[Wn.X.RUNNING,Wn.X.WAITING].includes(s),warning:[Wn.X.TERMINATING].includes(s)})}else u?(t=null!==x&&void 0!==x&&x.length?"Select a compute cluster":"Launch a new cluster",i=(0,_.jsx)(Y.Fs,{warning:!0})):(e=(0,_.jsx)(Sn.Z,{onClickOutside:function(e){(0,Be.j)(e),ne(!1)},open:ee,children:(0,_.jsx)(Vn,{children:(0,_.jsx)(rt.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,Be.j)(e),ee||ne(!0),oe(!1)},t="Compute setup incomplete",i=(0,_.jsx)(Y.uy,{danger:!0}));(b||u)&&(e=(0,_.jsx)(Sn.Z,{onClickOutside:function(e){(0,Be.j)(e),ne(!1)},open:ee,children:(0,_.jsx)(nt,{})}),n=function(e){(0,Be.j)(e),ee||ne(!0),oe(!1),oe(!1)})}else if(S.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,_.jsx)(Y.Fs,{success:!0})}}else n=function(){return a.push("/compute")},t="Compute unavailable",i=(0,_.jsx)(Y.Fs,{danger:!0});else t="Loading compute",i=(0,_.jsx)(W.Z,{inverted:!0,small:!0});return(0,_.jsxs)("div",{style:{position:"relative"},children:[(0,_.jsx)(U.ZP,dt(dt({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]})}),[b,ee,x,y,S,fe,l,a,ne,oe,ve,m,Oe]),Ae=(0,f.useMemo)((function(){return(0,_.jsx)("div",{ref:re,style:{position:"relative"},children:(0,_.jsxs)(Z.ZP,{alignItems:"center",children:[(null===l||void 0===l?void 0:l.type)===H.qL.PYSPARK&&!m&&(0,_.jsxs)(O.Z,{mr:w.cd,children:[(0,_.jsxs)(P.Z,{muted:!!ae,onClick:function(){return K(!0)},preventDefault:!0,sameColorAsText:!ae,underline:!ae,children:[ae&&ae.id,!ae&&"Select cluster"]}),(0,_.jsx)(Sn.Z,{disableEscape:!0,onClickOutside:function(){return K(!1)},open:G,children:(0,_.jsx)(_n.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,_.jsxs)(Z.ZP,{alignItems:"center",fullWidth:!0,justifyContent:"space-between",children:[(0,_.jsx)(k.Z,{flex:1,children:(0,_.jsx)(C.ZP,{muted:!t&&et.WAITING!==i,children:n})}),t&&(0,_.jsx)(Y.Jr,{size:2*w.iI,success:!0}),!t&&(0,_.jsx)(C.ZP,{monospace:!0,muted:!0,children:i})]})},onClick:t||et.WAITING!==i?null:function(){return pe({cluster:{id:n}})},uuid:n}})))),onClickCallback:function(){return K(!1)},open:G,parentRef:re,uuid:"KernelStatus/select_cluster",width:40*w.iI})})]}),(0,_.jsx)(U.ZP,{beforeElement:Ce,blackBorder:!0,compact:!0,inline:!0,onClick:function(){return Q(!0)},uuid:"Pipeline/KernelStatus/kernel",children:H.RH[(null===l||void 0===l?void 0:l.type)||H.qL.PYTHON]}),(0,_.jsx)(Sn.Z,{disableEscape:!0,onClickOutside:function(){return Q(!1)},open:q,children:(0,_.jsx)(_n.Z,{items:[{isGroupingTitle:!0,label:function(){return"Select kernel"},uuid:"select_kernel"}].concat((0,o.Z)(Object.keys(H.a_).filter((function(e){return(null===l||void 0===l?void 0:l.type)!=e})).map((function(e){return{label:function(){return H.RH[e]||e},onClick:function(){return s(null===l||void 0===l?void 0:l.name,e)},uuid:e}})))),onClickCallback:function(){return Q(!1)},open:q,parentRef:re,rightOffset:0,uuid:"KernelStatus/select_kernel",width:25*w.iI})})]})})}),[R,se,t,l,ae,K,Q,G,q,Ce,A,Ee,pe,s]);return(0,_.jsxs)(Z.ZP,{alignItems:"center",fullHeight:!0,justifyContent:"space-between",children:[(0,_.jsx)(Z.ZP,{alignItems:"center",fullHeight:!0,justifyContent:"flex-start",children:n}),(0,_.jsx)(O.Z,{px:w.cd,children:(0,_.jsx)(k.Z,{alignItems:"center",children:(0,_.jsxs)(Z.ZP,{alignItems:"center",children:[Ae,Te&&(0,_.jsx)(O.Z,{ml:1,children:Te}),Me&&(0,_.jsx)(O.Z,{ml:1,children:Me})]})})})]})},ft=t(48339),vt=t(17717),ht=t(12691),mt=t.n(ht),gt=t(65976),bt=t(88014),xt=t(92709),jt=p.default.div.withConfig({displayName:"indexstyle__ScrollbarContainerStyle",componentId:"sc-174iy66-0"})(["position:fixed;"," "," "," ",""],(function(e){return"\n border-radius: ".concat(_e.n_,"px;\n background: ").concat((e.theme.background||Se.Z.background).scrollbarTrack,";\n ")}),(function(e){return!e.invisible&&"\n width: ".concat(Ke.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 ")})),yt=p.default.div.withConfig({displayName:"indexstyle__ScrollCursorStyle",componentId:"sc-174iy66-1"})(["position:fixed;z-index:3;"," "," "," "," ",""],(function(e){return"\n border-radius: ".concat(_e.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(Ke.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 ")})),kt=t(74052),Zt=t(61709);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=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),g=((0,f.useMemo)((function(){return null===i||void 0===i?void 0:i.map((function(e){return e.uuid}))}),[i]),(0,f.useState)(null)),b=g[0],x=g[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],S=a||{},E=S.height,I=S.width,T=S.x,M=S.y,A=(0,f.useMemo)((function(){return(0,Ie.Sm)(b||[])}),[b]),D=(0,f.useCallback)((function(){return A>E?E*(E/A):0}),[E,A]),R=(0,f.useMemo)((function(){return D()}),[D]);(0,f.useMemo)((function(){v(R)}),[R,v]);var B=(0,f.useCallback)((function(e){if(R){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+R>=M+E&&(e=M+E-R),null!==h&&void 0!==h&&h.current&&(h.current.style.top="".concat(e,"px"))}}),[R,E,h,M]),N=(0,f.useCallback)((function(){if(!u){var e=new CustomEvent(xt.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,Ie.Sm)((null===o||void 0===o?void 0:o.slice(0,i))||[]),s=(0,Ie.Sm)(o||[])||0,a=(0,Zt.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)}),[]),U=(0,f.useCallback)((function(){var e=Object.values(c||{}),n=null===i||void 0===i?void 0:i.map((function(n){var t=(0,kt.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(Ot(Ot({},y),{},{heights:n}));B(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,U)})),function(){var e;null===(e=Object.keys(c||{}))||void 0===e||e.forEach((function(e){window.removeEventListener(e,U)}))}}),[c,U]);var F=(0,f.useCallback)((function(){N(),U()}),[N,U]);(0,f.useEffect)((function(){return window.addEventListener(xt.Qj,F),function(){window.removeEventListener(xt.Qj,F)}}),[F]),(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:b,y:null===m||void 0===m||null===(n=m.current)||void 0===n||null===(t=n.getBoundingClientRect())||void 0===t?void 0:t.y});B(l),N()};return window.addEventListener(xt.Em,e),function(){window.removeEventListener(xt.Em,e)}}),[i,L,N,b,B]),(0,f.useEffect)((function(){u||U()}),[u,p,U]),(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(Ot(Ot({},n),{},{heights:b}));B(t),N(),null!==n&&void 0!==n&&n.lockScroll&&k(n)}};return window.addEventListener(xt.Wf,e),function(){window.removeEventListener(xt.Wf,e)}}),[r,E,b,k,B,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);B(c),N(),k(null)}}}),[r,l,N,E,p,B,I,T,M]),G=(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;B(t),N(),k(null)}}),[N,C,B]);return(0,f.useEffect)((function(){var e,n;B(null===h||void 0===h||null===(e=h.current)||void 0===e||null===(n=e.getBoundingClientRect())||void 0===n?void 0:n.y)}),[E,B]),(0,f.useEffect)((function(){var e=function(){w(null)};return R&&(window.addEventListener("mousemove",G),window.addEventListener("wheel",H),window.addEventListener("mouseup",e)),function(){window.removeEventListener("mousemove",G),window.removeEventListener("wheel",H),window.removeEventListener("mouseup",e)}}),[R,G,H]),(0,_.jsx)(jt,{height:E,invisible:s,left:d?T+I-Ke.nn:void 0,ref:m,children:(0,_.jsx)(yt,{height:R,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})})},wt=t(88353),St=t(53779);var _t=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,Ie.HK)(n,(function(e){return e.configuration.file_path}))}),[n]),(0,wt.Z)({disableContextMenu:!0,onOpenFile:function(e,n){n||i(e)},onSelectBlockFile:o,query:{pattern:encodeURIComponent("\\.sql$")},uuid:"FileSelectorPopup/dbt"}).browser);return(0,_.jsxs)(St.eD,{children:[(0,_.jsxs)(St.X$,{children:[(0,_.jsx)(k.Z,{alignItems:"center",children:(0,_.jsx)(C.ZP,{disableWordBreak:!0,monospace:!0,children:"Select dbt model or snapshot file"})}),(0,_.jsx)(A.ZP,{iconOnly:!0,onClick:t,children:(0,_.jsx)(Y.x8,{muted:!0})})]}),(0,_.jsx)(St.C,{children:u})]})},Et=t(32013),It=t(98777),Tt=t(39457);function Mt(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 At(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Mt(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Mt(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Dt="4px",Rt={lightBackground:!0,muted:!0,relativePosition:!0},Bt=[Ce.Zj.BIGQUERY,Ce.Zj.DELTA_LAKE_S3];var Nt=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,g=(0,f.useRef)(null),b=s.bookmark_properties,j=s.destination_table,y=void 0===j?"":j,P=s.key_properties,S=s.metadata,E=s.partition_keys,I=s.replication_method,T=s.run_in_parallel,M=s.schema.properties,D=s.tap_stream_id,R=s.unique_constraints,B=s.unique_conflict_method,N=(0,f.useState)(y),L=N[0],U=N[1],F=(0,f.useState)(!1),H=F[0],W=F[1],z=(0,f.useState)(null),Y=z[0],V=z[1],q=(0,f.useState)(!!t),Q=q[0],X=q[1],$=(0,f.useState)((0,l.Z)({},D,n||{})),ee=$[0],ne=$[1],te=(0,lt.Z)(D);(0,f.useEffect)((function(){te!==D&&(U(y),V(null))}),[y,I,D,te,B]),(0,f.useEffect)((function(){var e=null===ee||void 0===ee?void 0:ee[D];(null===b||void 0===b?void 0:b.length)>0&&((0,je.Qr)(e)||!(0,je.Xy)(n,e))&&ne((function(e){return At(At({},e),{},(0,l.Z)({},D,n))}))}),[null===b||void 0===b?void 0:b.length,n,D]);var ie=(0,f.useMemo)((function(){return(0,Ie.HK)(S,(function(e){return e.breadcrumb.join("/")}))}),[S]),oe=(0,f.useMemo)((function(){var e;return null===(e=(0,Ie.sE)(S,(function(e){return 0===e.breadcrumb.length})))||void 0===e?void 0:e.metadata}),[S]),re=(0,f.useMemo)((function(){return oe[Ce.fe.KEY_PROPERTIES]||[]}),[oe]),le=(0,f.useMemo)((function(){return oe[Ce.fe.REPLICATION_KEYS]||[]}),[oe]),ce=Bt.includes(t),ae=a.length>1,de=(0,f.useCallback)((function(e){var n=At({},null===ee||void 0===ee?void 0:ee[D]);n.hasOwnProperty(e)&&delete n[e],ne((function(e){return At(At({},e),{},(0,l.Z)({},D,At({},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,Ie.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,g=void 0===f?[]:f,j=new Set(Array.isArray(g)?g:[g]),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 S=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=Ce.D5.reduce((function(e,n){return S.indexOf(n)>=0||Ce.Xv===String(n)&&Ce.zS.DATE_TIME===p||Ce.zS.UUID===String(n)&&Ce.zS.UUID===p?e:e.concat((0,_.jsx)("option",{value:n,children:n},n))}),[]),B=S.findIndex((function(e){return e===Ce.RL.STRING})),N=[(0,_.jsx)(x.Z,{checked:T,onClick:function(){v(D,[u],{selected:!T})}},"".concat(D,"/").concat(u,"/selected")),(0,_.jsx)(C.ZP,{children:u},"".concat(D,"/").concat(u,"/name")),(0,_.jsxs)(Z.ZP,{children:[(0,_.jsx)(k.Z,{flex:1,children:(0,_.jsx)(Z.ZP,{alignItems:"center",flexWrap:"wrap",fullWidth:!0,children:S.map((function(e,n){return(0,_.jsx)(O.Z,{mb:1,mr:1,children:(0,_.jsx)(ke.Z,{border:!0,label:p&&Ce.RL.STRING===e&&B===n?Ce.eL[p]:e,onClick:function(){var n={format:p,type:S.filter((function(n){return n!==e}))};Ce.zS.DATE_TIME!==p&&Ce.zS.UUID!==p||Ce.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,_.jsxs)(G.Z,{compact:!0,onChange:function(e){var n=e.target.value,t={format:p,type:S};Ce.Xv===String(n)?(t.format=Ce.zS.DATE_TIME,t.type.push(Ce.RL.STRING)):Ce.zS.UUID===String(n)?(t.format=Ce.zS.UUID,t.type.push(Ce.RL.STRING)):t.type.push(n),h(D,u,t)},primary:!0,small:!0,value:"",width:10*w.iI,children:[(0,_.jsx)("option",{value:""}),M]})]},"".concat(D,"/").concat(u,"/type")),(0,_.jsx)(x.Z,{checked:!(null===R||void 0===R||!R.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,Ie.Od)(e.unique_constraints,(function(e){return u===e})):e.unique_constraints=[u].concat(e.unique_constraints||[]),e}))}},"".concat(D,"/").concat(u,"/unique")),(0,_.jsx)(x.Z,{checked:!(null===b||void 0===b||!b.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,Ie.Od)(e.bookmark_properties,(function(e){return u===e}))):e.bookmark_properties=[u].concat(e.bookmark_properties||[]),e}))}},"".concat(D,"/").concat(u,"/bookmark")),(0,_.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,Ie.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(ce){var L=t!==Ce.Zj.DELTA_LAKE_S3,U=L&&(re.includes(u)||!y.has(Ce.zS.DATE_TIME));N.push((0,_.jsx)(x.Z,{checked:!(null===E||void 0===E||!E.includes(u)),disabled:U,onClick:U?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,Ie.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(ae){var F=Y===o;N.push((0,_.jsx)(A.ZP,{compact:!0,disabled:F,onClick:function(){V(o),setTimeout((function(){return V(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:S};var v=null===(i=(0,Ie.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[Ce.fe.REPLICATION_KEYS]||[],m=v[Ce.fe.KEY_PROPERTIES]||[];null===R||void 0===R||!R.includes(u)||null!==e&&void 0!==e&&null!==(o=e.unique_constraints)&&void 0!==o&&o.includes(u)||!m.includes(u)?null!==R&&void 0!==R&&R.includes(u)||null===e||void 0===e||null===(r=e.unique_constraints)||void 0===r||!r.includes(u)||(e.unique_constraints=(0,Ie.Od)(e.unique_constraints,(function(e){return u===e}))):e.unique_constraints=[u].concat(e.unique_constraints||[]),null===b||void 0===b||!b.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!==b&&void 0!==b&&b.includes(u)||null===e||void 0===e||null===(c=e.bookmark_properties)||void 0===c||!c.includes(u)||(e.bookmark_properties=(0,Ie.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,Ie.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,Ie.Od)(e.partition_keys,(function(e){return u===e}))):e.partition_keys=[u].concat(e.partition_keys||[])}return At({},e)}))},pill:!0,secondary:!0,children:(0,_.jsx)(C.ZP,{success:F,children:F?"Applied!":"Apply"})}))}return N})),o=e.every((function(e){return e})),l=[null,2,1,null,null,null],u=[{label:function(){return(0,_.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 ce&&(l.push(null),u.push({uuid:"Partition key"})),ae&&(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,_.jsx)(se.cl,{children:(0,_.jsx)(Ze.Z,{alignTop:!0,columnFlex:l,columns:u,rows:i,stickyHeader:!0})})}),[b,t,ae,Y,P,ie,E,M,de,ce,D,R,d,v,h,m,re,le]);return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(ue.Z,{condensed:!0,level:4,spacingBelow:!0,children:[(0,_.jsx)(ue.Z,{condensed:!0,inline:!0,level:4,monospace:!0,children:D})," schema"]}),(0,_.jsx)(O.Z,{mb:3,children:(0,_.jsx)(Kn.Z,{headerTitle:"Output",overflowVisible:!0,children:(0,_.jsxs)(Z.ZP,{alignItems:"center",children:[(0,_.jsx)(C.ZP,{children:"Destination table name"}),(0,_.jsx)(O.Z,{ml:Dt}),(0,_.jsx)(Oe.Z,At(At({},Rt),{},{label:(0,_.jsxs)(C.ZP,{children:["By default, this stream will be saved to your destination under the table named ",(0,_.jsx)(C.ZP,{bold:!0,inline:!0,monospace:!0,children:D}),". To change the table name, enter in a different value."]})})),(0,_.jsx)(O.Z,{ml:1}),(0,_.jsx)(K.Z,{compact:!0,monospace:!0,onChange:function(e){var n=e.target.value;U(n),clearTimeout(g.current),g.current=setTimeout((function(){m(D,(function(e){return At(At({},e),{},{destination_table:n})}))}),300)},value:L||"",width:45*w.iI})]})})}),(0,_.jsx)(O.Z,{mb:3,children:(0,_.jsx)(Kn.Z,{headerTitle:"Usage",overflowVisible:!0,children:(0,_.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,_.jsxs)(k.Z,{alignItems:"center",children:[(0,_.jsx)(C.ZP,{children:"Replication method"}),(0,_.jsx)(O.Z,{ml:Dt}),(0,_.jsx)(Oe.Z,At(At({},Rt),{},{label:(0,_.jsxs)(C.ZP,{children:["Do you want to synchronize the entire stream (",(0,_.jsx)(C.ZP,{bold:!0,inline:!0,monospace:!0,children:Ce._B.FULL_TABLE}),") on each integration pipeline run or only new records (",(0,_.jsx)(C.ZP,{bold:!0,inline:!0,monospace:!0,children:Ce._B.INCREMENTAL}),")?",c===Ce.th.POSTGRESQL&&(0,_.jsxs)(C.ZP,{children:["Log-based incremental replication (",(0,_.jsx)(C.ZP,{bold:!0,inline:!0,monospace:!0,children:Ce._B.LOG_BASED}),") is also available for PostgreSQL sources."]})]})})),(0,_.jsx)(O.Z,{ml:1}),(0,_.jsxs)(G.Z,{compact:!0,onChange:function(e){m(D,(function(n){return At(At({},n),{},{replication_method:e.target.value})}))},primary:!0,value:I,children:[(0,_.jsx)("option",{value:""}),Object.values(Ce._B).filter((function(e){return c===Ce.th.POSTGRESQL||e!==Ce._B.LOG_BASED})).map((function(e){return(0,_.jsx)("option",{value:e,children:e},e)}))]}),(0,_.jsx)(O.Z,{ml:3}),(0,_.jsx)(C.ZP,{children:"Unique conflict method"}),(0,_.jsx)(O.Z,{ml:Dt}),(0,_.jsx)(Oe.Z,At(At({},Rt),{},{label:(0,_.jsxs)(C.ZP,{wordBreak:!0,children:["If a new record has the same value as an existing record in the ",(0,J._6)("unique column",null===R||void 0===R?void 0:R.length),(null===R||void 0===R?void 0:R.length)>0&&(0,_.jsx)(_.Fragment,{children:"\xa0"}),null===R||void 0===R?void 0:R.sort().map((function(e,n){return(0,_.jsxs)(C.ZP,{bold:!0,inline:!0,monospace:!0,children:[1!==(null===R||void 0===R?void 0:R.length)&&n===(null===R||void 0===R?void 0:R.length)-1?(0,_.jsx)(C.ZP,{inline:!0,children:" and "},e):n>=1&&(0,_.jsx)(_.Fragment,{children:",\xa0"}),e]},e)})),", how do you want to resolve the conflict? The conflict method ",(0,_.jsx)(C.ZP,{bold:!0,inline:!0,monospace:!0,children:Ce.MU.IGNORE})," will skip the new record if it\u2019s a duplicate of an existing record. The conflict method ",(0,_.jsx)(C.ZP,{bold:!0,inline:!0,monospace:!0,children:Ce.MU.UPDATE})," will not save the new record and instead update the existing record with the new record\u2019s properties."]})})),(0,_.jsx)(O.Z,{ml:1}),(0,_.jsxs)(G.Z,{compact:!0,inputWidth:11*w.iI,onChange:function(e){m(D,(function(n){return At(At({},n),{},{unique_conflict_method:e.target.value})}))},primary:!0,value:B,children:[(0,_.jsx)("option",{value:""}),(0,_.jsx)("option",{value:Ce.MU.IGNORE,children:Ce.MU.IGNORE}),(0,_.jsx)("option",{value:Ce.MU.UPDATE,children:Ce.MU.UPDATE})]})]}),ae&&(0,_.jsxs)(k.Z,{alignItems:"center",children:[(0,_.jsx)(C.ZP,{default:!0,children:"All streams"}),(0,_.jsx)(O.Z,{ml:Dt}),(0,_.jsx)(Oe.Z,At(At({},Rt),{},{appearBefore:!0,label:(0,_.jsx)(C.ZP,{children:"This will apply this stream's replication method and unique conflict method settings to all selected streams."})})),(0,_.jsx)(O.Z,{ml:1}),(0,_.jsx)(A.ZP,{compact:!0,disabled:H,onClick:function(){W(!0),setTimeout((function(){return W(!1)}),2e3),d((function(e){return At(At({},e),{},{replication_method:I,unique_conflict_method:B})}))},pill:!0,secondary:!0,children:(0,_.jsx)(C.ZP,{bold:!H,success:H,children:H?"Applied!":"Apply"})})]})]})})}),(0,_.jsx)(Kn.Z,{headerTitle:"Features",noPadding:!0,children:pe}),(0,_.jsx)(O.Z,{mt:2,children:(0,_.jsx)(A.ZP,{loading:i,onClick:function(){return u(D)},primary:!0,small:!0,children:"Load sample data"})}),(0,_.jsxs)(O.Z,{mt:5,children:[(0,_.jsx)(ue.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Settings"}),(0,_.jsx)(O.Z,{mb:5,children:(0,_.jsxs)(O.Z,{mb:1,children:[(0,_.jsx)(C.ZP,{bold:!0,large:!0,children:"Run stream in parallel"}),(0,_.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,_.jsx)(O.Z,{mb:1}),(0,_.jsx)(Pe.Z,{checked:T,onCheck:function(){return m(D,(function(e){return e.run_in_parallel=!T,e}))}},"".concat(D,"/run_in_parallel"))]})}),Ce._B.INCREMENTAL===I&&(0,_.jsxs)(O.Z,{mb:5,children:[(0,_.jsxs)(O.Z,{mb:1,children:[(0,_.jsx)(C.ZP,{bold:!0,large:!0,children:"Bookmark properties"}),(0,_.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,_.jsxs)(Z.ZP,{alignItems:"center",flexWrap:"wrap",children:[!(null!==b&&void 0!==b&&b.length)&&(0,_.jsxs)(C.ZP,{italic:!0,children:["Click the checkbox under the column ",(0,_.jsx)(C.ZP,{bold:!0,inline:!0,italic:!0,children:"Bookmark"})," to use a specific column as a bookmark property."]}),null===b||void 0===b?void 0:b.sort().map((function(e){return(0,_.jsx)(O.Z,{mb:1,mr:1,children:(0,_.jsx)(ke.Z,{label:e,onClick:function(){de(e),m(D,(function(n){return At(At({},n),{},{bookmark_properties:(0,Ie.Od)(n.bookmark_properties||[],(function(n){return n===e}))})}))},primary:!0})},"bookmark_properties/".concat(e))}))]}),(null===b||void 0===b?void 0:b.length)>0&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(O.Z,{my:2,children:(0,_.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,_.jsxs)(O.Z,{mr:2,children:[(0,_.jsx)(C.ZP,{bold:!0,large:!0,children:"Manually edit bookmark property values"}),!t&&(0,_.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,_.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,_.jsx)(Pe.Z,{checked:Q,disabled:!t,onCheck:function(){return X((function(e){return!e}))}})]})}),Q&&!!t&&(0,_.jsx)(Kn.Z,{header:(0,_.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,_.jsx)(C.ZP,{bold:!0,default:!0,children:"Bookmark property values"}),(0,_.jsx)(A.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,_.jsx)(Ze.Z,{columnBorders:!0,columnFlex:[null,1],columns:[{uuid:"Feature"},{uuid:"Current bookmark value"}],rows:b.map((function(e){var n;return[(0,_.jsx)(C.ZP,{default:!0,monospace:!0,children:e},e),(0,_.jsx)(K.Z,{borderless:!0,monospace:!0,onChange:function(n){n.preventDefault(),ne((function(t){return At(At({},t),{},(0,l.Z)({},D,At(At({},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"))]}))})})]})]}),ae&&(null===b||void 0===b?void 0:b.length)>0&&(0,_.jsxs)(O.Z,{mb:5,children:[(0,_.jsx)(C.ZP,{bold:!0,large:!0,children:"Valid replication keys"}),(0,_.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,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(C.ZP,{default:!0,inline:!0,children:"These are the valid replication keys for this stream:"}),"\xa0",(0,_.jsxs)(C.ZP,{inline:!0,monospace:!0,small:!0,children:[le.join(", "),"."]})]}),0===le.length&&(0,_.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,_.jsxs)(O.Z,{mb:5,children:[(0,_.jsxs)(O.Z,{mb:1,children:[(0,_.jsx)(C.ZP,{bold:!0,large:!0,children:"Unique constraints"}),(0,_.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,_.jsxs)(Z.ZP,{alignItems:"center",flexWrap:"wrap",children:[!(null!==R&&void 0!==R&&R.length)&&(0,_.jsxs)(C.ZP,{italic:!0,children:["Click the checkbox under the column ",(0,_.jsx)(C.ZP,{bold:!0,inline:!0,italic:!0,children:"Unique"})," to use a specific column as a unique constraint."]}),null===R||void 0===R?void 0:R.sort().map((function(e){return(0,_.jsx)(O.Z,{mb:1,mr:1,children:(0,_.jsx)(ke.Z,{label:e,onClick:function(){m(D,(function(n){return At(At({},n),{},{unique_constraints:(0,Ie.Od)(n.unique_constraints||[],(function(n){return n===e}))})}))},primary:!0})},"unique_constraints/".concat(e))}))]})]}),(0,_.jsxs)(O.Z,{mb:5,children:[(0,_.jsxs)(O.Z,{mb:1,children:[(0,_.jsx)(C.ZP,{bold:!0,large:!0,children:"Key properties"}),(0,_.jsx)(C.ZP,{default:!0,children:"Key properties are used as the primary key for the destination table."})]}),(0,_.jsxs)(Z.ZP,{alignItems:"center",flexWrap:"wrap",children:[!(null!==P&&void 0!==P&&P.length)&&(0,_.jsxs)(C.ZP,{italic:!0,children:["Click the checkbox under the column ",(0,_.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,_.jsx)(O.Z,{mb:1,mr:1,children:(0,_.jsx)(ke.Z,{label:e,onClick:function(){m(D,(function(n){return At(At({},n),{},{key_properties:(0,Ie.Od)(n.key_properties||[],(function(n){return n===e}))})}))},primary:!0})},"key_properties/".concat(e))}))]})]}),ce&&(0,_.jsxs)(O.Z,{mb:3,children:[(0,_.jsxs)(O.Z,{mb:1,children:[(0,_.jsx)(C.ZP,{bold:!0,large:!0,children:"Partition keys"}),(0,_.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,_.jsxs)(Z.ZP,{alignItems:"center",flexWrap:"wrap",children:[!(null!==E&&void 0!==E&&E.length)&&(0,_.jsxs)(C.ZP,{italic:!0,children:["Click the checkbox under the column ",(0,_.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,_.jsx)(O.Z,{mb:1,mr:1,children:(0,_.jsx)(ke.Z,{label:e,onClick:function(){m(D,(function(n){return At(At({},n),{},{partition_keys:(0,Ie.Od)(n.partition_keys||[],(function(n){return n===e}))})}))},primary:!0})},"key_properties/".concat(e))}))]})]})]})]})},Lt=["catalog","pipeline","setErrors","setSelectedStream"];function Ut(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 Ft(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ut(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ut(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Ht,Gt=function(e){var n,t=e.catalog,i=e.pipeline,o=e.setErrors,l=e.setSelectedStream,u=(0,ge.Z)(e,Lt),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,Ie.YC)(d,"stream").map((function(e){return{uuid:e.stream}}))}),[d]),h=(0,f.useMemo)((function(){return(0,Ie.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]),g=(0,f.useMemo)((function(){return(0,Ie.sE)((null===i||void 0===i?void 0:i.blocks)||[],(function(e){var n=e.type;return b.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=z.ZP.blocks.pipelines.detail(k?null===i||void 0===i?void 0:i.uuid:null,k?null===g||void 0===g?void 0:g.uuid:null,{destination_table:j,state_stream:y}),P=Z.data,w=Z.mutate,S=null===P||void 0===P||null===(n=P.block)||void 0===n?void 0:n.bookmarks,E=(0,v.Db)(z.ZP.blocks.pipelines.useUpdate(encodeURIComponent(null===i||void 0===i?void 0:i.uuid),encodeURIComponent(null===g||void 0===g?void 0:g.uuid),{query:{update_state:!0}}),{onSuccess:function(e){return(0,$.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,Ie.sE)(p,(function(e){var n=e.uuid;return s.uuid===n}))||a(p[0]))}),[s,a,p]);var A=(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,_.jsx)(se.cl,{children:(0,_.jsx)(Ze.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,_.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,_.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,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(D.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,_.jsx)(O.Z,{mt:1,children:(0,_.jsx)(se.dE,{children:(0,_.jsx)(Nt,Ft(Ft({},u),{},{bookmarkValues:S,isLoadingUpdateDestinationBlockState:M,stream:m,streams:d,updateDestinationBlockState:T}))})}),d.length>=1&&(0,_.jsx)(O.Z,{mt:1,children:(0,_.jsxs)(se.dE,{children:[(0,_.jsx)(ue.Z,{level:4,children:"Streams Summary"}),(0,_.jsx)(O.Z,{mt:1}),A]})})]})},Wt=t(46732);function Kt(e){return Object.values(e).filter((function(e){return null!==e})).map((function(e){return e.tap_stream_id}))}function zt(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 Yt(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?zt(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):zt(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"}(Ht||(Ht={}));var Vt=45*w.iI,qt=Vt-4*w.iI;var Qt=function(e){var n=e.catalog,t=e.isLoading,i=e.onActionCallback,o=e.streams,r=(0,Ie.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 Yt(Yt({},e),{},{isMissingStream:!0})}))}),[r,o]),c=Yt({},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),g=m[0],b=m[1],j=(0,f.useState)(Ht.ALL),k=j[0],P=j[1],S=(0,f.useRef)(null),E=Kt(a),I=(0,f.useMemo)((function(){var e=o;return e=e.filter((function(e){var n=e.tap_stream_id;return k===Ht.SELECTED?E.includes(n):k!==Ht.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,_.jsxs)(De.Z,{children:[(0,_.jsx)(se.cv,{rounded:!0,children:(0,_.jsx)(C.ZP,{bold:!0,large:!0,children:"Select streams to sync"})}),(0,_.jsx)(se.cv,{padding:1.25*w.iI,children:(0,_.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,_.jsx)(K.Z,{beforeIcon:(0,_.jsx)(Y.HN,{}),compact:!0,noBackground:!0,noBorder:!0,onChange:function(e){return h(e.target.value)},placeholder:"Search",value:v}),(0,_.jsx)(O.Z,{pr:1,children:(0,_.jsx)(Wt.Z,{items:[{label:function(){return Ht.ALL},onClick:function(){return P(Ht.ALL)},uuid:"all_streams"},{label:function(){return Ht.SELECTED},onClick:function(){return P(Ht.SELECTED)},uuid:"selected"},{label:function(){return Ht.NOT_SELECTED},onClick:function(){return P(Ht.NOT_SELECTED)},uuid:"unselected"}],onClickCallback:function(){return b(!1)},onClickOutside:function(){return b(!1)},open:g,parentRef:S,uuid:"SelectStreams/filter",children:(0,_.jsx)(A.ZP,{beforeIcon:(0,_.jsx)(Y.wn,{}),noBackground:!0,onClick:function(){return b((function(e){return!e}))},ref:S,children:(0,_.jsx)(C.ZP,{children:k})})})})]})}),(0,_.jsx)(se.cl,{height:"55vh",hideHorizontalScrollbar:!0,width:"".concat(Vt,"px"),children:(0,_.jsx)(Ze.Z,{borderCollapseSeparate:!0,columnFlex:[1,6],columns:[{label:function(){return(0,_.jsx)(x.Z,{checked:T,onClick:function(){var e=(0,Ie.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,_.jsx)(x.Z,{checked:i,disabled:!i&&n,onClick:function(){d((function(n){return Yt(Yt({},n),{},(0,l.Z)({},t,i?null:e))}))}},"selected-".concat(t)),(0,_.jsxs)(C.ZP,{danger:n,title:t,width:Vt-48-32,children:[t,n?" (no longer available)":""]},"stream-".concat(t))]})),stickyHeader:!0})}),(0,_.jsx)(y.Z,{medium:!0}),(0,_.jsxs)(O.Z,{p:2,children:[(null===E||void 0===E?void 0:E.length)>50&&(0,_.jsx)(O.Z,{pb:2,children:(0,_.jsxs)(C.ZP,{danger:!0,maxWidth:qt,rightAligned:!0,whiteSpaceNormal:!0,children:["WARNING: Selecting too many streams (e.g. >50)",(0,_.jsx)("br",{}),"may cause app performance issues."]})}),0===(null===o||void 0===o?void 0:o.length)&&(0,_.jsx)(O.Z,{pb:2,children:(0,_.jsx)(C.ZP,{bold:!0,maxWidth:qt,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,_.jsx)(Z.ZP,{justifyContent:"flex-end",children:(0,_.jsx)(A.ZP,{loading:t,onClick:function(){return i(a)},primary:!0,children:"Confirm ".concat(Kt(a).length," streams")})})]})]})};function Xt(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 Jt(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Xt(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Xt(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var $t=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,re.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)(),g=m[0],x=m[1],j=(0,v.Db)(z.ZP[n].useCreate(),{onSuccess:function(e){return(0,$.wD)(e,{callback:function(e){var t,i,o=(0,J.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,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(se.$W,{children:(0,_.jsx)(le.Z,{autoHeight:!0,language:b.t6.YAML,onChange:function(e){a(e),o(t.type,t.uuid,(0,re.Pz)(Jt(Jt({},i),{},{config:(0,re.Qc)(e)})))},tabSize:2,value:s||void 0,width:"100%"})}),(0,_.jsxs)(O.Z,{mt:1,children:[(0,_.jsxs)(Z.ZP,{alignItems:"center",children:[(0,_.jsx)(A.ZP,{onClick:function(){k((0,l.Z)({},(0,J.C5)(n),{action_type:"test_connection",config:s,pipeline_uuid:u.uuid})),x(null)},small:!0,success:!0,children:"Test connection"}),(0,_.jsx)(O.Z,{ml:1,children:P?(0,_.jsx)(W.Z,{color:"white",small:!0}):(0,_.jsxs)(_.Fragment,{children:[p&&(0,_.jsx)(C.ZP,{small:!0,success:!0,children:"Connected successfully!"}),!1===p&&(0,_.jsx)(C.ZP,{small:!0,warning:!0,children:"Failed to connect, see error below."})]})})]}),g&&(0,_.jsx)(O.Z,{mt:1,children:(0,_.jsx)(C.ZP,{small:!0,warning:!0,children:g})})]})]}):null},ei=t(85385);function ni(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 ti(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ni(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ni(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ii=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,g=e.savePipelineContent,x=e.setErrors,j=e.setIntegrationStreams,y=e.setOutputBlocks,k=e.setSelectedBlock,S=e.setSelectedOutputBlock,E=e.setSelectedStream,I=(0,f.useState)(!0),T=I[0],M=I[1],D=(0,f.useState)(!0),R=D[0],B=D[1],N=(0,f.useState)(!0),L=N[0],U=N[1],F=(0,f.useState)(""),H=F[0],K=F[1],V=z.ZP.integration_sources.list({},{revalidateOnFocus:!1}).data,q=(0,f.useMemo)((function(){return(null===V||void 0===V?void 0:V.integration_sources)||[]}),[V]),Q=(0,f.useMemo)((function(){return(0,Ie.HK)(q,(function(e){return e.uuid}))}),[q]),X=z.ZP.integration_destinations.list({},{revalidateOnFocus:!1}).data,J=(0,f.useMemo)((function(){return(null===X||void 0===X?void 0:X.integration_destinations)||[]}),[X]),ee=(0,f.useMemo)((function(){return(0,Ie.HK)(J,(function(e){return e.uuid}))}),[J]),ne=(0,f.useMemo)((function(){return(0,Ie.sE)(l,(function(e){var n=e.type;return b.tf.DATA_LOADER===n}))}),[l]),te=(0,f.useMemo)((function(){return ne?(0,re.Qc)(ne.content):{}}),[ne]);(0,f.useEffect)((function(){var e;null!==te&&void 0!==te&&te.source&&K(null===(e=Q[te.source])||void 0===e?void 0:e.docs)}),[Q,te]);var ie=(0,f.useMemo)((function(){return(0,_.jsx)($t,{api:"integration_sources",block:ne,blockContent:te,onChangeCodeBlock:p,pipeline:m})}),[ne,te,p,m]),oe=(0,f.useMemo)((function(){return(0,Ie.sE)(l,(function(e){var n=e.type;return b.tf.DATA_EXPORTER===n}))}),[l]),le=(0,f.useMemo)((function(){return oe?(0,re.Qc)(oe.content):{}}),[oe]),ce=(0,f.useMemo)((function(){return(0,_.jsx)($t,{api:"integration_destinations",block:oe,blockContent:le,onChangeCodeBlock:p,pipeline:m})}),[oe,le,p,m]),ae=(0,f.useMemo)((function(){return(0,Ie.sE)(l,(function(e){var n=e.type;return b.tf.TRANSFORMER===n}))}),[l]),de=(0,f.useMemo)((function(){var e;return(0,je.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,lt.Z)(de);(0,f.useEffect)((function(){!ve&&de&&(y((function(){return S(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 me=(0,f.useState)(),ge=me[0],be=me[1],xe=(0,v.Db)(z.ZP.integration_sources.useCreate(),{onSuccess:function(e){return(0,$.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 S(ne),[ne]})),t.length>0&&E(t[0]),j((function(e){var n=(e||[]).concat(t);return Array.from(new Set(n)).sort()})),h(ei.cH.DATA),a()}else be(null===n||void 0===n?void 0:n.error_message)},onErrorCallback:function(e,n){return x({errors:n,response:e})}})}}),ye=(0,r.Z)(xe,2),ke=ye[0],Oe=ye[1].isLoading,we=(0,v.Db)(z.ZP.integration_sources.useUpdate(null===m||void 0===m?void 0:m.uuid),{onSuccess:function(e){return(0,$.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(Ce.ks.UNSUPPORTED!==i.inclusion){var o;if(e.replication_method||(e.replication_method=Ce._B.FULL_TABLE),e.unique_conflict_method||(e.unique_conflict_method=Ce.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]=ti(ti({},n),{},{metadata:ti(ti({},i),{},{selected:!0})})}}))}));var u={streams:o.concat(l)};j(Ye.map((function(e){return e.tap_stream_id})));var a=null===te||void 0===te?void 0:te.catalog;(0,je.Qr)(a)||p(ne.type,ne.uuid,(0,re.Pz)(ti(ti({},te),{},{catalog:{}})));var d={pipeline:ti(ti({},m),{},{data_integration:ti(ti({},(null===m||void 0===m?void 0:m.data_integration)||{}),{},{catalog:u})})};g(d).then((function(){s(),c()}))},onErrorCallback:function(e,n){return x({errors:n,response:e})}})}}),Se=(0,r.Z)(we,2),_e=Se[0],Ee=Se[1].isLoading,Te=(0,f.useState)(null),Me=Te[0],Ae=Te[1],De=(0,v.Db)(z.ZP.integration_source_streams.useUpdate(null===m||void 0===m?void 0:m.uuid),{onSuccess:function(e){return(0,$.wD)(e,{callback:function(e){Ae(e.integration_source_stream)},onErrorCallback:function(e,n){return x({errors:n,response:e})}})}}),Re=(0,r.Z)(De,2),Be=Re[0],Ne=Re[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=ti(ti({},de),{},{streams:o.concat(n(i))}),l=null===te||void 0===te?void 0:te.catalog;(0,je.Qr)(l)||p(ne.type,ne.uuid,(0,re.Pz)(ti(ti({},te),{},{catalog:{}})));var u={pipeline:ti(ti({},m),{},{data_integration:ti(ti({},(null===m||void 0===m?void 0:m.data_integration)||{}),{},{catalog:r})})};g(u).then((function(){return s()}))}),[de,ne,te,s,p,m,g]),Ue=(0,f.useCallback)((function(e){if(null!==de&&void 0!==de&&de.streams){var n=ti(ti({},de),{},{streams:de.streams.map((function(n){return e(n)}))}),t=null===te||void 0===te?void 0:te.catalog;(0,je.Qr)(t)||p(ne.type,ne.uuid,(0,re.Pz)(ti(ti({},te),{},{catalog:{}})));var i={pipeline:ti(ti({},m),{},{data_integration:ti(ti({},(null===m||void 0===m?void 0:m.data_integration)||{}),{},{catalog:n})})};g(i).then((function(){return s()}))}}),[de,ne,te,s,p,m,g]),Fe=(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=ti(ti({},r),t)}})),e}))}),[Le]),Ge=(0,v.Db)(z.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,$.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})}})}}),We=(0,r.Z)(Ge,1)[0],Ke=(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,_.jsx)(C.ZP,{monospace:!0,children:t},"variable-uuid-".concat(t)),(0,_.jsx)(C.ZP,{monospace:!0,children:i},"variable-uuid-".concat(t,"-{value}")),(0,_.jsx)(C.ZP,{monospace:!0,children:o},"variable-uuid-".concat(t,"-{value}-code")),(0,_.jsx)(Tt.Z,{copiedText:o,monospace:!0,withCopyIcon:!0},"variable-uuid-".concat(t,"-{value}-code-copy"))])}))})),(0,_.jsx)(Ze.Z,{alignTop:!0,columnFlex:[null,null,1],columns:[{uuid:"Key"},{uuid:"Value"},{uuid:"Code"}],rows:e})}),[d]),ze=(0,f.useCallback)((function(e){return(0,_.jsxs)(O.Z,{mt:2,children:[(0,_.jsxs)(C.ZP,{default:!0,children:["Use the following variables to interpolate sensitive or dynamic information into the configuration.",(0,_.jsx)("br",{}),"You can also access values from your environment variables by using the following syntax: ",(0,_.jsx)(C.ZP,{inline:!0,monospace:!0,children:"\"{{ env_var('MY_ENV_VARIABLE_NAME') }}\""}),(0,_.jsx)("br",{}),"For more information, check out the ",(0,_.jsx)(P.Z,{href:e,openNewWindow:!0,primary:!0,children:"documentation"}),"."]}),(0,_.jsx)(O.Z,{mt:1,children:Ke})]})}),[Ke]),Ye=(0,f.useMemo)((function(){return(null===Me||void 0===Me?void 0:Me.streams)||[]}),[Me]),Ve=(0,st.dd)((function(){return(0,_.jsx)(Qt,{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)_e({integration_source:{streams:n}}),Xe();else{var t=null===te||void 0===te?void 0:te.catalog;(0,je.Qr)(t)||p(ne.type,ne.uuid,(0,re.Pz)(ti(ti({},te),{},{catalog:{}}))),g({pipeline:ti(ti({},m),{},{data_integration:ti(ti({},(null===m||void 0===m?void 0:m.data_integration)||{}),{},{catalog:null})})}).then((function(){return s()})),Xe()}},streams:Ye})}),{},[de,ne,te,s,Ee,p,g,Ye],{background:!0,uuid:"select_streams"}),qe=(0,r.Z)(Ve,2),Qe=qe[0],Xe=qe[1];return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(O.Z,{mb:1,children:(0,_.jsxs)(Z.ZP,{alignItems:"center",children:[(0,_.jsx)(A.ZP,{iconOnly:!0,onClick:function(){return B((function(e){return!e}))},children:(0,_.jsxs)(_.Fragment,{children:[R&&(0,_.jsx)(Y.Kh,{size:1.5*w.iI}),!R&&(0,_.jsx)(Y._M,{size:1.5*w.iI})]})}),(0,_.jsx)(O.Z,{mr:1}),(0,_.jsxs)(Z.ZP,{alignItems:"center",children:[(0,_.jsx)(ue.Z,{children:"Source"}),!R&&(0,_.jsxs)(ue.Z,{default:!0,inline:!0,children:["\xa0",null===(t=Q[null===te||void 0===te?void 0:te.source])||void 0===t?void 0:t.name]})]})]})}),R&&(0,_.jsxs)(O.Z,{mb:5,children:[(0,_.jsxs)(se.dE,{children:[(0,_.jsxs)(O.Z,{mb:5,children:[(0,_.jsx)(ue.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Select source"}),(null===q||void 0===q?void 0:q.length)>0?(0,_.jsxs)(G.Z,{onChange:function(e){var n,t,i,r=e.target.value;if(r){K(null===(n=Q[r])||void 0===n?void 0:n.docs);var l=null===(t=Q[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,re.Pz)(ti(ti({},te),{},{catalog:{},config:l,source:r}))):o({content:(0,re.Pz)({config:l,source:r}),language:b.t6.YAML,type:b.tf.DATA_LOADER},0,k),Ae(null),g().then((function(){s()}))}},primary:!0,value:null===te||void 0===te?void 0:te.source,children:[(0,_.jsx)("option",{value:""}),q.map((function(e){var n=e.name,t=e.uuid;return(0,_.jsx)("option",{value:t,children:n},t)}))]}):(0,_.jsxs)(Z.ZP,{alignItems:"center",children:[(0,_.jsx)(W.Z,{inverted:!0}),(0,_.jsx)(O.Z,{ml:1}),(0,_.jsx)(ue.Z,{level:5,primary:!0,children:"Loading sources..."})]})]}),ne&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(O.Z,{mb:5,children:[(0,_.jsx)(ue.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Configuration"}),(null===te||void 0===te?void 0:te.source)&&H&&(0,_.jsxs)(O.Z,{mb:2,children:[(0,_.jsx)(Et.Z,{children:(0,_.jsx)(It.Z,{title:"Documentation: ".concat(te.source),children:(0,_.jsx)(se.zG,{children:(0,_.jsx)(he.Z,{children:H.replace(/\<br \/\>/g,"\n\n")})})})}),ze("https://docs.mage.ai/guides/data-integration-pipeline#configure-source")]}),ie]}),(0,_.jsxs)("div",{children:[(0,_.jsx)(ue.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Select stream"}),(0,_.jsx)(A.ZP,{loading:Ne,onClick:function(){g().then((function(){Be().then((function(){return Qe()})),s()}))},primary:!0,small:!0,children:"View and select streams"})]}),ge&&(0,_.jsx)(C.ZP,{warning:!0,children:ge})]})]}),Ee&&(0,_.jsx)(O.Z,{p:2,children:(0,_.jsx)(W.Z,{})}),!Ee&&(0,_.jsx)(O.Z,{mt:3,children:(0,_.jsx)(Gt,{catalog:de,destination:null===le||void 0===le?void 0:le.destination,isLoadingLoadSampleData:Oe,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:Ue,updateMetadataForColumns:He,updateSchemaProperty:Fe,updateStream:Le})})]}),(0,_.jsx)(O.Z,{mb:1,children:(0,_.jsxs)(Z.ZP,{alignItems:"center",children:[(0,_.jsx)(A.ZP,{disabled:!ne,iconOnly:!0,onClick:function(){return U((function(e){return!e}))},children:(0,_.jsxs)(_.Fragment,{children:[L&&ne&&(0,_.jsx)(Y.Kh,{size:1.5*w.iI}),(!L||!ne)&&(0,_.jsx)(Y._M,{disabled:!ne,size:1.5*w.iI})]})}),(0,_.jsx)(O.Z,{mr:1}),(0,_.jsx)(Z.ZP,{alignItems:"center",children:(0,_.jsx)(ue.Z,{children:"Transformers"})})]})}),L&&ne&&(0,_.jsx)(O.Z,{mb:5,children:(0,_.jsxs)(se.dE,{children:[u.length>0&&(0,_.jsx)(O.Z,{mb:1,children:u.map((function(e,n){return(0,_.jsx)(O.Z,{mb:1,children:e},n)}))}),(0,_.jsx)(O.Z,{mt:1,children:(0,_.jsx)(bt.Z,{addNewBlock:function(e){var n=e.content,t=e.configuration,i=[];return ne&&i.push(ne.uuid),o(ti(ti({},e),{},{configuration:t,content:n,upstream_blocks:i}),l.length-1,(function(e){oe&&(We({block:ti(ti({},oe),{},{upstream_blocks:[e.uuid]})}),k(e))}))},compact:!0,hideCustom:!0,hideDataExporter:!0,hideDataLoader:!0,hideDbt:!0,hideMarkdown:!0,hideScratchpad:!0,hideSensor:!0,hideTransformer:!!ae,hideTransformerDataSources:!0,pipeline:m})})]})}),(0,_.jsx)(O.Z,{mb:1,children:(0,_.jsxs)(Z.ZP,{alignItems:"center",children:[(0,_.jsx)(A.ZP,{disabled:!ne,iconOnly:!0,onClick:function(){return M((function(e){return!e}))},children:(0,_.jsxs)(_.Fragment,{children:[T&&ne&&(0,_.jsx)(Y.Kh,{size:1.5*w.iI}),(!T||!ne)&&(0,_.jsx)(Y._M,{disabled:!ne,size:1.5*w.iI})]})}),(0,_.jsx)(O.Z,{mr:1}),(0,_.jsxs)(Z.ZP,{alignItems:"center",children:[(0,_.jsx)(ue.Z,{children:"Destination"}),!T&&(0,_.jsxs)(ue.Z,{default:!0,inline:!0,children:["\xa0",null===(i=ee[null===le||void 0===le?void 0:le.destination])||void 0===i?void 0:i.name]})]})]})}),T&&ne&&(0,_.jsxs)(se.dE,{children:[(0,_.jsxs)(O.Z,{mb:5,children:[(0,_.jsx)(ue.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Select destination"}),(null===J||void 0===J?void 0:J.length)>0?(0,_.jsxs)(G.Z,{onChange:function(e){var n=e.target.value;if(n){if(oe)p(oe.type,oe.uuid,(0,re.Pz)(ti(ti({},le),{},{destination:n})));else{var t,i,r=null===(t=ee[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,re.Pz)({config:r,destination:n}),language:b.t6.YAML,type:b.tf.DATA_EXPORTER,upstream_blocks:u},1,k)}g().then((function(){s()}))}},primary:!0,value:null===le||void 0===le?void 0:le.destination,children:[(0,_.jsx)("option",{value:""}),J.map((function(e){var n=e.name,t=e.uuid;return(0,_.jsx)("option",{value:t,children:n},t)}))]}):(0,_.jsxs)(Z.ZP,{alignItems:"center",children:[(0,_.jsx)(W.Z,{inverted:!0}),(0,_.jsx)(O.Z,{ml:1}),(0,_.jsx)(ue.Z,{level:5,primary:!0,children:"Loading destinations..."})]})]}),oe&&(0,_.jsxs)(O.Z,{mb:5,children:[(0,_.jsx)(ue.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Configuration"}),(null===le||void 0===le?void 0:le.destination)&&(0,_.jsx)(_.Fragment,{children:(0,_.jsxs)(O.Z,{mb:2,children:[(0,_.jsxs)(C.ZP,{default:!0,children:["For more information on how to configure this destination, read the ",(0,_.jsxs)(P.Z,{href:"https://github.com/mage-ai/mage-ai/blob/master/mage_integrations/mage_integrations/destinations/".concat(le.destination,"/README.md"),openNewWindow:!0,primary:!0,children:[le.destination," documentation"]}),".",(0,_.jsx)("br",{}),(0,_.jsx)("br",{}),"If your configuration contains a key named ",(0,_.jsx)(C.ZP,{inline:!0,monospace:!0,children:"table"}),", it\u2019s optional.",(0,_.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,_.jsx)(C.ZP,{bold:!0,inline:!0,children:"Table name"})," in a previous section."]}),ze("https://docs.mage.ai/guides/data-integration-pipeline#configure-destination")]})}),ce,(0,_.jsx)(O.Z,{mt:3,children:(0,_.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,_.jsxs)(O.Z,{mr:2,children:[(0,_.jsx)(C.ZP,{bold:!0,large:!0,children:"Automatically add new fields"}),(0,_.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,_.jsx)(Pe.Z,{checked:!!pe,disabled:!(null!==de&&void 0!==de&&de.streams),onCheck:function(){return Ue((function(e){return ti(ti({},e),{},{auto_add_new_fields:!pe})}))}})]})}),(0,_.jsx)(O.Z,{mt:3,children:(0,_.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,_.jsxs)(O.Z,{mr:2,children:[(0,_.jsx)(C.ZP,{bold:!0,large:!0,children:"Disable column type check"}),(0,_.jsxs)(C.ZP,{default:!0,children:["By default, the value for each column is validated according to the schema property for that column.",(0,_.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,_.jsx)("br",{}),"Turn this toggle on if you want to disable this strict type checking."]})]}),(0,_.jsx)(Pe.Z,{checked:!!fe,disabled:!(null!==de&&void 0!==de&&de.streams),onCheck:function(){return Ue((function(e){return ti(ti({},e),{},{disable_column_type_check:!fe})}))}})]})})]})]})]})},oi=t(82359),ri=t(19698),li=t(97133),ui=t(35058),ci=t(38399),si=t(33834),ai=t(42041);function di(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 pi(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?di(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):di(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var fi=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,g=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,A=e.hiddenBlocks,D=e.interactionsMapping,N=e.interruptKernel,U=e.mainContainerRef,F=e.mainContainerWidth,G=e.messages,W=e.onChangeCallbackBlock,K=e.onChangeCodeBlock,Y=e.openSidekickView,V=e.pipeline,q=e.pipelineContentTouched,Q=e.project,X=e.restartKernel,ee=e.runBlock,ne=e.runningBlocks,te=void 0===ne?[]:ne,ie=e.savePipelineContent,oe=e.scrollTogether,re=e.selectedBlock,le=e.setAnyInputFocused,ue=e.setDisableShortcuts,ce=e.setEditingBlock,se=e.setErrors,ae=e.setHiddenBlocks,de=e.setIntegrationStreams,pe=e.setOutputBlocks,fe=e.setPipelineContentTouched,ve=e.setSelectedBlock,he=e.setSelectedOutputBlock,me=e.setSelectedStream,ge=e.setTextareaFocused,be=e.showBrowseTemplates,xe=e.showConfigureProjectModal,ye=e.showDataIntegrationModal,ke=e.showGlobalDataProducts,Ze=e.showUpdateBlockModal,Pe=e.sideBySideEnabled,Oe=e.textareaFocused,Ce=e.widgets,we=(0,ri.Z)().status,Se=(0,f.useRef)(null),_e=(0,f.useRef)(null),Ee=(0,f.useRef)({}),Te=(0,f.useState)(!1),Me=Te[0],Ae=Te[1],De=(0,f.useState)(!1),Re=De[0],Be=De[1],Ne=(0,f.useState)(!1),Le=Ne[0],Ue=Ne[1],Fe=(0,f.useState)(!0),He=Fe[0],Ge=Fe[1],We=(0,f.useState)(null),Ke=We[0],ze=We[1],Ye=(0,f.useState)(null),Ve=Ye[0],qe=Ye[1],Qe=(0,f.useState)(!1),Xe=Qe[0],Je=Qe[1],$e=(0,f.useState)(""),en=$e[0],nn=$e[1],tn=(0,f.useState)({height:null,width:null,x:null,y:null}),on=tn[0],rn=tn[1],ln=(0,f.useMemo)((function(){return H.qL.INTEGRATION===(null===V||void 0===V?void 0:V.type)}),[V]),un=(0,f.useMemo)((function(){return H.qL.STREAMING===(null===V||void 0===V?void 0:V.type)}),[V]),cn=(0,f.useMemo)((function(){return g.filter((function(e){var n=e.type;return!ln||b.tf.TRANSFORMER===n}))}),[g,ln]),sn=(0,f.useState)({}),an=(sn[0],sn[1]),dn=(0,Zn.i)(),pn=dn.height,fn=dn.width;(0,f.useEffect)((function(){var e;null!==U&&void 0!==U&&U.current&&rn(null===U||void 0===U||null===(e=U.current)||void 0===e?void 0:e.getBoundingClientRect())}),[i,d,U,F,rn,pn,fn]);var vn=(0,f.useMemo)((function(){return te.reduce((function(e,n,t){return pi(pi({},e),{},(0,l.Z)({},n.uuid,pi(pi({},n),{},{priority:t})))}),{})}),[te]),hn=(0,f.useState)(null),mn=hn[0],gn=hn[1],bn=(0,f.useMemo)((function(){return(0,_.jsx)(Ct,{blocks:cn,columnIndex:0,columns:2,disabled:oe,eventNameRefsMapping:(0,l.Z)({},xt.$e,h),invisible:!(null!==g&&void 0!==g&&g.length)||!mn||oe,mainContainerRect:on,scrollTogether:oe,setCursorHeight:gn})}),[h,cn,mn,on,oe,gn]),xn=(0,f.useState)(null),jn=xn[0],yn=xn[1],kn=(0,f.useMemo)((function(){return(0,_.jsx)(Ct,{blocks:cn,columnIndex:1,columns:2,disabled:oe,eventNameRefsMapping:(0,l.Z)({},xt.tK,Ee),invisible:!(null!==g&&void 0!==g&&g.length)||!jn||oe,mainContainerRect:on,rightAligned:!0,scrollTogether:oe,setCursorHeight:yn})}),[Ee,cn,jn,on,oe,yn]),Pn=(0,f.useState)(null),On=Pn[0],Cn=Pn[1],wn=(0,f.useMemo)((function(){var e;return(0,_.jsx)(Ct,{blocks:cn,columnIndex:2,columns:1,disabled:!oe,eventNameRefsMapping:(e={},(0,l.Z)(e,xt.tK,Ee),(0,l.Z)(e,xt.$e,h),e),invisible:!(null!==g&&void 0!==g&&g.length)||!On||!oe,mainContainerRect:on,rightAligned:!0,scrollTogether:oe,setCursorHeight:Cn})}),[Ee,h,cn,On,on,oe,Cn]),_n=(0,lt.Z)(re),En=(0,f.useMemo)((function(){return g.length}),[g]),In=(0,f.useMemo)((function(){var e;return H.qL.PYTHON===(null===V||void 0===V?void 0:V.type)&&(null===Q||void 0===Q||null===(e=Q.features)||void 0===e?void 0:e[oi.d.ADD_NEW_BLOCK_V2])}),[V,Q]),Mn=z.ZP.block_templates.list({show_all:!!In},{revalidateOnFocus:!1}).data,Dn=(0,f.useMemo)((function(){return(null===Mn||void 0===Mn?void 0:Mn.block_templates)||[]}),[Mn]),Rn=(0,f.useCallback)((function(e,t){var i=g[g.length-1],o=null,r=e.configuration||{},l=i?(0,Zt.eY)(i,e):[];i&&([b.tf.DATA_LOADER,b.tf.TRANSFORMER].includes(i.type)&&b.tf.SCRATCHPAD===e.type&&(o="from mage_ai.data_preparation.variable_manager import get_variable\n\n\ndf = get_variable('".concat(V.uuid,"', '").concat(i.uuid,"', 'output_0')\n")),b.t6.SQL===i.language&&(r=pi(pi({},(0,je.GL)(i.configuration,[ui.cH,ui.Sv,ui.sc,ui.BD,ui.nq])),r))),b.t6.SQL===e.language&&(o=(0,ci.SF)(o)),o=(0,ci.X7)(e,o);var u=null!==t?t:En;n(pi(pi({},e),{},{configuration:r,content:o,upstream_blocks:l}),u,ve),ge(!0)}),[n,g,En,V,ve,ge]),Bn="PipelineDetail/index",Nn=(0,An.y)(),Ln=Nn.disableGlobalKeyboardShortcuts,Fn=Nn.registerOnKeyDown,Hn=Nn.unregisterOnKeyDown;(0,f.useEffect)((function(){return function(){Hn(Bn)}}),[Hn,Bn]),Fn(Bn,(function(e,n,t){if(q&&(0,ai.y)([Tn.zX,Tn.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&&!Ln)if((0,ai.y)([Tn.zX,Tn.Um],n)||(0,ai.y)([Tn.PQ,Tn.Um],n))e.preventDefault(),ie();else if((0,ai.y)([Tn.zH],n)||(0,ai.y)([Tn.Fv],n)){if(re&&!e.repeat&&!(0,si.cK)(e)){var i=g.findIndex((function(e){var n=e.uuid;return re.uuid===n}));if(-1!==i){var o=(0,ai.y)([Tn.zH],n)?i:i+1;Rn({type:b.tf.SCRATCHPAD},o)}}}else if(Oe)n[Tn.vP]?ge(!1):q||Tn.Z1.find((function(e){return n[e]}))||fe(!0);else if(!ln){var r;if(In&&((0,ai.y)([Tn.zX,Tn.A1],n)||(0,ai.y)([Tn.PQ,Tn.A1],n)))e.preventDefault(),Be(!0),null===_e||void 0===_e||null===(r=_e.current)||void 0===r||r.focus();else if(In&&Re&&(0,ai.y)([Tn.vP],n)){var l;e.preventDefault(),Be(!1),null===_e||void 0===_e||null===(l=_e.current)||void 0===l||l.blur()}else if(re){var u=g.findIndex((function(e){var n=e.uuid;return re.uuid===n}));if(n[Tn.vP])ve(null);else if(t[0]===Tn.xD&&t[1]===Tn.xD)N();else if(t[0]===Tn.l1&&t[1]===Tn.l1&&-1!==u)y(re).then((function(e){null!==e&&void 0!==e&&e.error||setTimeout((function(){u===g.length-1?ve(g[u-1]):g.length>=0?ve(g[u+1]):ve(null)}),100)}));else if(n[Tn.Bu]&&u>=1){var c=g[u-1];if(c){var a,d;ve(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[Tn.kD]&&u<=En-2){var f=g[u+1];if(f){var v,m;ve(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,ai.y)([Tn.Uq],n)&&ge(!0)}else _n&&n[Tn.Uq]&&ve(_n);s||t[0]!==Tn.OC||t[1]!==Tn.OC||X()}}),[n,s,h.current,g,Re,N,ln,En,q,X,ie,_e,re,_n,fe,ve,ge,Oe,In]),(0,f.useEffect)((function(){var e=setInterval((function(){q&&ie()}),1e4);return function(){clearInterval(e)}}),[q,ie]),(0,f.useEffect)((function(){setTimeout((function(){return Ue(!0)}),2*li.zn)}),[V]);var Gn=(0,v.Db)((function(e){var n=e.block,t=e.upstreamBlocks;return z.ZP.blocks.pipelines.useUpdate(encodeURIComponent(null===V||void 0===V?void 0:V.uuid),encodeURIComponent(null===n||void 0===n?void 0:n.uuid))({block:{upstream_blocks:t}})}),{onSuccess:function(e){return(0,$.wD)(e,{callback:function(){E()},onErrorCallback:function(e,n){return null===se||void 0===se?void 0:se({errors:n,response:e})}})}}),Wn=(0,r.Z)(Gn,1)[0],Kn=(0,f.useCallback)((function(e){Ae(!0),qe(e),ue(!0)}),[Ae,ue,qe]),zn=(0,f.useCallback)((function(){Ae(!1),Je(!1),nn(""),ue(!1)}),[ue]),Yn=(0,f.useCallback)((function(e,n){var t,i;g.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,Ie.oM)(g,i);return o=(0,Ie.Hk)(n,Math.max(t,0),o),ie({pipeline:{blocks:o,uuid:null===V||void 0===V?void 0:V.uuid}})}),[g,V,ie]),Vn=(0,f.useMemo)((function(){return V&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(bt.Z,{addNewBlock:Rn,blockTemplates:Dn,focusedAddNewBlockSearch:Re,hideCustom:ln||un,hideDataExporter:ln,hideDataLoader:ln,hideDbt:ln||un,hideScratchpad:ln,hideSensor:ln,onClickAddSingleDBTModel:Kn,pipeline:V,project:Q,searchTextInputRef:_e,setCreatingNewDBTModel:Je,setFocusedAddNewBlockSearch:Be,showBrowseTemplates:be,showConfigureProjectModal:xe,showGlobalDataProducts:ke}),!In&&!ln&&!un&&(0,_.jsx)(O.Z,{mt:1,children:(0,_.jsxs)(C.ZP,{muted:!0,small:!0,children:["Want to try the new add block UI?",(0,_.jsx)("br",{}),"Turn on the feature named ",(0,_.jsx)(C.ZP,{bold:!0,inline:!0,muted:!0,small:!0,children:oi.d.ADD_NEW_BLOCK_V2})," in your ",(0,_.jsx)(mt(),{href:"/settings/workspace/preferences",passHref:!0,children:(0,_.jsx)(P.Z,{muted:!0,underline:!0,children:(0,_.jsx)(C.ZP,{bold:!0,inline:!0,muted:!0,small:!0,children:"project settings"})})}),"."]})})]})}),[Rn,Dn,Re,ln,un,Kn,V,Q,_e,Be,be,xe,ke,In]),qn=(0,f.useMemo)((function(){var e=[],i=(null===cn||void 0===cn?void 0:cn.length)||0;return cn.forEach((function(r,l){var s,d=l===i-1,v=r.type,m=r.uuid,P=(null===re||void 0===re?void 0:re.uuid)===m,O=vn[m],C=O?0===O.priority?ft.uF.BUSY:ft.uF.QUEUED:ft.uF.IDLE,w=(0,kt.zv)({type:v,uuid:m});Ee.current[w]=(0,f.createRef)(),h.current[w]=(0,f.createRef)();var I=v===b.tf.MARKDOWN,M=v===b.tf.TRANSFORMER,R=!(null===A||void 0===A||!A[m]),B=l===En-1||ln,H=Ee.current[w],z=h.current[w],q=m,X=null===x||void 0===x||null===(s=x[v])||void 0===s?void 0:s[m];X&&(q="".concat(q,":").concat(X)),e.push((0,_.jsx)(L.Z,{addNewBlock:function(e,t){ge(!0);return n(e,Pe?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)||[];Wn({block:{uuid:r},upstreamBlocks:[e.uuid].concat((0,o.Z)(l))})}null===ve||void 0===ve||ve(e)}))},addNewBlockMenuOpenIdx:Ke,addWidget:t,allBlocks:u,allowCodeBlockShortcuts:c,autocompleteItems:a,block:r,blockIdx:l,blockInteractions:null===p||void 0===p?void 0:p[m],blockOutputRef:H,blockRefs:h,blockTemplates:Dn,blocks:g,containerRef:Se,cursorHeight1:mn,cursorHeight2:jn,cursorHeight3:On,dataProviders:j,defaultValue:r.content,deleteBlock:function(e){y(e),le(!1)},disableShortcuts:k,executionState:C,fetchFileTree:Z,fetchPipeline:E,globalDataProducts:T,hideRunButton:un||I||ln&&M,interactionsMapping:D,interruptKernel:N,isHidden:R,mainContainerRect:on,mainContainerRef:U,mainContainerWidth:F,messages:G[m],noDivider:B,onCallbackChange:function(e){return W(v,m,e)},onChange:function(e){return K(v,m,e)},onClickAddSingleDBTModel:Kn,onDrop:Yn,openSidekickView:Y,pipeline:V,project:Q,ref:z,runBlock:ee,runningBlocks:te,savePipelineContent:ie,scrollTogether:oe,selected:P,setAddNewBlockMenuOpenIdx:ze,setAnyInputFocused:le,setCreatingNewDBTModel:Je,setEditingBlock:ce,setErrors:se,setHiddenBlocks:ae,setMountedBlocks:an,setOutputBlocks:pe,setSelected:function(e){return ve(!0===e?r:null)},setSelectedBlock:ve,setSelectedOutputBlock:he,setTextareaFocused:ge,showBrowseTemplates:be,showConfigureProjectModal:xe,showDataIntegrationModal:ye,showGlobalDataProducts:ke,showUpdateBlockModal:Ze,sideBySideEnabled:Pe,textareaFocused:P&&Oe,widgets:Ce,windowWidth:fn,children:Pe&&d&&(0,_.jsx)("div",{style:{paddingBottom:S.WC,paddingTop:S.WC},children:Vn})},q))})),e}),[n,Ke,Vn,t,u,c,a,p,Ee,h,Dn,g,cn,x,Se,mn,jn,On,j,y,k,Z,E,T,A,D,N,ln,un,on,U,F,G,En,W,K,Kn,Yn,Y,V,Q,ee,te,vn,ie,oe,re,ze,le,ce,se,ae,an,pe,ve,he,ge,be,xe,ye,ke,Ze,Pe,Oe,Wn,Ce,fn]),Qn=(0,f.useMemo)((function(){return(0,_.jsx)(ii,{addNewBlockAtIndex:n,blocks:g,codeBlocks:qn,fetchFileTree:Z,fetchPipeline:E,fetchSampleData:I,globalVariables:M,onChangeCodeBlock:K,openSidekickView:Y,pipeline:V,savePipelineContent:ie,setErrors:se,setIntegrationStreams:de,setOutputBlocks:pe,setSelectedBlock:ve,setSelectedOutputBlock:he,setSelectedStream:me})}),[n,g,qn,Z,E,I,M,K,Y,V,ie,se,de,pe,ve,he,me]),Xn=(0,f.useCallback)((function(e){var t,i,o="".concat(null===we||void 0===we?void 0:we.repo_path_relative_root).concat(vt.sep).concat(Un.aZ.DBT).concat(vt.sep),r=e;null!==(t=r)&&void 0!==t&&t.startsWith(o)&&(r=null===(i=r)||void 0===i?void 0:i.replace(o,""));if(Xe){var l=(0,J.RA)(en||(0,J.Y6)()),u=".".concat(Un.Lu.SQL);l.endsWith(u)&&(l=l.slice(0,-4)),r="".concat(e).concat(vt.sep).concat(l,".").concat(Un.Lu.SQL)}var c={configuration:{file_path:r,file_source:{path:e},limit:L.z},language:b.t6.SQL,name:(0,J.wE)(r),type:b.tf.DBT};Xe&&(c.content="--Docs: https://docs.mage.ai/dbt/sources\n");var s="undefined"===typeof Ve||null===Ve,a=g[s?g.length-1:Ve],d=a?(0,Zt.eY)(a,c):[];n(pi(pi({},c),{},{upstream_blocks:d}),(s?En:Ve+1)-(Pe?1:0),ve),zn(),ge(!0)}),[n,g,zn,Xe,en,Ve,En,ve,ge,Pe,we]);return(0,_.jsxs)(R.W,{backend:B.PD,children:[(0,_.jsx)(li.lO,{ref:Se,children:He&&(0,_.jsx)(gt.Z,{classNames:"pipeline-detail",in:Le,onEntered:function(){return setTimeout((function(){return Ge(!1)}),li.zn)},timeout:1,children:(0,_.jsx)(li.fm,{})})}),ln&&(0,_.jsx)(O.Z,{mt:1,px:w.cd,children:Qn}),!Pe&&(0,_.jsx)(O.Z,{mt:1,px:w.cd,children:!ln&&(0,_.jsxs)(_.Fragment,{children:[qn,(0,_.jsx)(O.Z,{mt:w.cd,children:Vn})]})}),Pe&&(0,_.jsxs)("div",{style:{position:"relative"},children:[bn,qn,kn,wn,!(null!==g&&void 0!==g&&g.length)&&(0,_.jsx)(O.Z,{p:w.cd,children:Vn})]}),Me&&(0,_.jsx)(Sn.Z,{onClickOutside:zn,open:!0,children:(0,_.jsx)(_t,{blocks:g,dbtModelName:en,onClose:zn,onOpenFile:Xn,onSelectBlockFile:function(e,n,t,i){var o=i.path;return Xn(o)},setDbtModelName:nn})})]})},vi=t(82555),hi=t(31557),mi=t(2842);function gi(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 bi(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?gi(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):gi(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var xi=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,g=e.children,b=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,S=e.setBeforeHidden,E=e.setErrors,I=e.setMainContainerWidth,T=(0,Zn.i)().width,M=(0,f.useState)((0,kn.U2)(kn.L8,mi.Zt)),A=M[0],D=M[1],R=(0,f.useState)((0,kn.U2)(kn.J3,mi.ve)),B=R[0],N=R[1],L=(0,f.useState)(!1),U=L[0],F=L[1],H=(0,f.useState)(!1),G=H[0],W=H[1],K=l,z=C;if(!z){var Y=(0,f.useState)(!!(0,kn.U2)(kn.zg)),V=(0,r.Z)(Y,2);K=V[0],z=V[1]}var q=h,Q=S;if(!Q){var X=(0,f.useState)(!!(0,kn.U2)(kn.Uu)),$=(0,r.Z)(X,2);q=$[0],Q=$[1]}(0,f.useEffect)((function(){null===Z||void 0===Z||!Z.current||U||G||null===I||void 0===I||I(Z.current.getBoundingClientRect().width)}),[U,G,K,A,q,B,Z,I,T]),(0,f.useEffect)((function(){U||(null===w||void 0===w||w(A),(0,kn.t8)(kn.L8,A))}),[U,A,w]),(0,f.useEffect)((function(){G||(0,kn.t8)(kn.J3,B)}),[G,B]);var ee=(0,f.useMemo)((function(){var e=[{label:function(){return"Pipelines"},linkProps:{as:"/pipelines",href:"/pipelines"}}];return O&&(e.push.apply(e,[{bold:xt.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]"}}]),xt.b7===P&&e.push.apply(e,[{bold:!0,label:function(){return(0,J.kC)(P)}}])),(0,_.jsx)(hi.Z,{breadcrumbs:e})}),[P,O]);return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(Hn.Z,{title:null===O||void 0===O?void 0:O.name}),(0,_.jsx)(yn.Z,{after:n,afterFooter:t,afterHeader:i,afterHeightOffset:o,afterHidden:K,afterInnerHeightMinus:u,afterMousedownActive:U,afterNavigationItems:c,afterOverflow:s,afterSubheader:a,afterWidth:A,before:d,beforeHeader:p,beforeHeightOffset:v,beforeHidden:q,beforeMousedownActive:G,beforeNavigationItems:m,beforeWidth:B,footerOffset:x,header:ee,headerOffset:j,mainContainerFooter:y,mainContainerHeader:k,mainContainerRef:Z,navigationShowMore:!0,setAfterHidden:z,setAfterMousedownActive:F,setAfterWidth:D,setBeforeHidden:Q,setBeforeMousedownActive:W,setBeforeWidth:N,children:g}),b&&(0,_.jsx)(Sn.Z,{disableClickOutside:!0,isOpen:!0,onClickOutside:function(){return E(null)},children:(0,_.jsx)(vi.Z,bi(bi({},b),{},{onClose:function(){return E(null)}}))})]})},ji=t(55729),yi=t(93808),ki=t(8666),Zi=t(72226),Pi=t(29644),Oi=t(46209),Ci=t(46568),wi=t(82682),Si=t(17679),_i=t(61896),Ei=(w.iI,Si.O$,w.iI,_i.dN,p.default.div.withConfig({displayName:"indexstyle__SidekickContainerStyle",componentId:"sc-cr39lf-0"})(["height:calc(100vh - ","px - ","px);width:fit-content;",""],mi.Wi,Ke.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 ")}))),Ii=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 ")})),Ti=t(31748),Mi=t(79633);var Ai=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,g=e.updateVariable,b=e.variable||{},x=b.uuid,j=b.value,y=(0,f.useRef)(null),Z=(0,f.useRef)(null),P=(0,f.useState)(!1),O=P[0],S=P[1],E=(0,f.useState)(x),I=E[0],T=E[1],M=(0,f.useState)(j),A=M[0],D=M[1],R=(0,f.useState)(u),B=R[0],N=R[1],L=(0,v.Db)(z.ZP.variables.pipelines.useUpdate(m,x),{onSuccess:function(e){return(0,$.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=A;try{n=JSON.parse(A)}catch(t){}g?I&&A&&(null===g||void 0===g||g((0,l.Z)({},I,A)),N(!1)):F({variable:{name:I,value:n}}),(0,si.ez)(),null===p||void 0===p||p()}else"Escape"===e.key&&((0,si.ez)(),N(!1),null===h||void 0===h||h())}),[p,h,g,F,I,A]),G=(0,f.useCallback)((function(){(0,si.ez)(),t()}),[t]);(0,f.useEffect)((function(){var e,n;B&&(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())}),[B,s]);var W=n||"kwargs['".concat(x,"']");return(0,_.jsx)("div",{onMouseEnter:function(){return S(!0)},onMouseLeave:function(){return S(!1)},children:(0,_.jsxs)(wi.Z,{children:[(0,_.jsx)(Ci.Z,{hiddenSmDown:!0,md:1,children:(0,_.jsx)(Ii,{noPadding:!0,children:(0,_.jsx)(U.ZP,{backgroundColor:Ti.qJ,borderless:!0,centerText:!0,muted:!0,onClick:function(){navigator.clipboard.writeText(W),Gn.Am.success("Successfully copied to clipboard.",{position:Gn.Am.POSITION.BOTTOM_RIGHT,toastId:x})},small:!0,uuid:"Sidekick/GlobalVariables/".concat(x),withIcon:!0,children:(0,_.jsx)(Y.CK,{size:2.5*w.iI})})})}),(0,_.jsx)(Ci.Z,{md:4,children:B&&!i?(0,_.jsx)(Ii,{children:(0,_.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,_.jsx)(Ii,{children:(0,_.jsx)(C.ZP,{color:Mi.Or,monospace:!0,small:!0,textOverflow:!0,children:x})})}),(0,_.jsx)(Ci.Z,{md:7,children:B?(0,_.jsx)(Ii,{children:(0,_.jsx)(K.Z,{borderless:!0,compact:!0,fullWidth:!0,monospace:!0,onChange:function(e){D(e.target.value),e.preventDefault()},onKeyDown:H,paddingHorizontal:0,placeholder:"enter value",ref:Z,small:!0,value:A})}):(0,_.jsxs)(Ii,{children:[d?(0,_.jsx)(C.ZP,{monospace:!0,small:!0,children:"********"}):(0,_.jsx)(C.ZP,{monospace:!0,small:!0,children:j}),(0,_.jsxs)(k.Z,{children:[!a&&O&&(0,_.jsx)(U.ZP,{backgroundColor:Ti.qJ,borderless:!0,inline:!0,muted:!0,onClick:function(){N(!0)},small:!0,uuid:"Sidekick/GlobalVariables/edit_".concat(x),withIcon:!0,children:(0,_.jsx)(Y.I8,{size:2.5*w.iI})}),t&&O&&(0,_.jsx)(U.ZP,{backgroundColor:Ti.qJ,borderless:!0,inline:!0,muted:!0,onClick:G,small:!0,uuid:"Sidekick/GlobalVariables/delete_".concat(x),withIcon:!0,children:(0,_.jsx)(Y.rF,{size:2.5*w.iI})})]})]})})]})})},Di=p.default.div.withConfig({displayName:"indexstyle__BannerStyle",componentId:"sc-1cm3orh-0"})(["border-radius:","px;padding:","px ","px;",""],_e.n_,1.5*w.iI,w.l4,(function(e){return"\n border: ".concat(_e.YF,"px ").concat(_e.M8," ").concat((e.theme||Se.Z).interactive.defaultBorder,";\n ")})),Ri=t(68781);function Bi(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?Bi(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Bi(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Li={borderLess:!0,iconOnly:!0,noBackground:!0,outline:!0,padding:"4px"},Ui={bold:!0,default:!0,inline:!0,monospace:!0,small:!0},Fi=(0,Zt.YW)();var Hi=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),g=(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]),S=(0,f.useMemo)((function(){return!(null!==a&&void 0!==a&&a.run_pipeline_in_one_process)&&[H.qL.PYSPARK,H.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,R=l.uuid,B=(0,f.useMemo)((function(){return b.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===R})),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,ee.VI)(null,{},[],{uuid:"BlockSettings/index"}),V=(0,r.Z)(F,1)[0],q=(0,f.useMemo)((function(){return(0,Ie.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&&q)return null===q||void 0===q?void 0:q[n]}),[I,q]),ne=z.ZP.pipelines.detail(ki.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===ne||void 0===ne?void 0:ne.pipeline}),[ne]),ie=(0,f.useState)(null),oe=ie[0],re=ie[1],le=(0,f.useState)(!1),ce=le[0],ae=le[1],pe=(0,f.useState)(!1),fe=pe[0],ve=pe[1],he=(0,f.useState)(!1),ge=he[0],be=he[1],xe=(0,lt.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 ye=(0,f.useMemo)((function(){return(null===oe||void 0===oe?void 0:oe.retry_config)||{}}),[oe]),ke=(0,f.useCallback)((function(e){ae(!0),re(e)}),[]),Pe=(0,f.useMemo)((function(){return(0,je.gR)((null===oe||void 0===oe?void 0:oe.configuration)||I,["data_integration","file_path","global_data_product"])}),[null===oe||void 0===oe?void 0:oe.configuration,I]),Ce=(0,f.useCallback)((function(e){return ke((function(n){return Ni(Ni({},n),{},{configuration:Ni(Ni({},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||Ri.R.find((function(e){return e===we}))||ve(!0)}),[fe,we]);var Se=z.ZP.blocks.pipelines.detail(g,encodeURIComponent(R),{_format:"with_settings",block_type:D}).data,_e=(0,f.useMemo)((function(){return(null===Se||void 0===Se?void 0:Se.block)||{}}),[Se]),Ee=(0,f.useMemo)((function(){return null!==_e&&void 0!==_e&&_e.pipelines?Object.values(null===_e||void 0===_e?void 0:_e.pipelines):[]}),[_e]),Te=(null===Ee||void 0===Ee?void 0:Ee.length)||1,Me=(0,v.Db)(z.ZP.blocks.pipelines.useUpdate(g,encodeURIComponent(R)),{onSuccess:function(e){return(0,$.wD)(e,{callback:function(e){ae(!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 V({errors:n,response:e})}})}}),Ae=(0,r.Z)(Me,2),De=Ae[0],Re=Ae[1].isLoading,Be=((0,f.useCallback)((function(e){return De({block:e})}),[De]),(0,f.useMemo)((function(){return Te>=1&&(0,_.jsx)(se.cl,{children:(0,_.jsx)(Ze.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,_.jsxs)(C.ZP,{monospace:!0,muted:!0,children:[i||o," (current)"]},"name"):(0,_.jsx)(P.Z,{href:"/pipelines/".concat(o,"/edit"),monospace:!0,openNewWindow:!0,sameColorAsText:!0,children:i||o},"name"),(0,_.jsx)(C.ZP,{default:!0,monospace:!0,children:t||"-"},"description")]})),uuid:"git-branch-blockPipelines"})})}),[Ee,Te,a])),Ne=(0,f.useMemo)((function(){return y&&"undefined"!==typeof y&&!(0,je.Qr)(y)&&("undefined"!==typeof(null===y||void 0===y?void 0:y.delay)&&"undefined"===typeof(null===ye||void 0===ye?void 0:ye.delay)||"undefined"!==typeof(null===y||void 0===y?void 0:y.exponential_backoff)&&"undefined"===typeof(null===ye||void 0===ye?void 0:ye.exponential_backoff)||"undefined"!==typeof(null===y||void 0===y?void 0:y.max_delay)&&"undefined"===typeof(null===ye||void 0===ye?void 0:ye.max_delay)||"undefined"!==typeof(null===y||void 0===y?void 0:y.retries)&&"undefined"===typeof(null===ye||void 0===ye?void 0:ye.retries))}),[ye,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]),Ue=(0,f.useCallback)((function(e){return ke((function(n){var t;return Ni(Ni({},n),{},{configuration:Ni(Ni({},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]),Fe=(0,f.useMemo)((function(){return(0,de.jO)(l,a)}),[l,a]);return(0,f.useMemo)((function(){return Fe&&(0,de.Uc)(l)}),[l,Fe]),(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(O.Z,{mb:w.HN,pt:w.cd,children:[Te>1&&(0,_.jsx)(O.Z,{mb:w.Mq,px:w.cd,children:(0,_.jsx)(Di,{children:(0,_.jsxs)(Z.ZP,Ni(Ni({},Z.A0),{},{children:[(0,_.jsxs)(k.Z,{children:[(0,_.jsx)(Y.BG,{fill:Mi.$R,size:Q.l2}),(0,_.jsx)(O.Z,{pr:2}),(0,_.jsxs)(C.ZP,{bold:!0,large:!0,lineHeight:3*w.iI,warning:!0,children:["Shared by ",Te," pipelines"]})]}),!B&&(null===a||void 0===a?void 0:a.type)!==H.qL.INTEGRATION&&(0,_.jsx)(Oe.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,_.jsx)(A.ZP,Ni(Ni({},Li),{},{afterIcon:(0,_.jsx)(Y.L9,{size:Q.bL}),iconOnly:!1,onClick:function(){return p(Ni(Ni({},(0,je.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,_.jsx)(O.Z,{mb:w.HN,px:w.cd,children:(0,_.jsxs)(me.Z,{noBackground:!0,noBoxShadow:!0,sameColorBorders:!0,children:[(0,_.jsx)(me.g,{noBorder:!0,children:(0,_.jsxs)(Z.ZP,Ni(Ni({},Z.A0),{},{children:[(0,_.jsx)(k.Z,{children:(0,_.jsx)(C.ZP,{bold:!0,default:!0,children:"Name"})}),(0,_.jsx)(O.Z,{mr:1}),(0,_.jsx)(A.ZP,Ni(Ni({},Li),{},{afterIcon:B?null:(0,_.jsx)(Y.I8,{size:Q.bL}),disabled:B,onClick:function(){return p(l,M)},children:(0,_.jsx)(C.ZP,{bold:!0,children:M||""})}))]}))}),b.tf.CUSTOM===(null===l||void 0===l?void 0:l.type)?(0,_.jsx)(me.g,{noBorder:!0,children:(0,_.jsxs)(Z.ZP,Ni(Ni({},Z.A0),{},{children:[(0,_.jsx)(k.Z,{children:(0,_.jsx)(C.ZP,{bold:!0,default:!0,children:"Color"})}),(0,_.jsx)(O.Z,{mr:1}),(0,_.jsx)(A.ZP,Ni(Ni({},Li),{},{afterIcon:(0,_.jsx)(j.Z,{color:E?Fi[E]:null,size:Q.bL,square:!0}),onClick:function(){return p(l,M)},outline:!1,children:(0,_.jsx)(C.ZP,{bold:!0,children:(0,J.kC)(E||"")})}))]}))}):null]})}),(0,_.jsxs)(O.Z,{mb:w.HN,px:w.cd,children:[(0,_.jsx)(ue.Z,{level:5,children:"Executor type"}),(0,_.jsxs)(C.ZP,{muted:!0,children:["For more information on this setting, please read the ",(0,_.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,_.jsxs)(O.Z,{mt:1,children:[!fe&&(0,_.jsx)(G.Z,{label:"Executor type",onChange:function(e){return ke((function(n){return Ni(Ni({},n),{},{executor_type:e.target.value})}))},primary:!0,ref:h,value:(null===oe||void 0===oe?void 0:oe.executor_type)||"",children:Ri.R.map((function(e){return(0,_.jsx)("option",{value:e,children:e},e)}))}),fe&&(0,_.jsx)(K.Z,{label:"Executor type",monospace:!0,onChange:function(e){return ke((function(n){return Ni(Ni({},n),{},{executor_type:e.target.value})}))},primary:!0,ref:m,setContentOnMount:!0,value:(null===oe||void 0===oe?void 0:oe.executor_type)||""}),(0,_.jsx)(O.Z,{mt:1,children:(0,_.jsx)(P.Z,{muted:!0,onClick:function(){fe?(ke((function(e){return Ni(Ni({},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,_.jsxs)(O.Z,{mb:w.HN,px:w.cd,children:[(0,_.jsx)(ue.Z,{level:5,children:"Retry configuration"}),(0,_.jsxs)(C.ZP,{muted:!0,children:[Ne&&(0,_.jsxs)(_.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,_.jsx)("br",{})]}),"For more information on this setting, please read the ",(0,_.jsx)(P.Z,{href:"https://docs.mage.ai/orchestration/pipeline-runs/retrying-block-runs",openNewWindow:!0,children:"documentation"}),"."]}),(0,_.jsxs)(O.Z,{mt:1,children:[(0,_.jsxs)(Z.ZP,{children:[(0,_.jsx)(K.Z,{label:"Retries",monospace:!0,onChange:function(e){return ke((function(n){var t;return Ni(Ni({},n),{},{retry_config:Ni(Ni({},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===ye||void 0===ye?void 0:ye.retries)?null===ye||void 0===ye?void 0:ye.retries:(null===y||void 0===y?void 0:y.retries)||""}),(0,_.jsx)(O.Z,{mr:1}),(0,_.jsx)(K.Z,{label:"Delay",monospace:!0,onChange:function(e){return ke((function(n){var t;return Ni(Ni({},n),{},{retry_config:Ni(Ni({},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===ye||void 0===ye?void 0:ye.delay)?null===ye||void 0===ye?void 0:ye.delay:(null===y||void 0===y?void 0:y.delay)||""}),(0,_.jsx)(O.Z,{mr:1}),(0,_.jsx)(K.Z,{label:"Max delay",monospace:!0,onChange:function(e){return ke((function(n){var t;return Ni(Ni({},n),{},{retry_config:Ni(Ni({},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===ye||void 0===ye?void 0:ye.max_delay)?null===ye||void 0===ye?void 0:ye.max_delay:(null===y||void 0===y?void 0:y.max_delay)||""})]}),(0,_.jsx)(O.Z,{mt:w.cd,children:(0,_.jsx)(x.Z,{checked:"undefined"===typeof(null===ye||void 0===ye?void 0:ye.exponential_backoff)&&"undefined"!==typeof(null===y||void 0===y?void 0:y.exponential_backoff)?!(null===y||void 0===y||!y.exponential_backoff):!(null===ye||void 0===ye||!ye.exponential_backoff),label:"Exponential backoff",onClick:function(){return ke((function(e){var n;return Ni(Ni({},e),{},{retry_config:Ni(Ni({},null===e||void 0===e?void 0:e.retry_config),{},{exponential_backoff:"undefined"===typeof(null===ye||void 0===ye?void 0:ye.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)})})}))}})})]})]}),S&&(0,_.jsxs)(O.Z,{mb:w.HN,px:w.cd,children:[(0,_.jsx)(ue.Z,{level:5,children:"Block run timeout"}),(0,_.jsx)(O.Z,{mb:1}),(0,_.jsx)(K.Z,{label:"Time in seconds",monospace:!0,onChange:function(e){return ke((function(n){return Ni(Ni({},n),{},{timeout:e.target.value})}))},primary:!0,setContentOnMount:!0,type:"number",value:(null===oe||void 0===oe?void 0:oe.timeout)||""}),(0,_.jsx)(O.Z,{mb:1}),(0,_.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."})]}),B&&(0,_.jsxs)(O.Z,{mb:w.HN,px:w.cd,children:[(0,_.jsx)(ue.Z,{level:5,children:"dbt settings"}),(0,_.jsx)(O.Z,{mt:1,children:(0,_.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 Ni(Ni({},e),{},{configuration:Ni(Ni({},null===e||void 0===e?void 0:e.configuration),{},{dbt:Ni(Ni({},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)})})})}))}})})]}),b.Lk.includes(D)&&b.t6.PYTHON===T&&(0,_.jsxs)(O.Z,{mb:w.HN,px:w.cd,children:[(0,_.jsxs)(Z.ZP,{alignItems:"center",children:[(0,_.jsx)(ue.Z,{level:5,children:"Block variables"}),(0,_.jsx)(O.Z,{ml:2}),(0,_.jsx)(U.ZP,{Icon:Y.mm,blackBorder:!0,halfPaddingBottom:!0,halfPaddingTop:!0,inline:!0,onClick:function(){return be((function(e){return!e}))},smallIcon:!0,uuid:"Sidekick/BlockSettings/addNewBlockVariable",children:"New"})]}),(0,_.jsxs)(O.Z,{mb:w.cd,mt:1,children:[(0,_.jsxs)(C.ZP,{muted:!0,children:["Press",(0,_.jsx)(C.ZP,Ni(Ni({},Ui),{},{children:" Enter"}))," or",(0,_.jsx)(C.ZP,Ni(Ni({},Ui),{},{children:" Return"}))," on a row to add or update a variable. These variables are only accessible in this block\xa0",(0,_.jsxs)(C.ZP,Ni(Ni({},Ui),{},{bold:!1,children:["(",R,")."]})),(0,_.jsxs)(C.ZP,{inline:!0,muted:!0,children:[" Refer to the",(0,_.jsx)(P.Z,{href:"https://docs.mage.ai/development/variables/block-variables",openNewWindow:!0,children:" documentation"})," for more details."]})]}),(0,_.jsxs)(C.ZP,{muted:!0,children:[(0,_.jsx)(C.ZP,{bold:!0,inline:!0,warning:!0,children:"Note: "}),"Click the",(0,_.jsx)(C.ZP,Ni(Ni({},Ui),{},{children:" Update block settings"}))," button below to save changes. If you do not, any new or updated block variables will not be persisted."]})]}),(0,_.jsxs)(O.Z,{mb:w.cd,children:[ge&&(0,_.jsx)(Ai,{editStateInit:!0,focusKey:!0,onEnterCallback:function(){return be(!1)},onEscapeCallback:function(){return be(!1)},updateVariable:Ce},"new_block_variable"),null===(o=Object.entries(Pe))||void 0===o?void 0:o.map((function(e){var n=e[0];return(0,_.jsx)(Ai,{copyText:"kwargs['configuration'].get('".concat(n,"')"),deleteVariable:function(){var e=Ni({},null===oe||void 0===oe?void 0:oe.configuration);delete e[n],ke((function(n){return Ni(Ni({},n),{},{configuration:Ni({},e)})}))},disableKeyEdit:!0,updateVariable:Ce,variable:{uuid:n,value:e[1]}},n)}))]})]}),b.tf.GLOBAL_DATA_PRODUCT===D&&(0,_.jsxs)(O.Z,{mb:w.HN,children:[(0,_.jsx)(O.Z,{px:w.cd,children:(0,_.jsx)(ue.Z,{level:5,children:"Override global data product settings"})}),(0,_.jsx)(O.Z,{mt:w.Mq,children:(0,_.jsx)(Zi.Z,{objectAttributes:Le,originalAttributes:X,setObjectAttributes:Ue})}),(0,_.jsx)(O.Z,{mt:w.Mq,children:(0,_.jsx)(Pi.Z,{objectAttributes:Le,originalAttributes:X,setObjectAttributes:Ue})}),(0,_.jsx)(O.Z,{mt:w.Mq,children:(0,_.jsx)(Oi.Z,{blocks:null===te||void 0===te?void 0:te.blocks,objectAttributes:Le,originalAttributes:X,setObjectAttributes:Ue})})]}),(0,_.jsx)(O.Z,{px:w.cd,children:(0,_.jsx)(A.ZP,{disabled:!ce,loading:Re,onClick:function(){return De({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:ye,timeout:null===oe||void 0===oe?void 0:oe.timeout}})},primary:!0,children:"Update block settings"})})]}),(0,_.jsxs)(O.Z,{mb:w.HN,children:[!Se&&(0,_.jsx)(O.Z,{p:w.cd,children:(0,_.jsx)(W.Z,{inverted:!0})}),Se&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(O.Z,{p:w.cd,children:[(0,_.jsxs)(ue.Z,{level:5,children:["Pipelines using this block (",Te,")"]}),(0,_.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."})]}),Be]})]})]})},Gi=t(4006),Wi=t(12869),Ki=["bold","defaultColor","description","disableWordBreak","fullWidth","inputValue","inputWidth","invertedTheme","label","labelColor","menuOpen","monospace","muted","onClick","notRequired","selectedTextProps","small","stacked","suffixValue","tooltipProps","value"];function zi(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 Yi(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?zi(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):zi(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Vi=p.default.div.withConfig({displayName:"LabelWithValueClicker__LabelStyle",componentId:"sc-1hzpn4h-0"})(["margin-bottom:","px;"],.25*w.iI),qi=p.default.div.withConfig({displayName:"LabelWithValueClicker__DescriptionStyle",componentId:"sc-1hzpn4h-1"})([""]);var Qi=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,g=e.onClick,b=e.notRequired,x=e.selectedTextProps,j=e.small,y=e.stacked,w=e.suffixValue,S=e.tooltipProps,E=e.value,I=(0,ge.Z)(e,Ki),T=(0,f.useRef)(null),M=(0,f.useState)(!1),A=M[0],D=M[1],R=(0,f.useState)(!1),B=R[0],N=R[1],L=a&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(C.ZP,{bold:t,color:d,inverted:s,lineHeight:20,monospace:h,muted:m,small:j,children:a}),S&&(0,_.jsx)(O.Z,{ml:1,children:(0,_.jsx)(Oe.Z,Yi({muted:!0},S))})]}),U=(0,_.jsxs)(k.Z,{flex:l?"1":"none",children:[E&&(0,_.jsx)(P.Z,{block:!0,danger:null===x||void 0===x?void 0:x.danger,fullWidth:!0,muted:m,onClick:function(){g(),T.current&&T.current.focus(),D(!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,_.jsx)(C.ZP,Yi(Yi({inverted:s,muted:m},x),{},{disableWordBreak:r,monospace:h,small:j,width:c,children:E}))}),(0,_.jsx)(K.Z,Yi(Yi({},I),{},{basic:!0,defaultColor:i,fullWidth:l,invertedTheme:s,monospace:h,onBlur:function(e){D(!1),I.onBlur&&I.onBlur(e),B||N(!0)},onFocus:function(e){D(!0),I.onFocus&&I.onFocus(e)},ref:T,small:j,value:u,visible:!E}))]}),F=o&&(0,_.jsx)(qi,{children:(0,_.jsx)(C.ZP,{dangerouslySetInnerHTML:{__html:o},monospace:h,muted:!0,small:j})}),H=(0,f.useMemo)((function(){return(0,_.jsx)(C.ZP,{default:!0,small:j,children:w})}),[j,w]);return(0,_.jsxs)(_.Fragment,{children:[y&&(0,_.jsxs)(_.Fragment,{children:[L&&(0,_.jsxs)(Vi,{children:[(0,_.jsx)(Z.ZP,{alignItems:"center",fullHeight:!1,fullWidth:!0,children:L}),F]}),(0,_.jsxs)(Z.ZP,{fullWidth:l,children:[U,w&&H]})]}),!y&&(0,_.jsxs)(Z.ZP,{alignItems:"center",fullWidth:!0,children:[L&&(0,_.jsxs)(_.Fragment,{children:[L,(0,_.jsx)(O.Z,{ml:1})]}),U,w&&H]}),B&&!A&&!E&&!v&&!b&&(0,_.jsx)(C.ZP,{danger:!0,small:j,children:"This field is required."})]})},Xi=t(10305),Ji=t(84820),$i=t(85108),eo=t(97301);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 to(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}function io(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,g=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,A=e.savePipelineContent,D=e.selected,R=e.setAnyInputFocused,B=e.setErrors,N=e.setSelectedBlock,L=e.setTextareaFocused,F=e.textareaFocused,H=e.updateWidget,V=e.width,q=(0,f.useRef)(null),Q=(0,f.useContext)(p.ThemeContext),X=z.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,ee=(null===X||void 0===X||null===(t=X.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],ue=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===ee.length),he=ve[0],me=ve[1],ge=(0,f.useState)(!1),be=ge[0],xe=ge[1],ye=(0,f.useState)(null),Ze=ye[0],Pe=ye[1],Ce=(0,f.useState)(null===s||void 0===s?void 0:s.upstream_blocks),we=Ce[0],_e=Ce[1],Ee=(0,f.useState)((null===ee||void 0===ee?void 0:ee.length)||0),Te=Ee[0],Me=Ee[1],Ae=(0,f.useState)(s.uuid),De=Ae[0],Re=Ae[1],Be=$i.G8[re],Ne=$i.x8[re],Le=(0,f.useMemo)((function(){return null===d||void 0===d?void 0:d.filter((function(e){var n=e.type;return[b.tf.DATA_LOADER,b.tf.TRANSFORMER].includes(n)}))}),[d]),Ue=(0,f.useMemo)((function(){return(0,Ie.HK)(Le,(function(e){return e.uuid}))}),[Le]),Fe=!!M.find((function(e){return e.uuid===s.uuid}))||(null===y||void 0===y?void 0:y.length)>=1&&m!==ft.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]),Ge=!!He.find((function(e){return e.error})),We=He.length>=1,Ke=(0,f.useMemo)((function(){return{blockType:s.type,hasError:Ge,selected:D}}),[s.type,Ge,D]);if(null!==He&&void 0!==He&&He.length){var ze,Ye,Ve=He.length-1;u=null===He||void 0===He||null===(ze=He[Ve])||void 0===ze||null===(Ye=ze.data)||void 0===Ye?void 0:Ye[0]}u?(u=(u=u.slice(1,u.length-1)).replaceAll('\\"','"').replaceAll("\\'","'"),(0,J.Pb)(u)&&(o=JSON.parse(u))):(null===ee||void 0===ee?void 0:ee.length)>=1&&(o={},ee.forEach((function(e){var n=e||{},t=n.text_data,i=n.type,r=n.variable_uuid;ft.Gi.TEXT===i&&(0,J.Pb)(t)&&(o[r]=JSON.parse(t))})));var qe=(0,f.useCallback)((function(e){var n=to(to(to({},s),e),{},{configuration:to(to({},s.configuration),e.configuration)});A().then((function(){T({block:n,code:pe,ignoreAlreadyRunning:!0,runUpstream:!!we.find((function(e){var n;return![b.DA.EXECUTED,b.DA.UPDATED].includes(null===(n=Ue[e])||void 0===n?void 0:n.status)}))})})),Me((function(e){return e+1}))}),[s,Ue,pe,T,A,Me,we]),Qe=(0,f.useCallback)((function(e){fe(e),E(e)}),[E,fe]),Xe=(0,f.useCallback)((function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.autoRun;ae((function(n){return to(to({},n),e)}));var i=to(to({},s),{},{configuration:to(to(to({},se),e),{},{chart_type:re})});H(i),Te&&t&&qe(i)}),[s,re,se,Te,qe,ae,H]);(0,f.useEffect)((function(){ie({python:(0,Ji.Z)({autocompleteItems:c,block:s,blocks:d,pipeline:I})})}),[c,s,d,I]);var Je=(0,f.useMemo)((function(){return(0,_.jsx)(le.Z,{autoHeight:!0,autocompleteProviders:te,onChange:Qe,selected:D,setSelected:function(e){return N(!0===e?s:null)},setTextareaFocused:L,showLineNumbers:!1,textareaFocused:F||ui.oV.TABLE===re&&!he,value:pe,width:"100%"})}),[te,s,re,pe,he,D,N,L,F,Qe]),$e=(0,f.useMemo)((function(){return(Ge||We)&&(0,_.jsx)(Wi.Z,to(to({},Ke),{},{block:s,contained:!1,hideExtraInfo:!0,isInProgress:Fe,messages:He,selected:D}))}),[s,Ke,Ge,We,Fe,He,D]),en=(0,lt.Z)(he),nn=(0,lt.Z)(V);(0,f.useEffect)((function(){var e,n=null===q||void 0===q||null===(e=q.current)||void 0===e?void 0:e.getBoundingClientRect();en!==he||nn!==V?(Pe(0),setTimeout((function(){var e,n,t=null===q||void 0===q||null===(e=q.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,q,Pe,V,nn]);var tn=(0,f.useMemo)((function(){var e=[];return we.forEach((function(n,t){var i=Ue[n],o=(0,S.qn)(null===i||void 0===i?void 0:i.type,{blockColor:null===i||void 0===i?void 0:i.color,theme:Q}).accent;e.push((0,_.jsxs)(O.Z,{ml:2,children:[(0,_.jsxs)(C.ZP,{bold:!0,inline:!0,monospace:!0,small:!0,children:["df_",t+1]})," ",(0,_.jsx)(C.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:"->"})," ",(0,_.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,_.jsx)(C.ZP,{color:o,monospace:!0,small:!0,children:n})})]},n))})),e}),[a,Ue,Q,we]),on=(0,f.useMemo)((function(){var e,n=[],t=null===Be||void 0===Be||null===(e=Be.code)||void 0===e?void 0:e.reduce((function(e,n){var t=n.uuid;return ui.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=$i.SR[re])||void 0===i||null===(o=i[e])||void 0===o?void 0:o.call(i);n.push((0,_.jsxs)(O.Z,{ml:2,children:[(0,_.jsx)(C.ZP,{bold:!0,inline:!0,monospace:!0,small:!0,children:t})," ",r&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(C.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:"->"})," ",(0,_.jsx)(C.ZP,{default:!0,inline:!0,small:!0,children:r})]})]},t))}})),n}),[re,se,Be]),rn=(0,lt.Z)(re),ln=(0,lt.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,je.Qr)(se)&&Ne){var e=to(to({},s),{},{upstream_blocks:we});Ne.configuration&&Xe(Ne.configuration(e)),Ne.content&&Qe(Ne.content(e))}}),[s,re,rn,se,pe,Ne,Xe,Qe,we,ln]);var un=(0,f.useMemo)((function(){return se[ui.v8]||1}),[se]),cn=(0,f.useMemo)((function(){return Object.entries(Be||{}).reduce((function(e,n){var t=(0,r.Z)(n,2),i=t[0],o=t[1];return to(to({},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,J.kC)(i()),monospace:o,onBlur:function(){return N(s)},onChange:function(e){return Xe((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!==X&&void 0!==X&&X.block?[X.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($i.VR.COLUMNS===a){var v=se[d]||[];n=(0,_.jsxs)(_.Fragment,{children:[(!c.maxValues||v.length<c.maxValues)&&(0,_.jsx)(G.Z,to(to({},p),{},{onChange:function(e){var n=se[d]||[],i=e.target.value;n.includes(i)?n=(0,Ie.Od)(n,(function(e){return e===i})):n.push(i),Xe((0,l.Z)({},d,n),{autoRun:t})},value:null,children:(0,Ie.YC)(f.filter((function(e){return!v.includes(e)})),(function(e){return e})).map((function(e){return(0,_.jsx)("option",{value:e,children:e},e)}))})),v.map((function(e){return(0,_.jsx)("div",{style:{display:"inline-block",marginRight:2,marginTop:2},children:(0,_.jsx)(ke.Z,{label:e,onClick:function(){Xe((0,l.Z)({},d,(0,Ie.Od)(v,(function(n){return n===e}))),{autoRun:t})}})},e)}))]})}else if($i.VR.METRICS===a){var h=se[d]||[];n=(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(C.ZP,{bold:!0,children:"Metrics"}),(0,_.jsx)(C.ZP,{muted:!0,small:!0,children:"Select a column and an aggregation function."}),(0,_.jsxs)(Xi.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]}))||(Xe((0,l.Z)({},d,h.concat({aggregation:e[0],column:e[1]})),{autoRun:t}),o([null,null]),i()))},children:[(0,_.jsx)(G.Z,to(to({},p),{},{label:"aggregation",children:(0,Ie.YC)(ui.bn,(function(e){return e})).map((function(e){return(0,_.jsx)("option",{value:e,children:e},e)}))})),(0,_.jsx)(G.Z,to(to({},p),{},{label:"column",children:(0,Ie.YC)(f,(function(e){return e})).map((function(e){return(0,_.jsx)("option",{value:e,children:e},e)}))}))]}),h.map((function(e){var n=e.aggregation,i=e.column;return(0,_.jsx)("div",{style:{display:"inline-block",marginRight:2,marginTop:2},children:(0,_.jsx)(ke.Z,{label:(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(C.ZP,{inline:!0,monospace:!0,children:[n,"("]}),i,(0,_.jsx)(C.ZP,{inline:!0,monospace:!0,children:")"})]}),onClick:function(){Xe((0,l.Z)({},d,(0,Ie.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,_.jsx)(G.Z,to(to({},p),{},{children:r.map((function(e){return(0,_.jsx)("option",{value:e,children:e},e)}))})):(0,_.jsx)(K.Z,to(to({},p),{},{type:a}));return(0,_.jsx)(O.Z,{mb:1,children:n},d)}))))}),{noCode:[]})}),[s,se,Be,X,N,Xe]),sn=cn.code,an=cn.noCode,dn=(0,v.Db)(z.ZP.widgets.pipelines.useUpdate(null===I||void 0===I?void 0:I.uuid,s.uuid),{onSuccess:function(e){return(0,$.wD)(e,{callback:function(){xe(!1),g(),x()},onErrorCallback:function(e,n){return null===B||void 0===B?void 0:B({errors:n,response:e})}})}}),pn=(0,r.Z)(dn,1)[0],fn="ChartBlock/".concat(s.uuid),vn=(0,An.y)(),hn=vn.registerOnKeyDown,mn=vn.unregisterOnKeyDown;return(0,f.useEffect)((function(){return function(){mn(fn)}}),[mn,fn]),hn(fn,(function(e,n,t){be&&String(t[0])===String(Tn.Uq)&&String(t[1])!==String(Tn.zX)&&pn({widget:to(to({},s),{},{name:De})})}),[s,be,De,pn]),(0,_.jsx)(Ci.Z,{sm:12,md:12*un,children:(0,_.jsxs)(eo.pM,{ref:n,children:[(0,_.jsx)(O.Z,{mt:1,pt:1,px:1,children:(0,_.jsxs)(Z.ZP,{alignItems:"center",fullWidth:!0,justifyContent:"space-between",children:[(0,_.jsxs)(k.Z,{flex:1,style:{position:"relative"},children:[(0,_.jsx)(Qi,{bold:!1,fullWidth:!0,inputValue:De,notRequired:!0,onBlur:function(){return setTimeout((function(){return xe(!1)}),300)},onChange:function(e){Re(e.target.value),e.preventDefault()},onClick:function(){R(!0),xe(!0)},onFocus:function(){R(!0),xe(!0)},small:!0,stacked:!0,value:!be&&s.uuid}),be&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(O.Z,{ml:1}),(0,_.jsx)(P.Z,{noWrapping:!0,onClick:function(){return pn({widget:to(to({},s),{},{name:De})})},preventDefault:!0,sameColorAsText:!0,small:!0,children:"Update chart name"})]})]}),(0,_.jsx)(O.Z,{mr:1}),(0,_.jsxs)(Z.ZP,{alignItems:"center",children:[(0,_.jsx)(G.Z,{compact:!0,onChange:function(e){var n=[e.target.value],t=to(to({},s),{},{upstream_blocks:n});H(t),qe(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,_.jsx)("option",{value:n,children:n},n)}))}),(0,_.jsx)(O.Z,{mr:1}),!Fe&&(0,_.jsx)(Oe.Z,{appearBefore:!0,default:!0,label:"Run chart block",size:null,widthFitContent:!0,children:(0,_.jsx)(U.ZP,{blackBorder:!0,compact:!0,inline:!0,onClick:function(){return qe(s)},uuid:"ChartBlock/run/".concat(s.uuid),children:(0,_.jsx)(Y.Py,{size:2*w.iI})})}),ft.uF.QUEUED===m&&(0,_.jsx)(W.Z,{color:(Q||Se.Z).content.active,small:!0,type:"cylon"}),ft.uF.BUSY===m&&(0,_.jsx)(W.Z,{color:(Q||Se.Z).content.active,small:!0}),(0,_.jsx)(O.Z,{mr:1}),(0,_.jsx)(Oe.Z,{appearBefore:!0,default:!0,label:"Edit chart",size:null,widthFitContent:!0,children:(0,_.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,_.jsx)(Y.I8,{size:2*w.iI})})}),(0,_.jsx)(O.Z,{mr:1}),(0,_.jsx)(Oe.Z,{appearBefore:!0,default:!0,label:"Delete chart",size:null,widthFitContent:!0,children:(0,_.jsx)(U.ZP,{blackBorder:!0,compact:!0,inline:!0,onClick:function(){return h(s)},uuid:"ChartBlock/delete/".concat(s.uuid),children:(0,_.jsx)(Y.rF,{size:2*w.iI})})})]})]})}),(0,_.jsx)(O.Z,{mt:1}),(0,_.jsxs)(Z.ZP,{fullWidth:!0,justifyContent:"space-between",children:[(0,_.jsx)(k.Z,{flex:6,ref:q,children:o&&!(0,je.Qr)(o)&&(0,_.jsx)(O.Z,{pb:3,children:(0,_.jsx)(Gi.Z,{block:to(to({},s),{},{configuration:to(to({},s.configuration),se)}),data:o,width:Ze})})}),he&&(0,_.jsx)(eo.Tb,{children:(0,_.jsxs)(Z.ZP,{flexDirection:"column",fullWidth:!0,children:[(0,_.jsx)(O.Z,{mb:1,children:(0,_.jsx)(G.Z,{onChange:function(e){var n=e.target.value,t=to(to({},s),{},{configuration:to(to({},se),{},{chart_type:n})});H(t),qe(t),ue(n)},placeholder:"Select chart type",value:re,children:ui.CK.map((function(e){return(0,_.jsx)("option",{value:e,children:(0,J.kC)(e)},e)}))})}),(0,_.jsx)(O.Z,{mb:1,children:(0,_.jsx)(G.Z,{onChange:function(e){return Xe((0,l.Z)({},ui.v8,e.target.value))},placeholder:"Chart width",value:(null===se||void 0===se?void 0:se[ui.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,_.jsx)("option",{value:i,children:t},t)}))})}),an]})})]}),he&&!(null===sn||void 0===sn||!sn.length)&&b.t6.SQL!==s.language&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(O.Z,{my:1,px:1,children:[(0,_.jsx)(C.ZP,{bold:!0,children:"Custom chart code"}),(0,_.jsxs)(C.ZP,{muted:!0,children:["Write custom logic mapping data to input values for your chart.",(0,_.jsx)("br",{}),"This code is only executed if you don\u2019t have any columns or metrics selected."]})]}),(0,_.jsxs)(eo.T7,{children:[we.length>=1&&(0,_.jsxs)(eo.y9,{children:[(0,_.jsxs)(C.ZP,{muted:!0,small:!0,children:["Variables you can use in your code: ",tn]}),(0,_.jsxs)(C.ZP,{muted:!0,small:!0,children:["Variables that you must define: ",on]})]}),Je]})]}),$e&&(0,_.jsx)(O.Z,{px:1,children:$e})]})})}var oo=f.forwardRef(io),ro=["blockRefs","blocks","chartRefs","deleteWidget","messages","onChangeChartBlock","runBlock","runningBlocks","savePipelineContent","selectedBlock","setAnyInputFocused","setErrors","setSelectedBlock","setTextareaFocused","textareaFocused","updateWidget","widgets","width"];function lo(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 uo(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?lo(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):lo(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var co=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,g=e.textareaFocused,b=e.updateWidget,x=e.widgets,j=e.width,y=(0,ge.Z)(e,ro),k=(0,f.useMemo)((function(){return s.reduce((function(e,n,t){return uo(uo({},e),{},(0,l.Z)({},n.uuid,uo(uo({},n),{},{priority:t})))}),{})}),[s]);return(0,_.jsxs)(Z.ZP,{flexDirection:"column",fullWidth:!0,children:[(0,_.jsx)(wi.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?ft.uF.BUSY:ft.uF.QUEUED:ft.uF.IDLE;return i.current[l]=(0,f.createRef)(),(0,f.createElement)(oo,uo(uo({},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:g,updateWidget:b,width:j}))}))}),(0,_.jsx)("div",{style:{height:"80vh"}})]})},so=t(24138),ao=p.default.svg.withConfig({displayName:"EmptyCharts__SVGStyle",componentId:"sc-ttsjrp-0"})([""]),po=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,_.jsxs)(ao,{height:t*(305/358),viewBox:o,width:t,children:[(0,_.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,_.jsx)("path",{fill:"#000",d:"M118 46h1v216h-1zM178 46h1v216h-1zM238 46h1v216h-1z"}),(0,_.jsx)("path",{fill:"#000",d:"M59 208.25v-1h239v1zM59 154.5v-1h239v1zM59 100.75v-1h239v1z"}),(0,_.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,_.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,_.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,_.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,_.jsx)("circle",{cx:"55.2178",cy:"34.6274",r:"5.2954",fill:"#8ADE00"}),(0,_.jsx)("circle",{cx:"113.818",cy:"106.582",r:"5.2954",fill:"#8ADE00"}),(0,_.jsx)("circle",{cx:"84.2832",cy:"80.6953",r:"5.2954",fill:"#8ADE00"}),(0,_.jsx)("circle",{cx:"117.115",cy:"43.6274",r:"5.2954",fill:"#8ADE00"}),(0,_.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,_.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,_.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,_.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,_.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,_.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,_.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,_.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 fo,vo=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 b.tf.DBT===n})))||[]}),[n]),(0,_.jsx)(_.Fragment,{})};function ho(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 mo(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ho(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ho(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"}(fo||(fo={}));var go=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)(""),g=m[0],b=m[1],P=(0,f.useState)(!1),E=P[0],I=P[1],T=(0,f.useState)(null),M=T[0],D=T[1],R=(0,f.useMemo)((function(){return(0,Ie.HK)(r,(function(e){return e.uuid}))}),[r]);(0,f.useEffect)((function(){M||D((0,Ie.HK)((null===i||void 0===i?void 0:i.upstream_blocks)||[],(function(e){return e})))}),[i,M]);var B=(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===g||void 0===g?void 0:g.toLowerCase()))||(null===i||void 0===i?void 0:i.toLowerCase().includes(null===g||void 0===g?void 0:g.toLowerCase())))&&(null===d||void 0===d?void 0:d.includes(t))})))||[]}),[g,r,d]),N=(0,f.useMemo)((function(){var e=[];return null===B||void 0===B||B.forEach((function(n,t){var i=n.color,o=n.language,r=n.type,l=n.uuid,u=(0,S.qn)(r,{blockColor:i,theme:h}).accent;t>=1&&e.push((0,_.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,_.jsx)(O.Z,{px:2,py:1,children:(0,_.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,_.jsxs)(k.Z,{alignItems:"center",children:[(0,_.jsx)(j.Z,{color:u,size:1.5*w.iI,square:!0}),(0,_.jsx)(O.Z,{mr:1}),(0,_.jsx)(C.ZP,{monospace:!0,muted:s,small:!0,children:l})]}),s&&(0,_.jsxs)(C.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:[o," support coming soon"]}),!s&&(0,_.jsx)(x.Z,{checked:!s&&c,disabled:s,onClick:function(){D((function(e){var n=mo({},e);return c?delete n[l]:n[l]=l,n}))}})]})},"option-".concat(l)))})),e}),[B,h,M]);return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(Sn.Z,{onClickOutside:function(){return I(!1)},open:!0,children:[(0,_.jsx)(K.Z,{beforeIcon:(0,_.jsx)(Y.HN,{}),borderless:!0,compact:!0,onChange:function(e){return b(e.target.value)},onClick:function(e){(0,Be.j)(e),I(!0)},onFocus:function(e){(0,Be.j)(e),I(!0)},placeholder:l,small:!0,value:g}),E&&(0,_.jsxs)(_.Fragment,{children:[N,(0,_.jsx)(O.Z,{p:1,children:(0,_.jsx)(Z.ZP,{justifyContent:"flex-end",children:(0,_.jsx)(A.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,_.jsxs)(O.Z,{pb:1,pr:1,children:[o&&(0,_.jsx)(O.Z,{mt:1,pl:1,children:(0,_.jsx)(C.ZP,{muted:!0,small:!0,children:o})}),(0,_.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===R||void 0===R?void 0:R[e];if(!n)return(0,_.jsx)("div",{},e);var t=n.color,o=n.type,r=(0,S.qn)(o,{blockColor:t,theme:h}).accentLight;return(0,_.jsx)(O.Z,{ml:1,mt:1,children:(0,_.jsx)(A.ZP,{backgroundColor:r,compact:!0,disabled:!s,onClick:function(e){(0,Be.j)(e),c?c(n):null===s||void 0===s||s({block:mo(mo({},i),{},{upstream_blocks:[null===n||void 0===n?void 0:n.uuid]})})},small:!0,children:(0,_.jsx)(C.ZP,{monospace:!0,small:!0,children:e})})},e)}))})]})]})},bo=t(75634);function xo(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?xo(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):xo(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var yo=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,g=e.onChangeCodeBlock,x=e.pipeline,j=e.runBlock,y=e.runningBlocks,k=e.savePipelineContent,Z=e.selectedBlock,S=e.setAnyInputFocused,E=e.setErrors,I=e.setSelectedBlock,T=e.setTextareaFocused,M=e.showBrowseTemplates,A=e.textareaFocused,D=(0,f.useRef)(null),R=(0,f.useState)(!1),B=R[0],N=R[1],F=(s||{}).uuid,H=(x||{}).extensions,G=(0,f.useMemo)((function(){return(null===s||void 0===s?void 0:s.templates)||[]}),[s]),W=(0,f.useMemo)((function(){return null===H||void 0===H?void 0:H[F]}),[F,H]),K=(0,f.useMemo)((function(){return(null===W||void 0===W?void 0:W.blocks)||[]}),[W]),V=(0,f.useMemo)((function(){return(0,Ie.HK)(K,(function(e){return e.uuid}))}),[K]),q=(0,f.useMemo)((function(){return F===(null===Z||void 0===Z?void 0:Z.extension_uuid)&&V[null===Z||void 0===Z?void 0:Z.uuid]}),[V,F,Z]),Q=(0,f.useMemo)((function(){return y.reduce((function(e,n,t){return jo(jo({},e),{},(0,l.Z)({},n.uuid,jo(jo({},n),{},{priority:t})))}),{})}),[y]),X=(0,v.Db)((function(e){var n=e.block,t=e.upstream_blocks;return z.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,$.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)(X,2),ee=J[0],ne=J[1].isLoading,te=(0,f.useMemo)((function(){return K.map((function(e,n){var r=jo(jo({},e),{},{extension_uuid:F}),l=r.type,s=r.uuid,v=(null===Z||void 0===Z?void 0:Z.uuid)===s,P=Q[s],C=P?0===P.priority?ft.uF.BUSY:ft.uF.QUEUED:ft.uF.IDLE,M="".concat(l,"s/").concat(s,".py");return i.current[M]=(0,f.createRef)(),(0,_.jsx)(O.Z,{mt:w.cd,children:(0,_.jsx)(L.Z,{allBlocks:o,autocompleteItems:t,block:r,blockIdx:n,blockRefs:i,blocks:o,defaultValue:r.content,deleteBlock:function(e){c(jo(jo({},e),{},{extension_uuid:F})),S(!1)},executionState:C,extraContent:(0,_.jsx)(go,{block:r,blockActionDescription:"Click a block name to run expectations on it.",blocks:u,inputPlaceholder:"Select blocks to run expectations on",loading:ne,supportedUpstreamBlockLanguages:[b.t6.PYTHON],supportedUpstreamBlockTypes:[b.tf.DATA_EXPORTER,b.tf.DATA_LOADER,b.tf.DBT,b.tf.TRANSFORMER],updateBlock:ee}),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 g(l,s,e)},pipeline:x,ref:i.current[M],runBlock:j,runningBlocks:y,savePipelineContent:k,selected:v,setAnyInputFocused:S,setErrors:E,setSelected:function(e){return I(!0===e?r:null)},setTextareaFocused:T,textareaFocused:v&&A})},s)}))}),[t,i,o,u,c,K,F,a,d,p,ne,h,m,g,x,j,y,Q,k,Z,S,E,I,T,A,ee]),ie="Extensions/GreatExpectations/index",oe=(0,An.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&&q&&((0,ai.y)([Tn.zX,Tn.Um],n)||(0,ai.y)([Tn.PQ,Tn.Um],n))&&(e.preventDefault(),k())}),[q,k]),(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(O.Z,{mb:w.cd,children:[(0,_.jsx)(C.ZP,{default:!0,children:"Add an extension block to start writing expectations for blocks in the current pipeline."}),(0,_.jsx)(O.Z,{mt:1,children:(0,_.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,_.jsx)(P.Z,{href:"https://docs.mage.ai/development/testing/great-expectations",openNewWindow:!0,children:"Great Expectation power up"}),"."]})}),(0,_.jsx)(O.Z,{mt:1,children:(0,_.jsxs)(C.ZP,{default:!0,children:["For all available expectations, read Great Expectation\u2019s ",(0,_.jsx)(P.Z,{href:"https://greatexpectations.io/expectations/",openNewWindow:!0,children:"documentation"}),"."]})})]}),te,(0,_.jsx)(O.Z,{mt:w.cd,children:(0,_.jsx)(Sn.Z,{onClickOutside:function(){return N(!1)},open:!0,children:(0,_.jsx)(Wt.Z,{disableKeyboardShortcuts:!0,items:null===G||void 0===G?void 0:G.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:F,type:b.tf.EXTENSION},(null===K||void 0===K?void 0:K.length)||0)},tooltip:function(){return t},uuid:e.uuid}})).concat((0,ci.hr)((function(e){return n(jo(jo({},e),{},{extension_uuid:F,type:b.tf.EXTENSION}),(null===K||void 0===K?void 0:K.length)||0)}),b.tf.EXTENSION,null,{onlyCustomTemplate:!0,showBrowseTemplates:M})),onClickCallback:function(){return N(!1)},open:B,parentRef:D,uuid:"Extension",children:(0,_.jsx)(U.ZP,{beforeElement:(0,_.jsx)(bo.Wx,{teal:!0,children:(0,_.jsx)(Y.mm,{size:bo.ZG})}),inline:!0,onClick:function(e){e.preventDefault(),N(!0)},uuid:"AddNewBlocks/Extension",children:"Extension block"})})})})]})},ko=t(15610),Zo=t(69419),Po=["pipeline"];function Oo(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 Co(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Oo(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Oo(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var wo=function(e){var n=e.pipeline,t=(0,ge.Z)(e,Po),i=(0,h.useRouter)(),o=z.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,Ie.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 Co(Co({},t),{},{pipeline:n})}),[n,t]);(0,f.useEffect)((function(){var e;s(null===(e=(0,Zo.iV)())||void 0===e?void 0:e.extension)}),[i.asPath]);var p=(0,f.useMemo)((function(){return n?(fo.GREAT_EXPECTATIONS===c?e=yo:fo.DBT===c&&(e=vo),e?(0,_.jsx)(e,Co(Co({},d),{},{extensionOption:a})):void 0):null;var e}),[a,n,c,d]);return(0,_.jsx)(R.W,{backend:B.PD,children:(0,_.jsxs)(O.Z,{p:w.cd,children:[!c&&(0,_.jsxs)(O.Z,{mb:w.cd,children:[(0,_.jsxs)(C.ZP,{default:!0,children:["Power up your pipeline with extensions. Learn more about ",(0,_.jsx)(P.Z,{href:"https://docs.mage.ai/design/blocks/extension",openNewWindow:!0,children:"extension blocks"}),"."]}),(0,_.jsx)(O.Z,{mt:1,children:(0,_.jsxs)(C.ZP,{default:!0,children:["Click on a power up below to add and configure it for the ",(0,_.jsx)(C.ZP,{inline:!0,monospace:!0,children:null===n||void 0===n?void 0:n.uuid})," pipeline."]})})]}),!o&&!c&&(0,_.jsx)(W.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,_.jsx)(O.Z,{mt:n>=1?w.cd:0,children:(0,_.jsx)(P.Z,{block:!0,noHoverUnderline:!0,onClick:function(){return(0,ko.u)({extension:r},{pushHistory:!0})},preventDefault:!0,children:(0,_.jsx)(Kn.Z,{dark:!0,children:(0,_.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,_.jsxs)(k.Z,{alignItems:"center",children:[(0,_.jsx)(De.Z,{fullWidth:!1,children:(0,_.jsx)(O.Z,{p:w.cd,children:(0,_.jsx)(Z.ZP,{alignItems:"center",children:(0,_.jsx)("img",{alt:o,height:3*w.iI,src:"".concat(i.basePath,"/images/extensions/").concat(r,"/logo.png"),width:3*w.iI})})})}),(0,_.jsx)(O.Z,{mr:w.cd}),(0,_.jsxs)(k.Z,{flexDirection:"column",children:[(0,_.jsx)(C.ZP,{bold:!0,children:o}),(0,_.jsx)(C.ZP,{default:!0,small:!0,children:t})]})]}),(0,_.jsx)(Y._Q,{})]})})})},r)})))]})})},So=t(28385),_o=t(9134),Eo=t(83784),Io=t(30229),To=t(8916);var Mo=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)(),g=m[0],x=m[1],j=null===t||void 0===t?void 0:t.uuid,y=(0,v.Db)(z.ZP.variables.pipelines.useCreate(j),{onSuccess:function(e){return(0,$.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],S=(0,v.Db)((function(e){return z.ZP.variables.pipelines.useDelete(j,e)()}),{onSuccess:function(e){return(0,$.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)(S,1)[0],I=(0,f.useCallback)((function(e){if("Enter"===e.key){var t=g;try{t=JSON.parse(g)}catch(i){}k({variable:{name:p,value:t}}).then((function(){n(),h(null),x(null)})),(0,si.ez)(),a(!1)}else"Escape"===e.key&&((0,si.ez)(),a(!1))}),[k,n,p,g]),T=(0,f.useMemo)((function(){return u-4*w.iI}),[u]),M=(0,f.useMemo)((function(){return(0,To.wx)(l,(function(e){return e.uuid===Eo.C}))}),[l]),A=(0,f.useMemo)((function(){return(0,To.wx)(l,(function(e){return e.uuid===(null===i||void 0===i?void 0:i.uuid)}))}),[i,l]),D=(0,f.useMemo)((function(){return(0,_.jsxs)(Ei,{width:T,children:[s&&(0,_.jsxs)(wi.Z,{children:[(0,_.jsx)(Ci.Z,{md:1,children:(0,_.jsx)(Ii,{noPadding:!0,children:(0,_.jsx)(U.ZP,{backgroundColor:Ti.qJ,borderless:!0,centerText:!0,muted:!0,onClick:function(){navigator.clipboard.writeText(p),Gn.Am.success("Successfully copied to clipboard.",{position:Gn.Am.POSITION.BOTTOM_RIGHT,toastId:p})},uuid:"Sidekick/GlobalVariables/".concat(p),withIcon:!0,children:(0,_.jsx)(Y.CK,{size:2.5*w.iI})})})}),(0,_.jsx)(Ci.Z,{md:4,children:(0,_.jsx)(Ii,{children:(0,_.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,_.jsx)(Ci.Z,{md:7,children:(0,_.jsx)(Ii,{children:(0,_.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:g})})})]}),null===M||void 0===M?void 0:M.map((function(e){return(0,_.jsx)(Ai,{deleteVariable:function(){return E(e.uuid)},fetchVariables:n,pipelineUUID:j,variable:e},e.uuid)}))]})}),[E,M,p,g,j,h,x,a,s,T]),R=(0,f.useMemo)((function(){return(0,_.jsx)(Ei,{width:T,children:null===A||void 0===A?void 0:A.map((function(e){return(0,_.jsx)(Ai,{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}))})}),[A,i,T]);return(0,_.jsxs)(O.Z,{p:w.cd,children:[(0,_.jsx)(O.Z,{mb:w.cd,children:(0,_.jsxs)(Z.ZP,{alignItems:"center",children:[(0,_.jsx)(ue.Z,{level:4,monospace:!0,children:"Global Variables"}),(0,_.jsx)(O.Z,{ml:2}),(0,_.jsx)(U.ZP,{Icon:Y.mm,blackBorder:!0,inline:!0,onClick:function(){return a((function(e){return!e}))},uuid:"Sidekick/GlobalVariables/addNewVariable",children:"New"})]})}),(0,_.jsx)(O.Z,{mb:w.cd,children:(0,_.jsxs)(C.ZP,{muted:!0,children:["Press ",(0,_.jsx)(C.ZP,{bold:!0,default:!0,inline:!0,monospace:!0,children:"Enter"})," or ",(0,_.jsx)(C.ZP,{bold:!0,default:!0,inline:!0,monospace:!0,children:"Return"})," to save changes."]})}),(0,_.jsx)(O.Z,{mb:w.cd,children:D}),(0,_.jsx)(O.Z,{mb:w.cd,children:(0,_.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,_.jsxs)(O.Z,{mb:w.cd,children:[(0,_.jsxs)(C.ZP,{bold:!0,large:!0,children:["For Python (",(0,_.jsx)(P.Z,{href:"https://docs.mage.ai/production/configuring-production-settings/runtime-variable",large:!0,openNewWindow:!0,primary:!0,children:"docs"}),"):"]}),(0,_.jsx)(_o.Z,{language:"python",small:!0,source:"\n var = kwargs['variable_name']\n"})]}),(0,_.jsxs)(O.Z,{mb:w.cd,children:[(0,_.jsxs)(C.ZP,{bold:!0,large:!0,children:["For SQL (",(0,_.jsx)(P.Z,{href:"https://docs.mage.ai/guides/sql-blocks#variables",large:!0,openNewWindow:!0,primary:!0,children:"docs"}),"):"]}),(0,_.jsx)(_o.Z,{language:"sql",small:!0,source:"\n {{ variable_name }}\n"})]}),(0,_.jsxs)(O.Z,{mb:w.cd,children:[(0,_.jsxs)(C.ZP,{bold:!0,large:!0,children:["For R (",(0,_.jsx)(P.Z,{href:"https://docs.mage.ai/guides/r-blocks#runtime-variables",large:!0,openNewWindow:!0,primary:!0,children:"docs"}),"):"]}),(0,_.jsx)(_o.Z,{language:"r",small:!0,source:"\n var <- global_vars['variable_name']\n"})]}),(0,_.jsxs)(O.Z,{mb:w.cd,children:[(0,_.jsx)(ue.Z,{level:4,monospace:!0,children:"Trigger Runtime Variables"}),(0,_.jsx)(O.Z,{mb:w.cd}),(0,_.jsx)(C.ZP,{children:"Depending on what kind of trigger you use for this pipeline, some default runtime variables will be provided."})]}),Object.values(Io.Xm).map((function(e,n){var t;return(0,_.jsxs)(O.Z,{mb:w.cd,children:[(0,_.jsx)(O.Z,{mb:w.cd,children:(0,_.jsx)(C.ZP,{large:!0,monospace:!0,children:(0,J.vg)(null===(t=Io.Z4[e])||void 0===t?void 0:t.call(Io.Z4))})}),(0,To.JZ)([],e).map((function(n,t){return(0,_.jsx)(Ai,{hideEdit:!0,pipelineUUID:j,variable:n},"var_".concat(e,"_").concat(t))}))]},"".concat(e,"_").concat(n))})),A&&A.length>0&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(O.Z,{my:2,children:(0,_.jsx)(ue.Z,{level:4,monospace:!0,children:"Block Output Variables"})}),(0,_.jsx)(O.Z,{mb:2,children:R}),(0,_.jsx)(O.Z,{mb:w.cd,children:(0,_.jsxs)(C.ZP,{children:["Output variables can be used in any ",(0,_.jsx)(C.ZP,{bold:!0,inline:!0,monospace:!0,warning:!0,children:b.tf.SCRATCHPAD})," block. They are for scratchpad blocks, specifically. To get upstream block outputs inside of other blocks, use the positional arguments."]})}),(0,_.jsx)(O.Z,{mb:w.cd,children:(0,_.jsx)(C.ZP,{children:"To load the variable in a scratchpad block, use the following syntax:"})}),(0,_.jsx)(O.Z,{mb:w.cd,children:(0,_.jsx)(_o.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"})})]})]})},Ao=t(89565),Do=t.n(Ao),Ro=t(88494),Bo=p.default.div.withConfig({displayName:"indexstyle__OutputHeaderStyle",componentId:"sc-wkjnrg-0"})([""," overflow-x:auto;"],(0,Ke.y$)()),No=p.default.div.withConfig({displayName:"indexstyle__OutputContainerStyle",componentId:"sc-wkjnrg-1"})([""," overflow-y:scroll;"," ",""],Ke.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 Lo(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 Uo(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Lo(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Lo(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Fo=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,si.ez)(),i()}),[i]),d=(0,f.useCallback)((function(){(0,si.ez)(),n()}),[n]),p=(0,f.useCallback)((function(){var e=!r;u(e),(0,kn.t8)(kn.Q9,e)}),[r,u]);return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(Bo,{children:(0,_.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,_.jsxs)(k.Z,{children:[(0,_.jsx)(A.ZP,{beforeIcon:(0,_.jsx)(Y.JM,{inverted:!0,size:2*w.iI}),compact:o,disabled:o,loading:o,onClick:a,success:!0,children:(0,_.jsx)(C.ZP,{bold:!0,inverted:!0,noWrapping:!0,primary:!1,children:"Execute pipeline"})}),(0,_.jsx)(O.Z,{ml:1}),o&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(A.ZP,{beforeIcon:(0,_.jsx)(Y.x8,{inverted:!0,size:2*w.iI}),onClick:d,success:!0,children:(0,_.jsx)(C.ZP,{bold:!0,inverted:!0,noWrapping:!0,primary:!1,children:"Cancel pipeline"})}),(0,_.jsx)(O.Z,{ml:1})]}),(0,_.jsx)(A.ZP,{onClick:t,secondary:!0,children:(0,_.jsx)(C.ZP,{bold:!0,noWrapping:!0,children:"Running status"})})]}),(0,_.jsxs)(k.Z,{alignItems:"center",children:[(0,_.jsx)(O.Z,{ml:1}),(0,_.jsx)(C.ZP,{children:"Hide"}),(0,_.jsx)(O.Z,{mr:1}),(0,_.jsx)(Pe.Z,{checked:r,onCheck:p})]})]})}),!r&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(O.Z,{mb:1}),(0,_.jsx)(No,{noScrollbarTrackBackground:!0,children:(0,_.jsx)(Ro.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 ft.jU.includes(i)?o=(0,_.jsx)(Ro.T5,Uo(Uo({},l),{},{children:(0,_.jsx)(C.ZP,{monospace:!0,preWrap:!0,children:(0,_.jsx)(Do(),{children:e})})})):i===ft.Gi.IMAGE_PNG&&(o=(0,_.jsx)("div",{style:{backgroundColor:"white"},children:(0,_.jsx)("img",{alt:"Image ".concat(n," from code output"),src:"data:image/png;base64, ".concat(e)})})),(0,_.jsx)("div",{children:o},"code-output-".concat(n,"-").concat(t))}))}))})})]})]})},Ho=t(81769),Go=(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;"," "," "," "," "," "," ",""],S.Kf,(function(e){return!e.noBorderRadiusTop&&"\n border-top-left-radius: ".concat(_e.n_,"px;\n border-top-right-radius: ").concat(_e.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(_e.n_,"px;\n border-bottom-right-radius: ").concat(_e.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 ")}))),Wo=(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,ze.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;",""],Ke.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;"," "," "," "," ",""],_e.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 ")}))),Ko=t(19452);function zo(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 Yo(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?zo(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):zo(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Vo=function(e){var n,t,i,o,l=e.index,u=e.permission,c=e.setPermissions,s=e.updatePermission;return(0,_.jsx)(Go,{children:(0,_.jsx)(O.Z,{p:w.cd,children:(0,_.jsxs)(Z.ZP,{alignItems:"flex-start",flexDirection:"row",children:[(0,_.jsx)(A.ZP,{iconOnly:!0,onClick:function(){return c((function(e){return(0,Ie.oM)(e,l)}))},children:(0,_.jsx)(Y.x8,{})}),(0,_.jsx)(O.Z,{mr:w.cd}),(0,_.jsxs)(Z.ZP,{flexDirection:"column",children:[(0,_.jsxs)(Z.ZP,{alignItems:"center",flexDirection:"row",children:[(0,_.jsx)(ue.Z,{level:5,children:"Triggers"}),(0,_.jsx)(O.Z,{mr:w.cd}),(0,_.jsx)(Z.ZP,{alignItems:"center",children:(0,_.jsx)(A.ZP,{beforeIcon:(0,_.jsx)(Y.mm,{}),compact:!0,onClick:function(e){(0,Be.j)(e),s(Yo(Yo({},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,_.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,_.jsx)(O.Z,{mt:n>=1?1:0,children:(0,_.jsxs)(Z.ZP,{alignItems:"center",children:[(0,_.jsx)(A.ZP,{iconOnly:!0,noBackground:!0,noBorder:!0,onClick:function(e){(0,Be.j)(e);var t=(0,Ie.oM)((null===u||void 0===u?void 0:u.triggers)||[],n);s(Yo(Yo({},u),{},{triggers:t}))},children:(0,_.jsx)(Y.x8,{})}),(0,_.jsx)(O.Z,{mr:1}),(0,_.jsx)(G.Z,{compact:!0,onChange:function(e){var t,i=e.target.value,o=Yo({},u),r=Yo({},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(Io.Z4).map((function(e){var n=(0,r.Z)(e,2),t=n[0],i=n[1];return(0,_.jsx)("option",{value:t,children:(0,J.kC)(i())},t)}))}),(Io.Xm.TIME===i||!i)&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(O.Z,{mr:1}),(0,_.jsx)(G.Z,{compact:!0,monospace:!0,onChange:function(e){var t,i=e.target.value,o=Yo({},u),r=Yo({},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:Io.Wb.map((function(e){return(0,_.jsx)("option",{value:e,children:e},e)}))})]})]})},"permission-trigger-".concat(l,"-").concat(n,"-").concat(o))}))})]}),(0,_.jsx)(O.Z,{mr:w.Mq}),(0,_.jsxs)(Z.ZP,{flexDirection:"column",children:[(0,_.jsxs)(Z.ZP,{alignItems:"center",flexDirection:"row",children:[(0,_.jsx)(ue.Z,{level:5,children:"Roles"}),(0,_.jsx)(O.Z,{mr:w.cd}),(0,_.jsx)(Z.ZP,{alignItems:"center",children:(0,_.jsx)(A.ZP,{beforeIcon:(0,_.jsx)(Y.mm,{}),compact:!0,onClick:function(e){(0,Be.j)(e),s(Yo(Yo({},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,_.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,_.jsx)(O.Z,{mt:n>=1?1:0,children:(0,_.jsxs)(Z.ZP,{alignItems:"center",children:[(0,_.jsx)(A.ZP,{iconOnly:!0,noBackground:!0,noBorder:!0,onClick:function(e){(0,Be.j)(e);var t=(0,Ie.oM)((null===u||void 0===u?void 0:u.roles)||[],n);s(Yo(Yo({},u),{},{roles:t}))},children:(0,_.jsx)(Y.x8,{})}),(0,_.jsx)(O.Z,{mr:1}),(0,_.jsx)(G.Z,{compact:!0,monospace:!0,onChange:function(e){var t,i=e.target.value,o=Yo({},u),r=Yo({},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:Ko.Z3.map((function(e){return(0,_.jsx)("option",{value:e,children:e},e)}))})]})},"permission-role-".concat(l,"-").concat(n,"-").concat(i))}))})]})]})})})},qo=t(35576),Qo=t(3917);function Xo(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?Xo(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Xo(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var $o=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,g=e.savePipelineInteraction,x=e.selectedBlock,j=e.setBlockInteractionsMapping,P=e.setInteractionsMapping,S=e.setPermissions,E=e.setSelectedBlock,I=e.updatePipelineInteraction,T=(0,f.useRef)(null),M=(0,f.useRef)(null),D=(0,f.useRef)(null),R=(0,f.useState)(null),B=R[0],N=R[1],L=(0,f.useState)(null),U=L[0],F=L[1],H=(0,f.useState)(!1),G=H[0],W=H[1],z=(0,f.useState)(null),V=z[0],q=z[1],Q=(0,f.useState)(!1),X=Q[0],J=Q[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],ce=(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||W(!0),"undefined"!==typeof j?j(e):le(e)}),[j,le,W]),de=(0,f.useCallback)((function(e,n){return null!==n&&void 0!==n&&n.initialBootstrap||W(!0),"undefined"!==typeof P?P(e):ie(e)}),[P,ie,W]),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,Ie.oM)(u,n):u[n]=Jo(Jo({},u[n]),t),Jo(Jo({},r),{},(0,l.Z)({},e,u))}))}),[ae]),me=(0,f.useCallback)((function(e,n){F(Number(new Date)),null!==n&&void 0!==n&&n.initialBootstrap||W(!0),"undefined"!==typeof S?S(e):ve(e)}),[F,S,ve,W]),ge=(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(U,"-").concat(t)}})),triggers:null===i||void 0===i?void 0:i.map((function(e,t){return Jo(Jo({},e),{},{uuid:"".concat(n,"-").concat(U,"-").concat(t)})})),uuid:"".concat(n,"-").concat(U)}}))}),[U,p,fe]),be=(0,f.useCallback)((function(){N(Number(new Date)),W(!1)}),[N,W]),xe=(0,f.useCallback)((function(){g?null===g||void 0===g||g().then((function(){return be()})):null===I||void 0===I||I(Jo(Jo({},h),{},{blocks:ce,interactions:se,permissions:null===ge||void 0===ge?void 0:ge.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 be()}))}),[ce,se,ge,h,be,g,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 Jo(Jo({},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,Ie.HK)(c||[],(function(e){return e.uuid})),{initialBootstrap:!0})}),[c,se,s,de]),(0,f.useEffect)((function(){"undefined"===typeof i&&!ce&&null!==h&&void 0!==h&&h.blocks&&ae(null===h||void 0===h?void 0:h.blocks,{initialBootstrap:!0})}),[ce,i,h,ae]),(0,f.useEffect)((function(){!ge&&null!==h&&void 0!==h&&h.permissions&&me(null===h||void 0===h?void 0:h.permissions,{initialBootstrap:!0})}),[ge,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===ce||void 0===ce?void 0:ce[o])||[],u=(null===l||void 0===l?void 0:l.length)>=1,c=(0,_.jsxs)(A.ZP,{beforeIcon:u?(0,_.jsx)(Y.I8,{}):(0,_.jsx)(Y.mm,{}),compact:!0,onClick:function(e){(0,Be.j)(e),E(t)},primary:!u,secondary:u,small:!0,children:[u&&"Edit interactions",!u&&"Add interactions"]});e.push((0,_.jsx)(It.Z,{first:0==i,noBorderRadius:i>=1,noPaddingContent:!0,titleXPadding:w.cd*w.iI,titleYPadding:1.5*w.iI,title:(0,_.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,_.jsx)(O.Z,{mr:w.cd,py:1,children:(0,_.jsx)(C.ZP,{large:!0,monospace:!0,children:o})}),u&&(0,_.jsx)(Z.ZP,{alignItems:"center",children:c})]}),children:(0,_.jsx)(Go,{noBackground:!0,noBorderRadiusBottom:i<n-1,noBorderRadiusTop:!0,children:(0,_.jsxs)(O.Z,{p:w.cd,children:[!u&&c,null===l||void 0===l?void 0:l.map((function(e,n){return(0,_.jsx)(O.Z,{mt:n>=1?w.HN:0,children:(0,_.jsx)(Ho.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,_.jsx)(Et.Z,{noBackground:!0,noBorder:!0,noBoxShadow:!0,visibleMapping:ye,children:ke})}),[je,ke,ye]),Pe=(0,f.useMemo)((function(){return(null===ce||void 0===ce?void 0:ce[null===x||void 0===x?void 0:x.uuid])||[]}),[ce,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,_.jsxs)(Z.ZP,{alignItems:"center",children:[!X&&(0,_.jsx)(_.Fragment,{children:(0,_.jsx)(A.ZP,{beforeIcon:(0,_.jsx)(Y.mm,{}),compact:e,onClick:function(e){(0,Be.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"})}),X&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(K.Z,{compact:!0,monospace:!0,onChange:function(e){(0,Be.j)(e),q(e.target.value)},onClick:function(e){return(0,Be.j)(e)},ref:M,small:!0,value:V||""}),(0,_.jsx)(O.Z,{mr:1}),(0,_.jsx)(A.ZP,{compact:e,loading:a,onClick:function(e){(0,Be.j)(e),u({block_uuid:null===x||void 0===x?void 0:x.uuid,inputs:{},layout:[],uuid:"".concat(V,".").concat(b.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 Jo(Jo({},e),{},(0,l.Z)({},t,n))})),setTimeout((function(){var e;null===D||void 0===D||null===(e=D.current)||void 0===e||e.scrollIntoView()}),It.e+100)})),J(!1),ee(V),q(null)},primary:!0,small:e,children:"Save interaction"}),(0,_.jsx)(O.Z,{mr:1}),(0,_.jsx)(A.ZP,{compact:e,onClick:function(e){(0,Be.j)(e),J(!1),q(null)},secondary:!0,small:e,children:"Cancel"})]})]})}),[x,Pe,X,a,V,de,J,ee,q,he]);return(0,_.jsxs)(O.Z,{p:w.cd,style:{position:"relative"},children:[(0,_.jsxs)(O.Z,{pb:w.cd,ref:T,children:[!x&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(O.Z,{mb:w.cd,children:(0,_.jsx)(ue.Z,{children:"Blocks with interactions"})}),Ze,(0,_.jsxs)(O.Z,{mb:w.cd,mt:w.HN,children:[(0,_.jsxs)(Z.ZP,{alignItems:"center",children:[(0,_.jsx)(ue.Z,{children:"Permissions"}),(0,_.jsx)(O.Z,{mr:w.cd}),(0,_.jsx)(Z.ZP,{alignItems:"center",children:(0,_.jsx)(A.ZP,{beforeIcon:(0,_.jsx)(Y.mm,{}),compact:!0,onClick:function(){return me((function(e){return e.concat([{roles:[],triggers:[]}])}))},secondary:!0,small:!0,children:"Add permission"})})]}),(0,_.jsx)(O.Z,{mt:1,children:(0,_.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===ge||void 0===ge?void 0:ge.map((function(e,n){return(0,_.jsx)(O.Z,{mt:n>=1?w.cd:0,children:(0,_.jsx)(Vo,{index:n,permission:e,setPermissions:me,updatePermission:function(e){var t=(0,o.Z)(ge);t[n]=e,me(t)}})},"permission-".concat(n))}))]}),x&&(0,_.jsxs)(O.Z,{mb:w.Mq,children:[(0,_.jsxs)(O.Z,{mb:w.Mq,children:[(0,_.jsxs)(Z.ZP,{alignItems:"center",children:[(0,_.jsx)(O.Z,{mr:w.cd,py:1,children:(0,_.jsx)(ue.Z,{children:"Block interactions"})}),(null===Pe||void 0===Pe?void 0:Pe.length)>=1&&Ce]}),(0,_.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,_.jsxs)(Z.ZP,{alignItems:"center",children:[(0,_.jsx)(C.ZP,{bold:!0,large:!0,children:"Variables"}),(0,_.jsx)(O.Z,{mr:w.cd}),(0,_.jsx)(k.Z,{alignItems:"center",flex:1,children:null===Oe||void 0===Oe?void 0:Oe.map((function(e,n){return(0,_.jsx)(O.Z,{mr:1,children:(0,_.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,_.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,_.jsxs)("div",{children:[n>=1&&(0,_.jsx)(O.Z,{my:w.HN,children:(0,_.jsx)(y.Z,{light:!0})}),(0,_.jsx)(Ho.Z,{blockInteraction:e,containerRef:T,containerWidth:r,interaction:s,isEditing:!0,removeBlockInteraction:function(){return he(u,n,e,{remove:!0})},setInteractionsMapping:de,children:(0,_.jsxs)(O.Z,{p:w.cd,children:[(0,_.jsxs)(Z.ZP,{alignItems:"flex-start",children:[(0,_.jsxs)(O.Z,{mb:1,style:{width:20*w.iI},children:[(0,_.jsx)(C.ZP,{bold:!0,large:!0,children:"Label"}),(0,_.jsxs)(C.ZP,{muted:!0,children:["Add a label for this",(0,_.jsx)("br",{}),"set of interactions."]})]}),(0,_.jsx)(O.Z,{mr:w.cd}),(0,_.jsx)(k.Z,{flex:1,children:(0,_.jsx)(K.Z,{fullWidth:!0,onChange:function(e){return he(u,n,{name:e.target.value})},value:l||""})})]}),(0,_.jsx)(O.Z,{mb:w.cd}),(0,_.jsxs)(Z.ZP,{alignItems:"flex-start",children:[(0,_.jsxs)(O.Z,{mb:1,style:{width:20*w.iI},children:[(0,_.jsx)(C.ZP,{bold:!0,large:!0,children:"Description"}),(0,_.jsxs)(C.ZP,{muted:!0,children:["Describe how these",(0,_.jsx)("br",{}),"interactions are used."]})]}),(0,_.jsx)(O.Z,{mr:w.cd}),(0,_.jsx)(k.Z,{flex:1,children:(0,_.jsx)(qo.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,_.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,_.jsx)(Wo,{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,_.jsx)(O.Z,{p:w.cd,children:(0,_.jsxs)(Z.ZP,{alignItems:"center",children:[(0,_.jsx)(A.ZP,{beforeIcon:(0,_.jsx)(Y.vc,{}),loading:d,onClick:function(){return xe()},primary:G,secondary:!G,children:"Save changes for all interactions"}),(0,_.jsx)(O.Z,{mr:w.cd}),G&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(Y.uy,{warning:!0}),(0,_.jsx)(O.Z,{mr:1}),(0,_.jsx)(C.ZP,{warning:!0,children:"You have unsaved interaction changes"})]}),!G&&B&&(0,_.jsxs)(C.ZP,{muted:!0,children:["Interactions last saved at ",(0,Qo.JX)(Number(B)/1e3)]})]})})})]})};var er=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],g=h[1],b=(0,f.useMemo)((function(){return l-w.cd*w.iI*2}),[l]),x=(0,v.Db)(z.ZP.secrets.useCreate(),{onSuccess:function(e){return(0,$.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 z.ZP.secrets.useDelete(e)()}),{onSuccess:function(e){return(0,$.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),g(null)})),(0,si.ez)(),s(!1)):"Escape"===e.key&&((0,si.ez)(),s(!1))}),[j,n,d,m]),S=(0,f.useCallback)((function(e){(0,si.ez)(),k(e)}),[k]);return(0,_.jsxs)(O.Z,{p:w.cd,children:[(0,_.jsx)(O.Z,{mb:w.cd,children:(0,_.jsxs)(Z.ZP,{alignItems:"center",children:[(0,_.jsx)(ue.Z,{level:4,monospace:!0,children:"Secrets"}),(0,_.jsx)(O.Z,{ml:2}),(0,_.jsx)(U.ZP,{Icon:Y.mm,blackBorder:!0,inline:!0,onClick:function(){return s((function(e){return!e}))},uuid:"Sidekick/Secrets/addNewSecret",children:"New"})]})}),(0,_.jsx)(O.Z,{mb:w.cd,children:(0,_.jsxs)(C.ZP,{children:[(0,_.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,_.jsx)(O.Z,{mb:w.cd,children:(0,_.jsxs)(C.ZP,{muted:!0,children:["Press ",(0,_.jsx)(C.ZP,{bold:!0,default:!0,inline:!0,monospace:!0,children:"Enter"})," or ",(0,_.jsx)(C.ZP,{bold:!0,default:!0,inline:!0,monospace:!0,children:"Return"})," to save changes."]})}),(0,_.jsx)(O.Z,{mb:w.cd,children:(0,_.jsxs)(Ei,{width:b,children:[c&&(0,_.jsxs)(wi.Z,{children:[(0,_.jsx)(Ci.Z,{md:1,children:(0,_.jsx)(Ii,{noPadding:!0,children:(0,_.jsx)(U.ZP,{backgroundColor:Ti.qJ,borderless:!0,centerText:!0,muted:!0,onClick:function(){navigator.clipboard.writeText("{{ mage_secret_var(".concat(d,") }}")),Gn.Am.success("Successfully copied to clipboard.",{position:Gn.Am.POSITION.BOTTOM_RIGHT,toastId:d})},uuid:"Sidekick/Secrets/".concat(d),withIcon:!0,children:(0,_.jsx)(Y.CK,{size:2.5*w.iI})})})}),(0,_.jsx)(Ci.Z,{md:4,children:(0,_.jsx)(Ii,{children:(0,_.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,_.jsx)(Ci.Z,{md:7,children:(0,_.jsx)(Ii,{children:(0,_.jsx)(K.Z,{borderless:!0,compact:!0,fullWidth:!0,monospace:!0,onChange:function(e){g(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,_.jsx)(Ai,{copyText:e.name,deleteVariable:function(){return S(e.name)},fetchVariables:n,hideEdit:!0,obfuscate:!0,pipelineUUID:t,variable:{uuid:e.name,value:e.value}},e.name)}))]})}),(0,_.jsx)(O.Z,{mb:w.cd,children:(0,_.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,_.jsx)(O.Z,{mb:w.cd,children:(0,_.jsx)(_o.Z,{language:"yaml",maxWidth:b,small:!0,source:"\n \"{{ mage_secret_var('<secret_name>') }}\"\n "})}),(0,_.jsx)(O.Z,{mb:w.cd,children:(0,_.jsx)(C.ZP,{children:"To reference a secret in code, you can import the `get_secret_value` helper method:"})}),(0,_.jsx)(O.Z,{mb:w.cd,children:(0,_.jsx)(_o.Z,{language:"python",maxWidth:b,small:!0,source:"\n from mage_ai.data_preparation.shared.secrets import get_secret_value\n\n get_secret_value('<secret_name>')\n "})})]})},nr=t(28026),tr=t(68899),ir=t(15752),or=t(91835);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.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,g=e.messages,x=(e.onChangeCallbackBlock,e.onChangeCodeBlock),j=e.onSelectBlockFile,y=e.pipeline,k=e.runBlock,Z=e.runningBlocks,S=e.savePipelineContent,E=e.selectedBlock,I=e.setAnyInputFocused,T=e.setErrors,M=e.setHiddenBlocks,A=e.setSelectedBlock,D=e.setTextareaFocused,R=e.showBrowseTemplates,B=e.showUpdateBlockModal,N=e.textareaFocused,F=(0,f.useRef)(null),H=(0,f.useState)(!1),G=H[0],W=H[1],K=(0,Zo.iV)().block_uuid;(0,f.useEffect)((function(){var e=c.find((function(e){var n,t=e.uuid;return(null===K||void 0===K||null===(n=K.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 lr(lr({},n),{},(0,l.Z)({},e.uuid,!1))})),j(e.uuid,e.type,null)))}),[K,c,j,E,M]);var V=(y||{}).type,q=(0,f.useMemo)((function(){return(0,Ie.HK)(t||[],(function(e){return e.uuid}))}),[t]),Q=z.ZP.block_templates.list({},{revalidateOnFocus:!1}).data,X=(0,f.useMemo)((function(){return(null===Q||void 0===Q?void 0:Q.block_templates)||[]}),[Q]),ee=(0,f.useCallback)((function(e){return n(e,(null===q||void 0===q?void 0:q.length)||0)}),[n,q]),ne=(0,f.useMemo)((function(){return(0,ci.oM)(X,ee)}),[ee,X]),te=(0,f.useMemo)((function(){return(0,ci.hr)(ee,i,V,{blockTemplatesByBlockType:ne,languages:[b.t6.PYTHON],showBrowseTemplates:R})}),[ee,i,ne,V]),ie=(0,f.useMemo)((function(){return null===q||void 0===q?void 0:q[null===E||void 0===E?void 0:E.uuid]}),[q,E]),oe=(0,f.useMemo)((function(){return Z.reduce((function(e,n,t){return lr(lr({},e),{},(0,l.Z)({},n.uuid,lr(lr({},n),{},{priority:t})))}),{})}),[Z]),re=(0,v.Db)((function(e){var n=e.block,t=e.upstream_blocks;return z.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,$.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?ft.uF.BUSY:ft.uF.QUEUED:ft.uF.IDLE,C="".concat(t,"s/").concat(i,".py");return u.current[C]=(0,f.createRef)(),(0,_.jsx)(O.Z,{mt:w.cd,children:(0,_.jsx)(L.Z,{allBlocks:c,autocompleteItems:o,block:e,blockIdx:n,blockRefs:u,blocks:c,defaultValue:e.content,deleteBlock:function(e){a(lr({},e)),I(!1)},executionState:P,extraContent:(0,_.jsx)(go,{block:e,blocks:s,inputPlaceholder:"Select blocks to add ".concat((0,J._6)(d,null)," to"),loading:ce,onClickTag:function(e){M((function(n){return lr(lr({},n),{},(0,l.Z)({},e.uuid,!1))})),j(e.uuid,e.type,null)},supportedUpstreamBlockTypes:[b.tf.CUSTOM,b.tf.DATA_EXPORTER,b.tf.DATA_LOADER,b.tf.DBT,b.tf.SCRATCHPAD,b.tf.SENSOR,b.tf.TRANSFORMER],updateBlock:ue}),fetchFileTree:p,fetchPipeline:h,hideRunButton:!0,interruptKernel:m,messages:g[i],noDivider:!0,onChange:function(e){return x(t,i,e)},pipeline:y,ref:u.current[C],runBlock:k,runningBlocks:Z,savePipelineContent:S,showUpdateBlockModal:B,selected:r,setAnyInputFocused:I,setErrors:T,setSelected:function(n){return A(!0===n?e:null)},setTextareaFocused:D,textareaFocused:r&&N})},i)}))}),[t,o,u,c,s,a,d,p,h,m,ce,g,x,j,y,k,Z,oe,S,E,I,T,M,A,D,B,N,ue]),ae="".concat(d,"/index"),de=(0,An.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,ai.y)([Tn.zX,Tn.Um],n)||(0,ai.y)([Tn.PQ,Tn.Um],n))&&(e.preventDefault(),S())}),[ie,S]),(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(O.Z,{mb:w.cd,children:[(0,_.jsxs)(C.ZP,{default:!0,children:["Run 1 or more ",(0,J.wX)(d)," block functions whenever another block succeeds or fails."]}),(0,_.jsx)(O.Z,{mt:1,children:(0,_.jsxs)(C.ZP,{default:!0,children:["Learn more about ",(0,_.jsx)(P.Z,{href:"https://docs.mage.ai/development/blocks/".concat((0,J.wX)((0,J._6)(d,null)),"/overview"),openNewWindow:!0,children:(0,J.wX)((0,J._6)(d,null))}),"."]})})]}),se,(0,_.jsx)(O.Z,{mt:w.cd,children:(0,_.jsx)(Sn.Z,{onClickOutside:function(){return W(!1)},open:!0,children:(0,_.jsx)(Wt.Z,{disableKeyboardShortcuts:!0,items:te,onClickCallback:function(){return W(!1)},open:G,parentRef:F,uuid:d,children:(0,_.jsxs)(U.ZP,{beforeElement:(0,_.jsx)(bo.Wx,{rose:i===b.tf.CALLBACK,children:(0,_.jsx)(Y.mm,{size:bo.ZG})}),inline:!0,onClick:function(e){e.preventDefault(),W(!0)},uuid:"AddNewBlocks/".concat(d),children:[(0,J.kC)(d)," block"]})})})})]})},cr=t(26084);function sr(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 ar(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?sr(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):sr(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var dr=[{Icon:Y.AQ,name:"Callbacks",uuid:cr.Q.CALLBACK},{Icon:Y.hW,name:"Conditionals",uuid:cr.Q.CONDITIONAL}];var pr=function(e){var n=(0,or.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,Zo.iV)())||void 0===e?void 0:e.addon)}),[t.asPath]);var l=(0,f.useMemo)((function(){var e,t;if(cr.Q.CALLBACK===o)e={addOnBlockType:b.tf.CALLBACK,addOnBlocks:null===(t=n.pipeline)||void 0===t?void 0:t.callbacks,displayBlockName:"callback"};else if(cr.Q.CONDITIONAL===o){var i;e={addOnBlockType:b.tf.CONDITIONAL,addOnBlocks:null===(i=n.pipeline)||void 0===i?void 0:i.conditionals,displayBlockName:"conditional"}}if(e)return(0,_.jsx)(ur,ar(ar({},e),n))}),[n,o]);return(0,_.jsx)(R.W,{backend:B.PD,children:(0,_.jsxs)(O.Z,{p:w.cd,children:[l,!o&&(null===dr||void 0===dr?void 0:dr.map((function(e,n){var t=e.name,i=e.uuid,o=e.Icon;return(0,_.jsx)(O.Z,{mt:n>=1?w.cd:0,children:(0,_.jsx)(P.Z,{block:!0,noHoverUnderline:!0,onClick:function(){return(0,ko.u)({addon:i},{pushHistory:!0})},preventDefault:!0,children:(0,_.jsx)(Kn.Z,{dark:!0,children:(0,_.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,_.jsxs)(k.Z,{alignItems:"center",children:[(0,_.jsx)(De.Z,{fullWidth:!1,children:(0,_.jsx)(O.Z,{p:w.cd,children:(0,_.jsx)(Z.ZP,{alignItems:"center",children:(0,_.jsx)(o,{fill:"#885EFF",size:2*w.iI})})})}),(0,_.jsx)(O.Z,{mr:w.cd}),(0,_.jsx)(k.Z,{flexDirection:"column",children:(0,_.jsx)(C.ZP,{bold:!0,children:t})})]}),(0,_.jsx)(Y._Q,{})]})})})},i)})))]})})};function fr(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 vr(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?fr(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):fr(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var hr=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,g=e.createInteraction,b=e.deleteBlock,x=e.deleteWidget,j=e.editingBlock,y=e.executePipeline,k=e.fetchFileTree,P=e.fetchPipeline,S=e.fetchSecrets,E=e.fetchVariables,I=e.globalDataProducts,T=e.globalVariables,M=e.insights,D=e.interactions,R=e.interactionsMapping,B=e.interruptKernel,N=e.isLoadingCreateInteraction,L=e.isLoadingUpdatePipelineInteraction,U=e.isPipelineExecuting,F=e.lastTerminalMessage,G=e.messages,W=e.metadata,K=e.onChangeCallbackBlock,z=e.onChangeChartBlock,V=e.onChangeCodeBlock,q=e.onSelectBlockFile,Q=e.onUpdateFileSuccess,X=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,ge=e.setEditingBlock,ye=e.setErrors,ke=e.setHiddenBlocks,Ze=e.setInteractionsMapping,Pe=e.setPermissions,Oe=e.setSelectedBlock,Ce=e.setTextareaFocused,we=e.showBrowseTemplates,Se=e.showDataIntegrationModal,_e=e.showUpdateBlockModal,Ee=e.sideBySideEnabled,Te=e.statistics,Me=e.textareaFocused,Ae=e.treeRef,De=e.updatePipelineInteraction,Re=e.updateWidget,Be=e.widgets,Ne=(0,Zn.i)().height,Le=mi.uX,Ue=(0,f.useState)([]),Fe=Ue[0],He=Ue[1],Ge=(0,f.useState)(!!(0,kn.U2)(kn.Q9)),We=Ge[0],ze=Ge[1],Ye=(0,f.useMemo)((function(){return i-(tr.k1+1)}),[i]),Ve=(0,f.useMemo)((function(){var e;return!(null===ne||void 0===ne||null===(e=ne.features)||void 0===e||!e[oi.d.INTERACTIONS])}),[null===ne||void 0===ne?void 0:ne.features]),qe=((null===j||void 0===j?void 0:j.upstreamBlocks)||{}).block,Qe=((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]),Je=(0,f.useMemo)((function(){return(null===W||void 0===W?void 0:W.column_types)||{}}),[W]),$e=(0,f.useMemo)((function(){return(null===M||void 0===M?void 0:M[1])||{}}),[M]),en=(0,f.useMemo)((function(){return(0,Ie.HK)((null===M||void 0===M?void 0:M[0])||[],(function(e){return e.feature.uuid}))}),[M]),nn=!!re,tn=(0,f.useMemo)((function(){return H.qL.INTEGRATION===(null===J||void 0===J?void 0:J.type)}),[J]),on=H.qL.STREAMING!==(null===J||void 0===J?void 0:J.type)?-70:We?-16:300,rn=(0,f.useCallback)((0,Si.Fk)({columnTypes:Je,columns:Qe,insightsByFeatureUUID:en,insightsOverview:$e,noColumnLinks:!0,statistics:Te}),[Je,Qe,en,$e,Te]),ln=(0,f.useMemo)((function(){return(0,_.jsx)(Mo,{blocks:c,fetchVariables:E,pipeline:J,selectedBlock:se,setErrorMessages:He,variables:T,width:Ye})}),[Ye,c,E,T,J,se]),un=(0,f.useMemo)((function(){return(0,_.jsx)(So.Z,{onActionCallback:Q,pipeline:J,selectedBlock:se,selectedFilePath:ae,setErrors:ye,width:Ye>Ke.nn?Ye-Ke.nn:Ye})}),[Ye,Q,J,se,ae,ye]),cn=(0,f.useMemo)((function(){return(0,_.jsx)(er,{fetchSecrets:S,pipelineUUID:null===J||void 0===J?void 0:J.uuid,secrets:ce,setErrorMessages:He,width:Ye})}),[Ye,S,J,ce]),sn=(0,f.useMemo)((function(){return{addNewBlockAtIndex:t,autocompleteItems:o,blockRefs:u,blocks:c,blocksInNotebook:s,deleteBlock:b,fetchFileTree:k,fetchPipeline:P,interruptKernel:B,messages:G,onChangeCallbackBlock:K,onChangeCodeBlock:V,onSelectBlockFile:q,pipeline:J,runBlock:ie,runningBlocks:oe,savePipelineContent:le,selectedBlock:se,setAnyInputFocused:ve,setErrors:ye,setHiddenBlocks:ke,setSelectedBlock:Oe,setTextareaFocused:Ce,showBrowseTemplates:we,showUpdateBlockModal:_e,textareaFocused:Me}}),[t,o,u,c,s,b,k,P,B,G,K,V,q,J,ie,oe,le,se,ve,ye,ke,Oe,Ce,we,_e,Me]),an=(0,f.useMemo)((function(){return Qe.length>0&&(0,_.jsx)(be.Z,{columnHeaderHeight:(0,je.Qr)(Je)&&(0,je.Qr)(en)&&(0,je.Qr)($e)?0:xe.Eh,columns:Qe,height:Ne-Le-mi.OM,noBorderBottom:!0,noBorderLeft:!0,noBorderRight:!0,noBorderTop:!0,renderColumnHeader:rn,rows:Xe,width:Ye})}),[Ye,Je,Qe,Le,Ne,en,$e,rn,Xe]),dn=(0,f.useMemo)((function(){return Be.length>0&&(0,_.jsx)(co,{autocompleteItems:o,blockRefs:u,blocks:c,chartRefs:d,deleteWidget:x,fetchFileTree:k,fetchPipeline:P,messages:G,onChangeChartBlock:z,pipeline:J,runBlock:ie,runningBlocks:oe,savePipelineContent:le,selectedBlock:se,setAnyInputFocused:ve,setErrors:ye,setSelectedBlock:Oe,setTextareaFocused:Ce,textareaFocused:Me,updateWidget:Re,widgets:Be,width:Ye})}),[Ye,o,u,c,d,x,k,P,G,z,J,ie,oe,le,se,ve,ye,Oe,Ce,Me,Re,Be]),pn=(0,f.useMemo)((function(){return(0,_.jsx)("div",{style:{height:"100%",position:"relative",width:Ye},children:(0,_.jsx)(nr.Z,{lastMessage:F,onFocus:function(){return Oe(null)},sendMessage:de,width:Ye})})}),[Ye,F,de,Oe]),fn=(0,f.useMemo)((function(){return(0,_.jsx)(wo,vr({},sn))}),[sn]),vn=(0,f.useMemo)((function(){return(0,_.jsx)(pr,vr({},sn))}),[sn]),hn=(0,f.useMemo)((function(){return J&&se&&(0,_.jsx)(Hi,{addNewBlockAtIndex:t,block:se,contentByBlockUUID:h,fetchFileTree:k,fetchPipeline:P,globalDataProducts:I,pipeline:J,setSelectedBlock:Oe,showDataIntegrationModal:Se,showUpdateBlockModal:_e})}),[t,h,k,P,I,J,se,Oe,Se,_e]);return(0,_.jsxs)(_.Fragment,{children:[(null===Fe||void 0===Fe?void 0:Fe.length)>=1&&(0,_.jsxs)(O.Z,{mb:3,mt:2,mx:2,children:[(0,_.jsxs)(Z.ZP,{justifyContent:"space-between",children:[(0,_.jsx)(C.ZP,{bold:!0,danger:!0,children:"Errors"}),(0,_.jsx)(A.ZP,{basic:!0,iconOnly:!0,noPadding:!0,onClick:function(){return He([])},transparent:!0,children:(0,_.jsx)(Y.x8,{muted:!0})})]}),null===Fe||void 0===Fe?void 0:Fe.map((function(e){return(0,_.jsx)(O.Z,{pb:1,children:(0,_.jsx)(C.ZP,{monospace:!0,xsmall:!0,children:e})},e)}))]}),(0,_.jsxs)(xe.t0,{fullWidth:!0,heightOffset:ei.cH.TERMINAL===n||n===ei.cH.TREE?0:v||Ke.nn,onBlur:function(){ae||me(!1),null===fe||void 0===fe||fe(!1)},onFocus:function(){me(!0),n===ei.cH.TREE&&(null===fe||void 0===fe||fe(!0))},overflowHidden:n===ei.cH.TREE,tabIndex:0,children:[n===ei.cH.TREE&&(0,_.jsx)(m.Z,{uuid:"PipelineDetail/".concat(null===J||void 0===J?void 0:J.uuid),children:(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(so.ZP,{addNewBlockAtIndex:t,blockRefs:u,blocks:c,contentByBlockUUID:h,contextMenuEnabled:!0,deleteBlock:b,dragEnabled:!0,editingBlock:j,enablePorts:!tn,fetchPipeline:P,height:Ne-(Le-Ke.nn)-on,messages:G,onClickNode:function(e){var n=e.block.uuid;return ke((function(e){var t=!(null===e||void 0===e||!e[n]);return t?vr(vr({},e),{},(0,l.Z)({},n,!t)):e}))},pipeline:J,runBlock:ie,runningBlocks:oe,selectedBlock:se,setActiveSidekickView:pe,setEditingBlock:ge,setErrors:ye,setSelectedBlock:function(e){Oe(e),Ee&&(0,ir.F)(e)},showUpdateBlockModal:_e,treeRef:Ae}),!qe&&H.qL.STREAMING===(null===J||void 0===J?void 0:J.type)&&(0,_.jsx)(O.Z,{p:1,children:(0,_.jsx)(Fo,{cancelPipeline:a,checkIfPipelineRunning:p,executePipeline:y,isPipelineExecuting:U,pipelineExecutionHidden:We,pipelineMessages:ee,setPipelineExecutionHidden:ze})})]})}),n===ei.cH.DATA&&an,ei.cH.SECRETS===n&&cn,ei.cH.VARIABLES===n&&ln,ei.cH.FILE_VERSIONS===n&&(0,_.jsx)(m.Z,{uuid:"FileVersions/".concat(ae?decodeURIComponent(ae):""),children:un}),tn||se&&nn||!se&&nn&&n===ei.cH.DATA?null:ei.du.includes(n)&&(0,_.jsx)(Z.ZP,{alignItems:"center",justifyContent:"center",verticalHeight:ei.fp,verticalHeightOffset:Le,width:Ye,children:(0,_.jsx)(C.ZP,{center:!0,default:!0,disableWordBreak:!0,large:!0,monospace:!0,children:se?!nn&&"No data or insights available":"Select a block for insights"})}),ei.cH.CHARTS===n&&(Be.length>0?dn:(0,_.jsxs)(Z.ZP,{alignItems:"center",flexDirection:"column",justifyContent:"center",verticalHeight:ei.fp,verticalHeightOffset:Le,width:Ye,children:[(0,_.jsx)(O.Z,{px:1,children:(0,_.jsx)(Z.ZP,{flexDirection:"row",children:(0,_.jsxs)(C.ZP,{center:!0,default:!0,children:["Add a chart by clicking the chart icon \xa0",(0,_.jsx)(Y.GQ,{size:1.5*w.iI}),"\xa0in",(0,_.jsx)("br",{}),"the top right corner of a block (if applicable)."]})})}),(0,_.jsx)(O.Z,{mt:w.cd,px:1,children:(0,_.jsx)(po,{size:40*w.iI})})]})),ei.cH.TERMINAL===n&&pn,ei.cH.EXTENSIONS===n&&fn,ei.cH.ADDON_BLOCKS===n&&vn,ei.cH.BLOCK_SETTINGS===n&&(se?hn:(0,_.jsx)(Z.ZP,{alignItems:"center",flexDirection:"column",justifyContent:"center",verticalHeight:ei.fp,verticalHeightOffset:Le,width:Ye,children:(0,_.jsx)(O.Z,{px:1,children:(0,_.jsx)(Z.ZP,{flexDirection:"row",children:(0,_.jsxs)(C.ZP,{center:!0,default:!0,children:["Please select a block and then click the settings icon \xa0",(0,_.jsx)(Y.JG,{size:1.5*w.iI}),"\xa0",(0,_.jsx)("br",{}),"in the top right corner of a block (if applicable)."]})})})})),ei.cH.INTERACTIONS===n&&Ve&&(0,_.jsx)($o,{blockInteractionsMapping:r,containerWidth:Ye,createInteraction:function(e){return g({interaction:e})},interactions:D,interactionsMapping:R,isLoadingCreateInteraction:N,isLoadingUpdatePipelineInteraction:L,permissions:X,pipeline:J,pipelineInteraction:$,refAfterFooter:te,savePipelineInteraction:ue,selectedBlock:se,setBlockInteractionsMapping:he,setInteractionsMapping:Ze,setPermissions:Pe,setSelectedBlock:Oe,updatePipelineInteraction:function(e){return De({pipeline_interaction:e})}})]})]})};var mr=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,Zo.iV)(),d=(0,To.wx)(c,(function(e){return e.uuid===Eo.C})),p=(0,ei.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);ei.cH.BLOCK_SETTINGS===t&&null!==l&&void 0!==l&&l.uuid&&(v=(0,_.jsxs)(_.Fragment,{children:["Block settings for ",(0,_.jsx)(C.ZP,{bold:!0,color:(0,S.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,_.jsx)(C.ZP,{bold:!0,children:v}),m=ei.cH.EXTENSIONS===t&&(null===a||void 0===a?void 0:a.extension),g=z.ZP.extension_options.list({},{},{pauseFetch:!m}).data,b=(0,f.useMemo)((function(){return(null===g||void 0===g?void 0:g.extension_options)||[]}),[g]),x=(0,f.useMemo)((function(){return(0,Ie.HK)(b,(function(e){return e.uuid}))}),[b]),j=ei.cH.ADDON_BLOCKS===t&&(null===a||void 0===a?void 0:a.addon);if(ei.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,_.jsx)(oe.Z,{breadcrumbs:y,noMarginLeft:!0})}else{if(!t)return(0,_.jsx)("div",{});if(m){var k=x[null===a||void 0===a?void 0:a.extension];h=(0,_.jsxs)(Z.ZP,{children:[(0,_.jsx)(mt(),{as:"/pipelines/".concat(s,"/edit?").concat(ei.uM,"=").concat(ei.cH.EXTENSIONS),href:"/pipelines/[pipeline]/edit",passHref:!0,children:(0,_.jsx)(P.Z,{default:!0,children:v})}),(0,_.jsx)(C.ZP,{monospace:!0,muted:!0,children:"\xa0/\xa0"}),(0,_.jsx)(C.ZP,{bold:!0,children:null===k||void 0===k?void 0:k.name})]})}else j&&(h=(0,_.jsxs)(Z.ZP,{children:[(0,_.jsx)(mt(),{as:"/pipelines/".concat(s,"/edit?").concat(ei.uM,"=").concat(ei.cH.ADDON_BLOCKS),href:"/pipelines/[pipeline]/edit",passHref:!0,children:(0,_.jsx)(P.Z,{default:!0,children:v})}),(0,_.jsx)(C.ZP,{monospace:!0,muted:!0,children:"\xa0/\xa0"}),(0,_.jsx)(C.ZP,{bold:!0,children:(0,J.vg)(null===a||void 0===a?void 0:a.addon)})]}))}return(0,_.jsx)(mi.ym,{children:h})},gr=t(16756),br=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 ")})),xr=1.25*w.iI;function jr(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,J.QV)(null===u||void 0===u?void 0:u.kernel_cpu,3):null}),[u]);return(0,_.jsxs)(br,{ref:n,width:r,children:[(0,_.jsx)(y.Z,{light:!0}),(0,_.jsx)(O.Z,{px:w.cd,py:1,children:(0,_.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[u&&(0,_.jsx)(_.Fragment,{children:(0,_.jsxs)(Z.ZP,{alignItems:"center",children:[null!==s&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(Y.Bf,{muted:!0,size:xr}),(0,_.jsx)(O.Z,{mr:1}),(0,_.jsxs)(C.ZP,{monospace:!0,muted:!0,small:!0,children:["CPU: ",(0,_.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,_.jsxs)(O.Z,{mx:w.cd,children:[(0,_.jsx)(O.Z,{mr:1}),(0,_.jsx)(C.ZP,{monospace:!0,muted:!0,small:!0,children:"/"})]}),null!==c&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(Y.ie,{muted:!0,size:xr}),(0,_.jsx)(O.Z,{mr:1}),(0,_.jsxs)(C.ZP,{monospace:!0,muted:!0,small:!0,children:["Memory: ",c]})]}),(0,_.jsx)(O.Z,{mx:w.cd})]})}),(0,_.jsx)(Oe.Z,{appearAbove:!0,appearBefore:!0,block:!0,description:(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(Z.ZP,{alignItems:"center",children:[(0,_.jsx)(C.ZP,{default:!0,inline:!0,children:"Press"}),"\xa0",(0,_.jsx)(gr.Z,{inline:!0,keyText:(0,Mn.V5)()?Tn.RJ:Tn.hE}),"\xa0",(0,_.jsx)(C.ZP,{default:!0,inline:!0,children:"+"}),"\xa0",(0,_.jsx)(gr.Z,{inline:!0,keyText:Tn.SS}),"\xa0",(0,_.jsx)(C.ZP,{default:!0,inline:!0,children:"to save changes."}),(0,_.jsx)("br",{})]}),(0,_.jsx)(O.Z,{mt:1,children:(0,_.jsxs)(C.ZP,{default:!0,children:["Or, go to ",(0,_.jsx)(C.ZP,{inline:!0,monospace:!0,children:"File"})," \u203a ",(0,_.jsx)(C.ZP,{inline:!0,monospace:!0,children:"Save pipeline"}),"."]})})]}),size:null,widthFitContent:!0,children:(0,_.jsxs)(Z.ZP,{alignItems:"center",children:[i&&(0,_.jsx)(Y.uy,{size:xr,warning:!0}),!i&&(0,_.jsx)(Y.$B,{size:xr,muted:!0}),(0,_.jsx)(O.Z,{mr:1}),(0,_.jsx)(C.ZP,{monospace:!0,muted:!0,small:!0,warning:i,children:o})]})})]})})]})}var yr=f.forwardRef(jr),kr=t(65044),Zr=t(78419),Pr=t(46684),Or=t(32929),Cr=t(11498),wr=t(28795),Sr=t(85010);function _r(e){var n=e.activeView,t=e.pipeline,i=e.project,o=e.secrets,r=e.setActiveSidekickView,l=e.variables,u=(0,To.wx)(l,(function(e){return e.uuid===Eo.C}));return(0,ei.j5)({pipeline:t,project:i}).map((function(e){var i=e.buildLabel,l=e.key,c=e.label;return{Icon:ei.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 Er=t(53005),Ir=t(4383),Tr=t(70320);function Mr(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 Ar(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Mr(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Mr(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function Dr(e){var n,t,i,u,c,s,x,j,y,k,P,C,S,E,I,R,B,N,L,F,G=e.page,W=e.pipeline,K=(0,f.useRef)(null),V=(0,f.useRef)(null),q=(0,d.ZP)((0,Ir.Ib)("terminal"),{shouldReconnect:function(){return!0}}),Q=q.lastMessage,ne=q.sendMessage,te=(0,In.Z)(),oe=te.featureEnabled,re=te.featureUUIDs,le=te.fetchProjects,ue=te.project,ce=te.sparkEnabled,se=(0,f.useContext)(p.ThemeContext),ae=(0,h.useRouter)(),de=(0,Zn.i)().height,pe=ae.query.pipeline,fe=W.uuid||pe,ve=(0,f.useState)(!0),he=ve[0],me=ve[1],ge=(0,f.useState)(!!(0,kn.U2)(kn.zg)),be=ge[0],xe=ge[1],ye=(0,f.useState)(!!(0,kn.U2)(kn.Uu)),ke=ye[0],Ze=ye[1],Pe=(0,f.useState)(!1),Oe=Pe[0],Ce=Pe[1],we=(0,f.useState)(null),_e=we[0],Ee=we[1],Te=(0,f.useState)(null),Me=Te[0],Ae=Te[1],De=(0,f.useState)(null),Re=De[0],Be=De[1],Ne=(0,f.useState)(null),Le=Ne[0],Ue=Ne[1],Fe=(0,f.useState)(!1),He=Fe[0],Ge=Fe[1],We=(0,f.useState)(!1),Ke=We[0],ze=We[1],Ye=(0,f.useState)(!1),Ve=Ye[0],qe=Ye[1],Qe=(0,f.useState)(!1),Xe=Qe[0],Je=Qe[1],$e=(0,f.useState)(!0),en=$e[0],nn=$e[1],tn=((0,f.useMemo)((function(){var e;return(0,Tr.hY)(null===ue||void 0===ue||null===(e=ue.features)||void 0===e?void 0:e[oi.d.LOCAL_TIMEZONE])}),[null===ue||void 0===ue?void 0:ue.features]),(0,f.useMemo)((function(){var e;return!(null===ue||void 0===ue||null===(e=ue.features)||void 0===e||!e[oi.d.INTERACTIONS])}),[null===ue||void 0===ue?void 0:ue.features])),on="".concat(Zr.H8,"_").concat(fe),rn=(0,kn.U2)(on),ln=(0,f.useState)((0,Ie.sE)(xt.NR,(function(e){return e.uuid===rn}))||xt.NR[0]),un=ln[0],cn=ln[1],sn=(0,f.useCallback)((function(e){cn(e),(0,kn.t8)(on,null===e||void 0===e?void 0:e.uuid)}),[on,cn]),an="".concat(Zr.g6,"_").concat(fe),dn=(0,f.useState)({}),pn=dn[0],fn=dn[1],vn=(0,f.useRef)(null),hn=z.ZP.statuses.list({},{revalidateOnFocus:!1}).data,mn=(0,f.useMemo)((function(){var e,n;return null===hn||void 0===hn||null===(e=hn.statuses)||void 0===e||null===(n=e[0])||void 0===n?void 0:n.disable_pipeline_edit_access}),[hn]),gn=(0,f.useMemo)((function(){var e,n;return null===hn||void 0===hn||null===(e=hn.statuses)||void 0===e||null===(n=e[0])||void 0===n?void 0:n.max_print_output_lines}),[hn]),bn=(0,f.useState)({}),xn=bn[0],jn=bn[1],yn=(0,f.useState)([]),Pn=yn[0],On=yn[1],Cn=(0,lt.Z)(fe),Sn=z.ZP.pipelines.detail(fe,Ar({include_block_pipelines:!0,includes_outputs:(0,je.Qr)(xn)||"undefined"===typeof F||null===F||"undefined"===typeof(null===(n=F)||void 0===n?void 0:n.blocks)||null===(null===(t=F)||void 0===t?void 0:t.blocks)||!(null===(i=F)||void 0===i||null===(u=i.blocks)||void 0===u||!u.find((function(e){return"undefined"===typeof e.ouputs})))},en?{includes_outputs_spark:!0}:{}),{refreshInterval:6e4},{key:"/pipelines/".concat(fe,"/edit")}),_n=Sn.data,En=Sn.mutate,Tn=z.ZP.pipeline_interactions.detail(tn&&fe,{},{revalidateOnFocus:!1}),Mn=Tn.data,An=Tn.mutate,Dn=z.ZP.interactions.pipeline_interactions.list(tn&&fe,{},{revalidateOnFocus:!1}),Rn=Dn.data,Bn=Dn.mutate,Gn=(0,f.useMemo)((function(){return(null===Mn||void 0===Mn?void 0:Mn.pipeline_interaction)||{}}),[Mn]),Wn=(0,f.useMemo)((function(){return(null===Rn||void 0===Rn?void 0:Rn.interactions)||{}}),[Rn]),zn=(0,v.Db)(z.ZP.pipeline_interactions.useUpdate(fe),{onSuccess:function(e){return(0,$.wD)(e,{callback:function(e){An()}})}}),Yn=(0,r.Z)(zn,2),Vn=Yn[0],qn=Yn[1].isLoading,Qn=(0,v.Db)(z.ZP.interactions.pipeline_interactions.useCreate(fe),{onSuccess:function(e){return(0,$.wD)(e,{callback:function(e){Bn(),An()}})}}),Xn=(0,r.Z)(Qn,2),Jn=Xn[0],$n=Xn[1].isLoading;F=(0,f.useMemo)((function(){return null===_n||void 0===_n?void 0:_n.pipeline}),[_n]);var et=(0,f.useMemo)((function(){var e;return H.qL.INTEGRATION===(null===(e=F)||void 0===e?void 0:e.type)}),[F]);(0,f.useEffect)((function(){F&&en&&ce&&nn(!1)}),[en,F,nn,ce]);var nt=(0,f.useState)((0,kn.U2)(Zr.iL,!1)),tt=nt[0],it=nt[1],rt=(0,f.useMemo)((function(){return!et&&(null===oe||void 0===oe?void 0:oe(null===re||void 0===re?void 0:re.NOTEBOOK_BLOCK_OUTPUT_SPLIT_VIEW))&&tt}),[oe,re,et,tt]),ut=(0,f.useState)((0,kn.U2)(Zr.qj,!1)),ct=ut[0],at=ut[1],dt=(0,f.useMemo)((function(){return(null===oe||void 0===oe?void 0:oe(null===re||void 0===re?void 0:re.NOTEBOOK_BLOCK_OUTPUT_SPLIT_VIEW))&&ct}),[oe,re,ct]),vt=(0,f.useCallback)((function(e){at(e),(0,kn.t8)(Zr.qj,"function"===typeof e?e():e)}),[at]),ht=(0,f.useCallback)((function(e){var n="function"===typeof e?e():e;it(e),(0,kn.t8)(Zr.iL,n),n||vt(e)}),[vt,it]),mt=(0,f.useCallback)((function(){var e=new CustomEvent(xt.$e,{detail:{}});window.dispatchEvent(e)}),[]),gt=(0,f.useCallback)((function(){var e=new CustomEvent(xt.tK,{detail:{}});window.dispatchEvent(e)}),[]),bt=(0,f.useCallback)((function(e){fn((function(n){var t=e(n);return(0,kn.t8)(an,JSON.stringify(t)),t})),rt&&(clearTimeout(V.current),V.current=setTimeout((function(){gt(),mt()}),It.e+1))}),[mt,gt,an,fn,rt]);(0,f.useEffect)((function(){var e=(0,kn.U2)(an);e&&(0,J.Pb)(e)&&fn(JSON.parse(e))}),[an,fn]);var jt=z.ZP.kernels.list({},{refreshInterval:5e3,revalidateOnFocus:!0}),yt=jt.data,Zt=jt.mutate,Pt=(0,f.useMemo)((function(){var e=null===yt||void 0===yt?void 0:yt.kernels;return(null===e||void 0===e?void 0:e.find((function(e){var n;return e.name===H.a_[null===(n=F)||void 0===n?void 0:n.type]})))||(null===e||void 0===e?void 0:e[0])}),[yt,F]),Ot=(0,f.useState)(null),Ct=Ot[0],St=Ot[1],_t=(0,f.useState)(a()().utc().unix()),Et=_t[0],Tt=_t[1],Mt=(0,f.useState)(!1),At=Mt[0],Dt=Mt[1],Rt=(0,st.dd)((function(){return(0,_.jsx)(ot.Z,{centerOnScreen:!0,neutral:!0,onClick:Lt,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"}),Bt=(0,r.Z)(Rt,2),Nt=Bt[0],Lt=Bt[1];(0,f.useEffect)((function(){var e;null!==_n&&void 0!==_n&&null!==(e=_n.pipeline)&&void 0!==e&&e.updated_at&&Ct!==a()().utc().unix()&&St(a()(_n.pipeline.updated_at).unix()),Ct&&Ct>Et&&Nt()}),[null===_n||void 0===_n||null===(c=_n.pipeline)||void 0===c?void 0:c.updated_at,Ct,Et]);var Ut=(0,Zo.iV)(),Ft=Ut[ei.uM],Ht=Ut.block_uuid,Gt=(0,f.useMemo)((function(){var e=Ut["file_paths[]"]||[];return Array.isArray(e)||(e=[e]),e}),[Ut]),Wt=(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)({},ei.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),me(!0),(0,ko.u)(i,{preserveParams:["addon","block_uuid","file_path","file_paths[]"],pushHistory:n,replaceParams:!0})}),[]);(0,f.useEffect)((function(){Ft||Wt(ei.cH.TREE,!1)}),[Ft,Wt]);var Kt=(0,f.useCallback)((function(e,n,t){xe(!1),setTimeout((function(){return Wt(e,n,t)}),1)}),[Wt]),zt=(0,f.useRef)({}),Yt=(0,f.useRef)({}),Vt=(0,f.useRef)(null),qt=(0,f.useRef)({}),Qt=(0,f.useRef)({}),Xt=(0,f.useRef)({}),Jt=(0,f.useState)({}),$t=Jt[0],ni=Jt[1],ti=(0,f.useCallback)((function(e,n,t){var i=qt.current||{};qt.current=Ar(Ar({},i),{},(0,l.Z)({},e,Ar(Ar({},i[e]||{}),{},(0,l.Z)({},n,t))))}),[qt]),ii=(0,f.useCallback)((function(e,n,t){var i=Qt.current||{};Qt.current=Ar(Ar({},i),{},(0,l.Z)({},e,Ar(Ar({},i[e]||{}),{},(0,l.Z)({},n,t))))}),[Qt]),ri=(0,f.useCallback)((function(e,n,t){ti(e,n,t),Dt(!0)}),[ti,Dt]),ui=(0,f.useCallback)((function(e,n,t){ii(e,n,t),Dt(!0)}),[ii,Dt]),ci=(0,f.useCallback)((function(e){Xt.current=Ar(Ar({},Xt.current),e)}),[Xt]),si=(0,f.useCallback)((function(e,n){ci((0,l.Z)({},e,n)),Dt(!0)}),[ci,Dt]),ai=(0,f.useState)(null),di=ai[0],pi=ai[1],vi=z.ZP.data_providers.list({},{revalidateOnFocus:!1}).data,hi=null===vi||void 0===vi?void 0:vi.data_providers,mi=z.ZP.variables.pipelines.list(fe,{global_only:!0},{revalidateOnFocus:!1}),gi=mi.data,bi=mi.mutate,yi=null===gi||void 0===gi?void 0:gi.variables,ki=z.ZP.secrets.list({},{revalidateOnFocus:!1}),Zi=ki.data,Pi=ki.mutate,Oi=null===Zi||void 0===Zi?void 0:Zi.secrets,Ci=(0,f.useState)([]),wi=Ci[0],Si=Ci[1],_i=(0,f.useState)([]),Ei=_i[0],Ii=_i[1],Ti=(0,f.useRef)({}),Mi=(0,f.useCallback)((function(e){var n;Dt(!0);var t=Ti.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),Ti.current[e.uuid]=Ar(Ar(Ar({},t),e),{},{configuration:Ar(Ar({},t.configuration),e.configuration),upstream_blocks:i})}),[Dt,Ti]),Ai=(0,f.useState)(!1),Di=Ai[0],Ri=Ai[1],Bi=(0,f.useState)({upstreamBlocks:null}),Ni=Bi[0],Li=Bi[1],Ui=(0,f.useState)([]),Fi=Ui[0],Hi=Ui[1],Gi=(0,f.useState)(null),Wi=Gi[0],Ki=Gi[1],zi=(0,f.useState)(null),Yi=zi[0],Vi=zi[1],qi=(0,f.useCallback)((function(e,n,t){Vi({block:{type:n,uuid:e},file:{path:t}})}),[]),Qi=(0,kt.Dp)(fe),Xi=(0,kt.Q9)(Qi,wi),Ji=(0,f.useState)(Xi),$i=Ji[0],eo=Ji[1],no=(0,f.useState)(),to=no[0],io=no[1],oo=(0,f.useState)(),ro=oo[0],lo=oo[1],uo=(0,f.useState)(null),co=uo[0],so=uo[1],ao=(0,lt.Z)($i);(0,f.useCallback)((function(){Li({upstreamBlocks:{block:null,values:[]}}),jn({}),Dt(!1),Hi([]),Ki(null)}),[]);(0,f.useEffect)((function(){fe!==Cn&&(qt.current={},Qt.current={})}),[fe,Cn]);var po=z.ZP.block_outputs.detail(!be&&(null===co||void 0===co?void 0:co.type)!==b.tf.SCRATCHPAD&&(null===co||void 0===co?void 0:co.type)!==b.tf.CHART&&null!==co&&void 0!==co&&co.uuid?encodeURIComponent(null===co||void 0===co?void 0:co.uuid):null,{pipeline_uuid:fe}),fo=po.data,vo=po.mutate,ho=(0,f.useMemo)((function(){return null===fo||void 0===fo?void 0:fo.block_output}),[fo]),mo=(0,f.useMemo)((function(){var e,n,t;return et?null===(e=(0,Ie.sE)(null===ho||void 0===ho?void 0:ho.outputs,(function(e){return e.variable_uuid==="output_sample_data_".concat((0,J.kE)(ro))})))||void 0===e?void 0:e.sample_data:null===ho||void 0===ho||null===(n=ho.outputs)||void 0===n||null===(t=n[0])||void 0===t?void 0:t.sample_data}),[ho,et,ro]),go=z.ZP.blocks.pipelines.analyses.detail(be?null:fe,(null===co||void 0===co?void 0:co.type)!==b.tf.SCRATCHPAD&&(null===co||void 0===co?void 0:co.type)!==b.tf.CHART&&(null===co||void 0===co?void 0:co.uuid)&&encodeURIComponent(null===co||void 0===co?void 0:co.uuid)),bo=go.data,xo=go.mutate,jo=(null===bo||void 0===bo||null===(s=bo.analyses)||void 0===s?void 0:s[0])||{},yo=jo.insights,Po=void 0===yo?{}:yo,Oo=jo.metadata,Co=void 0===Oo?{}:Oo,wo=jo.statistics,So=void 0===wo?{}:wo;(0,f.useEffect)((function(){0===Fi.length&&(xo(),vo(),bi())}),[xo,vo,bi,Fi]),(0,f.useEffect)((function(){if(0===$i.length)so(null);else if((null===ao||void 0===ao?void 0:ao.length)!==(null===$i||void 0===$i?void 0:$i.length)&&(null===$i||void 0===$i?void 0:$i.length)<(null===ao||void 0===ao?void 0:ao.length)){var e=ao.findIndex((function(e){return e.uuid===(null===co||void 0===co?void 0:co.uuid)})),n=ao.length-1===e?e-1:e+1;so(ao[Math.max(0,n)])}}),[$i,ao,null===co||void 0===co?void 0:co.uuid]),(0,f.useEffect)((function(){var e;null!==(e=Ni.upstreamBlocks)&&void 0!==e&&e.block&&(xe(!1),Wt(ei.cH.TREE))}),[Ni.upstreamBlocks,Wt]);var _o=z.ZP.autocomplete_items.list({},{refreshInterval:!1,revalidateOnFocus:!1}),Eo=_o.data,Io=_o.mutate,To=null===Eo||void 0===Eo?void 0:Eo.autocomplete_items,Mo=(0,v.Db)((function(e){var n=e.uuid;return z.ZP.widgets.pipelines.useDelete(fe,n)()}),{onSuccess:function(e){return(0,$.wD)(e,{callback:function(e){var n=e.widget.uuid;Ii((function(e){return(0,Ie.oM)(e,e.findIndex((function(e){var t=e.uuid;return n===t})))})),En(),Lo()},onErrorCallback:function(e,n){var t=e.url_parameters,i=n.messages;Ae({errors:n,response:e}),null!==t&&void 0!==t&&t.block_uuid&&jn((function(e){return Ar(Ar({},e),{},(0,l.Z)({},t.block_uuid,i.map((function(e){return{data:"".concat(e,"\n"),error:"".concat(e,"\n"),type:ft.Gi.TEXT_PLAIN}}))))}))}})}}),Ao=(0,r.Z)(Mo,1)[0],Do=(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===wi||void 0===wi?void 0:wi.find((function(e){return e.uuid===(null===n||void 0===n?void 0:n.blockUUID)})):(0,Er.IO)(r,wi)){var u=t,c=u.type,s=u.uuid;ui(c,s,o),Si((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})),ni((function(e){return Ar(Ar({},e),{},(0,l.Z)({},c,Ar(Ar({},null===e||void 0===e?void 0:e[c]),{},(0,l.Z)({},s,Number(new Date)))))})),En()}}),[wi,En,ui]),Ro=(0,wt.Z)({addNewBlock:function(e,n,t){Qr(e,wi.length,n,e.name,t),(null===Gt||void 0===Gt?void 0:Gt.length)>=1&&ae.push("/pipelines/".concat(fe,"/edit"))},blocks:wi,deleteWidget:Ao,fetchAutocompleteItems:Io,fetchPipeline:En,fetchVariables:bi,onOpenFile:function(e,n){n||(Wt(ei.cH.FILES),xe(!1),me(!1),Ki(null))},onSelectFile:function(){Ki(null)},onSelectBlockFile:qi,onUpdateFileSuccess:Do,openSidekickView:Kt,pipeline:F,selectedFilePath:fe,sendTerminalMessage:ne,setDisableShortcuts:qe,setSelectedBlock:Ki,uuid:fe,widgets:Ei}),Bo=Ro.browser,No=Ro.controller,Lo=Ro.fetchFiles,Uo=(Ro.filePaths,Ro.files),Fo=(Ro.filesTouched,Ro.menu,Ro.openFile),Ho=Ro.selectedFilePath,Go=Ro.tabs,Wo=(Ro.versions,Ro.versionsVisible,(0,v.Db)(z.ZP.pipelines.useCreate(),{onSuccess:function(e){return(0,$.wD)(e,{callback:function(e){var n=e.pipeline.uuid;ae.push("/pipelines/[pipeline]/edit","/pipelines/".concat(n,"/edit")),Lo()},onErrorCallback:function(e,n){return Ae({errors:n,response:e})}})}})),Ko=(0,r.Z)(Wo,1)[0],zo=(0,v.Db)(z.ZP.pipelines.useUpdate(fe,{update_content:!0}),{onSuccess:function(e){return(0,$.wD)(e,{callback:function(){Dt(!1),En().then((function(e){var n,t,i,o=e.pipeline,r=null===(n=F)||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,Ie.fS)(r||[],l||[])&&rt&&setTimeout((function(){(0,ir.h)()}),1)}))},onErrorCallback:function(e,n){return Ae({errors:n,response:e})}})}}),Yo=(0,r.Z)(zo,2),Vo=Yo[0],qo=Yo[1].isLoading,Xo=(0,f.useState)({}),Jo=Xo[0],$o=Xo[1],er=(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(!(Ct&&Ct>Et)){var s=(0,Qo.Tz)();Tt(a()().utc().unix());var d={},p={},f={},v={};((null===u||void 0===u?void 0:u.blocks)||wi).forEach((function(e){var n,t,i,l=e.extension_uuid,u=e.type,s=e.uuid,a=null===(n=Qt.current[u])||void 0===n?void 0:n[s];"undefined"===typeof a&&(a=e.content);var h=null===(t=qt.current[u])||void 0===t?void 0:t[s];"undefined"===typeof h&&(h=e.callback_content);var m=null,g=null===(i=xn[s])||void 0===i?void 0:i.filter((function(e){return!!e})),x=null===g||void 0===g?void 0:g.find((function(e){return e.error}));if(g&&(!ce||null===Fi||void 0===Fi||!Fi.length)){var j=[],y=0;g.forEach((function(n){var t=n.data,i=n.type;(b.tf.SCRATCHPAD===e.type||x||"table"!==i&&null!==Jo&&void 0!==Jo&&Jo[null===e||void 0===e?void 0:e.uuid])&&(Array.isArray(t)&&(n.data=t.reduce((function(e,n){return n.match(kr.Lz)?e:e.concat(n)}),[]),i===ft.Gi.TEXT_PLAIN&&(y+=(null===t||void 0===t?void 0:t.length)||0)),(!gn||y<gn+5)&&j.push(n))})),m=j.map((function(e,n){return{text_data:JSON.stringify(e),variable_uuid:"output_".concat(n)}}))}var k=Ar(Ar({},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}:[b.tf.EXTENSION].includes(u)?(d[l]||(d[l]=[]),d[l].push(k)):b.tf.CALLBACK===u?f[k.uuid]=k:b.tf.CONDITIONAL===u?v[k.uuid]=k:p[k.uuid]=k}));var h=Ar(Ar({},null===(t=F)||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=[],g=[],x=[];return((null===u||void 0===u?void 0:u.blocks)||wi).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?g.push(i):"undefined"!==typeof o&&x.push(o)})),$o({}),Vo({pipeline:Ar(Ar(Ar({},F),u),{},{blocks:m,callbacks:g,conditionals:x,extensions:h,updated_at:s,widgets:Ei.map((function(e){var n,t,i=Xt.current[e.uuid],o=Ti.current[e.uuid]||{};"undefined"===typeof i&&(i=e.content);var r=null===(n=xn[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;(b.tf.SCRATCHPAD===e.type||l||"table"!==i)&&(Array.isArray(t)&&(n.data=t.reduce((function(e,n){return n.match(kr.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 Ar(Ar(Ar({},e),o),{},{configuration:Ar(Ar({},e.configuration),o.configuration),content:i,outputs:t})}))})})}Nt()}),[wi,gn,xn,Jo,F,Ct,Et,Fi,ce,Vo,Ei]),nr=(0,f.useMemo)((function(){return(0,kt.Rz)(F,{displayRelative:!0,isPipelineUpdating:qo,pipelineContentTouched:At,pipelineLastSaved:Ct})}),[qo,F,At,Ct]),tr=(0,st.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=Ar({},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,_.jsx)(ee.BC,{children:(0,_.jsx)(wn,Ar(Ar({},e),{},{block:s,onChangeCodeBlock:ui,onClose:lr,pipeline:F,savePipelineContent:er}))})}),{},[ui,F,er],{background:!0,disableClickOutside:!0,disableCloseButton:!0,disableEscape:!0,uuid:"DataIntegrationModal/".concat(fe)}),or=(0,r.Z)(tr,2),rr=or[0],lr=or[1];(0,f.useEffect)((function(){if(Yi){var e,n=(null===Yi||void 0===Yi?void 0:Yi.block)||{type:null,uuid:null},t=n.type,i=n.uuid,o=wi.find((function(e){var n=e.type,o=e.uuid;return n===t&&o===i}));if(o){if(Ki(o),null!==zt&&void 0!==zt&&zt.current){var r,l=zt.current[(0,kt.zv)(o)];null===l||void 0===l||null===(r=l.current)||void 0===r||r.scrollIntoView()}}else if(t===b.tf.CHART){var u=Ei.find((function(e){return e.uuid===i}));if(u&&(Ki(u),null!==Yt&&void 0!==Yt&&Yt.current)){var c,s=Yt.current[u.uuid];null===s||void 0===s||null===(c=s.current)||void 0===c||c.scrollIntoView()}}else if(null!==Yi&&void 0!==Yi&&null!==(e=Yi.file)&&void 0!==e&&e.path){var a;Fo(null===Yi||void 0===Yi||null===(a=Yi.file)||void 0===a?void 0:a.path)}}}),[wi,Yi,Ei]),(0,f.useEffect)((function(){var e,n,t=_n,i=[],o=null===(e=F)||void 0===e?void 0:e.variables_dir,r=null===(n=F)||void 0===n?void 0:n.remote_variables_dir;null!==_n&&void 0!==_n&&_n.hasOwnProperty("error")?"undefined"!==fe?i=[{label:"Check pipeline configuration file for any issues",onClick:function(){Fo("pipelines/".concat(fe,"/").concat(Un.dT.METADATA_YAML)),Ae(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!==vi&&void 0!==vi&&vi.hasOwnProperty("error")?t=vi:(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(){Fo("".concat(Un.dT.METADATA_YAML)),Be(null)}}]),(0,$.bB)(t,Be,i)}),[_n,vi,Fo,null===(x=F)||void 0===x?void 0:x.remote_variables_dir,null===(j=F)||void 0===j?void 0:j.variables_dir,fe]);var ur=(0,f.useMemo)((function(){var e=[],n=[];return wi.forEach((function(t){b.M5.includes(t.type)?n.push(t):e.push(t)})),{blocksInNotebook:e,blocksInSidekick:n}}),[wi]),cr=ur.blocksInNotebook,sr=ur.blocksInSidekick,ar=(0,f.useCallback)((function(e,n){return er({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(fe!==r)window.location.href="".concat(ae.basePath,"/pipelines/").concat(r,"/edit");else Lo(),n!==(null===(o=F)||void 0===o?void 0:o.type)&&En(),(0,kt.k1)(cr,fe,r),(0,kt.k1)(sr,fe,r)}else null!==e&&void 0!==e&&null!==(i=e.data)&&void 0!==i&&i.error&&Ae((function(e){return Ar(Ar({},e),{},{links:[{label:"Check pipeline configuration",onClick:function(){Fo("pipelines/".concat(fe,"/").concat(Un.dT.METADATA_YAML)),Ae(null)}}]})}))}))}),[cr,sr,Lo,En,Fo,null===(y=F)||void 0===y?void 0:y.type,fe,ae,er]),dr=(0,f.useState)(null),pr=dr[0],fr=dr[1],vr=(0,f.useState)(null),gr=vr[0],br=vr[1],xr=(0,f.useState)(null),jr=xr[0],Mr=xr[1],Dr=(0,f.useCallback)((function(e){return Vn({pipeline_interaction:Ar(Ar({},Gn),{},{blocks:null!==e&&void 0!==e&&e.blockInteractionsMapping?null===e||void 0===e?void 0:e.blockInteractionsMapping:gr,interactions:pr,permissions:null===jr||void 0===jr?void 0:jr.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}}))}}))})})}),[gr,pr,jr,Gn,Vn]),Rr=(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),z.ZP.blocks.pipelines.useDelete(fe,encodeURIComponent(o),r)()}),{onSuccess:function(e){return(0,$.wD)(e,{callback:function(e){var n=e.block,t=n.type,i=n.uuid;if(Si((function(e){return(0,Ie.oM)(e,e.findIndex((function(e){var n=e.type,o=e.uuid;return t===n&&i===o})))})),En(),Ki(null),tn){var o=Ar({},gr);delete o[i],Dr({blockInteractionsMapping:o}).then((function(e){var n=e.pipeline_interaction;return br(null===n||void 0===n?void 0:n.blocks)}))}},onErrorCallback:function(e,n){var t=e.url_parameters,i=n.messages;Ae({errors:n,response:e}),null!==t&&void 0!==t&&t.block_uuid&&jn((function(e){return Ar(Ar({},e),{},(0,l.Z)({},t.block_uuid,i.map((function(e){return{data:"".concat(e,"\n"),error:"".concat(e,"\n"),type:ft.Gi.TEXT_PLAIN}}))))}))}})}}),Br=(0,r.Z)(Rr,1)[0],Nr=(0,st.dd)((function(e){return(0,_.jsx)(ot.Z,{centerOnScreen:!0,neutral:!0,onCancel:Fr,onClick:function(){return Gr(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})})),Lr=(0,r.Z)(Nr,2),Ur=Lr[0],Fr=Lr[1],Hr=(0,v.Db)((function(e){var n=e.language,t=e.type,i=e.uuid,o="".concat(t,"/").concat(i);return n&&Un.JD[n]&&(o="".concat(o,".").concat(Un.JD[n].toLowerCase())),z.ZP.blocks.useDelete(encodeURIComponent(o))()}),{onSuccess:function(e){return(0,$.wD)(e,{callback:function(){Io(),En()},onErrorCallback:function(e,n){Ur(),Ae({displayMessage:e.exception,errors:n,response:e})}})}}),Gr=(0,r.Z)(Hr,1)[0],Wr=(0,v.Db)(z.ZP.kernels.useUpdate(null===Pt||void 0===Pt?void 0:Pt.id),{onSuccess:function(e){return(0,$.wD)(e,{callback:function(){return Zt()},onErrorCallback:function(e,n){return Ae({errors:n,response:e})}})}}),Kr=(0,r.Z)(Wr,1)[0],zr=(0,f.useCallback)((function(){return Kr({kernel:{action_type:"restart"}})}),[Kr]),Yr=(0,f.useCallback)((function(){Kr({kernel:{action_type:"interrupt"}}),Hi([])}),[Kr]),Vr=(0,v.Db)(z.ZP.blocks.pipelines.useCreate(fe)),qr=(0,r.Z)(Vr,1)[0],Qr=(0,f.useCallback)((function(e,n,t){var i,l,u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:(0,J.Y6)(),c=arguments.length>4?arguments[4]:void 0;e.converted_from_type&&e.converted_from_uuid&&(i=null===(l=Qt.current[e.converted_from_type])||void 0===l?void 0:l[e.converted_from_uuid]);var s=e.language,a=e.type;if(et){var d,p=(0,Ie.HK)((null===(d=F)||void 0===d?void 0:d.blocks)||[],(function(e){return e.type})),f=p[b.tf.DATA_EXPORTER],v=p[b.tf.DATA_LOADER],h=p[b.tf.TRANSFORMER];if(b.tf.DATA_LOADER===a){if(b.t6.YAML!==s)return void Ae({displayMessage:"The source you\u2019re trying to add must contain the language ".concat(b.t6.YAML," and not ").concat(s,".")});var m;if(v)return void Ae({displayMessage:"Pipeline ".concat(null===(m=F)||void 0===m?void 0:m.uuid," already has a source: ").concat(null===v||void 0===v?void 0:v.uuid,".")})}else if(b.tf.TRANSFORMER===a){var g;if(h)return void Ae({displayMessage:"Pipeline ".concat(null===(g=F)||void 0===g?void 0:g.uuid," already has a transformer: ").concat(null===h||void 0===h?void 0:h.uuid,".")})}else if(b.tf.DATA_EXPORTER===a){if(b.t6.YAML!==s)return void Ae({displayMessage:"The destination you\u2019re trying to add must contain the language ".concat(b.t6.YAML," and not ").concat(s,".")});var x;if(f)return void Ae({displayMessage:"Pipeline ".concat(null===(x=F)||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 qr({block:Ar({content:i,name:u,priority:n,require_unique_name:!0},e)}).then((function(n){(0,$.wD)(n,{callback:function(){var e,i,l=n.data.block;(null===t||void 0===t||t(l),rt&&null!==oe&&void 0!==oe&&oe(null===re||void 0===re?void 0:re.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||Lo(),En().then((function(e){var n=e.pipeline,t=n.blocks,i=n.extensions;Si((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 Ar(Ar({},e),{},{extension_uuid:i})}))))}));var l=(0,Ie.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,Er.u$)(Ar(Ar({},e),{},{name:u}));o&&r&&o.startsWith(xt.LR)?Ae((function(){return{errors:t,links:[{label:"View existing block file contents and optionally add to pipeline (if applicable).",onClick:function(){Fo(r),Ae(null)}}],response:n}})):Ae({errors:t,response:n})}})}))};return rt&&null!==oe&&void 0!==oe&&oe(null===re||void 0===re?void 0:re.NOTEBOOK_BLOCK_OUTPUT_SPLIT_VIEW)?er().then((function(){return j()})):j()}),[qr,oe,null===re||void 0===re?void 0:re.NOTEBOOK_BLOCK_OUTPUT_SPLIT_VIEW,Lo,En,et,Fo,F,er,rt]),Xr=(0,st.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,J.Y6)():u,s=e.onCreateCallback;return(0,_.jsx)(ee.BC,{children:(0,_.jsx)(ie,{block:n,defaultName:c,isReplacingBlock:o,isUpdatingBlock:l,onClose:el,onSave:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(l||o){var i,r=n.detach||!1;er({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=F)||void 0===i?void 0:i.blocks)||[]}}).then((function(){Ki(null),el()}))}else Qr(Ar(Ar({},n),(0,je.gR)(e,["name"])),t,s,null===e||void 0===e?void 0:e.name).then((function(){return el()}))},pipeline:F})})}),{},[Qr,F],{background:!0,disableEscape:!0,uuid:"configure_block_name_and_create"}),Jr=(0,r.Z)(Xr,2),$r=Jr[0],el=Jr[1],nl=(0,st.dd)((function(e){var n=e.cancelButtonText,t=e.header,i=e.onCancel,o=e.onSaveSuccess;return(0,_.jsx)(ee.BC,{children:(0,_.jsx)(ji.Z,{cancelButtonText:n,contained:!0,header:t,onCancel:function(){null===i||void 0===i||i(),ol()},onSaveSuccess:function(e){le(),ol(),null===o||void 0===o||o(e)}})})}),{},[le],{background:!0,uuid:"configure_project"}),tl=(0,r.Z)(nl,2),il=tl[0],ol=tl[1],rl=(0,v.Db)(z.ZP.widgets.pipelines.useCreate(fe)),ll=(0,r.Z)(rl,1)[0],ul=(0,f.useCallback)((function(e,n,t){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:(0,J.Y6)();return ll({widget:Ar({name:i,priority:n,type:b.tf.CHART},e)}).then((function(e){return(0,$.wD)(e,{callback:function(){var n=e.data.widget;null===t||void 0===t||t(n),Lo(),En(),Wt(ei.cH.CHARTS),Ue(n)},onErrorCallback:function(e,n){return Ae({errors:n,response:e})}})}))}),[Lo,En,ll,Wt]);(0,f.useEffect)((function(){if(Le){var e,n=null===(e=Yt.current[Le.uuid])||void 0===e?void 0:e.current;n&&(n.scrollIntoView(),Ue(null))}}),[Le,Ue]),(0,f.useEffect)((function(){Cn!==fe&&(Si([]),Ii([]),eo([]),On([]))}),[fe,Cn]),(0,f.useEffect)((function(){var e,n;if("undefined"!==typeof(null===(e=F)||void 0===e?void 0:e.blocks)||"undefined"!==typeof(null===(n=F)||void 0===n?void 0:n.extensions)){var t,i,l,u,c,s,a,d,p=[];if("undefined"!==typeof(null===(t=F)||void 0===t?void 0:t.blocks))p.push.apply(p,(0,o.Z)(null===(c=F)||void 0===c?void 0:c.blocks));if("undefined"!==typeof(null===(i=F)||void 0===i?void 0:i.callbacks))p.push.apply(p,(0,o.Z)(null===(s=F)||void 0===s?void 0:s.callbacks));if("undefined"!==typeof(null===(l=F)||void 0===l?void 0:l.conditionals))p.push.apply(p,(0,o.Z)(null===(a=F)||void 0===a?void 0:a.conditionals));if("undefined"!==typeof(null===(u=F)||void 0===u?void 0:u.extensions))Object.entries((null===(d=F)||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 Ar(Ar({},e),{},{extension_uuid:t})}))))}));Si(p)}}),[null===(k=F)||void 0===k?void 0:k.blocks,null===(P=F)||void 0===P?void 0:P.callbacks,null===(C=F)||void 0===C?void 0:C.conditionals,null===(S=F)||void 0===S?void 0:S.extensions]),(0,f.useEffect)((function(){var e;"undefined"!==typeof(null===(e=F)||void 0===e?void 0:e.widgets)&&Ii(F.widgets)}),[null===(E=F)||void 0===E?void 0:E.widgets]),(0,f.useEffect)((function(){(null===Xi||void 0===Xi?void 0:Xi.length)>0&&0===(null===$i||void 0===$i?void 0:$i.length)&&(eo(Xi),so(Xi[0]))}),[$i,Xi]);var cl=(0,lt.Z)(wi);(0,f.useEffect)((function(){var e;if(!Oe&&("undefined"!==typeof(null===(e=F)||void 0===e?void 0:e.blocks)&&(!wi.length||!(0,Ie.fS)(null===cl||void 0===cl?void 0:cl.map((function(e){return e.uuid})).sort(),null===wi||void 0===wi?void 0:wi.map((function(e){return e.uuid})).sort())||(0,je.Qr)(xn)))){var n=(0,kt.Rt)(F.blocks),t=n.content,i=n.messages;Qt.current=t,(0,je.Qr)(i)||jn((function(e){return Ar(Ar({},i),e)})),Ce(!0)}}),[wi,cl,Oe,xn,null===(I=F)||void 0===I?void 0:I.blocks,Ce,jn]),(0,f.useEffect)((function(){var e;if(!Ei.length&&"undefined"!==typeof(null===(e=F)||void 0===e?void 0:e.widgets)){var n=(0,kt.Rt)(F.widgets),t=n.content,i=n.messages;Xt.current=t,jn((function(e){return Ar(Ar({},i),e)}))}}),[null===(R=F)||void 0===R?void 0:R.widgets,jn,Ei]),(0,f.useEffect)((function(){if(Ht&&!Wi){var e=wi.find((function(e){var n,t=e.uuid;return(null===Ht||void 0===Ht||null===(n=Ht.split(":"))||void 0===n?void 0:n[0])===t}));e&&(bt((function(n){return Ar(Ar({},n),{},(0,l.Z)({},e.uuid,!1))})),qi(e.uuid,e.type,null))}else(null===cl||void 0===cl?void 0:cl.length)!==(null===wi||void 0===wi?void 0:wi.length)&&Wi&&(bt((function(e){return Ar(Ar({},e),{},(0,l.Z)({},Wi.uuid,!1))})),qi(Wi.uuid,Wi.type,null))}),[Ht,wi,null===cl||void 0===cl?void 0:cl.length,qi,Wi,bt]);var sl=(0,f.useMemo)((function(){return new g.Z}),[]),al=(0,f.useMemo)((function(){return{api_key:Cr.lG,token:sl.decodedToken.token}}),[sl]),dl=(0,d.ZP)((0,Ir.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=wi.find((function(e){var n=e.type,i=e.uuid;return t===n&&c===i}));"stream_pipeline"!==r?jn((function(e){var t=e[c]||[];return Ar(Ar({},e),{},(0,l.Z)({},c,t.concat(n)))})):(On((function(e){return[].concat((0,o.Z)(e),[n])})),ft.uF.IDLE===i&&(Hi([]),En(),c||Ri(!1))),ft.uF.BUSY===i?Hi((function(e){return e.find((function(e){var n=e.uuid;return c===n}))||!s?e:e.concat(s)})):ft.uF.IDLE===i&&Hi((function(e){return e.filter((function(e){var n=e.uuid;return c!==n}))})),mn||Dt(!0)}},onOpen:function(){return console.log("socketUrlPublish opened")},reconnectAttempts:10,reconnectInterval:3e3,shouldReconnect:function(){return console.log("Attempting to reconnect..."),!0}}).sendMessage,pl=(0,f.useCallback)((function(){er().then((function(){Ri(!0),On([]),dl(JSON.stringify(Ar(Ar({},al),{},{execute_pipeline:!0,pipeline_uuid:fe})))}))}),[fe,er,dl,al]),fl=(0,f.useCallback)((function(){dl(JSON.stringify(Ar(Ar({},al),{},{cancel_pipeline:!0,pipeline_uuid:fe})))}),[fe,dl,al]),vl=(0,f.useCallback)((function(){dl(JSON.stringify(Ar(Ar({},al),{},{cancel_pipeline:!0,pipeline_uuid:fe,skip_publish_message:!0})))}),[fe,dl,al]),hl=(0,f.useCallback)((function(){dl(JSON.stringify(Ar(Ar({},al),{},{check_if_pipeline_running:!0,pipeline_uuid:fe})))}),[fe,dl,al]);(0,f.useEffect)((function(){var e;return window.addEventListener("pagehide",vl),null===ae||void 0===ae||null===(e=ae.events)||void 0===e||e.on("routeChangeStart",vl),function(){var e;null===ae||void 0===ae||null===(e=ae.events)||void 0===e||e.off("routeChangeStart",vl),window.removeEventListener("pagehide",vl)}}),[vl,null===ae||void 0===ae?void 0:ae.events]);var ml=(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,g=n.uuid;if(!Fi.find((function(e){var n=e.uuid;return g===n}))||i){var b,x,j="".concat(Zr.vF,"_").concat(null===(b=F)||void 0===b?void 0:b.uuid);dl(JSON.stringify(Ar(Ar({},al),{},{code:t,extension_uuid:h,output_messages_to_logs:!!(0,kn.U2)(j),pipeline_uuid:null===(x=F)||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:g,variables:v}))),jn((function(e){return delete e[g],e})),Ge(!1),Hi((function(e){return e.find((function(e){var n=e.uuid;return g===n}))?e:e.concat(n)})),$o((function(e){return Ar(Ar({},e),{},(0,l.Z)({},null===n||void 0===n?void 0:n.uuid,!0))}))}En()}),[En,F,Fi,dl,jn,Hi,Ge,al]),gl=(0,f.useCallback)((function(e){var n,t=e.block;return mn?ml(e):null===(n=er({block:{outputs:[],uuid:t.uuid}},{contentOnly:!0}))||void 0===n?void 0:n.then((function(){return ml(e)}))}),[mn,ml,er]),bl=(0,st.dd)((function(e){var n=e.addNew,t=e.addNewBlock,i=e.blockType;return(0,_.jsx)(ee.BC,{children:(0,_.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}}),yl()},showAddingNewTemplates:!!n,showBreadcrumbs:!0,tabs:[Or.n9]})})}),{},[],{background:!0,uuid:"browse_templates"}),xl=(0,r.Z)(bl,2),jl=xl[0],yl=xl[1],kl=z.ZP.global_data_products.list({},{revalidateOnFocus:!1}).data,Zl=(0,f.useMemo)((function(){return(null===kl||void 0===kl?void 0:kl.global_data_products)||[]}),[kl]),Pl=(0,st.dd)((function(e){var n=e.addNewBlock;return(0,_.jsx)(ee.BC,{children:(0,_.jsx)(Kn.Z,{children:(0,_.jsx)(Fn.Z,{globalDataProducts:Zl,onClickRow:function(e){n({configuration:{global_data_product:{uuid:null===e||void 0===e?void 0:e.uuid}},type:b.tf.GLOBAL_DATA_PRODUCT}),wl()}})})})}),{},[Zl],{background:!0,uuid:"global_data_products"}),Ol=(0,r.Z)(Pl,2),Cl=Ol[0],wl=Ol[1],Sl=(0,f.useRef)(null),_l=(0,f.useState)(null),El=_l[0],Il=_l[1],Tl=(0,f.useMemo)((function(){return ei.cH.INTERACTIONS===Ft}),[Ft]);(0,f.useEffect)((function(){var e,n;Ft&&null!==Sl&&void 0!==Sl&&Sl.current&&Il(null===Sl||void 0===Sl||null===(e=Sl.current)||void 0===e||null===(n=e.getBoundingClientRect())||void 0===n?void 0:n.height)}),[Ft,be,de,tn,Sl]),(0,f.useEffect)((function(){!pr&&(null===Wn||void 0===Wn?void 0:Wn.length)>=1&&fr((0,Ie.HK)(Wn||[],(function(e){return e.uuid})))}),[Wn,pr,fr]),(0,f.useEffect)((function(){!gr&&null!==Gn&&void 0!==Gn&&Gn.blocks&&br(null===Gn||void 0===Gn?void 0:Gn.blocks)}),[gr,Gn,br]);var Ml=(0,f.useMemo)((function(){return(0,_.jsx)(hr,{activeView:Ft,addNewBlockAtIndex:function(e,n,t,i){var o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return new Promise((function(){return $r({block:e,idx:n,isReplacingBlock:o,name:i,onCreateCallback:t})}))},afterWidth:_e,autocompleteItems:To,blockInteractionsMapping:gr,blockRefs:zt,blocks:wi,blocksInNotebook:cr,cancelPipeline:fl,chartRefs:Yt,checkIfPipelineRunning:hl,containerHeightOffset:Tl?El+1:null,contentByBlockUUID:Qt,createInteraction:Jn,deleteBlock:Br,deleteWidget:Ao,editingBlock:Ni,executePipeline:pl,fetchFiles:Lo,fetchPipeline:En,fetchSecrets:Pi,fetchVariables:bi,globalDataProducts:Zl,globalVariables:yi,insights:Po,interactions:Wn,interactionsMapping:pr,interruptKernel:Yr,isLoadingCreateInteraction:$n,isLoadingUpdatePipelineInteraction:qn,isPipelineExecuting:Di,isPipelineUpdating:qo,lastTerminalMessage:Q,messages:xn,metadata:Co,onChangeCallbackBlock:ri,onChangeChartBlock:si,onChangeCodeBlock:ui,onSelectBlockFile:qi,onUpdateFileSuccess:Do,permissions:jr,pipeline:F,pipelineInteraction:Gn,pipelineMessages:Pn,project:ue,refAfterFooter:Sl,runBlock:gl,runningBlocks:Fi,sampleData:mo,savePipelineContent:er,savePipelineInteraction:Dr,secrets:Oi,selectedBlock:Wi,selectedFilePath:Ho,sendTerminalMessage:ne,setActiveSidekickView:Wt,setAllowCodeBlockShortcuts:Je,setAnyInputFocused:ze,setBlockInteractionsMapping:br,setDisableShortcuts:qe,setEditingBlock:Li,setErrors:Ae,setHiddenBlocks:bt,setInteractionsMapping:fr,setPermissions:Mr,setSelectedBlock:Ki,setTextareaFocused:Ge,showBrowseTemplates:jl,showDataIntegrationModal:rr,showUpdateBlockModal:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,J.Y6)(),t=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return new Promise((function(){return $r({block:e,isReplacingBlock:t,isUpdatingBlock:!t,name:n})}))},sideBySideEnabled:rt,statistics:So,textareaFocused:He,treeRef:Vt,updatePipelineInteraction:Vn,updatePipelineMetadata:ar,updateWidget:Mi,widgets:Ei})}),[Ft,El,_e,To,gr,zt,wi,cr,fl,hl,Qt,Jn,Br,Ao,Ni,pl,Lo,En,Pi,bi,Zl,yi,Po,Wn,pr,Yr,$n,qn,Di,qo,Tl,Q,xn,Co,ri,si,ui,qi,Do,jr,F,Gn,Pn,ue,Sl,gl,Fi,mo,er,Dr,Oi,Wi,Ho,ne,Wt,ze,br,Li,Ae,bt,fr,Mr,Ge,$r,jl,rr,rt,So,He,Vn,ar,Mi,Ei]),Al=(0,f.useMemo)((function(){return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)("div",{style:{height:he?null:0,opacity:he?null:0,visibility:he?null:"hidden"},children:Ml}),(0,_.jsx)("div",{style:{height:he?0:null,opacity:he?0:null,visibility:he?"hidden":null},children:No})]})}),[No,he,Ml]),Dl=(0,f.useMemo)((function(){return he?(0,_.jsx)(mr,{activeView:Ft,pipeline:F,project:ue,secrets:Oi,selectedBlock:Wi,setSelectedBlock:Ki,variables:yi}):(0,_.jsx)(Ln.Z,{children:Go})}),[Ft,Go,yi,F,ue,Oi,Wi,Ki]),Rl=(0,f.useMemo)((function(){return(0,_.jsx)(fi,{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;X.L.BLOCK_FILE!==(null===e||void 0===e||null===(o=e.block_action_object)||void 0===o?void 0:o.object_type)&&(b.tf.DBT!==(null===e||void 0===e?void 0:e.type)||b.t6.SQL!==(null===e||void 0===e?void 0:e.language)||null!==e&&void 0!==e&&e.block_action_object)?$r({block:e,idx:n,name:i,onCreateCallback:t}):Qr(e,n,t,i)}))})),addWidget:function(e,n){var t=n.onCreateCallback;return ul(e,Ei.length,t)},afterHidden:be,allBlocks:wi,allowCodeBlockShortcuts:Xe,anyInputFocused:Ke,autocompleteItems:To,beforeHidden:ke,blockInteractionsMapping:gr,blockRefs:zt,blocks:cr,blocksThatNeedToRefresh:$t,dataProviders:hi,deleteBlock:Br,disableShortcuts:Ve,fetchFiles:Lo,fetchPipeline:En,fetchSampleData:vo,files:Uo,globalDataProducts:Zl,globalVariables:yi,hiddenBlocks:pn,interactionsMapping:pr,interruptKernel:Yr,mainContainerRef:vn,mainContainerWidth:di,messages:xn,onChangeCallbackBlock:ri,onChangeCodeBlock:ui,openSidekickView:Kt,pipeline:F,pipelineContentTouched:At,project:ue,restartKernel:zr,runBlock:gl,runningBlocks:Fi,savePipelineContent:er,scrollTogether:dt,selectedBlock:Wi,setAnyInputFocused:ze,setDisableShortcuts:qe,setEditingBlock:Li,setErrors:Ae,setHiddenBlocks:bt,setIntegrationStreams:io,setOutputBlocks:eo,setPipelineContentTouched:Dt,setSelectedBlock:Ki,setSelectedOutputBlock:so,setSelectedStream:lo,setTextareaFocused:Ge,showBrowseTemplates:jl,showConfigureProjectModal:il,showDataIntegrationModal:rr,showGlobalDataProducts:Cl,showUpdateBlockModal:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,J.Y6)();return new Promise((function(){return $r({block:e,isUpdatingBlock:!0,name:n})}))},sideBySideEnabled:rt,textareaFocused:He,widgets:Ei})}),[Qr,ul,be,Xe,Ke,To,ke,zt,gr,wi,cr,$t,hi,Br,Ve,Lo,En,vo,Uo,Zl,yi,pn,pr,Yr,vn,di,xn,ri,ui,Kt,F,At,ue,zr,gl,Fi,er,dt,Wi,ze,Li,Ae,bt,Dt,Ki,Ge,$r,jl,il,rr,Cl,rt,He,Ei]),Bl=(0,f.useMemo)((function(){if(G===xt.b7)return(0,_.jsx)(Nn,{cancelPipeline:fl,createPipeline:Ko,executePipeline:pl,interruptKernel:Yr,isPipelineExecuting:Di,kernel:Pt,pipeline:F,restartKernel:zr,savePipelineContent:er,scrollTogether:dt,setActiveSidekickView:Wt,setMessages:jn,setScrollTogether:vt,setSideBySideEnabled:ht,sideBySideEnabled:rt,updatePipelineMetadata:ar})}),[fl,Ko,pl,Yr,Di,Pt,G,F,zr,er,dt,Ho,Wt,jn,vt,ht,rt,ar]),Nl=(0,f.useCallback)((function(e){e.widthOffset;if(G===xt.b7)return(0,_.jsx)(li.rK,{relativePosition:!0,children:(0,_.jsxs)(pt,{isBusy:Fi.length>=1,kernel:Pt,pipeline:F,restartKernel:zr,savePipelineContent:er,setErrors:Ae,setRunningBlocks:Hi,updatePipelineMetadata:ar,children:[(0,_.jsx)(O.Z,{pr:1}),Bl]})})}),[Bl,Go,Pt,G,F,zr,Fi,er,Ae,ar]),Ll=(0,f.useMemo)((function(){if(G===xt.b7)return(0,_.jsx)(yr,{kernel:Pt,pipelineContentTouched:At,pipelineLastSaved:Ct,ref:K,saveStatus:nr,width:di})}),[Pt,di,G,At,Ct,nr]),Ul=(0,f.useMemo)((function(){var e;return null===to||void 0===to||null===(e=to.filter((function(e){return(0,Ie.sE)(null===ho||void 0===ho?void 0:ho.outputs,(function(n){return n.variable_uuid==="output_sample_data_".concat((0,J.kE)(e))}))})))||void 0===e?void 0:e.map((function(e){return(0,_.jsx)(O.Z,{pl:1,children:(0,_.jsx)(U.ZP,{blackBorder:!0,compact:!0,muted:!0,onClick:function(){return lo(e)},selected:ro===e,uuid:e,children:e})},e)}))}),[ho,to,ro]),Fl=(0,f.useMemo)((function(){return(0,_.jsx)(T,{blockRefs:zt,hiddenBlocks:pn,pipeline:F,setHiddenBlocks:bt})}),[zt,pn,F,bt]),Hl=(0,f.useMemo)((function(){return xt.Jf.uuid===(null===un||void 0===un?void 0:un.uuid)?Bo:xt.IY.uuid===(null===un||void 0===un?void 0:un.uuid)?Fl:null}),[Fl,Bo,un]),Gl=(0,f.useMemo)((function(){return(0,_.jsx)(O.Z,{px:1,children:(0,_.jsx)(D.Z,{noPadding:!0,onClickTab:function(e){sn(e)},selectedTabUUID:null===un||void 0===un?void 0:un.uuid,tabs:xt.NR,underlineColor:(se||Se.Z).accent.purple,underlineStyle:!0})})}),[sn,un,se]);return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(Hn.Z,{title:null===(B=F)||void 0===B?void 0:B.name}),(0,_.jsxs)(xi,{after:Al,afterHeader:Dl,afterHeightOffset:Pr.Mz,afterHidden:be,afterInnerHeightMinus:El,afterNavigationItems:_r({activeView:Ft,pipeline:F,project:ue,secrets:Oi,setActiveSidekickView:Wt,variables:yi}),afterOverflow:ei.cH.DATA===Ft?"hidden":null,afterSubheader:(null===$i||void 0===$i?void 0:$i.length)>0&&Ft===ei.cH.DATA&&(0,_.jsxs)(Z.ZP,{alignItems:"center",fullHeight:!0,fullWidth:!0,children:[!et&&$i.map((function(e){var n=e.uuid,t=(null===co||void 0===co?void 0:co.uuid)===n;return(0,_.jsx)(O.Z,{pl:1,children:(0,_.jsx)(U.ZP,{afterElement:t?(0,_.jsx)(A.ZP,{basic:!0,highlightOnHover:!0,onClick:function(){(0,kt.h8)(fe,e.uuid),eo((function(e){return e.filter((function(e){return e.uuid!==n}))}))},padding:"2px",transparent:!0,children:(0,_.jsx)(Y.x8,{muted:!0,size:1.25*w.iI})}):null,blackBorder:!0,compact:!0,muted:!0,onClick:function(){return so(e)},selected:t,uuid:n,children:n})},n)})),et&&Ul]}),before:Hl,beforeHeader:Gl,beforeHeightOffset:Pr.Mz,beforeHidden:ke,beforeNavigationItems:(0,Sr.H)(wr.M.EDIT,F),errors:Re||Me,footerOffset:null===K||void 0===K||null===(N=K.current)||void 0===N||null===(L=N.getBoundingClientRect())||void 0===L?void 0:L.height,mainContainerFooter:Ll,mainContainerHeader:Nl,mainContainerRef:vn,page:G,pipeline:F,setAfterHidden:xe,setAfterWidthForChildren:Ee,setBeforeHidden:Ze,setErrors:Re?Be:Ae,setMainContainerWidth:pi,children:[(0,_.jsx)(m.Z,{uuid:"PipelineDetail/".concat(fe),children:Rl}),(0,_.jsx)(O.Z,{pb:rt?0:Math.max(Math.floor(de*(2/3)/w.iI),0)})]})]})}Dr.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=xt.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 Rr=(0,yi.Z)(Dr)},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,g=(0,r.useMemo)((function(){return null===h||void 0===h?void 0:h.compute_service}),[h]),b={};d&&(b.include_all_states=!0);var x=u.ZP.compute_clusters.compute_services.list(null===g||void 0===g?void 0:g.uuid,b,{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!==g&&void 0!==g&&null!==(e=g.setup_steps)&&void 0!==e&&e.length?null===g||void 0===g||null===(n=g.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}),[g]),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===g||void 0===g?void 0:g.uuid,{},{refreshInterval:s},{pauseFetch:!f})),C=O.data,w=O.mutate,S=(0,r.useMemo)((function(){return(null===C||void 0===C?void 0:C.compute_connections)||[]}),[C]),_=(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:g,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:S,connectionsLoading:!C,fetchAll:_,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(80265)}])}},function(e){e.O(0,[9774,2678,3662,1154,844,5820,6639,1124,1751,341,5896,2714,9161,1821,2631,7011,4783,6563,874,1557,8264,7858,5499,5283,3745,8998,3004,9264,5533,976,161,3540,2888,179],(function(){return n=76419,e(e.s=n);var n}));var n=e.O();_N_E=n}]);
|