var p=Object.defineProperty,P=Object.defineProperties,U=Object.getOwnPropertyDescriptor,b=Object.getOwnPropertyDescriptors,q=Object.getOwnPropertyNames,l=Object.getOwnPropertySymbols;var f=Object.prototype.hasOwnProperty,C=Object.prototype.propertyIsEnumerable;var v=(e,t,r)=>t in e?p(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,g=(e,t)=>{for(var r in t||(t={}))f.call(t,r)&&v(e,r,t[r]);if(l)for(var r of l(t))C.call(t,r)&&v(e,r,t[r]);return e},y=(e,t)=>P(e,b(t));var R=(e,t)=>{var r={};for(var o in e)f.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&l)for(var o of l(e))t.indexOf(o)<0&&C.call(e,o)&&(r[o]=e[o]);return r};var w=(e,t)=>{for(var r in t)p(e,r,{get:t[r],enumerable:!0})},x=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of q(t))!f.call(e,n)&&n!==r&&p(e,n,{get:()=>t[n],enumerable:!(o=U(t,n))||o.enumerable});return e};var z=e=>x(p({},"__esModule",{value:!0}),e);var D={};w(D,{default:()=>B});module.exports=z(D);var a=require("@chakra-ui/react"),u=require("react"),h=require("react-hook-form");var i=require("react/jsx-runtime"),A=({name:e,acceptedFileTypes:t,control:r,renderChild:o,schema:n})=>{let c=(0,u.useRef)(),J=(0,h.useController)({name:e,control:r,rules:{validate:n.validateSync}}),{field:S}=J,m=S,{ref:F,value:s,onChange:I}=m,k=R(m,["ref","value","onChange"]),{fieldState:{invalid:d,error:H}}=J,G=o({click:()=>c.current.click(),image:s,error:d});return(0,u.useEffect)(()=>{},[s]),(0,i.jsx)(a.FormControl,{isInvalid:d,children:(0,i.jsxs)(a.InputGroup,{children:[(0,i.jsx)("input",y(g({type:"file",accept:t,name:e,ref:c},k),{inputRef:F,style:{display:"none"},onChange:E=>I(E.target.files[0])})),G]})})},B=A;
