import{l as a,M as e,z as s,cy as l}from"./utils-lib.js?v=20260328163632";import{n as i,B as n}from"./naive-ui.js?v=20260328163632";import{k as o,i as u,ap as t,c as v,r,o as p,V as d,W as m,X as c,Z as f,Y as _,O as y,N as b,_ as x,a3 as C,j,a1 as D}from"./base-lib.js?v=20260328163632";const k={class:"flex text-medium items-center"},w=o({__name:"index",props:{compData:{default:{},type:Object},compDataModifiers:{},isCut:{default:!0,type:Boolean},isCutModifiers:{}},emits:["update:compData","update:isCut"],setup(o){const w=u("popupClose",(()=>{})),M=t(o,"compData"),B=t(o,"isCut"),O=v((()=>{var a,e;return null==(e=null==(a=M.value)?void 0:a.versions.find((a=>a.setup)))?void 0:e.m_version})),g=r(""),z=v((()=>{var a,e;return null==(e=null==(a=M.value)?void 0:a.versions)?void 0:e.map((a=>({...a,label:M.value.name+" "+a.m_version,value:a.m_version})))})),N=async()=>{if(g.value===O.value)return void e.error(a("当前已经是[{0}]",[O.value]));const{name:i}=M.value,n=M.value.versions.find((a=>a.m_version===g.value));await s({title:a("软件安装"),icon:"warning-filled",content:a("您真的要安装[{0}]吗?",[i+" "+g.value])}),w(),l({name:i,version:g.value,min_version:n.version})};return p((async()=>{var a,e,s;g.value=null==(s=null==(e=null==(a=M.value)?void 0:a.versions)?void 0:e.find((a=>a.setup)))?void 0:s.m_version})),(e,s)=>{const l=i,o=n;return d(),m("div",k,[c("span",null,f(_(a)("选择版本")),1),y(l,{class:"mx-[12px] !w-160px",disabled:!B.value,value:_(g),"onUpdate:value":s[0]||(s[0]=a=>b(g)?g.value=a:null),options:_(z)},null,8,["disabled","value","options"]),B.value?(d(),x(o,{key:0,type:"primary",onClick:N},{default:C((()=>[j(f(_(a)("切换")),1)])),_:1})):D("",!0)])}}});export{w as _};
