var b=Object.defineProperty;var P=Object.getOwnPropertySymbols;var S=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable;var O=(e,o,t)=>o in e?b(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,F=(e,o)=>{for(var t in o||(o={}))S.call(o,t)&&O(e,t,o[t]);if(P)for(var t of P(o))I.call(o,t)&&O(e,t,o[t]);return e};var R=(e,o,t)=>new Promise((s,i)=>{var g=n=>{try{u(t.next(n))}catch(r){i(r)}},_=n=>{try{u(t.throw(n))}catch(r){i(r)}},u=n=>n.done?s(n.value):Promise.resolve(n.value).then(g,_);u((t=t.apply(e,o)).next())});import{r as v,f as c,c as h,k as l,a as w,o as x,h as E,t as j}from"./index.0d073eaa.js";var a=(e=>(e[e.LOGIN=0]="LOGIN",e[e.REGISTER=1]="REGISTER",e[e.RESET_PASSWORD=2]="RESET_PASSWORD",e[e.MOBILE=3]="MOBILE",e[e.QR_CODE=4]="QR_CODE",e))(a||{});const p=v(0);function B(){function e(s){p.value=s}const o=c(()=>p.value);function t(){e(0)}return{setLoginState:e,getLoginState:o,handleBackLogin:t}}function k(e){function o(){return R(this,null,function*(){const t=l(e);return t?yield t.validate():void 0})}return{validForm:o}}function A(e){const{t:o}=h(),t=c(()=>f(o("sys.login.accountPlaceholder"))),s=c(()=>f(o("sys.login.passwordPlaceholder"))),i=c(()=>f(o("sys.login.smsPlaceholder"))),g=c(()=>f(o("sys.login.mobilePlaceholder"))),_=(r,d)=>R(this,null,function*(){return d?Promise.resolve():Promise.reject(o("sys.login.policyPlaceholder"))}),u=r=>(d,m)=>R(this,null,function*(){return m?m!==r?Promise.reject(o("sys.login.diffPwd")):Promise.resolve():Promise.reject(o("sys.login.passwordPlaceholder"))});return{getFormRules:c(()=>{const r=l(t),d=l(s),m=l(i),T=l(g),y={sms:m,mobile:T};switch(l(p)){case 1:return F({account:r,password:d,confirmPassword:[{validator:u(e==null?void 0:e.password),trigger:"change"}],policy:[{validator:_,trigger:"change"}]},y);case 2:return F({account:r},y);case 3:return y;default:return{account:r,password:d}}})}}function f(e){return[{required:!0,message:e,trigger:"change"}]}const G={class:"mb-3 text-2xl font-bold text-center xl:text-3xl enter-x xl:text-left"},C=w({__name:"LoginFormTitle",setup(e){const{t:o}=h(),{getLoginState:t}=B(),s=c(()=>({[a.RESET_PASSWORD]:o("sys.login.forgetFormTitle"),[a.LOGIN]:o("sys.login.signInFormTitle"),[a.REGISTER]:o("sys.login.signUpFormTitle"),[a.MOBILE]:o("sys.login.mobileSignInFormTitle"),[a.QR_CODE]:o("sys.login.qrSignInFormTitle")})[l(t)]);return(i,g)=>(x(),E("h2",G,j(l(s)),1))}});var D=Object.freeze(Object.defineProperty({__proto__:null,default:C},Symbol.toStringTag,{value:"Module"}));export{a as L,C as _,A as a,k as b,D as c,B as u};
