import{toNestErrors as r,validateFieldsNatively as e}from"@hookform/resolvers";import{appendErrors as t}from"react-hook-form";function n(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}function o(o,a,i){return void 0===i&&(i={}),function(a,s,u){try{var l=function(){if(c.issues){var o=function(r,e){for(var o,a=Object.assign([],r),i=Object.create(null),s=function(r){var e="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(e)return(e=e.call(r)).next.bind(e);if(Array.isArray(r)||(e=function(r,e){if(r){if("string"==typeof r)return n(r,e);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?n(r,e):void 0}}(r))){e&&(r=e);var t=0;return function(){return t>=r.length?{done:!0}:{done:!1,value:r[t++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(a);!(o=s()).done;){var u=o.value;if(u.path){var l=u.path.join(".");if(i[l]||(i[l]={message:u.message,type:""}),e){var c=i[l].types,f=c&&c[""];i[l]=t(l,e,i,"",f?[].concat(f,u.message):u.message)}}}return i}(c.issues,!u.shouldUseNativeValidation&&"all"===u.criteriaMode);return{values:{},errors:r(o,u)}}return u.shouldUseNativeValidation&&e({},u),{values:i.raw?Object.assign({},a):c.value,errors:{}}},c=o["~standard"].validate(a),f=function(){if(c instanceof Promise)return Promise.resolve(c).then(function(r){c=r})}();return Promise.resolve(f&&f.then?f.then(l):l())}catch(r){return Promise.reject(r)}}}export{o as typeschemaResolver};
//# sourceMappingURL=typeschema.module.js.map
