import e from"@babel/runtime/helpers/slicedToArray";import r from"@babel/runtime/helpers/objectWithoutProperties";import t from"@babel/runtime/helpers/defineProperty";import{jsx as o}from"react/jsx-runtime";import{useState as i,useRef as n,useEffect as l}from"react";import{makeStyles as c,Tooltip as a}from"@material-ui/core";import s from"classnames";var p=["children","className","maxLines","showTooltip"];function m(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,o)}return t}function f(e){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?m(Object(o),!0).forEach((function(r){t(e,r,o[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):m(Object(o)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(o,r))}))}return e}var u=c({root:function(e){var r=e.maxLines;return f({overflow:"hidden"},r?{display:"-webkit-box","-webkit-line-clamp":r,"-webkit-box-orient":"vertical"}:{whiteSpace:"nowrap",textOverflow:"ellipsis"})}});function b(t){var c=t.children,m=t.className,b=void 0===m?"":m,h=t.maxLines,d=void 0===h?null:h,O=t.showTooltip,v=void 0===O||O,w=r(t,p),y=i(!1),j=e(y,2),P=j[0],g=j[1],x=n(null),k=u({maxLines:d});l((function(){if(x.current){var e=x.current,r=e.scrollWidth,t=e.clientWidth,o=e.scrollHeight,i=e.clientHeight;g(d?o>i:r>t)}}));var D=o("div",f(f({className:s(k.root,b),ref:x},w),{},{children:c}));return P&&v?o(a,{title:null!=c?c:"",children:D}):D}export{b as default};
//# sourceMappingURL=index.js.map
