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