import{c as e,o as a,aG as l,g5 as s,e as u}from"./page_layout.js?v=1753954525509";import{j as d}from"./public.js?v=1753954525509";import{k as t,ab as i,aj as o,ac as n,U as c,a1 as p,a2 as r,Q as v,H as _,W as f,al as m,V as b,j as k,a3 as x}from"./vue.js?v=1753954525509";import{aq as h,ay as S,aV as g,_ as y,c3 as L,bY as U}from"./naive.js?v=1753954525509";const $={key:1,class:"text-desc"},j=u(t({__name:"domain-input",props:i({is_wp:{type:Boolean,default:!1}},{value:{required:!0},valueModifiers:{},parseList:{required:!0},parseListModifiers:{}}),emits:i(["update:domain"],["update:value","update:parseList"]),setup(u,{expose:t,emit:i}){const j=u,w=o(),C=n(u,"value"),B=n(u,"parseList"),q=i,D=async(a,l)=>{if(0===l&&q("update:domain",a),!(null==a?void 0:a.trim()))return void(B.value[l]&&B.value.splice(l,1));const{message:s}=await d({domain:a});e(s)&&C.value[l]&&(B.value[l]={...s,auto:s.support.includes("auto"),ssl_cert:s.support.includes("ssl_cert"),cf_proxy:s.support.includes("cf_proxy")})},M=()=>{w.push("/ssl_domain/domain")};return t({onDomainItemBlur:D}),(e,u)=>{const d=h,t=S,i=g,o=y,n=a,w=L,I=l,V=U,G=s;return c(),p(G,{value:C.value,"onUpdate:value":u[0]||(u[0]=e=>C.value=e)},{default:r((({index:a})=>[v(d,{class:_(j.is_wp?"w-200px!":"w-140px!"),value:C.value[a],"onUpdate:value":e=>C.value[a]=e,placeholder:e.$t("Mail.Setting.index_20"),onBlur:e=>D(C.value[a],a)},null,8,["class","value","onUpdate:value","placeholder","onBlur"])])),action:r((({index:a})=>[v(V,{class:"items-center ml-5px"},{default:r((()=>{var l;return[j.is_wp?m("",!0):(c(),p(i,{key:0},{default:r((()=>[v(t,{onClick:e=>(e=>{C.value.splice(e,1),B.value.splice(e,1),0===e&&q("update:domain",C.value[0]?C.value[0]:"")})(a),disabled:1===C.value.length,round:""},{default:r((()=>u[1]||(u[1]=[f("span",null,"-",-1)]))),_:2,__:[1]},1032,["onClick","disabled"]),v(t,{onClick:e=>(e=>{C.value.splice(e+1,0,""),B.value.splice(e+1,0,{})})(a),round:""},{default:r((()=>u[2]||(u[2]=[f("span",null,"+",-1)]))),_:2,__:[2]},1032,["onClick"])])),_:2},1024)),(null==(l=B.value[a])?void 0:l.support)?(c(),b("span",$,[v(I,null,{default:r((()=>[v(w,{trigger:"hover",disabled:B.value[a].support.includes("auto")},{trigger:r((()=>[v(o,{checked:B.value[a].auto,"onUpdate:checked":e=>B.value[a].auto=e,disabled:!B.value[a].support.includes("auto"),label:e.$t("SSL.Domain.index_34")},null,8,["checked","onUpdate:checked","disabled","label"])])),default:r((()=>[f("div",null,[k(x(e.$t("SSL.index_5"))+" ",1),v(n,{onClick:M},{default:r((()=>[k(x(e.$t("SSL.index_4")),1)])),_:1})])])),_:2},1032,["disabled"]),v(w,{trigger:"hover",disabled:B.value[a].support.includes("ssl_cert")},{trigger:r((()=>[v(o,{checked:B.value[a].ssl_cert,"onUpdate:checked":e=>B.value[a].ssl_cert=e,disabled:!B.value[a].support.includes("ssl_cert"),label:e.$t("SSL.index_7")},null,8,["checked","onUpdate:checked","disabled","label"])])),default:r((()=>[f("div",null,[k(x(e.$t("SSL.index_6"))+" ",1),v(n,{onClick:M},{default:r((()=>[k(x(e.$t("SSL.index_4")),1)])),_:1})])])),_:2},1032,["disabled"]),B.value[a].support.includes("cf_proxy")?(c(),p(o,{key:0,checked:B.value[a].cf_proxy,"onUpdate:checked":e=>B.value[a].cf_proxy=e,disabled:!B.value[a].support.includes("cf_proxy"),label:e.$t("SSL.index_8")},null,8,["checked","onUpdate:checked","disabled","label"])):m("",!0)])),_:2},1024)])):m("",!0)]})),_:2},1024)])),_:1},8,["value"])}}}),[["__scopeId","data-v-4f4b9d13"]]);export{j as D};
