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