import{t as m,Q as g,m as r,B as l,i,af as p,h as f,aG as c,z as u,y,A as w,a3 as S}from"./index-BTglIPU2.js?v=1773287522785";const I=async a=>{const{close:t}=r.loading("Processing, please wait...");try{const{message:s}=await l({sName:a});if(i(s)){const e=s.versions[0].full_version;f({title:"Install plugin",content:"Are you sure to install [".concat(s.title," v").concat(e,"] plugin?"),onConfirm:async()=>{s.status?await c({sName:s.name,version:e,upgrade:e}):await c({sName:s.name,version:e}),u()}})}}finally{t()}},N=async(a,t)=>{const{close:s}=r.loading("Processing, please wait...");try{const{message:e}=await l({sName:a});if(i(e)){const o=e.versions[0].full_version;f({title:"Install plugin",content:"Are you sure to install [".concat(e.title," v").concat(o,"] plugin?"),onConfirm:async()=>{const{message:n}=await y({sName:e.name,version:o,upgrade:o,type:1});if(i(n)){if(n.result){u();return}await w({name:n.name,tmp_path:n.tmp_path,title:S.global.t("Soft.index_21")},()=>{t==null||t()})}}})}}finally{s()}},v=async(a,t=!0)=>{let s;t&&(s=r.loading("Processing, please wait..."));try{const{message:e}=await l({sName:a});return i(e)&&e.setup?e:(p(a),Promise.reject())}finally{t&&(s==null||s.close())}},$=async(a,t,s=!1)=>m().isFree?(g({source:t}),Promise.reject()):await v(a,s),d=a=>{const t=a.replace(/-+[{0-9},.,]+$/,"");return"/static/img/soft_ico/ico-".concat(t,".png")};export{$ as c,d as g,I as i,N as u};