"use strict";var t=require('./../../ext-esm/tslib/tslib.es6.js'),a=require("react/jsx-runtime"),r=require("prop-types"),o=require("classnames"),e=require("@material-ui/core"),i=require("react");function l(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var n=l(r),s=l(o),d=e.makeStyles((function(t){return{root:{borderRadius:"8px !important",color:t.palette.primary.text6,padding:6,"&:hover":{color:"#FFFFFF",backgroundColor:"rgba(255, 255, 255, 0.16)",backdropFilter:"blur(2px)","&.MuiIconButton-colorPrimary":{color:t.palette.primary.light}},"&:active":{color:"#FFFFFF","&.MuiIconButton-colorPrimary":{color:t.palette.primary.light}},"&.Mui-disabled":{pointerEvents:"all",opacity:.4,color:"#FFFFFF",backgroundColor:"transparent","&.MuiIconButton-colorPrimary":{color:t.palette.primary.main}},"& .MuiSvgIcon-root":{color:"inherit",fontSize:"inherit"},"& .MuiTouchRipple-child":{borderRadius:8,backgroundColor:"rgba(255, 255, 255, 0.16)"}},colorPrimary:{color:t.palette.primary.main},sizeSmall:{fontSize:20,padding:6,height:32,width:32,"& .i-icon, & .i-icon > svg":{width:20,height:20}},sizeLarge:{"&.MuiButtonBase-root":{padding:8}},contained:{backgroundColor:"rgba(255, 255, 255, 0.08)",backdropFilter:"blur(2px)","&:hover":{backgroundColor:"rgba(255, 255, 255, 0.16)"}},containedDisabled:{"&.MuiButtonBase-root":{backgroundColor:"rgba(255, 255, 255, 0.08)"}},transparent:{color:t.palette.primary.contrastText,backgroundColor:"rgba(255, 255, 255, 0.2)","&:hover":{backgroundColor:"rgba(255, 255, 255, 0.1)"}},transparentDisabled:{"&.MuiButtonBase-root":{backgroundColor:"rgba(255, 255, 255, 0.1)"}},tooltipPopper:{"& .MuiTooltip-tooltip":{backgroundColor:function(a){return"transparent"===a.variant?"rgba(255, 255, 255, 0.2)":t.palette.background.b9}}},active:{"&.MuiButtonBase-root":{color:t.palette.primary.main,backgroundColor:"rgba(255, 255, 255, 0.12)","&.MuiIconButton-colorPrimary":{color:t.palette.primary.main},"&.transparent":{color:t.palette.primary.contrastText,backgroundColor:"rgba(255, 255, 255, 0.2)"}}}}})),c=function(r){var o,l,n,c,u,p=r.tooltipProps,g=void 0===p?{title:"",classes:{}}:p,b=r.isActive,m=r.className,f=t.__rest(r,["tooltipProps","isActive","className"]),v=f.size,y=f.variant,F=f.classes,h=void 0===F?{}:F,P=f["data-testid"],_=d({variant:y}),k=i.useState(!1),B=k[0],z=k[1],C=t.__assign(t.__assign({},h),{root:s.default(h.root,_.root,(o={},o[_.sizeLarge]="large"===v,o[_.contained]="contained"===y,o[_.transparent]="transparent"===y,o)),disabled:s.default(h.disabled,(l={},l[_.containedDisabled]="contained"===y,l[_.transparentDisabled]="transparent"===y,l)),colorPrimary:s.default(h.colorPrimary,_.colorPrimary),sizeSmall:s.default(h.sizeSmall,_.sizeSmall)});return g.title?a.jsx(e.Tooltip,t.__assign({open:B},g,{classes:t.__assign(t.__assign({},g.classes),{popper:s.default(_.tooltipPopper,null===(u=g.classes)||void 0===u?void 0:u.popper)})},{children:a.jsx(e.IconButton,t.__assign({"data-testid":"".concat(P,"_").concat(g.title),classes:C,className:s.default(m,(n={},n[_.active]=b,n),y),onPointerOver:function(){return z(!0)},onPointerOut:function(){return z(!1)}},f))})):a.jsx(e.IconButton,t.__assign({"data-testid":P,classes:C,className:s.default(m,(c={},c[_.active]=b,c),y)},f))},u={isActive:n.default.bool,size:n.default.oneOf(["small","medium","large"]),variant:n.default.oneOf(["default","contained","transparent"]),tooltipProps:n.default.shape({title:n.default.node,classes:n.default.shape({popper:n.default.string})}),classes:n.default.shape({root:n.default.string,disabled:n.default.string,colorPrimary:n.default.string,sizeSmall:n.default.string}),disabled:n.default.bool,"data-testid":n.default.string};c.propTypes=u,c.defaultProps={isActive:!1,size:"medium",variant:"default",tooltipProps:{title:""},disabled:!1,"data-testid":"IconButton"},module.exports=c;
