import{toNestErrors as e}from"@hookform/resolvers";import{appendErrors as s}from"react-hook-form";import{safeParseAsync as t,getDotPath as r}from"valibot";function o(o,a,i={}){return async(n,c,u)=>{const l=!u.shouldUseNativeValidation&&"all"===u.criteriaMode,m=await t(o,n,Object.assign({},a,{abortPipeEarly:!l}));if(m.issues){const t=Object.create(null);for(;m.issues.length;){const e=m.issues[0],o=r(e);if(o&&(t[o]||(t[o]={message:e.message,type:e.type}),l)){const r=t[o].types,a=r&&r[e.type];t[o]=s(o,l,t,e.type,a?[].concat(a,e.message):e.message)}m.issues.shift()}return{values:{},errors:e(t,u)}}return{values:i.raw?Object.assign({},n):m.output,errors:{}}}}export{o as valibotResolver};
//# sourceMappingURL=valibot.modern.mjs.map
