import{j as e,d as o,b4 as h,bg as F,aY as y,w as b,eQ as P,au as v,av as C,ba as S,L as D,Q as V,d0 as i,b5 as w,b6 as E,g as G,q as M}from"./index-CK33qGU_.js";import{u as A}from"./useScreenWithScroll-zcr7TMGO.js";import{u as L}from"./useDownload-hrjXceJg.js";import{B}from"./ButtonWithRole-NHXEosto.js";import{D as I,K as N,T as R,a as k,I as W,A as K,R as O,v as Q}from"./validations-CoDvGmdx.js";import{M as T,a as U,b as q,A as Y,c as z,P as H,d as J}from"./PythonEnvField-CxRihNtd.js";import{N as X}from"./NameField-LGmKtw2e.js";import{s,g as Z}from"./utils-BLs53_9b.js";import"./useProject-BzBQtp4J.js";import"./length-fOfC3W0h.js";import"./SingleSelect-CV8k2k_j.js";import"./index-CBcuRugC.js";import"./useProjectId-CsRVHJQA.js";import"./FileUploaderButton-Bppadu35.js";import"./dumbPluralize-CcxDsNiu.js";import"./PrimaryIconButton-DQUEhx3G.js";import"./index-B4h3z62J.js";import"./cluster-utilization-DS4X6Ne5.js";import"./min-Esn8rYAn.js";import"./__-BIxbRvwe.js";const _=()=>e.jsxs(o,{sx:s.defaultGap,children:[e.jsx(X,{}),e.jsx(I,{})]}),Fe=()=>{const{id:a,project:n}=L(),l=A(),d=h(),c=F(),{state:m={}}=y(),[p,x]=b(),[u,{isLoading:r}]=P(),t=v({reValidateMode:"onChange",shouldUnregister:!1,mode:"onChange",defaultValues:{artifactVersion:null,...m},resolver:C(Q)}),j=async f=>{if(G(t.formState.errors))try{await u({projectId:a,formValues:Z({formValues:f,project:n})}).unwrap(),c(M.deployments.list)}catch(g){console.error(g)}};return e.jsxs(S,{...t,children:[r&&e.jsx(D,{}),e.jsxs("form",{onSubmit:t.handleSubmit(j,console.error),style:s.editForm,children:[e.jsx(o,{justifyContent:"center",sx:s.editFormWrapper,children:e.jsxs(o,{flexDirection:"column",sx:s.fieldsWrapper,children:[e.jsx(V,{title:"Create new deployment",children:e.jsxs(o,{flexDirection:"column",sx:s.defaultGap,children:[e.jsx(T,{}),e.jsx(_,{}),e.jsxs(o,{sx:s.defaultGap,children:[e.jsx(U,{}),e.jsx(q,{}),e.jsx(Y,{})]}),e.jsx(N,{}),e.jsx(z,{}),e.jsx(H,{isFileExplorerOpen:p,toggleFileExplorerPopup:x}),e.jsx(R,{}),e.jsx(J,{})]})}),e.jsx(i,{title:"Inference logging",children:e.jsxs(o,{flexDirection:"column",sx:s.defaultGap,children:[e.jsx(k,{}),e.jsx(W,{})]})}),e.jsx(i,{title:"Configuration",children:e.jsx(o,{flexDirection:"column",sx:s.defaultGap,children:e.jsx(K,{})})}),e.jsx(i,{title:"Resource allocation",children:e.jsx(O,{})})]})}),e.jsx(w,{hasScrollOnScreen:l,mainButton:e.jsx(B,{type:"submit",intent:"primary",disabled:r,isLoading:r,children:"Create new deployment"}),secondaryButton:e.jsx(E,{type:"button",intent:"secondary",onClick:()=>d(-1),children:"Back"})})]})]})};export{Fe as Create,Fe as default};
