import{i as e}from"./chunk-aKtaBQYM.js";import{Ft as t,vt as n}from"./mui-BgU4WrXF.js";import{t as r}from"./IconButton-oialqkv3.js";import{t as i}from"./TextField-DctlzLY-.js";import{Nt as a,_ as o}from"./index-bel1r0Sr.js";var s=e(t(),1),c=n(),l=({placeholder:e,value:t,onChange:n,slotProps:l})=>{let u=(0,s.useRef)(null),d=()=>u.current?.click(),f=e=>{n?.(e.target.files?.[0]||null),e.target.value=``},p=e=>{e.stopPropagation(),n?.(null)};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(`input`,{ref:u,type:`file`,style:{display:`none`},onChange:f,...l?.htmlInput}),(0,c.jsx)(i,{value:t?.name??``,placeholder:e,onClick:d,slotProps:{input:{readOnly:!0,sx:{cursor:`pointer`},endAdornment:t&&(0,c.jsx)(a,{position:`end`,children:(0,c.jsx)(r,{size:`small`,edge:`end`,onClick:p,children:(0,c.jsx)(o,{fontSize:`small`})})})},htmlInput:{sx:{cursor:`pointer`}}}})]})};export{l as t};