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