"use strict";var e=require("@babel/runtime/helpers/slicedToArray"),o=require("react"),s=require("classnames"),r=require("prop-types"),t=require("@material-ui/core"),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"),require("../../icons/customIcons/icons/CautionFilled.js"),require("../../icons/customIcons/icons/MoreApp.js");var c=require("../../utils/main.js"),n=require("react/jsx-runtime");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=u(e),l=u(s),p=u(r),d=t.makeStyles((function(e){return{iconWrapper:{color:e.palette.primary.text6,cursor:"pointer",paddingLeft:4,display:"flex",alignItems:"center","&:hover":{color:e.palette.primary.contrastText}},tooltip:{color:e.palette.primary.text6,backgroundColor:"rgba(20, 20, 20, 0.5)"}}})),m=function(e){var s=e.children,r=e.classes,i=e.dataTestId,u=e.IconComponent,p=e.tooltipProps,m=o.useState(!1),f=a.default(m,2),q=f[0],I=f[1],j=d();return o.useEffect((function(){var e=setTimeout((function(){I(!1)}),p.delay);return function(){return clearTimeout(e)}}),[q]),n.jsx(t.Tooltip,{classes:{tooltip:l.default(j.tooltip,r.tooltip),popper:l.default(j.tooltipPopper,r.tooltipPopper)},title:p.title,open:q,disableFocusListener:!0,disableHoverListener:!0,placement:p.placement,children:n.jsx("span",{className:l.default(j.iconWrapper,r.iconWrapper),onClick:function(){I(!0),c.copyToClipboard(s)},children:n.jsx(u,{className:r.icon,"data-testid":i})})})};m.propTypes={children:p.default.string.isRequired,dataTestId:p.default.string,IconComponent:p.default.shape({}),tooltipProps:p.default.shape({title:p.default.string,placement:p.default.string,delay:p.default.number}),classes:p.default.shape({root:p.default.string,icon:p.default.string,iconWrapper:p.default.string,tooltip:p.default.string,tooltipPopper:p.default.string})},m.defaultProps={dataTestId:null,IconComponent:function(){return n.jsx(i.CopyIcon,{size:16})},tooltipProps:{title:"Copied",placement:"bottom",delay:1500},classes:{}},module.exports=m;
