import{d as w,O as y,ao as v,e as C,r as N,o as s,f as c,w as r,k as g,g as u,aY as k,aX as x,h as E,aV as f,a5 as l,t as p,a4 as V}from"./index.52551726.js";import{u as b}from"./useRouteParam.4bc8e74f.js";const P=w({__name:"NotificationEdit",async setup(A){let t,n;const i=b("notificationId"),o=y({...([t,n]=v(()=>f.getNotification(i.value)),t=await t,n(),t)});async function _(e){try{await f.updateNotification(i.value,e),l.push(p.notifications())}catch(a){V("Error updating notification","error"),console.warn(a)}}function m(){l.push(p.notifications())}return C("Edit Notification"),(e,a)=>{const d=N("p-layout-default");return s(),c(d,null,{header:r(()=>[g(u(k))]),default:r(()=>[o.value?(s(),c(u(x),{key:0,notification:o.value,"onUpdate:notification":a[0]||(a[0]=h=>o.value=h),onSubmit:_,onCancel:m},null,8,["notification"])):E("",!0)]),_:1})}}});export{P as default};
