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