mage-ai 0.9.44__py3-none-any.whl → 0.9.46__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of mage-ai might be problematic. Click here for more details.

Files changed (540) hide show
  1. mage_ai/api/constants.py +2 -0
  2. mage_ai/api/operations/base.py +208 -12
  3. mage_ai/api/policies/BasePolicy.py +3 -3
  4. mage_ai/api/policies/ComputeClusterPolicy.py +96 -0
  5. mage_ai/api/policies/ComputeConnectionPolicy.py +74 -0
  6. mage_ai/api/policies/ComputeServicePolicy.py +50 -0
  7. mage_ai/api/policies/DownloadPolicy.py +29 -0
  8. mage_ai/api/policies/GitCustomBranchPolicy.py +1 -0
  9. mage_ai/api/policies/GlobalHookPolicy.py +126 -0
  10. mage_ai/api/policies/OauthPolicy.py +56 -7
  11. mage_ai/api/policies/ProjectPolicy.py +1 -0
  12. mage_ai/api/policies/RolePolicy.py +12 -1
  13. mage_ai/api/presenters/ComputeClusterPresenter.py +19 -0
  14. mage_ai/api/presenters/ComputeConnectionPresenter.py +26 -0
  15. mage_ai/api/presenters/ComputeServicePresenter.py +15 -0
  16. mage_ai/api/presenters/DownloadPresenter.py +13 -0
  17. mage_ai/api/presenters/GlobalHookPresenter.py +74 -0
  18. mage_ai/api/presenters/OauthPresenter.py +1 -0
  19. mage_ai/api/presenters/PipelinePresenter.py +1 -0
  20. mage_ai/api/presenters/ProjectPresenter.py +1 -0
  21. mage_ai/api/presenters/SparkApplicationPresenter.py +2 -0
  22. mage_ai/api/presenters/WorkspacePresenter.py +22 -22
  23. mage_ai/api/resources/AsyncBaseResource.py +39 -0
  24. mage_ai/api/resources/BackfillResource.py +1 -0
  25. mage_ai/api/resources/BlockResource.py +57 -0
  26. mage_ai/api/resources/ClusterResource.py +1 -1
  27. mage_ai/api/resources/ComputeClusterResource.py +109 -0
  28. mage_ai/api/resources/ComputeConnectionResource.py +103 -0
  29. mage_ai/api/resources/ComputeServiceResource.py +35 -0
  30. mage_ai/api/resources/DownloadResource.py +56 -0
  31. mage_ai/api/resources/ExecutionStateResource.py +1 -1
  32. mage_ai/api/resources/GitBranchResource.py +35 -29
  33. mage_ai/api/resources/GitCustomBranchResource.py +9 -0
  34. mage_ai/api/resources/GlobalHookResource.py +192 -0
  35. mage_ai/api/resources/KernelResource.py +10 -0
  36. mage_ai/api/resources/OauthResource.py +60 -98
  37. mage_ai/api/resources/PipelineResource.py +4 -4
  38. mage_ai/api/resources/PipelineScheduleResource.py +37 -16
  39. mage_ai/api/resources/ProjectResource.py +5 -3
  40. mage_ai/api/resources/SessionResource.py +24 -9
  41. mage_ai/api/resources/SparkApplicationResource.py +5 -5
  42. mage_ai/api/resources/SparkEnvironmentResource.py +1 -2
  43. mage_ai/api/resources/SparkExecutorResource.py +1 -2
  44. mage_ai/api/resources/SparkJobResource.py +3 -6
  45. mage_ai/api/resources/SparkSqlResource.py +6 -11
  46. mage_ai/api/resources/SparkStageAttemptResource.py +2 -3
  47. mage_ai/api/resources/SparkStageAttemptTaskResource.py +1 -2
  48. mage_ai/api/resources/SparkStageAttemptTaskSummaryResource.py +1 -2
  49. mage_ai/api/resources/SparkStageResource.py +3 -6
  50. mage_ai/api/resources/SparkThreadResource.py +1 -2
  51. mage_ai/api/resources/UserResource.py +32 -31
  52. mage_ai/api/resources/mixins/spark.py +25 -4
  53. mage_ai/authentication/oauth/constants.py +4 -0
  54. mage_ai/authentication/oauth2.py +1 -3
  55. mage_ai/authentication/permissions/constants.py +4 -0
  56. mage_ai/authentication/providers/__init__.py +0 -0
  57. mage_ai/authentication/providers/active_directory.py +136 -0
  58. mage_ai/authentication/providers/constants.py +17 -0
  59. mage_ai/authentication/providers/ghe.py +81 -0
  60. mage_ai/authentication/providers/google.py +86 -0
  61. mage_ai/authentication/providers/oauth.py +60 -0
  62. mage_ai/authentication/providers/okta.py +101 -0
  63. mage_ai/authentication/providers/sso.py +20 -0
  64. mage_ai/authentication/providers/utils.py +12 -0
  65. mage_ai/cluster_manager/aws/emr_cluster_manager.py +2 -1
  66. mage_ai/cluster_manager/workspace/base.py +7 -3
  67. mage_ai/data_integrations/destinations/constants.py +2 -0
  68. mage_ai/data_preparation/executors/block_executor.py +3 -0
  69. mage_ai/data_preparation/executors/pipeline_executor.py +9 -0
  70. mage_ai/data_preparation/git/__init__.py +3 -3
  71. mage_ai/data_preparation/git/api.py +69 -35
  72. mage_ai/data_preparation/models/block/__init__.py +95 -60
  73. mage_ai/data_preparation/models/block/data_integration/data.py +1 -1
  74. mage_ai/data_preparation/models/block/dbt/block_sql.py +95 -1
  75. mage_ai/data_preparation/models/block/dbt/utils.py +6 -0
  76. mage_ai/data_preparation/models/block/spark/mixins.py +82 -34
  77. mage_ai/data_preparation/models/download/__init__.py +8 -0
  78. mage_ai/data_preparation/models/global_hooks/__init__.py +0 -0
  79. mage_ai/data_preparation/models/global_hooks/constants.py +44 -0
  80. mage_ai/data_preparation/models/global_hooks/models.py +928 -0
  81. mage_ai/data_preparation/models/global_hooks/utils.py +21 -0
  82. mage_ai/data_preparation/models/pipeline.py +82 -6
  83. mage_ai/data_preparation/models/pipelines/models.py +16 -0
  84. mage_ai/data_preparation/models/project/__init__.py +6 -0
  85. mage_ai/data_preparation/models/project/constants.py +1 -0
  86. mage_ai/data_preparation/models/project/models.py +12 -0
  87. mage_ai/data_preparation/repo_manager.py +23 -1
  88. mage_ai/data_preparation/templates/callbacks/base.jinja +4 -0
  89. mage_ai/data_preparation/templates/data_exporters/streaming/kafka.yaml +1 -0
  90. mage_ai/data_preparation/templates/data_loaders/streaming/activemq.yaml +6 -0
  91. mage_ai/data_preparation/templates/data_loaders/streaming/kafka.yaml +1 -0
  92. mage_ai/data_preparation/templates/data_loaders/streaming/nats.yaml +20 -0
  93. mage_ai/data_preparation/templates/repo/io_config.yaml +2 -2
  94. mage_ai/io/duckdb.py +0 -1
  95. mage_ai/orchestration/concurrency.py +8 -1
  96. mage_ai/orchestration/db/models/schedules.py +23 -2
  97. mage_ai/orchestration/pipeline_scheduler.py +168 -105
  98. mage_ai/orchestration/queue/process_queue.py +9 -1
  99. mage_ai/orchestration/triggers/api.py +11 -3
  100. mage_ai/orchestration/triggers/constants.py +1 -0
  101. mage_ai/orchestration/triggers/utils.py +23 -0
  102. mage_ai/server/active_kernel.py +37 -4
  103. mage_ai/server/api/downloads.py +76 -1
  104. mage_ai/server/api/triggers.py +1 -0
  105. mage_ai/server/constants.py +1 -1
  106. mage_ai/server/frontend_dist/404.html +2 -2
  107. mage_ai/server/frontend_dist/_next/static/9jB4XPuz6BzxBcG9VNao5/_buildManifest.js +1 -0
  108. mage_ai/server/frontend_dist/_next/static/chunks/1749-9a6276b2918fdae1.js +1 -0
  109. mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/7519-8c29bbb92e03cc77.js → frontend_dist/_next/static/chunks/1845-5ce774d5ab81ed57.js} +1 -1
  110. mage_ai/server/frontend_dist/_next/static/chunks/1952-ac7722e8b1ab88fe.js +1 -0
  111. mage_ai/server/frontend_dist/_next/static/chunks/3419-f8d518d024e7b5c8.js +1 -0
  112. mage_ai/server/frontend_dist/_next/static/chunks/4267-fd4d8049e83178de.js +1 -0
  113. mage_ai/server/frontend_dist/_next/static/chunks/4366-93e09e5a4a7e182c.js +1 -0
  114. mage_ai/server/frontend_dist/_next/static/chunks/5457-949640f4037bf12f.js +1 -0
  115. mage_ai/server/frontend_dist/_next/static/chunks/5499-76cf8f023c6b0985.js +1 -0
  116. mage_ai/server/frontend_dist/_next/static/chunks/553-7f7919e14392ca67.js +1 -0
  117. mage_ai/server/frontend_dist/_next/static/chunks/5638-a65610405a70961c.js +1 -0
  118. mage_ai/server/frontend_dist/_next/static/chunks/5810-12eadc488265d55b.js +1 -0
  119. mage_ai/server/frontend_dist/_next/static/chunks/5820-28adeabb5cda2b96.js +1 -0
  120. mage_ai/server/frontend_dist/_next/static/chunks/595-0d174b1f9fbfce4f.js +1 -0
  121. mage_ai/server/frontend_dist/_next/static/chunks/600-705fe234320ec5de.js +1 -0
  122. mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/3122-f27de34d0b5426af.js → frontend_dist/_next/static/chunks/6285-e9b45335bfb9ccaf.js} +1 -1
  123. mage_ai/server/frontend_dist/_next/static/chunks/6333-bc1b433b428a9095.js +1 -0
  124. mage_ai/server/frontend_dist/_next/static/chunks/{5397-b5f2e477acc6bd6b.js → 6965-c613d1834c8ed92d.js} +1 -1
  125. mage_ai/server/frontend_dist/_next/static/chunks/{7022-18fde36eb46e1d65.js → 7022-070ec0144a4d029c.js} +1 -1
  126. mage_ai/server/frontend_dist/_next/static/chunks/722-a1584445357a276c.js +1 -0
  127. mage_ai/server/frontend_dist/_next/static/chunks/{7858-c83d25349d0e980f.js → 7858-d9df72e95e438284.js} +1 -1
  128. mage_ai/server/frontend_dist/_next/static/chunks/8264-0d582a6ca33c3dfa.js +1 -0
  129. mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/3684-cbda680fd8927d07.js → frontend_dist/_next/static/chunks/8432-f191e39f9b5893f2.js} +1 -1
  130. mage_ai/server/frontend_dist/_next/static/chunks/90-a7308bae028d7001.js +1 -0
  131. mage_ai/server/frontend_dist/_next/static/chunks/9264-1d4f0327d42fed91.js +1 -0
  132. mage_ai/server/frontend_dist/_next/static/chunks/9618-2c5045255ac5a6e7.js +1 -0
  133. mage_ai/server/frontend_dist/_next/static/chunks/{976-27c4eed1c9b20c44.js → 976-18c98af60b76f1a7.js} +1 -1
  134. mage_ai/server/frontend_dist/_next/static/chunks/framework-22b71764bf44ede4.js +1 -0
  135. mage_ai/server/frontend_dist/_next/static/chunks/pages/_app-ebef928183f9a3bb.js +1 -0
  136. mage_ai/server/frontend_dist/_next/static/chunks/pages/block-layout-a24cb24b6f08bbc9.js +1 -0
  137. mage_ai/server/frontend_dist/_next/static/chunks/pages/compute-419775ca1293b354.js +1 -0
  138. mage_ai/server/frontend_dist/_next/static/chunks/pages/files-0f2d4be6fdca86ca.js +1 -0
  139. mage_ai/server/frontend_dist/_next/static/chunks/pages/global-data-products/{[...slug]-3f6fc312f67ff72e.js → [...slug]-cfd68e760ae00958.js} +1 -1
  140. mage_ai/server/frontend_dist/_next/static/chunks/pages/{global-data-products-f4cd03036c3e8723.js → global-data-products-c3b79ef31007f95b.js} +1 -1
  141. mage_ai/server/frontend_dist/_next/static/chunks/pages/global-hooks/[...slug]-77edfa32d000e88b.js +1 -0
  142. mage_ai/server/frontend_dist/_next/static/chunks/pages/global-hooks-e561ae38cf5592e8.js +1 -0
  143. mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/files-449a022f2f0f2d94.js +1 -0
  144. mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/settings-60845f0b59142f32.js +1 -0
  145. 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
  146. mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/users/new-abd8571907664fdf.js +1 -0
  147. mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/{users-a7c970122a10afdc.js → users-28a930b148d99766.js} +1 -1
  148. mage_ai/server/frontend_dist/_next/static/chunks/pages/manage-f83deb790548693b.js +1 -0
  149. mage_ai/server/frontend_dist/_next/static/chunks/pages/oauth-8bb62c4f6a511c43.js +1 -0
  150. mage_ai/server/frontend_dist/_next/static/chunks/pages/overview-f0c40645f385f23f.js +1 -0
  151. mage_ai/server/frontend_dist/_next/static/chunks/pages/{pipeline-runs-c79819d6826e5416.js → pipeline-runs-b35d37bfba8fbccc.js} +1 -1
  152. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-10e9a2d19541caa2.js +1 -0
  153. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills-c8d3a5289ab93f88.js +1 -0
  154. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/dashboard-571c0962333b92f0.js +1 -0
  155. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-ff7e9108502f5716.js +1 -0
  156. mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/logs-a52d2d3e0c2978f4.js → frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/logs-ef680455ae54ccbe.js} +1 -1
  157. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runs-ddddcddd2f74b4f6.js +1 -0
  158. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-4a238307feddb522.js +1 -0
  159. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors-e051057d9fe94f23.js +1 -0
  160. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs/{[run]-4977276c8f84b5f4.js → [run]-0691711636fa95c7.js} +1 -1
  161. 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
  162. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/settings-2914e326a5f1ffe0.js +1 -0
  163. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/syncs-b75bf17498e87354.js +1 -0
  164. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-3a7500e6e53084d3.js +1 -0
  165. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers-c0e551d265a8d467.js +1 -0
  166. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/{[pipeline]-35fe7762cb83a733.js → [pipeline]-02c843b9c8418bb5.js} +1 -1
  167. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines-e47db5c3eaf683af.js +1 -0
  168. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/account/profile-55ac955dfa9a5a8d.js +1 -0
  169. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/permissions/{[...slug]-d6a62284c7c99cb3.js → [...slug]-b78b1be5b9ed84b9.js} +1 -1
  170. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/{permissions-b1389695f758c32b.js → permissions-37b78a436eeab258.js} +1 -1
  171. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/preferences-29c92a9bc54ae5cd.js +1 -0
  172. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/roles/{[...slug]-0bdb66265286ab22.js → [...slug]-db05a80d18c168e5.js} +1 -1
  173. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/{roles-e04e18fc295ca76a.js → roles-f55c77e4f46c8d33.js} +1 -1
  174. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/sync-data-2a1f8737561fdd94.js +1 -0
  175. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/users/{[...slug]-0267358c91122109.js → [...slug]-e3bf6e5d8bb250c4.js} +1 -1
  176. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/{users-50fed18bb9b8d142.js → users-20f0a050a42a015d.js} +1 -1
  177. mage_ai/server/frontend_dist/_next/static/chunks/pages/{settings-56f83205752b1323.js → settings-0f0121db7f5ff93d.js} +1 -1
  178. mage_ai/server/frontend_dist/_next/static/chunks/pages/sign-in-99e2748e3c1d57a3.js +1 -0
  179. 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
  180. mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/templates-3cff90df13a1a755.js → frontend_dist/_next/static/chunks/pages/templates-1bfaa1c50e844813.js} +1 -1
  181. mage_ai/server/frontend_dist/_next/static/chunks/pages/terminal-ed121e305169cf1c.js +1 -0
  182. mage_ai/server/frontend_dist/_next/static/chunks/pages/test-9ae68758102cc843.js +1 -0
  183. mage_ai/server/frontend_dist/_next/static/chunks/pages/{triggers-ffaab4c013e62ba1.js → triggers-572d82d6eb7a5d43.js} +1 -1
  184. mage_ai/server/frontend_dist/_next/static/chunks/pages/version-control-2d26d80370a2e481.js +1 -0
  185. mage_ai/server/frontend_dist/block-layout.html +2 -2
  186. mage_ai/server/frontend_dist/compute.html +5 -5
  187. mage_ai/server/frontend_dist/files.html +5 -5
  188. mage_ai/server/frontend_dist/global-data-products/[...slug].html +5 -5
  189. mage_ai/server/frontend_dist/global-data-products.html +5 -5
  190. mage_ai/server/frontend_dist/global-hooks/[...slug].html +24 -0
  191. mage_ai/server/frontend_dist/global-hooks.html +24 -0
  192. mage_ai/server/frontend_dist/index.html +2 -2
  193. mage_ai/server/frontend_dist/manage/files.html +5 -5
  194. mage_ai/server/frontend_dist/manage/settings.html +5 -5
  195. mage_ai/server/frontend_dist/manage/users/[user].html +5 -5
  196. mage_ai/server/frontend_dist/manage/users/new.html +5 -5
  197. mage_ai/server/frontend_dist/manage/users.html +5 -5
  198. mage_ai/server/frontend_dist/manage.html +5 -5
  199. mage_ai/server/frontend_dist/oauth.html +4 -4
  200. mage_ai/server/frontend_dist/overview.html +5 -5
  201. mage_ai/server/frontend_dist/pipeline-runs.html +5 -5
  202. mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills/[...slug].html +5 -5
  203. mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills.html +5 -5
  204. mage_ai/server/frontend_dist/pipelines/[pipeline]/dashboard.html +5 -5
  205. mage_ai/server/frontend_dist/pipelines/[pipeline]/edit.html +2 -2
  206. mage_ai/server/frontend_dist/pipelines/[pipeline]/logs.html +5 -5
  207. mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runs.html +5 -5
  208. mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runtime.html +5 -5
  209. mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors.html +5 -5
  210. mage_ai/server/frontend_dist/pipelines/[pipeline]/runs/[run].html +5 -5
  211. mage_ai/server/frontend_dist/pipelines/[pipeline]/runs.html +5 -5
  212. mage_ai/server/frontend_dist/pipelines/[pipeline]/settings.html +5 -5
  213. mage_ai/server/frontend_dist/pipelines/[pipeline]/syncs.html +5 -5
  214. mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers/[...slug].html +5 -5
  215. mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers.html +5 -5
  216. mage_ai/server/frontend_dist/pipelines/[pipeline].html +2 -2
  217. mage_ai/server/frontend_dist/pipelines.html +5 -5
  218. mage_ai/server/frontend_dist/settings/account/profile.html +5 -5
  219. mage_ai/server/frontend_dist/settings/workspace/permissions/[...slug].html +5 -5
  220. mage_ai/server/frontend_dist/settings/workspace/permissions.html +5 -5
  221. mage_ai/server/frontend_dist/settings/workspace/preferences.html +5 -5
  222. mage_ai/server/frontend_dist/settings/workspace/roles/[...slug].html +5 -5
  223. mage_ai/server/frontend_dist/settings/workspace/roles.html +5 -5
  224. mage_ai/server/frontend_dist/settings/workspace/sync-data.html +5 -5
  225. mage_ai/server/frontend_dist/settings/workspace/users/[...slug].html +5 -5
  226. mage_ai/server/frontend_dist/settings/workspace/users.html +5 -5
  227. mage_ai/server/frontend_dist/settings.html +2 -2
  228. mage_ai/server/frontend_dist/sign-in.html +17 -17
  229. mage_ai/server/frontend_dist/templates/[...slug].html +5 -5
  230. mage_ai/server/frontend_dist/templates.html +5 -5
  231. mage_ai/server/frontend_dist/terminal.html +5 -5
  232. mage_ai/server/frontend_dist/test.html +15 -15
  233. mage_ai/server/frontend_dist/triggers.html +5 -5
  234. mage_ai/server/frontend_dist/version-control.html +5 -5
  235. mage_ai/server/frontend_dist_base_path_template/404.html +2 -2
  236. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1749-9a6276b2918fdae1.js +1 -0
  237. mage_ai/server/{frontend_dist/_next/static/chunks/7519-8c29bbb92e03cc77.js → frontend_dist_base_path_template/_next/static/chunks/1845-5ce774d5ab81ed57.js} +1 -1
  238. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1952-ac7722e8b1ab88fe.js +1 -0
  239. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3419-f8d518d024e7b5c8.js +1 -0
  240. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/4267-fd4d8049e83178de.js +1 -0
  241. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/4366-93e09e5a4a7e182c.js +1 -0
  242. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5457-949640f4037bf12f.js +1 -0
  243. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5499-76cf8f023c6b0985.js +1 -0
  244. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/553-7f7919e14392ca67.js +1 -0
  245. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5638-a65610405a70961c.js +1 -0
  246. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5810-12eadc488265d55b.js +1 -0
  247. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5820-28adeabb5cda2b96.js +1 -0
  248. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/595-0d174b1f9fbfce4f.js +1 -0
  249. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/600-705fe234320ec5de.js +1 -0
  250. mage_ai/server/{frontend_dist/_next/static/chunks/3122-f27de34d0b5426af.js → frontend_dist_base_path_template/_next/static/chunks/6285-e9b45335bfb9ccaf.js} +1 -1
  251. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/6333-bc1b433b428a9095.js +1 -0
  252. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{5397-b5f2e477acc6bd6b.js → 6965-c613d1834c8ed92d.js} +1 -1
  253. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{7022-18fde36eb46e1d65.js → 7022-070ec0144a4d029c.js} +1 -1
  254. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/722-a1584445357a276c.js +1 -0
  255. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{7858-c83d25349d0e980f.js → 7858-d9df72e95e438284.js} +1 -1
  256. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8264-0d582a6ca33c3dfa.js +1 -0
  257. mage_ai/server/{frontend_dist/_next/static/chunks/3684-cbda680fd8927d07.js → frontend_dist_base_path_template/_next/static/chunks/8432-f191e39f9b5893f2.js} +1 -1
  258. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/90-a7308bae028d7001.js +1 -0
  259. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9264-1d4f0327d42fed91.js +1 -0
  260. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9618-2c5045255ac5a6e7.js +1 -0
  261. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{976-27c4eed1c9b20c44.js → 976-18c98af60b76f1a7.js} +1 -1
  262. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/framework-22b71764bf44ede4.js +1 -0
  263. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/_app-ebef928183f9a3bb.js +1 -0
  264. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/block-layout-a24cb24b6f08bbc9.js +1 -0
  265. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/compute-419775ca1293b354.js +1 -0
  266. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/files-0f2d4be6fdca86ca.js +1 -0
  267. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-data-products/{[...slug]-3f6fc312f67ff72e.js → [...slug]-cfd68e760ae00958.js} +1 -1
  268. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{global-data-products-f4cd03036c3e8723.js → global-data-products-c3b79ef31007f95b.js} +1 -1
  269. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-hooks/[...slug]-77edfa32d000e88b.js +1 -0
  270. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-hooks-e561ae38cf5592e8.js +1 -0
  271. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/files-449a022f2f0f2d94.js +1 -0
  272. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/settings-60845f0b59142f32.js +1 -0
  273. 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
  274. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/users/new-abd8571907664fdf.js +1 -0
  275. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/{users-a7c970122a10afdc.js → users-28a930b148d99766.js} +1 -1
  276. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage-f83deb790548693b.js +1 -0
  277. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/oauth-8bb62c4f6a511c43.js +1 -0
  278. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/overview-f0c40645f385f23f.js +1 -0
  279. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{pipeline-runs-c79819d6826e5416.js → pipeline-runs-b35d37bfba8fbccc.js} +1 -1
  280. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-10e9a2d19541caa2.js +1 -0
  281. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills-c8d3a5289ab93f88.js +1 -0
  282. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/dashboard-571c0962333b92f0.js +1 -0
  283. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/edit-ff7e9108502f5716.js +1 -0
  284. mage_ai/server/{frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/logs-a52d2d3e0c2978f4.js → frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/logs-ef680455ae54ccbe.js} +1 -1
  285. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runs-ddddcddd2f74b4f6.js +1 -0
  286. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-4a238307feddb522.js +1 -0
  287. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors-e051057d9fe94f23.js +1 -0
  288. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/runs/{[run]-4977276c8f84b5f4.js → [run]-0691711636fa95c7.js} +1 -1
  289. 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
  290. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/settings-2914e326a5f1ffe0.js +1 -0
  291. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/syncs-b75bf17498e87354.js +1 -0
  292. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-3a7500e6e53084d3.js +1 -0
  293. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers-c0e551d265a8d467.js +1 -0
  294. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/{[pipeline]-35fe7762cb83a733.js → [pipeline]-02c843b9c8418bb5.js} +1 -1
  295. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines-e47db5c3eaf683af.js +1 -0
  296. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/account/profile-55ac955dfa9a5a8d.js +1 -0
  297. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/permissions/{[...slug]-d6a62284c7c99cb3.js → [...slug]-b78b1be5b9ed84b9.js} +1 -1
  298. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/{permissions-b1389695f758c32b.js → permissions-37b78a436eeab258.js} +1 -1
  299. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/preferences-29c92a9bc54ae5cd.js +1 -0
  300. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/roles/{[...slug]-0bdb66265286ab22.js → [...slug]-db05a80d18c168e5.js} +1 -1
  301. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/{roles-e04e18fc295ca76a.js → roles-f55c77e4f46c8d33.js} +1 -1
  302. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/sync-data-2a1f8737561fdd94.js +1 -0
  303. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/users/{[...slug]-0267358c91122109.js → [...slug]-e3bf6e5d8bb250c4.js} +1 -1
  304. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/{users-50fed18bb9b8d142.js → users-20f0a050a42a015d.js} +1 -1
  305. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{settings-56f83205752b1323.js → settings-0f0121db7f5ff93d.js} +1 -1
  306. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/sign-in-99e2748e3c1d57a3.js +1 -0
  307. 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
  308. mage_ai/server/{frontend_dist/_next/static/chunks/pages/templates-3cff90df13a1a755.js → frontend_dist_base_path_template/_next/static/chunks/pages/templates-1bfaa1c50e844813.js} +1 -1
  309. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/terminal-ed121e305169cf1c.js +1 -0
  310. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/test-9ae68758102cc843.js +1 -0
  311. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{triggers-ffaab4c013e62ba1.js → triggers-572d82d6eb7a5d43.js} +1 -1
  312. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/version-control-2d26d80370a2e481.js +1 -0
  313. mage_ai/server/frontend_dist_base_path_template/_next/static/uPDjJYpJMst1q6psbRyte/_buildManifest.js +1 -0
  314. mage_ai/server/frontend_dist_base_path_template/block-layout.html +2 -2
  315. mage_ai/server/frontend_dist_base_path_template/compute.html +2 -2
  316. mage_ai/server/frontend_dist_base_path_template/files.html +2 -2
  317. mage_ai/server/frontend_dist_base_path_template/global-data-products/[...slug].html +2 -2
  318. mage_ai/server/frontend_dist_base_path_template/global-data-products.html +2 -2
  319. mage_ai/server/frontend_dist_base_path_template/global-hooks/[...slug].html +24 -0
  320. mage_ai/server/frontend_dist_base_path_template/global-hooks.html +24 -0
  321. mage_ai/server/frontend_dist_base_path_template/index.html +2 -2
  322. mage_ai/server/frontend_dist_base_path_template/manage/files.html +2 -2
  323. mage_ai/server/frontend_dist_base_path_template/manage/settings.html +2 -2
  324. mage_ai/server/frontend_dist_base_path_template/manage/users/[user].html +2 -2
  325. mage_ai/server/frontend_dist_base_path_template/manage/users/new.html +2 -2
  326. mage_ai/server/frontend_dist_base_path_template/manage/users.html +2 -2
  327. mage_ai/server/frontend_dist_base_path_template/manage.html +2 -2
  328. mage_ai/server/frontend_dist_base_path_template/oauth.html +3 -3
  329. mage_ai/server/frontend_dist_base_path_template/overview.html +2 -2
  330. mage_ai/server/frontend_dist_base_path_template/pipeline-runs.html +2 -2
  331. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills/[...slug].html +2 -2
  332. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills.html +2 -2
  333. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/dashboard.html +2 -2
  334. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/edit.html +2 -2
  335. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/logs.html +2 -2
  336. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runs.html +2 -2
  337. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runtime.html +2 -2
  338. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors.html +2 -2
  339. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs/[run].html +2 -2
  340. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs.html +2 -2
  341. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/settings.html +2 -2
  342. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/syncs.html +2 -2
  343. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers/[...slug].html +2 -2
  344. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers.html +2 -2
  345. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline].html +2 -2
  346. mage_ai/server/frontend_dist_base_path_template/pipelines.html +2 -2
  347. mage_ai/server/frontend_dist_base_path_template/settings/account/profile.html +2 -2
  348. mage_ai/server/frontend_dist_base_path_template/settings/workspace/permissions/[...slug].html +2 -2
  349. mage_ai/server/frontend_dist_base_path_template/settings/workspace/permissions.html +2 -2
  350. mage_ai/server/frontend_dist_base_path_template/settings/workspace/preferences.html +2 -2
  351. mage_ai/server/frontend_dist_base_path_template/settings/workspace/roles/[...slug].html +2 -2
  352. mage_ai/server/frontend_dist_base_path_template/settings/workspace/roles.html +2 -2
  353. mage_ai/server/frontend_dist_base_path_template/settings/workspace/sync-data.html +2 -2
  354. mage_ai/server/frontend_dist_base_path_template/settings/workspace/users/[...slug].html +2 -2
  355. mage_ai/server/frontend_dist_base_path_template/settings/workspace/users.html +2 -2
  356. mage_ai/server/frontend_dist_base_path_template/settings.html +2 -2
  357. mage_ai/server/frontend_dist_base_path_template/sign-in.html +9 -9
  358. mage_ai/server/frontend_dist_base_path_template/templates/[...slug].html +2 -2
  359. mage_ai/server/frontend_dist_base_path_template/templates.html +2 -2
  360. mage_ai/server/frontend_dist_base_path_template/terminal.html +2 -2
  361. mage_ai/server/frontend_dist_base_path_template/test.html +14 -14
  362. mage_ai/server/frontend_dist_base_path_template/triggers.html +2 -2
  363. mage_ai/server/frontend_dist_base_path_template/version-control.html +2 -2
  364. mage_ai/server/server.py +43 -15
  365. mage_ai/server/utils/output_display.py +6 -0
  366. mage_ai/server/websocket_server.py +14 -0
  367. mage_ai/services/aws/ecs/config.py +11 -8
  368. mage_ai/services/aws/emr/config.py +1 -0
  369. mage_ai/services/aws/emr/constants.py +1 -0
  370. mage_ai/services/aws/emr/emr.py +20 -7
  371. mage_ai/services/compute/__init__.py +0 -0
  372. mage_ai/services/compute/aws/__init__.py +0 -0
  373. mage_ai/services/compute/aws/constants.py +21 -0
  374. mage_ai/services/compute/aws/models.py +459 -0
  375. mage_ai/services/compute/aws/steps.py +482 -0
  376. mage_ai/services/compute/constants.py +27 -0
  377. mage_ai/services/compute/models.py +212 -0
  378. mage_ai/services/k8s/job_manager.py +3 -0
  379. mage_ai/services/spark/api/aws_emr.py +38 -0
  380. mage_ai/services/spark/api/base.py +7 -4
  381. mage_ai/services/spark/api/constants.py +4 -0
  382. mage_ai/services/spark/api/local.py +25 -24
  383. mage_ai/services/spark/api/service.py +15 -5
  384. mage_ai/services/spark/constants.py +1 -1
  385. mage_ai/services/spark/models/applications.py +45 -3
  386. mage_ai/services/spark/models/base.py +3 -19
  387. mage_ai/services/spark/models/environments.py +16 -11
  388. mage_ai/services/spark/models/executors.py +2 -2
  389. mage_ai/services/spark/models/sqls.py +46 -15
  390. mage_ai/services/spark/models/stages.py +55 -32
  391. mage_ai/services/spark/models/threads.py +2 -2
  392. mage_ai/services/spark/utils.py +22 -6
  393. mage_ai/services/ssh/__init__.py +0 -0
  394. mage_ai/services/ssh/aws/__init__.py +0 -0
  395. mage_ai/services/ssh/aws/emr/__init__.py +0 -0
  396. mage_ai/services/ssh/aws/emr/constants.py +10 -0
  397. mage_ai/services/ssh/aws/emr/models.py +326 -0
  398. mage_ai/services/ssh/aws/emr/utils.py +151 -0
  399. mage_ai/settings/__init__.py +16 -1
  400. mage_ai/settings/secret_generation.py +7 -0
  401. mage_ai/settings/sso.py +20 -0
  402. mage_ai/shared/hash.py +17 -1
  403. mage_ai/shared/models.py +253 -0
  404. mage_ai/streaming/constants.py +2 -0
  405. mage_ai/streaming/sources/activemq.py +89 -0
  406. mage_ai/streaming/sources/nats_js.py +182 -0
  407. mage_ai/streaming/sources/source_factory.py +8 -0
  408. mage_ai/tests/ai/test_ai_functions.py +53 -8
  409. mage_ai/tests/api/endpoints/test_oauths.py +33 -0
  410. mage_ai/tests/api/endpoints/test_projects.py +1 -0
  411. mage_ai/tests/api/endpoints/test_workspaces.py +55 -0
  412. mage_ai/tests/api/operations/test_base.py +7 -5
  413. mage_ai/tests/api/operations/test_operations.py +0 -1
  414. mage_ai/tests/api/operations/test_operations_with_hooks.py +577 -0
  415. mage_ai/tests/api/operations/test_syncs.py +0 -1
  416. mage_ai/tests/api/operations/test_users.py +13 -2
  417. mage_ai/tests/data_preparation/executors/test_block_executor.py +1 -0
  418. mage_ai/tests/data_preparation/models/global_hooks/__init__.py +0 -0
  419. mage_ai/tests/data_preparation/models/global_hooks/test_global_hooks.py +575 -0
  420. mage_ai/tests/data_preparation/models/global_hooks/test_hook.py +760 -0
  421. mage_ai/tests/data_preparation/models/global_hooks/test_utils.py +33 -0
  422. mage_ai/tests/data_preparation/models/test_pipeline.py +5 -0
  423. mage_ai/tests/data_preparation/test_repo_manager.py +11 -0
  424. mage_ai/tests/data_preparation/test_templates.py +1 -0
  425. mage_ai/tests/factory.py +132 -10
  426. mage_ai/tests/orchestration/queue/test_process_queue.py +15 -2
  427. mage_ai/tests/orchestration/test_pipeline_scheduler.py +447 -79
  428. mage_ai/tests/services/aws/ecs/__init__.py +0 -0
  429. mage_ai/tests/services/aws/ecs/test_config.py +144 -0
  430. mage_ai/tests/services/k8s/test_job_manager.py +22 -1
  431. mage_ai/tests/shared/mixins.py +291 -0
  432. mage_ai/tests/shared/test_hash.py +17 -1
  433. mage_ai/tests/streaming/sources/test_activemq.py +32 -0
  434. mage_ai/tests/streaming/sources/test_nats_js.py +32 -0
  435. mage_ai/tests/streaming/sources/test_source_factory.py +26 -1
  436. {mage_ai-0.9.44.dist-info → mage_ai-0.9.46.dist-info}/METADATA +28 -66
  437. {mage_ai-0.9.44.dist-info → mage_ai-0.9.46.dist-info}/RECORD +443 -364
  438. mage_ai/authentication/oauth/active_directory.py +0 -17
  439. mage_ai/server/frontend_dist/_next/static/RPXiX8RpZ7oO-yeaEtV2c/_buildManifest.js +0 -1
  440. mage_ai/server/frontend_dist/_next/static/chunks/1125-91d3ce33140ef041.js +0 -1
  441. mage_ai/server/frontend_dist/_next/static/chunks/1749-607014ecf28268bf.js +0 -1
  442. mage_ai/server/frontend_dist/_next/static/chunks/1952-573c7fc7ad84da6e.js +0 -1
  443. mage_ai/server/frontend_dist/_next/static/chunks/3004-231cad9039ae5dcb.js +0 -1
  444. mage_ai/server/frontend_dist/_next/static/chunks/3419-0873e170ef7d6303.js +0 -1
  445. mage_ai/server/frontend_dist/_next/static/chunks/3932-0ceca9599d6e6d00.js +0 -1
  446. mage_ai/server/frontend_dist/_next/static/chunks/4267-335766a915ee2fa9.js +0 -1
  447. mage_ai/server/frontend_dist/_next/static/chunks/5457-8be2e0a3fe0ba64b.js +0 -1
  448. mage_ai/server/frontend_dist/_next/static/chunks/5499-bca977f466e259e1.js +0 -1
  449. mage_ai/server/frontend_dist/_next/static/chunks/553-edf533e634e85192.js +0 -1
  450. mage_ai/server/frontend_dist/_next/static/chunks/5810-37c6091b29a1fe53.js +0 -1
  451. mage_ai/server/frontend_dist/_next/static/chunks/600-0733eb84f0a0a9e0.js +0 -1
  452. mage_ai/server/frontend_dist/_next/static/chunks/6333-53b6ebbef95a3691.js +0 -1
  453. mage_ai/server/frontend_dist/_next/static/chunks/722-3fff38a9019369fe.js +0 -1
  454. mage_ai/server/frontend_dist/_next/static/chunks/8224-39a93ee1058b6069.js +0 -1
  455. mage_ai/server/frontend_dist/_next/static/chunks/8264-6ef8fdb195694807.js +0 -1
  456. mage_ai/server/frontend_dist/_next/static/chunks/9264-1b5c4b071ed544c3.js +0 -1
  457. mage_ai/server/frontend_dist/_next/static/chunks/framework-7c365855dab1bf41.js +0 -1
  458. mage_ai/server/frontend_dist/_next/static/chunks/pages/_app-a4a660fa14cf05a9.js +0 -1
  459. mage_ai/server/frontend_dist/_next/static/chunks/pages/block-layout-c465c14d48392b11.js +0 -1
  460. mage_ai/server/frontend_dist/_next/static/chunks/pages/compute-b1f8d5a7a9a30f2d.js +0 -1
  461. mage_ai/server/frontend_dist/_next/static/chunks/pages/files-93c094bad0f299fb.js +0 -1
  462. mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/files-891e5bd5935f7473.js +0 -1
  463. mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/settings-d2e4ee4e68d36807.js +0 -1
  464. mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/users/new-4a49126fcfe8ced0.js +0 -1
  465. mage_ai/server/frontend_dist/_next/static/chunks/pages/manage-5f8c5d0bc6ad1113.js +0 -1
  466. mage_ai/server/frontend_dist/_next/static/chunks/pages/oauth-09467512a85c96ed.js +0 -1
  467. mage_ai/server/frontend_dist/_next/static/chunks/pages/overview-31bde04718d0d3a8.js +0 -1
  468. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-96718f95103d7844.js +0 -1
  469. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills-a9266d353f288e8c.js +0 -1
  470. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/dashboard-b5c29c852262312e.js +0 -1
  471. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-5d525454ff7aeb3f.js +0 -1
  472. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runs-883f4ae9a4a264c0.js +0 -1
  473. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-c65be964e6398cb7.js +0 -1
  474. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors-1f5b4a974bd39740.js +0 -1
  475. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/settings-074c32397d341de9.js +0 -1
  476. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/syncs-50f5d8706ed0bc73.js +0 -1
  477. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-e151c1552fcb67bd.js +0 -1
  478. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers-cc36f0f8c73fee4b.js +0 -1
  479. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines-8336c4326f1e7d96.js +0 -1
  480. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/account/profile-01dd679e4a21e0d9.js +0 -1
  481. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/preferences-4d9051c073a9b2ff.js +0 -1
  482. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/sync-data-88d41c33b8fcb300.js +0 -1
  483. mage_ai/server/frontend_dist/_next/static/chunks/pages/sign-in-d859e07561eb9010.js +0 -1
  484. mage_ai/server/frontend_dist/_next/static/chunks/pages/terminal-578d862f3e56e6e6.js +0 -1
  485. mage_ai/server/frontend_dist/_next/static/chunks/pages/test-1c0588d685b909b9.js +0 -1
  486. mage_ai/server/frontend_dist/_next/static/chunks/pages/version-control-e284cf1535d93798.js +0 -1
  487. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1125-91d3ce33140ef041.js +0 -1
  488. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1749-607014ecf28268bf.js +0 -1
  489. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1952-573c7fc7ad84da6e.js +0 -1
  490. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3004-231cad9039ae5dcb.js +0 -1
  491. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3419-0873e170ef7d6303.js +0 -1
  492. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3932-0ceca9599d6e6d00.js +0 -1
  493. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/4267-335766a915ee2fa9.js +0 -1
  494. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5457-8be2e0a3fe0ba64b.js +0 -1
  495. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5499-bca977f466e259e1.js +0 -1
  496. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/553-edf533e634e85192.js +0 -1
  497. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5810-37c6091b29a1fe53.js +0 -1
  498. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/600-0733eb84f0a0a9e0.js +0 -1
  499. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/6333-53b6ebbef95a3691.js +0 -1
  500. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/722-3fff38a9019369fe.js +0 -1
  501. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8224-39a93ee1058b6069.js +0 -1
  502. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8264-6ef8fdb195694807.js +0 -1
  503. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9264-1b5c4b071ed544c3.js +0 -1
  504. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/framework-7c365855dab1bf41.js +0 -1
  505. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/_app-a4a660fa14cf05a9.js +0 -1
  506. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/block-layout-c465c14d48392b11.js +0 -1
  507. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/compute-b1f8d5a7a9a30f2d.js +0 -1
  508. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/files-93c094bad0f299fb.js +0 -1
  509. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/files-891e5bd5935f7473.js +0 -1
  510. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/settings-d2e4ee4e68d36807.js +0 -1
  511. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/users/new-4a49126fcfe8ced0.js +0 -1
  512. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage-5f8c5d0bc6ad1113.js +0 -1
  513. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/oauth-09467512a85c96ed.js +0 -1
  514. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/overview-31bde04718d0d3a8.js +0 -1
  515. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-96718f95103d7844.js +0 -1
  516. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills-a9266d353f288e8c.js +0 -1
  517. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/dashboard-b5c29c852262312e.js +0 -1
  518. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/edit-5d525454ff7aeb3f.js +0 -1
  519. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runs-883f4ae9a4a264c0.js +0 -1
  520. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-c65be964e6398cb7.js +0 -1
  521. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors-1f5b4a974bd39740.js +0 -1
  522. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/settings-074c32397d341de9.js +0 -1
  523. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/syncs-50f5d8706ed0bc73.js +0 -1
  524. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-e151c1552fcb67bd.js +0 -1
  525. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers-cc36f0f8c73fee4b.js +0 -1
  526. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines-8336c4326f1e7d96.js +0 -1
  527. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/account/profile-01dd679e4a21e0d9.js +0 -1
  528. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/preferences-4d9051c073a9b2ff.js +0 -1
  529. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/sync-data-88d41c33b8fcb300.js +0 -1
  530. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/sign-in-d859e07561eb9010.js +0 -1
  531. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/terminal-578d862f3e56e6e6.js +0 -1
  532. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/test-1c0588d685b909b9.js +0 -1
  533. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/version-control-e284cf1535d93798.js +0 -1
  534. mage_ai/server/frontend_dist_base_path_template/_next/static/rNR5JgSxO3eA2BWGa_i7U/_buildManifest.js +0 -1
  535. /mage_ai/server/frontend_dist/_next/static/{RPXiX8RpZ7oO-yeaEtV2c → 9jB4XPuz6BzxBcG9VNao5}/_ssgManifest.js +0 -0
  536. /mage_ai/server/frontend_dist_base_path_template/_next/static/{rNR5JgSxO3eA2BWGa_i7U → uPDjJYpJMst1q6psbRyte}/_ssgManifest.js +0 -0
  537. {mage_ai-0.9.44.dist-info → mage_ai-0.9.46.dist-info}/LICENSE +0 -0
  538. {mage_ai-0.9.44.dist-info → mage_ai-0.9.46.dist-info}/WHEEL +0 -0
  539. {mage_ai-0.9.44.dist-info → mage_ai-0.9.46.dist-info}/entry_points.txt +0 -0
  540. {mage_ai-0.9.44.dist-info → mage_ai-0.9.46.dist-info}/top_level.txt +0 -0
