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