import{aP as fe,aQ as Ht,$ as nt,ak as Ut,al as pt,ar as rt,aq as it,aR as zt,aS as qe,an as Ln,a0 as Xt,k as at,m as Kt,_ as T,N as $e,a as Le,j as ce,b as B,i as Rn,I as _n,Q as Nn,a8 as Vn,aT as Yt,r as Qt,a5 as Dn,W as Wn,a4 as Gn,X as Bn,a6 as Hn,p as Zt,P as he,T as Un,t as ot,Y as zn,R as Xn,aU as Kn,a3 as Yn,n as Qn,aV as Zn,aW as Jn,aX as kn,d as de,g as ye,s as yt,y as er,x as Ce}from"./bootstrap-Dqw3yENe.js";import{a as tr,k as Re,g as Jt,b as nr,d as rr,e as ir,U as bt,f as kt,h as ar,i as en,S as or,c as $t,j as tn}from"./Trigger-5jflUr2b.js";import{i as lr,b as sr,a as nn,s as ur,o as fr,c as rn,d as lt,e as an,t as st,h as cr,f as on,g as ln,j as dr}from"./hasIn-BUtP4zTR.js";import{g as sn,i as mr}from"./isPlainObject-D2GlJz9_.js";import{u as gr,r as Ee}from"./responsiveObserve-Dnlnji5q.js";import{u as hr}from"./useFlexGapSupport-DWqqCtlk.js";import{R as ut,J as C,aF as ft,a4 as ve,P as Fe,a9 as un,az as fn,x as R,al as vr,F as Me,Y as ue,aA as pr,a5 as re,ao as He,T as cn,n as dn,r as Ue,a7 as oe}from"../jse/index-index-Gza42kOt.js";import{b as yr,a as br,g as $r}from"./collapse-BuqCI_Sc.js";import{T as xr}from"./index-DYHZID4U.js";import{c as wr}from"./collapseMotion-UObkCBaS.js";import{a as Fr,F as Sr,u as Or,b as ze}from"./FormItemContext-C_G5UYTm.js";function xt(e){return typeof e=="object"&&e!=null&&e.nodeType===1}function wt(e,t){return(!t||e!=="hidden")&&e!=="visible"&&e!=="clip"}function Ve(e,t){if(e.clientHeightt||a>e&&o=t&&l>=n?a-e-r:o>t&&ln?o-t+i:0}var Ft=function(e,t){var n=window,r=t.scrollMode,i=t.block,a=t.inline,o=t.boundary,l=t.skipOverflowHiddenElements,f=typeof o=="function"?o:function(Mn){return Mn!==o};if(!xt(e))throw new TypeError("Invalid target");for(var v,d,g=document.scrollingElement||document.documentElement,y=[],b=e;xt(b)&&f(b);){if((b=(d=(v=b).parentElement)==null?v.getRootNode().host||null:d)===g){y.push(b);break}b!=null&&b===document.body&&Ve(b)&&!Ve(document.documentElement)||b!=null&&Ve(b,l)&&y.push(b)}for(var x=n.visualViewport?n.visualViewport.width:innerWidth,c=n.visualViewport?n.visualViewport.height:innerHeight,$=window.scrollX||pageXOffset,m=window.scrollY||pageYOffset,F=e.getBoundingClientRect(),s=F.height,u=F.width,h=F.top,p=F.right,S=F.bottom,O=F.left,P=i==="start"||i==="nearest"?h:i==="end"?S:h+s/2,q=a==="center"?O+u/2:a==="end"?p:O,_=[],L=0;L=0&&O>=0&&S<=c&&p<=x&&h>=A&&S<=N&&O>=U&&p<=I)return _;var K=getComputedStyle(E),J=parseInt(K.borderLeftWidth,10),ie=parseInt(K.borderTopWidth,10),Z=parseInt(K.borderRightWidth,10),w=parseInt(K.borderBottomWidth,10),j=0,V=0,W="offsetWidth"in E?E.offsetWidth-E.clientWidth-J-Z:0,G="offsetHeight"in E?E.offsetHeight-E.clientHeight-ie-w:0,Y="offsetWidth"in E?E.offsetWidth===0?0:X/E.offsetWidth:0,te="offsetHeight"in E?E.offsetHeight===0?0:Q/E.offsetHeight:0;if(g===E)j=i==="start"?P:i==="end"?P-c:i==="nearest"?Ie(m,m+c,c,ie,w,m+P,m+P+s,s):P-c/2,V=a==="start"?q:a==="center"?q-x/2:a==="end"?q-x:Ie($,$+x,x,J,Z,$+q,$+q+u,u),j=Math.max(0,j+m),V=Math.max(0,V+$);else{j=i==="start"?P-A-ie:i==="end"?P-N+w+G:i==="nearest"?Ie(A,N,Q,ie,w+G,P,P+s,s):P-(A+Q/2)+G/2,V=a==="start"?q-U-J:a==="center"?q-(U+X/2)+W/2:a==="end"?q-I+Z+W:Ie(U,I,X,J,Z+W,q,q+u,u);var ne=E.scrollLeft,pe=E.scrollTop;P+=pe-(j=Math.max(0,Math.min(pe+j/te,E.scrollHeight-Q/te+G))),q+=ne-(V=Math.max(0,Math.min(ne+V/Y,E.scrollWidth-X/Y+W)))}_.push({el:E,top:j,left:V})}return _};function mn(e){return e===Object(e)&&Object.keys(e).length!==0}function Ar(e,t){t===void 0&&(t="auto");var n="scrollBehavior"in document.body.style;e.forEach(function(r){var i=r.el,a=r.top,o=r.left;i.scroll&&n?i.scroll({top:a,left:o,behavior:t}):(i.scrollTop=a,i.scrollLeft=o)})}function Cr(e){return e===!1?{block:"end",inline:"nearest"}:mn(e)?e:{block:"start",inline:"nearest"}}function Er(e,t){var n=e.isConnected||e.ownerDocument.documentElement.contains(e);if(mn(t)&&typeof t.behavior=="function")return t.behavior(n?Ft(e,t):[]);if(n){var r=Cr(t);return Ar(Ft(e,r),r.behavior)}}var Ir=/\s/;function Tr(e){for(var t=e.length;t--&&Ir.test(e.charAt(t)););return t}var Pr=/^\s+/;function jr(e){return e&&e.slice(0,Tr(e)+1).replace(Pr,"")}var St=NaN,qr=/^[-+]0x[0-9a-f]+$/i,Mr=/^0b[01]+$/i,Lr=/^0o[0-7]+$/i,Rr=parseInt;function Xe(e){if(typeof e=="number")return e;if(lr(e))return St;if(fe(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=fe(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=jr(e);var n=Mr.test(e);return n||Lr.test(e)?Rr(e.slice(2),n?2:8):qr.test(e)?St:+e}var _r=1/0,Nr=17976931348623157e292;function Vr(e){if(!e)return e===0?e:0;if(e=Xe(e),e===_r||e===-1/0){var t=e<0?-1:1;return t*Nr}return e===e?e:0}function Dr(e){var t=Vr(e),n=t%1;return t===t?n?t-n:t:0}var Ot=Object.create,Wr=function(){function e(){}return function(t){if(!fe(t))return{};if(Ot)return Ot(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Gr(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++ni?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r=t||S<0||g&&O>=a}function m(){var p=De();if($(p))return F(p);l=setTimeout(m,c(p))}function F(p){return l=void 0,y&&r?b(p):(r=i=void 0,o)}function s(){l!==void 0&&clearTimeout(l),v=0,r=f=i=l=void 0}function u(){return l===void 0?o:F(De())}function h(){var p=De(),S=$(p);if(r=arguments,i=this,f=p,S){if(l===void 0)return x(f);if(g)return clearTimeout(l),l=setTimeout(m,t),b(f)}return l===void 0&&(l=setTimeout(m,t)),o}return h.cancel=s,h.flush=u,h}function Ea(e){return rt(e)&&nt(e)}function Ia(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function Ta(e){return function(t,n,r){var i=Object(t);if(!nt(t)){var a=wn(n);t=Re(t),n=function(l){return a(i[l],l,i)}}var o=e(t,n,r);return o>-1?i[a?t[o]:o]:void 0}}var Pa=Math.max;function ja(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:Dr(n);return i<0&&(i=Pa(r+i,0)),yr(e,wn(t),i)}var qa=Ta(ja),Ma=Math.min;function La(e,t,n){for(var r=br,i=e[0].length,a=e.length,o=a,l=Array(a),f=1/0,v=[];o--;){var d=e[o];f=Ma(d.length,f),l[o]=i>=120&&d.length>=120?new or(o&&d):void 0}d=e[0];var g=-1,y=l[0];e:for(;++g1),a}),Oe(e,vn(e),n),r&&(n=xe(n,Wa|Ga|Ba,Da));for(var i=t.length;i--;)Va(n,t[i]);return n});const Fn=Symbol("rowContextKey"),Ua=e=>{ft(Fn,e)},za=()=>ut(Fn,{gutter:C(()=>{}),wrap:C(()=>{}),supportFlexGap:C(()=>{})}),Xa=e=>{const{componentCls:t}=e;return{[t]:{display:"flex",flexFlow:"row wrap",minWidth:0,"&::before, &::after":{display:"flex"},"&-no-wrap":{flexWrap:"nowrap"},"&-start":{justifyContent:"flex-start"},"&-center":{justifyContent:"center"},"&-end":{justifyContent:"flex-end"},"&-space-between":{justifyContent:"space-between"},"&-space-around ":{justifyContent:"space-around"},"&-space-evenly ":{justifyContent:"space-evenly"},"&-top":{alignItems:"flex-start"},"&-middle":{alignItems:"center"},"&-bottom":{alignItems:"flex-end"}}}},Ka=e=>{const{componentCls:t}=e;return{[t]:{position:"relative",maxWidth:"100%",minHeight:1}}},Ya=(e,t)=>{const{componentCls:n,gridColumns:r}=e,i={};for(let a=r;a>=0;a--)a===0?(i[`${n}${t}-${a}`]={display:"none"},i[`${n}-push-${a}`]={insetInlineStart:"auto"},i[`${n}-pull-${a}`]={insetInlineEnd:"auto"},i[`${n}${t}-push-${a}`]={insetInlineStart:"auto"},i[`${n}${t}-pull-${a}`]={insetInlineEnd:"auto"},i[`${n}${t}-offset-${a}`]={marginInlineEnd:0},i[`${n}${t}-order-${a}`]={order:0}):(i[`${n}${t}-${a}`]={display:"block",flex:`0 0 ${a/r*100}%`,maxWidth:`${a/r*100}%`},i[`${n}${t}-push-${a}`]={insetInlineStart:`${a/r*100}%`},i[`${n}${t}-pull-${a}`]={insetInlineEnd:`${a/r*100}%`},i[`${n}${t}-offset-${a}`]={marginInlineStart:`${a/r*100}%`},i[`${n}${t}-order-${a}`]={order:a});return i},Ke=(e,t)=>Ya(e,t),Qa=(e,t,n)=>({[`@media (min-width: ${t}px)`]:T({},Ke(e,n))}),Za=at("Grid",e=>[Xa(e)]),Ja=at("Grid",e=>{const t=Kt(e,{gridColumns:24}),n={"-sm":t.screenSMMin,"-md":t.screenMDMin,"-lg":t.screenLGMin,"-xl":t.screenXLMin,"-xxl":t.screenXXLMin};return[Ka(t),Ke(t,""),Ke(t,"-xs"),Object.keys(n).map(r=>Qa(t,n[r],r)).reduce((r,i)=>T(T({},r),i),{})]}),ka=()=>({align:$e([String,Object]),justify:$e([String,Object]),prefixCls:String,gutter:$e([Number,Array,Object],0),wrap:{type:Boolean,default:void 0}}),eo=ve({compatConfig:{MODE:3},name:"ARow",inheritAttrs:!1,props:ka(),setup(e,t){let{slots:n,attrs:r}=t;const{prefixCls:i,direction:a}=Le("row",e),[o,l]=Za(i);let f;const v=gr(),d=Fe({xs:!0,sm:!0,md:!0,lg:!0,xl:!0,xxl:!0}),g=Fe({xs:!1,sm:!1,md:!1,lg:!1,xl:!1,xxl:!1}),y=s=>C(()=>{if(typeof e[s]=="string")return e[s];if(typeof e[s]!="object")return"";for(let u=0;u{f=v.value.subscribe(s=>{g.value=s;const u=e.gutter||0;(!Array.isArray(u)&&typeof u=="object"||Array.isArray(u)&&(typeof u[0]=="object"||typeof u[1]=="object"))&&(d.value=s)})}),fn(()=>{v.value.unsubscribe(f)});const $=C(()=>{const s=[void 0,void 0],{gutter:u=0}=e;return(Array.isArray(u)?u:[u,void 0]).forEach((p,S)=>{if(typeof p=="object")for(let O=0;Oe.wrap)});const m=C(()=>ce(i.value,{[`${i.value}-no-wrap`]:e.wrap===!1,[`${i.value}-${x.value}`]:x.value,[`${i.value}-${b.value}`]:b.value,[`${i.value}-rtl`]:a.value==="rtl"},r.class,l.value)),F=C(()=>{const s=$.value,u={},h=s[0]!=null&&s[0]>0?`${s[0]/-2}px`:void 0,p=s[1]!=null&&s[1]>0?`${s[1]/-2}px`:void 0;return h&&(u.marginLeft=h,u.marginRight=h),c.value?u.rowGap=`${s[1]}px`:p&&(u.marginTop=p,u.marginBottom=p),u});return()=>{var s;return o(R("div",B(B({},r),{},{class:m.value,style:T(T({},F.value),r.style)}),[(s=n.default)===null||s===void 0?void 0:s.call(n)]))}}});function se(){return se=Object.assign?Object.assign.bind():function(e){for(var t=1;t1?t-1:0),r=1;r=a)return l;switch(l){case"%s":return String(n[i++]);case"%d":return Number(n[i++]);case"%j":try{return JSON.stringify(n[i++])}catch(f){return"[Circular]"}break;default:return l}});return o}return e}function oo(e){return e==="string"||e==="url"||e==="hex"||e==="email"||e==="date"||e==="pattern"}function z(e,t){return!!(e==null||t==="array"&&Array.isArray(e)&&!e.length||oo(t)&&typeof e=="string"&&!e)}function lo(e,t,n){var r=[],i=0,a=e.length;function o(l){r.push.apply(r,l||[]),i++,i===a&&n(r)}e.forEach(function(l){t(l,o)})}function qt(e,t,n){var r=0,i=e.length;function a(o){if(o&&o.length){n(o);return}var l=r;r=r+1,l()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},be={integer:function(t){return be.number(t)&&parseInt(t,10)===t},float:function(t){return be.number(t)&&!be.integer(t)},array:function(t){return Array.isArray(t)},regexp:function(t){if(t instanceof RegExp)return!0;try{return!!new RegExp(t)}catch(n){return!1}},date:function(t){return typeof t.getTime=="function"&&typeof t.getMonth=="function"&&typeof t.getYear=="function"&&!isNaN(t.getTime())},number:function(t){return isNaN(t)?!1:typeof t=="number"},object:function(t){return typeof t=="object"&&!be.array(t)},method:function(t){return typeof t=="function"},email:function(t){return typeof t=="string"&&t.length<=320&&!!t.match(_t.email)},url:function(t){return typeof t=="string"&&t.length<=2048&&!!t.match(go())},hex:function(t){return typeof t=="string"&&!!t.match(_t.hex)}},ho=function(t,n,r,i,a){if(t.required&&n===void 0){Sn(t,n,r,i,a);return}var o=["integer","float","array","regexp","object","method","email","number","date","url","hex"],l=t.type;o.indexOf(l)>-1?be[l](n)||i.push(ee(a.messages.types[l],t.fullField,t.type)):l&&typeof n!==t.type&&i.push(ee(a.messages.types[l],t.fullField,t.type))},vo=function(t,n,r,i,a){var o=typeof t.len=="number",l=typeof t.min=="number",f=typeof t.max=="number",v=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,d=n,g=null,y=typeof n=="number",b=typeof n=="string",x=Array.isArray(n);if(y?g="number":b?g="string":x&&(g="array"),!g)return!1;x&&(d=n.length),b&&(d=n.replace(v,"_").length),o?d!==t.len&&i.push(ee(a.messages[g].len,t.fullField,t.len)):l&&!f&&dt.max?i.push(ee(a.messages[g].max,t.fullField,t.max)):l&&f&&(dt.max)&&i.push(ee(a.messages[g].range,t.fullField,t.min,t.max))},me="enum",po=function(t,n,r,i,a){t[me]=Array.isArray(t[me])?t[me]:[],t[me].indexOf(n)===-1&&i.push(ee(a.messages[me],t.fullField,t[me].join(", ")))},yo=function(t,n,r,i,a){if(t.pattern){if(t.pattern instanceof RegExp)t.pattern.lastIndex=0,t.pattern.test(n)||i.push(ee(a.messages.pattern.mismatch,t.fullField,n,t.pattern));else if(typeof t.pattern=="string"){var o=new RegExp(t.pattern);o.test(n)||i.push(ee(a.messages.pattern.mismatch,t.fullField,n,t.pattern))}}},M={required:Sn,whitespace:mo,type:ho,range:vo,enum:po,pattern:yo},bo=function(t,n,r,i,a){var o=[],l=t.required||!t.required&&i.hasOwnProperty(t.field);if(l){if(z(n,"string")&&!t.required)return r();M.required(t,n,i,o,a,"string"),z(n,"string")||(M.type(t,n,i,o,a),M.range(t,n,i,o,a),M.pattern(t,n,i,o,a),t.whitespace===!0&&M.whitespace(t,n,i,o,a))}r(o)},$o=function(t,n,r,i,a){var o=[],l=t.required||!t.required&&i.hasOwnProperty(t.field);if(l){if(z(n)&&!t.required)return r();M.required(t,n,i,o,a),n!==void 0&&M.type(t,n,i,o,a)}r(o)},xo=function(t,n,r,i,a){var o=[],l=t.required||!t.required&&i.hasOwnProperty(t.field);if(l){if(n===""&&(n=void 0),z(n)&&!t.required)return r();M.required(t,n,i,o,a),n!==void 0&&(M.type(t,n,i,o,a),M.range(t,n,i,o,a))}r(o)},wo=function(t,n,r,i,a){var o=[],l=t.required||!t.required&&i.hasOwnProperty(t.field);if(l){if(z(n)&&!t.required)return r();M.required(t,n,i,o,a),n!==void 0&&M.type(t,n,i,o,a)}r(o)},Fo=function(t,n,r,i,a){var o=[],l=t.required||!t.required&&i.hasOwnProperty(t.field);if(l){if(z(n)&&!t.required)return r();M.required(t,n,i,o,a),z(n)||M.type(t,n,i,o,a)}r(o)},So=function(t,n,r,i,a){var o=[],l=t.required||!t.required&&i.hasOwnProperty(t.field);if(l){if(z(n)&&!t.required)return r();M.required(t,n,i,o,a),n!==void 0&&(M.type(t,n,i,o,a),M.range(t,n,i,o,a))}r(o)},Oo=function(t,n,r,i,a){var o=[],l=t.required||!t.required&&i.hasOwnProperty(t.field);if(l){if(z(n)&&!t.required)return r();M.required(t,n,i,o,a),n!==void 0&&(M.type(t,n,i,o,a),M.range(t,n,i,o,a))}r(o)},Ao=function(t,n,r,i,a){var o=[],l=t.required||!t.required&&i.hasOwnProperty(t.field);if(l){if(n==null&&!t.required)return r();M.required(t,n,i,o,a,"array"),n!=null&&(M.type(t,n,i,o,a),M.range(t,n,i,o,a))}r(o)},Co=function(t,n,r,i,a){var o=[],l=t.required||!t.required&&i.hasOwnProperty(t.field);if(l){if(z(n)&&!t.required)return r();M.required(t,n,i,o,a),n!==void 0&&M.type(t,n,i,o,a)}r(o)},Eo="enum",Io=function(t,n,r,i,a){var o=[],l=t.required||!t.required&&i.hasOwnProperty(t.field);if(l){if(z(n)&&!t.required)return r();M.required(t,n,i,o,a),n!==void 0&&M[Eo](t,n,i,o,a)}r(o)},To=function(t,n,r,i,a){var o=[],l=t.required||!t.required&&i.hasOwnProperty(t.field);if(l){if(z(n,"string")&&!t.required)return r();M.required(t,n,i,o,a),z(n,"string")||M.pattern(t,n,i,o,a)}r(o)},Po=function(t,n,r,i,a){var o=[],l=t.required||!t.required&&i.hasOwnProperty(t.field);if(l){if(z(n,"date")&&!t.required)return r();if(M.required(t,n,i,o,a),!z(n,"date")){var f;n instanceof Date?f=n:f=new Date(n),M.type(t,f,i,o,a),f&&M.range(t,f.getTime(),i,o,a)}}r(o)},jo=function(t,n,r,i,a){var o=[],l=Array.isArray(n)?"array":typeof n;M.required(t,n,i,o,a,l),r(o)},We=function(t,n,r,i,a){var o=t.type,l=[],f=t.required||!t.required&&i.hasOwnProperty(t.field);if(f){if(z(n,o)&&!t.required)return r();M.required(t,n,i,l,a,o),z(n,o)||M.type(t,n,i,l,a)}r(l)},qo=function(t,n,r,i,a){var o=[],l=t.required||!t.required&&i.hasOwnProperty(t.field);if(l){if(z(n)&&!t.required)return r();M.required(t,n,i,o,a)}r(o)},we={string:bo,method:$o,number:xo,boolean:wo,regexp:Fo,integer:So,float:Oo,array:Ao,object:Co,enum:Io,pattern:To,date:Po,url:We,hex:We,email:We,required:jo,any:qo};function Je(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var t=JSON.parse(JSON.stringify(this));return t.clone=this.clone,t}}}var ke=Je(),Ae=function(){function e(n){this.rules=null,this._messages=ke,this.define(n)}var t=e.prototype;return t.define=function(r){var i=this;if(!r)throw new Error("Cannot configure a schema with no rules");if(typeof r!="object"||Array.isArray(r))throw new Error("Rules must be an object");this.rules={},Object.keys(r).forEach(function(a){var o=r[a];i.rules[a]=Array.isArray(o)?o:[o]})},t.messages=function(r){return r&&(this._messages=Rt(Je(),r)),this._messages},t.validate=function(r,i,a){var o=this;i===void 0&&(i={}),a===void 0&&(a=function(){});var l=r,f=i,v=a;if(typeof f=="function"&&(v=f,f={}),!this.rules||Object.keys(this.rules).length===0)return v&&v(null,l),Promise.resolve(l);function d(c){var $=[],m={};function F(u){if(Array.isArray(u)){var h;$=(h=$).concat.apply(h,u)}else $.push(u)}for(var s=0;s3&&arguments[3]!==void 0?arguments[3]:!1;return t.length&&r&&n===void 0&&!On(e,t.slice(0,-1))?e:An(e,t,n,r)}function et(e){return ae(e)}function Lo(e,t){return On(e,t)}function Ro(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;return Mo(e,t,n,r)}function _o(e,t){return e&&e.some(n=>Vo(n,t))}function Nt(e){return typeof e=="object"&&e!==null&&Object.getPrototypeOf(e)===Object.prototype}function Cn(e,t){const n=Array.isArray(e)?[...e]:T({},e);return t&&Object.keys(t).forEach(r=>{const i=n[r],a=t[r],o=Nt(i)&&Nt(a);n[r]=o?Cn(i,a||{}):a}),n}function No(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;rCn(i,a),e)}function Vt(e,t){let n={};return t.forEach(r=>{const i=Lo(e,r);n=Ro(n,r,i)}),n}function Vo(e,t){return!e||!t||e.length!==t.length?!1:e.every((n,r)=>t[r]===n)}const k="'${name}' is not a valid ${type}",_e={default:"Validation error on field '${name}'",required:"'${name}' is required",enum:"'${name}' must be one of [${enum}]",whitespace:"'${name}' cannot be empty",date:{format:"'${name}' is invalid for format date",parse:"'${name}' could not be parsed as date",invalid:"'${name}' is invalid date"},types:{string:k,method:k,array:k,object:k,number:k,date:k,boolean:k,integer:k,float:k,regexp:k,email:k,url:k,hex:k},string:{len:"'${name}' must be exactly ${len} characters",min:"'${name}' must be at least ${min} characters",max:"'${name}' cannot be longer than ${max} characters",range:"'${name}' must be between ${min} and ${max} characters"},number:{len:"'${name}' must equal ${len}",min:"'${name}' cannot be less than ${min}",max:"'${name}' cannot be greater than ${max}",range:"'${name}' must be between ${min} and ${max}"},array:{len:"'${name}' must be exactly ${len} in length",min:"'${name}' cannot be less than ${min} in length",max:"'${name}' cannot be greater than ${max} in length",range:"'${name}' must be between ${min} and ${max} in length"},pattern:{mismatch:"'${name}' does not match pattern ${pattern}"}};var Ne=function(e,t,n,r){function i(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function l(d){try{v(r.next(d))}catch(g){o(g)}}function f(d){try{v(r.throw(d))}catch(g){o(g)}}function v(d){d.done?a(d.value):i(d.value).then(l,f)}v((r=r.apply(e,t||[])).next())})};const Do=Ae;function Wo(e,t){return e.replace(/\$\{\w+\}/g,n=>{const r=n.slice(2,-1);return t[r]})}function tt(e,t,n,r,i){return Ne(this,void 0,void 0,function*(){const a=T({},n);delete a.ruleIndex,delete a.trigger;let o=null;a&&a.type==="array"&&a.defaultField&&(o=a.defaultField,delete a.defaultField);const l=new Do({[e]:[a]}),f=No({},_e,r.validateMessages);l.messages(f);let v=[];try{yield Promise.resolve(l.validate({[e]:t},T({},r)))}catch(y){y.errors?v=y.errors.map((b,x)=>{let{message:c}=b;return Rn(c)?vr(c,{key:`error_${x}`}):c}):(console.error(y),v=[f.default()])}if(!v.length&&o)return(yield Promise.all(t.map((b,x)=>tt(`${e}.${x}`,b,o,r,i)))).reduce((b,x)=>[...b,...x],[]);const d=T(T(T({},n),{name:e,enum:(n.enum||[]).join(", ")}),i);return v.map(y=>typeof y=="string"?Wo(y,d):y)})}function En(e,t,n,r,i,a){const o=e.join("."),l=n.map((v,d)=>{const g=v.validator,y=T(T({},v),{ruleIndex:d});return g&&(y.validator=(b,x,c)=>{let $=!1;const F=g(b,x,function(){for(var s=arguments.length,u=new Array(s),h=0;h{$||c(...u)})});$=F&&typeof F.then=="function"&&typeof F.catch=="function",$&&F.then(()=>{c()}).catch(s=>{c(s||" ")})}),y}).sort((v,d)=>{let{warningOnly:g,ruleIndex:y}=v,{warningOnly:b,ruleIndex:x}=d;return!!g==!!b?y-x:g?1:-1});let f;if(i===!0)f=new Promise((v,d)=>Ne(this,void 0,void 0,function*(){for(let g=0;gtt(o,t,d,r,a).then(g=>({errors:g,rule:d})));f=(i?Bo(v):Go(v)).then(d=>Promise.reject(d))}return f.catch(v=>v),f}function Go(e){return Ne(this,void 0,void 0,function*(){return Promise.all(e).then(t=>[].concat(...t))})}function Bo(e){return Ne(this,void 0,void 0,function*(){let t=0;return new Promise(n=>{e.forEach(r=>{r.then(i=>{i.errors.length&&n([i]),t+=1,t===e.length&&n([])})})})})}const In=Symbol("formContextKey"),Tn=e=>{ft(In,e)},mt=()=>ut(In,{name:C(()=>{}),labelAlign:C(()=>"right"),vertical:C(()=>!1),addField:(e,t)=>{},removeField:e=>{},model:C(()=>{}),rules:C(()=>{}),colon:C(()=>{}),labelWrap:C(()=>{}),labelCol:C(()=>{}),requiredMark:C(()=>!1),validateTrigger:C(()=>{}),onValidate:()=>{},validateMessages:C(()=>_e)}),Pn=Symbol("formItemPrefixContextKey"),Ho=e=>{ft(Pn,e)},Uo=()=>ut(Pn,{prefixCls:C(()=>"")});function zo(e){return typeof e=="number"?`${e} ${e} auto`:/^\d+(\.\d+)?(px|em|rem|%)$/.test(e)?`0 0 ${e}`:e}const Xo=()=>({span:[String,Number],order:[String,Number],offset:[String,Number],push:[String,Number],pull:[String,Number],xs:{type:[String,Number,Object],default:void 0},sm:{type:[String,Number,Object],default:void 0},md:{type:[String,Number,Object],default:void 0},lg:{type:[String,Number,Object],default:void 0},xl:{type:[String,Number,Object],default:void 0},xxl:{type:[String,Number,Object],default:void 0},prefixCls:String,flex:[String,Number]}),Ko=["xs","sm","md","lg","xl","xxl"],jn=ve({compatConfig:{MODE:3},name:"ACol",inheritAttrs:!1,props:Xo(),setup(e,t){let{slots:n,attrs:r}=t;const{gutter:i,supportFlexGap:a,wrap:o}=za(),{prefixCls:l,direction:f}=Le("col",e),[v,d]=Ja(l),g=C(()=>{const{span:b,order:x,offset:c,push:$,pull:m}=e,F=l.value;let s={};return Ko.forEach(u=>{let h={};const p=e[u];typeof p=="number"?h.span=p:typeof p=="object"&&(h=p||{}),s=T(T({},s),{[`${F}-${u}-${h.span}`]:h.span!==void 0,[`${F}-${u}-order-${h.order}`]:h.order||h.order===0,[`${F}-${u}-offset-${h.offset}`]:h.offset||h.offset===0,[`${F}-${u}-push-${h.push}`]:h.push||h.push===0,[`${F}-${u}-pull-${h.pull}`]:h.pull||h.pull===0,[`${F}-rtl`]:f.value==="rtl"})}),ce(F,{[`${F}-${b}`]:b!==void 0,[`${F}-order-${x}`]:x,[`${F}-offset-${c}`]:c,[`${F}-push-${$}`]:$,[`${F}-pull-${m}`]:m},s,r.class,d.value)}),y=C(()=>{const{flex:b}=e,x=i.value,c={};if(x&&x[0]>0){const $=`${x[0]/2}px`;c.paddingLeft=$,c.paddingRight=$}if(x&&x[1]>0&&!a.value){const $=`${x[1]/2}px`;c.paddingTop=$,c.paddingBottom=$}return b&&(c.flex=zo(b),o.value===!1&&!c.minWidth&&(c.minWidth=0)),c});return()=>{var b;return v(R("div",B(B({},r),{},{class:g.value,style:[y.value,r.style]}),[(b=n.default)===null||b===void 0?void 0:b.call(n)]))}}});var Yo={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M623.6 316.7C593.6 290.4 554 276 512 276s-81.6 14.5-111.6 40.7C369.2 344 352 380.7 352 420v7.6c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V420c0-44.1 43.1-80 96-80s96 35.9 96 80c0 31.1-22 59.6-56.1 72.7-21.2 8.1-39.2 22.3-52.1 40.9-13.1 19-19.9 41.8-19.9 64.9V620c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-22.7a48.3 48.3 0 0130.9-44.8c59-22.7 97.1-74.7 97.1-132.5.1-39.3-17.1-76-48.3-103.3zM472 732a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"question-circle",theme:"outlined"};function Dt(e){for(var t=1;t{let{slots:n,emit:r,attrs:i}=t;var a,o,l,f,v;const{prefixCls:d,htmlFor:g,labelCol:y,labelAlign:b,colon:x,required:c,requiredMark:$}=T(T({},e),i),[m]=Nn("Form"),F=(a=e.label)!==null&&a!==void 0?a:(o=n.label)===null||o===void 0?void 0:o.call(n);if(!F)return null;const{vertical:s,labelAlign:u,labelCol:h,labelWrap:p,colon:S}=mt(),O=y||(h==null?void 0:h.value)||{},P=b||(u==null?void 0:u.value),q=`${d}-item-label`,_=ce(q,P==="left"&&`${q}-left`,O.class,{[`${q}-wrap`]:!!p.value});let L=F;const E=x===!0||(S==null?void 0:S.value)!==!1&&x!==!1;if(E&&!s.value&&typeof F=="string"&&F.trim()!==""&&(L=F.replace(/[:|:]\s*$/,"")),e.tooltip||n.tooltip){const X=R("span",{class:`${d}-item-tooltip`},[R(xr,{title:e.tooltip},{default:()=>[R(gt,null,null)]})]);L=R(Me,null,[L,n.tooltip?(l=n.tooltip)===null||l===void 0?void 0:l.call(n,{class:`${d}-item-tooltip`}):X])}$==="optional"&&!c&&(L=R(Me,null,[L,R("span",{class:`${d}-item-optional`},[((f=m.value)===null||f===void 0?void 0:f.optional)||((v=Vn.Form)===null||v===void 0?void 0:v.optional)])]));const Q=ce({[`${d}-item-required`]:c,[`${d}-item-required-mark-optional`]:$==="optional",[`${d}-item-no-colon`]:!E});return R(jn,B(B({},O),{},{class:_}),{default:()=>[R("label",{for:g,class:Q,title:typeof F=="string"?F:"",onClick:X=>r("click",X)},[L])]})};ht.displayName="FormItemLabel";ht.inheritAttrs=!1;const Zo=e=>{const{componentCls:t}=e,n=`${t}-show-help`,r=`${t}-show-help-item`;return{[n]:{transition:`opacity ${e.motionDurationSlow} ${e.motionEaseInOut}`,"&-appear, &-enter":{opacity:0,"&-active":{opacity:1}},"&-leave":{opacity:1,"&-active":{opacity:0}},[r]:{overflow:"hidden",transition:`height ${e.motionDurationSlow} ${e.motionEaseInOut}, opacity ${e.motionDurationSlow} ${e.motionEaseInOut}, transform ${e.motionDurationSlow} ${e.motionEaseInOut} !important`,[`&${r}-appear, &${r}-enter`]:{transform:"translateY(-5px)",opacity:0,"&-active":{transform:"translateY(0)",opacity:1}},[`&${r}-leave-active`]:{transform:"translateY(-5px)"}}}}},Jo=e=>({legend:{display:"block",width:"100%",marginBottom:e.marginLG,padding:0,color:e.colorTextDescription,fontSize:e.fontSizeLG,lineHeight:"inherit",border:0,borderBottom:`${e.lineWidth}px ${e.lineType} ${e.colorBorder}`},label:{fontSize:e.fontSize},'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 ${e.controlOutlineWidth}px ${e.controlOutline}`},output:{display:"block",paddingTop:15,color:e.colorText,fontSize:e.fontSize,lineHeight:e.lineHeight}}),Wt=(e,t)=>{const{formItemCls:n}=e;return{[n]:{[`${n}-label > label`]:{height:t},[`${n}-control-input`]:{minHeight:t}}}},ko=e=>{const{componentCls:t}=e;return{[e.componentCls]:T(T(T({},Qt(e)),Jo(e)),{[`${t}-text`]:{display:"inline-block",paddingInlineEnd:e.paddingSM},"&-small":T({},Wt(e,e.controlHeightSM)),"&-large":T({},Wt(e,e.controlHeightLG))})}},el=e=>{const{formItemCls:t,iconCls:n,componentCls:r,rootPrefixCls:i}=e;return{[t]:T(T({},Qt(e)),{marginBottom:e.marginLG,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`]:{display:"inline-block",flexGrow:0,overflow:"hidden",whiteSpace:"nowrap",textAlign:"end",verticalAlign:"middle","&-left":{textAlign:"start"},"&-wrap":{overflow:"unset",lineHeight:`${e.lineHeight} - 0.25em`,whiteSpace:"unset"},"> label":{position:"relative",display:"inline-flex",alignItems:"center",maxWidth:"100%",height:e.controlHeight,color:e.colorTextHeading,fontSize:e.fontSize,[`> ${n}`]:{fontSize:e.fontSize,verticalAlign:"top"},[`&${t}-required:not(${t}-required-mark-optional)::before`]:{display:"inline-block",marginInlineEnd:e.marginXXS,color:e.colorError,fontSize:e.fontSize,fontFamily:"SimSun, sans-serif",lineHeight:1,content:'"*"',[`${r}-hide-required-mark &`]:{display:"none"}},[`${t}-optional`]:{display:"inline-block",marginInlineStart:e.marginXXS,color:e.colorTextDescription,[`${r}-hide-required-mark &`]:{display:"none"}},[`${t}-tooltip`]:{color:e.colorTextDescription,cursor:"help",writingMode:"horizontal-tb",marginInlineStart:e.marginXXS},"&::after":{content:'":"',position:"relative",marginBlock:0,marginInlineStart:e.marginXXS/2,marginInlineEnd:e.marginXS},[`&${t}-no-colon::after`]:{content:'" "'}}},[`${t}-control`]:{display:"flex",flexDirection:"column",flexGrow:1,[`&:first-child:not([class^="'${i}-col-'"]):not([class*="' ${i}-col-'"])`]:{width:"100%"},"&-input":{position:"relative",display:"flex",alignItems:"center",minHeight:e.controlHeight,"&-content":{flex:"auto",maxWidth:"100%"}}},[t]:{"&-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:Yt,animationDuration:e.motionDurationMid,animationTimingFunction:e.motionEaseOutBack,pointerEvents:"none","&-success":{color:e.colorSuccess},"&-error":{color:e.colorError},"&-warning":{color:e.colorWarning},"&-validating":{color:e.colorPrimary}}})}},tl=e=>{const{componentCls:t,formItemCls:n,rootPrefixCls:r}=e;return{[`${t}-horizontal`]:{[`${n}-label`]:{flexGrow:0},[`${n}-control`]:{flex:"1 1 0",minWidth:0},[`${n}-label.${r}-col-24 + ${n}-control`]:{minWidth:"unset"}}}},nl=e=>{const{componentCls:t,formItemCls:n}=e;return{[`${t}-inline`]:{display:"flex",flexWrap:"wrap",[n]:{flex:"none",flexWrap:"nowrap",marginInlineEnd:e.margin,marginBottom:0,"&-with-help":{marginBottom:e.marginLG},[`> ${n}-label, > ${n}-control`]:{display:"inline-block",verticalAlign:"top"},[`> ${n}-label`]:{flex:"none"},[`${t}-text`]:{display:"inline-block"},[`${n}-has-feedback`]:{display:"inline-block"}}}}},ge=e=>({margin:0,padding:`0 0 ${e.paddingXS}px`,whiteSpace:"initial",textAlign:"start","> label":{margin:0,"&::after":{display:"none"}}}),rl=e=>{const{componentCls:t,formItemCls:n}=e;return{[`${n} ${n}-label`]:ge(e),[t]:{[n]:{flexWrap:"wrap",[`${n}-label, ${n}-control`]:{flex:"0 0 100%",maxWidth:"100%"}}}}},il=e=>{const{componentCls:t,formItemCls:n,rootPrefixCls:r}=e;return{[`${t}-vertical`]:{[n]:{"&-row":{flexDirection:"column"},"&-label > label":{height:"auto"},[`${t}-item-control`]:{width:"100%"}}},[`${t}-vertical ${n}-label, .${r}-col-24${n}-label, .${r}-col-xl-24${n}-label`]:ge(e),[`@media (max-width: ${e.screenXSMax}px)`]:[rl(e),{[t]:{[`.${r}-col-xs-24${n}-label`]:ge(e)}}],[`@media (max-width: ${e.screenSMMax}px)`]:{[t]:{[`.${r}-col-sm-24${n}-label`]:ge(e)}},[`@media (max-width: ${e.screenMDMax}px)`]:{[t]:{[`.${r}-col-md-24${n}-label`]:ge(e)}},[`@media (max-width: ${e.screenLGMax}px)`]:{[t]:{[`.${r}-col-lg-24${n}-label`]:ge(e)}}}},vt=at("Form",(e,t)=>{let{rootPrefixCls:n}=t;const r=Kt(e,{formItemCls:`${e.componentCls}-item`,rootPrefixCls:n});return[ko(r),el(r),Zo(r),tl(r),nl(r),il(r),$r(r),Yt]}),al=ve({compatConfig:{MODE:3},name:"ErrorList",inheritAttrs:!1,props:["errors","help","onErrorVisibleChanged","helpStatus","warnings"],setup(e,t){let{attrs:n}=t;const{prefixCls:r,status:i}=Uo(),a=C(()=>`${r.value}-item-explain`),o=C(()=>!!(e.errors&&e.errors.length)),l=Fe(i.value),[,f]=vt(r);return ue([o,i],()=>{o.value&&(l.value=i.value)}),()=>{var v,d;const g=wr(`${r.value}-show-help-item`),y=Dn(`${r.value}-show-help-item`,g);return y.role="alert",y.class=[f.value,a.value,n.class,`${r.value}-show-help`],R(Wn,B(B({},Gn(`${r.value}-show-help`)),{},{onAfterEnter:()=>e.onErrorVisibleChanged(!0),onAfterLeave:()=>e.onErrorVisibleChanged(!1)}),{default:()=>[pr(R(Hn,B(B({},y),{},{tag:"div"}),{default:()=>[(d=e.errors)===null||d===void 0?void 0:d.map((b,x)=>R("div",{key:x,class:l.value?`${a.value}-${l.value}`:""},[b]))]}),[[Bn,!!(!((v=e.errors)===null||v===void 0)&&v.length)]])]})}}}),ol=ve({compatConfig:{MODE:3},slots:Object,inheritAttrs:!1,props:["prefixCls","errors","hasFeedback","onDomErrorVisibleChange","wrapperCol","help","extra","status","marginBottom","onErrorVisibleChanged"],setup(e,t){let{slots:n}=t;const r=mt(),{wrapperCol:i}=r,a=T({},r);return delete a.labelCol,delete a.wrapperCol,Tn(a),Ho({prefixCls:C(()=>e.prefixCls),status:C(()=>e.status)}),()=>{var o,l,f;const{prefixCls:v,wrapperCol:d,marginBottom:g,onErrorVisibleChanged:y,help:b=(o=n.help)===null||o===void 0?void 0:o.call(n),errors:x=Zt((l=n.errors)===null||l===void 0?void 0:l.call(n)),extra:c=(f=n.extra)===null||f===void 0?void 0:f.call(n)}=e,$=`${v}-item`,m=d||(i==null?void 0:i.value)||{},F=ce(`${$}-control`,m.class);return R(jn,B(B({},m),{},{class:F}),{default:()=>{var s;return R(Me,null,[R("div",{class:`${$}-control-input`},[R("div",{class:`${$}-control-input-content`},[(s=n.default)===null||s===void 0?void 0:s.call(n)])]),g!==null||x.length?R("div",{style:{display:"flex",flexWrap:"nowrap"}},[R(al,{errors:x,help:b,class:`${$}-explain-connected`,onErrorVisibleChanged:y},null),!!g&&R("div",{style:{width:0,height:`${g}px`}},null)]):null,c?R("div",{class:`${$}-extra`},[c]):null])}})}}});function ll(e){const t=re(e.value.slice());let n=null;return He(()=>{clearTimeout(n),n=setTimeout(()=>{t.value=e.value},e.value.length?0:10)}),t}ot("success","warning","error","validating","");const sl={success:Yn,warning:Kn,error:Xn,validating:zn};function Ge(e,t,n){let r=e;const i=t;let a=0;try{for(let o=i.length;a({htmlFor:String,prefixCls:String,label:he.any,help:he.any,extra:he.any,labelCol:{type:Object},wrapperCol:{type:Object},hasFeedback:{type:Boolean,default:!1},colon:{type:Boolean,default:void 0},labelAlign:String,prop:{type:[String,Number,Array]},name:{type:[String,Number,Array]},rules:[Array,Object],autoLink:{type:Boolean,default:!0},required:{type:Boolean,default:void 0},validateFirst:{type:Boolean,default:void 0},validateStatus:he.oneOf(ot("","success","warning","error","validating")),validateTrigger:{type:[String,Array]},messageVariables:{type:Object},hidden:Boolean,noStyle:Boolean,tooltip:String});let fl=0;const cl="form_item",dl=ve({compatConfig:{MODE:3},name:"AFormItem",inheritAttrs:!1,__ANT_NEW_FORM_ITEM:!0,props:ul(),slots:Object,setup(e,t){let{slots:n,attrs:r,expose:i}=t;Un(e.prop===void 0);const a=`form-item-${++fl}`,{prefixCls:o}=Le("form",e),[l,f]=vt(o),v=re(),d=mt(),g=C(()=>e.name||e.prop),y=re([]),b=re(!1),x=re(),c=C(()=>{const w=g.value;return et(w)}),$=C(()=>{if(c.value.length){const w=d.name.value,j=c.value.join("_");return w?`${w}_${j}`:`${cl}_${j}`}else return}),m=()=>{const w=d.model.value;if(!(!w||!g.value))return Ge(w,c.value,!0).v},F=C(()=>m()),s=re(Pe(F.value)),u=C(()=>{let w=e.validateTrigger!==void 0?e.validateTrigger:d.validateTrigger.value;return w=w===void 0?"change":w,ae(w)}),h=C(()=>{let w=d.rules.value;const j=e.rules,V=e.required!==void 0?{required:!!e.required,trigger:u.value}:[],W=Ge(w,c.value);w=w?W.o[W.k]||W.v:[];const G=[].concat(j||w||[]);return qa(G,Y=>Y.required)?G:G.concat(V)}),p=C(()=>{const w=h.value;let j=!1;return w&&w.length&&w.every(V=>V.required?(j=!0,!1):!0),j||e.required}),S=re();He(()=>{S.value=e.validateStatus});const O=C(()=>{let w={};return typeof e.label=="string"?w.label=e.label:e.name&&(w.label=String(e.name)),e.messageVariables&&(w=T(T({},w),e.messageVariables)),w}),P=w=>{if(c.value.length===0)return;const{validateFirst:j=!1}=e,{triggerName:V}=w||{};let W=h.value;if(V&&(W=W.filter(Y=>{const{trigger:te}=Y;return!te&&!u.value.length?!0:ae(te||u.value).includes(V)})),!W.length)return Promise.resolve();const G=En(c.value,F.value,W,T({validateMessages:d.validateMessages.value},w),j,O.value);return S.value="validating",y.value=[],G.catch(Y=>Y).then(function(){let Y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];if(S.value==="validating"){const te=Y.filter(ne=>ne&&ne.errors.length);S.value=te.length?"error":"success",y.value=te.map(ne=>ne.errors),d.onValidate(g.value,!y.value.length,y.value.length?Ue(y.value[0]):null)}}),G},q=()=>{P({triggerName:"blur"})},_=()=>{if(b.value){b.value=!1;return}P({triggerName:"change"})},L=()=>{S.value=e.validateStatus,b.value=!1,y.value=[]},E=()=>{var w;S.value=e.validateStatus,b.value=!0,y.value=[];const j=d.model.value||{},V=F.value,W=Ge(j,c.value,!0);Array.isArray(V)?W.o[W.k]=[].concat((w=s.value)!==null&&w!==void 0?w:[]):W.o[W.k]=s.value,dn(()=>{b.value=!1})},H=C(()=>e.htmlFor===void 0?$.value:e.htmlFor),Q=()=>{const w=H.value;if(!w||!x.value)return;const j=x.value.$el.querySelector(`[id="${w}"]`);j&&j.focus&&j.focus()};i({onFieldBlur:q,onFieldChange:_,clearValidate:L,resetField:E}),Fr({id:$,onFieldBlur:()=>{e.autoLink&&q()},onFieldChange:()=>{e.autoLink&&_()},clearValidate:L},C(()=>!!(e.autoLink&&d.model.value&&g.value)));let X=!1;ue(g,w=>{w?X||(X=!0,d.addField(a,{fieldValue:F,fieldId:$,fieldName:g,resetField:E,clearValidate:L,namePath:c,validateRules:P,rules:h})):(X=!1,d.removeField(a))},{immediate:!0}),fn(()=>{d.removeField(a)});const A=ll(y),I=C(()=>e.validateStatus!==void 0?e.validateStatus:A.value.length?"error":S.value),N=C(()=>({[`${o.value}-item`]:!0,[f.value]:!0,[`${o.value}-item-has-feedback`]:I.value&&e.hasFeedback,[`${o.value}-item-has-success`]:I.value==="success",[`${o.value}-item-has-warning`]:I.value==="warning",[`${o.value}-item-has-error`]:I.value==="error",[`${o.value}-item-is-validating`]:I.value==="validating",[`${o.value}-item-hidden`]:e.hidden})),U=cn({});Sr.useProvide(U),He(()=>{let w;if(e.hasFeedback){const j=I.value&&sl[I.value];w=j?R("span",{class:ce(`${o.value}-item-feedback-icon`,`${o.value}-item-feedback-icon-${I.value}`)},[R(j,null,null)]):null}T(U,{status:I.value,hasFeedback:e.hasFeedback,feedbackIcon:w,isFormItemInput:!0})});const K=re(null),J=re(!1),ie=()=>{if(v.value){const w=getComputedStyle(v.value);K.value=parseInt(w.marginBottom,10)}};un(()=>{ue(J,()=>{J.value&&ie()},{flush:"post",immediate:!0})});const Z=w=>{w||(K.value=null)};return()=>{var w,j;if(e.noStyle)return(w=n.default)===null||w===void 0?void 0:w.call(n);const V=(j=e.help)!==null&&j!==void 0?j:n.help?Zt(n.help()):null,W=!!(V!=null&&Array.isArray(V)&&V.length||A.value.length);return J.value=W,l(R("div",{class:[N.value,W?`${o.value}-item-with-help`:"",r.class],ref:v},[R(eo,B(B({},r),{},{class:`${o.value}-item-row`,key:"row"}),{default:()=>{var G,Y;return R(Me,null,[R(ht,B(B({},e),{},{htmlFor:H.value,required:p.value,requiredMark:d.requiredMark.value,prefixCls:o.value,onClick:Q,label:e.label}),{label:n.label,tooltip:n.tooltip}),R(ol,B(B({},e),{},{errors:V!=null?ae(V):A.value,marginBottom:K.value,prefixCls:o.value,status:I.value,ref:x,help:V,extra:(G=e.extra)!==null&&G!==void 0?G:(Y=n.extra)===null||Y===void 0?void 0:Y.call(n),onErrorVisibleChanged:Z}),{default:n.default})])}}),!!K.value&&R("div",{class:`${o.value}-margin-offset`,style:{marginBottom:`-${K.value}px`}},null)]))}}});function qn(e){let t=!1,n=e.length;const r=[];return e.length?new Promise((i,a)=>{e.forEach((o,l)=>{o.catch(f=>(t=!0,f)).then(f=>{n-=1,r[l]=f,!(n>0)&&(t&&a(r),i(r))})})}):Promise.resolve([])}function Gt(e){let t=!1;return e&&e.length&&e.every(n=>n.required?(t=!0,!1):!0),t}function Bt(e){return e==null?[]:Array.isArray(e)?e:[e]}function Be(e,t,n){let r=e;t=t.replace(/\[(\w+)\]/g,".$1"),t=t.replace(/^\./,"");const i=t.split(".");let a=0;for(let o=i.length;a1&&arguments[1]!==void 0?arguments[1]:Fe({}),n=arguments.length>2?arguments[2]:void 0;const r=Pe(oe(e)),i=cn({}),a=re([]),o=s=>{T(oe(e),T(T({},Pe(r)),s)),dn(()=>{Object.keys(i).forEach(u=>{i[u]={autoLink:!1,required:Gt(oe(t)[u])}})})},l=function(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],u=arguments.length>1?arguments[1]:void 0;return u.length?s.filter(h=>{const p=Bt(h.trigger||"change");return _a(p,u).length}):s};let f=null;const v=function(s){let u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},h=arguments.length>2?arguments[2]:void 0;const p=[],S={};for(let q=0;q({name:_,errors:[],warnings:[]})).catch(H=>{const Q=[],X=[];return H.forEach(A=>{let{rule:{warningOnly:I},errors:N}=A;I?X.push(...N):Q.push(...N)}),Q.length?Promise.reject({name:_,errors:Q,warnings:X}):{name:_,errors:Q,warnings:X}}))}const O=qn(p);f=O;const P=O.then(()=>f===O?Promise.resolve(S):Promise.reject([])).catch(q=>{const _=q.filter(L=>L&&L.errors.length);return _.length?Promise.reject({values:S,errorFields:_,outOfDate:f!==O}):Promise.resolve(S)});return P.catch(q=>q),P},d=function(s,u,h){let p=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const S=En([s],u,h,T({validateMessages:_e},p),!!p.validateFirst);return i[s]?(i[s].validateStatus="validating",S.catch(O=>O).then(function(){let O=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];var P;if(i[s].validateStatus==="validating"){const q=O.filter(_=>_&&_.errors.length);i[s].validateStatus=q.length?"error":"success",i[s].help=q.length?q.map(_=>_.errors):null,(P=n==null?void 0:n.onValidate)===null||P===void 0||P.call(n,s,!q.length,q.length?Ue(i[s].help[0]):null)}}),S):S.catch(O=>O)},g=(s,u)=>{let h=[],p=!0;s?Array.isArray(s)?h=s:h=[s]:(p=!1,h=a.value);const S=v(h,u||{},p);return S.catch(O=>O),S},y=s=>{let u=[];s?Array.isArray(s)?u=s:u=[s]:u=a.value,u.forEach(h=>{i[h]&&T(i[h],{validateStatus:"",help:null})})},b=s=>{const u={autoLink:!1},h=[],p=Array.isArray(s)?s:[s];for(let S=0;S{const u=[];a.value.forEach(h=>{const p=Be(s,h,!1),S=Be(x,h,!1);(c&&(n==null?void 0:n.immediate)&&p.isValid||!tn(p.v,S.v))&&u.push(h)}),g(u,{trigger:"change"}),c=!1,x=Pe(Ue(s))},m=n==null?void 0:n.debounce;let F=!0;return ue(t,()=>{a.value=t?Object.keys(oe(t)):[],!F&&n&&n.validateOnRuleChange&&g(),F=!1},{deep:!0,immediate:!0}),ue(a,()=>{const s={};a.value.forEach(u=>{s[u]=T({},i[u],{autoLink:!1,required:Gt(oe(t)[u])}),delete i[u]});for(const u in i)Object.prototype.hasOwnProperty.call(i,u)&&delete i[u];T(i,s)},{immediate:!0}),ue(e,m&&m.wait?Ca($,m.wait,Ha(m,["wait"])):$,{immediate:n&&!!n.immediate,deep:!0}),{modelRef:e,rulesRef:t,initialModel:r,validateInfos:i,resetFields:o,validate:g,validateField:d,mergeValidateInfo:b,clearValidate:y}}const gl=()=>({layout:he.oneOf(ot("horizontal","inline","vertical")),labelCol:Ce(),wrapperCol:Ce(),colon:ye(),labelAlign:yt(),labelWrap:ye(),prefixCls:String,requiredMark:$e([String,Boolean]),hideRequiredMark:ye(),model:he.object,rules:Ce(),validateMessages:Ce(),validateOnRuleChange:ye(),scrollToFirstError:er(),onSubmit:de(),name:String,validateTrigger:$e([String,Array]),size:yt(),disabled:ye(),onValuesChange:de(),onFieldsChange:de(),onFinish:de(),onFinishFailed:de(),onValidate:de()});function hl(e,t){return tn(ae(e),ae(t))}const le=ve({compatConfig:{MODE:3},name:"AForm",inheritAttrs:!1,props:Qn(gl(),{layout:"horizontal",hideRequiredMark:!1,colon:!0}),Item:dl,useForm:ml,setup(e,t){let{emit:n,slots:r,expose:i,attrs:a}=t;const{prefixCls:o,direction:l,form:f,size:v,disabled:d}=Le("form",e),g=C(()=>e.requiredMark===""||e.requiredMark),y=C(()=>{var A;return g.value!==void 0?g.value:f&&((A=f.value)===null||A===void 0?void 0:A.requiredMark)!==void 0?f.value.requiredMark:!e.hideRequiredMark});Zn(v),Jn(d);const b=C(()=>{var A,I;return(A=e.colon)!==null&&A!==void 0?A:(I=f.value)===null||I===void 0?void 0:I.colon}),{validateMessages:x}=kn(),c=C(()=>T(T(T({},_e),x.value),e.validateMessages)),[$,m]=vt(o),F=C(()=>ce(o.value,{[`${o.value}-${e.layout}`]:!0,[`${o.value}-hide-required-mark`]:y.value===!1,[`${o.value}-rtl`]:l.value==="rtl",[`${o.value}-${v.value}`]:v.value},m.value)),s=Fe(),u={},h=(A,I)=>{u[A]=I},p=A=>{delete u[A]},S=A=>{const I=!!A,N=I?ae(A).map(et):[];return I?Object.values(u).filter(U=>N.findIndex(K=>hl(K,U.fieldName.value))>-1):Object.values(u)},O=A=>{e.model&&S(A).forEach(I=>{I.resetField()})},P=A=>{S(A).forEach(I=>{I.clearValidate()})},q=A=>{const{scrollToFirstError:I}=e;if(n("finishFailed",A),I&&A.errorFields.length){let N={};typeof I=="object"&&(N=I),L(A.errorFields[0].name,N)}},_=function(){return Q(...arguments)},L=function(A){let I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const N=S(A?[A]:void 0);if(N.length){const U=N[0].fieldId.value,K=U?document.getElementById(U):null;K&&Er(K,T({scrollMode:"if-needed",block:"nearest"},I))}},E=function(){let A=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;if(A===!0){const I=[];return Object.values(u).forEach(N=>{let{namePath:U}=N;I.push(U.value)}),Vt(e.model,I)}else return Vt(e.model,A)},H=(A,I)=>{if(!e.model)return Promise.reject("Form `model` is required for validateFields to work.");const N=!!A,U=N?ae(A).map(et):[],K=[];Object.values(u).forEach(Z=>{var w;if(N||U.push(Z.namePath.value),!(!((w=Z.rules)===null||w===void 0)&&w.value.length))return;const j=Z.namePath.value;if(!N||_o(U,j)){const V=Z.validateRules(T({validateMessages:c.value},I));K.push(V.then(()=>({name:j,errors:[],warnings:[]})).catch(W=>{const G=[],Y=[];return W.forEach(te=>{let{rule:{warningOnly:ne},errors:pe}=te;ne?Y.push(...pe):G.push(...pe)}),G.length?Promise.reject({name:j,errors:G,warnings:Y}):{name:j,errors:G,warnings:Y}}))}});const J=qn(K);s.value=J;const ie=J.then(()=>s.value===J?Promise.resolve(E(U)):Promise.reject([])).catch(Z=>{const w=Z.filter(j=>j&&j.errors.length);return Promise.reject({values:E(U),errorFields:w,outOfDate:s.value!==J})});return ie.catch(Z=>Z),ie},Q=function(){return H(...arguments)},X=A=>{A.preventDefault(),A.stopPropagation(),n("submit",A),e.model&&H().then(N=>{n("finish",N)}).catch(N=>{q(N)})};return i({resetFields:O,clearValidate:P,validateFields:H,getFieldsValue:E,validate:_,scrollToField:L}),Tn({model:C(()=>e.model),name:C(()=>e.name),labelAlign:C(()=>e.labelAlign),labelCol:C(()=>e.labelCol),labelWrap:C(()=>e.labelWrap),wrapperCol:C(()=>e.wrapperCol),vertical:C(()=>e.layout==="vertical"),colon:b,requiredMark:y,validateTrigger:C(()=>e.validateTrigger),rules:C(()=>e.rules),addField:h,removeField:p,onValidate:(A,I,N)=>{n("validate",A,I,N)},validateMessages:c}),ue(()=>e.rules,()=>{e.validateOnRuleChange&&H()}),()=>{var A;return $(R("form",B(B({},a),{},{onSubmit:X,class:[F.value,a.class]}),[(A=r.default)===null||A===void 0?void 0:A.call(r)]))}}});le.useInjectFormItemContext=Or;le.ItemRest=ze;le.install=function(e){return e.component(le.name,le),e.component(le.Item.name,le.Item),e.component(ze.name,ze),e};export{le as F,dl as a,wn as b};