"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var s=require("react/jsx-runtime"),e=require("classnames"),o=require("@material-ui/core"),r=require("../FileIcon/FileIcon.js"),c=require("../IconButton/index.js"),i=require("../../icons/iconParkIcons.js");require("../../icons/customIcons/icons/AddMessage.js"),require("../../icons/customIcons/icons/Attention.js"),require("../../icons/customIcons/icons/Collapse.js"),require("../../icons/customIcons/icons/Dashboard.js"),require("../../icons/customIcons/icons/Expand.js"),require("../../icons/customIcons/icons/FolderClosed.js"),require("../../icons/customIcons/icons/FolderClosedFilled.js"),require("../../icons/customIcons/icons/FolderOpened.js"),require("../../icons/customIcons/icons/GreaterOrEqual.js"),require("../../icons/customIcons/icons/LessOrEqual.js"),require("../../icons/customIcons/icons/Search.js"),require("../../icons/customIcons/icons/Wellhub.js"),require("../../icons/customIcons/icons/MultiRuler.js"),require("../../icons/customIcons/icons/Checkbox.js"),require("../../icons/customIcons/icons/CheckboxChecked.js"),require("../../icons/customIcons/icons/CheckboxIndeterminate.js"),require("../../icons/customIcons/icons/Radio.js"),require("../../icons/customIcons/icons/RadioChecked.js"),require("../../icons/customIcons/icons/SimulFrac.js"),require("../../icons/customIcons/icons/ZipperFrac.js");var n=require("../../icons/customIcons/icons/CautionFilled.js");require("../../icons/customIcons/icons/MoreApp.js");var t=require("../MiddleTruncatedText/MiddleTruncatedText.js"),l=require("../Typography.js"),u=require("./utils.js"),a=require("./styles.js");function d(s){return s&&"object"==typeof s&&"default"in s?s:{default:s}}var j=d(e);exports.FilesLoaderV2=function(e){var d=e.formatProgress,m=void 0===d?u.formatSizeProgress:d,q=e.className,x=e.name,I=e.current,h=e.total,p=e.errorText,C=e.onCancel,F=e.onReload,g=e.onDelete,v=a.useStyles(),R=h>=0&&I>=0,T=Math.min(100,Math.ceil(I/h*100)),k=I>=h;return s.jsxs("div",{className:j.default(v.root,q),children:[s.jsx(r.FileIcon,{name:x,className:v.icon,strokeWidth:2}),s.jsxs("div",{className:v.content,children:[s.jsx(l.Regular14,{className:v.name,children:s.jsx(t.MiddleTruncatedText,{children:x},x)}),!p&&!k&&s.jsxs(s.Fragment,{children:[s.jsx(o.LinearProgress,{className:v.progressBar,variant:R?"determinate":void 0,value:T}),s.jsxs("div",{className:v.progressTextContainer,children:[s.jsx(l.Regular12,{className:v.progressText,children:m(h,I)}),R&&s.jsxs(l.Regular12,{className:v.progressText,children:[T,"%"]})]})]}),p&&s.jsxs(l.Regular14,{className:v.error,children:[s.jsx(n.CautionFilledCustomIcon,{size:16}),p]})]}),C&&!p&&!k&&s.jsx(c,{onClick:C,size:"small",tooltipProps:{title:"Cancel"},children:s.jsx(i.CloseIcon,{})}),g&&(p||k)&&s.jsx(c,{onClick:g,size:"small",tooltipProps:{title:"Remove File"},children:s.jsx(i.DeleteFourIcon,{})}),F&&p&&s.jsx(c,{onClick:F,size:"small",tooltipProps:{title:"Reload"},children:s.jsx(i.RedoIcon,{})})]})};
