"use strict";var r=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/slicedToArray"),e=require("@babel/runtime/helpers/objectWithoutProperties"),o=require("react/jsx-runtime"),a=require("classnames"),i=require("@material-ui/core"),n=require("react");function l(r){return r&&"object"==typeof r&&"default"in r?r:{default:r}}var c=l(r),s=l(t),u=l(e),d=l(a),p=["tooltipProps","isActive","size","variant","className","data-testid"];function b(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))),e.push.apply(e,o)}return e}function f(r){for(var t=1;t<arguments.length;t++){var e=null!=arguments[t]?arguments[t]:{};t%2?b(Object(e),!0).forEach((function(t){c.default(r,t,e[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(e)):b(Object(e)).forEach((function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(e,t))}))}return r}var m=i.makeStyles((function(r){var t=r.palette,e=t.primary.text1||"#fff",o={b08:i.fade(e,.08),b010:i.fade(e,.1),b012:i.fade(e,.12),b016:i.fade(e,.16),b020:i.fade(e,.2)};return{root:{borderRadius:"8px !important",color:t.primary.text6,padding:6,"&:hover":{color:e,backgroundColor:o.b016,backdropFilter:"blur(2px)","&.MuiIconButton-colorPrimary":{color:t.primary.light}},"&:active":{color:e,"&.MuiIconButton-colorPrimary":{color:t.primary.light}},"&.Mui-disabled":{pointerEvents:"all",opacity:.4,color:t.primary.text1,backgroundColor:"transparent","&.MuiIconButton-colorPrimary":{color:t.primary.main}},"& .MuiSvgIcon-root":{color:"inherit",fontSize:"inherit"}},colorPrimary:{color:t.primary.main},sizeSmall:{fontSize:20,padding:6,height:32,width:32,"& .i-icon, & .i-icon > svg":{width:"20px !important",height:"20px !important"}},sizeLarge:{"&.MuiButtonBase-root":{padding:8}},contained:{backgroundColor:o.b08,backdropFilter:"blur(2px)","&:hover":{backgroundColor:o.b016}},containedDisabled:{"&.MuiButtonBase-root":{backgroundColor:o.b08}},transparent:{color:t.primary.contrastText,backgroundColor:o.b020,"&:hover":{backgroundColor:o.b010}},transparentDisabled:{"&.MuiButtonBase-root":{backgroundColor:o.b010}},tooltipPopper:{"& .MuiTooltip-tooltip":{backgroundColor:function(r){return"transparent"===r.variant?o.b020:t.background.b10}}},active:{"&.MuiButtonBase-root":{color:t.primary.main,backgroundColor:o.b012,"&.MuiIconButton-colorPrimary":{color:t.primary.main},"&.transparent":{color:t.primary.contrastText,backgroundColor:o.b020}}}}})),y={center:!1};module.exports=function(r){var t,e,a,l=r.tooltipProps,b=void 0===l?{title:"",classes:{}}:l,v=r.isActive,g=void 0!==v&&v,P=r.size,h=void 0===P?"medium":P,O=r.variant,j=void 0===O?"default":O,k=r.className,x=r["data-testid"],B=void 0===x?"IconButton":x,z=u.default(r,p),C=z.classes,M=void 0===C?{}:C,S=m({variant:j}),w=n.useState(!1),D=s.default(w,2),I=D[0],q=D[1],T=f(f({},M),{},{root:d.default(M.root,S.root,(t={},c.default(t,S.sizeLarge,"large"===h),c.default(t,S.contained,"contained"===j),c.default(t,S.transparent,"transparent"===j),t)),disabled:d.default(M.disabled,(e={},c.default(e,S.containedDisabled,"contained"===j),c.default(e,S.transparentDisabled,"transparent"===j),e)),colorPrimary:d.default(M.colorPrimary,S.colorPrimary),sizeSmall:d.default(M.sizeSmall,S.sizeSmall)});return b.title?o.jsx(i.Tooltip,f(f({open:I},b),{},{classes:f(f({},b.classes),{},{popper:d.default(S.tooltipPopper,null===(a=b.classes)||void 0===a?void 0:a.popper)}),children:o.jsx(i.IconButton,f({"data-testid":B,classes:T,className:d.default(k,c.default({},S.active,g),j),onPointerOver:function(){return q(!0)},onPointerOut:function(){return q(!1)},size:h,TouchRippleProps:y},z))})):o.jsx(i.IconButton,f({"data-testid":B,classes:T,className:d.default(k,c.default({},S.active,g),j),size:h,TouchRippleProps:y},z))};
//# sourceMappingURL=index.js.map
