mage-ai 0.9.46__py3-none-any.whl → 0.9.47__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.
- mage_ai/api/operations/base.py +27 -5
- mage_ai/api/policies/GlobalHookPolicy.py +1 -1
- mage_ai/api/policies/IntegrationSourcePolicy.py +62 -0
- mage_ai/api/policies/OauthPolicy.py +6 -6
- mage_ai/api/presenters/GlobalHookPresenter.py +1 -1
- mage_ai/api/presenters/IntegrationSourcePresenter.py +9 -2
- mage_ai/api/presenters/PipelinePresenter.py +2 -0
- mage_ai/api/presenters/PipelineRunPresenter.py +8 -3
- mage_ai/api/presenters/PipelineSchedulePresenter.py +22 -1
- mage_ai/api/resources/BlockResource.py +5 -0
- mage_ai/api/resources/DataProviderResource.py +2 -0
- mage_ai/api/resources/IntegrationSourceResource.py +149 -2
- mage_ai/data_integrations/sources/constants.py +5 -0
- mage_ai/data_integrations/utils/scheduler.py +57 -2
- mage_ai/data_preparation/executors/block_executor.py +9 -1
- mage_ai/data_preparation/models/block/__init__.py +25 -12
- mage_ai/data_preparation/models/block/data_integration/constants.py +3 -0
- mage_ai/data_preparation/models/block/data_integration/utils.py +196 -37
- mage_ai/data_preparation/models/block/sql/utils/shared.py +18 -1
- mage_ai/data_preparation/models/block/utils.py +28 -13
- mage_ai/data_preparation/models/global_hooks/constants.py +50 -1
- mage_ai/data_preparation/models/global_hooks/models.py +148 -84
- mage_ai/data_preparation/models/global_hooks/predicates.py +316 -0
- mage_ai/data_preparation/models/pipeline.py +2 -0
- mage_ai/data_preparation/models/pipelines/integration_pipeline.py +0 -1
- mage_ai/data_preparation/preferences.py +29 -18
- mage_ai/data_preparation/repo_manager.py +12 -2
- mage_ai/data_preparation/sync/__init__.py +2 -0
- mage_ai/data_preparation/templates/constants.py +14 -0
- mage_ai/data_preparation/templates/data_exporters/chroma.py +24 -0
- mage_ai/data_preparation/templates/data_exporters/streaming/rabbitmq.yaml +7 -0
- mage_ai/data_preparation/templates/data_loaders/chroma.py +27 -0
- mage_ai/data_preparation/templates/repo/io_config.yaml +3 -0
- mage_ai/io/base.py +1 -0
- mage_ai/io/chroma.py +153 -0
- mage_ai/io/config.py +8 -0
- mage_ai/orchestration/db/models/schedules.py +98 -34
- mage_ai/orchestration/pipeline_scheduler.py +58 -19
- mage_ai/server/constants.py +1 -1
- mage_ai/server/frontend_dist/404.html +2 -2
- mage_ai/server/frontend_dist/_next/static/N3FS4bHv0jpYeeg672uYK/_buildManifest.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/{1749-9a6276b2918fdae1.js → 1749-bf512b4dabbab7fa.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/{1952-ac7722e8b1ab88fe.js → 1952-57858e7445d24413.js} +1 -1
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/2714-1e79e9f2e998b544.js → frontend_dist/_next/static/chunks/2714-68fef54789d7eaeb.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/2717-92cdffd87b6f6e05.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/3419-f8d518d024e7b5c8.js → frontend_dist/_next/static/chunks/3419-715ca383fa15a5ef.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/3437-b4d6a037cf5781f8.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/3943-c9fb980f03df6450.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/4267-cb102e060a43d9bd.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/4366-93e09e5a4a7e182c.js → frontend_dist/_next/static/chunks/4366-3e52497942acbafe.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/{4783-1a21d9be47574bba.js → 4783-422429203610c318.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/5810-e26a0768db1cfdba.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/{5896-14e5a23b1c6a0769.js → 5896-7b8e36634d7d94eb.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/{6285-e9b45335bfb9ccaf.js → 6285-648f9a732e100b2f.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/6798-b904395b0c18647b.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/7022-070ec0144a4d029c.js → frontend_dist/_next/static/chunks/7022-e76cae3ba5ee5312.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/722-900f786d24f91b2e.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/{7361-694e1e4fb9c97d68.js → 7361-6c5c9063b9f91700.js} +1 -1
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/8146-92e7ccfed169ee9c.js → frontend_dist/_next/static/chunks/8146-27f0e31f309897a5.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/845-9a73c65fe3fdc328.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/8487-8e1c09546dff4dbf.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/9264-cc44b07f248707b0.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/9618-4eb49cdbd1ba11d7.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/{976-18c98af60b76f1a7.js → 976-0a8c2c4d7acd957b.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/_app-78c4a077a2f279c2.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/files-b37d221eb5ddc248.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/global-hooks/[...slug]-7adc543fc490367a.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/global-hooks-51d366993f6dd449.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/{files-449a022f2f0f2d94.js → files-fe6e73463a20d67c.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/{manage-f83deb790548693b.js → manage-d8a38b5d1f50e798.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-9adc2974aada27ba.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills-51b1311dff2a974e.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-2333e524d34b474a.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors-e051057d9fe94f23.js → frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors-6d1afeb4a84f50f7.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs/[run]-1ff9bb8e22ca1e75.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/settings-11363aa58d51f4e1.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-779c3ef0676a12ac.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers-bbea9a088657404a.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines-3737f2b0afc2ede3.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/account/profile-3c8f062913c66f3e.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/preferences-c1f4ed17d501ccca.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/triggers-8bdd858240d5dbf6.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/version-control-dd4fb405695f74bf.js +1 -0
- mage_ai/server/frontend_dist/block-layout.html +2 -2
- mage_ai/server/frontend_dist/compute.html +5 -5
- mage_ai/server/frontend_dist/files.html +5 -5
- mage_ai/server/frontend_dist/global-data-products/[...slug].html +5 -5
- mage_ai/server/frontend_dist/global-data-products.html +5 -5
- mage_ai/server/frontend_dist/global-hooks/[...slug].html +5 -5
- mage_ai/server/frontend_dist/global-hooks.html +5 -5
- mage_ai/server/frontend_dist/index.html +2 -2
- mage_ai/server/frontend_dist/manage/files.html +5 -5
- mage_ai/server/frontend_dist/manage/settings.html +5 -5
- mage_ai/server/frontend_dist/manage/users/[user].html +5 -5
- mage_ai/server/frontend_dist/manage/users/new.html +5 -5
- mage_ai/server/frontend_dist/manage/users.html +5 -5
- mage_ai/server/frontend_dist/manage.html +5 -5
- mage_ai/server/frontend_dist/oauth.html +4 -4
- mage_ai/server/frontend_dist/overview.html +5 -5
- mage_ai/server/frontend_dist/pipeline-runs.html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills/[...slug].html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills.html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/dashboard.html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/edit.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/logs.html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runs.html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runtime.html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors.html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/runs/[run].html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/runs.html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/settings.html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/syncs.html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers/[...slug].html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers.html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline].html +2 -2
- mage_ai/server/frontend_dist/pipelines.html +5 -5
- mage_ai/server/frontend_dist/settings/account/profile.html +5 -5
- mage_ai/server/frontend_dist/settings/workspace/permissions/[...slug].html +5 -5
- mage_ai/server/frontend_dist/settings/workspace/permissions.html +5 -5
- mage_ai/server/frontend_dist/settings/workspace/preferences.html +5 -5
- mage_ai/server/frontend_dist/settings/workspace/roles/[...slug].html +5 -5
- mage_ai/server/frontend_dist/settings/workspace/roles.html +5 -5
- mage_ai/server/frontend_dist/settings/workspace/sync-data.html +5 -5
- mage_ai/server/frontend_dist/settings/workspace/users/[...slug].html +5 -5
- mage_ai/server/frontend_dist/settings/workspace/users.html +5 -5
- mage_ai/server/frontend_dist/settings.html +2 -2
- mage_ai/server/frontend_dist/sign-in.html +20 -20
- mage_ai/server/frontend_dist/templates/[...slug].html +5 -5
- mage_ai/server/frontend_dist/templates.html +5 -5
- mage_ai/server/frontend_dist/terminal.html +5 -5
- mage_ai/server/frontend_dist/test.html +5 -5
- mage_ai/server/frontend_dist/triggers.html +5 -5
- mage_ai/server/frontend_dist/version-control.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/404.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/_next/static/aoO6jYZLVlUGCCdY-wmy8/_buildManifest.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{1749-9a6276b2918fdae1.js → 1749-bf512b4dabbab7fa.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{1952-ac7722e8b1ab88fe.js → 1952-57858e7445d24413.js} +1 -1
- mage_ai/server/{frontend_dist/_next/static/chunks/2714-1e79e9f2e998b544.js → frontend_dist_base_path_template/_next/static/chunks/2714-68fef54789d7eaeb.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/2717-92cdffd87b6f6e05.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/3419-f8d518d024e7b5c8.js → frontend_dist_base_path_template/_next/static/chunks/3419-715ca383fa15a5ef.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3437-b4d6a037cf5781f8.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3943-c9fb980f03df6450.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/4267-cb102e060a43d9bd.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/4366-93e09e5a4a7e182c.js → frontend_dist_base_path_template/_next/static/chunks/4366-3e52497942acbafe.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{4783-1a21d9be47574bba.js → 4783-422429203610c318.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5810-e26a0768db1cfdba.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{5896-14e5a23b1c6a0769.js → 5896-7b8e36634d7d94eb.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{6285-e9b45335bfb9ccaf.js → 6285-648f9a732e100b2f.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/6798-b904395b0c18647b.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/7022-070ec0144a4d029c.js → frontend_dist_base_path_template/_next/static/chunks/7022-e76cae3ba5ee5312.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/722-900f786d24f91b2e.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{7361-694e1e4fb9c97d68.js → 7361-6c5c9063b9f91700.js} +1 -1
- mage_ai/server/{frontend_dist/_next/static/chunks/8146-92e7ccfed169ee9c.js → frontend_dist_base_path_template/_next/static/chunks/8146-27f0e31f309897a5.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/845-9a73c65fe3fdc328.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8487-8e1c09546dff4dbf.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9264-cc44b07f248707b0.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9618-4eb49cdbd1ba11d7.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{976-18c98af60b76f1a7.js → 976-0a8c2c4d7acd957b.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/_app-78c4a077a2f279c2.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/files-b37d221eb5ddc248.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-hooks/[...slug]-7adc543fc490367a.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-hooks-51d366993f6dd449.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/{files-449a022f2f0f2d94.js → files-fe6e73463a20d67c.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{manage-f83deb790548693b.js → manage-d8a38b5d1f50e798.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-9adc2974aada27ba.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills-51b1311dff2a974e.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/edit-2333e524d34b474a.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors-e051057d9fe94f23.js → frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors-6d1afeb4a84f50f7.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/runs/[run]-1ff9bb8e22ca1e75.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/settings-11363aa58d51f4e1.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-779c3ef0676a12ac.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers-bbea9a088657404a.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines-3737f2b0afc2ede3.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/account/profile-3c8f062913c66f3e.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/preferences-c1f4ed17d501ccca.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/triggers-8bdd858240d5dbf6.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/version-control-dd4fb405695f74bf.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 +4 -4
- 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/settings/account/profile.html +5 -5
- 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 +23 -23
- 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 +5 -5
- 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/server.py +9 -3
- mage_ai/services/k8s/job_manager.py +1 -0
- mage_ai/settings/repo.py +3 -0
- mage_ai/shared/files.py +47 -0
- mage_ai/shared/models.py +1 -0
- mage_ai/streaming/constants.py +1 -0
- mage_ai/streaming/sinks/postgres.py +2 -0
- mage_ai/streaming/sinks/rabbitmq.py +76 -0
- mage_ai/streaming/sinks/sink_factory.py +4 -0
- mage_ai/tests/api/operations/test_operations_with_hooks.py +136 -91
- mage_ai/tests/api/policies/test_oauth_policy.py +38 -0
- mage_ai/tests/data_preparation/models/global_hooks/test_global_hooks.py +33 -8
- mage_ai/tests/data_preparation/models/global_hooks/test_hook.py +82 -38
- mage_ai/tests/data_preparation/models/global_hooks/test_predicates.py +803 -0
- mage_ai/tests/data_preparation/models/global_hooks/test_utils.py +6 -1
- mage_ai/tests/data_preparation/models/test_block.py +26 -0
- mage_ai/tests/data_preparation/models/test_pipeline.py +10 -0
- mage_ai/tests/factory.py +40 -2
- mage_ai/tests/orchestration/test_pipeline_scheduler.py +82 -1
- mage_ai/tests/services/k8s/test_job_manager.py +16 -0
- mage_ai/tests/shared/mixins.py +60 -23
- mage_ai/tests/streaming/sinks/test_rabbitmq.py +36 -0
- {mage_ai-0.9.46.dist-info → mage_ai-0.9.47.dist-info}/METADATA +7 -4
- {mage_ai-0.9.46.dist-info → mage_ai-0.9.47.dist-info}/RECORD +257 -243
- {mage_ai-0.9.46.dist-info → mage_ai-0.9.47.dist-info}/WHEEL +1 -1
- mage_ai/server/frontend_dist/_next/static/9jB4XPuz6BzxBcG9VNao5/_buildManifest.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/3943-9e1105393a3be0de.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/4267-fd4d8049e83178de.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/5810-12eadc488265d55b.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/595-0d174b1f9fbfce4f.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/6333-bc1b433b428a9095.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/722-a1584445357a276c.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/8487-032ef9b17d20aad9.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/9264-1d4f0327d42fed91.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/9618-2c5045255ac5a6e7.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/_app-ebef928183f9a3bb.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/files-0f2d4be6fdca86ca.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/global-hooks/[...slug]-77edfa32d000e88b.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/global-hooks-e561ae38cf5592e8.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-10e9a2d19541caa2.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills-c8d3a5289ab93f88.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-ff7e9108502f5716.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs/[run]-0691711636fa95c7.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/settings-2914e326a5f1ffe0.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-3a7500e6e53084d3.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers-c0e551d265a8d467.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines-e47db5c3eaf683af.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/account/profile-55ac955dfa9a5a8d.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/preferences-29c92a9bc54ae5cd.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/triggers-572d82d6eb7a5d43.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/version-control-2d26d80370a2e481.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3943-9e1105393a3be0de.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/4267-fd4d8049e83178de.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5810-12eadc488265d55b.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/595-0d174b1f9fbfce4f.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/6333-bc1b433b428a9095.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/722-a1584445357a276c.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8487-032ef9b17d20aad9.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9264-1d4f0327d42fed91.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9618-2c5045255ac5a6e7.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/_app-ebef928183f9a3bb.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/files-0f2d4be6fdca86ca.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-hooks/[...slug]-77edfa32d000e88b.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-hooks-e561ae38cf5592e8.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-10e9a2d19541caa2.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills-c8d3a5289ab93f88.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/edit-ff7e9108502f5716.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/runs/[run]-0691711636fa95c7.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/settings-2914e326a5f1ffe0.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-3a7500e6e53084d3.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers-c0e551d265a8d467.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines-e47db5c3eaf683af.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/account/profile-55ac955dfa9a5a8d.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/preferences-29c92a9bc54ae5cd.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/triggers-572d82d6eb7a5d43.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/version-control-2d26d80370a2e481.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/uPDjJYpJMst1q6psbRyte/_buildManifest.js +0 -1
- /mage_ai/server/frontend_dist/_next/static/{9jB4XPuz6BzxBcG9VNao5 → N3FS4bHv0jpYeeg672uYK}/_ssgManifest.js +0 -0
- /mage_ai/server/frontend_dist_base_path_template/_next/static/{uPDjJYpJMst1q6psbRyte → aoO6jYZLVlUGCCdY-wmy8}/_ssgManifest.js +0 -0
- {mage_ai-0.9.46.dist-info → mage_ai-0.9.47.dist-info}/LICENSE +0 -0
- {mage_ai-0.9.46.dist-info → mage_ai-0.9.47.dist-info}/entry_points.txt +0 -0
- {mage_ai-0.9.46.dist-info → mage_ai-0.9.47.dist-info}/top_level.txt +0 -0
mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-2333e524d34b474a.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2551,5810],{7432:function(e,n,t){var i={"./Active4D.json":[266,266],"./All Hallows Eve.json":[4450,4450],"./Amy.json":[88849,8849],"./Birds of Paradise.json":[78097,8097],"./Blackboard.json":[88018,6115],"./Brilliance Black.json":[73835,3835],"./Brilliance Dull.json":[6507,6507],"./Chrome DevTools.json":[22508,2508],"./Clouds Midnight.json":[49566,9566],"./Clouds.json":[57951,7951],"./Cobalt.json":[80826,826],"./Cobalt2.json":[98256,8256],"./Dawn.json":[76958,6958],"./Dominion Day.json":[89307,9307],"./Dracula.json":[33453,3453],"./Dreamweaver.json":[19363,9363],"./Eiffel.json":[82481,2481],"./Espresso Libre.json":[44776,4776],"./GitHub Dark.json":[792,792],"./GitHub Light.json":[61450,1450],"./GitHub.json":[10739,739],"./IDLE.json":[67947,7947],"./Katzenmilch.json":[81240,1240],"./Kuroir Theme.json":[4388,4388],"./LAZY.json":[25164,5164],"./MagicWB (Amiga).json":[76443,6443],"./Merbivore Soft.json":[99361,9361],"./Merbivore.json":[86042,6042],"./Monokai Bright.json":[14883,4883],"./Monokai.json":[34454,4454],"./Night Owl.json":[60261,261],"./Nord.json":[59785,9785],"./Oceanic Next.json":[58920,8920],"./Pastels on Dark.json":[38901,8901],"./Slush and Poppies.json":[26434,6434],"./Solarized-dark.json":[36116,6116],"./Solarized-light.json":[5008,5008],"./SpaceCadet.json":[20440,440],"./Sunburst.json":[68018,8018],"./Textmate (Mac Classic).json":[15824,5824],"./Tomorrow-Night-Blue.json":[81150,1150],"./Tomorrow-Night-Bright.json":[8762,8762],"./Tomorrow-Night-Eighties.json":[82545,2545],"./Tomorrow-Night.json":[99855,9855],"./Tomorrow.json":[34092,4092],"./Twilight.json":[93898,3898],"./Upstream Sunburst.json":[98807,8807],"./Vibrant Ink.json":[89927,9927],"./Xcode_default.json":[64042,4042],"./Zenburnesque.json":[33467,3467],"./iPlastic.json":[88277,8277],"./idleFingers.json":[5104,5104],"./krTheme.json":[9633,9633],"./monoindustrial.json":[15729,5729],"./themelist.json":[79437,9437]};function o(e){if(!t.o(i,e))return Promise.resolve().then((function(){var n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}));var n=i[e],o=n[0];return t.e(n[1]).then((function(){return t.t(o,19)}))}o.keys=function(){return Object.keys(i)},o.id=7432,e.exports=o},65557:function(e,n,t){"use strict";var i=t(21831),o=t(75582),r=t(82684),l=t(80329);n.Z=function(e){var n=e.children,t=e.uuid,u=e.uuids,c=void 0===u?[]:u,a=(0,l.j)("apiReloads"),s=(0,o.Z)(a,1)[0],d=(0,i.Z)(c);t&&d.push(t);var p=d.map((function(e){return String(s[e])||"-"})).join("_");return r.cloneElement(n,{key:p})}},89209:function(e,n,t){"use strict";t.d(n,{M4:function(){return d},S0:function(){return a},S_:function(){return c},Yn:function(){return p},rW:function(){return s}});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 a(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],a=r[3],s=r[4],d=r[5],p=c||a||s||d;return u(u({},e),{},(0,i.Z)({},p,n))}),{})}function s(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 a=(0,r.Z)(c,4),s=a[2],d=a[3];return s||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 a},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 '})),a=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),a=t(98464),s=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,_=e.onMountCallback,S=e.onSave,E=e.padding,I=e.placeholder,T=e.readOnly,M=e.selected,D=(e.setSelected,e.setTextareaFocused),R=e.shortcuts,A=e.showLineNumbers,B=void 0===A||A,N=e.tabSize,L=void 0===N?4:N,F=e.textareaFocused,U=e.theme,H=void 0===U?"twilight":U,z=e.value,G=e.width,W=void 0===G?"100%":G,K=(0,r.useRef)(null),V=(0,r.useRef)(null),q=(0,r.useRef)(null),Y=(0,r.useState)([]),Q=Y[0],X=Y[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]),ae=(0,r.useCallback)((function(e,n){K.current=e,V.current=n;var t=[];null===R||void 0===R||R.forEach((function(i){t.push(i(n,e))})),S&&t.push((0,g.e)(n,(function(){S(e.getValue())}))),v(0,e,t),e.getModel().updateOptions({tabSize:L}),l&&!Z&&(e._domElement.style.height="".concat(((z||"").split("\n").length+p.Ep)*p.aU,"px")),e.onDidFocusEditorWidget((function(){null===D||void 0===D||D(!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&&F&&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===_||void 0===_||_()}),[l,Z,C,w,_,S,M,ie,D,R,L,F,z]);(0,r.useEffect)((function(){var e;return x&&S&&(e=setInterval((function(){S(K.current.getValue())}),5e3)),function(){x&&e&&clearInterval(e)}}),[x,K,S]);var se=(0,a.Z)(M),de=(0,a.Z)(F);return(0,r.useEffect)((function(){null!==K&&void 0!==K&&K.current&&(M&&F?setTimeout((function(){K.current.focus()}),1):i.findDOMNode(K.current._domElement).getElementsByClassName("inputarea")[0].blur())}),[K,M,se,F,de]),(0,r.useEffect)((function(){if(null!==V&&void 0!==V&&V.current&&null!==K&&void 0!==K&&K.current){var e=[];null===R||void 0===R||R.forEach((function(n){e.push(n(null===V||void 0===V?void 0:V.current,null===K||void 0===K?void 0:K.current))})),v(null===V||void 0===V||V.current,null===K||void 0===K?void 0:K.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&&F||!de&&F?X((0,f.S_)($,n)):de&&!F&&Q.map((function(e){return e.dispose()})))}),[n,Q,$,F,de]),(0,b.jsxs)(p.Nk,{hideDuplicateMenuItems:!0,padding:E,style:{display:te?null:"none"},children:[I&&!(null!==z&&void 0!==z&&z.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:ae,options:{domReadOnly:T,fontFamily:s.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:z,width:W}),(0,b.jsx)("div",{ref:q})]})}},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),a=t(85854),s=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,_=e.status_calculated,S=e.steps,E=e.tab,I=e.uuid,T=(null===S||void 0===S?void 0:S.length)||0,M=x||{completedGroup:!1,level:0,numberEl:null},D=M.completedGroup,R=M.level,A=M.numberEl,B=0===R?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)(a.Z,{level:y?5:4,children:Z}),(0,b.jsx)(d.Z,{mr:v.cd}),m.br.COMPLETED===_&&(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===S||void 0===S?void 0:S.map((function(e,n){return k(e,n,T,{completedGroup:m.br.COMPLETED===_,level:0})}))]});return(0,b.jsxs)(d.Z,{mb:y?0:v.cd,children:[t&&(0,b.jsx)(s.Z,{noPadding:!0,children:N}),!t&&N]},I)}var L=m.br.COMPLETED===_,F=0===R?String(n+1):(0,g.bH)()[n].toLowerCase();var U=!!E&&i,H=(0,b.jsx)(d.Z,{pl:0===R?v.cd:0,children:(0,b.jsxs)(p.ZP,{large:!y,monospace:!0,muted:!0,children:[F,"."]})}),z={muted:L||D,strikethrough:L||D};return(0,b.jsx)(h.aw,{clickable:!!U,onClick:U?function(){return null===i||void 0===i?void 0:i(E)}:null,children:(0,b.jsxs)(d.Z,{py:0!==R||y?1:v.cd,children:[(0,b.jsxs)(c.ZP,{children:[A&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{style:{opacity:0},children:A}),(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===R&&!y&&(0,b.jsx)(a.Z,j(j({level:5},z),{},{children:Z})),0===R&&y&&(0,b.jsx)(p.ZP,j(j({bold:!0,large:!0},z),{},{children:Z})),R>=1&&(0,b.jsx)(p.ZP,j(j({bold:!0,large:!y},z),{},{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===_&&(0,b.jsx)(f.uy,{muted:!0,size:B}),m.br.ERROR===_&&(0,b.jsx)(f.uy,{danger:!0,size:B}),(0,b.jsx)(d.Z,{pr:v.cd*(_?1:2)})]}),P&&(0,b.jsx)(d.Z,{mt:1,pr:3*v.cd,children:(0,b.jsx)(p.ZP,j(j({default:!0},z),{},{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===S||void 0===S?void 0:S.map((function(e,n){return k(e,n,T,{completedGroup:D,level:1,numberEl:H})}))})]})},I)}),[t,i,y]),Z=[],P=(null===x||void 0===x?void 0:x.length)||0;return null===x||void 0===x||x.forEach((function(e,n){e.status;Z.push(k(e,n,P))})),t?(0,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),a=t(74260),s=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,_=void 0===C||C,S=e.fetchAll,E=e.hideDetails,I=e.onClickStep,T=e.small,M=(0,P.VI)(null,{},[],{uuid:"ConnectionSettings"}),D=(0,o.Z)(M,1)[0],R=(0,r.useState)(null),A=R[0],B=R[1],N=(0,r.useState)(null),L=N[0],F=N[1],U=(0,l.Db)((function(e){var n=e.action,i=e.uuid;return 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===S||void 0===S||S(),F(w(w({},A),{},{computeConnection:n}))},onErrorCallback:function(e,n){return D({errors:n,response:e})}})}}),H=(0,o.Z)(U,2),z=H[0],G=H[1].isLoading;return(0,r.useEffect)((function(){if(L){var e,n=null===i||void 0===i?void 0:i.find((function(e){var n,t=e.uuid;return(null===L||void 0===L||null===(n=L.computeConnection)||void 0===n?void 0:n.uuid)===t}));(null===n||void 0===n?void 0:n.state)!==(null===L||void 0===L||null===(e=L.computeConnection)||void 0===e?void 0:e.state)&&F(null)}}),[i,L,F]),(0,O.jsx)(m.Z,{py:_?x.cd:0,children:null===i||void 0===i?void 0:i.map((function(e,t){var i,r,l,b,Z=e.actions,P=e.attributes,C=e.connection,w=e.description,S=e.name,M=e.required,D=e.status_calculated,R=e.steps,N=e.uuid;!E&&!n&&P&&(null===(i=Object.keys(P||{}))||void 0===i?void 0:i.length)>=1&&(l=(0,k.s)(Object.entries(P||{}).map((function(e){var n=(0,o.Z)(e,2),t=n[0],i=n[1];return[(0,y.vg)(t),i]})))),!E&&!n&&C&&(null===(r=Object.keys(C||{}))||void 0===r?void 0:r.length)>=1&&(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 U=(0,O.jsxs)(O.Fragment,{children:[!n&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(m.Z,{p:x.cd,children:(0,O.jsx)(p.ZP,{children:(0,O.jsxs)(d.Z,{flex:1,flexDirection:"column",children:[(0,O.jsxs)(p.ZP,{alignItems:"center",children:[(0,O.jsx)(d.Z,{flex:1,children:(0,O.jsx)(f.Z,{level:T?5:4,children:S})}),(0,O.jsx)(m.Z,{mr:x.cd}),(0,O.jsx)(j.Fs,{danger:a.br.ERROR===D,muted:M&&a.br.INCOMPLETE===D,size:2*x.iI,success:!M||a.br.COMPLETED===D})]}),w&&(0,O.jsx)(m.Z,{mt:1,children:(0,O.jsx)(g.ZP,{default:!0,small:T,children:w})})]})})}),(null===R||void 0===R?void 0:R.length)>=1&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(s.Z,{light:!0}),(0,O.jsx)(h.Z,{contained:!1,onClickStep:I,setupSteps:R,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)(s.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)(s.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,a=G&&(null===A||void 0===A?void 0:A.uuid)===N&&(null===A||void 0===A?void 0:A.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)(s.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:a,onClick:function(){B({actionUUID:l,uuid:N}),F(null),z({action:l,uuid:N})},primary:[c._.CREATE,c._.UPDATE].includes(l),secondary:[c._.DESELECT].includes(l),small:T,children:r})})]})})})]},l)}))]})]});return(0,O.jsxs)(m.Z,{mt:t>=1?x.cd:0,px:_?x.cd:0,children:[_&&(0,O.jsx)(v.Z,{noPadding:!0,children:U}),!_&&U]},N)}))})}},77456:function(e,n,t){"use strict";var i=t(82394),o=t(75582),r=t(43695),l=t(30160),u=t(28598);function c(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function a(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,s=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,a(a({danger:n,inline:!0,large:i,muted:!n&&!s,small:c,warning:s},p||{}),{},{children:d}))))})),(0,u.jsx)(l.ZP,{danger:n,dangerouslySetInnerHTML:{__html:f},muted:!n&&!s,large:i,small:c,warning:s})}},74778:function(e,n,t){"use strict";t.d(n,{UE:function(){return c},aw:function(){return a},bC:function(){return s}});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 ")})),a=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 ")})),s=i.default.div.withConfig({displayName:"indexstyle__NavigationStyle",componentId:"sc-1b5e7g-2"})([""," height:","px;padding-left:","px;padding-right:","px;"," ",""],(0,u.eR)(),7*l.iI,l.cd*l.iI,l.cd*l.iI,(function(e){return!e.selected&&"\n &:hover {\n background-color: ".concat((e.theme.interactive||o.Z.interactive).rowHoverBackground,";\n }\n ")}),(function(e){return e.selected&&"\n background-color: ".concat((e.theme.background||o.Z.background).codeTextarea,";\n ")}))},60523:function(e,n,t){"use strict";var i=t(21831),o=t(82394),r=t(82684),l=t(38626),u=t(34376),c=t(54750),a=t(71180),s=t(90299),d=t(44898),p=t(55485),f=t(88328),v=t(38276),h=t(4190),m=t(48381),g=t(5755),b=t(30160),x=t(35686),j=t(72473),y=t(84649),k=t(32929),Z=t(15610),P=t(19183),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,o.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,t=e.contained,o=e.defaultLinkUUID,C=e.defaultTab,_=e.objectType,S=e.onClickCustomTemplate,E=e.pipelineUUID,I=e.showAddingNewTemplates,T=e.showBreadcrumbs,M=e.tabs,D=(0,u.useRouter)(),R=(0,r.useContext)(l.ThemeContext),A=(0,P.i)(),B=A.height,N=A.width,L=(0,r.useMemo)((function(){return M||k.dP}),[M]),F=(0,r.useState)(I||!1),U=F[0],H=F[1],z=(0,r.useState)(o?k.qy.find((function(e){return e.uuid===o})):k.qy[0]),G=z[0],W=z[1],K=(0,r.useState)(C?L.find((function(e){return e.uuid===(null===C||void 0===C?void 0:C.uuid)})):L[0]),V=K[0],q=K[1],Y=(0,r.useState)(null),Q=Y[0],X=Y[1],J=x.ZP.custom_templates.list({object_type:d.Z},{},{pauseFetch:k.n9.uuid!==(null===V||void 0===V?void 0:V.uuid)}),$=J.data,ee=J.mutate,ne=(0,r.useMemo)((function(){var e=(null===$||void 0===$?void 0:$.custom_templates)||[];return null!==G&&void 0!==G&&G.filterTemplates?null===G||void 0===G?void 0:G.filterTemplates(e):e}),[$,G]),te=x.ZP.custom_templates.list({object_type:d.R},{},{pauseFetch:k.A2.uuid!==(null===V||void 0===V?void 0:V.uuid)}),ie=te.data,oe=te.mutate,re=(0,r.useMemo)((function(){var e=(null===ie||void 0===ie?void 0:ie.custom_templates)||[];return null!==G&&void 0!==G&&G.filterTemplates?null===G||void 0===G?void 0:G.filterTemplates(e):e}),[ie,G]),le=(0,r.useMemo)((function(){return k.qy.map((function(e){var n=e.Icon,t=e.label,i=e.selectedBackgroundColor,o=e.selectedIconProps,r=e.uuid,l=(null===G||void 0===G?void 0:G.uuid)===r,u=w({size:y.ZG},l&&o?o:{});return(0,O.jsx)(y.wj,{onClick:function(){return W(e)},selected:l,children:(0,O.jsxs)(p.ZP,{alignItems:"center",children:[(0,O.jsx)(y.ze,{backgroundColor:l&&i?i(R):null,children:n?(0,O.jsx)(n,w({},u)):(0,O.jsx)(j.pd,w({},u))}),(0,O.jsx)(b.ZP,{bold:!0,large:!0,children:t?t():r})]})},r)}))}),[G,R]),ue=(0,r.useMemo)((function(){return k.hS.map((function(e){var n=e.Icon,t=e.label,i=e.selectedBackgroundColor,o=e.selectedIconProps,r=e.uuid,l=(null===G||void 0===G?void 0:G.uuid)===r,u=w({size:y.ZG},l&&o?o:{});return(0,O.jsx)(y.wj,{onClick:function(){return W(e)},selected:l,children:(0,O.jsxs)(p.ZP,{alignItems:"center",children:[(0,O.jsx)(y.ze,{backgroundColor:l&&i?i(R):null,children:n?(0,O.jsx)(n,w({},u)):(0,O.jsx)(j.pd,w({},u))}),(0,O.jsx)(b.ZP,{bold:!0,large:!0,children:t?t():r})]})},r)}))}),[G,R]),ce=(0,r.useMemo)((function(){return null===ne||void 0===ne?void 0:ne.map((function(e){var n=e.description,t=e.name,o=e.tags,r=e.template_uuid,l=e.user,u=[];return null!==o&&void 0!==o&&o.length?u.push.apply(u,(0,i.Z)(o)):null!==l&&void 0!==l&&l.username&&u.push(null===l||void 0===l?void 0:l.username),(0,O.jsxs)(y.UE,{onClick:function(){S?S(e):D.push("/templates/[...slug]","/templates/".concat(encodeURIComponent(r)))},children:[(0,O.jsx)(y.Tj,{children:(0,O.jsx)(b.ZP,{bold:!0,monospace:!0,textOverflow:!0,children:t||r})}),(0,O.jsx)(y.SL,{children:(0,O.jsx)(b.ZP,{default:!!n,italic:!n,muted:!n,textOverflowLines:2,children:n||"No description"})}),(0,O.jsx)(y.EN,{children:(null===u||void 0===u?void 0:u.length)>=1&&(0,O.jsx)(m.Z,{tags:null===u||void 0===u?void 0:u.map((function(e){return{uuid:e}}))})})]},r)}))}),[ne,S,D]),ae=(0,r.useMemo)((function(){return null===re||void 0===re?void 0:re.map((function(e){var n=e.description,t=e.name,o=e.tags,r=e.template_uuid,l=e.user,u=[];return null!==o&&void 0!==o&&o.length?u.push.apply(u,(0,i.Z)(o)):null!==l&&void 0!==l&&l.username&&u.push(null===l||void 0===l?void 0:l.username),(0,O.jsxs)(y.UE,{onClick:function(){S?S(e):D.push("/templates/[...slug]","/templates/".concat(encodeURIComponent(r),"?object_type=").concat(d.R))},children:[(0,O.jsx)(y.Tj,{children:(0,O.jsx)(b.ZP,{bold:!0,monospace:!0,textOverflow:!0,children:t||r})}),(0,O.jsx)(y.SL,{children:(0,O.jsx)(b.ZP,{default:!!n,italic:!n,muted:!n,textOverflowLines:2,children:n||"No description"})}),(0,O.jsx)(y.EN,{children:(null===u||void 0===u?void 0:u.length)>=1&&(0,O.jsx)(m.Z,{tags:null===u||void 0===u?void 0:u.map((function(e){return{uuid:e}}))})})]},r)}))}),[re,S,D]),se=(0,r.useMemo)((function(){if(!T)return null;var e=[];return U?e.push.apply(e,[{label:function(){return"Templates"},onClick:function(){H(!1)}},{bold:!0,label:function(){return"New custom template"}}]):e.push({label:function(){return"Templates"}}),(0,O.jsx)(y.FX,{children:(0,O.jsx)(c.Z,{breadcrumbs:e})})}),[U,T]),de=(0,r.useMemo)((function(){return T?36:0}),[T]),pe=(0,r.useMemo)((function(){return B-de}),[B,de]);if(U)return n=d.R===_&&E?(0,O.jsx)(f.Z,{onMutateSuccess:oe,pipelineUUID:E,templateAttributes:G&&(null===G||void 0===G?void 0:G.uuid)!==(null===k.qy||void 0===k.qy?void 0:k.qy[0].uuid)?{pipeline_type:null===G||void 0===G?void 0:G.uuid}:null,templateUUID:null===Q||void 0===Q?void 0:Q.template_uuid}):(0,O.jsx)(g.Z,{contained:t,heightOffset:de,onCreateCustomTemplate:t?function(e){X(e)}:null,onMutateSuccess:ee,templateAttributes:G&&(null===G||void 0===G?void 0:G.uuid)!==(null===k.qy||void 0===k.qy?void 0:k.qy[0].uuid)?{block_type:null===G||void 0===G?void 0:G.uuid}:null,templateUUID:null===Q||void 0===Q?void 0:Q.template_uuid}),t?(0,O.jsxs)(O.Fragment,{children:[T&&se,(0,O.jsx)(y.Rd,{height:pe,width:N,children:n})]}):n;var fe=(0,O.jsxs)(y.Nk,{children:[(0,O.jsxs)(y.bC,{height:t?pe:null,children:[(0,O.jsx)(y.Yf,{children:(0,O.jsx)(s.Z,{noPadding:!0,onClickTab:function(e){t?q(e):(0,Z.u7)({object_type:k.A2.uuid===e.uuid?d.R:d.Z})},selectedTabUUID:null===V||void 0===V?void 0:V.uuid,tabs:L})}),(0,O.jsxs)(y.wl,{contained:t,heightOffset:de,children:[k.n9.uuid===(null===V||void 0===V?void 0:V.uuid)&&le,k.A2.uuid===(null===V||void 0===V?void 0:V.uuid)&&ue]})]}),(0,O.jsxs)(y.w5,{children:[k.n9.uuid===(null===V||void 0===V?void 0:V.uuid)&&(0,O.jsx)(y.HS,{children:(0,O.jsx)(a.ZP,{beforeIcon:(0,O.jsx)(j.mm,{size:y.ZG}),onClick:function(){H(!0)},primary:!0,children:"New block template"})}),k.n9.uuid===(null===V||void 0===V?void 0:V.uuid)&&(0,O.jsxs)(O.Fragment,{children:[!$&&(0,O.jsx)(v.Z,{p:2,children:(0,O.jsx)(h.Z,{inverted:!0})}),$&&!(null!==ce&&void 0!==ce&&ce.length)&&(0,O.jsxs)(v.Z,{p:2,children:[(0,O.jsx)(b.ZP,{children:"There are currently no templates matching your search."}),(0,O.jsx)("br",{}),(0,O.jsx)(b.ZP,{children:"Add a new template by clicking the button above."})]}),(null===ce||void 0===ce?void 0:ce.length)>=1&&(0,O.jsx)(y.n8,{children:ce})]}),k.A2.uuid===(null===V||void 0===V?void 0:V.uuid)&&(0,O.jsxs)(O.Fragment,{children:[!ie&&(0,O.jsx)(v.Z,{p:2,children:(0,O.jsx)(h.Z,{inverted:!0})}),ie&&!(null!==ae&&void 0!==ae&&ae.length)&&(0,O.jsxs)(v.Z,{p:2,children:[(0,O.jsx)(b.ZP,{children:"There are currently no templates matching your search."}),(0,O.jsx)("br",{}),(0,O.jsx)(b.ZP,{children:'Add a new template by right-clicking a pipeline row from the Pipelines page and selecting "Create template".'})]}),(null===ae||void 0===ae?void 0:ae.length)>=1&&(0,O.jsx)(y.n8,{children:ae})]})]})]});return t?(0,O.jsxs)(O.Fragment,{children:[T&&se,(0,O.jsx)(y.Rd,{height:pe,width:N,children:fe})]}):fe}},29618:function(e,n,t){"use strict";t.d(n,{Z:function(){return B}});var i=t(82394),o=t(75582),r=t(17717),l=t(82684),u=t(80329),c=t(69864),a=t(40761),s=t(44425),d=t(71180),p=t(38626),f=t(97618),v=t(55485),h=t(28598),m=p.default.div.withConfig({displayName:"ButtonGroup__ButtonGroupStyle",componentId:"sc-15vbmc8-0"})([""]),g=p.default.div.withConfig({displayName:"ButtonGroup__VerticalDivider",componentId:"sc-15vbmc8-1"})(["width:1px;"]),b=function(e){var n=e.children,t=e.divider,i=l.Children.toArray(n).length;return(0,h.jsx)(m,{children:(0,h.jsx)(v.ZP,{children:l.Children.map(n,(function(e,n){return e&&(0,h.jsxs)(f.Z,{children:[n>=1&&t&&(0,h.jsx)(g,{}),l.cloneElement(e,{borderRadiusLeft:i>=2&&0===n,borderRadiusRight:i>=2&&n===i-1,halfPaddingLeft:i>=2&&0!==n,halfPaddingRight:i>=2&&n!==i-1,noBorder:i>=2&&n>0&&n<i-1,noBorderRight:i>=2&&n!==i-1})]},"button-group-child-".concat(n))}))})})},x=t(75810),j=t(89706),y=t(93369),k=t(57653),Z=t(38276),P=t(35686),O=t(39643),C=t(11498),w=t(85385),_=t(68669),S=t(86735),E=t(53005),I=t(81728),T=t(72619),M=t(42041),D=t(44688);function R(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?R(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):R(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var B=function(e){var n=e.active,t=e.addNewBlock,p=e.disableRefreshWarning,f=e.fetchPipeline,m=e.fetchVariables,g=e.filePath,R=e.hideHeaderButtons,B=e.onContentChange,N=e.onUpdateFileSuccess,L=e.openSidekickView,F=e.pipeline,U=e.saveFile,H=e.selectedFilePath,z=e.sendTerminalMessage,G=e.setDisableShortcuts,W=e.setErrors,K=e.setFilesTouched,V=e.setSelectedBlock,q=(0,u.j)("apiReloads"),Y=(0,o.Z)(q,2)[1],Q=(0,l.useState)(null),X=Q[0],J=Q[1],$=(0,l.useState)(!1),ee=$[0],ne=($[1],(0,l.useRef)(null)),te=(0,l.useMemo)((function(){return new a.Z}),[]),ie=(0,l.useMemo)((function(){return{api_key:C.l,token:te.decodedToken.token}}),[te]),oe=P.ZP.statuses.list().data,re=(0,l.useMemo)((function(){var e,n;return null===oe||void 0===oe||null===(e=oe.statuses)||void 0===e||null===(n=e[0])||void 0===n?void 0:n.repo_path}),[oe]),le=P.ZP.file_contents.detail(g).data;(0,l.useEffect)((function(){null!==le&&void 0!==le&&le.file_content?J(le.file_content):null!==le&&void 0!==le&&le.error&&(0,T.h$)(le,{onErrorCallback:function(e,n){return W({errors:n,response:e})}})}),[le,W]);var ue=(0,l.useState)(null===X||void 0===X?void 0:X.content),ce=ue[0],ae=ue[1],se=(0,l.useCallback)((function(e){ae(e),B&&(null===B||void 0===B||B(e))}),[B]),de=(0,l.useState)(!1),pe=de[0],fe=de[1];(0,l.useEffect)((function(){n&&G&&(null===G||void 0===G||G(!0))}),[n,G]),(0,l.useEffect)((function(){var e;H&&(null===ne||void 0===ne||null===(e=ne.current)||void 0===e||e.scrollIntoView())}),[H]);var ve=(0,c.Db)(P.ZP.file_contents.useUpdate((null===X||void 0===X?void 0:X.path)&&encodeURIComponent(null===X||void 0===X?void 0:X.path)),{onSuccess:function(e){return(0,T.wD)(e,{callback:function(e){var n=e.file_content;Y((function(e){return A(A({},e),{},(0,i.Z)({},"FileVersions/".concat(null===X||void 0===X?void 0:X.path),Number(new Date)))})),N&&(null===N||void 0===N||N(n))},onErrorCallback:function(e,n){return null===W||void 0===W?void 0:W({errors:n,response:e})}})}}),he=(0,o.Z)(ve,1)[0],me=(0,l.useCallback)((function(e,n){if(U)return U(e,n);he({file_content:A(A({},n),{},{content:e})}).then((function(){decodeURIComponent(g).split(r.sep).pop()===j.dT.METADATA_YAML&&m&&(null===m||void 0===m||m())})),K((function(e){return A(A({},e),{},(0,i.Z)({},null===n||void 0===n?void 0:n.path,!1))})),fe(!1)}),[m,g,U,K,he]),ge=(0,l.useMemo)((function(){return(0,_.lU)()}),[]),be=(0,l.useMemo)((function(){var e,n,t,i;return null===(null===X||void 0===X||null===(e=X.path)||void 0===e?void 0:e.match(ge))?j.Lu.TXT:null===X||void 0===X||null===(n=X.path)||void 0===n||null===(t=n.match(ge))||void 0===t||null===(i=t[0])||void 0===i?void 0:i.split(".")[1]}),[ge,X]),xe=(0,l.useMemo)((function(){if(null!==X&&void 0!==X&&X.path)return(0,h.jsx)(x.Z,{autoHeight:!0,language:j.nB[be],onChange:function(e){se(e),K((function(e){return A(A({},e),{},(0,i.Z)({},null===X||void 0===X?void 0:X.path,!0))})),fe(!0)},onSave:function(e){me(e,X)},padding:10,selected:!0,textareaFocused:!0,value:(0,I.Pb)(null===X||void 0===X?void 0:X.content)?JSON.stringify(JSON.parse(null===X||void 0===X?void 0:X.content),null,2):null===X||void 0===X?void 0:X.content,width:"100%"})}),[X,be,me,se,K]),je=null!==F&&void 0!==F&&F.blocks?(0,S.sE)(null===F||void 0===F?void 0:F.blocks,(function(e){var n=e.type;return s.tf.DATA_EXPORTER===n})):null,ye=(0,c.Db)(P.ZP.blocks.pipelines.useUpdate(null===F||void 0===F?void 0:F.uuid,null===je||void 0===je?void 0:je.uuid),{onSuccess:function(e){return(0,T.wD)(e,{callback:function(){null===f||void 0===f||f()}})}}),ke=(0,o.Z)(ye,1)[0],Ze=t&&F&&(be===j.Lu.PY||be===j.Lu.SQL||(be===j.Lu.YAML||be===j.Lu.R)&&(0,E.V3)(X,null===X||void 0===X?void 0:X.path))&&(0,_.ck)(X.path.split(r.sep))!==s.tf.SCRATCHPAD&&(0,E.lr)(X)&&(0,h.jsx)(d.ZP,{onClick:function(){var e=(null===F||void 0===F?void 0:F.type)===k.qL.INTEGRATION,n=(0,_.TU)(X,re,F);t(n,(function(n){e&&je&&ke({block:A(A({},je),{},{upstream_blocks:[n.uuid]})}),null===V||void 0===V||V(n)}))},primary:!0,children:"Add to current pipeline"}),Pe=z&&(0,h.jsx)(Z.Z,{m:2,children:(0,h.jsx)(y.ZP,{disabled:!re,inline:!0,loading:ee,onClick:function(){null===L||void 0===L||L(w.cH.TERMINAL),null===z||void 0===z||z(JSON.stringify(A(A({},ie),{},{command:["stdin","pip install -r ".concat(re,"/requirements.txt\r")]})))},title:re?"Pip install packages from your saved requirements.txt file (\u2318+S to save).":"Please use right panel terminal to install packages.",uuid:"FileEditor/InstallPackages",children:"Install packages"})}),Oe="FileEditor/".concat(null===X||void 0===X?void 0:X.path),Ce=(0,D.y)(),we=Ce.registerOnKeyDown,_e=Ce.unregisterOnKeyDown;return(0,l.useEffect)((function(){return function(){_e(Oe)}}),[_e,Oe]),we(Oe,(function(e,t){if(n&&!p)if((0,M.y)([O.zX,O.Um],t)||(0,M.y)([O.PQ,O.Um],t))e.preventDefault(),me(ce,X);else if(pe&&(0,M.y)([O.zX,O.hS],t)){e.preventDefault();var i="".concat(X.path," has changes that are unsaved. ")+"Click cancel and save your changes before reloading page.";"undefined"!==typeof location&&window.confirm(i)&&location.reload()}}),[n,ce,p,X,me,pe]),(0,h.jsxs)("div",{ref:ne,children:[!R&&(0,h.jsx)(Z.Z,{p:2,children:(0,h.jsxs)(v.ZP,{justifyContent:"space-between",children:[(0,h.jsxs)(b,{children:[Ze,(0,h.jsx)(d.ZP,{disabled:!ce,onClick:function(e){e.preventDefault(),me(ce,X)},title:ce?null:"No changes have been made to this file.",children:"Save file content"})]}),L&&(0,h.jsx)(b,{children:(0,h.jsx)(d.ZP,{compact:!0,onClick:function(){L(w.cH.FILE_VERSIONS)},small:!0,title:"View previous changes to this file.",children:"Show versions"})})]})}),xe,g===j.dT.REQS_TXT&&Pe]})}},53779:function(e,n,t){"use strict";t.d(n,{C:function(){return v},X$:function(){return f},eD:function(){return d},iW:function(){return h},nF:function(){return m}});var i=t(38626),o=t(44897),r=t(42631),l=t(70515),u=t(47041),c=t(91437),a=6.25*l.iI,s=(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_,s,(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;",""],a,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*a,"px);\n ")})),h=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 ")})),m=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 ")}))},28385:function(e,n,t){"use strict";var i=t(82394),o=t(75582),r=t(17717),l=t(82684),u=t(80329),c=t(69864),a=t(71180),s=t(75810),d=t(89706),p=t(97618),f=t(55485),v=t(85854),h=t(38276),m=t(4190),g=t(75499),b=t(30160),x=t(35686),j=t(70515),y=t(68669),k=t(3917),Z=t(81728),P=t(72619),O=t(3314),C=t(86735),w=t(28598);function _(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?_(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):_(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n=e.onActionCallback,t=e.pipeline,_=e.selectedBlock,E=e.selectedFilePath,I=e.setErrors,T=e.width,M=(0,u.j)("apiReloads"),D=(0,o.Z)(M,2)[1],R=(0,l.useMemo)((function(){return E?encodeURIComponent(E):_?encodeURIComponent("".concat(null===_||void 0===_?void 0:_.type,"/").concat(null===_||void 0===_?void 0:_.uuid)):null}),[_,E]),A=x.ZP.file_versions.files.list(R,{block_uuid:null===_||void 0===_?void 0:_.uuid,pipeline_uuid:null===t||void 0===t?void 0:t.uuid}),B=A.data,N=A.mutate,L=(0,l.useMemo)((function(){return(null===B||void 0===B?void 0:B.file_versions)||[]}),[B]),F=(0,l.useState)(null),U=F[0],H=F[1],z=(0,l.useMemo)((function(){return null===L||void 0===L?void 0:L[U]}),[U,L]),G=x.ZP.file_contents.detail(z?encodeURIComponent(z.path):null).data,W=(0,l.useMemo)((function(){return null===G||void 0===G?void 0:G.file_content}),[G]),K=(0,l.useMemo)((function(){return(0,y.lU)()}),[]),V=(0,l.useMemo)((function(){var e,n,t;return null===E||void 0===E||null===(e=E.match(K))||void 0===e||null===(n=e[0])||void 0===n||null===(t=n.split("."))||void 0===t?void 0:t[1]}),[E,K]),q=(0,c.Db)(x.ZP.file_contents.useUpdate(R),{onSuccess:function(e){return(0,P.wD)(e,{callback:function(e){var t;E&&N();var o=null===e||void 0===e||null===(t=e.file_content)||void 0===t?void 0:t.path,l="FileEditor/".concat(o);if(o){var u=o.split(r.sep);if("pipelines"===u[0]){var c=u.slice(1,u.length-1).join(r.sep);l="PipelineDetail/".concat(c)}}D((function(e){return S(S({},e),{},(0,i.Z)({},l,Number(new Date)))})),H((function(e){return e+1})),null===n||void 0===n||n(null===e||void 0===e?void 0:e.file_content,{blockUUID:null===_||void 0===_?void 0:_.uuid})},onErrorCallback:function(e,n){return I({errors:n,response:e})}})}}),Y=(0,o.Z)(q,2),Q=Y[0],X=Y[1].isLoading,J=(0,l.useCallback)((function(e){var n=S({},e);return E||(n.block_uuid=null===_||void 0===_?void 0:_.uuid,n.pipeline_uuid=null===t||void 0===t?void 0:t.uuid),Q({file_content:n})}),[t,_,E,Q]),$=(0,l.useMemo)((function(){var e=L.map((function(e){var n=e.name,t=e.path;return[(0,w.jsxs)(f.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,w.jsxs)(p.Z,{flex:1,children:[(0,w.jsx)(b.ZP,{default:!0,monospace:!0,children:(0,k.JX)(n,{withSeconds:!0})}),(0,w.jsx)(h.Z,{px:2*j.cd,children:(0,w.jsx)(b.ZP,{monospace:!0,children:n})})]}),z&&(null===z||void 0===z?void 0:z.path)===t&&(0,w.jsx)(a.ZP,{compact:!0,loading:X,onClick:function(e){(0,O.j)(e),J({version:n})},small:!0,children:"Replace with this version"})]},n)]}));if(z){var n=(0,w.jsx)(h.Z,{p:j.cd,children:(0,w.jsx)(m.Z,{},"spinner")});if(W&&(null===W||void 0===W?void 0:W.path)===(null===z||void 0===z?void 0:z.path)){var t=W.content,i=void 0===t?"":t;n=(0,w.jsx)(s.Z,{autoHeight:!0,language:d.nB[V],padding:2*j.iI,readOnly:!0,value:(0,Z.Pb)(i)?JSON.stringify(JSON.parse(i),null,2):i,width:T})}e=(0,C.Hk)([n],U+1,e)}return e}),[W,V,L,X,z,U,J,T]);return(0,w.jsxs)("div",{style:{width:T},children:[(0,w.jsxs)(h.Z,{p:j.cd,children:[(0,w.jsx)(v.Z,{level:5,children:"File versions"}),(0,w.jsx)(b.ZP,{inline:!0,monospace:!0,children:E?decodeURIComponent(E):null===_||void 0===_?void 0:_.uuid})]}),(0,w.jsx)(g.Z,{buildRowProps:function(e){if(z&&U+1===e)return{renderCell:function(e){return e},renderRow:function(e){return e}}},columnFlex:[1],columns:[{uuid:"Version"}],isSelectedRow:function(e){var n;return(null===(n=L[e])||void 0===n?void 0:n.name)===(null===z||void 0===z?void 0:z.name)},onClickRow:function(e){z?e===U?H(null):e<U?H(e):e>U+1&&H(e-1):H(e)},rows:$})]})}},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),a=t(28598);function s(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function d(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?s(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):s(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n=e.objectAttributes,t=e.originalAttributes,s=e.setObjectAttributes;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(o.Z,{mb:1,px:c.cd,children:[(0,a.jsx)(l.ZP,{bold:!0,children:"Outdated after"}),(0,a.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,a.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,a.jsxs)(l.ZP,{default:!0,monospace:!0,children:[c," ",f&&(0,a.jsxs)(l.ZP,{inline:!0,monospace:!0,muted:!0,children:["(default: ",f,")"]})]},"label-".concat(c)),(0,a.jsx)(u.Z,{compact:!0,monospace:!0,onChange:function(e){return s((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),a=t(70515),s=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:a.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,a,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 a=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,s.vg)(d)," ",g&&(0,p.jsxs)(u.ZP,{inline:!0,monospace:!0,muted:!0,children:["(default: ",g,")"]})]},"outdated-starting-at-label-".concat(d)),a]}))})]})}},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),a=t(75499),s=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)(s.ZP,{bold:!0,children:"Block data to output"}),(0,f.jsx)(s.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)(s.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)(a.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,a=null===t||void 0===t?void 0:t.settings,p=null===a||void 0===a?void 0:a[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)(s.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),a=t(38276),s=t(4190),d=t(75499),p=t(30160),f=t(35686),v=t(70515),h=t(3314),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)(a.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)(a.Z,{p:v.cd,children:(0,m.jsx)(s.Z,{})})}},29480:function(e,n,t){"use strict";t.d(n,{$W:function(){return s},cl:function(){return d},cv:function(){return p},dE:function(){return c},zG:function(){return a}});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 ")})),a=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;}"]),s=i.default.div.withConfig({displayName:"indexstyle__CodeEditorStyle",componentId:"sc-7a1uhf-2"})(["padding-top:","px;",""],l.cd*l.iI,(function(e){return"\n background-color: ".concat((e.theme.background||o.Z.background).codeTextarea,";\n ")})),d=i.default.div.withConfig({displayName:"indexstyle__TableContainerStyle",componentId:"sc-7a1uhf-3"})(["overflow:auto;max-height:90vh;width:100%;"," "," "," "," ",""],u.w5,(function(e){return e.hideHorizontalScrollbar&&"\n overflow-x: hidden;\n "}),(function(e){return e.width&&"\n width: ".concat(e.width,";\n ")}),(function(e){return e.height&&"\n height: ".concat(e.height,";\n ")}),(function(e){return e.maxHeight&&"\n max-height: ".concat(e.maxHeight,";\n ")})),p=i.default.div.withConfig({displayName:"indexstyle__HeaderRowStyle",componentId:"sc-7a1uhf-4"})(["padding:","px;"," "," ",""],2*l.iI,(function(e){return"\n background-color: ".concat((e.theme||o.Z).interactive.defaultBackground,";\n border-bottom: ").concat(r.YF,"px ").concat(r.M8," ").concat((e.theme||o.Z).borders.medium,";\n ")}),(function(e){return e.padding&&"\n padding: ".concat(e.padding,"px;\n ")}),(function(e){return e.rounded&&"\n border-top-left-radius: ".concat(r.n_,"px;\n border-top-right-radius: ").concat(r.n_,"px;\n ")}))},4015:function(e,n,t){"use strict";t.d(n,{$b:function(){return s},I5:function(){return c},Nk:function(){return u},gI:function(){return a}});var i=t(38626),o=t(44897),r=t(42631),l=t(70515),u=i.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-h093u4-0"})([""," ",""],(function(e){return!e.width&&"\n width: ".concat(40*l.iI,"px;\n ")}),(function(e){return e.width&&"\n width: ".concat(e.width,"px;\n ")})),c=i.default.div.withConfig({displayName:"indexstyle__HeaderStyle",componentId:"sc-h093u4-1"})(["padding:","px;",""],2.5*l.iI,(function(e){return"\n background-color: ".concat((e.theme.background||o.Z.background).dashboard,";\n border-left: 1px solid ").concat((e.theme.interactive||o.Z.interactive).defaultBorder,";\n border-right: 1px solid ").concat((e.theme.interactive||o.Z.interactive).defaultBorder,";\n border-top-left-radius: ").concat(r.n_,"px;\n border-top-right-radius: ").concat(r.n_,"px;\n border-top: 1px solid ").concat((e.theme.interactive||o.Z.interactive).defaultBorder,";\n ")})),a=i.default.div.withConfig({displayName:"indexstyle__RowStyle",componentId:"sc-h093u4-2"})(["align-items:center;justify-content:space-between;",""],(function(e){return"\n background-color: ".concat((e.theme.background||o.Z.background).dashboard,";\n border-left: 1px solid ").concat((e.theme.interactive||o.Z.interactive).defaultBorder,";\n border-right: 1px solid ").concat((e.theme.interactive||o.Z.interactive).defaultBorder,";\n border-top: 1px solid ").concat((e.theme.interactive||o.Z.interactive).defaultBorder,";\n display: ").concat((null===e||void 0===e?void 0:e.display)||"flex",";\n padding-bottom: ").concat(1*l.iI+((null===e||void 0===e?void 0:e.paddingVerticalAddition)||0),"px;\n padding-left: ").concat(l.cd*l.iI,"px;\n padding-top: ").concat(1*l.iI+((null===e||void 0===e?void 0:e.paddingVerticalAddition)||0),"px;\n ")})),s=i.default.div.withConfig({displayName:"indexstyle__FooterStyle",componentId:"sc-h093u4-3"})(["padding:","px ","px;",""],2.5*l.iI,2*l.iI,(function(e){return"\n background-color: ".concat((e.theme.background||o.Z.background).panel,";\n border-bottom-left-radius: ").concat(r.n_,"px;\n border-bottom-right-radius: ").concat(r.n_,"px;\n border-bottom: 1px solid ").concat((e.theme.interactive||o.Z.interactive).defaultBorder,";\n border-left: 1px solid ").concat((e.theme.interactive||o.Z.interactive).defaultBorder,";\n border-right: 1px solid ").concat((e.theme.interactive||o.Z.interactive).defaultBorder,";\n ")}))},90758:function(e,n,t){"use strict";t.d(n,{Z:function(){return O}});var i=t(82394),o=t(26304),r=t(82684),l=t(38626),u=t(39867),c=t(55485),a=t(48670),s=t(38276),d=t(30160),p=t(12468),f=t(44897),v=t(72473),h=t(97133),m=t(70515),g=t(15610),b=t(3314),x=t(28598);var j=function(e){var n=e.filePath,t=e.filesTouched,i=void 0===t?{}:t,o=e.isLast,l=e.onClickTab,j=e.onClickTabClose,y=e.renderTabTitle,k=e.savePipelineContent,Z=e.selected,P=e.themeContext,O=(0,r.useState)(!1),C=O[0],w=O[1];return(0,x.jsx)(c.ZP,{flexDirection:"column",fullHeight:!0,onClick:function(e){e.preventDefault(),Z||(l?l(n):(null===k||void 0===k||k(),(0,g.u7)({file_path:encodeURIComponent(n)})))},onMouseEnter:function(){return w(!0)},onMouseLeave:function(){return w(!1)},children:(0,x.jsx)(h.Gb,{last:o,selected:Z,children:(0,x.jsxs)(c.ZP,{alignItems:"center",fullHeight:!0,children:[(0,x.jsx)(p.Z,{appearAbove:!0,appearBefore:!0,label:n,size:null,widthFitContent:!0,children:(0,x.jsxs)(c.ZP,{alignItems:"center",fullHeight:!0,children:[!i[n]&&(0,x.jsx)(v.iU,{muted:!Z,size:1.5*m.iI}),i[n]&&(0,x.jsx)(p.Z,{label:"Unsaved changes",size:null,widthFitContent:!0,children:(0,x.jsx)("div",{style:{padding:1},children:(0,x.jsx)(u.Z,{borderColor:(P||f.Z).borders.danger,size:1.25*m.iI})})}),(0,x.jsx)(s.Z,{mr:1}),(0,x.jsx)(d.ZP,{muted:!Z,children:y?y(n):n})]})}),(0,x.jsx)(s.Z,{mr:2}),(0,x.jsx)(p.Z,{label:"Close",size:null,widthFitContent:!0,children:(0,x.jsxs)(a.Z,{autoHeight:!0,block:!0,noHoverUnderline:!0,noOutline:!0,onClick:function(e){(0,b.j)(e),null===j||void 0===j||j(n)},preventDefault:!0,children:[(C||Z)&&(0,x.jsx)(v.x8,{muted:!Z,size:1.25*m.iI}),!C&&!Z&&(0,x.jsx)("div",{style:{width:1.25*m.iI}})]})})]})})})},y=t(86735),k=["filePaths","isSelectedFilePath","onClickTabClose","selectedFilePath"];function Z(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 P(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Z(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Z(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var O=function(e){var n=e.filePaths,t=e.isSelectedFilePath,i=e.onClickTabClose,u=e.selectedFilePath,a=(0,o.Z)(e,k),s=(0,r.useContext)(l.ThemeContext),d=(0,r.useMemo)((function(){return n.map((function(e){return decodeURIComponent(e)}))}),[n]),p=(0,r.useMemo)((function(){return null===d||void 0===d?void 0:d.length}),[d]);return(0,x.jsx)(c.ZP,{alignItems:"center",justifyContent:"flex-start",children:null===d||void 0===d?void 0:d.map((function(e,n){var o=t?t(e,u):u===encodeURIComponent(e);return(0,r.createElement)(j,P(P({},a),{},{filePath:e,isLast:n===p-1,key:e,onClickTabClose:function(e){if(i)i(e);else{var n=(0,y.Od)(d,(function(n){return n===e})).map((function(e){return encodeURIComponent(e)}));(0,g.u7)({file_path:n[n.length-1]||null,"file_paths[]":n},{pushHistory:!0})}},selected:o,themeContext:s}))}))})}},97133:function(e,n,t){"use strict";t.d(n,{Gb:function(){return p},fm:function(){return s},lO:function(){return a},rK:function(){return d},zn:function(){return c}});var i=t(38626),o=t(44897),r=t(2842),l=t(70515),u=t(47041),c=300,a=i.default.div.withConfig({displayName:"indexstyle__PipelineContainerStyle",componentId:"sc-1sv9513-0"})([".pipeline-detail-enter-active{opacity:1;transition:opacity ","ms linear;}.pipeline-detail-enter-done{opacity:0;transition:opacity ","ms linear;}"],c,c),s=i.default.div.withConfig({displayName:"indexstyle__OverlayStyle",componentId:"sc-1sv9513-1"})(["height:100vh;opacity:1;position:fixed;width:100vw;z-index:9999;",""],(function(e){return"\n background-color: ".concat((e.theme.background||o.Z.background).codeArea,";\n ")})),d=i.default.div.withConfig({displayName:"indexstyle__PipelineHeaderStyle",componentId:"sc-1sv9513-2"})(["height:","px;position:sticky;top:","px;width:100%;z-index:5;"," "," "," ",""],r.Wi,r.Wi,(function(e){return"\n background-color: ".concat((e.theme.background||o.Z.background).panel,";\n border-bottom: 1px solid ").concat((e.theme.borders||o.Z.borders).medium,";\n ")}),(function(e){return e.relativePosition&&"\n position: relative;\n "}),(function(e){return e.secondary&&"\n height: ".concat(37,"px;\n top: ").concat(r.Wi,"px;\n overflow-x: auto;\n z-index: 3;\n ")}),(0,u.y$)()),p=i.default.div.withConfig({displayName:"indexstyle__FileTabStyle",componentId:"sc-1sv9513-3"})(["border-right:1px solid transparent;height:100%;padding:","px ","px;"," "," ",""],l.iI,l.cd*l.iI,(function(e){return"\n &:hover {\n cursor: default;\n\n p {\n color: ".concat((e.theme.content||o.Z.content).active," !important;\n cursor: default;\n }\n }\n ")}),(function(e){return e.selected&&"\n background-color: ".concat((e.theme.interactive||o.Z.interactive).hoverBackground,";\n ")}),(function(e){return!e.selected&&!e.last&&"\n border-color: ".concat((e.theme.borders||o.Z.borders).light," !important;\n ")}));i.default.div.withConfig({displayName:"indexstyle__HeaderViewOptionsStyle",componentId:"sc-1sv9513-4"})(["left:50%;position:absolute;transform:translateX(-50%);"])},28795:function(e,n,t){"use strict";var i;t.d(n,{B:function(){return o},M:function(){return i}}),function(e){e.BACKFILLS="backfills",e.BLOCK_RUNS="block_runs",e.DASHBOARD="dashboard",e.EDIT="edit",e.MONITOR="monitor",e.PIPELINE_LOGS="pipeline_logs",e.PIPELINE_RUNS="pipeline_runs",e.RUNS="runs",e.SETTINGS="settings",e.SYNCS="syncs",e.TRIGGERS="triggers"}(i||(i={}));var o="cancel_all_running_pipeline_runs"},85010:function(e,n,t){"use strict";t.d(n,{H:function(){return u}});var i=t(57653),o=t(72473),r=t(28795),l=t(50178);function u(e,n,t){var u=(n||{}).uuid||t,c=[{Icon:o.Bf,id:r.M.TRIGGERS,isSelected:function(){return r.M.TRIGGERS===e},label:function(){return"Triggers"},linkProps:{as:"/pipelines/".concat(u,"/triggers"),href:"/pipelines/[pipeline]/triggers"}},{Icon:o.Pf,id:r.M.RUNS,isSelected:function(){return r.M.RUNS===e},label:function(){return"Runs"},linkProps:{as:"/pipelines/".concat(u,"/runs"),href:"/pipelines/[pipeline]/runs"}},{Icon:o.UL,id:r.M.PIPELINE_LOGS,isSelected:function(){return r.M.PIPELINE_LOGS===e},label:function(){return"Logs"},linkProps:{as:"/pipelines/".concat(u,"/logs"),href:"/pipelines/[pipeline]/logs"}},{Icon:o.ug,id:r.M.MONITOR,isSelected:function(){return r.M.MONITOR===e},label:function(){return"Monitor"},linkProps:{as:"/pipelines/".concat(u,"/monitors"),href:"/pipelines/[pipeline]/monitors"}}];return i.qL.PYTHON===(null===n||void 0===n?void 0:n.type)&&c.splice(2,0,{Icon:o.dE,id:r.M.BACKFILLS,isSelected:function(){return r.M.BACKFILLS===e},label:function(){return"Backfills"},linkProps:{as:"/pipelines/".concat(u,"/backfills"),href:"/pipelines/[pipeline]/backfills"}}),i.qL.INTEGRATION===(null===n||void 0===n?void 0:n.type)&&c.unshift({Icon:o.Nt,id:r.M.SYNCS,isSelected:function(){return r.M.SYNCS===e},label:function(){return"Syncs"},linkProps:{as:"/pipelines/".concat(u,"/syncs"),href:"/pipelines/[pipeline]/syncs"}}),(0,l.Ct)()||(c.unshift({Icon:o.EK,disabled:!u,id:r.M.EDIT,isSelected:function(){return r.M.EDIT===e},label:function(){return"Edit pipeline"},linkProps:{as:"/pipelines/".concat(u,"/edit"),href:"/pipelines/[pipeline]/edit"}}),c.push({Icon:o.Zr,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 a},t0:function(){return s}});var i=t(38626),o=t(2842),r=t(17679),l=t(61896),u=t(47041),c=t(70515),a=(c.iI,r.O$+3*c.iI+l.dN),s=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 a},JZ:function(){return p},Tt:function(){return d},e7:function(){return f},wx:function(){return s}});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 a(e){return"string"===typeof e?e:JSON.stringify(e)}function s(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:a(n)})}))}function d(e){var n;return null===(n=s(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(a){}return c(c({},e),{},(0,o.Z)({},r,u))}),{}):e}},48381:function(e,n,t){"use strict";var i=t(82684),o=t(31882),r=t(55485),l=t(30160),u=t(86735),c=t(28598);n.Z=function(e){var n=e.onClickTag,t=e.tags,a=void 0===t?[]:t,s=(0,i.useMemo)((function(){return(null===a||void 0===a?void 0:a.length)||0}),[a]),d=(0,i.useMemo)((function(){return(0,u.YC)(a||[],"uuid")}),[a]);return(0,c.jsx)(r.ZP,{alignItems:"center",flexWrap:"wrap",children:null===d||void 0===d?void 0:d.reduce((function(e,t){return e.push((0,c.jsx)("div",{style:{marginBottom:2,marginRight:s>=2?4:0,marginTop:2},children:(0,c.jsx)(o.Z,{onClick:n?function(){return n(t)}:null,small:!0,children:(0,c.jsx)(l.ZP,{children:t.uuid})})},"tag-".concat(t.uuid))),e}),[])})}},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),a=t(82684),s=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),_=t(61896),S=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 D(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?M(Object(t),!0).forEach((function(n){(0,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 R={bottom:5*S.iI,left:3*S.iI,right:20*S.iI,top:0},A=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,s=e.showTooltip,b=e.tooltipData,S=e.tooltipLeft,T=e.tooltipOpen,M=e.tooltipTop,N=e.width,L=e.xAxisLabel,F=e.xNumTicks,U=e.yLabelFormat,H=e.ySerialize,z=U;z||(z=function(e){return e.length>20?"".concat(e.substring(0,20),"..."):e});var G=o?_.iD:_.J5,W=(0,a.useContext)(g.ThemeContext),K=D(D({},R),l),V=n.slice(Math.max(0,n.length-50)),q=Object.keys(V[0]||[]).filter((function(e){return"x"===e})),Y=(0,k.Z)({domain:q,range:[w.hM]}),Q=(0,Z.Z)({domain:[0,Math.max.apply(Math,(0,u.Z)(V.map(A)))],nice:!0}),X=(0,P.Z)({domain:V.map(B),padding:.35}),J={active:(null===W||void 0===W?void 0:W.content.default)||C.Z.content.default,backgroundPrimary:(null===W||void 0===W?void 0:W.chart.backgroundPrimary)||C.Z.chart.backgroundPrimary,backgroundSecondary:(null===W||void 0===W?void 0:W.chart.backgroundSecondary)||C.Z.chart.backgroundSecondary,muted:(null===W||void 0===W?void 0:W.content.muted)||C.Z.content.muted,primary:(null===W||void 0===W?void 0:W.chart.primary)||C.Z.chart.primary,tooltipBackground:(null===W||void 0===W?void 0:W.background.navigation)||C.Z.background.navigation},$=V.map(H),ee=Math.min(Math.max.apply(Math,(0,u.Z)($.map((function(e){return String(e).length})))),20);6*ee>2*K.right?K.right+=5.5*ee:6*ee>=K.right&&(K.right+=3.75*ee);var ne=N-K.left-K.right,te=t-K.top-K.bottom;K.left+=7*ee,Q.rangeRound([0,ne]),X.rangeRound([te,0]);var ie=V.map(A).length,oe=X($[ie-1]),re=(0,a.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=V[r];"undefined"===typeof l&&(l=V[r-1]),i>oe&&i<te-oe&&s({tooltipData:l,tooltipLeft:t,tooltipTop:i+K.top})}),[V,ie,K.top,s,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-(K.top+K.bottom),onMouseLeave:function(){return i()},onMouseMove:re,onTouchMove:re,onTouchStart:re,rx:14,width:N-K.left,x:K.left,y:0}),(0,I.jsxs)(m.Z,{left:K.left,top:K.top,children:[(0,I.jsx)(v.Z,{color:Y,data:V,height:te,keys:q,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 z(e)},tickLabelProps:function(){return{fill:J.active,fontFamily:E.ry,fontSize:G,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:G,textAnchor:"middle"},numTicks:F,scale:Q,stroke:J.muted,tickLabelProps:function(){return{fill:J.active,fontFamily:E.ry,fontSize:G,textAnchor:"middle"}},tickStroke:J.muted,top:te})]}),b&&(0,I.jsx)("g",{children:(0,I.jsx)(h.Z,{from:{x:K.left,y:M},pointerEvents:"none",stroke:w.Ej,strokeDasharray:"5,2",strokeWidth:1,to:{x:ne+K.left,y:M}})})]}),T&&b&&(0,I.jsx)(x.Z,{left:S,style:D(D({},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&&A(b).toFixed(4)]})})]})}));var L,F,U,H,z=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)(s.Z,{children:function(e){var n=e.width,t=e.height;return(0,I.jsx)(N,D(D({},i),{},{height:t,width:n}))}})})},G=t(97618),W=t(52729),K=t(48670),V=t(87862),q=t(89370),Y=t(86735),Q=(Y.Qj,Y.tS,Y.tS,Y.tS,Y.tS,Y.Qj,Y.Qj,Y.Qj,Y.tS,Y.tS,L={},(0,c.Z)(L,q.RL.EMAIL,"domain_distribution"),(0,c.Z)(L,q.RL.TEXT,"word_distribution"),(0,c.Z)(L,q.RL.LIST,"element_distribution"),(0,c.Z)(L,"default","value_counts"),L),X=[].concat((0,u.Z)(q.P_),[q.RL.TEXT,q.RL.EMAIL,q.RL.LIST]),J=(F={},(0,c.Z)(F,q.RL.EMAIL,"Domain distribution"),(0,c.Z)(F,q.RL.TEXT,"Word distribution"),(0,c.Z)(F,q.RL.LIST,"Element distribution"),(0,c.Z)(F,"default","Distribution of values"),t(31353));!function(e){e.RANGE="range"}(U||(U={})),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,a=e.x,s=e.x_metadata,d=s.label,p=s.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,Y.Sm)(v),b=(0,Y.IN)(v),x=g/Math.max(1,v.length),j=n[d]||l,y=null===j||void 0===j?void 0:j.columnType,k=q.RL.DATETIME===y,Z=[],P=[],O=a.length,C=a.map((function(e,n){var i,o,l,u,c=e.label,a=e.max,s=e.min,d=f[n];if(U.RANGE===p)if(t||(t=a-s),u=q.RL.NUMBER===y&&t<=O)i=Number(s);else if(i=t/2+s,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(s).format(C),l=ne().unix(a).format(w)}else i=(0,te.QV)(i);else i=c;var _=n>=1?f[n-1]:null,S=!1;r&&(S=r({x:e,y:d,yPrevious:_,yValues:v,yValuesAverage:x,yValuesMax:h,yValuesMin:m,yValuesStandardDeviation:b,yValuesSum:g}));var E={hideRange:u,isUnusual:S,x:e,xLabel:i,xLabelMax:l,xLabelMin:o,y:d};return S&&(u?P.push(E):Z.push(E)),E}));return{distribution:{data:C,featureUUID:d},rangedWithUnusualDistribution:(0,Y.YC)(Z,(function(e){var n=e.y;return c(n)}),{ascending:!1}),unusualDistribution:(0,Y.YC)(P,(function(e){var n=e.y;return c(n)}),{ascending:!1})}}var oe=t(40489);var re=12*S.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,a=e.statistics;return function(e,u,s){var d=s.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]===q.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)(W.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,Y.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===a||void 0===a?void 0:a["".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}})),_=q.RL.TRUE_OR_FALSE===f;if(q.RL.DATETIME===f)j=x[p];else if(Z&&!_)j=(0,I.jsx)(W.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,Y.YC)(e,"[2]")},width:d-2*S.iI});else if(X.includes(f)){var E=(0,Y.YC)((0,Y.YC)(w,"x",{ascending:!1}).slice(0,5),"x");j=(0,I.jsx)(z,{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 _&&C&&(j=(0,I.jsx)(V.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:S.iI},children:[(0,I.jsxs)("div",{style:{alignItems:"center",display:"flex",marginBottom:S.iI},children:[v&&(0,I.jsx)(G.Z,{title:q.Rp[f],children:(0,I.jsx)(v,{size:2*S.iI})}),(0,I.jsx)("div",{style:{marginLeft:.5*S.iI,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:d-4.5*S.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)(K.Z,{bold:!0,monospace:!0,secondary:!0,small:!0,title:t[u],children:t[u]})})})]}),j,!j&&(0,I.jsx)("div",{style:{height:re}})]})}}},55729:function(e,n,t){"use strict";t.d(n,{Z:function(){return A}});var i=t(82394),o=t(75582),r=t(82684),l=t(69864),u=t(71180),c=t(15338),a=t(97618),s=t(55485),d=t(85854),p=t(48670),f=t(65956),v=t(82359),h=t(88543),m=t(38276),g=t(30160),b=t(17488),x=t(69650),j=t(12468),y=t(35686),k=t(38626),Z=t(44897),P=t(42631),O=t(70515),C=k.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-1b0w59t-0"})(["border-radius:","px;padding:","px;",""],P.n_,O.cd*O.iI,(function(e){return"\n background-color: ".concat((e.theme.background||Z.Z.background).codeArea,";\n ")})),w=t(72473),_=t(72191),S=t(81728),E=t(72619),I=t(70320),T=t(23780),M=t(28598);function D(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 R(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?D(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):D(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var A=function(e){var n,t,k,Z=e.cancelButtonText,P=e.contained,D=e.header,A=e.onCancel,B=e.onSaveSuccess,N=(0,T.VI)(null,{},[],{uuid:"settings/workspace/preferences"}),L=(0,o.Z)(N,1)[0],F=(0,r.useState)(null),U=F[0],H=F[1],z=(0,r.useState)(!1),G=z[0],W=z[1],K=y.ZP.projects.list(),V=K.data,q=K.mutate,Y=(0,r.useMemo)((function(){var e;return null===V||void 0===V||null===(e=V.projects)||void 0===e?void 0:e[0]}),[V]),Q=Y||{},X=Q.name,J=Q.openai_api_key,$=Q.project_uuid,ee=(0,r.useMemo)((function(){return"demo.mage.ai"===window.location.hostname}),[]);(0,r.useEffect)((function(){U||H(Y)}),[Y,U]);var ne=(0,l.Db)(y.ZP.projects.useUpdate(X),{onSuccess:function(e){return(0,E.wD)(e,{callback:function(e){var n,t=e.project;q(),H(t),W(!1),(0,I.h)(null===t||void 0===t||null===(n=t.features)||void 0===n?void 0:n[v.d.LOCAL_TIMEZONE]),B&&(null===B||void 0===B||B(t))},onErrorCallback:function(e,n){return L({errors:n,response:e})}})}}),te=(0,o.Z)(ne,2),ie=te[0],oe=te[1].isLoading,re=(0,r.useCallback)((function(e){return ie({project:e})}),[ie]),le=(0,M.jsxs)(M.Fragment,{children:[D,(0,M.jsxs)(f.Z,{noPadding:!0,children:[(0,M.jsxs)(m.Z,{p:O.cd,children:[(0,M.jsx)(m.Z,{mb:1,children:(0,M.jsx)(d.Z,{level:5,children:"Project name"})}),(0,M.jsx)(g.ZP,{default:!0,monospace:!0,children:X})]}),(0,M.jsx)(c.Z,{light:!0}),(0,M.jsxs)(m.Z,{p:O.cd,children:[(0,M.jsx)(m.Z,{mb:1,children:(0,M.jsx)(d.Z,{level:5,children:"Project UUID"})}),(0,M.jsx)(g.ZP,{default:!!$,monospace:!0,muted:!$,children:$||"Not required"})]}),(0,M.jsx)(c.Z,{light:!0}),(0,M.jsx)(m.Z,{p:O.cd,children:(0,M.jsxs)(s.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,M.jsxs)(a.Z,{flexDirection:"column",children:[(0,M.jsx)(m.Z,{mb:1,children:(0,M.jsx)(d.Z,{level:5,children:"Help improve Mage"})}),(0,M.jsxs)(g.ZP,{default:!0,children:["Please contribute usage statistics to help improve the developer experience for you and everyone in the community. Learn more ",(0,M.jsx)(p.Z,{href:"https://docs.mage.ai/contributing/statistics/overview",openNewWindow:!0,children:"here"}),"."]})]}),(0,M.jsx)(m.Z,{mr:O.cd}),(0,M.jsx)(x.Z,{compact:!0,checked:null===U||void 0===U?void 0:U.help_improve_mage,onCheck:function(){return H((function(e){return R(R({},e),{},{help_improve_mage:!(null!==U&&void 0!==U&&U.help_improve_mage)})}))}})]})})]}),(0,M.jsx)(m.Z,{mt:O.HN}),(0,M.jsx)(h.Z,{description:"Global settings that are applied to all pipelines in this project.",title:"Pipeline settings",children:(0,M.jsx)(h.S,{description:"Every time a trigger is created or updated in this pipeline, automatically persist it in code.",title:"Save triggers in code automatically",toggleSwitch:{checked:!(null===U||void 0===U||null===(n=U.pipelines)||void 0===n||null===(t=n.settings)||void 0===t||null===(k=t.triggers)||void 0===k||!k.save_in_code_automatically),onCheck:function(e){return H((function(n){var t,i,o,r,l,u;return R(R({},n),{},{pipelines:R(R({},null===n||void 0===n?void 0:n.pipelines),{},{settings:R(R({},null===n||void 0===n||null===(t=n.pipelines)||void 0===t?void 0:t.settings),{},{triggers:R(R({},null===n||void 0===n||null===(i=n.pipelines)||void 0===i||null===(o=i.settings)||void 0===o?void 0:o.triggers),{},{save_in_code_automatically:e(null===n||void 0===n||null===(r=n.pipelines)||void 0===r||null===(l=r.settings)||void 0===l||null===(u=l.triggers)||void 0===u?void 0:u.save_in_code_automatically)})})})})}))}}})}),(0,M.jsx)(m.Z,{mt:O.HN}),(0,M.jsx)(f.Z,{noPadding:!0,overflowVisible:!0,children:(0,M.jsxs)(m.Z,{p:O.cd,children:[(0,M.jsx)(m.Z,{mb:1,children:(0,M.jsx)(d.Z,{level:5,children:"Features"})}),Object.entries((null===U||void 0===U?void 0:U.features)||{}).map((function(e,n){var t=(0,o.Z)(e,2),r=t[0],l=t[1];return(0,M.jsx)(m.Z,{mt:0===n?0:1,children:(0,M.jsxs)(s.ZP,{alignItems:"center",children:[(0,M.jsx)(x.Z,{checked:!!l,compact:!0,onCheck:function(){return H((function(e){return R(R({},e),{},{features:R(R({},null===U||void 0===U?void 0:U.features),{},(0,i.Z)({},r,!l))})}))}}),(0,M.jsx)(m.Z,{mr:O.cd}),(0,M.jsxs)(a.Z,{children:[(0,M.jsx)(g.ZP,{default:!l,monospace:!0,children:(0,S.vg)(r)}),r===v.d.LOCAL_TIMEZONE&&(0,M.jsx)(m.Z,{ml:1,children:(0,M.jsx)(j.Z,{block:!0,description:"Display dates in local timezone. Please note that certain pages (e.g. Monitor page) or components (e.g. Pipeline run bar charts) may still be in UTC time. Dates in local time will have a timezone offset in the timestamp (e.g. -07:00).",lightBackground:!0,muted:!0,size:_._k})})]})]})},r)}))]})}),(0,M.jsx)(m.Z,{mt:O.HN}),(0,M.jsx)(f.Z,{noPadding:!0,children:(0,M.jsxs)(m.Z,{p:O.cd,children:[(0,M.jsx)(m.Z,{mb:1,children:(0,M.jsx)(d.Z,{level:5,children:"OpenAI"})}),J&&!G?(0,M.jsxs)(s.ZP,R(R({},s.A0),{},{children:[(0,M.jsx)(g.ZP,{default:!0,monospace:!0,children:"API key: ********"}),(0,M.jsx)(u.ZP,{iconOnly:!0,onClick:function(){return W(!0)},secondary:!0,title:"Edit",children:(0,M.jsx)(w.I8,{size:_.bL})})]})):(0,M.jsx)(b.Z,{disabled:ee,label:ee?"Entering API key is disabled on demo":"API key",monospace:!0,onChange:function(e){return H((function(n){return R(R({},n),{},{openai_api_key:e.target.value})}))},primary:!0,setContentOnMount:!0,value:(null===U||void 0===U?void 0:U.openai_api_key)||""})]})}),(0,M.jsx)(m.Z,{mt:O.HN}),(0,M.jsxs)(s.ZP,{alignItems:"center",children:[(0,M.jsx)(u.ZP,{loading:oe,onClick:function(){re({features:null===U||void 0===U?void 0:U.features,help_improve_mage:null===U||void 0===U?void 0:U.help_improve_mage,openai_api_key:null===U||void 0===U?void 0:U.openai_api_key,pipelines:null===U||void 0===U?void 0:U.pipelines})},primary:!0,children:"Save project settings"}),A&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(m.Z,{mr:O.cd}),(0,M.jsx)(u.ZP,{onClick:A,secondary:!0,children:Z||"Cancel"})]})]})]});return P?(0,M.jsx)(C,{children:le}):le}},46568:function(e,n,t){"use strict";var i=t(82394),o=t(26304),r=(t(82684),t(33591)),l=t(28598),u=["children","fullHeight","gutter","style"];function c(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function a(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?c(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):c(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n=e.children,t=e.fullHeight,i=e.gutter,c=e.style,s=void 0===c?{}:c,d=(0,o.Z)(e,u),p=a({},s);return i&&(p.paddingLeft=i,p.paddingRight=p.paddingLeft),t&&(p.height="100%"),(0,l.jsx)(r.Col,a(a({},d),{},{style:p,children:n}))}},82682:function(e,n,t){"use strict";var i=t(82394),o=t(26304),r=t(82684),l=t(33591),u=t(28598),c=["children","fullHeight","gutter","justifyContent","style"];function 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 s(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.children,t=e.fullHeight,i=e.gutter,a=e.justifyContent,d=e.style,p=void 0===d?{}:d,f=(0,o.Z)(e,c),v=s({},p);return i&&(v.marginLeft=-1*i,v.marginRight=v.marginLeft),t&&(v.height="100%"),(0,u.jsx)(l.Row,s(s({},f),{},{justifyContent:a,style:v,children:r.Children.map(n,(function(e,n){return e&&r.cloneElement(e,{gutter:i,key:n})}))}))}},88543:function(e,n,t){"use strict";t.d(n,{S:function(){return y},Z:function(){return k}});var i=t(82684),o=t(15338),r=t(97618),l=t(55485),u=t(85854),c=t(65956),a=t(82394),s=t(44085),d=t(38276),p=t(30160),f=t(17488),v=t(69650),h=t(72473),m=t(8193),g=t(70515),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,a.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}var y=function(e){var n,t=e.children,i=e.description,o=e.invalid,u=e.large,c=void 0===u||u,a=e.selectInput,x=e.textInput,y=e.title,k=e.toggleSwitch,Z=e.warning;return(0,b.jsx)(d.Z,{p:g.cd,children:(0,b.jsxs)(l.ZP,{alignItems:"center",children:[(0,b.jsxs)(l.ZP,{flexDirection:"column",children:[(0,b.jsxs)(p.ZP,{danger:o,default:!0,large:c,warning:Z,children:[y," ",o&&(0,b.jsx)(p.ZP,{danger:!0,inline:!0,large:c,children:"is required"})]}),i&&"string"===typeof i&&(0,b.jsx)(p.ZP,{muted:!0,small:!0,children:i}),i&&"string"!==typeof i&&i]}),(0,b.jsx)(d.Z,{mr:g.cd}),(0,b.jsxs)(r.Z,{flex:1,justifyContent:"flex-end",children:[t,x&&(0,b.jsx)(f.Z,j({afterIcon:(0,b.jsx)(h.I8,{}),afterIconClick:function(e,n){var t;null===n||void 0===n||null===(t=n.current)||void 0===t||t.focus()},afterIconSize:m.Z,alignRight:!0,autoComplete:"off",large:c,noBackground:!0,noBorder:!0,fullWidth:!0,paddingHorizontal:0,paddingVertical:0,setContentOnMount:!0},x)),a&&(0,b.jsx)(s.Z,j(j({},a),{},{afterIcon:(0,b.jsx)(h._M,{}),afterIconSize:m.Z,alignRight:!0,autoComplete:"off",large:c,noBackground:!0,noBorder:!0,paddingHorizontal:0,paddingVertical:0,setContentOnMount:!0,children:null===a||void 0===a||null===(n=a.options)||void 0===n?void 0:n.map((function(e){var n=e.label,t=e.value;return(0,b.jsx)("option",{value:t,children:n||t},t)}))})),k&&(0,b.jsx)(v.Z,{checked:!(null===k||void 0===k||!k.checked),compact:!0,onCheck:null===k||void 0===k?void 0:k.onCheck})]})]})})},k=function(e){var n=e.children,t=e.description,a=e.headerChildren,s=e.title;return(0,b.jsxs)(c.Z,{noPadding:!0,children:[(0,b.jsx)(d.Z,{p:g.cd,children:(0,b.jsxs)(l.ZP,{alignItems:"center",children:[(0,b.jsxs)(r.Z,{flex:1,flexDirection:"column",children:[(0,b.jsx)(u.Z,{level:4,children:s}),t&&"string"===typeof t&&(0,b.jsx)(d.Z,{mt:1,children:(0,b.jsx)(p.ZP,{muted:!0,children:t})}),t&&"string"!==typeof t&&t]}),a]})}),i.Children.map(n,(function(e,n){return(0,b.jsxs)("div",{children:[(0,b.jsx)(o.Z,{light:!0}),e]},"".concat(s,"-").concat(n))}))]})}},8193:function(e,n,t){"use strict";t.d(n,{N:function(){return c},Z:function(){return u}});var i=t(38626),o=t(44897),r=t(42631),l=t(70515),u=2*l.iI,c=i.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-1ck7mzt-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).codeArea,";\n ")}))},28071:function(e,n,t){"use strict";var i;t.d(n,{X:function(){return i}}),function(e){e.BOOTSTRAPPING="BOOTSTRAPPING",e.RUNNING="RUNNING",e.STARTING="STARTING",e.TERMINATED="TERMINATED",e.TERMINATED_WITH_ERRORS="TERMINATED_WITH_ERRORS",e.TERMINATING="TERMINATING",e.WAITING="WAITING"}(i||(i={}))},26032:function(e,n,t){"use strict";var i,o;t.d(n,{_:function(){return i},i:function(){return o}}),function(e){e.CREATE="CREATE",e.DELETE="DELETE",e.DESELECT="DESELECT",e.UPDATE="UPDATE"}(i||(i={})),function(e){e.ACTIVE="ACTIVE",e.INACTIVE="INACTIVE",e.PENDING="PENDING"}(o||(o={}))},68781:function(e,n,t){"use strict";var i;t.d(n,{R:function(){return o}}),function(e){e.AZURE_CONTAINER_INSTANCE="azure_container_instance",e.ECS="ecs",e.GCP_CLOUD_RUN="gcp_cloud_run",e.K8S="k8s",e.LOCAL_PYTHON="local_python",e.PYSPARK="pyspark"}(i||(i={}));var o=[i.AZURE_CONTAINER_INSTANCE,i.ECS,i.GCP_CLOUD_RUN,i.K8S,i.LOCAL_PYTHON,i.PYSPARK]},8666:function(e,n,t){"use strict";var i;t.d(n,{b:function(){return i}}),function(e){e.BLOCK="block",e.PIPELINE="pipeline"}(i||(i={}))},14466:function(e,n,t){"use strict";t.d(n,{Ij:function(){return r},N_:function(){return h},SQ:function(){return l},TT:function(){return u},W6:function(){return p},XG:function(){return s},YB:function(){return a},i9:function(){return v},sw:function(){return c},t4:function(){return d}});var i,o,r,l,u,c,a,s,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"}(a||(a={})),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_ID="resource_parent_id",e.USER="user"}(s||(s={})),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)},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),a=t(95363),s=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:a.Vp,fontSize:f?12:14,marginBottom:0,marginTop:0,maxWidth:t,paddingBottom:2*s.iI,paddingTop:2*s.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),a=t(38276),s=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)(a.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)(s.ZP,{inverted:b,monospace:y,muted:k,small:Z,children:j}),g===i.RIGHT&&(0,v.jsx)(a.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})}},96348:function(e,n,t){"use strict";t.d(n,{g:function(){return g},Z:function(){return b}});var i=t(82684),o=t(38626),r=t(44897),l=t(42631),u=t(47041),c=t(70515),a=1.5*c.iI,s=1.5*c.iI,d=o.default.div.withConfig({displayName:"indexstyle__TableStyle",componentId:"sc-13p7y8j-0"})(["border-radius:","px;overflow:hidden;width:100%;"," "," "," ",""],l.n_,(function(e){return e.width&&"\n width: ".concat(e.width,"px;\n ")}),(function(e){return"\n background-color: ".concat((e.theme||r.Z).background.page,";\n border: ").concat(l.YF,"px ").concat(l.M8," ").concat((e.theme||r.Z).interactive.defaultBorder,";\n box-shadow: ").concat((e.theme||r.Z).shadow.frame,";\n ")}),(function(e){return e.noBackground&&"\n background-color: transparent;\n "}),(function(e){return e.noBoxShadow&&"\n box-shadow: none;\n "})),p=o.default.div.withConfig({displayName:"indexstyle__RowContainerStyle",componentId:"sc-13p7y8j-1"})(["overflow:auto;border-bottom-left-radius:","px;border-bottom-right-radius:","px;"," "," "," ",""],l.n_,l.n_,u.w5,(function(e){return e.maxHeight>0&&"\n max-height: ".concat(e.maxHeight,"px;\n ")}),(function(e){return e.minHeight>0&&"\n min-height: ".concat(e.minHeight,"px;\n ")}),(function(e){return e.scrollable&&"\n margin-bottom: ".concat(c.iI,"px;\n overflow-y: auto;\n padding-top: ").concat(3,"px;\n padding-left: ").concat(3,"px;\n padding-right: ").concat(3,"px;\n ")})),f=o.default.div.withConfig({displayName:"indexstyle__HeaderStyle",componentId:"sc-13p7y8j-2"})(["border-top-left-radius:","px;border-top-right-radius:","px;padding:","px ","px;",""],l.n_,l.n_,a,2*c.iI,(function(e){return"\n border-bottom: ".concat(l.YF,"px ").concat(l.M8," ").concat((e.theme.interactive||r.Z.interactive).defaultBorder,";\n ")})),v=o.default.div.withConfig({displayName:"indexstyle__RowStyle",componentId:"sc-13p7y8j-3"})(["padding:","px ","px;"," "," "," "," "," ",""],s,2*c.iI,(function(e){return"\n border-bottom: ".concat(l.YF,"px ").concat(l.M8," ").concat((e.theme||r.Z).borders.medium2,";\n ")}),(function(e){return e.sameColorBorders&&"\n border-bottom-color: ".concat((e.theme||r.Z).interactive.defaultBorder,";\n ")}),(function(e){return e.noHorizontalPadding&&"\n padding-left: 0;\n padding-right: 0;\n "}),(function(e){return e.condensed&&"\n padding-top: ".concat(9,"px;\n padding-bottom: ").concat(9,"px;\n ")}),(function(e){return e.secondary&&"\n background-color: ".concat((e.theme.background||r.Z.background).row2,";\n ")}),(function(e){return e.last&&e.noBorder&&"\n border-bottom-left-radius: ".concat(l.n_,"px;\n border-bottom-right-radius: ").concat(l.n_,"px;\n border-bottom: none;\n ")})),h=o.default.div.withConfig({displayName:"indexstyle__FooterStyle",componentId:"sc-13p7y8j-4"})(["border-bottom-left-radius:","px;border-bottom-right-radius:","px;padding:","px ","px;",""],l.n_,l.n_,a,2*c.iI,(function(e){return"\n border-top: ".concat(l.YF,"px ").concat(l.M8," ").concat((e.theme||r.Z).borders.medium2,";\n ")})),m=t(28598),g=v;var b=function(e){var n=e.alternating,t=e.children,o=e.footer,r=e.header,l=e.maxHeight,u=e.minHeight,c=e.noBackground,a=e.noBoxShadow,s=e.sameColorBorders,v=e.scrollable,g=e.width,b=[].concat(t).filter((function(e){return null!==e}));return(0,m.jsxs)(d,{noBackground:c,noBoxShadow:a,width:g,children:[r&&(0,m.jsx)(f,{children:r}),(0,m.jsx)(p,{maxHeight:l,minHeight:u,scrollable:v,children:i.Children.map(b,(function(e,t){return e&&i.cloneElement(e,{last:t===b.length-1,sameColorBorders:s,secondary:n&&t%2===1})}))}),o&&(0,m.jsx)(h,{children:o})]})}},90299:function(e,n,t){"use strict";t.d(n,{Z:function(){return x}});var i=t(82684),o=t(71180),r=t(55485),l=t(64888),u=t(38276),c=t(30160),a=t(8059),s=t(38626),d=t(44897),p=t(70515),f=t(47041),v=s.default.div.withConfig({displayName:"indexstyle__TabsContainerStyle",componentId:"sc-segf7l-0"})(["padding-left:","px;padding-right:","px;"," "," ",""],p.cd*p.iI,p.cd*p.iI,(function(e){return e.noPadding&&"\n padding: 0;\n "}),(function(e){return e.allowScroll&&"\n overflow: auto;\n "}),f.w5),h=s.default.div.withConfig({displayName:"indexstyle__SelectedUnderlineStyle",componentId:"sc-segf7l-1"})(["border-radius:6px;height:","px;"," "," ",""],2,(function(e){return!e.selected&&"\n background-color: transparent;\n "}),(function(e){return e.selected&&!e.backgroundColor&&"\n background-color: ".concat((e.theme||d.Z).accent.blue,";\n ")}),(function(e){return e.selected&&e.backgroundColor&&"\n background-color: ".concat(e.backgroundColor,";\n ")})),m=t(3314),g=t(28598);function b(e,n){var t=e.allowScroll,s=e.compact,d=e.contained,f=e.noPadding,b=e.onClickTab,x=e.regularSizeText,j=e.selectedTabUUID,y=e.small,k=e.tabs,Z=e.underlineColor,P=e.underlineStyle,O=e.uppercase,C=void 0===O||O,w=(0,i.useMemo)((function(){var e=k.length,n=[];return k.forEach((function(t,i){var d=t.Icon,f=t.IconSelected,v=t.label,k=t.uuid,O=k===j,w=O&&f||d,_=v?v():k,S=(0,g.jsxs)(r.ZP,{alignItems:"center",children:[w&&(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(w,{default:!O,size:2*p.iI}),(0,g.jsx)(u.Z,{mr:1})]}),(0,g.jsx)(c.ZP,{bold:!0,default:!O,noWrapping:!0,small:!x,uppercase:C,children:_})]});i>=1&&e>=2&&n.push((0,g.jsx)("div",{style:{marginLeft:(x?2:1.5)*p.iI}},"spacing-".concat(k))),O&&!P?n.push((0,g.jsx)(l.Z,{backgroundGradient:a.yr,backgroundPanel:!0,borderLess:!0,borderWidth:2,compact:s||y,onClick:function(e){(0,m.j)(e),b(t)},paddingUnitsHorizontal:1.75,paddingUnitsVertical:1.25,small:y,children:S},k)):n.push((0,g.jsxs)(r.ZP,{flexDirection:"column",style:{paddingLeft:2,paddingRight:2,paddingBottom:P?0:2,paddingTop:P?0:2},children:[(0,g.jsxs)(o.ZP,{borderLess:!0,compact:s||y,default:!0,noBackground:P,noPadding:P,onClick:function(e){(0,m.j)(e),b(t)},outline:!P,small:y,children:[!P&&S,P&&(0,g.jsx)("div",{style:{paddingBottom:(s||y?p.iI/2:p.iI)+2,paddingTop:(s||y?p.iI/2:p.iI)+2+2},children:S})]}),P&&(0,g.jsx)(h,{backgroundColor:Z,selected:O})]},"button-tab-".concat(k)))})),n}),[s,b,j,y,k,P]),_=(0,g.jsx)(r.ZP,{alignItems:"center",children:w});return d?_:(0,g.jsx)(v,{allowScroll:t,noPadding:f,ref:n,children:_})}var x=i.forwardRef(b)},98305:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return Sr}});var i=t(77837),o=t(21831),r=t(75582),l=t(82394),u=t(38860),c=t.n(u),a=t(92083),s=t.n(a),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),_=t(55283),S=t(28598);function E(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function I(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?E(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):E(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var T=function(e){var n=e.blockRefs,t=e.hiddenBlocks,i=e.pipeline,o=e.setHiddenBlocks,r=(0,f.useContext)(p.ThemeContext),u=(0,f.useMemo)((function(){return(null===i||void 0===i?void 0:i.blocks)||[]}),[i]),c=(0,f.useMemo)((function(){var e=[],n=[];return u.forEach((function(i){var o=i.uuid;null!==t&&void 0!==t&&t[o]?e.push(i):n.push(i)})),{blocksHidden:e,blocksVisible:n}}),[u,t]),a=c.blocksHidden,s=c.blocksVisible,d=(0,f.useMemo)((function(){return(null===u||void 0===u?void 0:u.length)>=1&&0===s.length}),[u,s]),v=(0,f.useMemo)((function(){return(null===u||void 0===u?void 0:u.length)>=1&&0===a.length}),[u,a]),h=(0,f.useCallback)((function(e){var t=e.type,i=e.uuid;if(null!==n&&void 0!==n&&n.current){var o,r=n.current["".concat(t,"s/").concat(i,".py")];null===r||void 0===r||null===(o=r.current)||void 0===o||o.scrollIntoView()}}),[n]);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Z,{p:1,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(x.Z,{checked:v,label:"Show all",onClick:function(){return o((function(){return{}}))}}),(0,S.jsx)(O.Z,{mr:w.cd}),(0,S.jsx)(x.Z,{checked:d,label:"Hide all",onClick:function(){return o((function(){return u.reduce((function(e,n){var t=n.uuid;return I(I({},e),{},(0,l.Z)({},t,!0))}),{})}))}})]})}),(0,S.jsx)(y.Z,{medium:!0}),null===u||void 0===u?void 0:u.map((function(e){var n=e.uuid,i=(0,_.qn)(e.type,{blockColor:e.color,theme:r}).accent,u=!(null!==t&&void 0!==t&&t[n]);return(0,S.jsx)(P.Z,{block:!0,noHoverUnderline:!0,noOutline:!0,onClick:function(){o((function(e){return I(I({},e),{},(0,l.Z)({},n,u))})),u||setTimeout((function(){return h(e)}),1)},preventDefault:!0,children:(0,S.jsx)(O.Z,{mt:1,px:1,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(O.Z,{pr:1,children:(0,S.jsx)(x.Z,{checked:u})}),(0,S.jsxs)(k.Z,{alignItems:"center",children:[(0,S.jsx)(j.Z,{color:i,size:1.5*w.iI,square:!0}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(C.ZP,{default:!0,monospace:!0,noWrapping:!0,small:!0,children:n})]})]})})},n)}))]})},M=t(60523),D=t(71180),R=t(90299),A=t(65701),B=t(1254);var N=function(e){var n=e.size;return(0,S.jsxs)("svg",{width:n,height:n,viewBox:"0 0 121 121",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,S.jsx)("path",{d:"M67.7193 2.36691C69.8656 1.52184 72.3078 2.0081 73.9667 3.61084L116.977 45.1646C119.018 47.1366 119.362 50.2841 117.794 52.65L92.5787 90.7113C92.1293 91.3897 91.5441 91.9675 90.8601 92.4083L51.1076 118.029C48.6859 119.589 45.4904 119.168 43.5558 117.033L3.02296 72.3013C1.48382 70.6027 1.07052 68.1652 1.96372 66.0542L20.1894 22.9792C20.8058 21.5224 21.9825 20.3749 23.4544 19.7954L67.7193 2.36691Z",fill:"url(#paint0_radial_11972_15232)"}),(0,S.jsx)("path",{d:"M71.2431 0.979492L23.6155 19.9931C22.1646 20.5723 21.0034 21.7045 20.3877 23.1402L0.499023 69.5159L20.1894 22.9792C20.8058 21.5224 21.9825 20.3749 23.4544 19.7954L71.2431 0.979492Z",fill:"url(#paint1_radial_11972_15232)"}),(0,S.jsx)("path",{d:"M66.8804 2.66681C69.0294 1.81866 71.4758 2.30583 73.1359 3.9125L116.693 46.0674C117.169 46.5283 117.061 47.3191 116.478 47.635L75.3823 69.9165C74.5929 70.3446 73.6135 70.1821 73.0046 69.522L27.1285 19.7915C26.661 19.2848 26.8482 18.4667 27.4895 18.2136L66.8804 2.66681Z",fill:"url(#paint3_radial_11972_15232)"}),(0,S.jsx)("path",{d:"M66.8804 2.66681C69.0294 1.81866 71.4758 2.30583 73.1359 3.9125L116.693 46.0674C117.169 46.5283 117.061 47.3191 116.478 47.635L75.3823 69.9165C74.5929 70.3446 73.6135 70.1821 73.0046 69.522L27.1285 19.7915C26.661 19.2848 26.8482 18.4667 27.4895 18.2136L66.8804 2.66681Z",fill:"url(#paint4_linear_11972_15232)"}),(0,S.jsx)("path",{d:"M23.3591 24.6945L58.2913 58.6736L25.3897 22.7247C24.8455 22.13 23.9152 22.1095 23.3452 22.6795C22.7871 23.2375 22.7934 24.1442 23.3591 24.6945Z",fill:"url(#paint5_radial_11972_15232)"}),(0,S.jsx)("path",{d:"M51.6694 46.395L73.0043 69.5215C73.6132 70.1816 74.5925 70.3441 75.382 69.9161L117.654 46.9975L75.6257 67.8209C74.8809 68.1899 73.9844 68.0497 73.3879 67.4708L51.6694 46.395Z",fill:"url(#paint6_radial_11972_15232)"}),(0,S.jsxs)("defs",{children:[(0,S.jsxs)("radialGradient",{id:"paint0_radial_11972_15232",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(16.9412 88.4412) rotate(18.02) scale(82.0367 81.4644)",children:[(0,S.jsx)("stop",{stopColor:"#FFDA19"}),(0,S.jsx)("stop",{offset:"0.473958",stopColor:"#33CDF2"}),(0,S.jsx)("stop",{offset:"0.786458",stopColor:"#3266FF"}),(0,S.jsx)("stop",{offset:"1",stopColor:"#5429FF"})]}),(0,S.jsxs)("radialGradient",{id:"paint1_radial_11972_15232",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(35.8711 10.2518) rotate(87.6364) scale(26.1711 27.0141)",children:[(0,S.jsx)("stop",{stopColor:"white"}),(0,S.jsx)("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]}),(0,S.jsxs)("radialGradient",{id:"paint2_radial_11972_15232",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(150.671 44.2502) rotate(128.639) scale(125.554 128.436)",children:[(0,S.jsx)("stop",{stopColor:"white"}),(0,S.jsx)("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]}),(0,S.jsxs)("radialGradient",{id:"paint3_radial_11972_15232",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(133.353 52.8357) rotate(144.647) scale(86.7385 72.7129)",children:[(0,S.jsx)("stop",{offset:"0.081278",stopColor:"white"}),(0,S.jsx)("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]}),(0,S.jsxs)("linearGradient",{id:"paint4_linear_11972_15232",x1:"76.5876",y1:"66.532",x2:"79.1358",y2:"50.4429",gradientUnits:"userSpaceOnUse",children:[(0,S.jsx)("stop",{stopColor:"white"}),(0,S.jsx)("stop",{offset:"0.416667",stopColor:"white",stopOpacity:"0.1"}),(0,S.jsx)("stop",{offset:"0.682292",stopColor:"white",stopOpacity:"0"})]}),(0,S.jsxs)("radialGradient",{id:"paint5_radial_11972_15232",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(25.2251 23.4978) rotate(48.3599) scale(35.5147 43.1672)",children:[(0,S.jsx)("stop",{stopColor:"white"}),(0,S.jsx)("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]}),(0,S.jsxs)("radialGradient",{id:"paint6_radial_11972_15232",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(76.5908 67.6516) rotate(104.629) scale(14.9575 79.0374)",children:[(0,S.jsx)("stop",{stopColor:"white"}),(0,S.jsx)("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]})]})]})},L=t(9189),F=t(93369),U=t(7267),H=t(57653),z=t(44085),G=t(4190),W=t(17488),K=t(35686),V=t(72473),q=t(4015),Y=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,a=e.onSave,s=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(){a(te(te({},x),{},{name:(null===x||void 0===x?void 0:x.name)||o}))}),[x,o,a]);(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===s||void 0===s?void 0:s.type)}),[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]),R=(0,f.useMemo)((function(){var e;return Y.I.DATA_INTEGRATION===(null===i||void 0===i||null===(e=i.config)||void 0===e?void 0:e.template_type)||!![Y.O.DESTINATIONS,Y.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)(K.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:U.z.GENERATE_BLOCK_WITH_DESCRIPTION}})}),[ue,M,T,ie]);var ae=(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]),se=(0,f.useMemo)((function(){var e=(null===x||void 0===x?void 0:x.type)||(null===i||void 0===i?void 0:i.type);ae&&(e=null===ae||void 0===ae?void 0:ae.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,ae,P]);return(0,S.jsxs)(q.Nk,{width:T&&(null===x||void 0===x?void 0:x.content)&&80*w.iI,children:[(0,S.jsxs)(q.I5,{children:[T&&ce&&(0,S.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsx)(C.ZP,{children:"Generating block using AI..."}),(0,S.jsx)(G.Z,{inverted:!0})]}),T&&!ce&&(0,S.jsx)(Z.ZP,{alignItems:"center",justifyContent:"center",children:(0,S.jsx)(V.xq,{size:5*w.iI,warning:!0})}),!T&&(0,S.jsx)(Z.ZP,{alignItems:"center",justifyContent:"center",children:(0,S.jsx)(N,{size:15*w.iI})})]}),T&&!ce&&(0,S.jsx)(q.gI,{children:(0,S.jsxs)(O.Z,{py:1,children:[(0,S.jsx)(O.Z,{mb:1,children:(0,S.jsx)(C.ZP,{default:!0,children:"Block generated using AI"})}),(0,S.jsx)(C.ZP,{textOverflow:!0,children:M})]})}),ae&&(0,S.jsx)(q.gI,{children:(0,S.jsxs)(O.Z,{py:1,children:[(0,S.jsx)(O.Z,{mb:1,children:(0,S.jsx)(C.ZP,{default:!0,children:"Template"})}),(0,S.jsx)(C.ZP,{textOverflow:!0,children:null===(t=(null===ae||void 0===ae?void 0:ae.name)||(null===ae||void 0===ae?void 0:ae.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,S.jsxs)(q.gI,{children:[(0,S.jsx)(k.Z,{flex:"1",children:(0,S.jsx)(V.uy,{size:Q.l2,warning:!0})}),(0,S.jsx)(k.Z,{flex:"6",children:(0,S.jsxs)(C.ZP,{bold:!0,warning:!0,children:[u&&"Renaming this block will affect ".concat(h," pipelines.")+" The renamed block may need to be re-added to the shared pipeline(s).",l&&"This will create a copy of the selected block and replace the existing one so it is no longer shared with any other pipelines."]})})]}),(0,S.jsxs)(q.gI,{children:[(0,S.jsx)(C.ZP,{default:!0,children:"Name"}),(0,S.jsx)(W.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,S.jsxs)(q.gI,{children:[(0,S.jsx)(C.ZP,{default:!0,children:"Type"}),(0,S.jsx)(O.Z,{mr:w.cd,py:1,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(C.ZP,{muted:!0,children:se}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(V.QM,{muted:!0})]})})]}),!E&&(_||ae||(null===x||void 0===x?void 0:x.language))&&(0,S.jsxs)(q.gI,{paddingVerticalAddition:3,children:[(0,S.jsx)(C.ZP,{default:!0,children:"Language"}),(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[[b.t6.PYTHON,b.t6.SQL,b.t6.R,b.t6.YAML].reduce((function(e,n){var t=(ae?null===ae||void 0===ae?void 0:ae.language:null===x||void 0===x?void 0:x.language)===n;return!(_&&!u&&!l||t||R&&b.t6.R!==n&&R&&b.t6.SQL!==n)||_&&b.t6.YAML===n||e.push((0,S.jsx)(O.Z,{ml:1,children:(0,S.jsx)(D.ZP,{borderColor:t?null:"transparent",compact:!0,default:!_&&!t&&!R,disabled:!_&&!t&&!R,noBackground:!0,notClickable:(!_||u||!R)&&t,onClick:ae&&!R?null:function(){return j((function(e){return te(te({},e),{},{language:n})}))},selected:t,children:b.LE[n]})},n)),e}),[]),!_&&!R&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(V.QM,{muted:!0})]}),(0,S.jsx)(O.Z,{mr:_||R?1:2})]})]}),(_||(null===ae||void 0===ae?void 0:ae.color)||(null===x||void 0===x?void 0:x.color))&&(0,S.jsxs)(q.gI,{children:[(0,S.jsx)(C.ZP,{default:!0,children:"Color"}),_&&(0,S.jsxs)(z.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:ae?(null===ae||void 0===ae?void 0:ae.color)||"":(null===x||void 0===x?void 0:x.color)||"",children:[(0,S.jsx)("option",{value:""}),Object.values(b.Lq).map((function(e){return(0,S.jsx)("option",{value:e,children:(0,J.kC)(e)},e)}))]}),!_&&(0,S.jsx)(O.Z,{mr:w.cd,py:1,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(C.ZP,{muted:!0,children:(0,J.kC)((null===ae||void 0===ae?void 0:ae.color)||(null===x||void 0===x?void 0:x.color)||"")}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(V.QM,{muted:!0})]})})]}),T&&(null===x||void 0===x?void 0:x.content)&&(0,S.jsx)(q.gI,{display:"block",children:(0,S.jsx)(O.Z,{pr:w.cd,py:1,children:(0,S.jsx)(A.W,{backend:B.PD,children:(0,S.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,S.jsx)(q.$b,{children:(0,S.jsxs)(Z.ZP,{fullWidth:!0,children:[(0,S.jsxs)(F.ZP,{bold:!0,centerText:!0,disabled:ce,onClick:y,primary:!0,tabIndex:0,uuid:"ConfigureBlock/SaveAndAddBlock",children:["Save and\xa0",u?"update":l?"replace":"add"," block"]}),(0,S.jsx)(O.Z,{ml:1,children:(0,S.jsx)(D.ZP,{onClick:c,tabIndex:0,children:"Cancel"})})]})})]})},oe=t(54750),re=t(4804),le=t(75810),ue=t(85854),ce=t(99236),ae=t(29480),se=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,a=e.savePipelineContent,s=e.setBlockConfigString,d=e.setBlockContent,p=e.setContent,h=e.setSelectedSubTab,m=e.showError,g=n||{},x=g.language,k=g.type,_=g.uuid,E=(c||{}).uuid,I=(0,f.useState)(!1),T=I[0],M=I[1],R=(0,f.useMemo)((function(){return b.t6.YAML===x&&i?(0,re.Qc)(i):{}}),[i,x]);(0,f.useEffect)((function(){R&&!t&&s((0,re.Pz)(null===R||void 0===R?void 0:R.config))}),[t,R]);var A=(0,f.useState)(!1),B=A[0],N=A[1],L=(0,v.Db)(K.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})}})}}),F=(0,r.Z)(L,2),U=F[0],H=F[1].isLoading,z=(0,f.useCallback)((function(){return a().then((function(){return U({integration_source:{action_type:"test_connection",block_uuid:_,pipeline_uuid:E}})}))}),[_,U,E,a]),G=(0,f.useMemo)((function(){if(b.t6.YAML===x)return(0,S.jsx)(ae.$W,{children:(0,S.jsx)(le.Z,{autoHeight:!0,language:x,onChange:function(e){s(e);try{var n=(0,re.Qc)(e),t=(0,re.Pz)(fe(fe({},R),{},{config:n}));u(k,_,t),p(t),M(!1)}catch(i){M(!0)}},tabSize:2,value:t||void 0,width:"100%"})});b.t6.PYTHON}),[t,i,R,x,k,_,d,p]),W=(0,f.useMemo)((function(){return(0,de.Wi)(o,l)}),[o,l]);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Z,{p:w.cd,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(D.ZP,{beforeIcon:(0,S.jsx)(V.Ae,{success:!0}),loading:H,onClick:function(){N(!1),z()},secondary:!0,compact:!0,children:"Test connection"}),B&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Z,{mr:w.cd}),(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(j.Z,{size:1*w.iI,success:!0}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(C.ZP,{success:!0,children:"Connection successful"})]})]})]})}),(0,S.jsx)(y.Z,{light:!0}),(0,S.jsxs)(O.Z,{p:w.cd,children:[(0,S.jsx)(C.ZP,{bold:!0,default:!0,large:!0,children:"Inputs from upstream blocks"}),0===(null===W||void 0===W?void 0:W.length)&&(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsxs)(C.ZP,{muted:!0,children:["No inputs are selected. Toggle the upstream blocks in the ",(0,S.jsx)(P.Z,{bold:!0,onClick:function(){return h(se.tw.UPSTREAM_BLOCK_SETTINGS)},preventDefault:!0,children:"Upstream block settings"})," to enable its output data as an input."]})})]}),(null===W||void 0===W?void 0:W.length)>=1&&(0,S.jsx)(ce.Z,{inputsBlocks:W}),T&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(y.Z,{light:!0}),(0,S.jsxs)(O.Z,{p:w.cd,children:[(0,S.jsx)(O.Z,{mb:1,children:(0,S.jsx)(ue.Z,{danger:!0,level:5,children:"ERROR"})}),(0,S.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."]})]})]}),G]})},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),a=(0,f.useState)(null),s=a[0],d=a[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,_=(0,f.useMemo)((function(){return(0,je.Qr)((0,de.WE)(u||{})||{},{idIsInObject:!0})}),[u]),E=K.ZP.outputs.pipelines.detail(!s&&x,!s&&j,{parent_stream:k,sample_count:h,stream:Z},{revalidateOnFocus:!1}).data,I=(0,v.Db)(K.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],R=T[1].isLoading,A=(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 s||(null===E||void 0===E?void 0:E.output)}),[E,s]),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,S.jsx)(be.Z,{columnHeaderHeight:xe.Eh,columns:o,height:t-g,noBorderBottom:!0,noBorderLeft:!0,noBorderRight:!0,rows:r})}),[N,t,g]);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Z,{p:w.cd,ref:c,children:_?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.ZP,{default:!0,children:"Please select at least 1 column in the stream in order to fetch sample data."}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsx)(P.Z,{bold:!0,onClick:function(){return o(se.tw.SETTINGS)},preventDefault:!0,children:"Go to Schema properties to select a column"})})]}):(0,S.jsx)(D.ZP,{compact:!0,loading:R,onClick:function(){return A()},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),_e=t(44897),Se=t(42631),Ee=p.default.div.withConfig({displayName:"indexstyle__SectionStyle",componentId:"sc-wjbb3f-0"})(["border-radius:","px;"," ",""],Se.n_,(function(e){return"\n border: 1px solid ".concat((e.theme.borders||_e.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 De=function(e){var n,t=e.block,i=(e.blocksMapping,e.onChangeBlock),u=e.setBlockAttributes,c=e.stream,a=(e.streamMapping,e.updateStreamsInCatalog),s=(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,_=h.partition_keys,E=h.replication_method,I=h.run_in_parallel,T=h.unique_conflict_method,M=h.unique_constraints,R=(0,de.M$)(c),A=(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),F=(0,f.useCallback)((function(e){return a(e,(function(e){return null===i||void 0===i?void 0:i(e)}))}),[i,a]),U=(0,f.useCallback)((function(e,n){F([Me(Me({},c),{},(0,l.Z)({},e,n))])}),[c,F]),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],a=c.metadata,s=c.type;n.push(u),(!a||null===a||void 0===a||!a.metadata||null!==a&&void 0!==a&&null!==(o=a.metadata)&&void 0!==o&&o.selected)&&i.push(u);var d=Array.isArray(s)?s:[s];if((null===d||void 0===d?void 0:d.length)>=1){var p=d[(null===d||void 0===d?void 0:d.length)-1];null!==t&&void 0!==t&&t[p]||(t[p]=[]),t[p].push(u)}})),(0,S.jsx)(Ze.Z,{columnFlex:[1,1],rows:[[(0,S.jsx)(C.ZP,{children:"Number of columns selected"},"columns"),(0,S.jsxs)(C.ZP,{monospace:!0,rightAligned:!0,children:[null===i||void 0===i?void 0:i.length," ",(0,S.jsx)(C.ZP,{inline:!0,monospace:!0,muted:!0,children:"/"})," ",null===n||void 0===n?void 0:n.length]},"columns-value")]].concat((0,o.Z)((0,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,S.jsxs)(C.ZP,{children:[(0,J.vg)(t)," columns"]},"columns-".concat(t)),(0,S.jsx)(C.ZP,{monospace:!0,rightAligned:!0,children:null===i||void 0===i?void 0:i.length},"columns-value-".concat(t))]}))),(0,o.Z)([["Bookmarks",g,"bookmark_properties"],["Unique constraints",M,"unique_constraints"],["Key properties",P,"key_properties"],["Partition keys",_,"partition_keys"]].map((function(e){var n,t=(0,r.Z)(e,3),i=t[0],o=t[1],l=t[2];return[(0,S.jsx)(C.ZP,{children:i},i),(0,S.jsxs)(Z.ZP,{alignItems:"center",flexWrap:"wrap",justifyContent:"flex-end",children:[!(null!==o&&void 0!==o&&o.length)&&(0,S.jsx)(C.ZP,{muted:!0,monospace:!0,children:"-"}),null===(n=(0,Ie.YC)(o||[],(function(e){return e})))||void 0===n?void 0:n.map((function(e){return(0,S.jsx)("div",{style:{marginLeft:w.iI/2},children:(0,S.jsx)(ke.Z,{label:e,onClick:function(){return U(l,(0,Ie.Od)(o,(function(n){return n===e})))},xsmall:!0})},"".concat(i,"-value-").concat(e))}))]},"".concat(i,"-value"))]}))))})}),[g,P,_,c,M,U]),G=(0,f.useMemo)((function(){return A in p?null===p||void 0===p?void 0:p[A]:j}),[j,p,A]);return(0,S.jsxs)(O.Z,{p:w.cd,children:[(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsxs)(Ee,{children:[(0,S.jsx)(C.ZP,{default:!0,uppercase:!0,children:"Output"}),(0,S.jsx)(O.Z,{mt:w.cd,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(C.ZP,{large:!0,children:"Destination table"}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(Oe.Z,{label:(0,S.jsxs)(C.ZP,{children:["By default, this stream will be saved to your destination under the table named ",(0,S.jsx)(C.ZP,{bold:!0,inline:!0,monospace:!0,children:R}),". To change the table name, enter in a different value."]}),lightBackground:!0}),(0,S.jsx)(O.Z,{mr:w.cd})]}),(0,S.jsx)(k.Z,{flex:1,children:(0,S.jsx)(W.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)({},A,t))})),clearTimeout(s.current),s.current=setTimeout((function(){return U("destination_table",t)}),300)},value:G||""})})]})})]})}),(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsxs)(Ee,{children:[(0,S.jsx)(C.ZP,{default:!0,uppercase:!0,children:"Settings"}),(0,S.jsx)(O.Z,{mt:w.cd,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(C.ZP,{large:!0,children:"Replication method"}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(Oe.Z,{label:(0,S.jsxs)(C.ZP,{children:["Do you want to synchronize the entire stream (",(0,S.jsx)(C.ZP,{bold:!0,inline:!0,monospace:!0,children:Ce._B.FULL_TABLE}),") on each pipeline run or only new records (",(0,S.jsx)(C.ZP,{bold:!0,inline:!0,monospace:!0,children:Ce._B.INCREMENTAL}),")?",Ce.th.POSTGRESQL===L&&(0,S.jsxs)(C.ZP,{children:["Log-based incremental replication (",(0,S.jsx)(C.ZP,{bold:!0,inline:!0,monospace:!0,children:Ce._B.LOG_BASED}),") is also available for PostgreSQL sources."]})]}),lightBackground:!0}),(0,S.jsx)(O.Z,{mr:w.cd}),(0,S.jsx)(z.Z,{defaultColor:!0,onChange:function(e){return U("replication_method",e.target.value)},placeholder:"Select an option",value:E,children:Ce.jL.map((function(e){return(0,S.jsx)("option",{value:e,children:(0,J.vg)(e)},e)}))})]})}),(0,S.jsx)(O.Z,{mt:w.cd,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(C.ZP,{large:!0,children:"Unique conflict method"}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(Oe.Z,{label:(0,S.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,S.jsx)(S.Fragment,{children:"\xa0"}),null===M||void 0===M?void 0:M.sort().map((function(e,n){return(0,S.jsxs)(C.ZP,{bold:!0,inline:!0,monospace:!0,children:[1!==(null===M||void 0===M?void 0:M.length)&&n===(null===M||void 0===M?void 0:M.length)-1?(0,S.jsx)(C.ZP,{inline:!0,children:" and "},e):n>=1&&(0,S.jsx)(S.Fragment,{children:",\xa0"}),e]},e)})),", how do you want to resolve the conflict? The conflict method ",(0,S.jsx)(C.ZP,{bold:!0,inline:!0,monospace:!0,children:Ce.MU.IGNORE})," will skip the new record if it\u2019s a duplicate of an existing record. The conflict method ",(0,S.jsx)(C.ZP,{bold:!0,inline:!0,monospace:!0,children:Ce.MU.UPDATE})," will not save the new record and instead update the existing record with the new record\u2019s properties."]}),lightBackground:!0}),(0,S.jsx)(O.Z,{mr:w.cd}),(0,S.jsx)(z.Z,{defaultColor:!0,onChange:function(e){return U("unique_conflict_method",e.target.value)},placeholder:"Select an option",value:T,children:Object.values(Ce.MU).map((function(e){return(0,S.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,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsxs)(Ee,{children:[(0,S.jsx)(C.ZP,{default:!0,uppercase:!0,children:"Bookmark property operators"}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsxs)(C.ZP,{muted:!0,small:!0,children:["By default, new records are compared to the bookmark property value using the operator greater than or equals (",(0,S.jsx)(C.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:">="}),").",(0,S.jsx)("br",{}),"If the bookmark property is also a unique constraint, then the default operator is greater than (",(0,S.jsx)(C.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:">"}),").",(0,S.jsx)("br",{}),"Change the operator that is used when determining which records to sync based on the bookmark value from the most recently completed sync."]})}),null===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,S.jsx)(O.Z,{mt:w.cd,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsxs)(C.ZP,{default:!0,monospace:!0,children:[(0,S.jsxs)(C.ZP,{inline:!0,monospace:!0,muted:!0,children:["{new_record}","."]}),e]}),(0,S.jsx)(O.Z,{mr:w.cd}),(0,S.jsx)(z.Z,{compact:!0,defaultColor:!0,monospace:!0,onChange:function(n){return U("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,S.jsx)("option",{value:e,children:we.N_[e]},e)}))}),(0,S.jsx)(O.Z,{mr:w.cd}),(0,S.jsxs)(C.ZP,{default:!0,monospace:!0,children:[(0,S.jsxs)(C.ZP,{inline:!0,monospace:!0,muted:!0,children:["{bookmark}","."]}),e]})]})},e)}))]})}),(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsxs)(Ee,{children:[(0,S.jsx)(C.ZP,{default:!0,uppercase:!0,children:"Options"}),(0,S.jsx)(O.Z,{mt:w.cd,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(k.Z,{flexDirection:"column",children:[(0,S.jsx)(C.ZP,{bold:!0,large:!0,children:"Run streams in parallel"}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsx)(C.ZP,{default:!0,children:"Parallel streams will be run at the same time, so make sure there are no dependencies between them."})})]}),(0,S.jsx)(O.Z,{mr:w.cd}),(0,S.jsx)(Pe.Z,{checked:!!I,onCheck:function(e){return U("run_in_parallel",e(I))}})]})}),b.tf.DATA_EXPORTER===(null===t||void 0===t?void 0:t.type)&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Z,{mt:w.cd,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(k.Z,{flexDirection:"column",children:[(0,S.jsx)(C.ZP,{bold:!0,large:!0,children:"Automatically add new fields"}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsx)(C.ZP,{default:!0,children:"Turn the toggle on if you want new table columns in each data source stream to be automatically added and synced with the data destination."})})]}),(0,S.jsx)(O.Z,{mr:w.cd}),(0,S.jsx)(Pe.Z,{checked:!!m,onCheck:function(e){return U("auto_add_new_fields",e(m))}})]})}),(0,S.jsx)(O.Z,{mt:w.cd,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(k.Z,{flexDirection:"column",children:[(0,S.jsx)(C.ZP,{bold:!0,large:!0,children:"Disable column type check"}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsx)(C.ZP,{default:!0,children:"By default, the value for each column is validated according to the schema property for that column. If a value in a column doesn\u2019t match its type, an error will be raised and the process will be stopped. Turn this toggle on if you want to disable this strict type checking."})})]}),(0,S.jsx)(O.Z,{mr:w.cd}),(0,S.jsx)(Pe.Z,{checked:!!y,onCheck:function(e){return U("disable_column_type_check",e(y))}})]})})]})]})}),(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsxs)(Ee,{noPadding:!0,children:[(0,S.jsx)(O.Z,{pt:w.cd,px:w.cd,children:(0,S.jsx)(C.ZP,{default:!0,uppercase:!0,children:"Summary"})}),(0,S.jsx)(O.Z,{mt:w.cd,pb:w.cd,children:H})]})}),(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsxs)(Ee,{children:[(0,S.jsx)(C.ZP,{default:!0,uppercase:!0,children:"Other"}),(0,S.jsx)(O.Z,{mt:w.cd,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(C.ZP,{large:!0,children:"Select stream"}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(Pe.Z,{checked:!!B,onCheck:function(e){return F([(0,de.XE)(c,{selected:e(B)})])}})]})}),(0,S.jsx)(O.Z,{mt:w.HN,children:(0,S.jsx)(Z.ZP,{alignItems:"center",children:(0,S.jsx)(D.ZP,{danger:!0,onClick:function(){window.confirm("Are you sure you want to remove stream ".concat(R," 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)===A}))})});return null===i||void 0===i||i(t),t}))},children:"Delete stream from block"})})})]})})]})},Re=t(11074),Ae=t(69632),Be=t(3314);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 Fe=function(e){var n,t,i=e.block,o=(e.blocksMapping,e.highlightedColumnsMapping),u=e.onChangeBlock,c=e.setBlockAttributes,a=e.setHighlightedColumnsMapping,s=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),_=P[0],E=P[1],I=(0,f.useState)(null),T=I[0],M=I[1],R=(0,f.useRef)(null),A=(0,f.useState)(null),B=A[0],N=A[1],L=(0,f.useCallback)((function(){N(null),E(null)}),[N,E]);(0,f.useEffect)((function(){var e;return null===(e=document)||void 0===e||e.addEventListener("click",L),function(){var e;null===(e=document)||void 0===e||e.removeEventListener("click",L)}}),[L]);var F=(0,f.useMemo)((function(){var e=v.bookmark_properties,n=v.key_properties,t=v.partition_keys,i=(v.replication_method,v.unique_constraints);return{bookmarkPropertiesMapping:(0,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]),U=F.bookmarkPropertiesMapping,H=F.keyPropertiesMapping,z=F.partitionKeysMapping,G=F.uniqueConstraintsMapping,W=(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]),K=((0,f.useMemo)((function(){return(0,de.MB)(v)}),[v]),(0,f.useMemo)((function(){return(0,de.Nf)(v)}),[v])),q=null===i||void 0===i||null===(n=i.metadata)||void 0===n||null===(t=n.data_integration)||void 0===t?void 0:t.destination,Y=(0,f.useMemo)((function(){return!Ce.kB.includes(q)}),[q]),Q=(0,f.useMemo)((function(){var e=[null,1,1],n=null===W||void 0===W?void 0:W.every((function(e){var n,t,i,o=e.property;return!(null!==o&&void 0!==o&&o.metadata)||!(null!==o&&void 0!==o&&null!==(n=o.metadata)&&void 0!==n&&n.metadata)||(null===o||void 0===o||null===(t=o.metadata)||void 0===t||null===(i=t.metadata)||void 0===i?void 0:i.selected)})),t=[{label:function(){return(0,S.jsx)(Pe.Z,{checked:n,compact:!0,onCheck:function(e){return function(e){var n=null===W||void 0===W?void 0:W.reduce((function(n,t){var i=t.column,o=(null===K||void 0===K?void 0:K[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"}];Y&&(e.push.apply(e,[null,null]),t.push.apply(t,[{center:!0,uuid:"Unique"},{center:!0,uuid:"Key"}]));var i=v.replication_method;return 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}}),[W,g,v,K,Y]),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),a=(null===c||void 0===c?void 0:c.typesDerived)||[];return(0,S.jsxs)(Z.ZP,{alignItems:"center",flexWrap:"wrap",children:[null===(i=a||[])||void 0===i?void 0:i.map((function(n){return(0,S.jsx)("div",{style:{paddingBottom:1,marginRight:2,paddingTop:1},children:(0,S.jsx)(ke.Z,{label:n,onClick:r?null:function(t){(0,Be.j)(t);var i=!(null===a||void 0===a||!a.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,S.jsx)(D.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,S.jsx)(V.I8,{default:!0})})]},"".concat(e,"-").concat(u||"types"))}),[g,N,E,v]),ee=(0,f.useMemo)((function(){return null===W||void 0===W?void 0:W.map((function(e){var n,t=e.column,i=e.property,o=v.bookmark_properties,u=v.key_properties,c=v.partition_keys,a=v.replication_method,s=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===G||void 0===G?void 0:G[t],m=null===U||void 0===U?void 0:U[t],b=null===H||void 0===H?void 0:H[t],j=null===z||void 0===z?void 0:z[t],y=[(0,S.jsx)("div",{style:{minHeight:22},children:(0,S.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,S.jsx)(C.ZP,{monospace:!0,children:t},"".concat(t,"-column")),$(t,p)];Y&&y.push((0,S.jsx)(Z.ZP,{alignItems:"center",justifyContent:"center",children:(0,S.jsx)(x.Z,{checked:h,onClick:function(e){(0,Be.j)(e),g((function(e){return(0,de.$C)(Le(Le({},v),{},{unique_constraints:h?(0,Ie.Od)(s||[],(function(e){return e===t})):(0,Ie.Hl)(t,s||[])}),e)}))}})},"".concat(t,"-unique")));var k=[];return Y&&k.push([b,"key_properties",u]),Ce._B.INCREMENTAL===a&&k.push([m,"bookmark_properties",o]),k.push([j,"partition_keys",c]),k.forEach((function(e){var n=(0,r.Z)(e,3),i=n[0],o=n[1],u=n[2];y.push((0,S.jsx)(Z.ZP,{alignItems:"center",justifyContent:"center",children:(0,S.jsx)(x.Z,{checked:i,onClick:function(e){(0,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}))}),[U,H,z,$,W,g,v,Y,G]),ne=(0,f.useCallback)((function(e){var n=null===W||void 0===W?void 0:W[e];return Le(Le({},n),{},{highlighted:!(null===o||void 0===o||!o[null===n||void 0===n?void 0:n.column])})}),[o,W]),te=(0,f.useMemo)((function(){var e;if(B&&_){var n=21*w.iI,t=(null===R||void 0===R||null===(e=R.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,a=r.y,s=void 0===a?0:a,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===_||void 0===_?void 0:_.uuid])||{},f=(0,de.wx)(null===_||void 0===_?void 0:_.uuid,p||{}),h=f||{},m=h.typesDerived,y=void 0===m?[]:m,k=h.uuid;return(0,S.jsx)("div",{onClick:Be.j,style:{left:d,position:"fixed",top:s+w.iI/2,width:n,zIndex:100},children:(0,S.jsxs)(Re.Z,{children:[(0,S.jsx)("div",{style:{position:"relative"},children:(0,S.jsx)(D.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,S.jsx)(j.Z,{default:!0,size:2.5*w.iI,children:(0,S.jsx)(V.x8,{size:1.5*w.iI})})})}),(0,S.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,S.jsx)("div",{style:{marginTop:0===n?0:4},children:(0,S.jsx)(Z.ZP,{alignItems:"center",children:(0,S.jsx)(x.Z,{checked:t,label:e,onClick:function(n){(0,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,_,R,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,S.jsx)(x.Z,{checked:r,onClick:function(e){(0,Be.j)(e),oe([t],!r)}},"".concat(t,"-accept")),(0,S.jsx)(C.ZP,{monospace:!0,children:t},"".concat(t,"-property")),$(t,i,{disableEdit:!0})];return o?l.push($(t,o,{disableEdit:!0,key:"types-current"})):l.push((0,S.jsx)("div",{},"".concat(t,"-empty"))),l}),[$,T,oe]),le=(0,f.useCallback)((function(e,n){var t=n||{},i=t.columnFlex,o=t.columns,r=(null===e||void 0===e?void 0:e.map((function(e){return e.column})))||[],l=null===r||void 0===r?void 0:r.every((function(e){return!(null===T||void 0===T||!T[e])}));return(0,S.jsx)(Ze.Z,{columnFlex:[null,1].concat(i||[]),columns:[{label:function(){return(0,S.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,S.jsxs)(S.Fragment,{children:[(null===u||void 0===u?void 0:u.length)>=1&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Z,{p:w.cd,children:(0,S.jsx)(ue.Z,{level:5,warning:!0,children:"New properties"})}),(0,S.jsx)(y.Z,{light:!0}),le(u,{columnFlex:[1,1],columns:[{uuid:"Types (new)"},{label:function(){return""},uuid:"empty"}]})]}),(null===c||void 0===c?void 0:c.length)>=1&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Z,{p:w.cd,children:(0,S.jsx)(ue.Z,{level:5,warning:!0,children:"Properties with new types"})}),(0,S.jsx)(y.Z,{light:!0}),le(c,{columnFlex:[1,1],columns:[{uuid:"Types (new)"},{uuid:"Types (current)"}]})]})]})}),[ie,le,b]),ae=(0,f.useMemo)((function(){return(0,S.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;a((function(e){return i?(0,je.gR)(e,[t]):Le(Le({},e),{},(0,l.Z)({},t,!0))}))},ref:R,rows:ee,stickyHeader:!0})}),[X,J,ne,R,te,ee,a]);return(0,S.jsxs)(S.Fragment,{children:[p&&ce&&(0,S.jsxs)(O.Z,{my:w.cd,children:[(0,S.jsx)(O.Z,{px:w.cd,children:(0,S.jsx)(Ae.NJ,{children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(k.Z,{children:(0,S.jsx)(V.uy,{size:2*w.iI,warning:!0})}),(0,S.jsx)(O.Z,{mr:w.cd}),(0,S.jsxs)(C.ZP,{muted:!0,children:["The following properties are either new or have different types. Please review and either merge the changes or discard them.",(0,S.jsx)("br",{}),"Click the checkbox to include the updated property when merging changes."]})]})})}),ce,(0,S.jsx)(O.Z,{p:w.cd,children:(0,S.jsxs)(Z.ZP,{children:[(0,S.jsx)(D.ZP,{beforeIcon:(0,S.jsx)(V.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:{}}),s(se.tw.SETTINGS)},primary:!0,children:"Merge changes"}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(D.ZP,{onClick:function(){d({noParents:{},parents:{}}),s(se.tw.SETTINGS)},secondary:!0,children:"Discard changes"})]})})]}),!p&&ae,(0,S.jsx)(O.Z,{pb:w.HN})]})},Ue=["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 ze(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 Ge=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,Ue);return se.tw.OVERVIEW!==o&&o?se.tw.SETTINGS===o||se.tw.STREAM_CONFLICTS===o?(0,S.jsx)(Fe,ze(ze({},u),{},{block:n,showStreamConflicts:se.tw.STREAM_CONFLICTS===o,stream:l})):se.tw.SAMPLE_DATA===o?(0,S.jsx)(ye,{block:n,height:t,pipeline:i,showError:r,stream:l}):(0,S.jsx)(S.Fragment,{}):(0,S.jsx)(De,ze(ze({},u),{},{block:n,stream:l}))},We=t(47041),Ke=t(91437),Ve=8*w.iI,qe=p.default.div.withConfig({displayName:"indexstyle__AfterContentStyle",componentId:"sc-119v89s-0"})(["",""],(function(e){return"\n background-color: ".concat((e.theme.background||_e.Z.background).panel,";\n ")})),Ye=p.default.div.withConfig({displayName:"indexstyle__AfterFooterStyle",componentId:"sc-119v89s-1"})(["",""],(function(e){return"\n background-color: ".concat((e.theme.background||_e.Z.background).panel,";\n ")})),Qe=p.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-119v89s-2"})(["border-radius:","px;position:relative;"," ",""],Se.n_,(function(e){return"\n border: 1px solid ".concat((e.theme.borders||_e.Z.borders).light,";\n background-color: ").concat((e.theme.background||_e.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||_e.Z.borders).light,";\n ")})),Je=p.default.div.withConfig({displayName:"indexstyle__NavigationStyle",componentId:"sc-119v89s-4"})([""," "," ",""],(0,Ke.eR)(),(function(e){return!e.selected&&"\n &:hover {\n background-color: ".concat((e.theme.interactive||_e.Z.interactive).rowHoverBackground,";\n }\n ")}),(function(e){return e.selected&&"\n background-color: ".concat((e.theme.background||_e.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;",""],We.w5,(function(e){return e.borderRight&&"\n border-right: 1px solid ".concat((e.theme.borders||_e.Z.borders).light,";\n ")})),nn=p.default.div.withConfig({displayName:"indexstyle__StreamGridStyle",componentId:"sc-119v89s-7"})(["border-radius:","px;padding:","px;margin:","px;"," "," "," "," ",""],Se.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||_e.Z.borders).light,";\n ")}),(function(e){return e.warning&&!e.selected&&"\n border: 1px solid ".concat((e.theme.accent||_e.Z.accent).warningTransparent,";\n ")}),(function(e){return e.warning&&e.selected&&"\n border: 1px solid ".concat((e.theme.accent||_e.Z.accent).warning,";\n ")}),(function(e){return e.selected&&!e.warning&&"\n background-color: ".concat((e.theme.background||_e.Z.background).panel,";\n border: 1px solid ").concat((e.theme.borders||_e.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||_e.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,a=(e.setSelectedSubTab,e.setStreamsMappingConflicts),s=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)(s||[])}),[s]),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,a=x(c),s=[],d=Object.values((null===a||void 0===a?void 0:a.noParents)||{})||[],p=un(u,d);(null===p||void 0===p?void 0:p.length)>=1&&s.push({streams:(0,Ie.YC)(p||[],de.M$)}),null===(o=Object.entries((null===a||void 0===a?void 0:a.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&&s.push({block:null===t||void 0===t?void 0:t[i],streams:(0,Ie.YC)(l||[],de.M$)})})),(null===s||void 0===s?void 0:s.length)>=1&&e.push({count:(0,Ie.Sm)((null===s||void 0===s?void 0:s.map((function(e){var n=e.streams;return(null===n||void 0===n?void 0:n.length)||0})))||[]),label:l,subgroups:s,uuid:c})})),e}),[x,u]),P=(0,f.useMemo)((function(){return(null===j||void 0===j?void 0:j.length)||0}),[j]);return(0,S.jsx)(S.Fragment,{children:null===j||void 0===j?void 0:j.map((function(e,n){var t=e.count,r=e.label,l=e.subgroups,u=e.uuid,s=on.uuid===u;return(0,S.jsx)($e,{style:{height:i,right:rn.uuid===u?null:0,width:p/P},children:(0,S.jsx)(en,{borderRight:P>=2&&!s,style:{height:i,width:p/P},children:(0,S.jsxs)(O.Z,{pt:w.cd,children:[(0,S.jsx)(O.Z,{px:w.Mq,children:(0,S.jsx)(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,S.jsxs)(O.Z,{mt:i&&0===n?w.cd:1,children:[(0,S.jsx)(O.Z,{mb:i?w.cd:0,mt:i?0:w.cd,children:(0,S.jsx)(y.Z,{light:!0})}),i&&(0,S.jsx)(O.Z,{px:w.cd,children:(0,S.jsx)(C.ZP,{bold:!0,color:null===(t=(0,_.qn)(null===i||void 0===i?void 0:i.type,{blockColor:null===i||void 0===i?void 0:i.color}))||void 0===t?void 0:t.accent,default:!0,large:!0,monospace:!0,children:null===i||void 0===i?void 0:i.uuid})}),(0,S.jsx)(O.Z,{p:1,children:(0,S.jsx)(Z.ZP,{alignItems:"center",flexWrap:"wrap",children:null===r||void 0===r?void 0:r.map((function(e){var n=g(e),t=!!b(e),i=(0,de.M$)(e),r=(0,de.Qu)(e),l=!1;if(s){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,S.jsx)(nn,{onClick:s&&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&&s,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",fullHeight:!0,justifyContent:"space-between",children:[(0,S.jsx)(k.Z,{flex:1,children:(0,S.jsx)(C.ZP,{monospace:!0,muted:!l,children:i})}),p&&s&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(C.ZP,{monospace:!0,warning:!0,children:"exists"})]}),p&&s&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(k.Z,{alignItems:"center",style:{minHeight:3*w.iI},children:(0,S.jsx)(D.ZP,{compact:!0,onClick:function(){a((function(n){return(0,de.UA)([e],n)})),c((function(e){return{selectedMainNavigationTab:i,selectedMainNavigationTabSub:r,selectedSubTab:se.tw.STREAM_CONFLICTS}}))},small:!0,warning:!0,children:"View differences"})})]}),(!p||!s)&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Z,{mr:w.HN}),l&&(0,S.jsx)(V.Zr,{size:2*w.iI}),(0,S.jsx)(O.Z,{mr:l?1:3}),(0,S.jsx)(k.Z,{alignItems:"center",style:{height:3*w.iI},children:(0,S.jsx)(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 an(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 sn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?an(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):an(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,a=(0,f.useCallback)((function(e,n){var i,r=e.inputType,u=e.label,a=e.options,s=e.uuid,d=null===t||void 0===t?void 0:t[s],p=!(null===d||void 0===d||!d.selected),f=null===d||void 0===d?void 0:d.value;return se.oI.CHECKBOX===r?i=(0,S.jsx)(x.Z,{checked:!!f,onClick:function(e){p&&(0,Be.j)(e),c((function(e){return sn(sn({},e),{},(0,l.Z)({},s,sn(sn({},null===e||void 0===e?void 0:e[s]),{},{value:!f})))}))}}):se.oI.SELECT===r?i=(0,S.jsxs)(z.Z,{compact:!0,fullWidth:!0,onChange:function(e){(0,Be.j)(e),c((function(n){var t;return sn(sn({},n),{},(0,l.Z)({},s,sn(sn({},null===n||void 0===n?void 0:n[s]),{},{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,S.jsx)("option",{value:""}),null===a||void 0===a?void 0:a.map((function(e){var n=e.disabled,t=e.label,i=e.value;return(0,S.jsx)("option",{disabled:n,value:i,children:t?t():i},i)}))]}):se.oI.TOGGLE===r&&(i=(0,S.jsx)(Pe.Z,{checked:f,compact:!0,onCheck:function(e){c((function(n){return sn(sn({},n),{},(0,l.Z)({},s,sn(sn({},null===n||void 0===n?void 0:n[s]),{},{value:e(f)})))}))},pauseEvent:p})),[(0,S.jsx)(x.Z,{checked:p,onClick:function(e){(0,Be.j)(e),c((function(e){return sn(sn({},e),{},(0,l.Z)({},s,sn(sn({},null===e||void 0===e?void 0:e[s]),{},{selected:!p})))}))}},"".concat(s,"-checkbox")),(0,S.jsx)(C.ZP,{muted:!p,children:u()},"".concat(s,"-name")),(0,S.jsx)(Z.ZP,{alignItems:"center",justifyContent:null!==o&&void 0!==o&&o.includes(n)?"flex-end":"center",children:i},"".concat(s,"-value"))]}),[t,o,c]);return(0,f.useMemo)((function(){return(0,S.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 sn(sn({},e),{},(0,l.Z)({},o,sn(sn({},null===e||void 0===e?void 0:e[o]),{},{selected:!u})))}))},rowGroupHeaders:r,rowsGroupedByIndex:u,rows:n.map((function(e,n){return a(e,n)}))})}),[n,t,i,a])};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 a=[];null===c||void 0===c||c.forEach((function(e){r.push(e),a.push(l),l+=1;var i=(0,de.WD)(e),o=(0,de.M$)(e),u=!!(0,de.zB)(e,n),c=[(0,S.jsx)(x.Z,{checked:u},"".concat(i,"-").concat(o,"-use")),(0,S.jsx)(C.ZP,{muted:!u,children:o},"".concat(i,"-").concat(o,"-stream"))];t.push(c)})),i.push(a)})),{rowGroupHeaders:e,rows:t,rowsGroupedByIndex:i,streamsArray:r}}),[n,o]),l=r.rowGroupHeaders,u=r.rows,c=r.rowsGroupedByIndex,a=r.streamsArray,s=(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,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Z,{p:w.cd,children:(0,S.jsxs)("div",{children:[(0,S.jsxs)(ue.Z,{children:[(0,J._6)("stream",s||0)," chosen"]}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsx)(C.ZP,{default:!0,children:"Clicking the Apply button below will use the values from the selected properties below and change the values of those properties in all the selected columns for all the selected streams."})})]})}),(0,S.jsx)(Ze.Z,{columnFlex:[null,1],columns:[{uuid:"Use"},{uuid:"Stream"}],groupsInline:!0,onClickRow:function(e){var i=null===a||void 0===a?void 0:a[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,S.jsx)(dn,{attributes:[{label:function(){return"Replication method"},inputType:se.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:se.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:se.oI.TOGGLE,uuid:de.I1.RUN_IN_PARALLEL},{label:function(){return"Automatically add new columns"},inputType:se.oI.TOGGLE,uuid:de.I1.AUTO_ADD_NEW_FIELDS},{label:function(){return"Disable strict column type checks"},inputType:se.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,S.jsx)(pn,{selectedStreamMapping:t,setSelectedStreamMapping:o,streamMapping:r})}),[t,o,r]);return(0,S.jsxs)(tn,{children:[(0,S.jsx)(O.Z,{p:w.cd,children:(0,S.jsxs)("div",{children:[(0,S.jsx)(ue.Z,{children:"Make changes to multiple streams"}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsx)(C.ZP,{default:!0,children:"Clicking the Apply button below will use the values from the attributes below and change the values of those attributes for all the selected streams."})})]})}),l,u]})};function 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,a=e.selectedStreamMapping,s=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&&!a){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:{}})}}),[a,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:se.oI.CHECKBOX,uuid:de.I1.PROPERTY_SELECTED},{label:function(){return"Partition key"},inputType:se.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:se.oI.CHECKBOX,uuid:e}}))));b&&e.splice(1,0,{label:function(){return"Bookmark property"},inputType:se.oI.CHECKBOX,uuid:de.I1.BOOKMARK_PROPERTIES}),g&&e.splice(1,0,{label:function(){return"Unique constraint"},inputType:se.oI.CHECKBOX,uuid:de.I1.UNIQUE_CONSTRAINTS},{label:function(){return"Key property"},inputType:se.oI.CHECKBOX,uuid:de.I1.KEY_PROPERTIES});var n=2;b&&(n+=1),g&&(n+=2);var t=(0,Ie.m5)(n);return(0,S.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:s})}),[i,s,g,b]),j=(0,f.useMemo)((function(){return(0,S.jsx)(pn,{selectedStreamMapping:a,setSelectedStreamMapping:p,streamMapping:h})}),[a,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,S.jsxs)(tn,{children:[(0,S.jsxs)(O.Z,{p:w.cd,children:[(0,S.jsxs)("div",{children:[(0,S.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,S.jsx)(O.Z,{mt:1,children:(0,S.jsxs)(C.ZP,{default:!0,children:[!(null!==y&&void 0!==y&&y.length)&&"Click 1 or more rows in the table to select which schema properties to apply bulk changes to.",(null===y||void 0===y?void 0:y.length)>=1&&(0,S.jsx)(S.Fragment,{children:"Clicking the Apply button below will use the values from the selected properties below and change the values of those properties in all the selected columns for all the selected streams."})]})})]}),(null===y||void 0===y?void 0:y.length)>=1&&(0,S.jsx)(O.Z,{mt:w.cd,children:(0,S.jsx)(Z.ZP,{alignItems:"center",flexWrap:"wrap",children:null===y||void 0===y?void 0:y.map((function(e){return(0,S.jsx)("div",{style:{marginBottom:w.iI/2,marginRight:w.iI/2},children:(0,S.jsx)(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,a=e.updateStreamsInCatalog,s=(0,f.useRef)(null),d=(0,f.useState)({}),p=d[0],v=d[1],h=(0,f.useCallback)((function(e){return a(e,(function(e){return null===i||void 0===i?void 0:i(e)}))}),[i,a]),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,S.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,D=(0,f.useMemo)((function(){var e=[],n=[],i=[],o=[],u=0;return null===E||void 0===E||E.forEach((function(c){var a=c.groupHeader,d=c.streams,g=a?null===t||void 0===t?void 0:t[a]:null;g?n.push((0,S.jsx)(O.Z,{p:w.cd,children:(0,S.jsx)(C.ZP,{bold:!0,color:(0,_.qn)(null===g||void 0===g?void 0:g.type,{blockColor:null===g||void 0===g?void 0:g.color}).accent,monospace:!0,children:a})})):n.push(a);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),a=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,_=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,S.jsx)(Pe.Z,{checked:E,compact:!0,onCheck:function(e){h([(0,de.XE)(n,{selected:e(E)})])}},"".concat(t,"-action")),(0,S.jsx)(P.Z,{bold:!0,monospace:!0,onClick:function(){r(c,o)},preventDefault:!0,sameColorAsText:!0,children:c},"".concat(t,"-name")),(0,S.jsx)(W.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(s.current),s.current=setTimeout((function(){return h([bn(bn({},n),{},{destination_table:o})])}),300)},onClick:Be.j,placeholder:c,value:I||""},"".concat(t,"-destinationTable")),(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(k.Z,{flex:1,children:(0,S.jsx)(z.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,S.jsx)("option",{value:e,children:(0,J.vg)(e)},e)}))}))}),Ce._B.INCREMENTAL===y&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Z,{mr:1}),!(null!==d&&void 0!==d&&d.length)&&(0,S.jsx)(C.ZP,{danger:!0,xsmall:!0,children:"No bookmark properties set"}),(null===d||void 0===d?void 0:d.length)>=1&&(null===d||void 0===d?void 0:d.map((function(e,n){return(0,S.jsxs)(C.ZP,{inline:!0,monospace:!0,muted:!0,xsmall:!0,children:[n>=1&&", ",e]},e)})))]})]},"".concat(t,"-replicationMethod")),(0,f.createElement)(z.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:_}),Object.values(Ce.MU).map((function(e){return(0,S.jsx)("option",{value:e,children:(0,J.vg)(e)},e)}))),(0,S.jsx)(Z.ZP,{alignItems:"center",justifyContent:b.tf.DATA_EXPORTER===m?"center":"flex-end",children:(0,S.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,S.jsx)(Z.ZP,{alignItems:"center",justifyContent:"center",children:(0,S.jsx)(Pe.Z,{checked:!!a,compact:!0,onCheck:function(e){h([bn(bn({},n),{},{auto_add_new_fields:e(a)})])}})},"".concat(t,"-autoAddNewFields")),(0,S.jsx)(Z.ZP,{alignItems:"center",justifyContent:"center",children:(0,S.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,s,h]),R=D.rowGroupHeaders,A=D.rows,B=D.rowsGroupedByIndex,N=D.streamsInRows;return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(O.Z,{p:w.cd,children:[(0,S.jsx)(ue.Z,{children:"Overview of streams"}),y&&(0,S.jsxs)(O.Z,{mt:1,children:[(0,S.jsx)(C.ZP,{default:!0,children:"Fetch and add at least 1 stream to the catalog in order to see an overview of all the configured stream."}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsx)(P.Z,{bold:!0,onClick:function(){return r(se.uK.STREAMS)},preventDefault:!0,children:"Go and fetch Streams"})})]})]}),!y&&(0,S.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:R,rows:A,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,a=void 0===c?null:c,s=e.defaultSubTab,d=void 0===s?null:s,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),A=(0,f.useRef)(null),B=(0,f.useRef)(null),N=(0,f.useRef)(null),L=(0,f.useState)({}),F=L[0],U=L[1],H=(0,f.useState)(null),z=H[0],q=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,ae=t||{},pe=(ae.catalog,ae.content),fe=(ae.language,ae.type),ge=ae.uuid,be=(0,f.useMemo)((function(){return b.tf.DATA_LOADER===fe?Y.O.SOURCES:Y.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]),_e=we.destination,Se=we.name,Ee=we.source,Te=(0,f.useMemo)((function(){return _e||Ee||null}),[_e,Ee]),Me=(0,f.useMemo)((function(){var e={include_block_catalog:!0,include_block_metadata:!0,include_documentation:!0};return Te&&(e.data_integration_uuid=Te),e}),[Te]),De=K.ZP.blocks.pipelines.detail(ce,ge,Me,{},{key:"pipelines/".concat(ce,"/blocks/").concat(ge,"/documentation")}).data,Re=(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]),Ae=(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 Ae((function(n){return On(On({},n),{},{inputs:e((null===n||void 0===n?void 0:n.inputs)||{})})}))}),[Ae]),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===De||void 0===De?void 0:De.block}),[De]);(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 Fe=(0,f.useMemo)((function(){return(0,Ie.HK)(le||[],(function(e){return e.uuid}))}),[le]),Ue=(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===Fe||void 0===Fe?void 0:Fe[e]}))}),[ye,Fe]),He=(0,f.useMemo)((function(){return null===Le||void 0===Le?void 0:Le.documentation}),[Le]),ze=(0,f.useMemo)((function(){return(0,de.Uc)(ye,{getAll:!0})}),[ye]),We=(0,f.useMemo)((function(){return(0,de.UA)(ze)}),[ze]),Ke=(0,f.useMemo)((function(){return"DataIntegrationModal/".concat(ge)}),[ge]),$e=(0,f.useMemo)((function(){return"block_layout_after_width_".concat(Ke)}),[Ke]),en=(0,f.useMemo)((function(){return"block_layout_before_width_".concat(Ke)}),[Ke]),nn=(0,ee.VI)(null,{},[],{uuid:Ke}),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),an=un[0],sn=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],_n=(0,f.useState)({selectedMainNavigationTab:null,selectedMainNavigationTabSub:a,selectedSubTab:null}),Sn=_n[0],En=Sn.selectedMainNavigationTab,In=Sn.selectedMainNavigationTabSub,Tn=Sn.selectedSubTab,Mn=_n[1],Dn=(0,f.useState)((0,de.UA)([])),Rn=Dn[0],An=Dn[1],Bn=(0,f.useMemo)((function(){if(!(0,je.Qr)(null===Rn||void 0===Rn?void 0:Rn.noParents)||!(0,je.Qr)(null===Rn||void 0===Rn?void 0:Rn.parents)){var e,n,t,i;if(En)if(In)e=null===Rn||void 0===Rn||null===(n=Rn.parents)||void 0===n||null===(t=n[En])||void 0===t?void 0:t[In];else e=null===Rn||void 0===Rn||null===(i=Rn.noParents)||void 0===i?void 0:i[En];return(0,se.C0)({addStreamConflicts:!!e})}return(0,se.C0)()}),[En,In,Rn]),Nn=(0,f.useCallback)((function(e){return e in se.Pf?se.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,a=i in se.Pf?se.Pf[i]:Bn,s=r;if(se.mU[i]||se.mU[u]){var d,p,f;if(s){if(se.mU[u]&&!se.mU[i]){var v;!s||null!==Bn&&void 0!==Bn&&Bn.includes(s)||se.tw.STREAM_CONFLICTS===s||(s=null===Bn||void 0===Bn||null===(v=Bn[0])||void 0===v?void 0:v.uuid)}}else s=null===a||void 0===a||null===(f=a[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},We),m=(0,de.zB)({parent_stream:o,stream:i,tap_stream_id:i},We),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:s}}(e(n),n)}))}),[wn,We,Bn]);(0,f.useEffect)((function(){En||Ln((function(e){var n,t,i=e.selectedSubTab;return{selectedMainNavigationTab:u||se.uK.CONFIGURATION,selectedMainNavigationTabSub:a,selectedSubTab:u?d||(null===(n=Nn(u))||void 0===n||null===(t=n[0])||void 0===t?void 0:t.uuid):i}}))}),[u,a,d,Nn,En,Ln]);var Fn=(0,f.useMemo)((function(){return Nn(En)}),[Nn,En]),Un=(0,f.useMemo)((function(){var e=[{Icon:V.JG,uuid:se.uK.CONFIGURATION},{Icon:V.kO,uuid:se.uK.STREAMS},{Icon:V.iA,uuid:se.uK.OVERVIEW}].map((function(e){var n=e.Icon,t=e.uuid;return(0,S.jsx)(Je,{selected:En===t,children:(0,S.jsx)(P.Z,{block:!0,noHoverUnderline:!0,noOutline:!0,onClick:function(){return Ln((function(){return{selectedMainNavigationTab:t}}))},preventDefault:!0,children:(0,S.jsx)(O.Z,{p:w.cd,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(j.Z,{primaryLight:!0,size:4*w.iI,square:!0,children:(0,S.jsx)(n,{size:2*w.iI})}),(0,S.jsx)(O.Z,{mr:2}),(0,S.jsx)(C.ZP,{bold:!0,large:!0,children:se.TD[t]})]})})})},t)})),n=(null===ze||void 0===ze?void 0:ze.length)||0,t=[],i={};return null===ze||void 0===ze||ze.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===Fe||void 0===Fe?void 0:Fe[t],streams:i}})))).forEach((function(t){var i=t.block,o=t.streams;if(i){var r=null===i||void 0===i?void 0:i.uuid;e.push((0,S.jsx)(y.Z,{light:!0},"block-".concat(r,"-divider-top"))),e.push((0,S.jsx)(O.Z,{px:w.cd,py:1,children:(0,S.jsx)(C.ZP,{bold:!0,color:(0,_.qn)(null===i||void 0===i?void 0:i.type,{blockColor:null===i||void 0===i?void 0:i.color}).accent,monospace:!0,small:!0,children:r})},"block-".concat(r)))}null===o||void 0===o||o.forEach((function(t,i){var o=(0,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,S.jsx)(y.Z,{light:!0},"".concat(l,"-divider-top"))),e.push((0,S.jsx)(Je,{selected:c,children:(0,S.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,S.jsx)(O.Z,{p:w.cd,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(j.Z,{size:1*w.iI,success:u}),(0,S.jsx)(O.Z,{mr:2}),(0,S.jsx)(k.Z,{flex:1,children:(0,S.jsx)(C.ZP,{default:!u,monospace:!0,children:o})})]})})})},l)),i===n-1&&e.push((0,S.jsx)(y.Z,{light:!0},"".concat(l,"-divider-last")))}))})),e}),[Fe,En,In,Ln,ze]),Hn=(0,f.useState)(null),zn=Hn[0],Gn=Hn[1],Wn=(0,f.useMemo)((function(){return(0,de.qf)(We,(0,de.UA)(zn||[]))}),[We,zn]),Kn=(0,v.Db)(K.ZP.integration_sources.useUpdate(ce),{onSuccess:function(e){return(0,$.wD)(e,{callback:function(e){var n=e.integration_source.streams;Gn(n)},onErrorCallback:function(e,n){return tn({errors:n,response:e})}})}}),Vn=(0,r.Z)(Kn,2),qn=Vn[0],Yn=Vn[1].isLoading,Qn=(0,f.useCallback)((function(){return qn({integration_source:{block_uuid:ge}})}),[ge,qn]),Xn=(0,f.useState)(null),Jn=Xn[0],$n=Xn[1],et=(0,f.useMemo)((function(){return(0,S.jsxs)("div",{ref:N,children:[(null===Fn||void 0===Fn?void 0:Fn.length)>=1&&(0,S.jsx)(O.Z,{p:w.cd,children:(0,S.jsx)(R.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:Fn})}),!(null!==Fn&&void 0!==Fn&&Fn.length)&&se.uK.STREAMS===En&&(0,S.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsx)(k.Z,{flex:1,children:(0,S.jsx)(W.Z,{beforeIcon:(0,S.jsx)(V.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,S.jsx)(D.ZP,{iconOnly:!0,noPadding:!0,noBackground:!0,noBorder:!0,onClick:function(){return $n(null)},children:(0,S.jsx)(V.x8,{default:!0,size:2*w.iI})}),!Wn&&(0,S.jsx)(O.Z,{px:w.cd,children:(0,S.jsx)(D.ZP,{beforeIcon:(0,S.jsx)(V.rH,{size:2*w.iI}),compact:!0,loading:Yn,onClick:function(){return Qn()},primary:!0,children:"Fetch streams"})})]}),(0,S.jsx)(y.Z,{light:!0})]})}),[Qn,Yn,Wn,N,Jn,En,Tn,$n,Ln,Fn]),nt=(0,f.useMemo)((function(){return te-2*Ve}),[te]),tt=(0,f.useMemo)((function(){return ie-2*Ve}),[ie]),it=(0,f.useState)(null),ot=it[0],rt=it[1],lt=(0,f.useState)(null),ut=lt[0],ct=lt[1],at=(0,f.useState)(null),st=(at[0],at[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),st(null===A||void 0===A||null===(t=A.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,A,N,En,Tn]);var vt=(0,v.Db)(K.ZP.blocks.pipelines.useUpdate(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&&![se.uK.CONFIGURATION,se.uK.OVERVIEW,se.uK.STREAMS,se.uK.SYNC].includes(En)}),[En])),gt=(0,f.useMemo)((function(){return mt&&se.tw.SETTINGS===Tn}),[mt,Tn]),bt=(0,f.useMemo)((function(){return se.uK.CONFIGURATION===En&&se.tw.CREDENTIALS===Tn}),[En,Tn]),xt=(0,f.useMemo)((function(){return se.uK.OVERVIEW===En}),[En]),jt=(0,f.useMemo)((function(){return!(bt||gt||xt&&(null===ze||void 0===ze?void 0:ze.length)>=1)||pt}),[pt,bt,gt,xt,ze]),yt=(0,f.useMemo)((function(){var e=(0,de.zB)({parent_stream:In,stream:En,tap_stream_id:En},We);if(e)return(0,S.jsx)(Ge,{block:ye,blocksMapping:Fe,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:An,showError:tn,stream:e,streamMapping:We,streamsMappingConflicts:Rn,updateStreamsInCatalog:Ne})}),[ye,Fe,ot,nt,Pn,p,E,En,In,Tn,ke,wn,Ln,An,tn,We,Rn,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],_t=(0,f.useMemo)((function(){return(0,S.jsx)(ve,{block:ye,blockConfigString:Ct,blockContent:Zt,blockUpstreamBlocks:Ue,dataIntegrationConfiguration:Re,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,Ue,Re,h,E,I,wt,Pt,T,Ln,tn]),St=(0,f.useMemo)((function(){if(se.uK.CONFIGURATION===En){if(se.tw.UPSTREAM_BLOCK_SETTINGS===Tn){var e=null===Ue||void 0===Ue?void 0:Ue.map((function(e){var n,t,i=e.uuid,o=null===Re||void 0===Re||null===(n=Re.inputs)||void 0===n?void 0:n[i],r=(null===o||void 0===o?void 0:o.streams)||[],u=!!o,c=null===Fe||void 0===Fe?void 0:Fe[i],a=(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],s=1===(null===a||void 0===a?void 0:a.length)&&(null===a||void 0===a?void 0:a.includes(i));return(0,S.jsxs)("div",{children:[(0,S.jsxs)(O.Z,{p:w.cd,children:[(0,S.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsx)(k.Z,{children:(0,S.jsx)(C.ZP,{bold:!0,large:!0,monospace:!0,muted:!u,children:i})}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(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,S.jsx)(O.Z,{mt:w.cd,children:(0,S.jsxs)(me.Z,{noBackground:!0,noBoxShadow:!0,sameColorBorders:!0,children:[(0,S.jsx)(me.g,{noBorder:!0,children:(0,S.jsxs)(Z.ZP,On(On({},Z.A0),{},{children:[(0,S.jsxs)(k.Z,{flexDirection:"column",children:[(0,S.jsx)(C.ZP,{bold:!0,default:!0,children:"Use catalog as an input"}),(0,S.jsx)(C.ZP,{muted:!0,small:!0,children:"If checked, then this block\u2019s catalog will be included as part of the input argument(s) for the current block."})]}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(x.Z,{checked:null===o||void 0===o?void 0:o.catalog,onClick:function(){return 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)})))}))}})]}))}),s&&(0,S.jsx)(me.g,{noBorder:!0,children:(0,S.jsxs)(Z.ZP,On(On({},Z.A0),{},{children:[(0,S.jsxs)(k.Z,{flexDirection:"column",children:[(0,S.jsx)(C.ZP,{bold:!0,default:!0,children:"Use the block\u2019s output data as an input"}),(0,S.jsx)(C.ZP,{muted:!0,small:!0,children:"Include this block\u2019s output data as an input."})]}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(x.Z,{checked:null===r||void 0===r?void 0:r.includes(i),monospace:!0,onClick:function(){return 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})]}))}),!s&&(0,S.jsxs)(me.g,{noBorder:!0,children:[(0,S.jsxs)(Z.ZP,On(On({},Z.A0),{},{children:[(0,S.jsxs)(k.Z,{flexDirection:"column",children:[(0,S.jsx)(C.ZP,{bold:!0,default:!0,children:"Select which stream\u2019s data to use as an input"}),(0,S.jsxs)(C.ZP,{muted:!0,small:!0,children:["Only the output data from the selected streams will be used as an input.",(0,S.jsx)("br",{}),"If none are selected, then no output data from any stream from this block will be used as in input.",(0,S.jsx)("br",{}),"If you don\u2019t see a stream here, then the upstream block may have unselected the stream in its stream settings."]})]}),(0,S.jsx)(O.Z,{mr:3})]})),null===a||void 0===a?void 0:a.map((function(e){var n=null===r||void 0===r?void 0:r.includes(e);return(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsxs)(Z.ZP,On(On({},Z.A0),{},{children:[(0,S.jsx)(k.Z,{children:(0,S.jsx)(C.ZP,{default:!0,monospace:!0,small:!0,children:e})}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(x.Z,{checked:n,onClick:function(){return 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,S.jsx)(me.g,{noBorder:!0,children:(0,S.jsxs)(Z.ZP,On(On({},Z.A0),{},{children:[(0,S.jsxs)(k.Z,{flexDirection:"column",children:[(0,S.jsx)(C.ZP,{bold:!0,default:!0,children:"Only use this block\u2019s output data as an input"}),(0,S.jsxs)(C.ZP,{muted:!0,small:!0,children:["If checked, then this block\u2019s output data is only used as inputs.",b.tf.DATA_EXPORTER===fe&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)("br",{}),"The block\u2019s output data won\u2019t be ingested when running a sync, regardless if it\u2019s enabled in the settings."]})]})]}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(x.Z,{checked:!(null===o||void 0===o||!o.input_only),onClick:function(){return 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,S.jsx)(y.Z,{light:!0})]},i)}));return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(O.Z,{p:w.cd,children:[(0,S.jsx)(ue.Z,{children:"Inputs"}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsxs)(C.ZP,{default:!0,children:["Choose which upstream block to use as inputs when interpolating data into ",(0,S.jsx)(C.ZP,{inline:!0,monospace:!0,children:ge}),"\u2019s (current block) credentials (aka config) and decorated functions."]})}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsxs)(C.ZP,{default:!0,children:["If ",(0,S.jsx)(C.ZP,{inline:!0,monospace:!0,children: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."]})}),Y.O.DESTINATIONS===be&&(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsxs)(C.ZP,{default:!0,children:["Upstream blocks can still be selected to have its data ingested. This is toggled and configured in the ",(0,S.jsx)(P.Z,{bold:!0,onClick:function(){return Ln((function(){return{selectedMainNavigationTab:se.uK.STREAMS}}))},preventDefault:!0,primary:!0,children:"Streams"})," section."]})})]}),(0,S.jsx)(y.Z,{light:!0}),e]})}}else{if(se.uK.STREAMS===En&&Wn)return(0,S.jsxs)(O.Z,{p:w.cd,children:[(0,S.jsxs)(O.Z,{mb:w.cd,children:[(0,S.jsx)(ue.Z,{children:"Fetch streams to start set up"}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsxs)(C.ZP,{default:!0,children:["Add streams and configure them by first fetching the available streams from ",Te,"."]})})]}),(0,S.jsx)(D.ZP,{beforeIcon:(0,S.jsx)(V.rH,{size:2*w.iI}),large:!0,loading:Yn,onClick:function(){return Qn()},primary:!0,children:"Fetch streams"})]});if(se.uK.SYNC===En)return(0,S.jsx)(O.Z,{p:w.cd,children:(0,S.jsx)(C.ZP,{children:"Coming soon"})});if(se.uK.OVERVIEW===En)return(0,S.jsx)(jn,{block:ye,blocksMapping:Fe,onChangeBlock:p,selectedStreamMapping:z,setSelectedMainNavigationTab:function(e){return Ln((function(n){return{selectedMainNavigationTab:e}}))},setSelectedStreamMapping:q,streamMapping:We,updateStreamsInCatalog:Ne})}}),[ye,fe,ge,Ue,Fe,Re,be,Te,Qn,Yn,Wn,p,En,z,Tn,Be,Ln,q,We,Ne]),Et=(0,f.useMemo)((function(){return bt?(0,S.jsx)(C.ZP,{bold:!0,children:"Documentation"}):gt?(0,S.jsx)(C.ZP,{bold:!0,children:"Bulk edit stream properties"}):xt?(0,S.jsx)(C.ZP,{bold:!0,children:"Bulk edit streams"}):void 0}),[bt,gt,xt]),It=(0,f.useMemo)((function(){if(gt||xt)return(0,S.jsx)(Ye,{ref:B,children:(0,S.jsxs)(O.Z,{p:w.cd,children:[(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsx)(x.Z,{checked:X,label:"Clear selection and values after applying changes",onClick:function(){return J((function(e){return!e}))}})}),(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(D.ZP,{fullWidth:!0,onClick:function(){var e={noParents:{},parents:{}};gt?e=(0,de.Kq)(z,Pn,F):xt&&(e=(0,de.bX)(z,F)),Ne((0,de.eH)(e),(function(e){return null===p||void 0===p?void 0:p(e)})),X&&(U({}),wn({}),q(null))},primary:!0,children:"Apply bulk changes"}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(D.ZP,{fullWidth:!0,onClick:function(){U({}),wn({}),q(null)},secondary:!0,children:"Clear"})]})]})})}),[F,X,Pn,gt,xt,p,B,z,U,wn,q,Ne]),Tt=(0,f.useMemo)((function(){if(bt)return(0,S.jsx)(qe,{children:(0,S.jsxs)(O.Z,{p:w.cd,children:[!De&&(0,S.jsx)(G.Z,{}),He&&(0,S.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},We);return(0,S.jsx)(mn,{attributesMapping:F,block:ye,blocksMapping:Fe,highlightedColumnsMapping:Pn,selectedStreamMapping:z,setAttributesMapping:U,setHighlightedColumnsMapping:wn,setSelectedStreamMapping:q,stream:e,streamMapping:We,updateStreamsInCatalog:Ne})}return xt?(0,S.jsx)(fn,{attributesMapping:F,selectedStreamMapping:z,setAttributesMapping:U,setSelectedStreamMapping:q,streamMapping:We}):void 0}),[F,ye,Fe,De,He,Pn,bt,gt,xt,En,In,z,We,Ne]),Mt=(0,f.useMemo)((function(){var e=[{label:function(){return ge}}];return Se&&e.push({bold:!En,label:function(){return Se}}),En&&e.push({bold:!0,label:function(){return se.TD[En]||En}}),(0,S.jsx)(oe.Z,{breadcrumbs:e,noMarginLeft:!0})}),[ge,Se,En]),Dt=(0,f.useMemo)((function(){return(te-nt-Cn)/2}),[nt,te]),Rt=(0,f.useMemo)((function(){return(0,S.jsx)(cn,{block:ye,blocksMapping:Fe,height:nt-ot,onChangeBlock:p,searchText:Jn,setSelectedMainNavigationTab:Ln,setSelectedSubTab:function(e){return Ln((function(n){return On(On({},n),{},{selectedSubTab:e})}))},setStreamsMappingConflicts:An,streamsFetched:zn,updateStreamsInCatalog:Ne,width:tt-(pn+(jt?0:rn))})}),[jt,rn,pn,ye,Fe,ot,nt,p,Jn,Ln,An,zn,Ne,tt]);return(0,S.jsxs)(Qe,{maxWidth:tt,children:[(0,S.jsx)(Xe,{children:(0,S.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsx)(k.Z,{children:Mt}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(P.Z,{href:"https://docs.mage.ai",inline:!0,noOutline:!0,openNewWindow:!0,children:(0,S.jsx)(V.$l,{default:!0,size:2*w.iI})}),(0,S.jsx)(O.Z,{mr:2}),m&&(0,S.jsx)(D.ZP,{iconOnly:!0,noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){null===m||void 0===m||m()},children:(0,S.jsx)(V.x8,{default:!0,size:2*w.iI})})]})]})}),(0,S.jsxs)(yn.Z,{after:Tt,afterFooter:It,afterFooterBottomOffset:Dt,afterHeader:(0,S.jsx)(O.Z,{px:1,ref:A,children:Et}),afterHeaderOffset:0,afterHeightOffset:0,afterHidden:jt,afterInnerHeightMinus:48+(It&&ut||0),afterMousedownActive:an,afterWidth:rn,before:Un,beforeHeightOffset:0,beforeMousedownActive:gn,beforeWidth:pn,contained:!0,headerOffset:ot,height:nt,hideAfterCompletely:!Tt||xt&&!(null!==ze&&void 0!==ze&&ze.length),inline:!0,mainContainerHeader:et,mainContainerRef:M,setAfterHidden:ft,setAfterMousedownActive:sn,setAfterWidth:ln,setBeforeMousedownActive:bn,setBeforeWidth:vn,uuid:Ke,children:[mt&&yt,!mt&&St,se.uK.CONFIGURATION===En&&se.tw.CREDENTIALS===Tn&&_t,se.uK.STREAMS===En&&!Wn&&Rt]})]})},_n=t(10553),Sn=t(29618),En=t(50724),In=t(70374),Tn=t(72098),Mn=t(77417),Dn=t(39643),Rn=t(87848),An=t(58325),Bn=t(44688);function Nn(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 Ln(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Nn(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Nn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Fn=1.5*w.iI;var Un=function(e){var n=e.cancelPipeline,t=e.children,i=e.createPipeline,o=e.executePipeline,r=e.interruptKernel,u=e.isPipelineExecuting,c=e.kernel,a=e.pipeline,s=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),_=(0,f.useRef)(null),E=(0,f.useRef)(null),I=(0,Mn.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,An.V5)()?Dn.RJ:Dn.hE,Dn.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:[[Dn.kA],[Dn.kA]],onClick:function(){return r()},uuid:"Interrupt kernel"},{label:function(){return"Restart kernel"},keyTextGroups:[[Dn.t_[Dn.OC]],[Dn.t_[Dn.OC]]],onClick:function(){return s()},uuid:"Restart kernel"},{label:function(){return"Clear all outputs"},onClick:function(){return v((function(e){return Object.keys(e).reduce((function(e,n){return Ln(Ln({},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===a||void 0===a?void 0:a.type)===H.qL.STREAMING&&e.push({label:function(){return"Execute pipeline"},onClick:function(){return o()},uuid:"Execute pipeline"}),e}),[n,o,r,u,null===a||void 0===a?void 0:a.type,s,v]),A=(0,f.useMemo)((function(){return[{label:function(){return"Pipeline settings"},linkProps:{as:"/pipelines/".concat(null===a||void 0===a?void 0:a.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"}]}),[a]),B=(0,f.useMemo)((function(){return[{label:function(){return(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(V.vR,{success:!g}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(C.ZP,{noWrapping:!0,children:"Show output below block"})]})},onClick:function(){m(!1)},uuid:"Show output next to code"},{label:function(){return(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(V.lx,{success:g}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(C.ZP,{noWrapping:!0,children:"Show output next to code (beta)"})]})},onClick:function(){m(!0)},uuid:"Show output next to code"},{disabled:!g,label:function(){return(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[p?(0,S.jsx)(V.Jr,{}):(0,S.jsx)("div",{style:{width:Fn}}),(0,S.jsx)(O.Z,{mr:1}),(0,S.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]),N=(0,f.useMemo)((function(){var e=[{label:function(){return"Open compute management"},linkProps:{href:"/compute"},uuid:"Open compute management"}];return Tn.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===a||void 0===a?void 0:a.name,H.fj[Tn.U.PYSPARK])},uuid:"Switch to PySpark kernel"}):Tn.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===a||void 0===a?void 0:a.name,H.fj[Tn.U.PYTHON3])},uuid:"Switch to Python kernel"}),e}),[c,a,b]),L="FileHeaderMenu/index",F=(0,Bn.y)(),U=F.registerOnKeyDown,z=F.unregisterOnKeyDown;return(0,f.useEffect)((function(){return function(){z(L)}}),[z,L]),U(L,(function(e,n,t){null!==j&&(n[Dn.QK]?y((function(e){return 0===e?2:e-1})):n[Dn.DY]&&y((function(e){return 2===e?0:e+1})))}),[j,y]),(0,S.jsx)(En.Z,{onClickOutside:function(){return y(null)},open:!0,style:{position:"relative"},children:(0,S.jsxs)(Z.ZP,{children:[(0,S.jsxs)("div",{style:{position:"relative"},children:[(0,S.jsx)(Rn.u,{highlighted:0===j,onClick:function(){return y((function(e){return 0===e?null:0}))},onMouseEnter:function(){return y((function(e){return null!==e?0:null}))},ref:k,children:(0,S.jsx)(C.ZP,{children:"File"})}),(0,S.jsx)(In.Z,{items:D,onClickCallback:function(){return y(null)},open:0===j,parentRef:k,uuid:"FileHeaderMenu/file_items"})]}),(0,S.jsxs)("div",{style:{position:"relative"},children:[(0,S.jsx)(Rn.u,{highlighted:1===j,onClick:function(){return y((function(e){return 1===e?null:1}))},onMouseEnter:function(){return y((function(e){return null!==e?1:null}))},ref:P,children:(0,S.jsx)(C.ZP,{children:"Run"})}),(0,S.jsx)(In.Z,{items:R,onClickCallback:function(){return y(null)},open:1===j,parentRef:P,uuid:"FileHeaderMenu/run_items"})]}),(0,S.jsxs)("div",{style:{position:"relative"},children:[(0,S.jsx)(Rn.u,{highlighted:2===j,onClick:function(){return y((function(e){return 2===e?null:2}))},onMouseEnter:function(){return y((function(e){return null!==e?2:null}))},ref:w,children:(0,S.jsx)(C.ZP,{children:"Edit"})}),(0,S.jsx)(In.Z,{items:A,onClickCallback:function(){return y(null)},open:2===j,parentRef:w,uuid:"FileHeaderMenu/edit_items"})]}),H.qL.INTEGRATION!==(null===a||void 0===a?void 0:a.type)&&(null===T||void 0===T?void 0:T(M.NOTEBOOK_BLOCK_OUTPUT_SPLIT_VIEW))&&(0,S.jsxs)("div",{style:{position:"relative"},children:[(0,S.jsx)(Rn.u,{highlighted:3===j,onClick:function(){return y((function(e){return 3===e?null:3}))},onMouseEnter:function(){return y((function(e){return null!==e?3:null}))},ref:_,children:(0,S.jsx)(C.ZP,{children:"View"})}),(0,S.jsx)(In.Z,{items:B,onClickCallback:function(){return y(null)},open:3===j,parentRef:_,uuid:"FileHeaderMenu/viewItems"})]}),(null===T||void 0===T?void 0:T(M.COMPUTE_MANAGEMENT))&&(0,S.jsxs)("div",{style:{position:"relative"},children:[(0,S.jsx)(Rn.u,{highlighted:4===j,onClick:function(){return y((function(e){return 4===e?null:4}))},onMouseEnter:function(){return y((function(e){return null!==e?4:null}))},ref:E,children:(0,S.jsx)(C.ZP,{children:"Compute"})}),(0,S.jsx)(In.Z,{items:N,onClickCallback:function(){return y(null)},open:4===j,parentRef:E,uuid:"FileHeaderMenu/viewItems"})]}),t]})})},Hn=t(90758),zn=t(89706),Gn=t(67355),Wn=t(70613),Kn=t(21764),Vn=t(28071),qn=t(65956),Yn=t(23657),Qn=t(8970),Xn=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;",""],We.w5,Se.n_,60*w.iI,70*w.iI,(function(e){return"\n background-color: ".concat((e.theme.background||_e.Z.background).panel,";\n border: 1px solid ").concat((e.theme.interactive||_e.Z.interactive).defaultBorder,";\n ")}));function Jn(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 $n(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Jn(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Jn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var et=2*w.iI,nt={default:!0,monospace:!0,small:!0};var tt,it,ot=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,Yn.Z)({clustersRefreshInterval:5e3,includeAllStates:o}),c=(u.activeCluster,u.clusters),a=u.clustersLoading,s=u.computeService,d=u.fetchComputeClusters,p=(0,f.useState)(null),h=p[0],m=p[1],g=(0,v.Db)(K.ZP.compute_clusters.compute_services.useCreate(null===s||void 0===s?void 0:s.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 K.ZP.compute_clusters.compute_services.useUpdate(null===s||void 0===s?void 0:s.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;Kn.Am.error((null===t||void 0===t?void 0:t.error)||i||o,{position:Kn.Am.POSITION.BOTTOM_RIGHT,toastId:r})}})}}),P=(0,r.Z)(k,2),_=P[0],E=P[1].isLoading,I=(0,f.useMemo)((function(){return(null===c||void 0===c?void 0:c.length)||0}),[c]),T=(0,f.useMemo)((function(){return(0,S.jsx)(D.ZP,{beforeIcon:(0,S.jsx)(V.NO,{size:et}),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,a=(0,S.jsx)(C.ZP,{default:!0,small:!0,children:l});return(0,S.jsx)("div",{ref:e,style:{hidden:!h,left:u-((null===e||void 0===e||null===(n=e.current)||void 0===n||null===(t=n.getBoundingClientRect())||void 0===t?void 0:t.width)||0),maxWidth:30*w.iI,position:"fixed",top:c-((null===e||void 0===e||null===(i=e.current)||void 0===i||null===(o=i.getBoundingClientRect())||void 0===o?void 0:o.height)||0),zIndex:9999},children:(0,S.jsx)(qn.Z,{dark:!0,noPadding:!0,children:(0,S.jsxs)(O.Z,{p:1,children:[E&&(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(G.Z,{inverted:!0,small:!0}),(0,S.jsx)(O.Z,{mr:1}),a]}),!E&&a]})})})}),[E,h,m]);return(0,S.jsxs)(S.Fragment,{children:[M,(0,S.jsxs)(Xn,{children:[(0,S.jsx)(O.Z,{p:w.cd,children:(0,S.jsxs)(Z.ZP,{alignItems:"flex-start",justifyContent:"space-between",children:[(0,S.jsxs)(Z.ZP,{flexDirection:"column",children:[(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(C.ZP,{bold:!0,large:!0,children:a?"Clusters":(0,J._6)("cluster",I,!0)}),(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(O.Z,{mr:w.cd}),(0,S.jsx)(Pe.Z,{checked:o,compact:!0,onCheck:function(e){return l(e(o))}}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(C.ZP,{default:o,muted:!o,small:!0,children:"Include terminated clusters"})]})]}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsxs)(C.ZP,{default:!0,small:!0,children:[I>=1&&"Click a cluster to activate and use it for compute.",!I&&"Launch a new cluster to use for compute."]})}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsx)(Z.ZP,{alignItems:"center",children:(0,S.jsx)(D.ZP,{beforeIcon:(0,S.jsx)(V.AP,{default:!0}),default:!0,linkProps:{href:"/compute",as:"/compute?tab=".concat(Qn.uK.CLUSTERS)},noBackground:!0,noBold:!0,noBorder:!0,target:"_blank",noPadding:!0,openNewWindow:!0,small:!0,children:"Open compute mangement"})})})]}),(0,S.jsx)(O.Z,{mr:w.cd}),I>=1&&(0,S.jsx)(Z.ZP,{flexDirection:"column",children:T})]})}),(0,S.jsx)(y.Z,{light:!0}),(0,S.jsx)(En.Z,{onClickOutside:function(){E||m(null)},open:!0,children:(0,S.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."):[Vn.X.RUNNING,Vn.X.WAITING].includes(r)?(i="Activating cluster ".concat(null===o||void 0===o?void 0:o.id,"."),_($n($n({},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)(Vn.X.WAITING)," or\n ").concat((0,J.vg)(Vn.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,$n($n({},nt),{},{key:"id"}),t),(0,S.jsx)(C.ZP,$n($n({},nt),{},{danger:[Vn.X.TERMINATED_WITH_ERRORS].includes(o),default:[Vn.X.STARTING].includes(o),muted:[Vn.X.TERMINATED].includes(o),success:[Vn.X.RUNNING,Vn.X.WAITING].includes(o),warning:[Vn.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,S.jsx)(Z.ZP,{justifyContent:"flex-end",children:(0,S.jsx)(V.Fs,{muted:!n,size:et,success:n})},"active")]})),stickyHeader:!0,uuid:"ClusterSelection"})}),!a&&0===I&&(0,S.jsx)(O.Z,{p:w.cd,children:T}),a&&(0,S.jsx)(O.Z,{p:w.cd,children:(0,S.jsx)(G.Z,{inverted:!0,small:!0})})]})]})};!function(e){e.CREATE_NEW_CLUSTER="create_new_cluster",e.SET_ACTIVE_CLUSTER="set_active_cluster"}(tt||(tt={})),function(e){e.BOOTSTRAPPING="BOOTSTRAPPING",e.STARTING="STARTING",e.WAITING="WAITING"}(it||(it={}));var rt,lt=t(89308),ut=t(89515),ct=t(78688),at=t(98464);!function(e){e.EMR="emr"}(rt||(rt={}));var st=t(26032),dt=t(97133),pt=t(74260),ft=t(15610),vt=t(89538);function ht(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function mt(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ht(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ht(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var gt=function(e){var n=e.children,t=(e.filePaths,e.filesTouched,e.isBusy),i=e.kernel,l=e.pipeline,u=(e.restartKernel,e.savePipelineContent,e.selectedFilePath),c=e.setErrors,a=e.setRunningBlocks,s=e.updatePipelineMetadata,d=(0,h.useRouter)(),m=(0,Mn.Z)(),g=(m.featureEnabled,m.featureUUIDs,m.sparkEnabled),b=(0,Yn.Z)({clustersRefreshInterval:5e3,computeServiceRefreshInterval:5e3,connectionsRefreshInterval:5e3}),x=b.activeCluster,y=b.clusters,_=(b.clustersLoading,b.computeService),E=b.computeServiceUUIDs,I=b.connections,T=b.connectionsLoading,M=b.fetchAll,D=b.fetchComputeClusters,R=(b.setupComplete,(0,f.useContext)(p.ThemeContext)),A=i||{},B=A.alive,N=A.usage,L=(0,f.useState)(!1),U=L[0],z=L[1],W=(0,f.useState)(""),q=W[0],Y=W[1],Q=(0,f.useState)(rt.EMR),X=Q[0],ee=(Q[1],(0,f.useState)(!1)),ne=ee[0],te=ee[1],ie=(0,f.useState)(!1),oe=ie[0],re=ie[1],le=(0,f.useState)(!1),ue=le[0],ce=le[1],ae=(0,f.useState)(!1),se=ae[0],de=ae[1],pe=(0,f.useRef)(null),fe=K.ZP.clusters.detail(X,{},{revalidateOnFocus:!1}),ve=fe.data,he=fe.mutate,me=(0,f.useMemo)((function(){var e;return(null===ve||void 0===ve||null===(e=ve.cluster)||void 0===e?void 0:e.clusters)||[]}),[ve]),ge=(0,f.useMemo)((function(){return(0,Ie.sE)(me,(function(e){return e.is_active}))}),[me]),be=(0,v.Db)(K.ZP.clusters.useUpdate(X),{onSuccess:function(e){return(0,$.wD)(e,{callback:function(){he()},onErrorCallback:function(e,n){return c({errors:n,response:e})}})}}),xe=(0,r.Z)(be,1)[0],ye=K.ZP.spark_applications.list({},{},{pauseFetch:!g}).data,ke=(0,f.useMemo)((function(){return null===ye||void 0===ye?void 0:ye.spark_applications}),[ye]);(0,f.useEffect)((function(){null!==l&&void 0!==l&&l.uuid&&Y(l.uuid)}),[null===l||void 0===l?void 0:l.uuid]);var Ze="KernelStatus",Pe=(0,Bn.y)(),Oe=Pe.registerOnKeyDown,Ce=Pe.unregisterOnKeyDown;(0,f.useEffect)((function(){return function(){Ce(Ze)}}),[Ce,Ze]),Oe(Ze,(function(e,n,t){U&&String(t[0])===String(Dn.Uq)&&String(t[1])!==String(Dn.zX)&&((null===l||void 0===l?void 0:l.uuid)===q?e.target.blur():(s(q),z(!1)))}),[U,q,z,s]);var we=(0,f.useMemo)((function(){return null===N||void 0===N?void 0:N.pid}),[null===N||void 0===N?void 0:N.pid]),Se=(0,at.Z)(we),Ee=(0,vt.dd)((function(){return(0,S.jsx)(ut.Z,{cancelText:"Close",centerOnScreen:!0,confirmText:"Don't show again",neutral:!0,onCancel:De,onClick:function(){(0,kn.t8)(kn.DU,1),De()},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"}),Te=(0,r.Z)(Ee,2),Me=Te[0],De=Te[1];(0,f.useEffect)((function(){var e=(0,kn.U2)(kn.DU,0);we!==Se&&t&&!e&&(Me(),a([]))}),[t,we,Se,a,Me]);var Re=(0,f.useMemo)((function(){return[H.qL.PYTHON,H.qL.PYSPARK].includes(null===l||void 0===l?void 0:l.type)}),[l]),Ae=(0,f.useMemo)((function(){return(0,S.jsx)(j.Z,{color:t?(R||_e.Z).borders.info:B?(R||_e.Z).borders.success:(R||_e.Z).borders.danger,size:w.iI})}),[B,t,R]),Ne=(0,v.Db)((function(e){return K.ZP.compute_clusters.compute_services.useUpdate(null===_||void 0===_?void 0:_.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()},onErrorCallback:function(e){var n=e.error,t=n.errors,i=n.exception,o=n.message,r=n.type;Kn.Am.error((null===t||void 0===t?void 0:t.error)||i||o,{position:Kn.Am.POSITION.BOTTOM_RIGHT,toastId:r})}})}}),Le=(0,r.Z)(Ne,2),Fe=Le[0],Ue=(Le[1].isLoading,(0,f.useMemo)((function(){if(!g||!Re||E.AWS_EMR!==(null===_||void 0===_?void 0:_.uuid)||H.qL.PYSPARK!==(null===l||void 0===l?void 0:l.type))return null;var e=null===I||void 0===I?void 0:I.find((function(e){var n=e.uuid;return pt.IK.OBSERVABILITY===n}));if(!e)return null;var n=e.name,t=e.state,i=e.status_calculated,o=e.uuid,r=[st.i.ACTIVE].includes(t),u=([st.i.INACTIVE].includes(t),[pt.br.COMPLETED].includes(i)),c={muted:!0,warning:!1},a=n||o;u&&(r?(a="Observability enabled",c.muted=!1):a="SSH tunnel not connected");var s=(0,S.jsx)(En.Z,{onClickOutside:function(e){(0,Be.j)(e),de(!1)},open:se,children:(0,S.jsx)(Xn,{children:(0,S.jsx)(lt.Z,{actionsOnly:u,computeService:_,computeConnections:[e],contained:!1,hideDetails:!0,fetchAll:M,onClickStep:function(e){d.push("/compute?tab=".concat(e))},small:!0})})}),p=(0,S.jsx)(V.Fs,{danger:[pt.br.ERROR].includes(i),muted:[pt.br.INCOMPLETE].includes(i),success:u&&r});return(0,S.jsxs)("div",{style:{position:"relative"},children:[(0,S.jsx)(F.ZP,mt(mt({beforeElement:p,blackBorder:!0,compact:!0,inline:!0,noHover:T,onClick:function(e){(0,Be.j)(e),se||de(!0),ce(!1)},uuid:"Pipeline/ComputeConnectionStatus"},c),{},{children:a})),s]})}),[se,_,I,T,M,l,ce,de,Re])),He=(0,f.useMemo)((function(){if(!g||!Re)return null;var e,n,t,i;if(E.AWS_EMR===(null===_||void 0===_?void 0:_.uuid)){var o,r=null===_||void 0===_||null===(o=_.setup_steps)||void 0===o?void 0:o.find((function(e){var n=e.uuid;return pt.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(x){var c,a=null===x||void 0===x||null===(c=x.status)||void 0===c?void 0:c.state;t=(0,S.jsxs)(C.ZP,{monospace:!0,children:[null===x||void 0===x?void 0:x.id," ",a&&![Vn.X.RUNNING,Vn.X.WAITING].includes(a)&&(0,J.J3)(a)]}),i=(0,S.jsx)(V.Fs,{danger:[Vn.X.TERMINATED_WITH_ERRORS].includes(a),default:[Vn.X.STARTING].includes(a),muted:[Vn.X.TERMINATED].includes(a),success:[Vn.X.RUNNING,Vn.X.WAITING].includes(a),warning:[Vn.X.TERMINATING].includes(a)})}else u?(t=null!==y&&void 0!==y&&y.length?"Select a compute cluster":"Launch a new cluster",i=(0,S.jsx)(V.Fs,{warning:!0})):(e=(0,S.jsx)(En.Z,{onClickOutside:function(e){(0,Be.j)(e),ce(!1)},open:ue,children:(0,S.jsx)(Xn,{children:(0,S.jsx)(ct.Z,{contained:!1,onClickStep:function(e){d.push("/compute?tab=".concat(e))},setupSteps:null===_||void 0===_?void 0:_.setup_steps,small:!0})})}),n=function(e){(0,Be.j)(e),ue||ce(!0),de(!1)},t="Compute setup incomplete",i=(0,S.jsx)(V.uy,{danger:!0}));(x||u)&&(e=(0,S.jsx)(En.Z,{onClickOutside:function(e){(0,Be.j)(e),ce(!1)},open:ue,children:(0,S.jsx)(ot,{})}),n=function(e){(0,Be.j)(e),ue||ce(!0),de(!1),de(!1)})}else if(E.STANDALONE_CLUSTER===(null===_||void 0===_?void 0:_.uuid))if(ye)if(null!==ke&&void 0!==ke&&ke.length){if((null===ke||void 0===ke?void 0:ke.length)>=1){var s,p,f=null===ke||void 0===ke?void 0:ke[0];t=[null===f||void 0===f?void 0:f.name,null===f||void 0===f||null===(s=f.attempts)||void 0===s||null===(p=s[0])||void 0===p?void 0:p.app_spark_version].filter((function(e){return e})).join(" "),i=(0,S.jsx)(V.Fs,{success:!0})}}else n=function(){return d.push("/compute")},t="Compute unavailable",i=(0,S.jsx)(V.Fs,{danger:!0});else t="Loading compute",i=(0,S.jsx)(G.Z,{inverted:!0,small:!0});return(0,S.jsxs)("div",{style:{position:"relative"},children:[(0,S.jsx)(F.ZP,mt(mt({beforeElement:i,blackBorder:!0,compact:!0,inline:!0,noHover:!ye||(null===ke||void 0===ke?void 0:ke.length)>=1,onClick:n,uuid:"Pipeline/ComputeStatus"},{muted:!1,warning:!1}),{},{children:t})),e]})}),[x,ue,y,_,E,ye,l,d,ce,de,ke,g,Re]),ze=(0,f.useMemo)((function(){return(0,S.jsx)("div",{ref:pe,style:{position:"relative"},children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(null===l||void 0===l?void 0:l.type)===H.qL.PYSPARK&&!g&&(0,S.jsxs)(O.Z,{mr:w.cd,children:[(0,S.jsxs)(P.Z,{muted:!!ge,onClick:function(){return te(!0)},preventDefault:!0,sameColorAsText:!ge,underline:!ge,children:[ge&&ge.id,!ge&&"Select cluster"]}),(0,S.jsx)(En.Z,{disableEscape:!0,onClickOutside:function(){return te(!1)},open:ne,children:(0,S.jsx)(In.Z,{items:[{isGroupingTitle:!0,label:function(){return"Select cluster"},uuid:"select_cluster"}].concat((0,o.Z)(me.map((function(e){var n=e.id,t=e.is_active,i=e.status;return{label:function(){return(0,S.jsxs)(Z.ZP,{alignItems:"center",fullWidth:!0,justifyContent:"space-between",children:[(0,S.jsx)(k.Z,{flex:1,children:(0,S.jsx)(C.ZP,{muted:!t&&it.WAITING!==i,children:n})}),t&&(0,S.jsx)(V.Jr,{size:2*w.iI,success:!0}),!t&&(0,S.jsx)(C.ZP,{monospace:!0,muted:!0,children:i})]})},onClick:t||it.WAITING!==i?null:function(){return xe({cluster:{id:n}})},uuid:n}})))),onClickCallback:function(){return te(!1)},open:ne,parentRef:pe,uuid:"KernelStatus/select_cluster",width:40*w.iI})})]}),(0,S.jsx)(F.ZP,{beforeElement:Ae,blackBorder:!0,compact:!0,inline:!0,onClick:function(){return re(!0)},uuid:"Pipeline/KernelStatus/kernel",children:H.RH[(null===l||void 0===l?void 0:l.type)||H.qL.PYTHON]}),(0,S.jsx)(En.Z,{disableEscape:!0,onClickOutside:function(){return re(!1)},open:oe,children:(0,S.jsx)(In.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 re(!1)},open:oe,parentRef:pe,rightOffset:0,uuid:"KernelStatus/select_kernel",width:25*w.iI})})]})})}),[B,me,t,l,ge,te,re,ne,oe,Ae,R,Fe,xe,s]);return(0,S.jsx)(dt.rK,{relativePosition:!0,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",fullHeight:!0,justifyContent:"space-between",children:[(0,S.jsx)(Z.ZP,{alignItems:"center",fullHeight:!0,justifyContent:"flex-start",children:(0,S.jsxs)(O.Z,{px:w.cd,children:[u&&(0,S.jsx)(P.Z,{noHoverUnderline:!0,noOutline:!0,onClick:u?function(){return(0,ft.u7)({file_path:null})}:null,preventDefault:!0,children:n}),!u&&(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[n,U&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Z,{ml:1}),(0,S.jsx)(P.Z,{onClick:function(){s(q),z(!1)},preventDefault:!0,sameColorAsText:!0,small:!0,children:"Update name"})]})]})]})}),(0,S.jsx)(O.Z,{px:w.cd,children:(0,S.jsx)(k.Z,{alignItems:"center",children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[ze,Ue&&(0,S.jsx)(O.Z,{ml:1,children:Ue}),He&&(0,S.jsx)(O.Z,{ml:1,children:He})]})})})]})})},bt=t(48339),xt=t(17717),jt=t(12691),yt=t.n(jt),kt=t(65976),Zt=t(57271),Pt=t(92709),Ot=p.default.div.withConfig({displayName:"indexstyle__ScrollbarContainerStyle",componentId:"sc-174iy66-0"})(["position:fixed;"," "," "," ",""],(function(e){return"\n border-radius: ".concat(Se.n_,"px;\n background: ").concat((e.theme.background||_e.Z.background).scrollbarTrack,";\n ")}),(function(e){return!e.invisible&&"\n width: ".concat(We.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 ")})),Ct=p.default.div.withConfig({displayName:"indexstyle__ScrollCursorStyle",componentId:"sc-174iy66-1"})(["position:fixed;z-index:3;"," "," "," "," ",""],(function(e){return"\n border-radius: ".concat(Se.TR,"px;\n background: ").concat((e.theme.background||_e.Z.background).scrollbarThumb,";\n\n &:hover {\n background: ").concat((e.theme.background||_e.Z.background).scrollbarThumbHover,";\n }\n ")}),(function(e){return!e.invisible&&"\n width: ".concat(We.nn,"px;\n ")}),(function(e){return(null===e||void 0===e?void 0:e.selected)&&"\n background: ".concat((e.theme.background||_e.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 ")})),wt=t(74052),_t=t(61709);function St(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 Et(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?St(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):St(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var It=function(e){var n,t,i=e.blocks,r=e.columnIndex,l=e.columns,u=e.disabled,c=e.eventNameRefsMapping,a=e.invisible,s=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||{},E=_.height,I=_.width,T=_.x,M=_.y,D=(0,f.useMemo)((function(){return(0,Ie.Sm)(b||[])}),[b]),R=(0,f.useCallback)((function(){return D>E?E*(E/D):0}),[E,D]),A=(0,f.useMemo)((function(){return R()}),[R]);(0,f.useMemo)((function(){v(A)}),[A,v]);var B=(0,f.useCallback)((function(e){if(A){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+A>=M+E&&(e=M+E-A),null!==h&&void 0!==h&&h.current&&(h.current.style.top="".concat(e,"px"))}}),[A,E,h,M]),N=(0,f.useCallback)((function(){if(!u){var e=new CustomEvent(Pt.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))||[]),a=(0,Ie.Sm)(o||[])||0,s=(0,_t.IT)(o,a,E);return(c-(r-(null===l||void 0===l?void 0:l.y)))/a/(1-s)*((null===l||void 0===l?void 0:l.height)-(null===u||void 0===u?void 0:u.height))+(null===l||void 0===l?void 0:l.y)}),[]),F=(0,f.useCallback)((function(){var e=Object.values(c||{}),n=null===i||void 0===i?void 0:i.map((function(n){var t=(0,wt.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(Et(Et({},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,F)})),function(){var e;null===(e=Object.keys(c||{}))||void 0===e||e.forEach((function(e){window.removeEventListener(e,F)}))}}),[c,F]);var U=(0,f.useCallback)((function(){N(),F()}),[N,F]);(0,f.useEffect)((function(){return window.addEventListener(Pt.Qj,U),function(){window.removeEventListener(Pt.Qj,U)}}),[U]),(0,f.useEffect)((function(){var e=function(e){var n,t,o=e.detail.block,r=null===i||void 0===i?void 0:i.findIndex((function(e){return e.uuid===(null===o||void 0===o?void 0:o.uuid)})),l=L({blockIndex:r,heights: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(Pt.Em,e),function(){window.removeEventListener(Pt.Em,e)}}),[i,L,N,b,B]),(0,f.useEffect)((function(){u||F()}),[u,p,F]),(0,f.useEffect)((function(){var e=function(e){var n=e.detail;if(r===(null===n||void 0===n?void 0:n.columnIndex)){var t=L(Et(Et({},n),{},{heights:b}));B(t),N(),null!==n&&void 0!==n&&n.lockScroll&&k(n)}};return window.addEventListener(Pt.Wf,e),function(){window.removeEventListener(Pt.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]),z=(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 A&&(window.addEventListener("mousemove",z),window.addEventListener("wheel",H),window.addEventListener("mouseup",e)),function(){window.removeEventListener("mousemove",z),window.removeEventListener("wheel",H),window.removeEventListener("mouseup",e)}}),[A,z,H]),(0,S.jsx)(Ot,{height:E,invisible:a,left:d?T+I-We.nn:void 0,ref:m,children:(0,S.jsx)(Ct,{height:A,invisible:a,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})})},Tt=["bold","defaultColor","description","disableWordBreak","fullWidth","inputValue","inputWidth","invertedTheme","label","labelColor","menuOpen","monospace","muted","onClick","notRequired","selectedTextProps","small","stacked","suffixValue","tooltipProps","value"];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 Dt(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 Rt=p.default.div.withConfig({displayName:"LabelWithValueClicker__LabelStyle",componentId:"sc-1hzpn4h-0"})(["margin-bottom:","px;"],.25*w.iI),At=p.default.div.withConfig({displayName:"LabelWithValueClicker__DescriptionStyle",componentId:"sc-1hzpn4h-1"})([""]);var Bt=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,a=e.invertedTheme,s=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,_=e.tooltipProps,E=e.value,I=(0,ge.Z)(e,Tt),T=(0,f.useRef)(null),M=(0,f.useState)(!1),D=M[0],R=M[1],A=(0,f.useState)(!1),B=A[0],N=A[1],L=s&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.ZP,{bold:t,color:d,inverted:a,lineHeight:20,monospace:h,muted:m,small:j,children:s}),_&&(0,S.jsx)(O.Z,{ml:1,children:(0,S.jsx)(Oe.Z,Dt({muted:!0},_))})]}),F=(0,S.jsxs)(k.Z,{flex:l?"1":"none",children:[E&&(0,S.jsx)(P.Z,{block:!0,danger:null===x||void 0===x?void 0:x.danger,fullWidth:!0,muted:m,onClick:function(){g(),T.current&&T.current.focus(),R(!0)},preventDefault:!0,sameColorAsText:m||!(null!==x&&void 0!==x&&x.primary)&&!(null!==x&&void 0!==x&&x.danger)&&!(null!==x&&void 0!==x&&x.warning),underline:null===x||void 0===x?void 0:x.underline,warning:null===x||void 0===x?void 0:x.warning,children:(0,S.jsx)(C.ZP,Dt(Dt({inverted:a,muted:m},x),{},{disableWordBreak:r,monospace:h,small:j,width:c,children:E}))}),(0,S.jsx)(W.Z,Dt(Dt({},I),{},{basic:!0,defaultColor:i,fullWidth:l,invertedTheme:a,monospace:h,onBlur:function(e){R(!1),I.onBlur&&I.onBlur(e),B||N(!0)},onFocus:function(e){R(!0),I.onFocus&&I.onFocus(e)},ref:T,small:j,value:u,visible:!E}))]}),U=o&&(0,S.jsx)(At,{children:(0,S.jsx)(C.ZP,{dangerouslySetInnerHTML:{__html:o},monospace:h,muted:!0,small:j})}),H=(0,f.useMemo)((function(){return(0,S.jsx)(C.ZP,{default:!0,small:j,children:w})}),[j,w]);return(0,S.jsxs)(S.Fragment,{children:[y&&(0,S.jsxs)(S.Fragment,{children:[L&&(0,S.jsxs)(Rt,{children:[(0,S.jsx)(Z.ZP,{alignItems:"center",fullHeight:!1,fullWidth:!0,children:L}),U]}),(0,S.jsxs)(Z.ZP,{fullWidth:l,children:[F,w&&H]})]}),!y&&(0,S.jsxs)(Z.ZP,{alignItems:"center",fullWidth:!0,children:[L&&(0,S.jsxs)(S.Fragment,{children:[L,(0,S.jsx)(O.Z,{ml:1})]}),F,w&&H]}),B&&!D&&!E&&!v&&!b&&(0,S.jsx)(C.ZP,{danger:!0,small:j,children:"This field is required."})]})},Nt=t(53779);function Lt(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?Lt(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Lt(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Ut=function(e){var n=e.blocks,t=e.creatingNewDBTModel,i=e.dbtModelName,o=e.files,r=e.onClose,l=e.onOpenFile,u=e.setDbtModelName,c=(0,f.useState)(!1),a=c[0],s=c[1],d=(0,f.useState)(null),p=d[0],v=d[1],h=(0,f.useMemo)((function(){var e,n,t=null===(e=(0,Ie.sE)((null===o||void 0===o||null===(n=o[0])||void 0===n?void 0:n.children)||[],(function(e){return"dbt"===e.name})))||void 0===e?void 0:e.children,i=[];return null===t||void 0===t||t.forEach((function(e){var n=e.children,t=void 0===n?[]:n;t.length>=1&&i.push(Ft(Ft({},e),{},{children:t}))})),i}),[o]),m=(0,f.useMemo)((function(){return(0,Ie.HK)(n,(function(e){return e.configuration.file_path}))}),[n]);return(0,S.jsxs)(Nt.eD,{children:[(0,S.jsxs)(Nt.X$,{children:[(0,S.jsx)(k.Z,{alignItems:"center",children:(0,S.jsx)(C.ZP,{disableWordBreak:!0,monospace:!0,children:t?"Create new dbt model":"Select dbt model or snapshot file"})}),(0,S.jsx)(D.ZP,{iconOnly:!0,onClick:r,children:(0,S.jsx)(V.x8,{muted:!0})})]}),t&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(Nt.nF,{children:(0,S.jsx)(Bt,{dynamicSizing:!0,inputValue:i,label:"Model name (cannot be changed):",labelColor:_e.Z.accent.dbt,notRequired:!0,onBlur:function(){s(!1)},onChange:function(e){u(e.target.value),e.preventDefault()},onClick:function(){s(!0)},onFocus:function(){s(!0)},placeholder:"Enter name",required:!0,stacked:!0,suffixValue:".".concat(b.t6.SQL),value:!a&&i})}),(0,S.jsxs)(Nt.nF,{children:[(0,S.jsx)(C.ZP,{bold:!0,color:_e.Z.accent.dbt,children:"Select folder location:"}),(0,S.jsx)(C.ZP,{bold:!0,muted:!p,children:p?"dbt".concat(xt.sep).concat(p):"Choose folder below"})]})]}),(0,S.jsx)(Nt.C,{children:(0,S.jsx)(_n.Z,{allowSelectingFolders:t,disableContextMenu:!0,files:h,isFileDisabled:function(e,n){return t?!n||(null===n||void 0===n?void 0:n.some((function(e){return"models"===(null===e||void 0===e?void 0:e.name)}))):!!m[e]||!(null!==n&&void 0!==n&&n.length)&&!e.match(new RegExp(".".concat(b.t6.SQL,"$")))},openFile:l,selectFile:v,uncollapsed:!0,useRootFolder:!0})}),t&&(0,S.jsx)(Nt.iW,{children:(0,S.jsx)(D.ZP,{backgroundColor:i&&p?_e.Z.accent.dbt:_e.Z.monotone.grey500,disabled:!i||!p,onClick:function(){return l(p)},padding:"6px 8px",children:"Create model"})})]})},Ht=t(32013),zt=t(98777),Gt=t(39457);function Wt(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 Kt(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Wt(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Wt(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Vt="4px",qt={lightBackground:!0,muted:!0,relativePosition:!0},Yt=[Ce.Zj.BIGQUERY,Ce.Zj.DELTA_LAKE_S3];var Qt=function(e){var n=e.bookmarkValues,t=e.destination,i=e.isLoadingLoadSampleData,o=e.isLoadingUpdateDestinationBlockState,u=e.loadSampleData,c=e.source,a=e.stream,s=e.streams,d=e.updateAllStreams,p=e.updateDestinationBlockState,v=e.updateMetadataForColumns,h=e.updateSchemaProperty,m=e.updateStream,g=(0,f.useRef)(null),b=a.bookmark_properties,j=a.destination_table,y=void 0===j?"":j,P=a.key_properties,_=a.metadata,E=a.partition_keys,I=a.replication_method,T=a.run_in_parallel,M=a.schema.properties,R=a.tap_stream_id,A=a.unique_constraints,B=a.unique_conflict_method,N=(0,f.useState)(y),L=N[0],F=N[1],U=(0,f.useState)(!1),H=U[0],G=U[1],K=(0,f.useState)(null),V=K[0],q=K[1],Y=(0,f.useState)(!!t),Q=Y[0],X=Y[1],$=(0,f.useState)((0,l.Z)({},R,n||{})),ee=$[0],ne=$[1],te=(0,at.Z)(R);(0,f.useEffect)((function(){te!==R&&(F(y),q(null))}),[y,I,R,te,B]),(0,f.useEffect)((function(){var e=null===ee||void 0===ee?void 0:ee[R];(null===b||void 0===b?void 0:b.length)>0&&((0,je.Qr)(e)||!(0,je.Xy)(n,e))&&ne((function(e){return Kt(Kt({},e),{},(0,l.Z)({},R,n))}))}),[null===b||void 0===b?void 0:b.length,n,R]);var ie=(0,f.useMemo)((function(){return(0,Ie.HK)(_,(function(e){return e.breadcrumb.join("/")}))}),[_]),oe=(0,f.useMemo)((function(){var e;return null===(e=(0,Ie.sE)(_,(function(e){return 0===e.breadcrumb.length})))||void 0===e?void 0:e.metadata}),[_]),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=Yt.includes(t),se=s.length>1,de=(0,f.useCallback)((function(e){var n=Kt({},null===ee||void 0===ee?void 0:ee[R]);n.hasOwnProperty(e)&&delete n[e],ne((function(e){return Kt(Kt({},e),{},(0,l.Z)({},R,Kt({},n)))})),p({block:{bookmark_values:n,destination_table:L,tap_stream_id:R}})}),[ee,L,R,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],a=c.anyOf,s=void 0===a?[]:a,p=c.format,f=c.type,g=void 0===f?[]:f,j=new Set(Array.isArray(g)?g:[g]),y=new Set(j);s.forEach((function(e){var n=e.format,t=(e.items,e.type);Array.isArray(t)?t.forEach((function(e){j.add(e),y.add(e)})):(j.add(t),y.add(t),n&&y.add(n))}));var _=Array.from(j);p&&y.add(p);var I=(ie["properties/".concat(u)]||{}).metadata,T=(I.inclusion,I.selected);e.push(T),n.push(u);var M=Ce.D5.reduce((function(e,n){return _.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,S.jsx)("option",{value:n,children:n},n))}),[]),B=_.findIndex((function(e){return e===Ce.RL.STRING})),N=[(0,S.jsx)(x.Z,{checked:T,onClick:function(){v(R,[u],{selected:!T})}},"".concat(R,"/").concat(u,"/selected")),(0,S.jsx)(C.ZP,{children:u},"".concat(R,"/").concat(u,"/name")),(0,S.jsxs)(Z.ZP,{children:[(0,S.jsx)(k.Z,{flex:1,children:(0,S.jsx)(Z.ZP,{alignItems:"center",flexWrap:"wrap",fullWidth:!0,children:_.map((function(e,n){return(0,S.jsx)(O.Z,{mb:1,mr:1,children:(0,S.jsx)(ke.Z,{border:!0,label:p&&Ce.RL.STRING===e&&B===n?Ce.eL[p]:e,onClick:function(){var n={format:p,type:_.filter((function(n){return n!==e}))};Ce.zS.DATE_TIME!==p&&Ce.zS.UUID!==p||Ce.RL.STRING!==e||(n.format=null),h(R,u,n)},small:!0})},"".concat(R,"/").concat(u,"/").concat(e,"/").concat(n,"/chip"))}))})}),M.length>=1&&(0,S.jsxs)(z.Z,{compact:!0,onChange:function(e){var n=e.target.value,t={format:p,type:_};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(R,u,t)},primary:!0,small:!0,value:"",width:10*w.iI,children:[(0,S.jsx)("option",{value:""}),M]})]},"".concat(R,"/").concat(u,"/type")),(0,S.jsx)(x.Z,{checked:!(null===A||void 0===A||!A.includes(u)),disabled:re.length>=1&&!re.includes(u),onClick:re.length>=1&&!re.includes(u)?null:function(){return m(R,(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(R,"/").concat(u,"/unique")),(0,S.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(R,(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(R,"/").concat(u,"/bookmark")),(0,S.jsx)(x.Z,{checked:!(null===P||void 0===P||!P.includes(u)),onClick:function(){return m(R,(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(R,"/").concat(u,"/key_property"))];if(ce){var L=t!==Ce.Zj.DELTA_LAKE_S3,F=L&&(re.includes(u)||!y.has(Ce.zS.DATE_TIME));N.push((0,S.jsx)(x.Z,{checked:!(null===E||void 0===E||!E.includes(u)),disabled:F,onClick:F?null:function(){return m(R,(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(R,"/").concat(u,"/partition_key")))}if(se){var U=V===o;N.push((0,S.jsx)(D.ZP,{compact:!0,disabled:U,onClick:function(){q(o),setTimeout((function(){return q(null)}),2e3),d((function(e){var n,t;if((null===e||void 0===e?void 0:e.tap_stream_id)!==R&&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,a,s,d,f;e.schema.properties[u]={format:p||null,type:_};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===A||void 0===A||!A.includes(u)||null!==e&&void 0!==e&&null!==(o=e.unique_constraints)&&void 0!==o&&o.includes(u)||!m.includes(u)?null!==A&&void 0!==A&&A.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!==(a=e.key_properties)&&void 0!==a&&a.includes(u)?null!==P&&void 0!==P&&P.includes(u)||null===e||void 0===e||null===(s=e.key_properties)||void 0===s||!s.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 Kt({},e)}))},pill:!0,secondary:!0,children:(0,S.jsx)(C.ZP,{success:U,children:U?"Applied!":"Apply"})}))}return N})),o=e.every((function(e){return e})),l=[null,2,1,null,null,null],u=[{label:function(){return(0,S.jsx)(x.Z,{checked:o,onClick:function(){v(R,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"})),se&&(l.push(null),u.push({tooltipMessage:"This will apply this individual feature's schema settings to all selected streams that have the same feature. Unique features must be valid key properties in other streams. Bookmark features must be valid replication keys in other streams.",uuid:"All streams"})),(0,S.jsx)(ae.cl,{children:(0,S.jsx)(Ze.Z,{alignTop:!0,columnFlex:l,columns:u,rows:i,stickyHeader:!0})})}),[b,t,se,V,P,ie,E,M,de,ce,R,A,d,v,h,m,re,le]);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(ue.Z,{condensed:!0,level:4,spacingBelow:!0,children:[(0,S.jsx)(ue.Z,{condensed:!0,inline:!0,level:4,monospace:!0,children:R})," schema"]}),(0,S.jsx)(O.Z,{mb:3,children:(0,S.jsx)(qn.Z,{headerTitle:"Output",overflowVisible:!0,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(C.ZP,{children:"Destination table name"}),(0,S.jsx)(O.Z,{ml:Vt}),(0,S.jsx)(Oe.Z,Kt(Kt({},qt),{},{label:(0,S.jsxs)(C.ZP,{children:["By default, this stream will be saved to your destination under the table named ",(0,S.jsx)(C.ZP,{bold:!0,inline:!0,monospace:!0,children:R}),". To change the table name, enter in a different value."]})})),(0,S.jsx)(O.Z,{ml:1}),(0,S.jsx)(W.Z,{compact:!0,monospace:!0,onChange:function(e){var n=e.target.value;F(n),clearTimeout(g.current),g.current=setTimeout((function(){m(R,(function(e){return Kt(Kt({},e),{},{destination_table:n})}))}),300)},value:L||"",width:45*w.iI})]})})}),(0,S.jsx)(O.Z,{mb:3,children:(0,S.jsx)(qn.Z,{headerTitle:"Usage",overflowVisible:!0,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(k.Z,{alignItems:"center",children:[(0,S.jsx)(C.ZP,{children:"Replication method"}),(0,S.jsx)(O.Z,{ml:Vt}),(0,S.jsx)(Oe.Z,Kt(Kt({},qt),{},{label:(0,S.jsxs)(C.ZP,{children:["Do you want to synchronize the entire stream (",(0,S.jsx)(C.ZP,{bold:!0,inline:!0,monospace:!0,children:Ce._B.FULL_TABLE}),") on each integration pipeline run or only new records (",(0,S.jsx)(C.ZP,{bold:!0,inline:!0,monospace:!0,children:Ce._B.INCREMENTAL}),")?",c===Ce.th.POSTGRESQL&&(0,S.jsxs)(C.ZP,{children:["Log-based incremental replication (",(0,S.jsx)(C.ZP,{bold:!0,inline:!0,monospace:!0,children:Ce._B.LOG_BASED}),") is also available for PostgreSQL sources."]})]})})),(0,S.jsx)(O.Z,{ml:1}),(0,S.jsxs)(z.Z,{compact:!0,onChange:function(e){m(R,(function(n){return Kt(Kt({},n),{},{replication_method:e.target.value})}))},primary:!0,value:I,children:[(0,S.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,S.jsx)("option",{value:e,children:e},e)}))]}),(0,S.jsx)(O.Z,{ml:3}),(0,S.jsx)(C.ZP,{children:"Unique conflict method"}),(0,S.jsx)(O.Z,{ml:Vt}),(0,S.jsx)(Oe.Z,Kt(Kt({},qt),{},{label:(0,S.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===A||void 0===A?void 0:A.length),(null===A||void 0===A?void 0:A.length)>0&&(0,S.jsx)(S.Fragment,{children:"\xa0"}),null===A||void 0===A?void 0:A.sort().map((function(e,n){return(0,S.jsxs)(C.ZP,{bold:!0,inline:!0,monospace:!0,children:[1!==(null===A||void 0===A?void 0:A.length)&&n===(null===A||void 0===A?void 0:A.length)-1?(0,S.jsx)(C.ZP,{inline:!0,children:" and "},e):n>=1&&(0,S.jsx)(S.Fragment,{children:",\xa0"}),e]},e)})),", how do you want to resolve the conflict? The conflict method ",(0,S.jsx)(C.ZP,{bold:!0,inline:!0,monospace:!0,children:Ce.MU.IGNORE})," will skip the new record if it\u2019s a duplicate of an existing record. The conflict method ",(0,S.jsx)(C.ZP,{bold:!0,inline:!0,monospace:!0,children:Ce.MU.UPDATE})," will not save the new record and instead update the existing record with the new record\u2019s properties."]})})),(0,S.jsx)(O.Z,{ml:1}),(0,S.jsxs)(z.Z,{compact:!0,inputWidth:11*w.iI,onChange:function(e){m(R,(function(n){return Kt(Kt({},n),{},{unique_conflict_method:e.target.value})}))},primary:!0,value:B,children:[(0,S.jsx)("option",{value:""}),(0,S.jsx)("option",{value:Ce.MU.IGNORE,children:Ce.MU.IGNORE}),(0,S.jsx)("option",{value:Ce.MU.UPDATE,children:Ce.MU.UPDATE})]})]}),se&&(0,S.jsxs)(k.Z,{alignItems:"center",children:[(0,S.jsx)(C.ZP,{default:!0,children:"All streams"}),(0,S.jsx)(O.Z,{ml:Vt}),(0,S.jsx)(Oe.Z,Kt(Kt({},qt),{},{appearBefore:!0,label:(0,S.jsx)(C.ZP,{children:"This will apply this stream's replication method and unique conflict method settings to all selected streams."})})),(0,S.jsx)(O.Z,{ml:1}),(0,S.jsx)(D.ZP,{compact:!0,disabled:H,onClick:function(){G(!0),setTimeout((function(){return G(!1)}),2e3),d((function(e){return Kt(Kt({},e),{},{replication_method:I,unique_conflict_method:B})}))},pill:!0,secondary:!0,children:(0,S.jsx)(C.ZP,{bold:!H,success:H,children:H?"Applied!":"Apply"})})]})]})})}),(0,S.jsx)(qn.Z,{headerTitle:"Features",noPadding:!0,children:pe}),(0,S.jsx)(O.Z,{mt:2,children:(0,S.jsx)(D.ZP,{loading:i,onClick:function(){return u(R)},primary:!0,small:!0,children:"Load sample data"})}),(0,S.jsxs)(O.Z,{mt:5,children:[(0,S.jsx)(ue.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Settings"}),(0,S.jsx)(O.Z,{mb:5,children:(0,S.jsxs)(O.Z,{mb:1,children:[(0,S.jsx)(C.ZP,{bold:!0,large:!0,children:"Run stream in parallel"}),(0,S.jsx)(C.ZP,{default:!0,children:"Parallel streams will be run at the same time, so make sure there are no dependencies between them."}),(0,S.jsx)(O.Z,{mb:1}),(0,S.jsx)(Pe.Z,{checked:T,onCheck:function(){return m(R,(function(e){return e.run_in_parallel=!T,e}))}},"".concat(R,"/run_in_parallel"))]})}),Ce._B.INCREMENTAL===I&&(0,S.jsxs)(O.Z,{mb:5,children:[(0,S.jsxs)(O.Z,{mb:1,children:[(0,S.jsx)(C.ZP,{bold:!0,large:!0,children:"Bookmark properties"}),(0,S.jsx)(C.ZP,{default:!0,children:"After each integration pipeline run, the last record that was successfully synchronized will be used as the bookmark. The properties listed below will be extracted from the last record and used as the bookmark. On the next run, the synchronization will start from the bookmarked record."})]}),(0,S.jsxs)(Z.ZP,{alignItems:"center",flexWrap:"wrap",children:[!(null!==b&&void 0!==b&&b.length)&&(0,S.jsxs)(C.ZP,{italic:!0,children:["Click the checkbox under the column ",(0,S.jsx)(C.ZP,{bold:!0,inline:!0,italic:!0,children:"Bookmark"})," to use a specific column as a bookmark property."]}),null===b||void 0===b?void 0:b.sort().map((function(e){return(0,S.jsx)(O.Z,{mb:1,mr:1,children:(0,S.jsx)(ke.Z,{label:e,onClick:function(){de(e),m(R,(function(n){return Kt(Kt({},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,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Z,{my:2,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(O.Z,{mr:2,children:[(0,S.jsx)(C.ZP,{bold:!0,large:!0,children:"Manually edit bookmark property values"}),!t&&(0,S.jsx)(C.ZP,{default:!0,children:'In order to overwrite the bookmark values for the next sync, you must first select a destination. Then you will be able to edit the bookmark property values in the table below. Click the "Save" button to save your changes.'}),t&&(0,S.jsx)(C.ZP,{default:!0,children:'This will temporarily overwrite the bookmark value for the next pipeline run. After editing any bookmark values below, you must click the "Save" button in the table header in order to persist and save your changes.'})]}),(0,S.jsx)(Pe.Z,{checked:Q,disabled:!t,onCheck:function(){return X((function(e){return!e}))}})]})}),Q&&!!t&&(0,S.jsx)(qn.Z,{header:(0,S.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsx)(C.ZP,{bold:!0,default:!0,children:"Bookmark property values"}),(0,S.jsx)(D.ZP,{compact:!0,loading:o,onClick:function(){p({block:{bookmark_values:(null===ee||void 0===ee?void 0:ee[R])||{},destination_table:L,tap_stream_id:R}})},pill:!0,primary:!0,children:"Save"})]}),headerPaddingVertical:w.iI,noPadding:!0,overflowVisible:!0,children:(0,S.jsx)(Ze.Z,{columnBorders:!0,columnFlex:[null,1],columns:[{uuid:"Feature"},{uuid:"Current bookmark value"}],rows:b.map((function(e){var n;return[(0,S.jsx)(C.ZP,{default:!0,monospace:!0,children:e},e),(0,S.jsx)(W.Z,{borderless:!0,monospace:!0,onChange:function(n){n.preventDefault(),ne((function(t){return Kt(Kt({},t),{},(0,l.Z)({},R,Kt(Kt({},t[R]),{},(0,l.Z)({},e,n.target.value||null))))}))},paddingHorizontal:0,placeholder:"Enter value (optional)",value:null===ee||void 0===ee||null===(n=ee[R])||void 0===n?void 0:n[e]},"".concat(e,"_value"))]}))})})]})]}),se&&(null===b||void 0===b?void 0:b.length)>0&&(0,S.jsxs)(O.Z,{mb:5,children:[(0,S.jsx)(C.ZP,{bold:!0,large:!0,children:"Valid replication keys"}),(0,S.jsx)(C.ZP,{default:!0,inline:!0,children:"If a stream's schema specifies its valid replication keys and a feature is not a valid replication key, that feature will not be set as a bookmark property when applying the feature (from a different stream) as a bookmark to all streams.\xa0"}),le.length>0&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.ZP,{default:!0,inline:!0,children:"These are the valid replication keys for this stream:"}),"\xa0",(0,S.jsxs)(C.ZP,{inline:!0,monospace:!0,small:!0,children:[le.join(", "),"."]})]}),0===le.length&&(0,S.jsx)(C.ZP,{default:!0,inline:!0,children:"This stream did not specify any valid replication keys, so all features can be used as bookmark properties."})]}),(0,S.jsxs)(O.Z,{mb:5,children:[(0,S.jsxs)(O.Z,{mb:1,children:[(0,S.jsx)(C.ZP,{bold:!0,large:!0,children:"Unique constraints"}),(0,S.jsx)(C.ZP,{default:!0,children:"Multiple records (e.g. 2 or more) with the same values in the columns listed below will be considered duplicates."})]}),(0,S.jsxs)(Z.ZP,{alignItems:"center",flexWrap:"wrap",children:[!(null!==A&&void 0!==A&&A.length)&&(0,S.jsxs)(C.ZP,{italic:!0,children:["Click the checkbox under the column ",(0,S.jsx)(C.ZP,{bold:!0,inline:!0,italic:!0,children:"Unique"})," to use a specific column as a unique constraint."]}),null===A||void 0===A?void 0:A.sort().map((function(e){return(0,S.jsx)(O.Z,{mb:1,mr:1,children:(0,S.jsx)(ke.Z,{label:e,onClick:function(){m(R,(function(n){return Kt(Kt({},n),{},{unique_constraints:(0,Ie.Od)(n.unique_constraints||[],(function(n){return n===e}))})}))},primary:!0})},"unique_constraints/".concat(e))}))]})]}),(0,S.jsxs)(O.Z,{mb:5,children:[(0,S.jsxs)(O.Z,{mb:1,children:[(0,S.jsx)(C.ZP,{bold:!0,large:!0,children:"Key properties"}),(0,S.jsx)(C.ZP,{default:!0,children:"Key properties are used as the primary key for the destination table."})]}),(0,S.jsxs)(Z.ZP,{alignItems:"center",flexWrap:"wrap",children:[!(null!==P&&void 0!==P&&P.length)&&(0,S.jsxs)(C.ZP,{italic:!0,children:["Click the checkbox under the column ",(0,S.jsx)(C.ZP,{bold:!0,inline:!0,italic:!0,children:"Key prop"})," to use a specific column as a key property."]}),null===P||void 0===P?void 0:P.sort().map((function(e){return(0,S.jsx)(O.Z,{mb:1,mr:1,children:(0,S.jsx)(ke.Z,{label:e,onClick:function(){m(R,(function(n){return Kt(Kt({},n),{},{key_properties:(0,Ie.Od)(n.key_properties||[],(function(n){return n===e}))})}))},primary:!0})},"key_properties/".concat(e))}))]})]}),ce&&(0,S.jsxs)(O.Z,{mb:3,children:[(0,S.jsxs)(O.Z,{mb:1,children:[(0,S.jsx)(C.ZP,{bold:!0,large:!0,children:"Partition keys"}),(0,S.jsx)(C.ZP,{default:!0,children:"One datetime column can be used to partition the table. (Note: Partition keys currently only work with BigQuery destinations. Support for other destinations is WIP.)"})]}),(0,S.jsxs)(Z.ZP,{alignItems:"center",flexWrap:"wrap",children:[!(null!==E&&void 0!==E&&E.length)&&(0,S.jsxs)(C.ZP,{italic:!0,children:["Click the checkbox under the column ",(0,S.jsx)(C.ZP,{bold:!0,inline:!0,italic:!0,children:"Partition key"})," to use a specific column as a partition key."]}),null===E||void 0===E?void 0:E.sort().map((function(e){return(0,S.jsx)(O.Z,{mb:1,mr:1,children:(0,S.jsx)(ke.Z,{label:e,onClick:function(){m(R,(function(n){return Kt(Kt({},n),{},{partition_keys:(0,Ie.Od)(n.partition_keys||[],(function(n){return n===e}))})}))},primary:!0})},"key_properties/".concat(e))}))]})]})]})]})},Xt=["catalog","pipeline","setErrors","setSelectedStream"];function Jt(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 $t(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Jt(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Jt(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ei,ni=function(e){var n,t=e.catalog,i=e.pipeline,o=e.setErrors,l=e.setSelectedStream,u=(0,ge.Z)(e,Xt),c=(0,f.useState)(null),a=c[0],s=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===a||void 0===a?void 0:a.uuid]}),[a,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=K.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,_=null===P||void 0===P||null===(n=P.block)||void 0===n?void 0:n.bookmarks,E=(0,v.Db)(K.ZP.blocks.pipelines.useUpdate(null===i||void 0===i?void 0:i.uuid,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&&(a&&(0,Ie.sE)(p,(function(e){var n=e.uuid;return a.uuid===n}))||s(p[0]))}),[a,s,p]);var D=(0,f.useMemo)((function(){var e=[{uuid:"Stream"},{uuid:"Columns Selected"},{uuid:"Replication Method"},{uuid:"Destination Table"},{uuid:"Bookmark Props"},{uuid:"Key Props"},{uuid:"Unique Constraints"},{uuid:"Unique Conflict Method"},{uuid:"Partition Keys"}];return(0,S.jsx)(ae.cl,{children:(0,S.jsx)(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,a=e.tap_stream_id,s=r.reduce((function(e,n){var t=n.breadcrumb,i=n.metadata.selected,o=(null===t||void 0===t?void 0:t.length)>0,r=i&&o?1:0,l=o?1:0;return{selectedCount:e.selectedCount+r,totalCount:e.totalCount+l}}),{selectedCount:0,totalCount:0}),d=(0,S.jsx)(C.ZP,{children:"".concat(s.selectedCount," of ").concat(s.totalCount," total")},"".concat(a,"_col_selected")),p=[a,n,t,i,o,l,u,c].map((function(e,n){return(0,S.jsx)(C.ZP,{bold:0===n,children:Array.isArray(e)?e.sort().join(", "):e},"".concat(a,"_cell_").concat(n))}));return p.slice(0,1).concat(d).concat(p.slice(1))})),stickyFirstColumn:!0,stickyHeader:!0,wrapColumns:!0})})}),[d]);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(R.Z,{allowScroll:!0,noPadding:!0,onClickTab:function(e){s(e),l(e.uuid)},selectedTabUUID:null===a||void 0===a?void 0:a.uuid,tabs:p}),m&&(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsx)(ae.dE,{children:(0,S.jsx)(Qt,$t($t({},u),{},{bookmarkValues:_,isLoadingUpdateDestinationBlockState:M,stream:m,streams:d,updateDestinationBlockState:T}))})}),d.length>=1&&(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsxs)(ae.dE,{children:[(0,S.jsx)(ue.Z,{level:4,children:"Streams Summary"}),(0,S.jsx)(O.Z,{mt:1}),D]})})]})},ti=t(46732);function ii(e){return Object.values(e).filter((function(e){return null!==e})).map((function(e){return e.tap_stream_id}))}function oi(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 ri(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?oi(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):oi(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"}(ei||(ei={}));var li=45*w.iI,ui=li-4*w.iI;var ci=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 ri(ri({},e),{},{isMissingStream:!0})}))}),[r,o]),c=ri({},r);u.forEach((function(e){var n=e.stream;delete c[n]}));var a=(0,f.useState)(c),s=a[0],d=a[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)(ei.ALL),k=j[0],P=j[1],_=(0,f.useRef)(null),E=ii(s),I=(0,f.useMemo)((function(){var e=o;return e=e.filter((function(e){var n=e.tap_stream_id;return k===ei.SELECTED?E.includes(n):k!==ei.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!!s[n]}))}),[s,o]);return(0,S.jsxs)(Re.Z,{children:[(0,S.jsx)(ae.cv,{rounded:!0,children:(0,S.jsx)(C.ZP,{bold:!0,large:!0,children:"Select streams to sync"})}),(0,S.jsx)(ae.cv,{padding:1.25*w.iI,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsx)(W.Z,{beforeIcon:(0,S.jsx)(V.HN,{}),compact:!0,noBackground:!0,noBorder:!0,onChange:function(e){return h(e.target.value)},placeholder:"Search",value:v}),(0,S.jsx)(O.Z,{pr:1,children:(0,S.jsx)(ti.Z,{items:[{label:function(){return ei.ALL},onClick:function(){return P(ei.ALL)},uuid:"all_streams"},{label:function(){return ei.SELECTED},onClick:function(){return P(ei.SELECTED)},uuid:"selected"},{label:function(){return ei.NOT_SELECTED},onClick:function(){return P(ei.NOT_SELECTED)},uuid:"unselected"}],onClickCallback:function(){return b(!1)},onClickOutside:function(){return b(!1)},open:g,parentRef:_,uuid:"SelectStreams/filter",children:(0,S.jsx)(D.ZP,{beforeIcon:(0,S.jsx)(V.wn,{}),noBackground:!0,onClick:function(){return b((function(e){return!e}))},ref:_,children:(0,S.jsx)(C.ZP,{children:k})})})})]})}),(0,S.jsx)(ae.cl,{height:"55vh",hideHorizontalScrollbar:!0,width:"".concat(li,"px"),children:(0,S.jsx)(Ze.Z,{borderCollapseSeparate:!0,columnFlex:[1,6],columns:[{label:function(){return(0,S.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=!!s[t];return[(0,S.jsx)(x.Z,{checked:i,disabled:!i&&n,onClick:function(){d((function(n){return ri(ri({},n),{},(0,l.Z)({},t,i?null:e))}))}},"selected-".concat(t)),(0,S.jsxs)(C.ZP,{danger:n,title:t,width:li-48-32,children:[t,n?" (no longer available)":""]},"stream-".concat(t))]})),stickyHeader:!0})}),(0,S.jsx)(y.Z,{medium:!0}),(0,S.jsxs)(O.Z,{p:2,children:[(null===E||void 0===E?void 0:E.length)>50&&(0,S.jsx)(O.Z,{pb:2,children:(0,S.jsxs)(C.ZP,{danger:!0,maxWidth:ui,rightAligned:!0,whiteSpaceNormal:!0,children:["WARNING: Selecting too many streams (e.g. >50)",(0,S.jsx)("br",{}),"may cause app performance issues."]})}),0===(null===o||void 0===o?void 0:o.length)&&(0,S.jsx)(O.Z,{pb:2,children:(0,S.jsx)(C.ZP,{bold:!0,maxWidth:ui,warning:!0,whiteSpaceNormal:!0,children:"If you can successfully connect to the data source but no streams are displayed, check if the user has proper database/schema permissions."})}),(0,S.jsx)(Z.ZP,{justifyContent:"flex-end",children:(0,S.jsx)(D.ZP,{loading:t,onClick:function(){return i(s)},primary:!0,children:"Confirm ".concat(ii(s).length," streams")})})]})]})};function ai(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function si(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ai(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ai(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var di=function(e){var n=e.api,t=e.block,i=e.blockContent,o=e.onChangeCodeBlock,u=e.pipeline,c=(0,f.useState)(null),a=c[0],s=c[1];(0,f.useEffect)((function(){i&&!a&&s((0,re.Pz)(null===i||void 0===i?void 0:i.config))}),[a,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)(K.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,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(ae.$W,{children:(0,S.jsx)(le.Z,{autoHeight:!0,language:b.t6.YAML,onChange:function(e){s(e),o(t.type,t.uuid,(0,re.Pz)(si(si({},i),{},{config:(0,re.Qc)(e)})))},tabSize:2,value:a||void 0,width:"100%"})}),(0,S.jsxs)(O.Z,{mt:1,children:[(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(D.ZP,{onClick:function(){k((0,l.Z)({},(0,J.C5)(n),{action_type:"test_connection",config:a,pipeline_uuid:u.uuid})),x(null)},small:!0,success:!0,children:"Test connection"}),(0,S.jsx)(O.Z,{ml:1,children:P?(0,S.jsx)(G.Z,{color:"white",small:!0}):(0,S.jsxs)(S.Fragment,{children:[p&&(0,S.jsx)(C.ZP,{small:!0,success:!0,children:"Connected successfully!"}),!1===p&&(0,S.jsx)(C.ZP,{small:!0,warning:!0,children:"Failed to connect, see error below."})]})})]}),g&&(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsx)(C.ZP,{small:!0,warning:!0,children:g})})]})]}):null},pi=t(85385);function fi(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function vi(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?fi(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):fi(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var hi=function(e){var n,t,i,o=e.addNewBlockAtIndex,l=e.blocks,u=e.codeBlocks,c=e.fetchFileTree,a=e.fetchPipeline,s=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,_=e.setSelectedOutputBlock,E=e.setSelectedStream,I=(0,f.useState)(!0),T=I[0],M=I[1],R=(0,f.useState)(!0),A=R[0],B=R[1],N=(0,f.useState)(!0),L=N[0],F=N[1],U=(0,f.useState)(""),H=U[0],W=U[1],q=K.ZP.integration_sources.list({},{revalidateOnFocus:!1}).data,Y=(0,f.useMemo)((function(){return(null===q||void 0===q?void 0:q.integration_sources)||[]}),[q]),Q=(0,f.useMemo)((function(){return(0,Ie.HK)(Y,(function(e){return e.uuid}))}),[Y]),X=K.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&&W(null===(e=Q[te.source])||void 0===e?void 0:e.docs)}),[Q,te]);var ie=(0,f.useMemo)((function(){return(0,S.jsx)(di,{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,S.jsx)(di,{api:"integration_destinations",block:oe,blockContent:le,onChangeCodeBlock:p,pipeline:m})}),[oe,le,p,m]),se=(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,at.Z)(de);(0,f.useEffect)((function(){!ve&&de&&(y((function(){return _(ne),[ne]})),j((function(e){var n;return e||(null===de||void 0===de||null===(n=de.streams)||void 0===n?void 0:n.map((function(e){return e.tap_stream_id})))})))}),[de]);var me=(0,f.useState)(),ge=me[0],be=me[1],xe=(0,v.Db)(K.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 _(ne),[ne]})),t.length>0&&E(t[0]),j((function(e){var n=(e||[]).concat(t);return Array.from(new Set(n)).sort()})),h(pi.cH.DATA),s()}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)(K.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]=vi(vi({},n),{},{metadata:vi(vi({},i),{},{selected:!0})})}}))}));var u={streams:o.concat(l)};j(Ve.map((function(e){return e.tap_stream_id})));var s=null===te||void 0===te?void 0:te.catalog;(0,je.Qr)(s)||p(ne.type,ne.uuid,(0,re.Pz)(vi(vi({},te),{},{catalog:{}})));var d={pipeline:vi(vi({},m),{},{data_integration:vi(vi({},(null===m||void 0===m?void 0:m.data_integration)||{}),{},{catalog:u})})};g(d).then((function(){a(),c()}))},onErrorCallback:function(e,n){return x({errors:n,response:e})}})}}),_e=(0,r.Z)(we,2),Se=_e[0],Ee=_e[1].isLoading,Te=(0,f.useState)(null),Me=Te[0],De=Te[1],Re=(0,v.Db)(K.ZP.integration_source_streams.useUpdate(null===m||void 0===m?void 0:m.uuid),{onSuccess:function(e){return(0,$.wD)(e,{callback:function(e){De(e.integration_source_stream)},onErrorCallback:function(e,n){return x({errors:n,response:e})}})}}),Ae=(0,r.Z)(Re,2),Be=Ae[0],Ne=Ae[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=vi(vi({},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)(vi(vi({},te),{},{catalog:{}})));var u={pipeline:vi(vi({},m),{},{data_integration:vi(vi({},(null===m||void 0===m?void 0:m.data_integration)||{}),{},{catalog:r})})};g(u).then((function(){return a()}))}),[de,ne,te,a,p,m,g]),Fe=(0,f.useCallback)((function(e){if(null!==de&&void 0!==de&&de.streams){var n=vi(vi({},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)(vi(vi({},te),{},{catalog:{}})));var i={pipeline:vi(vi({},m),{},{data_integration:vi(vi({},(null===m||void 0===m?void 0:m.data_integration)||{}),{},{catalog:n})})};g(i).then((function(){return a()}))}}),[de,ne,te,a,p,m,g]),Ue=(0,f.useCallback)((function(e,n,t){Le(e,(function(e){return e.schema.properties[n]=t,e}))}),[Le]),He=(0,f.useCallback)((function(e,n,t){Le(e,(function(e){var i=e.metadata;return n.forEach((function(n){var o=i.findIndex((function(e){var t=e.breadcrumb,i=void 0===t?[]:t;return 2===i.length&&"properties"===i[0]&&i[1]===n}));if(o>=0){var r=i[o].metadata;e.metadata[o].metadata=vi(vi({},r),t)}})),e}))}),[Le]),ze=(0,v.Db)(K.ZP.blocks.pipelines.useUpdate(null===m||void 0===m?void 0:m.uuid,null===oe||void 0===oe?void 0:oe.uuid),{onSuccess:function(e){return(0,$.wD)(e,{callback:function(){null===a||void 0===a||a()},onErrorCallback:function(e,n){return null===x||void 0===x?void 0:x({errors:n,response:e})}})}}),Ge=(0,r.Z)(ze,1)[0],We=(0,f.useMemo)((function(){var e=[];return null===d||void 0===d||d.forEach((function(n){var t=n.variables;return null===t||void 0===t?void 0:t.forEach((function(n){var t=n.uuid,i=n.value,o="\"{{ variables('".concat(t,"') }}\"");if(!t.startsWith("output"))return e.push([(0,S.jsx)(C.ZP,{monospace:!0,children:t},"variable-uuid-".concat(t)),(0,S.jsx)(C.ZP,{monospace:!0,children:i},"variable-uuid-".concat(t,"-{value}")),(0,S.jsx)(C.ZP,{monospace:!0,children:o},"variable-uuid-".concat(t,"-{value}-code")),(0,S.jsx)(Gt.Z,{copiedText:o,monospace:!0,withCopyIcon:!0},"variable-uuid-".concat(t,"-{value}-code-copy"))])}))})),(0,S.jsx)(Ze.Z,{alignTop:!0,columnFlex:[null,null,1],columns:[{uuid:"Key"},{uuid:"Value"},{uuid:"Code"}],rows:e})}),[d]),Ke=(0,f.useCallback)((function(e){return(0,S.jsxs)(O.Z,{mt:2,children:[(0,S.jsxs)(C.ZP,{default:!0,children:["Use the following variables to interpolate sensitive or dynamic information into the configuration.",(0,S.jsx)("br",{}),"You can also access values from your environment variables by using the following syntax: ",(0,S.jsx)(C.ZP,{inline:!0,monospace:!0,children:"\"{{ env_var('MY_ENV_VARIABLE_NAME') }}\""}),(0,S.jsx)("br",{}),"For more information, check out the ",(0,S.jsx)(P.Z,{href:e,openNewWindow:!0,primary:!0,children:"documentation"}),"."]}),(0,S.jsx)(O.Z,{mt:1,children:We})]})}),[We]),Ve=(0,f.useMemo)((function(){return(null===Me||void 0===Me?void 0:Me.streams)||[]}),[Me]),qe=(0,vt.dd)((function(){return(0,S.jsx)(ci,{catalog:de,isLoading:Ee,onActionCallback:function(e){var n=Object.entries(e).reduce((function(e,n){var t=(0,r.Z)(n,2),i=t[0];return t[1]?e.concat(i):e}),[]);if(n.length>0)Se({integration_source:{streams:n}}),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)(vi(vi({},te),{},{catalog:{}}))),g({pipeline:vi(vi({},m),{},{data_integration:vi(vi({},(null===m||void 0===m?void 0:m.data_integration)||{}),{},{catalog:null})})}).then((function(){return a()})),Xe()}},streams:Ve})}),{},[de,ne,te,a,Ee,p,g,Ve],{background:!0,uuid:"select_streams"}),Ye=(0,r.Z)(qe,2),Qe=Ye[0],Xe=Ye[1];return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Z,{mb:1,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(D.ZP,{iconOnly:!0,onClick:function(){return B((function(e){return!e}))},children:(0,S.jsxs)(S.Fragment,{children:[A&&(0,S.jsx)(V.Kh,{size:1.5*w.iI}),!A&&(0,S.jsx)(V._M,{size:1.5*w.iI})]})}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(ue.Z,{children:"Source"}),!A&&(0,S.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]})]})]})}),A&&(0,S.jsxs)(O.Z,{mb:5,children:[(0,S.jsxs)(ae.dE,{children:[(0,S.jsxs)(O.Z,{mb:5,children:[(0,S.jsx)(ue.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Select source"}),(null===Y||void 0===Y?void 0:Y.length)>0?(0,S.jsxs)(z.Z,{onChange:function(e){var n,t,i,r=e.target.value;if(r){W(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)(vi(vi({},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),De(null),g().then((function(){a()}))}},primary:!0,value:null===te||void 0===te?void 0:te.source,children:[(0,S.jsx)("option",{value:""}),Y.map((function(e){var n=e.name,t=e.uuid;return(0,S.jsx)("option",{value:t,children:n},t)}))]}):(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(G.Z,{inverted:!0}),(0,S.jsx)(O.Z,{ml:1}),(0,S.jsx)(ue.Z,{level:5,primary:!0,children:"Loading sources..."})]})]}),ne&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(O.Z,{mb:5,children:[(0,S.jsx)(ue.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Configuration"}),(null===te||void 0===te?void 0:te.source)&&H&&(0,S.jsxs)(O.Z,{mb:2,children:[(0,S.jsx)(Ht.Z,{children:(0,S.jsx)(zt.Z,{title:"Documentation: ".concat(te.source),children:(0,S.jsx)(ae.zG,{children:(0,S.jsx)(he.Z,{children:H.replace(/\<br \/\>/g,"\n\n")})})})}),Ke("https://docs.mage.ai/guides/data-integration-pipeline#configure-source")]}),ie]}),(0,S.jsxs)("div",{children:[(0,S.jsx)(ue.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Select stream"}),(0,S.jsx)(D.ZP,{loading:Ne,onClick:function(){g().then((function(){Be().then((function(){return Qe()})),a()}))},primary:!0,small:!0,children:"View and select streams"})]}),ge&&(0,S.jsx)(C.ZP,{warning:!0,children:ge})]})]}),Ee&&(0,S.jsx)(O.Z,{p:2,children:(0,S.jsx)(G.Z,{})}),!Ee&&(0,S.jsx)(O.Z,{mt:3,children:(0,S.jsx)(ni,{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:Fe,updateMetadataForColumns:He,updateSchemaProperty:Ue,updateStream:Le})})]}),(0,S.jsx)(O.Z,{mb:1,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(D.ZP,{disabled:!ne,iconOnly:!0,onClick:function(){return F((function(e){return!e}))},children:(0,S.jsxs)(S.Fragment,{children:[L&&ne&&(0,S.jsx)(V.Kh,{size:1.5*w.iI}),(!L||!ne)&&(0,S.jsx)(V._M,{disabled:!ne,size:1.5*w.iI})]})}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(Z.ZP,{alignItems:"center",children:(0,S.jsx)(ue.Z,{children:"Transformers"})})]})}),L&&ne&&(0,S.jsx)(O.Z,{mb:5,children:(0,S.jsxs)(ae.dE,{children:[u.length>0&&(0,S.jsx)(O.Z,{mb:1,children:u.map((function(e,n){return(0,S.jsx)(O.Z,{mb:1,children:e},n)}))}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsx)(Zt.Z,{addNewBlock:function(e){var n=e.content,t=e.configuration,i=[];return ne&&i.push(ne.uuid),o(vi(vi({},e),{},{configuration:t,content:n,upstream_blocks:i}),l.length-1,(function(e){oe&&(Ge({block:vi(vi({},oe),{},{upstream_blocks:[e.uuid]})}),k(e))}))},compact:!0,hideCustom:!0,hideDataExporter:!0,hideDataLoader:!0,hideDbt:!0,hideMarkdown:!0,hideScratchpad:!0,hideSensor:!0,hideTransformer:!!se,hideTransformerDataSources:!0,pipeline:m})})]})}),(0,S.jsx)(O.Z,{mb:1,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(D.ZP,{disabled:!ne,iconOnly:!0,onClick:function(){return M((function(e){return!e}))},children:(0,S.jsxs)(S.Fragment,{children:[T&&ne&&(0,S.jsx)(V.Kh,{size:1.5*w.iI}),(!T||!ne)&&(0,S.jsx)(V._M,{disabled:!ne,size:1.5*w.iI})]})}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(ue.Z,{children:"Destination"}),!T&&(0,S.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,S.jsxs)(ae.dE,{children:[(0,S.jsxs)(O.Z,{mb:5,children:[(0,S.jsx)(ue.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Select destination"}),(null===J||void 0===J?void 0:J.length)>0?(0,S.jsxs)(z.Z,{onChange:function(e){var n=e.target.value;if(n){if(oe)p(oe.type,oe.uuid,(0,re.Pz)(vi(vi({},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(){a()}))}},primary:!0,value:null===le||void 0===le?void 0:le.destination,children:[(0,S.jsx)("option",{value:""}),J.map((function(e){var n=e.name,t=e.uuid;return(0,S.jsx)("option",{value:t,children:n},t)}))]}):(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(G.Z,{inverted:!0}),(0,S.jsx)(O.Z,{ml:1}),(0,S.jsx)(ue.Z,{level:5,primary:!0,children:"Loading destinations..."})]})]}),oe&&(0,S.jsxs)(O.Z,{mb:5,children:[(0,S.jsx)(ue.Z,{condensed:!0,level:4,spacingBelow:!0,children:"Configuration"}),(null===le||void 0===le?void 0:le.destination)&&(0,S.jsx)(S.Fragment,{children:(0,S.jsxs)(O.Z,{mb:2,children:[(0,S.jsxs)(C.ZP,{default:!0,children:["For more information on how to configure this destination, read the ",(0,S.jsxs)(P.Z,{href:"https://github.com/mage-ai/mage-ai/blob/master/mage_integrations/mage_integrations/destinations/".concat(le.destination,"/README.md"),openNewWindow:!0,primary:!0,children:[le.destination," documentation"]}),".",(0,S.jsx)("br",{}),(0,S.jsx)("br",{}),"If your configuration contains a key named ",(0,S.jsx)(C.ZP,{inline:!0,monospace:!0,children:"table"}),", it\u2019s optional.",(0,S.jsx)("br",{}),"The table that\u2019s created in this destination will have a name corresponding to the stream\u2019s unique name (by default) or the value you entered under the input field labeled ",(0,S.jsx)(C.ZP,{bold:!0,inline:!0,children:"Table name"})," in a previous section."]}),Ke("https://docs.mage.ai/guides/data-integration-pipeline#configure-destination")]})}),ce,(0,S.jsx)(O.Z,{mt:3,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(O.Z,{mr:2,children:[(0,S.jsx)(C.ZP,{bold:!0,large:!0,children:"Automatically add new fields"}),(0,S.jsx)(C.ZP,{default:!0,children:"Turn the toggle on if you want new table columns in each data source stream to be automatically added and synced with the data destination."})]}),(0,S.jsx)(Pe.Z,{checked:!!pe,disabled:!(null!==de&&void 0!==de&&de.streams),onCheck:function(){return Fe((function(e){return vi(vi({},e),{},{auto_add_new_fields:!pe})}))}})]})}),(0,S.jsx)(O.Z,{mt:3,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(O.Z,{mr:2,children:[(0,S.jsx)(C.ZP,{bold:!0,large:!0,children:"Disable column type check"}),(0,S.jsxs)(C.ZP,{default:!0,children:["By default, the value for each column is validated according to the schema property for that column.",(0,S.jsx)("br",{}),"If a value in a column doesn\u2019t match its type, an error will be raised and the process will be stopped.",(0,S.jsx)("br",{}),"Turn this toggle on if you want to disable this strict type checking."]})]}),(0,S.jsx)(Pe.Z,{checked:!!fe,disabled:!(null!==de&&void 0!==de&&de.streams),onCheck:function(){return Fe((function(e){return vi(vi({},e),{},{disable_column_type_check:!fe})}))}})]})})]})]})]})},mi=t(82359),gi=t(35058),bi=t(38399),xi=t(33834),ji=t(42041);function yi(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 ki(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?yi(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):yi(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Zi=function(e){var n=e.addNewBlockAtIndex,t=e.addWidget,i=e.afterHidden,u=e.allBlocks,c=e.allowCodeBlockShortcuts,a=e.anyInputFocused,s=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,M=e.globalDataProducts,D=e.globalVariables,R=e.hiddenBlocks,N=e.interactionsMapping,F=e.interruptKernel,U=e.mainContainerRef,z=e.mainContainerWidth,G=e.messages,W=e.onChangeCallbackBlock,V=e.onChangeCodeBlock,q=e.openSidekickView,Y=e.pipeline,Q=e.pipelineContentTouched,X=e.project,ee=e.restartKernel,ne=e.runBlock,te=e.runningBlocks,ie=void 0===te?[]:te,oe=e.savePipelineContent,re=e.scrollTogether,le=e.selectedBlock,ue=e.setAnyInputFocused,ce=e.setDisableShortcuts,ae=e.setEditingBlock,se=e.setErrors,de=e.setHiddenBlocks,pe=e.setIntegrationStreams,fe=e.setOutputBlocks,ve=e.setPipelineContentTouched,he=e.setSelectedBlock,me=e.setSelectedOutputBlock,ge=e.setSelectedStream,be=e.setTextareaFocused,xe=e.showBrowseTemplates,ye=e.showConfigureProjectModal,ke=e.showDataIntegrationModal,Ze=e.showGlobalDataProducts,Pe=e.showUpdateBlockModal,Oe=e.sideBySideEnabled,Ce=e.textareaFocused,we=e.widgets,_e=(0,f.useRef)(null),Se=(0,f.useRef)(null),Ee=(0,f.useRef)({}),Te=(0,f.useState)(!1),Me=Te[0],De=Te[1],Re=(0,f.useState)(!1),Ae=Re[0],Be=Re[1],Ne=(0,f.useState)(!1),Le=Ne[0],Fe=Ne[1],Ue=(0,f.useState)(!0),He=Ue[0],ze=Ue[1],Ge=(0,f.useState)(null),We=Ge[0],Ke=Ge[1],Ve=(0,f.useState)(null),qe=Ve[0],Ye=Ve[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===Y||void 0===Y?void 0:Y.type)}),[Y]),un=(0,f.useMemo)((function(){return H.qL.STREAMING===(null===Y||void 0===Y?void 0:Y.type)}),[Y]),cn=(0,f.useMemo)((function(){return g.filter((function(e){var n=e.type;return!ln||b.tf.TRANSFORMER===n}))}),[g,ln]),an=(0,f.useState)({}),sn=(an[0],an[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,z,rn,pn,fn]);var vn=(0,f.useMemo)((function(){return ie.reduce((function(e,n,t){return ki(ki({},e),{},(0,l.Z)({},n.uuid,ki(ki({},n),{},{priority:t})))}),{})}),[ie]),hn=(0,f.useState)(null),mn=hn[0],gn=hn[1],bn=(0,f.useMemo)((function(){return(0,S.jsx)(It,{blocks:cn,columnIndex:0,columns:2,disabled:re,eventNameRefsMapping:(0,l.Z)({},Pt.$e,h),invisible:!(null!==g&&void 0!==g&&g.length)||!mn||re,mainContainerRect:on,scrollTogether:re,setCursorHeight:gn})}),[h,cn,mn,on,re,gn]),xn=(0,f.useState)(null),jn=xn[0],yn=xn[1],kn=(0,f.useMemo)((function(){return(0,S.jsx)(It,{blocks:cn,columnIndex:1,columns:2,disabled:re,eventNameRefsMapping:(0,l.Z)({},Pt.tK,Ee),invisible:!(null!==g&&void 0!==g&&g.length)||!jn||re,mainContainerRect:on,rightAligned:!0,scrollTogether:re,setCursorHeight:yn})}),[Ee,cn,jn,on,re,yn]),Pn=(0,f.useState)(null),On=Pn[0],Cn=Pn[1],wn=(0,f.useMemo)((function(){var e;return(0,S.jsx)(It,{blocks:cn,columnIndex:2,columns:1,disabled:!re,eventNameRefsMapping:(e={},(0,l.Z)(e,Pt.tK,Ee),(0,l.Z)(e,Pt.$e,h),e),invisible:!(null!==g&&void 0!==g&&g.length)||!On||!re,mainContainerRect:on,rightAligned:!0,scrollTogether:re,setCursorHeight:Cn})}),[Ee,h,cn,On,on,re,Cn]),_n=(0,at.Z)(le),Sn=(0,f.useMemo)((function(){return g.length}),[g]),In=(0,f.useMemo)((function(){var e;return H.qL.PYTHON===(null===Y||void 0===Y?void 0:Y.type)&&(null===X||void 0===X||null===(e=X.features)||void 0===e?void 0:e[mi.d.ADD_NEW_BLOCK_V2])}),[Y,X]),Tn=K.ZP.block_templates.list({show_all:!!In},{revalidateOnFocus:!1}).data,Mn=(0,f.useMemo)((function(){return(null===Tn||void 0===Tn?void 0:Tn.block_templates)||[]}),[Tn]),Rn=(0,f.useCallback)((function(e,t){var i=g[g.length-1],o=null,r=e.configuration||{},l=i?(0,_t.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(Y.uuid,"', '").concat(i.uuid,"', 'output_0')\n")),b.t6.SQL===i.language&&(r=ki(ki({},(0,je.GL)(i.configuration,[gi.cH,gi.Sv,gi.sc,gi.BD,gi.nq])),r))),b.t6.SQL===e.language&&(o=(0,bi.SF)(o)),o=(0,bi.X7)(e,o);var u=null!==t?t:Sn;n(ki(ki({},e),{},{configuration:r,content:o,upstream_blocks:l}),u,he),be(!0)}),[n,g,Sn,Y,he,be]),An="PipelineDetail/index",Nn=(0,Bn.y)(),Ln=Nn.disableGlobalKeyboardShortcuts,Fn=Nn.registerOnKeyDown,Un=Nn.unregisterOnKeyDown;(0,f.useEffect)((function(){return function(){Un(An)}}),[Un,An]),Fn(An,(function(e,n,t){if(Q&&(0,ji.y)([Dn.zX,Dn.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,ji.y)([Dn.zX,Dn.Um],n)||(0,ji.y)([Dn.PQ,Dn.Um],n))e.preventDefault(),oe();else if((0,ji.y)([Dn.zH],n)||(0,ji.y)([Dn.Fv],n)){if(le&&!e.repeat&&!(0,xi.cK)(e)){var i=g.findIndex((function(e){var n=e.uuid;return le.uuid===n}));if(-1!==i){var o=(0,ji.y)([Dn.zH],n)?i:i+1;Rn({type:b.tf.SCRATCHPAD},o)}}}else if(Ce)n[Dn.vP]?be(!1):Q||Dn.Z1.find((function(e){return n[e]}))||ve(!0);else if(!ln){var r;if(In&&((0,ji.y)([Dn.zX,Dn.A1],n)||(0,ji.y)([Dn.PQ,Dn.A1],n)))e.preventDefault(),Be(!0),null===Se||void 0===Se||null===(r=Se.current)||void 0===r||r.focus();else if(In&&Ae&&(0,ji.y)([Dn.vP],n)){var l;e.preventDefault(),Be(!1),null===Se||void 0===Se||null===(l=Se.current)||void 0===l||l.blur()}else if(le){var u=g.findIndex((function(e){var n=e.uuid;return le.uuid===n}));if(n[Dn.vP])he(null);else if(t[0]===Dn.xD&&t[1]===Dn.xD)F();else if(t[0]===Dn.l1&&t[1]===Dn.l1&&-1!==u)y(le).then((function(e){null!==e&&void 0!==e&&e.error||setTimeout((function(){u===g.length-1?he(g[u-1]):g.length>=0?he(g[u+1]):he(null)}),100)}));else if(n[Dn.Bu]&&u>=1){var c=g[u-1];if(c){var s,d;he(c);var p="".concat(c.type,"s/").concat(c.uuid,".py");null===(s=h.current[p])||void 0===s||null===(d=s.current)||void 0===d||d.scrollIntoView()}}else if(n[Dn.kD]&&u<=Sn-2){var f=g[u+1];if(f){var v,m;he(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,ji.y)([Dn.Uq],n)&&be(!0)}else _n&&n[Dn.Uq]&&he(_n);a||t[0]!==Dn.OC||t[1]!==Dn.OC||ee()}}),[n,a,h.current,g,Ae,F,ln,Sn,Q,ee,oe,Se,le,_n,ve,he,be,Ce,In]),(0,f.useEffect)((function(){var e=setInterval((function(){Q&&oe()}),1e4);return function(){clearInterval(e)}}),[Q,oe]),(0,f.useEffect)((function(){setTimeout((function(){return Fe(!0)}),2*dt.zn)}),[Y]);var Hn=(0,v.Db)((function(e){var n=e.block,t=e.upstreamBlocks;return K.ZP.blocks.pipelines.useUpdate(null===Y||void 0===Y?void 0:Y.uuid,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})}})}}),Gn=(0,r.Z)(Hn,1)[0],Wn=(0,f.useCallback)((function(e){De(!0),Ye(e),ce(!0)}),[De,ce,Ye]),Kn=(0,f.useCallback)((function(){De(!1),Je(!1),nn(""),ce(!1)}),[ce]),Vn=(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),oe({pipeline:{blocks:o,uuid:null===Y||void 0===Y?void 0:Y.uuid}})}),[g,Y,oe]),qn=(0,f.useMemo)((function(){return Y&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(Zt.Z,{addNewBlock:Rn,blockTemplates:Mn,focusedAddNewBlockSearch:Ae,hideCustom:ln||un,hideDataExporter:ln,hideDataLoader:ln,hideDbt:ln||un,hideScratchpad:ln,hideSensor:ln,onClickAddSingleDBTModel:Wn,pipeline:Y,project:X,searchTextInputRef:Se,setCreatingNewDBTModel:Je,setFocusedAddNewBlockSearch:Be,showBrowseTemplates:xe,showConfigureProjectModal:ye,showGlobalDataProducts:Ze}),!In&&!ln&&!un&&(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsxs)(C.ZP,{muted:!0,small:!0,children:["Want to try the new add block UI?",(0,S.jsx)("br",{}),"Turn on the feature named ",(0,S.jsx)(C.ZP,{bold:!0,inline:!0,muted:!0,small:!0,children:mi.d.ADD_NEW_BLOCK_V2})," in your ",(0,S.jsx)(yt(),{href:"/settings/workspace/preferences",passHref:!0,children:(0,S.jsx)(P.Z,{muted:!0,underline:!0,children:(0,S.jsx)(C.ZP,{bold:!0,inline:!0,muted:!0,small:!0,children:"project settings"})})}),"."]})})]})}),[Rn,Mn,Ae,ln,un,Wn,Y,X,Se,Be,xe,ye,Ze,In]),Yn=(0,f.useMemo)((function(){var e=[],i=(null===cn||void 0===cn?void 0:cn.length)||0;return cn.forEach((function(r,l){var a,d=l===i-1,v=r.type,m=r.uuid,P=(null===le||void 0===le?void 0:le.uuid)===m,O=vn[m],C=O?0===O.priority?bt.uF.BUSY:bt.uF.QUEUED:bt.uF.IDLE,w=(0,wt.zv)({type:v,uuid:m});Ee.current[w]=(0,f.createRef)(),h.current[w]=(0,f.createRef)();var I=v===b.tf.MARKDOWN,T=v===b.tf.TRANSFORMER,D=!(null===R||void 0===R||!R[m]),A=l===Sn-1||ln,B=Ee.current[w],H=h.current[w],K=m,Q=null===x||void 0===x||null===(a=x[v])||void 0===a?void 0:a[m];Q&&(K="".concat(K,":").concat(Q)),e.push((0,S.jsx)(L.Z,{addNewBlock:function(e,t){be(!0);return n(e,Oe?l:l+1,(function(e){if(1===(null===t||void 0===t?void 0:t.length)){var n,i,r=null===(n=t[0])||void 0===n?void 0:n.uuid,l=(null===(i=t[0])||void 0===i?void 0:i.upstream_blocks)||[];Gn({block:{uuid:r},upstreamBlocks:[e.uuid].concat((0,o.Z)(l))})}null===he||void 0===he||he(e)}))},addNewBlockMenuOpenIdx:We,addWidget:t,allBlocks:u,allowCodeBlockShortcuts:c,autocompleteItems:s,block:r,blockIdx:l,blockInteractions:null===p||void 0===p?void 0:p[m],blockOutputRef:B,blockRefs:h,blockTemplates:Mn,blocks:g,containerRef:_e,cursorHeight1:mn,cursorHeight2:jn,cursorHeight3:On,dataProviders:j,defaultValue:r.content,deleteBlock:function(e){y(e),ue(!1)},disableShortcuts:k,executionState:C,fetchFileTree:Z,fetchPipeline:E,globalDataProducts:M,hideRunButton:un||I||ln&&T,interactionsMapping:N,interruptKernel:F,isHidden:D,mainContainerRect:on,mainContainerRef:U,mainContainerWidth:z,messages:G[m],noDivider:A,onCallbackChange:function(e){return W(v,m,e)},onChange:function(e){return V(v,m,e)},onClickAddSingleDBTModel:Wn,onDrop:Vn,openSidekickView:q,pipeline:Y,project:X,ref:H,runBlock:ne,runningBlocks:ie,savePipelineContent:oe,scrollTogether:re,selected:P,setAddNewBlockMenuOpenIdx:Ke,setAnyInputFocused:ue,setCreatingNewDBTModel:Je,setEditingBlock:ae,setErrors:se,setHiddenBlocks:de,setMountedBlocks:sn,setOutputBlocks:fe,setSelected:function(e){return he(!0===e?r:null)},setSelectedBlock:he,setSelectedOutputBlock:me,setTextareaFocused:be,showBrowseTemplates:xe,showConfigureProjectModal:ye,showDataIntegrationModal:ke,showGlobalDataProducts:Ze,showUpdateBlockModal:Pe,sideBySideEnabled:Oe,textareaFocused:P&&Ce,widgets:we,windowWidth:fn,children:Oe&&d&&(0,S.jsx)("div",{style:{paddingBottom:_.WC,paddingTop:_.WC},children:qn})},K))})),e}),[n,We,qn,t,u,c,s,p,Ee,h,Mn,g,cn,x,_e,mn,jn,On,j,y,k,Z,E,M,R,N,F,ln,un,on,U,z,G,Sn,W,V,Wn,Vn,q,Y,X,ne,ie,vn,oe,re,le,Ke,ue,ae,se,de,sn,fe,he,me,be,xe,ye,ke,Ze,Pe,Oe,Ce,Gn,we,fn]),Qn=(0,f.useMemo)((function(){return(0,S.jsx)(hi,{addNewBlockAtIndex:n,blocks:g,codeBlocks:Yn,fetchFileTree:Z,fetchPipeline:E,fetchSampleData:I,globalVariables:D,onChangeCodeBlock:V,openSidekickView:q,pipeline:Y,savePipelineContent:oe,setErrors:se,setIntegrationStreams:pe,setOutputBlocks:fe,setSelectedBlock:he,setSelectedOutputBlock:me,setSelectedStream:ge})}),[n,g,Yn,Z,E,I,D,V,q,Y,oe,se,pe,fe,he,me,ge]);return(0,S.jsxs)(A.W,{backend:B.PD,children:[(0,S.jsx)(dt.lO,{ref:_e,children:He&&(0,S.jsx)(kt.Z,{classNames:"pipeline-detail",in:Le,onEntered:function(){return setTimeout((function(){return ze(!1)}),dt.zn)},timeout:1,children:(0,S.jsx)(dt.fm,{})})}),ln&&(0,S.jsx)(O.Z,{mt:1,px:w.cd,children:Qn}),!Oe&&(0,S.jsx)(O.Z,{mt:1,px:w.cd,children:!ln&&(0,S.jsxs)(S.Fragment,{children:[Yn,(0,S.jsx)(O.Z,{mt:w.cd,children:qn})]})}),Oe&&(0,S.jsxs)("div",{style:{position:"relative"},children:[bn,Yn,kn,wn,!(null!==g&&void 0!==g&&g.length)&&(0,S.jsx)(O.Z,{p:w.cd,children:qn})]}),Me&&(0,S.jsx)(En.Z,{onClickOutside:Kn,open:!0,children:(0,S.jsx)(Ut,{blocks:g,creatingNewDBTModel:Xe,dbtModelName:en,files:T,onClose:Kn,onOpenFile:function(e){var t=e;if(Xe){var i=(0,J.RA)(en||(0,J.Y6)()),o=".".concat(zn.Lu.SQL);i.endsWith(o)&&(i=i.slice(0,-4)),t="".concat(e).concat(xt.sep).concat(i,".").concat(zn.Lu.SQL)}var r={configuration:{file_path:t,limit:L.z},language:b.t6.SQL,name:(0,J.wE)(t),type:b.tf.DBT};Xe&&(r.content="--Docs: https://docs.mage.ai/dbt/sources\n");var l="undefined"===typeof qe||null===qe,u=g[l?g.length-1:qe],c=u?(0,_t.eY)(u,r):[];n(ki(ki({},r),{},{upstream_blocks:c}),(l?Sn:qe+1)-(Oe?1:0),he),Kn(),be(!0)},setDbtModelName:nn})})]})},Pi=t(82555),Oi=t(68487),Ci=t(2842);function wi(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?wi(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):wi(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Si=function(e){var n=e.after,t=e.afterFooter,i=e.afterHeader,o=e.afterHeightOffset,l=e.afterHidden,u=e.afterInnerHeightMinus,c=e.afterNavigationItems,a=e.afterOverflow,s=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,_=e.setBeforeHidden,E=e.setErrors,I=e.setMainContainerWidth,T=(0,Zn.i)().width,M=(0,f.useState)((0,kn.U2)(kn.L8,Ci.Zt)),D=M[0],R=M[1],A=(0,f.useState)((0,kn.U2)(kn.J3,Ci.ve)),B=A[0],N=A[1],L=(0,f.useState)(!1),F=L[0],U=L[1],H=(0,f.useState)(!1),z=H[0],G=H[1],W=l,V=C;if(!V){var q=(0,f.useState)(!!(0,kn.U2)(kn.zg)),Y=(0,r.Z)(q,2);W=Y[0],V=Y[1]}var Q=h,X=_;if(!X){var $=(0,f.useState)(!!(0,kn.U2)(kn.Uu)),ee=(0,r.Z)($,2);Q=ee[0],X=ee[1]}(0,f.useEffect)((function(){null===Z||void 0===Z||!Z.current||F||z||null===I||void 0===I||I(Z.current.getBoundingClientRect().width)}),[F,z,W,D,Q,B,Z,I,T]),(0,f.useEffect)((function(){F||(null===w||void 0===w||w(D),(0,kn.t8)(kn.L8,D))}),[F,D,w]),(0,f.useEffect)((function(){z||(0,kn.t8)(kn.J3,B)}),[z,B]);var ne=K.ZP.projects.list({},{revalidateOnFocus:!1}).data,te=null===ne||void 0===ne?void 0:ne.projects,ie=(0,f.useMemo)((function(){var e,n=[{label:function(){return"Pipelines"},linkProps:{as:"/pipelines",href:"/pipelines"}}];return O&&(n.push.apply(n,[{bold:Pt.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]"}}]),Pt.b7===P&&n.push.apply(n,[{bold:!0,label:function(){return(0,J.kC)(P)}}])),(0,S.jsx)(Oi.Z,{breadcrumbs:n,project:null===te||void 0===te?void 0:te[0],version:null===te||void 0===te||null===(e=te[0])||void 0===e?void 0:e.version})}),[P,O,te]);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(Wn.Z,{title:null===O||void 0===O?void 0:O.name}),(0,S.jsx)(yn.Z,{after:n,afterFooter:t,afterHeader:i,afterHeightOffset:o,afterHidden:W,afterInnerHeightMinus:u,afterMousedownActive:F,afterNavigationItems:c,afterOverflow:a,afterSubheader:s,afterWidth:D,before:d,beforeHeader:p,beforeHeightOffset:v,beforeHidden:Q,beforeMousedownActive:z,beforeNavigationItems:m,beforeWidth:B,footerOffset:x,header:ie,headerOffset:j,mainContainerFooter:y,mainContainerHeader:k,mainContainerRef:Z,navigationShowMore:!0,setAfterHidden:V,setAfterMousedownActive:U,setAfterWidth:R,setBeforeHidden:X,setBeforeMousedownActive:G,setBeforeWidth:N,children:g}),b&&(0,S.jsx)(En.Z,{disableClickOutside:!0,isOpen:!0,onClickOutside:function(){return E(null)},children:(0,S.jsx)(Pi.Z,_i(_i({},b),{},{onClose:function(){return E(null)}}))})]})},Ei=t(55729),Ii=t(93808),Ti=t(8666),Mi=t(72226),Di=t(29644),Ri=t(46209),Ai=t(46568),Bi=t(82682),Ni=t(17679),Li=t(61896),Fi=(w.iI,Ni.O$,w.iI,Li.dN,p.default.div.withConfig({displayName:"indexstyle__SidekickContainerStyle",componentId:"sc-cr39lf-0"})(["height:calc(100vh - ","px - ","px);width:fit-content;",""],Ci.Wi,We.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 ")}))),Ui=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 ")})),Hi=t(31748),zi=t(79633);var Gi=function(e){var n=e.copyText,t=e.deleteVariable,i=e.disableKeyEdit,o=e.editStateInit,u=void 0!==o&&o,c=e.fetchVariables,a=e.focusKey,s=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],_=P[1],E=(0,f.useState)(x),I=E[0],T=E[1],M=(0,f.useState)(j),D=M[0],R=M[1],A=(0,f.useState)(u),B=A[0],N=A[1],L=(0,v.Db)(K.ZP.variables.pipelines.useUpdate(m,x),{onSuccess:function(e){return(0,$.wD)(e,{callback:function(){N(!1),c()}})}}),U=(0,r.Z)(L,1)[0],H=(0,f.useCallback)((function(e){if("Enter"===e.key){var n=D;try{n=JSON.parse(D)}catch(t){}g?I&&D&&(null===g||void 0===g||g((0,l.Z)({},I,D)),N(!1)):U({variable:{name:I,value:n}}),(0,xi.ez)(),null===p||void 0===p||p()}else"Escape"===e.key&&((0,xi.ez)(),N(!1),null===h||void 0===h||h())}),[p,h,g,U,I,D]),z=(0,f.useCallback)((function(){(0,xi.ez)(),t()}),[t]);(0,f.useEffect)((function(){var e,n;B&&(a?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,a]);var G=n||"kwargs['".concat(x,"']");return(0,S.jsx)("div",{onMouseEnter:function(){return _(!0)},onMouseLeave:function(){return _(!1)},children:(0,S.jsxs)(Bi.Z,{children:[(0,S.jsx)(Ai.Z,{hiddenSmDown:!0,md:1,children:(0,S.jsx)(Ui,{noPadding:!0,children:(0,S.jsx)(F.ZP,{backgroundColor:Hi.qJ,borderless:!0,centerText:!0,muted:!0,onClick:function(){navigator.clipboard.writeText(G),Kn.Am.success("Successfully copied to clipboard.",{position:Kn.Am.POSITION.BOTTOM_RIGHT,toastId:x})},small:!0,uuid:"Sidekick/GlobalVariables/".concat(x),withIcon:!0,children:(0,S.jsx)(V.CK,{size:2.5*w.iI})})})}),(0,S.jsx)(Ai.Z,{md:4,children:B&&!i?(0,S.jsx)(Ui,{children:(0,S.jsx)(W.Z,{borderless:!0,compact:!0,fullWidth:!0,monospace:!0,onChange:function(e){T(e.target.value),e.preventDefault()},onKeyDown:H,paddingHorizontal:0,placeholder:"variable",ref:y,small:!0,value:I})}):(0,S.jsx)(Ui,{children:(0,S.jsx)(C.ZP,{color:zi.Or,monospace:!0,small:!0,textOverflow:!0,children:x})})}),(0,S.jsx)(Ai.Z,{md:7,children:B?(0,S.jsx)(Ui,{children:(0,S.jsx)(W.Z,{borderless:!0,compact:!0,fullWidth:!0,monospace:!0,onChange:function(e){R(e.target.value),e.preventDefault()},onKeyDown:H,paddingHorizontal:0,placeholder:"enter value",ref:Z,small:!0,value:D})}):(0,S.jsxs)(Ui,{children:[d?(0,S.jsx)(C.ZP,{monospace:!0,small:!0,children:"********"}):(0,S.jsx)(C.ZP,{monospace:!0,small:!0,children:j}),(0,S.jsxs)(k.Z,{children:[!s&&O&&(0,S.jsx)(F.ZP,{backgroundColor:Hi.qJ,borderless:!0,inline:!0,muted:!0,onClick:function(){N(!0)},small:!0,uuid:"Sidekick/GlobalVariables/edit_".concat(x),withIcon:!0,children:(0,S.jsx)(V.I8,{size:2.5*w.iI})}),t&&O&&(0,S.jsx)(F.ZP,{backgroundColor:Hi.qJ,borderless:!0,inline:!0,muted:!0,onClick:z,small:!0,uuid:"Sidekick/GlobalVariables/delete_".concat(x),withIcon:!0,children:(0,S.jsx)(V.rF,{size:2.5*w.iI})})]})]})})]})})},Wi=p.default.div.withConfig({displayName:"indexstyle__BannerStyle",componentId:"sc-1cm3orh-0"})(["border-radius:","px;padding:","px ","px;",""],Se.n_,1.5*w.iI,w.l4,(function(e){return"\n border: ".concat(Se.YF,"px ").concat(Se.M8," ").concat((e.theme||_e.Z).interactive.defaultBorder,";\n ")})),Ki=t(68781);function Vi(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 qi(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Vi(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Vi(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Yi={borderLess:!0,iconOnly:!0,noBackground:!0,outline:!0,padding:"4px"},Qi={bold:!0,default:!0,inline:!0,monospace:!0,small:!0},Xi=(0,_t.YW)();var Ji=function(e){e.addNewBlockAtIndex;var n,t,i,o,l=e.block,u=(e.contentByBlockUUID,e.fetchFileTree),c=e.fetchPipeline,a=e.globalDataProducts,s=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===s||void 0===s?void 0:s.uuid}),[s]),y=(0,f.useMemo)((function(){return(null===s||void 0===s?void 0:s.retry_config)||{}}),[s]),_=(0,f.useMemo)((function(){return!(null!==s&&void 0!==s&&s.run_pipeline_in_one_process)&&[H.qL.PYSPARK,H.qL.PYTHON].includes(null===s||void 0===s?void 0:s.type)}),[s]),E=l.color,I=l.configuration,T=l.language,M=l.name,R=l.type,A=l.uuid,B=(0,f.useMemo)((function(){return b.tf.DBT===R}),[R]),N=null===s||void 0===s||null===(n=s.blocks)||void 0===n?void 0:n.findIndex((function(e){return e.uuid===A})),L=(0,f.useMemo)((function(){var e;return null===s||void 0===s||null===(e=s.blocks)||void 0===e?void 0:e[N]}),[N,null===s||void 0===s?void 0:s.blocks]),U=(0,ee.VI)(null,{},[],{uuid:"BlockSettings/index"}),q=(0,r.Z)(U,1)[0],Y=(0,f.useMemo)((function(){return(0,Ie.HK)(a||[],(function(e){return e.uuid}))}),[a]),X=(0,f.useMemo)((function(){var e,n=null===I||void 0===I||null===(e=I.global_data_product)||void 0===e?void 0:e.uuid;if(n&&Y)return null===Y||void 0===Y?void 0:Y[n]}),[I,Y]),ne=K.ZP.pipelines.detail(Ti.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],se=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,at.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){se(!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 qi(qi({},n),{},{configuration:qi(qi({},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||Ki.R.find((function(e){return e===we}))||ve(!0)}),[fe,we]);var _e=K.ZP.blocks.pipelines.detail(g,encodeURIComponent(A),{_format:"with_settings",block_type:R}).data,Se=(0,f.useMemo)((function(){return(null===_e||void 0===_e?void 0:_e.block)||{}}),[_e]),Ee=(0,f.useMemo)((function(){return null!==Se&&void 0!==Se&&Se.pipelines?Object.values(null===Se||void 0===Se?void 0:Se.pipelines):[]}),[Se]),Te=(null===Ee||void 0===Ee?void 0:Ee.length)||1,Me=(0,v.Db)(K.ZP.blocks.pipelines.useUpdate(g,encodeURIComponent(A)),{onSuccess:function(e){return(0,$.wD)(e,{callback:function(e){se(!1),u(),c(),null!==e&&void 0!==e&&e.block&&d(null===e||void 0===e?void 0:e.block)},onErrorCallback:function(e,n){return q({errors:n,response:e})}})}}),De=(0,r.Z)(Me,2),Re=De[0],Ae=De[1].isLoading,Be=((0,f.useCallback)((function(e){return Re({block:e})}),[Re]),(0,f.useMemo)((function(){return Te>=1&&(0,S.jsx)(ae.cl,{children:(0,S.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===s||void 0===s?void 0:s.uuid)===o?(0,S.jsxs)(C.ZP,{monospace:!0,muted:!0,children:[i||o," (current)"]},"name"):(0,S.jsx)(P.Z,{href:"/pipelines/".concat(o,"/edit"),monospace:!0,openNewWindow:!0,sameColorAsText:!0,children:i||o},"name"),(0,S.jsx)(C.ZP,{default:!0,monospace:!0,children:t||"-"},"description")]})),uuid:"git-branch-blockPipelines"})})}),[Ee,Te,s])),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]),Fe=(0,f.useCallback)((function(e){return ke((function(n){var t;return qi(qi({},n),{},{configuration:qi(qi({},null===oe||void 0===oe?void 0:oe.configuration),{},{global_data_product:e(null===oe||void 0===oe||null===(t=oe.configuration)||void 0===t?void 0:t.global_data_product)})})}))}),[oe,ke]),Ue=(0,f.useMemo)((function(){return(0,de.jO)(l,s)}),[l,s]);return(0,f.useMemo)((function(){return Ue&&(0,de.Uc)(l)}),[l,Ue]),(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(O.Z,{mb:w.HN,pt:w.cd,children:[Te>1&&(0,S.jsx)(O.Z,{mb:w.Mq,px:w.cd,children:(0,S.jsx)(Wi,{children:(0,S.jsxs)(Z.ZP,qi(qi({},Z.A0),{},{children:[(0,S.jsxs)(k.Z,{children:[(0,S.jsx)(V.BG,{fill:zi.$R,size:Q.l2}),(0,S.jsx)(O.Z,{pr:2}),(0,S.jsxs)(C.ZP,{bold:!0,large:!0,lineHeight:3*w.iI,warning:!0,children:["Shared by ",Te," pipelines"]})]}),!B&&(null===s||void 0===s?void 0:s.type)!==H.qL.INTEGRATION&&(0,S.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,S.jsx)(D.ZP,qi(qi({},Yi),{},{afterIcon:(0,S.jsx)(V.L9,{size:Q.bL}),iconOnly:!1,onClick:function(){return p(qi(qi({},(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,S.jsx)(O.Z,{mb:w.HN,px:w.cd,children:(0,S.jsxs)(me.Z,{noBackground:!0,noBoxShadow:!0,sameColorBorders:!0,children:[(0,S.jsx)(me.g,{noBorder:!0,children:(0,S.jsxs)(Z.ZP,qi(qi({},Z.A0),{},{children:[(0,S.jsx)(k.Z,{children:(0,S.jsx)(C.ZP,{bold:!0,default:!0,children:"Name"})}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(D.ZP,qi(qi({},Yi),{},{afterIcon:B?null:(0,S.jsx)(V.I8,{size:Q.bL}),disabled:B,onClick:function(){return p(l,M)},children:(0,S.jsx)(C.ZP,{bold:!0,children:M||""})}))]}))}),b.tf.CUSTOM===(null===l||void 0===l?void 0:l.type)?(0,S.jsx)(me.g,{noBorder:!0,children:(0,S.jsxs)(Z.ZP,qi(qi({},Z.A0),{},{children:[(0,S.jsx)(k.Z,{children:(0,S.jsx)(C.ZP,{bold:!0,default:!0,children:"Color"})}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(D.ZP,qi(qi({},Yi),{},{afterIcon:(0,S.jsx)(j.Z,{color:E?Xi[E]:null,size:Q.bL,square:!0}),onClick:function(){return p(l,M)},outline:!1,children:(0,S.jsx)(C.ZP,{bold:!0,children:(0,J.kC)(E||"")})}))]}))}):null]})}),(0,S.jsxs)(O.Z,{mb:w.HN,px:w.cd,children:[(0,S.jsx)(ue.Z,{level:5,children:"Executor type"}),(0,S.jsxs)(C.ZP,{muted:!0,children:["For more information on this setting, please read the ",(0,S.jsx)(P.Z,{href:"https://docs.mage.ai/production/configuring-production-settings/compute-resource#2-set-executor-type-and-customize-the-compute-resource-of-the-mage-executor",openNewWindow:!0,children:"documentation"}),"."]}),(0,S.jsxs)(O.Z,{mt:1,children:[!fe&&(0,S.jsx)(z.Z,{label:"Executor type",onChange:function(e){return ke((function(n){return qi(qi({},n),{},{executor_type:e.target.value})}))},primary:!0,ref:h,value:(null===oe||void 0===oe?void 0:oe.executor_type)||"",children:Ki.R.map((function(e){return(0,S.jsx)("option",{value:e,children:e},e)}))}),fe&&(0,S.jsx)(W.Z,{label:"Executor type",monospace:!0,onChange:function(e){return ke((function(n){return qi(qi({},n),{},{executor_type:e.target.value})}))},primary:!0,ref:m,setContentOnMount:!0,value:(null===oe||void 0===oe?void 0:oe.executor_type)||""}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsx)(P.Z,{muted:!0,onClick:function(){fe?(ke((function(e){return qi(qi({},e),{},{executor_type:null})})),setTimeout((function(){var e;return null===h||void 0===h||null===(e=h.current)||void 0===e?void 0:e.focus()}),1)):setTimeout((function(){var e;return null===m||void 0===m||null===(e=m.current)||void 0===e?void 0:e.focus()}),1),ve(!fe)},preventDefault:!0,small:!0,children:fe?"Select a preset executor type":"Enter a custom executor type"})})]})]}),(0,S.jsxs)(O.Z,{mb:w.HN,px:w.cd,children:[(0,S.jsx)(ue.Z,{level:5,children:"Retry configuration"}),(0,S.jsxs)(C.ZP,{muted:!0,children:[Ne&&(0,S.jsxs)(S.Fragment,{children:["This block is currently using the retry configuration from the pipeline. You can override the pipeline\u2019s retry configuration for this block.",(0,S.jsx)("br",{})]}),"For more information on this setting, please read the ",(0,S.jsx)(P.Z,{href:"https://docs.mage.ai/orchestration/pipeline-runs/retrying-block-runs",openNewWindow:!0,children:"documentation"}),"."]}),(0,S.jsxs)(O.Z,{mt:1,children:[(0,S.jsxs)(Z.ZP,{children:[(0,S.jsx)(W.Z,{label:"Retries",monospace:!0,onChange:function(e){return ke((function(n){var t;return qi(qi({},n),{},{retry_config:qi(qi({},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,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(W.Z,{label:"Delay",monospace:!0,onChange:function(e){return ke((function(n){var t;return qi(qi({},n),{},{retry_config:qi(qi({},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,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(W.Z,{label:"Max delay",monospace:!0,onChange:function(e){return ke((function(n){var t;return qi(qi({},n),{},{retry_config:qi(qi({},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,S.jsx)(O.Z,{mt:w.cd,children:(0,S.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 qi(qi({},e),{},{retry_config:qi(qi({},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)})})}))}})})]})]}),_&&(0,S.jsxs)(O.Z,{mb:w.HN,px:w.cd,children:[(0,S.jsx)(ue.Z,{level:5,children:"Block run timeout"}),(0,S.jsx)(O.Z,{mb:1}),(0,S.jsx)(W.Z,{label:"Time in seconds",monospace:!0,onChange:function(e){return ke((function(n){return qi(qi({},n),{},{timeout:e.target.value})}))},primary:!0,setContentOnMount:!0,type:"number",value:(null===oe||void 0===oe?void 0:oe.timeout)||""}),(0,S.jsx)(O.Z,{mb:1}),(0,S.jsx)(C.ZP,{muted:!0,small:!0,children:"The block timeout will only be applied when the block is run through a trigger. If a block times out, the block run will be set to a failed state."})]}),B&&(0,S.jsxs)(O.Z,{mb:w.HN,px:w.cd,children:[(0,S.jsx)(ue.Z,{level:5,children:"dbt settings"}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsx)(x.Z,{checked:!(null===oe||void 0===oe||null===(t=oe.configuration)||void 0===t||null===(i=t.dbt)||void 0===i||!i.disable_tests),label:"Disable automatically running dbt tests",onClick:function(){return ke((function(e){var n,t,i;return qi(qi({},e),{},{configuration:qi(qi({},null===e||void 0===e?void 0:e.configuration),{},{dbt:qi(qi({},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(R)&&b.t6.PYTHON===T&&(0,S.jsxs)(O.Z,{mb:w.HN,px:w.cd,children:[(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(ue.Z,{level:5,children:"Block variables"}),(0,S.jsx)(O.Z,{ml:2}),(0,S.jsx)(F.ZP,{Icon:V.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,S.jsxs)(O.Z,{mb:w.cd,mt:1,children:[(0,S.jsxs)(C.ZP,{muted:!0,children:["Press",(0,S.jsx)(C.ZP,qi(qi({},Qi),{},{children:" Enter"}))," or",(0,S.jsx)(C.ZP,qi(qi({},Qi),{},{children:" Return"}))," on a row to add or update a variable. These variables are only accessible in this block\xa0",(0,S.jsxs)(C.ZP,qi(qi({},Qi),{},{bold:!1,children:["(",A,")."]})),(0,S.jsxs)(C.ZP,{inline:!0,muted:!0,children:[" Refer to the",(0,S.jsx)(P.Z,{href:"https://docs.mage.ai/development/variables/block-variables",openNewWindow:!0,children:" documentation"})," for more details."]})]}),(0,S.jsxs)(C.ZP,{muted:!0,children:[(0,S.jsx)(C.ZP,{bold:!0,inline:!0,warning:!0,children:"Note: "}),"Click the",(0,S.jsx)(C.ZP,qi(qi({},Qi),{},{children:" Update block settings"}))," button below to save changes. If you do not, any new or updated block variables will not be persisted."]})]}),(0,S.jsxs)(O.Z,{mb:w.cd,children:[ge&&(0,S.jsx)(Gi,{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,S.jsx)(Gi,{copyText:"kwargs['configuration'].get('".concat(n,"')"),deleteVariable:function(){var e=qi({},null===oe||void 0===oe?void 0:oe.configuration);delete e[n],ke((function(n){return qi(qi({},n),{},{configuration:qi({},e)})}))},disableKeyEdit:!0,updateVariable:Ce,variable:{uuid:n,value:e[1]}},n)}))]})]}),b.tf.GLOBAL_DATA_PRODUCT===R&&(0,S.jsxs)(O.Z,{mb:w.HN,children:[(0,S.jsx)(O.Z,{px:w.cd,children:(0,S.jsx)(ue.Z,{level:5,children:"Override global data product settings"})}),(0,S.jsx)(O.Z,{mt:w.Mq,children:(0,S.jsx)(Mi.Z,{objectAttributes:Le,originalAttributes:X,setObjectAttributes:Fe})}),(0,S.jsx)(O.Z,{mt:w.Mq,children:(0,S.jsx)(Di.Z,{objectAttributes:Le,originalAttributes:X,setObjectAttributes:Fe})}),(0,S.jsx)(O.Z,{mt:w.Mq,children:(0,S.jsx)(Ri.Z,{blocks:null===te||void 0===te?void 0:te.blocks,objectAttributes:Le,originalAttributes:X,setObjectAttributes:Fe})})]}),(0,S.jsx)(O.Z,{px:w.cd,children:(0,S.jsx)(D.ZP,{disabled:!ce,loading:Ae,onClick:function(){return Re({block:{configuration:null===oe||void 0===oe?void 0:oe.configuration,executor_type:null===oe||void 0===oe?void 0:oe.executor_type,retry_config:ye,timeout:null===oe||void 0===oe?void 0:oe.timeout}})},primary:!0,children:"Update block settings"})})]}),(0,S.jsxs)(O.Z,{mb:w.HN,children:[!_e&&(0,S.jsx)(O.Z,{p:w.cd,children:(0,S.jsx)(G.Z,{inverted:!0})}),_e&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(O.Z,{p:w.cd,children:[(0,S.jsxs)(ue.Z,{level:5,children:["Pipelines using this block (",Te,")"]}),(0,S.jsx)(C.ZP,{default:!0,children:"A shared block is available to and reused by multiple pipelines. It enables you to write code once and have it easily accessible anywhere in the workspace. As a result, any code changes will affect all pipelines sharing the block."})]}),Be]})]})]})},$i=t(4006),eo=t(12869),no=t(10305),to=t(84820),io=t(85108),oo=t(97301);function ro(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function lo(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ro(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ro(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function uo(e,n){var t,i,o,u,c=e.autocompleteItems,a=e.block,s=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,D=e.savePipelineContent,R=e.selected,A=e.setAnyInputFocused,B=e.setErrors,N=e.setSelectedBlock,L=e.setTextareaFocused,U=e.textareaFocused,H=e.updateWidget,q=e.width,Y=(0,f.useRef)(null),Q=(0,f.useContext)(p.ThemeContext),X=K.ZP.blocks.pipelines.detail(null===I||void 0===I?void 0:I.uuid,null===a||void 0===a?void 0:a.upstream_blocks[0]).data,ee=(null===X||void 0===X||null===(t=X.block)||void 0===t?void 0:t.outputs)||(null===a||void 0===a?void 0:a.outputs)||[],ne=(0,f.useState)(null),te=ne[0],ie=ne[1],oe=(0,f.useState)(null===(i=a.configuration)||void 0===i?void 0:i.chart_type),re=oe[0],ue=oe[1],ce=(0,f.useState)(a.configuration),ae=ce[0],se=ce[1],de=(0,f.useState)(a.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===a||void 0===a?void 0:a.upstream_blocks),we=Ce[0],Se=Ce[1],Ee=(0,f.useState)((null===ee||void 0===ee?void 0:ee.length)||0),Te=Ee[0],Me=Ee[1],De=(0,f.useState)(a.uuid),Re=De[0],Ae=De[1],Be=io.G8[re],Ne=io.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]),Fe=(0,f.useMemo)((function(){return(0,Ie.HK)(Le,(function(e){return e.uuid}))}),[Le]),Ue=!!M.find((function(e){return e.uuid===a.uuid}))||(null===y||void 0===y?void 0:y.length)>=1&&m!==bt.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]),ze=!!He.find((function(e){return e.error})),Ge=He.length>=1,We=(0,f.useMemo)((function(){return{blockType:a.type,hasError:ze,selected:R}}),[a.type,ze,R]);if(null!==He&&void 0!==He&&He.length){var Ke,Ve,qe=He.length-1;u=null===He||void 0===He||null===(Ke=He[qe])||void 0===Ke||null===(Ve=Ke.data)||void 0===Ve?void 0:Ve[0]}u?(u=(u=u.slice(1,u.length-1)).replaceAll('\\"','"').replaceAll("\\'","'"),(0,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;bt.Gi.TEXT===i&&(0,J.Pb)(t)&&(o[r]=JSON.parse(t))})));var Ye=(0,f.useCallback)((function(e){var n=lo(lo(lo({},a),e),{},{configuration:lo(lo({},a.configuration),e.configuration)});D().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=Fe[e])||void 0===n?void 0:n.status)}))})})),Me((function(e){return e+1}))}),[a,Fe,pe,T,D,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;se((function(n){return lo(lo({},n),e)}));var i=lo(lo({},a),{},{configuration:lo(lo(lo({},ae),e),{},{chart_type:re})});H(i),Te&&t&&Ye(i)}),[a,re,ae,Te,Ye,se,H]);(0,f.useEffect)((function(){ie({python:(0,to.Z)({autocompleteItems:c,block:a,blocks:d,pipeline:I})})}),[c,a,d,I]);var Je=(0,f.useMemo)((function(){return(0,S.jsx)(le.Z,{autoHeight:!0,autocompleteProviders:te,onChange:Qe,selected:R,setSelected:function(e){return N(!0===e?a:null)},setTextareaFocused:L,showLineNumbers:!1,textareaFocused:U||gi.oV.TABLE===re&&!he,value:pe,width:"100%"})}),[te,a,re,pe,he,R,N,L,U,Qe]),$e=(0,f.useMemo)((function(){return(ze||Ge)&&(0,S.jsx)(eo.Z,lo(lo({},We),{},{block:a,contained:!1,hideExtraInfo:!0,isInProgress:Ue,messages:He,selected:R}))}),[a,We,ze,Ge,Ue,He,R]),en=(0,at.Z)(he),nn=(0,at.Z)(q);(0,f.useEffect)((function(){var e,n=null===Y||void 0===Y||null===(e=Y.current)||void 0===e?void 0:e.getBoundingClientRect();en!==he||nn!==q?(Pe(0),setTimeout((function(){var e,n,t=null===Y||void 0===Y||null===(e=Y.current)||void 0===e||null===(n=e.getBoundingClientRect())||void 0===n?void 0:n.width;t&&Pe(t)}),100)):n&&Pe(n.width)}),[he,en,Y,Pe,q,nn]);var tn=(0,f.useMemo)((function(){var e=[];return we.forEach((function(n,t){var i=Fe[n],o=(0,_.qn)(null===i||void 0===i?void 0:i.type,{blockColor:null===i||void 0===i?void 0:i.color,theme:Q}).accent;e.push((0,S.jsxs)(O.Z,{ml:2,children:[(0,S.jsxs)(C.ZP,{bold:!0,inline:!0,monospace:!0,small:!0,children:["df_",t+1]})," ",(0,S.jsx)(C.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:"->"})," ",(0,S.jsx)(P.Z,{color:o,inline:!0,onClick:function(){var e,n,t=null===s||void 0===s||null===(e=s.current)||void 0===e?void 0:e["".concat(null===i||void 0===i?void 0:i.type,"s/").concat(null===i||void 0===i?void 0:i.uuid,".py")];null===t||void 0===t||null===(n=t.current)||void 0===n||n.scrollIntoView()},preventDefault:!0,small:!0,children:(0,S.jsx)(C.ZP,{color:o,monospace:!0,small:!0,children:n})})]},n))})),e}),[s,Fe,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 gi.Tv.includes(t)?e.concat(t):e}),[]);return null===t||void 0===t||t.forEach((function(e){var t=ae[e];if(t){var i,o,r=null===(i=io.SR[re])||void 0===i||null===(o=i[e])||void 0===o?void 0:o.call(i);n.push((0,S.jsxs)(O.Z,{ml:2,children:[(0,S.jsx)(C.ZP,{bold:!0,inline:!0,monospace:!0,small:!0,children:t})," ",r&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:"->"})," ",(0,S.jsx)(C.ZP,{default:!0,inline:!0,small:!0,children:r})]})]},t))}})),n}),[re,ae,Be]),rn=(0,at.Z)(re),ln=(0,at.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)(ae)&&Ne){var e=lo(lo({},a),{},{upstream_blocks:we});Ne.configuration&&Xe(Ne.configuration(e)),Ne.content&&Qe(Ne.content(e))}}),[a,re,rn,ae,pe,Ne,Xe,Qe,we,ln]);var un=(0,f.useMemo)((function(){return ae[gi.v8]||1}),[ae]),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 lo(lo({},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,s=e.type,d=e.uuid,p={fullWidth:!0,key:d,label:(0,J.kC)(i()),monospace:o,onBlur:function(){return N(a)},onChange:function(e){return Xe((0,l.Z)({},d,e.target.value),{autoRun:t})},onFocus:function(){return N(a)},value:(null===ae||void 0===ae?void 0:ae[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(io.VR.COLUMNS===s){var v=ae[d]||[];n=(0,S.jsxs)(S.Fragment,{children:[(!c.maxValues||v.length<c.maxValues)&&(0,S.jsx)(z.Z,lo(lo({},p),{},{onChange:function(e){var n=ae[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,S.jsx)("option",{value:e,children:e},e)}))})),v.map((function(e){return(0,S.jsx)("div",{style:{display:"inline-block",marginRight:2,marginTop:2},children:(0,S.jsx)(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(io.VR.METRICS===s){var h=ae[d]||[];n=(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C.ZP,{bold:!0,children:"Metrics"}),(0,S.jsx)(C.ZP,{muted:!0,small:!0,children:"Select a column and an aggregation function."}),(0,S.jsxs)(no.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,S.jsx)(z.Z,lo(lo({},p),{},{label:"aggregation",children:(0,Ie.YC)(gi.bn,(function(e){return e})).map((function(e){return(0,S.jsx)("option",{value:e,children:e},e)}))})),(0,S.jsx)(z.Z,lo(lo({},p),{},{label:"column",children:(0,Ie.YC)(f,(function(e){return e})).map((function(e){return(0,S.jsx)("option",{value:e,children:e},e)}))}))]}),h.map((function(e){var n=e.aggregation,i=e.column;return(0,S.jsx)("div",{style:{display:"inline-block",marginRight:2,marginTop:2},children:(0,S.jsx)(ke.Z,{label:(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(C.ZP,{inline:!0,monospace:!0,children:[n,"("]}),i,(0,S.jsx)(C.ZP,{inline:!0,monospace:!0,children:")"})]}),onClick:function(){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,S.jsx)(z.Z,lo(lo({},p),{},{children:r.map((function(e){return(0,S.jsx)("option",{value:e,children:e},e)}))})):(0,S.jsx)(W.Z,lo(lo({},p),{},{type:s}));return(0,S.jsx)(O.Z,{mb:1,children:n},d)}))))}),{noCode:[]})}),[a,ae,Be,X,N,Xe]),an=cn.code,sn=cn.noCode,dn=(0,v.Db)(K.ZP.widgets.pipelines.useUpdate(null===I||void 0===I?void 0:I.uuid,a.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(a.uuid),vn=(0,Bn.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(Dn.Uq)&&String(t[1])!==String(Dn.zX)&&pn({widget:lo(lo({},a),{},{name:Re})})}),[a,be,Re,pn]),(0,S.jsx)(Ai.Z,{sm:12,md:12*un,children:(0,S.jsxs)(oo.pM,{ref:n,children:[(0,S.jsx)(O.Z,{mt:1,pt:1,px:1,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",fullWidth:!0,justifyContent:"space-between",children:[(0,S.jsxs)(k.Z,{flex:1,style:{position:"relative"},children:[(0,S.jsx)(Bt,{bold:!1,fullWidth:!0,inputValue:Re,notRequired:!0,onBlur:function(){return setTimeout((function(){return xe(!1)}),300)},onChange:function(e){Ae(e.target.value),e.preventDefault()},onClick:function(){A(!0),xe(!0)},onFocus:function(){A(!0),xe(!0)},small:!0,stacked:!0,value:!be&&a.uuid}),be&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Z,{ml:1}),(0,S.jsx)(P.Z,{noWrapping:!0,onClick:function(){return pn({widget:lo(lo({},a),{},{name:Re})})},preventDefault:!0,sameColorAsText:!0,small:!0,children:"Update chart name"})]})]}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(z.Z,{compact:!0,onChange:function(e){var n=[e.target.value],t=lo(lo({},a),{},{upstream_blocks:n});H(t),Ye(t),Se(n)},placeholder:"Source block",small:!0,value:(null===we||void 0===we?void 0:we[0])||"",children:null===Le||void 0===Le?void 0:Le.map((function(e){var n=e.uuid;return(0,S.jsx)("option",{value:n,children:n},n)}))}),(0,S.jsx)(O.Z,{mr:1}),!Ue&&(0,S.jsx)(Oe.Z,{appearBefore:!0,default:!0,label:"Run chart block",size:null,widthFitContent:!0,children:(0,S.jsx)(F.ZP,{blackBorder:!0,compact:!0,inline:!0,onClick:function(){return Ye(a)},uuid:"ChartBlock/run/".concat(a.uuid),children:(0,S.jsx)(V.Py,{size:2*w.iI})})}),bt.uF.QUEUED===m&&(0,S.jsx)(G.Z,{color:(Q||_e.Z).content.active,small:!0,type:"cylon"}),bt.uF.BUSY===m&&(0,S.jsx)(G.Z,{color:(Q||_e.Z).content.active,small:!0}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(Oe.Z,{appearBefore:!0,default:!0,label:"Edit chart",size:null,widthFitContent:!0,children:(0,S.jsx)(F.ZP,{blackBorder:!0,compact:!0,inline:!0,onClick:function(){return me((function(e){return!e}))},selected:he,uuid:"ChartBlock/edit/".concat(a.uuid),children:(0,S.jsx)(V.I8,{size:2*w.iI})})}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(Oe.Z,{appearBefore:!0,default:!0,label:"Delete chart",size:null,widthFitContent:!0,children:(0,S.jsx)(F.ZP,{blackBorder:!0,compact:!0,inline:!0,onClick:function(){return h(a)},uuid:"ChartBlock/delete/".concat(a.uuid),children:(0,S.jsx)(V.rF,{size:2*w.iI})})})]})]})}),(0,S.jsx)(O.Z,{mt:1}),(0,S.jsxs)(Z.ZP,{fullWidth:!0,justifyContent:"space-between",children:[(0,S.jsx)(k.Z,{flex:6,ref:Y,children:o&&!(0,je.Qr)(o)&&(0,S.jsx)(O.Z,{pb:3,children:(0,S.jsx)($i.Z,{block:lo(lo({},a),{},{configuration:lo(lo({},a.configuration),ae)}),data:o,width:Ze})})}),he&&(0,S.jsx)(oo.Tb,{children:(0,S.jsxs)(Z.ZP,{flexDirection:"column",fullWidth:!0,children:[(0,S.jsx)(O.Z,{mb:1,children:(0,S.jsx)(z.Z,{onChange:function(e){var n=e.target.value,t=lo(lo({},a),{},{configuration:lo(lo({},ae),{},{chart_type:n})});H(t),Ye(t),ue(n)},placeholder:"Select chart type",value:re,children:gi.CK.map((function(e){return(0,S.jsx)("option",{value:e,children:(0,J.kC)(e)},e)}))})}),(0,S.jsx)(O.Z,{mb:1,children:(0,S.jsx)(z.Z,{onChange:function(e){return Xe((0,l.Z)({},gi.v8,e.target.value))},placeholder:"Chart width",value:(null===ae||void 0===ae?void 0:ae[gi.v8])||1,children:[["1/2 width",.5],["full width",1]].map((function(e){var n=(0,r.Z)(e,2),t=n[0],i=n[1];return(0,S.jsx)("option",{value:i,children:t},t)}))})}),sn]})})]}),he&&!(null===an||void 0===an||!an.length)&&b.t6.SQL!==a.language&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(O.Z,{my:1,px:1,children:[(0,S.jsx)(C.ZP,{bold:!0,children:"Custom chart code"}),(0,S.jsxs)(C.ZP,{muted:!0,children:["Write custom logic mapping data to input values for your chart.",(0,S.jsx)("br",{}),"This code is only executed if you don\u2019t have any columns or metrics selected."]})]}),(0,S.jsxs)(oo.T7,{children:[we.length>=1&&(0,S.jsxs)(oo.y9,{children:[(0,S.jsxs)(C.ZP,{muted:!0,small:!0,children:["Variables you can use in your code: ",tn]}),(0,S.jsxs)(C.ZP,{muted:!0,small:!0,children:["Variables that you must define: ",on]})]}),Je]})]}),$e&&(0,S.jsx)(O.Z,{px:1,children:$e})]})})}var co=f.forwardRef(uo),ao=["blockRefs","blocks","chartRefs","deleteWidget","messages","onChangeChartBlock","runBlock","runningBlocks","savePipelineContent","selectedBlock","setAnyInputFocused","setErrors","setSelectedBlock","setTextareaFocused","textareaFocused","updateWidget","widgets","width"];function so(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function po(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?so(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):so(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var fo=function(e){var n=e.blockRefs,t=e.blocks,i=e.chartRefs,o=e.deleteWidget,r=e.messages,u=e.onChangeChartBlock,c=e.runBlock,a=e.runningBlocks,s=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,ao),k=(0,f.useMemo)((function(){return a.reduce((function(e,n,t){return po(po({},e),{},(0,l.Z)({},n.uuid,po(po({},n),{},{priority:t})))}),{})}),[a]);return(0,S.jsxs)(Z.ZP,{flexDirection:"column",fullWidth:!0,children:[(0,S.jsx)(Bi.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?bt.uF.BUSY:bt.uF.QUEUED:bt.uF.IDLE;return i.current[l]=(0,f.createRef)(),(0,f.createElement)(co,po(po({},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:a,savePipelineContent:s,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,S.jsx)("div",{style:{height:"80vh"}})]})},vo=t(24138),ho=p.default.svg.withConfig({displayName:"EmptyCharts__SVGStyle",componentId:"sc-ttsjrp-0"})([""]),mo=function(e){var n=e.size,t=void 0===n?20:n,i=e.viewBox,o=void 0===i?"0 0 358 305":i;return(0,S.jsxs)(ho,{height:t*(305/358),viewBox:o,width:t,children:[(0,S.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M290 47H66c-3.866 0-7 3.134-7 7v200c0 3.866 3.134 7 7 7h224c3.866 0 7-3.134 7-7V54c0-3.866-3.134-7-7-7zM66 46c-4.4183 0-8 3.5817-8 8v200c0 4.418 3.5817 8 8 8h224c4.418 0 8-3.582 8-8V54c0-4.4183-3.582-8-8-8H66z",fill:"#000"}),(0,S.jsx)("path",{fill:"#000",d:"M118 46h1v216h-1zM178 46h1v216h-1zM238 46h1v216h-1z"}),(0,S.jsx)("path",{fill:"#000",d:"M59 208.25v-1h239v1zM59 154.5v-1h239v1zM59 100.75v-1h239v1z"}),(0,S.jsx)("rect",{x:"209.651",y:"17.1125",width:"1.0163",height:"14.2284",rx:".5082",transform:"rotate(24.933 209.651 17.1125)",fill:"#2AB2FE"}),(0,S.jsx)("path",{fill:"#2AB2FE",d:"M207.788 23.5313l35.4813 16.4949-.4285.9215-35.4812-16.4948zM247.033 31.9316c.946-2.0359 3.364-2.9191 5.4-1.9726l31.795 14.7811-11.383 24.4836-31.794-14.7811c-2.036-.9465-2.92-3.3642-1.973-5.4002l7.955-17.1108z"}),(0,S.jsx)("path",{d:"M284.228 44.7401l31.795 14.7811c2.036.9465 2.919 3.3642 1.972 5.4001l-7.954 17.1109c-.947 2.0359-3.365 2.9191-5.401 1.9726l-31.795-14.7811 11.383-24.4836z",fill:"#0093E4"}),(0,S.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M352.959 83.7347a.5082.5082 0 00-.675.2466l-2.571 5.5296-35.481-16.4949-.428.9216 35.481 16.4949-2.571 5.5295a.5081.5081 0 00.247.675.5082.5082 0 00.675-.2466l5.57-11.9806a.5083.5083 0 00-.247-.6751z",fill:"#2AB2FE"}),(0,S.jsx)("circle",{cx:"55.2178",cy:"34.6274",r:"5.2954",fill:"#8ADE00"}),(0,S.jsx)("circle",{cx:"113.818",cy:"106.582",r:"5.2954",fill:"#8ADE00"}),(0,S.jsx)("circle",{cx:"84.2832",cy:"80.6953",r:"5.2954",fill:"#8ADE00"}),(0,S.jsx)("circle",{cx:"117.115",cy:"43.6274",r:"5.2954",fill:"#8ADE00"}),(0,S.jsx)("path",{d:"M337.354 256.065a38.3848 38.3848 0 01-10.816 21.271 38.3722 38.3722 0 01-21.293 10.768 38.3787 38.3787 0 01-23.542-3.895 38.3764 38.3764 0 01-16.691-17.054l17.208-8.494a19.1932 19.1932 0 0020.117 10.475 19.189 19.189 0 0010.647-5.385c2.886-2.88 4.78-6.605 5.407-10.635l18.963 2.949z",fill:"#FF3C3C"}),(0,S.jsx)("path",{d:"M294.876 288.277a38.3849 38.3849 0 01-21.64-10.056 38.3818 38.3818 0 01-11.516-20.899 38.3896 38.3896 0 013.06-23.666 38.386 38.386 0 0116.453-17.283l9.098 16.897a19.1904 19.1904 0 00-9.757 20.474 19.1937 19.1937 0 005.758 10.45 19.194 19.194 0 0010.82 5.028l-2.276 19.055z",fill:"#2ECDF7"}),(0,S.jsx)("path",{d:"M275.892 219.85a38.3804 38.3804 0 0145.342-1.268 38.3803 38.3803 0 0114.45 18.989 38.3873 38.3873 0 01.436 23.858l-18.346-5.631a19.1827 19.1827 0 00-.218-11.929 19.1907 19.1907 0 00-7.225-9.495 19.1875 19.1875 0 00-11.439-3.39 19.192 19.192 0 00-11.232 4.024l-11.768-15.158z",fill:"#885EFF"}),(0,S.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M259.206 102.57c.241.135.327.439.193.68l-39.314 70.576c-.613 1.1-1.962 1.565-3.124 1.093-3.766-1.53-13.762-5.285-26.356-7.597-12.6-2.314-27.762-3.177-41.881 1.037-16.112 4.81-27.78 14.07-35.424 22.135-3.822 4.032-6.635 7.763-8.491 10.483-.928 1.36-1.616 2.467-2.072 3.232-.228.383-.397.68-.509.881-.057.1-.098.177-.126.227l-.03.057-.008.014-.001.003a.5008.5008 0 01-.676.21.5005.5005 0 01-.209-.676l.442.233-.442-.233.001-.001.002-.005.009-.016.033-.062c.03-.055.073-.135.132-.239.116-.208.29-.513.523-.904.465-.782 1.165-1.906 2.105-3.285 1.881-2.756 4.727-6.53 8.591-10.607 7.727-8.153 19.539-17.532 35.864-22.405 14.331-4.278 29.668-3.391 42.347-1.063 12.685 2.329 22.748 6.109 26.552 7.654.699.284 1.51.002 1.875-.653l39.313-70.575a.5008.5008 0 01.681-.194z",fill:"#7D55EC"}),(0,S.jsx)("path",{d:"M221.651 176.111c0 2.139-1.734 3.873-3.873 3.873-2.139 0-3.873-1.734-3.873-3.873 0-2.139 1.734-3.873 3.873-3.873 2.139 0 3.873 1.734 3.873 3.873zM157.778 166.428c0 2.139-1.734 3.873-3.873 3.873-2.139 0-3.873-1.734-3.873-3.873 0-2.139 1.734-3.873 3.873-3.873 2.139 0 3.873 1.734 3.873 3.873zM106.428 204.191c0 2.139-1.734 3.873-3.873 3.873-2.139 0-3.8726-1.734-3.8726-3.873 0-2.139 1.7336-3.873 3.8726-3.873s3.873 1.734 3.873 3.873zM262.35 104.459c0 2.139-1.734 3.873-3.873 3.873-2.139 0-3.873-1.734-3.873-3.873 0-2.139 1.734-3.873 3.873-3.873 2.139 0 3.873 1.734 3.873 3.873z",fill:"#7D55EC"}),(0,S.jsx)("path",{d:"M8.5523 214.855c-.3562-1.045.2025-2.181 1.248-2.538l13.7251-4.677c1.0456-.356 2.1819.203 2.5382 1.248l29.6737 87.084-17.5112 5.967-29.6738-87.084z",fill:"#4776FF"}),(0,S.jsx)("path",{d:"M45.0935 264.735c-.3562-1.045.2025-2.182 1.2481-2.538l13.725-4.677c1.0455-.356 2.1819.203 2.5382 1.248l10.6438 31.237-17.5112 5.967-10.6439-31.237z",fill:"#FFCC19"}),(0,S.jsx)("path",{d:"M54.4607 234.868c-.3563-1.046.2025-2.182 1.248-2.538l13.7251-4.677c1.0455-.356 2.1819.202 2.5382 1.248l18.7879 55.137-17.5113 5.967-18.7879-55.137z",fill:"#4776FF"})]})};var go,bo=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,S.jsx)(S.Fragment,{})};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}!function(e){e.DBT="dbt",e.GREAT_EXPECTATIONS="great_expectations"}(go||(go={}));var yo=function(e){var n,t,i=e.block,o=e.blockActionDescription,r=e.blocks,l=e.inputPlaceholder,u=e.loading,c=e.onClickTag,a=e.runBlockAndTrack,s=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],R=T[1],A=(0,f.useMemo)((function(){return(0,Ie.HK)(r,(function(e){return e.uuid}))}),[r]);(0,f.useEffect)((function(){M||R((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,_.qn)(r,{blockColor:i,theme:h}).accent;t>=1&&e.push((0,S.jsx)(y.Z,{light:!0},"divider-".concat(l)));var c=!(null===M||void 0===M||!M[l]),a=null!==s&&"undefined"!==typeof s&&!(null!==s&&void 0!==s&&s.includes(o));e.push((0,S.jsx)(O.Z,{px:2,py:1,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(k.Z,{alignItems:"center",children:[(0,S.jsx)(j.Z,{color:u,size:1.5*w.iI,square:!0}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(C.ZP,{monospace:!0,muted:a,small:!0,children:l})]}),a&&(0,S.jsxs)(C.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:[o," support coming soon"]}),!a&&(0,S.jsx)(x.Z,{checked:!a&&c,disabled:a,onClick:function(){R((function(e){var n=jo({},e);return c?delete n[l]:n[l]=l,n}))}})]})},"option-".concat(l)))})),e}),[B,h,M]);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(En.Z,{onClickOutside:function(){return I(!1)},open:!0,children:[(0,S.jsx)(W.Z,{beforeIcon:(0,S.jsx)(V.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,S.jsxs)(S.Fragment,{children:[N,(0,S.jsx)(O.Z,{p:1,children:(0,S.jsx)(Z.ZP,{justifyContent:"flex-end",children:(0,S.jsx)(D.ZP,{compact:!0,loading:u,onClick:function(){return v({block:i,upstream_blocks:Object.keys(M)}).then((function(){return I(!1)}))},small:!0,children:"Save selected blocks"})})})]})]}),!E&&(null===i||void 0===i||null===(n=i.upstream_blocks)||void 0===n?void 0:n.length)>=1&&(0,S.jsxs)(O.Z,{pb:1,pr:1,children:[o&&(0,S.jsx)(O.Z,{mt:1,pl:1,children:(0,S.jsx)(C.ZP,{muted:!0,small:!0,children:o})}),(0,S.jsx)(Z.ZP,{alignItems:"center",children:null===i||void 0===i||null===(t=i.upstream_blocks)||void 0===t?void 0:t.map((function(e){var n=null===A||void 0===A?void 0:A[e];if(!n)return(0,S.jsx)("div",{},e);var t=n.color,o=n.type,r=(0,_.qn)(o,{blockColor:t,theme:h}).accentLight;return(0,S.jsx)(O.Z,{ml:1,mt:1,children:(0,S.jsx)(D.ZP,{backgroundColor:r,compact:!0,disabled:!a,onClick:function(e){(0,Be.j)(e),c?c(n):null===a||void 0===a||a({block:jo(jo({},i),{},{upstream_blocks:[null===n||void 0===n?void 0:n.uuid]})})},small:!0,children:(0,S.jsx)(C.ZP,{monospace:!0,small:!0,children:e})})},e)}))})]})]})},ko=t(75634);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 Po(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 Oo=function(e){var n=e.addNewBlockAtIndex,t=e.autocompleteItems,i=e.blockRefs,o=e.blocks,u=e.blocksInNotebook,c=e.deleteBlock,a=e.extensionOption,s=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,_=e.setAnyInputFocused,E=e.setErrors,I=e.setSelectedBlock,T=e.setTextareaFocused,M=e.showBrowseTemplates,D=e.textareaFocused,R=(0,f.useRef)(null),A=(0,f.useState)(!1),B=A[0],N=A[1],U=(a||{}).uuid,H=(x||{}).extensions,z=(0,f.useMemo)((function(){return(null===a||void 0===a?void 0:a.templates)||[]}),[a]),G=(0,f.useMemo)((function(){return null===H||void 0===H?void 0:H[U]}),[U,H]),W=(0,f.useMemo)((function(){return(null===G||void 0===G?void 0:G.blocks)||[]}),[G]),q=(0,f.useMemo)((function(){return(0,Ie.HK)(W,(function(e){return e.uuid}))}),[W]),Y=(0,f.useMemo)((function(){return U===(null===Z||void 0===Z?void 0:Z.extension_uuid)&&q[null===Z||void 0===Z?void 0:Z.uuid]}),[q,U,Z]),Q=(0,f.useMemo)((function(){return y.reduce((function(e,n,t){return Po(Po({},e),{},(0,l.Z)({},n.uuid,Po(Po({},n),{},{priority:t})))}),{})}),[y]),X=(0,v.Db)((function(e){var n=e.block,t=e.upstream_blocks;return K.ZP.blocks.pipelines.useUpdate(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 W.map((function(e,n){var r=Po(Po({},e),{},{extension_uuid:U}),l=r.type,a=r.uuid,v=(null===Z||void 0===Z?void 0:Z.uuid)===a,P=Q[a],C=P?0===P.priority?bt.uF.BUSY:bt.uF.QUEUED:bt.uF.IDLE,M="".concat(l,"s/").concat(a,".py");return i.current[M]=(0,f.createRef)(),(0,S.jsx)(O.Z,{mt:w.cd,children:(0,S.jsx)(L.Z,{allBlocks:o,autocompleteItems:t,block:r,blockIdx:n,blockRefs:i,blocks:o,defaultValue:r.content,deleteBlock:function(e){c(Po(Po({},e),{},{extension_uuid:U})),_(!1)},executionState:C,extraContent:(0,S.jsx)(yo,{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:s,fetchPipeline:d,hideRunButton:!0,interruptKernel:p,messages:h[a],noDivider:!0,onCallbackChange:function(e){return m(l,a,e)},onChange:function(e){return g(l,a,e)},pipeline:x,ref:i.current[M],runBlock:j,runningBlocks:y,savePipelineContent:k,selected:v,setAnyInputFocused:_,setErrors:E,setSelected:function(e){return I(!0===e?r:null)},setTextareaFocused:T,textareaFocused:v&&D})},a)}))}),[t,i,o,u,c,W,U,s,d,p,ne,h,m,g,x,j,y,Q,k,Z,_,E,I,T,D,ee]),ie="Extensions/GreatExpectations/index",oe=(0,Bn.y)(),re=oe.disableGlobalKeyboardShortcuts,le=oe.registerOnKeyDown,ue=oe.unregisterOnKeyDown;return(0,f.useEffect)((function(){return function(){ue(ie)}}),[ue,ie]),le(ie,(function(e,n){!re&&Y&&((0,ji.y)([Dn.zX,Dn.Um],n)||(0,ji.y)([Dn.PQ,Dn.Um],n))&&(e.preventDefault(),k())}),[Y,k]),(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(O.Z,{mb:w.cd,children:[(0,S.jsx)(C.ZP,{default:!0,children:"Add an extension block to start writing expectations for blocks in the current pipeline."}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsxs)(C.ZP,{default:!0,children:["When a block in your pipeline runs, it\u2019ll run any tests you define in its code. All associated extension blocks will also run during that phase. Learn more about the ",(0,S.jsx)(P.Z,{href:"https://docs.mage.ai/development/testing/great-expectations",openNewWindow:!0,children:"Great Expectation power up"}),"."]})}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsxs)(C.ZP,{default:!0,children:["For all available expectations, read Great Expectation\u2019s ",(0,S.jsx)(P.Z,{href:"https://greatexpectations.io/expectations/",openNewWindow:!0,children:"documentation"}),"."]})})]}),te,(0,S.jsx)(O.Z,{mt:w.cd,children:(0,S.jsx)(En.Z,{onClickOutside:function(){return N(!1)},open:!0,children:(0,S.jsx)(ti.Z,{disableKeyboardShortcuts:!0,items:null===z||void 0===z?void 0:z.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:U,type:b.tf.EXTENSION},(null===W||void 0===W?void 0:W.length)||0)},tooltip:function(){return t},uuid:e.uuid}})).concat((0,bi.hr)((function(e){return n(Po(Po({},e),{},{extension_uuid:U,type:b.tf.EXTENSION}),(null===W||void 0===W?void 0:W.length)||0)}),b.tf.EXTENSION,null,{onlyCustomTemplate:!0,showBrowseTemplates:M})),onClickCallback:function(){return N(!1)},open:B,parentRef:R,uuid:"Extension",children:(0,S.jsx)(F.ZP,{beforeElement:(0,S.jsx)(ko.Wx,{teal:!0,children:(0,S.jsx)(V.mm,{size:ko.ZG})}),inline:!0,onClick:function(e){e.preventDefault(),N(!0)},uuid:"AddNewBlocks/Extension",children:"Extension block"})})})})]})},Co=t(69419),wo=["pipeline"];function _o(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function So(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?_o(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):_o(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Eo=function(e){var n=e.pipeline,t=(0,ge.Z)(e,wo),i=(0,h.useRouter)(),o=K.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],a=u[1],s=(0,f.useMemo)((function(){return l[c]}),[l,c]),d=(0,f.useMemo)((function(){return So(So({},t),{},{pipeline:n})}),[n,t]);(0,f.useEffect)((function(){var e;a(null===(e=(0,Co.iV)())||void 0===e?void 0:e.extension)}),[i.asPath]);var p=(0,f.useMemo)((function(){return n?(go.GREAT_EXPECTATIONS===c?e=Oo:go.DBT===c&&(e=bo),e?(0,S.jsx)(e,So(So({},d),{},{extensionOption:s})):void 0):null;var e}),[s,n,c,d]);return(0,S.jsx)(A.W,{backend:B.PD,children:(0,S.jsxs)(O.Z,{p:w.cd,children:[!c&&(0,S.jsxs)(O.Z,{mb:w.cd,children:[(0,S.jsxs)(C.ZP,{default:!0,children:["Power up your pipeline with extensions. Learn more about ",(0,S.jsx)(P.Z,{href:"https://docs.mage.ai/design/blocks/extension",openNewWindow:!0,children:"extension blocks"}),"."]}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsxs)(C.ZP,{default:!0,children:["Click on a power up below to add and configure it for the ",(0,S.jsx)(C.ZP,{inline:!0,monospace:!0,children:null===n||void 0===n?void 0:n.uuid})," pipeline."]})})]}),!o&&!c&&(0,S.jsx)(G.Z,{}),p,!c&&(null===r||void 0===r?void 0:r.map((function(e,n){var t=e.description,o=e.name,r=e.uuid;return(0,S.jsx)(O.Z,{mt:n>=1?w.cd:0,children:(0,S.jsx)(P.Z,{block:!0,noHoverUnderline:!0,onClick:function(){return(0,ft.u7)({extension:r},{pushHistory:!0})},preventDefault:!0,children:(0,S.jsx)(qn.Z,{dark:!0,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(k.Z,{alignItems:"center",children:[(0,S.jsx)(Re.Z,{fullWidth:!1,children:(0,S.jsx)(O.Z,{p:w.cd,children:(0,S.jsx)(Z.ZP,{alignItems:"center",children:(0,S.jsx)("img",{alt:o,height:3*w.iI,src:"".concat(i.basePath,"/images/extensions/").concat(r,"/logo.png"),width:3*w.iI})})})}),(0,S.jsx)(O.Z,{mr:w.cd}),(0,S.jsxs)(k.Z,{flexDirection:"column",children:[(0,S.jsx)(C.ZP,{bold:!0,children:o}),(0,S.jsx)(C.ZP,{default:!0,small:!0,children:t})]})]}),(0,S.jsx)(V._Q,{})]})})})},r)})))]})})},Io=t(28385),To=t(9134),Mo=t(83784),Do=t(30229),Ro=t(8916);var Ao=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),a=c[0],s=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)(K.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],_=(0,v.Db)((function(e){return K.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)(_,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,xi.ez)(),s(!1)}else"Escape"===e.key&&((0,xi.ez)(),s(!1))}),[k,n,p,g]),T=(0,f.useMemo)((function(){return u-4*w.iI}),[u]),M=(0,f.useMemo)((function(){return(0,Ro.wx)(l,(function(e){return e.uuid===Mo.C}))}),[l]),D=(0,f.useMemo)((function(){return(0,Ro.wx)(l,(function(e){return e.uuid===(null===i||void 0===i?void 0:i.uuid)}))}),[i,l]),R=(0,f.useMemo)((function(){return(0,S.jsxs)(Fi,{width:T,children:[a&&(0,S.jsxs)(Bi.Z,{children:[(0,S.jsx)(Ai.Z,{md:1,children:(0,S.jsx)(Ui,{noPadding:!0,children:(0,S.jsx)(F.ZP,{backgroundColor:Hi.qJ,borderless:!0,centerText:!0,muted:!0,onClick:function(){navigator.clipboard.writeText(p),Kn.Am.success("Successfully copied to clipboard.",{position:Kn.Am.POSITION.BOTTOM_RIGHT,toastId:p})},uuid:"Sidekick/GlobalVariables/".concat(p),withIcon:!0,children:(0,S.jsx)(V.CK,{size:2.5*w.iI})})})}),(0,S.jsx)(Ai.Z,{md:4,children:(0,S.jsx)(Ui,{children:(0,S.jsx)(W.Z,{borderless:!0,compact:!0,fullWidth:!0,monospace:!0,onChange:function(e){h(e.target.value),e.preventDefault()},onKeyDown:I,paddingHorizontal:0,placeholder:"variable",small:!0,value:p})})}),(0,S.jsx)(Ai.Z,{md:7,children:(0,S.jsx)(Ui,{children:(0,S.jsx)(W.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,S.jsx)(Gi,{deleteVariable:function(){return E(e.uuid)},fetchVariables:n,pipelineUUID:j,variable:e},e.uuid)}))]})}),[E,M,p,g,j,h,x,s,a,T]),A=(0,f.useMemo)((function(){return(0,S.jsx)(Fi,{width:T,children:null===D||void 0===D?void 0:D.map((function(e){return(0,S.jsx)(Gi,{copyText:(n=e.uuid,"from mage_ai.data_preparation.variable_manager import (\n get_variable,\n)\n\n".concat(function(e,n,t){return"\n".concat(t," = get_variable('").concat(e,"', '").concat(n,"', '").concat(t,"')\n")}(j,null===i||void 0===i?void 0:i.uuid,n))),hideEdit:!0,pipelineUUID:j,variable:e},e.uuid);var n}))})}),[D,i,T]);return(0,S.jsxs)(O.Z,{p:w.cd,children:[(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(ue.Z,{level:4,monospace:!0,children:"Global Variables"}),(0,S.jsx)(O.Z,{ml:2}),(0,S.jsx)(F.ZP,{Icon:V.mm,blackBorder:!0,inline:!0,onClick:function(){return s((function(e){return!e}))},uuid:"Sidekick/GlobalVariables/addNewVariable",children:"New"})]})}),(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsxs)(C.ZP,{muted:!0,children:["Press ",(0,S.jsx)(C.ZP,{bold:!0,default:!0,inline:!0,monospace:!0,children:"Enter"})," or ",(0,S.jsx)(C.ZP,{bold:!0,default:!0,inline:!0,monospace:!0,children:"Return"})," to save changes."]})}),(0,S.jsx)(O.Z,{mb:w.cd,children:R}),(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsx)(C.ZP,{children:"Global variables will be passed into all non-scratchpad blocks as keyword arguments (Python), interpolated variables (SQL), or vector elements (R). To load a global variable, use the following syntax:"})}),(0,S.jsxs)(O.Z,{mb:w.cd,children:[(0,S.jsxs)(C.ZP,{bold:!0,large:!0,children:["For Python (",(0,S.jsx)(P.Z,{href:"https://docs.mage.ai/production/configuring-production-settings/runtime-variable",large:!0,openNewWindow:!0,primary:!0,children:"docs"}),"):"]}),(0,S.jsx)(To.Z,{language:"python",small:!0,source:"\n var = kwargs['variable_name']\n"})]}),(0,S.jsxs)(O.Z,{mb:w.cd,children:[(0,S.jsxs)(C.ZP,{bold:!0,large:!0,children:["For SQL (",(0,S.jsx)(P.Z,{href:"https://docs.mage.ai/guides/sql-blocks#variables",large:!0,openNewWindow:!0,primary:!0,children:"docs"}),"):"]}),(0,S.jsx)(To.Z,{language:"sql",small:!0,source:"\n {{ variable_name }}\n"})]}),(0,S.jsxs)(O.Z,{mb:w.cd,children:[(0,S.jsxs)(C.ZP,{bold:!0,large:!0,children:["For R (",(0,S.jsx)(P.Z,{href:"https://docs.mage.ai/guides/r-blocks#runtime-variables",large:!0,openNewWindow:!0,primary:!0,children:"docs"}),"):"]}),(0,S.jsx)(To.Z,{language:"r",small:!0,source:"\n var <- global_vars['variable_name']\n"})]}),(0,S.jsxs)(O.Z,{mb:w.cd,children:[(0,S.jsx)(ue.Z,{level:4,monospace:!0,children:"Trigger Runtime Variables"}),(0,S.jsx)(O.Z,{mb:w.cd}),(0,S.jsx)(C.ZP,{children:"Depending on what kind of trigger you use for this pipeline, some default runtime variables will be provided."})]}),Object.values(Do.Xm).map((function(e,n){var t;return(0,S.jsxs)(O.Z,{mb:w.cd,children:[(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsx)(C.ZP,{large:!0,monospace:!0,children:(0,J.vg)(null===(t=Do.Z4[e])||void 0===t?void 0:t.call(Do.Z4))})}),(0,Ro.JZ)([],e).map((function(n,t){return(0,S.jsx)(Gi,{hideEdit:!0,pipelineUUID:j,variable:n},"var_".concat(e,"_").concat(t))}))]},"".concat(e,"_").concat(n))})),D&&D.length>0&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Z,{my:2,children:(0,S.jsx)(ue.Z,{level:4,monospace:!0,children:"Block Output Variables"})}),(0,S.jsx)(O.Z,{mb:2,children:A}),(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsxs)(C.ZP,{children:["Output variables can be used in any ",(0,S.jsx)(C.ZP,{bold:!0,inline:!0,monospace:!0,warning:!0,children:b.tf.SCRATCHPAD})," block. They are for scratchpad blocks, specifically. To get upstream block outputs inside of other blocks, use the positional arguments."]})}),(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsx)(C.ZP,{children:"To load the variable in a scratchpad block, use the following syntax:"})}),(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsx)(To.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"})})]})]})},Bo=t(89565),No=t.n(Bo),Lo=t(88494),Fo=p.default.div.withConfig({displayName:"indexstyle__OutputHeaderStyle",componentId:"sc-wkjnrg-0"})([""," overflow-x:auto;"],(0,We.y$)()),Uo=p.default.div.withConfig({displayName:"indexstyle__OutputContainerStyle",componentId:"sc-wkjnrg-1"})([""," overflow-y:scroll;"," ",""],We.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 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 zo(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}var Go=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]),a=(0,f.useMemo)((function(){return c>100?l.slice(-100):l}),[c,l]),s=(0,f.useCallback)((function(){(0,xi.ez)(),i()}),[i]),d=(0,f.useCallback)((function(){(0,xi.ez)(),n()}),[n]),p=(0,f.useCallback)((function(){var e=!r;u(e),(0,kn.t8)(kn.Q9,e)}),[r,u]);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(Fo,{children:(0,S.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(k.Z,{children:[(0,S.jsx)(D.ZP,{beforeIcon:(0,S.jsx)(V.JM,{inverted:!0,size:2*w.iI}),compact:o,disabled:o,loading:o,onClick:s,success:!0,children:(0,S.jsx)(C.ZP,{bold:!0,inverted:!0,noWrapping:!0,primary:!1,children:"Execute pipeline"})}),(0,S.jsx)(O.Z,{ml:1}),o&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(D.ZP,{beforeIcon:(0,S.jsx)(V.x8,{inverted:!0,size:2*w.iI}),onClick:d,success:!0,children:(0,S.jsx)(C.ZP,{bold:!0,inverted:!0,noWrapping:!0,primary:!1,children:"Cancel pipeline"})}),(0,S.jsx)(O.Z,{ml:1})]}),(0,S.jsx)(D.ZP,{onClick:t,secondary:!0,children:(0,S.jsx)(C.ZP,{bold:!0,noWrapping:!0,children:"Running status"})})]}),(0,S.jsxs)(k.Z,{alignItems:"center",children:[(0,S.jsx)(O.Z,{ml:1}),(0,S.jsx)(C.ZP,{children:"Hide"}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(Pe.Z,{checked:r,onCheck:p})]})]})}),!r&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(O.Z,{mb:1}),(0,S.jsx)(Uo,{noScrollbarTrackBackground:!0,children:(0,S.jsx)(Lo.Nk,{executedAndIdle:!0,hasError:!1,selected:!0,children:a.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 bt.jU.includes(i)?o=(0,S.jsx)(Lo.T5,zo(zo({},l),{},{children:(0,S.jsx)(C.ZP,{monospace:!0,preWrap:!0,children:(0,S.jsx)(No(),{children:e})})})):i===bt.Gi.IMAGE_PNG&&(o=(0,S.jsx)("div",{style:{backgroundColor:"white"},children:(0,S.jsx)("img",{alt:"Image ".concat(n," from code output"),src:"data:image/png;base64, ".concat(e)})})),(0,S.jsx)("div",{children:o},"code-output-".concat(n,"-").concat(t))}))}))})})]})]})},Wo=t(91749);var Ko=function(e){var n=e.fetchSecrets,t=e.pipelineUUID,i=e.secrets,o=e.setErrorMessages,l=e.width,u=(0,f.useState)(!1),c=u[0],a=u[1],s=(0,f.useState)(),d=s[0],p=s[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)(K.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 K.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,xi.ez)(),a(!1)):"Escape"===e.key&&((0,xi.ez)(),a(!1))}),[j,n,d,m]),_=(0,f.useCallback)((function(e){(0,xi.ez)(),k(e)}),[k]);return(0,S.jsxs)(O.Z,{p:w.cd,children:[(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(ue.Z,{level:4,monospace:!0,children:"Secrets"}),(0,S.jsx)(O.Z,{ml:2}),(0,S.jsx)(F.ZP,{Icon:V.mm,blackBorder:!0,inline:!0,onClick:function(){return a((function(e){return!e}))},uuid:"Sidekick/Secrets/addNewSecret",children:"New"})]})}),(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsxs)(C.ZP,{children:[(0,S.jsx)(C.ZP,{inline:!0,warning:!0,children:"WARNING:"})," the encryption key is stored in a file on your machine. If you need more secure encryption, we recommend using a secrets manager."]})}),c&&(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsxs)(C.ZP,{muted:!0,children:["Press ",(0,S.jsx)(C.ZP,{bold:!0,default:!0,inline:!0,monospace:!0,children:"Enter"})," or ",(0,S.jsx)(C.ZP,{bold:!0,default:!0,inline:!0,monospace:!0,children:"Return"})," to save changes."]})}),(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsxs)(Fi,{width:b,children:[c&&(0,S.jsxs)(Bi.Z,{children:[(0,S.jsx)(Ai.Z,{md:1,children:(0,S.jsx)(Ui,{noPadding:!0,children:(0,S.jsx)(F.ZP,{backgroundColor:Hi.qJ,borderless:!0,centerText:!0,muted:!0,onClick:function(){navigator.clipboard.writeText("{{ mage_secret_var(".concat(d,") }}")),Kn.Am.success("Successfully copied to clipboard.",{position:Kn.Am.POSITION.BOTTOM_RIGHT,toastId:d})},uuid:"Sidekick/Secrets/".concat(d),withIcon:!0,children:(0,S.jsx)(V.CK,{size:2.5*w.iI})})})}),(0,S.jsx)(Ai.Z,{md:4,children:(0,S.jsx)(Ui,{children:(0,S.jsx)(W.Z,{borderless:!0,compact:!0,fullWidth:!0,monospace:!0,onChange:function(e){p(e.target.value),e.preventDefault()},onKeyDown:P,paddingHorizontal:0,placeholder:"secret name",small:!0,value:d})})}),(0,S.jsx)(Ai.Z,{md:7,children:(0,S.jsx)(Ui,{children:(0,S.jsx)(W.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,S.jsx)(Gi,{copyText:e.name,deleteVariable:function(){return _(e.name)},fetchVariables:n,hideEdit:!0,obfuscate:!0,pipelineUUID:t,variable:{uuid:e.name,value:e.value}},e.name)}))]})}),(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsx)(C.ZP,{children:"Secrets are not editable, they can only be created and deleted. Secrets are shared across the project, and can be used in configuration fields. To reference a secret, use the following templating syntax:"})}),(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsx)(To.Z,{language:"yaml",maxWidth:b,small:!0,source:"\n \"{{ mage_secret_var('<secret_name>') }}\"\n "})}),(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsx)(C.ZP,{children:"To reference a secret in code, you can import the `get_secret_value` helper method:"})}),(0,S.jsx)(O.Z,{mb:w.cd,children:(0,S.jsx)(To.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 "})})]})},Vo=t(28026),qo=t(68899),Yo=t(15752),Qo=t(91835);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=e.addNewBlockAtIndex,t=e.addOnBlocks,i=e.addOnBlockType,o=e.autocompleteItems,u=e.blockRefs,c=e.blocks,a=e.blocksInNotebook,s=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,_=e.savePipelineContent,E=e.selectedBlock,I=e.setAnyInputFocused,T=e.setErrors,M=e.setHiddenBlocks,D=e.setSelectedBlock,R=e.setTextareaFocused,A=e.showBrowseTemplates,B=e.showUpdateBlockModal,N=e.textareaFocused,U=(0,f.useRef)(null),H=(0,f.useState)(!1),z=H[0],G=H[1],W=(0,Co.iV)().block_uuid;(0,f.useEffect)((function(){var e=c.find((function(e){var n,t=e.uuid;return(null===W||void 0===W||null===(n=W.split(":"))||void 0===n?void 0:n[0])===t}));e&&(E&&(null===e||void 0===e?void 0:e.uuid)===(null===E||void 0===E?void 0:E.uuid)||(M((function(n){return Jo(Jo({},n),{},(0,l.Z)({},e.uuid,!1))})),j(e.uuid,e.type,null)))}),[W,c,j,E,M]);var q=(y||{}).type,Y=(0,f.useMemo)((function(){return(0,Ie.HK)(t||[],(function(e){return e.uuid}))}),[t]),Q=K.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===Y||void 0===Y?void 0:Y.length)||0)}),[n,Y]),ne=(0,f.useMemo)((function(){return(0,bi.oM)(X,ee)}),[ee,X]),te=(0,f.useMemo)((function(){return(0,bi.hr)(ee,i,q,{blockTemplatesByBlockType:ne,languages:[b.t6.PYTHON],showBrowseTemplates:A})}),[ee,i,ne,q]),ie=(0,f.useMemo)((function(){return null===Y||void 0===Y?void 0:Y[null===E||void 0===E?void 0:E.uuid]}),[Y,E]),oe=(0,f.useMemo)((function(){return Z.reduce((function(e,n,t){return Jo(Jo({},e),{},(0,l.Z)({},n.uuid,Jo(Jo({},n),{},{priority:t})))}),{})}),[Z]),re=(0,v.Db)((function(e){var n=e.block,t=e.upstream_blocks;return K.ZP.blocks.pipelines.useUpdate(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,ae=(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?bt.uF.BUSY:bt.uF.QUEUED:bt.uF.IDLE,C="".concat(t,"s/").concat(i,".py");return u.current[C]=(0,f.createRef)(),(0,S.jsx)(O.Z,{mt:w.cd,children:(0,S.jsx)(L.Z,{allBlocks:c,autocompleteItems:o,block:e,blockIdx:n,blockRefs:u,blocks:c,defaultValue:e.content,deleteBlock:function(e){s(Jo({},e)),I(!1)},executionState:P,extraContent:(0,S.jsx)(yo,{block:e,blocks:a,inputPlaceholder:"Select blocks to add ".concat((0,J._6)(d,null)," to"),loading:ce,onClickTag:function(e){M((function(n){return Jo(Jo({},n),{},(0,l.Z)({},e.uuid,!1))})),j(e.uuid,e.type,null)},supportedUpstreamBlockTypes:[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:_,showUpdateBlockModal:B,selected:r,setAnyInputFocused:I,setErrors:T,setSelected:function(n){return D(!0===n?e:null)},setTextareaFocused:R,textareaFocused:r&&N})},i)}))}),[t,o,u,c,a,s,d,p,h,m,ce,g,x,j,y,k,Z,oe,_,E,I,T,M,D,R,B,N,ue]),se="".concat(d,"/index"),de=(0,Bn.y)(),pe=de.disableGlobalKeyboardShortcuts,fe=de.registerOnKeyDown,ve=de.unregisterOnKeyDown;return(0,f.useEffect)((function(){return function(){ve(se)}}),[ve,se]),fe(se,(function(e,n){!pe&&ie&&((0,ji.y)([Dn.zX,Dn.Um],n)||(0,ji.y)([Dn.PQ,Dn.Um],n))&&(e.preventDefault(),_())}),[ie,_]),(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(O.Z,{mb:w.cd,children:[(0,S.jsxs)(C.ZP,{default:!0,children:["Run 1 or more ",(0,J.wX)(d)," block functions whenever another block succeeds or fails."]}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsxs)(C.ZP,{default:!0,children:["Learn more about ",(0,S.jsx)(P.Z,{href:"https://docs.mage.ai/development/blocks/".concat((0,J.wX)((0,J._6)(d,null)),"/overview"),openNewWindow:!0,children:(0,J.wX)((0,J._6)(d,null))}),"."]})})]}),ae,(0,S.jsx)(O.Z,{mt:w.cd,children:(0,S.jsx)(En.Z,{onClickOutside:function(){return G(!1)},open:!0,children:(0,S.jsx)(ti.Z,{disableKeyboardShortcuts:!0,items:te,onClickCallback:function(){return G(!1)},open:z,parentRef:U,uuid:d,children:(0,S.jsxs)(F.ZP,{beforeElement:(0,S.jsx)(ko.Wx,{rose:i===b.tf.CALLBACK,children:(0,S.jsx)(V.mm,{size:ko.ZG})}),inline:!0,onClick:function(e){e.preventDefault(),G(!0)},uuid:"AddNewBlocks/".concat(d),children:[(0,J.kC)(d)," block"]})})})})]})},er=t(26084);function nr(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function tr(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?nr(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):nr(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ir=[{Icon:V.AQ,name:"Callbacks",uuid:er.Q.CALLBACK},{Icon:V.hW,name:"Conditionals",uuid:er.Q.CONDITIONAL}];var or=function(e){var n=(0,Qo.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,Co.iV)())||void 0===e?void 0:e.addon)}),[t.asPath]);var l=(0,f.useMemo)((function(){var e,t;if(er.Q.CALLBACK===o)e={addOnBlockType:b.tf.CALLBACK,addOnBlocks:null===(t=n.pipeline)||void 0===t?void 0:t.callbacks,displayBlockName:"callback"};else if(er.Q.CONDITIONAL===o){var i;e={addOnBlockType:b.tf.CONDITIONAL,addOnBlocks:null===(i=n.pipeline)||void 0===i?void 0:i.conditionals,displayBlockName:"conditional"}}if(e)return(0,S.jsx)($o,tr(tr({},e),n))}),[n,o]);return(0,S.jsx)(A.W,{backend:B.PD,children:(0,S.jsxs)(O.Z,{p:w.cd,children:[l,!o&&(null===ir||void 0===ir?void 0:ir.map((function(e,n){var t=e.name,i=e.uuid,o=e.Icon;return(0,S.jsx)(O.Z,{mt:n>=1?w.cd:0,children:(0,S.jsx)(P.Z,{block:!0,noHoverUnderline:!0,onClick:function(){return(0,ft.u7)({addon:i},{pushHistory:!0})},preventDefault:!0,children:(0,S.jsx)(qn.Z,{dark:!0,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,S.jsxs)(k.Z,{alignItems:"center",children:[(0,S.jsx)(Re.Z,{fullWidth:!1,children:(0,S.jsx)(O.Z,{p:w.cd,children:(0,S.jsx)(Z.ZP,{alignItems:"center",children:(0,S.jsx)(o,{fill:"#885EFF",size:2*w.iI})})})}),(0,S.jsx)(O.Z,{mr:w.cd}),(0,S.jsx)(k.Z,{flexDirection:"column",children:(0,S.jsx)(C.ZP,{bold:!0,children:t})})]}),(0,S.jsx)(V._Q,{})]})})})},i)})))]})})};function rr(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function lr(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?rr(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):rr(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ur=function(e){var n=e.activeView,t=e.addNewBlockAtIndex,i=e.afterWidth,o=e.autocompleteItems,r=e.blockInteractionsMapping,u=e.blockRefs,c=e.blocks,a=e.blocksInNotebook,s=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,_=e.fetchSecrets,E=e.fetchVariables,I=e.globalDataProducts,T=e.globalVariables,M=e.insights,R=e.interactions,A=e.interactionsMapping,B=e.interruptKernel,N=e.isLoadingCreateInteraction,L=e.isLoadingUpdatePipelineInteraction,F=e.isPipelineExecuting,U=e.lastTerminalMessage,z=e.messages,G=e.metadata,W=e.onChangeCallbackBlock,K=e.onChangeChartBlock,q=e.onChangeCodeBlock,Y=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,ae=e.selectedBlock,se=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,_e=e.showDataIntegrationModal,Se=e.showUpdateBlockModal,Ee=e.sideBySideEnabled,Te=e.statistics,Me=e.textareaFocused,De=e.treeRef,Re=e.updatePipelineInteraction,Ae=e.updateWidget,Be=e.widgets,Ne=(0,Zn.i)().height,Le=Ci.uX,Fe=(0,f.useState)([]),Ue=Fe[0],He=Fe[1],ze=(0,f.useState)(!!(0,kn.U2)(kn.Q9)),Ge=ze[0],Ke=ze[1],Ve=(0,f.useMemo)((function(){return i-(qo.k1+1)}),[i]),qe=(0,f.useMemo)((function(){var e;return!(null===ne||void 0===ne||null===(e=ne.features)||void 0===e||!e[mi.d.INTERACTIONS])}),[null===ne||void 0===ne?void 0:ne.features]),Ye=((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===G||void 0===G?void 0:G.column_types)||{}}),[G]),$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:Ge?-16:300,rn=(0,f.useCallback)((0,Ni.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,S.jsx)(Ao,{blocks:c,fetchVariables:E,pipeline:J,selectedBlock:ae,setErrorMessages:He,variables:T,width:Ve})}),[Ve,c,E,T,J,ae]),un=(0,f.useMemo)((function(){return(0,S.jsx)(Io.Z,{onActionCallback:Q,pipeline:J,selectedBlock:ae,selectedFilePath:se,setErrors:ye,width:Ve>We.nn?Ve-We.nn:Ve})}),[Ve,Q,J,ae,se,ye]),cn=(0,f.useMemo)((function(){return(0,S.jsx)(Ko,{fetchSecrets:_,pipelineUUID:null===J||void 0===J?void 0:J.uuid,secrets:ce,setErrorMessages:He,width:Ve})}),[Ve,_,J,ce]),an=(0,f.useMemo)((function(){return{addNewBlockAtIndex:t,autocompleteItems:o,blockRefs:u,blocks:c,blocksInNotebook:a,deleteBlock:b,fetchFileTree:k,fetchPipeline:P,interruptKernel:B,messages:z,onChangeCallbackBlock:W,onChangeCodeBlock:q,onSelectBlockFile:Y,pipeline:J,runBlock:ie,runningBlocks:oe,savePipelineContent:le,selectedBlock:ae,setAnyInputFocused:ve,setErrors:ye,setHiddenBlocks:ke,setSelectedBlock:Oe,setTextareaFocused:Ce,showBrowseTemplates:we,showUpdateBlockModal:Se,textareaFocused:Me}}),[t,o,u,c,a,b,k,P,B,z,W,q,Y,J,ie,oe,le,ae,ve,ye,ke,Oe,Ce,we,Se,Me]),sn=(0,f.useMemo)((function(){return Qe.length>0&&(0,S.jsx)(be.Z,{columnHeaderHeight:(0,je.Qr)(Je)&&(0,je.Qr)(en)&&(0,je.Qr)($e)?0:xe.Eh,columns:Qe,height:Ne-Le-Ci.OM,noBorderBottom:!0,noBorderLeft:!0,noBorderRight:!0,noBorderTop:!0,renderColumnHeader:rn,rows:Xe,width:Ve})}),[Ve,Je,Qe,Le,Ne,en,$e,rn,Xe]),dn=(0,f.useMemo)((function(){return Be.length>0&&(0,S.jsx)(fo,{autocompleteItems:o,blockRefs:u,blocks:c,chartRefs:d,deleteWidget:x,fetchFileTree:k,fetchPipeline:P,messages:z,onChangeChartBlock:K,pipeline:J,runBlock:ie,runningBlocks:oe,savePipelineContent:le,selectedBlock:ae,setAnyInputFocused:ve,setErrors:ye,setSelectedBlock:Oe,setTextareaFocused:Ce,textareaFocused:Me,updateWidget:Ae,widgets:Be,width:Ve})}),[Ve,o,u,c,d,x,k,P,z,K,J,ie,oe,le,ae,ve,ye,Oe,Ce,Me,Ae,Be]),pn=(0,f.useMemo)((function(){return(0,S.jsx)("div",{style:{height:"100%",position:"relative",width:Ve},children:(0,S.jsx)(Vo.Z,{lastMessage:U,onFocus:function(){return Oe(null)},sendMessage:de,width:Ve})})}),[Ve,U,de,Oe]),fn=(0,f.useMemo)((function(){return(0,S.jsx)(Eo,lr({},an))}),[an]),vn=(0,f.useMemo)((function(){return(0,S.jsx)(or,lr({},an))}),[an]),hn=(0,f.useMemo)((function(){return J&&ae&&(0,S.jsx)(Ji,{addNewBlockAtIndex:t,block:ae,contentByBlockUUID:h,fetchFileTree:k,fetchPipeline:P,globalDataProducts:I,pipeline:J,setSelectedBlock:Oe,showDataIntegrationModal:_e,showUpdateBlockModal:Se})}),[t,h,k,P,I,J,ae,Oe,_e,Se]);return(0,S.jsxs)(S.Fragment,{children:[(null===Ue||void 0===Ue?void 0:Ue.length)>=1&&(0,S.jsxs)(O.Z,{mb:3,mt:2,mx:2,children:[(0,S.jsxs)(Z.ZP,{justifyContent:"space-between",children:[(0,S.jsx)(C.ZP,{bold:!0,danger:!0,children:"Errors"}),(0,S.jsx)(D.ZP,{basic:!0,iconOnly:!0,noPadding:!0,onClick:function(){return He([])},transparent:!0,children:(0,S.jsx)(V.x8,{muted:!0})})]}),null===Ue||void 0===Ue?void 0:Ue.map((function(e){return(0,S.jsx)(O.Z,{pb:1,children:(0,S.jsx)(C.ZP,{monospace:!0,xsmall:!0,children:e})},e)}))]}),(0,S.jsxs)(xe.t0,{fullWidth:!0,heightOffset:pi.cH.TERMINAL===n||n===pi.cH.TREE?0:v||We.nn,onBlur:function(){se||me(!1),null===fe||void 0===fe||fe(!1)},onFocus:function(){me(!0),n===pi.cH.TREE&&(null===fe||void 0===fe||fe(!0))},overflowHidden:n===pi.cH.TREE,tabIndex:0,children:[n===pi.cH.TREE&&(0,S.jsx)(m.Z,{uuid:"PipelineDetail/".concat(null===J||void 0===J?void 0:J.uuid),children:(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(vo.ZP,{addNewBlockAtIndex:t,blockRefs:u,blocks:c,contentByBlockUUID:h,contextMenuEnabled:!0,deleteBlock:b,dragEnabled:!0,editingBlock:j,enablePorts:!tn,fetchPipeline:P,height:Ne-(Le-We.nn)-on,messages:z,onClickNode:function(e){var n=e.block.uuid;return ke((function(e){var t=!(null===e||void 0===e||!e[n]);return t?lr(lr({},e),{},(0,l.Z)({},n,!t)):e}))},pipeline:J,runBlock:ie,runningBlocks:oe,selectedBlock:ae,setActiveSidekickView:pe,setEditingBlock:ge,setErrors:ye,setSelectedBlock:function(e){Oe(e),Ee&&(0,Yo.F)(e)},showUpdateBlockModal:Se,treeRef:De}),!Ye&&H.qL.STREAMING===(null===J||void 0===J?void 0:J.type)&&(0,S.jsx)(O.Z,{p:1,children:(0,S.jsx)(Go,{cancelPipeline:s,checkIfPipelineRunning:p,executePipeline:y,isPipelineExecuting:F,pipelineExecutionHidden:Ge,pipelineMessages:ee,setPipelineExecutionHidden:Ke})})]})}),n===pi.cH.DATA&&sn,pi.cH.SECRETS===n&&cn,pi.cH.VARIABLES===n&&ln,pi.cH.FILE_VERSIONS===n&&(0,S.jsx)(m.Z,{uuid:"FileVersions/".concat(se?decodeURIComponent(se):""),children:un}),tn||ae&&nn||!ae&&nn&&n===pi.cH.DATA?null:pi.du.includes(n)&&(0,S.jsx)(Z.ZP,{alignItems:"center",justifyContent:"center",verticalHeight:pi.fp,verticalHeightOffset:Le,width:Ve,children:(0,S.jsx)(C.ZP,{center:!0,default:!0,disableWordBreak:!0,large:!0,monospace:!0,children:ae?!nn&&"No data or insights available":"Select a block for insights"})}),pi.cH.CHARTS===n&&(Be.length>0?dn:(0,S.jsxs)(Z.ZP,{alignItems:"center",flexDirection:"column",justifyContent:"center",verticalHeight:pi.fp,verticalHeightOffset:Le,width:Ve,children:[(0,S.jsx)(O.Z,{px:1,children:(0,S.jsx)(Z.ZP,{flexDirection:"row",children:(0,S.jsxs)(C.ZP,{center:!0,default:!0,children:["Add a chart by clicking the chart icon \xa0",(0,S.jsx)(V.GQ,{size:1.5*w.iI}),"\xa0in",(0,S.jsx)("br",{}),"the top right corner of a block (if applicable)."]})})}),(0,S.jsx)(O.Z,{mt:w.cd,px:1,children:(0,S.jsx)(mo,{size:40*w.iI})})]})),pi.cH.TERMINAL===n&&pn,pi.cH.EXTENSIONS===n&&fn,pi.cH.ADDON_BLOCKS===n&&vn,pi.cH.BLOCK_SETTINGS===n&&(ae?hn:(0,S.jsx)(Z.ZP,{alignItems:"center",flexDirection:"column",justifyContent:"center",verticalHeight:pi.fp,verticalHeightOffset:Le,width:Ve,children:(0,S.jsx)(O.Z,{px:1,children:(0,S.jsx)(Z.ZP,{flexDirection:"row",children:(0,S.jsxs)(C.ZP,{center:!0,default:!0,children:["Please select a block and then click the settings icon \xa0",(0,S.jsx)(V.JG,{size:1.5*w.iI}),"\xa0",(0,S.jsx)("br",{}),"in the top right corner of a block (if applicable)."]})})})})),pi.cH.INTERACTIONS===n&&qe&&(0,S.jsx)(Wo.Z,{blockInteractionsMapping:r,containerWidth:Ve,createInteraction:function(e){return g({interaction:e})},interactions:R,interactionsMapping:A,isLoadingCreateInteraction:N,isLoadingUpdatePipelineInteraction:L,permissions:X,pipeline:J,pipelineInteraction:$,refAfterFooter:te,savePipelineInteraction:ue,selectedBlock:ae,setBlockInteractionsMapping:he,setInteractionsMapping:Ze,setPermissions:Pe,setSelectedBlock:Oe,updatePipelineInteraction:function(e){return Re({pipeline_interaction:e})}})]})]})};var cr=function(e){var n,t=e.activeView,i=e.pipeline,o=e.project,r=e.secrets,l=e.selectedBlock,u=e.setSelectedBlock,c=e.variables,a=null===i||void 0===i?void 0:i.uuid,s=(0,Co.iV)(),d=(0,Ro.wx)(c,(function(e){return e.uuid===Mo.C})),p=(0,pi.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);pi.cH.BLOCK_SETTINGS===t&&null!==l&&void 0!==l&&l.uuid&&(v=(0,S.jsxs)(S.Fragment,{children:["Block settings for ",(0,S.jsx)(C.ZP,{bold:!0,color:(0,_.qn)(null===l||void 0===l?void 0:l.type).accent,inline:!0,monospace:!0,children:null===l||void 0===l?void 0:l.uuid})]}));var h=(0,S.jsx)(C.ZP,{bold:!0,children:v}),m=pi.cH.EXTENSIONS===t&&(null===s||void 0===s?void 0:s.extension),g=K.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=pi.cH.ADDON_BLOCKS===t&&(null===s||void 0===s?void 0:s.addon);if(pi.cH.INTERACTIONS===t){var y=[];null!==l&&void 0!==l&&l.uuid?y.push.apply(y,[{label:function(){return"All interactions"},monospace:!1,onClick:function(){return u(null)}},{bold:!0,label:function(){return null===l||void 0===l?void 0:l.uuid},monospace:!0}]):y.push({bold:!0,label:function(){return"Interactions"},monospace:!1}),h=(0,S.jsx)(oe.Z,{breadcrumbs:y,noMarginLeft:!0})}else{if(!t)return(0,S.jsx)("div",{});if(m){var k=x[null===s||void 0===s?void 0:s.extension];h=(0,S.jsxs)(Z.ZP,{children:[(0,S.jsx)(yt(),{as:"/pipelines/".concat(a,"/edit?").concat(pi.uM,"=").concat(pi.cH.EXTENSIONS),href:"/pipelines/[pipeline]/edit",passHref:!0,children:(0,S.jsx)(P.Z,{default:!0,children:v})}),(0,S.jsx)(C.ZP,{monospace:!0,muted:!0,children:"\xa0/\xa0"}),(0,S.jsx)(C.ZP,{bold:!0,children:null===k||void 0===k?void 0:k.name})]})}else j&&(h=(0,S.jsxs)(Z.ZP,{children:[(0,S.jsx)(yt(),{as:"/pipelines/".concat(a,"/edit?").concat(pi.uM,"=").concat(pi.cH.ADDON_BLOCKS),href:"/pipelines/[pipeline]/edit",passHref:!0,children:(0,S.jsx)(P.Z,{default:!0,children:v})}),(0,S.jsx)(C.ZP,{monospace:!0,muted:!0,children:"\xa0/\xa0"}),(0,S.jsx)(C.ZP,{bold:!0,children:(0,J.vg)(null===s||void 0===s?void 0:s.addon)})]}))}return(0,S.jsx)(Ci.ym,{children:h})},ar=t(16756),sr=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||_e.Z.background).header,";\n ")}),(function(e){return e.width&&"\n width: ".concat(e.width,"px;\n ")})),dr=1.25*w.iI;function pr(e,n){var t=e.kernel,i=e.pipelineContentTouched,o=(e.pipelineLastSaved,e.saveStatus),r=e.width,l=t||{},u=(l.alive,l.usage),c=(0,f.useMemo)((function(){if(null!==u&&void 0!==u&&u.kernel_memory){var e=u.kernel_memory,n=Math.floor(Math.log(e)/Math.log(1024));return"".concat(parseFloat((e/Math.pow(1024,n)).toFixed(2))).concat(["B","KB","MB","GB","TB","PB","EB","ZB","YB"][n])}return null}),[null===u||void 0===u?void 0:u.kernel_memory]),a=(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,S.jsxs)(sr,{ref:n,width:r,children:[(0,S.jsx)(y.Z,{light:!0}),(0,S.jsx)(O.Z,{px:w.cd,py:1,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[u&&(0,S.jsx)(S.Fragment,{children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[null!==a&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(V.Bf,{muted:!0,size:dr}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsxs)(C.ZP,{monospace:!0,muted:!0,small:!0,children:["CPU: ",(0,S.jsxs)(C.ZP,{inline:!0,danger:a>=90,muted:a<50,small:!0,warning:a>=50&&a<90,children:[a,"%"]})]})]}),null!==a&&null!==c&&(0,S.jsxs)(O.Z,{mx:w.cd,children:[(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(C.ZP,{monospace:!0,muted:!0,small:!0,children:"/"})]}),null!==c&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(V.ie,{muted:!0,size:dr}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsxs)(C.ZP,{monospace:!0,muted:!0,small:!0,children:["Memory: ",c]})]}),(0,S.jsx)(O.Z,{mx:w.cd})]})}),(0,S.jsx)(Oe.Z,{appearAbove:!0,appearBefore:!0,block:!0,description:(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[(0,S.jsx)(C.ZP,{default:!0,inline:!0,children:"Press"}),"\xa0",(0,S.jsx)(ar.Z,{inline:!0,keyText:(0,An.V5)()?Dn.RJ:Dn.hE}),"\xa0",(0,S.jsx)(C.ZP,{default:!0,inline:!0,children:"+"}),"\xa0",(0,S.jsx)(ar.Z,{inline:!0,keyText:Dn.SS}),"\xa0",(0,S.jsx)(C.ZP,{default:!0,inline:!0,children:"to save changes."}),(0,S.jsx)("br",{})]}),(0,S.jsx)(O.Z,{mt:1,children:(0,S.jsxs)(C.ZP,{default:!0,children:["Or, go to ",(0,S.jsx)(C.ZP,{inline:!0,monospace:!0,children:"File"})," \u203a ",(0,S.jsx)(C.ZP,{inline:!0,monospace:!0,children:"Save pipeline"}),"."]})})]}),size:null,widthFitContent:!0,children:(0,S.jsxs)(Z.ZP,{alignItems:"center",children:[i&&(0,S.jsx)(V.uy,{size:dr,warning:!0}),!i&&(0,S.jsx)(V.$B,{size:dr,muted:!0}),(0,S.jsx)(O.Z,{mr:1}),(0,S.jsx)(C.ZP,{monospace:!0,muted:!0,small:!0,warning:i,children:o})]})})]})})]})}var fr=f.forwardRef(pr),vr=t(65044),hr=t(78419),mr=t(46684),gr=t(32929),br=t(11498),xr=t(28795),jr=t(85010);function yr(e){var n=e.activeView,t=e.pipeline,i=e.project,o=e.secrets,r=e.setActiveSidekickView,l=e.variables,u=(0,Ro.wx)(l,(function(e){return e.uuid===Mo.C}));return(0,pi.j5)({pipeline:t,project:i}).map((function(e){var i=e.buildLabel,l=e.key,c=e.label;return{Icon:pi.Z7[l],id:l,isSelected:function(){return n===l},label:function(){return(null===i||void 0===i?void 0:i({pipeline:t,secrets:o,variables:u}))||c},onClick:function(){return r(l,!0)}}}))}var kr=t(53005),Zr=t(4383),Pr=t(70320),Or=t(3917);function Cr(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 wr(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Cr(Object(t),!0).forEach((function(n){(0,l.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Cr(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function _r(e){var n,t,i,u,c,a,x,j,y,k,P,C,_,E,I,A,B,N,L,U,z=e.page,G=e.pipeline,W=(0,f.useRef)(null),q=(0,f.useRef)(null),Y=(0,Mn.Z)(),Q=Y.featureEnabled,ne=Y.featureUUIDs,te=Y.fetchProjects,oe=Y.project,re=Y.sparkEnabled,le=(0,f.useContext)(p.ThemeContext),ue=(0,h.useRouter)(),ce=(0,Zn.i)().height,ae=ue.query.pipeline,se=G.uuid||ae,de=(0,f.useState)(!!(0,kn.U2)(kn.zg)),pe=de[0],fe=de[1],ve=(0,f.useState)(!!(0,kn.U2)(kn.Uu)),he=ve[0],me=ve[1],ge=(0,f.useState)(!1),be=ge[0],xe=ge[1],ye=(0,f.useState)(null),ke=ye[0],Ze=ye[1],Pe=(0,f.useState)(null),Oe=Pe[0],Ce=Pe[1],we=(0,f.useState)(null),Se=we[0],Ee=we[1],Te=(0,f.useState)(null),Me=Te[0],De=Te[1],Re=(0,f.useState)(null),Ae=Re[0],Be=Re[1],Ne=(0,f.useState)([]),Le=Ne[0],Fe=Ne[1],Ue=(0,f.useState)({}),He=Ue[0],ze=Ue[1],Ge=(0,f.useState)(!1),We=Ge[0],Ke=Ge[1],Ve=(0,f.useState)(!1),qe=Ve[0],Ye=Ve[1],Qe=(0,f.useState)(!1),Xe=Qe[0],Je=Qe[1],$e=(0,f.useState)(!1),en=$e[0],nn=$e[1],tn=(0,f.useState)(!0),on=tn[0],rn=tn[1],ln=((0,f.useMemo)((function(){var e;return(0,Pr.h)(null===oe||void 0===oe||null===(e=oe.features)||void 0===e?void 0:e[mi.d.LOCAL_TIMEZONE])}),[null===oe||void 0===oe?void 0:oe.features]),(0,f.useMemo)((function(){var e;return!(null===oe||void 0===oe||null===(e=oe.features)||void 0===e||!e[mi.d.INTERACTIONS])}),[null===oe||void 0===oe?void 0:oe.features])),un="".concat(hr.H8,"_").concat(se),cn=(0,kn.U2)(un),an=(0,f.useState)((0,Ie.sE)(Pt.NR,(function(e){return e.uuid===cn}))||Pt.NR[0]),sn=an[0],dn=an[1],pn=(0,f.useCallback)((function(e){dn(e),(0,kn.t8)(un,null===e||void 0===e?void 0:e.uuid)}),[un,dn]),fn="".concat(hr.g6,"_").concat(se),vn=(0,f.useState)({}),hn=vn[0],mn=vn[1],gn=(0,f.useRef)(null),bn=K.ZP.statuses.list({},{revalidateOnFocus:!1}).data,xn=(0,f.useMemo)((function(){var e,n;return null===bn||void 0===bn||null===(e=bn.statuses)||void 0===e||null===(n=e[0])||void 0===n?void 0:n.disable_pipeline_edit_access}),[bn]),jn=(0,f.useMemo)((function(){var e,n;return null===bn||void 0===bn||null===(e=bn.statuses)||void 0===e||null===(n=e[0])||void 0===n?void 0:n.max_print_output_lines}),[bn]),yn=(0,f.useState)({}),Pn=yn[0],On=yn[1],Cn=(0,f.useState)([]),En=Cn[0],In=Cn[1],Tn=(0,at.Z)(se),Dn=K.ZP.pipelines.detail(se,wr({include_block_pipelines:!0,includes_outputs:(0,je.Qr)(Pn)||"undefined"===typeof U||null===U||"undefined"===typeof(null===(n=U)||void 0===n?void 0:n.blocks)||null===(null===(t=U)||void 0===t?void 0:t.blocks)||!(null===(i=U)||void 0===i||null===(u=i.blocks)||void 0===u||!u.find((function(e){return"undefined"===typeof e.ouputs})))},on?{includes_outputs_spark:!0}:{}),{refreshInterval:6e4},{key:"/pipelines/".concat(se,"/edit")}),Rn=Dn.data,An=Dn.mutate,Bn=K.ZP.pipeline_interactions.detail(ln&&se),Nn=Bn.data,Ln=Bn.mutate,Fn=K.ZP.interactions.pipeline_interactions.list(ln&&se),Kn=Fn.data,Vn=Fn.mutate,Yn=(0,f.useMemo)((function(){return(null===Nn||void 0===Nn?void 0:Nn.pipeline_interaction)||{}}),[Nn]),Qn=(0,f.useMemo)((function(){return(null===Kn||void 0===Kn?void 0:Kn.interactions)||{}}),[Kn]),Xn=(0,v.Db)(K.ZP.pipeline_interactions.useUpdate(se),{onSuccess:function(e){return(0,$.wD)(e,{callback:function(e){Ln()}})}}),Jn=(0,r.Z)(Xn,2),$n=Jn[0],et=Jn[1].isLoading,nt=(0,v.Db)(K.ZP.interactions.pipeline_interactions.useCreate(se),{onSuccess:function(e){return(0,$.wD)(e,{callback:function(e){Vn(),Ln()}})}}),tt=(0,r.Z)(nt,2),it=tt[0],ot=tt[1].isLoading,rt=K.ZP.files.list(),lt=rt.data,ct=rt.mutate,st=(0,f.useMemo)((function(){return(null===lt||void 0===lt?void 0:lt.files)||[]}),[lt]);U=(0,f.useMemo)((function(){return null===Rn||void 0===Rn?void 0:Rn.pipeline}),[Rn]);var pt=(0,f.useMemo)((function(){var e;return H.qL.INTEGRATION===(null===(e=U)||void 0===e?void 0:e.type)}),[U]);(0,f.useEffect)((function(){U&&on&&re&&rn(!1)}),[on,U,rn,re]);var ht=(0,f.useState)((0,kn.U2)(hr.iL,!1)),mt=ht[0],xt=ht[1],jt=(0,f.useMemo)((function(){return!pt&&(null===Q||void 0===Q?void 0:Q(null===ne||void 0===ne?void 0:ne.NOTEBOOK_BLOCK_OUTPUT_SPLIT_VIEW))&&mt}),[Q,ne,pt,mt]),yt=(0,f.useState)((0,kn.U2)(hr.qj,!1)),kt=yt[0],Zt=yt[1],Ot=(0,f.useMemo)((function(){return(null===Q||void 0===Q?void 0:Q(null===ne||void 0===ne?void 0:ne.NOTEBOOK_BLOCK_OUTPUT_SPLIT_VIEW))&&kt}),[Q,ne,kt]),Ct=(0,f.useCallback)((function(e){Zt(e),(0,kn.t8)(hr.qj,"function"===typeof e?e():e)}),[Zt]),_t=(0,f.useCallback)((function(e){var n="function"===typeof e?e():e;xt(e),(0,kn.t8)(hr.iL,n),n||Ct(e)}),[Ct,xt]),St=(0,f.useCallback)((function(){var e=new CustomEvent(Pt.$e,{detail:{}});window.dispatchEvent(e)}),[]),Et=(0,f.useCallback)((function(){var e=new CustomEvent(Pt.tK,{detail:{}});window.dispatchEvent(e)}),[]),It=(0,f.useCallback)((function(e){mn((function(n){var t=e(n);return(0,kn.t8)(fn,JSON.stringify(t)),t})),jt&&(clearTimeout(q.current),q.current=setTimeout((function(){Et(),St()}),zt.e+1))}),[fn,mn,jt]);(0,f.useEffect)((function(){var e=(0,kn.U2)(fn);e&&(0,J.Pb)(e)&&mn(JSON.parse(e))}),[fn,mn]);var Tt=K.ZP.kernels.list({},{refreshInterval:5e3,revalidateOnFocus:!0}),Mt=Tt.data,Dt=Tt.mutate,Rt=(0,f.useMemo)((function(){var e=null===Mt||void 0===Mt?void 0:Mt.kernels;return(null===e||void 0===e?void 0:e.find((function(e){var n;return e.name===H.a_[null===(n=U)||void 0===n?void 0:n.type]})))||(null===e||void 0===e?void 0:e[0])}),[Mt,U]),At=(0,f.useState)(null),Bt=At[0],Nt=At[1],Lt=(0,f.useState)(Number((0,Or.Tz)({dateObj:!0}))),Ft=Lt[0],Ut=Lt[1],Ht=(0,f.useState)(!1),Gt=Ht[0],Wt=Ht[1],Kt=(0,vt.dd)((function(){return(0,S.jsx)(ut.Z,{centerOnScreen:!0,neutral:!0,onClick:Yt,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"}),Vt=(0,r.Z)(Kt,2),qt=Vt[0],Yt=Vt[1];(0,f.useEffect)((function(){var e;null!==Rn&&void 0!==Rn&&null!==(e=Rn.pipeline)&&void 0!==e&&e.updated_at&&Bt!==s()().utc().unix()&&Nt(s()(Rn.pipeline.updated_at).unix()),Bt&&Bt>Ft&&qt()}),[null===Rn||void 0===Rn||null===(c=Rn.pipeline)||void 0===c?void 0:c.updated_at,Bt,Ft,qt]);var Qt=(0,Co.iV)(),Xt=Qt[pi.uM],Jt=Qt.block_uuid,$t=Qt.file_path,ei=(0,f.useMemo)((function(){var e=Qt["file_paths[]"]||[];return Array.isArray(e)||(e=[e]),e}),[Qt]),ni=(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)({},pi.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),(0,ft.u7)(i,{preserveParams:["addon","block_uuid","file_path","file_paths[]"],pushHistory:n,replaceParams:!0})}),[]);(0,f.useEffect)((function(){Xt||ni(pi.cH.TREE,!1)}),[Xt,ni]);var ti=(0,f.useCallback)((function(e,n,t){fe(!1),setTimeout((function(){return ni(e,n,t)}),1)}),[ni]),ii=(0,f.useRef)({}),oi=(0,f.useRef)({}),ri=(0,f.useRef)(null),li=(0,f.useRef)({}),ui=(0,f.useRef)({}),ci=(0,f.useRef)({}),ai=(0,f.useState)({}),si=ai[0],di=ai[1],fi=(0,f.useCallback)((function(e,n,t){var i=li.current||{};li.current=wr(wr({},i),{},(0,l.Z)({},e,wr(wr({},i[e]||{}),{},(0,l.Z)({},n,t))))}),[li]),vi=(0,f.useCallback)((function(e,n,t){var i=ui.current||{};ui.current=wr(wr({},i),{},(0,l.Z)({},e,wr(wr({},i[e]||{}),{},(0,l.Z)({},n,t))))}),[ui]),hi=(0,f.useCallback)((function(e,n,t){fi(e,n,t),Wt(!0)}),[fi,Wt]),gi=(0,f.useCallback)((function(e,n,t){vi(e,n,t),Wt(!0)}),[vi,Wt]),bi=(0,f.useCallback)((function(e){ci.current=wr(wr({},ci.current),e)}),[ci]),xi=(0,f.useCallback)((function(e,n){bi((0,l.Z)({},e,n)),Wt(!0)}),[bi,Wt]),ji=(0,f.useState)(null),yi=ji[0],ki=ji[1],Pi=K.ZP.data_providers.list({},{revalidateOnFocus:!1}).data,Oi=null===Pi||void 0===Pi?void 0:Pi.data_providers,Ci=K.ZP.variables.pipelines.list(se,{global_only:!0},{revalidateOnFocus:!1}),wi=Ci.data,_i=Ci.mutate,Ii=null===wi||void 0===wi?void 0:wi.variables,Ti=K.ZP.secrets.list({},{revalidateOnFocus:!1}),Mi=Ti.data,Di=Ti.mutate,Ri=null===Mi||void 0===Mi?void 0:Mi.secrets,Ai=(0,f.useState)([]),Bi=Ai[0],Ni=Ai[1],Li=(0,f.useState)([]),Fi=Li[0],Ui=Li[1],Hi=(0,f.useRef)({}),zi=(0,f.useCallback)((function(e){var n;Wt(!0);var t=Hi.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),Hi.current[e.uuid]=wr(wr(wr({},t),e),{},{configuration:wr(wr({},t.configuration),e.configuration),upstream_blocks:i})}),[Wt,Hi]),Gi=(0,f.useState)(!1),Wi=Gi[0],Ki=Gi[1],Vi=(0,f.useState)({upstreamBlocks:null}),qi=Vi[0],Yi=Vi[1],Qi=(0,f.useState)([]),Xi=Qi[0],Ji=Qi[1],$i=(0,f.useState)(null),eo=$i[0],no=$i[1],to=(0,wt.Dp)(se),io=(0,wt.Q9)(to,Bi),oo=(0,f.useState)(io),ro=oo[0],lo=oo[1],uo=(0,f.useState)(),co=uo[0],ao=uo[1],so=(0,f.useState)(),po=so[0],fo=so[1],vo=(0,f.useState)(null),ho=vo[0],mo=vo[1],go=(0,at.Z)(ro),bo=(0,f.useCallback)((function(){Yi({upstreamBlocks:{block:null,values:[]}}),On({}),Wt(!1),Ji([]),no(null)}),[]);(0,f.useEffect)((function(){se!==Tn&&(li.current={},ui.current={})}),[se,Tn]);var xo=K.ZP.block_outputs.detail(!pe&&(null===ho||void 0===ho?void 0:ho.type)!==b.tf.SCRATCHPAD&&(null===ho||void 0===ho?void 0:ho.type)!==b.tf.CHART&&null!==ho&&void 0!==ho&&ho.uuid?encodeURIComponent(null===ho||void 0===ho?void 0:ho.uuid):null,{pipeline_uuid:se}),jo=xo.data,yo=xo.mutate,ko=(0,f.useMemo)((function(){return null===jo||void 0===jo?void 0:jo.block_output}),[jo]),Zo=(0,f.useMemo)((function(){var e,n,t;return pt?null===(e=(0,Ie.sE)(null===ko||void 0===ko?void 0:ko.outputs,(function(e){return e.variable_uuid==="output_sample_data_".concat((0,J.kE)(po))})))||void 0===e?void 0:e.sample_data:null===ko||void 0===ko||null===(n=ko.outputs)||void 0===n||null===(t=n[0])||void 0===t?void 0:t.sample_data}),[ko,pt,po]),Po=K.ZP.blocks.pipelines.analyses.detail(pe?null:se,(null===ho||void 0===ho?void 0:ho.type)!==b.tf.SCRATCHPAD&&(null===ho||void 0===ho?void 0:ho.type)!==b.tf.CHART&&(null===ho||void 0===ho?void 0:ho.uuid)&&encodeURIComponent(null===ho||void 0===ho?void 0:ho.uuid)),Oo=Po.data,wo=Po.mutate,_o=(null===Oo||void 0===Oo||null===(a=Oo.analyses)||void 0===a?void 0:a[0])||{},So=_o.insights,Eo=void 0===So?{}:So,Io=_o.metadata,To=void 0===Io?{}:Io,Mo=_o.statistics,Do=void 0===Mo?{}:Mo;(0,f.useEffect)((function(){0===Xi.length&&(wo(),yo(),_i())}),[wo,yo,_i,Xi]),(0,f.useEffect)((function(){if(0===ro.length)mo(null);else if((null===go||void 0===go?void 0:go.length)!==(null===ro||void 0===ro?void 0:ro.length)&&(null===ro||void 0===ro?void 0:ro.length)<(null===go||void 0===go?void 0:go.length)){var e=go.findIndex((function(e){return e.uuid===(null===ho||void 0===ho?void 0:ho.uuid)})),n=go.length-1===e?e-1:e+1;mo(go[Math.max(0,n)])}}),[ro,go,null===ho||void 0===ho?void 0:ho.uuid]),(0,f.useEffect)((function(){var e;null!==(e=qi.upstreamBlocks)&&void 0!==e&&e.block&&(fe(!1),ni(pi.cH.TREE))}),[qi.upstreamBlocks,ni]);var Ro=K.ZP.autocomplete_items.list({},{refreshInterval:!1,revalidateOnFocus:!1}),Ao=Ro.data,Bo=Ro.mutate,No=null===Ao||void 0===Ao?void 0:Ao.autocomplete_items;(0,f.useEffect)((function(){$t||Je(!1),Be($t)}),[$t,Qt]),(0,f.useEffect)((function(){(0,Ie.fS)(ei,Le)||Fe(ei)}),[ei,Le,Qt]);var Lo=(0,v.Db)(K.ZP.pipelines.useCreate(),{onSuccess:function(e){return(0,$.wD)(e,{callback:function(e){var n=e.pipeline.uuid;ue.push("/pipelines/[pipeline]/edit","/pipelines/".concat(n,"/edit")),ct()},onErrorCallback:function(e,n){return Ce({errors:n,response:e})}})}}),Fo=(0,r.Z)(Lo,1)[0],Uo=(0,v.Db)(K.ZP.pipelines.useUpdate(se,{update_content:!0}),{onSuccess:function(e){return(0,$.wD)(e,{callback:function(){Wt(!1),An().then((function(e){var n=e.pipeline;if(jt){var t,i,o,r=null===(t=U)||void 0===t||null===(i=t.blocks)||void 0===i?void 0:i.map((function(e){return e.uuid})),l=null===n||void 0===n||null===(o=n.blocks)||void 0===o?void 0:o.map((function(e){return e.uuid}));(0,Ie.fS)(r||[],l||[])||setTimeout((function(){(0,Yo.h)()}),1)}})),ct()},onErrorCallback:function(e,n){return Ce({errors:n,response:e})}})}}),Ho=(0,r.Z)(Uo,2),zo=Ho[0],Go=Ho[1].isLoading,Wo=(0,f.useState)({}),Ko=Wo[0],Vo=Wo[1],qo=(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(!(Bt&&Bt>Ft)){var a=(0,Or.Tz)({dateObj:!0}),s=(0,Or.Tz)();Ut(Number(a));var d={},p={},f={},v={};((null===u||void 0===u?void 0:u.blocks)||Bi).forEach((function(e){var n,t,i,l=e.extension_uuid,u=e.type,a=e.uuid,s=null===(n=ui.current[u])||void 0===n?void 0:n[a];"undefined"===typeof s&&(s=e.content);var h=null===(t=li.current[u])||void 0===t?void 0:t[a];"undefined"===typeof h&&(h=e.callback_content);var m=null,g=null===(i=Pn[a])||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&&(!re||null===Xi||void 0===Xi||!Xi.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!==Ko&&void 0!==Ko&&Ko[null===e||void 0===e?void 0:e.uuid])&&(Array.isArray(t)&&(n.data=t.reduce((function(e,n){return n.match(vr.Lz)?e:e.concat(n)}),[]),i===bt.Gi.TEXT_PLAIN&&(y+=(null===t||void 0===t?void 0:t.length)||0)),(!jn||y<jn+5)&&j.push(n))})),m=j.map((function(e,n){return{text_data:JSON.stringify(e),variable_uuid:"output_".concat(n)}}))}var k=wr(wr({},e),{},{callback_content:h,content:s});null===m?delete k.outputs:k.outputs=m,(null===o||void 0===o?void 0:o.uuid)===a&&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=wr(wr({},null===(t=U)||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)||Bi).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)})),Vo({}),zo({pipeline:wr(wr(wr({},U),u),{},{blocks:m,callbacks:g,conditionals:x,extensions:h,updated_at:s,widgets:Fi.map((function(e){var n,t,i=ci.current[e.uuid],o=Hi.current[e.uuid]||{};"undefined"===typeof i&&(i=e.content);var r=null===(n=Pn[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(vr.Lz)?e:e.concat(n)}),[])),u.push(n))})),t=u.map((function(n,t){return{text_data:JSON.stringify(n),variable_uuid:"".concat(e.uuid,"_").concat(t)}}))}return wr(wr(wr({},e),o),{},{configuration:wr(wr({},e.configuration),o.configuration),content:i,outputs:t})}))})})}qt()}),[Bi,jn,Pn,Ko,U,Bt,Ft,Xi,qt,re,zo,Fi]),Qo=(0,f.useMemo)((function(){return(0,wt.Rz)(U,{displayRelative:!0,isPipelineUpdating:Go,pipelineContentTouched:Gt,pipelineLastSaved:Bt})}),[Go,U,Gt,Bt]),Xo=(0,vt.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,a=wr({},o);r&&(a.content=null===r||void 0===r||null===(n=r.current)||void 0===n||null===(t=n[u])||void 0===t?void 0:t[c]);return(0,S.jsx)(ee.BC,{children:(0,S.jsx)(wn,wr(wr({},e),{},{block:a,onChangeCodeBlock:gi,onClose:er,pipeline:U,savePipelineContent:qo}))})}),{},[gi,U,qo],{background:!0,disableClickOutside:!0,disableCloseButton:!0,disableEscape:!0,uuid:"DataIntegrationModal/".concat(se)}),Jo=(0,r.Z)(Xo,2),$o=Jo[0],er=Jo[1],nr=(0,f.useCallback)((function(e){qo();var n=encodeURIComponent(e),t=(0,Co.iV)()["file_paths[]"]||[];Array.isArray(t)||(t=[t]),t.includes(n)||t.push(n),(0,ft.u7)({file_path:n,"file_paths[]":t})}),[qo]),tr=(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===Bi||void 0===Bi?void 0:Bi.find((function(e){return e.uuid===(null===n||void 0===n?void 0:n.blockUUID)})):(0,kr.IO)(r,Bi)){var u=t,c=u.type,a=u.uuid;gi(c,a,o),Ni((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===a}));return n>=0&&(e[n].content=o),e})),di((function(e){return wr(wr({},e),{},(0,l.Z)({},c,wr(wr({},null===e||void 0===e?void 0:e[c]),{},(0,l.Z)({},a,Number(new Date)))))})),An()}}),[Bi,An,gi]);(0,f.useEffect)((function(){var e,n,t=Rn,i=[],o=null===(e=U)||void 0===e?void 0:e.variables_dir,r=null===(n=U)||void 0===n?void 0:n.remote_variables_dir;null!==Rn&&void 0!==Rn&&Rn.hasOwnProperty("error")&&!$t?"undefined"!==se?i=[{label:"Check pipeline configuration file for any issues",onClick:function(){nr("pipelines/".concat(se,"/").concat(zn.dT.METADATA_YAML)),Ce(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!==Pi&&void 0!==Pi&&Pi.hasOwnProperty("error")?t=Pi:(null!==o&&void 0!==o&&o.includes("None")||null!==r&&void 0!==r&&r.includes("None"))&&!$t&&(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(){nr("".concat(zn.dT.METADATA_YAML)),Ee(null)}}]),(0,$.bB)(t,Ee,i)}),[Rn,Pi,$t,nr,null===(x=U)||void 0===x?void 0:x.remote_variables_dir,null===(j=U)||void 0===j?void 0:j.variables_dir,se]);var ir=(0,f.useMemo)((function(){var e=[],n=[];return Bi.forEach((function(t){b.M5.includes(t.type)?n.push(t):e.push(t)})),{blocksInNotebook:e,blocksInSidekick:n}}),[Bi]),or=ir.blocksInNotebook,rr=ir.blocksInSidekick,lr=(0,f.useCallback)((function(e,n){return qo({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(se!==r)window.location.href="".concat(ue.basePath,"/pipelines/").concat(r,"/edit");else ct(),n!==(null===(o=U)||void 0===o?void 0:o.type)&&An(),(0,wt.k1)(or,se,r),(0,wt.k1)(rr,se,r)}else null!==e&&void 0!==e&&null!==(i=e.data)&&void 0!==i&&i.error&&Ce((function(e){return wr(wr({},e),{},{links:[{label:"Check pipeline configuration",onClick:function(){nr("pipelines/".concat(se,"/").concat(zn.dT.METADATA_YAML)),Ce(null)}}]})}))}))}),[or,rr,ct,An,nr,null===(y=U)||void 0===y?void 0:y.type,se,ue,qo]),ar=(0,f.useState)(null),sr=ar[0],dr=ar[1],pr=(0,f.useState)(null),Cr=pr[0],_r=pr[1],Sr=(0,f.useState)(null),Er=Sr[0],Ir=Sr[1],Tr=(0,f.useCallback)((function(e){return $n({pipeline_interaction:wr(wr({},Yn),{},{blocks:null!==e&&void 0!==e&&e.blockInteractionsMapping?null===e||void 0===e?void 0:e.blockInteractionsMapping:Cr,interactions:sr,permissions:null===Er||void 0===Er?void 0:Er.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}}))}}))})})}),[Cr,sr,Er,Yn,$n]),Mr=(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),K.ZP.blocks.pipelines.useDelete(se,encodeURIComponent(o),r)()}),{onSuccess:function(e){return(0,$.wD)(e,{callback:function(e){var n=e.block,t=n.type,i=n.uuid;if(Ni((function(e){return(0,Ie.oM)(e,e.findIndex((function(e){var n=e.type,o=e.uuid;return t===n&&i===o})))})),An(),no(null),t===b.tf.SCRATCHPAD&&ct(),ln){var o=wr({},Cr);delete o[i],Tr({blockInteractionsMapping:o}).then((function(e){var n=e.pipeline_interaction;return _r(null===n||void 0===n?void 0:n.blocks)}))}},onErrorCallback:function(e,n){var t=e.url_parameters,i=n.messages;Ce({errors:n,response:e}),null!==t&&void 0!==t&&t.block_uuid&&On((function(e){return wr(wr({},e),{},(0,l.Z)({},t.block_uuid,i.map((function(e){return{data:"".concat(e,"\n"),error:"".concat(e,"\n"),type:bt.Gi.TEXT_PLAIN}}))))}))}})}}),Dr=(0,r.Z)(Mr,1)[0],Rr=(0,v.Db)((function(e){var n=e.uuid;return K.ZP.widgets.pipelines.useDelete(se,n)()}),{onSuccess:function(e){return(0,$.wD)(e,{callback:function(e){var n=e.widget.uuid;Ui((function(e){return(0,Ie.oM)(e,e.findIndex((function(e){var t=e.uuid;return n===t})))})),An(),ct()},onErrorCallback:function(e,n){var t=e.url_parameters,i=n.messages;Ce({errors:n,response:e}),null!==t&&void 0!==t&&t.block_uuid&&On((function(e){return wr(wr({},e),{},(0,l.Z)({},t.block_uuid,i.map((function(e){return{data:"".concat(e,"\n"),error:"".concat(e,"\n"),type:bt.Gi.TEXT_PLAIN}}))))}))}})}}),Ar=(0,r.Z)(Rr,1)[0],Br=(0,vt.dd)((function(e){return(0,S.jsx)(ut.Z,{centerOnScreen:!0,neutral:!0,onCancel:Fr,onClick:function(){return Hr(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})})),Nr=(0,r.Z)(Br,2),Lr=Nr[0],Fr=Nr[1],Ur=(0,v.Db)((function(e){var n=e.language,t=e.type,i=e.uuid,o="".concat(t,"/").concat(i);return n&&zn.JD[n]&&(o="".concat(o,".").concat(zn.JD[n].toLowerCase())),K.ZP.blocks.useDelete(encodeURIComponent(o))()}),{onSuccess:function(e){return(0,$.wD)(e,{callback:function(){Bo(),An(),ct()},onErrorCallback:function(e,n){Lr(),Ce({displayMessage:e.exception,errors:n,response:e})}})}}),Hr=(0,r.Z)(Ur,1)[0],zr=(0,v.Db)(K.ZP.kernels.useUpdate(null===Rt||void 0===Rt?void 0:Rt.id),{onSuccess:function(e){return(0,$.wD)(e,{callback:function(){return Dt()},onErrorCallback:function(e,n){return Ce({errors:n,response:e})}})}}),Gr=(0,r.Z)(zr,1)[0],Wr=(0,f.useCallback)((function(){return Gr({kernel:{action_type:"restart"}})}),[Gr]),Kr=(0,f.useCallback)((function(){Gr({kernel:{action_type:"interrupt"}}),Ji([])}),[Gr]),Vr=(0,v.Db)(K.ZP.blocks.pipelines.useCreate(se)),qr=(0,r.Z)(Vr,1)[0],Yr=(0,f.useCallback)((function(e,n,t){var i,l,u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:(0,J.Y6)();e.converted_from_type&&e.converted_from_uuid&&(i=null===(l=ui.current[e.converted_from_type])||void 0===l?void 0:l[e.converted_from_uuid]);var c=e.language,a=e.type;if(pt){var s,d=(0,Ie.HK)((null===(s=U)||void 0===s?void 0:s.blocks)||[],(function(e){return e.type})),p=d[b.tf.DATA_EXPORTER],f=d[b.tf.DATA_LOADER],v=d[b.tf.TRANSFORMER];if(b.tf.DATA_LOADER===a){if(b.t6.YAML!==c)return void Ce({displayMessage:"The source you\u2019re trying to add must contain the language ".concat(b.t6.YAML," and not ").concat(c,".")});var h;if(f)return void Ce({displayMessage:"Pipeline ".concat(null===(h=U)||void 0===h?void 0:h.uuid," already has a source: ").concat(null===f||void 0===f?void 0:f.uuid,".")})}else if(b.tf.TRANSFORMER===a){var m;if(v)return void Ce({displayMessage:"Pipeline ".concat(null===(m=U)||void 0===m?void 0:m.uuid," already has a transformer: ").concat(null===v||void 0===v?void 0:v.uuid,".")})}else if(b.tf.DATA_EXPORTER===a){if(b.t6.YAML!==c)return void Ce({displayMessage:"The destination you\u2019re trying to add must contain the language ".concat(b.t6.YAML," and not ").concat(c,".")});var g;if(p)return void Ce({displayMessage:"Pipeline ".concat(null===(g=U)||void 0===g?void 0:g.uuid," already has a destination: ").concat(null===p||void 0===p?void 0:p.uuid,".")})}}var x=function(){return qr({block:wr({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),jt&&null!==Q&&void 0!==Q&&Q(null===ne||void 0===ne?void 0:ne.NOTEBOOK_BLOCK_OUTPUT_SPLIT_VIEW))?null===(e=window)||void 0===e||null===(i=e.location)||void 0===i||i.reload():(ct(),An().then((function(e){var n=e.pipeline,t=n.blocks,i=n.extensions;Ni((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 wr(wr({},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,kr.u$)(wr(wr({},e),{},{name:u}));o&&r&&o.startsWith(Pt.LR)?Ce((function(){return{errors:t,links:[{label:"View existing block file contents and optionally add to pipeline (if applicable).",onClick:function(){nr(r),Ce(null)}}],response:n}})):Ce({errors:t,response:n})}})}))};return jt&&null!==Q&&void 0!==Q&&Q(null===ne||void 0===ne?void 0:ne.NOTEBOOK_BLOCK_OUTPUT_SPLIT_VIEW)?qo().then((function(){return x()})):x()}),[qr,ct,An,pt,nr,U,qo,Ni,Ce,jt]),Qr=(0,vt.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,a=e.onCreateCallback;return(0,S.jsx)(ee.BC,{children:(0,S.jsx)(ie,{block:n,defaultName:c,isReplacingBlock:o,isUpdatingBlock:l,onClose:$r,onSave:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(l||o){var i,r=n.detach||!1;qo({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=U)||void 0===i?void 0:i.blocks)||[]}}).then((function(){no(null),$r()}))}else Yr(wr(wr({},n),(0,je.gR)(e,["name"])),t,a,null===e||void 0===e?void 0:e.name).then((function(){return $r()}))},pipeline:U})})}),{},[Yr,U],{background:!0,disableEscape:!0,uuid:"configure_block_name_and_create"}),Xr=(0,r.Z)(Qr,2),Jr=Xr[0],$r=Xr[1],el=(0,vt.dd)((function(e){var n=e.cancelButtonText,t=e.header,i=e.onCancel,o=e.onSaveSuccess;return(0,S.jsx)(ee.BC,{children:(0,S.jsx)(Ei.Z,{cancelButtonText:n,contained:!0,header:t,onCancel:function(){null===i||void 0===i||i(),il()},onSaveSuccess:function(e){te(),il(),null===o||void 0===o||o(e)}})})}),{},[te],{background:!0,uuid:"configure_project"}),nl=(0,r.Z)(el,2),tl=nl[0],il=nl[1],ol=(0,v.Db)(K.ZP.widgets.pipelines.useCreate(se)),rl=(0,r.Z)(ol,1)[0],ll=(0,f.useCallback)((function(e,n,t){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:(0,J.Y6)();return rl({widget:wr({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),ct(),An(),ni(pi.cH.CHARTS),De(n)},onErrorCallback:function(e,n){return Ce({errors:n,response:e})}})}))}),[ct,An,rl,ni]);(0,f.useEffect)((function(){if(Me){var e,n=null===(e=oi.current[Me.uuid])||void 0===e?void 0:e.current;n&&(n.scrollIntoView(),De(null))}}),[Me,De]),(0,f.useEffect)((function(){Tn!==se&&(Ni([]),Ui([]),lo([]),In([]))}),[se,Tn]),(0,f.useEffect)((function(){var e,n;if("undefined"!==typeof(null===(e=U)||void 0===e?void 0:e.blocks)||"undefined"!==typeof(null===(n=U)||void 0===n?void 0:n.extensions)){var t,i,l,u,c,a,s,d,p=[];if("undefined"!==typeof(null===(t=U)||void 0===t?void 0:t.blocks))p.push.apply(p,(0,o.Z)(null===(c=U)||void 0===c?void 0:c.blocks));if("undefined"!==typeof(null===(i=U)||void 0===i?void 0:i.callbacks))p.push.apply(p,(0,o.Z)(null===(a=U)||void 0===a?void 0:a.callbacks));if("undefined"!==typeof(null===(l=U)||void 0===l?void 0:l.conditionals))p.push.apply(p,(0,o.Z)(null===(s=U)||void 0===s?void 0:s.conditionals));if("undefined"!==typeof(null===(u=U)||void 0===u?void 0:u.extensions))Object.entries((null===(d=U)||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 wr(wr({},e),{},{extension_uuid:t})}))))}));Ni(p)}}),[null===(k=U)||void 0===k?void 0:k.blocks,null===(P=U)||void 0===P?void 0:P.callbacks,null===(C=U)||void 0===C?void 0:C.conditionals,null===(_=U)||void 0===_?void 0:_.extensions]),(0,f.useEffect)((function(){var e;"undefined"!==typeof(null===(e=U)||void 0===e?void 0:e.widgets)&&Ui(U.widgets)}),[null===(E=U)||void 0===E?void 0:E.widgets]),(0,f.useEffect)((function(){(null===io||void 0===io?void 0:io.length)>0&&0===(null===ro||void 0===ro?void 0:ro.length)&&(lo(io),mo(io[0]))}),[ro,io]);var ul=(0,at.Z)(Bi);(0,f.useEffect)((function(){var e;if(!be&&("undefined"!==typeof(null===(e=U)||void 0===e?void 0:e.blocks)&&(!Bi.length||!(0,Ie.fS)(null===ul||void 0===ul?void 0:ul.map((function(e){return e.uuid})).sort(),null===Bi||void 0===Bi?void 0:Bi.map((function(e){return e.uuid})).sort())||(0,je.Qr)(Pn)))){var n=(0,wt.Rt)(U.blocks),t=n.content,i=n.messages;ui.current=t,(0,je.Qr)(i)||On((function(e){return wr(wr({},i),e)})),xe(!0)}}),[Bi,ul,be,Pn,null===(I=U)||void 0===I?void 0:I.blocks,xe,On]),(0,f.useEffect)((function(){var e;if(!Fi.length&&"undefined"!==typeof(null===(e=U)||void 0===e?void 0:e.widgets)){var n=(0,wt.Rt)(U.widgets),t=n.content,i=n.messages;ci.current=t,On((function(e){return wr(wr({},i),e)}))}}),[null===(A=U)||void 0===A?void 0:A.widgets,On,Fi]);var cl=(0,f.useCallback)((function(e,n,t){var i=Bi.find((function(t){var i=t.type,o=t.uuid;return i===n&&o===e}));if(i){if(no(i),null!==ii&&void 0!==ii&&ii.current){var o,r=ii.current[(0,wt.zv)(i)];null===r||void 0===r||null===(o=r.current)||void 0===o||o.scrollIntoView()}(0,ft.u7)({block_uuid:null,file_path:null,"file_paths[]":[]})}else if(n===b.tf.CHART){var l=Fi.find((function(n){return n.uuid===e}));if(l&&(no(l),null!==oi&&void 0!==oi&&oi.current)){var u,c=oi.current[l.uuid];null===c||void 0===c||null===(u=c.current)||void 0===u||u.scrollIntoView()}}else t&&nr(t)}),[Bi,nr,Fi]);(0,f.useEffect)((function(){if(Jt&&!eo){var e=Bi.find((function(e){var n,t=e.uuid;return(null===Jt||void 0===Jt||null===(n=Jt.split(":"))||void 0===n?void 0:n[0])===t}));e&&(It((function(n){return wr(wr({},n),{},(0,l.Z)({},e.uuid,!1))})),cl(e.uuid,e.type,null))}else(null===ul||void 0===ul?void 0:ul.length)!==(null===Bi||void 0===Bi?void 0:Bi.length)&&eo&&(It((function(e){return wr(wr({},e),{},(0,l.Z)({},eo.uuid,!1))})),cl(eo.uuid,eo.type,null))}),[Jt,Bi,null===ul||void 0===ul?void 0:ul.length,cl,eo,It]);var al=(0,f.useMemo)((function(){return new g.Z}),[]),sl=(0,f.useMemo)((function(){return{api_key:br.l,token:al.decodedToken.token}}),[al]),dl=(0,d.ZP)((0,Zr.Ib)(),{onClose:function(){return console.log("socketUrlPublish closed")},onMessage:function(e){if(e){var n=JSON.parse(e.data),t=n.block_type,i=n.execution_state,r=n.msg_type,u=n.pipeline_uuid,c=n.uuid;if(!c&&!u)return;var a=Bi.find((function(e){var n=e.type,i=e.uuid;return t===n&&c===i}));"stream_pipeline"!==r?On((function(e){var t=e[c]||[];return wr(wr({},e),{},(0,l.Z)({},c,t.concat(n)))})):(In((function(e){return[].concat((0,o.Z)(e),[n])})),bt.uF.IDLE===i&&(Ji([]),An(),c||Ki(!1))),bt.uF.BUSY===i?Ji((function(e){return e.find((function(e){var n=e.uuid;return c===n}))||!a?e:e.concat(a)})):bt.uF.IDLE===i&&Ji((function(e){return e.filter((function(e){var n=e.uuid;return c!==n}))})),xn||Wt(!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(){qo().then((function(){Ki(!0),In([]),dl(JSON.stringify(wr(wr({},sl),{},{execute_pipeline:!0,pipeline_uuid:se})))}))}),[se,qo,dl,sl]),fl=(0,f.useCallback)((function(){dl(JSON.stringify(wr(wr({},sl),{},{cancel_pipeline:!0,pipeline_uuid:se})))}),[se,dl,sl]),vl=(0,f.useCallback)((function(){dl(JSON.stringify(wr(wr({},sl),{},{cancel_pipeline:!0,pipeline_uuid:se,skip_publish_message:!0})))}),[se,dl,sl]),hl=(0,f.useCallback)((function(){dl(JSON.stringify(wr(wr({},sl),{},{check_if_pipeline_running:!0,pipeline_uuid:se})))}),[se,dl,sl]);(0,f.useEffect)((function(){var e;return window.addEventListener("pagehide",vl),null===ue||void 0===ue||null===(e=ue.events)||void 0===e||e.on("routeChangeStart",vl),function(){var e;null===ue||void 0===ue||null===(e=ue.events)||void 0===e||e.off("routeChangeStart",vl),window.removeEventListener("pagehide",vl)}}),[vl,null===ue||void 0===ue?void 0:ue.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,a=e.runSettings,s=void 0===a?{}:a,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(!Xi.find((function(e){var n=e.uuid;return g===n}))||i){var b,x,j="".concat(hr.vF,"_").concat(null===(b=U)||void 0===b?void 0:b.uuid);dl(JSON.stringify(wr(wr({},sl),{},{code:t,extension_uuid:h,output_messages_to_logs:!!(0,kn.U2)(j),pipeline_uuid:null===(x=U)||void 0===x?void 0:x.uuid,run_downstream:r,run_incomplete_upstream:c,run_settings:s,run_tests:p,run_upstream:f,type:n.type,upstream_blocks:m,uuid:g,variables:v}))),On((function(e){return delete e[g],e})),Ke(!1),Ji((function(e){return e.find((function(e){var n=e.uuid;return g===n}))?e:e.concat(n)})),Vo((function(e){return wr(wr({},e),{},(0,l.Z)({},null===n||void 0===n?void 0:n.uuid,!0))}))}An()}),[An,U,Xi,dl,On,Ji,Ke,sl]),gl=(0,f.useCallback)((function(e){var n,t=e.block;return xn?ml(e):null===(n=qo({block:{outputs:[],uuid:t.uuid}},{contentOnly:!0}))||void 0===n?void 0:n.then((function(){return ml(e)}))}),[xn,ml,qo]),bl=(0,d.ZP)((0,Zr.Ib)("terminal"),{shouldReconnect:function(){return!0}}),xl=bl.lastMessage,jl=bl.sendMessage,yl=(0,vt.dd)((function(e){var n=e.addNew,t=e.addNewBlock,i=e.blockType;return(0,S.jsx)(ee.BC,{children:(0,S.jsx)(M.Z,{contained:!0,defaultLinkUUID:i,onClickCustomTemplate:function(e){t({config:{custom_template:e,custom_template_uuid:null===e||void 0===e?void 0:e.template_uuid}}),Pl()},showAddingNewTemplates:!!n,showBreadcrumbs:!0,tabs:[gr.n9]})})}),{},[],{background:!0,uuid:"browse_templates"}),kl=(0,r.Z)(yl,2),Zl=kl[0],Pl=kl[1],Ol=K.ZP.global_data_products.list().data,Cl=(0,f.useMemo)((function(){return(null===Ol||void 0===Ol?void 0:Ol.global_data_products)||[]}),[Ol]),wl=(0,vt.dd)((function(e){var n=e.addNewBlock;return(0,S.jsx)(ee.BC,{children:(0,S.jsx)(qn.Z,{children:(0,S.jsx)(Gn.Z,{globalDataProducts:Cl,onClickRow:function(e){n({configuration:{global_data_product:{uuid:null===e||void 0===e?void 0:e.uuid}},type:b.tf.GLOBAL_DATA_PRODUCT}),El()}})})})}),{},[Cl],{background:!0,uuid:"global_data_products"}),_l=(0,r.Z)(wl,2),Sl=_l[0],El=_l[1],Il=(0,f.useRef)(null),Tl=(0,f.useState)(null),Ml=Tl[0],Dl=Tl[1],Rl=(0,f.useMemo)((function(){return pi.cH.INTERACTIONS===Xt}),[Xt]);(0,f.useEffect)((function(){var e,n;Xt&&null!==Il&&void 0!==Il&&Il.current&&Dl(null===Il||void 0===Il||null===(e=Il.current)||void 0===e||null===(n=e.getBoundingClientRect())||void 0===n?void 0:n.height)}),[Xt,pe,ce,ln,Il]),(0,f.useEffect)((function(){!sr&&(null===Qn||void 0===Qn?void 0:Qn.length)>=1&&dr((0,Ie.HK)(Qn||[],(function(e){return e.uuid})))}),[Qn,sr,dr]),(0,f.useEffect)((function(){!Cr&&null!==Yn&&void 0!==Yn&&Yn.blocks&&_r(null===Yn||void 0===Yn?void 0:Yn.blocks)}),[Cr,Yn,_r]);var Al=(0,f.useMemo)((function(){return(0,S.jsx)(ur,{activeView:Xt,addNewBlockAtIndex:function(e,n,t,i){var o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return new Promise((function(){return Jr({block:e,idx:n,isReplacingBlock:o,name:i,onCreateCallback:t})}))},afterWidth:ke,autocompleteItems:No,blockInteractionsMapping:Cr,blockRefs:ii,blocks:Bi,blocksInNotebook:or,cancelPipeline:fl,chartRefs:oi,checkIfPipelineRunning:hl,containerHeightOffset:Rl?Ml+1:null,contentByBlockUUID:ui,createInteraction:it,deleteBlock:Dr,deleteWidget:Ar,editingBlock:qi,executePipeline:pl,fetchFileTree:ct,fetchPipeline:An,fetchSecrets:Di,fetchVariables:_i,globalDataProducts:Cl,globalVariables:Ii,insights:Eo,interactions:Qn,interactionsMapping:sr,interruptKernel:Kr,isLoadingCreateInteraction:ot,isLoadingUpdatePipelineInteraction:et,isPipelineExecuting:Wi,isPipelineUpdating:Go,lastTerminalMessage:xl,messages:Pn,metadata:To,onChangeCallbackBlock:hi,onChangeChartBlock:xi,onChangeCodeBlock:gi,onSelectBlockFile:cl,onUpdateFileSuccess:tr,permissions:Er,pipeline:U,pipelineInteraction:Yn,pipelineMessages:En,project:oe,refAfterFooter:Il,runBlock:gl,runningBlocks:Xi,sampleData:Zo,savePipelineContent:qo,savePipelineInteraction:Tr,secrets:Ri,selectedBlock:eo,selectedFilePath:Ae,sendTerminalMessage:jl,setActiveSidekickView:ni,setAllowCodeBlockShortcuts:nn,setAnyInputFocused:Ye,setBlockInteractionsMapping:_r,setDisableShortcuts:Je,setEditingBlock:Yi,setErrors:Ce,setHiddenBlocks:It,setInteractionsMapping:dr,setPermissions:Ir,setSelectedBlock:no,setTextareaFocused:Ke,showBrowseTemplates:Zl,showDataIntegrationModal:$o,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 Jr({block:e,isReplacingBlock:t,isUpdatingBlock:!t,name:n})}))},sideBySideEnabled:jt,statistics:Do,textareaFocused:We,treeRef:ri,updatePipelineInteraction:$n,updatePipelineMetadata:lr,updateWidget:zi,widgets:Fi})}),[Xt,Ml,ke,No,Cr,ii,Bi,or,fl,hl,ui,it,Dr,Ar,qi,pl,ct,An,Di,_i,Cl,Ii,Eo,Qn,sr,Kr,ot,et,Wi,Go,Rl,xl,Pn,To,hi,xi,gi,cl,tr,Er,U,Yn,En,oe,Il,gl,Xi,Zo,qo,Tr,Ri,eo,Ae,jl,ni,Ye,_r,Yi,Ce,It,dr,Ir,Ke,Jr,Zl,$o,jt,Do,We,$n,lr,zi,Fi]),Bl=(0,f.useMemo)((function(){return(0,S.jsx)(Zi,{addNewBlockAtIndex: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)?Jr({block:e,idx:n,name:i,onCreateCallback:t}):Yr(e,n,t,i)}))},addWidget:function(e,n){var t=n.onCreateCallback;return ll(e,Fi.length,t)},afterHidden:pe,allBlocks:Bi,allowCodeBlockShortcuts:en,anyInputFocused:qe,autocompleteItems:No,beforeHidden:he,blockInteractionsMapping:Cr,blockRefs:ii,blocks:or,blocksThatNeedToRefresh:si,dataProviders:Oi,deleteBlock:Dr,disableShortcuts:Xe,fetchFileTree:ct,fetchPipeline:An,fetchSampleData:yo,files:st,globalDataProducts:Cl,globalVariables:Ii,hiddenBlocks:hn,interactionsMapping:sr,interruptKernel:Kr,mainContainerRef:gn,mainContainerWidth:yi,messages:Pn,onChangeCallbackBlock:hi,onChangeCodeBlock:gi,openSidekickView:ti,pipeline:U,pipelineContentTouched:Gt,project:oe,restartKernel:Wr,runBlock:gl,runningBlocks:Xi,savePipelineContent:qo,scrollTogether:Ot,selectedBlock:eo,setAnyInputFocused:Ye,setDisableShortcuts:Je,setEditingBlock:Yi,setErrors:Ce,setHiddenBlocks:It,setIntegrationStreams:ao,setOutputBlocks:lo,setPipelineContentTouched:Wt,setSelectedBlock:no,setSelectedOutputBlock:mo,setSelectedStream:fo,setTextareaFocused:Ke,showBrowseTemplates:Zl,showConfigureProjectModal:tl,showDataIntegrationModal:$o,showGlobalDataProducts:Sl,showUpdateBlockModal:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,J.Y6)();return new Promise((function(){return Jr({block:e,isUpdatingBlock:!0,name:n})}))},sideBySideEnabled:jt,textareaFocused:We,widgets:Fi})}),[Yr,ll,pe,en,qe,No,he,ii,Cr,Bi,or,si,Oi,Dr,Xe,ct,An,yo,st,Cl,Ii,hn,sr,Kr,gn,yi,Pn,hi,gi,ti,U,Gt,oe,Wr,gl,Xi,qo,Ot,eo,Ye,Yi,Ce,It,Wt,no,Ke,Jr,Zl,tl,$o,Sl,jt,We,Fi]),Nl=(0,f.useMemo)((function(){if(z===Pt.b7)return(0,S.jsx)(Un,{cancelPipeline:fl,createPipeline:Fo,executePipeline:pl,interruptKernel:Kr,isPipelineExecuting:Wi,kernel:Rt,pipeline:U,restartKernel:Wr,savePipelineContent:qo,scrollTogether:Ot,setActiveSidekickView:ni,setMessages:On,setScrollTogether:Ct,setSideBySideEnabled:_t,sideBySideEnabled:jt,updatePipelineMetadata:lr,children:Ae&&(0,S.jsx)(O.Z,{ml:1,children:(0,S.jsx)(Z.ZP,{alignItems:"center",fullHeight:!0,children:(0,S.jsx)(D.ZP,{compact:!0,onClick:function(){return Be(null)},small:!0,children:"View pipeline"})})})})}),[fl,Fo,pl,Kr,Wi,Rt,z,U,Wr,qo,Ot,Ae,ni,On,Ct,Be,_t,jt,lr]),Ll=(0,f.useMemo)((function(){if(z===Pt.b7)return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(gt,{filePaths:Le,filesTouched:He,isBusy:Xi.length>=1,kernel:Rt,pipeline:U,restartKernel:Wr,savePipelineContent:qo,selectedFilePath:Ae,setErrors:Ce,setRunningBlocks:Ji,updatePipelineMetadata:lr,children:Nl}),(null===Le||void 0===Le?void 0:Le.length)>0&&(0,S.jsx)(dt.rK,{relativePosition:!0,secondary:!0,children:(0,S.jsx)(Hn.Z,{filePaths:Le,filesTouched:He,savePipelineContent:qo,selectedFilePath:Ae})})]})}),[Nl,He,Rt,z,U,Wr,Xi,qo,Ae,Le,Ce,lr]),Fl=(0,f.useMemo)((function(){if(z===Pt.b7)return(0,S.jsx)(fr,{kernel:Rt,pipelineContentTouched:Gt,pipelineLastSaved:Bt,ref:W,saveStatus:Qo,width:yi})}),[yi,z,Gt,Bt,Qo]),Ul=(0,f.useMemo)((function(){var e;return null===co||void 0===co||null===(e=co.filter((function(e){return(0,Ie.sE)(null===ko||void 0===ko?void 0:ko.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,S.jsx)(O.Z,{pl:1,children:(0,S.jsx)(F.ZP,{blackBorder:!0,compact:!0,muted:!0,onClick:function(){return fo(e)},selected:po===e,uuid:e,children:e})},e)}))}),[ko,co,po]),Hl=(0,f.useRef)(null),zl=(0,f.useMemo)((function(){return(0,S.jsx)(_n.Z,{addNewBlock:function(e,n){Yr(e,Bi.length,n,e.name),(null===ei||void 0===ei?void 0:ei.length)>=1&&ue.push("/pipelines/".concat(se,"/edit"))},blocks:Bi,deleteWidget:Ar,fetchAutocompleteItems:Bo,fetchFileTree:ct,fetchPipeline:An,files:st,onSelectBlockFile:cl,openFile:nr,openPipeline:function(e){bo(),ue.push("/pipelines/[pipeline]/edit","/pipelines/".concat(e,"/edit"))},openSidekickView:ti,pipeline:U,ref:Hl,setErrors:Ce,setSelectedBlock:no,widgets:Fi})}),[Yr,Bi,Ar,Bo,ct,An,null===ei||void 0===ei?void 0:ei.length,st,cl,nr,ti,U,se,bo,ue,Ce,no,Fi]),Gl=(0,f.useMemo)((function(){return(0,S.jsx)(T,{blockRefs:ii,hiddenBlocks:hn,pipeline:U,setHiddenBlocks:It})}),[ii,hn,U,It]),Wl=(0,f.useMemo)((function(){return Pt.Jf.uuid===(null===sn||void 0===sn?void 0:sn.uuid)?zl:Pt.IY.uuid===(null===sn||void 0===sn?void 0:sn.uuid)?Gl:null}),[zl,Gl,sn]),Kl=(0,f.useMemo)((function(){return(0,S.jsx)(O.Z,{px:1,children:(0,S.jsx)(R.Z,{noPadding:!0,onClickTab:function(e){pn(e)},selectedTabUUID:null===sn||void 0===sn?void 0:sn.uuid,tabs:Pt.NR,underlineColor:(le||_e.Z).accent.purple,underlineStyle:!0})})}),[pn,sn,le]);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(Wn.Z,{title:null===(B=U)||void 0===B?void 0:B.name}),(0,S.jsxs)(Si,{after:Al,afterHeader:(0,S.jsx)(cr,{activeView:Xt,pipeline:U,project:oe,secrets:Ri,selectedBlock:eo,setSelectedBlock:no,variables:Ii}),afterHeightOffset:mr.Mz,afterHidden:pe,afterInnerHeightMinus:Ml,afterNavigationItems:yr({activeView:Xt,pipeline:U,project:oe,secrets:Ri,setActiveSidekickView:ni,variables:Ii}),afterOverflow:pi.cH.DATA===Xt?"hidden":null,afterSubheader:(null===ro||void 0===ro?void 0:ro.length)>0&&Xt===pi.cH.DATA&&(0,S.jsxs)(Z.ZP,{alignItems:"center",fullHeight:!0,fullWidth:!0,children:[!pt&&ro.map((function(e){var n=e.uuid,t=(null===ho||void 0===ho?void 0:ho.uuid)===n;return(0,S.jsx)(O.Z,{pl:1,children:(0,S.jsx)(F.ZP,{afterElement:t?(0,S.jsx)(D.ZP,{basic:!0,highlightOnHover:!0,onClick:function(){(0,wt.h8)(se,e.uuid),lo((function(e){return e.filter((function(e){return e.uuid!==n}))}))},padding:"2px",transparent:!0,children:(0,S.jsx)(V.x8,{muted:!0,size:1.25*w.iI})}):null,blackBorder:!0,compact:!0,muted:!0,onClick:function(){return mo(e)},selected:t,uuid:n,children:n})},n)})),pt&&Ul]}),before:Wl,beforeHeader:Kl,beforeHeightOffset:mr.Mz,beforeHidden:he,beforeNavigationItems:(0,jr.H)(xr.M.EDIT,U),errors:Se||Oe,footerOffset:null===W||void 0===W||null===(N=W.current)||void 0===N||null===(L=N.getBoundingClientRect())||void 0===L?void 0:L.height,headerOffset:(null===Le||void 0===Le?void 0:Le.length)>0?36:0,mainContainerFooter:Fl,mainContainerHeader:Ll,mainContainerRef:gn,page:z,pipeline:U,setAfterHidden:fe,setAfterWidthForChildren:Ze,setBeforeHidden:me,setErrors:Se?Ee:Ce,setMainContainerWidth:ki,children:[(0,S.jsx)("div",{style:{height:Ae?0:null,opacity:Ae?0:null,visibility:Ae?"hidden":null},children:(0,S.jsx)(m.Z,{uuid:"PipelineDetail/".concat(se),children:Bl})}),null===ei||void 0===ei?void 0:ei.map((function(e){return(0,S.jsx)("div",{style:{display:Ae===e?null:"none"},children:(0,S.jsx)(m.Z,{uuid:"FileEditor/".concat(decodeURIComponent(e)),children:(0,S.jsx)(Sn.Z,{active:Ae===e,addNewBlock:function(e,n){Yr(wr(wr({},e),{},{require_unique_name:!1}),Bi.length,n,e.name),ue.push("/pipelines/".concat(se,"/edit"))},fetchPipeline:An,fetchVariables:_i,filePath:e,onUpdateFileSuccess:tr,openSidekickView:ti,pipeline:U,selectedFilePath:Ae,sendTerminalMessage:jl,setDisableShortcuts:Je,setErrors:Ce,setFilesTouched:ze,setSelectedBlock:no})})},e)})),(0,S.jsx)(O.Z,{pb:$t||jt?0:Math.max(Math.floor(ce*(2/3)/w.iI),0)})]})]})}_r.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=Pt.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 Sr=(0,Ii.Z)(_r)},80329:function(e,n,t){"use strict";t.d(n,{j:function(){return i}});var i=(0,t(44152).r)({apiReloads:{}}).useGlobalState},23657:function(e,n,t){"use strict";var i=t(82394),o=t(75582),r=t(82684),l=t(74260),u=t(35686),c=t(77417);function 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 s(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(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.clustersRefreshInterval,t=e.computeServiceRefreshInterval,a=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:a},{pauseFetch:!f})),C=O.data,w=O.mutate,_=(0,r.useMemo)((function(){return(null===C||void 0===C?void 0:C.compute_connections)||[]}),[C]),S=(0,r.useCallback)((function(){return new Promise((function(){null===y||void 0===y||y(),null===w||void 0===w||w(),null===m||void 0===m||m()}))}),[y,w,m]);return{activeCluster:null===Z||void 0===Z?void 0:Z.find((function(e){return e.active})),clusters:Z,clustersLoading:!j,computeService:g,computeServiceUUIDs:Object.entries(l.GO).reduce((function(e,n){var t=(0,o.Z)(n,2),r=t[0],l=t[1];return s(s({},e),{},(0,i.Z)({},r,l))}),{}),connections:_,connectionsLoading:!C,fetchAll:S,fetchComputeClusters:y,fetchComputeConnections:w,fetchComputeService:m,setupComplete:P}}},76419:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/pipelines/[pipeline]/edit",function(){return t(98305)}])}},function(e){e.O(0,[9774,2678,3662,1154,844,5820,6639,1124,341,1751,5896,2714,9161,1821,2631,7011,4783,6563,4267,600,8487,8264,7858,5499,722,1769,1550,90,9264,553,976,1749,2888,179],(function(){return n=76419,e(e.s=n);var n}));var n=e.O();_N_E=n}]);
|