import x from"./DgZ9OEJo.js";import{_ as C}from"./Du23p2ZK.js";import{_ as b}from"./D_pw6GNO.js";import{v as w,m as E,n as L,s as N,r as _,H as O,_ as V,o as l,c as u,a as s,t as o,b as f,E as W,w as S,d as c,I as B,p as D,q as T}from"./CChoqk00.js";const j=w({__name:"ResendLink",props:{resendType:{type:String,default:"activateEmail"}},emits:["resend"],setup(t,{expose:i,emit:g}){i();const e=E(),d=L(),n=N(),a=t,p=g,r=_(!1),y=()=>{d.currentStep=0,n.clearData(),e.push("/signup")},R=O().public.WHM_EXTRAS,m=_(""),k=_(!1),h={router:e,store:d,sStore:n,props:a,emit:p,open:r,handleRestartSignup:y,isWhm:R,resendError:m,linkSent:k,resendLink:async()=>{const{error:v}=a.resendType==="resetPassword"?await n.triggerPasswordReset(n.signUpData.email):await n.resendVerificationEmail(n.signUpData.email);if(v){m.value=v;return}k.value=!0},toggleOpen:()=>{r.value=!r.value,r.value||(m.value="")}};return Object.defineProperty(h,"__isScriptSetup",{enumerable:!1,value:!0}),h}}),H={class:"bg-slate-100 p-4 rounded-lg text-sm leading-6"},M={class:"text-slate-900 font-medium"},P={class:"text-nowrap flex flex-col gap-2 py-4"},U={key:0},z={key:1},A={class:"flex items-center gap-1 text-slate-600"};function I(t,i,g,e,d,n){const a=x,p=C,r=b;return l(),u("div",H,[s("div",{class:"flex flex-row justify-between cursor-pointer",onClick:e.toggleOpen},[s("span",M,o(e.isWhm?t.$t("CodeNotReceived"):t.$t("LinkNotReceived")),1),f(a,{class:W(["size-5 text-gray-500",{"transform rotate-90":e.open}]),name:"tabler:chevron-right"},null,8,["class"])]),f(r,{open:e.open},{default:S(()=>[i[0]||(i[0]=s("hr",{class:"border-slate-300 mt-2"},null,-1)),s("div",P,[s("div",null,[e.linkSent?(l(),u("p",z,[s("span",A,[c(o(e.isWhm?t.$t("CodeSent"):t.$t("LinkSent"))+" ",1),f(a,{name:"material-symbols:check-circle",class:"w-5 h-5 text-green-600"})])])):(l(),u("p",U,[c(o(t.$t("CheckSpam")+" "+t.$t("or"))+" ",1),s("a",{class:"text-primary cursor-pointer",onClick:B(e.resendLink,["stop"])},o(e.isWhm?t.$t("ResendCode"):t.$t("ResendLink")),1)])),!e.linkSent&&e.resendError?(l(),D(p,{key:2,class:"mt-4"},{default:S(()=>[c(o(e.resendError),1)]),_:1})):T("",!0)]),s("div",null,[c(o(t.$t("RestartEmail"))+" ",1),s("span",{class:"text-primary hover:cursor-pointer",onClick:e.handleRestartSignup},o(t.$t("SignUp")),1)])])]),_:1},8,["open"])])}const K=Object.assign(V(j,[["render",I],["__file","ResendLink.vue"]]),{__name:"ResendLink"});export{K as default};