@@ -1 +0,0 @@
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},W={basic:!0,iconOnly:!0,noPadding:!0,transparent:!0};function q(e,n){var t=e.block,i=e.blockIndex,u=e.blockMetadata,z=e.buttonTabs,q=e.children,Y=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=(0,l.useState)(!1),Te=Ee[0],Se=Ee[1];(0,l.useEffect)((function(){Se(!0)}),[]);var _e=(0,l.useCallback)((function(){var e=new CustomEvent(I.tK,{detail:{blockIndex:i}});window.dispatchEvent(e)}),[i]);(0,l.useEffect)((function(){Te&&ye&&_e()}),[ce,Te,he,ye]);var Pe=t||{},Ie=Pe.color,Ae=Pe.status,Re=Pe.type,we=Pe.uuid,De=(0,l.useMemo)((function(){return{blockColor:Ie,blockType:Re,dynamicBlock:$,dynamicChildBlock:ee,hasError:ne,selected:be}}),[Ie,Re,$,ee,ne,be]),Ne=(0,l.useMemo)((function(){return(null===ue||void 0===ue?void 0:ue.length)||0}),[ue]),Me=f.DA.EXECUTED===Ae||!re&&0===pe&&Ne>=1||!re&&pe>=1&&ve>=me,Le=(0,l.useState)(),Be=Le[0],Ue=Le[1],Fe=(0,l.useState)(),Ge=Fe[0],He=Fe[1],ze=(0,l.useState)(null),Qe=ze[0],Ke=ze[1],We=(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}),[]),qe=(0,d.Db)((function(){return T.ZP.block_outputs.pipelines.downloads.detailAsync(null===fe||void 0===fe?void 0:fe.uuid,we,{token:We},{onDownloadProgress:function(e){return Ke((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(we,".").concat(A.Lu.CSV))},onErrorCallback:function(e,n){return null===je||void 0===je?void 0:je({errors:n,response:e})}})}}),Ye=(0,r.Z)(qe,2),Ve=Ye[0],Xe=Ye[1].isLoading;(0,l.useEffect)((function(){re||He(100)}),[re]);var Je=function(e){return Array.isArray(e)?e.join("\n"):e},$e=(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&&!Je(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=Je(n.data)||"";t.data=[t.data,o].join("\n")}}else C.jU.includes(null===n||void 0===n?void 0:n.type)&&!Je(null===n||void 0===n?void 0:n.data).match(R.Lz)?e.push(Q(Q({},n),{},{data:Je(n.data)})):e.push(Q({},n));return e}),[]):ce||[]}),[ue,ce]),en=(0,l.useMemo)((function(){return!(null!==ue&&void 0!==ue&&ue.length)&&(null===ce||void 0===ce?void 0:ce.length)>=1}),[ue,ce]),nn=(0,l.useMemo)((function(){return(0,H.jsx)(Z.Z,{progress:Ge})}),[Ge]),tn=f.tf.DBT===(null===t||void 0===t?void 0:t.type),on=(0,S.Z)(ne);(0,l.useEffect)((function(){tn&&!on&&ne&&Ze(L.Rj)}),[ne,on,tn,Ze]);var rn=(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&&Ue(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===$e||void 0===$e||$e.forEach((function(r,l){var u,d,s,f=Array.isArray(r);if(en&&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===$e.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),tn||(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),tn||(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);He(_>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&&n.unshift([(0,H.jsx)(P.T5,{contained:!0,children:(0,H.jsx)(k.Z,{mt:1,children:nn})},"progress_bar")]),{content:n,tableContent:t,testContent:i}}),[$e,J,tn,re,le,se,fe,nn,en,be]),ln=rn.content,un=rn.tableContent,cn=rn.testContent,an=(null===Be||void 0===Be?void 0:Be[1])||0,dn=an>30?" (30 out of ".concat(an," columns displayed)"):"",sn=(0,l.useMemo)((function(){var e;if(tn&&ge){var n=ge.uuid;if(L.$m.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 preview to display yet, try running the block."})}));else if(L.Rj.uuid===n)(null===ln||void 0===ln?void 0:ln.length)>=1?e=ln: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:!0,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=ln;return(0,H.jsxs)(H.Fragment,{children:[z,Y,!ie&&e]})}),[u,z,Y,ln,ne,ie,tn,re,fe,be,ge,ye,un]);return z||ne||te||en||q?(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({},De),{},{addBottomPadding:re&&(null===fe||void 0===fe?void 0:fe.type)===O.qL.PYSPARK,blockType:Re,dynamicBlock:$,dynamicChildBlock:ee,executedAndIdle:Me,hasError:ne,selected:be,showBorderTop:ke,children:[q,!V&&(null===cn||void 0===cn?void 0:cn.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:cn.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&&sn]})),!J&&(0,H.jsxs)(H.Fragment,{children:[q,sn]}),Me&&!oe&&(0,H.jsxs)(P._A,Q(Q({},De),{},{blockType:Re,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({},W),{},{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}),Be&&(0,H.jsx)(k.Z,{ml:2,children:(0,H.jsx)(y.ZP,{children:"".concat(Be[0]," rows x ").concat(Be[1]," columns").concat(dn)})})]})})),!xe&&(0,H.jsx)(j.ZP,{alignItems:"center",children:Be&&(0,H.jsx)(k.Z,{pl:1,children:(0,H.jsx)(y.ZP,{children:"".concat(Be[0]," rows x ").concat(Be[1]," columns").concat(dn)})})})]}),(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(Re)&&(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({},W),{},{onClick:function(){(0,U.OF)(null===fe||void 0===fe?void 0:fe.uuid,we),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===we}))?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:Xe,label:Xe?"".concat(Qe||0,"mb downloaded..."):"Save output as CSV file",children:(0,H.jsx)(p.ZP,Q(Q({},W),{},{compact:!0,loading:Xe,onClick:function(){Ke(null),Ve()},children:(0,H.jsx)(_.vc,{muted:!0,size:1.75*w.iI})}))}))]})})]})})]})]}))]})}):null}n.Z=l.forwardRef(q)},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]},39791:function(e,n,t){t.d(n,{z:function(){return vn},Z:function(){return hn}});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"})([""]),W=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"})]})})]})},q=t(46732),Y=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),We=Ke[0],qe=Ke[1].isLoading,Ye=(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)(Ye,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&&We({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):We({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):We({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,We]));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)(Y.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)(Y.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)(q.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)(W,{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:[qe&&(0,j.jsx)($.Z,{inverted:!0,small:!0}),!qe&&(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:We}),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(53405);function Oe(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 Ze(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Oe(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Oe(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ke,ye=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,Ce.Uc)(n,{getAll:!0})}),[n]),E=(0,c.useMemo)((function(){return null===k||void 0===k?void 0:k.filter(Ce.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.destination_table,f=l.replication_method,p=l.run_in_parallel,v=(l.tap_stream_id,(0,Ce.M$)(e)),m=(0,Ce.Qu)(e),b=(0,Ce.WD)(e),x=(0,Ce.JN)(e),C=x.allColumns,O=x.selectedColumns,Z=(null===(o=Object.keys(C||[]))||void 0===o?void 0:o.length)||0,k=(null===(i=Object.keys(O||[]))||void 0===i?void 0:i.length)||0,E=P.t6.YAML===s&&!k,T=(0,j.jsxs)(X.Z,{danger:E,monospace:!0,onClick:function(){return d({block:Ze(Ze({},n),{},{content:t}),defaultMainNavigationTab:v,defaultMainNavigationTabSub:m,defaultSubTab:E?je.tw.SETTINGS:je.tw.OVERVIEW,onChangeBlock:u,setContent:a})},preventDefault:!0,sameColorAsText:!E,children:[v," ",E&&(0,j.jsx)(g.ZP,{inline:!0,default:!0,monospace:!0,children:"will fail if no columns selected"})]},"".concat(b,"-stream"));r=k>=1||P.t6.PYTHON===s?(0,j.jsxs)(g.ZP,{center:!0,default:!0,monospace:!0,children:[k," ",(0,j.jsx)(g.ZP,{inline:!0,monospace:!0,muted:!0,children:"/"})," ",Z]}):(0,j.jsx)(g.ZP,{center:!0,danger:!0,children:"No columns selected"});var S=[T,(0,j.jsx)(X.Z,{danger:E,monospace:!0,onClick:function(){return d({block:Ze(Ze({},n),{},{content:t}),defaultMainNavigationTab:v,defaultMainNavigationTabSub:m,defaultSubTab:je.tw.SETTINGS,onChangeBlock:u,setContent:a})},preventDefault:!0,sameColorAsText:!E,children:r},"".concat(b,"-columns")),(0,j.jsx)(g.ZP,{center:!0,default:!0,children:f&&(0,U.vg)(f)},"".concat(b,"-replicationMethod")),(0,j.jsx)(h.ZP,{justifyContent:"flex-end",children:p?(0,j.jsx)(ie.Jr,{size:2*B.iI,success:!0}):(0,j.jsx)(g.ZP,{monospace:!0,muted:!0,children:"-"})},"".concat(b,"-runInParallel"))];return _||(S=(0,y.Hk)((0,j.jsx)(g.ZP,{default:!0,monospace:!0,children:c||v},"".concat(b,"-tableName")),1,S)),S}))})}),[n,t,s,_,a,d,E]),R=(0,c.useMemo)((function(){var e,t;return(0,Ce.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:Ze(Ze({},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:Ze(Ze({},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:Ze(Ze({},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:Ze(Ze({},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"}(ke||(ke={}));var Ee,Te=[ke.APPEND,ke.FAIL,ke.REPLACE];!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"}(Ee||(Ee={}));var Se=t(56747),_e=t(82359),Pe=t(44085),Ie=t(74521);var Ae=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.id)in e||(e[null===t||void 0===t?void 0:t.id]={}),e[null===t||void 0===t?void 0:t.id][null===n||void 0===n?void 0:n.stage_id]=n,e}),{})}),[r]),u=(0,c.useMemo)((function(){return(0,j.jsx)(Ie.Z,{disableStageExpansion:!0,jobs:i,stagesMapping:l})}),[i,l]);return(0,j.jsx)(j.Fragment,{children:u})},Re=B.iI/2,we=a.default.div.withConfig({displayName:"indexstyle__ProgressDotsStyle",componentId:"sc-5dfsks-0"})(["border-top-width:","px;border-top-style:dotted;height:","px;",""],Re,Re,(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 ")})),De=t(88422);var Ne=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+=De.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;De.Dd.SKIPPED!==u&&(t+=De.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)(we,{progress:100*x,success:!0}),x>0&&x<1&&(0,j.jsx)("div",{style:{width:B.iI/2}}),(0,j.jsx)(we,{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)(we,{progress:100*C,success:!0}),C>0&&C<1&&(0,j.jsx)("div",{style:{width:B.iI/2}}),(0,j.jsx)(we,{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)(we,{progress:100*O,success:!0}),O>0&&O<1&&(0,j.jsx)("div",{style:{width:B.iI/2}}),(0,j.jsx)(we,{progress:100*(1-O)})]})]}),t]}):null},Me=t(93004);var Le=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)(Me.Z,{disableGraph:t,disableJobExpansion:!0,overrideScrollForGraph:i,showSparkGraph:!0,sqls:r})}),[t,r]);return(0,j.jsx)(j.Fragment,{children:l})},Be=t(71417);var Ue=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)(Be.Z,{stages:o,tasksContained:!0})}),[o]);return(0,j.jsx)(j.Fragment,{children:i})},Fe=t(17488),Ge=t(3314);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 ze(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?He(Object(t),!0).forEach((function(n){(0,i.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 Qe=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)(Fe.Z,{borderless:!0,compact:!0,monospace:!0,onChange:function(e){var n=e.target.value;l((0,i.Z)({},M.Yf,ze(ze({},O),{},(0,i.Z)({},v,ze(ze({},Z),{},(0,i.Z)({},M.aZ,n))))))},onClick:Ge.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)})})},Ke=t(84820),We=t(98464),qe=t(77497),Ye=t(98777),Ve=t(88494),Xe=t(84438),Je=t(92709),$e=t(47041),en=t(89678),nn=t(38399),tn=t(74052),on=t(22286),rn=t(37529),ln=t(53808),un=t(44375),cn=t(42041),an=t(15752),dn=t(42122),sn=t(44688);function fn(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 pn(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?fn(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):fn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var vn=1e3;function mn(e,n){var t,l,C,Z,E=e.addNewBlock,T=e.addNewBlockMenuOpenIdx,N=e.addWidget,L=e.allBlocks,F=e.allowCodeBlockShortcuts,G=e.autocompleteItems,H=e.block,z=e.blockIdx,Q=e.blockInteractions,K=e.blockOutputRef,W=e.blockRefs,Y=e.blockTemplates,V=e.blocks,J=void 0===V?[]:V,te=e.children,ae=e.containerRef,se=e.cursorHeight1,fe=e.cursorHeight2,pe=e.cursorHeight3,he=e.dataProviders,be=e.defaultValue,ge=void 0===be?"":be,xe=e.deleteBlock,je=e.disableDrag,Oe=e.disableShortcuts,Ze=e.executionState,Ie=e.extraContent,Re=e.fetchFileTree,we=e.fetchPipeline,De=e.globalDataProducts,Me=e.height,Be=e.hideExtraCommandButtons,He=e.hideExtraConfiguration,ze=e.hideHeaderInteractiveInformation,fn=e.hideRunButton,mn=e.interactionsMapping,hn=e.interruptKernel,bn=e.mainContainerRect,gn=e.mainContainerRef,xn=e.mainContainerWidth,jn=e.messages,Cn=void 0===jn?[]:jn,On=e.noDivider,Zn=e.onCallbackChange,kn=e.onChange,yn=e.onClickAddSingleDBTModel,En=e.onDrop,Tn=e.openSidekickView,Sn=e.pipeline,_n=e.project,Pn=e.runBlock,In=e.runningBlocks,An=e.savePipelineContent,Rn=e.scrollTogether,wn=e.selected,Dn=e.setAddNewBlockMenuOpenIdx,Nn=e.setAnyInputFocused,Mn=e.setCreatingNewDBTModel,Ln=e.setEditingBlock,Bn=e.setErrors,Un=(e.setMountedBlocks,e.setOutputBlocks),Fn=e.setSelected,Gn=e.setSelectedBlock,Hn=e.setSelectedOutputBlock,zn=e.setTextareaFocused,Qn=e.showBrowseTemplates,Kn=e.showConfigureProjectModal,Wn=e.showDataIntegrationModal,qn=e.showGlobalDataProducts,Yn=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,qe.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(Je.$e,{detail:{blockIndex:z}});window.dispatchEvent(e)}),[z]),bt=(0,c.useCallback)((function(){var e=new CustomEvent(Je.tK,{detail:{blockIndex:z}});window.dispatchEvent(e)}),[z]);(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,Ye.e+1))};return ct&&window.addEventListener("click",e),function(){window.removeEventListener("click",e)}}),[bt,ct]),(0,c.useEffect)((function(){vt&&Vn&&ht()}),[vt,Rn,Vn]);var gt=(0,c.useMemo)((function(){var e;return!(null===_n||void 0===_n||null===(e=_n.features)||void 0===e||!e[_e.d.INTERACTIONS])}),[null===_n||void 0===_n?void 0:_n.features]),xt=(0,c.useCallback)((function(e){var n,t,o,i,l=e.columnScrolling,u=e.refCursor,c=e.refCursorContainer,a=e.refsMappings,d=null===J||void 0===J?void 0:J.map((function(e){var n=(0,tn.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===bn||void 0===bn?void 0:bn.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,z))||[]);if(Rn)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"))}}),[z,bn,nt,tt,Rn]);(0,c.useEffect)((function(){var e=function(e){var n=e.detail;xt(n)};return Vn&&window.addEventListener(Je.m$,e),function(){window.removeEventListener(Je.m$,e)}}),[xt,Vn]);var jt=H||{},Ct=jt.callback_content,Ot=jt.configuration,Zt=void 0===Ot?{}:Ot,kt=jt.color,yt=jt.error,Et=jt.has_callback,Tt=jt.language,St=jt.name,_t=jt.pipelines,Pt=jt.replicated_block,It=jt.type,At=jt.upstream_blocks,Rt=void 0===At?[]:At,wt=jt.uuid,Dt=(0,c.useMemo)((function(){return Zt}),[Zt]),Nt=(0,c.useMemo)((function(){var e;return(null===(e=Object.values(_t||{}))||void 0===e?void 0:e.length)||1}),[_t]),Mt=(0,c.useMemo)((function(){return null===Dt||void 0===Dt?void 0:Dt.global_data_product}),[Dt]),Lt=(0,c.useMemo)((function(){return(0,y.HK)(De||[],(function(e){return e.uuid}))}),[De]),Bt=(0,c.useState)(!1),Ut=Bt[0],Ft=Bt[1],Gt=(0,c.useState)(null),Ht=Gt[0],zt=Gt[1],Qt=(0,c.useState)(!1),Kt=Qt[0],Wt=Qt[1],qt=(0,c.useState)(!1),Yt=qt[0],Vt=qt[1],Xt=(0,c.useState)(ge),Jt=Xt[0],$t=Xt[1],eo=(0,c.useState)(null),no=eo[0],to=eo[1],oo=(0,c.useState)(re.C4[0].uuid),io=oo[0],ro=oo[1],lo=(0,c.useState)(null),uo=lo[0],co=lo[1],ao=Sn||{},so=ao.type,fo=ao.uuid,po=(0,c.useMemo)((function(){return ue.qL.STREAMING===so}),[so]),vo=P.tf.DBT===It,mo=P.t6.SQL===Tt,ho=P.t6.R===Tt,bo=P.tf.MARKDOWN===It,go=(0,c.useMemo)((function(){return(0,Ce.jO)(H,Sn)}),[H,Sn]),xo=Dt[M.mW];mo&&void 0===xo&&(xo=vn);var jo=(0,c.useState)(pn(pn({},Dt),{},(t={},(0,i.Z)(t,M.cH,Dt[M.cH]),(0,i.Z)(t,M.Sv,Dt[M.Sv]),(0,i.Z)(t,M.sc,Dt[M.sc]),(0,i.Z)(t,M.BD,Dt[M.BD]),(0,i.Z)(t,M.m$,Dt[M.m$]),(0,i.Z)(t,M.Pi,Dt[M.Pi]||{}),(0,i.Z)(t,M.Mv,Dt[M.Mv]),(0,i.Z)(t,M.eW,Dt[M.eW]),(0,i.Z)(t,M.nq,Dt[M.nq]||ke.APPEND),(0,i.Z)(t,M.mW,xo),(0,i.Z)(t,M.bk,Dt[M.bk]),(0,i.Z)(t,M.Mi,!!Dt[M.Mi]),t))),Co=jo[0],Oo=jo[1],Zo=(0,c.useState)(null),ko=Zo[0],yo=Zo[1],Eo=(0,c.useState)(bo),To=Eo[0],So=Eo[1],_o=(0,c.useState)(!1),Po=_o[0],Io=_o[1],Ao=(0,c.useState)(0),Ro=Ao[0],wo=Ao[1],Do=(0,c.useState)(null),No=Do[0],Mo=Do[1],Lo=(0,c.useState)(null),Bo=Lo[0],Uo=Lo[1],Fo=(0,c.useState)(Cn),Go=Fo[0],Ho=Fo[1],zo=(0,c.useState)(null),Qo=zo[0],Ko=zo[1],Wo=(0,c.useCallback)((function(e){bt(),null===Fn||void 0===Fn||Fn(!!e),Ko(e)}),[bt,Fn,Ko]);(0,c.useEffect)((function(){Qo||(ct?Wo((0,re.iz)(H)[0]):vo&&Wo((0,re.Xy)(H)[0]))}),[H,vo,Qo,Wo,ct]);var qo=(0,c.useCallback)((function(e){So(e),setTimeout((function(){return ht()}),1)}),[ht,So]),Yo=(0,d.c)((function(){return{collect:function(e){return{isDragging:!!e.isDragging()}},item:H,type:re.vT}}),[H]),Vo=(0,o.Z)(Yo,2),Xo=Vo[0],Jo=Vo[1],$o=(0,s.L)((function(){return{accept:re.vT,drop:function(e){return null===En||void 0===En?void 0:En(H,e)}}}),[H]),ei=(0,o.Z)($o,2)[1],ni=(0,c.useMemo)((function(){var e;return(null===H||void 0===H||null===(e=H.metadata)||void 0===e?void 0:e.dbt)||{project:null,projects:{}}}),[H]),ti=(0,c.useMemo)((function(){return ni.projects||{}}),[ni]),oi=(0,c.useMemo)((function(){return ni.project||Co[M.eW]}),[Co,ni]),ii=(0,c.useMemo)((function(){return ti[oi]||{target:null,targets:[]}}),[oi,ti]),ri=(0,c.useMemo)((function(){return ii.targets||[]}),[ii]),li=(0,c.useMemo)((function(){return Co[M.Mv]}),[Co]),ui=oi?null!==ii&&void 0!==ii&&ii.target?(0,y.sE)(ri,(function(e){return e===ii.target})):"Select target":"Select project first",ci=(0,c.useState)(li&&!(null!==ri&&void 0!==ri&&ri.includes(li))),ai=ci[0],di=ci[1],si=(0,c.useState)(null),fi=si[0],pi=si[1];(0,c.useEffect)((function(){Ct!==fi&&pi(Ct)}),[fi,Ct]);var vi=(0,We.Z)(H);(0,c.useEffect)((function(){if(JSON.stringify(H)!=JSON.stringify(vi)){var e,n=(0,tn.Rt)([H]).messages,t=null===n||void 0===n||null===(e=n[It])||void 0===e?void 0:e[wt];(null===t||void 0===t?void 0:t.length)>=1&&Ho(t)}}),[H,It,wt,vi,Ho]);var mi=(0,We.Z)(Cn);(0,c.useEffect)((function(){"undefined"!==typeof Cn&&Cn.length!==(null===mi||void 0===mi?void 0:mi.length)&&Ho(Cn)}),[Cn,mi,Ho]);var hi=(0,c.useMemo)((function(){var e=new Set;return null===he||void 0===he||he.forEach((function(n){var t=n.profiles;e=new Set([].concat((0,r.Z)(e),(0,r.Z)(t)))})),(0,r.Z)(e)}),[he]),bi=(0,c.useMemo)((function(){return"".concat(fo,"/").concat(wt,"/codeCollapsed")}),[fo,wt]),gi=(0,c.useMemo)((function(){return"".concat(fo,"/").concat(wt,"/outputCollapsed")}),[fo,wt]);(0,c.useEffect)((function(){Vt((0,ln.U2)(bi,!1)),Io((0,ln.U2)(gi,!1))}),[bi,gi]);var xi=(0,c.useRef)(null),ji=(0,c.useMemo)((function(){return(0,y.HK)(J,(function(e){return e.uuid}))}),[J]),Ci=(0,c.useMemo)((function(){return!(null===Jn||void 0===Jn||!Jn.find((function(e){return e.upstream_blocks.includes(wt)})))}),[wt,Jn]),Oi=(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===bn||void 0===bn?void 0:bn.y)+(null===bn||void 0===bn?void 0:bn.height)||(null===o||void 0===o?void 0:o.y)<=(null===bn||void 0===bn?void 0:bn.y)){var r=new CustomEvent(Je.Wf,{detail:{blockIndex:z,columnIndex:t,lockScroll:!0,y:i}});window.dispatchEvent(r)}}),[z,bn]),Zi=!(null===In||void 0===In||!In.find((function(e){return e.uuid===wt})))||(null===Go||void 0===Go?void 0:Go.length)>=1&&Ze!==oe.uF.IDLE;(0,c.useEffect)((function(){at(lt&&!po&&!go&&P.t6.PYTHON===Tt)}),[Tt,go,po,lt]);var ki=ne.ZP.execution_states.list({block_uuid:wt,pipeline_uuid:fo},{refreshInterval:wn&&Zi?1e3:5e3,revalidateOnFocus:!0},{pauseFetch:!wn&&st>=1||!ct}),yi=ki.data,Ei=ki.mutate,Ti=(0,c.useCallback)((function(e){var n,t,i;Vn&&Oi(pn({columnIndex:Rn?2:1,bypassOffScreen:Rn},(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)}vo&&re.Rj!==Qo&&Wo(re.Rj);var b=pn({},v||uo);(null===Q||void 0===Q?void 0:Q.length)>=1&&(null===Q||void 0===Q||Q.forEach((function(e){var n=e.uuid,t=null===mn||void 0===mn?void 0:mn[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,on.M)(b[t],i))}))}))),null===Pn||void 0===Pn||Pn({block:l,code:u||Jt,runDownstream:a||Ci,runIncompleteUpstream:d||!1,runSettings:s,runTests:m||!1,runUpstream:f||!1,variables:b}),c||(wo(1+Number(Ro)),Mo(null),Io(!1)),ct&&Ei()}),[Q,Jt,Ei,Ci,mn,vo,nt,tt,Pn,Ro,Rn,Qo,wo,Mo,Wo,Vn,ct,uo]),Si=(0,c.useState)(null),_i=Si[0],Pi=Si[1];(0,c.useEffect)((function(){yi&&(ft((function(e){return e+1})),Pi((null===yi||void 0===yi?void 0:yi.execution_states)||[]))}),[yi,Pi,ft]),(0,c.useEffect)((function(){null!==_i&&(clearTimeout(it.current),it.current=setTimeout(bt,1))}),[_i,bt,Qo]),(0,c.useEffect)((function(){Zi&&Uo(Number(new Date))}),[Zi,Uo]);var Ii=(0,We.Z)(Ze);(0,c.useEffect)((function(){Ze===oe.uF.IDLE&&Ze!==Ii&&Mo(Number(new Date))}),[Ze,Ii,Mo]);var Ai=(0,c.useCallback)((function(e){var n=e.editorRect.top,t=e.position.lineNumberTop;if(null!==gn&&void 0!==gn&&gn.current){var o=gn.current.getBoundingClientRect().height;if(n+t>o){var i=gn.current.scrollTop+(t-o+n);gn.current.scrollTo(0,i)}else if(t+n<en.aU){var r=gn.current.scrollTop+(t+n-en.aU);gn.current.scrollTo(0,r)}}}),[gn]),Ri=(0,c.useMemo)((function(){return(0,ce.h5)(Go,ko)}),[ko,Go]),wi=(0,ce.oI)(Ri),Di=wi.hasError,Ni=wi.hasOutput,Mi=(0,c.useMemo)((function(){return Ni||(null===Go||void 0===Go?void 0:Go.length)>=1}),[Ni,Go]),Li=(0,x.qn)(It,{blockColor:kt,theme:et}).accent,Bi=(null===Rt||void 0===Rt?void 0:Rt.length)||0,Ui=(0,Ce.cU)([H],J)[0],Fi=Ui.dynamic,Gi=Ui.dynamicUpstreamBlock,Hi=Ui.reduceOutput,zi=Ui.reduceOutputUpstreamBlock,Qi=(0,c.useMemo)((function(){return(0,ce._o)({block:H,dynamic:Fi,dynamicUpstreamBlock:Gi,hasError:Di,reduceOutput:Hi,reduceOutputUpstreamBlock:zi,selected:wn})}),[H,Fi,Gi,Di,Hi,zi,wn]),Ki=Qi.borderColorShareProps,Wi=Qi.tags,qi=(0,c.useCallback)((function(){wn||(null===Nn||void 0===Nn||Nn(!1),null===Fn||void 0===Fn||Fn(!0))}),[wn,Nn,Fn]),Yi=ne.ZP.blocks.pipelines.detail(fo,re.gM.uuid===(null===Qo||void 0===Qo?void 0:Qo.uuid)||re.Jt.uuid===(null===Qo||void 0===Qo?void 0:Qo.uuid)?encodeURIComponent(wt):null,{_format:"dbt"},{revalidateOnFocus:!0}),Vi=Yi.data,Xi=Yi.mutate,Ji=(0,c.useMemo)((function(){var e;return(null===Vi||void 0===Vi||null===(e=Vi.block)||void 0===e?void 0:e.metadata)||{}}),[Vi]),$i=(0,f.Db)(ne.ZP.blocks.pipelines.useUpdate(fo,wt),{onError:function(e){var n=(0,de.qQ)(e).messages;yo(n)},onSuccess:function(e){return(0,de.wD)(e,{callback:function(e){we(),Re(),$t(Jt),null!==e&&void 0!==e&&e.block&&Gn(null===e||void 0===e?void 0:e.block)},onErrorCallback:function(e,n){return Bn({errors:n,response:e})}})}}),er=(0,o.Z)($i,1)[0],nr="CodeBlock/".concat(wt),tr=(0,sn.y)(),or=tr.registerOnKeyDown,ir=tr.unregisterOnKeyDown;(0,c.useEffect)((function(){return function(){ir(nr)}}),[ir,nr]),or(nr,(function(e,n){Oe&&!F||wn&&!fn&&((0,cn.y)([le.zX,le.Uq],n)||(0,cn.y)([le.PQ,le.Uq],n)?Ti({block:H}):(0,cn.y)([le.XR,le.Uq],n)&&E&&(e.preventDefault(),E({language:Tt,type:It,upstream_blocks:[wt]}),Ti({block:H})))}),[E,H,fn,Ti,wn,er]),(0,c.useEffect)((function(){var e;return Bo&&(e=setInterval((function(){return to(Number(new Date))}),1e3)),no&&!Zi&&clearInterval(e),function(){return clearInterval(e)}}),[no,Zi,Bo]);var rr=(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(){er({block:pn(pn({},e),{},{color:t})})},uuid:t}),n}),[])),(0,i.Z)(n,P.tf.SCRATCHPAD,(0,r.Z)((0,ce.Ts)(e,J,"block_menu/scratchpad",E)).map((function(e){return pn(pn({},e),{},{onClick:function(){return An().then((function(){return e.onClick()}))}})}))),n);return t[e.type]}),[E,J,An,er]),lr=(0,c.useMemo)((function(){return Pt&&(null===ji||void 0===ji?void 0:ji[Pt])}),[ji,Pt]),ur=(0,c.useMemo)((function(){return!Yt&&![P.tf.CALLBACK,P.tf.CONDITIONAL,P.tf.EXTENSION].includes(It)&&(0,j.jsx)(S,{block:H,blocks:L,openSidekickView:Tn,pipeline:Sn})}),[L,H,It,Yt,Tn,Sn]),cr=(0,c.useMemo)((function(){if(Pt&&!go)return null;if(P.tf.GLOBAL_DATA_PRODUCT===It){var e=null===Lt||void 0===Lt?void 0:Lt[null===Mt||void 0===Mt?void 0:Mt.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 Tn(k.cH.BLOCK_SETTINGS)},children:"Customize block settings"})]})]})}var n,t;return go&&P.t6.PYTHON!==Tt||(n=(0,j.jsx)(w.Z,{autoHeight:!0,autocompleteProviders:Ht,block:H,height:Me,language:Tt,onChange:function(e){$t(e),null===kn||void 0===kn||kn(e)},onContentSizeChangeCallback:Vn?function(){return ht()}:null,onDidChangeCursorPosition:Ai,onMountCallback:Vn?function(){mt(!0)}:null,placeholder:P.tf.DBT===It&&P.t6.YAML===Tt?"e.g. --select ".concat(oi||"project","/models --exclude ").concat(oi||"project","/models/some_dir"):"Start typing here...",selected:wn,setSelected:Fn,setTextareaFocused:zn,shortcuts:fn?[]:[function(e,n){return(0,rn.Q)(e,(function(){fn||Ti({block:H,code:n.getValue()})}))}],textareaFocused:Xn,value:Jt,width:"100%"}),t=Et&&(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:Ht,language:"python",onChange:function(e){pi(e),null===Zn||void 0===Zn||Zn(e)},onDidChangeCursorPosition:Ai,placeholder:"Start typing here...",selected:wn,setSelected:Fn,setTextareaFocused:zn,textareaFocused:Xn,value:fi,width:"100%"})]})]})),go?(0,j.jsx)(ye,{block:H,blocksMapping:ji,blockContent:Jt,callbackEl:t,codeEditor:n,hasElementsBelow:(null===Go||void 0===Go?void 0:Go.length)>=1||!!ur,onChangeBlock:function(e){return er({block:e})},openSidekickView:Tn,savePipelineContent:An,setContent:$t,showDataIntegrationModal:Wn}):(0,j.jsxs)(j.Fragment,{children:[n,t]})}),[Ht,H,ur,Tt,It,ji,fi,Jt,oi,Mt,Lt,Et,Me,fn,go,Go,Zn,kn,Ai,Tn,Pt,Ti,wn,$t,mt,Fn,zn,Vn,Xn]);(0,c.useEffect)((function(){G&&zt({python:(0,Ke.Z)({autocompleteItems:G,block:H,blocks:J,pipeline:Sn})})}),[G,H,J,Sn]);var ar=(0,c.useMemo)((function(){var e;return vo?e=(0,j.jsx)(I.Z,{onClickTab:function(e){Wo(e),re.gM.uuid!==e.uuid&&re.Jt.uuid!==e.uuid||Xi()},selectedTabUUID:null===Qo||void 0===Qo?void 0:Qo.uuid,tabs:(0,re.Xy)(H),underlineColor:(0,x.qn)(P.tf.DBT,{theme:et}).accent,underlineStyle:!0}):ct&&![P.tf.CALLBACK,P.tf.CONDITIONAL,P.tf.EXTENSION].includes(It)&&(e=(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(I.Z,{onClickTab:function(e){Wo(e)},selectedTabUUID:null===Qo||void 0===Qo?void 0:Qo.uuid,tabs:(0,re.iz)(H),underlineColor:Li,underlineStyle:!0}),(0,j.jsx)(me.Z,{medium:!0})]})),e?(0,j.jsx)(x.HS,{children:e}):null}),[H,It,Li,Xi,vo,Qo,ct,et]),dr=(0,c.useMemo)((function(){if(Zi&&no&&no>Bo){var e=(0,j.jsxs)(g.ZP,{muted:!0,children:["".concat(Math.round((no-Bo)/1e3)),"s"]});return go&&P.t6.PYTHON!==Tt?(0,j.jsx)(Ve.Nk,{children:(0,j.jsx)(b.Z,{p:1,children:e})}):(0,j.jsx)(x.HC,{children:e})}return null}),[Tt,no,go,Zi,Bo]),sr=(0,c.useMemo)((function(){var e,n,t;oe.uF.QUEUED===Ze&&(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===Ze&&(e=(0,j.jsx)($.Z,{color:null===et||void 0===et||null===(t=et.content)||void 0===t?void 0:t.active}));var o,i=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,pn(pn({},Ki),{},{block:H,blockIndex:z,blockMetadata:Ji,buttonTabs:ct?null:ar,childrenBelowTabs:t,collapsed:Po,hasOutput:Mi,hideOutput:o,isInProgress:Zi,mainContainerWidth:xn,messages:Ri,messagesAll:Go,onClickSelectBlock:Vn?qi:null,openSidekickView:Tn,outputRowNormalPadding:Vn||go||ct,pipeline:Sn,ref:K,runCount:Ro,runEndTime:No,runStartTime:Bo,scrollTogether:Rn,selected:wn,selectedTab:Qo,setCollapsed:Vn?null:function(e){Io((function(){return(0,ln.t8)(gi,e),e}))},setErrors:Bn,setOutputBlocks:Un,setSelectedOutputBlock:Hn,setSelectedTab:Wo,showBorderTop:Vn,sideBySideEnabled:Vn,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:Li,monospace:!0,onClick:function(){var e,n,t;Oi({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===H||void 0===H?void 0:H.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 Ti({block:H,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:Li,size:3*B.iI,children:(0,j.jsx)(ie.Py,{black:!0,size:1.5*B.iI})})})]})}),Mi&&(0,j.jsx)(me.Z,{medium:!0})]})}))},r=re.aL.uuid===(null===Qo||void 0===Qo?void 0:Qo.uuid);return ct?(r?o=(0,j.jsx)(Ne,{executionStates:_i,isInProgress:Zi}):re.qC.uuid===(null===Qo||void 0===Qo?void 0:Qo.uuid)?o=(0,j.jsx)(Ae,{executionStates:_i,isInProgress:Zi}):re.p.uuid===(null===Qo||void 0===Qo?void 0:Qo.uuid)?o=(0,j.jsx)(Ue,{executionStates:_i}):re.SD.uuid===(null===Qo||void 0===Qo?void 0:Qo.uuid)&&(o=(0,j.jsx)(Le,{disableGraph:!wn,executionStates:_i,overrideScrollForGraph:wn})),Vn?i({childrenBelowTabs:(0,j.jsxs)(j.Fragment,{children:[ar,(0,j.jsx)(me.Z,{medium:!0}),(0,j.jsx)("div",{ref:ot,children:o})]}),hideOutput:!r}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(x.jv,pn(pn({},Ki),{},{className:wn&&Xn?"selected":null,hideBorderBottom:r&&Mi,lightBackground:!0,noPadding:!0,children:[ar,(0,j.jsx)(me.Z,{light:!0}),o]})),r&&i()]})):i()}),[H,_i,z,Ji,K,Ki,ar,Li,Oi,Ze,Mi,go,To,Zi,bo,xn,Go,Ri,qi,Tn,Po,gi,Sn,nt,tt,Ti,Ro,No,Bo,Rn,wn,Qo,Bn,Un,Io,Hn,Vn,ct,Xn]),fr=(0,c.useCallback)((function(){return Wt(!1)}),[]),pr=(0,c.useRef)(null),vr=(0,c.useCallback)((function(e){clearTimeout(pr.current),Oo((function(n){return pn(pn({},n),e)})),pr.current=setTimeout((function(){var n=pn(pn({},Co),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])&&An({block:{configuration:n,uuid:wt}})}),1e3)}),[wt,Co,An]),mr=Xe.zJ.BIGQUERY===Co[M.cH]||Xe.zJ.SNOWFLAKE===Co[M.cH],hr=(0,c.useMemo)((function(){return(null===J||void 0===J?void 0:J.length)||0}),[J]),br=(0,c.useMemo)((function(){return Jt?(0,j.jsx)(Se.Z,{children:Jt}):(0,j.jsx)(b.Z,{px:1,children:(0,j.jsx)(g.ZP,{monospace:!0,muted:!0,children:"Double-click to edit"})})}),[Jt]);(0,c.useEffect)((function(){bo&&To&&!wn&&qo(!1)}),[To,bo,wn]);var gr=(0,c.useMemo)((function(){return(0,j.jsx)(Fe.Z,{compact:!0,monospace:!0,onBlur:function(){return setTimeout((function(){Nn(!1)}),300)},onChange:function(e){Nn(!0),vr((0,i.Z)({},M.mW,+e.target.value)),e.preventDefault()},onClick:Ge.j,onFocus:function(){Nn(!0)},small:!0,type:"number",value:Co[M.mW]||"",width:11*B.iI})}),[Co,Nn,vr]),xr=(0,c.useMemo)((function(){return se>=1}),[se]),jr=(0,c.useMemo)((function(){return fe>=1}),[fe]),Cr=(0,c.useMemo)((function(){return pe>=1}),[pe]),Or=(0,c.useMemo)((function(){var e=3*x.IN;return Rn?Cr&&(e+=$e.nn):(xr&&(e+=$e.nn),jr&&(e+=$e.nn)),(xn-e)/2}),[xr,jr,Cr,xn,Rn]),Zr=(0,c.useMemo)((function(){var e;if(gt)return Vn&&(e=0,Rn?Cr&&(e=18):(xr&&(e+=18),jr&&(e+=2))),null===Q||void 0===Q?void 0:Q.map((function(n,t){return(0,j.jsx)("div",{children:(0,j.jsx)(_.Z,{blockInteraction:n,contained:!0,containerRef:Vn?nt:ae,containerWidth:Vn?Or:xn,interaction:null===mn||void 0===mn?void 0:mn[null===n||void 0===n?void 0:n.uuid],setVariables:co,showVariableUUID:!0,variables:uo,widthOffset:e})},"".concat(null===n||void 0===n?void 0:n.uuid,"-").concat(t))}))}),[Q,xr,jr,Cr,ae,mn,gt,xn,Rn,co,Vn,uo,Or]);(0,c.useEffect)((function(){(0,an.h)()}),[Zr,io,uo]);var kr=(0,c.useMemo)((function(){return gt&&null!==Q&&void 0!==Q&&Q.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 ro(n)},selectedTabUUID:io,tabs:re.C4,underlineColor:(0,x.qn)(null===H||void 0===H?void 0:H.type,{blockColor:null===H||void 0===H?void 0:H.color,theme:et}).accent,underlineStyle:!0})})}):null}),[H,Q,gt,io,ro,et]),yr=(0,c.useMemo)((function(){if(!gt)return null;var e=[],n={};if(null===Q||void 0===Q||Q.forEach((function(t){var o=t.uuid,i=null===mn||void 0===mn?void 0:mn[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)}))]})}),[Q,mn,gt]),Er=(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)(Sn,e,n).map((function(e){var n=pn({},ji[e]||{}),t=n.upstream_blocks;return t&&(n.upstream_blocks=t.filter((function(e){return e!==wt}))),n}));return[P.tf.DATA_LOADER,P.tf.TRANSFORMER].includes(It)&&P.tf.SCRATCHPAD===n.type&&(t="from mage_ai.data_preparation.variable_manager import get_variable\n\n\ndf = get_variable('".concat(fo,"', '").concat(wt,"', 'output_0')")),t=(0,nn.X7)(n,t),P.t6.SQL===Tt&&(o=pn(pn({},(0,dn.GL)(Dt,[M.cH,M.Sv,M.sc,M.BD,M.nq])),o)),P.t6.SQL===n.language&&(t=(0,nn.SF)(t)),E(pn(pn({},n),{},{configuration:o,content:t,upstream_blocks:i}),r)},blockIdx:n,blockTemplates:Y,compact:!0,hideCustom:po,hideDbt:po,onClickAddSingleDBTModel:yn,pipeline:Sn,project:_n,setAddNewBlockMenuOpenIdx:Dn,setCreatingNewDBTModel:Mn,showBrowseTemplates:Qn,showConfigureProjectModal:Kn,showGlobalDataProducts:qn})}),[Dt,Y,It,wt,ji,po,po,yn,Sn,Sn,fo,_n,Dn,Mn,Qn,Kn,qn]),Tr=(0,j.jsx)("div",{ref:n,children:(0,j.jsx)("div",{ref:ei,style:{zIndex:z===T?hr+9:null},children:(0,j.jsxs)("div",{style:{paddingTop:Vn&&0===z?x.WC:0,position:"relative"},children:[Vn&&z>=1&&(0,j.jsxs)(x.gE,{additionalZIndex:hr-z,bottom:0,height:x.WC,onMouseEnter:function(){return Ft(!0)},onMouseLeave:function(){Ft(!1),null===Dn||void 0===Dn||Dn(null)},children:[Ut&&E&&(0,j.jsx)(b.Z,{mx:2,style:{width:"100%"},children:Er(null===J||void 0===J?void 0:J[z-1],z-1)}),(0,j.jsx)(x.t1,{className:"block-divider-inner"})]}),(0,j.jsxs)("div",{style:{position:"relative"},children:[(0,j.jsx)(x.nz,pn(pn({},pn(pn({},Ki),Xo)),{},{onClick:function(){return qi()},ref:je?null:Jo,zIndex:Vn?null:hr+1-(z||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===H||void 0===H?void 0:H.type)?"GDP":P.dO[Tt]}),(0,j.jsx)(b.Z,{mr:1}),(0,j.jsx)(R.Z,{color:Li,size:1.5*B.iI,square:!0}),(0,j.jsx)(b.Z,{mr:1}),(0,j.jsx)(q.Z,{items:rr(H),onClickCallback:fr,onClickOutside:fr,open:Kt,parentRef:xi,uuid:"CodeBlock/block_menu",children:(0,j.jsx)(g.ZP,{color:Li,monospace:!0,noWrapping:!0,children:null===(l=vo?P.tf.DBT:P.V4[It])||void 0===l?void 0:l.toUpperCase()})}),!ze&&[P.tf.CUSTOM,P.tf.SCRATCHPAD].includes(It)&&(0,j.jsxs)(j.Fragment,{children:["\xa0",(0,j.jsx)(m.ZP,{basic:!0,iconOnly:!0,noPadding:!0,onClick:function(){return Wt(!0)},transparent:!0,children:(0,j.jsx)(ie.K5,{muted:!0})})]})]}),!ze&&(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:[vo&&P.t6.YAML!==Tt&&(0,j.jsx)(ee.Z,{block:!0,label:(0,un.$1)(H,{fullPath:!0}),size:null,children:(0,j.jsx)(g.ZP,{monospace:!0,muted:!0,children:(0,un.$1)(H)})}),(!vo||P.t6.YAML===Tt)&&(0,j.jsx)(X.Z,{default:!0,monospace:!0,noWrapping:!0,onClick:function(){return Yn(H,St)},preventDefault:!0,sameColorAsText:!0,children:wt})]}),!P.iZ.includes(It)&&xn>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",Bi),". ").concat(0===Bi?"Click to select 1 or more blocks to depend on.":"Edit parent blocks.","\n "),size:null,widthFitContent:Bi>=1,children:(0,j.jsx)(m.ZP,{noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){Fn(!0),Ln({upstreamBlocks:{block:H,values:null===Rt||void 0===Rt?void 0:Rt.map((function(e){return{uuid:e}}))}})},children:(0,j.jsxs)(h.ZP,{alignItems:"center",children:[0===Bi&&(0,j.jsx)(ie.Jj,{size:3*B.iI}),Bi>=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:Bi>=1,noWrapping:!0,small:!0,underline:0===Bi,children:[0===Bi&&"Edit parents",Bi>=1&&(0,U._6)("parent",Bi)]})]})})})]}),Nt>=2&&xn>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(Nt," 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 Tn(k.cH.BLOCK_SETTINGS)},preventDefault:!0,small:!0,children:[Nt," pipelines"]})]})})]})]})]}),Pn&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(b.Z,{pr:B.cd}),(0,j.jsx)(ve,{addNewBlock:E,addWidget:N,block:H,blockContent:Jt,blocks:J,deleteBlock:xe,executionState:Ze,fetchFileTree:Re,fetchPipeline:we,hideExtraButtons:Be,interruptKernel:hn,isEditingBlock:To,openSidekickView:Tn,pipeline:Sn,project:_n,runBlock:fn?null:Ti,savePipelineContent:An,setBlockContent:function(e){$t(e),null===kn||void 0===kn||kn(e)},setErrors:Bn,setIsEditingBlock:qo,setOutputCollapsed:Io,showConfigureProjectModal:Kn})]}),!Vn&&!Be&&(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(){Vt((function(e){return(0,ln.t8)(bi,!e),!e})),Yt||Io((function(){return(0,ln.t8)(gi,!0),!0}))},transparent:!0,children:Yt?(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 qi()},children:[(0,j.jsxs)(x.jv,pn(pn({},Ki),{},{className:wn&&Xn?"selected":null,hideBorderBottom:!Vn&&(!!ar||Mi),lightBackground:bo&&!To,noPadding:!0,onClick:qi,onDoubleClick:function(){bo&&!To&&qo(!0)},children:[(0,j.jsx)(x.PB,{}),Wi.length>=1&&(0,j.jsx)(x.HS,{children:(0,j.jsx)(b.Z,{p:1,children:(0,j.jsx)(h.ZP,{children:Wi.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)}))})})}),!He&&P.tf.DBT===It&&!Yt&&(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===Tt&&(0,j.jsx)(Pe.Z,{compact:!0,monospace:!0,onBlur:function(){return setTimeout((function(){Nn(!1)}),300)},onChange:function(e){var n;vr((n={},(0,i.Z)(n,M.Mv,""),(0,i.Z)(n,M.eW,e.target.value),n)),e.preventDefault()},onClick:Ge.j,onFocus:function(){Nn(!0)},placeholder:"Project",small:!0,value:Co[M.eW]||"",children:Object.keys(ti||{}).map((function(e){return(0,j.jsx)("option",{value:e,children:e},e)}))}),P.t6.YAML!==Tt&&(0,j.jsx)(g.ZP,{monospace:!0,small:!0,children:oi}),(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"}),!ai&&(0,j.jsx)(Pe.Z,{compact:!0,disabled:!oi,monospace:!0,onBlur:function(){return setTimeout((function(){Nn(!1)}),300)},onChange:function(e){vr((0,i.Z)({},M.Mv,e.target.value)),e.preventDefault()},onClick:Ge.j,onFocus:function(){Nn(!0)},placeholder:ui,small:!0,value:li||"",children:null===ri||void 0===ri?void 0:ri.map((function(e){return(0,j.jsx)("option",{value:e,children:e},e)}))}),ai&&(0,j.jsx)(Fe.Z,{compact:!0,monospace:!0,onBlur:function(){return setTimeout((function(){Nn(!1)}),300)},onChange:function(e){vr((0,i.Z)({},M.Mv,e.target.value)),e.preventDefault()},onClick:Ge.j,onFocus:function(){Nn(!0)},placeholder:oi?(null===ii||void 0===ii?void 0:ii.target)||"Enter target":"Select project first",small:!0,value:li||"",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:ai,label:(0,j.jsx)(g.ZP,{muted:!0,small:!0,children:"Manually enter target"}),onClick:function(e){(0,Ge.j)(e),di(!ai),ai&&vr((0,i.Z)({},M.Mv,null))}}),(0,j.jsx)("span",{children:"\xa0"}),(0,j.jsx)(ie.kI,{muted:!0})]})})})]}),P.t6.YAML!==Tt&&!(null!==ni&&void 0!==ni&&null!==(C=ni.block)&&void 0!==C&&C.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"})]})}),gr,(0,j.jsx)(b.Z,{mr:1})]})]}),P.t6.YAML===Tt&&(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)(Fe.Z,{compact:!0,monospace:!0,onBlur:function(){return setTimeout((function(){Nn(!1)}),300)},onChange:function(e){vr((0,i.Z)({},M.Pi,pn(pn({},null===Co||void 0===Co?void 0:Co[M.Pi]),{},(0,i.Z)({},M.pA,e.target.value)))),e.preventDefault()},onClick:Ge.j,onFocus:function(){Nn(!0)},placeholder:"command",small:!0,value:(null===Co||void 0===Co||null===(Z=Co[M.Pi])||void 0===Z?void 0:Z[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===Co||void 0===Co?void 0:Co[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})]})})]})})]}),!He&&mo&&!Yt&&P.tf.DBT!==It&&(0,j.jsx)(x.y9,{normalPadding:!0,children:(0,j.jsxs)(h.ZP,{flexWrap:"wrap",style:{marginTop:"-8px"},children:[(0,j.jsxs)(h.ZP,{style:{marginTop:"8px"},children:[(0,j.jsx)(Pe.Z,{compact:!0,label:"Connection",onChange:function(e){return vr((0,i.Z)({},M.cH,e.target.value))},onClick:Ge.j,small:!0,value:Co[M.cH],children:null===he||void 0===he?void 0:he.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)(Pe.Z,{compact:!0,label:"Profile",onChange:function(e){return vr((0,i.Z)({},M.sc,e.target.value))},onClick:Ge.j,small:!0,value:Co[M.sc],children:null===hi||void 0===hi?void 0:hi.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:Co[M.Mi],label:(0,j.jsx)(g.ZP,{muted:!0,small:!0,children:"Use raw SQL"}),onClick:function(e){(0,Ge.j)(e),vr((0,i.Z)({},M.Mi,!Co[M.Mi]))}}),(0,j.jsx)("span",{children:"\xa0"}),(0,j.jsx)(ie.kI,{muted:!0})]})})}),!Co[M.Mi]&&(0,j.jsxs)(j.Fragment,{children:[mr&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(b.Z,{mr:1}),(0,j.jsx)(h.ZP,{alignItems:"center",children:(0,j.jsx)(Fe.Z,{compact:!0,label:"Database",monospace:!0,onBlur:function(){return setTimeout((function(){Nn(!1)}),300)},onChange:function(e){vr((0,i.Z)({},M.Sv,e.target.value)),e.preventDefault()},onClick:Ge.j,onFocus:function(){Nn(!0)},small:!0,value:Co[M.Sv],width:10*B.iI})})]}),(0,j.jsx)(b.Z,{mr:1}),![Ee.CLICKHOUSE,Ee.MYSQL].includes(Co[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)(Fe.Z,{compact:!0,label:"Schema",monospace:!0,onBlur:function(){return setTimeout((function(){Nn(!1)}),300)},onChange:function(e){vr((0,i.Z)({},M.BD,e.target.value)),e.preventDefault()},onClick:Ge.j,onFocus:function(){Nn(!0)},small:!0,value:Co[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:[fo,"_",wt]}),(0,j.jsx)("br",{}),"This field is optional."]}),size:null,widthFitContent:!0,children:(0,j.jsx)(h.ZP,{alignItems:"center",children:(0,j.jsx)(Fe.Z,{compact:!0,label:"Table (optional)",monospace:!0,onBlur:function(){return setTimeout((function(){Nn(!1)}),300)},onChange:function(e){vr((0,i.Z)({},M.m$,e.target.value)),e.preventDefault()},onClick:Ge.j,onFocus:function(){Nn(!0)},small:!0,value:Co[M.m$],width:20*B.iI})})})]}),(0,j.jsx)(b.Z,{mr:1})]}),!Co[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"})]})}),gr,(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",mr?" 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)(Pe.Z,{compact:!0,label:"strategy",onChange:function(e){return vr((0,i.Z)({},M.nq,e.target.value))},onClick:Ge.j,small:!0,value:Co[M.nq],children:null===Te||void 0===Te?void 0:Te.map((function(e){return(0,j.jsx)("option",{value:e,children:(0,U.kC)(e)},e)}))})]})}),(0,j.jsx)(b.Z,{mr:1})]}),(null===Co||void 0===Co?void 0:Co[M.cH])===Ee.TRINO&&Rt.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:Co[M.bk],label:(0,j.jsx)(g.ZP,{muted:!0,small:!0,children:"Unique upstream table names"}),onClick:function(e){(0,Ge.j)(e),vr((0,i.Z)({},M.bk,!Co[M.bk]))}}),(0,j.jsx)("span",{children:"\xa0"}),(0,j.jsx)(ie.kI,{muted:!0})]})}),(0,j.jsx)(b.Z,{mr:1})]})]})}),kr,Rt.length>=1&&!Yt&&(P.f2.includes(It)||P.tf.DBT===It&&P.t6.YAML===Tt)&&!po&&!Pt&&!go&&(!io||io===re.zr.uuid)&&(0,j.jsxs)(x.y9,{noMargin:!0,normalPadding:!0,children:[P.tf.DBT===It&&P.t6.YAML===Tt&&(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:Rt.reduce((function(e,n,t){var o=ji[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===W||void 0===W||null===(e=W.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===Rt||void 0===Rt?void 0:Rt.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!==It&&(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:[!mo&&"Positional arguments for ".concat(ho?"":"decorated ","function:"),mo&&(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===Rt||void 0===Rt?void 0:Rt[0]})," into a table."]})]})}),(0,j.jsxs)(b.Z,{my:1,children:[!mo&&!ho&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(g.ZP,{monospace:!0,muted:!0,small:!0,children:[P.tf.DATA_EXPORTER===It&&"@data_exporter",P.tf.DATA_LOADER===It&&"@data_loader",P.tf.TRANSFORMER===It&&"@transformer",P.tf.CUSTOM===It&&"@custom"]}),(0,j.jsxs)(g.ZP,{monospace:!0,muted:!0,small:!0,children:["def ",(P.tf.DATA_EXPORTER===It?"export_data":P.tf.DATA_LOADER===It&&"load_data")||P.tf.TRANSFORMER===It&&"transform"||P.tf.CUSTOM===It&&"transform_custom","(",Rt.map((function(e,n){return n>=1?"data_".concat(n+1):"data"})).join(", "),"):"]})]}),ho&&(0,j.jsx)(j.Fragment,{children:(0,j.jsxs)(g.ZP,{monospace:!0,muted:!0,small:!0,children:[P.tf.DATA_EXPORTER===It?"export_data":P.tf.TRANSFORMER===It&&"transform","\xa0\u2190 function(",Rt.map((function(e,n){return"df_".concat(n+1)})).join(", "),"):"]})}),mo&&(null===Rt||void 0===Rt?void 0:Rt.length)>=1&&(0,j.jsx)(Qe,{block:H,blockConfiguration:Co,blockRefs:W,blocks:null===Rt||void 0===Rt?void 0:Rt.map((function(e){return null===ji||void 0===ji?void 0:ji[e]})),updateBlockConfiguration:vr}),!mo&&Rt.map((function(e,n){var t=ji[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:[!mo&&!ho&&(0,j.jsxs)(g.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:["\xa0\xa0\xa0\xa0data",n>=1?"_".concat(n+1):null]}),mo&&(0,j.jsx)(g.ZP,{inline:!0,monospace:!0,muted:!0,small:!0,children:i}),ho&&(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===W||void 0===W||null===(e=W.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)}))]})]})]}),(!io||!(null!==Q&&void 0!==Q&&Q.length)||io===re.zr.uuid)&&!Yt&&yr&&(0,j.jsx)(x.HS,{darkBorder:!0,noBackground:!0,children:(0,j.jsx)(b.Z,{p:1,children:yr})}),re.aj.uuid===io&&(null===Q||void 0===Q?void 0:Q.length)>=1&&!Yt&&(0,j.jsx)(j.Fragment,{children:Zr}),!yt&&(!io||!(null!==Q&&void 0!==Q&&Q.length)||re.zr.uuid===io)&&(0,j.jsx)(j.Fragment,{children:Yt?(0,j.jsx)(b.Z,{p:1,children:(0,j.jsxs)(g.ZP,{monospace:!0,muted:!0,children:["(",(0,U._6)("line",null===Jt||void 0===Jt?void 0:Jt.split(/\r\n|\r|\n/).length)," collapsed)"]})}):!bo||To?lr&&!go?(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===lr||void 0===lr?void 0:lr.type,{blockColor:null===lr||void 0===lr?void 0:lr.color,theme:et}).accent,onClick:function(e){var n,t;(0,Ge.j)(e);var o=null===W||void 0===W||null===(n=W.current)||void 0===n?void 0:n["".concat(null===lr||void 0===lr?void 0:lr.type,"s/").concat(null===lr||void 0===lr?void 0:lr.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===lr||void 0===lr?void 0:lr.type,{blockColor:null===lr||void 0===lr?void 0:lr.color,theme:et}).accent,inline:!0,monospace:!0,children:null===lr||void 0===lr?void 0:lr.uuid})})]})}):(0,j.jsx)(b.Z,{py:go?0:B.cd,children:cr}):br}),Ie&&c.cloneElement(Ie,{runBlockAndTrack:Ti}),yt&&(0,j.jsxs)(b.Z,{p:B.cd,children:[(0,j.jsx)(g.ZP,{bold:!0,danger:!0,children:null===yt||void 0===yt?void 0:yt.error}),(0,j.jsx)(g.ZP,{muted:!0,children:null===yt||void 0===yt?void 0:yt.message})]}),!(go&&P.t6.PYTHON!==Tt)&&dr,go&&P.t6.PYTHON!==Tt&&dr,ur]})),!Vn&&sr]})]}),!Vn&&!On&&(0,j.jsxs)(x.gE,{additionalZIndex:hr-z,onMouseEnter:function(){return Ft(!0)},onMouseLeave:function(){Ft(!1),null===Dn||void 0===Dn||Dn(null)},children:[Ut&&E&&(0,j.jsx)(b.Z,{mt:2,mx:2,style:{width:"100%"},children:Er(H,z)}),(0,j.jsx)(x.t1,{className:"block-divider-inner"})]}),te]})})}),Sr=(0,c.useMemo)((function(){var e=bn||{},n=(e.height,e.x),t=(e.width,e.y),o=n+x.IN;return xr&&!Rn&&(o+=$e.nn),(0,j.jsx)(x.j1,{left:o,ref:nt,top:t,width:Or,children:Tr})}),[z,Tr,xr,bn,Rn]),_r=(0,c.useMemo)((function(){return((null===J||void 0===J?void 0:J.length)||0)-z}),[z,J]),Pr=(0,c.useMemo)((function(){var e=bn||{},n=(e.height,e.x),t=e.width,o=e.y,i=$n+x.IN-(n+t);return Rn?Cr&&(i+=x.IN):jr&&(i+=x.IN),(0,j.jsx)(x.j1,{ref:tt,right:i,top:o,width:Or,zIndex:_r,children:sr})}),[z,J,sr,jr,Cr,bn,Or,$n,_r]);return Vn?(0,j.jsxs)(x.fk,{zIndex:wn?_r:Ut?2*_r:null,children:[Sr,Pr]}):Tr}var hn=c.forwardRef(mn)},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],W=(0,c.useState)(!1),q=W[0],Y=W[1],V=(0,c.useState)(M),X=V[0],J=V[1],$=(0,c.useCallback)((function(e){Y(!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),Y(!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&&q,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(39791),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,W=e.onCreateCustomTemplate,q=e.onMutateSuccess,Y=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(!Y&&X&&encodeURIComponent(X),{object_type:h.Z}).data,Oe=(0,l.useMemo)((function(){return Y||(null===Ce||void 0===Ce?void 0:Ce.custom_template)}),[Ce,Y]),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;q&&(null===q||void 0===q||q()),W?null===W||void 0===W||W(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(Y?encodeURIComponent(null===Y||void 0===Y?void 0:Y.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;q&&(null===q||void 0===q||q()),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=!Y&&!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"}}),qe([])}),[Fe]),He=(0,l.useState)({}),ze=He[0],Qe=He[1],Ke=(0,l.useState)([]),We=Ke[0],qe=Ke[1],Ye=(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?qe((function(e){return e.find((function(e){var n=e.uuid;return i===n}))||!Ye?e:e.concat(Ye)})):_.uF.IDLE===t&&qe((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;We.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})),qe((function(e){return e.find((function(e){var n=e.uuid;return m===n}))?e:e.concat(n)})))}),[We,Je,Qe,qe,Xe]),en=(0,l.useMemo)((function(){return We.reduce((function(e,n,t){return Q(Q({},e),{},(0,o.Z)({},n.uuid,Q(Q({},n),{},{priority:t})))}),{})}),[We]),nn=(0,l.useMemo)((function(){if(!ae)return(0,H.jsx)("div",{});var e=en[null===Ye||void 0===Ye?void 0:Ye.uuid],n=e?0===e.priority?_.uF.BUSY:_.uF.QUEUED:_.uF.IDLE;return(0,H.jsx)(m.Z,{block:Ye,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===Ye||void 0===Ye?void 0:Ye.uuid],noDivider:!0,onChange:function(e){return je((function(n){return Q(Q({},n),{},{content:e})}))},runBlock:$e,runningBlocks:We,selected:!0,setErrors:ne,textareaFocused:!0},String(oe))}),[Ye,oe,Ge,ze,ae,$e,We,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%;"]),W=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 ")})),q=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 ")})),Y=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[Y.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]),We=(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]),qe=(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(We(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(We(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(We(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,We,He,ze,Fe,Ge,y,Ke,Qe,le,ae]),Ye=(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:qe,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:Ye,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:[[Y.RJ,Y.ZS]]})]}),nn,(0,b.jsx)(W,{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)(q,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,W=l?ve.ZG/2:ve.ZG,q=25*L.iI,Y=(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)(Y));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,Y,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:W})}),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:W})}),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:W})}),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:q,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:W})}),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:q,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:W})}),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:q,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:W})}),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:W})}),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.AMAZON_SQS,d.ZP.AZURE_EVENT_HUB,d.ZP.GOOGLE_CLOUD_PUBSUB,d.ZP.INFLUXDB,d.ZP.KAFKA,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.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:"Files in pipeline"},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 h},OF:function(){return b},Q9:function(){return x},Rt:function(){return p},Rz:function(){return C},h8:function(){return g},k1:function(){return v},uS:function(){return j},zv:function(){return O}});var o=t(21831),i=t(82394),r=t(48339),l=t(53808),u=t(3917),c=t(86735),a=t(81728),d=t(70320);function s(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 f(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?s(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):s(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function p(e){var n={},t={};return null===e||void 0===e||e.forEach((function(e){var o=e.content,i=e.outputs,l=e.type,u=e.uuid;(null===i||void 0===i?void 0:i.length)>=1&&(n[u]=i.map((function(e){if("object"===typeof e){var n=e||{},t=n.sample_data,o=n.shape,i=n.text_data,l=n.type;return t?{data:f({shape:o},t),type:l}:i&&(0,a.Pb)(i)?JSON.parse(i):i}return{data:String(e),type:r.Gi.TEXT}}))),t[l]||(t[l]={}),t[l][u]=o})),{content:t,messages:n}}function v(e,n,t){e.forEach((function(e){(0,l.t8)("".concat(t,"/").concat(e.uuid,"/codeCollapsed"),(0,l.Od)("".concat(n,"/").concat(e.uuid,"/codeCollapsed"))),(0,l.t8)("".concat(t,"/").concat(e.uuid,"/outputCollapsed"),(0,l.Od)("".concat(n,"/").concat(e.uuid,"/outputCollapsed")))}))}function m(e){return"".concat(e,"/").concat(l.kP)}function h(e){return(0,l.U2)(m(e),[])}function b(e,n){var t=h(e);t.includes(n)||(0,l.t8)(m(e),[].concat((0,o.Z)(t),[n]))}function g(e,n){var t=h(e).filter((function(e){return e!==n}));(0,l.t8)(m(e),t)}function x(e,n){var t=(0,c.HK)(n,(function(e){return e.uuid}));return e.map((function(e){return t[e]})).filter((function(e){return!!e}))}var j=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 C(e,n){var t,o=(0,d.q)(),i=null===n||void 0===n?void 0:n.isPipelineUpdating,r=null===n||void 0===n?void 0:n.pipelineContentTouched,l=null===n||void 0===n?void 0:n.pipelineLastSaved;if(r)t="Unsaved changes";else if(i)t="Saving changes...";else if(l){var c=(0,u.JX)(Number(l)/1e3);null!==e&&void 0!==e&&e.updated_at&&(c=(0,u.XG)(null===e||void 0===e?void 0:e.updated_at,o)),t="Last saved ".concat(c)}else t="All changes saved";return t}function O(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.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.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.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.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 h},MU:function(){return r},RL:function(){return c},Xv:function(){return a},Zj:function(){return m},_B:function(){return i},eL:function(){return d},fe:function(){return p},ks:function(){return f},th:function(){return v},u7:function(){return s},zS:function(){return l}});var o,i,r,l,u=t(82394);!function(e){e.FULL_TABLE="FULL_TABLE",e.INCREMENTAL="INCREMENTAL",e.LOG_BASED="LOG_BASED"}(i||(i={})),function(e){e.IGNORE="IGNORE",e.UPDATE="UPDATE"}(r||(r={})),function(e){e.DATE_TIME="date-time",e.UUID="uuid"}(l||(l={}));var c,a="datetime",d=(o={},(0,u.Z)(o,l.DATE_TIME,a),(0,u.Z)(o,l.UUID,l.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"}(c||(c={}));var s,f,p,v,m,h=[c.ARRAY,c.BOOLEAN,a,c.INTEGER,c.NULL,c.NUMBER,c.OBJECT,c.STRING,l.UUID];!function(e){e.PROPERTIES="properties"}(s||(s={})),function(e){e.AUTOMATIC="automatic",e.AVAILABLE="available",e.UNSUPPORTED="unsupported"}(f||(f={})),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"}(p||(p={})),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"}(v||(v={})),function(e){e.BIGQUERY="bigquery",e.DELTA_LAKE_S3="delta_lake_s3",e.MYSQL="mysql",e.POSTGRESQL="postgresql",e.SNOWFLAKE="snowflake"}(m||(m={}))},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})})}},35185:function(e,n,t){var o=t(82394),i=t(91835),r=(t(82684),t(38626)),l=t(44897),u=t(42631),c=t(70515),a=t(28598);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,o.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=r.default.div.withConfig({displayName:"ProgressBar__ProgressBarContainerStyle",componentId:"sc-10x9ojc-0"})(["border-radius:","px;height:","px;overflow:hidden;position:relative;width:100%;",""],u.BG,.75*c.iI,(function(e){return"\n background-color: ".concat((e.theme.monotone||l.Z.monotone).grey200,";\n ")})),p=r.default.div.withConfig({displayName:"ProgressBar__ProgressBarStyle",componentId:"sc-10x9ojc-1"})(["height:inherit;position:absolute;"," "," "," ",""],(function(e){return!e.danger&&"\n background-color: ".concat((e.theme.progress||l.Z.progress).positive,";\n ")}),(function(e){return e.progress&&"\n width: ".concat(e.progress,"%;\n ")}),(function(e){return e.danger&&"\n background-color: ".concat((e.theme.progress||l.Z.progress).negative,";\n ")}),(function(e){return e.animateProgress&&"\n animation: animate-progress ".concat(e.animateProgress.duration,"ms linear forwards;\n\n @keyframes animate-progress {\n 0% {\n width: ").concat(e.animateProgress.start,"%;\n }\n\n 100% {\n width: ").concat(e.animateProgress.end,"%;\n }\n }\n ")}));n.Z=function(e){var n=(0,i.Z)({},e);return(0,a.jsx)(f,s(s({},n),{},{children:(0,a.jsx)(p,s({},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 q},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 W},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 W(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 q(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}}}]);