import{n as e,r as t}from"./rolldown-runtime-DAXXjFlN.js";import{Fr as n,dn as r,gr as i}from"./vendor-Dnfj1twE.js";import{A as a,g as o,i as s,j as c}from"./vendor-vue--4CNL3BY.js";import{$r as l,Jr as u,Mo as d,ei as f,jo as p}from"./ws-Dl8XkIy4.js";var m=t({usePluginStore:()=>h}),h,g=e((()=>{s(),c(),d(),l(),r(),h=a(`plugin-store`,()=>{let e=p();n(0);let t=n([]),r=o(`c3api/applied-plugins`,[]);i(r,t=>{for(let n of t)if(!f(n))try{u(`${e}/plugins/${n}/plugin.js`)}catch(e){console.error(`Failed to load plugin ${n}`,e)}},{immediate:!0});function a(t){r.value.includes(t)||r.value.push(t),u(`${e}/plugins/${t}/plugin.js`)}function s(e){let t=r.value.indexOf(e);t!==-1&&r.value.splice(t,1)}async function c(){let n=`${e}/plugins/list`;t.value=await fetch(n).then(e=>e.json())}return{availPlugins:t,appliedPlugins:r,refreshList:c,enablePlugin:a,disablePlugin:s}})}));export{m as n,h as r,g as t};