zenml-nightly 0.83.0.dev20250623__py3-none-any.whl → 0.83.1.dev20250624__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 (130) hide show
  1. zenml/VERSION +1 -1
  2. zenml/zen_server/dashboard/assets/{404-DmJUgorp.js → 404-B5eko6XL.js} +1 -1
  3. zenml/zen_server/dashboard/assets/{@reactflow-8OCk19Fi.js → @reactflow-B_iCtR7X.js} +1 -1
  4. zenml/zen_server/dashboard/assets/{AlertDialogDropdownItem-CZW4QyWn.js → AlertDialogDropdownItem-DsOmO1FH.js} +1 -1
  5. zenml/zen_server/dashboard/assets/{ButtonGroup-DFWWFGUE.js → ButtonGroup-4sPZDv70.js} +1 -1
  6. zenml/zen_server/dashboard/assets/{CodeSnippet-D2HkkAGr.js → CodeSnippet-Ctplhzdc.js} +1 -1
  7. zenml/zen_server/dashboard/assets/{CollapsibleCard-CnS09ljw.js → CollapsibleCard-CBKenz9f.js} +1 -1
  8. zenml/zen_server/dashboard/assets/{ComponentBadge-CDgdd0Ks.js → ComponentBadge-Cnecw3qz.js} +1 -1
  9. zenml/zen_server/dashboard/assets/{ComponentIcon-CbbOc7lb.js → ComponentIcon-CMiVW-O6.js} +1 -1
  10. zenml/zen_server/dashboard/assets/{DeleteAlertDialog-VIOMDLmx.js → DeleteAlertDialog-DEI0YDzP.js} +1 -1
  11. zenml/zen_server/dashboard/assets/{DialogItem-ClFCqxEp.js → DialogItem-CRCDpYU6.js} +1 -1
  12. zenml/zen_server/dashboard/assets/{Error-CQzjbDcN.js → Error-BG6f_WRd.js} +1 -1
  13. zenml/zen_server/dashboard/assets/{ExecutionStatus-CWreILP0.js → ExecutionStatus-BuhNAE9w.js} +1 -1
  14. zenml/zen_server/dashboard/assets/{Helpbox-CiKxG5_X.js → Helpbox-DtUG2Bf_.js} +1 -1
  15. zenml/zen_server/dashboard/assets/{Infobox-CGxFvqzi.js → Infobox-CSBRrM6r.js} +1 -1
  16. zenml/zen_server/dashboard/assets/{LeftSideMenu-DCsKdIjC.js → LeftSideMenu-DPsCCK3z.js} +1 -1
  17. zenml/zen_server/dashboard/assets/{NestedCollapsible-3M4llYtH.js → NestedCollapsible-CMuDIJlp.js} +1 -1
  18. zenml/zen_server/dashboard/assets/{NumberBox-C0mQktmV.js → NumberBox-DtCv7jh3.js} +1 -1
  19. zenml/zen_server/dashboard/assets/Pagination-CWnEpSpN.js +1 -0
  20. zenml/zen_server/dashboard/assets/{Partials-DSjkttlz.js → Partials-CfHD6OH5.js} +1 -1
  21. zenml/zen_server/dashboard/assets/{ProCta-Dm5cWKpS.js → ProCta-CNyp04C8.js} +1 -1
  22. zenml/zen_server/dashboard/assets/{ProviderIcon-DPwMR6nF.js → ProviderIcon-DHejyg7C.js} +1 -1
  23. zenml/zen_server/dashboard/assets/{ProviderRadio-DEDNRgAb.js → ProviderRadio-tGtie8Gc.js} +1 -1
  24. zenml/zen_server/dashboard/assets/RunsBody-mYwMcWWj.js +1 -0
  25. zenml/zen_server/dashboard/assets/SearchField-BtUi6cYl.js +1 -0
  26. zenml/zen_server/dashboard/assets/{SecretTooltip-CZTRnaCV.js → SecretTooltip-B5u1UsQ9.js} +1 -1
  27. zenml/zen_server/dashboard/assets/{SetPassword-BjNGDC5e.js → SetPassword-BmbgL_ed.js} +1 -1
  28. zenml/zen_server/dashboard/assets/{SheetHeader-CASpN2Lz.js → SheetHeader-DkH7aG9K.js} +1 -1
  29. zenml/zen_server/dashboard/assets/StackComponentList-Bi8BKqCu.js +1 -0
  30. zenml/zen_server/dashboard/assets/StackList-Cvxapo0p.js +1 -0
  31. zenml/zen_server/dashboard/assets/{StackName-ojLC6xdl.js → StackName-CFSZL8ec.js} +1 -1
  32. zenml/zen_server/dashboard/assets/Tabs-D4dv48ry.js +1 -0
  33. zenml/zen_server/dashboard/assets/{Tick-BPrWnNlN.js → Tick-Qquvr4P3.js} +1 -1
  34. zenml/zen_server/dashboard/assets/{UpdatePasswordSchemas-CNfKDo2Q.js → UpdatePasswordSchemas-D_DCETSO.js} +1 -1
  35. zenml/zen_server/dashboard/assets/{UsageReason-Cb-mpV8M.js → UsageReason-DhiUV1bu.js} +1 -1
  36. zenml/zen_server/dashboard/assets/{Wizard-Dg8Pmn5A.js → Wizard-BHvY75u_.js} +1 -1
  37. zenml/zen_server/dashboard/assets/{WizardFooter-BcNDIvlQ.js → WizardFooter-FQm8y-jP.js} +1 -1
  38. zenml/zen_server/dashboard/assets/{all-pipeline-runs-query-DCdax7I5.js → all-pipeline-runs-query-DpKw9WL9.js} +1 -1
  39. zenml/zen_server/dashboard/assets/{bulk-delete-C_kpIB9A.js → bulk-delete-CzYA--cC.js} +1 -1
  40. zenml/zen_server/dashboard/assets/{configuration-form-B2hmKGnF.js → configuration-form-DSoMMiPE.js} +1 -1
  41. zenml/zen_server/dashboard/assets/{constants-1EZZxtay.js → constants-DTfsIqHy.js} +1 -1
  42. zenml/zen_server/dashboard/assets/{create-stack-TKmMtrkQ.js → create-stack-BpZrmKDu.js} +1 -1
  43. zenml/zen_server/dashboard/assets/{delete-run-CCR9md_s.js → delete-run-BkyDsKQc.js} +1 -1
  44. zenml/zen_server/dashboard/assets/elk-worker.min-BdOC9sib.js +6263 -0
  45. zenml/zen_server/dashboard/assets/expand-full-BPiXpch2.js +1 -0
  46. zenml/zen_server/dashboard/assets/{form-DFJkaFDX.js → form-BgtamtJm.js} +1 -1
  47. zenml/zen_server/dashboard/assets/{form-schemas-CrznJVzA.js → form-schemas-dyDkAxXP.js} +1 -1
  48. zenml/zen_server/dashboard/assets/{index-BjUu1mP4.js → index-BBt0LDtR.js} +1 -1
  49. zenml/zen_server/dashboard/assets/index-BfNISy0X.css +1 -0
  50. zenml/zen_server/dashboard/assets/{index-BFqbGSck.js → index-BgEfQ3_G.js} +4 -4
  51. zenml/zen_server/dashboard/assets/{index-U992soPJ.js → index-eoDB_1XX.js} +1 -1
  52. zenml/zen_server/dashboard/assets/{layout-Do9YI4QX.js → layout-o1x87a3q.js} +1 -1
  53. zenml/zen_server/dashboard/assets/{login-mutation-D3tFP6Wm.js → login-mutation-C1hvP_cX.js} +1 -1
  54. zenml/zen_server/dashboard/assets/page-4xUZpMN0.js +31 -0
  55. zenml/zen_server/dashboard/assets/page-4zc4xPv2.js +2 -0
  56. zenml/zen_server/dashboard/assets/page-B0104V6C.js +1 -0
  57. zenml/zen_server/dashboard/assets/page-BNJsjvof.js +1 -0
  58. zenml/zen_server/dashboard/assets/{page-sJjNT9xA.js → page-BPQ66vR-.js} +1 -1
  59. zenml/zen_server/dashboard/assets/{page-CAJ8B0vb.js → page-BQgSZ2nH.js} +1 -1
  60. zenml/zen_server/dashboard/assets/page-BXl2ZX6J.js +1 -0
  61. zenml/zen_server/dashboard/assets/{page-CtiuMP_r.js → page-BxeZrG_t.js} +1 -1
  62. zenml/zen_server/dashboard/assets/{page-Cal6XQ4U.js → page-C2A-2Cj_.js} +1 -1
  63. zenml/zen_server/dashboard/assets/page-C2i-C7jv.js +1 -0
  64. zenml/zen_server/dashboard/assets/{page-DJIGaUQ9.js → page-C3JfJxuR.js} +1 -1
  65. zenml/zen_server/dashboard/assets/{page-ChGcZI_6.js → page-CESEqC2L.js} +1 -1
  66. zenml/zen_server/dashboard/assets/{page-DCcuPZ8P.js → page-CF8cTZ7l.js} +1 -1
  67. zenml/zen_server/dashboard/assets/page-CKjsimVu.js +1 -0
  68. zenml/zen_server/dashboard/assets/{page-DNjKHjnH.js → page-COLzBwff.js} +1 -1
  69. zenml/zen_server/dashboard/assets/page-COifg5fa.js +1 -0
  70. zenml/zen_server/dashboard/assets/{page-CnbIYE80.js → page-CQeJuA8T.js} +1 -1
  71. zenml/zen_server/dashboard/assets/{page-DKK6ulgy.js → page-CcjWEjre.js} +1 -1
  72. zenml/zen_server/dashboard/assets/{page-9RjCitFH.js → page-CefGLeWy.js} +1 -1
  73. zenml/zen_server/dashboard/assets/{page-DUKbOhaD.js → page-CfxpV3j4.js} +1 -1
  74. zenml/zen_server/dashboard/assets/{page-D9Hfx6GV.js → page-ClcUzawe.js} +1 -1
  75. zenml/zen_server/dashboard/assets/page-Ct_LB3zo.js +1 -0
  76. zenml/zen_server/dashboard/assets/page-D-ZWUMYY.js +1 -0
  77. zenml/zen_server/dashboard/assets/{page-CUaMMoPG.js → page-D-tJ_Y0a.js} +1 -1
  78. zenml/zen_server/dashboard/assets/{page-CdZCmszX.js → page-DHrvih9u.js} +1 -1
  79. zenml/zen_server/dashboard/assets/{page-DUK0Nd_1.js → page-DMhaHZDw.js} +1 -1
  80. zenml/zen_server/dashboard/assets/{page-CAUYrfui.js → page-DOCOmmKn.js} +1 -1
  81. zenml/zen_server/dashboard/assets/{page-akLcPcKw.js → page-DcQmxKLp.js} +1 -1
  82. zenml/zen_server/dashboard/assets/page-Dh4GRWw5.js +1 -0
  83. zenml/zen_server/dashboard/assets/{page-DwVPpCFg.js → page-DiHZK-1w.js} +1 -1
  84. zenml/zen_server/dashboard/assets/page-Dn7ZNapg.js +1 -0
  85. zenml/zen_server/dashboard/assets/page-Dy4vSQY7.js +1 -0
  86. zenml/zen_server/dashboard/assets/{page-CN7lkvXr.js → page-QrvWQwZb.js} +1 -1
  87. zenml/zen_server/dashboard/assets/{page-BrT0_zSJ.js → page-RF3Fup0q.js} +1 -1
  88. zenml/zen_server/dashboard/assets/page-WuvCrN47.js +1 -0
  89. zenml/zen_server/dashboard/assets/{page-Be3R2uYn.js → page-_WnHBI1F.js} +1 -1
  90. zenml/zen_server/dashboard/assets/{page-C210HcBA.js → page-ghjVNgVE.js} +1 -1
  91. zenml/zen_server/dashboard/assets/{page-BCrKmYIZ.js → page-iDsDiDXw.js} +1 -1
  92. zenml/zen_server/dashboard/assets/{page-ClvmVesa.js → page-rVhXI5ZO.js} +1 -1
  93. zenml/zen_server/dashboard/assets/{page-DEohTSz6.js → page-uxjMX8Iq.js} +1 -1
  94. zenml/zen_server/dashboard/assets/{persist-Dec_w7aB.js → persist-BsdEtCkd.js} +1 -1
  95. zenml/zen_server/dashboard/assets/{persist-DWMWVP-y.js → persist-CFPbMcJX.js} +1 -1
  96. zenml/zen_server/dashboard/assets/{resource-tyes-list-o2LXiMay.js → resource-tyes-list-79FqS3LY.js} +1 -1
  97. zenml/zen_server/dashboard/assets/{resource-type-tooltip-DwHrJstL.js → resource-type-tooltip-BL9ZTRKi.js} +1 -1
  98. zenml/zen_server/dashboard/assets/{service-connectors-DSEMwJ5A.js → service-connectors-Q8h7-_rG.js} +1 -1
  99. zenml/zen_server/dashboard/assets/{service-jxtvgks0.js → service-k-9Vsb30.js} +1 -1
  100. zenml/zen_server/dashboard/assets/{sharedSchema-BXzg0EZz.js → sharedSchema-C_HkejsG.js} +1 -1
  101. zenml/zen_server/dashboard/assets/{stack-detail-query-Cm0fsgo-.js → stack-detail-query-CNmVZ0Bo.js} +1 -1
  102. zenml/zen_server/dashboard/assets/{update-current-user-mutation-D5MjcQ6F.js → update-current-user-mutation-Ca-Lmwuj.js} +1 -1
  103. zenml/zen_server/dashboard/assets/{update-server-settings-mutation-CmnxdxiK.js → update-server-settings-mutation-Bwe3gUt4.js} +1 -1
  104. zenml/zen_server/dashboard/index.html +4 -4
  105. zenml/zen_stores/migrations/versions/0.83.1_release.py +23 -0
  106. {zenml_nightly-0.83.0.dev20250623.dist-info → zenml_nightly-0.83.1.dev20250624.dist-info}/METADATA +5 -9
  107. {zenml_nightly-0.83.0.dev20250623.dist-info → zenml_nightly-0.83.1.dev20250624.dist-info}/RECORD +110 -106
  108. zenml/zen_server/dashboard/assets/RunsBody-BRBn1e2O.js +0 -1
  109. zenml/zen_server/dashboard/assets/SearchField-DY6-UbRT.js +0 -1
  110. zenml/zen_server/dashboard/assets/StackComponentList-Be1pQt9m.js +0 -1
  111. zenml/zen_server/dashboard/assets/StackList-BdiR5DvR.js +0 -1
  112. zenml/zen_server/dashboard/assets/Tabs-DNSKblCM.js +0 -1
  113. zenml/zen_server/dashboard/assets/index-DuhuqTCI.css +0 -1
  114. zenml/zen_server/dashboard/assets/page-B0PsXWiT.js +0 -1
  115. zenml/zen_server/dashboard/assets/page-BcRI3-aR.js +0 -29
  116. zenml/zen_server/dashboard/assets/page-BgknnddT.js +0 -1
  117. zenml/zen_server/dashboard/assets/page-Bs3W2FDi.js +0 -1
  118. zenml/zen_server/dashboard/assets/page-C6KaiZ_W.js +0 -1
  119. zenml/zen_server/dashboard/assets/page-CHxVhF3x.js +0 -1
  120. zenml/zen_server/dashboard/assets/page-CktmtZ8Z.js +0 -1
  121. zenml/zen_server/dashboard/assets/page-CoXzjeEY.js +0 -1
  122. zenml/zen_server/dashboard/assets/page-D9iuB88h.js +0 -1
  123. zenml/zen_server/dashboard/assets/page-DYOucPtA.js +0 -1
  124. zenml/zen_server/dashboard/assets/page-DpqRelAy.js +0 -1
  125. zenml/zen_server/dashboard/assets/page-XURWnYZP.js +0 -1
  126. zenml/zen_server/dashboard/assets/page-abw-2oeW.js +0 -1
  127. zenml/zen_server/dashboard/assets/page-n9ejQ2V3.js +0 -2
  128. {zenml_nightly-0.83.0.dev20250623.dist-info → zenml_nightly-0.83.1.dev20250624.dist-info}/LICENSE +0 -0
  129. {zenml_nightly-0.83.0.dev20250623.dist-info → zenml_nightly-0.83.1.dev20250624.dist-info}/WHEEL +0 -0
  130. {zenml_nightly-0.83.0.dev20250623.dist-info → zenml_nightly-0.83.1.dev20250624.dist-info}/entry_points.txt +0 -0
