text: !function(e,t){if("function"==typeof define&&define.amd)define(["exports","module"],t);else if("undefined"!=typeof exports&&"undefined"!=typeof module)t(exports,module);else{var n={exports:{}};t(n.exports,n),e.autosize=n.exports}}(this,function(e,t){"use strict";function n(r){function i(e){var t=r.style.width;r.style.width="0px",r.offsetWidth,r.style.width=t,r.style.overflowY=e}function d(){var e=r.style.height,t=function(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}(r),n=document.documentElement&&document.documentElement.scrollTop;r.style.height="";var o=r.scrollHeight+l;return 0===r.scrollHeight?void(r.style.height=e):(r.style.height=o+"px",s=r.clientWidth,t.forEach(function(e){e.node.scrollTop=e.scrollTop}),void(n&&(document.documentElement.scrollTop=n)))}function e(){d();var e=Math.round(parseFloat(r.style.height)),t=window.getComputedStyle(r,null),n="content-box"===t.boxSizing?Math.round(parseFloat(t.height)):r.offsetHeight;if(n!==e?"hidden"===t.overflowY&&(i("scroll"),d(),n="content-box"===t.boxSizing?Math.round(parseFloat(window.getComputedStyle(r,null).height)):r.offsetHeight):"hidden"!==t.overflowY&&(i("hidden"),d(),n="content-box"===t.boxSizing?Math.round(parseFloat(window.getComputedStyle(r,null).height)):r.offsetHeight),u!==n){u=n;var o=p("autosize:resized");try{r.dispatchEvent(o)}catch(e){}}}if(r&&r.nodeName&&"TEXTAREA"===r.nodeName&&!a.has(r)){var l=null,s=r.clientWidth,u=null,n=function(){r.clientWidth!==s&&e()},o=function(t){window.removeEventListener("resize",n,!1),r.removeEventListener("input",e,!1),r.removeEventListener("keyup",e,!1),r.removeEventListener("autosize:destroy",o,!1),r.removeEventListener("autosize:update",e,!1),Object.keys(t).forEach(function(e){r.style[e]=t[e]}),a.delete(r)}.bind(r,{height:r.style.height,resize:r.style.resize,overflowY:r.style.overflowY,overflowX:r.style.overflowX,wordWrap:r.style.wordWrap});r.addEventListener("autosize:destroy",o,!1),"onpropertychange"in r&&"oninput"in r&&r.addEventListener("keyup",e,!1),window.addEventListener("resize",n,!1),r.addEventListener("input",e,!1),r.addEventListener("autosize:update",e,!1),r.style.overflowX="hidden",r.style.wordWrap="break-word",a.set(r,{destroy:o,update:e}),"vertical"===(t=window.getComputedStyle(r,null)).resize?r.style.resize="none":"both"===t.resize&&(r.style.resize="horizontal"),l="content-box"===t.boxSizing?-(parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)):parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth),isNaN(l)&&(l=0),e()}var t}function o(e){var t=a.get(e);t&&t.destroy()}function r(e){var t=a.get(e);t&&t.update()}var i,d,a="function"==typeof Map?new Map:(i=[],d=[],{has:function(e){return-1<i.indexOf(e)},get:function(e){return d[i.indexOf(e)]},set:function(e,t){-1===i.indexOf(e)&&(i.push(e),d.push(t))},delete:function(e){var t=i.indexOf(e);-1<t&&(i.splice(t,1),d.splice(t,1))}}),p=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){p=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}var l=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((l=function(e){return e}).destroy=function(e){return e},l.update=function(e){return e}):((l=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],function(e){return n(e)}),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],o),e},l.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],r),e}),t.exports=l});