tinymce.PluginManager.add("autoresize",function(e){function t(i){var a,s,g,r,m,u,l,h,_=tinymce.DOM;s=e.getDoc(),s&&(g=s.body,r=s.documentElement,m=n.autoresize_min_height,!g||i&&"setcontent"===i.type&&i.initial||e.plugins.fullscreen&&e.plugins.fullscreen.isFullscreen()||(l=e.dom.getStyle(g,"margin-top",!0),h=e.dom.getStyle(g,"margin-bottom",!0),u=g.offsetHeight+parseInt(l,10)+parseInt(h,10),(isNaN(u)||0>=u)&&(u=tinymce.Env.ie?g.scrollHeight:tinymce.Env.webkit&&0===g.clientHeight?0:g.offsetHeight),u>n.autoresize_min_height&&(m=u),n.autoresize_max_height&&u>n.autoresize_max_height?(m=n.autoresize_max_height,g.style.overflowY="auto",r.style.overflowY="auto"):(g.style.overflowY="hidden",r.style.overflowY="hidden",g.scrollTop=0),m!==o&&(a=m-o,_.setStyle(_.get(e.id+"_ifr"),"height",m+"px"),o=m,tinymce.isWebKit&&0>a&&t(i))))}function i(e,n,o){setTimeout(function(){t({}),e--?i(e,n,o):o&&o()},n)}var n=e.settings,o=0;e.settings.inline||(n.autoresize_min_height=parseInt(e.getParam("autoresize_min_height",e.getElement().offsetHeight),10),n.autoresize_max_height=parseInt(e.getParam("autoresize_max_height",0),10),e.on("init",function(){var t=e.getParam("autoresize_overflow_padding",1);e.dom.setStyles(e.getBody(),{paddingBottom:e.getParam("autoresize_bottom_margin",50),paddingLeft:t,paddingRight:t})}),e.on("change setcontent paste keyup",t),e.getParam("autoresize_on_init",!0)&&e.on("init",function(){i(20,100,function(){i(5,1e3)})}),e.addCommand("mceAutoResize",t))});