text: 'use strict';(function(c){"object"==typeof exports&&"object"==typeof module?c(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],c):c(CodeMirror)})(function(c){function l(a,b,e){function g(f){var h=c.wheelEventPixels(f)["horizontal"==d.orientation?"x":"y"],m=d.pos;d.moveTo(d.pos+h);d.pos!=m&&c.e_preventDefault(f)}this.orientation=b;this.scroll=e;this.screen=this.total=this.size=1;this.pos=0;this.node=document.createElement("div");this.node.className=
  a+"-"+b;this.inner=this.node.appendChild(document.createElement("div"));var d=this;c.on(this.inner,"mousedown",function(f){function h(){c.off(document,"mousemove",m);c.off(document,"mouseup",h)}function m(n){if(1!=n.which)return h();d.moveTo(q+d.total/d.size*(n[p]-r))}if(1==f.which){c.e_preventDefault(f);var p="horizontal"==d.orientation?"pageX":"pageY",r=f[p],q=d.pos;c.on(document,"mousemove",m);c.on(document,"mouseup",h)}});c.on(this.node,"click",function(f){c.e_preventDefault(f);var h=d.inner.getBoundingClientRect();
  d.moveTo(d.pos+("horizontal"==d.orientation?f.clientX<h.left?-1:f.clientX>h.right?1:0:f.clientY<h.top?-1:f.clientY>h.bottom?1:0)*d.screen)});c.on(this.node,"mousewheel",g);c.on(this.node,"DOMMouseScroll",g)}function k(a,b,e){this.addClass=a;this.horiz=new l(a,"horizontal",e);b(this.horiz.node);this.vert=new l(a,"vertical",e);b(this.vert.node);this.width=null}l.prototype.setPos=function(a,b){0>a&&(a=0);a>this.total-this.screen&&(a=this.total-this.screen);if(!b&&a==this.pos)return!1;this.pos=a;this.inner.style["horizontal"==
  this.orientation?"left":"top"]=this.size/this.total*a+"px";return!0};l.prototype.moveTo=function(a){this.setPos(a)&&this.scroll(a,this.orientation)};l.prototype.update=function(a,b,e){var g=this.screen!=b||this.total!=a||this.size!=e;g&&(this.screen=b,this.total=a,this.size=e);a=this.size/this.total*this.screen;10>a&&(this.size-=10-a,a=10);this.inner.style["horizontal"==this.orientation?"width":"height"]=a+"px";this.setPos(this.pos,g)};k.prototype.update=function(a){if(null==this.width){var b=window.getComputedStyle?
  window.getComputedStyle(this.horiz.node):this.horiz.node.currentStyle;b&&(this.width=parseInt(b.height))}b=this.width||0;var e=a.scrollWidth>a.clientWidth+1,g=a.scrollHeight>a.clientHeight+1;this.vert.node.style.display=g?"block":"none";this.horiz.node.style.display=e?"block":"none";g&&(this.vert.update(a.scrollHeight,a.clientHeight,a.viewHeight-(e?b:0)),this.vert.node.style.bottom=e?b+"px":"0");e&&(this.horiz.update(a.scrollWidth,a.clientWidth,a.viewWidth-(g?b:0)-a.barLeft),this.horiz.node.style.right=
  g?b+"px":"0",this.horiz.node.style.left=a.barLeft+"px");return{right:g?b:0,bottom:e?b:0}};k.prototype.setScrollTop=function(a){this.vert.setPos(a)};k.prototype.setScrollLeft=function(a){this.horiz.setPos(a)};k.prototype.clear=function(){var a=this.horiz.node.parentNode;a.removeChild(this.horiz.node);a.removeChild(this.vert.node)};c.scrollbarModel.simple=function(a,b){return new k("CodeMirror-simplescroll",a,b)};c.scrollbarModel.overlay=function(a,b){return new k("CodeMirror-overlayscroll",a,b)}});
  