import{bm as e,o as a,dy as l,am as s,d,p as u}from"./page_layout.js?v=1764830988434";import{k as t,ad as i,am as n,ae as o,a2 as p,V as c,a3 as r,W as v,an as _,R as m,S as f,j as k,a4 as x,H as b}from"./vue.js?v=1764830988434";import{da as h,aX as S,aC as y,dh as g,_ as L,au as U}from"./naive.js?v=1764830988434";const $={key:1,class:"text-desc"},C=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 C=u,w=n(),j=o(u,"value"),B=o(u,"parseList"),D=i,M=async(e,a)=>{if(0===a&&D("update:domain",e),!(null==e?void 0:e.trim()))return void(B.value[a]&&B.value.splice(a,1));const{message:l}=await s({domain:e});d(l)&&j.value[a]&&(B.value[a]={...l,auto:l.support.includes("auto"),ssl_cert:l.support.includes("ssl_cert"),cf_proxy:l.support.includes("cf_proxy")})},q=()=>{w.push("/ssl_domain/domain")};return t({onDomainItemBlur:M}),(s,d)=>{const u=U,t=y,i=S,n=L,o=a,w=g,I=e,H=h,R=l;return c(),p(R,{value:j.value,"onUpdate:value":d[0]||(d[0]=e=>j.value=e)},{default:r(({index:e})=>[v(u,{class:b(C.is_wp?"w-200px!":"w-140px!"),value:j.value[e],"onUpdate:value":a=>j.value[e]=a,placeholder:s.$t("Mail.Setting.index_20"),onBlur:a=>M(j.value[e],e)},null,8,["class","value","onUpdate:value","placeholder","onBlur"])]),action:r(({index:e})=>[v(H,{class:"items-center ml-5px"},{default:r(()=>{var a;return[C.is_wp?_("",!0):(c(),p(i,{key:0},{default:r(()=>[v(t,{onClick:a=>(e=>{j.value.splice(e,1),B.value.splice(e,1),0===e&&D("update:domain",j.value[0]?j.value[0]:"")})(e),disabled:1===j.value.length,round:""},{default:r(()=>d[1]||(d[1]=[f("span",null,"-",-1)])),_:2,__:[1]},1032,["onClick","disabled"]),v(t,{onClick:a=>(e=>{j.value.splice(e+1,0,""),B.value.splice(e+1,0,{})})(e),round:""},{default:r(()=>d[2]||(d[2]=[f("span",null,"+",-1)])),_:2,__:[2]},1032,["onClick"])]),_:2},1024)),(null==(a=B.value[e])?void 0:a.support)?(c(),m("span",$,[v(I,null,{default:r(()=>[v(w,{trigger:"hover",disabled:B.value[e].support.includes("auto")},{trigger:r(()=>[v(n,{checked:B.value[e].auto,"onUpdate:checked":a=>B.value[e].auto=a,disabled:!B.value[e].support.includes("auto"),label:s.$t("SSL.Domain.index_34")},null,8,["checked","onUpdate:checked","disabled","label"])]),default:r(()=>[f("div",null,[k(x(s.$t("SSL.index_5"))+" ",1),v(o,{onClick:q},{default:r(()=>[k(x(s.$t("SSL.index_4")),1)]),_:1})])]),_:2},1032,["disabled"]),v(w,{trigger:"hover",disabled:B.value[e].support.includes("ssl_cert")},{trigger:r(()=>[v(n,{checked:B.value[e].ssl_cert,"onUpdate:checked":a=>B.value[e].ssl_cert=a,disabled:!B.value[e].support.includes("ssl_cert"),label:s.$t("SSL.index_7")},null,8,["checked","onUpdate:checked","disabled","label"])]),default:r(()=>[f("div",null,[k(x(s.$t("SSL.index_6"))+" ",1),v(o,{onClick:q},{default:r(()=>[k(x(s.$t("SSL.index_4")),1)]),_:1})])]),_:2},1032,["disabled"]),B.value[e].support.includes("cf_proxy")?(c(),p(n,{key:0,checked:B.value[e].cf_proxy,"onUpdate:checked":a=>B.value[e].cf_proxy=a,disabled:!B.value[e].support.includes("cf_proxy"),label:s.$t("SSL.index_8")},null,8,["checked","onUpdate:checked","disabled","label"])):_("",!0)]),_:2},1024)])):_("",!0)]}),_:2},1024)]),_:1},8,["value"])}}}),[["__scopeId","data-v-4f4b9d13"]]);export{C as D};
