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