var e=(e,a,l)=>new Promise((n,t)=>{var i=e=>{try{o(l.next(e))}catch(a){t(a)}},s=e=>{try{o(l.throw(e))}catch(a){t(a)}},o=e=>e.done?n(e.value):Promise.resolve(e.value).then(i,s);o((l=l.apply(e,a)).next())});import{w as a,s as l,a7 as n,e as t,x as i,R as s,T as o}from"./vendor-element-DupX9wXy.js";import{q as u,bI as d,r,R as p,t as c,v as m,M as v,E as h,F as g,H as b,D as f,u as y,A as w,K as x,J as M}from"./vendor-core-Di0OO4oJ.js";import{Q as P,T as _,U as C}from"./index-BkDr3sJj.js";const k={class:"shop-plugin-page p-4"},j={class:"flex items-center justify-between"},T={class:"text-base font-medium"},V=["innerHTML"],H={key:0,class:"py-6 text-center text-gray-400"},U=u({__name:"index",setup(u){const{t:U}=d(),L=r(!1),R=r([]),q=()=>e(null,null,function*(){L.value=!0;try{const e=yield P();R.value=(null==e?void 0:e.available)||[]}finally{L.value=!1}});return p(q),(u,d)=>{const r=t,p=l,P=n,A=a,D=s,E=i;return m(),c("div",k,[v(D,{shadow:"never"},{header:h(()=>[w("div",j,[w("span",T,x(y(U)("shopPluginManage.title")),1),v(r,{type:"primary",plain:"",onClick:q},{default:h(()=>[M(x(y(U)("common.refresh")),1)]),_:1})])]),default:h(()=>[g((m(),f(A,{data:R.value,class:"w-full"},{default:h(()=>[v(p,{prop:"name",label:y(U)("shopPluginManage.name"),"min-width":"160"},null,8,["label"]),v(p,{label:y(U)("shopPluginManage.desc"),"min-width":"220"},{default:h(({row:e})=>[w("div",{innerHTML:e.desc},null,8,V)]),_:1},8,["label"]),v(p,{prop:"type",label:y(U)("shopPluginManage.type"),"min-width":"120"},null,8,["label"]),v(p,{label:y(U)("shopPluginManage.entry"),"min-width":"180"},{default:h(({row:e})=>[w("span",null,x(e.entry||"-"),1)]),_:1},8,["label"]),v(p,{prop:"path",label:y(U)("shopPluginManage.path"),"min-width":"220"},null,8,["label"]),v(p,{label:y(U)("shopPluginManage.visible"),width:"160"},{default:h(({row:a})=>[v(P,{modelValue:a.visible,"onUpdate:modelValue":e=>a.visible=e,"active-value":!0,"inactive-value":!1,"inline-prompt":"","active-text":y(U)("common.enable"),"inactive-text":y(U)("common.disabled"),onChange:l=>(a=>e(null,null,function*(){const e=a.visible?1:0;yield _({code:a.code,visible:e}),yield q()}))(a)},null,8,["modelValue","onUpdate:modelValue","active-text","inactive-text","onChange"])]),_:1},8,["label"]),v(p,{label:y(U)("shopPluginManage.action"),width:"120",fixed:"right"},{default:h(({row:a})=>[v(r,{type:"danger",link:"",onClick:l=>(a=>e(null,null,function*(){yield o.confirm(U("shopPluginManage.uninstallConfirm"),U("common.tips"),{type:"warning"}),yield C({code:a.code}),yield q()}))(a)},{default:h(()=>[M(x(y(U)("shopPluginManage.uninstall")),1)]),_:1},8,["onClick"])]),_:1},8,["label"])]),_:1},8,["data"])),[[E,L.value]]),L.value||0!==R.value.length?b("",!0):(m(),c("div",H,x(y(U)("shopPluginManage.empty")),1))]),_:1})])}}});export{U as default};
