import{_ as a}from"./index.vue_vue_type_script_setup_true_lang.js?v=1753954525509";import{m as e,c as i}from"./page_layout.js?v=1753954525509";import{c as s}from"./public.js?v=1753954525509";import{b as n}from"./site.js?v=1753954525509";import{i as o}from"./index50.js?v=1753954525509";import{k as t,P as l,r,e as p,aj as m,U as u,V as d,Q as v,a2 as _,W as c,X as f,a1 as g,j,a3 as h,al as x,F as b}from"./vue.js?v=1753954525509";import{aq as y,cI as w,av as M,cA as k,cG as P}from"./naive.js?v=1753954525509";import"./common.js?v=1753954525509";import"./__commonjsHelpers__.js?v=1753954525509";import"./index.js?v=1753954525509";import"./index.vue_vue_type_script_setup_true_lang4.js?v=1753954525509";import"./index.vue_vue_type_script_setup_true_lang7.js?v=1753954525509";import"./index.vue_vue_type_script_setup_true_lang5.js?v=1753954525509";import"./mail2.js?v=1753954525509";const S={class:"p-20px pt-24px pb-8px"},W={class:"w-240px"},I={class:"w-240px"},U=t({__name:"install",props:{domain:{type:Object}},emits:["refresh"],setup(t,{expose:U,emit:C}){const E=C,{t:H}=l(),$=r(null),q=p({domain:"",php_version:null}),A={domain:{trigger:"change",validator:()=>""!==q.domain.trim()||new Error(H("Mail.Setting.index_20"))},php_version:{trigger:"change",validator:()=>null!==q.php_version||new Error(H("Mail.Setting.index_21"))}},F=r([]),G=async()=>{const{message:a}=await n();if(i(a)){F.value=a.versions.reverse().map((a=>({label:a.name,value:a.version})));const e=a.versions.findIndex((a=>"74"===a.version));q.php_version=-1!==e?a.versions[e].version:a.versions[0].version}},{loading:L,setLoading:O}=s(),Q=m();return(async()=>{try{O(!0),await Promise.all([G()])}finally{O(!1)}})(),U({onConfirm:async()=>{var a,i,s;await(null==(a=$.value)?void 0:a.validate()),await o({webmail_domain:"".concat(q.domain,".").concat((null==(i=t.domain)?void 0:i.domain)||""),php_version:q.php_version||"",domain:(null==(s=t.domain)?void 0:s.domain)||""});const{close:n}=e.success({content:()=>v(b,null,[j("WebMail Installation Successful, "),v("br",null,null),j(' Manage WebMail view in "'),v("a",{class:"bt-link",href:"javascript:;",onClick:()=>{Q.push("/site/php"),n()}},[j("Website > PHP Project")]),j('"')]),close:!0,maxWidth:480});E("refresh")}}),(e,i)=>{const s=y,n=w,o=M,l=k,r=P,p=a;return u(),d("div",S,[v(p,{ref_key:"formRef",ref:$,model:f(q),rules:A},{default:_((()=>[v(l,{label:e.$t("Mail.Setting.index_18"),path:"domain"},{default:_((()=>[c("div",W,[v(o,null,{default:_((()=>{var a;return[v(s,{value:f(q).domain,"onUpdate:value":i[0]||(i[0]=a=>f(q).domain=a)},null,8,["value"]),(null==(a=t.domain)?void 0:a.domain)?(u(),g(n,{key:0},{default:_((()=>{var a;return[j(" ."+h(null==(a=t.domain)?void 0:a.domain),1)]})),_:1})):x("",!0)]})),_:1})])])),_:1},8,["label"]),v(l,{label:e.$t("Mail.Setting.index_19"),path:"php_version"},{default:_((()=>[c("div",I,[v(r,{value:f(q).php_version,"onUpdate:value":i[1]||(i[1]=a=>f(q).php_version=a),loading:f(L),options:f(F)},null,8,["value","loading","options"])])])),_:1},8,["label"])])),_:1},8,["model"])])}}});export{U as default};
