const i = ({
  file: e,
  uploaderTitle: t
}) => e && typeof e != "string" ? e.name : t, g = ({
  file: e,
  maxSizeDescription: t
}) => e && typeof e != "string" ? `${(e.size / 1e3).toFixed(2)}KB` : t, o = ({
  file: e,
  fileId: t
}) => {
  if (e) {
    const r = document.getElementById(
      t
    );
    if (r)
      if (typeof e == "string")
        r.src = e;
      else {
        const n = new FileReader();
        n.onload = (a) => {
          if (a.target && a.target.result) {
            const s = a.target.result;
            r.src = typeof s == "string" ? s : "";
          }
        }, n.readAsDataURL(e);
      }
  } else
    return null;
}, c = ({
  file: e,
  errorMessage: t,
  inputId: r
}) => {
  if (!e || t) {
    const n = document.getElementById(r);
    n && n.click();
  }
}, m = (e) => {
  if (typeof e == "string" || !e)
    return !1;
  switch (e.type) {
    case "image/apng":
    case "image/avif":
    case "image/gif":
    case "image/jpeg":
    case "image/png":
    case "image/svg+xml":
    case "image/webp":
      return !0;
    default:
      return !1;
  }
};
export {
  o as getImageUrlFromFile,
  g as getUploaderDescription,
  i as getUploaderTitle,
  m as isImageFile,
  c as openFileExplorer
};
