import{F as C}from"./link-DQNFdX6e.js";import{C as u,aA as b,b as n,a8 as V,M as h,at as w,u as D,j as F}from"./app-QjDgb7aF.js";import{F as M}from"./section-Dbg05qO2.js";import{M as m}from"./MkKeyValue-BeApKcpm.js";import{b as N,a as S,j as p,p as g,k as c,i as t,J as o,D as a,u as i,q as d,F as A,G as P,g as j,H as L,n as _}from"./vue-Cm77DuTi.js";import"./charts-3gEHPHRq.js";import"./media-DuCIZ-3n.js";const R={class:"_formRoot"},T={style:{display:"flex"}},U={style:{"margin-left":"auto"}},$={style:{display:"flex",gap:"var(--margin)","flex-wrap":"wrap"}},O=N({__name:"plugin",setup(q){const k=S(u.get("plugins"));function y(l){u.set("plugins",k.value.filter(s=>s.id!==l.id)),w(),_(()=>{D()})}async function x(l){const s=l.config;for(const f in l.configData)s[f].default=l.configData[f];const{canceled:e,result:r}=await F(l.name,s);if(e)return;const v=u.get("plugins");v.find(f=>f.id===l.id).configData=r,u.set("plugins",v),_(()=>{location.reload()})}function B(l,s){const e=u.get("plugins");e.find(r=>r.id===l.id).active=s,u.set("plugins",e),_(()=>{location.reload()})}return b({title:n.ts.plugins,icon:"ph-plug ph-bold ph-lg"}),(l,s)=>(p(),g("div",R,[c(C,{to:"/settings/plugin/install"},{icon:t(()=>[...s[0]||(s[0]=[d("i",{class:"ph-download-simple ph-bold ph-lg"},null,-1)])]),default:t(()=>[o(a(i(n).ts._plugin.install),1)]),_:1}),c(M,null,{label:t(()=>[o(a(i(n).ts.manage),1)]),default:t(()=>[(p(!0),g(A,null,P(k.value,e=>(p(),g("div",{key:e.id,class:"_formBlock _panel",style:{padding:"20px"}},[d("span",T,[d("b",null,a(e.name),1),d("span",U,"v"+a(e.version),1)]),c(V,{class:"_formBlock","model-value":e.active,"onUpdate:modelValue":r=>B(e,r)},{default:t(()=>[o(a(i(n).ts.makeActive),1)]),_:1},8,["model-value","onUpdate:modelValue"]),c(m,{class:"_formBlock"},{key:t(()=>[o(a(i(n).ts.author),1)]),value:t(()=>[o(a(e.author),1)]),_:2},1024),c(m,{class:"_formBlock"},{key:t(()=>[o(a(i(n).ts.description),1)]),value:t(()=>[o(a(e.description),1)]),_:2},1024),c(m,{class:"_formBlock"},{key:t(()=>[o(a(i(n).ts.permission),1)]),value:t(()=>[o(a(e.permission),1)]),_:2},1024),d("div",$,[e.config?(p(),j(h,{key:0,inline:"",onClick:r=>x(e)},{default:t(()=>[s[1]||(s[1]=d("i",{class:"ph-gear-six ph-bold ph-lg"},null,-1)),o(" "+a(i(n).ts.settings),1)]),_:1},8,["onClick"])):L("",!0),c(h,{inline:"",danger:"",onClick:r=>y(e)},{default:t(()=>[s[2]||(s[2]=d("i",{class:"ph-trash ph-bold ph-lg"},null,-1)),o(" "+a(i(n).ts.uninstall),1)]),_:1},8,["onClick"])])]))),128))]),_:1})]))}});export{O as default};
//# sourceMappingURL=plugin-DaSqR79D.js.map
