var e=require("react-hook-form"),r=function(r,t,i){if(r&&"reportValidity"in r){var a=e.get(i,t);r.setCustomValidity(a&&a.message||""),r.reportValidity()}},t=function(e,t){var i=function(i){var a=t.fields[i];a&&a.ref&&"reportValidity"in a.ref?r(a.ref,i,e):a&&a.refs&&a.refs.forEach(function(t){return r(t,i,e)})};for(var a in t.fields)i(a)},i=function(e,r){var t=a(r).replace(/[.*+?^${}()|\\]/g,"\\$&");return e.some(function(e){return a(e).match("^"+t+"\\.\\d+")})};function a(e){return e.replace(/[\[\]]/g,"")}exports.toNestErrors=function(r,a){a.shouldUseNativeValidation&&t(r,a);var n={};for(var o in r){var s=e.get(a.fields,o),f=Object.assign(r[o]||{},{ref:s&&s.ref});if(i(a.names||Object.keys(r),o)){var c=Object.assign({},e.get(n,o));e.set(c,"root",f),e.set(n,o,c)}else e.set(n,o,f)}return n},exports.validateFieldsNatively=t;
//# sourceMappingURL=resolvers.js.map
