import{d as D,g as v,W as g,e as h,i as l,c as k,j as s,a as w,k as C,o as b,l as r,m as c,c6 as x,c7 as B,P as p,c8 as m,bk as I,L as P}from"./index-Cq5Q7kWk.js";import{u as E}from"./usePageTitle-NgGMZFeo.js";const W=D({__name:"DeploymentDuplicate",setup(N){const a=v(),u=g("deploymentId"),d=h(a.deployments.getDeployment,[u.value],{}),e=l(()=>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(I.deployment(n.id))}catch(n){const o=P(n,"Error creating deployment");p(o,"error"),console.warn(n)}}function f(){m.back()}const _=l(()=>e.value?`Duplicate Deployment: ${e.value.name}`:"Duplicate Deployment");return E(_),(t,n)=>{const o=C("p-layout-default");return e.value?(b(),k(o,{key:0,class:"deployment-edit"},{header:s(()=>[r(c(x),{deployment:e.value},null,8,["deployment"])]),default:s(()=>[r(c(B),{deployment:e.value,mode:"duplicate",onCancel:f,onSubmit:y},null,8,["deployment"])]),_:1})):w("",!0)}}});export{W as default};
//# sourceMappingURL=DeploymentDuplicate-DB_6_FJE.js.map
