import{d as D,e as v,W as h,f as b,g as s,c as g,h as l,a as k,i as w,o as C,j as r,k as c,c6 as I,c7 as x,P as p,c8 as m,bk as P,I as B}from"./index-B5elPXvm.js";import{u as E}from"./usePageTitle-c6xxeh_y.js";const W=D({__name:"DeploymentDuplicate",setup(N){const a=v(),u=h("deploymentId"),d=b(a.deployments.getDeployment,[u.value],{}),e=s(()=>d.response);function i(t){return"name"in t}async function y(t){try{if(!i(t))throw new Error("Invalid request");const n=await a.deployments.createDeployment(t);p("Deployment created","success"),m.push(P.deployment(n.id))}catch(n){const o=B(n,"Error creating deployment");p(o,"error"),console.warn(n)}}function f(){m.back()}const _=s(()=>e.value?`Duplicate Deployment: ${e.value.name}`:"Duplicate Deployment");return E(_),(t,n)=>{const o=w("p-layout-default");return e.value?(C(),g(o,{key:0,class:"deployment-edit"},{header:l(()=>[r(c(I),{deployment:e.value},null,8,["deployment"])]),default:l(()=>[r(c(x),{deployment:e.value,mode:"duplicate",onCancel:f,onSubmit:y},null,8,["deployment"])]),_:1})):k("",!0)}}});export{W as default};
//# sourceMappingURL=DeploymentDuplicate-oYSrl3Nk.js.map
