!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(i){"use strict";function r(e,t){clearTimeout(t.timeout),i.off(window,"mouseup",t.hurry),i.off(window,"keyup",t.hurry)}i.defineOption("autoRefresh",!1,function(e,t){e.state.autoRefresh&&(r(e,e.state.autoRefresh),e.state.autoRefresh=null),t&&0==e.display.wrapper.offsetHeight&&function(e,t){function o(){e.display.wrapper.offsetHeight?(r(e,t),e.display.lastWrapHeight!=e.display.wrapper.clientHeight&&e.refresh()):t.timeout=setTimeout(o,t.delay)}t.timeout=setTimeout(o,t.delay),t.hurry=function(){clearTimeout(t.timeout),t.timeout=setTimeout(o,50)},i.on(window,"mouseup",t.hurry),i.on(window,"keyup",t.hurry)}(e,e.state.autoRefresh={delay:t.delay||250})})});