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