(function(){var h={default:!0};window.MirrorFrame=function(b,a,c,e,f){CodeMirror.I18N=CodeMirror.I18N||{getMessage:f};f=document.createElement("div");f.setAttribute("class","CodeMirror-editor");f.setAttribute("style","font-size:"+((a.fontSize||100)/100).toFixed(2)+"em;");b.appendChild(f);var l={nextTheme:function(){if(a.themeOptions){var g=a.themeOptions.all,b=g.indexOf(a.theme||"default")||0;++b>=g.length&&(b=0);g=a.theme=g[b];k(g);if(a.themeOptions.onChange)a.themeOptions.onChange(g)}}};a.theme=
a.theme||"default";var d=new CodeMirror(f,a);this.mirror=d;Object.keys(l).forEach(function(a){d.setCommand(a,l[a])});c&&Object.keys(c).forEach(function(a){d.setCommand(a,c[a])});e&&Object.keys(e).forEach(function(a){d.on(a,e[a])});this.refresh=function(){d.refresh.call(d)};var k=function(a){"default"==a&&-1!=document.documentElement.getAttribute("class").split(" ").indexOf("dark")&&(a="monokai");h[a]||(h[a]=!0,rea.page.addStyle(rea.extension.getURL("vendor/cm/theme/"+a.replace(/[^a-zA-Z0-9\.-]/g,
"")+".css")));d.setOption("theme",a)};k(a.theme)};var e={jump:function(b){var a=prompt(CodeMirror.I18N.getMessage("Jump_to_line"),"");a&&!isNaN(Number(a-1))&&b.setCursor(Number(a-1));b.focus()},macro:function(b){var a=prompt(CodeMirror.I18N.getMessage("Insert_constructor")+":","");a&&b.replaceSelection("function "+a+"() {\n  \n}\n\n"+a+".prototype = {\n  \n};\n")},reindentall:function(b){for(var a=0;a<=b.lineCount();a++)b.indentLine(a,"smart")}},c;for(c in e)e.hasOwnProperty(c)&&(CodeMirror.commands[c]=
e[c])})();
