(self["webpackJsonp@lyrio/ui"]=self["webpackJsonp@lyrio/ui"]||[]).push([[51],{1087:function(e,t,n){"use strict";var r=n(2),i=n(184),o=n(0),a=o.useLayoutEffect,u=function(e){var t=Object(o.useRef)(e);return a((function(){t.current=e})),t},d=function(e,t){"function"!==typeof e?e.current=t:e(t)},c=function(e,t){var n=Object(o.useRef)();return Object(o.useCallback)((function(r){e.current=r,n.current&&d(n.current,null),n.current=t,t&&d(t,r)}),[t])},l={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},s=function(e){Object.keys(l).forEach((function(t){e.style.setProperty(t,l[t],"important")}))},f=null;var h=function(){},b=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width"],p=!!document.documentElement.currentStyle,g=function(e,t){var n=e.cacheMeasurements,a=e.maxRows,d=e.minRows,l=e.onChange,g=void 0===l?h:l,v=e.onHeightChange,m=void 0===v?h:v,x=Object(i.a)(e,["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"]);var y=void 0!==x.value,S=Object(o.useRef)(null),w=c(S,t),z=Object(o.useRef)(0),R=Object(o.useRef)(),j=function(){var e=S.current,t=n&&R.current?R.current:function(e){var t=window.getComputedStyle(e);if(null===t)return null;var n,r=(n=t,b.reduce((function(e,t){return e[t]=n[t],e}),{})),i=r.boxSizing;return""===i?null:(p&&"border-box"===i&&(r.width=parseFloat(r.width)+parseFloat(r.borderRightWidth)+parseFloat(r.borderLeftWidth)+parseFloat(r.paddingRight)+parseFloat(r.paddingLeft)+"px"),{sizingStyle:r,paddingSize:parseFloat(r.paddingBottom)+parseFloat(r.paddingTop),borderSize:parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth)})}(e);if(t){R.current=t;var r=function(e,t,n,r){void 0===n&&(n=1),void 0===r&&(r=1/0),f||((f=document.createElement("textarea")).setAttribute("tab-index","-1"),f.setAttribute("aria-hidden","true"),s(f)),null===f.parentNode&&document.body.appendChild(f);var i=e.paddingSize,o=e.borderSize,a=e.sizingStyle,u=a.boxSizing;Object.keys(a).forEach((function(e){var t=e;f.style[t]=a[t]})),s(f),f.value=t;var d=function(e,t){var n=e.scrollHeight;return"border-box"===t.sizingStyle.boxSizing?n+t.borderSize:n-t.paddingSize}(f,e);f.value="x";var c=f.scrollHeight-i,l=c*n;"border-box"===u&&(l=l+i+o),d=Math.max(l,d);var h=c*r;return"border-box"===u&&(h=h+i+o),[d=Math.min(h,d),c]}(t,e.value||e.placeholder||"x",d,a),i=r[0],o=r[1];z.current!==i&&(z.current=i,e.style.setProperty("height",i+"px","important"),m(i,{rowHeight:o}))}};return Object(o.useLayoutEffect)(j),function(e){var t=u(e);Object(o.useEffect)((function(){var e=function(e){t.current(e)};return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[])}(j),Object(o.createElement)("textarea",Object(r.a)({},x,{onChange:function(e){y||j(),g(e)},ref:w}))},v=Object(o.forwardRef)(g);t.a=v}}]);
//# sourceMappingURL=51.2b4e0cda.chunk.js.map