import{r as m,$ as r,ae as d}from"./index-DGnN4tUo.js";const c=/^[\u4E00-\u9FA5a-zA-Z0-9_-]{6,16}$/,E=/^[\u4E00-\u9FA5a-zA-Z0-9_-]{2,16}$/,f=/^[1](([3][0-9])|([4][01456789])|([5][012356789])|([6][2567])|([7][0-8])|([8][0-9])|([9][012356789]))[0-9]{8}$/,l=/^(?=.*[a-z])(?=.*[A-Z])[a-zA-Z0-9_]{6,18}$/,g=/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/,p=/^\d{6}$/;function _(){const a={userName:{pattern:c,message:r("form.userName.invalid"),trigger:"change"},phone:{pattern:f,message:r("form.phone.invalid"),trigger:"change"},pwd:{pattern:l,message:r("form.pwd.invalid"),trigger:"change"},code:{pattern:p,message:r("form.code.invalid"),trigger:"change"},email:{pattern:g,message:r("form.email.invalid"),trigger:"change"}},n={userName:[e(r("form.userName.required")),a.userName],phone:[e(r("form.phone.required")),a.phone],pwd:[e(r("form.pwd.required")),a.pwd],code:[e(r("form.code.required")),a.code],email:[e(r("form.email.required")),a.email]},o=e(r("form.required"));function e(t){return{required:!0,message:t}}function s(t){return[{required:!0,message:r("form.confirmPwd.required")},{asyncValidator:(u,i)=>i.trim()!==""&&i!==d(t)?Promise.reject(u.message):Promise.resolve(),message:r("form.confirmPwd.invalid"),trigger:"input"}]}return{patternRules:a,formRules:n,defaultRequiredRule:o,createRequiredRule:e,createConfirmPwdRule:s}}function q(){const a=m(null);async function n(){var e;await((e=a.value)==null?void 0:e.validate())}async function o(){var e;(e=a.value)==null||e.restoreValidation()}return{formRef:a,validate:n,restoreValidation:o}}export{g as R,_ as a,E as b,f as c,l as d,c as e,p as f,q as u};
