import{_ as q,i as A,c as P}from"./index-BTglIPU2.js?v=1773287522785";import{g as z}from"./ssl-Bm8jcneQ.js?v=1773287522785";import{k as E,am as H,an as B,$ as _,a8 as f,a9 as s,a0 as n,_ as r,ak as k,Z as O,j as i,aa as d,L as T,ao as C}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import{k as Z,aH as F,B as G,ap as J,a5 as K,al as Q,b as W,aV as X}from"./naive-ui--dJnpVcV.js?v=1773287522785";const Y={key:1,class:"text-desc"},x=E({__name:"domain-input",props:C({is_wp:{type:Boolean,default:!1}},{value:{required:!0},valueModifiers:{},parseList:{required:!0},parseListModifiers:{}}),emits:C(["update:domain"],["update:value","update:parseList"]),setup(v,{expose:U,emit:D}){const b=v,w=H(),o=B(v,"value"),t=B(v,"parseList"),g=D,S=async(a,l)=>{if(l===0&&g("update:domain",a),!(a!=null&&a.trim())){t.value[l]&&t.value.splice(l,1);return}const{message:u}=await z({domain:a});A(u)&&o.value[l]&&(t.value[l]={...u,auto:u.support.includes("auto"),ssl_cert:u.support.includes("ssl_cert"),cf_proxy:u.support.includes("cf_proxy")})},M=a=>{o.value.splice(a,1),t.value.splice(a,1),a===0&&g("update:domain",o.value[0]?o.value[0]:"")},V=a=>{o.value.splice(a+1,0,""),t.value.splice(a+1,0,{})},h=()=>{w.push("/ssl_domain/domain")};return U({onDomainItemBlur:S}),(a,l)=>{const u=W,L=G,N=F,m=Q,$=q,y=K,I=J,R=Z,j=X;return _(),f(j,{value:o.value,"onUpdate:value":l[0]||(l[0]=e=>o.value=e)},{default:s(({index:e})=>[n(u,{class:T(b.is_wp?"w-200px!":"w-140px!"),value:o.value[e],"onUpdate:value":c=>o.value[e]=c,placeholder:a.$t("Mail.Setting.index_20"),onBlur:c=>S(o.value[e],e)},null,8,["class","value","onUpdate:value","placeholder","onBlur"])]),action:s(({index:e})=>[n(R,{class:"items-center ml-5px"},{default:s(()=>{var c;return[b.is_wp?k("",!0):(_(),f(N,{key:0},{default:s(()=>[n(L,{onClick:p=>M(e),disabled:o.value.length===1,round:""},{default:s(()=>l[1]||(l[1]=[r("span",null,"-",-1)])),_:2,__:[1]},1032,["onClick","disabled"]),n(L,{onClick:p=>V(e),round:""},{default:s(()=>l[2]||(l[2]=[r("span",null,"+",-1)])),_:2,__:[2]},1032,["onClick"])]),_:2},1024)),(c=t.value[e])!=null&&c.support?(_(),O("span",Y,[n(I,null,{default:s(()=>[n(y,{trigger:"hover",disabled:t.value[e].support.includes("auto")},{trigger:s(()=>[n(m,{checked:t.value[e].auto,"onUpdate:checked":p=>t.value[e].auto=p,disabled:!t.value[e].support.includes("auto"),label:a.$t("SSL.Domain.index_34")},null,8,["checked","onUpdate:checked","disabled","label"])]),default:s(()=>[r("div",null,[i(d(a.$t("SSL.index_5"))+" ",1),n($,{onClick:h},{default:s(()=>[i(d(a.$t("SSL.index_4")),1)]),_:1})])]),_:2},1032,["disabled"]),n(y,{trigger:"hover",disabled:t.value[e].support.includes("ssl_cert")},{trigger:s(()=>[n(m,{checked:t.value[e].ssl_cert,"onUpdate:checked":p=>t.value[e].ssl_cert=p,disabled:!t.value[e].support.includes("ssl_cert"),label:a.$t("SSL.index_7")},null,8,["checked","onUpdate:checked","disabled","label"])]),default:s(()=>[r("div",null,[i(d(a.$t("SSL.index_6"))+" ",1),n($,{onClick:h},{default:s(()=>[i(d(a.$t("SSL.index_4")),1)]),_:1})])]),_:2},1032,["disabled"]),t.value[e].support.includes("cf_proxy")?(_(),f(m,{key:0,checked:t.value[e].cf_proxy,"onUpdate:checked":p=>t.value[e].cf_proxy=p,disabled:!t.value[e].support.includes("cf_proxy"),label:a.$t("SSL.index_8")},null,8,["checked","onUpdate:checked","disabled","label"])):k("",!0)]),_:2},1024)])):k("",!0)]}),_:2},1024)]),_:1},8,["value"])}}}),le=P(x,[["__scopeId","data-v-4f4b9d13"]]);export{le as D};
