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