import { jsxDEV } from "react/jsx-dev-runtime";
import { FileUrlFieldView } from "@contember/react-binding-ui";
import { defaultUploader } from "../../defaultUploader.js";
import { getAudioFileDataExtractor } from "../../fileDataExtractors/getAudioFileDataExtractor.js";
import { getFileUrlDataExtractor } from "../../fileDataExtractors/getFileUrlDataExtractor.js";
import { getGenericFileMetadataExtractor } from "../../fileDataExtractors/getGenericFileMetadataExtractor.js";
const acceptAudioFile = ({ file }) => file.type.startsWith("audio");
const renderAudioFilePreview = ({ objectUrl }) => /* @__PURE__ */ jsxDEV("audio", { src: objectUrl, controls: true }, void 0, false, {
  fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/upload/fileKinds/factories/getStockAudioFileKind.tsx",
  lineNumber: 18,
  columnNumber: 84
}, void 0);
const getStockAudioFileKind = ({
  additionalExtractors = [],
  acceptMimeTypes = "audio/*",
  acceptFile = acceptAudioFile,
  baseEntity,
  children,
  durationField,
  fileSizeField,
  fileTypeField,
  lastModifiedField,
  fileNameField,
  renderFilePreview = renderAudioFilePreview,
  renderUploadedFile,
  uploader = defaultUploader,
  urlField,
  childrenOutsideBaseEntity
}) => {
  const extractors = [
    getFileUrlDataExtractor({ urlField }),
    getGenericFileMetadataExtractor({ fileNameField, fileSizeField, fileTypeField, lastModifiedField }),
    getAudioFileDataExtractor({ durationField }),
    ...additionalExtractors
  ];
  return {
    acceptMimeTypes,
    acceptFile,
    renderFilePreview,
    uploader,
    renderUploadedFile: renderUploadedFile ?? /* @__PURE__ */ jsxDEV(FileUrlFieldView, { fileUrlField: urlField }, void 0, false, {
      fileName: "/__w/interface/interface/packages/admin/src/components/bindingFacade/upload/fileKinds/factories/getStockAudioFileKind.tsx",
      lineNumber: 49,
      columnNumber: 45
    }, void 0),
    baseEntity,
    children,
    childrenOutsideBaseEntity,
    extractors
  };
};
export {
  acceptAudioFile,
  getStockAudioFileKind,
  renderAudioFilePreview
};
//# sourceMappingURL=getStockAudioFileKind.js.map
