import{d as D,_ as v,W as b,b as g,e as s,c as h,f as l,a as w,g as C,o as k,j as c,k as r,ca as x,cb as I,P as p,cc as m,bo as P,Y as B}from"./index-BrFqolpA.js";import{u as E}from"./usePageTitle-CsnULHHx.js";const W=D({__name:"DeploymentDuplicate",setup(N){const a=v(),u=b("deploymentId"),d=g(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=C("p-layout-default");return e.value?(k(),h(o,{key:0,class:"deployment-edit"},{header:l(()=>[c(r(x),{deployment:e.value},null,8,["deployment"])]),default:l(()=>[c(r(I),{deployment:e.value,mode:"duplicate",onCancel:f,onSubmit:y},null,8,["deployment"])]),_:1})):w("",!0)}}});export{W as default};
//# sourceMappingURL=DeploymentDuplicate-C8XaDMQd.js.map
