"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require('./../../ext-esm/tslib/tslib.es6.js'),s=require("react/jsx-runtime"),o=require("react-dropzone"),i=require("classnames"),r=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/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"),c=require("../Typography.js"),t=require("../Button/components/Button/index.js");require("moment-timezone"),require("@material-ui/core"),require("../Button/components/LiveButton/components/LiveButtonStateIndicator/index.js"),require("../Button/components/LiveButton/styles.js");var u=require("./styles.js"),a=require("./utils.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=l(i);exports.FilesDropzone=function(i){var l=i.multiple,m=i.children,j=i.accept,p=i.onDrop,q=i.className,x=i.maxFiles,I=i.maxSize,h=i.errorText,g=i.disabled,_=u.useStyles(),v=a.parseAccept(j),b=v.mimetypes,f=v.extensions,F=b.length||f.length?e.__assign({"*/*":f},Object.fromEntries(b.map((function(e){return[e,[]]})))):void 0,C=a.formatDescription(f,I),y=o.useDropzone({onDrop:p,multiple:l,accept:F,maxFiles:x,maxSize:I,disabled:g}),z=y.getRootProps,B=y.getInputProps,D=y.isDragActive;return s.jsxs("div",e.__assign({className:q},{children:[s.jsxs("div",e.__assign({},z(),{className:d.default(_.root,g&&_.disabled,D&&_.active)},{children:[s.jsx("input",e.__assign({},B())),m||s.jsxs(s.Fragment,{children:[s.jsx(r.FileAdditionOne,{size:24,className:_.icon}),s.jsx(c.Regular14,{children:"Drag & Drop your file here or"}),s.jsx(t,e.__assign({variation:"tertiary",size:"small",disabled:g,className:_.uploadButton},{children:"Choose file"}))]})]})),!h&&C&&s.jsx(c.Regular14,e.__assign({className:d.default(_.description,g&&_.disabled)},{children:C})),h&&s.jsxs(c.Regular14,e.__assign({className:_.error},{children:[s.jsx(n.CautionFilledCustomIcon,{size:20}),h]}))]}))};
