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