import{c as e,s as a,o as s,r as t,q as r,v as l,x as o,e as m,B as i,y as n,F as d,b0 as u,N as p,z as c,A as f,R as v,ak as b,al as N,ab as _,a9 as h}from"./base-lib.js?v=1761009159";import{verifyTrustAsiaCret as y}from"./site.js?v=1761009159";import{b as I}from"./utils-lib.js?v=1761009159";import{u as O}from"./useStore11.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";const j={class:"p-[16px]"},w={style:{float:"left"}},D=e({__name:"index",props:{compData:{type:Object,default:()=>{}}},setup(e,{expose:D}){const{activeTabs:x,sslIsRefresh:R,testIsRefresh:g,encryptIsRefresh:C,otherIsRefresh:z}=a(O()),S=I(),V=e,k=s({siteName:"",partnerOrderId:""}),q=t([]),A=()=>{k.siteName="",k.partnerOrderId=""};return r(()=>{(async()=>{var e;q.value=V.compData.row.domainName,k.partnerOrderId=V.compData.row.partnerOrderId,(null==(e=V.compData.row.domainName)?void 0:e.length)&&(k.siteName=V.compData.row.domainName[0])})()}),D({onConfirm:async e=>{var a;if(!k.siteName)return void S.error("请选择验证域名");let s;try{s=S.load("正在验证证书申请状态，请稍后...");const{data:t,msg:r,status:l}=await y({partnerOrderId:k.partnerOrderId,siteName:k.siteName});if(S.request({status:l,msg:r}),l)if(A(),e(),"COMPLETED"===t.stateCode){S.success("验证成功");const e={ssl:()=>R.value=!0,test:()=>g.value=!0,encrypt:()=>C.value=!0,other:()=>z.value=!0};null==(a=e[x.value])||a.call(e)}else S.success("等待CA验证中，若长时间未能成功验证，请登录官网使用DNS方式重新申请...")}catch(t){}finally{s&&s.close()}}}),(e,a)=>{const s=b,t=N,r=_,y=h;return l(),o("div",j,[m(y,{model:n(k),class:"relative w-full","label-position":"right",size:"small",onSubmit:a[1]||(a[1]=v(()=>{},["prevent"]))},{default:i(()=>[m(r,{label:"验证域名",prop:"dns_name"},{default:i(()=>[m(t,{modelValue:n(k).siteName,"onUpdate:modelValue":a[0]||(a[0]=e=>n(k).siteName=e),class:"!w-[33rem]",filterable:"","default-first-option":"",size:"default",placeholder:"请选择验证域名"},{default:i(()=>[(l(!0),o(d,null,u(n(q),e=>(l(),p(s,{key:e,label:e,value:e},{default:i(()=>[c("span",w,f(e),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model"])])}}});export{D as default};
