mage-ai 0.9.74__py3-none-any.whl → 0.9.79__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.
Files changed (420) hide show
  1. mage_ai/ai/llm_pipeline_wizard.py +6 -4
  2. mage_ai/ai/openai_client.py +7 -5
  3. mage_ai/api/policies/PipelineSchedulePolicy.py +1 -0
  4. mage_ai/api/presenters/PipelineSchedulePresenter.py +11 -2
  5. mage_ai/api/resources/GitFileResource.py +8 -0
  6. mage_ai/api/resources/PipelineScheduleResource.py +20 -14
  7. mage_ai/api/resources/PipelineTriggerResource.py +3 -1
  8. mage_ai/api/resources/SessionResource.py +2 -2
  9. mage_ai/api/resources/SyncResource.py +1 -1
  10. mage_ai/api/resources/UserResource.py +1 -1
  11. mage_ai/cli/main.py +8 -1
  12. mage_ai/data_cleaner/analysis/charts.py +1 -1
  13. mage_ai/data_cleaner/cleaning_rules/reformat_values.py +1 -1
  14. mage_ai/data_integrations/destinations/constants.py +3 -0
  15. mage_ai/data_integrations/sources/constants.py +2 -0
  16. mage_ai/data_preparation/executors/block_executor.py +8 -3
  17. mage_ai/data_preparation/executors/pipeline_executor.py +35 -19
  18. mage_ai/data_preparation/git/utils.py +2 -2
  19. mage_ai/data_preparation/logging/logger_manager.py +31 -2
  20. mage_ai/data_preparation/models/block/__init__.py +33 -27
  21. mage_ai/data_preparation/models/block/dbt/dbt_adapter.py +20 -8
  22. mage_ai/data_preparation/models/block/dynamic/constants.py +0 -1
  23. mage_ai/data_preparation/models/block/dynamic/counter.py +1 -3
  24. mage_ai/data_preparation/models/block/outputs.py +7 -1
  25. mage_ai/data_preparation/models/block/r/__init__.py +16 -5
  26. mage_ai/data_preparation/models/block/sql/__init__.py +2 -0
  27. mage_ai/data_preparation/models/block/sql/mssql.py +8 -0
  28. mage_ai/data_preparation/models/block/sql/utils/shared.py +6 -2
  29. mage_ai/data_preparation/models/constants.py +4 -1
  30. mage_ai/data_preparation/models/pipeline.py +11 -2
  31. mage_ai/data_preparation/models/project/__init__.py +3 -1
  32. mage_ai/data_preparation/models/triggers/__init__.py +1 -1
  33. mage_ai/data_preparation/storage/local_storage.py +4 -1
  34. mage_ai/data_preparation/templates/constants.py +7 -0
  35. mage_ai/data_preparation/templates/data_exporters/streaming/elasticsearch.yaml +3 -0
  36. mage_ai/data_preparation/templates/data_loaders/airtable.py +28 -0
  37. mage_ai/data_preparation/templates/data_loaders/streaming/nats.yaml +6 -3
  38. mage_ai/data_preparation/templates/repo/io_config.yaml +2 -0
  39. mage_ai/io/airtable.py +104 -0
  40. mage_ai/io/base.py +30 -1
  41. mage_ai/io/bigquery.py +36 -0
  42. mage_ai/io/config.py +6 -0
  43. mage_ai/io/mssql.py +21 -9
  44. mage_ai/io/mysql.py +6 -1
  45. mage_ai/io/oracledb.py +2 -4
  46. mage_ai/io/postgres.py +41 -19
  47. mage_ai/io/qdrant.py +1 -1
  48. mage_ai/io/redshift.py +13 -0
  49. mage_ai/io/sql.py +1 -0
  50. mage_ai/io/utils.py +18 -0
  51. mage_ai/orchestration/db/__init__.py +23 -3
  52. mage_ai/orchestration/db/migrations/versions/39d36f1dab73_create_genericjob.py +47 -0
  53. mage_ai/orchestration/db/models/oauth.py +2 -1
  54. mage_ai/orchestration/db/models/schedules.py +108 -6
  55. mage_ai/orchestration/db/models/schedules_project_platform.py +1 -1
  56. mage_ai/orchestration/db/models/secrets.py +11 -1
  57. mage_ai/orchestration/job_manager.py +19 -0
  58. mage_ai/orchestration/metrics/pipeline_run.py +1 -1
  59. mage_ai/orchestration/notification/sender.py +2 -2
  60. mage_ai/orchestration/pipeline_scheduler_original.py +150 -6
  61. mage_ai/orchestration/pipeline_scheduler_project_platform.py +4 -5
  62. mage_ai/orchestration/queue/config.py +11 -1
  63. mage_ai/orchestration/queue/process_queue.py +4 -0
  64. mage_ai/orchestration/utils/distributed_lock.py +8 -1
  65. mage_ai/orchestration/utils/resources.py +56 -2
  66. mage_ai/sample_datasets/salary_survey.csv +52 -52
  67. mage_ai/server/api/base.py +41 -0
  68. mage_ai/server/api/constants.py +1 -0
  69. mage_ai/server/api/triggers.py +9 -0
  70. mage_ai/server/constants.py +1 -1
  71. mage_ai/server/frontend_dist/404.html +3 -3
  72. mage_ai/server/frontend_dist/_next/static/TUo4RceCdMufBTBTq8CAq/_buildManifest.js +1 -0
  73. mage_ai/server/frontend_dist/_next/static/chunks/{1187-839336d276186105.js → 1187-4560c3895e1d7099.js} +1 -1
  74. mage_ai/server/frontend_dist/_next/static/chunks/{1598-0adca9dce3ba4c60.js → 1598-cbf3f5a6078fc3f5.js} +1 -1
  75. mage_ai/server/frontend_dist/_next/static/chunks/2717-638a944d24d5abde.js +1 -0
  76. mage_ai/server/frontend_dist/_next/static/chunks/3548-36f746b1824004f2.js +1 -0
  77. mage_ai/server/frontend_dist/_next/static/chunks/{3763-39a5174f6a3924db.js → 3763-aabe2703076636b0.js} +1 -1
  78. mage_ai/server/frontend_dist/_next/static/chunks/3782-3e2acb5ed45b582b.js +1 -0
  79. mage_ai/server/frontend_dist/_next/static/chunks/449-5e2253c6aba42557.js +1 -0
  80. mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/5627-d5e559859dd0e1e0.js → frontend_dist/_next/static/chunks/5627-10e76bafa5a26f5f.js} +1 -1
  81. mage_ai/server/frontend_dist/_next/static/chunks/{5699-e49718dfc9eb2854.js → 5699-e99379e332bd0b41.js} +1 -1
  82. mage_ai/server/frontend_dist/_next/static/chunks/{7966-163da2621b8c987c.js → 7966-a5a7db345ce81263.js} +1 -1
  83. mage_ai/server/frontend_dist/_next/static/chunks/pages/_app-b697b35dfc4e6e26.js +2 -0
  84. mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/compute-ed67fa8e81662e8b.js → frontend_dist/_next/static/chunks/pages/compute-9e2dea78024e3bb4.js} +1 -1
  85. mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/files-e0ecd7ced09a63b2.js → frontend_dist/_next/static/chunks/pages/files-e08c7fe76f968f9c.js} +1 -1
  86. mage_ai/server/frontend_dist/_next/static/chunks/pages/global-data-products/{[...slug]-c7a729477ecda50e.js → [...slug]-30c3807057a4e65b.js} +1 -1
  87. mage_ai/server/frontend_dist/_next/static/chunks/pages/{global-data-products-fd6ae6a358a60a0c.js → global-data-products-8dcb3b31af9e0e39.js} +1 -1
  88. mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/global-hooks/[...slug]-8e50243797a7fe59.js → frontend_dist/_next/static/chunks/pages/global-hooks/[...slug]-85a64b64d27214b6.js} +1 -1
  89. mage_ai/server/frontend_dist/_next/static/chunks/pages/{global-hooks-d0c003446332dc0d.js → global-hooks-4ff959d51b8a9502.js} +1 -1
  90. mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/{files-a69ed8e9f814490c.js → files-d08a460641d0efaa.js} +1 -1
  91. mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/{overview-1aad7093c6d39257.js → overview-aae747f487e08d51.js} +1 -1
  92. mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/{pipeline-runs-528d30e0d13b0cc7.js → pipeline-runs-09a842d64a6ada62.js} +1 -1
  93. mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/{settings-fb9201d9cf63031d.js → settings-2e98e57d9376a458.js} +1 -1
  94. mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/users/{[user]-000f5a980a07da39.js → [user]-7be6e41ad66089bb.js} +1 -1
  95. mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/manage/users/new-e4e613f6e817a733.js → frontend_dist/_next/static/chunks/pages/manage/users/new-4c088833063bfa07.js} +1 -1
  96. mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/users-5db54821a3059c69.js +1 -0
  97. mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/manage-34d718b8a4066c23.js → frontend_dist/_next/static/chunks/pages/manage-868fcd8cbeb265f0.js} +1 -1
  98. mage_ai/server/frontend_dist/_next/static/chunks/pages/{oauth-3bfd1b8d7f036726.js → oauth-6ceceb62191dfe8a.js} +1 -1
  99. mage_ai/server/frontend_dist/_next/static/chunks/pages/overview-f65416f6dbe30ad3.js +1 -0
  100. mage_ai/server/frontend_dist/_next/static/chunks/pages/{pipeline-runs-5f8c100e648efa8a.js → pipeline-runs-2d0136b51b57de93.js} +1 -1
  101. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills/{[...slug]-688c652f3296bb9c.js → [...slug]-1ad5238742e25b4c.js} +1 -1
  102. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills-bd11e87d026bfbf9.js +1 -0
  103. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/{dashboard-1236e36d39b1637d.js → dashboard-0f4f47f721b0723f.js} +1 -1
  104. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-5ae8efe9e0530212.js +1 -0
  105. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/logs-fe91dfb0091f6bc6.js +1 -0
  106. mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runs-0d68d4bf6290fefb.js → frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runs-cf794b2d22a80f31.js} +1 -1
  107. mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-9254358d58f07714.js → frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-a964caef91bed9e1.js} +1 -1
  108. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/{monitors-821001e690caebe2.js → monitors-80bebb4401eefe25.js} +1 -1
  109. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs/[run]-2eae7cb017027682.js +1 -0
  110. mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/runs-2d4b2a0800a66b33.js → frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs-776b2e5b0b6ceba8.js} +1 -1
  111. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/settings-03d9bca3bc5e6088.js +1 -0
  112. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/syncs-707ed8ca942ca802.js +1 -0
  113. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers/{[...slug]-259143ed3cf59e31.js → [...slug]-8429f17d4146e1ec.js} +1 -1
  114. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers-193045d9836d8d80.js +1 -0
  115. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines-d25d07db166cbb04.js +1 -0
  116. mage_ai/server/frontend_dist/_next/static/chunks/pages/platform/global-hooks/{[...slug]-5eeec927e4202b63.js → [...slug]-6834ae87bd668cb2.js} +1 -1
  117. mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/platform/global-hooks-fbe9ad995d46d837.js → frontend_dist/_next/static/chunks/pages/platform/global-hooks-b3f7309a23e592b2.js} +1 -1
  118. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/account/{profile-fc659962d4015cb3.js → profile-f8b7374385e1f1bf.js} +1 -1
  119. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/platform/preferences-8de68502a9afa299.js +1 -0
  120. mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/settings/platform/settings-a4f88c334414402b.js → frontend_dist/_next/static/chunks/pages/settings/platform/settings-50fb6a34f3913f1f.js} +1 -1
  121. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/permissions/{[...slug]-4deb9579ef99a3c6.js → [...slug]-2e5c098c21ea32b7.js} +1 -1
  122. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/{permissions-e0cda2f2bfce8d61.js → permissions-54e4b15b9585bfc4.js} +1 -1
  123. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/preferences-040f83d75d0f6537.js +1 -0
  124. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/roles/{[...slug]-910257d16c604ebd.js → [...slug]-95088f43034e3c95.js} +1 -1
  125. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/{roles-4f7a0756806cee34.js → roles-e9149e1fcf218f42.js} +1 -1
  126. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/{sync-data-208d6f955204d704.js → sync-data-75b67ae4a00818ef.js} +1 -1
  127. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/users/{[...slug]-c89dc67e5a1706a8.js → [...slug]-557dda05ca6c6124.js} +1 -1
  128. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/users-fa61dc6c1370e6a5.js +1 -0
  129. mage_ai/server/frontend_dist/_next/static/chunks/pages/{sign-in-054b33312d3193c3.js → sign-in-593c40985d63fcf7.js} +1 -1
  130. mage_ai/server/frontend_dist/_next/static/chunks/pages/templates/{[...slug]-b6ed6a5d818bfd20.js → [...slug]-252c4b6b818345d5.js} +1 -1
  131. mage_ai/server/frontend_dist/_next/static/chunks/pages/{templates-852357bc983af2ea.js → templates-ca528bc607753ab8.js} +1 -1
  132. mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/terminal-1f9c56d671bbc67d.js → frontend_dist/_next/static/chunks/pages/terminal-287362c1defcc96b.js} +1 -1
  133. mage_ai/server/frontend_dist/_next/static/chunks/pages/test-2f83af8c9f1378fe.js +1 -0
  134. mage_ai/server/frontend_dist/_next/static/chunks/pages/triggers-d9de73fb799efed8.js +1 -0
  135. mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/version-control-ae3469b992a341d6.js → frontend_dist/_next/static/chunks/pages/version-control-573f0225d7a703ed.js} +1 -1
  136. mage_ai/server/frontend_dist/block-layout.html +3 -3
  137. mage_ai/server/frontend_dist/compute.html +6 -6
  138. mage_ai/server/frontend_dist/files.html +6 -6
  139. mage_ai/server/frontend_dist/global-data-products/[...slug].html +6 -6
  140. mage_ai/server/frontend_dist/global-data-products.html +6 -6
  141. mage_ai/server/frontend_dist/global-hooks/[...slug].html +6 -6
  142. mage_ai/server/frontend_dist/global-hooks.html +6 -6
  143. mage_ai/server/frontend_dist/index.html +3 -3
  144. mage_ai/server/frontend_dist/manage/files.html +6 -6
  145. mage_ai/server/frontend_dist/manage/overview.html +6 -6
  146. mage_ai/server/frontend_dist/manage/pipeline-runs.html +6 -6
  147. mage_ai/server/frontend_dist/manage/settings.html +6 -6
  148. mage_ai/server/frontend_dist/manage/users/[user].html +6 -6
  149. mage_ai/server/frontend_dist/manage/users/new.html +6 -6
  150. mage_ai/server/frontend_dist/manage/users.html +6 -6
  151. mage_ai/server/frontend_dist/manage.html +6 -6
  152. mage_ai/server/frontend_dist/oauth.html +5 -5
  153. mage_ai/server/frontend_dist/overview.html +6 -6
  154. mage_ai/server/frontend_dist/pipeline-runs.html +6 -6
  155. mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills/[...slug].html +6 -6
  156. mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills.html +6 -6
  157. mage_ai/server/frontend_dist/pipelines/[pipeline]/dashboard.html +6 -6
  158. mage_ai/server/frontend_dist/pipelines/[pipeline]/edit.html +3 -3
  159. mage_ai/server/frontend_dist/pipelines/[pipeline]/logs.html +6 -6
  160. mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runs.html +6 -6
  161. mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runtime.html +6 -6
  162. mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors.html +6 -6
  163. mage_ai/server/frontend_dist/pipelines/[pipeline]/runs/[run].html +6 -6
  164. mage_ai/server/frontend_dist/pipelines/[pipeline]/runs.html +6 -6
  165. mage_ai/server/frontend_dist/pipelines/[pipeline]/settings.html +6 -6
  166. mage_ai/server/frontend_dist/pipelines/[pipeline]/syncs.html +6 -6
  167. mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers/[...slug].html +6 -6
  168. mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers.html +6 -6
  169. mage_ai/server/frontend_dist/pipelines/[pipeline].html +3 -3
  170. mage_ai/server/frontend_dist/pipelines.html +6 -6
  171. mage_ai/server/frontend_dist/platform/global-hooks/[...slug].html +6 -6
  172. mage_ai/server/frontend_dist/platform/global-hooks.html +6 -6
  173. mage_ai/server/frontend_dist/settings/account/profile.html +6 -6
  174. mage_ai/server/frontend_dist/settings/platform/preferences.html +6 -6
  175. mage_ai/server/frontend_dist/settings/platform/settings.html +6 -6
  176. mage_ai/server/frontend_dist/settings/workspace/permissions/[...slug].html +6 -6
  177. mage_ai/server/frontend_dist/settings/workspace/permissions.html +6 -6
  178. mage_ai/server/frontend_dist/settings/workspace/preferences.html +6 -6
  179. mage_ai/server/frontend_dist/settings/workspace/roles/[...slug].html +6 -6
  180. mage_ai/server/frontend_dist/settings/workspace/roles.html +6 -6
  181. mage_ai/server/frontend_dist/settings/workspace/sync-data.html +6 -6
  182. mage_ai/server/frontend_dist/settings/workspace/users/[...slug].html +6 -6
  183. mage_ai/server/frontend_dist/settings/workspace/users.html +6 -6
  184. mage_ai/server/frontend_dist/settings.html +3 -3
  185. mage_ai/server/frontend_dist/sign-in.html +7 -7
  186. mage_ai/server/frontend_dist/templates/[...slug].html +6 -6
  187. mage_ai/server/frontend_dist/templates.html +6 -6
  188. mage_ai/server/frontend_dist/terminal.html +6 -6
  189. mage_ai/server/frontend_dist/test.html +3 -3
  190. mage_ai/server/frontend_dist/triggers.html +6 -6
  191. mage_ai/server/frontend_dist/v2/canvas.html +2 -2
  192. mage_ai/server/frontend_dist/v2.html +2 -2
  193. mage_ai/server/frontend_dist/version-control.html +6 -6
  194. mage_ai/server/frontend_dist_base_path_template/404.html +3 -3
  195. mage_ai/server/frontend_dist_base_path_template/_next/static/2QL-FT4lFR0a9bDZ7lNd9/_buildManifest.js +1 -0
  196. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{1187-839336d276186105.js → 1187-4560c3895e1d7099.js} +1 -1
  197. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{1598-0adca9dce3ba4c60.js → 1598-cbf3f5a6078fc3f5.js} +1 -1
  198. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/2717-638a944d24d5abde.js +1 -0
  199. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3548-36f746b1824004f2.js +1 -0
  200. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{3763-39a5174f6a3924db.js → 3763-aabe2703076636b0.js} +1 -1
  201. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3782-3e2acb5ed45b582b.js +1 -0
  202. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/449-5e2253c6aba42557.js +1 -0
  203. mage_ai/server/{frontend_dist/_next/static/chunks/5627-d5e559859dd0e1e0.js → frontend_dist_base_path_template/_next/static/chunks/5627-10e76bafa5a26f5f.js} +1 -1
  204. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{5699-e49718dfc9eb2854.js → 5699-e99379e332bd0b41.js} +1 -1
  205. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{7966-163da2621b8c987c.js → 7966-a5a7db345ce81263.js} +1 -1
  206. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/_app-f205accb03b9ff43.js +2 -0
  207. mage_ai/server/{frontend_dist/_next/static/chunks/pages/compute-ed67fa8e81662e8b.js → frontend_dist_base_path_template/_next/static/chunks/pages/compute-9e2dea78024e3bb4.js} +1 -1
  208. mage_ai/server/{frontend_dist/_next/static/chunks/pages/files-e0ecd7ced09a63b2.js → frontend_dist_base_path_template/_next/static/chunks/pages/files-e08c7fe76f968f9c.js} +1 -1
  209. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-data-products/{[...slug]-c7a729477ecda50e.js → [...slug]-30c3807057a4e65b.js} +1 -1
  210. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{global-data-products-fd6ae6a358a60a0c.js → global-data-products-8dcb3b31af9e0e39.js} +1 -1
  211. mage_ai/server/{frontend_dist/_next/static/chunks/pages/global-hooks/[...slug]-8e50243797a7fe59.js → frontend_dist_base_path_template/_next/static/chunks/pages/global-hooks/[...slug]-85a64b64d27214b6.js} +1 -1
  212. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{global-hooks-d0c003446332dc0d.js → global-hooks-4ff959d51b8a9502.js} +1 -1
  213. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/{files-a69ed8e9f814490c.js → files-d08a460641d0efaa.js} +1 -1
  214. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/{overview-1aad7093c6d39257.js → overview-aae747f487e08d51.js} +1 -1
  215. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/{pipeline-runs-528d30e0d13b0cc7.js → pipeline-runs-09a842d64a6ada62.js} +1 -1
  216. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/{settings-fb9201d9cf63031d.js → settings-2e98e57d9376a458.js} +1 -1
  217. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/users/{[user]-000f5a980a07da39.js → [user]-7be6e41ad66089bb.js} +1 -1
  218. mage_ai/server/{frontend_dist/_next/static/chunks/pages/manage/users/new-e4e613f6e817a733.js → frontend_dist_base_path_template/_next/static/chunks/pages/manage/users/new-4c088833063bfa07.js} +1 -1
  219. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/users-5db54821a3059c69.js +1 -0
  220. mage_ai/server/{frontend_dist/_next/static/chunks/pages/manage-34d718b8a4066c23.js → frontend_dist_base_path_template/_next/static/chunks/pages/manage-868fcd8cbeb265f0.js} +1 -1
  221. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{oauth-3bfd1b8d7f036726.js → oauth-6ceceb62191dfe8a.js} +1 -1
  222. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/overview-f65416f6dbe30ad3.js +1 -0
  223. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{pipeline-runs-5f8c100e648efa8a.js → pipeline-runs-2d0136b51b57de93.js} +1 -1
  224. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills/{[...slug]-688c652f3296bb9c.js → [...slug]-1ad5238742e25b4c.js} +1 -1
  225. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills-bd11e87d026bfbf9.js +1 -0
  226. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/{dashboard-1236e36d39b1637d.js → dashboard-0f4f47f721b0723f.js} +1 -1
  227. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/edit-5ae8efe9e0530212.js +1 -0
  228. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/logs-fe91dfb0091f6bc6.js +1 -0
  229. mage_ai/server/{frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runs-0d68d4bf6290fefb.js → frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runs-cf794b2d22a80f31.js} +1 -1
  230. mage_ai/server/{frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-9254358d58f07714.js → frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-a964caef91bed9e1.js} +1 -1
  231. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/{monitors-821001e690caebe2.js → monitors-80bebb4401eefe25.js} +1 -1
  232. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/runs/[run]-2eae7cb017027682.js +1 -0
  233. mage_ai/server/{frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs-2d4b2a0800a66b33.js → frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/runs-776b2e5b0b6ceba8.js} +1 -1
  234. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/settings-03d9bca3bc5e6088.js +1 -0
  235. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/syncs-707ed8ca942ca802.js +1 -0
  236. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers/{[...slug]-259143ed3cf59e31.js → [...slug]-8429f17d4146e1ec.js} +1 -1
  237. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers-193045d9836d8d80.js +1 -0
  238. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines-d25d07db166cbb04.js +1 -0
  239. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/platform/global-hooks/{[...slug]-5eeec927e4202b63.js → [...slug]-6834ae87bd668cb2.js} +1 -1
  240. mage_ai/server/{frontend_dist/_next/static/chunks/pages/platform/global-hooks-fbe9ad995d46d837.js → frontend_dist_base_path_template/_next/static/chunks/pages/platform/global-hooks-b3f7309a23e592b2.js} +1 -1
  241. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/account/{profile-fc659962d4015cb3.js → profile-f8b7374385e1f1bf.js} +1 -1
  242. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/platform/preferences-8de68502a9afa299.js +1 -0
  243. mage_ai/server/{frontend_dist/_next/static/chunks/pages/settings/platform/settings-a4f88c334414402b.js → frontend_dist_base_path_template/_next/static/chunks/pages/settings/platform/settings-50fb6a34f3913f1f.js} +1 -1
  244. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/permissions/{[...slug]-4deb9579ef99a3c6.js → [...slug]-2e5c098c21ea32b7.js} +1 -1
  245. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/{permissions-e0cda2f2bfce8d61.js → permissions-54e4b15b9585bfc4.js} +1 -1
  246. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/preferences-040f83d75d0f6537.js +1 -0
  247. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/roles/{[...slug]-910257d16c604ebd.js → [...slug]-95088f43034e3c95.js} +1 -1
  248. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/{roles-4f7a0756806cee34.js → roles-e9149e1fcf218f42.js} +1 -1
  249. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/{sync-data-208d6f955204d704.js → sync-data-75b67ae4a00818ef.js} +1 -1
  250. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/users/{[...slug]-c89dc67e5a1706a8.js → [...slug]-557dda05ca6c6124.js} +1 -1
  251. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/users-fa61dc6c1370e6a5.js +1 -0
  252. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{sign-in-054b33312d3193c3.js → sign-in-593c40985d63fcf7.js} +1 -1
  253. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/templates/{[...slug]-b6ed6a5d818bfd20.js → [...slug]-252c4b6b818345d5.js} +1 -1
  254. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{templates-852357bc983af2ea.js → templates-ca528bc607753ab8.js} +1 -1
  255. mage_ai/server/{frontend_dist/_next/static/chunks/pages/terminal-1f9c56d671bbc67d.js → frontend_dist_base_path_template/_next/static/chunks/pages/terminal-287362c1defcc96b.js} +1 -1
  256. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/test-2f83af8c9f1378fe.js +1 -0
  257. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/triggers-d9de73fb799efed8.js +1 -0
  258. mage_ai/server/{frontend_dist/_next/static/chunks/pages/version-control-ae3469b992a341d6.js → frontend_dist_base_path_template/_next/static/chunks/pages/version-control-573f0225d7a703ed.js} +1 -1
  259. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{webpack-12ad70eb5c31aa92.js → webpack-5f4be622608d9267.js} +1 -1
  260. mage_ai/server/frontend_dist_base_path_template/block-layout.html +3 -3
  261. mage_ai/server/frontend_dist_base_path_template/compute.html +6 -6
  262. mage_ai/server/frontend_dist_base_path_template/files.html +6 -6
  263. mage_ai/server/frontend_dist_base_path_template/global-data-products/[...slug].html +6 -6
  264. mage_ai/server/frontend_dist_base_path_template/global-data-products.html +6 -6
  265. mage_ai/server/frontend_dist_base_path_template/global-hooks/[...slug].html +6 -6
  266. mage_ai/server/frontend_dist_base_path_template/global-hooks.html +6 -6
  267. mage_ai/server/frontend_dist_base_path_template/index.html +3 -3
  268. mage_ai/server/frontend_dist_base_path_template/manage/files.html +6 -6
  269. mage_ai/server/frontend_dist_base_path_template/manage/overview.html +6 -6
  270. mage_ai/server/frontend_dist_base_path_template/manage/pipeline-runs.html +6 -6
  271. mage_ai/server/frontend_dist_base_path_template/manage/settings.html +6 -6
  272. mage_ai/server/frontend_dist_base_path_template/manage/users/[user].html +6 -6
  273. mage_ai/server/frontend_dist_base_path_template/manage/users/new.html +6 -6
  274. mage_ai/server/frontend_dist_base_path_template/manage/users.html +6 -6
  275. mage_ai/server/frontend_dist_base_path_template/manage.html +6 -6
  276. mage_ai/server/frontend_dist_base_path_template/oauth.html +5 -5
  277. mage_ai/server/frontend_dist_base_path_template/overview.html +6 -6
  278. mage_ai/server/frontend_dist_base_path_template/pipeline-runs.html +6 -6
  279. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills/[...slug].html +6 -6
  280. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills.html +6 -6
  281. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/dashboard.html +6 -6
  282. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/edit.html +3 -3
  283. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/logs.html +6 -6
  284. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runs.html +6 -6
  285. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runtime.html +6 -6
  286. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors.html +6 -6
  287. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs/[run].html +6 -6
  288. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs.html +6 -6
  289. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/settings.html +6 -6
  290. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/syncs.html +6 -6
  291. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers/[...slug].html +6 -6
  292. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers.html +6 -6
  293. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline].html +3 -3
  294. mage_ai/server/frontend_dist_base_path_template/pipelines.html +6 -6
  295. mage_ai/server/frontend_dist_base_path_template/platform/global-hooks/[...slug].html +6 -6
  296. mage_ai/server/frontend_dist_base_path_template/platform/global-hooks.html +6 -6
  297. mage_ai/server/frontend_dist_base_path_template/settings/account/profile.html +6 -6
  298. mage_ai/server/frontend_dist_base_path_template/settings/platform/preferences.html +6 -6
  299. mage_ai/server/frontend_dist_base_path_template/settings/platform/settings.html +6 -6
  300. mage_ai/server/frontend_dist_base_path_template/settings/workspace/permissions/[...slug].html +6 -6
  301. mage_ai/server/frontend_dist_base_path_template/settings/workspace/permissions.html +6 -6
  302. mage_ai/server/frontend_dist_base_path_template/settings/workspace/preferences.html +6 -6
  303. mage_ai/server/frontend_dist_base_path_template/settings/workspace/roles/[...slug].html +6 -6
  304. mage_ai/server/frontend_dist_base_path_template/settings/workspace/roles.html +6 -6
  305. mage_ai/server/frontend_dist_base_path_template/settings/workspace/sync-data.html +6 -6
  306. mage_ai/server/frontend_dist_base_path_template/settings/workspace/users/[...slug].html +6 -6
  307. mage_ai/server/frontend_dist_base_path_template/settings/workspace/users.html +6 -6
  308. mage_ai/server/frontend_dist_base_path_template/settings.html +3 -3
  309. mage_ai/server/frontend_dist_base_path_template/sign-in.html +7 -7
  310. mage_ai/server/frontend_dist_base_path_template/templates/[...slug].html +6 -6
  311. mage_ai/server/frontend_dist_base_path_template/templates.html +6 -6
  312. mage_ai/server/frontend_dist_base_path_template/terminal.html +6 -6
  313. mage_ai/server/frontend_dist_base_path_template/test.html +3 -3
  314. mage_ai/server/frontend_dist_base_path_template/triggers.html +6 -6
  315. mage_ai/server/frontend_dist_base_path_template/v2/canvas.html +2 -2
  316. mage_ai/server/frontend_dist_base_path_template/v2.html +2 -2
  317. mage_ai/server/frontend_dist_base_path_template/version-control.html +6 -6
  318. mage_ai/server/scheduler_manager.py +2 -0
  319. mage_ai/server/server.py +13 -0
  320. mage_ai/server/terminal_server.py +3 -0
  321. mage_ai/server/utils/output_display.py +5 -3
  322. mage_ai/services/aws/events/events.py +2 -2
  323. mage_ai/services/gcp/cloud_run/cloud_run.py +1 -1
  324. mage_ai/services/teams/config.py +13 -2
  325. mage_ai/services/teams/teams.py +13 -11
  326. mage_ai/settings/server.py +12 -1
  327. mage_ai/shared/constants.py +3 -1
  328. mage_ai/shared/croniter.py +1398 -0
  329. mage_ai/shared/enum.py +2 -5
  330. mage_ai/shared/environments.py +27 -3
  331. mage_ai/streaming/sinks/elasticsearch.py +15 -5
  332. mage_ai/streaming/sinks/kafka.py +21 -3
  333. mage_ai/streaming/sources/kafka.py +64 -7
  334. mage_ai/streaming/sources/kafka_oauth.py +182 -0
  335. mage_ai/tests/api/endpoints/test_blocks.py +1 -101
  336. mage_ai/tests/api/endpoints/test_configuration_options.py +1 -48
  337. mage_ai/tests/api/endpoints/test_configuration_options_project_platform.py +68 -0
  338. mage_ai/tests/api/endpoints/test_custom_designs.py +1 -106
  339. mage_ai/tests/api/endpoints/test_custom_designs_project_platform.py +132 -0
  340. mage_ai/tests/api/endpoints/test_dbt_blocks.py +111 -0
  341. mage_ai/tests/api/endpoints/test_file_contents.py +0 -48
  342. mage_ai/tests/api/endpoints/test_file_contents_with_project_platform.py +66 -0
  343. mage_ai/tests/api/endpoints/test_pipelines.py +0 -134
  344. mage_ai/tests/api/endpoints/test_pipelines_with_project_platform.py +143 -0
  345. mage_ai/tests/data_preparation/executors/test_block_executor.py +3 -3
  346. mage_ai/tests/data_preparation/logging/test_logger_manager.py +24 -5
  347. mage_ai/tests/data_preparation/models/block/dynamic/test_counter.py +1 -3
  348. mage_ai/tests/data_preparation/models/block/hook/test_hook_block.py +3 -3
  349. mage_ai/tests/data_preparation/models/test_block.py +7 -0
  350. mage_ai/tests/data_preparation/models/test_pipeline.py +55 -0
  351. mage_ai/tests/data_preparation/models/test_variable.py +2 -0
  352. mage_ai/tests/data_preparation/test_repo_manager.py +0 -63
  353. mage_ai/tests/data_preparation/test_repo_manager_project_platform.py +67 -0
  354. mage_ai/tests/data_preparation/test_variable_manager.py +0 -51
  355. mage_ai/tests/data_preparation/test_variable_manager_project_platform.py +41 -0
  356. mage_ai/tests/io/create_table/test_postgresql.py +28 -0
  357. mage_ai/tests/orchestration/db/models/test_schedules.py +1 -1
  358. mage_ai/tests/orchestration/notification/test_config.py +3 -3
  359. mage_ai/tests/orchestration/notification/test_sender.py +5 -1
  360. mage_ai/tests/orchestration/utils/__init__.py +0 -0
  361. mage_ai/tests/orchestration/utils/test_resources.py +235 -0
  362. mage_ai/tests/shared/test_croniter.py +2541 -0
  363. mage_ai/tests/streaming/sinks/test_kafka.py +130 -0
  364. mage_ai/tests/streaming/sources/test_kafka.py +125 -3
  365. mage_ai/tests/streaming/sources/test_kafka_oauth.py +208 -0
  366. mage_ai/tests/streaming/sources/test_kafka_raw_value.py +105 -0
  367. mage_ai/usage_statistics/logger.py +99 -15
  368. mage_ai-0.9.79.dist-info/METADATA +358 -0
  369. {mage_ai-0.9.74.dist-info → mage_ai-0.9.79.dist-info}/RECORD +377 -359
  370. {mage_ai-0.9.74.dist-info → mage_ai-0.9.79.dist-info}/WHEEL +1 -1
  371. mage_ai/server/frontend_dist/_next/static/chunks/1557-1ad0c64c2d08e569.js +0 -1
  372. mage_ai/server/frontend_dist/_next/static/chunks/2717-d65056b6b5e124eb.js +0 -1
  373. mage_ai/server/frontend_dist/_next/static/chunks/3548-b2c5edfb710886a6.js +0 -1
  374. mage_ai/server/frontend_dist/_next/static/chunks/3782-4b3091e550f809a2.js +0 -1
  375. mage_ai/server/frontend_dist/_next/static/chunks/pages/_app-5bdff745074fb350.js +0 -2
  376. mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/users-a5e9d77ed5b50205.js +0 -1
  377. mage_ai/server/frontend_dist/_next/static/chunks/pages/overview-69af3253ad0d0d89.js +0 -1
  378. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills-fe112809feb25b05.js +0 -1
  379. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-e9ca358209cdf93d.js +0 -1
  380. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/logs-a29f1615d2e7d330.js +0 -1
  381. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs/[run]-6d382ae5bad9745c.js +0 -1
  382. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/settings-cd49372ae1702963.js +0 -1
  383. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/syncs-135be8974f7f5f2b.js +0 -1
  384. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers-3af13e89adff4d6c.js +0 -1
  385. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines-b578b075a8d857e3.js +0 -1
  386. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/platform/preferences-058d283ee178c038.js +0 -1
  387. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/preferences-7b02bb70462144cb.js +0 -1
  388. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/users-5212c01a9dc558da.js +0 -1
  389. mage_ai/server/frontend_dist/_next/static/chunks/pages/test-86b12cc12d4a625f.js +0 -1
  390. mage_ai/server/frontend_dist/_next/static/chunks/pages/triggers-2481c40b18d5b6d4.js +0 -1
  391. mage_ai/server/frontend_dist/_next/static/pLWT6Sqd09xYpufCVIqnz/_buildManifest.js +0 -1
  392. mage_ai/server/frontend_dist_base_path_template/_next/static/JQewSAObpbhO0wrdAM6Ng/_buildManifest.js +0 -1
  393. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1557-1ad0c64c2d08e569.js +0 -1
  394. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/2717-d65056b6b5e124eb.js +0 -1
  395. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3548-b2c5edfb710886a6.js +0 -1
  396. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3782-4b3091e550f809a2.js +0 -1
  397. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/_app-90de19bc03f1484b.js +0 -2
  398. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/users-a5e9d77ed5b50205.js +0 -1
  399. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/overview-69af3253ad0d0d89.js +0 -1
  400. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills-fe112809feb25b05.js +0 -1
  401. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/edit-e9ca358209cdf93d.js +0 -1
  402. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/logs-a29f1615d2e7d330.js +0 -1
  403. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/runs/[run]-6d382ae5bad9745c.js +0 -1
  404. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/settings-cd49372ae1702963.js +0 -1
  405. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/syncs-135be8974f7f5f2b.js +0 -1
  406. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers-3af13e89adff4d6c.js +0 -1
  407. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines-b578b075a8d857e3.js +0 -1
  408. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/platform/preferences-058d283ee178c038.js +0 -1
  409. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/preferences-7b02bb70462144cb.js +0 -1
  410. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/users-5212c01a9dc558da.js +0 -1
  411. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/test-86b12cc12d4a625f.js +0 -1
  412. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/triggers-2481c40b18d5b6d4.js +0 -1
  413. mage_ai-0.9.74.dist-info/METADATA +0 -544
  414. /mage_ai/server/frontend_dist/_next/static/{pLWT6Sqd09xYpufCVIqnz → TUo4RceCdMufBTBTq8CAq}/_ssgManifest.js +0 -0
  415. /mage_ai/server/frontend_dist/_next/static/chunks/pages/{_app-5bdff745074fb350.js.LICENSE.txt → _app-b697b35dfc4e6e26.js.LICENSE.txt} +0 -0
  416. /mage_ai/server/frontend_dist_base_path_template/_next/static/{JQewSAObpbhO0wrdAM6Ng → 2QL-FT4lFR0a9bDZ7lNd9}/_ssgManifest.js +0 -0
  417. /mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{_app-90de19bc03f1484b.js.LICENSE.txt → _app-f205accb03b9ff43.js.LICENSE.txt} +0 -0
  418. {mage_ai-0.9.74.dist-info → mage_ai-0.9.79.dist-info}/entry_points.txt +0 -0
  419. {mage_ai-0.9.74.dist-info → mage_ai-0.9.79.dist-info/licenses}/LICENSE +0 -0
  420. {mage_ai-0.9.74.dist-info → mage_ai-0.9.79.dist-info}/top_level.txt +0 -0
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3512],{27216:function(t,e,n){"use strict";n.r(e);var r=n(77837),u=n(38860),o=n.n(u),i=n(82684),c=n(43449),a=n(93808),s=n(59533),f=n(75083),l=n(28598);function p(){var t=(0,i.useState)(null),e=t[0];t[1];return(0,l.jsx)(s.Z,{breadcrumbs:[{label:function(){return"Workspaces"},linkProps:{as:"/manage",href:"/manage"}},{bold:!0,label:function(){return"Settings"}}],errors:e,pageName:f.L6.SETTINGS,children:(0,l.jsx)(c.Z,{active:!0,filePath:"metadata.yaml",selectedFilePath:"metadata.yaml",setFilesTouched:function(){return null}})})}p.getInitialProps=(0,r.Z)(o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",{});case 1:case"end":return t.stop()}}),t)}))),e.default=(0,a.Z)(p)},1116:function(t,e,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/manage/settings",function(){return n(27216)}])},80022:function(t,e,n){"use strict";function r(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}n.d(e,{Z:function(){return r}})},15544:function(t,e,n){"use strict";function r(t){return r=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},r(t)}n.d(e,{Z:function(){return r}})},13692:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(61049);function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&(0,r.Z)(t,e)}},93189:function(t,e,n){"use strict";n.d(e,{Z:function(){return o}});var r=n(12539),u=n(80022);function o(t,e){if(e&&("object"===r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return(0,u.Z)(t)}}},function(t){t.O(0,[1557,1598,9774,2888,179],(function(){return e=1116,t(t.s=e);var e}));var e=t.O();_N_E=e}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3512],{27216:function(t,e,n){"use strict";n.r(e);var r=n(77837),u=n(38860),o=n.n(u),i=n(82684),c=n(43449),a=n(93808),s=n(59533),f=n(75083),l=n(28598);function p(){var t=(0,i.useState)(null),e=t[0];t[1];return(0,l.jsx)(s.Z,{breadcrumbs:[{label:function(){return"Workspaces"},linkProps:{as:"/manage",href:"/manage"}},{bold:!0,label:function(){return"Settings"}}],errors:e,pageName:f.L6.SETTINGS,children:(0,l.jsx)(c.Z,{active:!0,filePath:"metadata.yaml",selectedFilePath:"metadata.yaml",setFilesTouched:function(){return null}})})}p.getInitialProps=(0,r.Z)(o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",{});case 1:case"end":return t.stop()}}),t)}))),e.default=(0,a.Z)(p)},1116:function(t,e,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/manage/settings",function(){return n(27216)}])},80022:function(t,e,n){"use strict";function r(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}n.d(e,{Z:function(){return r}})},15544:function(t,e,n){"use strict";function r(t){return r=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},r(t)}n.d(e,{Z:function(){return r}})},13692:function(t,e,n){"use strict";n.d(e,{Z:function(){return u}});var r=n(61049);function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&(0,r.Z)(t,e)}},93189:function(t,e,n){"use strict";n.d(e,{Z:function(){return o}});var r=n(12539),u=n(80022);function o(t,e){if(e&&("object"===r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return(0,u.Z)(t)}}},function(t){t.O(0,[449,1598,9774,2888,179],(function(){return e=1116,t(t.s=e);var e}));var e=t.O();_N_E=e}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4496],{55072:function(e,n,r){"use strict";r.d(n,{Et:function(){return f},Q:function(){return d}});r(82684);var t=r(71180),o=r(55485),u=r(38276),s=r(31748),i=r(72473),l=r(79633),a=r(70515),c=r(28598),d=30,f=9;n.ZP=function(e){var n=e.page,r=e.maxPages,d=e.onUpdate,f=e.totalPages,p=[],m=r;if(m>f)p=Array.from({length:f},(function(e,n){return n}));else{var v=Math.floor(m/2),h=n-v;n+v>=f?(h=f-m+2,m-=2):n-v<=0?(h=0,m-=2):(m-=4,h=n-Math.floor(m/2)),p=Array.from({length:m},(function(e,n){return n+h}))}return(0,c.jsx)(c.Fragment,{children:f>0&&(0,c.jsxs)(o.ZP,{alignItems:"center",children:[(0,c.jsx)(t.ZP,{disabled:0===n,onClick:function(){return d(n-1)},children:(0,c.jsx)(i.PaginateArrowLeft,{size:1.5*a.iI,stroke:s.Av})}),!p.includes(0)&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(u.Z,{ml:1,children:(0,c.jsx)(t.ZP,{borderLess:!0,noBackground:!0,onClick:function(){return d(0)},children:1})},0),!p.includes(1)&&(0,c.jsx)(u.Z,{ml:1,children:(0,c.jsx)(t.ZP,{noBackground:!0,noPadding:!0,notClickable:!0,children:"..."})},0)]}),p.map((function(e){return(0,c.jsx)(u.Z,{ml:1,children:(0,c.jsx)(t.ZP,{backgroundColor:e===n&&l.a$,borderLess:!0,noBackground:!0,notClickable:e===n,onClick:function(){e!==n&&d(e)},children:e+1})},e)})),!p.includes(f-1)&&(0,c.jsxs)(c.Fragment,{children:[!p.includes(f-2)&&(0,c.jsx)(u.Z,{ml:1,children:(0,c.jsx)(t.ZP,{noBackground:!0,noPadding:!0,notClickable:!0,children:"..."})},0),(0,c.jsx)(u.Z,{ml:1,children:(0,c.jsx)(t.ZP,{borderLess:!0,noBackground:!0,onClick:function(){return d(f-1)},children:f})},f-1)]}),(0,c.jsx)(u.Z,{ml:1}),(0,c.jsx)(t.ZP,{disabled:n===f-1,onClick:function(){return d(n+1)},children:(0,c.jsx)(i.PaginateArrowRight,{size:1.5*a.iI,stroke:s.Av})})]})})}},14875:function(e,n,r){"use strict";r.d(n,{Z3:function(){return t},ms:function(){return u},s7:function(){return o}});var t=[{autoComplete:"username",label:"Username",required:!0,uuid:"username"},{autoComplete:"email",disabled:!1,label:"Email",required:!0,type:"email",uuid:"email"}],o="password_current",u=[{autoComplete:"current-password",label:"Current password",type:"password",uuid:o},{autoComplete:"new-password",label:"New password",type:"password",uuid:"password"},{autoComplete:"new-password",label:"Confirm new password",type:"password",uuid:"password_confirmation"}]},36043:function(e,n,r){"use strict";var t=r(82394),o=r(21831),u=r(75582),s=r(21764),i=r(82684),l=r(83455),a=r(71180),c=r(31882),d=r(55485),f=r(85854),p=r(44085),m=r(38276),v=r(30160),h=r(17488),b=r(35686),w=r(50018),j=r(98464),g=r(82359),Z=r(14875),x=r(86735),y=r(42122),P=r(72619),O=r(28598);function _(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 k(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?_(Object(r),!0).forEach((function(n){(0,t.Z)(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}n.Z=function(e){var n=e.disabledFields,r=e.hideFields,_=e.newUser,C=e.onDeleteSuccess,E=e.onSaveSuccess,S=e.showDelete,M=e.title,D=e.user,I=(0,i.useState)(!0),T=I[0],U=I[1],A=(0,i.useState)({}),F=A[0],N=A[1],L=(0,i.useState)(null),R=L[0],q=L[1],B=((0,w.Z)()||{}).owner,W=b.ZP.statuses.list().data,G=(0,i.useMemo)((function(){var e;return(null==W||null===(e=W.statuses)||void 0===e?void 0:e[0])||{}}),[W]),H=G.project_type,V=G.project_uuid,z="global",Q=null,X=null;H===g.k.SUB?(z="project",Q=V):H===g.k.MAIN&&(X="The roles selected here will apply to this user globally.\n If a user has both a global role and a workspace role,\n then the role with higher access will take precedence.");var $=b.ZP.roles.list({entity:z,entity_ids:Q?[Q]:[],limit_roles:!!_},{revalidateOnFocus:!1}),J=$.data,K=($.mutate,(0,i.useMemo)((function(){return(null==J?void 0:J.roles)||[]}),[null==J?void 0:J.roles])),Y=(0,l.Db)(_?b.ZP.users.useCreate():b.ZP.users.useUpdate(null==D?void 0:D.id),{onSuccess:function(e){return(0,P.wD)(e,{callback:function(e){var n=e.user,r=Z.Z3.concat(Z.ms).map((function(e){return e.uuid}));r.push("id");var t=(0,y.GL)(n,r);q(t),s.Am.success(_?"New user created successfully.":"User profile successfully updated.",{position:s.Am.POSITION.BOTTOM_RIGHT,toastId:"user-update-success-".concat(n.id)}),null==E||E(t)},onErrorCallback:function(e){var n=e.error,r=n.errors,t=n.exception,o=n.message,u=n.type;s.Am.error((null==r?void 0:r.error)||t||o,{position:s.Am.POSITION.BOTTOM_RIGHT,toastId:u})}})}}),ee=(0,u.Z)(Y,2),ne=ee[0],re=ee[1].isLoading,te=(0,l.Db)(b.ZP.users.useDelete(null==D?void 0:D.id),{onSuccess:function(e){return(0,P.wD)(e,{callback:function(){null==C||C()},onErrorCallback:function(e){var n=e.error,r=n.errors,t=n.message;alert(t),console.log(r)}})}}),oe=(0,u.Z)(te,2),ue=oe[0],se=oe[1].isLoading,ie=r?(0,o.Z)(r):[];_&&ie.push(Z.s7);var le=!ie||!ie.includes(Z.s7),ae=(0,j.Z)(D);(0,i.useEffect)((function(){if(D&&(!R||(null==ae?void 0:ae.id)!==(null==D?void 0:D.id))){var e=Z.Z3.concat(Z.ms).map((function(e){return e.uuid}));q((0,y.GL)(D,e))}null!=R&&R.password||null!=R&&R.password_confirmation?(null==R?void 0:R.password)!==(null==R?void 0:R.password_confirmation)?N({password_confirmation:"Password confirmation does not match."}):!le||null!=R&&R.password_current?N(null):N({password_current:"This field is required."}):null!=R&&R.password_current&&le?null!=R&&R.password&&null!=R&&R.password_confirmation?N(null):N({password:"This field is required.",password_confirmation:"This field is required."}):null!=R&&R.password_current||null!=R&&R.password||null!=R&&R.password_confirmation||N(null)}),[R,le,D,ae]);var ce=(0,i.useState)(!1),de=ce[0],fe=ce[1],pe=(0,i.useMemo)((function(){return(de?null==R?void 0:R.roles_new:null==D?void 0:D.roles_new)||[]}),[R,de,D]),me=(0,i.useMemo)((function(){var e=(null==K?void 0:K.map((function(e){return e.id})))||[];return null==pe?void 0:pe.filter((function(n){var r=n.id;return e.includes(r)}))}),[pe,K]);return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(f.Z,{children:M||"Edit profile"}),(0,O.jsxs)("form",{children:[Z.Z3.filter((function(e){var n=e.uuid;return!ie||!ie.includes(n)})).map((function(e){var n=e.autoComplete,r=e.disabled,o=e.label,u=e.required,s=e.type,i=e.uuid;return(0,O.jsx)(m.Z,{mt:2,children:(0,O.jsx)(h.Z,{autoComplete:n,disabled:r&&!_,label:o,onChange:function(e){U(!1),q((function(n){return k(k({},n),{},(0,t.Z)({},i,e.target.value))}))},primary:!0,required:u,setContentOnMount:!0,type:s,value:(null==R?void 0:R[i])||""})},i)})),!(null!=D&&D.owner)&&!(null!=ie&&ie.includes("roles"))&&(0,O.jsxs)(m.Z,{mt:2,children:[X&&(0,O.jsx)(m.Z,{mb:1,children:(0,O.jsx)(v.ZP,{children:X})}),(0,O.jsx)(p.Z,{disabled:null==n?void 0:n.includes("roles"),label:"Roles",onChange:function(e){var n=(0,x.sE)(K,(function(n){return n.id==e.target.value}));n&&(U(!1),fe(!0),q((function(e){var r={};return(0,x.sE)(pe,(function(e){return e.id==(null==n?void 0:n.id)}))||(r={roles_new:[].concat((0,o.Z)(pe),[n])}),k(k({},e),r)})))},primary:!0,setContentOnMount:!0,children:K.map((function(e){var n=e.id,r=e.name;return(0,O.jsx)("option",{value:n,children:r},r)}))}),(0,O.jsx)(m.Z,{mb:1}),(0,O.jsx)(d.ZP,{alignItems:"center",flexWrap:"wrap",children:null==me?void 0:me.map((function(e){var r=e.id,t=e.name;return(0,O.jsx)(m.Z,{mb:1,mr:1,children:(0,O.jsx)(c.Z,{disabled:null==n?void 0:n.includes("roles"),label:t,onClick:function(){U(!1),fe(!0),q((function(e){return k(k({},e),{},{roles_new:(0,x.Od)(pe,(function(e){return e.id===r}))})}))},primary:!0})},"user_roles/".concat(t))}))})]}),(0,O.jsxs)(m.Z,{mt:5,children:[(0,O.jsx)(f.Z,{children:_?"Password":"Change password"}),Z.ms.filter((function(e){var n=e.uuid;return!ie||!ie.includes(n)})).map((function(e){var n=e.autoComplete,r=e.disabled,o=e.label,u=e.required,s=e.type,i=e.uuid;return(0,O.jsx)(m.Z,{mt:2,children:(0,O.jsx)(h.Z,{autoComplete:n,disabled:r,label:o,meta:{error:null==F?void 0:F[i],touched:!(null==F||!F[i])},onChange:function(e){U(!1),q((function(n){return k(k({},n),{},(0,t.Z)({},i,e.target.value))}))},primary:!0,required:u,setContentOnMount:!0,type:s,value:(null==R?void 0:R[i])||""})},i)}))]}),(0,O.jsx)(m.Z,{mt:5,children:(0,O.jsxs)(d.ZP,{children:[(0,O.jsx)(a.ZP,{disabled:T||F&&!(0,y.Qr)(F),loading:re,onClick:function(){var e,n=k({},R);"roles_new"in n&&(n.roles_new=null===(e=R.roles_new)||void 0===e?void 0:e.map((function(e){return e.id})));ne({user:n})},primary:!0,children:_?"Create new user":"Update user profile"}),S&&B&&(0,O.jsx)(m.Z,{ml:1,children:(0,O.jsx)(a.ZP,{danger:!0,loading:se,onClick:function(){window.confirm("Are you sure you want to delete ".concat(R.username||R.email,"?"))&&ue()},children:"Delete user"})})]})})]})]})}},5178:function(e,n,r){"use strict";r.r(n),r.d(n,{default:function(){return F}});var t=r(77837),o=r(38860),u=r.n(o),s=r(82684),i=r(34376),l=r(93808),a=r(38276),c=r(36043),d=r(75582),f=r(21831),p=r(82394),m=r(21764),v=r(83455),h=r(71180),b=r(31882),w=r(55485),j=r(55072),g=r(44085),Z=r(4190),x=r(75499),y=r(30160),P=r(35686),O=r(86735),_=r(72619),k=r(69419),C=r(28598);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 S(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,p.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}var M=function(e){e.fetchUser;var n=e.isLoadingWorkspaces,r=e.user,t=e.workspaces,o=(0,i.useRouter)(),u=(0,s.useState)(),l=u[0],c=u[1],E=(0,s.useState)(!0),M=E[0],D=E[1];(0,s.useEffect)((function(){r&&c(r)}),[r]);var I=(0,k.iV)(),T=null!=I&&I.page?I.page:0,U=(null==t?void 0:t.length)||0,A=(0,s.useMemo)((function(){return null==t?void 0:t.slice(10*T,10*T+10)}),[t,T]),F=(0,s.useMemo)((function(){return null==A?void 0:A.map((function(e){return e.project_uuid}))}),[A]),N=P.ZP.roles.list({entity:"project",entity_ids:F},{revalidateOnFocus:!1},{pauseFetch:!A}),L=N.data,R=N.isValidating,q=(N.mutate,(0,s.useCallback)((function(e){return null==e?void 0:e.reduce((function(e,n){var r,t=e;return null==n||null===(r=n.permissions)||void 0===r||r.forEach((function(e){var r=e.entity_id,o=t[r]||[];t=S(S({},t),{},(0,p.Z)({},r,[].concat((0,f.Z)(o),[n])))})),t}),{})}),[])),B=(0,s.useMemo)((function(){var e=(null==L?void 0:L.roles)||[];return q(e)}),[L,q]),W=(0,s.useMemo)((function(){var e=l||r,n=null==e?void 0:e.roles_new;return q(n)}),[q,l,r]),G=(0,v.Db)(P.ZP.users.useUpdate(null==r?void 0:r.id),{onSuccess:function(e){return(0,_.wD)(e,{callback:function(){o.push("/manage/users")},onErrorCallback:function(e){var n=e.error,r=n.errors,t=n.exception,o=n.message,u=n.type;m.Am.error((null==r?void 0:r.error)||t||o,{position:m.Am.POSITION.BOTTOM_RIGHT,toastId:u})}})}}),H=(0,d.Z)(G,2),V=H[0],z=H[1].isLoading;return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(a.Z,{p:2,children:(0,C.jsx)(h.ZP,{disabled:M,loading:z,onClick:function(){var e,n=S(S({},l),{},{roles_new:null==l||null===(e=l.roles_new)||void 0===e?void 0:e.map((function(e){return e.id}))});V({user:n})},primary:!0,children:"Update workspace roles"})}),R||n?(0,C.jsx)(a.Z,{p:2,children:(0,C.jsx)(Z.Z,{color:"white"})}):(0,C.jsx)(x.Z,{columnFlex:[1,1],columns:[{uuid:"Workspace"},{uuid:"Role"}],rows:null==A?void 0:A.map((function(e){var n=e.name,r=e.project_uuid,t=(null==B?void 0:B[r])||[],o=null==W?void 0:W[r];return[(0,C.jsx)(y.ZP,{bold:!0,children:n},"name"),(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(g.Z,{label:"Roles",onChange:function(e){D(!1);var n=(0,O.sE)(t,(function(n){return n.id==e.target.value}));n&&c((function(e){var r,t=(null==e||null===(r=e.roles_new)||void 0===r?void 0:r.filter((function(e){return e.id!=(null==n?void 0:n.id)})))||[],o={roles_new:[].concat((0,f.Z)(t),[n])};return S(S({},e),o)}))},primary:!0,setContentOnMount:!0,children:t.map((function(e){var n=e.id,r=e.name;return(0,C.jsx)("option",{value:n,children:r},r)}))},"project_role"),(0,C.jsx)(a.Z,{mb:1}),(0,C.jsx)(w.ZP,{alignItems:"center",flexWrap:"wrap",children:null==o?void 0:o.map((function(e){var n=e.id,r=e.name;return(0,C.jsx)(a.Z,{mb:1,mr:1,children:(0,C.jsx)(b.Z,{label:r,onClick:function(){D(!1),c((function(e){return S(S({},e),{},{roles_new:(0,O.Od)((null==e?void 0:e.roles_new)||[],(function(e){return e.id===n}))})}))},primary:!0})},"user_roles/".concat(r))}))})]})]}))}),(0,C.jsx)(a.Z,{p:2,children:(0,C.jsx)(j.ZP,{maxPages:j.Et,onUpdate:function(e){var n=Number(e),t=S(S({},I),{},{page:n>=0?n:0});o.push("/manage/users/[user]","/manage/users/".concat(r.id,"?").concat((0,k.uM)(t)))},page:Number(T),totalPages:Math.ceil(U/10)})})]})},D=r(59533),I=r(70515),T=r(14875),U=r(75083);function A(e){var n=e.user,r=(0,i.useRouter)(),t=(0,s.useState)(null),o=t[0],u=t[1],l=null==n?void 0:n.id,d=P.ZP.users.detail(l),f=d.data,p=d.mutate,m=P.ZP.statuses.list().data,v=(0,s.useMemo)((function(){var e,n;return null==m||null===(e=m.statuses)||void 0===e||null===(n=e[0])||void 0===n?void 0:n.instance_type}),[m]),h=(0,s.useMemo)((function(){return null==f?void 0:f.user}),[f]);(0,s.useEffect)((function(){(0,_.bB)(f,u)}),[f]);var b=P.ZP.workspaces.list({cluster_type:v,user_id:l},{revalidateOnFocus:!1}),w=b.data,j=b.isValidating,g=(0,s.useMemo)((function(){return(0,C.jsx)(a.Z,{p:I.cd,children:(0,C.jsx)(c.Z,{hideFields:[T.s7],onDeleteSuccess:function(){return r.push("/manage/users")},onSaveSuccess:function(){return r.push("/manage/users")},showDelete:!0,title:"Edit user",user:h})})}),[r,h]),Z=(0,s.useMemo)((function(){return null==w?void 0:w.workspaces}),[w]);return(0,C.jsx)(D.Z,{before:g,breadcrumbs:[{label:function(){return"Workspaces"},linkProps:{as:"/manage",href:"/manage"}},{label:function(){return"Users"},linkProps:{as:"/manage/users",href:"/manage/users"}},{bold:!0,label:function(){return(null==h?void 0:h.username)||"User"}}],errors:o,pageName:U.L6.USERS,children:(0,C.jsx)(M,{fetchUser:p,user:h,isLoadingWorkspaces:j,workspaces:Z})})}A.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.user,e.abrupt("return",{user:{id:r}});case 2:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();var F=(0,l.Z)(A)},11976:function(e,n,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/manage/users/[user]",function(){return r(5178)}])},80022:function(e,n,r){"use strict";function t(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}r.d(n,{Z:function(){return t}})},15544:function(e,n,r){"use strict";function t(e){return t=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},t(e)}r.d(n,{Z:function(){return t}})},13692:function(e,n,r){"use strict";r.d(n,{Z:function(){return o}});var t=r(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,t.Z)(e,n)}},93189:function(e,n,r){"use strict";r.d(n,{Z:function(){return u}});var t=r(12539),o=r(80022);function u(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,o.Z)(e)}}},function(e){e.O(0,[1557,1598,9774,2888,179],(function(){return n=11976,e(e.s=n);var n}));var n=e.O();_N_E=n}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4496],{55072:function(e,n,r){"use strict";r.d(n,{Et:function(){return f},Q:function(){return d}});r(82684);var t=r(71180),o=r(55485),u=r(38276),s=r(31748),i=r(72473),l=r(79633),a=r(70515),c=r(28598),d=30,f=9;n.ZP=function(e){var n=e.page,r=e.maxPages,d=e.onUpdate,f=e.totalPages,p=[],m=r;if(m>f)p=Array.from({length:f},(function(e,n){return n}));else{var v=Math.floor(m/2),h=n-v;n+v>=f?(h=f-m+2,m-=2):n-v<=0?(h=0,m-=2):(m-=4,h=n-Math.floor(m/2)),p=Array.from({length:m},(function(e,n){return n+h}))}return(0,c.jsx)(c.Fragment,{children:f>0&&(0,c.jsxs)(o.ZP,{alignItems:"center",children:[(0,c.jsx)(t.ZP,{disabled:0===n,onClick:function(){return d(n-1)},children:(0,c.jsx)(i.PaginateArrowLeft,{size:1.5*a.iI,stroke:s.Av})}),!p.includes(0)&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(u.Z,{ml:1,children:(0,c.jsx)(t.ZP,{borderLess:!0,noBackground:!0,onClick:function(){return d(0)},children:1})},0),!p.includes(1)&&(0,c.jsx)(u.Z,{ml:1,children:(0,c.jsx)(t.ZP,{noBackground:!0,noPadding:!0,notClickable:!0,children:"..."})},0)]}),p.map((function(e){return(0,c.jsx)(u.Z,{ml:1,children:(0,c.jsx)(t.ZP,{backgroundColor:e===n&&l.a$,borderLess:!0,noBackground:!0,notClickable:e===n,onClick:function(){e!==n&&d(e)},children:e+1})},e)})),!p.includes(f-1)&&(0,c.jsxs)(c.Fragment,{children:[!p.includes(f-2)&&(0,c.jsx)(u.Z,{ml:1,children:(0,c.jsx)(t.ZP,{noBackground:!0,noPadding:!0,notClickable:!0,children:"..."})},0),(0,c.jsx)(u.Z,{ml:1,children:(0,c.jsx)(t.ZP,{borderLess:!0,noBackground:!0,onClick:function(){return d(f-1)},children:f})},f-1)]}),(0,c.jsx)(u.Z,{ml:1}),(0,c.jsx)(t.ZP,{disabled:n===f-1,onClick:function(){return d(n+1)},children:(0,c.jsx)(i.PaginateArrowRight,{size:1.5*a.iI,stroke:s.Av})})]})})}},14875:function(e,n,r){"use strict";r.d(n,{Z3:function(){return t},ms:function(){return u},s7:function(){return o}});var t=[{autoComplete:"username",label:"Username",required:!0,uuid:"username"},{autoComplete:"email",disabled:!1,label:"Email",required:!0,type:"email",uuid:"email"}],o="password_current",u=[{autoComplete:"current-password",label:"Current password",type:"password",uuid:o},{autoComplete:"new-password",label:"New password",type:"password",uuid:"password"},{autoComplete:"new-password",label:"Confirm new password",type:"password",uuid:"password_confirmation"}]},36043:function(e,n,r){"use strict";var t=r(82394),o=r(21831),u=r(75582),s=r(21764),i=r(82684),l=r(83455),a=r(71180),c=r(31882),d=r(55485),f=r(85854),p=r(44085),m=r(38276),v=r(30160),h=r(17488),b=r(35686),w=r(50018),j=r(98464),g=r(82359),Z=r(14875),x=r(86735),y=r(42122),P=r(72619),O=r(28598);function _(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 k(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?_(Object(r),!0).forEach((function(n){(0,t.Z)(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}n.Z=function(e){var n=e.disabledFields,r=e.hideFields,_=e.newUser,C=e.onDeleteSuccess,E=e.onSaveSuccess,S=e.showDelete,M=e.title,D=e.user,I=(0,i.useState)(!0),T=I[0],U=I[1],A=(0,i.useState)({}),F=A[0],N=A[1],L=(0,i.useState)(null),R=L[0],q=L[1],B=((0,w.Z)()||{}).owner,W=b.ZP.statuses.list().data,G=(0,i.useMemo)((function(){var e;return(null==W||null===(e=W.statuses)||void 0===e?void 0:e[0])||{}}),[W]),H=G.project_type,V=G.project_uuid,z="global",Q=null,X=null;H===g.k.SUB?(z="project",Q=V):H===g.k.MAIN&&(X="The roles selected here will apply to this user globally.\n If a user has both a global role and a workspace role,\n then the role with higher access will take precedence.");var $=b.ZP.roles.list({entity:z,entity_ids:Q?[Q]:[],limit_roles:!!_},{revalidateOnFocus:!1}),J=$.data,K=($.mutate,(0,i.useMemo)((function(){return(null==J?void 0:J.roles)||[]}),[null==J?void 0:J.roles])),Y=(0,l.Db)(_?b.ZP.users.useCreate():b.ZP.users.useUpdate(null==D?void 0:D.id),{onSuccess:function(e){return(0,P.wD)(e,{callback:function(e){var n=e.user,r=Z.Z3.concat(Z.ms).map((function(e){return e.uuid}));r.push("id");var t=(0,y.GL)(n,r);q(t),s.Am.success(_?"New user created successfully.":"User profile successfully updated.",{position:s.Am.POSITION.BOTTOM_RIGHT,toastId:"user-update-success-".concat(n.id)}),null==E||E(t)},onErrorCallback:function(e){var n=e.error,r=n.errors,t=n.exception,o=n.message,u=n.type;s.Am.error((null==r?void 0:r.error)||t||o,{position:s.Am.POSITION.BOTTOM_RIGHT,toastId:u})}})}}),ee=(0,u.Z)(Y,2),ne=ee[0],re=ee[1].isLoading,te=(0,l.Db)(b.ZP.users.useDelete(null==D?void 0:D.id),{onSuccess:function(e){return(0,P.wD)(e,{callback:function(){null==C||C()},onErrorCallback:function(e){var n=e.error,r=n.errors,t=n.message;alert(t),console.log(r)}})}}),oe=(0,u.Z)(te,2),ue=oe[0],se=oe[1].isLoading,ie=r?(0,o.Z)(r):[];_&&ie.push(Z.s7);var le=!ie||!ie.includes(Z.s7),ae=(0,j.Z)(D);(0,i.useEffect)((function(){if(D&&(!R||(null==ae?void 0:ae.id)!==(null==D?void 0:D.id))){var e=Z.Z3.concat(Z.ms).map((function(e){return e.uuid}));q((0,y.GL)(D,e))}null!=R&&R.password||null!=R&&R.password_confirmation?(null==R?void 0:R.password)!==(null==R?void 0:R.password_confirmation)?N({password_confirmation:"Password confirmation does not match."}):!le||null!=R&&R.password_current?N(null):N({password_current:"This field is required."}):null!=R&&R.password_current&&le?null!=R&&R.password&&null!=R&&R.password_confirmation?N(null):N({password:"This field is required.",password_confirmation:"This field is required."}):null!=R&&R.password_current||null!=R&&R.password||null!=R&&R.password_confirmation||N(null)}),[R,le,D,ae]);var ce=(0,i.useState)(!1),de=ce[0],fe=ce[1],pe=(0,i.useMemo)((function(){return(de?null==R?void 0:R.roles_new:null==D?void 0:D.roles_new)||[]}),[R,de,D]),me=(0,i.useMemo)((function(){var e=(null==K?void 0:K.map((function(e){return e.id})))||[];return null==pe?void 0:pe.filter((function(n){var r=n.id;return e.includes(r)}))}),[pe,K]);return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(f.Z,{children:M||"Edit profile"}),(0,O.jsxs)("form",{children:[Z.Z3.filter((function(e){var n=e.uuid;return!ie||!ie.includes(n)})).map((function(e){var n=e.autoComplete,r=e.disabled,o=e.label,u=e.required,s=e.type,i=e.uuid;return(0,O.jsx)(m.Z,{mt:2,children:(0,O.jsx)(h.Z,{autoComplete:n,disabled:r&&!_,label:o,onChange:function(e){U(!1),q((function(n){return k(k({},n),{},(0,t.Z)({},i,e.target.value))}))},primary:!0,required:u,setContentOnMount:!0,type:s,value:(null==R?void 0:R[i])||""})},i)})),!(null!=D&&D.owner)&&!(null!=ie&&ie.includes("roles"))&&(0,O.jsxs)(m.Z,{mt:2,children:[X&&(0,O.jsx)(m.Z,{mb:1,children:(0,O.jsx)(v.ZP,{children:X})}),(0,O.jsx)(p.Z,{disabled:null==n?void 0:n.includes("roles"),label:"Roles",onChange:function(e){var n=(0,x.sE)(K,(function(n){return n.id==e.target.value}));n&&(U(!1),fe(!0),q((function(e){var r={};return(0,x.sE)(pe,(function(e){return e.id==(null==n?void 0:n.id)}))||(r={roles_new:[].concat((0,o.Z)(pe),[n])}),k(k({},e),r)})))},primary:!0,setContentOnMount:!0,children:K.map((function(e){var n=e.id,r=e.name;return(0,O.jsx)("option",{value:n,children:r},r)}))}),(0,O.jsx)(m.Z,{mb:1}),(0,O.jsx)(d.ZP,{alignItems:"center",flexWrap:"wrap",children:null==me?void 0:me.map((function(e){var r=e.id,t=e.name;return(0,O.jsx)(m.Z,{mb:1,mr:1,children:(0,O.jsx)(c.Z,{disabled:null==n?void 0:n.includes("roles"),label:t,onClick:function(){U(!1),fe(!0),q((function(e){return k(k({},e),{},{roles_new:(0,x.Od)(pe,(function(e){return e.id===r}))})}))},primary:!0})},"user_roles/".concat(t))}))})]}),(0,O.jsxs)(m.Z,{mt:5,children:[(0,O.jsx)(f.Z,{children:_?"Password":"Change password"}),Z.ms.filter((function(e){var n=e.uuid;return!ie||!ie.includes(n)})).map((function(e){var n=e.autoComplete,r=e.disabled,o=e.label,u=e.required,s=e.type,i=e.uuid;return(0,O.jsx)(m.Z,{mt:2,children:(0,O.jsx)(h.Z,{autoComplete:n,disabled:r,label:o,meta:{error:null==F?void 0:F[i],touched:!(null==F||!F[i])},onChange:function(e){U(!1),q((function(n){return k(k({},n),{},(0,t.Z)({},i,e.target.value))}))},primary:!0,required:u,setContentOnMount:!0,type:s,value:(null==R?void 0:R[i])||""})},i)}))]}),(0,O.jsx)(m.Z,{mt:5,children:(0,O.jsxs)(d.ZP,{children:[(0,O.jsx)(a.ZP,{disabled:T||F&&!(0,y.Qr)(F),loading:re,onClick:function(){var e,n=k({},R);"roles_new"in n&&(n.roles_new=null===(e=R.roles_new)||void 0===e?void 0:e.map((function(e){return e.id})));ne({user:n})},primary:!0,children:_?"Create new user":"Update user profile"}),S&&B&&(0,O.jsx)(m.Z,{ml:1,children:(0,O.jsx)(a.ZP,{danger:!0,loading:se,onClick:function(){window.confirm("Are you sure you want to delete ".concat(R.username||R.email,"?"))&&ue()},children:"Delete user"})})]})})]})]})}},5178:function(e,n,r){"use strict";r.r(n),r.d(n,{default:function(){return F}});var t=r(77837),o=r(38860),u=r.n(o),s=r(82684),i=r(34376),l=r(93808),a=r(38276),c=r(36043),d=r(75582),f=r(21831),p=r(82394),m=r(21764),v=r(83455),h=r(71180),b=r(31882),w=r(55485),j=r(55072),g=r(44085),Z=r(4190),x=r(75499),y=r(30160),P=r(35686),O=r(86735),_=r(72619),k=r(69419),C=r(28598);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 S(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,p.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}var M=function(e){e.fetchUser;var n=e.isLoadingWorkspaces,r=e.user,t=e.workspaces,o=(0,i.useRouter)(),u=(0,s.useState)(),l=u[0],c=u[1],E=(0,s.useState)(!0),M=E[0],D=E[1];(0,s.useEffect)((function(){r&&c(r)}),[r]);var I=(0,k.iV)(),T=null!=I&&I.page?I.page:0,U=(null==t?void 0:t.length)||0,A=(0,s.useMemo)((function(){return null==t?void 0:t.slice(10*T,10*T+10)}),[t,T]),F=(0,s.useMemo)((function(){return null==A?void 0:A.map((function(e){return e.project_uuid}))}),[A]),N=P.ZP.roles.list({entity:"project",entity_ids:F},{revalidateOnFocus:!1},{pauseFetch:!A}),L=N.data,R=N.isValidating,q=(N.mutate,(0,s.useCallback)((function(e){return null==e?void 0:e.reduce((function(e,n){var r,t=e;return null==n||null===(r=n.permissions)||void 0===r||r.forEach((function(e){var r=e.entity_id,o=t[r]||[];t=S(S({},t),{},(0,p.Z)({},r,[].concat((0,f.Z)(o),[n])))})),t}),{})}),[])),B=(0,s.useMemo)((function(){var e=(null==L?void 0:L.roles)||[];return q(e)}),[L,q]),W=(0,s.useMemo)((function(){var e=l||r,n=null==e?void 0:e.roles_new;return q(n)}),[q,l,r]),G=(0,v.Db)(P.ZP.users.useUpdate(null==r?void 0:r.id),{onSuccess:function(e){return(0,_.wD)(e,{callback:function(){o.push("/manage/users")},onErrorCallback:function(e){var n=e.error,r=n.errors,t=n.exception,o=n.message,u=n.type;m.Am.error((null==r?void 0:r.error)||t||o,{position:m.Am.POSITION.BOTTOM_RIGHT,toastId:u})}})}}),H=(0,d.Z)(G,2),V=H[0],z=H[1].isLoading;return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(a.Z,{p:2,children:(0,C.jsx)(h.ZP,{disabled:M,loading:z,onClick:function(){var e,n=S(S({},l),{},{roles_new:null==l||null===(e=l.roles_new)||void 0===e?void 0:e.map((function(e){return e.id}))});V({user:n})},primary:!0,children:"Update workspace roles"})}),R||n?(0,C.jsx)(a.Z,{p:2,children:(0,C.jsx)(Z.Z,{color:"white"})}):(0,C.jsx)(x.Z,{columnFlex:[1,1],columns:[{uuid:"Workspace"},{uuid:"Role"}],rows:null==A?void 0:A.map((function(e){var n=e.name,r=e.project_uuid,t=(null==B?void 0:B[r])||[],o=null==W?void 0:W[r];return[(0,C.jsx)(y.ZP,{bold:!0,children:n},"name"),(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(g.Z,{label:"Roles",onChange:function(e){D(!1);var n=(0,O.sE)(t,(function(n){return n.id==e.target.value}));n&&c((function(e){var r,t=(null==e||null===(r=e.roles_new)||void 0===r?void 0:r.filter((function(e){return e.id!=(null==n?void 0:n.id)})))||[],o={roles_new:[].concat((0,f.Z)(t),[n])};return S(S({},e),o)}))},primary:!0,setContentOnMount:!0,children:t.map((function(e){var n=e.id,r=e.name;return(0,C.jsx)("option",{value:n,children:r},r)}))},"project_role"),(0,C.jsx)(a.Z,{mb:1}),(0,C.jsx)(w.ZP,{alignItems:"center",flexWrap:"wrap",children:null==o?void 0:o.map((function(e){var n=e.id,r=e.name;return(0,C.jsx)(a.Z,{mb:1,mr:1,children:(0,C.jsx)(b.Z,{label:r,onClick:function(){D(!1),c((function(e){return S(S({},e),{},{roles_new:(0,O.Od)((null==e?void 0:e.roles_new)||[],(function(e){return e.id===n}))})}))},primary:!0})},"user_roles/".concat(r))}))})]})]}))}),(0,C.jsx)(a.Z,{p:2,children:(0,C.jsx)(j.ZP,{maxPages:j.Et,onUpdate:function(e){var n=Number(e),t=S(S({},I),{},{page:n>=0?n:0});o.push("/manage/users/[user]","/manage/users/".concat(r.id,"?").concat((0,k.uM)(t)))},page:Number(T),totalPages:Math.ceil(U/10)})})]})},D=r(59533),I=r(70515),T=r(14875),U=r(75083);function A(e){var n=e.user,r=(0,i.useRouter)(),t=(0,s.useState)(null),o=t[0],u=t[1],l=null==n?void 0:n.id,d=P.ZP.users.detail(l),f=d.data,p=d.mutate,m=P.ZP.statuses.list().data,v=(0,s.useMemo)((function(){var e,n;return null==m||null===(e=m.statuses)||void 0===e||null===(n=e[0])||void 0===n?void 0:n.instance_type}),[m]),h=(0,s.useMemo)((function(){return null==f?void 0:f.user}),[f]);(0,s.useEffect)((function(){(0,_.bB)(f,u)}),[f]);var b=P.ZP.workspaces.list({cluster_type:v,user_id:l},{revalidateOnFocus:!1}),w=b.data,j=b.isValidating,g=(0,s.useMemo)((function(){return(0,C.jsx)(a.Z,{p:I.cd,children:(0,C.jsx)(c.Z,{hideFields:[T.s7],onDeleteSuccess:function(){return r.push("/manage/users")},onSaveSuccess:function(){return r.push("/manage/users")},showDelete:!0,title:"Edit user",user:h})})}),[r,h]),Z=(0,s.useMemo)((function(){return null==w?void 0:w.workspaces}),[w]);return(0,C.jsx)(D.Z,{before:g,breadcrumbs:[{label:function(){return"Workspaces"},linkProps:{as:"/manage",href:"/manage"}},{label:function(){return"Users"},linkProps:{as:"/manage/users",href:"/manage/users"}},{bold:!0,label:function(){return(null==h?void 0:h.username)||"User"}}],errors:o,pageName:U.L6.USERS,children:(0,C.jsx)(M,{fetchUser:p,user:h,isLoadingWorkspaces:j,workspaces:Z})})}A.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.user,e.abrupt("return",{user:{id:r}});case 2:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();var F=(0,l.Z)(A)},11976:function(e,n,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/manage/users/[user]",function(){return r(5178)}])},80022:function(e,n,r){"use strict";function t(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}r.d(n,{Z:function(){return t}})},15544:function(e,n,r){"use strict";function t(e){return t=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},t(e)}r.d(n,{Z:function(){return t}})},13692:function(e,n,r){"use strict";r.d(n,{Z:function(){return o}});var t=r(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,t.Z)(e,n)}},93189:function(e,n,r){"use strict";r.d(n,{Z:function(){return u}});var t=r(12539),o=r(80022);function u(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,o.Z)(e)}}},function(e){e.O(0,[449,1598,9774,2888,179],(function(){return n=11976,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([[3277],{14875:function(e,r,n){"use strict";n.d(r,{Z3:function(){return t},ms:function(){return o},s7:function(){return u}});var t=[{autoComplete:"username",label:"Username",required:!0,uuid:"username"},{autoComplete:"email",disabled:!1,label:"Email",required:!0,type:"email",uuid:"email"}],u="password_current",o=[{autoComplete:"current-password",label:"Current password",type:"password",uuid:u},{autoComplete:"new-password",label:"New password",type:"password",uuid:"password"},{autoComplete:"new-password",label:"Confirm new password",type:"password",uuid:"password_confirmation"}]},36043:function(e,r,n){"use strict";var t=n(82394),u=n(21831),o=n(75582),s=n(21764),i=n(82684),l=n(83455),a=n(71180),c=n(31882),d=n(55485),p=n(85854),f=n(44085),m=n(38276),w=n(30160),v=n(17488),b=n(35686),h=n(50018),Z=n(98464),j=n(82359),y=n(14875),_=n(86735),g=n(42122),O=n(72619),x=n(28598);function P(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),n.push.apply(n,t)}return n}function C(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?P(Object(n),!0).forEach((function(r){(0,t.Z)(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}r.Z=function(e){var r=e.disabledFields,n=e.hideFields,P=e.newUser,k=e.onDeleteSuccess,S=e.onSaveSuccess,E=e.showDelete,T=e.title,D=e.user,I=(0,i.useState)(!0),N=I[0],M=I[1],q=(0,i.useState)({}),U=q[0],A=q[1],R=(0,i.useState)(null),F=R[0],L=R[1],G=((0,h.Z)()||{}).owner,B=b.ZP.statuses.list().data,H=(0,i.useMemo)((function(){var e;return(null==B||null===(e=B.statuses)||void 0===e?void 0:e[0])||{}}),[B]),W=H.project_type,X=H.project_uuid,Q="global",z=null,J=null;W===j.k.SUB?(Q="project",z=X):W===j.k.MAIN&&(J="The roles selected here will apply to this user globally.\n If a user has both a global role and a workspace role,\n then the role with higher access will take precedence.");var K=b.ZP.roles.list({entity:Q,entity_ids:z?[z]:[],limit_roles:!!P},{revalidateOnFocus:!1}),V=K.data,Y=(K.mutate,(0,i.useMemo)((function(){return(null==V?void 0:V.roles)||[]}),[null==V?void 0:V.roles])),$=(0,l.Db)(P?b.ZP.users.useCreate():b.ZP.users.useUpdate(null==D?void 0:D.id),{onSuccess:function(e){return(0,O.wD)(e,{callback:function(e){var r=e.user,n=y.Z3.concat(y.ms).map((function(e){return e.uuid}));n.push("id");var t=(0,g.GL)(r,n);L(t),s.Am.success(P?"New user created successfully.":"User profile successfully updated.",{position:s.Am.POSITION.BOTTOM_RIGHT,toastId:"user-update-success-".concat(r.id)}),null==S||S(t)},onErrorCallback:function(e){var r=e.error,n=r.errors,t=r.exception,u=r.message,o=r.type;s.Am.error((null==n?void 0:n.error)||t||u,{position:s.Am.POSITION.BOTTOM_RIGHT,toastId:o})}})}}),ee=(0,o.Z)($,2),re=ee[0],ne=ee[1].isLoading,te=(0,l.Db)(b.ZP.users.useDelete(null==D?void 0:D.id),{onSuccess:function(e){return(0,O.wD)(e,{callback:function(){null==k||k()},onErrorCallback:function(e){var r=e.error,n=r.errors,t=r.message;alert(t),console.log(n)}})}}),ue=(0,o.Z)(te,2),oe=ue[0],se=ue[1].isLoading,ie=n?(0,u.Z)(n):[];P&&ie.push(y.s7);var le=!ie||!ie.includes(y.s7),ae=(0,Z.Z)(D);(0,i.useEffect)((function(){if(D&&(!F||(null==ae?void 0:ae.id)!==(null==D?void 0:D.id))){var e=y.Z3.concat(y.ms).map((function(e){return e.uuid}));L((0,g.GL)(D,e))}null!=F&&F.password||null!=F&&F.password_confirmation?(null==F?void 0:F.password)!==(null==F?void 0:F.password_confirmation)?A({password_confirmation:"Password confirmation does not match."}):!le||null!=F&&F.password_current?A(null):A({password_current:"This field is required."}):null!=F&&F.password_current&&le?null!=F&&F.password&&null!=F&&F.password_confirmation?A(null):A({password:"This field is required.",password_confirmation:"This field is required."}):null!=F&&F.password_current||null!=F&&F.password||null!=F&&F.password_confirmation||A(null)}),[F,le,D,ae]);var ce=(0,i.useState)(!1),de=ce[0],pe=ce[1],fe=(0,i.useMemo)((function(){return(de?null==F?void 0:F.roles_new:null==D?void 0:D.roles_new)||[]}),[F,de,D]),me=(0,i.useMemo)((function(){var e=(null==Y?void 0:Y.map((function(e){return e.id})))||[];return null==fe?void 0:fe.filter((function(r){var n=r.id;return e.includes(n)}))}),[fe,Y]);return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(p.Z,{children:T||"Edit profile"}),(0,x.jsxs)("form",{children:[y.Z3.filter((function(e){var r=e.uuid;return!ie||!ie.includes(r)})).map((function(e){var r=e.autoComplete,n=e.disabled,u=e.label,o=e.required,s=e.type,i=e.uuid;return(0,x.jsx)(m.Z,{mt:2,children:(0,x.jsx)(v.Z,{autoComplete:r,disabled:n&&!P,label:u,onChange:function(e){M(!1),L((function(r){return C(C({},r),{},(0,t.Z)({},i,e.target.value))}))},primary:!0,required:o,setContentOnMount:!0,type:s,value:(null==F?void 0:F[i])||""})},i)})),!(null!=D&&D.owner)&&!(null!=ie&&ie.includes("roles"))&&(0,x.jsxs)(m.Z,{mt:2,children:[J&&(0,x.jsx)(m.Z,{mb:1,children:(0,x.jsx)(w.ZP,{children:J})}),(0,x.jsx)(f.Z,{disabled:null==r?void 0:r.includes("roles"),label:"Roles",onChange:function(e){var r=(0,_.sE)(Y,(function(r){return r.id==e.target.value}));r&&(M(!1),pe(!0),L((function(e){var n={};return(0,_.sE)(fe,(function(e){return e.id==(null==r?void 0:r.id)}))||(n={roles_new:[].concat((0,u.Z)(fe),[r])}),C(C({},e),n)})))},primary:!0,setContentOnMount:!0,children:Y.map((function(e){var r=e.id,n=e.name;return(0,x.jsx)("option",{value:r,children:n},n)}))}),(0,x.jsx)(m.Z,{mb:1}),(0,x.jsx)(d.ZP,{alignItems:"center",flexWrap:"wrap",children:null==me?void 0:me.map((function(e){var n=e.id,t=e.name;return(0,x.jsx)(m.Z,{mb:1,mr:1,children:(0,x.jsx)(c.Z,{disabled:null==r?void 0:r.includes("roles"),label:t,onClick:function(){M(!1),pe(!0),L((function(e){return C(C({},e),{},{roles_new:(0,_.Od)(fe,(function(e){return e.id===n}))})}))},primary:!0})},"user_roles/".concat(t))}))})]}),(0,x.jsxs)(m.Z,{mt:5,children:[(0,x.jsx)(p.Z,{children:P?"Password":"Change password"}),y.ms.filter((function(e){var r=e.uuid;return!ie||!ie.includes(r)})).map((function(e){var r=e.autoComplete,n=e.disabled,u=e.label,o=e.required,s=e.type,i=e.uuid;return(0,x.jsx)(m.Z,{mt:2,children:(0,x.jsx)(v.Z,{autoComplete:r,disabled:n,label:u,meta:{error:null==U?void 0:U[i],touched:!(null==U||!U[i])},onChange:function(e){M(!1),L((function(r){return C(C({},r),{},(0,t.Z)({},i,e.target.value))}))},primary:!0,required:o,setContentOnMount:!0,type:s,value:(null==F?void 0:F[i])||""})},i)}))]}),(0,x.jsx)(m.Z,{mt:5,children:(0,x.jsxs)(d.ZP,{children:[(0,x.jsx)(a.ZP,{disabled:N||U&&!(0,g.Qr)(U),loading:ne,onClick:function(){var e,r=C({},F);"roles_new"in r&&(r.roles_new=null===(e=F.roles_new)||void 0===e?void 0:e.map((function(e){return e.id})));re({user:r})},primary:!0,children:P?"Create new user":"Update user profile"}),E&&G&&(0,x.jsx)(m.Z,{ml:1,children:(0,x.jsx)(a.ZP,{danger:!0,loading:se,onClick:function(){window.confirm("Are you sure you want to delete ".concat(F.username||F.email,"?"))&&oe()},children:"Delete user"})})]})})]})]})}},37560:function(e,r,n){"use strict";n.r(r);var t=n(77837),u=n(38860),o=n.n(u),s=(n(82684),n(34376)),i=n(93808),l=n(38276),a=n(36043),c=n(59533),d=n(70515),p=n(75083),f=n(28598);function m(){var e=(0,s.useRouter)();return(0,f.jsx)(c.Z,{breadcrumbs:[{label:function(){return"Workspaces"},linkProps:{as:"/manage",href:"/manage"}},{label:function(){return"Users"},linkProps:{as:"/manage/users",href:"/manage/users"}},{bold:!0,label:function(){return"New"}}],pageName:p.L6.USERS,children:(0,f.jsx)(l.Z,{p:d.cd,children:(0,f.jsx)(a.Z,{hideFields:["roles"],newUser:!0,onSaveSuccess:function(r){e.push("/manage/users/[user]","/manage/users/".concat(null==r?void 0:r.id))},title:"Add new user",user:{}})})})}m.getInitialProps=function(){var e=(0,t.Z)(o().mark((function e(r){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)})));return function(r){return e.apply(this,arguments)}}(),r.default=(0,i.Z)(m)},94e3:function(e,r,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/manage/users/new",function(){return n(37560)}])},80022:function(e,r,n){"use strict";function t(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(r,{Z:function(){return t}})},15544:function(e,r,n){"use strict";function t(e){return t=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},t(e)}n.d(r,{Z:function(){return t}})},13692:function(e,r,n){"use strict";n.d(r,{Z:function(){return u}});var t=n(61049);function u(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),r&&(0,t.Z)(e,r)}},93189:function(e,r,n){"use strict";n.d(r,{Z:function(){return o}});var t=n(12539),u=n(80022);function o(e,r){if(r&&("object"===t(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return(0,u.Z)(e)}}},function(e){e.O(0,[1557,1598,9774,2888,179],(function(){return r=94e3,e(e.s=r);var r}));var r=e.O();_N_E=r}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3277],{14875:function(e,r,n){"use strict";n.d(r,{Z3:function(){return t},ms:function(){return o},s7:function(){return u}});var t=[{autoComplete:"username",label:"Username",required:!0,uuid:"username"},{autoComplete:"email",disabled:!1,label:"Email",required:!0,type:"email",uuid:"email"}],u="password_current",o=[{autoComplete:"current-password",label:"Current password",type:"password",uuid:u},{autoComplete:"new-password",label:"New password",type:"password",uuid:"password"},{autoComplete:"new-password",label:"Confirm new password",type:"password",uuid:"password_confirmation"}]},36043:function(e,r,n){"use strict";var t=n(82394),u=n(21831),o=n(75582),s=n(21764),i=n(82684),l=n(83455),a=n(71180),c=n(31882),d=n(55485),p=n(85854),f=n(44085),m=n(38276),w=n(30160),v=n(17488),b=n(35686),h=n(50018),Z=n(98464),j=n(82359),y=n(14875),_=n(86735),g=n(42122),O=n(72619),x=n(28598);function P(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),n.push.apply(n,t)}return n}function C(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?P(Object(n),!0).forEach((function(r){(0,t.Z)(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}r.Z=function(e){var r=e.disabledFields,n=e.hideFields,P=e.newUser,k=e.onDeleteSuccess,S=e.onSaveSuccess,E=e.showDelete,T=e.title,D=e.user,I=(0,i.useState)(!0),N=I[0],M=I[1],q=(0,i.useState)({}),U=q[0],A=q[1],R=(0,i.useState)(null),F=R[0],L=R[1],G=((0,h.Z)()||{}).owner,B=b.ZP.statuses.list().data,H=(0,i.useMemo)((function(){var e;return(null==B||null===(e=B.statuses)||void 0===e?void 0:e[0])||{}}),[B]),W=H.project_type,X=H.project_uuid,Q="global",z=null,J=null;W===j.k.SUB?(Q="project",z=X):W===j.k.MAIN&&(J="The roles selected here will apply to this user globally.\n If a user has both a global role and a workspace role,\n then the role with higher access will take precedence.");var K=b.ZP.roles.list({entity:Q,entity_ids:z?[z]:[],limit_roles:!!P},{revalidateOnFocus:!1}),V=K.data,Y=(K.mutate,(0,i.useMemo)((function(){return(null==V?void 0:V.roles)||[]}),[null==V?void 0:V.roles])),$=(0,l.Db)(P?b.ZP.users.useCreate():b.ZP.users.useUpdate(null==D?void 0:D.id),{onSuccess:function(e){return(0,O.wD)(e,{callback:function(e){var r=e.user,n=y.Z3.concat(y.ms).map((function(e){return e.uuid}));n.push("id");var t=(0,g.GL)(r,n);L(t),s.Am.success(P?"New user created successfully.":"User profile successfully updated.",{position:s.Am.POSITION.BOTTOM_RIGHT,toastId:"user-update-success-".concat(r.id)}),null==S||S(t)},onErrorCallback:function(e){var r=e.error,n=r.errors,t=r.exception,u=r.message,o=r.type;s.Am.error((null==n?void 0:n.error)||t||u,{position:s.Am.POSITION.BOTTOM_RIGHT,toastId:o})}})}}),ee=(0,o.Z)($,2),re=ee[0],ne=ee[1].isLoading,te=(0,l.Db)(b.ZP.users.useDelete(null==D?void 0:D.id),{onSuccess:function(e){return(0,O.wD)(e,{callback:function(){null==k||k()},onErrorCallback:function(e){var r=e.error,n=r.errors,t=r.message;alert(t),console.log(n)}})}}),ue=(0,o.Z)(te,2),oe=ue[0],se=ue[1].isLoading,ie=n?(0,u.Z)(n):[];P&&ie.push(y.s7);var le=!ie||!ie.includes(y.s7),ae=(0,Z.Z)(D);(0,i.useEffect)((function(){if(D&&(!F||(null==ae?void 0:ae.id)!==(null==D?void 0:D.id))){var e=y.Z3.concat(y.ms).map((function(e){return e.uuid}));L((0,g.GL)(D,e))}null!=F&&F.password||null!=F&&F.password_confirmation?(null==F?void 0:F.password)!==(null==F?void 0:F.password_confirmation)?A({password_confirmation:"Password confirmation does not match."}):!le||null!=F&&F.password_current?A(null):A({password_current:"This field is required."}):null!=F&&F.password_current&&le?null!=F&&F.password&&null!=F&&F.password_confirmation?A(null):A({password:"This field is required.",password_confirmation:"This field is required."}):null!=F&&F.password_current||null!=F&&F.password||null!=F&&F.password_confirmation||A(null)}),[F,le,D,ae]);var ce=(0,i.useState)(!1),de=ce[0],pe=ce[1],fe=(0,i.useMemo)((function(){return(de?null==F?void 0:F.roles_new:null==D?void 0:D.roles_new)||[]}),[F,de,D]),me=(0,i.useMemo)((function(){var e=(null==Y?void 0:Y.map((function(e){return e.id})))||[];return null==fe?void 0:fe.filter((function(r){var n=r.id;return e.includes(n)}))}),[fe,Y]);return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(p.Z,{children:T||"Edit profile"}),(0,x.jsxs)("form",{children:[y.Z3.filter((function(e){var r=e.uuid;return!ie||!ie.includes(r)})).map((function(e){var r=e.autoComplete,n=e.disabled,u=e.label,o=e.required,s=e.type,i=e.uuid;return(0,x.jsx)(m.Z,{mt:2,children:(0,x.jsx)(v.Z,{autoComplete:r,disabled:n&&!P,label:u,onChange:function(e){M(!1),L((function(r){return C(C({},r),{},(0,t.Z)({},i,e.target.value))}))},primary:!0,required:o,setContentOnMount:!0,type:s,value:(null==F?void 0:F[i])||""})},i)})),!(null!=D&&D.owner)&&!(null!=ie&&ie.includes("roles"))&&(0,x.jsxs)(m.Z,{mt:2,children:[J&&(0,x.jsx)(m.Z,{mb:1,children:(0,x.jsx)(w.ZP,{children:J})}),(0,x.jsx)(f.Z,{disabled:null==r?void 0:r.includes("roles"),label:"Roles",onChange:function(e){var r=(0,_.sE)(Y,(function(r){return r.id==e.target.value}));r&&(M(!1),pe(!0),L((function(e){var n={};return(0,_.sE)(fe,(function(e){return e.id==(null==r?void 0:r.id)}))||(n={roles_new:[].concat((0,u.Z)(fe),[r])}),C(C({},e),n)})))},primary:!0,setContentOnMount:!0,children:Y.map((function(e){var r=e.id,n=e.name;return(0,x.jsx)("option",{value:r,children:n},n)}))}),(0,x.jsx)(m.Z,{mb:1}),(0,x.jsx)(d.ZP,{alignItems:"center",flexWrap:"wrap",children:null==me?void 0:me.map((function(e){var n=e.id,t=e.name;return(0,x.jsx)(m.Z,{mb:1,mr:1,children:(0,x.jsx)(c.Z,{disabled:null==r?void 0:r.includes("roles"),label:t,onClick:function(){M(!1),pe(!0),L((function(e){return C(C({},e),{},{roles_new:(0,_.Od)(fe,(function(e){return e.id===n}))})}))},primary:!0})},"user_roles/".concat(t))}))})]}),(0,x.jsxs)(m.Z,{mt:5,children:[(0,x.jsx)(p.Z,{children:P?"Password":"Change password"}),y.ms.filter((function(e){var r=e.uuid;return!ie||!ie.includes(r)})).map((function(e){var r=e.autoComplete,n=e.disabled,u=e.label,o=e.required,s=e.type,i=e.uuid;return(0,x.jsx)(m.Z,{mt:2,children:(0,x.jsx)(v.Z,{autoComplete:r,disabled:n,label:u,meta:{error:null==U?void 0:U[i],touched:!(null==U||!U[i])},onChange:function(e){M(!1),L((function(r){return C(C({},r),{},(0,t.Z)({},i,e.target.value))}))},primary:!0,required:o,setContentOnMount:!0,type:s,value:(null==F?void 0:F[i])||""})},i)}))]}),(0,x.jsx)(m.Z,{mt:5,children:(0,x.jsxs)(d.ZP,{children:[(0,x.jsx)(a.ZP,{disabled:N||U&&!(0,g.Qr)(U),loading:ne,onClick:function(){var e,r=C({},F);"roles_new"in r&&(r.roles_new=null===(e=F.roles_new)||void 0===e?void 0:e.map((function(e){return e.id})));re({user:r})},primary:!0,children:P?"Create new user":"Update user profile"}),E&&G&&(0,x.jsx)(m.Z,{ml:1,children:(0,x.jsx)(a.ZP,{danger:!0,loading:se,onClick:function(){window.confirm("Are you sure you want to delete ".concat(F.username||F.email,"?"))&&oe()},children:"Delete user"})})]})})]})]})}},37560:function(e,r,n){"use strict";n.r(r);var t=n(77837),u=n(38860),o=n.n(u),s=(n(82684),n(34376)),i=n(93808),l=n(38276),a=n(36043),c=n(59533),d=n(70515),p=n(75083),f=n(28598);function m(){var e=(0,s.useRouter)();return(0,f.jsx)(c.Z,{breadcrumbs:[{label:function(){return"Workspaces"},linkProps:{as:"/manage",href:"/manage"}},{label:function(){return"Users"},linkProps:{as:"/manage/users",href:"/manage/users"}},{bold:!0,label:function(){return"New"}}],pageName:p.L6.USERS,children:(0,f.jsx)(l.Z,{p:d.cd,children:(0,f.jsx)(a.Z,{hideFields:["roles"],newUser:!0,onSaveSuccess:function(r){e.push("/manage/users/[user]","/manage/users/".concat(null==r?void 0:r.id))},title:"Add new user",user:{}})})})}m.getInitialProps=function(){var e=(0,t.Z)(o().mark((function e(r){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)})));return function(r){return e.apply(this,arguments)}}(),r.default=(0,i.Z)(m)},94e3:function(e,r,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/manage/users/new",function(){return n(37560)}])},80022:function(e,r,n){"use strict";function t(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(r,{Z:function(){return t}})},15544:function(e,r,n){"use strict";function t(e){return t=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},t(e)}n.d(r,{Z:function(){return t}})},13692:function(e,r,n){"use strict";n.d(r,{Z:function(){return u}});var t=n(61049);function u(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),r&&(0,t.Z)(e,r)}},93189:function(e,r,n){"use strict";n.d(r,{Z:function(){return o}});var t=n(12539),u=n(80022);function o(e,r){if(r&&("object"===t(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return(0,u.Z)(e)}}},function(e){e.O(0,[449,1598,9774,2888,179],(function(){return r=94e3,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([[1911],{55072:function(e,n,r){"use strict";r.d(n,{Et:function(){return f},Q:function(){return d}});r(82684);var t=r(71180),u=r(55485),o=r(38276),i=r(31748),s=r(72473),c=r(79633),a=r(70515),l=r(28598),d=30,f=9;n.ZP=function(e){var n=e.page,r=e.maxPages,d=e.onUpdate,f=e.totalPages,p=[],h=r;if(h>f)p=Array.from({length:f},(function(e,n){return n}));else{var b=Math.floor(h/2),m=n-b;n+b>=f?(m=f-h+2,h-=2):n-b<=0?(m=0,h-=2):(h-=4,m=n-Math.floor(h/2)),p=Array.from({length:h},(function(e,n){return n+m}))}return(0,l.jsx)(l.Fragment,{children:f>0&&(0,l.jsxs)(u.ZP,{alignItems:"center",children:[(0,l.jsx)(t.ZP,{disabled:0===n,onClick:function(){return d(n-1)},children:(0,l.jsx)(s.PaginateArrowLeft,{size:1.5*a.iI,stroke:i.Av})}),!p.includes(0)&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(o.Z,{ml:1,children:(0,l.jsx)(t.ZP,{borderLess:!0,noBackground:!0,onClick:function(){return d(0)},children:1})},0),!p.includes(1)&&(0,l.jsx)(o.Z,{ml:1,children:(0,l.jsx)(t.ZP,{noBackground:!0,noPadding:!0,notClickable:!0,children:"..."})},0)]}),p.map((function(e){return(0,l.jsx)(o.Z,{ml:1,children:(0,l.jsx)(t.ZP,{backgroundColor:e===n&&c.a$,borderLess:!0,noBackground:!0,notClickable:e===n,onClick:function(){e!==n&&d(e)},children:e+1})},e)})),!p.includes(f-1)&&(0,l.jsxs)(l.Fragment,{children:[!p.includes(f-2)&&(0,l.jsx)(o.Z,{ml:1,children:(0,l.jsx)(t.ZP,{noBackground:!0,noPadding:!0,notClickable:!0,children:"..."})},0),(0,l.jsx)(o.Z,{ml:1,children:(0,l.jsx)(t.ZP,{borderLess:!0,noBackground:!0,onClick:function(){return d(f-1)},children:f})},f-1)]}),(0,l.jsx)(o.Z,{ml:1}),(0,l.jsx)(t.ZP,{disabled:n===f-1,onClick:function(){return d(n+1)},children:(0,l.jsx)(s.PaginateArrowRight,{size:1.5*a.iI,stroke:i.Av})})]})})}},12222:function(e,n,r){"use strict";r.r(n);var t=r(77837),u=r(82394),o=r(38860),i=r.n(o),s=r(82684),c=r(34376),a=r(71180),l=r(85854),d=r(55072),f=r(93808),p=r(38276),h=r(75499),b=r(30160),m=r(59533),j=r(35686),g=r(98464),v=r(72473),P=r(11498),Z=r(70515),x=r(75083),w=r(72619),O=r(50178),_=r(42122),y=r(69419),k=r(28598);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 C(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,u.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 S(){var e,n=(0,c.useRouter)(),r=(0,s.useState)(null),t=r[0],o=r[1],i=((0,O.PR)(null==n?void 0:n.basePath)||{}).owner,f=(0,s.useState)(null),E=f[0],S=f[1],A=(0,y.iV)(),F=null!=A&&A.page?A.page:0,N=(e={},(0,u.Z)(e,P.$D.LIMIT,d.Q),(0,u.Z)(e,P.$D.OFFSET,F*d.Q),e),R=j.ZP.users.list(N,{revalidateOnFocus:!1}),B=R.data,D=(R.mutate,(0,s.useMemo)((function(){var e;return(null==B||null===(e=B.metadata)||void 0===e?void 0:e.count)||[]}),[B]));(0,s.useEffect)((function(){(0,w.bB)(B,o)}),[B]);var I=(0,s.useMemo)((function(){return(null==B?void 0:B.users)||[]}),[null==B?void 0:B.users]),M=j.ZP.users.detail(null==E?void 0:E.user_id,{},{revalidateOnFocus:!1}),L=M.data;M.mutate;(0,s.useEffect)((function(){(0,w.bB)(L,o)}),[L]);var T=null==L?void 0:L.user,U=(0,g.Z)(A);return(0,s.useEffect)((function(){var e=A.add_new_user,n=A.user_id;if(!(0,_.Xy)(A,U)){var r=C(C({},U),A);n?r.user_id=n:delete r.user_id,e?r.add_new_user=e:delete r.add_new_user,S(r)}}),[A,U]),(0,k.jsxs)(m.Z,{breadcrumbs:[{label:function(){return"Workspaces"},linkProps:{as:"/manage",href:"/manage"}},{bold:!0,label:function(){return"Users"}}],errors:t,pageName:x.L6.USERS,children:[i&&(0,k.jsx)(p.Z,{p:Z.cd,children:(0,k.jsx)(a.ZP,{beforeIcon:(0,k.jsx)(v.Add,{}),onClick:function(){return n.push("/manage/users/new")},primary:!0,children:"Add new user"})}),(0,k.jsx)(p.Z,{p:Z.cd,children:(0,k.jsx)(l.Z,{children:"Users"})}),(0,k.jsx)(h.Z,{columnFlex:[1,1,1],columns:[{uuid:"Username"},{uuid:"Email"},{uuid:"Role"}],isSelectedRow:function(e){var n;return(null===(n=I[e])||void 0===n?void 0:n.id)===(null==T?void 0:T.id)},onClickRow:function(e){var r,t=null===(r=I[e])||void 0===r?void 0:r.id;n.push("/manage/users/[user]","/manage/users/".concat(t))},rows:I.map((function(e){var n=e.email,r=e.roles_display,t=e.roles_new,u=e.username;return[(0,k.jsx)(b.ZP,{bold:!0,children:u},"username"),(0,k.jsx)(b.ZP,{default:!0,children:n},"email"),(0,k.jsx)(b.ZP,{default:!0,children:t&&t[0]?t[0].name:r},"roles")]})),uuid:"pipeline-runs"}),(0,k.jsx)(p.Z,{p:2,children:(0,k.jsx)(d.ZP,{maxPages:9,onUpdate:function(e){var r=Number(e),t=C(C({},A),{},{page:r>=0?r:0});n.push("/manage/users","/manage/users?".concat((0,y.uM)(t)))},page:Number(F),totalPages:Math.ceil(D/d.Q)})})]})}S.getInitialProps=(0,t.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)}))),n.default=(0,f.Z)(S)},72695:function(e,n,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/manage/users",function(){return r(12222)}])},80022:function(e,n,r){"use strict";function t(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}r.d(n,{Z:function(){return t}})},15544:function(e,n,r){"use strict";function t(e){return t=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},t(e)}r.d(n,{Z:function(){return t}})},13692:function(e,n,r){"use strict";r.d(n,{Z:function(){return u}});var t=r(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,r){"use strict";r.d(n,{Z:function(){return o}});var t=r(12539),u=r(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,[449,1598,9774,2888,179],(function(){return n=72695,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([[8867],{53779:function(e,n,t){"use strict";t.d(n,{C:function(){return h},X$:function(){return f},eD:function(){return d}});var r=t(9518),i=t(44897),o=t(42631),c=t(70515),s=t(47041),l=t(91437),a=6.25*c.iI,u=100*c.iI,d=r.default.div.withConfig({displayName:"indexstyle__WindowContainerStyle",componentId:"sc-g0cszf-0"})(["border-radius:","px;width:100%;max-width:","px;z-index:101;position:absolute;overflow:hidden;top:50%;left:50%;transform:translate(-50%,-50%);",""],o.n_,u,(function(e){return"\n box-shadow: ".concat((e.theme||i.Z).shadow.window,";\n background-color: ").concat((e.theme||i.Z).background.panel,";\n ")})),p=(0,r.css)(["display:flex;align-items:center;justify-content:space-between;height:","px;padding:","px ","px;",""],a,c.iI,c.cd*c.iI,(function(e){return"\n background-color: ".concat((e.theme||i.Z).background.output,";\n ")})),f=r.default.div.withConfig({displayName:"indexstyle__WindowHeaderStyle",componentId:"sc-g0cszf-1"})([""," border-top-left-radius:","px;border-top-right-radius:","px;",""],p,o.n_,o.n_,(function(e){return"\n border-bottom: ".concat(o.YF,"px ").concat(o.M8," ").concat((e.theme||i.Z).borders.medium,";\n ")})),h=r.default.div.withConfig({displayName:"indexstyle__WindowContentStyle",componentId:"sc-g0cszf-2"})(["overflow:auto;padding:","px 0;"," "," "," ",""],c.iI,s.w5,(0,l.eR)(),(function(e){return e.minMaxHeight&&"\n max-height: ".concat(7*c.iI,"px;\n ")}),(function(e){return!e.minMaxHeight&&"\n max-height: calc(100vh - ".concat(6.5*a,"px);\n ")}))},29480:function(e,n,t){"use strict";t.d(n,{$W:function(){return u},cl:function(){return d},cv:function(){return p},dE:function(){return l},zG:function(){return a}});var r=t(9518),i=t(44897),o=t(42631),c=t(70515),s=t(47041),l=r.default.div.withConfig({displayName:"indexstyle__SectionStyle",componentId:"sc-7a1uhf-0"})(["border-radius:","px;padding:","px;",""],o.n_,c.cd*c.iI,(function(e){return"\n background-color: ".concat((e.theme.background||i.Z.background).popup,";\n ")})),a=r.default.div.withConfig({displayName:"indexstyle__DocsStyle",componentId:"sc-7a1uhf-1"})(["> div{overflow:initial;}> div img{max-width:80%;background:white;padding:1rem;max-height:20vh;}"]),u=r.default.div.withConfig({displayName:"indexstyle__CodeEditorStyle",componentId:"sc-7a1uhf-2"})(["padding-top:","px;",""],c.cd*c.iI,(function(e){return"\n background-color: ".concat((e.theme.background||i.Z.background).codeTextarea,";\n ")})),d=r.default.div.withConfig({displayName:"indexstyle__TableContainerStyle",componentId:"sc-7a1uhf-3"})(["overflow:auto;max-height:90vh;width:100%;"," "," "," "," ",""],s.w5,(function(e){return e.hideHorizontalScrollbar&&"\n overflow-x: hidden;\n "}),(function(e){return e.width&&"\n width: ".concat(e.width,";\n ")}),(function(e){return e.height&&"\n height: ".concat(e.height,";\n ")}),(function(e){return e.maxHeight&&"\n max-height: ".concat(e.maxHeight,";\n ")})),p=r.default.div.withConfig({displayName:"indexstyle__HeaderRowStyle",componentId:"sc-7a1uhf-4"})(["padding:","px;"," "," ",""],2*c.iI,(function(e){return"\n background-color: ".concat((e.theme||i.Z).interactive.defaultBackground,";\n border-bottom: ").concat(o.YF,"px ").concat(o.M8," ").concat((e.theme||i.Z).borders.medium,";\n ")}),(function(e){return e.padding&&"\n padding: ".concat(e.padding,"px;\n ")}),(function(e){return e.rounded&&"\n border-top-left-radius: ".concat(o.n_,"px;\n border-top-right-radius: ").concat(o.n_,"px;\n ")}))},11074:function(e,n,t){"use strict";t.d(n,{Z:function(){return l}});var r=t(9518),i=t(44897),o=t(42631),c=r.default.div.withConfig({displayName:"indexstyle__PanelStyle",componentId:"sc-1rfr5wd-0"})(["border-radius:","px;"," ",""],o.n_,(function(e){return"\n background-color: ".concat((e.theme.background||i.Z.background).panel,";\n ")}),(function(e){return e.fullWidth&&"\n width: 100%;\n "})),s=t(28598);var l=function(e){var n=e.children,t=e.fullWidth,r=void 0===t||t;return(0,s.jsx)(c,{fullWidth:r,children:n})}},42765:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return be}});var r,i=t(77837),o=t(75582),c=t(82394),s=t(38860),l=t.n(s),a=t(82684),u=t(34376),d=t(71180),p=t(83455),f=t(32013),h=t(98777),m=t(89083),x=t(15338),j=t(78650),g=t(97618),Z=t(55485),b=t(85854),v=t(68562),y=t(11074),_=t(44085),w=t(38276),k=t(30160),P=t(17488),C=t(69650),O=t(12468),S=t(35686),I=["ReadWriteOnce","ReadWriteMany","ReadOnlyMany"],D=["Retain","Delete"],E=[{label:"Workspace name",required:!0,uuid:"name"}],N=[{label:"Namespace",labelDescription:"The namespace where the workspace resources will be deployed. Defaults to the value of the KUBE_NAMESPACE environment variable.",uuid:"namespace"},{label:"Service account name",placeholder:"default",uuid:"service_account_name"},{label:"Ingress name",labelDescription:"If you want to add the workspace to an existing ingress, enter the name of the ingress here. Otherwise, the workspace can be accessed through the service.",placeholder:"my-ingress",uuid:"ingress_name"}],M=[{label:"Storage class name",placeholder:"default",uuid:"storage_class_name"},{label:"Storage request size (in GB)",type:"number",uuid:"storage_request_size"}],F=t(44425),R=t(72473);!function(e){e.K8S="k8s",e.ECS="ecs",e.CLOUD_RUN="cloud_run",e.EMR="emr"}(r||(r={}));var A={ingress_name:"Ingress",namespace:"Namespace",pvc_retention_policy:"PVC retention policy",service_account_name:"Service account name",storage_access_mode:"Storage access mode",storage_class_name:"Storage class name",storage_request_size:"Storage request size (in GB)",url:"Access URL"},W={"termination_policy.enable_auto_termination":"Termination policy: auto-terminate","termination_policy.max_idle_seconds":"Termination policy: max idle seconds",pre_start_script_path:"Pre start: script path","post_start.command":"Post start: command","post_start.hook_path":"Post start: path to hook"},T=t(29480),L=t(79633),z=t(53779),U=t(72619),B=t(81728),G=t(89538),H=t(28598);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 V(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,c.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=function(e){var n=e.clusterType,t=e.onCancel,i=e.onCreate,s=e.project,l=e.workspace,u=l||{},A=u.lifecycle_config,W=void 0===A?{}:A,q=u.container_config,K=(0,a.useState)(),$=K[0],Y=K[1],Q=(0,a.useState)(!!q),X=Q[0],J=Q[1],ee=(0,a.useState)(!1),ne=ee[0],te=ee[1],re=(0,a.useState)(l),ie=re[0],oe=re[1],ce=(0,a.useState)(W),se=ce[0],le=ce[1],ae=!!l,ue=(0,a.useMemo)((function(){return null==s?void 0:s.workspace_config_defaults}),[s]);(0,a.useEffect)((function(){if(ue&&(se||le(null==ue?void 0:ue.lifecycle_config),!ie)){var e=V(V({},null==ue?void 0:ue.k8s),{},{name:null==ue?void 0:ue.name});oe(e)}}),[ue,se,ie]);var de=(0,p.Db)(S.ZP.workspaces.useUpdate(null==l?void 0:l.name,{cluster_type:n}),{onSuccess:function(e){return(0,U.wD)(e,{callback:function(e){e.error_message?Y(e.error_message):i()},onErrorCallback:function(e){var n=e.error,t=n.errors,r=n.message;Y(r),console.log(t,r)}})}}),pe=(0,o.Z)(de,2),fe=pe[0],he=pe[1].isLoading,me=(0,p.Db)(S.ZP.workspaces.useCreate(),{onSuccess:function(e){return(0,U.wD)(e,{callback:function(e){e.error_message?Y(e.error_message):i()},onErrorCallback:function(e){var n=e.error,t=n.errors,r=n.message;Y(r),console.log(t,r)}})}}),xe=(0,o.Z)(me,2),je=xe[0],ge=xe[1].isLoading,Ze=S.ZP.files.list(),be=Ze.data,ve=Ze.mutate,ye=(0,a.useMemo)((function(){return(null==be?void 0:be.files)||[]}),[be]),_e=(0,G.dd)((function(e){return(0,H.jsxs)(z.eD,{children:[(0,H.jsxs)(z.X$,{children:[(0,H.jsx)(g.Z,{alignItems:"center",children:(0,H.jsx)(k.ZP,{disableWordBreak:!0,monospace:!0,children:"Select file"})}),(0,H.jsx)(d.ZP,{iconOnly:!0,onClick:Pe,children:(0,H.jsx)(R.Close,{muted:!0})})]}),(0,H.jsx)(z.C,{children:(0,H.jsx)(j.Z,{disableContextMenu:!0,fetchFiles:ve,files:ye,isFileDisabled:null==e?void 0:e.isFileDisabled,openFile:e.onFileOpen,uuid:"ConfigureWorkspace/FileBrowser"})})]})}),{},[ye,ve],{background:!0,uuid:"file_selector"}),we=(0,o.Z)(_e,2),ke=we[0],Pe=we[1],Ce=(0,a.useCallback)((function(e){var n=e.autoComplete,t=e.disabled,r=e.label,i=e.labelDescription,o=e.placeholder,s=e.required,l=e.type,a=e.uuid;return(0,H.jsxs)("div",{children:[(0,H.jsx)(x.Z,{muted:!0}),(0,H.jsx)(w.Z,{ml:3,mr:2,my:1,children:(0,H.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,H.jsxs)(g.Z,{flex:2,flexDirection:"column",children:[(0,H.jsx)(k.ZP,{children:r}),i&&(0,H.jsx)(k.ZP,{muted:!0,children:i})]}),(0,H.jsx)(g.Z,{flex:1}),(0,H.jsx)(g.Z,{flex:1,children:(0,H.jsx)(P.Z,{autoComplete:n,disabled:t,onChange:function(e){oe((function(n){return V(V({},n),{},(0,c.Z)({},a,e.target.value))}))},placeholder:o,required:s,setContentOnMount:!0,type:l,value:(null==ie?void 0:ie[a])||""})})]})})]},a)}),[ie,oe]),Oe=(0,a.useMemo)((function(){return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Z.ZP,{children:(0,H.jsx)(w.Z,{ml:2,my:2,children:(0,H.jsx)(k.ZP,{bold:!0,sky:!0,children:"General"})})}),N.map((function(e){return Ce(e)})),(0,H.jsx)(x.Z,{muted:!0}),(0,H.jsx)(Z.ZP,{children:(0,H.jsx)(w.Z,{ml:2,my:2,children:(0,H.jsx)(k.ZP,{bold:!0,sky:!0,children:"Volume claim params"})})}),M.map((function(e){return Ce(e)})),(0,H.jsx)(x.Z,{muted:!0}),(0,H.jsx)(w.Z,{ml:3,mr:2,my:1,children:(0,H.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,H.jsx)(g.Z,{flex:3,children:(0,H.jsx)(k.ZP,{children:"Access mode"})}),(0,H.jsx)(g.Z,{flex:1,children:(0,H.jsx)(_.Z,{fullWidth:!0,label:"Access mode",onChange:function(e){e.preventDefault(),oe((function(n){return V(V({},n),{},{storage_access_mode:e.target.value})}))},placeholder:"Access mode",value:null==ie?void 0:ie.storage_access_mode,children:I.map((function(e){return(0,H.jsx)("option",{value:e,children:e},e)}))})})]})}),(0,H.jsx)(x.Z,{muted:!0}),(0,H.jsx)(w.Z,{ml:3,mr:2,my:1,children:(0,H.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,H.jsx)(g.Z,{flex:3,children:(0,H.jsx)(O.Z,{block:!0,description:(0,H.jsxs)(k.ZP,{default:!0,inline:!0,children:["Configure the retention policy for the stateful set PVC.",(0,H.jsx)("br",{}),"Retain will keep the PVC after the workspace is deleted.",(0,H.jsx)("br",{}),"Delete will delete the PVC when the workspace is deleted."]}),size:null,widthFitContent:!0,children:(0,H.jsx)(k.ZP,{children:"Retention policy (default: Retain)"})})}),(0,H.jsx)(g.Z,{flex:1,children:(0,H.jsx)(_.Z,{fullWidth:!0,label:"Retention policy",onChange:function(e){e.preventDefault(),oe((function(n){return V(V({},n),{},{pvc_retention_policy:e.target.value})}))},placeholder:"Retention policy",value:null==ie?void 0:ie.pvc_retention_policy,children:D.map((function(e){return(0,H.jsx)("option",{value:e,children:e},e)}))})})]})}),(0,H.jsx)(x.Z,{muted:!0}),(0,H.jsx)(w.Z,{ml:2,my:2,children:(0,H.jsxs)(Z.ZP,{alignItems:"center",children:[(0,H.jsx)(C.Z,{checked:X,compact:!0,onCheck:function(){return J((function(e){return!e}))}}),(0,H.jsx)(w.Z,{ml:1,children:(0,H.jsx)(k.ZP,{bold:!0,sky:!0,children:"Configure container"})})]})}),X&&(0,H.jsx)(w.Z,{ml:3,mr:2,my:1,children:(0,H.jsx)(T.$W,{children:(0,H.jsx)(m.Z,{autoHeight:!0,fontSize:12,language:F.t6.YAML,onChange:function(e){oe((function(n){return V(V({},n),{},{container_config:e})}))},tabSize:2,value:null==ie?void 0:ie.container_config,width:"100%"})})}),(0,H.jsx)(x.Z,{muted:!0})]})}),[Ce,X,ie]),Se=(0,a.useMemo)((function(){return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(w.Z,{ml:3,mr:2,my:1,children:(0,H.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,H.jsxs)(g.Z,{flex:2,flexDirection:"column",children:[(0,H.jsx)(k.ZP,{children:"Update workspace settings"}),(0,H.jsx)(k.ZP,{muted:!0,children:"Set this to true to update the workspace environment variable settings with values from this Kubernetes deployment."})]}),(0,H.jsx)(g.Z,{flex:1}),(0,H.jsx)(g.Z,{flex:1,children:(0,H.jsxs)(_.Z,{fullWidth:!0,onChange:function(e){e.preventDefault(),te("true"===e.target.value)},value:(null==ne?void 0:ne.toString())||"false",children:[(0,H.jsx)("option",{value:"true",children:"True"},"true"),(0,H.jsx)("option",{value:"false",children:"False"},"false")]})})]})}),(0,H.jsx)(x.Z,{muted:!0}),(0,H.jsx)(w.Z,{ml:2,my:2,children:(0,H.jsxs)(Z.ZP,{alignItems:"center",children:[(0,H.jsx)(C.Z,{checked:X,compact:!0,onCheck:function(){return J((function(e){return!e}))}}),(0,H.jsx)(w.Z,{ml:1,children:(0,H.jsx)(k.ZP,{bold:!0,sky:!0,children:"Configure container"})})]})}),X&&(0,H.jsx)(w.Z,{ml:3,mr:2,my:1,children:(0,H.jsx)(T.$W,{children:(0,H.jsx)(m.Z,{autoHeight:!0,fontSize:12,language:F.t6.YAML,onChange:function(e){oe((function(n){return V(V({},n),{},{container_config:e})}))},tabSize:2,value:null==ie?void 0:ie.container_config,width:"100%"})})}),(0,H.jsx)(x.Z,{muted:!0})]})}),[X,ne,ie]),Ie=(0,a.useMemo)((function(){var e,n,t,r;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Z.ZP,{children:(0,H.jsx)(w.Z,{ml:2,my:2,children:(0,H.jsx)(k.ZP,{bold:!0,sky:!0,children:"Termination policy"})})}),(0,H.jsx)(x.Z,{muted:!0}),(0,H.jsx)(w.Z,{ml:3,mr:2,my:1,children:(0,H.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,H.jsx)(g.Z,{flex:3,children:(0,H.jsx)(k.ZP,{children:"Enable auto termination"})}),(0,H.jsx)(g.Z,{flex:1,children:(0,H.jsxs)(_.Z,{fullWidth:!0,onChange:function(e){e.preventDefault(),le((function(n){return V(V({},n),{},{termination_policy:V(V({},null==n?void 0:n.termination_policy),{},{enable_auto_termination:"true"===e.target.value})})}))},value:(null==se||null===(e=se.termination_policy)||void 0===e?void 0:e.enable_auto_termination)||"false",children:[(0,H.jsx)("option",{value:"true",children:"True"},"true"),(0,H.jsx)("option",{value:"false",children:"False"},"false")]})})]})}),(0,H.jsx)(x.Z,{muted:!0}),(0,H.jsx)(w.Z,{ml:3,mr:2,my:1,children:(0,H.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,H.jsx)(g.Z,{flex:3,children:(0,H.jsx)(k.ZP,{children:"Max idle time (in seconds)"})}),(0,H.jsx)(g.Z,{flex:1,children:(0,H.jsx)(P.Z,{onChange:function(e){le((function(n){return V(V({},n),{},{termination_policy:V(V({},null==n?void 0:n.termination_policy),{},{max_idle_seconds:e.target.value})})}))},setContentOnMount:!0,type:"number",value:(null==se||null===(n=se.termination_policy)||void 0===n?void 0:n.max_idle_seconds)||""})})]})}),(0,H.jsx)(x.Z,{muted:!0}),(0,H.jsx)(Z.ZP,{children:(0,H.jsx)(w.Z,{ml:2,my:2,children:(0,H.jsx)(k.ZP,{bold:!0,sky:!0,children:"Pre start"})})}),(0,H.jsx)(x.Z,{muted:!0}),(0,H.jsx)(w.Z,{ml:3,mr:2,my:1,children:(0,H.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,H.jsxs)(g.Z,{flex:3,justifyContent:"space-between",children:[(0,H.jsx)(k.ZP,{children:"Path to pre start script"}),(0,H.jsx)(w.Z,{mr:1,children:(0,H.jsx)(d.ZP,{iconOnly:!0,noBackground:!0,noBorder:!0,onClick:function(){return ke({isFileDisabled:function(e,n){return!n&&!e.endsWith(".py")},onFileOpen:function(e,n){le((function(n){return V(V({},n),{},{pre_start_script_path:e})})),Pe()}})},children:(0,H.jsx)(R.Folder,{})})})]}),(0,H.jsx)(g.Z,{flex:1,children:(0,H.jsx)(P.Z,{onChange:function(e){le((function(n){return V(V({},n),{},{pre_start_script_path:e.target.value})}))},placeholder:"/",setContentOnMount:!0,value:(null==se?void 0:se.pre_start_script_path)||""})})]})}),(0,H.jsx)(x.Z,{muted:!0}),(0,H.jsx)(Z.ZP,{children:(0,H.jsx)(w.Z,{ml:2,my:2,children:(0,H.jsx)(k.ZP,{bold:!0,sky:!0,children:"Post start"})})}),(0,H.jsx)(x.Z,{muted:!0}),(0,H.jsx)(w.Z,{ml:3,mr:2,my:1,children:(0,H.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,H.jsx)(g.Z,{flex:3,children:(0,H.jsx)(k.ZP,{children:"Command"})}),(0,H.jsx)(g.Z,{flex:1,children:(0,H.jsx)(P.Z,{monospace:!0,onChange:function(e){le((function(n){return V(V({},n),{},{post_start:V(V({},null==n?void 0:n.post_start),{},{command:e.target.value})})}))},setContentOnMount:!0,value:(null==se||null===(t=se.post_start)||void 0===t?void 0:t.command)||""})})]})}),(0,H.jsx)(x.Z,{muted:!0}),(0,H.jsx)(w.Z,{ml:3,mr:2,my:1,children:(0,H.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,H.jsxs)(g.Z,{flex:3,justifyContent:"space-between",children:[(0,H.jsx)(k.ZP,{children:"Path to hook (optional)"}),(0,H.jsx)(w.Z,{mr:1,children:(0,H.jsx)(d.ZP,{iconOnly:!0,noBackground:!0,noBorder:!0,onClick:function(){return ke({onFileOpen:function(e,n){le((function(n){return V(V({},n),{},{post_start:V(V({},null==n?void 0:n.post_start),{},{hook_path:e})})})),Pe()}})},children:(0,H.jsx)(R.Folder,{})})})]}),(0,H.jsx)(g.Z,{flex:1,children:(0,H.jsx)(P.Z,{onChange:function(e){le((function(n){return V(V({},n),{},{post_start:V(V({},null==n?void 0:n.post_start),{},{hook_path:e.target.value})})}))},placeholder:"/",setContentOnMount:!0,value:(null==se||null===(r=se.post_start)||void 0===r?void 0:r.hook_path)||""})})]})}),(0,H.jsx)(x.Z,{muted:!0})]})}),[Pe,se,le,ke]);return(0,H.jsx)(y.Z,{children:(0,H.jsx)("div",{style:{width:"750px"},children:(0,H.jsxs)(w.Z,{p:2,children:[(0,H.jsxs)(b.Z,{level:4,children:[ae?"Update":"Create"," workspace"]}),(0,H.jsxs)("form",{children:[E.map((function(e){var n=e.autoComplete,t=e.disabled,r=e.label,i=e.required,o=e.type,s=e.uuid;return(0,H.jsx)(w.Z,{mt:2,children:(0,H.jsx)(P.Z,{autoComplete:n,disabled:t,label:r,onChange:function(e){oe((function(n){return V(V({},n),{},(0,c.Z)({},s,e.target.value))}))},required:i,setContentOnMount:!0,type:o,value:(null==ie?void 0:ie[s])||""})},s)})),(0,H.jsx)(w.Z,{mt:2,children:(0,H.jsxs)(f.Z,{noPaddingContent:!0,children:[n===r.K8S&&(0,H.jsx)(h.Z,{title:"Kubernetes",children:ae?Se:Oe}),!ae&&(0,H.jsx)(h.Z,{title:"Lifecycle (optional)",children:Ie})]})})]}),ge&&(0,H.jsx)(w.Z,{mt:1,children:(0,H.jsx)(k.ZP,{small:!0,warning:!0,children:"This may take up to a few minutes... Once the service is created, it may take another 5-10 minutes for the service to be accessible."})}),!ge&&$&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(w.Z,{mt:1,children:(0,H.jsx)(k.ZP,{danger:!0,small:!0,children:"Failed to create instance, see error below."})}),(0,H.jsx)(w.Z,{mt:1,children:(0,H.jsx)(k.ZP,{danger:!0,small:!0,children:$})})]}),(0,H.jsx)(w.Z,{my:2,children:(0,H.jsxs)(Z.ZP,{flexDirection:"row-reverse",children:[(0,H.jsx)(v.ZP,{background:L.a$,bold:!0,inline:!0,loading:ge||he,onClick:function(){var e=ie||{},t=e.name,r=e.container_config;if(t){var i=V({},ie);i.name=function(e){return"ecs"===n?(0,B.We)(e,"_"):(0,B.We)(e,"-")}(t),X&&(i.container_config=r),i.update_workspace_settings=ne,ae?fe({workspace:V(V({},i),{},{action:"patch",cluster_type:n})}):je({workspace:V(V({},i),{},{cluster_type:n,lifecycle_config:se})})}else Y("Please enter a valid name!")},uuid:"workspaces/create",children:ae?"Update":"Create"}),(0,H.jsx)(w.Z,{ml:1}),(0,H.jsx)(v.ZP,{bold:!0,inline:!0,onClick:t,uuid:"workspaces/cancel",children:"Cancel"})]})})]})})})},$=t(65956),Y=t(93808),Q=t(75499),X=t(85544),J=t(59533),ee=t(9518),ne=t(44897),te=ee.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-19701zd-0"})(["border:1px solid;border-radius:8px;",""],(function(e){return"\n border-color: ".concat((e.theme.monotone||ne.Z.monotone).grey500,";\n ")})),re=t(70515);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 oe(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,c.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 ce,se=function(e){var n=e.clusterType,t=e.fetchWorkspaces,i=e.onSuccess,c=e.setErrors,s=e.showUpdateModal,l=e.workspace,u=l.instance,f=l.lifecycle_config,h=(u.ip,u.name),j=u.status,v=(u.type,{cluster_type:n}),y=(0,p.Db)(S.ZP.workspaces.useUpdate(h,v),{onSuccess:function(e){return(0,U.wD)(e,{callback:function(){t(),i()},onErrorCallback:function(e,n){return c({errors:n,response:e})}})}}),_=(0,o.Z)(y,2),P=_[0],C=_[1].isLoading,O=(0,p.Db)(S.ZP.workspaces.useDelete(h,v),{onSuccess:function(e){return(0,U.wD)(e,{callback:function(){t(),i()},onErrorCallback:function(e,n){return c({errors:n,response:e})}})}}),I=(0,o.Z)(O,2),D=I[0],E=I[1].isLoading,N=(0,a.useMemo)((function(){if(f){var e={};return Object.entries(f).map((function(n){var t=(0,o.Z)(n,2),r=t[0],i=t[1];i&&"object"==typeof i?Object.entries(i).map((function(n){var t=(0,o.Z)(n,2),i=t[0],c=t[1];e["".concat(r,".").concat(i)]=c})):e[r]=i})),e}}),[f]),M=(0,a.useMemo)((function(){var e=u.status,t=[];return"ecs"===n&&("STOPPED"===e?t.unshift({label:"Resume instance",onClick:function(){return P({workspace:{action:"resume",cluster_type:n,name:u.name,task_arn:u.task_arn}})},props:{loading:C,primary:!0},uuid:"resume_instance"}):"RUNNING"===e&&t.unshift({label:"Stop instance",onClick:function(){return P({workspace:{action:"stop",cluster_type:n,name:u.name,task_arn:u.task_arn}})},props:{loading:C,warning:!0},uuid:"stop_instance"})),"k8s"===n&&("STOPPED"===e?t.unshift({label:"Resume instance",onClick:function(){return P({workspace:{action:"resume",cluster_type:n,name:u.name}})},props:{loading:C,primary:!0},uuid:"resume_instance"}):"RUNNING"===e&&t.unshift({label:"Stop instance",onClick:function(){return P({workspace:{action:"stop",cluster_type:n,name:u.name}})},props:{loading:C,warning:!0},uuid:"stop_instance"}),t.push({label:"Update",onClick:function(){i(),s()},props:{},uuid:"update_instance"})),null==l||!l.ingress_name||null!=l&&l.url||t.push({label:"Add to ingress",onClick:function(){return P({workspace:{action:"add_to_ingress",cluster_type:n,name:u.name}})},props:{default:!0,loading:C},uuid:"re_add_to_ingress"}),t}),[n,u,C,i,s,P,l]),L=(0,a.useMemo)((function(){return(0,H.jsx)(d.ZP,{danger:!0,loading:E,onClick:function(){window.confirm("Are you sure you want to delete workspace ".concat(h,"?"))&&D()},children:"Delete workspace"})}),[D,E,h]);return(0,H.jsx)(H.Fragment,{children:(0,H.jsxs)(w.Z,{p:2,children:[(0,H.jsx)(w.Z,{mb:2,children:(0,H.jsxs)(Z.ZP,{alignItems:"center",children:[(0,H.jsx)(R.Folder,{size:2*re.iI}),(0,H.jsx)(w.Z,{mr:1}),(0,H.jsx)(b.Z,{level:3,children:null==l?void 0:l.name})]})}),(0,H.jsx)(w.Z,{mb:2,children:(0,H.jsxs)(k.ZP,{children:["Status: ",(0,H.jsx)(k.ZP,{bold:!0,danger:"STOPPED"===j,default:"PROVISIONING"===j,inline:!0,success:"RUNNING"===j,warning:"PENDING"===j,children:j})]})}),!M||0==M.length&&(0,H.jsx)(w.Z,{mb:2,children:L}),M&&M.length>0&&(0,H.jsx)(w.Z,{mb:2,children:(0,H.jsxs)(Z.ZP,{justifyContent:"space-between",children:[(0,H.jsx)(g.Z,{children:M.map((function(e){var n=e.label,t=e.onClick,r=e.uuid,i=e.props;return(0,H.jsx)(w.Z,{mr:1,children:(0,H.jsx)(d.ZP,oe(oe({},i),{},{onClick:t,children:n}))},r)}))}),L]})}),n===r.K8S&&(0,H.jsxs)(te,{children:[Object.entries(A).map((function(e,n){var t=(0,o.Z)(e,2),r=t[0],i=t[1];return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(w.Z,{mx:2,my:2,children:(0,H.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,H.jsx)(g.Z,{flex:4,children:(0,H.jsx)(k.ZP,{muted:!0,children:i})}),(0,H.jsx)(g.Z,{flex:2,flexDirection:"row-reverse",children:(0,H.jsx)(k.ZP,{bold:!0,children:(null==l?void 0:l[r])||"N/A"})})]})},r),n!==Object.entries(A).length-1&&(0,H.jsx)(x.Z,{muted:!0})]})})),(null==l?void 0:l.container_config)&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(x.Z,{muted:!0}),(0,H.jsxs)(w.Z,{mx:2,my:2,children:[(0,H.jsx)(k.ZP,{muted:!0,children:"Container config"}),(0,H.jsx)(w.Z,{mt:1}),(0,H.jsx)(T.$W,{children:(0,H.jsx)(m.Z,{autoHeight:!0,fontSize:12,language:F.t6.YAML,readOnly:!0,tabSize:2,value:null==l?void 0:l.container_config,width:"100%"})})]})]})]}),N&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(w.Z,{my:2,children:(0,H.jsx)(b.Z,{default:!0,level:5,children:"Lifecycle Properties"})}),(0,H.jsx)(te,{children:Object.entries(W).map((function(e,n){var t,r=(0,o.Z)(e,2),i=r[0],c=r[1];return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(w.Z,{mx:2,my:2,children:(0,H.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,H.jsx)(g.Z,{flex:3,children:(0,H.jsx)(k.ZP,{muted:!0,children:c})}),(0,H.jsx)(g.Z,{flex:1,flexDirection:"row-reverse",children:(0,H.jsx)(k.ZP,{bold:!0,children:null===(t=N[i])||void 0===t?void 0:t.toString()})})]})},i),n!==Object.entries(W).length-1&&(0,H.jsx)(x.Z,{muted:!0})]})}))})]})]})})};!function(e){e.ALL="__all__",e.NAMESPACE="namespace[]"}(ce||(ce={}));var le=t(42631),ae=t(11498),ue=t(75083),de=t(69419),pe=t(53808),fe="workspace_list_filters";function he(e){return(0,pe.t8)(fe,e),e}var me=t(15610),xe=t(42122);function je(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?je(Object(t),!0).forEach((function(n){(0,c.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):je(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function Ze(){var e=(0,u.useRouter)(),n=S.ZP.statuses.list().data,t=(0,a.useState)(null),i=t[0],s=t[1],l=(0,de.iV)(),p=(0,a.useMemo)((function(){return ge({},(0,de.DQ)(l,[ce.NAMESPACE]))}),[l]),f=(0,a.useMemo)((function(){var e,t;return(null==n||null===(e=n.statuses)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.instance_type)||"ecs"}),[n]),h=S.ZP.projects.list({},{revalidateOnFocus:!1}).data,m=(0,a.useMemo)((function(){var e;return null==h||null===(e=h.projects)||void 0===e?void 0:e[0]}),[h]),x=S.ZP.workspaces.list(ge(ge({},p),{},{cluster_type:f}),{revalidateOnFocus:!1}),j=x.data,g=x.isValidating,Z=x.mutate,b=(0,a.useMemo)((function(){var e;return null==j||null===(e=j.workspaces)||void 0===e?void 0:e.filter((function(e){return e.name}))}),[j]),v=(0,G.dd)((function(e){var n=e.workspace;return(0,H.jsx)(K,{clusterType:f,onCancel:w,onCreate:function(){Z(),w()},project:m,workspace:n})}),{},[f,Z,m],{background:!0,disableClickOutside:!0,disableEscape:!0,uuid:"configure_workspace"}),y=(0,o.Z)(v,2),_=y[0],w=y[1],P=(0,G.dd)((function(e){var n=e.workspace;return(0,H.jsx)($.Z,{children:(0,H.jsx)("div",{style:{width:"750px"},children:(0,H.jsx)(se,{clusterType:f,fetchWorkspaces:Z,onSuccess:I,setErrors:s,showUpdateModal:function(){return _({workspace:n})},workspace:n})})})}),{},[f,Z,s,b],{background:!0,uuid:"workspace_detail"}),C=(0,o.Z)(P,2),O=C[0],I=C[1],D=(0,a.useCallback)((function(e){var n=null==b?void 0:b[e];O({workspace:n})}),[O,b]);(0,a.useEffect)((function(){var e={};if((0,xe.Qr)(p)){var n={},t=(0,pe.U2)(fe,{});t&&Object.entries(t).forEach((function(e){var t=(0,o.Z)(e,2),r=t[0],i=t[1];null!=i&&(ae.RG.includes(r)?n[r]=i:(n[r]=[],Object.entries(i).forEach((function(e){var t=(0,o.Z)(e,2),i=t[0];t[1]&&n[r].push(i)}))))})),(0,xe.Qr)(n)||(e={},Object.entries(ge(ge({},e),n)||{}).forEach((function(n){var t=(0,o.Z)(n,2),r=t[0],i=t[1];null!=i&&(e[r]=i)})))}else{var r={};Object.entries(p).forEach((function(e){var n=(0,o.Z)(e,2),t=n[0],i=n[1];r[t]={};var c,s=i;null!=i&&(ae.RG.includes(t)?r[t]=s:(Array.isArray(s)||(s=[s]),s&&Array.isArray(s)&&(null===(c=s)||void 0===c||c.forEach((function(e){r[t][e]=!0})))))})),he((0,xe.hB)(r))}(0,xe.Qr)(e)||(0,me.u)((0,xe.hB)(e),{pushHistory:!1})}),[p]);var E=(0,a.useMemo)((function(){var n={},t={};return f===r.K8S&&(n={namespace:[ce.ALL]},t={namespace:(0,c.Z)({},ce.ALL,"All namespaces")}),(0,H.jsx)(X.Z,{addButtonProps:{label:"Create new workspace",onClick:_},extraActionButtonProps:{Icon:R.Refresh,disabled:!1,isLoading:g,onClick:Z,tooltip:"Refresh workspaces"},filterOptions:n,filterValueLabelMapping:t,onClickFilterDefaults:function(){he({}),e.push("/manage")},onFilterApply:function(e,n){Object.values(n).every((function(e){return!(null!=e&&e.length)}))&&he({})},query:p})}),[f,Z,g,p,e,_]);return(0,H.jsx)(J.Z,{breadcrumbs:[{bold:!0,label:function(){return"Workspaces"}}],errors:i,pageName:ue.L6.WORKSPACES,setErrors:s,subheaderChildren:E,children:(0,H.jsx)(Q.Z,{columnFlex:[2,4,2,3,1,null],columns:[{uuid:"Status"},{uuid:"Instance Name"},{uuid:"Type"},{uuid:"URL/IP"},{uuid:"Open"}],onClickRow:["ecs","k8s"].includes(f)&&D,rows:null==b?void 0:b.map((function(e){var n=e.instance,t=e.url,r=n.ip,i=n.name,o=n.status,c=n.type,s=t||r,l=s;return s&&!s.includes("http")&&(l="http://".concat(s),"ecs"===f&&(l="http://".concat(s,":6789"))),[(0,H.jsx)(d.ZP,{borderRadius:"".concat(le.D7,"px"),danger:"STOPPED"===o,default:"PROVISIONING"===o,notClickable:!0,padding:"6px",success:"RUNNING"===o,warning:"PENDING"===o,children:(0,B.vg)(o)},"status"),(0,H.jsx)(k.ZP,{children:i},"name"),(0,H.jsx)(k.ZP,{children:(0,B.vg)(c)},"type"),(0,H.jsx)(k.ZP,{children:s||"N/A"},"ip"),(0,H.jsx)(d.ZP,{disabled:!s,iconOnly:!0,onClick:function(){return window.open(l)},children:(0,H.jsx)(R.Expand,{size:2*re.iI})},"open_button")]}))})})}Ze.getInitialProps=(0,i.Z)(l().mark((function e(){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",{});case 1:case"end":return e.stop()}}),e)})));var be=(0,Y.Z)(Ze)},13157:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/manage",function(){return t(42765)}])},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 i}});var r=t(61049);function i(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 o}});var r=t(12539),i=t(80022);function o(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,i.Z)(e)}}},function(e){e.O(0,[1557,1598,5544,9774,2888,179],(function(){return n=13157,e(e.s=n);var n}));var n=e.O();_N_E=n}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8867],{53779:function(e,n,t){"use strict";t.d(n,{C:function(){return h},X$:function(){return f},eD:function(){return d}});var r=t(9518),i=t(44897),o=t(42631),c=t(70515),s=t(47041),l=t(91437),a=6.25*c.iI,u=100*c.iI,d=r.default.div.withConfig({displayName:"indexstyle__WindowContainerStyle",componentId:"sc-g0cszf-0"})(["border-radius:","px;width:100%;max-width:","px;z-index:101;position:absolute;overflow:hidden;top:50%;left:50%;transform:translate(-50%,-50%);",""],o.n_,u,(function(e){return"\n box-shadow: ".concat((e.theme||i.Z).shadow.window,";\n background-color: ").concat((e.theme||i.Z).background.panel,";\n ")})),p=(0,r.css)(["display:flex;align-items:center;justify-content:space-between;height:","px;padding:","px ","px;",""],a,c.iI,c.cd*c.iI,(function(e){return"\n background-color: ".concat((e.theme||i.Z).background.output,";\n ")})),f=r.default.div.withConfig({displayName:"indexstyle__WindowHeaderStyle",componentId:"sc-g0cszf-1"})([""," border-top-left-radius:","px;border-top-right-radius:","px;",""],p,o.n_,o.n_,(function(e){return"\n border-bottom: ".concat(o.YF,"px ").concat(o.M8," ").concat((e.theme||i.Z).borders.medium,";\n ")})),h=r.default.div.withConfig({displayName:"indexstyle__WindowContentStyle",componentId:"sc-g0cszf-2"})(["overflow:auto;padding:","px 0;"," "," "," ",""],c.iI,s.w5,(0,l.eR)(),(function(e){return e.minMaxHeight&&"\n max-height: ".concat(7*c.iI,"px;\n ")}),(function(e){return!e.minMaxHeight&&"\n max-height: calc(100vh - ".concat(6.5*a,"px);\n ")}))},29480:function(e,n,t){"use strict";t.d(n,{$W:function(){return u},cl:function(){return d},cv:function(){return p},dE:function(){return l},zG:function(){return a}});var r=t(9518),i=t(44897),o=t(42631),c=t(70515),s=t(47041),l=r.default.div.withConfig({displayName:"indexstyle__SectionStyle",componentId:"sc-7a1uhf-0"})(["border-radius:","px;padding:","px;",""],o.n_,c.cd*c.iI,(function(e){return"\n background-color: ".concat((e.theme.background||i.Z.background).popup,";\n ")})),a=r.default.div.withConfig({displayName:"indexstyle__DocsStyle",componentId:"sc-7a1uhf-1"})(["> div{overflow:initial;}> div img{max-width:80%;background:white;padding:1rem;max-height:20vh;}"]),u=r.default.div.withConfig({displayName:"indexstyle__CodeEditorStyle",componentId:"sc-7a1uhf-2"})(["padding-top:","px;",""],c.cd*c.iI,(function(e){return"\n background-color: ".concat((e.theme.background||i.Z.background).codeTextarea,";\n ")})),d=r.default.div.withConfig({displayName:"indexstyle__TableContainerStyle",componentId:"sc-7a1uhf-3"})(["overflow:auto;max-height:90vh;width:100%;"," "," "," "," ",""],s.w5,(function(e){return e.hideHorizontalScrollbar&&"\n overflow-x: hidden;\n "}),(function(e){return e.width&&"\n width: ".concat(e.width,";\n ")}),(function(e){return e.height&&"\n height: ".concat(e.height,";\n ")}),(function(e){return e.maxHeight&&"\n max-height: ".concat(e.maxHeight,";\n ")})),p=r.default.div.withConfig({displayName:"indexstyle__HeaderRowStyle",componentId:"sc-7a1uhf-4"})(["padding:","px;"," "," ",""],2*c.iI,(function(e){return"\n background-color: ".concat((e.theme||i.Z).interactive.defaultBackground,";\n border-bottom: ").concat(o.YF,"px ").concat(o.M8," ").concat((e.theme||i.Z).borders.medium,";\n ")}),(function(e){return e.padding&&"\n padding: ".concat(e.padding,"px;\n ")}),(function(e){return e.rounded&&"\n border-top-left-radius: ".concat(o.n_,"px;\n border-top-right-radius: ").concat(o.n_,"px;\n ")}))},11074:function(e,n,t){"use strict";t.d(n,{Z:function(){return l}});var r=t(9518),i=t(44897),o=t(42631),c=r.default.div.withConfig({displayName:"indexstyle__PanelStyle",componentId:"sc-1rfr5wd-0"})(["border-radius:","px;"," ",""],o.n_,(function(e){return"\n background-color: ".concat((e.theme.background||i.Z.background).panel,";\n ")}),(function(e){return e.fullWidth&&"\n width: 100%;\n "})),s=t(28598);var l=function(e){var n=e.children,t=e.fullWidth,r=void 0===t||t;return(0,s.jsx)(c,{fullWidth:r,children:n})}},42765:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return be}});var r,i=t(77837),o=t(75582),c=t(82394),s=t(38860),l=t.n(s),a=t(82684),u=t(34376),d=t(71180),p=t(83455),f=t(32013),h=t(98777),m=t(89083),x=t(15338),j=t(78650),g=t(97618),Z=t(55485),b=t(85854),v=t(68562),y=t(11074),_=t(44085),w=t(38276),k=t(30160),P=t(17488),C=t(69650),O=t(12468),S=t(35686),I=["ReadWriteOnce","ReadWriteMany","ReadOnlyMany"],D=["Retain","Delete"],E=[{label:"Workspace name",required:!0,uuid:"name"}],N=[{label:"Namespace",labelDescription:"The namespace where the workspace resources will be deployed. Defaults to the value of the KUBE_NAMESPACE environment variable.",uuid:"namespace"},{label:"Service account name",placeholder:"default",uuid:"service_account_name"},{label:"Ingress name",labelDescription:"If you want to add the workspace to an existing ingress, enter the name of the ingress here. Otherwise, the workspace can be accessed through the service.",placeholder:"my-ingress",uuid:"ingress_name"}],M=[{label:"Storage class name",placeholder:"default",uuid:"storage_class_name"},{label:"Storage request size (in GB)",type:"number",uuid:"storage_request_size"}],F=t(44425),R=t(72473);!function(e){e.K8S="k8s",e.ECS="ecs",e.CLOUD_RUN="cloud_run",e.EMR="emr"}(r||(r={}));var A={ingress_name:"Ingress",namespace:"Namespace",pvc_retention_policy:"PVC retention policy",service_account_name:"Service account name",storage_access_mode:"Storage access mode",storage_class_name:"Storage class name",storage_request_size:"Storage request size (in GB)",url:"Access URL"},W={"termination_policy.enable_auto_termination":"Termination policy: auto-terminate","termination_policy.max_idle_seconds":"Termination policy: max idle seconds",pre_start_script_path:"Pre start: script path","post_start.command":"Post start: command","post_start.hook_path":"Post start: path to hook"},T=t(29480),L=t(79633),z=t(53779),U=t(72619),B=t(81728),G=t(89538),H=t(28598);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 V(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,c.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=function(e){var n=e.clusterType,t=e.onCancel,i=e.onCreate,s=e.project,l=e.workspace,u=l||{},A=u.lifecycle_config,W=void 0===A?{}:A,q=u.container_config,K=(0,a.useState)(),$=K[0],Y=K[1],Q=(0,a.useState)(!!q),X=Q[0],J=Q[1],ee=(0,a.useState)(!1),ne=ee[0],te=ee[1],re=(0,a.useState)(l),ie=re[0],oe=re[1],ce=(0,a.useState)(W),se=ce[0],le=ce[1],ae=!!l,ue=(0,a.useMemo)((function(){return null==s?void 0:s.workspace_config_defaults}),[s]);(0,a.useEffect)((function(){if(ue&&(se||le(null==ue?void 0:ue.lifecycle_config),!ie)){var e=V(V({},null==ue?void 0:ue.k8s),{},{name:null==ue?void 0:ue.name});oe(e)}}),[ue,se,ie]);var de=(0,p.Db)(S.ZP.workspaces.useUpdate(null==l?void 0:l.name,{cluster_type:n}),{onSuccess:function(e){return(0,U.wD)(e,{callback:function(e){e.error_message?Y(e.error_message):i()},onErrorCallback:function(e){var n=e.error,t=n.errors,r=n.message;Y(r),console.log(t,r)}})}}),pe=(0,o.Z)(de,2),fe=pe[0],he=pe[1].isLoading,me=(0,p.Db)(S.ZP.workspaces.useCreate(),{onSuccess:function(e){return(0,U.wD)(e,{callback:function(e){e.error_message?Y(e.error_message):i()},onErrorCallback:function(e){var n=e.error,t=n.errors,r=n.message;Y(r),console.log(t,r)}})}}),xe=(0,o.Z)(me,2),je=xe[0],ge=xe[1].isLoading,Ze=S.ZP.files.list(),be=Ze.data,ve=Ze.mutate,ye=(0,a.useMemo)((function(){return(null==be?void 0:be.files)||[]}),[be]),_e=(0,G.dd)((function(e){return(0,H.jsxs)(z.eD,{children:[(0,H.jsxs)(z.X$,{children:[(0,H.jsx)(g.Z,{alignItems:"center",children:(0,H.jsx)(k.ZP,{disableWordBreak:!0,monospace:!0,children:"Select file"})}),(0,H.jsx)(d.ZP,{iconOnly:!0,onClick:Pe,children:(0,H.jsx)(R.Close,{muted:!0})})]}),(0,H.jsx)(z.C,{children:(0,H.jsx)(j.Z,{disableContextMenu:!0,fetchFiles:ve,files:ye,isFileDisabled:null==e?void 0:e.isFileDisabled,openFile:e.onFileOpen,uuid:"ConfigureWorkspace/FileBrowser"})})]})}),{},[ye,ve],{background:!0,uuid:"file_selector"}),we=(0,o.Z)(_e,2),ke=we[0],Pe=we[1],Ce=(0,a.useCallback)((function(e){var n=e.autoComplete,t=e.disabled,r=e.label,i=e.labelDescription,o=e.placeholder,s=e.required,l=e.type,a=e.uuid;return(0,H.jsxs)("div",{children:[(0,H.jsx)(x.Z,{muted:!0}),(0,H.jsx)(w.Z,{ml:3,mr:2,my:1,children:(0,H.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,H.jsxs)(g.Z,{flex:2,flexDirection:"column",children:[(0,H.jsx)(k.ZP,{children:r}),i&&(0,H.jsx)(k.ZP,{muted:!0,children:i})]}),(0,H.jsx)(g.Z,{flex:1}),(0,H.jsx)(g.Z,{flex:1,children:(0,H.jsx)(P.Z,{autoComplete:n,disabled:t,onChange:function(e){oe((function(n){return V(V({},n),{},(0,c.Z)({},a,e.target.value))}))},placeholder:o,required:s,setContentOnMount:!0,type:l,value:(null==ie?void 0:ie[a])||""})})]})})]},a)}),[ie,oe]),Oe=(0,a.useMemo)((function(){return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Z.ZP,{children:(0,H.jsx)(w.Z,{ml:2,my:2,children:(0,H.jsx)(k.ZP,{bold:!0,sky:!0,children:"General"})})}),N.map((function(e){return Ce(e)})),(0,H.jsx)(x.Z,{muted:!0}),(0,H.jsx)(Z.ZP,{children:(0,H.jsx)(w.Z,{ml:2,my:2,children:(0,H.jsx)(k.ZP,{bold:!0,sky:!0,children:"Volume claim params"})})}),M.map((function(e){return Ce(e)})),(0,H.jsx)(x.Z,{muted:!0}),(0,H.jsx)(w.Z,{ml:3,mr:2,my:1,children:(0,H.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,H.jsx)(g.Z,{flex:3,children:(0,H.jsx)(k.ZP,{children:"Access mode"})}),(0,H.jsx)(g.Z,{flex:1,children:(0,H.jsx)(_.Z,{fullWidth:!0,label:"Access mode",onChange:function(e){e.preventDefault(),oe((function(n){return V(V({},n),{},{storage_access_mode:e.target.value})}))},placeholder:"Access mode",value:null==ie?void 0:ie.storage_access_mode,children:I.map((function(e){return(0,H.jsx)("option",{value:e,children:e},e)}))})})]})}),(0,H.jsx)(x.Z,{muted:!0}),(0,H.jsx)(w.Z,{ml:3,mr:2,my:1,children:(0,H.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,H.jsx)(g.Z,{flex:3,children:(0,H.jsx)(O.Z,{block:!0,description:(0,H.jsxs)(k.ZP,{default:!0,inline:!0,children:["Configure the retention policy for the stateful set PVC.",(0,H.jsx)("br",{}),"Retain will keep the PVC after the workspace is deleted.",(0,H.jsx)("br",{}),"Delete will delete the PVC when the workspace is deleted."]}),size:null,widthFitContent:!0,children:(0,H.jsx)(k.ZP,{children:"Retention policy (default: Retain)"})})}),(0,H.jsx)(g.Z,{flex:1,children:(0,H.jsx)(_.Z,{fullWidth:!0,label:"Retention policy",onChange:function(e){e.preventDefault(),oe((function(n){return V(V({},n),{},{pvc_retention_policy:e.target.value})}))},placeholder:"Retention policy",value:null==ie?void 0:ie.pvc_retention_policy,children:D.map((function(e){return(0,H.jsx)("option",{value:e,children:e},e)}))})})]})}),(0,H.jsx)(x.Z,{muted:!0}),(0,H.jsx)(w.Z,{ml:2,my:2,children:(0,H.jsxs)(Z.ZP,{alignItems:"center",children:[(0,H.jsx)(C.Z,{checked:X,compact:!0,onCheck:function(){return J((function(e){return!e}))}}),(0,H.jsx)(w.Z,{ml:1,children:(0,H.jsx)(k.ZP,{bold:!0,sky:!0,children:"Configure container"})})]})}),X&&(0,H.jsx)(w.Z,{ml:3,mr:2,my:1,children:(0,H.jsx)(T.$W,{children:(0,H.jsx)(m.Z,{autoHeight:!0,fontSize:12,language:F.t6.YAML,onChange:function(e){oe((function(n){return V(V({},n),{},{container_config:e})}))},tabSize:2,value:null==ie?void 0:ie.container_config,width:"100%"})})}),(0,H.jsx)(x.Z,{muted:!0})]})}),[Ce,X,ie]),Se=(0,a.useMemo)((function(){return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(w.Z,{ml:3,mr:2,my:1,children:(0,H.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,H.jsxs)(g.Z,{flex:2,flexDirection:"column",children:[(0,H.jsx)(k.ZP,{children:"Update workspace settings"}),(0,H.jsx)(k.ZP,{muted:!0,children:"Set this to true to update the workspace environment variable settings with values from this Kubernetes deployment."})]}),(0,H.jsx)(g.Z,{flex:1}),(0,H.jsx)(g.Z,{flex:1,children:(0,H.jsxs)(_.Z,{fullWidth:!0,onChange:function(e){e.preventDefault(),te("true"===e.target.value)},value:(null==ne?void 0:ne.toString())||"false",children:[(0,H.jsx)("option",{value:"true",children:"True"},"true"),(0,H.jsx)("option",{value:"false",children:"False"},"false")]})})]})}),(0,H.jsx)(x.Z,{muted:!0}),(0,H.jsx)(w.Z,{ml:2,my:2,children:(0,H.jsxs)(Z.ZP,{alignItems:"center",children:[(0,H.jsx)(C.Z,{checked:X,compact:!0,onCheck:function(){return J((function(e){return!e}))}}),(0,H.jsx)(w.Z,{ml:1,children:(0,H.jsx)(k.ZP,{bold:!0,sky:!0,children:"Configure container"})})]})}),X&&(0,H.jsx)(w.Z,{ml:3,mr:2,my:1,children:(0,H.jsx)(T.$W,{children:(0,H.jsx)(m.Z,{autoHeight:!0,fontSize:12,language:F.t6.YAML,onChange:function(e){oe((function(n){return V(V({},n),{},{container_config:e})}))},tabSize:2,value:null==ie?void 0:ie.container_config,width:"100%"})})}),(0,H.jsx)(x.Z,{muted:!0})]})}),[X,ne,ie]),Ie=(0,a.useMemo)((function(){var e,n,t,r;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Z.ZP,{children:(0,H.jsx)(w.Z,{ml:2,my:2,children:(0,H.jsx)(k.ZP,{bold:!0,sky:!0,children:"Termination policy"})})}),(0,H.jsx)(x.Z,{muted:!0}),(0,H.jsx)(w.Z,{ml:3,mr:2,my:1,children:(0,H.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,H.jsx)(g.Z,{flex:3,children:(0,H.jsx)(k.ZP,{children:"Enable auto termination"})}),(0,H.jsx)(g.Z,{flex:1,children:(0,H.jsxs)(_.Z,{fullWidth:!0,onChange:function(e){e.preventDefault(),le((function(n){return V(V({},n),{},{termination_policy:V(V({},null==n?void 0:n.termination_policy),{},{enable_auto_termination:"true"===e.target.value})})}))},value:(null==se||null===(e=se.termination_policy)||void 0===e?void 0:e.enable_auto_termination)||"false",children:[(0,H.jsx)("option",{value:"true",children:"True"},"true"),(0,H.jsx)("option",{value:"false",children:"False"},"false")]})})]})}),(0,H.jsx)(x.Z,{muted:!0}),(0,H.jsx)(w.Z,{ml:3,mr:2,my:1,children:(0,H.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,H.jsx)(g.Z,{flex:3,children:(0,H.jsx)(k.ZP,{children:"Max idle time (in seconds)"})}),(0,H.jsx)(g.Z,{flex:1,children:(0,H.jsx)(P.Z,{onChange:function(e){le((function(n){return V(V({},n),{},{termination_policy:V(V({},null==n?void 0:n.termination_policy),{},{max_idle_seconds:e.target.value})})}))},setContentOnMount:!0,type:"number",value:(null==se||null===(n=se.termination_policy)||void 0===n?void 0:n.max_idle_seconds)||""})})]})}),(0,H.jsx)(x.Z,{muted:!0}),(0,H.jsx)(Z.ZP,{children:(0,H.jsx)(w.Z,{ml:2,my:2,children:(0,H.jsx)(k.ZP,{bold:!0,sky:!0,children:"Pre start"})})}),(0,H.jsx)(x.Z,{muted:!0}),(0,H.jsx)(w.Z,{ml:3,mr:2,my:1,children:(0,H.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,H.jsxs)(g.Z,{flex:3,justifyContent:"space-between",children:[(0,H.jsx)(k.ZP,{children:"Path to pre start script"}),(0,H.jsx)(w.Z,{mr:1,children:(0,H.jsx)(d.ZP,{iconOnly:!0,noBackground:!0,noBorder:!0,onClick:function(){return ke({isFileDisabled:function(e,n){return!n&&!e.endsWith(".py")},onFileOpen:function(e,n){le((function(n){return V(V({},n),{},{pre_start_script_path:e})})),Pe()}})},children:(0,H.jsx)(R.Folder,{})})})]}),(0,H.jsx)(g.Z,{flex:1,children:(0,H.jsx)(P.Z,{onChange:function(e){le((function(n){return V(V({},n),{},{pre_start_script_path:e.target.value})}))},placeholder:"/",setContentOnMount:!0,value:(null==se?void 0:se.pre_start_script_path)||""})})]})}),(0,H.jsx)(x.Z,{muted:!0}),(0,H.jsx)(Z.ZP,{children:(0,H.jsx)(w.Z,{ml:2,my:2,children:(0,H.jsx)(k.ZP,{bold:!0,sky:!0,children:"Post start"})})}),(0,H.jsx)(x.Z,{muted:!0}),(0,H.jsx)(w.Z,{ml:3,mr:2,my:1,children:(0,H.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,H.jsx)(g.Z,{flex:3,children:(0,H.jsx)(k.ZP,{children:"Command"})}),(0,H.jsx)(g.Z,{flex:1,children:(0,H.jsx)(P.Z,{monospace:!0,onChange:function(e){le((function(n){return V(V({},n),{},{post_start:V(V({},null==n?void 0:n.post_start),{},{command:e.target.value})})}))},setContentOnMount:!0,value:(null==se||null===(t=se.post_start)||void 0===t?void 0:t.command)||""})})]})}),(0,H.jsx)(x.Z,{muted:!0}),(0,H.jsx)(w.Z,{ml:3,mr:2,my:1,children:(0,H.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,H.jsxs)(g.Z,{flex:3,justifyContent:"space-between",children:[(0,H.jsx)(k.ZP,{children:"Path to hook (optional)"}),(0,H.jsx)(w.Z,{mr:1,children:(0,H.jsx)(d.ZP,{iconOnly:!0,noBackground:!0,noBorder:!0,onClick:function(){return ke({onFileOpen:function(e,n){le((function(n){return V(V({},n),{},{post_start:V(V({},null==n?void 0:n.post_start),{},{hook_path:e})})})),Pe()}})},children:(0,H.jsx)(R.Folder,{})})})]}),(0,H.jsx)(g.Z,{flex:1,children:(0,H.jsx)(P.Z,{onChange:function(e){le((function(n){return V(V({},n),{},{post_start:V(V({},null==n?void 0:n.post_start),{},{hook_path:e.target.value})})}))},placeholder:"/",setContentOnMount:!0,value:(null==se||null===(r=se.post_start)||void 0===r?void 0:r.hook_path)||""})})]})}),(0,H.jsx)(x.Z,{muted:!0})]})}),[Pe,se,le,ke]);return(0,H.jsx)(y.Z,{children:(0,H.jsx)("div",{style:{width:"750px"},children:(0,H.jsxs)(w.Z,{p:2,children:[(0,H.jsxs)(b.Z,{level:4,children:[ae?"Update":"Create"," workspace"]}),(0,H.jsxs)("form",{children:[E.map((function(e){var n=e.autoComplete,t=e.disabled,r=e.label,i=e.required,o=e.type,s=e.uuid;return(0,H.jsx)(w.Z,{mt:2,children:(0,H.jsx)(P.Z,{autoComplete:n,disabled:t,label:r,onChange:function(e){oe((function(n){return V(V({},n),{},(0,c.Z)({},s,e.target.value))}))},required:i,setContentOnMount:!0,type:o,value:(null==ie?void 0:ie[s])||""})},s)})),(0,H.jsx)(w.Z,{mt:2,children:(0,H.jsxs)(f.Z,{noPaddingContent:!0,children:[n===r.K8S&&(0,H.jsx)(h.Z,{title:"Kubernetes",children:ae?Se:Oe}),!ae&&(0,H.jsx)(h.Z,{title:"Lifecycle (optional)",children:Ie})]})})]}),ge&&(0,H.jsx)(w.Z,{mt:1,children:(0,H.jsx)(k.ZP,{small:!0,warning:!0,children:"This may take up to a few minutes... Once the service is created, it may take another 5-10 minutes for the service to be accessible."})}),!ge&&$&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(w.Z,{mt:1,children:(0,H.jsx)(k.ZP,{danger:!0,small:!0,children:"Failed to create instance, see error below."})}),(0,H.jsx)(w.Z,{mt:1,children:(0,H.jsx)(k.ZP,{danger:!0,small:!0,children:$})})]}),(0,H.jsx)(w.Z,{my:2,children:(0,H.jsxs)(Z.ZP,{flexDirection:"row-reverse",children:[(0,H.jsx)(v.ZP,{background:L.a$,bold:!0,inline:!0,loading:ge||he,onClick:function(){var e=ie||{},t=e.name,r=e.container_config;if(t){var i=V({},ie);i.name=function(e){return"ecs"===n?(0,B.We)(e,"_"):(0,B.We)(e,"-")}(t),X&&(i.container_config=r),i.update_workspace_settings=ne,ae?fe({workspace:V(V({},i),{},{action:"patch",cluster_type:n})}):je({workspace:V(V({},i),{},{cluster_type:n,lifecycle_config:se})})}else Y("Please enter a valid name!")},uuid:"workspaces/create",children:ae?"Update":"Create"}),(0,H.jsx)(w.Z,{ml:1}),(0,H.jsx)(v.ZP,{bold:!0,inline:!0,onClick:t,uuid:"workspaces/cancel",children:"Cancel"})]})})]})})})},$=t(65956),Y=t(93808),Q=t(75499),X=t(85544),J=t(59533),ee=t(9518),ne=t(44897),te=ee.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-19701zd-0"})(["border:1px solid;border-radius:8px;",""],(function(e){return"\n border-color: ".concat((e.theme.monotone||ne.Z.monotone).grey500,";\n ")})),re=t(70515);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 oe(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,c.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 ce,se=function(e){var n=e.clusterType,t=e.fetchWorkspaces,i=e.onSuccess,c=e.setErrors,s=e.showUpdateModal,l=e.workspace,u=l.instance,f=l.lifecycle_config,h=(u.ip,u.name),j=u.status,v=(u.type,{cluster_type:n}),y=(0,p.Db)(S.ZP.workspaces.useUpdate(h,v),{onSuccess:function(e){return(0,U.wD)(e,{callback:function(){t(),i()},onErrorCallback:function(e,n){return c({errors:n,response:e})}})}}),_=(0,o.Z)(y,2),P=_[0],C=_[1].isLoading,O=(0,p.Db)(S.ZP.workspaces.useDelete(h,v),{onSuccess:function(e){return(0,U.wD)(e,{callback:function(){t(),i()},onErrorCallback:function(e,n){return c({errors:n,response:e})}})}}),I=(0,o.Z)(O,2),D=I[0],E=I[1].isLoading,N=(0,a.useMemo)((function(){if(f){var e={};return Object.entries(f).map((function(n){var t=(0,o.Z)(n,2),r=t[0],i=t[1];i&&"object"==typeof i?Object.entries(i).map((function(n){var t=(0,o.Z)(n,2),i=t[0],c=t[1];e["".concat(r,".").concat(i)]=c})):e[r]=i})),e}}),[f]),M=(0,a.useMemo)((function(){var e=u.status,t=[];return"ecs"===n&&("STOPPED"===e?t.unshift({label:"Resume instance",onClick:function(){return P({workspace:{action:"resume",cluster_type:n,name:u.name,task_arn:u.task_arn}})},props:{loading:C,primary:!0},uuid:"resume_instance"}):"RUNNING"===e&&t.unshift({label:"Stop instance",onClick:function(){return P({workspace:{action:"stop",cluster_type:n,name:u.name,task_arn:u.task_arn}})},props:{loading:C,warning:!0},uuid:"stop_instance"})),"k8s"===n&&("STOPPED"===e?t.unshift({label:"Resume instance",onClick:function(){return P({workspace:{action:"resume",cluster_type:n,name:u.name}})},props:{loading:C,primary:!0},uuid:"resume_instance"}):"RUNNING"===e&&t.unshift({label:"Stop instance",onClick:function(){return P({workspace:{action:"stop",cluster_type:n,name:u.name}})},props:{loading:C,warning:!0},uuid:"stop_instance"}),t.push({label:"Update",onClick:function(){i(),s()},props:{},uuid:"update_instance"})),null==l||!l.ingress_name||null!=l&&l.url||t.push({label:"Add to ingress",onClick:function(){return P({workspace:{action:"add_to_ingress",cluster_type:n,name:u.name}})},props:{default:!0,loading:C},uuid:"re_add_to_ingress"}),t}),[n,u,C,i,s,P,l]),L=(0,a.useMemo)((function(){return(0,H.jsx)(d.ZP,{danger:!0,loading:E,onClick:function(){window.confirm("Are you sure you want to delete workspace ".concat(h,"?"))&&D()},children:"Delete workspace"})}),[D,E,h]);return(0,H.jsx)(H.Fragment,{children:(0,H.jsxs)(w.Z,{p:2,children:[(0,H.jsx)(w.Z,{mb:2,children:(0,H.jsxs)(Z.ZP,{alignItems:"center",children:[(0,H.jsx)(R.Folder,{size:2*re.iI}),(0,H.jsx)(w.Z,{mr:1}),(0,H.jsx)(b.Z,{level:3,children:null==l?void 0:l.name})]})}),(0,H.jsx)(w.Z,{mb:2,children:(0,H.jsxs)(k.ZP,{children:["Status: ",(0,H.jsx)(k.ZP,{bold:!0,danger:"STOPPED"===j,default:"PROVISIONING"===j,inline:!0,success:"RUNNING"===j,warning:"PENDING"===j,children:j})]})}),!M||0==M.length&&(0,H.jsx)(w.Z,{mb:2,children:L}),M&&M.length>0&&(0,H.jsx)(w.Z,{mb:2,children:(0,H.jsxs)(Z.ZP,{justifyContent:"space-between",children:[(0,H.jsx)(g.Z,{children:M.map((function(e){var n=e.label,t=e.onClick,r=e.uuid,i=e.props;return(0,H.jsx)(w.Z,{mr:1,children:(0,H.jsx)(d.ZP,oe(oe({},i),{},{onClick:t,children:n}))},r)}))}),L]})}),n===r.K8S&&(0,H.jsxs)(te,{children:[Object.entries(A).map((function(e,n){var t=(0,o.Z)(e,2),r=t[0],i=t[1];return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(w.Z,{mx:2,my:2,children:(0,H.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,H.jsx)(g.Z,{flex:4,children:(0,H.jsx)(k.ZP,{muted:!0,children:i})}),(0,H.jsx)(g.Z,{flex:2,flexDirection:"row-reverse",children:(0,H.jsx)(k.ZP,{bold:!0,children:(null==l?void 0:l[r])||"N/A"})})]})},r),n!==Object.entries(A).length-1&&(0,H.jsx)(x.Z,{muted:!0})]})})),(null==l?void 0:l.container_config)&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(x.Z,{muted:!0}),(0,H.jsxs)(w.Z,{mx:2,my:2,children:[(0,H.jsx)(k.ZP,{muted:!0,children:"Container config"}),(0,H.jsx)(w.Z,{mt:1}),(0,H.jsx)(T.$W,{children:(0,H.jsx)(m.Z,{autoHeight:!0,fontSize:12,language:F.t6.YAML,readOnly:!0,tabSize:2,value:null==l?void 0:l.container_config,width:"100%"})})]})]})]}),N&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(w.Z,{my:2,children:(0,H.jsx)(b.Z,{default:!0,level:5,children:"Lifecycle Properties"})}),(0,H.jsx)(te,{children:Object.entries(W).map((function(e,n){var t,r=(0,o.Z)(e,2),i=r[0],c=r[1];return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(w.Z,{mx:2,my:2,children:(0,H.jsxs)(Z.ZP,{alignItems:"center",justifyContent:"space-between",children:[(0,H.jsx)(g.Z,{flex:3,children:(0,H.jsx)(k.ZP,{muted:!0,children:c})}),(0,H.jsx)(g.Z,{flex:1,flexDirection:"row-reverse",children:(0,H.jsx)(k.ZP,{bold:!0,children:null===(t=N[i])||void 0===t?void 0:t.toString()})})]})},i),n!==Object.entries(W).length-1&&(0,H.jsx)(x.Z,{muted:!0})]})}))})]})]})})};!function(e){e.ALL="__all__",e.NAMESPACE="namespace[]"}(ce||(ce={}));var le=t(42631),ae=t(11498),ue=t(75083),de=t(69419),pe=t(53808),fe="workspace_list_filters";function he(e){return(0,pe.t8)(fe,e),e}var me=t(15610),xe=t(42122);function je(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?je(Object(t),!0).forEach((function(n){(0,c.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):je(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function Ze(){var e=(0,u.useRouter)(),n=S.ZP.statuses.list().data,t=(0,a.useState)(null),i=t[0],s=t[1],l=(0,de.iV)(),p=(0,a.useMemo)((function(){return ge({},(0,de.DQ)(l,[ce.NAMESPACE]))}),[l]),f=(0,a.useMemo)((function(){var e,t;return(null==n||null===(e=n.statuses)||void 0===e||null===(t=e[0])||void 0===t?void 0:t.instance_type)||"ecs"}),[n]),h=S.ZP.projects.list({},{revalidateOnFocus:!1}).data,m=(0,a.useMemo)((function(){var e;return null==h||null===(e=h.projects)||void 0===e?void 0:e[0]}),[h]),x=S.ZP.workspaces.list(ge(ge({},p),{},{cluster_type:f}),{revalidateOnFocus:!1}),j=x.data,g=x.isValidating,Z=x.mutate,b=(0,a.useMemo)((function(){var e;return null==j||null===(e=j.workspaces)||void 0===e?void 0:e.filter((function(e){return e.name}))}),[j]),v=(0,G.dd)((function(e){var n=e.workspace;return(0,H.jsx)(K,{clusterType:f,onCancel:w,onCreate:function(){Z(),w()},project:m,workspace:n})}),{},[f,Z,m],{background:!0,disableClickOutside:!0,disableEscape:!0,uuid:"configure_workspace"}),y=(0,o.Z)(v,2),_=y[0],w=y[1],P=(0,G.dd)((function(e){var n=e.workspace;return(0,H.jsx)($.Z,{children:(0,H.jsx)("div",{style:{width:"750px"},children:(0,H.jsx)(se,{clusterType:f,fetchWorkspaces:Z,onSuccess:I,setErrors:s,showUpdateModal:function(){return _({workspace:n})},workspace:n})})})}),{},[f,Z,s,b],{background:!0,uuid:"workspace_detail"}),C=(0,o.Z)(P,2),O=C[0],I=C[1],D=(0,a.useCallback)((function(e){var n=null==b?void 0:b[e];O({workspace:n})}),[O,b]);(0,a.useEffect)((function(){var e={};if((0,xe.Qr)(p)){var n={},t=(0,pe.U2)(fe,{});t&&Object.entries(t).forEach((function(e){var t=(0,o.Z)(e,2),r=t[0],i=t[1];null!=i&&(ae.RG.includes(r)?n[r]=i:(n[r]=[],Object.entries(i).forEach((function(e){var t=(0,o.Z)(e,2),i=t[0];t[1]&&n[r].push(i)}))))})),(0,xe.Qr)(n)||(e={},Object.entries(ge(ge({},e),n)||{}).forEach((function(n){var t=(0,o.Z)(n,2),r=t[0],i=t[1];null!=i&&(e[r]=i)})))}else{var r={};Object.entries(p).forEach((function(e){var n=(0,o.Z)(e,2),t=n[0],i=n[1];r[t]={};var c,s=i;null!=i&&(ae.RG.includes(t)?r[t]=s:(Array.isArray(s)||(s=[s]),s&&Array.isArray(s)&&(null===(c=s)||void 0===c||c.forEach((function(e){r[t][e]=!0})))))})),he((0,xe.hB)(r))}(0,xe.Qr)(e)||(0,me.u)((0,xe.hB)(e),{pushHistory:!1})}),[p]);var E=(0,a.useMemo)((function(){var n={},t={};return f===r.K8S&&(n={namespace:[ce.ALL]},t={namespace:(0,c.Z)({},ce.ALL,"All namespaces")}),(0,H.jsx)(X.Z,{addButtonProps:{label:"Create new workspace",onClick:_},extraActionButtonProps:{Icon:R.Refresh,disabled:!1,isLoading:g,onClick:Z,tooltip:"Refresh workspaces"},filterOptions:n,filterValueLabelMapping:t,onClickFilterDefaults:function(){he({}),e.push("/manage")},onFilterApply:function(e,n){Object.values(n).every((function(e){return!(null!=e&&e.length)}))&&he({})},query:p})}),[f,Z,g,p,e,_]);return(0,H.jsx)(J.Z,{breadcrumbs:[{bold:!0,label:function(){return"Workspaces"}}],errors:i,pageName:ue.L6.WORKSPACES,setErrors:s,subheaderChildren:E,children:(0,H.jsx)(Q.Z,{columnFlex:[2,4,2,3,1,null],columns:[{uuid:"Status"},{uuid:"Instance Name"},{uuid:"Type"},{uuid:"URL/IP"},{uuid:"Open"}],onClickRow:["ecs","k8s"].includes(f)&&D,rows:null==b?void 0:b.map((function(e){var n=e.instance,t=e.url,r=n.ip,i=n.name,o=n.status,c=n.type,s=t||r,l=s;return s&&!s.includes("http")&&(l="http://".concat(s),"ecs"===f&&(l="http://".concat(s,":6789"))),[(0,H.jsx)(d.ZP,{borderRadius:"".concat(le.D7,"px"),danger:"STOPPED"===o,default:"PROVISIONING"===o,notClickable:!0,padding:"6px",success:"RUNNING"===o,warning:"PENDING"===o,children:(0,B.vg)(o)},"status"),(0,H.jsx)(k.ZP,{children:i},"name"),(0,H.jsx)(k.ZP,{children:(0,B.vg)(c)},"type"),(0,H.jsx)(k.ZP,{children:s||"N/A"},"ip"),(0,H.jsx)(d.ZP,{disabled:!s,iconOnly:!0,onClick:function(){return window.open(l)},children:(0,H.jsx)(R.Expand,{size:2*re.iI})},"open_button")]}))})})}Ze.getInitialProps=(0,i.Z)(l().mark((function e(){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",{});case 1:case"end":return e.stop()}}),e)})));var be=(0,Y.Z)(Ze)},13157:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/manage",function(){return t(42765)}])},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 i}});var r=t(61049);function i(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 o}});var r=t(12539),i=t(80022);function o(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,i.Z)(e)}}},function(e){e.O(0,[449,1598,5544,9774,2888,179],(function(){return n=13157,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([[4688],{66316:function(e,t,r){"use strict";r.d(t,{Z:function(){return j}});var n=r(82394),i=r(70613),o=r(31557),u=r(33591),c=r(38276),s=r(70515),l=r(28598);var a=function(e){var t=e.children,r=e.width,n=void 0===r?12:r;return(0,l.jsx)(c.Z,{px:s.zC,children:(0,l.jsx)(u.Row,{children:(0,l.jsx)(u.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:t})})})},f=r(9518),p=r(46684),d=f.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-jcgu5l-0"})(["padding-top:","px;",""],p.Mz,(function(e){return e.fullHeight&&"\n height: calc(100vh);\n "}));function h(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function O(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?h(Object(r),!0).forEach((function(t){(0,n.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var j=function(e){var t=e.children,r=e.headerProps,n=e.title;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(i.Z,{title:n}),(0,l.jsx)(o.Z,O({},r)),(0,l.jsx)(a,{children:(0,l.jsx)(d,{fullHeight:!0,children:t})})]})}},77429:function(e,t,r){"use strict";r.r(t);var n=r(77837),i=r(82394),o=r(38860),u=r.n(o),c=r(82684),s=r(34376),l=r(66316),a=r(50724),f=r(82555),p=r(35686),d=r(53808),h=r(69419),O=r(28598);function j(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function b(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?j(Object(r),!0).forEach((function(t){(0,i.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):j(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function v(){var e=(0,s.useRouter)(),t=(0,h.iV)(),r=null==t?void 0:t.state,n=(0,d.U2)(r),i=null==n?void 0:n.provider,o=t;n&&(o=b(b({},t),n));var u=p.ZP.oauths.detail(i,o).data,j=(0,c.useMemo)((function(){var e;return null==u||null===(e=u.oauth)||void 0===e?void 0:e.url}),[u]),v=(0,c.useState)(null),g=v[0],y=v[1];return(0,c.useEffect)((function(){if(j){var t=((0,h.iV)(j)||{}).error;t?y(t):n?((0,d.Od)(r),e.push(j)):n||y("Oauth failed due to state not matching!")}}),[n,j,e,t,r]),(0,O.jsxs)(l.Z,{title:"Oauth",children:[(0,O.jsx)(O.Fragment,{}),g&&(0,O.jsx)(a.Z,{disableClickOutside:!0,isOpen:!0,onClickOutside:function(){return null==y?void 0:y(null)},children:(0,O.jsx)(f.Z,{displayMessage:g,onClose:function(){return null==y?void 0:y(null)}})})]})}v.getInitialProps=(0,n.Z)(u().mark((function e(){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",{});case 1:case"end":return e.stop()}}),e)}))),t.default=v},39341:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/oauth",function(){return r(77429)}])}},function(e){e.O(0,[1557,9774,2888,179],(function(){return t=39341,e(e.s=t);var t}));var t=e.O();_N_E=t}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4688],{66316:function(e,t,r){"use strict";r.d(t,{Z:function(){return j}});var n=r(82394),i=r(70613),o=r(92272),u=r(33591),c=r(38276),s=r(70515),l=r(28598);var a=function(e){var t=e.children,r=e.width,n=void 0===r?12:r;return(0,l.jsx)(c.Z,{px:s.zC,children:(0,l.jsx)(u.Row,{children:(0,l.jsx)(u.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:t})})})},f=r(9518),p=r(46684),d=f.default.div.withConfig({displayName:"indexstyle__ContainerStyle",componentId:"sc-jcgu5l-0"})(["padding-top:","px;",""],p.Mz,(function(e){return e.fullHeight&&"\n height: calc(100vh);\n "}));function h(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function O(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?h(Object(r),!0).forEach((function(t){(0,n.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var j=function(e){var t=e.children,r=e.headerProps,n=e.title;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(i.Z,{title:n}),(0,l.jsx)(o.Z,O({},r)),(0,l.jsx)(a,{children:(0,l.jsx)(d,{fullHeight:!0,children:t})})]})}},77429:function(e,t,r){"use strict";r.r(t);var n=r(77837),i=r(82394),o=r(38860),u=r.n(o),c=r(82684),s=r(34376),l=r(66316),a=r(50724),f=r(82555),p=r(35686),d=r(53808),h=r(69419),O=r(28598);function j(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function b(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?j(Object(r),!0).forEach((function(t){(0,i.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):j(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function v(){var e=(0,s.useRouter)(),t=(0,h.iV)(),r=null==t?void 0:t.state,n=(0,d.U2)(r),i=null==n?void 0:n.provider,o=t;n&&(o=b(b({},t),n));var u=p.ZP.oauths.detail(i,o).data,j=(0,c.useMemo)((function(){var e;return null==u||null===(e=u.oauth)||void 0===e?void 0:e.url}),[u]),v=(0,c.useState)(null),g=v[0],y=v[1];return(0,c.useEffect)((function(){if(j){var t=((0,h.iV)(j)||{}).error;t?y(t):n?((0,d.Od)(r),e.push(j)):n||y("Oauth failed due to state not matching!")}}),[n,j,e,t,r]),(0,O.jsxs)(l.Z,{title:"Oauth",children:[(0,O.jsx)(O.Fragment,{}),g&&(0,O.jsx)(a.Z,{disableClickOutside:!0,isOpen:!0,onClickOutside:function(){return null==y?void 0:y(null)},children:(0,O.jsx)(f.Z,{displayMessage:g,onClose:function(){return null==y?void 0:y(null)}})})]})}v.getInitialProps=(0,n.Z)(u().mark((function e(){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",{});case 1:case"end":return e.stop()}}),e)}))),t.default=v},39341:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/oauth",function(){return r(77429)}])}},function(e){e.O(0,[449,9774,2888,179],(function(){return t=39341,e(e.s=t);var t}));var t=e.O();_N_E=t}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1709],{81066:function(e,n,t){"use strict";t.d(n,{B:function(){return p}});var r=t(82394),i=t(46732),o=t(68562),u=t(72473),c=t(8059),l=t(70515),a=t(28598);function s(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 d(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?s(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):s(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var p={bold:!0,greyBorder:!0,paddingBottom:9,paddingTop:9};n.Z=function(e){var n=e.addButtonMenuOpen,t=e.addButtonMenuRef,r=e.isLoading,s=e.label,f=e.menuItems,b=e.onClick,h=e.onClickCallback;return(0,a.jsx)(i.Z,{disableKeyboardShortcuts:!0,items:f,onClickCallback:h,onClickOutside:h,open:n,parentRef:t,roundedStyle:!0,topOffset:1,uuid:"Table/Toolbar/NewItemMenu",children:(0,a.jsx)(o.ZP,d(d({},p),{},{background:c.eW,beforeElement:(0,a.jsx)(u.Add,{size:2.5*l.iI}),loading:r,onClick:function(e){e.preventDefault(),null==b||b()},uuid:"shared/AddButton/index",children:s}))})}},46568:function(e,n,t){"use strict";var r=t(82394),i=t(26304),o=(t(82684),t(33591)),u=t(28598),c=["children","fullHeight","gutter","style"];function l(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 a(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?l(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):l(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n=e.children,t=e.fullHeight,r=e.gutter,l=e.style,s=void 0===l?{}:l,d=(0,i.Z)(e,c),p=a({},s);return r&&(p.paddingLeft=r,p.paddingRight=p.paddingLeft),t&&(p.height="100%"),(0,u.jsx)(o.Col,a(a({},d),{},{style:p,children:n}))}},82682:function(e,n,t){"use strict";var r=t(82394),i=t(26304),o=t(82684),u=t(33591),c=t(28598),l=["children","fullHeight","gutter","justifyContent","style"];function a(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 s(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?a(Object(t),!0).forEach((function(n){(0,r.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):a(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}n.Z=function(e){var n=e.children,t=e.fullHeight,r=e.gutter,a=e.justifyContent,d=e.style,p=void 0===d?{}:d,f=(0,i.Z)(e,l),b=s({},p);return r&&(b.marginLeft=-1*r,b.marginRight=b.marginLeft),t&&(b.height="100%"),(0,c.jsx)(u.Row,s(s({},f),{},{justifyContent:a,style:b,children:o.Children.map(n,(function(e,n){return e&&o.cloneElement(e,{gutter:r,key:n})}))}))}},94542:function(e,n,t){"use strict";t.d(n,{J:function(){return o},X:function(){return u}});var r=t(46568),i=t(82682),o=r.Z,u=i.Z},95660:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return Ie}});var r=t(77837),i=t(82394),o=t(75582),u=t(38860),c=t.n(u),l=t(83455),a=t(82684),s=t(34376),d=t(92083),p=t.n(d),f=t(52749),b=t(81066),h=t(53998),m=t(36065),g=t(60523),y=t(90299),v=t(76111),j=t(94629),O=t(55485),Z=t(85854),_=t(97618),x=t(38276),P=t(30160),C=t(9518),w=t(44897),k=t(42631),T=t(70515),E=12.5*T.iI,I=8*T.iI,D=5*T.iI,N=3*T.iI,S=C.default.div.withConfig({displayName:"indexstyle__TileContainerStyle",componentId:"sc-c3nc3q-0"})(["padding:","px;border-radius:","px;height:","px;width:","px;"," ",""],2.5*T.iI,k.TR,E,E,(function(e){return"\n background-color: ".concat((e.theme||w.Z).background.chartBlock,";\n ")}),(function(e){return e.compact&&"\n height: ".concat(I,"px;\n width: ").concat(I,"px;\n ")})),R=t(28598);var L=function(e){var n=e.Icon,t=e.compact,r=e.label;return(0,R.jsx)(S,{compact:t,children:(0,R.jsxs)(O.ZP,{alignItems:"center",flexDirection:"column",justifyContent:"center",children:[(0,R.jsx)(n,{size:t?N:D}),(0,R.jsx)(x.Z,{mb:"4px"}),(0,R.jsx)(P.ZP,{bold:!0,small:t,children:r})]})})},M=t(12468),A=C.default.div.withConfig({displayName:"indexstyle__MetricsSummaryContainerStyle",componentId:"sc-nu65g1-0"})(["width:100%;padding:","px;border-radius:","px;",""],2*T.iI,k.n_,(function(e){return"\n border: ".concat(k.YF,"px ").concat(k.M8," ").concat((e.theme||w.Z).interactive.defaultBorder,";\n box-shadow: ").concat((e.theme||w.Z).shadow.frame,";\n ")})),B=C.default.div.withConfig({displayName:"indexstyle__MetricContainerStyle",componentId:"sc-nu65g1-1"})(["display:flex;flex:1;align-items:center;justify-content:space-between;",""],(function(e){return e.includeLeftBorder&&"\n @media (min-width: 1200px) {\n padding-left: 24px;\n border-left: ".concat(k.YF,"px ").concat(k.M8," ").concat((e.theme||w.Z).interactive.defaultBorder,";\n }\n ")})),H=t(57653),U=t(94542),Y=t(41143),q=t(39598),V=t(81728),F=t(48277),X=t(79221),G=t(70320),J=t(86735);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 K(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?z(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):z(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var $=function(e){var n=e.pipelineRunCountByPipelineType,t=(0,G.qB)(),r=(0,a.useMemo)((function(){if(!n)return[];var e=JSON.parse(JSON.stringify(n)),t=e[H.qL.PYTHON]||{};return Object.entries(e[H.qL.PYSPARK]||{}).forEach((function(e){var n=(0,o.Z)(e,2),r=n[0],i=n[1];t[r]?t[r]+=i:t[r]=i})),e[H.qL.PYTHON]=t,delete e[H.qL.PYSPARK],(0,J.mr)(Object.entries(e).filter((function(e){var n=(0,o.Z)(e,2),t=(n[0],n[1]);return 0!==Object.keys(t).length})))}),[n]),i=(0,a.useMemo)((function(){return t?(0,R.jsx)(x.Z,{ml:"4px",children:(0,R.jsx)(M.Z,K(K({},q.m),{},{label:"Please note that these metrics are based on UTC time."}))}):null}),[t]);return(0,R.jsxs)(A,{children:[(0,R.jsxs)(O.ZP,{alignItems:"center",children:[(0,R.jsx)(P.ZP,{bold:!0,large:!0,children:"Pipeline run metrics"}),i]}),(0,R.jsx)(x.Z,{mb:2}),(0,R.jsx)(U.X,{style:{gap:"16px"},children:r.map((function(e,n){var t=(0,o.Z)(e,2),i=t[0],u=t[1];return(0,R.jsxs)(B,{includeLeftBorder:0!==n,children:[(0,R.jsx)(L,{Icon:H.Mj[i],label:H.G7[i]}),(0,J.mr)(Object.entries(u)).map((function(e,n){var t=(0,o.Z)(e,2),r=t[0],i=t[1];return(0,R.jsx)(x.Z,{px:1,children:(0,R.jsxs)(_.Z,{flexDirection:"column",children:[(0,R.jsx)(P.ZP,{children:(0,V.kC)(r)}),(0,R.jsx)(P.ZP,{bold:!0,danger:r===Y.V.FAILED&&i>0,title:(0,F.uf)(i),xlarge:!0,children:(0,X.P5)(i,{maxFractionDigits:1,minAmount:1e3})})]})},"".concat(r,"_").concat(n))})),(0,R.jsx)(x.Z,{pr:n!==r.length-1?2:0})]},"".concat(i,"_metric"))}))})]})},W=t(29241),Q=t(55729),ee=t(93808),ne=t(82359),te=t(4190),re=t(67913),ie=t(35686),oe=t(35058),ue=t(64657),ce=t(44425),le=t(75399),ae=t(23780),se=t(46684),de=t(61556),pe=t(32929),fe=t(17380),be=t(3917),he=t(50389),me=t(68899),ge=t(24491),ye=t(65458),ve=t(15610),je=t(72619),Oe=t(69419),Ze=t(89538),_e=t(70026),xe=t(53808),Pe=t(43613);function Ce(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 we(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?Ce(Object(t),!0).forEach((function(n){(0,i.Z)(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ce(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}var ke={mt:2,mx:3},Te={refreshInterval:6e4,revalidateOnFocus:!1};function Ee(e){var n,t,r=e.tab,u=(0,a.useRef)(null),c=(0,a.useRef)(!1),d=(0,a.useRef)(null),_=((0,Oe.iV)(),(0,s.useRouter)()),C=(0,a.useRef)(null),k=(0,a.useMemo)((function(){return he.hS}),[]),T=(0,a.useState)(k.find((function(e){var n;return e.uuid===(r||(null===(n=(0,xe.U2)(xe.Xq))||void 0===n?void 0:n.uuid))}))||he.xM),E=T[0],I=T[1],D=(0,a.useState)(!1),N=D[0],S=D[1],L=(0,a.useState)(null),A=L[0],B=L[1],U=null==E?void 0:E.uuid,X=(0,a.useMemo)((function(){return(0,be.jV)(U,{isoString:!0})}),[U]),z=(0,a.useMemo)((function(){return{group_by_pipeline_type:1,start_time:X}}),[X]),K=(0,a.useState)(),ee=K[0],Ce=K[1],Ee=(0,l.Db)((function(){var e,n;return null===(e=ie.ZP.monitor_stats)||void 0===e?void 0:e.detailAsync(de.h.PIPELINE_RUN_COUNT,z,{signal:null==u||null===(n=u.current)||void 0===n?void 0:n.signal})}),{onSuccess:function(e){return(0,je.wD)(e,{callback:function(e){var n=e.monitor_stat.stats;Ce(n)}})}}),Ie=(0,o.Z)(Ee,2),De=Ie[0],Ne=Ie[1].isLoading,Se=(0,a.useCallback)((function(e){var n;null!==(null==u?void 0:u.current)&&(null==u||null===(n=u.current)||void 0===n||n.abort());u.current=new AbortController,I((function(n){var t="function"==typeof e?e(n):e;return(null==n?void 0:n.uuid)!==(null==t?void 0:t.uuid)&&((0,ve.u)((0,i.Z)({},fe.i,null==t?void 0:t.uuid),{replaceParams:!0}),De()),(0,xe.t8)(xe.Xq,t),t}))}),[De]);(0,a.useEffect)((function(){var e;(null!=c&&c.current||(c.current=!0,De()),r)||(0,ve.u)((0,i.Z)({},fe.i,E?null==E?void 0:E.uuid:null==k||null===(e=k[0])||void 0===e?void 0:e.uuid),{pushHistory:!1})}),[k,De,E,r]);var Re,Le=ie.ZP.pipeline_runs.list({_limit:50,include_pipeline_type:1,"order_by[]":"created_at desc",start_timestamp:(0,be.A5)(X),status:Y.V.FAILED},we({},Te)).data,Me=(0,a.useMemo)((function(){return((null==Le?void 0:Le.pipeline_runs)||[]).filter((function(e){return null!==e.pipeline_type}))}),[null==Le?void 0:Le.pipeline_runs]),Ae=(0,a.useMemo)((function(){return(0,J.vM)(Me,(function(e){return e.pipeline_type}))}),[Me]),Be=Ae.integration,He=void 0===Be?[]:Be,Ue=Ae.python,Ye=void 0===Ue?[]:Ue,qe=Ae.streaming,Ve=void 0===qe?[]:qe,Fe=(0,a.useMemo)((function(){return(0,be.Y_)(be.yD[U]+1)}),[U]),Xe=(0,a.useMemo)((function(){return(0,ge.i)(ee,Fe)}),[ee,Fe]),Ge=Xe.pipelineRunCountByPipelineType,Je=Xe.totalPipelineRunCount,ze=Xe.ungroupedPipelineRunData,Ke=(0,a.useMemo)((function(){return(0,be.Ro)(be.yD[U],{endDateOnly:U===be.vk.TODAY})}),[U]),$e=(Re=function(e){return _.push("/pipelines/[pipeline]/edit","/pipelines/".concat(e,"/edit"))},(0,l.Db)(ie.ZP.pipelines.useCreate(),{onSuccess:function(e){return(0,je.wD)(e,{callback:function(e){var n=e.pipeline.uuid;null==Re||Re(n)},onErrorCallback:function(e,n){return B({errors:n,response:e})}})}})),We=(0,o.Z)($e,2),Qe=We[0],en=We[1].isLoading,nn=ie.ZP.projects.list(),tn=nn.data,rn=nn.mutate,on=(0,a.useMemo)((function(){var e;return null==tn||null===(e=tn.projects)||void 0===e?void 0:e[0]}),[tn]),un=(0,a.useMemo)((function(){var e;return(0,G.hY)(null==on||null===(e=on.features)||void 0===e?void 0:e[ne.d.LOCAL_TIMEZONE])}),[null==on?void 0:on.features]),cn=(0,Ze.dd)((function(e){var n=e.pipelineType;return(0,R.jsx)(v.Z,{onClose:sn,onSave:function(e){var t=e.name,r=e.description,i=e.tags;Qe({pipeline:{description:r,name:t,tags:i,type:n}})},pipelineType:n})}),{},[Qe],{background:!0,disableEscape:!0,uuid:"overview/create_pipeline"}),ln=(0,o.Z)(cn,2),an=ln[0],sn=ln[1],dn=(0,Ze.dd)((function(){return(0,R.jsx)(ae.BC,{children:(0,R.jsx)(g.Z,{contained:!0,onClickCustomTemplate:function(e){Qe({pipeline:{custom_template_uuid:null==e?void 0:e.template_uuid,name:(0,V.Y6)()}}).then((function(){bn()}))},showBreadcrumbs:!0,tabs:[pe.A2]})})}),{},[],{background:!0,uuid:"browse_templates"}),pn=(0,o.Z)(dn,2),fn=pn[0],bn=pn[1],hn=(0,Ze.dd)((function(){return(0,R.jsx)(_e.Z,{onCancel:yn})}),{},[,],{background:!0,uuid:"import_pipeline"}),mn=(0,o.Z)(hn,2),gn=mn[0],yn=mn[1],vn=(0,Ze.dd)((function(e){var n=e.cancelButtonText,t=(e.header,e.onCancel),r=e.onSaveSuccess;return(0,R.jsx)(ae.BC,{children:(0,R.jsx)(Q.Z,{cancelButtonText:n,contained:!0,header:(0,R.jsx)(Pe.Z,{}),onCancel:function(){null==t||t(),Zn()},onSaveSuccess:function(e){rn(),Zn(),null==r||r(e)}})})}),{},[rn],{background:!0,uuid:"configure_project"}),jn=(0,o.Z)(vn,2),On=jn[0],Zn=jn[1],_n=(0,Ze.dd)((function(){return(0,R.jsx)(ae.BC,{children:(0,R.jsx)(f.Z,{createPipeline:Qe,isLoading:en,onClose:Cn})})}),{},[Qe,en],{background:!0,disableClickOutside:!0,disableCloseButton:!0,uuid:"AI_modal"}),xn=(0,o.Z)(_n,2),Pn=xn[0],Cn=xn[1],wn=(0,a.useMemo)((function(){return(0,ye.d)(Qe,{showAIModal:function(){null!=on&&on.openai_api_key?Pn():On({onSaveSuccess:function(){Pn()}})},showBrowseTemplates:fn,showCreatePipelineModal:an,showImportPipelineModal:gn})}),[Qe,on,Pn,fn,On,an,gn]),kn=(0,a.useMemo)((function(){return(0,R.jsx)(b.Z,{addButtonMenuOpen:N,addButtonMenuRef:C,isLoading:en,label:"New pipeline",menuItems:wn,onClick:function(){return S((function(e){return!e}))},onClickCallback:function(){return S(!1)}})}),[N,en,wn]),Tn=(0,a.useMemo)((function(){return un?(0,R.jsx)(x.Z,{ml:"4px",children:(0,R.jsx)(M.Z,we(we({},q.m),{},{label:"Please note that these counts are based on UTC time."}))}):null}),[un]),En=(0,a.useMemo)((function(){var e,n,t,r,o,u,c="Pipelines",l=(0,V.kE)("".concat(c,"_overview_dashboard_").concat((0,V.Lo)())),a="Trigger active status",s=(0,V.kE)("".concat(a,"_overview_dashboard_").concat((0,V.Lo)())),d="Pipeline run status",p=(0,V.kE)("".concat(d,"_overview_dashboard_").concat((0,V.Lo)())),f="Pipeline runs daily",b=(0,V.kE)("".concat(f,"_overview_dashboard_").concat((0,V.Lo)())),h="Completed pipeline runs daily",m=(0,V.kE)("".concat(h,"_overview_dashboard_").concat((0,V.Lo)())),g="Failed pipeline runs daily",y=(0,V.kE)("".concat(g,"_overview_dashboard_").concat((0,V.Lo)())),v="Running pipelines",j=(0,V.kE)("".concat(v,"_overview_dashboard_").concat((0,V.Lo)())),O={type:le.XO.PIPELINE_SCHEDULES},Z={type:le.XO.PIPELINE_RUNS},_={configuration:(e={},(0,i.Z)(e,oe.eN,["execution_date"]),(0,i.Z)(e,oe.bE,[{aggregation:oe.os.COUNT_DISTINCT,column:"id"}]),(0,i.Z)(e,oe.Yg,oe.aE.DAY),(0,i.Z)(e,"chart_type",oe.oV.TIME_SERIES_LINE_CHART),e),data_source:Z,type:ce.tf.CHART};return{blocks:(u={},(0,i.Z)(u,l,{configuration:(n={},(0,i.Z)(n,oe.eN,["type"]),(0,i.Z)(n,oe.bE,[{aggregation:oe.os.COUNT_DISTINCT,column:"uuid"}]),(0,i.Z)(n,oe.$1,oe.MP.DESCENDING),(0,i.Z)(n,"chart_style",oe.JT.HORIZONTAL),(0,i.Z)(n,"chart_type",oe.oV.BAR_CHART),n),data_source:{type:le.XO.PIPELINES},name:c,type:ce.tf.CHART,uuid:l}),(0,i.Z)(u,s,{configuration:(t={},(0,i.Z)(t,oe.eN,["status"]),(0,i.Z)(t,oe.bE,[{aggregation:oe.os.COUNT_DISTINCT,column:"id"}]),(0,i.Z)(t,oe.$1,oe.MP.DESCENDING),(0,i.Z)(t,"chart_type",oe.oV.BAR_CHART),t),data_source:O,name:a,type:ce.tf.CHART,uuid:s}),(0,i.Z)(u,p,{configuration:(r={},(0,i.Z)(r,oe.eN,["status"]),(0,i.Z)(r,oe.bE,[{aggregation:oe.os.COUNT_DISTINCT,column:"id"}]),(0,i.Z)(r,oe.$1,oe.MP.DESCENDING),(0,i.Z)(r,"chart_style",oe.JT.HORIZONTAL),(0,i.Z)(r,"chart_type",oe.oV.BAR_CHART),r),data_source:Z,name:d,type:ce.tf.CHART,uuid:p}),(0,i.Z)(u,b,we(we({},_),{},{name:f,uuid:b})),(0,i.Z)(u,m,we(we({},_),{},{content:"\n@data_source\ndef d(df):\n return df[df['status'] == '".concat(Y.V.COMPLETED,"']\n"),name:h,uuid:m})),(0,i.Z)(u,y,we(we({},_),{},{content:"\n@data_source\ndef d(df):\n return df[df['status'] == '".concat(Y.V.FAILED,"']\n"),name:g,uuid:y})),(0,i.Z)(u,j,{configuration:(o={},(0,i.Z)(o,oe.eN,["backfill_id","completed_at","created_at","execution_date","executor_type","id","pipeline_schedule_id","pipeline_uuid","started_at","status"]),(0,i.Z)(o,"chart_type",oe.oV.TABLE),o),content:"\n@data_source\ndef d(df):\n return df[df['status'] == '".concat(Y.V.RUNNING,"']\n"),data_source:Z,name:v,type:ce.tf.CHART,uuid:j}),u),layout:[[{block_uuid:l,width:1},{block_uuid:s,width:1}],[{block_uuid:p,width:1},{block_uuid:b,width:2}],[{block_uuid:m,width:1},{block_uuid:y,width:1}],[{block_uuid:j,width:1}]]}}),[]);return(0,R.jsxs)(j.Z,{errors:A,setErrors:B,title:"Overview",uuid:"overview/index",children:[(0,R.jsx)(W.Z,{backgroundColor:w.Z.background.panel,ref:d,children:(0,R.jsx)(x.Z,{py:2,children:(0,R.jsxs)(O.ZP,{alignItems:"center",children:[(0,R.jsx)(x.Z,{ml:3,children:kn}),(0,R.jsx)(y.Z,{onClickTab:function(e){var n=e.uuid;Se((function(){return k.find((function(e){return n===e.uuid}))}))},regularSizeText:!0,selectedTabUUID:U,tabs:k})]})})}),he.oP.uuid===(null==E?void 0:E.uuid)&&(0,R.jsx)(m.Z,{leftOffset:me.k1-1,pageBlockLayoutTemplate:En,topOffset:se.Mz+(null==d||null===(n=d.current)||void 0===n||null===(t=n.getBoundingClientRect())||void 0===t?void 0:t.height),uuid:"overview/dashboard"}),he.oP.uuid!==(null==E?void 0:E.uuid)&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(x.Z,{mx:3,my:2,children:[(0,R.jsxs)(Z.Z,{level:4,children:[U===be.vk.TODAY&&"".concat((0,V.kC)(be.vk.TODAY)," (UTC): ").concat(Ke),U!==be.vk.TODAY&&"".concat((0,V.kC)(be.s8[U])," (UTC): ").concat(Ke)]}),(0,R.jsx)(x.Z,{mt:2,children:Ne?(0,R.jsx)(x.Z,{mx:2,my:11,children:(0,R.jsx)(te.Z,{inverted:!0})}):(0,R.jsx)($,{pipelineRunCountByPipelineType:Ge})}),(0,R.jsxs)(x.Z,{mt:2,children:[(0,R.jsx)(x.Z,{ml:2,children:(0,R.jsxs)(O.ZP,{alignItems:"center",children:[(0,R.jsxs)(P.ZP,{bold:!0,large:!0,children:[Ne?"--":(0,F.uf)(Je)," total pipeline runs"]}),Tn]})}),(0,R.jsx)(x.Z,{mt:1,children:(0,R.jsx)(h.Z,{backgroundColor:w.Z.background.panel,colors:ue.NU,data:ze,getXValue:function(e){return e.date},height:200,keys:ue.hu,margin:{bottom:30,left:35,right:0,top:10},tooltipLeftOffset:ue.CD,xLabelFormat:function(e){return p()(e).format("MMM DD")}})})]})]}),(0,R.jsx)(x.Z,we(we({},ke),{},{children:(0,R.jsxs)(O.ZP,{alignItems:"center",justifyContent:"center",children:[(0,R.jsx)(re.Z,{pipelineRuns:Me,pipelineType:H.LM}),(0,R.jsx)(x.Z,{ml:2}),(0,R.jsx)(re.Z,{pipelineRuns:Ye,pipelineType:H.qL.PYTHON})]})})),(0,R.jsx)(x.Z,we(we({},ke),{},{children:(0,R.jsxs)(O.ZP,{alignItems:"center",justifyContent:"center",children:[(0,R.jsx)(re.Z,{pipelineRuns:He,pipelineType:H.qL.INTEGRATION}),(0,R.jsx)(x.Z,{ml:2}),(0,R.jsx)(re.Z,{pipelineRuns:Ve,pipelineType:H.qL.STREAMING})]})})),(0,R.jsx)(x.Z,{mb:2})]})]})}Ee.getInitialProps=function(){var e=(0,r.Z)(c().mark((function e(n){var t,r;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",{tab:null!=n&&null!==(t=n.query)&&void 0!==t&&t.tab?null==n||null===(r=n.query)||void 0===r?void 0:r.tab:null});case 1:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();var Ie=(0,ee.Z)(Ee)},56655:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/overview",function(){return t(95660)}])}},function(e){e.O(0,[3662,125,2714,1799,140,2996,449,8095,4241,4168,8023,523,6065,5831,3548,5627,6362,9774,2888,179],(function(){return n=56655,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([[1009],{94629:function(e,t,r){"use strict";r.d(t,{Z:function(){return P}});var n=r(82394),i=r(21831),o=r(82684),u=r(50724),s=r(82555),c=r(97618),a=r(70613),f=r(31557),l=r(68899),d=r(28598);function p(e,t){var r=e.children,n=e.noPadding;return(0,d.jsx)(l.HS,{noPadding:n,ref:t,children:r})}var h=o.forwardRef(p),b=r(62547),v=r(82571),O=r(77417),j=r(46684),y=r(75375);function g(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?g(Object(r),!0).forEach((function(t){(0,n.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):g(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function w(e,t){e.addProjectBreadcrumbToCustomBreadcrumbs;var r=e.after,n=e.afterHeader,o=e.afterHidden,p=e.afterWidth,g=e.afterWidthOverride,w=e.appendBreadcrumbs,P=e.before,Z=e.beforeHeader,x=e.beforeWidth,_=e.breadcrumbs,A=e.children,M=e.contained,E=e.errors,k=e.headerMenuItems,D=e.headerOffset,C=e.hideAfterCompletely,B=e.mainContainerHeader,I=e.navigationItems,H=e.setAfterHidden,R=e.setAfterWidth,W=e.setBeforeWidth,S=e.setErrors,N=e.subheaderChildren,T=e.subheaderNoPadding,F=e.title,L=e.uuid,q=(0,y.Z)(L,{beforeResizeOffset:y.H,setWidthAfter:R,setWidthBefore:W,widthAfter:p,widthBefore:x,widthOverrideAfter:g}),Q=q.mainContainerRef,U=q.mousedownActiveAfter,z=q.mousedownActiveBefore,G=q.setMousedownActiveAfter,Y=q.setMousedownActiveBefore,V=q.setWidthAfter,X=q.setWidthBefore,J=q.widthAfter,K=q.widthBefore,$=(0,O.Z)().project,ee=[];return _&&ee.push.apply(ee,(0,i.Z)(_)),null!=_&&_.length&&!w||!$||null!=_&&_.length||ee.unshift({bold:!w,label:function(){return F}}),(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(a.Z,{title:F}),(0,d.jsx)(f.Z,{breadcrumbs:ee,menuItems:k}),(0,d.jsxs)(l.Nk,{ref:t,children:[0!==(null==I?void 0:I.length)&&(0,d.jsx)(l.lm,{showMore:!0,children:(0,d.jsx)(v.Z,{navigationItems:I,showMore:!0})}),(0,d.jsx)(c.Z,{flex:1,flexDirection:"column",children:(0,d.jsxs)(b.Z,{after:r,afterHeader:n,afterHeightOffset:j.Mz,afterHidden:o,afterMousedownActive:U,afterWidth:J,before:P,beforeHeader:Z,beforeHeightOffset:j.Mz,beforeMousedownActive:z,beforeWidth:P?K:l.k1,contained:M,headerOffset:D,hideAfterCompletely:!r||C,leftOffset:P?l.k1:null,mainContainerHeader:B,mainContainerRef:Q,setAfterHidden:H,setAfterMousedownActive:G,setAfterWidth:V,setBeforeMousedownActive:Y,setBeforeWidth:X,children:[N&&(0,d.jsx)(h,{noPadding:T,children:N}),A]})})]}),E&&(0,d.jsx)(u.Z,{disableClickOutside:!0,isOpen:!0,onClickOutside:function(){return null==S?void 0:S(null)},children:(0,d.jsx)(s.Z,m(m({},E),{},{onClose:function(){return null==S?void 0:S(null)}}))})]})}var P=o.forwardRef(w)},93808:function(e,t,r){"use strict";r.d(t,{Z:function(){return A}});var n=r(77837),i=r(26304),o=r(62243),u=r(29385),s=r(80022),c=r(13692),a=r(93189),f=r(15544),l=r(82394),d=r(38860),p=r.n(d),h=r(82684),b=r(56663),v=r.n(b),O=r(40761),j=r(34661),y=r(36105),g=r(50178),m=r(69419),w=r(28598),P=["auth"];function Z(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function x(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Z(Object(r),!0).forEach((function(t){(0,l.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Z(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _(e){var t=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 r,n=(0,f.Z)(e);if(t){var i=(0,f.Z)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return(0,a.Z)(this,r)}}function A(e){return function(t){(0,c.Z)(f,t);var r,a=_(f);function f(){var e;(0,o.Z)(this,f);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return e=a.call.apply(a,[this].concat(r)),(0,l.Z)((0,s.Z)(e),"state",{auth:new O.Z(e.props.token)}),e}return(0,u.Z)(f,[{key:"componentDidMount",value:function(){this.setState({auth:new O.Z(this.props.token)})}},{key:"render",value:function(){var t=this.props,r=(t.auth,(0,i.Z)(t,P));return(0,w.jsx)(e,x({auth:this.state.auth},r))}}],[{key:"getInitialProps",value:(r=(0,n.Z)(p().mark((function t(r){var n,i,o,u,s,c,a,f,l;return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=v()(r),i=(0,g.ex)(r),o=i.id,u=n[j.Mv],s=n[y.qt],c=new O.Z(u),a=x(x({},r),{},{auth:c,currentGroupId:o,theme:s}),(0,g.YB)(r)&&c.isExpired&&(console.log("OAuth token has expired."),f=x(x({},r.query),{},{redirect_url:r.asPath}),(0,m.nL)("/sign-in?".concat((0,m.uM)(f)),r.res)),!e.getInitialProps){t.next=12;break}return t.next=10,e.getInitialProps(a);case 10:return l=t.sent,t.abrupt("return",x(x({},l),{},{auth:c,currentGroupId:o,theme:s}));case 12:return t.abrupt("return",a);case 13:case"end":return t.stop()}}),t)}))),function(e){return r.apply(this,arguments)})}]),f}(h.Component)}},78234:function(e,t,r){"use strict";r.r(t);var n=r(77837),i=r(82394),o=r(38860),u=r.n(o),s=r(82684),c=r(34376),a=r(94629),f=r(55072),l=r(27966),d=r(93808),p=r(82359),h=r(38276),b=r(4190),v=r(85544),O=r(35686),j=r(44265),y=r(70515),g=r(69419),m=r(86735),w=r(70320),P=r(28598);function Z(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function x(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Z(Object(r),!0).forEach((function(t){(0,i.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Z(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _(){var e=(0,c.useRouter)(),t=(0,s.useState)(null),r=t[0],n=t[1],o=(0,g.iV)(),u=null!=o&&o.page?o.page:0,d=(0,s.useMemo)((function(){return(0,g.DQ)(o,[j.P0.PIPELINE_UUID,j.P0.STATUS,j.P0.TAG])}),[o]),Z=O.ZP.projects.list().data,_=(0,s.useMemo)((function(){var e;return null==Z||null===(e=Z.projects)||void 0===e?void 0:e[0]}),[Z]),A=((0,s.useMemo)((function(){var e;return(0,w.hY)(null==_||null===(e=_.features)||void 0===e?void 0:e[p.d.LOCAL_TIMEZONE])}),[null==_?void 0:_.features]),x(x({},d),{},{_limit:f.Q,_offset:u*f.Q,disable_retries_grouping:!0,include_pipeline_tags:!0,include_pipeline_uuids:!0}));null!=o&&o.status&&(A.status=o.status);var M=O.ZP.pipeline_runs.list(A,{refreshInterval:3e3,revalidateOnFocus:!0}),E=M.data,k=M.mutate,D=O.ZP.tags.list().data,C=(0,s.useMemo)((function(){return(0,m.YC)((null==D?void 0:D.tags)||[],(function(e){return e.uuid}))}),[D]),B=(0,s.useMemo)((function(){return(null==E?void 0:E.pipeline_runs)||[]}),[E]),I=(0,s.useMemo)((function(){var e;return(null==E||null===(e=E.metadata)||void 0===e?void 0:e.count)||[]}),[E]),H=(0,s.useMemo)((function(){var e;return(null==E||null===(e=E.metadata)||void 0===e?void 0:e.pipeline_uuids)||[]}),[E]),R=(0,s.useMemo)((function(){return(0,P.jsx)(v.Z,{filterOptions:{pipeline_tag:C.map((function(e){return e.uuid})),pipeline_uuid:H,status:j.hn},filterValueLabelMapping:{pipeline_tag:C.reduce((function(e,t){var r=t.uuid;return x(x({},e),{},(0,i.Z)({},r,r))}),{}),status:j.Do},onClickFilterDefaults:function(){e.push("/pipeline-runs")},query:d,resetPageOnFilterApply:!0})}),[H,e,C]);return(0,P.jsx)(a.Z,{errors:r,setErrors:n,subheaderChildren:R,title:"Pipeline runs",uuid:"pipeline_runs/index",children:E?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(l.Z,{fetchPipelineRuns:k,includePipelineTags:!0,pipelineRuns:B,setErrors:n}),(0,P.jsx)(h.Z,{p:2,children:(0,P.jsx)(f.ZP,{maxPages:f.Et,onUpdate:function(t){var r=Number(t),n=x(x({},o),{},{page:r>=0?r:0});e.push("/pipeline-runs","/pipeline-runs?".concat((0,g.uM)(n)))},page:Number(u),totalPages:Math.ceil(I/f.Q)})})]}):(0,P.jsx)(h.Z,{p:y.Mq,children:(0,P.jsx)(b.Z,{inverted:!0,large:!0})})})}_.getInitialProps=(0,n.Z)(u().mark((function e(){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",{});case 1:case"end":return e.stop()}}),e)}))),t.default=(0,d.Z)(_)},60710:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/pipeline-runs",function(){return r(78234)}])},80022:function(e,t,r){"use strict";function n(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}r.d(t,{Z:function(){return n}})},15544:function(e,t,r){"use strict";function n(e){return n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(e)}r.d(t,{Z:function(){return n}})},13692:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n=r(61049);function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&(0,n.Z)(e,t)}},93189:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}});var n=r(12539),i=r(80022);function o(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return(0,i.Z)(e)}}},function(e){e.O(0,[1557,7966,5544,9774,2888,179],(function(){return t=60710,e(e.s=t);var t}));var t=e.O();_N_E=t}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1009],{94629:function(e,t,r){"use strict";r.d(t,{Z:function(){return P}});var n=r(82394),i=r(21831),o=r(82684),u=r(50724),s=r(82555),c=r(97618),a=r(70613),f=r(92272),l=r(68899),d=r(28598);function p(e,t){var r=e.children,n=e.noPadding;return(0,d.jsx)(l.HS,{noPadding:n,ref:t,children:r})}var h=o.forwardRef(p),b=r(62547),v=r(82571),O=r(77417),j=r(46684),y=r(75375);function g(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?g(Object(r),!0).forEach((function(t){(0,n.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):g(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function w(e,t){e.addProjectBreadcrumbToCustomBreadcrumbs;var r=e.after,n=e.afterHeader,o=e.afterHidden,p=e.afterWidth,g=e.afterWidthOverride,w=e.appendBreadcrumbs,P=e.before,Z=e.beforeHeader,x=e.beforeWidth,_=e.breadcrumbs,A=e.children,M=e.contained,E=e.errors,k=e.headerMenuItems,D=e.headerOffset,C=e.hideAfterCompletely,B=e.mainContainerHeader,I=e.navigationItems,H=e.setAfterHidden,R=e.setAfterWidth,W=e.setBeforeWidth,S=e.setErrors,N=e.subheaderChildren,T=e.subheaderNoPadding,F=e.title,L=e.uuid,q=(0,y.Z)(L,{beforeResizeOffset:y.H,setWidthAfter:R,setWidthBefore:W,widthAfter:p,widthBefore:x,widthOverrideAfter:g}),Q=q.mainContainerRef,U=q.mousedownActiveAfter,z=q.mousedownActiveBefore,G=q.setMousedownActiveAfter,Y=q.setMousedownActiveBefore,V=q.setWidthAfter,X=q.setWidthBefore,J=q.widthAfter,K=q.widthBefore,$=(0,O.Z)().project,ee=[];return _&&ee.push.apply(ee,(0,i.Z)(_)),null!=_&&_.length&&!w||!$||null!=_&&_.length||ee.unshift({bold:!w,label:function(){return F}}),(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(a.Z,{title:F}),(0,d.jsx)(f.Z,{breadcrumbs:ee,menuItems:k}),(0,d.jsxs)(l.Nk,{ref:t,children:[0!==(null==I?void 0:I.length)&&(0,d.jsx)(l.lm,{showMore:!0,children:(0,d.jsx)(v.Z,{navigationItems:I,showMore:!0})}),(0,d.jsx)(c.Z,{flex:1,flexDirection:"column",children:(0,d.jsxs)(b.Z,{after:r,afterHeader:n,afterHeightOffset:j.Mz,afterHidden:o,afterMousedownActive:U,afterWidth:J,before:P,beforeHeader:Z,beforeHeightOffset:j.Mz,beforeMousedownActive:z,beforeWidth:P?K:l.k1,contained:M,headerOffset:D,hideAfterCompletely:!r||C,leftOffset:P?l.k1:null,mainContainerHeader:B,mainContainerRef:Q,setAfterHidden:H,setAfterMousedownActive:G,setAfterWidth:V,setBeforeMousedownActive:Y,setBeforeWidth:X,children:[N&&(0,d.jsx)(h,{noPadding:T,children:N}),A]})})]}),E&&(0,d.jsx)(u.Z,{disableClickOutside:!0,isOpen:!0,onClickOutside:function(){return null==S?void 0:S(null)},children:(0,d.jsx)(s.Z,m(m({},E),{},{onClose:function(){return null==S?void 0:S(null)}}))})]})}var P=o.forwardRef(w)},93808:function(e,t,r){"use strict";r.d(t,{Z:function(){return A}});var n=r(77837),i=r(26304),o=r(62243),u=r(29385),s=r(80022),c=r(13692),a=r(93189),f=r(15544),l=r(82394),d=r(38860),p=r.n(d),h=r(82684),b=r(56663),v=r.n(b),O=r(40761),j=r(34661),y=r(36105),g=r(50178),m=r(69419),w=r(28598),P=["auth"];function Z(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function x(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Z(Object(r),!0).forEach((function(t){(0,l.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Z(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _(e){var t=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 r,n=(0,f.Z)(e);if(t){var i=(0,f.Z)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return(0,a.Z)(this,r)}}function A(e){return function(t){(0,c.Z)(f,t);var r,a=_(f);function f(){var e;(0,o.Z)(this,f);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return e=a.call.apply(a,[this].concat(r)),(0,l.Z)((0,s.Z)(e),"state",{auth:new O.Z(e.props.token)}),e}return(0,u.Z)(f,[{key:"componentDidMount",value:function(){this.setState({auth:new O.Z(this.props.token)})}},{key:"render",value:function(){var t=this.props,r=(t.auth,(0,i.Z)(t,P));return(0,w.jsx)(e,x({auth:this.state.auth},r))}}],[{key:"getInitialProps",value:(r=(0,n.Z)(p().mark((function t(r){var n,i,o,u,s,c,a,f,l;return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=v()(r),i=(0,g.ex)(r),o=i.id,u=n[j.Mv],s=n[y.qt],c=new O.Z(u),a=x(x({},r),{},{auth:c,currentGroupId:o,theme:s}),(0,g.YB)(r)&&c.isExpired&&(console.log("OAuth token has expired."),f=x(x({},r.query),{},{redirect_url:r.asPath}),(0,m.nL)("/sign-in?".concat((0,m.uM)(f)),r.res)),!e.getInitialProps){t.next=12;break}return t.next=10,e.getInitialProps(a);case 10:return l=t.sent,t.abrupt("return",x(x({},l),{},{auth:c,currentGroupId:o,theme:s}));case 12:return t.abrupt("return",a);case 13:case"end":return t.stop()}}),t)}))),function(e){return r.apply(this,arguments)})}]),f}(h.Component)}},78234:function(e,t,r){"use strict";r.r(t);var n=r(77837),i=r(82394),o=r(38860),u=r.n(o),s=r(82684),c=r(34376),a=r(94629),f=r(55072),l=r(27966),d=r(93808),p=r(82359),h=r(38276),b=r(4190),v=r(85544),O=r(35686),j=r(44265),y=r(70515),g=r(69419),m=r(86735),w=r(70320),P=r(28598);function Z(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function x(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Z(Object(r),!0).forEach((function(t){(0,i.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Z(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _(){var e=(0,c.useRouter)(),t=(0,s.useState)(null),r=t[0],n=t[1],o=(0,g.iV)(),u=null!=o&&o.page?o.page:0,d=(0,s.useMemo)((function(){return(0,g.DQ)(o,[j.P0.PIPELINE_UUID,j.P0.STATUS,j.P0.TAG])}),[o]),Z=O.ZP.projects.list().data,_=(0,s.useMemo)((function(){var e;return null==Z||null===(e=Z.projects)||void 0===e?void 0:e[0]}),[Z]),A=((0,s.useMemo)((function(){var e;return(0,w.hY)(null==_||null===(e=_.features)||void 0===e?void 0:e[p.d.LOCAL_TIMEZONE])}),[null==_?void 0:_.features]),x(x({},d),{},{_limit:f.Q,_offset:u*f.Q,disable_retries_grouping:!0,include_pipeline_tags:!0,include_pipeline_uuids:!0}));null!=o&&o.status&&(A.status=o.status);var M=O.ZP.pipeline_runs.list(A,{refreshInterval:3e3,revalidateOnFocus:!0}),E=M.data,k=M.mutate,D=O.ZP.tags.list().data,C=(0,s.useMemo)((function(){return(0,m.YC)((null==D?void 0:D.tags)||[],(function(e){return e.uuid}))}),[D]),B=(0,s.useMemo)((function(){return(null==E?void 0:E.pipeline_runs)||[]}),[E]),I=(0,s.useMemo)((function(){var e;return(null==E||null===(e=E.metadata)||void 0===e?void 0:e.count)||[]}),[E]),H=(0,s.useMemo)((function(){var e;return(null==E||null===(e=E.metadata)||void 0===e?void 0:e.pipeline_uuids)||[]}),[E]),R=(0,s.useMemo)((function(){return(0,P.jsx)(v.Z,{filterOptions:{pipeline_tag:C.map((function(e){return e.uuid})),pipeline_uuid:H,status:j.hn},filterValueLabelMapping:{pipeline_tag:C.reduce((function(e,t){var r=t.uuid;return x(x({},e),{},(0,i.Z)({},r,r))}),{}),status:j.Do},onClickFilterDefaults:function(){e.push("/pipeline-runs")},query:d,resetPageOnFilterApply:!0})}),[H,e,C]);return(0,P.jsx)(a.Z,{errors:r,setErrors:n,subheaderChildren:R,title:"Pipeline runs",uuid:"pipeline_runs/index",children:E?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(l.Z,{fetchPipelineRuns:k,includePipelineTags:!0,pipelineRuns:B,setErrors:n}),(0,P.jsx)(h.Z,{p:2,children:(0,P.jsx)(f.ZP,{maxPages:f.Et,onUpdate:function(t){var r=Number(t),n=x(x({},o),{},{page:r>=0?r:0});e.push("/pipeline-runs","/pipeline-runs?".concat((0,g.uM)(n)))},page:Number(u),totalPages:Math.ceil(I/f.Q)})})]}):(0,P.jsx)(h.Z,{p:y.Mq,children:(0,P.jsx)(b.Z,{inverted:!0,large:!0})})})}_.getInitialProps=(0,n.Z)(u().mark((function e(){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",{});case 1:case"end":return e.stop()}}),e)}))),t.default=(0,d.Z)(_)},60710:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/pipeline-runs",function(){return r(78234)}])},80022:function(e,t,r){"use strict";function n(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}r.d(t,{Z:function(){return n}})},15544:function(e,t,r){"use strict";function n(e){return n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(e)}r.d(t,{Z:function(){return n}})},13692:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n=r(61049);function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&(0,n.Z)(e,t)}},93189:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}});var n=r(12539),i=r(80022);function o(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return(0,i.Z)(e)}}},function(e){e.O(0,[449,7966,5544,9774,2888,179],(function(){return t=60710,e(e.s=t);var t}));var t=e.O();_N_E=t}]);