(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[7751],{64893:function(_e,Ne,u){"use strict";u.d(Ne,{G:function(){return w}});var g=u(96156),me=u(28481),y=u(28991),q=u(81253),ee=u(85893),R=["colon","dependencies","extra","getValueFromEvent","getValueProps","hasFeedback","help","htmlFor","initialValue","noStyle","label","labelAlign","labelCol","name","preserve","normalize","required","rules","shouldUpdate","trigger","validateFirst","validateStatus","validateTrigger","valuePropName","wrapperCol","hidden","addonBefore","addonAfter"];function M(se){var j={};return R.forEach(function(te){se[te]!==void 0&&(j[te]=se[te])}),j}var ge=u(51812),_=u(26369),F=u(60249),Pe=u(94184),he=u.n(Pe),d=u(80230),H=u(80334),O=u(67294),N=u(30939),ue=u(82785),A=u(97462),De=u(66758),ae=u(2514),be=["valueType","customLightMode","lightFilterLabelFormatter","valuePropName","ignoreWidth","defaultProps"],ie=["label","tooltip","placeholder","width","bordered","messageVariables","ignoreFormItem","transform","convertValue","readonly","allowClear","colSize","getFormItemProps","getFieldProps","filedConfig","cacheForSwr","proFieldProps"],Te=Symbol("ProFormComponent"),Ve={xs:104,s:216,sm:216,m:328,md:328,l:440,lg:440,xl:552},de=["switch","radioButton","radio","rate"];function w(se,j){se.displayName="ProFormComponent";var te=function(W){var Y=(0,y.Z)((0,y.Z)({},W==null?void 0:W.filedConfig),j)||{},$e=Y.valueType,pe=Y.customLightMode,Q=Y.lightFilterLabelFormatter,C=Y.valuePropName,K=C===void 0?"value":C,L=Y.ignoreWidth,T=Y.defaultProps,I=(0,q.Z)(Y,be),D=(0,y.Z)((0,y.Z)({},T),W),X=D.label,Ae=D.tooltip,we=D.placeholder,ye=D.width,Ue=D.bordered,He=D.messageVariables,re=D.ignoreFormItem,Xe=D.transform,je=D.convertValue,Ye=D.readonly,Ke=D.allowClear,at=D.colSize,Ce=D.getFormItemProps,Ee=D.getFieldProps,it=D.filedConfig,ze=D.cacheForSwr,ne=D.proFieldProps,z=(0,q.Z)(D,ie),Fe=$e||z.valueType,Je=(0,O.useMemo)(function(){return L||de.includes(Fe)},[L,Fe]),st=(0,O.useState)(),ce=(0,me.Z)(st,2),et=ce[1],Qe=(0,O.useState)(),tt=(0,me.Z)(Qe,2),rt=tt[0],nt=tt[1],Ie=O.useContext(De.Z),Ge=(0,O.useMemo)(function(){return{formItemProps:Ce==null?void 0:Ce(),fieldProps:Ee==null?void 0:Ee()}},[Ee,Ce,z.dependenciesValues,rt]),$=(0,O.useMemo)(function(){var n=(0,y.Z)((0,y.Z)((0,y.Z)((0,y.Z)({},re?(0,ge.Z)({value:z.value}):{}),{},{placeholder:we,disabled:W.disabled},Ie.fieldProps),Ge.fieldProps),z.fieldProps);return n.style=(0,ge.Z)(n==null?void 0:n.style),n},[re,z.value,z.fieldProps,we,W.disabled,Ie.fieldProps,Ge.fieldProps]),Me=M(z),We=(0,O.useMemo)(function(){return(0,y.Z)((0,y.Z)((0,y.Z)((0,y.Z)({},Ie.formItemProps),Me),Ge.formItemProps),z.formItemProps)},[Ge.formItemProps,Ie.formItemProps,z.formItemProps,Me]),Ze=(0,O.useMemo)(function(){return(0,y.Z)((0,y.Z)({messageVariables:He},I),We)},[I,We,He]);(0,H.ET)(!z.defaultValue,"\u8BF7\u4E0D\u8981\u5728 Form \u4E2D\u4F7F\u7528 defaultXXX\u3002\u5982\u679C\u9700\u8981\u9ED8\u8BA4\u503C\u8BF7\u4F7F\u7528 initialValues \u548C initialValue\u3002");var lt=(0,O.useContext)(d.zb),Be=lt.prefixName,ut=(0,O.useMemo)(function(){var n,v=Ze==null?void 0:Ze.name;Array.isArray(v)&&(v=v.join("_")),Array.isArray(Be)&&v&&(v="".concat(Be.join("."),".").concat(v));var m=v&&"form-".concat((n=Ie.formKey)!==null&&n!==void 0?n:"","-field-").concat(v);return m},[(0,N.P)(Ze==null?void 0:Ze.name),Be,Ie.formKey]),c=(0,_.Z)(z),l=(0,O.useCallback)(function(){var n;Ce||Ee?nt([]):z.renderFormItem&&et([]);for(var v=arguments.length,m=new Array(v),V=0;V2&&arguments[2]!==void 0?arguments[2]:!1;return c&&c.some(function(r){return Ae(l,r,t)})}function Ae(c,l){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return!c||!l||!t&&c.length!==l.length?!1:l.every(function(r,e){return c[e]===r})}function we(c,l){if(c===l)return!0;if(!c&&l||c&&!l||!c||!l||(0,L.Z)(c)!=="object"||(0,L.Z)(l)!=="object")return!1;var t=Object.keys(c),r=Object.keys(l),e=new Set([].concat(t,r));return(0,M.Z)(e).every(function(a){var i=c[a],f=l[a];return typeof i=="function"&&typeof f=="function"?!0:i===f})}function ye(c){var l=arguments.length<=1?void 0:arguments[1];return l&&l.target&&(0,L.Z)(l.target)==="object"&&c in l.target?l.target[c]:l}function Ue(c,l,t){var r=c.length;if(l<0||l>=r||t<0||t>=r)return c;var e=c[l],a=l-t;return a>0?[].concat((0,M.Z)(c.slice(0,t)),[e],(0,M.Z)(c.slice(t,l)),(0,M.Z)(c.slice(l+1,r))):a<0?[].concat((0,M.Z)(c.slice(0,l)),(0,M.Z)(c.slice(l+1,t+1)),[e],(0,M.Z)(c.slice(t+1,r))):c}var He=["name"],re=[];function Xe(c,l,t,r,e,a){return typeof c=="function"?c(l,t,"source"in a?{source:a.source}:{}):r!==e}var je=function(c){(0,Pe.Z)(t,c);var l=(0,he.Z)(t);function t(r){var e;if((0,ge.Z)(this,t),e=l.call(this,r),(0,d.Z)((0,F.Z)(e),"state",{resetCount:0}),(0,d.Z)((0,F.Z)(e),"cancelRegisterFunc",null),(0,d.Z)((0,F.Z)(e),"mounted",!1),(0,d.Z)((0,F.Z)(e),"touched",!1),(0,d.Z)((0,F.Z)(e),"dirty",!1),(0,d.Z)((0,F.Z)(e),"validatePromise",void 0),(0,d.Z)((0,F.Z)(e),"prevValidating",void 0),(0,d.Z)((0,F.Z)(e),"errors",re),(0,d.Z)((0,F.Z)(e),"warnings",re),(0,d.Z)((0,F.Z)(e),"cancelRegister",function(){var o=e.props,s=o.preserve,n=o.isListField,v=o.name;e.cancelRegisterFunc&&e.cancelRegisterFunc(n,s,I(v)),e.cancelRegisterFunc=null}),(0,d.Z)((0,F.Z)(e),"getNamePath",function(){var o=e.props,s=o.name,n=o.fieldContext,v=n.prefixName,m=v===void 0?[]:v;return s!==void 0?[].concat((0,M.Z)(m),(0,M.Z)(s)):[]}),(0,d.Z)((0,F.Z)(e),"getRules",function(){var o=e.props,s=o.rules,n=s===void 0?[]:s,v=o.fieldContext;return n.map(function(m){return typeof m=="function"?m(v):m})}),(0,d.Z)((0,F.Z)(e),"refresh",function(){!e.mounted||e.setState(function(o){var s=o.resetCount;return{resetCount:s+1}})}),(0,d.Z)((0,F.Z)(e),"metaCache",null),(0,d.Z)((0,F.Z)(e),"triggerMetaEvent",function(o){var s=e.props.onMetaChange;if(s){var n=(0,R.Z)((0,R.Z)({},e.getMeta()),{},{destroy:o});(0,O.Z)(e.metaCache,n)||s(n),e.metaCache=n}else e.metaCache=null}),(0,d.Z)((0,F.Z)(e),"onStoreChange",function(o,s,n){var v=e.props,m=v.shouldUpdate,V=v.dependencies,x=V===void 0?[]:V,Z=v.onReset,p=n.store,P=e.getNamePath(),h=e.getValue(o),E=e.getValue(p),G=s&&X(s,P);switch(n.type==="valueUpdate"&&n.source==="external"&&!(0,O.Z)(h,E)&&(e.touched=!0,e.dirty=!0,e.validatePromise=null,e.errors=re,e.warnings=re,e.triggerMetaEvent()),n.type){case"reset":if(!s||G){e.touched=!1,e.dirty=!1,e.validatePromise=void 0,e.errors=re,e.warnings=re,e.triggerMetaEvent(),Z==null||Z(),e.refresh();return}break;case"remove":{if(m){e.reRender();return}break}case"setField":{var B=n.data;if(G){"touched"in B&&(e.touched=B.touched),"validating"in B&&!("originRCField"in B)&&(e.validatePromise=B.validating?Promise.resolve([]):null),"errors"in B&&(e.errors=B.errors||re),"warnings"in B&&(e.warnings=B.warnings||re),e.dirty=!0,e.triggerMetaEvent(),e.reRender();return}else if("value"in B&&X(s,P,!0)){e.reRender();return}if(m&&!P.length&&Xe(m,o,p,h,E,n)){e.reRender();return}break}case"dependenciesUpdate":{var k=x.map(I);if(k.some(function(U){return X(n.relatedFields,U)})){e.reRender();return}break}default:if(G||(!x.length||P.length||m)&&Xe(m,o,p,h,E,n)){e.reRender();return}break}m===!0&&e.reRender()}),(0,d.Z)((0,F.Z)(e),"validateRules",function(o){var s=e.getNamePath(),n=e.getValue(),v=o||{},m=v.triggerName,V=v.validateOnly,x=V===void 0?!1:V,Z=Promise.resolve().then((0,ee.Z)((0,q.Z)().mark(function p(){var P,h,E,G,B,k,U;return(0,q.Z)().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:if(e.mounted){b.next=2;break}return b.abrupt("return",[]);case 2:if(P=e.props,h=P.validateFirst,E=h===void 0?!1:h,G=P.messageVariables,B=P.validateDebounce,k=e.getRules(),m&&(k=k.filter(function(S){return S}).filter(function(S){var J=S.validateTrigger;if(!J)return!0;var oe=Te(J);return oe.includes(m)})),!(B&&m)){b.next=10;break}return b.next=8,new Promise(function(S){setTimeout(S,B)});case 8:if(e.validatePromise===Z){b.next=10;break}return b.abrupt("return",[]);case 10:return U=$e(s,n,k,o,E,G),U.catch(function(S){return S}).then(function(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:re;if(e.validatePromise===Z){var J;e.validatePromise=null;var oe=[],fe=[];(J=S.forEach)===null||J===void 0||J.call(S,function(le){var Se=le.rule.warningOnly,Oe=le.errors,ke=Oe===void 0?re:Oe;Se?fe.push.apply(fe,(0,M.Z)(ke)):oe.push.apply(oe,(0,M.Z)(ke))}),e.errors=oe,e.warnings=fe,e.triggerMetaEvent(),e.reRender()}}),b.abrupt("return",U);case 13:case"end":return b.stop()}},p)})));return x||(e.validatePromise=Z,e.dirty=!0,e.errors=re,e.warnings=re,e.triggerMetaEvent(),e.reRender()),Z}),(0,d.Z)((0,F.Z)(e),"isFieldValidating",function(){return!!e.validatePromise}),(0,d.Z)((0,F.Z)(e),"isFieldTouched",function(){return e.touched}),(0,d.Z)((0,F.Z)(e),"isFieldDirty",function(){if(e.dirty||e.props.initialValue!==void 0)return!0;var o=e.props.fieldContext,s=o.getInternalHooks(ue),n=s.getInitialValue;return n(e.getNamePath())!==void 0}),(0,d.Z)((0,F.Z)(e),"getErrors",function(){return e.errors}),(0,d.Z)((0,F.Z)(e),"getWarnings",function(){return e.warnings}),(0,d.Z)((0,F.Z)(e),"isListField",function(){return e.props.isListField}),(0,d.Z)((0,F.Z)(e),"isList",function(){return e.props.isList}),(0,d.Z)((0,F.Z)(e),"isPreserve",function(){return e.props.preserve}),(0,d.Z)((0,F.Z)(e),"getMeta",function(){e.prevValidating=e.isFieldValidating();var o={touched:e.isFieldTouched(),validating:e.prevValidating,errors:e.errors,warnings:e.warnings,name:e.getNamePath(),validated:e.validatePromise===null};return o}),(0,d.Z)((0,F.Z)(e),"getOnlyChild",function(o){if(typeof o=="function"){var s=e.getMeta();return(0,R.Z)((0,R.Z)({},e.getOnlyChild(o(e.getControlled(),s,e.props.fieldContext))),{},{isFunction:!0})}var n=(0,H.Z)(o);return n.length!==1||!g.isValidElement(n[0])?{child:n,isFunction:!1}:{child:n[0],isFunction:!1}}),(0,d.Z)((0,F.Z)(e),"getValue",function(o){var s=e.props.fieldContext.getFieldsValue,n=e.getNamePath();return(0,T.Z)(o||s(!0),n)}),(0,d.Z)((0,F.Z)(e),"getControlled",function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=e.props,n=s.name,v=s.trigger,m=s.validateTrigger,V=s.getValueFromEvent,x=s.normalize,Z=s.valuePropName,p=s.getValueProps,P=s.fieldContext,h=m!==void 0?m:P.validateTrigger,E=e.getNamePath(),G=P.getInternalHooks,B=P.getFieldsValue,k=G(ue),U=k.dispatch,ve=e.getValue(),b=p||function(le){return(0,d.Z)({},Z,le)},S=o[v],J=n!==void 0?b(ve):{},oe=(0,R.Z)((0,R.Z)({},o),J);oe[v]=function(){e.touched=!0,e.dirty=!0,e.triggerMetaEvent();for(var le,Se=arguments.length,Oe=new Array(Se),ke=0;ke=0&&S<=J.length?(n.keys=[].concat((0,M.Z)(n.keys.slice(0,S)),[n.id],(0,M.Z)(n.keys.slice(S))),E([].concat((0,M.Z)(J.slice(0,S)),[b],(0,M.Z)(J.slice(S))))):(n.keys=[].concat((0,M.Z)(n.keys),[n.id]),E([].concat((0,M.Z)(J),[b]))),n.id+=1},remove:function(b){var S=B(),J=new Set(Array.isArray(b)?b:[b]);J.size<=0||(n.keys=n.keys.filter(function(oe,fe){return!J.has(fe)}),E(S.filter(function(oe,fe){return!J.has(fe)})))},move:function(b,S){if(b!==S){var J=B();b<0||b>=J.length||S<0||S>=J.length||(n.keys=Ue(n.keys,b,S),E(Ue(J,b,S)))}}},U=h||[];return Array.isArray(U)||(U=[]),r(U.map(function(ve,b){var S=n.keys[b];return S===void 0&&(n.keys[b]=n.id,S=n.keys[b],n.id+=1),{name:b,key:S,isListField:!0}}),k,p)})))}var Ce=at,Ee=u(28481);function it(c){var l=!1,t=c.length,r=[];return c.length?new Promise(function(e,a){c.forEach(function(i,f){i.catch(function(o){return l=!0,o}).then(function(o){t-=1,r[f]=o,!(t>0)&&(l&&a(r),e(r))})})}):Promise.resolve([])}var ze="__@field_split__";function ne(c){return c.map(function(l){return"".concat((0,L.Z)(l),":").concat(l)}).join(ze)}var z=function(){function c(){(0,ge.Z)(this,c),(0,d.Z)(this,"kvs",new Map)}return(0,_.Z)(c,[{key:"set",value:function(t,r){this.kvs.set(ne(t),r)}},{key:"get",value:function(t){return this.kvs.get(ne(t))}},{key:"update",value:function(t,r){var e=this.get(t),a=r(e);a?this.set(t,a):this.delete(t)}},{key:"delete",value:function(t){this.kvs.delete(ne(t))}},{key:"map",value:function(t){return(0,M.Z)(this.kvs.entries()).map(function(r){var e=(0,Ee.Z)(r,2),a=e[0],i=e[1],f=a.split(ze);return t({key:f.map(function(o){var s=o.match(/^([^:]*):(.*)$/),n=(0,Ee.Z)(s,3),v=n[1],m=n[2];return v==="number"?Number(m):m}),value:i})})}},{key:"toJSON",value:function(){var t={};return this.map(function(r){var e=r.key,a=r.value;return t[e.join(".")]=a,null}),t}}]),c}(),Fe=z,Je=["name"],st=(0,_.Z)(function c(l){var t=this;(0,ge.Z)(this,c),(0,d.Z)(this,"formHooked",!1),(0,d.Z)(this,"forceRootUpdate",void 0),(0,d.Z)(this,"subscribable",!0),(0,d.Z)(this,"store",{}),(0,d.Z)(this,"fieldEntities",[]),(0,d.Z)(this,"initialValues",{}),(0,d.Z)(this,"callbacks",{}),(0,d.Z)(this,"validateMessages",null),(0,d.Z)(this,"preserve",null),(0,d.Z)(this,"lastValidatePromise",null),(0,d.Z)(this,"getForm",function(){return{getFieldValue:t.getFieldValue,getFieldsValue:t.getFieldsValue,getFieldError:t.getFieldError,getFieldWarning:t.getFieldWarning,getFieldsError:t.getFieldsError,isFieldsTouched:t.isFieldsTouched,isFieldTouched:t.isFieldTouched,isFieldValidating:t.isFieldValidating,isFieldsValidating:t.isFieldsValidating,resetFields:t.resetFields,setFields:t.setFields,setFieldValue:t.setFieldValue,setFieldsValue:t.setFieldsValue,validateFields:t.validateFields,submit:t.submit,_init:!0,getInternalHooks:t.getInternalHooks}}),(0,d.Z)(this,"getInternalHooks",function(r){return r===ue?(t.formHooked=!0,{dispatch:t.dispatch,initEntityValue:t.initEntityValue,registerField:t.registerField,useSubscribe:t.useSubscribe,setInitialValues:t.setInitialValues,destroyForm:t.destroyForm,setCallbacks:t.setCallbacks,setValidateMessages:t.setValidateMessages,getFields:t.getFields,setPreserve:t.setPreserve,getInitialValue:t.getInitialValue,registerWatch:t.registerWatch}):((0,N.ZP)(!1,"`getInternalHooks` is internal usage. Should not call directly."),null)}),(0,d.Z)(this,"useSubscribe",function(r){t.subscribable=r}),(0,d.Z)(this,"prevWithoutPreserves",null),(0,d.Z)(this,"setInitialValues",function(r,e){if(t.initialValues=r||{},e){var a,i=(0,j.T)(r,t.store);(a=t.prevWithoutPreserves)===null||a===void 0||a.map(function(f){var o=f.key;i=(0,j.Z)(i,o,(0,T.Z)(r,o))}),t.prevWithoutPreserves=null,t.updateStore(i)}}),(0,d.Z)(this,"destroyForm",function(){var r=new Fe;t.getFieldEntities(!0).forEach(function(e){t.isMergedPreserve(e.isPreserve())||r.set(e.getNamePath(),!0)}),t.prevWithoutPreserves=r}),(0,d.Z)(this,"getInitialValue",function(r){var e=(0,T.Z)(t.initialValues,r);return r.length?(0,j.T)(e):e}),(0,d.Z)(this,"setCallbacks",function(r){t.callbacks=r}),(0,d.Z)(this,"setValidateMessages",function(r){t.validateMessages=r}),(0,d.Z)(this,"setPreserve",function(r){t.preserve=r}),(0,d.Z)(this,"watchList",[]),(0,d.Z)(this,"registerWatch",function(r){return t.watchList.push(r),function(){t.watchList=t.watchList.filter(function(e){return e!==r})}}),(0,d.Z)(this,"notifyWatch",function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];if(t.watchList.length){var e=t.getFieldsValue(),a=t.getFieldsValue(!0);t.watchList.forEach(function(i){i(e,a,r)})}}),(0,d.Z)(this,"timeoutId",null),(0,d.Z)(this,"warningUnhooked",function(){}),(0,d.Z)(this,"updateStore",function(r){t.store=r}),(0,d.Z)(this,"getFieldEntities",function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return r?t.fieldEntities.filter(function(e){return e.getNamePath().length}):t.fieldEntities}),(0,d.Z)(this,"getFieldsMap",function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=new Fe;return t.getFieldEntities(r).forEach(function(a){var i=a.getNamePath();e.set(i,a)}),e}),(0,d.Z)(this,"getFieldEntitiesForNamePathList",function(r){if(!r)return t.getFieldEntities(!0);var e=t.getFieldsMap(!0);return r.map(function(a){var i=I(a);return e.get(i)||{INVALIDATE_NAME_PATH:I(a)}})}),(0,d.Z)(this,"getFieldsValue",function(r,e){t.warningUnhooked();var a,i,f;if(r===!0||Array.isArray(r)?(a=r,i=e):r&&(0,L.Z)(r)==="object"&&(f=r.strict,i=r.filter),a===!0&&!i)return t.store;var o=t.getFieldEntitiesForNamePathList(Array.isArray(a)?a:null),s=[];return o.forEach(function(n){var v,m,V="INVALIDATE_NAME_PATH"in n?n.INVALIDATE_NAME_PATH:n.getNamePath();if(f){var x,Z;if((x=(Z=n).isList)!==null&&x!==void 0&&x.call(Z))return}else if(!a&&(v=(m=n).isListField)!==null&&v!==void 0&&v.call(m))return;if(!i)s.push(V);else{var p="getMeta"in n?n.getMeta():null;i(p)&&s.push(V)}}),D(t.store,s.map(I))}),(0,d.Z)(this,"getFieldValue",function(r){t.warningUnhooked();var e=I(r);return(0,T.Z)(t.store,e)}),(0,d.Z)(this,"getFieldsError",function(r){t.warningUnhooked();var e=t.getFieldEntitiesForNamePathList(r);return e.map(function(a,i){return a&&!("INVALIDATE_NAME_PATH"in a)?{name:a.getNamePath(),errors:a.getErrors(),warnings:a.getWarnings()}:{name:I(r[i]),errors:[],warnings:[]}})}),(0,d.Z)(this,"getFieldError",function(r){t.warningUnhooked();var e=I(r),a=t.getFieldsError([e])[0];return a.errors}),(0,d.Z)(this,"getFieldWarning",function(r){t.warningUnhooked();var e=I(r),a=t.getFieldsError([e])[0];return a.warnings}),(0,d.Z)(this,"isFieldsTouched",function(){t.warningUnhooked();for(var r=arguments.length,e=new Array(r),a=0;a0&&arguments[0]!==void 0?arguments[0]:{},e=new Fe,a=t.getFieldEntities(!0);a.forEach(function(o){var s=o.props.initialValue,n=o.getNamePath();if(s!==void 0){var v=e.get(n)||new Set;v.add({entity:o,value:s}),e.set(n,v)}});var i=function(s){s.forEach(function(n){var v=n.props.initialValue;if(v!==void 0){var m=n.getNamePath(),V=t.getInitialValue(m);if(V!==void 0)(0,N.ZP)(!1,"Form already set 'initialValues' with path '".concat(m.join("."),"'. Field can not overwrite it."));else{var x=e.get(m);if(x&&x.size>1)(0,N.ZP)(!1,"Multiple Field with path '".concat(m.join("."),"' set 'initialValue'. Can not decide which one to pick."));else if(x){var Z=t.getFieldValue(m),p=n.isListField();!p&&(!r.skipExist||Z===void 0)&&t.updateStore((0,j.Z)(t.store,m,(0,M.Z)(x)[0].value))}}}})},f;r.entities?f=r.entities:r.namePathList?(f=[],r.namePathList.forEach(function(o){var s=e.get(o);if(s){var n;(n=f).push.apply(n,(0,M.Z)((0,M.Z)(s).map(function(v){return v.entity})))}})):f=a,i(f)}),(0,d.Z)(this,"resetFields",function(r){t.warningUnhooked();var e=t.store;if(!r){t.updateStore((0,j.T)(t.initialValues)),t.resetWithFieldInitialValue(),t.notifyObservers(e,null,{type:"reset"}),t.notifyWatch();return}var a=r.map(I);a.forEach(function(i){var f=t.getInitialValue(i);t.updateStore((0,j.Z)(t.store,i,f))}),t.resetWithFieldInitialValue({namePathList:a}),t.notifyObservers(e,a,{type:"reset"}),t.notifyWatch(a)}),(0,d.Z)(this,"setFields",function(r){t.warningUnhooked();var e=t.store,a=[];r.forEach(function(i){var f=i.name,o=(0,y.Z)(i,Je),s=I(f);a.push(s),"value"in o&&t.updateStore((0,j.Z)(t.store,s,o.value)),t.notifyObservers(e,[s],{type:"setField",data:i})}),t.notifyWatch(a)}),(0,d.Z)(this,"getFields",function(){var r=t.getFieldEntities(!0),e=r.map(function(a){var i=a.getNamePath(),f=a.getMeta(),o=(0,R.Z)((0,R.Z)({},f),{},{name:i,value:t.getFieldValue(i)});return Object.defineProperty(o,"originRCField",{value:!0}),o});return e}),(0,d.Z)(this,"initEntityValue",function(r){var e=r.props.initialValue;if(e!==void 0){var a=r.getNamePath(),i=(0,T.Z)(t.store,a);i===void 0&&t.updateStore((0,j.Z)(t.store,a,e))}}),(0,d.Z)(this,"isMergedPreserve",function(r){var e=r!==void 0?r:t.preserve;return e!=null?e:!0}),(0,d.Z)(this,"registerField",function(r){t.fieldEntities.push(r);var e=r.getNamePath();if(t.notifyWatch([e]),r.props.initialValue!==void 0){var a=t.store;t.resetWithFieldInitialValue({entities:[r],skipExist:!0}),t.notifyObservers(a,[r.getNamePath()],{type:"valueUpdate",source:"internal"})}return function(i,f){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(t.fieldEntities=t.fieldEntities.filter(function(v){return v!==r}),!t.isMergedPreserve(f)&&(!i||o.length>1)){var s=i?void 0:t.getInitialValue(e);if(e.length&&t.getFieldValue(e)!==s&&t.fieldEntities.every(function(v){return!Ae(v.getNamePath(),e)})){var n=t.store;t.updateStore((0,j.Z)(n,e,s,!0)),t.notifyObservers(n,[e],{type:"remove"}),t.triggerDependenciesUpdate(n,e)}}t.notifyWatch([e])}}),(0,d.Z)(this,"dispatch",function(r){switch(r.type){case"updateValue":{var e=r.namePath,a=r.value;t.updateValue(e,a);break}case"validateField":{var i=r.namePath,f=r.triggerName;t.validateFields([i],{triggerName:f});break}default:}}),(0,d.Z)(this,"notifyObservers",function(r,e,a){if(t.subscribable){var i=(0,R.Z)((0,R.Z)({},a),{},{store:t.getFieldsValue(!0)});t.getFieldEntities().forEach(function(f){var o=f.onStoreChange;o(r,e,i)})}else t.forceRootUpdate()}),(0,d.Z)(this,"triggerDependenciesUpdate",function(r,e){var a=t.getDependencyChildrenFields(e);return a.length&&t.validateFields(a),t.notifyObservers(r,a,{type:"dependenciesUpdate",relatedFields:[e].concat((0,M.Z)(a))}),a}),(0,d.Z)(this,"updateValue",function(r,e){var a=I(r),i=t.store;t.updateStore((0,j.Z)(t.store,a,e)),t.notifyObservers(i,[a],{type:"valueUpdate",source:"internal"}),t.notifyWatch([a]);var f=t.triggerDependenciesUpdate(i,a),o=t.callbacks.onValuesChange;if(o){var s=D(t.store,[a]);o(s,t.getFieldsValue())}t.triggerOnFieldsChange([a].concat((0,M.Z)(f)))}),(0,d.Z)(this,"setFieldsValue",function(r){t.warningUnhooked();var e=t.store;if(r){var a=(0,j.T)(t.store,r);t.updateStore(a)}t.notifyObservers(e,null,{type:"valueUpdate",source:"external"}),t.notifyWatch()}),(0,d.Z)(this,"setFieldValue",function(r,e){t.setFields([{name:r,value:e}])}),(0,d.Z)(this,"getDependencyChildrenFields",function(r){var e=new Set,a=[],i=new Fe;t.getFieldEntities().forEach(function(o){var s=o.props.dependencies;(s||[]).forEach(function(n){var v=I(n);i.update(v,function(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Set;return m.add(o),m})})});var f=function o(s){var n=i.get(s)||new Set;n.forEach(function(v){if(!e.has(v)){e.add(v);var m=v.getNamePath();v.isFieldDirty()&&m.length&&(a.push(m),o(m))}})};return f(r),a}),(0,d.Z)(this,"triggerOnFieldsChange",function(r,e){var a=t.callbacks.onFieldsChange;if(a){var i=t.getFields();if(e){var f=new Fe;e.forEach(function(s){var n=s.name,v=s.errors;f.set(n,v)}),i.forEach(function(s){s.errors=f.get(s.name)||s.errors})}var o=i.filter(function(s){var n=s.name;return X(r,n)});o.length&&a(o,i)}}),(0,d.Z)(this,"validateFields",function(r,e){t.warningUnhooked();var a,i;Array.isArray(r)||typeof r=="string"||typeof e=="string"?(a=r,i=e):i=r;var f=!!a,o=f?a.map(I):[],s=[],n=String(Date.now()),v=new Set,m=i||{},V=m.recursive,x=m.dirty;t.getFieldEntities(!0).forEach(function(h){if(f||o.push(h.getNamePath()),!(!h.props.rules||!h.props.rules.length)&&!(x&&!h.isFieldDirty())){var E=h.getNamePath();if(v.add(E.join(n)),!f||X(o,E,V)){var G=h.validateRules((0,R.Z)({validateMessages:(0,R.Z)((0,R.Z)({},se),t.validateMessages)},i));s.push(G.then(function(){return{name:E,errors:[],warnings:[]}}).catch(function(B){var k,U=[],ve=[];return(k=B.forEach)===null||k===void 0||k.call(B,function(b){var S=b.rule.warningOnly,J=b.errors;S?ve.push.apply(ve,(0,M.Z)(J)):U.push.apply(U,(0,M.Z)(J))}),U.length?Promise.reject({name:E,errors:U,warnings:ve}):{name:E,errors:U,warnings:ve}}))}}});var Z=it(s);t.lastValidatePromise=Z,Z.catch(function(h){return h}).then(function(h){var E=h.map(function(G){var B=G.name;return B});t.notifyObservers(t.store,E,{type:"validateFinish"}),t.triggerOnFieldsChange(E,h)});var p=Z.then(function(){return t.lastValidatePromise===Z?Promise.resolve(t.getFieldsValue(o)):Promise.reject([])}).catch(function(h){var E=h.filter(function(G){return G&&G.errors.length});return Promise.reject({values:t.getFieldsValue(o),errorFields:E,outOfDate:t.lastValidatePromise!==Z})});p.catch(function(h){return h});var P=o.filter(function(h){return v.has(h.join(n))});return t.triggerOnFieldsChange(P),p}),(0,d.Z)(this,"submit",function(){t.warningUnhooked(),t.validateFields().then(function(r){var e=t.callbacks.onFinish;if(e)try{e(r)}catch(a){console.error(a)}}).catch(function(r){var e=t.callbacks.onFinishFailed;e&&e(r)})}),this.forceRootUpdate=l});function ce(c){var l=g.useRef(),t=g.useState({}),r=(0,Ee.Z)(t,2),e=r[1];if(!l.current)if(c)l.current=c;else{var a=function(){e({})},i=new st(a);l.current=i.getForm()}return[l.current]}var et=ce,Qe=g.createContext({triggerFormChange:function(){},triggerFormFinish:function(){},registerForm:function(){},unregisterForm:function(){}}),tt=function(l){var t=l.validateMessages,r=l.onFormChange,e=l.onFormFinish,a=l.children,i=g.useContext(Qe),f=g.useRef({});return g.createElement(Qe.Provider,{value:(0,R.Z)((0,R.Z)({},i),{},{validateMessages:(0,R.Z)((0,R.Z)({},i.validateMessages),t),triggerFormChange:function(s,n){r&&r(s,{changedFields:n,forms:f.current}),i.triggerFormChange(s,n)},triggerFormFinish:function(s,n){e&&e(s,{values:n,forms:f.current}),i.triggerFormFinish(s,n)},registerForm:function(s,n){s&&(f.current=(0,R.Z)((0,R.Z)({},f.current),{},(0,d.Z)({},s,n))),i.registerForm(s,n)},unregisterForm:function(s){var n=(0,R.Z)({},f.current);delete n[s],f.current=n,i.unregisterForm(s)}})},a)},rt=Qe,nt=["name","initialValues","fields","form","preserve","children","component","validateMessages","validateTrigger","onValuesChange","onFieldsChange","onFinish","onFinishFailed"],Ie=function(l,t){var r=l.name,e=l.initialValues,a=l.fields,i=l.form,f=l.preserve,o=l.children,s=l.component,n=s===void 0?"form":s,v=l.validateMessages,m=l.validateTrigger,V=m===void 0?"onChange":m,x=l.onValuesChange,Z=l.onFieldsChange,p=l.onFinish,P=l.onFinishFailed,h=(0,y.Z)(l,nt),E=g.useContext(rt),G=et(i),B=(0,Ee.Z)(G,1),k=B[0],U=k.getInternalHooks(ue),ve=U.useSubscribe,b=U.setInitialValues,S=U.setCallbacks,J=U.setValidateMessages,oe=U.setPreserve,fe=U.destroyForm;g.useImperativeHandle(t,function(){return k}),g.useEffect(function(){return E.registerForm(r,k),function(){E.unregisterForm(r)}},[E,k,r]),J((0,R.Z)((0,R.Z)({},E.validateMessages),v)),S({onValuesChange:x,onFieldsChange:function(Le){if(E.triggerFormChange(r,Le),Z){for(var qe=arguments.length,ft=new Array(qe>1?qe-1:0),ot=1;ot