import{_ as e,m as a,r as l,h as s,f as t,o,c as i,d as n,a as c,b as u,p as r,q as d,t as v,e as m,n as p,W as g,cA as h,eR as f,c5 as w,cB as y,E as C,eQ as _,cI as b,j as x,ag as k}from"./index-BhrLSE9x.js";import{_ as V}from"./loading-sbVgfH70.js";/* empty css              */const $={class:"open-account-page"},A={class:"level-block"},S={class:"form"},j={class:"select-code"},I=["src"],N={class:"select-code"},P=["src"],U={key:0,class:"star-input"},E=["src"],M=["src"],O=e({__name:"OpenAccount",setup(e){const{theme:O}=a(),T=l(""),W=l(""),q=l(!1),z=l("password"),B=l(!0),D=()=>{W.value=""},G=()=>{J()},Q=()=>{z.value="text"===z.value?"password":"text",B.value="password"===z.value},R=s((()=>{let e=!0;return e=!T.value||!W.value||H.value,e})),Y=async()=>{F()&&await Z()&&K()},F=()=>!(!T.value||!W.value),H=l(!1),J=()=>H.value=W.value.length<6||W.value.length>15,K=async()=>{if(!T.value||!W.value)return;if(J())return;q.value=!0;const e=await h();f({userName:T.value,emailAddress:"",password:w(String(T.value)+String(W.value)),confirmPassword:w(String(T.value)+String(W.value)),passwordOriginal:w(String(W.value)),authenticate:"",auxiliaryCode:"PC",currencyAbbr:"CNY",deviceCode:e.finalUID||y(),languageCode:"zh_CN",mobile:"",mobileAreaCode:"",smsVerifyCode:"",emailVerifyCode:"",sourceType:"4",token:"",userCode:L.value.userCode,registerType:3,registerWebsite:window.location.hostname}).then((()=>{ee.value=!0,C({message:"开户成功",type:"success"})})).finally((()=>{q.value=!1}))},L=l({}),X=l(!1),Z=()=>new Promise((e=>{const a={userName:T.value};b(a).then((()=>{X.value=!0,e(!0)})).catch((()=>{X.value=!1,e(!1)}))})),ee=l(!1);return t((()=>{_().then((e=>{L.value=e.data}))})),(e,a)=>{const l=x,s=k;return o(),i("div",$,[n("div",A,[n("div",S,[c(l,{class:"common-input",modelValue:T.value,"onUpdate:modelValue":a[0]||(a[0]=e=>T.value=e),modelModifiers:{trim:!0},placeholder:e.$t("请输入会员账号"),autocomplete:"off",clearable:"",maxlength:"15"},{prefix:u((()=>[n("div",j,[n("img",{class:"icon-open",width:"20",height:"20",src:r(d)(`affiliate/user_${r(O)}.png`),alt:""},null,8,I)])])),_:1},8,["modelValue","placeholder"]),c(l,{class:p(["common-input !mb-16",{pwdcss:B.value}]),modelValue:W.value,"onUpdate:modelValue":a[1]||(a[1]=e=>W.value=e),modelModifiers:{trim:!0},type:z.value,autocomplete:"off",clearable:"",placeholder:e.$t("请输入登录密码"),maxlength:15,onClear:D,onInput:G},{prefix:u((()=>[n("div",N,[n("img",{class:"icon-open",width:"20",height:"20",src:r(d)(`affiliate/lock-${r(O)}.png`),alt:""},null,8,P),B.value?(o(),i("div",U,v("".padEnd(W.value.length,"*")),1)):m("",!0)])])),suffix:u((()=>["text"===z.value?(o(),i("img",{key:0,class:"icon-open",width:"16",height:"16",src:r(d)(`login/eye_open-${r(O)}.png`),alt:"",onClick:Q},null,8,E)):(o(),i("img",{key:1,class:"icon-open",width:"16",height:"16",src:r(d)(`affiliate/eye_close-${r(O)}.png`),alt:"",onClick:Q},null,8,M))])),_:1},8,["class","modelValue","type","placeholder"]),c(s,{class:p(["btn",{active:!R.value}]),onClick:Y,loading:q.value},{loading:u((()=>a[2]||(a[2]=[n("img",{class:"icon",width:"12",height:"12",src:V,alt:""},null,-1)]))),default:u((()=>[g(v(q.value?e.$t("处理中"):e.$t("提交开户"))+" ",1)])),_:1},8,["class","loading"])])])])}}},[["__scopeId","data-v-82d92b47"]]);export{O as default};
