"use strict";var e=require('./../../ext-esm/tslib/tslib.es6.js'),i=require("react/jsx-runtime"),t=require("react"),r=require("@material-ui/core");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=s(require("classnames")),a=r.makeStyles({root:function(i){var t=i.maxLines;return e.__assign({overflow:"hidden"},t?{display:"-webkit-box","-webkit-line-clamp":t,"-webkit-box-orient":"vertical"}:{whiteSpace:"nowrap",textOverflow:"ellipsis"})}});module.exports=function(s){var o=s.children,n=s.className,c=void 0===n?"":n,u=s.maxLines,d=void 0===u?null:u,f=s.showTooltip,m=void 0===f||f,v=e.__rest(s,["children","className","maxLines","showTooltip"]),h=t.useState(!1),x=h[0],p=h[1],w=t.useRef(),_=a({maxLines:d});t.useEffect((function(){var e=w.current,i=e.scrollWidth,t=e.clientWidth,r=e.scrollHeight,s=e.clientHeight;p(d?r>s:i>t)}));var b=i.jsx("div",e.__assign({className:l.default(_.root,c),ref:w},v,{children:o}));return x&&m?i.jsx(r.Tooltip,e.__assign({title:o},{children:b})):b};
