import{n as e,r as t}from"./rolldown-runtime-CMxvf4Kt.js";import{Xn as n,hr as r,qt as i}from"./vendor-C4JLrdLj.js";import{M as a,N as o,_ as s,i as c}from"./vendor-vue-SNAXxxQe.js";import{Ci as l,Wn as u,Xn as d,Yn as f,wi as p}from"./ws-JRT2XE7Y.js";var m=t({usePluginStore:()=>h}),h,g=e((()=>{c(),o(),p(),f(),i(),h=a(`plugin-store`,()=>{let e=l();r(0);let t=r([]),i=s(`c3api/applied-plugins`,[]);n(i,t=>{for(let n of t)if(!d(n))try{u(`${e}/plugins/${n}/plugin.js`)}catch(e){console.error(`Failed to load plugin ${n}`,e)}},{immediate:!0});function a(t){i.value.includes(t)||i.value.push(t),u(`${e}/plugins/${t}/plugin.js`)}function o(e){let t=i.value.indexOf(e);t!==-1&&i.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:i,refreshList:c,enablePlugin:a,disablePlugin:o}})}));export{m as n,h as r,g as t};