(true);\n\n let path = \"\";\n\n if (object) {\n const encodedPath = encodeURLString(object.name);\n let basename = document.baseURI.replace(window.location.origin, \"\");\n path = `${window.location.origin}${basename}api/v1/buckets/${bucketName}/objects/download?preview=true&prefix=${encodedPath}`;\n if (object.version_id) {\n path = path.concat(`&version_id=${object.version_id}`);\n }\n }\n\n const objectType = extensionPreview(object?.name || \"\");\n\n const iframeLoaded = () => {\n setLoading(false);\n };\n\n return (\n \n {loading && (\n \n \n \n )}\n \n {objectType === \"video\" && (\n
\n \n \n )}\n {objectType === \"audio\" && (\n
\n \n \n )}\n {objectType === \"image\" && (\n
\n )}\n {objectType !== \"video\" &&\n objectType !== \"audio\" &&\n objectType !== \"image\" && (\n
\n \n
\n )}\n
\n \n );\n};\nexport default withStyles(styles)(PreviewFile);\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment } from \"react\";\nimport ModalWrapper from \"../../../../Common/ModalWrapper/ModalWrapper\";\nimport PreviewFileContent from \"./PreviewFileContent\";\nimport { BucketObjectItem } from \"../ListObjects/types\";\nimport { ObjectPreviewIcon } from \"../../../../../../icons\";\n\ninterface IPreviewFileProps {\n open: boolean;\n bucketName: string;\n object: BucketObjectItem | null;\n onClosePreview: () => void;\n}\n\nconst PreviewFileModal = ({\n open,\n bucketName,\n object,\n onClosePreview,\n}: IPreviewFileProps) => {\n return (\n \n }\n >\n \n \n \n );\n};\n\nexport default PreviewFileModal;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport { BucketObjectItem } from \"./ListObjects/types\";\nimport { IAllowResources } from \"../../../types\";\nimport { encodeURLString } from \"../../../../../common/utils\";\n\nexport const download = (\n bucketName: string,\n objectPath: string,\n versionID: any,\n fileSize: number,\n overrideFileName: string | null = null,\n progressCallback: (progress: number) => void,\n completeCallback: () => void,\n errorCallback: (msg: string) => void,\n abortCallback: () => void\n) => {\n const anchor = document.createElement(\"a\");\n document.body.appendChild(anchor);\n let path = `/api/v1/buckets/${bucketName}/objects/download?prefix=${objectPath}${\n overrideFileName !== null && overrideFileName.trim() !== \"\"\n ? `&override_file_name=${encodeURLString(overrideFileName || \"\")}`\n : \"\"\n }`;\n if (versionID) {\n path = path.concat(`&version_id=${versionID}`);\n }\n\n var req = new XMLHttpRequest();\n req.open(\"GET\", path, true);\n req.addEventListener(\n \"progress\",\n function (evt) {\n var percentComplete = Math.round((evt.loaded / fileSize) * 100);\n\n if (progressCallback) {\n progressCallback(percentComplete);\n }\n },\n false\n );\n\n req.responseType = \"blob\";\n req.onreadystatechange = () => {\n if (req.readyState === 4) {\n if (req.status === 200) {\n const rspHeader = req.getResponseHeader(\"Content-Disposition\");\n\n let filename = \"download\";\n if (rspHeader) {\n let rspHeaderDecoded = decodeURIComponent(rspHeader);\n filename = rspHeaderDecoded.split('\"')[1];\n }\n\n if (completeCallback) {\n completeCallback();\n }\n\n var link = document.createElement(\"a\");\n link.href = window.URL.createObjectURL(req.response);\n link.download = filename;\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n } else {\n if (req.getResponseHeader(\"Content-Type\") === \"application/json\") {\n const rspBody: { detailedMessage?: string } = JSON.parse(\n req.response\n );\n if (rspBody.detailedMessage) {\n errorCallback(rspBody.detailedMessage);\n return;\n }\n }\n errorCallback(`Unexpected response status code (${req.status}).`);\n }\n }\n };\n req.onerror = () => {\n if (errorCallback) {\n errorCallback(\"A network error occurred.\");\n }\n };\n req.onabort = () => {\n if (abortCallback) {\n abortCallback();\n }\n };\n //req.send();\n\n return req;\n};\n\n// Review file extension by name & returns the type of preview browser that can be used\nexport const extensionPreview = (\n fileName: string\n): \"image\" | \"text\" | \"audio\" | \"video\" | \"none\" => {\n const imageExtensions = [\n \"jif\",\n \"jfif\",\n \"apng\",\n \"avif\",\n \"svg\",\n \"webp\",\n \"bmp\",\n \"ico\",\n \"jpg\",\n \"jpe\",\n \"jpeg\",\n \"gif\",\n \"png\",\n \"heic\",\n ];\n const textExtensions = [\"pdf\", \"txt\", \"json\"];\n const audioExtensions = [\"wav\", \"mp3\", \"alac\", \"aiff\", \"dsd\", \"pcm\"];\n const videoExtensions = [\n \"mp4\",\n \"avi\",\n \"mpg\",\n \"webm\",\n \"mov\",\n \"flv\",\n \"mkv\",\n \"wmv\",\n \"avchd\",\n \"mpeg-4\",\n ];\n\n let fileExtension = fileName.split(\".\").pop();\n\n if (!fileExtension) {\n return \"none\";\n }\n\n fileExtension = fileExtension.toLowerCase();\n\n if (imageExtensions.includes(fileExtension)) {\n return \"image\";\n }\n\n if (textExtensions.includes(fileExtension)) {\n return \"text\";\n }\n\n if (audioExtensions.includes(fileExtension)) {\n return \"audio\";\n }\n\n if (videoExtensions.includes(fileExtension)) {\n return \"video\";\n }\n\n return \"none\";\n};\n\nexport const sortListObjects = (fieldSort: string) => {\n switch (fieldSort) {\n case \"name\":\n return (a: BucketObjectItem, b: BucketObjectItem) =>\n a.name.localeCompare(b.name);\n case \"last_modified\":\n return (a: BucketObjectItem, b: BucketObjectItem) =>\n new Date(a.last_modified).getTime() -\n new Date(b.last_modified).getTime();\n case \"size\":\n return (a: BucketObjectItem, b: BucketObjectItem) =>\n (a.size || -1) - (b.size || -1);\n }\n};\n\nexport const permissionItems = (\n bucketName: string,\n currentPath: string,\n permissionsArray: IAllowResources[]\n): BucketObjectItem[] | null => {\n if (permissionsArray.length === 0) {\n return null;\n }\n\n // We get permissions applied to the current bucket\n const filteredPermissionsForBucket = permissionsArray.filter(\n (permissionItem) =>\n permissionItem.resource.endsWith(`:${bucketName}`) ||\n permissionItem.resource.includes(`:${bucketName}/`)\n );\n\n // No permissions for this bucket. we can throw the error message at this point\n if (filteredPermissionsForBucket.length === 0) {\n return null;\n }\n\n const returnElements: BucketObjectItem[] = [];\n\n // We split current path\n const splitCurrentPath = currentPath.split(\"/\");\n\n filteredPermissionsForBucket.forEach((permissionElement) => {\n // We review paths in resource address\n\n // We split ARN & get the last item to check the URL\n const splitARN = permissionElement.resource.split(\":\");\n const urlARN = splitARN.pop() || \"\";\n\n // We split the paths of the URL & compare against current location to see if there are more items to include. In case current level is a wildcard or is the last one, we omit this validation\n\n const splitURLARN = urlARN.split(\"/\");\n\n // splitURL has more items than bucket name, we can continue validating\n if (splitURLARN.length > 1) {\n splitURLARN.every((currentElementInPath, index) => {\n // It is a wildcard element. We can stor the verification as value should be included (?)\n if (currentElementInPath === \"*\") {\n return false;\n }\n\n // Element is not included in the path. The user is trying to browse something else.\n if (\n splitCurrentPath[index] &&\n splitCurrentPath[index] !== currentElementInPath\n ) {\n return false;\n }\n\n // This element is not included by index in the current paths list. We add it so user can browse into it\n if (!splitCurrentPath[index]) {\n returnElements.push({\n name: `${currentElementInPath}/`,\n size: 0,\n last_modified: new Date(),\n version_id: \"\",\n });\n }\n\n return true;\n });\n }\n\n // We review prefixes in allow resources for StringEquals variant only.\n if (\n permissionElement.conditionOperator === \"StringEquals\" ||\n permissionElement.conditionOperator === \"StringLike\"\n ) {\n permissionElement.prefixes.forEach((prefixItem) => {\n // Prefix Item is not empty?\n if (prefixItem !== \"\") {\n const splitItems = prefixItem.split(\"/\");\n\n let pathToRouteElements: string[] = [];\n\n splitItems.every((splitElement, index) => {\n if (!splitElement.includes(\"*\") && splitElement !== \"\") {\n if (splitElement !== splitCurrentPath[index]) {\n returnElements.push({\n name: `${pathToRouteElements.join(\"/\")}${\n pathToRouteElements.length > 0 ? \"/\" : \"\"\n }${splitElement}/`,\n size: 0,\n last_modified: new Date(),\n version_id: \"\",\n });\n return false;\n }\n if (splitElement !== \"\") {\n pathToRouteElements.push(splitElement);\n }\n\n return true;\n }\n return false;\n });\n }\n });\n }\n });\n\n return returnElements;\n};\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { ComponentType, Suspense, SuspenseProps } from \"react\";\n\nfunction withSuspense(\n WrappedComponent: ComponentType
,\n fallback: SuspenseProps[\"fallback\"] = null\n) {\n function ComponentWithSuspense(props: P) {\n return (\n \n \n \n );\n }\n\n return ComponentWithSuspense;\n}\n\nexport default withSuspense;\n","import React, { Fragment } from \"react\";\nimport Grid from \"@mui/material/Grid\";\nimport { Theme } from \"@mui/material/styles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport withStyles from \"@mui/styles/withStyles\";\nimport { predefinedList } from \"../common/styleLibrary\";\n\ninterface IPredefinedList {\n classes: any;\n label?: string;\n content: any;\n multiLine?: boolean;\n actionButton?: React.ReactNode;\n}\n\nconst styles = (theme: Theme) =>\n createStyles({\n ...predefinedList,\n });\n\nconst PredefinedList = ({\n classes,\n label = \"\",\n content,\n multiLine = false,\n actionButton,\n}: IPredefinedList) => {\n return (\n \n \n {label !== \"\" && (\n \n {label}\n \n )}\n \n \n {content}\n \n {actionButton && (\n {actionButton}
\n )}\n \n \n \n );\n};\n\nexport default withStyles(styles)(PredefinedList);\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\nimport React, { useEffect, useState } from \"react\";\nimport { useSelector } from \"react-redux\";\nimport IconButton from \"@mui/material/IconButton\";\nimport Snackbar from \"@mui/material/Snackbar\";\nimport { Dialog, DialogContent, DialogTitle } from \"@mui/material\";\nimport { Theme } from \"@mui/material/styles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport withStyles from \"@mui/styles/withStyles\";\nimport {\n deleteDialogStyles,\n snackBarCommon,\n} from \"../FormComponents/common/styleLibrary\";\nimport { AppState, useAppDispatch } from \"../../../../store\";\nimport CloseIcon from \"@mui/icons-material/Close\";\nimport MainError from \"../MainError/MainError\";\nimport { setModalSnackMessage } from \"../../../../systemSlice\";\n\ninterface IModalProps {\n classes: any;\n onClose: () => void;\n modalOpen: boolean;\n title: string | React.ReactNode;\n children: any;\n wideLimit?: boolean;\n noContentPadding?: boolean;\n titleIcon?: React.ReactNode;\n}\n\nconst styles = (theme: Theme) =>\n createStyles({\n ...deleteDialogStyles,\n content: {\n padding: 25,\n paddingBottom: 0,\n },\n customDialogSize: {\n width: \"100%\",\n maxWidth: 765,\n },\n ...snackBarCommon,\n });\n\nconst ModalWrapper = ({\n onClose,\n modalOpen,\n title,\n children,\n classes,\n wideLimit = true,\n noContentPadding,\n titleIcon = null,\n}: IModalProps) => {\n const dispatch = useAppDispatch();\n const [openSnackbar, setOpenSnackbar] = useState(false);\n\n const modalSnackMessage = useSelector(\n (state: AppState) => state.system.modalSnackBar\n );\n\n useEffect(() => {\n dispatch(setModalSnackMessage(\"\"));\n }, [dispatch]);\n\n useEffect(() => {\n if (modalSnackMessage) {\n if (modalSnackMessage.message === \"\") {\n setOpenSnackbar(false);\n return;\n }\n // Open SnackBar\n if (modalSnackMessage.type !== \"error\") {\n setOpenSnackbar(true);\n }\n }\n }, [modalSnackMessage]);\n\n const closeSnackBar = () => {\n setOpenSnackbar(false);\n dispatch(setModalSnackMessage(\"\"));\n };\n\n const customSize = wideLimit\n ? {\n classes: {\n paper: classes.customDialogSize,\n },\n }\n : { maxWidth: \"lg\" as const, fullWidth: true };\n\n let message = \"\";\n\n if (modalSnackMessage) {\n message = modalSnackMessage.detailedErrorMsg;\n if (\n modalSnackMessage.detailedErrorMsg === \"\" ||\n modalSnackMessage.detailedErrorMsg.length < 5\n ) {\n message = modalSnackMessage.message;\n }\n }\n\n return (\n {\n if (reason !== \"backdropClick\") {\n onClose(); // close on Esc but not on click outside\n }\n }}\n className={classes.root}\n >\n \n \n {titleIcon} {title}\n
\n \n \n \n \n
\n \n\n \n {\n closeSnackBar();\n }}\n message={message}\n ContentProps={{\n className: `${classes.snackBar} ${\n modalSnackMessage && modalSnackMessage.type === \"error\"\n ? classes.errorSnackBar\n : \"\"\n }`,\n }}\n autoHideDuration={\n modalSnackMessage && modalSnackMessage.type === \"error\" ? 10000 : 5000\n }\n />\n \n {children}\n \n \n );\n};\n\nexport default withStyles(styles)(ModalWrapper);\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React from \"react\";\nimport InputAdornment from \"@mui/material/InputAdornment\";\nimport SearchIcon from \"../../../icons/SearchIcon\";\nimport TextField from \"@mui/material/TextField\";\nimport withStyles from \"@mui/styles/withStyles\";\nimport { Theme } from \"@mui/material/styles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport { searchField } from \"./FormComponents/common/styleLibrary\";\n\nconst styles = (theme: Theme) =>\n createStyles({\n searchField: {\n ...searchField.searchField,\n },\n adornment: {},\n });\n\ntype SearchBoxProps = {\n placeholder?: string;\n value: string;\n classes: any;\n onChange: (value: string) => void;\n adornmentPosition?: \"start\" | \"end\";\n overrideClass?: any;\n};\n\nconst SearchBox = ({\n placeholder = \"\",\n classes,\n onChange,\n adornmentPosition = \"end\",\n overrideClass,\n value,\n}: SearchBoxProps) => {\n const inputProps = {\n disableUnderline: true,\n [`${adornmentPosition}Adornment`]: (\n \n \n \n ),\n };\n return (\n {\n onChange(e.target.value);\n }}\n variant=\"standard\"\n value={value}\n />\n );\n};\n\nexport default withStyles(styles)(SearchBox);\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nlet objectCalls: { [key: string]: XMLHttpRequest } = {};\n\nexport const storeCallForObjectWithID = (id: string, call: XMLHttpRequest) => {\n objectCalls[id] = call;\n};\n\nexport const callForObjectID = (id: string): XMLHttpRequest => {\n return objectCalls[id];\n};\n\nexport const makeid = (length: number) => {\n var result = \"\";\n var characters =\n \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n var charactersLength = characters.length;\n for (var i = 0; i < length; i++) {\n result += characters.charAt(Math.floor(Math.random() * charactersLength));\n }\n return result;\n};\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport { Box, Button } from \"@mui/material\";\nimport InputBoxWrapper from \"../Common/FormComponents/InputBoxWrapper/InputBoxWrapper\";\nimport { CopyIcon } from \"../../../icons\";\nimport { useState } from \"react\";\n\nconst KeyRevealer = ({ value }: { value: string }) => {\n const [shown, setShown] = useState(false);\n\n return (\n \n {}}\n value={value}\n overlayIcon={ }\n extraInputProps={{\n readOnly: true,\n }}\n overlayAction={() => navigator.clipboard.writeText(value)}\n />\n\n setShown(!shown)}\n >\n Show/Hide\n \n \n );\n};\n\nexport default KeyRevealer;\n"],"names":["CreatePathModal","withSuspense","React","withStyles","theme","createStyles","objectBrowserCommon","slashSpacingStyle","margin","classes","bucketName","internalPaths","existingFiles","hidePathButton","additionalOptions","dispatch","useAppDispatch","navigate","useNavigate","rewindEnabled","useSelector","state","objectBrowser","rewind","versionsMode","versionedFile","useState","createFolderOpen","setCreateFolderOpen","paths","splitPaths","split","filter","path","lastBreadcrumbsIndex","length","breadcrumbsMap","map","objectItem","index","subSplit","slice","join","route","encodeURLString","Fragment","className","style","cursor","to","onClick","setVersionsModeEnabled","status","objectName","toString","versionsItem","listBreadcrumbs","breadcrumbsMain","modalOpen","folderName","onClose","Grid","item","xs","breadcrumbs","IconButton","sx","border","backgroundColor","borderLeft","borderRadius","width","height","marginRight","breadcrumbsList","dir","text","RBIconButton","id","icon","disableTouchRipple","disableRipple","focusRipple","variant","setSnackBarMessage","padding","color","Tooltip","title","Button","disabled","hasPermission","IAM_SCOPES","endIcon","whiteSpace","minWidth","fontSize","breadcrumbsSecond","listUploadIcons","fill","uploadPath","forceDisable","uploadFileFunction","uploadFolderFunction","anchorEl","setAnchorEl","openUploadMenu","Boolean","handleCloseUpload","uploadObjectAllowed","uploadFolderAllowed","uploadEnabled","tooltip","undefined","event","currentTarget","Menu","open","anchorOrigin","vertical","horizontal","transformOrigin","MenuItem","ListItemIcon","ListItemText","detailsList","borderColor","borderWidth","borderStyle","borderBottomLeftRadius","borderBottomRightRadius","transitionDuration","overflowX","overflowY","position","opacity","marginLeft","borderLeftWidth","closePanel","right","top","children","months","value","label","days","Array","from","_","num","currentYear","Date","getFullYear","years","numYear","SelectStyled","root","input","borderBottom","InputBase","DateSelector","forwardRef","ref","disableOptions","addSwitch","onDateChange","useImperativeHandle","resetDate","dateEnabled","setDateEnabled","month","setMonth","day","setDay","year","setYear","useEffect","valueSplit","parseInt","currentDate","parse","isNaN","parsedMonth","parsedDay","monthForString","dayForString","parsedDate","toISOString","dateString","validDate","isValid","isDateDisabled","clsx","fieldContainer","fieldContainerBorder","labelContainer","container","InputLabel","htmlFor","inputLabel","tooltipContainer","placement","HelpIcon","FormSwitchWrapper","indicatorLabels","checked","name","onChange","e","target","switchOnly","FormControl","dateInput","Select","displayEmpty","option","dayNumber","fieldBasic","tooltipHelper","flex","display","alignItems","justifyContent","paddingBottom","marginTop","marginBottom","formFieldStyles","modalStyleUtils","spacingUtils","dateSelector","paddingLeft","closeModalAndRefresh","objectInfo","statusEnabled","setStatusEnabled","type","setType","date","setDate","isDateValid","setIsDateValid","isSaving","setIsSaving","alreadyConfigured","setAlreadyConfigured","retention_mode","toLowerCase","retention_until_date","valueDate","getMonth","getDate","dateElement","useRef","resetForm","current","showSwitcher","ModalWrapper","spacerBottom","noValidate","autoComplete","onSubmit","preventDefault","formFieldRow","RadioGroupSelector","currentSelection","selectorOptions","modalButtonBar","selectedObject","versionId","version_id","expireDate","api","expires","mode","then","res","catch","error","setModalErrorSnackMessage","addRetention","disableRetention","closeDeleteModalAndRefresh","deleteOpen","selectedBucket","versioning","selectedVersion","useApi","err","setErrorSnackMessage","deleteLoading","invokeDeleteApi","deleteVersions","setDeleteVersions","ConfirmDialog","confirmText","isOpen","titleIcon","isLoading","onConfirm","recursive","decodeURLString","endsWith","confirmationContent","DialogContentText","description","actualInfo","legalHoldEnabled","setLegalHoldEnabled","get","propertiesIcon","capitalizeFirst","textTransform","titleItem","detailsPanel","linear","metaData","setMetaData","metadata","invokeMetaDataApi","metaKeys","Object","keys","loadMetaData","useCallback","element","renderItem","isArray","decodeURIComponent","Box","metadataLinear","Table","table","TableBody","TableRow","TableCell","component","scope","align","fontWeight","restProps","startIcon","items","titleLabel","objectActions","actionItem","action","fileName","minHeight","fileNameText","overflow","textOverflow","strings","FileBookIcon","FileCodeIcon","FileConfigIcon","FileDbIcon","FileFontIcon","FileImageIcon","FileLockIcon","FileMissingIcon","FileMusicIcon","FilePdfIcon","FilePptIcon","FileTxtIcon","FileVideoIcon","FileXlsIcon","FileZipIcon","extensionToIcon","extensions","displayFileIconName","returnOnlyIcon","elementString","ObjectBrowserIcon","ObjectBrowserFolderIcon","lowercaseElement","etc","ext","indexOf","splitItem","newTileHeader","tagsForLabel","currentTagsContainer","noTagsForObject","deleteTag","onCloseAndUpdate","distributedSetup","selDistSet","newKey","setNewKey","newLabel","setNewLabel","isSending","setIsSending","deleteEnabled","setDeleteEnabled","deleteKey","setDeleteKey","deleteLabel","setDeleteLabel","currentTags","tags","currTagKeys","currentItem","pop","tagsFor","plural","cleanObject","verID","SecureComponent","scopes","resource","flexFlow","tagKey","tag","matchAll","errorProps","deleteIcon","onDelete","Chip","size","Close","onDeleteTag","InputBoxWrapper","placeholder","trim","newTag","newTagList","closeInspectModalAndRefresh","inspectOpen","inspectPath","volumeName","isEncrypt","setIsEncrypt","decryptionKey","setDecryptionKey","insFileName","setInsFileName","makeRequest","url","fetch","method","performInspect","file","volume","urlOfInspectApi","ok","json","resErr","errorMessage","message","detailedError","code","blob","filename","headers","decryptKey","getCookieValue","performDownload","deleteCookie","KeyRevealer","useStyles","makeStyles","containerForHeader","spacing","closeModal","newFileName","setNewFileName","acceptLongName","setAcceptLongName","identityDownload","getTime","Math","random","downloadCall","download","progress","updateProgress","instanceID","completeObject","msg","failObject","cancelObjectInList","ID","makeid","storeCallForObjectWithID","setNewObject","done","percentage","prefix","waitingForFile","failed","cancelled","send","doDownload","modalFormScrollable","emptyFile","is_latest","last_modified","legal_hold_status","ObjectDetailsTitle","objectNameContainer","headerForSection","buttonsStyles","actionsTray","textStyleUtils","locking","onClosePanel","loadingObjectInfo","shareFileModalOpen","setShareFileModalOpen","retentionModalOpen","setRetentionModalOpen","tagModalOpen","setTagModalOpen","legalholdOpen","setLegalholdOpen","inspectModalOpen","setInspectModalOpen","setActualInfo","allInfoElements","setAllInfoElements","objectToShare","setObjectToShare","versions","setVersions","setDeleteOpen","previewOpen","setPreviewOpen","totalVersionsSize","setTotalVersionsSize","longFileOpen","setLongFileOpen","objectNameArray","infoElement","find","el","result","tVersionSize","reduce","acc","currValue","setLoadingObjectInfo","console","tagKeys","loaderForContainer","textAlign","Loader","objectResources","multiActionButtons","object","getClientOS","includes","downloadObject","is_delete_marker","extensionPreview","ShareFile","dataObject","updateInfo","closeAndReload","setLoadingVersions","setSelectedVersion","reload","PreviewFileModal","content_type","onClosePreview","TagsModal","reloadObjectData","detailContainer","overflowWrap","niceBytes","niceBytesInt","lastModified","currentTime","modifiedTime","difTime","formatTime","niceDaysInt","calculateLastModifyTime","etag","displayParsedDate","displayNiceBytes","String","listModeColumns","elementKey","renderFunction","enableSort","renderFullObject","contentTextAlign","rewindModeColumns","modalBasic","versionID","objectPath","restoreOpen","restoreLoading","setRestoreLoading","RecoverIcon","confirmButtonProps","wrapText","bgColor","mainFileVersionItem","intermediateLayer","borderBottomColor","versionContainer","buttonContainer","maxWidth","versionData","ctrItem","content","left","collapsableInfo","flexDirection","versionItem","versionInfo","isSelected","checkable","isChecked","onCheck","onShare","onDownload","onRestore","onPreview","globalClick","key","disableButtons","versionItemButtons","pill","md","CheckboxWrapper","stopPropagation","overrideCheckboxStyles","noTopMargin","button","buttonDisabled","setDeleteLoading","typeConfirm","setTypeConfirm","selectedVersions","selectedObjectsRequest","versionsContainer","noBottomBorder","versionsVirtualPanel","flexGrow","screenTitleContainer","bottom","sortByLabel","hrClass","tableStyles","objectBrowserExtras","searchVersions","loadingVersions","restoreVersionOpen","setRestoreVersionOpen","restoreVersion","setRestoreVersion","sortValue","setSortValue","deleteNonCurrentOpen","setDeleteNonCurrentOpen","selectEnabled","setSelectEnabled","selectedItems","setSelectedItems","delSelectedVOpen","setDelSelectedVOpen","onShareItem","onPreviewItem","onRestoreItem","onDownloadItem","onGlobalClick","filteredRecords","version","totalSpace","sort","a","b","dateA","dateB","onCheckVersion","filteredItems","cloneState","push","DeleteNonCurrent","reloadAfterDelete","DeleteSelectedVersions","reloadOnComplete","LinearProgress","ScreenTitle","listIcon","titleSpacer","subTitle","bucketDetails","detailsSpacer","actions","SelectWrapper","options","containerStyle","rowCount","rowHeight","rowRenderer","isScrolling","isVisible","versOrd","HistoryIcon","RefreshIcon","DeleteIcon","DeleteMultipleObjects","RewindEnable","browsePaper","backgroundImage","badgeOverlap","screenTitle","paddingTop","paddingRight","searchField","labelStyle","breadcrumbsContainer","parentWrapper","fullContainer","hideListOnSmall","baseDnDStyle","outline","activeDnDStyle","acceptDnDStyle","defLoading","Typography","params","useParams","location","useLocation","rewindDate","dateToRewind","bucketToRewind","searchObjects","showDeleted","detailsOpen","objectDetailsOpen","selectedInternalPaths","loading","loadingObjects","simplePath","loadingBucket","selBucketDetailsLoading","bucketInfo","selBucketDetailsInfo","allowResources","session","features","selFeatures","obOnly","records","setRecords","deleteMultipleOpen","setDeleteMultipleOpen","loadingStartTime","setLoadingStartTime","loadingMessage","setLoadingMessage","loadingVersioning","setLoadingVersioning","isVersioned","setIsVersioned","loadingLocking","setLoadingLocking","lockingEnabled","setLockingEnabled","rewindSelect","setRewindSelect","selectedObjects","setSelectedObjects","selectedPreview","setSelectedPreview","sortDirection","setSortDirection","currentSortField","setCurrentSortField","iniLoad","setIniLoad","canShareFile","setCanShareFile","canPreviewFile","setCanPreviewFile","quota","setQuota","downloadRenameModal","setDownloadRenameModal","pathSegment","pathname","fileUpload","folderUpload","setAttribute","quotaVals","setObjectDetailsView","displayDeleteObject","displayListObjects","setBucketDetailsLoad","callback","delay","savedCallback","setInterval","clearInterval","useInterval","timeDelta","now","ceil","updateMessage","is_versioned","object_locking_enabled","decodedIPaths","setSelectedObjectView","setSimplePathHandler","setSearchObjects","setLoadingObjectsList","pathPrefix","decodedPath","currentTimestamp","urlTake","resetRewind","rewindParsed","currDateISO","objects","folders","files","forEach","record","recordsInElement","pathTest","found","pathPrefixChopped","i","parentPath","permitItems","permissionItems","setBucketInfo","handleUploadButton","newFiles","uploadObject","folderPath","uploadPromise","Promise","resolve","reject","uploadUrl","blobFile","Blob","encodedPath","filePath","fileWebkitRelativePath","relativeFolderPath","finalFolderPath","pathClean","startsWith","identity","xhr","XMLHttpRequest","areMultipleFiles","errorMessages","withCredentials","onload","response","JSON","detailedMessage","upload","addEventListener","floor","loaded","total","onerror","onloadend","onabort","formData","FormData","append","uploadFilePromises","openList","allSettled","results","errors","totalFiles","successUploadedFiles","onDrop","acceptedFiles","newFolderPath","useDropzone","noClick","getRootProps","getInputProps","isDragActive","isDragAccept","dndStyles","useMemo","pageTitle","currentPath","sortASC","sortListObjects","payload","reverse","concat","forceRefresh","splitURLS","URLItem","tableActions","idElement","newPath","sendOnlyId","itemsToDownload","filteredItem","fileObject","refresh","PageLayout","creation_date","access","actionsSection","Badge","badgeContent","invisible","multiple","closeMenu","click","tableBlock","borderTop","setShowDeletedObjects","overrideLabelClasses","overrideShowDeleted","TableWrapper","itemActions","columns","entityName","idField","customPaperHeight","onSelect","targetD","elements","customEmptyMessage","sortConfig","currentSort","currentDirection","triggerSort","sortData","newSortDirection","sortBy","onSelectAll","rowStyle","delete_flag","parentClassName","searchBar","SearchBox","setSearchVersions","PageHeader","BackLink","IAM_PAGES","IAM_PERMISSIONS","IAM_ROLES","SettingsIcon","middleComponent","dateInputContainer","durationInputs","validityIndicator","invalidDurationText","reverseInput","validityText","validTill","initialDate","maxDays","entity","selectedDays","setSelectedDays","selectedHours","setSelectedHours","selectedMinutes","setSelectedMinutes","setValidDate","moment","dateSelected","setDateSelected","hours","minutes","add","calculateNewTime","format","valid","extraInputProps","min","max","noLabelMinWidth","validityLabel","CopyIcon","shareLinkInfo","copyShareLink","copyShareLinkInput","copyShareLinkBtn","shareURL","setShareURL","isLoadingVersion","setIsLoadingVersion","isLoadingFile","setIsLoadingFile","selectedDate","setSelectedDate","dateValid","setDateValid","setVersionID","latestVersion","elem","slDate","currDate","diffDate","dateContainer","newDate","PredefinedList","actionButton","BoxIconButton","setModalSnackMessage","iframeContainer","iframeBase","iframeHidden","isFullscreen","setLoading","basename","document","baseURI","replace","window","origin","objectType","iframeLoaded","maxHeight","autoPlay","controls","muted","playsInline","onPlay","src","alt","onLoad","allowTransparency","wideLimit","PreviewFileContent","fileSize","overrideFileName","progressCallback","completeCallback","errorCallback","abortCallback","anchor","createElement","body","appendChild","req","evt","percentComplete","round","responseType","onreadystatechange","readyState","rspHeader","getResponseHeader","link","href","URL","createObjectURL","removeChild","rspBody","fileExtension","fieldSort","localeCompare","permissionsArray","filteredPermissionsForBucket","permissionItem","returnElements","splitCurrentPath","permissionElement","splitURLARN","every","currentElementInPath","conditionOperator","prefixes","prefixItem","splitItems","pathToRouteElements","splitElement","WrappedComponent","fallback","ComponentWithSuspense","props","Suspense","predefinedList","multiLine","prefinedContainer","predefinedTitle","includesActionButton","innerContentMultiline","innerContent","overlayShareOption","deleteDialogStyles","customDialogSize","snackBarCommon","noContentPadding","openSnackbar","setOpenSnackbar","modalSnackMessage","system","modalSnackBar","customSize","paper","fullWidth","detailedErrorMsg","scroll","reason","titleText","closeContainer","closeButton","isModal","snackBarModal","ContentProps","snackBar","errorSnackBar","autoHideDuration","adornment","adornmentPosition","overrideClass","inputProps","disableUnderline","InputProps","objectCalls","call","callForObjectID","characters","charactersLength","charAt","shown","setShown","sm","overlayIcon","readOnly","overlayAction","navigator","clipboard","writeText"],"sourceRoot":""}
\ No newline at end of file
diff --git a/portal-ui/build/static/js/1379.be3e0cea.chunk.js b/portal-ui/build/static/js/1379.be3e0cea.chunk.js
new file mode 100644
index 000000000..72f63f10a
--- /dev/null
+++ b/portal-ui/build/static/js/1379.be3e0cea.chunk.js
@@ -0,0 +1,2 @@
+"use strict";(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[1379],{41379:function(e,n,t){t.r(n),t.d(n,{default:function(){return Xn}});var i=t(1413),o=t(72791),a=t(60364),s=t(16871),r=t(11135),c=t(25787),l=t(20068),d=t(13400),u=t(61889),h=t(25469),m=t(23814),f=t(93433),p=t(29439),x=t(57831),v=t(26181),b=t.n(v),g=t(81207),j=t(92983),Z=t(45248),w=t(20890),y=t(84697),S=t(78029),C=t.n(S),N=t(43504),k=t(36151),E=t(38734),I=t(38442),T=t(56087),_=t(75578),F=t(87995),P=t(54756),L=t(40603),D=t(80184),O=(0,_.Z)(o.lazy((function(){return t.e(2185).then(t.bind(t,62185))}))),B=(0,c.Z)((function(e){return(0,r.Z)((0,i.Z)((0,i.Z)({},m.cx),{},{slashSpacingStyle:{margin:"0 5px"}}))}))((function(e){var n=e.classes,t=e.bucketName,i=e.internalPaths,r=e.existingFiles,c=e.hidePathButton,m=e.additionalOptions,x=(0,h.TL)(),v=(0,s.s0)(),b=(0,a.v9)((function(e){return e.objectBrowser.rewind.rewindEnabled})),g=(0,a.v9)((function(e){return e.objectBrowser.versionsMode})),j=(0,a.v9)((function(e){return e.objectBrowser.versionedFile})),w=(0,o.useState)(!1),y=(0,p.Z)(w,2),S=y[0],_=y[1],B=i;""!==i&&(B="/".concat(i));var R=B.split("/").filter((function(e){return""!==e})),z=R.length-1,M=R.map((function(e,i){var a="".concat(R.slice(0,i+1).join("/"),"/"),s="/buckets/".concat(t,"/browse/").concat(a?"".concat((0,Z.LL)(a)):"");return i===z&&e===j?null:(0,D.jsxs)(o.Fragment,{children:[(0,D.jsx)("span",{className:n.slashSpacingStyle,children:"/"}),i===z?(0,D.jsx)("span",{style:{cursor:"default"},children:e}):(0,D.jsx)(N.rU,{to:s,onClick:function(){x((0,P.db)({status:!1,objectName:""}))},children:e})]},"breadcrumbs-".concat(i.toString()))})),A=[];g&&(A=[(0,D.jsx)(o.Fragment,{children:(0,D.jsxs)("span",{children:[(0,D.jsx)("span",{className:n.slashSpacingStyle,children:"/"}),j," - Versions"]})},"breadcrumbs-versionedItem")]);var U=[(0,D.jsx)(o.Fragment,{children:(0,D.jsx)(N.rU,{to:"/buckets/".concat(t,"/browse"),onClick:function(){x((0,P.db)({status:!1,objectName:""}))},children:t})},"breadcrumbs-root-path")].concat((0,f.Z)(M),(0,f.Z)(A));return(0,D.jsxs)(o.Fragment,{children:[(0,D.jsxs)("div",{className:n.breadcrumbsMain,children:[S&&(0,D.jsx)(O,{modalOpen:S,bucketName:t,folderName:i,onClose:function(){_(!1)},existingFiles:r}),(0,D.jsxs)(u.ZP,{item:!0,xs:12,className:"".concat(n.breadcrumbs),children:[(0,D.jsx)(d.Z,{onClick:function(){g?x((0,P.db)({status:!1,objectName:""})):v(-1)},sx:{border:"#EAEDEE 1px solid",backgroundColor:"#fff",borderLeft:0,borderRadius:0,width:38,height:38,marginRight:"10px"},children:(0,D.jsx)(E.ubh,{})}),(0,D.jsx)("div",{className:n.breadcrumbsList,dir:"rtl",children:U}),(0,D.jsx)(C(),{text:"".concat(t,"/").concat(R.join("/")),children:(0,D.jsx)(L.Z,{id:"copy-path",icon:(0,D.jsx)(E.TIy,{}),disableTouchRipple:!0,disableRipple:!0,focusRipple:!1,variant:"outlined",onClick:function(){x((0,F.y1)("Path copied to clipboard"))},sx:{marginRight:"3px",padding:"0",color:"#969FA8",border:"#969FA8 1px solid",width:"28px",height:"28px","& .MuiButton-root":{height:"28px"},"& .min-icon":{width:"12px",height:"12px"}}})}),(0,D.jsx)("div",{className:n.additionalOptions,children:m})]}),!c&&(0,D.jsx)(l.Z,{title:"Choose or create a new path",children:(0,D.jsx)(k.Z,{id:"new-path",onClick:function(){_(!0)},disabled:b||!(0,I.F)(t,[T.Ft.S3_PUT_OBJECT]),endIcon:(0,D.jsx)(E.N$q,{}),disableTouchRipple:!0,disableRipple:!0,focusRipple:!1,sx:{color:"#969FA8",border:"#969FA8 1px solid",whiteSpace:"nowrap",minWidth:"160px","@media (max-width: 1060px)":{fontSize:0,minWidth:40,padding:"0 10px 0 0"}},variant:"outlined",children:"Create new path"})})]}),(0,D.jsx)("div",{className:n.breadcrumbsSecond,children:m})]})})),R=t(47922),z=t(14917),M=t(74794),A=t(71715),U=t(23786),W=t(49900),G=t(57064),H=(0,c.Z)((function(e){return(0,r.Z)({listUploadIcons:{height:20,"& .min-icon":{width:18,fill:"rgba(0,0,0,0.87)"}}})}))((function(e){var n=e.uploadPath,t=e.bucketName,i=e.forceDisable,a=void 0!==i&&i,s=e.uploadFileFunction,r=e.uploadFolderFunction,c=e.classes,l=o.useState(null),d=(0,p.Z)(l,2),u=d[0],h=d[1],m=Boolean(u),f=function(){h(null)},x=(0,I.F)(n,[T.Ft.S3_PUT_OBJECT]),v=(0,I.F)(t,[T.Ft.S3_PUT_OBJECT],!1,!0),b=x||v;return(0,D.jsxs)(o.Fragment,{children:[(0,D.jsx)(L.Z,{id:"upload-main",tooltip:"Upload Files","aria-controls":"upload-main-menu","aria-haspopup":"true","aria-expanded":m?"true":void 0,onClick:function(e){h(e.currentTarget)},text:"Upload",icon:(0,D.jsx)(E.rG2,{}),color:"primary",variant:"contained",disabled:a||!b}),(0,D.jsxs)(A.Z,{id:"upload-main-menu","aria-labelledby":"upload-main",anchorEl:u,open:m,onClose:function(){f()},anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:[(0,D.jsxs)(U.Z,{onClick:function(){s(f)},disabled:!x||a,children:[(0,D.jsx)(G.Z,{className:c.listUploadIcons,children:(0,D.jsx)(E.rG2,{})}),(0,D.jsx)(W.Z,{children:"Upload File"})]}),(0,D.jsxs)(U.Z,{onClick:function(){r(f)},disabled:!v||a,children:[(0,D.jsx)(G.Z,{className:c.listUploadIcons,children:(0,D.jsx)(E.oXh,{})}),(0,D.jsx)(W.Z,{children:"Upload Folder"})]})]})]})})),V=t(72455),K=(0,V.Z)((function(e){return(0,r.Z)({detailsList:{borderColor:"#EAEDEE",borderWidth:0,borderStyle:"solid",borderRadius:3,borderBottomLeftRadius:0,borderBottomRightRadius:0,width:0,transitionDuration:"0.3s",overflowX:"hidden",overflowY:"auto",position:"relative",opacity:0,marginLeft:-1,"&.open":{width:300,minWidth:300,borderLeftWidth:1,opacity:1},"@media (max-width: 799px)":{"&.open":{width:"100%",minWidth:"100%",borderLeftWidth:0}}},closePanel:{position:"absolute",right:0,top:8,"& .min-icon":{width:14}}})})),J=function(e){var n=e.open,t=e.closePanel,i=e.className,o=void 0===i?"":i,a=e.children,s=K();return(0,D.jsxs)(u.ZP,{item:!0,className:"".concat(s.detailsList," ").concat(n?"open":""," ").concat(o," detailsListPanel"),children:[(0,D.jsx)(d.Z,{onClick:t,className:s.closePanel,children:(0,D.jsx)(E.oto,{})}),a]})},Y=t(64554),q=t(25183),X=t(34433),$=[{value:"01",label:"January"},{value:"02",label:"February"},{value:"03",label:"March"},{value:"04",label:"April"},{value:"05",label:"May"},{value:"06",label:"June"},{value:"07",label:"July"},{value:"08",label:"August"},{value:"09",label:"September"},{value:"10",label:"October"},{value:"11",label:"November"},{value:"12",label:"December"}],Q=Array.from(Array(31),(function(e,n){return n+1})),ee=(new Date).getFullYear(),ne=Array.from(Array(25),(function(e,n){return n+ee})),te=t(56028),ie=t(37516),oe=t(83679),ae=t(4942),se=t(28182),re=t(30829),ce=t(68096),le=t(58406),de=t(4834),ue=t(84570),he=(0,c.Z)((function(e){return(0,r.Z)({root:{"& .MuiSelect-icon":{color:"#000","&.Mui-disabled":{color:"#9c9c9c"}}},input:{borderBottom:0,fontSize:12}})}))(de.ZP),me=(0,o.forwardRef)((function(e,n){var t=e.classes,i=e.id,a=e.label,s=e.disableOptions,r=void 0!==s&&s,c=e.addSwitch,d=void 0!==c&&c,h=e.tooltip,m=void 0===h?"":h,f=e.borderBottom,x=void 0!==f&&f,v=e.onDateChange,b=e.value,g=void 0===b?"":b;(0,o.useImperativeHandle)(n,(function(){return{resetDate:B}}));var j=(0,o.useState)(!1),Z=(0,p.Z)(j,2),w=Z[0],y=Z[1],S=(0,o.useState)(""),C=(0,p.Z)(S,2),N=C[0],k=C[1],E=(0,o.useState)(""),I=(0,p.Z)(E,2),T=I[0],_=I[1],F=(0,o.useState)(""),P=(0,p.Z)(F,2),L=P[0],O=P[1];(0,o.useEffect)((function(){if(""!==g){var e=g.split("-");O(e[0]),k(e[1]),_("".concat(parseInt(e[2])))}}),[g]),(0,o.useEffect)((function(){var e=function(e,n,t){var i=Date.parse("".concat(e,"-").concat(n,"-").concat(t));if(isNaN(i))return[!1,""];var o=parseInt(n),a=parseInt(t),s=o<10?"0".concat(o):o,r=a<10?"0".concat(a):a,c=new Date(i).toISOString().split("T")[0],l="".concat(e,"-").concat(s,"-").concat(r);return[c===l,l]}(L,N,T),n=(0,p.Z)(e,2),t=n[0],i=n[1];v(i,t)}),[N,T,L,v]);var B=function(){k(""),_(""),O("")},R=function(){return r||!!d&&!w};return(0,D.jsxs)(u.ZP,{item:!0,xs:12,className:(0,se.Z)(t.fieldContainer,(0,ae.Z)({},t.fieldContainerBorder,x)),children:[(0,D.jsx)("div",{className:t.labelContainer,children:(0,D.jsxs)(u.ZP,{container:!0,children:[(0,D.jsxs)(re.Z,{htmlFor:i,className:t.inputLabel,children:[(0,D.jsx)("span",{children:a}),""!==m&&(0,D.jsx)("div",{className:t.tooltipContainer,children:(0,D.jsx)(l.Z,{title:m,placement:"top-start",children:(0,D.jsx)("div",{className:t.tooltip,children:(0,D.jsx)(ue.Z,{})})})})]}),d&&(0,D.jsx)(ie.Z,{indicatorLabels:["Specific Date","Default (7 Days)"],checked:w,value:"date_enabled",id:"date-status",name:"date-status",onChange:function(e){y(e.target.checked),e.target.checked||v("",!0)},switchOnly:!0})]})}),(0,D.jsxs)("div",{children:[(0,D.jsx)(ce.Z,{disabled:R(),className:t.dateInput,children:(0,D.jsxs)(le.Z,{id:"".concat(i,"-month"),name:"".concat(i,"-month"),value:N,displayEmpty:!0,onChange:function(e){k(e.target.value)},input:(0,D.jsx)(he,{}),children:[(0,D.jsx)(U.Z,{value:"",disabled:!0,children:""}),$.map((function(e){return(0,D.jsx)(U.Z,{value:e.value,children:e.label},"select-".concat(i,"-monthOP-").concat(e.label))}))]})}),(0,D.jsx)(ce.Z,{disabled:R(),className:t.dateInput,children:(0,D.jsxs)(le.Z,{id:"".concat(i,"-day"),name:"".concat(i,"-day"),value:T,displayEmpty:!0,onChange:function(e){_(e.target.value)},input:(0,D.jsx)(he,{}),children:[(0,D.jsx)(U.Z,{value:"",disabled:!0,children:""}),Q.map((function(e){return(0,D.jsx)(U.Z,{value:e,children:e},"select-".concat(i,"-dayOP-").concat(e))}))]})}),(0,D.jsx)(ce.Z,{disabled:R(),className:t.dateInput,children:(0,D.jsxs)(le.Z,{id:"".concat(i,"-year"),name:"".concat(i,"-year"),value:L,displayEmpty:!0,onChange:function(e){O(e.target.value)},input:(0,D.jsx)(he,{}),children:[(0,D.jsx)(U.Z,{value:"",disabled:!0,children:""}),ne.map((function(e){return(0,D.jsx)(U.Z,{value:e,children:e},"select-".concat(i,"-yearOP-").concat(e))}))]})})]})]})})),fe=(0,c.Z)((function(e){return(0,r.Z)((0,i.Z)((0,i.Z)((0,i.Z)({dateInput:{"&:not(:last-child)":{marginRight:22}}},m.YI),m.Hr),{},{labelContainer:{flex:1},fieldContainer:(0,i.Z)((0,i.Z)({},m.YI.fieldContainer),{},{display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:10,marginTop:11,marginBottom:6}),fieldContainerBorder:{borderBottom:"#9c9c9c 1px solid",marginBottom:20}}))}))(me),pe=(0,c.Z)((function(e){return(0,r.Z)((0,i.Z)((0,i.Z)((0,i.Z)((0,i.Z)({},m.DF),m.ID),m.bK),{},{dateSelector:{"& div":{borderBottom:0,marginBottom:0,"& div:nth-child(2)":{border:"1px solid #EAEAEA",paddingLeft:5,"& div":{border:0}}}}}))}))((function(e){var n=e.classes,t=e.open,i=e.closeModalAndRefresh,a=e.objectName,s=e.objectInfo,r=e.bucketName,c=(0,h.TL)(),l=(0,o.useState)(!0),d=(0,p.Z)(l,2),m=d[0],f=d[1],x=(0,o.useState)(""),v=(0,p.Z)(x,2),b=v[0],j=v[1],w=(0,o.useState)(""),y=(0,p.Z)(w,2),S=y[0],C=y[1],N=(0,o.useState)(!1),E=(0,p.Z)(N,2),I=E[0],T=E[1],_=(0,o.useState)(!1),P=(0,p.Z)(_,2),L=P[0],O=P[1],B=(0,o.useState)(!1),R=(0,p.Z)(B,2),z=R[0],M=R[1];(0,o.useEffect)((function(){if(s.retention_mode&&(j(s.retention_mode.toLowerCase()),M(!0)),s.retention_until_date){var e=new Date(s.retention_until_date);if("Invalid Date"!==e.toString()){var n=e.getFullYear(),t=(o=e.getMonth()+1)<10?"0".concat(o):"".concat(o),i=e.getDate();isNaN(i)||"NaN"===t||isNaN(n)||C("".concat(n,"-").concat(t,"-").concat(i))}M(!0)}var o}),[s]);var A=(0,o.useRef)(null),U=function(){f(!1),j(""),A.current&&A.current.resetDate()},W=z&&("governance"===b||""===b);return(0,D.jsxs)(te.Z,{title:"Set Retention Policy",modalOpen:t,onClose:function(){U(),i(!1)},children:[(0,D.jsxs)("div",{className:n.spacerBottom,children:[(0,D.jsx)("strong",{children:"Selected Object"}),": ",a]}),(0,D.jsxs)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(e){!function(e){e.preventDefault()}(e)},children:[W&&(0,D.jsx)(u.ZP,{item:!0,xs:12,className:n.formFieldRow,children:(0,D.jsx)(ie.Z,{value:"status",id:"status",name:"status",checked:m,onChange:function(e){f(!m)},label:"Status",indicatorLabels:["Enabled","Disabled"]})}),(0,D.jsx)(u.ZP,{item:!0,xs:12,className:n.formFieldRow,children:(0,D.jsx)(oe.Z,{currentSelection:b,id:"type",name:"type",label:"Type",disableOptions:!m||z&&""!==b,onChange:function(e){j(e.target.value)},selectorOptions:[{label:"Governance",value:"governance"},{label:"Compliance",value:"compliance"}]})}),(0,D.jsx)(u.ZP,{item:!0,xs:12,className:"".concat(n.dateSelector," "),children:(0,D.jsx)(fe,{id:"date",label:"Date",disableOptions:!(m&&("governance"===b||"compliance"===b)),ref:A,value:S,borderBottom:!0,onDateChange:function(e,n){T(n),n&&C(e)}})}),(0,D.jsxs)(u.ZP,{item:!0,xs:12,className:n.modalButtonBar,children:[(0,D.jsx)(k.Z,{type:"button",variant:"outlined",color:"primary",onClick:U,children:"Reset"}),(0,D.jsx)(k.Z,{type:"submit",variant:"contained",color:"primary",disabled:m&&""===b||m&&!I||L,onClick:function(){O(!0);var e=s.name,n=s.version_id,t=m||"governance"!==b?"".concat(S,"T23:59:59Z"):"";m||"governance"!==b?function(e,n,t){g.Z.invoke("PUT","/api/v1/buckets/".concat(r,"/objects/retention?prefix=").concat((0,Z.LL)(e),"&version_id=").concat(n),{expires:t,mode:b}).then((function(e){O(!1),i(!0)})).catch((function(e){c((0,F.zb)(e)),O(!1)}))}(e,n,t):function(e,n){g.Z.invoke("DELETE","/api/v1/buckets/".concat(r,"/objects/retention?prefix=").concat((0,Z.LL)(e),"&version_id=").concat(n)).then((function(){O(!1),i(!0)})).catch((function(e){c((0,F.zb)(e)),O(!1)}))}(e,n)},children:"Save"})]})]})]})})),xe=t(51691),ve=t(2148),be=t(9505),ge=function(e){var n=e.closeDeleteModalAndRefresh,t=e.deleteOpen,i=e.selectedBucket,a=e.selectedObject,s=e.versioning,r=e.selectedVersion,c=void 0===r?"":r,l=(0,h.TL)(),d=(0,be.Z)((function(){return n(!0)}),(function(e){return l((0,F.Ih)(e))})),u=(0,p.Z)(d,2),m=u[0],f=u[1],x=(0,o.useState)(!1),v=(0,p.Z)(x,2),b=v[0],g=v[1];if(!a)return null;return(0,D.jsx)(ve.Z,{title:"Delete Object",confirmText:"Delete",isOpen:t,titleIcon:(0,D.jsx)(E.NvT,{}),isLoading:m,onConfirm:function(){var e=(0,Z.IO)(a).endsWith("/");f("DELETE","/api/v1/buckets/".concat(i,"/objects?path=").concat(a).concat(""!==c?"&version_id=".concat(c):"&recursive=".concat(e,"&all_versions=").concat(b)))},onClose:function(){return n(!1)},confirmationContent:(0,D.jsxs)(xe.Z,{children:["Are you sure you want to delete: ",(0,D.jsx)("br",{}),(0,D.jsx)("b",{children:(0,Z.IO)(a)})," ",""!==c?(0,D.jsxs)(o.Fragment,{children:[(0,D.jsx)("br",{}),(0,D.jsx)("br",{}),"Version ID:",(0,D.jsx)("br",{}),(0,D.jsx)("strong",{children:c})]}):"","? ",(0,D.jsx)("br",{}),(0,D.jsx)("br",{}),s&&""===c&&(0,D.jsx)(ie.Z,{label:"Delete All Versions",indicatorLabels:["Yes","No"],checked:b,value:"delete_versions",id:"delete-versions",name:"delete-versions",onChange:function(e){g(!b)},description:""})]})})},je=(0,c.Z)((function(e){return(0,r.Z)((0,i.Z)((0,i.Z)((0,i.Z)({},m.DF),m.ID),m.bK))}))((function(e){var n=e.classes,t=e.open,i=e.closeModalAndRefresh,a=e.objectName,s=e.bucketName,r=e.actualInfo,c=(0,h.TL)(),l=(0,o.useState)(!1),d=(0,p.Z)(l,2),m=d[0],f=d[1],x=(0,o.useState)(!1),v=(0,p.Z)(x,2),j=v[0],w=v[1],y=r.version_id;(0,o.useEffect)((function(){var e=b()(r,"legal_hold_status","OFF");f("ON"===e)}),[r]);var S=function(){f(!1)};return(0,D.jsxs)(te.Z,{title:"Set Legal Hold",modalOpen:t,onClose:function(){S(),i(!1)},children:[(0,D.jsxs)(u.ZP,{item:!0,xs:12,className:n.spacerBottom,children:["Object: ",s]}),(0,D.jsxs)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(e){!function(e){e.preventDefault(),w(!0),g.Z.invoke("PUT","/api/v1/buckets/".concat(s,"/objects/legalhold?prefix=").concat((0,Z.LL)(a),"&version_id=").concat(y),{status:m?"enabled":"disabled"}).then((function(){w(!1),i(!0)})).catch((function(e){c((0,F.zb)(e)),w(!1)}))}(e)},children:[(0,D.jsx)(u.ZP,{item:!0,xs:12,className:n.formFieldRow,children:(0,D.jsx)(ie.Z,{value:"legalhold",id:"legalhold",name:"legalhold",checked:m,onChange:function(e){f(!m)},label:"Legal Hold Status",indicatorLabels:["Enabled","Disabled"],tooltip:"To enable this feature you need to enable versioning on the bucket before creation"})}),(0,D.jsxs)(u.ZP,{item:!0,xs:12,className:n.modalButtonBar,children:[(0,D.jsx)(k.Z,{type:"button",color:"primary",variant:"outlined",onClick:S,children:"Clear"}),(0,D.jsx)(k.Z,{type:"submit",variant:"contained",color:"primary",disabled:j,children:"Save"})]})]})]})})),Ze=t(78562),we=t(79836),ye=t(53382),Se=t(35855),Ce=t(53994),Ne=(0,c.Z)((function(e){return(0,r.Z)((0,i.Z)((0,i.Z)({propertiesIcon:{marginLeft:5,"& .min-icon":{height:12}},capitalizeFirst:{textTransform:"capitalize","& .min-icon":{width:16,height:16}},titleItem:{width:"35%"}},m.bK),m.$b))}))((function(e){var n=e.bucketName,t=e.internalPaths,i=e.classes,a=e.actualInfo,s=e.linear,r=void 0!==s&&s,c=(0,o.useState)({}),l=(0,p.Z)(c,2),d=l[0],h=l[1],m=(0,be.Z)((function(e){var n=b()(e,"objectMetadata",{});h(n)}),(function(e){return!1})),f=(0,p.Z)(m,2)[1],x=Object.keys(d),v=(0,o.useCallback)((function(){f("GET","/api/v1/buckets/".concat(n,"/objects/metadata?prefix=").concat(t))}),[n,t,a]);return(0,o.useEffect)((function(){a&&v()}),[a,v]),r?(0,D.jsx)(o.Fragment,{children:x.map((function(e,n){var t=Array.isArray(d[e])?d[e].map(decodeURIComponent).join(", "):decodeURIComponent(d[e]);return(0,D.jsxs)(Y.Z,{className:i.metadataLinear,children:[(0,D.jsx)("strong",{children:e}),(0,D.jsx)("br",{}),t]},"box-meta-".concat(e,"-").concat(n.toString()))}))}):(0,D.jsxs)(u.ZP,{container:!0,children:[(0,D.jsx)(u.ZP,{item:!0,xs:12,sx:{marginTop:"25px",marginBottom:"5px"},children:(0,D.jsx)("h3",{style:{marginTop:"0",marginBottom:"0"},children:"Object Metadata"})}),(0,D.jsx)(u.ZP,{item:!0,xs:12,children:(0,D.jsx)(we.Z,{className:i.table,"aria-label":"simple table",children:(0,D.jsx)(ye.Z,{children:x.map((function(e,n){var t=Array.isArray(d[e])?d[e].map(decodeURIComponent).join(", "):decodeURIComponent(d[e]);return(0,D.jsxs)(Se.Z,{children:[(0,D.jsx)(Ce.Z,{component:"th",scope:"row",className:i.titleItem,children:e}),(0,D.jsx)(Ce.Z,{align:"right",children:t})]},"tRow-".concat(n.toString()))}))})})})]})})),ke=t(45987),Ee=["disabled","onClick","icon","label","classes"],Ie=(0,c.Z)((function(e){return(0,r.Z)({root:{padding:"0 15px",height:22,margin:0,color:"#5E5E5E",fontWeight:"normal",fontSize:14,whiteSpace:"nowrap",width:"100%",justifyContent:"flex-start","&:hover":{backgroundColor:"transparent",color:"#000"},"& .min-icon":{width:11},"&:disabled":{color:"#EBEBEB",borderColor:"#EBEBEB"}}})}))((function(e){var n=e.disabled,t=e.onClick,o=e.icon,a=e.label,s=e.classes,r=(0,ke.Z)(e,Ee);return(0,D.jsx)(k.Z,(0,i.Z)((0,i.Z)({},r),{},{disabled:n,onClick:t,className:(0,se.Z)(s.root,"noDefaultHeight"),startIcon:o,sx:{height:"initial"},children:(0,D.jsx)("span",{className:"buttonItem",children:a})}))})),Te=(0,c.Z)((function(){return(0,r.Z)((0,i.Z)({},m.$b))}))((function(e){var n=e.items,t=e.classes,i=e.title;return(0,D.jsxs)(o.Fragment,{children:[(0,D.jsx)("div",{className:t.titleLabel,children:i}),(0,D.jsxs)("ul",{className:t.objectActions,children:[(0,D.jsx)("li",{children:"Actions:"}),n.map((function(e,n){return(0,D.jsx)("li",{children:(0,D.jsx)(Ie,{label:e.label,icon:e.icon,onClick:e.action,disabled:e.disabled})},"action-element-".concat(n.toString()))}))]})]})})),_e=t(37762),Fe=t(71863),Pe=t(82314),Le=(0,c.Z)((function(e){return(0,r.Z)({fileName:{display:"flex",alignItems:"center","& .min-icon":{width:16,height:16,marginRight:4,minWidth:16,minHeight:16}},fileNameText:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}})}))((function(e){var n=e.classes,t=e.icon,i=e.strings;return(0,D.jsxs)("div",{className:n.fileName,children:[t,(0,D.jsx)("span",{className:n.fileNameText,children:i[i.length-1]})]})})),De=o.lazy((function(){return Promise.resolve().then(t.bind(t,76181))})),Oe=o.lazy((function(){return Promise.resolve().then(t.bind(t,49563))})),Be=o.lazy((function(){return Promise.resolve().then(t.bind(t,21733))})),Re=o.lazy((function(){return Promise.resolve().then(t.bind(t,95232))})),ze=o.lazy((function(){return Promise.resolve().then(t.bind(t,27529))})),Me=o.lazy((function(){return Promise.resolve().then(t.bind(t,60527))})),Ae=o.lazy((function(){return Promise.resolve().then(t.bind(t,69812))})),Ue=o.lazy((function(){return Promise.resolve().then(t.bind(t,46454))})),We=o.lazy((function(){return Promise.resolve().then(t.bind(t,84820))})),Ge=o.lazy((function(){return Promise.resolve().then(t.bind(t,40599))})),He=o.lazy((function(){return Promise.resolve().then(t.bind(t,72995))})),Ve=o.lazy((function(){return Promise.resolve().then(t.bind(t,34171))})),Ke=o.lazy((function(){return Promise.resolve().then(t.bind(t,30745))})),Je=o.lazy((function(){return Promise.resolve().then(t.bind(t,84033))})),Ye=o.lazy((function(){return Promise.resolve().then(t.bind(t,52009))})),qe=[{icon:(0,D.jsx)(Ke,{}),extensions:["mp4","mov","avi","mpeg","mpg"]},{icon:(0,D.jsx)(We,{}),extensions:["mp3","m4a","aac"]},{icon:(0,D.jsx)(Ge,{}),extensions:["pdf"]},{icon:(0,D.jsx)(He,{}),extensions:["ppt","pptx"]},{icon:(0,D.jsx)(Je,{}),extensions:["xls","xlsx"]},{icon:(0,D.jsx)(Ae,{}),extensions:["cer","crt","pem"]},{icon:(0,D.jsx)(Oe,{}),extensions:["html","xml","css","py","go","php","cpp","h","java"]},{icon:(0,D.jsx)(Be,{}),extensions:["cfg","yaml"]},{icon:(0,D.jsx)(Re,{}),extensions:["sql"]},{icon:(0,D.jsx)(ze,{}),extensions:["ttf","otf"]},{icon:(0,D.jsx)(Ve,{}),extensions:["txt"]},{icon:(0,D.jsx)(Ye,{}),extensions:["zip","rar","tar","gz"]},{icon:(0,D.jsx)(De,{}),extensions:["epub","mobi","azw","azw3"]},{icon:(0,D.jsx)(Me,{}),extensions:["jpeg","jpg","gif","tiff","png","heic","dng"]}],Xe=function(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],t=e,i=(0,D.jsx)(Fe.Z,{});e.endsWith("/")&&(i=(0,D.jsx)(Pe.Z,{}),t=e.slice(0,-1));var o,a=e.toLowerCase(),s=(0,_e.Z)(qe);try{for(s.s();!(o=s.n()).done;){var r,c=o.value,l=(0,_e.Z)(c.extensions);try{for(l.s();!(r=l.n()).done;){var d=r.value;a.endsWith(".".concat(d))&&(i=c.icon)}}catch(h){l.e(h)}finally{l.f()}}}catch(h){s.e(h)}finally{s.f()}!e.endsWith("/")&&e.indexOf(".")<0&&(i=(0,D.jsx)(Ue,{}));var u=t.split("/");return n?i:(0,D.jsx)(Le,{icon:i,strings:u})},$e=t(21435),Qe=t(81918),en=t(29823),nn=(0,c.Z)((function(e){return(0,r.Z)((0,i.Z)((0,i.Z)((0,i.Z)({newTileHeader:{fontSize:18,fontWeight:"bold",color:"#000",margin:"35px 0",paddingBottom:15,display:"flex",alignItems:"center","& > svg":{marginRight:10}},tagsForLabel:{fontSize:16,margin:"20px 0 30px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",width:"100%"},currentTagsContainer:{fontSize:14,fontWeight:"normal"},noTagsForObject:{color:"#858585"},deleteTag:{color:"#C83B51",marginLeft:5}},m.DF),m.ID),m.bK))}))((function(e){var n=e.modalOpen,t=e.onCloseAndUpdate,s=e.bucketName,r=e.actualInfo,c=e.classes,l=(0,h.TL)(),d=(0,a.v9)(F.N5),m=(0,o.useState)(""),f=(0,p.Z)(m,2),x=f[0],v=f[1],j=(0,o.useState)(""),w=(0,p.Z)(j,2),y=w[0],S=w[1],C=(0,o.useState)(!1),N=(0,p.Z)(C,2),_=N[0],P=N[1],L=(0,o.useState)(!1),O=(0,p.Z)(L,2),B=O[0],R=O[1],z=(0,o.useState)(""),M=(0,p.Z)(z,2),A=M[0],U=M[1],W=(0,o.useState)(""),G=(0,p.Z)(W,2),H=G[0],V=G[1],K=(0,Z.LL)(r.name),J=r.tags,q=Object.keys(J||{}),X=r.name.split("/").pop()||"",$=function(e){return(0,D.jsxs)("div",{className:c.tagsForLabel,children:["Tag",e?"s":""," for: ",(0,D.jsx)("strong",{children:X})]})};return(0,D.jsx)(o.Fragment,{children:(0,D.jsx)(te.Z,{modalOpen:n,title:B?(0,D.jsx)("span",{style:{color:"#C83B51"},children:"Delete Tag"}):"Edit Tags",onClose:function(){t(!0)},titleIcon:B?(0,D.jsx)(E.dRf,{style:{fill:"#C83B51"}}):(0,D.jsx)(E.T0F,{}),children:B?(0,D.jsx)(o.Fragment,{children:(0,D.jsxs)(u.ZP,{container:!0,children:[$(!1),"Are you sure you want to delete the tag"," ",(0,D.jsxs)("b",{className:c.deleteTag,children:[A," : ",H]})," ","?",(0,D.jsxs)(u.ZP,{item:!0,xs:12,className:c.modalButtonBar,children:[(0,D.jsx)(k.Z,{type:"button",variant:"outlined",color:"primary",onClick:function(){U(""),V(""),R(!1)},children:"Cancel"}),(0,D.jsx)(k.Z,{type:"submit",variant:"outlined",color:"secondary",onClick:function(){var e=(0,i.Z)({},J);delete e[A];var n=d?r.version_id:"null";g.Z.invoke("PUT","/api/v1/buckets/".concat(s,"/objects/tags?prefix=").concat(K,"&version_id=").concat(n),{tags:e}).then((function(e){t(!0),P(!1)})).catch((function(e){l((0,F.zb)(e)),P(!1)}))},id:"deleteTag",children:"Delete Tag"})]})]})}):(0,D.jsxs)(u.ZP,{container:!0,children:[(0,D.jsx)(I.s,{scopes:[T.Ft.S3_GET_OBJECT_TAGGING],resource:s,children:(0,D.jsxs)(Y.Z,{sx:{display:"flex",flexFlow:"column",width:"100%"},children:[$(!0),(0,D.jsxs)("div",{className:c.currentTagsContainer,children:["Current Tags:",(0,D.jsx)("br",{}),0===q.length?(0,D.jsx)("span",{className:c.noTagsForObject,children:"There are no tags for this object"}):(0,D.jsx)(o.Fragment,{}),(0,D.jsx)(Y.Z,{sx:{marginTop:"5px",marginBottom:"15px"},children:q.map((function(e,n){var t=b()(J,"".concat(e),"");return""!==t?(0,D.jsx)(I.s,{scopes:[T.Ft.S3_DELETE_OBJECT_TAGGING],resource:s,matchAll:!0,errorProps:{deleteIcon:null,onDelete:null},children:(0,D.jsx)(Qe.Z,{style:{textTransform:"none",marginRight:"5px",marginBottom:"5px"},size:"small",label:"".concat(e," : ").concat(t),color:"primary",deleteIcon:(0,D.jsx)(en.Z,{}),onDelete:function(){!function(e,n){U(e),V(n),R(!0)}(e,t)}})},"chip-".concat(n)):null}))})]})]})}),(0,D.jsx)(I.s,{scopes:[T.Ft.S3_PUT_OBJECT_TAGGING],resource:s,errorProps:{disabled:!0,onClick:null},children:(0,D.jsxs)(u.ZP,{container:!0,children:[(0,D.jsxs)(u.ZP,{item:!0,xs:12,className:c.newTileHeader,children:[(0,D.jsx)(E.OCT,{})," Add New Tag"]}),(0,D.jsx)(u.ZP,{item:!0,xs:12,className:c.formFieldRow,children:(0,D.jsx)($e.Z,{value:x,label:"Tag Key",id:"newTagKey",name:"newTagKey",placeholder:"Enter Tag Key",onChange:function(e){v(e.target.value)}})}),(0,D.jsx)(u.ZP,{item:!0,xs:12,className:c.formFieldRow,children:(0,D.jsx)($e.Z,{value:y,label:"Tag Label",id:"newTagLabel",name:"newTagLabel",placeholder:"Enter Tag Label",onChange:function(e){S(e.target.value)}})}),(0,D.jsxs)(u.ZP,{item:!0,xs:12,className:c.modalButtonBar,children:[(0,D.jsx)(k.Z,{type:"button",variant:"outlined",color:"primary",onClick:function(){S(""),v("")},children:"Clear"}),(0,D.jsx)(k.Z,{type:"submit",variant:"contained",color:"primary",disabled:""===y.trim()||""===x.trim()||_,onClick:function(){P(!0);var e={};e[x]=y;var n=(0,i.Z)((0,i.Z)({},J),e),o=d?r.version_id:"null";g.Z.invoke("PUT","/api/v1/buckets/".concat(s,"/objects/tags?prefix=").concat(K,"&version_id=").concat(o),{tags:n}).then((function(e){t(!0),P(!1)})).catch((function(e){l((0,F.zb)(e)),P(!1)}))},id:"saveTag",children:"Save"})]})]})})]})})})})),tn=t(74165),on=t(15861),an=t(73669),sn=(0,c.Z)((function(e){return(0,r.Z)((0,i.Z)((0,i.Z)((0,i.Z)({},m.DF),m.ID),m.bK))}))((function(e){var n=e.classes,t=e.closeInspectModalAndRefresh,i=e.inspectOpen,a=e.inspectPath,s=e.volumeName,r=(0,h.TL)(),c=function(){return t(!1)},l=(0,o.useState)(!0),d=(0,p.Z)(l,2),m=d[0],f=d[1],x=(0,o.useState)(""),v=(0,p.Z)(x,2),b=v[0],g=v[1],j=(0,o.useState)(""),w=(0,p.Z)(j,2),y=w[0],S=w[1];if(!a)return null;var C=function(){var e=(0,on.Z)((0,tn.Z)().mark((function e(n){return(0,tn.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch(n,{method:"GET"});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),N=function(){var e=(0,on.Z)((0,tn.Z)().mark((function e(){var n,t,i;return(0,tn.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=(0,Z.LL)(a+"/xl.meta"),t=(0,Z.LL)(s),i="/api/v1/admin/inspect?volume=".concat(t,"&file=").concat(n,"&encrypt=").concat(m),C(i).then(function(){var e=(0,on.Z)((0,tn.Z)().mark((function e(n){var t,i,o,a;return(0,tn.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.ok){e.next=5;break}return e.next=3,n.json();case 3:t=e.sent,r((0,F.Ih)({errorMessage:t.message,detailedError:t.code}));case 5:return e.next=7,n.blob();case 7:if(i=e.sent,o=n.headers.get("content-disposition").split('"')[1],a=(0,Z.Do)(o)||"",(0,Z.zZ)(i,o),S(o),""!==a){e.next=15;break}return c(),e.abrupt("return");case 15:g(a);case 16:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}()).catch((function(e){r((0,F.Ih)(e))}));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,D.jsxs)(o.Fragment,{children:[!b&&(0,D.jsx)(te.Z,{modalOpen:i,titleIcon:(0,D.jsx)(q.Gp,{}),title:"Inspect Object",onClose:c,children:(0,D.jsxs)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(e){!function(e){e.preventDefault()}(e)},children:["Would you like to encrypt ",(0,D.jsx)("b",{children:(0,Z.IO)(a)}),"?"," ",(0,D.jsx)("br",{}),(0,D.jsx)(ie.Z,{label:"Encrypt",indicatorLabels:["Yes","No"],checked:m,value:"encrypt",id:"encrypt",name:"encrypt",onChange:function(e){f(!m)},description:""}),(0,D.jsx)(u.ZP,{item:!0,xs:12,className:n.modalButtonBar,children:(0,D.jsx)(k.Z,{type:"submit",variant:"contained",color:"primary",onClick:N,children:"Inspect"})})]})}),b?(0,D.jsx)(te.Z,{modalOpen:i,title:"Inspect Decryption Key",onClose:function(){(0,Z.kT)(y),c(),g("")},titleIcon:(0,D.jsx)(E.tvm,{}),children:(0,D.jsxs)(xe.Z,{children:[(0,D.jsxs)(Y.Z,{children:["This will be displayed only once. It cannot be recovered.",(0,D.jsx)("br",{}),"Use secure medium to share this key."]}),(0,D.jsx)(Y.Z,{children:(0,D.jsx)(an.Z,{value:b})})]})}):null]})})),rn=t(72401),cn=t(76610),ln=(0,V.Z)((function(e){return(0,r.Z)((0,i.Z)((0,i.Z)((0,i.Z)((0,i.Z)({},m.ID),m.DF),m.bK),(0,m.Bz)(e.spacing(4))))})),dn=function(e){var n=e.open,t=e.closeModal,i=e.currentItem,a=e.internalPaths,s=e.actualInfo,r=e.bucketName,c=ln(),l=(0,h.TL)(),d=(0,o.useState)(i),m=(0,p.Z)(d,2),f=m[0],x=m[1],v=(0,o.useState)(!1),b=(0,p.Z)(v,2),g=b[0],j=b[1];return(0,D.jsxs)(te.Z,{title:"Rename Download",modalOpen:n,onClose:t,titleIcon:(0,D.jsx)(E.dY8,{}),children:[(0,D.jsxs)("div",{children:["The file you are trying to download has a long name.",(0,D.jsx)("br",{}),"This can cause issues on Windows Systems by trimming the file name after download.",(0,D.jsx)("br",{}),(0,D.jsx)("br",{})," We recommend to rename the file download"]}),(0,D.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:function(e){!function(e){e.preventDefault();var n=(0,Z.LL)("".concat(r,"-").concat(s.name,"-").concat((new Date).getTime(),"-").concat(Math.random())),i=(0,R.LR)(r,a,s.version_id,parseInt(s.size||"0"),f,(function(e){l((0,P.RO)({instanceID:n,progress:e}))}),(function(){l((0,P.oK)(n))}),(function(e){l((0,P.qJ)({instanceID:n,msg:e}))}),(function(){l((0,P.Im)(n))})),o=(0,cn.YO)(8);(0,cn.EN)(o,i),l((0,P.Mc)({ID:o,bucketName:r,done:!1,instanceID:n,percentage:0,prefix:f,type:"download",waitingForFile:!0,failed:!1,cancelled:!1,errorMessage:""})),i.send(),t()}(e)},children:(0,D.jsxs)(u.ZP,{container:!0,children:[(0,D.jsxs)(u.ZP,{item:!0,xs:12,className:c.modalFormScrollable,children:[(0,D.jsx)(u.ZP,{item:!0,xs:12,className:c.formFieldRow,children:(0,D.jsx)($e.Z,{id:"download-filename",name:"download-filename",onChange:function(e){x(e.target.value)},label:"",type:"text",value:f,error:f.length>200&&!g?"Filename should be less than 200 characters long.":""})}),(0,D.jsx)(u.ZP,{item:!0,xs:12,className:c.formFieldRow,children:(0,D.jsx)(ie.Z,{value:"acceptLongName",id:"acceptLongName",name:"acceptLongName",checked:g,onChange:function(e){j(e.target.checked),e.target.checked&&x(i)},label:"Use Original Name"})})]}),(0,D.jsx)(u.ZP,{item:!0,xs:12,className:c.modalButtonBar,children:(0,D.jsx)(k.Z,{type:"submit",variant:"contained",color:"primary",disabled:f.length>200&&!g,children:"Download File"})})]})})]})},un={is_latest:!0,last_modified:"",legal_hold_status:"",name:"",retention_mode:"",retention_until_date:"",size:"0",tags:{},version_id:null},hn=(0,c.Z)((function(){return(0,r.Z)((0,i.Z)((0,i.Z)((0,i.Z)((0,i.Z)((0,i.Z)({ObjectDetailsTitle:{display:"flex",alignItems:"center","& .min-icon":{width:26,height:26,minWidth:26,minHeight:26}},objectNameContainer:{whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",alignItems:"center",marginLeft:10},headerForSection:{display:"flex",justifyContent:"space-between",alignItems:"center",paddingBottom:15,borderBottom:"#E2E2E2 2px solid",fontWeight:"bold",fontSize:18,color:"#000",margin:"20px 22px"},capitalizeFirst:{textTransform:"capitalize"}},m.Si),m.OR),m.bK),m.VI),m.$b))}))((function(e){var n=e.classes,t=e.internalPaths,i=e.bucketName,s=e.versioning,r=e.locking,c=e.onClosePanel,l=(0,h.TL)(),d=(0,a.v9)(F.N5),m=(0,a.v9)((function(e){return e.objectBrowser.versionsMode})),f=(0,a.v9)((function(e){return e.objectBrowser.selectedVersion})),x=(0,a.v9)((function(e){return e.objectBrowser.loadingObjectInfo})),v=(0,o.useState)(!1),j=(0,p.Z)(v,2),w=j[0],y=j[1],S=(0,o.useState)(!1),C=(0,p.Z)(S,2),N=C[0],_=C[1],L=(0,o.useState)(!1),O=(0,p.Z)(L,2),B=O[0],z=O[1],M=(0,o.useState)(!1),A=(0,p.Z)(M,2),U=A[0],W=A[1],G=(0,o.useState)(!1),H=(0,p.Z)(G,2),V=H[0],K=H[1],J=(0,o.useState)(null),$=(0,p.Z)(J,2),Q=$[0],ee=$[1],ne=(0,o.useState)([]),te=(0,p.Z)(ne,2),ie=te[0],oe=te[1],ae=(0,o.useState)(null),se=(0,p.Z)(ae,2),re=se[0],ce=se[1],le=(0,o.useState)([]),de=(0,p.Z)(le,2),ue=de[0],he=de[1],me=(0,o.useState)(!1),fe=(0,p.Z)(me,2),xe=fe[0],ve=fe[1],be=(0,o.useState)(!1),we=(0,p.Z)(be,2),ye=we[0],Se=we[1],Ce=(0,o.useState)(0),ke=(0,p.Z)(Ce,2),Ee=ke[0],Ie=ke[1],_e=(0,o.useState)(!1),Fe=(0,p.Z)(_e,2),Pe=Fe[0],Le=Fe[1],De=((0,Z.IO)(t)||"").split("/").pop()||"",Oe=[];Q&&(Oe=Q.name.split("/")),(0,o.useEffect)((function(){if(d&&ie&&ie.length>=1){var e=ie.find((function(e){return e.is_latest}))||un;""!==f&&(e=ie.find((function(e){return e.version_id===f}))||un),ee(e)}}),[f,d,ie]),(0,o.useEffect)((function(){x&&""!==t&&g.Z.invoke("GET","/api/v1/buckets/".concat(i,"/objects?prefix=").concat(t).concat(d?"&with_versions=true":"")).then((function(e){var n=b()(e,"objects",[]);if(d){oe(n),he(n);var t=n.reduce((function(e,n){return null!==n&&void 0!==n&&n.size?e+n.size:e}),0);Ie(t)}else ee(n[0]),he([]);l((0,P.vH)(!1))})).catch((function(e){console.error("Error loading object details",e),l((0,P.vH)(!1))}))}),[x,i,t,l,d,f]);var Be=[];Q&&Q.tags&&(Be=Object.keys(Q.tags));var Re=(0,D.jsx)("div",{style:{textAlign:"center",marginTop:35},children:(0,D.jsx)(rn.Z,{})});if(!Q)return x?Re:null;var ze=Oe.length>0?Oe[Oe.length-1]:Q.name,Me=[i,De,[i,Q.name].join("/")],Ae=[{action:function(){!function(e){var n=(0,Z.LL)("".concat(i,"-").concat(e.name,"-").concat((new Date).getTime(),"-").concat(Math.random()));if(e.name.length>200&&(0,Z.mv)().toLowerCase().includes("win"))Le(!0);else{var o=(0,R.LR)(i,t,e.version_id,parseInt(e.size||"0"),null,(function(e){l((0,P.RO)({instanceID:n,progress:e}))}),(function(){l((0,P.oK)(n))}),(function(e){l((0,P.qJ)({instanceID:n,msg:e}))}),(function(){l((0,P.Im)(n))})),a=(0,cn.YO)(8);(0,cn.EN)(a,o),l((0,P.Mc)({ID:a,bucketName:i,done:!1,instanceID:n,percentage:0,prefix:e.name,type:"download",waitingForFile:!0,failed:!1,cancelled:!1,errorMessage:""})),o.send()}}(Q)},label:"Download",disabled:!!Q.is_delete_marker||!(0,I.F)(Me,[T.Ft.S3_GET_OBJECT]),icon:(0,D.jsx)(E._8t,{}),tooltip:"Download this Object"},{action:function(){y(!0)},label:"Share",disabled:!!Q.is_delete_marker||!(0,I.F)(Me,[T.Ft.S3_GET_OBJECT]),icon:(0,D.jsx)(E.aAc,{}),tooltip:"Share this File"},{action:function(){Se(!0)},label:"Preview",disabled:!!Q.is_delete_marker||"none"===(0,R.Bg)(De)||!(0,I.F)(Me,[T.Ft.S3_GET_OBJECT]),icon:(0,D.jsx)(E.P99,{}),tooltip:"Preview this File"},{action:function(){W(!0)},label:"Legal Hold",disabled:!r||!d||!!Q.is_delete_marker||!(0,I.F)(i,[T.Ft.S3_PUT_OBJECT_LEGAL_HOLD])||""!==f,icon:(0,D.jsx)(E.fNL,{}),tooltip:"Change Legal Hold rules for this File"},{action:function(){_(!0)},label:"Retention",disabled:!d||!!Q.is_delete_marker||!(0,I.F)(Me,[T.Ft.S3_GET_OBJECT_RETENTION])||""!==f,icon:(0,D.jsx)(E.E9d,{}),tooltip:"Change Retention rules for this File"},{action:function(){z(!0)},label:"Tags",disabled:!!Q.is_delete_marker||""!==f||!(0,I.F)(Me,[T.Ft.S3_PUT_OBJECT_TAGGING]),icon:(0,D.jsx)(E.DgT,{}),tooltip:"Change Tags for this File"},{action:function(){K(!0)},label:"Inspect",disabled:!d||!!Q.is_delete_marker||""!==f||!(0,I.F)(Me,[T.Ft.ADMIN_INSPECT_DATA]),icon:(0,D.jsx)(q.Gp,{}),tooltip:"Inspect this file"},{action:function(){l((0,P.db)({status:!m,objectName:ze}))},label:m?"Hide Object Versions":"Display Object Versions",icon:(0,D.jsx)(E.cRd,{}),disabled:!d||!(Q.version_id&&"null"!==Q.version_id)||!(0,I.F)(Me,[T.Ft.S3_GET_BUCKET_VERSIONING,T.Ft.S3_PUT_BUCKET_VERSIONING,T.Ft.S3_GET_OBJECT_VERSION]),tooltip:"Display Versions for this file"}];return(0,D.jsxs)(o.Fragment,{children:[w&&Q&&(0,D.jsx)(X.default,{open:w,closeModalAndRefresh:function(){ce(null),y(!1)},bucketName:i,dataObject:re||Q}),N&&Q&&(0,D.jsx)(pe,{open:N,closeModalAndRefresh:function(e){_(!1),e&&l((0,P.vH)(!0))},objectName:De,objectInfo:Q,bucketName:i}),xe&&(0,D.jsx)(ge,{deleteOpen:xe,selectedBucket:i,selectedObject:t,closeDeleteModalAndRefresh:function(e){ve(!1),e&&""===f?c(!0):(l((0,P.Eq)(!0)),l((0,P.M3)("")),l((0,P.vH)(!0)))},versioning:d&&s,selectedVersion:f}),U&&Q&&(0,D.jsx)(je,{open:U,closeModalAndRefresh:function(e){W(!1),e&&l((0,P.vH)(!0))},objectName:Q.name,bucketName:i,actualInfo:Q}),ye&&Q&&(0,D.jsx)(Ze.default,{open:ye,bucketName:i,object:{name:Q.name,version_id:Q.version_id||"null",size:parseInt(Q.size||"0"),content_type:"",last_modified:new Date(Q.last_modified)},onClosePreview:function(){Se(!1)}}),B&&Q&&(0,D.jsx)(nn,{modalOpen:B,bucketName:i,actualInfo:Q,onCloseAndUpdate:function(e){z(!1),e&&l((0,P.vH)(!0))}}),V&&Q&&(0,D.jsx)(sn,{inspectOpen:V,volumeName:i,inspectPath:Q.name,closeInspectModalAndRefresh:function(e){K(!1),e&&l((0,P.vH)(!0))}}),Pe&&Q&&(0,D.jsx)(dn,{open:Pe,closeModal:function(){Le(!1)},currentItem:De,bucketName:i,internalPaths:t,actualInfo:Q}),x?(0,D.jsx)(o.Fragment,{children:Re}):(0,D.jsxs)(o.Fragment,{children:[(0,D.jsx)(Te,{title:(0,D.jsxs)("div",{className:n.ObjectDetailsTitle,children:[Xe(ze,!0),(0,D.jsx)("span",{className:n.objectNameContainer,children:ze})]}),items:Ae}),(0,D.jsx)(u.ZP,{item:!0,xs:12,sx:{textAlign:"center"},children:(0,D.jsx)(I.s,{resource:[i,De,[i,Q.name].join("/")],scopes:[T.Ft.S3_DELETE_OBJECT],errorProps:{disabled:!0},children:(0,D.jsxs)(k.Z,{startIcon:(0,D.jsx)(E.pJl,{}),color:"secondary",variant:"outlined",onClick:function(){ve(!0)},disabled:""===f&&Q.is_delete_marker,sx:{width:"calc(100% - 44px)",margin:"8px 0","& svg.min-icon":{width:14,height:14}},children:["Delete",""!==f?" version":""]})})}),(0,D.jsxs)(u.ZP,{item:!0,xs:12,className:n.headerForSection,children:[(0,D.jsx)("span",{children:"Object Info"}),(0,D.jsx)(E.Gvh,{})]}),(0,D.jsxs)(Y.Z,{className:n.detailContainer,children:[(0,D.jsx)("strong",{children:"Name:"}),(0,D.jsx)("br",{}),(0,D.jsx)("div",{style:{overflowWrap:"break-word"},children:ze})]}),""!==f&&(0,D.jsxs)(Y.Z,{className:n.detailContainer,children:[(0,D.jsx)("strong",{children:"Version ID:"}),(0,D.jsx)("br",{}),f]}),(0,D.jsxs)(Y.Z,{className:n.detailContainer,children:[(0,D.jsx)("strong",{children:"Size:"}),(0,D.jsx)("br",{}),(0,Z.ae)(Q.size||"0")]}),Q.version_id&&"null"!==Q.version_id&&""===f&&(0,D.jsxs)(Y.Z,{className:n.detailContainer,children:[(0,D.jsx)("strong",{children:"Versions:"}),(0,D.jsx)("br",{}),ue.length," version",1!==ue.length?"s":"",","," ",(0,Z.l5)(Ee)]}),""===f&&(0,D.jsxs)(Y.Z,{className:n.detailContainer,children:[(0,D.jsx)("strong",{children:"Last Modified:"}),(0,D.jsx)("br",{}),function(e){var n=new Date,t=new Date(e),i=n.getTime()-t.getTime(),o=(0,Z.nF)(i,"ms");return""!==o.trim()?"".concat(o," ago"):"Just now"}(Q.last_modified)]}),(0,D.jsxs)(Y.Z,{className:n.detailContainer,children:[(0,D.jsx)("strong",{children:"ETAG:"}),(0,D.jsx)("br",{}),Q.etag||"N/A"]}),(0,D.jsxs)(Y.Z,{className:n.detailContainer,children:[(0,D.jsx)("strong",{children:"Tags:"}),(0,D.jsx)("br",{}),0===Be.length?"N/A":Be.map((function(e,n){return(0,D.jsxs)("span",{children:[e,":",b()(Q,"tags.".concat(e),""),n div":{borderBottomColor:"#F8F8F8"}},"@media (max-width: 799px)":{margin:0,"&:hover, &.selected":{backgroundColor:"transparent","& > div":{borderBottomColor:"#E2E2E2"}}}},versionContainer:{fontSize:16,fontWeight:"bold",display:"flex",alignItems:"center","& svg.min-icon":{width:18,height:18,minWidth:18,minHeight:18,marginRight:10},"@media (max-width: 799px)":{fontSize:14,"& svg.min-icon":{display:"none"}}},buttonContainer:{textAlign:"right","& button":{marginLeft:"1.5rem"},"@media (max-width: 600px)":{"& button":{marginLeft:"5px"}}},versionID:{fontSize:"12px",margin:"2px 0",whiteSpace:"nowrap",textOverflow:"ellipsis",maxWidth:"95%",overflow:"hidden"},versionData:{marginRight:"10px",fontSize:12,color:"#868686","@media (max-width: 799px)":{textOverflow:"ellipsis",maxWidth:"95%",overflow:"hidden",whiteSpace:"nowrap"}},ctrItem:{position:"relative","&::before":{content:"' '",display:"block",position:"absolute",width:"2px",height:"calc(100% + 2px)",backgroundColor:"#F8F8F8",left:"24px"},"@media (max-width: 799px)":{"&::before":{display:"none"}}},collapsableInfo:{"@media (max-width: 799px)":{display:"flex",flexDirection:"column"}},versionItem:{"@media (max-width: 799px)":{display:"none"}}})}))((function(e){var n=e.classes,t=e.fileName,i=e.versionInfo,o=e.isSelected,a=e.checkable,s=e.isChecked,r=e.onCheck,c=e.onShare,h=e.onDownload,m=e.onRestore,f=e.onPreview,p=e.globalClick,x=e.index,v=e.key,b=e.style,g=i.is_delete_marker,j=[{icon:(0,D.jsx)(E.P99,{}),action:f,tooltip:"Preview"},{icon:(0,D.jsx)(E._8t,{}),action:h,tooltip:"Download this version"},{icon:(0,D.jsx)(E.aAc,{}),action:c,tooltip:"Share this version"},{icon:(0,D.jsx)(E.D7Y,{}),action:m,tooltip:"Restore this version"}],w=null;return i.is_delete_marker?w="deleted":i.is_latest?w="current":"null"===i.version_id&&(w="null"),(0,D.jsx)(u.ZP,{container:!0,flex:1,className:n.ctrItem,onClick:function(){p(i)},style:b,children:(0,D.jsx)(u.ZP,{item:!0,xs:12,className:"".concat(n.intermediateLayer," ").concat(o?"selected":""),children:(0,D.jsxs)(u.ZP,{item:!0,xs:12,className:"".concat(n.mainFileVersionItem," ").concat(i.is_delete_marker?"deleted":""),children:[(0,D.jsx)(u.ZP,{item:!0,xs:12,justifyContent:"space-between",children:(0,D.jsxs)(u.ZP,{container:!0,children:[(0,D.jsxs)(u.ZP,{item:!0,xs:!0,md:4,className:n.versionContainer,children:[a&&(0,D.jsx)(yn.Z,{checked:s,id:"select-".concat(i.version_id),label:"",name:"select-".concat(i.version_id),onChange:function(e){e.stopPropagation(),e.preventDefault(),r(i.version_id||"")},value:i.version_id||"",disabled:i.is_delete_marker,overrideCheckboxStyles:{paddingLeft:0,height:34,width:25},noTopMargin:!0}),Xe(t,!0)," v",x.toString(),(0,D.jsx)("span",{className:n.versionItem,children:w&&(0,D.jsx)(wn,{type:w})})]}),(0,D.jsx)(u.ZP,{item:!0,xs:10,md:8,className:n.buttonContainer,children:j.map((function(e,t){return(0,D.jsx)(l.Z,{title:e.tooltip,children:(0,D.jsx)(d.Z,{size:"small",id:"version-action-".concat(e.tooltip,"-").concat(t.toString()),className:"".concat(n.spacing," ").concat(g?n.buttonDisabled:""),disabled:g,onClick:function(n){n.stopPropagation(),g?n.preventDefault():e.action(i)},sx:{backgroundColor:"#F8F8F8",borderRadius:"100%",width:"28px",height:"28px",padding:"5px","& .min-icon":{width:"14px",height:"14px"}},children:e.icon})},"version-action-".concat(e.tooltip,"-").concat(t.toString()))}))})]})}),(0,D.jsx)(u.ZP,{item:!0,xs:12,className:n.versionID,children:"null"!==i.version_id?i.version_id:"-"}),(0,D.jsxs)(u.ZP,{item:!0,xs:12,className:n.collapsableInfo,children:[(0,D.jsxs)("span",{className:n.versionData,children:[(0,D.jsx)("strong",{children:"Last modified:"})," ",(0,D.jsx)(fn(),{children:i.last_modified})]}),(0,D.jsxs)("span",{className:n.versionData,children:[(0,D.jsx)("strong",{children:"Size:"})," ",(0,Z.ae)(i.size||"0")]})]})]})})},v)})),Cn=t(90673),Nn=function(e){var n=e.closeDeleteModalAndRefresh,t=e.deleteOpen,i=e.selectedBucket,a=e.selectedObject,s=(0,h.TL)(),r=(0,o.useState)(!1),c=(0,p.Z)(r,2),l=c[0],d=c[1],m=(0,o.useState)(""),f=(0,p.Z)(m,2),x=f[0],v=f[1];if((0,o.useEffect)((function(){l&&g.Z.invoke("DELETE","/api/v1/buckets/".concat(i,"/objects?path=").concat(a,"&non_current_versions=true")).then((function(){n(!0)})).catch((function(e){s((0,F.Ih)(e)),d(!1)}))}),[l,n,s,a,i]),!a)return null;return(0,D.jsx)(ve.Z,{title:"Delete Non-Current versions",confirmText:"Delete",isOpen:t,titleIcon:(0,D.jsx)(E.NvT,{}),isLoading:l,onConfirm:function(){d(!0)},onClose:function(){return n(!1)},confirmButtonProps:{disabled:"YES, PROCEED"!==x||l},confirmationContent:(0,D.jsxs)(xe.Z,{children:["Are you sure you want to delete all the non-current versions for:"," ",(0,D.jsx)("b",{children:(0,Z.IO)(a)}),"? ",(0,D.jsx)("br",{}),(0,D.jsx)("br",{}),"To continue please type ",(0,D.jsx)("b",{children:"YES, PROCEED"})," in the box.",(0,D.jsx)(u.ZP,{item:!0,xs:12,children:(0,D.jsx)($e.Z,{id:"type-confirm",name:"retype-tenant",onChange:function(e){v(e.target.value)},label:"",value:x})})]})})},kn=function(e){var n=e.closeDeleteModalAndRefresh,t=e.deleteOpen,i=e.selectedBucket,a=e.selectedVersions,s=e.selectedObject,r=(0,h.TL)(),c=(0,o.useState)(!1),l=(0,p.Z)(c,2),d=l[0],u=l[1];return(0,o.useEffect)((function(){if(d){var e=a.map((function(e){return{path:s,versionID:e,recursive:!1}}));e.length>0&&g.Z.invoke("POST","/api/v1/buckets/".concat(i,"/delete-objects?all_versions=false"),e).then((function(){u(!1),n(!0)})).catch((function(e){r((0,F.Ih)(e)),u(!1)}))}}),[d,n,i,s,a,r]),a?(0,D.jsx)(ve.Z,{title:"Delete Selected Versions",confirmText:"Delete",isOpen:t,titleIcon:(0,D.jsx)(E.NvT,{}),isLoading:d,onConfirm:function(){u(!0)},onClose:function(){return n(!1)},confirmationContent:(0,D.jsxs)(xe.Z,{children:["Are you sure you want to delete the selected ",a.length," ","versions for ",(0,D.jsx)("strong",{children:s}),"?"]})}):null},En=t(5171),In={is_latest:!0,last_modified:"",legal_hold_status:"",name:"",retention_mode:"",retention_until_date:"",size:"0",tags:{},version_id:null},Tn=(0,c.Z)((function(e){return(0,r.Z)((0,i.Z)((0,i.Z)((0,i.Z)((0,i.Z)((0,i.Z)((0,i.Z)((0,i.Z)((0,i.Z)((0,i.Z)({versionsContainer:{padding:10,"@media (max-width: 799px)":{minHeight:800}},noBottomBorder:{borderBottom:0},versionsVirtualPanel:{flexGrow:1,height:"calc(100% - 120px)",overflow:"auto","@media (max-width: 799px)":{height:600}},screenTitleContainer:{position:"relative","&::before":{content:"' '",display:"block",position:"absolute",width:"2px",backgroundColor:"#F8F8F8",left:"24px",height:"40px",bottom:0},"@media (max-width: 799px)":{"&::before":{display:"none"}}},sortByLabel:{color:"#838383",fontWeight:"bold",whiteSpace:"nowrap",marginRight:12,fontSize:14,"@media (max-width: 600px)":{display:"none"}}},m.bp),m.Si),m.OR),m.VX),m.bK),m.VI),m.cx),m.C4),(0,m.Bz)(e.spacing(4))))}))((function(e){var n=e.classes,t=e.internalPaths,i=e.bucketName,s=(0,h.TL)(),r=(0,a.v9)((function(e){return e.objectBrowser.searchVersions})),c=(0,a.v9)((function(e){return e.objectBrowser.loadingVersions})),l=(0,a.v9)((function(e){return e.objectBrowser.selectedVersion})),d=(0,a.v9)(F.N5),m=(0,o.useState)(!1),x=(0,p.Z)(m,2),v=x[0],j=x[1],w=(0,o.useState)(null),y=(0,p.Z)(w,2),S=y[0],C=y[1],N=(0,o.useState)(null),k=(0,p.Z)(N,2),I=k[0],T=k[1],_=(0,o.useState)([]),O=(0,p.Z)(_,2),M=O[0],A=O[1],U=(0,o.useState)(!1),W=(0,p.Z)(U,2),G=W[0],H=W[1],V=(0,o.useState)(""),K=(0,p.Z)(V,2),J=K[0],Y=K[1],q=(0,o.useState)("date"),$=(0,p.Z)(q,2),Q=$[0],ee=$[1],ne=(0,o.useState)(!1),te=(0,p.Z)(ne,2),ie=te[0],oe=te[1],ae=(0,o.useState)(!1),se=(0,p.Z)(ae,2),re=se[0],ce=se[1],le=(0,o.useState)(!1),de=(0,p.Z)(le,2),ue=de[0],he=de[1],me=(0,o.useState)([]),fe=(0,p.Z)(me,2),pe=fe[0],xe=fe[1],ve=(0,o.useState)(!1),be=(0,p.Z)(ve,2),ge=be[0],je=be[1],we=[];S&&(we=S.name.split("/")),(0,o.useEffect)((function(){c||S||s((0,P.Eq)(!0))}),[c,S,s]),(0,o.useEffect)((function(){c&&""!==t&&g.Z.invoke("GET","/api/v1/buckets/".concat(i,"/objects?prefix=").concat(t).concat(d?"&with_versions=true":"")).then((function(e){var n=b()(e,"objects",[]);d?(C(n.find((function(e){return e.is_latest}))||In),A(n)):(C(n[0]),A([])),s((0,P.Eq)(!1))})).catch((function(e){s((0,F.Ih)(e)),s((0,P.Eq)(!1))}))}),[c,i,t,s,d]);var ye=function(e){T(e),j(!0)},Se=function(e){T(e),oe(!0)},Ce=function(e){Y(e.version_id||""),H(!0)},Ne=function(e){!function(e){var n=(0,Z.LL)("".concat(i,"-").concat(e.name,"-").concat((new Date).getTime(),"-").concat(Math.random())),o=(0,R.LR)(i,t,e.version_id,parseInt(e.size||"0"),null,(function(e){s((0,P.RO)({instanceID:n,progress:e}))}),(function(){s((0,P.oK)(n))}),(function(e){s((0,P.qJ)({instanceID:n,msg:e}))}),(function(){s((0,P.Im)(n))})),a=(0,cn.YO)(8);(0,cn.EN)(a,o),s((0,P.Mc)({ID:a,bucketName:i,done:!1,instanceID:n,percentage:0,prefix:e.name,type:"download",waitingForFile:!0,failed:!1,cancelled:!1,errorMessage:""})),o.send()}(e)},ke=function(e){s((0,P.M3)(e.version_id||""))},Ee=M.filter((function(e){return!!e.version_id&&e.version_id.includes(r)})),Ie=M.reduce((function(e,n){return n.size?e+parseInt(n.size):e}),0);Ee.sort((function(e,n){if("size"===Q)return e.size&&n.size?e.sizen.size?1:0:0;var t=new Date(e.last_modified).getTime(),i=new Date(n.last_modified).getTime();return ti?-1:0}));var Te=function(e){if(pe.includes(e)){var n=pe.filter((function(n){return n!==e}));xe(n)}else{var t=(0,f.Z)(pe);t.push(e),xe(t)}};return(0,D.jsxs)(o.Fragment,{children:[v&&S&&(0,D.jsx)(X.default,{open:v,closeModalAndRefresh:function(){T(null),j(!1),oe(!1)},bucketName:i,dataObject:I||S}),G&&S&&(0,D.jsx)(Zn,{restoreOpen:G,bucketName:i,versionID:J,objectPath:S.name,onCloseAndUpdate:function(e){H(!1),Y(""),e&&(s((0,P.Eq)(!0)),s((0,P.vH)(!0)))}}),ie&&S&&(0,D.jsx)(Ze.default,{open:ie,bucketName:i,object:{name:S.name,version_id:I&&I.version_id?I.version_id:"null",size:parseInt(I&&I.size?I.size:"0"),content_type:"",last_modified:new Date(S.last_modified)},onClosePreview:function(){oe(!1)}}),re&&(0,D.jsx)(Nn,{deleteOpen:re,closeDeleteModalAndRefresh:function(e){ce(!1),e&&(s((0,P.Eq)(!0)),s((0,P.M3)("")),s((0,P.vH)(!0)))},selectedBucket:i,selectedObject:t}),ge&&(0,D.jsx)(kn,{selectedBucket:i,selectedObject:(0,Z.IO)(t),deleteOpen:ge,selectedVersions:pe,closeDeleteModalAndRefresh:function(e){je(!1),e&&(s((0,P.Eq)(!0)),s((0,P.M3)("")),s((0,P.vH)(!0)),xe([]))}}),(0,D.jsxs)(u.ZP,{container:!0,className:n.versionsContainer,children:[!S&&(0,D.jsx)(u.ZP,{item:!0,xs:12,children:(0,D.jsx)(gn.Z,{})}),S&&(0,D.jsxs)(o.Fragment,{children:[(0,D.jsx)(u.ZP,{item:!0,xs:12,children:(0,D.jsx)(B,{bucketName:i,internalPaths:(0,Z.IO)(t),existingFiles:[],hidePathButton:!0})}),(0,D.jsx)(u.ZP,{item:!0,xs:12,className:n.screenTitleContainer,children:(0,D.jsx)(z.Z,{icon:(0,D.jsx)("span",{className:n.listIcon,children:(0,D.jsx)(E.cRd,{})}),title:(0,D.jsxs)("span",{className:n.titleSpacer,children:[we.length>0?we[we.length-1]:S.name," ","Versions"]}),subTitle:(0,D.jsx)(o.Fragment,{children:(0,D.jsxs)(u.ZP,{item:!0,xs:12,className:n.bucketDetails,children:[(0,D.jsx)("span",{className:n.detailsSpacer,children:(0,D.jsxs)("strong",{children:[M.length," Version",1===M.length?"":"s","\xa0\xa0\xa0"]})}),(0,D.jsx)("span",{className:n.detailsSpacer,children:(0,D.jsx)("strong",{children:(0,Z.l5)(Ie)})})]})}),actions:(0,D.jsxs)(o.Fragment,{children:[(0,D.jsx)(L.Z,{id:"select-multiple-versions",tooltip:"Select Multiple Versions",onClick:function(){he(!ue)},text:"",icon:(0,D.jsx)(E.amE,{}),color:"primary",variant:ue?"contained":"outlined",style:{marginRight:8}}),ue&&(0,D.jsx)(L.Z,{id:"delete-multiple-versions",tooltip:"Delete Selected Versions",onClick:function(){je(!0)},text:"",icon:(0,D.jsx)(E.pJl,{}),color:"secondary",style:{marginRight:8},disabled:0===pe.length}),(0,D.jsx)(L.Z,{id:"delete-non-current",tooltip:"Delete Non Current Versions",onClick:function(){ce(!0)},text:"",icon:(0,D.jsx)(E.utM,{}),color:"secondary",style:{marginRight:15},disabled:M.length<=1}),(0,D.jsx)("span",{className:n.sortByLabel,children:"Sort by"}),(0,D.jsx)(Cn.Z,{id:"sort-by",label:"",value:Q,onChange:function(e){ee(e.target.value)},name:"sort-by",options:[{label:"Date",value:"date"},{label:"Size",value:"size"}]})]}),className:n.noBottomBorder})}),(0,D.jsx)(u.ZP,{item:!0,xs:12,className:n.versionsVirtualPanel,children:S.version_id&&"null"!==S.version_id&&(0,D.jsx)(En.aV,{style:{width:"100%"},containerStyle:{width:"100%",maxWidth:"100%"},width:1,height:800,rowCount:Ee.length,rowHeight:108,rowRenderer:function(e){var n=e.key,t=e.index,i=(e.isScrolling,e.isVisible,e.style),o=M.length-t;return(0,D.jsx)(Sn,{style:i,fileName:(null===S||void 0===S?void 0:S.name)||"",versionInfo:Ee[t],index:o,onDownload:Ne,onRestore:Ce,onShare:ye,onPreview:Se,globalClick:ke,isSelected:l===Ee[t].version_id,checkable:ue,onCheck:Te,isChecked:pe.includes(Ee[t].version_id||"")},n)}})})]})]})]})})),_n=t(9859),Fn=t(46078),Pn=o.lazy((function(){return Promise.resolve().then(t.bind(t,13065))})),Ln=o.lazy((function(){return Promise.resolve().then(t.bind(t,28789))})),Dn=o.lazy((function(){return Promise.resolve().then(t.bind(t,74768))})),On=(0,_.Z)(o.lazy((function(){return t.e(711).then(t.bind(t,50711))}))),Bn=(0,_.Z)(o.lazy((function(){return Promise.resolve().then(t.bind(t,34433))}))),Rn=(0,_.Z)(o.lazy((function(){return Promise.all([t.e(3691),t.e(4814),t.e(6901)]).then(t.bind(t,26901))}))),zn=(0,_.Z)(o.lazy((function(){return Promise.resolve().then(t.bind(t,78562))}))),Mn=(0,V.Z)((function(e){return(0,r.Z)((0,i.Z)((0,i.Z)((0,i.Z)((0,i.Z)((0,i.Z)((0,i.Z)({browsePaper:{border:0,height:"calc(100vh - 210px)","&.isEmbedded":{height:"calc(100vh - 315px)"},"&.actionsPanelOpen":{minHeight:"100%"},"@media (max-width: 800px)":{width:800}},"@global":{".rowLine:hover .iconFileElm":{backgroundImage:"url(/images/ob_file_filled.svg)"},".rowLine:hover .iconFolderElm":{backgroundImage:"url(/images/ob_folder_filled.svg)"}},badgeOverlap:{"& .MuiBadge-badge":{top:10,right:1,width:5,height:5,minWidth:5}},screenTitle:{borderBottom:0,paddingTop:0,paddingLeft:0,paddingRight:0}},m.VX),m.OR),m.qg),{},{searchField:(0,i.Z)((0,i.Z)({},m.qg.searchField),{},{maxWidth:380}),screenTitleContainer:{border:"#EAEDEE 1px solid",padding:"0.8rem 15px 0"},labelStyle:{color:"#969FA8",fontSize:"12px"},breadcrumbsContainer:{padding:"12px 14px 5px"},parentWrapper:{"@media (max-width: 800px)":{overflowX:"auto"}},fullContainer:{"@media (max-width: 799px)":{width:0}},hideListOnSmall:{"@media (max-width: 799px)":{display:"none"}}},m.C4),m.cx),(0,m.Bz)(e.spacing(4))))})),An={borderWidth:2,borderRadius:2,borderColor:"#eeeeee",outline:"none"},Un={borderStyle:"dashed",backgroundColor:"#fafafa",borderColor:"#2196f3"},Wn={borderStyle:"dashed",backgroundColor:"#fafafa",borderColor:"#00e676"};var Gn=(0,D.jsx)(w.Z,{component:"h3",children:"Loading..."}),Hn=function(){var e,n=Mn(),t=(0,h.TL)(),r=(0,s.UO)(),c=(0,s.s0)(),l=(0,s.TH)(),d=(0,a.v9)((function(e){return e.objectBrowser.rewind.rewindEnabled})),m=(0,a.v9)((function(e){return e.objectBrowser.rewind.dateToRewind})),v=(0,a.v9)((function(e){return e.objectBrowser.rewind.bucketToRewind})),S=(0,a.v9)((function(e){return e.objectBrowser.versionsMode})),C=(0,a.v9)((function(e){return e.objectBrowser.searchObjects})),N=(0,a.v9)((function(e){return e.objectBrowser.showDeleted})),k=(0,a.v9)((function(e){return e.objectBrowser.objectDetailsOpen})),_=(0,a.v9)((function(e){return e.objectBrowser.selectedInternalPaths})),O=(0,a.v9)((function(e){return e.objectBrowser.loadingObjects})),A=(0,a.v9)((function(e){return e.objectBrowser.simplePath})),U=(0,a.v9)(_n.HQ),W=(0,a.v9)(_n.G6),G=(0,a.v9)((function(e){return e.console.session.allowResources})),V=(0,a.v9)(Fn.$4),K=!(null===V||void 0===V||!V.includes("object-browser-only")),Y=(0,o.useState)([]),q=(0,p.Z)(Y,2),X=q[0],$=q[1],Q=(0,o.useState)(!1),ee=(0,p.Z)(Q,2),ne=ee[0],te=ee[1],ie=(0,o.useState)(0),oe=(0,p.Z)(ie,2),ae=oe[0],se=oe[1],re=(0,o.useState)(Gn),ce=(0,p.Z)(re,2),le=ce[0],de=ce[1],ue=(0,o.useState)(!0),he=(0,p.Z)(ue,2),me=he[0],fe=he[1],pe=(0,o.useState)(!1),xe=(0,p.Z)(pe,2),ve=xe[0],be=xe[1],ge=(0,o.useState)(!0),je=(0,p.Z)(ge,2),Ze=je[0],we=je[1],ye=(0,o.useState)(!1),Se=(0,p.Z)(ye,2),Ce=Se[0],Ne=Se[1],ke=(0,o.useState)(!1),Ee=(0,p.Z)(ke,2),Ie=Ee[0],_e=Ee[1],Fe=(0,o.useState)([]),Pe=(0,p.Z)(Fe,2),Le=Pe[0],De=Pe[1],Oe=(0,o.useState)(!1),Be=(0,p.Z)(Oe,2),Re=Be[0],ze=Be[1],Me=(0,o.useState)(null),Ae=(0,p.Z)(Me,2),Ue=Ae[0],We=Ae[1],Ge=(0,o.useState)(!1),He=(0,p.Z)(Ge,2),Ve=He[0],Ke=He[1],Je=(0,o.useState)("ASC"),Ye=(0,p.Z)(Je,2),qe=Ye[0],Xe=Ye[1],$e=(0,o.useState)("name"),Qe=(0,p.Z)($e,2),en=Qe[0],nn=Qe[1],tn=(0,o.useState)(!1),on=(0,p.Z)(tn,2),an=on[0],sn=on[1],rn=(0,o.useState)(!1),ln=(0,p.Z)(rn,2),un=ln[0],mn=ln[1],fn=(0,o.useState)(!1),pn=(0,p.Z)(fn,2),xn=pn[0],gn=pn[1],jn=(0,o.useState)(null),Zn=(0,p.Z)(jn,2),wn=Zn[0],Sn=Zn[1],Cn=(0,o.useState)(null),Nn=(0,p.Z)(Cn,2),kn=Nn[0],En=Nn[1],In=l.pathname.split("/browse/"),Hn=2===In.length?In[1]:"",Vn=r.bucketName||"",Kn=(0,o.useRef)(null),Jn=(0,o.useRef)(null);(0,o.useEffect)((function(){null!==Jn.current&&(Jn.current.setAttribute("directory",""),Jn.current.setAttribute("webkitdirectory",""))}),[Jn]),(0,o.useEffect)((function(){if(1===Le.length){var e=Le[0];"none"!==(0,R.Bg)(e)?gn(!0):gn(!1),e.endsWith("/")?mn(!1):mn(!0)}else mn(!1),gn(!1)}),[Le]),(0,o.useEffect)((function(){wn||g.Z.invoke("GET","/api/v1/buckets/".concat(Vn,"/quota")).then((function(e){var n=null;e.quota&&(n=e),Sn(n)})).catch((function(e){console.error("Error Getting Quota Status: ",e.detailedError),Sn(null)}))}),[wn,Vn]),(0,o.useEffect)((function(){Le.length>0?t((0,P.vb)(!0)):0===Le.length&&null===_&&t((0,P.vb)(!1))}),[Le,_,t]);var Yn=(0,I.F)(Vn,[T.Ft.S3_DELETE_OBJECT]),qn=(0,I.F)(Vn,[T.Ft.S3_LIST_BUCKET]);(0,o.useEffect)((function(){an||(t((0,_n.d5)(!0)),sn(!0))}),[an,t,sn]),function(e,n){var t=(0,o.useRef)(null);(0,o.useEffect)((function(){t.current=e}),[e]),(0,o.useEffect)((function(){if(null!==n){var e=setInterval((function(){void 0!==t&&t.current&&t.current()}),n);return function(){return clearInterval(e)}}}),[n])}((function(){O&&function(){var e=Date.now()-ae;e/1e3>=6?de((0,D.jsx)(o.Fragment,{children:(0,D.jsxs)(w.Z,{component:"h3",children:["This operation is taking longer than expected... (",Math.ceil(e/1e3),"s)"]})})):e/1e3>=3&&de((0,D.jsx)(w.Z,{component:"h3",children:"This operation is taking longer than expected..."}))}()}),1e3),(0,o.useEffect)((function(){me&&(qn?g.Z.invoke("GET","/api/v1/buckets/".concat(Vn,"/versioning")).then((function(e){be(e.is_versioned),fe(!1)})).catch((function(e){console.error("Error Getting Object Versioning Status: ",e.detailedError),fe(!1)})):(fe(!1),$([])))}),[Vn,me,t,qn]),(0,o.useEffect)((function(){Ze&&(qn?g.Z.invoke("GET","/api/v1/buckets/".concat(Vn,"/object-locking")).then((function(e){Ne(e.object_locking_enabled),we(!1)})).catch((function(e){console.error("Error Getting Object Locking Status: ",e.detailedError),we(!1)})):($([]),we(!1)))}),[Vn,Ze,t,qn]),(0,o.useEffect)((function(){var e=(0,Z.IO)(Hn);e.endsWith("/")||""===e?(t((0,P.vb)(!1)),t((0,P.EE)(null)),t((0,P.Su)(""===e?"/":e))):(t((0,P.vH)(!0)),t((0,P.vb)(!0)),t((0,P.Eq)(!0)),t((0,P.EE)("".concat(e?"".concat((0,Z.LL)(e)):""))),t((0,P.Su)("".concat(e.split("/").slice(0,-1).join("/"),"/"))))}),[Hn,m,d,t]),(0,o.useEffect)((function(){t((0,P.G4)("")),t((0,P.MU)(!0)),De([])}),[A,t,De]),(0,o.useEffect)((function(){if(O)if(qn){var e="";if(Hn){var n=(0,Z.IO)(Hn);e=n.endsWith("/")?n:n+"/"}var i=Date.now();se(i),de(Gn);var o="/api/v1/buckets/".concat(Vn,"/objects");if(d){if(v!==Vn)return void t((0,P._w)());if(m){var a=m.toISOString();o="/api/v1/buckets/".concat(Vn,"/rewind/").concat(a)}}else if(N){var s=(new Date).toISOString();o="/api/v1/buckets/".concat(Vn,"/rewind/").concat(s)}g.Z.invoke("GET","".concat(o).concat(e?"?prefix=".concat((0,Z.LL)(e)):"")).then((function(n){var i=n.objects||[],a=[],s=[];i.forEach((function(e){e.name!==(0,Z.IO)(Hn)&&(e.name.endsWith("/")?a.push(e):s.push(e))}));var r=[].concat(a,s);if(0===r.length&&""!==e){var c="/api/v1/buckets/".concat(Vn,"/objects").concat(Hn?"?prefix=".concat(Hn):"");if(d){var l=m.toISOString(),u="";if(Hn){var h=(0,Z.IO)(Hn);u=h.endsWith("/")?h:h+"/"}c="/api/v1/buckets/".concat(Vn,"/rewind/").concat(l).concat(u?"?prefix=".concat((0,Z.LL)(u)):"")}g.Z.invoke("GET",c).then((function(n){if(n.objects){for(var i=!1,a=e.slice(0,e.length-1),s=0;s1,w="An error occurred while uploading the file".concat(j?"s":"","."),y={413:"Error - File size too large"};g.withCredentials=!1,g.onload=function(e){if(g.status>=200&&g.status<300)t((0,P.oK)(v)),s({status:g.status});else{if(y[g.status])w=y[g.status];else if(g.response)try{var n=JSON.parse(g.response);w=n.detailedMessage}catch(i){w="something went wrong"}t((0,P.qJ)({instanceID:v,msg:w})),r({status:g.status,message:w})}},g.upload.addEventListener("error",(function(e){r(w),t((0,P.qJ)({instanceID:v,msg:"A network error occurred."}))})),g.upload.addEventListener("progress",(function(e){var n=Math.floor(100*e.loaded/e.total);t((0,P.RO)({instanceID:v,progress:n}))})),g.onerror=function(){r(w),t((0,P.qJ)({instanceID:v,msg:"A network error occurred."}))},g.onloadend=function(){0===e.length&&t((0,P.MU)(!0))},g.onabort=function(){t((0,P.Im)(v))};var S=new FormData;if(void 0!==a.size){S.append(a.size.toString(),d,l);var C=(0,cn.YO)(8);(0,cn.EN)(C,g),t((0,P.Mc)({ID:C,bucketName:n,done:!1,instanceID:v,percentage:0,prefix:"".concat((0,Z.IO)(u)).concat(l),type:"upload",waitingForFile:!1,failed:!1,cancelled:!1,errorMessage:""})),g.send(S)}}))},s=[];t((0,P.LD)());for(var r=0;r0){var i=s.length,o=s.length-n.length,a={errorMessage:"There were some errors during file upload",detailedError:"Uploaded files ".concat(o,"/").concat(i)};t((0,F.Ih)(a))}t((0,P.MU)(!0)),De([])}))}(e,Vn,i,n)}),[Vn,t,A]),Qn=(0,o.useCallback)((function(e){if(e&&e.length>0){var n=e[0].path;$n(e,n)}}),[$n]),et=(0,x.uI)({noClick:!0,onDrop:Qn}),nt=et.getRootProps,tt=et.getInputProps,it=et.isDragActive,ot=et.isDragAccept,at=(0,o.useMemo)((function(){return(0,i.Z)((0,i.Z)((0,i.Z)({},An),it?Un:{}),ot?Wn:{})}),[it,ot]),st=X.filter((function(e){return""===C||e.name.toLowerCase().indexOf(C.toLowerCase())>=0})),rt=(0,Z.IO)(Hn),ct=rt.split("/").filter((function(e){return""!==e})),lt=st.sort((0,R.P_)(en)),dt=[];dt="ASC"===qe?lt:lt.reverse();var ut=[Vn];ct.length>0&&(ut=ut.concat(ct));var ht=function(e){if(t((0,P.EE)(null)),t((0,P.db)({status:!1})),k&&null!==_){var n=(0,Z.IO)(Hn).split("/");n.pop();var i="";n&&n.length>0&&(i="".concat(n.join("/"),"/")),c("/buckets/".concat(Vn,"/browse/").concat((0,Z.LL)(i)))}t((0,P.vb)(!1)),De([]),e&&t((0,P.MU)(!0))},mt=[{type:"view",label:"View",onClick:function(e){De([]);var n="/buckets/".concat(Vn,"/browse").concat(e?"/".concat((0,Z.LL)(e)):"");c(n),t((0,P.vb)(!0)),t((0,P.Eq)(!0)),t((0,P.EE)("".concat(e?"".concat((0,Z.LL)(e)):"")))},sendOnlyId:!0}],ft=[{action:function(){if(0!==Le.length){var e=[];if(1===(e=st.filter((function(e){return Le.includes(e.name)}))).length&&e[0].name.length>200&&(0,Z.mv)().toLowerCase().includes("win"))return void En(e[0]);e.forEach((function(e){!function(e){var n=(0,Z.LL)("".concat(Vn,"-").concat(e.name,"-").concat((new Date).getTime(),"-").concat(Math.random())),i=(0,R.LR)(Vn,(0,Z.LL)(e.name),e.version_id,e.size,null,(function(e){t((0,P.RO)({instanceID:n,progress:e}))}),(function(){t((0,P.oK)(n))}),(function(e){t((0,P.qJ)({instanceID:n,msg:e}))}),(function(){t((0,P.Im)(n))})),o=(0,cn.YO)(8);(0,cn.EN)(o,i),t((0,P.Mc)({ID:o,bucketName:Vn,done:!1,instanceID:n,percentage:0,prefix:e.name,type:"download",waitingForFile:!0,failed:!1,cancelled:!1,errorMessage:""})),i.send()}(e)}))}},label:"Download",disabled:0===Le.length,icon:(0,D.jsx)(E._8t,{}),tooltip:"Download Selected"},{action:function(){if(1===Le.length){var e;(e=st.find((function(e){return Le.includes(e.name)})))&&(We(e),Ke(!0))}},label:"Share",disabled:1!==Le.length||!un,icon:(0,D.jsx)(E.aAc,{}),tooltip:"Share Selected File"},{action:function(){if(1===Le.length){var e;(e=st.find((function(e){return Le.includes(e.name)})))&&(We(e),ze(!0))}},label:"Preview",disabled:1!==Le.length||!xn,icon:(0,D.jsx)(E.P99,{}),tooltip:"Preview Selected File"},{action:function(){te(!0)},label:"Delete",icon:(0,D.jsx)(Dn,{}),disabled:!(0,I.F)(Vn,[T.Ft.S3_DELETE_OBJECT])||0===Le.length||!Yn,tooltip:"Delete Selected Files"}];return(0,D.jsxs)(o.Fragment,{children:[Ve&&Ue&&(0,D.jsx)(Bn,{open:Ve,closeModalAndRefresh:function(){Ke(!1),We(null)},bucketName:Vn,dataObject:{name:Ue.name,last_modified:"",version_id:Ue.version_id}}),ne&&(0,D.jsx)(On,{deleteOpen:ne,selectedBucket:Vn,selectedObjects:Le,closeDeleteModalAndRefresh:function(e){te(!1),e&&(t((0,F.y1)("Objects deleted successfully.")),De([]),t((0,P.MU)(!0)))},versioning:ve}),Ie&&(0,D.jsx)(Rn,{open:Ie,closeModalAndRefresh:function(){_e(!1)},bucketName:Vn}),Re&&(0,D.jsx)(zn,{open:Re,bucketName:Vn,object:Ue,onClosePreview:function(){ze(!1),We(null)}}),!!kn&&(0,D.jsx)(dn,{open:!!kn,closeModal:function(){En(null)},currentItem:(null===(e=kn.name.split("/"))||void 0===e?void 0:e.pop())||"",bucketName:Vn,internalPaths:Hn,actualInfo:{name:kn.name,last_modified:"",version_id:kn.version_id,size:kn.size.toString()}}),(0,D.jsxs)(M.Z,{variant:"full",children:[(0,D.jsx)(u.ZP,{item:!0,xs:12,className:n.screenTitleContainer,children:(0,D.jsx)(z.Z,{className:n.screenTitle,icon:(0,D.jsx)("span",{className:n.listIcon,children:(0,D.jsx)(E.wNb,{})}),title:(0,D.jsx)("span",{className:n.titleSpacer,children:Vn}),subTitle:(0,D.jsx)(o.Fragment,{children:(0,D.jsxs)(u.ZP,{item:!0,xs:12,className:n.bucketDetails,children:[(0,D.jsxs)("span",{className:n.detailsSpacer,children:["Created:\xa0\xa0\xa0",(0,D.jsx)("strong",{children:(null===W||void 0===W?void 0:W.creation_date)||""})]}),(0,D.jsxs)("span",{className:n.detailsSpacer,children:["Access:\xa0\xa0\xa0",(0,D.jsx)("strong",{children:(null===W||void 0===W?void 0:W.access)||""})]}),W&&(0,D.jsx)(o.Fragment,{children:(0,D.jsxs)("span",{className:n.detailsSpacer,children:[W.size&&(0,D.jsx)(o.Fragment,{children:(0,Z.l5)(W.size)}),W.size&&wn&&(0,D.jsxs)(o.Fragment,{children:[" / ",(0,Z.l5)(wn.quota)]}),W.size&&W.objects?" - ":"",W.objects&&(0,D.jsxs)(o.Fragment,{children:[W.objects,"\xa0Object",W.objects&&1!==W.objects?"s":""]})]})})]})}),actions:(0,D.jsx)(o.Fragment,{children:(0,D.jsxs)("div",{className:n.actionsSection,children:[(0,D.jsx)(L.Z,{id:"rewind-objects-list",tooltip:"Rewind Bucket",text:"Rewind",icon:(0,D.jsx)(y.Z,{badgeContent:" ",color:"secondary",variant:"dot",invisible:!d,className:n.badgeOverlap,sx:{height:16},children:(0,D.jsx)(Pn,{style:{minWidth:16,minHeight:16,width:16,height:16}})}),color:"primary",variant:"outlined",onClick:function(){_e(!0)},disabled:!ve||!(0,I.F)(Vn,[T.Ft.S3_GET_OBJECT])}),(0,D.jsx)(L.Z,{id:"refresh-objects-list",tooltip:"Reload List",text:"Refresh",icon:(0,D.jsx)(Ln,{}),color:"primary",variant:"outlined",onClick:function(){t(S?(0,P.Eq)(!0):(0,P.MU)(!0))},disabled:!(0,I.F)(Vn,[T.Ft.S3_LIST_BUCKET])||d}),(0,D.jsx)("input",{type:"file",multiple:!0,onChange:Xn,style:{display:"none"},ref:Kn}),(0,D.jsx)("input",{type:"file",multiple:!0,onChange:Xn,style:{display:"none"},ref:Jn}),(0,D.jsx)(H,{bucketName:Vn,uploadPath:ut.join("/"),uploadFileFunction:function(e){Kn&&Kn.current&&Kn.current.click(),e()},uploadFolderFunction:function(e){Jn&&Jn.current&&Jn.current.click(),e()}})]})})})}),(0,D.jsxs)("div",(0,i.Z)((0,i.Z)({id:"object-list-wrapper"},nt({style:(0,i.Z)({},at)})),{},{children:[(0,D.jsx)("input",(0,i.Z)({},tt())),(0,D.jsxs)(u.ZP,{item:!0,xs:12,className:n.tableBlock,sx:{border:"#EAEDEE 1px solid",borderTop:0},children:[S?(0,D.jsx)(o.Fragment,{children:null!==_&&(0,D.jsx)(Tn,{internalPaths:_,bucketName:Vn})}):(0,D.jsx)(I.s,{scopes:[T.Ft.S3_LIST_BUCKET],resource:Vn,errorProps:{disabled:!0},children:(0,D.jsxs)(u.ZP,{item:!0,xs:12,className:n.fullContainer,children:[(0,D.jsx)(u.ZP,{item:!0,xs:12,className:n.breadcrumbsContainer,children:(0,D.jsx)(B,{bucketName:Vn,internalPaths:rt,existingFiles:X||[],additionalOptions:!ve||d?null:(0,D.jsx)("div",{children:(0,D.jsx)(yn.Z,{name:"deleted_objects",id:"showDeletedObjects",value:"deleted_on",label:"Show deleted objects",onChange:function(){t((0,P.mz)(!N)),ht(!0)},checked:N,overrideLabelClasses:n.labelStyle,className:n.overrideShowDeleted,noTopMargin:!0})}),hidePathButton:!1})}),(0,D.jsx)(j.Z,{itemActions:mt,columns:d?bn:vn,isLoading:O,loadingMessage:le,entityName:"Objects",idField:"name",records:dt,customPaperHeight:"".concat(n.browsePaper," ").concat(K?"isEmbedded":""," ").concat(k?"actionsPanelOpen":""),selectedItems:Le,onSelect:function(e){var n=e.target,i=n.value,o=n.checked,a=(0,f.Z)(Le);return o?a.push(i):a=a.filter((function(e){return e!==i})),De(a),t((0,P.EE)(null)),a},customEmptyMessage:"This location is empty".concat(d?"":", please try uploading a new file"),sortConfig:{currentSort:en,currentDirection:qe,triggerSort:function(e){var n=b()(e,"sortDirection","DESC");nn(e.sortBy),Xe(n),t((0,P.MU)(!0))}},onSelectAll:function(){if(t((0,P.EE)(null)),Le.length!==dt.length){var e=dt.map((function(e){return e.name}));De(e)}else De([])},rowStyle:function(e){var n,t=e.index;return null!==(n=dt[t])&&void 0!==n&&n.delete_flag?"deleted":""},parentClassName:n.parentWrapper})]})}),(0,D.jsx)(I.s,{scopes:[T.Ft.S3_LIST_BUCKET],resource:Vn,errorProps:{disabled:!0},children:(0,D.jsxs)(J,{open:k,closePanel:function(){ht(!1)},className:"".concat(S?n.hideListOnSmall:""),children:[Le.length>0&&(0,D.jsx)(Te,{items:ft,title:"Selected Objects:"}),null!==_&&(0,D.jsx)(hn,{internalPaths:_,bucketName:Vn,onClosePanel:ht,versioning:ve,locking:Ce})]})})]})]}))]})]})},Vn=t(32291),Kn=t(95792),Jn=t(84669),Yn=t(59114),qn=t(73996),Xn=(0,c.Z)((function(e){return(0,r.Z)((0,i.Z)({},(0,m.Bz)(e.spacing(4))))}))((function(){var e=(0,h.TL)(),n=(0,s.s0)(),t=(0,s.UO)(),i=(0,s.TH)(),r=(0,a.v9)((function(e){return e.objectBrowser.versionsMode})),c=(0,a.v9)((function(e){return e.objectBrowser.searchObjects})),m=(0,a.v9)((function(e){return e.objectBrowser.versionedFile})),f=(0,a.v9)((function(e){return e.objectBrowser.searchVersions})),p=(0,a.v9)(Fn.$4),x=t.bucketName||"",v=i.pathname.split("/browse/"),b=2===v.length?v[1]:"",g=!(null===p||void 0===p||!p.includes("object-browser-only"));(0,o.useEffect)((function(){e((0,P.db)({status:!1}))}),[b,e]);var j=(0,D.jsx)(o.Fragment,{children:r?(0,D.jsx)(o.Fragment,{children:(0,D.jsx)(Yn.Z,{placeholder:"Start typing to filter versions of ".concat(m),onChange:function(n){e((0,P.Pr)(n))},value:f})}):(0,D.jsx)(I.s,{scopes:[T.Ft.S3_LIST_BUCKET],resource:x,errorProps:{disabled:!0},children:(0,D.jsx)(Yn.Z,{placeholder:"Start typing to filter objects in the bucket",onChange:function(n){e((0,P.G4)(n))},value:c})})});return(0,D.jsxs)(o.Fragment,{children:[g?(0,D.jsxs)(u.ZP,{container:!0,sx:{padding:"20px 32px 0"},children:[(0,D.jsx)(u.ZP,{children:(0,D.jsx)(qn.Z,{marginRight:30,marginTop:10})}),(0,D.jsx)(u.ZP,{item:!0,xs:!0,children:j})]}):(0,D.jsx)(Vn.Z,{label:(0,D.jsx)(Jn.Z,{label:"Buckets",to:T.gA.BUCKETS}),actions:(0,D.jsx)(I.s,{scopes:T.D[T.EI.BUCKET_ADMIN],resource:x,errorProps:{disabled:!0},children:(0,D.jsx)(l.Z,{title:"Configure Bucket",children:(0,D.jsx)(d.Z,{color:"primary","aria-label":"Configure Bucket",component:"span",onClick:function(){n("/buckets/".concat(x,"/admin"))},size:"large",children:(0,D.jsx)(Kn.Z,{})})})}),middleComponent:j}),(0,D.jsx)(u.ZP,{children:(0,D.jsx)(Hn,{})})]})}))},34433:function(e,n,t){t.r(n),t.d(n,{default:function(){return _}});var i=t(29439),o=t(1413),a=t(72791),s=t(26181),r=t.n(s),c=t(60364),l=t(11135),d=t(25787),u=t(78029),h=t.n(u),m=t(61889),f=t(40986),p=t(23814),x=t(81207),v=t(56028),b=t(64163),g=t(30829),j=t(72426),Z=t.n(j),w=t(21435),y=t(38734),S=t(80184),C=(0,d.Z)((function(e){return(0,l.Z)((0,o.Z)((0,o.Z)((0,o.Z)({},p.YI),p.Hr),{},{labelContainer:{display:"flex",alignItems:"center",marginBottom:15},fieldContainer:(0,o.Z)((0,o.Z)({},p.YI.fieldContainer),{},{display:"flex",alignItems:"center",justifyContent:"space-between",paddingBottom:10,marginTop:11,marginBottom:6}),dateInputContainer:{margin:"0 10px"},durationInputs:{display:"flex",alignItems:"center",justifyContent:"flex-start"},validityIndicator:{display:"flex",alignItems:"center",justifyContent:"flex-start",marginTop:25,marginLeft:10},invalidDurationText:{marginTop:15,display:"flex",color:"red",fontSize:11},reverseInput:{flexFlow:"row-reverse","& > label":{fontWeight:400,marginLeft:15,marginRight:25}},validityText:{fontSize:14,marginTop:15,display:"flex",alignItems:"center",justifyContent:"center","@media (max-width: 900px)":{flexFlow:"column"},"& > .min-icon":{color:"#5E5E5E",width:15,height:15,marginRight:10}},validTill:{fontWeight:"bold",marginLeft:15}}))}))((function(e){var n=e.classes,t=e.id,o=e.initialDate,s=e.label,r=e.maxDays,c=e.entity,l=e.onChange,d=(0,a.useState)(7),u=(0,i.Z)(d,2),h=u[0],f=u[1],p=(0,a.useState)(0),x=(0,i.Z)(p,2),v=x[0],b=x[1],j=(0,a.useState)(0),C=(0,i.Z)(j,2),N=C[0],k=C[1],E=(0,a.useState)(!0),I=(0,i.Z)(E,2),T=I[0],_=I[1],F=(0,a.useState)(Z()()),P=(0,i.Z)(F,2),L=P[0],D=P[1];(0,a.useEffect)((function(){D(function(e,n,t,i){return Z()(e).add(n,"days").add(t,"hours").add(i,"minutes")}(o,h,v,N))}),[o,h,v,N]),(0,a.useEffect)((function(){T?l(L.format("YYYY-MM-DDTHH:mm:ss"),!0):l("0000-00-00",!1)}),[L,l,T]),(0,a.useEffect)((function(){var e=!0;(h<0||r&&h>r||isNaN(h))&&(e=!1),(v<0||v>23||isNaN(v))&&(e=!1),(N<0||N>59||isNaN(N))&&(e=!1),!r||h!==r||0===v&&0===N||(e=!1),_(e)}),[L,r,l,h,v,N]);var O={style:{textAlign:"center",paddingRight:10,paddingLeft:10,width:25},className:"removeArrows"};return(0,S.jsx)(a.Fragment,{children:(0,S.jsxs)(m.ZP,{container:!0,className:n.fieldContainer,children:[(0,S.jsx)(m.ZP,{item:!0,xs:12,className:n.labelContainer,children:(0,S.jsx)(g.Z,{htmlFor:t,className:n.inputLabel,sx:{marginLeft:"10px"},children:(0,S.jsx)("span",{children:s})})}),(0,S.jsxs)(m.ZP,{item:!0,xs:12,className:n.durationInputs,children:[(0,S.jsx)(m.ZP,{item:!0,className:n.dateInputContainer,children:(0,S.jsx)(w.Z,{id:t,className:n.reverseInput,type:"number",min:"0",max:r?r.toString():"999",label:"Days",name:t,onChange:function(e){f(parseInt(e.target.value))},value:h.toString(),extraInputProps:O,noLabelMinWidth:!0})}),(0,S.jsx)(m.ZP,{item:!0,className:n.dateInputContainer,children:(0,S.jsx)(w.Z,{id:t,className:n.reverseInput,type:"number",min:"0",max:"23",label:"Hours",name:t,onChange:function(e){b(parseInt(e.target.value))},value:v.toString(),extraInputProps:O,noLabelMinWidth:!0})}),(0,S.jsx)(m.ZP,{item:!0,className:n.dateInputContainer,children:(0,S.jsx)(w.Z,{id:t,className:n.reverseInput,type:"number",min:"0",max:"59",label:"Minutes",name:t,onChange:function(e){k(parseInt(e.target.value))},value:N.toString(),extraInputProps:O,noLabelMinWidth:!0})})]}),(0,S.jsx)(m.ZP,{item:!0,xs:12,className:"".concat(n.validityIndicator," ").concat(n.formFieldRow),children:T?(0,S.jsxs)("div",{className:n.validityText,children:[(0,S.jsx)(y.xPt,{}),(0,S.jsxs)("div",{className:n.validityLabel,children:[c," will be available until:"]})," ",(0,S.jsx)("div",{className:n.validTill,children:L.format("MM/DD/YYYY HH:mm:ss")})]}):(0,S.jsx)("div",{className:n.invalidDurationText,children:"Please select a valid duration."})})]})})})),N=t(45248),k=t(85531),E=t(87995),I=t(25469),T=a.lazy((function(){return Promise.resolve().then(t.bind(t,79880))})),_=(0,d.Z)((function(e){return(0,l.Z)((0,o.Z)((0,o.Z)({shareLinkInfo:{fontSize:14,fontWeight:400},copyShareLink:{display:"flex","@media (max-width: 900px)":{flexFlow:"column",alignItems:"center",justifyContent:"center"}},copyShareLinkInput:{"& div:first-child":{marginTop:0},"@media (max-width: 900px)":{minWidth:250}},copyShareLinkBtn:{display:"flex",alignItems:"center",justifyContent:"center","@media (max-width: 900px)":{marginTop:10}}},p.ID),p.DF))}))((function(e){var n=e.classes,t=e.open,o=e.closeModalAndRefresh,s=e.bucketName,l=e.dataObject,d=(0,I.TL)(),u=(0,c.v9)(E.N5),p=(0,a.useState)(""),g=(0,i.Z)(p,2),j=g[0],Z=g[1],w=(0,a.useState)(!0),_=(0,i.Z)(w,2),F=_[0],P=_[1],L=(0,a.useState)(!1),D=(0,i.Z)(L,2),O=D[0],B=D[1],R=(0,a.useState)(""),z=(0,i.Z)(R,2),M=z[0],A=z[1],U=(0,a.useState)(!0),W=(0,i.Z)(U,2),G=W[0],H=W[1],V=(0,a.useState)("null"),K=(0,i.Z)(V,2),J=K[0],Y=K[1],q=new Date;return(0,a.useEffect)((function(){if(void 0===l.version_id)return u?(x.Z.invoke("GET","/api/v1/buckets/".concat(s,"/objects?prefix=").concat((0,N.LL)(l.name)).concat(u?"&with_versions=true":"")).then((function(e){var n=r()(e,"objects",[]).find((function(e){return e.is_latest}));Y(n?n.version_id:"null")})).catch((function(e){d((0,E.zb)(e))})),void P(!1)):(Y("null"),void P(!1));Y(l.version_id||"null"),P(!1)}),[s,l,u,d]),(0,a.useEffect)((function(){if(G&&!F){B(!0),Z("");var e=new Date("".concat(M)),n=new Date,t=Math.ceil((e.getTime()-n.getTime())/1e3);t>0&&x.Z.invoke("GET","/api/v1/buckets/".concat(s,"/objects/share?prefix=").concat((0,N.LL)(l.name),"&version_id=").concat(J).concat(""!==M?"&expires=".concat(t,"s"):"")).then((function(e){Z(e),B(!1)})).catch((function(e){d((0,E.zb)(e)),Z(""),B(!1)}))}}),[l,M,s,G,Z,d,u,F,J]),(0,S.jsx)(a.Fragment,{children:(0,S.jsxs)(v.Z,{title:"Share File",titleIcon:(0,S.jsx)(y.aAc,{style:{fill:"#4CCB92"}}),modalOpen:t,onClose:function(){o()},children:[F&&(0,S.jsx)(m.ZP,{item:!0,xs:12,children:(0,S.jsx)(f.Z,{})}),!F&&(0,S.jsxs)(a.Fragment,{children:[(0,S.jsxs)(m.ZP,{item:!0,xs:12,className:n.shareLinkInfo,children:["This is a temporary URL with integrated access credentials for sharing objects valid for up to 7 days.",(0,S.jsx)("br",{}),(0,S.jsx)("br",{}),"The temporary URL expires after the configured time limit."]}),(0,S.jsx)("br",{}),(0,S.jsx)(m.ZP,{item:!0,xs:12,className:n.dateContainer,children:(0,S.jsx)(C,{initialDate:q,id:"date",label:"Active for",maxDays:7,onChange:function(e,n){H(n),n?A(e):(A(""),Z(""))},entity:"Link"})}),(0,S.jsx)(m.ZP,{item:!0,xs:12,className:"".concat(n.copyShareLink," ").concat(n.formFieldRow," "),children:(0,S.jsx)(m.ZP,{item:!0,xs:12,className:n.copyShareLinkInput,children:(0,S.jsx)(b.Z,{content:j,actionButton:(0,S.jsx)(h(),{text:j,children:(0,S.jsx)(k.Z,{variant:"outlined",onClick:function(){d((0,E.MK)("Share URL Copied to clipboard"))},disabled:""===j||O,sx:{marginRight:"5px",width:"28px",height:"28px",padding:"0px"},children:(0,S.jsx)(T,{})})})})})})]})]})})}))},78562:function(e,n,t){t.r(n),t.d(n,{default:function(){return v}});var i=t(72791),o=t(56028),a=t(4942),s=t(29439),r=t(11135),c=t(25787),l=t(61889),d=t(40986),u=t(47922),h=t(45248),m=t(28182),f=t(80184),p=(0,c.Z)((function(){return(0,r.Z)({iframeContainer:{border:"0px",flex:"1 1 auto",width:"100%",height:250,backgroundColor:"transparent",borderRadius:5,"&.image":{height:500},"&.text":{height:700},"&.audio":{height:150},"&.video":{height:350},"&.fullHeight":{height:"calc(100vh - 185px)"}},iframeBase:{backgroundColor:"#fff"},iframeHidden:{display:"none"}})}))((function(e){var n=e.bucketName,t=e.object,o=e.isFullscreen,r=void 0!==o&&o,c=e.classes,p=(0,i.useState)(!0),x=(0,s.Z)(p,2),v=x[0],b=x[1],g="";if(t){var j=(0,h.LL)(t.name),Z=document.baseURI.replace(window.location.origin,"");g="".concat(window.location.origin).concat(Z,"api/v1/buckets/").concat(n,"/objects/download?preview=true&prefix=").concat(j),t.version_id&&(g=g.concat("&version_id=".concat(t.version_id)))}var w=(0,u.Bg)((null===t||void 0===t?void 0:t.name)||""),y=function(){b(!1)};return(0,f.jsxs)(i.Fragment,{children:[v&&(0,f.jsx)(l.ZP,{item:!0,xs:12,children:(0,f.jsx)(d.Z,{})}),(0,f.jsxs)("div",{style:{textAlign:"center"},children:["video"===w&&(0,f.jsx)("video",{style:{width:"auto",height:"auto",maxWidth:"calc(100vw - 100px)",maxHeight:"calc(100vh - 200px)"},autoPlay:!0,controls:!0,muted:!1,playsInline:!0,onPlay:y,children:(0,f.jsx)("source",{src:g,type:"video/mp4"})}),"audio"===w&&(0,f.jsx)("audio",{style:{width:"100%",height:"auto"},autoPlay:!0,controls:!0,muted:!1,playsInline:!0,onPlay:y,children:(0,f.jsx)("source",{src:g,type:"audio/mpeg"})}),"image"===w&&(0,f.jsx)("img",{style:{width:"auto",height:"auto",maxWidth:"100vw",maxHeight:"100vh"},src:g,alt:"preview",onLoad:y}),"video"!==w&&"audio"!==w&&"image"!==w&&(0,f.jsx)("div",{className:(0,m.Z)(c.iframeBase,(0,a.Z)({},c.iframeHidden,v)),children:(0,f.jsx)("iframe",{src:g,title:"File Preview",allowTransparency:!0,className:"".concat(c.iframeContainer," ").concat(r?"fullHeight":w),onLoad:y,children:"File couldn't be loaded. Please try Download instead"})})]})]})})),x=t(38734),v=function(e){var n=e.open,t=e.bucketName,a=e.object,s=e.onClosePreview;return(0,f.jsx)(i.Fragment,{children:(0,f.jsx)(o.Z,{modalOpen:n,title:"Preview - ".concat(null===a||void 0===a?void 0:a.name),onClose:s,wideLimit:!1,titleIcon:(0,f.jsx)(x.$30,{}),children:(0,f.jsx)(p,{bucketName:t,object:a})})})}},47922:function(e,n,t){t.d(n,{Bg:function(){return a},LR:function(){return o},P_:function(){return s},kh:function(){return r}});var i=t(45248),o=function(e,n,t,o){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,s=arguments.length>5?arguments[5]:void 0,r=arguments.length>6?arguments[6]:void 0,c=arguments.length>7?arguments[7]:void 0,l=arguments.length>8?arguments[8]:void 0,d=document.createElement("a");document.body.appendChild(d);var u="/api/v1/buckets/".concat(e,"/objects/download?prefix=").concat(n).concat(null!==a&&""!==a.trim()?"&override_file_name=".concat((0,i.LL)(a||"")):"");t&&(u=u.concat("&version_id=".concat(t)));var h=new XMLHttpRequest;return h.open("GET",u,!0),h.addEventListener("progress",(function(e){var n=Math.round(e.loaded/o*100);s&&s(n)}),!1),h.responseType="blob",h.onreadystatechange=function(){if(4===h.readyState)if(200===h.status){var e=h.getResponseHeader("Content-Disposition"),n="download";if(e)n=decodeURIComponent(e).split('"')[1];r&&r();var t=document.createElement("a");t.href=window.URL.createObjectURL(h.response),t.download=n,document.body.appendChild(t),t.click(),document.body.removeChild(t)}else{if("application/json"===h.getResponseHeader("Content-Type")){var i=JSON.parse(h.response);if(i.detailedMessage)return void c(i.detailedMessage)}c("Unexpected response status code (".concat(h.status,")."))}},h.onerror=function(){c&&c("A network error occurred.")},h.onabort=function(){l&&l()},h},a=function(e){var n=e.split(".").pop();return n?(n=n.toLowerCase(),["jif","jfif","apng","avif","svg","webp","bmp","ico","jpg","jpe","jpeg","gif","png","heic"].includes(n)?"image":["pdf","txt","json"].includes(n)?"text":["wav","mp3","alac","aiff","dsd","pcm"].includes(n)?"audio":["mp4","avi","mpg","webm","mov","flv","mkv","wmv","avchd","mpeg-4"].includes(n)?"video":"none"):"none"},s=function(e){switch(e){case"name":return function(e,n){return e.name.localeCompare(n.name)};case"last_modified":return function(e,n){return new Date(e.last_modified).getTime()-new Date(n.last_modified).getTime()};case"size":return function(e,n){return(e.size||-1)-(n.size||-1)}}},r=function(e,n,t){if(0===t.length)return null;var i=t.filter((function(n){return n.resource.endsWith(":".concat(e))||n.resource.includes(":".concat(e,"/"))}));if(0===i.length)return null;var o=[],a=n.split("/");return i.forEach((function(e){var n=(e.resource.split(":").pop()||"").split("/");n.length>1&&n.every((function(e,n){return"*"!==e&&((!a[n]||a[n]===e)&&(a[n]||o.push({name:"".concat(e,"/"),size:0,last_modified:new Date,version_id:""}),!0))})),"StringEquals"!==e.conditionOperator&&"StringLike"!==e.conditionOperator||e.prefixes.forEach((function(e){if(""!==e){var n=e.split("/"),t=[];n.every((function(e,n){return!e.includes("*")&&""!==e&&(e!==a[n]?(o.push({name:"".concat(t.join("/")).concat(t.length>0?"/":"").concat(e,"/"),size:0,last_modified:new Date,version_id:""}),!1):(""!==e&&t.push(e),!0))}))}}))})),o}},73996:function(e,n,t){t(72791);var i=t(38734),o=t(60364),a=t(80184);n.Z=function(e){var n=e.marginRight,s=e.marginTop,r=t(47045),c=(0,o.v9)((function(e){return e.system.overrideStyles})),l=r((null===c||void 0===c?void 0:c.backgroundColor)||"#fff").getBrightness()<=128;return(0,a.jsx)(i.BHR,{style:{width:105,marginRight:n,marginTop:s,fill:l?"#fff":"#081C42"}})}},75578:function(e,n,t){var i=t(1413),o=t(72791),a=t(80184);n.Z=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;function t(t){return(0,a.jsx)(o.Suspense,{fallback:n,children:(0,a.jsx)(e,(0,i.Z)({},t))})}return t}},64163:function(e,n,t){var i=t(1413),o=t(72791),a=t(61889),s=t(11135),r=t(25787),c=t(23814),l=t(80184);n.Z=(0,r.Z)((function(e){return(0,s.Z)((0,i.Z)({},c.xx))}))((function(e){var n=e.classes,t=e.label,i=void 0===t?"":t,s=e.content,r=e.multiLine,c=void 0!==r&&r,d=e.actionButton;return(0,l.jsx)(o.Fragment,{children:(0,l.jsxs)(a.ZP,{className:n.prefinedContainer,children:[""!==i&&(0,l.jsx)(a.ZP,{item:!0,xs:12,className:n.predefinedTitle,children:i}),(0,l.jsxs)(a.ZP,{item:!0,xs:12,className:"".concat(n.predefinedList," ").concat(d?n.includesActionButton:""),children:[(0,l.jsx)(a.ZP,{item:!0,xs:12,className:c?n.innerContentMultiline:n.innerContent,children:s}),d&&(0,l.jsx)("div",{className:n.overlayShareOption,children:d})]})]})})}))},56028:function(e,n,t){var i=t(29439),o=t(1413),a=t(72791),s=t(60364),r=t(13400),c=t(55646),l=t(5574),d=t(65661),u=t(39157),h=t(11135),m=t(25787),f=t(23814),p=t(25469),x=t(29823),v=t(28057),b=t(87995),g=t(80184);n.Z=(0,m.Z)((function(e){return(0,h.Z)((0,o.Z)((0,o.Z)({},f.Qw),{},{content:{padding:25,paddingBottom:0},customDialogSize:{width:"100%",maxWidth:765}},f.sN))}))((function(e){var n=e.onClose,t=e.modalOpen,h=e.title,m=e.children,f=e.classes,j=e.wideLimit,Z=void 0===j||j,w=e.noContentPadding,y=e.titleIcon,S=void 0===y?null:y,C=(0,p.TL)(),N=(0,a.useState)(!1),k=(0,i.Z)(N,2),E=k[0],I=k[1],T=(0,s.v9)((function(e){return e.system.modalSnackBar}));(0,a.useEffect)((function(){C((0,b.MK)(""))}),[C]),(0,a.useEffect)((function(){if(T){if(""===T.message)return void I(!1);"error"!==T.type&&I(!0)}}),[T]);var _=Z?{classes:{paper:f.customDialogSize}}:{maxWidth:"lg",fullWidth:!0},F="";return T&&(F=T.detailedErrorMsg,(""===T.detailedErrorMsg||T.detailedErrorMsg.length<5)&&(F=T.message)),(0,g.jsxs)(l.Z,(0,o.Z)((0,o.Z)({open:t,classes:f},_),{},{scroll:"paper",onClose:function(e,t){"backdropClick"!==t&&n()},className:f.root,children:[(0,g.jsxs)(d.Z,{className:f.title,children:[(0,g.jsxs)("div",{className:f.titleText,children:[S," ",h]}),(0,g.jsx)("div",{className:f.closeContainer,children:(0,g.jsx)(r.Z,{"aria-label":"close",id:"close",className:f.closeButton,onClick:n,disableRipple:!0,size:"small",children:(0,g.jsx)(x.Z,{})})})]}),(0,g.jsx)(v.Z,{isModal:!0}),(0,g.jsx)(c.Z,{open:E,className:f.snackBarModal,onClose:function(){I(!1),C((0,b.MK)(""))},message:F,ContentProps:{className:"".concat(f.snackBar," ").concat(T&&"error"===T.type?f.errorSnackBar:"")},autoHideDuration:T&&"error"===T.type?1e4:5e3}),(0,g.jsx)(u.Z,{className:w?"":f.content,children:m})]}))}))},59114:function(e,n,t){var i=t(4942),o=t(1413),a=(t(72791),t(63466)),s=t(74900),r=t(27391),c=t(25787),l=t(11135),d=t(23814),u=t(80184);n.Z=(0,c.Z)((function(e){return(0,l.Z)({searchField:(0,o.Z)({},d.qg.searchField),adornment:{}})}))((function(e){var n=e.placeholder,t=void 0===n?"":n,o=e.classes,c=e.onChange,l=e.adornmentPosition,d=void 0===l?"end":l,h=e.overrideClass,m=e.value,f=(0,i.Z)({disableUnderline:!0},"".concat(d,"Adornment"),(0,u.jsx)(a.Z,{position:d,className:o.adornment,children:(0,u.jsx)(s.Z,{})}));return(0,u.jsx)(r.Z,{placeholder:t,className:h||o.searchField,id:"search-resource",label:"",InputProps:f,onChange:function(e){c(e.target.value)},variant:"standard",value:m})}))},76610:function(e,n,t){t.d(n,{EN:function(){return o},Gy:function(){return a},YO:function(){return s}});var i={},o=function(e,n){i[e]=n},a=function(e){return i[e]},s=function(e){for(var n="",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",i=t.length,o=0;o .\n\nimport React, { Fragment, useState } from \"react\";\nimport { useSelector } from \"react-redux\";\nimport CopyToClipboard from \"react-copy-to-clipboard\";\nimport Grid from \"@mui/material/Grid\";\nimport withStyles from \"@mui/styles/withStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport { Theme } from \"@mui/material/styles\";\nimport { Link, useNavigate } from \"react-router-dom\";\nimport { Button, IconButton, Tooltip } from \"@mui/material\";\nimport { objectBrowserCommon } from \"../Common/FormComponents/common/styleLibrary\";\nimport { encodeURLString } from \"../../../common/utils\";\nimport { BackCaretIcon, CopyIcon, NewPathIcon } from \"../../../icons\";\nimport { hasPermission } from \"../../../common/SecureComponent\";\nimport { IAM_SCOPES } from \"../../../common/SecureComponent/permissions\";\nimport { BucketObjectItem } from \"../Buckets/ListBuckets/Objects/ListObjects/types\";\nimport withSuspense from \"../Common/Components/withSuspense\";\nimport { setSnackBarMessage } from \"../../../systemSlice\";\nimport { AppState, useAppDispatch } from \"../../../store\";\nimport { setVersionsModeEnabled } from \"./objectBrowserSlice\";\nimport RBIconButton from \"../Buckets/BucketDetails/SummaryItems/RBIconButton\";\n\nconst CreatePathModal = withSuspense(\n React.lazy(\n () => import(\"../Buckets/ListBuckets/Objects/ListObjects/CreatePathModal\")\n )\n);\n\nconst styles = (theme: Theme) =>\n createStyles({\n ...objectBrowserCommon,\n slashSpacingStyle: {\n margin: \"0 5px\",\n },\n });\n\ninterface IObjectBrowser {\n classes: any;\n bucketName: string;\n internalPaths: string;\n hidePathButton?: boolean;\n existingFiles: BucketObjectItem[];\n additionalOptions?: React.ReactNode;\n}\n\nconst BrowserBreadcrumbs = ({\n classes,\n bucketName,\n internalPaths,\n existingFiles,\n hidePathButton,\n additionalOptions,\n}: IObjectBrowser) => {\n const dispatch = useAppDispatch();\n const navigate = useNavigate();\n\n const rewindEnabled = useSelector(\n (state: AppState) => state.objectBrowser.rewind.rewindEnabled\n );\n const versionsMode = useSelector(\n (state: AppState) => state.objectBrowser.versionsMode\n );\n const versionedFile = useSelector(\n (state: AppState) => state.objectBrowser.versionedFile\n );\n\n const [createFolderOpen, setCreateFolderOpen] = useState(false);\n\n let paths = internalPaths;\n\n if (internalPaths !== \"\") {\n paths = `/${internalPaths}`;\n }\n\n const splitPaths = paths.split(\"/\").filter((path) => path !== \"\");\n const lastBreadcrumbsIndex = splitPaths.length - 1;\n\n let breadcrumbsMap = splitPaths.map((objectItem: string, index: number) => {\n const subSplit = `${splitPaths.slice(0, index + 1).join(\"/\")}/`;\n const route = `/buckets/${bucketName}/browse/${\n subSplit ? `${encodeURLString(subSplit)}` : ``\n }`;\n\n if (index === lastBreadcrumbsIndex && objectItem === versionedFile) {\n return null;\n }\n\n return (\n \n / \n {index === lastBreadcrumbsIndex ? (\n {objectItem} \n ) : (\n {\n dispatch(\n setVersionsModeEnabled({ status: false, objectName: \"\" })\n );\n }}\n >\n {objectItem}\n \n )}\n \n );\n });\n\n let versionsItem: any[] = [];\n\n if (versionsMode) {\n versionsItem = [\n \n \n / \n {versionedFile} - Versions\n \n ,\n ];\n }\n\n const listBreadcrumbs: any[] = [\n \n {\n dispatch(setVersionsModeEnabled({ status: false, objectName: \"\" }));\n }}\n >\n {bucketName}\n \n ,\n ...breadcrumbsMap,\n ...versionsItem,\n ];\n\n const closeAddFolderModal = () => {\n setCreateFolderOpen(false);\n };\n\n const goBackFunction = () => {\n if (versionsMode) {\n dispatch(setVersionsModeEnabled({ status: false, objectName: \"\" }));\n } else {\n navigate(-1);\n }\n };\n\n return (\n \n \n {createFolderOpen && (\n
\n )}\n
\n \n \n \n \n {listBreadcrumbs}\n
\n \n }\n disableTouchRipple\n disableRipple\n focusRipple={false}\n variant={\"outlined\"}\n onClick={() => {\n dispatch(setSnackBarMessage(\"Path copied to clipboard\"));\n }}\n sx={{\n marginRight: \"3px\",\n padding: \"0\",\n color: \"#969FA8\",\n border: \"#969FA8 1px solid\",\n width: \"28px\",\n height: \"28px\",\n\n \"& .MuiButton-root\": {\n height: \"28px\",\n },\n \"& .min-icon\": {\n width: \"12px\",\n height: \"12px\",\n },\n }}\n />\n \n {additionalOptions}
\n \n {!hidePathButton && (\n
\n {\n setCreateFolderOpen(true);\n }}\n disabled={\n rewindEnabled ||\n !hasPermission(bucketName, [IAM_SCOPES.S3_PUT_OBJECT])\n }\n endIcon={ }\n disableTouchRipple\n disableRipple\n focusRipple={false}\n sx={{\n color: \"#969FA8\",\n border: \"#969FA8 1px solid\",\n whiteSpace: \"nowrap\",\n minWidth: \"160px\",\n \"@media (max-width: 1060px)\": {\n fontSize: 0,\n minWidth: 40,\n padding: \"0 10px 0 0\",\n },\n }}\n variant={\"outlined\"}\n >\n Create new path\n \n \n )}\n
\n {additionalOptions}
\n \n );\n};\n\nexport default withStyles(styles)(BrowserBreadcrumbs);\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment } from \"react\";\nimport { Theme } from \"@mui/material/styles\";\nimport { Menu, MenuItem } from \"@mui/material\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport withStyles from \"@mui/styles/withStyles\";\nimport ListItemText from \"@mui/material/ListItemText\";\nimport ListItemIcon from \"@mui/material/ListItemIcon\";\nimport { UploadFolderIcon, UploadIcon } from \"../../../../icons\";\nimport RBIconButton from \"../BucketDetails/SummaryItems/RBIconButton\";\nimport { IAM_SCOPES } from \"../../../../common/SecureComponent/permissions\";\nimport { hasPermission } from \"../../../../common/SecureComponent\";\n\ninterface IUploadFilesButton {\n uploadPath: string;\n bucketName: string;\n forceDisable?: boolean;\n uploadFileFunction: (closeFunction: () => void) => void;\n uploadFolderFunction: (closeFunction: () => void) => void;\n classes: any;\n}\n\nconst styles = (theme: Theme) =>\n createStyles({\n listUploadIcons: {\n height: 20,\n \"& .min-icon\": {\n width: 18,\n fill: \"rgba(0,0,0,0.87)\",\n },\n },\n });\n\nconst UploadFilesButton = ({\n uploadPath,\n bucketName,\n forceDisable = false,\n uploadFileFunction,\n uploadFolderFunction,\n classes,\n}: IUploadFilesButton) => {\n const [anchorEl, setAnchorEl] = React.useState(null);\n const openUploadMenu = Boolean(anchorEl);\n const handleClick = (event: React.MouseEvent) => {\n setAnchorEl(event.currentTarget);\n };\n const handleCloseUpload = () => {\n setAnchorEl(null);\n };\n\n const uploadObjectAllowed = hasPermission(uploadPath, [\n IAM_SCOPES.S3_PUT_OBJECT,\n ]);\n const uploadFolderAllowed = hasPermission(\n bucketName,\n [IAM_SCOPES.S3_PUT_OBJECT],\n false,\n true\n );\n\n const uploadEnabled: boolean = uploadObjectAllowed || uploadFolderAllowed;\n\n return (\n \n }\n color=\"primary\"\n variant={\"contained\"}\n disabled={forceDisable || !uploadEnabled}\n />\n {\n handleCloseUpload();\n }}\n anchorOrigin={{\n vertical: \"bottom\",\n horizontal: \"center\",\n }}\n transformOrigin={{\n vertical: \"top\",\n horizontal: \"center\",\n }}\n >\n {\n uploadFileFunction(handleCloseUpload);\n }}\n disabled={!uploadObjectAllowed || forceDisable}\n >\n \n \n \n Upload File \n \n {\n uploadFolderFunction(handleCloseUpload);\n }}\n disabled={!uploadFolderAllowed || forceDisable}\n >\n \n \n \n Upload Folder \n \n \n \n );\n};\n\nexport default withStyles(styles)(UploadFilesButton);\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React from \"react\";\nimport { Theme } from \"@mui/material/styles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport { Grid, IconButton } from \"@mui/material\";\nimport { ClosePanelIcon } from \"../../../../../../icons\";\nimport makeStyles from \"@mui/styles/makeStyles\";\n\ninterface IDetailsListPanel {\n open: boolean;\n className?: string;\n closePanel: () => void;\n children: React.ReactNode;\n}\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n detailsList: {\n borderColor: \"#EAEDEE\",\n borderWidth: 0,\n borderStyle: \"solid\",\n borderRadius: 3,\n borderBottomLeftRadius: 0,\n borderBottomRightRadius: 0,\n width: 0,\n transitionDuration: \"0.3s\",\n overflowX: \"hidden\",\n overflowY: \"auto\",\n position: \"relative\",\n opacity: 0,\n marginLeft: -1,\n \"&.open\": {\n width: 300,\n minWidth: 300,\n borderLeftWidth: 1,\n opacity: 1,\n },\n \"@media (max-width: 799px)\": {\n \"&.open\": {\n width: \"100%\",\n minWidth: \"100%\",\n borderLeftWidth: 0,\n },\n },\n },\n closePanel: {\n position: \"absolute\",\n right: 0,\n top: 8,\n \"& .min-icon\": {\n width: 14,\n },\n },\n })\n);\n\nconst DetailsListPanel = ({\n open,\n closePanel,\n className = \"\",\n children,\n}: IDetailsListPanel) => {\n const classes = useStyles();\n\n return (\n \n \n \n \n {children}\n \n );\n};\n\nexport default DetailsListPanel;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nexport const months = [\n { value: \"01\", label: \"January\" },\n { value: \"02\", label: \"February\" },\n { value: \"03\", label: \"March\" },\n { value: \"04\", label: \"April\" },\n { value: \"05\", label: \"May\" },\n { value: \"06\", label: \"June\" },\n { value: \"07\", label: \"July\" },\n { value: \"08\", label: \"August\" },\n { value: \"09\", label: \"September\" },\n { value: \"10\", label: \"October\" },\n { value: \"11\", label: \"November\" },\n { value: \"12\", label: \"December\" },\n];\n\nexport const days = Array.from(Array(31), (_, num) => num + 1);\n\nconst currentYear = new Date().getFullYear();\n\nexport const years = Array.from(\n Array(25),\n (_, numYear) => numYear + currentYear\n);\n\nexport const validDate = (year: string, month: string, day: string): any[] => {\n const currentDate = Date.parse(`${year}-${month}-${day}`);\n\n if (isNaN(currentDate)) {\n return [false, \"\"];\n }\n\n const parsedMonth = parseInt(month);\n const parsedDay = parseInt(day);\n\n const monthForString = parsedMonth < 10 ? `0${parsedMonth}` : parsedMonth;\n const dayForString = parsedDay < 10 ? `0${parsedDay}` : parsedDay;\n\n const parsedDate = new Date(currentDate).toISOString().split(\"T\")[0];\n const dateString = `${year}-${monthForString}-${dayForString}`;\n\n return [parsedDate === dateString, dateString];\n};\n\n// twoDigitDate gets a two digit string number used for months or days\n// returns \"NaN\" if number is NaN\nexport const twoDigitDate = (num: number): string => {\n return num < 10 ? `0${num}` : `${num}`;\n};\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, {\n forwardRef,\n useEffect,\n useImperativeHandle,\n useState,\n} from \"react\";\nimport clsx from \"clsx\";\nimport Grid from \"@mui/material/Grid\";\nimport { SelectChangeEvent } from \"@mui/material\";\nimport { Theme } from \"@mui/material/styles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport withStyles from \"@mui/styles/withStyles\";\nimport InputLabel from \"@mui/material/InputLabel\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport FormControl from \"@mui/material/FormControl\";\nimport Select from \"@mui/material/Select\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport InputBase from \"@mui/material/InputBase\";\nimport { fieldBasic, tooltipHelper } from \"../common/styleLibrary\";\nimport HelpIcon from \"../../../../../icons/HelpIcon\";\nimport FormSwitchWrapper from \"../FormSwitchWrapper/FormSwitchWrapper\";\nimport { days, months, validDate, years } from \"./utils\";\n\nconst styles = (theme: Theme) =>\n createStyles({\n dateInput: {\n \"&:not(:last-child)\": {\n marginRight: 22,\n },\n },\n ...fieldBasic,\n ...tooltipHelper,\n labelContainer: {\n flex: 1,\n },\n fieldContainer: {\n ...fieldBasic.fieldContainer,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n paddingBottom: 10,\n marginTop: 11,\n marginBottom: 6,\n },\n fieldContainerBorder: {\n borderBottom: \"#9c9c9c 1px solid\",\n marginBottom: 20,\n },\n });\n\nconst SelectStyled = withStyles((theme: Theme) =>\n createStyles({\n root: {\n \"& .MuiSelect-icon\": {\n color: \"#000\",\n \"&.Mui-disabled\": {\n color: \"#9c9c9c\",\n },\n },\n },\n input: {\n borderBottom: 0,\n fontSize: 12,\n },\n })\n)(InputBase);\n\ninterface IDateSelectorProps {\n classes: any;\n id: string;\n label: string;\n disableOptions?: boolean;\n addSwitch?: boolean;\n tooltip?: string;\n borderBottom?: boolean;\n value?: string;\n onDateChange: (date: string, isValid: boolean) => any;\n}\n\nconst DateSelector = forwardRef(\n (\n {\n classes,\n id,\n label,\n disableOptions = false,\n addSwitch = false,\n tooltip = \"\",\n borderBottom = false,\n onDateChange,\n value = \"\",\n }: IDateSelectorProps,\n ref: any\n ) => {\n useImperativeHandle(ref, () => ({ resetDate }));\n\n const [dateEnabled, setDateEnabled] = useState(false);\n const [month, setMonth] = useState(\"\");\n const [day, setDay] = useState(\"\");\n const [year, setYear] = useState(\"\");\n\n useEffect(() => {\n // verify if there is a current value\n // assume is in the format \"2021-12-30\"\n if (value !== \"\") {\n const valueSplit = value.split(\"-\");\n setYear(valueSplit[0]);\n setMonth(valueSplit[1]);\n // Turn to single digit to be displayed on dropdown buttons\n setDay(`${parseInt(valueSplit[2])}`);\n }\n }, [value]);\n\n useEffect(() => {\n const [isValid, dateString] = validDate(year, month, day);\n onDateChange(dateString, isValid);\n }, [month, day, year, onDateChange]);\n\n const resetDate = () => {\n setMonth(\"\");\n setDay(\"\");\n setYear(\"\");\n };\n\n const isDateDisabled = () => {\n if (disableOptions) {\n return disableOptions;\n } else if (addSwitch) {\n return !dateEnabled;\n } else {\n return false;\n }\n };\n\n const onMonthChange = (e: SelectChangeEvent) => {\n setMonth(e.target.value as string);\n };\n\n const onDayChange = (e: SelectChangeEvent) => {\n setDay(e.target.value as string);\n };\n\n const onYearChange = (e: SelectChangeEvent) => {\n setYear(e.target.value as string);\n };\n\n return (\n \n \n
\n \n {label} \n {tooltip !== \"\" && (\n \n )}\n \n {addSwitch && (\n {\n setDateEnabled(e.target.checked);\n if (!e.target.checked) {\n onDateChange(\"\", true);\n }\n }}\n switchOnly\n />\n )}\n \n
\n \n \n }\n >\n \n {\"\"}\n \n {months.map((option) => (\n \n {option.label}\n \n ))}\n \n \n \n }\n >\n \n {\"\"}\n \n {days.map((dayNumber) => (\n \n {dayNumber}\n \n ))}\n \n \n \n }\n >\n \n {\"\"}\n \n {years.map((year) => (\n \n {year}\n \n ))}\n \n \n
\n \n );\n }\n);\n\nexport default withStyles(styles)(DateSelector);\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { useEffect, useRef, useState } from \"react\";\n\nimport { Theme } from \"@mui/material/styles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport withStyles from \"@mui/styles/withStyles\";\nimport Grid from \"@mui/material/Grid\";\nimport Button from \"@mui/material/Button\";\nimport {\n formFieldStyles,\n modalStyleUtils,\n spacingUtils,\n} from \"../../../../Common/FormComponents/common/styleLibrary\";\nimport { IFileInfo } from \"./types\";\n\nimport { twoDigitDate } from \"../../../../Common/FormComponents/DateSelector/utils\";\nimport { ErrorResponseHandler } from \"../../../../../../common/types\";\nimport ModalWrapper from \"../../../../Common/ModalWrapper/ModalWrapper\";\nimport FormSwitchWrapper from \"../../../../Common/FormComponents/FormSwitchWrapper/FormSwitchWrapper\";\nimport RadioGroupSelector from \"../../../../Common/FormComponents/RadioGroupSelector/RadioGroupSelector\";\nimport DateSelector from \"../../../../Common/FormComponents/DateSelector/DateSelector\";\nimport api from \"../../../../../../common/api\";\nimport { encodeURLString } from \"../../../../../../common/utils\";\nimport { setModalErrorSnackMessage } from \"../../../../../../systemSlice\";\nimport { useAppDispatch } from \"../../../../../../store\";\n\nconst styles = (theme: Theme) =>\n createStyles({\n ...formFieldStyles,\n ...modalStyleUtils,\n ...spacingUtils,\n dateSelector: {\n \"& div\": {\n borderBottom: 0,\n marginBottom: 0,\n\n \"& div:nth-child(2)\": {\n border: \"1px solid #EAEAEA\",\n paddingLeft: 5,\n\n \"& div\": {\n border: 0,\n },\n },\n },\n },\n });\n\ninterface ISetRetentionProps {\n classes: any;\n open: boolean;\n closeModalAndRefresh: (updateInfo: boolean) => void;\n objectName: string;\n bucketName: string;\n objectInfo: IFileInfo;\n}\n\ninterface IRefObject {\n resetDate: () => void;\n}\n\nconst SetRetention = ({\n classes,\n open,\n closeModalAndRefresh,\n objectName,\n objectInfo,\n bucketName,\n}: ISetRetentionProps) => {\n const dispatch = useAppDispatch();\n const [statusEnabled, setStatusEnabled] = useState(true);\n const [type, setType] = useState(\"\");\n const [date, setDate] = useState(\"\");\n const [isDateValid, setIsDateValid] = useState(false);\n const [isSaving, setIsSaving] = useState(false);\n const [alreadyConfigured, setAlreadyConfigured] = useState(false);\n\n useEffect(() => {\n if (objectInfo.retention_mode) {\n setType(objectInfo.retention_mode.toLowerCase());\n setAlreadyConfigured(true);\n }\n // get retention_until_date if defined\n if (objectInfo.retention_until_date) {\n const valueDate = new Date(objectInfo.retention_until_date);\n if (valueDate.toString() !== \"Invalid Date\") {\n const year = valueDate.getFullYear();\n const month = twoDigitDate(valueDate.getMonth() + 1);\n const day = valueDate.getDate();\n if (!isNaN(day) && month !== \"NaN\" && !isNaN(year)) {\n setDate(`${year}-${month}-${day}`);\n }\n }\n setAlreadyConfigured(true);\n }\n }, [objectInfo]);\n\n const dateElement = useRef(null);\n\n const dateFieldDisabled = () => {\n return !(statusEnabled && (type === \"governance\" || type === \"compliance\"));\n };\n\n const onSubmit = (e: React.FormEvent) => {\n e.preventDefault();\n };\n\n const resetForm = () => {\n setStatusEnabled(false);\n setType(\"\");\n if (dateElement.current) {\n dateElement.current.resetDate();\n }\n };\n\n const addRetention = (\n selectedObject: string,\n versionId: string | null,\n expireDate: string\n ) => {\n api\n .invoke(\n \"PUT\",\n `/api/v1/buckets/${bucketName}/objects/retention?prefix=${encodeURLString(\n selectedObject\n )}&version_id=${versionId}`,\n {\n expires: expireDate,\n mode: type,\n }\n )\n .then((res: any) => {\n setIsSaving(false);\n closeModalAndRefresh(true);\n })\n .catch((error: ErrorResponseHandler) => {\n dispatch(setModalErrorSnackMessage(error));\n setIsSaving(false);\n });\n };\n\n const disableRetention = (\n selectedObject: string,\n versionId: string | null\n ) => {\n api\n .invoke(\n \"DELETE\",\n `/api/v1/buckets/${bucketName}/objects/retention?prefix=${encodeURLString(\n selectedObject\n )}&version_id=${versionId}`\n )\n .then(() => {\n setIsSaving(false);\n closeModalAndRefresh(true);\n })\n .catch((error: ErrorResponseHandler) => {\n dispatch(setModalErrorSnackMessage(error));\n setIsSaving(false);\n });\n };\n\n const saveNewRetentionPolicy = () => {\n setIsSaving(true);\n const selectedObject = objectInfo.name;\n const versionId = objectInfo.version_id;\n\n const expireDate =\n !statusEnabled && type === \"governance\" ? \"\" : `${date}T23:59:59Z`;\n\n if (!statusEnabled && type === \"governance\") {\n disableRetention(selectedObject, versionId);\n\n return;\n }\n\n addRetention(selectedObject, versionId, expireDate);\n };\n\n const showSwitcher =\n alreadyConfigured && (type === \"governance\" || type === \"\");\n\n return (\n {\n resetForm();\n closeModalAndRefresh(false);\n }}\n >\n \n Selected Object : {objectName}\n
\n \n \n );\n};\n\nexport default withStyles(styles)(SetRetention);\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment, useState } from \"react\";\nimport { DialogContentText } from \"@mui/material\";\n\nimport { ErrorResponseHandler } from \"../../../../../../common/types\";\nimport { decodeURLString } from \"../../../../../../common/utils\";\nimport ConfirmDialog from \"../../../../Common/ModalWrapper/ConfirmDialog\";\nimport useApi from \"../../../../Common/Hooks/useApi\";\nimport { ConfirmDeleteIcon } from \"../../../../../../icons\";\nimport FormSwitchWrapper from \"../../../../Common/FormComponents/FormSwitchWrapper/FormSwitchWrapper\";\n\nimport { setErrorSnackMessage } from \"../../../../../../systemSlice\";\nimport { useAppDispatch } from \"../../../../../../store\";\n\ninterface IDeleteObjectProps {\n closeDeleteModalAndRefresh: (refresh: boolean) => void;\n deleteOpen: boolean;\n selectedObject: string;\n selectedBucket: string;\n\n versioning: boolean;\n selectedVersion?: string;\n}\n\nconst DeleteObject = ({\n closeDeleteModalAndRefresh,\n deleteOpen,\n selectedBucket,\n selectedObject,\n\n versioning,\n selectedVersion = \"\",\n}: IDeleteObjectProps) => {\n const dispatch = useAppDispatch();\n const onDelSuccess = () => closeDeleteModalAndRefresh(true);\n const onDelError = (err: ErrorResponseHandler) =>\n dispatch(setErrorSnackMessage(err));\n const onClose = () => closeDeleteModalAndRefresh(false);\n\n const [deleteLoading, invokeDeleteApi] = useApi(onDelSuccess, onDelError);\n const [deleteVersions, setDeleteVersions] = useState(false);\n\n if (!selectedObject) {\n return null;\n }\n const onConfirmDelete = () => {\n const decodedSelectedObject = decodeURLString(selectedObject);\n const recursive = decodedSelectedObject.endsWith(\"/\");\n invokeDeleteApi(\n \"DELETE\",\n `/api/v1/buckets/${selectedBucket}/objects?path=${selectedObject}${\n selectedVersion !== \"\"\n ? `&version_id=${selectedVersion}`\n : `&recursive=${recursive}&all_versions=${deleteVersions}`\n }`\n );\n };\n\n return (\n }\n isLoading={deleteLoading}\n onConfirm={onConfirmDelete}\n onClose={onClose}\n confirmationContent={\n \n Are you sure you want to delete: \n {decodeURLString(selectedObject)} {\" \"}\n {selectedVersion !== \"\" ? (\n \n \n \n Version ID:\n \n {selectedVersion} \n \n ) : (\n \"\"\n )}\n ? \n \n {versioning && selectedVersion === \"\" && (\n {\n setDeleteVersions(!deleteVersions);\n }}\n description=\"\"\n />\n )}\n \n }\n />\n );\n};\n\nexport default DeleteObject;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { useEffect, useState } from \"react\";\nimport { Theme } from \"@mui/material/styles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport withStyles from \"@mui/styles/withStyles\";\nimport get from \"lodash/get\";\nimport Grid from \"@mui/material/Grid\";\nimport Button from \"@mui/material/Button\";\nimport {\n formFieldStyles,\n modalStyleUtils,\n spacingUtils,\n} from \"../../../../Common/FormComponents/common/styleLibrary\";\n\nimport { IFileInfo } from \"./types\";\nimport { ErrorResponseHandler } from \"../../../../../../common/types\";\nimport ModalWrapper from \"../../../../Common/ModalWrapper/ModalWrapper\";\nimport FormSwitchWrapper from \"../../../../Common/FormComponents/FormSwitchWrapper/FormSwitchWrapper\";\nimport api from \"../../../../../../common/api\";\nimport { encodeURLString } from \"../../../../../../common/utils\";\n\nimport { setModalErrorSnackMessage } from \"../../../../../../systemSlice\";\nimport { useAppDispatch } from \"../../../../../../store\";\n\nconst styles = (theme: Theme) =>\n createStyles({\n ...formFieldStyles,\n ...modalStyleUtils,\n ...spacingUtils,\n });\n\ninterface ISetRetentionProps {\n classes: any;\n open: boolean;\n closeModalAndRefresh: (reload: boolean) => void;\n objectName: string;\n bucketName: string;\n actualInfo: IFileInfo;\n}\n\nconst SetLegalHoldModal = ({\n classes,\n open,\n closeModalAndRefresh,\n objectName,\n bucketName,\n actualInfo,\n}: ISetRetentionProps) => {\n const dispatch = useAppDispatch();\n const [legalHoldEnabled, setLegalHoldEnabled] = useState(false);\n const [isSaving, setIsSaving] = useState(false);\n const versionId = actualInfo.version_id;\n\n useEffect(() => {\n const status = get(actualInfo, \"legal_hold_status\", \"OFF\");\n setLegalHoldEnabled(status === \"ON\");\n }, [actualInfo]);\n\n const onSubmit = (e: React.FormEvent) => {\n e.preventDefault();\n setIsSaving(true);\n\n api\n .invoke(\n \"PUT\",\n `/api/v1/buckets/${bucketName}/objects/legalhold?prefix=${encodeURLString(\n objectName\n )}&version_id=${versionId}`,\n { status: legalHoldEnabled ? \"enabled\" : \"disabled\" }\n )\n .then(() => {\n setIsSaving(false);\n closeModalAndRefresh(true);\n })\n .catch((error: ErrorResponseHandler) => {\n dispatch(setModalErrorSnackMessage(error));\n setIsSaving(false);\n });\n };\n\n const resetForm = () => {\n setLegalHoldEnabled(false);\n };\n\n return (\n {\n resetForm();\n closeModalAndRefresh(false);\n }}\n >\n \n Object: {bucketName}\n \n\n \n \n );\n};\n\nexport default withStyles(styles)(SetLegalHoldModal);\n","import React, { Fragment, useCallback, useEffect, useState } from \"react\";\nimport useApi from \"../../../../Common/Hooks/useApi\";\nimport { ErrorResponseHandler } from \"../../../../../../common/types\";\nimport { MetadataResponse } from \"./types\";\nimport get from \"lodash/get\";\nimport Grid from \"@mui/material/Grid\";\nimport { Box, Table, TableBody, TableCell, TableRow } from \"@mui/material\";\nimport { Theme } from \"@mui/material/styles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport {\n detailsPanel,\n spacingUtils,\n} from \"../../../../Common/FormComponents/common/styleLibrary\";\nimport { withStyles } from \"@mui/styles\";\n\ninterface IObjectMetadata {\n bucketName: string;\n internalPaths: string;\n classes?: any;\n actualInfo: any;\n linear?: boolean;\n}\n\nconst styles = (theme: Theme) =>\n createStyles({\n propertiesIcon: {\n marginLeft: 5,\n \"& .min-icon\": {\n height: 12,\n },\n },\n\n capitalizeFirst: {\n textTransform: \"capitalize\",\n \"& .min-icon\": {\n width: 16,\n height: 16,\n },\n },\n titleItem: {\n width: \"35%\",\n },\n ...spacingUtils,\n ...detailsPanel,\n });\n\nconst ObjectMetaData = ({\n bucketName,\n internalPaths,\n classes,\n actualInfo,\n linear = false,\n}: IObjectMetadata) => {\n const [metaData, setMetaData] = useState({});\n\n const onMetaDataSuccess = (res: MetadataResponse) => {\n let metadata = get(res, \"objectMetadata\", {});\n\n setMetaData(metadata);\n };\n const onMetaDataError = (err: ErrorResponseHandler) => false;\n\n const [, invokeMetaDataApi] = useApi(onMetaDataSuccess, onMetaDataError);\n\n const metaKeys = Object.keys(metaData);\n const loadMetaData = useCallback(() => {\n invokeMetaDataApi(\n \"GET\",\n `/api/v1/buckets/${bucketName}/objects/metadata?prefix=${internalPaths}`\n );\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [bucketName, internalPaths, actualInfo]);\n\n useEffect(() => {\n if (actualInfo) {\n loadMetaData();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [actualInfo, loadMetaData]);\n\n if (linear) {\n return (\n \n {metaKeys.map((element: string, index: number) => {\n const renderItem = Array.isArray(metaData[element])\n ? metaData[element].map(decodeURIComponent).join(\", \")\n : decodeURIComponent(metaData[element]);\n\n return (\n \n {element} \n \n {renderItem}\n \n );\n })}\n \n );\n }\n\n return (\n \n \n \n Object Metadata\n \n \n\n \n \n \n {metaKeys.map((element: string, index: number) => {\n const renderItem = Array.isArray(metaData[element])\n ? metaData[element].map(decodeURIComponent).join(\", \")\n : decodeURIComponent(metaData[element]);\n\n return (\n \n \n {element}\n \n {renderItem} \n \n );\n })}\n \n
\n \n \n );\n};\n\nexport default withStyles(styles)(ObjectMetaData);\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React from \"react\";\nimport { Button } from \"@mui/material\";\nimport { Theme } from \"@mui/material/styles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport withStyles from \"@mui/styles/withStyles\";\nimport clsx from \"clsx\";\n\ntype ObjectActionButtonProps = {\n disabled?: boolean;\n onClick: () => void | any;\n icon: React.ReactNode;\n label: string;\n [x: string]: any;\n};\n\nconst styles = (theme: Theme) =>\n createStyles({\n root: {\n padding: \"0 15px\",\n height: 22,\n margin: 0,\n color: \"#5E5E5E\",\n fontWeight: \"normal\",\n fontSize: 14,\n whiteSpace: \"nowrap\",\n width: \"100%\",\n justifyContent: \"flex-start\",\n \"&:hover\": {\n backgroundColor: \"transparent\",\n color: \"#000\",\n },\n \"& .min-icon\": {\n width: 11,\n },\n \"&:disabled\": {\n color: \"#EBEBEB\",\n borderColor: \"#EBEBEB\",\n },\n },\n });\n\nconst ObjectActionButton = ({\n disabled,\n onClick,\n icon,\n label,\n classes,\n ...restProps\n}: ObjectActionButtonProps) => {\n return (\n \n {label} \n \n );\n};\n\nexport default withStyles(styles)(ObjectActionButton);\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment } from \"react\";\nimport ObjectActionButton from \"./ObjectActionButton\";\nimport { withStyles } from \"@mui/styles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport { detailsPanel } from \"../../../../Common/FormComponents/common/styleLibrary\";\n\nconst styles = () =>\n createStyles({\n ...detailsPanel,\n });\n\nexport interface MultiSelectionItem {\n action: () => void;\n label: string;\n disabled: boolean;\n icon: React.ReactNode;\n tooltip: string;\n}\n\ninterface IActionsListSectionProps {\n items: MultiSelectionItem[];\n title: string | React.ReactNode;\n classes: any;\n}\n\nconst ActionsListSection = ({\n items,\n classes,\n title,\n}: IActionsListSectionProps) => {\n return (\n \n {title}
\n \n Actions: \n {items.map((actionItem, index) => {\n return (\n \n \n \n );\n })}\n \n \n );\n};\n\nexport default withStyles(styles)(ActionsListSection);\n","import React from \"react\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport withStyles from \"@mui/styles/withStyles\";\nimport { Theme } from \"@mui/material/styles\";\n\ninterface IIconWithLabel {\n classes: any;\n icon: JSX.Element;\n strings: string[];\n}\n\nconst styles = (theme: Theme) =>\n createStyles({\n fileName: {\n display: \"flex\",\n alignItems: \"center\",\n \"& .min-icon\": {\n width: 16,\n height: 16,\n marginRight: 4,\n minWidth: 16,\n minHeight: 16,\n },\n },\n fileNameText: {\n whiteSpace: \"nowrap\",\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n },\n });\n\nconst IconWithLabel = ({ classes, icon, strings }: IIconWithLabel) => {\n return (\n \n {icon}\n \n {strings[strings.length - 1]}\n \n
\n );\n};\n\nexport default withStyles(styles)(IconWithLabel);\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React from \"react\";\n\nimport ObjectBrowserIcon from \"../../../../../../icons/ObjectBrowserIcon\";\nimport ObjectBrowserFolderIcon from \"../../../../../../icons/ObjectBrowserFolderIcon\";\nimport IconWithLabel from \"./IconWithLabel\";\n\nconst FileBookIcon = React.lazy(\n () => import(\"../../../../../../icons/FileBookIcon\")\n);\nconst FileCodeIcon = React.lazy(\n () => import(\"../../../../../../icons/FileCodeIcon\")\n);\nconst FileConfigIcon = React.lazy(\n () => import(\"../../../../../../icons/FileConfigIcon\")\n);\nconst FileDbIcon = React.lazy(\n () => import(\"../../../../../../icons/FileDbIcon\")\n);\nconst FileFontIcon = React.lazy(\n () => import(\"../../../../../../icons/FileFontIcon\")\n);\nconst FileImageIcon = React.lazy(\n () => import(\"../../../../../../icons/FileImageIcon\")\n);\nconst FileLockIcon = React.lazy(\n () => import(\"../../../../../../icons/FileLockIcon\")\n);\nconst FileMissingIcon = React.lazy(\n () => import(\"../../../../../../icons/FileMissingIcon\")\n);\nconst FileMusicIcon = React.lazy(\n () => import(\"../../../../../../icons/FileMusicIcon\")\n);\nconst FilePdfIcon = React.lazy(\n () => import(\"../../../../../../icons/FilePdfIcon\")\n);\nconst FilePptIcon = React.lazy(\n () => import(\"../../../../../../icons/FilePptIcon\")\n);\nconst FileTxtIcon = React.lazy(\n () => import(\"../../../../../../icons/FileTxtIcon\")\n);\nconst FileVideoIcon = React.lazy(\n () => import(\"../../../../../../icons/FileVideoIcon\")\n);\nconst FileXlsIcon = React.lazy(\n () => import(\"../../../../../../icons/FileXlsIcon\")\n);\nconst FileZipIcon = React.lazy(\n () => import(\"../../../../../../icons/FileZipIcon\")\n);\n\ninterface IExtToIcon {\n icon: any;\n extensions: string[];\n}\n\nexport const extensionToIcon: IExtToIcon[] = [\n {\n icon: ,\n extensions: [\"mp4\", \"mov\", \"avi\", \"mpeg\", \"mpg\"],\n },\n {\n icon: ,\n extensions: [\"mp3\", \"m4a\", \"aac\"],\n },\n {\n icon: ,\n extensions: [\"pdf\"],\n },\n {\n icon: ,\n extensions: [\"ppt\", \"pptx\"],\n },\n {\n icon: ,\n extensions: [\"xls\", \"xlsx\"],\n },\n {\n icon: ,\n extensions: [\"cer\", \"crt\", \"pem\"],\n },\n {\n icon: ,\n extensions: [\"html\", \"xml\", \"css\", \"py\", \"go\", \"php\", \"cpp\", \"h\", \"java\"],\n },\n {\n icon: ,\n extensions: [\"cfg\", \"yaml\"],\n },\n {\n icon: ,\n extensions: [\"sql\"],\n },\n {\n icon: ,\n extensions: [\"ttf\", \"otf\"],\n },\n {\n icon: ,\n extensions: [\"txt\"],\n },\n {\n icon: ,\n extensions: [\"zip\", \"rar\", \"tar\", \"gz\"],\n },\n {\n icon: ,\n extensions: [\"epub\", \"mobi\", \"azw\", \"azw3\"],\n },\n {\n icon: ,\n extensions: [\"jpeg\", \"jpg\", \"gif\", \"tiff\", \"png\", \"heic\", \"dng\"],\n },\n];\n\nexport const displayFileIconName = (\n element: string,\n returnOnlyIcon: boolean = false\n) => {\n let elementString = element;\n let icon = ;\n // Element is a folder\n if (element.endsWith(\"/\")) {\n icon = ;\n elementString = element.slice(0, -1);\n }\n\n const lowercaseElement = element.toLowerCase();\n for (const etc of extensionToIcon) {\n for (const ext of etc.extensions) {\n if (lowercaseElement.endsWith(`.${ext}`)) {\n icon = etc.icon;\n }\n }\n }\n\n if (!element.endsWith(\"/\") && element.indexOf(\".\") < 0) {\n icon = ;\n }\n\n const splitItem = elementString.split(\"/\");\n\n if (returnOnlyIcon) {\n return icon;\n }\n\n return ;\n};\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment, useState } from \"react\";\nimport get from \"lodash/get\";\nimport { useSelector } from \"react-redux\";\nimport { Box, Button, Grid } from \"@mui/material\";\nimport { Theme } from \"@mui/material/styles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport withStyles from \"@mui/styles/withStyles\";\nimport { ErrorResponseHandler } from \"../../../../../../common/types\";\nimport InputBoxWrapper from \"../../../../Common/FormComponents/InputBoxWrapper/InputBoxWrapper\";\nimport ModalWrapper from \"../../../../Common/ModalWrapper/ModalWrapper\";\nimport api from \"../../../../../../common/api\";\nimport { encodeURLString } from \"../../../../../../common/utils\";\nimport {\n formFieldStyles,\n modalStyleUtils,\n spacingUtils,\n} from \"../../../../Common/FormComponents/common/styleLibrary\";\nimport {\n AddNewTagIcon,\n DisabledIcon,\n EditTagIcon,\n} from \"../../../../../../icons\";\nimport { IFileInfo } from \"./types\";\nimport { IAM_SCOPES } from \"../../../../../../common/SecureComponent/permissions\";\nimport { SecureComponent } from \"../../../../../../common/SecureComponent\";\nimport Chip from \"@mui/material/Chip\";\nimport CloseIcon from \"@mui/icons-material/Close\";\nimport {\n selDistSet,\n setModalErrorSnackMessage,\n} from \"../../../../../../systemSlice\";\nimport { useAppDispatch } from \"../../../../../../store\";\n\ninterface ITagModal {\n modalOpen: boolean;\n bucketName: string;\n actualInfo: IFileInfo;\n onCloseAndUpdate: (refresh: boolean) => void;\n classes: any;\n}\n\nconst styles = (theme: Theme) =>\n createStyles({\n newTileHeader: {\n fontSize: 18,\n fontWeight: \"bold\",\n color: \"#000\",\n margin: \"35px 0\",\n paddingBottom: 15,\n display: \"flex\",\n alignItems: \"center\",\n \"& > svg\": {\n marginRight: 10,\n },\n },\n tagsForLabel: {\n fontSize: 16,\n margin: \"20px 0 30px\",\n whiteSpace: \"nowrap\",\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n width: \"100%\",\n },\n currentTagsContainer: {\n fontSize: 14,\n fontWeight: \"normal\",\n },\n noTagsForObject: {\n color: \"#858585\",\n },\n deleteTag: {\n color: \"#C83B51\",\n marginLeft: 5,\n },\n ...formFieldStyles,\n ...modalStyleUtils,\n ...spacingUtils,\n });\n\nconst AddTagModal = ({\n modalOpen,\n onCloseAndUpdate,\n bucketName,\n actualInfo,\n classes,\n}: ITagModal) => {\n const dispatch = useAppDispatch();\n const distributedSetup = useSelector(selDistSet);\n const [newKey, setNewKey] = useState(\"\");\n const [newLabel, setNewLabel] = useState(\"\");\n const [isSending, setIsSending] = useState(false);\n const [deleteEnabled, setDeleteEnabled] = useState(false);\n const [deleteKey, setDeleteKey] = useState(\"\");\n const [deleteLabel, setDeleteLabel] = useState(\"\");\n\n const selectedObject = encodeURLString(actualInfo.name);\n const currentTags = actualInfo.tags;\n const currTagKeys = Object.keys(currentTags || {});\n\n const allPathData = actualInfo.name.split(\"/\");\n const currentItem = allPathData.pop() || \"\";\n\n const resetForm = () => {\n setNewLabel(\"\");\n setNewKey(\"\");\n };\n\n const addTagProcess = () => {\n setIsSending(true);\n const newTag: any = {};\n\n newTag[newKey] = newLabel;\n const newTagList = { ...currentTags, ...newTag };\n\n const verID = distributedSetup ? actualInfo.version_id : \"null\";\n\n api\n .invoke(\n \"PUT\",\n `/api/v1/buckets/${bucketName}/objects/tags?prefix=${selectedObject}&version_id=${verID}`,\n { tags: newTagList }\n )\n .then((res: any) => {\n onCloseAndUpdate(true);\n setIsSending(false);\n })\n .catch((error: ErrorResponseHandler) => {\n dispatch(setModalErrorSnackMessage(error));\n setIsSending(false);\n });\n };\n\n const deleteTagProcess = () => {\n const cleanObject: any = { ...currentTags };\n delete cleanObject[deleteKey];\n\n const verID = distributedSetup ? actualInfo.version_id : \"null\";\n\n api\n .invoke(\n \"PUT\",\n `/api/v1/buckets/${bucketName}/objects/tags?prefix=${selectedObject}&version_id=${verID}`,\n { tags: cleanObject }\n )\n .then((res: any) => {\n onCloseAndUpdate(true);\n setIsSending(false);\n })\n .catch((error: ErrorResponseHandler) => {\n dispatch(setModalErrorSnackMessage(error));\n setIsSending(false);\n });\n };\n\n const onDeleteTag = (tagKey: string, tag: string) => {\n setDeleteKey(tagKey);\n setDeleteLabel(tag);\n setDeleteEnabled(true);\n };\n\n const cancelDelete = () => {\n setDeleteKey(\"\");\n setDeleteLabel(\"\");\n setDeleteEnabled(false);\n };\n\n const tagsFor = (plural: boolean) => (\n \n Tag{plural ? \"s\" : \"\"} for: {currentItem} \n
\n );\n\n return (\n \n Delete Tag\n ) : (\n `Edit Tags`\n )\n }\n onClose={() => {\n onCloseAndUpdate(true);\n }}\n titleIcon={\n deleteEnabled ? (\n \n ) : (\n \n )\n }\n >\n {deleteEnabled ? (\n \n \n {tagsFor(false)}\n Are you sure you want to delete the tag{\" \"}\n \n {deleteKey} : {deleteLabel}\n {\" \"}\n ?\n \n \n Cancel\n \n \n Delete Tag\n \n \n \n \n ) : (\n \n \n \n {tagsFor(true)}\n \n Current Tags:\n \n {currTagKeys.length === 0 ? (\n \n There are no tags for this object\n \n ) : (\n \n )}\n \n {currTagKeys.map((tagKey: string, index: number) => {\n const tag = get(currentTags, `${tagKey}`, \"\");\n if (tag !== \"\") {\n return (\n \n }\n onDelete={() => {\n onDeleteTag(tagKey, tag);\n }}\n />\n \n );\n }\n return null;\n })}\n \n
\n \n \n \n \n \n Add New Tag\n \n \n {\n setNewKey(e.target.value);\n }}\n />\n \n \n {\n setNewLabel(e.target.value);\n }}\n />\n \n \n \n Clear\n \n \n Save\n \n \n \n \n \n )}\n \n \n );\n};\n\nexport default withStyles(styles)(AddTagModal);\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { useState } from \"react\";\n\nimport withStyles from \"@mui/styles/withStyles\";\nimport {\n decodeURLString,\n deleteCookie,\n encodeURLString,\n getCookieValue,\n performDownload,\n} from \"../../../../../../common/utils\";\nimport FormSwitchWrapper from \"../../../../Common/FormComponents/FormSwitchWrapper/FormSwitchWrapper\";\nimport ModalWrapper from \"../../../../Common/ModalWrapper/ModalWrapper\";\nimport { InspectMenuIcon } from \"../../../../../../icons/SidebarMenus\";\nimport Button from \"@mui/material/Button\";\nimport Grid from \"@mui/material/Grid\";\nimport { Theme } from \"@mui/material/styles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport {\n formFieldStyles,\n modalStyleUtils,\n spacingUtils,\n} from \"../../../../Common/FormComponents/common/styleLibrary\";\nimport { PasswordKeyIcon } from \"../../../../../../icons\";\nimport { Box, DialogContentText } from \"@mui/material\";\nimport KeyRevealer from \"../../../../Tools/KeyRevealer\";\nimport { setErrorSnackMessage } from \"../../../../../../systemSlice\";\nimport { useAppDispatch } from \"../../../../../../store\";\n\nconst styles = (theme: Theme) =>\n createStyles({\n ...formFieldStyles,\n ...modalStyleUtils,\n ...spacingUtils,\n });\n\ninterface IInspectObjectProps {\n classes: any;\n closeInspectModalAndRefresh: (refresh: boolean) => void;\n inspectOpen: boolean;\n inspectPath: string;\n volumeName: string;\n}\n\nconst InspectObject = ({\n classes,\n closeInspectModalAndRefresh,\n inspectOpen,\n inspectPath,\n volumeName,\n}: IInspectObjectProps) => {\n const dispatch = useAppDispatch();\n const onClose = () => closeInspectModalAndRefresh(false);\n const [isEncrypt, setIsEncrypt] = useState(true);\n const [decryptionKey, setDecryptionKey] = useState(\"\");\n const [insFileName, setInsFileName] = useState(\"\");\n\n if (!inspectPath) {\n return null;\n }\n const makeRequest = async (url: string) => {\n return await fetch(url, { method: \"GET\" });\n };\n\n const performInspect = async () => {\n const file = encodeURLString(inspectPath + \"/xl.meta\");\n const volume = encodeURLString(volumeName);\n\n const urlOfInspectApi = `/api/v1/admin/inspect?volume=${volume}&file=${file}&encrypt=${isEncrypt}`;\n\n makeRequest(urlOfInspectApi)\n .then(async (res) => {\n if (!res.ok) {\n const resErr: any = await res.json();\n\n dispatch(\n setErrorSnackMessage({\n errorMessage: resErr.message,\n detailedError: resErr.code,\n })\n );\n }\n const blob: Blob = await res.blob();\n\n //@ts-ignore\n const filename = res.headers.get(\"content-disposition\").split('\"')[1];\n const decryptKey = getCookieValue(filename) || \"\";\n\n performDownload(blob, filename);\n setInsFileName(filename);\n if (decryptKey === \"\") {\n onClose();\n return;\n }\n setDecryptionKey(decryptKey);\n })\n .catch((err) => {\n dispatch(setErrorSnackMessage(err));\n });\n };\n\n const onCloseDecKeyModal = () => {\n deleteCookie(insFileName);\n onClose();\n setDecryptionKey(\"\");\n };\n\n const onSubmit = (e: React.FormEvent) => {\n e.preventDefault();\n };\n\n return (\n \n {!decryptionKey && (\n }\n title={`Inspect Object`}\n onClose={onClose}\n >\n \n \n )}\n {decryptionKey ? (\n }\n >\n \n \n This will be displayed only once. It cannot be recovered.\n \n Use secure medium to share this key.\n \n \n \n \n \n \n ) : null}\n \n );\n};\n\nexport default withStyles(styles)(InspectObject);\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { useState } from \"react\";\nimport Grid from \"@mui/material/Grid\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport { Button } from \"@mui/material\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport { Theme } from \"@mui/material/styles\";\nimport { EditIcon } from \"../../../icons\";\nimport {\n containerForHeader,\n formFieldStyles,\n modalStyleUtils,\n spacingUtils,\n} from \"../Common/FormComponents/common/styleLibrary\";\nimport { IFileInfo } from \"../Buckets/ListBuckets/Objects/ObjectDetails/types\";\nimport { encodeURLString } from \"../../../common/utils\";\nimport { download } from \"../Buckets/ListBuckets/Objects/utils\";\nimport {\n cancelObjectInList,\n completeObject,\n failObject,\n setNewObject,\n updateProgress,\n} from \"./objectBrowserSlice\";\nimport { makeid, storeCallForObjectWithID } from \"./transferManager\";\nimport { useAppDispatch } from \"../../../store\";\nimport ModalWrapper from \"../Common/ModalWrapper/ModalWrapper\";\nimport InputBoxWrapper from \"../Common/FormComponents/InputBoxWrapper/InputBoxWrapper\";\nimport FormSwitchWrapper from \"../Common/FormComponents/FormSwitchWrapper/FormSwitchWrapper\";\n\ninterface IRenameLongFilename {\n open: boolean;\n bucketName: string;\n internalPaths: string;\n currentItem: string;\n actualInfo: IFileInfo;\n closeModal: () => void;\n}\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n ...modalStyleUtils,\n ...formFieldStyles,\n ...spacingUtils,\n ...containerForHeader(theme.spacing(4)),\n })\n);\n\nconst RenameLongFileName = ({\n open,\n closeModal,\n currentItem,\n internalPaths,\n actualInfo,\n bucketName,\n}: IRenameLongFilename) => {\n const classes = useStyles();\n const dispatch = useAppDispatch();\n\n const [newFileName, setNewFileName] = useState(currentItem);\n const [acceptLongName, setAcceptLongName] = useState(false);\n\n const doDownload = (e: React.FormEvent) => {\n e.preventDefault();\n\n const identityDownload = encodeURLString(\n `${bucketName}-${\n actualInfo.name\n }-${new Date().getTime()}-${Math.random()}`\n );\n\n const downloadCall = download(\n bucketName,\n internalPaths,\n actualInfo.version_id,\n parseInt(actualInfo.size || \"0\"),\n newFileName,\n (progress) => {\n dispatch(\n updateProgress({\n instanceID: identityDownload,\n progress: progress,\n })\n );\n },\n () => {\n dispatch(completeObject(identityDownload));\n },\n (msg: string) => {\n dispatch(failObject({ instanceID: identityDownload, msg }));\n },\n () => {\n dispatch(cancelObjectInList(identityDownload));\n }\n );\n const ID = makeid(8);\n storeCallForObjectWithID(ID, downloadCall);\n dispatch(\n setNewObject({\n ID,\n bucketName,\n done: false,\n instanceID: identityDownload,\n percentage: 0,\n prefix: newFileName,\n type: \"download\",\n waitingForFile: true,\n failed: false,\n cancelled: false,\n errorMessage: \"\",\n })\n );\n\n downloadCall.send();\n closeModal();\n };\n\n return (\n }\n >\n \n The file you are trying to download has a long name.\n \n This can cause issues on Windows Systems by trimming the file name after\n download.\n \n We recommend to rename the file download\n
\n \n \n );\n};\n\nexport default RenameLongFileName;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment, useEffect, useState } from \"react\";\nimport { useSelector } from \"react-redux\";\nimport { Box, Button } from \"@mui/material\";\nimport { withStyles } from \"@mui/styles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport get from \"lodash/get\";\nimport Grid from \"@mui/material/Grid\";\nimport {\n actionsTray,\n buttonsStyles,\n detailsPanel,\n spacingUtils,\n textStyleUtils,\n} from \"../../../../Common/FormComponents/common/styleLibrary\";\nimport { IFileInfo } from \"../ObjectDetails/types\";\nimport { download, extensionPreview } from \"../utils\";\nimport { ErrorResponseHandler } from \"../../../../../../common/types\";\n\nimport {\n decodeURLString,\n encodeURLString,\n getClientOS,\n niceBytes,\n niceBytesInt,\n niceDaysInt,\n} from \"../../../../../../common/utils\";\nimport { IAM_SCOPES } from \"../../../../../../common/SecureComponent/permissions\";\n\nimport { AppState, useAppDispatch } from \"../../../../../../store\";\nimport {\n DeleteIcon,\n DownloadIcon,\n LegalHoldIcon,\n MetadataIcon,\n ObjectInfoIcon,\n PreviewIcon,\n RetentionIcon,\n ShareIcon,\n TagsIcon,\n VersionsIcon,\n} from \"../../../../../../icons\";\nimport { InspectMenuIcon } from \"../../../../../../icons/SidebarMenus\";\nimport api from \"../../../../../../common/api\";\nimport ShareFile from \"../ObjectDetails/ShareFile\";\nimport SetRetention from \"../ObjectDetails/SetRetention\";\nimport DeleteObject from \"../ListObjects/DeleteObject\";\nimport SetLegalHoldModal from \"../ObjectDetails/SetLegalHoldModal\";\nimport {\n hasPermission,\n SecureComponent,\n} from \"../../../../../../common/SecureComponent\";\nimport PreviewFileModal from \"../Preview/PreviewFileModal\";\nimport ObjectMetaData from \"../ObjectDetails/ObjectMetaData\";\nimport ActionsListSection from \"./ActionsListSection\";\nimport { displayFileIconName } from \"./utils\";\nimport TagsModal from \"../ObjectDetails/TagsModal\";\nimport InspectObject from \"./InspectObject\";\nimport Loader from \"../../../../Common/Loader/Loader\";\nimport { selDistSet } from \"../../../../../../systemSlice\";\nimport {\n makeid,\n storeCallForObjectWithID,\n} from \"../../../../ObjectBrowser/transferManager\";\nimport {\n cancelObjectInList,\n completeObject,\n failObject,\n setLoadingObjectInfo,\n setLoadingVersions,\n setNewObject,\n setSelectedVersion,\n setVersionsModeEnabled,\n updateProgress,\n} from \"../../../../ObjectBrowser/objectBrowserSlice\";\nimport RenameLongFileName from \"../../../../ObjectBrowser/RenameLongFilename\";\n\nconst styles = () =>\n createStyles({\n ObjectDetailsTitle: {\n display: \"flex\",\n alignItems: \"center\",\n \"& .min-icon\": {\n width: 26,\n height: 26,\n minWidth: 26,\n minHeight: 26,\n },\n },\n objectNameContainer: {\n whiteSpace: \"nowrap\",\n textOverflow: \"ellipsis\",\n overflow: \"hidden\",\n alignItems: \"center\",\n marginLeft: 10,\n },\n headerForSection: {\n display: \"flex\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n paddingBottom: 15,\n borderBottom: \"#E2E2E2 2px solid\",\n fontWeight: \"bold\",\n fontSize: 18,\n color: \"#000\",\n margin: \"20px 22px\",\n },\n capitalizeFirst: {\n textTransform: \"capitalize\",\n },\n ...buttonsStyles,\n ...actionsTray,\n ...spacingUtils,\n ...textStyleUtils,\n ...detailsPanel,\n });\n\nconst emptyFile: IFileInfo = {\n is_latest: true,\n last_modified: \"\",\n legal_hold_status: \"\",\n name: \"\",\n retention_mode: \"\",\n retention_until_date: \"\",\n size: \"0\",\n tags: {},\n version_id: null,\n};\n\ninterface IObjectDetailPanelProps {\n classes: any;\n internalPaths: string;\n bucketName: string;\n versioning: boolean;\n locking: boolean;\n onClosePanel: (hardRefresh: boolean) => void;\n}\n\nconst ObjectDetailPanel = ({\n classes,\n internalPaths,\n bucketName,\n versioning,\n locking,\n onClosePanel,\n}: IObjectDetailPanelProps) => {\n const dispatch = useAppDispatch();\n\n const distributedSetup = useSelector(selDistSet);\n const versionsMode = useSelector(\n (state: AppState) => state.objectBrowser.versionsMode\n );\n const selectedVersion = useSelector(\n (state: AppState) => state.objectBrowser.selectedVersion\n );\n const loadingObjectInfo = useSelector(\n (state: AppState) => state.objectBrowser.loadingObjectInfo\n );\n\n const [shareFileModalOpen, setShareFileModalOpen] = useState(false);\n const [retentionModalOpen, setRetentionModalOpen] = useState(false);\n const [tagModalOpen, setTagModalOpen] = useState(false);\n const [legalholdOpen, setLegalholdOpen] = useState(false);\n const [inspectModalOpen, setInspectModalOpen] = useState(false);\n const [actualInfo, setActualInfo] = useState(null);\n const [allInfoElements, setAllInfoElements] = useState([]);\n const [objectToShare, setObjectToShare] = useState(null);\n const [versions, setVersions] = useState([]);\n const [deleteOpen, setDeleteOpen] = useState(false);\n const [previewOpen, setPreviewOpen] = useState(false);\n const [totalVersionsSize, setTotalVersionsSize] = useState(0);\n const [longFileOpen, setLongFileOpen] = useState(false);\n\n const internalPathsDecoded = decodeURLString(internalPaths) || \"\";\n const allPathData = internalPathsDecoded.split(\"/\");\n const currentItem = allPathData.pop() || \"\";\n\n // calculate object name to display\n let objectNameArray: string[] = [];\n if (actualInfo) {\n objectNameArray = actualInfo.name.split(\"/\");\n }\n\n useEffect(() => {\n if (distributedSetup && allInfoElements && allInfoElements.length >= 1) {\n let infoElement =\n allInfoElements.find((el: IFileInfo) => el.is_latest) || emptyFile;\n\n if (selectedVersion !== \"\") {\n infoElement =\n allInfoElements.find(\n (el: IFileInfo) => el.version_id === selectedVersion\n ) || emptyFile;\n }\n\n setActualInfo(infoElement);\n }\n }, [selectedVersion, distributedSetup, allInfoElements]);\n\n useEffect(() => {\n if (loadingObjectInfo && internalPaths !== \"\") {\n api\n .invoke(\n \"GET\",\n `/api/v1/buckets/${bucketName}/objects?prefix=${internalPaths}${\n distributedSetup ? \"&with_versions=true\" : \"\"\n }`\n )\n .then((res: IFileInfo[]) => {\n const result = get(res, \"objects\", []);\n if (distributedSetup) {\n setAllInfoElements(result);\n setVersions(result);\n const tVersionSize = result.reduce(\n (acc: number, currValue: IFileInfo) => {\n if (currValue?.size) {\n return acc + currValue.size;\n }\n return acc;\n },\n 0\n );\n\n setTotalVersionsSize(tVersionSize);\n } else {\n setActualInfo(result[0]);\n setVersions([]);\n }\n\n dispatch(setLoadingObjectInfo(false));\n })\n .catch((error: ErrorResponseHandler) => {\n console.error(\"Error loading object details\", error);\n dispatch(setLoadingObjectInfo(false));\n });\n }\n }, [\n loadingObjectInfo,\n bucketName,\n internalPaths,\n dispatch,\n distributedSetup,\n selectedVersion,\n ]);\n\n let tagKeys: string[] = [];\n\n if (actualInfo && actualInfo.tags) {\n tagKeys = Object.keys(actualInfo.tags);\n }\n\n const openRetentionModal = () => {\n setRetentionModalOpen(true);\n };\n\n const closeRetentionModal = (updateInfo: boolean) => {\n setRetentionModalOpen(false);\n if (updateInfo) {\n dispatch(setLoadingObjectInfo(true));\n }\n };\n\n const shareObject = () => {\n setShareFileModalOpen(true);\n };\n\n const closeShareModal = () => {\n setObjectToShare(null);\n setShareFileModalOpen(false);\n };\n\n const closeFileOpen = () => {\n setLongFileOpen(false);\n };\n\n const downloadObject = (object: IFileInfo) => {\n const identityDownload = encodeURLString(\n `${bucketName}-${object.name}-${new Date().getTime()}-${Math.random()}`\n );\n\n if (\n object.name.length > 200 &&\n getClientOS().toLowerCase().includes(\"win\")\n ) {\n setLongFileOpen(true);\n return;\n }\n\n const downloadCall = download(\n bucketName,\n internalPaths,\n object.version_id,\n parseInt(object.size || \"0\"),\n null,\n (progress) => {\n dispatch(\n updateProgress({\n instanceID: identityDownload,\n progress: progress,\n })\n );\n },\n () => {\n dispatch(completeObject(identityDownload));\n },\n (msg: string) => {\n dispatch(failObject({ instanceID: identityDownload, msg }));\n },\n () => {\n dispatch(cancelObjectInList(identityDownload));\n }\n );\n const ID = makeid(8);\n storeCallForObjectWithID(ID, downloadCall);\n dispatch(\n setNewObject({\n ID,\n bucketName,\n done: false,\n instanceID: identityDownload,\n percentage: 0,\n prefix: object.name,\n type: \"download\",\n waitingForFile: true,\n failed: false,\n cancelled: false,\n errorMessage: \"\",\n })\n );\n\n downloadCall.send();\n };\n\n const closeDeleteModal = (closeAndReload: boolean) => {\n setDeleteOpen(false);\n\n if (closeAndReload && selectedVersion === \"\") {\n onClosePanel(true);\n } else {\n dispatch(setLoadingVersions(true));\n dispatch(setSelectedVersion(\"\"));\n dispatch(setLoadingObjectInfo(true));\n }\n };\n\n const closeAddTagModal = (reloadObjectData: boolean) => {\n setTagModalOpen(false);\n if (reloadObjectData) {\n dispatch(setLoadingObjectInfo(true));\n }\n };\n\n const closeInspectModal = (reloadObjectData: boolean) => {\n setInspectModalOpen(false);\n if (reloadObjectData) {\n dispatch(setLoadingObjectInfo(true));\n }\n };\n\n const closeLegalholdModal = (reload: boolean) => {\n setLegalholdOpen(false);\n if (reload) {\n dispatch(setLoadingObjectInfo(true));\n }\n };\n\n const loaderForContainer = (\n \n \n
\n );\n\n if (!actualInfo) {\n if (loadingObjectInfo) {\n return loaderForContainer;\n }\n\n return null;\n }\n\n const objectName =\n objectNameArray.length > 0\n ? objectNameArray[objectNameArray.length - 1]\n : actualInfo.name;\n\n const objectResources = [\n bucketName,\n currentItem,\n [bucketName, actualInfo.name].join(\"/\"),\n ];\n\n const multiActionButtons = [\n {\n action: () => {\n downloadObject(actualInfo);\n },\n label: \"Download\",\n disabled:\n !!actualInfo.is_delete_marker ||\n !hasPermission(objectResources, [IAM_SCOPES.S3_GET_OBJECT]),\n icon: ,\n tooltip: \"Download this Object\",\n },\n {\n action: () => {\n shareObject();\n },\n label: \"Share\",\n disabled:\n !!actualInfo.is_delete_marker ||\n !hasPermission(objectResources, [IAM_SCOPES.S3_GET_OBJECT]),\n icon: ,\n tooltip: \"Share this File\",\n },\n {\n action: () => {\n setPreviewOpen(true);\n },\n label: \"Preview\",\n disabled:\n !!actualInfo.is_delete_marker ||\n extensionPreview(currentItem) === \"none\" ||\n !hasPermission(objectResources, [IAM_SCOPES.S3_GET_OBJECT]),\n icon: ,\n tooltip: \"Preview this File\",\n },\n {\n action: () => {\n setLegalholdOpen(true);\n },\n label: \"Legal Hold\",\n disabled:\n !locking ||\n !distributedSetup ||\n !!actualInfo.is_delete_marker ||\n !hasPermission(bucketName, [IAM_SCOPES.S3_PUT_OBJECT_LEGAL_HOLD]) ||\n selectedVersion !== \"\",\n icon: ,\n tooltip: \"Change Legal Hold rules for this File\",\n },\n {\n action: openRetentionModal,\n label: \"Retention\",\n disabled:\n !distributedSetup ||\n !!actualInfo.is_delete_marker ||\n !hasPermission(objectResources, [IAM_SCOPES.S3_GET_OBJECT_RETENTION]) ||\n selectedVersion !== \"\",\n icon: ,\n tooltip: \"Change Retention rules for this File\",\n },\n {\n action: () => {\n setTagModalOpen(true);\n },\n label: \"Tags\",\n disabled:\n !!actualInfo.is_delete_marker ||\n selectedVersion !== \"\" ||\n !hasPermission(objectResources, [IAM_SCOPES.S3_PUT_OBJECT_TAGGING]),\n icon: ,\n tooltip: \"Change Tags for this File\",\n },\n {\n action: () => {\n setInspectModalOpen(true);\n },\n label: \"Inspect\",\n disabled:\n !distributedSetup ||\n !!actualInfo.is_delete_marker ||\n selectedVersion !== \"\" ||\n !hasPermission(objectResources, [IAM_SCOPES.ADMIN_INSPECT_DATA]),\n icon: ,\n tooltip: \"Inspect this file\",\n },\n {\n action: () => {\n dispatch(\n setVersionsModeEnabled({\n status: !versionsMode,\n objectName: objectName,\n })\n );\n },\n label: versionsMode ? \"Hide Object Versions\" : \"Display Object Versions\",\n icon: ,\n disabled:\n !distributedSetup ||\n !(actualInfo.version_id && actualInfo.version_id !== \"null\") ||\n !hasPermission(objectResources, [\n IAM_SCOPES.S3_GET_BUCKET_VERSIONING,\n IAM_SCOPES.S3_PUT_BUCKET_VERSIONING,\n IAM_SCOPES.S3_GET_OBJECT_VERSION,\n ]),\n tooltip: \"Display Versions for this file\",\n },\n ];\n\n const calculateLastModifyTime = (lastModified: string) => {\n const currentTime = new Date();\n const modifiedTime = new Date(lastModified);\n\n const difTime = currentTime.getTime() - modifiedTime.getTime();\n\n const formatTime = niceDaysInt(difTime, \"ms\");\n\n return formatTime.trim() !== \"\" ? `${formatTime} ago` : \"Just now\";\n };\n\n return (\n \n {shareFileModalOpen && actualInfo && (\n \n )}\n {retentionModalOpen && actualInfo && (\n \n )}\n {deleteOpen && (\n \n )}\n {legalholdOpen && actualInfo && (\n \n )}\n {previewOpen && actualInfo && (\n {\n setPreviewOpen(false);\n }}\n />\n )}\n {tagModalOpen && actualInfo && (\n \n )}\n {inspectModalOpen && actualInfo && (\n \n )}\n {longFileOpen && actualInfo && (\n \n )}\n\n {loadingObjectInfo ? (\n {loaderForContainer} \n ) : (\n \n \n {displayFileIconName(objectName, true)}\n \n {objectName}\n \n \n }\n items={multiActionButtons}\n />\n\n \n \n }\n color=\"secondary\"\n variant={\"outlined\"}\n onClick={() => {\n setDeleteOpen(true);\n }}\n disabled={selectedVersion === \"\" && actualInfo.is_delete_marker}\n sx={{\n width: \"calc(100% - 44px)\",\n margin: \"8px 0\",\n \"& svg.min-icon\": {\n width: 14,\n height: 14,\n },\n }}\n >\n Delete{selectedVersion !== \"\" ? \" version\" : \"\"}\n \n \n \n \n Object Info \n \n \n \n Name: \n \n {objectName}
\n \n {selectedVersion !== \"\" && (\n \n Version ID: \n \n {selectedVersion}\n \n )}\n \n Size: \n \n {niceBytes(actualInfo.size || \"0\")}\n \n {actualInfo.version_id &&\n actualInfo.version_id !== \"null\" &&\n selectedVersion === \"\" && (\n \n Versions: \n \n {versions.length} version{versions.length !== 1 ? \"s\" : \"\"},{\" \"}\n {niceBytesInt(totalVersionsSize)}\n \n )}\n {selectedVersion === \"\" && (\n \n Last Modified: \n \n {calculateLastModifyTime(actualInfo.last_modified)}\n \n )}\n \n ETAG: \n \n {actualInfo.etag || \"N/A\"}\n \n \n Tags: \n \n {tagKeys.length === 0\n ? \"N/A\"\n : tagKeys.map((tagKey, index) => {\n return (\n \n {tagKey}:{get(actualInfo, `tags.${tagKey}`, \"\")}\n {index < tagKeys.length - 1 ? \", \" : \"\"}\n \n );\n })}\n \n \n \n \n Legal Hold: \n \n {actualInfo.legal_hold_status ? \"On\" : \"Off\"}\n \n \n \n \n \n \n Retention Policy: \n \n \n {actualInfo.version_id && actualInfo.version_id !== \"null\" ? (\n \n {actualInfo.retention_mode\n ? actualInfo.retention_mode.toLowerCase()\n : \"None\"}\n \n ) : (\n \n {actualInfo.retention_mode\n ? actualInfo.retention_mode.toLowerCase()\n : \"None\"}\n \n )}\n \n \n \n \n \n Metadata \n \n \n \n {actualInfo ? (\n \n ) : null}\n \n \n )}\n \n );\n};\n\nexport default withStyles(styles)(ObjectDetailPanel);\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React from \"react\";\nimport * as reactMoment from \"react-moment\";\nimport { BucketObjectItem } from \"./types\";\nimport { niceBytes } from \"../../../../../../common/utils\";\nimport { displayFileIconName } from \"./utils\";\n\n// Functions\n\nexport const displayParsedDate = (object: BucketObjectItem) => {\n if (object.name.endsWith(\"/\")) {\n return \"\";\n }\n return {object.last_modified} ;\n};\n\nexport const displayNiceBytes = (object: BucketObjectItem) => {\n if (object.name.endsWith(\"/\") || !object.size) {\n return \"-\";\n }\n return niceBytes(String(object.size));\n};\n\nexport const displayDeleteFlag = (state: boolean) => {\n return state ? \"Yes\" : \"No\";\n};\n\n// Table Props\n\nexport const listModeColumns = [\n {\n label: \"Name\",\n elementKey: \"name\",\n renderFunction: displayFileIconName,\n enableSort: true,\n },\n {\n label: \"Last Modified\",\n elementKey: \"last_modified\",\n renderFunction: displayParsedDate,\n renderFullObject: true,\n enableSort: true,\n },\n {\n label: \"Size\",\n elementKey: \"size\",\n renderFunction: displayNiceBytes,\n renderFullObject: true,\n width: 100,\n contentTextAlign: \"center\",\n enableSort: true,\n },\n];\n\nexport const rewindModeColumns = [\n {\n label: \"Name\",\n elementKey: \"name\",\n renderFunction: displayFileIconName,\n enableSort: true,\n },\n {\n label: \"Object Date\",\n elementKey: \"last_modified\",\n renderFunction: displayParsedDate,\n renderFullObject: true,\n enableSort: true,\n },\n {\n label: \"Size\",\n elementKey: \"size\",\n renderFunction: displayNiceBytes,\n renderFullObject: true,\n width: 100,\n contentTextAlign: \"center\",\n enableSort: true,\n },\n {\n label: \"Deleted\",\n elementKey: \"delete_flag\",\n renderFunction: displayDeleteFlag,\n width: 60,\n contentTextAlign: \"center\",\n },\n];\n","// This file is part of MinIO Console Server\n// Copyright (c) 2021 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { useState } from \"react\";\nimport { DialogContentText } from \"@mui/material\";\nimport { Theme } from \"@mui/material/styles\";\n\nimport createStyles from \"@mui/styles/createStyles\";\nimport withStyles from \"@mui/styles/withStyles\";\nimport { modalBasic } from \"../../../../Common/FormComponents/common/styleLibrary\";\n\nimport { ErrorResponseHandler } from \"../../../../../../common/types\";\nimport { encodeURLString } from \"../../../../../../common/utils\";\nimport api from \"../../../../../../common/api\";\nimport ConfirmDialog from \"../../../../Common/ModalWrapper/ConfirmDialog\";\nimport RecoverIcon from \"../../../../../../icons/RecoverIcon\";\nimport { setErrorSnackMessage } from \"../../../../../../systemSlice\";\nimport { useAppDispatch } from \"../../../../../../store\";\n\ninterface IRestoreFileVersion {\n classes: any;\n restoreOpen: boolean;\n bucketName: string;\n versionID: string;\n objectPath: string;\n onCloseAndUpdate: (refresh: boolean) => void;\n}\n\nconst styles = (theme: Theme) =>\n createStyles({\n ...modalBasic,\n });\n\nconst RestoreFileVersion = ({\n classes,\n versionID,\n bucketName,\n objectPath,\n restoreOpen,\n onCloseAndUpdate,\n}: IRestoreFileVersion) => {\n const dispatch = useAppDispatch();\n const [restoreLoading, setRestoreLoading] = useState(false);\n\n const restoreVersion = () => {\n setRestoreLoading(true);\n\n api\n .invoke(\n \"PUT\",\n `/api/v1/buckets/${bucketName}/objects/restore?prefix=${encodeURLString(\n objectPath\n )}&version_id=${versionID}`\n )\n .then((res: any) => {\n setRestoreLoading(false);\n onCloseAndUpdate(true);\n })\n .catch((error: ErrorResponseHandler) => {\n dispatch(setErrorSnackMessage(error));\n setRestoreLoading(false);\n });\n };\n\n return (\n }\n onConfirm={restoreVersion}\n confirmButtonProps={{\n color: \"secondary\",\n variant: \"outlined\",\n disabled: restoreLoading,\n }}\n onClose={() => {\n onCloseAndUpdate(false);\n }}\n confirmationContent={\n \n Are you sure you want to restore \n {objectPath} with Version ID:\n \n {versionID} ?\n \n }\n />\n );\n};\n\nexport default withStyles(styles)(RestoreFileVersion);\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React from \"react\";\n\ninterface ISpecificVersionPillProps {\n type: \"null\" | \"current\" | \"deleted\";\n}\n\nconst SpecificVersionPill = ({ type }: ISpecificVersionPillProps) => {\n let bgColor = \"#000\";\n let message = \"\";\n\n switch (type) {\n case \"null\":\n bgColor = \"#07193E\";\n message = \"NULL VERSION\";\n break;\n case \"deleted\":\n bgColor = \"#868686\";\n message = \"DELETED\";\n break;\n default:\n bgColor = \"#174551\";\n message = \"CURRENT VERSION\";\n }\n\n return (\n \n {message}\n \n );\n};\n\nexport default SpecificVersionPill;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React from \"react\";\nimport * as reactMoment from \"react-moment\";\nimport Grid from \"@mui/material/Grid\";\nimport { Theme } from \"@mui/material/styles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport { withStyles } from \"@mui/styles\";\nimport { displayFileIconName } from \"../ListObjects/utils\";\nimport { IFileInfo } from \"./types\";\nimport { IconButton, Tooltip } from \"@mui/material\";\nimport {\n DownloadIcon,\n PreviewIcon,\n RecoverIcon,\n ShareIcon,\n} from \"../../../../../../icons\";\nimport { niceBytes } from \"../../../../../../common/utils\";\nimport SpecificVersionPill from \"./SpecificVersionPill\";\nimport CheckboxWrapper from \"../../../../Common/FormComponents/CheckboxWrapper/CheckboxWrapper\";\n\ninterface IFileVersionItem {\n fileName: string;\n versionInfo: IFileInfo;\n index: number;\n isSelected?: boolean;\n checkable: boolean;\n isChecked: boolean;\n onCheck: (versionID: string) => void;\n onShare: (versionInfo: IFileInfo) => void;\n onDownload: (versionInfo: IFileInfo) => void;\n onRestore: (versionInfo: IFileInfo) => void;\n onPreview: (versionInfo: IFileInfo) => void;\n globalClick: (versionInfo: IFileInfo) => void;\n classes: any;\n key: any;\n style: any;\n}\n\nconst styles = (theme: Theme) =>\n createStyles({\n mainFileVersionItem: {\n borderBottom: \"#E2E2E2 1px solid\",\n padding: \"1rem 0\",\n margin: \"0 0.5rem 0 2.5rem\",\n cursor: \"pointer\",\n \"&.deleted\": {\n color: \"#868686\",\n },\n \"@media (max-width: 799px)\": {\n padding: \"5px 0px\",\n margin: 0,\n },\n },\n intermediateLayer: {\n margin: \"0 1.5rem 0 1.5rem\",\n \"&:hover, &.selected\": {\n backgroundColor: \"#F8F8F8\",\n \"& > div\": {\n borderBottomColor: \"#F8F8F8\",\n },\n },\n \"@media (max-width: 799px)\": {\n margin: 0,\n \"&:hover, &.selected\": {\n backgroundColor: \"transparent\",\n \"& > div\": {\n borderBottomColor: \"#E2E2E2\",\n },\n },\n },\n },\n versionContainer: {\n fontSize: 16,\n fontWeight: \"bold\",\n display: \"flex\",\n alignItems: \"center\",\n \"& svg.min-icon\": {\n width: 18,\n height: 18,\n minWidth: 18,\n minHeight: 18,\n marginRight: 10,\n },\n \"@media (max-width: 799px)\": {\n fontSize: 14,\n \"& svg.min-icon\": {\n display: \"none\",\n },\n },\n },\n buttonContainer: {\n textAlign: \"right\",\n \"& button\": {\n marginLeft: \"1.5rem\",\n },\n \"@media (max-width: 600px)\": {\n \"& button\": {\n marginLeft: \"5px\",\n },\n },\n },\n versionID: {\n fontSize: \"12px\",\n margin: \"2px 0\",\n whiteSpace: \"nowrap\",\n textOverflow: \"ellipsis\",\n maxWidth: \"95%\",\n overflow: \"hidden\",\n },\n versionData: {\n marginRight: \"10px\",\n fontSize: 12,\n color: \"#868686\",\n \"@media (max-width: 799px)\": {\n textOverflow: \"ellipsis\",\n maxWidth: \"95%\",\n overflow: \"hidden\",\n whiteSpace: \"nowrap\",\n },\n },\n ctrItem: {\n position: \"relative\",\n \"&::before\": {\n content: \"' '\",\n display: \"block\",\n position: \"absolute\",\n width: \"2px\",\n height: \"calc(100% + 2px)\",\n backgroundColor: \"#F8F8F8\",\n left: \"24px\",\n },\n \"@media (max-width: 799px)\": {\n \"&::before\": {\n display: \"none\",\n },\n },\n },\n collapsableInfo: {\n \"@media (max-width: 799px)\": {\n display: \"flex\",\n flexDirection: \"column\",\n },\n },\n versionItem: {\n \"@media (max-width: 799px)\": {\n display: \"none\",\n },\n },\n });\n\nconst FileVersionItem = ({\n classes,\n fileName,\n versionInfo,\n isSelected,\n checkable,\n isChecked,\n onCheck,\n onShare,\n onDownload,\n onRestore,\n onPreview,\n globalClick,\n index,\n key,\n style,\n}: IFileVersionItem) => {\n const disableButtons = versionInfo.is_delete_marker;\n\n const versionItemButtons = [\n {\n icon: ,\n action: onPreview,\n tooltip: \"Preview\",\n },\n {\n icon: ,\n action: onDownload,\n tooltip: \"Download this version\",\n },\n {\n icon: ,\n action: onShare,\n tooltip: \"Share this version\",\n },\n {\n icon: ,\n action: onRestore,\n tooltip: \"Restore this version\",\n },\n ];\n\n let pill: \"deleted\" | \"current\" | \"null\" | null = null;\n\n if (versionInfo.is_delete_marker) {\n pill = \"deleted\";\n } else if (versionInfo.is_latest) {\n pill = \"current\";\n } else if (versionInfo.version_id === \"null\") {\n pill = \"null\";\n }\n\n return (\n {\n globalClick(versionInfo);\n }}\n key={key}\n style={style}\n >\n \n \n \n \n \n {checkable && (\n {\n e.stopPropagation();\n e.preventDefault();\n onCheck(versionInfo.version_id || \"\");\n }}\n value={versionInfo.version_id || \"\"}\n disabled={versionInfo.is_delete_marker}\n overrideCheckboxStyles={{\n paddingLeft: 0,\n height: 34,\n width: 25,\n }}\n noTopMargin\n />\n )}\n {displayFileIconName(fileName, true)} v{index.toString()}\n \n {pill && }\n \n \n \n {versionItemButtons.map((button, index) => {\n return (\n \n {\n e.stopPropagation();\n if (!disableButtons) {\n button.action(versionInfo);\n } else {\n e.preventDefault();\n }\n }}\n sx={{\n backgroundColor: \"#F8F8F8\",\n borderRadius: \"100%\",\n width: \"28px\",\n height: \"28px\",\n padding: \"5px\",\n \"& .min-icon\": {\n width: \"14px\",\n height: \"14px\",\n },\n }}\n >\n {button.icon}\n \n \n );\n })}\n \n \n \n \n {versionInfo.version_id !== \"null\" ? versionInfo.version_id : \"-\"}\n \n \n \n Last modified: {\" \"}\n \n {versionInfo.last_modified}\n \n \n \n Size: {niceBytes(versionInfo.size || \"0\")}\n \n \n \n \n \n );\n};\n\nexport default withStyles(styles)(FileVersionItem);\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { useEffect, useState } from \"react\";\n\nimport { DialogContentText } from \"@mui/material\";\nimport Grid from \"@mui/material/Grid\";\nimport { ErrorResponseHandler } from \"../../../../../../common/types\";\nimport { decodeURLString } from \"../../../../../../common/utils\";\nimport { ConfirmDeleteIcon } from \"../../../../../../icons\";\nimport ConfirmDialog from \"../../../../Common/ModalWrapper/ConfirmDialog\";\nimport api from \"../../../../../../common/api\";\nimport InputBoxWrapper from \"../../../../Common/FormComponents/InputBoxWrapper/InputBoxWrapper\";\nimport { setErrorSnackMessage } from \"../../../../../../systemSlice\";\nimport { useAppDispatch } from \"../../../../../../store\";\n\ninterface IDeleteNonCurrentProps {\n closeDeleteModalAndRefresh: (refresh: boolean) => void;\n deleteOpen: boolean;\n selectedObject: string;\n selectedBucket: string;\n}\n\nconst DeleteNonCurrentVersions = ({\n closeDeleteModalAndRefresh,\n deleteOpen,\n selectedBucket,\n selectedObject,\n}: IDeleteNonCurrentProps) => {\n const dispatch = useAppDispatch();\n const [deleteLoading, setDeleteLoading] = useState(false);\n const [typeConfirm, setTypeConfirm] = useState(\"\");\n\n useEffect(() => {\n if (deleteLoading) {\n api\n .invoke(\n \"DELETE\",\n `/api/v1/buckets/${selectedBucket}/objects?path=${selectedObject}&non_current_versions=true`\n )\n .then(() => {\n closeDeleteModalAndRefresh(true);\n })\n .catch((error: ErrorResponseHandler) => {\n dispatch(setErrorSnackMessage(error));\n setDeleteLoading(false);\n });\n }\n }, [\n deleteLoading,\n closeDeleteModalAndRefresh,\n dispatch,\n selectedObject,\n selectedBucket,\n ]);\n\n if (!selectedObject) {\n return null;\n }\n const onConfirmDelete = () => {\n setDeleteLoading(true);\n };\n\n return (\n }\n isLoading={deleteLoading}\n onConfirm={onConfirmDelete}\n onClose={() => closeDeleteModalAndRefresh(false)}\n confirmButtonProps={{\n disabled: typeConfirm !== \"YES, PROCEED\" || deleteLoading,\n }}\n confirmationContent={\n \n Are you sure you want to delete all the non-current versions for:{\" \"}\n {decodeURLString(selectedObject)} ? \n \n To continue please type YES, PROCEED in the box.\n \n ) => {\n setTypeConfirm(event.target.value);\n }}\n label=\"\"\n value={typeConfirm}\n />\n \n \n }\n />\n );\n};\n\nexport default DeleteNonCurrentVersions;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { useEffect, useState } from \"react\";\n\nimport { DialogContentText } from \"@mui/material\";\n\nimport { ErrorResponseHandler } from \"../../../../../../common/types\";\nimport ConfirmDialog from \"../../../../Common/ModalWrapper/ConfirmDialog\";\nimport { ConfirmDeleteIcon } from \"../../../../../../icons\";\nimport api from \"../../../../../../common/api\";\nimport { setErrorSnackMessage } from \"../../../../../../systemSlice\";\nimport { useAppDispatch } from \"../../../../../../store\";\n\ninterface IDeleteSelectedVersionsProps {\n closeDeleteModalAndRefresh: (refresh: boolean) => void;\n deleteOpen: boolean;\n selectedVersions: string[];\n selectedObject: string;\n selectedBucket: string;\n}\n\nconst DeleteObject = ({\n closeDeleteModalAndRefresh,\n deleteOpen,\n selectedBucket,\n selectedVersions,\n selectedObject,\n}: IDeleteSelectedVersionsProps) => {\n const dispatch = useAppDispatch();\n const [deleteLoading, setDeleteLoading] = useState(false);\n\n const onClose = () => closeDeleteModalAndRefresh(false);\n const onConfirmDelete = () => {\n setDeleteLoading(true);\n };\n\n useEffect(() => {\n if (deleteLoading) {\n const selectedObjectsRequest = selectedVersions.map((versionID) => {\n return {\n path: selectedObject,\n versionID: versionID,\n recursive: false,\n };\n });\n\n if (selectedObjectsRequest.length > 0) {\n api\n .invoke(\n \"POST\",\n `/api/v1/buckets/${selectedBucket}/delete-objects?all_versions=false`,\n selectedObjectsRequest\n )\n .then(() => {\n setDeleteLoading(false);\n closeDeleteModalAndRefresh(true);\n })\n .catch((error: ErrorResponseHandler) => {\n dispatch(setErrorSnackMessage(error));\n setDeleteLoading(false);\n });\n }\n }\n }, [\n deleteLoading,\n closeDeleteModalAndRefresh,\n selectedBucket,\n selectedObject,\n selectedVersions,\n dispatch,\n ]);\n\n if (!selectedVersions) {\n return null;\n }\n\n return (\n }\n isLoading={deleteLoading}\n onConfirm={onConfirmDelete}\n onClose={onClose}\n confirmationContent={\n \n Are you sure you want to delete the selected {selectedVersions.length}{\" \"}\n versions for {selectedObject} ?\n \n }\n />\n );\n};\n\nexport default DeleteObject;\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, { Fragment, useEffect, useState } from \"react\";\nimport get from \"lodash/get\";\nimport { useSelector } from \"react-redux\";\nimport { withStyles } from \"@mui/styles\";\nimport { Theme } from \"@mui/material/styles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport { LinearProgress, SelectChangeEvent } from \"@mui/material\";\nimport Grid from \"@mui/material/Grid\";\nimport ShareFile from \"./ShareFile\";\nimport {\n actionsTray,\n buttonsStyles,\n containerForHeader,\n hrClass,\n objectBrowserCommon,\n objectBrowserExtras,\n spacingUtils,\n tableStyles,\n textStyleUtils,\n} from \"../../../../Common/FormComponents/common/styleLibrary\";\nimport { IFileInfo } from \"./types\";\nimport { download } from \"../utils\";\nimport api from \"../../../../../../common/api\";\nimport { ErrorResponseHandler } from \"../../../../../../common/types\";\n\nimport {\n decodeURLString,\n encodeURLString,\n niceBytesInt,\n} from \"../../../../../../common/utils\";\nimport ScreenTitle from \"../../../../Common/ScreenTitle/ScreenTitle\";\nimport RestoreFileVersion from \"./RestoreFileVersion\";\n\nimport { AppState, useAppDispatch } from \"../../../../../../store\";\nimport {\n DeleteIcon,\n DeleteNonCurrentIcon,\n SelectMultipleIcon,\n VersionsIcon,\n} from \"../../../../../../icons\";\nimport FileVersionItem from \"./FileVersionItem\";\nimport SelectWrapper from \"../../../../Common/FormComponents/SelectWrapper/SelectWrapper\";\nimport PreviewFileModal from \"../Preview/PreviewFileModal\";\nimport RBIconButton from \"../../../BucketDetails/SummaryItems/RBIconButton\";\nimport DeleteNonCurrent from \"../ListObjects/DeleteNonCurrent\";\nimport BrowserBreadcrumbs from \"../../../../ObjectBrowser/BrowserBreadcrumbs\";\nimport DeleteSelectedVersions from \"./DeleteSelectedVersions\";\nimport {\n selDistSet,\n setErrorSnackMessage,\n} from \"../../../../../../systemSlice\";\nimport {\n makeid,\n storeCallForObjectWithID,\n} from \"../../../../ObjectBrowser/transferManager\";\nimport {\n cancelObjectInList,\n completeObject,\n failObject,\n setLoadingObjectInfo,\n setLoadingVersions,\n setNewObject,\n setSelectedVersion,\n updateProgress,\n} from \"../../../../ObjectBrowser/objectBrowserSlice\";\nimport { List, ListRowProps } from \"react-virtualized\";\n\nconst styles = (theme: Theme) =>\n createStyles({\n versionsContainer: {\n padding: 10,\n \"@media (max-width: 799px)\": {\n minHeight: 800,\n },\n },\n noBottomBorder: {\n borderBottom: 0,\n },\n versionsVirtualPanel: {\n flexGrow: 1,\n height: \"calc(100% - 120px)\",\n overflow: \"auto\",\n \"@media (max-width: 799px)\": {\n height: 600,\n },\n },\n screenTitleContainer: {\n position: \"relative\",\n \"&::before\": {\n content: \"' '\",\n display: \"block\",\n position: \"absolute\",\n width: \"2px\",\n backgroundColor: \"#F8F8F8\",\n left: \"24px\",\n height: \"40px\",\n bottom: 0,\n },\n \"@media (max-width: 799px)\": {\n \"&::before\": {\n display: \"none\",\n },\n },\n },\n sortByLabel: {\n color: \"#838383\",\n fontWeight: \"bold\",\n whiteSpace: \"nowrap\",\n marginRight: 12,\n fontSize: 14,\n \"@media (max-width: 600px)\": {\n display: \"none\",\n },\n },\n ...hrClass,\n ...buttonsStyles,\n ...actionsTray,\n ...tableStyles,\n ...spacingUtils,\n ...textStyleUtils,\n ...objectBrowserCommon,\n ...objectBrowserExtras,\n ...containerForHeader(theme.spacing(4)),\n });\n\ninterface IVersionsNavigatorProps {\n classes: any;\n internalPaths: string;\n bucketName: string;\n}\n\nconst emptyFile: IFileInfo = {\n is_latest: true,\n last_modified: \"\",\n legal_hold_status: \"\",\n name: \"\",\n retention_mode: \"\",\n retention_until_date: \"\",\n size: \"0\",\n tags: {},\n version_id: null,\n};\n\nconst VersionsNavigator = ({\n classes,\n internalPaths,\n bucketName,\n}: IVersionsNavigatorProps) => {\n const dispatch = useAppDispatch();\n\n const searchVersions = useSelector(\n (state: AppState) => state.objectBrowser.searchVersions\n );\n const loadingVersions = useSelector(\n (state: AppState) => state.objectBrowser.loadingVersions\n );\n const selectedVersion = useSelector(\n (state: AppState) => state.objectBrowser.selectedVersion\n );\n\n const distributedSetup = useSelector(selDistSet);\n const [shareFileModalOpen, setShareFileModalOpen] = useState(false);\n const [actualInfo, setActualInfo] = useState(null);\n const [objectToShare, setObjectToShare] = useState(null);\n const [versions, setVersions] = useState([]);\n const [restoreVersionOpen, setRestoreVersionOpen] = useState(false);\n const [restoreVersion, setRestoreVersion] = useState(\"\");\n const [sortValue, setSortValue] = useState(\"date\");\n const [previewOpen, setPreviewOpen] = useState(false);\n const [deleteNonCurrentOpen, setDeleteNonCurrentOpen] =\n useState(false);\n const [selectEnabled, setSelectEnabled] = useState(false);\n const [selectedItems, setSelectedItems] = useState([]);\n const [delSelectedVOpen, setDelSelectedVOpen] = useState(false);\n\n // calculate object name to display\n let objectNameArray: string[] = [];\n if (actualInfo) {\n objectNameArray = actualInfo.name.split(\"/\");\n }\n\n useEffect(() => {\n if (!loadingVersions && !actualInfo) {\n dispatch(setLoadingVersions(true));\n }\n }, [loadingVersions, actualInfo, dispatch]);\n\n useEffect(() => {\n if (loadingVersions && internalPaths !== \"\") {\n api\n .invoke(\n \"GET\",\n `/api/v1/buckets/${bucketName}/objects?prefix=${internalPaths}${\n distributedSetup ? \"&with_versions=true\" : \"\"\n }`\n )\n .then((res: IFileInfo[]) => {\n const result = get(res, \"objects\", []);\n if (distributedSetup) {\n setActualInfo(\n result.find((el: IFileInfo) => el.is_latest) || emptyFile\n );\n setVersions(result);\n } else {\n setActualInfo(result[0]);\n setVersions([]);\n }\n\n dispatch(setLoadingVersions(false));\n })\n .catch((err: ErrorResponseHandler) => {\n dispatch(setErrorSnackMessage(err));\n dispatch(setLoadingVersions(false));\n });\n }\n }, [loadingVersions, bucketName, internalPaths, dispatch, distributedSetup]);\n\n const shareObject = () => {\n setShareFileModalOpen(true);\n };\n\n const closeShareModal = () => {\n setObjectToShare(null);\n setShareFileModalOpen(false);\n setPreviewOpen(false);\n };\n\n const downloadObject = (object: IFileInfo) => {\n const identityDownload = encodeURLString(\n `${bucketName}-${object.name}-${new Date().getTime()}-${Math.random()}`\n );\n\n const downloadCall = download(\n bucketName,\n internalPaths,\n object.version_id,\n parseInt(object.size || \"0\"),\n null,\n (progress) => {\n dispatch(\n updateProgress({\n instanceID: identityDownload,\n progress: progress,\n })\n );\n },\n () => {\n dispatch(completeObject(identityDownload));\n },\n (msg: string) => {\n dispatch(failObject({ instanceID: identityDownload, msg }));\n },\n () => {\n dispatch(cancelObjectInList(identityDownload));\n }\n );\n const ID = makeid(8);\n storeCallForObjectWithID(ID, downloadCall);\n dispatch(\n setNewObject({\n ID,\n bucketName,\n done: false,\n instanceID: identityDownload,\n percentage: 0,\n prefix: object.name,\n type: \"download\",\n waitingForFile: true,\n failed: false,\n cancelled: false,\n errorMessage: \"\",\n })\n );\n\n downloadCall.send();\n };\n\n const onShareItem = (item: IFileInfo) => {\n setObjectToShare(item);\n shareObject();\n };\n\n const onPreviewItem = (item: IFileInfo) => {\n setObjectToShare(item);\n setPreviewOpen(true);\n };\n\n const onRestoreItem = (item: IFileInfo) => {\n setRestoreVersion(item.version_id || \"\");\n setRestoreVersionOpen(true);\n };\n\n const onDownloadItem = (item: IFileInfo) => {\n downloadObject(item);\n };\n\n const onGlobalClick = (item: IFileInfo) => {\n dispatch(setSelectedVersion(item.version_id || \"\"));\n };\n\n const filteredRecords = versions.filter((version) => {\n if (version.version_id) {\n return version.version_id.includes(searchVersions);\n }\n return false;\n });\n\n const closeRestoreModal = (reloadObjectData: boolean) => {\n setRestoreVersionOpen(false);\n setRestoreVersion(\"\");\n\n if (reloadObjectData) {\n dispatch(setLoadingVersions(true));\n dispatch(setLoadingObjectInfo(true));\n }\n };\n\n const closeDeleteNonCurrent = (reloadAfterDelete: boolean) => {\n setDeleteNonCurrentOpen(false);\n\n if (reloadAfterDelete) {\n dispatch(setLoadingVersions(true));\n dispatch(setSelectedVersion(\"\"));\n dispatch(setLoadingObjectInfo(true));\n }\n };\n\n const closeSelectedVersions = (reloadOnComplete: boolean) => {\n setDelSelectedVOpen(false);\n\n if (reloadOnComplete) {\n dispatch(setLoadingVersions(true));\n dispatch(setSelectedVersion(\"\"));\n dispatch(setLoadingObjectInfo(true));\n setSelectedItems([]);\n }\n };\n\n const totalSpace = versions.reduce((acc: number, currValue: IFileInfo) => {\n if (currValue.size) {\n return acc + parseInt(currValue.size);\n }\n return acc;\n }, 0);\n\n filteredRecords.sort((a, b) => {\n switch (sortValue) {\n case \"size\":\n if (a.size && b.size) {\n if (a.size < b.size) {\n return -1;\n }\n if (a.size > b.size) {\n return 1;\n }\n return 0;\n }\n return 0;\n default:\n const dateA = new Date(a.last_modified).getTime();\n const dateB = new Date(b.last_modified).getTime();\n\n if (dateA < dateB) {\n return 1;\n }\n if (dateA > dateB) {\n return -1;\n }\n return 0;\n }\n });\n\n const onCheckVersion = (selectedVersion: string) => {\n if (selectedItems.includes(selectedVersion)) {\n const filteredItems = selectedItems.filter(\n (element) => element !== selectedVersion\n );\n\n setSelectedItems(filteredItems);\n\n return;\n }\n\n const cloneState = [...selectedItems];\n cloneState.push(selectedVersion);\n\n setSelectedItems(cloneState);\n };\n\n const rowRenderer = ({\n key, // Unique key within array of rows\n index, // Index of row within collection\n isScrolling, // The List is currently being scrolled\n isVisible, // This row is visible within the List (eg it is not an overscanned row)\n style, // Style object to be applied to row (to position it)\n }: ListRowProps) => {\n const versOrd = versions.length - index;\n return (\n \n );\n };\n\n return (\n \n {shareFileModalOpen && actualInfo && (\n \n )}\n {restoreVersionOpen && actualInfo && (\n \n )}\n {previewOpen && actualInfo && (\n {\n setPreviewOpen(false);\n }}\n />\n )}\n {deleteNonCurrentOpen && (\n \n )}\n {delSelectedVOpen && (\n \n )}\n \n {!actualInfo && (\n \n \n \n )}\n\n {actualInfo && (\n \n \n \n \n \n \n \n \n }\n title={\n \n {objectNameArray.length > 0\n ? objectNameArray[objectNameArray.length - 1]\n : actualInfo.name}{\" \"}\n Versions\n \n }\n subTitle={\n \n \n \n \n {versions.length} Version\n {versions.length === 1 ? \"\" : \"s\"} \n \n \n \n {niceBytesInt(totalSpace)} \n \n \n \n }\n actions={\n \n {\n setSelectEnabled(!selectEnabled);\n }}\n text={\"\"}\n icon={ }\n color=\"primary\"\n variant={selectEnabled ? \"contained\" : \"outlined\"}\n style={{ marginRight: 8 }}\n />\n {selectEnabled && (\n {\n setDelSelectedVOpen(true);\n }}\n text={\"\"}\n icon={ }\n color=\"secondary\"\n style={{ marginRight: 8 }}\n disabled={selectedItems.length === 0}\n />\n )}\n {\n setDeleteNonCurrentOpen(true);\n }}\n text={\"\"}\n icon={ }\n color=\"secondary\"\n style={{ marginRight: 15 }}\n disabled={versions.length <= 1}\n />\n Sort by \n ) => {\n setSortValue(e.target.value as string);\n }}\n name={\"sort-by\"}\n options={[\n { label: \"Date\", value: \"date\" },\n {\n label: \"Size\",\n value: \"size\",\n },\n ]}\n />\n \n }\n className={classes.noBottomBorder}\n />\n \n \n {actualInfo.version_id && actualInfo.version_id !== \"null\" && (\n // @ts-ignore\n
\n )}\n \n \n )}\n \n \n );\n};\n\nexport default withStyles(styles)(VersionsNavigator);\n","// This file is part of MinIO Console Server\n// Copyright (c) 2022 MinIO, Inc.\n//\n// This program is free software: you can redistribute it and/or modify\n// it under the terms of the GNU Affero General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// This program is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU Affero General Public License for more details.\n//\n// You should have received a copy of the GNU Affero General Public License\n// along with this program. If not, see .\n\nimport React, {\n Fragment,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { useSelector } from \"react-redux\";\nimport { useLocation, useNavigate, useParams } from \"react-router-dom\";\nimport { useDropzone } from \"react-dropzone\";\nimport { Theme } from \"@mui/material/styles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport Grid from \"@mui/material/Grid\";\nimport get from \"lodash/get\";\nimport { BucketObjectItem, BucketObjectItemsList } from \"./types\";\nimport api from \"../../../../../../common/api\";\nimport TableWrapper, {\n ItemActions,\n} from \"../../../../Common/TableWrapper/TableWrapper\";\nimport {\n decodeURLString,\n encodeURLString,\n getClientOS,\n niceBytesInt,\n} from \"../../../../../../common/utils\";\n\nimport {\n actionsTray,\n containerForHeader,\n objectBrowserCommon,\n objectBrowserExtras,\n searchField,\n tableStyles,\n} from \"../../../../Common/FormComponents/common/styleLibrary\";\nimport { Badge, Typography } from \"@mui/material\";\nimport BrowserBreadcrumbs from \"../../../../ObjectBrowser/BrowserBreadcrumbs\";\nimport {\n download,\n extensionPreview,\n permissionItems,\n sortListObjects,\n} from \"../utils\";\nimport {\n BucketInfo,\n BucketObjectLocking,\n BucketQuota,\n BucketVersioning,\n} from \"../../../types\";\nimport { ErrorResponseHandler } from \"../../../../../../common/types\";\n\nimport ScreenTitle from \"../../../../Common/ScreenTitle/ScreenTitle\";\n\nimport { AppState, useAppDispatch } from \"../../../../../../store\";\nimport PageLayout from \"../../../../Common/Layout/PageLayout\";\n\nimport { IAM_SCOPES } from \"../../../../../../common/SecureComponent/permissions\";\nimport {\n hasPermission,\n SecureComponent,\n} from \"../../../../../../common/SecureComponent\";\n\nimport withSuspense from \"../../../../Common/Components/withSuspense\";\nimport {\n BucketsIcon,\n DownloadIcon,\n PreviewIcon,\n ShareIcon,\n} from \"../../../../../../icons\";\nimport UploadFilesButton from \"../../UploadFilesButton\";\nimport DetailsListPanel from \"./DetailsListPanel\";\nimport ObjectDetailPanel from \"./ObjectDetailPanel\";\nimport RBIconButton from \"../../../BucketDetails/SummaryItems/RBIconButton\";\nimport ActionsListSection from \"./ActionsListSection\";\nimport { listModeColumns, rewindModeColumns } from \"./ListObjectsHelpers\";\nimport VersionsNavigator from \"../ObjectDetails/VersionsNavigator\";\nimport CheckboxWrapper from \"../../../../Common/FormComponents/CheckboxWrapper/CheckboxWrapper\";\n\nimport {\n setErrorSnackMessage,\n setSnackBarMessage,\n} from \"../../../../../../systemSlice\";\n\nimport {\n makeid,\n storeCallForObjectWithID,\n} from \"../../../../ObjectBrowser/transferManager\";\nimport {\n cancelObjectInList,\n completeObject,\n failObject,\n openList,\n resetRewind,\n setLoadingObjectInfo,\n setLoadingObjectsList,\n setLoadingVersions,\n setNewObject,\n setObjectDetailsView,\n setSearchObjects,\n setSelectedObjectView,\n setShowDeletedObjects,\n setSimplePathHandler,\n setVersionsModeEnabled,\n updateProgress,\n} from \"../../../../ObjectBrowser/objectBrowserSlice\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport {\n selBucketDetailsInfo,\n selBucketDetailsLoading,\n setBucketDetailsLoad,\n setBucketInfo,\n} from \"../../../BucketDetails/bucketDetailsSlice\";\nimport RenameLongFileName from \"../../../../ObjectBrowser/RenameLongFilename\";\nimport { selFeatures } from \"../../../../consoleSlice\";\n\nconst HistoryIcon = React.lazy(\n () => import(\"../../../../../../icons/HistoryIcon\")\n);\nconst RefreshIcon = React.lazy(\n () => import(\"../../../../../../icons/RefreshIcon\")\n);\n\nconst DeleteIcon = React.lazy(\n () => import(\"../../../../../../icons/DeleteIcon\")\n);\n\nconst DeleteMultipleObjects = withSuspense(\n React.lazy(() => import(\"./DeleteMultipleObjects\"))\n);\nconst ShareFile = withSuspense(\n React.lazy(() => import(\"../ObjectDetails/ShareFile\"))\n);\nconst RewindEnable = withSuspense(React.lazy(() => import(\"./RewindEnable\")));\nconst PreviewFileModal = withSuspense(\n React.lazy(() => import(\"../Preview/PreviewFileModal\"))\n);\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n browsePaper: {\n border: 0,\n height: \"calc(100vh - 210px)\",\n \"&.isEmbedded\": {\n height: \"calc(100vh - 315px)\",\n },\n \"&.actionsPanelOpen\": {\n minHeight: \"100%\",\n },\n \"@media (max-width: 800px)\": {\n width: 800,\n },\n },\n \"@global\": {\n \".rowLine:hover .iconFileElm\": {\n backgroundImage: \"url(/images/ob_file_filled.svg)\",\n },\n \".rowLine:hover .iconFolderElm\": {\n backgroundImage: \"url(/images/ob_folder_filled.svg)\",\n },\n },\n\n badgeOverlap: {\n \"& .MuiBadge-badge\": {\n top: 10,\n right: 1,\n width: 5,\n height: 5,\n minWidth: 5,\n },\n },\n screenTitle: {\n borderBottom: 0,\n paddingTop: 0,\n paddingLeft: 0,\n paddingRight: 0,\n },\n ...tableStyles,\n ...actionsTray,\n ...searchField,\n\n searchField: {\n ...searchField.searchField,\n maxWidth: 380,\n },\n screenTitleContainer: {\n border: \"#EAEDEE 1px solid\",\n padding: \"0.8rem 15px 0\",\n },\n labelStyle: {\n color: \"#969FA8\",\n fontSize: \"12px\",\n },\n breadcrumbsContainer: {\n padding: \"12px 14px 5px\",\n },\n parentWrapper: {\n \"@media (max-width: 800px)\": {\n overflowX: \"auto\",\n },\n },\n fullContainer: {\n \"@media (max-width: 799px)\": {\n width: 0,\n },\n },\n hideListOnSmall: {\n \"@media (max-width: 799px)\": {\n display: \"none\",\n },\n },\n ...objectBrowserExtras,\n ...objectBrowserCommon,\n ...containerForHeader(theme.spacing(4)),\n })\n);\n\nconst baseDnDStyle = {\n borderWidth: 2,\n borderRadius: 2,\n borderColor: \"#eeeeee\",\n outline: \"none\",\n};\n\nconst activeDnDStyle = {\n borderStyle: \"dashed\",\n backgroundColor: \"#fafafa\",\n borderColor: \"#2196f3\",\n};\n\nconst acceptDnDStyle = {\n borderStyle: \"dashed\",\n backgroundColor: \"#fafafa\",\n borderColor: \"#00e676\",\n};\n\nfunction useInterval(callback: any, delay: number) {\n const savedCallback = useRef(null);\n\n // Remember the latest callback.\n useEffect(() => {\n savedCallback.current = callback;\n }, [callback]);\n\n // Set up the interval.\n useEffect(() => {\n function tick() {\n if (savedCallback !== undefined && savedCallback.current) {\n savedCallback.current();\n }\n }\n\n if (delay !== null) {\n let id = setInterval(tick, delay);\n return () => clearInterval(id);\n }\n }, [delay]);\n}\n\nconst defLoading = Loading... ;\n\nconst ListObjects = () => {\n const classes = useStyles();\n const dispatch = useAppDispatch();\n const params = useParams();\n const navigate = useNavigate();\n const location = useLocation();\n\n const rewindEnabled = useSelector(\n (state: AppState) => state.objectBrowser.rewind.rewindEnabled\n );\n const rewindDate = useSelector(\n (state: AppState) => state.objectBrowser.rewind.dateToRewind\n );\n const bucketToRewind = useSelector(\n (state: AppState) => state.objectBrowser.rewind.bucketToRewind\n );\n const versionsMode = useSelector(\n (state: AppState) => state.objectBrowser.versionsMode\n );\n\n const searchObjects = useSelector(\n (state: AppState) => state.objectBrowser.searchObjects\n );\n const showDeleted = useSelector(\n (state: AppState) => state.objectBrowser.showDeleted\n );\n const detailsOpen = useSelector(\n (state: AppState) => state.objectBrowser.objectDetailsOpen\n );\n const selectedInternalPaths = useSelector(\n (state: AppState) => state.objectBrowser.selectedInternalPaths\n );\n const loading = useSelector(\n (state: AppState) => state.objectBrowser.loadingObjects\n );\n const simplePath = useSelector(\n (state: AppState) => state.objectBrowser.simplePath\n );\n\n const loadingBucket = useSelector(selBucketDetailsLoading);\n const bucketInfo = useSelector(selBucketDetailsInfo);\n const allowResources = useSelector(\n (state: AppState) => state.console.session.allowResources\n );\n\n const features = useSelector(selFeatures);\n const obOnly = !!features?.includes(\"object-browser-only\");\n\n const [records, setRecords] = useState([]);\n const [deleteMultipleOpen, setDeleteMultipleOpen] = useState(false);\n const [loadingStartTime, setLoadingStartTime] = useState(0);\n const [loadingMessage, setLoadingMessage] =\n useState(defLoading);\n const [loadingVersioning, setLoadingVersioning] = useState(true);\n const [isVersioned, setIsVersioned] = useState(false);\n const [loadingLocking, setLoadingLocking] = useState(true);\n const [lockingEnabled, setLockingEnabled] = useState(false);\n const [rewindSelect, setRewindSelect] = useState(false);\n const [selectedObjects, setSelectedObjects] = useState([]);\n const [previewOpen, setPreviewOpen] = useState(false);\n const [selectedPreview, setSelectedPreview] =\n useState(null);\n const [shareFileModalOpen, setShareFileModalOpen] = useState(false);\n const [sortDirection, setSortDirection] = useState<\n \"ASC\" | \"DESC\" | undefined\n >(\"ASC\");\n const [currentSortField, setCurrentSortField] = useState(\"name\");\n const [iniLoad, setIniLoad] = useState(false);\n const [canShareFile, setCanShareFile] = useState(false);\n const [canPreviewFile, setCanPreviewFile] = useState(false);\n const [quota, setQuota] = useState(null);\n const [downloadRenameModal, setDownloadRenameModal] =\n useState(null);\n\n const pathSegment = location.pathname.split(\"/browse/\");\n\n const internalPaths = pathSegment.length === 2 ? pathSegment[1] : \"\";\n const bucketName = params.bucketName || \"\";\n\n const fileUpload = useRef(null);\n const folderUpload = useRef(null);\n\n useEffect(() => {\n if (folderUpload.current !== null) {\n folderUpload.current.setAttribute(\"directory\", \"\");\n folderUpload.current.setAttribute(\"webkitdirectory\", \"\");\n }\n }, [folderUpload]);\n\n useEffect(() => {\n if (selectedObjects.length === 1) {\n const objectName = selectedObjects[0];\n\n if (extensionPreview(objectName) !== \"none\") {\n setCanPreviewFile(true);\n } else {\n setCanPreviewFile(false);\n }\n\n if (objectName.endsWith(\"/\")) {\n setCanShareFile(false);\n } else {\n setCanShareFile(true);\n }\n } else {\n setCanShareFile(false);\n setCanPreviewFile(false);\n }\n }, [selectedObjects]);\n\n useEffect(() => {\n if (!quota) {\n api\n .invoke(\"GET\", `/api/v1/buckets/${bucketName}/quota`)\n .then((res: BucketQuota) => {\n let quotaVals = null;\n\n if (res.quota) {\n quotaVals = res;\n }\n\n setQuota(quotaVals);\n })\n .catch((err) => {\n console.error(\"Error Getting Quota Status: \", err.detailedError);\n setQuota(null);\n });\n }\n }, [quota, bucketName]);\n\n useEffect(() => {\n if (selectedObjects.length > 0) {\n dispatch(setObjectDetailsView(true));\n return;\n }\n\n if (selectedObjects.length === 0 && selectedInternalPaths === null) {\n dispatch(setObjectDetailsView(false));\n }\n }, [selectedObjects, selectedInternalPaths, dispatch]);\n\n const displayDeleteObject = hasPermission(bucketName, [\n IAM_SCOPES.S3_DELETE_OBJECT,\n ]);\n\n const displayListObjects = hasPermission(bucketName, [\n IAM_SCOPES.S3_LIST_BUCKET,\n ]);\n\n const updateMessage = () => {\n let timeDelta = Date.now() - loadingStartTime;\n\n if (timeDelta / 1000 >= 6) {\n setLoadingMessage(\n \n \n This operation is taking longer than expected... (\n {Math.ceil(timeDelta / 1000)}s)\n \n \n );\n } else if (timeDelta / 1000 >= 3) {\n setLoadingMessage(\n \n This operation is taking longer than expected...\n \n );\n }\n };\n\n useEffect(() => {\n if (!iniLoad) {\n dispatch(setBucketDetailsLoad(true));\n setIniLoad(true);\n }\n }, [iniLoad, dispatch, setIniLoad]);\n\n useInterval(() => {\n // Your custom logic here\n if (loading) {\n updateMessage();\n }\n }, 1000);\n\n useEffect(() => {\n if (loadingVersioning) {\n if (displayListObjects) {\n api\n .invoke(\"GET\", `/api/v1/buckets/${bucketName}/versioning`)\n .then((res: BucketVersioning) => {\n setIsVersioned(res.is_versioned);\n setLoadingVersioning(false);\n })\n .catch((err: ErrorResponseHandler) => {\n console.error(\n \"Error Getting Object Versioning Status: \",\n err.detailedError\n );\n setLoadingVersioning(false);\n });\n } else {\n setLoadingVersioning(false);\n setRecords([]);\n }\n }\n }, [bucketName, loadingVersioning, dispatch, displayListObjects]);\n\n useEffect(() => {\n if (loadingLocking) {\n if (displayListObjects) {\n api\n .invoke(\"GET\", `/api/v1/buckets/${bucketName}/object-locking`)\n .then((res: BucketObjectLocking) => {\n setLockingEnabled(res.object_locking_enabled);\n setLoadingLocking(false);\n })\n .catch((err: ErrorResponseHandler) => {\n console.error(\n \"Error Getting Object Locking Status: \",\n err.detailedError\n );\n setLoadingLocking(false);\n });\n } else {\n setRecords([]);\n setLoadingLocking(false);\n }\n }\n }, [bucketName, loadingLocking, dispatch, displayListObjects]);\n\n useEffect(() => {\n const decodedIPaths = decodeURLString(internalPaths);\n\n if (decodedIPaths.endsWith(\"/\") || decodedIPaths === \"\") {\n dispatch(setObjectDetailsView(false));\n dispatch(setSelectedObjectView(null));\n dispatch(\n setSimplePathHandler(decodedIPaths === \"\" ? \"/\" : decodedIPaths)\n );\n } else {\n dispatch(setLoadingObjectInfo(true));\n dispatch(setObjectDetailsView(true));\n dispatch(setLoadingVersions(true));\n dispatch(\n setSelectedObjectView(\n `${decodedIPaths ? `${encodeURLString(decodedIPaths)}` : ``}`\n )\n );\n dispatch(\n setSimplePathHandler(\n `${decodedIPaths.split(\"/\").slice(0, -1).join(\"/\")}/`\n )\n );\n }\n }, [internalPaths, rewindDate, rewindEnabled, dispatch]);\n\n useEffect(() => {\n dispatch(setSearchObjects(\"\"));\n dispatch(setLoadingObjectsList(true));\n setSelectedObjects([]);\n }, [simplePath, dispatch, setSelectedObjects]);\n\n useEffect(() => {\n if (loading) {\n if (displayListObjects) {\n let pathPrefix = \"\";\n if (internalPaths) {\n const decodedPath = decodeURLString(internalPaths);\n pathPrefix = decodedPath.endsWith(\"/\")\n ? decodedPath\n : decodedPath + \"/\";\n }\n\n let currentTimestamp = Date.now();\n setLoadingStartTime(currentTimestamp);\n setLoadingMessage(defLoading);\n\n // We get URL to look into\n let urlTake = `/api/v1/buckets/${bucketName}/objects`;\n\n // Is rewind enabled?, we use Rewind API\n if (rewindEnabled) {\n if (bucketToRewind !== bucketName) {\n dispatch(resetRewind());\n return;\n }\n\n if (rewindDate) {\n const rewindParsed = rewindDate.toISOString();\n\n urlTake = `/api/v1/buckets/${bucketName}/rewind/${rewindParsed}`;\n }\n } else if (showDeleted) {\n // Do we want to display deleted items too?, we use rewind to current time to show everything\n const currDate = new Date();\n const currDateISO = currDate.toISOString();\n\n urlTake = `/api/v1/buckets/${bucketName}/rewind/${currDateISO}`;\n }\n\n api\n .invoke(\n \"GET\",\n `${urlTake}${\n pathPrefix ? `?prefix=${encodeURLString(pathPrefix)}` : ``\n }`\n )\n .then((res: BucketObjectItemsList) => {\n const records: BucketObjectItem[] = res.objects || [];\n const folders: BucketObjectItem[] = [];\n const files: BucketObjectItem[] = [];\n\n // We separate items between folders or files to display folders at the beginning always.\n records.forEach((record) => {\n // We omit files from the same path\n if (record.name !== decodeURLString(internalPaths)) {\n // this is a folder\n if (record.name.endsWith(\"/\")) {\n folders.push(record);\n } else {\n // this is a file\n files.push(record);\n }\n }\n });\n\n const recordsInElement = [...folders, ...files];\n\n if (recordsInElement.length === 0 && pathPrefix !== \"\") {\n let pathTest = `/api/v1/buckets/${bucketName}/objects${\n internalPaths ? `?prefix=${internalPaths}` : \"\"\n }`;\n\n if (rewindEnabled) {\n const rewindParsed = rewindDate.toISOString();\n\n let pathPrefix = \"\";\n if (internalPaths) {\n const decodedPath = decodeURLString(internalPaths);\n pathPrefix = decodedPath.endsWith(\"/\")\n ? decodedPath\n : decodedPath + \"/\";\n }\n\n pathTest = `/api/v1/buckets/${bucketName}/rewind/${rewindParsed}${\n pathPrefix ? `?prefix=${encodeURLString(pathPrefix)}` : ``\n }`;\n }\n\n api\n .invoke(\"GET\", pathTest)\n .then((res: BucketObjectItemsList) => {\n //It is a file since it has elements in the object, setting file flag and waiting for component mount\n if (!res.objects) {\n // It is a folder, we remove loader & set original results list\n dispatch(setLoadingObjectsList(false));\n setRecords(recordsInElement);\n } else {\n // This code prevents the program from opening a file when a substring of that file is entered as a new folder.\n // Previously, if there was a file test1.txt and the folder test was created with the same prefix, the program\n // would open test1.txt instead\n let found = false;\n let pathPrefixChopped = pathPrefix.slice(\n 0,\n pathPrefix.length - 1\n );\n for (let i = 0; i < res.objects.length; i++) {\n if (res.objects[i].name === pathPrefixChopped) {\n found = true;\n }\n }\n if (\n (res.objects.length === 1 &&\n res.objects[0].name.endsWith(\"/\")) ||\n !found\n ) {\n // This is a folder, we set the original results list\n setRecords(recordsInElement);\n } else {\n // This is a file. We change URL & Open file details view.\n dispatch(setObjectDetailsView(true));\n dispatch(setSelectedObjectView(internalPaths));\n\n // We split the selected object URL & remove the last item to fetch the files list for the parent folder\n const parentPath = `${decodeURLString(internalPaths)\n .split(\"/\")\n .slice(0, -1)\n .join(\"/\")}/`;\n\n api\n .invoke(\n \"GET\",\n `${urlTake}${\n pathPrefix\n ? `?prefix=${encodeURLString(parentPath)}`\n : ``\n }`\n )\n .then((res: BucketObjectItemsList) => {\n const records: BucketObjectItem[] = res.objects || [];\n\n setRecords(records);\n })\n .catch(() => {});\n }\n\n dispatch(setLoadingObjectsList(false));\n }\n })\n .catch((err: ErrorResponseHandler) => {\n dispatch(setLoadingObjectsList(false));\n dispatch(setErrorSnackMessage(err));\n });\n } else {\n setRecords(recordsInElement);\n dispatch(setLoadingObjectsList(false));\n }\n })\n .catch((err: ErrorResponseHandler) => {\n const permitItems = permissionItems(\n bucketName,\n pathPrefix,\n allowResources || []\n );\n\n if (!permitItems || permitItems.length === 0) {\n dispatch(setErrorSnackMessage(err));\n } else {\n setRecords(permitItems);\n }\n\n dispatch(setLoadingObjectsList(false));\n });\n } else {\n dispatch(setLoadingObjectsList(false));\n }\n }\n }, [\n loading,\n dispatch,\n bucketName,\n rewindEnabled,\n rewindDate,\n internalPaths,\n bucketInfo,\n showDeleted,\n displayListObjects,\n bucketToRewind,\n allowResources,\n ]);\n\n // bucket info\n useEffect(() => {\n if (loadingBucket) {\n api\n .invoke(\"GET\", `/api/v1/buckets/${bucketName}`)\n .then((res: BucketInfo) => {\n dispatch(setBucketDetailsLoad(false));\n dispatch(setBucketInfo(res));\n })\n .catch((err: ErrorResponseHandler) => {\n dispatch(setBucketDetailsLoad(false));\n dispatch(setErrorSnackMessage(err));\n });\n }\n }, [bucketName, loadingBucket, dispatch]);\n\n const closeDeleteMultipleModalAndRefresh = (refresh: boolean) => {\n setDeleteMultipleOpen(false);\n\n if (refresh) {\n dispatch(setSnackBarMessage(`Objects deleted successfully.`));\n setSelectedObjects([]);\n dispatch(setLoadingObjectsList(true));\n }\n };\n\n const handleUploadButton = (e: any) => {\n if (\n e === null ||\n e === undefined ||\n e.target.files === null ||\n e.target.files === undefined\n ) {\n return;\n }\n e.preventDefault();\n var newFiles: File[] = [];\n\n for (var i = 0; i < e.target.files.length; i++) {\n newFiles.push(e.target.files[i]);\n }\n uploadObject(newFiles, \"\");\n\n e.target.value = \"\";\n };\n\n const downloadObject = (object: BucketObjectItem) => {\n const identityDownload = encodeURLString(\n `${bucketName}-${object.name}-${new Date().getTime()}-${Math.random()}`\n );\n\n const downloadCall = download(\n bucketName,\n encodeURLString(object.name),\n object.version_id,\n object.size,\n null,\n (progress) => {\n dispatch(\n updateProgress({\n instanceID: identityDownload,\n progress: progress,\n })\n );\n },\n () => {\n dispatch(completeObject(identityDownload));\n },\n (msg: string) => {\n dispatch(failObject({ instanceID: identityDownload, msg }));\n },\n () => {\n dispatch(cancelObjectInList(identityDownload));\n }\n );\n const ID = makeid(8);\n storeCallForObjectWithID(ID, downloadCall);\n dispatch(\n setNewObject({\n ID,\n bucketName,\n done: false,\n instanceID: identityDownload,\n percentage: 0,\n prefix: object.name,\n type: \"download\",\n waitingForFile: true,\n failed: false,\n cancelled: false,\n errorMessage: \"\",\n })\n );\n\n downloadCall.send();\n };\n\n const openPath = (idElement: string) => {\n setSelectedObjects([]);\n\n const newPath = `/buckets/${bucketName}/browse${\n idElement ? `/${encodeURLString(idElement)}` : ``\n }`;\n navigate(newPath);\n\n dispatch(setObjectDetailsView(true));\n dispatch(setLoadingVersions(true));\n dispatch(\n setSelectedObjectView(\n `${idElement ? `${encodeURLString(idElement)}` : ``}`\n )\n );\n };\n\n const uploadObject = useCallback(\n (files: File[], folderPath: string): void => {\n let pathPrefix = \"\";\n if (simplePath) {\n pathPrefix = simplePath.endsWith(\"/\") ? simplePath : simplePath + \"/\";\n }\n\n const upload = (\n files: File[],\n bucketName: string,\n path: string,\n folderPath: string\n ) => {\n let uploadPromise = (file: File) => {\n return new Promise((resolve, reject) => {\n let uploadUrl = `api/v1/buckets/${bucketName}/objects/upload`;\n const fileName = file.name;\n\n const blobFile = new Blob([file], { type: file.type });\n\n let encodedPath = \"\";\n\n const filePath = get(file, \"path\", \"\");\n const fileWebkitRelativePath = get(file, \"webkitRelativePath\", \"\");\n\n let relativeFolderPath = folderPath;\n\n // File was uploaded via drag & drop\n if (filePath !== \"\") {\n relativeFolderPath = filePath;\n } else if (fileWebkitRelativePath !== \"\") {\n // File was uploaded using upload button\n relativeFolderPath = fileWebkitRelativePath;\n }\n\n if (path !== \"\" || relativeFolderPath !== \"\") {\n const finalFolderPath = relativeFolderPath\n .split(\"/\")\n .slice(0, -1)\n .join(\"/\");\n\n const pathClean = path.endsWith(\"/\") ? path.slice(0, -1) : path;\n\n encodedPath = encodeURLString(\n `${pathClean}${\n !pathClean.endsWith(\"/\") &&\n finalFolderPath !== \"\" &&\n !finalFolderPath.startsWith(\"/\")\n ? \"/\"\n : \"\"\n }${finalFolderPath}${\n !finalFolderPath.endsWith(\"/\") ||\n (finalFolderPath.trim() === \"\" && !path.endsWith(\"/\"))\n ? \"/\"\n : \"\"\n }`\n );\n }\n\n if (encodedPath !== \"\") {\n uploadUrl = `${uploadUrl}?prefix=${encodedPath}`;\n }\n\n const identity = encodeURLString(\n `${bucketName}-${encodedPath}-${new Date().getTime()}-${Math.random()}`\n );\n\n let xhr = new XMLHttpRequest();\n xhr.open(\"POST\", uploadUrl, true);\n\n const areMultipleFiles = files.length > 1;\n let errorMessage = `An error occurred while uploading the file${\n areMultipleFiles ? \"s\" : \"\"\n }.`;\n\n const errorMessages: any = {\n 413: \"Error - File size too large\",\n };\n\n xhr.withCredentials = false;\n xhr.onload = function (event) {\n // resolve promise only when HTTP code is ok\n if (xhr.status >= 200 && xhr.status < 300) {\n dispatch(completeObject(identity));\n resolve({ status: xhr.status });\n } else {\n // reject promise if there was a server error\n if (errorMessages[xhr.status]) {\n errorMessage = errorMessages[xhr.status];\n } else if (xhr.response) {\n try {\n const err = JSON.parse(xhr.response);\n errorMessage = err.detailedMessage;\n } catch (e) {\n errorMessage = \"something went wrong\";\n }\n }\n dispatch(\n failObject({\n instanceID: identity,\n msg: errorMessage,\n })\n );\n reject({ status: xhr.status, message: errorMessage });\n }\n };\n\n xhr.upload.addEventListener(\"error\", (event) => {\n reject(errorMessage);\n dispatch(\n failObject({\n instanceID: identity,\n msg: \"A network error occurred.\",\n })\n );\n return;\n });\n\n xhr.upload.addEventListener(\"progress\", (event) => {\n const progress = Math.floor((event.loaded * 100) / event.total);\n\n dispatch(\n updateProgress({\n instanceID: identity,\n progress: progress,\n })\n );\n });\n\n xhr.onerror = () => {\n reject(errorMessage);\n dispatch(\n failObject({\n instanceID: identity,\n msg: \"A network error occurred.\",\n })\n );\n return;\n };\n xhr.onloadend = () => {\n if (files.length === 0) {\n dispatch(setLoadingObjectsList(true));\n }\n };\n xhr.onabort = () => {\n dispatch(cancelObjectInList(identity));\n };\n\n const formData = new FormData();\n if (file.size !== undefined) {\n formData.append(file.size.toString(), blobFile, fileName);\n const ID = makeid(8);\n storeCallForObjectWithID(ID, xhr);\n dispatch(\n setNewObject({\n ID,\n bucketName,\n done: false,\n instanceID: identity,\n percentage: 0,\n prefix: `${decodeURLString(encodedPath)}${fileName}`,\n type: \"upload\",\n waitingForFile: false,\n failed: false,\n cancelled: false,\n errorMessage: \"\",\n })\n );\n\n xhr.send(formData);\n }\n });\n };\n\n const uploadFilePromises: any = [];\n // open object manager\n dispatch(openList());\n for (let i = 0; i < files.length; i++) {\n const file = files[i];\n uploadFilePromises.push(uploadPromise(file));\n }\n Promise.allSettled(uploadFilePromises).then((results: Array) => {\n const errors = results.filter(\n (result) => result.status === \"rejected\"\n );\n if (errors.length > 0) {\n const totalFiles = uploadFilePromises.length;\n const successUploadedFiles =\n uploadFilePromises.length - errors.length;\n const err: ErrorResponseHandler = {\n errorMessage: \"There were some errors during file upload\",\n detailedError: `Uploaded files ${successUploadedFiles}/${totalFiles}`,\n };\n dispatch(setErrorSnackMessage(err));\n }\n // We force objects list reload after all promises were handled\n dispatch(setLoadingObjectsList(true));\n setSelectedObjects([]);\n });\n };\n\n upload(files, bucketName, pathPrefix, folderPath);\n },\n [bucketName, dispatch, simplePath]\n );\n\n const onDrop = useCallback(\n (acceptedFiles: any[]) => {\n if (acceptedFiles && acceptedFiles.length > 0) {\n let newFolderPath: string = acceptedFiles[0].path;\n uploadObject(acceptedFiles, newFolderPath);\n }\n },\n [uploadObject]\n );\n\n const { getRootProps, getInputProps, isDragActive, isDragAccept } =\n useDropzone({\n noClick: true,\n onDrop,\n });\n\n const dndStyles = useMemo(\n () => ({\n ...baseDnDStyle,\n ...(isDragActive ? activeDnDStyle : {}),\n ...(isDragAccept ? acceptDnDStyle : {}),\n }),\n [isDragActive, isDragAccept]\n );\n\n const openPreview = () => {\n if (selectedObjects.length === 1) {\n let fileObject: BucketObjectItem | undefined;\n\n const findFunction = (currValue: BucketObjectItem) =>\n selectedObjects.includes(currValue.name);\n\n fileObject = filteredRecords.find(findFunction);\n\n if (fileObject) {\n setSelectedPreview(fileObject);\n setPreviewOpen(true);\n }\n }\n };\n\n const openShare = () => {\n if (selectedObjects.length === 1) {\n let fileObject: BucketObjectItem | undefined;\n\n const findFunction = (currValue: BucketObjectItem) =>\n selectedObjects.includes(currValue.name);\n\n fileObject = filteredRecords.find(findFunction);\n\n if (fileObject) {\n setSelectedPreview(fileObject);\n setShareFileModalOpen(true);\n }\n }\n };\n\n const closeShareModal = () => {\n setShareFileModalOpen(false);\n setSelectedPreview(null);\n };\n\n const filteredRecords = records.filter((b: BucketObjectItem) => {\n if (searchObjects === \"\") {\n return true;\n } else {\n const objectName = b.name.toLowerCase();\n if (objectName.indexOf(searchObjects.toLowerCase()) >= 0) {\n return true;\n } else {\n return false;\n }\n }\n });\n\n const rewindCloseModal = () => {\n setRewindSelect(false);\n };\n\n const closePreviewWindow = () => {\n setPreviewOpen(false);\n setSelectedPreview(null);\n };\n\n const selectListObjects = (e: React.ChangeEvent) => {\n const targetD = e.target;\n const value = targetD.value;\n const checked = targetD.checked;\n\n let elements: string[] = [...selectedObjects]; // We clone the selectedBuckets array\n\n if (checked) {\n // If the user has checked this field we need to push this to selectedBucketsList\n elements.push(value);\n } else {\n // User has unchecked this field, we need to remove it from the list\n elements = elements.filter((element) => element !== value);\n }\n setSelectedObjects(elements);\n dispatch(setSelectedObjectView(null));\n\n return elements;\n };\n\n const sortChange = (sortData: any) => {\n const newSortDirection = get(sortData, \"sortDirection\", \"DESC\");\n setCurrentSortField(sortData.sortBy);\n setSortDirection(newSortDirection);\n dispatch(setLoadingObjectsList(true));\n };\n\n const pageTitle = decodeURLString(internalPaths);\n const currentPath = pageTitle.split(\"/\").filter((i: string) => i !== \"\");\n\n const plSelect = filteredRecords;\n const sortASC = plSelect.sort(sortListObjects(currentSortField));\n\n let payload: BucketObjectItem[] = [];\n\n if (sortDirection === \"ASC\") {\n payload = sortASC;\n } else {\n payload = sortASC.reverse();\n }\n\n const selectAllItems = () => {\n dispatch(setSelectedObjectView(null));\n\n if (selectedObjects.length === payload.length) {\n setSelectedObjects([]);\n return;\n }\n\n const elements = payload.map((item) => item.name);\n setSelectedObjects(elements);\n };\n\n const downloadSelected = () => {\n if (selectedObjects.length !== 0) {\n let itemsToDownload: BucketObjectItem[] = [];\n\n const filterFunction = (currValue: BucketObjectItem) =>\n selectedObjects.includes(currValue.name);\n\n itemsToDownload = filteredRecords.filter(filterFunction);\n\n // I case just one element is selected, then we trigger download modal validation.\n // We are going to enforce zip download when multiple files are selected\n if (itemsToDownload.length === 1) {\n if (\n itemsToDownload[0].name.length > 200 &&\n getClientOS().toLowerCase().includes(\"win\")\n ) {\n setDownloadRenameModal(itemsToDownload[0]);\n return;\n }\n }\n\n itemsToDownload.forEach((filteredItem) => {\n downloadObject(filteredItem);\n });\n }\n };\n let uploadPath = [bucketName];\n if (currentPath.length > 0) {\n uploadPath = uploadPath.concat(currentPath);\n }\n\n const onClosePanel = (forceRefresh: boolean) => {\n dispatch(setSelectedObjectView(null));\n dispatch(setVersionsModeEnabled({ status: false }));\n if (detailsOpen && selectedInternalPaths !== null) {\n // We change URL to be the contained folder\n\n const decodedPath = decodeURLString(internalPaths);\n const splitURLS = decodedPath.split(\"/\");\n\n // We remove the last section of the URL as it should be a file\n splitURLS.pop();\n\n let URLItem = \"\";\n\n if (splitURLS && splitURLS.length > 0) {\n URLItem = `${splitURLS.join(\"/\")}/`;\n }\n\n navigate(`/buckets/${bucketName}/browse/${encodeURLString(URLItem)}`);\n }\n\n dispatch(setObjectDetailsView(false));\n setSelectedObjects([]);\n\n if (forceRefresh) {\n dispatch(setLoadingObjectsList(true));\n }\n };\n\n const setDeletedAction = () => {\n dispatch(setShowDeletedObjects(!showDeleted));\n onClosePanel(true);\n };\n\n const closeRenameModal = () => {\n setDownloadRenameModal(null);\n };\n\n const tableActions: ItemActions[] = [\n {\n type: \"view\",\n label: \"View\",\n onClick: openPath,\n sendOnlyId: true,\n },\n ];\n\n const multiActionButtons = [\n {\n action: downloadSelected,\n label: \"Download\",\n disabled: selectedObjects.length === 0,\n icon: ,\n tooltip: \"Download Selected\",\n },\n {\n action: openShare,\n label: \"Share\",\n disabled: selectedObjects.length !== 1 || !canShareFile,\n icon: ,\n tooltip: \"Share Selected File\",\n },\n {\n action: openPreview,\n label: \"Preview\",\n disabled: selectedObjects.length !== 1 || !canPreviewFile,\n icon: ,\n tooltip: \"Preview Selected File\",\n },\n {\n action: () => {\n setDeleteMultipleOpen(true);\n },\n label: \"Delete\",\n icon: ,\n disabled:\n !hasPermission(bucketName, [IAM_SCOPES.S3_DELETE_OBJECT]) ||\n selectedObjects.length === 0 ||\n !displayDeleteObject,\n tooltip: \"Delete Selected Files\",\n },\n ];\n\n return (\n \n {shareFileModalOpen && selectedPreview && (\n \n )}\n {deleteMultipleOpen && (\n \n )}\n {rewindSelect && (\n \n )}\n {previewOpen && (\n \n )}\n {!!downloadRenameModal && (\n \n )}\n \n \n \n \n \n }\n title={{bucketName} }\n subTitle={\n \n \n \n Created: \n