mage-ai 0.9.45__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/constants.py +2 -0
- mage_ai/api/operations/base.py +230 -12
- mage_ai/api/policies/BasePolicy.py +3 -3
- mage_ai/api/policies/ComputeClusterPolicy.py +96 -0
- mage_ai/api/policies/ComputeConnectionPolicy.py +74 -0
- mage_ai/api/policies/ComputeServicePolicy.py +50 -0
- mage_ai/api/policies/DownloadPolicy.py +29 -0
- mage_ai/api/policies/GlobalHookPolicy.py +126 -0
- mage_ai/api/policies/IntegrationSourcePolicy.py +62 -0
- mage_ai/api/policies/OauthPolicy.py +56 -4
- mage_ai/api/policies/ProjectPolicy.py +1 -0
- mage_ai/api/presenters/ComputeClusterPresenter.py +19 -0
- mage_ai/api/presenters/ComputeConnectionPresenter.py +26 -0
- mage_ai/api/presenters/ComputeServicePresenter.py +15 -0
- mage_ai/api/presenters/DownloadPresenter.py +13 -0
- mage_ai/api/presenters/GlobalHookPresenter.py +74 -0
- mage_ai/api/presenters/IntegrationSourcePresenter.py +9 -2
- mage_ai/api/presenters/PipelinePresenter.py +3 -0
- mage_ai/api/presenters/PipelineRunPresenter.py +8 -3
- mage_ai/api/presenters/PipelineSchedulePresenter.py +22 -1
- mage_ai/api/presenters/ProjectPresenter.py +1 -0
- mage_ai/api/presenters/SparkApplicationPresenter.py +2 -0
- mage_ai/api/presenters/WorkspacePresenter.py +22 -22
- mage_ai/api/resources/AsyncBaseResource.py +39 -0
- mage_ai/api/resources/BlockResource.py +5 -0
- mage_ai/api/resources/ClusterResource.py +1 -1
- mage_ai/api/resources/ComputeClusterResource.py +109 -0
- mage_ai/api/resources/ComputeConnectionResource.py +103 -0
- mage_ai/api/resources/ComputeServiceResource.py +35 -0
- mage_ai/api/resources/DataProviderResource.py +2 -0
- mage_ai/api/resources/DownloadResource.py +56 -0
- mage_ai/api/resources/ExecutionStateResource.py +1 -1
- mage_ai/api/resources/GlobalHookResource.py +192 -0
- mage_ai/api/resources/IntegrationSourceResource.py +149 -2
- mage_ai/api/resources/KernelResource.py +10 -0
- mage_ai/api/resources/OauthResource.py +28 -33
- mage_ai/api/resources/PipelineResource.py +4 -4
- mage_ai/api/resources/PipelineScheduleResource.py +37 -16
- mage_ai/api/resources/ProjectResource.py +5 -3
- mage_ai/api/resources/SessionResource.py +0 -9
- mage_ai/api/resources/SparkApplicationResource.py +5 -5
- mage_ai/api/resources/SparkEnvironmentResource.py +1 -2
- mage_ai/api/resources/SparkExecutorResource.py +1 -2
- mage_ai/api/resources/SparkJobResource.py +3 -6
- mage_ai/api/resources/SparkSqlResource.py +6 -11
- mage_ai/api/resources/SparkStageAttemptResource.py +2 -3
- mage_ai/api/resources/SparkStageAttemptTaskResource.py +1 -2
- mage_ai/api/resources/SparkStageAttemptTaskSummaryResource.py +1 -2
- mage_ai/api/resources/SparkStageResource.py +3 -6
- mage_ai/api/resources/SparkThreadResource.py +1 -2
- mage_ai/api/resources/mixins/spark.py +25 -4
- mage_ai/authentication/oauth2.py +1 -3
- mage_ai/authentication/permissions/constants.py +4 -0
- mage_ai/authentication/providers/active_directory.py +136 -0
- mage_ai/authentication/providers/constants.py +3 -0
- mage_ai/authentication/providers/ghe.py +24 -25
- mage_ai/authentication/providers/google.py +25 -26
- mage_ai/authentication/providers/oauth.py +2 -2
- mage_ai/authentication/providers/okta.py +28 -29
- mage_ai/authentication/providers/sso.py +2 -2
- mage_ai/cluster_manager/aws/emr_cluster_manager.py +2 -1
- mage_ai/cluster_manager/workspace/base.py +7 -3
- mage_ai/data_integrations/destinations/constants.py +1 -0
- 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/executors/pipeline_executor.py +9 -0
- mage_ai/data_preparation/models/block/__init__.py +82 -17
- mage_ai/data_preparation/models/block/data_integration/constants.py +3 -0
- mage_ai/data_preparation/models/block/data_integration/data.py +1 -1
- mage_ai/data_preparation/models/block/data_integration/utils.py +196 -37
- mage_ai/data_preparation/models/block/spark/mixins.py +82 -34
- 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/download/__init__.py +8 -0
- mage_ai/data_preparation/models/global_hooks/__init__.py +0 -0
- mage_ai/data_preparation/models/global_hooks/constants.py +93 -0
- mage_ai/data_preparation/models/global_hooks/models.py +992 -0
- mage_ai/data_preparation/models/global_hooks/predicates.py +316 -0
- mage_ai/data_preparation/models/global_hooks/utils.py +21 -0
- mage_ai/data_preparation/models/pipeline.py +84 -6
- mage_ai/data_preparation/models/pipelines/integration_pipeline.py +0 -1
- mage_ai/data_preparation/models/pipelines/models.py +16 -0
- mage_ai/data_preparation/models/project/__init__.py +6 -0
- mage_ai/data_preparation/models/project/constants.py +1 -0
- mage_ai/data_preparation/models/project/models.py +12 -0
- mage_ai/data_preparation/preferences.py +29 -18
- mage_ai/data_preparation/repo_manager.py +35 -3
- 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/data_loaders/streaming/activemq.yaml +6 -0
- mage_ai/data_preparation/templates/data_loaders/streaming/nats.yaml +20 -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 +100 -36
- mage_ai/orchestration/pipeline_scheduler.py +58 -19
- mage_ai/orchestration/queue/process_queue.py +9 -1
- mage_ai/orchestration/triggers/api.py +11 -3
- mage_ai/orchestration/triggers/constants.py +1 -0
- mage_ai/server/active_kernel.py +37 -4
- mage_ai/server/api/downloads.py +76 -1
- 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-bf512b4dabbab7fa.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/{7519-8c29bbb92e03cc77.js → 1845-5ce774d5ab81ed57.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/1952-57858e7445d24413.js +1 -0
- 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/_next/static/chunks/3419-715ca383fa15a5ef.js +1 -0
- 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/3932-0ceca9599d6e6d00.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/5457-949640f4037bf12f.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/5499-76cf8f023c6b0985.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/553-7f7919e14392ca67.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/5638-a65610405a70961c.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/5810-e26a0768db1cfdba.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/5820-28adeabb5cda2b96.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/600-705fe234320ec5de.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/3122-f27de34d0b5426af.js → frontend_dist/_next/static/chunks/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/5397-b5f2e477acc6bd6b.js → frontend_dist/_next/static/chunks/6965-c613d1834c8ed92d.js} +1 -1
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/7022-18fde36eb46e1d65.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_base_path_template/_next/static/chunks/7361-694e1e4fb9c97d68.js → frontend_dist/_next/static/chunks/7361-6c5c9063b9f91700.js} +1 -1
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/7858-c83d25349d0e980f.js → frontend_dist/_next/static/chunks/7858-d9df72e95e438284.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/{8146-92e7ccfed169ee9c.js → 8146-27f0e31f309897a5.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/8264-0d582a6ca33c3dfa.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/3684-cbda680fd8927d07.js → frontend_dist/_next/static/chunks/8432-f191e39f9b5893f2.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/90-a7308bae028d7001.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/framework-22b71764bf44ede4.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/_app-78c4a077a2f279c2.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/block-layout-a24cb24b6f08bbc9.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/compute-419775ca1293b354.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-data-products/{[...slug]-3f6fc312f67ff72e.js → [...slug]-cfd68e760ae00958.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/{global-data-products-f4cd03036c3e8723.js → global-data-products-c3b79ef31007f95b.js} +1 -1
- 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-fe6e73463a20d67c.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/settings-60845f0b59142f32.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/manage/users/[user]-1d9b298fdceabbf1.js → frontend_dist/_next/static/chunks/pages/manage/users/[user]-9384c5f1efa2ac18.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/users/new-abd8571907664fdf.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/{users-a7c970122a10afdc.js → users-28a930b148d99766.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage-d8a38b5d1f50e798.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/overview-a4647a274cf4dffa.js → frontend_dist/_next/static/chunks/pages/overview-f0c40645f385f23f.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/{pipeline-runs-c79819d6826e5416.js → pipeline-runs-b35d37bfba8fbccc.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]/dashboard-571c0962333b92f0.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-2333e524d34b474a.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/{logs-a52d2d3e0c2978f4.js → logs-ef680455ae54ccbe.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runs-ddddcddd2f74b4f6.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-4a238307feddb522.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors-6d1afeb4a84f50f7.js +1 -0
- mage_ai/server/frontend_dist/_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]/runs-ce717786f31e8f04.js → frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs-2d20b2cd08907afd.js} +1 -1
- 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]/syncs-b75bf17498e87354.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/{[pipeline]-35fe7762cb83a733.js → [pipeline]-02c843b9c8418bb5.js} +1 -1
- 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/permissions/{[...slug]-d6a62284c7c99cb3.js → [...slug]-b78b1be5b9ed84b9.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/{permissions-b1389695f758c32b.js → permissions-37b78a436eeab258.js} +1 -1
- 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/settings/workspace/roles/{[...slug]-0bdb66265286ab22.js → [...slug]-db05a80d18c168e5.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/{roles-e04e18fc295ca76a.js → roles-f55c77e4f46c8d33.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/sync-data-2a1f8737561fdd94.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/users/{[...slug]-0267358c91122109.js → [...slug]-e3bf6e5d8bb250c4.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/{users-50fed18bb9b8d142.js → users-20f0a050a42a015d.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/{settings-56f83205752b1323.js → settings-0f0121db7f5ff93d.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/sign-in-99e2748e3c1d57a3.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/templates/[...slug]-9370551ffa462144.js → frontend_dist/_next/static/chunks/pages/templates/[...slug]-f44ccd1499ffd23a.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/{templates-3cff90df13a1a755.js → templates-1bfaa1c50e844813.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/terminal-ed121e305169cf1c.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/test-9ae68758102cc843.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/_next/static/chunks/{webpack-8af2b89c5a3779fc.js → webpack-fea697dd168c6d0c.js} +1 -1
- 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 +24 -0
- mage_ai/server/frontend_dist/global-hooks.html +24 -0
- 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 +24 -25
- 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 +15 -15
- 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-bf512b4dabbab7fa.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{7519-8c29bbb92e03cc77.js → 1845-5ce774d5ab81ed57.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1952-57858e7445d24413.js +1 -0
- 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_base_path_template/_next/static/chunks/3419-715ca383fa15a5ef.js +1 -0
- 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/3932-0ceca9599d6e6d00.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/5457-949640f4037bf12f.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5499-76cf8f023c6b0985.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/553-7f7919e14392ca67.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5638-a65610405a70961c.js +1 -0
- 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/5820-28adeabb5cda2b96.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/600-705fe234320ec5de.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/3122-f27de34d0b5426af.js → frontend_dist_base_path_template/_next/static/chunks/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/5397-b5f2e477acc6bd6b.js → frontend_dist_base_path_template/_next/static/chunks/6965-c613d1834c8ed92d.js} +1 -1
- mage_ai/server/{frontend_dist/_next/static/chunks/7022-18fde36eb46e1d65.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/_next/static/chunks/7361-694e1e4fb9c97d68.js → frontend_dist_base_path_template/_next/static/chunks/7361-6c5c9063b9f91700.js} +1 -1
- mage_ai/server/{frontend_dist/_next/static/chunks/7858-c83d25349d0e980f.js → frontend_dist_base_path_template/_next/static/chunks/7858-d9df72e95e438284.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{8146-92e7ccfed169ee9c.js → 8146-27f0e31f309897a5.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8264-0d582a6ca33c3dfa.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/3684-cbda680fd8927d07.js → frontend_dist_base_path_template/_next/static/chunks/8432-f191e39f9b5893f2.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/90-a7308bae028d7001.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/framework-22b71764bf44ede4.js +1 -0
- 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/block-layout-a24cb24b6f08bbc9.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/compute-419775ca1293b354.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-data-products/{[...slug]-3f6fc312f67ff72e.js → [...slug]-cfd68e760ae00958.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{global-data-products-f4cd03036c3e8723.js → global-data-products-c3b79ef31007f95b.js} +1 -1
- 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-fe6e73463a20d67c.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/settings-60845f0b59142f32.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/manage/users/[user]-1d9b298fdceabbf1.js → frontend_dist_base_path_template/_next/static/chunks/pages/manage/users/[user]-9384c5f1efa2ac18.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/users/new-abd8571907664fdf.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/{users-a7c970122a10afdc.js → users-28a930b148d99766.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage-d8a38b5d1f50e798.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/overview-a4647a274cf4dffa.js → frontend_dist_base_path_template/_next/static/chunks/pages/overview-f0c40645f385f23f.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{pipeline-runs-c79819d6826e5416.js → pipeline-runs-b35d37bfba8fbccc.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]/dashboard-571c0962333b92f0.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_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/{logs-a52d2d3e0c2978f4.js → logs-ef680455ae54ccbe.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runs-ddddcddd2f74b4f6.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-4a238307feddb522.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors-6d1afeb4a84f50f7.js +1 -0
- 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/_next/static/chunks/pages/pipelines/[pipeline]/runs-ce717786f31e8f04.js → frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/runs-2d20b2cd08907afd.js} +1 -1
- 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]/syncs-b75bf17498e87354.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/{[pipeline]-35fe7762cb83a733.js → [pipeline]-02c843b9c8418bb5.js} +1 -1
- 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/permissions/{[...slug]-d6a62284c7c99cb3.js → [...slug]-b78b1be5b9ed84b9.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/{permissions-b1389695f758c32b.js → permissions-37b78a436eeab258.js} +1 -1
- 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/settings/workspace/roles/{[...slug]-0bdb66265286ab22.js → [...slug]-db05a80d18c168e5.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/{roles-e04e18fc295ca76a.js → roles-f55c77e4f46c8d33.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/sync-data-2a1f8737561fdd94.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/users/{[...slug]-0267358c91122109.js → [...slug]-e3bf6e5d8bb250c4.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/{users-50fed18bb9b8d142.js → users-20f0a050a42a015d.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{settings-56f83205752b1323.js → settings-0f0121db7f5ff93d.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/sign-in-99e2748e3c1d57a3.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/templates/[...slug]-9370551ffa462144.js → frontend_dist_base_path_template/_next/static/chunks/pages/templates/[...slug]-f44ccd1499ffd23a.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{templates-3cff90df13a1a755.js → templates-1bfaa1c50e844813.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/terminal-ed121e305169cf1c.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/test-9ae68758102cc843.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/_next/static/chunks/{webpack-074f3eb2281fba79.js → webpack-d30cb09c85b4c4f0.js} +1 -1
- 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 +24 -0
- mage_ai/server/frontend_dist_base_path_template/global-hooks.html +24 -0
- 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 +28 -29
- 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 +15 -15
- 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 +44 -12
- mage_ai/server/utils/output_display.py +6 -0
- mage_ai/server/websocket_server.py +14 -0
- mage_ai/services/aws/emr/config.py +1 -0
- mage_ai/services/aws/emr/constants.py +1 -0
- mage_ai/services/aws/emr/emr.py +20 -7
- mage_ai/services/compute/__init__.py +0 -0
- mage_ai/services/compute/aws/__init__.py +0 -0
- mage_ai/services/compute/aws/constants.py +21 -0
- mage_ai/services/compute/aws/models.py +459 -0
- mage_ai/services/compute/aws/steps.py +482 -0
- mage_ai/services/compute/constants.py +27 -0
- mage_ai/services/compute/models.py +212 -0
- mage_ai/services/k8s/job_manager.py +4 -0
- mage_ai/services/spark/api/aws_emr.py +38 -0
- mage_ai/services/spark/api/base.py +7 -4
- mage_ai/services/spark/api/constants.py +4 -0
- mage_ai/services/spark/api/local.py +25 -24
- mage_ai/services/spark/api/service.py +15 -5
- mage_ai/services/spark/constants.py +1 -1
- mage_ai/services/spark/models/applications.py +45 -3
- mage_ai/services/spark/models/base.py +3 -19
- mage_ai/services/spark/models/environments.py +16 -11
- mage_ai/services/spark/models/executors.py +2 -2
- mage_ai/services/spark/models/sqls.py +46 -15
- mage_ai/services/spark/models/stages.py +55 -32
- mage_ai/services/spark/models/threads.py +2 -2
- mage_ai/services/spark/utils.py +22 -6
- mage_ai/services/ssh/__init__.py +0 -0
- mage_ai/services/ssh/aws/__init__.py +0 -0
- mage_ai/services/ssh/aws/emr/__init__.py +0 -0
- mage_ai/services/ssh/aws/emr/constants.py +10 -0
- mage_ai/services/ssh/aws/emr/models.py +326 -0
- mage_ai/services/ssh/aws/emr/utils.py +151 -0
- mage_ai/settings/__init__.py +8 -1
- mage_ai/settings/repo.py +3 -0
- mage_ai/settings/secret_generation.py +7 -0
- mage_ai/settings/sso.py +8 -0
- mage_ai/shared/files.py +47 -0
- mage_ai/shared/hash.py +16 -0
- mage_ai/shared/models.py +254 -0
- mage_ai/streaming/constants.py +3 -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/streaming/sources/activemq.py +89 -0
- mage_ai/streaming/sources/nats_js.py +182 -0
- mage_ai/streaming/sources/source_factory.py +8 -0
- mage_ai/tests/ai/test_ai_functions.py +53 -8
- mage_ai/tests/api/endpoints/test_oauths.py +33 -0
- mage_ai/tests/api/endpoints/test_projects.py +1 -0
- mage_ai/tests/api/endpoints/test_workspaces.py +55 -0
- mage_ai/tests/api/operations/test_base.py +7 -5
- mage_ai/tests/api/operations/test_operations.py +0 -1
- mage_ai/tests/api/operations/test_operations_with_hooks.py +622 -0
- mage_ai/tests/api/operations/test_syncs.py +0 -1
- mage_ai/tests/api/operations/test_users.py +13 -2
- mage_ai/tests/api/policies/test_oauth_policy.py +38 -0
- mage_ai/tests/data_preparation/models/global_hooks/__init__.py +0 -0
- mage_ai/tests/data_preparation/models/global_hooks/test_global_hooks.py +600 -0
- mage_ai/tests/data_preparation/models/global_hooks/test_hook.py +804 -0
- mage_ai/tests/data_preparation/models/global_hooks/test_predicates.py +803 -0
- mage_ai/tests/data_preparation/models/global_hooks/test_utils.py +38 -0
- mage_ai/tests/data_preparation/models/test_block.py +26 -0
- mage_ai/tests/data_preparation/models/test_pipeline.py +15 -0
- mage_ai/tests/data_preparation/test_repo_manager.py +11 -0
- mage_ai/tests/factory.py +105 -5
- mage_ai/tests/orchestration/queue/test_process_queue.py +15 -2
- mage_ai/tests/orchestration/test_pipeline_scheduler.py +82 -1
- mage_ai/tests/services/k8s/test_job_manager.py +38 -1
- mage_ai/tests/shared/mixins.py +328 -0
- mage_ai/tests/shared/test_hash.py +17 -1
- mage_ai/tests/streaming/sinks/test_rabbitmq.py +36 -0
- mage_ai/tests/streaming/sources/test_activemq.py +32 -0
- mage_ai/tests/streaming/sources/test_nats_js.py +32 -0
- mage_ai/tests/streaming/sources/test_source_factory.py +26 -1
- {mage_ai-0.9.45.dist-info → mage_ai-0.9.47.dist-info}/METADATA +14 -4
- {mage_ai-0.9.45.dist-info → mage_ai-0.9.47.dist-info}/RECORD +467 -386
- {mage_ai-0.9.45.dist-info → mage_ai-0.9.47.dist-info}/WHEEL +1 -1
- mage_ai/authentication/oauth/active_directory.py +0 -17
- mage_ai/server/frontend_dist/_next/static/chunks/1125-91d3ce33140ef041.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/1749-607014ecf28268bf.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/1952-573c7fc7ad84da6e.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/3004-231cad9039ae5dcb.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/3419-0873e170ef7d6303.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-335766a915ee2fa9.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/5457-8be2e0a3fe0ba64b.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/5499-bca977f466e259e1.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/553-edf533e634e85192.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/5810-37c6091b29a1fe53.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/600-0733eb84f0a0a9e0.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/6333-95ad799d13326dce.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/722-2a171fe616310f60.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/8224-39a93ee1058b6069.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/8264-6ef8fdb195694807.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-1b5c4b071ed544c3.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/framework-7c365855dab1bf41.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/_app-1203afde83fa2d6e.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/block-layout-c465c14d48392b11.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/compute-b1f8d5a7a9a30f2d.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/files-93c094bad0f299fb.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/files-891e5bd5935f7473.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/settings-d2e4ee4e68d36807.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/users/new-4a49126fcfe8ced0.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage-5f8c5d0bc6ad1113.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-b4c0a36c69c346a4.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills-a9266d353f288e8c.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/dashboard-b5c29c852262312e.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-9f233917aa72ad82.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runs-5af599da035252a7.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-8597f8e13d80ee48.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors-5e0d047a6c9cb1fc.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs/[run]-b0a508aa52914dad.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/settings-074c32397d341de9.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/syncs-50f5d8706ed0bc73.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-e151c1552fcb67bd.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers-95394769a783c6c7.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines-8336c4326f1e7d96.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/account/profile-01dd679e4a21e0d9.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/preferences-4d9051c073a9b2ff.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/sync-data-5a306deca6717862.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/sign-in-0dbc5b11019e78a0.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/terminal-578d862f3e56e6e6.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/test-1c0588d685b909b9.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/triggers-ffaab4c013e62ba1.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/version-control-114000e84313994f.js +0 -1
- mage_ai/server/frontend_dist/_next/static/icIDjCezcfhiKL87kgeSY/_buildManifest.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/_O1kJQLGtZmoBMyWpQrea/_buildManifest.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1125-91d3ce33140ef041.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1749-607014ecf28268bf.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1952-573c7fc7ad84da6e.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3004-231cad9039ae5dcb.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3419-0873e170ef7d6303.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-335766a915ee2fa9.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5457-8be2e0a3fe0ba64b.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5499-bca977f466e259e1.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/553-edf533e634e85192.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5810-37c6091b29a1fe53.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/600-0733eb84f0a0a9e0.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/6333-95ad799d13326dce.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/722-2a171fe616310f60.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8224-39a93ee1058b6069.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8264-6ef8fdb195694807.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-1b5c4b071ed544c3.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/framework-7c365855dab1bf41.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/_app-1203afde83fa2d6e.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/block-layout-c465c14d48392b11.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/compute-b1f8d5a7a9a30f2d.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/files-93c094bad0f299fb.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/files-891e5bd5935f7473.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/settings-d2e4ee4e68d36807.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/users/new-4a49126fcfe8ced0.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage-5f8c5d0bc6ad1113.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-b4c0a36c69c346a4.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills-a9266d353f288e8c.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/dashboard-b5c29c852262312e.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/edit-9f233917aa72ad82.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runs-5af599da035252a7.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-8597f8e13d80ee48.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors-5e0d047a6c9cb1fc.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/runs/[run]-b0a508aa52914dad.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/settings-074c32397d341de9.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/syncs-50f5d8706ed0bc73.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-e151c1552fcb67bd.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers-95394769a783c6c7.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines-8336c4326f1e7d96.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/account/profile-01dd679e4a21e0d9.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/preferences-4d9051c073a9b2ff.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/sync-data-5a306deca6717862.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/sign-in-0dbc5b11019e78a0.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/terminal-578d862f3e56e6e6.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/test-1c0588d685b909b9.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/triggers-ffaab4c013e62ba1.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/version-control-114000e84313994f.js +0 -1
- /mage_ai/server/frontend_dist/_next/static/{icIDjCezcfhiKL87kgeSY → N3FS4bHv0jpYeeg672uYK}/_ssgManifest.js +0 -0
- /mage_ai/server/frontend_dist_base_path_template/_next/static/{_O1kJQLGtZmoBMyWpQrea → aoO6jYZLVlUGCCdY-wmy8}/_ssgManifest.js +0 -0
- {mage_ai-0.9.45.dist-info → mage_ai-0.9.47.dist-info}/LICENSE +0 -0
- {mage_ai-0.9.45.dist-info → mage_ai-0.9.47.dist-info}/entry_points.txt +0 -0
- {mage_ai-0.9.45.dist-info → mage_ai-0.9.47.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9264],{27277:function(e,n,t){var o=t(82394),i=t(21831),r=t(82684),l=t(39643),u=t(44688),c=t(28598);function a(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function d(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?a(Object(t),!0).forEach((function(n){(0,o.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.highlightedItemIndexInitial,t=void 0===n?null:n,o=e.itemGroups,a=e.noResultGroups,s=e.onHighlightItemIndexChange,f=e.onMouseEnterItem,p=e.onMouseLeaveItem,v=e.onSelectItem,m=e.renderEmptyState,h=e.searchQuery,b=e.selectedItem,g=e.setItemRefs,x=e.uuid,j=(0,r.useState)(!0),C=j[0],O=j[1],Z=(0,r.useMemo)((function(){var e=[],n=o.reduce((function(n,t){var o=t.items.filter((function(e){return!h||function(e,n){return e.searchQueries.filter((function(e){return String(e).toLowerCase().includes(n.toLowerCase())})).length>=1}(e,h)}));return 0===o.length?n:(e.push.apply(e,(0,i.Z)(o)),n.concat(d(d({},t),{},{items:o})))}),[]);return{itemGroups:n,itemsFlattened:e}}),[o,h]),k=Z.itemGroups,y=Z.itemsFlattened;a&&0===y.length&&(k.push.apply(k,(0,i.Z)(a)),y.push.apply(y,(0,i.Z)(a.reduce((function(e,n){var t=n.items;return e.concat(t)}),[]))));var E=(0,r.useRef)(null);E.current=y.map((function(){return(0,r.createRef)()}));var T=(0,r.useState)(t),S=T[0],_=T[1],P=(0,r.useCallback)((function(e){null===s||void 0===s||s(e),_(e)}),[s,_]),I=y[S],A=(0,u.y)(),R=A.registerOnKeyDown,w=A.unregisterOnKeyDown;(0,r.useEffect)((function(){return function(){return w(x)}}),[w,x]),null===R||void 0===R||R(x,(function(e,n,t){var o,i=!0,r=y.length,u=y.findIndex((function(e,o){var i=e.keyboardShortcutValidation;return null===i||void 0===i?void 0:i({keyHistory:t,keyMapping:n},o)})),c=n[l.Gs]&&!n[l.XR]&&!b;return-1!==u?(e.preventDefault(),v(y[u]),O(i),P(u)):(n[l.Uq]||c)&&y[S]?(c&&e.preventDefault(),v(y[S]),O(i),P(S)):(n[l.Bu]?(i=!1,o=null===S?r-1:S-1):n[l.kD]?(i=!1,o=null===S?0:S+1):n[l.vP]&&P(null),"undefined"!==typeof o&&(o>=r?o=0:o<=-1&&(o=r-1),o>=0&&o<=r-1?(P(o),e.preventDefault()):P(null)),void O(i))}),[S,y,b,P,O]),(0,r.useEffect)((function(){null===g||void 0===g||g(E)}),[E,y,g]),(0,r.useEffect)((function(){var e=null===S||"undefined"===typeof S||S>=y.length;(null===h||void 0===h?void 0:h.length)>=1&&e&&P(0)}),[S,y,h,P]);var D=(0,r.useCallback)((function(){return O(!0)}),[O]);return(0,r.useEffect)((function(){return window.addEventListener("mousemove",D),function(){window.removeEventListener("mousemove",D)}}),[D]),0===k.length&&m?m():(0,c.jsx)(c.Fragment,{children:k.map((function(e,n){var t=e.items,o=e.renderItem,i=e.renderGroupHeader,r=e.uuid,l=n>=1?k.slice(0,n).reduce((function(e,n){return e+n.items.length}),0):0,u=t.map((function(e,n){var t=e.itemObject,i=e.value,r=i===(null===I||void 0===I?void 0:I.value),u=n+l,a=(null===t||void 0===t?void 0:t.id)||(null===t||void 0===t?void 0:t.uuid);return(0,c.jsx)("div",{id:"item-".concat(i,"-").concat(a),onMouseMove:function(){return C&&P(u)},ref:E.current[u],children:o(e,{highlighted:r,onClick:function(){return v(e)},onMouseEnter:function(){return null===f||void 0===f?void 0:f(e)},onMouseLeave:function(){return null===p||void 0===p?void 0:p(e)}},n,u)},"item-".concat(i,"-").concat(a))}));return u.length>=1&&(0,c.jsxs)("div",{children:[null===i||void 0===i?void 0:i(),u]},r||"group-uuid-".concat(n))}))})}},88494:function(e,n,t){t.d(n,{MB:function(){return v},Nk:function(){return a},T5:function(){return d},_A:function(){return f},a3:function(){return p},wx:function(){return s}});var o=t(38626),i=t(44897),r=t(55283),l=t(42631),u=t(70515),c=t(30160),a=o.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-n38rkq-0"})([""," border-left-style:solid;border-left-width:2px;border-right-style:solid;border-right-width:2px;overflow:hidden;"," "," "," ",""],r.Kf,(function(e){return e.addBottomPadding&&"\n padding-bottom: ".concat(2*u.tr,"px;\n ")}),(function(e){return"\n background-color: ".concat((e.theme.background||i.Z.background).table,";\n ")}),(function(e){return!e.executedAndIdle&&"\n border-bottom-left-radius: ".concat(l.n_,"px;\n border-bottom-right-radius: ").concat(l.n_,"px;\n border-bottom-style: solid;\n border-bottom-width: 2px;\n ")}),(function(e){return e.showBorderTop&&"\n border-top-left-radius: ".concat(l.n_,"px;\n border-top-right-radius: ").concat(l.n_,"px;\n border-top-style: solid;\n border-top-width: 2px;\n ")})),d=o.default.div.withConfig({displayName:"indexstyle__OutputRowStyle",componentId:"sc-n38rkq-1"})([""," "," "," ",""],(function(e){return e.first&&"\n padding-top: ".concat(u.iI*u.cd,"px;\n ")}),(function(e){return e.last&&"\n padding-bottom: ".concat(u.iI*u.cd,"px;\n ")}),(function(e){return e.contained&&!e.normalPadding&&"\n padding-left: ".concat(r.oh,"px;\n padding-right: ").concat(u.iI*u.cd,"px;\n ")}),(function(e){return e.contained&&e.normalPadding&&"\n padding-left: ".concat(u.iI*u.cd,"px;\n padding-right: ").concat(u.iI*u.cd,"px;\n ")})),s=o.default.div.withConfig({displayName:"indexstyle__HTMLOutputStyle",componentId:"sc-n38rkq-2"})([""," table{"," border-left-style:solid;border-left-width:2px;border-right-style:solid;border-right-width:2px;}td,th{padding:0 8px;}a{","}"],c.IH,r.Kf,(function(e){return"\n color: ".concat((e.theme.interactive||i.Z.interactive).linkPrimary,";\n ")})),f=o.default.div.withConfig({displayName:"indexstyle__ExtraInfoStyle",componentId:"sc-n38rkq-3"})([""," border-bottom-left-radius:","px;border-bottom-right-radius:","px;border-bottom-style:solid;border-bottom-width:2px;border-left-style:solid;border-left-width:2px;border-right-style:solid;border-right-width:2px;",""],r.Kf,l.n_,l.n_,(function(e){return"\n background-color: ".concat((e.theme.borders||i.Z.borders).light,";\n ")})),p=o.default.div.withConfig({displayName:"indexstyle__ExtraInfoContentStyle",componentId:"sc-n38rkq-4"})(["padding-bottom:","px;padding-left:","px;padding-right:","px;padding-top:","px;"],u.iI,r.oh,u.iI*u.cd,u.iI),v=o.default.div.withConfig({displayName:"indexstyle__ExtraInfoBorderStyle",componentId:"sc-n38rkq-5"})(["height:1px;width:100%;",""],(function(e){return"\n border-top: 1px solid ".concat((e.theme.borders||i.Z.borders).medium,";\n ")}))},12869:function(e,n,t){var o=t(21831),i=t(82394),r=t(75582),l=t(82684),u=t(89565),c=t.n(u),a=t(62302),d=t(69864),s=t(40761),f=t(44425),p=t(71180),v=t(39867),m=t(75810),h=t(93859),b=t(24138),g=t(15338),x=t(97618),j=t(55485),C=t(48339),O=t(57653),Z=t(35185),k=t(38276),y=t(30160),E=t(12468),T=t(35686),S=t(98464),_=t(72473),P=t(88494),I=t(92709),A=t(89706),R=t(65044),w=t(70515),D=t(11498),N=t(47041),M=t(55283),L=t(41429),B=t(85385),U=t(74052),F=t(81728),G=t(72619),H=t(28598);function z(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function Q(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 K={appearAbove:!0,appearBefore:!0,block:!0,size:null,widthFitContent:!0},q={basic:!0,iconOnly:!0,noPadding:!0,transparent:!0};function Y(e,n){var t=e.block,i=e.blockIndex,u=e.blockMetadata,z=e.buttonTabs,Y=e.children,W=e.childrenBelowTabs,V=e.collapsed,X=e.contained,J=void 0===X||X,$=e.dynamicBlock,ee=e.dynamicChildBlock,ne=e.hasError,te=e.hasOutput,oe=e.hideExtraInfo,ie=e.hideOutput,re=e.isInProgress,le=e.mainContainerWidth,ue=e.messages,ce=e.messagesAll,ae=e.onClickSelectBlock,de=e.openSidekickView,se=e.outputRowNormalPadding,fe=e.pipeline,pe=e.runCount,ve=e.runEndTime,me=e.runStartTime,he=e.scrollTogether,be=e.selected,ge=e.selectedTab,xe=e.setCollapsed,je=e.setErrors,Ce=e.setOutputBlocks,Oe=e.setSelectedOutputBlock,Ze=e.setSelectedTab,ke=e.showBorderTop,ye=e.sideBySideEnabled,Ee=e.sparkEnabled,Te=(0,l.useState)(!1),Se=Te[0],_e=Te[1];(0,l.useEffect)((function(){_e(!0)}),[]);var Pe=(0,l.useCallback)((function(){var e=new CustomEvent(I.tK,{detail:{blockIndex:i}});window.dispatchEvent(e)}),[i]);(0,l.useEffect)((function(){Se&&ye&&Pe()}),[ce,Se,he,ye]);var Ie=t||{},Ae=Ie.color,Re=Ie.status,we=Ie.type,De=Ie.uuid,Ne=(0,l.useMemo)((function(){return{blockColor:Ae,blockType:we,dynamicBlock:$,dynamicChildBlock:ee,hasError:ne,selected:be}}),[Ae,we,$,ee,ne,be]),Me=(0,l.useMemo)((function(){return(null===ue||void 0===ue?void 0:ue.length)||0}),[ue]),Le=f.DA.EXECUTED===Re||!re&&0===pe&&Me>=1||!re&&pe>=1&&ve>=me,Be=(0,l.useState)(),Ue=Be[0],Fe=Be[1],Ge=(0,l.useState)(),He=Ge[0],ze=Ge[1],Qe=(0,l.useState)(null),Ke=Qe[0],qe=Qe[1],Ye=(0,l.useMemo)((function(){var e,n;return null===(e=new s.Z)||void 0===e||null===(n=e.decodedToken)||void 0===n?void 0:n.token}),[]),We=(0,d.Db)((function(){return T.ZP.block_outputs.pipelines.downloads.detailAsync(null===fe||void 0===fe?void 0:fe.uuid,De,{token:Ye},{onDownloadProgress:function(e){return qe((Number((null===e||void 0===e?void 0:e.loaded)||0)/1e6).toFixed(3))},responseType:D.E.BLOB})}),{onSuccess:function(e){return(0,G.wD)(e,{callback:function(e){(0,U.uS)(e,"".concat(De,".").concat(A.Lu.CSV))},onErrorCallback:function(e,n){return null===je||void 0===je?void 0:je({errors:n,response:e})}})}}),Ve=(0,r.Z)(We,2),Xe=Ve[0],Je=Ve[1].isLoading;(0,l.useEffect)((function(){re||ze(100)}),[re]);var $e=function(e){return Array.isArray(e)?e.join("\n"):e},en=(0,l.useMemo)((function(){return(null===ue||void 0===ue?void 0:ue.length)>=1?ue.reduce((function(e,n){var t=e.at(-1);if(C.jU.includes(null===t||void 0===t?void 0:t.type)&&(null===t||void 0===t?void 0:t.type)===n.type&&!$e(null===n||void 0===n?void 0:n.data).match(R.Lz)){if(Array.isArray(t.data))t.data.concat(n.data);else if("string"===typeof t.data){var o=$e(n.data)||"";t.data=[t.data,o].join("\n")}}else C.jU.includes(null===n||void 0===n?void 0:n.type)&&!$e(null===n||void 0===n?void 0:n.data).match(R.Lz)?e.push(Q(Q({},n),{},{data:$e(n.data)})):e.push(Q({},n));return e}),[]):ce||[]}),[ue,ce]),nn=(0,l.useMemo)((function(){return!(null!==ue&&void 0!==ue&&ue.length)&&(null===ce||void 0===ce?void 0:ce.length)>=1}),[ue,ce]),tn=(0,l.useMemo)((function(){return(0,H.jsx)(Z.Z,{progress:He})}),[He]),on=f.tf.DBT===(null===t||void 0===t?void 0:t.type),rn=(0,S.Z)(ne);(0,l.useEffect)((function(){on&&!rn&&ne&&Ze(L.Rj)}),[ne,rn,on,Ze]);var ln=(0,l.useMemo)((function(){var e=function(e,n){var t=e.columns,o=e.index,i=e.rows,r=e.shape,l=n.borderTop,u=n.selected;return r&&Fe(r),(null===t||void 0===t?void 0:t.some((function(e){return""===e})))?(0,H.jsx)(k.Z,{mx:5,my:3,children:(0,H.jsx)(y.ZP,{monospace:!0,warning:!0,children:"Block output table could not be rendered due to empty string headers. Please check your data\u2019s column headers for empty strings."})}):i.length>=1&&(0,H.jsx)(h.Z,{columns:t,disableScrolling:!u,index:o,maxHeight:60*w.iI,noBorderBottom:!0,noBorderLeft:!0,noBorderRight:!0,noBorderTop:!l,rows:i,width:le-(2+w.cd*w.iI*2+2+N.nn)},"data-table-".concat(o))},n=[],t=[],i=[];return null===en||void 0===en||en.forEach((function(r,l){var u,d,s,f=Array.isArray(r);if(nn&&f?(d={columns:["-"],index:0,rows:null===r||void 0===r?void 0:r.map((function(e){return[(0,F.Pb)(e)?JSON.parse(e):e]})),shape:[null===r||void 0===r?void 0:r.length,1]},s=C.Gi.TABLE):"string"===typeof r?(d=r,s=C.Gi.TEXT_PLAIN):(d=null===r||void 0===r?void 0:r.data,s=null===r||void 0===r?void 0:r.type),f||d&&0!==(null===(u=d)||void 0===u?void 0:u.length)){var p=[];p=(p=Array.isArray(d)?d:[d]).filter((function(e){return e}));var v=[];p.forEach((function(e){if(s===C.Gi.TEXT_HTML)v.push(e);else if(e&&"string"===typeof e){var n=e.split("\n");v.push.apply(v,(0,o.Z)(n))}else"object"===typeof v&&v.push(e)}));var m=v.length,h=[];v.forEach((function(n,o){var r,u,d={contained:J,first:0===l&&0===o,last:l===en.length-1&&o===m-1,normalPadding:se,sideBySideEnabled:ye},f=l>=1;if("string"===typeof n&&n.match(R.Gr)){var p=n.split("\n"),v=[];p.forEach((function(e){if(e.match(R.Gr)){var t=e.split(R.Vc),o=t[t.length-1];(0,F.Pb)(o)&&i.push(JSON.parse(o))}else v.push(e);n=v.length>=1?v.join("\n"):null}))}if(null!==n){if("string"===typeof n&&n.match(R.Lz)){var b=n.split(R.gr),g=b[b.length-1],x=g.split("FloatProgress");if(b.length>=2&&(g=x[0]),(0,F.Pb)(g)){var j=JSON.parse(g),O=j.data,Z=j.type;if(C.Gi.TABLE===Z){!0;var k=e(O,{borderTop:f,selected:be});t.push(k),on||(u=k)}}}else if(s===C.Gi.TABLE){!0;var E=e((0,F.Pb)(n)?JSON.parse(n):n,{borderTop:f,selected:be});t.push(E),on||(u=E)}else if(C.jU.includes(s)){var T,S=null===(T=n)||void 0===T?void 0:T.split("\\n");u=(0,H.jsx)(P.T5,Q(Q({},d),{},{children:S.map((function(e){return(0,H.jsxs)(y.ZP,{monospace:!0,preWrap:!0,children:[(null===e||void 0===e?void 0:e.length)>=1&&(0,H.jsx)(c(),{children:e}),!(null!==e&&void 0!==e&&e.length)&&(0,H.jsx)(H.Fragment,{children:"\xa0"})]},e)}))}))}else if(s===C.Gi.TEXT_HTML)n&&(u=(0,H.jsx)(P.T5,Q(Q({},d),{},{children:(0,H.jsx)(P.wx,{monospace:!0,children:(0,H.jsx)(a.Z,{html:n})})})));else if(s===C.Gi.IMAGE_PNG&&(null===(r=n)||void 0===r?void 0:r.length)>=1)u=(0,H.jsx)("div",{style:{backgroundColor:"white"},children:(0,H.jsx)("img",{alt:"Image ".concat(l," from code output"),src:"data:image/png;base64, ".concat(n)})});else if(s===C.Gi.PROGRESS){var _=parseInt(n);ze(_>90?90:_)}u&&h.push((0,H.jsx)("div",{children:u},"code-output-".concat(l,"-").concat(o)))}})),h.length>=1&&n.push(h)}})),re&&(null===fe||void 0===fe?void 0:fe.type)===O.qL.PYSPARK&&!Ee&&n.unshift([(0,H.jsx)(P.T5,{contained:!0,children:(0,H.jsx)(k.Z,{mt:1,children:tn})},"progress_bar")]),{content:n,tableContent:t,testContent:i}}),[en,J,on,re,le,se,fe,tn,nn,be,Ee]),un=ln.content,cn=ln.tableContent,an=ln.testContent,dn=(null===Ue||void 0===Ue?void 0:Ue[1])||0,sn=dn>30?" (30 out of ".concat(dn," columns displayed)"):"",fn=(0,l.useMemo)((function(){var e;if(on&&ge){var n=ge.uuid;if(L.$m.uuid===n)(null===cn||void 0===cn?void 0:cn.length)>=1?e=cn:re||(e=(0,H.jsx)(k.Z,{px:2,py:1,children:(0,H.jsx)(y.ZP,{muted:!0,children:ne?"Error, check logs.":"No preview to display yet, try running the block."})}));else if(L.Rj.uuid===n)(null===un||void 0===un?void 0:un.length)>=1?e=un:re||(e=(0,H.jsx)(k.Z,{px:2,py:1,children:(0,H.jsx)(y.ZP,{muted:!0,children:ne?"Error, check logs.":"No logs to display yet, try running the block."})}));else if(L.Jt.uuid===n){var t,o=null===u||void 0===u||null===(t=u.dbt)||void 0===t?void 0:t.sql;e=o?(0,H.jsx)(m.Z,{autoHeight:!0,language:A.Lu.SQL,padding:2*w.iI,readOnly:!0,value:o,width:"100%"}):null}else if(L.gM.uuid===n){var i,r=null===u||void 0===u||null===(i=u.dbt)||void 0===i?void 0:i.lineage;e=r?(0,H.jsx)(b.ZP,{disabled:!0,enablePorts:!1,height:55*w.iI,pannable:be,pipeline:Q(Q({},fe),{},{blocks:r}),zoomable:be}):null}}else e=un;return(0,H.jsxs)(H.Fragment,{children:[z,W,!ie&&e]})}),[u,z,W,un,ne,ie,on,re,fe,be,ge,ye,cn]);return z||ne||te||nn||Y?(0,H.jsx)("div",{ref:n,children:(0,H.jsxs)("div",{onClick:ae?function(){return null===ae||void 0===ae?void 0:ae()}:null,style:{paddingTop:ye?M.WC:0},children:[J&&(0,H.jsxs)(P.Nk,Q(Q({},Ne),{},{addBottomPadding:re&&(null===fe||void 0===fe?void 0:fe.type)===O.qL.PYSPARK,blockType:we,dynamicBlock:$,dynamicChildBlock:ee,executedAndIdle:Le,hasError:ne,selected:be,showBorderTop:ke,children:[Y,!V&&(null===an||void 0===an?void 0:an.length)>=1&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(k.Z,{py:2,children:(0,H.jsx)(P.T5,{contained:!0,normalPadding:ye,children:an.map((function(e,n){var t=e.error,o=e.message,i=e.stacktrace;return(0,H.jsxs)(k.Z,{mt:n>=1?3:0,children:[(0,H.jsx)(y.ZP,{monospace:!0,preWrap:!0,children:(0,H.jsx)(c(),{children:"".concat(o).concat(t?" "+t:"")})}),null===i||void 0===i?void 0:i.map((function(e){return(0,H.jsx)(y.ZP,{default:!0,monospace:!0,preWrap:!0,small:!0,children:(0,H.jsx)(c(),{children:e})},e)}))]},o)}))})}),(0,H.jsx)(k.Z,{mb:ye||ne?2:0,children:(0,H.jsx)(g.Z,{medium:!0})})]}),!V&&fn]})),!J&&(0,H.jsxs)(H.Fragment,{children:[Y,fn]}),Le&&!oe&&(0,H.jsxs)(P._A,Q(Q({},Ne),{},{blockType:we,dynamicBlock:$,dynamicChildBlock:ee,hasError:ne,selected:be,children:[(0,H.jsx)(P.MB,{}),(0,H.jsxs)(j.ZP,{justifyContent:"space-between",children:[(0,H.jsxs)(x.Z,{alignItems:"center",px:1,children:[xe&&(0,H.jsx)(p.ZP,Q(Q({},q),{},{onClick:function(){return xe(!V)},children:V?(0,H.jsxs)(j.ZP,{alignItems:"center",children:[(0,H.jsx)(_._M,{muted:!0,size:2*w.iI}),"\xa0",(0,H.jsx)(y.ZP,{default:!0,children:"Expand output"})]}):(0,H.jsxs)(j.ZP,{alignItems:"center",children:[(0,H.jsx)(_.Kh,{muted:!0,size:2*w.iI}),Ue&&(0,H.jsx)(k.Z,{ml:2,children:(0,H.jsx)(y.ZP,{children:"".concat(Ue[0]," rows x ").concat(Ue[1]," columns").concat(sn)})})]})})),!xe&&(0,H.jsx)(j.ZP,{alignItems:"center",children:Ue&&(0,H.jsx)(k.Z,{pl:1,children:(0,H.jsx)(y.ZP,{children:"".concat(Ue[0]," rows x ").concat(Ue[1]," columns").concat(sn)})})})]}),(0,H.jsx)(P.a3,{children:(0,H.jsxs)(j.ZP,{alignItems:"center",fullWidth:!0,justifyContent:"flex-end",children:[(0,H.jsx)(E.Z,Q(Q({},K),{},{label:pe>=1&&me?"Last run at ".concat(new Date(me.valueOf()).toLocaleString()):ne?"Block executed with errors":"Block executed successfully",children:(0,H.jsxs)(j.ZP,{alignItems:"center",children:[pe>=1&&Number(ve)>Number(me)&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(y.ZP,{small:!0,children:[(Number(ve)-Number(me))/1e3,"s"]}),(0,H.jsx)(k.Z,{mr:1})]}),!ne&&(0,H.jsx)(_.Jr,{size:2*w.iI,success:!0}),ne&&(0,H.jsx)(v.Z,{danger:!0,size:2*w.iI,children:(0,H.jsx)(y.ZP,{bold:!0,monospace:!0,small:!0,children:"!"})})]})})),!ne&&!f.Qj.includes(we)&&(0,H.jsx)(k.Z,{pl:2,children:(0,H.jsxs)(j.ZP,{alignItems:"center",children:[(0,H.jsx)(E.Z,Q(Q({},K),{},{label:"Expand table",children:(0,H.jsx)(p.ZP,Q(Q({},q),{},{onClick:function(){(0,U.OF)(null===fe||void 0===fe?void 0:fe.uuid,De),null===de||void 0===de||de(B.cH.DATA),null===Ce||void 0===Ce||Ce((function(e){return e.find((function(e){return e.uuid===De}))?e:(null===Oe||void 0===Oe||Oe(t),e.concat(t))}))},children:(0,H.jsx)(_.M0,{muted:!0,size:1.75*w.iI})}))})),(0,H.jsx)(k.Z,{pl:2}),(0,H.jsx)(E.Z,Q(Q({},K),{},{forceVisible:Je,label:Je?"".concat(Ke||0,"mb downloaded..."):"Save output as CSV file",children:(0,H.jsx)(p.ZP,Q(Q({},q),{},{compact:!0,loading:Je,onClick:function(){qe(null),Xe()},children:(0,H.jsx)(_.vc,{muted:!0,size:1.75*w.iI})}))}))]})})]})})]})]}))]})}):null}n.Z=l.forwardRef(Y)},69632:function(e,n,t){t.d(n,{JX:function(){return c},NJ:function(){return d},au:function(){return u},eQ:function(){return a}});var o=t(38626),i=t(44897),r=t(42631),l=t(70515),u=(l.iI,o.default.div.withConfig({displayName:"indexstyle__HeaderSectionStyle",componentId:"sc-nlaveq-0"})(["",""],(function(e){return"\n background-color: ".concat((e.theme.background||i.Z.background).content,";\n ")}))),c=o.default.div.withConfig({displayName:"indexstyle__StreamSectionStyle",componentId:"sc-nlaveq-1"})(["overflow:hidden;"," ",""],(function(e){return"\n background-color: ".concat((e.theme.background||i.Z.background).content,";\n ")}),(function(e){return!e.noBorderRadius&&"\n border-bottom-left-radius: ".concat(r.n_,"px;\n border-bottom-right-radius: ").concat(r.n_,"px;\n ")})),a=o.default.div.withConfig({displayName:"indexstyle__EmptyCodeSpace",componentId:"sc-nlaveq-2"})(["",""],(function(e){return"\n background-color: ".concat((e.theme.background||i.Z.background).codeTextarea,";\n ")})),d=o.default.div.withConfig({displayName:"indexstyle__CalloutStyle",componentId:"sc-nlaveq-3"})(["border-radius:","px;padding:","px;",""],r.n_,l.cd*l.iI,(function(e){return"\n background-color: ".concat((e.theme.background||i.Z.background).panel,";\n border: 1px solid ").concat((e.theme.borders||i.Z.borders).light,";\n ")}))},41429:function(e,n,t){t.d(n,{$m:function(){return i},C:function(){return v},C4:function(){return g},Jt:function(){return l},Rj:function(){return r},SD:function(){return s},Xy:function(){return c},aL:function(){return d},aj:function(){return b},gM:function(){return u},iz:function(){return p},p:function(){return f},qC:function(){return a},vT:function(){return m},zr:function(){return h}});var o=t(70515),i={uuid:"PREVIEW RESULTS"},r={uuid:"LOGS"},l={uuid:"SQL"},u={uuid:"LINEAGE"},c=function(e){var n,t,o=e.metadata,c=[r,l];return(null===o||void 0===o||null===(n=o.dbt)||void 0===n||null===(t=n.block)||void 0===t?void 0:t.snapshot)||(c.unshift(i),c.push(u)),c},a={uuid:"Jobs"},d={uuid:"Output"},s={uuid:"SQLs"},f={uuid:"Stages & Tasks"},p=function(e){return[d,a,f,s]},v=2.5*o.iI,m="CodeBlock_HiddenBlock",h={label:function(){return"CODE"},uuid:"code"},b={label:function(){return"INTERACTIONS"},uuid:"interactions"},g=[h,b]},9189:function(e,n,t){t.d(n,{z:function(){return xn},Z:function(){return Cn}});var o=t(75582),i=t(82394),r=t(21831),l=t(12691),u=t.n(l),c=t(82684),a=t(38626),d=t(10975),s=t(14567),f=t(69864),p=t(57271),v=t(79757),m=t(71180),h=t(55485),b=t(38276),g=t(30160),x=t(55283),j=t(28598);var C=function(e){var n=e.blocks,t=e.onClick,o=(0,c.useContext)(a.ThemeContext);return(0,j.jsx)(h.ZP,{alignItems:"center",children:null===n||void 0===n?void 0:n.map((function(e){var n=e.color,i=e.type,r=e.uuid,l=(0,x.qn)(i,{blockColor:n,theme:o}).accentLight;return(0,j.jsx)(b.Z,{ml:1,mt:1,children:(0,j.jsx)(m.ZP,{backgroundColor:l,compact:!0,onClick:function(){return t(e)},small:!0,children:(0,j.jsx)(g.ZP,{monospace:!0,small:!0,children:r})})},r)}))})},O=t(97618),Z=t(26084),k=t(85385),y=t(86735);function E(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function T(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?E(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):E(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var S=function(e){var n=e.block,t=e.blocks,i=e.openSidekickView,r=e.pipeline,l=(0,c.useMemo)((function(){return(0,y.HK)(t,(function(e){return e.uuid}))}),[t]),u=(0,c.useMemo)((function(){var e;return null===n||void 0===n||null===(e=n.callback_blocks)||void 0===e?void 0:e.reduce((function(e,n){var t=null===l||void 0===l?void 0:l[n];return t?e.concat(t):e}),[])}),[n,l]),a=(0,c.useMemo)((function(){var e;return null===n||void 0===n||null===(e=n.conditional_blocks)||void 0===e?void 0:e.reduce((function(e,n){var t=null===l||void 0===l?void 0:l[n];return t?e.concat(t):e}),[])}),[n,l]),d=(0,c.useMemo)((function(){var e,t=[];return null===(e=Object.entries((null===r||void 0===r?void 0:r.extensions)||{}))||void 0===e||e.forEach((function(e){var i=(0,o.Z)(e,2),r=i[0],u=i[1].blocks;null===u||void 0===u||u.forEach((function(e){var o=e.upstream_blocks,i=e.uuid;if(null!==o&&void 0!==o&&o.includes(null===n||void 0===n?void 0:n.uuid)){var u=null===l||void 0===l?void 0:l[i];u&&t.push(T(T({},u),{},{extension_uuid:r}))}}))})),t}),[n,l,r]),s=(0,c.useMemo)((function(){return null===a||void 0===a?void 0:a.length}),[a]),f=(0,c.useMemo)((function(){return null===u||void 0===u?void 0:u.length}),[u]),p=(0,c.useMemo)((function(){return null===d||void 0===d?void 0:d.length}),[d]);return s||f||p?(0,j.jsxs)(b.Z,{pb:s>=1||f>=1||p>=1?1:0,children:[s>=1&&(0,j.jsx)(b.Z,{mt:1,children:(0,j.jsxs)(O.Z,{flexDirection:"column",children:[(0,j.jsx)(b.Z,{px:1,children:(0,j.jsx)(g.ZP,{bold:!0,muted:!0,children:"Conditionals"})}),(0,j.jsx)(C,{blocks:a,onClick:function(e){var n=e.uuid;return i(k.cH.ADDON_BLOCKS,!0,{addon:Z.Q.CONDITIONAL,blockUUID:n})}})]})}),f>=1&&(0,j.jsx)(b.Z,{mt:1,children:(0,j.jsxs)(O.Z,{flexDirection:"column",children:[(0,j.jsx)(b.Z,{px:1,children:(0,j.jsx)(g.ZP,{bold:!0,muted:!0,children:"Callbacks"})}),(0,j.jsx)(C,{blocks:u,onClick:function(e){var n=e.uuid;return i(k.cH.ADDON_BLOCKS,!0,{addon:Z.Q.CALLBACK,blockUUID:n})}})]})}),p>=1&&(0,j.jsx)(b.Z,{mt:1,children:(0,j.jsxs)(O.Z,{flexDirection:"column",children:[(0,j.jsx)(b.Z,{px:1,children:(0,j.jsx)(g.ZP,{bold:!0,muted:!0,children:"Extensions"})}),(0,j.jsx)(C,{blocks:d,onClick:function(e){var n=e.extension_uuid,t=e.uuid;return i(k.cH.EXTENSIONS,!0,{blockUUID:t,extension:n})}})]})})]}):null},_=t(81769),P=t(44425),I=t(90299),A=t(70652),R=t(39867),w=t(75810),D=t(12869),N=t(70374),M=t(35058),L=t(85108),B=t(70515),U=t(81728);function F(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function G(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}var H=function(e){var n=e.addWidget,t=e.block,o=e.left,i=e.rightOffset,l=e.onClickCallback,u=e.open,a=e.parentRef,d=e.runBlock,s=e.topOffset,f=(0,c.useMemo)((function(){return M.CK.map((function(e){var o,i,r={configuration:{chart_type:e},language:t.language,type:P.tf.CHART,upstream_blocks:t?[t.uuid]:null},l=L.x8[e],u=(null===l||void 0===l||null===(o=l.configuration)||void 0===o?void 0:o.call(l,r))||{},c=P.t6.SQL===(null===t||void 0===t?void 0:t.language)?null:(null===l||void 0===l||null===(i=l.content)||void 0===i?void 0:i.call(l,r))||null,a=e;return t&&(a="".concat(a," for ").concat(t.uuid)),{label:function(){return(0,U.vg)(e)},onClick:function(){return n(G(G({},r),{},{name:"".concat(a," ").concat((0,U.Mp)()),configuration:G(G({},r.configuration),u),content:c}),{onCreateCallback:function(e){t&&P.t6.SQL!==t.language&&([P.DA.EXECUTED,P.DA.UPDATED].includes(t.status)?null===d||void 0===d||d({block:e,code:c,disableReset:!0}):null===d||void 0===d||d({block:t,runDownstream:!0}))}})},uuid:e}}))}),[M.CK,t,d]),p=(0,c.useMemo)((function(){return L._H.map((function(e){var o=e.label,i=G(G({},(0,e.widgetTemplate)({block:t})),{},{language:t.language,type:P.tf.CHART,upstream_blocks:t?[t.uuid]:null});return{label:o,onClick:function(){return n(i,{onCreateCallback:function(e){t&&P.t6.SQL!==t.language&&([P.DA.EXECUTED,P.DA.UPDATED].includes(t.status)?null===d||void 0===d||d({block:e,code:e.content,disableReset:!0}):null===d||void 0===d||d({block:t,runDownstream:!0}))}})},uuid:o()}}))}),[L._H,n,t,d]),v=[{isGroupingTitle:!0,label:function(){return"Custom charts"},uuid:"custom_charts"}].concat((0,r.Z)(f));return P.t6.SQL!==t.language&&v.push.apply(v,[{isGroupingTitle:!0,label:function(){return"Templates"},uuid:"chart_templates"}].concat((0,r.Z)(p))),(0,j.jsx)(N.Z,{items:v,left:o,onClickCallback:l,open:u,parentRef:a,rightOffset:i,topOffset:s,uuid:"CommandButtons/add_charts",width:25*B.iI})},z=t(50724),Q=t(63403),K=a.default.svg.withConfig({displayName:"Convert__SVGStyle",componentId:"sc-fmw0vr-0"})([""]),q=function(e){var n=e.fill,t=e.opacity,o=e.size,i=void 0===o?Q.C:o,r=e.style,l=e.viewBox,u=void 0===l?"0 0 12 12":l;return(0,j.jsxs)(K,{fill:n,height:i,opacity:t,style:r,viewBox:u,width:i,children:[(0,j.jsx)("path",{clipRule:"evenodd",d:"M2.5 1C1.67157 1 1 1.67157 1 2.5v.0625c0 .27614-.223858.5-.5.5s-.5-.22386-.5-.5V2.5C0 1.11929 1.11929 0 2.5 0h7C10.8807 0 12 1.11929 12 2.5v7c0 1.3807-1.1193 2.5-2.5 2.5h-7C1.11929 12 0 10.8807 0 9.5v-.0625c0-.27614.223858-.5.5-.5s.5.22386.5.5V9.5c0 .8284.67157 1.5 1.5 1.5h7c.8284 0 1.5-.6716 1.5-1.5v-7c0-.82843-.6716-1.5-1.5-1.5h-7z",fill:"url(#paint0_linear_1332_60037)",fillRule:"evenodd"}),(0,j.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.05806 3.55806c.24408-.24408.6398-.24408.88388 0l2 2c.24408.24408.24408.6398 0 .88388l-2 2c-.24408.24408-.6398.24408-.88388 0-.24408-.24408-.24408-.6398 0-.88388l.93306-.93306H1C.654822 6.625.375 6.34518.375 6s.279822-.625.625-.625h5.99112l-.93306-.93306c-.24408-.24408-.24408-.6398 0-.88388z",fill:"#fff"}),(0,j.jsx)("defs",{children:(0,j.jsxs)("linearGradient",{id:"paint0_linear_1332_60037",x1:"-.618557",y1:"-.000001",x2:"10.5709",y2:".83113",gradientUnits:"userSpaceOnUse",children:[(0,j.jsx)("stop",{stopColor:"#FFCC19"}),(0,j.jsx)("stop",{offset:".585938",stopColor:"#2ECDF7"}),(0,j.jsx)("stop",{offset:"1",stopColor:"#9E7BFF"})]})})]})},Y=t(46732),W=t(49130),V=t(7267),X=t(48670),J=t(65956),$=t(4190),ee=t(12468),ne=t(35686),te=t(44897),oe=t(48339),ie=t(72473),re=t(41429),le=t(39643),ue=t(57653),ce=t(61709),ae=t(58325),de=t(72619),se=t(23780);function fe(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function pe(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?fe(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):fe(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ve=function(e){var n=e.addNewBlock,t=e.addWidget,i=e.block,r=e.blockContent,l=e.blocks,u=e.deleteBlock,d=e.executionState,s=e.fetchFileTree,p=e.fetchPipeline,v=e.hideExtraButtons,C=e.interruptKernel,O=e.isEditingBlock,Z=e.openSidekickView,E=e.pipeline,T=e.project,S=e.runBlock,_=e.setBlockContent,I=e.setIsEditingBlock,A=e.savePipelineContent,w=e.setErrors,D=e.setOutputCollapsed,M=e.showConfigureProjectModal,L=(0,se.VI)(null,{},[],{uuid:"CommandButtons/".concat(null===i||void 0===i?void 0:i.uuid)}),U=(0,o.Z)(L,1)[0],F=i.all_upstream_blocks_executed,G=void 0===F||F,Q=i.color,K=i.language,fe=(i.metadata,i.type),ve=i.uuid,me=(0,c.useRef)(null),he=(0,c.useRef)(null),be=(0,c.useRef)(null),ge=(0,c.useRef)(null),xe=(0,c.useRef)(null),je=null===E||void 0===E?void 0:E.type,Ce=(0,c.useState)(!1),Oe=Ce[0],Ze=Ce[1],ke=(0,c.useState)(!1),ye=ke[0],Ee=ke[1],Te=(0,c.useState)(!1),Se=Te[0],_e=Te[1],Pe=(0,c.useState)(!1),Ie=Pe[0],Ae=Pe[1],Re=(0,c.useState)(!1),we=Re[0],De=Re[1],Ne=(0,c.useContext)(a.ThemeContext),Me=oe.uF.IDLE!==d,Le=(0,x.qn)(fe,{blockColor:Q,theme:Ne}).accent,Be=(0,c.useMemo)((function(){return je===ue.qL.STREAMING}),[je]),Ue=(0,c.useMemo)((function(){return je===ue.qL.INTEGRATION}),[je]),Fe=(0,c.useMemo)((function(){return(0,ce.Ts)(i,l,"CommandButtons",n).map((function(e){return pe(pe({},e),{},{onClick:function(){return A().then((function(){return e.onClick()}))}})}))}),[n,i,l,A]),Ge=(0,c.useMemo)((function(){return(0,y.HK)(l,(function(e){return e.uuid}))}),[l]),He=(0,c.useMemo)((function(){return P.tf.DBT===(null===i||void 0===i?void 0:i.type)}),[i]),ze=(0,c.useMemo)((function(){return P.tf.MARKDOWN===(null===i||void 0===i?void 0:i.type)}),[i]),Qe=(0,f.Db)(ne.ZP.pipelines.useUpdate(null===E||void 0===E?void 0:E.uuid),{onSuccess:function(e){return(0,de.wD)(e,{callback:function(){p()},onErrorCallback:function(e,n){return w({errors:n,response:e})}})}}),Ke=(0,o.Z)(Qe,2),qe=Ke[0],Ye=Ke[1].isLoading,We=(0,f.Db)(ne.ZP.llms.useCreate(),{onSuccess:function(e){return(0,de.wD)(e,{callback:function(e){var n=e.llm;null!==n&&void 0!==n&&n.response&&_&&(null===_||void 0===_||_(null===n||void 0===n?void 0:n.response))},onErrorCallback:function(e,n){return U({errors:n,response:e})}})}}),Ve=(0,o.Z)(We,2),Xe=Ve[0],Je=(Ve[1].isLoading,(0,c.useMemo)((function(){var e=!(null!==T&&void 0!==T&&T.openai_api_key),n=function(e){null===M||void 0===M||M({header:(0,j.jsx)(b.Z,{mb:B.HN,children:(0,j.jsxs)(J.Z,{children:[(0,j.jsx)(g.ZP,{warning:!0,children:"You need to add an OpenAI API key to your project before you can generate blocks using AI."}),(0,j.jsx)(b.Z,{mt:1,children:(0,j.jsxs)(g.ZP,{warning:!0,children:["Read ",(0,j.jsx)(X.Z,{href:"https://help.openai.com/en/articles/4936850-where-do-i-find-my-secret-api-key",openNewWindow:!0,children:"OpenAI\u2019s documentation"})," to get your API key."]})})]})}),onSaveSuccess:function(n){null!==n&&void 0!==n&&n.openai_api_key&&qe({pipeline:{llm:e}})}})},t={request:{block_uuid:null===i||void 0===i?void 0:i.uuid,pipeline_uuid:null===E||void 0===E?void 0:E.uuid}};return[{label:function(){return"Document block (beta)"},onClick:function(){t.use_case=V.z.GENERATE_DOC_FOR_BLOCK,e?n(t):qe({pipeline:{llm:t}})},uuid:"Document block"},{label:function(){return"Document pipeline and all blocks (beta)"},onClick:function(){t.use_case=V.z.GENERATE_DOC_FOR_PIPELINE,e?n(t):qe({pipeline:{llm:t}})},uuid:"Document pipeline and all blocks"},{label:function(){return"Add comments in code (beta)"},onClick:function(){e?n(t):Xe({llm:{request:{block_code:r},use_case:V.z.GENERATE_COMMENT_FOR_CODE}})},uuid:"Add comments in code"}]}),[i,r,Xe,E,T,M,qe]));return(0,j.jsxs)(h.ZP,{alignItems:"center",children:[oe.uF.QUEUED===d&&(0,j.jsx)($.Z,{color:(Ne||te.Z).content.active,type:"cylon"}),oe.uF.BUSY===d&&(0,j.jsx)($.Z,{color:(Ne||te.Z).content.active}),S&&!Me&&!Be&&(0,j.jsxs)(j.Fragment,{children:[!He&&(0,j.jsx)(ee.Z,{appearBefore:!0,default:!0,label:(0,j.jsxs)(g.ZP,{children:["Run block \xa0 \xa0",(0,j.jsx)(W.Z,{inline:!0,keyTextGroups:[[(0,ae.V5)()?le.RJ:le.hE,le.Lz]],monospace:!0,uuidForKey:ve})]}),size:3*B.iI,widthFitContent:!0,children:(0,j.jsx)(m.ZP,{noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){G?S({block:i}):_e(!0)},children:(0,j.jsx)(R.Z,{color:Le,size:3*B.iI,children:(0,j.jsx)(ie.Py,{black:!0,size:1.5*B.iI})})})}),He&&(0,j.jsx)(m.ZP,{backgroundColor:Le,beforeIcon:(0,j.jsx)(ie.Py,{size:1.5*B.iI}),compact:!0,onClick:function(){G?S({block:i}):_e(!0)},small:!0,children:K===P.t6.YAML?"Run command":"Compile & preview"}),(0,j.jsx)(z.Z,{disableEscape:!0,onClickOutside:function(){return _e(!1)},open:Se,children:(0,j.jsx)(N.Z,{items:[{label:function(){return"Execute block"},onClick:function(){return S({block:i})},uuid:"execute_block"},{label:function(){return"Execute with upstream blocks"},onClick:function(){return S({block:i,runUpstream:!0})},uuid:"execute_upstream"}],onClickCallback:function(){return _e(!1)},open:Se,parentRef:be,rightOffset:13.25*B.iI,topOffset:4.5*B.iI,uuid:"execute_actions",width:25*B.iI})})]}),Me&&(0,j.jsx)(b.Z,{ml:B.cd,children:(0,j.jsx)(ee.Z,{appearBefore:!0,default:!0,label:(0,j.jsxs)(g.ZP,{children:["Interrupt kernel \xa0 \xa0",(0,j.jsx)(W.Z,{inline:!0,keyTextGroups:[[le.kA],[le.kA]],monospace:!0,uuidForKey:ve})]}),size:re.C,widthFitContent:!0,children:(0,j.jsx)(m.ZP,{noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){return C()},children:(0,j.jsx)(R.Z,{borderSize:1.5,size:re.C,children:(0,j.jsx)(ie.x8,{size:1*B.iI})})})})}),!v&&P.tf.SCRATCHPAD===i.type&&!Be&&(0,j.jsx)(b.Z,{ml:B.cd,children:(0,j.jsx)(Y.Z,{items:Fe,onClickCallback:function(){return Ee(!1)},onClickOutside:function(){return Ee(!1)},open:ye,parentRef:he,rightOffset:0,topOffset:4,uuid:"CommandButtons/convert_block",children:(0,j.jsx)(ee.Z,{appearBefore:!0,default:!0,label:(0,j.jsx)(g.ZP,{children:"Convert block"}),size:re.C,widthFitContent:!0,children:(0,j.jsx)(m.ZP,{noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){return Ee(!ye)},ref:he,children:(0,j.jsx)(q,{size:re.C})})})})}),!v&&[P.tf.DATA_LOADER,P.tf.TRANSFORMER].includes(i.type)&&!Be&&!Ue&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(b.Z,{ml:B.cd,ref:me,children:(0,j.jsx)(ee.Z,{appearBefore:!0,default:!0,label:"Add chart",size:2.25*B.iI,widthFitContent:!0,children:(0,j.jsx)(m.ZP,{noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){return Ze((function(e){return!e}))},children:(0,j.jsx)(ie.GQ,{size:2.25*B.iI})})})}),t&&(0,j.jsx)(z.Z,{disableEscape:!0,onClickOutside:function(){return Ze(!1)},open:Oe,children:(0,j.jsx)(H,{addWidget:t,block:i,onClickCallback:function(){return Ze(!1)},open:Oe,parentRef:me,rightOffset:9*B.iI,runBlock:S,topOffset:2*B.iI})})]}),!v&&ze&&(0,j.jsx)(b.Z,{ml:B.cd,children:(0,j.jsx)(ee.Z,{appearBefore:!0,default:!0,label:O?"Close editor":"Edit",size:re.C,widthFitContent:!0,children:(0,j.jsx)(m.ZP,{noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){return I((function(e){return!e}))},children:O?(0,j.jsx)(ie.Jr,{size:re.C,success:!0}):(0,j.jsx)(ie.I8,{size:re.C})})})}),!v&&P.tf.GLOBAL_DATA_PRODUCT!==(null===i||void 0===i?void 0:i.type)&&(0,j.jsx)("div",{ref:xe,children:(0,j.jsxs)(b.Z,{ml:B.cd,children:[Ye&&(0,j.jsx)($.Z,{inverted:!0,small:!0}),!Ye&&(0,j.jsx)(ee.Z,{appearBefore:!0,default:!0,label:(0,j.jsx)(g.ZP,{children:"AI actions"}),size:re.C,widthFitContent:!0,children:(0,j.jsx)(m.ZP,{noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){return De((function(e){return!e}))},children:(0,j.jsx)(ie.xq,{default:!0,size:re.C})})})]})}),!v&&(0,j.jsx)(z.Z,{disableEscape:!0,onClickOutside:function(){return De(!1)},open:we,children:(0,j.jsx)(N.Z,{items:Je,onClickCallback:function(){return De(!1)},open:we,parentRef:xe,rightOffset:4.75*B.iI,topOffset:2*B.iI,uuid:"FileHeaderMenu/AI_actions"})}),!v&&(0,j.jsx)(b.Z,{ml:B.cd,children:(0,j.jsx)(ee.Z,{appearBefore:!0,default:!0,label:"View and edit settings for this block",size:re.C,widthFitContent:!0,children:(0,j.jsx)(m.ZP,{noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){return null===Z||void 0===Z?void 0:Z(k.cH.BLOCK_SETTINGS)},children:(0,j.jsx)(ie.JG,{default:!0,size:re.C})})})}),!v&&(0,j.jsx)("div",{ref:ge,children:(0,j.jsx)(b.Z,{ml:B.cd,children:(0,j.jsx)(ee.Z,{appearBefore:!0,default:!0,label:(0,j.jsx)(g.ZP,{children:"More actions"}),size:re.C,widthFitContent:!0,children:(0,j.jsx)(m.ZP,{noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){return Ae((function(e){return!e}))},children:(0,j.jsx)(R.Z,{borderSize:1.5,default:!0,size:re.C,children:(0,j.jsx)(ie.mH,{default:!0,size:B.iI})})})})})}),!v&&(0,j.jsx)(z.Z,{disableEscape:!0,onClickOutside:function(){return Ae(!1)},open:Ie,children:(0,j.jsx)(N.Z,{items:(0,ce.J8)(i,S,u,D,Be||Ue,{addNewBlock:n,blocksMapping:Ge,fetchFileTree:s,fetchPipeline:p,openSidekickView:Z,project:T,savePipelineContent:A,updatePipeline:qe}),onClickCallback:function(){return Ae(!1)},open:Ie,parentRef:ge,rightOffset:4.75*B.iI,topOffset:2*B.iI,uuid:"FileHeaderMenu/file_items"})})]})},me=t(15338),he=t(85854),be=t(99236),ge=t(75499),xe=t(69632),je=t(37443),Ce=t(61599),Oe=t(53405);function Ze(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function ke(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ze(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ze(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ye,Ee=function(e){var n=e.block,t=e.blockContent,o=e.blocksMapping,i=(e.children,e.codeEditor),r=e.callbackEl,l=e.hasElementsBelow,u=e.onChangeBlock,a=(e.openSidekickView,e.setContent),d=e.showDataIntegrationModal,s=(n.catalog,n.language),f=n.metadata,p=n.type,v=n.upstream_blocks,C=n.uuid,Z=((null===f||void 0===f?void 0:f.data_integration)||{}).name,k=(0,c.useMemo)((function(){return(0,Oe.Uc)(n,{getAll:!0})}),[n]),E=(0,c.useMemo)((function(){return null===k||void 0===k?void 0:k.filter(Oe.Z5)}),[k]),T=(0,c.useMemo)((function(){return(null===k||void 0===k?void 0:k.length)||0}),[k]),S=(0,c.useMemo)((function(){return(null===E||void 0===E?void 0:E.length)||0}),[E]),_=P.tf.DATA_LOADER===p,I=_?"source":"destination",A=(0,c.useMemo)((function(){var e=[1,1,1,null],o=[{uuid:"Stream"},{center:!0,uuid:"Columns"},{center:!0,uuid:"Sync method"},{uuid:"Parallel"}];return _||(e=(0,y.Hk)(1,1,e),o=(0,y.Hk)({uuid:"Table name"},1,o)),(0,j.jsx)(ge.Z,{columnFlex:e,columns:o,rows:null===E||void 0===E?void 0:E.map((function(e){var o,i,r,l=e||{},c=l.bookmark_properties,f=l.destination_table,p=l.replication_method,v=l.run_in_parallel,m=(l.tap_stream_id,(0,Oe.M$)(e)),x=(0,Oe.Qu)(e),C=(0,Oe.WD)(e),O=(0,Oe.JN)(e),Z=O.allColumns,k=O.selectedColumns,E=(null===(o=Object.keys(Z||[]))||void 0===o?void 0:o.length)||0,T=(null===(i=Object.keys(k||[]))||void 0===i?void 0:i.length)||0,S=P.t6.YAML===s&&!T,I=(0,j.jsxs)(X.Z,{danger:S,monospace:!0,onClick:function(){return d({block:ke(ke({},n),{},{content:t}),defaultMainNavigationTab:m,defaultMainNavigationTabSub:x,defaultSubTab:S?je.tw.SETTINGS:je.tw.OVERVIEW,onChangeBlock:u,setContent:a})},preventDefault:!0,sameColorAsText:!S,children:[m," ",S&&(0,j.jsx)(g.ZP,{inline:!0,default:!0,monospace:!0,children:"will fail if no columns selected"})]},"".concat(C,"-stream"));r=T>=1||P.t6.PYTHON===s?(0,j.jsxs)(g.ZP,{center:!0,default:!0,monospace:!0,children:[T," ",(0,j.jsx)(g.ZP,{inline:!0,monospace:!0,muted:!0,children:"/"})," ",E]}):(0,j.jsx)(g.ZP,{center:!0,danger:!0,children:"No columns selected"});var A=[I,(0,j.jsx)(X.Z,{danger:S,monospace:!0,onClick:function(){return d({block:ke(ke({},n),{},{content:t}),defaultMainNavigationTab:m,defaultMainNavigationTabSub:x,defaultSubTab:je.tw.SETTINGS,onChangeBlock:u,setContent:a})},preventDefault:!0,sameColorAsText:!S,children:r},"".concat(C,"-columns")),(0,j.jsxs)(h.ZP,{alignItems:"center",justifyContent:"center",children:[(0,j.jsx)(g.ZP,{center:!0,default:!0,children:p&&(0,U.vg)(p)}),Ce._B.INCREMENTAL===p&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(b.Z,{mr:1}),!(null!==c&&void 0!==c&&c.length)&&(0,j.jsx)(g.ZP,{danger:!0,xsmall:!0,children:"No bookmark properties set"}),(null===c||void 0===c?void 0:c.length)>=1&&(null===c||void 0===c?void 0:c.map((function(e,n){return(0,j.jsxs)(g.ZP,{inline:!0,monospace:!0,muted:!0,xsmall:!0,children:[n>=1&&", ",e]},e)})))]})]},"".concat(C,"-replicationMethod")),(0,j.jsx)(h.ZP,{justifyContent:"flex-end",children:v?(0,j.jsx)(ie.Jr,{size:2*B.iI,success:!0}):(0,j.jsx)(g.ZP,{monospace:!0,muted:!0,children:"-"})},"".concat(C,"-runInParallel"))];return _||(A=(0,y.Hk)((0,j.jsx)(g.ZP,{default:!0,monospace:!0,children:f||m},"".concat(C,"-tableName")),1,A)),A}))})}),[n,t,s,_,a,d,E]),R=(0,c.useMemo)((function(){var e,t;return(0,Oe.Wi)(null===n||void 0===n||null===(e=n.upstream_blocks)||void 0===e?void 0:e.map((function(e){return null===o||void 0===o?void 0:o[e]})),null===n||void 0===n||null===(t=n.configuration)||void 0===t?void 0:t.data_integration)}),[n,o]);return(0,j.jsxs)(j.Fragment,{children:[P.t6.YAML===s&&(0,j.jsxs)(xe.au,{children:[(0,j.jsx)(b.Z,{p:B.cd,children:(0,j.jsxs)(h.ZP,{alignItems:"flex-start",justifyContent:"space-between",children:[(0,j.jsxs)(O.Z,{flex:1,flexDirection:"column",children:[(0,j.jsx)(g.ZP,{bold:!0,monospace:!0,muted:!0,small:!0,uppercase:!0,children:I}),(0,j.jsx)(he.Z,{default:!0,children:Z})]}),(0,j.jsxs)(m.ZP,{compact:!0,onClick:function(){return d({block:ke(ke({},n),{},{content:t}),defaultMainNavigationTab:je.uK.CONFIGURATION,onChangeBlock:u,setContent:a})},secondary:!0,children:["Configure ",I]})]})}),(0,j.jsx)(me.Z,{light:!0}),(null===R||void 0===R?void 0:R.length)>=1&&(0,j.jsx)(be.Z,{inputsBlocks:R})]}),P.t6.PYTHON===s&&(0,j.jsxs)(xe.au,{children:[(0,j.jsx)(b.Z,{p:B.cd,children:(0,j.jsxs)(h.ZP,{alignItems:"flex-start",justifyContent:"space-between",children:[(0,j.jsxs)(O.Z,{flex:1,flexDirection:"column",children:[(0,j.jsx)(g.ZP,{bold:!0,monospace:!0,muted:!0,small:!0,uppercase:!0,children:I}),(0,j.jsx)(he.Z,{default:!0,children:Z})]}),(0,j.jsxs)(m.ZP,{compact:!0,onClick:function(){return d({block:ke(ke({},n),{},{content:t}),defaultMainNavigationTab:je.uK.CONFIGURATION,onChangeBlock:u,setContent:a})},secondary:!0,children:["Configure ",I]})]})}),(0,j.jsx)(me.Z,{light:!0}),(null===v||void 0===v?void 0:v.length)>=1&&(0,j.jsx)(b.Z,{p:B.cd,children:(0,j.jsxs)(h.ZP,{alignItems:"flex-start",justifyContent:"space-between",children:[(0,j.jsxs)(O.Z,{flex:4,flexDirection:"column",children:[(0,j.jsx)(g.ZP,{bold:!0,monospace:!0,muted:!0,small:!0,uppercase:!0,children:"Inputs"}),(0,j.jsxs)(b.Z,{mt:1,children:[(null===R||void 0===R?void 0:R.length)>=1&&(0,j.jsx)(g.ZP,{default:!0,children:"The output of these upstream blocks are used as positional arguments for decorated functions."}),!(null!==R&&void 0!==R&&R.length)&&(0,j.jsxs)(g.ZP,{default:!0,children:["There are currently no positional arguments for decorated functions.",(0,j.jsx)("br",{}),"To use the output of 1 or more upstream blocks as positional arguments for decorated functions, add and configure 1 or more inputs."]})]})]}),(0,j.jsx)(b.Z,{mr:B.cd}),(0,j.jsx)(O.Z,{flex:1,justifyContent:"flex-end",children:(0,j.jsx)(m.ZP,{compact:!0,onClick:function(){return d({block:ke(ke({},n),{},{content:t}),defaultMainNavigationTab:je.uK.CONFIGURATION,defaultSubTab:je.tw.UPSTREAM_BLOCK_SETTINGS,onChangeBlock:u,setContent:a})},secondary:!0,children:(null===R||void 0===R?void 0:R.length)>=1?"Configure inputs":"Add inputs"})})]})}),(null===R||void 0===R?void 0:R.length)>=1&&(0,j.jsx)(be.Z,{inputsBlocks:R})]}),(0,j.jsxs)(xe.JX,{noBorderRadius:l,children:[(0,j.jsx)(b.Z,{p:B.cd,children:(0,j.jsxs)(h.ZP,{alignItems:"center",justifyContent:"space-between",children:[S>=1&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(O.Z,{flex:1,flexDirection:"column",children:(0,j.jsxs)(g.ZP,{bold:!0,default:!0,large:!0,children:[S," ",(0,j.jsx)(g.ZP,{bold:!0,inline:!0,monospace:!0,muted:!0,children:"/"})," ",T," ",(0,U._6)("stream",T,!1,!0)," selected"]})}),(0,j.jsx)(b.Z,{mr:1})]}),(0,j.jsxs)(m.ZP,{beforeIcon:!S&&(0,j.jsx)(ie.Zr,{size:2*B.iI}),compact:S>=1,onClick:function(){return d({block:ke(ke({},n),{},{content:t}),defaultMainNavigationTab:je.uK.STREAMS,onChangeBlock:u,setContent:a})},primary:!S,secondary:S>=1,children:[S>=1&&"Edit streams",!S&&"Set up streams"]})]})}),S>=1&&A,S>=1&&(0,j.jsx)(b.Z,{mb:B.cd})]}),P.t6.PYTHON===s&&(0,j.jsxs)(j.Fragment,{children:[S>=1&&(0,j.jsx)(xe.au,{children:(0,j.jsx)(b.Z,{pb:B.cd,px:B.cd,children:(0,j.jsx)(xe.NJ,{children:(0,j.jsxs)(h.ZP,{alignItems:"center",children:[(0,j.jsx)(O.Z,{children:(0,j.jsx)(ie.uy,{size:2*B.iI,warning:!0})}),(0,j.jsx)(b.Z,{mr:B.cd}),(0,j.jsxs)(g.ZP,{muted:!0,children:["The decorated function ",(0,j.jsx)(g.ZP,{inline:!0,monospace:!0,default:!0,children:"@selected_streams"})," and ",(0,j.jsx)(g.ZP,{inline:!0,monospace:!0,default:!0,children:"@catalog"})," will override any stream settings configured for ",(0,j.jsx)(g.ZP,{bold:!0,color:(0,x.qn)(null===n||void 0===n?void 0:n.type,{blockColor:null===n||void 0===n?void 0:n.color}).accent,inline:!0,monospace:!0,children:C}),"."]})]})})})}),(0,j.jsx)(xe.eQ,{children:(0,j.jsx)(b.Z,{pb:B.cd})}),i,r]})]})};!function(e){e.APPEND="append",e.FAIL="fail",e.REPLACE="replace"}(ye||(ye={}));var Te,Se=[ye.APPEND,ye.FAIL,ye.REPLACE];function _e(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function Pe(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?_e(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):_e(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function Ie(e,n){var t,i=e.block,r=e.blocks,l=e.onClick,u=e.onDrop,f=i.type,p=(0,d.c)((function(){return{collect:function(e){return{isDragging:!!e.isDragging()}},item:i,type:re.vT}}),[i]),m=(0,o.Z)(p,3),C=m[0],Z=m[1],k=(m[2],(0,s.L)((function(){return{accept:re.vT,drop:function(e){return null===u||void 0===u?void 0:u(i,e)}}}),[i])),y=(0,o.Z)(k,2)[1],E=(0,c.useContext)(a.ThemeContext),T=(0,x.qn)(f,{blockColor:i.color,theme:E}).accent,S=(0,Oe.cU)([i],r)[0],_=S.dynamic,I=S.dynamicUpstreamBlock,A=S.reduceOutput,w=S.reduceOutputUpstreamBlock,D=(0,c.useMemo)((function(){return(0,ce._o)({block:i,dynamic:_,dynamicUpstreamBlock:I,reduceOutput:A,reduceOutputUpstreamBlock:w})}),[i,_,I,A,w]).borderColorShareProps,N=(0,c.useMemo)((function(){return P.tf.DBT===(null===i||void 0===i?void 0:i.type)}),[i]);return(0,j.jsx)(b.Z,{pb:1,ref:y,children:(0,j.jsx)(x.PY,Pe(Pe({},Pe(Pe({},D),C)),{},{ref:Z,children:(0,j.jsx)(X.Z,{noHoverUnderline:!0,noOutline:!0,onClick:function(){return l()},preventDefault:!0,ref:n,children:(0,j.jsx)(b.Z,{p:1,children:(0,j.jsxs)(h.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,j.jsxs)(O.Z,{alignItems:"center",flex:1,children:[(0,j.jsxs)(h.ZP,{alignItems:"center",children:[(0,j.jsx)(v.Z,{monospace:!0,children:P.dO[i.language]}),(0,j.jsx)(b.Z,{mr:1}),(0,j.jsx)(R.Z,{color:T,size:1.5*B.iI,square:!0}),(0,j.jsx)(b.Z,{mr:1}),(0,j.jsx)(g.ZP,{color:T,monospace:!0,children:null===(t=N?P.tf.DBT:P.V4[i.type])||void 0===t?void 0:t.toUpperCase()})]}),(0,j.jsx)(b.Z,{mr:B.cd}),(0,j.jsx)(ie.iU,{size:1.5*B.iI}),(0,j.jsx)(b.Z,{mr:1}),(0,j.jsx)(g.ZP,{monospace:!0,muted:!0,children:null===i||void 0===i?void 0:i.uuid})]}),(0,j.jsx)(ee.Z,{appearAbove:!0,appearBefore:!0,block:!0,label:"Show ".concat(null===i||void 0===i?void 0:i.uuid," block"),size:2*B.iI,widthFitContent:!0,children:(0,j.jsx)(ie.Db,{muted:!0,size:2*B.iI})})]})})})}))})}!function(e){e.BIGQUERY="bigquery",e.CLICKHOUSE="clickhouse",e.DRUID="druid",e.MYSQL="mysql",e.POSTGRES="postgres",e.REDSHIFT="redshift",e.SNOWFLAKE="snowflake",e.TRINO="trino"}(Te||(Te={}));var Ae=c.forwardRef(Ie),Re=t(56747),we=t(82359),De=t(44085),Ne=t(74521);var Me=function(e){var n,t=e.executionStates,o=(e.isInProgress,(null===t||void 0===t||null===(n=t[0])||void 0===n?void 0:n.spark)||{jobs:null,sqls:null,stages:null}),i=o.jobs,r=(o.sqls,o.stages),l=(0,c.useMemo)((function(){return(r||[]).reduce((function(e,n){var t=null===n||void 0===n?void 0:n.application;return(null===t||void 0===t?void 0:t.calculated_id)in e||(e[null===t||void 0===t?void 0:t.calculated_id]={}),e[null===t||void 0===t?void 0:t.calculated_id][null===n||void 0===n?void 0:n.stage_id]=n,e}),{})}),[r]),u=(0,c.useMemo)((function(){return(0,j.jsx)(Ne.Z,{disableStageExpansion:!0,jobs:i,stagesMapping:l})}),[i,l]);return(0,j.jsx)(j.Fragment,{children:u})},Le=B.iI/2,Be=a.default.div.withConfig({displayName:"indexstyle__ProgressDotsStyle",componentId:"sc-5dfsks-0"})(["border-top-width:","px;border-top-style:dotted;height:","px;",""],Le,Le,(function(e){return"\n border-top-color: ".concat(e.success?(e.theme||te.Z).accent.positive:(e.theme||te.Z).content.muted,";\n width: ").concat(e.progress,"%;\n ")})),Ue=t(88422);var Fe=function(e){var n,t=e.children,o=e.executionStates,i=e.isInProgress,r=(null===o||void 0===o||null===(n=o[0])||void 0===n?void 0:n.spark)||{jobs:null,sqls:null,stages:null},l=r.jobs,u=(r.sqls,r.stages),a=(0,c.useMemo)((function(){var e=0,n=0,t=0,o=0;null===l||void 0===l||l.forEach((function(t){t.num_completed_stages;var o=t.status;e+=Ue.CN.SUCCEEDED===o?1:0,n+=1}));var i=0,r=0;return null===u||void 0===u||u.forEach((function(e){var n=e.num_complete_tasks,l=e.num_tasks,u=e.status;Ue.Dd.SKIPPED!==u&&(t+=Ue.Dd.COMPLETE===u?1:0,o+=1,i+=n||0,r+=l||0)})),{jobsCountCompleted:e,jobsCount:n,stagesCount:o,stagesCountCompleted:t,tasksCount:r,tasksCountCompleted:i}}),[l,u]),d=a.jobsCountCompleted,s=a.jobsCount,f=a.stagesCount,p=a.stagesCountCompleted,v=a.tasksCount,m=a.tasksCountCompleted,x=(0,c.useMemo)((function(){return s?Math.min(i?90:1,d/s):0}),[i,s,d]),C=(0,c.useMemo)((function(){return f?Math.min(x<1?90:1,p/f):0}),[x,f,p]),O=(0,c.useMemo)((function(){return v?Math.min(x<1?90:1,m/v):0}),[x,v,m]);return i||s?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(b.Z,{p:B.cd,children:[(0,j.jsx)(b.Z,{mb:1,children:(0,j.jsxs)(h.ZP,{alignContent:"center",justifyContent:"space-between",children:[(0,j.jsx)(g.ZP,{default:!0,monospace:!0,small:!0,children:"Jobs"}),(0,j.jsx)(b.Z,{mr:B.cd}),(0,j.jsxs)(g.ZP,{default:!0,monospace:!0,small:!0,children:[d," / ",s," (",Math.round(100*x),"%)"]})]})}),(0,j.jsxs)(h.ZP,{children:[(0,j.jsx)(Be,{progress:100*x,success:!0}),x>0&&x<1&&(0,j.jsx)("div",{style:{width:B.iI/2}}),(0,j.jsx)(Be,{progress:100*(1-x)})]})]}),(0,j.jsxs)(b.Z,{px:B.cd,pb:B.cd,children:[(0,j.jsx)(b.Z,{mb:1,children:(0,j.jsxs)(h.ZP,{alignContent:"center",justifyContent:"space-between",children:[(0,j.jsx)(g.ZP,{default:!0,monospace:!0,small:!0,children:"Stages"}),(0,j.jsx)(b.Z,{mr:B.cd}),(0,j.jsxs)(g.ZP,{default:!0,monospace:!0,small:!0,children:[p," / ",f," (",Math.round(100*C),"%)"]})]})}),(0,j.jsxs)(h.ZP,{children:[(0,j.jsx)(Be,{progress:100*C,success:!0}),C>0&&C<1&&(0,j.jsx)("div",{style:{width:B.iI/2}}),(0,j.jsx)(Be,{progress:100*(1-C)})]})]}),(0,j.jsxs)(b.Z,{px:B.cd,pb:B.cd,children:[(0,j.jsx)(b.Z,{mb:1,children:(0,j.jsxs)(h.ZP,{alignContent:"center",justifyContent:"space-between",children:[(0,j.jsx)(g.ZP,{default:!0,monospace:!0,small:!0,children:"Tasks"}),(0,j.jsx)(b.Z,{mr:B.cd}),(0,j.jsxs)(g.ZP,{default:!0,monospace:!0,small:!0,children:[m," / ",v," (",Math.round(100*O),"%)"]})]})}),(0,j.jsxs)(h.ZP,{children:[(0,j.jsx)(Be,{progress:100*O,success:!0}),O>0&&O<1&&(0,j.jsx)("div",{style:{width:B.iI/2}}),(0,j.jsx)(Be,{progress:100*(1-O)})]})]}),t]}):null},Ge=t(93004);var He=function(e){var n,t=e.disableGraph,o=e.executionStates,i=(e.isInProgress,e.overrideScrollForGraph),r=((null===o||void 0===o||null===(n=o[0])||void 0===n?void 0:n.spark)||{sqls:[]}).sqls,l=(0,c.useMemo)((function(){return(0,j.jsx)(Ge.Z,{disableGraph:t,disableJobExpansion:!0,overrideScrollForGraph:i,showSparkGraph:!0,sqls:r})}),[t,r]);return(0,j.jsx)(j.Fragment,{children:l})},ze=t(71417);var Qe=function(e){var n,t=e.executionStates,o=(e.isInProgress,((null===t||void 0===t||null===(n=t[0])||void 0===n?void 0:n.spark)||{stages:null}).stages),i=(0,c.useMemo)((function(){return(0,j.jsx)(ze.Z,{stages:o,tasksContained:!0})}),[o]);return(0,j.jsx)(j.Fragment,{children:i})},Ke=t(17488),qe=t(3314);function Ye(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function We(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ye(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ye(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.blockConfiguration,o=e.blockRefs,r=e.blocks,l=e.updateBlockConfiguration,u=(0,c.useContext)(a.ThemeContext),d=P.t6.R===(null===n||void 0===n?void 0:n.language),s=P.t6.SQL===(null===n||void 0===n?void 0:n.language),f=null===r||void 0===r?void 0:r.find((function(e){var n=e.language;return P.t6.PYTHON===n})),p=(0,c.useMemo)((function(){var e=[null];return s&&f?e.push.apply(e,[null,1]):e.push(1),e}),[f,s]),v=(0,c.useMemo)((function(){var e=[{tooltipMessage:null,uuid:"Variable"},{tooltipMessage:null,uuid:"Block"}];return s&&f&&e.push({tooltipMessage:"Customize the full table name that this block gets created in. Include database, schema, and table name where applicable.",uuid:"Table name"}),e}),[f,s]),m=(0,c.useMemo)((function(){return null===r||void 0===r?void 0:r.map((function(e,n){var r,c=e.color,a=e.language,p=e.type,v=e.uuid,m=(0,x.qn)(p,{blockColor:c,theme:u}).accent,h=P.t6.PYTHON===a;r=s?"{{ df_".concat(n+1," }}"):d?"df".concat(n+1):"data".concat(n>=1?"_".concat(n+1):null);var b=[(0,j.jsx)(g.ZP,{default:!0,monospace:!0,small:!0,children:r},"variable-".concat(v)),(0,j.jsx)(X.Z,{color:m,onClick:function(){var e,n,t=null===o||void 0===o||null===(e=o.current)||void 0===e?void 0:e["".concat(p,"s/").concat(v,".py")];null===t||void 0===t||null===(n=t.current)||void 0===n||n.scrollIntoView()},preventDefault:!0,small:!0,children:(0,j.jsx)(g.ZP,{color:m,monospace:!0,small:!0,children:v})},"block-".concat(v))];if(s){var C="table-name-input-".concat(v),O=(null===t||void 0===t?void 0:t[M.Yf])||{},Z=(null===O||void 0===O?void 0:O[v])||{};h?b.push((0,j.jsx)(Ke.Z,{borderless:!0,compact:!0,monospace:!0,onChange:function(e){var n=e.target.value;l((0,i.Z)({},M.Yf,We(We({},O),{},(0,i.Z)({},v,We(We({},Z),{},(0,i.Z)({},M.aZ,n))))))},onClick:qe.j,placeholder:"[database_optional].[schema_optional].[table]",small:!0,value:(null===Z||void 0===Z?void 0:Z[M.aZ])||""},C)):f&&b.push((0,j.jsx)(g.ZP,{italic:!0,muted:!0,small:!0,children:"Table name is defined in upstream block."},C))}return b}))}),[f,t,o,r,d,s,u,l]);return(0,j.jsx)(j.Fragment,{children:(0,j.jsx)(ge.Z,{columnFlex:p,columns:v,compact:!0,noBorder:!0,rows:m,uuid:"CodeBlock/UpstreamBlockSettings/".concat(null===n||void 0===n?void 0:n.uuid)})})},Xe=t(84820),Je=t(98464),$e=t(77417),en=t(98777),nn=t(88494),tn=t(84438),on=t(92709),rn=t(47041),ln=t(89678),un=t(38399),cn=t(74052),an=t(22286),dn=t(37529),sn=t(53808),fn=t(44375),pn=t(42041),vn=t(15752),mn=t(42122),hn=t(44688);function bn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function gn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?bn(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):bn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var xn=1e3;function jn(e,n){var t,l=e.addNewBlock,C=e.addNewBlockMenuOpenIdx,Z=e.addWidget,E=e.allBlocks,T=e.allowCodeBlockShortcuts,N=e.autocompleteItems,L=e.block,F=e.blockIdx,G=e.blockInteractions,H=e.blockOutputRef,z=e.blockRefs,Q=e.blockTemplates,K=e.blocks,q=void 0===K?[]:K,W=e.children,V=e.containerRef,J=e.cursorHeight1,te=e.cursorHeight2,ae=e.cursorHeight3,se=e.dataProviders,fe=e.defaultValue,pe=void 0===fe?"":fe,he=e.deleteBlock,be=e.disableDrag,ge=e.disableShortcuts,xe=e.executionState,je=e.extraContent,Ce=e.fetchFileTree,Ze=e.fetchPipeline,ke=e.globalDataProducts,_e=e.height,Pe=e.hideExtraCommandButtons,Ie=e.hideExtraConfiguration,Ne=e.hideHeaderInteractiveInformation,Le=e.hideRunButton,Be=e.interactionsMapping,Ue=e.interruptKernel,Ge=e.isHidden,ze=e.mainContainerRect,Ye=e.mainContainerRef,We=e.mainContainerWidth,bn=e.messages,jn=void 0===bn?[]:bn,Cn=e.noDivider,On=e.onCallbackChange,Zn=e.onChange,kn=e.onClickAddSingleDBTModel,yn=e.onDrop,En=e.openSidekickView,Tn=e.pipeline,Sn=e.project,_n=e.runBlock,Pn=e.runningBlocks,In=e.savePipelineContent,An=e.scrollTogether,Rn=e.selected,wn=e.setAddNewBlockMenuOpenIdx,Dn=e.setAnyInputFocused,Nn=e.setCreatingNewDBTModel,Mn=e.setEditingBlock,Ln=e.setErrors,Bn=e.setHiddenBlocks,Un=(e.setMountedBlocks,e.setOutputBlocks),Fn=e.setSelected,Gn=e.setSelectedBlock,Hn=e.setSelectedOutputBlock,zn=e.setTextareaFocused,Qn=e.showBrowseTemplates,Kn=e.showConfigureProjectModal,qn=e.showDataIntegrationModal,Yn=e.showGlobalDataProducts,Wn=e.showUpdateBlockModal,Vn=e.sideBySideEnabled,Xn=e.textareaFocused,Jn=e.widgets,$n=e.windowWidth,et=(0,c.useContext)(a.ThemeContext),nt=(0,c.useRef)(null),tt=(0,c.useRef)(null),ot=(0,c.useRef)(null),it=(0,c.useRef)(null),rt=(0,$e.Z)(),lt=(rt.featureEnabled,rt.featureUUIDs,rt.sparkEnabled),ut=(0,c.useState)(!1),ct=ut[0],at=ut[1],dt=(0,c.useState)(0),st=dt[0],ft=dt[1],pt=(0,c.useState)(!1),vt=pt[0],mt=pt[1],ht=(0,c.useCallback)((function(){var e=new CustomEvent(on.$e,{detail:{blockIndex:F}});window.dispatchEvent(e)}),[F]),bt=(0,c.useCallback)((function(){var e=new CustomEvent(on.tK,{detail:{blockIndex:F}});window.dispatchEvent(e)}),[F]),gt=(0,c.useCallback)((function(e){Bn&&(null===Bn||void 0===Bn||Bn(e),clearTimeout(it.current),it.current=setTimeout((function(){bt(),ht()}),en.e+1))}),[ht,bt,Bn]);(0,c.useEffect)((function(){var e=function(e){var n,t=null===ot||void 0===ot||null===(n=ot.current)||void 0===n?void 0:n.getBoundingClientRect();t&&(null===e||void 0===e?void 0:e.clientX)>=(null===t||void 0===t?void 0:t.x)&&(null===e||void 0===e?void 0:e.clientX)<=(null===t||void 0===t?void 0:t.x)+(null===t||void 0===t?void 0:t.width)&&(null===e||void 0===e?void 0:e.clientY)>=(null===t||void 0===t?void 0:t.y)&&(null===e||void 0===e?void 0:e.clientY)<=(null===t||void 0===t?void 0:t.y)+(null===t||void 0===t?void 0:t.height)&&(clearTimeout(it.current),it.current=setTimeout(bt,en.e+1))};return ct&&window.addEventListener("click",e),function(){window.removeEventListener("click",e)}}),[bt,ct]),(0,c.useEffect)((function(){vt&&Vn&&ht()}),[vt,An,Vn]);var xt=(0,c.useMemo)((function(){var e;return!(null===Sn||void 0===Sn||null===(e=Sn.features)||void 0===e||!e[we.d.INTERACTIONS])}),[null===Sn||void 0===Sn?void 0:Sn.features]),jt=(0,c.useCallback)((function(e){var n,t,o,i,l=e.columnScrolling,u=e.refCursor,c=e.refCursorContainer,a=e.refsMappings,d=null===q||void 0===q?void 0:q.map((function(e){var n=(0,cn.zv)(e);return Math.max.apply(Math,(0,r.Z)(a.map((function(e){var t,o,i,r=null===e||void 0===e||null===(t=e.current)||void 0===t?void 0:t[n];return(null===r||void 0===r||null===(o=r.current)||void 0===o||null===(i=o.getBoundingClientRect())||void 0===i?void 0:i.height)||0}))))})),s=(0,y.Sm)(d||[]),f=null===c||void 0===c||null===(n=c.current)||void 0===n?void 0:n.getBoundingClientRect(),p=null===u||void 0===u||null===(t=u.current)||void 0===t||null===(o=t.getBoundingClientRect)||void 0===o?void 0:o.call(t),v=(null===f||void 0===f?void 0:f.y)+(null===p||void 0===p?void 0:p.height),m=100*((0===(null===p||void 0===p?void 0:p.height)?0:(null===p||void 0===p?void 0:p.y)+(null===p||void 0===p?void 0:p.height))-v)/((null===f||void 0===f?void 0:f.height)-(null===p||void 0===p?void 0:p.height))/100,h=(0,ce.IT)(d,s,null===ze||void 0===ze?void 0:ze.height)||0,b=(null===f||void 0===f?void 0:f.y)-Math.max(0,m*(1-h))*s+(0,y.Sm)((null===(i=d||[])||void 0===i?void 0:i.slice(0,F))||[]);if(An)null!==nt&&void 0!==nt&&nt.current&&(nt.current.style.top="".concat(b,"px")),null!==tt&&void 0!==tt&&tt.current&&(tt.current.style.top="".concat(b,"px"));else{var g=0===l?nt:tt;null!==g&&void 0!==g&&g.current&&(g.current.style.top="".concat(b,"px"))}}),[F,ze,nt,tt,An]);(0,c.useEffect)((function(){var e=function(e){var n=e.detail;jt(n)};return Vn&&window.addEventListener(on.m$,e),function(){window.removeEventListener(on.m$,e)}}),[jt,Vn]);var Ct=L||{},Ot=Ct.callback_content,Zt=Ct.configuration,kt=void 0===Zt?{}:Zt,yt=Ct.color,Et=Ct.error,Tt=Ct.has_callback,St=Ct.language,_t=Ct.name,Pt=Ct.pipelines,It=Ct.replicated_block,At=Ct.type,Rt=Ct.upstream_blocks,wt=void 0===Rt?[]:Rt,Dt=Ct.uuid,Nt=(0,c.useMemo)((function(){return kt}),[kt]),Mt=(0,c.useMemo)((function(){var e;return(null===(e=Object.values(Pt||{}))||void 0===e?void 0:e.length)||1}),[Pt]),Lt=(0,c.useMemo)((function(){return null===Nt||void 0===Nt?void 0:Nt.global_data_product}),[Nt]),Bt=(0,c.useMemo)((function(){return(0,y.HK)(ke||[],(function(e){return e.uuid}))}),[ke]),Ut=(0,c.useState)(!1),Ft=Ut[0],Gt=Ut[1],Ht=(0,c.useState)(null),zt=Ht[0],Qt=Ht[1],Kt=(0,c.useState)(!1),qt=Kt[0],Yt=Kt[1],Wt=(0,c.useState)(!1),Vt=Wt[0],Xt=Wt[1],Jt=(0,c.useState)(pe),$t=Jt[0],eo=Jt[1],no=(0,c.useState)(null),to=no[0],oo=no[1],io=(0,c.useState)(re.C4[0].uuid),ro=io[0],lo=io[1],uo=(0,c.useState)(null),co=uo[0],ao=uo[1],so=Tn||{},fo=so.type,po=so.uuid,vo=(0,c.useMemo)((function(){return ue.qL.STREAMING===fo}),[fo]),mo=P.tf.DBT===At,ho=P.t6.SQL===St,bo=P.t6.R===St,go=P.tf.MARKDOWN===At,xo=(0,c.useMemo)((function(){return(0,Oe.jO)(L,Tn)}),[L,Tn]),jo=Nt[M.mW];ho&&void 0===jo&&(jo=xn);var Co=(0,c.useState)(gn(gn({},Nt),{},(t={},(0,i.Z)(t,M.cH,Nt[M.cH]),(0,i.Z)(t,M.Sv,Nt[M.Sv]),(0,i.Z)(t,M.sc,Nt[M.sc]),(0,i.Z)(t,M.BD,Nt[M.BD]),(0,i.Z)(t,M.m$,Nt[M.m$]),(0,i.Z)(t,M.Pi,Nt[M.Pi]||{}),(0,i.Z)(t,M.Mv,Nt[M.Mv]),(0,i.Z)(t,M.eW,Nt[M.eW]),(0,i.Z)(t,M.nq,Nt[M.nq]||ye.APPEND),(0,i.Z)(t,M.mW,jo),(0,i.Z)(t,M.bk,Nt[M.bk]),(0,i.Z)(t,M.Mi,!!Nt[M.Mi]),t))),Oo=Co[0],Zo=Co[1],ko=(0,c.useState)(null),yo=ko[0],Eo=ko[1],To=(0,c.useState)(go),So=To[0],_o=To[1],Po=(0,c.useState)(!1),Io=Po[0],Ao=Po[1],Ro=(0,c.useState)(0),wo=Ro[0],Do=Ro[1],No=(0,c.useState)(null),Mo=No[0],Lo=No[1],Bo=(0,c.useState)(null),Uo=Bo[0],Fo=Bo[1],Go=(0,c.useState)(jn),Ho=Go[0],zo=Go[1],Qo=(0,c.useState)(null),Ko=Qo[0],qo=Qo[1],Yo=(0,c.useCallback)((function(e){bt(),null===Fn||void 0===Fn||Fn(!!e),qo(e)}),[bt,Fn,qo]);(0,c.useEffect)((function(){Ko||(ct?Yo((0,re.iz)(L)[0]):mo&&Yo((0,re.Xy)(L)[0]))}),[L,mo,Ko,Yo,ct]);var Wo=(0,c.useCallback)((function(e){_o(e),setTimeout((function(){return ht()}),1)}),[ht,_o]),Vo=(0,d.c)((function(){return{collect:function(e){return{isDragging:!!e.isDragging()}},item:L,type:re.vT}}),[L]),Xo=(0,o.Z)(Vo,2),Jo=Xo[0],$o=Xo[1],ei=(0,s.L)((function(){return{accept:re.vT,drop:function(e){return null===yn||void 0===yn?void 0:yn(L,e)}}}),[L]),ni=(0,o.Z)(ei,2)[1],ti=(0,c.useMemo)((function(){var e;return(null===L||void 0===L||null===(e=L.metadata)||void 0===e?void 0:e.dbt)||{project:null,projects:{}}}),[L]),oi=(0,c.useMemo)((function(){return ti.projects||{}}),[ti]),ii=(0,c.useMemo)((function(){return ti.project||Oo[M.eW]}),[Oo,ti]),ri=(0,c.useMemo)((function(){return oi[ii]||{target:null,targets:[]}}),[ii,oi]),li=(0,c.useMemo)((function(){return ri.targets||[]}),[ri]),ui=(0,c.useMemo)((function(){return Oo[M.Mv]}),[Oo]),ci=ii?null!==ri&&void 0!==ri&&ri.target?(0,y.sE)(li,(function(e){return e===ri.target})):"Select target":"Select project first",ai=(0,c.useState)(ui&&!(null!==li&&void 0!==li&&li.includes(ui))),di=ai[0],si=ai[1],fi=(0,c.useState)(null),pi=fi[0],vi=fi[1];(0,c.useEffect)((function(){Ot!==pi&&vi(Ot)}),[pi,Ot]);var mi=(0,Je.Z)(L);(0,c.useEffect)((function(){if(JSON.stringify(L)!=JSON.stringify(mi)){var e,n=(0,cn.Rt)([L]).messages,t=null===n||void 0===n||null===(e=n[At])||void 0===e?void 0:e[Dt];(null===t||void 0===t?void 0:t.length)>=1&&zo(t)}}),[L,At,Dt,mi,zo]);var hi=(0,Je.Z)(jn);(0,c.useEffect)((function(){"undefined"!==typeof jn&&jn.length!==(null===hi||void 0===hi?void 0:hi.length)&&zo(jn)}),[jn,hi,zo]);var bi=(0,c.useMemo)((function(){var e=new Set;return null===se||void 0===se||se.forEach((function(n){var t=n.profiles;e=new Set([].concat((0,r.Z)(e),(0,r.Z)(t)))})),(0,r.Z)(e)}),[se]),gi=(0,c.useMemo)((function(){return"".concat(po,"/").concat(Dt,"/codeCollapsed")}),[po,Dt]),xi=(0,c.useMemo)((function(){return"".concat(po,"/").concat(Dt,"/outputCollapsed")}),[po,Dt]);(0,c.useEffect)((function(){Xt((0,sn.U2)(gi,!1)),Ao((0,sn.U2)(xi,!1))}),[gi,xi]);var ji=(0,c.useRef)(null),Ci=(0,c.useMemo)((function(){return(0,y.HK)(q,(function(e){return e.uuid}))}),[q]),Oi=(0,c.useMemo)((function(){return!(null===Jn||void 0===Jn||!Jn.find((function(e){return e.upstream_blocks.includes(Dt)})))}),[Dt,Jn]),Zi=(0,c.useCallback)((function(e){var n=e.bypassOffScreen,t=e.columnIndex,o=e.rect,i=e.y;if(n||(null===o||void 0===o?void 0:o.y)>=(null===ze||void 0===ze?void 0:ze.y)+(null===ze||void 0===ze?void 0:ze.height)||(null===o||void 0===o?void 0:o.y)<=(null===ze||void 0===ze?void 0:ze.y)){var r=new CustomEvent(on.Wf,{detail:{blockIndex:F,columnIndex:t,lockScroll:!0,y:i}});window.dispatchEvent(r)}}),[F,ze]),ki=!(null===Pn||void 0===Pn||!Pn.find((function(e){return e.uuid===Dt})))||(null===Ho||void 0===Ho?void 0:Ho.length)>=1&&xe!==oe.uF.IDLE;(0,c.useEffect)((function(){at(lt&&!vo&&!xo&&P.t6.PYTHON===St&&(ue.qL.PYSPARK===(null===Tn||void 0===Tn?void 0:Tn.type)||!(null!==Sn&&void 0!==Sn&&Sn.emr_config)))}),[St,xo,vo,Tn,Sn,lt]);var yi=ne.ZP.execution_states.list({block_uuid:"undefined"!==typeof Dt?Dt:null,pipeline_uuid:"undefined"!==typeof po?po:null},{refreshInterval:Rn&&ki?1e3:5e3,revalidateOnFocus:!0},{pauseFetch:!Rn&&st>=1||!ct}),Ei=yi.data,Ti=yi.mutate,Si=(0,c.useCallback)((function(e){var n,t,i;Vn&&Zi(gn({columnIndex:An?2:1,bypassOffScreen:An},(null===e||void 0===e?void 0:e.syncColumnPositions)||{rect:null===tt||void 0===tt||null===(n=tt.current)||void 0===n?void 0:n.getBoundingClientRect(),y:null===nt||void 0===nt||null===(t=nt.current)||void 0===t||null===(i=t.getBoundingClientRect())||void 0===i?void 0:i.y}));var r=e||{},l=r.block,u=r.code,c=r.disableReset,a=r.runDownstream,d=r.runIncompleteUpstream,s=r.runSettings,f=r.runUpstream,p=r.runTests,v=r.variables,m=p;if(null===m||"undefined"===typeof m){var h=(l||{}).type;m=[P.tf.DATA_LOADER,P.tf.DATA_EXPORTER,P.tf.TRANSFORMER].includes(h)}mo&&re.Rj!==Ko&&Yo(re.Rj);var b=gn({},v||co);(null===G||void 0===G?void 0:G.length)>=1&&(null===G||void 0===G||G.forEach((function(e){var n=e.uuid,t=null===Be||void 0===Be?void 0:Be[n];Object.entries((null===t||void 0===t?void 0:t.variables)||{}).forEach((function(e){var n=(0,o.Z)(e,2),t=n[0],i=n[1].types;b&&t in b&&(b[t]=(0,an.M)(b[t],i))}))}))),null===_n||void 0===_n||_n({block:l,code:u||$t,runDownstream:a||Oi,runIncompleteUpstream:d||!1,runSettings:s,runTests:m||!1,runUpstream:f||!1,variables:b}),c||(Do(1+Number(wo)),Lo(null),Ao(!1)),ct&&Ti()}),[G,$t,Ti,Oi,Be,mo,nt,tt,_n,wo,An,Ko,Do,Lo,Yo,Vn,ct,co]),_i=(0,c.useState)(null),Pi=_i[0],Ii=_i[1];(0,c.useEffect)((function(){Ei&&(ft((function(e){return e+1})),Ii((null===Ei||void 0===Ei?void 0:Ei.execution_states)||[]))}),[Ei,Ii,ft]),(0,c.useEffect)((function(){null!==Pi&&(clearTimeout(it.current),it.current=setTimeout(bt,1))}),[Pi,bt,Ko]),(0,c.useEffect)((function(){ki&&Fo(Number(new Date))}),[ki,Fo]);var Ai=(0,Je.Z)(xe);(0,c.useEffect)((function(){xe===oe.uF.IDLE&&xe!==Ai&&Lo(Number(new Date))}),[xe,Ai,Lo]);var Ri=(0,c.useCallback)((function(e){var n=e.editorRect.top,t=e.position.lineNumberTop;if(null!==Ye&&void 0!==Ye&&Ye.current){var o=Ye.current.getBoundingClientRect().height;if(n+t>o){var i=Ye.current.scrollTop+(t-o+n);Ye.current.scrollTo(0,i)}else if(t+n<ln.aU){var r=Ye.current.scrollTop+(t+n-ln.aU);Ye.current.scrollTo(0,r)}}}),[Ye]),wi=(0,c.useMemo)((function(){return(0,ce.h5)(Ho,yo)}),[yo,Ho]),Di=(0,ce.oI)(wi),Ni=Di.hasError,Mi=Di.hasOutput,Li=(0,c.useMemo)((function(){return Mi||(null===Ho||void 0===Ho?void 0:Ho.length)>=1}),[Mi,Ho]),Bi=(0,x.qn)(At,{blockColor:yt,theme:et}).accent,Ui=(null===wt||void 0===wt?void 0:wt.length)||0,Fi=(0,Oe.cU)([L],q)[0],Gi=Fi.dynamic,Hi=Fi.dynamicUpstreamBlock,zi=Fi.reduceOutput,Qi=Fi.reduceOutputUpstreamBlock,Ki=(0,c.useMemo)((function(){return(0,ce._o)({block:L,dynamic:Gi,dynamicUpstreamBlock:Hi,hasError:Ni,reduceOutput:zi,reduceOutputUpstreamBlock:Qi,selected:Rn})}),[L,Gi,Hi,Ni,zi,Qi,Rn]),qi=Ki.borderColorShareProps,Yi=Ki.tags,Wi=(0,c.useCallback)((function(){Rn||(null===Dn||void 0===Dn||Dn(!1),null===Fn||void 0===Fn||Fn(!0))}),[Rn,Dn,Fn]),Vi=ne.ZP.blocks.pipelines.detail(po,re.gM.uuid===(null===Ko||void 0===Ko?void 0:Ko.uuid)||re.Jt.uuid===(null===Ko||void 0===Ko?void 0:Ko.uuid)?encodeURIComponent(Dt):null,{_format:"dbt"},{revalidateOnFocus:!0}),Xi=Vi.data,Ji=Vi.mutate,$i=(0,c.useMemo)((function(){var e;return(null===Xi||void 0===Xi||null===(e=Xi.block)||void 0===e?void 0:e.metadata)||{}}),[Xi]),er=(0,f.Db)(ne.ZP.blocks.pipelines.useUpdate(po,Dt),{onError:function(e){var n=(0,de.qQ)(e).messages;Eo(n)},onSuccess:function(e){return(0,de.wD)(e,{callback:function(e){Ze(),Ce(),eo($t),null!==e&&void 0!==e&&e.block&&Gn(null===e||void 0===e?void 0:e.block)},onErrorCallback:function(e,n){return Ln({errors:n,response:e})}})}}),nr=(0,o.Z)(er,1)[0],tr="CodeBlock/".concat(Dt),or=(0,hn.y)(),ir=or.registerOnKeyDown,rr=or.unregisterOnKeyDown;(0,c.useEffect)((function(){return function(){rr(tr)}}),[rr,tr]),ir(tr,(function(e,n){ge&&!T||Rn&&!Le&&((0,pn.y)([le.zX,le.Uq],n)||(0,pn.y)([le.PQ,le.Uq],n)?Si({block:L}):(0,pn.y)([le.XR,le.Uq],n)&&l&&(e.preventDefault(),l({language:St,type:At,upstream_blocks:[Dt]}),Si({block:L})))}),[l,L,Le,Si,Rn,nr]),(0,c.useEffect)((function(){var e;return Uo&&(e=setInterval((function(){return oo(Number(new Date))}),1e3)),to&&!ki&&clearInterval(e),function(){return clearInterval(e)}}),[to,ki,Uo]);var lr=(0,c.useCallback)((function(e){var n,t=(n={},(0,i.Z)(n,P.tf.CUSTOM,Object.values(P.Lq).reduce((function(n,t){return(null===e||void 0===e?void 0:e.color)!==t&&n.push({label:function(){return(0,j.jsx)(O.Z,{alignItems:"center",children:(0,j.jsxs)(g.ZP,{noWrapping:!0,children:["Change color to ",(0,j.jsx)(g.ZP,{color:(0,x.qn)(P.tf.CUSTOM,{blockColor:t}).accent,inline:!0,children:t})]})})},onClick:function(){nr({block:gn(gn({},e),{},{color:t})})},uuid:t}),n}),[])),(0,i.Z)(n,P.tf.SCRATCHPAD,(0,r.Z)((0,ce.Ts)(e,q,"block_menu/scratchpad",l)).map((function(e){return gn(gn({},e),{},{onClick:function(){return In().then((function(){return e.onClick()}))}})}))),n);return t[e.type]}),[l,q,In,nr]),ur=(0,c.useMemo)((function(){return It&&(null===Ci||void 0===Ci?void 0:Ci[It])}),[Ci,It]),cr=(0,c.useMemo)((function(){return!Vt&&![P.tf.CALLBACK,P.tf.CONDITIONAL,P.tf.EXTENSION].includes(At)&&(0,j.jsx)(S,{block:L,blocks:E,openSidekickView:En,pipeline:Tn})}),[E,L,At,Vt,En,Tn]),ar=(0,c.useMemo)((function(){if(It&&!xo)return null;if(P.tf.GLOBAL_DATA_PRODUCT===At){var e=null===Bt||void 0===Bt?void 0:Bt[null===Lt||void 0===Lt?void 0:Lt.uuid];return(0,j.jsxs)(x.y9,{children:[(0,j.jsxs)(b.Z,{mb:B.cd,mt:1,children:[(0,j.jsx)(g.ZP,{monospace:!0,muted:!0,small:!0,children:"UUID"}),(0,j.jsx)(g.ZP,{monospace:!0,children:null===e||void 0===e?void 0:e.uuid})]}),(0,j.jsxs)(b.Z,{mb:B.cd,children:[(0,j.jsx)(g.ZP,{monospace:!0,muted:!0,small:!0,children:(0,U.kC)((null===e||void 0===e?void 0:e.object_type)||"")}),(0,j.jsx)(u(),{as:"/pipelines/".concat(null===e||void 0===e?void 0:e.object_uuid,"/edit"),href:"/pipelines/[pipeline]/edit",passHref:!0,children:(0,j.jsx)(X.Z,{monospace:!0,openNewWindow:!0,children:null===e||void 0===e?void 0:e.object_uuid})})]}),(0,j.jsxs)(b.Z,{mb:1,children:[(0,j.jsx)(g.ZP,{monospace:!0,muted:!0,small:!0,children:"Override global data product settings"}),(0,j.jsx)(X.Z,{monospace:!0,onClick:function(){return En(k.cH.BLOCK_SETTINGS)},children:"Customize block settings"})]})]})}var n,t;return xo&&P.t6.PYTHON!==St||(n=(0,j.jsx)(w.Z,{autoHeight:!0,autocompleteProviders:zt,block:L,height:_e,language:St,onChange:function(e){eo(e),null===Zn||void 0===Zn||Zn(e)},onContentSizeChangeCallback:Vn?function(){return ht()}:null,onDidChangeCursorPosition:Ri,onMountCallback:Vn?function(){mt(!0)}:null,placeholder:P.tf.DBT===At&&P.t6.YAML===St?"e.g. --select ".concat(ii||"project","/models --exclude ").concat(ii||"project","/models/some_dir"):"Start typing here...",selected:Rn,setSelected:Fn,setTextareaFocused:zn,shortcuts:Le?[]:[function(e,n){return(0,dn.Q)(e,(function(){Le||Si({block:L,code:n.getValue()})}))}],textareaFocused:Xn,value:$t,width:"100%"}),t=Tt&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(me.Z,{}),(0,j.jsxs)(b.Z,{mt:1,children:[(0,j.jsxs)(x.y9,{normalPadding:!0,children:[(0,j.jsx)(g.ZP,{small:!0,children:"Callback block: define @on_success or @on_failure callbacks for this block."}),(0,j.jsxs)(g.ZP,{monospace:!0,muted:!0,small:!0,children:["kwargs",(0,j.jsx)(g.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:" \u2192 "}),"global variables"]})]}),(0,j.jsx)(w.Z,{autoHeight:!0,autocompleteProviders:zt,language:"python",onChange:function(e){vi(e),null===On||void 0===On||On(e)},onDidChangeCursorPosition:Ri,placeholder:"Start typing here...",selected:Rn,setSelected:Fn,setTextareaFocused:zn,textareaFocused:Xn,value:pi,width:"100%"})]})]})),xo?(0,j.jsx)(Ee,{block:L,blocksMapping:Ci,blockContent:$t,callbackEl:t,codeEditor:n,hasElementsBelow:(null===Ho||void 0===Ho?void 0:Ho.length)>=1||!!cr,onChangeBlock:function(e){return nr({block:e})},openSidekickView:En,savePipelineContent:In,setContent:eo,showDataIntegrationModal:qn}):(0,j.jsxs)(j.Fragment,{children:[n,t]})}),[zt,L,cr,St,At,Ci,pi,$t,ii,Lt,Bt,Tt,_e,Le,xo,Ho,On,Zn,Ri,En,It,Si,Rn,eo,mt,Fn,zn,Vn,Xn]);(0,c.useEffect)((function(){N&&Qt({python:(0,Xe.Z)({autocompleteItems:N,block:L,blocks:q,pipeline:Tn})})}),[N,L,q,Tn]);var dr=(0,c.useMemo)((function(){var e;return mo?e=(0,j.jsx)(I.Z,{onClickTab:function(e){Yo(e),re.gM.uuid!==e.uuid&&re.Jt.uuid!==e.uuid||Ji()},selectedTabUUID:null===Ko||void 0===Ko?void 0:Ko.uuid,tabs:(0,re.Xy)(L),underlineColor:(0,x.qn)(P.tf.DBT,{theme:et}).accent,underlineStyle:!0}):ct&&![P.tf.CALLBACK,P.tf.CONDITIONAL,P.tf.EXTENSION].includes(At)&&(e=(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(I.Z,{onClickTab:function(e){Yo(e)},selectedTabUUID:null===Ko||void 0===Ko?void 0:Ko.uuid,tabs:(0,re.iz)(L),underlineColor:Bi,underlineStyle:!0}),(0,j.jsx)(me.Z,{medium:!0})]})),e?(0,j.jsx)(x.HS,{children:e}):null}),[L,At,Bi,Ji,mo,Ko,ct,et]),sr=(0,c.useMemo)((function(){if(ki&&to&&to>Uo){var e=(0,j.jsxs)(g.ZP,{muted:!0,children:["".concat(Math.round((to-Uo)/1e3)),"s"]});return xo&&P.t6.PYTHON!==St?(0,j.jsx)(nn.Nk,{children:(0,j.jsx)(b.Z,{p:1,children:e})}):(0,j.jsx)(x.HC,{children:e})}return null}),[St,to,xo,ki,Uo]),fr=(0,c.useMemo)((function(){var e,n,t;oe.uF.QUEUED===xe&&(e=(0,j.jsx)($.Z,{color:null===et||void 0===et||null===(n=et.content)||void 0===n?void 0:n.active,type:"cylon"}));oe.uF.BUSY===xe&&(e=(0,j.jsx)($.Z,{color:null===et||void 0===et||null===(t=et.content)||void 0===t?void 0:t.active}));var o,r=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{childrenBelowTabs:null,hideOutput:!1},t=n.childrenBelowTabs,o=n.hideOutput;return(0,j.jsx)(D.Z,gn(gn({},qi),{},{block:L,blockIndex:F,blockMetadata:$i,buttonTabs:ct?null:dr,childrenBelowTabs:t,collapsed:Io,hasOutput:Li,hideOutput:o,isInProgress:ki,mainContainerWidth:We,messages:wi,messagesAll:Ho,onClickSelectBlock:Vn?Ge&>?function(){return gt((function(e){return gn(gn({},e),{},(0,i.Z)({},Dt,!Ge))}))}:Wi:null,openSidekickView:En,outputRowNormalPadding:Vn||xo||ct,pipeline:Tn,ref:H,runCount:wo,runEndTime:Mo,runStartTime:Uo,scrollTogether:An,selected:Rn&&(!Ge||!Vn),selectedTab:Ko,setCollapsed:Vn?null:function(e){Ao((function(){return(0,sn.t8)(xi,e),e}))},setErrors:Ln,setOutputBlocks:Un,setSelectedOutputBlock:Hn,setSelectedTab:Yo,showBorderTop:Vn,sideBySideEnabled:Vn,sparkEnabled:ct,children:Vn&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(b.Z,{px:B.cd,py:1,children:(0,j.jsxs)(h.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,j.jsx)(X.Z,{color:Bi,monospace:!0,onClick:function(){var e,n,t;Zi({bypassOffScreen:!0,columnIndex:0,rect:null===nt||void 0===nt||null===(e=nt.current)||void 0===e?void 0:e.getBoundingClientRect(),y:null===tt||void 0===tt||null===(n=tt.current)||void 0===n||null===(t=n.getBoundingClientRect())||void 0===t?void 0:t.y})},preventDefault:!0,children:null===L||void 0===L?void 0:L.uuid}),(0,j.jsx)(b.Z,{mr:B.cd}),e,!e&&(0,j.jsx)(m.ZP,{noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){var e,n,t;return Si({block:L,syncColumnPositions:{rect:null===nt||void 0===nt||null===(e=nt.current)||void 0===e?void 0:e.getBoundingClientRect(),y:null===tt||void 0===tt||null===(n=tt.current)||void 0===n||null===(t=n.getBoundingClientRect())||void 0===t?void 0:t.y}})},children:(0,j.jsx)(R.Z,{color:Bi,size:3*B.iI,children:(0,j.jsx)(ie.Py,{black:!0,size:1.5*B.iI})})})]})}),Li&&(0,j.jsx)(me.Z,{medium:!0})]})}))},l=re.aL.uuid===(null===Ko||void 0===Ko?void 0:Ko.uuid);return ct&&![P.tf.CALLBACK,P.tf.CONDITIONAL,P.tf.EXTENSION].includes(null===L||void 0===L?void 0:L.type)?(l?o=(0,j.jsx)(Fe,{executionStates:Pi,isInProgress:ki}):re.qC.uuid===(null===Ko||void 0===Ko?void 0:Ko.uuid)?o=(0,j.jsx)(Me,{executionStates:Pi,isInProgress:ki}):re.p.uuid===(null===Ko||void 0===Ko?void 0:Ko.uuid)?o=(0,j.jsx)(Qe,{executionStates:Pi}):re.SD.uuid===(null===Ko||void 0===Ko?void 0:Ko.uuid)&&(o=(0,j.jsx)(He,{disableGraph:!Rn,executionStates:Pi,overrideScrollForGraph:Rn})),Vn?r({childrenBelowTabs:!Ge&&(0,j.jsxs)(j.Fragment,{children:[dr,(0,j.jsx)(me.Z,{medium:!0}),(0,j.jsx)("div",{ref:ot,children:o})]}),hideOutput:!l||Ge}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(x.jv,gn(gn({},qi),{},{className:Rn&&Xn?"selected":null,hideBorderBottom:l&&Li,lightBackground:!0,noPadding:!0,children:[dr,(0,j.jsx)(me.Z,{light:!0}),o]})),l&&r()]})):r()}),[L,Pi,F,$i,H,qi,dr,Bi,Zi,xe,Li,xo,So,Ge,ki,go,We,Ho,wi,Wi,En,Io,xi,Tn,nt,tt,Si,wo,Mo,Uo,An,Rn,Ko,Ln,gt,Un,Ao,Hn,Vn,ct,Xn]),pr=(0,c.useCallback)((function(){return Yt(!1)}),[]),vr=(0,c.useRef)(null),mr=(0,c.useCallback)((function(e){clearTimeout(vr.current),Zo((function(n){return gn(gn({},n),e)})),vr.current=setTimeout((function(){var n=gn(gn({},Oo),e);("undefined"!==typeof n[M.cH]&&"undefined"!==n[M.sc]||"undefined"!==typeof n[M.Mv]||"undefined"!==typeof n[M.eW]||"undefined"!==typeof n[M.mW])&&In({block:{configuration:n,uuid:Dt}})}),1e3)}),[Dt,Oo,In]),hr=tn.zJ.BIGQUERY===Oo[M.cH]||tn.zJ.SNOWFLAKE===Oo[M.cH],br=(0,c.useMemo)((function(){return(null===q||void 0===q?void 0:q.length)||0}),[q]),gr=(0,c.useMemo)((function(){return $t?(0,j.jsx)(Re.Z,{children:$t}):(0,j.jsx)(b.Z,{px:1,children:(0,j.jsx)(g.ZP,{monospace:!0,muted:!0,children:"Double-click to edit"})})}),[$t]);(0,c.useEffect)((function(){go&&So&&!Rn&&Wo(!1)}),[So,go,Rn]);var xr=(0,c.useMemo)((function(){return(0,j.jsx)(Ke.Z,{compact:!0,monospace:!0,onBlur:function(){return setTimeout((function(){Dn(!1)}),300)},onChange:function(e){Dn(!0),mr((0,i.Z)({},M.mW,+e.target.value)),e.preventDefault()},onClick:qe.j,onFocus:function(){Dn(!0)},small:!0,type:"number",value:Oo[M.mW]||"",width:11*B.iI})}),[Oo,Dn,mr]),jr=(0,c.useMemo)((function(){return J>=1}),[J]),Cr=(0,c.useMemo)((function(){return te>=1}),[te]),Or=(0,c.useMemo)((function(){return ae>=1}),[ae]),Zr=(0,c.useMemo)((function(){var e=3*x.IN;return An?Or&&(e+=rn.nn):(jr&&(e+=rn.nn),Cr&&(e+=rn.nn)),(We-e)/2}),[jr,Cr,Or,We,An]),kr=(0,c.useMemo)((function(){var e;if(xt)return Vn&&(e=0,An?Or&&(e=18):(jr&&(e+=18),Cr&&(e+=2))),null===G||void 0===G?void 0:G.map((function(n,t){return(0,j.jsx)("div",{children:(0,j.jsx)(_.Z,{blockInteraction:n,contained:!0,containerRef:Vn?nt:V,containerWidth:Vn?Zr:We,interaction:null===Be||void 0===Be?void 0:Be[null===n||void 0===n?void 0:n.uuid],setVariables:ao,showVariableUUID:!0,variables:co,widthOffset:e})},"".concat(null===n||void 0===n?void 0:n.uuid,"-").concat(t))}))}),[G,jr,Cr,Or,V,Be,xt,We,An,ao,Vn,co,Zr]);(0,c.useEffect)((function(){(0,vn.h)()}),[kr,ro,co]);var yr,Er,Tr,Sr,_r=(0,c.useMemo)((function(){return xt&&null!==G&&void 0!==G&&G.length?(0,j.jsx)(x.HS,{children:(0,j.jsx)(b.Z,{px:B.cd,children:(0,j.jsx)(I.Z,{noPadding:!0,onClickTab:function(e){var n=e.uuid;return lo(n)},selectedTabUUID:ro,tabs:re.C4,underlineColor:(0,x.qn)(null===L||void 0===L?void 0:L.type,{blockColor:null===L||void 0===L?void 0:L.color,theme:et}).accent,underlineStyle:!0})})}):null}),[L,G,xt,ro,lo,et]),Pr=(0,c.useMemo)((function(){if(!xt)return null;var e=[],n={};if(null===G||void 0===G||G.forEach((function(t){var o=t.uuid,i=null===Be||void 0===Be?void 0:Be[o],r=null===i||void 0===i?void 0:i.variables;Object.keys(r||{}).forEach((function(t){null!==n&&void 0!==n&&n[t]||(e.push(t),n[t]=!0)}))})),null===e||void 0===e||!e.length)return null;var t=(null===e||void 0===e?void 0:e.length)||0;return(0,j.jsxs)(h.ZP,{alignItems:"center",children:[(0,j.jsx)(g.ZP,{monospace:!0,muted:!0,small:!0,children:"Interaction variables:"}),(0,j.jsx)(b.Z,{mr:B.cd}),null===e||void 0===e?void 0:e.map((function(e,n){return(0,j.jsx)(b.Z,{mr:1,children:(0,j.jsxs)(g.ZP,{default:!0,monospace:!0,small:!0,children:[e,t>=2&&n<t-1&&(0,j.jsx)(g.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:","})]})},e)}))]})}),[G,Be,xt]),Ir=(0,c.useCallback)((function(e,n){return(0,j.jsx)(p.Z,{addNewBlock:function(n){var t=n.content,o=n.configuration,i=(0,ce.eY)(e,n),r=(0,ce.fA)(Tn,e,n).map((function(e){var n=gn({},Ci[e]||{}),t=n.upstream_blocks;return t&&(n.upstream_blocks=t.filter((function(e){return e!==Dt}))),n}));return[P.tf.DATA_LOADER,P.tf.TRANSFORMER].includes(At)&&P.tf.SCRATCHPAD===n.type&&(t="from mage_ai.data_preparation.variable_manager import get_variable\n\n\ndf = get_variable('".concat(po,"', '").concat(Dt,"', 'output_0')")),t=(0,un.X7)(n,t),P.t6.SQL===St&&(o=gn(gn({},(0,mn.GL)(Nt,[M.cH,M.Sv,M.sc,M.BD,M.nq])),o)),P.t6.SQL===n.language&&(t=(0,un.SF)(t)),l(gn(gn({},n),{},{configuration:o,content:t,upstream_blocks:i}),r)},blockIdx:n,blockTemplates:Q,compact:!0,hideCustom:vo,hideDbt:vo,onClickAddSingleDBTModel:kn,pipeline:Tn,project:Sn,setAddNewBlockMenuOpenIdx:wn,setCreatingNewDBTModel:Nn,showBrowseTemplates:Qn,showConfigureProjectModal:Kn,showGlobalDataProducts:Yn})}),[Nt,Q,At,Dt,Ci,vo,vo,kn,Tn,Tn,po,Sn,wn,Nn,Qn,Kn,Yn]);Ge?yr=(0,j.jsx)(Ae,{block:L,blocks:q,onClick:function(){return gt((function(e){return gn(gn({},e),{},(0,i.Z)({},Dt,!Ge))}))}}):yr=(0,j.jsx)(j.Fragment,{children:(0,j.jsxs)("div",{style:{position:"relative"},children:[(0,j.jsx)(x.nz,gn(gn({},gn(gn({},qi),Jo)),{},{onClick:function(){return Wi()},ref:be?null:$o,zIndex:Vn?null:br+1-(F||0),noSticky:Vn,children:(0,j.jsxs)(h.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,j.jsx)(b.Z,{pr:1}),(0,j.jsxs)(O.Z,{alignItems:"center",flex:1,children:[(0,j.jsxs)(h.ZP,{alignItems:"center",children:[(0,j.jsx)(v.Z,{monospace:!0,children:P.tf.GLOBAL_DATA_PRODUCT===(null===L||void 0===L?void 0:L.type)?"GDP":P.dO[St]}),(0,j.jsx)(b.Z,{mr:1}),(0,j.jsx)(R.Z,{color:Bi,size:1.5*B.iI,square:!0}),(0,j.jsx)(b.Z,{mr:1}),(0,j.jsx)(Y.Z,{items:lr(L),onClickCallback:pr,onClickOutside:pr,open:qt,parentRef:ji,uuid:"CodeBlock/block_menu",children:(0,j.jsx)(g.ZP,{color:Bi,monospace:!0,noWrapping:!0,children:null===(Er=mo?P.tf.DBT:P.V4[At])||void 0===Er?void 0:Er.toUpperCase()})}),!Ne&&[P.tf.CUSTOM,P.tf.SCRATCHPAD].includes(At)&&(0,j.jsxs)(j.Fragment,{children:["\xa0",(0,j.jsx)(m.ZP,{basic:!0,iconOnly:!0,noPadding:!0,onClick:function(){return Yt(!0)},transparent:!0,children:(0,j.jsx)(ie.K5,{muted:!0})})]})]}),!Ne&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(b.Z,{mr:B.cd}),(0,j.jsx)(ie.iU,{size:1.5*B.iI}),(0,j.jsx)(b.Z,{mr:1}),(0,j.jsxs)(h.ZP,{alignItems:"center",children:[mo&&P.t6.YAML!==St&&(0,j.jsx)(ee.Z,{block:!0,label:(0,fn.$1)(L,{fullPath:!0}),size:null,children:(0,j.jsx)(g.ZP,{monospace:!0,muted:!0,children:(0,fn.$1)(L)})}),(!mo||P.t6.YAML===St)&&(0,j.jsx)(X.Z,{default:!0,monospace:!0,noWrapping:!0,onClick:function(){return Wn(L,_t)},preventDefault:!0,sameColorAsText:!0,children:Dt})]}),!P.iZ.includes(At)&&We>800&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(b.Z,{mr:B.cd}),(0,j.jsx)(ee.Z,{appearBefore:!0,block:!0,label:"\n ".concat((0,U._6)("parent block",Ui),". ").concat(0===Ui?"Click to select 1 or more blocks to depend on.":"Edit parent blocks.","\n "),size:null,widthFitContent:Ui>=1,children:(0,j.jsx)(m.ZP,{noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){Fn(!0),Mn({upstreamBlocks:{block:L,values:null===wt||void 0===wt?void 0:wt.map((function(e){return{uuid:e}}))}})},children:(0,j.jsxs)(h.ZP,{alignItems:"center",children:[0===Ui&&(0,j.jsx)(ie.Jj,{size:3*B.iI}),Ui>=1&&(0,j.jsx)(ie.eV,{size:3*B.iI}),(0,j.jsx)(b.Z,{mr:1}),(0,j.jsxs)(g.ZP,{default:!0,monospace:Ui>=1,noWrapping:!0,small:!0,underline:0===Ui,children:[0===Ui&&"Edit parents",Ui>=1&&(0,U._6)("parent",Ui)]})]})})})]}),Mt>=2&&We>725&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(b.Z,{mr:B.cd}),(0,j.jsx)(ee.Z,{block:!0,label:"This block is used in ".concat(Mt," pipelines."),size:null,widthFitContent:!0,children:(0,j.jsxs)(h.ZP,{alignItems:"center",children:[(0,j.jsx)(ie.BG,{size:14}),(0,j.jsx)(b.Z,{ml:1}),(0,j.jsxs)(X.Z,{default:!0,monospace:!0,noWrapping:!0,onClick:function(){return En(k.cH.BLOCK_SETTINGS)},preventDefault:!0,small:!0,children:[Mt," pipelines"]})]})})]})]})]}),_n&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(b.Z,{pr:B.cd}),(0,j.jsx)(ve,{addNewBlock:l,addWidget:Z,block:L,blockContent:$t,blocks:q,deleteBlock:he,executionState:xe,fetchFileTree:Ce,fetchPipeline:Ze,hideExtraButtons:Pe,interruptKernel:Ue,isEditingBlock:So,openSidekickView:En,pipeline:Tn,project:Sn,runBlock:Le?null:Si,savePipelineContent:In,setBlockContent:function(e){eo(e),null===Zn||void 0===Zn||Zn(e)},setErrors:Ln,setIsEditingBlock:Wo,setOutputCollapsed:Ao,showConfigureProjectModal:Kn})]}),!Vn&&!Pe&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(b.Z,{pr:B.cd}),(0,j.jsx)(m.ZP,{basic:!0,iconOnly:!0,noPadding:!0,onClick:function(){Xt((function(e){return(0,sn.t8)(gi,!e),!e})),Vt||Ao((function(){return(0,sn.t8)(xi,!0),!0}))},transparent:!0,children:Vt?(0,j.jsx)(ie._M,{muted:!0,size:2*B.iI}):(0,j.jsx)(ie.Kh,{muted:!0,size:2*B.iI})})]}),(0,j.jsx)(O.Z,{children:(0,j.jsx)("div",{style:{height:1,width:B.iI}})})]})})),(0,j.jsxs)(x.Nk,{onClick:function(){return Wi()},children:[(0,j.jsxs)(x.jv,gn(gn({},qi),{},{className:Rn&&Xn?"selected":null,hideBorderBottom:!Vn&&(!!dr||Li),lightBackground:go&&!So,noPadding:!0,onClick:Wi,onDoubleClick:function(){go&&!So&&Wo(!0)},children:[(0,j.jsx)(x.PB,{}),Yi.length>=1&&(0,j.jsx)(x.HS,{children:(0,j.jsx)(b.Z,{p:1,children:(0,j.jsx)(h.ZP,{children:Yi.map((function(e,n){var t=e.description,o=e.title;return(0,j.jsx)(b.Z,{ml:n>=1?1:0,children:(0,j.jsx)(ee.Z,{block:!0,description:t,size:null,widthFitContent:!0,children:(0,j.jsx)(v.Z,{children:o})})},o)}))})})}),!Ie&&P.tf.DBT===At&&!Vt&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(b.Z,{mt:1}),(0,j.jsx)(x.y9,{noMargin:!0,normalPadding:!0,children:(0,j.jsxs)(b.Z,{pb:1,children:[(0,j.jsxs)(h.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,j.jsxs)(O.Z,{alignItems:"center",children:[P.t6.YAML===St&&(0,j.jsx)(De.Z,{compact:!0,monospace:!0,onBlur:function(){return setTimeout((function(){Dn(!1)}),300)},onChange:function(e){var n;mr((n={},(0,i.Z)(n,M.Mv,""),(0,i.Z)(n,M.eW,e.target.value),n)),e.preventDefault()},onClick:qe.j,onFocus:function(){Dn(!0)},placeholder:"Project",small:!0,value:Oo[M.eW]||"",children:Object.keys(oi||{}).map((function(e){return(0,j.jsx)("option",{value:e,children:e},e)}))}),P.t6.YAML!==St&&(0,j.jsx)(g.ZP,{monospace:!0,small:!0,children:ii}),(0,j.jsx)(b.Z,{mr:2}),(0,j.jsx)(g.ZP,{monospace:!0,muted:!0,small:!0,children:"Target"}),(0,j.jsx)("span",{children:"\xa0"}),!di&&(0,j.jsx)(De.Z,{compact:!0,disabled:!ii,monospace:!0,onBlur:function(){return setTimeout((function(){Dn(!1)}),300)},onChange:function(e){mr((0,i.Z)({},M.Mv,e.target.value)),e.preventDefault()},onClick:qe.j,onFocus:function(){Dn(!0)},placeholder:ci,small:!0,value:ui||"",children:null===li||void 0===li?void 0:li.map((function(e){return(0,j.jsx)("option",{value:e,children:e},e)}))}),di&&(0,j.jsx)(Ke.Z,{compact:!0,monospace:!0,onBlur:function(){return setTimeout((function(){Dn(!1)}),300)},onChange:function(e){mr((0,i.Z)({},M.Mv,e.target.value)),e.preventDefault()},onClick:qe.j,onFocus:function(){Dn(!0)},placeholder:ii?(null===ri||void 0===ri?void 0:ri.target)||"Enter target":"Select project first",small:!0,value:ui||"",width:21*B.iI}),(0,j.jsx)(b.Z,{mr:1}),(0,j.jsx)(h.ZP,{alignItems:"center",children:(0,j.jsx)(ee.Z,{block:!0,description:(0,j.jsxs)(g.ZP,{default:!0,inline:!0,children:["Manually type the name of the target you want to use in the profile.",(0,j.jsx)("br",{}),"Interpolate environment variables and global variables using the following syntax:",(0,j.jsx)("br",{}),(0,j.jsx)(g.ZP,{default:!0,inline:!0,monospace:!0,children:"{{ env_var('NAME') }}"})," or ",(0,j.jsx)(g.ZP,{default:!0,inline:!0,monospace:!0,children:"{{ variables('NAME') }}"})]}),size:null,widthFitContent:!0,children:(0,j.jsxs)(h.ZP,{alignItems:"center",children:[(0,j.jsx)(A.Z,{checked:di,label:(0,j.jsx)(g.ZP,{muted:!0,small:!0,children:"Manually enter target"}),onClick:function(e){(0,qe.j)(e),si(!di),di&&mr((0,i.Z)({},M.Mv,null))}}),(0,j.jsx)("span",{children:"\xa0"}),(0,j.jsx)(ie.kI,{muted:!0})]})})})]}),P.t6.YAML!==St&&!(null!==ti&&void 0!==ti&&null!==(Tr=ti.block)&&void 0!==Tr&&Tr.snapshot)&&(0,j.jsxs)(h.ZP,{alignItems:"center",children:[(0,j.jsx)(ee.Z,{appearBefore:!0,block:!0,description:(0,j.jsxs)(g.ZP,{default:!0,inline:!0,children:["Limit the number of results that are returned",(0,j.jsx)("br",{}),"when running this block in the notebook.",(0,j.jsx)("br",{}),"This limit won\u2019t affect the number of results",(0,j.jsx)("br",{}),"returned when running the pipeline end-to-end."]}),size:null,widthFitContent:!0,children:(0,j.jsxs)(h.ZP,{alignItems:"center",children:[(0,j.jsx)(ie.kI,{muted:!0}),(0,j.jsx)("span",{children:"\xa0"}),(0,j.jsx)(g.ZP,{monospace:!0,muted:!0,small:!0,children:"Sample limit"}),(0,j.jsx)("span",{children:"\xa0"})]})}),xr,(0,j.jsx)(b.Z,{mr:1})]})]}),P.t6.YAML===St&&(0,j.jsx)(b.Z,{mt:1,children:(0,j.jsxs)(h.ZP,{alignItems:"center",children:[(0,j.jsxs)(O.Z,{alignItems:"center",flex:1,children:[(0,j.jsx)(g.ZP,{default:!0,monospace:!0,small:!0,children:"dbt"}),(0,j.jsx)(b.Z,{mr:1}),(0,j.jsx)(Ke.Z,{compact:!0,monospace:!0,onBlur:function(){return setTimeout((function(){Dn(!1)}),300)},onChange:function(e){mr((0,i.Z)({},M.Pi,gn(gn({},null===Oo||void 0===Oo?void 0:Oo[M.Pi]),{},(0,i.Z)({},M.pA,e.target.value)))),e.preventDefault()},onClick:qe.j,onFocus:function(){Dn(!0)},placeholder:"command",small:!0,value:(null===Oo||void 0===Oo||null===(Sr=Oo[M.Pi])||void 0===Sr?void 0:Sr[M.pA])||"",width:10*B.iI}),(0,j.jsx)(b.Z,{mr:1}),(0,j.jsx)(g.ZP,{monospace:!0,small:!0,children:"[type your --select and --exclude syntax below]"}),(0,j.jsx)(b.Z,{mr:1}),(0,j.jsxs)(g.ZP,{monospace:!0,muted:!0,small:!0,children:["(paths start from ",(null===Oo||void 0===Oo?void 0:Oo[M.eW])||"project"," folder)"]})]}),(0,j.jsx)(b.Z,{mr:1}),(0,j.jsx)(g.ZP,{muted:!0,small:!0,children:(0,j.jsx)(X.Z,{href:"https://docs.getdbt.com/reference/node-selection/syntax#examples",openNewWindow:!0,small:!0,children:"Examples"})}),(0,j.jsx)(b.Z,{mr:1})]})})]})})]}),!Ie&&ho&&!Vt&&P.tf.DBT!==At&&(0,j.jsx)(x.y9,{normalPadding:!0,children:(0,j.jsxs)(h.ZP,{flexWrap:"wrap",children:[(0,j.jsxs)(h.ZP,{style:{marginTop:"8px"},children:[(0,j.jsx)(De.Z,{compact:!0,label:"Connection",onChange:function(e){return mr((0,i.Z)({},M.cH,e.target.value))},onClick:qe.j,small:!0,value:Oo[M.cH],children:null===se||void 0===se?void 0:se.map((function(e){var n=e.id,t=e.value;return(0,j.jsx)("option",{value:t,children:n},n)}))}),(0,j.jsx)(b.Z,{mr:1}),(0,j.jsx)(De.Z,{compact:!0,label:"Profile",onChange:function(e){return mr((0,i.Z)({},M.sc,e.target.value))},onClick:qe.j,small:!0,value:Oo[M.sc],children:null===bi||void 0===bi?void 0:bi.map((function(e){return(0,j.jsx)("option",{value:e,children:e},e)}))}),(0,j.jsx)(b.Z,{mr:1}),(0,j.jsx)(h.ZP,{alignItems:"center",children:(0,j.jsx)(ee.Z,{block:!0,description:(0,j.jsxs)(g.ZP,{default:!0,inline:!0,children:["If checked, you\u2019ll have to write your own custom",(0,j.jsx)("br",{}),"CREATE TABLE commands and INSERT commands.",(0,j.jsx)("br",{}),"Separate your commands using a semi-colon: ",(0,j.jsx)(g.ZP,{default:!0,inline:!0,monospace:!0,children:";"})]}),size:null,widthFitContent:!0,children:(0,j.jsxs)(h.ZP,{alignItems:"center",children:[(0,j.jsx)(A.Z,{checked:Oo[M.Mi],label:(0,j.jsx)(g.ZP,{muted:!0,small:!0,children:"Use raw SQL"}),onClick:function(e){(0,qe.j)(e),mr((0,i.Z)({},M.Mi,!Oo[M.Mi]))}}),(0,j.jsx)("span",{children:"\xa0"}),(0,j.jsx)(ie.kI,{muted:!0})]})})}),!Oo[M.Mi]&&(0,j.jsxs)(j.Fragment,{children:[hr&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(b.Z,{mr:1}),(0,j.jsx)(h.ZP,{alignItems:"center",children:(0,j.jsx)(Ke.Z,{compact:!0,label:"Database",monospace:!0,onBlur:function(){return setTimeout((function(){Dn(!1)}),300)},onChange:function(e){mr((0,i.Z)({},M.Sv,e.target.value)),e.preventDefault()},onClick:qe.j,onFocus:function(){Dn(!0)},small:!0,value:Oo[M.Sv],width:10*B.iI})})]}),(0,j.jsx)(b.Z,{mr:1}),![Te.CLICKHOUSE,Te.MYSQL].includes(Oo[M.cH])&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(ee.Z,{block:!0,description:(0,j.jsxs)(g.ZP,{default:!0,inline:!0,children:["Schema that is used when creating a table and inserting values.",(0,j.jsx)("br",{}),"This field is required."]}),size:null,widthFitContent:!0,children:(0,j.jsx)(h.ZP,{alignItems:"center",children:(0,j.jsx)(Ke.Z,{compact:!0,label:"Schema",monospace:!0,onBlur:function(){return setTimeout((function(){Dn(!1)}),300)},onChange:function(e){mr((0,i.Z)({},M.BD,e.target.value)),e.preventDefault()},onClick:qe.j,onFocus:function(){Dn(!0)},small:!0,value:Oo[M.BD],width:10*B.iI})})}),(0,j.jsx)(b.Z,{mr:1})]}),(0,j.jsx)(ee.Z,{block:!0,description:(0,j.jsxs)(g.ZP,{default:!0,inline:!0,children:["This value will be used as the table name.",(0,j.jsx)("br",{}),"If blank, the default table name will be:",(0,j.jsx)("br",{}),(0,j.jsxs)(g.ZP,{inline:!0,monospace:!0,children:[po,"_",Dt]}),(0,j.jsx)("br",{}),"This field is optional."]}),size:null,widthFitContent:!0,children:(0,j.jsx)(h.ZP,{alignItems:"center",children:(0,j.jsx)(Ke.Z,{compact:!0,label:"Table (optional)",monospace:!0,onBlur:function(){return setTimeout((function(){Dn(!1)}),300)},onChange:function(e){mr((0,i.Z)({},M.m$,e.target.value)),e.preventDefault()},onClick:qe.j,onFocus:function(){Dn(!0)},small:!0,value:Oo[M.m$],width:20*B.iI})})})]}),(0,j.jsx)(b.Z,{mr:1})]}),!Oo[M.Mi]&&(0,j.jsxs)(h.ZP,{alignItems:"center",style:{marginTop:"8px"},children:[(0,j.jsx)(ee.Z,{block:!0,description:(0,j.jsxs)(g.ZP,{default:!0,inline:!0,children:["Limit the number of results that are returned",(0,j.jsx)("br",{}),"when running this block in the notebook.",(0,j.jsx)("br",{}),"This limit won\u2019t affect the number of results",(0,j.jsx)("br",{}),"returned when running the pipeline end-to-end."]}),size:null,widthFitContent:!0,children:(0,j.jsxs)(h.ZP,{alignItems:"center",children:[(0,j.jsx)(ie.kI,{muted:!0}),(0,j.jsx)("span",{children:"\xa0"}),(0,j.jsx)(g.ZP,{monospace:!0,muted:!0,small:!0,children:"Limit"}),(0,j.jsx)("span",{children:"\xa0"})]})}),xr,(0,j.jsx)(b.Z,{mr:1}),(0,j.jsx)(ee.Z,{autoWidth:!0,block:!0,description:(0,j.jsxs)(g.ZP,{default:!0,inline:!0,children:["How do you want to handle existing data with the same",hr?" database,":""," schema, and table name?",(0,j.jsx)("br",{}),(0,j.jsx)(g.ZP,{bold:!0,inline:!0,monospace:!0,children:"Append"}),": add rows to the existing table.",(0,j.jsx)("br",{}),(0,j.jsx)(g.ZP,{bold:!0,inline:!0,monospace:!0,children:"Replace"}),": delete the existing data.",(0,j.jsx)("br",{}),(0,j.jsx)(g.ZP,{bold:!0,inline:!0,monospace:!0,children:"Fail"}),": raise an error during execution."]}),size:null,widthFitContent:!0,children:(0,j.jsxs)(h.ZP,{alignItems:"center",children:[(0,j.jsx)(ie.kI,{muted:!0}),(0,j.jsx)("span",{children:"\xa0"}),(0,j.jsx)(g.ZP,{monospace:!0,muted:!0,small:!0,children:"Write policy:"}),(0,j.jsx)("span",{children:"\xa0"}),(0,j.jsx)(De.Z,{compact:!0,label:"strategy",onChange:function(e){return mr((0,i.Z)({},M.nq,e.target.value))},onClick:qe.j,small:!0,value:Oo[M.nq],children:null===Se||void 0===Se?void 0:Se.map((function(e){return(0,j.jsx)("option",{value:e,children:(0,U.kC)(e)},e)}))})]})}),(0,j.jsx)(b.Z,{mr:1})]}),(null===Oo||void 0===Oo?void 0:Oo[M.cH])===Te.TRINO&&wt.length>=1&&(0,j.jsxs)(h.ZP,{alignItems:"center",style:{marginTop:"8px"},children:[(0,j.jsx)(ee.Z,{appearBefore:!0,block:!0,description:(0,j.jsxs)(g.ZP,{default:!0,inline:!0,children:["If checked, upstream blocks that aren\u2019t SQL blocks",(0,j.jsx)("br",{}),"will have their data exported into a table that is",(0,j.jsx)("br",{}),"uniquely named upon each block run. For example,",(0,j.jsx)("br",{}),(0,j.jsx)(g.ZP,{default:!0,inline:!0,monospace:!0,children:"[pipeline_uuid]_[block_uuid]_[unique_timestamp]"}),"."]}),size:null,widthFitContent:!0,children:(0,j.jsxs)(h.ZP,{alignItems:"center",children:[(0,j.jsx)(A.Z,{checked:Oo[M.bk],label:(0,j.jsx)(g.ZP,{muted:!0,small:!0,children:"Unique upstream table names"}),onClick:function(e){(0,qe.j)(e),mr((0,i.Z)({},M.bk,!Oo[M.bk]))}}),(0,j.jsx)("span",{children:"\xa0"}),(0,j.jsx)(ie.kI,{muted:!0})]})}),(0,j.jsx)(b.Z,{mr:1})]})]})}),_r,wt.length>=1&&!Vt&&(P.f2.includes(At)||P.tf.DBT===At&&P.t6.YAML===St)&&!vo&&!It&&!xo&&(!ro||ro===re.zr.uuid)&&(0,j.jsxs)(x.y9,{noMargin:!0,normalPadding:!0,children:[P.tf.DBT===At&&P.t6.YAML===St&&(0,j.jsxs)(b.Z,{py:1,children:[(0,j.jsxs)(g.ZP,{muted:!0,small:!0,children:["Positional order of upstream block outputs for ",(0,j.jsx)(g.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:"block_output"})," function:"]}),(0,j.jsx)(h.ZP,{children:wt.reduce((function(e,n,t){var o=Ci[n],i=(0,x.qn)(null===o||void 0===o?void 0:o.type,{blockColor:null===o||void 0===o?void 0:o.color,theme:et}).accent;e.push((0,j.jsx)(X.Z,{color:i,onClick:function(){var e,n,t=null===z||void 0===z||null===(e=z.current)||void 0===e?void 0:e["".concat(null===o||void 0===o?void 0:o.type,"s/").concat(null===o||void 0===o?void 0:o.uuid,".py")];null===t||void 0===t||null===(n=t.current)||void 0===n||n.scrollIntoView()},preventDefault:!0,small:!0,children:(0,j.jsx)(g.ZP,{color:i,inline:!0,monospace:!0,small:!0,children:n})},n));var r=(null===wt||void 0===wt?void 0:wt.length)||0;return r>=2&&t<r-1&&e.push((0,j.jsx)(g.ZP,{inline:!0,muted:!0,small:!0,children:",\xa0\xa0"},"".concat(n,"-comma"))),e}),[])})]}),P.tf.DBT!==At&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(b.Z,{mr:1,pt:1,children:(0,j.jsxs)(g.ZP,{muted:!0,small:!0,children:[!ho&&"Positional arguments for ".concat(bo?"":"decorated ","function:"),ho&&(0,j.jsxs)(j.Fragment,{children:["The interpolated tables below are available in queries from upstream blocks.",(0,j.jsx)("br",{}),"Example: ",(0,j.jsx)(g.ZP,{inline:!0,monospace:!0,small:!0,children:"SELECT * FROM {{ df_1 }}"})," to insert all rows from ",(0,j.jsx)(g.ZP,{inline:!0,monospace:!0,small:!0,children:null===wt||void 0===wt?void 0:wt[0]})," into a table."]})]})}),(0,j.jsxs)(b.Z,{my:1,children:[!ho&&!bo&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(g.ZP,{monospace:!0,muted:!0,small:!0,children:[P.tf.DATA_EXPORTER===At&&"@data_exporter",P.tf.DATA_LOADER===At&&"@data_loader",P.tf.TRANSFORMER===At&&"@transformer",P.tf.CUSTOM===At&&"@custom"]}),(0,j.jsxs)(g.ZP,{monospace:!0,muted:!0,small:!0,children:["def ",(P.tf.DATA_EXPORTER===At?"export_data":P.tf.DATA_LOADER===At&&"load_data")||P.tf.TRANSFORMER===At&&"transform"||P.tf.CUSTOM===At&&"transform_custom","(",wt.map((function(e,n){return n>=1?"data_".concat(n+1):"data"})).join(", "),"):"]})]}),bo&&(0,j.jsx)(j.Fragment,{children:(0,j.jsxs)(g.ZP,{monospace:!0,muted:!0,small:!0,children:[P.tf.DATA_EXPORTER===At?"export_data":P.tf.TRANSFORMER===At&&"transform","\xa0\u2190 function(",wt.map((function(e,n){return"df_".concat(n+1)})).join(", "),"):"]})}),ho&&(null===wt||void 0===wt?void 0:wt.length)>=1&&(0,j.jsx)(Ve,{block:L,blockConfiguration:Oo,blockRefs:z,blocks:null===wt||void 0===wt?void 0:wt.map((function(e){return null===Ci||void 0===Ci?void 0:Ci[e]})),updateBlockConfiguration:mr}),!ho&&wt.map((function(e,n){var t=Ci[e],o=(0,x.qn)(null===t||void 0===t?void 0:t.type,{blockColor:null===t||void 0===t?void 0:t.color,theme:et}).accent,i="{{ df_".concat(n+1," }}");return(0,j.jsxs)("div",{children:[!ho&&!bo&&(0,j.jsxs)(g.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:["\xa0\xa0\xa0\xa0data",n>=1?"_".concat(n+1):null]}),ho&&(0,j.jsx)(g.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:i}),bo&&(0,j.jsxs)(g.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:["\xa0\xa0\xa0\xa0","df".concat(n+1)]})," ",(0,j.jsx)(g.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:"\u2192"})," ",(0,j.jsx)(X.Z,{color:o,onClick:function(){var e,n,o=null===z||void 0===z||null===(e=z.current)||void 0===e?void 0:e["".concat(null===t||void 0===t?void 0:t.type,"s/").concat(null===t||void 0===t?void 0:t.uuid,".py")];null===o||void 0===o||null===(n=o.current)||void 0===n||n.scrollIntoView()},preventDefault:!0,small:!0,children:(0,j.jsx)(g.ZP,{color:o,inline:!0,monospace:!0,small:!0,children:e})})]},e)}))]})]})]}),(!ro||!(null!==G&&void 0!==G&&G.length)||ro===re.zr.uuid)&&!Vt&&Pr&&(0,j.jsx)(x.HS,{darkBorder:!0,noBackground:!0,children:(0,j.jsx)(b.Z,{p:1,children:Pr})}),re.aj.uuid===ro&&(null===G||void 0===G?void 0:G.length)>=1&&!Vt&&(0,j.jsx)(j.Fragment,{children:kr}),!Et&&(!ro||!(null!==G&&void 0!==G&&G.length)||re.zr.uuid===ro)&&(0,j.jsx)(j.Fragment,{children:Vt?(0,j.jsx)(b.Z,{p:1,children:(0,j.jsxs)(g.ZP,{monospace:!0,muted:!0,children:["(",(0,U._6)("line",null===$t||void 0===$t?void 0:$t.split(/\r\n|\r|\n/).length)," collapsed)"]})}):!go||So?ur&&!xo?(0,j.jsx)(b.Z,{px:1,children:(0,j.jsxs)(g.ZP,{monospace:!0,muted:!0,children:["Replicated from block ",(0,j.jsx)(X.Z,{color:(0,x.qn)(null===ur||void 0===ur?void 0:ur.type,{blockColor:null===ur||void 0===ur?void 0:ur.color,theme:et}).accent,onClick:function(e){var n,t;(0,qe.j)(e);var o=null===z||void 0===z||null===(n=z.current)||void 0===n?void 0:n["".concat(null===ur||void 0===ur?void 0:ur.type,"s/").concat(null===ur||void 0===ur?void 0:ur.uuid,".py")];null===o||void 0===o||null===(t=o.current)||void 0===t||t.scrollIntoView()},preventDefault:!0,children:(0,j.jsx)(g.ZP,{color:(0,x.qn)(null===ur||void 0===ur?void 0:ur.type,{blockColor:null===ur||void 0===ur?void 0:ur.color,theme:et}).accent,inline:!0,monospace:!0,children:null===ur||void 0===ur?void 0:ur.uuid})})]})}):(0,j.jsx)(b.Z,{py:xo?0:B.cd,children:ar}):gr}),je&&c.cloneElement(je,{runBlockAndTrack:Si}),Et&&(0,j.jsxs)(b.Z,{p:B.cd,children:[(0,j.jsx)(g.ZP,{bold:!0,danger:!0,children:null===Et||void 0===Et?void 0:Et.error}),(0,j.jsx)(g.ZP,{muted:!0,children:null===Et||void 0===Et?void 0:Et.message})]}),!(xo&&P.t6.PYTHON!==St)&&sr,xo&&P.t6.PYTHON!==St&&sr,cr]})),!Vn&&fr]})]})});var Ar=(0,j.jsx)("div",{ref:n,children:(0,j.jsx)("div",{ref:ni,style:{zIndex:F===C?br+9:null},children:(0,j.jsxs)("div",{style:{paddingTop:Vn&&0===F?x.WC:0,position:"relative"},children:[Vn&&F>=1&&(0,j.jsxs)(x.gE,{additionalZIndex:br-F,bottom:0,height:x.WC,onMouseEnter:function(){return Gt(!0)},onMouseLeave:function(){Gt(!1),null===wn||void 0===wn||wn(null)},children:[Ft&&l&&(0,j.jsx)(b.Z,{mx:2,style:{width:"100%"},children:Ir(null===q||void 0===q?void 0:q[F-1],F-1)}),(0,j.jsx)(x.t1,{className:"block-divider-inner"})]}),yr,!Vn&&!Cn&&(0,j.jsxs)(x.gE,{additionalZIndex:br-F,onMouseEnter:function(){return Gt(!0)},onMouseLeave:function(){Gt(!1),null===wn||void 0===wn||wn(null)},children:[Ft&&l&&(0,j.jsx)(b.Z,{mt:2,mx:2,style:{width:"100%"},children:Ir(L,F)}),(0,j.jsx)(x.t1,{className:"block-divider-inner"})]}),W]})})}),Rr=(0,c.useMemo)((function(){var e=ze||{},n=(e.height,e.x),t=(e.width,e.y),o=n+x.IN;return jr&&!An&&(o+=rn.nn),(0,j.jsx)(x.j1,{left:o,ref:nt,top:t,width:Zr,children:Ar})}),[F,Ar,jr,ze,An]),wr=(0,c.useMemo)((function(){return((null===q||void 0===q?void 0:q.length)||0)-F}),[F,q]),Dr=(0,c.useMemo)((function(){var e=ze||{},n=(e.height,e.x),t=e.width,o=e.y,i=$n+x.IN-(n+t);return An?Or&&(i+=x.IN):Cr&&(i+=x.IN),(0,j.jsx)(x.j1,{ref:tt,right:i,top:o,width:Zr,zIndex:wr,children:fr})}),[F,q,fr,Cr,Or,ze,Zr,$n,wr]);return Vn?(0,j.jsxs)(x.fk,{zIndex:Rn?wr:Ft?2*wr:null,children:[Rr,Dr]}):Ar}var Cn=c.forwardRef(jn)},84820:function(e,n,t){t.d(n,{Z:function(){return h}});var o,i=t(21831),r=t(44425),l=t(82394),u=t(75582),c=t(17717);!function(e){e.DATA_EXPORTER="data_exporter",e.DATA_LOADER="data_loader",e.MAGE_LIBRARY="mage_library",e.TRANSFORMER="transformer",e.USER_LIBRARY="user_library"}(o||(o={}));var a=t(89209);function d(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function s(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,l.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 f=t(86735);function p(e,n){var t=e;t.includes("__init__")||t.push("__init__");var o,i=t.length;return(0,f.w6)(i).forEach((function(e,r){if(o)return o;var l=t.slice(0,i-r).join(c.sep);o=n["".concat(l,".py")]})),o}function v(e,n,t){var o,i,r;return((null===(o=t.outputs)||void 0===o||null===(i=o[0])||void 0===i||null===(r=i.sample_data)||void 0===r?void 0:r.columns)||[]).map((function(t){return{label:"".concat(t," column"),kind:e.languages.CompletionItemKind.Variable,insertText:"'".concat(t,"'"),range:n}}))}function m(e,n){var t=e.word.split(""),o=new RegExp(t.reduce((function(e,n,o){var i=t[o+1],r=i?"^".concat(i):"";return e+"".concat(n,"[w ").concat(r,"]*")}),""));return n.reduce((function(e,n){return n.label.match(o)?e.concat(n):e}),[])}function h(e){var n=e.autocompleteItems,t=e.block,l=e.blocks,d=e.pipeline,h=t.type,b=t.upstream_blocks,g=(0,f.HK)(n,(function(e){return e.id}));return function(t){return function(x,j){var C=[],O=x.getValueInRange({endColumn:j.column,endLineNumber:j.lineNumber,startColumn:1,startLineNumber:1}),Z=x.getWordUntilPosition(j),k=Z.endColumn,y=Z.startColumn,E={endColumn:k,endLineNumber:j.lineNumber,startColumn:y,startLineNumber:j.lineNumber},T=function(e,n,t){var o=(0,a.Yn)(e),i=(0,a.M4)(e,n),r=o.find((function(e){var n=e.variableName;return i.match(new RegExp(n))}));if(r){var l=r.assignmentValue,u=(0,a.S0)(e)[l];if(u){var c,d=p(u.split(" as ")[0].replace("from ","").replace("import ","").split(" ").reduce((function(e,n){return n.trim()?e.concat(n):e}),[]).join(".").split("."),t),s=(0,a.rW)(u,l);return null===d||void 0===d||null===(c=d.methods_for_class)||void 0===c?void 0:c[s]}}return[]}(O,E,g);if((null===T||void 0===T?void 0:T.length)>=1){var S=m(Z,T.map((function(e){return{filterText:e,insertText:e,kind:t.languages.CompletionItemKind.Method,label:e,range:E}})));if(S.length>=1)return{suggestions:S}}var _=function(e,n,t){var o=(0,a.M4)(e,n);if(o=o.match(/([\w_]+)./)){var i=(0,a.S0)(e)[o[1]];if(i){var r=p(i.split(" as ")[0].replace("from ","").replace("import ","").split(" ").reduce((function(e,n){return n.trim()?e.concat(n):e}),[]).join(".").split("."),t);if(null!==r&&void 0!==r&&r.functions)return null===r||void 0===r?void 0:r.functions}}return[]}(O,E,g);if((null===_||void 0===_?void 0:_.length)>=1){var P=m(Z,_.map((function(e){return{filterText:e,insertText:e,kind:t.languages.CompletionItemKind.Function,label:e,range:E}})));if(P.length>=1)return{suggestions:P}}if((null===b||void 0===b?void 0:b.length)>=1){var I=new RegExp("\n@".concat(h));O.match(I)&&C.push.apply(C,(0,i.Z)(m(Z,function(e,n,t){var o=t.block,i=t.blocks,r=o.upstream_blocks,l=(0,f.HK)(i,(function(e){return e.uuid}));return r.map((function(t,o){var i=l[t].type,r=0===o?"output_0":"args[".concat(o-1,"]");return{label:"df ".concat(t," ").concat(i," block"),kind:e.languages.CompletionItemKind.Variable,documentation:"Variable for ".concat(i," ").concat(t," data."),insertText:r,range:n}}))}(t,E,e))))}if(Z.word.match(/i|f/)){var A=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,t=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0,l=(arguments.length>2?arguments[2]:void 0).word,d=new Set,f={};e.forEach((function(e){var n=e.group,t=e.id,i=e.imports;if([o.MAGE_LIBRARY,o.USER_LIBRARY].includes(n)){var r=t;r.match(/__init__.py/)&&(r=r.replace(/\/__init__.py/,"")),r=r.split(".py")[0].replaceAll(c.sep,"."),f[r]=e}var l=t.replace(".py","").replace("/__init__","").split(c.sep);if(1===l.length)d.add("import ".concat(l[0]));else if(l.length>=2){var u=l.slice(0,l.length-1).join(".");d.add("from ".concat(u," import ").concat(l[l.length-1]))}i.forEach((function(e){return d.add(e)}))}));var p,v="i"===l,m="f"===l,h=v?"import":m?"from":"",b=(0,a.M4)(n,r);if(v&&b.match(/from/)&&(p=b.match(/from ([A-Za-z0-9_.]+) /)[1]),p&&f[p]){var g=f[p],x=g.classes,j=g.constants,C=g.files,O=g.functions,Z=[];return[[j,t.languages.CompletionItemKind.Constant],[x,t.languages.CompletionItemKind.Class],[O,t.languages.CompletionItemKind.Function]].forEach((function(e){var n=(0,u.Z)(e,2),t=n[0],o=n[1];t.forEach((function(e){Z.push({filterText:"import ".concat(e),insertText:"import ".concat(e),kind:o,label:e,range:r})}))})),C.forEach((function(e){var n=e.split(c.sep),o=n[n.length-1].split(".py")[0];Z.push({filterText:"import ".concat(o),insertText:"import ".concat(o),kind:t.languages.CompletionItemKind.Variable,label:o,range:r})})),Z}return(0,i.Z)(d).map((function(e){return{filterText:e,insertText:e,kind:t.languages.CompletionItemKind.File,label:e,range:r}})).concat(Object.entries(f).map((function(e){var n=(0,u.Z)(e,2),o=n[0];return n[1],{filterText:"".concat(h," ").concat(o),insertText:"".concat(h," ").concat(o," "),kind:t.languages.CompletionItemKind.File,label:"".concat(o),range:s({},r)}})))}(n,O,Z,t,E,e);C.push.apply(C,(0,i.Z)(A))}if(r.tf.CHART===h||r.tf.SCRATCHPAD===h){var R=[];if(r.tf.CHART===h?b.forEach((function(e,n){R.push({block:l.find((function(n){var t=n.uuid;return e===t})),matchIndex:0,variableName:"df_".concat(n+1)})})):r.tf.SCRATCHPAD===h&&function(e,n){return e.map((function(e){return{block:e,regex:new RegExp("([\\w_]+)[ ]*=[ ]*get_variable\\('".concat(n.uuid,"', '").concat(e.uuid,"', 'output_0'\\)"),"g")}}))}(l,d).forEach((function(e){var n=e.block,t=e.regex,o=O.matchAll(t);(0,i.Z)(o).forEach((function(e){var t=null===e||void 0===e?void 0:e.index,o=null===e||void 0===e?void 0:e[1];o&&R.push({block:n,matchIndex:t,variableName:o})}))})),R.length>=1){var w,D=null===(w=O.split("\n")[j.lineNumber-1])||void 0===w?void 0:w.slice(0,Z.startColumn-1);if(D){var N=[];if(R.forEach((function(e){var n=e.block,o=e.matchIndex,i=e.variableName,r=new RegExp("".concat(i,"\\["));D.match(r)&&N.push({items:v(t,E,n),matchIndex:o})})),N.length>=1)return{suggestions:m(Z,(0,f.YC)(N,"matchIndex",{ascending:!1})[0].items)}}}1===y&&(r.tf.CHART===h?C.push.apply(C,(0,i.Z)(m(Z,b.map((function(e,n){var o="df_".concat(n+1);return{label:"".concat(o," ").concat(e," block"),kind:t.languages.CompletionItemKind.Snippet,insertText:o,range:E}}))))):r.tf.SCRATCHPAD===h&&C.push.apply(C,(0,i.Z)(m(Z,function(e,n,t){var o=t.block,i=t.blocks,l=t.pipeline;return i.reduce((function(t,i){var u=i.type,c=i.uuid;return o.uuid!==c&&[r.tf.DATA_LOADER,r.tf.TRANSFORMER].includes(u)?t.concat({label:"df ".concat(c," ").concat(u," block"),kind:e.languages.CompletionItemKind.Snippet,documentation:"Get the data from ".concat(u," block ").concat(c,"."),insertText:"from mage_ai.data_preparation.variable_manager import get_variable\n\n\ndf = get_variable('".concat(l.uuid,"', '").concat(c,"', 'output_0')\n"),range:n}):t}),[])}(t,E,e)))))}var M=new Set;l.concat({content:O}).forEach((function(e){var n=e.content;(0,i.Z)(n.matchAll("([A-Za-z_0-9]+)","g")).forEach((function(e){return M.add(e[1])}))}));var L=(0,i.Z)(M);if(L.length){var B=L.map((function(e){return{filterText:e,insertText:e,kind:t.languages.CompletionItemKind.Variable,label:e,range:E}}));C.push.apply(C,(0,i.Z)(m(Z,B)))}return{suggestions:C}}}}},32929:function(e,n,t){t.d(n,{A2:function(){return h},dP:function(){return b},hS:function(){return j},iK:function(){return g},n9:function(){return m},qy:function(){return x}});var o,i=t(26304),r=t(82394),l=t(13507),u=t(44425),c=t(72473),a=t(57653),d=t(55283),s=["uuid"],f=["uuid"];function p(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function v(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?p(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):p(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var m={uuid:"Blocks"},h={uuid:"Pipelines"},b=[m,h],g=(o={},(0,r.Z)(o,u.tf.CALLBACK,c.AQ),(0,r.Z)(o,u.tf.CHART,c.GQ),(0,r.Z)(o,u.tf.CONDITIONAL,c.hW),(0,r.Z)(o,u.tf.CUSTOM,c.VS),(0,r.Z)(o,u.tf.DATA_EXPORTER,c.zS),(0,r.Z)(o,u.tf.DATA_LOADER,c.rH),(0,r.Z)(o,u.tf.DBT,c.xE),(0,r.Z)(o,u.tf.EXTENSION,c.Bf),(0,r.Z)(o,u.tf.MARKDOWN,c.$B),(0,r.Z)(o,u.tf.SENSOR,c.LM),(0,r.Z)(o,u.tf.TRANSFORMER,c.Sv),o),x=[{Icon:c.zQ,uuid:"All templates"}].concat([{uuid:u.tf.DATA_LOADER},{uuid:u.tf.TRANSFORMER},{selectedIconProps:{inverted:!0},uuid:u.tf.DATA_EXPORTER},{uuid:u.tf.SENSOR},{selectedIconProps:{inverted:!0},uuid:u.tf.CUSTOM},{uuid:u.tf.CHART},{selectedIconProps:{inverted:!0},uuid:u.tf.CALLBACK},{selectedIconProps:{inverted:!0},uuid:u.tf.CONDITIONAL},{uuid:u.tf.EXTENSION},{selectedBackgroundColor:null,uuid:u.tf.DBT},{selectedIconProps:{inverted:!0},uuid:u.tf.MARKDOWN}].map((function(e){var n=e.uuid,t=(0,i.Z)(e,s);return v({Icon:g[n],filterTemplates:function(e){return null===e||void 0===e?void 0:e.filter((function(e){return e.block_type===n}))},label:function(){return u.V4[n]},selectedBackgroundColor:function(e){return(0,d.qn)(n,{theme:e}).accent},uuid:n},t)}))),j=[{Icon:c.zQ,uuid:"All templates"}].concat([{Icon:c.X5,uuid:a.qL.PYTHON},{Icon:c.ZG,uuid:a.qL.INTEGRATION},{Icon:l.Z,uuid:a.qL.STREAMING}].map((function(e){var n=e.uuid,t=(0,i.Z)(e,f);return v({filterTemplates:function(e){return null===e||void 0===e?void 0:e.filter((function(e){var t;return(null===e||void 0===e||null===(t=e.pipeline)||void 0===t?void 0:t.type)===n}))},label:function(){return a.G7[n]},uuid:n},t)})))},84649:function(e,n,t){t.d(n,{EN:function(){return E},FX:function(){return T},HS:function(){return C},Nk:function(){return v},Rd:function(){return p},SL:function(){return y},Tj:function(){return k},UE:function(){return Z},Yf:function(){return h},ZG:function(){return d},bC:function(){return m},n5:function(){return f},n8:function(){return O},w5:function(){return j},wj:function(){return g},wl:function(){return b},ze:function(){return x}});var o=t(38626),i=t(44897),r=t(42631),l=t(46684),u=t(70515),c=t(91437),a=t(47041),d=2.5*u.iI,s=40*u.iI,f=10*u.iI,p=o.default.div.withConfig({displayName:"indexstyle__ContainedStyle",componentId:"sc-8sk2qr-0"})([""," overflow:auto;"," "," ",""],a.w5,(function(e){return"\n background-color: ".concat((e.theme.background||i.Z.background).page,";\n ")}),(function(e){return e.height&&"\n height: ".concat(e.height-f,"px;\n ")}),(function(e){return e.width&&"\n width: ".concat(e.width-f,"px;\n ")})),v=o.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-8sk2qr-1"})(["height:100%;position:relative;"]),m=o.default.div.withConfig({displayName:"indexstyle__NavigationStyle",componentId:"sc-8sk2qr-2"})(["position:fixed;width:","px;z-index:1;"," "," ",""],s,(function(e){return"\n background-color: ".concat((e.theme.background||i.Z.background).panel,";\n border-right: 1px solid ").concat((e.theme.borders||i.Z.borders).light,";\n ")}),(function(e){return e.height&&"\n height: ".concat(e.height-f,"px;\n ")}),(function(e){return!e.height&&"\n height: 100%;\n "})),h=o.default.div.withConfig({displayName:"indexstyle__TabsStyle",componentId:"sc-8sk2qr-3"})(["padding-bottom:","px;padding-left:","px;padding-right:","px;padding-top:","px;",""],1*u.iI,u.cd*u.iI,u.cd*u.iI,1*u.iI,(function(e){return"\n border-bottom: 1px solid ".concat((e.theme.borders||i.Z.borders).light,";\n ")})),b=o.default.div.withConfig({displayName:"indexstyle__LinksContainerStyle",componentId:"sc-8sk2qr-4"})([""," overflow:auto;position:fixed;width:","px;",""],a.w5,s,(function(e){return"\n height: calc(100% - ".concat(55+(null!==e&&void 0!==e&&e.contained?f:l.Mz)+((null===e||void 0===e?void 0:e.heightOffset)||0),"px);\n ")})),g=o.default.div.withConfig({displayName:"indexstyle__NavLinkStyle",componentId:"sc-8sk2qr-5"})([""," padding-bottom:","px;padding-left:","px;padding-right:","px;padding-top:","px;&:hover{cursor:pointer;}",""],(0,c.eR)(),1*u.iI,u.cd*u.iI,u.cd*u.iI,1*u.iI,(function(e){return e.selected&&"\n background-color: ".concat((e.theme.background||i.Z.background).codeTextarea,";\n ")})),x=o.default.div.withConfig({displayName:"indexstyle__IconStyle",componentId:"sc-8sk2qr-6"})([""," border-radius:","px;height:","px;margin-right:","px;padding:","px;width:","px;"," ",""],(0,c.eR)(),r.n_,5*u.iI,1.25*u.iI,1.25*u.iI,5*u.iI,(function(e){return!e.backgroundColor&&"\n background-color: ".concat((e.theme.background||i.Z.background).chartBlock,";\n ")}),(function(e){return e.backgroundColor&&"\n background-color: ".concat(e.backgroundColor,";\n ")})),j=o.default.div.withConfig({displayName:"indexstyle__ContentStyle",componentId:"sc-8sk2qr-7"})(["margin-left:","px;"],s),C=o.default.div.withConfig({displayName:"indexstyle__SubheaderStyle",componentId:"sc-8sk2qr-8"})(["padding:","px;",""],u.cd*u.iI,(function(e){return"\n background-color: ".concat((e.theme.background||i.Z.background).panel,";\n border-bottom: 1px solid ").concat((e.theme.borders||i.Z.borders).light,";\n ")})),O=o.default.div.withConfig({displayName:"indexstyle__CardsStyle",componentId:"sc-8sk2qr-9"})(["display:flex;flex-wrap:wrap;padding:","px;"],.75*u.iI),Z=o.default.div.withConfig({displayName:"indexstyle__CardStyle",componentId:"sc-8sk2qr-10"})(["border-radius:","px;margin:","px;padding:","px;width:","px;&:hover{cursor:pointer;}",""],r.n_,.75*u.iI,2.5*u.iI,50*u.iI,(function(e){return"\n background-color: ".concat((e.theme.background||i.Z.background).panel,";\n border: 1px solid ").concat((e.theme.background||i.Z.background).chartBlock,";\n box-shadow: ").concat((e.theme.shadow||i.Z.shadow).frame,";\n ")})),k=o.default.div.withConfig({displayName:"indexstyle__CardTitleStyle",componentId:"sc-8sk2qr-11"})(["height:","px;"],2.5*u.iI),y=o.default.div.withConfig({displayName:"indexstyle__CardDescriptionStyle",componentId:"sc-8sk2qr-12"})(["height:","px;margin-top:","px;"],2.5*u.iI*2,1*u.iI),E=o.default.div.withConfig({displayName:"indexstyle__TagsStyle",componentId:"sc-8sk2qr-13"})(["height:","px;margin-top:","px;overflow:hidden;"],3.5*u.iI,.5*u.iI),T=o.default.div.withConfig({displayName:"indexstyle__BreadcrumbsStyle",componentId:"sc-8sk2qr-14"})(["padding-bottom:","px;padding-top:","px;",""],1*u.iI,1*u.iI,(function(e){return"\n background-color: ".concat((e.theme.background||i.Z.background).panel,";\n border-bottom: 1px solid ").concat((e.theme.borders||i.Z.borders).light,";\n ")}))},88328:function(e,n,t){t.d(n,{Z:function(){return B}});var o=t(82394),i=t(75582),r=t(12691),l=t.n(r),u=t(21764),c=t(82684),a=t(69864),d=t(34376),s=t(71180),f=t(90299),p=t(44898),v=t(24138),m=t(97618),h=t(55485),b=t(48670),g=t(38276),x=t(30160),j=t(35576),C=t(17488),O=t(62547),Z=t(35686),k=t(94777),y=t(98464),E=t(46684),T={uuid:"Define"},S={uuid:"Document"},_=[T,S],P=t(70515),I=t(11302),A=t(68899),R=t(72619),w=t(23780),D=t(19183),N=t(28598);function M(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function L(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,o.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 B=function(e){var n=e.defaultTab,t=e.onMutateSuccess,o=e.pipelineUUID,r=e.template,M=e.templateAttributes,B=e.templateUUID,U=(0,D.i)().height,F=(E.Mz,(0,d.useRouter)()),G=(0,w.VI)(null,{},[],{uuid:"CustomTemplates/PipelineTemplateDetail"}),H=(0,i.Z)(G,1)[0],z=(0,c.useState)(!1),Q=z[0],K=z[1],q=(0,c.useState)(!1),Y=q[0],W=q[1],V=(0,c.useState)(M),X=V[0],J=V[1],$=(0,c.useCallback)((function(e){W(!0),J(e)}),[]),ee=(0,y.Z)(r);(0,c.useEffect)((function(){(null===ee||void 0===ee?void 0:ee.template_uuid)!==(null===r||void 0===r?void 0:r.template_uuid)&&J(r)}),[r,ee]);var ne=Z.ZP.pipelines.detail(o).data,te=(0,c.useMemo)((function(){return(null===r||void 0===r?void 0:r.pipeline)||(null===ne||void 0===ne?void 0:ne.pipeline)}),[ne,r]),oe=(0,c.useMemo)((function(){return(null===te||void 0===te?void 0:te.blocks)||[]}),[te]),ie=(0,c.useMemo)((function(){return!r&&!B}),[r,B]),re=(0,c.useState)(n?_.find((function(e){return e.uuid===(null===n||void 0===n?void 0:n.uuid)})):_[0]),le=re[0],ue=re[1],ce=(0,c.useMemo)((function(){return!!ie&&!(null!==X&&void 0!==X&&X.template_uuid)}),[ie,X]),ae=(0,c.useState)(!1),de=ae[0],se=ae[1],fe=(0,c.useState)(ie?400:300),pe=fe[0],ve=fe[1],me=(0,a.Db)(Z.ZP.custom_templates.useCreate(),{onSuccess:function(e){return(0,R.wD)(e,{callback:function(e){var n=e.custom_template;t&&(null===t||void 0===t||t()),K(!0),setTimeout((function(){F.push("/templates/[...slug]","/templates/".concat(encodeURIComponent(null===n||void 0===n?void 0:n.template_uuid),"?object_type=").concat(p.R))}),1)},onErrorCallback:function(e,n){return H({errors:n,response:e})}})}}),he=(0,i.Z)(me,2),be=he[0],ge=he[1].isLoading,xe=(0,a.Db)(Z.ZP.custom_templates.useUpdate(r?encodeURIComponent(null===r||void 0===r?void 0:r.template_uuid):B&&encodeURIComponent(B),{object_type:p.R}),{onSuccess:function(e){return(0,R.wD)(e,{callback:function(e){var n=e.custom_template;t&&(null===t||void 0===t||t()),null!==r&&void 0!==r&&r.template_uuid&&(null===n||void 0===n?void 0:n.template_uuid)!==(null===r||void 0===r?void 0:r.template_uuid)||B&&(null===n||void 0===n?void 0:n.template_uuid)!==B?F.replace("/templates/[...slug]","/templates/".concat(encodeURIComponent(null===n||void 0===n?void 0:n.template_uuid),"?object_type=").concat(p.R)):(J(n),W(!1),u.Am.success("Template successfully saved.",{position:u.Am.POSITION.BOTTOM_RIGHT,toastId:"custom_pipeline_template"}))},onErrorCallback:function(e,n){return H({errors:n,response:e})}})}}),je=(0,i.Z)(xe,2),Ce=je[0],Oe=je[1].isLoading,Ze=(0,c.useCallback)((function(){var e={custom_template:L(L({},X),{},{object_type:p.R})};ie?be(L(L({},e),{},{custom_template:L(L({},null===e||void 0===e?void 0:e.custom_template),{},{pipeline_uuid:o})})):Ce(e)}),[be,ie,o,X,Ce]),ke=(0,c.useMemo)((function(){return(0,N.jsxs)(h.ZP,{flexDirection:"column",fullHeight:!0,children:[(0,N.jsx)(I.Yf,{children:(0,N.jsx)(f.Z,{noPadding:!0,onClickTab:function(e){ue(e)},selectedTabUUID:null===le||void 0===le?void 0:le.uuid,tabs:_})}),(0,N.jsxs)(m.Z,{flexDirection:"column",children:[T.uuid===(null===le||void 0===le?void 0:le.uuid)&&(0,N.jsxs)(N.Fragment,{children:[o&&(0,N.jsx)(g.Z,{mt:P.cd,px:P.cd,children:(0,N.jsxs)(x.ZP,{default:!0,children:["This pipeline template will be based off the pipeline ",(0,N.jsx)(l(),{as:"/pipelines/".concat(o),href:"/pipelines/[pipeline]",passHref:!0,children:(0,N.jsx)(b.Z,{bold:!0,default:!0,inline:!0,monospace:!0,openNewWindow:!0,children:o})}),"."]})}),(0,N.jsxs)(g.Z,{mt:P.cd,px:P.cd,children:[(0,N.jsxs)(g.Z,{mb:1,children:[(0,N.jsx)(x.ZP,{bold:!0,children:"Template UUID"}),(0,N.jsx)(x.ZP,{muted:!0,small:!0,children:"Unique identifier for custom template. The UUID will also determine where the custom template file is stored in the project. You can use nested folder names in the template\u2019s UUID."})]}),(0,N.jsx)(C.Z,{monospace:!0,onChange:function(e){return $((function(n){return L(L({},n),{},{template_uuid:e.target.value})}))},placeholder:"e.g. some_template_name",primary:!0,setContentOnMount:!0,value:(null===X||void 0===X?void 0:X.template_uuid)||""})]})]}),S.uuid===(null===le||void 0===le?void 0:le.uuid)&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(g.Z,{mt:P.cd,px:P.cd,children:[(0,N.jsxs)(g.Z,{mb:1,children:[(0,N.jsx)(x.ZP,{bold:!0,children:"Name"}),(0,N.jsx)(x.ZP,{muted:!0,small:!0,children:"A human readable name for your template."})]}),(0,N.jsx)(C.Z,{onChange:function(e){return $((function(n){return L(L({},n),{},{name:e.target.value})}))},primary:!0,setContentOnMount:!0,value:(null===X||void 0===X?void 0:X.name)||""})]}),(0,N.jsx)(g.Z,{mt:P.cd,px:P.cd,children:(0,N.jsx)(j.Z,{label:"Description",onChange:function(e){return $((function(n){return L(L({},n),{},{description:e.target.value})}))},primary:!0,setContentOnMount:!0,value:(null===X||void 0===X?void 0:X.description)||""})})]})]}),(0,N.jsx)(I.ig,{children:(0,N.jsx)(g.Z,{p:P.cd,children:(0,N.jsx)(h.ZP,{children:(0,N.jsxs)(s.ZP,{disabled:ce,fullWidth:!0,loading:ge||Oe,onClick:function(){return Ze()},primary:!0,children:[!ie&&"Save template",ie&&"Create new template"]})})})})]})}),[ce,ge,Oe,ie,o,Ze,null===le||void 0===le?void 0:le.uuid,$,X]),ye=(0,k.Z)({shouldWarn:!Q&&Y,warningMessage:"You have unsaved changes. Are you sure you want to leave?"}).ConfirmLeaveModal;return(0,N.jsxs)(O.Z,{before:ke,beforeHidden:de,beforeWidth:pe,leftOffset:A.k1,setBeforeHidden:se,setBeforeWidth:ve,children:[(0,N.jsx)(ye,{}),(0,N.jsx)(v.ZP,{blocks:oe,height:U,heightOffset:E.Mz,noStatus:!0,pipeline:te})]})}},11302:function(e,n,t){t.d(n,{Nk:function(){return c},Yf:function(){return d},bC:function(){return a},ig:function(){return s},w5:function(){return f}});var o=t(38626),i=t(44897),r=t(70515),l=t(84649),u=(r.iI,40*r.iI),c=o.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-axgvn9-0"})(["height:100%;position:relative;"]),a=o.default.div.withConfig({displayName:"indexstyle__NavigationStyle",componentId:"sc-axgvn9-1"})(["overflow:auto;position:fixed;width:","px;z-index:1;"," "," ",""],u,(function(e){return"\n background-color: ".concat((e.theme.background||i.Z.background).panel,";\n border-right: 1px solid ").concat((e.theme.borders||i.Z.borders).light,";\n ")}),(function(e){return e.height&&"\n height: ".concat(e.height-l.n5,"px;\n ")}),(function(e){return!e.height&&"\n height: 100%;\n "})),d=o.default.div.withConfig({displayName:"indexstyle__TabsStyle",componentId:"sc-axgvn9-2"})(["padding-bottom:","px;padding-left:","px;padding-right:","px;padding-top:","px;width:100%;",""],1*r.iI,r.cd*r.iI,r.cd*r.iI,1*r.iI,(function(e){return"\n border-bottom: 1px solid ".concat((e.theme.borders||i.Z.borders).light,";\n ")})),s=o.default.div.withConfig({displayName:"indexstyle__ButtonsStyle",componentId:"sc-axgvn9-3"})(["margin-top:","px;width:100%;",""],r.cd*r.iI,(function(e){return"\n border-top: 1px solid ".concat((e.theme.borders||i.Z.borders).light,";\n ")})),f=o.default.div.withConfig({displayName:"indexstyle__ContentStyle",componentId:"sc-axgvn9-4"})(["margin-left:","px;"],u)},5755:function(e,n,t){t.d(n,{Z:function(){return K}});var o=t(82394),i=t(75582),r=t(56085),l=t(82684),u=t(65701),c=t(1254),a=t(21764),d=t(69864),s=t(34376),f=t(40761),p=t(71180),v=t(90299),m=t(9189),h=t(44898),b=t(97618),g=t(55485),x=t(38276),j=t(44085),C=t(30160),O=t(35576),Z=t(17488),k=t(35686),y=t(94777),E=t(98464),T=t(44425),S=t(11302),_=t(48339),P=t(39643),I={uuid:"Define"},A={uuid:"Document"},R=[I,A],w=t(11498),D=t(70515),N=t(57653),M=t(4383),L=t(72619),B=t(42041),U=t(23780),F=t(44688),G=t(19183),H=t(28598);function z(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function Q(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,o.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 K=function(e){var n=e.contained,t=e.defaultTab,z=e.heightOffset,K=e.onCancel,q=e.onCreateCustomTemplate,Y=e.onMutateSuccess,W=e.template,V=e.templateAttributes,X=e.templateUUID,J=(0,G.i)().height,$=(0,s.useRouter)(),ee=(0,U.VI)(null,{},[],{uuid:"CustomTemplates/TemplateDetail"}),ne=(0,i.Z)(ee,1)[0],te=(0,l.useState)(Number(new Date)),oe=te[0],ie=te[1],re=(0,l.useState)(!1),le=re[0],ue=re[1],ce=(0,l.useState)(!1),ae=ce[0],de=ce[1],se=(0,l.useState)(t?R.find((function(e){return e.uuid===(null===t||void 0===t?void 0:t.uuid)})):R[0]),fe=se[0],pe=se[1],ve=(0,l.useState)(!1),me=ve[0],he=ve[1],be=(0,l.useState)(V),ge=be[0],xe=be[1],je=(0,l.useCallback)((function(e){he(!0),xe(e)}),[]),Ce=k.ZP.custom_templates.detail(!W&&X&&encodeURIComponent(X),{object_type:h.Z}).data,Oe=(0,l.useMemo)((function(){return W||(null===Ce||void 0===Ce?void 0:Ce.custom_template)}),[Ce,W]),Ze=(0,E.Z)(Oe);(0,l.useEffect)((function(){(null===Ze||void 0===Ze?void 0:Ze.template_uuid)!==(null===Oe||void 0===Oe?void 0:Oe.template_uuid)&&(ie(Number(new Date)),xe(Oe),de(!0))}),[Oe,Ze]);var ke=(0,d.Db)(k.ZP.custom_templates.useCreate(),{onSuccess:function(e){return(0,L.wD)(e,{callback:function(e){var n=e.custom_template;Y&&(null===Y||void 0===Y||Y()),q?null===q||void 0===q||q(n):(ue(!0),setTimeout((function(){$.push("/templates/[...slug]","/templates/".concat(encodeURIComponent(null===n||void 0===n?void 0:n.template_uuid)))}),1))},onErrorCallback:function(e,n){return ne({errors:n,response:e})}})}}),ye=(0,i.Z)(ke,2),Ee=ye[0],Te=ye[1].isLoading,Se=(0,d.Db)(k.ZP.custom_templates.useUpdate(W?encodeURIComponent(null===W||void 0===W?void 0:W.template_uuid):X&&encodeURIComponent(X),{object_type:h.Z}),{onSuccess:function(e){return(0,L.wD)(e,{callback:function(e){var n=e.custom_template;Y&&(null===Y||void 0===Y||Y()),xe(n),he(!1),a.Am.success("Template successfully saved.",{position:a.Am.POSITION.BOTTOM_RIGHT,toastId:"custom_block_template"})},onErrorCallback:function(e,n){return ne({errors:n,response:e})}})}}),_e=(0,i.Z)(Se,2),Pe=_e[0],Ie=_e[1].isLoading,Ae=(0,l.useMemo)((function(){return T.tf.MARKDOWN===(null===ge||void 0===ge?void 0:ge.block_type)}),[null===ge||void 0===ge?void 0:ge.block_type]),Re=!W&&!X,we=(0,l.useMemo)((function(){return!!Re&&(!(null!==ge&&void 0!==ge&&ge.template_uuid)||!(null!==ge&&void 0!==ge&&ge.block_type)||!Ae&&!(null!==ge&&void 0!==ge&&ge.language))}),[Ae,Re,ge]),De=k.ZP.kernels.list({},{refreshInterval:5e3,revalidateOnFocus:!0}),Ne=De.data,Me=De.mutate,Le=null===Ne||void 0===Ne?void 0:Ne.kernels,Be=(null===Le||void 0===Le?void 0:Le.find((function(e){return e.name===N.a_[N.qL.PYTHON]})))||(null===Le||void 0===Le?void 0:Le[0]),Ue=(0,d.Db)(k.ZP.kernels.useUpdate(null===Be||void 0===Be?void 0:Be.id),{onSuccess:function(e){return(0,L.wD)(e,{callback:function(){return Me()},onErrorCallback:function(e,n){return ne({errors:n,response:e})}})}}),Fe=(0,i.Z)(Ue,1)[0],Ge=(0,l.useCallback)((function(){Fe({kernel:{action_type:"interrupt"}}),Ye([])}),[Fe]),He=(0,l.useState)({}),ze=He[0],Qe=He[1],Ke=(0,l.useState)([]),qe=Ke[0],Ye=Ke[1],We=(0,l.useMemo)((function(){return{language:null===ge||void 0===ge?void 0:ge.language,name:null===ge||void 0===ge?void 0:ge.name,type:null===ge||void 0===ge?void 0:ge.block_type,uuid:null===ge||void 0===ge?void 0:ge.template_uuid}}),[ge]),Ve=(0,l.useMemo)((function(){return new f.Z}),[]),Xe=(0,l.useMemo)((function(){return{api_key:w.l,token:Ve.decodedToken.token}}),[Ve]),Je=(0,r.ZP)((0,M.Ib)(),{onClose:function(){return console.log("socketUrlPublish closed")},onMessage:function(e){if(e){var n=JSON.parse(e.data),t=n.execution_state,i=n.uuid;if(!i)return;Qe((function(e){var t=e[i]||[];return Q(Q({},e),{},(0,o.Z)({},i,t.concat(n)))})),_.uF.BUSY===t?Ye((function(e){return e.find((function(e){var n=e.uuid;return i===n}))||!We?e:e.concat(We)})):_.uF.IDLE===t&&Ye((function(e){return e.filter((function(e){var n=e.uuid;return i!==n}))}))}},onOpen:function(){return console.log("socketUrlPublish opened")},reconnectAttempts:10,reconnectInterval:3e3,shouldReconnect:function(){return console.log("Attempting to reconnect..."),!0}}).sendMessage,$e=(0,l.useCallback)((function(e){var n=e.block,t=e.code,o=e.ignoreAlreadyRunning,i=e.runDownstream,r=void 0!==i&&i,l=e.runIncompleteUpstream,u=void 0!==l&&l,c=e.runSettings,a=void 0===c?{}:c,d=e.runTests,s=void 0!==d&&d,f=e.runUpstream,p=n.extension_uuid,v=n.upstream_blocks,m=n.uuid;qe.find((function(e){var n=e.uuid;return m===n}))&&!o||(Je(JSON.stringify(Q(Q({},Xe),{},{code:t,extension_uuid:p,run_downstream:r,run_incomplete_upstream:u,run_settings:a,run_tests:s,run_upstream:f,type:n.type,upstream_blocks:v,uuid:m}))),Qe((function(e){return delete e[m],e})),Ye((function(e){return e.find((function(e){var n=e.uuid;return m===n}))?e:e.concat(n)})))}),[qe,Je,Qe,Ye,Xe]),en=(0,l.useMemo)((function(){return qe.reduce((function(e,n,t){return Q(Q({},e),{},(0,o.Z)({},n.uuid,Q(Q({},n),{},{priority:t})))}),{})}),[qe]),nn=(0,l.useMemo)((function(){if(!ae)return(0,H.jsx)("div",{});var e=en[null===We||void 0===We?void 0:We.uuid],n=e?0===e.priority?_.uF.BUSY:_.uF.QUEUED:_.uF.IDLE;return(0,H.jsx)(m.Z,{block:We,defaultValue:null===ge||void 0===ge?void 0:ge.content,disableDrag:!0,executionState:n,hideExtraCommandButtons:!0,hideExtraConfiguration:!0,hideHeaderInteractiveInformation:!0,interruptKernel:Ge,messages:null===ze||void 0===ze?void 0:ze[null===We||void 0===We?void 0:We.uuid],noDivider:!0,onChange:function(e){return je((function(n){return Q(Q({},n),{},{content:e})}))},runBlock:$e,runningBlocks:qe,selected:!0,setErrors:ne,textareaFocused:!0},String(oe))}),[We,oe,Ge,ze,ae,$e,qe,en,je,ne,ge]),tn=(0,l.useCallback)((function(){var e={custom_template:Q(Q({},ge),{},{language:Ae?T.t6.MARKDOWN:null===ge||void 0===ge?void 0:ge.language,object_type:h.Z})};Re?Ee(e):Pe(e)}),[Ee,Ae,Re,ge,Pe]),on="CustomTemplates/TemplateDetail",rn=(0,F.y)(),ln=rn.registerOnKeyDown,un=rn.unregisterOnKeyDown;(0,l.useEffect)((function(){return function(){un(on)}}),[un,on]),ln(on,(function(e,n){if(me&&(0,B.y)([P.zX,P.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()}else((0,B.y)([P.zX,P.Um],n)||(0,B.y)([P.PQ,P.Um],n))&&(e.preventDefault(),tn())}),[tn,me]);var cn=(0,l.useMemo)((function(){return J-z}),[J,z]),an=(0,y.Z)({shouldWarn:!le&&me,warningMessage:"You have unsaved changes. Are you sure you want to leave?"}).ConfirmLeaveModal;return(0,H.jsxs)(S.Nk,{children:[(0,H.jsx)(an,{}),(0,H.jsx)(S.bC,{height:n?cn:null,children:(0,H.jsxs)(g.ZP,{flexDirection:"column",fullHeight:!0,children:[(0,H.jsx)(S.Yf,{children:(0,H.jsx)(v.Z,{noPadding:!0,onClickTab:function(e){pe(e)},selectedTabUUID:null===fe||void 0===fe?void 0:fe.uuid,tabs:Re?R.slice(0,1):R})}),(0,H.jsxs)(b.Z,{flexDirection:"column",children:[I.uuid===(null===fe||void 0===fe?void 0:fe.uuid)&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(x.Z,{mt:D.cd,px:D.cd,children:[(0,H.jsxs)(x.Z,{mb:1,children:[(0,H.jsx)(C.ZP,{bold:!0,children:"Template UUID"}),(0,H.jsx)(C.ZP,{muted:!0,small:!0,children:"Unique identifier for custom template. The UUID will also determine where the custom template file is stored in the project. You can use nested folder names in the template\u2019s UUID."})]}),(0,H.jsx)(Z.Z,{monospace:!0,onChange:function(e){return je((function(n){return Q(Q({},n),{},{template_uuid:e.target.value})}))},placeholder:"e.g. some_template_name",primary:!0,setContentOnMount:!0,value:(null===ge||void 0===ge?void 0:ge.template_uuid)||""})]}),(0,H.jsx)(x.Z,{mt:D.cd,px:D.cd,children:(0,H.jsx)(j.Z,{label:"Block type",onChange:function(e){return je((function(n){return Q(Q({},n),{},{block_type:e.target.value,language:T.tf.MARKDOWN===e.target.value?T.t6.MARKDOWN:null===n||void 0===n?void 0:n.language})}))},primary:!0,value:(null===ge||void 0===ge?void 0:ge.block_type)||"",children:Object.values(T.tf).map((function(e){return(0,H.jsx)("option",{value:e,children:T.V4[e]},e)}))})}),!Ae&&(0,H.jsx)(x.Z,{mt:D.cd,px:D.cd,children:(0,H.jsx)(j.Z,{label:"Language",onChange:function(e){return je((function(n){return Q(Q({},n),{},{language:e.target.value})}))},primary:!0,value:(null===ge||void 0===ge?void 0:ge.language)||"",children:Object.values(T.t6).map((function(e){return(0,H.jsx)("option",{value:e,children:T.LE[e]},e)}))})})]}),A.uuid===(null===fe||void 0===fe?void 0:fe.uuid)&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(x.Z,{mt:D.cd,px:D.cd,children:[(0,H.jsxs)(x.Z,{mb:1,children:[(0,H.jsx)(C.ZP,{bold:!0,children:"Name"}),(0,H.jsx)(C.ZP,{muted:!0,small:!0,children:"A human readable name for your template."})]}),(0,H.jsx)(Z.Z,{onChange:function(e){return je((function(n){return Q(Q({},n),{},{name:e.target.value})}))},primary:!0,setContentOnMount:!0,value:(null===ge||void 0===ge?void 0:ge.name)||""})]}),(0,H.jsx)(x.Z,{mt:D.cd,px:D.cd,children:(0,H.jsx)(O.Z,{label:"Description",onChange:function(e){return je((function(n){return Q(Q({},n),{},{description:e.target.value})}))},primary:!0,setContentOnMount:!0,value:(null===ge||void 0===ge?void 0:ge.description)||""})})]})]}),(0,H.jsx)(S.ig,{children:(0,H.jsx)(x.Z,{p:D.cd,children:(0,H.jsxs)(g.ZP,{children:[(0,H.jsxs)(p.ZP,{disabled:we,fullWidth:!0,loading:Te||Ie,onClick:function(){return tn()},primary:!0,children:[!Re&&"Save template",Re&&"Create new template"]}),K&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(x.Z,{mr:1}),(0,H.jsx)(p.ZP,{onClick:K,secondary:!0,children:"Cancel"})]})]})})})]})}),(0,H.jsx)(S.w5,{children:(0,H.jsx)(x.Z,{p:D.cd,children:(0,H.jsx)(u.W,{backend:c.PD,children:nn})})})]})}},99236:function(e,n,t){var o=t(55485),i=t(75499),r=t(30160),l=t(72473),u=t(55283),c=t(28598);n.Z=function(e){var n=e.inputsBlocks;return(0,c.jsx)(i.Z,{columnFlex:[null,1,null,1,null],columns:[{uuid:"Position"},{uuid:"Block"},{center:!0,uuid:"Catalog"},{center:!0,uuid:"Streams"},{rightAligned:!0,uuid:"Argument shape"}],rows:null===n||void 0===n?void 0:n.map((function(e,n){var t=e.block,i=t.color,a=t.type,d=t.uuid,s=e.input,f=s.catalog,p=s.streams,v=(null===p||void 0===p?void 0:p.length)>=1,m=(0,u.qn)(a,{blockColor:i}).accent;return[(0,c.jsx)(r.ZP,{default:!0,monospace:!0,children:n},"position-".concat(d)),(0,c.jsx)(r.ZP,{color:m,monospace:!0,children:d},"block-".concat(d)),(0,c.jsx)(o.ZP,{justifyContent:"center",children:f?(0,c.jsx)(l.Jr,{success:!0}):(0,c.jsx)(l.x8,{muted:!0})},"catalog-".concat(d)),(0,c.jsxs)(o.ZP,{justifyContent:"center",children:[!v&&(0,c.jsx)(l.x8,{muted:!0},"catalog-".concat(d)),v&&null!==p&&void 0!==p&&p.includes(d)?(0,c.jsx)(l.Jr,{success:!0}):(0,c.jsx)(r.ZP,{center:!0,default:!0,monospace:!0,small:!0,children:null===p||void 0===p?void 0:p.join(", ")})]},"selected-streams-".concat(d)),(0,c.jsxs)(r.ZP,{default:!0,monospace:!0,rightAligned:!0,children:[f&&!v&&"Dict",!f&&v&&"Union[Dict, pd.DataFrame]",f&&v&&"Tuple[Union[Dict, pd.DataFrame], Dict]"]},"shape-".concat(d))]}))})}},37443:function(e,n,t){t.d(n,{C0:function(){return v},Pf:function(){return f},TD:function(){return s},mU:function(){return d},oI:function(){return l},tw:function(){return a},uK:function(){return u}});var o,i,r,l,u,c=t(82394);!function(e){e.CHECKBOX="checkbox",e.CUSTOM="custom",e.SELECT="select",e.TOGGLE="toggle"}(l||(l={})),function(e){e.CONFIGURATION="configuration",e.OVERVIEW="overview",e.STREAMS="streams",e.SYNC="sync"}(u||(u={}));var a,d=(o={},(0,c.Z)(o,u.CONFIGURATION,u.CONFIGURATION),(0,c.Z)(o,u.OVERVIEW,u.OVERVIEW),(0,c.Z)(o,u.STREAMS,u.STREAMS),(0,c.Z)(o,u.SYNC,u.SYNC),o),s=(i={},(0,c.Z)(i,u.CONFIGURATION,"Configuration"),(0,c.Z)(i,u.OVERVIEW,"Overview"),(0,c.Z)(i,u.STREAMS,"Streams"),(0,c.Z)(i,u.SYNC,"Sync"),i);!function(e){e.BOOKMARKS="bookmarks",e.CREDENTIALS="credentials",e.OVERVIEW="overview",e.SAMPLE_DATA="sample_data",e.SETTINGS="settings",e.STREAM_CONFLICTS="stream_conflicts",e.UPSTREAM_BLOCK_SETTINGS="upstream_block_settings"}(a||(a={}));var f=(r={},(0,c.Z)(r,u.CONFIGURATION,[{label:function(){return"Credentials"},uuid:a.CREDENTIALS},{label:function(){return"Upstream block settings"},uuid:a.UPSTREAM_BLOCK_SETTINGS}]),(0,c.Z)(r,u.SYNC,[{label:function(){return"Bookmarks"},uuid:a.BOOKMARKS}]),(0,c.Z)(r,u.STREAMS,[]),(0,c.Z)(r,u.OVERVIEW,[]),r),p={label:function(){return"Schema property conflicts"},uuid:a.STREAM_CONFLICTS};function v(e){var n=[{label:function(){return"Overview"},uuid:a.OVERVIEW},{label:function(){return"Schema properties"},uuid:a.SETTINGS}];return null!==e&&void 0!==e&&e.addStreamConflicts&&n.push(p),n.push({label:function(){return"Sample data"},uuid:a.SAMPLE_DATA}),n}},75634:function(e,n,t){t.d(n,{W4:function(){return s},Wx:function(){return d},ZG:function(){return a}});var o=t(38626),i=t(44897),r=t(44425),l=t(42631),u=t(70515),c=t(55283),a=u.cd*u.iI,d=o.default.div.withConfig({displayName:"indexstyle__IconContainerStyle",componentId:"sc-oyfjzc-0"})(["align-items:center;border-radius:","px;border:1px solid transparent;display:flex;justify-content:center;"," "," "," "," "," "," "," "," "," ",""],l.BG,(function(e){return e.border&&"\n border: 1px dotted ".concat((e.theme.content||i.Z.content).active,";\n ")}),(function(e){return e.grey&&"\n background-color: ".concat((0,c.qn)(r.tf.SCRATCHPAD,e).accent,";\n ")}),(function(e){return e.blue&&"\n background-color: ".concat((0,c.qn)(r.tf.DATA_LOADER,e).accent,";\n ")}),(function(e){return e.purple&&"\n background-color: ".concat((0,c.qn)(r.tf.TRANSFORMER,e).accent,";\n ")}),(function(e){return e.sky&&"\n background-color: ".concat((0,c.qn)(r.tf.MARKDOWN,e).accent,";\n ")}),(function(e){return e.teal&&"\n background-color: ".concat((0,c.qn)(r.tf.EXTENSION,e).accent,";\n ")}),(function(e){return e.rose&&"\n background-color: ".concat((0,c.qn)(r.tf.CALLBACK,e).accent,";\n ")}),(function(e){return e.yellow&&"\n background-color: ".concat((0,c.qn)(r.tf.DATA_EXPORTER,e).accent,";\n ")}),(function(e){return!e.compact&&"\n height: ".concat(a+u.iI/2,"px;\n width: ").concat(a+u.iI/2,"px;\n ")}),(function(e){return e.compact&&"\n height: ".concat(a/2+u.iI,"px;\n width: ").concat(a/2+u.iI,"px;\n ")})),s=o.default.div.withConfig({displayName:"indexstyle__ButtonWrapper",componentId:"sc-oyfjzc-1"})(["position:relative;margin-bottom:","px;margin-right:","px;",""],u.iI,u.iI,(function(e){return e.increasedZIndex&&"\n z-index: 3;\n "}))},57271:function(e,n,t){t.d(n,{Z:function(){return ge}});var o=t(82394),i=t(21831),r=t(82684),l=t(75582),u=t(69864),c=t(27277),a=t(2548),d=t(71180),s=t(50724),f=t(97618),p=t(55485),v=t(46732),m=t(49130),h=t(48670),b=t(28598);var g=function(e){var n=e.fill,t=void 0===n?"white":n,o=e.size;return(0,b.jsxs)("svg",{fill:"none",height:o,viewBox:"0 0 20 21",width:o,xmlns:"http://www.w3.org/2000/svg",children:[(0,b.jsx)("g",{clipPath:"url(#clip0_11802_82284)",children:(0,b.jsx)("path",{clipRule:"evenodd",d:"M10 20.0024C15.5228 20.0024 20 15.5253 20 10.0024C20 4.47959 15.5228 0.00244141 10 0.00244141C4.47715 0.00244141 0 4.47959 0 10.0024C0 15.5253 4.47715 20.0024 10 20.0024ZM10 18.5024C11.5782 18.5024 13.0559 18.0723 14.3224 17.323C14.3144 17.3061 14.307 17.2888 14.3002 17.2712L11.5045 10.0024H8.49587L5.70021 17.2712C5.69339 17.2889 5.68596 17.3062 5.67796 17.3231C6.94434 18.0724 8.42195 18.5024 10 18.5024ZM11.6336 6.15938L15.5784 16.416C17.3685 14.8577 18.5 12.5622 18.5 10.0024C18.5 5.30802 14.6944 1.50244 10 1.50244C5.30558 1.50244 1.5 5.30802 1.5 10.0024C1.5 12.5623 2.63162 14.8579 4.4219 16.4163L8.36685 6.15939C8.94212 4.66367 11.0583 4.66367 11.6336 6.15938Z",fill:t,fillRule:"evenodd"})}),(0,b.jsx)("defs",{children:(0,b.jsx)("clipPath",{id:"clip0_11802_82284",children:(0,b.jsx)("rect",{fill:t,height:"20",transform:"translate(0 0.00244141)",width:"20"})})})]})},x=t(65956),j=t(91835),C=t(45373),O=t(63403),Z=t(72473);function k(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function y(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?k(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):k(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var E,T=function(e){var n=(0,j.Z)({},e),t=(null===n||void 0===n?void 0:n.size)||O.C,o=(0,Z.J_)([{clipRule:"evenodd",d:"M15.4697 1.47202C16.3149 0.62684 17.6852 0.62684 18.5304 1.47202C19.3756 2.3172 19.3756 3.6875 18.5304 4.53268L10.7445 12.3186C10.5002 12.5629 10.1891 12.7294 9.85027 12.7972L9.11804 12.9436C7.89353 13.1885 6.81392 12.1089 7.05882 10.8844L7.20527 10.1522C7.27302 9.81337 7.43954 9.50222 7.68384 9.25792L15.4697 1.47202ZM17.4697 2.53268C17.2104 2.27329 16.7898 2.27329 16.5304 2.53268L14.7522 4.31085L15.6916 5.25019L17.4697 3.47202C17.7291 3.21263 17.7291 2.79207 17.4697 2.53268ZM14.6309 6.31085L13.6916 5.37151L8.7445 10.3186C8.7096 10.3535 8.68582 10.3979 8.67614 10.4463L8.52969 11.1786C8.4947 11.3535 8.64893 11.5077 8.82386 11.4727L9.5561 11.3263C9.60449 11.3166 9.64894 11.2928 9.68384 11.2579L14.6309 6.31085Z",fillRule:"evenodd"},{clipRule:"evenodd",d:"M2.12221 16.4212C1.89178 16.7635 1.42775 16.8555 1.08405 16.6264C0.739408 16.3966 0.646278 15.931 0.876042 15.5863L1.50008 16.0023C0.876042 15.5863 0.87632 15.5859 0.876609 15.5855L0.877248 15.5845L0.878742 15.5823L0.882593 15.5766L0.893746 15.5605C0.902714 15.5476 0.914758 15.5306 0.929868 15.51C0.96007 15.4687 1.00264 15.4126 1.05749 15.345C1.16699 15.2102 1.32669 15.0283 1.53609 14.8278C1.95274 14.4289 2.58034 13.9427 3.41428 13.6164C5.14688 12.9384 7.5533 13.0314 10.475 15.4219C13.0533 17.5314 14.8969 17.4384 16.0393 16.9914C16.6428 16.7552 17.109 16.3976 17.4267 16.0934C17.5845 15.9424 17.7021 15.8078 17.7782 15.7142C17.8161 15.6675 17.8434 15.6313 17.8598 15.6089C17.868 15.5977 17.8735 15.5899 17.8762 15.586C17.8769 15.585 17.8774 15.5843 17.8777 15.5838L17.877 15.5849C18.1069 15.2409 18.5717 15.1487 18.9161 15.3783C19.2608 15.6081 19.3539 16.0737 19.1241 16.4184L18.5001 16.0023C19.1241 16.4184 19.1238 16.4188 19.1236 16.4192L19.1229 16.4202L19.1214 16.4224L19.1176 16.4281L19.1064 16.4442C19.0974 16.4571 19.0854 16.4741 19.0703 16.4947C19.0401 16.536 18.9975 16.5921 18.9427 16.6597C18.8332 16.7945 18.6735 16.9764 18.4641 17.1769C18.0474 17.5758 17.4198 18.062 16.5859 18.3883C14.8533 19.0663 12.4469 18.9733 9.52515 16.5828C6.94686 14.4733 5.10328 14.5663 3.96088 15.0133C3.35732 15.2495 2.89117 15.6071 2.57345 15.9113C2.41566 16.0623 2.29802 16.1969 2.22197 16.2905C2.18405 16.3372 2.15679 16.3734 2.14036 16.3958C2.13215 16.407 2.12668 16.4148 2.12396 16.4187C2.12332 16.4196 2.12254 16.4207 2.12221 16.4212ZM2.12221 16.4212C2.1222 16.4212 2.12221 16.4212 2.12221 16.4212V16.4212Z",fillRule:"evenodd"}],{viewBox:"0 0 20 21"});return(0,b.jsxs)(C.ZP,y(y({},n),{},{size:t,viewBox:null,children:[(0,b.jsx)("g",{clipPath:"url(#clip0_11826_796)",id:"Type / Scratchpad",children:(0,b.jsx)("g",{id:"Vector",children:o(y(y({},n),{},{size:t}))})}),(0,b.jsx)("defs",{children:(0,b.jsx)("clipPath",{id:"clip0_11826_796",children:(0,b.jsx)("rect",{fill:"white",height:"20",transform:"translate(0 0.00244141)",width:"20"})})})]}))};!function(e){e.BLOCK_ACTION_OBJECTS="block_action_objects"}(E||(E={}));var S=t(38276),_=t(30160),P=t(17488),I=t(12468),A=t(35686),R=t(44425),w=t(32929),D=t(38626),N=t(44897),M=t(42631),L=t(70515),B=t(47041),U=t(91437),F=L.cd*L.iI,G=D.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-1mqygp5-0"})([""," border-radius:","px;"," "," "," "," ",""],(0,U.eR)(),M.n_,(function(e){return"\n background-color: ".concat((e.theme.background||N.Z.background).dashboard,";\n box-shadow: ").concat((e.theme.shadow||N.Z.shadow).frame,";\n ")}),(function(e){return!e.focused&&"\n border: 1px solid ".concat((e.theme.interactive||N.Z.interactive).defaultBorder,";\n ")}),(function(e){return e.focused&&"\n border: 1px solid ".concat((e.theme.interactive||N.Z.interactive).hoverBorder,";\n ")}),(function(e){return!e.compact&&"\n padding-left: ".concat(2.5*L.iI,"px;\n padding-right: ").concat(2.5*L.iI,"px;\n ")}),(function(e){return e.compact&&"\n padding-left: ".concat(1.5*L.iI,"px;\n padding-right: ").concat(1.5*L.iI,"px;\n ")})),H=D.default.div.withConfig({displayName:"indexstyle__DividerStyle",componentId:"sc-1mqygp5-1"})(["height:","px;width:1px;",""],F,(function(e){return"\n background-color: ".concat((e.theme.interactive||N.Z.interactive).defaultBorder,";\n ")})),z=D.default.div.withConfig({displayName:"indexstyle__ButtonWrapper",componentId:"sc-1mqygp5-2"})(["position:relative;"," "," ",""],(function(e){return e.increasedZIndex&&"\n z-index: 3;\n "}),(function(e){return!e.compact&&"\n margin-bottom: ".concat(2.5*L.iI,"px;\n margin-top: ").concat(2.5*L.iI,"px;\n ")}),(function(e){return e.compact&&"\n margin-bottom: ".concat(1.5*L.iI,"px;\n margin-top: ").concat(1.5*L.iI,"px;\n ")})),Q=D.default.div.withConfig({displayName:"indexstyle__TextInputFocusAreaStyle",componentId:"sc-1mqygp5-3"})(["width:100%;&:hover{cursor:text;}"," ",""],(function(e){return!e.compact&&"\n height: ".concat(2.5*L.iI,"px;\n ")}),(function(e){return e.compact&&"\n height: ".concat(1.5*L.iI,"px;\n ")})),K=D.default.div.withConfig({displayName:"indexstyle__SearchStyle",componentId:"sc-1mqygp5-4"})(["position:relative;width:100%;"]),q=D.default.div.withConfig({displayName:"indexstyle__DropdownStyle",componentId:"sc-1mqygp5-5"})([""," border-radius:","px;max-height:","px;overflow:auto;position:absolute;width:100%;z-index:1;"," ",""],B.w5,M.BG,40*L.iI,(function(e){return"\n background-color: ".concat((e.theme.background||N.Z.background).popup,";\n box-shadow: ").concat((e.theme.shadow||N.Z.shadow).popup,";\n ")}),(function(e){return e.topOffset&&"\n top: ".concat(e.topOffset,"px;\n ")})),Y=D.default.div.withConfig({displayName:"indexstyle__RowStyle",componentId:"sc-1mqygp5-6"})(["align-items:center;display:flex;justify-content:space-between;padding:","px ","px;position:relative;z-index:2;&:hover{cursor:pointer;}",""],1.5*L.iI,2.5*L.iI,(function(e){return e.highlighted&&"\n background-color: ".concat((e.theme.interactive||N.Z.interactive).hoverBackground,";\n ")})),W=t(39643),V=t(78419),X=t(13803),J=t(81728),$=t(53808),ee=t(55283),ne=t(38399),te=t(72619),oe=t(3314),ie=t(23780),re=t(44688);function le(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function ue(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?le(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):le(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ce=function(e){var n,t,i=e.addNewBlock,j=e.blockIdx,C=e.blockTemplatesByBlockType,O=e.compact,k=e.focused,y=e.itemsDBT,D=e.pipelineType,N=e.project,M=e.searchTextInputRef,B=e.setAddNewBlockMenuOpenIdx,U=e.setFocused,le=e.showBrowseTemplates,ce=e.showConfigureProjectModal,ae=e.showGlobalDataProducts,de=(0,r.useRef)(null),se=(0,r.useRef)(null),fe=(0,r.useRef)(null),pe=(0,r.useRef)(null),ve="undefined"!==typeof M?M:pe,me=(0,r.useMemo)((function(){return"AddNewBlocksV2/".concat(j)}),[j]),he=(0,ie.VI)(null,{},[],{uuid:"AddNewBlocksV2/".concat(j)}),be=(0,l.Z)(he,1)[0],ge=(0,r.useState)(null),xe=ge[0],je=ge[1],Ce=(0,r.useState)(!1),Oe=Ce[0],Ze=Ce[1],ke=(0,r.useState)(null),ye=ke[0],Ee=ke[1],Te=(0,r.useState)(null),Se=Te[0],_e=Te[1],Pe=(0,r.useState)(null),Ie=Pe[0],Ae=Pe[1],Re=(0,r.useCallback)((function(e){Ae(e),(0,$.t8)(V.Ch,e)}),[]);(0,r.useEffect)((function(){if(null===Ie){var e=(0,$.U2)(V.Ch,!1);Re(e)}}),[Re,Ie]);var we=(0,r.useMemo)((function(){return"undefined"!==typeof k?k:Oe}),[k,Oe]),De=(0,r.useCallback)((function(e){return"undefined"!==typeof U?U(e):Ze(e)}),[U,Ze]),Ne=(0,re.y)(),Me=Ne.registerOnKeyDown,Le=Ne.unregisterOnKeyDown;(0,r.useEffect)((function(){return function(){return Le(me)}}),[Le,me]),null===Me||void 0===Me||Me(me,(function(e,n){var t;we&&(n[W.vP]&&(De(!1),null===ve||void 0===ve||null===(t=ve.current)||void 0===t||t.blur()))}),[we,ve]);var Be=(0,r.useCallback)((function(){return je(null)}),[]),Ue=(0,r.useCallback)((function(e){return null===B||void 0===B?void 0:B((function(n){return null===n||xe!==e?j:null}))}),[j,xe,B]),Fe=(0,r.useMemo)((function(){var e,n;return null===(e=(0,ne.hr)(i,R.tf.DATA_LOADER,D,{blockTemplatesByBlockType:C,v2:!0}))||void 0===e||null===(n=e.find((function(e){return e.uuid==="".concat(R.tf.DATA_LOADER,"/").concat(R.t6.PYTHON)})))||void 0===n?void 0:n.items}),[i,C,D]),Ge=(0,r.useMemo)((function(){var e,n;return null===(e=(0,ne.hr)(i,R.tf.DATA_LOADER,D,{blockTemplatesByBlockType:C,dataIntegrationType:X.O.SOURCES,v2:!0}))||void 0===e||null===(n=e.find((function(e){return e.uuid==="".concat(R.tf.DATA_LOADER,"/").concat(X.O.SOURCES)})))||void 0===n?void 0:n.items}),[i,C,D]),He=(0,r.useMemo)((function(){var e,n;return null===(e=(0,ne.hr)(i,R.tf.DATA_EXPORTER,D,{blockTemplatesByBlockType:C,v2:!0}))||void 0===e||null===(n=e.find((function(e){return e.uuid==="".concat(R.tf.DATA_EXPORTER,"/").concat(R.t6.PYTHON)})))||void 0===n?void 0:n.items}),[i,C,D]),ze=(0,r.useMemo)((function(){var e,n;return null===(e=(0,ne.hr)(i,R.tf.DATA_EXPORTER,D,{blockTemplatesByBlockType:C,dataIntegrationType:X.O.DESTINATIONS,v2:!0}))||void 0===e||null===(n=e.find((function(e){return e.uuid==="".concat(R.tf.DATA_EXPORTER,"/").concat(X.O.DESTINATIONS)})))||void 0===n?void 0:n.items}),[i,C,D]),Qe=(0,r.useMemo)((function(){var e,n;return null===(e=(0,ne.hr)(i,R.tf.TRANSFORMER,D,{blockTemplatesByBlockType:C,v2:!0}))||void 0===e||null===(n=e.find((function(e){return e.uuid==="".concat(R.tf.TRANSFORMER,"/").concat(R.t6.PYTHON)})))||void 0===n?void 0:n.items}),[i,C,D]),Ke=(0,r.useMemo)((function(){var e,n;return null===(e=(0,ne.hr)(i,R.tf.SENSOR,D,{blockTemplatesByBlockType:C,v2:!0}))||void 0===e||null===(n=e.find((function(e){return e.uuid==="".concat(R.tf.SENSOR,"/").concat(R.t6.PYTHON)})))||void 0===n?void 0:n.items}),[i,C,D]),qe=(0,r.useCallback)((function(e){return[{isGroupingTitle:!0,label:function(){return"SQL"},uuid:"".concat(R.t6.SQL,"/").concat(e,"/group")},{label:function(){return"Base template (generic)"},onClick:function(){i({language:R.t6.SQL,type:e})},uuid:"".concat(R.t6.SQL,"/").concat(e,"/Base template (generic)")},{isGroupingTitle:!0,label:function(){return"R"},uuid:"".concat(R.t6.R,"/").concat(e,"/group")},{label:function(){return"Base template (generic)"},onClick:function(){i({language:R.t6.R,type:e})},uuid:"".concat(R.t6.R,"/").concat(e,"/Base template (generic)")}]}),[i]),Ye=(0,r.useMemo)((function(){var e=[{isGroupingTitle:!0,label:function(){return"Python"},uuid:"".concat(R.t6.PYTHON).concat(R.tf.DATA_LOADER,"/group")}].concat(Fe).concat(qe(R.tf.DATA_LOADER));Ge&&e.push.apply(e,[{isGroupingTitle:!0,label:function(){return"Data integrations"},uuid:"".concat(R.tf.DATA_LOADER,"/").concat(X.I.DATA_INTEGRATION,"/group")},{items:Ge,label:function(){return(0,J.kC)(X.O.SOURCES)},uuid:"".concat(R.tf.DATA_LOADER,"/").concat(X.I.DATA_INTEGRATION,"/").concat(X.O.SOURCES)}]);var n=[{isGroupingTitle:!0,label:function(){return"Python"},uuid:"".concat(R.t6.PYTHON).concat(R.tf.DATA_EXPORTER,"/group")}].concat(He).concat(qe(R.tf.DATA_EXPORTER));return ze&&n.push.apply(n,[{isGroupingTitle:!0,label:function(){return"Data integrations"},uuid:"".concat(R.tf.DATA_EXPORTER,"/").concat(X.I.DATA_INTEGRATION,"/group")},{items:ze,label:function(){return(0,J.kC)(X.O.DESTINATIONS)},uuid:"".concat(R.tf.DATA_EXPORTER,"/").concat(X.I.DATA_INTEGRATION,"/").concat(X.O.DESTINATIONS)}]),[{beforeIcon:(0,b.jsx)(Z.rH,{fill:(0,ee.qn)(R.tf.DATA_LOADER).accent,size:F}),items:e,label:function(){return R.V4[R.tf.DATA_LOADER]},uuid:"".concat(R.tf.DATA_LOADER,"/").concat(R.t6.PYTHON)},{beforeIcon:(0,b.jsx)(Z.Sv,{fill:(0,ee.qn)(R.tf.TRANSFORMER).accent,size:F}),items:[{isGroupingTitle:!0,label:function(){return"Python"},uuid:"".concat(R.t6.PYTHON).concat(R.tf.TRANSFORMER,"/group")}].concat(Qe).concat(qe(R.tf.TRANSFORMER)),label:function(){return R.V4[R.tf.TRANSFORMER]},uuid:"".concat(R.tf.TRANSFORMER,"/").concat(R.t6.PYTHON)},{beforeIcon:(0,b.jsx)(Z.zS,{fill:(0,ee.qn)(R.tf.DATA_EXPORTER).accent,size:F}),items:n,label:function(){return R.V4[R.tf.DATA_EXPORTER]},uuid:"".concat(R.tf.DATA_EXPORTER,"/").concat(R.t6.PYTHON)},{beforeIcon:(0,b.jsx)(Z.LM,{fill:(0,ee.qn)(R.tf.SENSOR).accent,size:F}),items:[{isGroupingTitle:!0,label:function(){return"Python"},uuid:"".concat(R.t6.PYTHON).concat(R.tf.SENSOR,"/group")}].concat(Ke),label:function(){return R.V4[R.tf.SENSOR]},uuid:"".concat(R.tf.SENSOR,"/").concat(R.t6.PYTHON)},{beforeIcon:(0,b.jsx)(Z.xE,{fill:(0,ee.qn)(R.tf.DBT).accent,size:F}),items:y,label:function(){return R.V4[R.tf.DBT]},uuid:R.tf.DBT},{beforeIcon:(0,b.jsx)(Z.ie,{size:F}),label:function(){return R.V4[R.tf.GLOBAL_DATA_PRODUCT]},onClick:function(){return ae({addNewBlock:i})},uuid:R.tf.GLOBAL_DATA_PRODUCT},{isGroupingTitle:!0,label:function(){return"Custom templates"},uuid:"custom_templates"},{beforeIcon:(0,b.jsx)(Z.zQ,{default:!0,size:F}),label:function(){return"Browse templates"},onClick:function(){return le({addNewBlock:i})},uuid:"browse_templates"},{beforeIcon:(0,b.jsx)(Z.o0,{default:!0,size:F}),label:function(){return"Create new template"},onClick:function(){return le({addNew:!0,addNewBlock:i})},uuid:"create_template"}]}),[i,qe,He,ze,Fe,Ge,y,Ke,Qe,le,ae]),We=(0,r.useMemo)((function(){return[{beforeIcon:(0,b.jsx)(Z.VS,{default:!0,size:F}),label:function(){return"Python block"},onClick:function(){i({language:R.t6.PYTHON,type:R.tf.CUSTOM})},uuid:"Python"},{beforeIcon:(0,b.jsx)(Z.VS,{default:!0,size:F}),label:function(){return"SQL block"},onClick:function(){i({language:R.t6.SQL,type:R.tf.CUSTOM})},uuid:"SQL"},{beforeIcon:(0,b.jsx)(Z.VS,{default:!0,size:F}),label:function(){return"R block"},onClick:function(){i({language:R.t6.R,type:R.tf.CUSTOM})},uuid:"R"},{beforeIcon:(0,b.jsx)(T,{default:!0,size:F}),label:function(){return"Scratchpad"},onClick:function(){i({language:R.t6.PYTHON,type:R.tf.SCRATCHPAD})},uuid:"scratchpad"}]}),[i]),Ve=(0,u.Db)(A.ZP.search_results.useCreate(),{onSuccess:function(e){return(0,te.wD)(e,{callback:function(e){var n=e.search_result;_e(n)},onErrorCallback:function(e,n){return be({errors:n,response:e})}})}}),Xe=(0,l.Z)(Ve,1)[0],Je=(0,r.useCallback)((function(e){clearTimeout(fe.current);var n=e.target.value;Ee(n),n?fe.current=setTimeout((function(){Xe({search_result:{pipeline_type:D,query:n,ratio:70,type:E.BLOCK_ACTION_OBJECTS}})}),500):_e(null)}),[Xe,D,fe]),$e=(0,r.useMemo)((function(){return(null===Se||void 0===Se?void 0:Se.results)||[]}),[Se]),en=(0,r.useMemo)((function(){var e=null===Se||void 0===Se?void 0:Se.uuid,n=null===$e||void 0===$e?void 0:$e.map((function(n){return{itemObject:n,searchQueries:[e],value:null===n||void 0===n?void 0:n.uuid}}));if(e){var t={itemObject:{description:e,object_type:a.L.GENERATE_BLOCK,title:"Generate block using AI (beta)"},searchQueries:[e],value:"generate_block"};Ie?n.push(t):n.unshift(t)}return n}),[$e,Se,Ie]),nn=(0,r.useMemo)((function(){return(0,b.jsx)(Q,{compact:O,onClick:function(){var e;return null===ve||void 0===ve||null===(e=ve.current)||void 0===e?void 0:e.focus()}})}),[O,ve]),tn=(0,r.useMemo)((function(){return!(null===N||void 0===N||!N.openai_api_key)}),[N]);return(0,b.jsx)(s.Z,{onClickOutside:Be,open:!0,children:(0,b.jsx)(G,{compact:O,focused:we,children:(0,b.jsxs)(p.ZP,{alignItems:"center",children:[(0,b.jsx)(z,{compact:O,increasedZIndex:0===xe,children:(0,b.jsx)(v.Z,{customSubmenuHeights:(n={},(0,o.Z)(n,"".concat(R.tf.DATA_EXPORTER,"/").concat(X.I.DATA_INTEGRATION,"/").concat(X.O.DESTINATIONS),504),(0,o.Z)(n,"".concat(R.tf.DATA_LOADER,"/").concat(X.I.DATA_INTEGRATION,"/").concat(X.O.SOURCES),504),n),disableKeyboardShortcuts:!0,items:Ye,onClickCallback:Be,open:0===xe,parentRef:de,uuid:"button_templates",children:(0,b.jsx)(I.Z,{block:!0,label:"Add a block from a template",size:null,widthFitContent:!0,children:(0,b.jsx)(d.ZP,{beforeIcon:(0,b.jsx)(Z.zQ,{secondary:0===xe,size:F}),noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(e){e.preventDefault(),je((function(e){return 0===e?null:0})),Ue(0)},children:"Templates"})})})}),(0,b.jsx)(S.Z,{mr:3}),(0,b.jsx)(z,{compact:O,increasedZIndex:1===xe,children:(0,b.jsx)(v.Z,{disableKeyboardShortcuts:!0,items:We,onClickCallback:Be,open:1===xe,parentRef:se,uuid:"button_custom",children:(0,b.jsx)(I.Z,{block:!0,label:"Add a blank custom block or scratchpad block",size:null,widthFitContent:!0,children:(0,b.jsx)(d.ZP,{beforeIcon:(0,b.jsx)(Z.cW,{secondary:1===xe,size:F}),noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(e){e.preventDefault(),je((function(e){return 1===e?null:1})),Ue(1)},children:"Custom"})})})}),(0,b.jsx)(S.Z,{mr:3}),(0,b.jsx)(z,{compact:O,increasedZIndex:0===xe,children:(0,b.jsx)(I.Z,{block:!0,label:"Add a markdown block for documentation",size:null,widthFitContent:!0,children:(0,b.jsx)(d.ZP,{beforeIcon:(0,b.jsx)(g,{size:F}),noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(e){e.preventDefault(),i({language:R.t6.MARKDOWN,type:R.tf.MARKDOWN})},children:"Markdown"})})}),(0,b.jsx)(S.Z,{mr:3}),(0,b.jsx)(H,{}),(0,b.jsx)(S.Z,{mr:3}),(0,b.jsxs)(K,{children:[nn,(0,b.jsxs)(p.ZP,{alignItems:"center",fullWidth:!0,children:[(0,b.jsx)(P.Z,{fullWidth:!0,noBackground:!0,noBorder:!0,noBorderRadiusBottom:!0,noBorderRadiusTop:!0,onBlur:function(){return setTimeout((function(){return De(!1)}),150)},onChange:Je,onFocus:function(){return De(!0)},paddingHorizontal:0,paddingVertical:0,placeholder:"Search for a block...",ref:ve,value:ye||""}),(0,b.jsx)(m.Z,{addPlusSignBetweenKeys:!0,disabled:!0,keyTextGroups:[[W.RJ,W.ZS]]})]}),nn,(0,b.jsx)(q,{topOffset:(null===ve||void 0===ve||null===(t=ve.current)||void 0===t?void 0:t.getBoundingClientRect().height)+(O?1.5*L.iI:2.5*L.iI),children:(0,b.jsx)(c.Z,{itemGroups:[{items:we?en:[],renderItem:function(e,n){var t=e.itemObject,o=t.block_type,i=t.description,r=t.language,l=t.object_type,u=t.title,c={fill:(0,ee.qn)(o).accent,size:F},d=w.iK[o],s=a.L.GENERATE_BLOCK===l;s&&(d=Z.xq,c.default=!1,c.fill=null,c.warning=!0);var p="".concat(u).concat(i?": "+i:"").slice(0,80);return(0,b.jsxs)(Y,ue(ue({},n),{},{onClick:function(e){var t;(0,oe.j)(e),null===n||void 0===n||null===(t=n.onClick)||void 0===t||t.call(n,e)},children:[(0,b.jsxs)(f.Z,{alignItems:"center",flex:1,children:[d&&(0,b.jsx)(d,ue({default:!(null!==c&&void 0!==c&&c.fill)},c)),(0,b.jsx)(S.Z,{mr:2}),(0,b.jsx)(_.ZP,{default:!0,overflowWrap:!0,textOverflow:!0,children:p})]}),(0,b.jsx)(S.Z,{mr:1}),(0,b.jsx)(_.ZP,{monospace:!0,muted:!0,uppercase:!0,children:s?"AI":R.dO[r]}),(0,b.jsx)(S.Z,{mr:1}),a.L.BLOCK_FILE===l&&(0,b.jsx)(Z.$B,{muted:!0,size:F}),a.L.CUSTOM_BLOCK_TEMPLATE===l&&(0,b.jsx)(Z.zQ,{muted:!0,size:F}),a.L.MAGE_TEMPLATE===l&&(0,b.jsx)(Z.m1,{muted:!0,size:F}),s&&tn&&(0,b.jsx)(Z.xq,{muted:!0,size:F}),s&&!tn&&(0,b.jsx)(Z.uy,{muted:!0,size:F})]}))}}],onSelectItem:function(e){var n=e.itemObject,t=n.object_type;a.L.GENERATE_BLOCK!==t||tn?(i({block_action_object:n,require_unique_name:!1}),Ee(null),_e(null)):null===ce||void 0===ce||ce({cancelButtonText:"Set this up later",header:(0,b.jsx)(S.Z,{mb:L.HN,children:(0,b.jsxs)(x.Z,{children:[(0,b.jsx)(_.ZP,{warning:!0,children:"You need to add an OpenAI API key to your project before you can generate blocks using AI."}),(0,b.jsx)(S.Z,{mt:1,children:(0,b.jsxs)(_.ZP,{warning:!0,children:["Read ",(0,b.jsx)(h.Z,{href:"https://help.openai.com/en/articles/4936850-where-do-i-find-my-secret-api-key",openNewWindow:!0,children:"OpenAI\u2019s documentation"})," to get your API key."]})})]})}),onCancel:function(){Re(!0)},onSaveSuccess:function(e){null!==e&&void 0!==e&&e.openai_api_key&&(i({block_action_object:n}),Ee(null),_e(null))}})},uuid:me})})]})]})})})};var ae=function(e){var n=e.size;return(0,b.jsx)("svg",{fill:"none",height:n,preserveAspectRatio:"xMidYMid",viewBox:"0 0 256 256",width:n,xmlns:"http://www.w3.org/2000/svg",children:(0,b.jsx)("path",{d:"M245.121138,10.6473813 C251.139129,16.4340053 255.074133,24.0723342 256,32.4050489 C256,35.8769778 255.074133,38.1917867 252.990862,42.5895822 C250.907876,46.9873778 225.215147,91.4286933 217.57696,103.696213 C213.179164,110.871609 210.864356,119.435947 210.864356,127.768462 C210.864356,136.3328 213.179164,144.6656 217.57696,151.840996 C225.215147,164.108516 250.907876,208.781084 252.990862,213.179164 C255.074133,217.57696 256,219.659947 256,223.131876 C255.074133,231.464676 251.370667,239.103147 245.352676,244.658347 C239.565938,250.676338 231.927751,254.611342 223.826489,255.305671 C220.35456,255.305671 218.039751,254.379804 213.873493,252.296533 C209.706951,250.213262 164.340053,225.215147 152.072249,217.57696 C151.146382,217.113884 150.220516,216.419556 149.063396,215.95648 L88.4195556,180.079502 C89.8082133,191.652693 94.9006222,202.763093 103.233138,210.864356 C104.853618,212.484551 106.473813,213.873493 108.325547,215.262151 C106.936604,215.95648 105.316409,216.651093 103.927751,217.57696 C91.6599467,225.215147 46.9873778,250.907876 42.5895822,252.990862 C38.1917867,255.074133 36.1085156,256 32.4050489,256 C24.0723342,255.074133 16.4340053,251.370667 10.8788338,245.352676 C4.86075733,239.565938 0.925858133,231.927751 0,223.594951 C0.231464676,220.123022 1.1573248,216.651093 3.00905244,213.641956 C5.09223822,209.24416 30.7848533,164.571307 38.42304,152.303787 C42.82112,145.128391 45.1356444,136.795591 45.1356444,128.231538 C45.1356444,119.6672 42.82112,111.3344 38.42304,104.159004 C30.7848533,91.4286933 4.86075733,46.75584 3.00905244,42.3580444 C1.1573248,39.3489067 0.231464676,35.8769778 0,32.4050489 C0.925858133,24.0723342 4.62930489,16.4340053 10.6473813,10.6473813 C16.4340053,4.62930489 24.0723342,0.925858133 32.4050489,0 C35.8769778,0.231464676 39.3489067,1.1573248 42.5895822,3.00905244 C46.2930489,4.62930489 78.9293511,23.6094009 96.28928,33.7939911 L100.224284,36.1085156 C101.612942,37.0343822 102.770347,37.7287111 103.696213,38.1917867 L105.547947,39.3489067 L167.348907,75.9204978 C165.960249,62.0324978 158.784853,49.3019022 147.674453,40.7378489 C149.063396,40.04352 150.683591,39.3489067 152.072249,38.42304 C164.340053,30.7848533 209.012622,4.86075733 213.410418,3.00905244 C216.419556,1.1573248 219.891484,0.231464676 223.594951,0 C231.696213,0.925858133 239.334684,4.62930489 245.121138,10.6473813 Z M131.240391,144.434062 L144.434062,131.240391 C146.285796,129.388658 146.285796,126.611342 144.434062,124.759609 L131.240391,111.565938 C129.388658,109.714204 126.611342,109.714204 124.759609,111.565938 L111.565938,124.759609 C109.714204,126.611342 109.714204,129.388658 111.565938,131.240391 L124.759609,144.434062 C126.379804,146.054258 129.388658,146.054258 131.240391,144.434062 Z",fill:"#FF694A"})})},de=t(93369),se=t(57653),fe=t(82359),pe=t(8454),ve=t(75634),me=t(5677);function he(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function be(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,o.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.addNewBlock,t=e.blockIdx,o=e.blockTemplates,l=e.compact,u=e.focusedAddNewBlockSearch,c=e.hideCustom,a=e.hideDataExporter,d=(e.hideDataLoader,e.hideDbt),f=e.hideMarkdown,m=e.hideScratchpad,h=e.hideSensor,g=e.hideTransformer,x=e.hideTransformerDataSources,j=e.onClickAddSingleDBTModel,C=e.pipeline,O=e.project,k=e.searchTextInputRef,y=e.setAddNewBlockMenuOpenIdx,E=e.setCreatingNewDBTModel,T=e.setFocusedAddNewBlockSearch,S=e.showBrowseTemplates,_=e.showConfigureProjectModal,P=e.showGlobalDataProducts,A=(0,r.useState)(null),w=A[0],D=A[1],N=(0,r.useRef)(null),M=(0,r.useRef)(null),B=(0,r.useRef)(null),U=(0,r.useRef)(null),F=(0,r.useRef)(null),G=(0,r.useRef)(null),H=(0,r.useRef)(null),z={compact:l,inline:!0},Q=null===C||void 0===C?void 0:C.type,K=Q===se.qL.STREAMING,q=l?ve.ZG/2:ve.ZG,Y=25*L.iI,W=(0,r.useMemo)((function(){return(0,ne.q_)(me.c1,pe.qs.COLUMN,n)}),[n]),V=(0,r.useMemo)((function(){return(0,ne.q_)(me.Wt,pe.qs.ROW,n)}),[n]),X=(0,r.useMemo)((function(){var e=[{label:function(){return"Generic (no template)"},onClick:function(){n({language:R.t6.PYTHON,type:R.tf.TRANSFORMER})},uuid:"generic_transformer_action"},{bold:!0,items:V,label:function(){return"Row actions"},uuid:"row_actions_grouping"},{isGroupingTitle:!0,label:function(){return"Column actions"},uuid:"column_actions_grouping"}].concat((0,i.Z)(W));return x||e.splice(1,0,{bold:!0,items:(0,ne.hr)(n,R.tf.TRANSFORMER,Q),label:function(){return"Data sources"},uuid:"data_sources_grouping"}),e}),[n,W,x,Q,V]),J=(0,r.useCallback)((function(){return D(null)}),[]),$=(0,r.useCallback)((function(e){return null===y||void 0===y?void 0:y((function(n){return null===n||w!==e?t:null}))}),[t,w,y]),ee=se.qL.PYSPARK===Q,te=(0,r.useMemo)((function(){return(0,ne.oM)(o,n,{"data_integrations/destinations/base":!0,"data_integrations/sources/base":!0})}),[n,o]),oe=(0,r.useMemo)((function(){return(0,ne.hr)(n,R.tf.DATA_LOADER,Q,{blockTemplatesByBlockType:te,showBrowseTemplates:S})}),[n,te,Q,S]),ie=(0,r.useMemo)((function(){return(0,ne.hr)(n,R.tf.DATA_EXPORTER,Q,{blockTemplatesByBlockType:te,showBrowseTemplates:S})}),[n,te,Q,S]),re=(0,r.useMemo)((function(){return ee||se.qL.INTEGRATION===Q?X:K?[{items:(0,ne.hr)(n,R.tf.TRANSFORMER,Q),label:function(){return"Python"},uuid:"transformers/python"}].concat((0,i.Z)((0,ne.hr)(n,R.tf.TRANSFORMER,Q,{blockTemplatesByBlockType:te,onlyCustomTemplate:!0,showBrowseTemplates:S}))):[{items:X,label:function(){return"Python"},uuid:"transformers/python_all"}].concat((0,i.Z)((0,ne.qs)(n,R.tf.TRANSFORMER)),(0,i.Z)((0,ne.hr)(n,R.tf.TRANSFORMER,Q,{blockTemplatesByBlockType:te,onlyCustomTemplate:!0,showBrowseTemplates:S})))}),[n,X,te,ee,K,Q,S]),le=(0,r.useMemo)((function(){return[{label:function(){return"New model"},onClick:function(){null===E||void 0===E||E(!0),null===j||void 0===j||j(t)},uuid:"dbt/new_model"},{label:function(){return"Single model or snapshot (from file)"},onClick:function(){return null===j||void 0===j?void 0:j(t)},uuid:"dbt/single_model"},{label:function(){return"All models (w/ optional exclusion)"},onClick:function(){return n({configuration:{dbt:{command:"run"}},language:R.t6.YAML,type:R.tf.DBT})},uuid:"dbt/all_models"},{label:function(){return"Generic dbt command"},onClick:function(){return n({configuration:{dbt:{command:null}},language:R.t6.YAML,type:R.tf.DBT})},uuid:"dbt/generic_command"}]}),[n,t,j,E]);return(0,r.useMemo)((function(){var e;return se.qL.PYTHON===Q&&!ee&&(null===O||void 0===O||null===(e=O.features)||void 0===e?void 0:e[fe.d.ADD_NEW_BLOCK_V2])}),[ee,Q,O])?(0,b.jsx)(ce,{addNewBlock:n,blockIdx:t,blockTemplatesByBlockType:te,compact:l,focused:u,itemsDBT:le,pipelineType:Q,project:O,searchTextInputRef:k,setAddNewBlockMenuOpenIdx:y,setFocused:T,showBrowseTemplates:S,showConfigureProjectModal:_,showGlobalDataProducts:P}):(0,b.jsx)(p.ZP,{flexWrap:"wrap",inline:!0,children:(0,b.jsx)(s.Z,{onClickOutside:J,open:!0,children:(0,b.jsxs)(p.ZP,{flexWrap:"wrap",children:[!a&&(0,b.jsx)(ve.W4,{increasedZIndex:0===w,children:(0,b.jsx)(v.Z,{disableKeyboardShortcuts:!0,items:oe,onClickCallback:J,open:0===w,parentRef:N,uuid:"data_loader_button",children:(0,b.jsx)(de.ZP,be(be({},z),{},{beforeElement:(0,b.jsx)(ve.Wx,{blue:!0,compact:l,children:(0,b.jsx)(Z.mm,{size:q})}),onClick:function(e){e.preventDefault(),D((function(e){return 0===e?null:0})),$(0)},uuid:"AddNewBlocks/Data_loader",children:"Data loader"}))})}),!g&&(0,b.jsx)(ve.W4,{increasedZIndex:1===w,children:(0,b.jsx)(v.Z,{disableKeyboardShortcuts:!0,items:re,onClickCallback:J,open:1===w,parentRef:M,uuid:"transformer_button",children:(0,b.jsx)(de.ZP,be(be({},z),{},{beforeElement:(0,b.jsx)(ve.Wx,{compact:l,purple:!0,children:(0,b.jsx)(Z.mm,{size:q})}),onClick:function(e){e.preventDefault(),D((function(e){return 1===e?null:1})),$(1)},uuid:"AddNewBlocks/Transformer",children:"Transformer"}))})}),!a&&(0,b.jsx)(ve.W4,{increasedZIndex:2===w,children:(0,b.jsx)(v.Z,{disableKeyboardShortcuts:!0,items:ie,onClickCallback:J,open:2===w,parentRef:B,uuid:"data_exporter_button",children:(0,b.jsx)(de.ZP,be(be({},z),{},{beforeElement:(0,b.jsx)(ve.Wx,{compact:l,yellow:!0,children:(0,b.jsx)(Z.mm,{inverted:!0,size:q})}),onClick:function(e){e.preventDefault(),D((function(e){return 2===e?null:2})),$(2)},uuid:"AddNewBlocks/Data_exporter",children:"Data exporter"}))})}),!d&&(0,b.jsx)(ve.W4,{increasedZIndex:3===w,children:(0,b.jsx)(v.Z,{disableKeyboardShortcuts:!0,items:[].concat((0,i.Z)(le),(0,i.Z)((0,ne.hr)(n,R.tf.DBT,Q,{blockTemplatesByBlockType:te,onlyCustomTemplate:!0,showBrowseTemplates:S}))),onClickCallback:J,open:3===w,parentRef:U,uuid:"dbt_button",children:(0,b.jsx)(de.ZP,be(be({},z),{},{beforeElement:(0,b.jsx)(ae,{size:ve.ZG*(l?.75:1.25)}),onClick:function(e){e.preventDefault(),D((function(e){return 3===e?null:3})),$(3)},uuid:"AddNewBlocks/DBT",children:"DBT model"}))})}),!c&&(0,b.jsx)(ve.W4,{increasedZIndex:4===w,children:(0,b.jsx)(v.Z,{disableKeyboardShortcuts:!0,items:[{items:(0,ne.Bd)(n,R.tf.CUSTOM,R.t6.PYTHON),label:function(){return"Python"},uuid:"custom_block_python"},{items:(0,ne.Bd)(n,R.tf.CUSTOM,R.t6.SQL),label:function(){return"SQL"},uuid:"custom_block_sql"}].concat((0,i.Z)((0,ne.hr)(n,R.tf.CUSTOM,Q,{blockTemplatesByBlockType:te,onlyCustomTemplate:!0,showBrowseTemplates:S}))),onClickCallback:J,open:4===w,parentRef:F,uuid:"custom_block_button",children:(0,b.jsx)(I.Z,{block:!0,label:"Add a custom code block with a designated color.",maxWidth:Y,size:null,children:(0,b.jsx)(de.ZP,be(be({},z),{},{beforeElement:(0,b.jsx)(ve.Wx,{compact:l,grey:!0,children:(0,b.jsx)(Z.mm,{inverted:!0,size:q})}),onClick:function(e){e.preventDefault(),D((function(e){return 4===e?null:4})),$(4)},uuid:"AddNewBlocks/Scratchpad",children:"Custom"}))})})}),!m&&(0,b.jsx)(ve.W4,{children:(0,b.jsx)(I.Z,{block:!0,label:"Write experimental code that doesn\u2019t get executed when you run your pipeline.",maxWidth:Y,size:null,children:(0,b.jsx)(de.ZP,be(be({},z),{},{beforeElement:(0,b.jsx)(ve.Wx,{border:!0,compact:l,children:(0,b.jsx)(Z.mm,{size:q})}),onClick:function(e){e.preventDefault(),n({type:R.tf.SCRATCHPAD})},uuid:"AddNewBlocks/Scratchpad",children:"Scratchpad"}))})}),!m&&(0,b.jsx)(ve.W4,{children:(0,b.jsx)(I.Z,{block:!0,label:"Add a global data product block",maxWidth:Y,size:null,children:(0,b.jsx)(de.ZP,be(be({},z),{},{beforeElement:(0,b.jsx)(ve.Wx,{compact:l,children:(0,b.jsx)(Z.ie,{size:q})}),onClick:function(e){e.preventDefault(),P({addNewBlock:n})},uuid:"AddNewBlocks/GlobalDataProducts",children:"Global data product"}))})}),!K&&!h&&(0,b.jsx)(ve.W4,{increasedZIndex:6===w,children:(0,b.jsx)(v.Z,{disableKeyboardShortcuts:!0,items:[].concat((0,i.Z)((0,ne.hr)(n,R.tf.SENSOR,Q)),(0,i.Z)((0,ne.hr)(n,R.tf.SENSOR,Q,{blockTemplatesByBlockType:te,onlyCustomTemplate:!0,showBrowseTemplates:S}))),onClickCallback:J,open:6===w,parentRef:G,uuid:"sensor_button",children:(0,b.jsx)(de.ZP,be(be({},z),{},{beforeElement:(0,b.jsx)(ve.Wx,{compact:l,children:(0,b.jsx)(Z.LM,{pink:!0,size:ve.ZG*(l?.75:1.25)})}),onClick:function(e){e.preventDefault(),D((function(e){return 6===e?null:6})),$(6)},uuid:"AddNewBlocks/Sensor",children:"Sensor"}))})}),!f&&(0,b.jsx)(ve.W4,{increasedZIndex:7===w,children:(0,b.jsx)(v.Z,{disableKeyboardShortcuts:!0,items:[{label:function(){return"Generic (no template)"},onClick:function(){n({language:R.t6.MARKDOWN,type:R.tf.MARKDOWN})},uuid:"generic_markdown"}].concat((0,i.Z)((0,ne.hr)(n,R.tf.MARKDOWN,Q,{blockTemplatesByBlockType:te,onlyCustomTemplate:!0,showBrowseTemplates:S}))),onClickCallback:J,open:7===w,parentRef:H,uuid:"markdown_button",children:(0,b.jsx)(de.ZP,be(be({},z),{},{beforeElement:(0,b.jsx)(ve.Wx,{compact:l,sky:!0,children:(0,b.jsx)(Z.mm,{inverted:!0,size:q})}),onClick:function(e){e.preventDefault(),D((function(e){return 7===e?null:7})),$(7)},uuid:"AddNewBlocks/Markdown",children:"Markdown"}))})})]})})})}},38399:function(e,n,t){t.d(n,{Bd:function(){return y},SF:function(){return E},X7:function(){return T},hr:function(){return O},oM:function(){return C},q_:function(){return k},qs:function(){return j}});var o=t(21831),i=t(82394),r=t(55485),l=t(30160),u=t(5677),c=t(72473),a=t(44425),d=t(84438),s=t(57653),f=t(81728),p=t(55283),v=t(86735),m=t(28598);function h(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}var b=function(e,n,t){var o=t===s.qL.STREAMING&&(e===a.tf.DATA_LOADER||e===a.tf.DATA_EXPORTER);return(function(e){var n;return e===s.qL.STREAMING?(n={},(0,i.Z)(n,a.tf.DATA_LOADER,[d.ZP.ACTIVEMQ,d.ZP.AMAZON_SQS,d.ZP.AZURE_EVENT_HUB,d.ZP.GOOGLE_CLOUD_PUBSUB,d.ZP.INFLUXDB,d.ZP.KAFKA,d.ZP.NATS,d.ZP.KINESIS,d.ZP.RABBITMQ,d.ZP.MONGODB]),(0,i.Z)(n,a.tf.DATA_EXPORTER,[d.ZP.AZURE_DATA_LAKE,d.ZP.BIGQUERY,d.ZP.CLICKHOUSE,d.ZP.DUCKDB,d.ZP.DUMMY,d.ZP.ELASTICSEARCH,d.ZP.GOOGLE_CLOUD_PUBSUB,d.ZP.INFLUXDB,d.ZP.S3,d.ZP.KAFKA,d.ZP.KINESIS,d.ZP.MONGODB,d.ZP.MSSQL,d.ZP.MYSQL,d.ZP.OPENSEARCH,d.ZP.POSTGRES,d.ZP.RABBITMQ,d.ZP.REDSHIFT,d.ZP.SNOWFLAKE,d.ZP.TRINO]),(0,i.Z)(n,a.tf.TRANSFORMER,[d.ZP.GENERIC]),n):d.cp}(t)[e]||[]).map((function(t){return{indent:e===a.tf.TRANSFORMER,label:function(){return d.MV[t]},onClick:function(){n({config:{data_source:t===d.ZP.GENERIC?null:t},language:o?a.t6.YAML:a.t6.PYTHON,type:e})},uuid:"".concat(e,"/").concat(t)}}))};function g(e,n){return{label:function(){return"SQL"},onClick:function(){return e({language:a.t6.SQL,type:n})},uuid:"".concat(n,"/sql")}}function x(e,n){return{label:function(){return"R"},onClick:function(){return e({language:a.t6.R,type:n})},uuid:"".concat(n,"/r")}}var j=function(e,n){return[g(e,n),x(e,n)]};function C(e,n,t){var o={};return null===e||void 0===e||e.forEach((function(e){var r=e.block_type,l=e.configuration,u=e.defaults,c=e.description,a=e.groups,d=e.language,s=e.name,f=e.path,p=e.template_type,v=e.template_variables;o[r]||(o[r]={}),o[r][d]||(o[r][d]={items:[],label:function(){return d},uuid:"".concat(r,"/").concat(d)});var m={label:function(){return s},onClick:function(){return n({config:{template_path:f,template_type:p,template_variables:v},configuration:l,defaults:u,language:d,type:r})},uuid:"".concat(f,"/").concat(s)};if(null!==t&&void 0!==t&&t[f]||(m.tooltip=function(){return c}),(null===a||void 0===a?void 0:a.length)>=1){var b=function(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,i.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}({},o[r][d]),g=[null],x=[b];a.forEach((function(e,n){var t="".concat(r,"/").concat(d,"/").concat(a.slice(0,n+1).join("/")),o=x[n],i=o.items.findIndex((function(e){var n=e.uuid;return t===n})),l=i>=0?o.items[i]:null;l||(l={items:[],label:function(){return e},uuid:t}),g.push(i),x.push(l)})),g.push(-1),x.push(m);var j=x.length;o[r][d]=x.reduce((function(e,n,t){var o=j-t,i=x[o-2],r=x[o-1],l=g[o-1];return i?(l>=0?i.items[l]=r:i.items.push(r),i):r}),{})}else o[r][d].items.push(m)})),o}var O=function(e,n,t,o){var i=o||{},r=i.blockTemplatesByBlockType,l=i.dataIntegrationType,u=i.languages,c=i.onlyCustomTemplate,d=i.showBrowseTemplates,f={};null!==o&&void 0!==o&&o.v2||(f=Object.fromEntries(a.Ut.map((function(n){return[n,b(n,e,t)]}))));var p={label:function(){return"Custom template"},onClick:function(){return d({addNewBlock:e,blockType:n,language:a.t6.SQL})},uuid:"".concat(n,"/custom_template")};if(c)return[p];if(t===s.qL.PYSPARK||t===s.qL.STREAMING)return f[n];if(l&&null!==o&&void 0!==o&&o.v2){var m,h,j=(null===r||void 0===r||null===(m=r[n])||void 0===m||null===(h=m[l])||void 0===h?void 0:h.items)||[];return[{items:(0,v.YC)(j,(function(e){return(0,e.label)()})),uuid:"".concat(n,"/").concat(l)}]}var C,O,Z=(null===r||void 0===r||null===(C=r[n])||void 0===C||null===(O=C[a.t6.PYTHON])||void 0===O?void 0:O.items)||[],k=[{items:(0,v.YC)((f[n]||[]).concat(Z),(function(e){return(0,e.label)()})),label:function(){return"Python"},uuid:"".concat(n,"/").concat(a.t6.PYTHON)}];return(!u||null!==u&&void 0!==u&&u.includes(a.t6.SQL))&&k.push(g(e,n)),(!u||null!==u&&void 0!==u&&u.includes(a.t6.R))&&k.push(x(e,n)),![a.tf.MARKDOWN,a.tf.SCRATCHPAD].includes(n)&&d&&k.push(p),k};function Z(e,n,t){return e.map((function(e){return{indent:!0,label:function(){return u.NX[n][e]},onClick:function(){t({config:{action_type:e,axis:n},language:a.t6.PYTHON,type:a.tf.TRANSFORMER})},uuid:"".concat(n,"_").concat(e)}})).sort((function(e,n){return e.label().localeCompare(n.label())}))}function k(e,n,t){var i=[];return e.forEach((function(e){if(e!==u._G.MISC)i.push({indent:!0,items:Z(u.d9[n][e],n,t),label:function(){return e},uuid:"".concat(n,"_grouping_").concat((0,f.RA)(e))});else{var r=Z(u.d9[n][e],n,t);i.push.apply(i,(0,o.Z)(r))}})),i}var y=function(e,n,t){return Object.values(a.Lq).map((function(o){return{label:function(){return(0,m.jsxs)(r.ZP,{alignItems:"center",children:[(0,m.jsx)(c.mm,{fill:(0,p.qn)(a.tf.CUSTOM,{blockColor:o}).accent,size:16}),"\xa0",(0,m.jsx)(l.ZP,{children:(0,f.kC)(o)})]})},leftAligned:!0,onClick:function(){e({color:o,language:t,type:n})},uuid:"".concat(t,"_").concat(o)}}))},E=function(e){return"-- Docs: https://docs.mage.ai/guides/sql-blocks\n"+(e||"")};function T(e,n){var t=n;return a.tf.SCRATCHPAD===e.type&&(t='"""\nNOTE: Scratchpad blocks are used only for experimentation and testing out code.\nThe code written here will not be executed as part of the pipeline.\n"""\n'+(n||"")),t}},15752:function(e,n,t){t.d(n,{F:function(){return r},h:function(){return i}});var o=t(92709);function i(){var e=new CustomEvent(o.Qj);window.dispatchEvent(e)}function r(e){var n=new CustomEvent(o.Em,{detail:{block:e}});window.dispatchEvent(n)}},92709:function(e,n,t){t.d(n,{$e:function(){return a},Em:function(){return f},IY:function(){return l},Jf:function(){return r},LR:function(){return i},NR:function(){return u},Qj:function(){return s},Wf:function(){return p},b7:function(){return o},m$:function(){return d},tK:function(){return c}});var o="edit",i="[ERR_BLOCK_EXISTS]",r={uuid:"All files"},l={uuid:"Current blocks"},u=[r,l],c="CUSTOM_EVENT_BLOCK_OUTPUT_CHANGED",a="CUSTOM_EVENT_CODE_BLOCK_CHANGED",d="CUSTOM_EVENT_COLUMN_SCROLLER_CURSOR_MOVED",s="CUSTOM_EVENT_COLUMN_SCROLLER_RESET",f="CUSTOM_EVENT_COLUMN_SCROLLER_SCROLL_TO_BLOCK",p="CUSTOM_EVENT_SYNC_COLUMN_POSITIONS"},74052:function(e,n,t){t.d(n,{Dp:function(){return g},OF:function(){return x},Q9:function(){return C},Rt:function(){return m},Rz:function(){return Z},h8:function(){return j},k1:function(){return h},uS:function(){return O},zv:function(){return k}});var o=t(21831),i=t(82394),r=t(92083),l=t.n(r),u=t(48339),c=t(53808),a=t(3917),d=t(86735),s=t(81728),f=t(70320);function p(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function v(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?p(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):p(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function m(e){var n={},t={};return null===e||void 0===e||e.forEach((function(e){var o=e.content,i=e.outputs,r=e.type,l=e.uuid;(null===i||void 0===i?void 0:i.length)>=1&&(n[l]=i.map((function(e){if("object"===typeof e){var n=e||{},t=n.sample_data,o=n.shape,i=n.text_data,r=n.type;return t?{data:v({shape:o},t),type:r}:i&&(0,s.Pb)(i)?JSON.parse(i):i}return{data:String(e),type:u.Gi.TEXT}}))),t[r]||(t[r]={}),t[r][l]=o})),{content:t,messages:n}}function h(e,n,t){e.forEach((function(e){(0,c.t8)("".concat(t,"/").concat(e.uuid,"/codeCollapsed"),(0,c.Od)("".concat(n,"/").concat(e.uuid,"/codeCollapsed"))),(0,c.t8)("".concat(t,"/").concat(e.uuid,"/outputCollapsed"),(0,c.Od)("".concat(n,"/").concat(e.uuid,"/outputCollapsed")))}))}function b(e){return"".concat(e,"/").concat(c.kP)}function g(e){return(0,c.U2)(b(e),[])}function x(e,n){var t=g(e);t.includes(n)||(0,c.t8)(b(e),[].concat((0,o.Z)(t),[n]))}function j(e,n){var t=g(e).filter((function(e){return e!==n}));(0,c.t8)(b(e),t)}function C(e,n){var t=(0,d.HK)(n,(function(e){return e.uuid}));return e.map((function(e){return t[e]})).filter((function(e){return!!e}))}var O=function(e,n){var t=window.URL.createObjectURL(e),o=document.createElement("a");o.href=t,o.download=n,document.body.appendChild(o),o.click(),o.remove()};function Z(e,n){var t,o=(0,f.q)(),i=null===n||void 0===n?void 0:n.isPipelineUpdating,r=null===n||void 0===n?void 0:n.pipelineContentTouched,u=null===n||void 0===n?void 0:n.pipelineLastSaved;if(r)t="Unsaved changes";else if(i)t="Saving changes...";else if(u){var c=l()().utc().unix();if(null!==n&&void 0!==n&&n.displayRelative&&c-u<3600){var d=l().unix(c-(c-u)).utc().fromNow();t="Saved ".concat(d)}else{var s=(0,a.JX)(u/1e3);null!==e&&void 0!==e&&e.updated_at&&(s=(0,a.XG)(null===e||void 0===e?void 0:e.updated_at,o)),t="Last saved ".concat(s)}}else t="All changes saved";return t}function k(e){var n=e.type,t=e.uuid;return"".concat(n,"s/").concat(t,".py")}},26084:function(e,n,t){var o;t.d(n,{Q:function(){return o}}),function(e){e.CALLBACK="callbacks",e.CONDITIONAL="conditionals"}(o||(o={}))},2548:function(e,n,t){var o;t.d(n,{L:function(){return o}}),function(e){e.BLOCK_FILE="block_file",e.CUSTOM_BLOCK_TEMPLATE="custom_block_template",e.GENERATE_BLOCK="generate_block",e.MAGE_TEMPLATE="mage_template"}(o||(o={}))},13803:function(e,n,t){var o,i;t.d(n,{I:function(){return i},O:function(){return o}}),function(e){e.DESTINATIONS="destinations",e.SOURCES="sources"}(o||(o={})),function(e){e.DATA_INTEGRATION="data_integration"}(i||(i={}))},44898:function(e,n,t){t.d(n,{R:function(){return i},Z:function(){return o}});var o="blocks",i="pipelines"},84438:function(e,n,t){t.d(n,{MV:function(){return c},cp:function(){return a},zJ:function(){return r}});var o,i,r,l=t(82394),u=t(44425);!function(e){e.ACTIVEMQ="activemq",e.AMAZON_SQS="amazon_sqs",e.API="api",e.AZURE_BLOB_STORAGE="azure_blob_storage",e.AZURE_DATA_LAKE="azure_data_lake",e.AZURE_EVENT_HUB="azure_event_hub",e.BIGQUERY="bigquery",e.CLICKHOUSE="clickhouse",e.DRUID="druid",e.DUCKDB="duckdb",e.DUMMY="dummy",e.ELASTICSEARCH="elasticsearch",e.FILE="file",e.GENERIC="generic",e.GOOGLE_CLOUD_PUBSUB="google_cloud_pubsub",e.GOOGLE_CLOUD_STORAGE="google_cloud_storage",e.GOOGLE_SHEETS="google_sheets",e.INFLUXDB="influxdb",e.KAFKA="kafka",e.KINESIS="kinesis",e.MONGODB="mongodb",e.MSSQL="mssql",e.MYSQL="mysql",e.NATS="nats",e.OPENSEARCH="opensearch",e.ORACLEDB="oracledb",e.PINOT="pinot",e.POSTGRES="postgres",e.RABBITMQ="rabbitmq",e.REDSHIFT="redshift",e.S3="s3",e.SNOWFLAKE="snowflake",e.TRINO="trino"}(r||(r={}));var c=(o={},(0,l.Z)(o,r.ACTIVEMQ,"ActiveMQ"),(0,l.Z)(o,r.AMAZON_SQS,"Amazon SQS"),(0,l.Z)(o,r.API,"API"),(0,l.Z)(o,r.AZURE_BLOB_STORAGE,"Azure Blob Storage"),(0,l.Z)(o,r.AZURE_DATA_LAKE,"Azure Data Lake"),(0,l.Z)(o,r.AZURE_EVENT_HUB,"Azure Event Hub"),(0,l.Z)(o,r.BIGQUERY,"Google BigQuery"),(0,l.Z)(o,r.CLICKHOUSE,"ClickHouse"),(0,l.Z)(o,r.DRUID,"Druid"),(0,l.Z)(o,r.DUCKDB,"DuckDB"),(0,l.Z)(o,r.DUMMY,"Dummy"),(0,l.Z)(o,r.ELASTICSEARCH,"ElasticSearch"),(0,l.Z)(o,r.FILE,"Local file"),(0,l.Z)(o,r.GENERIC,"Generic (no template)"),(0,l.Z)(o,r.GOOGLE_CLOUD_PUBSUB,"Google Cloud PubSub"),(0,l.Z)(o,r.GOOGLE_CLOUD_STORAGE,"Google Cloud Storage"),(0,l.Z)(o,r.GOOGLE_SHEETS,"Google Sheets"),(0,l.Z)(o,r.INFLUXDB,"InfluxDB"),(0,l.Z)(o,r.KAFKA,"Kafka"),(0,l.Z)(o,r.KINESIS,"Kinesis"),(0,l.Z)(o,r.MONGODB,"MongoDB"),(0,l.Z)(o,r.MSSQL,"Microsoft SQL Server"),(0,l.Z)(o,r.MYSQL,"MySQL"),(0,l.Z)(o,r.NATS,"NATS"),(0,l.Z)(o,r.OPENSEARCH,"OpenSearch"),(0,l.Z)(o,r.ORACLEDB,"OracleDB"),(0,l.Z)(o,r.PINOT,"Pinot"),(0,l.Z)(o,r.POSTGRES,"PostgreSQL"),(0,l.Z)(o,r.RABBITMQ,"RabbitMQ"),(0,l.Z)(o,r.REDSHIFT,"Amazon Redshift"),(0,l.Z)(o,r.S3,"Amazon S3"),(0,l.Z)(o,r.SNOWFLAKE,"Snowflake"),(0,l.Z)(o,r.TRINO,"Trino"),o),a=(i={},(0,l.Z)(i,u.tf.DATA_LOADER,[r.GENERIC,r.FILE,r.API,r.AZURE_BLOB_STORAGE,r.BIGQUERY,r.DRUID,r.GOOGLE_CLOUD_STORAGE,r.GOOGLE_SHEETS,r.MYSQL,r.ORACLEDB,r.PINOT,r.POSTGRES,r.REDSHIFT,r.S3,r.SNOWFLAKE,r.MONGODB]),(0,l.Z)(i,u.tf.DATA_EXPORTER,[r.GENERIC,r.FILE,r.S3,r.AZURE_BLOB_STORAGE,r.GOOGLE_CLOUD_STORAGE,r.GOOGLE_SHEETS,r.REDSHIFT,r.BIGQUERY,r.SNOWFLAKE,r.MYSQL,r.POSTGRES]),(0,l.Z)(i,u.tf.TRANSFORMER,[r.REDSHIFT,r.BIGQUERY,r.SNOWFLAKE,r.POSTGRES]),(0,l.Z)(i,u.tf.SENSOR,[r.GENERIC,r.S3,r.GOOGLE_CLOUD_STORAGE,r.REDSHIFT,r.BIGQUERY,r.SNOWFLAKE,r.MYSQL,r.POSTGRES]),i);n.ZP=r},89706:function(e,n,t){t.d(n,{JD:function(){return m},Lu:function(){return r},PF:function(){return f},dT:function(){return l},n6:function(){return a},nB:function(){return v},oy:function(){return p},xF:function(){return s}});var o,i,r,l,u=t(82394),c=t(44425);!function(e){e.CSV="csv",e.JSON="json",e.MD="md",e.PY="py",e.R="r",e.SH="sh",e.SQL="sql",e.TXT="txt",e.YAML="yaml",e.YML="yml"}(r||(r={})),function(e){e.INIT_PY="__init__.py",e.METADATA_YAML="metadata.yaml",e.REQS_TXT="requirements.txt"}(l||(l={}));var a=[r.PY,r.SQL],d=[r.JSON,r.MD,r.PY,r.R,r.SH,r.SQL,r.TXT,r.YAML,r.YML],s=new RegExp(d.map((function(e){return".".concat(e,"$")})).join("|")),f=(new RegExp(d.map((function(e){return".".concat(e,"$")})).join("|")),"charts"),p="pipelines",v=(o={},(0,u.Z)(o,r.MD,c.t6.MARKDOWN),(0,u.Z)(o,r.JSON,r.JSON),(0,u.Z)(o,r.PY,c.t6.PYTHON),(0,u.Z)(o,r.R,c.t6.R),(0,u.Z)(o,r.SQL,c.t6.SQL),(0,u.Z)(o,r.TXT,"text"),(0,u.Z)(o,r.YAML,c.t6.YAML),(0,u.Z)(o,r.YML,c.t6.YAML),o),m=(i={},(0,u.Z)(i,c.t6.MARKDOWN,r.MD),(0,u.Z)(i,c.t6.PYTHON,r.PY),(0,u.Z)(i,c.t6.R,r.R),(0,u.Z)(i,c.t6.SQL,r.SQL),(0,u.Z)(i,c.t6.YAML,r.YAML),(0,u.Z)(i,"text",r.TXT),i)},61599:function(e,n,t){t.d(n,{D5:function(){return b},MU:function(){return l},RL:function(){return a},Xv:function(){return d},Zj:function(){return h},_B:function(){return i},eL:function(){return s},fe:function(){return v},jL:function(){return c},kB:function(){return g},ks:function(){return p},th:function(){return m},u7:function(){return f},zS:function(){return u}});var o,i,r=t(82394);!function(e){e.FULL_TABLE="FULL_TABLE",e.INCREMENTAL="INCREMENTAL",e.LOG_BASED="LOG_BASED"}(i||(i={}));var l,u,c=[i.FULL_TABLE,i.INCREMENTAL];!function(e){e.IGNORE="IGNORE",e.UPDATE="UPDATE"}(l||(l={})),function(e){e.DATE_TIME="date-time",e.UUID="uuid"}(u||(u={}));var a,d="datetime",s=(o={},(0,r.Z)(o,u.DATE_TIME,d),(0,r.Z)(o,u.UUID,u.UUID),o);!function(e){e.ARRAY="array",e.BOOLEAN="boolean",e.INTEGER="integer",e.NULL="null",e.NUMBER="number",e.OBJECT="object",e.STRING="string"}(a||(a={}));var f,p,v,m,h,b=[a.ARRAY,a.BOOLEAN,d,a.INTEGER,a.NULL,a.NUMBER,a.OBJECT,a.STRING,u.UUID];!function(e){e.PROPERTIES="properties"}(f||(f={})),function(e){e.AUTOMATIC="automatic",e.AVAILABLE="available",e.UNSUPPORTED="unsupported"}(p||(p={})),function(e){e.FORCED_REPLICATION_METHOD="forced-replication-method",e.KEY_PROPERTIES="table-key-properties",e.REPLICATION_KEYS="valid-replication-keys",e.SCHEMA_NAME="schema-name"}(v||(v={})),function(e){e.AMPLITUDE="amplitude",e.BIGQUERY="bigquery",e.CHARGEBEE="chargebee",e.GOOGLE_ADS="google_ads",e.GOOGLE_SEARCH_CONSOLE="google_search_console",e.GOOGLE_SHEETS="google_sheets",e.INTERCOM="intercom",e.MYSQL="mysql",e.PIPEDRIVE="pipedrive",e.POSTGRESQL="postgresql",e.REDSHIFT="redshift",e.SALESFORCE="salesforce",e.STRIPE="stripe"}(m||(m={})),function(e){e.AMAZON_S3="amazon_s3",e.BIGQUERY="bigquery",e.DELTA_LAKE_S3="delta_lake_s3",e.GOOGLE_CLOUD_STORAGE="google_cloud_storage",e.KAFKA="kafka",e.MYSQL="mysql",e.POSTGRESQL="postgresql",e.SNOWFLAKE="snowflake"}(h||(h={}));var g=[h.AMAZON_S3,h.GOOGLE_CLOUD_STORAGE,h.KAFKA]},7267:function(e,n,t){var o;t.d(n,{z:function(){return o}}),function(e){e.GENERATE_BLOCK_WITH_DESCRIPTION="generate_block_with_description",e.GENERATE_COMMENT_FOR_CODE="generate_comment_for_code",e.GENERATE_DOC_FOR_BLOCK="generate_doc_for_block",e.GENERATE_DOC_FOR_PIPELINE="generate_doc_for_pipeline",e.GENERATE_PIPELINE_WITH_DESCRIPTION="generate_pipeline_with_description"}(o||(o={}))},5677:function(e,n,t){t.d(n,{NX:function(){return m},Wt:function(){return v},_G:function(){return c},c1:function(){return p},d9:function(){return f}});var o,i,r,l,u,c,a=t(82394),d=t(8454),s=(d.Q0.AVERAGE,d.Q0.CLEAN_COLUMN_NAME,d.Q0.COUNT,d.Q0.COUNT_DISTINCT,d.Q0.CUSTOM,d.Q0.DIFF,d.Q0.FIRST,d.Q0.FIX_SYNTAX_ERRORS,d.Q0.IMPUTE,d.Q0.LAST,d.Q0.MAX,d.Q0.MEDIAN,d.Q0.MIN,d.Q0.NORMALIZE,d.Q0.REFORMAT,d.Q0.REMOVE,d.Q0.REMOVE_OUTLIERS,d.Q0.SELECT,d.Q0.SHIFT_DOWN,d.Q0.SHIFT_UP,d.Q0.STANDARDIZE,d.Q0.SUM,[d.Q0.DROP_DUPLICATE,d.Q0.FILTER,d.Q0.SORT,d.Q0.REMOVE]);!function(e){e.AGGREGATE="Aggregate",e.FORMATTING="Formatting",e.COLUMN_REMOVAL="Column removal",e.SHIFT_ROWS="Shift rows in a column",e.MISC="Miscellaneous",e.FEATURE_SCALING="Feature Scaling"}(c||(c={}));var f=(i={},(0,a.Z)(i,d.qs.COLUMN,(o={},(0,a.Z)(o,c.AGGREGATE,[d.Q0.AVERAGE,d.Q0.COUNT,d.Q0.COUNT_DISTINCT,d.Q0.FIRST,d.Q0.LAST,d.Q0.MAX,d.Q0.MEDIAN,d.Q0.MIN,d.Q0.SUM]),(0,a.Z)(o,c.FORMATTING,[d.Q0.CLEAN_COLUMN_NAME,d.Q0.FIX_SYNTAX_ERRORS,d.Q0.REFORMAT]),(0,a.Z)(o,c.COLUMN_REMOVAL,[d.Q0.REMOVE,d.Q0.SELECT]),(0,a.Z)(o,c.SHIFT_ROWS,[d.Q0.SHIFT_DOWN,d.Q0.SHIFT_UP]),(0,a.Z)(o,c.MISC,[d.Q0.DIFF,d.Q0.IMPUTE,d.Q0.REMOVE_OUTLIERS]),(0,a.Z)(o,c.FEATURE_SCALING,[d.Q0.NORMALIZE,d.Q0.STANDARDIZE]),o)),(0,a.Z)(i,d.qs.ROW,(0,a.Z)({},c.MISC,[].concat(s))),i),p=Object.keys(f[d.qs.COLUMN]),v=[c.MISC],m=(u={},(0,a.Z)(u,d.qs.COLUMN,(r={},(0,a.Z)(r,d.Q0.ADD,"Add column"),(0,a.Z)(r,d.Q0.AVERAGE,"Aggregate by average value"),(0,a.Z)(r,d.Q0.CLEAN_COLUMN_NAME,"Clean column name"),(0,a.Z)(r,d.Q0.COUNT_DISTINCT,"Aggregate by distinct count"),(0,a.Z)(r,d.Q0.COUNT,"Aggregate by total count"),(0,a.Z)(r,d.Q0.DIFF,"Difference"),(0,a.Z)(r,d.Q0.FIRST,"Aggregate by first value"),(0,a.Z)(r,d.Q0.FIX_SYNTAX_ERRORS,"Fix syntax errors"),(0,a.Z)(r,d.Q0.IMPUTE,"Fill in missing values"),(0,a.Z)(r,d.Q0.NORMALIZE,"Normalize Data"),(0,a.Z)(r,d.Q0.STANDARDIZE,"Standardize Data"),(0,a.Z)(r,d.Q0.LAST,"Aggregate by last value"),(0,a.Z)(r,d.Q0.MAX,"Aggregate by maximum value"),(0,a.Z)(r,d.Q0.MEDIAN,"Aggregate by median value"),(0,a.Z)(r,d.Q0.MIN,"Aggregate by mininum value"),(0,a.Z)(r,d.Q0.REFORMAT,"Reformat"),(0,a.Z)(r,d.Q0.REMOVE_OUTLIERS,"Remove outliers"),(0,a.Z)(r,d.Q0.REMOVE,"Remove column(s)"),(0,a.Z)(r,d.Q0.SELECT,"Keep columns"),(0,a.Z)(r,d.Q0.SHIFT_DOWN,"Shift rows down in a column"),(0,a.Z)(r,d.Q0.SHIFT_UP,"Shift rows up in a column"),(0,a.Z)(r,d.Q0.SUM,"Aggregate by sum of values"),r)),(0,a.Z)(u,d.qs.ROW,(l={},(0,a.Z)(l,d.Q0.DROP_DUPLICATE,"Drop duplicates"),(0,a.Z)(l,d.Q0.FILTER,"Filter"),(0,a.Z)(l,d.Q0.SORT,"Sort"),(0,a.Z)(l,d.Q0.REMOVE,"Remove rows"),l)),u)},56747:function(e,n,t){t.d(n,{Z:function(){return j}});var o=t(21124),i=t(40583),r=t(85223),l=t(45993),u=t(85854),c=t(48670),a=t(30160),d=t(44897),s=t(38626),f=t(95363),p=t(70515),v=t(42631),m=t(61896),h=t(47041),b="0.75em",g=s.default.div.withConfig({displayName:"indexstyle__MarkdownContainer",componentId:"sc-j72mol-0"})(["font-family:",";margin:0 ","px;overflow:auto;"," "," p{margin:0.5em 0;}blockquote{margin:"," 0;padding:","px 0;","}blockquote:before{content:'';font-size:","px;line-height:0.1em;margin-right:0.25em;vertical-align:-0.4em;}blockquote p{display:inline;}pre{border-radius:","px;white-space:pre;margin:"," 0;padding:","px;overflow-x:auto;"," "," span{padding:0;}}ul,ol{margin-bottom:",";padding-left:","px;}li{","}li > input[type='checkbox']{pointer-events:none;}table{"," margin:",";thead{font-family:",";","}th,td{padding:","px ","px;","}}"],f.ry,p.iI,h.w5,(function(e){return"\n color: ".concat((e.theme||d.Z).content.active,";\n ")}),b,p.iI,(function(e){return"\n border-left: ".concat(.5*p.iI,"px solid ").concat((e.theme||d.Z).content.active,";\n ")}),3*p.l4,v.BG,b,p.iI,h.w5,(function(e){return"\n background-color: ".concat((e.theme||d.Z).interactive.defaultBorder,";\n ")}),b,3*p.iI,m.iD,m.iD,b,f.nF,(function(e){return"\n border-bottom: ".concat(v.YF,"px solid ").concat((e.theme||d.Z).content.active,";\n ")}),.5*p.iI,.75*p.iI,(function(e){return"\n border: ".concat(v.YF,"px solid ").concat((e.theme||d.Z).content.muted,";\n ")})),x=t(28598);var j=function(e){var n=e.children;return(0,x.jsx)(g,{children:(0,x.jsx)(o.D,{components:{a:function(e){var n=e.children,t=e.href;return(0,x.jsx)(c.Z,{href:t,inline:!0,openNewWindow:!0,primary:!0,children:n})},code:function(e){var n=e.children;return(0,x.jsx)(a.ZP,{backgroundColor:d.Z.interactive.defaultBorder,inline:!0,monospace:!0,pre:!0,style:{fontSize:"13px"},children:n})},em:function(e){var n=e.children;return(0,x.jsx)(a.ZP,{inline:!0,italic:!0,children:n})},h1:function(e){var n=e.children;return(0,x.jsx)(u.Z,{level:1,children:n})},h2:function(e){var n=e.children;return(0,x.jsx)(u.Z,{level:2,children:n})},h3:function(e){var n=e.children;return(0,x.jsx)(u.Z,{level:3,children:n})},h4:function(e){var n=e.children;return(0,x.jsx)(u.Z,{level:4,children:n})},h5:function(e){var n=e.children;return(0,x.jsx)(u.Z,{level:5,children:n})},p:function(e){var n=e.children;return(0,x.jsx)(a.ZP,{children:n})},strong:function(e){var n=e.children;return(0,x.jsx)(a.ZP,{bold:!0,inline:!0,children:n})}},rehypePlugins:[i.Z,r.Z],remarkPlugins:[l.Z],children:n})})}},13507:function(e,n,t){var o=t(28598);n.Z=function(e){var n=e.fill,t=void 0===n?"white":n,i=e.size;return(0,o.jsxs)("svg",{fill:"none",height:i,viewBox:"0 0 20 20",width:i,xmlns:"http://www.w3.org/2000/svg",children:[(0,o.jsxs)("g",{clipPath:"url(#clip0_11802_82850)",children:[(0,o.jsx)("path",{d:"M15.6276 1.73378C15.97 1.96689 16.022 2.44136 15.7638 2.76532C15.5057 3.08929 15.0355 3.13958 14.69 2.91102C13.3636 2.0334 11.8126 1.54269 10.2126 1.50266C8.36175 1.45636 6.54643 2.01561 5.04253 3.09541C3.53863 4.1752 2.4284 5.71649 1.8806 7.48498C1.40702 9.01387 1.37618 10.6403 1.7837 12.1777C1.88982 12.5781 1.69185 13.0076 1.30237 13.1486C0.912892 13.2896 0.479935 13.0887 0.368517 12.6897C-0.147093 10.8435 -0.122519 8.88224 0.447763 7.04116C1.09223 4.96057 2.39838 3.14729 4.16768 1.87695C5.93697 0.606601 8.07265 -0.0513415 10.2501 0.00312922C12.1769 0.0513296 14.0431 0.655033 15.6276 1.73378Z",fill:t}),(0,o.jsx)("path",{d:"M13.2714 5.89383C13.5295 5.56986 13.4781 5.09341 13.1245 4.87771C12.2306 4.33247 11.2055 4.02828 10.15 4.00188C8.84359 3.9692 7.56218 4.36396 6.50061 5.12617C5.43903 5.88838 4.65534 6.97634 4.26866 8.22469C3.95628 9.23316 3.91679 10.3017 4.14767 11.323C4.23901 11.727 4.67403 11.928 5.06351 11.787C5.45299 11.6461 5.64766 11.216 5.57323 10.8086C5.44361 10.0989 5.48588 9.36461 5.70149 8.66852C5.9915 7.73226 6.57927 6.91628 7.37545 6.34463C8.17164 5.77297 9.13269 5.4769 10.1125 5.50141C10.841 5.51963 11.5503 5.71432 12.1813 6.06401C12.5436 6.26478 13.0133 6.2178 13.2714 5.89383Z",fill:t}),(0,o.jsx)("path",{clipRule:"evenodd",d:"M10 7.5C8.61929 7.5 7.5 8.61929 7.5 10C7.5 11.3807 8.61929 12.5 10 12.5C11.3807 12.5 12.5 11.3807 12.5 10C12.5 8.61929 11.3807 7.5 10 7.5ZM9 10C9 10.5523 9.44772 11 10 11C10.5523 11 11 10.5523 11 10C11 9.44772 10.5523 9 10 9C9.44772 9 9 9.44772 9 10Z",fill:t,fillRule:"evenodd"}),(0,o.jsx)("path",{d:"M6.87554 15.1223C6.52192 14.9066 6.47052 14.4301 6.72863 14.1062C6.98673 13.7822 7.45642 13.7352 7.81872 13.936C8.44971 14.2857 9.15897 14.4804 9.88746 14.4986C10.8673 14.5231 11.8284 14.227 12.6245 13.6554C13.4207 13.0837 14.0085 12.2677 14.2985 11.3315C14.5141 10.6354 14.5564 9.90111 14.4268 9.19144C14.3523 8.78397 14.547 8.35395 14.9365 8.21295C15.326 8.07196 15.761 8.27297 15.8523 8.67699C16.0832 9.69826 16.0437 10.7668 15.7313 11.7753C15.3447 13.0237 14.561 14.1116 13.4994 14.8738C12.4378 15.636 11.1564 16.0308 9.84995 15.9981C8.79455 15.9717 7.76942 15.6675 6.87554 15.1223Z",fill:t}),(0,o.jsx)("path",{d:"M4.23615 17.2347C3.97805 17.5586 4.03001 18.0331 4.37241 18.2662C5.95691 19.345 7.82314 19.9487 9.74992 19.9969C11.9274 20.0513 14.063 19.3934 15.8323 18.1231C17.6016 16.8527 18.9078 15.0394 19.5522 12.9588C20.1225 11.1178 20.1471 9.15647 19.6315 7.31026C19.5201 6.91131 19.0871 6.7104 18.6976 6.85139C18.3082 6.99238 18.1102 7.42188 18.2163 7.82227C18.6238 9.35971 18.593 10.9861 18.1194 12.515C17.5716 14.2835 16.4614 15.8248 14.9575 16.9046C13.4536 17.9844 11.6382 18.5436 9.78743 18.4973C8.18738 18.4573 6.63645 17.9666 5.30996 17.089C4.96451 16.8604 4.49426 16.9107 4.23615 17.2347Z",fill:t})]}),(0,o.jsx)("defs",{children:(0,o.jsx)("clipPath",{id:"clip0_11802_82850",children:(0,o.jsx)("rect",{fill:t,height:"20",width:"20"})})})]})}},94777:function(e,n,t){var o=t(75582),i=t(82684),r=t(34376),l=t(71180),u=t(55485),c=t(65956),a=t(38276),d=t(30160),s=t(89538),f=t(28598);n.Z=function(e){var n=e.shouldWarn,t=e.warningMessage,p=(0,r.useRouter)(),v=(0,i.useState)(!1),m=v[0],h=v[1],b=(0,i.useState)({isModalOpen:!1,nextRoute:null}),g=b[0],x=b[1];(0,i.useEffect)((function(){var e=function(e){if(n)return e.preventDefault(),(e||window.event).returnValue="Are you sure you want to leave?"};return window.addEventListener("beforeunload",e),function(){window.removeEventListener("beforeunload",e)}}),[n]),(0,i.useEffect)((function(){var e=function(e){if(n&&!m)throw x({isModalOpen:!0,nextRoute:e}),p.events.emit("routeChangeError"),"navigation aborted"};p.events.on("routeChangeStart",e);var t=function(){return p.events.off("routeChangeStart",e)};if(m){if(!g.nextRoute)return;return p.push(g.nextRoute),t}return t}),[g,m,p,n]);var j=(0,s.dd)((function(){return(0,f.jsxs)(c.Z,{children:[(0,f.jsx)(d.ZP,{children:t}),(0,f.jsx)(a.Z,{mt:2,children:(0,f.jsxs)(u.ZP,{alignItems:"center",children:[(0,f.jsx)(l.ZP,{onClick:function(){return h(!0)},primary:!0,children:"Leave"}),(0,f.jsx)(a.Z,{mr:1}),(0,f.jsx)(l.ZP,{onClick:function(){x({isModalOpen:!1,nextRoute:null})},secondary:!0,children:"Cancel"})]})})]})}),{},[t],{background:!0,hideCallback:function(){x({isModalOpen:!1,nextRoute:null})},uuid:"stale_pipeline_message"}),C=(0,o.Z)(j,2),O=C[0],Z=C[1];(0,i.useEffect)((function(){g.isModalOpen?O():Z()}),[Z,g.isModalOpen,O]);return{ConfirmLeaveModal:function(){return(0,f.jsx)("div",{})}}}},53405:function(e,n,t){t.d(n,{$C:function(){return Z},AP:function(){return L},I1:function(){return o},JN:function(){return Y},KN:function(){return M},Kq:function(){return Q},M$:function(){return g},MB:function(){return O},Nf:function(){return w},Qu:function(){return x},RP:function(){return R},UA:function(){return T},Uc:function(){return E},VZ:function(){return U},WD:function(){return j},WE:function(){return K},Wi:function(){return q},XE:function(){return k},Z5:function(){return y},bX:function(){return z},cU:function(){return h},eH:function(){return S},iN:function(){return H},ig:function(){return P},jC:function(){return N},jO:function(){return b},p$:function(){return I},qf:function(){return A},qx:function(){return B},th:function(){return G},wx:function(){return F},zB:function(){return _}});var o,i=t(75582),r=t(82394),l=t(21831),u=t(82684),c=t(44425),a=t(57653),d=t(61599),s=t(86735),f=t(42122);function p(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}return t}function v(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?p(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):p(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function m(e,n){return function(e,n,t){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{includeAllNodes:!1},i=(0,s.HK)(t,(function(e){return e.uuid})),r=(o||{}).includeAllNodes,l=[];function u(t){if(t){var o=(t[n]||[]).reduce((function(n,t){return e.uuid===t?n:n.concat(i[t])}),[]);(0===o.length||r&&e.uuid!==t.uuid)&&l.push(t),o.forEach((function(e){u(e)}))}}return u(e),l}(e,"upstream_blocks",n,{includeAllNodes:!0})}function h(e,n){return(0,u.useMemo)((function(){return e.map((function(t){var o=function(e,n){var t=m(e,n),o=t.filter((function(n){var t=n.configuration,o=n.uuid;return(null===t||void 0===t?void 0:t.dynamic)&&o!==(null===e||void 0===e?void 0:e.uuid)})),i=t.filter((function(n){var t=n.configuration,o=n.uuid;return(null===t||void 0===t?void 0:t.reduce_output)&&o!==(null===e||void 0===e?void 0:e.uuid)}));return{dynamicUpstreamBlock:o[0],dynamicUpstreamBlocks:o,reduceOutputUpstreamBlock:i[0],reduceOutputUpstreamBlocks:i}}(t,n),i=o.dynamicUpstreamBlock,r=o.dynamicUpstreamBlocks,l=o.reduceOutputUpstreamBlock,u=o.reduceOutputUpstreamBlocks,c=(t||{}).configuration||{},a=c.dynamic,d=c.reduce_output;return{block:t,blocksToUse:e,dynamic:!!a,dynamicUpstreamBlock:i,dynamicUpstreamBlocks:r,reduceOutput:!!d,reduceOutputUpstreamBlock:l,reduceOutputUpstreamBlocks:u}}))}),[n,null===n||void 0===n?void 0:n.map((function(e){var n=e.configuration;return null===n||void 0===n?void 0:n.dynamic})),null===n||void 0===n?void 0:n.map((function(e){var n=e.configuration;return null===n||void 0===n?void 0:n.reduce_output})),null===n||void 0===n?void 0:n.map((function(e){return e.upstream_blocks}))])}function b(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,t=e||{},o=t.configuration,i=t.language,r=t.type,l=o||{},u=l.data_integration,d=[c.tf.DATA_LOADER,c.tf.DATA_EXPORTER].includes(r);if(a.qL.PYTHON===(null===n||void 0===n?void 0:n.type)&&d){if(c.t6.YAML===i)return!0;if(c.t6.PYTHON===i&&u)return!0}return!1}function g(e){return(null===e||void 0===e?void 0:e.stream)||(null===e||void 0===e?void 0:e.tap_stream_id)}function x(e){return null===e||void 0===e?void 0:e.parent_stream}function j(e){return[x(e),g(e)].filter((function(e){return e})).join("/")}function C(e){var n;return 0===(null===e||void 0===e||null===(n=e.breadcrumb)||void 0===n?void 0:n.length)}function O(e){var n;return(null===e||void 0===e||null===(n=e.metadata)||void 0===n?void 0:n.find(C))||{breadcrumb:[],metadata:{}}}function Z(e,n){var t=(null===n||void 0===n?void 0:n.catalog)||{streams:[]},o=(0,l.Z)((null===t||void 0===t?void 0:t.streams)||[]),i=null===o||void 0===o?void 0:o.findIndex((function(n){return j(n)===j(e)}));return i>=0?o[i]=e:o.push(e),v(v({},n),{},{catalog:v(v({},t),{},{streams:o})})}function k(e,n){var t,o,i=v({},e);null!==i&&void 0!==i&&i.metadata||(i.metadata=[]);var r=null===i||void 0===i||null===(t=i.metadata)||void 0===t?void 0:t.findIndex(C),l={breadcrumb:[],metadata:{}};r>=0&&(l=O(i)||{breadcrumb:[],metadata:{}});var u=v(v({},l),{},{metadata:v(v({},null===(o=l)||void 0===o?void 0:o.metadata),n)});return r>=0?i.metadata[r]=u:i.metadata.push(u),i}function y(e){var n,t,o=(e||{}).metadata;return null===o||void 0===o||null===(n=o.find(C))||void 0===n||null===(t=n.metadata)||void 0===t?void 0:t.selected}function E(e,n){var t=(n||{}).getAll,o=null===e||void 0===e?void 0:e.catalog,i=(null===o||void 0===o?void 0:o.streams)||[];return t?i:null===i||void 0===i?void 0:i.filter(y)}function T(e,n){var t=n||{},o=t.noParents,i=t.parents,r={noParents:{},parents:{}};return null===e||void 0===e||e.forEach((function(e){var n,t=null===e||void 0===e?void 0:e.parent_stream,l=g(e);t?null!==i&&void 0!==i&&null!==(n=i[t])&&void 0!==n&&n[l]||(r.parents[t]||(r.parents[t]={}),r.parents[t][l]=e):null!==o&&void 0!==o&&o[l]||(r.noParents[l]=e)})),r}function S(e){var n=e||{},t=n.noParents,o=void 0===t?{}:t,i=n.parents,r=void 0===i?{}:i;return Object.values(o||[]).concat(Object.values(r||[]).reduce((function(e,n){return e.concat(Object.values(n))}),[]))}function _(e,n){var t,o,i,r=null===e||void 0===e?void 0:e.parent_stream,l=g(e);return r?null===n||void 0===n||null===(o=n.parents)||void 0===o||null===(i=o[r])||void 0===i?void 0:i[l]:null===n||void 0===n||null===(t=n.noParents)||void 0===t?void 0:t[l]}function P(e,n,t){return!!_(e,n)&&!!_(e,t)}function I(e,n,t){var o=function(e,n){var t,o,r={},l=[],u={};function c(e,n){null!==r&&void 0!==r&&r[e]||(r[e]={}),r[e]=v(v({},null===r||void 0===r?void 0:r[e]),n)}var a=(null===e||void 0===e||null===(t=e.schema)||void 0===t?void 0:t.properties)||{},d=(null===n||void 0===n||null===(o=n.schema)||void 0===o?void 0:o.properties)||{};return Object.entries(a).forEach((function(e){var n=(0,i.Z)(e,2),t=n[0],o=n[1],a=null===d||void 0===d?void 0:d[t];if(a){var p=(null===o||void 0===o?void 0:o.type)||[];p=Array.isArray(p)?p:[p];var v=(null===a||void 0===a?void 0:a.type)||[];v=Array.isArray(v)?v:[v],(0,s.fS)(p,v)||c(t,{type:p});var m=null===o||void 0===o?void 0:o.format;m!==(null===a||void 0===a?void 0:a.format)&&c(t,{format:m});var h=(null===o||void 0===o?void 0:o.anyOf)||{},b=(null===a||void 0===a?void 0:a.anyOf)||{};(0,f.Xy)(h,b)||c(t,{anyOf:h}),null!==r&&void 0!==r&&r[t]&&(u[t]=o)}else l.push(t),u[t]=o})),{newColumnSettings:r,newColumns:l,stream:v(v({},n),{},{schema:v(v({},null===n||void 0===n?void 0:n.schema),{},{properties:v(v(v({},d),u),r)})})}}(_(e,n),_(e,t)),r=o||{},l=r.newColumnSettings,u=r.newColumns;if(!(0,f.Qr)(l||{})||(null===u||void 0===u?void 0:u.length)>=1)return o}function A(e,n){return[].concat((0,l.Z)(Object.values(e||{})),(0,l.Z)(Object.values(n||{}))).every((function(e){return(0,f.Qr)(e)}))}function R(e){var n,t,o=v({},(null===e||void 0===e||null===(n=e.schema)||void 0===n?void 0:n.properties)||{});return null===e||void 0===e||null===(t=e.metadata)||void 0===t||t.forEach((function(e){if(!C(e)){var n,t=null===e||void 0===e||null===(n=e.breadcrumb)||void 0===n?void 0:n.find((function(e){return e!==d.u7.PROPERTIES}));t&&null!==o&&void 0!==o&&o[t]&&(o[t]=v(v({},o[t]),{},{metadata:e}))}})),o}function w(e){var n;return null===e||void 0===e||null===(n=e.metadata)||void 0===n?void 0:n.reduce((function(e,n){if(C(n))return e;var t=D(n);return t&&(e[t]=n),e}),{})}function D(e){var n;return null===e||void 0===e||null===(n=e.breadcrumb)||void 0===n?void 0:n.find((function(e){return e!==d.u7.PROPERTIES}))}function N(e){return{breadcrumb:[d.u7.PROPERTIES,e],metadata:{inclusion:d.ks.AVAILABLE,selected:!0}}}function M(e,n){var t;return v(v({},e),{},{schema:v(v({},null===e||void 0===e?void 0:e.schema),{},{properties:v(v({},null===e||void 0===e||null===(t=e.schema)||void 0===t?void 0:t.properties),n)})})}function L(e,n){var t=O(e),o=v(v({},w(e)),n);return v(v({},e),{},{metadata:[t].concat((0,l.Z)(Object.values(o||{})))})}function B(e,n){var t=n||{},o=t.type,i=t.typesDerived,r=v({},n),u=(0,l.Z)(o),c=(0,l.Z)(i);return null===e||void 0===e||e.forEach((function(e){d.Xv===e?r.format=d.zS.DATE_TIME:d.zS.UUID===e?r.format=d.zS.UUID:(null!==u&&void 0!==u&&u.includes(e)||u.push(e),null!==c&&void 0!==c&&c.includes(e)||c.push(e))})),v(v({},r),{},{type:u,typesDerived:c})}function U(e,n){var t=n||{},o=t.format,i=t.type,r=t.typesDerived,u=v({},n),c=(0,l.Z)(i),a=(0,l.Z)(r);return null===e||void 0===e||e.forEach((function(e){if(o&&d.eL[o]===e)delete u.format;else{var n,t,i,r;if(null!==(n=c)&&void 0!==n&&n.includes(e))c=(0,l.Z)(null===(i=c)||void 0===i?void 0:i.filter((function(n){return n!==e})));if(null!==(t=a)&&void 0!==t&&t.includes(e))a=(0,l.Z)(null===(r=a)||void 0===r?void 0:r.filter((function(n){return n!==e})))}})),v(v({},u),{},{type:c,typesDerived:a})}function F(e,n){var t=n||{},o=t.format,i=t.type,r=void 0===i?[]:i,l=null===r||void 0===r?void 0:r.filter((function(e){var n;return!(null!==(n=[d.Xv,d.zS.UUID])&&void 0!==n&&n.includes(e))}));return d.eL[o]&&(null!==l&&void 0!==l&&l.includes(d.eL[o])||l.push(d.eL[o])),v(v({},n),{},{typesDerived:l,uuid:e})}function G(e){var n=e||{},t=n.noParents,o=n.parents;return[{groupHeader:null,streams:(0,s.YC)(Object.values(t),(function(e){return g(e)}))}].concat((0,l.Z)((0,s.YC)(Object.entries(o),(function(e){return(0,i.Z)(e,1)[0]})).map((function(e){var n=(0,i.Z)(e,2),t=n[0],o=n[1];return{groupHeader:t,streams:(0,s.YC)(Object.values(o),(function(e){return g(e)}))}}))))}function H(e,n,t){var o,i,l,u=(t||{}).remove,c=g(e||{}),a=x(e||{}),d=v({},n);if(a)u?null===d||void 0===d||(null===(o=d.parents)||void 0===o||(null===(i=o[a])||void 0===i||delete i[c])):d.parents=v(v({},null===d||void 0===d?void 0:d.parents),{},(0,r.Z)({},a,v(v({},null===d||void 0===d||null===(l=d.parents)||void 0===l?void 0:l[a]),{},(0,r.Z)({},c,e))));else if(c){var s;if(u)null===d||void 0===d||(null===(s=d.noParents)||void 0===s||delete s[c]);else d.noParents=v(v({},null===d||void 0===d?void 0:d.noParents),{},(0,r.Z)({},c,e))}return d}function z(e,n){var t=[o.AUTO_ADD_NEW_FIELDS,o.DISABLE_COLUMN_TYPE_CHECK,o.REPLICATION_METHOD,o.RUN_IN_PARALLEL,o.UNIQUE_CONFLICT_METHOD],l=Object.entries(n||{}).reduce((function(e,n){var t=(0,i.Z)(n,2),o=t[0],l=t[1],u=l.selected,c=l.value;return v(v({},e),u?(0,r.Z)({},o,c):{})}),{}),u=v({},e),c=e&&S(e)||[];return null===c||void 0===c||c.forEach((function(e){u=H(function(e){var n,o=v({},e);return null===o||void 0===o||null===(n=o.schema)||void 0===n||n.properties,Object.entries(l||{}).forEach((function(e){var n=(0,i.Z)(e,2),r=n[0],l=n[1];t.includes(r)&&(o[r]=l)})),o}(e),u)})),u}function Q(e,n,t){var l=[o.BOOKMARK_PROPERTIES,o.KEY_PROPERTIES,o.PARTITION_KEYS,o.UNIQUE_CONSTRAINTS],u=Object.entries(n||{}).reduce((function(e,n){var t=(0,i.Z)(n,2),o=t[0];return t[1]?e.concat(o):e}),[]),c=Object.entries(t||{}).reduce((function(e,n){var t=(0,i.Z)(n,2),o=t[0],l=t[1],u=l.selected,c=l.value;return v(v({},e),u?(0,r.Z)({},o,c):{})}),{}),a=v({},e),p=e&&S(e)||[];return null===p||void 0===p||p.forEach((function(e){a=H(function(e){var n,t=v({},e),r=(null===t||void 0===t||null===(n=t.schema)||void 0===n?void 0:n.properties)||{},a=w(e);return null===u||void 0===u||u.forEach((function(e){null!==r&&void 0!==r&&r[e]&&Object.entries(c||{}).forEach((function(n){var u=(0,i.Z)(n,2),c=u[0],p=u[1];if(o.PROPERTY_SELECTED===c){var m=(null===a||void 0===a?void 0:a[e])||N(e)||{breadcrumb:[],metadata:{}},h=v(v({},m),{},{metadata:v(v({},null===m||void 0===m?void 0:m.metadata),{},{selected:p})});a[e]=h}else if(l.includes(c)){var b;null!==t&&void 0!==t&&t[c]||(t[c]=[]);var g=null===(b=t[c])||void 0===b?void 0:b.includes(e);p&&!g?t[c].push(e):!p&&g&&(t[c]=(0,s.Od)(t[c],(function(n){return n===e})))}else if(d.D5.includes(c)){var x,j=v({},(null===r||void 0===r?void 0:r[e])||{}),C=(p?B:U)([c],F(e,j)),O=C.anyOf,Z=C.format,k=C.type;null!==t&&void 0!==t&&t.schema||(t.schema={properties:{}}),null!==t&&void 0!==t&&null!==(x=t.schema)&&void 0!==x&&x.properties||(t.schema=v(v({},null===t||void 0===t?void 0:t.schema),{},{properties:{}}));var y=(0,f.hB)({anyOf:O,format:Z,type:k});t.schema.properties[e]=y}}))})),L(t,a)}(e),a)})),a}function K(e){var n,t,o=(null===e||void 0===e||null===(n=e.schema)||void 0===n?void 0:n.properties)||{};return null===e||void 0===e||null===(t=e.metadata)||void 0===t?void 0:t.reduce((function(e,n){var t;if(C(n))return e;if(!(null===n||void 0===n||null===(t=n.metadata)||void 0===t?void 0:t.selected))return e;var i=D(n),l=null===o||void 0===o?void 0:o[i];return v(v({},e),{},(0,r.Z)({},i,v(v({},l),{},{metadata:n,uuid:i})))}),{})}function q(e,n){var t=(null===n||void 0===n?void 0:n.inputs)||{};return null===e||void 0===e?void 0:e.reduce((function(e,n){var o=null===n||void 0===n?void 0:n.uuid,i=o&&(null===t||void 0===t?void 0:t[o]);return i?e.concat({block:n,input:i}):e}),[])}function Y(e){var n,t,o={},r={},l={};return null===e||void 0===e||null===(n=e.metadata)||void 0===n||n.forEach((function(e){if(!C(e)){var n,t=D(e);if(t&&null!==e&&void 0!==e&&e.metadata)l[t]=null===e||void 0===e||null===(n=e.metadata)||void 0===n?void 0:n.selected}})),Object.entries((null===e||void 0===e||null===(t=e.schema)||void 0===t?void 0:t.properties)||{}).forEach((function(e){var n=(0,i.Z)(e,2),t=n[0],u=v(v({},n[1]),{},{uuid:t});t in l?null!==l&&void 0!==l&&l[t]&&(r[t]=u):r[t]=u,o[t]=u})),{allColumns:o,selectedColumns:r}}!function(e){e.AUTO_ADD_NEW_FIELDS="auto_add_new_fields",e.BOOKMARK_PROPERTIES="bookmark_properties",e.DISABLE_COLUMN_TYPE_CHECK="disable_column_type_check",e.KEY_PROPERTIES="key_properties",e.PARTITION_KEYS="partition_keys",e.PROPERTY_SELECTED="property_selected",e.REPLICATION_METHOD="replication_method",e.RUN_IN_PARALLEL="run_in_parallel",e.UNIQUE_CONFLICT_METHOD="unique_conflict_method",e.UNIQUE_CONSTRAINTS="unique_constraints"}(o||(o={}))},22286:function(e,n,t){t.d(n,{M:function(){return d}});var o=t(82394),i=t(75582),r=t(54193),l=t(81728),u=t(42122);function c(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n&&(o=o.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,o)}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,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}function d(e,n){var t,c;if(!n||null===n||void 0===n||!n.length)return e;if(null!==n&&void 0!==n&&n.includes(r.zj.LIST))return((0,u.Kn)(e)?Object.keys(e||{}):[e]).map((function(e){return d(e,null===n||void 0===n?void 0:n.filter((function(e){return r.zj.LIST!==e})))}));if(null!==n&&void 0!==n&&n.includes(r.zj.DICTIONARY)){var s=(0,u.Kn)(e)?e:(0,l.Pb)(e)?JSON.parse(e):e;if((0,u.Kn)(s))return Object.entries(s).reduce((function(e,t){var l=(0,i.Z)(t,2),u=l[0],c=l[1];return a(a({},e),{},(0,o.Z)({},u,d(c,null===n||void 0===n?void 0:n.filter((function(e){return r.zj.DICTIONARY!==e})))))}),{})}if(null!==n&&void 0!==n&&n.includes(r.zj.BOOLEAN)){var f,p;if("boolean"===typeof e)return e;if("true"===(null===(f=String(e))||void 0===f?void 0:f.toLowerCase()))return!0;if("false"===(null===(p=String(e))||void 0===p?void 0:p.toLowerCase()))return!1}return null!==n&&void 0!==n&&null!==(t=n.includes)&&void 0!==t&&t.call(n,r.zj.FLOAT)&&(0,l.HW)(e)?parseFloat(e):null!==n&&void 0!==n&&null!==(c=n.includes)&&void 0!==c&&c.call(n,r.zj.INTEGER)&&(0,l.HW)(e)?parseInt(e):e}},65044:function(e,n,t){t.d(n,{Gr:function(){return i},Lz:function(){return o},Vc:function(){return l},gr:function(){return r}});var o=/\[__internal_output__\]/,i=/\[__internal_test__\]/,r="[__internal_output__]",l="[__internal_test__]"},58325:function(e,n,t){var o;t.d(n,{V5:function(){return r}}),function(e){e.ANDROID="Android",e.CHROME_OS="ChromeOS",e.IOS="iOS",e.LINUX="Linux",e.MAC="macOS",e.WINDOWS="Windows"}(o||(o={}));var i=o;function r(){return function(){var e,n,t,o,r,l,u,c=i.MAC,a=null===(e=window)||void 0===e||null===(n=e.navigator)||void 0===n?void 0:n.userAgent,d=(null===(t=window)||void 0===t||null===(o=t.navigator)||void 0===o||null===(r=o.userAgentData)||void 0===r?void 0:r.platform)||(null===(l=window)||void 0===l||null===(u=l.navigator)||void 0===u?void 0:u.platform);return d?["macOS","Macintosh","MacIntel","MacPPC","Mac68K"].includes(d)?c=i.MAC:["Win32","Win64","Windows","WinCE"].includes(d)?c=i.WINDOWS:["iPhone","iPad","iPod"].includes(d)&&(c=i.IOS):a&&(a.includes("Macintosh")?c=i.MAC:a.includes("Windows")?c=i.WINDOWS:a.includes("Linux")&&a.includes("X11")?c=i.LINUX:/(iPhone|iPad)/.test(a)?c=i.IOS:a.includes("Android")&&a.includes("Mobi")?c=i.ANDROID:a.includes("CrOS")&&(c=i.CHROME_OS)),c}()===i.MAC}}}]);
|