(self.webpackChunk_jupyterlab_git=self.webpackChunk_jupyterlab_git||[]).push([[176],{7453:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>b});var n=i(2122),o=i(9756),r=i(3349),a=i(1788),s=i(6271),h=(i(5697),!!document.documentElement.currentStyle),d={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},u=["letter-spacing","line-height","font-family","font-weight","font-size","font-style","tab-size","text-rendering","text-transform","width","text-indent","padding-top","padding-right","padding-bottom","padding-left","border-top-width","border-right-width","border-bottom-width","border-left-width","box-sizing"],l={},p=document.createElement("textarea"),g=function(e){Object.keys(d).forEach((function(t){e.style.setProperty(t,d[t],"important")}))};p.setAttribute("tab-index","-1"),p.setAttribute("aria-hidden","true"),g(p);var c=function(){},f=0,m=function(e){function t(t){var i;return(i=e.call(this,t)||this)._onRef=function(e){i._ref=e;var t=i.props.inputRef;"function"!=typeof t?t.current=e:t(e)},i._onChange=function(e){i._controlled||i._resizeComponent(),i.props.onChange(e,(0,r.Z)(i))},i._resizeComponent=function(e){void 0===e&&(e=c);var t=function(e,t,i,n,o){void 0===i&&(i=!1),void 0===n&&(n=null),void 0===o&&(o=null),null===p.parentNode&&document.body.appendChild(p);var r=function(e,t,i){if(void 0===i&&(i=!1),i&&l[t])return l[t];var n=window.getComputedStyle(e);if(null===n)return null;var o=u.reduce((function(e,t){return e[t]=n.getPropertyValue(t),e}),{}),r=o["box-sizing"];if(""===r)return null;h&&"border-box"===r&&(o.width=parseFloat(o.width)+parseFloat(n["border-right-width"])+parseFloat(n["border-left-width"])+parseFloat(n["padding-right"])+parseFloat(n["padding-left"])+"px");var a={sizingStyle:o,paddingSize:parseFloat(o["padding-bottom"])+parseFloat(o["padding-top"]),borderSize:parseFloat(o["border-bottom-width"])+parseFloat(o["border-top-width"]),boxSizing:r};return i&&(l[t]=a),a}(e,t,i);if(null===r)return null;var a=r.paddingSize,s=r.borderSize,d=r.boxSizing,c=r.sizingStyle;Object.keys(c).forEach((function(e){p.style[e]=c[e]})),g(p),p.value=e.value||e.placeholder||"x";var f=-1/0,m=1/0,b=p.scrollHeight;"border-box"===d?b+=s:"content-box"===d&&(b-=a),p.value="x";var v=p.scrollHeight-a,w=Math.floor(b/v);return null!==n&&(f=v*n,"border-box"===d&&(f=f+a+s),b=Math.max(f,b)),null!==o&&(m=v*o,"border-box"===d&&(m=m+a+s),b=Math.min(m,b)),{height:b,minHeight:f,maxHeight:m,rowCount:Math.floor(b/v),valueRowCount:w}}(i._ref,i._uid,i.props.useCacheForDOMMeasurements,i.props.minRows,i.props.maxRows);if(null!==t){var n=t.height,o=t.minHeight,r=t.maxHeight,a=t.rowCount,s=t.valueRowCount;i.rowCount=a,i.valueRowCount=s,i.state.height===n&&i.state.minHeight===o&&i.state.maxHeight===r?e():i.setState({height:n,minHeight:o,maxHeight:r},e)}else e()},i.state={height:t.style&&t.style.height||0,minHeight:-1/0,maxHeight:1/0},i._uid=f++,i._controlled=void 0!==t.value,i._resizeLock=!1,i}(0,a.Z)(t,e);var i=t.prototype;return i.render=function(){var e=this.props,t=(e.inputRef,e.maxRows,e.minRows,e.onHeightChange,e.useCacheForDOMMeasurements,(0,o.Z)(e,["inputRef","maxRows","minRows","onHeightChange","useCacheForDOMMeasurements"]));return t.style=(0,n.Z)({},t.style,{height:this.state.height}),Math.max(t.style.maxHeight||1/0,this.state.maxHeight)<this.state.height&&(t.style.overflow="hidden"),(0,s.createElement)("textarea",(0,n.Z)({},t,{onChange:this._onChange,ref:this._onRef}))},i.componentDidMount=function(){var e=this;this._resizeComponent(),this._resizeListener=function(){e._resizeLock||(e._resizeLock=!0,e._resizeComponent((function(){e._resizeLock=!1})))},window.addEventListener("resize",this._resizeListener)},i.componentDidUpdate=function(e,t){e!==this.props&&this._resizeComponent(),this.state.height!==t.height&&this.props.onHeightChange(this.state.height,this)},i.componentWillUnmount=function(){window.removeEventListener("resize",this._resizeListener),function(e){delete l[e]}(this._uid)},t}(s.Component);m.defaultProps={inputRef:c,onChange:c,onHeightChange:c,useCacheForDOMMeasurements:!1};const b=m}}]);