"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _constants = require("../../../constants");
/* eslint-disable @atlassian/i18n/no-literal-string-in-object */

var extractFileFormatIcon = function extractFileFormatIcon(fileFormat) {
  switch (fileFormat) {
    // Generic documents
    case 'folder':
      // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
      return {
        icon: _constants.IconType.Folder,
        label: 'Folder'
      };
    case 'text/plain':
    case 'application/vnd.oasis.opendocument.text':
    case 'application/vnd.apple.pages':
      // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
      return {
        icon: _constants.IconType.Document,
        label: 'Document'
      };
    case 'application/pdf':
      // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
      return {
        icon: _constants.IconType.PDF,
        label: 'PDF document'
      };
    case 'application/vnd.oasis.opendocument.presentation':
    case 'application/vnd.apple.keynote':
      // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
      return {
        icon: _constants.IconType.Presentation,
        label: 'Presentation'
      };
    case 'application/vnd.oasis.opendocument.spreadsheet':
    case 'application/vnd.apple.numbers':
      // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
      return {
        icon: _constants.IconType.Spreadsheet,
        label: 'Spreadsheet'
      };
    // Google Drive
    case 'application/vnd.google-apps.document':
      // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
      return {
        icon: _constants.IconType.GoogleDocs,
        label: 'Google Docs'
      };
    case 'application/vnd.google-apps.form':
      // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
      return {
        icon: _constants.IconType.GoogleForms,
        label: 'Google Form'
      };
    case 'application/vnd.google-apps.spreadsheet':
      // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
      return {
        icon: _constants.IconType.GoogleSheets,
        label: 'Google Sheets'
      };
    case 'application/vnd.google-apps.presentation':
      // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
      return {
        icon: _constants.IconType.GoogleSlides,
        label: 'Google Slides'
      };
    // Microsoft
    case 'application/vnd.ms-excel':
    case 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet':
      // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
      return {
        icon: _constants.IconType.MSExcel,
        label: 'Excel spreadsheet'
      };
    case 'application/vnd.ms-powerpoint':
    case 'application/vnd.openxmlformats-officedocument.presentationml.presentation':
      // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
      return {
        icon: _constants.IconType.MSPowerpoint,
        label: 'PowerPoint presentation'
      };
    case 'application/msword':
    case 'application/vnd.openxmlformats-officedocument.wordprocessingml.document':
      // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
      return {
        icon: _constants.IconType.MSWord,
        label: 'Word document'
      };
    case 'image/png':
    case 'image/jpeg':
    case 'image/bmp':
    case 'image/webp':
    case 'image/svg+xml':
      // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
      return {
        icon: _constants.IconType.Image,
        label: 'Image'
      };
    case 'image/gif':
      // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
      return {
        icon: _constants.IconType.GIF,
        label: 'GIF'
      };
    case 'audio/midi':
    case 'audio/mpeg':
    case 'audio/webm':
    case 'audio/ogg':
    case 'audio/wav':
      // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
      return {
        icon: _constants.IconType.Audio,
        label: 'Audio'
      };
    case 'video/mp4':
    case 'video/quicktime':
    case 'video/mov':
    case 'video/webm':
    case 'video/ogg':
    case 'video/x-ms-wmv':
    case 'video/x-msvideo':
      // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
      return {
        icon: _constants.IconType.Video,
        label: 'Video'
      };
    // Others
    case 'text/css':
    case 'text/html':
    case 'application/javascript':
      // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
      return {
        icon: _constants.IconType.Code,
        label: 'Source Code'
      };
    case 'application/zip':
    case 'application/x-tar':
    case 'application/x-gtar':
    case 'application/x-7z-compressed':
    case 'application/x-apple-diskimage':
    case 'application/vnd.rar':
      // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
      return {
        icon: _constants.IconType.Archive,
        label: 'Archive'
      };
    case 'application/dmg':
      // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
      return {
        icon: _constants.IconType.Executable,
        label: 'Executable'
      };
    case 'application/sketch':
      // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
      return {
        icon: _constants.IconType.Sketch,
        label: 'Sketch'
      };
    case 'application/octet-stream':
      // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
      return {
        icon: _constants.IconType.Generic,
        label: 'Binary file'
      };
    case 'application/invision.prototype':
      // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
      return {
        icon: _constants.IconType.Generic,
        label: 'Prototype'
      };
    default:
      return undefined;
  }
};
var _default = exports.default = extractFileFormatIcon;