zenml-nightly 0.84.0.dev20250729__py3-none-any.whl → 0.84.0.dev20250730__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 (205) hide show
  1. zenml/VERSION +1 -1
  2. zenml/client.py +6 -1
  3. zenml/constants.py +25 -0
  4. zenml/integrations/gcp/__init__.py +4 -1
  5. zenml/logging/__init__.py +0 -11
  6. zenml/logging/step_logging.py +255 -149
  7. zenml/models/__init__.py +4 -0
  8. zenml/models/v2/core/service_account.py +87 -1
  9. zenml/models/v2/core/user.py +20 -6
  10. zenml/models/v2/misc/external_user.py +4 -1
  11. zenml/orchestrators/step_launcher.py +2 -4
  12. zenml/zen_server/auth.py +138 -27
  13. zenml/zen_server/dashboard/assets/{404-B5cfnwZ1.js → 404-CMbwR10f.js} +1 -1
  14. zenml/zen_server/dashboard/assets/{@radix-C_LirfyT.js → @radix-B1sy0Lhr.js} +1 -1
  15. zenml/zen_server/dashboard/assets/{@react-router-BSsrkPOd.js → @react-router-CHjLNlgw.js} +1 -1
  16. zenml/zen_server/dashboard/assets/{@reactflow-D9hglKLF.js → @reactflow-gbyyU3kq.js} +2 -2
  17. zenml/zen_server/dashboard/assets/{@tanstack-C0SeHZng.js → @tanstack-Dwlisomv.js} +1 -1
  18. zenml/zen_server/dashboard/assets/AlertDialogDropdownItem-BpLj419i.js +1 -0
  19. zenml/zen_server/dashboard/assets/ButtonGroup-DVhzbQxV.js +1 -0
  20. zenml/zen_server/dashboard/assets/{CodeSnippet-D8iBqOVv.js → CodeSnippet-B7Wd4R8u.js} +1 -1
  21. zenml/zen_server/dashboard/assets/{CollapsibleCard-D0-pQi1n.js → CollapsibleCard-DSZzbjx5.js} +1 -1
  22. zenml/zen_server/dashboard/assets/{ComponentBadge-mw2Ja_ON.js → ComponentBadge-MVT08kBV.js} +1 -1
  23. zenml/zen_server/dashboard/assets/{ComponentIcon-BXgpt-jw.js → ComponentIcon-C9AY8usJ.js} +1 -1
  24. zenml/zen_server/dashboard/assets/DeleteAlertDialog-CzhTVQaC.js +1 -0
  25. zenml/zen_server/dashboard/assets/{DialogItem-DeME0oSt.js → DialogItem-DD_7v3UY.js} +1 -1
  26. zenml/zen_server/dashboard/assets/{DisplayDate-v3KW7oez.js → DisplayDate-57lUNS79.js} +1 -1
  27. zenml/zen_server/dashboard/assets/{EmptyState-DG0m-CGv.js → EmptyState-BMA34iVR.js} +1 -1
  28. zenml/zen_server/dashboard/assets/{Error-DcVLcrLs.js → Error-Cakgjexo.js} +1 -1
  29. zenml/zen_server/dashboard/assets/{ExecutionStatus-C4tlFnlh.js → ExecutionStatus-CQbWovhV.js} +1 -1
  30. zenml/zen_server/dashboard/assets/{Helpbox-C-RGHz3S.js → Helpbox-7FZpmsHB.js} +1 -1
  31. zenml/zen_server/dashboard/assets/{Infobox-DFCWPbMb.js → Infobox-DnduZjNU.js} +1 -1
  32. zenml/zen_server/dashboard/assets/{LeftSideMenu-Czev0KCA.js → LeftSideMenu-D5UEs4vB.js} +1 -1
  33. zenml/zen_server/dashboard/assets/{Lock-CRP5J_su.js → Lock-u8WOoTTd.js} +1 -1
  34. zenml/zen_server/dashboard/assets/NestedCollapsible-0yviIfaA.js +1 -0
  35. zenml/zen_server/dashboard/assets/{NumberBox-CoQjQYDJ.js → NumberBox-C2Pju4PR.js} +1 -1
  36. zenml/zen_server/dashboard/assets/{Pagination-CcDD5yHh.js → Pagination-C1sE5Nzn.js} +1 -1
  37. zenml/zen_server/dashboard/assets/{Partials-DlMzfKgs.js → Partials-DosysQMU.js} +1 -1
  38. zenml/zen_server/dashboard/assets/{PasswordChecker-BZwoeQIm.js → PasswordChecker-DOPLfvg7.js} +1 -1
  39. zenml/zen_server/dashboard/assets/{ProCta-CU2ycJDo.js → ProCta-CUkpV3PJ.js} +1 -1
  40. zenml/zen_server/dashboard/assets/{ProviderIcon-BMAn9Jld.js → ProviderIcon-aQjTuTRX.js} +1 -1
  41. zenml/zen_server/dashboard/assets/{ProviderRadio-D_q9tE3G.js → ProviderRadio-C6pLVNxC.js} +1 -1
  42. zenml/zen_server/dashboard/assets/RunsBody-CZAiSxYK.js +1 -0
  43. zenml/zen_server/dashboard/assets/{SearchField-D_0-uAPj.js → SearchField-Byv1PtST.js} +1 -1
  44. zenml/zen_server/dashboard/assets/{SecretTooltip-BcWMKb9f.js → SecretTooltip-CErfhVgF.js} +1 -1
  45. zenml/zen_server/dashboard/assets/{SetPassword-CaKVSqAL.js → SetPassword-C4OH-cn1.js} +1 -1
  46. zenml/zen_server/dashboard/assets/{SheetHeader-7vwlsY_i.js → SheetHeader-Bb3v9rha.js} +1 -1
  47. zenml/zen_server/dashboard/assets/StackComponentList-D85oab98.js +1 -0
  48. zenml/zen_server/dashboard/assets/StackList-DSAjbVb5.js +1 -0
  49. zenml/zen_server/dashboard/assets/Tabs-2uwqXsdL.js +1 -0
  50. zenml/zen_server/dashboard/assets/Tick-BQ7_xDBl.js +1 -0
  51. zenml/zen_server/dashboard/assets/{UpdatePasswordSchemas-Da5RndbV.js → UpdatePasswordSchemas-DNkYgzN6.js} +1 -1
  52. zenml/zen_server/dashboard/assets/{Wizard-8aJzxUjb.js → Wizard-2FIi8JNY.js} +1 -1
  53. zenml/zen_server/dashboard/assets/WizardFooter-DQEnlDmZ.js +1 -0
  54. zenml/zen_server/dashboard/assets/{all-pipeline-runs-query-gorNNEaT.js → all-pipeline-runs-query-CdvWtiAY.js} +1 -1
  55. zenml/zen_server/dashboard/assets/{arrow-left-hcj2H8HY.js → arrow-left-BFB2mgJo.js} +1 -1
  56. zenml/zen_server/dashboard/assets/{bar-chart-square-check-9siI9icm.js → bar-chart-square-check-_m-oYysN.js} +1 -1
  57. zenml/zen_server/dashboard/assets/{bulk-delete-B5RTlnD_.js → bulk-delete-wdObjfps.js} +2 -2
  58. zenml/zen_server/dashboard/assets/{check-D1bHMJkL.js → check-C9Nye5lR.js} +1 -1
  59. zenml/zen_server/dashboard/assets/{check-circle-mnEgPhPF.js → check-circle-CG6XAdk-.js} +1 -1
  60. zenml/zen_server/dashboard/assets/{chevron-down-Z3nUe-0U.js → chevron-down-Bl7WwQAL.js} +1 -1
  61. zenml/zen_server/dashboard/assets/{chevron-right-double-CbRQKN4Q.js → chevron-right-double-CbMG1dOM.js} +1 -1
  62. zenml/zen_server/dashboard/assets/{clock-BMjHXT3f.js → clock-BnPvxp3D.js} +1 -1
  63. zenml/zen_server/dashboard/assets/{code-browser-DftoiCIg.js → code-browser-CzWvJ4S6.js} +1 -1
  64. zenml/zen_server/dashboard/assets/configuration-form-BbcNBQTO.js +1 -0
  65. zenml/zen_server/dashboard/assets/constants-DfvsDtcH.js +1 -0
  66. zenml/zen_server/dashboard/assets/{create-stack-BruqH_6X.js → create-stack-D4Sf7QpF.js} +1 -1
  67. zenml/zen_server/dashboard/assets/{credit-card-CH1BHrXY.js → credit-card-DfBA6dBb.js} +1 -1
  68. zenml/zen_server/dashboard/assets/{dataflow-2-qHjWt7zp.js → dataflow-2-BLkaTH0Q.js} +1 -1
  69. zenml/zen_server/dashboard/assets/{delete-run-ibBtciMR.js → delete-run-XSre8ru-.js} +1 -1
  70. zenml/zen_server/dashboard/assets/{expand-full-CD4fFvM-.js → expand-full-C8p_0jQv.js} +1 -1
  71. zenml/zen_server/dashboard/assets/{eye-CLNgIh_K.js → eye-BXcQevds.js} +1 -1
  72. zenml/zen_server/dashboard/assets/{file-text-CltVhgwZ.js → file-text-TdPXNd7s.js} +1 -1
  73. zenml/zen_server/dashboard/assets/form-C1jJgRy1.js +1 -0
  74. zenml/zen_server/dashboard/assets/{form-schemas-B9XgTS1V.js → form-schemas-BjWDRvGd.js} +1 -1
  75. zenml/zen_server/dashboard/assets/{help-B0CvBhCm.js → help-CRPfbPTO.js} +1 -1
  76. zenml/zen_server/dashboard/assets/{icon-hDriJUXY.js → icon--Tp6obFZ.js} +1 -1
  77. zenml/zen_server/dashboard/assets/{index-mA8kL088.js → index-B4ZeIaPd.js} +1 -1
  78. zenml/zen_server/dashboard/assets/{index-dCcVgFNl.js → index-BYHxFvoG.js} +1 -1
  79. zenml/zen_server/dashboard/assets/{index-BQWlHo1Y.js → index-BYzR7YrM.js} +1 -1
  80. zenml/zen_server/dashboard/assets/{index-BacoJBEQ.js → index-CO6UN3UX.js} +11 -11
  81. zenml/zen_server/dashboard/assets/{index-B7CRNU8l.js → index-d_QrPL-8.js} +1 -1
  82. zenml/zen_server/dashboard/assets/{index-BRhKF2z-.js → index-g7wOyc86.js} +1 -1
  83. zenml/zen_server/dashboard/assets/index-n_sn2ITN.css +1 -0
  84. zenml/zen_server/dashboard/assets/{index.es-DcVFDpJU.js → index.es-CZMSrR6z.js} +1 -1
  85. zenml/zen_server/dashboard/assets/{index.esm-COnaHLSh.js → index.esm-SBF9nn_P.js} +1 -1
  86. zenml/zen_server/dashboard/assets/{info-CyMih3vQ.js → info-CI2szPUG.js} +1 -1
  87. zenml/zen_server/dashboard/assets/{key-icon-HOx2gazv.js → key-icon-BiV171aI.js} +1 -1
  88. zenml/zen_server/dashboard/assets/layout-Cyc-V16c.js +1 -0
  89. zenml/zen_server/dashboard/assets/{layout-C5dgIReC.js → layout-GIiNvS10.js} +1 -1
  90. zenml/zen_server/dashboard/assets/{login-mutation-CidpsqyH.js → login-mutation-CDgTlQBD.js} +1 -1
  91. zenml/zen_server/dashboard/assets/{logs-DoLoTEfj.js → logs-lNLbZqHL.js} +1 -1
  92. zenml/zen_server/dashboard/assets/{mail-C160gvB0.js → mail-DBJRSzyu.js} +1 -1
  93. zenml/zen_server/dashboard/assets/{message-chat-square-DLz6XmPS.js → message-chat-square-C3CRCQvD.js} +1 -1
  94. zenml/zen_server/dashboard/assets/{package-BhYXGPxF.js → package-pR4bbXJp.js} +1 -1
  95. zenml/zen_server/dashboard/assets/page-1DXG7hp8.js +1 -0
  96. zenml/zen_server/dashboard/assets/{page-BCRXJXC9.js → page-43SWdz4k.js} +1 -1
  97. zenml/zen_server/dashboard/assets/{page-YdWnx9MX.js → page-AOVMuHDc.js} +1 -1
  98. zenml/zen_server/dashboard/assets/page-B4QBxV0B.js +22 -0
  99. zenml/zen_server/dashboard/assets/{page-CvllZMBF.js → page-B8ict_cR.js} +1 -1
  100. zenml/zen_server/dashboard/assets/page-BDre_qCO.js +1 -0
  101. zenml/zen_server/dashboard/assets/page-BbsvGfyi.js +18 -0
  102. zenml/zen_server/dashboard/assets/page-Bi4I23Hs.js +1 -0
  103. zenml/zen_server/dashboard/assets/page-BnAMyQZb.js +1 -0
  104. zenml/zen_server/dashboard/assets/{page-D6cvOG8w.js → page-BnZEAhNn.js} +1 -1
  105. zenml/zen_server/dashboard/assets/page-Bncp08FW.js +1 -0
  106. zenml/zen_server/dashboard/assets/{page-BTDi81N3.js → page-C4Jnp1qP.js} +1 -1
  107. zenml/zen_server/dashboard/assets/page-C7Z2sDHE.js +1 -0
  108. zenml/zen_server/dashboard/assets/page-C8t9qLdV.js +1 -0
  109. zenml/zen_server/dashboard/assets/{page-BByayrO-.js → page-C9IsnFid.js} +2 -2
  110. zenml/zen_server/dashboard/assets/page-CEHZzQ1Q.js +1 -0
  111. zenml/zen_server/dashboard/assets/page-CGtll3Jk.js +1 -0
  112. zenml/zen_server/dashboard/assets/{page-q41JNDWO.js → page-CKPkbOoE.js} +1 -1
  113. zenml/zen_server/dashboard/assets/{page-DF4FVxxW.js → page-CMvcoaSZ.js} +2 -2
  114. zenml/zen_server/dashboard/assets/page-CVwTAlzd.js +1 -0
  115. zenml/zen_server/dashboard/assets/{page-DSZfclXt.js → page-ClqRvz_V.js} +1 -1
  116. zenml/zen_server/dashboard/assets/{page-7CJ4Wq3O.js → page-CzDjN1wE.js} +1 -1
  117. zenml/zen_server/dashboard/assets/{page-BK59rZvf.js → page-D654xHWd.js} +1 -1
  118. zenml/zen_server/dashboard/assets/{page-DcXrWWWh.js → page-DLrYW-Dn.js} +1 -1
  119. zenml/zen_server/dashboard/assets/page-DOnAInjC.js +1 -0
  120. zenml/zen_server/dashboard/assets/{page-Cc8owYXQ.js → page-DQncGJeH.js} +1 -1
  121. zenml/zen_server/dashboard/assets/page-DQzNmXk3.js +1 -0
  122. zenml/zen_server/dashboard/assets/{page-FQxi1Otg.js → page-DSn1Jcvs.js} +1 -1
  123. zenml/zen_server/dashboard/assets/page-DZ5hcS1o.js +1 -0
  124. zenml/zen_server/dashboard/assets/page-DerIbaqa.js +1 -0
  125. zenml/zen_server/dashboard/assets/{page-8U20Tu_8.js → page-DgOEl3Bc.js} +1 -1
  126. zenml/zen_server/dashboard/assets/{page-DgldL5UB.js → page-DgSu4pTE.js} +2 -2
  127. zenml/zen_server/dashboard/assets/page-DgblJuXC.js +1 -0
  128. zenml/zen_server/dashboard/assets/{page-CY0LPcAJ.js → page-Dpw-xP4q.js} +1 -1
  129. zenml/zen_server/dashboard/assets/page-DsFXol8x.js +1 -0
  130. zenml/zen_server/dashboard/assets/page-Du6bFZTS.js +1 -0
  131. zenml/zen_server/dashboard/assets/{page-CeGBDh1Q.js → page-DznxxpKA.js} +1 -1
  132. zenml/zen_server/dashboard/assets/page-E9Mx9_rn.js +1 -0
  133. zenml/zen_server/dashboard/assets/page-HrebZOAM.js +1 -0
  134. zenml/zen_server/dashboard/assets/{page-BX67x4iL.js → page-O5xnz_nW.js} +1 -1
  135. zenml/zen_server/dashboard/assets/{page-DDWW21kl.js → page-hX7NkNdA.js} +1 -1
  136. zenml/zen_server/dashboard/assets/{persist-BKKcL1Kp.js → persist-B3Hb8HDW.js} +1 -1
  137. zenml/zen_server/dashboard/assets/{persist-DxiyfAax.js → persist-Dkbp9MFP.js} +1 -1
  138. zenml/zen_server/dashboard/assets/{pipeline-BJ8liDnl.js → pipeline-CDJSAXrb.js} +1 -1
  139. zenml/zen_server/dashboard/assets/{plus-cI8zD2xh.js → plus-DOrkJCmy.js} +1 -1
  140. zenml/zen_server/dashboard/assets/primary-role-CjkpP9fL.js +1 -0
  141. zenml/zen_server/dashboard/assets/{react-error-boundary.esm-DoXxY4pT.js → react-error-boundary.esm-DgOYA0wh.js} +1 -1
  142. zenml/zen_server/dashboard/assets/{refresh-3EF2R7ja.js → refresh-C8BXS3Fb.js} +1 -1
  143. zenml/zen_server/dashboard/assets/{resource-tyes-list-B5rkZcbc.js → resource-tyes-list-CugyWUAE.js} +1 -1
  144. zenml/zen_server/dashboard/assets/{resource-type-tooltip-E97WGqfk.js → resource-type-tooltip-V-zdiLKz.js} +1 -1
  145. zenml/zen_server/dashboard/assets/{service-B9aVzfAF.js → service-FjqYTmBw.js} +2 -2
  146. zenml/zen_server/dashboard/assets/{service-connectors-DL2-k_E2.js → service-connectors-nF4-OXB9.js} +1 -1
  147. zenml/zen_server/dashboard/assets/{sharedSchema-DyUO09BR.js → sharedSchema-Br1JPr8d.js} +1 -1
  148. zenml/zen_server/dashboard/assets/{slash-circle-D2Lb2FyR.js → slash-circle-B0xMh8q6.js} +1 -1
  149. zenml/zen_server/dashboard/assets/{stack-detail-query-Bc4QKlWg.js → stack-detail-query-DnyMCdVE.js} +1 -1
  150. zenml/zen_server/dashboard/assets/{terminal-BObrvDlO.js → terminal-C2tAF2XG.js} +1 -1
  151. zenml/zen_server/dashboard/assets/{terminal-square-BObrvDlO.js → terminal-square-C2tAF2XG.js} +1 -1
  152. zenml/zen_server/dashboard/assets/{transform-DFpKTKgF.js → transform-S7omcvTm.js} +1 -1
  153. zenml/zen_server/dashboard/assets/{trash-HKxXWbSG.js → trash-D9LA4VFD.js} +1 -1
  154. zenml/zen_server/dashboard/assets/{update-current-user-mutation-DSyUyHVj.js → update-current-user-mutation-B3Dpv3u6.js} +1 -1
  155. zenml/zen_server/dashboard/assets/{update-server-settings-mutation-CdM-Sdds.js → update-server-settings-mutation-s7tlHN8s.js} +1 -1
  156. zenml/zen_server/dashboard/assets/{zod-DgEcN9jD.js → zod-D48zuELD.js} +1 -1
  157. zenml/zen_server/dashboard/index.html +7 -7
  158. zenml/zen_server/rbac/zenml_cloud_rbac.py +8 -4
  159. zenml/zen_server/routers/service_accounts_endpoints.py +71 -12
  160. zenml/zen_stores/base_zen_store.py +0 -19
  161. zenml/zen_stores/migrations/versions/8d4b9ba22c1f_add_user_avatar.py +39 -0
  162. zenml/zen_stores/schemas/user_schemas.py +16 -5
  163. zenml/zen_stores/sql_zen_store.py +5 -1
  164. {zenml_nightly-0.84.0.dev20250729.dist-info → zenml_nightly-0.84.0.dev20250730.dist-info}/METADATA +1 -1
  165. {zenml_nightly-0.84.0.dev20250729.dist-info → zenml_nightly-0.84.0.dev20250730.dist-info}/RECORD +168 -167
  166. zenml/zen_server/dashboard/assets/AlertDialogDropdownItem-druRNuO2.js +0 -1
  167. zenml/zen_server/dashboard/assets/ButtonGroup-SF2DlzHV.js +0 -1
  168. zenml/zen_server/dashboard/assets/DeleteAlertDialog-BbyFVnVI.js +0 -1
  169. zenml/zen_server/dashboard/assets/NestedCollapsible-CN9scBUn.js +0 -1
  170. zenml/zen_server/dashboard/assets/RunsBody-BToytB8e.js +0 -1
  171. zenml/zen_server/dashboard/assets/StackComponentList-s7eSfm8o.js +0 -1
  172. zenml/zen_server/dashboard/assets/StackList-Dt0FrIkM.js +0 -1
  173. zenml/zen_server/dashboard/assets/Tabs-B27AHUfo.js +0 -1
  174. zenml/zen_server/dashboard/assets/Tick-DDeDgTuT.js +0 -1
  175. zenml/zen_server/dashboard/assets/WizardFooter-Bt7_UE14.js +0 -1
  176. zenml/zen_server/dashboard/assets/configuration-form-Yz8m0QIG.js +0 -1
  177. zenml/zen_server/dashboard/assets/constants-DeV48DuZ.js +0 -1
  178. zenml/zen_server/dashboard/assets/form-6aSt3tIl.js +0 -1
  179. zenml/zen_server/dashboard/assets/index-eggipFZS.css +0 -1
  180. zenml/zen_server/dashboard/assets/layout-CFLL6-CM.js +0 -1
  181. zenml/zen_server/dashboard/assets/page-6huxSHEu.js +0 -1
  182. zenml/zen_server/dashboard/assets/page-BMpXak4U.js +0 -1
  183. zenml/zen_server/dashboard/assets/page-Bjmcdg64.js +0 -1
  184. zenml/zen_server/dashboard/assets/page-BsAn8p4m.js +0 -1
  185. zenml/zen_server/dashboard/assets/page-BwjPRuaY.js +0 -1
  186. zenml/zen_server/dashboard/assets/page-CDtSVkNc.js +0 -1
  187. zenml/zen_server/dashboard/assets/page-CEDU0L2T.js +0 -1
  188. zenml/zen_server/dashboard/assets/page-COJK90rG.js +0 -1
  189. zenml/zen_server/dashboard/assets/page-C_XMn4GU.js +0 -1
  190. zenml/zen_server/dashboard/assets/page-Cb3KGsPK.js +0 -22
  191. zenml/zen_server/dashboard/assets/page-CiGOVsj3.js +0 -1
  192. zenml/zen_server/dashboard/assets/page-CmLSFMkW.js +0 -1
  193. zenml/zen_server/dashboard/assets/page-CnfCptXq.js +0 -1
  194. zenml/zen_server/dashboard/assets/page-CxzglV3-.js +0 -1
  195. zenml/zen_server/dashboard/assets/page-DVLez4R1.js +0 -1
  196. zenml/zen_server/dashboard/assets/page-Dg7-H_9i.js +0 -1
  197. zenml/zen_server/dashboard/assets/page-Dw7XuiSo.js +0 -18
  198. zenml/zen_server/dashboard/assets/page-XrmOHHg7.js +0 -1
  199. zenml/zen_server/dashboard/assets/page-oRm7D4TC.js +0 -1
  200. zenml/zen_server/dashboard/assets/page-x2GXC8sI.js +0 -1
  201. zenml/zen_server/dashboard/assets/page-z2FXP4GY.js +0 -1
  202. zenml/zen_server/dashboard/assets/primary-role-CPGHymjN.js +0 -1
  203. {zenml_nightly-0.84.0.dev20250729.dist-info → zenml_nightly-0.84.0.dev20250730.dist-info}/LICENSE +0 -0
  204. {zenml_nightly-0.84.0.dev20250729.dist-info → zenml_nightly-0.84.0.dev20250730.dist-info}/WHEEL +0 -0
  205. {zenml_nightly-0.84.0.dev20250729.dist-info → zenml_nightly-0.84.0.dev20250730.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1 @@
1
+ import{r as p,j as t}from"./@radix-B1sy0Lhr.js";import{u as F,W as Ze,L as Ue}from"./LeftSideMenu-D5UEs4vB.js";import{W as D,H as O,B as E}from"./Wizard-2FIi8JNY.js";import{t as q}from"./zod-D48zuELD.js";import{z as y,d as Y,s as Ke,I as ge,B as M,aZ as Ie,b2 as Qe,b3 as Ge,b4 as Ye,b5 as Je,aG as Xe,b6 as et,aH as tt,aJ as rt,D as st,aX as nt,N as ot,a7 as it,x as at,F as ct,G as lt,H as ut,v as De,w as dt,A as ft,f as mt,aa as ht,r as xt}from"./index-CO6UN3UX.js";import{a as v,C as k,u as W,F as H}from"./index.esm-SBF9nn_P.js";import{S as R}from"./WizardFooter-DQEnlDmZ.js";import{C as je}from"./ComponentIcon-C9AY8usJ.js";import{R as Z,a as U,s as pt,u as yt}from"./create-stack-D4Sf7QpF.js";import{f as gt}from"./index-d_QrPL-8.js";import{b as J,c as jt,k as Oe,h as _t}from"./@tanstack-Dwlisomv.js";import{g as vt,S as St,C as oe,P as ie}from"./ProviderRadio-C6pLVNxC.js";import{S as Ct}from"./transform-S7omcvTm.js";import{C as L}from"./ProviderIcon-aQjTuTRX.js";import{g as bt,a as wt,D as Nt,b as Pt,z as Ft}from"./form-C1jJgRy1.js";import{s as kt}from"./sharedSchema-Br1JPr8d.js";import{S as zt}from"./Lock-u8WOoTTd.js";import{T as _e}from"./Tick-BQ7_xDBl.js";import{s as Ee}from"./index-BYHxFvoG.js";import{C as At}from"./ComponentBadge-MVT08kBV.js";import{e as It}from"./components-Br2ezRib.js";import{L as Dt}from"./@react-router-CHjLNlgw.js";import"./@reactflow-gbyyU3kq.js";import"./bar-chart-square-check-_m-oYysN.js";import"./layout-GIiNvS10.js";import"./persist-Dkbp9MFP.js";import"./plus-DOrkJCmy.js";import"./trash-D9LA4VFD.js";import"./info-CI2szPUG.js";import"./index.es-CZMSrR6z.js";import"./check-C9Nye5lR.js";import"./stack-detail-query-DnyMCdVE.js";const Me=p.createContext(null);function Ot({children:e}){const[r,s]=p.useState({stackName:null,createdStackId:null,connectorConfig:null,fullstackResources:null,artifactStoreConfig:null,registryConfig:null,orchestratorConfig:null});return t.jsx(Me.Provider,{value:{data:r,setData:s},children:e})}function S(){const e=p.useContext(Me);if(e===null)throw new Error("useExistingInfraContext must be used within an ExistingInfraProvider");return e}const Re=p.createContext(null);function be({children:e,initialSchema:r}){const[s,n]=p.useState(r),[o,a]=p.useState({});return t.jsx(Re.Provider,{value:{schema:s,setSchema:n,defaultValues:o,setDefaultValues:a},children:e})}function X(){const e=p.useContext(Re);if(!e)throw new Error("useSchemaContext must be used within a SchemaProvider");return e}const Et=y.object({resourceId:y.string().min(1),flavor:y.string()});function Mt(){return t.jsxs("div",{className:"space-y-1",children:[t.jsxs("p",{className:"flex items-center gap-1 text-text-lg font-semibold",children:[t.jsx(je,{type:"artifact_store",className:"h-5 w-5 fill-primary-400"}),"Select your Artifact Store"]}),t.jsx("p",{className:"text-theme-text-secondary",children:"Choose one of the storages for the new Artifact Store."})]})}var Le=Symbol.for("immer-nothing"),we=Symbol.for("immer-draftable"),g=Symbol.for("immer-state");function _(e,...r){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var z=Object.getPrototypeOf;function A(e){return!!e&&!!e[g]}function N(e){var r;return e?Te(e)||Array.isArray(e)||!!e[we]||!!((r=e.constructor)!=null&&r[we])||te(e)||re(e):!1}var Rt=Object.prototype.constructor.toString();function Te(e){if(!e||typeof e!="object")return!1;const r=z(e);if(r===null)return!0;const s=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return s===Object?!0:typeof s=="function"&&Function.toString.call(s)===Rt}function K(e,r){ee(e)===0?Reflect.ownKeys(e).forEach(s=>{r(s,e[s],e)}):e.forEach((s,n)=>r(n,s,e))}function ee(e){const r=e[g];return r?r.type_:Array.isArray(e)?1:te(e)?2:re(e)?3:0}function de(e,r){return ee(e)===2?e.has(r):Object.prototype.hasOwnProperty.call(e,r)}function Be(e,r,s){const n=ee(e);n===2?e.set(r,s):n===3?e.add(s):e[r]=s}function Lt(e,r){return e===r?e!==0||1/e===1/r:e!==e&&r!==r}function te(e){return e instanceof Map}function re(e){return e instanceof Set}function w(e){return e.copy_||e.base_}function fe(e,r){if(te(e))return new Map(e);if(re(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const s=Te(e);if(r===!0||r==="class_only"&&!s){const n=Object.getOwnPropertyDescriptors(e);delete n[g];let o=Reflect.ownKeys(n);for(let a=0;a<o.length;a++){const l=o[a],u=n[l];u.writable===!1&&(u.writable=!0,u.configurable=!0),(u.get||u.set)&&(n[l]={configurable:!0,writable:!0,enumerable:u.enumerable,value:e[l]})}return Object.create(z(e),n)}else{const n=z(e);if(n!==null&&s)return{...e};const o=Object.create(n);return Object.assign(o,e)}}function ve(e,r=!1){return se(e)||A(e)||!N(e)||(ee(e)>1&&(e.set=e.add=e.clear=e.delete=Tt),Object.freeze(e),r&&Object.entries(e).forEach(([s,n])=>ve(n,!0))),e}function Tt(){_(2)}function se(e){return Object.isFrozen(e)}var Bt={};function P(e){const r=Bt[e];return r||_(0,e),r}var T;function Ve(){return T}function Vt(e,r){return{drafts_:[],parent_:e,immer_:r,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Ne(e,r){r&&(P("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=r)}function me(e){he(e),e.drafts_.forEach(qt),e.drafts_=null}function he(e){e===T&&(T=e.parent_)}function Pe(e){return T=Vt(T,e)}function qt(e){const r=e[g];r.type_===0||r.type_===1?r.revoke_():r.revoked_=!0}function Fe(e,r){r.unfinalizedDrafts_=r.drafts_.length;const s=r.drafts_[0];return e!==void 0&&e!==s?(s[g].modified_&&(me(r),_(4)),N(e)&&(e=Q(r,e),r.parent_||G(r,e)),r.patches_&&P("Patches").generateReplacementPatches_(s[g].base_,e,r.patches_,r.inversePatches_)):e=Q(r,s,[]),me(r),r.patches_&&r.patchListener_(r.patches_,r.inversePatches_),e!==Le?e:void 0}function Q(e,r,s){if(se(r))return r;const n=r[g];if(!n)return K(r,(o,a)=>ke(e,n,r,o,a,s)),r;if(n.scope_!==e)return r;if(!n.modified_)return G(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;const o=n.copy_;let a=o,l=!1;n.type_===3&&(a=new Set(o),o.clear(),l=!0),K(a,(u,f)=>ke(e,n,o,u,f,s,l)),G(e,o,!1),s&&e.patches_&&P("Patches").generatePatches_(n,s,e.patches_,e.inversePatches_)}return n.copy_}function ke(e,r,s,n,o,a,l){if(A(o)){const u=a&&r&&r.type_!==3&&!de(r.assigned_,n)?a.concat(n):void 0,f=Q(e,o,u);if(Be(s,n,f),A(f))e.canAutoFreeze_=!1;else return}else l&&s.add(o);if(N(o)&&!se(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Q(e,o),(!r||!r.scope_.parent_)&&typeof n!="symbol"&&Object.prototype.propertyIsEnumerable.call(s,n)&&G(e,o)}}function G(e,r,s=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&ve(r,s)}function Wt(e,r){const s=Array.isArray(e),n={type_:s?1:0,scope_:r?r.scope_:Ve(),modified_:!1,finalized_:!1,assigned_:{},parent_:r,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=n,a=Se;s&&(o=[n],a=B);const{revoke:l,proxy:u}=Proxy.revocable(o,a);return n.draft_=u,n.revoke_=l,u}var Se={get(e,r){if(r===g)return e;const s=w(e);if(!de(s,r))return Ht(e,s,r);const n=s[r];return e.finalized_||!N(n)?n:n===ae(e.base_,r)?(ce(e),e.copy_[r]=pe(n,e)):n},has(e,r){return r in w(e)},ownKeys(e){return Reflect.ownKeys(w(e))},set(e,r,s){const n=qe(w(e),r);if(n!=null&&n.set)return n.set.call(e.draft_,s),!0;if(!e.modified_){const o=ae(w(e),r),a=o==null?void 0:o[g];if(a&&a.base_===s)return e.copy_[r]=s,e.assigned_[r]=!1,!0;if(Lt(s,o)&&(s!==void 0||de(e.base_,r)))return!0;ce(e),xe(e)}return e.copy_[r]===s&&(s!==void 0||r in e.copy_)||Number.isNaN(s)&&Number.isNaN(e.copy_[r])||(e.copy_[r]=s,e.assigned_[r]=!0),!0},deleteProperty(e,r){return ae(e.base_,r)!==void 0||r in e.base_?(e.assigned_[r]=!1,ce(e),xe(e)):delete e.assigned_[r],e.copy_&&delete e.copy_[r],!0},getOwnPropertyDescriptor(e,r){const s=w(e),n=Reflect.getOwnPropertyDescriptor(s,r);return n&&{writable:!0,configurable:e.type_!==1||r!=="length",enumerable:n.enumerable,value:s[r]}},defineProperty(){_(11)},getPrototypeOf(e){return z(e.base_)},setPrototypeOf(){_(12)}},B={};K(Se,(e,r)=>{B[e]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)}});B.deleteProperty=function(e,r){return B.set.call(this,e,r,void 0)};B.set=function(e,r,s){return Se.set.call(this,e[0],r,s,e[0])};function ae(e,r){const s=e[g];return(s?w(s):e)[r]}function Ht(e,r,s){var o;const n=qe(r,s);return n?"value"in n?n.value:(o=n.get)==null?void 0:o.call(e.draft_):void 0}function qe(e,r){if(!(r in e))return;let s=z(e);for(;s;){const n=Object.getOwnPropertyDescriptor(s,r);if(n)return n;s=z(s)}}function xe(e){e.modified_||(e.modified_=!0,e.parent_&&xe(e.parent_))}function ce(e){e.copy_||(e.copy_=fe(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var $t=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(r,s,n)=>{if(typeof r=="function"&&typeof s!="function"){const a=s;s=r;const l=this;return function(f=a,...d){return l.produce(f,c=>s.call(this,c,...d))}}typeof s!="function"&&_(6),n!==void 0&&typeof n!="function"&&_(7);let o;if(N(r)){const a=Pe(this),l=pe(r,void 0);let u=!0;try{o=s(l),u=!1}finally{u?me(a):he(a)}return Ne(a,n),Fe(o,a)}else if(!r||typeof r!="object"){if(o=s(r),o===void 0&&(o=r),o===Le&&(o=void 0),this.autoFreeze_&&ve(o,!0),n){const a=[],l=[];P("Patches").generateReplacementPatches_(r,o,a,l),n(a,l)}return o}else _(1,r)},this.produceWithPatches=(r,s)=>{if(typeof r=="function")return(l,...u)=>this.produceWithPatches(l,f=>r(f,...u));let n,o;return[this.produce(r,s,(l,u)=>{n=l,o=u}),n,o]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){N(e)||_(8),A(e)&&(e=Zt(e));const r=Pe(this),s=pe(e,void 0);return s[g].isManual_=!0,he(r),s}finishDraft(e,r){const s=e&&e[g];(!s||!s.isManual_)&&_(9);const{scope_:n}=s;return Ne(n,r),Fe(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,r){let s;for(s=r.length-1;s>=0;s--){const o=r[s];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}s>-1&&(r=r.slice(s+1));const n=P("Patches").applyPatches_;return A(e)?n(e,r):this.produce(e,o=>n(o,r))}};function pe(e,r){const s=te(e)?P("MapSet").proxyMap_(e,r):re(e)?P("MapSet").proxySet_(e,r):Wt(e,r);return(r?r.scope_:Ve()).drafts_.push(s),s}function Zt(e){return A(e)||_(10,e),We(e)}function We(e){if(!N(e)||se(e))return e;const r=e[g];let s;if(r){if(!r.modified_)return r.base_;r.finalized_=!0,s=fe(e,r.scope_.immer_.useStrictShallowCopy_)}else s=fe(e,!0);return K(s,(n,o)=>{Be(s,n,We(o))}),r&&(r.finalized_=!1),s}var j=new $t,I=j.produce;j.produceWithPatches.bind(j);j.setAutoFreeze.bind(j);j.setUseStrictShallowCopy.bind(j);j.applyPatches.bind(j);j.createDraft.bind(j);j.finishDraft.bind(j);function Ut(){const{data:e,setData:r}=S(),{setCurrentStep:s}=F();if(!e.fullstackResources)return s(2),{handleFormSubmit:()=>{},flattenedInstances:[]};const n=e.fullstackResources.components_resources_info.artifact_store,o=n.flatMap(l=>l.accessible_by_service_connector.map(u=>({...l,value:u})));function a({flavor:l,resourceId:u}){const f=n.find(d=>d.flavor===l);f&&(r(d=>I(d,c=>{c.artifactStoreConfig={flavor:l,configuration:Object.fromEntries(Object.keys(f.required_configuration||{}).map(h=>[h,u])),service_connector_resource_id:u}})),s(d=>d+1))}return{handleFormSubmit:a,flattenedInstances:o}}function V({flavor:e,type:r,width:s=32,height:n=32,...o}){var l;const a=J({...gt.flavorList({name:e,type:r})});return a.isError?null:a.isPending?t.jsx(Y,{style:{height:`${n}px`,width:`${s}px`}}):t.jsx("img",{width:s,height:n,alt:`${e} logo`,...o,src:Ke(((l=a.data.items[0].body)==null?void 0:l.logo_url)??"")})}const Kt="artifact_store";function Qt(){const[e,r]=p.useState(""),{control:s,setValue:n,handleSubmit:o,register:a,watch:l,trigger:u,reset:f}=v(),{flattenedInstances:d,handleFormSubmit:c}=Ut(),h=d.filter(i=>i.value.toLocaleLowerCase().includes(e.toLocaleLowerCase()));return t.jsxs(t.Fragment,{children:[t.jsx(ge,{placeholder:"Search...",onChange:i=>{f(),r(i.target.value)}}),t.jsxs("form",{onSubmit:o(c),id:"artifact-store-form",children:[t.jsx("input",{type:"hidden",...a("flavor")}),t.jsx("ul",{className:"space-y-1",children:h.map(i=>t.jsx("li",{children:t.jsx(k,{name:"resourceId",control:s,render:({field:{onChange:m,...x}})=>t.jsxs(Z,{"data-state":l("resourceId")===i.value?"selected":"unselected",htmlFor:i.value,children:[t.jsx(U,{id:i.value,type:"radio",...x,onChange:C=>{n("flavor",i.flavor,{shouldValidate:!0,shouldDirty:!0,shouldTouch:!0}),m(C.target.value),u()},value:i.value,name:"connector-radio"}),t.jsx(V,{type:Kt,width:24,height:24,flavor:i.flavor})," ",t.jsx("span",{children:i.value})]})})},i.value))})]})]})}function Gt(){const e=W({resolver:q(Et),shouldUnregister:!0});return t.jsx(H,{...e,children:t.jsxs(D,{children:[t.jsx(O,{children:"Artifact Store"}),t.jsx(E,{children:t.jsxs("section",{className:"space-y-5 py-5 first:pt-0 last:pb-0",children:[t.jsx(Mt,{}),t.jsx(Qt,{})]})}),t.jsx(R,{children:t.jsx(Yt,{})})]})})}function Yt(){const e=v();return t.jsx(M,{disabled:!e.formState.isValid,form:"artifact-store-form",size:"md",children:"Next"})}const He=y.object({authMethod:y.string().min(1),stackName:kt});function Jt(){var h,i;const{data:e}=S(),{setCurrentStep:r}=F(),{control:s,watch:n,resetField:o}=v(),{setSchema:a,setDefaultValues:l}=X(),u=J({...Ie.serviceConnectorTypeDetail(((h=e.connectorConfig)==null?void 0:h.type)||"")});if(u.isError)return null;if(u.isPending)return t.jsx(Y,{className:"h-[40px] w-[100px]"});const f=u.data.auth_methods.filter(m=>m.auth_method!=="implicit").map(m=>({name:m.name,auth_method:m.auth_method}));if(!((i=e.connectorConfig)!=null&&i.type)){r(1);return}function d(){var Ce;const m=n("authMethod"),x=(Ce=u.data)==null?void 0:Ce.auth_methods.find(ne=>ne.auth_method===m);if(!x)return;const C=x.config_schema,b=bt(C),$e=wt(C);a(He.merge(b)),l($e),Object.keys(b.shape).forEach(ne=>o(ne))}const c=e.connectorConfig.type||"";return t.jsx(k,{control:s,name:"authMethod",render:({field:{onChange:m,ref:x,...C}})=>t.jsxs(Qe,{...C,onValueChange:b=>{m(b),d()},children:[t.jsx(Ge,{className:"w-fit border border-neutral-300 text-left text-text-md",children:t.jsx(Ye,{className:"flex items-center gap-2",placeholder:"Select your Auth Method"})}),t.jsx(Je,{children:t.jsx(Xe,{viewportClassName:"max-h-[300px]",children:f.map(b=>t.jsx(et,{className:"space-x-2",value:b.auth_method,children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(L,{provider:c}),t.jsx("div",{children:b.name})]})},b.auth_method))})})]})})}function Xt(){return t.jsxs("section",{className:"space-y-5 py-5 first:pt-0 last:pb-0",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsxs("p",{className:"flex items-center gap-1 text-text-lg font-semibold",children:[t.jsx(Ct,{className:"h-5 w-5 fill-primary-400"}),"Select an Authentication Method"]}),t.jsx("p",{className:"text-theme-text-secondary",children:"Connect ZenML to your resources for seamless integration of cloud services into your ML pipelines."})]}),t.jsx(Jt,{})]})}function er(){return t.jsxs("section",{className:"space-y-5 py-5 first:pt-0 last:pb-0",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsxs("p",{className:"flex items-center gap-1 text-text-lg font-semibold",children:[t.jsx(zt,{className:"h-5 w-5 fill-primary-400"}),"Add your Configuration"]}),t.jsx("p",{className:"text-theme-text-secondary",children:"Your credentials are securely stored and encrypted. ZenML uses these credentials to interact with your resources."})]}),t.jsx(tr,{})]})}function tr(){var c,h;const{data:e}=S(),{watch:r}=v(),s=J({...Ie.serviceConnectorTypeDetail(((c=e.connectorConfig)==null?void 0:c.type)||"")}),n=r("authMethod"),o=(h=s.data)==null?void 0:h.auth_methods.find(i=>i.auth_method===n);if(s.isError)return null;if(s.isPending)return t.jsx(Y,{className:"h-[200px] w-full"});if(!o)return null;const a=o.config_schema,l=a.properties||{},u=a.required||[],f=a.$defs,d=Object.entries(l).sort(([i],[m])=>u.includes(i)&&!u.includes(m)?-1:!u.includes(i)&&u.includes(m)?1:0);return t.jsx("div",{className:"space-y-5",children:d.map(([i,m])=>t.jsx(Nt,{definitions:f,isOptional:Pt(i,u),name:i,schema:m},i))})}function rr({open:e,loadingComponents:r}){var n,o;const{data:s}=S();return(n=s.connectorConfig)!=null&&n.type?t.jsx(tt,{open:e,children:t.jsxs(rt,{onPointerDownOutside:a=>a.preventDefault(),onEscapeKeyDown:a=>a.preventDefault(),className:"max-w-[600px]",children:[t.jsx("div",{className:"flex items-center justify-between border-b border-theme-border-moderate py-2 pl-5 pr-3",children:t.jsx(st,{className:"text-text-lg",children:"Connecting and loading your components..."})}),t.jsxs("div",{className:"flex h-[200px] items-center justify-center gap-5 bg-primary-50",children:[t.jsx(nt,{className:"h-[60px] w-[60px]"}),t.jsx("div",{className:"flex h-[60px] w-[60px] items-center justify-center",children:t.jsx(ot,{className:"h-5 w-5 fill-theme-text-tertiary"})}),t.jsx(L,{className:"h-[60px] w-[60px]",provider:s.connectorConfig.type})]}),t.jsxs("div",{className:"flex flex-col gap-1 px-7 pb-6 pt-5",children:[t.jsxs("p",{className:"text-theme-text-secondary",children:["We're securely connecting to ",vt(((o=s.connectorConfig)==null?void 0:o.type)||"aws")," ","and retrieving your custom components. This process typically takes about 30-60 seconds."]}),t.jsx(sr,{loadingComponents:r})]})]})}):null}function sr({loadingComponents:e}){const[r,s]=p.useState(!0),[n,o]=p.useState(!0);return p.useEffect(()=>{const a=setTimeout(()=>{s(!1)},Math.floor(Math.random()*1e3)+500),l=setTimeout(()=>{o(!1)},1500);return()=>{clearTimeout(a),clearTimeout(l)}},[]),t.jsxs("ul",{className:"mt-3 space-y-3 text-theme-text-secondary",children:[t.jsxs(ue,{children:[t.jsx(le,{loading:r}),"Establishing a secure connection"]}),t.jsxs(ue,{children:[t.jsx(le,{loading:n}),"Authenticating your account"]}),t.jsxs(ue,{children:[t.jsx(le,{loading:e}),"Fetching your existing components"]})]})}function le({loading:e}){return e?t.jsx(it,{className:"h-5 w-5 border-2"}):t.jsx(_e,{className:"h-5 w-5",tickClasses:"w-3 h-3"})}function ue({children:e}){return t.jsx("li",{className:"flex items-center gap-1",children:e})}async function nr({payload:e}){const r=ct(ut.serviceConnectors.fullStackResources),s=await at(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!s.ok){const n=await s.json().then(o=>Array.isArray(o.detail)?o.detail[1]:o.detail).catch(()=>"Error while fetching service connector type");throw new lt({status:s.status,statusText:s.statusText,message:n})}return s.json()}function or(e){return jt({...e,mutationFn:async({payload:r})=>nr({payload:r})})}function ir(){const{setCurrentStep:e}=F(),[r,s]=p.useState(!0),{toast:n}=De(),{setData:o,data:a}=S(),l=or({onSuccess:async f=>{o(d=>I(d,c=>{c.fullstackResources=f})),s(!1),await pt(200),e(d=>d+1)},onError:f=>{n({status:"error",emphasis:"subtle",description:f.message,rounded:!0})}});return{handleFormSubmit:({authMethod:f,stackName:d,...c})=>{Object.keys(c).forEach(i=>{(c[i]===""||c[i]===null||c[i]===void 0||Array.isArray(c[i])&&c[i].length===0)&&delete c[i]});const h=I(a,i=>{i.stackName=d,i.connectorConfig&&(i.connectorConfig.auth_method=f,i.connectorConfig.configuration={...c})});o(h),h.connectorConfig&&l.mutate({payload:h.connectorConfig})},fullStackResources:l,loadingComponents:r}}function ar(){const{handleSubmit:e,formState:{isSubmitting:r}}=v(),{handleFormSubmit:s,fullStackResources:n,loadingComponents:o}=ir();return t.jsxs("form",{onSubmit:e(s),id:"connect-form",children:[t.jsx(rr,{loadingComponents:o,open:r||n.isPending}),t.jsx(Xt,{}),t.jsx(St,{}),t.jsx(er,{})]})}function cr(){const{schema:e,defaultValues:r}=X(),s=W({shouldUnregister:!0,mode:"onChange",resolver:q(e),defaultValues:{stackName:"",authMethod:"",...r}});return t.jsx(H,{...s,children:t.jsxs(D,{children:[t.jsx(O,{children:"Connect to your Cloud"}),t.jsx(E,{children:t.jsx(ar,{})}),t.jsx(R,{children:t.jsx(lr,{})})]})})}function lr(){const{formState:{isValid:e,isSubmitting:r}}=v(),s=!!Oe();return t.jsx(M,{className:"justify-center gap-2",disabled:!e||s||r,form:"connect-form",size:"md",children:s||r?"Loading...":"Next"})}function ur(){const{data:e,setData:r}=S(),s=_t(),{toast:n}=De(),{setCurrentStep:o}=F(),{mutate:a}=yt({onError:d=>{d instanceof Error&&n({status:"error",emphasis:"subtle",icon:t.jsx(dt,{className:"h-5 w-5 shrink-0 fill-error-700"}),description:d.message,rounded:!0})},onSuccess:async d=>{r(c=>I(c,h=>{h.createdStackId=d.id})),o(c=>c+1),s.invalidateQueries({queryKey:Ee.all})}});if(!e.fullstackResources)return o(2),{handleFormSubmit:()=>{},flattenedInstances:[]};const l=e.fullstackResources.components_resources_info.container_registry,u=l.flatMap(d=>d.accessible_by_service_connector.map(c=>({...d,value:c})));function f({flavor:d,resourceId:c}){const h=l.find(m=>m.flavor===d);if(!h)return;const i=I(e,m=>{m.registryConfig={flavor:d,configuration:Object.fromEntries(Object.keys(h.required_configuration||{}).map(x=>[x,c])),service_connector_resource_id:c}});r(i),a({payload:{name:i.stackName||Math.random().toString(36).substring(7),service_connectors:i.connectorConfig?[i.connectorConfig]:[],components:{orchestrator:[{...i.orchestratorConfig,service_connector_index:0}],artifact_store:[{...i.artifactStoreConfig,service_connector_index:0}],container_registry:[{...i.registryConfig,service_connector_index:0}]}}})}return{handleFormSubmit:f,flattenedInstances:u}}const dr="container_registry";function fr(){const[e,r]=p.useState(""),{control:s,setValue:n,handleSubmit:o,register:a,watch:l,trigger:u,reset:f}=v(),{flattenedInstances:d,handleFormSubmit:c}=ur(),h=d.filter(i=>i.value.toLocaleLowerCase().includes(e.toLocaleLowerCase()));return t.jsxs(t.Fragment,{children:[t.jsx(ge,{placeholder:"Search...",onChange:i=>{f(),r(i.target.value)}}),t.jsxs("form",{onSubmit:o(c),id:"artifact-store-form",children:[t.jsx("input",{type:"hidden",...a("flavor")}),t.jsx("ul",{className:"space-y-1",children:h.map(i=>t.jsx("li",{children:t.jsx(k,{name:"resourceId",control:s,render:({field:{onChange:m,...x}})=>t.jsxs(Z,{"data-state":l("resourceId")===i.value?"selected":"unselected",htmlFor:i.value,children:[t.jsx(U,{id:i.value,type:"radio",...x,onChange:C=>{n("flavor",i.flavor,{shouldValidate:!0,shouldDirty:!0,shouldTouch:!0}),m(C.target.value),u()},value:i.value,name:"connector-radio"}),t.jsx(V,{width:24,height:24,type:dr,flavor:i.flavor})," ",t.jsx("span",{children:i.value})]})})},i.value))})]})]})}function mr(){return t.jsx("section",{className:"space-y-5 py-5 first:pt-0 last:pb-0",children:t.jsxs("div",{className:"space-y-1",children:[t.jsxs("p",{className:"flex items-center gap-1 text-text-lg font-semibold",children:[t.jsx(je,{type:"container_registry",className:"h-5 w-5 fill-primary-400"}),"Select your Container Registry"]}),t.jsx("p",{className:"text-theme-text-secondary",children:"Select one of the Container Registries for your new stack"})]})})}const hr=y.object({flavor:y.string().min(1),resourceId:y.string().min(1)});function xr(){const e=W({resolver:q(hr),shouldUnregister:!0});return t.jsx(H,{...e,children:t.jsxs(D,{children:[t.jsx(O,{children:"Container Registry"}),t.jsx(E,{children:t.jsxs("section",{className:"space-y-5 py-5 first:pt-0 last:pb-0",children:[t.jsx(mr,{}),t.jsx(fr,{})]})}),t.jsx(R,{children:t.jsx(pr,{})})]})})}function pr(){const e=v(),r=!!Oe();return t.jsxs(M,{className:"justify-center gap-2",disabled:!e.formState.isValid||r,form:"artifact-store-form",size:"md",children:[r&&t.jsx("div",{role:"alert","aria-busy":"true",className:"full h-[20px] w-[20px] animate-spin rounded-rounded border-2 border-theme-text-negative border-b-theme-text-brand"}),r?"Loading...":"Next"]})}function yr(){var a;const{data:e,setData:r}=S(),{setCurrentStep:s}=F();if(!e.fullstackResources)return s(2),{orchestrators:[],handleFormSubmit:()=>{}};const n=((a=e.fullstackResources.components_resources_info)==null?void 0:a.orchestrator)||[];function o({flavor:l,resourceId:u,...f}){const d=n.find(c=>c.flavor===l);d&&(r(c=>{const h=d!=null&&d.use_resource_value_as_fixed_config?Object.fromEntries(Object.keys(d.required_configuration||{}).map(i=>[i,u])):{...f};return I(c,i=>{i.orchestratorConfig={flavor:l,configuration:h,service_connector_resource_id:u}})}),s(c=>c+1))}return{orchestrators:n,handleFormSubmit:o}}const ye=y.object({flavor:y.string().min(1),resourceId:y.string().min(1)}),$="kubernetes",ze="orchestrator";function gr(){const{orchestrators:e,handleFormSubmit:r}=yr(),{setSchema:s}=X(),{control:n,watch:o,setValue:a,register:l,reset:u,handleSubmit:f}=v(),d=o("flavor");return t.jsxs("form",{onSubmit:f(r),id:"artifact-store-form",children:[d!==$&&t.jsx("input",{...l("resourceId"),type:"hidden"}),t.jsx("ul",{className:"space-y-1",children:e.map((c,h)=>t.jsxs("li",{children:[t.jsx(k,{control:n,name:"flavor",render:({field:{onChange:i,...m}})=>t.jsxs(Z,{"data-state":d===c.flavor?"selected":"unselected",htmlFor:c.flavor,children:[t.jsx(U,{onChange:x=>{u({flavor:c.flavor}),c.use_resource_value_as_fixed_config===!0&&s(ye),c.use_resource_value_as_fixed_config===!1&&c.required_configuration&&s(ye.merge(Ft(c.required_configuration))),c.flavor!==$&&c.accessible_by_service_connector.length>0&&a("resourceId",c.accessible_by_service_connector[0]),i(x)},...m,id:c.flavor,type:"radio",value:c.flavor,name:"orchestrator-flavor-radio"}),t.jsx(V,{width:24,height:24,type:ze,flavor:c.flavor}),t.jsx("span",{children:c.flavor_display_name})]})}),d===c.flavor&&(c.flavor===$||c.use_resource_value_as_fixed_config===!1)&&t.jsxs("div",{className:"space-y-3 py-5 pl-8",children:[c.flavor===$&&t.jsx("ul",{className:"space-y-1",children:c.accessible_by_service_connector.map(i=>t.jsx("li",{children:t.jsx(k,{control:n,name:"resourceId",render:({field:m})=>t.jsxs(Z,{"data-state":o("resourceId")===i?"selected":"unselected",htmlFor:i,children:[t.jsx(U,{...m,id:i,type:"radio",value:i,name:"instance-radio"}),t.jsx(V,{type:ze,width:24,height:24,flavor:c.flavor}),t.jsx("span",{children:i})]})})},i))}),c.use_resource_value_as_fixed_config===!1&&c.required_configuration&&Object.keys(c.required_configuration).length>=1&&t.jsx("div",{children:Object.entries(c.required_configuration).map(([i,m])=>t.jsx("div",{children:t.jsx(k,{defaultValue:"",name:i,control:n,render:({field:x})=>t.jsxs("div",{children:[t.jsx("label",{htmlFor:i,className:"text-text-sm",children:m}),t.jsx(ge,{...x,inputSize:"md",required:!0,className:"w-full",id:i})]})})},i))})]})]},h))})]})}function jr(){return t.jsx("section",{className:"space-y-5 py-5 first:pt-0 last:pb-0",children:t.jsxs("div",{className:"space-y-1",children:[t.jsxs("p",{className:"flex items-center gap-1 text-text-lg font-semibold",children:[t.jsx(je,{type:"orchestrator",className:"h-5 w-5 fill-primary-400"}),"Select your Orchestrator"]}),t.jsx("p",{className:"text-theme-text-secondary",children:"Select one of the connected orchestrators for your new stack"})]})})}function _r(){const{schema:e}=X(),r=W({resolver:q(e),shouldUnregister:!0,defaultValues:{resourceId:""}});return t.jsx(H,{...r,children:t.jsxs(D,{children:[t.jsx(O,{children:"Orchestrator"}),t.jsxs(E,{children:[t.jsx(jr,{}),t.jsx(gr,{})]}),t.jsx(R,{children:t.jsx(vr,{})})]})})}function vr(){const e=v();return t.jsx(M,{disabled:!e.formState.isValid,form:"artifact-store-form",size:"md",children:"Next"})}const Sr=y.object({provider:y.string().min(1)});function Cr(){var a;const{setData:e,data:r}=S(),{setCurrentStep:s}=F(),n=W({resolver:q(Sr),defaultValues:{provider:((a=r.connectorConfig)==null?void 0:a.type)||""}});function o(l){e(u=>({...u,connectorConfig:{type:l.provider,auth_method:""}})),s(u=>u+1)}return t.jsx(H,{...n,children:t.jsxs(D,{children:[t.jsx(O,{children:"Select Your Existing Cloud Infrastructure"}),t.jsx(E,{children:t.jsxs("div",{className:"space-y-5",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsx("p",{className:"text-text-lg font-semibold",children:"Select a Cloud Provider"}),t.jsx("p",{className:"text-theme-text-secondary",children:"Select the cloud provider where you have existing infrastructure to connect with ZenML. This will allow you to integrate your current cloud resources with ZenML for model deployment and management."})]}),t.jsxs("form",{id:"provider-form",onSubmit:n.handleSubmit(o),className:"grid grid-cols-1 gap-3 xl:grid-cols-3",children:[t.jsx(oe,{id:"aws-provider",...n.register("provider"),value:"aws",children:t.jsx(ie,{icon:t.jsx(L,{provider:"aws",className:"h-6 w-6 shrink-0"}),title:"AWS",subtitle:"Connect your existing S3, ECR, and Sagemaker components to ZenML"})}),t.jsx(oe,{id:"gcp-provider",...n.register("provider"),value:"gcp",children:t.jsx(ie,{icon:t.jsx(L,{provider:"gcp",className:"h-6 w-6 shrink-0"}),title:"GCP",subtitle:"Link your GCS, Artifact Registry, and Vertex AI components to ZenML"})}),t.jsx(oe,{id:"azure-provider",...n.register("provider"),value:"azure",children:t.jsx(ie,{icon:t.jsx(L,{provider:"azure",className:"h-6 w-6 shrink-0"}),title:"Azure",subtitle:"Integrate ZenML with your Blob Storage, Container Registry, and Azure ML"})})]})]})}),t.jsx(R,{children:t.jsx(br,{})})]})})}function br(){const{formState:{isValid:e}}=v();return t.jsx(M,{form:"provider-form",disabled:!e,size:"md",children:"Next"})}function wr(){var o;const{data:e}=S(),r=J({...Ee.stackDetail(e.createdStackId||""),throwOnError:!0});if(r.isError)return null;if(r.isPending)return t.jsx(Y,{className:"h-[200px] w-full"});const s=r.data,n=It((o=r.data.metadata)==null?void 0:o.components);return t.jsxs(D,{children:[t.jsx(O,{children:"Your stack"}),t.jsx(E,{children:t.jsxs("div",{className:"space-y-5",children:[t.jsx("p",{className:"text-theme-text-secondary",children:"Here you can review the created stack and stack components. Now you can start running pipelines using this new configuration."}),t.jsxs("div",{className:"divide-y divide-theme-border-moderate overflow-hidden rounded-md border border-theme-border-moderate",children:[t.jsx(Pr,{stack:s}),n.map(a=>t.jsx(Fr,{component:a},a.id))]})]})}),t.jsx(R,{displayCancel:!1,children:t.jsx(Nr,{})})]})}function Nr(){return t.jsx(M,{size:"md",asChild:!0,children:t.jsx(Dt,{to:xt.stacks.overview,children:"Finish"})})}function Pr({stack:e}){return t.jsxs("div",{className:"flex items-center gap-3 bg-theme-surface-secondary p-5 font-semibold",children:[t.jsx(_e,{className:"h-5 w-5",tickClasses:"w-3 h-3"}),t.jsx(ft,{type:"square",size:"lg",children:t.jsx(mt,{size:"lg",children:e.name[0]})}),t.jsxs("div",{children:[t.jsx("p",{className:"text-text-lg",children:e.name}),t.jsx("p",{className:"text-text-sm text-theme-text-secondary",children:e.id.split("-")[0]})]})]})}function Fr({component:e}){var r,s,n,o;return t.jsxs("div",{className:"flex items-center justify-between py-3 pl-9 pr-5",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(_e,{className:"h-5 w-5",tickClasses:"w-3 h-3"}),t.jsx(V,{width:24,height:24,flavor:((r=e.body)==null?void 0:r.flavor_name)||"",type:((s=e.body)==null?void 0:s.type)||"orchestrator"}),t.jsxs("div",{children:[t.jsx("p",{className:"text-text-lg font-semibold",children:e.name}),t.jsx("p",{className:"text-text-sm text-theme-text-secondary",children:e.id.split("-")[0]})]})]}),t.jsx(At,{type:((n=e.body)==null?void 0:n.type)||"alerter",children:ht((o=e.body)==null?void 0:o.type)})]},e.id)}function kr(){const{currentStep:e}=F();if(e===1)return t.jsx(Cr,{});if(e===2)return t.jsx(be,{initialSchema:He,children:t.jsx(cr,{})});if(e===3)return t.jsx(Gt,{});if(e===4)return t.jsx(be,{initialSchema:ye,children:t.jsx(_r,{})});if(e===5)return t.jsx(xr,{});if(e===6)return t.jsx(wr,{})}const Ae=["Infrastructure Type","Cloud Provider","Connect your Cloud","Artifact Store","Orchestrator","Container Registry"];function ls(){return t.jsx(Ze,{maxSteps:Ae.length+1,initialStep:1,children:t.jsx(Ot,{children:t.jsxs("section",{className:"layout-container flex flex-col gap-5 py-5 xl:flex-row",children:[t.jsx(Ue,{entries:Ae}),t.jsx("div",{className:"w-full",children:t.jsx(kr,{})})]})})})}export{ls as default};
@@ -1 +1 @@
1
- import{r as c,j as e}from"./@radix-C_LirfyT.js";import{c as N,u as R}from"./bulk-delete-B5RTlnD_.js";import{p as D}from"./index-BQWlHo1Y.js";import{y as k,F as A,E as _,G as E,H as O,B as C,J as I,K as F,L as B,M as L,N as f,r as p,O as z,Q as $,R as M,U as H,V as g,T as U,z as d,W as G,d as j}from"./index-BacoJBEQ.js";import{c as Q,b as q}from"./@tanstack-C0SeHZng.js";import{S as K}from"./refresh-3EF2R7ja.js";import{P as J}from"./Pagination-CcDD5yHh.js";import{S as V}from"./SearchField-D_0-uAPj.js";import{S as P}from"./trash-HKxXWbSG.js";import{D as S,a as v}from"./DeleteAlertDialog-BbyFVnVI.js";import{S as W}from"./pipeline-BJ8liDnl.js";import{S as X}from"./terminal-BObrvDlO.js";import{g as Y,E as Z,a as ee}from"./ExecutionStatus-C4tlFnlh.js";import{L as m,f as te}from"./@react-router-BSsrkPOd.js";import{A as se}from"./AlertDialogDropdownItem-druRNuO2.js";import"./@reactflow-D9hglKLF.js";import"./chevron-right-double-CbRQKN4Q.js";import"./index-BRhKF2z-.js";import"./zod-DgEcN9jD.js";import"./index.esm-COnaHLSh.js";import"./check-circle-mnEgPhPF.js";import"./help-B0CvBhCm.js";async function ne({pipelineId:t}){const s=k(_.pipelines.detail(t)),n=await fetch(s,{method:"DELETE",credentials:"include",headers:{"Content-Type":"application/json"}});if(!n.ok){const a=await n.json().then(r=>r.detail).catch(()=>`Failed to delete pipeline ${t}`);throw new A({status:n.status,statusText:n.statusText,message:a})}return n.json()}function ae(t){return Q({mutationFn:ne,...t})}const{ContextProvider:re,useContext:u}=N();function w(){const{setRowSelection:t}=u(),{mutateAsync:s}=ae();async function n(a){await s({pipelineId:a})}return R({deleteFn:n,queryKeyToInvalidate:D.all,setRowSelection:t})}function ie(){const[t,s]=c.useState(!1),{selectedRowCount:n,selectedRowIDs:a}=u(),{bulkDelete:r}=w();async function i(){await r(a),s(!1)}return e.jsxs(E,{open:t,onOpenChange:s,children:[e.jsx(O,{asChild:!0,children:e.jsxs(C,{className:"rounded-sharp border-y-0 bg-white",size:"md",emphasis:"subtle",intent:"secondary",children:[e.jsx(P,{className:"h-5 w-5 shrink-0 gap-1 fill-neutral-400"}),"Delete"]})}),e.jsx(S,{title:`Delete Pipeline${n>=2?"s":""}`,handleDelete:i,children:e.jsxs(v,{children:[e.jsx("p",{children:"Are you sure?"}),e.jsx("p",{children:"This action cannot be undone."})]})})]})}function oe(){const{selectedRowCount:t}=u();return e.jsxs("div",{className:"flex items-center divide-x divide-theme-border-moderate overflow-hidden rounded-md border border-theme-border-moderate",children:[e.jsx("div",{className:"bg-primary-25 px-2 py-1 font-semibold text-theme-text-brand",children:`${t} Pipeline${t>1?"s":""} selected`}),e.jsx(ie,{})]})}function le({id:t}){const[s,n]=c.useState(!1),[a,r]=c.useState(!1),i=c.useRef(null),o=c.useRef(null),{bulkDelete:y}=w();async function b(){await y([t]),x(!1)}function T(){o.current=i.current}function x(l){if(l===!1){r(!1),setTimeout(()=>{n(l)},200);return}n(l)}return e.jsxs(I,{onOpenChange:r,open:a,children:[e.jsx(F,{ref:i,children:e.jsx(B,{className:"h-4 w-4 fill-theme-text-tertiary"})}),e.jsx(L,{hidden:s,onCloseAutoFocus:l=>{o.current&&(o.current.focus(),o.current=null,l.preventDefault())},align:"end",sideOffset:7,children:e.jsx(se,{onSelect:T,open:s,onOpenChange:x,triggerChildren:"Delete",icon:e.jsx(P,{fill:"red"}),children:e.jsx(S,{title:"Delete Pipeline",handleDelete:b,children:e.jsxs(v,{children:[e.jsx("p",{children:"Are you sure?"}),e.jsx("p",{children:"This action cannot be undone."})]})})})})]})}function ce(){return[{id:"select",meta:{width:"1%"},header:({table:t})=>e.jsx(f,{id:"check-all",checked:t.getIsAllRowsSelected(),onCheckedChange:s=>t.toggleAllRowsSelected(s==="indeterminate"?!0:s)}),cell:({row:t})=>e.jsx(f,{id:`check-${t.id}`,checked:t.getIsSelected(),onCheckedChange:t.getToggleSelectedHandler()})},{id:"name",header:"Pipeline",cell:({row:t})=>{var s,n,a;return e.jsxs("div",{className:"group/copybutton flex items-center gap-2",children:[e.jsx(W,{className:`h-5 w-5 ${Y((s=t.original.resources)==null?void 0:s.latest_run_status)}`}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(m,{to:p.projects.pipelines.namespace(encodeURIComponent(t.original.name)),className:"flex items-center gap-1",children:e.jsx("span",{className:"text-text-md font-semibold text-theme-text-primary",children:t.original.name})}),e.jsx(z,{children:e.jsxs($,{children:[e.jsx(M,{className:"hover:text-theme-text-brand hover:underline",children:e.jsx(Z,{status:(n=t.original.resources)==null?void 0:n.latest_run_status})}),e.jsx(H,{className:"z-20 capitalize",children:(a=t.original.resources)==null?void 0:a.latest_run_status})]})}),e.jsx(g,{copyText:t.original.name})]}),e.jsxs(m,{to:p.projects.pipelines.namespace(encodeURIComponent(t.original.name)),className:"flex items-center gap-1",children:[e.jsx("p",{className:"text-text-xs text-theme-text-secondary",children:t.original.id.split("-")[0]}),e.jsx(g,{copyText:t.original.id})]})]})]})}},{id:"latest-run",header:"Latest Run",accessorFn:t=>{var s,n;return{status:(s=t.resources)==null?void 0:s.latest_run_status,runId:(n=t.resources)==null?void 0:n.latest_run_id}},cell:({getValue:t})=>{const{runId:s,status:n}=t();return!s||!n?e.jsx("div",{children:"No run"}):e.jsx(m,{to:p.projects.runs.detail(s),children:e.jsxs(U,{emphasis:"subtle",rounded:!1,className:"inline-flex items-center gap-0.5",color:ee(n),children:[e.jsx(X,{className:"h-3 w-3 fill-current"}),s==null?void 0:s.split("-")[0]]})})}},{id:"admin_actions",header:"",meta:{width:"5%"},cell:({row:t})=>e.jsx(le,{id:t.original.id})}]}const h=1,de=d.object({page:d.coerce.number().min(h).optional().default(h).catch(h),name:d.string().optional(),operator:d.enum(["and","or"]).optional()});function ue(){const[t]=te(),{page:s,name:n,operator:a}=de.parse({page:t.get("page")||void 0,name:t.get("name")||void 0,operator:t.get("operator")||void 0});return{page:s,name:n,logical_operator:a}}function pe(){const t=ue(),{selectedRowCount:s,rowSelection:n,setRowSelection:a}=u(),{data:r,refetch:i}=q({...D.pipelineList({...t,sort_by:"desc:latest_run"}),throwOnError:!0});return e.jsxs("div",{className:"flex flex-col gap-5 pt-5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[s?e.jsx(oe,{}):e.jsx(V,{searchParams:t}),e.jsx("div",{className:"flex justify-between",children:e.jsxs(C,{intent:"primary",emphasis:"subtle",size:"md",onClick:()=>i(),children:[e.jsx(K,{className:"h-5 w-5 fill-theme-text-brand"}),"Refresh"]})})]}),e.jsxs("div",{className:"flex flex-col items-center gap-5",children:[e.jsx("div",{className:"w-full",children:r?e.jsx(G,{rowSelection:n,onRowSelectionChange:a,getRowId:o=>o.id,columns:ce(),data:r.items}):e.jsx(j,{className:"h-[500px] w-full"})}),r?r.total_pages>1&&e.jsx(J,{searchParams:t,paginate:r}):e.jsx(j,{className:"h-[36px] w-[300px]"})]})]})}function Ie(){return e.jsx(re,{children:e.jsx(pe,{})})}export{Ie as default};
1
+ import{r as c,j as e}from"./@radix-B1sy0Lhr.js";import{c as N,u as R}from"./bulk-delete-wdObjfps.js";import{p as D}from"./index-BYzR7YrM.js";import{F as k,G as A,H as _,J as O,K as E,B as C,L as I,M as F,N as B,O as L,Q as f,r as p,R as z,U as $,V as M,W as H,X as g,T as U,z as d,Y as G,d as j}from"./index-CO6UN3UX.js";import{c as Q,b as q}from"./@tanstack-Dwlisomv.js";import{S as K}from"./refresh-C8BXS3Fb.js";import{P as J}from"./Pagination-C1sE5Nzn.js";import{S as V}from"./SearchField-Byv1PtST.js";import{S as P}from"./trash-D9LA4VFD.js";import{D as S,a as v}from"./DeleteAlertDialog-CzhTVQaC.js";import{S as W}from"./pipeline-CDJSAXrb.js";import{S as X}from"./terminal-C2tAF2XG.js";import{g as Y,E as Z,a as ee}from"./ExecutionStatus-CQbWovhV.js";import{L as m,f as te}from"./@react-router-CHjLNlgw.js";import{A as se}from"./AlertDialogDropdownItem-BpLj419i.js";import"./@reactflow-gbyyU3kq.js";import"./chevron-right-double-CbMG1dOM.js";import"./index-g7wOyc86.js";import"./zod-D48zuELD.js";import"./index.esm-SBF9nn_P.js";import"./check-circle-CG6XAdk-.js";import"./help-CRPfbPTO.js";async function ne({pipelineId:t}){const s=k(_.pipelines.detail(t)),n=await fetch(s,{method:"DELETE",credentials:"include",headers:{"Content-Type":"application/json"}});if(!n.ok){const a=await n.json().then(r=>r.detail).catch(()=>`Failed to delete pipeline ${t}`);throw new A({status:n.status,statusText:n.statusText,message:a})}return n.json()}function ae(t){return Q({mutationFn:ne,...t})}const{ContextProvider:re,useContext:u}=N();function w(){const{setRowSelection:t}=u(),{mutateAsync:s}=ae();async function n(a){await s({pipelineId:a})}return R({deleteFn:n,queryKeyToInvalidate:D.all,setRowSelection:t})}function ie(){const[t,s]=c.useState(!1),{selectedRowCount:n,selectedRowIDs:a}=u(),{bulkDelete:r}=w();async function i(){await r(a),s(!1)}return e.jsxs(O,{open:t,onOpenChange:s,children:[e.jsx(E,{asChild:!0,children:e.jsxs(C,{className:"rounded-sharp border-y-0 bg-white",size:"md",emphasis:"subtle",intent:"secondary",children:[e.jsx(P,{className:"h-5 w-5 shrink-0 gap-1 fill-neutral-400"}),"Delete"]})}),e.jsx(S,{title:`Delete Pipeline${n>=2?"s":""}`,handleDelete:i,children:e.jsxs(v,{children:[e.jsx("p",{children:"Are you sure?"}),e.jsx("p",{children:"This action cannot be undone."})]})})]})}function oe(){const{selectedRowCount:t}=u();return e.jsxs("div",{className:"flex items-center divide-x divide-theme-border-moderate overflow-hidden rounded-md border border-theme-border-moderate",children:[e.jsx("div",{className:"bg-primary-25 px-2 py-1 font-semibold text-theme-text-brand",children:`${t} Pipeline${t>1?"s":""} selected`}),e.jsx(ie,{})]})}function le({id:t}){const[s,n]=c.useState(!1),[a,r]=c.useState(!1),i=c.useRef(null),o=c.useRef(null),{bulkDelete:y}=w();async function b(){await y([t]),x(!1)}function T(){o.current=i.current}function x(l){if(l===!1){r(!1),setTimeout(()=>{n(l)},200);return}n(l)}return e.jsxs(I,{onOpenChange:r,open:a,children:[e.jsx(F,{ref:i,children:e.jsx(B,{className:"h-4 w-4 fill-theme-text-tertiary"})}),e.jsx(L,{hidden:s,onCloseAutoFocus:l=>{o.current&&(o.current.focus(),o.current=null,l.preventDefault())},align:"end",sideOffset:7,children:e.jsx(se,{onSelect:T,open:s,onOpenChange:x,triggerChildren:"Delete",icon:e.jsx(P,{fill:"red"}),children:e.jsx(S,{title:"Delete Pipeline",handleDelete:b,children:e.jsxs(v,{children:[e.jsx("p",{children:"Are you sure?"}),e.jsx("p",{children:"This action cannot be undone."})]})})})})]})}function ce(){return[{id:"select",meta:{width:"1%"},header:({table:t})=>e.jsx(f,{id:"check-all",checked:t.getIsAllRowsSelected(),onCheckedChange:s=>t.toggleAllRowsSelected(s==="indeterminate"?!0:s)}),cell:({row:t})=>e.jsx(f,{id:`check-${t.id}`,checked:t.getIsSelected(),onCheckedChange:t.getToggleSelectedHandler()})},{id:"name",header:"Pipeline",cell:({row:t})=>{var s,n,a;return e.jsxs("div",{className:"group/copybutton flex items-center gap-2",children:[e.jsx(W,{className:`h-5 w-5 ${Y((s=t.original.resources)==null?void 0:s.latest_run_status)}`}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(m,{to:p.projects.pipelines.namespace(encodeURIComponent(t.original.name)),className:"flex items-center gap-1",children:e.jsx("span",{className:"text-text-md font-semibold text-theme-text-primary",children:t.original.name})}),e.jsx(z,{children:e.jsxs($,{children:[e.jsx(M,{className:"hover:text-theme-text-brand hover:underline",children:e.jsx(Z,{status:(n=t.original.resources)==null?void 0:n.latest_run_status})}),e.jsx(H,{className:"z-20 capitalize",children:(a=t.original.resources)==null?void 0:a.latest_run_status})]})}),e.jsx(g,{copyText:t.original.name})]}),e.jsxs(m,{to:p.projects.pipelines.namespace(encodeURIComponent(t.original.name)),className:"flex items-center gap-1",children:[e.jsx("p",{className:"text-text-xs text-theme-text-secondary",children:t.original.id.split("-")[0]}),e.jsx(g,{copyText:t.original.id})]})]})]})}},{id:"latest-run",header:"Latest Run",accessorFn:t=>{var s,n;return{status:(s=t.resources)==null?void 0:s.latest_run_status,runId:(n=t.resources)==null?void 0:n.latest_run_id}},cell:({getValue:t})=>{const{runId:s,status:n}=t();return!s||!n?e.jsx("div",{children:"No run"}):e.jsx(m,{to:p.projects.runs.detail(s),children:e.jsxs(U,{emphasis:"subtle",rounded:!1,className:"inline-flex items-center gap-0.5",color:ee(n),children:[e.jsx(X,{className:"h-3 w-3 fill-current"}),s==null?void 0:s.split("-")[0]]})})}},{id:"admin_actions",header:"",meta:{width:"5%"},cell:({row:t})=>e.jsx(le,{id:t.original.id})}]}const h=1,de=d.object({page:d.coerce.number().min(h).optional().default(h).catch(h),name:d.string().optional(),operator:d.enum(["and","or"]).optional()});function ue(){const[t]=te(),{page:s,name:n,operator:a}=de.parse({page:t.get("page")||void 0,name:t.get("name")||void 0,operator:t.get("operator")||void 0});return{page:s,name:n,logical_operator:a}}function pe(){const t=ue(),{selectedRowCount:s,rowSelection:n,setRowSelection:a}=u(),{data:r,refetch:i}=q({...D.pipelineList({...t,sort_by:"desc:latest_run"}),throwOnError:!0});return e.jsxs("div",{className:"flex flex-col gap-5 pt-5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[s?e.jsx(oe,{}):e.jsx(V,{searchParams:t}),e.jsx("div",{className:"flex justify-between",children:e.jsxs(C,{intent:"primary",emphasis:"subtle",size:"md",onClick:()=>i(),children:[e.jsx(K,{className:"h-5 w-5 fill-theme-text-brand"}),"Refresh"]})})]}),e.jsxs("div",{className:"flex flex-col items-center gap-5",children:[e.jsx("div",{className:"w-full",children:r?e.jsx(G,{rowSelection:n,onRowSelectionChange:a,getRowId:o=>o.id,columns:ce(),data:r.items}):e.jsx(j,{className:"h-[500px] w-full"})}),r?r.total_pages>1&&e.jsx(J,{searchParams:t,paginate:r}):e.jsx(j,{className:"h-[36px] w-[300px]"})]})]})}function Ie(){return e.jsx(re,{children:e.jsx(pe,{})})}export{Ie as default};
@@ -0,0 +1 @@
1
+ import{j as r}from"./@radix-B1sy0Lhr.js";import{R as o}from"./RunsBody-CZAiSxYK.js";import{b as t}from"./ButtonGroup-DVhzbQxV.js";import"./refresh-C8BXS3Fb.js";import"./Pagination-C1sE5Nzn.js";import"./index-CO6UN3UX.js";import"./@tanstack-Dwlisomv.js";import"./@react-router-CHjLNlgw.js";import"./@reactflow-gbyyU3kq.js";import"./chevron-right-double-CbMG1dOM.js";import"./SearchField-Byv1PtST.js";import"./index-g7wOyc86.js";import"./all-pipeline-runs-query-CdvWtiAY.js";import"./terminal-C2tAF2XG.js";import"./DisplayDate-57lUNS79.js";import"./ExecutionStatus-CQbWovhV.js";import"./check-circle-CG6XAdk-.js";import"./help-CRPfbPTO.js";import"./trash-D9LA4VFD.js";import"./AlertDialogDropdownItem-BpLj419i.js";import"./DeleteAlertDialog-CzhTVQaC.js";import"./zod-D48zuELD.js";import"./index.esm-SBF9nn_P.js";import"./bulk-delete-wdObjfps.js";import"./delete-run-XSre8ru-.js";function k(){return r.jsx(t,{children:r.jsx(o,{})})}export{k as default};
@@ -0,0 +1 @@
1
+ import{j as t}from"./@radix-B1sy0Lhr.js";import{C as o,S as r}from"./StackComponentList-D85oab98.js";import"./plus-DOrkJCmy.js";import"./refresh-C8BXS3Fb.js";import"./Pagination-C1sE5Nzn.js";import"./index-CO6UN3UX.js";import"./@tanstack-Dwlisomv.js";import"./@react-router-CHjLNlgw.js";import"./@reactflow-gbyyU3kq.js";import"./chevron-right-double-CbMG1dOM.js";import"./SearchField-Byv1PtST.js";import"./index-g7wOyc86.js";import"./DisplayDate-57lUNS79.js";import"./expand-full-C8p_0jQv.js";import"./SheetHeader-Bb3v9rha.js";import"./Tabs-2uwqXsdL.js";import"./terminal-C2tAF2XG.js";import"./chevron-down-Bl7WwQAL.js";import"./transform-S7omcvTm.js";import"./NestedCollapsible-0yviIfaA.js";import"./eye-BXcQevds.js";import"./CollapsibleCard-DSZzbjx5.js";import"./check-circle-CG6XAdk-.js";import"./CodeSnippet-B7Wd4R8u.js";import"./all-pipeline-runs-query-CdvWtiAY.js";import"./ExecutionStatus-CQbWovhV.js";import"./help-CRPfbPTO.js";import"./index-BYHxFvoG.js";import"./stack-detail-query-DnyMCdVE.js";import"./ComponentBadge-MVT08kBV.js";import"./ComponentIcon-C9AY8usJ.js";import"./bar-chart-square-check-_m-oYysN.js";import"./layout-GIiNvS10.js";import"./trash-D9LA4VFD.js";import"./DeleteAlertDialog-CzhTVQaC.js";import"./zod-D48zuELD.js";import"./index.esm-SBF9nn_P.js";import"./Infobox-DnduZjNU.js";import"./info-CI2szPUG.js";import"./bulk-delete-wdObjfps.js";function O(){return t.jsx("div",{className:"pt-5",children:t.jsx(o,{children:t.jsx(r,{})})})}export{O as default};
@@ -1,2 +1,2 @@
1
- import{r as v,j as o}from"./@radix-C_LirfyT.js";import{X as B,v as V,y as Z,F as G,E as J,aA as Q,aC as X,aD as Y,D as K,B as D,l as ee,b4 as te,r as re,O as ne,Q as oe,R as se,c as R,b5 as ae,U as ie,s as ce,x as le,d as ue,b6 as pe,aI as de,j as N}from"./index-BacoJBEQ.js";import{c as me}from"./@tanstack-C0SeHZng.js";import{S as fe}from"./clock-BMjHXT3f.js";import{C as I}from"./CodeSnippet-D8iBqOVv.js";import{I as he}from"./Infobox-DFCWPbMb.js";import{T as ye}from"./Tick-DDeDgTuT.js";import{E as ve}from"./react-error-boundary.esm-DoXxY4pT.js";import{L as Te}from"./@react-router-BSsrkPOd.js";import"./@reactflow-D9hglKLF.js";import"./info-CyMih3vQ.js";import"./check-D1bHMJkL.js";async function xe({params:t}){const n=B(t).toString(),s=Z(J.apiToken+(n?`?${n}`:"")),r=await V(s,{credentials:"include",headers:{"Content-Type":"application/json"}});if(!r.ok){const e=await r.json().then(a=>Array.isArray(a.detail)?a.detail[1]:a.detail).catch(()=>"Error while creating API Token");throw new G({status:r.status,statusText:r.statusText,message:e})}return r.json()}function ge(t){return me({mutationFn:async n=>xe(n),...t})}class x extends Error{}x.prototype.name="InvalidTokenError";function be(t){return decodeURIComponent(atob(t).replace(/(.)/g,(n,s)=>{let r=s.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}function Se(t){let n=t.replace(/-/g,"+").replace(/_/g,"/");switch(n.length%4){case 0:break;case 2:n+="==";break;case 3:n+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return be(n)}catch{return atob(n)}}function je(t,n){if(typeof t!="string")throw new x("Invalid token specified: must be a string");n||(n={});const s=n.header===!0?0:1,r=t.split(".")[s];if(typeof r!="string")throw new x(`Invalid token specified: missing part #${s+1}`);let e;try{e=Se(r)}catch(a){throw new x(`Invalid token specified: invalid base64 for part #${s+1} (${a.message})`)}try{return JSON.parse(e)}catch(a){throw new x(`Invalid token specified: invalid json for part #${s+1} (${a.message})`)}}var b={exports:{}},S,_;function we(){if(_)return S;_=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return S=t,S}var j,E;function Pe(){if(E)return j;E=1;var t=we();function n(){}function s(){}return s.resetWarningCache=n,j=function(){function r(i,c,u,m,h,p){if(p!==t){var f=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw f.name="Invariant Violation",f}}r.isRequired=r;function e(){return r}var a={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:e,element:r,elementType:r,instanceOf:e,node:r,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:s,resetWarningCache:n};return a.PropTypes=a,a},j}var A;function ke(){return A||(A=1,b.exports=Pe()()),b.exports}var l=ke();function M(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function De(t,n){for(var s=0;s<n.length;s++){var r=n[s];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function z(t,n,s){return n&&De(t.prototype,n),t}function $(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&w(t,n)}function g(t){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(s){return s.__proto__||Object.getPrototypeOf(s)},g(t)}function w(t,n){return w=Object.setPrototypeOf||function(r,e){return r.__proto__=e,r},w(t,n)}function Ce(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function Oe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ne(t,n){return n&&(typeof n=="object"||typeof n=="function")?n:Oe(t)}function U(t){var n=Ce();return function(){var r=g(t),e;if(n){var a=g(this).constructor;e=Reflect.construct(r,arguments,a)}else e=r.apply(this,arguments);return Ne(this,e)}}function Ie(t){return _e(t)||Ee(t)||Ae(t)||Re()}function _e(t){if(Array.isArray(t))return P(t)}function Ee(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function Ae(t,n){if(t){if(typeof t=="string")return P(t,n);var s=Object.prototype.toString.call(t).slice(8,-1);if(s==="Object"&&t.constructor&&(s=t.constructor.name),s==="Map"||s==="Set")return Array.from(t);if(s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return P(t,n)}}function P(t,n){(n==null||n>t.length)&&(n=t.length);for(var s=0,r=new Array(n);s<n;s++)r[s]=t[s];return r}function Re(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function T(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2,s=String(t);if(n===0)return s;var r=s.match(/(.*?)([0-9]+)(.*)/),e=r?r[1]:"",a=r?r[3]:"",i=r?r[2]:s,c=i.length>=n?i:(Ie(Array(n)).map(function(){return"0"}).join("")+i).slice(n*-1);return"".concat(e).concat(c).concat(a)}var F={daysInHours:!1,zeroPadTime:2};function Me(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=n.now,r=s===void 0?Date.now:s,e=n.precision,a=e===void 0?0:e,i=n.controlled,c=n.offsetTime,u=c===void 0?0:c,m=n.overtime,h;typeof t=="string"?h=new Date(t).getTime():t instanceof Date?h=t.getTime():h=t,i||(h+=u);var p=i?h:h-r(),f=Math.min(20,Math.max(0,a)),d=Math.round(parseFloat(((m?p:Math.max(0,p))/1e3).toFixed(f))*1e3),y=Math.abs(d)/1e3;return{total:d,days:Math.floor(y/(3600*24)),hours:Math.floor(y/3600%24),minutes:Math.floor(y/60%60),seconds:Math.floor(y%60),milliseconds:Number((y%1*1e3).toFixed()),completed:d<=0}}function ze(t,n){var s=t.days,r=t.hours,e=t.minutes,a=t.seconds,i=Object.assign(Object.assign({},F),n),c=i.daysInHours,u=i.zeroPadTime,m=i.zeroPadDays,h=m===void 0?u:m,p=Math.min(2,u),f=c?T(r+s*24,u):T(r,p);return{days:c?"":T(s,h),hours:f,minutes:T(e,p),seconds:T(a,p)}}var H=function(t){$(s,t);var n=U(s);function s(){var r;return M(this,s),r=n.apply(this,arguments),r.state={count:r.props.count||3},r.startCountdown=function(){r.interval=window.setInterval(function(){var e=r.state.count-1;e===0?(r.stopCountdown(),r.props.onComplete&&r.props.onComplete()):r.setState(function(a){return{count:a.count-1}})},1e3)},r.stopCountdown=function(){clearInterval(r.interval)},r.addTime=function(e){r.stopCountdown(),r.setState(function(a){return{count:a.count+e}},r.startCountdown)},r}return z(s,[{key:"componentDidMount",value:function(){this.startCountdown()}},{key:"componentWillUnmount",value:function(){clearInterval(this.interval)}},{key:"render",value:function(){return this.props.children?v.cloneElement(this.props.children,{count:this.state.count}):null}}]),s}(v.Component);H.propTypes={count:l.number,children:l.element,onComplete:l.func};var C=function(t){$(s,t);var n=U(s);function s(r){var e;if(M(this,s),e=n.call(this,r),e.mounted=!1,e.initialTimestamp=e.calcOffsetStartTimestamp(),e.offsetStartTimestamp=e.props.autoStart?0:e.initialTimestamp,e.offsetTime=0,e.legacyMode=!1,e.legacyCountdownRef=null,e.tick=function(){var i=e.calcTimeDelta(),c=i.completed&&!e.props.overtime?void 0:e.props.onTick;e.setTimeDeltaState(i,void 0,c)},e.setLegacyCountdownRef=function(i){e.legacyCountdownRef=i},e.start=function(){if(!e.isStarted()){var i=e.offsetStartTimestamp;e.offsetStartTimestamp=0,e.offsetTime+=i?e.calcOffsetStartTimestamp()-i:0;var c=e.calcTimeDelta();e.setTimeDeltaState(c,"STARTED",e.props.onStart),!e.props.controlled&&(!c.completed||e.props.overtime)&&(e.clearTimer(),e.interval=window.setInterval(e.tick,e.props.intervalDelay))}},e.pause=function(){e.isPaused()||(e.clearTimer(),e.offsetStartTimestamp=e.calcOffsetStartTimestamp(),e.setTimeDeltaState(e.state.timeDelta,"PAUSED",e.props.onPause))},e.stop=function(){e.isStopped()||(e.clearTimer(),e.offsetStartTimestamp=e.calcOffsetStartTimestamp(),e.offsetTime=e.offsetStartTimestamp-e.initialTimestamp,e.setTimeDeltaState(e.calcTimeDelta(),"STOPPED",e.props.onStop))},e.isStarted=function(){return e.isStatus("STARTED")},e.isPaused=function(){return e.isStatus("PAUSED")},e.isStopped=function(){return e.isStatus("STOPPED")},e.isCompleted=function(){return e.isStatus("COMPLETED")},r.date){var a=e.calcTimeDelta();e.state={timeDelta:a,status:a.completed?"COMPLETED":"STOPPED"}}else e.legacyMode=!0;return e}return z(s,[{key:"componentDidMount",value:function(){this.legacyMode||(this.mounted=!0,this.props.onMount&&this.props.onMount(this.calcTimeDelta()),this.props.autoStart&&this.start())}},{key:"componentDidUpdate",value:function(e){this.legacyMode||this.props.date!==e.date&&(this.initialTimestamp=this.calcOffsetStartTimestamp(),this.offsetStartTimestamp=this.initialTimestamp,this.offsetTime=0,this.setTimeDeltaState(this.calcTimeDelta()))}},{key:"componentWillUnmount",value:function(){this.legacyMode||(this.mounted=!1,this.clearTimer())}},{key:"calcTimeDelta",value:function(){var e=this.props,a=e.date,i=e.now,c=e.precision,u=e.controlled,m=e.overtime;return Me(a,{now:i,precision:c,controlled:u,offsetTime:this.offsetTime,overtime:m})}},{key:"calcOffsetStartTimestamp",value:function(){return Date.now()}},{key:"addTime",value:function(e){this.legacyCountdownRef.addTime(e)}},{key:"clearTimer",value:function(){window.clearInterval(this.interval)}},{key:"isStatus",value:function(e){return this.state.status===e}},{key:"setTimeDeltaState",value:function(e,a,i){var c=this;if(this.mounted){var u=e.completed&&!this.state.timeDelta.completed,m=e.completed&&a==="STARTED";u&&!this.props.overtime&&this.clearTimer();var h=function(){i&&i(c.state.timeDelta),c.props.onComplete&&(u||m)&&c.props.onComplete(e,m)};return this.setState(function(p){var f=a||p.status;return e.completed&&!c.props.overtime?f="COMPLETED":!a&&f==="COMPLETED"&&(f="STOPPED"),{timeDelta:e,status:f}},h)}}},{key:"getApi",value:function(){return this.api=this.api||{start:this.start,pause:this.pause,stop:this.stop,isStarted:this.isStarted,isPaused:this.isPaused,isStopped:this.isStopped,isCompleted:this.isCompleted}}},{key:"getRenderProps",value:function(){var e=this.props,a=e.daysInHours,i=e.zeroPadTime,c=e.zeroPadDays,u=this.state.timeDelta;return Object.assign(Object.assign({},u),{api:this.getApi(),props:this.props,formatted:ze(u,{daysInHours:a,zeroPadTime:i,zeroPadDays:c})})}},{key:"render",value:function(){if(this.legacyMode){var e=this.props,a=e.count,i=e.children,c=e.onComplete;return v.createElement(H,{ref:this.setLegacyCountdownRef,count:a,onComplete:c},i)}var u=this.props,m=u.className,h=u.overtime,p=u.children,f=u.renderer,d=this.getRenderProps();if(f)return f(d);if(p&&this.state.timeDelta.completed&&!h)return v.cloneElement(p,{countdown:d});var y=d.formatted,O=y.days,L=y.hours,W=y.minutes,q=y.seconds;return v.createElement("span",{className:m},d.total<0?"-":"",O,O?":":"",L,":",W,":",q)}}]),s}(v.Component);C.defaultProps=Object.assign(Object.assign({},F),{controlled:!1,intervalDelay:1e3,precision:0,autoStart:!0});C.propTypes={date:l.oneOfType([l.instanceOf(Date),l.string,l.number]),daysInHours:l.bool,zeroPadTime:l.number,zeroPadDays:l.number,controlled:l.bool,intervalDelay:l.number,precision:l.number,autoStart:l.bool,overtime:l.bool,className:l.string,children:l.element,renderer:l.func,now:l.func,onMount:l.func,onStart:l.func,onPause:l.func,onStop:l.func,onTick:l.func,onComplete:l.func};function $e({token:t,open:n,setOpen:s}){return o.jsx(Q,{open:n,onOpenChange:s,children:o.jsxs(X,{className:"max-w-[700px]",children:[o.jsx(Y,{children:o.jsx(K,{children:"API Token Created Successfully"})}),o.jsxs("div",{className:"space-y-3 overflow-hidden px-7 py-5",children:[o.jsx(Ue,{}),o.jsx(Fe,{}),o.jsx(He,{token:t}),o.jsx(ve,{fallbackRender:()=>null,children:o.jsx(We,{token:t})}),o.jsx("div",{role:"separator","aria-hidden":"true",className:"h-[1px] bg-theme-border-moderate"}),o.jsx(qe,{token:t}),o.jsx(Be,{}),o.jsx("div",{role:"separator","aria-hidden":"true",className:"h-[1px] bg-theme-border-moderate"}),o.jsx(Ve,{})]})]})})}function Ue(){return o.jsxs("section",{children:[o.jsx("p",{className:"font-semibold",children:"Here is your new API Token"}),o.jsx("p",{className:"text-theme-text-secondary",children:"This token provides temporary access to your ZenML Server"})]})}function Fe(){return o.jsx(he,{children:"Important: This token expires in 1 hour and cannot be retrieved later. Please, copy it now."})}function He({token:t}){const[n,s]=v.useState(!1);function r(e){navigator.clipboard&&(navigator.clipboard.writeText(e),s(!0),setTimeout(()=>{s(!1)},2e3))}return o.jsxs("section",{className:"flex items-center gap-5 py-5",children:[o.jsx("code",{className:"block overflow-x-auto whitespace-nowrap font-sans text-display-xs",children:t}),n?o.jsxs("div",{className:"flex h-7 items-center",children:[o.jsx(ye,{className:"h-5 w-5 shrink-0 fill-theme-text-tertiary"}),o.jsx("p",{className:"sr-only",children:"copied successfully"})]}):o.jsxs(D,{onClick:()=>r(t),size:"md",intent:"secondary",className:"flex items-center gap-1",emphasis:"subtle",children:[o.jsx(ee,{className:"size-4 shrink-0 fill-inherit"}),"Copy"]})]})}const Le=({days:t,hours:n,minutes:s,seconds:r,completed:e})=>{if(e)return o.jsx("span",{className:"font-semibold text-theme-text-error",children:"Expired"});const a=c=>String(c).padStart(2,"0"),i=[];return t>0&&i.push(`${t}`),(t>0||n>0)&&i.push(`${a(n)}`),(t>0||n>0||s>0)&&i.push(`${a(s)}`),i.push(`${a(r)}`),o.jsx("span",{className:"font-semibold",children:i.join(":")})};function We({token:t}){if(!t)return null;const n=je(t);return n.exp?o.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-3 rounded-sm border border-theme-border-moderate bg-theme-surface-tertiary py-1 text-center",children:[o.jsx(fe,{className:"size-5 shrink-0 fill-theme-text-secondary"}),o.jsxs("div",{children:["Expires in:"," ",o.jsx(C,{daysInHours:!0,renderer:Le,zeroPadTime:2,date:new Date(n.exp*1e3)})]})]}):null}function qe({token:t}){const n=`${window.location.origin}/api/v1/current-user`;return o.jsxs("section",{className:"space-y-1",children:[o.jsx("div",{className:"font-semibold",children:"Using your API Token"}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("p",{className:"text-theme-text-secondary",children:"To use the API token to run queries against the Server API, you can run the following commands:"}),o.jsx(I,{code:Ze(t,n)}),o.jsx(I,{code:Ge(t,n)})]})]})}function Be(){const t=`${window.location.origin}/docs`;return o.jsxs("section",{className:"space-y-2",children:[o.jsx("p",{className:"font-semibold",children:"API Documentation"}),o.jsx("p",{className:"text-theme-text-secondary",children:"Access our OpenAPI dashboard for comprehensive documentation on all available REST API endpoints:"}),o.jsx(D,{asChild:!0,size:"md",intent:"secondary",className:"flex w-fit items-center gap-1",emphasis:"subtle",children:o.jsxs("a",{target:"_blank",rel:"noopener noreferrer",href:t,children:[o.jsx("span",{children:"Open the documentation"}),o.jsx(te,{className:"size-5 shrink-0 fill-inherit"})]})})]})}function Ve(){return o.jsxs("p",{children:["For long-term programmatic access, consider"," ",o.jsx(Te,{className:"link text-theme-text-brand",to:re.settings.service_accounts.overview,children:"setting up a service account instead."})]})}function Ze(t,n){return`curl -H "Authorization: Bearer ${t}" "${encodeURI(n)}"`}function Ge(t,n){return`wget -qO- --header="Authorization: Bearer ${t}" "${encodeURI(n)}"`}function Je({size:t}){return o.jsx("div",{className:"flex flex-wrap items-center justify-end gap-2",children:o.jsx(ne,{children:o.jsxs(oe,{children:[o.jsx(se,{className:"z-10",children:o.jsx("div",{className:R(ae({size:t}),"pointer-events-none bg-primary-50"),children:"Create new token"})}),o.jsx(ie,{children:"API-Tokens are not available for local deployments"})]})})})}const k=v.forwardRef(({className:t,onClick:n,...s},r)=>{const{toast:e}=ce(),[a,i]=v.useState(""),[c,u]=v.useState(!1),m=le(),{mutate:h,isPending:p}=ge({onError:d=>{de(d)&&e({title:"Error",emphasis:"subtle",rounded:!0,status:"error",description:d.message}),console.log(d)},onSuccess:d=>{i(d),u(!0)}});function f(d){u(d),d||i("")}return m.isPending?o.jsx(ue,{className:"h-7 w-10"}):m.isError?null:pe(m.data.auth_scheme||"other")?o.jsx(Je,{size:s.size}):o.jsxs(o.Fragment,{children:[o.jsxs(D,{disabled:p,ref:r,...s,onClick:()=>h({params:{token_type:"generic"}}),className:R(t),children:[p&&o.jsx("div",{role:"alert","aria-busy":"true",className:"full h-[20px] w-[20px] animate-spin rounded-rounded border-2 border-theme-text-negative border-b-theme-text-brand"}),"Create new token"]}),o.jsx($e,{open:c,setOpen:f,token:a})]})});k.displayName="CreateTokenButton";function ct(){return o.jsxs(N,{className:"flex flex-col gap-5 p-5",children:[o.jsx("h1",{className:"text-text-xl font-semibold",children:"API Tokens"}),o.jsx("div",{className:"flex items-center justify-end",children:o.jsx(k,{size:"sm"})}),o.jsxs(N,{className:"flex w-full flex-col items-center justify-center space-y-5 p-9 text-center",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("h2",{className:"text-display-xs font-semibold",children:"Create a new API Token"}),o.jsx("p",{className:"text-text-xl text-theme-text-secondary",children:"Generate a temporary access key for quick, secure automation tasks in your Tenant. An API Token is temporary (max. 1 hour) and won't be stored anywhere."})]}),o.jsx(k,{size:"md"})]})]})}export{ct as default};
1
+ import{r as v,j as o}from"./@radix-B1sy0Lhr.js";import{Z as B,x as V,F as Z,G,H as J,aH as K,aJ as Y,aK as Q,D as X,B as D,m as ee,b8 as te,r as re,R as ne,U as oe,V as se,c as R,b9 as ae,W as ie,v as ce,E as le,d as ue,ba as pe,aP as de,k as N}from"./index-CO6UN3UX.js";import{c as me}from"./@tanstack-Dwlisomv.js";import{S as fe}from"./clock-BnPvxp3D.js";import{C as I}from"./CodeSnippet-B7Wd4R8u.js";import{I as he}from"./Infobox-DnduZjNU.js";import{T as ye}from"./Tick-BQ7_xDBl.js";import{E as ve}from"./react-error-boundary.esm-DgOYA0wh.js";import{L as Te}from"./@react-router-CHjLNlgw.js";import"./@reactflow-gbyyU3kq.js";import"./info-CI2szPUG.js";import"./check-C9Nye5lR.js";async function xe({params:t}){const n=B(t).toString(),s=Z(J.apiToken+(n?`?${n}`:"")),r=await V(s,{credentials:"include",headers:{"Content-Type":"application/json"}});if(!r.ok){const e=await r.json().then(a=>Array.isArray(a.detail)?a.detail[1]:a.detail).catch(()=>"Error while creating API Token");throw new G({status:r.status,statusText:r.statusText,message:e})}return r.json()}function ge(t){return me({mutationFn:async n=>xe(n),...t})}class x extends Error{}x.prototype.name="InvalidTokenError";function be(t){return decodeURIComponent(atob(t).replace(/(.)/g,(n,s)=>{let r=s.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}function Se(t){let n=t.replace(/-/g,"+").replace(/_/g,"/");switch(n.length%4){case 0:break;case 2:n+="==";break;case 3:n+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return be(n)}catch{return atob(n)}}function je(t,n){if(typeof t!="string")throw new x("Invalid token specified: must be a string");n||(n={});const s=n.header===!0?0:1,r=t.split(".")[s];if(typeof r!="string")throw new x(`Invalid token specified: missing part #${s+1}`);let e;try{e=Se(r)}catch(a){throw new x(`Invalid token specified: invalid base64 for part #${s+1} (${a.message})`)}try{return JSON.parse(e)}catch(a){throw new x(`Invalid token specified: invalid json for part #${s+1} (${a.message})`)}}var b={exports:{}},S,_;function we(){if(_)return S;_=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return S=t,S}var j,E;function Pe(){if(E)return j;E=1;var t=we();function n(){}function s(){}return s.resetWarningCache=n,j=function(){function r(i,c,u,m,h,p){if(p!==t){var f=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw f.name="Invariant Violation",f}}r.isRequired=r;function e(){return r}var a={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:e,element:r,elementType:r,instanceOf:e,node:r,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:s,resetWarningCache:n};return a.PropTypes=a,a},j}var A;function ke(){return A||(A=1,b.exports=Pe()()),b.exports}var l=ke();function M(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function De(t,n){for(var s=0;s<n.length;s++){var r=n[s];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function z(t,n,s){return n&&De(t.prototype,n),t}function $(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&w(t,n)}function g(t){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(s){return s.__proto__||Object.getPrototypeOf(s)},g(t)}function w(t,n){return w=Object.setPrototypeOf||function(r,e){return r.__proto__=e,r},w(t,n)}function Ce(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function Oe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ne(t,n){return n&&(typeof n=="object"||typeof n=="function")?n:Oe(t)}function U(t){var n=Ce();return function(){var r=g(t),e;if(n){var a=g(this).constructor;e=Reflect.construct(r,arguments,a)}else e=r.apply(this,arguments);return Ne(this,e)}}function Ie(t){return _e(t)||Ee(t)||Ae(t)||Re()}function _e(t){if(Array.isArray(t))return P(t)}function Ee(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function Ae(t,n){if(t){if(typeof t=="string")return P(t,n);var s=Object.prototype.toString.call(t).slice(8,-1);if(s==="Object"&&t.constructor&&(s=t.constructor.name),s==="Map"||s==="Set")return Array.from(t);if(s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return P(t,n)}}function P(t,n){(n==null||n>t.length)&&(n=t.length);for(var s=0,r=new Array(n);s<n;s++)r[s]=t[s];return r}function Re(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function T(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2,s=String(t);if(n===0)return s;var r=s.match(/(.*?)([0-9]+)(.*)/),e=r?r[1]:"",a=r?r[3]:"",i=r?r[2]:s,c=i.length>=n?i:(Ie(Array(n)).map(function(){return"0"}).join("")+i).slice(n*-1);return"".concat(e).concat(c).concat(a)}var H={daysInHours:!1,zeroPadTime:2};function Me(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=n.now,r=s===void 0?Date.now:s,e=n.precision,a=e===void 0?0:e,i=n.controlled,c=n.offsetTime,u=c===void 0?0:c,m=n.overtime,h;typeof t=="string"?h=new Date(t).getTime():t instanceof Date?h=t.getTime():h=t,i||(h+=u);var p=i?h:h-r(),f=Math.min(20,Math.max(0,a)),d=Math.round(parseFloat(((m?p:Math.max(0,p))/1e3).toFixed(f))*1e3),y=Math.abs(d)/1e3;return{total:d,days:Math.floor(y/(3600*24)),hours:Math.floor(y/3600%24),minutes:Math.floor(y/60%60),seconds:Math.floor(y%60),milliseconds:Number((y%1*1e3).toFixed()),completed:d<=0}}function ze(t,n){var s=t.days,r=t.hours,e=t.minutes,a=t.seconds,i=Object.assign(Object.assign({},H),n),c=i.daysInHours,u=i.zeroPadTime,m=i.zeroPadDays,h=m===void 0?u:m,p=Math.min(2,u),f=c?T(r+s*24,u):T(r,p);return{days:c?"":T(s,h),hours:f,minutes:T(e,p),seconds:T(a,p)}}var F=function(t){$(s,t);var n=U(s);function s(){var r;return M(this,s),r=n.apply(this,arguments),r.state={count:r.props.count||3},r.startCountdown=function(){r.interval=window.setInterval(function(){var e=r.state.count-1;e===0?(r.stopCountdown(),r.props.onComplete&&r.props.onComplete()):r.setState(function(a){return{count:a.count-1}})},1e3)},r.stopCountdown=function(){clearInterval(r.interval)},r.addTime=function(e){r.stopCountdown(),r.setState(function(a){return{count:a.count+e}},r.startCountdown)},r}return z(s,[{key:"componentDidMount",value:function(){this.startCountdown()}},{key:"componentWillUnmount",value:function(){clearInterval(this.interval)}},{key:"render",value:function(){return this.props.children?v.cloneElement(this.props.children,{count:this.state.count}):null}}]),s}(v.Component);F.propTypes={count:l.number,children:l.element,onComplete:l.func};var C=function(t){$(s,t);var n=U(s);function s(r){var e;if(M(this,s),e=n.call(this,r),e.mounted=!1,e.initialTimestamp=e.calcOffsetStartTimestamp(),e.offsetStartTimestamp=e.props.autoStart?0:e.initialTimestamp,e.offsetTime=0,e.legacyMode=!1,e.legacyCountdownRef=null,e.tick=function(){var i=e.calcTimeDelta(),c=i.completed&&!e.props.overtime?void 0:e.props.onTick;e.setTimeDeltaState(i,void 0,c)},e.setLegacyCountdownRef=function(i){e.legacyCountdownRef=i},e.start=function(){if(!e.isStarted()){var i=e.offsetStartTimestamp;e.offsetStartTimestamp=0,e.offsetTime+=i?e.calcOffsetStartTimestamp()-i:0;var c=e.calcTimeDelta();e.setTimeDeltaState(c,"STARTED",e.props.onStart),!e.props.controlled&&(!c.completed||e.props.overtime)&&(e.clearTimer(),e.interval=window.setInterval(e.tick,e.props.intervalDelay))}},e.pause=function(){e.isPaused()||(e.clearTimer(),e.offsetStartTimestamp=e.calcOffsetStartTimestamp(),e.setTimeDeltaState(e.state.timeDelta,"PAUSED",e.props.onPause))},e.stop=function(){e.isStopped()||(e.clearTimer(),e.offsetStartTimestamp=e.calcOffsetStartTimestamp(),e.offsetTime=e.offsetStartTimestamp-e.initialTimestamp,e.setTimeDeltaState(e.calcTimeDelta(),"STOPPED",e.props.onStop))},e.isStarted=function(){return e.isStatus("STARTED")},e.isPaused=function(){return e.isStatus("PAUSED")},e.isStopped=function(){return e.isStatus("STOPPED")},e.isCompleted=function(){return e.isStatus("COMPLETED")},r.date){var a=e.calcTimeDelta();e.state={timeDelta:a,status:a.completed?"COMPLETED":"STOPPED"}}else e.legacyMode=!0;return e}return z(s,[{key:"componentDidMount",value:function(){this.legacyMode||(this.mounted=!0,this.props.onMount&&this.props.onMount(this.calcTimeDelta()),this.props.autoStart&&this.start())}},{key:"componentDidUpdate",value:function(e){this.legacyMode||this.props.date!==e.date&&(this.initialTimestamp=this.calcOffsetStartTimestamp(),this.offsetStartTimestamp=this.initialTimestamp,this.offsetTime=0,this.setTimeDeltaState(this.calcTimeDelta()))}},{key:"componentWillUnmount",value:function(){this.legacyMode||(this.mounted=!1,this.clearTimer())}},{key:"calcTimeDelta",value:function(){var e=this.props,a=e.date,i=e.now,c=e.precision,u=e.controlled,m=e.overtime;return Me(a,{now:i,precision:c,controlled:u,offsetTime:this.offsetTime,overtime:m})}},{key:"calcOffsetStartTimestamp",value:function(){return Date.now()}},{key:"addTime",value:function(e){this.legacyCountdownRef.addTime(e)}},{key:"clearTimer",value:function(){window.clearInterval(this.interval)}},{key:"isStatus",value:function(e){return this.state.status===e}},{key:"setTimeDeltaState",value:function(e,a,i){var c=this;if(this.mounted){var u=e.completed&&!this.state.timeDelta.completed,m=e.completed&&a==="STARTED";u&&!this.props.overtime&&this.clearTimer();var h=function(){i&&i(c.state.timeDelta),c.props.onComplete&&(u||m)&&c.props.onComplete(e,m)};return this.setState(function(p){var f=a||p.status;return e.completed&&!c.props.overtime?f="COMPLETED":!a&&f==="COMPLETED"&&(f="STOPPED"),{timeDelta:e,status:f}},h)}}},{key:"getApi",value:function(){return this.api=this.api||{start:this.start,pause:this.pause,stop:this.stop,isStarted:this.isStarted,isPaused:this.isPaused,isStopped:this.isStopped,isCompleted:this.isCompleted}}},{key:"getRenderProps",value:function(){var e=this.props,a=e.daysInHours,i=e.zeroPadTime,c=e.zeroPadDays,u=this.state.timeDelta;return Object.assign(Object.assign({},u),{api:this.getApi(),props:this.props,formatted:ze(u,{daysInHours:a,zeroPadTime:i,zeroPadDays:c})})}},{key:"render",value:function(){if(this.legacyMode){var e=this.props,a=e.count,i=e.children,c=e.onComplete;return v.createElement(F,{ref:this.setLegacyCountdownRef,count:a,onComplete:c},i)}var u=this.props,m=u.className,h=u.overtime,p=u.children,f=u.renderer,d=this.getRenderProps();if(f)return f(d);if(p&&this.state.timeDelta.completed&&!h)return v.cloneElement(p,{countdown:d});var y=d.formatted,O=y.days,L=y.hours,W=y.minutes,q=y.seconds;return v.createElement("span",{className:m},d.total<0?"-":"",O,O?":":"",L,":",W,":",q)}}]),s}(v.Component);C.defaultProps=Object.assign(Object.assign({},H),{controlled:!1,intervalDelay:1e3,precision:0,autoStart:!0});C.propTypes={date:l.oneOfType([l.instanceOf(Date),l.string,l.number]),daysInHours:l.bool,zeroPadTime:l.number,zeroPadDays:l.number,controlled:l.bool,intervalDelay:l.number,precision:l.number,autoStart:l.bool,overtime:l.bool,className:l.string,children:l.element,renderer:l.func,now:l.func,onMount:l.func,onStart:l.func,onPause:l.func,onStop:l.func,onTick:l.func,onComplete:l.func};function $e({token:t,open:n,setOpen:s}){return o.jsx(K,{open:n,onOpenChange:s,children:o.jsxs(Y,{className:"max-w-[700px]",children:[o.jsx(Q,{children:o.jsx(X,{children:"API Token Created Successfully"})}),o.jsxs("div",{className:"space-y-3 overflow-hidden px-7 py-5",children:[o.jsx(Ue,{}),o.jsx(He,{}),o.jsx(Fe,{token:t}),o.jsx(ve,{fallbackRender:()=>null,children:o.jsx(We,{token:t})}),o.jsx("div",{role:"separator","aria-hidden":"true",className:"h-[1px] bg-theme-border-moderate"}),o.jsx(qe,{token:t}),o.jsx(Be,{}),o.jsx("div",{role:"separator","aria-hidden":"true",className:"h-[1px] bg-theme-border-moderate"}),o.jsx(Ve,{})]})]})})}function Ue(){return o.jsxs("section",{children:[o.jsx("p",{className:"font-semibold",children:"Here is your new API Token"}),o.jsx("p",{className:"text-theme-text-secondary",children:"This token provides temporary access to your ZenML Server"})]})}function He(){return o.jsx(he,{children:"Important: This token expires in 1 hour and cannot be retrieved later. Please, copy it now."})}function Fe({token:t}){const[n,s]=v.useState(!1);function r(e){navigator.clipboard&&(navigator.clipboard.writeText(e),s(!0),setTimeout(()=>{s(!1)},2e3))}return o.jsxs("section",{className:"flex items-center gap-5 py-5",children:[o.jsx("code",{className:"block overflow-x-auto whitespace-nowrap font-sans text-display-xs",children:t}),n?o.jsxs("div",{className:"flex h-7 items-center",children:[o.jsx(ye,{className:"h-5 w-5 shrink-0 fill-theme-text-tertiary"}),o.jsx("p",{className:"sr-only",children:"copied successfully"})]}):o.jsxs(D,{onClick:()=>r(t),size:"md",intent:"secondary",className:"flex items-center gap-1",emphasis:"subtle",children:[o.jsx(ee,{className:"size-4 shrink-0 fill-inherit"}),"Copy"]})]})}const Le=({days:t,hours:n,minutes:s,seconds:r,completed:e})=>{if(e)return o.jsx("span",{className:"font-semibold text-theme-text-error",children:"Expired"});const a=c=>String(c).padStart(2,"0"),i=[];return t>0&&i.push(`${t}`),(t>0||n>0)&&i.push(`${a(n)}`),(t>0||n>0||s>0)&&i.push(`${a(s)}`),i.push(`${a(r)}`),o.jsx("span",{className:"font-semibold",children:i.join(":")})};function We({token:t}){if(!t)return null;const n=je(t);return n.exp?o.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-3 rounded-sm border border-theme-border-moderate bg-theme-surface-tertiary py-1 text-center",children:[o.jsx(fe,{className:"size-5 shrink-0 fill-theme-text-secondary"}),o.jsxs("div",{children:["Expires in:"," ",o.jsx(C,{daysInHours:!0,renderer:Le,zeroPadTime:2,date:new Date(n.exp*1e3)})]})]}):null}function qe({token:t}){const n=`${window.location.origin}/api/v1/current-user`;return o.jsxs("section",{className:"space-y-1",children:[o.jsx("div",{className:"font-semibold",children:"Using your API Token"}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("p",{className:"text-theme-text-secondary",children:"To use the API token to run queries against the Server API, you can run the following commands:"}),o.jsx(I,{code:Ze(t,n)}),o.jsx(I,{code:Ge(t,n)})]})]})}function Be(){const t=`${window.location.origin}/docs`;return o.jsxs("section",{className:"space-y-2",children:[o.jsx("p",{className:"font-semibold",children:"API Documentation"}),o.jsx("p",{className:"text-theme-text-secondary",children:"Access our OpenAPI dashboard for comprehensive documentation on all available REST API endpoints:"}),o.jsx(D,{asChild:!0,size:"md",intent:"secondary",className:"flex w-fit items-center gap-1",emphasis:"subtle",children:o.jsxs("a",{target:"_blank",rel:"noopener noreferrer",href:t,children:[o.jsx("span",{children:"Open the documentation"}),o.jsx(te,{className:"size-5 shrink-0 fill-inherit"})]})})]})}function Ve(){return o.jsxs("p",{children:["For long-term programmatic access, consider"," ",o.jsx(Te,{className:"link text-theme-text-brand",to:re.settings.service_accounts.overview,children:"setting up a service account instead."})]})}function Ze(t,n){return`curl -H "Authorization: Bearer ${t}" "${encodeURI(n)}"`}function Ge(t,n){return`wget -qO- --header="Authorization: Bearer ${t}" "${encodeURI(n)}"`}function Je({size:t}){return o.jsx("div",{className:"flex flex-wrap items-center justify-end gap-2",children:o.jsx(ne,{children:o.jsxs(oe,{children:[o.jsx(se,{className:"z-10",children:o.jsx("div",{className:R(ae({size:t}),"pointer-events-none bg-primary-50"),children:"Create new token"})}),o.jsx(ie,{children:"API-Tokens are not available for local deployments"})]})})})}const k=v.forwardRef(({className:t,onClick:n,...s},r)=>{const{toast:e}=ce(),[a,i]=v.useState(""),[c,u]=v.useState(!1),m=le(),{mutate:h,isPending:p}=ge({onError:d=>{de(d)&&e({title:"Error",emphasis:"subtle",rounded:!0,status:"error",description:d.message}),console.log(d)},onSuccess:d=>{i(d),u(!0)}});function f(d){u(d),d||i("")}return m.isPending?o.jsx(ue,{className:"h-7 w-10"}):m.isError?null:pe(m.data.auth_scheme||"other")?o.jsx(Je,{size:s.size}):o.jsxs(o.Fragment,{children:[o.jsxs(D,{disabled:p,ref:r,...s,onClick:()=>h({params:{token_type:"generic"}}),className:R(t),children:[p&&o.jsx("div",{role:"alert","aria-busy":"true",className:"full h-[20px] w-[20px] animate-spin rounded-rounded border-2 border-theme-text-negative border-b-theme-text-brand"}),"Create new token"]}),o.jsx($e,{open:c,setOpen:f,token:a})]})});k.displayName="CreateTokenButton";function ct(){return o.jsxs(N,{className:"flex flex-col gap-5 p-5",children:[o.jsx("h1",{className:"text-text-xl font-semibold",children:"API Tokens"}),o.jsx("div",{className:"flex items-center justify-end",children:o.jsx(k,{size:"sm"})}),o.jsxs(N,{className:"flex w-full flex-col items-center justify-center space-y-5 p-9 text-center",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx("h2",{className:"text-display-xs font-semibold",children:"Create a new API Token"}),o.jsx("p",{className:"text-text-xl text-theme-text-secondary",children:"Generate a temporary access key for quick, secure automation tasks in your Tenant. An API Token is temporary (max. 1 hour) and won't be stored anywhere."})]}),o.jsx(k,{size:"md"})]})]})}export{ct as default};
@@ -0,0 +1 @@
1
+ import{j as e,r as j}from"./@radix-B1sy0Lhr.js";import{B as i,r as u,x as D,F as S,G as b,H as T,aZ as x,J as g,K as k,z as c,L as R,M as A,N as P,O as B,aw as _,Q as h,X as p,a2 as E,d as f,Y as L,k as F}from"./index-CO6UN3UX.js";import{S as M}from"./SearchField-Byv1PtST.js";import{c as I,b as y}from"./@tanstack-Dwlisomv.js";import{S as z}from"./refresh-C8BXS3Fb.js";import{S as H}from"./plus-DOrkJCmy.js";import{L as m,f as O}from"./@react-router-CHjLNlgw.js";import{c as Q,u as $}from"./bulk-delete-wdObjfps.js";import{S as C}from"./trash-D9LA4VFD.js";import{D as G,a as K}from"./DeleteAlertDialog-CzhTVQaC.js";import{P as U}from"./Pagination-C1sE5Nzn.js";import{C as q,R as J}from"./resource-type-tooltip-V-zdiLKz.js";import{e as X,R as Y,E as Z}from"./service-connectors-nF4-OXB9.js";import"./@reactflow-gbyyU3kq.js";import"./index-g7wOyc86.js";import"./zod-D48zuELD.js";import"./index.esm-SBF9nn_P.js";import"./chevron-right-double-CbMG1dOM.js";function V(){return e.jsxs("div",{className:"space-y-2",children:[e.jsx("h1",{className:"text-text-xl font-semibold",children:"Service Connectors"}),e.jsxs("p",{className:"text-text-sm text-theme-text-secondary",children:["Configure and manage your service connectors."," ",e.jsx("a",{target:"_blank",rel:"noreferrer noopener",href:"https://docs.zenml.io/how-to/infrastructure-deployment/auth-management",className:"link text-text-sm text-primary-400",children:"Learn More"})]})]})}function W(){return e.jsx(i,{size:"md",asChild:!0,children:e.jsxs(m,{to:u.settings.connectors.create,children:[e.jsx(H,{className:"h-5 w-5 shrink-0 fill-white"}),e.jsx("span",{children:"New Connector"})]})})}async function ee({connectorId:t}){const s=S(T.serviceConnectors.detail(t)),r=await D(s,{method:"DELETE"});if(!r.ok){const n=await r.json().then(o=>Array.isArray(o.detail)?o.detail[1]:o.detail).catch(()=>`Error while deleting connector ${t}`);throw new b({status:r.status,statusText:r.statusText,message:n})}return r.json()}function te(t){return I({...t,mutationFn:async({connectorId:s})=>ee({connectorId:s})})}const{ContextProvider:se,useContext:l}=Q();function v(){const{setRowSelection:t}=l(),{mutateAsync:s}=te();async function r(n){await s({connectorId:n})}return $({deleteFn:r,queryKeyToInvalidate:[...x.connectors],setRowSelection:t})}function w({deleteHandler:t}){return e.jsx(G,{title:"Delete Connectors",handleDelete:t,children:e.jsxs(K,{children:[e.jsx("p",{children:"Are you sure?"}),e.jsx("p",{children:"This action cannot be undone."})]})})}function re({deleteHandler:t,open:s,setOpen:r}){return e.jsx(g,{open:s,onOpenChange:r,children:e.jsx(w,{deleteHandler:t})})}function ne(){const{selectedRowCount:t,selectedRowIDs:s}=l(),{bulkDelete:r}=v();async function n(){await r(s)}const o=t>1?"s":"",a=`${t} Service connector${o} selected`;return e.jsxs("div",{className:"flex h-7 items-center divide-x divide-theme-border-moderate overflow-hidden rounded-md border border-theme-border-moderate",children:[e.jsx("div",{className:"bg-primary-25 px-2 py-1 font-semibold text-theme-text-brand",children:a}),e.jsxs(g,{children:[e.jsx(k,{asChild:!0,children:e.jsxs(i,{className:"rounded-sharp border-y-0 bg-white",size:"md",emphasis:"subtle",intent:"secondary",children:[e.jsx(C,{className:"h-5 w-5 shrink-0 gap-1 fill-neutral-400"}),"Delete"]})}),e.jsx(w,{deleteHandler:n})]})]})}function oe({queryParams:t}){const{selectedRowCount:s}=l();return e.jsx(e.Fragment,{children:e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[s>0?e.jsx(ne,{}):e.jsx(M,{searchParams:t}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ae,{queryParams:t}),e.jsx(W,{})]})]})})}function ae({queryParams:t}){const{refetch:s}=y(x.serviceConnectorList(t));return e.jsxs(i,{intent:"primary",emphasis:"subtle",size:"md",onClick:()=>s(),children:[e.jsx(z,{className:"h-5 w-5 fill-theme-text-brand"}),"Refresh"]})}const d=1,ce=c.object({page:c.coerce.number().min(d).optional().default(d).catch(d),name:c.string().optional(),operator:c.enum(["and","or"]).optional()});function ie(){const[t]=O(),{page:s,name:r,operator:n}=ce.parse({page:t.get("page")||void 0,name:t.get("name")||void 0,sortBy:t.get("sort_by")||void 0});return{page:s,name:r,logical_operator:n}}function le({id:t}){const[s,r]=j.useState(!1),{bulkDelete:n}=v();async function o(){await n([t]),r(!1)}return e.jsxs(e.Fragment,{children:[e.jsx(re,{deleteHandler:o,open:s,setOpen:r}),e.jsxs(R,{children:[e.jsx(A,{asChild:!0,children:e.jsx(i,{intent:"secondary",emphasis:"minimal",className:"flex aspect-square items-center justify-center p-0",children:e.jsx(P,{className:"h-4 w-4 shrink-0 fill-theme-text-tertiary"})})}),e.jsx(B,{align:"end",sideOffset:7,children:e.jsxs(_,{onSelect:()=>r(!0),className:"cursor-pointer space-x-2",children:[e.jsx(C,{className:"h-3 w-3 fill-neutral-400"}),e.jsx("p",{children:"Delete"})]})})]})]})}function de(){return j.useMemo(()=>[{id:"select",meta:{width:"1%"},header:({table:t})=>e.jsx(h,{id:"check-all",checked:t.getIsAllRowsSelected(),onCheckedChange:s=>t.toggleAllRowsSelected(s==="indeterminate"?!0:s)}),cell:({row:t})=>e.jsx(h,{id:`check-${t.id}`,checked:t.getIsSelected(),onCheckedChange:t.getToggleSelectedHandler()})},{id:"name",header:"Service Connector",accessorKey:"name",cell:({row:t})=>{var o;const s=t.original.id,r=t.original.name,n=(o=t.original.body)==null?void 0:o.connector_type;return e.jsxs("div",{className:"group/copybutton flex items-center gap-2",children:[!!n&&typeof n!="string"&&e.jsx(q,{connectorType:n}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(m,{to:u.settings.connectors.detail.configuration(s),className:"block max-w-[200px] truncate text-text-md font-semibold",children:r}),e.jsx(p,{copyText:r})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(m,{to:u.settings.connectors.detail.configuration(s),children:s.split("-")[0]}),e.jsx(p,{copyText:s})]})]})]})}},{id:"resource_types",header(){return e.jsx("p",{className:"whitespace-nowrap",children:"Resource Types"})},cell:({row:t})=>{const s=X(t.original);return e.jsx("div",{className:"flex items-center gap-0.5",children:s.map((r,n)=>e.jsx(J,{resourceType:r},n))})}},{id:"resource-name",header(){return e.jsx("p",{className:"whitespace-nowrap",children:"Resource Name"})},cell:({row:t})=>e.jsx("div",{className:"max-w-[100px]",children:e.jsx(Y,{connector:t.original})})},{id:"user",header:"Author",accessorFn:t=>{var s,r;return(r=(s=t.resources)==null?void 0:s.user)==null?void 0:r.name},cell:({row:t})=>{var r,n,o;const s=(r=t.original.resources)==null?void 0:r.user;return s?e.jsx(E,{className:"max-w-[200px] truncate",avatarUrl:((n=s.body)==null?void 0:n.avatar_url)??void 0,username:s.name,isServiceAccount:!!((o=s.body)!=null&&o.is_service_account)}):null}},{id:"expires",header(){return e.jsx("p",{className:"whitespace-nowrap",children:"Expires in"})},accessorFn:t=>{var s;return(s=t.body)==null?void 0:s.expires_at},cell:({row:t})=>{var r;const s=(r=t.original.body)==null?void 0:r.expires_at;return s?e.jsx(Z,{expires:s}):e.jsx("p",{children:"Never"})}},{id:"admin_actions",header:"",cell:({row:t})=>e.jsx(le,{id:t.original.id})}],[])}function ue({queryParams:t}){const{rowSelection:s,setRowSelection:r}=l(),n=y({...x.serviceConnectorList(t)}),o=de();if(n.isPending)return e.jsxs("div",{className:"space-y-5",children:[e.jsx(f,{className:"h-[300px] w-full"}),e.jsx(f,{className:"mx-auto h-[36px] w-[300px]"})]});if(n.isError)return null;const a=n.data;return e.jsx("section",{className:"flex flex-col gap-5",children:e.jsxs("div",{className:"flex flex-col items-center gap-5",children:[e.jsx("div",{className:"w-full",children:e.jsx(L,{columns:o,data:a.items,rowSelection:s,getRowId:N=>N.id,onRowSelectionChange:r})}),a.total_pages>1&&e.jsx(U,{searchParams:t,paginate:a})]})})}function me(){const s={...ie(),sort_by:"desc:updated"};return e.jsxs(e.Fragment,{children:[e.jsx(oe,{queryParams:s}),e.jsx(ue,{queryParams:s})]})}function Pe(){return e.jsxs(F,{className:"space-y-4 p-5",children:[e.jsx(V,{}),e.jsx(se,{children:e.jsx(me,{})})]})}export{Pe as default};
@@ -0,0 +1 @@
1
+ import{r as a,j as e}from"./@radix-B1sy0Lhr.js";import{$ as g,bn as C,r as p,a1 as b,b7 as y,B as i,aa as c}from"./index-CO6UN3UX.js";import{H as u,B as x,F as v,W as N}from"./Wizard-2FIi8JNY.js";import{S as f}from"./arrow-left-BFB2mgJo.js";import{C as S}from"./configuration-form-BbcNBQTO.js";import{c as k,L as F}from"./@react-router-CHjLNlgw.js";import{S as B,s as w}from"./constants-DfvsDtcH.js";import{C as T}from"./ComponentIcon-C9AY8usJ.js";import"./@tanstack-Dwlisomv.js";import"./@reactflow-gbyyU3kq.js";import"./index-d_QrPL-8.js";import"./form-C1jJgRy1.js";import"./plus-DOrkJCmy.js";import"./trash-D9LA4VFD.js";import"./index.esm-SBF9nn_P.js";import"./info-CI2szPUG.js";import"./zod-D48zuELD.js";import"./transform-S7omcvTm.js";import"./check-C9Nye5lR.js";import"./CodeSnippet-B7Wd4R8u.js";import"./file-text-TdPXNd7s.js";import"./terminal-square-C2tAF2XG.js";import"./bar-chart-square-check-_m-oYysN.js";import"./layout-GIiNvS10.js";function z(){const{setBreadcrumbs:s}=g();a.useEffect(()=>{s([C,{label:"Create",href:p.components.create}])},[s])}function H(){return z(),e.jsx(b,{children:e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(y,{className:"h-5 w-5 fill-turquoise-400"}),e.jsx("h1",{className:"text-display-xs font-semibold",children:"Register new Component"})]})})}function I({flavor:s,type:t,handleBack:r}){const l=a.useId(),o=k();function m(d){o(p.components.detail(d))}return e.jsxs(e.Fragment,{children:[e.jsxs(u,{className:"flex items-center gap-2",children:[e.jsxs(i,{intent:"secondary",emphasis:"subtle",className:"flex aspect-square size-6 items-center justify-center",onClick:()=>r(),children:[e.jsx(f,{className:"size-5 shrink-0"}),e.jsx("span",{className:"sr-only",children:"Go step back"})]}),e.jsxs("span",{children:["Configure your ",c(s.name)," ",c(t)]})]}),e.jsx(x,{className:"p-0",children:e.jsx(S,{flavorId:s.id,formId:l,successHandler:m,FooterComponent:L})})]})}function L({formId:s,isPending:t}){return e.jsxs(v,{children:[e.jsx(i,{asChild:!0,intent:"secondary",size:"md",children:e.jsx(F,{to:p.components.overview,children:"Cancel"})}),e.jsxs(i,{size:"md",disabled:t,type:"submit",form:s,children:[t&&e.jsx("div",{role:"alert","aria-busy":"true",className:"full h-[20px] w-[20px] animate-spin rounded-rounded border-2 border-theme-text-negative border-b-theme-text-brand"}),"Register Component"]})]})}function R({type:s,handleFlavorSelect:t,handleBack:r}){return e.jsxs(e.Fragment,{children:[e.jsxs(u,{className:"flex items-center gap-2",children:[e.jsxs(i,{intent:"secondary",emphasis:"subtle",className:"flex aspect-square size-6 items-center justify-center",onClick:()=>r(),children:[e.jsx(f,{className:"size-5 shrink-0"}),e.jsx("span",{className:"sr-only",children:"Go step back"})]}),e.jsxs("span",{children:["Select your ",c(s)," Flavor"]})," "]}),e.jsx(x,{children:e.jsx(B,{type:s,setSelectedFlavor:t})})]})}function q({selectTypeHandler:s}){return e.jsxs(e.Fragment,{children:[e.jsx(u,{children:"Select your Component Type"}),e.jsx(x,{children:e.jsx("ul",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 xl:grid-cols-4",children:w.map(t=>e.jsx(E,{type:t,selectTypeHandler:s},t))})})]})}function E({type:s,selectTypeHandler:t}){return e.jsxs("button",{onClick:()=>t(s),className:"flex h-[110px] flex-col items-center justify-center space-y-2 truncate whitespace-nowrap rounded-md border border-theme-border-moderate bg-theme-surface-secondary py-5 text-center text-text-sm text-theme-text-secondary transition-all duration-150 hover:bg-theme-surface-primary hover:shadow-sm",children:[e.jsx(T,{className:"h-5 w-5 shrink-0 fill-theme-text-tertiary group-data-[state=active]/trigger:fill-theme-surface-strong",type:s}),e.jsx("span",{children:c(s)})]})}function W(){const[s,t]=a.useState(0),[r,l]=a.useState(null),[o,m]=a.useState();function d(n){l(n),t(1)}function j(n){m(n),t(2)}function h(){t(n=>n-1)}return e.jsxs(N,{children:[s===0&&e.jsx(q,{selectTypeHandler:d}),s===1&&r&&e.jsx(R,{type:r,handleFlavorSelect:j,handleBack:h}),s===2&&o&&r&&e.jsx(I,{flavor:o,type:r,handleBack:h})]})}function ce(){return e.jsxs("div",{className:"space-y-5",children:[e.jsx(H,{}),e.jsx("section",{className:"layout-container pb-5",children:e.jsx(W,{})})]})}export{ce as default};
@@ -1 +1 @@
1
- import{j as e}from"./@radix-C_LirfyT.js";import{j as t,B as a,r as n}from"./index-BacoJBEQ.js";import{L as i}from"./@react-router-BSsrkPOd.js";import"./@tanstack-C0SeHZng.js";import"./@reactflow-D9hglKLF.js";const l="/assets/templates-1S_8WeSK.webp",o=["Run pipelines from the dashboard with Templates","Re-run a pipeline easily from the UI","Model and Artifact Control Plane Dashboard","Managed ZenML server on your VPC or hosted on our servers","Social SSO, RBAC, and User Management","CI/CD/CT, and more!"];function m(){return e.jsxs(t,{className:"relative overflow-hidden border border-warning-100 px-7 py-5",children:[e.jsxs("div",{className:"max-w-[450px] space-y-4",children:[e.jsx("h2",{className:"text-display-xs font-semibold",children:"Access Advanced Template Features with ZenML Pro"}),e.jsx("ul",{className:"space-y-2",children:o.map((r,s)=>e.jsx("li",{className:"text-text-md text-theme-text-secondary",children:r},s))}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(a,{asChild:!0,className:"truncate bg-warning-600 hover:bg-warning-400 active:bg-warning-500 active:ring-warning-50",size:"md",children:e.jsx(i,{to:n.upgrade,children:"Try Pro Features"})}),e.jsx(a,{emphasis:"minimal",size:"md",children:e.jsx("a",{href:"https://www.zenml.io/pro",target:"_blank",rel:"noopener noreferrer",children:"Learn more"})})]})]}),e.jsx("img",{className:"absolute right-0 top-0 hidden translate-x-[30%] scale-75 md:translate-y-[30%] lg:block xl:-translate-y-[5%]",src:l,alt:"Screenshot of Zenml Pro Templates Feature"})]})}function u(){return e.jsx("div",{className:"layout-container space-y-5 pt-5",children:e.jsx(m,{})})}export{u as default};
1
+ import{j as e}from"./@radix-B1sy0Lhr.js";import{k as t,B as a,r as n}from"./index-CO6UN3UX.js";import{L as i}from"./@react-router-CHjLNlgw.js";import"./@tanstack-Dwlisomv.js";import"./@reactflow-gbyyU3kq.js";const l="/assets/templates-1S_8WeSK.webp",o=["Run pipelines from the dashboard with Templates","Re-run a pipeline easily from the UI","Model and Artifact Control Plane Dashboard","Managed ZenML server on your VPC or hosted on our servers","Social SSO, RBAC, and User Management","CI/CD/CT, and more!"];function m(){return e.jsxs(t,{className:"relative overflow-hidden border border-warning-100 px-7 py-5",children:[e.jsxs("div",{className:"max-w-[450px] space-y-4",children:[e.jsx("h2",{className:"text-display-xs font-semibold",children:"Access Advanced Template Features with ZenML Pro"}),e.jsx("ul",{className:"space-y-2",children:o.map((r,s)=>e.jsx("li",{className:"text-text-md text-theme-text-secondary",children:r},s))}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(a,{asChild:!0,className:"truncate bg-warning-600 hover:bg-warning-400 active:bg-warning-500 active:ring-warning-50",size:"md",children:e.jsx(i,{to:n.upgrade,children:"Try Pro Features"})}),e.jsx(a,{emphasis:"minimal",size:"md",children:e.jsx("a",{href:"https://www.zenml.io/pro",target:"_blank",rel:"noopener noreferrer",children:"Learn more"})})]})]}),e.jsx("img",{className:"absolute right-0 top-0 hidden translate-x-[30%] scale-75 md:translate-y-[30%] lg:block xl:-translate-y-[5%]",src:l,alt:"Screenshot of Zenml Pro Templates Feature"})]})}function u(){return e.jsx("div",{className:"layout-container space-y-5 pt-5",children:e.jsx(m,{})})}export{u as default};
@@ -1,2 +1,2 @@
1
- import{r as u,j as a}from"./@radix-C_LirfyT.js";import{u as h,c as w,S as v,a as y,b as k}from"./form-schemas-B9XgTS1V.js";import{S}from"./SetPassword-CaKVSqAL.js";import{I as x,B as j,v as N,y as A,F as C,E as q,q as P,s as E,t as z}from"./index-BacoJBEQ.js";import{u as F}from"./index.esm-COnaHLSh.js";import{t as M}from"./zod-DgEcN9jD.js";import{c as T}from"./@tanstack-C0SeHZng.js";import{u as U}from"./login-mutation-CidpsqyH.js";import"./check-circle-mnEgPhPF.js";import"./@react-router-BSsrkPOd.js";import"./UpdatePasswordSchemas-Da5RndbV.js";import"./PasswordChecker-BZwoeQIm.js";import"./@reactflow-D9hglKLF.js";const g=u.createContext(null);function $({children:e,initialSettings:r}){const[t,i]=u.useState(r||{});return a.jsx(g.Provider,{value:{serverSettings:t,setServerSettings:i},children:e})}function f(){const e=u.useContext(g);if(e===null)throw new Error("useServerActivationContext must be used within an ServerActivationProvider");return e}function I(){const{setSurveyStep:e}=h(),{setServerSettings:r}=f();function t({newPassword:i,username:o}){r(s=>({...s,admin_password:i,admin_username:o})),e(s=>s+1)}return a.jsx(S,{displayUsername:!0,headline:"Create your admin user and password",subHeadine:"Select a username and password for your admin account",submitHandler:t})}const m=e=>{e=1831565813+(e|=0)|0;let r=Math.imul(e^e>>>15,1|e);return r=r+Math.imul(r^r>>>7,61|r)^r,((r^r>>>14)>>>0)/4294967296};class L{constructor(r){this.dictionaries=void 0,this.length=void 0,this.separator=void 0,this.style=void 0,this.seed=void 0;const{length:t,separator:i,dictionaries:o,style:s,seed:l}=r;this.dictionaries=o,this.separator=i,this.length=t,this.style=s,this.seed=l}generate(){if(!this.dictionaries)throw new Error('Cannot find any dictionary. Please provide at least one, or leave the "dictionary" field empty in the config object');if(this.length<=0)throw new Error("Invalid length provided");if(this.length>this.dictionaries.length)throw new Error(`The length cannot be bigger than the number of dictionaries.
2
- Length provided: ${this.length}. Number of dictionaries provided: ${this.dictionaries.length}`);let r=this.seed;return this.dictionaries.slice(0,this.length).reduce((t,i)=>{let o;r?(o=(l=>{if(typeof l=="string"){const c=l.split("").map(d=>d.charCodeAt(0)).reduce((d,b)=>d+b,1),n=Math.floor(Number(c));return m(n)}return m(l)})(r),r=4294967296*o):o=Math.random();let s=i[Math.floor(o*i.length)]||"";if(this.style==="lowerCase")s=s.toLowerCase();else if(this.style==="capital"){const[l,...c]=s.split("");s=l.toUpperCase()+c.join("")}else this.style==="upperCase"&&(s=s.toUpperCase());return t?`${t}${this.separator}${s}`:`${s}`},"")}}const p={separator:"_",dictionaries:[]},_=e=>{const r=[...e&&e.dictionaries||p.dictionaries],t={...p,...e,length:e&&e.length||r.length,dictionaries:r};if(!e||!e.dictionaries||!e.dictionaries.length)throw new Error('A "dictionaries" array must be provided. This is a breaking change introduced starting from Unique Name Generator v4. Read more about the breaking change here: https://github.com/andreasonny83/unique-names-generator#migration-guide');return new L(t).generate()};var H=["aardvark","aardwolf","albatross","alligator","alpaca","amphibian","anaconda","angelfish","anglerfish","ant","anteater","antelope","antlion","ape","aphid","armadillo","asp","baboon","badger","bandicoot","barnacle","barracuda","basilisk","bass","bat","bear","beaver","bedbug","bee","beetle","bird","bison","blackbird","boa","boar","bobcat","bobolink","bonobo","booby","bovid","bug","butterfly","buzzard","camel","canid","canidae","capybara","cardinal","caribou","carp","cat","caterpillar","catfish","catshark","cattle","centipede","cephalopod","chameleon","cheetah","chickadee","chicken","chimpanzee","chinchilla","chipmunk","cicada","clam","clownfish","cobra","cockroach","cod","condor","constrictor","coral","cougar","cow","coyote","crab","crane","crawdad","crayfish","cricket","crocodile","crow","cuckoo","damselfly","deer","dingo","dinosaur","dog","dolphin","donkey","dormouse","dove","dragon","dragonfly","duck","eagle","earthworm","earwig","echidna","eel","egret","elephant","elk","emu","ermine","falcon","felidae","ferret","finch","firefly","fish","flamingo","flea","fly","flyingfish","fowl","fox","frog","galliform","gamefowl","gayal","gazelle","gecko","gerbil","gibbon","giraffe","goat","goldfish","goose","gopher","gorilla","grasshopper","grouse","guan","guanaco","guineafowl","gull","guppy","haddock","halibut","hamster","hare","harrier","hawk","hedgehog","heron","herring","hippopotamus","hookworm","hornet","horse","hoverfly","hummingbird","hyena","iguana","impala","jackal","jaguar","jay","jellyfish","junglefowl","kangaroo","kingfisher","kite","kiwi","koala","koi","krill","ladybug","lamprey","landfowl","lark","leech","lemming","lemur","leopard","leopon","limpet","lion","lizard","llama","lobster","locust","loon","louse","lungfish","lynx","macaw","mackerel","magpie","mammal","manatee","mandrill","marlin","marmoset","marmot","marsupial","marten","mastodon","meadowlark","meerkat","mink","minnow","mite","mockingbird","mole","mollusk","mongoose","monkey","moose","mosquito","moth","mouse","mule","muskox","narwhal","newt","nightingale","ocelot","octopus","opossum","orangutan","orca","ostrich","otter","owl","ox","panda","panther","parakeet","parrot","parrotfish","partridge","peacock","peafowl","pelican","penguin","perch","pheasant","pig","pigeon","pike","pinniped","piranha","planarian","platypus","pony","porcupine","porpoise","possum","prawn","primate","ptarmigan","puffin","puma","python","quail","quelea","quokka","rabbit","raccoon","rat","rattlesnake","raven","reindeer","reptile","rhinoceros","roadrunner","rodent","rook","rooster","roundworm","sailfish","salamander","salmon","sawfish","scallop","scorpion","seahorse","shark","sheep","shrew","shrimp","silkworm","silverfish","skink","skunk","sloth","slug","smelt","snail","snake","snipe","sole","sparrow","spider","spoonbill","squid","squirrel","starfish","stingray","stoat","stork","sturgeon","swallow","swan","swift","swordfish","swordtail","tahr","takin","tapir","tarantula","tarsier","termite","tern","thrush","tick","tiger","tiglon","toad","tortoise","toucan","trout","tuna","turkey","turtle","tyrannosaurus","unicorn","urial","vicuna","viper","vole","vulture","wallaby","walrus","warbler","wasp","weasel","whale","whippet","whitefish","wildcat","wildebeest","wildfowl","wolf","wolverine","wombat","woodpecker","worm","wren","xerinae","yak","zebra"],B=["amaranth","amber","amethyst","apricot","aqua","aquamarine","azure","beige","black","blue","blush","bronze","brown","chocolate","coffee","copper","coral","crimson","cyan","emerald","fuchsia","gold","gray","green","harlequin","indigo","ivory","jade","lavender","lime","magenta","maroon","moccasin","olive","orange","peach","pink","plum","purple","red","rose","salmon","sapphire","scarlet","silver","tan","teal","tomato","turquoise","violet","white","yellow"];const D=["booby","swallow"];function R(){return _({dictionaries:[B,H.filter(e=>!D.includes(e))]})}function V({submitHandler:e}){const r=u.useId(),{handleSubmit:t,register:i,formState:{isValid:o}}=F({resolver:M(w),defaultValues:{serverName:R()}});return a.jsxs("div",{className:"max-w-[570px] space-y-5",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-display-xs font-semibold",children:"Almost there! Select a server name"}),a.jsx("p",{className:"text-theme-text-secondary",children:"This will identify your ZenML server. You can use the generated name or create your own."})]}),a.jsxs("form",{onSubmit:t(e),className:"space-y-5",children:[a.jsx("div",{className:"space-y-2",children:a.jsxs("div",{className:"space-y-0.5",children:[a.jsx("label",{htmlFor:r,className:"text-text-sm",children:"Server Name"}),a.jsx(x,{...i("serverName"),id:r,className:"w-full"})]})}),a.jsx(j,{disabled:!o,className:"w-full text-center",size:"md",children:a.jsx("span",{className:"w-full",children:"Activate your Server"})})]})]})}async function Y(e){const r=A(q.activate),t=await N(r,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const i=await t.json().then(o=>Array.isArray(o.detail)?o.detail[1]:o.detail).catch(()=>"Failed to activate server");throw new C({status:t.status,statusText:t.statusText,message:i})}return t.json()}function Z(e){return T({mutationFn:async r=>Y(r),...e})}function G({setUsername:e}){const{serverSettings:r}=f(),{setSurveyStep:t}=h(),{setAuthState:i}=P(),{toast:o}=E(),{mutate:s}=U({onSuccess:()=>{i("true"),t(n=>n+1)}}),{mutate:l}=Z({onSuccess:async n=>{e(n.name),s({username:n.name,password:r.admin_password??void 0})},onError:n=>{n instanceof Error&&o({status:"error",emphasis:"subtle",icon:a.jsx(z,{className:"h-5 w-5 shrink-0 fill-error-700"}),description:n.message,rounded:!0})}});function c({serverName:n}){l({...r,server_name:n})}return a.jsx(V,{submitHandler:c})}function J(){const{surveyStep:e}=h(),[r,t]=u.useState("");return a.jsx(a.Fragment,{children:a.jsxs($,{children:[a.jsx(v,{stepAmount:2}),e===1&&a.jsx(I,{}),e===2&&a.jsx(G,{setUsername:t}),e===3&&a.jsx(y,{subHeader:"Your created your ZenML account",username:r})]})})}function le(){return a.jsx(k,{children:a.jsx(J,{})})}export{le as default};
1
+ import{r as u,j as a}from"./@radix-B1sy0Lhr.js";import{u as h,c as b,S as v,a as y,b as k}from"./form-schemas-BjWDRvGd.js";import{S}from"./SetPassword-C4OH-cn1.js";import{I as x,B as j,x as N,F as A,G as C,H as q,t as P,v as z,w as E}from"./index-CO6UN3UX.js";import{u as F}from"./index.esm-SBF9nn_P.js";import{t as M}from"./zod-D48zuELD.js";import{c as T}from"./@tanstack-Dwlisomv.js";import{u as U}from"./login-mutation-CDgTlQBD.js";import"./check-circle-CG6XAdk-.js";import"./@react-router-CHjLNlgw.js";import"./UpdatePasswordSchemas-DNkYgzN6.js";import"./PasswordChecker-DOPLfvg7.js";import"./@reactflow-gbyyU3kq.js";const g=u.createContext(null);function $({children:e,initialSettings:r}){const[t,i]=u.useState(r||{});return a.jsx(g.Provider,{value:{serverSettings:t,setServerSettings:i},children:e})}function f(){const e=u.useContext(g);if(e===null)throw new Error("useServerActivationContext must be used within an ServerActivationProvider");return e}function H(){const{setSurveyStep:e}=h(),{setServerSettings:r}=f();function t({newPassword:i,username:o}){r(s=>({...s,admin_password:i,admin_username:o})),e(s=>s+1)}return a.jsx(S,{displayUsername:!0,headline:"Create your admin user and password",subHeadine:"Select a username and password for your admin account",submitHandler:t})}const m=e=>{e=1831565813+(e|=0)|0;let r=Math.imul(e^e>>>15,1|e);return r=r+Math.imul(r^r>>>7,61|r)^r,((r^r>>>14)>>>0)/4294967296};class I{constructor(r){this.dictionaries=void 0,this.length=void 0,this.separator=void 0,this.style=void 0,this.seed=void 0;const{length:t,separator:i,dictionaries:o,style:s,seed:l}=r;this.dictionaries=o,this.separator=i,this.length=t,this.style=s,this.seed=l}generate(){if(!this.dictionaries)throw new Error('Cannot find any dictionary. Please provide at least one, or leave the "dictionary" field empty in the config object');if(this.length<=0)throw new Error("Invalid length provided");if(this.length>this.dictionaries.length)throw new Error(`The length cannot be bigger than the number of dictionaries.
2
+ Length provided: ${this.length}. Number of dictionaries provided: ${this.dictionaries.length}`);let r=this.seed;return this.dictionaries.slice(0,this.length).reduce((t,i)=>{let o;r?(o=(l=>{if(typeof l=="string"){const c=l.split("").map(d=>d.charCodeAt(0)).reduce((d,w)=>d+w,1),n=Math.floor(Number(c));return m(n)}return m(l)})(r),r=4294967296*o):o=Math.random();let s=i[Math.floor(o*i.length)]||"";if(this.style==="lowerCase")s=s.toLowerCase();else if(this.style==="capital"){const[l,...c]=s.split("");s=l.toUpperCase()+c.join("")}else this.style==="upperCase"&&(s=s.toUpperCase());return t?`${t}${this.separator}${s}`:`${s}`},"")}}const p={separator:"_",dictionaries:[]},L=e=>{const r=[...e&&e.dictionaries||p.dictionaries],t={...p,...e,length:e&&e.length||r.length,dictionaries:r};if(!e||!e.dictionaries||!e.dictionaries.length)throw new Error('A "dictionaries" array must be provided. This is a breaking change introduced starting from Unique Name Generator v4. Read more about the breaking change here: https://github.com/andreasonny83/unique-names-generator#migration-guide');return new I(t).generate()};var _=["aardvark","aardwolf","albatross","alligator","alpaca","amphibian","anaconda","angelfish","anglerfish","ant","anteater","antelope","antlion","ape","aphid","armadillo","asp","baboon","badger","bandicoot","barnacle","barracuda","basilisk","bass","bat","bear","beaver","bedbug","bee","beetle","bird","bison","blackbird","boa","boar","bobcat","bobolink","bonobo","booby","bovid","bug","butterfly","buzzard","camel","canid","canidae","capybara","cardinal","caribou","carp","cat","caterpillar","catfish","catshark","cattle","centipede","cephalopod","chameleon","cheetah","chickadee","chicken","chimpanzee","chinchilla","chipmunk","cicada","clam","clownfish","cobra","cockroach","cod","condor","constrictor","coral","cougar","cow","coyote","crab","crane","crawdad","crayfish","cricket","crocodile","crow","cuckoo","damselfly","deer","dingo","dinosaur","dog","dolphin","donkey","dormouse","dove","dragon","dragonfly","duck","eagle","earthworm","earwig","echidna","eel","egret","elephant","elk","emu","ermine","falcon","felidae","ferret","finch","firefly","fish","flamingo","flea","fly","flyingfish","fowl","fox","frog","galliform","gamefowl","gayal","gazelle","gecko","gerbil","gibbon","giraffe","goat","goldfish","goose","gopher","gorilla","grasshopper","grouse","guan","guanaco","guineafowl","gull","guppy","haddock","halibut","hamster","hare","harrier","hawk","hedgehog","heron","herring","hippopotamus","hookworm","hornet","horse","hoverfly","hummingbird","hyena","iguana","impala","jackal","jaguar","jay","jellyfish","junglefowl","kangaroo","kingfisher","kite","kiwi","koala","koi","krill","ladybug","lamprey","landfowl","lark","leech","lemming","lemur","leopard","leopon","limpet","lion","lizard","llama","lobster","locust","loon","louse","lungfish","lynx","macaw","mackerel","magpie","mammal","manatee","mandrill","marlin","marmoset","marmot","marsupial","marten","mastodon","meadowlark","meerkat","mink","minnow","mite","mockingbird","mole","mollusk","mongoose","monkey","moose","mosquito","moth","mouse","mule","muskox","narwhal","newt","nightingale","ocelot","octopus","opossum","orangutan","orca","ostrich","otter","owl","ox","panda","panther","parakeet","parrot","parrotfish","partridge","peacock","peafowl","pelican","penguin","perch","pheasant","pig","pigeon","pike","pinniped","piranha","planarian","platypus","pony","porcupine","porpoise","possum","prawn","primate","ptarmigan","puffin","puma","python","quail","quelea","quokka","rabbit","raccoon","rat","rattlesnake","raven","reindeer","reptile","rhinoceros","roadrunner","rodent","rook","rooster","roundworm","sailfish","salamander","salmon","sawfish","scallop","scorpion","seahorse","shark","sheep","shrew","shrimp","silkworm","silverfish","skink","skunk","sloth","slug","smelt","snail","snake","snipe","sole","sparrow","spider","spoonbill","squid","squirrel","starfish","stingray","stoat","stork","sturgeon","swallow","swan","swift","swordfish","swordtail","tahr","takin","tapir","tarantula","tarsier","termite","tern","thrush","tick","tiger","tiglon","toad","tortoise","toucan","trout","tuna","turkey","turtle","tyrannosaurus","unicorn","urial","vicuna","viper","vole","vulture","wallaby","walrus","warbler","wasp","weasel","whale","whippet","whitefish","wildcat","wildebeest","wildfowl","wolf","wolverine","wombat","woodpecker","worm","wren","xerinae","yak","zebra"],B=["amaranth","amber","amethyst","apricot","aqua","aquamarine","azure","beige","black","blue","blush","bronze","brown","chocolate","coffee","copper","coral","crimson","cyan","emerald","fuchsia","gold","gray","green","harlequin","indigo","ivory","jade","lavender","lime","magenta","maroon","moccasin","olive","orange","peach","pink","plum","purple","red","rose","salmon","sapphire","scarlet","silver","tan","teal","tomato","turquoise","violet","white","yellow"];const D=["booby","swallow"];function G(){return L({dictionaries:[B,_.filter(e=>!D.includes(e))]})}function R({submitHandler:e}){const r=u.useId(),{handleSubmit:t,register:i,formState:{isValid:o}}=F({resolver:M(b),defaultValues:{serverName:G()}});return a.jsxs("div",{className:"max-w-[570px] space-y-5",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-display-xs font-semibold",children:"Almost there! Select a server name"}),a.jsx("p",{className:"text-theme-text-secondary",children:"This will identify your ZenML server. You can use the generated name or create your own."})]}),a.jsxs("form",{onSubmit:t(e),className:"space-y-5",children:[a.jsx("div",{className:"space-y-2",children:a.jsxs("div",{className:"space-y-0.5",children:[a.jsx("label",{htmlFor:r,className:"text-text-sm",children:"Server Name"}),a.jsx(x,{...i("serverName"),id:r,className:"w-full"})]})}),a.jsx(j,{disabled:!o,className:"w-full text-center",size:"md",children:a.jsx("span",{className:"w-full",children:"Activate your Server"})})]})]})}async function V(e){const r=A(q.activate),t=await N(r,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const i=await t.json().then(o=>Array.isArray(o.detail)?o.detail[1]:o.detail).catch(()=>"Failed to activate server");throw new C({status:t.status,statusText:t.statusText,message:i})}return t.json()}function Y(e){return T({mutationFn:async r=>V(r),...e})}function Z({setUsername:e}){const{serverSettings:r}=f(),{setSurveyStep:t}=h(),{setAuthState:i}=P(),{toast:o}=z(),{mutate:s}=U({onSuccess:()=>{i("true"),t(n=>n+1)}}),{mutate:l}=Y({onSuccess:async n=>{e(n.name),s({username:n.name,password:r.admin_password??void 0})},onError:n=>{n instanceof Error&&o({status:"error",emphasis:"subtle",icon:a.jsx(E,{className:"h-5 w-5 shrink-0 fill-error-700"}),description:n.message,rounded:!0})}});function c({serverName:n}){l({...r,server_name:n})}return a.jsx(R,{submitHandler:c})}function J(){const{surveyStep:e}=h(),[r,t]=u.useState("");return a.jsx(a.Fragment,{children:a.jsxs($,{children:[a.jsx(v,{stepAmount:2}),e===1&&a.jsx(H,{}),e===2&&a.jsx(Z,{setUsername:t}),e===3&&a.jsx(y,{subHeader:"Your created your ZenML account",username:r})]})})}function le(){return a.jsx(k,{children:a.jsx(J,{})})}export{le as default};
@@ -0,0 +1 @@
1
+ import{j as o}from"./@radix-B1sy0Lhr.js";import{S as r}from"./Tabs-2uwqXsdL.js";import{R as m}from"./RunsBody-CZAiSxYK.js";import{b as i}from"./ButtonGroup-DVhzbQxV.js";import{S as p}from"./StackList-DSAjbVb5.js";import{a as s}from"./@react-router-CHjLNlgw.js";import"./index-CO6UN3UX.js";import"./@tanstack-Dwlisomv.js";import"./@reactflow-gbyyU3kq.js";import"./terminal-C2tAF2XG.js";import"./chevron-down-Bl7WwQAL.js";import"./transform-S7omcvTm.js";import"./DisplayDate-57lUNS79.js";import"./NestedCollapsible-0yviIfaA.js";import"./eye-BXcQevds.js";import"./CollapsibleCard-DSZzbjx5.js";import"./check-circle-CG6XAdk-.js";import"./CodeSnippet-B7Wd4R8u.js";import"./refresh-C8BXS3Fb.js";import"./Pagination-C1sE5Nzn.js";import"./chevron-right-double-CbMG1dOM.js";import"./SearchField-Byv1PtST.js";import"./index-g7wOyc86.js";import"./all-pipeline-runs-query-CdvWtiAY.js";import"./ExecutionStatus-CQbWovhV.js";import"./help-CRPfbPTO.js";import"./trash-D9LA4VFD.js";import"./AlertDialogDropdownItem-BpLj419i.js";import"./DeleteAlertDialog-CzhTVQaC.js";import"./zod-D48zuELD.js";import"./index.esm-SBF9nn_P.js";import"./bulk-delete-wdObjfps.js";import"./delete-run-XSre8ru-.js";import"./plus-DOrkJCmy.js";import"./index-BYHxFvoG.js";import"./stack-detail-query-DnyMCdVE.js";import"./SheetHeader-Bb3v9rha.js";import"./components-Br2ezRib.js";import"./NumberBox-C2Pju4PR.js";import"./ComponentBadge-MVT08kBV.js";import"./ComponentIcon-C9AY8usJ.js";import"./bar-chart-square-check-_m-oYysN.js";import"./layout-GIiNvS10.js";import"./Infobox-DnduZjNU.js";import"./info-CI2szPUG.js";import"./DialogItem-DD_7v3UY.js";function $(){const{componentId:t}=s();return o.jsx("div",{className:"@container",children:o.jsx(r,{isPanel:!1,stacksTabContent:o.jsx(p,{fixedQueryParams:{component_id:t}}),runsTabContent:o.jsx(i,{children:o.jsx(m,{fixedQueryParams:{stack_component:t}})}),componentId:t})})}export{$ as default};
@@ -1 +1 @@
1
- import{r as l,j as e}from"./@radix-C_LirfyT.js";import{u as m,W as B,L as I}from"./LeftSideMenu-Czev0KCA.js";import{p as C,s as M,c as k}from"./persist-BKKcL1Kp.js";import{I as b}from"./Infobox-DFCWPbMb.js";import{W as v,H as g,B as y}from"./Wizard-8aJzxUjb.js";import{t as z}from"./zod-DgEcN9jD.js";import{B as p,bj as A,d as P,b4 as F,r as Z,z as _}from"./index-BacoJBEQ.js";import{u as T,F as L,a as W}from"./index.esm-COnaHLSh.js";import{S as V,C as x,P as f}from"./ProviderRadio-D_q9tE3G.js";import{S as N}from"./WizardFooter-Bt7_UE14.js";import{R as H,a as O,E as $,C as G}from"./Partials-DlMzfKgs.js";import{b as Q,a as Y}from"./persist-DxiyfAax.js";import{S as q}from"./logs-DoLoTEfj.js";import{C as j}from"./CodeSnippet-D8iBqOVv.js";import{N as w}from"./NumberBox-CoQjQYDJ.js";import{s as E}from"./index-dCcVgFNl.js";import{b as D}from"./@tanstack-C0SeHZng.js";import{c as J}from"./@react-router-BSsrkPOd.js";import{C as h}from"./ProviderIcon-BMAn9Jld.js";import"./Tick-DDeDgTuT.js";import"./check-D1bHMJkL.js";import"./info-CyMih3vQ.js";import"./@reactflow-D9hglKLF.js";import"./package-BhYXGPxF.js";import"./credit-card-CH1BHrXY.js";import"./ComponentBadge-mw2Ja_ON.js";import"./ComponentIcon-BXgpt-jw.js";import"./bar-chart-square-check-9siI9icm.js";import"./layout-C5dgIReC.js";import"./transform-DFpKTKgF.js";import"./sharedSchema-DyUO09BR.js";import"./index.es-DcVFDpJU.js";import"./stack-detail-query-Bc4QKlWg.js";const R=l.createContext(null);function K({children:r}){const{setCurrentStep:t}=m(),[i,s]=l.useState({}),[o,c]=l.useState("");return l.useEffect(()=>{const{success:a,data:n}=C();if(a){t(3),s({location:n.location,provider:n.provider,stackName:n.stackName}),c(n.timestamp);return}t(1)},[C]),e.jsx(R.Provider,{value:{data:i,setData:s,timestamp:o,setTimestamp:c},children:r})}function d(){const r=l.useContext(R);if(r===null)throw new Error("useCreateTerraformContext must be used within an CreateTerraformContext");return r}function U(){const{setData:r,data:t,setTimestamp:i}=d(),{setCurrentStep:s}=m(),o=T({resolver:z(Q,{async:!0}),defaultValues:{region:t.location||"",stackName:t.stackName||""}});function c(a){const n=new Date().toISOString().slice(0,-1);M({location:a.region,provider:t.provider||"aws",stackName:a.stackName,timestamp:n}),i(n),r(u=>({...u,location:a.region,stackName:a.stackName})),s(u=>u+1)}return e.jsx(L,{...o,children:e.jsxs(v,{children:[e.jsx(g,{children:"Review Stack Configuration"}),e.jsx(y,{children:e.jsxs("div",{className:"space-y-5",children:[e.jsxs(b,{className:"text-text-sm",children:[e.jsx("p",{className:"font-semibold",children:"Important"}),e.jsx("p",{children:"This will create new resources in your account. Ensure you have the necessary permissions and are aware of any potential costs."})]}),e.jsxs("form",{id:"configuration-form",onSubmit:o.handleSubmit(c),className:"space-y-5",children:[e.jsx(H,{provider:t.provider||"aws"}),e.jsx(V,{})]}),e.jsx(O,{provider:t.provider||"aws"}),e.jsx($,{provider:t.provider||"aws"})]})}),e.jsx(N,{children:e.jsx(X,{})})]})})}function X(){const{formState:{isSubmitting:r}}=W();return e.jsx(p,{disabled:r,form:"configuration-form",size:"md",children:"Next"})}function ee(){return e.jsxs("div",{className:"space-y-5",children:[e.jsx("div",{className:"space-y-1",children:e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(w,{children:"3"}),e.jsx("span",{className:"text-text-lg font-semibold",children:"Run the following commands"})]})}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-text-sm text-theme-text-secondary",children:"Initialize the Terraform configuration."}),e.jsx(j,{code:"terraform init --upgrade"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-text-sm text-theme-text-secondary",children:"Run terraform apply to deploy the ZenML stack to Azure."}),e.jsx(j,{code:"terraform apply"})]})]})}function re(){const{data:r,timestamp:t}=d(),{setCurrentStep:i}=m(),s=D({...E.stackDeploymentStack({provider:r.provider,stack_name:r.stackName,date_start:t,terraform:!0}),refetchInterval:5e3,throwOnError:!0});return l.useEffect(()=>{s.data&&(k(),i(o=>o+1))},[s.data]),{fullstackDeployment:s,data:r}}function te(){const{fullstackDeployment:r,data:t}=re();return r.isError?e.jsx("p",{children:"Error fetching Terraform Command"}):r.isPending?e.jsx(P,{className:"h-[200px] w-full"}):e.jsx(ae,{provider:t.provider||"aws",stackName:t.stackName||""})}function se(){return e.jsxs("section",{className:"space-y-5 border-t border-theme-border-moderate pt-5",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("p",{className:"flex items-center gap-1 text-text-lg font-semibold",children:[e.jsx(A,{className:"h-5 w-5 fill-primary-400"}),"Waiting for your Terraform script to finish..."]}),e.jsx("p",{className:"text-theme-text-secondary",children:"We are detecting whether your Terraform script ran through successfully. Once the terraform script has finished successfully, come back to check your brand new stack and components ready."})]}),e.jsx(te,{})]})}function ae({stackName:r,provider:t}){return e.jsxs("div",{className:"relative overflow-hidden rounded-md",children:[e.jsx("div",{className:"absolute z-50 h-full w-full bg-neutral-50/50"}),e.jsx(G,{type:t,componentProps:{isLoading:!0,isSuccess:!1,stackName:r}})]})}function oe(){return e.jsxs(v,{children:[e.jsx(g,{children:"Deploy ZenML Stack"}),e.jsx(y,{children:e.jsxs("section",{className:"space-y-5",children:[e.jsx(ne,{}),e.jsx(de,{}),e.jsx(me,{}),e.jsx(ee,{}),e.jsx(se,{})]})}),e.jsxs(N,{displayCancel:!1,children:[e.jsx(ue,{}),e.jsx(ie,{})]})]})}function ie(){return e.jsx(p,{disabled:!0,size:"md",children:"Next"})}function ne(){return e.jsxs("div",{className:"space-y-1",children:[e.jsxs("p",{className:"flex items-center gap-1 text-text-lg font-semibold",children:[e.jsx(q,{className:"h-5 w-5 fill-primary-400"}),"Configuration"]}),e.jsx("p",{className:"text-theme-text-secondary",children:"Follow the steps to deploy your Stack."})]})}function ce(r){switch(r){case"aws":return"https://aws.amazon.com/cli/";case"azure":return"https://learn.microsoft.com/en-us/cli/azure/";case"gcp":return"https://cloud.google.com/sdk/gcloud"}}function le(r){switch(r){case"aws":return"AWS";case"gcp":return"gcloud";case"azure":return"Azure"}}function de(){const{data:r}=d();return e.jsx("div",{className:"space-y-5",children:e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(w,{children:"1"}),e.jsxs("span",{className:"text-text-lg font-semibold",children:["Login locally with the ",le(r.provider||"aws")," CLI"]})]}),e.jsx("p",{className:"text-theme-text-secondary",children:"Make sure you are logged in locally with an account with appropriate permissions."}),e.jsx(p,{asChild:!0,className:"w-fit gap-1",intent:"secondary",emphasis:"subtle",size:"md",children:e.jsxs("a",{rel:"noopener noreferrer",target:"_blank",href:ce(r.provider||"aws"),children:[e.jsx("span",{children:"Learn More"}),e.jsx(F,{className:"h-5 w-5 shrink-0 fill-primary-900"})]})})]})})}function me(){const{data:r}=d();return e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(w,{children:"2"}),e.jsx("span",{className:"text-text-lg font-semibold",children:"Create a file with the following configuration"})]}),e.jsxs("p",{className:"text-theme-text-secondary",children:["Create a file named ",e.jsx("code",{className:"font-mono text-primary-400",children:"main.tf"})," in the Cloud Shell and copy and paste the Terraform configuration below into it."]})]}),r.provider==="gcp"&&e.jsxs(b,{intent:"warning",children:["Please replace ",e.jsx("code",{className:"font-mono text-primary-400",children:"project_id"})," in the following Terraform script with your own one."]}),e.jsx(pe,{})]})}function pe(){const{data:r}=d(),t=D({...E.stackDeploymentConfig({provider:r.provider||"aws",terraform:!0,stack_name:r.stackName,location:r.location}),enabled:!!r.stackName});return t.isError?null:t.isPending?e.jsx(P,{className:"h-[200px] w-full"}):e.jsx(j,{fullWidth:!0,highlightCode:!0,codeClasses:"whitespace-pre-wrap word-break-all",wrap:!0,code:t.data.configuration||""})}function ue(){const r=J();function t(){k(),r(Z.stacks.create.index)}return e.jsx(p,{onClick:()=>t(),intent:"secondary",size:"md",children:"Cancel"})}const xe=_.object({provider:Y});function fe(){const{setData:r,data:t}=d(),{setCurrentStep:i}=m(),s=T({resolver:z(xe),defaultValues:{provider:t.provider||void 0}});function o(c){r(a=>({...a,provider:c.provider})),i(a=>a+1)}return e.jsx(L,{...s,children:e.jsxs(v,{children:[e.jsx(g,{children:"New Cloud infrastructure"}),e.jsx(y,{children:e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-text-lg font-semibold",children:"Select a Cloud Provider"}),e.jsx("p",{className:"text-theme-text-secondary",children:"Select the cloud provider where your want to create your infrastructure. You will be able to remove the ZenML stack at any time."})]}),e.jsxs("form",{id:"provider-form",onSubmit:s.handleSubmit(o),className:"grid grid-cols-1 gap-3 xl:grid-cols-3",children:[e.jsx(x,{id:"aws-provider",...s.register("provider"),value:"aws",children:e.jsx(f,{icon:e.jsx(h,{provider:"aws",className:"h-6 w-6 shrink-0"}),title:"AWS",subtitle:"Connect your existing S3, ECR, and Sagemaker components to ZenML"})}),e.jsx(x,{id:"gcp-provider",...s.register("provider"),value:"gcp",children:e.jsx(f,{icon:e.jsx(h,{provider:"gcp",className:"h-6 w-6 shrink-0"}),title:"GCP",subtitle:"Link your GCS, Artifact Registry, and Vertex AI components to ZenML"})}),e.jsx(x,{id:"azure-provider",...s.register("provider"),value:"azure",children:e.jsx(f,{icon:e.jsx(h,{provider:"azure",className:"h-6 w-6 shrink-0"}),title:"Azure",subtitle:"Integrate ZenML with your Blob Storage, Container Registry, and Azure ML"})})]})]})}),e.jsx(N,{children:e.jsx(he,{})})]})})}function he(){const{formState:{isValid:r}}=W();return e.jsx(p,{form:"provider-form",disabled:!r,size:"md",children:"Next"})}function je(){const{currentStep:r}=m();if(r===1)return e.jsx(fe,{});if(r===2)return e.jsx(U,{});if(r===3)return e.jsx(oe,{})}const S=["Infrastructure Type","Cloud Provider","Review Configuration","Deploy Stack"];function Ke(){return e.jsx(B,{maxSteps:S.length,initialStep:0,children:e.jsx(K,{children:e.jsxs("section",{className:"layout-container flex flex-col gap-5 py-5 xl:flex-row",children:[e.jsx(I,{entries:S}),e.jsx("div",{className:"w-full overflow-y-hidden",children:e.jsx(je,{})})]})})})}export{Ke as default};
1
+ import{r as l,j as e}from"./@radix-B1sy0Lhr.js";import{u as m,W as B,L as I}from"./LeftSideMenu-D5UEs4vB.js";import{p as C,s as M,c as k}from"./persist-B3Hb8HDW.js";import{I as b}from"./Infobox-DnduZjNU.js";import{W as v,H as g,B as y}from"./Wizard-2FIi8JNY.js";import{t as z}from"./zod-D48zuELD.js";import{B as p,bl as A,d as P,b8 as F,r as Z,z as _}from"./index-CO6UN3UX.js";import{u as T,F as L,a as W}from"./index.esm-SBF9nn_P.js";import{S as V,C as x,P as f}from"./ProviderRadio-C6pLVNxC.js";import{S as N}from"./WizardFooter-DQEnlDmZ.js";import{R as H,a as O,E as $,C as G}from"./Partials-DosysQMU.js";import{b as Q,a as Y}from"./persist-Dkbp9MFP.js";import{S as q}from"./logs-lNLbZqHL.js";import{C as j}from"./CodeSnippet-B7Wd4R8u.js";import{N as w}from"./NumberBox-C2Pju4PR.js";import{s as E}from"./index-BYHxFvoG.js";import{b as D}from"./@tanstack-Dwlisomv.js";import{c as J}from"./@react-router-CHjLNlgw.js";import{C as h}from"./ProviderIcon-aQjTuTRX.js";import"./Tick-BQ7_xDBl.js";import"./check-C9Nye5lR.js";import"./info-CI2szPUG.js";import"./@reactflow-gbyyU3kq.js";import"./package-pR4bbXJp.js";import"./credit-card-DfBA6dBb.js";import"./ComponentBadge-MVT08kBV.js";import"./ComponentIcon-C9AY8usJ.js";import"./bar-chart-square-check-_m-oYysN.js";import"./layout-GIiNvS10.js";import"./transform-S7omcvTm.js";import"./sharedSchema-Br1JPr8d.js";import"./index.es-CZMSrR6z.js";import"./stack-detail-query-DnyMCdVE.js";const R=l.createContext(null);function K({children:r}){const{setCurrentStep:t}=m(),[i,s]=l.useState({}),[o,c]=l.useState("");return l.useEffect(()=>{const{success:a,data:n}=C();if(a){t(3),s({location:n.location,provider:n.provider,stackName:n.stackName}),c(n.timestamp);return}t(1)},[C]),e.jsx(R.Provider,{value:{data:i,setData:s,timestamp:o,setTimestamp:c},children:r})}function d(){const r=l.useContext(R);if(r===null)throw new Error("useCreateTerraformContext must be used within an CreateTerraformContext");return r}function U(){const{setData:r,data:t,setTimestamp:i}=d(),{setCurrentStep:s}=m(),o=T({resolver:z(Q,{async:!0}),defaultValues:{region:t.location||"",stackName:t.stackName||""}});function c(a){const n=new Date().toISOString().slice(0,-1);M({location:a.region,provider:t.provider||"aws",stackName:a.stackName,timestamp:n}),i(n),r(u=>({...u,location:a.region,stackName:a.stackName})),s(u=>u+1)}return e.jsx(L,{...o,children:e.jsxs(v,{children:[e.jsx(g,{children:"Review Stack Configuration"}),e.jsx(y,{children:e.jsxs("div",{className:"space-y-5",children:[e.jsxs(b,{className:"text-text-sm",children:[e.jsx("p",{className:"font-semibold",children:"Important"}),e.jsx("p",{children:"This will create new resources in your account. Ensure you have the necessary permissions and are aware of any potential costs."})]}),e.jsxs("form",{id:"configuration-form",onSubmit:o.handleSubmit(c),className:"space-y-5",children:[e.jsx(H,{provider:t.provider||"aws"}),e.jsx(V,{})]}),e.jsx(O,{provider:t.provider||"aws"}),e.jsx($,{provider:t.provider||"aws"})]})}),e.jsx(N,{children:e.jsx(X,{})})]})})}function X(){const{formState:{isSubmitting:r}}=W();return e.jsx(p,{disabled:r,form:"configuration-form",size:"md",children:"Next"})}function ee(){return e.jsxs("div",{className:"space-y-5",children:[e.jsx("div",{className:"space-y-1",children:e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(w,{children:"3"}),e.jsx("span",{className:"text-text-lg font-semibold",children:"Run the following commands"})]})}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-text-sm text-theme-text-secondary",children:"Initialize the Terraform configuration."}),e.jsx(j,{code:"terraform init --upgrade"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-text-sm text-theme-text-secondary",children:"Run terraform apply to deploy the ZenML stack to Azure."}),e.jsx(j,{code:"terraform apply"})]})]})}function re(){const{data:r,timestamp:t}=d(),{setCurrentStep:i}=m(),s=D({...E.stackDeploymentStack({provider:r.provider,stack_name:r.stackName,date_start:t,terraform:!0}),refetchInterval:5e3,throwOnError:!0});return l.useEffect(()=>{s.data&&(k(),i(o=>o+1))},[s.data]),{fullstackDeployment:s,data:r}}function te(){const{fullstackDeployment:r,data:t}=re();return r.isError?e.jsx("p",{children:"Error fetching Terraform Command"}):r.isPending?e.jsx(P,{className:"h-[200px] w-full"}):e.jsx(ae,{provider:t.provider||"aws",stackName:t.stackName||""})}function se(){return e.jsxs("section",{className:"space-y-5 border-t border-theme-border-moderate pt-5",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("p",{className:"flex items-center gap-1 text-text-lg font-semibold",children:[e.jsx(A,{className:"h-5 w-5 fill-primary-400"}),"Waiting for your Terraform script to finish..."]}),e.jsx("p",{className:"text-theme-text-secondary",children:"We are detecting whether your Terraform script ran through successfully. Once the terraform script has finished successfully, come back to check your brand new stack and components ready."})]}),e.jsx(te,{})]})}function ae({stackName:r,provider:t}){return e.jsxs("div",{className:"relative overflow-hidden rounded-md",children:[e.jsx("div",{className:"absolute z-50 h-full w-full bg-neutral-50/50"}),e.jsx(G,{type:t,componentProps:{isLoading:!0,isSuccess:!1,stackName:r}})]})}function oe(){return e.jsxs(v,{children:[e.jsx(g,{children:"Deploy ZenML Stack"}),e.jsx(y,{children:e.jsxs("section",{className:"space-y-5",children:[e.jsx(ne,{}),e.jsx(de,{}),e.jsx(me,{}),e.jsx(ee,{}),e.jsx(se,{})]})}),e.jsxs(N,{displayCancel:!1,children:[e.jsx(ue,{}),e.jsx(ie,{})]})]})}function ie(){return e.jsx(p,{disabled:!0,size:"md",children:"Next"})}function ne(){return e.jsxs("div",{className:"space-y-1",children:[e.jsxs("p",{className:"flex items-center gap-1 text-text-lg font-semibold",children:[e.jsx(q,{className:"h-5 w-5 fill-primary-400"}),"Configuration"]}),e.jsx("p",{className:"text-theme-text-secondary",children:"Follow the steps to deploy your Stack."})]})}function ce(r){switch(r){case"aws":return"https://aws.amazon.com/cli/";case"azure":return"https://learn.microsoft.com/en-us/cli/azure/";case"gcp":return"https://cloud.google.com/sdk/gcloud"}}function le(r){switch(r){case"aws":return"AWS";case"gcp":return"gcloud";case"azure":return"Azure"}}function de(){const{data:r}=d();return e.jsx("div",{className:"space-y-5",children:e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(w,{children:"1"}),e.jsxs("span",{className:"text-text-lg font-semibold",children:["Login locally with the ",le(r.provider||"aws")," CLI"]})]}),e.jsx("p",{className:"text-theme-text-secondary",children:"Make sure you are logged in locally with an account with appropriate permissions."}),e.jsx(p,{asChild:!0,className:"w-fit gap-1",intent:"secondary",emphasis:"subtle",size:"md",children:e.jsxs("a",{rel:"noopener noreferrer",target:"_blank",href:ce(r.provider||"aws"),children:[e.jsx("span",{children:"Learn More"}),e.jsx(F,{className:"h-5 w-5 shrink-0 fill-primary-900"})]})})]})})}function me(){const{data:r}=d();return e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(w,{children:"2"}),e.jsx("span",{className:"text-text-lg font-semibold",children:"Create a file with the following configuration"})]}),e.jsxs("p",{className:"text-theme-text-secondary",children:["Create a file named ",e.jsx("code",{className:"font-mono text-primary-400",children:"main.tf"})," in the Cloud Shell and copy and paste the Terraform configuration below into it."]})]}),r.provider==="gcp"&&e.jsxs(b,{intent:"warning",children:["Please replace ",e.jsx("code",{className:"font-mono text-primary-400",children:"project_id"})," in the following Terraform script with your own one."]}),e.jsx(pe,{})]})}function pe(){const{data:r}=d(),t=D({...E.stackDeploymentConfig({provider:r.provider||"aws",terraform:!0,stack_name:r.stackName,location:r.location}),enabled:!!r.stackName});return t.isError?null:t.isPending?e.jsx(P,{className:"h-[200px] w-full"}):e.jsx(j,{fullWidth:!0,highlightCode:!0,codeClasses:"whitespace-pre-wrap word-break-all",wrap:!0,code:t.data.configuration||""})}function ue(){const r=J();function t(){k(),r(Z.stacks.create.index)}return e.jsx(p,{onClick:()=>t(),intent:"secondary",size:"md",children:"Cancel"})}const xe=_.object({provider:Y});function fe(){const{setData:r,data:t}=d(),{setCurrentStep:i}=m(),s=T({resolver:z(xe),defaultValues:{provider:t.provider||void 0}});function o(c){r(a=>({...a,provider:c.provider})),i(a=>a+1)}return e.jsx(L,{...s,children:e.jsxs(v,{children:[e.jsx(g,{children:"New Cloud infrastructure"}),e.jsx(y,{children:e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-text-lg font-semibold",children:"Select a Cloud Provider"}),e.jsx("p",{className:"text-theme-text-secondary",children:"Select the cloud provider where your want to create your infrastructure. You will be able to remove the ZenML stack at any time."})]}),e.jsxs("form",{id:"provider-form",onSubmit:s.handleSubmit(o),className:"grid grid-cols-1 gap-3 xl:grid-cols-3",children:[e.jsx(x,{id:"aws-provider",...s.register("provider"),value:"aws",children:e.jsx(f,{icon:e.jsx(h,{provider:"aws",className:"h-6 w-6 shrink-0"}),title:"AWS",subtitle:"Connect your existing S3, ECR, and Sagemaker components to ZenML"})}),e.jsx(x,{id:"gcp-provider",...s.register("provider"),value:"gcp",children:e.jsx(f,{icon:e.jsx(h,{provider:"gcp",className:"h-6 w-6 shrink-0"}),title:"GCP",subtitle:"Link your GCS, Artifact Registry, and Vertex AI components to ZenML"})}),e.jsx(x,{id:"azure-provider",...s.register("provider"),value:"azure",children:e.jsx(f,{icon:e.jsx(h,{provider:"azure",className:"h-6 w-6 shrink-0"}),title:"Azure",subtitle:"Integrate ZenML with your Blob Storage, Container Registry, and Azure ML"})})]})]})}),e.jsx(N,{children:e.jsx(he,{})})]})})}function he(){const{formState:{isValid:r}}=W();return e.jsx(p,{form:"provider-form",disabled:!r,size:"md",children:"Next"})}function je(){const{currentStep:r}=m();if(r===1)return e.jsx(fe,{});if(r===2)return e.jsx(U,{});if(r===3)return e.jsx(oe,{})}const S=["Infrastructure Type","Cloud Provider","Review Configuration","Deploy Stack"];function Ke(){return e.jsx(B,{maxSteps:S.length,initialStep:0,children:e.jsx(K,{children:e.jsxs("section",{className:"layout-container flex flex-col gap-5 py-5 xl:flex-row",children:[e.jsx(I,{entries:S}),e.jsx("div",{className:"w-full overflow-y-hidden",children:e.jsx(je,{})})]})})})}export{Ke as default};
@@ -1 +1 @@
1
- import{j as e,r as f}from"./@radix-C_LirfyT.js";import{z as d,y as x,E as h,X as b,v as j,F as p,j as m,s as S,N as D,B as E,t as P,ac as C}from"./index-BacoJBEQ.js";import{f as _}from"./@react-router-BSsrkPOd.js";import{E as F}from"./EmptyState-DG0m-CGv.js";import{b as T,c as k}from"./@tanstack-C0SeHZng.js";import{E as I}from"./Error-DcVLcrLs.js";import{t as A}from"./zod-DgEcN9jD.js";import{u as V,C as z}from"./index.esm-COnaHLSh.js";import{S as q}from"./check-circle-mnEgPhPF.js";import"./@reactflow-D9hglKLF.js";const B=d.object({device_id:d.string().optional(),user_code:d.string().optional()});function Y(){const[s]=_(),{device_id:t,user_code:i}=B.parse({device_id:s.get("device_id")||void 0,user_code:s.get("user_code")||void 0});return{user_code:i,device_id:t}}const K=d.object({trustDevice:d.boolean()});function L({deviceId:s,queryParams:t}){return["devices",s,t]}async function R({deviceId:s,queryParams:t}){const i=x(h.devices.detail(s)+"?"+b(t)),r=await j(i,{method:"GET",credentials:"include",headers:{"Content-Type":"application/json"}});if(!r.ok)throw new p({message:"Error while fetching Device details",status:r.status,statusText:r.statusText});return r.json()}function W(s,t){return T({queryKey:L(s),queryFn:async()=>R(s),...t})}function G({device:s}){var t,i,r,a,c,n;return e.jsx(m,{className:"w-full p-5",children:e.jsxs("dl",{className:"flex flex-col gap-5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("dt",{children:"IP Address"}),e.jsx("dd",{children:(t=s.body)==null?void 0:t.ip_address})]}),((i=s.metadata)==null?void 0:i.city)&&((r=s.metadata)==null?void 0:r.country)&&e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("dt",{children:"Location"}),e.jsxs("dd",{children:[(a=s.metadata)==null?void 0:a.city,", ",(c=s.metadata)==null?void 0:c.country]})]}),e.jsxs("div",{className:"flex min-w-0 items-center justify-between",children:[e.jsx("dt",{children:"Hostname"}),e.jsx("dd",{className:"truncate",children:(n=s.body)==null?void 0:n.hostname})]})]})})}async function H({deviceId:s,payload:t}){const i=x(h.devices.verify(s)),r=await j(i,{method:"PUT",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!r.ok){const a=await r.json().then(c=>c.detail).catch(()=>["","Failed to verify device."]);throw new p({status:r.status,statusText:r.statusText,message:a[1]||"Failed to verify device."})}return r.json()}function J(s){return k({mutationFn:async t=>H(t),...s})}function M({deviceId:s,user_code:t,setSuccess:i}){const r=f.useId(),{handleSubmit:a,formState:{isValid:c},control:n}=V({resolver:A(K),defaultValues:{trustDevice:!1}}),{toast:l}=S(),{mutate:v,isPending:y}=J({onSuccess:()=>{i(!0)},onError:o=>{o instanceof Error&&l({status:"error",emphasis:"subtle",icon:e.jsx(P,{className:"h-5 w-5 shrink-0 fill-error-700"}),description:o.message,rounded:!0})}});function g(o){v({deviceId:s,payload:{user_code:t,trusted_device:o.trustDevice}})}return e.jsxs("form",{onSubmit:a(g),className:"flex flex-col gap-5",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(z,{control:n,name:"trustDevice",render:({field:{onChange:o,value:w}})=>e.jsx(D,{checked:w,onCheckedChange:N=>o(!!N),id:r})}),e.jsxs("label",{htmlFor:r,children:[e.jsx("p",{children:"Trust this device"}),e.jsx("p",{className:"text-theme-text-secondary",children:"We won't ask you again soon on this device."})]})]}),e.jsx(E,{disabled:y||!c,size:"md",className:"flex w-full justify-center",children:"Authorize this device"})]})}function O(){return e.jsxs(m,{className:"flex min-w-[540px] flex-col items-center justify-center space-y-7 px-7 py-9",children:[e.jsx(q,{className:"h-[120px] w-[120px] fill-theme-text-success"}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-display-xs font-semibold",children:"You successfully added your device"}),e.jsx("p",{className:"text-theme-text-secondary",children:"You may close this screen and return to your CLI."})]})]})}function ae(){const{device_id:s,user_code:t}=Y(),[i,r]=f.useState(!1),{data:a,isPending:c,isError:n,error:l}=W({deviceId:s,queryParams:{user_code:t}},{enabled:!!s&&!!t});return!s||!t?e.jsx(F,{children:e.jsx("p",{children:"Invalid device verification link."})}):n?e.jsx(u,{children:e.jsx(I,{isAlertCircle:!0,err:l})}):c?e.jsx(u,{children:e.jsx(C,{})}):i?e.jsx(O,{}):e.jsx(u,{children:e.jsxs("div",{className:"w-full space-y-7",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("h1",{className:"mb-0.5 text-display-xs font-semibold",children:"Authorize a new device"}),e.jsx("p",{className:"text-theme-text-secondary",children:"You are logging in from a new device."})]}),e.jsx(G,{device:a}),e.jsx(M,{setSuccess:r,deviceId:s,user_code:t})]})})}function u({children:s}){return e.jsx(m,{className:"flex w-full min-w-[540px] flex-col items-center justify-center gap-5 p-7",children:s})}export{ae as default};
1
+ import{j as e,r as f}from"./@radix-B1sy0Lhr.js";import{z as d,F as x,H as h,Z as N,x as j,G as p,k as m,v as S,Q as D,B as P,w as C,a7 as E}from"./index-CO6UN3UX.js";import{f as _}from"./@react-router-CHjLNlgw.js";import{E as k}from"./EmptyState-BMA34iVR.js";import{b as F,c as T}from"./@tanstack-Dwlisomv.js";import{E as I}from"./Error-Cakgjexo.js";import{t as A}from"./zod-D48zuELD.js";import{u as V,C as z}from"./index.esm-SBF9nn_P.js";import{S as q}from"./check-circle-CG6XAdk-.js";import"./@reactflow-gbyyU3kq.js";const B=d.object({device_id:d.string().optional(),user_code:d.string().optional()});function Y(){const[s]=_(),{device_id:t,user_code:i}=B.parse({device_id:s.get("device_id")||void 0,user_code:s.get("user_code")||void 0});return{user_code:i,device_id:t}}const G=d.object({trustDevice:d.boolean()});function H({deviceId:s,queryParams:t}){return["devices",s,t]}async function K({deviceId:s,queryParams:t}){const i=x(h.devices.detail(s)+"?"+N(t)),r=await j(i,{method:"GET",credentials:"include",headers:{"Content-Type":"application/json"}});if(!r.ok)throw new p({message:"Error while fetching Device details",status:r.status,statusText:r.statusText});return r.json()}function L(s,t){return F({queryKey:H(s),queryFn:async()=>K(s),...t})}function Q({device:s}){var t,i,r,a,c,n;return e.jsx(m,{className:"w-full p-5",children:e.jsxs("dl",{className:"flex flex-col gap-5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("dt",{children:"IP Address"}),e.jsx("dd",{children:(t=s.body)==null?void 0:t.ip_address})]}),((i=s.metadata)==null?void 0:i.city)&&((r=s.metadata)==null?void 0:r.country)&&e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("dt",{children:"Location"}),e.jsxs("dd",{children:[(a=s.metadata)==null?void 0:a.city,", ",(c=s.metadata)==null?void 0:c.country]})]}),e.jsxs("div",{className:"flex min-w-0 items-center justify-between",children:[e.jsx("dt",{children:"Hostname"}),e.jsx("dd",{className:"truncate",children:(n=s.body)==null?void 0:n.hostname})]})]})})}async function R({deviceId:s,payload:t}){const i=x(h.devices.verify(s)),r=await j(i,{method:"PUT",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!r.ok){const a=await r.json().then(c=>c.detail).catch(()=>["","Failed to verify device."]);throw new p({status:r.status,statusText:r.statusText,message:a[1]||"Failed to verify device."})}return r.json()}function W(s){return T({mutationFn:async t=>R(t),...s})}function J({deviceId:s,user_code:t,setSuccess:i}){const r=f.useId(),{handleSubmit:a,formState:{isValid:c},control:n}=V({resolver:A(G),defaultValues:{trustDevice:!1}}),{toast:l}=S(),{mutate:v,isPending:y}=W({onSuccess:()=>{i(!0)},onError:o=>{o instanceof Error&&l({status:"error",emphasis:"subtle",icon:e.jsx(C,{className:"h-5 w-5 shrink-0 fill-error-700"}),description:o.message,rounded:!0})}});function g(o){v({deviceId:s,payload:{user_code:t,trusted_device:o.trustDevice}})}return e.jsxs("form",{onSubmit:a(g),className:"flex flex-col gap-5",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(z,{control:n,name:"trustDevice",render:({field:{onChange:o,value:w}})=>e.jsx(D,{checked:w,onCheckedChange:b=>o(!!b),id:r})}),e.jsxs("label",{htmlFor:r,children:[e.jsx("p",{children:"Trust this device"}),e.jsx("p",{className:"text-theme-text-secondary",children:"We won't ask you again soon on this device."})]})]}),e.jsx(P,{disabled:y||!c,size:"md",className:"flex w-full justify-center",children:"Authorize this device"})]})}function M(){return e.jsxs(m,{className:"flex min-w-[540px] flex-col items-center justify-center space-y-7 px-7 py-9",children:[e.jsx(q,{className:"h-[120px] w-[120px] fill-theme-text-success"}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-display-xs font-semibold",children:"You successfully added your device"}),e.jsx("p",{className:"text-theme-text-secondary",children:"You may close this screen and return to your CLI."})]})]})}function ae(){const{device_id:s,user_code:t}=Y(),[i,r]=f.useState(!1),{data:a,isPending:c,isError:n,error:l}=L({deviceId:s,queryParams:{user_code:t}},{enabled:!!s&&!!t});return!s||!t?e.jsx(k,{children:e.jsx("p",{children:"Invalid device verification link."})}):n?e.jsx(u,{children:e.jsx(I,{isAlertCircle:!0,err:l})}):c?e.jsx(u,{children:e.jsx(E,{})}):i?e.jsx(M,{}):e.jsx(u,{children:e.jsxs("div",{className:"w-full space-y-7",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("h1",{className:"mb-0.5 text-display-xs font-semibold",children:"Authorize a new device"}),e.jsx("p",{className:"text-theme-text-secondary",children:"You are logging in from a new device."})]}),e.jsx(Q,{device:a}),e.jsx(J,{setSuccess:r,deviceId:s,user_code:t})]})})}function u({children:s}){return e.jsx(m,{className:"flex w-full min-w-[540px] flex-col items-center justify-center gap-5 p-7",children:s})}export{ae as default};
@@ -1 +1 @@
1
- import{j as e,r as u}from"./@radix-C_LirfyT.js";import{v as p,y as f,F as y,E as j,aA as g,aC as v,ac as N,B as l,ax as m,aW as d,aV as b,d as w,C,n as k,o as S,p as D,t as E}from"./index-BacoJBEQ.js";import{S as P}from"./chevron-down-Z3nUe-0U.js";import{I as _}from"./Infobox-DFCWPbMb.js";import{c as F,b as R}from"./@tanstack-C0SeHZng.js";import{a as T}from"./@react-router-BSsrkPOd.js";import{F as V}from"./icon-hDriJUXY.js";import"./@reactflow-D9hglKLF.js";import"./info-CyMih3vQ.js";async function z({connectorId:s}){const t=f(j.serviceConnectors.verifyExisting(s)),n=await p(t,{method:"PUT",headers:{"Content-Type":"application/json"}});if(!n.ok){const r=await n.json().then(i=>Array.isArray(i.detail)?i.detail[1]:i.detail).catch(()=>"Failed to verify connector");throw new y({status:n.status,statusText:n.statusText,message:r})}return n.json()}function O(s){return F({...s,mutationFn:async({connectorId:t})=>z({connectorId:t})})}const A="/assets/connectivity-4UKGMYnr.webp";function B({open:s,isLoading:t,isError:n,onClose:r,onSuccess:i,data:c}){const a=!!(c!=null&&c.error),o=(c==null?void 0:c.error)??void 0;return e.jsx(g,{open:s,children:e.jsx(v,{onPointerDownOutside:x=>t?x.preventDefault():r==null?void 0:r(),onEscapeKeyDown:x=>t?x.preventDefault():r==null?void 0:r(),className:"max-w-[540px] p-8",children:e.jsxs("div",{className:"flex w-full flex-col items-center justify-center space-y-5",children:[t&&!c&&e.jsx(I,{onClose:r}),!t&&!n&&!a&&e.jsx(Q,{onSuccess:i}),!t&&(n||a)&&e.jsx(W,{error:o,onClose:r})]})})})}function I({onClose:s}){return e.jsxs(e.Fragment,{children:[e.jsx(N,{}),e.jsxs("div",{className:"space-y-2 text-center",children:[e.jsx("p",{className:"text-display-xs font-semibold",children:"Verifying your service connector"}),e.jsxs("p",{className:"text-text-lg text-theme-text-secondary",children:["Please wait while we check your connection ",e.jsx("br",{}),"This may take up to a minute."]})]}),e.jsx(l,{size:"md",emphasis:"subtle",onClick:s,intent:"secondary",className:"mt-4",children:"Cancel"})]})}function Q({onSuccess:s}){return e.jsxs(e.Fragment,{children:[e.jsx(m,{width:180,height:180,className:"fill-theme-text-success"}),e.jsxs("div",{className:"space-y-2 text-center",children:[e.jsx("p",{className:"text-display-xs font-semibold",children:"Connection verified successfully!"}),e.jsx("p",{className:"text-text-lg text-theme-text-secondary",children:"Ready to show your available resources"})]}),e.jsx(l,{size:"md",onClick:s,className:"mt-4",children:"Display Resources"})]})}function W({onClose:s,error:t}){return e.jsxs(e.Fragment,{children:[e.jsx("img",{src:A,alt:"Connectivity",width:180,height:180}),e.jsxs("div",{className:"space-y-2 text-center",children:[e.jsx("p",{className:"text-display-xs font-semibold",children:"We couldn't verify your connection"}),t&&e.jsx("p",{className:"max-h-[250px] overflow-auto rounded-md border border-theme-border-moderate bg-theme-surface-secondary p-1 text-left font-mono",children:t}),e.jsx("p",{className:"text-text-lg text-theme-text-secondary",children:"Please try again to list your resources"})]}),e.jsx(l,{size:"md",emphasis:"subtle",onClick:s,intent:"secondary",className:"mt-4",children:"Close"})]})}function h({children:s}){const{setResources:t}=d(),{connectorId:n}=T(),r=R({...b.serviceConnectorDetail(n),throwOnError:!0}),[i,c]=u.useState(!1),a=O();if(r.isPending)return e.jsx(w,{className:"h-7 w-[150px]"});if(r.isError)return null;const o=()=>{c(!1)};return e.jsxs(e.Fragment,{children:[e.jsx(B,{data:a.data,open:i,isLoading:a.isPending,isError:a.isError,onClose:o,onSuccess:()=>{a.data&&(t(a.data),c(!1))}}),e.jsxs(l,{disabled:a.isPending&&i,onClick:()=>{c(!0),a.mutate({connectorId:n})},className:"gap-1",size:"md",children:[e.jsx(m,{width:24,height:24,className:"size-5 shrink-0 fill-white"}),s]})]})}function K(){var n;const{resources:s}=d();if(!s)return null;const t=s.connector_type;return!t||typeof t=="string"?null:e.jsxs("div",{className:"space-y-5",children:[e.jsx("div",{className:"flex justify-end",children:e.jsx(h,{children:e.jsx("span",{children:"Reverify now"})})}),(n=s.resources)==null?void 0:n.map(r=>{var i,c;return e.jsx(M,{title:(i=t.resource_types.find(a=>a.resource_type===r.resource_type))==null?void 0:i.name,logoUrl:((c=t.resource_types.find(a=>a.resource_type===r.resource_type))==null?void 0:c.logo_url)??void 0,resource:r},r.resource_type)})]})}function M({resource:s,title:t,logoUrl:n}){const[r,i]=u.useState(!0),c=s.error,a=s.resource_ids??[];return e.jsxs(C,{open:r,onOpenChange:i,children:[e.jsx(k,{className:"flex items-center gap-[10px]",children:e.jsxs(S,{className:"flex w-full items-center gap-[10px] text-text-lg",children:[e.jsx(P,{className:` ${r?"":"-rotate-90"} h-5 w-5 rounded-md fill-neutral-500 transition-transform duration-200 hover:bg-neutral-200`}),t||s.resource_type]})}),e.jsx(D,{className:"space-y-5 border-t border-theme-border-moderate bg-theme-surface-primary",children:c?e.jsx("div",{className:"p-5",children:e.jsx(_,{intent:"error",children:c})}):e.jsx("ul",{className:"divide-y divide-theme-border-moderate",children:a.map(o=>e.jsxs("li",{className:"flex items-center space-x-2 py-3 pl-8",children:[!!n&&e.jsx("img",{width:24,height:24,src:n,alt:t,className:"size-5 shrink-0"}),e.jsx("span",{children:o})]},o))})})]})}function U(){return e.jsx("div",{className:"p-9",children:e.jsxs("div",{className:"flex flex-col items-center space-y-5",children:[e.jsx(V,{icon:e.jsx(E,{className:"h-[36px] w-[36px] fill-primary-400"})}),e.jsxs("div",{className:"space-y-2 text-center",children:[e.jsx("p",{className:"text-display-xs font-semibold",children:"Please verify your service connector"}),e.jsxs("p",{className:"text-text-lg text-theme-text-secondary",children:["We'll check your connection and load available resources.",e.jsx("br",{}),"This may take up to a minute."]})]}),e.jsx(h,{children:e.jsx("span",{children:"Verify now"})})]})})}function ee(){const{resources:s}=d();return s===null?e.jsx(U,{}):e.jsx(K,{})}export{ee as default};
1
+ import{j as e,r as u}from"./@radix-B1sy0Lhr.js";import{x as p,F as f,G as y,H as j,aH as g,aJ as v,a7 as N,B as l,ay as m,a_ as d,aZ as b,d as w,C,o as k,p as S,q as D,w as P}from"./index-CO6UN3UX.js";import{S as _}from"./chevron-down-Bl7WwQAL.js";import{I as E}from"./Infobox-DnduZjNU.js";import{c as F,b as R}from"./@tanstack-Dwlisomv.js";import{a as T}from"./@react-router-CHjLNlgw.js";import{F as z}from"./icon--Tp6obFZ.js";import"./@reactflow-gbyyU3kq.js";import"./info-CI2szPUG.js";async function O({connectorId:s}){const t=f(j.serviceConnectors.verifyExisting(s)),n=await p(t,{method:"PUT",headers:{"Content-Type":"application/json"}});if(!n.ok){const r=await n.json().then(i=>Array.isArray(i.detail)?i.detail[1]:i.detail).catch(()=>"Failed to verify connector");throw new y({status:n.status,statusText:n.statusText,message:r})}return n.json()}function V(s){return F({...s,mutationFn:async({connectorId:t})=>O({connectorId:t})})}const B="/assets/connectivity-4UKGMYnr.webp";function I({open:s,isLoading:t,isError:n,onClose:r,onSuccess:i,data:a}){const c=!!(a!=null&&a.error),o=(a==null?void 0:a.error)??void 0;return e.jsx(g,{open:s,children:e.jsx(v,{onPointerDownOutside:x=>t?x.preventDefault():r==null?void 0:r(),onEscapeKeyDown:x=>t?x.preventDefault():r==null?void 0:r(),className:"max-w-[540px] p-8",children:e.jsxs("div",{className:"flex w-full flex-col items-center justify-center space-y-5",children:[t&&!a&&e.jsx(A,{onClose:r}),!t&&!n&&!c&&e.jsx(H,{onSuccess:i}),!t&&(n||c)&&e.jsx(Q,{error:o,onClose:r})]})})})}function A({onClose:s}){return e.jsxs(e.Fragment,{children:[e.jsx(N,{}),e.jsxs("div",{className:"space-y-2 text-center",children:[e.jsx("p",{className:"text-display-xs font-semibold",children:"Verifying your service connector"}),e.jsxs("p",{className:"text-text-lg text-theme-text-secondary",children:["Please wait while we check your connection ",e.jsx("br",{}),"This may take up to a minute."]})]}),e.jsx(l,{size:"md",emphasis:"subtle",onClick:s,intent:"secondary",className:"mt-4",children:"Cancel"})]})}function H({onSuccess:s}){return e.jsxs(e.Fragment,{children:[e.jsx(m,{width:180,height:180,className:"fill-theme-text-success"}),e.jsxs("div",{className:"space-y-2 text-center",children:[e.jsx("p",{className:"text-display-xs font-semibold",children:"Connection verified successfully!"}),e.jsx("p",{className:"text-text-lg text-theme-text-secondary",children:"Ready to show your available resources"})]}),e.jsx(l,{size:"md",onClick:s,className:"mt-4",children:"Display Resources"})]})}function Q({onClose:s,error:t}){return e.jsxs(e.Fragment,{children:[e.jsx("img",{src:B,alt:"Connectivity",width:180,height:180}),e.jsxs("div",{className:"space-y-2 text-center",children:[e.jsx("p",{className:"text-display-xs font-semibold",children:"We couldn't verify your connection"}),t&&e.jsx("p",{className:"max-h-[250px] overflow-auto rounded-md border border-theme-border-moderate bg-theme-surface-secondary p-1 text-left font-mono",children:t}),e.jsx("p",{className:"text-text-lg text-theme-text-secondary",children:"Please try again to list your resources"})]}),e.jsx(l,{size:"md",emphasis:"subtle",onClick:s,intent:"secondary",className:"mt-4",children:"Close"})]})}function h({children:s}){const{setResources:t}=d(),{connectorId:n}=T(),r=R({...b.serviceConnectorDetail(n),throwOnError:!0}),[i,a]=u.useState(!1),c=V();if(r.isPending)return e.jsx(w,{className:"h-7 w-[150px]"});if(r.isError)return null;const o=()=>{a(!1)};return e.jsxs(e.Fragment,{children:[e.jsx(I,{data:c.data,open:i,isLoading:c.isPending,isError:c.isError,onClose:o,onSuccess:()=>{c.data&&(t(c.data),a(!1))}}),e.jsxs(l,{disabled:c.isPending&&i,onClick:()=>{a(!0),c.mutate({connectorId:n})},className:"gap-1",size:"md",children:[e.jsx(m,{width:24,height:24,className:"size-5 shrink-0 fill-white"}),s]})]})}function G(){var n;const{resources:s}=d();if(!s)return null;const t=s.connector_type;return!t||typeof t=="string"?null:e.jsxs("div",{className:"space-y-5",children:[e.jsx("div",{className:"flex justify-end",children:e.jsx(h,{children:e.jsx("span",{children:"Reverify now"})})}),(n=s.resources)==null?void 0:n.map(r=>{var i,a;return e.jsx(K,{title:(i=t.resource_types.find(c=>c.resource_type===r.resource_type))==null?void 0:i.name,logoUrl:((a=t.resource_types.find(c=>c.resource_type===r.resource_type))==null?void 0:a.logo_url)??void 0,resource:r},r.resource_type)})]})}function K({resource:s,title:t,logoUrl:n}){const[r,i]=u.useState(!0),a=s.error,c=s.resource_ids??[];return e.jsxs(C,{open:r,onOpenChange:i,children:[e.jsx(k,{className:"flex items-center gap-[10px]",children:e.jsxs(S,{className:"flex w-full items-center gap-[10px] text-text-lg",children:[e.jsx(_,{className:` ${r?"":"-rotate-90"} h-5 w-5 rounded-md fill-neutral-500 transition-transform duration-200 hover:bg-neutral-200`}),t||s.resource_type]})}),e.jsx(D,{className:"space-y-5 border-t border-theme-border-moderate bg-theme-surface-primary",children:a?e.jsx("div",{className:"p-5",children:e.jsx(E,{intent:"error",children:a})}):e.jsx("ul",{className:"divide-y divide-theme-border-moderate",children:c.map(o=>e.jsxs("li",{className:"flex items-center space-x-2 py-3 pl-8",children:[!!n&&e.jsx("img",{width:24,height:24,src:n,alt:t,className:"size-5 shrink-0"}),e.jsx("span",{children:o})]},o))})})]})}function M(){return e.jsx("div",{className:"p-9",children:e.jsxs("div",{className:"flex flex-col items-center space-y-5",children:[e.jsx(z,{icon:e.jsx(P,{className:"h-[36px] w-[36px] fill-primary-400"})}),e.jsxs("div",{className:"space-y-2 text-center",children:[e.jsx("p",{className:"text-display-xs font-semibold",children:"Please verify your service connector"}),e.jsxs("p",{className:"text-text-lg text-theme-text-secondary",children:["We'll check your connection and load available resources.",e.jsx("br",{}),"This may take up to a minute."]})]}),e.jsx(h,{children:e.jsx("span",{children:"Verify now"})})]})})}function ee(){const{resources:s}=d();return s===null?e.jsx(M,{}):e.jsx(G,{})}export{ee as default};
@@ -1 +1 @@
1
- import{r as f,j as e}from"./@radix-C_LirfyT.js";import{u as y,W as X,L as $}from"./LeftSideMenu-Czev0KCA.js";import{u,R as ee,a as te,E as se,D as F,G as re,A as ae,C as O,b as oe,N as ne}from"./Partials-DlMzfKgs.js";import{d as V,j as Y,bj as ie,B as ce,r as T}from"./index-BacoJBEQ.js";import{f as de,c as le}from"./@react-router-BSsrkPOd.js";import{S as me,C as v,P as N,a as ue}from"./ProviderRadio-D_q9tE3G.js";import{I as G}from"./Infobox-DFCWPbMb.js";import{t as H}from"./zod-DgEcN9jD.js";import{u as Q,F as pe}from"./index.esm-COnaHLSh.js";import{b as xe,c as q,d as fe,p as he}from"./persist-DxiyfAax.js";import{C as h}from"./ProviderIcon-BMAn9Jld.js";import{s as J}from"./index-dCcVgFNl.js";import{b as K}from"./@tanstack-C0SeHZng.js";import"./Tick-DDeDgTuT.js";import"./check-D1bHMJkL.js";import"./package-BhYXGPxF.js";import"./credit-card-CH1BHrXY.js";import"./ComponentBadge-mw2Ja_ON.js";import"./ComponentIcon-BXgpt-jw.js";import"./bar-chart-square-check-9siI9icm.js";import"./layout-C5dgIReC.js";import"./transform-DFpKTKgF.js";import"./logs-DoLoTEfj.js";import"./CodeSnippet-D8iBqOVv.js";import"./NumberBox-CoQjQYDJ.js";import"./@reactflow-D9hglKLF.js";import"./info-CyMih3vQ.js";import"./sharedSchema-DyUO09BR.js";import"./index.es-DcVFDpJU.js";import"./stack-detail-query-Bc4QKlWg.js";function je(){const{formRef:t,setIsNextButtonDisabled:s,setData:a,data:o}=u(),n=Q({resolver:H(xe),mode:"onChange",defaultValues:{region:o.location,stackName:o.stackName||""}});f.useEffect(()=>{s(!n.formState.isValid)},[n.formState.isValid,s]);function l(r){a(m=>({...m,location:r.region,stackName:r.stackName}))}return e.jsx(j,{title:"Review Stack Configuration",children:e.jsx(pe,{...n,children:e.jsxs("div",{className:"space-y-5",children:[e.jsxs(G,{className:"text-text-sm",children:[e.jsx("p",{className:"font-semibold",children:"Important"}),e.jsx("p",{children:"This will create new resources in your account. Ensure you have the necessary permissions and are aware of any potential costs."})]}),e.jsxs("form",{onSubmit:n.handleSubmit(l),ref:t,className:"space-y-5",children:[e.jsx(ee,{provider:o.provider||"aws"}),e.jsx(me,{})]}),e.jsx(te,{provider:o.provider||"aws"}),e.jsx(se,{provider:o.provider||"aws"})]})})})}function ve(){const{data:t,timestamp:s,setIsNextButtonDisabled:a}=u(),{setCurrentStep:o}=y(),{isPending:n,isError:l,data:r}=K({...J.stackDeploymentStack({provider:t.provider,stack_name:t.stackName,date_start:s}),refetchInterval:5e3,throwOnError:!0});return f.useEffect(()=>{r&&(q(),o(m=>m+1),a(!1))},[r]),n?e.jsx(V,{className:"h-[200px] w-full"}):l?null:e.jsxs("div",{className:"space-y-5",children:[e.jsx(Ne,{}),e.jsx(ye,{stack:r})]})}function Ne(){const{data:t}=u();return e.jsxs("section",{className:"space-y-5 border-b border-theme-border-moderate pb-5",children:[e.jsxs(Y,{className:"flex items-center justify-between gap-4 px-6 py-5",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(h,{provider:t.provider,className:"h-6 w-6 shrink-0"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-text-lg font-semibold",children:"Deploying the Stack..."}),e.jsx("p",{className:"text-theme-text-secondary",children:"Follow the steps in your Cloud console to finish the setup. You can come back to check once your components are deployed."})]})]}),t.provider==="azure"?e.jsx(F,{children:e.jsx("span",{children:"Deploy in Azure"})}):e.jsx(F,{})]}),t.provider==="gcp"&&e.jsx(re,{}),t.provider==="azure"&&e.jsx(ae,{})]})}function ye({stack:t}){const s=!!t;return e.jsxs("div",{className:"space-y-5",children:[!s&&e.jsxs("div",{className:"space-y-1",children:[e.jsxs("p",{className:"flex items-center gap-1 text-text-lg font-semibold",children:[e.jsx(ie,{className:"h-5 w-5 fill-primary-400"}),"Creating your stack and components..."]}),e.jsx("p",{className:"text-theme-text-secondary",children:"We are creating your stack and stack components based on your configuration. Once you finish the setup, come back to check your brand new stack and components ready."})]}),e.jsx(ke,{isReady:s}),e.jsx(ge,{stack:t})]})}function ge({stack:t}){const s=!!t,{data:a}=u();return e.jsxs("div",{className:"relative overflow-hidden rounded-md",children:[!s&&e.jsx("div",{className:"absolute z-50 h-full w-full bg-neutral-50/50"}),e.jsx(O,{type:a.provider,componentProps:{isLoading:!s,isSuccess:s,stackName:a.stackName}})]})}function ke({isReady:t}){const[s,a]=f.useState(!1);return f.useEffect(()=>{const o=setTimeout(()=>{a(!0)},3e5);return()=>clearTimeout(o)},[]),!s||t?null:e.jsx(G,{children:"Your stack is taking longer than usual to deploy. Please check your Cloud console, or the stacks list in ZenML."})}function Se(){return e.jsx(j,{title:"Deploy ZenML Stack",children:e.jsx(be,{})})}function be(){const{setIsNextButtonDisabled:t,isLoading:s}=u();return f.useEffect(()=>{t(!0)},[]),s?e.jsx(ve,{}):e.jsx(oe,{})}function we(){const{formRef:t,setIsNextButtonDisabled:s,setData:a,data:o}=u(),{register:n,handleSubmit:l,formState:{isValid:r}}=Q({resolver:H(fe),defaultValues:{provider:o.provider}});f.useEffect(()=>{s(!r)},[r,s]);function m(d){a(c=>({...c,provider:d.provider}))}return e.jsx(j,{title:"New Cloud Infrastructure",children:e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-text-lg font-semibold",children:"Select a Cloud Provider"}),e.jsx("p",{className:"text-theme-text-secondary",children:"Select the cloud provider where your want to create your infrastructure and deploy your ZenML models. You will be able to remove the ZenML stack at any time."})]}),e.jsxs("form",{id:"provider-form",onSubmit:l(m),className:"grid grid-cols-1 gap-3 xl:grid-cols-3",ref:t,children:[e.jsx(v,{id:"aws-provider",...n("provider"),value:"aws",children:e.jsx(N,{icon:e.jsx(h,{provider:"aws",className:"h-6 w-6 shrink-0"}),title:"AWS",subtitle:"ZenML stack with S3, ECR, and SageMaker integration"})}),e.jsx(v,{id:"gcp-provider",...n("provider"),value:"gcp",children:e.jsx(N,{icon:e.jsx(h,{provider:"gcp",className:"h-6 w-6 shrink-0"}),title:"GCP",subtitle:"Create ZenML infrastructure using GCS, Artifact Registry, and Vertex AI"})}),e.jsx(v,{id:"azure-provider",...n("provider"),value:"azure",children:e.jsx(N,{icon:e.jsx(h,{provider:"azure",className:"h-6 w-6 shrink-0"}),title:"Azure",subtitle:"Set up ZenML with Azure Storage, Container Registry, and ML services"})})]})]})})}function Ce({provider:t,stackName:s,timestamp:a,isTerraform:o}){var g,k,S,b,w,C,P,D,I,z,L,R,B,E,W,M,_,A;const{isPending:n,isError:l,data:r}=K({...J.stackDeploymentStack({provider:t,stack_name:s,date_start:a,terraform:o}),throwOnError:!0});if(n)return e.jsx(V,{className:"h-[200px] w-full"});if(l)return null;const m=r.stack.name,d=(g=r.stack.metadata)==null?void 0:g.components.orchestrator,c=(k=r.stack.metadata)==null?void 0:k.components.artifact_store,i=(S=r.stack.metadata)==null?void 0:S.components.container_registry,p=(b=r.stack.metadata)==null?void 0:b.components.image_builder,x=(w=r.stack.metadata)==null?void 0:w.components.step_operator,U={orchestrator:{name:((C=d==null?void 0:d[0])==null?void 0:C.name)??"Orchestrator",id:((P=d==null?void 0:d[0])==null?void 0:P.id.split("-")[0])??""},artifactStore:{name:((D=c==null?void 0:c[0])==null?void 0:D.name)??"Artifact Store",id:((I=c==null?void 0:c[0])==null?void 0:I.id.split("-")[0])??""},registry:{name:((z=i==null?void 0:i[0])==null?void 0:z.name)??"Container Registry",id:((L=i==null?void 0:i[0])==null?void 0:L.id.split("-")[0])??""},connector:{name:(R=r.service_connector)==null?void 0:R.name,id:((E=(B=r.service_connector)==null?void 0:B.id)==null?void 0:E.split("-")[0])??""},imageBuilder:{name:((W=p==null?void 0:p[0])==null?void 0:W.name)??"Image Builder",id:((M=p==null?void 0:p[0])==null?void 0:M.id.split("-")[0])??""},operator:{name:((_=x==null?void 0:x[0])==null?void 0:_.name)??"Step Operator",id:((A=x==null?void 0:x[0])==null?void 0:A.id.split("-")[0])??""}};return e.jsx(O,{type:t,componentProps:{components:U,isSuccess:!0,stackName:m}})}function Pe(){const{setIsNextButtonDisabled:t,data:s,timestamp:a}=u();return t(!1),e.jsx(j,{title:"Your Stack",children:e.jsxs("div",{className:"space-y-5",children:[e.jsx("p",{className:"text-theme-text-secondary",children:"Here you can review the created stack and stack components. Now you can start running pipelines using this new configuration."}),e.jsx(Ce,{provider:s.provider||"aws",stackName:s.stackName||"",timestamp:a})]})})}function De(){const{currentStep:t}=y();if(t===1)return e.jsx(we,{});if(t===2)return e.jsx(je,{});if(t===3)return e.jsx(Se,{});if(t===4)return e.jsx(Pe,{})}function Ie(){var c;const[s]=de(),{setCurrentStep:a,currentStep:o}=y(),{formRef:n,isNextButtonDisabled:l}=u(),r=le(),m=s.get("origin")==="onboarding";async function d(){n.current&&(n.current.requestSubmit(),await new Promise(i=>setTimeout(i,20))),a(i=>i<4?i+1:i),o===4&&(q(),r(m?T.onboarding:T.stacks.overview))}return e.jsx(ce,{form:(c=n.current)==null?void 0:c.id,disabled:l,onClick:()=>d(),size:"md",children:o===4?"Finish":"Next"})}function j({children:t,title:s}){return e.jsxs(Y,{className:"w-full",children:[e.jsx("div",{className:"border-b border-theme-border-moderate px-5 py-3 text-display-xs font-semibold",children:s}),e.jsx("div",{className:"p-5",children:t}),e.jsxs("div",{className:"flex items-center justify-end gap-2 border-t border-theme-border-moderate p-5",children:[e.jsx(ue,{}),e.jsx(Ie,{})]})]})}const Z=["Infrastructure Type","Cloud Provider","Review Configuration","Deploy Stack"];function nt(){const{success:t}=he();return e.jsx(X,{maxSteps:Z.length,initialStep:t?3:1,children:e.jsx(ne,{children:e.jsxs("section",{className:"layout-container flex flex-col gap-5 p-5 xl:flex-row",children:[e.jsx($,{entries:Z}),e.jsx("div",{className:"w-full overflow-y-hidden",children:e.jsx(De,{})})]})})})}export{nt as default};
1
+ import{r as f,j as e}from"./@radix-B1sy0Lhr.js";import{u as y,W as X,L as $}from"./LeftSideMenu-D5UEs4vB.js";import{u,R as ee,a as te,E as se,D as F,G as re,A as ae,C as O,b as oe,N as ne}from"./Partials-DosysQMU.js";import{d as V,k as Y,bl as ie,B as ce,r as T}from"./index-CO6UN3UX.js";import{f as de,c as le}from"./@react-router-CHjLNlgw.js";import{S as me,C as v,P as N,a as ue}from"./ProviderRadio-C6pLVNxC.js";import{I as G}from"./Infobox-DnduZjNU.js";import{t as H}from"./zod-D48zuELD.js";import{u as Q,F as pe}from"./index.esm-SBF9nn_P.js";import{b as xe,c as q,d as fe,p as he}from"./persist-Dkbp9MFP.js";import{C as h}from"./ProviderIcon-aQjTuTRX.js";import{s as J}from"./index-BYHxFvoG.js";import{b as K}from"./@tanstack-Dwlisomv.js";import"./Tick-BQ7_xDBl.js";import"./check-C9Nye5lR.js";import"./package-pR4bbXJp.js";import"./credit-card-DfBA6dBb.js";import"./ComponentBadge-MVT08kBV.js";import"./ComponentIcon-C9AY8usJ.js";import"./bar-chart-square-check-_m-oYysN.js";import"./layout-GIiNvS10.js";import"./transform-S7omcvTm.js";import"./logs-lNLbZqHL.js";import"./CodeSnippet-B7Wd4R8u.js";import"./NumberBox-C2Pju4PR.js";import"./@reactflow-gbyyU3kq.js";import"./info-CI2szPUG.js";import"./sharedSchema-Br1JPr8d.js";import"./index.es-CZMSrR6z.js";import"./stack-detail-query-DnyMCdVE.js";function je(){const{formRef:t,setIsNextButtonDisabled:s,setData:a,data:o}=u(),n=Q({resolver:H(xe),mode:"onChange",defaultValues:{region:o.location,stackName:o.stackName||""}});f.useEffect(()=>{s(!n.formState.isValid)},[n.formState.isValid,s]);function l(r){a(m=>({...m,location:r.region,stackName:r.stackName}))}return e.jsx(j,{title:"Review Stack Configuration",children:e.jsx(pe,{...n,children:e.jsxs("div",{className:"space-y-5",children:[e.jsxs(G,{className:"text-text-sm",children:[e.jsx("p",{className:"font-semibold",children:"Important"}),e.jsx("p",{children:"This will create new resources in your account. Ensure you have the necessary permissions and are aware of any potential costs."})]}),e.jsxs("form",{onSubmit:n.handleSubmit(l),ref:t,className:"space-y-5",children:[e.jsx(ee,{provider:o.provider||"aws"}),e.jsx(me,{})]}),e.jsx(te,{provider:o.provider||"aws"}),e.jsx(se,{provider:o.provider||"aws"})]})})})}function ve(){const{data:t,timestamp:s,setIsNextButtonDisabled:a}=u(),{setCurrentStep:o}=y(),{isPending:n,isError:l,data:r}=K({...J.stackDeploymentStack({provider:t.provider,stack_name:t.stackName,date_start:s}),refetchInterval:5e3,throwOnError:!0});return f.useEffect(()=>{r&&(q(),o(m=>m+1),a(!1))},[r]),n?e.jsx(V,{className:"h-[200px] w-full"}):l?null:e.jsxs("div",{className:"space-y-5",children:[e.jsx(Ne,{}),e.jsx(ye,{stack:r})]})}function Ne(){const{data:t}=u();return e.jsxs("section",{className:"space-y-5 border-b border-theme-border-moderate pb-5",children:[e.jsxs(Y,{className:"flex items-center justify-between gap-4 px-6 py-5",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(h,{provider:t.provider,className:"h-6 w-6 shrink-0"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-text-lg font-semibold",children:"Deploying the Stack..."}),e.jsx("p",{className:"text-theme-text-secondary",children:"Follow the steps in your Cloud console to finish the setup. You can come back to check once your components are deployed."})]})]}),t.provider==="azure"?e.jsx(F,{children:e.jsx("span",{children:"Deploy in Azure"})}):e.jsx(F,{})]}),t.provider==="gcp"&&e.jsx(re,{}),t.provider==="azure"&&e.jsx(ae,{})]})}function ye({stack:t}){const s=!!t;return e.jsxs("div",{className:"space-y-5",children:[!s&&e.jsxs("div",{className:"space-y-1",children:[e.jsxs("p",{className:"flex items-center gap-1 text-text-lg font-semibold",children:[e.jsx(ie,{className:"h-5 w-5 fill-primary-400"}),"Creating your stack and components..."]}),e.jsx("p",{className:"text-theme-text-secondary",children:"We are creating your stack and stack components based on your configuration. Once you finish the setup, come back to check your brand new stack and components ready."})]}),e.jsx(ke,{isReady:s}),e.jsx(ge,{stack:t})]})}function ge({stack:t}){const s=!!t,{data:a}=u();return e.jsxs("div",{className:"relative overflow-hidden rounded-md",children:[!s&&e.jsx("div",{className:"absolute z-50 h-full w-full bg-neutral-50/50"}),e.jsx(O,{type:a.provider,componentProps:{isLoading:!s,isSuccess:s,stackName:a.stackName}})]})}function ke({isReady:t}){const[s,a]=f.useState(!1);return f.useEffect(()=>{const o=setTimeout(()=>{a(!0)},3e5);return()=>clearTimeout(o)},[]),!s||t?null:e.jsx(G,{children:"Your stack is taking longer than usual to deploy. Please check your Cloud console, or the stacks list in ZenML."})}function Se(){return e.jsx(j,{title:"Deploy ZenML Stack",children:e.jsx(be,{})})}function be(){const{setIsNextButtonDisabled:t,isLoading:s}=u();return f.useEffect(()=>{t(!0)},[]),s?e.jsx(ve,{}):e.jsx(oe,{})}function we(){const{formRef:t,setIsNextButtonDisabled:s,setData:a,data:o}=u(),{register:n,handleSubmit:l,formState:{isValid:r}}=Q({resolver:H(fe),defaultValues:{provider:o.provider}});f.useEffect(()=>{s(!r)},[r,s]);function m(d){a(c=>({...c,provider:d.provider}))}return e.jsx(j,{title:"New Cloud Infrastructure",children:e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-text-lg font-semibold",children:"Select a Cloud Provider"}),e.jsx("p",{className:"text-theme-text-secondary",children:"Select the cloud provider where your want to create your infrastructure and deploy your ZenML models. You will be able to remove the ZenML stack at any time."})]}),e.jsxs("form",{id:"provider-form",onSubmit:l(m),className:"grid grid-cols-1 gap-3 xl:grid-cols-3",ref:t,children:[e.jsx(v,{id:"aws-provider",...n("provider"),value:"aws",children:e.jsx(N,{icon:e.jsx(h,{provider:"aws",className:"h-6 w-6 shrink-0"}),title:"AWS",subtitle:"ZenML stack with S3, ECR, and SageMaker integration"})}),e.jsx(v,{id:"gcp-provider",...n("provider"),value:"gcp",children:e.jsx(N,{icon:e.jsx(h,{provider:"gcp",className:"h-6 w-6 shrink-0"}),title:"GCP",subtitle:"Create ZenML infrastructure using GCS, Artifact Registry, and Vertex AI"})}),e.jsx(v,{id:"azure-provider",...n("provider"),value:"azure",children:e.jsx(N,{icon:e.jsx(h,{provider:"azure",className:"h-6 w-6 shrink-0"}),title:"Azure",subtitle:"Set up ZenML with Azure Storage, Container Registry, and ML services"})})]})]})})}function Ce({provider:t,stackName:s,timestamp:a,isTerraform:o}){var g,k,S,b,w,C,P,D,I,z,L,R,B,E,W,M,_,A;const{isPending:n,isError:l,data:r}=K({...J.stackDeploymentStack({provider:t,stack_name:s,date_start:a,terraform:o}),throwOnError:!0});if(n)return e.jsx(V,{className:"h-[200px] w-full"});if(l)return null;const m=r.stack.name,d=(g=r.stack.metadata)==null?void 0:g.components.orchestrator,c=(k=r.stack.metadata)==null?void 0:k.components.artifact_store,i=(S=r.stack.metadata)==null?void 0:S.components.container_registry,p=(b=r.stack.metadata)==null?void 0:b.components.image_builder,x=(w=r.stack.metadata)==null?void 0:w.components.step_operator,U={orchestrator:{name:((C=d==null?void 0:d[0])==null?void 0:C.name)??"Orchestrator",id:((P=d==null?void 0:d[0])==null?void 0:P.id.split("-")[0])??""},artifactStore:{name:((D=c==null?void 0:c[0])==null?void 0:D.name)??"Artifact Store",id:((I=c==null?void 0:c[0])==null?void 0:I.id.split("-")[0])??""},registry:{name:((z=i==null?void 0:i[0])==null?void 0:z.name)??"Container Registry",id:((L=i==null?void 0:i[0])==null?void 0:L.id.split("-")[0])??""},connector:{name:(R=r.service_connector)==null?void 0:R.name,id:((E=(B=r.service_connector)==null?void 0:B.id)==null?void 0:E.split("-")[0])??""},imageBuilder:{name:((W=p==null?void 0:p[0])==null?void 0:W.name)??"Image Builder",id:((M=p==null?void 0:p[0])==null?void 0:M.id.split("-")[0])??""},operator:{name:((_=x==null?void 0:x[0])==null?void 0:_.name)??"Step Operator",id:((A=x==null?void 0:x[0])==null?void 0:A.id.split("-")[0])??""}};return e.jsx(O,{type:t,componentProps:{components:U,isSuccess:!0,stackName:m}})}function Pe(){const{setIsNextButtonDisabled:t,data:s,timestamp:a}=u();return t(!1),e.jsx(j,{title:"Your Stack",children:e.jsxs("div",{className:"space-y-5",children:[e.jsx("p",{className:"text-theme-text-secondary",children:"Here you can review the created stack and stack components. Now you can start running pipelines using this new configuration."}),e.jsx(Ce,{provider:s.provider||"aws",stackName:s.stackName||"",timestamp:a})]})})}function De(){const{currentStep:t}=y();if(t===1)return e.jsx(we,{});if(t===2)return e.jsx(je,{});if(t===3)return e.jsx(Se,{});if(t===4)return e.jsx(Pe,{})}function Ie(){var c;const[s]=de(),{setCurrentStep:a,currentStep:o}=y(),{formRef:n,isNextButtonDisabled:l}=u(),r=le(),m=s.get("origin")==="onboarding";async function d(){n.current&&(n.current.requestSubmit(),await new Promise(i=>setTimeout(i,20))),a(i=>i<4?i+1:i),o===4&&(q(),r(m?T.onboarding:T.stacks.overview))}return e.jsx(ce,{form:(c=n.current)==null?void 0:c.id,disabled:l,onClick:()=>d(),size:"md",children:o===4?"Finish":"Next"})}function j({children:t,title:s}){return e.jsxs(Y,{className:"w-full",children:[e.jsx("div",{className:"border-b border-theme-border-moderate px-5 py-3 text-display-xs font-semibold",children:s}),e.jsx("div",{className:"p-5",children:t}),e.jsxs("div",{className:"flex items-center justify-end gap-2 border-t border-theme-border-moderate p-5",children:[e.jsx(ue,{}),e.jsx(Ie,{})]})]})}const Z=["Infrastructure Type","Cloud Provider","Review Configuration","Deploy Stack"];function nt(){const{success:t}=he();return e.jsx(X,{maxSteps:Z.length,initialStep:t?3:1,children:e.jsx(ne,{children:e.jsxs("section",{className:"layout-container flex flex-col gap-5 p-5 xl:flex-row",children:[e.jsx($,{entries:Z}),e.jsx("div",{className:"w-full overflow-y-hidden",children:e.jsx(De,{})})]})})})}export{nt as default};
@@ -0,0 +1 @@
1
+ import{r as p,j as e}from"./@radix-B1sy0Lhr.js";import{S as j}from"./chevron-down-Bl7WwQAL.js";import{D as i}from"./DisplayDate-57lUNS79.js";import{aZ as l,d as c,C as h,o as f,p as g,q as y,T as u,a2 as v}from"./index-CO6UN3UX.js";import{K as o,a as b,V as N,N as C}from"./NestedCollapsible-0yviIfaA.js";import{a as d,e as E,R as T,E as w}from"./service-connectors-nF4-OXB9.js";import{R}from"./resource-tyes-list-CugyWUAE.js";import{b as m}from"./@tanstack-Dwlisomv.js";import{a as x}from"./@react-router-CHjLNlgw.js";import"./@reactflow-gbyyU3kq.js";import"./eye-BXcQevds.js";import"./CollapsibleCard-DSZzbjx5.js";import"./check-circle-CG6XAdk-.js";import"./CodeSnippet-B7Wd4R8u.js";function P(){const[a,r]=p.useState(!0),{connectorId:s}=x(),n=m({...l.serviceConnectorDetail(s),throwOnError:!0});if(n.isPending)return e.jsx(c,{className:"h-[300px] w-full"});if(n.isError)return e.jsx("div",{children:"Error"});const t=n.data;return e.jsxs(h,{open:a,onOpenChange:r,children:[e.jsx(f,{className:"flex items-center gap-[10px]",children:e.jsxs(g,{className:"flex w-full items-center gap-[10px] text-text-lg",children:[e.jsx(j,{className:` ${a?"":"-rotate-90"} h-5 w-5 rounded-md fill-neutral-500 transition-transform duration-200 hover:bg-neutral-200`}),"Basic Parameters"]})}),e.jsx(y,{className:"space-y-5 border-t border-theme-border-moderate bg-theme-surface-primary p-5",children:e.jsxs("dl",{className:"grid grid-cols-1 gap-x-[10px] gap-y-2 md:gap-y-4 lg:grid-cols-3",children:[e.jsx(o,{label:"Name",value:t.name}),e.jsx(_,{connector:t}),e.jsx(A,{connector:t}),e.jsx(D,{connector:t}),e.jsx(S,{connector:t}),e.jsx(O,{connector:t}),e.jsx(I,{connector:t}),e.jsx(Q,{connector:t}),e.jsx(K,{connector:t})]})})]})}function _({connector:a}){var s;const r=(s=a.body)==null?void 0:s.connector_type;return!r||typeof r=="string"?null:e.jsx(o,{label:"Type",value:e.jsxs(u,{size:"sm",rounded:!1,emphasis:"minimal",className:"w-fit gap-0.5 text-theme-text-primary",color:"grey",children:[e.jsx("img",{src:r.logo_url??"",className:"h-4 w-4 shrink-0",alt:r.name}),e.jsx("span",{children:r.name})]})})}function A({connector:a}){var s;const r=d(a);return e.jsx(o,{label:"Auth Method",value:r===void 0?null:e.jsx(u,{size:"sm",rounded:!1,emphasis:"minimal",className:"w-fit text-theme-text-primary",color:"grey",children:e.jsx("span",{children:r.name||((s=a.body)==null?void 0:s.auth_method)})})})}function D({connector:a}){const r=E(a);return e.jsxs(e.Fragment,{children:[e.jsx(b,{children:"Resrouce Types"}),e.jsx(N,{className:"h-auto",children:e.jsx(R,{resourceTypes:r})})]})}function S({connector:a}){return e.jsx(o,{label:"Resource Name",value:e.jsx(T,{connector:a})})}function O({connector:a}){var s,n,t;const r=(s=a.resources)==null?void 0:s.user;return e.jsx(o,{label:"Author",value:r?e.jsx(v,{avatarUrl:((n=r.body)==null?void 0:n.avatar_url)??void 0,username:r.name,isServiceAccount:!!((t=r.body)!=null&&t.is_service_account)}):null})}function I({connector:a}){var s;const r=(s=a.body)==null?void 0:s.expires_at;return e.jsx(o,{label:"Expires in",value:r?e.jsx(w,{expires:r}):"Never"})}function Q({connector:a}){var s;const r=(s=a.body)==null?void 0:s.created;return e.jsx(o,{label:"Created",value:r?e.jsx("span",{className:"truncate",children:e.jsx(i,{dateString:r})}):null})}function K({connector:a}){var s;const r=(s=a.body)==null?void 0:s.updated;return e.jsx(o,{label:"Updated",value:r?e.jsx("span",{className:"truncate",children:e.jsx(i,{dateString:r})}):null})}function M(){var t;const{connectorId:a}=x(),r=m({...l.serviceConnectorDetail(a),throwOnError:!0});if(r.isPending)return e.jsx(c,{className:"h-[300px] w-full"});if(r.isError)return e.jsx("div",{children:"Error"});const s=r.data,n=d(s);return e.jsx(C,{schema:n==null?void 0:n.config_schema,title:e.jsx("p",{className:"text-text-xl",children:"Configuration"}),data:(t=s.metadata)==null?void 0:t.configuration,isInitialOpen:!0})}function X(){return e.jsxs("div",{className:"grid grid-cols-1 gap-5",children:[e.jsx("div",{children:e.jsx(P,{})}),e.jsx("div",{className:"space-y-5",children:e.jsx(M,{})})]})}export{X as default};