import{__assign as o}from'./../../ext-esm/tslib/tslib.es6.js';import{jsxs as s,jsx as i,Fragment as c}from"react/jsx-runtime";import{useDropzone as n}from"react-dropzone";import t from"classnames";import{FileAdditionOne as e}from"../../icons/iconParkIcons.js";import"../../icons/customIcons/icons/AddMessage.js";import"../../icons/customIcons/icons/Attention.js";import"../../icons/customIcons/icons/Collapse.js";import"../../icons/customIcons/icons/Dashboard.js";import"../../icons/customIcons/icons/Expand.js";import"../../icons/customIcons/icons/FolderClosed.js";import"../../icons/customIcons/icons/FolderClosedFilled.js";import"../../icons/customIcons/icons/FolderOpened.js";import"../../icons/customIcons/icons/GreaterOrEqual.js";import"../../icons/customIcons/icons/LessOrEqual.js";import"../../icons/customIcons/icons/Search.js";import"../../icons/customIcons/icons/Wellhub.js";import"../../icons/customIcons/icons/MultiRuler.js";import"../../icons/customIcons/icons/Checkbox.js";import"../../icons/customIcons/icons/CheckboxChecked.js";import"../../icons/customIcons/icons/CheckboxIndeterminate.js";import"../../icons/customIcons/icons/Radio.js";import"../../icons/customIcons/icons/RadioChecked.js";import"../../icons/customIcons/icons/SimulFrac.js";import"../../icons/customIcons/icons/ZipperFrac.js";import{CautionFilledCustomIcon as r}from"../../icons/customIcons/icons/CautionFilled.js";import"../../icons/customIcons/icons/MoreApp.js";import{Regular14 as m}from"../Typography.js";import p from"../Button/components/Button/index.js";import"moment-timezone";import"@material-ui/core";import"../Button/components/LiveButton/components/LiveButtonStateIndicator/index.js";import"../Button/components/LiveButton/styles.js";import{useStyles as a}from"./styles.js";import{parseAccept as l,formatDescription as u}from"./utils.js";var d=function(d){var j=d.multiple,I=d.children,h=d.accept,f=d.onDrop,x=d.className,b=d.maxFiles,v=d.maxSize,C=d.errorText,F=d.disabled,g=a(),B=l(h),y=B.mimetypes,z=B.extensions,N=y.length||z.length?o({"*/*":z},Object.fromEntries(y.map((function(o){return[o,[]]})))):void 0,k=u(z,v),D=n({onDrop:f,multiple:j,accept:N,maxFiles:b,maxSize:v,disabled:F}),S=D.getRootProps,A=D.getInputProps,E=D.isDragActive;return s("div",{className:x,children:[s("div",o({},S(),{className:t(g.root,F&&g.disabled,E&&g.active),children:[i("input",o({},A())),I||s(c,{children:[i(e,{size:24,className:g.icon}),i(m,{children:"Drag & Drop your file here or"}),i(p,{variation:"tertiary",size:"small",disabled:F,className:g.uploadButton,children:"Choose file"})]})]})),!C&&k&&i(m,{className:t(g.description,F&&g.disabled),children:k}),C&&s(m,{className:g.error,children:[i(r,{size:20}),C]})]})};export{d as FilesDropzone};
