"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7266],{54329:function(e,n,r){r.d(n,{x:function(){return x}});var t,o=r(95235),a=r(8529),i=r(7328),c=r(2784),u=r(54073),l=r.n(u),s=r(17486),f=r(89495),d=r(48840),v=r(2660),p=r(52322);function m(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,t)}return r}function b(e){for(var n=1;n0&&(t.length0&&(T(!1),r.hasOwnProperty("setCustomValidity")&&r.setCustomValidity(n.inner[0].message),e.setIsNotValidated&&e.setIsNotValidated(!0),m(n.inner[0].message))}return!1},25,{leading:!0,trailing:!1}),N=function(e,n,r){try{if("button"===n.type)return!0;return r.validateSync({validator:e},{abortEarly:!1}),!0}catch(e){return!1}},L=function(e,n){return"".concat(null==e?void 0:e.toLowerCase().replace(/\:|\?|\.|\!|\"|\'/g,"").split(" ").join("-"),"-form-item-id").concat(n?"-confirm":"")},I=null!=o&&null!=o.current&&null!=o.current.parentElement?o.current.parentElement.previousElementSibling:null;c.useImperativeHandle(e.bindref,function(){return b(b({},n.props),{},{focus:function(){null!=o&&null!=o.current&&o.current.focus()},validate:function(){return null!=o&&null!=o.current&&V(o.current.value,o.current,P,null!==i.current&&i.current)},value:null!=o&&null!=o.current?o.current.value:"",inView:e.inView||!1,offsetTop:null!=o&&null!=o.current&&null!=I?I.offsetTop-Number(e.offset):0})});var A=function(e,n,r){switch(e){case"MIN_LENGTH":r.minLength=n;break;case"MAX_LENGTH":r.maxLength=n;break;case"REGEX_MATCHES":r.pattern=n}return r},D={};null===(r=n.props.validators)||void 0===r||r.forEach(function(e){return A(e.name,e.argument,D)});var P=(0,s.object)().shape({validator:O(b(b(b({},n.props),D),{},{checkboxes:[]})).label(n.props.label)}),_="".concat(n.props.label,"-error"),Z="".concat(e.i18nText?e.i18nText.confirm:"Confirm","-").concat(n.props.label,"-error");return(0,p.jsxs)(c.Fragment,{children:[(0,p.jsxs)(y,{flexDirection:e.row?"row":"column",disableSpacing:e.disableSpacing,"data-testid":L(n.props.label,!1),className:e.className,children:[c.cloneElement(n,b(b({},n.props),{},{error:d,bindref:o,onChange:n.props.onChange?function(r){var t=V(r.target.value,r.target,P);n.props.onChange&&(n.props.onChange(r),t&&e.onValidationSuccess&&e.onValidationSuccess(r.target.value))}:function(n){var r=n.target;!C&&(V(n.target.value,n.target,P)&&e.onValidationSuccess&&e.onValidationSuccess(r.value),i.current&&E(i.current.value,r.type,e.config)===E(r.value,r.type,e.config)&&x(""))},onBlur:function(n){var r=n.target;C&&(V(r.value,r,P,null!==i.current&&i.current),i.current&&(E(i.current.value,r.type,e.config)===E(r.value,r.type,e.config)||""===i.current.value)&&x("")),N(r.value,r,P)&&e.onValidationSuccess&&e.onValidationSuccess(r.value)},ariaDescribedBy:_})),d&&"boolean"!=typeof d&&(0,p.jsx)(v.B,{id:_,error:d})]}),n.props.confirmable&&(0,p.jsxs)(y,{flexDirection:e.row?"row":"column","data-testid":L(n.props.label,!0),children:[c.cloneElement(n,b(b({},n.props),{},{error:!d&&w,label:j(n.props.label,null===(t=e.i18nText)||void 0===t?void 0:t.confirm,e.locale),helperText:"",bindref:i,onChange:function(){o.current&&i.current&&E(o.current.value,n.props.type,e.config)===E(i.current.value,n.props.type,e.config)&&x("")},onBlur:function(){!d&&o.current&&i.current&&E(o.current.value,n.props.type,e.config)!==E(i.current.value,n.props.type,e.config)&&x("".concat(n.props.label," ").concat(e.i18nText?e.i18nText.mustMatch:"must match"))},ariaDescribedBy:Z})),!d&&w&&(0,p.jsx)(v.B,{id:Z,error:w})]})]})},x=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g;return c.Children.map(e.children,function(n){return w(e,n)})}},9371:function(e,n,r){r.d(n,{F:function(){return u}});var t=r(8529),o=r(2784),a=r(52322);function i(e,n){(null==n||n>e.length)&&(n=e.length);for(var r=0,t=Array(n);r=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:o}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,c=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return c=e.done,e},e:function(e){u=!0,a=e},f:function(){try{c||null==r.return||r.return()}finally{if(u)throw a}}}}(m);try{for(a.s();!(o=a.n()).done;){var c,u=o.value;if(u.fields.includes(r)){t=(null===(c=w[u.dependsOn])||void 0===c||null===(c=c.current)||void 0===c?void 0:c.value)!==u.validateWhen;break}}}catch(e){a.e(e)}finally{a.f()}}t||w[r].current.validate()||(n=!1,e[r]=w[r])}return e},{}));var r={};Object.keys(w).forEach(function(e){null!==w[e]&&null!==w[e].current&&(r[e]="true"===w[e].current.value||"false"===w[e].current.value?"true"===w[e].current.value:w[e].current.value)}),n?v(r):p&&v(r,!0),V.current=e}},[w,v,p]);var N=r.map(function(e){return(0,a.jsx)(c,{field:e,refs:b},e.fieldName)});return(0,a.jsxs)("form",{noValidate:!0,method:"POST",onSubmit:function(e){e.preventDefault(),x(b)},id:n,children:[u&&(0,a.jsx)("input",{type:"hidden",name:"_csrf",value:u}),(0,a.jsxs)(o.Fragment,{children:[s&&s("assertive",C),N,l]})]})}}}]); //# sourceMappingURL=7266-ae1c412f98740b19.js.map