import { uuid } from "./../../wix-rich-content-common/lib/uuid.js";
const createUploadStartBIData = (pluginId, fileSize, mediaType) => {
  const correlationId = uuid();
  return { correlationId, pluginId, fileSize, mediaType, timeStamp: Date.now() };
};
const errorMap = {
  0: "Generic Error",
  1: "File size too big",
  2: "Quata Storage - Visitor",
  3: "Quata Storage - Owner",
  4: "Quata Video - Visitor",
  5: "Quata Video - Owner"
};
const createUploadEndBIData = (uploadBIData, error) => {
  const { correlationId, pluginId, fileSize, mediaType, timeStamp } = uploadBIData;
  const isSuccess = !error;
  const errorType = error ? error.key ? errorMap[error.key] : "Custom Error" : void 0;
  const duration = Date.now() - timeStamp;
  return {
    correlationId,
    pluginId,
    duration,
    fileSize,
    mediaType,
    isSuccess,
    errorType
  };
};
export {
  createUploadEndBIData,
  createUploadStartBIData
};
//# sourceMappingURL=media-upload-bi.js.map
