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