mage-ai 0.9.65__py3-none-any.whl → 0.9.67__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 (242) hide show
  1. mage_ai/api/monitors/BaseMonitor.py +38 -16
  2. mage_ai/api/policies/BackfillPolicy.py +1 -0
  3. mage_ai/api/resources/OauthResource.py +13 -5
  4. mage_ai/api/resources/SessionResource.py +6 -4
  5. mage_ai/authentication/ldap.py +19 -9
  6. mage_ai/authentication/oauth/constants.py +8 -14
  7. mage_ai/authentication/oauth/utils.py +18 -6
  8. mage_ai/authentication/providers/active_directory.py +21 -16
  9. mage_ai/authentication/providers/azure_devops.py +18 -0
  10. mage_ai/authentication/providers/bitbucket.py +10 -9
  11. mage_ai/authentication/providers/constants.py +2 -0
  12. mage_ai/authentication/providers/ghe.py +5 -9
  13. mage_ai/authentication/providers/gitlab.py +6 -9
  14. mage_ai/authentication/providers/google.py +9 -6
  15. mage_ai/authentication/providers/oidc.py +6 -4
  16. mage_ai/authentication/providers/okta.py +9 -6
  17. mage_ai/cluster_manager/kubernetes/workload_manager.py +10 -0
  18. mage_ai/cluster_manager/workspace/base.py +6 -1
  19. mage_ai/cluster_manager/workspace/kubernetes.py +3 -0
  20. mage_ai/data_preparation/decorators.py +15 -0
  21. mage_ai/data_preparation/executors/streaming_pipeline_executor.py +22 -12
  22. mage_ai/data_preparation/git/__init__.py +10 -1
  23. mage_ai/data_preparation/git/api.py +3 -0
  24. mage_ai/data_preparation/git/clients/azure_devops.py +106 -0
  25. mage_ai/data_preparation/git/clients/base.py +6 -0
  26. mage_ai/data_preparation/git/clients/gitlab.py +3 -2
  27. mage_ai/data_preparation/git/utils.py +31 -29
  28. mage_ai/data_preparation/models/block/__init__.py +27 -18
  29. mage_ai/data_preparation/models/block/dbt/block_sql.py +164 -0
  30. mage_ai/data_preparation/models/block/dynamic/variables.py +1 -2
  31. mage_ai/data_preparation/models/pipeline.py +3 -3
  32. mage_ai/data_preparation/models/triggers/__init__.py +6 -1
  33. mage_ai/data_preparation/preferences.py +42 -37
  34. mage_ai/data_preparation/repo_manager.py +21 -0
  35. mage_ai/data_preparation/storage/gcs_storage.py +27 -2
  36. mage_ai/data_preparation/storage/local_storage.py +18 -3
  37. mage_ai/data_preparation/storage/s3_storage.py +7 -2
  38. mage_ai/data_preparation/templates/data_loaders/streaming/generic_python.py +23 -0
  39. mage_ai/data_preparation/templates/main/metadata.yaml +6 -0
  40. mage_ai/data_preparation/templates/template.py +6 -2
  41. mage_ai/data_preparation/variable_manager.py +2 -1
  42. mage_ai/io/base.py +3 -0
  43. mage_ai/io/bigquery.py +2 -0
  44. mage_ai/io/export_utils.py +14 -9
  45. mage_ai/io/mssql.py +104 -25
  46. mage_ai/io/mysql.py +10 -9
  47. mage_ai/io/oracledb.py +14 -2
  48. mage_ai/io/postgres.py +3 -0
  49. mage_ai/io/sql.py +14 -6
  50. mage_ai/io/trino.py +10 -8
  51. mage_ai/orchestration/db/migrations/versions/90d978a8aef8_update_unique_constraint_for_secret.py +11 -5
  52. mage_ai/orchestration/db/models/schedules.py +25 -1
  53. mage_ai/orchestration/db/models/schedules_project_platform.py +24 -1
  54. mage_ai/orchestration/job_manager.py +6 -1
  55. mage_ai/orchestration/pipeline_scheduler_original.py +16 -10
  56. mage_ai/server/constants.py +1 -1
  57. mage_ai/server/file_observer.py +10 -0
  58. mage_ai/server/frontend_dist/404.html +2 -2
  59. mage_ai/server/frontend_dist/_next/static/chunks/{1557-a754b04510d50b80.js → 1557-01f0843dc6ac4971.js} +1 -1
  60. mage_ai/server/frontend_dist/_next/static/chunks/9440-4069842b90d4b801.js +1 -0
  61. mage_ai/server/frontend_dist/_next/static/chunks/pages/_app-1c1ffd928f5a00f7.js +1 -0
  62. mage_ai/server/frontend_dist/_next/static/chunks/pages/index-b7b8695a7f9efde2.js +1 -0
  63. mage_ai/server/frontend_dist/_next/static/chunks/pages/oauth-30e34ee15d410331.js +1 -0
  64. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-ff4bd7a8ec3bab40.js +1 -0
  65. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills-aaf393c86fc1bda3.js +1 -0
  66. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/{edit-8d32ac7e8f023779.js → edit-36377e679da2cd91.js} +1 -1
  67. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/logs-3f5c14076ddde20e.js +1 -0
  68. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/{triggers-fe08120d9a6fb1b0.js → triggers-f508c2f261297724.js} +1 -1
  69. mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/pipelines-bcdb4ad41dd4c7d5.js → frontend_dist/_next/static/chunks/pages/pipelines-f99e99aa8f45529c.js} +1 -1
  70. mage_ai/server/frontend_dist/_next/static/chunks/pages/{sign-in-19b36600d908b711.js → sign-in-7d38b2f7c3e918a1.js} +1 -1
  71. mage_ai/server/frontend_dist/_next/static/chunks/pages/version-control-5753fac7c1bfdc88.js +1 -0
  72. mage_ai/server/frontend_dist/_next/static/chunks/{webpack-ac7fdc472bedf682.js → webpack-d079359c241db804.js} +1 -1
  73. mage_ai/server/frontend_dist/_next/static/{ZMrJfDouIX5AMb_RteRbL → vPsMu6Fi2zrHaf2fRXKRO}/_buildManifest.js +1 -1
  74. mage_ai/server/frontend_dist/block-layout.html +2 -2
  75. mage_ai/server/frontend_dist/compute.html +2 -2
  76. mage_ai/server/frontend_dist/files.html +2 -2
  77. mage_ai/server/frontend_dist/global-data-products/[...slug].html +2 -2
  78. mage_ai/server/frontend_dist/global-data-products.html +2 -2
  79. mage_ai/server/frontend_dist/global-hooks/[...slug].html +2 -2
  80. mage_ai/server/frontend_dist/global-hooks.html +2 -2
  81. mage_ai/server/frontend_dist/index.html +2 -2
  82. mage_ai/server/frontend_dist/manage/files.html +2 -2
  83. mage_ai/server/frontend_dist/manage/settings.html +2 -2
  84. mage_ai/server/frontend_dist/manage/users/[user].html +2 -2
  85. mage_ai/server/frontend_dist/manage/users/new.html +2 -2
  86. mage_ai/server/frontend_dist/manage/users.html +2 -2
  87. mage_ai/server/frontend_dist/manage.html +2 -2
  88. mage_ai/server/frontend_dist/oauth.html +2 -2
  89. mage_ai/server/frontend_dist/overview.html +2 -2
  90. mage_ai/server/frontend_dist/pipeline-runs.html +2 -2
  91. mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills/[...slug].html +2 -2
  92. mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills.html +2 -2
  93. mage_ai/server/frontend_dist/pipelines/[pipeline]/dashboard.html +2 -2
  94. mage_ai/server/frontend_dist/pipelines/[pipeline]/edit.html +2 -2
  95. mage_ai/server/frontend_dist/pipelines/[pipeline]/logs.html +2 -2
  96. mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runs.html +2 -2
  97. mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runtime.html +2 -2
  98. mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors.html +2 -2
  99. mage_ai/server/frontend_dist/pipelines/[pipeline]/runs/[run].html +2 -2
  100. mage_ai/server/frontend_dist/pipelines/[pipeline]/runs.html +2 -2
  101. mage_ai/server/frontend_dist/pipelines/[pipeline]/settings.html +2 -2
  102. mage_ai/server/frontend_dist/pipelines/[pipeline]/syncs.html +2 -2
  103. mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers/[...slug].html +2 -2
  104. mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers.html +2 -2
  105. mage_ai/server/frontend_dist/pipelines/[pipeline].html +2 -2
  106. mage_ai/server/frontend_dist/pipelines.html +2 -2
  107. mage_ai/server/frontend_dist/platform/global-hooks/[...slug].html +2 -2
  108. mage_ai/server/frontend_dist/platform/global-hooks.html +2 -2
  109. mage_ai/server/frontend_dist/settings/account/profile.html +2 -2
  110. mage_ai/server/frontend_dist/settings/platform/preferences.html +2 -2
  111. mage_ai/server/frontend_dist/settings/platform/settings.html +2 -2
  112. mage_ai/server/frontend_dist/settings/workspace/permissions/[...slug].html +2 -2
  113. mage_ai/server/frontend_dist/settings/workspace/permissions.html +2 -2
  114. mage_ai/server/frontend_dist/settings/workspace/preferences.html +2 -2
  115. mage_ai/server/frontend_dist/settings/workspace/roles/[...slug].html +2 -2
  116. mage_ai/server/frontend_dist/settings/workspace/roles.html +2 -2
  117. mage_ai/server/frontend_dist/settings/workspace/sync-data.html +2 -2
  118. mage_ai/server/frontend_dist/settings/workspace/users/[...slug].html +2 -2
  119. mage_ai/server/frontend_dist/settings/workspace/users.html +2 -2
  120. mage_ai/server/frontend_dist/settings.html +2 -2
  121. mage_ai/server/frontend_dist/sign-in.html +2 -2
  122. mage_ai/server/frontend_dist/templates/[...slug].html +2 -2
  123. mage_ai/server/frontend_dist/templates.html +2 -2
  124. mage_ai/server/frontend_dist/terminal.html +2 -2
  125. mage_ai/server/frontend_dist/test.html +2 -2
  126. mage_ai/server/frontend_dist/triggers.html +2 -2
  127. mage_ai/server/frontend_dist/version-control.html +2 -2
  128. mage_ai/server/frontend_dist_base_path_template/404.html +2 -2
  129. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{1557-a754b04510d50b80.js → 1557-01f0843dc6ac4971.js} +1 -1
  130. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9440-4069842b90d4b801.js +1 -0
  131. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/_app-1c1ffd928f5a00f7.js +1 -0
  132. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/index-b7b8695a7f9efde2.js +1 -0
  133. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/oauth-30e34ee15d410331.js +1 -0
  134. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-ff4bd7a8ec3bab40.js +1 -0
  135. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills-aaf393c86fc1bda3.js +1 -0
  136. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/{edit-8d32ac7e8f023779.js → edit-36377e679da2cd91.js} +1 -1
  137. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/logs-3f5c14076ddde20e.js +1 -0
  138. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/{triggers-fe08120d9a6fb1b0.js → triggers-f508c2f261297724.js} +1 -1
  139. mage_ai/server/{frontend_dist/_next/static/chunks/pages/pipelines-bcdb4ad41dd4c7d5.js → frontend_dist_base_path_template/_next/static/chunks/pages/pipelines-f99e99aa8f45529c.js} +1 -1
  140. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{sign-in-19b36600d908b711.js → sign-in-7d38b2f7c3e918a1.js} +1 -1
  141. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/version-control-5753fac7c1bfdc88.js +1 -0
  142. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{webpack-481689d9989710cd.js → webpack-68c003fb6a175cd7.js} +1 -1
  143. mage_ai/server/frontend_dist_base_path_template/_next/static/{QYwFH4sievaq5XyUjRriy → khKiaJtwrslgMmp4YSa1f}/_buildManifest.js +1 -1
  144. mage_ai/server/frontend_dist_base_path_template/block-layout.html +2 -2
  145. mage_ai/server/frontend_dist_base_path_template/compute.html +2 -2
  146. mage_ai/server/frontend_dist_base_path_template/files.html +2 -2
  147. mage_ai/server/frontend_dist_base_path_template/global-data-products/[...slug].html +2 -2
  148. mage_ai/server/frontend_dist_base_path_template/global-data-products.html +2 -2
  149. mage_ai/server/frontend_dist_base_path_template/global-hooks/[...slug].html +2 -2
  150. mage_ai/server/frontend_dist_base_path_template/global-hooks.html +2 -2
  151. mage_ai/server/frontend_dist_base_path_template/index.html +2 -2
  152. mage_ai/server/frontend_dist_base_path_template/manage/files.html +2 -2
  153. mage_ai/server/frontend_dist_base_path_template/manage/settings.html +2 -2
  154. mage_ai/server/frontend_dist_base_path_template/manage/users/[user].html +2 -2
  155. mage_ai/server/frontend_dist_base_path_template/manage/users/new.html +2 -2
  156. mage_ai/server/frontend_dist_base_path_template/manage/users.html +2 -2
  157. mage_ai/server/frontend_dist_base_path_template/manage.html +2 -2
  158. mage_ai/server/frontend_dist_base_path_template/oauth.html +2 -2
  159. mage_ai/server/frontend_dist_base_path_template/overview.html +2 -2
  160. mage_ai/server/frontend_dist_base_path_template/pipeline-runs.html +2 -2
  161. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills/[...slug].html +2 -2
  162. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills.html +2 -2
  163. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/dashboard.html +2 -2
  164. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/edit.html +2 -2
  165. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/logs.html +2 -2
  166. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runs.html +2 -2
  167. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runtime.html +2 -2
  168. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors.html +2 -2
  169. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs/[run].html +2 -2
  170. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs.html +2 -2
  171. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/settings.html +2 -2
  172. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/syncs.html +2 -2
  173. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers/[...slug].html +2 -2
  174. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers.html +2 -2
  175. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline].html +2 -2
  176. mage_ai/server/frontend_dist_base_path_template/pipelines.html +2 -2
  177. mage_ai/server/frontend_dist_base_path_template/platform/global-hooks/[...slug].html +2 -2
  178. mage_ai/server/frontend_dist_base_path_template/platform/global-hooks.html +2 -2
  179. mage_ai/server/frontend_dist_base_path_template/settings/account/profile.html +2 -2
  180. mage_ai/server/frontend_dist_base_path_template/settings/platform/preferences.html +2 -2
  181. mage_ai/server/frontend_dist_base_path_template/settings/platform/settings.html +2 -2
  182. mage_ai/server/frontend_dist_base_path_template/settings/workspace/permissions/[...slug].html +2 -2
  183. mage_ai/server/frontend_dist_base_path_template/settings/workspace/permissions.html +2 -2
  184. mage_ai/server/frontend_dist_base_path_template/settings/workspace/preferences.html +2 -2
  185. mage_ai/server/frontend_dist_base_path_template/settings/workspace/roles/[...slug].html +2 -2
  186. mage_ai/server/frontend_dist_base_path_template/settings/workspace/roles.html +2 -2
  187. mage_ai/server/frontend_dist_base_path_template/settings/workspace/sync-data.html +2 -2
  188. mage_ai/server/frontend_dist_base_path_template/settings/workspace/users/[...slug].html +2 -2
  189. mage_ai/server/frontend_dist_base_path_template/settings/workspace/users.html +2 -2
  190. mage_ai/server/frontend_dist_base_path_template/settings.html +2 -2
  191. mage_ai/server/frontend_dist_base_path_template/sign-in.html +2 -2
  192. mage_ai/server/frontend_dist_base_path_template/templates/[...slug].html +2 -2
  193. mage_ai/server/frontend_dist_base_path_template/templates.html +2 -2
  194. mage_ai/server/frontend_dist_base_path_template/terminal.html +2 -2
  195. mage_ai/server/frontend_dist_base_path_template/test.html +2 -2
  196. mage_ai/server/frontend_dist_base_path_template/triggers.html +2 -2
  197. mage_ai/server/frontend_dist_base_path_template/version-control.html +2 -2
  198. mage_ai/server/server.py +117 -87
  199. mage_ai/server/utils/output_display.py +6 -1
  200. mage_ai/services/aws/s3/s3.py +8 -2
  201. mage_ai/services/slack/slack.py +8 -8
  202. mage_ai/settings/__init__.py +36 -186
  203. mage_ai/settings/backends.py +95 -0
  204. mage_ai/settings/keys/__init__.py +1 -0
  205. mage_ai/settings/keys/auth.py +76 -0
  206. mage_ai/settings/server.py +187 -0
  207. mage_ai/shared/io.py +2 -2
  208. mage_ai/shared/logger.py +12 -6
  209. mage_ai/streaming/sources/base_python.py +30 -0
  210. mage_ai/streaming/sources/source_factory.py +25 -0
  211. mage_ai/tests/api/endpoints/test_oauths.py +13 -5
  212. mage_ai/tests/api/operations/test_operations.py +2 -2
  213. mage_ai/tests/api/operations/test_sessions.py +83 -48
  214. mage_ai/tests/authentication/oauth/test_utils.py +56 -6
  215. mage_ai/tests/authentication/providers/test_active_directory.py +9 -15
  216. mage_ai/tests/data_preparation/models/test_block.py +39 -2
  217. mage_ai/tests/orchestration/db/models/test_schedules.py +33 -1
  218. {mage_ai-0.9.65.dist-info → mage_ai-0.9.67.dist-info}/METADATA +2 -1
  219. {mage_ai-0.9.65.dist-info → mage_ai-0.9.67.dist-info}/RECORD +225 -217
  220. {mage_ai-0.9.65.dist-info → mage_ai-0.9.67.dist-info}/WHEEL +1 -1
  221. mage_ai/server/frontend_dist/_next/static/chunks/9440-2bcbdc765ed82062.js +0 -1
  222. mage_ai/server/frontend_dist/_next/static/chunks/pages/_app-2ae1d919333f01fe.js +0 -1
  223. mage_ai/server/frontend_dist/_next/static/chunks/pages/index-64851458dde54ad9.js +0 -1
  224. mage_ai/server/frontend_dist/_next/static/chunks/pages/oauth-abe5ba687cb93509.js +0 -1
  225. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-22e49726eeed16ae.js +0 -1
  226. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills-c74507dce89b41a2.js +0 -1
  227. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/logs-cf656cbe37ecaacc.js +0 -1
  228. mage_ai/server/frontend_dist/_next/static/chunks/pages/version-control-690206d30d8b412b.js +0 -1
  229. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9440-2bcbdc765ed82062.js +0 -1
  230. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/_app-2ae1d919333f01fe.js +0 -1
  231. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/index-64851458dde54ad9.js +0 -1
  232. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/oauth-abe5ba687cb93509.js +0 -1
  233. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-22e49726eeed16ae.js +0 -1
  234. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills-c74507dce89b41a2.js +0 -1
  235. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/logs-cf656cbe37ecaacc.js +0 -1
  236. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/version-control-690206d30d8b412b.js +0 -1
  237. mage_ai/settings/sso.py +0 -27
  238. /mage_ai/server/frontend_dist/_next/static/{ZMrJfDouIX5AMb_RteRbL → vPsMu6Fi2zrHaf2fRXKRO}/_ssgManifest.js +0 -0
  239. /mage_ai/server/frontend_dist_base_path_template/_next/static/{QYwFH4sievaq5XyUjRriy → khKiaJtwrslgMmp4YSa1f}/_ssgManifest.js +0 -0
  240. {mage_ai-0.9.65.dist-info → mage_ai-0.9.67.dist-info}/LICENSE +0 -0
  241. {mage_ai-0.9.65.dist-info → mage_ai-0.9.67.dist-info}/entry_points.txt +0 -0
  242. {mage_ai-0.9.65.dist-info → mage_ai-0.9.67.dist-info}/top_level.txt +0 -0
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4794],{74395:function(e,n,t){"use strict";t.d(n,{M:function(){return l},W:function(){return o}});var r=t(25976),i=t(46684),o=34*t(70515).iI,l=r.default.div.withConfig({displayName:"indexstyle__BeforeStyle",componentId:"sc-12ee2ib-0"})(["min-height:calc(100vh - ","px);"],i.Mz)},88785:function(e,n,t){"use strict";t.d(n,{J:function(){return u},U:function(){return c}});var r=t(25976),i=t(44897),o=t(42631),l=t(70515),c=r.default.div.withConfig({displayName:"indexstyle__CardStyle",componentId:"sc-m7tlau-0"})(["border-radius:","px;border-style:solid;border-width:2px;height:","px;margin-right:","px;padding:","px;width:","px;"," ",""],o.TR,14*l.iI,l.cd*l.iI,l.cd*l.iI,40*l.iI,(function(e){return!e.selected&&"\n border-color: ".concat((e.theme.borders||i.Z.borders).light,";\n ")}),(function(e){return e.selected&&"\n border-color: ".concat((e.theme.interactive||i.Z.interactive).linkPrimary,";\n ")})),u=r.default.div.withConfig({displayName:"indexstyle__DateSelectionContainer",componentId:"sc-m7tlau-1"})(["border-radius:","px;padding:","px;"," "," ",""],o.n_,l.tr,(function(e){return"\n background-color: ".concat((e.theme.interactive||i.Z.interactive).defaultBackground,";\n ")}),(function(e){return e.absolute&&"\n position: absolute;\n z-index: 2;\n right: 0;\n top: ".concat(2.5*l.iI,"px;\n ")}),(function(e){return e.topPosition&&"\n top: -".concat(42*l.iI,"px;\n ")}))},14805:function(e,n,t){"use strict";var r=t(82394),i=t(44495),o=t(55485),l=t(44085),c=t(38276),u=t(30160),s=t(88785),a=t(70515),d=t(86735),p=t(28598);function f(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function h(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?f(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):f(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n=e.localTime,t=e.selectedDate,r=e.selectedTime,f=e.setSelectedDate,v=e.setSelectedTime,m=e.topPosition;return(0,p.jsxs)(s.J,{absolute:!0,topPosition:m,children:[(0,p.jsx)(i.ZP,{onChange:f,value:t}),(0,p.jsx)(c.Z,{mb:2}),(0,p.jsxs)(o.ZP,{alignItems:"center",children:[(0,p.jsxs)(u.ZP,{default:!0,large:!0,children:["Time (",n?"Local":"UTC","):"]}),(0,p.jsx)(c.Z,{pr:2}),(0,p.jsx)(l.Z,{compact:!0,monospace:!0,onChange:function(e){e.preventDefault(),v((function(n){return h(h({},n),{},{hour:e.target.value})}))},paddingRight:5*a.iI,placeholder:"HH",value:null===r||void 0===r?void 0:r.hour,children:(0,d.m5)(24,0).map((function(e){return String(e).padStart(2,"0")})).map((function(e){return(0,p.jsx)("option",{value:e,children:e},"hour_".concat(e))}))}),(0,p.jsx)(c.Z,{px:1,children:(0,p.jsx)(u.ZP,{bold:!0,large:!0,children:":"})}),(0,p.jsx)(l.Z,{compact:!0,monospace:!0,onChange:function(e){e.preventDefault(),v((function(n){return h(h({},n),{},{minute:e.target.value})}))},paddingRight:5*a.iI,placeholder:"MM",value:null===r||void 0===r?void 0:r.minute,children:(0,d.m5)(60,0).map((function(e){return String(e).padStart(2,"0")})).map((function(e){return(0,p.jsx)("option",{value:e,children:e},"minute_".concat(e))}))})]})]})}},59860:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return sn}});var r,i=t(77837),o=t(82394),l=t(38860),c=t.n(l),u=t(25976),s=t(4804),a=t(82684),d=t(44425),p=t(15338),f=t(71180),h=t(70652),v=t(39867),m=t(55485),g=t(38276),j=t(30160),b=t(74395),x=t(70515),y=u.default.div.withConfig({displayName:"indexstyle__FilterRowStyle",componentId:"sc-kvapsi-0"})(["padding-bottom:","px;padding-top:","px;"],x.iI/2,x.iI/2);!function(e){e.CRITICAL="CRITICAL",e.DEBUG="DEBUG",e.ERROR="ERROR",e.EXCEPTION="EXCEPTION",e.INFO="INFO",e.LOG="LOG",e.WARNING="WARNING"}(r||(r={}));var _,Z=[r.CRITICAL,r.DEBUG,r.ERROR,r.EXCEPTION,r.INFO,r.LOG,r.WARNING];!function(e){e.LAST_HOUR="Last hour",e.LAST_DAY="Last day",e.LAST_WEEK="Last week",e.LAST_30_DAYS="Last 30 days",e.CUSTOM_RANGE="Custom range"}(_||(_={}));var O=t(42631),P=t(79633);var I,S=(0,u.css)(["",""],(function(e){return"\n background-color: ".concat(function(e){var n=e.critical,t=e.debug,r=e.error,i=e.exception,o=e.info,l=e.log,c=e.warning;return n?P.Zl:t?P.EG:r?P.hl:i?P.hM:o?P.gN:l?P.Wd:c?P.$R:"transparent"}(e),";\n ")})),k=u.default.div.withConfig({displayName:"indexstyle__LogLevelIndicatorStyle",componentId:"sc-1e2zh7m-0"})([""," border-radius:","px;height:12px;width:5px;"],S,O.n_),w=t(81728),C=t(55283),E=t(15610),L=t(28598);function D(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function T(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}!function(e){e.BLOCK_RUN_ID="block_run_id[]",e.BLOCK_TYPE="block_type[]",e.BLOCK_UUID="block_uuid[]",e.LEVEL="level[]",e.PIPELINE_RUN_ID="pipeline_run_id[]",e.PIPELINE_SCHEDULE_ID="pipeline_schedule_id[]"}(I||(I={}));var A=function(e){var n=e.blocks,t=e.query,r=(0,a.useContext)(u.ThemeContext),i=(0,a.useMemo)((function(){return t[I.LEVEL]}),[t]),l=(0,a.useMemo)((function(){return t[I.BLOCK_TYPE]}),[t]),c=(0,a.useMemo)((function(){return t[I.BLOCK_UUID]}),[t]),s=(0,a.useMemo)((function(){return t[I.PIPELINE_SCHEDULE_ID]}),[t]),p=(0,a.useMemo)((function(){return t[I.PIPELINE_RUN_ID]}),[t]),_=(0,a.useMemo)((function(){return t[I.BLOCK_RUN_ID]}),[t]);return(0,L.jsx)(b.M,{children:(0,L.jsxs)(g.Z,{p:x.cd,children:[(0,L.jsxs)(g.Z,{mb:3,children:[(0,L.jsx)(g.Z,{mb:1,children:(0,L.jsx)(j.ZP,{bold:!0,default:!0,large:!0,children:"Log level"})}),Z.map((function(e){return(0,L.jsx)(f.ZP,{noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){return(0,E.g)(t,{level:e},{isList:!0})},children:(0,L.jsx)(y,{children:(0,L.jsxs)(m.ZP,{alignItems:"center",children:[(0,L.jsx)(h.Z,{checked:Array.isArray(i)&&(null===i||void 0===i?void 0:i.includes(String(e)))}),(0,L.jsx)(g.Z,{mr:1}),(0,L.jsx)(k,T({},(0,o.Z)({},e.toLowerCase(),!0))),(0,L.jsx)(g.Z,{mr:1}),(0,L.jsx)(j.ZP,{disableWordBreak:!0,children:(0,w.kC)(e.toLowerCase())})]})})},e)}))]}),(0,L.jsxs)(g.Z,{mb:3,children:[(0,L.jsx)(g.Z,{mb:1,children:(0,L.jsx)(j.ZP,{bold:!0,default:!0,large:!0,children:"Block type"})}),[d.tf.DATA_LOADER,d.tf.TRANSFORMER,d.tf.DATA_EXPORTER].map((function(e){return(0,L.jsx)(f.ZP,{noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){return(0,E.g)(t,{block_type:e},{isList:!0})},children:(0,L.jsx)(y,{children:(0,L.jsxs)(m.ZP,{alignItems:"center",children:[(0,L.jsx)(h.Z,{checked:Array.isArray(l)&&(null===l||void 0===l?void 0:l.includes(String(e)))}),(0,L.jsx)(g.Z,{mr:1}),(0,L.jsx)(v.Z,{color:(0,C.qn)(e,{theme:r}).accent,size:1.5*x.iI,square:!0}),(0,L.jsx)(g.Z,{mr:1}),(0,L.jsx)(j.ZP,{disableWordBreak:!0,muted:!0,monospace:!0,children:e})]})})},e)}))]}),(0,L.jsxs)(g.Z,{mb:3,children:[(0,L.jsx)(g.Z,{mb:1,children:(0,L.jsx)(j.ZP,{bold:!0,default:!0,large:!0,children:"Block"})}),n.filter((function(e){var n=e.type;return d.tf.SCRATCHPAD!==n})).map((function(e){return(0,L.jsx)(f.ZP,{noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){return(0,E.g)(t,{block_uuid:e.uuid},{isList:!0,resetLimitParams:!0})},children:(0,L.jsx)(y,{children:(0,L.jsxs)(m.ZP,{alignItems:"center",children:[(0,L.jsx)(h.Z,{checked:Array.isArray(c)&&(null===c||void 0===c?void 0:c.includes(String(e.uuid)))}),(0,L.jsx)(g.Z,{mr:1}),(0,L.jsx)(v.Z,{color:(0,C.qn)(e.type,{blockColor:e.color,theme:r}).accent,size:1.5*x.iI,square:!0}),(0,L.jsx)(g.Z,{mr:1}),(0,L.jsx)(j.ZP,{disableWordBreak:!0,monospace:!0,muted:!0,children:e.uuid})]})})},e.uuid)}))]}),(null===s||void 0===s?void 0:s.length)&&(0,L.jsxs)(g.Z,{mb:3,children:[(0,L.jsx)(g.Z,{mb:1,children:(0,L.jsx)(j.ZP,{bold:!0,default:!0,large:!0,children:"Trigger"})}),s.map((function(e){return(0,L.jsx)(f.ZP,{noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){return(0,E.g)(t,{pipeline_schedule_id:e},{isList:!0})},children:(0,L.jsx)(y,{children:(0,L.jsxs)(m.ZP,{alignItems:"center",children:[(0,L.jsx)(h.Z,{checked:Array.isArray(s)&&(null===s||void 0===s?void 0:s.includes(e))}),(0,L.jsx)(g.Z,{mr:1}),(0,L.jsx)(j.ZP,{disableWordBreak:!0,monospace:!0,children:e})]})})},"pipeline-schedule-".concat(e))}))]}),(null===p||void 0===p?void 0:p.length)&&(0,L.jsxs)(g.Z,{mb:3,children:[(0,L.jsx)(g.Z,{mb:1,children:(0,L.jsx)(j.ZP,{bold:!0,default:!0,large:!0,children:"Pipeline run"})}),p.map((function(e){return(0,L.jsx)(f.ZP,{noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){return(0,E.g)(t,{pipeline_run_id:e},{isList:!0})},children:(0,L.jsx)(y,{children:(0,L.jsxs)(m.ZP,{alignItems:"center",children:[(0,L.jsx)(h.Z,{checked:Array.isArray(p)&&(null===p||void 0===p?void 0:p.includes(e))}),(0,L.jsx)(g.Z,{mr:1}),(0,L.jsx)(j.ZP,{disableWordBreak:!0,monospace:!0,children:e})]})})},"pipeline-run-".concat(e))}))]}),(null===_||void 0===_?void 0:_.length)&&(0,L.jsxs)(g.Z,{mb:3,children:[(0,L.jsx)(g.Z,{mb:1,children:(0,L.jsx)(j.ZP,{bold:!0,default:!0,large:!0,children:"Block run"})}),_.map((function(e){return(0,L.jsx)(f.ZP,{noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(){return(0,E.g)(t,{block_run_id:e},{isList:!0})},children:(0,L.jsx)(y,{children:(0,L.jsxs)(m.ZP,{alignItems:"center",children:[(0,L.jsx)(h.Z,{checked:Array.isArray(_)&&(null===_||void 0===_?void 0:_.includes(e))}),(0,L.jsx)(g.Z,{mr:1}),(0,L.jsx)(j.ZP,{disableWordBreak:!0,monospace:!0,children:e})]})})},"block-run-".concat(e))}))]})]})})},R=t(97618),N=t(68562),B=t(75582),M=t(90299),U=t(48670),W=t(75499),J=u.default.div.withConfig({displayName:"indexstyle__BarStyle",componentId:"sc-1r43sbu-0"})([""," height:","px;width:100%;"],S,.5*x.iI),Y=u.default.div.withConfig({displayName:"indexstyle__BadgeStyle",componentId:"sc-1r43sbu-1"})([""," border-radius:","px;display:inline-block;padding:","px ","px;"],S,O.BG,.25*x.iI,.5*x.iI),F=t(72473),H=t(92083),G=t.n(H);function q(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function z(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?q(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):q(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var K=/^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}$/,$=/([0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}) (.+)/;function V(e){var n=e.content.trim().split($),t=[],r=[];return n.forEach((function(e){var n=e.trim();K.test(e)?(r.length>=1&&t.push(r.join(" ").trim()),r=[e]):r.filter((function(e){return e})).length<=1&&n&&r.push(n)})),t.push(r.join(" ").trim()),t.map((function(n){return function(e){var n=e.content.trim().match($),t=null===n||void 0===n?void 0:n[1],r=null===n||void 0===n?void 0:n[2],i={};return r&&(0,w.Pb)(r)&&(i=JSON.parse(r)),z(z({},e),{},{createdAt:t,data:i})}(z(z({},e),{},{content:n}))}))}function X(e,n){return e?null!==n&&void 0!==n&&n.localTimezone?G().unix(e).local().format():G().unix(e).utc().format("YYYY-MM-DD HH:mm:ss.SSS"):""}var Q=t(42122),ee=t(86735);function ne(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function te(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ne(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ne(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var re=["error","error_stack","error_stacktrace"],ie={uuid:"Details"},oe={uuid:"Errors"};var le=function(e){var n=e.log,t=e.onClose,r=e.selectedTab,i=e.setSelectedTab,l=(0,a.useState)(!1),c=l[0],u=l[1],s=n.data,d=n.name,h=n.path,v=s||{},b=v.error,y=v.error_stack,_=v.error_stacktrace,Z=v.level,O=v.timestamp,P=(0,o.Z)({},Z.toLowerCase(),!0),I=(0,a.useMemo)((function(){var e=[["file name",d],["file path",h]];return Object.entries(s).forEach((function(n){var t=(0,B.Z)(n,2),r=t[0],i=t[1];re.includes(r)||e.push([r,i])})),_&&e.push(["error",_]),(0,ee.YC)(e,(function(e){var n=(0,B.Z)(e,2),t=n[0];n[1];return t}))}),[s,_,d,h]),S=(0,a.useMemo)((function(){var e=[ie];return b&&e.push(oe),(0,L.jsx)(M.Z,{onClickTab:i,selectedTabUUID:null===r||void 0===r?void 0:r.uuid,tabs:e})}),[b,r,i]);return(0,L.jsxs)("div",{children:[(0,L.jsx)(J,te({},P)),(0,L.jsx)(g.Z,{p:x.cd,children:(0,L.jsxs)(m.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,L.jsxs)(R.Z,{alignItems:"center",children:[(0,L.jsx)(Y,te(te({},P),{},{children:(0,L.jsx)(j.ZP,{bold:!0,inverted:!0,monospace:!0,small:!0,children:Z})})),(0,L.jsx)(g.Z,{mr:x.cd}),(0,L.jsx)(j.ZP,{monospace:!0,children:X(O)})]}),(0,L.jsx)(f.ZP,{iconOnly:!0,noBackground:!0,onClick:function(){return t()},children:(0,L.jsx)(F.Close,{size:1.5*x.iI})})]})}),(0,L.jsx)(p.Z,{medium:!0}),(0,L.jsx)(g.Z,{py:x.cd,children:S}),ie.uuid===(null===r||void 0===r?void 0:r.uuid)&&(0,L.jsx)(W.Z,{columnFlex:[null,1],columnMaxWidth:function(e){return 1===e?"100px":null},rows:null===I||void 0===I?void 0:I.map((function(e,n){var t=(0,B.Z)(e,2),r=t[0],i=t[1],o="message"===r,l="tags"===r,s=i,d=i;if(l)d=s=(0,w.Pb)(i)?JSON.parse(JSON.stringify(i,null,2)):JSON.stringify(i,null,2);else if(o&&c&&(0,w.Pb)(i)){var p,f;d=JSON.stringify(JSON.parse(i),null,2),s=(0,L.jsx)("pre",{children:d}),!(0,a.isValidElement)(s)&&(0,Q.Kn)(s)&&null===s._owner&&"pre"===s.type&&"string"===typeof(null===(p=s)||void 0===p||null===(f=p.props)||void 0===f?void 0:f.children)&&(s=(0,a.createElement)("pre",null,s.props.children))}if("object"===typeof s)try{s=JSON.stringify(s,null,2),s=(0,L.jsx)("pre",{children:s})}catch(h){}return"object"===typeof d&&(d=JSON.stringify(d)),[(0,L.jsx)(j.ZP,{monospace:!0,muted:!0,children:r},"".concat(r,"_").concat(n,"_key")),(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(j.ZP,{monospace:!0,textOverflow:!0,title:d,whiteSpaceNormal:o&&c||l,wordBreak:o&&c||l,children:[!l&&s,l&&(0,L.jsx)("pre",{children:s})]},"".concat(r,"_").concat(n,"_val")),o&&(0,L.jsx)(U.Z,{muted:!0,onClick:function(){return u((function(e){return!e}))},children:c?"Click to hide log":"Click to show full log message"})]})]})),uuid:"LogDetail"}),oe.uuid===(null===r||void 0===r?void 0:r.uuid)&&(0,L.jsxs)(g.Z,{mb:5,px:x.cd,children:[(0,L.jsx)(g.Z,{mb:1,children:(0,L.jsx)(j.ZP,{bold:!0,children:"Error"})}),null===b||void 0===b?void 0:b.map((function(e){return e.split("\n").map((function(e){return e.split("\\n").map((function(e){return(0,L.jsx)(j.ZP,{default:!0,monospace:!0,preWrap:!0,small:!0,children:e},e)}))}))})),y&&(0,L.jsxs)(g.Z,{mt:3,children:[(0,L.jsx)(g.Z,{mb:1,children:(0,L.jsx)(j.ZP,{bold:!0,children:"Stack trace"})}),null===y||void 0===y?void 0:y.map((function(e){return null===e||void 0===e?void 0:e.map((function(e){return(0,L.jsx)(j.ZP,{default:!0,monospace:!0,preWrap:!0,small:!0,children:e},e)}))}))]})]})]})},ce=t(21831),ue=t(89565),se=t.n(ue),ae=t(12691),de=t.n(ae),pe=t(80017),fe=t(57653),he=t(98464),ve=t(46684),me=t(44897),ge=t(47041),je=u.default.div.withConfig({displayName:"indexstyle__TableContainer",componentId:"sc-16j4vp6-0"})([".table_row > div{margin:","px ","px;}div{","}"],.5*x.iI,x.iI,ge.w5),be=u.default.div.withConfig({displayName:"indexstyle__TableHeadStyle",componentId:"sc-16j4vp6-1"})(["display:flex;align-items:center;overflow:hidden;",""],(function(e){return"\n border-bottom: 1px solid ".concat((e.theme||me.Z).borders.medium2,";\n ")})),xe=u.default.div.withConfig({displayName:"indexstyle__TableRowStyle",componentId:"sc-16j4vp6-2"})(["display:flex;align-items:center;"," "," ",""],(function(e){return"\n border-bottom: 1px solid ".concat((e.theme||me.Z).borders.light,";\n\n &:hover {\n cursor: pointer;\n }\n ")}),(function(e){return!e.selected&&"\n &:hover {\n background: ".concat((e.theme.interactive||me.Z.interactive).rowHoverBackground,";\n cursor: pointer;\n }\n ")}),(function(e){return e.selected&&"\n background-color: ".concat((e.theme.interactive||me.Z.interactive).activeBorder,";\n ")})),ye=t(93859),_e=t(53808),Ze=t(69419),Oe=function(e){var n=(0,Ze.iV)(),t=((null===n||void 0===n?void 0:n[I.PIPELINE_SCHEDULE_ID])||[]).join(",");return"".concat(e,"/logs/triggers/").concat(t)},Pe=t(70320),Ie=t(19183);function Se(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function ke(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Se(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Se(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var we="log_uuid";var Ce,Ee,Le,De=function(e){var n=e.autoScrollLogs,t=e.blocksByUUID,r=e.tableInnerRef,i=e.logs,l=e.onRowClick,c=e.pipeline,u=e.query,s=e.saveScrollPosition,d=e.setSelectedLog,p=e.themeContext,f=(0,Pe.qB)(),h=(0,Ie.i)().height,b=(0,a.useRef)(null),y=(0,a.useMemo)((function(){return fe.qL.INTEGRATION===(null===c||void 0===c?void 0:c.type)}),[c.type]),_=(0,he.Z)(i);(0,a.useEffect)((function(){var e;n&&(_||[]).length!==(i||[]).length&&(null===r||void 0===r||null===(e=r.current)||void 0===e||e.scrollIntoView(!1))}),[n,i,_,r]);var Z=(0,a.useMemo)((function(){return Oe(null===c||void 0===c?void 0:c.uuid)}),[null===c||void 0===c?void 0:c.uuid]);(0,a.useEffect)((function(){var e;s&&(null===b||void 0===b||null===(e=b.current)||void 0===e||e.scrollTo((0,_e.U2)(Z,0)))}),[s,Z]);var O=Object.keys(t||{});if(y){var P,I,S=((null===c||void 0===c||null===(P=c.data_integration)||void 0===P||null===(I=P.catalog)||void 0===I?void 0:I.streams)||[]).map((function(e){return e.tap_stream_id})),w=new Set;O.forEach((function(e){S.forEach((function(n){return w.add("".concat(e,":").concat(n,":0"))}))})),O=Array.from(w)}var D=(0,a.useMemo)((function(){var e=null===i||void 0===i?void 0:i.map((function(e){var n;return null===(n=e.name.split(".log")[0])||void 0===n?void 0:n.length})),n=Math.max.apply(Math,(0,ce.Z)(e));return Math.min(n*ye.r+12+8,50*x.iI)}),[i]),T=[{uuid:"_",width:28},{uuid:"Date",width:f?202:214},{uuid:"Block",width:D+16},{uuid:"Message"},{uuid:"_"}],A=(0,a.useCallback)((function(e){var n,t=e.data,r=e.index,i=e.style,c=t.blocksByUUID,s=t.logs,a=t.themeContext,p=s[r],h=p.content,b=p.data,_=p.name,Z=b||{},O=Z.block_uuid,P=Z.level,I=Z.message,S=Z.pipeline_uuid,w=Z.timestamp,T=Z.uuid,A=null==I?h:I;Array.isArray(A)?A=A.join(" "):"object"===typeof A&&(A=JSON.stringify(A));var N,B,M=O||_.split(".log")[0],W=M,J=W.split(":");y&&(W=J[0],N=J[1],B=J[2]);var Y=c[W];if(Y||(Y=c[J[0]]),Y){var H=(0,C.qn)(Y.type,{blockColor:Y.color,theme:a}).accent;n=(0,L.jsx)(m.ZP,{alignItems:"center",children:(0,L.jsx)(de(),{as:"/pipelines/".concat(S,"/edit?block_uuid=").concat(W),href:"/pipelines/[pipeline]/edit",passHref:!0,children:(0,L.jsxs)(U.Z,{block:!0,fullWidth:!0,sameColorAsText:!0,verticalAlignContent:!0,children:[(0,L.jsx)(v.Z,{color:H,size:1.5*x.iI,square:!0}),(0,L.jsx)(g.Z,{mr:1}),(0,L.jsxs)(j.ZP,{disableWordBreak:!0,monospace:!0,noWrapping:!0,title:O,width:D-16,children:[M,N&&":",N&&(0,L.jsx)(j.ZP,{default:!0,inline:!0,monospace:!0,children:N}),B>=0&&":",B>=0&&(0,L.jsx)(j.ZP,{default:!0,inline:!0,monospace:!0,children:B})]})]})})})}return(0,L.jsxs)(xe,{className:"table_row",onClick:function(){var e,n,t=s[r],i=null===(e=t.data)||void 0===e?void 0:e.uuid;u.log_uuid===i&&(i=null),null!==(n=t.data)&&void 0!==n&&n.error?null===l||void 0===l||l(oe):null===l||void 0===l||l(ie),(0,E.u)((0,o.Z)({},we,i)),d(i?t:null)},selected:(null===u||void 0===u?void 0:u.log_uuid)&&(null===u||void 0===u?void 0:u.log_uuid)===T,style:ke({},i),children:[(0,L.jsx)(R.Z,{alignItems:"center",justifyContent:"center",children:(0,L.jsx)(k,ke({},(0,o.Z)({},null===P||void 0===P?void 0:P.toLowerCase(),!0)))},"log_type"),(0,L.jsx)(R.Z,{children:(0,L.jsx)(j.ZP,{default:!0,monospace:!0,noWrapping:!0,small:f,children:X(w,{localTimezone:f})},"log_timestamp")}),(0,L.jsx)(R.Z,{style:{minWidth:D,width:D},children:n}),(0,L.jsx)(R.Z,{style:{overflow:"auto"},children:(0,L.jsx)(j.ZP,{monospace:!0,textOverflow:!0,title:A,children:(0,L.jsx)(se(),{children:A})},"log_message")}),(0,L.jsx)(R.Z,{flex:"1",justifyContent:"flex-end",children:(0,L.jsx)(F.ChevronRight,{default:!0,size:2*x.iI})},"chevron_right_icon")]})}),[D,f,y,l,u,d]);return(0,L.jsxs)(je,{children:[(0,L.jsx)(be,{children:T.map((function(e,n){return(0,L.jsx)(R.Z,{alignItems:"center",style:{height:4*x.iI,minWidth:e.width||null,width:e.width||null},children:"_"!==e.uuid&&(0,L.jsx)(j.ZP,{bold:!0,leftAligned:!0,monospace:!0,muted:!0,children:e.uuid})},"".concat(e,"_").concat(n))}))}),(0,L.jsx)(pe.t7,{height:h-ve.Mz-86-34-58,innerRef:r,itemCount:i.length,itemData:{blocksByUUID:t,logs:i,pipeline:c,themeContext:p},itemSize:3.75*x.iI,onScroll:function(e){var n=e.scrollOffset,t=e.scrollDirection;!s||"forward"===t&&0===n||(0,_e.t8)(Z,n)},ref:b,width:"100%",children:A})]})},Te=t(34376),Ae=t(14805),Re=t(50724),Ne=t(44085),Be=t(17488),Me=20,Ue=[_.LAST_HOUR,_.LAST_DAY,_.LAST_WEEK,_.LAST_30_DAYS],We=(Ce={},(0,o.Z)(Ce,_.LAST_HOUR,3600),(0,o.Z)(Ce,_.LAST_DAY,86400),(0,o.Z)(Ce,_.LAST_WEEK,604800),(0,o.Z)(Ce,_.LAST_30_DAYS,2592e3),Ce),Je=t(11498),Ye=t(48277),Fe=t(3917);function He(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function Ge(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?He(Object(t),!0).forEach((function(n){(0,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}!function(e){e.START="start_timestamp",e.END="end_timestamp"}(Le||(Le={}));var qe=(Ee={},(0,o.Z)(Ee,Je.$D.LIMIT,Me),(0,o.Z)(Ee,Je.$D.OFFSET,0),Ee),ze={blackBorder:!0,inline:!0,paddingBottom:.75*x.iI,paddingTop:.75*x.iI};var Ke=function(e){var n=e.allPastLogsLoaded,t=e.loadNewerLogInterval,r=e.loadPastLogInterval,i=e.saveScrollPosition,l=e.selectedRange,c=e.setSelectedRange,u=(0,a.useState)(null),s=u[0],d=u[1],p=(0,a.useState)(null),h=p[0],v=p[1],b=(0,a.useState)({hour:"00",minute:"00"}),y=b[0],Z=b[1],O=(0,a.useState)(new Date),P=O[0],I=O[1],S=(0,a.useState)({hour:(0,Fe.lJ)(String((new Date).getUTCHours())),minute:(0,Fe.lJ)(String((new Date).getUTCMinutes()))}),k=S[0],w=S[1],C=(0,Te.useRouter)().query.pipeline,D=(0,Ze.iV)(),T=(0,he.Z)(D);(0,a.useEffect)((function(){if(!(0,Q.Xy)(D,T)){var e=D.start_timestamp,n=D.end_timestamp;if(e){var t=(0,Fe.Pc)(e),r=t.date,i=t.hour,o=t.minute;v(r),Z({hour:(0,Fe.lJ)(i),minute:(0,Fe.lJ)(o)});var l=Math.ceil(Date.now()/1e3)-e;Math.abs(l-We[_.LAST_DAY])<=60&&c(_.LAST_DAY)}if(n){var u=(0,Fe.Pc)(n),s=u.date,a=u.hour,d=u.minute;I(s),w({hour:(0,Fe.lJ)(a),minute:(0,Fe.lJ)(d)})}}}),[D,T]);var A=(0,a.useCallback)((function(){if(i){var e=Oe(C);(0,_e.t8)(e,0)}}),[C,i]);return(0,L.jsx)(g.Z,{py:1,children:(0,L.jsxs)(m.ZP,{alignItems:"center",children:[(0,L.jsx)(N.ZP,Ge(Ge({},ze),{},{disabled:n,onClick:function(){A(),r()},uuid:"logs/load_older_logs",children:n?"All past logs within range loaded":"Load older logs"})),(0,L.jsx)(g.Z,{mr:1}),(0,L.jsx)(N.ZP,Ge(Ge({},ze),{},{disabled:(null===D||void 0===D?void 0:D._offset)<=0,onClick:function(){A(),t()},uuid:"logs/load_newer_logs",children:"Load newer logs"})),(0,L.jsx)(g.Z,{mr:2}),(0,L.jsx)(Ne.Z,{compact:!0,defaultColor:!0,onChange:function(e){e.preventDefault();var n=e.target.value;if(A(),c(n),Ue.includes(n)){var t,r=(0,Ye.JI)(We[n]);(0,E.u)(Ge((t={},(0,o.Z)(t,Le.START,r),(0,o.Z)(t,Le.END,null),t),qe))}},paddingRight:4*x.iI,placeholder:"Select time range",value:l,children:Object.values(_).map((function(e){return(0,L.jsx)("option",{value:e,children:e},e)}))}),(0,L.jsx)(g.Z,{mr:1}),l===_.CUSTOM_RANGE&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Be.Z,{compact:!0,defaultColor:!0,onClick:function(){return d(0)},paddingRight:0,placeholder:"Start",value:h?(0,Fe.AY)(h,null===y||void 0===y?void 0:y.hour,null===y||void 0===y?void 0:y.minute):""}),(0,L.jsx)(Re.Z,{onClickOutside:function(){return d(null)},open:0===s,style:{position:"relative"},children:(0,L.jsx)(Ae.Z,{selectedDate:h,selectedTime:y,setSelectedDate:v,setSelectedTime:Z})}),(0,L.jsx)(g.Z,{px:1,children:(0,L.jsx)(j.ZP,{children:"to"})}),(0,L.jsx)(Be.Z,{compact:!0,defaultColor:!0,onClick:function(){return d(1)},paddingRight:0,placeholder:"End",value:P?(0,Fe.AY)(P,null===k||void 0===k?void 0:k.hour,null===k||void 0===k?void 0:k.minute):""}),(0,L.jsx)(Re.Z,{onClickOutside:function(){return d(null)},open:1===s,style:{position:"relative"},children:(0,L.jsx)(Ae.Z,{selectedDate:P,selectedTime:k,setSelectedDate:I,setSelectedTime:w})}),(0,L.jsx)(g.Z,{mr:1}),(0,L.jsx)(f.ZP,{borderRadius:"".concat(x.iI/2,"px"),onClick:function(){var e;A();var n=(0,Fe.BP)(h,y.hour,y.minute),t=(0,Fe.BP)(P,k.hour,k.minute);(0,E.u)(Ge((e={},(0,o.Z)(e,Le.START,(0,Fe.A5)(n)),(0,o.Z)(e,Le.END,(0,Fe.A5)(t)),e),qe))},padding:"".concat(x.iI/2,"px"),primary:!0,children:"Search"})]})]})})},$e=t(75457),Ve=t(93808),Xe=t(4190),Qe=t(69650),en=t(35686),nn=t(78419),tn=t(28795);function rn(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function on(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?rn(Object(t),!0).forEach((function(n){(0,o.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):rn(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ln="pipeline_run_id[]",cn="block_run_id[]";function un(e){var n=e.pipeline,t=(0,a.useContext)(u.ThemeContext),r=(0,a.useRef)(null),i=n.uuid,l=(0,a.useState)(null),c=l[0],f=l[1],h=(0,a.useState)(null),v=h[0],b=h[1],y=(0,a.useState)(null),Z=y[0],O=y[1],P=(0,a.useState)(null),S=P[0],k=P[1],C=(0,a.useState)(ie),D=C[0],T=C[1],B=(0,a.useState)((0,_e.U2)(nn.Tz,!0)),M=B[0],U=B[1],W=en.ZP.pipelines.detail(i,{includes_content:!1,includes_outputs:!1},{revalidateOnFocus:!1}).data,J=(0,a.useMemo)((function(){return on(on({},null===W||void 0===W?void 0:W.pipeline),{},{uuid:i})}),[W,i]),Y=(null===J||void 0===J?void 0:J.type)===fe.qL.INTEGRATION,F=(0,a.useMemo)((function(){return J.blocks||[]}),[J]),H=(0,a.useMemo)((function(){var e=(0,ee.HK)(F,(function(e){return e.uuid}));if(Y){var n,t=(0,ee.sE)(F,(function(e){var n=e.type;return d.tf.DATA_LOADER===n})),r=t?(0,s.Qc)(t.content):{},i=((null===r||void 0===r||null===(n=r.catalog)||void 0===n?void 0:n.streams)||[]).reduce((function(e,n){var t=n.tap_stream_id,r={};return F.forEach((function(e){var n=e.uuid,i=e.type,o="".concat(n,":").concat(t);r[o]={type:i}})),on(on({},e),r)}),{});e=on(on({},i),e)}return e}),[F,Y]),G=(0,Ze.iV)(),q=(0,a.useMemo)((function(){return(null===G||void 0===G?void 0:G.hasOwnProperty(I.PIPELINE_SCHEDULE_ID))&&!(null!==G&&void 0!==G&&G.hasOwnProperty(I.LEVEL))&&!(null!==G&&void 0!==G&&G.hasOwnProperty(I.BLOCK_TYPE))&&!(null!==G&&void 0!==G&&G.hasOwnProperty(I.BLOCK_UUID))}),[G]),z=!(null!==G&&void 0!==G&&G.start_timestamp)&&!(null!==G&&void 0!==G&&G.hasOwnProperty(ln)||null!==G&&void 0!==G&&G.hasOwnProperty(cn)),K=(0,Ye.JI)(We[_.LAST_DAY]),$=en.ZP.logs.pipelines.list(c?i:null,(0,Q.gR)(z?on(on({},c),{},{start_timestamp:K}):c,[we]),{refreshInterval:5e3}),X=$.data,ne=$.mutate,te=!X,re=(0,a.useMemo)((function(){var e;if(null!==X&&void 0!==X&&null!==(e=X.logs)&&void 0!==e&&e[0]){var n,t=(null===(n=X.logs)||void 0===n?void 0:n[0])||{};return{blockRunLogs:t.block_run_logs,pipelineRunLogs:t.pipeline_run_logs,totalBlockRunLogCount:t.total_block_run_log_count,totalPipelineRunLogCount:t.total_pipeline_run_log_count}}return{blockRunLogs:[],pipelineRunLogs:[],totalBlockRunLogCount:0,totalPipelineRunLogCount:0}}),[X]),oe=re.blockRunLogs,ce=re.pipelineRunLogs,ue=re.totalBlockRunLogCount,se=re.totalPipelineRunLogCount,ae=+(null===G||void 0===G?void 0:G._limit)>=ue&&+(null===G||void 0===G?void 0:G._limit)>=se,de=(0,a.useMemo)((function(){return(0,ee.YC)(oe.concat(ce).reduce((function(e,n){return e.concat(V(n))}),[]),(function(e){var n=e.data;return(null===n||void 0===n?void 0:n.timestamp)||0}))}),[oe,ce]),pe=(0,a.useMemo)((function(){return de.filter((function(e){var n=e.data,t=[];if(!c)return!0;if(t.push(!(0,Q.Qr)(n)),c["level[]"]&&t.push(c["level[]"].includes(null===n||void 0===n?void 0:n.level)),c["block_type[]"]){var r,i,o=null===n||void 0===n?void 0:n.block_uuid;if(Y)o=null===n||void 0===n||null===(i=n.block_uuid)||void 0===i?void 0:i.split(":").slice(0,2).join(":");t.push(c["block_type[]"].includes(null===(r=H[o])||void 0===r?void 0:r.type))}if(c["pipeline_run_id[]"]){var l=null===n||void 0===n?void 0:n.pipeline_run_id;t.push(c["pipeline_run_id[]"].includes(String(l)))}if(c["block_run_id[]"]){var u=null===n||void 0===n?void 0:n.block_run_id;t.push(c["block_run_id[]"].includes(String(u)))}return t.every((function(e){return e}))}))}),[H,Y,de,c]),ve=pe.length,ge=(0,he.Z)(G);(0,a.useEffect)((function(){var e;z&&(0,E.u)((e={},(0,o.Z)(e,Je.$D.LIMIT,Me),(0,o.Z)(e,Je.$D.OFFSET,0),(0,o.Z)(e,"start_timestamp",K),e))}),[z]),(0,a.useEffect)((function(){(0,Q.Xy)(G,ge)||f(G)}),[G,ge]);var je=(0,he.Z)(v);(0,a.useEffect)((function(){var e=G.log_uuid;!e||v||je||b(de.find((function(n){var t=n.data;return(null===t||void 0===t?void 0:t.uuid)===e})))}),[de,G,v,je]);var be=G._limit,xe=G._offset,ye=+(be||0),Oe=+(xe||0),Pe=Math.max(ue,se),Ie=(0,a.useCallback)((function(){var e,n=ye,t=Oe;(ue>ye||se>ye)&&(n=Math.min(Pe,ye+Me),t=Math.min(Oe+Me,Pe-Pe%Me),(0,E.u)(on(on({},G),{},(e={},(0,o.Z)(e,Je.$D.LIMIT,n),(0,o.Z)(e,Je.$D.OFFSET,t),e))))}),[Pe,ye,Oe,G,ue,se]),Se=(0,a.useCallback)((function(){var e,n=ye,t=Oe;ye>=Me&&(n=Math.max(Me,ye-Me),ye>=Pe&&Pe%Me!==0&&(n=Pe-Pe%Me),t=Math.max(0,Oe-Me),(0,E.u)(on(on({},G),{},(e={},(0,o.Z)(e,Je.$D.LIMIT,n),(0,o.Z)(e,Je.$D.OFFSET,t),e))))}),[Pe,ye,Oe,G]),ke=(0,a.useCallback)((function(){var e=!M;U(e),(0,_e.t8)(nn.Tz,e)}),[M]),Ce=(0,a.useMemo)((function(){return(0,L.jsx)(De,{autoScrollLogs:M,blocksByUUID:H,logs:pe,onRowClick:T,pipeline:J,query:c,saveScrollPosition:q,setSelectedLog:b,tableInnerRef:r,themeContext:t})}),[M,H,pe,J,c,q,t]);return(0,L.jsxs)($e.Z,{after:v&&(0,L.jsx)(le,{log:v,onClose:function(){(0,E.u)((0,o.Z)({},we,null)),b(null)},selectedTab:D,setSelectedTab:T}),afterHidden:!v,afterWidth:80*x.iI,before:(0,L.jsx)(A,{blocks:F,query:c}),beforeWidth:20*x.iI,breadcrumbs:[{label:function(){return"Logs"}}],errors:S,pageName:tn.M.PIPELINE_LOGS,pipeline:J,setErrors:k,subheader:null,title:function(e){var n=e.name;return"".concat(n," logs")},uuid:"pipeline/logs",children:[(0,L.jsx)(g.Z,{px:x.cd,py:1,children:(0,L.jsxs)(j.ZP,{children:[!te&&(0,L.jsxs)(L.Fragment,{children:[(0,w.x6)(ve)," logs found",(0,L.jsx)(Ke,{allPastLogsLoaded:ae,loadNewerLogInterval:Se,loadPastLogInterval:Ie,saveScrollPosition:q,selectedRange:Z,setSelectedRange:O})]}),te&&"Searching..."]})}),(0,L.jsx)(p.Z,{light:!0}),te&&(0,L.jsx)(g.Z,{p:x.cd,children:(0,L.jsx)(Xe.Z,{})}),!te&&pe.length>=1&&Ce,(0,L.jsx)(g.Z,{p:"".concat(1.5*x.iI,"px"),children:(0,L.jsxs)(m.ZP,{alignItems:"center",children:[(0,L.jsx)(N.ZP,on(on({},ze),{},{onClick:function(){"0"===(null===G||void 0===G?void 0:G._offset)&&(null===G||void 0===G?void 0:G._limit)===String(Me)?ne(null):(0,E.u)({_limit:Me,_offset:0})},uuid:"logs/toolbar/load_newest",children:"Load latest logs"})),(0,L.jsx)(g.Z,{mr:1}),(0,L.jsx)(N.ZP,on(on({},ze),{},{backgroundColor:me.Z.background.page,onClick:function(){var e;null===r||void 0===r||null===(e=r.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})},uuid:"logs/toolbar/scroll_to_bottomt",children:"Scroll to bottom"})),(0,L.jsx)(g.Z,{mr:1}),(0,L.jsxs)(R.Z,{children:[(0,L.jsx)(j.ZP,{noWrapping:!0,children:"Auto-scroll to new logs"}),(0,L.jsx)(g.Z,{mr:1}),(0,L.jsx)(Qe.Z,{checked:M,compact:!0,onCheck:ke})]})]})})]})}un.getInitialProps=function(){var e=(0,i.Z)(c().mark((function e(n){var t;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.query.pipeline,e.abrupt("return",{pipeline:{uuid:t}});case 2:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();var sn=(0,Ve.Z)(un)},48277:function(e,n,t){"use strict";t.d(n,{$P:function(){return s},JI:function(){return o},VJ:function(){return u},fD:function(){return l},uf:function(){return i},vN:function(){return c}});var r=t(75582),i=function(e){var n=String(e).split("."),t=(0,r.Z)(n,2),i=t[0],o=t[1];return"".concat(i.replace(/\B(?=(\d{3})+(?!\d))/g,",")).concat(o?".".concat(o):"")};function o(e){var n=Math.floor(Date.now()/1e3);return e>0?n-e:n}function l(e){return(e>>>0).toString(2)}function c(e,n){return String(BigInt(e)+BigInt(n))}function u(e,n){return String(BigInt(e)-BigInt(n))}function s(e){return parseInt(e,2)}},62453:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/pipelines/[pipeline]/logs",function(){return t(59860)}])}},function(e){e.O(0,[7674,1557,3782,9774,2888,179],(function(){return n=62453,e(e.s=n);var n}));var n=e.O();_N_E=n}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4249],{16488:function(e,n,r){"use strict";r.d(n,{IJ:function(){return h},M8:function(){return P},Uc:function(){return j},XM:function(){return Z},_U:function(){return v},eI:function(){return b},gU:function(){return y},lO:function(){return S},ri:function(){return m},tL:function(){return w},vJ:function(){return O},xH:function(){return x}});var t,i=r(82394),o=r(92083),l=r.n(o),u=r(3917),c=r(4383),a=r(30229),d=r(42122),s=r(86735);function p(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),r.push.apply(r,t)}return r}function f(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?p(Object(r),!0).forEach((function(n){(0,i.Z)(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}var v=function(e){return!!e&&!Object.values(a.U5).includes(e)};function h(e){return null===e||void 0===e?void 0:e.reduce((function(e,n){var r=n.block_uuid,t=n.completed_at,o=n.started_at,u=n.status,c=null;o&&t&&(c=l()(t).valueOf()-l()(o).valueOf());return f(f({},e),{},(0,i.Z)({},r,{runtime:c,status:u}))}),{})}var g,m=function(e){var n=[{description:function(){return"This pipeline will run continuously on an interval or just once."},label:function(){return"Schedule"},uuid:a.Xm.TIME},{description:function(){return"This pipeline will run when a specific event occurs."},label:function(){return"Event"},uuid:a.Xm.EVENT},{description:function(){return"Run this pipeline when you make an API call."},label:function(){return"API"},uuid:a.Xm.API}];return e?n.slice(0,1):n};function x(e){var n=(0,d.gR)(e,[a.gm.INTERVAL,a.gm.TYPE]),r=e[a.gm.INTERVAL];r&&(n["schedule_interval[]"]=encodeURIComponent(r));var t=e[a.gm.TYPE];return t&&(n["schedule_type[]"]=t),n}function b(e){return e?new Date(l()(e).valueOf()):null}function j(e,n){return n?(0,u.XG)(e,n):function(e){if("string"!==typeof e)return e;var n=e.split("+")[0];return l()(b(n)).format(u.Nx)}(e)}!function(e){e.DAY="day",e.HOUR="hour",e.MINUTE="minute",e.SECOND="second"}(g||(g={}));var w=(t={},(0,i.Z)(t,g.DAY,86400),(0,i.Z)(t,g.HOUR,3600),(0,i.Z)(t,g.MINUTE,60),(0,i.Z)(t,g.SECOND,1),t);function y(e){var n=g.SECOND,r=e;return e%86400===0?(r/=86400,n=g.DAY):e%3600===0?(r/=3600,n=g.HOUR):e%60===0&&(r/=60,n=g.MINUTE),{time:r,unit:n}}function O(e,n){return e*w[n]}function Z(e,n,r){var t,i=l()(e);return i.set("hour",+(null===n||void 0===n?void 0:n.hour)||0),i.set("minute",+(null===n||void 0===n?void 0:n.minute)||0),i.set("second",0),t=i.format(u.TD),null!==r&&void 0!==r&&r.includeSeconds&&(t=t.concat(":00")),null!==r&&void 0!==r&&r.localTimezone&&(t=i.format(u.lE),null!==r&&void 0!==r&&r.convertToUtc&&(t=(0,u.d$)(t,{includeSeconds:null===r||void 0===r?void 0:r.includeSeconds,utcFormat:!0}))),t}function P(e){var n,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],t="",i=!0;return i&&(r?t="".concat(window.origin,"/api/pipeline_schedules/").concat(null===e||void 0===e?void 0:e.id,"/api_trigger"):(t="".concat(window.origin,"/api/pipeline_schedules/").concat(null===e||void 0===e?void 0:e.id,"/pipeline_runs"),null!==e&&void 0!==e&&e.token&&(t="".concat(t,"/").concat(e.token)))),i&&(n=window.location.port)&&(t=t.replace(n,c.QT)),t}function _(e,n,r){return e.match(/[*,-/]/)?{additionalOffset:0,cronValue:e}:function(e,n,r){var t=r.indexOf(e),i=0;if(n<0)for(var o=0;o>n;o--)0===t?(t=r.length-1,i-=1):t-=1;else if(n>0)for(var l=0;l<n;l++)t===r.length-1?(t=0,i+=1):t+=1;var u="number"===typeof r[t]?r[t]:e;return{additionalOffset:i,cronValue:String(u)}}(+e,n,r)}var I=(0,s.m5)(60),k=(0,s.m5)(24),C=(0,u.Cs)();function S(e,n){if(!e)return e;var r=l()().local().format("Z"),t=r.split(":"),i="-"===r[0],o=3===t[0].length?Number(t[0].slice(1)):Number(t[0]),u=Number(t[1]);(i&&!n||!i&&n)&&(o=-o,u=-u);var c=e.split(" "),a=c[0],d=c[1],s=c[2],p=_(a,u,I),f=_(d,o+p.additionalOffset,k);if(c[0]=p.cronValue,c[1]=f.cronValue,0!==(null===f||void 0===f?void 0:f.additionalOffset)){var v=_(s,f.additionalOffset,C);c[2]=v.cronValue}return c.join(" ")}},38415:function(e,n,r){"use strict";r.r(n),r.d(n,{default:function(){return Ce}});var t=r(77837),i=r(75582),o=r(82394),l=r(38860),u=r.n(l),c=r(12691),a=r.n(c),d=r(82684),s=r(69864),p=r(34376),f=r(24138),v=r(15338),h=r(68562),g=r(48670),m=r(55072),x=r(75457),b=r(30229),j=r(93808),w=r(82359),y=r(71610),O=r(71180),Z=r(90299),P=r(55485),_=r(85854),I=r(37899),k=r(65956),C=r(38276),S=r(30160),E=r(44897),T=r(70515),M={uuid:"RUNTIME VARIABLES"},R={uuid:"BOOKMARK VALUES"},N=r(32080),B=r(8916),D=r(81728),A=r(28598);function V(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),r.push.apply(r,t)}return r}function U(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?V(Object(r),!0).forEach((function(n){(0,o.Z)(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):V(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}var F="".concat(T.iI,"px ").concat(3*T.iI,"px");var H=function(e){var n=e.initialPipelineSchedulePayload,r=e.onCancel,t=e.onSuccess,i=e.pipeline,l=e.variables,u=(0,d.useState)(null),c=u[0],a=u[1],s=(0,d.useState)(!0),p=s[0],f=s[1],h=(0,d.useState)(l||{}),g=h[0],m=h[1],x=(0,d.useState)(null),j=x[0],w=x[1],V=(0,d.useMemo)((function(){return U(U({},n),{},{name:(0,D.Y6)(),variables:p?(0,B.e7)(U(U({},g),c?(0,o.Z)({},b.PN,c):{})):null})}),[c,n,p,g]),H=(0,d.useMemo)((function(){return null!==i&&void 0!==i&&i.blocks?(0,N.n)(i):null}),[i]),G=(0,d.useMemo)((function(){var e;return H&&(null===(e=Object.keys(H||{}))||void 0===e?void 0:e.length)>=1?[M,R]:null}),[H]);(0,d.useEffect)((function(){(null===G||void 0===G?void 0:G.length)>=1&&!j&&w(null===G||void 0===G?void 0:G[0])}),[j,w,G]);var L=(0,d.useMemo)((function(){return null!==G&&void 0!==G&&G.length?(0,A.jsx)(Z.Z,{onClickTab:function(e){w(e)},selectedTabUUID:null===j||void 0===j?void 0:j.uuid,tabs:G,underlineStyle:!0}):null}),[j,w,G]);return(0,A.jsxs)(k.Z,{noPadding:!0,footer:(0,A.jsxs)(P.ZP,{alignItems:"center",fullWidth:!0,justifyContent:"flex-end",children:[(0,A.jsx)(O.ZP,{onClick:function(){t({pipeline_schedule:V}),r()},padding:F,primaryAlternate:!0,children:"Run now"}),(0,A.jsx)(C.Z,{mr:1}),(0,A.jsx)(O.ZP,{borderColor:E.Z.background.page,onClick:r,padding:F,secondary:!0,children:"Cancel"})]}),header:(0,A.jsx)(_.Z,{level:5,children:"Run pipeline now"}),maxHeight:"90vh",minWidth:85*T.iI,subtitle:(0,A.jsxs)(A.Fragment,{children:[!(null!==G&&void 0!==G&&G.length)&&(0,A.jsx)(C.Z,{p:T.cd,children:(0,A.jsx)(S.ZP,{default:!0,children:"Creates a new trigger and immediately runs the current pipeline once."})}),(null===G||void 0===G?void 0:G.length)>=1&&L,(0,A.jsx)(v.Z,{light:!0})]}),children:[(!(null!==G&&void 0!==G&&G.length)||M.uuid===(null===j||void 0===j?void 0:j.uuid))&&(0,A.jsxs)(A.Fragment,{children:[(null===G||void 0===G?void 0:G.length)>=1&&(0,A.jsx)(C.Z,{p:T.cd,children:(0,A.jsx)(S.ZP,{default:!0,children:"Creates a new trigger and immediately runs the current pipeline once."})}),(0,A.jsx)(I.Z,{enableVariablesOverwrite:p,originalVariables:l,runtimeVariables:g,setEnableVariablesOverwrite:f,setRuntimeVariables:m})]}),R.uuid===(null===j||void 0===j?void 0:j.uuid)&&(0,A.jsx)(y.Z,{bookmarkValues:c,pipeline:i,setBookmarkValues:a})]})},G=r(97618),L=r(72473),Y=r(25976),X=r(42631),z=r(47041),q=r(91437),Q=Y.default.div.withConfig({displayName:"indexstyle__TableStyle",componentId:"sc-pu8csx-0"})([""," overflow-y:auto;position:relative;width:100%;z-index:3;border-radius:","px;"," "," "," ",""],z.w5,X.n_,(function(e){return"\n background-color: ".concat((e.theme.background||E.Z.background).page,";\n ")}),(function(e){return e.height&&"\n height: ".concat(e.height,"px;\n ")}),(function(e){return e.flex&&"\n flex: 1;\n "}),(function(e){return(e.noBorder||e.noBorderRadius)&&"\n border-radius: 0;\n "})),W=Y.default.div.withConfig({displayName:"indexstyle__ColumnHeaderRowStyle",componentId:"sc-pu8csx-1"})(["border-top-left-radius:","px;border-top-right-radius:","px;position:sticky;top:0;width:100%;z-index:2;"," "," ",""],X.n_,X.n_,(function(e){return"\n background-color: ".concat((e.theme.background||E.Z.background).panel,";\n ")}),(function(e){return!e.noBorder&&"\n border: 1px solid ".concat((e.theme.interactive||E.Z.interactive).defaultBorder,";\n ")}),(function(e){return(e.noBorder||e.noBorderRadius)&&"\n border-radius: 0;\n "})),J=Y.default.div.withConfig({displayName:"indexstyle__ColumnHeaderCellStyle",componentId:"sc-pu8csx-2"})([""," ",""],(function(e){return!e.small&&"\n padding: ".concat(1.5*T.iI,"px;\n ")}),(function(e){return e.small&&"\n padding: ".concat(1.5*T.iI,"px;\n ")})),K=Y.default.div.withConfig({displayName:"indexstyle__RowTitleStyle",componentId:"sc-pu8csx-3"})([""," "," ",""],(function(e){return"\n background-color: ".concat((e.theme.background||E.Z.background).header,";\n border: 1px solid ").concat((e.theme.interative||E.Z.interactive).defaultBorder,";\n ")}),(function(e){return!e.small&&"\n padding: ".concat(1.5*T.iI,"px;\n ")}),(function(e){return e.small&&"\n padding: ".concat(1.5*T.iI,"px;\n ")})),$=Y.default.div.withConfig({displayName:"indexstyle__RowStyle",componentId:"sc-pu8csx-4"})([""," "," "," ",""],(0,q.eR)(),(function(e){return"\n background-color: ".concat((e.theme.background||E.Z.background).page,";\n border-top: none;\n border-bottom: none;\n ")}),(function(e){return!e.noBorder&&"\n border-bottom: 1px solid ".concat((e.theme.interactive||E.Z.interactive).defaultBorder,";\n border-left: 1px solid ").concat((e.theme.interactive||E.Z.interactive).defaultBorder,";\n border-right: 1px solid ").concat((e.theme.interactive||E.Z.interactive).defaultBorder,";\n ")}),(function(e){return e.finalRow&&!e.noBorderRadius&&"\n border-bottom-left-radius: ".concat(X.n_,"px;\n border-bottom-right-radius: ").concat(X.n_,"px;\n ")})),ee=Y.default.div.withConfig({displayName:"indexstyle__TextStyle",componentId:"sc-pu8csx-5"})(["p{cursor:pointer;}"]),ne=Y.default.div.withConfig({displayName:"indexstyle__RowCellStyle",componentId:"sc-pu8csx-6"})(["width:100%;z-index:0;"," "," "," "," ",""],(function(e){return!e.first&&"\n border-left: 1px solid ".concat((e.theme.background||E.Z.background).page,";\n ")}),(function(e){return!e.small&&"\n padding: ".concat(1.5*T.iI,"px;\n ")}),(function(e){return e.small&&"\n padding: ".concat(1.5*T.iI,"px;\n ")}),(function(e){return e.textColor&&"\n & p {\n color: ".concat(e.textColor,";\n }\n ")}),(function(e){return e.vanish&&"\n border: none;\n padding: 0 !important;\n width: 0% !important;\n height: 100% !important;\n background-color: ".concat((e.theme.background||E.Z.background).page," !important;\n ")})),re=r(35185);var te=function(e){var n,r=e.cellIndex,t=e.danger,i=e.flex,o=e.render,l=e.rowGroupIndex,u=e.rowIndex,c=e.selected,a=e.small,s=e.showBackground,p=e.showProgress,f=e.textColor,v=e.value,h=e.vanish,m=(0,d.useState)(!1),x=m[0],b=m[1],j=Array.isArray(v);return n=o?o(v):"function"===typeof v?v({selected:c}):j?(0,A.jsxs)(G.Z,{alignItems:"start",flexDirection:"row",justifyContent:"space-between",children:[(0,A.jsxs)(S.ZP,{small:a,textOverflow:!0,title:v[0],children:[x&&(0,A.jsx)(A.Fragment,{children:"".concat(v[0]," & ").concat(v.length-1," more")}),!x&&(0,A.jsx)(A.Fragment,{children:v.map((function(e){return(0,A.jsx)("div",{children:e},e)}))})]}),(0,A.jsxs)(g.Z,{onClick:function(){return b(!x)},children:[x&&(0,A.jsx)(L.ArrowDown,{muted:!0,size:2*T.iI}),!x&&(0,A.jsx)(L.ArrowRight,{muted:!0,size:2*T.iI})]})]}):p?(0,A.jsx)(P.ZP,{alignItems:"center",fullHeight:!0,fullWidth:!0,children:(0,A.jsx)(re.Z,{danger:v<80,progress:v})}):(0,A.jsx)(S.ZP,{bold:t,danger:t,small:a,textOverflow:!0,title:v,children:v}),(0,A.jsx)(G.Z,{flex:i,textOverflow:!0,children:(0,A.jsx)(ne,{first:0===r,showBackground:s,small:a,textColor:f,vanish:h,children:!h&&(0,A.jsxs)(A.Fragment,{children:[n," "]})})},"cell-".concat(l,"-").concat(u,"-").concat(r,"-").concat(v))};var ie=function(e){var n=e.columnFlexNumbers,r=e.columnHeaders,t=e.height,i=e.isTextSelectionRequired,o=e.noBorder,l=e.noBorderRadius,u=e.onClickRow,c=e.onHoverRow,a=e.renderRowCellByIndex,s=e.rowGroupData,p=void 0===s?[]:s,f=e.selectedRowIndexes,v=e.small,h=e.flex,m=e.warnings,x=void 0===m?[]:m,b=(0,d.useMemo)((function(){return p.length}),[p]);return(0,A.jsxs)(Q,{flex:h,height:t,noBorder:o,noBorderRadius:l,noScrollbarTrackBackground:!0,children:[(0,A.jsx)(W,{noBorder:o,noBorderRadius:l,children:(0,A.jsx)(P.ZP,{alignItems:"center",children:r.map((function(e,r){var t=e.Icon,i=e.label;return(0,A.jsx)(G.Z,{flex:n[r],children:(0,A.jsx)(J,{first:0===r,small:v,children:(0,A.jsxs)(P.ZP,{alignItems:"center",children:[t&&(0,A.jsx)(L.Check,{}),t&&(0,A.jsx)(C.Z,{mr:1}),(0,A.jsx)(S.ZP,{bold:!0,children:i})]})})},i)}))})}),p&&p.map((function(e,r){var t,d=e.title,s=e.rowData,p=d||r,h=[];d&&(t=(0,A.jsx)(K,{small:v,children:(0,A.jsx)(S.ZP,{bold:!0,children:d})}));var m=null===s||void 0===s?void 0:s.length;return null===s||void 0===s||s.forEach((function(e,t){var d=e.columnTextColors,s=e.columnValues,j=e.danger,w=e.uuid,y=(null===f||void 0===f?void 0:f[0])===r&&(null===f||void 0===f?void 0:f[1])===t,O=[],Z=x.find((function(e){return e.name===s[0]})),_=Z&&(0,D.HD)(s[1])?(0,D.Tz)(s[1]):s[1],I=Z&&Z.compare(_,Z.val);null===s||void 0===s||s.forEach((function(e,i,o){var l=null===a||void 0===a?void 0:a[i],u=d?d[i]:void 0;Array.isArray(e)?O.push((0,A.jsx)(te,{cellIndex:i,flex:n[i],render:l,rowGroupIndex:r,rowIndex:t,selected:y,showBackground:t%2===1,showProgress:e[0],small:v,textColor:u,value:e[1]},i)):"undefined"===typeof e?(O.pop(),i=o.length+1,O.push((0,A.jsx)(te,{cellIndex:i,danger:j,flex:n[i],render:l,rowGroupIndex:r,rowIndex:t,selected:y,showBackground:t%2===1,small:v,textColor:u,value:e,vanish:!0},i))):O.push((0,A.jsx)(te,{cellIndex:i,danger:I||j,flex:n[i],render:l,rowGroupIndex:r,rowIndex:t,selected:y,showBackground:t%2===1,small:v,textColor:u,value:e},i))}));var k=(0,A.jsx)(P.ZP,{textOverflow:!0,children:O});h.push((0,A.jsxs)($,{finalRow:b-1===r&&m-1===t,hasHover:!!c,noBorder:o,noBorderRadius:l,onMouseEnter:function(){return null===c||void 0===c?void 0:c({rowGroupIndex:r,rowIndex:t,uuid:w})},selected:y,children:[u&&(i?(0,A.jsx)(ee,{onClick:function(){return u({rowGroupIndex:r,rowIndex:t,uuid:w})},role:"cell",children:k}):(0,A.jsx)(g.Z,{block:!0,noHoverUnderline:!0,noOutline:!0,onClick:function(){return u({rowGroupIndex:r,rowIndex:t,uuid:w})},preventDefault:!0,children:k})),!u&&k]},"row-group-".concat(p,"-row-").concat(t)))})),(0,A.jsxs)("div",{children:[t,h]},p)}))]})},oe=Y.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-1xgfh62-0"})(["display:flex;flex-direction:column;height:","px;border-bottom:1px solid ",";"," ",""],(function(e){return e.height}),E.Z.borders.medium,(function(e){return e.includePadding&&"\n padding: ".concat(T.tr,"px;\n ")}),(function(e){return e.overflow&&"\n overflow: auto;\n "})),le=r(79633);var ue=function(e){var n=e.height,r=e.scheduleType,t=e.variables,o=e.variablesOverride,l=[];Object.entries(t).forEach((function(e){var n=(0,i.Z)(e,2),r=n[0],t=n[1],u=null===o||void 0===o?void 0:o[r];l.push({uuid:r,value:(0,B.FS)(u||t)})})),(0,B.JZ)(l,r);var u=Object.keys(t).length;return(0,A.jsx)(oe,{height:n,children:t&&(0,A.jsx)(ie,{columnFlexNumbers:[1,1],columnHeaders:[{label:"Runtime variable (".concat(u,")")},{label:"Value"}],noBorderRadius:!0,rowGroupData:[{rowData:l.map((function(e){var n=e.uuid,r=e.value;return{columnTextColors:[le.Or,void 0],columnValues:[n,r],uuid:n}}))}],small:!0})})},ce=r(4190),ae=r(12717),de=r(85544),se=r(29624),pe=r(35686),fe=r(72191),ve=r(28795),he=r(81066),ge=r(24944),me=r(3917),xe=r(69419),be=r(16488),je=r(86735),we=r(42122),ye=r(50178),Oe=r(72619),Ze=r(70320),Pe=r(89538);function _e(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),r.push.apply(r,t)}return r}function Ie(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?_e(Object(r),!0).forEach((function(n){(0,o.Z)(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_e(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}function ke(e){var n=e.pipeline,r=(0,p.useRouter)(),t=(0,ye.Ct)(),l=n.uuid,u=pe.ZP.pipelines.detail(l,{includes_outputs:!1},{revalidateOnFocus:!1}).data,c=(0,d.useMemo)((function(){return(null===u||void 0===u?void 0:u.pipeline)||n}),[null===u||void 0===u?void 0:u.pipeline,n]),j=(0,d.useState)(null),y=j[0],O=j[1],Z=(0,d.useState)(null),P=Z[0],_=Z[1],I=(0,d.useState)(!1),k=I[0],E=I[1],T=pe.ZP.projects.list().data,M=(0,d.useMemo)((function(){var e;return null===T||void 0===T||null===(e=T.projects)||void 0===e?void 0:e[0]}),[T]),R=((0,d.useMemo)((function(){var e;return(0,Ze.hY)(null===M||void 0===M||null===(e=M.features)||void 0===e?void 0:e[w.d.LOCAL_TIMEZONE])}),[null===M||void 0===M?void 0:M.features]),pe.ZP.client_pages.detail("pipeline_schedule:create",{"pipelines[]":[l]},{},{key:"Triggers/Edit/".concat(l)}).data),N=(0,d.useMemo)((function(){return null===R||void 0===R?void 0:R.client_page}),[R]),V=(0,d.useMemo)((function(){var e,n;return null===N||void 0===N||null===(e=N.components)||void 0===e||null===(n=e.find((function(e){return"create_with_interactions_component"===e.uuid})))||void 0===n?void 0:n.enabled}),[N]),U=(0,d.useMemo)((function(){return null===N||void 0===N?void 0:N.disabled}),[N]),F=pe.ZP.variables.pipelines.list(l,{global_only:!0},{revalidateOnFocus:!1}).data,G=null===F||void 0===F?void 0:F.variables,Y=(0,xe.iV)(),X=(0,xe.DQ)(Y,[b.gm.INTERVAL,b.gm.STATUS,b.gm.TAG,b.gm.TYPE]),z=(0,be.xH)(X),q=null!==Y&&void 0!==Y&&Y.page?Y.page:0,Q=pe.ZP.pipeline_schedules.pipelines.list(l,Ie(Ie({},z),{},{_limit:m.Q,_offset:(null!==Y&&void 0!==Y&&Y.page?Y.page:0)*m.Q}),{refreshInterval:7500}),W=Q.data,J=Q.mutate,K=(0,d.useMemo)((function(){return(null===W||void 0===W?void 0:W.pipeline_schedules)||[]}),[W]),$=function(e){return(0,s.Db)(pe.ZP.pipeline_schedules.pipelines.useCreate(l),{onSuccess:function(n){return(0,Oe.wD)(n,{callback:function(n){var r=n.pipeline_schedule.id;null===e||void 0===e||e(r)},onErrorCallback:function(e,n){return O({errors:n,response:e})}})}})},ee=$((function(e){return r.push("/pipelines/[pipeline]/triggers/[...slug]","/pipelines/".concat(null===c||void 0===c?void 0:c.uuid,"/triggers/").concat(e,"/edit"))})),ne=(0,i.Z)(ee,2),re=ne[0],te=ne[1].isLoading,ie=$(J),le=(0,i.Z)(ie,2),_e=le[0],ke=le[1].isLoading,Ce=(0,d.useMemo)((function(){return(0,B.Tt)(G)}),[G]),Se=(0,D.Y6)(),Ee=(0,d.useMemo)((function(){return{name:Se,schedule_interval:b.U5.ONCE,schedule_type:b.Xm.TIME,start_time:(0,me.d$)((new Date).toISOString(),{dayAgo:!0,utcFormat:!0}),status:b.fq.ACTIVE}}),[Se]),Te=(0,Pe.dd)((function(){return(0,A.jsx)(H,{initialPipelineSchedulePayload:Ee,onCancel:Ne,onSuccess:_e,pipeline:c,variables:Ce})}),{},[G,c,Ce],{background:!0,uuid:"run_pipeline_now_popup"}),Me=(0,i.Z)(Te,2),Re=Me[0],Ne=Me[1],Be=(0,d.useState)(),De=Be[0],Ae=Be[1],Ve=(0,d.useMemo)((function(){var e=null===De||void 0===De?void 0:De.variables,n=!(0,we.Qr)(Ce);return function(r){var i=80;if(n){var o=Object.keys(Ce).length;i=46+43*Math.min(5,o)+1}var u=r.height-i;return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(f.ZP,Ie(Ie({},r),{},{enablePorts:!1,height:u,noStatus:!0})),n&&(0,A.jsx)(ue,{height:i,scheduleType:null===De||void 0===De?void 0:De.schedule_type,variables:Ce,variablesOverride:e}),!n&&(0,A.jsxs)(oe,{height:i,includePadding:!0,overflow:!0,children:[(0,A.jsx)(S.ZP,{children:"This pipeline has no runtime variables."}),!t&&(0,A.jsxs)(C.Z,{mt:1,children:[(0,A.jsx)(a(),{as:"/pipelines/".concat(l,"/edit?sideview=variables"),href:"/pipelines/[pipeline]/edit",passHref:!0,children:(0,A.jsx)(g.Z,{primary:!0,children:"Click here"})})," ",(0,A.jsx)(S.ZP,{inline:!0,children:"to add variables to this pipeline."})]})]})]})}}),[t,l,null===De||void 0===De?void 0:De.schedule_type,null===De||void 0===De?void 0:De.variables,Ce]),Ue=(0,d.useMemo)((function(){var e;return(null===W||void 0===W||null===(e=W.metadata)||void 0===e?void 0:e.count)||[]}),[W]),Fe=pe.ZP.pipeline_triggers.pipelines.list(l).data,He=(0,d.useMemo)((function(){return(0,je.HK)((null===Fe||void 0===Fe?void 0:Fe.pipeline_triggers)||[],(function(e){return e.name}))}),[Fe]);(0,d.useEffect)((function(){var e=((null===Fe||void 0===Fe?void 0:Fe.pipeline_triggers)||[]).find((function(e){var n=e.settings;return null===n||void 0===n?void 0:n.invalid_schedule_interval}));_(e?{displayMessage:'Schedule interval for Trigger (in code) "'.concat(null===e||void 0===e?void 0:e.name,'"')+" is invalid. Please check your cron expression\u2019s syntax in the pipeline\u2019s triggers.yaml file."}:null)}),[null===Fe||void 0===Fe?void 0:Fe.pipeline_triggers]);var Ge=pe.ZP.tags.list().data,Le=(0,d.useMemo)((function(){return(0,je.YC)((null===Ge||void 0===Ge?void 0:Ge.tags)||[],(function(e){return e.uuid}))}),[Ge]),Ye=pe.ZP.pipeline_interactions.detail(V&&l,{filter_for_permissions:1}).data,Xe=pe.ZP.interactions.pipeline_interactions.list(V&&l).data,ze=pe.ZP.pipelines.detail(V&&l).data,qe=(0,d.useMemo)((function(){return(null===Ye||void 0===Ye?void 0:Ye.pipeline_interaction)||{}}),[Ye]),Qe=((0,d.useMemo)((function(){return(null===Xe||void 0===Xe?void 0:Xe.interactions)||[]}),[Xe]),(0,d.useMemo)((function(){var e;return V&&(null===(e=Object.keys((null===qe||void 0===qe?void 0:qe.blocks)||{}))||void 0===e?void 0:e.length)>=1}),[V,qe])),We=(0,d.useMemo)((function(){return Qe&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(C.Z,{ml:"12px"}),(0,A.jsx)(ge.lZ,{}),(0,A.jsx)(C.Z,{ml:"12px"}),(0,A.jsx)(h.ZP,Ie(Ie({},he.B),{},{Icon:L.Interactions,inline:!0,onClick:function(){return E(!0)},uuid:"Create trigger with no-code",children:"Create trigger with no-code"}))]})}),[Qe,E]),Je=(0,d.useMemo)((function(){return(0,A.jsx)(de.Z,{addButtonProps:!U&&{isLoading:te,label:"New trigger",onClick:function(){return re({pipeline_schedule:{name:(0,D.Y6)()}})}},filterOptions:{frequency:Object.values(b.U5),status:Object.values(b.fq),tag:Le.map((function(e){return e.uuid})),type:Object.values(b.Xm)},filterValueLabelMapping:{status:Object.values(b.fq).reduce((function(e,n){return Ie(Ie({},e),{},(0,o.Z)({},n,(0,D.kC)(n)))}),{}),tag:Le.reduce((function(e,n){var r=n.uuid;return Ie(Ie({},e),{},(0,o.Z)({},r,r))}),{}),type:b.Z4},onClickFilterDefaults:function(){r.push("/pipelines/[pipeline]/triggers","/pipelines/".concat(l,"/triggers"))},query:X,resetPageOnFilterApply:!0,secondaryButtonProps:!U&&{beforeIcon:(0,A.jsx)(L.Once,{size:fe.bL}),disabled:t,isLoading:ke,label:"Run@once",onClick:Re,tooltip:"Creates an @once trigger and runs pipeline immediately"},showDivider:!U,children:We})}),[re,U,te,ke,t,We,l,X,r,Re,Le]),Ke=(0,d.useMemo)((function(){var e=[];return k?e.push.apply(e,[{label:function(){return"Triggers"},onClick:function(){return E(!1)}},{bold:!0,label:function(){return"New trigger"}}]):e.push({label:function(){return"Triggers"}}),e}),[k,E]);return k?(0,A.jsx)(ae.Z,{creatingWithLimitation:!0,errors:y,onCancel:function(){return E(!1)},pipeline:null===ze||void 0===ze?void 0:ze.pipeline,setErrors:O,useCreateScheduleMutation:$}):(0,A.jsx)(x.Z,{breadcrumbs:Ke,buildSidekick:!k&&Ve,errors:y||P,pageName:ve.M.TRIGGERS,pipeline:c,setErrors:O,subheader:!k&&Je,title:function(e){var n=e.name;return"".concat(n," triggers")},uuid:"".concat(ve.M.TRIGGERS,"_").concat(l),children:!k&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(v.Z,{light:!0}),W?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(se.Z,{fetchPipelineSchedules:J,pipeline:c,pipelineSchedules:K,pipelineTriggersByName:He,selectedSchedule:De,setErrors:O,setSelectedSchedule:Ae}),(0,A.jsx)(C.Z,{p:2,children:(0,A.jsx)(m.ZP,{maxPages:9,onUpdate:function(e){var n=Number(e),t=Ie(Ie({},Y),{},{page:n>=0?n:0});r.push("/pipelines/[pipeline]/triggers","/pipelines/".concat(l,"/triggers?").concat((0,xe.uM)(t)))},page:Number(q),totalPages:Math.ceil(Ue/m.Q)})})]}):(0,A.jsx)(C.Z,{m:2,children:(0,A.jsx)(ce.Z,{inverted:!0,large:!0})})]})})}ke.getInitialProps=function(){var e=(0,t.Z)(u().mark((function e(n){var r;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.query.pipeline,e.abrupt("return",{pipeline:{uuid:r}});case 2:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();var Ce=(0,j.Z)(ke)},40183:function(e,n,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/pipelines/[pipeline]/triggers",function(){return r(38415)}])}},function(e){e.O(0,[9161,7674,26,1557,3782,5544,9624,2717,9774,2888,179],(function(){return n=40183,e(e.s=n);var n}));var n=e.O();_N_E=n}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4249],{16488:function(e,n,r){"use strict";r.d(n,{IJ:function(){return h},M8:function(){return P},Uc:function(){return j},XM:function(){return Z},_U:function(){return v},eI:function(){return b},gU:function(){return y},lO:function(){return S},ri:function(){return m},tL:function(){return w},vJ:function(){return O},xH:function(){return x}});var t,i=r(82394),o=r(92083),l=r.n(o),u=r(3917),c=r(4383),a=r(30229),d=r(42122),s=r(86735);function p(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),r.push.apply(r,t)}return r}function f(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?p(Object(r),!0).forEach((function(n){(0,i.Z)(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}var v=function(e){return!!e&&!Object.values(a.U5).includes(e)};function h(e){return null===e||void 0===e?void 0:e.reduce((function(e,n){var r=n.block_uuid,t=n.completed_at,o=n.started_at,u=n.status,c=null;o&&t&&(c=l()(t).valueOf()-l()(o).valueOf());return f(f({},e),{},(0,i.Z)({},r,{runtime:c,status:u}))}),{})}var g,m=function(e){var n=[{description:function(){return"This pipeline will run continuously on an interval or just once."},label:function(){return"Schedule"},uuid:a.Xm.TIME},{description:function(){return"This pipeline will run when a specific event occurs."},label:function(){return"Event"},uuid:a.Xm.EVENT},{description:function(){return"Run this pipeline when you make an API call."},label:function(){return"API"},uuid:a.Xm.API}];return e?n.slice(0,1):n};function x(e){var n=(0,d.gR)(e,[a.gm.INTERVAL,a.gm.TYPE]),r=e[a.gm.INTERVAL];r&&(n["schedule_interval[]"]=encodeURIComponent(r));var t=e[a.gm.TYPE];return t&&(n["schedule_type[]"]=t),n}function b(e){return e?new Date(l()(e).valueOf()):null}function j(e,n){return n?(0,u.XG)(e,n):function(e){if("string"!==typeof e)return e;var n=e.split("+")[0];return l()(b(n)).format(u.Nx)}(e)}!function(e){e.DAY="day",e.HOUR="hour",e.MINUTE="minute",e.SECOND="second"}(g||(g={}));var w=(t={},(0,i.Z)(t,g.DAY,86400),(0,i.Z)(t,g.HOUR,3600),(0,i.Z)(t,g.MINUTE,60),(0,i.Z)(t,g.SECOND,1),t);function y(e){var n=g.SECOND,r=e;return e%86400===0?(r/=86400,n=g.DAY):e%3600===0?(r/=3600,n=g.HOUR):e%60===0&&(r/=60,n=g.MINUTE),{time:r,unit:n}}function O(e,n){return e*w[n]}function Z(e,n,r){var t,i=l()(e);return i.set("hour",+(null===n||void 0===n?void 0:n.hour)||0),i.set("minute",+(null===n||void 0===n?void 0:n.minute)||0),i.set("second",0),t=i.format(u.TD),null!==r&&void 0!==r&&r.includeSeconds&&(t=t.concat(":00")),null!==r&&void 0!==r&&r.localTimezone&&(t=i.format(u.lE),null!==r&&void 0!==r&&r.convertToUtc&&(t=(0,u.d$)(t,{includeSeconds:null===r||void 0===r?void 0:r.includeSeconds,utcFormat:!0}))),t}function P(e){var n,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],t="",i=!0;return i&&(r?t="".concat(window.origin,"/api/pipeline_schedules/").concat(null===e||void 0===e?void 0:e.id,"/api_trigger"):(t="".concat(window.origin,"/api/pipeline_schedules/").concat(null===e||void 0===e?void 0:e.id,"/pipeline_runs"),null!==e&&void 0!==e&&e.token&&(t="".concat(t,"/").concat(e.token)))),i&&(n=window.location.port)&&(t=t.replace(n,c.QT)),t}function _(e,n,r){return e.match(/[*,-/]/)?{additionalOffset:0,cronValue:e}:function(e,n,r){var t=r.indexOf(e),i=0;if(n<0)for(var o=0;o>n;o--)0===t?(t=r.length-1,i-=1):t-=1;else if(n>0)for(var l=0;l<n;l++)t===r.length-1?(t=0,i+=1):t+=1;var u="number"===typeof r[t]?r[t]:e;return{additionalOffset:i,cronValue:String(u)}}(+e,n,r)}var I=(0,s.m5)(60),k=(0,s.m5)(24),C=(0,u.Cs)();function S(e,n){if(!e)return e;var r=l()().local().format("Z"),t=r.split(":"),i="-"===r[0],o=3===t[0].length?Number(t[0].slice(1)):Number(t[0]),u=Number(t[1]);(i&&!n||!i&&n)&&(o=-o,u=-u);var c=e.split(" "),a=c[0],d=c[1],s=c[2],p=_(a,u,I),f=_(d,o+p.additionalOffset,k);if(c[0]=p.cronValue,c[1]=f.cronValue,0!==(null===f||void 0===f?void 0:f.additionalOffset)){var v=_(s,f.additionalOffset,C);c[2]=v.cronValue}return c.join(" ")}},38415:function(e,n,r){"use strict";r.r(n),r.d(n,{default:function(){return Ce}});var t=r(77837),i=r(75582),o=r(82394),l=r(38860),u=r.n(l),c=r(12691),a=r.n(c),d=r(82684),s=r(69864),p=r(34376),f=r(24138),v=r(15338),h=r(68562),g=r(48670),m=r(55072),x=r(75457),b=r(30229),j=r(93808),w=r(82359),y=r(71610),O=r(71180),Z=r(90299),P=r(55485),_=r(85854),I=r(37899),k=r(65956),C=r(38276),S=r(30160),E=r(44897),T=r(70515),M={uuid:"RUNTIME VARIABLES"},R={uuid:"BOOKMARK VALUES"},N=r(32080),B=r(8916),D=r(81728),A=r(28598);function V(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),r.push.apply(r,t)}return r}function U(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?V(Object(r),!0).forEach((function(n){(0,o.Z)(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):V(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}var F="".concat(T.iI,"px ").concat(3*T.iI,"px");var H=function(e){var n=e.initialPipelineSchedulePayload,r=e.onCancel,t=e.onSuccess,i=e.pipeline,l=e.variables,u=(0,d.useState)(null),c=u[0],a=u[1],s=(0,d.useState)(!0),p=s[0],f=s[1],h=(0,d.useState)(l||{}),g=h[0],m=h[1],x=(0,d.useState)(null),j=x[0],w=x[1],V=(0,d.useMemo)((function(){return U(U({},n),{},{name:(0,D.Y6)(),variables:p?(0,B.e7)(U(U({},g),c?(0,o.Z)({},b.PN,c):{})):null})}),[c,n,p,g]),H=(0,d.useMemo)((function(){return null!==i&&void 0!==i&&i.blocks?(0,N.n)(i):null}),[i]),G=(0,d.useMemo)((function(){var e;return H&&(null===(e=Object.keys(H||{}))||void 0===e?void 0:e.length)>=1?[M,R]:null}),[H]);(0,d.useEffect)((function(){(null===G||void 0===G?void 0:G.length)>=1&&!j&&w(null===G||void 0===G?void 0:G[0])}),[j,w,G]);var L=(0,d.useMemo)((function(){return null!==G&&void 0!==G&&G.length?(0,A.jsx)(Z.Z,{onClickTab:function(e){w(e)},selectedTabUUID:null===j||void 0===j?void 0:j.uuid,tabs:G,underlineStyle:!0}):null}),[j,w,G]);return(0,A.jsxs)(k.Z,{noPadding:!0,footer:(0,A.jsxs)(P.ZP,{alignItems:"center",fullWidth:!0,justifyContent:"flex-end",children:[(0,A.jsx)(O.ZP,{onClick:function(){t({pipeline_schedule:V}),r()},padding:F,primaryAlternate:!0,children:"Run now"}),(0,A.jsx)(C.Z,{mr:1}),(0,A.jsx)(O.ZP,{borderColor:E.Z.background.page,onClick:r,padding:F,secondary:!0,children:"Cancel"})]}),header:(0,A.jsx)(_.Z,{level:5,children:"Run pipeline now"}),maxHeight:"90vh",minWidth:85*T.iI,subtitle:(0,A.jsxs)(A.Fragment,{children:[!(null!==G&&void 0!==G&&G.length)&&(0,A.jsx)(C.Z,{p:T.cd,children:(0,A.jsx)(S.ZP,{default:!0,children:"Creates a new trigger and immediately runs the current pipeline once."})}),(null===G||void 0===G?void 0:G.length)>=1&&L,(0,A.jsx)(v.Z,{light:!0})]}),children:[(!(null!==G&&void 0!==G&&G.length)||M.uuid===(null===j||void 0===j?void 0:j.uuid))&&(0,A.jsxs)(A.Fragment,{children:[(null===G||void 0===G?void 0:G.length)>=1&&(0,A.jsx)(C.Z,{p:T.cd,children:(0,A.jsx)(S.ZP,{default:!0,children:"Creates a new trigger and immediately runs the current pipeline once."})}),(0,A.jsx)(I.Z,{enableVariablesOverwrite:p,originalVariables:l,runtimeVariables:g,setEnableVariablesOverwrite:f,setRuntimeVariables:m})]}),R.uuid===(null===j||void 0===j?void 0:j.uuid)&&(0,A.jsx)(y.Z,{bookmarkValues:c,pipeline:i,setBookmarkValues:a})]})},G=r(97618),L=r(72473),Y=r(25976),X=r(42631),z=r(47041),q=r(91437),Q=Y.default.div.withConfig({displayName:"indexstyle__TableStyle",componentId:"sc-pu8csx-0"})([""," overflow-y:auto;position:relative;width:100%;z-index:3;border-radius:","px;"," "," "," ",""],z.w5,X.n_,(function(e){return"\n background-color: ".concat((e.theme.background||E.Z.background).page,";\n ")}),(function(e){return e.height&&"\n height: ".concat(e.height,"px;\n ")}),(function(e){return e.flex&&"\n flex: 1;\n "}),(function(e){return(e.noBorder||e.noBorderRadius)&&"\n border-radius: 0;\n "})),W=Y.default.div.withConfig({displayName:"indexstyle__ColumnHeaderRowStyle",componentId:"sc-pu8csx-1"})(["border-top-left-radius:","px;border-top-right-radius:","px;position:sticky;top:0;width:100%;z-index:2;"," "," ",""],X.n_,X.n_,(function(e){return"\n background-color: ".concat((e.theme.background||E.Z.background).panel,";\n ")}),(function(e){return!e.noBorder&&"\n border: 1px solid ".concat((e.theme.interactive||E.Z.interactive).defaultBorder,";\n ")}),(function(e){return(e.noBorder||e.noBorderRadius)&&"\n border-radius: 0;\n "})),J=Y.default.div.withConfig({displayName:"indexstyle__ColumnHeaderCellStyle",componentId:"sc-pu8csx-2"})([""," ",""],(function(e){return!e.small&&"\n padding: ".concat(1.5*T.iI,"px;\n ")}),(function(e){return e.small&&"\n padding: ".concat(1.5*T.iI,"px;\n ")})),K=Y.default.div.withConfig({displayName:"indexstyle__RowTitleStyle",componentId:"sc-pu8csx-3"})([""," "," ",""],(function(e){return"\n background-color: ".concat((e.theme.background||E.Z.background).header,";\n border: 1px solid ").concat((e.theme.interative||E.Z.interactive).defaultBorder,";\n ")}),(function(e){return!e.small&&"\n padding: ".concat(1.5*T.iI,"px;\n ")}),(function(e){return e.small&&"\n padding: ".concat(1.5*T.iI,"px;\n ")})),$=Y.default.div.withConfig({displayName:"indexstyle__RowStyle",componentId:"sc-pu8csx-4"})([""," "," "," ",""],(0,q.eR)(),(function(e){return"\n background-color: ".concat((e.theme.background||E.Z.background).page,";\n border-top: none;\n border-bottom: none;\n ")}),(function(e){return!e.noBorder&&"\n border-bottom: 1px solid ".concat((e.theme.interactive||E.Z.interactive).defaultBorder,";\n border-left: 1px solid ").concat((e.theme.interactive||E.Z.interactive).defaultBorder,";\n border-right: 1px solid ").concat((e.theme.interactive||E.Z.interactive).defaultBorder,";\n ")}),(function(e){return e.finalRow&&!e.noBorderRadius&&"\n border-bottom-left-radius: ".concat(X.n_,"px;\n border-bottom-right-radius: ").concat(X.n_,"px;\n ")})),ee=Y.default.div.withConfig({displayName:"indexstyle__TextStyle",componentId:"sc-pu8csx-5"})(["p{cursor:pointer;}"]),ne=Y.default.div.withConfig({displayName:"indexstyle__RowCellStyle",componentId:"sc-pu8csx-6"})(["width:100%;z-index:0;"," "," "," "," ",""],(function(e){return!e.first&&"\n border-left: 1px solid ".concat((e.theme.background||E.Z.background).page,";\n ")}),(function(e){return!e.small&&"\n padding: ".concat(1.5*T.iI,"px;\n ")}),(function(e){return e.small&&"\n padding: ".concat(1.5*T.iI,"px;\n ")}),(function(e){return e.textColor&&"\n & p {\n color: ".concat(e.textColor,";\n }\n ")}),(function(e){return e.vanish&&"\n border: none;\n padding: 0 !important;\n width: 0% !important;\n height: 100% !important;\n background-color: ".concat((e.theme.background||E.Z.background).page," !important;\n ")})),re=r(35185);var te=function(e){var n,r=e.cellIndex,t=e.danger,i=e.flex,o=e.render,l=e.rowGroupIndex,u=e.rowIndex,c=e.selected,a=e.small,s=e.showBackground,p=e.showProgress,f=e.textColor,v=e.value,h=e.vanish,m=(0,d.useState)(!1),x=m[0],b=m[1],j=Array.isArray(v);return n=o?o(v):"function"===typeof v?v({selected:c}):j?(0,A.jsxs)(G.Z,{alignItems:"start",flexDirection:"row",justifyContent:"space-between",children:[(0,A.jsxs)(S.ZP,{small:a,textOverflow:!0,title:v[0],children:[x&&(0,A.jsx)(A.Fragment,{children:"".concat(v[0]," & ").concat(v.length-1," more")}),!x&&(0,A.jsx)(A.Fragment,{children:v.map((function(e){return(0,A.jsx)("div",{children:e},e)}))})]}),(0,A.jsxs)(g.Z,{onClick:function(){return b(!x)},children:[x&&(0,A.jsx)(L.ArrowDown,{muted:!0,size:2*T.iI}),!x&&(0,A.jsx)(L.ArrowRight,{muted:!0,size:2*T.iI})]})]}):p?(0,A.jsx)(P.ZP,{alignItems:"center",fullHeight:!0,fullWidth:!0,children:(0,A.jsx)(re.Z,{danger:v<80,progress:v})}):(0,A.jsx)(S.ZP,{bold:t,danger:t,small:a,textOverflow:!0,title:v,children:v}),(0,A.jsx)(G.Z,{flex:i,textOverflow:!0,children:(0,A.jsx)(ne,{first:0===r,showBackground:s,small:a,textColor:f,vanish:h,children:!h&&(0,A.jsxs)(A.Fragment,{children:[n," "]})})},"cell-".concat(l,"-").concat(u,"-").concat(r,"-").concat(v))};var ie=function(e){var n=e.columnFlexNumbers,r=e.columnHeaders,t=e.height,i=e.isTextSelectionRequired,o=e.noBorder,l=e.noBorderRadius,u=e.onClickRow,c=e.onHoverRow,a=e.renderRowCellByIndex,s=e.rowGroupData,p=void 0===s?[]:s,f=e.selectedRowIndexes,v=e.small,h=e.flex,m=e.warnings,x=void 0===m?[]:m,b=(0,d.useMemo)((function(){return p.length}),[p]);return(0,A.jsxs)(Q,{flex:h,height:t,noBorder:o,noBorderRadius:l,noScrollbarTrackBackground:!0,children:[(0,A.jsx)(W,{noBorder:o,noBorderRadius:l,children:(0,A.jsx)(P.ZP,{alignItems:"center",children:r.map((function(e,r){var t=e.Icon,i=e.label;return(0,A.jsx)(G.Z,{flex:n[r],children:(0,A.jsx)(J,{first:0===r,small:v,children:(0,A.jsxs)(P.ZP,{alignItems:"center",children:[t&&(0,A.jsx)(L.Check,{}),t&&(0,A.jsx)(C.Z,{mr:1}),(0,A.jsx)(S.ZP,{bold:!0,children:i})]})})},i)}))})}),p&&p.map((function(e,r){var t,d=e.title,s=e.rowData,p=d||r,h=[];d&&(t=(0,A.jsx)(K,{small:v,children:(0,A.jsx)(S.ZP,{bold:!0,children:d})}));var m=null===s||void 0===s?void 0:s.length;return null===s||void 0===s||s.forEach((function(e,t){var d=e.columnTextColors,s=e.columnValues,j=e.danger,w=e.uuid,y=(null===f||void 0===f?void 0:f[0])===r&&(null===f||void 0===f?void 0:f[1])===t,O=[],Z=x.find((function(e){return e.name===s[0]})),_=Z&&(0,D.HD)(s[1])?(0,D.Tz)(s[1]):s[1],I=Z&&Z.compare(_,Z.val);null===s||void 0===s||s.forEach((function(e,i,o){var l=null===a||void 0===a?void 0:a[i],u=d?d[i]:void 0;Array.isArray(e)?O.push((0,A.jsx)(te,{cellIndex:i,flex:n[i],render:l,rowGroupIndex:r,rowIndex:t,selected:y,showBackground:t%2===1,showProgress:e[0],small:v,textColor:u,value:e[1]},i)):"undefined"===typeof e?(O.pop(),i=o.length+1,O.push((0,A.jsx)(te,{cellIndex:i,danger:j,flex:n[i],render:l,rowGroupIndex:r,rowIndex:t,selected:y,showBackground:t%2===1,small:v,textColor:u,value:e,vanish:!0},i))):O.push((0,A.jsx)(te,{cellIndex:i,danger:I||j,flex:n[i],render:l,rowGroupIndex:r,rowIndex:t,selected:y,showBackground:t%2===1,small:v,textColor:u,value:e},i))}));var k=(0,A.jsx)(P.ZP,{textOverflow:!0,children:O});h.push((0,A.jsxs)($,{finalRow:b-1===r&&m-1===t,hasHover:!!c,noBorder:o,noBorderRadius:l,onMouseEnter:function(){return null===c||void 0===c?void 0:c({rowGroupIndex:r,rowIndex:t,uuid:w})},selected:y,children:[u&&(i?(0,A.jsx)(ee,{onClick:function(){return u({rowGroupIndex:r,rowIndex:t,uuid:w})},role:"cell",children:k}):(0,A.jsx)(g.Z,{block:!0,noHoverUnderline:!0,noOutline:!0,onClick:function(){return u({rowGroupIndex:r,rowIndex:t,uuid:w})},preventDefault:!0,children:k})),!u&&k]},"row-group-".concat(p,"-row-").concat(t)))})),(0,A.jsxs)("div",{children:[t,h]},p)}))]})},oe=Y.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-1xgfh62-0"})(["display:flex;flex-direction:column;height:","px;border-bottom:1px solid ",";"," "," ",""],(function(e){return e.height}),E.Z.borders.medium,(function(e){return e.includePadding&&"\n padding: ".concat(T.tr,"px;\n ")}),(function(e){return e.overflow&&"\n overflow: auto;\n "}),z.w5),le=r(79633);var ue=function(e){var n=e.height,r=e.scheduleType,t=e.variables,o=e.variablesOverride,l=[];Object.entries(t).forEach((function(e){var n=(0,i.Z)(e,2),r=n[0],t=n[1],u=null===o||void 0===o?void 0:o[r];l.push({uuid:r,value:(0,B.FS)(u||t)})})),(0,B.JZ)(l,r);var u=Object.keys(t).length;return(0,A.jsx)(oe,{height:n,children:t&&(0,A.jsx)(ie,{columnFlexNumbers:[1,1],columnHeaders:[{label:"Runtime variable (".concat(u,")")},{label:"Value"}],noBorderRadius:!0,rowGroupData:[{rowData:l.map((function(e){var n=e.uuid,r=e.value;return{columnTextColors:[le.Or,void 0],columnValues:[n,r],uuid:n}}))}],small:!0})})},ce=r(4190),ae=r(12717),de=r(85544),se=r(29624),pe=r(35686),fe=r(72191),ve=r(28795),he=r(81066),ge=r(24944),me=r(3917),xe=r(69419),be=r(16488),je=r(86735),we=r(42122),ye=r(50178),Oe=r(72619),Ze=r(70320),Pe=r(89538);function _e(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),r.push.apply(r,t)}return r}function Ie(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?_e(Object(r),!0).forEach((function(n){(0,o.Z)(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_e(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}function ke(e){var n=e.pipeline,r=(0,p.useRouter)(),t=(0,ye.Ct)(),l=n.uuid,u=pe.ZP.pipelines.detail(l,{includes_outputs:!1},{revalidateOnFocus:!1}).data,c=(0,d.useMemo)((function(){return(null===u||void 0===u?void 0:u.pipeline)||n}),[null===u||void 0===u?void 0:u.pipeline,n]),j=(0,d.useState)(null),y=j[0],O=j[1],Z=(0,d.useState)(null),P=Z[0],_=Z[1],I=(0,d.useState)(!1),k=I[0],E=I[1],T=pe.ZP.projects.list().data,M=(0,d.useMemo)((function(){var e;return null===T||void 0===T||null===(e=T.projects)||void 0===e?void 0:e[0]}),[T]),R=((0,d.useMemo)((function(){var e;return(0,Ze.hY)(null===M||void 0===M||null===(e=M.features)||void 0===e?void 0:e[w.d.LOCAL_TIMEZONE])}),[null===M||void 0===M?void 0:M.features]),pe.ZP.client_pages.detail("pipeline_schedule:create",{"pipelines[]":[l]},{},{key:"Triggers/Edit/".concat(l)}).data),N=(0,d.useMemo)((function(){return null===R||void 0===R?void 0:R.client_page}),[R]),V=(0,d.useMemo)((function(){var e,n;return null===N||void 0===N||null===(e=N.components)||void 0===e||null===(n=e.find((function(e){return"create_with_interactions_component"===e.uuid})))||void 0===n?void 0:n.enabled}),[N]),U=(0,d.useMemo)((function(){return null===N||void 0===N?void 0:N.disabled}),[N]),F=pe.ZP.variables.pipelines.list(l,{global_only:!0},{revalidateOnFocus:!1}).data,G=null===F||void 0===F?void 0:F.variables,Y=(0,xe.iV)(),X=(0,xe.DQ)(Y,[b.gm.INTERVAL,b.gm.STATUS,b.gm.TAG,b.gm.TYPE]),z=(0,be.xH)(X),q=null!==Y&&void 0!==Y&&Y.page?Y.page:0,Q=pe.ZP.pipeline_schedules.pipelines.list(l,Ie(Ie({},z),{},{_limit:m.Q,_offset:(null!==Y&&void 0!==Y&&Y.page?Y.page:0)*m.Q}),{refreshInterval:7500}),W=Q.data,J=Q.mutate,K=(0,d.useMemo)((function(){return(null===W||void 0===W?void 0:W.pipeline_schedules)||[]}),[W]),$=function(e){return(0,s.Db)(pe.ZP.pipeline_schedules.pipelines.useCreate(l),{onSuccess:function(n){return(0,Oe.wD)(n,{callback:function(n){var r=n.pipeline_schedule.id;null===e||void 0===e||e(r)},onErrorCallback:function(e,n){return O({errors:n,response:e})}})}})},ee=$((function(e){return r.push("/pipelines/[pipeline]/triggers/[...slug]","/pipelines/".concat(null===c||void 0===c?void 0:c.uuid,"/triggers/").concat(e,"/edit"))})),ne=(0,i.Z)(ee,2),re=ne[0],te=ne[1].isLoading,ie=$(J),le=(0,i.Z)(ie,2),_e=le[0],ke=le[1].isLoading,Ce=(0,d.useMemo)((function(){return(0,B.Tt)(G)}),[G]),Se=(0,D.Y6)(),Ee=(0,d.useMemo)((function(){return{name:Se,schedule_interval:b.U5.ONCE,schedule_type:b.Xm.TIME,start_time:(0,me.d$)((new Date).toISOString(),{dayAgo:!0,utcFormat:!0}),status:b.fq.ACTIVE}}),[Se]),Te=(0,Pe.dd)((function(){return(0,A.jsx)(H,{initialPipelineSchedulePayload:Ee,onCancel:Ne,onSuccess:_e,pipeline:c,variables:Ce})}),{},[G,c,Ce],{background:!0,uuid:"run_pipeline_now_popup"}),Me=(0,i.Z)(Te,2),Re=Me[0],Ne=Me[1],Be=(0,d.useState)(),De=Be[0],Ae=Be[1],Ve=(0,d.useMemo)((function(){var e=null===De||void 0===De?void 0:De.variables,n=!(0,we.Qr)(Ce);return function(r){var i=80;if(n){var o=Object.keys(Ce).length;i=46+43*Math.min(5,o)+1}var u=r.height-i;return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(f.ZP,Ie(Ie({},r),{},{enablePorts:!1,height:u,noStatus:!0})),n&&(0,A.jsx)(ue,{height:i+1,scheduleType:null===De||void 0===De?void 0:De.schedule_type,variables:Ce,variablesOverride:e}),!n&&(0,A.jsxs)(oe,{height:i+1,includePadding:!0,overflow:!0,children:[(0,A.jsx)(S.ZP,{children:"This pipeline has no runtime variables."}),!t&&(0,A.jsxs)(C.Z,{mt:1,children:[(0,A.jsx)(a(),{as:"/pipelines/".concat(l,"/edit?sideview=variables"),href:"/pipelines/[pipeline]/edit",passHref:!0,children:(0,A.jsx)(g.Z,{primary:!0,children:"Click here"})})," ",(0,A.jsx)(S.ZP,{inline:!0,children:"to add variables to this pipeline."})]})]})]})}}),[t,l,null===De||void 0===De?void 0:De.schedule_type,null===De||void 0===De?void 0:De.variables,Ce]),Ue=(0,d.useMemo)((function(){var e;return(null===W||void 0===W||null===(e=W.metadata)||void 0===e?void 0:e.count)||[]}),[W]),Fe=pe.ZP.pipeline_triggers.pipelines.list(l).data,He=(0,d.useMemo)((function(){return(0,je.HK)((null===Fe||void 0===Fe?void 0:Fe.pipeline_triggers)||[],(function(e){return e.name}))}),[Fe]);(0,d.useEffect)((function(){var e=((null===Fe||void 0===Fe?void 0:Fe.pipeline_triggers)||[]).find((function(e){var n=e.settings;return null===n||void 0===n?void 0:n.invalid_schedule_interval}));_(e?{displayMessage:'Schedule interval for Trigger (in code) "'.concat(null===e||void 0===e?void 0:e.name,'"')+" is invalid. Please check your cron expression\u2019s syntax in the pipeline\u2019s triggers.yaml file."}:null)}),[null===Fe||void 0===Fe?void 0:Fe.pipeline_triggers]);var Ge=pe.ZP.tags.list().data,Le=(0,d.useMemo)((function(){return(0,je.YC)((null===Ge||void 0===Ge?void 0:Ge.tags)||[],(function(e){return e.uuid}))}),[Ge]),Ye=pe.ZP.pipeline_interactions.detail(V&&l,{filter_for_permissions:1}).data,Xe=pe.ZP.interactions.pipeline_interactions.list(V&&l).data,ze=pe.ZP.pipelines.detail(V&&l).data,qe=(0,d.useMemo)((function(){return(null===Ye||void 0===Ye?void 0:Ye.pipeline_interaction)||{}}),[Ye]),Qe=((0,d.useMemo)((function(){return(null===Xe||void 0===Xe?void 0:Xe.interactions)||[]}),[Xe]),(0,d.useMemo)((function(){var e;return V&&(null===(e=Object.keys((null===qe||void 0===qe?void 0:qe.blocks)||{}))||void 0===e?void 0:e.length)>=1}),[V,qe])),We=(0,d.useMemo)((function(){return Qe&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(C.Z,{ml:"12px"}),(0,A.jsx)(ge.lZ,{}),(0,A.jsx)(C.Z,{ml:"12px"}),(0,A.jsx)(h.ZP,Ie(Ie({},he.B),{},{Icon:L.Interactions,inline:!0,onClick:function(){return E(!0)},uuid:"Create trigger with no-code",children:"Create trigger with no-code"}))]})}),[Qe,E]),Je=(0,d.useMemo)((function(){return(0,A.jsx)(de.Z,{addButtonProps:!U&&{isLoading:te,label:"New trigger",onClick:function(){return re({pipeline_schedule:{name:(0,D.Y6)()}})}},filterOptions:{frequency:Object.values(b.U5),status:Object.values(b.fq),tag:Le.map((function(e){return e.uuid})),type:Object.values(b.Xm)},filterValueLabelMapping:{status:Object.values(b.fq).reduce((function(e,n){return Ie(Ie({},e),{},(0,o.Z)({},n,(0,D.kC)(n)))}),{}),tag:Le.reduce((function(e,n){var r=n.uuid;return Ie(Ie({},e),{},(0,o.Z)({},r,r))}),{}),type:b.Z4},onClickFilterDefaults:function(){r.push("/pipelines/[pipeline]/triggers","/pipelines/".concat(l,"/triggers"))},query:X,resetPageOnFilterApply:!0,secondaryButtonProps:!U&&{beforeIcon:(0,A.jsx)(L.Once,{size:fe.bL}),disabled:t,isLoading:ke,label:"Run@once",onClick:Re,tooltip:"Creates an @once trigger and runs pipeline immediately"},showDivider:!U,children:We})}),[re,U,te,ke,t,We,l,X,r,Re,Le]),Ke=(0,d.useMemo)((function(){var e=[];return k?e.push.apply(e,[{label:function(){return"Triggers"},onClick:function(){return E(!1)}},{bold:!0,label:function(){return"New trigger"}}]):e.push({label:function(){return"Triggers"}}),e}),[k,E]);return k?(0,A.jsx)(ae.Z,{creatingWithLimitation:!0,errors:y,onCancel:function(){return E(!1)},pipeline:null===ze||void 0===ze?void 0:ze.pipeline,setErrors:O,useCreateScheduleMutation:$}):(0,A.jsx)(x.Z,{breadcrumbs:Ke,buildSidekick:!k&&Ve,errors:y||P,pageName:ve.M.TRIGGERS,pipeline:c,setErrors:O,subheader:!k&&Je,title:function(e){var n=e.name;return"".concat(n," triggers")},uuid:"".concat(ve.M.TRIGGERS,"_").concat(l),children:!k&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(v.Z,{light:!0}),W?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(se.Z,{fetchPipelineSchedules:J,pipeline:c,pipelineSchedules:K,pipelineTriggersByName:He,selectedSchedule:De,setErrors:O,setSelectedSchedule:Ae}),(0,A.jsx)(C.Z,{p:2,children:(0,A.jsx)(m.ZP,{maxPages:9,onUpdate:function(e){var n=Number(e),t=Ie(Ie({},Y),{},{page:n>=0?n:0});r.push("/pipelines/[pipeline]/triggers","/pipelines/".concat(l,"/triggers?").concat((0,xe.uM)(t)))},page:Number(q),totalPages:Math.ceil(Ue/m.Q)})})]}):(0,A.jsx)(C.Z,{m:2,children:(0,A.jsx)(ce.Z,{inverted:!0,large:!0})})]})})}ke.getInitialProps=function(){var e=(0,t.Z)(u().mark((function e(n){var r;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.query.pipeline,e.abrupt("return",{pipeline:{uuid:r}});case 2:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();var Ce=(0,j.Z)(ke)},40183:function(e,n,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/pipelines/[pipeline]/triggers",function(){return r(38415)}])}},function(e){e.O(0,[9161,7674,26,1557,3782,5544,9624,2717,9774,2888,179],(function(){return n=40183,e(e.s=n);var n}));var n=e.O();_N_E=n}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1221],{8666:function(e,n,i){"use strict";var t;i.d(n,{b:function(){return t}}),function(e){e.BLOCK="block",e.PIPELINE="pipeline"}(t||(t={}))},55620:function(e,n,i){"use strict";i.r(n),i.d(n,{default:function(){return Me}});var t=i(77837),u=i(75582),o=i(21831),r=i(82394),l=i(38860),c=i.n(l),s=i(12691),d=i.n(s),a=i(82684),p=i(69864),f=i(34376),v=i(52749),h=i(60523),m=i(71180),b=i(90299),g=i(31882),j=i(94629),Z=i(97618),x=i(55485),_=i(85854),C=i(68562),w=i(65956),y=i(38276),P=i(30160),k=i(35576),I=i(17488),T=i(28598);var S=function(e){var n=e.description,i=e.isLoading,t=e.maxWidth,u=e.minWidth,o=e.noEmptyValue,r=e.onClose,l=e.onSave,c=e.textArea,s=e.title,d=e.value,p=(0,a.useRef)(null),f=(0,a.useState)(d),v=f[0],h=f[1],b=c?k.Z:I.Z;return(0,a.useEffect)((function(){var e;null===p||void 0===p||null===(e=p.current)||void 0===e||e.focus()}),[]),(0,T.jsxs)(w.Z,{maxWidth:t,minWidth:u,children:[(0,T.jsx)(P.ZP,{bold:!0,children:s}),(0,T.jsx)(y.Z,{mt:1,children:(0,T.jsx)(b,{monospace:!0,onChange:function(e){return h(e.target.value)},ref:p,rows:c?7:null,value:v})}),n&&(0,T.jsx)(y.Z,{mt:2,children:(0,T.jsx)(P.ZP,{muted:!0,small:!0,children:n})}),(0,T.jsx)(y.Z,{mt:3,children:(0,T.jsxs)(x.ZP,{children:[(0,T.jsx)(C.ZP,{bold:!0,inline:!0,loading:i,onClick:function(){v===d||o&&!v?r():l(v)},outline:!0,primary:!0,uuid:"Inputs/InputModal/SaveInput",children:"Save"}),(0,T.jsx)(y.Z,{ml:1}),(0,T.jsx)(m.ZP,{onClick:r,children:"Cancel"})]})})]})},O=i(48670),E=i(55072),A=i(57653),D=i(55729),M=i(93808),R=i(82359),G=i(44085),$=i(4190),N=i(75499),U=i(48381),L=i(69650),B=i(85544),H=i(70026),F=i(35686),Y=i(44897),z=i(77417),Q=i(42631),V=i(44425),W=i(72473),q=i(23780),K=i(8666),X=i(46684),J=i(53808),ee="pipeline_list_filters",ne="pipeline_list_group_bys",ie="pipeline_list_sort_column_index",te="pipeline_list_sort_direction",ue="pipeline_list_selected_tab_uuid";function oe(e){return(0,J.t8)(ee,e),e}function re(e){return(0,J.t8)(ne,e),e}var le=i(11498),ce=i(32929),se=i(44898),de=i(70515),ae=i(30229),pe=i(81655),fe=i(31608),ve=i(81728),he=i(3917),me=i(72619),be=i(69419),ge=i(65458),je=i(15610),Ze=i(42122),xe=i(95924),_e=i(86735),Ce=i(70320),we=i(89538),ye=i(44952);function Pe(e,n){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),i.push.apply(i,t)}return i}function ke(e){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?Pe(Object(i),!0).forEach((function(n){(0,r.Z)(e,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Pe(Object(i)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(i,n))}))}return e}var Ie={Icon:W.Schedule,label:function(){return"Recently viewed"},uuid:"recent"},Te={Icon:W.PipelineV3,label:function(e){return null!==e&&void 0!==e&&e.count?"All pipelines \u203a ".concat((null===e||void 0===e?void 0:e.count)||0):"All pipelines"},uuid:"all"},Se=[Te,Ie],Oe="tab",Ee=[A.$1.SEARCH],Ae={borderRadius:"".concat(Q.BG,"px"),iconOnly:!0,noBackground:!0,noBorder:!0,outline:!0,padding:"4px"};function De(){var e,n=(0,f.useRouter)(),i=(0,a.useRef)(null),t=(0,a.useRef)(null),l=(0,a.useRef)(null),c=(0,a.useRef)(null),s=(0,z.Z)(),C=s.fetchProjects,k=s.project,I=(0,a.useState)(null),M=I[0],Q=I[1],Pe=(0,a.useState)(null),De=Pe[0],Me=Pe[1],Re=(0,a.useState)(null),Ge=Re[0],$e=Re[1],Ne=(0,a.useCallback)((function(e){$e(e),clearTimeout(c.current),c.current=setTimeout((function(){var n;return(0,je.u)((n={},(0,r.Z)(n,le.$D.OFFSET,0),(0,r.Z)(n,A.$1.SEARCH,e),n))}),500)}),[$e]),Ue=(0,a.useState)({}),Le=Ue[0],Be=Ue[1],He=(0,a.useState)(null),Fe=He[0],Ye=He[1],ze=(0,be.iV)(),Qe=ke({},(0,be.DQ)(ze,[A.$1.SEARCH,A.$1.STATUS,A.$1.TAG,A.$1.TYPE].concat((0,o.Z)(le.RG)))),Ve=(0,a.useMemo)((function(){return null===ze||void 0===ze?void 0:ze.tab}),[ze]);(0,a.useEffect)((function(){var e;Q(null===i||void 0===i||null===(e=i.current)||void 0===e?void 0:e.getBoundingClientRect().height)}),[ze,i]);var We=(0,a.useMemo)((function(){var e;return(0,Ce.hY)(null===k||void 0===k||null===(e=k.features)||void 0===e?void 0:e[R.d.LOCAL_TIMEZONE])}),[null===k||void 0===k?void 0:k.features]),qe=(0,a.useMemo)((function(){var e;return null===k||void 0===k||null===(e=k.features)||void 0===e?void 0:e[R.d.OPERATION_HISTORY]}),[k]),Ke=(0,a.useMemo)((function(){return We?pe.O$:{}}),[We]),Xe=F.ZP.pipelines.list(ke(ke({},Qe),{},{include_schedules:1}),{revalidateOnFocus:!1}),Je=Xe.data,en=Xe.mutate,nn=(0,a.useMemo)((function(){return(null===ze||void 0===ze?void 0:ze[A.$1.HISTORY_DAYS])||7}),[ze]),tn=F.ZP.pipelines.list(ke(ke({},Qe),{},(e={},(0,r.Z)(e,A.$1.HISTORY_DAYS,(0,ve.HW)(nn)?Number(nn):nn),(0,r.Z)(e,"include_schedules",1),e)),{},{pauseFetch:!qe||!Ve||Ie.uuid!==Ve}),un=tn.data,on=tn.mutate,rn=(0,a.useCallback)((function(e){return e}),[]),ln=(0,a.useMemo)((function(){var e=rn((null===Je||void 0===Je?void 0:Je.pipelines)||[]);if(null!==ze&&void 0!==ze&&ze[A.$1.TAG]){var n=ze[A.$1.TAG];e=e.filter((function(e){var i=e.tags;return i.some((function(e){return n.includes(e)}))||0===i.length&&n.includes(A.$1.NO_TAGS)}))}return e}),[Je,rn,ze]),cn=(0,a.useMemo)((function(){return rn((null===un||void 0===un?void 0:un.pipelines)||[])}),[un,rn]),sn=(0,a.useMemo)((function(){return[1,2,3,4,5,6,8,9]}),[]),dn=null===ze||void 0===ze?void 0:ze[pe.lG.SORT_COL_IDX],an=null===ze||void 0===ze?void 0:ze[pe.lG.SORT_DIRECTION],pn=(0,a.useMemo)((function(){return dn?{columnIndex:+dn,sortDirection:an||pe.sh.ASC}:void 0}),[dn,an]),fn=null===ze||void 0===ze?void 0:ze[A.$1.GROUP],vn=(0,p.Db)((function(e){var n=e.pipelineUUID,i=e.filesOnly,t=void 0!==i&&i;return F.ZP.downloads.pipelines.useCreate(n)({download:{ignore_folder_structure:t}})}),{onSuccess:function(e){return(0,me.wD)(e,{callback:function(){var n=e.data.download.token;(0,ye.K)(n)},onErrorCallback:function(e,n){return Ye({errors:n,response:e})}})}}),hn=(0,u.Z)(vn,1)[0];(0,a.useEffect)((function(){null!==Qe&&void 0!==Qe&&Qe[A.$1.SEARCH]&&null===Ge&&$e(null===Qe||void 0===Qe?void 0:Qe[A.$1.SEARCH])}),[Qe,Ge,$e]),(0,a.useEffect)((function(){var e,n={};if(!dn){var i=(0,J.U2)(ie,null),t=(0,J.U2)(te,pe.sh.ASC);null!==i&&(n[pe.lG.SORT_COL_IDX]=i,n[pe.lG.SORT_DIRECTION]=t)}qe&&(Ve?(0,J.t8)(ue,Ve):n.tab=(0,J.U2)(ue,null===Se||void 0===Se||null===(e=Se[0])||void 0===e?void 0:e.uuid));if(fn)re((0,r.Z)({},fn,!0));else{var o,l=(0,J.U2)(ne,{});l&&Object.entries(l).forEach((function(e){var n=(0,u.Z)(e,2),i=n[0],t=n[1];!o&&t&&(o=i)})),o&&(n[A.$1.GROUP]=o)}if((0,Ze.Qr)(Qe)){var c=(0,r.Z)({},le.$D.LIMIT,E.Q),s=(0,J.U2)(ee,{});s&&Object.entries(s).forEach((function(e){var n=(0,u.Z)(e,2),i=n[0],t=n[1];"undefined"!==typeof t&&null!==t&&(le.RG.includes(i)||Ee.includes(i)?c[i]=t:(c[i]=[],Object.entries(t).forEach((function(e){var n=(0,u.Z)(e,2),t=n[0];n[1]&&c[i].push(t)}))))})),(0,Ze.Qr)(c)||(n={},Object.entries(ke(ke({},n),c)||{}).forEach((function(e){var i=(0,u.Z)(e,2),t=i[0],o=i[1];"undefined"!==typeof o&&null!==o&&(n[t]=o)})))}else{var d={};Object.entries(Qe).forEach((function(e){var n=(0,u.Z)(e,2),i=n[0],t=n[1];d[i]={};var o,r=t;"undefined"!==typeof t&&null!==t&&(le.RG.includes(i)||Ee.includes(i)?d[i]=r:(Array.isArray(r)||(r=[r]),r&&Array.isArray(r)&&(null===(o=r)||void 0===o||o.forEach((function(e){d[i][e]=!0})))))})),oe((0,Ze.hB)(d))}(0,Ze.Qr)(n)||(0,je.u)((0,Ze.hB)(n),{pushHistory:!1})}),[fn,qe,Qe,Ve,sn,dn,an]),(0,a.useEffect)((function(){(0,me.bB)(Je,Ye)}),[Je]);var mn=function(e){return(0,p.Db)(F.ZP.pipelines.useCreate(),{onSuccess:function(n){return(0,me.wD)(n,{callback:function(n){var i=n.pipeline.uuid;null===e||void 0===e||e(i)},onErrorCallback:function(e,n){return Ye({errors:n,response:e})}})}})},bn=mn((function(e){return n.push("/pipelines/[pipeline]/edit","/pipelines/".concat(e,"/edit"))})),gn=(0,u.Z)(bn,2),jn=gn[0],Zn=gn[1].isLoading,xn=mn((function(){null===en||void 0===en||en(),null===on||void 0===on||on()})),_n=(0,u.Z)(xn,2),Cn=_n[0],wn=_n[1].isLoading,yn=(0,p.Db)((function(e){return F.ZP.pipelines.useUpdate(e.uuid)({pipeline:e})}),{onSuccess:function(e){return(0,me.wD)(e,{callback:function(e){var n=e.pipeline.uuid;Be((function(e){return ke(ke({},e),{},(0,r.Z)({},n,!1))})),en(),null===on||void 0===on||on(),null===Rn||void 0===Rn||Rn(),Me(null)},onErrorCallback:function(e,n){var i,t=null===e||void 0===e||null===(i=e.url_parameters)||void 0===i?void 0:i.pk;Be((function(e){return ke(ke({},e),{},(0,r.Z)({},t,!1))})),Ye({errors:n,response:e})}})}}),Pn=(0,u.Z)(yn,2),kn=Pn[0],In=Pn[1].isLoading,Tn=(0,p.Db)((function(e){return F.ZP.pipelines.useDelete(e)()}),{onSuccess:function(e){return(0,me.wD)(e,{callback:function(){null===en||void 0===en||en(),null===on||void 0===on||on()},onErrorCallback:function(e,n){return Ye({errors:n,response:e})}})}}),Sn=(0,u.Z)(Tn,2),On=Sn[0],En=Sn[1].isLoading,An=(0,we.dd)((function(e){var n=e.pipeline,i=e.pipelineDescription,t=e.pipelineName;return(0,T.jsx)(S,{isLoading:In,minWidth:55*de.iI,noEmptyValue:!!t,onClose:Rn,onSave:function(e){var i=n||De;if(i){var u=i.uuid,o={uuid:u};t?o.name=e:o.description=e,Be((function(e){return ke(ke({},e),{},(0,r.Z)({},u,!0))})),kn(o)}},textArea:!t,title:t?"Rename pipeline":"Edit description for ".concat(null===n||void 0===n?void 0:n.uuid),value:t||i})}),{},[In,De],{background:!0,uuid:"rename_pipeline_and_save"}),Dn=(0,u.Z)(An,2),Mn=Dn[0],Rn=Dn[1],Gn=(0,we.dd)((function(){return(0,T.jsx)(H.Z,{fetchPipelines:en,onCancel:Un})}),{},[en],{background:!0,uuid:"upload_pipeline"}),$n=(0,u.Z)(Gn,2),Nn=$n[0],Un=$n[1],Ln=(0,we.dd)((function(){return(0,T.jsx)(q.BC,{children:(0,T.jsx)(h.Z,{contained:!0,onClickCustomTemplate:function(e){jn({pipeline:{custom_template_uuid:null===e||void 0===e?void 0:e.template_uuid,name:(0,ve.Y6)()}}).then((function(){Fn()}))},showBreadcrumbs:!0,tabs:[ce.A2]})})}),{},[jn],{background:!0,uuid:"browse_templates"}),Bn=(0,u.Z)(Ln,2),Hn=Bn[0],Fn=Bn[1],Yn=(0,we.dd)((function(e){var n=e.cancelButtonText,i=(e.header,e.onCancel),t=e.onSaveSuccess;return(0,T.jsx)(q.BC,{children:(0,T.jsx)(D.Z,{cancelButtonText:n,contained:!0,header:(0,T.jsx)(y.Z,{mb:de.HN,children:(0,T.jsxs)(w.Z,{children:[(0,T.jsx)(P.ZP,{warning:!0,children:"You need to add an OpenAI API key to your project before you can generate pipelines using AI."}),(0,T.jsx)(y.Z,{mt:1,children:(0,T.jsxs)(P.ZP,{warning:!0,children:["Read ",(0,T.jsx)(O.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(){null===i||void 0===i||i(),Vn()},onSaveSuccess:function(e){C(),Vn(),null===t||void 0===t||t(e)}})})}),{},[C],{background:!0,uuid:"configure_project"}),zn=(0,u.Z)(Yn,2),Qn=zn[0],Vn=zn[1],Wn=(0,we.dd)((function(){return(0,T.jsx)(q.BC,{children:(0,T.jsx)(v.Z,{createPipeline:jn,isLoading:Zn,onClose:Xn})})}),{},[jn,Zn],{background:!0,disableClickOutside:!0,disableCloseButton:!0,uuid:"AI_modal"}),qn=(0,u.Z)(Wn,2),Kn=qn[0],Xn=qn[1],Jn=(0,a.useMemo)((function(){return(0,ge.d)(jn,{showImportPipelineModal:Nn,showAIModal:function(){null!==k&&void 0!==k&&k.openai_api_key?Kn():Qn({onSaveSuccess:function(){Kn()}})},showBrowseTemplates:Hn})}),[jn,k,Kn,Hn,Qn,Nn]),ei=F.ZP.tags.list().data,ni=(0,a.useMemo)((function(){return(0,_e.YC)((null===ei||void 0===ei?void 0:ei.tags)||[],(function(e){return e.uuid}))}),[ei]),ii=(0,a.useMemo)((function(){return(0,T.jsx)(B.Z,{addButtonProps:{isLoading:Zn,label:"New",menuItems:Jn},deleteRowProps:{confirmationMessage:"This is irreversible and will immediately delete everything associated with the pipeline, including its blocks, triggers, runs, logs, and history.",isLoading:En,item:"pipeline",onDelete:function(){window.confirm("Are you sure you want to delete pipeline ".concat(null===De||void 0===De?void 0:De.uuid,"?"))&&On(null===De||void 0===De?void 0:De.uuid)}},extraActionButtonProps:{Icon:W.Clone,confirmationDescription:"Cloning the selected pipeline will create a new pipeline with the same configuration and code blocks. The blocks use the same block files as the original pipeline. Pipeline triggers, runs, backfills, and logs are not copied over to the new pipeline.",confirmationMessage:"Do you want to clone the pipeline ".concat(null===De||void 0===De?void 0:De.uuid,"?"),isLoading:wn,onClick:function(){return Cn({pipeline:{clone_pipeline_uuid:null===De||void 0===De?void 0:De.uuid}})},openConfirmationDialogue:!0,tooltip:"Clone pipeline"},filterOptions:{status:A.kA,tag:[A.$1.NO_TAGS].concat((0,o.Z)(ni.map((function(e){return e.uuid})))),type:Object.values(A.qL)},filterValueLabelMapping:{status:A.kA.reduce((function(e,n){return ke(ke({},e),{},(0,r.Z)({},n,(0,ve.J3)((0,ve.kC)(n))))}),{}),tag:ke((0,r.Z)({},A.$1.NO_TAGS,"No tags"),ni.reduce((function(e,n){var i=n.uuid;return ke(ke({},e),{},(0,r.Z)({},i,i))}),{})),type:A.G7},groupButtonProps:{groupByLabel:fn,menuItems:[{beforeIcon:fn===A.r0.STATUS?(0,T.jsx)(W.Check,{fill:Y.Z.content.default,size:1.5*de.iI}):(0,T.jsx)(W.Circle,{muted:!0,size:1.5*de.iI}),label:function(){return(0,ve.kC)(A.r0.STATUS)},onClick:function(){var e=fn===A.r0.STATUS?null:A.r0.STATUS;e||re({}),(0,je.u)((0,r.Z)({},A.$1.GROUP,e),{pushHistory:!0})},uuid:"Pipelines/GroupMenu/Status"},{beforeIcon:fn===A.r0.TAG?(0,T.jsx)(W.Check,{fill:Y.Z.content.default,size:1.5*de.iI}):(0,T.jsx)(W.Circle,{muted:!0,size:1.5*de.iI}),label:function(){return(0,ve.kC)(A.r0.TAG)},onClick:function(){var e=fn===A.r0.TAG?null:A.r0.TAG;e||re({}),(0,je.u)((0,r.Z)({},A.$1.GROUP,e),{pushHistory:!0})},uuid:"Pipelines/GroupMenu/Tag"},{beforeIcon:fn===A.r0.TYPE?(0,T.jsx)(W.Check,{fill:Y.Z.content.default,size:1.5*de.iI}):(0,T.jsx)(W.Circle,{muted:!0,size:1.5*de.iI}),label:function(){return(0,ve.kC)(A.r0.TYPE)},onClick:function(){var e=fn===A.r0.TYPE?null:A.r0.TYPE;e||re({}),(0,je.u)((0,r.Z)({},A.$1.GROUP,e),{pushHistory:!0})},uuid:"Pipelines/GroupMenu/Type"}]},moreActionsMenuItems:[{label:function(){return"Rename pipeline"},onClick:function(){return Mn({pipelineName:null===De||void 0===De?void 0:De.name})},uuid:"Pipelines/MoreActionsMenu/Rename"},{label:function(){return"Edit description"},onClick:function(){return Mn({pipeline:De,pipelineDescription:null===De||void 0===De?void 0:De.description})},uuid:"Pipelines/MoreActionsMenu/EditDescription"}],onClickFilterDefaults:function(){var e;oe({}),$e(""),(0,je.u)((e={},(0,r.Z)(e,le.$D.LIMIT,(null===Qe||void 0===Qe?void 0:Qe[le.$D.LIMIT])||E.Q),(0,r.Z)(e,A.$1.SEARCH,""),e),{replaceParams:!0})},onFilterApply:function(e,n){Object.values(n).every((function(e){return!(null!==e&&void 0!==e&&e.length)}))&&oe({})},query:Qe,resetLimitOnFilterApply:!0,searchProps:{onChange:Ne,value:Ge},selectedRowId:null===De||void 0===De?void 0:De.uuid,setSelectedRow:Me})}),[Cn,On,fn,wn,Zn,En,Jn,Qe,Ge,De,Ne,Mn,ni]),ti=(0,q.VI)(null,{},[],{uuid:"pipelines/list"}),ui=(0,u.Z)(ti,1)[0],oi=(0,p.Db)(F.ZP.projects.useUpdate(null===k||void 0===k?void 0:k.name),{onSuccess:function(e){return(0,me.wD)(e,{callback:function(){C()},onErrorCallback:function(e,n){return ui({errors:n,response:e})}})}}),ri=(0,u.Z)(oi,2),li=ri[0],ci=ri[1].isLoading,si=(0,a.useCallback)((function(e){return li({project:e})}),[li]),di=(0,we.dd)((function(){return(0,T.jsxs)(w.Z,{maxWidth:60*de.iI,children:[(0,T.jsx)(y.Z,{mb:1,children:(0,T.jsx)(_.Z,{children:"Help improve Mage"})}),(0,T.jsx)(y.Z,{mb:de.cd,children:(0,T.jsx)(P.ZP,{default:!0,children:"Please contribute usage statistics to help improve the developer experience for you and everyone in the community \ud83e\udd1d."})}),(0,T.jsx)(y.Z,{mb:de.cd,children:(0,T.jsx)(w.Z,{success:!0,children:(0,T.jsxs)(x.ZP,{alignItems:"center",children:[(0,T.jsx)(W.Secrets,{size:5*de.iI,success:!0}),(0,T.jsx)(y.Z,{mr:1}),(0,T.jsx)(Z.Z,{children:(0,T.jsx)(P.ZP,{children:"All usage statistics are completely anonymous. It\u2019s impossible for Mage to know which statistics belongs to whom."})})]})})}),(0,T.jsx)(y.Z,{mb:de.cd,children:(0,T.jsxs)(P.ZP,{default:!0,children:["By opting into sending usage statistics to ",(0,T.jsx)(O.Z,{href:"https://www.mage.ai",openNewWindow:!0,children:"Mage"}),", it\u2019ll help the team and community of contributors (",(0,T.jsx)(O.Z,{href:"https://www.mage.ai/chat",openNewWindow:!0,children:"Magers"}),") learn what\u2019s going wrong with the tool and what improvements can be made."]})}),(0,T.jsx)(y.Z,{mb:de.cd,children:(0,T.jsx)(P.ZP,{default:!0,children:"In addition to helping reduce potential errors, you\u2019ll help inform which features are useful and which need work."})}),(0,T.jsx)(y.Z,{mb:de.cd,children:(0,T.jsxs)(x.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,T.jsx)(P.ZP,{bold:!0,children:"I want to help make Mage more powerful for everyone"}),(0,T.jsx)(y.Z,{mr:de.cd}),(0,T.jsx)(L.Z,{checked:!0,onCheck:function(){window.confirm("Are you sure you don\u2019t want to help everyone in the community?")&&si({deny_improve_mage:!0,help_improve_mage:!1}).then((function(){return fi()}))}})]})}),ci&&(0,T.jsx)(y.Z,{mb:de.cd,children:(0,T.jsx)($.Z,{inverted:!0})}),(0,T.jsx)(y.Z,{mb:de.cd,children:(0,T.jsxs)(P.ZP,{muted:!0,small:!0,children:["To learn more about how this works, please check out the ",(0,T.jsx)(O.Z,{href:"https://docs.mage.ai/contributing/statistics/overview",openNewWindow:!0,small:!0,children:"documentation"}),"."]})}),(0,T.jsx)(m.ZP,{onClick:function(){return si({help_improve_mage:!0}).then((function(){return fi()}))},secondary:!0,children:"Close"})]})}),{},[k],{background:!0,hideCallback:function(){si({help_improve_mage:!0})},uuid:"help_mage"}),ai=(0,u.Z)(di,2),pi=ai[0],fi=ai[1];(0,a.useEffect)((function(){k&&null===(null===k||void 0===k?void 0:k.help_improve_mage)&&pi()}),[k,pi]);var vi=(0,a.useCallback)((function(e){var n={};null===e||void 0===e||e.forEach((function(e,i){var t=null===e||void 0===e?void 0:e[fn];if(A.r0.STATUS===fn){var u=(e||{}).schedules,o=void 0===u?[]:u,r=o.length;t=o.find((function(e){var n=e.status;return ae.fq.ACTIVE===n}))?A.QK.ACTIVE:r>=1?A.QK.INACTIVE:A.QK.NO_SCHEDULES}else if(A.r0.TAG===fn){t=(null===e||void 0===e?void 0:e.tags)?(0,_e.YC)(e.tags,(function(e){return e})).join(", "):""}n[t]||(n[t]=[]),n[t].push(i)}));var i=[],t=[];A.r0.STATUS===fn?Object.values(A.QK).forEach((function(e){i.push(n[e]),t.push((0,ve.vg)(e))})):A.r0.TAG===fn?(0,_e.YC)(Object.keys(n),(function(e){return e})).forEach((function(e){i.push(n[e]),e?t.push(e.split(", ").map((function(e,n){return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("div",{style:{marginLeft:n>=1?4:0}},"".concat(e,"-").concat(n,"-spacing")),(0,T.jsx)(g.Z,{small:!0,children:(0,T.jsx)(P.ZP,{children:e})},"".concat(e,"-").concat(n))]})}))):t.push("No tags")})):A.r0.TYPE===fn&&Object.values(A.qL).forEach((function(e){i.push(n[e]),t.push(A.G7[e])}));var u=[],o=[];return null===i||void 0===i||i.forEach((function(e,n){"undefined"!==typeof e&&null!==e&&(null===e||void 0===e?void 0:e.length)>=1&&(o.push(e),u.push(null===t||void 0===t?void 0:t[n]))})),{rowGroupHeaders:u,rowsGroupedByIndex:o}}),[fn]),hi=(0,a.useMemo)((function(){return vi(ln)}),[vi,ln]),mi=hi.rowGroupHeaders,bi=hi.rowsGroupedByIndex,gi=(0,a.useMemo)((function(){return vi(cn)}),[vi,cn]),ji=gi.rowGroupHeaders,Zi=gi.rowsGroupedByIndex,xi=(0,a.useCallback)((function(e,i,u){return(0,T.jsx)(N.Z,{columnFlex:[null,null,null,2,null,null,null,1,null,null,null],columns:[{label:function(){return""},uuid:"action"},{uuid:(0,ve.kC)(A.r0.STATUS)},{uuid:"Name"},{uuid:"Description"},{uuid:(0,ve.kC)(A.r0.TYPE)},ke(ke({},Ke),{},{uuid:"Updated at"}),ke(ke({},Ke),{},{uuid:"Created at"}),{uuid:"Tags"},{uuid:"Blocks"},{uuid:"Triggers"},{center:!0,label:function(){return""},uuid:"Actions"}],isSelectedRow:function(n){var i;return(null===(i=e[n])||void 0===i?void 0:i.uuid)===(null===De||void 0===De?void 0:De.uuid)},localStorageKeySortColIdx:ie,localStorageKeySortDirection:te,onClickRow:function(n){return Me((function(i){var t=e[n];return(null===i||void 0===i?void 0:i.uuid)!==(null===t||void 0===t?void 0:t.uuid)?t:null}))},onDoubleClickRow:function(i){n.push("/pipelines/[pipeline]/edit","/pipelines/".concat(e[i].uuid,"/edit"))},ref:t,renderRightClickMenuItems:function(i){var t=e[i];return[{label:function(){return"Edit description"},onClick:function(){return Mn({pipeline:t,pipelineDescription:null===t||void 0===t?void 0:t.description})},uuid:"edit_description"},{label:function(){return"Rename"},onClick:function(){return Mn({pipeline:t,pipelineName:null===t||void 0===t?void 0:t.name})},uuid:"rename"},{label:function(){return"Clone"},onClick:function(){return Cn({pipeline:{clone_pipeline_uuid:null===t||void 0===t?void 0:t.uuid}})},uuid:"clone"},{label:function(){return"Download (keep folder structure)"},onClick:function(){hn({filesOnly:!1,pipelineUUID:null===t||void 0===t?void 0:t.uuid})},uuid:"download_keep_folder_structure"},{label:function(){return"Download (without folder structure)"},onClick:function(){hn({filesOnly:!0,pipelineUUID:null===t||void 0===t?void 0:t.uuid})},uuid:"download_without_folder_structure"},{label:function(){return"Add/Remove tags"},onClick:function(){n.push("/pipelines/[pipeline]/settings","/pipelines/".concat(null===t||void 0===t?void 0:t.uuid,"/settings"))},uuid:"add_tags"},{label:function(){return"Create template"},onClick:function(){n.push("/templates?object_type=".concat(se.R,"&new=1&pipeline_uuid=").concat(null===t||void 0===t?void 0:t.uuid))},uuid:"create_custom_template"},{label:function(){return"Create global data product"},onClick:function(){n.push("/global-data-products?object_type=".concat(K.b.PIPELINE,"&new=1&object_uuid=").concat(null===t||void 0===t?void 0:t.uuid))},uuid:"create_global_data_product"},{label:function(){return"Delete"},onClick:function(){window.confirm("Are you sure you want to delete pipeline ".concat(null===t||void 0===t?void 0:t.uuid,"?"))&&On(null===t||void 0===t?void 0:t.uuid)},uuid:"delete"}]},rightClickMenuHeight:252,rightClickMenuWidth:30*de.iI,rowGroupHeaders:i,rows:null===e||void 0===e?void 0:e.map((function(e,i){var t=e.blocks,u=e.created_at,o=e.description,l=e.schedules,c=e.tags,s=e.type,a=e.updated_at,p=e.uuid,f=t.filter((function(e){var n=e.type;return V.tf.SCRATCHPAD!==n})).length,v=l.length,h=l.find((function(e){var n=e.status;return ae.fq.ACTIVE===n})),b=s===A.ad,g=(0,T.jsx)("div",{children:(0,T.jsx)(U.Z,{tags:null===c||void 0===c?void 0:c.map((function(e){return{uuid:e}}))})},"pipeline_tags_".concat(i));return[v>=1||Le[p]?(0,T.jsx)(m.ZP,{iconOnly:!0,loading:!!Le[p],noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(n){(0,xe.j)(n),Be((function(e){return ke(ke({},e),{},(0,r.Z)({},p,!0))})),kn(ke(ke({},e),{},{status:h?ae.fq.INACTIVE:ae.fq.ACTIVE}))},children:h?(0,T.jsx)(W.Pause,{muted:!0,size:2*de.iI}):(0,T.jsx)(W.PlayButtonFilled,{default:!0,size:2*de.iI})}):null,(0,T.jsx)(P.ZP,{default:!h,monospace:!0,success:!!h,children:h?ae.fq.ACTIVE:v>=1?ae.fq.INACTIVE:"no schedules"},"pipeline_status_".concat(i)),(0,T.jsx)(d(),{as:"/pipelines/".concat(p),href:"/pipelines/[pipeline]",passHref:!0,children:(0,T.jsx)(O.Z,{sameColorAsText:!0,children:p})},"pipeline_name_".concat(i)),(0,T.jsx)(P.ZP,{default:!0,preWrap:!0,title:o,children:o},"pipeline_description_".concat(i)),(0,T.jsx)(P.ZP,{bold:b,danger:b,children:b?(0,ve.kC)(A.ad):A.G7[s]},"pipeline_type_".concat(i)),(0,T.jsx)(P.ZP,{monospace:!0,small:!0,title:a?(0,he._6)(a):null,children:a?(0,he.XG)((0,he.d$)(a,{includeSeconds:!0,utcFormat:!0}),We):(0,T.jsx)(T.Fragment,{children:"\u2014"})},"pipeline_updated_at_".concat(i)),(0,T.jsx)(P.ZP,{monospace:!0,small:!0,title:u?(0,he._6)(u):null,children:u?(0,he.XG)(u.slice(0,19),We):(0,T.jsx)(T.Fragment,{children:"\u2014"})},"pipeline_created_at_".concat(i)),g,(0,T.jsx)(P.ZP,{default:0===f,monospace:!0,children:f},"pipeline_block_count_".concat(i)),(0,T.jsx)(P.ZP,{default:0===v,monospace:!0,children:v},"pipeline_trigger_count_".concat(i)),(0,T.jsxs)(Z.Z,{flex:1,justifyContent:"flex-end",children:[(0,T.jsx)(m.ZP,ke(ke({},Ae),{},{onClick:function(){hn({pipelineUUID:p})},title:"Download (keep folder structure)",children:(0,T.jsx)(W.Save,{default:!0,size:2*de.iI})})),(0,T.jsx)(y.Z,{mr:1}),(0,T.jsx)(m.ZP,ke(ke({},Ae),{},{onClick:function(){n.push("/pipelines/[pipeline]","/pipelines/".concat(p))},title:"Detail",children:(0,T.jsx)(W.Open,{default:!0,size:2*de.iI})})),(0,T.jsx)(y.Z,{mr:1}),(0,T.jsx)(m.ZP,ke(ke({},Ae),{},{onClick:function(){n.push("/pipelines/[pipeline]/logs","/pipelines/".concat(p,"/logs"))},title:"Logs",children:(0,T.jsx)(W.File,{default:!0,size:2*de.iI})}))]},"chevron_icon_".concat(i))]})),rowsGroupedByIndex:u,sortableColumnIndexes:sn,sortedColumn:pn,stickyHeader:!0,uuid:"pipelines_table"})}),[Cn,On,hn,We,Le,n,De,Be,Me,Mn,sn,pn,Ke,kn]),_i=(0,a.useMemo)((function(){return xi(ln,mi,bi)}),[ln,xi,mi,bi]),Ci=(0,a.useMemo)((function(){return xi(cn,ji,Zi)}),[cn,xi,ji,Zi]),wi=(0,a.useMemo)((function(){return(null===ln||void 0===ln?void 0:ln.length)||0}),[ln]),yi=(0,a.useMemo)((function(){return(null===cn||void 0===cn?void 0:cn.length)||0}),[cn]),Pi=(0,a.useMemo)((function(){return(!qe||Te.uuid===Ve)&&!wi||qe&&Ie.uuid===Ve&&!yi}),[qe,wi,yi,Ve]),ki=(0,a.useMemo)((function(){var e=null===Qe||void 0===Qe?void 0:Qe[le.$D.LIMIT];return(0,T.jsxs)(x.ZP,{alignItems:"center",children:[(0,T.jsx)(P.ZP,{muted:!0,small:!0,children:"Per page"}),(0,T.jsx)(y.Z,{mr:1}),(0,T.jsxs)(G.Z,{compact:!0,onChange:function(e){var n;return(0,je.u)((n={},(0,r.Z)(n,le.$D.LIMIT,e.target.value),(0,r.Z)(n,le.$D.OFFSET,0),n),{pushHistory:!0})},small:!0,value:e,children:[e&&(e>5*E.Q||e%E.Q)&&(0,T.jsx)("option",{value:e,children:e}),(0,_e.w6)(5).map((function(e,n){var i=(n+1)*E.Q;return(0,T.jsx)("option",{value:i,children:i},i)}))]})]})}),[Qe]),Ii=(0,a.useMemo)((function(){var e,n,i=Je;qe&&Ie.uuid===Ve&&(i=un);var t=(null===(e=i)||void 0===e||null===(n=e.metadata)||void 0===n?void 0:n.count)||0,u=(null===Qe||void 0===Qe?void 0:Qe[le.$D.LIMIT])||E.Q,o=(null===Qe||void 0===Qe?void 0:Qe[le.$D.OFFSET])||0,l=Math.ceil(t/u);return(0,T.jsx)(y.Z,{p:de.cd,children:(0,T.jsx)(E.ZP,{maxPages:E.Et,onUpdate:function(e){var n=Number(e);(0,je.u)((0,r.Z)({},le.$D.OFFSET,n*u))},page:Math.floor(o/u),totalPages:l})})}),[Je,un,qe,Qe,Ve]);return(0,T.jsxs)(j.Z,{errors:Fe,setErrors:Ye,subheaderChildren:(0,T.jsxs)(x.ZP,{alignItems:"center",justifyContent:"space-between",children:[ii,ki]}),title:"Pipelines",uuid:"pipelines/index",children:[qe&&(0,T.jsx)(y.Z,{px:de.cd,ref:i,children:(0,T.jsx)(b.Z,{noPadding:!0,onClickTab:function(e){var n,i=e.uuid;return(0,je.u)((n={},(0,r.Z)(n,Oe,i),(0,r.Z)(n,le.$D.OFFSET,0),n),{pushHistory:!0})},regularSizeText:!0,selectedTabUUID:Ve,tabs:Se.map((function(e){var n=e.Icon,i=e.label;return{Icon:n,label:function(){var e;return i({count:null===Je||void 0===Je||null===(e=Je.metadata)||void 0===e?void 0:e.count})},uuid:e.uuid}})),underlineStyle:!0})}),Pi?(0,T.jsx)(y.Z,{p:de.Mq,children:Je?(0,T.jsx)(P.ZP,{bold:!0,default:!0,monospace:!0,muted:!0,children:"No pipelines available"}):(0,T.jsx)($.Z,{inverted:!0,large:!0})}):null,(0,T.jsxs)(fe.cl,{hide:Pi,includePadding:!!fn,maxHeight:"calc(100vh - ".concat(X.Mz+74+(M||44)+68,"px)"),children:[(!qe||Te.uuid===Ve)&&_i,qe&&Ie.uuid===Ve&&Ci]}),(0,T.jsx)("div",{ref:l,children:Ii})]})}De.getInitialProps=(0,t.Z)(c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",{});case 1:case"end":return e.stop()}}),e)})));var Me=(0,M.Z)(De)},79274:function(e,n,i){(window.__NEXT_P=window.__NEXT_P||[]).push(["/pipelines",function(){return i(55620)}])},80022:function(e,n,i){"use strict";function t(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}i.d(n,{Z:function(){return t}})},15544:function(e,n,i){"use strict";function t(e){return t=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},t(e)}i.d(n,{Z:function(){return t}})},13692:function(e,n,i){"use strict";i.d(n,{Z:function(){return u}});var t=i(61049);function u(e,n){if("function"!==typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),n&&(0,t.Z)(e,n)}},93189:function(e,n,i){"use strict";i.d(n,{Z:function(){return o}});var t=i(12539),u=i(80022);function o(e,n){if(n&&("object"===t(n)||"function"===typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return(0,u.Z)(e)}}},function(e){e.O(0,[1557,4241,5544,523,3548,181,9774,2888,179],(function(){return n=79274,e(e.s=n);var n}));var n=e.O();_N_E=n}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1221],{8666:function(e,n,i){"use strict";var t;i.d(n,{b:function(){return t}}),function(e){e.BLOCK="block",e.PIPELINE="pipeline"}(t||(t={}))},55620:function(e,n,i){"use strict";i.r(n),i.d(n,{default:function(){return Me}});var t=i(77837),u=i(75582),o=i(21831),r=i(82394),l=i(38860),c=i.n(l),s=i(12691),d=i.n(s),a=i(82684),p=i(69864),f=i(34376),v=i(52749),h=i(60523),m=i(71180),b=i(90299),g=i(31882),j=i(94629),Z=i(97618),x=i(55485),_=i(85854),C=i(68562),w=i(65956),y=i(38276),P=i(30160),k=i(35576),I=i(17488),T=i(28598);var S=function(e){var n=e.description,i=e.isLoading,t=e.maxWidth,u=e.minWidth,o=e.noEmptyValue,r=e.onClose,l=e.onSave,c=e.textArea,s=e.title,d=e.value,p=(0,a.useRef)(null),f=(0,a.useState)(d),v=f[0],h=f[1],b=c?k.Z:I.Z;return(0,a.useEffect)((function(){var e;null===p||void 0===p||null===(e=p.current)||void 0===e||e.focus()}),[]),(0,T.jsxs)(w.Z,{maxWidth:t,minWidth:u,children:[(0,T.jsx)(P.ZP,{bold:!0,children:s}),(0,T.jsx)(y.Z,{mt:1,children:(0,T.jsx)(b,{monospace:!0,onChange:function(e){return h(e.target.value)},ref:p,rows:c?7:null,value:v})}),n&&(0,T.jsx)(y.Z,{mt:2,children:(0,T.jsx)(P.ZP,{muted:!0,small:!0,children:n})}),(0,T.jsx)(y.Z,{mt:3,children:(0,T.jsxs)(x.ZP,{children:[(0,T.jsx)(C.ZP,{bold:!0,inline:!0,loading:i,onClick:function(){v===d||o&&!v?r():l(v)},outline:!0,primary:!0,uuid:"Inputs/InputModal/SaveInput",children:"Save"}),(0,T.jsx)(y.Z,{ml:1}),(0,T.jsx)(m.ZP,{onClick:r,children:"Cancel"})]})})]})},O=i(48670),E=i(55072),A=i(57653),D=i(55729),M=i(93808),R=i(82359),G=i(44085),$=i(4190),N=i(75499),U=i(48381),L=i(69650),B=i(85544),H=i(70026),F=i(35686),Y=i(44897),z=i(77417),Q=i(42631),V=i(44425),W=i(72473),q=i(23780),K=i(8666),X=i(46684),J=i(53808),ee="pipeline_list_filters",ne="pipeline_list_group_bys",ie="pipeline_list_sort_column_index",te="pipeline_list_sort_direction",ue="pipeline_list_selected_tab_uuid";function oe(e){return(0,J.t8)(ee,e),e}function re(e){return(0,J.t8)(ne,e),e}var le=i(11498),ce=i(32929),se=i(44898),de=i(70515),ae=i(30229),pe=i(81655),fe=i(31608),ve=i(81728),he=i(3917),me=i(72619),be=i(69419),ge=i(65458),je=i(15610),Ze=i(42122),xe=i(95924),_e=i(86735),Ce=i(70320),we=i(89538),ye=i(44952);function Pe(e,n){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),i.push.apply(i,t)}return i}function ke(e){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?Pe(Object(i),!0).forEach((function(n){(0,r.Z)(e,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Pe(Object(i)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(i,n))}))}return e}var Ie={Icon:W.Schedule,label:function(){return"Recently viewed"},uuid:"recent"},Te={Icon:W.PipelineV3,label:function(e){return null!==e&&void 0!==e&&e.count?"All pipelines \u203a ".concat((null===e||void 0===e?void 0:e.count)||0):"All pipelines"},uuid:"all"},Se=[Te,Ie],Oe="tab",Ee=[A.$1.SEARCH],Ae={borderRadius:"".concat(Q.BG,"px"),iconOnly:!0,noBackground:!0,noBorder:!0,outline:!0,padding:"4px"};function De(){var e,n=(0,f.useRouter)(),i=(0,a.useRef)(null),t=(0,a.useRef)(null),l=(0,a.useRef)(null),c=(0,a.useRef)(null),s=(0,z.Z)(),C=s.fetchProjects,k=s.project,I=(0,a.useState)(null),M=I[0],Q=I[1],Pe=(0,a.useState)(null),De=Pe[0],Me=Pe[1],Re=(0,a.useState)(null),Ge=Re[0],$e=Re[1],Ne=(0,a.useCallback)((function(e){$e(e),clearTimeout(c.current),c.current=setTimeout((function(){var n;return(0,je.u)((n={},(0,r.Z)(n,le.$D.OFFSET,0),(0,r.Z)(n,A.$1.SEARCH,e),n))}),500)}),[$e]),Ue=(0,a.useState)({}),Le=Ue[0],Be=Ue[1],He=(0,a.useState)(null),Fe=He[0],Ye=He[1],ze=(0,be.iV)(),Qe=ke({},(0,be.DQ)(ze,[A.$1.SEARCH,A.$1.STATUS,A.$1.TAG,A.$1.TYPE].concat((0,o.Z)(le.RG)))),Ve=(0,a.useMemo)((function(){return null===ze||void 0===ze?void 0:ze.tab}),[ze]);(0,a.useEffect)((function(){var e;Q(null===i||void 0===i||null===(e=i.current)||void 0===e?void 0:e.getBoundingClientRect().height)}),[ze,i]);var We=(0,a.useMemo)((function(){var e;return(0,Ce.hY)(null===k||void 0===k||null===(e=k.features)||void 0===e?void 0:e[R.d.LOCAL_TIMEZONE])}),[null===k||void 0===k?void 0:k.features]),qe=(0,a.useMemo)((function(){var e;return null===k||void 0===k||null===(e=k.features)||void 0===e?void 0:e[R.d.OPERATION_HISTORY]}),[k]),Ke=(0,a.useMemo)((function(){return We?pe.O$:{}}),[We]),Xe=F.ZP.pipelines.list(ke(ke({},Qe),{},{include_schedules:1}),{revalidateOnFocus:!1}),Je=Xe.data,en=Xe.mutate,nn=(0,a.useMemo)((function(){return(null===ze||void 0===ze?void 0:ze[A.$1.HISTORY_DAYS])||7}),[ze]),tn=F.ZP.pipelines.list(ke(ke({},Qe),{},(e={},(0,r.Z)(e,A.$1.HISTORY_DAYS,(0,ve.HW)(nn)?Number(nn):nn),(0,r.Z)(e,"include_schedules",1),e)),{},{pauseFetch:!qe||!Ve||Ie.uuid!==Ve}),un=tn.data,on=tn.mutate,rn=(0,a.useCallback)((function(e){return e}),[]),ln=(0,a.useMemo)((function(){var e=rn((null===Je||void 0===Je?void 0:Je.pipelines)||[]);if(null!==ze&&void 0!==ze&&ze[A.$1.TAG]){var n=ze[A.$1.TAG];e=e.filter((function(e){var i=e.tags;return i.some((function(e){return n.includes(e)}))||0===i.length&&n.includes(A.$1.NO_TAGS)}))}return e}),[Je,rn,ze]),cn=(0,a.useMemo)((function(){return rn((null===un||void 0===un?void 0:un.pipelines)||[])}),[un,rn]),sn=(0,a.useMemo)((function(){return[1,2,3,4,5,6,8,9]}),[]),dn=null===ze||void 0===ze?void 0:ze[pe.lG.SORT_COL_IDX],an=null===ze||void 0===ze?void 0:ze[pe.lG.SORT_DIRECTION],pn=(0,a.useMemo)((function(){return dn?{columnIndex:+dn,sortDirection:an||pe.sh.ASC}:void 0}),[dn,an]),fn=null===ze||void 0===ze?void 0:ze[A.$1.GROUP],vn=(0,p.Db)((function(e){var n=e.pipelineUUID,i=e.filesOnly,t=void 0!==i&&i;return F.ZP.downloads.pipelines.useCreate(n)({download:{ignore_folder_structure:t}})}),{onSuccess:function(e){return(0,me.wD)(e,{callback:function(){var n=e.data.download.token;(0,ye.K)(n)},onErrorCallback:function(e,n){return Ye({errors:n,response:e})}})}}),hn=(0,u.Z)(vn,1)[0];(0,a.useEffect)((function(){null!==Qe&&void 0!==Qe&&Qe[A.$1.SEARCH]&&null===Ge&&$e(null===Qe||void 0===Qe?void 0:Qe[A.$1.SEARCH])}),[Qe,Ge,$e]),(0,a.useEffect)((function(){var e,n={};if(!dn){var i=(0,J.U2)(ie,null),t=(0,J.U2)(te,pe.sh.ASC);null!==i&&(n[pe.lG.SORT_COL_IDX]=i,n[pe.lG.SORT_DIRECTION]=t)}qe&&(Ve?(0,J.t8)(ue,Ve):n.tab=(0,J.U2)(ue,null===Se||void 0===Se||null===(e=Se[0])||void 0===e?void 0:e.uuid));if(fn)re((0,r.Z)({},fn,!0));else{var o,l=(0,J.U2)(ne,{});l&&Object.entries(l).forEach((function(e){var n=(0,u.Z)(e,2),i=n[0],t=n[1];!o&&t&&(o=i)})),o&&(n[A.$1.GROUP]=o)}if((0,Ze.Qr)(Qe)){var c=(0,r.Z)({},le.$D.LIMIT,E.Q),s=(0,J.U2)(ee,{});s&&Object.entries(s).forEach((function(e){var n=(0,u.Z)(e,2),i=n[0],t=n[1];"undefined"!==typeof t&&null!==t&&(le.RG.includes(i)||Ee.includes(i)?c[i]=t:(c[i]=[],Object.entries(t).forEach((function(e){var n=(0,u.Z)(e,2),t=n[0];n[1]&&c[i].push(t)}))))})),(0,Ze.Qr)(c)||(n={},Object.entries(ke(ke({},n),c)||{}).forEach((function(e){var i=(0,u.Z)(e,2),t=i[0],o=i[1];"undefined"!==typeof o&&null!==o&&(n[t]=o)})))}else{var d={};Object.entries(Qe).forEach((function(e){var n=(0,u.Z)(e,2),i=n[0],t=n[1];d[i]={};var o,r=t;"undefined"!==typeof t&&null!==t&&(le.RG.includes(i)||Ee.includes(i)?d[i]=r:(Array.isArray(r)||(r=[r]),r&&Array.isArray(r)&&(null===(o=r)||void 0===o||o.forEach((function(e){d[i][e]=!0})))))})),oe((0,Ze.hB)(d))}(0,Ze.Qr)(n)||(0,je.u)((0,Ze.hB)(n),{pushHistory:!1})}),[fn,qe,Qe,Ve,sn,dn,an]),(0,a.useEffect)((function(){(0,me.bB)(Je,Ye)}),[Je]);var mn=function(e){return(0,p.Db)(F.ZP.pipelines.useCreate(),{onSuccess:function(n){return(0,me.wD)(n,{callback:function(n){var i=n.pipeline.uuid;null===e||void 0===e||e(i)},onErrorCallback:function(e,n){return Ye({errors:n,response:e})}})}})},bn=mn((function(e){return n.push("/pipelines/[pipeline]/edit","/pipelines/".concat(e,"/edit"))})),gn=(0,u.Z)(bn,2),jn=gn[0],Zn=gn[1].isLoading,xn=mn((function(){null===en||void 0===en||en(),null===on||void 0===on||on()})),_n=(0,u.Z)(xn,2),Cn=_n[0],wn=_n[1].isLoading,yn=(0,p.Db)((function(e){return F.ZP.pipelines.useUpdate(e.uuid)({pipeline:e})}),{onSuccess:function(e){return(0,me.wD)(e,{callback:function(e){var n=e.pipeline.uuid;Be((function(e){return ke(ke({},e),{},(0,r.Z)({},n,!1))})),en(),null===on||void 0===on||on(),null===Rn||void 0===Rn||Rn(),Me(null)},onErrorCallback:function(e,n){var i,t=null===e||void 0===e||null===(i=e.url_parameters)||void 0===i?void 0:i.pk;Be((function(e){return ke(ke({},e),{},(0,r.Z)({},t,!1))})),Ye({errors:n,response:e})}})}}),Pn=(0,u.Z)(yn,2),kn=Pn[0],In=Pn[1].isLoading,Tn=(0,p.Db)((function(e){return F.ZP.pipelines.useDelete(e)()}),{onSuccess:function(e){return(0,me.wD)(e,{callback:function(){null===en||void 0===en||en(),null===on||void 0===on||on()},onErrorCallback:function(e,n){return Ye({errors:n,response:e})}})}}),Sn=(0,u.Z)(Tn,2),On=Sn[0],En=Sn[1].isLoading,An=(0,we.dd)((function(e){var n=e.pipeline,i=e.pipelineDescription,t=e.pipelineName;return(0,T.jsx)(S,{isLoading:In,minWidth:55*de.iI,noEmptyValue:!!t,onClose:Rn,onSave:function(e){var i=n||De;if(i){var u=i.uuid,o={uuid:u};t?o.name=e:o.description=e,Be((function(e){return ke(ke({},e),{},(0,r.Z)({},u,!0))})),kn(o)}},textArea:!t,title:t?"Rename pipeline":"Edit description for ".concat(null===n||void 0===n?void 0:n.uuid),value:t||i})}),{},[In,De],{background:!0,uuid:"rename_pipeline_and_save"}),Dn=(0,u.Z)(An,2),Mn=Dn[0],Rn=Dn[1],Gn=(0,we.dd)((function(){return(0,T.jsx)(H.Z,{fetchPipelines:en,onCancel:Un})}),{},[en],{background:!0,uuid:"upload_pipeline"}),$n=(0,u.Z)(Gn,2),Nn=$n[0],Un=$n[1],Ln=(0,we.dd)((function(){return(0,T.jsx)(q.BC,{children:(0,T.jsx)(h.Z,{contained:!0,onClickCustomTemplate:function(e){jn({pipeline:{custom_template_uuid:null===e||void 0===e?void 0:e.template_uuid,name:(0,ve.Y6)()}}).then((function(){Fn()}))},showBreadcrumbs:!0,tabs:[ce.A2]})})}),{},[jn],{background:!0,uuid:"browse_templates"}),Bn=(0,u.Z)(Ln,2),Hn=Bn[0],Fn=Bn[1],Yn=(0,we.dd)((function(e){var n=e.cancelButtonText,i=(e.header,e.onCancel),t=e.onSaveSuccess;return(0,T.jsx)(q.BC,{children:(0,T.jsx)(D.Z,{cancelButtonText:n,contained:!0,header:(0,T.jsx)(y.Z,{mb:de.HN,children:(0,T.jsxs)(w.Z,{children:[(0,T.jsx)(P.ZP,{warning:!0,children:"You need to add an OpenAI API key to your project before you can generate pipelines using AI."}),(0,T.jsx)(y.Z,{mt:1,children:(0,T.jsxs)(P.ZP,{warning:!0,children:["Read ",(0,T.jsx)(O.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(){null===i||void 0===i||i(),Vn()},onSaveSuccess:function(e){C(),Vn(),null===t||void 0===t||t(e)}})})}),{},[C],{background:!0,uuid:"configure_project"}),zn=(0,u.Z)(Yn,2),Qn=zn[0],Vn=zn[1],Wn=(0,we.dd)((function(){return(0,T.jsx)(q.BC,{children:(0,T.jsx)(v.Z,{createPipeline:jn,isLoading:Zn,onClose:Xn})})}),{},[jn,Zn],{background:!0,disableClickOutside:!0,disableCloseButton:!0,uuid:"AI_modal"}),qn=(0,u.Z)(Wn,2),Kn=qn[0],Xn=qn[1],Jn=(0,a.useMemo)((function(){return(0,ge.d)(jn,{showImportPipelineModal:Nn,showAIModal:function(){null!==k&&void 0!==k&&k.openai_api_key?Kn():Qn({onSaveSuccess:function(){Kn()}})},showBrowseTemplates:Hn})}),[jn,k,Kn,Hn,Qn,Nn]),ei=F.ZP.tags.list().data,ni=(0,a.useMemo)((function(){return(0,_e.YC)((null===ei||void 0===ei?void 0:ei.tags)||[],(function(e){return e.uuid}))}),[ei]),ii=(0,a.useMemo)((function(){return(0,T.jsx)(B.Z,{addButtonProps:{isLoading:Zn,label:"New",menuItems:Jn},deleteRowProps:{confirmationMessage:"This is irreversible and will immediately delete everything associated with the pipeline, including its blocks, triggers, runs, logs, and history.",isLoading:En,item:"pipeline",onDelete:function(){window.confirm("Are you sure you want to delete pipeline ".concat(null===De||void 0===De?void 0:De.uuid,"?"))&&On(null===De||void 0===De?void 0:De.uuid)}},extraActionButtonProps:{Icon:W.Clone,confirmationDescription:"Cloning the selected pipeline will create a new pipeline with the same configuration and code blocks. The blocks use the same block files as the original pipeline. Pipeline triggers, runs, backfills, and logs are not copied over to the new pipeline.",confirmationMessage:"Do you want to clone the pipeline ".concat(null===De||void 0===De?void 0:De.uuid,"?"),isLoading:wn,onClick:function(){return Cn({pipeline:{clone_pipeline_uuid:null===De||void 0===De?void 0:De.uuid}})},openConfirmationDialogue:!0,tooltip:"Clone pipeline"},filterOptions:{status:A.kA,tag:[A.$1.NO_TAGS].concat((0,o.Z)(ni.map((function(e){return e.uuid})))),type:Object.values(A.qL)},filterValueLabelMapping:{status:A.kA.reduce((function(e,n){return ke(ke({},e),{},(0,r.Z)({},n,(0,ve.J3)((0,ve.kC)(n))))}),{}),tag:ke((0,r.Z)({},A.$1.NO_TAGS,"No tags"),ni.reduce((function(e,n){var i=n.uuid;return ke(ke({},e),{},(0,r.Z)({},i,i))}),{})),type:A.G7},groupButtonProps:{groupByLabel:fn,menuItems:[{beforeIcon:fn===A.r0.STATUS?(0,T.jsx)(W.Check,{fill:Y.Z.content.default,size:1.5*de.iI}):(0,T.jsx)(W.Circle,{muted:!0,size:1.5*de.iI}),label:function(){return(0,ve.kC)(A.r0.STATUS)},onClick:function(){var e=fn===A.r0.STATUS?null:A.r0.STATUS;e||re({}),(0,je.u)((0,r.Z)({},A.$1.GROUP,e),{pushHistory:!0})},uuid:"Pipelines/GroupMenu/Status"},{beforeIcon:fn===A.r0.TAG?(0,T.jsx)(W.Check,{fill:Y.Z.content.default,size:1.5*de.iI}):(0,T.jsx)(W.Circle,{muted:!0,size:1.5*de.iI}),label:function(){return(0,ve.kC)(A.r0.TAG)},onClick:function(){var e=fn===A.r0.TAG?null:A.r0.TAG;e||re({}),(0,je.u)((0,r.Z)({},A.$1.GROUP,e),{pushHistory:!0})},uuid:"Pipelines/GroupMenu/Tag"},{beforeIcon:fn===A.r0.TYPE?(0,T.jsx)(W.Check,{fill:Y.Z.content.default,size:1.5*de.iI}):(0,T.jsx)(W.Circle,{muted:!0,size:1.5*de.iI}),label:function(){return(0,ve.kC)(A.r0.TYPE)},onClick:function(){var e=fn===A.r0.TYPE?null:A.r0.TYPE;e||re({}),(0,je.u)((0,r.Z)({},A.$1.GROUP,e),{pushHistory:!0})},uuid:"Pipelines/GroupMenu/Type"}]},moreActionsMenuItems:[{label:function(){return"Rename pipeline"},onClick:function(){return Mn({pipelineName:null===De||void 0===De?void 0:De.name})},uuid:"Pipelines/MoreActionsMenu/Rename"},{label:function(){return"Edit description"},onClick:function(){return Mn({pipeline:De,pipelineDescription:null===De||void 0===De?void 0:De.description})},uuid:"Pipelines/MoreActionsMenu/EditDescription"}],onClickFilterDefaults:function(){var e;oe({}),$e(""),(0,je.u)((e={},(0,r.Z)(e,le.$D.LIMIT,(null===Qe||void 0===Qe?void 0:Qe[le.$D.LIMIT])||E.Q),(0,r.Z)(e,A.$1.SEARCH,""),e),{replaceParams:!0})},onFilterApply:function(e,n){Object.values(n).every((function(e){return!(null!==e&&void 0!==e&&e.length)}))&&oe({})},query:Qe,resetLimitOnFilterApply:!0,searchProps:{onChange:Ne,value:Ge},selectedRowId:null===De||void 0===De?void 0:De.uuid,setSelectedRow:Me})}),[Cn,On,fn,wn,Zn,En,Jn,Qe,Ge,De,Ne,Mn,ni]),ti=(0,q.VI)(null,{},[],{uuid:"pipelines/list"}),ui=(0,u.Z)(ti,1)[0],oi=(0,p.Db)(F.ZP.projects.useUpdate(null===k||void 0===k?void 0:k.name),{onSuccess:function(e){return(0,me.wD)(e,{callback:function(){C()},onErrorCallback:function(e,n){return ui({errors:n,response:e})}})}}),ri=(0,u.Z)(oi,2),li=ri[0],ci=ri[1].isLoading,si=(0,a.useCallback)((function(e){return li({project:e})}),[li]),di=(0,we.dd)((function(){return(0,T.jsxs)(w.Z,{maxWidth:60*de.iI,children:[(0,T.jsx)(y.Z,{mb:1,children:(0,T.jsx)(_.Z,{children:"Help improve Mage"})}),(0,T.jsx)(y.Z,{mb:de.cd,children:(0,T.jsx)(P.ZP,{default:!0,children:"Please contribute usage statistics to help improve the developer experience for you and everyone in the community \ud83e\udd1d."})}),(0,T.jsx)(y.Z,{mb:de.cd,children:(0,T.jsx)(w.Z,{success:!0,children:(0,T.jsxs)(x.ZP,{alignItems:"center",children:[(0,T.jsx)(W.Secrets,{size:5*de.iI,success:!0}),(0,T.jsx)(y.Z,{mr:1}),(0,T.jsx)(Z.Z,{children:(0,T.jsx)(P.ZP,{children:"All usage statistics are completely anonymous. It\u2019s impossible for Mage to know which statistics belongs to whom."})})]})})}),(0,T.jsx)(y.Z,{mb:de.cd,children:(0,T.jsxs)(P.ZP,{default:!0,children:["By opting into sending usage statistics to ",(0,T.jsx)(O.Z,{href:"https://www.mage.ai",openNewWindow:!0,children:"Mage"}),", it\u2019ll help the team and community of contributors (",(0,T.jsx)(O.Z,{href:"https://www.mage.ai/chat",openNewWindow:!0,children:"Magers"}),") learn what\u2019s going wrong with the tool and what improvements can be made."]})}),(0,T.jsx)(y.Z,{mb:de.cd,children:(0,T.jsx)(P.ZP,{default:!0,children:"In addition to helping reduce potential errors, you\u2019ll help inform which features are useful and which need work."})}),(0,T.jsx)(y.Z,{mb:de.cd,children:(0,T.jsxs)(x.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,T.jsx)(P.ZP,{bold:!0,children:"I want to help make Mage more powerful for everyone"}),(0,T.jsx)(y.Z,{mr:de.cd}),(0,T.jsx)(L.Z,{checked:!0,onCheck:function(){window.confirm("Are you sure you don\u2019t want to help everyone in the community?")&&si({deny_improve_mage:!0,help_improve_mage:!1}).then((function(){return fi()}))}})]})}),ci&&(0,T.jsx)(y.Z,{mb:de.cd,children:(0,T.jsx)($.Z,{inverted:!0})}),(0,T.jsx)(y.Z,{mb:de.cd,children:(0,T.jsxs)(P.ZP,{muted:!0,small:!0,children:["To learn more about how this works, please check out the ",(0,T.jsx)(O.Z,{href:"https://docs.mage.ai/contributing/statistics/overview",openNewWindow:!0,small:!0,children:"documentation"}),"."]})}),(0,T.jsx)(m.ZP,{"data-testid":"help_mage_close_button",onClick:function(){return si({help_improve_mage:!0}).then((function(){return fi()}))},secondary:!0,children:"Close"})]})}),{},[k],{background:!0,hideCallback:function(){si({help_improve_mage:!0})},uuid:"help_mage"}),ai=(0,u.Z)(di,2),pi=ai[0],fi=ai[1];(0,a.useEffect)((function(){k&&null===(null===k||void 0===k?void 0:k.help_improve_mage)&&pi()}),[k,pi]);var vi=(0,a.useCallback)((function(e){var n={};null===e||void 0===e||e.forEach((function(e,i){var t=null===e||void 0===e?void 0:e[fn];if(A.r0.STATUS===fn){var u=(e||{}).schedules,o=void 0===u?[]:u,r=o.length;t=o.find((function(e){var n=e.status;return ae.fq.ACTIVE===n}))?A.QK.ACTIVE:r>=1?A.QK.INACTIVE:A.QK.NO_SCHEDULES}else if(A.r0.TAG===fn){t=(null===e||void 0===e?void 0:e.tags)?(0,_e.YC)(e.tags,(function(e){return e})).join(", "):""}n[t]||(n[t]=[]),n[t].push(i)}));var i=[],t=[];A.r0.STATUS===fn?Object.values(A.QK).forEach((function(e){i.push(n[e]),t.push((0,ve.vg)(e))})):A.r0.TAG===fn?(0,_e.YC)(Object.keys(n),(function(e){return e})).forEach((function(e){i.push(n[e]),e?t.push(e.split(", ").map((function(e,n){return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("div",{style:{marginLeft:n>=1?4:0}},"".concat(e,"-").concat(n,"-spacing")),(0,T.jsx)(g.Z,{small:!0,children:(0,T.jsx)(P.ZP,{children:e})},"".concat(e,"-").concat(n))]})}))):t.push("No tags")})):A.r0.TYPE===fn&&Object.values(A.qL).forEach((function(e){i.push(n[e]),t.push(A.G7[e])}));var u=[],o=[];return null===i||void 0===i||i.forEach((function(e,n){"undefined"!==typeof e&&null!==e&&(null===e||void 0===e?void 0:e.length)>=1&&(o.push(e),u.push(null===t||void 0===t?void 0:t[n]))})),{rowGroupHeaders:u,rowsGroupedByIndex:o}}),[fn]),hi=(0,a.useMemo)((function(){return vi(ln)}),[vi,ln]),mi=hi.rowGroupHeaders,bi=hi.rowsGroupedByIndex,gi=(0,a.useMemo)((function(){return vi(cn)}),[vi,cn]),ji=gi.rowGroupHeaders,Zi=gi.rowsGroupedByIndex,xi=(0,a.useCallback)((function(e,i,u){return(0,T.jsx)(N.Z,{columnFlex:[null,null,null,2,null,null,null,1,null,null,null],columns:[{label:function(){return""},uuid:"action"},{uuid:(0,ve.kC)(A.r0.STATUS)},{uuid:"Name"},{uuid:"Description"},{uuid:(0,ve.kC)(A.r0.TYPE)},ke(ke({},Ke),{},{uuid:"Updated at"}),ke(ke({},Ke),{},{uuid:"Created at"}),{uuid:"Tags"},{uuid:"Blocks"},{uuid:"Triggers"},{center:!0,label:function(){return""},uuid:"Actions"}],isSelectedRow:function(n){var i;return(null===(i=e[n])||void 0===i?void 0:i.uuid)===(null===De||void 0===De?void 0:De.uuid)},localStorageKeySortColIdx:ie,localStorageKeySortDirection:te,onClickRow:function(n){return Me((function(i){var t=e[n];return(null===i||void 0===i?void 0:i.uuid)!==(null===t||void 0===t?void 0:t.uuid)?t:null}))},onDoubleClickRow:function(i){n.push("/pipelines/[pipeline]/edit","/pipelines/".concat(e[i].uuid,"/edit"))},ref:t,renderRightClickMenuItems:function(i){var t=e[i];return[{label:function(){return"Edit description"},onClick:function(){return Mn({pipeline:t,pipelineDescription:null===t||void 0===t?void 0:t.description})},uuid:"edit_description"},{label:function(){return"Rename"},onClick:function(){return Mn({pipeline:t,pipelineName:null===t||void 0===t?void 0:t.name})},uuid:"rename"},{label:function(){return"Clone"},onClick:function(){return Cn({pipeline:{clone_pipeline_uuid:null===t||void 0===t?void 0:t.uuid}})},uuid:"clone"},{label:function(){return"Download (keep folder structure)"},onClick:function(){hn({filesOnly:!1,pipelineUUID:null===t||void 0===t?void 0:t.uuid})},uuid:"download_keep_folder_structure"},{label:function(){return"Download (without folder structure)"},onClick:function(){hn({filesOnly:!0,pipelineUUID:null===t||void 0===t?void 0:t.uuid})},uuid:"download_without_folder_structure"},{label:function(){return"Add/Remove tags"},onClick:function(){n.push("/pipelines/[pipeline]/settings","/pipelines/".concat(null===t||void 0===t?void 0:t.uuid,"/settings"))},uuid:"add_tags"},{label:function(){return"Create template"},onClick:function(){n.push("/templates?object_type=".concat(se.R,"&new=1&pipeline_uuid=").concat(null===t||void 0===t?void 0:t.uuid))},uuid:"create_custom_template"},{label:function(){return"Create global data product"},onClick:function(){n.push("/global-data-products?object_type=".concat(K.b.PIPELINE,"&new=1&object_uuid=").concat(null===t||void 0===t?void 0:t.uuid))},uuid:"create_global_data_product"},{label:function(){return"Delete"},onClick:function(){window.confirm("Are you sure you want to delete pipeline ".concat(null===t||void 0===t?void 0:t.uuid,"?"))&&On(null===t||void 0===t?void 0:t.uuid)},uuid:"delete"}]},rightClickMenuHeight:252,rightClickMenuWidth:30*de.iI,rowGroupHeaders:i,rows:null===e||void 0===e?void 0:e.map((function(e,i){var t=e.blocks,u=e.created_at,o=e.description,l=e.schedules,c=e.tags,s=e.type,a=e.updated_at,p=e.uuid,f=t.filter((function(e){var n=e.type;return V.tf.SCRATCHPAD!==n})).length,v=l.length,h=l.find((function(e){var n=e.status;return ae.fq.ACTIVE===n})),b=s===A.ad,g=(0,T.jsx)("div",{children:(0,T.jsx)(U.Z,{tags:null===c||void 0===c?void 0:c.map((function(e){return{uuid:e}}))})},"pipeline_tags_".concat(i));return[v>=1||Le[p]?(0,T.jsx)(m.ZP,{iconOnly:!0,loading:!!Le[p],noBackground:!0,noBorder:!0,noPadding:!0,onClick:function(n){(0,xe.j)(n),Be((function(e){return ke(ke({},e),{},(0,r.Z)({},p,!0))})),kn(ke(ke({},e),{},{status:h?ae.fq.INACTIVE:ae.fq.ACTIVE}))},children:h?(0,T.jsx)(W.Pause,{muted:!0,size:2*de.iI}):(0,T.jsx)(W.PlayButtonFilled,{default:!0,size:2*de.iI})}):null,(0,T.jsx)(P.ZP,{default:!h,monospace:!0,success:!!h,children:h?ae.fq.ACTIVE:v>=1?ae.fq.INACTIVE:"no schedules"},"pipeline_status_".concat(i)),(0,T.jsx)(d(),{as:"/pipelines/".concat(p),href:"/pipelines/[pipeline]",passHref:!0,children:(0,T.jsx)(O.Z,{sameColorAsText:!0,children:p})},"pipeline_name_".concat(i)),(0,T.jsx)(P.ZP,{default:!0,preWrap:!0,title:o,children:o},"pipeline_description_".concat(i)),(0,T.jsx)(P.ZP,{bold:b,danger:b,children:b?(0,ve.kC)(A.ad):A.G7[s]},"pipeline_type_".concat(i)),(0,T.jsx)(P.ZP,{monospace:!0,small:!0,title:a?(0,he._6)(a):null,children:a?(0,he.XG)((0,he.d$)(a,{includeSeconds:!0,utcFormat:!0}),We):(0,T.jsx)(T.Fragment,{children:"\u2014"})},"pipeline_updated_at_".concat(i)),(0,T.jsx)(P.ZP,{monospace:!0,small:!0,title:u?(0,he._6)(u):null,children:u?(0,he.XG)(u.slice(0,19),We):(0,T.jsx)(T.Fragment,{children:"\u2014"})},"pipeline_created_at_".concat(i)),g,(0,T.jsx)(P.ZP,{default:0===f,monospace:!0,children:f},"pipeline_block_count_".concat(i)),(0,T.jsx)(P.ZP,{default:0===v,monospace:!0,children:v},"pipeline_trigger_count_".concat(i)),(0,T.jsxs)(Z.Z,{flex:1,justifyContent:"flex-end",children:[(0,T.jsx)(m.ZP,ke(ke({},Ae),{},{onClick:function(){hn({pipelineUUID:p})},title:"Download (keep folder structure)",children:(0,T.jsx)(W.Save,{default:!0,size:2*de.iI})})),(0,T.jsx)(y.Z,{mr:1}),(0,T.jsx)(m.ZP,ke(ke({},Ae),{},{onClick:function(){n.push("/pipelines/[pipeline]","/pipelines/".concat(p))},title:"Detail",children:(0,T.jsx)(W.Open,{default:!0,size:2*de.iI})})),(0,T.jsx)(y.Z,{mr:1}),(0,T.jsx)(m.ZP,ke(ke({},Ae),{},{onClick:function(){n.push("/pipelines/[pipeline]/logs","/pipelines/".concat(p,"/logs"))},title:"Logs",children:(0,T.jsx)(W.File,{default:!0,size:2*de.iI})}))]},"chevron_icon_".concat(i))]})),rowsGroupedByIndex:u,sortableColumnIndexes:sn,sortedColumn:pn,stickyHeader:!0,uuid:"pipelines_table"})}),[Cn,On,hn,We,Le,n,De,Be,Me,Mn,sn,pn,Ke,kn]),_i=(0,a.useMemo)((function(){return xi(ln,mi,bi)}),[ln,xi,mi,bi]),Ci=(0,a.useMemo)((function(){return xi(cn,ji,Zi)}),[cn,xi,ji,Zi]),wi=(0,a.useMemo)((function(){return(null===ln||void 0===ln?void 0:ln.length)||0}),[ln]),yi=(0,a.useMemo)((function(){return(null===cn||void 0===cn?void 0:cn.length)||0}),[cn]),Pi=(0,a.useMemo)((function(){return(!qe||Te.uuid===Ve)&&!wi||qe&&Ie.uuid===Ve&&!yi}),[qe,wi,yi,Ve]),ki=(0,a.useMemo)((function(){var e=null===Qe||void 0===Qe?void 0:Qe[le.$D.LIMIT];return(0,T.jsxs)(x.ZP,{alignItems:"center",children:[(0,T.jsx)(P.ZP,{muted:!0,small:!0,children:"Per page"}),(0,T.jsx)(y.Z,{mr:1}),(0,T.jsxs)(G.Z,{compact:!0,onChange:function(e){var n;return(0,je.u)((n={},(0,r.Z)(n,le.$D.LIMIT,e.target.value),(0,r.Z)(n,le.$D.OFFSET,0),n),{pushHistory:!0})},small:!0,value:e,children:[e&&(e>5*E.Q||e%E.Q)&&(0,T.jsx)("option",{value:e,children:e}),(0,_e.w6)(5).map((function(e,n){var i=(n+1)*E.Q;return(0,T.jsx)("option",{value:i,children:i},i)}))]})]})}),[Qe]),Ii=(0,a.useMemo)((function(){var e,n,i=Je;qe&&Ie.uuid===Ve&&(i=un);var t=(null===(e=i)||void 0===e||null===(n=e.metadata)||void 0===n?void 0:n.count)||0,u=(null===Qe||void 0===Qe?void 0:Qe[le.$D.LIMIT])||E.Q,o=(null===Qe||void 0===Qe?void 0:Qe[le.$D.OFFSET])||0,l=Math.ceil(t/u);return(0,T.jsx)(y.Z,{p:de.cd,children:(0,T.jsx)(E.ZP,{maxPages:E.Et,onUpdate:function(e){var n=Number(e);(0,je.u)((0,r.Z)({},le.$D.OFFSET,n*u))},page:Math.floor(o/u),totalPages:l})})}),[Je,un,qe,Qe,Ve]);return(0,T.jsxs)(j.Z,{errors:Fe,setErrors:Ye,subheaderChildren:(0,T.jsxs)(x.ZP,{alignItems:"center",justifyContent:"space-between",children:[ii,ki]}),title:"Pipelines",uuid:"pipelines/index",children:[qe&&(0,T.jsx)(y.Z,{px:de.cd,ref:i,children:(0,T.jsx)(b.Z,{noPadding:!0,onClickTab:function(e){var n,i=e.uuid;return(0,je.u)((n={},(0,r.Z)(n,Oe,i),(0,r.Z)(n,le.$D.OFFSET,0),n),{pushHistory:!0})},regularSizeText:!0,selectedTabUUID:Ve,tabs:Se.map((function(e){var n=e.Icon,i=e.label;return{Icon:n,label:function(){var e;return i({count:null===Je||void 0===Je||null===(e=Je.metadata)||void 0===e?void 0:e.count})},uuid:e.uuid}})),underlineStyle:!0})}),Pi?(0,T.jsx)(y.Z,{p:de.Mq,children:Je?(0,T.jsx)(P.ZP,{bold:!0,default:!0,monospace:!0,muted:!0,children:"No pipelines available"}):(0,T.jsx)($.Z,{inverted:!0,large:!0})}):null,(0,T.jsxs)(fe.cl,{hide:Pi,includePadding:!!fn,maxHeight:"calc(100vh - ".concat(X.Mz+74+(M||44)+68,"px)"),children:[(!qe||Te.uuid===Ve)&&_i,qe&&Ie.uuid===Ve&&Ci]}),(0,T.jsx)("div",{ref:l,children:Ii})]})}De.getInitialProps=(0,t.Z)(c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",{});case 1:case"end":return e.stop()}}),e)})));var Me=(0,M.Z)(De)},79274:function(e,n,i){(window.__NEXT_P=window.__NEXT_P||[]).push(["/pipelines",function(){return i(55620)}])},80022:function(e,n,i){"use strict";function t(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}i.d(n,{Z:function(){return t}})},15544:function(e,n,i){"use strict";function t(e){return t=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},t(e)}i.d(n,{Z:function(){return t}})},13692:function(e,n,i){"use strict";i.d(n,{Z:function(){return u}});var t=i(61049);function u(e,n){if("function"!==typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),n&&(0,t.Z)(e,n)}},93189:function(e,n,i){"use strict";i.d(n,{Z:function(){return o}});var t=i(12539),u=i(80022);function o(e,n){if(n&&("object"===t(n)||"function"===typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return(0,u.Z)(e)}}},function(e){e.O(0,[1557,4241,5544,523,3548,181,9774,2888,179],(function(){return n=79274,e(e.s=n);var n}));var n=e.O();_N_E=n}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1312],{66316:function(e,r,t){"use strict";t.d(r,{Z:function(){return j}});var n=t(82394),i=t(70613),o=t(31557),c=t(33591),u=t(38276),s=t(70515),a=t(28598);var l=function(e){var r=e.children,t=e.width,n=void 0===t?12:t;return(0,a.jsx)(u.Z,{px:s.zC,children:(0,a.jsx)(c.Row,{children:(0,a.jsx)(c.Col,{lg:n,md:Math.min(12,Math.round(1.5*(12-n))),sm:Math.min(12,Math.round(1.75*(12-n))),xs:12,children:r})})})},d=t(25976),f=t(46684),p=d.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-jcgu5l-0"})(["padding-top:","px;",""],f.Mz,(function(e){return e.fullHeight&&"\n height: calc(100vh);\n "}));function g(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function h(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?g(Object(t),!0).forEach((function(r){(0,n.Z)(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):g(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}var j=function(e){var r=e.children,t=e.headerProps,n=e.title;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.Z,{title:n}),(0,a.jsx)(o.Z,h({},t)),(0,a.jsx)(l,{children:(0,a.jsx)(p,{fullHeight:!0,children:r})})]})}},46568:function(e,r,t){"use strict";var n=t(82394),i=t(26304),o=(t(82684),t(33591)),c=t(28598),u=["children","fullHeight","gutter","style"];function s(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function a(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?s(Object(t),!0).forEach((function(r){(0,n.Z)(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):s(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}r.Z=function(e){var r=e.children,t=e.fullHeight,n=e.gutter,s=e.style,l=void 0===s?{}:s,d=(0,i.Z)(e,u),f=a({},l);return n&&(f.paddingLeft=n,f.paddingRight=f.paddingLeft),t&&(f.height="100%"),(0,c.jsx)(o.Col,a(a({},d),{},{style:f,children:r}))}},82682:function(e,r,t){"use strict";var n=t(82394),i=t(26304),o=t(82684),c=t(33591),u=t(28598),s=["children","fullHeight","gutter","justifyContent","style"];function a(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function l(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?a(Object(t),!0).forEach((function(r){(0,n.Z)(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):a(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}r.Z=function(e){var r=e.children,t=e.fullHeight,n=e.gutter,a=e.justifyContent,d=e.style,f=void 0===d?{}:d,p=(0,i.Z)(e,s),g=l({},f);return n&&(g.marginLeft=-1*n,g.marginRight=g.marginLeft),t&&(g.height="100%"),(0,u.jsx)(c.Row,l(l({},p),{},{justifyContent:a,style:g,children:o.Children.map(r,(function(e,r){return e&&o.cloneElement(e,{gutter:n,key:r})}))}))}},94542:function(e,r,t){"use strict";t.d(r,{J:function(){return o},X:function(){return c}});var n=t(46568),i=t(82682),o=n.Z,c=i.Z},91769:function(e,r,t){"use strict";t.d(r,{f:function(){return v},h:function(){return j}});var n=t(82394),i=t(82684),o=t(34376),c=t(68562),u=t(72473),s=t(70515),a=t(69419),l=t(53808),d=t(28598);var f=function(e){var r=e.oauthResponse,t=(0,o.useRouter)(),n=(0,i.useMemo)((function(){return r||{}}),[r]),f=n.url,p=n.redirect_query_params,g=void 0===p?{}:p;return(0,d.jsx)(d.Fragment,{children:f&&(0,d.jsx)(c.ZP,{beforeElement:(0,d.jsx)(u.GoogleIcon,{size:2*s.iI}),bold:!0,inline:!0,onClick:function(){var e=(0,a.iV)(f).state;(0,l.t8)(e,g),t.push(f)},uuid:"SignForm/google",children:"Sign in with Google"})})};var p=function(e){var r=e.oauthResponse,t=(0,o.useRouter)(),n=(0,i.useMemo)((function(){return r||{}}),[r]),f=n.url,p=n.redirect_query_params,g=void 0===p?{}:p;return(0,d.jsx)(d.Fragment,{children:f&&(0,d.jsx)(c.ZP,{beforeElement:(0,d.jsx)(u.MicrosoftIcon,{size:2*s.iI}),bold:!0,inline:!0,onClick:function(){var e=(0,a.iV)(f).state;g&&(0,l.t8)(e,g),t.push(f)},uuid:"SignForm/active_directory",children:"Sign in with Microsoft"})})};var g=function(e){var r=e.oauthResponse,t=(0,o.useRouter)(),n=(0,i.useMemo)((function(){return r||{}}),[r]),u=n.url,s=n.redirect_query_params,f=void 0===s?{}:s;return(0,d.jsx)(d.Fragment,{children:u&&(0,d.jsx)(c.ZP,{bold:!0,inline:!0,onClick:function(){var e=(0,a.iV)(u).state;(0,l.t8)(e,f),t.push(u)},uuid:"SignForm/oidc_generic",children:"Sign in with OIDC"})})};var h,j,b=function(e){var r=e.oauthResponse,t=(0,o.useRouter)(),n=(0,i.useMemo)((function(){return r||{}}),[r]),u=n.url,s=n.redirect_query_params,f=void 0===s?{}:s;return(0,d.jsx)(d.Fragment,{children:u&&(0,d.jsx)(c.ZP,{bold:!0,inline:!0,onClick:function(){var e=(0,a.iV)(u).state;(0,l.t8)(e,f),t.push(u)},uuid:"SignForm/okta",children:"Sign in with Okta"})})};!function(e){e.ACTIVE_DIRECTORY="active_directory",e.BITBUCKET="bitbucket",e.GITHUB="github",e.GITLAB="gitlab",e.GOOGLE="google",e.OIDC_GENERIC="oidc_generic",e.OKTA="okta"}(j||(j={}));var v=(h={},(0,n.Z)(h,j.ACTIVE_DIRECTORY,p),(0,n.Z)(h,j.GOOGLE,f),(0,n.Z)(h,j.OIDC_GENERIC,g),(0,n.Z)(h,j.OKTA,b),h)},13180:function(e,r,t){"use strict";t.r(r),t.d(r,{default:function(){return L}});var n=t(77837),i=t(38860),o=t.n(i),c=t(66316),u=t(82394),s=t(75582),a=t(82684),l=t(69864),d=t(34376),f=t(40761),p=t(55485),g=t(85854),h=t(68562),j=t(38276),b=t(30160),v=t(17488),O=t(35686),y=t(25976),m=t(44897),x=t(42631),w=t(70515),Z=y.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-641xul-0"})(["border-radius:","px;padding-bottom:","px;padding-left:","px;padding-right:","px;padding-top:","px;width:100%;",""],x.TR,21*w.iI,w.Vj,w.Vj,w.Vj,(function(e){return"\n background-color: ".concat((e.theme.background||m.Z.background).panel,";\n ")})),P=y.default.div.withConfig({displayName:"indexstyle__BackgroundImageStyle",componentId:"sc-641xul-1"})(["border-radius:","px;font-size:0;overflow:hidden;",""],x.D7,(function(e){return e.src&&"\n background-image: url(".concat(e.src,");\n background-size: cover;\n background-repeat: no-repeat;\n height: 100%;\n width: 100%;\n ")})),C=t(94542),_=t(39643),k=t(91769),E=t(42122),S=t(72619),D=t(42041),I=t(69419),R=t(50178),M=t(28598);function T(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function z(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?T(Object(t),!0).forEach((function(r){(0,u.Z)(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):T(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}var V="email",F="password";var G=function(e){var r=e.title,t=(0,d.useRouter)(),n=(0,a.useState)(null),i=n[0],o=n[1],c=(0,a.useState)({}),y=c[0],m=c[1],x=(0,l.Db)(O.ZP.sessions.useCreate(),{onSuccess:function(e){return(0,S.wD)(e,{callback:function(e){var r=e.session,t=r.token,n=r.user;(0,R.av)(n),f.Z.storeToken(t,(function(){var e="/",r=(0,I.iV)(window.location.href),t=(0,I.uM)((0,E.gR)(r,["redirect_url","access_token","provider"]));r.redirect_url&&(e="".concat(r.redirect_url,"?").concat(t)),window.location.href=e}))},onErrorCallback:function(e){var r=e.error;o(r)}})}}),T=(0,s.Z)(x,2),G=T[0],H=T[1].isLoading,L=(0,a.useCallback)((function(e){return f.Z.logout((function(){return G(e)}))}),[G]),N=O.ZP.oauths.list({redirect_uri:encodeURIComponent(window.location.href)}).data,q=(0,a.useMemo)((function(){var e;return null===N||void 0===N||null===(e=N.oauths)||void 0===e?void 0:e.reduce((function(e,r){return e[r.provider]=r,e}),{})}),[N]),A=(0,I.iV)()||{},B=A.access_token,U=A.provider;return(0,a.useEffect)((function(){var e;B&&U&&G({session:(e={},(0,u.Z)(e,"provider",U),(0,u.Z)(e,"token",B),e)})}),[B,G,U]),(0,M.jsxs)(C.X,{fullHeight:!0,children:[(0,M.jsx)(C.J,{lg:6,md:12,children:(0,M.jsx)(p.ZP,{flexDirection:"column",fullHeight:!0,fullWidth:!0,justifyContent:"center",children:(0,M.jsx)(j.Z,{px:{xl:5*w.zC,xs:w.zC},py:w.zC,children:(0,M.jsxs)(Z,{children:[(0,M.jsx)(g.Z,{yellow:!0,children:r}),(0,M.jsxs)("form",{children:[(0,M.jsxs)(j.Z,{mt:3,children:[(0,M.jsx)(v.Z,{autoComplete:"username",label:"Email",large:!0,meta:{error:" ",touched:!!i},onChange:function(e){return m((function(r){return z(z({},r),{},(0,u.Z)({},V,e.target.value))}))},primary:!i,value:y.email}),(0,M.jsx)(j.Z,{mt:2,children:(0,M.jsx)(v.Z,{autoComplete:"current-password",label:"Password",large:!0,meta:{error:" ",touched:!!i},onChange:function(e){return m((function(r){return z(z({},r),{},(0,u.Z)({},F,e.target.value))}))},primary:!i,type:"password",value:y.password})})]}),i&&(0,M.jsx)(j.Z,{mt:2,children:(0,M.jsx)(b.ZP,{danger:!0,children:i.message})}),(0,M.jsx)(j.Z,{mt:3,children:(0,M.jsx)(h.ZP,{bold:!0,inline:!0,keyTextGroups:[[_.Lz]],keyboardShortcutValidation:function(e){var r=e.keyMapping;return(0,D.y)([_.Uq],r)},large:!0,loading:H,noHoverUnderline:!0,onClick:function(){return L({session:y})},selected:!0,uuid:"SignForm/action",wind:!0,children:"Sign into Mage"})}),Object.entries(k.f).map((function(e){var r=(0,s.Z)(e,2),t=r[0],n=r[1];return(0,M.jsx)(M.Fragment,{children:(null===q||void 0===q?void 0:q[t])&&(0,M.jsx)(j.Z,{mt:4,children:(0,M.jsx)(n,{oauthResponse:null===q||void 0===q?void 0:q[t]})})})}))]})]})})})}),(0,M.jsx)(C.J,{hiddenLgDown:!0,lg:6,style:{flex:1},children:(0,M.jsx)(j.Z,{fullHeight:!0,fullWidth:!0,px:w.zC,py:w.zC+8,children:(0,M.jsx)(P,{src:"".concat(t.basePath,"/images/sessions/abstract.png"),children:"Sign in abstract image"})})})]})};function H(){return(0,M.jsx)(c.Z,{title:"Sign in",children:(0,M.jsx)(G,{title:"\ud83d\udc4b Sign in"})})}H.getInitialProps=(0,n.Z)(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",{});case 1:case"end":return e.stop()}}),e)})));var L=H},6821:function(e,r,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/sign-in",function(){return t(13180)}])}},function(e){e.O(0,[1557,9774,2888,179],(function(){return r=6821,e(e.s=r);var r}));var r=e.O();_N_E=r}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1312],{66316:function(e,r,t){"use strict";t.d(r,{Z:function(){return j}});var n=t(82394),i=t(70613),o=t(31557),c=t(33591),u=t(38276),s=t(70515),a=t(28598);var l=function(e){var r=e.children,t=e.width,n=void 0===t?12:t;return(0,a.jsx)(u.Z,{px:s.zC,children:(0,a.jsx)(c.Row,{children:(0,a.jsx)(c.Col,{lg:n,md:Math.min(12,Math.round(1.5*(12-n))),sm:Math.min(12,Math.round(1.75*(12-n))),xs:12,children:r})})})},d=t(25976),f=t(46684),p=d.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-jcgu5l-0"})(["padding-top:","px;",""],f.Mz,(function(e){return e.fullHeight&&"\n height: calc(100vh);\n "}));function g(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function h(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?g(Object(t),!0).forEach((function(r){(0,n.Z)(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):g(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}var j=function(e){var r=e.children,t=e.headerProps,n=e.title;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.Z,{title:n}),(0,a.jsx)(o.Z,h({},t)),(0,a.jsx)(l,{children:(0,a.jsx)(p,{fullHeight:!0,children:r})})]})}},46568:function(e,r,t){"use strict";var n=t(82394),i=t(26304),o=(t(82684),t(33591)),c=t(28598),u=["children","fullHeight","gutter","style"];function s(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function a(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?s(Object(t),!0).forEach((function(r){(0,n.Z)(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):s(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}r.Z=function(e){var r=e.children,t=e.fullHeight,n=e.gutter,s=e.style,l=void 0===s?{}:s,d=(0,i.Z)(e,u),f=a({},l);return n&&(f.paddingLeft=n,f.paddingRight=f.paddingLeft),t&&(f.height="100%"),(0,c.jsx)(o.Col,a(a({},d),{},{style:f,children:r}))}},82682:function(e,r,t){"use strict";var n=t(82394),i=t(26304),o=t(82684),c=t(33591),u=t(28598),s=["children","fullHeight","gutter","justifyContent","style"];function a(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function l(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?a(Object(t),!0).forEach((function(r){(0,n.Z)(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):a(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}r.Z=function(e){var r=e.children,t=e.fullHeight,n=e.gutter,a=e.justifyContent,d=e.style,f=void 0===d?{}:d,p=(0,i.Z)(e,s),g=l({},f);return n&&(g.marginLeft=-1*n,g.marginRight=g.marginLeft),t&&(g.height="100%"),(0,u.jsx)(c.Row,l(l({},p),{},{justifyContent:a,style:g,children:o.Children.map(r,(function(e,r){return e&&o.cloneElement(e,{gutter:n,key:r})}))}))}},94542:function(e,r,t){"use strict";t.d(r,{J:function(){return o},X:function(){return c}});var n=t(46568),i=t(82682),o=n.Z,c=i.Z},91769:function(e,r,t){"use strict";t.d(r,{f:function(){return v},h:function(){return j}});var n=t(82394),i=t(82684),o=t(34376),c=t(68562),u=t(72473),s=t(70515),a=t(69419),l=t(53808),d=t(28598);var f=function(e){var r=e.oauthResponse,t=(0,o.useRouter)(),n=(0,i.useMemo)((function(){return r||{}}),[r]),f=n.url,p=n.redirect_query_params,g=void 0===p?{}:p;return(0,d.jsx)(d.Fragment,{children:f&&(0,d.jsx)(c.ZP,{beforeElement:(0,d.jsx)(u.GoogleIcon,{size:2*s.iI}),bold:!0,inline:!0,onClick:function(){var e=(0,a.iV)(f).state;(0,l.t8)(e,g),t.push(f)},uuid:"SignForm/google",children:"Sign in with Google"})})};var p=function(e){var r=e.oauthResponse,t=(0,o.useRouter)(),n=(0,i.useMemo)((function(){return r||{}}),[r]),f=n.url,p=n.redirect_query_params,g=void 0===p?{}:p;return(0,d.jsx)(d.Fragment,{children:f&&(0,d.jsx)(c.ZP,{beforeElement:(0,d.jsx)(u.MicrosoftIcon,{size:2*s.iI}),bold:!0,inline:!0,onClick:function(){var e=(0,a.iV)(f).state;g&&(0,l.t8)(e,g),t.push(f)},uuid:"SignForm/active_directory",children:"Sign in with Microsoft"})})};var g=function(e){var r=e.oauthResponse,t=(0,o.useRouter)(),n=(0,i.useMemo)((function(){return r||{}}),[r]),u=n.url,s=n.redirect_query_params,f=void 0===s?{}:s;return(0,d.jsx)(d.Fragment,{children:u&&(0,d.jsx)(c.ZP,{bold:!0,inline:!0,onClick:function(){var e=(0,a.iV)(u).state;(0,l.t8)(e,f),t.push(u)},uuid:"SignForm/oidc_generic",children:"Sign in with OIDC"})})};var h,j,b=function(e){var r=e.oauthResponse,t=(0,o.useRouter)(),n=(0,i.useMemo)((function(){return r||{}}),[r]),u=n.url,s=n.redirect_query_params,f=void 0===s?{}:s;return(0,d.jsx)(d.Fragment,{children:u&&(0,d.jsx)(c.ZP,{bold:!0,inline:!0,onClick:function(){var e=(0,a.iV)(u).state;(0,l.t8)(e,f),t.push(u)},uuid:"SignForm/okta",children:"Sign in with Okta"})})};!function(e){e.ACTIVE_DIRECTORY="active_directory",e.AZURE_DEVOPS="azure_devops",e.BITBUCKET="bitbucket",e.GITHUB="github",e.GITLAB="gitlab",e.GOOGLE="google",e.OIDC_GENERIC="oidc_generic",e.OKTA="okta"}(j||(j={}));var v=(h={},(0,n.Z)(h,j.ACTIVE_DIRECTORY,p),(0,n.Z)(h,j.GOOGLE,f),(0,n.Z)(h,j.OIDC_GENERIC,g),(0,n.Z)(h,j.OKTA,b),h)},13180:function(e,r,t){"use strict";t.r(r),t.d(r,{default:function(){return L}});var n=t(77837),i=t(38860),o=t.n(i),c=t(66316),u=t(82394),s=t(75582),a=t(82684),l=t(69864),d=t(34376),f=t(40761),p=t(55485),g=t(85854),h=t(68562),j=t(38276),b=t(30160),v=t(17488),O=t(35686),y=t(25976),m=t(44897),x=t(42631),w=t(70515),Z=y.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-641xul-0"})(["border-radius:","px;padding-bottom:","px;padding-left:","px;padding-right:","px;padding-top:","px;width:100%;",""],x.TR,21*w.iI,w.Vj,w.Vj,w.Vj,(function(e){return"\n background-color: ".concat((e.theme.background||m.Z.background).panel,";\n ")})),P=y.default.div.withConfig({displayName:"indexstyle__BackgroundImageStyle",componentId:"sc-641xul-1"})(["border-radius:","px;font-size:0;overflow:hidden;",""],x.D7,(function(e){return e.src&&"\n background-image: url(".concat(e.src,");\n background-size: cover;\n background-repeat: no-repeat;\n height: 100%;\n width: 100%;\n ")})),C=t(94542),_=t(39643),k=t(91769),E=t(42122),S=t(72619),D=t(42041),R=t(69419),I=t(50178),M=t(28598);function T(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function z(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?T(Object(t),!0).forEach((function(r){(0,u.Z)(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):T(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}var V="email",F="password";var G=function(e){var r=e.title,t=(0,d.useRouter)(),n=(0,a.useState)(null),i=n[0],o=n[1],c=(0,a.useState)({}),y=c[0],m=c[1],x=(0,l.Db)(O.ZP.sessions.useCreate(),{onSuccess:function(e){return(0,S.wD)(e,{callback:function(e){var r=e.session,t=r.token,n=r.user;(0,I.av)(n),f.Z.storeToken(t,(function(){var e="/",r=(0,R.iV)(window.location.href),t=(0,R.uM)((0,E.gR)(r,["redirect_url","access_token","provider"]));r.redirect_url&&(e="".concat(r.redirect_url,"?").concat(t)),window.location.href=e}))},onErrorCallback:function(e){var r=e.error;o(r)}})}}),T=(0,s.Z)(x,2),G=T[0],H=T[1].isLoading,L=(0,a.useCallback)((function(e){return f.Z.logout((function(){return G(e)}))}),[G]),N=O.ZP.oauths.list({redirect_uri:encodeURIComponent(window.location.href)}).data,A=(0,a.useMemo)((function(){var e;return null===N||void 0===N||null===(e=N.oauths)||void 0===e?void 0:e.reduce((function(e,r){return e[r.provider]=r,e}),{})}),[N]),U=(0,R.iV)()||{},q=U.access_token,B=U.provider;return(0,a.useEffect)((function(){var e;q&&B&&G({session:(e={},(0,u.Z)(e,"provider",B),(0,u.Z)(e,"token",q),e)})}),[q,G,B]),(0,M.jsxs)(C.X,{fullHeight:!0,children:[(0,M.jsx)(C.J,{lg:6,md:12,children:(0,M.jsx)(p.ZP,{flexDirection:"column",fullHeight:!0,fullWidth:!0,justifyContent:"center",children:(0,M.jsx)(j.Z,{px:{xl:5*w.zC,xs:w.zC},py:w.zC,children:(0,M.jsxs)(Z,{children:[(0,M.jsx)(g.Z,{yellow:!0,children:r}),(0,M.jsxs)("form",{children:[(0,M.jsxs)(j.Z,{mt:3,children:[(0,M.jsx)(v.Z,{autoComplete:"username",label:"Email",large:!0,meta:{error:" ",touched:!!i},onChange:function(e){return m((function(r){return z(z({},r),{},(0,u.Z)({},V,e.target.value))}))},primary:!i,value:y.email}),(0,M.jsx)(j.Z,{mt:2,children:(0,M.jsx)(v.Z,{autoComplete:"current-password",label:"Password",large:!0,meta:{error:" ",touched:!!i},onChange:function(e){return m((function(r){return z(z({},r),{},(0,u.Z)({},F,e.target.value))}))},primary:!i,type:"password",value:y.password})})]}),i&&(0,M.jsx)(j.Z,{mt:2,children:(0,M.jsx)(b.ZP,{danger:!0,children:i.message})}),(0,M.jsx)(j.Z,{mt:3,children:(0,M.jsx)(h.ZP,{bold:!0,inline:!0,keyTextGroups:[[_.Lz]],keyboardShortcutValidation:function(e){var r=e.keyMapping;return(0,D.y)([_.Uq],r)},large:!0,loading:H,noHoverUnderline:!0,onClick:function(){return L({session:y})},selected:!0,uuid:"SignForm/action",wind:!0,children:"Sign into Mage"})}),Object.entries(k.f).map((function(e){var r=(0,s.Z)(e,2),t=r[0],n=r[1];return(0,M.jsx)(M.Fragment,{children:(null===A||void 0===A?void 0:A[t])&&(0,M.jsx)(j.Z,{mt:4,children:(0,M.jsx)(n,{oauthResponse:null===A||void 0===A?void 0:A[t]})})})}))]})]})})})}),(0,M.jsx)(C.J,{hiddenLgDown:!0,lg:6,style:{flex:1},children:(0,M.jsx)(j.Z,{fullHeight:!0,fullWidth:!0,px:w.zC,py:w.zC+8,children:(0,M.jsx)(P,{src:"".concat(t.basePath,"/images/sessions/abstract.png"),children:"Sign in abstract image"})})})]})};function H(){return(0,M.jsx)(c.Z,{title:"Sign in",children:(0,M.jsx)(G,{title:"\ud83d\udc4b Sign in"})})}H.getInitialProps=(0,n.Z)(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",{});case 1:case"end":return e.stop()}}),e)})));var L=H},6821:function(e,r,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/sign-in",function(){return t(13180)}])}},function(e){e.O(0,[1557,9774,2888,179],(function(){return r=6821,e(e.s=r);var r}));var r=e.O();_N_E=r}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2858],{94629:function(e,n,t){"use strict";t.d(n,{Z:function(){return C}});var r=t(82394),o=t(21831),i=t(82684),l=t(50724),s=t(1402),c=t(97618),u=t(70613),a=t(31557),d=t(68899),h=t(28598);function f(e,n){var t=e.children,r=e.noPadding;return(0,h.jsx)(d.HS,{noPadding:r,ref:n,children:t})}var m=i.forwardRef(f),v=t(62547),j=t(82571),p=t(77417),x=t(46684),b=t(75375);function Z(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function g(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,r.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}function y(e,n){e.addProjectBreadcrumbToCustomBreadcrumbs;var t=e.after,r=e.afterHeader,i=e.afterHidden,f=e.afterWidth,Z=e.afterWidthOverride,y=e.appendBreadcrumbs,C=e.before,P=e.beforeHeader,_=e.beforeWidth,w=e.breadcrumbs,O=e.children,k=e.contained,M=e.errors,I=e.headerMenuItems,S=e.headerOffset,H=e.hideAfterCompletely,E=e.mainContainerHeader,A=e.navigationItems,D=e.setAfterHidden,R=e.setAfterWidth,F=e.setBeforeWidth,B=e.setErrors,N=e.subheaderChildren,V=e.subheaderNoPadding,T=e.title,U=e.uuid,L=(0,b.Z)(U,{beforeResizeOffset:b.H,setWidthAfter:R,setWidthBefore:F,widthAfter:f,widthBefore:_,widthOverrideAfter:Z}),q=L.mainContainerRef,G=L.mousedownActiveAfter,z=L.mousedownActiveBefore,W=L.setMousedownActiveAfter,Q=L.setMousedownActiveBefore,K=L.setWidthAfter,Y=L.setWidthBefore,X=L.widthAfter,J=L.widthBefore,$=(0,p.Z)().project,ee=[];return w&&ee.push.apply(ee,(0,o.Z)(w)),null!==w&&void 0!==w&&w.length&&!y||!$||null!==w&&void 0!==w&&w.length||ee.unshift({bold:!y,label:function(){return T}}),(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(u.Z,{title:T}),(0,h.jsx)(a.Z,{breadcrumbs:ee,menuItems:I}),(0,h.jsxs)(d.Nk,{ref:n,children:[0!==(null===A||void 0===A?void 0:A.length)&&(0,h.jsx)(d.lm,{showMore:!0,children:(0,h.jsx)(j.Z,{navigationItems:A,showMore:!0})}),(0,h.jsx)(c.Z,{flex:1,flexDirection:"column",children:(0,h.jsxs)(v.Z,{after:t,afterHeader:r,afterHeightOffset:x.Mz,afterHidden:i,afterMousedownActive:G,afterWidth:X,before:C,beforeHeader:P,beforeHeightOffset:x.Mz,beforeMousedownActive:z,beforeWidth:C?J:d.k1,contained:k,headerOffset:S,hideAfterCompletely:!t||H,leftOffset:C?d.k1:null,mainContainerHeader:E,mainContainerRef:q,setAfterHidden:D,setAfterMousedownActive:W,setAfterWidth:K,setBeforeMousedownActive:Q,setBeforeWidth:Y,children:[N&&(0,h.jsx)(m,{noPadding:V,children:N}),O]})})]}),M&&(0,h.jsx)(l.Z,{disableClickOutside:!0,isOpen:!0,onClickOutside:function(){return null===B||void 0===B?void 0:B(null)},children:(0,h.jsx)(s.Z,g(g({},M),{},{onClose:function(){return null===B||void 0===B?void 0:B(null)}}))})]})}var C=i.forwardRef(y)},93808:function(e,n,t){"use strict";t.d(n,{Z:function(){return O}});var r=t(77837),o=t(26304),i=t(62243),l=t(29385),s=t(80022),c=t(13692),u=t(93189),a=t(15544),d=t(82394),h=t(38860),f=t.n(h),m=t(82684),v=t(56663),j=t.n(v),p=t(40761),x=t(34661),b=t(36105),Z=t(50178),g=t(69419),y=t(28598),C=["auth"];function P(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function _(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,d.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 w(e){var n=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var t,r=(0,a.Z)(e);if(n){var o=(0,a.Z)(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return(0,u.Z)(this,t)}}function O(e){return function(n){(0,c.Z)(u,n);var t=w(u);function u(){var e;(0,i.Z)(this,u);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return e=t.call.apply(t,[this].concat(r)),(0,d.Z)((0,s.Z)(e),"state",{auth:new p.Z(e.props.token)}),e}return(0,l.Z)(u,[{key:"componentDidMount",value:function(){this.setState({auth:new p.Z(this.props.token)})}},{key:"render",value:function(){var n=this.props,t=(n.auth,(0,o.Z)(n,C));return(0,y.jsx)(e,_({auth:this.state.auth},t))}}],[{key:"getInitialProps",value:function(){var n=(0,r.Z)(f().mark((function n(t){var r,o,i,l,s,c,u,a,d;return f().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(r=j()(t),o=(0,Z.ex)(t),i=o.id,l=r[x.Mv],s=r[b.qt],c=new p.Z(l),u=_(_({},t),{},{auth:c,currentGroupId:i,theme:s}),(0,Z.YB)(t)&&c.isExpired&&(console.log("OAuth token has expired."),a=_(_({},t.query),{},{redirect_url:t.asPath}),(0,g.nL)("/sign-in?".concat((0,g.uM)(a)),t.res)),!e.getInitialProps){n.next=12;break}return n.next=10,e.getInitialProps(u);case 10:return d=n.sent,n.abrupt("return",_(_({},d),{},{auth:c,currentGroupId:i,theme:s}));case 12:return n.abrupt("return",u);case 13:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}()}]),u}(m.Component)}},91769:function(e,n,t){"use strict";t.d(n,{f:function(){return x},h:function(){return j}});var r=t(82394),o=t(82684),i=t(34376),l=t(68562),s=t(72473),c=t(70515),u=t(69419),a=t(53808),d=t(28598);var h=function(e){var n=e.oauthResponse,t=(0,i.useRouter)(),r=(0,o.useMemo)((function(){return n||{}}),[n]),h=r.url,f=r.redirect_query_params,m=void 0===f?{}:f;return(0,d.jsx)(d.Fragment,{children:h&&(0,d.jsx)(l.ZP,{beforeElement:(0,d.jsx)(s.GoogleIcon,{size:2*c.iI}),bold:!0,inline:!0,onClick:function(){var e=(0,u.iV)(h).state;(0,a.t8)(e,m),t.push(h)},uuid:"SignForm/google",children:"Sign in with Google"})})};var f=function(e){var n=e.oauthResponse,t=(0,i.useRouter)(),r=(0,o.useMemo)((function(){return n||{}}),[n]),h=r.url,f=r.redirect_query_params,m=void 0===f?{}:f;return(0,d.jsx)(d.Fragment,{children:h&&(0,d.jsx)(l.ZP,{beforeElement:(0,d.jsx)(s.MicrosoftIcon,{size:2*c.iI}),bold:!0,inline:!0,onClick:function(){var e=(0,u.iV)(h).state;m&&(0,a.t8)(e,m),t.push(h)},uuid:"SignForm/active_directory",children:"Sign in with Microsoft"})})};var m=function(e){var n=e.oauthResponse,t=(0,i.useRouter)(),r=(0,o.useMemo)((function(){return n||{}}),[n]),s=r.url,c=r.redirect_query_params,h=void 0===c?{}:c;return(0,d.jsx)(d.Fragment,{children:s&&(0,d.jsx)(l.ZP,{bold:!0,inline:!0,onClick:function(){var e=(0,u.iV)(s).state;(0,a.t8)(e,h),t.push(s)},uuid:"SignForm/oidc_generic",children:"Sign in with OIDC"})})};var v,j,p=function(e){var n=e.oauthResponse,t=(0,i.useRouter)(),r=(0,o.useMemo)((function(){return n||{}}),[n]),s=r.url,c=r.redirect_query_params,h=void 0===c?{}:c;return(0,d.jsx)(d.Fragment,{children:s&&(0,d.jsx)(l.ZP,{bold:!0,inline:!0,onClick:function(){var e=(0,u.iV)(s).state;(0,a.t8)(e,h),t.push(s)},uuid:"SignForm/okta",children:"Sign in with Okta"})})};!function(e){e.ACTIVE_DIRECTORY="active_directory",e.AZURE_DEVOPS="azure_devops",e.BITBUCKET="bitbucket",e.GITHUB="github",e.GITLAB="gitlab",e.GOOGLE="google",e.OIDC_GENERIC="oidc_generic",e.OKTA="okta"}(j||(j={}));var x=(v={},(0,r.Z)(v,j.ACTIVE_DIRECTORY,f),(0,r.Z)(v,j.GOOGLE,h),(0,r.Z)(v,j.OIDC_GENERIC,m),(0,r.Z)(v,j.OKTA,p),v)},37520:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return Ne}});var r=t(77837),o=t(38860),i=t.n(o),l=t(93808),s=t(82394),c=t(75582),u=t(82684),a=t(69864),d=t(71180),h=t(15338),f=t(55485),m=t(85854),v=t(44085),j=t(38276),p=t(4190),x=t(30160),b=t(35576),Z=t(17488),g=t(12468),y=t(35686),C=t(72473),P="clone",_="delete",w="fetch",O="merge",k="pull",M="push",I="rebase",S="git_remote_name",H="git_repository_name",E={uuid:"Branches"},A={uuid:"Commit"},D={uuid:"Push & Pull Requests"},R={uuid:"Remote & Auth"},F=[R,E,A,D],B=t(70515),N=t(81728),V=t(72619),T=t(28598);var U=function(e){var n=e.actionRemoteName,t=e.branch,r=e.branches,o=e.fetchBranch,i=e.fetchBranches,l=e.remotes,s=e.setActionRemoteName,P=e.showError,w=(0,u.useState)(""),k=w[0],M=w[1],S=(0,u.useState)(null),H=S[0],E=S[1],D=(0,u.useState)(null),F=D[0],U=D[1],L=(0,u.useState)(null),q=L[0],G=L[1],z=(0,u.useState)(""),W=z[0],Q=z[1],K=(0,u.useMemo)((function(){return null===l||void 0===l?void 0:l.find((function(e){return e.name===n}))}),[n,l]),Y=(0,u.useMemo)((function(){return(null===r||void 0===r?void 0:r.concat((null===K||void 0===K?void 0:K.refs)||[]))||[]}),[r,K]),X=(0,a.Db)(y.ZP.git_custom_branches.useCreate(),{onSuccess:function(e){return(0,V.wD)(e,{callback:function(){o(),i(),Q("")},onErrorCallback:function(e,n){return P({errors:n,response:e})}})}}),J=(0,c.Z)(X,2),$=J[0],ee=J[1].isLoading,ne=(0,a.Db)(y.ZP.git_custom_branches.useCreate(),{onSuccess:function(e){return(0,V.wD)(e,{callback:function(){o(),window.location.reload()},onErrorCallback:function(e,n){return P({errors:n,response:e})}})}}),te=(0,c.Z)(ne,2),re=te[0],oe=te[1].isLoading,ie=(0,a.Db)(y.ZP.git_custom_branches.useUpdate(null===t||void 0===t?void 0:t.name),{onSuccess:function(e){return(0,V.wD)(e,{callback:function(e){var n=e.git_custom_branch.progress;o(),M(""),E(""),U(n),G("")},onErrorCallback:function(e,n){return P({errors:n,response:e})}})}}),le=(0,c.Z)(ie,2),se=le[0],ce=le[1].isLoading;return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(j.Z,{mb:B.HN,children:[(0,T.jsxs)(m.Z,{children:["Branches",r?" (".concat(null===r||void 0===r?void 0:r.length,")"):""]}),(0,T.jsx)(j.Z,{mt:B.Mq,children:(0,T.jsxs)(f.ZP,{children:[(0,T.jsxs)("div",{children:[(0,T.jsx)(j.Z,{mb:1,children:(0,T.jsx)(x.ZP,{bold:!0,muted:!0,children:"Remote"})}),(0,T.jsx)(v.Z,{beforeIcon:(0,T.jsx)(C.MultiShare,{}),beforeIconSize:1.5*B.iI,monospace:!0,onChange:function(e){return s(e.target.value)},placeholder:"Choose a remote",value:n||"",children:null===l||void 0===l?void 0:l.map((function(e){var n=e.name;return(0,T.jsx)("option",{value:n,children:n},n)}))})]}),(0,T.jsx)(j.Z,{mr:1}),(0,T.jsxs)("div",{children:[(0,T.jsx)(j.Z,{mb:1,children:(0,T.jsx)(x.ZP,{bold:!0,muted:!0,children:"Current branch"})}),(0,T.jsxs)(f.ZP,{alignItems:"center",children:[(0,T.jsx)(g.Z,{fullSize:!0,label:"Choose a different branch to switch branches",widthFitContent:!0,children:(0,T.jsx)(v.Z,{beforeIcon:(0,T.jsx)(C.Branch,{muted:!1}),beforeIconSize:2*B.iI,monospace:!0,onChange:function(e){return re({git_custom_branch:{name:e.target.value,remote:n}})},value:null===t||void 0===t?void 0:t.name,children:(null===t||void 0===t?void 0:t.name)&&(null===Y||void 0===Y?void 0:Y.map((function(e){var n=e.name;return(0,T.jsx)("option",{value:n,children:n},n)})))})}),(0,T.jsx)(j.Z,{mr:B.cd}),oe&&(0,T.jsx)(p.Z,{inverted:!0})]})]})]})}),(0,T.jsx)(j.Z,{mt:B.Mq,children:(0,T.jsxs)(f.ZP,{alignItems:"center",children:[(0,T.jsx)(Z.Z,{label:"New branch name",monospace:!0,onChange:function(e){var n;return Q(null===e||void 0===e||null===(n=e.target)||void 0===n?void 0:n.value)},value:W||""}),(0,T.jsx)(j.Z,{mr:1}),(0,T.jsx)(d.ZP,{beforeIcon:(0,T.jsx)(C.Add,{size:2*B.iI}),disabled:!W,loading:ee,onClick:function(){$({git_custom_branch:{name:W}})},primary:!0,children:"Create new branch"})]})})]}),(0,T.jsxs)(j.Z,{mb:B.HN,children:[(0,T.jsx)(m.Z,{children:"Actions"}),(0,T.jsxs)(j.Z,{mt:B.Mq,children:[(0,T.jsxs)(j.Z,{mb:B.Mq,children:[(0,T.jsx)(j.Z,{mb:1,children:(0,T.jsx)(x.ZP,{bold:!0,muted:!0,children:"Compare branch"})}),(null===t||void 0===t?void 0:t.name)&&(0,T.jsx)(x.ZP,{monospace:!0,children:null===t||void 0===t?void 0:t.name})]}),(0,T.jsxs)(f.ZP,{alignItems:"center",children:[(0,T.jsxs)("div",{children:[(0,T.jsx)(j.Z,{mb:1,children:(0,T.jsx)(x.ZP,{bold:!0,muted:!0,children:"Base branch"})}),(0,T.jsx)(v.Z,{beforeIcon:(0,T.jsx)(C.Branch,{}),beforeIconSize:1.5*B.iI,monospace:!0,onChange:function(e){return G(e.target.value)},placeholder:"Choose a branch",value:q,children:null===Y||void 0===Y?void 0:Y.map((function(e){var n=e.name;return(0,T.jsx)("option",{value:n,children:n},n)}))})]}),(0,T.jsx)(j.Z,{mr:1}),(0,T.jsxs)("div",{children:[(0,T.jsx)(j.Z,{mb:1,children:(0,T.jsx)(x.ZP,{bold:!0,muted:!0,children:"Action"})}),(0,T.jsxs)(v.Z,{onChange:function(e){return E(e.target.value)},placeholder:"Choose action",value:H||"",children:[(0,T.jsx)("option",{value:O,children:(0,N.vg)(O)}),(0,T.jsx)("option",{value:I,children:(0,N.vg)(I)}),(0,T.jsx)("option",{value:_,children:(0,N.vg)(_)})]})]})]}),H&&[O,I].includes(H)&&(0,T.jsxs)(j.Z,{mt:B.cd,children:[(0,T.jsx)(j.Z,{mb:1,children:(0,T.jsxs)(x.ZP,{bold:!0,muted:!0,children:["Message for ",H]})}),(0,T.jsx)(b.Z,{monospace:!0,onChange:function(e){return M(e.target.value)},value:k||""})]}),(0,T.jsxs)(j.Z,{mt:B.cd,children:[(0,T.jsx)(d.ZP,{beforeIcon:(0,T.jsx)(C.Lightning,{size:2*B.iI}),disabled:!H||!q,loading:ce,onClick:function(){(_!==H||"undefined"!==typeof location&&window.confirm("Are you sure you want to delete branch ".concat(q,"?")))&&se({git_custom_branch:{action_payload:{base_branch:q},action_type:H,message:k}})},primary:!0,children:H?(0,N.vg)(H):"Execute action"}),F&&(0,T.jsx)(j.Z,{mt:B.cd,children:(0,T.jsx)(x.ZP,{default:!0,monospace:!0,preWrap:!0,children:F})})]})]})]}),(0,T.jsxs)(j.Z,{mb:B.HN,children:[(0,T.jsx)(j.Z,{mb:B.HN,children:(0,T.jsx)(h.Z,{light:!0})}),(0,T.jsxs)(f.ZP,{children:[(0,T.jsx)(d.ZP,{beforeIcon:(0,T.jsx)(C.PaginateArrowLeft,{}),linkProps:{href:"/version-control?tab=".concat(encodeURIComponent(R.uuid))},noBackground:!0,noHoverUnderline:!0,sameColorAsText:!0,children:R.uuid}),(0,T.jsx)(j.Z,{mr:1}),(0,T.jsxs)(d.ZP,{afterIcon:(0,T.jsx)(C.PaginateArrowRight,{}),linkProps:{href:"/version-control?tab=".concat(A.uuid)},noHoverUnderline:!0,sameColorAsText:!0,secondary:!0,children:["Next: ",A.uuid]})]})]})]})},L=t(90299),q=t(32013),G=t(98777),z=t(48670),W=t(75499);function Q(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function K(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Q(Object(t),!0).forEach((function(n){(0,s.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Q(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var Y={base_branch:null,body:null,compare_branch:null,repository:null,title:null};var X=function(e){var n=e.actionRemoteName,t=e.branch,r=e.branches,o=e.fetchBranch,i=e.loading,l=e.remotes,s=e.repositories,g=e.repositoryName,P=e.setActionRemoteName,_=e.setRepositoryName,w=e.showError,O=(0,u.useState)((null===t||void 0===t?void 0:t.name)||""),k=O[0],I=O[1],S=(0,u.useState)(null),H=S[0],E=S[1],D=(0,u.useState)(null),R=D[0],F=D[1],U=(0,u.useState)(Y),L=U[0],Q=U[1],X=(0,a.Db)(y.ZP.git_custom_branches.useUpdate(null===t||void 0===t?void 0:t.name),{onSuccess:function(e){return(0,V.wD)(e,{callback:function(e){var n=e.git_custom_branch,t=n.error,r=n.progress;t?(E(t),F(null)):(o(),E(null),F(r))},onErrorCallback:function(e,n){return w({errors:n,response:e})}})}}),J=(0,c.Z)(X,2),$=J[0],ee=J[1].isLoading,ne=(0,u.useMemo)((function(){var e;return null===s||void 0===s||null===(e=s.find((function(e){return e.name===g})))||void 0===e?void 0:e.url}),[s,g]),te=y.ZP.pull_requests.list({remote_url:ne,repository:g},{},{pauseFetch:!g}),re=te.data,oe=te.mutate,ie=(0,u.useMemo)((function(){return(null===re||void 0===re?void 0:re.pull_requests)||[]}),[re]),le=(0,u.useMemo)((function(){return(0,T.jsx)(W.Z,{columnFlex:[null,null,null,null],columns:[{uuid:"Title"},{uuid:"Author"},{uuid:"Created"},{uuid:"Last modified"}],onClickRow:function(e){var n,t=null===ie||void 0===ie||null===(n=ie[e])||void 0===n?void 0:n.url;t&&window.open(t,"_blank")},rows:null===ie||void 0===ie?void 0:ie.map((function(e){var n=e.created_at,t=e.last_modified,r=e.title,o=e.url,i=e.user;return[(0,T.jsx)(z.Z,{default:!0,href:o,monospace:!0,openNewWindow:!0,small:!0,children:r},"title"),(0,T.jsx)(x.ZP,{default:!0,monospace:!0,small:!0,children:i},"user"),(0,T.jsx)(x.ZP,{default:!0,monospace:!0,small:!0,children:n},"createdAt"),(0,T.jsx)(x.ZP,{default:!0,monospace:!0,small:!0,children:t||"-"},"lastModified")]})),uuid:"pull-requests"})}),[ie]),se=y.ZP.git_custom_branches.list({remote_url:ne,repository:g},{},{pauseFetch:!g}).data,ce=(0,u.useMemo)((function(){return(null===se||void 0===se?void 0:se.git_custom_branches)||[]}),[se]);(0,u.useEffect)((function(){null!==L&&void 0!==L&&L.compare_branch||null===ce||void 0===ce||!ce.find((function(e){return e.name===(null===t||void 0===t?void 0:t.name)}))||Q((function(e){return K(K({},e),{},{compare_branch:null===t||void 0===t?void 0:t.name})}))}),[t,ce,L]);var ue=(0,a.Db)(y.ZP.pull_requests.useCreate(),{onSuccess:function(e){return(0,V.wD)(e,{callback:function(){oe(),Q(Y)},onErrorCallback:function(e,n){return w({errors:n,response:e})}})}}),ae=(0,c.Z)(ue,2),de=ae[0],he=ae[1].isLoading;return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(j.Z,{mb:B.HN,children:[(0,T.jsx)(j.Z,{mb:1,children:(0,T.jsx)(m.Z,{children:(0,N.vg)(M)})}),(0,T.jsxs)(j.Z,{mt:B.Mq,children:[(0,T.jsxs)(f.ZP,{children:[(0,T.jsxs)("div",{children:[(0,T.jsx)(j.Z,{mb:1,children:(0,T.jsx)(x.ZP,{bold:!0,muted:!0,children:"Remote"})}),i&&(0,T.jsx)(p.Z,{inverted:!0}),!i&&(0,T.jsx)(v.Z,{beforeIcon:(0,T.jsx)(C.MultiShare,{}),beforeIconSize:1.5*B.iI,monospace:!0,onChange:function(e){return P(e.target.value)},placeholder:"Choose remote",value:n||"",children:null===l||void 0===l?void 0:l.map((function(e){var n=e.name;return(0,T.jsx)("option",{value:n,children:n},n)}))})]}),(0,T.jsx)(j.Z,{mr:1}),(0,T.jsxs)("div",{children:[(0,T.jsx)(j.Z,{mb:1,children:(0,T.jsx)(x.ZP,{bold:!0,muted:!0,children:"Branch"})}),(0,T.jsxs)(v.Z,{beforeIcon:(0,T.jsx)(C.Branch,{}),beforeIconSize:1.5*B.iI,monospace:!0,onChange:function(e){return I(e.target.value)},placeholder:"Choose branch",value:k||"",children:[(0,T.jsx)("option",{value:""}),null===r||void 0===r?void 0:r.map((function(e){var n=e.name;return(0,T.jsx)("option",{value:n,children:n},n)}))]})]})]}),(0,T.jsx)(j.Z,{mt:B.cd,children:(0,T.jsxs)(d.ZP,{beforeIcon:(0,T.jsx)(C.Lightning,{size:2*B.iI}),disabled:!n||!k,loading:ee,onClick:function(){F(null),$({git_custom_branch:{action_payload:{branch:k,remote:n},action_type:M}})},primary:!0,children:[(0,N.vg)(M)," ",n," ",n&&k]})}),(R||H)&&(0,T.jsx)(j.Z,{mt:B.cd,children:(0,T.jsx)(x.ZP,{danger:!!H,default:!!R,monospace:!0,preWrap:!0,children:R||H})})]})]}),(0,T.jsxs)(j.Z,{mb:B.HN,children:[(0,T.jsx)(j.Z,{mb:1,children:(0,T.jsx)(m.Z,{children:"Create pull request"})}),(0,T.jsxs)(j.Z,{mt:B.Mq,children:[i&&(0,T.jsx)(p.Z,{inverted:!0}),!i&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(f.ZP,{children:[(0,T.jsxs)("div",{children:[(0,T.jsx)(j.Z,{mb:1,children:(0,T.jsx)(x.ZP,{bold:!0,muted:!0,children:"Repository"})}),(0,T.jsx)(v.Z,{monospace:!0,onChange:function(e){return _(e.target.value)},placeholder:"Choose repository",value:g||"",children:null===s||void 0===s?void 0:s.map((function(e){var n=e.name;return(0,T.jsx)("option",{value:n,children:n},n)}))})]}),(0,T.jsx)(j.Z,{mr:1}),(0,T.jsxs)("div",{children:[(0,T.jsx)(j.Z,{mb:1,children:(0,T.jsx)(x.ZP,{bold:!0,muted:!0,children:"Base branch"})}),g&&!se&&(0,T.jsx)(p.Z,{inverted:!0}),(!g||se)&&(0,T.jsx)(v.Z,{beforeIcon:(0,T.jsx)(C.Branch,{}),beforeIconSize:1.5*B.iI,disabled:!g,monospace:!0,onChange:function(e){return Q((function(n){return K(K({},n),{},{base_branch:e.target.value})}))},placeholder:"Choose branch",value:(null===L||void 0===L?void 0:L.base_branch)||"",children:null===ce||void 0===ce?void 0:ce.map((function(e){var n=e.name;return(0,T.jsx)("option",{value:n,children:n},n)}))})]}),(0,T.jsx)(j.Z,{mr:1}),(0,T.jsxs)("div",{children:[(0,T.jsx)(j.Z,{mb:1,children:(0,T.jsx)(x.ZP,{bold:!0,muted:!0,children:"Compare branch"})}),g&&!se&&(0,T.jsx)(p.Z,{inverted:!0}),(!g||se||(null===L||void 0===L?void 0:L.compare_branch))&&(0,T.jsxs)(v.Z,{beforeIcon:(0,T.jsx)(C.Branch,{}),beforeIconSize:1.5*B.iI,disabled:!g,monospace:!0,onChange:function(e){return Q((function(n){return K(K({},n),{},{compare_branch:e.target.value})}))},placeholder:"Choose branch",value:(null===L||void 0===L?void 0:L.compare_branch)||"",children:[!(null!==ce&&void 0!==ce&&ce.length)&&(null===L||void 0===L?void 0:L.compare_branch)&&(0,T.jsx)("option",{value:null===L||void 0===L?void 0:L.compare_branch,children:null===L||void 0===L?void 0:L.compare_branch}),null===ce||void 0===ce?void 0:ce.map((function(e){var n=e.name;return(0,T.jsx)("option",{value:n,children:n},n)}))]})]})]}),(0,T.jsx)(j.Z,{mt:1,children:(0,T.jsx)(Z.Z,{label:"Title",monospace:!0,onChange:function(e){return Q((function(n){return K(K({},n),{},{title:e.target.value})}))},value:(null===L||void 0===L?void 0:L.title)||""})}),(0,T.jsx)(j.Z,{mt:1,children:(0,T.jsx)(b.Z,{label:"Description",monospace:!0,onChange:function(e){return Q((function(n){return K(K({},n),{},{body:e.target.value})}))},value:(null===L||void 0===L?void 0:L.body)||""})}),(0,T.jsx)(j.Z,{mt:B.cd,children:(0,T.jsx)(d.ZP,{beforeIcon:(0,T.jsx)(C.Lightning,{size:2*B.iI}),disabled:!g||!(null!==L&&void 0!==L&&L.title)||!(null!==L&&void 0!==L&&L.base_branch)||!(null!==L&&void 0!==L&&L.compare_branch),loading:he,onClick:function(){de({pull_request:K(K({},L),{},{remote_url:ne,repository:g})})},primary:!0,children:"Create new pull request"})})]})]}),(0,T.jsx)(j.Z,{mt:B.Mq,children:(0,T.jsx)(q.Z,{visibleMapping:{0:!g},children:(0,T.jsxs)(G.Z,{noPaddingContent:!0,title:re?"Pull requests (".concat(null===ie||void 0===ie?void 0:ie.length,")"):"Pull requests",children:[!g&&(0,T.jsx)(j.Z,{p:B.cd,children:(0,T.jsx)(x.ZP,{muted:!0,children:"Please select a repository to view open pull requests."})}),g&&(0,T.jsxs)(T.Fragment,{children:[!re&&(0,T.jsx)(j.Z,{p:B.cd,children:(0,T.jsx)(p.Z,{inverted:!0})}),re&&le]})]})})})]}),(0,T.jsxs)(j.Z,{mb:B.HN,children:[(0,T.jsx)(j.Z,{mb:B.HN,children:(0,T.jsx)(h.Z,{light:!0})}),(0,T.jsx)(f.ZP,{children:(0,T.jsx)(d.ZP,{beforeIcon:(0,T.jsx)(C.PaginateArrowLeft,{}),linkProps:{href:"/version-control?tab=".concat(A.uuid)},noBackground:!0,noHoverUnderline:!0,sameColorAsText:!0,children:A.uuid})})]})]})},J=t(94629),$=t(78650),ee=t(70652),ne=t(97618),te=t(25976),re=te.default.div.withConfig({displayName:"indexstyle__SpacingStyle",componentId:"sc-el09vr-0"})(["margin-top:","px;"],.5*B.iI),oe=t(42122);function ie(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function le(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?ie(Object(t),!0).forEach((function(n){(0,s.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ie(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var se,ce=function(e){var n=e.branch,t=e.fetchBranch,r=e.modifiedFiles,o=e.setSelectedFilePath,i=e.showError,l=e.stagedFiles,s=e.untrackedFiles,v=(0,u.useRef)(null),Z=(0,u.useState)(""),g=Z[0],P=Z[1],_=(0,u.useState)({}),w=_[0],O=_[1],k=(0,u.useState)({}),M=k[0],I=k[1],S=(0,u.useMemo)((function(){return Object.keys(r).concat(Object.keys(s)).sort()}),[r,s]),H=(0,u.useMemo)((function(){return Object.keys(l||{})}),[l]),A=(0,u.useMemo)((function(){return H.length}),[H]),R=(0,u.useMemo)((function(){return Object.keys(w).length===(null===S||void 0===S?void 0:S.length)}),[w,S]),F=(0,u.useMemo)((function(){return Object.keys(M).length===(null===H||void 0===H?void 0:H.length)}),[M,H]),U=(0,u.useMemo)((function(){return{onErrorCallback:function(e,n){return i({errors:n,response:e})}}}),[i]),L=(0,u.useMemo)((function(){return{onSuccess:function(e){return(0,V.wD)(e,le({callback:function(){t(),O({})}},U))}}}),[t,U]),Q=(0,u.useMemo)((function(){return y.ZP.git_custom_branches.useUpdate(null===n||void 0===n?void 0:n.name)}),[n]),K=(0,a.Db)(Q,L),Y=(0,c.Z)(K,2),X=Y[0],J=Y[1].isLoading,$=(0,a.Db)(Q,L),te=(0,c.Z)($,2),ie=te[0],se=te[1].isLoading,ce=(0,a.Db)(Q,{onSuccess:function(e){return(0,V.wD)(e,le({callback:function(){t(),I({})}},U))}}),ue=(0,c.Z)(ce,2),ae=ue[0],de=ue[1].isLoading,he=(0,u.useCallback)((function(e,n,t,r,o){var i=(null===e||void 0===e?void 0:e.length)>=1;return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(z.Z,{block:!0,noHoverUnderline:!0,onClick:function(){t(o?{}:r)},preventDefault:!0,children:(0,T.jsxs)(f.ZP,{alignItems:"center",flexDirection:"row",children:[(0,T.jsx)(ee.Z,{checked:i&&o,disabled:!i}),(0,T.jsx)(j.Z,{mr:1}),(0,T.jsx)(x.ZP,{bold:!0,children:i&&o?"Unselect all":"Select all"})]})}),e.map((function(e){return(0,T.jsx)(re,{children:(0,T.jsx)(z.Z,{block:!0,noHoverUnderline:!0,onClick:function(){return t((function(n){var t=le({},n);return!(null!==t&&void 0!==t&&t[e])?t[e]=!0:delete t[e],t}))},preventDefault:!0,children:(0,T.jsxs)(f.ZP,{alignItems:"center",flexDirection:"row",children:[(0,T.jsx)(ee.Z,{checked:!(null===n||void 0===n||!n[e])}),(0,T.jsx)(j.Z,{mr:1}),(0,T.jsx)(x.ZP,{default:!0,monospace:!0,children:e})]})})},e)}))]})}),[]),fe=(0,u.useMemo)((function(){return(0,oe.Qr)(w)}),[w]),me=y.ZP.git_custom_branches.detail("with_logs",{_format:"with_logs"}),ve=me.data,je=me.mutate,pe=(0,u.useMemo)((function(){var e;return(null===ve||void 0===ve||null===(e=ve.git_custom_branch)||void 0===e?void 0:e.logs)||[]}),[ve]),xe=(0,a.Db)(y.ZP.git_custom_branches.useUpdate(null===n||void 0===n?void 0:n.name),{onSuccess:function(e){return(0,V.wD)(e,{callback:function(){je(),t(),P("")},onErrorCallback:function(e,n){return i({errors:n,response:e})}})}}),be=(0,c.Z)(xe,2),Ze=be[0],ge=be[1].isLoading,ye=(0,u.useMemo)((function(){return(0,T.jsx)(W.Z,{columnFlex:[1,1,1],columns:[{uuid:"Author"},{uuid:"Date"},{uuid:"Message"}],rows:pe.map((function(e){var n=e.author,t=e.date,r=e.message;return[(0,T.jsx)(x.ZP,{default:!0,monospace:!0,small:!0,children:null===n||void 0===n?void 0:n.name},"author"),(0,T.jsx)(x.ZP,{default:!0,monospace:!0,small:!0,children:t},"date"),(0,T.jsx)(x.ZP,{default:!0,monospace:!0,small:!0,children:r},"message")]})),uuid:"git-branch-logs"})}),[pe]);return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(j.Z,{mb:B.HN,children:(0,T.jsxs)(f.ZP,{children:[(0,T.jsxs)(ne.Z,{flex:1,flexDirection:"column",children:[(0,T.jsxs)(m.Z,{children:["Not staged ",(null===S||void 0===S?void 0:S.length)>=1&&"(".concat(null===S||void 0===S?void 0:S.length,")")]}),(0,T.jsx)(j.Z,{my:B.cd,children:(0,T.jsx)(h.Z,{light:!0})}),(0,T.jsx)(j.Z,{mb:B.cd,children:(0,T.jsxs)(f.ZP,{flexDirection:"row",children:[(0,T.jsx)(d.ZP,{compact:!0,disabled:fe||de||se,loading:J,onClick:function(){X({git_custom_branch:{action_type:"add",files:Object.keys(w)}}).then((function(e){var n,t=e.data;null!==t&&void 0!==t&&t.git_custom_branch&&(null===v||void 0===v||null===(n=v.current)||void 0===n||n.focus())}))},primary:!0,children:"Add files"}),(0,T.jsx)(j.Z,{mr:1}),(0,T.jsx)(d.ZP,{compact:!0,disabled:fe||J||de,loading:se,noBackground:!0,onClick:function(){"undefined"!==typeof location&&window.confirm("Are you sure you want to undo all changes in the selected files?")&&ie({git_custom_branch:{action_type:"checkout",files:Object.keys(w)}})},children:"Checkout files"})]})}),he(S,w,O,le(le({},r),s),R)]}),(0,T.jsx)(j.Z,{mr:B.cd}),(0,T.jsxs)(ne.Z,{flex:1,flexDirection:"column",children:[(0,T.jsxs)(m.Z,{children:["Staged files ",(null===H||void 0===H?void 0:H.length)>=1&&"(".concat(null===H||void 0===H?void 0:H.length,")")]}),(0,T.jsx)(j.Z,{my:B.cd,children:(0,T.jsx)(h.Z,{light:!0})}),(0,T.jsx)(j.Z,{mb:B.cd,children:(0,T.jsx)(f.ZP,{flexDirection:"row",children:(0,T.jsx)(d.ZP,{compact:!0,disabled:(0,oe.Qr)(M)||J||se,loading:de,onClick:function(){ae({git_custom_branch:{action_type:"reset",files:Object.keys(M)}})},secondary:!0,children:"Reset files"})})}),he(H,M,I,l,F)]})]})}),(0,T.jsxs)(j.Z,{mb:B.HN,children:[(0,T.jsx)(j.Z,{mb:1,children:(0,T.jsx)(m.Z,{children:"Commit"})}),(0,T.jsx)(j.Z,{mb:B.cd,children:(0,T.jsx)(q.Z,{children:(0,T.jsx)(G.Z,{noPaddingContent:!0,title:A>=1?"Staged files (".concat(A,")"):"No staged files",children:null===H||void 0===H?void 0:H.map((function(e){return(0,T.jsx)(j.Z,{my:1,px:B.cd,children:(0,T.jsxs)(f.ZP,{justifyContent:"space-between",children:[(0,T.jsx)(z.Z,{default:!0,monospace:!0,onClick:function(){return o((function(n){return n===e?null:e}))},warning:null===r||void 0===r?void 0:r[e],children:e}),(0,T.jsx)(j.Z,{mr:1}),(null===r||void 0===r?void 0:r[e])&&(0,T.jsx)(x.ZP,{warning:!0,children:"Modified after staging"})]})},e)}))})})}),(0,T.jsx)(b.Z,{label:"Commit message",monospace:!0,onChange:function(e){return P(e.target.value)},ref:v,value:g||""}),(0,T.jsx)(j.Z,{mt:B.cd,children:(0,T.jsxs)(f.ZP,{alignItems:"center",children:[(0,T.jsxs)(d.ZP,{disabled:0===A||!((null===g||void 0===g?void 0:g.length)>=1),loading:ge,onClick:function(){Ze({git_custom_branch:{action_type:"commit",message:g}})},primary:!0,children:["Commit ",(0,N._6)("file",A,!0)," with message"]}),0===A&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(j.Z,{mr:1}),(0,T.jsx)(x.ZP,{danger:!0,small:!0,children:"Please stage at least 1 file before committing."})]})]})})]}),(0,T.jsx)(j.Z,{mb:B.HN,children:(0,T.jsx)(q.Z,{children:(0,T.jsxs)(G.Z,{noPaddingContent:!0,title:"Logs",children:[!ve&&(0,T.jsx)(j.Z,{p:B.cd,children:(0,T.jsx)(p.Z,{inverted:!0})}),ve&&ye]})})}),(0,T.jsxs)(j.Z,{mb:B.HN,children:[(0,T.jsx)(j.Z,{mb:B.HN,children:(0,T.jsx)(h.Z,{light:!0})}),(0,T.jsxs)(f.ZP,{children:[(0,T.jsx)(d.ZP,{beforeIcon:(0,T.jsx)(C.PaginateArrowLeft,{}),linkProps:{href:"/version-control?tab=".concat(E.uuid)},noBackground:!0,noHoverUnderline:!0,sameColorAsText:!0,children:E.uuid}),(0,T.jsx)(j.Z,{mr:1}),(0,T.jsxs)(d.ZP,{afterIcon:(0,T.jsx)(C.PaginateArrowRight,{}),linkProps:fe?{href:"/version-control?tab=".concat(encodeURIComponent(D.uuid))}:null,noHoverUnderline:!0,primary:fe,sameColorAsText:!0,secondary:!fe,children:["Next: ",D.uuid]})]})]})]})},ue=t(23531),ae=t(12691),de=t.n(ae),he=t(34376),fe=t(63403),me=te.default.svg.withConfig({displayName:"BitbucketWithText__SVGStyle",componentId:"sc-wdje9z-0"})([""]),ve=function(e){var n=e.fill,t=e.opacity,r=e.size,o=void 0===r?fe.C:r,i=e.style,l=e.viewBox,s=void 0===l?"0 0 299 42":l;return(0,T.jsxs)(me,{fill:n,height:o,opacity:t,style:i,viewBox:s,width:o,children:[(0,T.jsx)("path",{d:"M63.3372 2.9978H79.5353C87.4335 2.9978 91.2488 6.77741 91.2488 12.8379C91.2488 17.3994 89.1068 20.2016 84.756 21.179C90.4455 22.0914 93.3237 25.1542 93.3237 30.4978C93.3237 36.4931 89.1737 40.6637 80.4724 40.6637H63.3372V2.9978ZM68.625 19.0939H78.799C83.8191 19.0939 85.894 16.8782 85.894 13.2289C85.894 9.57954 83.6852 7.82008 78.799 7.82008H68.625V19.0939ZM68.625 23.7206V35.4504H80.673C85.7601 35.4504 88.036 33.6909 88.036 29.9113C88.036 25.871 85.827 23.7206 80.5393 23.7206H68.625Z",fill:n||"white"}),(0,T.jsx)("path",{d:"M101.958 0.977783C104.033 0.977783 105.506 2.21592 105.506 4.43157C105.506 6.58205 104.033 7.88536 101.958 7.88536C99.8833 7.88536 98.4106 6.6472 98.4106 4.43157C98.4106 2.21592 99.8833 0.977783 101.958 0.977783ZM99.3478 11.9907H104.435V40.6638H99.3478V11.9907Z",fill:n||"white"}),(0,T.jsx)("path",{d:"M123.779 36.0376C124.984 36.0376 126.055 35.7769 126.992 35.6466V40.4037C126.121 40.6643 125.117 40.8599 123.578 40.8599C117.286 40.8599 114.207 37.2756 114.207 31.9321V16.5529H109.455V11.9912H114.207V5.93091H119.16V11.9912H126.992V16.5529H119.16V31.7367C119.093 34.2781 120.633 36.0376 123.779 36.0376Z",fill:n||"white"}),(0,T.jsx)("path",{d:"M138.504 35.5806V40.5982H133.417V0H138.504V17.1386C140.378 13.359 143.926 11.4039 148.477 11.4039C156.309 11.4039 160.258 17.8554 160.258 26.3271C160.258 34.4076 156.108 41.25 147.875 41.25C143.524 41.25 140.244 39.3602 138.504 35.5806ZM147.072 16.0309C142.52 16.0309 138.504 18.8329 138.504 25.2191V27.5001C138.504 33.8863 142.186 36.6883 146.536 36.6883C152.226 36.6883 155.171 33.0392 155.171 26.3921C155.171 19.4194 152.36 16.0309 147.072 16.0309Z",fill:n||"white"}),(0,T.jsx)("path",{d:"M165.546 11.991H170.633V29.3252C170.633 34.4733 172.775 36.7541 177.594 36.7541C182.279 36.7541 185.559 33.6913 185.559 27.8915V11.991H190.647V40.664H185.559V35.972C183.685 39.3607 180.204 41.2505 176.255 41.2505C169.495 41.2505 165.613 36.6888 165.613 28.8039V11.991H165.546Z",fill:n||"white"}),(0,T.jsx)("path",{d:"M219.027 39.8814C217.287 40.7938 214.542 41.1847 211.864 41.1847C201.355 41.1847 196.469 34.9941 196.469 26.1967C196.469 17.5296 201.355 11.3389 211.864 11.3389C214.542 11.3389 216.55 11.6647 218.892 12.7072V17.2689C217.019 16.4218 215.011 15.9006 212.266 15.9006C204.636 15.9006 201.49 20.5924 201.49 26.1967C201.49 31.8009 204.702 36.4929 212.401 36.4929C215.412 36.4929 217.287 36.1018 219.092 35.4502V39.8814H219.027Z",fill:n||"white"}),(0,T.jsx)("path",{d:"M224.783 40.6635V0H229.87V25.4147L242.52 11.9904H249.147L235.29 26.0664L249.681 40.6635H242.789L229.802 27.2392V40.6635H224.783Z",fill:n||"white"}),(0,T.jsx)("path",{d:"M266.483 41.2506C255.437 41.2506 250.619 35.0599 250.619 26.2624C250.619 17.5954 255.572 11.4045 264.541 11.4045C273.644 11.4045 277.259 17.5302 277.259 26.2624V28.4781H255.773C256.51 33.3655 259.722 36.4935 266.684 36.4935C270.096 36.4935 272.974 35.8418 275.652 34.9296V39.4911C273.175 40.7944 269.494 41.2506 266.483 41.2506ZM255.706 24.2423H272.172C271.904 18.8987 269.427 15.9012 264.34 15.9012C258.919 15.9012 256.242 19.2897 255.706 24.2423Z",fill:n||"white"}),(0,T.jsx)("path",{d:"M294.929 36.0376C296.134 36.0376 297.205 35.7769 298.142 35.6466V40.4037C297.272 40.6643 296.267 40.8599 294.728 40.8599C288.437 40.8599 285.359 37.2756 285.359 31.9321V16.5529H280.606V11.9912H285.359V5.93091H290.311V11.9912H298.142V16.5529H290.311V31.7367C290.245 34.2781 291.784 36.0376 294.929 36.0376Z",fill:n||"white"}),(0,T.jsx)("path",{d:"M1.36497 4.1062C0.556341 4.1062 -0.117513 4.82301 0.0172582 5.605L5.74501 39.1654C5.87979 40.0127 6.62103 40.6642 7.56442 40.6642H34.9903C35.6641 40.6642 36.2032 40.208 36.338 39.5565L42.0658 5.605C42.2006 4.82301 41.594 4.1062 40.718 4.1062H1.36497ZM25.4889 28.3479H16.7288L14.3704 16.3573H27.6453L25.4889 28.3479Z",fill:n||"white"}),(0,T.jsx)("path",{d:"M40.2462 16.3572H27.5775L25.4886 28.3478H16.7286L6.3512 40.2079C6.3512 40.2079 6.82289 40.6641 7.56413 40.6641H34.99C35.6639 40.6641 36.2029 40.2079 36.3377 39.5562L40.2462 16.3572Z",fill:"url(#paint0_linear_13549_1163)"}),(0,T.jsx)("defs",{children:(0,T.jsxs)("linearGradient",{gradientUnits:"userSpaceOnUse",id:"paint0_linear_13549_1163",x1:"43.1513",x2:"22.7826",y1:"19.7256",y2:"36.1667",children:[(0,T.jsx)("stop",{offset:"0.176",stopColor:"#0052CC"}),(0,T.jsx)("stop",{offset:"1",stopColor:"#2684FF"})]})})]})},je=t(91769),pe=t(69419),xe=t(53808),be=(se={},(0,s.Z)(se,je.h.AZURE_DEVOPS,C.DevOpsWithText),(0,s.Z)(se,je.h.BITBUCKET,ve),(0,s.Z)(se,je.h.GITHUB,C.GitHubWithTextIcon),(0,s.Z)(se,je.h.GITLAB,C.GitLabWithTextIcon),se);function Ze(e){var n=e.isLoadingCreateOauth,t=e.oauth,r=e.provider,o=e.showError,i=(0,he.useRouter)(),l=(0,a.Db)(y.ZP.oauths.useUpdate(r),{onSuccess:function(e){return(0,V.wD)(e,{callback:function(){return window.location.href=window.location.href.split("?")[0]},onErrorCallback:function(e,n){return o({errors:n,response:e})}})}}),s=(0,c.Z)(l,2),u=s[0],h=s[1].isLoading,m=be[r];return(0,T.jsxs)(f.ZP,{justifyContent:"space-between",children:[(0,T.jsx)(ne.Z,{children:(0,T.jsx)(m,{size:12*B.iI})}),(0,T.jsx)(ne.Z,{alignItems:"center",children:null!==t&&void 0!==t&&t.authenticated?(0,T.jsx)(d.ZP,{loading:h,onClick:function(){return u({oauth:{action_type:"reset"}})},warning:!0,children:"Reset"}):(0,T.jsx)(d.ZP,{loading:n,onClick:function(){var e=null===t||void 0===t?void 0:t.url,n=(0,pe.iV)(e).state;(0,xe.t8)(n,(null===t||void 0===t?void 0:t.redirect_query_params)||{}),i.push(e)},primary:!0,children:"Authenticate"})})]})}var ge=function(e){var n=e.branch,t=e.isLoadingCreateOauth,r=e.showError,o=y.ZP.oauths.list({type:"git",redirect_uri:encodeURIComponent(window.location.href)}),i=o.data,l=(o.mutate,y.ZP.oauths.detail(je.h.GITHUB,{redirect_uri:encodeURIComponent(window.location.href)})),s=l.data,a=(l.mutate,(0,u.useMemo)((function(){return(null===s||void 0===s?void 0:s.oauth)||{}}),[s])),f=(0,u.useMemo)((function(){return null===n||void 0===n?void 0:n.access_token_exists}),[n]),v=(0,u.useMemo)((function(){var e,n=(null===i||void 0===i||null===(e=i.oauths)||void 0===e?void 0:e.reduce((function(e,n){return e[n.provider]=n,e}),{}))||{};return a&&(n[je.h.GITHUB]=a),n}),[i,a]),p=(0,u.useMemo)((function(){return Object.values(v).some((function(e){return null===e||void 0===e?void 0:e.authenticated}))}),[v]);return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(m.Z,{children:"Authentication"}),(0,T.jsxs)(j.Z,{mt:B.Mq,children:[f&&!p&&(0,T.jsxs)(j.Z,{mb:2,children:[(0,T.jsx)(d.ZP,{disabled:!0,children:"Using access token from Git Settings"}),(0,T.jsx)(j.Z,{mt:1,children:(0,T.jsx)(x.ZP,{muted:!0,children:"Some features may not work unless you authenticate with a Git client."})})]}),(0,T.jsxs)(j.Z,{mb:B.HN,children:[(0,T.jsx)(j.Z,{mb:B.Mq,children:(0,T.jsx)(x.ZP,{muted:!0,children:"Authenticating with the apps below will allow you to easily pull, push, and create pull requests."})}),(0,T.jsxs)(j.Z,{mb:B.Mq,style:{maxWidth:"600px"},children:[(0,T.jsx)(h.Z,{muted:!0}),Object.entries(v||{}).map((function(e){var n=(0,c.Z)(e,2),o=n[0],i=n[1];return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(Ze,{isLoadingCreateOauth:t,oauth:i,provider:o,showError:r},o),(0,T.jsx)(h.Z,{muted:!0})]})}))]})]})]})]})},ye=t(77417);var Ce=function(e){var n,t,r,o,i=e.actionRemoteName,l=e.branch,s=e.fetchBranch,b=e.loading,g=e.remotes,_=e.setActionRemoteName,O=e.showError,M=(0,he.useRouter)(),I=(0,ye.Z)().project,S=(0,u.useRef)(null),H=(0,u.useState)(null),A=H[0],D=H[1],R=(0,u.useState)(null),F=R[0],U=R[1],L=(0,u.useState)(null),Q=L[0],K=L[1],Y=(0,u.useState)(null),X=Y[0],J=Y[1],$=(0,u.useState)(!1),ee=$[0],te=$[1],re=(0,u.useState)(null),oe=re[0],ie=re[1],le=(0,u.useState)(""),se=le[0],ce=le[1],ue=(0,u.useState)(""),ae=ue[0],fe=ue[1],me=(0,u.useState)(null),ve=me[0],xe=me[1],be=(0,u.useMemo)((function(){return!(null===l||void 0===l||!l.name)}),[l]);(0,u.useEffect)((function(){var e,n;!ve&&(null!==l&&void 0!==l&&null!==(e=l.sync_config)&&void 0!==e&&e.repo_path||null!==I&&void 0!==I&&I.repo_path)&&xe((null===l||void 0===l||null===(n=l.sync_config)||void 0===n?void 0:n.repo_path)||(null===I||void 0===I?void 0:I.repo_path))}),[l,I,ve]);var Ze=(0,u.useMemo)((function(){var e,n;return null===g||void 0===g||null===(e=g.find((function(e){return e.name===i})))||void 0===e||null===(n=e.refs)||void 0===n?void 0:n.map((function(e){var n=e.name.split("/");return{name:n[n.length-1]}}))}),[i,g]),Ce=(0,a.Db)(y.ZP.syncs.useCreate(),{onSuccess:function(e){return(0,V.wD)(e,{callback:function(){s(),te(!1)},onErrorCallback:function(e,n){return O({errors:n,response:e})}})}}),Pe=(0,c.Z)(Ce,2),_e=Pe[0],we=Pe[1].isLoading,Oe=(0,a.Db)(y.ZP.git_custom_branches.useUpdate(null===l||void 0===l?void 0:l.name),{onSuccess:function(e){return(0,V.wD)(e,{callback:function(e){var n=e.git_custom_branch,t=n.error,r=n.progress;t?(U(t),J(null)):(s(),D(null),U(null),K(null),J(r))},onErrorCallback:function(e,n){return O({errors:n,response:e})}})}}),ke=(0,c.Z)(Oe,2),Me=ke[0],Ie=ke[1].isLoading,Se=(0,a.Db)(y.ZP.git_custom_branches.useUpdate(null===l||void 0===l?void 0:l.name),{onSuccess:function(e){return(0,V.wD)(e,{callback:function(){s(),ce(""),fe("")},onErrorCallback:function(e,n){return O({errors:n,response:e})}})}}),He=(0,c.Z)(Se,2),Ee=He[0],Ae=He[1].isLoading,De=(0,a.Db)(y.ZP.git_custom_branches.useUpdate(null===l||void 0===l?void 0:l.name),{onSuccess:function(e){return(0,V.wD)(e,{callback:function(){s(),ie(null)},onErrorCallback:function(e,n){ie(null),O({errors:n,response:e})}})}}),Re=(0,c.Z)(De,2),Fe=Re[0],Be=Re[1].isLoading,Ne=(0,a.Db)(y.ZP.oauths.useCreate(),{onSuccess:function(e){return(0,V.wD)(e,{callback:function(){return window.location.href="".concat(M.basePath,"/version-control")},onErrorCallback:function(e,n){O({errors:n,response:e})}})}}),Ve=(0,c.Z)(Ne,2),Te=Ve[0],Ue=Ve[1].isLoading,Le=(0,pe.iV)()||{},qe=Le.access_token,Ge=Le.provider,ze=Le.refresh_token,We=Le.expires_in;(0,u.useEffect)((function(){qe&&Te({oauth:{expires_in:We,provider:Ge||je.h.GITHUB,refresh_token:ze,token:qe}})}),[qe,Te,We,Ge,ze]);var Qe=(0,u.useMemo)((function(){return null===g||void 0===g?void 0:g.map((function(e){var n=e.name,t=e.refs,r=e.urls;return(0,T.jsxs)(j.Z,{mt:B.Mq,children:[(0,T.jsx)(j.Z,{mb:1,children:(0,T.jsxs)(f.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,T.jsxs)(ne.Z,{alignItems:"center",children:[(0,T.jsx)(x.ZP,{bold:!0,children:n}),(0,T.jsx)(j.Z,{mx:1,children:(0,T.jsx)(C.ChevronRight,{muted:!0})}),null===r||void 0===r?void 0:r.map((function(e){return(0,T.jsx)(j.Z,{mr:1,children:(0,T.jsx)(x.ZP,{default:!0,monospace:!0,small:!0,children:e})},e)}))]}),(0,T.jsx)(j.Z,{mr:1}),(0,T.jsx)(d.ZP,{compact:!0,disabled:Be&&oe!==n,iconOnly:!0,loading:Be&&oe===n,noBackground:!0,onClick:function(){"undefined"!==typeof location&&window.confirm("Are you sure you want to remove remote ".concat(n,"?"))&&(ie(n),Fe({git_custom_branch:{action_type:"remove_remote",action_payload:{name:n}}}).then((function(){i===n&&_(null)})))},small:!0,title:"Remote remote ".concat(n),children:(0,T.jsx)(C.Trash,{})})]})}),(0,T.jsx)(q.Z,{children:(0,T.jsxs)(G.Z,{noPaddingContent:!0,smallTitle:!0,title:"Refs (".concat(null===t||void 0===t?void 0:t.length,")"),children:[0===(null===t||void 0===t?void 0:t.length)&&(0,T.jsx)(j.Z,{p:B.cd,children:(0,T.jsx)(x.ZP,{muted:!0,children:"This remote has no refs."})}),(null===t||void 0===t?void 0:t.length)>=1&&(0,T.jsx)(W.Z,{columnFlex:[1,1,1],columns:[{uuid:"Ref"},{uuid:"Author"},{uuid:"Date"},{uuid:"Message"}],rows:t.map((function(e){var n,t=e.commit,r=e.name;return[(0,T.jsx)(x.ZP,{default:!0,monospace:!0,small:!0,children:r},"ref-name"),(0,T.jsx)(x.ZP,{default:!0,monospace:!0,small:!0,children:null===t||void 0===t||null===(n=t.author)||void 0===n?void 0:n.name},"author"),(0,T.jsx)(x.ZP,{default:!0,monospace:!0,small:!0,children:null===t||void 0===t?void 0:t.date},"date"),(0,T.jsx)(x.ZP,{default:!0,monospace:!0,small:!0,children:null===t||void 0===t?void 0:t.message},"message")]})),uuid:"git-branch-remotes-refs"})]})}),(0,T.jsx)(j.Z,{mt:B.Mq,children:(0,T.jsx)(h.Z,{light:!0})})]},n)}))}),[Be,oe,g,Fe]);return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(j.Z,{mb:B.HN,children:[(0,T.jsx)(m.Z,{children:"Setup"}),(0,T.jsxs)(j.Z,{mt:B.Mq,children:[(0,T.jsxs)(j.Z,{mb:1,children:[(0,T.jsx)(x.ZP,{bold:!0,large:!0,children:be?"Git init directory":"Initialize Git directory"}),!be&&(0,T.jsxs)(x.ZP,{muted:!0,children:["Enter the directory you want to initialize git in.",(0,T.jsx)("br",{}),"The current project directoy is filled in for you. If you want to use that, click the save button."]}),be&&(0,T.jsxs)(x.ZP,{muted:!0,children:["If the directory below is blank, then the current working directory will be used to initialize git.",(0,T.jsx)("br",{}),"If git hasn\u2019t been initialized in the directory below, Mage will automatically run git init for you."]})]}),(0,T.jsxs)(f.ZP,{alignItems:"center",children:[(0,T.jsx)(Z.Z,{disabled:be&&!ee,fullWidth:!0,label:"Git directory",maxWidth:400,monospace:!0,onChange:function(e){return xe(e.target.value)},ref:S,value:ve||""}),(0,T.jsx)(j.Z,{mr:1}),(!be||ee)&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(d.ZP,{compact:!0,disabled:!be&&!ve,loading:we,onClick:function(){_e({sync:{repo_path:ve}})},primary:!0,small:!0,children:"Save"}),be&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(j.Z,{mr:1}),(0,T.jsx)(z.Z,{onClick:function(){return te(!1)},preventDefault:!0,sameColorAsText:!0,small:!0,children:"Cancel"})]})]}),be&&!ee&&(0,T.jsx)(z.Z,{onClick:function(){te(!0),setTimeout((function(){var e;return null===S||void 0===S||null===(e=S.current)||void 0===e?void 0:e.focus()}),1)},preventDefault:!0,sameColorAsText:!0,small:!0,children:"Edit"})]})]})]}),(0,T.jsx)(j.Z,{mb:B.HN,children:(0,T.jsx)(ge,{branch:l,isLoadingCreateOauth:Ue,showError:O})}),be&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(j.Z,{mb:B.HN,children:[(0,T.jsxs)(m.Z,{children:["Remotes",!b&&g?" (".concat(null===g||void 0===g?void 0:g.length,")"):""]}),b&&(0,T.jsx)(j.Z,{mt:B.Mq,children:(0,T.jsx)(p.Z,{inverted:!0})}),!b&&Qe,(0,T.jsx)(j.Z,{mt:B.Mq,children:(0,T.jsxs)(f.ZP,{alignItems:"flex-start",children:[(0,T.jsx)(Z.Z,{label:"New remote name",monospace:!0,onChange:function(e){var n;return ce(null===e||void 0===e||null===(n=e.target)||void 0===n?void 0:n.value)},value:se||""}),(0,T.jsx)(j.Z,{mr:1}),(0,T.jsxs)(f.ZP,{flexDirection:"column",children:[(0,T.jsx)(Z.Z,{label:"Remote URL",monospace:!0,onChange:function(e){var n;return fe(null===e||void 0===e||null===(n=e.target)||void 0===n?void 0:n.value)},value:ae||""}),(0,T.jsx)(j.Z,{mt:1,children:(0,T.jsxs)(x.ZP,{muted:!0,small:!0,children:["Use the https URL if you",(0,T.jsx)("br",{}),"authenticated with GitHub above."]})})]}),(0,T.jsx)(j.Z,{mr:1}),(0,T.jsx)(d.ZP,{beforeIcon:(0,T.jsx)(C.Add,{size:2*B.iI}),disabled:!se||!ae,loading:Ae,onClick:function(){Ee({git_custom_branch:{action_type:"add_remote",action_payload:{name:se,url:ae}}})},primary:!0,children:"Create new remote"})]})})]}),(0,T.jsxs)(j.Z,{mb:B.HN,children:[(0,T.jsx)(m.Z,{children:"Actions"}),(0,T.jsxs)(j.Z,{mt:B.Mq,children:[(0,T.jsxs)(j.Z,{mb:B.Mq,children:[(0,T.jsx)(j.Z,{mb:1,children:(0,T.jsx)(x.ZP,{bold:!0,muted:!0,children:"Current branch"})}),(null===l||void 0===l?void 0:l.name)&&(0,T.jsxs)(f.ZP,{alignItems:"center",children:[(0,T.jsx)(x.ZP,{monospace:!0,children:null===l||void 0===l?void 0:l.name}),(0,T.jsx)(j.Z,{mr:B.cd}),(0,T.jsx)(de(),{href:"/version-control?tab=".concat(E.uuid),passHref:!0,children:(0,T.jsx)(z.Z,{small:!0,children:"Switch branch"})})]})]}),(0,T.jsxs)(f.ZP,{children:[(0,T.jsxs)(v.Z,{onChange:function(e){return K(e.target.value)},placeholder:"Action",value:Q||"",children:[(0,T.jsx)("option",{value:w,children:(0,N.vg)(w)}),(0,T.jsx)("option",{value:k,children:(0,N.vg)(k)}),(0,T.jsx)("option",{value:"reset",children:(0,N.vg)("reset --hard")}),(0,T.jsx)("option",{value:P,children:(0,N.vg)(P)})]}),(0,T.jsx)(j.Z,{mr:1}),(0,T.jsx)(v.Z,{beforeIcon:(0,T.jsx)(C.MultiShare,{}),beforeIconSize:1.5*B.iI,monospace:!0,onChange:function(e){return _(e.target.value)},placeholder:"Remote",value:i||"",children:null===g||void 0===g?void 0:g.map((function(e){var n=e.name;return(0,T.jsx)("option",{value:n,children:n},n)}))}),![w,P].includes(Q)&&(0,T.jsx)(j.Z,{ml:1,children:(0,T.jsxs)(v.Z,{beforeIcon:(0,T.jsx)(C.Branch,{}),beforeIconSize:1.5*B.iI,monospace:!0,onChange:function(e){return D(e.target.value)},value:A||"",children:[(0,T.jsx)("option",{value:"",children:"All branches"}),null===Ze||void 0===Ze?void 0:Ze.map((function(e){var n=e.name;return(0,T.jsx)("option",{value:n,children:n},n)}))]})})]}),P===Q&&(0,T.jsxs)(j.Z,{mt:B.cd,children:[(0,T.jsxs)(x.ZP,{muted:!0,small:!0,children:["Cloning a branch will copy all the files and folders from the remote repository and put them into the Git directory configured above:",(0,T.jsx)("br",{}),(0,T.jsx)(x.ZP,{default:!0,inline:!0,monospace:!0,small:!0,children:null===l||void 0===l||null===(n=l.sync_config)||void 0===n?void 0:n.repo_path}),"."]}),(0,T.jsx)(j.Z,{mt:1,children:(0,T.jsx)(x.ZP,{muted:!0,small:!0,children:"Cloning won\u2019t automatically create a folder that is named after the remote repository."})}),(0,T.jsx)(j.Z,{mt:1,children:(0,T.jsxs)(x.ZP,{muted:!0,small:!0,children:["For example, if you have a file named ",(0,T.jsx)(x.ZP,{default:!0,inline:!0,monospace:!0,small:!0,children:"magic.py"})," in a remote repository named ",(0,T.jsx)(x.ZP,{default:!0,inline:!0,monospace:!0,small:!0,children:"project_romeo"}),(0,T.jsx)("br",{}),"then that file will be cloned here ",(0,T.jsxs)(x.ZP,{default:!0,inline:!0,monospace:!0,small:!0,children:[null===l||void 0===l||null===(t=l.sync_config)||void 0===t?void 0:t.repo_path,"/magic.py"]}),(0,T.jsx)("br",{}),"as opposed to ",(0,T.jsxs)(x.ZP,{default:!0,inline:!0,monospace:!0,small:!0,children:[null===l||void 0===l||null===(r=l.sync_config)||void 0===r?void 0:r.repo_path,"/project_romeo/magic.py"]}),"."]})}),(0,T.jsx)(j.Z,{mt:1,children:(0,T.jsxs)(x.ZP,{muted:!0,small:!0,children:["If you want to clone the content of a remote repository into a folder named after the remote repository, then change the Git init directoy above to",(0,T.jsx)("br",{}),(0,T.jsxs)(x.ZP,{default:!0,inline:!0,monospace:!0,small:!0,children:[null===l||void 0===l||null===(o=l.sync_config)||void 0===o?void 0:o.repo_path,"/",(0,T.jsx)(x.ZP,{inline:!0,monospace:!0,small:!0,children:"[remote repository name]"})]})]})})]}),(0,T.jsxs)(j.Z,{mt:B.cd,children:[(0,T.jsx)(d.ZP,{beforeIcon:(0,T.jsx)(C.Lightning,{size:2*B.iI}),disabled:!Q||!i,loading:Ie,onClick:function(){J(null),(Q!==P||"undefined"!==typeof location&&window.confirm("Are you sure you want to clone remote ".concat(i,"? This will ")+"overwrite all your local changes and may reset any settings you may have configured for your local Git repo. This action cannot be undone."))&&Me({git_custom_branch:{action_payload:{branch:A,remote:i},action_type:Q}})},primary:!0,children:Q?(0,N.vg)(Q):"Execute action"}),(X||F)&&(0,T.jsx)(j.Z,{mt:B.cd,children:(0,T.jsx)(x.ZP,{danger:!!F,default:!!X,monospace:!0,preWrap:!0,children:X||F})})]})]})]}),(0,T.jsxs)(j.Z,{mb:B.HN,children:[(0,T.jsx)(j.Z,{mb:B.HN,children:(0,T.jsx)(h.Z,{light:!0})}),(0,T.jsx)(f.ZP,{children:(0,T.jsxs)(d.ZP,{afterIcon:(0,T.jsx)(C.PaginateArrowRight,{}),linkProps:{href:"/version-control?tab=".concat(E.uuid)},noHoverUnderline:!0,sameColorAsText:!0,secondary:!0,children:["Next: ",E.uuid]})})]})]})]})},Pe=t(93528),_e=t(98464),we=t(46684),Oe=t(53005),ke=t(15610),Me=(t(17717),t(74401)),Ie=t(86735);function Se(e,n){var t=(0,Me.a9)(e),r=Object.keys(n)||[];return null===r||void 0===r?void 0:r.find((function(e){return null===t||void 0===t?void 0:t.endsWith(e)}))}var He=t(23780);function Ee(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function Ae(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ee(Object(t),!0).forEach((function(n){(0,s.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ee(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var De="version_control/index",Re=30*B.iI;var Fe=function(){var e=(0,u.useRef)(null),n=(0,u.useRef)(null),t=(0,He.VI)(null,{},[],{uuid:"VersionControlPage"}),r=(0,c.Z)(t,1)[0],o=(0,u.useState)(!0),i=o[0],l=o[1],d=(0,u.useState)(Re),f=d[0],m=d[1],b="layout_before_".concat(De,"_width"),Z=(0,xe.U2)(b,Re),C=(0,u.useState)(Z),P=C[0],_=C[1],w=(0,u.useState)({}),O=w[0],k=w[1],M=(0,u.useState)(null),I=M[0],N=M[1],V=(0,u.useState)(null),q=V[0],G=V[1],z=(0,u.useState)(F[0]),W=z[0],Q=z[1],K=(0,u.useState)({"All projects":{uuid:"All projects"},"Git directory":{uuid:"Git directory"}}),Y=K[0],ee=K[1],ne=(0,pe.iV)();(0,u.useEffect)((function(){null!==ne&&void 0!==ne&&ne.tab&&Q(F.find((function(e){return e.uuid===(null===ne||void 0===ne?void 0:ne.tab)})))}),[ne]);var te=y.ZP.git_custom_branches.list({include_remote_branches:1}),re=te.data,ie=te.mutate,le=(0,u.useMemo)((function(){return null===re||void 0===re?void 0:re.git_custom_branches}),[re]);(0,u.useEffect)((function(){var e,n;!I&&(null===le||void 0===le?void 0:le.length)>=1&&null!==(e=le[0])&&void 0!==e&&e.name&&N(null===(n=le[0])||void 0===n?void 0:n.name)}),[I,le]);var se=y.ZP.git_custom_branches.detail("current",{_format:"with_files"}),ae=se.data,de=se.mutate,he=(0,u.useMemo)((function(){return(null===ae||void 0===ae?void 0:ae.git_custom_branch)||{}}),[ae]),fe=(0,u.useMemo)((function(){return(null===he||void 0===he?void 0:he.files)||[]}),[he]),me=y.ZP.git_custom_branches.detail("with_remotes",{_format:"with_remotes"}),ve=me.data,je=me.mutate,be=(0,u.useMemo)((function(){return null===ve||void 0===ve?void 0:ve.git_custom_branch}),[ve]),Ze=(0,u.useMemo)((function(){return(null===be||void 0===be?void 0:be.remotes)||[]}),[be]),ge=(0,u.useState)(null),ye=ge[0],Me=ge[1],Ee=(0,u.useCallback)((function(e){(0,xe.t8)(S,e),Me(e)}),[]);(0,u.useEffect)((function(){var e=(0,xe.U2)(S,null);if(ve&&e){var n=null===Ze||void 0===Ze?void 0:Ze.find((function(n){return n.name===e}));Ee(n?null===n||void 0===n?void 0:n.name:null)}}),[ve,Ze,Ee]);var Fe=(0,u.useState)((0,xe.U2)(H,"")),Be=Fe[0],Ne=Fe[1],Ve=(0,u.useCallback)((function(e){(0,xe.t8)(H,e),Ne(e)}),[]),Te=(0,u.useMemo)((function(){return(0,Ie.Tw)(Ze.reduce((function(e,n){var t;return e.concat((null===n||void 0===n||null===(t=n.repository_names)||void 0===t?void 0:t.map((function(e){var t;return{name:e,url:null===n||void 0===n||null===(t=n.urls)||void 0===t?void 0:t[0]}})))||[])}),[]),(function(e){return e.name}))}),[Ze]);(0,u.useEffect)((function(){var e=(0,xe.U2)(H,null);if(ve&&e){var n=null===Te||void 0===Te?void 0:Te.find((function(n){return n.name===e}));Ve(n?null===n||void 0===n?void 0:n.name:null)}}),[ve,Te,Ve]);var Ue=y.ZP.git_files.detail(q?encodeURIComponent(q):null,{base_branch:I}),Le=Ue.data,qe=Ue.mutate,Ge=(0,u.useMemo)((function(){return null===Le||void 0===Le?void 0:Le.git_file}),[Le]),ze=(0,_e.Z)(Ge);(0,u.useEffect)((function(){if(Ge!==ze){var e,n=null===he||void 0===he||null===(e=he.files_absolute_path)||void 0===e?void 0:e[q];k((function(e){var t;return Ae(Ae({},e),{},(0,s.Z)({},n,Ae(Ae({},Ge),{},{fullPath:n,relativePath:q,repoPath:null===he||void 0===he||null===(t=he.sync_config)||void 0===t?void 0:t.repo_path})))}))}}),[he,Ge,ze]),(0,u.useEffect)((function(){I&&qe()}),[I,qe]),(0,u.useEffect)((function(){null!==Le&&void 0!==Le&&Le.error&&r({errors:null===Le||void 0===Le?void 0:Le.error,response:Le})}),[Le,r]);var We=(0,u.useMemo)((function(){var e,n,t;return{modifiedFiles:null===he||void 0===he||null===(e=he.modified_files)||void 0===e?void 0:e.reduce((function(e,n){return Ae(Ae({},e),{},(0,s.Z)({},n,!0))}),{}),stagedFiles:null===he||void 0===he||null===(n=he.staged_files)||void 0===n?void 0:n.reduce((function(e,n){return Ae(Ae({},e),{},(0,s.Z)({},n,!0))}),{}),untrackedFiles:null===he||void 0===he||null===(t=he.untracked_files)||void 0===t?void 0:t.reduce((function(e,n){return Ae(Ae({},e),{},(0,s.Z)({},n,!0))}),{})}}),[he]),Qe=We.modifiedFiles,Ke=void 0===Qe?{}:Qe,Ye=We.stagedFiles,Xe=void 0===Ye?{}:Ye,Je=We.untrackedFiles,$e=void 0===Je?{}:Je;(0,u.useEffect)((function(){q&&(0,oe.Qr)(Ke)&&(0,oe.Qr)(Xe)&&(0,oe.Qr)($e)&&G(null)}),[Ke,q,Xe,$e]);var en=(0,u.useMemo)((function(){return(null===fe||void 0===fe?void 0:fe.length)>=1?(0,T.jsx)($.Z,{allowEmptyFolders:!0,disableContextMenu:!0,fetchFiles:de,files:fe,isFileDisabled:function(){return!1},onClickFile:function(e,t){G((function(t){if(!t||t!==e){var r;if(!I)null===n||void 0===n||null===(r=n.current)||void 0===r||r.focus();return e}return null})),qe()},ref:e,renderAfterContent:function(e){var n,t,r=e.children,o=(null===r||void 0===r?void 0:r.length)>=1,i=(0,Oe.a9)(e);o&&(i="".concat(i,"/"));var l={};return Se(e,Ke)?(n="M",t="Modified",l.warning=!0):Se(e,$e)?(n="U",t="Untracked",l.danger=!0):Se(e,Xe)&&(n="S",t="Staged",l.success=!0),o&&!n?null:(0,T.jsx)(j.Z,{mx:1,children:(0,T.jsx)(g.Z,{appearBefore:!0,label:t,widthFitContent:!0,children:(0,T.jsx)(x.ZP,Ae(Ae({},l),{},{monospace:!0,rightAligned:!0,small:!0,children:n}))})})},useRootFolder:!0,uuid:"pages/VersionControl"}):(0,T.jsx)(j.Z,{p:B.cd,children:(0,T.jsx)(x.ZP,{monospace:!0,muted:!0,children:"No files modified"})})}),[I,de,qe,e,fe,Ke,n,G,Xe,$e]),nn=((0,u.useMemo)((function(){return!Le||!Ge||q&&(null===Ge||void 0===Ge?void 0:Ge.filename)!==q}),[Le,Ge,q]),(0,u.useMemo)((function(){return ae&&null!==he&&void 0!==he&&he.name?F:F.slice(0,1)}),[he,ae])),tn=(0,u.useMemo)((function(){return(0,T.jsxs)("div",{style:{marginTop:5},children:[(0,T.jsx)(L.Z,{onClickTab:function(e){var n=e.uuid;(0,ke.u)({tab:n})},selectedTabUUID:null===W||void 0===W?void 0:W.uuid,tabs:nn,underlineStyle:!0}),(0,T.jsx)(h.Z,{light:!0})]})}),[W,nn]),rn=(0,u.useMemo)((function(){return(0,T.jsx)(Ce,{actionRemoteName:ye,branch:he,fetchBranch:function(){de(),je()},loading:!ve,remotes:Ze,setActionRemoteName:Ee,showError:r})}),[ye,he,ve,de,je,Ze,Ee,r]),on=(0,u.useMemo)((function(){return(0,T.jsx)(U,{actionRemoteName:ye,branch:he,branches:le,fetchBranch:de,fetchBranches:ie,remotes:Ze,setActionRemoteName:Ee,showError:r})}),[ye,he,le,de,ie,Ze,Ee,r]),ln=(0,u.useMemo)((function(){return(0,T.jsx)(ce,{branch:he,fetchBranch:de,modifiedFiles:Ke,setSelectedFilePath:G,showError:r,stagedFiles:Xe,untrackedFiles:$e})}),[he,de,Ke,G,r,Xe,$e]),sn=(0,u.useMemo)((function(){return(0,T.jsx)(X,{actionRemoteName:ye,branch:he,branches:le,fetchBranch:de,loading:!ve,modifiedFiles:Ke,remotes:Ze,repositories:Te,repositoryName:Be,setActionRemoteName:Ee,setRepositoryName:Ve,showError:r,stagedFiles:Xe})}),[ye,he,le,ve,de,Ke,Ze,Te,Be,Ee,Ve,r,Xe]),cn=(0,u.useMemo)((function(){return(0,T.jsx)(L.Z,{allowScroll:!0,onClickTab:function(e){ee((function(n){return Ae(Ae({},(0,oe.gR)(n,[null===e||void 0===e?void 0:e.uuid])),null!==n&&void 0!==n&&n[null===e||void 0===e?void 0:e.uuid]?{}:(0,s.Z)({},null===e||void 0===e?void 0:e.uuid,e))}))},selectedTabUUIDs:Y,tabs:[{uuid:"All projects"},{uuid:"Git directory"}],underlineStyle:!0})}),[Y]),un=(0,u.useCallback)((function(){qe()}),[qe]),an=(0,u.useCallback)((function(){de()}),[de]),dn=(0,u.useMemo)((function(){var e;if(q)return null===he||void 0===he||null===(e=he.files_absolute_path)||void 0===e?void 0:e[q]}),[he,q]),hn=(0,u.useCallback)((function(e){k((function(n){return(0,oe.gR)(n,[e])}))}),[]),fn=(0,Pe.ZP)({codeEditorMaximumHeightOffset:2*we.Mz+10,onClickTabClose:hn,onCreateFile:an,onUpdateFileSuccess:un,originalContent:O,selectedFilePath:dn,showHiddenFilesSetting:!0,uuid:"pages/VersionControlPage"}),mn=fn.browser,vn=fn.controller,jn=fn.filePaths,pn=(fn.menu,fn.selectedFilePath),xn=fn.tabs,bn=(0,a.Db)((function(e){var n=e.filePath,t=e.query;return y.ZP.git_files.detailAsync(encodeURIComponent(n),t)})),Zn=(0,c.Z)(bn,2),gn=Zn[0];Zn[1].isLoading,(0,u.useEffect)((function(){pn&&gn({filePath:pn,query:{base_branch:I,derive:!0}}).then((function(e){return k((function(n){var t;return Ae(Ae({},n),{},(0,s.Z)({},pn,null===e||void 0===e||null===(t=e.data)||void 0===t?void 0:t.git_file))}))}))}),[pn]),(0,u.useEffect)((function(){(null===jn||void 0===jn?void 0:jn.length)>=1&&l(!1)}),[jn]);var yn=(0,u.useMemo)((function(){var e=[];return"All projects"in Y&&e.push([{render:function(e){var n=e.columnWidth;return(0,T.jsx)("div",{style:{width:"".concat(n,"px")},children:mn})}}]),"Git directory"in Y&&e.push([{render:function(){return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(j.Z,{p:1,children:(0,T.jsx)(v.Z,{compact:!0,label:"Base branch",onChange:function(e){return N(e.target.value)},ref:n,small:!0,value:I||"",children:null===le||void 0===le?void 0:le.map((function(e){var n=e.name;return(0,T.jsx)("option",{value:n,children:n},n)}))})}),en]})}}]),(0,T.jsx)(ue.Z,{columnsOfItems:e,fullHeight:!0,heightOffset:2*we.Mz,uuid:"version-control-all-modified-files",width:P})}),[I,le,mn,P,en,Y]);return(0,T.jsx)(J.Z,{after:vn,afterHeader:xn,afterHidden:i,afterWidth:f,before:yn,beforeHeader:cn,beforeWidth:P,mainContainerHeader:tn,setAfterHidden:l,setAfterWidth:m,setBeforeWidth:_,title:"Version control",uuid:De,children:(0,T.jsxs)(j.Z,{p:B.cd,children:[!ae&&(0,T.jsx)(p.Z,{inverted:!0}),ae&&(0,T.jsxs)(T.Fragment,{children:[R.uuid===(null===W||void 0===W?void 0:W.uuid)&&rn,E.uuid===(null===W||void 0===W?void 0:W.uuid)&&on,A.uuid===(null===W||void 0===W?void 0:W.uuid)&&ln,D.uuid===(null===W||void 0===W?void 0:W.uuid)&&sn]})]})})};function Be(){return(0,T.jsx)(Fe,{})}Be.getInitialProps=(0,r.Z)(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",{});case 1:case"end":return e.stop()}}),e)})));var Ne=(0,l.Z)(Be)},75302:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/version-control",function(){return t(37520)}])},80022:function(e,n,t){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}t.d(n,{Z:function(){return r}})},15544:function(e,n,t){"use strict";function r(e){return r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},r(e)}t.d(n,{Z:function(){return r}})},13692:function(e,n,t){"use strict";t.d(n,{Z:function(){return o}});var r=t(61049);function o(e,n){if("function"!==typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),n&&(0,r.Z)(e,n)}},93189:function(e,n,t){"use strict";t.d(n,{Z:function(){return i}});var r=t(12539),o=t(80022);function i(e,n){if(n&&("object"===r(n)||"function"===typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return(0,o.Z)(e)}}},function(e){e.O(0,[1557,9774,2888,179],(function(){return n=75302,e(e.s=n);var n}));var n=e.O();_N_E=n}]);