Files
weiguang-jewelry-ledger/新账系统/web/dist/assets/LoginPage-BXIKn2V6.js
T

8 lines
29 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{n as e}from"./rolldown-runtime-Dl_DZoUm.js";import{$ as t,$n as n,An as r,At as i,Bn as a,Ct as o,Dt as s,G as c,Gt as l,H as u,Ht as d,In as f,It as p,J as m,K as h,Lt as g,Pt as _,Q as v,Qn as y,Rn as b,Rt as x,Sn as S,U as C,Vt as w,W as T,Wt as E,X as D,Xn as O,Xt as k,Y as A,_ as j,_n as ee,_t as M,an as N,bt as P,cn as F,ct as I,dt as L,et as te,f as R,g as z,gn as ne,h as B,jt as re,kn as V,kt as ie,m as H,mn as U,n as ae,on as oe,pn as W,q as G,rn as se,sn as ce,tn as le,tr as ue,tt as de,un as fe,v as pe,vn as me,wn as K,xt as he,yn as ge}from"./index-D422TGjj.js";import{t as _e}from"./card-C-8yMAVJ.js";import{a as ve,c as ye,g as be,i as xe,n as Se,r as Ce}from"./useForm-gd33qHRf.js";import{i as we,n as Te,r as Ee,t as De}from"./LockOutlined-B5mVtuYn.js";import{f as Oe}from"./TextArea-C-bIgxlu.js";import{t as q}from"./input-CKrxaItg.js";import{t as ke}from"./typography-B7akXptf.js";var J=e(ue());function Ae(e){return e==null?null:typeof e==`object`&&!(0,J.isValidElement)(e)?e:{title:e}}function Y(e){let[t,n]=J.useState(e);return J.useEffect(()=>{let t=setTimeout(()=>{n(e)},e.length?0:10);return()=>{clearTimeout(t)}},[e]),t}var je=e=>{let{componentCls:t}=e,n=`${t}-show-help`,r=`${t}-show-help-item`;return{[n]:{transition:`opacity ${e.motionDurationFast} ${e.motionEaseInOut}`,"&-appear, &-enter":{opacity:0,"&-active":{opacity:1}},"&-leave":{opacity:1,"&-active":{opacity:0}},[r]:{overflow:`hidden`,transition:`height ${e.motionDurationFast} ${e.motionEaseInOut},
opacity ${e.motionDurationFast} ${e.motionEaseInOut},
transform ${e.motionDurationFast} ${e.motionEaseInOut} !important`,[`&${r}-appear, &${r}-enter`]:{transform:`translateY(-5px)`,opacity:0,"&-active":{transform:`translateY(0)`,opacity:1}},[`&${r}-leave-active`]:{transform:`translateY(-5px)`}}}}},Me=e=>({legend:{display:`block`,width:`100%`,marginBottom:e.marginLG,padding:0,color:e.colorTextDescription,fontSize:e.fontSizeLG,lineHeight:`inherit`,border:0,borderBottom:`${K(e.lineWidth)} ${e.lineType} ${e.colorBorder}`},'input[type="search"]':{boxSizing:`border-box`},'input[type="radio"], input[type="checkbox"]':{lineHeight:`normal`},'input[type="file"]':{display:`block`},'input[type="range"]':{display:`block`,width:`100%`},"select[multiple], select[size]":{height:`auto`},"input[type='file']:focus,\n input[type='radio']:focus,\n input[type='checkbox']:focus":{outline:0,boxShadow:`0 0 0 ${K(e.controlOutlineWidth)} ${e.controlOutline}`},output:{display:`block`,paddingTop:15,color:e.colorText,fontSize:e.fontSize,lineHeight:e.lineHeight}}),Ne=(e,t)=>{let{formItemCls:n}=e;return{[n]:{[`${n}-label > label`]:{height:t},[`${n}-control-input`]:{minHeight:t}}}},Pe=e=>{let{componentCls:t}=e;return{[e.componentCls]:Object.assign(Object.assign(Object.assign({},k(e)),Me(e)),{[`${t}-text`]:{display:`inline-block`,paddingInlineEnd:e.paddingSM},"&-small":Object.assign({},Ne(e,e.controlHeightSM)),"&-large":Object.assign({},Ne(e,e.controlHeightLG))})}},Fe=e=>{let{formItemCls:t,iconCls:n,rootPrefixCls:r,antCls:i,labelRequiredMarkColor:a,labelColor:o,labelFontSize:s,labelHeight:c,labelColonMarginInlineStart:l,labelColonMarginInlineEnd:u,itemMarginBottom:d}=e;return{[t]:Object.assign(Object.assign({},k(e)),{marginBottom:d,verticalAlign:`top`,"&-with-help":{transition:`none`},[`&-hidden,
&-hidden${i}-row`]:{display:`none`},"&-has-warning":{[`${t}-split`]:{color:e.colorError}},"&-has-error":{[`${t}-split`]:{color:e.colorWarning}},[`${t}-label`]:{flexGrow:0,overflow:`hidden`,whiteSpace:`nowrap`,textAlign:`end`,verticalAlign:`middle`,"&-left":{textAlign:`start`},"&-wrap":{overflow:`unset`,lineHeight:e.lineHeight,whiteSpace:`unset`,"> label":{verticalAlign:`middle`,textWrap:`balance`}},"> label":{position:`relative`,display:`inline-flex`,alignItems:`center`,maxWidth:`100%`,height:c,color:o,fontSize:s,[`> ${n}`]:{fontSize:e.fontSize,verticalAlign:`top`},[`&${t}-required`]:{"&::before":{display:`inline-block`,marginInlineEnd:e.marginXXS,color:a,fontSize:e.fontSize,fontFamily:`SimSun, sans-serif`,lineHeight:1,content:`"*"`},[`&${t}-required-mark-hidden, &${t}-required-mark-optional`]:{"&::before":{display:`none`}}},[`${t}-optional`]:{display:`inline-block`,marginInlineStart:e.marginXXS,color:e.colorTextDescription,[`&${t}-required-mark-hidden`]:{display:`none`}},[`${t}-tooltip`]:{color:e.colorTextDescription,cursor:`help`,writingMode:`horizontal-tb`,marginInlineStart:e.marginXXS},"&::after":{content:`":"`,position:`relative`,marginBlock:0,marginInlineStart:l,marginInlineEnd:u},[`&${t}-no-colon::after`]:{content:`"\\a0"`}}},[`${t}-control`]:{"--ant-display":`flex`,flexDirection:`column`,flexGrow:1,[`&:first-child:not([class^="'${r}-col-'"]):not([class*="' ${r}-col-'"])`]:{width:`100%`},"&-input":{position:`relative`,display:`flex`,alignItems:`center`,minHeight:e.controlHeight,"&-content":{flex:`auto`,maxWidth:`100%`,[`&:has(> ${i}-switch:only-child, > ${i}-rate:only-child)`]:{display:`flex`,alignItems:`center`}}}},[t]:{"&-additional":{display:`flex`,flexDirection:`column`},"&-explain, &-extra":{clear:`both`,color:e.colorTextDescription,fontSize:e.fontSize,lineHeight:e.lineHeight},"&-explain-connected":{width:`100%`},"&-extra":{minHeight:e.controlHeightSM,transition:`color ${e.motionDurationMid} ${e.motionEaseOut}`},"&-explain":{"&-error":{color:e.colorError},"&-warning":{color:e.colorWarning}}},[`&-with-help ${t}-explain`]:{height:`auto`,opacity:1},[`${t}-feedback-icon`]:{fontSize:e.fontSize,textAlign:`center`,visibility:`visible`,animationName:L,animationDuration:e.motionDurationMid,animationTimingFunction:e.motionEaseOutBack,pointerEvents:`none`,"&-success":{color:e.colorSuccess},"&-error":{color:e.colorError},"&-warning":{color:e.colorWarning},"&-validating":{color:e.colorPrimary}}})}},X=e=>({padding:e.verticalLabelPadding,margin:e.verticalLabelMargin,whiteSpace:`initial`,textAlign:`start`,"> label":{margin:0,"&::after":{visibility:`hidden`}}}),Ie=e=>{let{antCls:t,formItemCls:n}=e;return{[`${n}-horizontal`]:{[`${n}-label`]:{flexGrow:0},[`${n}-control`]:{flex:`1 1 0`,minWidth:0},[`${n}-label[class$='-24'], ${n}-label[class*='-24 ']`]:{[`& + ${n}-control`]:{minWidth:`unset`}},[`${t}-col-24${n}-label,
${t}-col-xl-24${n}-label`]:X(e)}}},Le=e=>{let{componentCls:t,formItemCls:n,inlineItemMarginBottom:r}=e;return{[`${t}-inline`]:{display:`flex`,flexWrap:`wrap`,[`${n}-inline`]:{flex:`none`,marginInlineEnd:e.margin,marginBottom:r,"&-row":{flexWrap:`nowrap`},[`> ${n}-label,
> ${n}-control`]:{display:`inline-block`,verticalAlign:`top`},[`> ${n}-label`]:{flex:`none`},[`${t}-text`]:{display:`inline-block`},[`${n}-has-feedback`]:{display:`inline-block`}}}}},Re=e=>{let{componentCls:t,formItemCls:n,rootPrefixCls:r}=e;return{[`${n} ${n}-label`]:X(e),[`${t}:not(${t}-inline)`]:{[n]:{flexWrap:`wrap`,[`${n}-label, ${n}-control`]:{[`&:not([class*=" ${r}-col-xs"])`]:{flex:`0 0 100%`,maxWidth:`100%`}}}}}},ze=e=>{let{componentCls:t,formItemCls:n,antCls:r}=e;return{[`${n}-vertical`]:{[`${n}-row`]:{flexDirection:`column`},[`${n}-label > label`]:{height:`auto`},[`${n}-control`]:{width:`100%`},[`${n}-label,
${r}-col-24${n}-label,
${r}-col-xl-24${n}-label`]:X(e)},[`@media (max-width: ${K(e.screenXSMax)})`]:[Re(e),{[t]:{[`${n}:not(${n}-horizontal)`]:{[`${r}-col-xs-24${n}-label`]:X(e)}}}],[`@media (max-width: ${K(e.screenSMMax)})`]:{[t]:{[`${n}:not(${n}-horizontal)`]:{[`${r}-col-sm-24${n}-label`]:X(e)}}},[`@media (max-width: ${K(e.screenMDMax)})`]:{[t]:{[`${n}:not(${n}-horizontal)`]:{[`${r}-col-md-24${n}-label`]:X(e)}}},[`@media (max-width: ${K(e.screenLGMax)})`]:{[t]:{[`${n}:not(${n}-horizontal)`]:{[`${r}-col-lg-24${n}-label`]:X(e)}}}}},Be=e=>({labelRequiredMarkColor:e.colorError,labelColor:e.colorTextHeading,labelFontSize:e.fontSize,labelHeight:e.controlHeight,labelColonMarginInlineStart:e.marginXXS/2,labelColonMarginInlineEnd:e.marginXS,itemMarginBottom:e.marginLG,verticalLabelPadding:`0 0 ${e.paddingXS}px`,verticalLabelMargin:0,inlineItemMarginBottom:0}),Ve=(e,t)=>le(e,{formItemCls:`${e.componentCls}-item`,rootPrefixCls:t}),He=E(`Form`,(e,{rootPrefixCls:t})=>{let n=Ve(e,t);return[Pe(n),Fe(n),je(n),Ie(n),Le(n),ze(n),be(n),L]},Be,{order:-1e3}),Z=e(n()),Ue=[];function We(e,t,n,r=0){return{key:typeof e==`string`?e:`${t}-${r}`,error:e,errorStatus:n}}var Ge=({help:e,helpStatus:t,errors:n=Ue,warnings:i=Ue,className:a,fieldId:s,onVisibleChanged:c})=>{let{prefixCls:l}=J.useContext(T),u=`${l}-item-explain`,f=ie(l),[p,m,h]=He(l,f),g=J.useMemo(()=>o(l),[l]),_=Y(n),v=Y(i),y=J.useMemo(()=>e==null?[].concat(r(_.map((e,t)=>We(e,`error`,`error`,t))),r(v.map((e,t)=>We(e,`warning`,`warning`,t)))):[We(e,`help`,t)],[e,t,_,v]),b=J.useMemo(()=>{let e={};return y.forEach(({key:t})=>{e[t]=(e[t]||0)+1}),y.map((t,n)=>Object.assign(Object.assign({},t),{key:e[t.key]>1?`${t.key}-fallback-${n}`:t.key}))},[y]),x={};return s&&(x.id=`${s}_help`),p(J.createElement(w,{motionDeadline:g.motionDeadline,motionName:`${l}-show-help`,visible:!!b.length,onVisibleChanged:c},e=>{let{className:t,style:n}=e;return J.createElement(`div`,Object.assign({},x,{className:(0,Z.default)(u,t,h,f,a,m),style:n}),J.createElement(d,Object.assign({keys:b},o(l),{motionName:`${l}-show-help-item`,component:!1}),e=>{let{key:t,error:n,errorStatus:r,className:i,style:a}=e;return J.createElement(`div`,{key:t,className:(0,Z.default)(i,{[`${u}-${r}`]:r}),style:a},n)}))}))},Ke=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},qe=J.forwardRef((e,t)=>{let n=J.useContext(oe),{getPrefixCls:r,direction:i,requiredMark:a,colon:o,scrollToFirstError:s,className:l,style:d}=fe(`form`),{prefixCls:f,className:p,rootClassName:g,size:_,disabled:v=n,form:y,colon:b,labelAlign:x,labelWrap:S,labelCol:C,wrapperCol:w,hideRequiredMark:T,layout:E=`horizontal`,scrollToFirstError:D,requiredMark:O,onFinishFailed:k,name:j,style:ee,feedbackIcons:P,variant:F}=e,I=Ke(e,[`prefixCls`,`className`,`rootClassName`,`size`,`disabled`,`form`,`colon`,`labelAlign`,`labelWrap`,`labelCol`,`wrapperCol`,`hideRequiredMark`,`layout`,`scrollToFirstError`,`requiredMark`,`onFinishFailed`,`name`,`style`,`feedbackIcons`,`variant`]),L=M(_),te=J.useContext(ne),R=J.useMemo(()=>O===void 0?T?!1:a===void 0||a:O,[T,O,a]),z=b??o,B=r(`form`,f),re=ie(B),[V,H,U]=He(B,re),ae=(0,Z.default)(B,`${B}-${E}`,{[`${B}-hide-required-mark`]:R===!1,[`${B}-rtl`]:i===`rtl`,[`${B}-${L}`]:L},U,re,H,l,p,g),[W]=Se(y),{__INTERNAL__:G}=W;G.name=j;let se=J.useMemo(()=>({name:j,labelAlign:x,labelCol:C,labelWrap:S,wrapperCol:w,layout:E,colon:z,requiredMark:R,itemRef:G.itemRef,form:W,feedbackIcons:P}),[j,x,C,w,E,z,R,W,P]),le=J.useRef(null);J.useImperativeHandle(t,()=>Object.assign(Object.assign({},W),{nativeElement:le.current?.nativeElement}));let ue=(e,t)=>{if(e){let n={block:`nearest`};typeof e==`object`&&(n=Object.assign(Object.assign({},n),e)),W.scrollToField(t,n)}};return V(J.createElement(m.Provider,{value:F},J.createElement(ce,{disabled:v},J.createElement(N.Provider,{value:L},J.createElement(c,{validateMessages:te},J.createElement(u.Provider,{value:se},J.createElement(h,{status:!0},J.createElement(A,Object.assign({id:j},I,{name:j,onFinishFailed:e=>{if(k?.(e),e.errorFields.length){let t=e.errorFields[0].name;if(D!==void 0){ue(D,t);return}s!==void 0&&ue(s,t)}},form:W,ref:le,style:Object.assign(Object.assign({},d),ee),className:ae})))))))))});function Je(e){if(typeof e==`function`)return e;let t=O(e);return t.length<=1?t[0]:t}var Ye=()=>{let{status:e,errors:t=[],warnings:n=[]}=J.useContext(C);return{status:e,errors:t,warnings:n}};Ye.Context=C;function Xe(e){let[t,n]=J.useState(e),r=J.useRef(null),i=J.useRef([]),a=J.useRef(!1);J.useEffect(()=>(a.current=!1,()=>{a.current=!0,V.cancel(r.current),r.current=null}),[]);function o(e){a.current||(r.current===null&&(i.current=[],r.current=V(()=>{r.current=null,n(e=>{let t=e;return i.current.forEach(e=>{t=e(t)}),t})})),i.current.push(e))}return[t,o]}function Ze(){let{itemRef:e}=J.useContext(u),t=J.useRef({});function n(n,r){let i=r&&typeof r==`object`&&b(r),a=n.join(`_`);return(t.current.name!==a||t.current.originRef!==i)&&(t.current.name=a,t.current.originRef=i,t.current.ref=f(e(n),i)),t.current.ref}return n}var Qe=e=>{let{formItemCls:t}=e;return{"@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none)":{[`${t}-control`]:{display:`flex`}}}},$e=l([`Form`,`item-item`],(e,{rootPrefixCls:t})=>Qe(Ve(e,t))),et=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},tt=24,nt=e=>{let{prefixCls:t,status:n,labelCol:r,wrapperCol:i,children:a,errors:o,warnings:s,_internalItemRender:c,extra:l,help:d,fieldId:f,marginBottom:p,onErrorVisibleChanged:m,label:h}=e,g=`${t}-item`,_=J.useContext(u),v=J.useMemo(()=>{let e=Object.assign({},i||_.wrapperCol||{});return h===null&&!r&&!i&&_.labelCol&&[void 0,`xs`,`sm`,`md`,`lg`,`xl`,`xxl`].forEach(t=>{let n=t?[t]:[],r=ge(_.labelCol,n),i=typeof r==`object`?r:{},a=ge(e,n),o=typeof a==`object`?a:{};`span`in i&&!(`offset`in o)&&i.span<tt&&(e=me(e,[].concat(n,[`offset`]),i.span))}),e},[i,_.wrapperCol,_.labelCol,h,r]),y=(0,Z.default)(`${g}-control`,v.className),b=J.useMemo(()=>{let{labelCol:e,wrapperCol:t}=_;return et(_,[`labelCol`,`wrapperCol`])},[_]),x=J.useRef(null),[C,w]=J.useState(0);S(()=>{l&&x.current?w(x.current.clientHeight):w(0)},[l]);let E=J.createElement(`div`,{className:`${g}-control-input`},J.createElement(`div`,{className:`${g}-control-input-content`},a)),D=J.useMemo(()=>({prefixCls:t,status:n}),[t,n]),O=p!==null||o.length||s.length?J.createElement(T.Provider,{value:D},J.createElement(Ge,{fieldId:f,errors:o,warnings:s,help:d,helpStatus:n,className:`${g}-explain-connected`,onVisibleChanged:m})):null,k={};f&&(k.id=`${f}_extra`);let A=l?J.createElement(`div`,Object.assign({},k,{className:`${g}-extra`,ref:x}),l):null,j=O||A?J.createElement(`div`,{className:`${g}-additional`,style:p?{minHeight:p+C}:{}},O,A):null,ee=c&&c.mark===`pro_table_render`&&c.render?c.render(e,{input:E,errorList:O,extra:A}):J.createElement(J.Fragment,null,E,j);return J.createElement(u.Provider,{value:b},J.createElement(we,Object.assign({},v,{className:y}),ee),J.createElement($e,{prefixCls:t}))},rt=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},it=({prefixCls:e,label:t,htmlFor:n,labelCol:r,labelAlign:i,colon:a,required:o,requiredMark:s,tooltip:c,vertical:l})=>{let[d]=W(`Form`),{labelAlign:f,labelCol:p,labelWrap:m,colon:h}=J.useContext(u);if(!t)return null;let g=r||p||{},_=i||f,v=`${e}-item-label`,y=(0,Z.default)(v,_===`left`&&`${v}-left`,g.className,{[`${v}-wrap`]:!!m}),b=t,x=a===!0||h!==!1&&a!==!1;x&&!l&&typeof t==`string`&&t.trim()&&(b=t.replace(/[:|:]\s*$/,``));let S=Ae(c);if(S){let{icon:t=J.createElement(Te,null)}=S,n=rt(S,[`icon`]),r=J.createElement(Oe,Object.assign({},n),J.cloneElement(t,{className:`${e}-item-tooltip`,title:``,onClick:e=>{e.preventDefault()},tabIndex:null}));b=J.createElement(J.Fragment,null,b,r)}let C=s===`optional`,w=typeof s==`function`,T=s===!1;w?b=s(b,{required:!!o}):C&&!o&&(b=J.createElement(J.Fragment,null,b,J.createElement(`span`,{className:`${e}-item-optional`,title:``},d?.optional||U.Form?.optional)));let E;T?E=`hidden`:(C||w)&&(E=`optional`);let D=(0,Z.default)({[`${e}-item-required`]:o,[`${e}-item-required-mark-${E}`]:E,[`${e}-item-no-colon`]:!x});return J.createElement(we,Object.assign({},g,{className:y}),J.createElement(`label`,{htmlFor:n,className:D,title:typeof t==`string`?t:``},b))},at={success:g,warning:_,error:p,validating:s};function ot({children:e,errors:t,warnings:n,hasFeedback:r,validateStatus:i,prefixCls:a,meta:o,noStyle:s,name:c}){let l=`${a}-item`,{feedbackIcons:d}=J.useContext(u),f=xe(t,n,o,null,!!r,i),{isFormItemInput:p,status:m,hasFeedback:h,feedbackIcon:g,name:_}=J.useContext(C),v=J.useMemo(()=>{let e;if(r){let i=r!==!0&&r.icons||d,a=f&&i?.({status:f,errors:t,warnings:n})?.[f],o=f?at[f]:null;e=a!==!1&&o?J.createElement(`span`,{className:(0,Z.default)(`${l}-feedback-icon`,`${l}-feedback-icon-${f}`)},a||J.createElement(o,null)):null}let i={status:f||``,errors:t,warnings:n,hasFeedback:!!r,feedbackIcon:e,isFormItemInput:!0,name:c};return s&&(i.status=(f??m)||``,i.isFormItemInput=p,i.hasFeedback=!!(r??h),i.feedbackIcon=r===void 0?g:i.feedbackIcon,i.name=c??_),i},[f,r,s,p,m]);return J.createElement(C.Provider,{value:v},e)}var st=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};function ct(e){let{prefixCls:t,className:n,rootClassName:r,style:i,help:a,errors:o,warnings:s,validateStatus:c,meta:l,hasFeedback:d,hidden:f,children:p,fieldId:m,required:h,isRequired:g,onSubItemMetaChange:_,layout:v,name:y}=e,b=st(e,[`prefixCls`,`className`,`rootClassName`,`style`,`help`,`errors`,`warnings`,`validateStatus`,`meta`,`hasFeedback`,`hidden`,`children`,`fieldId`,`required`,`isRequired`,`onSubItemMetaChange`,`layout`,`name`]),x=`${t}-item`,{requiredMark:C,layout:w}=J.useContext(u),T=v||w,E=T===`vertical`,D=J.useRef(null),O=Y(o),k=Y(s),A=a!=null,j=!!(A||o.length||s.length),ee=!!D.current&&P(D.current),[M,N]=J.useState(null);S(()=>{if(j&&D.current){let e=getComputedStyle(D.current);N(Number.parseInt(e.marginBottom,10))}},[j,ee]);let F=e=>{e||N(null)},I=((e=!1)=>{let t=e?O:l.errors,n=e?k:l.warnings;return xe(t,n,l,``,!!d,c)})(),L=(0,Z.default)(x,n,r,{[`${x}-with-help`]:A||O.length||k.length,[`${x}-has-feedback`]:I&&d,[`${x}-has-success`]:I===`success`,[`${x}-has-warning`]:I===`warning`,[`${x}-has-error`]:I===`error`,[`${x}-is-validating`]:I===`validating`,[`${x}-hidden`]:f,[`${x}-${T}`]:T});return J.createElement(`div`,{className:L,style:i,ref:D},J.createElement(Ee,Object.assign({className:`${x}-row`},he(b,`_internalItemRender.colon.dependencies.extra.fieldKey.getValueFromEvent.getValueProps.htmlFor.id.initialValue.isListField.label.labelAlign.labelCol.labelWrap.messageVariables.name.normalize.noStyle.preserve.requiredMark.rules.shouldUpdate.trigger.tooltip.validateFirst.validateTrigger.valuePropName.wrapperCol.validateDebounce`.split(`.`))),J.createElement(it,Object.assign({htmlFor:m},e,{requiredMark:C,required:h??g,prefixCls:t,vertical:E})),J.createElement(nt,Object.assign({},e,l,{errors:O,warnings:k,prefixCls:t,status:I,help:a,marginBottom:M,onErrorVisibleChanged:F}),J.createElement(G.Provider,{value:_},J.createElement(ot,{prefixCls:t,meta:l,errors:l.errors,warnings:l.warnings,hasFeedback:d,validateStatus:I,name:y},p)))),!!M&&J.createElement(`div`,{className:`${x}-margin-offset`,style:{marginBottom:-M}}))}var lt=`__SPLIT__`;function ut(e,t){let n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(n=>{let r=e[n],i=t[n];return r===i||typeof r==`function`||typeof i==`function`})}var dt=J.memo(({children:e})=>e,(e,t)=>ut(e.control,t.control)&&e.update===t.update&&e.childProps.length===t.childProps.length&&e.childProps.every((e,n)=>e===t.childProps[n]));function ft(){return{errors:[],warnings:[],touched:!1,validating:!1,name:[],validated:!1}}function pt(e){let{name:n,noStyle:i,className:o,dependencies:s,prefixCls:c,shouldUpdate:l,rules:d,children:f,required:p,label:m,messageVariables:h,trigger:g=`onChange`,validateTrigger:_,hidden:v,help:y,layout:b}=e,{getPrefixCls:x}=J.useContext(F),{name:S}=J.useContext(u),C=Je(f),w=typeof C==`function`,T=J.useContext(G),{validateTrigger:E}=J.useContext(de),D=_===void 0?E:_,O=n!=null,k=x(`form`,c),A=ie(k),[j,M,N]=He(k,A);ee(`Form.Item`);let P=J.useContext(te),I=J.useRef(null),[L,R]=Xe({}),[z,ne]=se(()=>ft()),B=e=>{let t=P?.getKey(e.name);if(ne(e.destroy?ft():e,!0),i&&y!==!1&&T){let n=e.name;if(e.destroy)n=I.current||n;else if(t!==void 0){let[e,i]=t;n=[e].concat(r(i)),I.current=n}T(e,n)}},V=(e,t)=>{R(n=>{let i=Object.assign({},n),a=[].concat(r(e.name.slice(0,-1)),r(t)).join(lt);return e.destroy?delete i[a]:i[a]=e,i})},[H,U]=J.useMemo(()=>{let e=r(z.errors),t=r(z.warnings);return Object.values(L).forEach(n=>{e.push.apply(e,r(n.errors||[])),t.push.apply(t,r(n.warnings||[]))}),[e,t]},[L,z.errors,z.warnings]),ae=Ze();function oe(t,r,a){return i&&!v?J.createElement(ot,{prefixCls:k,hasFeedback:e.hasFeedback,validateStatus:e.validateStatus,meta:z,errors:H,warnings:U,noStyle:!0,name:n},t):J.createElement(ct,Object.assign({key:`row`},e,{className:(0,Z.default)(o,N,A,M),prefixCls:k,fieldId:r,isRequired:a,errors:H,warnings:U,meta:z,onSubItemMetaChange:V,layout:b,name:n}),t)}if(!O&&!w&&!s)return j(oe(C));let W={};return typeof m==`string`?W.label=m:n&&(W.label=String(n)),h&&(W=Object.assign(Object.assign({},W),h)),j(J.createElement(t,Object.assign({},e,{messageVariables:W,trigger:g,validateTrigger:D,onMetaChange:B}),(t,i,o)=>{let c=ve(n).length&&i?i.name:[],u=Ce(c,S),f=p===void 0?!!d?.some(e=>{if(e&&typeof e==`object`&&e.required&&!e.warningOnly)return!0;if(typeof e==`function`){let t=e(o);return t?.required&&!t?.warningOnly}return!1}):p,m=Object.assign({},t),h=null;if(Array.isArray(C)&&O)h=C;else if((!w||(l||s)&&!O)&&(!s||w||O)){if(J.isValidElement(C)){let t=Object.assign(Object.assign({},C.props),m);if(t.id||=u,y||H.length>0||U.length>0||e.extra){let n=[];(y||H.length>0)&&n.push(`${u}_help`),e.extra&&n.push(`${u}_extra`),t[`aria-describedby`]=n.join(` `)}H.length>0&&(t[`aria-invalid`]=`true`),f&&(t[`aria-required`]=`true`),a(C)&&(t.ref=ae(c,C)),new Set([].concat(r(ve(g)),r(ve(D)))).forEach(e=>{t[e]=(...t)=>{var n,r,i,a,o;(i=m[e])==null||(n=i).call.apply(n,[m].concat(t)),(o=(a=C.props)[e])==null||(r=o).call.apply(r,[a].concat(t))}});let n=[t[`aria-required`],t[`aria-invalid`],t[`aria-describedby`]];h=J.createElement(dt,{control:m,update:C,childProps:n},re(C,t))}else h=w&&(l||s)&&!O?C(o):C}return oe(h,u,f)}))}var mt=pt;mt.useStatus=Ye;var ht=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},gt=e=>{var{prefixCls:t,children:n}=e,r=ht(e,[`prefixCls`,`children`]);let{getPrefixCls:i}=J.useContext(F),a=i(`form`,t),o=J.useMemo(()=>({prefixCls:a,status:`error`}),[a]);return J.createElement(v,Object.assign({},r),(e,t,r)=>J.createElement(T.Provider,{value:o},n(e.map(e=>Object.assign(Object.assign({},e),{fieldKey:e.key})),t,{errors:r.errors,warnings:r.warnings})))},Q=qe;Q.Item=mt,Q.List=gt,Q.ErrorList=Ge,Q.useForm=Se,Q.useFormInstance=function(){let{form:e}=J.useContext(u);return e},Q.useWatch=D,Q.Provider=c,Q.create=()=>{};var _t={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M869 487.8L491.2 159.9c-2.9-2.5-6.6-3.9-10.5-3.9h-88.5c-7.4 0-10.8 9.2-5.2 14l350.2 304H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h585.1L386.9 854c-5.6 4.9-2.2 14 5.2 14h91.5c1.9 0 3.8-.7 5.2-2L869 536.2a32.07 32.07 0 000-48.4z`}}]},name:`arrow-right`,theme:`outlined`},vt=J.forwardRef(function(e,t){return J.createElement(x,y({},e,{ref:t,icon:_t}))}),yt={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M858.5 763.6a374 374 0 00-80.6-119.5 375.63 375.63 0 00-119.5-80.6c-.4-.2-.8-.3-1.2-.5C719.5 518 760 444.7 760 362c0-137-111-248-248-248S264 225 264 362c0 82.7 40.5 156 102.8 201.1-.4.2-.8.3-1.2.5-44.8 18.9-85 46-119.5 80.6a375.63 375.63 0 00-80.6 119.5A371.7 371.7 0 00136 901.8a8 8 0 008 8.2h60c4.4 0 7.9-3.5 8-7.8 2-77.2 33-149.5 87.8-204.3 56.7-56.7 132-87.9 212.2-87.9s155.5 31.2 212.2 87.9C779 752.7 810 825 812 902.2c.1 4.4 3.6 7.8 8 7.8h60a8 8 0 008-8.2c-1-47.8-10.9-94.3-29.5-138.2zM512 534c-45.9 0-89.1-17.9-121.6-50.4S340 407.9 340 362c0-45.9 17.9-89.1 50.4-121.6S466.1 190 512 190s89.1 17.9 121.6 50.4S684 316.1 684 362c0 45.9-17.9 89.1-50.4 121.6S557.9 534 512 534z`}}]},name:`user`,theme:`outlined`},bt=J.forwardRef(function(e,t){return J.createElement(x,y({},e,{ref:t,icon:yt}))}),$=pe();function xt({client:e,session:t,onLoggedIn:n}){let[r,a]=(0,J.useState)(``),[o,s]=(0,J.useState)(``),c=j(null,t),l=t.loginOptions||[],u=t.mode===`demo`?`用虚构订单练习完整流程,演示数据与新账隔离。`:`先设置账号。当前是本机试用,正式云端开账另行配置。`;async function d(e,t){a(``),s(e);try{await t(),await n()}catch(e){a(e.message)}finally{s(``)}}return(0,$.jsxs)(`div`,{className:`login-wrap`,children:[(0,$.jsxs)(_e,{className:`login-card`,children:[(0,$.jsxs)(`div`,{className:`login-head`,children:[(0,$.jsx)(ae,{name:c,size:`lg`}),(0,$.jsxs)(ke.Title,{level:1,className:`login-title`,children:[c,` · 新账系统`]}),(0,$.jsx)(ke.Paragraph,{type:`secondary`,className:`login-intro`,children:t.setup||t.mode===`demo`?u:`录入、收款与复核,从同一张订单开始。`}),(0,$.jsx)(`span`,{className:`login-mode`,children:B(t.mode)})]}),r&&(0,$.jsx)(i,{type:`error`,showIcon:!0,message:r,className:`login-error`,role:`alert`}),t.mode===`demo`?(0,$.jsx)(`div`,{className:`role-cards`,role:`group`,"aria-label":`选择演示身份`,children:l.map(t=>(0,$.jsxs)(I,{className:`role-card`+(t.member===`owner`?` role-card-owner`:``),"aria-label":`以`+t.label+`身份进入演示`,loading:o===t.member,disabled:!!o&&o!==t.member,onClick:()=>d(t.member,()=>R(e,t.member)),children:[(0,$.jsx)(`span`,{className:`role-avatar`,"aria-hidden":`true`,children:Array.from(t.label)[0]}),(0,$.jsxs)(`span`,{className:`role-text`,children:[(0,$.jsx)(`strong`,{children:t.label}),(0,$.jsx)(`small`,{children:t.member===`owner`?`店主`:`店员`})]}),(0,$.jsx)(vt,{className:`role-go`,"aria-hidden":`true`})]},t.member))}):t.setup?(0,$.jsx)(Ct,{working:o===`setup`,onSubmit:t=>d(`setup`,()=>z(e,t))}):(0,$.jsx)(St,{options:l,working:o===`login`,onSubmit:(t,n)=>d(`login`,()=>H(e,t,n))}),(0,$.jsxs)(`div`,{className:`login-foot`,children:[(0,$.jsx)(`span`,{className:`small muted`,children:`新版界面(对照试用)`}),(0,$.jsx)(`a`,{href:`/`,className:`old-ui-link`,children:`返回旧版界面`})]})]}),(0,$.jsx)(`p`,{className:`login-note small muted`,children:`云端数据库和飞书同步的真实状态,会在系统内显示。`})]})}function St({options:e,working:t,onSubmit:n}){let[r,i]=(0,J.useState)(``),[a,o]=(0,J.useState)(``),s=(0,J.useRef)(null);return(0,$.jsx)(`form`,{className:`login-form`,onSubmit:e=>{e.preventDefault(),n(r,a)},children:(0,$.jsxs)(Q,{layout:`vertical`,component:!1,children:[(0,$.jsx)(Q.Item,{label:`登录账号`,required:!0,children:(0,$.jsx)(ye,{"aria-label":`登录账号`,suffixIcon:(0,$.jsx)(bt,{}),"data-testid":`login-member`,value:r||void 0,placeholder:`请选择账号`,options:e.map(e=>({value:e.member,label:e.label})),onChange:e=>{i(e),window.setTimeout(()=>s.current?.focus(),0)}})}),(0,$.jsx)(Q.Item,{label:`密码`,required:!0,children:(0,$.jsx)(q.Password,{ref:s,name:`password`,"aria-label":`密码`,prefix:(0,$.jsx)(De,{className:`input-icon`}),autoComplete:`current-password`,value:a,onChange:e=>o(e.target.value)})}),(0,$.jsx)(I,{type:`primary`,htmlType:`submit`,block:!0,size:`large`,loading:t,children:`登录`})]})})}function Ct({working:e,onSubmit:t}){let[n,r]=(0,J.useState)({storeName:``,ownerLabel:`店主`,ownerLoginName:`owner`,ownerPassword:``}),i=e=>({value:n[e],onChange:t=>r({...n,[e]:t.target.value})});return(0,$.jsx)(`form`,{className:`setup-form`,onSubmit:e=>{e.preventDefault(),t(n)},children:(0,$.jsxs)(Q,{layout:`vertical`,component:!1,children:[(0,$.jsx)(Q.Item,{label:`店铺名称`,required:!0,children:(0,$.jsx)(q,{name:`storeName`,"aria-label":`店铺名称`,maxLength:80,...i(`storeName`)})}),(0,$.jsx)(Q.Item,{label:`店主显示名`,required:!0,children:(0,$.jsx)(q,{name:`ownerLabel`,"aria-label":`店主显示名`,maxLength:30,...i(`ownerLabel`)})}),(0,$.jsx)(Q.Item,{label:`店主登录名`,required:!0,children:(0,$.jsx)(q,{name:`ownerLoginName`,"aria-label":`店主登录名`,maxLength:60,...i(`ownerLoginName`)})}),(0,$.jsx)(Q.Item,{label:`店主密码(至少12个字符)`,required:!0,children:(0,$.jsx)(q.Password,{name:`ownerPassword`,"aria-label":`店主密码`,autoComplete:`new-password`,...i(`ownerPassword`)})}),(0,$.jsx)(ke.Paragraph,{type:`secondary`,className:`small`,children:`进入系统后,在设置 → 员工管理中添加员工。`}),(0,$.jsx)(I,{type:`primary`,htmlType:`submit`,block:!0,size:`large`,loading:e,children:`建立试用账号`})]})})}export{xt as LoginPage};