@@ -1 +1 @@
1
- import{j as e,r as d,aF as N,aG as H,aH as P,aI as Q}from"./@radix-Cdvw4jJ8.js";import{T as U,q as Z,s as G,t as J,av as O,aw as E,ai as u,ar as K,B as f,az as W,aA as X,as as Y,at as ee,au as te,bw as se,I as R,J as re,V as ne,L as ae,G as ie,r as B,z as x,a as oe,S as ce,h as le}from"./index-BFqbGSck.js";import{a as p,C as de,u as me,F as ue}from"./index.esm-DhJo3mA6.js";import{C as V}from"./ComponentIcon-CbbOc7lb.js";import{D as pe}from"./DisplayDate-8RESqe5H.js";import{j as he,k as xe,h as fe}from"./@tanstack-5gTMR7G2.js";import{d as ge}from"./index-DWpiv-Ft.js";import{s as je,R as ke,a as be,u as ve}from"./create-stack-TKmMtrkQ.js";import{S as ye}from"./info-QkbQz4QU.js";import{S as Ne,s as b}from"./constants-1EZZxtay.js";import{S as Se}from"./arrow-left-MRXv5pAH.js";import{C as we}from"./configuration-form-B2hmKGnF.js";import{S as Ce}from"./check-circle-C4tYvbtw.js";import{L as Le,c as _e}from"./@react-router-DeDfXbUF.js";import{s as Fe}from"./index-BjUu1mP4.js";import{t as Te}from"./zod-XdS2h1ws.js";import{s as ze}from"./sharedSchema-BXzg0EZz.js";import"./@reactflow-8OCk19Fi.js";import"./layout-DBbfEFBe.js";import"./transform-CeZdrxDZ.js";import"./index-U992soPJ.js";import"./form-DFJkaFDX.js";import"./plus-Cl0_rCVF.js";import"./trash-DP6Tpp_E.js";import"./type-guards-CNgPYg8l.js";import"./check-B9QMTa3f.js";import"./CodeSnippet-D2HkkAGr.js";import"./file-text-Cd8wVfq5.js";import"./terminal-square-XFL_4QN-.js";import"./stack-detail-query-Cm0fsgo-.js";import"./index.es-C1gfATPn.js";const S={helpLink:"https://docs.zenml.io/stack-components/orchestrators",description:"An orchestrator is a special kind of backend that manages the running of each step of the pipeline. Orchestrators administer the actual pipeline runs. By default, ZenML initializes your repository with an orchestrator that runs everything on your local machine."},w={helpLink:"https://docs.zenml.io/stack-components/artifact-stores",description:"The Artifact Store is a central component in any MLOps stack. As the name suggests, it acts as a data persistence layer where artifacts (e.g. datasets, models) ingested or generated by the machine learning pipelines are stored."},C={helpLink:"https://docs.zenml.io/stack-components/container-registries",description:"Container registry is used to store container images that are built to run machine learning pipelines in remote environments. Containerization of the pipeline code creates a portable environment that allows code to run in an isolated manner."},L={description:"Step operators allow you to run individual steps in a custom environment different from the default one used by your active orchestrator.",helpLink:"https://docs.zenml.io/stack-components/step-operators"},_={description:"Model deployers are stack components responsible for online model serving. They are responsible for deploying models to a remote server. Model deployers also act as a registry for models that are served with ZenML.",helpLink:"https://docs.zenml.io/stack-components/model-deployers"},F={description:"ZenML supports connecting to a Redis-backed Feast feature store as a stack component integration.",helpLink:"https://docs.zenml.io/stack-components/feature-stores"},T={description:"Experiment trackers let you track your ML experiments by logging the parameters and allowing you to compare between different runs.",helpLink:"https://docs.zenml.io/stack-components/experiment-trackers"},z={description:"Alerters allow you to send messages to chat services (like Slack, Discord, Mattermost, etc.) from within your pipelines. This is useful to immediately get notified when failures happen, for general monitoring/reporting, and also for building human-in-the-loop ML.",helpLink:"https://docs.zenml.io/stack-components/alerters "},M={description:"Annotators are a stack component that enables the use of data annotation as part of your ZenML stack and pipelines.",helpLink:"https://docs.zenml.io/stack-components/annotators"},I={description:"Data Validators used in ZenML pipelines usually generate data profiles and data quality check reports that are versioned and stored in the Artifact Store and can be retrieved and visualized later.",helpLink:"https://docs.zenml.io/stack-components/data-validators"},A={description:"The image builder is an essential part of most remote MLOps stacks. It is used to build container images such that your machine-learning pipelines and steps can be executed in remote environments.",helpLink:"https://docs.zenml.io/stack-components/image-builders"},D={description:"Model registries are centralized storage solutions for managing and tracking machine learning models across various stages of development and deployment.",helpLink:"https://docs.zenml.io/stack-components/model-registries"};function Me({type:t}){const{description:s,link:r}=Ie(t);return e.jsx(U,{children:e.jsxs(Z,{delayDuration:200,children:[e.jsxs(G,{children:[e.jsx(ye,{className:"h-4 w-4 shrink-0 fill-theme-text-tertiary"}),e.jsxs("div",{className:"sr-only",children:["Info for ",t]})]}),e.jsxs(J,{align:"start",side:"bottom",className:"flex max-w-xl flex-col gap-2 bg-theme-surface-primary p-5 text-text-sm text-theme-text-primary",children:[e.jsx("p",{children:s}),e.jsx("a",{className:"link mt-2 text-primary-400",target:"_blank",href:r,children:"Learn more"})]})]})})}function Ie(t){switch(t){case"orchestrator":return{description:S.description,link:S.helpLink};case"alerter":return{description:z.description,link:z.helpLink};case"annotator":return{description:M.description,link:M.helpLink};case"artifact_store":return{description:w.description,link:w.helpLink};case"container_registry":return{description:C.description,link:C.helpLink};case"data_validator":return{description:I.description,link:I.helpLink};case"experiment_tracker":return{description:T.description,link:T.helpLink};case"feature_store":return{description:F.description,link:F.helpLink};case"image_builder":return{description:A.description,link:A.helpLink};case"model_deployer":return{description:_.description,link:_.helpLink};case"model_registry":return{description:D.description,link:D.helpLink};case"step_operator":return{description:L.description,link:L.helpLink}}}function Ae({type:t,setSelectedFlavor:s}){return e.jsxs(e.Fragment,{children:[e.jsx(O,{children:e.jsxs(E,{children:["Select ",u(t)," Flavor"]})}),e.jsx(K,{viewportClassName:"max-h-[70vh]",children:e.jsx("div",{className:"p-5",children:e.jsx(Ne,{setSelectedFlavor:s,type:t})})})]})}function De({name:t,id:s,backHandler:r,type:n,successHandler:a}){const o=d.useId();return e.jsxs(e.Fragment,{children:[e.jsx(O,{className:"w-full",children:e.jsxs("div",{className:"flex w-0 flex-1 items-center gap-2",children:[e.jsxs(f,{intent:"secondary",emphasis:"subtle",className:"flex aspect-square size-6 items-center justify-center",onClick:()=>r(),children:[e.jsx(Se,{className:"size-5 shrink-0"}),e.jsx("span",{className:"sr-only",children:"Go step back"})]}),e.jsxs(E,{className:"truncate",children:["Configure your ",u(t)," ",u(n)]})]})}),e.jsx(we,{useMaxHeight:!0,flavorId:s,formId:o,successHandler:a,FooterComponent:$e})]})}function $e({formId:t,isPending:s}){return e.jsx(W,{children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(X,{asChild:!0,children:e.jsx(f,{size:"md",intent:"secondary",children:"Cancel"})}),e.jsxs(f,{size:"md",disabled:s,type:"submit",form:t,children:[s&&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 Oe({type:t}){const[s,r]=d.useState(!1),[n,a]=d.useState(0),[o,c]=d.useState(null);async function i(l){r(l),await je(100),l||(a(0),c(null))}function g(l){var m;c({id:l.id,name:l.name,logoUrl:((m=l.body)==null?void 0:m.logo_url)??void 0}),a(j=>j+1)}function h(){a(0),c(null)}return e.jsxs(Y,{open:s,onOpenChange:l=>i(l),children:[e.jsx(ee,{asChild:!0,children:e.jsxs("button",{className:"w-full rounded-md border border-dashed border-neutral-300 bg-theme-surface-tertiary py-5 text-theme-text-secondary",children:["New ",u(t)]})}),e.jsxs(te,{className:"w-full sm:max-w-[640px] md:max-w-3xl xl:max-w-[1080px]",children:[n===0&&e.jsx(Ae,{setSelectedFlavor:g,type:t}),n===1&&!!o&&e.jsx(De,{successHandler:()=>i(!1),backHandler:h,...o,type:t})]})]})}function Ee(){return e.jsxs(e.Fragment,{children:[b.map(t=>e.jsx(N,{className:"h-full space-y-5 p-5",value:t,children:e.jsx(Ve,{type:t})},t)),e.jsx(N,{className:"h-full",value:"",children:e.jsx("div",{className:"flex h-full w-full items-center justify-center text-theme-text-tertiary",children:"Select a category to add a new component"})})]})}function Re({type:t,search:s}){const r=he({...re.componentListInfinite({sort_by:"desc:updated",type:t,...s?{name:`contains:${s}`}:{}})}),{control:n,watch:a,setValue:o}=p();return r.isError?e.jsx("p",{children:"Error while fetching Components"}):r.isPending?e.jsx("div",{className:"flex w-full flex-1 items-center justify-center",children:e.jsx(ne,{})}):e.jsxs("div",{className:"space-y-1",children:[e.jsx("ul",{className:"space-y-1",children:r.data.pages.map(c=>c.items.map(i=>e.jsx("li",{children:e.jsx(de,{name:`components.${t}.id`,control:n,render:({field:{onChange:g,...h}})=>{var l,m,j,v;return e.jsxs(ke,{className:"justify-between bg-theme-surface-primary font-medium","data-state":a(`components.${t}.id`)===i.id?"selected":"unselected",htmlFor:i.id,children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(be,{...h,id:i.id,type:"radio",value:i.id,onChange:q=>{var y;o(`components.${t}.name`,i.name),o(`components.${t}.logoUrl`,((y=i.body)==null?void 0:y.logo_url)||""),g(q)},checked:a(`components.${t}.id`)===i.id,name:t}),e.jsx("img",{alt:"flavor icon",src:ae(((l=i.body)==null?void 0:l.logo_url)||""),width:24,height:24}),e.jsxs("div",{className:"min-w-0 truncate",children:[e.jsx("div",{className:"truncate font-semibold",children:i.name}),e.jsx("div",{className:"truncate text-text-xs text-theme-text-secondary",children:i.id.split("-")[0]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 text-text-sm",children:[((j=(m=i.resources)==null?void 0:m.user)==null?void 0:j.name)&&e.jsx(ie,{username:i.resources.user.name}),((v=i.body)==null?void 0:v.updated)&&e.jsx("div",{className:"whitespace-nowrap text-theme-text-secondary",children:e.jsx(pe,{short:!0,dateString:i.body.updated})})]})]})}})},i.id)))}),e.jsx(Oe,{type:t}),r.hasNextPage&&e.jsx(f,{onClick:()=>r.fetchNextPage(),type:"button",size:"md",intent:"secondary",emphasis:"subtle",className:"flex w-full items-center justify-center bg-theme-surface-primary",children:e.jsxs("div",{className:"flex items-center gap-1",children:[r.isFetchingNextPage&&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"}),"Load more"]})})]})}function Be({type:t}){return e.jsxs("section",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(V,{className:"h-5 w-5 fill-primary-400",type:t}),e.jsx("h2",{className:"text-text-lg font-semibold",children:u(t)}),e.jsx(Me,{type:t})]}),e.jsxs("p",{className:"text-theme-text-secondary",children:["Select a existing ",se(t)," from your server:"]})]})}function Ve({type:t}){const[s,r]=d.useState(""),{watch:n,setValue:a}=p(),o=n(`components.${t}`);return d.useEffect(()=>{o&&!o.id&&a(`components.${t}`,null)},[o,a,t]),e.jsxs(e.Fragment,{children:[e.jsx(Be,{type:t}),e.jsx(qe,{search:s,setSearch:r}),e.jsx(Re,{search:s,type:t})]})}function qe({setSearch:t,search:s}){const[r,n]=d.useState(s),a=d.useCallback(ge(t,500),[]);d.useEffect(()=>()=>{a.cancel()},[a]);function o(c){n(c),a(c)}return e.jsx(R,{value:r,onChange:c=>o(c.target.value),placeholder:"Search..."})}function He({type:t}){const{watch:s,formState:{errors:r}}=p(),n=s(`components.${t}`),a=n&&n.id;return e.jsx("div",{"data-error":!a&&r.components&&r.components[t]?"true":"false","data-filled":a?"true":"false",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 data-[error=true]:border-theme-text-error data-[filled=true]:border-success-400 data-[filled=true]:bg-theme-surface-primary data-[state=active]:bg-theme-surface-primary group-data-[state=active]/trigger:bg-theme-surface-primary group-data-[state=active]/trigger:shadow-md data-[error=false]:data-[filled=false]:group-data-[state=active]/trigger:border-theme-border-bold",children:a?e.jsx(Pe,{type:t}):e.jsx(Qe,{type:t})})}function Pe({type:t}){const{watch:s}=p(),r=s(`components.${t}`);return r&&r.id?e.jsxs("div",{className:"flex flex-col items-center gap-2 text-text-sm",children:[e.jsx("img",{width:24,height:24,src:r.logoUrl,alt:`Icon of ${r.name}`}),e.jsxs("div",{className:"space-y-0.25",children:[e.jsx("div",{className:"text-theme-text-primary",children:r.name}),e.jsx("div",{className:"text-text-xs text-theme-text-tertiary",children:u(t)})]})]}):null}function Qe({type:t}){return e.jsxs(e.Fragment,{children:[e.jsx(V,{className:"h-5 w-5 shrink-0 fill-theme-text-tertiary group-data-[state=active]/trigger:fill-theme-surface-strong",type:t}),e.jsx("span",{children:u(t)})]})}function Ue(){return e.jsxs("div",{className:"flex h-full flex-col justify-between space-y-5",children:[e.jsxs("div",{className:"space-y-5 p-5",children:[e.jsx(Je,{}),e.jsx(Ze,{})]}),e.jsx(Ge,{})]})}function Ze(){const{watch:t,resetField:s}=p();return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h2",{className:"text-text-lg font-semibold",children:"Add Components"}),e.jsxs("p",{className:"text-theme-text-secondary",children:["All stacks have at minimum an orchestrator and an artifact store."," ",e.jsx("a",{target:"_blank",rel:"noopener noreferrer",href:"https://docs.zenml.io/stack-components/component-guide",className:"link text-primary-400",children:"Learn more"})]})]}),e.jsx(H,{children:e.jsx("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 xl:grid-cols-4",children:b.map(r=>e.jsxs("div",{className:"relative",children:[e.jsx(P,{className:"group/trigger w-full",value:r,children:e.jsx(He,{type:r})}),t(`components.${r}.id`)&&e.jsx("button",{type:"button",onClick:n=>{n.preventDefault(),s(`components.${r}`)},className:"absolute right-[-12px] top-[-12px] flex aspect-square h-[28px] w-[28px] items-center justify-center rounded-rounded bg-theme-surface-primary",children:e.jsx(Ce,{className:"h-5 w-5 shrink-0 fill-success-400"})})]},r))})})]})}function Ge(){const{formState:{isSubmitting:t}}=p(),s=!!xe();return e.jsxs("div",{className:"flex items-center justify-end space-x-2 border-t border-theme-border-moderate p-5",children:[e.jsx(f,{asChild:!0,intent:"secondary",size:"md",children:e.jsx(Le,{to:B.stacks.create.index,children:"Cancel"})}),e.jsxs(f,{className:"flex items-center gap-1",disabled:t||s,size:"md",children:[(s||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 Stack"]})]})}function Je(){var r;const{register:t,formState:{errors:s}}=p();return e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-text-sm",htmlFor:"stack-name",children:"Stack Name"}),e.jsx(R,{id:"stack-name",className:`${s.stackName?"border-red-500":""} w-full`,placeholder:"zenml-stack",...t("stackName")}),s.stackName&&e.jsx("p",{className:"text-text-xs text-red-500",children:(r=s.stackName.message)==null?void 0:r.toString()})]})}const k=x.object({id:x.string().trim().min(1),name:x.string().trim().min(1),logoUrl:x.string().trim().min(1)}),Ke=b.reduce((t,s)=>(t[s]=k.nullable(),t),{}),We=x.object({stackName:ze,components:x.object({...Ke,orchestrator:k,artifact_store:k})});function Xe(){const{toast:t}=oe(),s=_e(),r=fe(),n=ve({onSuccess:async()=>{r.invalidateQueries({queryKey:Fe.all}),s(B.stacks.overview)},onError:c=>{t({status:"error",emphasis:"subtle",icon:e.jsx(ce,{className:"h-5 w-5 shrink-0 fill-error-700"}),description:c.message,rounded:!0})}});function a(c){const i=Object.entries(c.components).reduce((h,[l,m])=>(m&&(h[l]=[m.id]),h),{}),g={name:c.stackName,components:i};n.mutate({payload:g})}const o=me({resolver:Te(We),defaultValues:{components:{alerter:null,orchestrator:{},annotator:null,artifact_store:{},container_registry:null,data_validator:null,experiment_tracker:null,feature_store:null,model_registry:null,image_builder:null,model_deployer:null,step_operator:null},stackName:""}});return{createManualStack:a,form:o}}function Tt(){const[t,s]=d.useState(""),{createManualStack:r,form:n}=Xe();return e.jsx(ue,{...n,children:e.jsx(Q,{value:t,onValueChange:s,className:"h-full",children:e.jsxs("form",{onSubmit:n.handleSubmit(r),className:"flex h-[calc(100vh_-_4rem_-_4rem_-_2px)] flex-1 flex-col divide-y divide-theme-border-moderate xl:flex-row-reverse xl:divide-x xl:divide-y-0 xl:divide-x-reverse",children:[e.jsx($,{className:"h-full flex-1 bg-theme-surface-primary",children:e.jsx(Ue,{})}),e.jsx($,{children:e.jsx(Ee,{})})]})})})}function $({className:t,...s}){return e.jsx("div",{className:le("w-full overflow-y-auto xl:w-1/2",t),...s})}export{Tt as default};
1
+ import{j as e,r as d,aF as N,aG as H,aH as P,aI as Q}from"./@radix-Cdvw4jJ8.js";import{T as U,q as Z,s as G,t as J,av as O,aw as E,ai as u,ar as K,B as f,az as W,aA as X,as as Y,at as ee,au as te,bw as se,I as R,J as re,V as ne,L as ae,G as ie,r as B,z as x,a as oe,S as ce,h as le}from"./index-BgEfQ3_G.js";import{a as p,C as de,u as me,F as ue}from"./index.esm-DhJo3mA6.js";import{C as V}from"./ComponentIcon-CMiVW-O6.js";import{D as pe}from"./DisplayDate-8RESqe5H.js";import{j as he,k as xe,h as fe}from"./@tanstack-5gTMR7G2.js";import{d as ge}from"./index-DWpiv-Ft.js";import{s as je,R as ke,a as be,u as ve}from"./create-stack-BpZrmKDu.js";import{S as ye}from"./info-QkbQz4QU.js";import{S as Ne,s as b}from"./constants-DTfsIqHy.js";import{S as Se}from"./arrow-left-MRXv5pAH.js";import{C as we}from"./configuration-form-DSoMMiPE.js";import{S as Ce}from"./check-circle-C4tYvbtw.js";import{L as Le,c as _e}from"./@react-router-DeDfXbUF.js";import{s as Fe}from"./index-BBt0LDtR.js";import{t as Te}from"./zod-XdS2h1ws.js";import{s as ze}from"./sharedSchema-C_HkejsG.js";import"./@reactflow-B_iCtR7X.js";import"./layout-DBbfEFBe.js";import"./transform-CeZdrxDZ.js";import"./index-eoDB_1XX.js";import"./form-BgtamtJm.js";import"./plus-Cl0_rCVF.js";import"./trash-DP6Tpp_E.js";import"./type-guards-CNgPYg8l.js";import"./check-B9QMTa3f.js";import"./CodeSnippet-Ctplhzdc.js";import"./file-text-Cd8wVfq5.js";import"./terminal-square-XFL_4QN-.js";import"./stack-detail-query-CNmVZ0Bo.js";import"./index.es-C1gfATPn.js";const S={helpLink:"https://docs.zenml.io/stack-components/orchestrators",description:"An orchestrator is a special kind of backend that manages the running of each step of the pipeline. Orchestrators administer the actual pipeline runs. By default, ZenML initializes your repository with an orchestrator that runs everything on your local machine."},w={helpLink:"https://docs.zenml.io/stack-components/artifact-stores",description:"The Artifact Store is a central component in any MLOps stack. As the name suggests, it acts as a data persistence layer where artifacts (e.g. datasets, models) ingested or generated by the machine learning pipelines are stored."},C={helpLink:"https://docs.zenml.io/stack-components/container-registries",description:"Container registry is used to store container images that are built to run machine learning pipelines in remote environments. Containerization of the pipeline code creates a portable environment that allows code to run in an isolated manner."},L={description:"Step operators allow you to run individual steps in a custom environment different from the default one used by your active orchestrator.",helpLink:"https://docs.zenml.io/stack-components/step-operators"},_={description:"Model deployers are stack components responsible for online model serving. They are responsible for deploying models to a remote server. Model deployers also act as a registry for models that are served with ZenML.",helpLink:"https://docs.zenml.io/stack-components/model-deployers"},F={description:"ZenML supports connecting to a Redis-backed Feast feature store as a stack component integration.",helpLink:"https://docs.zenml.io/stack-components/feature-stores"},T={description:"Experiment trackers let you track your ML experiments by logging the parameters and allowing you to compare between different runs.",helpLink:"https://docs.zenml.io/stack-components/experiment-trackers"},z={description:"Alerters allow you to send messages to chat services (like Slack, Discord, Mattermost, etc.) from within your pipelines. This is useful to immediately get notified when failures happen, for general monitoring/reporting, and also for building human-in-the-loop ML.",helpLink:"https://docs.zenml.io/stack-components/alerters "},M={description:"Annotators are a stack component that enables the use of data annotation as part of your ZenML stack and pipelines.",helpLink:"https://docs.zenml.io/stack-components/annotators"},I={description:"Data Validators used in ZenML pipelines usually generate data profiles and data quality check reports that are versioned and stored in the Artifact Store and can be retrieved and visualized later.",helpLink:"https://docs.zenml.io/stack-components/data-validators"},A={description:"The image builder is an essential part of most remote MLOps stacks. It is used to build container images such that your machine-learning pipelines and steps can be executed in remote environments.",helpLink:"https://docs.zenml.io/stack-components/image-builders"},D={description:"Model registries are centralized storage solutions for managing and tracking machine learning models across various stages of development and deployment.",helpLink:"https://docs.zenml.io/stack-components/model-registries"};function Me({type:t}){const{description:s,link:r}=Ie(t);return e.jsx(U,{children:e.jsxs(Z,{delayDuration:200,children:[e.jsxs(G,{children:[e.jsx(ye,{className:"h-4 w-4 shrink-0 fill-theme-text-tertiary"}),e.jsxs("div",{className:"sr-only",children:["Info for ",t]})]}),e.jsxs(J,{align:"start",side:"bottom",className:"flex max-w-xl flex-col gap-2 bg-theme-surface-primary p-5 text-text-sm text-theme-text-primary",children:[e.jsx("p",{children:s}),e.jsx("a",{className:"link mt-2 text-primary-400",target:"_blank",href:r,children:"Learn more"})]})]})})}function Ie(t){switch(t){case"orchestrator":return{description:S.description,link:S.helpLink};case"alerter":return{description:z.description,link:z.helpLink};case"annotator":return{description:M.description,link:M.helpLink};case"artifact_store":return{description:w.description,link:w.helpLink};case"container_registry":return{description:C.description,link:C.helpLink};case"data_validator":return{description:I.description,link:I.helpLink};case"experiment_tracker":return{description:T.description,link:T.helpLink};case"feature_store":return{description:F.description,link:F.helpLink};case"image_builder":return{description:A.description,link:A.helpLink};case"model_deployer":return{description:_.description,link:_.helpLink};case"model_registry":return{description:D.description,link:D.helpLink};case"step_operator":return{description:L.description,link:L.helpLink}}}function Ae({type:t,setSelectedFlavor:s}){return e.jsxs(e.Fragment,{children:[e.jsx(O,{children:e.jsxs(E,{children:["Select ",u(t)," Flavor"]})}),e.jsx(K,{viewportClassName:"max-h-[70vh]",children:e.jsx("div",{className:"p-5",children:e.jsx(Ne,{setSelectedFlavor:s,type:t})})})]})}function De({name:t,id:s,backHandler:r,type:n,successHandler:a}){const o=d.useId();return e.jsxs(e.Fragment,{children:[e.jsx(O,{className:"w-full",children:e.jsxs("div",{className:"flex w-0 flex-1 items-center gap-2",children:[e.jsxs(f,{intent:"secondary",emphasis:"subtle",className:"flex aspect-square size-6 items-center justify-center",onClick:()=>r(),children:[e.jsx(Se,{className:"size-5 shrink-0"}),e.jsx("span",{className:"sr-only",children:"Go step back"})]}),e.jsxs(E,{className:"truncate",children:["Configure your ",u(t)," ",u(n)]})]})}),e.jsx(we,{useMaxHeight:!0,flavorId:s,formId:o,successHandler:a,FooterComponent:$e})]})}function $e({formId:t,isPending:s}){return e.jsx(W,{children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(X,{asChild:!0,children:e.jsx(f,{size:"md",intent:"secondary",children:"Cancel"})}),e.jsxs(f,{size:"md",disabled:s,type:"submit",form:t,children:[s&&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 Oe({type:t}){const[s,r]=d.useState(!1),[n,a]=d.useState(0),[o,c]=d.useState(null);async function i(l){r(l),await je(100),l||(a(0),c(null))}function g(l){var m;c({id:l.id,name:l.name,logoUrl:((m=l.body)==null?void 0:m.logo_url)??void 0}),a(j=>j+1)}function h(){a(0),c(null)}return e.jsxs(Y,{open:s,onOpenChange:l=>i(l),children:[e.jsx(ee,{asChild:!0,children:e.jsxs("button",{className:"w-full rounded-md border border-dashed border-neutral-300 bg-theme-surface-tertiary py-5 text-theme-text-secondary",children:["New ",u(t)]})}),e.jsxs(te,{className:"w-full sm:max-w-[640px] md:max-w-3xl xl:max-w-[1080px]",children:[n===0&&e.jsx(Ae,{setSelectedFlavor:g,type:t}),n===1&&!!o&&e.jsx(De,{successHandler:()=>i(!1),backHandler:h,...o,type:t})]})]})}function Ee(){return e.jsxs(e.Fragment,{children:[b.map(t=>e.jsx(N,{className:"h-full space-y-5 p-5",value:t,children:e.jsx(Ve,{type:t})},t)),e.jsx(N,{className:"h-full",value:"",children:e.jsx("div",{className:"flex h-full w-full items-center justify-center text-theme-text-tertiary",children:"Select a category to add a new component"})})]})}function Re({type:t,search:s}){const r=he({...re.componentListInfinite({sort_by:"desc:updated",type:t,...s?{name:`contains:${s}`}:{}})}),{control:n,watch:a,setValue:o}=p();return r.isError?e.jsx("p",{children:"Error while fetching Components"}):r.isPending?e.jsx("div",{className:"flex w-full flex-1 items-center justify-center",children:e.jsx(ne,{})}):e.jsxs("div",{className:"space-y-1",children:[e.jsx("ul",{className:"space-y-1",children:r.data.pages.map(c=>c.items.map(i=>e.jsx("li",{children:e.jsx(de,{name:`components.${t}.id`,control:n,render:({field:{onChange:g,...h}})=>{var l,m,j,v;return e.jsxs(ke,{className:"justify-between bg-theme-surface-primary font-medium","data-state":a(`components.${t}.id`)===i.id?"selected":"unselected",htmlFor:i.id,children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(be,{...h,id:i.id,type:"radio",value:i.id,onChange:q=>{var y;o(`components.${t}.name`,i.name),o(`components.${t}.logoUrl`,((y=i.body)==null?void 0:y.logo_url)||""),g(q)},checked:a(`components.${t}.id`)===i.id,name:t}),e.jsx("img",{alt:"flavor icon",src:ae(((l=i.body)==null?void 0:l.logo_url)||""),width:24,height:24}),e.jsxs("div",{className:"min-w-0 truncate",children:[e.jsx("div",{className:"truncate font-semibold",children:i.name}),e.jsx("div",{className:"truncate text-text-xs text-theme-text-secondary",children:i.id.split("-")[0]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 text-text-sm",children:[((j=(m=i.resources)==null?void 0:m.user)==null?void 0:j.name)&&e.jsx(ie,{username:i.resources.user.name}),((v=i.body)==null?void 0:v.updated)&&e.jsx("div",{className:"whitespace-nowrap text-theme-text-secondary",children:e.jsx(pe,{short:!0,dateString:i.body.updated})})]})]})}})},i.id)))}),e.jsx(Oe,{type:t}),r.hasNextPage&&e.jsx(f,{onClick:()=>r.fetchNextPage(),type:"button",size:"md",intent:"secondary",emphasis:"subtle",className:"flex w-full items-center justify-center bg-theme-surface-primary",children:e.jsxs("div",{className:"flex items-center gap-1",children:[r.isFetchingNextPage&&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"}),"Load more"]})})]})}function Be({type:t}){return e.jsxs("section",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(V,{className:"h-5 w-5 fill-primary-400",type:t}),e.jsx("h2",{className:"text-text-lg font-semibold",children:u(t)}),e.jsx(Me,{type:t})]}),e.jsxs("p",{className:"text-theme-text-secondary",children:["Select a existing ",se(t)," from your server:"]})]})}function Ve({type:t}){const[s,r]=d.useState(""),{watch:n,setValue:a}=p(),o=n(`components.${t}`);return d.useEffect(()=>{o&&!o.id&&a(`components.${t}`,null)},[o,a,t]),e.jsxs(e.Fragment,{children:[e.jsx(Be,{type:t}),e.jsx(qe,{search:s,setSearch:r}),e.jsx(Re,{search:s,type:t})]})}function qe({setSearch:t,search:s}){const[r,n]=d.useState(s),a=d.useCallback(ge(t,500),[]);d.useEffect(()=>()=>{a.cancel()},[a]);function o(c){n(c),a(c)}return e.jsx(R,{value:r,onChange:c=>o(c.target.value),placeholder:"Search..."})}function He({type:t}){const{watch:s,formState:{errors:r}}=p(),n=s(`components.${t}`),a=n&&n.id;return e.jsx("div",{"data-error":!a&&r.components&&r.components[t]?"true":"false","data-filled":a?"true":"false",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 data-[error=true]:border-theme-text-error data-[filled=true]:border-success-400 data-[filled=true]:bg-theme-surface-primary data-[state=active]:bg-theme-surface-primary group-data-[state=active]/trigger:bg-theme-surface-primary group-data-[state=active]/trigger:shadow-md data-[error=false]:data-[filled=false]:group-data-[state=active]/trigger:border-theme-border-bold",children:a?e.jsx(Pe,{type:t}):e.jsx(Qe,{type:t})})}function Pe({type:t}){const{watch:s}=p(),r=s(`components.${t}`);return r&&r.id?e.jsxs("div",{className:"flex flex-col items-center gap-2 text-text-sm",children:[e.jsx("img",{width:24,height:24,src:r.logoUrl,alt:`Icon of ${r.name}`}),e.jsxs("div",{className:"space-y-0.25",children:[e.jsx("div",{className:"text-theme-text-primary",children:r.name}),e.jsx("div",{className:"text-text-xs text-theme-text-tertiary",children:u(t)})]})]}):null}function Qe({type:t}){return e.jsxs(e.Fragment,{children:[e.jsx(V,{className:"h-5 w-5 shrink-0 fill-theme-text-tertiary group-data-[state=active]/trigger:fill-theme-surface-strong",type:t}),e.jsx("span",{children:u(t)})]})}function Ue(){return e.jsxs("div",{className:"flex h-full flex-col justify-between space-y-5",children:[e.jsxs("div",{className:"space-y-5 p-5",children:[e.jsx(Je,{}),e.jsx(Ze,{})]}),e.jsx(Ge,{})]})}function Ze(){const{watch:t,resetField:s}=p();return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h2",{className:"text-text-lg font-semibold",children:"Add Components"}),e.jsxs("p",{className:"text-theme-text-secondary",children:["All stacks have at minimum an orchestrator and an artifact store."," ",e.jsx("a",{target:"_blank",rel:"noopener noreferrer",href:"https://docs.zenml.io/stack-components/component-guide",className:"link text-primary-400",children:"Learn more"})]})]}),e.jsx(H,{children:e.jsx("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 xl:grid-cols-4",children:b.map(r=>e.jsxs("div",{className:"relative",children:[e.jsx(P,{className:"group/trigger w-full",value:r,children:e.jsx(He,{type:r})}),t(`components.${r}.id`)&&e.jsx("button",{type:"button",onClick:n=>{n.preventDefault(),s(`components.${r}`)},className:"absolute right-[-12px] top-[-12px] flex aspect-square h-[28px] w-[28px] items-center justify-center rounded-rounded bg-theme-surface-primary",children:e.jsx(Ce,{className:"h-5 w-5 shrink-0 fill-success-400"})})]},r))})})]})}function Ge(){const{formState:{isSubmitting:t}}=p(),s=!!xe();return e.jsxs("div",{className:"flex items-center justify-end space-x-2 border-t border-theme-border-moderate p-5",children:[e.jsx(f,{asChild:!0,intent:"secondary",size:"md",children:e.jsx(Le,{to:B.stacks.create.index,children:"Cancel"})}),e.jsxs(f,{className:"flex items-center gap-1",disabled:t||s,size:"md",children:[(s||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 Stack"]})]})}function Je(){var r;const{register:t,formState:{errors:s}}=p();return e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{className:"text-text-sm",htmlFor:"stack-name",children:"Stack Name"}),e.jsx(R,{id:"stack-name",className:`${s.stackName?"border-red-500":""} w-full`,placeholder:"zenml-stack",...t("stackName")}),s.stackName&&e.jsx("p",{className:"text-text-xs text-red-500",children:(r=s.stackName.message)==null?void 0:r.toString()})]})}const k=x.object({id:x.string().trim().min(1),name:x.string().trim().min(1),logoUrl:x.string().trim().min(1)}),Ke=b.reduce((t,s)=>(t[s]=k.nullable(),t),{}),We=x.object({stackName:ze,components:x.object({...Ke,orchestrator:k,artifact_store:k})});function Xe(){const{toast:t}=oe(),s=_e(),r=fe(),n=ve({onSuccess:async()=>{r.invalidateQueries({queryKey:Fe.all}),s(B.stacks.overview)},onError:c=>{t({status:"error",emphasis:"subtle",icon:e.jsx(ce,{className:"h-5 w-5 shrink-0 fill-error-700"}),description:c.message,rounded:!0})}});function a(c){const i=Object.entries(c.components).reduce((h,[l,m])=>(m&&(h[l]=[m.id]),h),{}),g={name:c.stackName,components:i};n.mutate({payload:g})}const o=me({resolver:Te(We),defaultValues:{components:{alerter:null,orchestrator:{},annotator:null,artifact_store:{},container_registry:null,data_validator:null,experiment_tracker:null,feature_store:null,model_registry:null,image_builder:null,model_deployer:null,step_operator:null},stackName:""}});return{createManualStack:a,form:o}}function Tt(){const[t,s]=d.useState(""),{createManualStack:r,form:n}=Xe();return e.jsx(ue,{...n,children:e.jsx(Q,{value:t,onValueChange:s,className:"h-full",children:e.jsxs("form",{onSubmit:n.handleSubmit(r),className:"flex h-[calc(100vh_-_4rem_-_4rem_-_2px)] flex-1 flex-col divide-y divide-theme-border-moderate xl:flex-row-reverse xl:divide-x xl:divide-y-0 xl:divide-x-reverse",children:[e.jsx($,{className:"h-full flex-1 bg-theme-surface-primary",children:e.jsx(Ue,{})}),e.jsx($,{children:e.jsx(Ee,{})})]})})})}function $({className:t,...s}){return e.jsx("div",{className:le("w-full overflow-y-auto xl:w-1/2",t),...s})}export{Tt as default};
@@ -1 +1 @@
1
- import{r as i,j as e}from"./@radix-Cdvw4jJ8.js";import{e as d,g as c,b8 as y,an as m,D as N,l as w,B as x,m as L,p as b,r as u,b9 as P,b as H,T as C,q as h,s as p,a3 as S,t as j,ba as f,bb as k,ap as M,ab as z,h as E,bc as T}from"./index-BFqbGSck.js";import{h as D,b as g}from"./@tanstack-5gTMR7G2.js";import{L as v}from"./@react-router-DeDfXbUF.js";import{S as U}from"./pipeline-CSUlkd50.js";import{S as Z}from"./terminal-XFL_4QN-.js";import{u as R}from"./update-current-user-mutation-D5MjcQ6F.js";import{S as B}from"./plus-Cl0_rCVF.js";import"./@reactflow-8OCk19Fi.js";const _=s=>i.createElement("svg",{viewBox:"0 0 24 24",fill:"black",xmlns:"http://www.w3.org/2000/svg",...s},i.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.66438 2.01352C10.2092 2.10431 10.5772 2.61954 10.4864 3.16431L9.84711 6.99991H15.8195L16.5136 2.83551C16.6044 2.29074 17.1196 1.92272 17.6644 2.01352C18.2091 2.10431 18.5772 2.61954 18.4864 3.16431L17.8471 6.99991H20.5C21.0523 6.99991 21.5 7.44763 21.5 7.99991C21.5 8.5522 21.0523 8.99991 20.5 8.99991H17.5138L16.5138 14.9999H19.5C20.0523 14.9999 20.5 15.4476 20.5 15.9999C20.5 16.5522 20.0523 16.9999 19.5 16.9999H16.1804L15.4864 21.1643C15.3956 21.7091 14.8803 22.0771 14.3356 21.9863C13.7908 21.8955 13.4228 21.3803 13.5136 20.8355L14.1528 16.9999H8.18045L7.48638 21.1643C7.39558 21.7091 6.88036 22.0771 6.33559 21.9863C5.79082 21.8955 5.4228 21.3803 5.51359 20.8355L6.15286 16.9999H2.5C1.94772 16.9999 1.5 16.5522 1.5 15.9999C1.5 15.4476 1.94772 14.9999 2.5 14.9999H6.48619L7.48619 8.99991H3.5C2.94772 8.99991 2.5 8.5522 2.5 7.99991C2.5 7.44763 2.94772 6.99991 3.5 6.99991H7.81953L8.51359 2.83551C8.60439 2.29074 9.11961 1.92272 9.66438 2.01352ZM9.51378 8.99991L8.51378 14.9999H14.4862L15.4862 8.99991H9.51378Z"})),I=s=>i.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...s},i.createElement("g",{id:"settings"},i.createElement("g",{id:"Icon (Stroke)"},i.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 16C14.2091 16 16 14.2091 16 12C16 9.79086 14.2091 8 12 8C9.79084 8 7.99998 9.79086 7.99998 12C7.99998 14.2091 9.79084 16 12 16ZM14 12C14 13.1046 13.1046 14 12 14C10.8954 14 9.99998 13.1046 9.99998 12C9.99998 10.8954 10.8954 10 12 10C13.1046 10 14 10.8954 14 12Z"}),i.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.3426 2.32757C13.1416 0.826354 10.8583 0.826356 9.65737 2.32758L7.8196 4.62479C7.62983 4.86201 7.34251 5.0001 7.03873 5.0001H5.23605C3.0059 5.0001 1.55541 7.34703 2.55277 9.34174L3.65834 11.5529C3.7991 11.8344 3.7991 12.1658 3.65834 12.4473L2.55277 14.6585C1.55542 16.6532 3.0059 19.0001 5.23605 19.0001H7.03873C7.34251 19.0001 7.62983 19.1382 7.8196 19.3754L9.65737 21.6726C10.8584 23.1738 13.1416 23.1738 14.3426 21.6726L16.1804 19.3754C16.3701 19.1382 16.6574 19.0001 16.9612 19.0001H18.7639C20.9941 19.0001 22.4445 16.6532 21.4472 14.6585L20.3416 12.4473C20.2009 12.1658 20.2009 11.8344 20.3416 11.5529L21.4472 9.34174C22.4445 7.34703 20.9941 5.0001 18.7639 5.0001H16.9612C16.6574 5.0001 16.3701 4.86201 16.1804 4.62479L14.3426 2.32757ZM11.2191 3.57697C11.6194 3.07656 12.3805 3.07656 12.7808 3.57696L14.6186 5.87418C15.1879 6.58583 16.0499 7.0001 16.9612 7.0001H18.7639C19.5073 7.0001 19.9908 7.78241 19.6583 8.44731L18.5528 10.6585C18.1305 11.503 18.1305 12.4972 18.5528 13.3417L19.6583 15.5529C19.9908 16.2178 19.5073 17.0001 18.7639 17.0001H16.9612C16.0499 17.0001 15.1879 17.4144 14.6186 18.126L12.7809 20.4232C12.3805 20.9236 11.6194 20.9236 11.2191 20.4232L9.38134 18.126C8.81202 17.4144 7.95008 17.0001 7.03873 17.0001H5.23605C4.49267 17.0001 4.00917 16.2178 4.34162 15.5529L5.44719 13.3417C5.86949 12.4972 5.86949 11.503 5.44719 10.6585L4.34162 8.44731C4.00917 7.78241 4.49267 7.0001 5.23605 7.0001H7.03873C7.95008 7.0001 8.81202 6.58583 9.38134 5.87418L11.2191 3.57697Z"})))),Q=s=>i.createElement("svg",{viewBox:"0 0 24 24",fill:"black",xmlns:"http://www.w3.org/2000/svg",...s},i.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.32406 1C8.33723 1 8.35044 1 8.36368 1L15.6768 1C16.0385 0.999969 16.3745 0.999939 16.6496 1.02491C16.9375 1.05104 17.2968 1.11316 17.6284 1.33301C18.0677 1.62422 18.3743 2.07707 18.4816 2.5931C18.5625 2.98268 18.4868 3.33932 18.4041 3.61632C18.3251 3.88107 18.2003 4.19305 18.0659 4.52883L17.0433 7.0853C17.0204 7.1427 17.0092 7.17072 17.0015 7.1913C17.0014 7.19179 17.0012 7.19225 17.001 7.1927C17.001 7.19318 17.001 7.19368 17.001 7.19419C17.0005 7.21616 17.0004 7.24632 17.0004 7.30814V9.43876C17.0004 9.55027 17.0006 9.60549 17.0022 9.64564C17.0022 9.64665 17.0023 9.64763 17.0023 9.64856C17.0029 9.64932 17.0034 9.6501 17.0041 9.65092C17.0279 9.68326 17.0622 9.7265 17.1319 9.81357L18.7295 11.8106C19.0385 12.1968 19.3122 12.5388 19.504 12.829C19.6913 13.1123 19.9193 13.5133 19.9198 13.9978C19.9205 14.6069 19.6435 15.1831 19.1675 15.5631C18.7888 15.8654 18.3333 15.9379 17.995 15.9686C17.6486 16.0001 17.2106 16 16.7159 16L13.0004 16L13.0004 22C13.0004 22.5523 12.5527 23 12.0004 23C11.4481 23 11.0004 22.5523 11.0004 22L11.0004 16L7.28496 16C6.79028 16 6.35222 16.0001 6.00585 15.9686C5.66758 15.9379 5.21203 15.8654 4.83335 15.5631C4.35733 15.1831 4.0804 14.6069 4.08106 13.9978C4.08158 13.5133 4.30954 13.1123 4.49686 12.829C4.68867 12.5388 4.96234 12.1968 5.27138 11.8105L6.86895 9.81357C6.93861 9.7265 6.97297 9.68327 6.99681 9.65092C6.99741 9.6501 6.99799 9.64932 6.99854 9.64856C6.99858 9.64762 6.99862 9.64665 6.99866 9.64564C7.00025 9.60549 7.00043 9.55027 7.00043 9.43876V7.30814C7.00043 7.24632 7.00037 7.21617 6.99987 7.1942C6.99986 7.19368 6.99985 7.19318 6.99984 7.1927C6.99967 7.19225 6.9995 7.19179 6.99932 7.1913C6.99162 7.17072 6.98047 7.1427 6.95752 7.0853L5.94964 4.56562C5.94473 4.55333 5.93982 4.54107 5.93493 4.52884C5.80058 4.19306 5.67575 3.88107 5.59675 3.61632C5.51409 3.33932 5.43834 2.98268 5.51929 2.5931C5.62652 2.07707 5.93312 1.62422 6.37241 1.33301C6.70406 1.11316 7.06333 1.05104 7.35122 1.02491C7.62638 0.999939 7.9624 0.999969 8.32406 1ZM16.6714 14C17.2242 14 17.5695 13.999 17.8141 13.9768C17.8312 13.9752 17.847 13.9736 17.8615 13.972C17.8537 13.9596 17.8451 13.9463 17.8356 13.932C17.7002 13.7271 17.4853 13.4568 17.14 13.0252L15.5702 11.063C15.5614 11.052 15.5523 11.0407 15.5431 11.0292C15.4416 10.903 15.3139 10.744 15.2194 10.5591C15.1374 10.3987 15.0775 10.2278 15.0413 10.0513C14.9995 9.84793 15 9.64398 15.0004 9.48205C15.0004 9.46725 15.0004 9.45281 15.0004 9.43876V7.30814C15.0004 7.30039 15.0004 7.29243 15.0004 7.28429C15.0003 7.19422 15.0001 7.08077 15.0134 6.96478C15.025 6.86392 15.0442 6.76409 15.071 6.66615C15.1017 6.55352 15.144 6.44823 15.1775 6.36464C15.1806 6.35709 15.1835 6.34971 15.1864 6.34252L16.1943 3.82284C16.3484 3.43753 16.4378 3.21134 16.4876 3.04443C16.4903 3.03549 16.4927 3.02712 16.4949 3.01929C16.4868 3.01843 16.4781 3.01757 16.4689 3.01672C16.2954 3.00098 16.0522 3 15.6372 3H8.36368C7.94869 3 7.70547 3.00098 7.53199 3.01672C7.52271 3.01757 7.51404 3.01843 7.50595 3.01929C7.50815 3.02712 7.51057 3.03549 7.51324 3.04443C7.56305 3.21134 7.65247 3.43753 7.8066 3.82284L8.81447 6.34252C8.81735 6.34971 8.82031 6.35709 8.82334 6.36465C8.8569 6.44823 8.89917 6.55352 8.9299 6.66615C8.95662 6.76409 8.97585 6.86392 8.98741 6.96478C9.00071 7.08077 9.00057 7.19423 9.00045 7.2843C9.00044 7.29244 9.00043 7.30039 9.00043 7.30814V9.43876C9.00043 9.45281 9.00046 9.46725 9.0005 9.48205C9.00087 9.64398 9.00133 9.84793 8.95959 10.0513C8.92337 10.2278 8.86344 10.3987 8.78146 10.5591C8.68701 10.744 8.55923 10.903 8.45778 11.0292C8.44852 11.0407 8.43947 11.052 8.43069 11.063L6.86091 13.0252C6.51558 13.4568 6.30064 13.7271 6.16521 13.932C6.15573 13.9463 6.14712 13.9596 6.13932 13.972C6.15384 13.9736 6.16964 13.9752 6.18677 13.9768C6.43132 13.999 6.77664 14 7.32943 14H16.6714Z"}));function q({projectId:s}){var l;const t=d();if(t.isPending||t.isError)return e.jsxs(e.Fragment,{children:[e.jsx(c,{className:"h-[44px] w-full"}),e.jsx("div",{"aria-hidden":"true",className:"my-1 h-[1px] bg-theme-border-moderate"})]});const a=((l=t.data.body)==null?void 0:l.default_project_id)===s,n=t.data.id;return a?e.jsx(o,{userId:n}):e.jsx(o,{projectId:s,userId:n})}function o({projectId:s}){const t=D(),{mutate:r,isPending:a}=R({onSuccess:()=>{t.invalidateQueries({queryKey:y()})}});return e.jsx(m,{onSelect:()=>{r({default_project_id:s||null})},disabled:a,className:"hover:cursor-pointer",icon:e.jsx(Q,{}),children:s?"Set as default":"Unset as default"})}function V({projectId:s}){return e.jsxs(N,{children:[e.jsx(w,{asChild:!0,children:e.jsx(x,{className:"z-20 flex aspect-square size-6 shrink-0 items-center justify-center bg-white p-0",intent:"secondary",emphasis:"bold",size:"sm",children:e.jsx(L,{className:"h-5 w-5 fill-theme-text-secondary"})})}),e.jsxs(b,{className:"z-10",align:"end",sideOffset:1,children:[e.jsx(m,{asChild:!0,icon:e.jsx(I,{}),children:e.jsx(v,{className:"hover:cursor-pointer",to:u.projects.settings.repositories.overview,children:"Project Settings"})}),e.jsx("div",{"aria-hidden":"true",className:"my-1 h-[1px] bg-theme-border-moderate"}),e.jsx(q,{projectId:s})]})]})}function F({project:s,isDefault:t=!1}){var n;const r=(n=s.body)==null?void 0:n.display_name,a=`https://public-flavor-logos.s3.eu-central-1.amazonaws.com/projects/${P(s.name)}.jpg`;return e.jsxs(H,{className:"group relative h-full overflow-hidden transition-all duration-300 hover:shadow-md",children:[e.jsxs("div",{className:"relative h-[180px] w-full",children:[e.jsx("img",{alt:s.name,src:a,className:"h-full w-full object-cover"}),e.jsx("div",{className:"absolute right-2 top-2 z-10 opacity-0 transition-all duration-300 group-hover:opacity-100",children:e.jsx(V,{projectId:s.id})})]}),e.jsxs("div",{className:"space-y-5 p-5",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("p",{className:"truncate text-text-xl font-semibold",children:r}),t&&e.jsx(G,{})]}),e.jsxs("div",{className:"flex items-center gap-0.5 text-text-sm text-theme-text-secondary",children:[e.jsx(_,{width:16,height:16,className:"shrink-0 fill-theme-text-tertiary"}),e.jsx("p",{className:"truncate",children:s.name})]})]}),e.jsx("div",{className:"space-y-4",children:e.jsx(K,{projectName:s.id})}),e.jsx($,{projectId:s.name})]}),e.jsx(v,{to:u.projects.pipelines.overview,className:"absolute inset-0"})]})}function K({projectName:s}){const t=g({...f.projectStatistics(s)});if(t.isPending)return e.jsx(c,{className:"h-4 w-[120px]"});if(t.isError)return null;const r=t.data;return e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsxs("div",{className:"flex items-center gap-0.5",children:[e.jsx(U,{width:16,height:16,className:"shrink-0 fill-theme-text-tertiary"}),e.jsxs("p",{className:"text-text-sm text-theme-text-secondary",children:[r.pipelines," pipelines"]})]}),e.jsxs("div",{className:"flex items-center gap-0.5",children:[e.jsx(Z,{width:16,height:16,className:"shrink-0 fill-theme-text-tertiary"}),e.jsxs("p",{className:"text-text-sm text-theme-text-secondary",children:[r.runs," runs"]})]})]})}function $({projectId:s}){const{copied:t,copyToClipboard:r}=k(),a=`zenml project set ${s}`;return e.jsx("div",{className:"flex items-center gap-2 truncate",children:e.jsxs("div",{className:"flex w-full items-center justify-between gap-1 truncate rounded-md border border-theme-border-moderate bg-theme-surface-secondary px-2 py-1 text-text-sm text-theme-text-secondary",children:[e.jsx("code",{className:"truncate",children:a}),t?e.jsxs(e.Fragment,{children:[e.jsx(M,{className:"h-3 w-3 shrink-0 fill-theme-text-tertiary"}),e.jsx("p",{className:"sr-only",children:"copied successfully"})]}):e.jsxs("button",{className:"z-10",onClick:()=>r(a),children:[e.jsx(z,{className:"h-3 w-3 shrink-0 fill-theme-text-tertiary"}),e.jsx("p",{className:"sr-only",children:"Copy tenantUrl"})]})]})})}function G(){return e.jsx(C,{children:e.jsxs(h,{children:[e.jsx(p,{className:"z-10",children:e.jsx(S,{size:"sm",rounded:!1,className:"font-semibold uppercase",color:"purple",children:"Default"})}),e.jsxs(j,{className:"max-w-[320px] space-y-0.5",children:[e.jsx("p",{className:"font-semibold",children:"This is your default project in this workspace"}),e.jsx("p",{children:"This project is used automatically when no specific project is selected"})]})]})})}function O(){var n,l;const s=g({...f.projectDetail("default")}),t=d();if(s.isPending||t.isPending)return e.jsx("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3",children:e.jsx("div",{className:"h-full w-full",children:e.jsx(c,{className:"h-[400px] w-full"})})});if(s.isError)return e.jsx("p",{children:s.error.message});const r=s.data,a=(l=(n=t.data)==null?void 0:n.body)==null?void 0:l.default_project_id;return e.jsx("ul",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3",children:e.jsx("li",{children:e.jsx(F,{project:r,isDefault:a===r.id})})})}function A(){return e.jsx("div",{className:"flex flex-wrap items-center justify-end gap-2",children:e.jsx(C,{children:e.jsxs(h,{children:[e.jsx(p,{className:"z-10",children:e.jsxs("div",{className:E(T({size:"md"}),"pointer-events-none bg-primary-50"),children:[e.jsx(B,{width:24,height:24,className:"shrink-0 fill-white"}),"New Project"]})}),e.jsxs(j,{side:"bottom",align:"end",className:"max-w-[320px] space-y-4 border border-theme-border-moderate bg-theme-surface-primary p-5 text-text-md text-theme-text-primary",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx("p",{children:"Upgrade to create Projects"}),e.jsx("p",{className:"text-text-sm text-theme-text-secondary",children:"Get access to additional projects and workspaces, manage users and permissions, and get advanced features with ZenML Pro"})]}),e.jsx(x,{asChild:!0,children:e.jsx("a",{target:"_blank",className:"block w-fit",rel:"noopener noreferrer",href:"https://cloud.zenml.io/signup",children:"Try ZenML Pro"})})]})]})})})}function i1(){return e.jsxs("div",{className:"layout-container space-y-4 py-5",children:[e.jsx(A,{}),e.jsx(O,{})]})}export{i1 as default};
1
+ import{r as i,j as e}from"./@radix-Cdvw4jJ8.js";import{e as d,g as c,b9 as y,an as m,D as N,l as w,B as x,m as L,p as b,r as u,ba as P,b as H,T as C,q as h,s as p,a3 as S,t as j,bb as f,bc as k,ap as M,ab as z,h as E,b0 as T}from"./index-BgEfQ3_G.js";import{h as D,b as g}from"./@tanstack-5gTMR7G2.js";import{L as v}from"./@react-router-DeDfXbUF.js";import{S as U}from"./pipeline-CSUlkd50.js";import{S as Z}from"./terminal-XFL_4QN-.js";import{u as R}from"./update-current-user-mutation-Ca-Lmwuj.js";import{S as B}from"./plus-Cl0_rCVF.js";import"./@reactflow-B_iCtR7X.js";const _=s=>i.createElement("svg",{viewBox:"0 0 24 24",fill:"black",xmlns:"http://www.w3.org/2000/svg",...s},i.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.66438 2.01352C10.2092 2.10431 10.5772 2.61954 10.4864 3.16431L9.84711 6.99991H15.8195L16.5136 2.83551C16.6044 2.29074 17.1196 1.92272 17.6644 2.01352C18.2091 2.10431 18.5772 2.61954 18.4864 3.16431L17.8471 6.99991H20.5C21.0523 6.99991 21.5 7.44763 21.5 7.99991C21.5 8.5522 21.0523 8.99991 20.5 8.99991H17.5138L16.5138 14.9999H19.5C20.0523 14.9999 20.5 15.4476 20.5 15.9999C20.5 16.5522 20.0523 16.9999 19.5 16.9999H16.1804L15.4864 21.1643C15.3956 21.7091 14.8803 22.0771 14.3356 21.9863C13.7908 21.8955 13.4228 21.3803 13.5136 20.8355L14.1528 16.9999H8.18045L7.48638 21.1643C7.39558 21.7091 6.88036 22.0771 6.33559 21.9863C5.79082 21.8955 5.4228 21.3803 5.51359 20.8355L6.15286 16.9999H2.5C1.94772 16.9999 1.5 16.5522 1.5 15.9999C1.5 15.4476 1.94772 14.9999 2.5 14.9999H6.48619L7.48619 8.99991H3.5C2.94772 8.99991 2.5 8.5522 2.5 7.99991C2.5 7.44763 2.94772 6.99991 3.5 6.99991H7.81953L8.51359 2.83551C8.60439 2.29074 9.11961 1.92272 9.66438 2.01352ZM9.51378 8.99991L8.51378 14.9999H14.4862L15.4862 8.99991H9.51378Z"})),I=s=>i.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...s},i.createElement("g",{id:"settings"},i.createElement("g",{id:"Icon (Stroke)"},i.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 16C14.2091 16 16 14.2091 16 12C16 9.79086 14.2091 8 12 8C9.79084 8 7.99998 9.79086 7.99998 12C7.99998 14.2091 9.79084 16 12 16ZM14 12C14 13.1046 13.1046 14 12 14C10.8954 14 9.99998 13.1046 9.99998 12C9.99998 10.8954 10.8954 10 12 10C13.1046 10 14 10.8954 14 12Z"}),i.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.3426 2.32757C13.1416 0.826354 10.8583 0.826356 9.65737 2.32758L7.8196 4.62479C7.62983 4.86201 7.34251 5.0001 7.03873 5.0001H5.23605C3.0059 5.0001 1.55541 7.34703 2.55277 9.34174L3.65834 11.5529C3.7991 11.8344 3.7991 12.1658 3.65834 12.4473L2.55277 14.6585C1.55542 16.6532 3.0059 19.0001 5.23605 19.0001H7.03873C7.34251 19.0001 7.62983 19.1382 7.8196 19.3754L9.65737 21.6726C10.8584 23.1738 13.1416 23.1738 14.3426 21.6726L16.1804 19.3754C16.3701 19.1382 16.6574 19.0001 16.9612 19.0001H18.7639C20.9941 19.0001 22.4445 16.6532 21.4472 14.6585L20.3416 12.4473C20.2009 12.1658 20.2009 11.8344 20.3416 11.5529L21.4472 9.34174C22.4445 7.34703 20.9941 5.0001 18.7639 5.0001H16.9612C16.6574 5.0001 16.3701 4.86201 16.1804 4.62479L14.3426 2.32757ZM11.2191 3.57697C11.6194 3.07656 12.3805 3.07656 12.7808 3.57696L14.6186 5.87418C15.1879 6.58583 16.0499 7.0001 16.9612 7.0001H18.7639C19.5073 7.0001 19.9908 7.78241 19.6583 8.44731L18.5528 10.6585C18.1305 11.503 18.1305 12.4972 18.5528 13.3417L19.6583 15.5529C19.9908 16.2178 19.5073 17.0001 18.7639 17.0001H16.9612C16.0499 17.0001 15.1879 17.4144 14.6186 18.126L12.7809 20.4232C12.3805 20.9236 11.6194 20.9236 11.2191 20.4232L9.38134 18.126C8.81202 17.4144 7.95008 17.0001 7.03873 17.0001H5.23605C4.49267 17.0001 4.00917 16.2178 4.34162 15.5529L5.44719 13.3417C5.86949 12.4972 5.86949 11.503 5.44719 10.6585L4.34162 8.44731C4.00917 7.78241 4.49267 7.0001 5.23605 7.0001H7.03873C7.95008 7.0001 8.81202 6.58583 9.38134 5.87418L11.2191 3.57697Z"})))),Q=s=>i.createElement("svg",{viewBox:"0 0 24 24",fill:"black",xmlns:"http://www.w3.org/2000/svg",...s},i.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.32406 1C8.33723 1 8.35044 1 8.36368 1L15.6768 1C16.0385 0.999969 16.3745 0.999939 16.6496 1.02491C16.9375 1.05104 17.2968 1.11316 17.6284 1.33301C18.0677 1.62422 18.3743 2.07707 18.4816 2.5931C18.5625 2.98268 18.4868 3.33932 18.4041 3.61632C18.3251 3.88107 18.2003 4.19305 18.0659 4.52883L17.0433 7.0853C17.0204 7.1427 17.0092 7.17072 17.0015 7.1913C17.0014 7.19179 17.0012 7.19225 17.001 7.1927C17.001 7.19318 17.001 7.19368 17.001 7.19419C17.0005 7.21616 17.0004 7.24632 17.0004 7.30814V9.43876C17.0004 9.55027 17.0006 9.60549 17.0022 9.64564C17.0022 9.64665 17.0023 9.64763 17.0023 9.64856C17.0029 9.64932 17.0034 9.6501 17.0041 9.65092C17.0279 9.68326 17.0622 9.7265 17.1319 9.81357L18.7295 11.8106C19.0385 12.1968 19.3122 12.5388 19.504 12.829C19.6913 13.1123 19.9193 13.5133 19.9198 13.9978C19.9205 14.6069 19.6435 15.1831 19.1675 15.5631C18.7888 15.8654 18.3333 15.9379 17.995 15.9686C17.6486 16.0001 17.2106 16 16.7159 16L13.0004 16L13.0004 22C13.0004 22.5523 12.5527 23 12.0004 23C11.4481 23 11.0004 22.5523 11.0004 22L11.0004 16L7.28496 16C6.79028 16 6.35222 16.0001 6.00585 15.9686C5.66758 15.9379 5.21203 15.8654 4.83335 15.5631C4.35733 15.1831 4.0804 14.6069 4.08106 13.9978C4.08158 13.5133 4.30954 13.1123 4.49686 12.829C4.68867 12.5388 4.96234 12.1968 5.27138 11.8105L6.86895 9.81357C6.93861 9.7265 6.97297 9.68327 6.99681 9.65092C6.99741 9.6501 6.99799 9.64932 6.99854 9.64856C6.99858 9.64762 6.99862 9.64665 6.99866 9.64564C7.00025 9.60549 7.00043 9.55027 7.00043 9.43876V7.30814C7.00043 7.24632 7.00037 7.21617 6.99987 7.1942C6.99986 7.19368 6.99985 7.19318 6.99984 7.1927C6.99967 7.19225 6.9995 7.19179 6.99932 7.1913C6.99162 7.17072 6.98047 7.1427 6.95752 7.0853L5.94964 4.56562C5.94473 4.55333 5.93982 4.54107 5.93493 4.52884C5.80058 4.19306 5.67575 3.88107 5.59675 3.61632C5.51409 3.33932 5.43834 2.98268 5.51929 2.5931C5.62652 2.07707 5.93312 1.62422 6.37241 1.33301C6.70406 1.11316 7.06333 1.05104 7.35122 1.02491C7.62638 0.999939 7.9624 0.999969 8.32406 1ZM16.6714 14C17.2242 14 17.5695 13.999 17.8141 13.9768C17.8312 13.9752 17.847 13.9736 17.8615 13.972C17.8537 13.9596 17.8451 13.9463 17.8356 13.932C17.7002 13.7271 17.4853 13.4568 17.14 13.0252L15.5702 11.063C15.5614 11.052 15.5523 11.0407 15.5431 11.0292C15.4416 10.903 15.3139 10.744 15.2194 10.5591C15.1374 10.3987 15.0775 10.2278 15.0413 10.0513C14.9995 9.84793 15 9.64398 15.0004 9.48205C15.0004 9.46725 15.0004 9.45281 15.0004 9.43876V7.30814C15.0004 7.30039 15.0004 7.29243 15.0004 7.28429C15.0003 7.19422 15.0001 7.08077 15.0134 6.96478C15.025 6.86392 15.0442 6.76409 15.071 6.66615C15.1017 6.55352 15.144 6.44823 15.1775 6.36464C15.1806 6.35709 15.1835 6.34971 15.1864 6.34252L16.1943 3.82284C16.3484 3.43753 16.4378 3.21134 16.4876 3.04443C16.4903 3.03549 16.4927 3.02712 16.4949 3.01929C16.4868 3.01843 16.4781 3.01757 16.4689 3.01672C16.2954 3.00098 16.0522 3 15.6372 3H8.36368C7.94869 3 7.70547 3.00098 7.53199 3.01672C7.52271 3.01757 7.51404 3.01843 7.50595 3.01929C7.50815 3.02712 7.51057 3.03549 7.51324 3.04443C7.56305 3.21134 7.65247 3.43753 7.8066 3.82284L8.81447 6.34252C8.81735 6.34971 8.82031 6.35709 8.82334 6.36465C8.8569 6.44823 8.89917 6.55352 8.9299 6.66615C8.95662 6.76409 8.97585 6.86392 8.98741 6.96478C9.00071 7.08077 9.00057 7.19423 9.00045 7.2843C9.00044 7.29244 9.00043 7.30039 9.00043 7.30814V9.43876C9.00043 9.45281 9.00046 9.46725 9.0005 9.48205C9.00087 9.64398 9.00133 9.84793 8.95959 10.0513C8.92337 10.2278 8.86344 10.3987 8.78146 10.5591C8.68701 10.744 8.55923 10.903 8.45778 11.0292C8.44852 11.0407 8.43947 11.052 8.43069 11.063L6.86091 13.0252C6.51558 13.4568 6.30064 13.7271 6.16521 13.932C6.15573 13.9463 6.14712 13.9596 6.13932 13.972C6.15384 13.9736 6.16964 13.9752 6.18677 13.9768C6.43132 13.999 6.77664 14 7.32943 14H16.6714Z"}));function q({projectId:s}){var l;const t=d();if(t.isPending||t.isError)return e.jsxs(e.Fragment,{children:[e.jsx(c,{className:"h-[44px] w-full"}),e.jsx("div",{"aria-hidden":"true",className:"my-1 h-[1px] bg-theme-border-moderate"})]});const a=((l=t.data.body)==null?void 0:l.default_project_id)===s,n=t.data.id;return a?e.jsx(o,{userId:n}):e.jsx(o,{projectId:s,userId:n})}function o({projectId:s}){const t=D(),{mutate:r,isPending:a}=R({onSuccess:()=>{t.invalidateQueries({queryKey:y()})}});return e.jsx(m,{onSelect:()=>{r({default_project_id:s||null})},disabled:a,className:"hover:cursor-pointer",icon:e.jsx(Q,{}),children:s?"Set as default":"Unset as default"})}function V({projectId:s}){return e.jsxs(N,{children:[e.jsx(w,{asChild:!0,children:e.jsx(x,{className:"z-20 flex aspect-square size-6 shrink-0 items-center justify-center bg-white p-0",intent:"secondary",emphasis:"bold",size:"sm",children:e.jsx(L,{className:"h-5 w-5 fill-theme-text-secondary"})})}),e.jsxs(b,{className:"z-10",align:"end",sideOffset:1,children:[e.jsx(m,{asChild:!0,icon:e.jsx(I,{}),children:e.jsx(v,{className:"hover:cursor-pointer",to:u.projects.settings.repositories.overview,children:"Project Settings"})}),e.jsx("div",{"aria-hidden":"true",className:"my-1 h-[1px] bg-theme-border-moderate"}),e.jsx(q,{projectId:s})]})]})}function F({project:s,isDefault:t=!1}){var n;const r=(n=s.body)==null?void 0:n.display_name,a=`https://public-flavor-logos.s3.eu-central-1.amazonaws.com/projects/${P(s.name)}.jpg`;return e.jsxs(H,{className:"group relative h-full overflow-hidden transition-all duration-300 hover:shadow-md",children:[e.jsxs("div",{className:"relative h-[180px] w-full",children:[e.jsx("img",{alt:s.name,src:a,className:"h-full w-full object-cover"}),e.jsx("div",{className:"absolute right-2 top-2 z-10 opacity-0 transition-all duration-300 group-hover:opacity-100",children:e.jsx(V,{projectId:s.id})})]}),e.jsxs("div",{className:"space-y-5 p-5",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("p",{className:"truncate text-text-xl font-semibold",children:r}),t&&e.jsx(G,{})]}),e.jsxs("div",{className:"flex items-center gap-0.5 text-text-sm text-theme-text-secondary",children:[e.jsx(_,{width:16,height:16,className:"shrink-0 fill-theme-text-tertiary"}),e.jsx("p",{className:"truncate",children:s.name})]})]}),e.jsx("div",{className:"space-y-4",children:e.jsx(K,{projectName:s.id})}),e.jsx($,{projectId:s.name})]}),e.jsx(v,{to:u.projects.pipelines.overview,className:"absolute inset-0"})]})}function K({projectName:s}){const t=g({...f.projectStatistics(s)});if(t.isPending)return e.jsx(c,{className:"h-4 w-[120px]"});if(t.isError)return null;const r=t.data;return e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsxs("div",{className:"flex items-center gap-0.5",children:[e.jsx(U,{width:16,height:16,className:"shrink-0 fill-theme-text-tertiary"}),e.jsxs("p",{className:"text-text-sm text-theme-text-secondary",children:[r.pipelines," pipelines"]})]}),e.jsxs("div",{className:"flex items-center gap-0.5",children:[e.jsx(Z,{width:16,height:16,className:"shrink-0 fill-theme-text-tertiary"}),e.jsxs("p",{className:"text-text-sm text-theme-text-secondary",children:[r.runs," runs"]})]})]})}function $({projectId:s}){const{copied:t,copyToClipboard:r}=k(),a=`zenml project set ${s}`;return e.jsx("div",{className:"flex items-center gap-2 truncate",children:e.jsxs("div",{className:"flex w-full items-center justify-between gap-1 truncate rounded-md border border-theme-border-moderate bg-theme-surface-secondary px-2 py-1 text-text-sm text-theme-text-secondary",children:[e.jsx("code",{className:"truncate",children:a}),t?e.jsxs(e.Fragment,{children:[e.jsx(M,{className:"h-3 w-3 shrink-0 fill-theme-text-tertiary"}),e.jsx("p",{className:"sr-only",children:"copied successfully"})]}):e.jsxs("button",{className:"z-10",onClick:()=>r(a),children:[e.jsx(z,{className:"h-3 w-3 shrink-0 fill-theme-text-tertiary"}),e.jsx("p",{className:"sr-only",children:"Copy tenantUrl"})]})]})})}function G(){return e.jsx(C,{children:e.jsxs(h,{children:[e.jsx(p,{className:"z-10",children:e.jsx(S,{size:"sm",rounded:!1,className:"font-semibold uppercase",color:"purple",children:"Default"})}),e.jsxs(j,{className:"max-w-[320px] space-y-0.5",children:[e.jsx("p",{className:"font-semibold",children:"This is your default project in this workspace"}),e.jsx("p",{children:"This project is used automatically when no specific project is selected"})]})]})})}function O(){var n,l;const s=g({...f.projectDetail("default")}),t=d();if(s.isPending||t.isPending)return e.jsx("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3",children:e.jsx("div",{className:"h-full w-full",children:e.jsx(c,{className:"h-[400px] w-full"})})});if(s.isError)return e.jsx("p",{children:s.error.message});const r=s.data,a=(l=(n=t.data)==null?void 0:n.body)==null?void 0:l.default_project_id;return e.jsx("ul",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3",children:e.jsx("li",{children:e.jsx(F,{project:r,isDefault:a===r.id})})})}function A(){return e.jsx("div",{className:"flex flex-wrap items-center justify-end gap-2",children:e.jsx(C,{children:e.jsxs(h,{children:[e.jsx(p,{className:"z-10",children:e.jsxs("div",{className:E(T({size:"md"}),"pointer-events-none bg-primary-50"),children:[e.jsx(B,{width:24,height:24,className:"shrink-0 fill-white"}),"New Project"]})}),e.jsxs(j,{side:"bottom",align:"end",className:"max-w-[320px] space-y-4 border border-theme-border-moderate bg-theme-surface-primary p-5 text-text-md text-theme-text-primary",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx("p",{children:"Upgrade to create Projects"}),e.jsx("p",{className:"text-text-sm text-theme-text-secondary",children:"Get access to additional projects and workspaces, manage users and permissions, and get advanced features with ZenML Pro"})]}),e.jsx(x,{asChild:!0,children:e.jsx("a",{target:"_blank",className:"block w-fit",rel:"noopener noreferrer",href:"https://cloud.zenml.io/signup",children:"Try ZenML Pro"})})]})]})})})}function i1(){return e.jsxs("div",{className:"layout-container space-y-4 py-5",children:[e.jsx(A,{}),e.jsx(O,{})]})}export{i1 as default};
@@ -1 +1 @@
1
- import{r as i,j as s}from"./@radix-Cdvw4jJ8.js";import{as as D,at as k,B as f,au as z,av as E,aw as A,ap as T,a as v,aB as b,S,I as o,az as B,aA as q,z as a,e as M,b as Q,g as P,aj as V,ak as _}from"./index-BFqbGSck.js";import{u as C}from"./update-current-user-mutation-D5MjcQ6F.js";import{h as K}from"./@tanstack-5gTMR7G2.js";import{u as F}from"./index.esm-DhJo3mA6.js";import{t as I}from"./zod-XdS2h1ws.js";import{P as O}from"./PasswordChecker-B88WjuCe.js";import{u as H}from"./UpdatePasswordSchemas-CNfKDo2Q.js";import{D as R}from"./DisplayDate-8RESqe5H.js";import"./@react-router-DeDfXbUF.js";import"./@reactflow-8OCk19Fi.js";function G(){const[e,l]=i.useState(!1);return s.jsxs(D,{onOpenChange:()=>{l(!1)},children:[s.jsx(k,{asChild:!0,children:s.jsx(f,{size:"md",className:"shrink-0",intent:"primary",emphasis:"subtle",children:"Change Password"})}),s.jsxs(z,{children:[s.jsx(E,{children:s.jsx(A,{children:" Update Credentials"})}),e?s.jsx(L,{}):s.jsx(J,{setSuccess:l})]})]})}function J({setSuccess:e}){var u;const l=i.useId(),d=i.useId(),n=i.useId(),{toast:x}=v(),{mutate:p,isPending:j}=C({onSuccess(){e(!0)},onError(t){b(t)&&x({status:"error",emphasis:"subtle",icon:s.jsx(S,{className:"h-5 w-5 shrink-0 fill-error-700"}),description:t.message,rounded:!0})}}),{register:c,handleSubmit:m,watch:w,formState:{isValid:N,errors:y}}=F({resolver:I(H),mode:"onChange",criteriaMode:"all"});function g(t){p({old_password:t.oldPassword,password:t.newPassword})}const h=(u=y.newPassword)==null?void 0:u.types;return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"space-y-5 p-7",children:[s.jsx("form",{id:"update-password-form",onSubmit:m(g),children:s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"space-y-0.5",children:[s.jsx("label",{htmlFor:l,className:"text-text-sm",children:"Old Password"}),s.jsx(o,{...c("oldPassword"),type:"password",id:l,className:"w-full"})]}),s.jsxs("div",{className:"space-y-0.5",children:[s.jsx("label",{htmlFor:d,className:"text-text-sm",children:"New Password"}),s.jsx(o,{...c("newPassword"),type:"password",id:d,className:"w-full"})]}),s.jsxs("div",{className:"space-y-0.5",children:[s.jsx("label",{htmlFor:n,className:"text-text-sm",children:"Confirm Password"}),s.jsx(o,{...c("confirmPassword"),type:"password",id:n,className:"w-full"})]})]})}),s.jsx(O,{val:w("newPassword"),errors:h||[]})]}),s.jsxs(B,{className:"gap-[10px]",children:[s.jsx(q,{asChild:!0,children:s.jsx(f,{size:"sm",intent:"secondary",children:"Cancel"})}),s.jsx(f,{disabled:!N||j,form:"update-password-form",size:"sm",children:"Update Password"})]})]})}function L(){return s.jsxs("div",{className:"space-y-5 p-7 text-center",children:[s.jsx(T,{className:"mx-auto h-[110px] w-[110px] fill-success-500"}),s.jsx("p",{className:"text-text-lg font-semibold text-theme-text-primary",children:"The password was updated successfully!"})]})}const W=a.object({fullName:a.union([a.string(),a.literal("")]),username:a.union([a.string(),a.literal("")]),email:a.union([a.string().email(),a.literal("")])}).refine(e=>e.fullName!==""||e.username!==""||e.email!=="");function X({user:e}){var h,u,t;const l=K(),{toast:d}=v(),n=i.useId(),x=i.useId(),p=i.useId(),{isPending:j,mutate:c}=C({onError(r){b(r)&&d({status:"error",emphasis:"subtle",icon:s.jsx(S,{className:"h-5 w-5 shrink-0 fill-error-700"}),description:r.message,rounded:!0})},onSuccess:()=>{l.invalidateQueries({queryKey:["current-user"]}),l.invalidateQueries({queryKey:["users"]}),w(),d({status:"success",emphasis:"subtle",rounded:!0,description:"User updated successfully"})}}),{register:m,reset:w,handleSubmit:N,formState:{isValid:y}}=F({resolver:I(W),defaultValues:{email:void 0,fullName:void 0,username:void 0}});function g(r){const U={...r.fullName&&{full_name:r.fullName},...r.username&&{name:r.username},...r.email&&{email:r.email}};c(U)}return s.jsxs("div",{className:"w-full max-w-[600px]",children:[s.jsx("form",{onSubmit:N(g),children:s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"space-y-0.5",children:[s.jsx("label",{htmlFor:n,className:"text-text-sm",children:"Full Name"}),s.jsx(o,{placeholder:(h=e.body)==null?void 0:h.full_name,...m("fullName"),id:n,className:"w-full"})]}),s.jsxs("div",{className:"space-y-0.5",children:[s.jsx("label",{htmlFor:x,className:"text-text-sm",children:"Username"}),s.jsx(o,{...m("username"),placeholder:e.name,id:x,className:"w-full"})]}),s.jsxs("div",{className:"space-y-0.5",children:[s.jsx("label",{htmlFor:p,className:"text-text-sm",children:"Email"}),s.jsx(o,{placeholder:((u=e.metadata)==null?void 0:u.email)??void 0,...m("email"),id:p,className:"w-full"})]}),s.jsx("div",{className:"flex justify-end",children:s.jsx(f,{disabled:j||!y,size:"md",intent:"primary",children:"Update"})})]})}),s.jsx(G,{}),s.jsxs("p",{className:"mt-5 text-text-sm text-theme-text-secondary",children:["Created on ",s.jsx(R,{dateString:((t=e.body)==null?void 0:t.created)||""})]})]})}function ds(){const{data:e}=M();return s.jsxs(Q,{className:"flex flex-col gap-5 p-5",children:[s.jsx("h1",{className:"text-text-xl font-semibold",children:"Profile"}),s.jsxs("div",{className:"flex justify-between",children:[e?s.jsx(X,{user:e}):s.jsx(P,{className:"h-[350px] w-full"}),e?s.jsx(V,{size:"xxl",className:"ml-5 h-[140px] w-[140px]",type:"rounded",children:s.jsx(_,{className:"text-display-lg",size:"xxl",children:e.name[0]})}):s.jsx(P,{className:"h-[140px] w-[140px] rounded-rounded"})]})]})}export{ds as default};
1
+ import{r as i,j as s}from"./@radix-Cdvw4jJ8.js";import{as as D,at as k,B as f,au as z,av as E,aw as A,ap as T,a as v,aB as b,S,I as o,az as B,aA as q,z as a,e as M,b as Q,g as P,aj as V,ak as _}from"./index-BgEfQ3_G.js";import{u as C}from"./update-current-user-mutation-Ca-Lmwuj.js";import{h as K}from"./@tanstack-5gTMR7G2.js";import{u as F}from"./index.esm-DhJo3mA6.js";import{t as I}from"./zod-XdS2h1ws.js";import{P as O}from"./PasswordChecker-B88WjuCe.js";import{u as H}from"./UpdatePasswordSchemas-D_DCETSO.js";import{D as R}from"./DisplayDate-8RESqe5H.js";import"./@react-router-DeDfXbUF.js";import"./@reactflow-B_iCtR7X.js";function G(){const[e,l]=i.useState(!1);return s.jsxs(D,{onOpenChange:()=>{l(!1)},children:[s.jsx(k,{asChild:!0,children:s.jsx(f,{size:"md",className:"shrink-0",intent:"primary",emphasis:"subtle",children:"Change Password"})}),s.jsxs(z,{children:[s.jsx(E,{children:s.jsx(A,{children:" Update Credentials"})}),e?s.jsx(L,{}):s.jsx(J,{setSuccess:l})]})]})}function J({setSuccess:e}){var u;const l=i.useId(),d=i.useId(),n=i.useId(),{toast:x}=v(),{mutate:p,isPending:j}=C({onSuccess(){e(!0)},onError(t){b(t)&&x({status:"error",emphasis:"subtle",icon:s.jsx(S,{className:"h-5 w-5 shrink-0 fill-error-700"}),description:t.message,rounded:!0})}}),{register:c,handleSubmit:m,watch:w,formState:{isValid:N,errors:y}}=F({resolver:I(H),mode:"onChange",criteriaMode:"all"});function g(t){p({old_password:t.oldPassword,password:t.newPassword})}const h=(u=y.newPassword)==null?void 0:u.types;return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"space-y-5 p-7",children:[s.jsx("form",{id:"update-password-form",onSubmit:m(g),children:s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"space-y-0.5",children:[s.jsx("label",{htmlFor:l,className:"text-text-sm",children:"Old Password"}),s.jsx(o,{...c("oldPassword"),type:"password",id:l,className:"w-full"})]}),s.jsxs("div",{className:"space-y-0.5",children:[s.jsx("label",{htmlFor:d,className:"text-text-sm",children:"New Password"}),s.jsx(o,{...c("newPassword"),type:"password",id:d,className:"w-full"})]}),s.jsxs("div",{className:"space-y-0.5",children:[s.jsx("label",{htmlFor:n,className:"text-text-sm",children:"Confirm Password"}),s.jsx(o,{...c("confirmPassword"),type:"password",id:n,className:"w-full"})]})]})}),s.jsx(O,{val:w("newPassword"),errors:h||[]})]}),s.jsxs(B,{className:"gap-[10px]",children:[s.jsx(q,{asChild:!0,children:s.jsx(f,{size:"sm",intent:"secondary",children:"Cancel"})}),s.jsx(f,{disabled:!N||j,form:"update-password-form",size:"sm",children:"Update Password"})]})]})}function L(){return s.jsxs("div",{className:"space-y-5 p-7 text-center",children:[s.jsx(T,{className:"mx-auto h-[110px] w-[110px] fill-success-500"}),s.jsx("p",{className:"text-text-lg font-semibold text-theme-text-primary",children:"The password was updated successfully!"})]})}const W=a.object({fullName:a.union([a.string(),a.literal("")]),username:a.union([a.string(),a.literal("")]),email:a.union([a.string().email(),a.literal("")])}).refine(e=>e.fullName!==""||e.username!==""||e.email!=="");function X({user:e}){var h,u,t;const l=K(),{toast:d}=v(),n=i.useId(),x=i.useId(),p=i.useId(),{isPending:j,mutate:c}=C({onError(r){b(r)&&d({status:"error",emphasis:"subtle",icon:s.jsx(S,{className:"h-5 w-5 shrink-0 fill-error-700"}),description:r.message,rounded:!0})},onSuccess:()=>{l.invalidateQueries({queryKey:["current-user"]}),l.invalidateQueries({queryKey:["users"]}),w(),d({status:"success",emphasis:"subtle",rounded:!0,description:"User updated successfully"})}}),{register:m,reset:w,handleSubmit:N,formState:{isValid:y}}=F({resolver:I(W),defaultValues:{email:void 0,fullName:void 0,username:void 0}});function g(r){const U={...r.fullName&&{full_name:r.fullName},...r.username&&{name:r.username},...r.email&&{email:r.email}};c(U)}return s.jsxs("div",{className:"w-full max-w-[600px]",children:[s.jsx("form",{onSubmit:N(g),children:s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"space-y-0.5",children:[s.jsx("label",{htmlFor:n,className:"text-text-sm",children:"Full Name"}),s.jsx(o,{placeholder:(h=e.body)==null?void 0:h.full_name,...m("fullName"),id:n,className:"w-full"})]}),s.jsxs("div",{className:"space-y-0.5",children:[s.jsx("label",{htmlFor:x,className:"text-text-sm",children:"Username"}),s.jsx(o,{...m("username"),placeholder:e.name,id:x,className:"w-full"})]}),s.jsxs("div",{className:"space-y-0.5",children:[s.jsx("label",{htmlFor:p,className:"text-text-sm",children:"Email"}),s.jsx(o,{placeholder:((u=e.metadata)==null?void 0:u.email)??void 0,...m("email"),id:p,className:"w-full"})]}),s.jsx("div",{className:"flex justify-end",children:s.jsx(f,{disabled:j||!y,size:"md",intent:"primary",children:"Update"})})]})}),s.jsx(G,{}),s.jsxs("p",{className:"mt-5 text-text-sm text-theme-text-secondary",children:["Created on ",s.jsx(R,{dateString:((t=e.body)==null?void 0:t.created)||""})]})]})}function ds(){const{data:e}=M();return s.jsxs(Q,{className:"flex flex-col gap-5 p-5",children:[s.jsx("h1",{className:"text-text-xl font-semibold",children:"Profile"}),s.jsxs("div",{className:"flex justify-between",children:[e?s.jsx(X,{user:e}):s.jsx(P,{className:"h-[350px] w-full"}),e?s.jsx(V,{size:"xxl",className:"ml-5 h-[140px] w-[140px]",type:"rounded",children:s.jsx(_,{className:"text-display-lg",size:"xxl",children:e.name[0]})}):s.jsx(P,{className:"h-[140px] w-[140px] rounded-rounded"})]})]})}export{ds as default};
@@ -1 +1 @@
1
- import{r as p,j as t}from"./@radix-Cdvw4jJ8.js";import{u as F,W as Ue,L as Ze}from"./LeftSideMenu-DCsKdIjC.js";import{W as O,H as D,B as M}from"./Wizard-Dg8Pmn5A.js";import{t as q}from"./zod-XdS2h1ws.js";import{z as y,g as G,L as Ke,I as ge,B as E,aO as Ie,aU as Qe,aV as Ye,aW as Ge,aX as Xe,ar as Je,aY as et,as as tt,au as rt,aw as st,aM as nt,m as ot,V as it,f as at,i as ct,F as lt,j as ut,a as Oe,S as dt,aj as ft,ak as mt,ai as ht,r as xt}from"./index-BFqbGSck.js";import{a as v,C as k,u as W,F as $}from"./index.esm-DhJo3mA6.js";import{S as R}from"./WizardFooter-BcNDIvlQ.js";import{C as je}from"./ComponentIcon-CbbOc7lb.js";import{R as U,a as Z,s as pt,u as yt}from"./create-stack-TKmMtrkQ.js";import{f as gt}from"./index-U992soPJ.js";import{b as X,c as jt,k as De,h as _t}from"./@tanstack-5gTMR7G2.js";import{g as vt,S as St}from"./StackName-ojLC6xdl.js";import{S as Ct}from"./transform-CeZdrxDZ.js";import{C as L}from"./ProviderIcon-DPwMR6nF.js";import{g as bt,a as wt,D as Nt,b as Pt,z as Ft}from"./form-DFJkaFDX.js";import{s as kt}from"./sharedSchema-BXzg0EZz.js";import{S as zt}from"./Lock-CrIAdQo6.js";import{T as _e}from"./Tick-BPrWnNlN.js";import{s as Me}from"./index-BjUu1mP4.js";import{C as oe,P as ie}from"./ProviderRadio-DEDNRgAb.js";import{C as At}from"./ComponentBadge-CDgdd0Ks.js";import{e as It}from"./components-Br2ezRib.js";import{L as Ot}from"./@react-router-DeDfXbUF.js";import"./@reactflow-8OCk19Fi.js";import"./layout-DBbfEFBe.js";import"./persist-Dec_w7aB.js";import"./gcp-B1I3Qvcx.js";import"./plus-Cl0_rCVF.js";import"./trash-DP6Tpp_E.js";import"./type-guards-CNgPYg8l.js";import"./index.es-C1gfATPn.js";import"./check-B9QMTa3f.js";import"./stack-detail-query-Cm0fsgo-.js";const Ee=p.createContext(null);function Dt({children:e}){const[r,s]=p.useState({stackName:null,createdStackId:null,connectorConfig:null,fullstackResources:null,artifactStoreConfig:null,registryConfig:null,orchestratorConfig:null});return t.jsx(Ee.Provider,{value:{data:r,setData:s},children:e})}function S(){const e=p.useContext(Ee);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 J(){const e=p.useContext(Re);if(!e)throw new Error("useSchemaContext must be used within a SchemaProvider");return e}const Mt=y.object({resourceId:y.string().min(1),flavor:y.string()});function Et(){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 Ve(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 Vt={};function P(e){const r=Vt[e];return r||_(0,e),r}var T;function Be(){return T}function Bt(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=Bt(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_||Y(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 Y(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)),Y(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(Ve(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)&&Y(e,o)}}function Y(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_:Be(),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=V);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 $t(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)}},V={};K(Se,(e,r)=>{V[e]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)}});V.deleteProperty=function(e,r){return V.set.call(this,e,r,void 0)};V.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 $t(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 Ht=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=Ut(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_:Be()).drafts_.push(s),s}function Ut(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)=>{Ve(s,n,We(o))}),r&&(r.finalized_=!1),s}var j=new Ht,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 Zt(){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 B({flavor:e,type:r,width:s=32,height:n=32,...o}){var l;const a=X({...gt.flavorList({name:e,type:r})});return a.isError?null:a.isPending?t.jsx(G,{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}=Zt(),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(U,{"data-state":l("resourceId")===i.value?"selected":"unselected",htmlFor:i.value,children:[t.jsx(Z,{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(B,{type:Kt,width:24,height:24,flavor:i.flavor})," ",t.jsx("span",{children:i.value})]})})},i.value))})]})]})}function Yt(){const e=W({resolver:q(Mt),shouldUnregister:!0});return t.jsx($,{...e,children:t.jsxs(O,{children:[t.jsx(D,{children:"Artifact Store"}),t.jsx(M,{children:t.jsxs("section",{className:"space-y-5 py-5 first:pt-0 last:pb-0",children:[t.jsx(Et,{}),t.jsx(Qt,{})]})}),t.jsx(R,{children:t.jsx(Gt,{})})]})})}function Gt(){const e=v();return t.jsx(E,{disabled:!e.formState.isValid,form:"artifact-store-form",size:"md",children:"Next"})}const $e=y.object({authMethod:y.string().min(1),stackName:kt});function Xt(){var h,i;const{data:e}=S(),{setCurrentStep:r}=F(),{control:s,watch:n,resetField:o}=v(),{setSchema:a,setDefaultValues:l}=J(),u=X({...Ie.serviceConnectorTypeDetail(((h=e.connectorConfig)==null?void 0:h.type)||"")});if(u.isError)return null;if(u.isPending)return t.jsx(G,{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),He=wt(C);a($e.merge(b)),l(He),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(Ye,{className:"w-fit border border-neutral-300 text-left text-text-md",children:t.jsx(Ge,{className:"flex items-center gap-2",placeholder:"Select your Auth Method"})}),t.jsx(Xe,{children:t.jsx(Je,{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 Jt(){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(Xt,{})]})}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=X({...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(G,{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}=Oe(),{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(Jt,{}),t.jsx(St,{}),t.jsx(er,{})]})}function cr(){const{schema:e,defaultValues:r}=J(),s=W({shouldUnregister:!0,mode:"onChange",resolver:q(e),defaultValues:{stackName:"",authMethod:"",...r}});return t.jsx($,{...s,children:t.jsxs(O,{children:[t.jsx(D,{children:"Connect to your Cloud"}),t.jsx(M,{children:t.jsx(ar,{})}),t.jsx(R,{children:t.jsx(lr,{})})]})})}function lr(){const{formState:{isValid:e,isSubmitting:r}}=v(),s=!!De();return t.jsx(E,{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}=Oe(),{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:Me.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(U,{"data-state":l("resourceId")===i.value?"selected":"unselected",htmlFor:i.value,children:[t.jsx(Z,{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(B,{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($,{...e,children:t.jsxs(O,{children:[t.jsx(D,{children:"Container Registry"}),t.jsx(M,{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=!!De();return t.jsxs(E,{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)}),H="kubernetes",ze="orchestrator";function gr(){const{orchestrators:e,handleFormSubmit:r}=yr(),{setSchema:s}=J(),{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!==H&&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(U,{"data-state":d===c.flavor?"selected":"unselected",htmlFor:c.flavor,children:[t.jsx(Z,{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!==H&&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(B,{width:24,height:24,type:ze,flavor:c.flavor}),t.jsx("span",{children:c.flavor_display_name})]})}),d===c.flavor&&(c.flavor===H||c.use_resource_value_as_fixed_config===!1)&&t.jsxs("div",{className:"space-y-3 py-5 pl-8",children:[c.flavor===H&&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(U,{"data-state":o("resourceId")===i?"selected":"unselected",htmlFor:i,children:[t.jsx(Z,{...m,id:i,type:"radio",value:i,name:"instance-radio"}),t.jsx(B,{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}=J(),r=W({resolver:q(e),shouldUnregister:!0,defaultValues:{resourceId:""}});return t.jsx($,{...r,children:t.jsxs(O,{children:[t.jsx(D,{children:"Orchestrator"}),t.jsxs(M,{children:[t.jsx(jr,{}),t.jsx(gr,{})]}),t.jsx(R,{children:t.jsx(vr,{})})]})})}function vr(){const e=v();return t.jsx(E,{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($,{...n,children:t.jsxs(O,{children:[t.jsx(D,{children:"Select Your Existing Cloud Infrastructure"}),t.jsx(M,{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(E,{form:"provider-form",disabled:!e,size:"md",children:"Next"})}function wr(){var o;const{data:e}=S(),r=X({...Me.stackDetail(e.createdStackId||""),throwOnError:!0});if(r.isError)return null;if(r.isPending)return t.jsx(G,{className:"h-[200px] w-full"});const s=r.data,n=It((o=r.data.metadata)==null?void 0:o.components);return t.jsxs(O,{children:[t.jsx(D,{children:"Your stack"}),t.jsx(M,{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(E,{size:"md",asChild:!0,children:t.jsx(Ot,{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(B,{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:$e,children:t.jsx(cr,{})});if(e===3)return t.jsx(Yt,{});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 us(){return t.jsx(Ue,{maxSteps:Ae.length+1,initialStep:1,children:t.jsx(Dt,{children:t.jsxs("section",{className:"layout-container flex flex-col gap-5 py-5 xl:flex-row",children:[t.jsx(Ze,{entries:Ae}),t.jsx("div",{className:"w-full",children:t.jsx(kr,{})})]})})})}export{us as default};
1
+ import{r as p,j as t}from"./@radix-Cdvw4jJ8.js";import{u as F,W as Ue,L as Ze}from"./LeftSideMenu-DPsCCK3z.js";import{W as O,H as D,B as M}from"./Wizard-BHvY75u_.js";import{t as q}from"./zod-XdS2h1ws.js";import{z as y,g as G,L as Ke,I as ge,B as E,aO as Ie,aU as Qe,aV as Ye,aW as Ge,aX as Xe,ar as Je,aY as et,as as tt,au as rt,aw as st,aM as nt,m as ot,V as it,f as at,i as ct,F as lt,j as ut,a as Oe,S as dt,aj as ft,ak as mt,ai as ht,r as xt}from"./index-BgEfQ3_G.js";import{a as v,C as k,u as W,F as $}from"./index.esm-DhJo3mA6.js";import{S as R}from"./WizardFooter-FQm8y-jP.js";import{C as je}from"./ComponentIcon-CMiVW-O6.js";import{R as U,a as Z,s as pt,u as yt}from"./create-stack-BpZrmKDu.js";import{f as gt}from"./index-eoDB_1XX.js";import{b as X,c as jt,k as De,h as _t}from"./@tanstack-5gTMR7G2.js";import{g as vt,S as St}from"./StackName-CFSZL8ec.js";import{S as Ct}from"./transform-CeZdrxDZ.js";import{C as L}from"./ProviderIcon-DHejyg7C.js";import{g as bt,a as wt,D as Nt,b as Pt,z as Ft}from"./form-BgtamtJm.js";import{s as kt}from"./sharedSchema-C_HkejsG.js";import{S as zt}from"./Lock-CrIAdQo6.js";import{T as _e}from"./Tick-Qquvr4P3.js";import{s as Me}from"./index-BBt0LDtR.js";import{C as oe,P as ie}from"./ProviderRadio-tGtie8Gc.js";import{C as At}from"./ComponentBadge-Cnecw3qz.js";import{e as It}from"./components-Br2ezRib.js";import{L as Ot}from"./@react-router-DeDfXbUF.js";import"./@reactflow-B_iCtR7X.js";import"./layout-DBbfEFBe.js";import"./persist-BsdEtCkd.js";import"./gcp-B1I3Qvcx.js";import"./plus-Cl0_rCVF.js";import"./trash-DP6Tpp_E.js";import"./type-guards-CNgPYg8l.js";import"./index.es-C1gfATPn.js";import"./check-B9QMTa3f.js";import"./stack-detail-query-CNmVZ0Bo.js";const Ee=p.createContext(null);function Dt({children:e}){const[r,s]=p.useState({stackName:null,createdStackId:null,connectorConfig:null,fullstackResources:null,artifactStoreConfig:null,registryConfig:null,orchestratorConfig:null});return t.jsx(Ee.Provider,{value:{data:r,setData:s},children:e})}function S(){const e=p.useContext(Ee);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 J(){const e=p.useContext(Re);if(!e)throw new Error("useSchemaContext must be used within a SchemaProvider");return e}const Mt=y.object({resourceId:y.string().min(1),flavor:y.string()});function Et(){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 Ve(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 Vt={};function P(e){const r=Vt[e];return r||_(0,e),r}var T;function Be(){return T}function Bt(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=Bt(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_||Y(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 Y(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)),Y(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(Ve(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)&&Y(e,o)}}function Y(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_:Be(),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=V);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 $t(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)}},V={};K(Se,(e,r)=>{V[e]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)}});V.deleteProperty=function(e,r){return V.set.call(this,e,r,void 0)};V.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 $t(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 Ht=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=Ut(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_:Be()).drafts_.push(s),s}function Ut(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)=>{Ve(s,n,We(o))}),r&&(r.finalized_=!1),s}var j=new Ht,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 Zt(){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 B({flavor:e,type:r,width:s=32,height:n=32,...o}){var l;const a=X({...gt.flavorList({name:e,type:r})});return a.isError?null:a.isPending?t.jsx(G,{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}=Zt(),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(U,{"data-state":l("resourceId")===i.value?"selected":"unselected",htmlFor:i.value,children:[t.jsx(Z,{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(B,{type:Kt,width:24,height:24,flavor:i.flavor})," ",t.jsx("span",{children:i.value})]})})},i.value))})]})]})}function Yt(){const e=W({resolver:q(Mt),shouldUnregister:!0});return t.jsx($,{...e,children:t.jsxs(O,{children:[t.jsx(D,{children:"Artifact Store"}),t.jsx(M,{children:t.jsxs("section",{className:"space-y-5 py-5 first:pt-0 last:pb-0",children:[t.jsx(Et,{}),t.jsx(Qt,{})]})}),t.jsx(R,{children:t.jsx(Gt,{})})]})})}function Gt(){const e=v();return t.jsx(E,{disabled:!e.formState.isValid,form:"artifact-store-form",size:"md",children:"Next"})}const $e=y.object({authMethod:y.string().min(1),stackName:kt});function Xt(){var h,i;const{data:e}=S(),{setCurrentStep:r}=F(),{control:s,watch:n,resetField:o}=v(),{setSchema:a,setDefaultValues:l}=J(),u=X({...Ie.serviceConnectorTypeDetail(((h=e.connectorConfig)==null?void 0:h.type)||"")});if(u.isError)return null;if(u.isPending)return t.jsx(G,{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),He=wt(C);a($e.merge(b)),l(He),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(Ye,{className:"w-fit border border-neutral-300 text-left text-text-md",children:t.jsx(Ge,{className:"flex items-center gap-2",placeholder:"Select your Auth Method"})}),t.jsx(Xe,{children:t.jsx(Je,{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 Jt(){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(Xt,{})]})}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=X({...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(G,{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}=Oe(),{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(Jt,{}),t.jsx(St,{}),t.jsx(er,{})]})}function cr(){const{schema:e,defaultValues:r}=J(),s=W({shouldUnregister:!0,mode:"onChange",resolver:q(e),defaultValues:{stackName:"",authMethod:"",...r}});return t.jsx($,{...s,children:t.jsxs(O,{children:[t.jsx(D,{children:"Connect to your Cloud"}),t.jsx(M,{children:t.jsx(ar,{})}),t.jsx(R,{children:t.jsx(lr,{})})]})})}function lr(){const{formState:{isValid:e,isSubmitting:r}}=v(),s=!!De();return t.jsx(E,{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}=Oe(),{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:Me.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(U,{"data-state":l("resourceId")===i.value?"selected":"unselected",htmlFor:i.value,children:[t.jsx(Z,{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(B,{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($,{...e,children:t.jsxs(O,{children:[t.jsx(D,{children:"Container Registry"}),t.jsx(M,{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=!!De();return t.jsxs(E,{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)}),H="kubernetes",ze="orchestrator";function gr(){const{orchestrators:e,handleFormSubmit:r}=yr(),{setSchema:s}=J(),{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!==H&&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(U,{"data-state":d===c.flavor?"selected":"unselected",htmlFor:c.flavor,children:[t.jsx(Z,{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!==H&&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(B,{width:24,height:24,type:ze,flavor:c.flavor}),t.jsx("span",{children:c.flavor_display_name})]})}),d===c.flavor&&(c.flavor===H||c.use_resource_value_as_fixed_config===!1)&&t.jsxs("div",{className:"space-y-3 py-5 pl-8",children:[c.flavor===H&&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(U,{"data-state":o("resourceId")===i?"selected":"unselected",htmlFor:i,children:[t.jsx(Z,{...m,id:i,type:"radio",value:i,name:"instance-radio"}),t.jsx(B,{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}=J(),r=W({resolver:q(e),shouldUnregister:!0,defaultValues:{resourceId:""}});return t.jsx($,{...r,children:t.jsxs(O,{children:[t.jsx(D,{children:"Orchestrator"}),t.jsxs(M,{children:[t.jsx(jr,{}),t.jsx(gr,{})]}),t.jsx(R,{children:t.jsx(vr,{})})]})})}function vr(){const e=v();return t.jsx(E,{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($,{...n,children:t.jsxs(O,{children:[t.jsx(D,{children:"Select Your Existing Cloud Infrastructure"}),t.jsx(M,{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(E,{form:"provider-form",disabled:!e,size:"md",children:"Next"})}function wr(){var o;const{data:e}=S(),r=X({...Me.stackDetail(e.createdStackId||""),throwOnError:!0});if(r.isError)return null;if(r.isPending)return t.jsx(G,{className:"h-[200px] w-full"});const s=r.data,n=It((o=r.data.metadata)==null?void 0:o.components);return t.jsxs(O,{children:[t.jsx(D,{children:"Your stack"}),t.jsx(M,{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(E,{size:"md",asChild:!0,children:t.jsx(Ot,{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(B,{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:$e,children:t.jsx(cr,{})});if(e===3)return t.jsx(Yt,{});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 us(){return t.jsx(Ue,{maxSteps:Ae.length+1,initialStep:1,children:t.jsx(Dt,{children:t.jsxs("section",{className:"layout-container flex flex-col gap-5 py-5 xl:flex-row",children:[t.jsx(Ze,{entries:Ae}),t.jsx("div",{className:"w-full",children:t.jsx(kr,{})})]})})})}export{us as default};
@@ -0,0 +1 @@
1
+ import{r as m,j as e}from"./@radix-Cdvw4jJ8.js";import{f as S,i as D,F as C,j as w,as as M,at as $,B as h,au as _,av as V,aw as J,a as P,I as k,C as g,az as U,aA as G,aB as A,A as K,k as Y,n as Z,aC as W,b3 as X,aD as ee,b4 as te,aF as se,ay as ne,D as ae,l as re,m as ce,p as ie,r as T,b as I,x as oe,g as F}from"./index-BgEfQ3_G.js";import{P as le}from"./Pagination-CWnEpSpN.js";import{S as ue}from"./SearchField-BtUi6cYl.js";import{s as f,c as de,A as me,u as xe,a as R,b as he}from"./service-k-9Vsb30.js";import{c as b,h as N,b as pe}from"./@tanstack-5gTMR7G2.js";import{t as fe}from"./zod-XdS2h1ws.js";import{u as je,F as ye,a as ve,C as v}from"./index.esm-DhJo3mA6.js";import{S as q}from"./trash-DP6Tpp_E.js";import{D as E,a as z}from"./DeleteAlertDialog-DEI0YDzP.js";import{c as ge,u as Ae}from"./bulk-delete-CzYA--cC.js";import{S as Se}from"./Lock-CrIAdQo6.js";import{L as O}from"./@react-router-DeDfXbUF.js";import{A as De}from"./AlertDialogDropdownItem-DsOmO1FH.js";import"./@reactflow-B_iCtR7X.js";import"./chevron-right-double-Dgp_gEsp.js";import"./index-DWpiv-Ft.js";import"./CodeSnippet-Ctplhzdc.js";import"./Infobox-CSBRrM6r.js";import"./info-QkbQz4QU.js";import"./Tick-Qquvr4P3.js";import"./check-B9QMTa3f.js";async function Ce({body:t}){const s=D(w.serviceAccounts.all),n=await S(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){const r=await n.json().then(a=>Array.isArray(a.detail)?a.detail[1]:a.detail).catch(()=>"Failed to create service account");throw new C({status:n.status,statusText:n.statusText,message:r})}return n.json()}function we(t){return b({...t,mutationFn:async s=>Ce({body:s})})}function B({isFallback:t}){const[s,n]=m.useState(!1),[r,a]=m.useState(""),i=N(),u=je({resolver:fe(de),defaultValues:{name:"",description:"",createDefault:!1}}),l=!!r&&u.watch("createDefault");function d(){return l?e.jsx(me,{value:r}):e.jsx(be,{isFallback:t,setApiKeyValue:a,setOpen:n})}return e.jsx(ye,{...u,children:e.jsxs(M,{open:s,onOpenChange:o=>{t&&!o&&i.invalidateQueries({queryKey:f.serviceAccountsKey()}),n(o),a(""),u.reset()},children:[e.jsx($,{asChild:!0,children:e.jsx(h,{className:"shrink-0",size:"sm",intent:"primary",children:"Add service account"})}),e.jsxs(_,{"data-success":l,className:"mx-auto overflow-x-auto transition-none data-[success=true]:max-w-[800px]",children:[e.jsx(V,{children:e.jsx(J,{children:"Add service account"})}),d()]})]})})}function be({setApiKeyValue:t,setOpen:s,isFallback:n}){const{watch:r,handleSubmit:a,control:i,formState:{isValid:u}}=ve(),{toast:l}=P(),d=N(),{mutate:o}=we({onError(c){A(c)&&l({status:"error",emphasis:"subtle",description:c.message,rounded:!0})},async onSuccess(c){if(l({description:"The service account has been added successfully.",status:"success",emphasis:"subtle",rounded:!0}),r("createDefault")){x(c.id);return}d.invalidateQueries({queryKey:f.serviceAccountsKey()}),s(!1)}}),{mutate:p}=xe({onSuccess(c){var y;n||d.invalidateQueries({queryKey:f.serviceAccountsKey()}),t(((y=c.body)==null?void 0:y.key)||"")},onError(c){A(c)&&l({status:"error",emphasis:"subtle",description:c.message,rounded:!0})}}),x=c=>{p({serviceAccountId:c,body:{name:"default",description:"Default api key"}})},H=c=>{o({name:c.name,description:c.description,active:!0})};return e.jsxs(e.Fragment,{children:[e.jsxs("form",{id:"create-secret-form",className:"space-y-5 p-7",onSubmit:a(H),children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx("label",{className:"font-inter text-sm text-left font-medium leading-5",children:"Name:"}),e.jsx(v,{name:"name",control:i,render:({field:c})=>e.jsx(k,{...c,className:"w-full",required:!0,placeholder:"Add name"})})]}),e.jsxs("div",{className:"space-y-0.5",children:[e.jsx("label",{className:"font-inter text-sm text-left font-medium leading-5",children:"Description:"}),e.jsx(v,{name:"description",control:i,render:({field:c})=>e.jsx(k,{...c,className:"w-full",placeholder:"Add description"})})]}),e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(v,{control:i,name:"createDefault",render:({field:{onChange:c,value:y}})=>e.jsx(g,{checked:y,id:"default-key",onCheckedChange:L=>c(!!L)})}),e.jsx("label",{htmlFor:"default-key",children:"Create a default API Key"})]}),e.jsx("p",{className:"pl-[30px] text-text-xs text-theme-text-secondary",children:"This will include a default API Key for your service account."})]})]}),e.jsxs(U,{className:"gap-[10px]",children:[e.jsx(G,{asChild:!0,children:e.jsx(h,{size:"sm",intent:"secondary",children:"Cancel"})}),e.jsx(h,{intent:"primary",size:"sm",disabled:!u,type:"submit",form:"create-secret-form",children:"Add service account"})]})]})}async function Ne(t){const s=D(w.serviceAccounts.detail(t)),n=await S(s,{method:"DELETE",headers:{"Content-Type":"application/json"}});if(!n.ok){const r=await n.json().then(a=>Array.isArray(a.detail)?a.detail[1]:a.detail).catch(()=>`Failed to delete service account ${t}`);throw new C({status:n.status,statusText:n.statusText,message:r})}return n.json()}function ke(t){return b({...t,mutationFn:async s=>{await Ne(s)}})}const{ContextProvider:Te,useContext:j}=ge();function Q(){const{setRowSelection:t}=j(),{mutateAsync:s}=ke();async function n(r){await s(r)}return Ae({deleteFn:n,queryKeyToInvalidate:f.serviceAccountsKey(),setRowSelection:t})}function Fe(){const[t,s]=m.useState(!1),{selectedRowCount:n,selectedRowIDs:r}=j(),{bulkDelete:a}=Q();async function i(){await a(r),s(!1)}return e.jsxs(K,{open:t,onOpenChange:s,children:[e.jsx(Y,{asChild:!0,children:e.jsxs(h,{className:"rounded-sharp border-y-0 bg-white",size:"md",emphasis:"subtle",intent:"secondary",children:[e.jsx(q,{className:"h-5 w-5 shrink-0 gap-1 fill-neutral-400"}),"Delete"]})}),e.jsx(E,{title:`Delete Service Account${n>=2?"s":""}`,handleDelete:i,children:e.jsxs(z,{children:[e.jsx("p",{children:"Are you sure?"}),e.jsx("p",{children:"This action cannot be undone."})]})})]})}function Oe(){const{selectedRowCount:t}=j();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} Service Account${t>1?"s":""} selected`}),e.jsx(Fe,{})]})}async function Pe({body:t,serviceAccountId:s}){const n=D(w.serviceAccounts.detail(s)),r=await S(n,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(r.status===404&&Z(),!r.ok){const a=await r.json().then(i=>Array.isArray(i.detail)?i.detail[1]:i.detail).catch(()=>`Failed to update service account ${s}`);throw new C({status:r.status,statusText:r.statusText,message:a})}return r.json()}function Ke(t){return b({...t,mutationFn:async({serviceAccountId:s,body:n})=>Pe({serviceAccountId:s,body:n})})}function Ie({isActive:t,serviceAccountId:s}){const{toast:n}=P(),r=N(),[a,i]=m.useState(!1),{mutate:u}=Ke({onError(o){A(o)&&n({status:"error",emphasis:"subtle",description:o.message,rounded:!0})},onSuccess(){r.invalidateQueries({queryKey:f.serviceAccountsKey()})}});function l(o){o?d(o):i(!0)}async function d(o){u({serviceAccountId:s,body:{active:o}})}return e.jsxs(e.Fragment,{children:[e.jsx(K,{open:a,onOpenChange:i,children:e.jsxs(W,{children:[e.jsx(X,{children:e.jsx(ee,{children:"Deactivate Service Account"})}),e.jsxs("div",{className:"p-5 text-text-md text-theme-text-secondary",children:[e.jsx("p",{children:"Are you sure?"}),e.jsx("p",{children:"You won't be able to use any API keys of this service account to authenticate with the server anymore."})]}),e.jsxs(te,{className:"gap-[10px]",children:[e.jsx(se,{asChild:!0,children:e.jsx(h,{size:"sm",intent:"secondary",children:"Cancel"})}),e.jsx(h,{onClick:()=>d(!1).then(o=>i(!1)),intent:"primary",type:"button",children:"Deactivate"})]})]})}),e.jsx(ne,{checked:t,onCheckedChange:l})]})}function Re({serviceAccountId:t}){const[s,n]=m.useState(!1),[r,a]=m.useState(!1),{bulkDelete:i}=Q(),u=m.useRef(null),l=m.useRef(null);function d(){l.current=u.current}async function o(){await i([t]),p(!1)}function p(x){if(x===!1){n(!1),setTimeout(()=>{a(x)},200);return}a(x)}return e.jsxs(ae,{onOpenChange:n,open:s,children:[e.jsx(re,{ref:u,children:e.jsx(ce,{className:"h-5 w-5 fill-theme-text-secondary"})}),e.jsx(ie,{hidden:r,onCloseAutoFocus:x=>{l.current&&(l.current.focus(),l.current=null,x.preventDefault())},align:"end",sideOffset:7,children:e.jsx(De,{onSelect:d,open:r,onOpenChange:p,triggerChildren:"Delete",icon:e.jsx(q,{fill:"red"}),children:e.jsx(E,{title:"Delete Service Account",handleDelete:o,children:e.jsxs(z,{children:[e.jsx("p",{children:"Are you sure?"}),e.jsx("p",{children:"This action cannot be undone."})]})})})})]})}function qe(){return[{id:"select",meta:{width:"1%"},header:({table:t})=>e.jsx(g,{id:"check-all",checked:t.getIsAllRowsSelected(),onCheckedChange:s=>t.toggleAllRowsSelected(s==="indeterminate"?!0:s)}),cell:({row:t})=>e.jsx(g,{id:`check-${t.id}`,checked:t.getIsSelected(),onCheckedChange:t.getToggleSelectedHandler()})},{id:"service-account",header:"Service Account",accessorFn:t=>t.name,cell:({row:t})=>{var s;return e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Se,{className:"h-5 w-5 flex-shrink-0 fill-primary-400"}),e.jsxs("div",{className:"group/copybutton flex flex-col",children:[e.jsx("div",{className:"flex flex-row items-center space-x-1",children:e.jsx("div",{className:"flex items-center space-x-1",children:e.jsx(O,{className:"text-text-md font-semibold text-theme-text-primary",to:T.settings.service_accounts.detail(t.original.id),children:t.original.name})})}),e.jsx("div",{className:"flex items-center gap-1",children:e.jsx(O,{className:"flex items-center gap-1 text-text-sm text-theme-text-secondary",to:T.settings.service_accounts.detail(t.original.id),children:(s=t.original.metadata)==null?void 0:s.description})})]})]})}},{id:"active",header:"Active",accessorFn:t=>{var s;return(s=t.body)==null?void 0:s.active},cell:({row:t})=>{var s;return e.jsx(Ie,{isActive:!!((s=t.original.body)!=null&&s.active),serviceAccountId:t.original.id})}},{id:"actions",meta:{width:"5%"},header:"",cell:({row:t})=>e.jsx("div",{className:"flex items-center justify-end",children:e.jsx(Re,{serviceAccountId:t.original.id})})}]}function Ee(){return e.jsxs(I,{className:"flex flex-col items-center justify-center space-y-4 p-9",children:[e.jsxs("div",{className:"space-y-2 text-center",children:[e.jsx("p",{className:"text-display-xs font-semibold text-theme-text-primary",children:"There are no service accounts yet."}),e.jsx("p",{className:"text-theme-text-secondary",children:"Create your first one now to automate your processes securely with ZenML."})]}),e.jsx(B,{isFallback:!0})]})}function ze(){const t=R(),{rowSelection:s,setRowSelection:n}=j(),r=m.useMemo(()=>qe(),[]),{data:a}=pe({...he.serviceAccountList({...t,sort_by:"desc:created",hydrate:!0})});return a&&a.items.length<1&&!t.name?e.jsx(Ee,{}):e.jsxs(e.Fragment,{children:[e.jsx(Be,{}),e.jsxs("div",{className:"flex flex-col items-center gap-5",children:[e.jsx("div",{className:"w-full",children:a?e.jsx(oe,{getRowId:i=>i.id,rowSelection:s,onRowSelectionChange:n,columns:r,data:a.items}):e.jsx(F,{className:"h-[500px] w-full"})}),a?a.total_pages>1&&e.jsx(le,{searchParams:t,paginate:a}):e.jsx(F,{className:"h-[36px] w-[300px]"})]})]})}function Be(){const t=R(),{selectedRowCount:s}=j();return e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[s?e.jsx(Oe,{}):e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(ue,{searchParams:t})}),e.jsx(B,{isFallback:!1})]})}function lt(){return e.jsxs(I,{className:"space-y-4 p-5",children:[e.jsx(Qe,{}),e.jsx(Te,{children:e.jsx(ze,{})})]})}function Qe(){return e.jsxs("div",{className:"space-y-2",children:[e.jsx("h1",{className:"text-text-xl font-semibold",children:"Service Accounts"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1",children:[e.jsx("p",{className:"text-text-sm text-theme-text-secondary",children:"Configure automated access for background tasks and integrations."}),e.jsx("a",{target:"_blank",rel:"noreferrer noopener",href:"https://docs.zenml.io/how-to/project-setup-and-management/connecting-to-zenml/connect-with-a-service-account",className:"link text-text-sm text-primary-400",children:"Learn More"})]})]})}export{lt as default};
@@ -0,0 +1 @@
1
+ import{r as i,j as e}from"./@radix-Cdvw4jJ8.js";import{g as o,B as n,r as c,bh as d}from"./index-BgEfQ3_G.js";import{S as h}from"./StackList-Cvxapo0p.js";import{p as m,c as j}from"./persist-BsdEtCkd.js";import{p as l,c as k}from"./persist-CFPbMcJX.js";import{I as p}from"./Infobox-CSBRrM6r.js";import{s as u}from"./index-BBt0LDtR.js";import{b as f}from"./@tanstack-5gTMR7G2.js";import{L as x}from"./@react-router-DeDfXbUF.js";import"./@reactflow-B_iCtR7X.js";import"./plus-Cl0_rCVF.js";import"./refresh-BcTM09NW.js";import"./Pagination-CWnEpSpN.js";import"./chevron-right-double-Dgp_gEsp.js";import"./SearchField-BtUi6cYl.js";import"./index-DWpiv-Ft.js";import"./DisplayDate-8RESqe5H.js";import"./CodeSnippet-Ctplhzdc.js";import"./CollapsibleCard-CBKenz9f.js";import"./chevron-down-jbbQh82s.js";import"./check-circle-C4tYvbtw.js";import"./SheetHeader-DkH7aG9K.js";import"./components-Br2ezRib.js";import"./NumberBox-DtCv7jh3.js";import"./ComponentBadge-Cnecw3qz.js";import"./ComponentIcon-CMiVW-O6.js";import"./layout-DBbfEFBe.js";import"./transform-CeZdrxDZ.js";import"./trash-DP6Tpp_E.js";import"./DialogItem-CRCDpYU6.js";import"./AlertDialogDropdownItem-DsOmO1FH.js";import"./sharedSchema-C_HkejsG.js";import"./index.es-C1gfATPn.js";import"./info-QkbQz4QU.js";import"./stack-detail-query-CNmVZ0Bo.js";function w({setHasResumeableStack:a}){const{success:t,data:s}=m(),r=f({...u.stackDeploymentStack({provider:(s==null?void 0:s.provider)||"aws",stack_name:(s==null?void 0:s.stackName)||"",date_start:s==null?void 0:s.timestamp}),enabled:t,throwOnError:!0});return i.useEffect(()=>{r.data&&(j(),a(!1))},[r.data]),!t||r.isError?null:r.isPending?e.jsx(o,{className:"h-[70px] w-full"}):e.jsx(p,{className:"w-full",children:e.jsxs("section",{className:"flex flex-wrap items-center justify-between gap-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("p",{className:"font-semibold",children:"You have a Stack provision incomplete"}),e.jsx("p",{className:"text-text-sm",children:"Return to the setup and finish the configuration on your cloud provider"})]}),e.jsx("div",{children:e.jsx(n,{className:"w-fit bg-theme-surface-primary",intent:"primary",emphasis:"subtle",asChild:!0,children:e.jsx(x,{to:c.stacks.create.newInfra,children:e.jsx("span",{children:"Review Stack"})})})})]})})}function b({setHasResumeableTerraform:a}){const{success:t,data:s}=l(),r=f({...u.stackDeploymentStack({provider:(s==null?void 0:s.provider)||"aws",stack_name:(s==null?void 0:s.stackName)||"",date_start:s==null?void 0:s.timestamp}),enabled:t,throwOnError:!0});return i.useEffect(()=>{r.data&&(k(),a(!1))},[r.data]),!t||r.isError?null:r.isPending?e.jsx(o,{className:"h-[70px] w-full"}):e.jsx(p,{className:"w-full",children:e.jsxs("section",{className:"flex flex-wrap items-center justify-between gap-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("p",{className:"font-semibold",children:"You have a Terraform Stack provision incomplete"}),e.jsx("p",{className:"text-text-sm",children:"Return to the setup and finish the configuration on your cloud provider"})]}),e.jsx("div",{children:e.jsx(n,{className:"w-fit bg-theme-surface-primary",intent:"primary",emphasis:"subtle",asChild:!0,children:e.jsx(x,{to:c.stacks.create.terraform,children:e.jsx("span",{children:"Review Stack"})})})})]})})}function v(){const[a,t]=i.useState(m().success),[s,r]=i.useState(l().success);return!a&&!s?null:e.jsxs("div",{className:"space-y-5",children:[a&&e.jsx(w,{setHasResumeableStack:t}),s&&e.jsx(b,{setHasResumeableTerraform:r})]})}function te(){const{setTourState:a,tourState:{tourActive:t}}=d();return i.useEffect(()=>{t&&a(s=>({...s,run:!0,stepIndex:s.stepIndex}))},[t]),e.jsxs("div",{className:"space-y-5 py-5",children:[e.jsx(v,{}),e.jsx(h,{})]})}export{te as default};
@@ -1 +1 @@
1
- import{j as e,r}from"./@radix-Cdvw4jJ8.js";import{P as o,a as n,b as l,c as i,d as m,e as c}from"./ProCta-Dm5cWKpS.js";import{b as d,bh as u}from"./index-BFqbGSck.js";import{C as x}from"./CodeSnippet-D2HkkAGr.js";import{f as p}from"./@react-router-DeDfXbUF.js";import"./check-B9QMTa3f.js";import"./@tanstack-5gTMR7G2.js";import"./@reactflow-8OCk19Fi.js";const f="/assets/mcp-Cb1aMeoq.webp";function h(){const[a]=p(),t=a.get("model");function s(){return t?`zenml model list --name='contains:${t}'`:"zenml model list"}return e.jsxs(d,{className:"flex flex-wrap justify-between p-5",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-text-xl font-semibold",children:"Staying Open Source? "}),e.jsx("p",{className:"text-theme-text-secondary",children:"No problem! Use this CLI command to list your models"})]}),e.jsx(x,{code:s()})]})}function v(){const{setTourState:a,tourState:{tourActive:t}}=u();return r.useEffect(()=>{t&&a(s=>({...s,run:!0,stepIndex:s.stepIndex}))},[t]),e.jsx("div",{children:e.jsxs("div",{className:"layout-container space-y-5 py-5",children:[e.jsxs(o,{className:"relative overflow-y-hidden",children:[e.jsxs("div",{className:"w-full max-w-none space-y-5 lg:max-w-[900px]",children:[e.jsx(n,{children:"Access Advanced Model Management Features with ZenML Pro"}),e.jsx(l,{}),e.jsx(i,{features:[{title:"Model Control Plane Dashboard",subtitle:"Centralized model management and monitoring"},{title:"Enterprise Security",subtitle:"Social SSO, RBAC, and User Management"},{title:"Managed ZenML Server",subtitle:"On your VPC or hosted on our infrastructure"},{title:"Advanced MLOps",subtitle:"CI/CD/CT, Artifact Control Plane and more"}]}),e.jsx(m,{})]}),e.jsx(c,{className:"absolute translate-x-[30%] translate-y-[15%] scale-[40%]",src:f,alt:"Screenshot of the ZenML Pro Artifact Control Plane"})]}),e.jsx(h,{})]})})}export{v as default};
1
+ import{j as e,r}from"./@radix-Cdvw4jJ8.js";import{P as o,a as n,b as l,c as i,d as m,e as c}from"./ProCta-CNyp04C8.js";import{b as d,bh as u}from"./index-BgEfQ3_G.js";import{C as x}from"./CodeSnippet-Ctplhzdc.js";import{f as p}from"./@react-router-DeDfXbUF.js";import"./check-B9QMTa3f.js";import"./@tanstack-5gTMR7G2.js";import"./@reactflow-B_iCtR7X.js";const f="/assets/mcp-Cb1aMeoq.webp";function h(){const[a]=p(),t=a.get("model");function s(){return t?`zenml model list --name='contains:${t}'`:"zenml model list"}return e.jsxs(d,{className:"flex flex-wrap justify-between p-5",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-text-xl font-semibold",children:"Staying Open Source? "}),e.jsx("p",{className:"text-theme-text-secondary",children:"No problem! Use this CLI command to list your models"})]}),e.jsx(x,{code:s()})]})}function v(){const{setTourState:a,tourState:{tourActive:t}}=u();return r.useEffect(()=>{t&&a(s=>({...s,run:!0,stepIndex:s.stepIndex}))},[t]),e.jsx("div",{children:e.jsxs("div",{className:"layout-container space-y-5 py-5",children:[e.jsxs(o,{className:"relative overflow-y-hidden",children:[e.jsxs("div",{className:"w-full max-w-none space-y-5 lg:max-w-[900px]",children:[e.jsx(n,{children:"Access Advanced Model Management Features with ZenML Pro"}),e.jsx(l,{}),e.jsx(i,{features:[{title:"Model Control Plane Dashboard",subtitle:"Centralized model management and monitoring"},{title:"Enterprise Security",subtitle:"Social SSO, RBAC, and User Management"},{title:"Managed ZenML Server",subtitle:"On your VPC or hosted on our infrastructure"},{title:"Advanced MLOps",subtitle:"CI/CD/CT, Artifact Control Plane and more"}]}),e.jsx(m,{})]}),e.jsx(c,{className:"absolute translate-x-[30%] translate-y-[15%] scale-[40%]",src:f,alt:"Screenshot of the ZenML Pro Artifact Control Plane"})]}),e.jsx(h,{})]})})}export{v as default};
@@ -1 +1 @@
1
- import{r as l,j as e}from"./@radix-Cdvw4jJ8.js";import{u as m,W as B,L as I}from"./LeftSideMenu-DCsKdIjC.js";import{p as C,s as M,c as k}from"./persist-DWMWVP-y.js";import{I as b}from"./Infobox-CGxFvqzi.js";import{W as v,H as g,B as y}from"./Wizard-Dg8Pmn5A.js";import{t as z}from"./zod-XdS2h1ws.js";import{B as p,bf as A,g as P,a$ as F,r as Z,z as _}from"./index-BFqbGSck.js";import{u as T,F as L,a as W}from"./index.esm-DhJo3mA6.js";import{S as V}from"./StackName-ojLC6xdl.js";import{S as N}from"./WizardFooter-BcNDIvlQ.js";import{R as $,a as H,E as O,C as G}from"./Partials-DSjkttlz.js";import{b as Q,a as Y}from"./persist-Dec_w7aB.js";import{S as q}from"./logs-CQKlJjo0.js";import{C as j}from"./CodeSnippet-D2HkkAGr.js";import{N as w}from"./NumberBox-C0mQktmV.js";import{s as E}from"./index-BjUu1mP4.js";import{b as D}from"./@tanstack-5gTMR7G2.js";import{c as J}from"./@react-router-DeDfXbUF.js";import{C as x,P as f}from"./ProviderRadio-DEDNRgAb.js";import{C as h}from"./ProviderIcon-DPwMR6nF.js";import"./Tick-BPrWnNlN.js";import"./check-B9QMTa3f.js";import"./info-QkbQz4QU.js";import"./@reactflow-8OCk19Fi.js";import"./package-miExReQl.js";import"./ComponentBadge-CDgdd0Ks.js";import"./ComponentIcon-CbbOc7lb.js";import"./layout-DBbfEFBe.js";import"./transform-CeZdrxDZ.js";import"./sharedSchema-BXzg0EZz.js";import"./index.es-C1gfATPn.js";import"./stack-detail-query-Cm0fsgo-.js";import"./gcp-B1I3Qvcx.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($,{provider:t.provider||"aws"}),e.jsx(V,{})]}),e.jsx(H,{provider:t.provider||"aws"}),e.jsx(O,{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-Cdvw4jJ8.js";import{u as m,W as B,L as I}from"./LeftSideMenu-DPsCCK3z.js";import{p as C,s as M,c as k}from"./persist-CFPbMcJX.js";import{I as b}from"./Infobox-CSBRrM6r.js";import{W as v,H as g,B as y}from"./Wizard-BHvY75u_.js";import{t as z}from"./zod-XdS2h1ws.js";import{B as p,bf as A,g as P,a$ as F,r as Z,z as _}from"./index-BgEfQ3_G.js";import{u as T,F as L,a as W}from"./index.esm-DhJo3mA6.js";import{S as V}from"./StackName-CFSZL8ec.js";import{S as N}from"./WizardFooter-FQm8y-jP.js";import{R as $,a as H,E as O,C as G}from"./Partials-CfHD6OH5.js";import{b as Q,a as Y}from"./persist-BsdEtCkd.js";import{S as q}from"./logs-CQKlJjo0.js";import{C as j}from"./CodeSnippet-Ctplhzdc.js";import{N as w}from"./NumberBox-DtCv7jh3.js";import{s as E}from"./index-BBt0LDtR.js";import{b as D}from"./@tanstack-5gTMR7G2.js";import{c as J}from"./@react-router-DeDfXbUF.js";import{C as x,P as f}from"./ProviderRadio-tGtie8Gc.js";import{C as h}from"./ProviderIcon-DHejyg7C.js";import"./Tick-Qquvr4P3.js";import"./check-B9QMTa3f.js";import"./info-QkbQz4QU.js";import"./@reactflow-B_iCtR7X.js";import"./package-miExReQl.js";import"./ComponentBadge-Cnecw3qz.js";import"./ComponentIcon-CMiVW-O6.js";import"./layout-DBbfEFBe.js";import"./transform-CeZdrxDZ.js";import"./sharedSchema-C_HkejsG.js";import"./index.es-C1gfATPn.js";import"./stack-detail-query-CNmVZ0Bo.js";import"./gcp-B1I3Qvcx.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($,{provider:t.provider||"aws"}),e.jsx(V,{})]}),e.jsx(H,{provider:t.provider||"aws"}),e.jsx(O,{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{r as p,j as e}from"./@radix-Cdvw4jJ8.js";import{S as j}from"./chevron-down-jbbQh82s.js";import{D as i}from"./DisplayDate-8RESqe5H.js";import{aO as l,g as c,ac as h,ad as f,ae as g,af as y,w as u,G as b,aP as N}from"./index-BFqbGSck.js";import{K as n,a as v,V as C,N as E}from"./NestedCollapsible-3M4llYtH.js";import{a as m,e as w,R as T,E as R}from"./service-connectors-DSEMwJ5A.js";import{R as P}from"./resource-tyes-list-o2LXiMay.js";import{b as d}from"./@tanstack-5gTMR7G2.js";import{a as x}from"./@react-router-DeDfXbUF.js";import"./@reactflow-8OCk19Fi.js";import"./type-guards-CNgPYg8l.js";import"./eye-CbVlAYty.js";import"./CollapsibleCard-CnS09ljw.js";import"./check-circle-C4tYvbtw.js";import"./CodeSnippet-D2HkkAGr.js";function D(){const[a,r]=p.useState(!0),{connectorId:s}=x(),o=d({...l.serviceConnectorDetail(s),throwOnError:!0});if(o.isPending)return e.jsx(c,{className:"h-[300px] w-full"});if(o.isError)return e.jsx("div",{children:"Error"});const t=o.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(n,{label:"Name",value:t.name}),e.jsx(A,{connector:t}),e.jsx(O,{connector:t}),e.jsx(S,{connector:t}),e.jsx(_,{connector:t}),e.jsx(I,{connector:t}),e.jsx(Q,{connector:t}),e.jsx(K,{connector:t}),e.jsx(M,{connector:t})]})})]})}function A({connector:a}){var s;const r=(s=a.body)==null?void 0:s.connector_type;return!r||typeof r=="string"?null:e.jsx(n,{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 O({connector:a}){var s;const r=m(a);return e.jsx(n,{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 S({connector:a}){const r=w(a);return e.jsxs(e.Fragment,{children:[e.jsx(v,{children:"Resrouce Types"}),e.jsx(C,{className:"h-auto",children:e.jsx(P,{resourceTypes:r})})]})}function _({connector:a}){return e.jsx(n,{label:"Resource Name",value:e.jsx(T,{connector:a})})}function I({connector:a}){var s;const r=(s=a.resources)==null?void 0:s.user;return e.jsx(n,{label:"Author",value:r?e.jsx(b,{username:N(r)}):null})}function Q({connector:a}){var s;const r=(s=a.body)==null?void 0:s.expires_at;return e.jsx(n,{label:"Expires in",value:r?e.jsx(R,{expires:r}):"Never"})}function K({connector:a}){var s;const r=(s=a.body)==null?void 0:s.created;return e.jsx(n,{label:"Created",value:r?e.jsx("span",{className:"truncate",children:e.jsx(i,{dateString:r})}):null})}function M({connector:a}){var s;const r=(s=a.body)==null?void 0:s.updated;return e.jsx(n,{label:"Updated",value:r?e.jsx("span",{className:"truncate",children:e.jsx(i,{dateString:r})}):null})}function U(){var t;const{connectorId:a}=x(),r=d({...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,o=m(s);return e.jsx(E,{schema:o==null?void 0:o.config_schema,title:e.jsx("p",{className:"text-text-xl",children:"Configuration"}),data:(t=s.metadata)==null?void 0:t.configuration,isInitialOpen:!0})}function ee(){return e.jsxs("div",{className:"grid grid-cols-1 gap-5",children:[e.jsx("div",{children:e.jsx(D,{})}),e.jsx("div",{className:"space-y-5",children:e.jsx(U,{})})]})}export{ee as default};
1
+ import{r as p,j as e}from"./@radix-Cdvw4jJ8.js";import{S as j}from"./chevron-down-jbbQh82s.js";import{D as i}from"./DisplayDate-8RESqe5H.js";import{aO as l,g as c,ac as h,ad as f,ae as g,af as y,w as u,G as b,aP as N}from"./index-BgEfQ3_G.js";import{K as n,a as v,V as C,N as E}from"./NestedCollapsible-CMuDIJlp.js";import{a as m,e as w,R as T,E as R}from"./service-connectors-Q8h7-_rG.js";import{R as P}from"./resource-tyes-list-79FqS3LY.js";import{b as d}from"./@tanstack-5gTMR7G2.js";import{a as x}from"./@react-router-DeDfXbUF.js";import"./@reactflow-B_iCtR7X.js";import"./type-guards-CNgPYg8l.js";import"./eye-CbVlAYty.js";import"./CollapsibleCard-CBKenz9f.js";import"./check-circle-C4tYvbtw.js";import"./CodeSnippet-Ctplhzdc.js";function D(){const[a,r]=p.useState(!0),{connectorId:s}=x(),o=d({...l.serviceConnectorDetail(s),throwOnError:!0});if(o.isPending)return e.jsx(c,{className:"h-[300px] w-full"});if(o.isError)return e.jsx("div",{children:"Error"});const t=o.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(n,{label:"Name",value:t.name}),e.jsx(A,{connector:t}),e.jsx(O,{connector:t}),e.jsx(S,{connector:t}),e.jsx(_,{connector:t}),e.jsx(I,{connector:t}),e.jsx(Q,{connector:t}),e.jsx(K,{connector:t}),e.jsx(M,{connector:t})]})})]})}function A({connector:a}){var s;const r=(s=a.body)==null?void 0:s.connector_type;return!r||typeof r=="string"?null:e.jsx(n,{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 O({connector:a}){var s;const r=m(a);return e.jsx(n,{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 S({connector:a}){const r=w(a);return e.jsxs(e.Fragment,{children:[e.jsx(v,{children:"Resrouce Types"}),e.jsx(C,{className:"h-auto",children:e.jsx(P,{resourceTypes:r})})]})}function _({connector:a}){return e.jsx(n,{label:"Resource Name",value:e.jsx(T,{connector:a})})}function I({connector:a}){var s;const r=(s=a.resources)==null?void 0:s.user;return e.jsx(n,{label:"Author",value:r?e.jsx(b,{username:N(r)}):null})}function Q({connector:a}){var s;const r=(s=a.body)==null?void 0:s.expires_at;return e.jsx(n,{label:"Expires in",value:r?e.jsx(R,{expires:r}):"Never"})}function K({connector:a}){var s;const r=(s=a.body)==null?void 0:s.created;return e.jsx(n,{label:"Created",value:r?e.jsx("span",{className:"truncate",children:e.jsx(i,{dateString:r})}):null})}function M({connector:a}){var s;const r=(s=a.body)==null?void 0:s.updated;return e.jsx(n,{label:"Updated",value:r?e.jsx("span",{className:"truncate",children:e.jsx(i,{dateString:r})}):null})}function U(){var t;const{connectorId:a}=x(),r=d({...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,o=m(s);return e.jsx(E,{schema:o==null?void 0:o.config_schema,title:e.jsx("p",{className:"text-text-xl",children:"Configuration"}),data:(t=s.metadata)==null?void 0:t.configuration,isInitialOpen:!0})}function ee(){return e.jsxs("div",{className:"grid grid-cols-1 gap-5",children:[e.jsx("div",{children:e.jsx(D,{})}),e.jsx("div",{className:"space-y-5",children:e.jsx(U,{})})]})}export{ee as default};
@@ -1 +1 @@
1
- import{r as u,j as e}from"./@radix-Cdvw4jJ8.js";import{a as g,ay as m,aN as p,aB as j,S as N,aI as b,b as v,g as S}from"./index-BFqbGSck.js";import{u as C}from"./update-server-settings-mutation-CmnxdxiK.js";import{h as k}from"./@tanstack-5gTMR7G2.js";import"./@react-router-DeDfXbUF.js";import"./@reactflow-8OCk19Fi.js";function w({settings:t}){var o,l;const a=u.useId(),n=u.useId(),{toast:r}=g(),i=k(),x=((o=t.body)==null?void 0:o.display_announcements)??!1,h=((l=t.body)==null?void 0:l.display_updates)??!1,{mutate:c,isPending:d}=C({onError:s=>{i.invalidateQueries({queryKey:p()}),j(s)&&r({status:"error",emphasis:"subtle",icon:e.jsx(N,{className:"h-5 w-5 shrink-0 fill-error-700"}),description:s.message,rounded:!0})},onSuccess:()=>{i.invalidateQueries({queryKey:p()}),r({status:"success",emphasis:"subtle",rounded:!0,description:"Settings updated successfully"})}}),f=s=>{c({display_announcements:s})},y=s=>{c({display_updates:s})};return e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"flex items-center gap-5",children:[e.jsx(m,{checked:x,onCheckedChange:f,id:a,disabled:d}),e.jsxs("label",{htmlFor:a,className:"text-text-md",children:[e.jsx("p",{className:"font-semibold",children:"Announcements"}),e.jsx("p",{className:"text-theme-text-secondary",children:"Enable Announcements for important ZenML updates, surveys, and feedback opportunities."})]})]}),e.jsx("hr",{}),e.jsxs("div",{className:"flex items-center gap-5",children:[e.jsx(m,{checked:h,onCheckedChange:y,id:n,disabled:d}),e.jsxs("label",{htmlFor:n,className:"text-text-md",children:[e.jsx("p",{className:"font-semibold",children:"Updates"}),e.jsx("p",{className:"text-theme-text-secondary",children:"Activate Updates to receive the latest ZenML news and feature releases."})]})]})]})}function _(){const{data:t}=b({throwOnError:!0});return e.jsxs(v,{className:"flex flex-col gap-5 p-5",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx("h1",{className:"text-text-xl font-semibold",children:"Notifications"}),e.jsx("p",{className:"text-text-sm text-theme-text-secondary",children:"ZenML comes equipped with default widgets designed to enhance your experience by analyzing usage patterns, gathering your feedback, and ensuring you stay informed about our latest updates and features."})]}),e.jsx("div",{className:"",children:t?e.jsx(w,{settings:t}):e.jsx(S,{className:"h-[250px] w-full"})})]})}export{_ as default};
1
+ import{r as u,j as e}from"./@radix-Cdvw4jJ8.js";import{a as g,ay as m,aN as p,aB as j,S as N,aI as b,b as v,g as S}from"./index-BgEfQ3_G.js";import{u as C}from"./update-server-settings-mutation-Bwe3gUt4.js";import{h as k}from"./@tanstack-5gTMR7G2.js";import"./@react-router-DeDfXbUF.js";import"./@reactflow-B_iCtR7X.js";function w({settings:t}){var o,l;const a=u.useId(),n=u.useId(),{toast:r}=g(),i=k(),x=((o=t.body)==null?void 0:o.display_announcements)??!1,h=((l=t.body)==null?void 0:l.display_updates)??!1,{mutate:c,isPending:d}=C({onError:s=>{i.invalidateQueries({queryKey:p()}),j(s)&&r({status:"error",emphasis:"subtle",icon:e.jsx(N,{className:"h-5 w-5 shrink-0 fill-error-700"}),description:s.message,rounded:!0})},onSuccess:()=>{i.invalidateQueries({queryKey:p()}),r({status:"success",emphasis:"subtle",rounded:!0,description:"Settings updated successfully"})}}),f=s=>{c({display_announcements:s})},y=s=>{c({display_updates:s})};return e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"flex items-center gap-5",children:[e.jsx(m,{checked:x,onCheckedChange:f,id:a,disabled:d}),e.jsxs("label",{htmlFor:a,className:"text-text-md",children:[e.jsx("p",{className:"font-semibold",children:"Announcements"}),e.jsx("p",{className:"text-theme-text-secondary",children:"Enable Announcements for important ZenML updates, surveys, and feedback opportunities."})]})]}),e.jsx("hr",{}),e.jsxs("div",{className:"flex items-center gap-5",children:[e.jsx(m,{checked:h,onCheckedChange:y,id:n,disabled:d}),e.jsxs("label",{htmlFor:n,className:"text-text-md",children:[e.jsx("p",{className:"font-semibold",children:"Updates"}),e.jsx("p",{className:"text-theme-text-secondary",children:"Activate Updates to receive the latest ZenML news and feature releases."})]})]})]})}function _(){const{data:t}=b({throwOnError:!0});return e.jsxs(v,{className:"flex flex-col gap-5 p-5",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx("h1",{className:"text-text-xl font-semibold",children:"Notifications"}),e.jsx("p",{className:"text-text-sm text-theme-text-secondary",children:"ZenML comes equipped with default widgets designed to enhance your experience by analyzing usage patterns, gathering your feedback, and ensuring you stay informed about our latest updates and features."})]}),e.jsx("div",{className:"",children:t?e.jsx(w,{settings:t}):e.jsx(S,{className:"h-[250px] w-full"})})]})}export{_ as default};
@@ -1 +1 @@
1
- import{j as e,r as f}from"./@radix-Cdvw4jJ8.js";import{z as d,i as x,j as h,o as N,f as j,F as p,b as m,a as S,C as D,B as C,S as P,V as E}from"./index-BFqbGSck.js";import{f as _}from"./@react-router-DeDfXbUF.js";import{E as F}from"./EmptyState-CjrgDtVk.js";import{b as T,c as k}from"./@tanstack-5gTMR7G2.js";import{E as I}from"./Error-CQzjbDcN.js";import{t as V}from"./zod-XdS2h1ws.js";import{u as A,C as z}from"./index.esm-DhJo3mA6.js";import{S as q}from"./check-circle-C4tYvbtw.js";import"./@reactflow-8OCk19Fi.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)+"?"+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 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}=A({resolver:V(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:b}})=>e.jsx(D,{checked:b,onCheckedChange:w=>o(!!w),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(C,{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(E,{})}):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-Cdvw4jJ8.js";import{z as d,i as x,j as h,o as N,f as j,F as p,b as m,a as S,C as D,B as C,S as P,V as E}from"./index-BgEfQ3_G.js";import{f as _}from"./@react-router-DeDfXbUF.js";import{E as F}from"./EmptyState-CjrgDtVk.js";import{b as T,c as k}from"./@tanstack-5gTMR7G2.js";import{E as I}from"./Error-BG6f_WRd.js";import{t as V}from"./zod-XdS2h1ws.js";import{u as A,C as z}from"./index.esm-DhJo3mA6.js";import{S as q}from"./check-circle-C4tYvbtw.js";import"./@reactflow-B_iCtR7X.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)+"?"+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 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}=A({resolver:V(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:b}})=>e.jsx(D,{checked:b,onCheckedChange:w=>o(!!w),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(C,{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(E,{})}):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};