/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
import{getAssetUrl as i}from"../../../assets.js";import{getPathExtension as e}from"../../../core/urlUtils.js";const o=new Map([["7z","document"],["aac","audio"],["aif","audio"],["avi","video"],["bmp","image"],["csv","document"],["doc","document"],["docx","document"],["dot","document"],["dwf","document"],["dwg","document"],["ecw","image"],["emf","image"],["eps","document"],["flac","audio"],["geojson","document"],["gif","image"],["gml","document"],["gpx","document"],["gpkg","document"],["gtar","document"],["gz","document"],["heic","image"],["heif","image"],["img","image"],["j2k","image"],["jp2","image"],["jpc","image"],["jpe","image"],["jpeg","image"],["jpf","image"],["jpg","image"],["json","document"],["kml","document"],["kmz","document"],["m4a","audio"],["mdb","document"],["mid","audio"],["mov","video"],["mp2","audio"],["mp3","audio"],["mp4","video"],["mpa","audio"],["mpe","video"],["mpeg","video"],["mpg","video"],["mpv2","video"],["ogg","audio"],["pdf","document"],["png","image"],["ps","document"],["psd","image"],["ppt","document"],["pptx","document"],["qt","video"],["ra","audio"],["ram","audio"],["rar","document"],["raw","image"],["rmi","audio"],["rtf","document"],["sid","image"],["tar","document"],["tgz","document"],["tif","image"],["tiff","image"],["txt","document"],["vrml","document"],["wav","audio"],["webm","video"],["wma","audio"],["wmf","image"],["wmv","video"],["wps","document"],["xls","document"],["xlsx","document"],["xlt","document"],["xml","document"],["zip","document"]]);function t(i){return i?i.startsWith("image/")?"image":i.startsWith("audio/")?"audio":i.startsWith("video/")?"video":i.startsWith("text/")||i.startsWith("application/")||i.startsWith("model/")?"document":"unknown":"unknown"}function a(i){const e=p(i.type);return e&&"unknown"!==e?e:i instanceof File?c(i.name):null}function n(i){const e=p(i.contentType);return e&&"unknown"!==e?e:c(i.name)}function p(i){if(!i)return null;const e=i.toLowerCase().split(";",1)[0].trim();return e&&"application/octet-stream"!==e?t(e):null}function c(i){const t=e(i)?.toLowerCase();return t?o.get(t)??null:null}function m(i){const e=i.toLowerCase();return"image/bmp"===e||"image/emf"===e||"image/exif"===e||"image/gif"===e||"image/x-icon"===e||"image/jpeg"===e||"image/png"===e||"image/tiff"===e||"image/x-wmf"===e}function d(e){const o=i("esri/themes/base/images/files/");return e?"text/plain"===e?`${o}text-32.svg`:"application/pdf"===e?`${o}pdf-32.svg`:"text/csv"===e?`${o}csv-32.svg`:"application/gpx+xml"===e?`${o}gpx-32.svg`:"application/x-dwf"===e?`${o}cad-32.svg`:"application/postscript"===e||"application/json"===e||"text/xml"===e||"model/vrml"===e?`${o}code-32.svg`:"application/x-zip-compressed"===e||"application/x-7z-compressed"===e||"application/x-gzip"===e||"application/x-tar"===e||"application/x-gtar"===e||"application/x-bzip2"===e||"application/gzip"===e||"application/x-compress"===e||"application/x-apple-diskimage"===e||"application/x-rar-compressed"===e||"application/zip"===e?`${o}zip-32.svg`:e.includes("image/")?`${o}image-32.svg`:e.includes("audio/")?`${o}sound-32.svg`:e.includes("video/")?`${o}video-32.svg`:e.includes("msexcel")||e.includes("ms-excel")||e.includes("spreadsheetml")?`${o}excel-32.svg`:e.includes("msword")||e.includes("ms-word")||e.includes("wordprocessingml")?`${o}word-32.svg`:e.includes("powerpoint")||e.includes("presentationml")?`${o}report-32.svg`:`${o}generic-32.svg`:`${o}generic-32.svg`}function s(i){return i?"text/plain"===i?"file-text":"application/pdf"===i?"file-pdf":"text/csv"===i?"file-csv":"application/gpx+xml"===i?"file-gpx":"application/x-dwf"===i?"file-cad":"application/postscript"===i||"application/json"===i||"text/xml"===i||"model/vrml"===i?"file-code":"application/x-zip-compressed"===i||"application/x-7z-compressed"===i||"application/x-gzip"===i||"application/x-tar"===i||"application/x-gtar"===i||"application/x-bzip2"===i||"application/gzip"===i||"application/x-compress"===i||"application/x-apple-diskimage"===i||"application/x-rar-compressed"===i||"application/zip"===i?"file-zip":i.includes("image/")?"file-image":i.includes("audio/")?"file-sound":i.includes("video/")?"file-video":i.includes("msexcel")||i.includes("ms-excel")||i.includes("spreadsheetml")?"file-excel":i.includes("msword")||i.includes("ms-word")||i.includes("wordprocessingml")?"file-word":i.includes("powerpoint")||i.includes("presentationml")?"file-ppt":"file":"file"}export{n as getAttachmentCategoryForAttachment,c as getAttachmentCategoryForExtension,a as getAttachmentCategoryForFile,p as getAttachmentCategoryForMimeType,t as getAttachmentTypeCategory,s as getCalciteIconForAttachment,d as getIconPath,m as isSupportedImage};
