"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/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 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 m=l(i);exports.FilesDropzone=function(i){var l=i.multiple,d=i.children,j=i.accept,p=i.onDrop,q=i.className,I=i.maxFiles,x=i.maxSize,h=i.errorText,v=i.disabled,b=u.useStyles(),g=a.parseAccept(j),f=g.mimetypes,F=g.extensions,C=f.length||F.length?e.__assign({"*/*":F},Object.fromEntries(f.map((function(e){return[e,[]]})))):void 0,y=a.formatDescription(F,x),z=o.useDropzone({onDrop:p,multiple:l,accept:C,maxFiles:I,maxSize:x,disabled:v}),D=z.getRootProps,_=z.getInputProps,B=z.isDragActive;return s.jsxs("div",{className:q,children:[s.jsxs("div",e.__assign({},D(),{className:m.default(b.root,v&&b.disabled,B&&b.active),children:[s.jsx("input",e.__assign({},_())),d||s.jsxs(s.Fragment,{children:[s.jsx(r.FileAdditionOne,{size:24,className:b.icon}),s.jsx(c.Regular14,{children:"Drag & Drop your file here or"}),s.jsx(t,{variation:"tertiary",size:"small",disabled:v,className:b.uploadButton,children:"Choose file"})]})]})),!h&&y&&s.jsx(c.Regular14,{className:m.default(b.description,v&&b.disabled),children:y}),h&&s.jsxs(c.Regular14,{className:b.error,children:[s.jsx(n.CautionFilledCustomIcon,{size:20}),h]})]})};
