var p=(f,o,n)=>new Promise((s,r)=>{var c=e=>{try{t(n.next(e))}catch(m){r(m)}},i=e=>{try{t(n.throw(e))}catch(m){r(m)}},t=e=>e.done?s(e.value):Promise.resolve(e.value).then(c,i);t((n=n.apply(f,o)).next())});import{u as d}from"./useEditDrawer-JG4PTzvo.js";import{b6 as u}from"./bootstrap-Bqxdt4iG.js";import{u as l}from"./announcements-8EaxYlGv.js";import{u as _}from"./data-refresh-BZ1_-6mk.js";import{_ as b}from"./announcement-form.vue_vue_type_script_setup_true_lang-WwaKo_20.js";import{a1 as w,ai as x,aj as S,ak as h,p as D,a9 as a}from"../jse/index-index-BUJ_4tQs.js";const C=w({__name:"announcement-edit-drawer",setup(f){const o=l(),n=_(),{Drawer:s,entity:r,formRef:c,handleSubmit:i}=d({getDetailApi:t=>p(null,null,function*(){const e=yield o.getDetail(t);if(!e)throw new Error("Announcement not found");return e}),updateApi:(t,e)=>o.update(t,e),invalidateData:()=>n.invalidateAnnouncements(),title:u("page.announcements.edit"),idKey:"announcementId"});return(t,e)=>(S(),x(a(s),{class:"w-[640px]","confirm-text":a(u)("page.table.button.save"),"cancel-text":a(u)("page.table.button.cancel")},{default:h(()=>[D(b,{ref_key:"formRef",ref:c,announcement:a(r),mode:"edit",onSubmit:a(i)},null,8,["announcement","onSubmit"])]),_:1},8,["confirm-text","cancel-text"]))}});export{C as _};
